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