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

- Mise à jour des template de feuille de temps par défaut (décalage de la mise en page)

 - Simplification de la personnalisation du logo (Voir DOC)
 - DEV : Notes sur les dépenses mises à jour
parent af7dcc24
Loading
Loading
Loading
Loading
+1 −0
Changes for .gitignore: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ install/init/**
# Gabarits
data/templates/timesheet_activity_synthesis.html.php
data/templates/timesheet_person_month.html.php
data/templates/custom.inc.php

# Fichiers d'exemple
!data/timesheet_model.xls
+10 −0
Changes for data/templates/custom.inc.php.dist: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php
/*
 La variable $logo_data est utilisée dans le code HTML
 sous la forme <img src="<?= $logo_data ?>">
 Note : Une URL absolue peut ne pas fonctionner dans le cadre
 de la génération d'un PDF, d'où l'usage de BASE64
*/
$logo_data = "data:image/png;base64," . base64_encode(
    file_get_contents(__DIR__.'/logo.example.png')
);
 No newline at end of file
+4 −1
Changes for data/templates/functions.inc.php: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
<?php

require_once __DIR__ . '/variables.inc.php';

$custom = __DIR__ . '/custom.inc.php';
if( file_exists($custom) ){
    require_once $custom;
}
/**
 * @param $duration
 * @return string
+173 KiB
Loading image diff...
+53 −47
Changes for data/templates/timesheet_activity_synthesis.default.html.php: 53 added lines, 47 removed lines.
Original line number Diff line number Diff line
@@ -12,13 +12,12 @@ $labels = [
<html>
    <head>
        <meta charset="utf-8">
        <title>Document PDF</title>
        <title>Synthèse de l'activité</title>
        <style>
            <?php echo file_get_contents(__DIR__.'/common.css'); ?>
        </style>
    </head>
    <body>

            <table border="0">
                <tr>
                    <td>
@@ -38,64 +37,69 @@ $labels = [
                    <th>&nbsp;</th>
                    <?php

                    // Nombre de colonne dans les groupe
                    $colWP      = count($wps) + (count($wps)>1 ? 1 : 0);
                    $colCE      = count($ces) + (count($ces)>1 ? 1 : 0);
                    $colSEARCH  = count($othersGroups['research']) + (count($othersGroups['research'])>1 ? 1 : 0);

                    // Largeur des colonnes
                    $colonneLot = count($wps);
                    $colonneLotTotal = $colonneLot > 1 ? 1 : 0;

                    $colonneAutresProjets = count($ces);
                    $colonneAutresProjetsTotal = $colonneAutresProjets > 1 ? 1 : 0;

                    $colonneRecherches = count($othersGroups['research']);
                    $colonneRecherchesTotal = $colonneRecherches > 1 ? 1 : 0;

                    $colonneCategorieRecherche = $colonneLot + $colonneLotTotal + $colonneRecherches + $colonneRecherchesTotal + $colonneAutresProjets + $colonneAutresProjetsTotal;
                    $colonneCategorieRechercheTotal = $colonneCategorieRecherche > 2 ? 1 : 0;

                    $colonneAbs = count($othersGroups['abs']);
                    $colonneAbsTotal = $colonneAbs > 1 ? 1 : 0;

                    $colonneOthers = count($othersGroups['other']);
                    $colonneOthersTotal = $colonneOthers > 1 ? 1 : 0;

                    $colonneOthers = count($othersGroups['education']);
                    $colonneOthersTotal = $colonneOthers > 1 ? 1 : 0;



                    $colspanLot = count($wps) -1 +1;
                    $colspanCE = count($ces) -1;
                    if( $colspanCE > 1 ) $colspanCE +=1;
                    ////////////////////////////// Colonnes RECHERCHE
                    //// Colonnes du projet
                    $nbrColProjetLots = count($wps); // Lots
                    $nbrColProjetTotal = $nbrColProjetLots > 1 ? 1 : 0; // Colonne TOTAL
                    $nbrColProjet = $nbrColProjetLots + $nbrColProjetTotal;

                    //// Colonnes Autres Projets
                    $nbrColCEProjet = count($ces);
                    $nbrColCETotal = $nbrColCEProjet > 1 ? 1 : 0;
                    $nbrColCE = $nbrColCEProjet + $nbrColCETotal;

                    //// Colonnes Autres Recherche
                    $nbrColOtherSearchItems = count($othersGroups['research']);
                    $nbrColOtherSearchTotal = $nbrColOtherSearchItems > 1 ? 1 : 0;
                    $nbrColOtherSearch = $nbrColOtherSearchItems + $nbrColOtherSearchTotal;

                    $nbrColResearch = $nbrColProjet + $nbrColCE + $nbrColOtherSearch;


                    //// Colonnes Autres
                    $nbrColOthers = [];
                    foreach ($othersGroups as $key => $value) {
                        if( $key == "research" ){
                            continue;
                        }
                        $nbrItems = count($value);
                        $hasTotal = $nbrItems > 1 ? 1 : 0;
                        $total = $nbrItems + $hasTotal;

                        $nbrColOthers[$key] = [
                            'items' => $nbrItems,
                            'hasTotal' => $hasTotal,
                            'total' => $total,
                        ];
                    }
                    ?>
                    <th class="research" colspan="<?= $colonneCategorieRecherche + $colonneCategorieRechercheTotal ?>">Recherches</th>
                    <th class="research" colspan="<?= $nbrColResearch + 1 ?>">Recherches</th>

                    <?php foreach ($othersGroups as $k=>$othersGroup): if( $k == 'research') continue;?>
                        <th class="<?= $k ?>" colspan="<?= count($othersGroup)+(count($othersGroup)>1 ? 1 : 0) ?>">
                            <?= array_keys($labels, $k) ? $labels[$k] : $k ?>
                        <th class="<?= $k ?>" colspan="<?= $nbrColOthers[$k]['total'] ?>">
                            <?= array_key_exists($k, $labels) ? $labels[$k] : $k ?>
                        </th>
                    <?php endforeach; ?>
                    <th colspan="2" class="totalall">TOTAL</th>
                    <th colspan="2" class="totalall">TOTAL période</th>
                </tr>
                <tr>
                    <th>&nbsp;</th>

                    <th class="research main" colspan="<?= $colonneLot + $colonneLotTotal ?>">
                        <strong><?= $activity['projectacronym'] ?></strong>
                    <th class="research main" colspan="<?= $nbrColProjet ?>">
                        <strong>
                            <?= $activity['projectacronym'] ?>
                        </strong>
                    </th>
                    <?php if( count($ces) > 0): ?>
                        <th class="research ce" colspan="<?= $colonneAutresProjets + $colonneAutresProjetsTotal ?>">
                            <strong>Projets</strong>
                    <?php if( $nbrColCE > 0): ?>
                        <th class="research ce" colspan="<?= $nbrColCE ?>">
                            <strong>Autres Projets</strong>
                        </th>
                    <?php endif; ?>
                    <th class="research other" colspan="<?= $colonneRecherches + $colonneRecherchesTotal ?>">
                        <strong>Autres</strong>
                    <th class="research other" colspan="<?= $nbrColOtherSearch ?>">
                        <span>Autres </span>
                    </th>
                    <th class="research totalcategory" rowspan="2">
                        Total
                        Total<br> recherche
                    </th>

                    <?php foreach ($othersGroups as $k=>$othersGroup): if( $k == 'research') continue;?>
@@ -110,7 +114,7 @@ $labels = [
                            </th>
                        <?php endif; ?>
                    <?php endforeach; ?>
                    <th rowspan="2">ACTIF</th>
                    <th rowspan="2">Actif</th>
                    <th rowspan="2" class="total">TOTAL</th>
                </tr>
                <tr>
@@ -155,9 +159,11 @@ $labels = [
                                <?= duration($duration) ?>
                            </td>
                        <?php endforeach; ?>
                        <?php if($nbrColProjetLots > 1): ?>
                        <td class="stotal main research <?= $line['totalMain'] ? 'value' : 'empty' ?>">
                            <?= duration($line['totalMain']) ?>
                        </td>
                        <?php endif; ?>

                        <?php foreach ($line['ce'] as $acronym=>$duration): ?>
                            <td class="ce research <?= $duration ? 'value' : 'empty' ?>">
Loading