Commit 9fcd5f31 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Nettoyage de l'ancien code de report de service suite nouveau code

parent a70c7154
Loading
Loading
Loading
Loading
Loading
+1 −9
Changes for module/Enseignement/config/module.config.php: 1 added line, 9 removed lines.
Original line number Diff line number Diff line
@@ -118,14 +118,6 @@ return [
                        'service' => '[0-9]*',
                    ],
                ],
                'initialisation'         => [
                    'route'  => '/initialisation/:intervenant',
                    'action' => 'initialisation',
                ],
                'constatation'           => [
                    'route'  => '/constatation',
                    'action' => 'constatation',
                ],
                'transfert-donnees'      => [
                    'route'  => '/transfert-donnees',
                    'action' => 'transfert-donnees',
@@ -270,7 +262,7 @@ return [
        ],
        [
            'controller' => EnseignementController::class,
            'action'     => ['saisie', 'rafraichir-ligne', 'saisie-form-refresh-vh', 'suppression', 'initialisation', 'constatation', 'transfert-executer'],
            'action'     => ['saisie', 'rafraichir-ligne', 'saisie-form-refresh-vh', 'suppression', 'transfert-executer'],
            'privileges' => [
                Privileges::ENSEIGNEMENT_PREVU_EDITION,
                Privileges::ENSEIGNEMENT_REALISE_EDITION,
−70
Changes for module/Enseignement/src/Controller/EnseignementController.php: 0 added lines, 70 removed lines.
Original line number Diff line number Diff line
@@ -394,76 +394,6 @@ class EnseignementController extends AbstractController



    public function initialisationAction ()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
        $this->getProcessusPlafond()->beginTransaction();
        $this->getServiceService()->setPrevusFromPrevus($intervenant);
        $this->updateTableauxBord($intervenant);
        $this->getProcessusPlafond()->endTransaction($intervenant, $this->getServiceTypeVolumeHoraire()->getPrevu());
        $errors = [];

        $vm = new ViewModel();
        $vm->setTemplate('enseignement/initialisation');
        $vm->setVariables(compact('errors'));

        return $vm;
    }



    public function constatationAction ()
    {
        $this->initFilters();
        $realise  = $this->getServiceTypeVolumeHoraire()->getRealise();
        $services = $this->params()->fromQuery('services');

        if ($services) {
            $services = explode(',', $services);
            foreach ($services as $n => $sid) {
                $services[$n] = $this->getServiceService()->get($sid);

                $intervenant                         = $services[$n]->getIntervenant();
                $intervenants[$intervenant->getId()] = $intervenant;
            }
        }

        if (empty($services)) {
            $this->flashMessenger()->addErrorMessage('Aucun service précisé : constatation impossible');

            return [];
        }

        if (count($intervenants) > 1) {
            $this->flashMessenger()->addErrorMessage('On ne peut constater les services que d\'un seul intervenant à la fois');

            return [];
        }

        $this->getProcessusPlafond()->beginTransaction();

        foreach ($services as $service) {
            $service->setTypeVolumeHoraire($realise);
            if ($this->isAllowed($service, Privileges::ENSEIGNEMENT_REALISE_EDITION)) {
                $this->getServiceService()->setRealisesFromPrevus($service);
            }
        }
        $this->updateTableauxBord($intervenant);

        if (!$this->getProcessusPlafond()->endTransaction($intervenant, $realise)) {
            $this->flashMessenger()->addErrorMessage('La constatation des services réalisés n\'a donc pas pu se faire.');
        } else {
            $this->flashMessenger()->addSuccessMessage('Les services prévisionnels ont été reportés comme réalisés.');
        }

        $vm = new ViewModel();
        $vm->setTemplate('enseignement/constatation');

        return $vm;
    }



    public function transfertDonneesAction()
    {
        $intervenantId = (int)$this->params()->fromQuery('intervenant', 0);
−2
Changes for module/Enseignement/template_map.php: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -4,8 +4,6 @@
 * Commande : ose-code  module='Enseignement'
 */
return [
    'enseignement/constatation'                     => __DIR__ . '/view/enseignement/constatation.phtml',
    'enseignement/initialisation'                   => __DIR__ . '/view/enseignement/initialisation.phtml',
    'enseignement/rafraichir-ligne'                 => __DIR__ . '/view/enseignement/rafraichir-ligne.phtml',
    'enseignement/volume-horaire/saisie-calendaire' => __DIR__ . '/view/enseignement/volume-horaire/saisie-calendaire.phtml',
    'enseignement/volume-horaire/saisie'            => __DIR__ . '/view/enseignement/volume-horaire/saisie.phtml',
−x−3

File deleted.

−x−9

File deleted.

Loading