From c47fa0c1d3a86dd747c554a4a55df192341f454a Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 19 Feb 2003 10:31:37 +0000 Subject: [PATCH] added subscription firing code --- presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php b/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php index f8d5c7c..1bc99ff 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php @@ -14,6 +14,7 @@ require_once("$default->owl_fs_root/lib/foldermanagement/Folder.inc"); require_once("$default->owl_fs_root/lib/users/User.inc"); require_once("$default->owl_fs_root/lib/documentmanagement/Document.inc"); require_once("$default->owl_fs_root/lib/documentmanagement/DocumentTransaction.inc"); +require_once("$default->owl_fs_root/lib/subscriptions/SubscriptionEngine.inc"); require_once("$default->owl_fs_root/presentation/Html.inc"); @@ -33,7 +34,17 @@ if (checkSession()) { $oDocumentTransaction->create(); if ($oDocument->delete()) { if (unlink($sDocumentPath)) { - //successfully deleted the document from the file system + // successfully deleted the document from the file system + + // fire subscription alerts for the deleted document + $count = SubscriptionEngine::fireSubscription($oDocument->getFolderID(), SubscriptionConstants::subscriptionAlertType("RemoveDocument"), + SubscriptionConstants::subscriptionType("FolderSubscription"), + array( "removedDocumentName" => $oDocument->getName(), + "folderName" => Folder::getFolderName($oDocument->getFolderID()))); + $default->log->info("deleteDocumentBL.php fired $count subscription alerts for removed document " . $oDocument->getName()); + + + // redirect to the browse folder page redirect("$default->owl_root_url/control.php?action=browse&fFolderID=" . $oDocument->getFolderID()); } else { //could not delete the document from the file system -- libgit2 0.21.4