Loading data/privileges.php +1 Changes for data/privileges.php: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -117,6 +117,7 @@ return [ 'visualisation' => 'Visualisation', 'edition' => 'Édition', 'validation' => 'Validation', 'refus-piece' => 'Refus - Pièce justificative', 'devalidation' => 'Dévalidation', 'archivage' => 'Archivage', 'gestion-edition' => 'Gestion des pièces justificatives (édition)', Loading module/Application/config/pieces.config.php +20 −1 Changes for module/Application/config/pieces.config.php: 20 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -80,6 +80,20 @@ return [ ], ], ], 'refuser' => [ // refuser la PJ 'type' => 'Segment', 'options' => [ 'route' => '/refuser/:pieceJointe', 'constraints' => [ 'pieceJointe' => '[0-9]*', 'fichier' => '[0-9]*', ], 'defaults' => [ 'action' => 'refuser', ], ], ], 'archiver' => [ // archiver la PJ 'type' => 'Segment', Loading Loading @@ -310,6 +324,11 @@ return [ 'action' => ['supprimer'], 'privileges' => [Privileges::DOSSIER_SUPPRESSION], ], [ 'controller' => 'Application\Controller\Dossier', 'action' => ['supprimer'], 'privileges' => [Privileges::DOSSIER_SUPPRESSION], ], [ 'controller' => 'Application\Controller\IntervenantDossier', Loading Loading @@ -359,7 +378,7 @@ return [ ], [ 'controller' => 'Application\Controller\PieceJointe', 'action' => ['infos', 'lister', 'validation'], 'action' => ['infos', 'lister', 'validation', 'refuser'], 'privileges' => Privileges::PIECE_JUSTIFICATIVE_VISUALISATION, ], [ Loading module/Application/src/Controller/PieceJointeController.php +41 Changes for module/Application/src/Controller/PieceJointeController.php: 41 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -516,4 +516,45 @@ class PieceJointeController extends AbstractController } } public function refuserAction() { // $this->initFilters(); // // /** @var PieceJointe $pj */ // $pj = $this->getEvent()->getParam('pieceJointe'); // $this->getServicePieceJointe()->valider($pj); // $this->updateTableauxBord($pj->getIntervenant(), true); // // $viewModel = new ViewModel(); // $viewModel->setTemplate('application/piece-jointe/validation'); // $viewModel->setVariable('pj', $pj); // // return $viewModel; // // // return $viewModel; /** @var PieceJointe $pj */ $pj = $this->getEvent()->getParam('pieceJointe'); $intervenant = $this->getServiceContext()->getSelectedIdentityRole()->getIntervenant(); if ($intervenant && $pj->getIntervenant() != $intervenant) { // un intervenant tente de supprimer la PJ d'un autre intervenant throw new \Exception('Vous ne pouvez pas supprimer la pièce jointe d\'un autre intervenant'); } foreach ($pj->getFichier() as $fichier) { $this->getServicePieceJointe()->supprimerFichier($fichier, $pj); } $this->updateTableauxBord($pj->getIntervenant()); $viewModel = new ViewModel(); $viewModel->setTemplate('application/piece-jointe/validation'); $viewModel->setVariable('pj', $pj); return $viewModel; } } public/js/piece-jointe.js +5 Changes for public/js/piece-jointe.js: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -12,6 +12,11 @@ $.widget("ose.pieceJointe", { event.preventDefault(); }); that.element.on('click', '.refuser-pj', function (event) { that.refuser($(this)); event.preventDefault(); }); that.element.on('click', '.archiver-pj', function (event) { that.archiver($(this)); event.preventDefault(); Loading Loading
data/privileges.php +1 Changes for data/privileges.php: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -117,6 +117,7 @@ return [ 'visualisation' => 'Visualisation', 'edition' => 'Édition', 'validation' => 'Validation', 'refus-piece' => 'Refus - Pièce justificative', 'devalidation' => 'Dévalidation', 'archivage' => 'Archivage', 'gestion-edition' => 'Gestion des pièces justificatives (édition)', Loading
module/Application/config/pieces.config.php +20 −1 Changes for module/Application/config/pieces.config.php: 20 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -80,6 +80,20 @@ return [ ], ], ], 'refuser' => [ // refuser la PJ 'type' => 'Segment', 'options' => [ 'route' => '/refuser/:pieceJointe', 'constraints' => [ 'pieceJointe' => '[0-9]*', 'fichier' => '[0-9]*', ], 'defaults' => [ 'action' => 'refuser', ], ], ], 'archiver' => [ // archiver la PJ 'type' => 'Segment', Loading Loading @@ -310,6 +324,11 @@ return [ 'action' => ['supprimer'], 'privileges' => [Privileges::DOSSIER_SUPPRESSION], ], [ 'controller' => 'Application\Controller\Dossier', 'action' => ['supprimer'], 'privileges' => [Privileges::DOSSIER_SUPPRESSION], ], [ 'controller' => 'Application\Controller\IntervenantDossier', Loading Loading @@ -359,7 +378,7 @@ return [ ], [ 'controller' => 'Application\Controller\PieceJointe', 'action' => ['infos', 'lister', 'validation'], 'action' => ['infos', 'lister', 'validation', 'refuser'], 'privileges' => Privileges::PIECE_JUSTIFICATIVE_VISUALISATION, ], [ Loading
module/Application/src/Controller/PieceJointeController.php +41 Changes for module/Application/src/Controller/PieceJointeController.php: 41 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -516,4 +516,45 @@ class PieceJointeController extends AbstractController } } public function refuserAction() { // $this->initFilters(); // // /** @var PieceJointe $pj */ // $pj = $this->getEvent()->getParam('pieceJointe'); // $this->getServicePieceJointe()->valider($pj); // $this->updateTableauxBord($pj->getIntervenant(), true); // // $viewModel = new ViewModel(); // $viewModel->setTemplate('application/piece-jointe/validation'); // $viewModel->setVariable('pj', $pj); // // return $viewModel; // // // return $viewModel; /** @var PieceJointe $pj */ $pj = $this->getEvent()->getParam('pieceJointe'); $intervenant = $this->getServiceContext()->getSelectedIdentityRole()->getIntervenant(); if ($intervenant && $pj->getIntervenant() != $intervenant) { // un intervenant tente de supprimer la PJ d'un autre intervenant throw new \Exception('Vous ne pouvez pas supprimer la pièce jointe d\'un autre intervenant'); } foreach ($pj->getFichier() as $fichier) { $this->getServicePieceJointe()->supprimerFichier($fichier, $pj); } $this->updateTableauxBord($pj->getIntervenant()); $viewModel = new ViewModel(); $viewModel->setTemplate('application/piece-jointe/validation'); $viewModel->setVariable('pj', $pj); return $viewModel; } }
public/js/piece-jointe.js +5 Changes for public/js/piece-jointe.js: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -12,6 +12,11 @@ $.widget("ose.pieceJointe", { event.preventDefault(); }); that.element.on('click', '.refuser-pj', function (event) { that.refuser($(this)); event.preventDefault(); }); that.element.on('click', '.archiver-pj', function (event) { that.archiver($(this)); event.preventDefault(); Loading