diff --git a/config/acl.yaml b/config/acl.yaml
index 4699dc85..e7f42308 100644
--- a/config/acl.yaml
+++ b/config/acl.yaml
@@ -244,6 +244,8 @@ access_keys:
label: Cancel
- id: jo_onestep.form
label: One-step Process
+ - id: jo_onestep.edit
+ label: One-step Process Edit
- id: support
label: Customer Support Access
diff --git a/config/routes/job_order.yaml b/config/routes/job_order.yaml
index e1bd3f34..be379be8 100644
--- a/config/routes/job_order.yaml
+++ b/config/routes/job_order.yaml
@@ -185,3 +185,13 @@ jo_onestep_submit:
path: /job-order/onestep
controller: App\Controller\JobOrderController::oneStepSubmit
methods: [POST]
+
+jo_onestep_edit_form:
+ path: /job-order/onestep/{id}/edit
+ controller: App\Controller\JobOrderController::oneStepEditForm
+ methods: [GET]
+
+jo_onestep_edit_submit:
+ path: /job-order/onestep/{id}/edit
+ controller: App\Controller\JobOrderController::oneStepEditSubmit
+ methods: [POST]
diff --git a/src/Controller/JobOrderController.php b/src/Controller/JobOrderController.php
index daff6232..1d1d7336 100644
--- a/src/Controller/JobOrderController.php
+++ b/src/Controller/JobOrderController.php
@@ -264,10 +264,12 @@ class JobOrderController extends Controller
$rows[$key]['meta']['reassign_hub_url'] = $this->generateUrl('jo_open_hub_form', ['id' => $jo_id]);
$rows[$key]['meta']['reassign_rider_url'] = $this->generateUrl('jo_open_rider_form', ['id' => $jo_id]);
$rows[$key]['meta']['edit_url'] = $this->generateUrl('jo_open_edit_form', ['id' => $jo_id]);
+ $rows[$key]['meta']['onestep_edit_url'] = $this->generateUrl('jo_onestep_edit_form', ['id' => $jo_id]);
}
else
{
$rows[$key]['meta']['update_url'] = $this->generateUrl($tier_params['edit_route'], ['id' => $jo_id]);
+ $rows[$key]['meta']['onestep_edit_url'] = $this->generateUrl('jo_onestep_edit_form', ['id' => $jo_id]);
$rows[$key]['meta']['pdf_url'] = $this->generateUrl('jo_pdf_form', ['id' => $jo_id]);
}
@@ -864,4 +866,26 @@ class JobOrderController extends Controller
]);
}
+
+ /**
+ * @Menu(selected="jo_onestep_edit_form")
+ */
+ public function oneStepEditForm($id, JobOrderHandlerInterface $jo_handler, GISManagerInterface $gis)
+ {
+ $this->denyAccessUnlessGranted('jo_onestep.edit', null, 'No access.');
+
+ $params = $jo_handler->initializeOneStepEditForm($id);
+ $params['submit_url'] = $this->generateUrl('jo_onestep_edit_submit', ['id' => $id]);
+ $params['return_url'] = $this->generateUrl('jo_open');
+ $params['map_js_file'] = $gis->getJSJOFile();
+
+ $template = $params['template'];
+
+ // response
+ return $this->render($template, $params);
+ }
+
+ public function oneStepEditSubmit(Request $req, JobOrderHandlerInterface $jo_handler)
+ {
+ }
}
diff --git a/src/Service/JobOrderHandler/ResqJobOrderHandler.php b/src/Service/JobOrderHandler/ResqJobOrderHandler.php
index 1dd72700..860058d4 100644
--- a/src/Service/JobOrderHandler/ResqJobOrderHandler.php
+++ b/src/Service/JobOrderHandler/ResqJobOrderHandler.php
@@ -1267,6 +1267,25 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
return $params;
}
+ public function initializeOneStepEditForm($id)
+ {
+ $em = $this->em;
+ $jo = $em->getRepository(JobOrder::class)->find($id);
+
+ $params['obj'] = $jo;
+ $params['mode'] = 'onestep_edit';
+ $params['cvid'] = $jo->getCustomerVehicle()->getID();
+ $params['vid'] = $jo->getCustomerVehicle()->getVehicle()->getID();
+
+ $this->fillDropdownParameters($params);
+ $this->fillFormTags($params);
+
+ // get template to display
+ $params['template'] = $this->getTwigTemplate('jo_onestep_edit_form');
+
+ return $params;
+ }
+
// initialize open edit job order form
public function initializeOpenEditForm($id)
{
@@ -2185,6 +2204,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
$params['ftags']['ticket_table'] = false;
$params['ftags']['cancel_button'] = false;
break;
+ case 'onestep_edit':
+ $params['ftags']['invoice_edit'] = true;
+ $params['ftags']['preset_vehicle'] = true;
+ break;
}
}
@@ -2212,6 +2235,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
$this->template_hash['jo_list_open'] = 'job-order/list.open.html.twig';
$this->template_hash['jo_list_all'] = 'job-order/list.all.html.twig';
$this->template_hash['jo_onestep'] = 'job-order/form.onestep.html.twig';
+ $this->template_hash['jo_onestep_edit_form'] = 'job-order/form.onestep.html.twig';
}
protected function checkTier($tier)
diff --git a/templates/job-order/list.fulfillment.html.twig b/templates/job-order/list.fulfillment.html.twig
index f38bd4a5..46210a9d 100644
--- a/templates/job-order/list.fulfillment.html.twig
+++ b/templates/job-order/list.fulfillment.html.twig
@@ -108,7 +108,7 @@
sortable: false,
overflow: 'visible',
template: function (row, index, datatable) {
- var actions = '';
+ var actions = '' + '';
return actions;
},
diff --git a/templates/job-order/list.open.html.twig b/templates/job-order/list.open.html.twig
index cea8df51..62af1e3a 100644
--- a/templates/job-order/list.open.html.twig
+++ b/templates/job-order/list.open.html.twig
@@ -122,6 +122,9 @@
{% if is_granted('jo_open.edit') %}
actions += '';
{% endif %}
+ {% if is_granted('jo_onestep.edit') %}
+ actions += '';
+ {% endif %}
return actions;
},