diff --git a/lib/dashboard/Notification.inc.php b/lib/dashboard/Notification.inc.php index 5fdb893..8644d02 100644 --- a/lib/dashboard/Notification.inc.php +++ b/lib/dashboard/Notification.inc.php @@ -6,31 +6,31 @@ * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ * @@ -200,7 +200,10 @@ class KTSubscriptionNotification extends KTNotificationHandler { "ModifyDocument" => 'document', "CheckInDocument" => 'document', "CheckOutDocument" => 'document', - "MovedDocument" => 'document', + "MovedDocument" => 'folder', + "MovedDocument2" => 'document', + "CopiedDocument" => 'folder', + "CopiedDocument2" => 'document', "ArchivedDocument" => 'document', // can go through and request un-archival (?) "RestoredArchivedDocument" => 'document', "DiscussDocument" => 'document', diff --git a/lib/subscriptions/subscriptions.inc.php b/lib/subscriptions/subscriptions.inc.php index 1f24add..3306b35 100644 --- a/lib/subscriptions/subscriptions.inc.php +++ b/lib/subscriptions/subscriptions.inc.php @@ -64,7 +64,9 @@ class SubscriptionEvent { "CheckInDocument", "CheckOutDocument", "MovedDocument", + "MovedDocument2", "CopiedDocument", + "CopiedDocument2", "ArchivedDocument", "RestoredArchivedDocument", "DownloadDocument", @@ -364,15 +366,16 @@ class SubscriptionEvent { } function MoveDocument($oMovedDocument, $oToFolder, $oFromFolder, $moveOrCopy = "MovedDocument") { - $content = new SubscriptionContent(); // needed for i18n - // OK: two actions: document registrants, folder registrants. + $parentId = $oToFolder->getId(); + + // Document registrants $aDocUsers = $this->_getSubscribers($oMovedDocument->getId(), $this->subscriptionTypes["Document"]); + $this->sendNotification($aDocUsers, $moveOrCopy.'2', $oMovedDocument->getName(), $oMovedDocument->getId(), $parentId); + + // Folder registrants $aFromUsers = $this->_getSubscribers($oFromFolder->getId(), $this->subscriptionTypes["Folder"]); $aFolderUsers = $this->_getSubscribers($oToFolder->getId(), $this->subscriptionTypes["Folder"]); - $aUsers = array_merge($aDocUsers, $aFromUsers); - $aUsers = array_merge($aUsers, $aFolderUsers); - - $parentId = $oToFolder->getId(); + $aUsers = array_merge($aFromUsers, $aFolderUsers); $this->sendNotification($aUsers, $moveOrCopy, $oMovedDocument->getName(), $oToFolder->getId(), $parentId); } @@ -542,7 +545,9 @@ class SubscriptionContent { "CheckInDocument" => _kt('Document checked in'), "CheckOutDocument" => _kt('Document checked out'), "MovedDocument" => _kt('Document moved'), + "MovedDocument2" => _kt('Document moved'), "CopiedDocument" => _kt('Document copied'), + "CopiedDocument2" => _kt('Document copied'), "ArchivedDocument" => _kt('Document archived'), // can go through and request un-archival (?) "DownloadDocument" => _kt('Document downloaded'), "RestoredArchivedDocument" => _kt('Document restored'), @@ -660,6 +665,7 @@ class SubscriptionContent { $links .= ' | '._kt('Clear Alert').''; break; case 'MovedDocument': + case 'MovedDocument2': $text = $modifyDocumentText; $url = $rootUrl.'/notify.php?id='.$info['notify_id']; if(!$bulk_action) $links = ''._kt('View New Location').''; @@ -667,6 +673,7 @@ class SubscriptionContent { $links .= ' | '._kt('Clear Alert').''; break; case 'CopiedDocument': + case 'CopiedDocument2': $text = $copiedDocumentText; $url = $rootUrl.'/notify.php?id='.$info['notify_id']; if(!$bulk_action) $links = ''._kt('View Document').''; @@ -770,8 +777,10 @@ class SubscriptionContent { "ModifyDocument" => 'document', "CheckInDocument" => 'document', "CheckOutDocument" => 'document', - "MovedDocument" => 'document', - "CopiedDocument" => 'document', + "MovedDocument" => 'folder', + "MovedDocument2" => 'document', + "CopiedDocument" => 'folder', + "CopiedDocument2" => 'document', "ArchivedDocument" => 'document', // can go through and request un-archival (?) "DownloadDocument" => 'document', "RestoredArchivedDocument" => 'document',