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 5 * KnowledgeTree Community Edition
6 6 * Document Management Made Simple
7 7 * Copyright (C) 2008, 2009, 2010 KnowledgeTree Inc.
8   - *
  8 + *
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
... ... @@ -580,6 +580,7 @@ class SubscriptionContent {
580 580 $restoreArchivedDocumentText = _kt('The document "').$info['object_name']._kt('" has been restored by an administrator');
581 581 $downloadDocumentText = _kt('The document "').$info['object_name']._kt('"');
582 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 585 if($info['location_name'] !== NULL && !$bulk_action){
585 586 $addFolderText .= _kt(' to "').$info['location_name']._kt('"');
... ... @@ -701,6 +702,14 @@ class SubscriptionContent {
701 702 $links .= '&#160;|&#160;<a href="'.$url.'">'._kt('Clear Alert').'</a>';
702 703 $url = $rootUrl.'/notify.php?id='.$info['notify_id'].'&notify_action=viewall';
703 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 715 if($info['actor_name'] !== NULL && $info['event_type'] != 'RestoredArchivedDocument'){
... ...
plugins/ktstandard/KTSubscriptions.php
... ... @@ -5,7 +5,7 @@
5 5 * KnowledgeTree Community Edition
6 6 * Document Management Made Simple
7 7 * Copyright (C) 2008, 2009, 2010 KnowledgeTree Inc.
8   - *
  8 + *
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
... ... @@ -65,6 +65,7 @@ class KTSubscriptionPlugin extends KTPlugin {
65 65 'ktstandard.subscription.documentsubscription');
66 66 $this->registerAction('documentsubscriptionaction', 'KTDocumentUnsubscriptionAction',
67 67 'ktstandard.subscription.documentunsubscription');
  68 +
68 69 $this->registerTrigger('checkout', 'postValidate', 'KTCheckoutSubscriptionTrigger',
69 70 'ktstandard.triggers.subscription.checkout');
70 71 $this->registerTrigger('edit', 'postValidate', 'KTEditSubscriptionTrigger',
... ... @@ -76,7 +77,8 @@ class KTSubscriptionPlugin extends KTPlugin {
76 77 $this->registerTrigger('archive', 'postValidate', 'KTArchiveSubscriptionTrigger',
77 78 'ktstandard.triggers.subscription.archive');
78 79 $this->registerTrigger('discussion', 'postValidate', 'KTDiscussionSubscriptionTrigger',
79   - 'ktstandard.triggers.subscription.archive');
  80 + 'ktstandard.triggers.subscription.discussion');
  81 +
80 82 $this->registerAction('foldersubscriptionaction', 'KTFolderSubscriptionAction',
81 83 'ktstandard.subscription.foldersubscription');
82 84 $this->registerAction('foldersubscriptionaction', 'KTFolderUnsubscriptionAction',
... ...
search2/indexing/indexerCore.inc.php
... ... @@ -643,6 +643,11 @@ abstract class Indexer
643 643  
644 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 651 // Appending the process queue to the index for convenience
647 652 // Don't want to complicate matters by creating too many new classes and files
648 653 Indexer::unqueueDocFromProcessing($document_id);
... ...