Loading config/autoload/unicaen-signature.global.php +1 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ return [ // Emplacement où sont archivés les documents en cours de signature 'documents_path' => __DIR__ . '/../../data/documents/signature', 'redirect_internal' => 'contractdocument/my-documents', ///////////////////////////////////////////////////////////////////////////////// /// SYSTEME de LOG Loading module/Oscar/config/module.config.php +1 −0 Original line number Diff line number Diff line Loading @@ -283,6 +283,7 @@ return array( 'reupload', 'search', 'show', 'signatureMine', 'upload', ], 'roles' => ['user'] Loading module/Oscar/config/routes.yml +6 −0 Original line number Diff line number Diff line Loading @@ -1302,6 +1302,12 @@ contractdocument: may_terminate: true child_routes: my-documents: type: segment options: route: /my-documents defaults: action: signatureMine search: type: segment Loading module/Oscar/src/Oscar/Controller/ContractDocumentController.php +27 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Doctrine\ORM\OptimisticLockException; use Exception; use Laminas\Http\Response; use Laminas\Mvc\Controller\Plugin\Redirect; use Laminas\View\Model\ViewModel; use Oscar\Entity\Activity; use Oscar\Entity\ContractDocument; use Oscar\Entity\Person; Loading Loading @@ -746,7 +747,7 @@ class ContractDocumentController extends AbstractOscarController implements UseS if ($this->isAjax() || $this->params()->fromQuery('f', null) == 'json') { $this->getLoggerService()->debug("Chargement des documents observés"); try { $documents = $this->getContractDocumentService()->getDocumentsWithSignProcessForUser($person); $documents = $this->getContractDocumentService()->getDocumentsObservedForUser($person); $output = $this->baseJsonResponse(); $output['documents'] = $this->getJsonFormatterService()->contractDocuments($documents); return $this->jsonOutput($output); Loading @@ -759,6 +760,31 @@ class ContractDocumentController extends AbstractOscarController implements UseS return []; } public function signatureMineAction() { if( !$this->getCurrentPerson() ){ throw new OscarException(); } $this->getLoggerService()->debug("Signature MINE()"); $this->getJsonFormatterService()->setUrlHelper($this->url()); $person = $this->getCurrentPerson(); if ($this->isAjax() || $this->params()->fromQuery('f', null) == 'json') { $this->getLoggerService()->debug("Chargement des documents observés"); try { $documents = $this->getContractDocumentService()->getDocumentsWithSignProcessForUser($person); $output = $this->baseJsonResponse(); $output['documents'] = $this->getJsonFormatterService()->contractDocuments($documents, true, [ 'signPersonEmail' => $person ? $person->getEmail() : null, ]); return $this->jsonOutput($output); } catch (Exception $e) { $msg = "Impossible d'afficher le suivi des signatures"; $this->getLoggerService()->error($msg . " : " . $e->getMessage()); return $this->jsonError($msg); } } return []; } /** * Annulation d'un processus de signature. * Loading module/Oscar/src/Oscar/Entity/ContractDocumentRepository.php +27 −0 Original line number Diff line number Diff line Loading @@ -97,13 +97,40 @@ class ContractDocumentRepository extends AbstractTreeDataRepository return $query->getQuery()->getResult(); } /** * Liste des documents impliquant le signataire (via l'email). * * @param string $person_email * @return array */ public function getDocumentsWithProcessByPerson(string $person_email) { $query = $this->createQueryBuilder('d') ->innerJoin('d.process', 'p') ->innerJoin('p.steps', 'st') ->innerJoin('st.signature', 's') ->innerJoin('d.grant', 'a') ->innerJoin('s.recipients', 'o') ->orderBy('s.dateCreated', 'DESC') ->where("o.email = :email"); $query->setParameter('email', $person_email); return $query->getQuery()->getResult(); } /** * Liste des documents signés observés. * * @param string $person_email * @return array */ public function getDocumentsSignedObservedByPerson( string $person_email): array { $query = $this->createQueryBuilder('d') ->innerJoin('d.process', 'p') ->innerJoin('p.steps', 'st') ->innerJoin('st.signature', 's') ->innerJoin('d.grant', 'a') ->innerJoin('s.observers', 'o') ->orderBy('s.dateCreated', 'DESC') ->where("o.email = :email"); $query->setParameter('email', $person_email); return $query->getQuery()->getResult(); Loading Loading
config/autoload/unicaen-signature.global.php +1 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ return [ // Emplacement où sont archivés les documents en cours de signature 'documents_path' => __DIR__ . '/../../data/documents/signature', 'redirect_internal' => 'contractdocument/my-documents', ///////////////////////////////////////////////////////////////////////////////// /// SYSTEME de LOG Loading
module/Oscar/config/module.config.php +1 −0 Original line number Diff line number Diff line Loading @@ -283,6 +283,7 @@ return array( 'reupload', 'search', 'show', 'signatureMine', 'upload', ], 'roles' => ['user'] Loading
module/Oscar/config/routes.yml +6 −0 Original line number Diff line number Diff line Loading @@ -1302,6 +1302,12 @@ contractdocument: may_terminate: true child_routes: my-documents: type: segment options: route: /my-documents defaults: action: signatureMine search: type: segment Loading
module/Oscar/src/Oscar/Controller/ContractDocumentController.php +27 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Doctrine\ORM\OptimisticLockException; use Exception; use Laminas\Http\Response; use Laminas\Mvc\Controller\Plugin\Redirect; use Laminas\View\Model\ViewModel; use Oscar\Entity\Activity; use Oscar\Entity\ContractDocument; use Oscar\Entity\Person; Loading Loading @@ -746,7 +747,7 @@ class ContractDocumentController extends AbstractOscarController implements UseS if ($this->isAjax() || $this->params()->fromQuery('f', null) == 'json') { $this->getLoggerService()->debug("Chargement des documents observés"); try { $documents = $this->getContractDocumentService()->getDocumentsWithSignProcessForUser($person); $documents = $this->getContractDocumentService()->getDocumentsObservedForUser($person); $output = $this->baseJsonResponse(); $output['documents'] = $this->getJsonFormatterService()->contractDocuments($documents); return $this->jsonOutput($output); Loading @@ -759,6 +760,31 @@ class ContractDocumentController extends AbstractOscarController implements UseS return []; } public function signatureMineAction() { if( !$this->getCurrentPerson() ){ throw new OscarException(); } $this->getLoggerService()->debug("Signature MINE()"); $this->getJsonFormatterService()->setUrlHelper($this->url()); $person = $this->getCurrentPerson(); if ($this->isAjax() || $this->params()->fromQuery('f', null) == 'json') { $this->getLoggerService()->debug("Chargement des documents observés"); try { $documents = $this->getContractDocumentService()->getDocumentsWithSignProcessForUser($person); $output = $this->baseJsonResponse(); $output['documents'] = $this->getJsonFormatterService()->contractDocuments($documents, true, [ 'signPersonEmail' => $person ? $person->getEmail() : null, ]); return $this->jsonOutput($output); } catch (Exception $e) { $msg = "Impossible d'afficher le suivi des signatures"; $this->getLoggerService()->error($msg . " : " . $e->getMessage()); return $this->jsonError($msg); } } return []; } /** * Annulation d'un processus de signature. * Loading
module/Oscar/src/Oscar/Entity/ContractDocumentRepository.php +27 −0 Original line number Diff line number Diff line Loading @@ -97,13 +97,40 @@ class ContractDocumentRepository extends AbstractTreeDataRepository return $query->getQuery()->getResult(); } /** * Liste des documents impliquant le signataire (via l'email). * * @param string $person_email * @return array */ public function getDocumentsWithProcessByPerson(string $person_email) { $query = $this->createQueryBuilder('d') ->innerJoin('d.process', 'p') ->innerJoin('p.steps', 'st') ->innerJoin('st.signature', 's') ->innerJoin('d.grant', 'a') ->innerJoin('s.recipients', 'o') ->orderBy('s.dateCreated', 'DESC') ->where("o.email = :email"); $query->setParameter('email', $person_email); return $query->getQuery()->getResult(); } /** * Liste des documents signés observés. * * @param string $person_email * @return array */ public function getDocumentsSignedObservedByPerson( string $person_email): array { $query = $this->createQueryBuilder('d') ->innerJoin('d.process', 'p') ->innerJoin('p.steps', 'st') ->innerJoin('st.signature', 's') ->innerJoin('d.grant', 'a') ->innerJoin('s.observers', 'o') ->orderBy('s.dateCreated', 'DESC') ->where("o.email = :email"); $query->setParameter('email', $person_email); return $query->getQuery()->getResult(); Loading