Commit 034c2eb2 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Ajout d'une option de visualisation des feuilles de temps déjà validées.

parent 595be5c5
Loading
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -172,12 +172,13 @@
          </footer>

          <hr>

          <nav class="text-center">
            <button class="btn btn-danger" @click="handlerReject(details)">
              <i class="icon-cancel-alt"></i>
            <button class="btn btn-danger" @click="handlerReject(details)" v-if="details.validation.infos.validable">
              <i class="icon-minus-circled"></i>
              Refuser
            </button>
            <form action="" method="post" class="form-inline">
            <form action="" method="post" class="form-inline" v-if="details.validation.infos.validable">
              <input type="hidden" name="period" :value="details.period"/>
              <input type="hidden" name="action" value="validate"/>
              <input type="hidden" name="declarer" :value="details.declarer"/>
@@ -186,12 +187,15 @@
                Valider la déclaration pour cette période
              </button>
            </form>
            <button class="btn btn-default" @click.prevent="loadingDetails = null; details = null">
              <i class="icon-cancel-alt"></i>
              Retour
            </button>
          </nav>
        </div>
      </div>
    </div>


    <div class="row" v-if="synthesis">

      <div class="col-md-12">
@@ -295,12 +299,19 @@
              <span v-if="vp.statusKey != 'conflict' && vp.statusKey != 'valid' ">
                Validateurs : <span class="cartouche" v-for="v in vp.validators">{{ v }}</span>
              </span>

              <span v-if="vp.validable" class="buttons">
                <button class="btn btn-default btn-info" @click="handlerDetail(vp)">
                  <i class="icon-zoom-in-outline"></i>
                  Vérifier et valider
                </button>
              </span>
              <span v-else>
                <button class="btn btn-default" @click="handlerDetail(vp)">
                  <i class="icon-zoom-in-outline"></i>
                  Voir le détail
                </button>
              </span>
          </article>
        </section>
        <hr>
+1 −5
Original line number Diff line number Diff line
@@ -2066,12 +2066,11 @@ class TimesheetController extends AbstractOscarController
                        break;
                }
            } catch (\Exception $e) {
                throw new \HttpException($e->getMessage());
                throw new OscarException($e->getMessage());
            }
            $this->redirect()->toRoute('timesheet/validations2');
        }


        // Lecture des informations
        if( $this->isAjax() || $this->params()->fromQuery('f', null) == 'json' ){
            $json = $this->baseJsonResponse();
@@ -2091,9 +2090,6 @@ class TimesheetController extends AbstractOscarController
            return $this->jsonOutput($json);
        }




        return [

        ];
+15 −7
Original line number Diff line number Diff line
@@ -1006,6 +1006,7 @@ class TimesheetService implements UseOscarUserContextService, UseOscarConfigurat
    {
        $declarer = $this->getPersonService()->getPerson($declarer_id);
        $periodObj = PeriodInfos::getPeriodInfosObj($period);
        $validator = $this->getPersonService()->getPerson($validator_id);

        $year = $periodObj->getYear();
        $month = $periodObj->getMonth();
@@ -1026,13 +1027,19 @@ class TimesheetService implements UseOscarUserContextService, UseOscarConfigurat
        );

        // Récupération des données à traiter
        $queryValidationPeriod = $this->getValidationPeriodRepository()->getValidationsDeclarerPeriod($declarer->getId(), $periodObj->getYear(), $periodObj->getMonth());
        $queryValidationPeriod = $this->getValidationPeriodRepository()
            ->getValidationsDeclarerPeriod($declarer->getId(), $periodObj->getYear(), $periodObj->getMonth());

        $vps = $queryValidationPeriod->getResult();
        $validable = false;

        /** @var ValidationPeriod $v */
        foreach ($vps as $v) {

            if( $v->isValidator($validator) ){
                $validable = true;
            }

            if( $v->isActivityValidation() ){
                if( !array_key_exists($v->getObjectId(), $activitiesTmp) ){
                    $activitiesTmp[$v->getObjectId()] = $this->getActivityService()->getActivityById($v->getObjectId());
@@ -1096,16 +1103,17 @@ class TimesheetService implements UseOscarUserContextService, UseOscarConfigurat
        }

        $out = [
          'datas' => [
              'activities' => $activitiesInfos,
              'horslots' => $horsLotsInfos,
              'total' => 0.0
          ],
          'infos' => [
              'validable' => $validable,
              'period' => $periodObj->toArray(),
              'declarer' => $declarer->toJson(),
              'horslots' => $horsLots,
              'days' => $daysDetails
          ],
          'datas' => [
              'activities' => $activitiesInfos,
              'horslots' => $horsLotsInfos,
              'total' => 0.0
          ]
        ];

@@ -1162,12 +1170,12 @@ class TimesheetService implements UseOscarUserContextService, UseOscarConfigurat
                            'by_days' => []
                        ];
                    }

                }

                if( !array_key_exists($group, $out['datas']['horslots']) ){
                    die("Pas de prétableau pour le group : $group");
                }

                if( !array_key_exists($code, $out['datas']['horslots'][$group]['subs']) ){
                    echo "<pre> <strong>[ $group / $code ]</strong>\n";
                    die("Pas de prétableau pour $code");
+6 −17

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

Loading