Loading data/ddl.php +9 −9 Original line number Diff line number Diff line Loading @@ -30903,7 +30903,7 @@ END UNICAEN_TBL;', AND f.histo_destruction IS NULL JOIN type_piece_jointe_statut tpjs ON tpjs.statut_intervenant_id = i.statut_id AND tpjs.type_piece_jointe_id = pj.type_piece_jointe_id AND tpjs.HISTO_DESTRUCTION IS NULL --AND tpjs.HISTO_DESTRUCTION IS NULL LEFT JOIN validation v ON v.id = pj.validation_id AND v.histo_destruction IS NULL Loading Loading @@ -30931,10 +30931,10 @@ END UNICAEN_TBL;', ANNEE_ID = v.ANNEE_ID, PIECE_JOINTE_ID = v.PIECE_JOINTE_ID, DATE_ARCHIVE = v.DATE_ARCHIVE, DATE_VALIDITE = v.DATE_VALIDITE, DUREE_VIE = v.DUREE_VIE, CODE_INTERVENANT = v.CODE_INTERVENANT, DATE_VALIDITE = v.DATE_VALIDITE, DATE_ARCHIVE = v.DATE_ARCHIVE, to_delete = 0 WHEN NOT MATCHED THEN INSERT ( Loading @@ -30946,10 +30946,10 @@ END UNICAEN_TBL;', VALIDATION_ID, FICHIER_ID, PIECE_JOINTE_ID, DATE_ARCHIVE, DATE_VALIDITE, DUREE_VIE, CODE_INTERVENANT, DATE_VALIDITE, DATE_ARCHIVE, TO_DELETE ) VALUES ( Loading @@ -30961,10 +30961,10 @@ END UNICAEN_TBL;', v.VALIDATION_ID, v.FICHIER_ID, v.PIECE_JOINTE_ID, v.DATE_ARCHIVE, v.DATE_VALIDITE, v.DUREE_VIE, v.CODE_INTERVENANT, v.DATE_VALIDITE, v.DATE_ARCHIVE, 0 ); Loading Loading @@ -36567,7 +36567,7 @@ FROM AND f.histo_destruction IS NULL JOIN type_piece_jointe_statut tpjs ON tpjs.statut_intervenant_id = i.statut_id AND tpjs.type_piece_jointe_id = pj.type_piece_jointe_id AND tpjs.HISTO_DESTRUCTION IS NULL --AND tpjs.HISTO_DESTRUCTION IS NULL LEFT JOIN validation v ON v.id = pj.validation_id AND v.histo_destruction IS NULL module/Application/src/Application/Controller/PieceJointeController.php +16 −6 Original line number Diff line number Diff line Loading @@ -4,9 +4,11 @@ namespace Application\Controller; use Application\Entity\Db\Intervenant; use Application\Entity\Db\PieceJointe; use Application\Entity\Db\TblPieceJointe; use Application\Entity\Db\TypePieceJointe; use Application\Entity\Db\TypePieceJointeStatut; use Application\Form\PieceJointe\Traits\ModifierTypePieceJointeStatutFormAwareTrait; use Application\Service\Traits\IntervenantServiceAwareTrait; use Application\Service\Traits\PieceJointeServiceAwareTrait; use Application\Service\Traits\StatutIntervenantServiceAwareTrait; use Application\Service\Traits\TypePieceJointeServiceAwareTrait; Loading @@ -28,6 +30,7 @@ class PieceJointeController extends AbstractController use ContextServiceAwareTrait; use PieceJointeServiceAwareTrait; use StatutIntervenantServiceAwareTrait; use IntervenantServiceAwareTrait; use TypePieceJointeSaisieFormAwareTrait; use ModifierTypePieceJointeStatutFormAwareTrait; use TypePieceJointeServiceAwareTrait; Loading Loading @@ -71,10 +74,10 @@ class PieceJointeController extends AbstractController $title = "Pièces justificatives <small>{$intervenant}</small>"; $demandees = $this->getServicePieceJointe()->getTypesPiecesDemandees($intervenant); $heuresPourSeuil = $this->getServicePieceJointe()->getHeuresPourSeuil($intervenant); $fournies = $this->getServicePieceJointe()->getPiecesFournies($intervenant); //$archives = $this->getServicePieceJointe()->getPiecesFourniesArchives($intervenant); $demandees = $this->getServicePieceJointe()->getTypesPiecesDemandees($intervenant); $synthese = $this->getServicePieceJointe()->getPiecesSynthese($intervenant); $annee = $this->getServiceContext()->getAnnee(); Loading @@ -82,7 +85,7 @@ class PieceJointeController extends AbstractController $alertContrat = $role->getIntervenant() && $intervenant->getStatut()->getPeutAvoirContrat(); return compact('intervenant', 'title', 'demandees', 'heuresPourSeuil', 'fournies', 'messages', 'alertContrat', 'annee'); return compact('intervenant', 'title', 'heuresPourSeuil', 'demandees', 'synthese', 'fournies', 'messages', 'alertContrat', 'annee'); } Loading @@ -109,8 +112,7 @@ class PieceJointeController extends AbstractController /** * @param TypePieceJointe[] $demandees * @param PieceJointe[] $fournies * @param TblPieceJointe[] $synthesePiecesJointes */ protected function makeMessages($demandees, $fournies) { Loading Loading @@ -449,6 +451,14 @@ class PieceJointeController extends AbstractController 'agrement', 'contrat', ], $intervenant); //Récupérer tous les intervenants avec le même code intervenant $intervenants = $this->getServiceIntervenant()->getIntervenantByCode($intervenant->getCode()); //On recalcule le tbl piece_jointe pour tous les intervenants ayant le même code intervenant que l'intervenant de l'année en cours $this->getServiceWorkflow()->calculerTableauxBord([ 'piece_jointe', ], $intervenants); } } module/Application/src/Application/Service/IntervenantService.php +10 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,16 @@ class IntervenantService extends AbstractEntityService return $this->getBy('utilisateurCode', 'UTILISATEUR_CODE', $utilisateurCode, $annee, $autoImport); } public function getIntervenantByCode($intervenantCode, Annee $annee = null) { $findParams = ['code' => (string)$intervenantCode]; $repo = $this->getRepo(); $result = $repo->findBy($findParams); return $result; } /** Loading module/Application/src/Application/Service/PieceJointeService.php +29 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,34 @@ class PieceJointeService extends AbstractEntityService } /** * @param Intervenant $intervenant * * @return mixed $result */ public function getPiecesSynthese(Intervenant $intervenant) { $dql = " SELECT pj FROM Application\Entity\Db\TblPieceJointe pj WHERE pj.intervenant = :intervenant "; $listTblPieceJointe = $this->getEntityManager()->createQuery($dql)->setParameters([ 'intervenant' => $intervenant->getId(), ])->getResult(); $result = []; foreach ($listTblPieceJointe as $TblPieceJointe) { $result[$TblPieceJointe->getTypePieceJointe()->getId()] = $TblPieceJointe; } return $result; } /** * @param Intervenant $intervenant Loading Loading @@ -158,6 +186,7 @@ class PieceJointeService extends AbstractEntityService 'annee' => $intervenant->getAnnee()->getId(), ])->getResult(); /* @var $lpjf \Application\Entity\Db\TblPieceJointeFournie[] */ $result = []; Loading module/Application/view/application/piece-jointe/index.phtml +18 −6 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ $menuUrl = $this->url('intervenant/services', ['intervenant' => $intervenant->ge //Check si piece obligatoire $obligatoire = $pj->isObligatoire(); $tpj = $pj->getTypePieceJointe(); if (isset($fournies[$tpj->getId()])) { // qu'elles soient fournies ou non if (isset($fournies[$tpj->getId()]) && $synthese[$tpj->getId()]->getFournie() == 1) { // qu'elles soient fournies ou non $pj = $fournies[$tpj->getId()]; unset($restantes[$tpj->getId()]); } else { Loading @@ -64,15 +64,27 @@ $menuUrl = $this->url('intervenant/services', ['intervenant' => $intervenant->ge } } if (!empty($restantes)) { echo '<div class="well">'; echo '<h2>Autres pièces fournies</h2>'; $html = '<div class="well">'; $html .= '<h2>Autres pièces fournies</h2>'; $obligatoire = false; $haveRestante = false; foreach ($restantes as $tpjId => $pj) { // on liste les pièces fournies mais qui ne sont pas demandées... //on affiche la pièce jointe restante uniquement sur l'année où elle a été fourni if($pj->getIntervenant()->getAnnee()->getId() == $annee->getId()) { $haveRestante = true; $tpj = $pj->getType(); echo $this->partial('application/piece-jointe/partial/piece-jointe', compact('intervenant', 'tpj', 'pj', 'canEdit', 'canValider', 'canDevalider', 'obligatoire', 'annee')); $html .= $this->partial('application/piece-jointe/partial/piece-jointe', compact('intervenant', 'tpj', 'pj', 'canEdit', 'canValider', 'canDevalider', 'obligatoire', 'annee')); } } $html .= '</div>'; if($haveRestante) { echo $html; } echo '</div>'; } ?> Loading Loading
data/ddl.php +9 −9 Original line number Diff line number Diff line Loading @@ -30903,7 +30903,7 @@ END UNICAEN_TBL;', AND f.histo_destruction IS NULL JOIN type_piece_jointe_statut tpjs ON tpjs.statut_intervenant_id = i.statut_id AND tpjs.type_piece_jointe_id = pj.type_piece_jointe_id AND tpjs.HISTO_DESTRUCTION IS NULL --AND tpjs.HISTO_DESTRUCTION IS NULL LEFT JOIN validation v ON v.id = pj.validation_id AND v.histo_destruction IS NULL Loading Loading @@ -30931,10 +30931,10 @@ END UNICAEN_TBL;', ANNEE_ID = v.ANNEE_ID, PIECE_JOINTE_ID = v.PIECE_JOINTE_ID, DATE_ARCHIVE = v.DATE_ARCHIVE, DATE_VALIDITE = v.DATE_VALIDITE, DUREE_VIE = v.DUREE_VIE, CODE_INTERVENANT = v.CODE_INTERVENANT, DATE_VALIDITE = v.DATE_VALIDITE, DATE_ARCHIVE = v.DATE_ARCHIVE, to_delete = 0 WHEN NOT MATCHED THEN INSERT ( Loading @@ -30946,10 +30946,10 @@ END UNICAEN_TBL;', VALIDATION_ID, FICHIER_ID, PIECE_JOINTE_ID, DATE_ARCHIVE, DATE_VALIDITE, DUREE_VIE, CODE_INTERVENANT, DATE_VALIDITE, DATE_ARCHIVE, TO_DELETE ) VALUES ( Loading @@ -30961,10 +30961,10 @@ END UNICAEN_TBL;', v.VALIDATION_ID, v.FICHIER_ID, v.PIECE_JOINTE_ID, v.DATE_ARCHIVE, v.DATE_VALIDITE, v.DUREE_VIE, v.CODE_INTERVENANT, v.DATE_VALIDITE, v.DATE_ARCHIVE, 0 ); Loading Loading @@ -36567,7 +36567,7 @@ FROM AND f.histo_destruction IS NULL JOIN type_piece_jointe_statut tpjs ON tpjs.statut_intervenant_id = i.statut_id AND tpjs.type_piece_jointe_id = pj.type_piece_jointe_id AND tpjs.HISTO_DESTRUCTION IS NULL --AND tpjs.HISTO_DESTRUCTION IS NULL LEFT JOIN validation v ON v.id = pj.validation_id AND v.histo_destruction IS NULL
module/Application/src/Application/Controller/PieceJointeController.php +16 −6 Original line number Diff line number Diff line Loading @@ -4,9 +4,11 @@ namespace Application\Controller; use Application\Entity\Db\Intervenant; use Application\Entity\Db\PieceJointe; use Application\Entity\Db\TblPieceJointe; use Application\Entity\Db\TypePieceJointe; use Application\Entity\Db\TypePieceJointeStatut; use Application\Form\PieceJointe\Traits\ModifierTypePieceJointeStatutFormAwareTrait; use Application\Service\Traits\IntervenantServiceAwareTrait; use Application\Service\Traits\PieceJointeServiceAwareTrait; use Application\Service\Traits\StatutIntervenantServiceAwareTrait; use Application\Service\Traits\TypePieceJointeServiceAwareTrait; Loading @@ -28,6 +30,7 @@ class PieceJointeController extends AbstractController use ContextServiceAwareTrait; use PieceJointeServiceAwareTrait; use StatutIntervenantServiceAwareTrait; use IntervenantServiceAwareTrait; use TypePieceJointeSaisieFormAwareTrait; use ModifierTypePieceJointeStatutFormAwareTrait; use TypePieceJointeServiceAwareTrait; Loading Loading @@ -71,10 +74,10 @@ class PieceJointeController extends AbstractController $title = "Pièces justificatives <small>{$intervenant}</small>"; $demandees = $this->getServicePieceJointe()->getTypesPiecesDemandees($intervenant); $heuresPourSeuil = $this->getServicePieceJointe()->getHeuresPourSeuil($intervenant); $fournies = $this->getServicePieceJointe()->getPiecesFournies($intervenant); //$archives = $this->getServicePieceJointe()->getPiecesFourniesArchives($intervenant); $demandees = $this->getServicePieceJointe()->getTypesPiecesDemandees($intervenant); $synthese = $this->getServicePieceJointe()->getPiecesSynthese($intervenant); $annee = $this->getServiceContext()->getAnnee(); Loading @@ -82,7 +85,7 @@ class PieceJointeController extends AbstractController $alertContrat = $role->getIntervenant() && $intervenant->getStatut()->getPeutAvoirContrat(); return compact('intervenant', 'title', 'demandees', 'heuresPourSeuil', 'fournies', 'messages', 'alertContrat', 'annee'); return compact('intervenant', 'title', 'heuresPourSeuil', 'demandees', 'synthese', 'fournies', 'messages', 'alertContrat', 'annee'); } Loading @@ -109,8 +112,7 @@ class PieceJointeController extends AbstractController /** * @param TypePieceJointe[] $demandees * @param PieceJointe[] $fournies * @param TblPieceJointe[] $synthesePiecesJointes */ protected function makeMessages($demandees, $fournies) { Loading Loading @@ -449,6 +451,14 @@ class PieceJointeController extends AbstractController 'agrement', 'contrat', ], $intervenant); //Récupérer tous les intervenants avec le même code intervenant $intervenants = $this->getServiceIntervenant()->getIntervenantByCode($intervenant->getCode()); //On recalcule le tbl piece_jointe pour tous les intervenants ayant le même code intervenant que l'intervenant de l'année en cours $this->getServiceWorkflow()->calculerTableauxBord([ 'piece_jointe', ], $intervenants); } }
module/Application/src/Application/Service/IntervenantService.php +10 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,16 @@ class IntervenantService extends AbstractEntityService return $this->getBy('utilisateurCode', 'UTILISATEUR_CODE', $utilisateurCode, $annee, $autoImport); } public function getIntervenantByCode($intervenantCode, Annee $annee = null) { $findParams = ['code' => (string)$intervenantCode]; $repo = $this->getRepo(); $result = $repo->findBy($findParams); return $result; } /** Loading
module/Application/src/Application/Service/PieceJointeService.php +29 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,34 @@ class PieceJointeService extends AbstractEntityService } /** * @param Intervenant $intervenant * * @return mixed $result */ public function getPiecesSynthese(Intervenant $intervenant) { $dql = " SELECT pj FROM Application\Entity\Db\TblPieceJointe pj WHERE pj.intervenant = :intervenant "; $listTblPieceJointe = $this->getEntityManager()->createQuery($dql)->setParameters([ 'intervenant' => $intervenant->getId(), ])->getResult(); $result = []; foreach ($listTblPieceJointe as $TblPieceJointe) { $result[$TblPieceJointe->getTypePieceJointe()->getId()] = $TblPieceJointe; } return $result; } /** * @param Intervenant $intervenant Loading Loading @@ -158,6 +186,7 @@ class PieceJointeService extends AbstractEntityService 'annee' => $intervenant->getAnnee()->getId(), ])->getResult(); /* @var $lpjf \Application\Entity\Db\TblPieceJointeFournie[] */ $result = []; Loading
module/Application/view/application/piece-jointe/index.phtml +18 −6 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ $menuUrl = $this->url('intervenant/services', ['intervenant' => $intervenant->ge //Check si piece obligatoire $obligatoire = $pj->isObligatoire(); $tpj = $pj->getTypePieceJointe(); if (isset($fournies[$tpj->getId()])) { // qu'elles soient fournies ou non if (isset($fournies[$tpj->getId()]) && $synthese[$tpj->getId()]->getFournie() == 1) { // qu'elles soient fournies ou non $pj = $fournies[$tpj->getId()]; unset($restantes[$tpj->getId()]); } else { Loading @@ -64,15 +64,27 @@ $menuUrl = $this->url('intervenant/services', ['intervenant' => $intervenant->ge } } if (!empty($restantes)) { echo '<div class="well">'; echo '<h2>Autres pièces fournies</h2>'; $html = '<div class="well">'; $html .= '<h2>Autres pièces fournies</h2>'; $obligatoire = false; $haveRestante = false; foreach ($restantes as $tpjId => $pj) { // on liste les pièces fournies mais qui ne sont pas demandées... //on affiche la pièce jointe restante uniquement sur l'année où elle a été fourni if($pj->getIntervenant()->getAnnee()->getId() == $annee->getId()) { $haveRestante = true; $tpj = $pj->getType(); echo $this->partial('application/piece-jointe/partial/piece-jointe', compact('intervenant', 'tpj', 'pj', 'canEdit', 'canValider', 'canDevalider', 'obligatoire', 'annee')); $html .= $this->partial('application/piece-jointe/partial/piece-jointe', compact('intervenant', 'tpj', 'pj', 'canEdit', 'canValider', 'canDevalider', 'obligatoire', 'annee')); } } $html .= '</div>'; if($haveRestante) { echo $html; } echo '</div>'; } ?> Loading