Commit 538cf2ce04a7b8ccb88764fc498f79bf737a9a5c

Authored by Megan Watson
1 parent 3faaec34

Changed the namespace on the discussions trigger, added text. Added check to ind…

…exer to only reindex the document and not reprocess after an update.

Committed by: Megan Watson
lib/subscriptions/subscriptions.inc.php
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 * KnowledgeTree Community Edition 5 * KnowledgeTree Community Edition
6 * Document Management Made Simple 6 * Document Management Made Simple
7 * Copyright (C) 2008, 2009, 2010 KnowledgeTree Inc. 7 * Copyright (C) 2008, 2009, 2010 KnowledgeTree Inc.
8 - * 8 + *
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
@@ -580,6 +580,7 @@ class SubscriptionContent { @@ -580,6 +580,7 @@ class SubscriptionContent {
580 $restoreArchivedDocumentText = _kt('The document "').$info['object_name']._kt('" has been restored by an administrator'); 580 $restoreArchivedDocumentText = _kt('The document "').$info['object_name']._kt('" has been restored by an administrator');
581 $downloadDocumentText = _kt('The document "').$info['object_name']._kt('"'); 581 $downloadDocumentText = _kt('The document "').$info['object_name']._kt('"');
582 $documentAlertText = _kt('An alert on the document "').$info['object_name']._kt('" has been added or modified'); 582 $documentAlertText = _kt('An alert on the document "').$info['object_name']._kt('" has been added or modified');
  583 + $discussDocumentText = _kt('A discussion on the document "').$info['object_name']._kt('" has been updated');
583 584
584 if($info['location_name'] !== NULL && !$bulk_action){ 585 if($info['location_name'] !== NULL && !$bulk_action){
585 $addFolderText .= _kt(' to "').$info['location_name']._kt('"'); 586 $addFolderText .= _kt(' to "').$info['location_name']._kt('"');
@@ -701,6 +702,14 @@ class SubscriptionContent { @@ -701,6 +702,14 @@ class SubscriptionContent {
701 $links .= '&#160;|&#160;<a href="'.$url.'">'._kt('Clear Alert').'</a>'; 702 $links .= '&#160;|&#160;<a href="'.$url.'">'._kt('Clear Alert').'</a>';
702 $url = $rootUrl.'/notify.php?id='.$info['notify_id'].'&notify_action=viewall'; 703 $url = $rootUrl.'/notify.php?id='.$info['notify_id'].'&notify_action=viewall';
703 $links .= '&#160;|&#160;<a href="'.$url.'">'._kt('View all alerts on this document').'</a>'; 704 $links .= '&#160;|&#160;<a href="'.$url.'">'._kt('View all alerts on this document').'</a>';
  705 + break;
  706 + case 'DiscussDocument':
  707 + $text = $discussDocumentText;
  708 + $url = $rootUrl.'/notify.php?id='.$info['notify_id'];
  709 + $links = '<a href="'.$url.'">'._kt('View Document').'</a>';
  710 + $url = $rootUrl.'/notify.php?id='.$info['notify_id'].'&notify_action=clear';
  711 + $links .= '&#160;|&#160;<a href="'.$url.'">'._kt('Clear Alert').'</a>';
  712 + break;
704 } 713 }
705 714
706 if($info['actor_name'] !== NULL && $info['event_type'] != 'RestoredArchivedDocument'){ 715 if($info['actor_name'] !== NULL && $info['event_type'] != 'RestoredArchivedDocument'){
plugins/ktstandard/KTSubscriptions.php
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 * KnowledgeTree Community Edition 5 * KnowledgeTree Community Edition
6 * Document Management Made Simple 6 * Document Management Made Simple
7 * Copyright (C) 2008, 2009, 2010 KnowledgeTree Inc. 7 * Copyright (C) 2008, 2009, 2010 KnowledgeTree Inc.
8 - * 8 + *
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
@@ -65,6 +65,7 @@ class KTSubscriptionPlugin extends KTPlugin { @@ -65,6 +65,7 @@ class KTSubscriptionPlugin extends KTPlugin {
65 'ktstandard.subscription.documentsubscription'); 65 'ktstandard.subscription.documentsubscription');
66 $this->registerAction('documentsubscriptionaction', 'KTDocumentUnsubscriptionAction', 66 $this->registerAction('documentsubscriptionaction', 'KTDocumentUnsubscriptionAction',
67 'ktstandard.subscription.documentunsubscription'); 67 'ktstandard.subscription.documentunsubscription');
  68 +
68 $this->registerTrigger('checkout', 'postValidate', 'KTCheckoutSubscriptionTrigger', 69 $this->registerTrigger('checkout', 'postValidate', 'KTCheckoutSubscriptionTrigger',
69 'ktstandard.triggers.subscription.checkout'); 70 'ktstandard.triggers.subscription.checkout');
70 $this->registerTrigger('edit', 'postValidate', 'KTEditSubscriptionTrigger', 71 $this->registerTrigger('edit', 'postValidate', 'KTEditSubscriptionTrigger',
@@ -76,7 +77,8 @@ class KTSubscriptionPlugin extends KTPlugin { @@ -76,7 +77,8 @@ class KTSubscriptionPlugin extends KTPlugin {
76 $this->registerTrigger('archive', 'postValidate', 'KTArchiveSubscriptionTrigger', 77 $this->registerTrigger('archive', 'postValidate', 'KTArchiveSubscriptionTrigger',
77 'ktstandard.triggers.subscription.archive'); 78 'ktstandard.triggers.subscription.archive');
78 $this->registerTrigger('discussion', 'postValidate', 'KTDiscussionSubscriptionTrigger', 79 $this->registerTrigger('discussion', 'postValidate', 'KTDiscussionSubscriptionTrigger',
79 - 'ktstandard.triggers.subscription.archive'); 80 + 'ktstandard.triggers.subscription.discussion');
  81 +
80 $this->registerAction('foldersubscriptionaction', 'KTFolderSubscriptionAction', 82 $this->registerAction('foldersubscriptionaction', 'KTFolderSubscriptionAction',
81 'ktstandard.subscription.foldersubscription'); 83 'ktstandard.subscription.foldersubscription');
82 $this->registerAction('foldersubscriptionaction', 'KTFolderUnsubscriptionAction', 84 $this->registerAction('foldersubscriptionaction', 'KTFolderUnsubscriptionAction',
search2/indexing/indexerCore.inc.php
@@ -643,6 +643,11 @@ abstract class Indexer @@ -643,6 +643,11 @@ abstract class Indexer
643 643
644 $default->log->debug("index: Queuing indexing of $document_id"); 644 $default->log->debug("index: Queuing indexing of $document_id");
645 645
  646 + // If we're indexing a discussion, re-processing is not needed.
  647 + if($what === 'D'){
  648 + return true;
  649 + }
  650 +
646 // Appending the process queue to the index for convenience 651 // Appending the process queue to the index for convenience
647 // Don't want to complicate matters by creating too many new classes and files 652 // Don't want to complicate matters by creating too many new classes and files
648 Indexer::unqueueDocFromProcessing($document_id); 653 Indexer::unqueueDocFromProcessing($document_id);