mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
call the hook and let it do everything
only if the hook returns null, than proceed with the regular removal
This commit is contained in:
parent
5af3ceef36
commit
d1c11c04aa
|
@ -31,13 +31,15 @@ class SeedDMS_Controller_RemoveDocument extends SeedDMS_Controller_Common {
|
||||||
|
|
||||||
$folder = $document->getFolder();
|
$folder = $document->getFolder();
|
||||||
|
|
||||||
/* Get the notify list before removing the document */
|
/* Get the document id and name before removing the document */
|
||||||
$docname = $document->getName();
|
$docname = $document->getName();
|
||||||
$documentid = $document->getID();
|
$documentid = $document->getID();
|
||||||
|
|
||||||
if(!$this->callHook('preRemoveDocument')) {
|
if(!$this->callHook('preRemoveDocument')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$result = $this->callHook('removeDocument', $document);
|
||||||
|
if($result === null) {
|
||||||
if (!$document->remove()) {
|
if (!$document->remove()) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -53,6 +55,8 @@ class SeedDMS_Controller_RemoveDocument extends SeedDMS_Controller_Common {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user