From 665a6d1a43bb875ae3f7cb8b7d0d1a31a04783f4 Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Wed, 28 May 2003 10:28:53 +0000 Subject: [PATCH] integrated subscription firing --- presentation/lookAndFeel/knowledgeTree/documentmanagement/archiving/archiveDocumentBL.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/archiving/archiveDocumentBL.php b/presentation/lookAndFeel/knowledgeTree/documentmanagement/archiving/archiveDocumentBL.php index 8e601f7..5618e7d 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/archiving/archiveDocumentBL.php +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/archiving/archiveDocumentBL.php @@ -1,10 +1,9 @@ fileSystemRoot/lib/documentmanagement/Document.inc"); - require_once("$default->fileSystemRoot/lib/archiving/DocumentArchiveSettingsFactory.inc"); - +require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); +require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionEngine.inc"); require_once("$default->fileSystemRoot/lib/visualpatterns/PatternMainPage.inc"); require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc"); @@ -39,8 +38,16 @@ if (checkSession()) { $oDocument->setStatusID(lookupStatusID("Archived")); if ($oDocument->update()) { - // redirect to folder browse $default->log->info("archiveDocumentBL.php successfully archived document id $fDocumentID"); + + // fire subscription alerts for the archived document + $count = SubscriptionEngine::fireSubscription($fDocumentID, SubscriptionConstants::subscriptionAlertType("ArchivedDocument"), + SubscriptionConstants::subscriptionType("DocumentSubscription"), + array( "folderID" => $oDocument->getFolderID(), + "modifiedDocumentName" => $oDocument->getName())); + $default->log->info("archiveDocumentBL.php fired $count subscription alerts for archived document " . $oDocument->getName()); + + // redirect to folder browse redirect("$default->rootUrl/control.php?action=browse&fBrowseType=folder&fFolderID=" . $oDocument->getFolderID()); } else { // error -- libgit2 0.21.4