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

Version Excel de la synthèse mensuelle des déclarations

parent 573b6a70
Loading
Loading
Loading
Loading
+2 −1
Changes for composer.json: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -23,7 +23,8 @@
    "elasticsearch/elasticsearch": "^6.0",
    "swiftmailer/swiftmailer": "^6.0",
    "zendframework/zend-text": "^2.4",
    "phpoffice/phpword": "^0.14.0"
    "phpoffice/phpword": "^0.14.0",
    "phpoffice/phpspreadsheet": "^1.6"
  },
  "require-dev": {
    "phpmd/phpmd": "@stable",
+750 −87

File changed.

Preview size limit exceeded, changes collapsed.

+12 −3
Changes for module/Oscar/src/Oscar/Controller/TimesheetController.php: 12 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ use Oscar\Entity\WorkPackagePerson;
use Oscar\Exception\OscarException;
use Oscar\Form\ActivityDateForm;
use Oscar\Form\ActivityTypeForm;
use Oscar\Formatter\TimesheetActivityPeriodFormatter;
use Oscar\Formatter\TimesheetsMonthFormatter;
use Oscar\Provider\Privileges;
use Oscar\Service\TimesheetService;
@@ -501,11 +502,19 @@ class TimesheetController extends AbstractOscarController
        $error = null;

        $output = $this->getTimesheetService()->getSynthesisActivityPeriod($activity_id, $period);
        if( $format == 'html' ){
            return $output;
        if( $format == 'json' ){
            return $this->jsonOutput($output);
        }
        elseif ($format == "excel") {
            $formatter = new TimesheetActivityPeriodFormatter();
            $formatter->output($output, 'excel');
        }
        elseif ($format == "pdf") {
            $formatter = new TimesheetActivityPeriodFormatter();
            $formatter->output($output, 'pdf');
        }
        else {
            return $this->jsonOutput($output);
            return $output;
        }
    }

+624 −0

File added.

Preview size limit exceeded, changes collapsed.

+23 −74
Changes for module/Oscar/view/oscar/timesheet/synthesis-activity-period.phtml: 23 added lines, 74 removed lines.
Original line number Diff line number Diff line
@@ -53,6 +53,24 @@ $labels = [
    }
</style>

    <div class="container-fluid">

        <h1>
            <em>Synthèse des déclarations pour</em><br>
            <strong><?= $activity['projectacronym'] ?></strong> <?= $activity['project'] ?><br>
            <i class="icon-calendar"></i> Du <strong><?= $period['startLabel'] ?></strong>
            au <strong><?= $period['endLabel'] ?></strong>
        </h1>
        <p>
            <a class="btn btn-primary" href="/feuille-de-temps/synthesisactivity?activity_id=<?= $activity['id'] ?>&format=excel&period=<?= $period['year'] ?>-<?= $period['month'] ?>">
                <i class="icon-file-excel"></i>
            Télécharger la version Excel
            </a>
            <a class="btn btn-primary disabled" href="/feuille-de-temps/synthesisactivity?activity_id=<?= $activity['id'] ?>&format=pdf&period=<?= $period['year'] ?>-<?= $period['month'] ?>">
                <i class="icon-file-pdf"></i>
                Télécharger la version PDF (bientôt disponible)
            </a>
        </p>
<table class="table table-condensed" style="border: 0">
    <thead>
        <tr>
@@ -65,7 +83,7 @@ $labels = [

            $colEDU = count()
            ?>
            <th class="research" colspan="<?= $colWP + $colCE + $colSEARCH +1 ?>"><i class="icon-beaker"></i> Recherche</th>
            <th class="research" colspan="<?= $colWP + $colCE + $colSEARCH +1 ?>"><i class="icon-beaker"></i> Recherches</th>

            <?php foreach ($othersGroups as $k=>$othersGroup): if( $k == 'research') continue;?>
                <th class="<?= $k ?>" colspan="<?= count($othersGroup)+(count($othersGroup)>1 ? 1 : 0) ?>">
@@ -77,9 +95,9 @@ $labels = [
        <tr>
            <th>&nbsp;</th>

            <th class="research" colspan="<?= $colWP ?>"><i class="icon-cubes"></i> PROJET</th>
            <th class="research" colspan="<?= $colCE ?>"><i class="icon-cubes"></i> autres projets</th>
            <th class="research" colspan="<?= $colSEARCH ?>"><i class="icon-cubes"></i> autres recherches</th>
            <th class="research" colspan="<?= $colWP ?>"><i class="icon-cubes"></i> <?= $activity['label'] ?></th>
            <th class="research" colspan="<?= $colCE ?>"><i class="icon-cubes"></i> Projets</th>
            <th class="research" colspan="<?= $colSEARCH ?>"><i class="icon-cubes"></i> Autres</th>
            <th class="research" rowspan="2">TOTAL</th>

            <?php foreach ($othersGroups as $k=>$othersGroup): if( $k == 'research') continue;?>
@@ -271,73 +289,4 @@ $labels = [
    </tr>
    </tfoot>
</table>

<?php /*
<table class="table table-condensed" style="border: 0">
    <thead>
        <tr>
            <th>&nbsp;</th>
            <th class="research" colspan="<?= count($wps)+1 +count($ces)+1 + count($research) ?>"><i class="icon-beaker"></i> Recherche</th>

            <?php foreach ($othersGroups as $k=>$othersGroup): if( $k == 'research') continue;?>
                <th class="<?= $k ?>" colspan="<?= count($othersGroup)+(count($othersGroup)>1 ? 1 : 0) ?>">
                    <i class="icon-<?= $k ?>"></i>
                    <?= $labels[$k] ?>
                </th>
            <?php endforeach; ?>
        </tr>
        <tr>
            <th>&nbsp;</th>
            <th colspan="<?= count($wps)+1 ?>" class="main">
                <strong title="<?= $activity['label'] ?>">
                    <i class="icon-cube"></i>
                    <?= $activity['projectacronym'] ?></strong>
            </th>
            <?php foreach ($ces as $acronym): ?>
                <th class="research ce" rowspan="2">
                    <strong><i class="icon-cube"></i><?= $acronym ?></strong>
                </th>
            <?php endforeach; ?>

            <?php foreach ($othersGroups as $k=>$othersGroup): if( $k != 'research') continue;?>
                <th class="<?= $k ?>" colspan="<?= count($othersGroup)+(count($othersGroup)>1 ? 1 : 0) ?>">
                    <i class="icon-<?= $k ?>"></i>
                    <?= $labels[$k] ?>
                </th>
            <?php endforeach; ?>

            <th class="main" rowspan="2"><strong>TOTAL</strong></th>
            <?php foreach ($othersGroups as $k=>$othersGroup): if( $k == 'research') continue; ?>
                <?php foreach ($othersGroup as $other):?>
            <th class="<?= $k ?>" rowspan="2"><?= $other['label'] ?></th>
                <?php endforeach; ?>
                <?php if(count($othersGroup) > 1): ?>
                    <th class="<?= $k ?>" rowspan="2">Total</th>
                <?php endif; ?>
            <?php endforeach; ?>

            <th>&nbsp;</th>
        </tr>
        <tr>
            <th>&nbsp;</th>
        <?php foreach ($wps as $id=>$wp): ?>
            <th class="main">
                <strong title="<?= $wp['label'] ?>">
                    <?= $wp['code'] ?>
                </strong>
            </th>
        <?php endforeach; ?>

        <th class="main">
            <strong>Total</strong>
        </th>
        </th>
            <th class="">
                <strong>TOTAL MOIS</strong>
            </th>
        </tr>
    </thead>
    <tbody>
/****/

?>
 No newline at end of file
        </div>
 No newline at end of file