overhauled workorder module
This commit is contained in:
@@ -16,7 +16,7 @@ class WorkorderCompanyController extends WorkorderBaseController {
|
||||
['key' => 'deadlineDate', 'text' => 'Deadline', 'modal' => false, 'table' => ['filter' => 'date', 'sortable' => true]],
|
||||
['key' => 'appointmentDate', 'text' => 'Termin', 'modal' => false, 'table' => ['filter' => 'date', 'sortable' => true]],
|
||||
];
|
||||
protected array $additionalJSVariables = ['COMPANY_ID' => '0'];
|
||||
protected array $additionalJSVariables = ['COMPANY_ID' => '0', 'RML_COMPANY_MANAGER' => false];
|
||||
|
||||
protected function prepareCrudConfig() {
|
||||
$preorderInfoColIdx = array_search('preorderInfo', array_column($this->columns, 'key'));
|
||||
@@ -34,6 +34,14 @@ class WorkorderCompanyController extends WorkorderBaseController {
|
||||
|
||||
|
||||
$this->additionalJSVariables['COMPANY_ID'] = $company ? $company->id : 0;
|
||||
if ($this->user->can('RMLCompanyManager')) {
|
||||
$this->additionalJSVariables['RML_COMPANY_MANAGER'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function indexAction() {
|
||||
$this->archiveWorkorders();
|
||||
parent::indexAction();
|
||||
}
|
||||
|
||||
protected function logout() {
|
||||
@@ -185,7 +193,7 @@ class WorkorderCompanyController extends WorkorderBaseController {
|
||||
$doc = WorkorderDocumentationModel::get($this->postData['id']);
|
||||
if (!$doc) self::sendError("Dokument nicht gefunden.");
|
||||
if (isset($this->postData['documentType'])) $doc->documentType = $this->postData['documentType'];
|
||||
WorkorderDocumentationModel::update((array)$doc);
|
||||
WorkorderModel::update((array)$doc);
|
||||
self::returnJson(['success' => true, 'message' => 'Dokument aktualisiert.']);
|
||||
}
|
||||
|
||||
@@ -213,4 +221,4 @@ class WorkorderCompanyController extends WorkorderBaseController {
|
||||
self::returnJson(['success' => true, 'message' => 'Tiefbau erfolgreich abgeschlossen.']);
|
||||
}
|
||||
//endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user