Merge branch 'warehouse-order-improvements' into 'master'
Updated WarehouseOrder and WarehouseOrderRequest See merge request fronk/thetool!1075
This commit is contained in:
@@ -37,6 +37,7 @@ class TTCrud extends mfBaseController {
|
||||
$this->model = new $modelName();
|
||||
$this->postData = json_decode(file_get_contents('php://input'), true);
|
||||
$this->checkArray = $this->getCheckArray();
|
||||
$this->infoMessages = $this->getInfoMessages();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -293,6 +294,24 @@ class TTCrud extends mfBaseController {
|
||||
if (method_exists($this, 'getByIdParse') && !isset($_GET['disableParse'])) $data = $this->getByIdParse($data);
|
||||
self::returnJson($data);
|
||||
}
|
||||
|
||||
private function getInfoMessages(): array {
|
||||
if (isset($this->infoMessages) && is_array($this->infoMessages)) {
|
||||
return $this->infoMessages;
|
||||
}
|
||||
|
||||
if (isset($this->singleText) && is_string($this->singleText)) {
|
||||
return ['create' => $this->singleText . ' wurde erstellt.',
|
||||
'update' => $this->singleText . ' wurde aktualisiert',
|
||||
'delete' => $this->singleText . ' wurde gelöscht',
|
||||
'noChanges' => 'Keine Änderungen'];
|
||||
}
|
||||
|
||||
return ['create' => 'Eintrag wurde erstellt.',
|
||||
'update' => 'Eintrag wurde aktualisiert',
|
||||
'delete' => 'Eintrag wurde gelöscht',
|
||||
'noChanges' => 'Keine Änderungen'];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -149,7 +149,6 @@ class mfUpload {
|
||||
throw new Exception ("Not enough data to build savepath!",605);
|
||||
}
|
||||
}
|
||||
|
||||
if(!$this->upload->move_upload($this->savepath."/".$this->filename)) {
|
||||
throw new Exception ("Unable to move temp file: ".$this->upload->errormessage,605);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,14 @@ class mfUpload_TmpFile {
|
||||
|
||||
public function move_upload($path) {
|
||||
if($path && $this->tmp_name) {
|
||||
// check if all directories exist needed for the path
|
||||
$dir = dirname($path);
|
||||
if(!is_dir($dir)) {
|
||||
if(!mkdir($dir, 0777, true)) {
|
||||
$this->errormessage = "Cannot create directory $dir.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(move_uploaded_file($this->tmp_name, $path)) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user