Commit 7829d2b7 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Patch rôle affichés (terminated)

parent 32d4d8e0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2454,6 +2454,7 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                'roleLabel'     => $activityPerson->getRole(),
                'roleId'        => $activityPerson->getRoleObj() ? $activityPerson->getRoleObj()->getId() : "",
                'rolePrincipal' => $activityPerson->isPrincipal(),
                'personEnd'     => DateTimeUtils::toStr($activityPerson->getPerson()->getLdapFinInscription(), 'Y-m-d'),
                'urlDelete'     => $urlDelete,
                'context'       => $context,
                'contextKey'    => $contextKey,
@@ -2467,6 +2468,7 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                'enrolled'      => $activityPerson->getPerson()->getId(),
                'firstname'      => $activityPerson->getPerson()->getFirstname(),
                'lastname'      => $activityPerson->getPerson()->getLastname(),
                'disabled' => true,
                'enrolledLabel' => $activityPerson->getPerson()->getDisplayName(),
                'start'         => DateTimeUtils::toStr($activityPerson->getDateStart(), 'Y-m-d'),
                'end'           => DateTimeUtils::toStr($activityPerson->getDateEnd(), 'Y-m-d'),
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ use Oscar\Traits\UseServiceContainer;
use Oscar\Traits\UseServiceContainerTrait;
use Oscar\Traits\UseSpentService;
use Oscar\Traits\UseSpentServiceTrait;
use Oscar\Utils\DateTimeUtils;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use UnicaenSignature\Provider\SignaturePrivileges;
@@ -1074,6 +1075,7 @@ class ProjectGrantApiService implements
                'roleLabel' => $activityPerson->getRole(),
                'roleId' => $activityPerson->getRoleObj() ? $activityPerson->getRoleObj()->getId() : "",
                'rolePrincipal' => $activityPerson->isPrincipal(),
                'enrolledEnd'     => $activityPerson->getPerson()->getLdapFinInscription(),
                'context' => $context,
                'contextKey' => $contextKey,
                'urlShow' => $urlShow,
+16 −4
Original line number Diff line number Diff line
@@ -249,23 +249,24 @@
    </section>
    <section v-else>
      <span class="cartouche" v-for="e in stacked" :class="{
        'terminated': e.end,
        'person' : title == 'Personne',
        'organization' : title == 'Organisation',
        'primary': e.hasPrimary, 'default': !e.hasPrimary}">
        <a :href="e.urlShow" v-if="entityLinkShow">
        <a :href="e.urlShow" v-if="entityLinkShow" :class="e.end ? 'terminated' : ''">
          <PersonDisplay :person="e" v-if="title == 'Personne'" :allow-tooltip="entityLinkShow"/>
          <span v-else>
            {{ e.enrolledLabel }}
          </span>
        </a>
        <span v-else>
        <span v-else :class="e.end ? 'terminated' : ''">
          <PersonDisplay :person="e" v-if="title == 'Personne'" :allow-tooltip="entityLinkShow"/>
          <span v-else>
            {{ e.enrolledLabel }}
          </span>
        </span>
        <span class="addon principal">
          <span v-for="r in e.roles" class="addon-module" :class="{'primary': r.rolePrincipal}">
          <span v-for="r in e.roles" class="addon-module" :class="{'primary': r.rolePrincipal, 'terminated': r.past}">
            {{ r.role }}
          </span>
        </span>
@@ -359,6 +360,7 @@ export default {

    stacked() {
      let stacks = {};
      let now = (new Date()).toISOString();
      if (this.entities) {
        this.entities.forEach(i => {
          let id = i.enrolled;
@@ -367,6 +369,9 @@ export default {
              id: id,
              firstname: i.firstname,
              lastname: i.lastname,
              disabled: i.disabled == true,
              end: i.enrolledEnd ? (i.enrolledEnd < now) : null,
              enrolledEnd: i.enrolledEnd,
              enrolled: i.enrolled,
              urlShow: i.urlShow,
              enrolledLabel: i.enrolledLabel,
@@ -377,6 +382,7 @@ export default {
          stacks[id]['roles'][i.roleId] = {
            role: i.roleLabel,
            roleId: i.roleId,
            past: i.past,
            rolePrincipal: i.rolePrincipal,
            context: i.context,
          };
@@ -626,3 +632,9 @@ export default {
}

</script>
<style>
.terminated {
  text-decoration: line-through !important;
  opacity: .5
}
</style>
 No newline at end of file