Merge branch 'spidev' into 'master'
Zeiterfassung Fahrzeugverwaltung neue Features: See merge request fronk/thetool!1115
This commit is contained in:
@@ -32,6 +32,12 @@ class TimerecordingCarController extends mfBaseController
|
||||
case "deleteDocument":
|
||||
$return = $this->deleteDocument();
|
||||
break;
|
||||
case "deleteJournal":
|
||||
$return = $this->deleteJournal();
|
||||
break;
|
||||
case "deleteMilageHistory":
|
||||
$return = $this->deleteMilageHistory();
|
||||
break;
|
||||
default:
|
||||
$return = false;
|
||||
}
|
||||
@@ -57,7 +63,7 @@ class TimerecordingCarController extends mfBaseController
|
||||
{
|
||||
$timerecordingcarid = $this->request->id;
|
||||
$timeRecordingCarMileageHistory = TimerecordingCarMileageHistoryModel::search(["timerecordingCar_id" => $timerecordingcarid]);
|
||||
$timerecordingCarJournal=TimerecordingCarJournalModel::search(["timerecordingCar_id" => $timerecordingcarid]);
|
||||
$timerecordingCarJournal = TimerecordingCarJournalModel::search(["timerecordingCar_id" => $timerecordingcarid]);
|
||||
$mimetypes = TimerecordingCarDocumentsModel::$mimetypes;
|
||||
$timerecordingcarDokuments = TimerecordingCarDocumentsModel::search(["timerecordingCar_id" => $timerecordingcarid]);
|
||||
$this->layout()->set("mimetypes", $mimetypes);
|
||||
@@ -373,4 +379,42 @@ class TimerecordingCarController extends mfBaseController
|
||||
$timerecordingCarDokument->delete();
|
||||
}
|
||||
|
||||
protected function deleteJournal()
|
||||
{
|
||||
$r = $this->request;
|
||||
$id = $r->id;
|
||||
$timerecordingCarJournal = new TimerecordingCarJournal($id);
|
||||
$data = [];
|
||||
$data['deleted'] = 1;
|
||||
$data['edit_by'] = $this->me->id;
|
||||
$timerecordingCarJournal->update($data);
|
||||
$id = $timerecordingCarJournal->save();
|
||||
if (!$id) {
|
||||
|
||||
} else {
|
||||
$result["success"] = true;
|
||||
echo json_encode($result);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
protected function deleteMilageHistory()
|
||||
{
|
||||
$r = $this->request;
|
||||
$id = $r->id;
|
||||
$timerecordingCarMileageHistory = new TimerecordingCarMileageHistory($id);
|
||||
$data = [];
|
||||
$data['deleted'] = 1;
|
||||
$data['edit_by'] = $this->me->id;
|
||||
$timerecordingCarMileageHistory->update($data);
|
||||
$id = $timerecordingCarMileageHistory->save();
|
||||
if (!$id) {
|
||||
|
||||
} else {
|
||||
$result["success"] = true;
|
||||
echo json_encode($result);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ class TimerecordingCarJournalModel
|
||||
private $timerecordingCar_id;
|
||||
private $journal;
|
||||
private $timestamp;
|
||||
|
||||
private $deleted;
|
||||
private $edit_by;
|
||||
|
||||
|
||||
public static function find($data)
|
||||
{
|
||||
@@ -116,7 +118,7 @@ class TimerecordingCarJournalModel
|
||||
if (array_key_exists("timerecordingCar_id", $filter)) {
|
||||
$timerecordingCar_id = $filter['timerecordingCar_id'];
|
||||
if (is_numeric($timerecordingCar_id)) {
|
||||
$where .= " AND timerecordingCar_id=$timerecordingCar_id";
|
||||
$where .= " AND timerecordingCar_id=$timerecordingCar_id AND deleted =0";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ class TimerecordingCarMileageHistoryModel
|
||||
private $timerecordingCar_id;
|
||||
private $mileage;
|
||||
private $mileage_timestamp;
|
||||
private $deleted;
|
||||
private $create_by;
|
||||
private $edit_by;
|
||||
private $create;
|
||||
@@ -120,7 +121,7 @@ class TimerecordingCarMileageHistoryModel
|
||||
if (array_key_exists("timerecordingCar_id", $filter)) {
|
||||
$timerecordingCar_id = $filter['timerecordingCar_id'];
|
||||
if (is_numeric($timerecordingCar_id)) {
|
||||
$where .= " AND timerecordingCar_id=$timerecordingCar_id";
|
||||
$where .= " AND timerecordingCar_id=$timerecordingCar_id AND deleted=0";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user