Order/Form: documents can be uploaded even if order is closed already

This commit is contained in:
Frank Schubert
2025-10-09 15:33:24 +02:00
parent c5f60f96c3
commit 15bb02de52
4 changed files with 127 additions and 26 deletions

View File

@@ -40,26 +40,18 @@ class File extends mfBaseModel {
public function delete() {
if($this->id) {
$id = $this->id;
$id = $this->id;
// delete file in store
if($this->subfolder) {
$path = MFUPLOAD_FILE_SAVE_PATH."/".$this->subfolder."/".$this->store_filename;
} else {
$path = MFUPLOAD_FILE_SAVE_PATH."/".$this->store_filename;
}
if(!unlink($path)) {
$this->log->warn(__CLASS__."::delete(): Error unlinking file ($path)");
}
// delete physical file
if(!unlink($this->getFullPath())) {
$this->log->warn(__CLASS__."::delete(): Error unlinking file ({$this->getFullPath()})");
}
$where = "id=$id";
if($this->fieldprefix && !strstr($field,"_")) {
$where = $this->fieldprefix."_id=$id";
}
if($this->db->delete($this->table,$where)) {
if(method_exists($this, "afterDelete")) {
$this->afterDelete();
}
$where = "id=$id";
if($this->db->delete($this->table,$where)) {
if(method_exists($this, "afterDelete")) {
$this->afterDelete();
}
$this->data = new stdClass();
$this->id = "";
return true;