From efbc6224b375b6edb5c1e6a8b723166f3d5a2fbf Mon Sep 17 00:00:00 2001 From: Benn Oshrin Date: Sun, 17 Nov 2019 10:44:26 -0500 Subject: [PATCH] Make build button available to Matchgrid Admins (CO-1765) --- app/src/Controller/MatchgridsController.php | 4 ++-- app/src/Locale/en_US/default.po | 3 +++ app/src/Model/Table/MatchgridsTable.php | 2 +- app/src/Template/Matchgrids/columns.inc | 4 ---- app/src/Template/Matchgrids/manage.ctp | 15 ++++++++++++++- app/src/Template/Matchgrids/select.ctp | 12 ------------ 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/src/Controller/MatchgridsController.php b/app/src/Controller/MatchgridsController.php index 558daeaf0..cd4a6a09c 100644 --- a/app/src/Controller/MatchgridsController.php +++ b/app/src/Controller/MatchgridsController.php @@ -49,7 +49,7 @@ class MatchgridsController extends StandardController { public function beforeFilter(\Cake\Event\Event $event) { // Only certain actions require a matchgrid ID if(in_array($this->request->getParam('action'), - ['manage', 'pending', 'reconcile'])) { + ['build', 'manage', 'pending', 'reconcile'])) { $this->Matchgrids->setRequiresMatchgrid(true); } @@ -72,7 +72,7 @@ public function build(int $id) { $this->Flash->error(__('match.er.build', [$e->getMessage()])); } - return $this->redirect(['action' => 'index']); + return $this->redirect(['action' => 'manage', $id]); } /** diff --git a/app/src/Locale/en_US/default.po b/app/src/Locale/en_US/default.po index 203c3d6c0..a2fb85dfc 100644 --- a/app/src/Locale/en_US/default.po +++ b/app/src/Locale/en_US/default.po @@ -227,6 +227,9 @@ msgstr "Invalid character found" msgid "match.er.mgid" msgstr "Could not find Matchgrid ID in request" +msgid "match.er.notfound" +msgstr "{0} \"{1}\" not found" + msgid "match.er.pagenum.exceeded" msgstr "Page number may not be larger than {0}" diff --git a/app/src/Model/Table/MatchgridsTable.php b/app/src/Model/Table/MatchgridsTable.php index 26f996802..0752ed518 100644 --- a/app/src/Model/Table/MatchgridsTable.php +++ b/app/src/Model/Table/MatchgridsTable.php @@ -90,7 +90,7 @@ public function initialize(array $config) { ] ]); - $this->setAllowLookupPrimaryLink(['manage', 'pending', 'reconcile']); + $this->setAllowLookupPrimaryLink(['build', 'manage', 'pending', 'reconcile']); } /** diff --git a/app/src/Template/Matchgrids/columns.inc b/app/src/Template/Matchgrids/columns.inc index 97acee903..186bd07b7 100644 --- a/app/src/Template/Matchgrids/columns.inc +++ b/app/src/Template/Matchgrids/columns.inc @@ -42,9 +42,5 @@ $indexActions = [ [ 'action' => 'manage', 'class' => 'configurebutton' - ], - [ - 'action' => 'build', - 'class' => 'buildbutton' ] ]; diff --git a/app/src/Template/Matchgrids/manage.ctp b/app/src/Template/Matchgrids/manage.ctp index b6883f17c..8ffa995b3 100644 --- a/app/src/Template/Matchgrids/manage.ctp +++ b/app/src/Template/Matchgrids/manage.ctp @@ -36,6 +36,18 @@ declare(strict_types = 1);
-
\ No newline at end of file + diff --git a/app/src/Template/Matchgrids/select.ctp b/app/src/Template/Matchgrids/select.ctp index 0fa3037e7..531c10332 100644 --- a/app/src/Template/Matchgrids/select.ctp +++ b/app/src/Template/Matchgrids/select.ctp @@ -70,18 +70,6 @@ use \App\Lib\Enum\PermissionEnum; $id], ['class' => 'configurebutton']); } - - // Can reconcile this matchgrid? - if((isset($vv_menu_permissions['gridroles'][$id][PermissionEnum::ReconciliationManager]) - && $vv_menu_permissions['gridroles'][$id][PermissionEnum::ReconciliationManager]) - // Proxy for platform admin - || $vv_menu_permissions['matchgrids']) { - print $this->Html->link(__('match.op.reconcile'), - ['controller' => 'Matchgrids', - 'action' => 'pending', - $id], - ['class' => 'reconcilebutton']); - } ?>