Loading module/Oscar/src/Oscar/Controller/AdministrationController.php +9 −6 Original line number Diff line number Diff line Loading @@ -1742,15 +1742,16 @@ class AdministrationController extends AbstractOscarController implements try { $id = null; $label = $this->params()->fromPost('label'); $description = $this->params()->fromPost('description'); $description = ""; $default = $this->params()->fromPost('default', ''); $this->getLoggerService()->info("Enregistrement de type de document '$signatureflow_id'"); $active = $this->params()->fromPost('active', ''); $documentRepository->createOrUpdateTypeDocument( $id, $label, $description, $default == 'on' $default == 'on', $active == 'on' ); } catch (\Exception $e) { return $this->jsonErrorLogged("Impossible d'ajouter le type de document", $e); Loading @@ -1768,16 +1769,18 @@ class AdministrationController extends AbstractOscarController implements throw new \Exception("Pas d'identifiant"); } $label = $_PUT->get('label'); $description = $_PUT->get('description'); $description = $_PUT->get('description', ''); $default = $_PUT->get('default', ''); $active = $_PUT->get('active', ''); $signatureflow_id = intval($_PUT->get('signatureflow_id')); $this->getLoggerService()->info(" > $id, $label, $description, $signatureflow_id"); $documentRepository->createOrUpdateTypeDocument( $id, $label, $description, $default == 'on' "", $default == 'on', $active == 'on' ); return $this->getResponseOk(); } catch (\Exception $e) { Loading module/Oscar/src/Oscar/Entity/ContractDocumentRepository.php +2 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,7 @@ class ContractDocumentRepository extends AbstractTreeDataRepository string $label = "", string $description = "", bool $default = false, bool $active = true, int $signatureflow_id = 0 ): void { if ($id == null) { Loading @@ -197,6 +198,7 @@ class ContractDocumentRepository extends AbstractTreeDataRepository $type->setLabel($label) ->setDefault($default) ->setActive($active) ->setDescription($description); $this->getEntityManager()->flush(); Loading module/Oscar/src/Oscar/Entity/Discipline.php +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ class Discipline * @var boolean * @ORM\Column(type="boolean", nullable=false, options={"default"=true}) */ protected $active = false; protected $active = true; /** * @var \Doctrine\Common\Collections\Collection Loading module/Oscar/src/Oscar/Entity/TypeDocument.php +23 −1 Original line number Diff line number Diff line Loading @@ -45,6 +45,14 @@ class TypeDocument implements ITrackable */ private bool $default = false; /** * Est disponible à la selection * * @var boolean * @ORM\Column(type="boolean", nullable=false, options={"default"=true}) */ protected $active = true; /** * @return bool */ Loading @@ -61,6 +69,19 @@ class TypeDocument implements ITrackable return $this->getDefault(); } public function isActive(): bool { return $this->active; } public function setActive(bool $active): self { $this->active = $active; return $this; } /** * @param bool $default */ Loading Loading @@ -144,7 +165,8 @@ class TypeDocument implements ITrackable 'id' => $this->getId(), 'label' => $this->getLabel(), 'description' => $this->getDescription(), 'default' => $this->isDefault() 'default' => $this->isDefault(), 'active' => $this->isActive(), ); } } module/Oscar/src/Oscar/Service/ProjectGrantApiService.php +5 −3 Original line number Diff line number Diff line Loading @@ -769,10 +769,12 @@ class ProjectGrantApiService implements // Types de document foreach ($typesDocumentsDatas as $typeDocument) { if( $typeDocument->isActive() ){ $typeDatas = $typeDocument->toArray(); $typeDatas['flow'] = false; $typesDocuments[] = $typeDatas; } } $out['processDatas'] = $processDatas; $out['typesDocuments'] = $typesDocuments; Loading Loading
module/Oscar/src/Oscar/Controller/AdministrationController.php +9 −6 Original line number Diff line number Diff line Loading @@ -1742,15 +1742,16 @@ class AdministrationController extends AbstractOscarController implements try { $id = null; $label = $this->params()->fromPost('label'); $description = $this->params()->fromPost('description'); $description = ""; $default = $this->params()->fromPost('default', ''); $this->getLoggerService()->info("Enregistrement de type de document '$signatureflow_id'"); $active = $this->params()->fromPost('active', ''); $documentRepository->createOrUpdateTypeDocument( $id, $label, $description, $default == 'on' $default == 'on', $active == 'on' ); } catch (\Exception $e) { return $this->jsonErrorLogged("Impossible d'ajouter le type de document", $e); Loading @@ -1768,16 +1769,18 @@ class AdministrationController extends AbstractOscarController implements throw new \Exception("Pas d'identifiant"); } $label = $_PUT->get('label'); $description = $_PUT->get('description'); $description = $_PUT->get('description', ''); $default = $_PUT->get('default', ''); $active = $_PUT->get('active', ''); $signatureflow_id = intval($_PUT->get('signatureflow_id')); $this->getLoggerService()->info(" > $id, $label, $description, $signatureflow_id"); $documentRepository->createOrUpdateTypeDocument( $id, $label, $description, $default == 'on' "", $default == 'on', $active == 'on' ); return $this->getResponseOk(); } catch (\Exception $e) { Loading
module/Oscar/src/Oscar/Entity/ContractDocumentRepository.php +2 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,7 @@ class ContractDocumentRepository extends AbstractTreeDataRepository string $label = "", string $description = "", bool $default = false, bool $active = true, int $signatureflow_id = 0 ): void { if ($id == null) { Loading @@ -197,6 +198,7 @@ class ContractDocumentRepository extends AbstractTreeDataRepository $type->setLabel($label) ->setDefault($default) ->setActive($active) ->setDescription($description); $this->getEntityManager()->flush(); Loading
module/Oscar/src/Oscar/Entity/Discipline.php +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ class Discipline * @var boolean * @ORM\Column(type="boolean", nullable=false, options={"default"=true}) */ protected $active = false; protected $active = true; /** * @var \Doctrine\Common\Collections\Collection Loading
module/Oscar/src/Oscar/Entity/TypeDocument.php +23 −1 Original line number Diff line number Diff line Loading @@ -45,6 +45,14 @@ class TypeDocument implements ITrackable */ private bool $default = false; /** * Est disponible à la selection * * @var boolean * @ORM\Column(type="boolean", nullable=false, options={"default"=true}) */ protected $active = true; /** * @return bool */ Loading @@ -61,6 +69,19 @@ class TypeDocument implements ITrackable return $this->getDefault(); } public function isActive(): bool { return $this->active; } public function setActive(bool $active): self { $this->active = $active; return $this; } /** * @param bool $default */ Loading Loading @@ -144,7 +165,8 @@ class TypeDocument implements ITrackable 'id' => $this->getId(), 'label' => $this->getLabel(), 'description' => $this->getDescription(), 'default' => $this->isDefault() 'default' => $this->isDefault(), 'active' => $this->isActive(), ); } }
module/Oscar/src/Oscar/Service/ProjectGrantApiService.php +5 −3 Original line number Diff line number Diff line Loading @@ -769,10 +769,12 @@ class ProjectGrantApiService implements // Types de document foreach ($typesDocumentsDatas as $typeDocument) { if( $typeDocument->isActive() ){ $typeDatas = $typeDocument->toArray(); $typeDatas['flow'] = false; $typesDocuments[] = $typeDatas; } } $out['processDatas'] = $processDatas; $out['typesDocuments'] = $typesDocuments; Loading