diff --git a/module/Application/autoload_classmap.php b/module/Application/autoload_classmap.php index d8ba19065680f294068f425d99ed445241083853..8cecfb8a7ebcdc5d797eea198cb90835ea3e8714 100755 --- a/module/Application/autoload_classmap.php +++ b/module/Application/autoload_classmap.php @@ -80,7 +80,6 @@ return [ 'Application\Entity\Db\Interfaces\IndicateurAwareInterface' => __DIR__ . '/src/Application/Entity/Db/Interfaces/IndicateurAwareInterface.php', 'Application\Entity\Db\Interfaces\ModificationServiceDuAwareInterface' => __DIR__ . '/src/Application/Entity/Db/Interfaces/ModificationServiceDuAwareInterface.php', 'Application\Entity\Db\Interfaces\TypeCentreCoutAwareInterface' => __DIR__ . '/src/Application/Entity/Db/Interfaces/TypeCentreCoutAwareInterface.php', - 'Application\Entity\Db\Interfaces\CiviliteAwareInterface' => __DIR__ . '/src/Application/Entity/Db/Interfaces/CiviliteAwareInterface.php', 'Application\Entity\Db\Interfaces\MotifModificationServiceDuAwareInterface' => __DIR__ . '/src/Application/Entity/Db/Interfaces/MotifModificationServiceDuAwareInterface.php', 'Application\Entity\Db\Interfaces\VolumeHoraireAwareInterface' => __DIR__ . '/src/Application/Entity/Db/Interfaces/VolumeHoraireAwareInterface.php', 'Application\Entity\Db\Interfaces\VServiceValideAwareInterface' => __DIR__ . '/src/Application/Entity/Db/Interfaces/VServiceValideAwareInterface.php', @@ -220,7 +219,6 @@ return [ 'Application\Entity\Db\Traits\TypeIntervenantAwareTrait' => __DIR__ . '/src/Application/Entity/Db/Traits/TypeIntervenantAwareTrait.php', 'Application\Entity\Db\Traits\VServiceValideAwareTrait' => __DIR__ . '/src/Application/Entity/Db/Traits/VServiceValideAwareTrait.php', 'Application\Entity\Db\Traits\FormuleResultatServiceReferentielAwareTrait' => __DIR__ . '/src/Application/Entity/Db/Traits/FormuleResultatServiceReferentielAwareTrait.php', - 'Application\Entity\Db\Traits\CiviliteAwareTrait' => __DIR__ . '/src/Application/Entity/Db/Traits/CiviliteAwareTrait.php', 'Application\Entity\Db\Traits\VIndicAttenteDemandeMepAwareTrait' => __DIR__ . '/src/Application/Entity/Db/Traits/VIndicAttenteDemandeMepAwareTrait.php', 'Application\Entity\Db\Traits\AdresseIntervenantAwareTrait' => __DIR__ . '/src/Application/Entity/Db/Traits/AdresseIntervenantAwareTrait.php', 'Application\Entity\Db\Traits\CentreCoutEpAwareTrait' => __DIR__ . '/src/Application/Entity/Db/Traits/CentreCoutEpAwareTrait.php', diff --git a/module/Application/src/Application/Controller/ContratController.php b/module/Application/src/Application/Controller/ContratController.php index ce289bb3f7ea8ee1579a555c7297cc1ff33f2dc6..c9463d98fc034a74804a80425c83450c2d4e34a4 100755 --- a/module/Application/src/Application/Controller/ContratController.php +++ b/module/Application/src/Application/Controller/ContratController.php @@ -325,109 +325,6 @@ class ContratController extends AbstractController - /** - * - * @todo A Supprimer!!! - * @deprecated - */ - public function exporterOldAction() - { - $this->initFilters(); - - $contrat = $this->getEvent()->getParam('contrat'); - /* @var $contrat Contrat */ - - $intervenant = $contrat->getIntervenant(); - - if (!$this->isAllowed($contrat, ContratAssertion::PRIV_EXPORT)) { - throw new UnAuthorizedException("Génération du contrat interdite."); - } - - $estUnAvenant = $contrat->estUnAvenant(); - $contratToString = (string)$contrat; - $estUnProjet = $contrat->getValidation() ? false : true; - $contratIniModif = $estUnAvenant && $contrat->getContrat()->getStructure() === $contrat->getStructure() ? true : false; - $dateSignature = $estUnProjet ? $contrat->getHistoCreation() : $contrat->getValidation()->getHistoCreation(); - $servicesRecaps = $this->getProcessusContrat()->getServicesRecaps($contrat); // récap de tous les services au sein de la structure d'ens - $totalHETD = $contrat->getTotalHetd() ?: $this->getProcessusContrat()->getIntervenantTotalHetd($intervenant); - - $tauxHoraire = $this->getServiceTauxHoraireHETD()->getByDate($contrat->getHistoCreation()); - - $dossier = $this->getServiceDossier()->getByIntervenant($intervenant); - if ($dossier->getId()) { - $nomIntervenant = strtoupper($dossier->getNomUsuel()) . ' ' . ucfirst($dossier->getPrenom()); - $nomUsuel = $dossier->getNomUsuel(); - $dateNaissance = $dossier->getDateNaissance() ? $dossier->getDateNaissance()->format(Constants::DATE_FORMAT) : $intervenant->getAdressePrincipale(true); - $adresseIntervenant = $dossier->getAdresse(); - $numeroINSEE = $dossier->getNumeroInsee(); - $nomCompletIntervenant = $dossier->getCivilite() . ' ' . $nomIntervenant; - $estUneFemme = $dossier->getCivilite()->estUneFemme(); - $estATV = $dossier->getStatut()->getTemAtv(); - } else { - $nomIntervenant = (string)$intervenant; - $nomUsuel = $intervenant->getNomUsuel(); - $dateNaissance = $intervenant->getDateNaissanceToString(); - $adresseIntervenant = $intervenant->getAdressePrincipale(true); - $numeroINSEE = $intervenant->getNumeroInsee() . ' ' . $intervenant->getNumeroInseeCle(); - $nomCompletIntervenant = $intervenant->getCivilite() . ' ' . $nomIntervenant; - $estUneFemme = $intervenant->getCivilite()->estUneFemme(); - $estATV = $intervenant->getStatut()->getTemAtv(); - } - - $fileName = sprintf(($estUnAvenant ? 'avenant' : 'contrat') . "_%s_%s_%s.pdf", - $contrat->getStructure()->getCode(), - $nomUsuel, - $intervenant->getCode()); - - $variables = [ - 'estUnAvenant' => $estUnAvenant, - 'estUnProjet' => $estUnProjet, - 'contratIniModif' => $contratIniModif, - 'etablissement' => $this->getServiceParametres()->get('contrat_etablissement'), - 'etablissementRepresente' => $this->getServiceParametres()->get('contrat_etablissement_represente'), - 'civilitePresident' => $this->getServiceParametres()->get('contrat_civilite_president'), - 'lieuSignature' => $this->getServiceParametres()->get('contrat_lieu_signature'), - 'nomIntervenant' => $nomIntervenant, - 'f' => $estUneFemme, - 'dateNaissance' => $dateNaissance, - 'adresseIntervenant' => nl2br($adresseIntervenant), - 'numeroINSEE' => $numeroINSEE, - 'estATV' => $estATV, - 'nomCompletIntervenant' => $nomCompletIntervenant, - 'annee' => $intervenant->getAnnee(), - 'dateSignature' => $dateSignature->format(Constants::DATE_FORMAT), - 'servicesRecaps' => $servicesRecaps, - 'totalHETD' => \UnicaenApp\Util::formattedFloat($totalHETD, \NumberFormatter::DECIMAL, 2), - 'tauxHoraire' => $tauxHoraire, - ]; - - // Création du pdf, complétion et envoi au navigateur - $exp = $this->pdf() - ->setHeaderSubtitle($contratToString) - ->setMarginBottom(25) - ->setMarginTop(25); - $exp->setFooterTitle($contratToString . ' - ' . $intervenant->getAnnee()); - if ($estUnProjet) { - $exp->setWatermark("Projet"); - } - - $variables['mentionRetourner'] = "EXEMPLAIRE À CONSERVER"; - $exp->addBodyScript('application/contrat/contrat-pdf.phtml', false, $variables); - - $variables['mentionRetourner'] = "EXEMPLAIRE À RETOURNER " . (($contrat->getStructure()->getAffAdresseContrat()) ? 'SIGNÉ À L\'ADRESSE SUIVANTE :<br />' : ''); - $variables['mentionRetourner'] .= str_replace("\n", ' - ', - $contrat->getStructure()->getAffAdresseContrat() ? - strtoupper($contrat->getStructure()) . "\n" . $contrat->getStructure()->getAdressePrincipale() - : '' - ); - $exp->addBodyScript('application/contrat/contrat-pdf.phtml', true, $variables, 1); - - $exp->export($fileName, Pdf::DESTINATION_BROWSER_FORCE_DL); - die(); // pour éviter de générer une erreur par la suite - } - - - /** * Dépôt du contrat signé. * diff --git a/module/Application/src/Application/Controller/IntervenantController.php b/module/Application/src/Application/Controller/IntervenantController.php index bdb7234f69150d3f56e09db845f7fd828d1ea9ed..c2eaa20c2328d2e88e43f19770e4b1792a548524 100755 --- a/module/Application/src/Application/Controller/IntervenantController.php +++ b/module/Application/src/Application/Controller/IntervenantController.php @@ -420,11 +420,11 @@ class IntervenantController extends AbstractController } $container->recents[$intervenant->getSourceCode()] = [ - 'civilite' => $intervenant->getCivilite()->getLibelleLong(), + 'civilite' => $intervenant->getCivilite() ? $intervenant->getCivilite()->getLibelleLong() : null, 'nom' => $intervenant->getNomUsuel(), 'prenom' => $intervenant->getPrenom(), 'date-naissance' => $intervenant->getDateNaissance(), - 'structure' => $intervenant->getStructure()->getLibelleCourt(), + 'structure' => (string)$intervenant->getStructure(), 'numero-personnel' => $intervenant->getSourceCode(), '__horo_ajout__' => (int)date('U'), ]; diff --git a/module/Application/src/Application/Entity/Db/Dossier.php b/module/Application/src/Application/Entity/Db/Dossier.php index 7bbe578102bd843b002772a9d5373ed7a0f18d8f..99c230edec289d3c7f5fa7b88c41d75ea217b38d 100755 --- a/module/Application/src/Application/Entity/Db/Dossier.php +++ b/module/Application/src/Application/Entity/Db/Dossier.php @@ -156,7 +156,7 @@ class Dossier implements HistoriqueAwareInterface * * @return Dossier */ - public function setCivilite(Civilite $civilite) + public function setCivilite($civilite) { $this->civilite = $civilite; diff --git a/module/Application/src/Application/Entity/Db/Interfaces/CiviliteAwareInterface.php b/module/Application/src/Application/Entity/Db/Interfaces/CiviliteAwareInterface.php deleted file mode 100755 index a8a02b9bf773764560dd24be7a66fff21183f35f..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Entity/Db/Interfaces/CiviliteAwareInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -namespace Application\Entity\Db\Interfaces; - -use Application\Entity\Db\Civilite; - -/** - * Description of CiviliteAwareInterface - * - * @author UnicaenCode - */ -interface CiviliteAwareInterface -{ - /** - * @param Civilite $civilite - * @return self - */ - public function setCivilite( Civilite $civilite = null ); - - - - /** - * @return Civilite - */ - public function getCivilite(); -} \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Intervenant.php b/module/Application/src/Application/Entity/Db/Intervenant.php index 10b1a36de84ea380ea05332150ba3c8e7fb03153..fdbc58f2a753106feb0d5ee82fea35225c41a898 100755 --- a/module/Application/src/Application/Entity/Db/Intervenant.php +++ b/module/Application/src/Application/Entity/Db/Intervenant.php @@ -1359,18 +1359,6 @@ class Intervenant implements HistoriqueAwareInterface, ResourceInterface, AnneeA - /** - * Get civilite - * - * @return string - */ - public function getCiviliteToString() - { - return $this->getCivilite()->getLibelleCourt(); - } - - - /** * Get affectations * diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Intervenant.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Intervenant.dcm.xml index 6c7ef0536e22982e95d62ef702ae3e45baf5e9d8..441ec6171d45b3bb5fb144a67a3e8f6cb539d1e2 100755 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Intervenant.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Intervenant.dcm.xml @@ -27,7 +27,7 @@ <field name="histoCreation" type="datetime" column="HISTO_CREATION" nullable="false"/> <field name="histoDestruction" type="datetime" column="HISTO_DESTRUCTION" nullable="true"/> <field name="histoModification" type="datetime" column="HISTO_MODIFICATION" nullable="false"/> - <field name="nomPatronymique" type="string" column="NOM_PATRONYMIQUE" length="60" nullable="false"/> + <field name="nomPatronymique" type="string" column="NOM_PATRONYMIQUE" length="60" nullable="true"/> <field name="nomUsuel" type="string" column="NOM_USUEL" length="60" nullable="false"/> <field name="numeroInsee" type="string" column="NUMERO_INSEE" length="13" nullable="true"/> <field name="numeroInseeCle" type="string" column="NUMERO_INSEE_CLE" length="2" nullable="true"/> diff --git a/module/Application/src/Application/Entity/Db/Traits/CiviliteAwareTrait.php b/module/Application/src/Application/Entity/Db/Traits/CiviliteAwareTrait.php deleted file mode 100755 index 73f958cd10361d8d37ea135b1ec58d60b15c3aa9..0000000000000000000000000000000000000000 --- a/module/Application/src/Application/Entity/Db/Traits/CiviliteAwareTrait.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace Application\Entity\Db\Traits; - -use Application\Entity\Db\Civilite; - -/** - * Description of CiviliteAwareTrait - * - * @author UnicaenCode - */ -trait CiviliteAwareTrait -{ - /** - * @var Civilite - */ - private $civilite; - - - - - - /** - * @param Civilite $civilite - * @return self - */ - public function setCivilite( Civilite $civilite = null ) - { - $this->civilite = $civilite; - return $this; - } - - - - /** - * @return Civilite - */ - public function getCivilite() - { - return $this->civilite; - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Filter/NomCompletFormatter.php b/module/Application/src/Application/Filter/NomCompletFormatter.php index 41a551e795f4e53140c140510734e655c716e111..8f61ec61655b5897e7fe4471f44c439b42317d17 100755 --- a/module/Application/src/Application/Filter/NomCompletFormatter.php +++ b/module/Application/src/Application/Filter/NomCompletFormatter.php @@ -50,7 +50,7 @@ class NomCompletFormatter extends AbstractFilter $nomUsuel = $value->getNomUsuel(); $nomPatro = $value->getNomPatronymique(); $prenom = $value->getPrenom(); - $civilite = $value->getCiviliteToString(); + $civilite = (string)$value->getCivilite(); } else if ($value instanceof People) { /* @var $value People */ @@ -62,17 +62,10 @@ class NomCompletFormatter extends AbstractFilter else if ($value instanceof Utilisateur) { /* @var $value Utilisateur */ $nomUsuel = $value->getDisplayName(); - $nomPatro = $value->getDisplayName(); + $nomPatro = null; $prenom = ''; $civilite = ''; } - else if ($value instanceof Personnel) { - /* @var $value Personnel */ - $nomUsuel = $value->getNomUsuel(); - $nomPatro = $value->getNomPatronymique(); - $prenom = $value->getPrenom(); - $civilite = $value->getCiviliteToString(); - } else if ($value instanceof \stdClass) { foreach (['nomUsuel', 'nomPatronymique', 'prenom', 'civilite'] as $prop) { if (!isset($value->$prop)) { @@ -107,7 +100,7 @@ class NomCompletFormatter extends AbstractFilter $parts = [ $this->prenomDabord ? "$prenom $nomUsuel" : "$nomUsuel $prenom", $civilite, - $this->avecNomPatro && $nomPatro != $nomUsuel ? "née $nomPatro" : null, + $this->avecNomPatro && $nomPatro && $nomPatro != $nomUsuel ? "née $nomPatro" : null, ]; $result = implode(', ', array_filter($parts)); diff --git a/module/Application/src/Application/Form/Intervenant/Dossier.php b/module/Application/src/Application/Form/Intervenant/Dossier.php index 9d223017d4d36a1146d1f0cb003b7861c051d12c..508dad2664b45f1af6c5d5c532a490df8c5aa7aa 100755 --- a/module/Application/src/Application/Form/Intervenant/Dossier.php +++ b/module/Application/src/Application/Form/Intervenant/Dossier.php @@ -3,7 +3,6 @@ namespace Application\Form\Intervenant; use Application\Entity\Db\Intervenant; -use Application\Entity\Db\StatutIntervenant; use Application\Form\AbstractForm; use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\DossierServiceAwareTrait; diff --git a/module/Application/src/Application/Form/Intervenant/DossierFieldset.php b/module/Application/src/Application/Form/Intervenant/DossierFieldset.php index 78fba65371378da2da00008c91d62d51cc037eeb..84f25442eb2a844bcf5bca5da21308cf0867970a 100755 --- a/module/Application/src/Application/Form/Intervenant/DossierFieldset.php +++ b/module/Application/src/Application/Form/Intervenant/DossierFieldset.php @@ -345,7 +345,7 @@ class DossierFieldset extends AbstractFieldset 'required' => true, ], 'nomPatronymique' => [ - 'required' => true, + 'required' => false, ], 'prenom' => [ 'required' => true, diff --git a/module/Application/src/Application/Processus/Intervenant/RechercheProcessus.php b/module/Application/src/Application/Processus/Intervenant/RechercheProcessus.php index 507353bafe5d7bf35204fa4c1866cc6b98ab9860..b38e50b33dd4632c8e5adf8d8c2117b905493d9c 100644 --- a/module/Application/src/Application/Processus/Intervenant/RechercheProcessus.php +++ b/module/Application/src/Application/Processus/Intervenant/RechercheProcessus.php @@ -44,8 +44,8 @@ class RechercheProcessus i.annee_id FROM intervenant i - JOIN structure s ON s.id = i.structure_id - JOIN civilite c ON c.id = i.civilite_id + LEFT JOIN structure s ON s.id = i.structure_id + LEFT JOIN civilite c ON c.id = i.civilite_id WHERE i.histo_destruction IS NULL @@ -64,8 +64,8 @@ class RechercheProcessus i.annee_id FROM src_intervenant i - JOIN structure s ON s.id = i.structure_id - JOIN civilite c ON c.id = i.civilite_id + LEFT JOIN structure s ON s.id = i.structure_id + LEFT JOIN civilite c ON c.id = i.civilite_id ) SELECT * FROM vrec WHERE rownum <= ' . (int)$limit . ' AND annee_id = ' . $anneeId; @@ -144,8 +144,8 @@ class RechercheProcessus i.annee_id FROM intervenant i - JOIN structure s ON s.id = i.structure_id - JOIN civilite c ON c.id = i.civilite_id + LEFT JOIN structure s ON s.id = i.structure_id + LEFT JOIN civilite c ON c.id = i.civilite_id WHERE i.histo_destruction IS NULL ) diff --git a/module/Application/src/Application/Service/ServiceService.php b/module/Application/src/Application/Service/ServiceService.php index 307bb2ea403de61131bf3788499b4d8b13b14fab..8b93b3e18963aed66af5a7837e4cc0e59c7a2971 100755 --- a/module/Application/src/Application/Service/ServiceService.php +++ b/module/Application/src/Application/Service/ServiceService.php @@ -834,12 +834,12 @@ class ServiceService extends AbstractEntityService //if ($c5 = $recherche->getNiveauFormation() ) $conditions['niveau_formation_id'] = '(niveau_formation_id = -1 OR niveau_formation_id = ' . $c5->getId().')'; if ($c6 = $recherche->getEtape()) $conditions['etape_id'] = '(etape_id = -1 OR etape_id = ' . $c6->getId() . ')'; if ($c7 = $recherche->getElementPedagogique()) $conditions['element_pedagogique_id'] = '(element_pedagogique_id = -1 OR element_pedagogique_id = ' . $c7->getId() . ')'; - if ($c8 = $recherche->getStructureAff()) $conditions['structure_aff_id'] = '(structure_aff_id = -1 OR structure_aff_id = ' . $c8->getId() . ')'; + if ($c8 = $recherche->getStructureAff()) $conditions['structure_aff_id'] = '(structure_aff_id IS NULL OR structure_aff_id = -1 OR structure_aff_id = ' . $c8->getId() . ')'; if ($c9 = $recherche->getStructureEns()) $conditions['structure_ens_id'] = '(structure_ens_id = -1 OR structure_ens_id = ' . $c9->getId() . ')'; if ($options['composante'] instanceof Structure) { $id = (int)$options['composante']->getId(); - $conditions['composante'] = "(structure_aff_id = -1 OR structure_aff_id = $id OR structure_ens_id = -1 OR structure_ens_id = $id)"; + $conditions['composante'] = "(structure_aff_id IS NULL OR structure_aff_id = -1 OR structure_aff_id = $id OR structure_ens_id = -1 OR structure_ens_id = $id)"; } switch ($options['tri']) { diff --git a/module/Application/src/Application/Service/Traits/CiviliteServiceAwareTrait.php b/module/Application/src/Application/Service/Traits/CiviliteServiceAwareTrait.php index 31fa1ef0cb47c968be5fcc6556d10043b1996ef2..6fcc6405f239b65391477de8e0b60b0bc4e46d31 100755 --- a/module/Application/src/Application/Service/Traits/CiviliteServiceAwareTrait.php +++ b/module/Application/src/Application/Service/Traits/CiviliteServiceAwareTrait.php @@ -5,7 +5,7 @@ namespace Application\Service\Traits; use Application\Service\CiviliteService; /** - * Description of CiviliteAwareTrait + * Description of CiviliteServiceAwareTrait * * @author UnicaenCode */ diff --git a/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php b/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php index 1983fc50e3d2b4a23a26ae3ea57e7310c6f09151..d646a935cbd9860d361c56ac0fb6473e6eaf554f 100755 --- a/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php +++ b/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php @@ -55,16 +55,14 @@ class IntervenantViewHelper extends AbstractHtmlElement return ''; } - $adresse = $entity->getAdressePrincipale(); - $vars = [ 'identite' => [ "NOM prénom" => $entity, - "Civilité" => $entity->getCiviliteToString(), - "Date de naissance" => $entity->getDateNaissanceToString(), - "Ville de naissance" => $entity->getVilleNaissanceLibelle() ?: '<span class="inconnu">(Inconnue)</span>', - "Pays de naissance" => $entity->getPaysNaissance(), - "N° INSEE" => $entity->getNumeroInsee(), + "Civilité" => (string)$entity->getCivilite(), + "Date de naissance" => (string)$entity->getDateNaissanceToString(), + "Ville de naissance" => (string)$entity->getVilleNaissanceLibelle() ?: '<span class="inconnu">(Inconnue)</span>', + "Pays de naissance" => (string)$entity->getPaysNaissance(), + "N° INSEE" => (string)$entity->getNumeroInsee(), ], 'coordonnees' => [ "Email" => $entity->getEmail() ?: '<span class="inconnu">(Inconnu)</span>',