Remove links to onestep edit from templates for resq. Fix for getEditRoute issues found during testing. #357
This commit is contained in:
parent
6d14677bd7
commit
3d40bc6238
4 changed files with 5 additions and 29 deletions
|
|
@ -277,13 +277,13 @@ 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']['edit_url'] = $this->generateUrl($jo_handler->getEditRoute($jo_id, $tier_params), ['id' => $jo_id]);
|
$rows[$key]['meta']['edit_url'] = $this->generateUrl($jo_handler->getEditRoute($jo_id, $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']['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']['update_url'] = $this->generateUrl($jo_handler->getEditRoute($jo_id, $tier_params), ['id' => $jo_id]);
|
$rows[$key]['meta']['update_url'] = $this->generateUrl($jo_handler->getEditRoute($jo_id, $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']['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]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2590,30 +2590,9 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
|
|
||||||
public function getEditRoute($jo_id, $tier)
|
public function getEditRoute($jo_id, $tier)
|
||||||
{
|
{
|
||||||
$edit_route = '';
|
|
||||||
|
|
||||||
if (empty($tier))
|
if (empty($tier))
|
||||||
return $edit_route;
|
return 'jo_open_edit_form';
|
||||||
|
|
||||||
switch ($tier)
|
return $tier;
|
||||||
{
|
|
||||||
case 'proc':
|
|
||||||
$edit_route = 'jo_proc_form';
|
|
||||||
break;
|
|
||||||
case 'assign':
|
|
||||||
$edit_route = 'jo_assign_form';
|
|
||||||
break;
|
|
||||||
case 'fulfill':
|
|
||||||
$edit_route = 'jo_fulfill_form';
|
|
||||||
break;
|
|
||||||
case 'all':
|
|
||||||
$edit_route = 'jo_all_form';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
// do nothing
|
|
||||||
// for 'open', edit route is blank
|
|
||||||
}
|
|
||||||
|
|
||||||
return $edit_route;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,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>' + '<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>';
|
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>';
|
||||||
|
|
||||||
return actions;
|
return actions;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -148,9 +148,6 @@
|
||||||
{% 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