Commit 196ff47e authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Mise en place du nouveau système de génération des contrats

parent 93fb37ed
Loading
Loading
Loading
Loading
+107 −4
Changes for code/test3.php: 107 added lines, 4 removed lines.
Original line number Diff line number Diff line
<?php

/**
 * @var $this       \Application\View\Renderer\PhpRenderer
 * @var $controller \Zend\Mvc\Controller\AbstractController
 * @var $viewName   string
 * @var $sl         \Zend\ServiceManager\ServiceLocatorInterface
 */

use Unicaen\OpenDocument\Document;

$r = new Document('/home/laurent/Contrat.odt');

$m = $r->getMeta();
$d = [
    [
        'nom'                      => 'Lécluse',
        'prenom'                   => 'Laurent',
        'sec1'                     => false,

        'dpl_libelle@table:table-row' => [
            [
                'dpl_libelle'             => 'MASTER',
                'dpl_annee'               => '2016/2017',
                'prof_nom@text:list-item' => [
                    [
                        'prof_nom'    => 'Gaultier',
                        'prof_prenom' => 'Jean-paul',
                    ],
                    [
                        'prof_nom'    => 'Stingwitch',
                        'prof_prenom' => 'Serge',
                    ],
                ],
            ],
            [
                'dpl_libelle'             => 'Licence',
                'dpl_annee'               => '2013/2014',
                'prof_nom@text:list-item' => [
                    [
                        'prof_nom'    => 'Diouf',
                        'prof_prenom' => 'Mouss',
                    ],
                    [
                        'prof_nom'    => 'Poeld',
                        'prof_prenom' => 'Thony',
                    ],
                ],
            ],
        ],
    ],

    [
        'nom'                      => 'Fery',
        'prenom'                   => 'Karin',
        'sec1@text:section'       => [
            ['secvar' => 'Varsec1',],
            ['secvar' => 'Varsec2',]
        ],
        'dpl_libelle@table:table-row' => [
            [
                'dpl_libelle'             => 'Ingé',
                'annee'                   => '2011/2012',
                'prof_nom@text:list-item' => [
                    [
                        'prof_nom'    => 'Gaul1',
                        'prof_prenom' => 'Jean-paul2',
                    ],
                    [
                        'prof_nom'    => 'Stingwitch2',
                        'prof_prenom' => 'Serge2',
                    ],
                ],
            ],
            [
                'dpl_libelle'             => 'Licence3',
                'annee'                   => '2010/2011',
                'prof_nom@text:list-item' => [
                    [
                        'prof_nom'    => 'Diouf2',
                        'prof_prenom' => 'Mouss2
poto',
                    ],
                    [
                        'prof_nom'    => 'Poeld2',
                        'prof_prenom' => 'Thony2',
                    ],
                ],
            ],
        ],
    ],
];


///** @var ModeleContrat $contrat */
//$contrat = $sl->get(ModeleContratService::class)->get(3);

$document = new Document();
$document->setTmpDir('/home/laurent/UnicaenCode');
//$document->loadFromData($contrat->getFichier());
$document->loadFromFile('/home/laurent/UnicaenCode/srcodt.odt');
$p = $document->publish($d);

//xmlDump($document->getContent());
$document->setPdfOutput(true);
//$document->saveToFile('/home/laurent/UnicaenCode/odtExport.pdf');

xmlDump($document->getPublisher()->getOutContent());

$document->download('exp.pdf');





var_dump($m);
var_dump($m->getUserDefined('testUD'));
 No newline at end of file
+25
Changes for code/test6.php: 25 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -6,3 +6,28 @@
 * @var $viewName   string
 * @var $sl         \Zend\ServiceManager\ServiceLocatorInterface
 */

use Application\Service\ModeleContratService;
use Unicaen\OpenDocument\Document;

$fichier = '/home/laurent/Téléchargements/testfill.odt';
//$fichier = '/home/laurent/UnicaenCode/srcodt.odt';
//$fichier = '/home/laurent/tt.odt';
//$fichier = '/home/laurent/Téléchargements/Contrat.odt';

$modeleContrat = $sl->get(ModeleContratService::class)->get(13);

$document = new Document();
$document->setTmpDir('/home/laurent/UnicaenCode');
//$document->loadFromFile($fichier);
$document->loadFromData($modeleContrat->getFichier());

$document->getStylist()->addFiligrane('PROJET');

$document->setStylesChanged(true);
xmlDump($document->getStyles());
$document->setPdfOutput(true);
//$document->saveToFile('/home/laurent/UnicaenCode/odtExport.pdf');


//$document->download('exp.pdf');
+1 −1
Changes for composer.json: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -19,6 +19,6 @@
        "unicaen/code"              : "1.1.6",
        "unicaen/import"            : "1.1.6",
        "unicaen/tbl"               : "1.0.3",
        "unicaen/open-document"     : "dev-master"
        "unicaen/open-document"     : "1.1"
    }
}
+5 −6
Changes for composer.lock: 5 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
        "This file is @generated automatically"
    ],
    "content-hash": "a9239b2e807d15736ea5b3b36f79acfb",
    "content-hash": "2d8484ab3ebb905c81684d9433a4de9f",
    "packages": [
        {
            "name": "bjyoungblood/bjy-authorize",
@@ -1584,11 +1584,11 @@
        },
        {
            "name": "unicaen/open-document",
            "version": "dev-master",
            "version": "1.1",
            "source": {
                "type": "git",
                "url": "https://git.unicaen.fr/lib/unicaen/open-document.git",
                "reference": "bfc492c88e7e60b916348063308f67178b07ef47"
                "reference": "a5caafa705ce6e30da2ef44d45f0531c9e931e2a"
            },
            "type": "library",
            "autoload": {
@@ -1600,7 +1600,7 @@
                ]
            },
            "description": "Module Unicaen de traitement des fichiers au format OpenDocument",
            "time": "2018-03-01T14:53:17+00:00"
            "time": "2018-09-19T14:53:12+00:00"
        },
        {
            "name": "unicaen/oracle",
@@ -3983,8 +3983,7 @@
    "aliases": [],
    "minimum-stability": "stable",
    "stability-flags": {
        "bjyoungblood/bjy-authorize": 20,
        "unicaen/open-document": 20
        "bjyoungblood/bjy-authorize": 20
    },
    "prefer-stable": false,
    "prefer-lowest": false,
+10
Changes for data/Mises à jour/07.0.sql: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -283,24 +283,34 @@ CREATE TABLE modele_contrat (
  fichier                 BLOB,
  requete                 VARCHAR2(4000 CHAR),
  bloc1_nom               VARCHAR2(50 CHAR),
  bloc1_zone              VARCHAR2(80 CHAR),
  bloc1_requete           VARCHAR2(4000 CHAR),
  bloc2_nom               VARCHAR2(50 CHAR),
  bloc2_zone              VARCHAR2(80 CHAR),
  bloc2_requete           VARCHAR2(4000 CHAR),
  bloc3_nom               VARCHAR2(50 CHAR),
  bloc3_zone              VARCHAR2(80 CHAR),
  bloc3_requete           VARCHAR2(4000 CHAR),
  bloc4_nom               VARCHAR2(50 CHAR),
  bloc4_zone              VARCHAR2(80 CHAR),
  bloc4_requete           VARCHAR2(4000 CHAR),
  bloc5_nom               VARCHAR2(50 CHAR),
  bloc5_zone              VARCHAR2(80 CHAR),
  bloc5_requete           VARCHAR2(4000 CHAR),
  bloc6_nom               VARCHAR2(50 CHAR),
  bloc6_zone              VARCHAR2(80 CHAR),
  bloc6_requete           VARCHAR2(4000 CHAR),
  bloc7_nom               VARCHAR2(50 CHAR),
  bloc7_zone              VARCHAR2(80 CHAR),
  bloc7_requete           VARCHAR2(4000 CHAR),
  bloc8_nom               VARCHAR2(50 CHAR),
  bloc8_zone              VARCHAR2(80 CHAR),
  bloc8_requete           VARCHAR2(4000 CHAR),
  bloc9_nom               VARCHAR2(50 CHAR),
  bloc9_zone              VARCHAR2(80 CHAR),
  bloc9_requete           VARCHAR2(4000 CHAR),
  bloc10_nom              VARCHAR2(50 CHAR),
  bloc10_zone             VARCHAR2(80 CHAR),
  bloc10_requete          VARCHAR2(4000 CHAR)
)
LOGGING;
Loading