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

écran de contrôle des retards (Ajout d'informations métiers + Mise en page)

parent 3f509704
Loading
Loading
Loading
Loading
Loading
+77 −24
Changes for front/src/TimesheetHigDelay.vue: 77 added lines, 24 removed lines.
Original line number Diff line number Diff line
@@ -9,56 +9,109 @@
      </div>
    </div>
    <article class="card" v-for="entry in entries">
      <h2>
        {{ entry.fullname }}
        <span class="cartouche xs warning">
          {{ entry.total_declarations }} / {{ entry.total_periods }}
      <h2 class="card-title">
        <span class="profile">
          <img :src="'//www.gravatar.com/avatar/' + entry.emailmd5 +'?s=80'" alt="" width="40" style="width: 40px"/>
        </span>
        <span>
          <strong>{{ entry.fullname }}</strong>
          <small style="display: block">
            <i class="icon-mail"></i>
            {{ entry.email }}
          </small>
        </span>
        <span v-if="entry.url_show">
          <a :href="entry.url_show">
            Fiche
          </a>
        </span>
      </h2>
<!--      <div>-->
<!--        <i class="icon-calendar"></i> Nombre de période : <strong>{{ entry.total_periods }}</strong><br>-->
<!--        <i class="icon-docs"></i> Déclaration(s) : <strong>{{ entry.total_declarations }}</strong><br>-->


<!--      </div>-->
      <div class="row">
        <div class="col-md-3">
          <div class="validators">
        <h3>
            <h4 style="margin-top: 1em">
              <i class="icon-user"></i>
              Validateur(s) impliqué(s) :
        </h3>
            </h4>
            <div class="alert alert-danger" v-if="entry.np1.length == 0"><i class="icon-attention-1"></i>
          Aucun <em>N+1</em> (validateur hors-lot) n'est assigné à ce déclarant, vous pouvez lui en assigner un (ou plusieurs) depuis la fiche personne.
              Aucun <em>N+1</em> (validateur hors-lot) n'est assigné à ce déclarant, vous pouvez lui en assigner un (ou
              plusieurs) depuis la fiche personne.
            </div>

            <div v-if="entry.send == true && entry.validators.length == 0" class="alert alert-danger">
              <i class="icon-attention-1"></i>
          Aucun validateur n'est désigné pour valider ces déclarations, rendez-vous dans la fiche activité afin de vérifier que des validateurs sont bien désignés, ainsi que dans la fiche personne pour les créneaux Hors-lot
              Aucun validateur n'est désigné pour valider ces déclarations, rendez-vous dans la fiche activité afin de
              vérifier que des validateurs sont bien désignés.
            </div>
            <ul v-else>
              <li v-for="v in entry.validators"><i class="icon-cube"></i> {{ v }}</li>
          <li v-for="v in entry.np1"><i class="icon-tag"></i> {{ v }}</li>
              <li v-for="v in entry.np1">
                <i class="icon-tag"></i>
                <strong>{{ v }}</strong>
                <small> (Validateur Hors-Lot)</small>
              </li>
            </ul>
          </div>
        </div>
        <div class="col-md-9">
          <div class="periods">
            <h3>
              <i class="icon-calendar"></i>
          Période(s)</h3>
        <span v-for="(p, key) in entry.periods" class="cartouche xs" :class="{
              {{ entry.total_periods }} Période(s) en retard
              <small v-if="entry.total_declarations">
                (dont <strong>{{ entry.total_declarations }}</strong> en cours de traitement)
              </small>
            </h3>
            <div v-for="(p, key) in entry.periods" class="xs highdelay-line" :class="{
          'error ': p.conflict,
          'success': p.valid == true,
          'danger': p.send == false && p.conflict != true,
          'secondary2': p.send == true && p.valid_prj == true && p.valid_sci == false,
          'warning': p.conflict != true && (p.send == true && p.valid_prj == true && p.valid_sci == true),
        }" @click.shift="debug = p">
          <span v-if="p.valid == true"><i class="icon-ok-circled"title="Validée"></i></span>
          <span v-else-if="p.conflict == true"><i class="icon-hammer"title="Conflit à régler (demandeur)"></i></span>
          <span v-else-if="p.send == false" ><i class="icon-paper-plane" title="En attente d'envoi"></i></span>
          <span v-else-if="p.valid_prj == true && p.valid_sci == false"><i class="icon-beaker" title="En attente de validation scientifique"></i></span>
          <span v-else-if="p.valid_sci == true && p.valid_adm == false"><i class="icon-book" title="En attente de validation administrative"></i></span>
          {{ key | period }}
          <small style="font-weight: bold">({{ p.step }} / 3)</small>

          <span class="state-info">
            <span v-if="p.valid == true">
              <span class="compact-state"><i class="icon-ok-circled" title="Validée"></i>
                <span class="info-text">Période validée</span>
              </span>
            </span>
            <span v-else-if="p.conflict == true">
              <span class="compact-state"><i class="icon-hammer" title="Conflit à régler (demandeur)"></i>
                <span class="info-text">La période a un conflit</span>
              </span>
            </span>
            <span v-else-if="p.send == false">
              <span class="compact-state"><i class="icon-paper-plane" title="En attente d'envoi"></i>
                <span class="info-text">Pas encore envoyée</span>
              </span>
            </span>
            <span v-else-if="p.valid_prj == true && p.valid_sci == false">
              <span class="compact-state"><i class="icon-beaker" title="En attente de validation scientifique"></i>
                <span class="info-text">En attente de validation scientifique</span>
              </span>
            </span>
            <span v-else-if="p.valid_sci == true && p.valid_adm == false">
              <span class="compact-state"><i class="icon-book" title="En attente de validation administrative"></i>
                <span class="info-text">En attente de validation administrative</span>
              </span>
            </span>
          </span>

              <span class="period-label">{{ key | period }}</span>

              <span>
                Validation : <small style="font-weight: bold">({{ p.step }} / 3)</small>
                <span class="danger" v-if="p.send == true && p.validators.length == 0">
                  <i class="icon-attention-1"></i> Pas de validateur
                </span>
              </span>
            </div>
          </div>
        </div>
      </div>


    </article>
  </div>
</template>
+477 −221

File changed.

Preview size limit exceeded, changes collapsed.

+5 −0
Changes for module/Oscar/src/Oscar/Entity/Person.php: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -574,6 +574,11 @@ class Person implements ResourceInterface
        return $this->email;
    }

    public function getMd5Email() :string
    {
        return md5($this->getEmail());
    }

    /**
     * @param string $email
     */
+19 −2
Changes for module/Oscar/src/Oscar/Service/PersonService.php: 19 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ use Oscar\Traits\UseServiceContainerTrait;
use Oscar\Utils\PeriodInfos;
use Oscar\Utils\UnicaenDoctrinePaginator;
use Symfony\Component\Console\Style\SymfonyStyle;
use Zend\Mvc\Controller\Plugin\Url;

/**
 * Gestion des Personnes :
@@ -1217,7 +1218,7 @@ class PersonService implements UseOscarConfigurationService, UseEntityManager, U
    }

    /**
     * Retourne la liste des validateurs EFFECTIFS impliqués dans la validatation des heures du déclarant pour la
     * Retourne la liste des validateurs EFFECTIFS impliqués dans la validation des heures du déclarant pour la
     * période.
     *
     * @param int $delcarerId
@@ -1238,7 +1239,16 @@ class PersonService implements UseOscarConfigurationService, UseEntityManager, U
        return $output;
    }

    public function getPersonsHighDelay(string $period)
    /**
     * Retourne la liste des déclarants impliqués dans des retards pour une période (périodes précédentes inclues).
     * Les données tiennent compte des retards de validation.
     *
     * @param string $period
     * @return array
     * @throws \Psr\Container\ContainerExceptionInterface
     * @throws \Psr\Container\NotFoundExceptionInterface
     */
    public function getPersonsHighDelay(string $period, ?Url $urlHelper = null)
    {
        $declarers = $this->getDeclarersIdsBeforePeriod($period);

@@ -1265,9 +1275,16 @@ class PersonService implements UseOscarConfigurationService, UseEntityManager, U
            }
            $periods = [];

            $urlShow = false;
            if( $urlHelper ){
                $urlShow = $urlHelper->fromRoute('person/show', ['id' => $personId]);
            }

            $output[$personId] = [
                'person_id' => $personId,
                'fullname' => $personName,
                'emailmd5' => $person->getMd5Email(),
                'url_show' => $urlShow,
                'email' => $personEmail,
                'np1' => $validatorsOthers,
                'total_periods' => count($personPeriods),
+2 −1
Changes for module/Oscar/view/oscar/timesheet/high-delay.phtml: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -3,7 +3,8 @@
<div class="container">
    <h1>
        <i class="icon-clock"></i>
        Retards importants</h1>
        Retards importants
    </h1>
    <div id="timesheethighdelay"></div>
</div>

Loading