From a0f7ca6abed210df3a6009c0119cf1f73ff0668c Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Thu, 27 Feb 2020 02:07:30 +0000 Subject: [PATCH] Fix editRoute parameters for CMB. #357 --- src/Service/JobOrderHandler/CMBJobOrderHandler.php | 2 +- src/Service/JobOrderHandler/ResqJobOrderHandler.php | 3 +++ src/Service/JobOrderHandlerInterface.php | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Service/JobOrderHandler/CMBJobOrderHandler.php b/src/Service/JobOrderHandler/CMBJobOrderHandler.php index 2e16f2e9..422f5fb7 100644 --- a/src/Service/JobOrderHandler/CMBJobOrderHandler.php +++ b/src/Service/JobOrderHandler/CMBJobOrderHandler.php @@ -2997,7 +2997,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface } } - public function getEditRoute($jo_id) + public function getEditRoute($jo_id, $tier = null) { $jo = $this->em->getRepository(JobOrder::class)->find($jo_id); if (empty($jo)) diff --git a/src/Service/JobOrderHandler/ResqJobOrderHandler.php b/src/Service/JobOrderHandler/ResqJobOrderHandler.php index e98eaa45..a12e09d5 100644 --- a/src/Service/JobOrderHandler/ResqJobOrderHandler.php +++ b/src/Service/JobOrderHandler/ResqJobOrderHandler.php @@ -314,6 +314,9 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface } } + // TODO: check status before saving since JO might already + // have a status that needs to be retained + if (empty($error_array)) { // get current user $user = $this->security->getUser(); diff --git a/src/Service/JobOrderHandlerInterface.php b/src/Service/JobOrderHandlerInterface.php index 5593d10c..590a0926 100644 --- a/src/Service/JobOrderHandlerInterface.php +++ b/src/Service/JobOrderHandlerInterface.php @@ -98,4 +98,7 @@ interface JobOrderHandlerInterface // check if service type is new battery public function checkIfNewBattery(JobOrder $jo); + + // return the edit route, based on tier and form + public function getEditRoute(int $jo_id, $tier); }