Commit e4786c99 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Retrait de l'affectation à la création d'une fiche metier

parent cf88b74d
Loading
Loading
Loading
Loading
+0 −20
Changes for module/Application/src/Application/Entity/Db/FicheMetier.php: 0 added lines, 20 removed lines.
Original line number Diff line number Diff line
@@ -12,8 +12,6 @@ class FicheMetier
    private $id;
    /** @var string */
    private $libelle;
    /** @var Affectation */
    private $affectation;
    /** @var Agent */
    private $agent;

@@ -47,24 +45,6 @@ class FicheMetier
        return $this;
    }

    /**
     * @return Affectation
     */
    public function getAffectation()
    {
        return $this->affectation;
    }

    /**
     * @param Affectation $affectation
     * @return FicheMetier
     */
    public function setAffectation($affectation)
    {
        $this->affectation = $affectation;
        return $this;
    }

    /**
     * @return Agent
     */
+0 −5
Changes for module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.FicheMetier.dcm.xml: 0 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -7,11 +7,6 @@
        </id>

        <field name="libelle"           type="string" length="256"      column="libelle"            nullable="false"/>

        <many-to-one target-entity="Application\Entity\Db\Affectation"  field="affectation">
            <join-column name="affectation" referenced-column-name="id"/>
        </many-to-one>

        <field name="histoCreation"     type="datetime"                 column="histo_creation"     nullable="false"/>
        <field name="histoModification" type="datetime"                 column="histo_modification" nullable="false"/>
        <field name="histoDestruction"  type="datetime"                 column="histo_destruction"  nullable="true"/>
+0 −27
Changes for module/Application/src/Application/Form/FicheMetier/FicheMetierCreationForm.php: 0 added lines, 27 removed lines.
Original line number Diff line number Diff line
@@ -2,15 +2,11 @@

namespace Application\Form\FicheMetier;

use Application\Entity\Db\Affectation;
use DoctrineModule\Form\Element\ObjectSelect;
use UnicaenApp\Service\EntityManagerAwareTrait;
use Zend\Form\Element\Button;
use Zend\Form\Element\Text;
use Zend\Form\Form;

class FicheMetierCreationForm extends Form {
    use EntityManagerAwareTrait;

    public function init()
    {
@@ -25,29 +21,6 @@ class FicheMetierCreationForm extends Form {
                'id' => 'libelle',
            ],
        ]);
        //Selection obligatoire AFFECTATION
        $this->add([
            'type' => ObjectSelect::class,
            'name' => 'affectation',
            'options' => [
                'label' => "Service/composante/direction d'affectation :",
                'empty_option' => "Sélectionner une affectation",
                'object_manager' => $this->getEntityManager(),
                'target_class' => Affectation::class,
                'property' => 'libelle',
                'find_method' => [
                    'name' => 'findBy',
                    'params' => [
                        'criteria' => [],
                        'orderBy' => ['libelle' => 'ASC'],
                    ],
                ],
                'disable_inarray_validator' => true,
            ],
            'attributes' => [
                'id' => 'affectation',
            ],
        ]);

//        submit
        $this->add([
+0 −2
Changes for module/Application/src/Application/Form/FicheMetier/FicheMetierCreationHydrator.php: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ class FicheMetierCreationHydrator implements HydratorInterface {
    {
        $data = [
            'libelle' => $object->getLibelle(),
            'affectation' => ($object->getAffectation())?$object->getAffectation()->getId():null,
            ];

        return $data;
@@ -33,7 +32,6 @@ class FicheMetierCreationHydrator implements HydratorInterface {
        $affectation = $this->getAffectationService()->getAffectation($data['affectation']);

        $object->setLibelle($data['libelle']);
        $object->setAffectation($affectation);
        return $object;
    }

+4 −5
Changes for module/Application/view/application/fiche-metier/afficher.phtml: 4 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ $canEditer = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPr

<h1 class="page-header">
    Fiche métier : <?php echo $fiche->getLibelle(); ?> <br/>
    Affectation : <?php echo $fiche->getAffectation(); ?>
</h1>


@@ -82,13 +81,13 @@ $canEditer = $this->isAllowed(FicheMetierPrivileges::getResourceId(FicheMetierPr
    </div>
    <div class="panel-body">
            <h3> Affectation du poste </h3>
            <?php if ($fiche->getAffectation() !== null) : ?>
                <?php if ($fiche->getAffectation()->getDescription() !== null) :?>
                    <?php echo $fiche->getAffectation()->getDescription(); ?>
            <?php if ($fiche->getPoste() !== null && $fiche->getPoste()->getAffectation() !== null) : ?>
                <?php if ($fiche->getPoste()->getAffectation()->getDescription() !== null) :?>
                    <?php echo $fiche->getPoste()->getAffectation()->getDescription(); ?>
                <?php else: ?>
                    <div class="alert alert-warning">
                        <i class="fas fa-exclamation-triangle"></i>
                        Aucune description de fournie pour l'affectation <em><?php echo $fiche->getAffectation()->getLibelle(); ?></em>.
                        Aucune description de fournie pour l'affectation <em><?php echo $fiche->getPoste()->getAffectation()->getLibelle(); ?></em>.
                    </div>
                <?php endif; ?>
            <?php else : ?>
Loading