Loading front/src/EntityWithRole.vue +6 −17 Original line number Diff line number Diff line Loading @@ -211,8 +211,10 @@ </article> </section> <section v-else> <span class="cartouche" v-for="e in stacked" :class="e.hasPrimary ? 'primary' : 'default' "> {{ e.enrolledLabel }} <span class="cartouche" v-for="e in stacked" :class="{ 'primary': e.hasPrimary, 'default': !e.hasPrimary}"> <a :href="e.urlShow" v-if="e.urlShow">{{ e.enrolledLabel }}</a> <span v-else>{{ e.enrolledLabel }}</span> <span class="addon principal" > <span v-for="r in e.roles" class="addon-module" :class="{'primary': r.rolePrincipal}"> {{ r.role }} Loading @@ -220,20 +222,6 @@ </span> </span> </section> <!-- <span class="cartouche" v-for="e in entities" :class="{'primary': e.rolePrincipal, 'outofdate past': e.past }"> <i v-if="e.context == 'activity'" class="icon-cube"></i> <i v-else class="icon-cubes"></i> <span class="text-clickable" @click="open(e.urlShow)" v-if="e.urlShow">{{ e.enrolledLabel }}</span> <span v-else>{{ e.enrolledLabel }}</span> <span class="addon"> {{ e.roleLabel }} <i class="icon-pencil-1 icon-clickable" v-if="manage" @click="handlerEdit(e)"></i> <i class="icon-trash icon-clickable" v-if="manage" @click="handlerDelete(e)"></i> </span> </span> --> </div> </template> <script> Loading Loading @@ -288,6 +276,7 @@ export default { if( !stacks.hasOwnProperty(id) ){ stacks[id] = { enrolled: i.enrolled, urlShow: i.urlShow, enrolledLabel: i.enrolledLabel, hasPrimary: false } Loading Loading @@ -378,7 +367,7 @@ export default { this.$http.post(url, data).then(ok => { }, ko => { this.error = "Erreur : " + ko.body; this.error = "Erreur : Impossible de modifier le rôle : " + ko.body; }).then(foo => { this.loading = false; this.fetch(); Loading module/Oscar/src/Oscar/Controller/EnrollController.php +1 −1 Original line number Diff line number Diff line Loading @@ -456,7 +456,7 @@ class EnrollController extends AbstractOscarController implements UsePersonServi $dateStart, $dateEnd ); return $this->getResponseOk("La personne a bien été ajouté"); return $this->getResponseOk("L'organisation a bien été ajoutée"); } catch (\Exception $e) { $msg = "Impossible d'ajouter l'organisation à l'activité : " . $e->getMessage(); $this->getLoggerService()->error("$msg : " . $e->getMessage()); Loading module/Oscar/src/Oscar/Controller/ProjectGrantController.php +17 −7 Original line number Diff line number Diff line Loading @@ -2343,7 +2343,9 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif * @var ActivityOrganization $activityOrganization */ foreach ($activity->getOrganizationsDeep() as $activityOrganization) { // FIX (non idéale) // Cas particulier (affectation sans rôle) // rôle supprimé ? manipulation extérieur if (!$activityOrganization->getRoleObj()) { $this->getLoggerService()->warning( sprintf( Loading @@ -2352,8 +2354,17 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif $activityOrganization->getEnroller() ) ); continue; $roleId = 0; $roleprincipal = false; $rolelabel = "Rôle inconnu"; $role = null; } else { $roleId = $activityOrganization->getRoleObj()->getId(); $roleprincipal = $activityOrganization->getRoleObj()->isPrincipal(); $rolelabel = $activityOrganization->getRoleObj()->getRoleId(); $role = $activityOrganization->getRoleObj(); } $class = get_class($activityOrganization); if ($class == ActivityOrganization::class) { Loading Loading @@ -2385,10 +2396,10 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif $out[] = [ 'id' => $activityOrganization->getId(), 'roleId' => $activityOrganization->getRoleObj()->getId(), 'role' => $activityOrganization->getRole(), 'roleLabel' => $activityOrganization->getRole(), 'rolePrincipal' => $activityOrganization->isPrincipal(), 'roleId' => $roleId, 'role' => $role, 'roleLabel' => $rolelabel, 'rolePrincipal' => $roleprincipal, 'urlDelete' => $urlDelete, 'context' => $context, 'contextKey' => $contextKey, Loading @@ -2398,7 +2409,6 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif 'enrollerLabel' => (string)$activity, 'editable' => $editable, 'deletable' => $deletable, // 'hash' => (string)$activityOrganization, 'enrolled' => $activityOrganization->getOrganization()->getId(), 'enrolledLabel' => $activityOrganization->getOrganization()->getFullName(), 'past' => !$activityOrganization->isActive(), Loading module/Oscar/src/Oscar/Form/ProjectGrantForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -202,7 +202,7 @@ class ProjectGrantForm extends Form implements InputFilterProviderInterface, Use $this->add([ 'name' => 'codeEOTP', 'options' => [ 'label' => 'EOTP' 'label' => 'N°Financier (' . $this->getProjectGrantService()->getOscarConfigurationService()->getFinancialLabel() . ')' ], 'attributes' => [ 'class' => 'form-control' Loading module/Oscar/src/Oscar/Formatter/EnrollToArrayFormatter.php +14 −2 Original line number Diff line number Diff line Loading @@ -71,6 +71,10 @@ class EnrollToArrayFormatter if( $this->oscarUserContext->hasPrivileges($manageEnrollPrivilege, $affectation->getEnroller()) ){ $output['urlEdit'] = $this->url->fromRoute($this->getConf($affectation)->edit, ['idenroll' => $affectation->getId()]); $output['urlDelete'] = $this->url->fromRoute($this->getConf($affectation)->delete, ['idenroll' => $affectation->getId()]); $output['urlShow'] = false; if( $this->oscarUserContext->hasPrivileges($showEnrolledPrivilege) ){ $output['urlShow'] = $this->url->fromRoute($this->getConf($affectation)->urlEnrolledShow, ['id' => $affectation->getEnrolled()->getId()]); } } $output['manage'] = $manage; Loading @@ -91,27 +95,35 @@ class EnrollToArrayFormatter $_conf->context = self::CONTEXT_PROJECT; $_conf->manage = Privileges::PROJECT_ORGANIZATION_MANAGE; $_conf->show = Privileges::PROJECT_ORGANIZATION_SHOW; $_conf->showEnrolled = Privileges::ORGANIZATION_SHOW; $_conf->urlEnrolledShow = 'organization/show'; $_conf->edit = 'organizationproject/edit'; $_conf->delete = 'organizationproject/delete'; break; case ProjectMember::class : $_conf->context = self::CONTEXT_PROJECT; $_conf->manage = Privileges::PROJECT_PERSON_MANAGE; $_conf->showEnrolled = Privileges::PERSON_SHOW; $_conf->show = Privileges::PROJECT_PERSON_SHOW; $_conf->urlEnrolledShow = 'person/show'; $_conf->edit = 'personproject/edit'; $_conf->delete = 'personproject/delete'; break; case ActivityOrganization::class: $_conf->context = self::CONTEXT_ACTIVITY; $_conf->manage = Privileges::ACTIVITY_ORGANIZATION_MANAGE; $_conf->showEnrolled = Privileges::ORGANIZATION_SHOW; $_conf->show = Privileges::ACTIVITY_ORGANIZATION_SHOW; $_conf->urlEnrolledShow = 'organization/show'; $_conf->edit = 'organizationactivity/edit'; $_conf->delete = 'organizationactivity/delete'; break; case ActivityPerson::class : $_conf->context = self::CONTEXT_ACTIVITY; $_conf->manage = Privileges::ACTIVITY_PERSON_MANAGE; $_conf->show = Privileges::ACTIVITY_PAYMENT_SHOW; $_conf->showEnrolled = Privileges::PERSON_SHOW; $_conf->show = Privileges::ACTIVITY_PERSON_SHOW; $_conf->urlEnrolledShow = 'person/show'; $_conf->edit = 'personactivity/edit'; $_conf->delete = 'personactivity/delete'; break; Loading @@ -132,7 +144,7 @@ class EnrollToArrayFormatter } protected function getShowEnrolledPrivilege($affectation){ return $this->getConf($affectation)->show; return $this->getConf($affectation)->showEnrolled; } protected function getContext($affectation) :string { Loading Loading
front/src/EntityWithRole.vue +6 −17 Original line number Diff line number Diff line Loading @@ -211,8 +211,10 @@ </article> </section> <section v-else> <span class="cartouche" v-for="e in stacked" :class="e.hasPrimary ? 'primary' : 'default' "> {{ e.enrolledLabel }} <span class="cartouche" v-for="e in stacked" :class="{ 'primary': e.hasPrimary, 'default': !e.hasPrimary}"> <a :href="e.urlShow" v-if="e.urlShow">{{ e.enrolledLabel }}</a> <span v-else>{{ e.enrolledLabel }}</span> <span class="addon principal" > <span v-for="r in e.roles" class="addon-module" :class="{'primary': r.rolePrincipal}"> {{ r.role }} Loading @@ -220,20 +222,6 @@ </span> </span> </section> <!-- <span class="cartouche" v-for="e in entities" :class="{'primary': e.rolePrincipal, 'outofdate past': e.past }"> <i v-if="e.context == 'activity'" class="icon-cube"></i> <i v-else class="icon-cubes"></i> <span class="text-clickable" @click="open(e.urlShow)" v-if="e.urlShow">{{ e.enrolledLabel }}</span> <span v-else>{{ e.enrolledLabel }}</span> <span class="addon"> {{ e.roleLabel }} <i class="icon-pencil-1 icon-clickable" v-if="manage" @click="handlerEdit(e)"></i> <i class="icon-trash icon-clickable" v-if="manage" @click="handlerDelete(e)"></i> </span> </span> --> </div> </template> <script> Loading Loading @@ -288,6 +276,7 @@ export default { if( !stacks.hasOwnProperty(id) ){ stacks[id] = { enrolled: i.enrolled, urlShow: i.urlShow, enrolledLabel: i.enrolledLabel, hasPrimary: false } Loading Loading @@ -378,7 +367,7 @@ export default { this.$http.post(url, data).then(ok => { }, ko => { this.error = "Erreur : " + ko.body; this.error = "Erreur : Impossible de modifier le rôle : " + ko.body; }).then(foo => { this.loading = false; this.fetch(); Loading
module/Oscar/src/Oscar/Controller/EnrollController.php +1 −1 Original line number Diff line number Diff line Loading @@ -456,7 +456,7 @@ class EnrollController extends AbstractOscarController implements UsePersonServi $dateStart, $dateEnd ); return $this->getResponseOk("La personne a bien été ajouté"); return $this->getResponseOk("L'organisation a bien été ajoutée"); } catch (\Exception $e) { $msg = "Impossible d'ajouter l'organisation à l'activité : " . $e->getMessage(); $this->getLoggerService()->error("$msg : " . $e->getMessage()); Loading
module/Oscar/src/Oscar/Controller/ProjectGrantController.php +17 −7 Original line number Diff line number Diff line Loading @@ -2343,7 +2343,9 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif * @var ActivityOrganization $activityOrganization */ foreach ($activity->getOrganizationsDeep() as $activityOrganization) { // FIX (non idéale) // Cas particulier (affectation sans rôle) // rôle supprimé ? manipulation extérieur if (!$activityOrganization->getRoleObj()) { $this->getLoggerService()->warning( sprintf( Loading @@ -2352,8 +2354,17 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif $activityOrganization->getEnroller() ) ); continue; $roleId = 0; $roleprincipal = false; $rolelabel = "Rôle inconnu"; $role = null; } else { $roleId = $activityOrganization->getRoleObj()->getId(); $roleprincipal = $activityOrganization->getRoleObj()->isPrincipal(); $rolelabel = $activityOrganization->getRoleObj()->getRoleId(); $role = $activityOrganization->getRoleObj(); } $class = get_class($activityOrganization); if ($class == ActivityOrganization::class) { Loading Loading @@ -2385,10 +2396,10 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif $out[] = [ 'id' => $activityOrganization->getId(), 'roleId' => $activityOrganization->getRoleObj()->getId(), 'role' => $activityOrganization->getRole(), 'roleLabel' => $activityOrganization->getRole(), 'rolePrincipal' => $activityOrganization->isPrincipal(), 'roleId' => $roleId, 'role' => $role, 'roleLabel' => $rolelabel, 'rolePrincipal' => $roleprincipal, 'urlDelete' => $urlDelete, 'context' => $context, 'contextKey' => $contextKey, Loading @@ -2398,7 +2409,6 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif 'enrollerLabel' => (string)$activity, 'editable' => $editable, 'deletable' => $deletable, // 'hash' => (string)$activityOrganization, 'enrolled' => $activityOrganization->getOrganization()->getId(), 'enrolledLabel' => $activityOrganization->getOrganization()->getFullName(), 'past' => !$activityOrganization->isActive(), Loading
module/Oscar/src/Oscar/Form/ProjectGrantForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -202,7 +202,7 @@ class ProjectGrantForm extends Form implements InputFilterProviderInterface, Use $this->add([ 'name' => 'codeEOTP', 'options' => [ 'label' => 'EOTP' 'label' => 'N°Financier (' . $this->getProjectGrantService()->getOscarConfigurationService()->getFinancialLabel() . ')' ], 'attributes' => [ 'class' => 'form-control' Loading
module/Oscar/src/Oscar/Formatter/EnrollToArrayFormatter.php +14 −2 Original line number Diff line number Diff line Loading @@ -71,6 +71,10 @@ class EnrollToArrayFormatter if( $this->oscarUserContext->hasPrivileges($manageEnrollPrivilege, $affectation->getEnroller()) ){ $output['urlEdit'] = $this->url->fromRoute($this->getConf($affectation)->edit, ['idenroll' => $affectation->getId()]); $output['urlDelete'] = $this->url->fromRoute($this->getConf($affectation)->delete, ['idenroll' => $affectation->getId()]); $output['urlShow'] = false; if( $this->oscarUserContext->hasPrivileges($showEnrolledPrivilege) ){ $output['urlShow'] = $this->url->fromRoute($this->getConf($affectation)->urlEnrolledShow, ['id' => $affectation->getEnrolled()->getId()]); } } $output['manage'] = $manage; Loading @@ -91,27 +95,35 @@ class EnrollToArrayFormatter $_conf->context = self::CONTEXT_PROJECT; $_conf->manage = Privileges::PROJECT_ORGANIZATION_MANAGE; $_conf->show = Privileges::PROJECT_ORGANIZATION_SHOW; $_conf->showEnrolled = Privileges::ORGANIZATION_SHOW; $_conf->urlEnrolledShow = 'organization/show'; $_conf->edit = 'organizationproject/edit'; $_conf->delete = 'organizationproject/delete'; break; case ProjectMember::class : $_conf->context = self::CONTEXT_PROJECT; $_conf->manage = Privileges::PROJECT_PERSON_MANAGE; $_conf->showEnrolled = Privileges::PERSON_SHOW; $_conf->show = Privileges::PROJECT_PERSON_SHOW; $_conf->urlEnrolledShow = 'person/show'; $_conf->edit = 'personproject/edit'; $_conf->delete = 'personproject/delete'; break; case ActivityOrganization::class: $_conf->context = self::CONTEXT_ACTIVITY; $_conf->manage = Privileges::ACTIVITY_ORGANIZATION_MANAGE; $_conf->showEnrolled = Privileges::ORGANIZATION_SHOW; $_conf->show = Privileges::ACTIVITY_ORGANIZATION_SHOW; $_conf->urlEnrolledShow = 'organization/show'; $_conf->edit = 'organizationactivity/edit'; $_conf->delete = 'organizationactivity/delete'; break; case ActivityPerson::class : $_conf->context = self::CONTEXT_ACTIVITY; $_conf->manage = Privileges::ACTIVITY_PERSON_MANAGE; $_conf->show = Privileges::ACTIVITY_PAYMENT_SHOW; $_conf->showEnrolled = Privileges::PERSON_SHOW; $_conf->show = Privileges::ACTIVITY_PERSON_SHOW; $_conf->urlEnrolledShow = 'person/show'; $_conf->edit = 'personactivity/edit'; $_conf->delete = 'personactivity/delete'; break; Loading @@ -132,7 +144,7 @@ class EnrollToArrayFormatter } protected function getShowEnrolledPrivilege($affectation){ return $this->getConf($affectation)->show; return $this->getConf($affectation)->showEnrolled; } protected function getContext($affectation) :string { Loading