Commit f01e66b4 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Merge branches 'alc-pj-duree-vie' and 'master' of...

Merge branches 'alc-pj-duree-vie' and 'master' of https://git.unicaen.fr/open-source/OSE into alc-pj-duree-vie
parents 3c31b391 5bb100c9
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
# OSE 13.0 ALPHA

## Correction de bugs

* La page de saisie des services était accessible en écrivant la bonne URL, même si le workflow ne permettait pas d'arriver à cette étape.

# OSE 12.2

## Correction de bug

* Depuis la V12, la formule de calcul ne distinguait plus si le service était effectué dans la composante d'affectation de l'intervenant ou dans une autre composante. C'est rétabli. 

# OSE 12.1

## Correction de bugs
+6 −6
Original line number Diff line number Diff line
@@ -33694,10 +33694,10 @@ SELECT
  CASE WHEN ep.id IS NOT NULL THEN ep.taux_fi ELSE 1 END               taux_fi,
  CASE WHEN ep.id IS NOT NULL THEN ep.taux_fa ELSE 0 END               taux_fa,
  CASE WHEN ep.id IS NOT NULL THEN ep.taux_fc ELSE 0 END               taux_fc,
  s.id                                                                 structure_id,
  s.code                                                               structure_code,
  CASE WHEN COALESCE(s.id,0) = COALESCE(i.structure_id,0)      THEN 1 ELSE 0 END structure_is_affectation,
  CASE WHEN COALESCE(s.id,0) = COALESCE(to_number(p.valeur),0) THEN 1 ELSE 0 END structure_is_univ,
  str.id                                                               structure_id,
  str.code                                                             structure_code,
  CASE WHEN COALESCE(str.id,0) = COALESCE(i.structure_id,0)      THEN 1 ELSE 0 END structure_is_affectation,
  CASE WHEN COALESCE(str.id,0) = COALESCE(to_number(p.valeur),0) THEN 1 ELSE 0 END structure_is_univ,
  MAX(COALESCE( m.ponderation_service_du, 1))                          ponderation_service_du,
  MAX(COALESCE( m.ponderation_service_compl, 1))                       ponderation_service_compl,
  COALESCE(tf.service_statutaire,1)                                    service_statutaire,
@@ -33718,7 +33718,7 @@ FROM
       JOIN type_volume_horaire      tvh ON tvh.id = vh.type_volume_horaire_id
  LEFT JOIN element_pedagogique       ep ON ep.id = s.element_pedagogique_id
  LEFT JOIN structure                  s ON s.id = ep.structure_id
  LEFT JOIN structure                str ON str.id = ep.structure_id
  LEFT JOIN etape                      e ON e.id = ep.etape_id
  LEFT JOIN type_formation            tf ON tf.id = e.type_formation_id
  LEFT JOIN element_modulateur        em ON em.element_id = s.element_pedagogique_id
@@ -33733,7 +33733,7 @@ WHERE
  AND s.intervenant_id = COALESCE( OSE_FORMULE.GET_INTERVENANT_ID, s.intervenant_id )
GROUP BY
  vh.id, s.id, s.intervenant_id, ti.id, vh.type_volume_horaire_id, vhe.etat_volume_horaire_id, tvh.code,
  ep.id, ep.taux_fi, ep.taux_fa, ep.taux_fc, s.id, s.code, tf.service_statutaire, vh.heures,
  ep.id, ep.taux_fi, ep.taux_fa, ep.taux_fc, str.id, str.code, tf.service_statutaire, vh.heures,
  vh.horaire_debut, vh.horaire_fin, tis.taux_hetd_service, tis.taux_hetd_complementaire,
  ti.code, ti.taux_hetd_service, ti.taux_hetd_complementaire, i.structure_id, p.valeur
+36 −9
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ use Application\Entity\Db\WfEtape;
use Application\Provider\Privilege\Privileges;
use Application\Service\Traits\CampagneSaisieServiceAwareTrait;
use Application\Service\Traits\ContextServiceAwareTrait;
use Application\Service\Traits\TypeVolumeHoraireServiceAwareTrait;
use Application\Service\Traits\ValidationServiceAwareTrait;
use Application\Service\Traits\WorkflowServiceAwareTrait;
use UnicaenAuth\Assertion\AbstractAssertion;
@@ -30,6 +31,7 @@ class ServiceAssertion extends AbstractAssertion
    use ContextServiceAwareTrait;
    use CampagneSaisieServiceAwareTrait;
    use ValidationServiceAwareTrait;
    use TypeVolumeHoraireServiceAwareTrait;



@@ -59,10 +61,12 @@ class ServiceAssertion extends AbstractAssertion
            ) { // dans ce cas ce n'est pas le WF qui agit mais on voit la validation dès qu'on a des services directement...
                // car on peut très bien avoir à visualiser cette page sans pour autant avoir de services à soi à valider!!
                return $this->assertHasServices($intervenant, $role->getStructure());
            }else if (!$this->assertEtapeAtteignable($etape, $intervenant)) {
            } else {
                if (!$this->assertEtapeAtteignable($etape, $intervenant)) {
                    return false;
                }
            }
        }

        if ($intervenant && isset($page['route'])) {
            switch ($page['route']) {
@@ -176,6 +180,8 @@ class ServiceAssertion extends AbstractAssertion
                return $this->assertImportAgenda($role);

            break;
            case 'Application\Controller\Intervenant.services':
                return $this->assertPageServices($role, $intervenant);
        }

        return true;
@@ -183,6 +189,23 @@ class ServiceAssertion extends AbstractAssertion



    protected function assertPageServices(Role $role, Intervenant $intervenant = null)
    {
        if (!$intervenant) return true;

        $typeVolumehoraireCode = $this->getMvcEvent()->getRouteMatch()->getParam('type-volume-horaire-code');
        $typeVolumeHoraire     = $this->getServiceTypeVolumeHoraire()->getByCode($typeVolumehoraireCode);

        $wfEtape = $this->getWorkflowEtape($typeVolumeHoraire, 'saisie');

        return $this->asserts([
            $this->assertIntervenant($role, $intervenant),
            $this->assertEtapeAtteignable($wfEtape, $intervenant),
        ]);
    }



    protected function assertEnseignements(Role $role)
    {
        return $this->asserts([
@@ -293,8 +316,10 @@ class ServiceAssertion extends AbstractAssertion
    {
        $services = $intervenant->getService()->filter(function (Service $service) use ($structure) {
            if (!$service->getElementPedagogique()) return false;

            return $service->getElementPedagogique()->getStructure() == $structure;
        });

        return $services->count() > 0;
    }

@@ -309,6 +334,7 @@ class ServiceAssertion extends AbstractAssertion
            );
            if (!$campagneSaisie->estOuverte()) return false;
        }

        return true;
    }

@@ -329,6 +355,7 @@ class ServiceAssertion extends AbstractAssertion
                if ($cloture && $cloture->getId()) return false; // pas de saisie si c'est clôturé
            }
        }

        return true;
    }