Commit ca5b3185 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Merge branch 'spartan' into hm/notifications-roles

parents 3491b15c 0e69679d
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ Configuration de l'authentification

```php
<?php
// config/autoload/local.php
// config/autoload/unicaen-auth.local.php
$settings = array(
    // Authentification via LDAP/BDD
    'local' => [
+6 −4
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@
                                <div class="col-md-4">
                                    <select v-model="confirmProccess.personRole" class="form-control" id="roleDeclarer">
                                        <option value="0">Ne pas affecter à l'activité</option>
                                        <option v-for="r, id in rolesPerson" :value="id">{{ r }}</option>
                                        <option v-for="(r, id) in rolesPerson" :value="id">{{ r }}</option>
                                    </select>
                                </div>
                            </section>
@@ -47,7 +47,7 @@
                                <label for="roleOrg" class="col-md-8">Rôle de {{ confirmProccess.organization }}</label>
                                <div class="col-md-4">
                                    <select v-model="confirmProccess.organisationRole" class="form-control" id="roleOrg">
                                        <option v-for="r in rolesOrganisation" :value="r.id">{{ r.label }}</option>
                                        <option v-for="(r, id) in rolesOrganisation" :value="id">{{ r }}</option>
                                    </select>
                                </div>
                            </section>
@@ -148,7 +148,9 @@
    </section>
</template>
<script>
    // poi watch --format umd --moduleName  ActivityRequestAdmin --filename.css ActivityRequestAdmin.css --filename.js ActivityRequestAdmin.js --dist public/js/oscar/dist public/js/oscar/src/ActivityRequestAdmin.vue
// node node_modules/.bin/vue-cli-service build --name ActivityRequestAdmin --dest ../public/js/oscar/dist --no-clean --formats umd,umd-min --target lib src/ActivityRequestAdmin.vue

    import JCKSelector from "./components/JCKSelector";

    export default {
        data(){
@@ -177,7 +179,7 @@
        },

        components: {
            'jckselector': require('./JCKSelector.vue').default,
            'jckselector': JCKSelector,
        },

        props: {
+60 −0
Original line number Diff line number Diff line
<template>
    <div class="jck-selector">
        <div class="selected">
            <i class="icon-cog"></i>
            <strong>{{ selectedLabel }}</strong>
        </div>
        <div class="list">
            <div class="item" v-for="opt in choose" :class="{ 'selected': (selected.indexOf(opt.id) > -1) }" @click="toggleSelection(opt.id)">
                <i class="icon-check"></i>
                <i class="icon-check-empty"></i>
                {{ opt.label }}
                <small> ({{ opt.description }})</small>
            </div>
        </div>
    </div>
</template>
<script>
    export default {
        props: {
            choose: {
                default: null
            },
            selected: {
                default: null
            }
        },

        computed: {
            selectedLabel(){
                if( this.selected.length ){
                    let label = [];
                    this.choose.forEach(item => {
                       if(this.selected.indexOf(item.id) > -1){
                           label.push(item.label);
                       }
                    });
                    return label.join(', ');
                }
                return "Aucune selection";
            }
        },

        methods: {
            toggleSelection(value){
                let selection = [];
                if( this.selected )
                    selection = this.selected;

                let pos = selection.indexOf(value)
                if( pos > -1 ){
                    selection.splice(pos, 1);
                } else {
                    selection.push(value);
                }
                console.log(selection);
                this.$emit('change', selection);
            }
        }
    }
</script>
 No newline at end of file
+3 −2
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ use Oscar\Formatter\ActivityPaymentFormatter;
use Oscar\Formatter\ActivityToJsonFormatter;
use Oscar\Formatter\CSVDownloader;
use Oscar\Formatter\JSONFormatter;
use Oscar\Formatter\OscarFormatterConst;
use Oscar\Formatter\Spent\EstimatedSpentActivityHTMLFormater;
use Oscar\Formatter\Spent\EstimatedSpentActivityPDFFormater;
use Oscar\Hydrator\PcruInfosFormHydrator;
@@ -414,8 +415,8 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif

        return [
            'asAdmin' => $asAdmin,
            'rolesPerson' => $this->getPersonService()->getAvailableRolesPersonActivity(),
            'rolesOrganisation' => $this->getOrganizationService()->getAvailableRolesOrganisationActivity()
            'rolesPerson' => $this->getPersonService()->getAvailableRolesPersonActivity(OscarFormatterConst::FORMAT_ARRAY_ID_VALUE),
            'rolesOrganisation' => $this->getOrganizationService()->getAvailableRolesOrganisationActivity(OscarFormatterConst::FORMAT_ARRAY_ID_VALUE)
        ];
    }

+15 −1
Original line number Diff line number Diff line
@@ -127,6 +127,18 @@ class ActivityRequestService implements UseEntityManager, UsePersonService, UseO
        throw new OscarException("L'enregistrement des demandes d'activité n'est pas encore implanté.");
    }

    /**
     * Validation d'une demande d'activité.
     *
     * @param ActivityRequest $activityRequest
     * @param Person $validator
     * @param null $personsDatas
     * @param null $organisationDatas
     * @return bool
     * @throws OscarException
     * @throws \Doctrine\ORM\ORMException
     * @throws \Doctrine\ORM\OptimisticLockException
     */
    public function valid( ActivityRequest $activityRequest, Person $validator, $personsDatas = null, $organisationDatas = null ){

        // Test du status
@@ -151,6 +163,8 @@ class ActivityRequestService implements UseEntityManager, UsePersonService, UseO
            ->setAmount($activityRequest->getAmount())
            ->setDateStart($activityRequest->getDateStart())
            ->setDateEnd($activityRequest->getDateEnd())
            ->setPcruPoleCompetitivite(null)
            ->setPcruValidPoleCompetitivite(false)
            ->setCurrency($currency);

        $person = $this->getPersonService()->getPersonById($activityRequest->getCreatedBy()->getId(), true);
@@ -208,7 +222,7 @@ class ActivityRequestService implements UseEntityManager, UsePersonService, UseO
        $this->getEntityManager()->flush();

        // Mise à jour de l'index de recherche
        $activityService->searchUpdate($activity);
        $activityService->getGearmanJobLauncherService()->triggerUpdateSearchIndexActivity($activity);

        // Ajout du Follow
        $follow = new ActivityRequestFollow();
Loading