Commit 872b55a3 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

UP : Les créneaux "Invalid" sont rangés dans une colonne dédiée pour éviter...

UP : Les créneaux "Invalid" sont rangés dans une colonne dédiée pour éviter les décalages. La colonne n'est visible que si necessaire.
parent 207aee2a
Loading
Loading
Loading
Loading
Loading
+21 −3
Original line number Diff line number Diff line
@@ -29,6 +29,15 @@
        td.valued {

        }

        .error {
            background: #e34242;
            color: white;
        }
        .error.none {
            background: #e34242;
            color: rgba(255,255,255,.5);
        }
    </style>
</head>
<?php
@@ -81,7 +90,10 @@ $lines = $facet == 'period' ? $by_periods : $by_persons;
            <th class="project research"><?= $prj['label'] ?></th>
            <?php endforeach; ?>

            <?php foreach ($headings['others'] as $other): ?>
            <?php foreach ($headings['others'] as $other):
                // On n'affiche pas la colonne "Invalid" si ça n'est pas utile
                if( $other['label'] == 'Invalid' && ($headings['has_invalid'] == false) ) continue;
                ?>
                <th class="<?= $other['group'] ?>"><?= $other['label'] ?></th>
            <?php endforeach; ?>
            <th class="total">TOTAL</th>
@@ -101,7 +113,10 @@ $lines = $facet == 'period' ? $by_periods : $by_persons;
            <td class="research <?= $prj['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($prj['total']) ?></td>
            <?php endforeach; ?>

            <?php foreach ($line['datas']['others'] as $other): ?>
            <?php foreach ($line['datas']['others'] as $other):
                // On n'affiche pas la colonne "Invalid" si ça n'est pas utile
                if( $other['label'] == 'Invalid' && ($headings['has_invalid'] == false) ) continue;
                ?>
                <td class="<?= $other['group'] ?> <?= $other['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($other['total']) ?></td>
            <?php endforeach; ?>
            <td class="total <?= $line['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($line['total']) ?></td>
@@ -120,7 +135,10 @@ $lines = $facet == 'period' ? $by_periods : $by_persons;
        <th class="research <?= $prj['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($prj['total']) ?></th>
    <?php endforeach; ?>

    <?php foreach ($headings['others'] as $other): ?>
    <?php foreach ($headings['others'] as $other):
        // On n'affiche pas la colonne "Invalid" si ça n'est pas utile
        if( $other['label'] == 'Invalid' && ($headings['has_invalid'] == false) ) continue;
        ?>
        <th class="<?= $other['group'] ?> <?= $other['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($other['total']) ?></th>
    <?php endforeach; ?>
    <th class="total <?= $headings['total'] == 0 ? 'none' : 'valued'?>"><?= $duration($headings['total']) ?></th>
+14 −3
Original line number Diff line number Diff line
@@ -48,7 +48,11 @@
          <span class="value hours">{{ prj.label }}</span>
        </div>

        <div v-for="other in initialdata.headings.others" :title="other.label" :class="other.group">
        <div v-for="other in initialdata.headings.others"
             :title="other.label"
             :class="other.group"
             v-if="other.label != 'Invalid' || (other.label == 'Invalid' && initialdata.headings.has_invalid)"
        >
          <span class="value hours">{{ other.label }}</span>
        </div>

@@ -76,7 +80,11 @@
          <span class="value hours">{{ prj.total | duration }}</span>
        </div>

        <div v-for="other in entry.datas.others" :title="other.label" :class="other.group">
        <div v-for="other in entry.datas.others"
             :title="other.label"
             :class="other.group"
             v-if="other.label != 'Invalid' || (other.label == 'Invalid' && initialdata.headings.has_invalid)"
        >
          <span class="value hours">{{ other.total | duration }}</span>
        </div>

@@ -101,7 +109,10 @@
          <span class="value hours">{{ prj.total | duration }}</span>
        </div>

        <div v-for="other in initialdata.headings.others" :title="other.label" :class="other.group">
        <div v-for="other in initialdata.headings.others"
             :title="other.label"
             :class="other.group"
             v-if="other.label != 'Invalid' || (other.label == 'Invalid' && initialdata.headings.has_invalid)">
          <span class="value hours">{{ other.total | duration }}</span>
        </div>

+26 −0
Original line number Diff line number Diff line
@@ -1624,6 +1624,7 @@ class TimesheetService implements UseOscarUserContextService, UseOscarConfigurat
            'total_research' => 0.0,
            'total_off' => 0.0,
            'total' => 0.0,
            'has_invalid' => false,
            'current' => [
                'total' => 0.0,
                'workpackages' => []
@@ -1680,9 +1681,12 @@ class TimesheetService implements UseOscarUserContextService, UseOscarConfigurat
            'other' => [],
        ];

        $othersValidKeys = [];

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

            if (!array_key_exists($group, $otherByGroup)) {
                $otherByGroup[$group] = [];
@@ -1716,6 +1720,24 @@ class TimesheetService implements UseOscarUserContextService, UseOscarConfigurat
            }
        }

        // Fix : Rangement des créneaux mal qualifiés
        $othersModel['invalid'] = [
            'label' => 'Invalid',
            'group' => 'error',
            'total' => 0.0,
        ];
        $othersInfos['items']['invalid'] = [
            'label' => 'Invalid',
            'group' => 'error',
            'total' => 0.0,
        ];

        $headings['others']['invalid'] = [
            'label' => 'Invalid',
            'group' => 'error',
            'total' => 0.0,
        ];

        $output = [
            'period_from_label' => $startPeriod->getPeriodLabel(),
            'period_from' => $startPeriod->getPeriodCode(),
@@ -1834,6 +1856,10 @@ class TimesheetService implements UseOscarUserContextService, UseOscarConfigurat
                } // Autre
                else {
                    $key = $t['itemkey'];
                    if( !in_array($key, $othersValidKeys) ){
                        $key = 'invalid';
                        $headings['has_invalid'] = true;
                    }
                    $datasPersons[$personId]['datas']["others"][$key]['total'] += $timesheetDuration;
                    $datasPeriods[$timesheetPeriod]['datas']["others"][$key]['total'] += $timesheetDuration;
                    $headings['others'][$key]['total'] += $timesheetDuration;
+9 −0
Original line number Diff line number Diff line
@@ -98,6 +98,15 @@
        font-weight: bold;
    }

    .error {
        background: #e34242;
        color: white;
    }
    .error.none {
        background: #e34242;
        color: rgba(255,255,255,.5);
    }

</style>
<div class="container">
    <h1>
+2 −2

File changed.

Preview size limit exceeded, changes collapsed.

Loading