Add pdf workaround #76
This commit is contained in:
parent
00892ba367
commit
e383a66e8f
5 changed files with 1314 additions and 0 deletions
|
|
@ -199,6 +199,8 @@ access_keys:
|
|||
label: Open
|
||||
- id: jo_all.list
|
||||
label: View All
|
||||
- id: jo_pdf.list
|
||||
label: PDF
|
||||
- id: joborder.cancel
|
||||
label: Cancel
|
||||
|
||||
|
|
|
|||
|
|
@ -155,3 +155,8 @@ jo_all_form:
|
|||
path: /job-order/all/{id}
|
||||
controller: App\Controller\JobOrderController::allForm
|
||||
methods: [GET]
|
||||
|
||||
jo_pdf_form:
|
||||
path: /job-order/pdf/{id}
|
||||
controller: App\Controller\JobOrderController::pdfForm
|
||||
methods: [GET]
|
||||
|
|
|
|||
|
|
@ -569,6 +569,7 @@ class JobOrderController extends BaseController
|
|||
else
|
||||
{
|
||||
$row['meta']['update_url'] = $this->generateUrl($tier_params['edit_route'], ['id' => $row['id']]);
|
||||
$row['meta']['pdf_url'] = $this->generateUrl('jo_pdf_form', ['id' => $row['id']]);
|
||||
}
|
||||
|
||||
if ($tier_params['unlock_route'] != '')
|
||||
|
|
@ -1466,6 +1467,34 @@ class JobOrderController extends BaseController
|
|||
// response
|
||||
return $this->render('job-order/form.html.twig', $params);
|
||||
}
|
||||
|
||||
|
||||
public function pdfForm($id)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('jo_pdf.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');
|
||||
|
||||
$this->fillDropdownParameters($params);
|
||||
|
||||
$params['obj'] = $obj;
|
||||
$params['status_cancelled'] = JOStatus::CANCELLED;
|
||||
$params['return_url'] = $this->generateUrl('jo_all');
|
||||
$params['submit_url'] = '';
|
||||
|
||||
// response
|
||||
return $this->render('job-order/form.pdf.html.twig', $params);
|
||||
}
|
||||
|
||||
public function cancelJobOrder(Request $req, $id)
|
||||
{
|
||||
|
|
|
|||
1277
templates/job-order/form.pdf.html.twig
Normal file
1277
templates/job-order/form.pdf.html.twig
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -109,6 +109,7 @@
|
|||
overflow: 'visible',
|
||||
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"><i class="la la-edit"></i></a>';
|
||||
actions += '<a href="' + row.meta.pdf_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="PDF"><i class="la la-file-o"></i></a>';
|
||||
|
||||
return actions;
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue