Add function to load walk-in form. #340
This commit is contained in:
parent
60203cc7b5
commit
7e116d8d3e
3 changed files with 1125 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ use App\Entity\Battery;
|
|||
use App\Entity\JobOrder;
|
||||
use App\Entity\VehicleManufacturer;
|
||||
use App\Entity\Vehicle;
|
||||
use App\Entity\Hub;
|
||||
|
||||
use App\Service\InvoiceGeneratorInterface;
|
||||
use App\Service\JobOrderHandlerInterface;
|
||||
|
|
@ -962,4 +963,25 @@ class JobOrderController extends Controller
|
|||
|
||||
return $this->render('job-order/tracker.html.twig', $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Menu(selected="jo_walkin_form")
|
||||
*/
|
||||
public function walkinForm(EntityManagerInterface $em, JobOrderHandlerInterface $jo_handler)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('jo_walkin.form', null, 'No access.');
|
||||
|
||||
$params = $jo_handler->initializeWalkinForm();
|
||||
$params['submit_url'] = $this->generateUrl('jo_walkin_submit');
|
||||
$params['return_url'] = $this->generateUrl('jo_walkin_form');
|
||||
$params['vmfgs'] = $em->getRepository(VehicleManufacturer::class)->findAll();
|
||||
$params['vmakes'] = $em->getRepository(Vehicle::class)->findAll();
|
||||
$params['hubs'] = $em->getRepository(Hub::class)->findAll();
|
||||
|
||||
$template = $params['template'];
|
||||
|
||||
// response
|
||||
return $this->render($template, $params);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2345,6 +2345,21 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
return false;
|
||||
}
|
||||
|
||||
public function initializeWalkinForm()
|
||||
{
|
||||
$params['obj'] = new JobOrder();
|
||||
$params['mode'] = 'onestep';
|
||||
|
||||
$this->fillDropdownParameters($params);
|
||||
$this->fillFormTags($params);
|
||||
|
||||
// get template to display
|
||||
$params['template'] = $this->getTwigTemplate('jo_walkin');
|
||||
|
||||
// return params
|
||||
return $params;
|
||||
}
|
||||
|
||||
protected function fillDropdownParameters(&$params)
|
||||
{
|
||||
$em = $this->em;
|
||||
|
|
@ -2450,6 +2465,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
$this->template_hash['jo_list_all'] = 'job-order/list.all.html.twig';
|
||||
$this->template_hash['jo_onestep'] = 'job-order/cmb.form.onestep.html.twig';
|
||||
$this->template_hash['jo_onestep_edit_form'] = 'job-order/cmb.form.onestep.html.twig';
|
||||
$this->template_hash['jo_walkin'] = 'job-order/cmb.form.walkin.html.twig';
|
||||
}
|
||||
|
||||
protected function checkTier($tier)
|
||||
|
|
|
|||
1087
templates/job-order/cmb.form.walkin.html.twig
Normal file
1087
templates/job-order/cmb.form.walkin.html.twig
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue