Loading module/Soutenance/config/others/proposition.config.php +17 −5 Original line number Diff line number Diff line Loading @@ -56,8 +56,8 @@ return [ PropositionPrivileges::PROPOSITION_VALIDER_BDD, PropositionPrivileges::PROPOSITION_PRESIDENCE, PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_VISUALISER, PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_VALIDER, PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_REVOQUER, ], 'resources' => ['These'], 'assertion' => PropositionAssertion::class, Loading Loading @@ -146,16 +146,17 @@ return [ 'controller' => PropositionController::class, 'action' => [ 'declaration-non-plagiat', 'valider-declaration-non-plagiat', 'refuser-declaration-non-plagiat', ], 'privileges' => PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_VISUALISER, 'privileges' => PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_VALIDER, ], [ 'controller' => PropositionController::class, 'action' => [ 'valider-declaration-non-plagiat', 'refuser-declaration-non-plagiat', 'revoquer-declaration-non-plagiat', ], 'privileges' => PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_VALIDER, 'privileges' => PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_REVOQUER, ], ], ], Loading Loading @@ -396,6 +397,17 @@ return [ ], ], ], 'revoquer' => [ 'type' => Literal::class, 'may_terminate' => true, 'options' => [ 'route' => '/revoquer', 'defaults' => [ 'controller' => PropositionController::class, 'action' => 'revoquer-declaration-non-plagiat', ], ], ], ], ], ], Loading module/Soutenance/src/Soutenance/Assertion/PropositionAssertion.php +18 −0 Original line number Diff line number Diff line Loading @@ -190,6 +190,24 @@ class PropositionAssertion implements AssertionInterface { default: return false; } case PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_VALIDER: switch ($role) { case Role::CODE_DOCTORANT : $isDoctorant = $doctorant->getId() === $individu->getId(); $dateOk = ($sursis OR ($dateCurrent <= $dateValidationMax)); return ($isDoctorant AND $dateOk); default: return false; } case PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_REVOQUER: switch($role) { case Role::CODE_ADMIN_TECH : return true; case Role::CODE_BDD : return ($these->getEtablissement()->getStructure() === $identityRole->getStructure()); default : return false; } default : return false; } Loading module/Soutenance/src/Soutenance/Controller/PropositionController.php +12 −4 Original line number Diff line number Diff line Loading @@ -542,13 +542,9 @@ class PropositionController extends AbstractController { $these = $this->requestedThese(); $individuUtilisateur = $this->userContextService->getIdentityDb()->getIndividu(); $individuDoctorant = $these->getDoctorant()->getIndividu(); return new ViewModel([ 'title' => '« Lutte anti-plagiat : Déclaration sur l’honneur »', 'these' => $these, 'isTheseDoctorant' => $individuDoctorant === $individuUtilisateur, 'validation' => null, /** @see PropositionController::validerDeclarationNonPlagiatAction() */ Loading @@ -575,4 +571,16 @@ class PropositionController extends AbstractController return $this->redirect()->toRoute('soutenance/proposition', ['these' => $these->getId()], [], true); } public function revoquerDeclarationNonPlagiatAction() : Response { $these = $this->requestedThese(); $validations = $this->getValidationService()->getRepository()->findValidationByCodeAndThese(TypeValidation::CODE_VALIDATION_DECLARATION_HONNEUR, $these); foreach ($validations as $validation) { $this->getValidationService()->historise($validation); } $refus = $this->getValidationService()->getRepository()->findValidationByCodeAndThese(TypeValidation::CODE_REFUS_DECLARATION_HONNEUR, $these); foreach ($refus as $refu) { $this->getValidationService()->historise($refu); } return $this->redirect()->toRoute('soutenance/proposition', ['these' => $these->getId()], [], true); } } No newline at end of file module/Soutenance/src/Soutenance/Provider/Privilege/PropositionPrivileges.php +1 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,6 @@ class PropositionPrivileges extends Privileges const PROPOSITION_VALIDER_BDD = 'soutenance-proposition-validation-bdd'; const PROPOSITION_PRESIDENCE = 'soutenance-proposition-presidence'; const PROPOSITION_SURSIS = 'soutenance-proposition-sursis'; const PROPOSITION_DECLARATION_HONNEUR_VISUALISER = 'soutenance-declaration-honneur-visualiser'; const PROPOSITION_DECLARATION_HONNEUR_VALIDER = 'soutenance-declaration-honneur-valider'; const PROPOSITION_DECLARATION_HONNEUR_REVOQUER = 'soutenance-declaration-honneur-revoquer'; } No newline at end of file module/Soutenance/view/soutenance/proposition/declaration-non-plagiat.phtml +3 −3 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ /** * @see \Soutenance\Controller\PropositionController::declarationNonPlagiatAction() * @var These $these * @var bool $isTheseDoctorant * @var Validation $validation * @var string $urlValider * @var string $urlRefuser Loading @@ -12,6 +11,7 @@ use Application\Entity\Db\Acteur; use Application\Entity\Db\These; use Application\Entity\Db\Validation; use Soutenance\Provider\Privilege\PropositionPrivileges; use Soutenance\Provider\Validation\TypeValidation; $this->headTitle("Déclaration sur l'honneur de non plagiat"); Loading Loading @@ -42,7 +42,7 @@ if ($ur !== null) { $unite = $ur->getLibelle() . " (" . $ur->getSigle() . ")"; } $canValider = $this->isAllowed($these, PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_VALIDER); ?> Loading Loading @@ -75,7 +75,7 @@ if ($ur !== null) { <div class="row"> <div class="col-md-4"> <?php if ($isTheseDoctorant): ?> <?php if ($canValider): ?> <p> <span style="text-align: center"> <a href="<?php echo $urlValider; ?>" Loading Loading
module/Soutenance/config/others/proposition.config.php +17 −5 Original line number Diff line number Diff line Loading @@ -56,8 +56,8 @@ return [ PropositionPrivileges::PROPOSITION_VALIDER_BDD, PropositionPrivileges::PROPOSITION_PRESIDENCE, PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_VISUALISER, PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_VALIDER, PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_REVOQUER, ], 'resources' => ['These'], 'assertion' => PropositionAssertion::class, Loading Loading @@ -146,16 +146,17 @@ return [ 'controller' => PropositionController::class, 'action' => [ 'declaration-non-plagiat', 'valider-declaration-non-plagiat', 'refuser-declaration-non-plagiat', ], 'privileges' => PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_VISUALISER, 'privileges' => PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_VALIDER, ], [ 'controller' => PropositionController::class, 'action' => [ 'valider-declaration-non-plagiat', 'refuser-declaration-non-plagiat', 'revoquer-declaration-non-plagiat', ], 'privileges' => PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_VALIDER, 'privileges' => PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_REVOQUER, ], ], ], Loading Loading @@ -396,6 +397,17 @@ return [ ], ], ], 'revoquer' => [ 'type' => Literal::class, 'may_terminate' => true, 'options' => [ 'route' => '/revoquer', 'defaults' => [ 'controller' => PropositionController::class, 'action' => 'revoquer-declaration-non-plagiat', ], ], ], ], ], ], Loading
module/Soutenance/src/Soutenance/Assertion/PropositionAssertion.php +18 −0 Original line number Diff line number Diff line Loading @@ -190,6 +190,24 @@ class PropositionAssertion implements AssertionInterface { default: return false; } case PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_VALIDER: switch ($role) { case Role::CODE_DOCTORANT : $isDoctorant = $doctorant->getId() === $individu->getId(); $dateOk = ($sursis OR ($dateCurrent <= $dateValidationMax)); return ($isDoctorant AND $dateOk); default: return false; } case PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_REVOQUER: switch($role) { case Role::CODE_ADMIN_TECH : return true; case Role::CODE_BDD : return ($these->getEtablissement()->getStructure() === $identityRole->getStructure()); default : return false; } default : return false; } Loading
module/Soutenance/src/Soutenance/Controller/PropositionController.php +12 −4 Original line number Diff line number Diff line Loading @@ -542,13 +542,9 @@ class PropositionController extends AbstractController { $these = $this->requestedThese(); $individuUtilisateur = $this->userContextService->getIdentityDb()->getIndividu(); $individuDoctorant = $these->getDoctorant()->getIndividu(); return new ViewModel([ 'title' => '« Lutte anti-plagiat : Déclaration sur l’honneur »', 'these' => $these, 'isTheseDoctorant' => $individuDoctorant === $individuUtilisateur, 'validation' => null, /** @see PropositionController::validerDeclarationNonPlagiatAction() */ Loading @@ -575,4 +571,16 @@ class PropositionController extends AbstractController return $this->redirect()->toRoute('soutenance/proposition', ['these' => $these->getId()], [], true); } public function revoquerDeclarationNonPlagiatAction() : Response { $these = $this->requestedThese(); $validations = $this->getValidationService()->getRepository()->findValidationByCodeAndThese(TypeValidation::CODE_VALIDATION_DECLARATION_HONNEUR, $these); foreach ($validations as $validation) { $this->getValidationService()->historise($validation); } $refus = $this->getValidationService()->getRepository()->findValidationByCodeAndThese(TypeValidation::CODE_REFUS_DECLARATION_HONNEUR, $these); foreach ($refus as $refu) { $this->getValidationService()->historise($refu); } return $this->redirect()->toRoute('soutenance/proposition', ['these' => $these->getId()], [], true); } } No newline at end of file
module/Soutenance/src/Soutenance/Provider/Privilege/PropositionPrivileges.php +1 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,6 @@ class PropositionPrivileges extends Privileges const PROPOSITION_VALIDER_BDD = 'soutenance-proposition-validation-bdd'; const PROPOSITION_PRESIDENCE = 'soutenance-proposition-presidence'; const PROPOSITION_SURSIS = 'soutenance-proposition-sursis'; const PROPOSITION_DECLARATION_HONNEUR_VISUALISER = 'soutenance-declaration-honneur-visualiser'; const PROPOSITION_DECLARATION_HONNEUR_VALIDER = 'soutenance-declaration-honneur-valider'; const PROPOSITION_DECLARATION_HONNEUR_REVOQUER = 'soutenance-declaration-honneur-revoquer'; } No newline at end of file
module/Soutenance/view/soutenance/proposition/declaration-non-plagiat.phtml +3 −3 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ /** * @see \Soutenance\Controller\PropositionController::declarationNonPlagiatAction() * @var These $these * @var bool $isTheseDoctorant * @var Validation $validation * @var string $urlValider * @var string $urlRefuser Loading @@ -12,6 +11,7 @@ use Application\Entity\Db\Acteur; use Application\Entity\Db\These; use Application\Entity\Db\Validation; use Soutenance\Provider\Privilege\PropositionPrivileges; use Soutenance\Provider\Validation\TypeValidation; $this->headTitle("Déclaration sur l'honneur de non plagiat"); Loading Loading @@ -42,7 +42,7 @@ if ($ur !== null) { $unite = $ur->getLibelle() . " (" . $ur->getSigle() . ")"; } $canValider = $this->isAllowed($these, PropositionPrivileges::PROPOSITION_DECLARATION_HONNEUR_VALIDER); ?> Loading Loading @@ -75,7 +75,7 @@ if ($ur !== null) { <div class="row"> <div class="col-md-4"> <?php if ($isTheseDoctorant): ?> <?php if ($canValider): ?> <p> <span style="text-align: center"> <a href="<?php echo $urlValider; ?>" Loading