- get list of users/groups to notify before removing document

This commit is contained in:
steinm 2010-11-18 14:36:45 +00:00
parent af5e6e7b79
commit 0d695f57d6

View File

@ -45,10 +45,11 @@ if ($document->getAccessMode($user) < M_ALL) {
$folder = $document->getFolder(); $folder = $document->getFolder();
/* Get the notify list before removing the document */
$nl = $document->getNotifyList();
if (!$document->remove()) { if (!$document->remove()) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("error_occured")); UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("error_occured"));
} else { } else {
$document->getNotifyList();
if ($notifier){ if ($notifier){
$path = ""; $path = "";
$folderPath = $folder->getPath(); $folderPath = $folder->getPath();
@ -70,8 +71,8 @@ if (!$document->remove()) {
$message=mydmsDecodeString($message); $message=mydmsDecodeString($message);
// Send notification to subscribers. // Send notification to subscribers.
$notifier->toList($user, $document->_notifyList["users"], $subject, $message); $notifier->toList($user, $nl["users"], $subject, $message);
foreach ($document->_notifyList["groups"] as $grp) { foreach ($nl["groups"] as $grp) {
$notifier->toGroup($user, $grp, $subject, $message); $notifier->toGroup($user, $grp, $subject, $message);
} }
} }