Add links and routes to editing a one step job order form. #270
This commit is contained in:
parent
79ab60619b
commit
3a167f0b38
6 changed files with 64 additions and 1 deletions
|
|
@ -244,6 +244,8 @@ access_keys:
|
||||||
label: Cancel
|
label: Cancel
|
||||||
- id: jo_onestep.form
|
- id: jo_onestep.form
|
||||||
label: One-step Process
|
label: One-step Process
|
||||||
|
- id: jo_onestep.edit
|
||||||
|
label: One-step Process Edit
|
||||||
|
|
||||||
- id: support
|
- id: support
|
||||||
label: Customer Support Access
|
label: Customer Support Access
|
||||||
|
|
|
||||||
|
|
@ -185,3 +185,13 @@ jo_onestep_submit:
|
||||||
path: /job-order/onestep
|
path: /job-order/onestep
|
||||||
controller: App\Controller\JobOrderController::oneStepSubmit
|
controller: App\Controller\JobOrderController::oneStepSubmit
|
||||||
methods: [POST]
|
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]
|
||||||
|
|
|
||||||
|
|
@ -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_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']['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']['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
|
else
|
||||||
{
|
{
|
||||||
$rows[$key]['meta']['update_url'] = $this->generateUrl($tier_params['edit_route'], ['id' => $jo_id]);
|
$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]);
|
$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)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1267,6 +1267,25 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
return $params;
|
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
|
// initialize open edit job order form
|
||||||
public function initializeOpenEditForm($id)
|
public function initializeOpenEditForm($id)
|
||||||
{
|
{
|
||||||
|
|
@ -2185,6 +2204,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
$params['ftags']['ticket_table'] = false;
|
$params['ftags']['ticket_table'] = false;
|
||||||
$params['ftags']['cancel_button'] = false;
|
$params['ftags']['cancel_button'] = false;
|
||||||
break;
|
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_open'] = 'job-order/list.open.html.twig';
|
||||||
$this->template_hash['jo_list_all'] = 'job-order/list.all.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'] = 'job-order/form.onestep.html.twig';
|
||||||
|
$this->template_hash['jo_onestep_edit_form'] = 'job-order/form.onestep.html.twig';
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function checkTier($tier)
|
protected function checkTier($tier)
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@
|
||||||
sortable: false,
|
sortable: false,
|
||||||
overflow: 'visible',
|
overflow: 'visible',
|
||||||
template: function (row, index, datatable) {
|
template: function (row, index, datatable) {
|
||||||
var actions = '<a href="' + row.meta.update_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="View / Edit"><i class="la la-edit"></i></a>';
|
var actions = '<a href="' + row.meta.update_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="View / Edit"><i class="la la-edit"></i></a>' + '<a href="' + row.meta.onestep_edit_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="One Step Edit"><i class="la la-edit"></i></a>';
|
||||||
|
|
||||||
return actions;
|
return actions;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,9 @@
|
||||||
{% if is_granted('jo_open.edit') %}
|
{% if is_granted('jo_open.edit') %}
|
||||||
actions += '<a href="' + row.meta.edit_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-reassign-hub" title="Edit"><i class="fa fa-file"></i></a>';
|
actions += '<a href="' + row.meta.edit_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-reassign-hub" title="Edit"><i class="fa fa-file"></i></a>';
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if is_granted('jo_onestep.edit') %}
|
||||||
|
actions += '<a href="' + row.meta.onestep_edit_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-reassign-hub" title="One Step Edit"><i class="fa fa-file"></i></a>';
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
return actions;
|
return actions;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue