Commit 72c1cb81a10b386e7174d7e2b5dd384e8c3fcf26

Authored by Megan Watson
1 parent 4f2c6b30

The move notification now correctly points to the target folder. Subscribers to …

…the document will get a link to the document.
Jira: KTS-4381

Committed by: Megan Watson
lib/dashboard/Notification.inc.php
@@ -6,31 +6,31 @@ @@ -6,31 +6,31 @@
6 * Document Management Made Simple 6 * Document Management Made Simple
7 * Copyright (C) 2008, 2009 KnowledgeTree Inc. 7 * Copyright (C) 2008, 2009 KnowledgeTree Inc.
8 * Portions copyright The Jam Warehouse Software (Pty) Limited 8 * Portions copyright The Jam Warehouse Software (Pty) Limited
9 - * 9 + *
10 * This program is free software; you can redistribute it and/or modify it under 10 * This program is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU General Public License version 3 as published by the 11 * the terms of the GNU General Public License version 3 as published by the
12 * Free Software Foundation. 12 * Free Software Foundation.
13 - * 13 + *
14 * This program is distributed in the hope that it will be useful, but WITHOUT 14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * details. 17 * details.
18 - * 18 + *
19 * You should have received a copy of the GNU General Public License 19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>. 20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 - *  
22 - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, 21 + *
  22 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
23 * California 94120-7775, or email info@knowledgetree.com. 23 * California 94120-7775, or email info@knowledgetree.com.
24 - * 24 + *
25 * The interactive user interfaces in modified source and object code versions 25 * The interactive user interfaces in modified source and object code versions
26 * of this program must display Appropriate Legal Notices, as required under 26 * of this program must display Appropriate Legal Notices, as required under
27 * Section 5 of the GNU General Public License version 3. 27 * Section 5 of the GNU General Public License version 3.
28 - * 28 + *
29 * In accordance with Section 7(b) of the GNU General Public License version 3, 29 * In accordance with Section 7(b) of the GNU General Public License version 3,
30 * these Appropriate Legal Notices must retain the display of the "Powered by 30 * these Appropriate Legal Notices must retain the display of the "Powered by
31 - * KnowledgeTree" logo and retain the original copyright notice. If the display of the 31 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices 32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
33 - * must display the words "Powered by KnowledgeTree" and retain the original 33 + * must display the words "Powered by KnowledgeTree" and retain the original
34 * copyright notice. 34 * copyright notice.
35 * Contributor( s): ______________________________________ 35 * Contributor( s): ______________________________________
36 * 36 *
@@ -200,7 +200,10 @@ class KTSubscriptionNotification extends KTNotificationHandler { @@ -200,7 +200,10 @@ class KTSubscriptionNotification extends KTNotificationHandler {
200 "ModifyDocument" => 'document', 200 "ModifyDocument" => 'document',
201 "CheckInDocument" => 'document', 201 "CheckInDocument" => 'document',
202 "CheckOutDocument" => 'document', 202 "CheckOutDocument" => 'document',
203 - "MovedDocument" => 'document', 203 + "MovedDocument" => 'folder',
  204 + "MovedDocument2" => 'document',
  205 + "CopiedDocument" => 'folder',
  206 + "CopiedDocument2" => 'document',
204 "ArchivedDocument" => 'document', // can go through and request un-archival (?) 207 "ArchivedDocument" => 'document', // can go through and request un-archival (?)
205 "RestoredArchivedDocument" => 'document', 208 "RestoredArchivedDocument" => 'document',
206 "DiscussDocument" => 'document', 209 "DiscussDocument" => 'document',
lib/subscriptions/subscriptions.inc.php
@@ -64,7 +64,9 @@ class SubscriptionEvent { @@ -64,7 +64,9 @@ class SubscriptionEvent {
64 "CheckInDocument", 64 "CheckInDocument",
65 "CheckOutDocument", 65 "CheckOutDocument",
66 "MovedDocument", 66 "MovedDocument",
  67 + "MovedDocument2",
67 "CopiedDocument", 68 "CopiedDocument",
  69 + "CopiedDocument2",
68 "ArchivedDocument", 70 "ArchivedDocument",
69 "RestoredArchivedDocument", 71 "RestoredArchivedDocument",
70 "DownloadDocument", 72 "DownloadDocument",
@@ -364,15 +366,16 @@ class SubscriptionEvent { @@ -364,15 +366,16 @@ class SubscriptionEvent {
364 } 366 }
365 367
366 function MoveDocument($oMovedDocument, $oToFolder, $oFromFolder, $moveOrCopy = "MovedDocument") { 368 function MoveDocument($oMovedDocument, $oToFolder, $oFromFolder, $moveOrCopy = "MovedDocument") {
367 - $content = new SubscriptionContent(); // needed for i18n  
368 - // OK: two actions: document registrants, folder registrants. 369 + $parentId = $oToFolder->getId();
  370 +
  371 + // Document registrants
369 $aDocUsers = $this->_getSubscribers($oMovedDocument->getId(), $this->subscriptionTypes["Document"]); 372 $aDocUsers = $this->_getSubscribers($oMovedDocument->getId(), $this->subscriptionTypes["Document"]);
  373 + $this->sendNotification($aDocUsers, $moveOrCopy.'2', $oMovedDocument->getName(), $oMovedDocument->getId(), $parentId);
  374 +
  375 + // Folder registrants
370 $aFromUsers = $this->_getSubscribers($oFromFolder->getId(), $this->subscriptionTypes["Folder"]); 376 $aFromUsers = $this->_getSubscribers($oFromFolder->getId(), $this->subscriptionTypes["Folder"]);
371 $aFolderUsers = $this->_getSubscribers($oToFolder->getId(), $this->subscriptionTypes["Folder"]); 377 $aFolderUsers = $this->_getSubscribers($oToFolder->getId(), $this->subscriptionTypes["Folder"]);
372 - $aUsers = array_merge($aDocUsers, $aFromUsers);  
373 - $aUsers = array_merge($aUsers, $aFolderUsers);  
374 -  
375 - $parentId = $oToFolder->getId(); 378 + $aUsers = array_merge($aFromUsers, $aFolderUsers);
376 $this->sendNotification($aUsers, $moveOrCopy, $oMovedDocument->getName(), $oToFolder->getId(), $parentId); 379 $this->sendNotification($aUsers, $moveOrCopy, $oMovedDocument->getName(), $oToFolder->getId(), $parentId);
377 } 380 }
378 381
@@ -542,7 +545,9 @@ class SubscriptionContent { @@ -542,7 +545,9 @@ class SubscriptionContent {
542 "CheckInDocument" => _kt('Document checked in'), 545 "CheckInDocument" => _kt('Document checked in'),
543 "CheckOutDocument" => _kt('Document checked out'), 546 "CheckOutDocument" => _kt('Document checked out'),
544 "MovedDocument" => _kt('Document moved'), 547 "MovedDocument" => _kt('Document moved'),
  548 + "MovedDocument2" => _kt('Document moved'),
545 "CopiedDocument" => _kt('Document copied'), 549 "CopiedDocument" => _kt('Document copied'),
  550 + "CopiedDocument2" => _kt('Document copied'),
546 "ArchivedDocument" => _kt('Document archived'), // can go through and request un-archival (?) 551 "ArchivedDocument" => _kt('Document archived'), // can go through and request un-archival (?)
547 "DownloadDocument" => _kt('Document downloaded'), 552 "DownloadDocument" => _kt('Document downloaded'),
548 "RestoredArchivedDocument" => _kt('Document restored'), 553 "RestoredArchivedDocument" => _kt('Document restored'),
@@ -660,6 +665,7 @@ class SubscriptionContent { @@ -660,6 +665,7 @@ class SubscriptionContent {
660 $links .= '&#160;|&#160;<a href="'.$url.'">'._kt('Clear Alert').'</a>'; 665 $links .= '&#160;|&#160;<a href="'.$url.'">'._kt('Clear Alert').'</a>';
661 break; 666 break;
662 case 'MovedDocument': 667 case 'MovedDocument':
  668 + case 'MovedDocument2':
663 $text = $modifyDocumentText; 669 $text = $modifyDocumentText;
664 $url = $rootUrl.'/notify.php?id='.$info['notify_id']; 670 $url = $rootUrl.'/notify.php?id='.$info['notify_id'];
665 if(!$bulk_action) $links = '<a href="'.$url.'">'._kt('View New Location').'</a>'; 671 if(!$bulk_action) $links = '<a href="'.$url.'">'._kt('View New Location').'</a>';
@@ -667,6 +673,7 @@ class SubscriptionContent { @@ -667,6 +673,7 @@ class SubscriptionContent {
667 $links .= '&#160;|&#160;<a href="'.$url.'">'._kt('Clear Alert').'</a>'; 673 $links .= '&#160;|&#160;<a href="'.$url.'">'._kt('Clear Alert').'</a>';
668 break; 674 break;
669 case 'CopiedDocument': 675 case 'CopiedDocument':
  676 + case 'CopiedDocument2':
670 $text = $copiedDocumentText; 677 $text = $copiedDocumentText;
671 $url = $rootUrl.'/notify.php?id='.$info['notify_id']; 678 $url = $rootUrl.'/notify.php?id='.$info['notify_id'];
672 if(!$bulk_action) $links = '<a href="'.$url.'">'._kt('View Document').'</a>'; 679 if(!$bulk_action) $links = '<a href="'.$url.'">'._kt('View Document').'</a>';
@@ -770,8 +777,10 @@ class SubscriptionContent { @@ -770,8 +777,10 @@ class SubscriptionContent {
770 "ModifyDocument" => 'document', 777 "ModifyDocument" => 'document',
771 "CheckInDocument" => 'document', 778 "CheckInDocument" => 'document',
772 "CheckOutDocument" => 'document', 779 "CheckOutDocument" => 'document',
773 - "MovedDocument" => 'document',  
774 - "CopiedDocument" => 'document', 780 + "MovedDocument" => 'folder',
  781 + "MovedDocument2" => 'document',
  782 + "CopiedDocument" => 'folder',
  783 + "CopiedDocument2" => 'document',
775 "ArchivedDocument" => 'document', // can go through and request un-archival (?) 784 "ArchivedDocument" => 'document', // can go through and request un-archival (?)
776 "DownloadDocument" => 'document', 785 "DownloadDocument" => 'document',
777 "RestoredArchivedDocument" => 'document', 786 "RestoredArchivedDocument" => 'document',