diff --git a/config/acl.yaml b/config/acl.yaml index cf0f4bbf..0458a505 100644 --- a/config/acl.yaml +++ b/config/acl.yaml @@ -197,6 +197,8 @@ access_keys: label: Fulfillment - id: jo_open.list label: Open + - id: jo_all.list + label: View All - id: joborder.cancel label: Cancel diff --git a/config/menu.yaml b/config/menu.yaml index cdc72dc8..7356e376 100644 --- a/config/menu.yaml +++ b/config/menu.yaml @@ -101,6 +101,10 @@ main_menu: acl: jo_open.list label: Open parent: joborder + - id: jo_all + acl: jo_all.list + label: View All + parent: joborder - id: support acl: support.menu diff --git a/config/routes/job_order.yaml b/config/routes/job_order.yaml index f5148406..74849cad 100644 --- a/config/routes/job_order.yaml +++ b/config/routes/job_order.yaml @@ -132,3 +132,20 @@ jo_assign_unlock: path: /job-order/{id}/unlock/assignor controller: App\Controller\JobOrderController::unlockAssignor methods: [GET] + +jo_all: + path: /job-order/all + controller: App\Controller\JobOrderController::listAll + methods: [GET] + +jo_all_rows: + path: /job-order/all-rows + controller: App\Controller\JobOrderController::getRows + methods: [POST] + defaults: + tier: "all" + +jo_all_form: + path: /job-order/all/{id} + controller: App\Controller\JobOrderController::allForm + methods: [GET] diff --git a/public/assets/css/style.css b/public/assets/css/style.css index 9edbff58..a80da49c 100644 --- a/public/assets/css/style.css +++ b/public/assets/css/style.css @@ -166,6 +166,25 @@ span.has-danger, margin-left: 4px; } +.m-timeline-2 .m-timeline-2__items .m-timeline-2__item .m-timeline-2__item-cricle { + left: 6.1rem; + top: 0.3rem; +} + +.m-timeline-2 .m-timeline-2__items .m-timeline-2__item .m-timeline-2__item-text { + padding-left: 7rem; +} + +.m-timeline-2:before { + left: 7.95rem; +} + +.m-timeline-2 .m-timeline-2__items .m-timeline-2__item .m-timeline-2__item-time { + line-height: 1rem; + padding-top: 0; + top: -0.45rem; +} + @media (min-width: 995px) { .modal-lg { max-width: 1024px; diff --git a/src/Controller/JobOrderController.php b/src/Controller/JobOrderController.php index 3906bb3f..4b7c1b3d 100644 --- a/src/Controller/JobOrderController.php +++ b/src/Controller/JobOrderController.php @@ -304,7 +304,7 @@ class JobOrderController extends BaseController $tier_key = 'jo_open'; $tier_name = 'Open'; $rows_route = 'jo_open_rows'; - $edit_route = false; + $edit_route = ''; $unlock_route = ''; $jo_status = [ JOStatus::PENDING, @@ -313,6 +313,14 @@ class JobOrderController extends BaseController JOStatus::IN_PROGRESS ]; break; + case 'all': + $tier_key = 'jo_open'; + $tier_name = 'Open'; + $rows_route = 'jo_open_rows'; + $edit_route = 'jo_all_form'; + $unlock_route = ''; + $jo_status = ''; + break; default: $exception = $this->createAccessDeniedException('No access.'); throw $exception; @@ -360,6 +368,15 @@ class JobOrderController extends BaseController return $this->render('job-order/list.open.html.twig', $params); } + public function listAll() + { + $params = $this->initParameters('jo_all'); + + $params['table_refresh_rate'] = $this->container->getParameter('job_order_refresh_interval'); + + return $this->render('job-order/list.all.html.twig', $params); + } + public function listRows($tier) { // check which job order tier is being called for and confirm access @@ -1212,6 +1229,68 @@ class JobOrderController extends BaseController ]); } + public function allForm($id) + { + $this->denyAccessUnlessGranted('jo_all.list', null, 'No access.'); + + $em = $this->getDoctrine()->getManager(); + + $params = $this->initParameters('jo_all'); + $params['mode'] = 'update-all'; + + // get row data + $obj = $em->getRepository(JobOrder::class)->find($id); + + // make sure this row exists + if (empty($obj)) + throw $this->createNotFoundException('The job order does not exist'); + + // get parent associations + $params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll(); + $params['customers'] = $em->getRepository(Customer::class)->findAll(); + $params['service_types'] = ServiceType::getCollection(); + $params['warranty_classes'] = WarrantyClass::getCollection(); + $params['statuses'] = JOStatus::getCollection(); + $params['promos'] = $em->getRepository(Promo::class)->findAll(); + $params['discount_apply'] = DiscountApply::getCollection(); + $params['trade_in_types'] = TradeInType::getCollection(); + + $params['obj'] = $obj; + $params['return_url'] = $this->generateUrl('jo_all'); + $params['submit_url'] = ''; + + // timeline stuff (descending by time) + $params['timeline'] = [ + [ + 'date' => date("M j"), + 'time' => date("H:i A"), + 'event' => "Event 4", + 'color' => "#f4516c" + ], + [ + 'date' => date("M j"), + 'time' => date("H:i A"), + 'event' => "Event 3", + 'color' => "#34bfa3" + ], + [ + 'date' => date("M j"), + 'time' => date("H:i A"), + 'event' => "Event 2", + 'color' => "#716aca" + ], + [ + 'date' => date("M j"), + 'time' => date("H:i A"), + 'event' => "Event 1", + 'color' => "#ffb822" + ], + ]; + + // response + return $this->render('job-order/form.html.twig', $params); + } + public function cancelJobOrder(Request $req, $id) { $this->denyAccessUnlessGranted('joborder.cancel', null, 'No access.'); @@ -1258,6 +1337,8 @@ class JobOrderController extends BaseController $query->where('q.status IN (:statuses)') ->setParameter('statuses', $status, Connection::PARAM_STR_ARRAY); break; + case 'all': + break; default: $query->where('q.status = :status') ->setParameter('status', $status); diff --git a/templates/job-order/form.html.twig b/templates/job-order/form.html.twig index 6b28fd71..1a5e8df7 100644 --- a/templates/job-order/form.html.twig +++ b/templates/job-order/form.html.twig @@ -34,6 +34,9 @@ {% elseif mode == 'update-reassign-rider' %} Re-assign Rider {{ obj.getID() }} + {% elseif mode == 'update-all' %} + Viewing + {{ obj.getID() }} {% else %} Incoming {% endif %} @@ -454,7 +457,7 @@ {% endif %} - {% if mode in ['update-assigning', 'update-fulfillment', 'update-reassign-rider'] %} + {% if mode in ['update-assigning', 'update-fulfillment', 'update-reassign-rider', 'update-all'] %}
{% if obj.getHub %}
@@ -553,45 +556,81 @@
{% endif %} - {% if mode == 'update-fulfillment' %} -
-
-

- Rider Details -

-
-
-
- - - + {% if mode in ['update-fulfillment', 'update-all'] %} + {% if obj.getRider %} +
+
+

+ Rider Details +

-
- - - +
+
+ + + +
+
+ + + +
+
+
+
+ + + +
+
+ + + +
+
+
+
+ +
+
-
-
- - - -
-
- - - -
-
-
-
- -
+ {% endif %} + {% endif %} + {% endif %} + + {% if mode == 'update-all' %} +
+ +
+
+

+ Timeline +

+
+
+
+
+
+ {% for item in timeline %} +
+ + {{ item.date }} +
{{ item.time }}
+
+
+ +
+
+ {{ item.event }} +
+
+ {% endfor %} +
- {% endif %} +
{% endif %} {% if mode != 'create' %} @@ -621,7 +660,9 @@
- + {% if mode != 'update-all' %} + + {% endif %} {% if mode != 'create' and is_granted('joborder.cancel') %} Cancel Job Order {% endif %} diff --git a/templates/job-order/list.all.html.twig b/templates/job-order/list.all.html.twig new file mode 100644 index 00000000..8b2da9be --- /dev/null +++ b/templates/job-order/list.all.html.twig @@ -0,0 +1,132 @@ +{% extends 'base.html.twig' %} + +{% block body %} + +
+
+
+

+ Job Orders (All) +

+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+ + + + +
+
+
+
+
+
+ +
+ +
+
+
+
+
+{% endblock %} + +{% block scripts %} + +{% endblock %}