From 32c83aa40c8ac26316787083192322394c8620ed Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Mon, 29 Jun 2020 07:00:17 +0000 Subject: [PATCH] Add odometer and pictures when viewing JO. #432 --- .../JobOrderHandler/CMBJobOrderHandler.php | 45 +++++++++++++++++++ .../job-order/cmb.form.onestep.html.twig | 25 +++++++++++ 2 files changed, 70 insertions(+) diff --git a/src/Service/JobOrderHandler/CMBJobOrderHandler.php b/src/Service/JobOrderHandler/CMBJobOrderHandler.php index e9e6ef15..0b7c629f 100644 --- a/src/Service/JobOrderHandler/CMBJobOrderHandler.php +++ b/src/Service/JobOrderHandler/CMBJobOrderHandler.php @@ -1487,6 +1487,51 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface $params['jo_service_charges'] = $sc_array; + // get odometer + $odometer = $obj->getMeta('odometer'); + + $params['odometer'] = $odometer; + + // get images if any + $jo_extra = $obj->getJOExtra(); + $pic_array = []; + if ($jo_extra != null) + { + $b_speed_img = $jo_extra->getBeforeSpeedImageFilename(); + $a_speed_img = $jo_extra->getAfterSpeedImageFilename(); + $b_plate_img = $jo_extra->getBeforePlateNumImageFilename(); + $a_plate_img = $jo_extra->getAfterPlateNumImageFilename(); + $b_batt_img = $jo_extra->getBeforeBattImageFilename(); + $a_batt_img = $jo_extra->getAfterBattImageFilename(); + + $b_other_images = $jo_extra->getBeforeOtherImages(); + $a_other_images = $jo_extra->getAfterOtherImages(); + + if ($b_speed_img != null) + $pic_array[] = $b_speed_img; + if ($a_speed_img != null) + $pic_array[] = $a_speed_img; + if ($b_plate_img != null) + $pic_array[] = $b_plate_img; + if ($a_plate_img != null) + $pic_array[] = $a_plate_img; + if ($b_batt_img != null) + $pic_array[] = $b_batt_img; + if ($a_batt_img != null) + $pic_array[] = $a_batt_img; + + foreach($b_other_images as $b_img) + { + $pic_array[] = $b_img; + } + foreach ($a_other_images as $a_img) + { + $pic_array[] = $a_img; + } + } + + $params['jo_pictures'] = $pic_array; + $this->fillDropdownParameters($params); $this->fillFormTags($params); diff --git a/templates/job-order/cmb.form.onestep.html.twig b/templates/job-order/cmb.form.onestep.html.twig index 6f35127e..7c0646c8 100644 --- a/templates/job-order/cmb.form.onestep.html.twig +++ b/templates/job-order/cmb.form.onestep.html.twig @@ -492,6 +492,31 @@ + {% if mode in ['onestep-edit'] %} +
+
+
+

+ Other Information +

+
+
+
+ + +
+
+
+
+ + {% for picture in jo_pictures %} +
+ {% endfor %} +
+
+
+ {% endif %} +