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

Synthèse des feuilles de temps :

 - Les colonnes sont organisées par groupe
 - Mise en page du PDF
 - Fix : La date de début est bien selectionnable quand elle tombe en décembre
parent 54d967e8
Loading
Loading
Loading
Loading
Loading
+49 −24
Original line number Diff line number Diff line
@@ -5,6 +5,30 @@
    <title>Feuille de temps</title>
    <style>
        <?php include __DIR__.'/common.css'; ?>

        thead td, thead th, tbody {
            font-size: 1.2em;
        }

        tr {
            line-height: 1em;
        }

        thead tr, tfoot tr {
            line-height: 1.4em;
        }

        tfoot th {
            border-top: #333333 solid 1px;
        }

        td.none {
            color: rgba(0,0,0,.5);
            font-size: .8em;
        }
        td.valued {

        }
    </style>
</head>
<?php
@@ -46,6 +70,7 @@ $lines = $facet == 'period' ? $by_periods : $by_persons;

<table>
    <thead>
        <tr>
        <th>Personne / périodes</th>
            <?php foreach ($headings['current']['workpackages'] as $wp): ?>
            <th class="project main research"><?= $wp['code'] ?></th>
@@ -57,9 +82,10 @@ $lines = $facet == 'period' ? $by_periods : $by_persons;
            <?php endforeach; ?>

            <?php foreach ($headings['others'] as $other): ?>
            <th class="other <?= $other['group'] ?>"><?= $other['label'] ?></th>
                <th class="<?= $other['group'] ?>"><?= $other['label'] ?></th>
            <?php endforeach; ?>
        <th class="other total">TOTAL</th>
            <th class="total">TOTAL</th>
        </tr>
    </thead>

    <tbody>
@@ -67,19 +93,18 @@ $lines = $facet == 'period' ? $by_periods : $by_persons;
        <tr class="person">
            <th><?= $line['label'] ?></th>
            <?php foreach ($line['datas']['current']['workpackages'] as $wp): ?>
            <td class="project main research"><?= $duration($wp['total']) ?> </td>
            <td class="main research <?= $wp['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($wp['total']) ?> </td>
            <?php endforeach; ?>
            <td class="project main research total"><?= $duration($line['datas']['current']['total']) ?></td>
            <td class="main research total <?= $line['datas']['current']['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($line['datas']['current']['total']) ?></td>

            <?php foreach ($line['datas']['prjs'] as $prj): ?>
            <td class="project research"><?= $duration($prj['total']) ?></td>
            <td class="research <?= $prj['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($prj['total']) ?></td>
            <?php endforeach; ?>

            <?php foreach ($line['datas']['others'] as $other): ?>
                <td class="other <?= $other['group'] ?>"><?= $duration($other['total']) ?></td>
                <td class="<?= $other['group'] ?> <?= $other['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($other['total']) ?></td>
            <?php endforeach; ?>
            <td class="other total"><?= $duration($line['total']) ?></td>

            <td class="total <?= $line['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($line['total']) ?></td>
        </tr>
    <?php endforeach; ?>
    </tbody>
@@ -87,18 +112,18 @@ $lines = $facet == 'period' ? $by_periods : $by_persons;
    <tfoot>
    <th>TOTAUX</th>
    <?php foreach ($headings['current']['workpackages'] as $wp): ?>
        <th class="project main research"><?= $duration($wp['total']) ?></th>
        <th class="main research <?= $wp['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($wp['total']) ?></th>
    <?php endforeach; ?>
    <th class="project main research total"><?= $duration($headings['current']['total']) ?></th>
    <th class="main research total <?= $headings['current']['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($headings['current']['total']) ?></th>

    <?php foreach ($headings['prjs']['prjs'] as $prj): ?>
        <th class="project research"><?= $duration($prj['total']) ?></th>
        <th class="research <?= $prj['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($prj['total']) ?></th>
    <?php endforeach; ?>

    <?php foreach ($headings['others'] as $other): ?>
        <th class="other <?= $other['group'] ?>"><?= $duration($other['total']) ?></th>
        <th class="<?= $other['group'] ?> <?= $other['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($other['total']) ?></th>
    <?php endforeach; ?>
    <th class="other total"><?= $duration($headings['total']) ?></th>
    <th class="total <?= $headings['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($headings['total']) ?></th>
    </tfoot>
</table>
</body>
+3 −5
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
    <section class="validations-admin">

      <div v-if="initialdata">
      <nav style="display: flex">
      <nav style="display: flex; line-height: 1.5em; align-items: center; border-bottom: solid #999 thin; padding: .3em; margin-bottom: 1em">
        Période du
        <div style="position: relative">
          <period-selector v-model="period_from"
@@ -10,7 +10,6 @@
                           :max="period_to"
                           @change="handlerChangeRefresh"/>
        </div>

        à
        <div style="position: relative">
          <period-selector v-model="period_to"
@@ -19,13 +18,12 @@
                           @change="handlerChangeRefresh"/>
        </div>

        <a :href="url + '?format=pdf&from=' +this.period_from +'&to=' +this.period_to +'&facet=' +state" download>
        <a class="btn btn-default"
            :href="url + '?format=pdf&from=' +this.period_from +'&to=' +this.period_to +'&facet=' +state" download>
          <i class="doc-doc"></i>
          Exporter
        </a>

        <input type="file" @change="handlerFile" id="debug_file" />

      </nav>

      <section class="synthesis heading">
+3 −3
Original line number Diff line number Diff line
@@ -152,9 +152,9 @@
                    let extract = this.min.match(regex);
                    let year = parseInt(extract[1]);
                    let month = parseInt(extract[2]);
                    if( month == 12 ){
                        year += 1;
                    }
                    // if( month == 12 ){
                    //     year += 1;
                    // }
                    return year;
                }
                return Number.MIN_SAFE_INTEGER;
+44 −29
Original line number Diff line number Diff line
@@ -1672,9 +1672,28 @@ class TimesheetService implements UseOscarUserContextService, UseOscarConfigurat

        ];

        // Rangement des Hors-Lots par groupe
        $otherByGroup = [
            'research' => [],
            'education' => [],
            'abs' => [],
            'other' => [],
        ];

        foreach ($this->getOthersWP() as $other) {
            $item = $other['code'];
            $group = $other['group'];
            $code = $other['code'];

            if (!array_key_exists($group, $otherByGroup)) {
                $otherByGroup[$group] = [];
            }

            $otherByGroup[$group][$code] = $other;
        }

        foreach ($otherByGroup as $group => $items) {
            foreach ($items as $other) {
                $item = $other['code'];
                $label = $other['label'];

                $othersModel[$item] = [
@@ -1695,6 +1714,7 @@ class TimesheetService implements UseOscarUserContextService, UseOscarConfigurat
                    'total' => 0.0,
                ];
            }
        }

        $output = [
            'period_from_label' => $startPeriod->getPeriodLabel(),
@@ -1763,7 +1783,6 @@ class TimesheetService implements UseOscarUserContextService, UseOscarConfigurat

                // Projet idoine
                if ($timesheetActivityId == $activity->getId()) {

                    $datasPersons[$personId]['datas']["current"]['total'] += $timesheetDuration;
                    $datasPersons[$personId]['datas']["current"]['workpackages'][$timesheetWorkpackageId]['total'] += $timesheetDuration;

@@ -1772,9 +1791,6 @@ class TimesheetService implements UseOscarUserContextService, UseOscarConfigurat

                    $headings['current']['total'] += $timesheetDuration;
                    $headings['current']['workpackages'][$timesheetWorkpackageId]['total'] += $timesheetDuration;



                } // Autre projet avec Feuille de temps
                elseif ($timesheetActivityId != null) {
                    $infosProjects['total'] += $timesheetDuration;
@@ -1815,7 +1831,6 @@ class TimesheetService implements UseOscarUserContextService, UseOscarConfigurat

                    $headings['prjs']['total'] += $timesheetDuration;
                    $headings['prjs']['prjs'][$timesheetActivityId]['total'] += $timesheetDuration;

                } // Autre
                else {
                    $key = $t['itemkey'];
+6 −0
Original line number Diff line number Diff line
@@ -108,6 +108,12 @@
            Revenir sur la fiche
        </a>
    </h1>
    <div>
        <small>
            du <strong><?= $this->moment($activity->getDateStart()) ?></strong>
            au <strong><?= $this->moment($activity->getDateEnd()) ?></strong>
        </small>
    </div>

    <?php if($activity->isTimesheetAllowed()): ?>
    <section>
Loading