Commit 2ea80c5e authored by root's avatar root
Browse files

[fix](module/Oscar/Formatter/TimesheetActivityPeriodFormatter): test if...

[fix](module/Oscar/Formatter/TimesheetActivityPeriodFormatter): test if variable data['otherGroups'][xxx] exists unless initialize to 0 + draw cells if ONLY if exist
parent 6cf104ae
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -260,12 +260,12 @@ class TimesheetActivityPeriodFormatter
        $colorAbsBG = 'faefea';
        $colorOtherBG = 'f8faea';

        $wpWidth = count($datas['wps']);
        $ceWidth = count($datas['ces']);
        $educationWidth = count($datas['othersGroups']['education']);
        $absWidth = count($datas['othersGroups']['abs']);
        $otherWidth = count($datas['othersGroups']['other']);
        $researchWidth = count($datas['othersGroups']['research']);
        $wpWidth = count($datas['wps'] ?? []);
        $ceWidth = count($datas['ces'] ?? []);
        $educationWidth = count($datas['othersGroups']['education'] ?? []);
        $absWidth = count($datas['othersGroups']['abs'] ?? []);
        $otherWidth = count($datas['othersGroups']['other'] ?? []);
        $researchWidth = count($datas['othersGroups']['research'] ?? []);

        $fullWidth = $wpWidth + $ceWidth + $educationWidth + $absWidth + $otherWidth + $researchWidth + 5;

@@ -610,21 +610,21 @@ class TimesheetActivityPeriodFormatter
            foreach ($datas['othersGroups']['education'] as $r) {
                $this->drawCell($r['label'], 0, true, 'headEducation');
            }
            if( count($datas['othersGroups']['education']) > 1 ){
            if( isset( $datas['othersGroups']['education'] ) && count($datas['othersGroups']['education']) > 1 ){
                $this->drawCell("Total Enseignement", 0, true, 'headEducation');
            }

            foreach ($datas['othersGroups']['abs'] as $r) {
                $this->drawCell($r['label'], 0, true, 'headAbs');
            }
            if( count($datas['othersGroups']['abs']) > 1 ){
            if( isset( $datas['othersGroups']['abs'] ) && count($datas['othersGroups']['abs']) > 1 ){
                $this->drawCell("Total absent", 0, true, 'headAbs');
            }

            foreach ($datas['othersGroups']['other'] as $r) {
                $this->drawCell($r['label'], 0, true, 'headOther');
            }
            if( count($datas['othersGroups']['other']) > 1 ){
            if( isset( $datas['othersGroups']['other'] ) && count($datas['othersGroups']['other']) > 1 ){
                $this->drawCell("Total autre", 0, true, 'headOther');
            }