Commit 8a7fd7c9 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Merge branch 'master' of https://git.unicaen.fr/lib/unicaen/app

parents e4584976 988cc105
Loading
Loading
Loading
Loading
Loading
+3 −1
Changes for .gitlab-ci.yml: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
image: registre.unicaen.fr:5000/unicaen-dev-php7.3-apache

stages:
- tests
- publish
- tests

cache:
  key: ${CI_COMMIT_REF_SLUG}
+13 −1
Changes for CHANGELOG.md: 13 added lines, 1 removed line.
Original line number Diff line number Diff line
CHANGELOG
=========

3.1.7 (28/05/2020)
------------------
Génération de PDF : fusion de toutes les variables dans les scripts de création des header et footer.

3.1.6 (09/04/2020)
------------------
Formulaires multipages : améliorations et modifications (rupture de compatibilité probable).

3.0.0 (17/09/2019)
------------------
Première version officielle sous ZF3.


3.0.1 (19/09/2019)
------------------
- Corrections
@@ -15,3 +22,8 @@ Première version officielle sous ZF3.
------------------
- Correction
  - Bug corrigé sur le validateur d'INSEE qui ne passait pas avec les corses
  
3.1.5 (24/03/2020)
------------------
- MultipageFormPlugin : possibilité d'omettre le formulaire lors de l'invoke
- MultipageForm : simplification des clés dans la liste des fieldsets ; possibilité de retirer un fieldset ; ajout de l'élément de navigation dans prepare().
+230 −191

File changed.

Preview size limit exceeded, changes collapsed.

+2
Changes for src/UnicaenApp/Exporter/Pdf.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -401,6 +401,7 @@ class Pdf implements ExporterInterface
            'headerTitle'    => $this->headerTitle,
            'headerSubtitle' => $this->headerSubtitle,
            'logo'           => $this->logo);
        $scriptVars = array_merge($scriptVars, current($this->scriptVars));

        // le logo doit être passé ainsi pour pouvoir être référencé dans la balise <img> sous la forme "var:logo"
        $this->getMpdf()->imageVars['logo'] = $this->logo;
@@ -492,6 +493,7 @@ class Pdf implements ExporterInterface
        
        $scriptVars = array(
            'footerTitle' => $this->footerTitle);
        $scriptVars = array_merge($scriptVars, current($this->scriptVars));
        
        if (isset($this->footerScripts['O'])) {
            $footerOdd = $this->getRenderer()->render($this->footerScripts['O'], $scriptVars);
+106 −42
Changes for src/UnicaenApp/Form/Element/MultipageFormNavElement.php: 106 added lines, 42 removed lines.
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ use Zend\Form\Element\Submit;
 * Boutons présents selon le contexte : "Précédent", "Suivant", "Terminer", "Annuler".
 *
 * @author Bertrand GAUTHIER <bertrand.gauthier@unicaen.fr>
 * @deprecated Remplacé par {@see MultipageFormNavFieldset}
 */
class MultipageFormNavElement extends Element
{
@@ -47,36 +48,93 @@ class MultipageFormNavElement extends Element
    /**
     * @var boolean
     */
    private $activatePrevious = false;
    private $previousEnabled = false;
    /**
     * @var boolean
     */
    private $activateNext = true;
    private $nextEnabled = true;
    /**
     * @var boolean
     */
    private $activateSubmit = false;
    private $submitEnabled = false;
    /**
     * @var boolean
     */
    private $activateCancel = true;
    private $cancelEnabled = true;
    /**
     * @var boolean
     */
    private $activateConfirm = false;
    private $confirmEnabled = false;

    /**
     * {@inheritDoc}
     */
    public function __construct($name = self::NAME, $options = array())
    private function __construct($name = null, $options = [])
    {
        parent::__construct($name, $options);

        $this->setPreviousEnabled(false)
//        $this->getNextButton();
        $this->getPreviousButton();
//        $this->getCancelButton();
//        $this->getSubmitButton();
//        $this->getConfirmButton();

        $this
            ->setPreviousEnabled(false)
            ->setNextEnabled(true)
            ->setSubmitEnabled(false)
            ->setCancelEnabled(true)
            ->setConfirmEnabled(false);
    }

    /**
     * @param array $options
     * @return self
     */
    static public function create(array $options = []): self
    {
        return new static(static::NAME, $options);
    }

    /**
     * @param MultipageFormNavElement $prototype
     * @return self
     */
    static public function createFromPrototype(MultipageFormNavElement $prototype)
    {
        $instance = clone $prototype;

        $instance->setAttributes($prototype->getAttributes());
        $instance->setOptions($prototype->getOptions());
        $instance->setLabelOptions($prototype->getLabelOptions());
        $instance->setValue($prototype->getValue());
        $instance->setLabel($prototype->getLabel());

        $instance
            ->setPreviousEnabled(false)
            ->setNextEnabled(true)
            ->setSubmitEnabled(false)
            ->setCancelEnabled(true)
            ->setConfirmEnabled(false);

        return $instance;
    }

    /**
     * @param MultipageFormNavElement $prototype
     * @return self
     */
    static public function createFromPrototypePrec(MultipageFormNavElement $prototype)
    {
        $instance = static::create();

        $instance->setAttributes($prototype->getAttributes());
        $instance->setOptions($prototype->getOptions());
        $instance->setLabelOptions($prototype->getLabelOptions());
        $instance->setValue($prototype->getValue());
        $instance->setLabel($prototype->getLabel());

        return $instance;
    }

    /**
@@ -87,15 +145,16 @@ class MultipageFormNavElement extends Element
        if ($this->nextButton === null) {
            $name = $this->getName();

            $labelNext    = ("Suivant >");
            $titleNext    = ("Passer à l'étape suivante");
            $label    = ("Suivant >");
            $title    = ("Passer à l'étape suivante");

            $this->nextButton = new Submit(
                $name . '[' . MultipageFormNavElement::NEXT . ']'
                $name . '[' . MultipageFormNavElement::NEXT . ']',
                ['label' => $label]
            );
            $this->nextButton->setValue($labelNext);
            $this->nextButton->setValue($label);
            $this->nextButton->setAttributes([
                'title' => $titleNext,
                'title' => $title,
                'class' => 'multipage-nav next']);
        }

@@ -110,16 +169,16 @@ class MultipageFormNavElement extends Element
        if ($this->previousButton === null) {
            $name = $this->getName();

            $labelPrev    = ("< Précédent");
            $titlePrev    = ("Revenir à l'étape précédente");
            $label    = ("< Précédent");
            $title    = ("Revenir à l'étape précédente");

            $this->previousButton = new Submit(
                $name . '[' . MultipageFormNavElement::PREVIOUS . ']',
                ['label' => $labelPrev]
                ['label' => $label]
            );
            $this->previousButton->setValue($labelPrev);
            $this->previousButton->setValue($label);
            $this->previousButton->setAttributes([
                'title' => $titlePrev,
                'title' => $title,
                'class' => 'multipage-nav previous', 'style'=>'float: left;']);
        }

@@ -134,16 +193,16 @@ class MultipageFormNavElement extends Element
        if ($this->cancelButton === null) {
            $name = $this->getName();

            $labelCancel  = ("Annuler");
            $titleCancel  = ("Abandonner définitivement la saisie");
            $label  = ("Annuler");
            $title  = ("Abandonner définitivement la saisie");

            $this->cancelButton = new Submit(
                $name . '[' . MultipageFormNavElement::CANCEL . ']',
                ['label' => $labelCancel]
                ['label' => $label]
            );
            $this->cancelButton->setValue($labelCancel);
            $this->cancelButton->setValue($label);
            $this->cancelButton->setAttributes([
                'title'   => $titleCancel,
                'title'   => $title,
                'class'   => 'multipage-nav cancel',
                'onclick' => 'askConfirmation(this)',
            ]);
@@ -160,16 +219,16 @@ class MultipageFormNavElement extends Element
        if ($this->submitButton === null) {
            $name = $this->getName();

            $labelSubmit  = ("Terminer");
            $titleSubmit  = ("Terminer la saisie");
            $label  = ("Terminer");
            $title  = ("Terminer la saisie");

            $this->submitButton = new Submit(
                $name . '[' . MultipageFormNavElement::SUBMIT . ']',
                ['label' => $labelSubmit]
                ['label' => $label]
            );
            $this->submitButton->setValue($labelSubmit);
            $this->submitButton->setValue($label);
            $this->submitButton->setAttributes([
                'title' => $titleSubmit,
                'title' => $title,
                'class' => 'multipage-nav submit']);
        }

@@ -184,16 +243,16 @@ class MultipageFormNavElement extends Element
        if ($this->confirmButton === null) {
            $name = $this->getName();

            $labelConfirm = ("Confirmer et enregistrer");
            $titleConfirm = ("Confirmer et enregistrer la saisie");
            $label = ("Confirmer et enregistrer");
            $title = ("Confirmer et enregistrer la saisie");

            $this->confirmButton = new Submit(
                $name . '[' . MultipageFormNavElement::CONFIRM . ']',
                ['label' => $labelConfirm]
                ['label' => $label]
            );
            $this->confirmButton->setValue($labelConfirm);
            $this->confirmButton->setValue($label);
            $this->confirmButton->setAttributes([
                'title' => $titleConfirm,
                'title' => $title,
                'class' => 'multipage-nav confirm']);
        }

@@ -208,7 +267,8 @@ class MultipageFormNavElement extends Element
     */
    public function setPreviousEnabled($value = true)
    {
        $this->activatePrevious = $value;
        $this->previousEnabled = $value;

        return $this;
    }
    
@@ -220,7 +280,8 @@ class MultipageFormNavElement extends Element
     */
    public function setNextEnabled($value = true)
    {
        $this->activateNext = $value;
        $this->nextEnabled = $value;

        return $this;
    }
    
@@ -232,7 +293,8 @@ class MultipageFormNavElement extends Element
     */
    public function setSubmitEnabled($value = true)
    {
        $this->activateSubmit = $value;
        $this->submitEnabled = $value;

        return $this;
    }
    
@@ -244,7 +306,8 @@ class MultipageFormNavElement extends Element
     */
    public function setCancelEnabled($value = true)
    {
        $this->activateCancel = $value;
        $this->cancelEnabled = $value;

        return $this;
    }
    
@@ -256,7 +319,8 @@ class MultipageFormNavElement extends Element
     */
    public function setConfirmEnabled($value = true)
    {
        $this->activateConfirm = $value;
        $this->confirmEnabled = $value;

        return $this;
    }

@@ -267,7 +331,7 @@ class MultipageFormNavElement extends Element
     */
    public function isPreviousEnabled()
    {
        return $this->activatePrevious;
        return $this->previousEnabled;
    }
    
    /**
@@ -277,7 +341,7 @@ class MultipageFormNavElement extends Element
     */
    public function isNextEnabled()
    {
        return $this->activateNext;
        return $this->nextEnabled;
    }
    
    /**
@@ -287,7 +351,7 @@ class MultipageFormNavElement extends Element
     */
    public function isSubmitEnabled()
    {
        return $this->activateSubmit;
        return $this->submitEnabled;
    }
    
    /**
@@ -297,7 +361,7 @@ class MultipageFormNavElement extends Element
     */
    public function isCancelEnabled()
    {
        return $this->activateCancel;
        return $this->cancelEnabled;
    }
    
    /**
@@ -307,6 +371,6 @@ class MultipageFormNavElement extends Element
     */
    public function isConfirmEnabled()
    {
        return $this->activateConfirm;
        return $this->confirmEnabled;
    }
}
 No newline at end of file
Loading