Commit c47fa0c1d3a86dd747c554a4a55df192341f454a

Authored by michael
1 parent afaad557

added subscription firing code


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@986 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php
@@ -14,6 +14,7 @@ require_once("$default->owl_fs_root/lib/foldermanagement/Folder.inc"); @@ -14,6 +14,7 @@ require_once("$default->owl_fs_root/lib/foldermanagement/Folder.inc");
14 require_once("$default->owl_fs_root/lib/users/User.inc"); 14 require_once("$default->owl_fs_root/lib/users/User.inc");
15 require_once("$default->owl_fs_root/lib/documentmanagement/Document.inc"); 15 require_once("$default->owl_fs_root/lib/documentmanagement/Document.inc");
16 require_once("$default->owl_fs_root/lib/documentmanagement/DocumentTransaction.inc"); 16 require_once("$default->owl_fs_root/lib/documentmanagement/DocumentTransaction.inc");
  17 +require_once("$default->owl_fs_root/lib/subscriptions/SubscriptionEngine.inc");
17 18
18 require_once("$default->owl_fs_root/presentation/Html.inc"); 19 require_once("$default->owl_fs_root/presentation/Html.inc");
19 20
@@ -33,7 +34,17 @@ if (checkSession()) { @@ -33,7 +34,17 @@ if (checkSession()) {
33 $oDocumentTransaction->create(); 34 $oDocumentTransaction->create();
34 if ($oDocument->delete()) { 35 if ($oDocument->delete()) {
35 if (unlink($sDocumentPath)) { 36 if (unlink($sDocumentPath)) {
36 - //successfully deleted the document from the file system 37 + // successfully deleted the document from the file system
  38 +
  39 + // fire subscription alerts for the deleted document
  40 + $count = SubscriptionEngine::fireSubscription($oDocument->getFolderID(), SubscriptionConstants::subscriptionAlertType("RemoveDocument"),
  41 + SubscriptionConstants::subscriptionType("FolderSubscription"),
  42 + array( "removedDocumentName" => $oDocument->getName(),
  43 + "folderName" => Folder::getFolderName($oDocument->getFolderID())));
  44 + $default->log->info("deleteDocumentBL.php fired $count subscription alerts for removed document " . $oDocument->getName());
  45 +
  46 +
  47 + // redirect to the browse folder page
37 redirect("$default->owl_root_url/control.php?action=browse&fFolderID=" . $oDocument->getFolderID()); 48 redirect("$default->owl_root_url/control.php?action=browse&fFolderID=" . $oDocument->getFolderID());
38 } else { 49 } else {
39 //could not delete the document from the file system 50 //could not delete the document from the file system