Commit 665a6d1a43bb875ae3f7cb8b7d0d1a31a04783f4
1 parent
a3fa7632
integrated subscription firing
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1952 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
11 additions
and
4 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/archiving/archiveDocumentBL.php
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | require_once("../../../../../config/dmsDefaults.php"); |
| 4 | -require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); | |
| 5 | - | |
| 6 | 4 | require_once("$default->fileSystemRoot/lib/archiving/DocumentArchiveSettingsFactory.inc"); |
| 7 | - | |
| 5 | +require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); | |
| 6 | +require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionEngine.inc"); | |
| 8 | 7 | require_once("$default->fileSystemRoot/lib/visualpatterns/PatternMainPage.inc"); |
| 9 | 8 | require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); |
| 10 | 9 | require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc"); |
| ... | ... | @@ -39,8 +38,16 @@ if (checkSession()) { |
| 39 | 38 | $oDocument->setStatusID(lookupStatusID("Archived")); |
| 40 | 39 | |
| 41 | 40 | if ($oDocument->update()) { |
| 42 | - // redirect to folder browse | |
| 43 | 41 | $default->log->info("archiveDocumentBL.php successfully archived document id $fDocumentID"); |
| 42 | + | |
| 43 | + // fire subscription alerts for the archived document | |
| 44 | + $count = SubscriptionEngine::fireSubscription($fDocumentID, SubscriptionConstants::subscriptionAlertType("ArchivedDocument"), | |
| 45 | + SubscriptionConstants::subscriptionType("DocumentSubscription"), | |
| 46 | + array( "folderID" => $oDocument->getFolderID(), | |
| 47 | + "modifiedDocumentName" => $oDocument->getName())); | |
| 48 | + $default->log->info("archiveDocumentBL.php fired $count subscription alerts for archived document " . $oDocument->getName()); | |
| 49 | + | |
| 50 | + // redirect to folder browse | |
| 44 | 51 | redirect("$default->rootUrl/control.php?action=browse&fBrowseType=folder&fFolderID=" . $oDocument->getFolderID()); |
| 45 | 52 | } else { |
| 46 | 53 | // error | ... | ... |