Commit b7761908116999fee1e9db18523dce3a8fec1b41

Authored by Brad Shuttleworth
1 parent 383af810

last.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5024 c91229c3-7414-0410-bfa2-8a42b809f60b
kthelp/ktcore/EN/browse.html
@@ -29,7 +29,7 @@ permissions-based, so the system only returns items that the logged in user is @@ -29,7 +29,7 @@ permissions-based, so the system only returns items that the logged in user is
29 allowed to access. </p> 29 allowed to access. </p>
30 <p> </p> 30 <p> </p>
31 <h5>Simple (quick) search</h5> 31 <h5>Simple (quick) search</h5>
32 -<p>Specify a search term to search all text – including 32 +<p>Specify a search term to search all text - including
33 document metadata and the contents of the following file types (if your 33 document metadata and the contents of the following file types (if your
34 administrator has configured these options): MS Word, MS Excel, MS PowerPoint, 34 administrator has configured these options): MS Word, MS Excel, MS PowerPoint,
35 Adobe PDF, and Plain Text files.</p> 35 Adobe PDF, and Plain Text files.</p>
kthelp/ktcore/EN/search.html 0 → 100644
  1 +<html>
  2 +<head><title>Search</title></head>
  3 +<body>
  4 +<h2>Search</h2>
  5 +<p>KnowledgeTree provides three versatile search options –
  6 +simple (quick) search, advanced search, and saved searches. Search is
  7 +permissions-based, so the system only returns items that the logged in user is
  8 +allowed to access. </p>
  9 +
  10 +<p>Specify a search term to search all text - including
  11 +document metadata and the contents of the following file types (if your
  12 +administrator has configured these options): MS Word, MS Excel, MS PowerPoint,
  13 +Adobe PDF, and Plain Text files.</p>
  14 +
  15 +<p><strong>Please Note:</strong> words shorter than 4 characters long (e.g. "the" or
  16 +"for") are discarded from the search. Search also only ever returns fully matching words
  17 +(e.g. "Know" will <strong>not</strong> match "KnowledgeTree").</p>
  18 +</body>
  19 +</html>
0 \ No newline at end of file 20 \ No newline at end of file
plugins/ktcore/KTDashlets.php
@@ -171,17 +171,11 @@ class KTIndexerStatusDashlet extends KTBaseDashlet { @@ -171,17 +171,11 @@ class KTIndexerStatusDashlet extends KTBaseDashlet {
171 } 171 }
172 $oTrigger = new $sTrigger; 172 $oTrigger = new $sTrigger;
173 173
174 - $sCommand = KTUtil::findCommand($oTrigger->commandconfig, $oTrigger->command);  
175 - $sFriendly = $oTrigger->getFriendlyCommand();  
176 -  
177 - // check that we do not specify inactivity.  
178 - if ($sFriendly === false) { $sCommand = null; }  
179 - // otherwise check for friendly name.  
180 - else if (!is_null($sFriendly)) { $sCommand = $sFriendly; }  
181 - else if ($sCommand) { $sCommand = sprintf(_('<strong>command:</strong> %s'), $sCommand); }  
182 -  
183 - // only worry about _broken_ triggers.  
184 - if (!empty($sCommand)) { continue; } 174 + $sDiagnostic = $oTrigger->getDiagnostic();
  175 + // empty is OK.
  176 + if (is_null($sDiagnostic) || ($sDiagnostic == false)) {
  177 + continue;
  178 + }
185 179
186 $aTypes = (array) $oTrigger->mimetypes; 180 $aTypes = (array) $oTrigger->mimetypes;
187 $aTypesStr = array(); 181 $aTypesStr = array();
@@ -191,7 +185,7 @@ class KTIndexerStatusDashlet extends KTBaseDashlet { @@ -191,7 +185,7 @@ class KTIndexerStatusDashlet extends KTBaseDashlet {
191 //} 185 //}
192 } 186 }
193 187
194 - $aTriggerSet[] = array('types' => $aTypesStr, 'command' => $sCommand); 188 + $aTriggerSet[] = array('types' => $aTypesStr, 'diagnostic' => $sDiagnostic);
195 } 189 }
196 } 190 }
197 191
plugins/ktstandard/contents/BaseIndexer.php
@@ -35,10 +35,11 @@ class KTBaseIndexerTrigger { @@ -35,10 +35,11 @@ class KTBaseIndexerTrigger {
35 * If it is false, the temporary file will be sent as the last 35 * If it is false, the temporary file will be sent as the last
36 * parameter. 36 * parameter.
37 */ 37 */
38 - var $use_pipes = true;  
39 -  
40 - function getFriendlyCommand() {  
41 - return null; // _('Built-in') 38 + var $use_pipes = true;
  39 +
  40 + /* return a diagnostic string _if_ there is something wrong. NULL otherwise. */
  41 + function getDiagnostic() {
  42 + return null;
42 } 43 }
43 44
44 function setDocument($oDocument) { 45 function setDocument($oDocument) {
plugins/ktstandard/contents/OpenDocumentIndexer.php
@@ -40,6 +40,22 @@ class KTOpenDocumentIndexerTrigger extends KTBaseIndexerTrigger { @@ -40,6 +40,22 @@ class KTOpenDocumentIndexerTrigger extends KTBaseIndexerTrigger {
40 } 40 }
41 return _('Built-in'); 41 return _('Built-in');
42 } 42 }
  43 +
  44 + function findLocalCommand() {
  45 + $sCommand = KTUtil::findCommand("import/unzip", "unzip");
  46 + return $sCommand;
  47 + }
  48 +
  49 + function getDiagnostic() {
  50 + $sCommand = $this->findLocalCommand();
  51 +
  52 + // can't find the local command.
  53 + if (empty($sCommand)) {
  54 + return sprintf(_('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url);
  55 + }
  56 +
  57 + return null;
  58 + }
43 59
44 function extract_contents($sFilename, $sTmpFilename) { 60 function extract_contents($sFilename, $sTmpFilename) {
45 $sUnzipCommand = KTUtil::findCommand("import/unzip", "unzip"); 61 $sUnzipCommand = KTUtil::findCommand("import/unzip", "unzip");
plugins/ktstandard/contents/PdfIndexer.php
@@ -12,6 +12,22 @@ class KTPdfIndexerTrigger extends KTBaseIndexerTrigger { @@ -12,6 +12,22 @@ class KTPdfIndexerTrigger extends KTBaseIndexerTrigger {
12 var $use_pipes = false; 12 var $use_pipes = false;
13 13
14 // see BaseIndexer for how the extraction works. 14 // see BaseIndexer for how the extraction works.
  15 + function findLocalCommand() {
  16 + $sCommand = KTUtil::findCommand($this->commandconfig, $this->command);
  17 + return $sCommand;
  18 + }
  19 +
  20 + function getDiagnostic() {
  21 + $sCommand = $this->findLocalCommand();
  22 +
  23 + // can't find the local command.
  24 + if (empty($sCommand)) {
  25 + return sprintf(_('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url);
  26 + }
  27 +
  28 + return null;
  29 + }
  30 +
15 } 31 }
16 32
17 ?> 33 ?>
plugins/ktstandard/contents/PowerpointIndexer.php
@@ -9,7 +9,22 @@ class KTPowerpointIndexerTrigger extends KTBaseIndexerTrigger { @@ -9,7 +9,22 @@ class KTPowerpointIndexerTrigger extends KTBaseIndexerTrigger {
9 var $args = array(); 9 var $args = array();
10 var $use_pipes = true; 10 var $use_pipes = true;
11 11
12 - // see BaseIndexer for how the extraction works. 12 + function findLocalCommand() {
  13 + $sCommand = KTUtil::findCommand($this->commandconfig, $this->command);
  14 + return $sCommand;
  15 + }
  16 +
  17 + function getDiagnostic() {
  18 + $sCommand = $this->findLocalCommand();
  19 +
  20 + // can't find the local command.
  21 + if (empty($sCommand)) {
  22 + return sprintf(_('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url);
  23 + }
  24 +
  25 + return null;
  26 + }
  27 +
13 } 28 }
14 29
15 ?> 30 ?>
plugins/ktstandard/contents/PsIndexer.php
@@ -11,7 +11,21 @@ class KTPostscriptIndexerTrigger extends KTBaseIndexerTrigger { @@ -11,7 +11,21 @@ class KTPostscriptIndexerTrigger extends KTBaseIndexerTrigger {
11 var $args = array(); 11 var $args = array();
12 var $use_pipes = true; 12 var $use_pipes = true;
13 13
14 - // see BaseIndexer for how the extraction works. 14 + function findLocalCommand() {
  15 + $sCommand = KTUtil::findCommand($this->commandconfig, $this->command);
  16 + return $sCommand;
  17 + }
  18 +
  19 + function getDiagnostic() {
  20 + $sCommand = $this->findLocalCommand();
  21 +
  22 + // can't find the local command.
  23 + if (empty($sCommand)) {
  24 + return sprintf(_('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url);
  25 + }
  26 +
  27 + return null;
  28 + }
15 } 29 }
16 30
17 ?> 31 ?>
plugins/ktstandard/contents/TextIndexer.php
@@ -8,9 +8,7 @@ class KTTextIndexerTrigger extends KTBaseIndexerTrigger { @@ -8,9 +8,7 @@ class KTTextIndexerTrigger extends KTBaseIndexerTrigger {
8 'text/csv' => true, 8 'text/csv' => true,
9 ); 9 );
10 10
11 - function getFriendlyCommand() {  
12 - return _('Built-in');  
13 - } 11 + // no need for diagnostic - this is always available.
14 12
15 function extract_contents($sFilename, $sTempFilename) { 13 function extract_contents($sFilename, $sTempFilename) {
16 $contents = file_get_contents($sFilename); 14 $contents = file_get_contents($sFilename);
plugins/ktstandard/contents/WordIndexer.php
@@ -19,6 +19,28 @@ class KTWordIndexerTrigger extends KTBaseIndexerTrigger { @@ -19,6 +19,28 @@ class KTWordIndexerTrigger extends KTBaseIndexerTrigger {
19 } 19 }
20 return parent::extract_contents($sFilename, $sTempFilename); 20 return parent::extract_contents($sFilename, $sTempFilename);
21 } 21 }
  22 +
  23 + function findLocalCommand() {
  24 + if (OS_WINDOWS) {
  25 + $this->command = 'c:\antiword\antiword.exe';
  26 + $this->commandconfig = 'indexer/antiword';
  27 + $this->args = array();
  28 + }
  29 +
  30 + $sCommand = KTUtil::findCommand($this->commandconfig, $this->command);
  31 + return $sCommand;
  32 + }
  33 +
  34 + function getDiagnostic() {
  35 + $sCommand = $this->findLocalCommand();
  36 +
  37 + // can't find the local command.
  38 + if (empty($sCommand)) {
  39 + return sprintf(_('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url);
  40 + }
  41 +
  42 + return null;
  43 + }
22 } 44 }
23 45
24 ?> 46 ?>
templates/kt3/portlets/search_portlet.smarty
1 <form action="{$rootUrl}/search/simpleSearch.php" method="GET"> 1 <form action="{$rootUrl}/search/simpleSearch.php" method="GET">
2 <input type="text" name="fSearchableText" id="portlet-search-text" size="15" /><input type="submit" value="{i18n}search{/i18n}" class="searchbutton" /> 2 <input type="text" name="fSearchableText" id="portlet-search-text" size="15" /><input type="submit" value="{i18n}search{/i18n}" class="searchbutton" />
3 </form> 3 </form>
  4 +<p><a href="{ktLink base="help.php" subpath="ktcore/search.html"}" class="ktInline ktHelp" style="float: left; margin: 0 0.5em 0.5em 5px;" >{i18n}How do I search?{/i18n}</a>
  5 +{i18n}How do I search?{/i18n}</p>
4 6
5 {if (!empty($saved_searches))} 7 {if (!empty($saved_searches))}
6 <h4>Saved Searches</h4> 8 <h4>Saved Searches</h4>
templates/ktcore/dashlets/indexer_status.smarty
@@ -5,26 +5,27 @@ @@ -5,26 +5,27 @@
5 no active indexers registered. No content indexing will occur.{/i18n}</p></div> 5 no active indexers registered. No content indexing will occur.{/i18n}</p></div>
6 {else} 6 {else}
7 {if empty($transforms)} 7 {if empty($transforms)}
8 -<div class="ktInfo"><p>All indexers should be working correctly.</p></div> 8 +<div class="ktInfo"><p>{i18n}All indexers claim to be working correctly.{/i18n}</p></div>
9 {else} 9 {else}
10 <table class="kt_collection"> 10 <table class="kt_collection">
11 <thead> 11 <thead>
12 <tr> 12 <tr>
13 <th>Mime Types</th> 13 <th>Mime Types</th>
14 - <th>Command</th> 14 + <th>Diagnostic</th>
15 </tr> 15 </tr>
16 </thead> 16 </thead>
17 <tbody> 17 <tbody>
18 {foreach item=aRow from=$transforms} 18 {foreach item=aRow from=$transforms}
19 <tr class="browse_column {cycle values=odd,even}"> 19 <tr class="browse_column {cycle values=odd,even}">
20 - <td> 20 + <td><p>
21 {foreach key=mimetype item=v from=$aRow.types name=mimetype} 21 {foreach key=mimetype item=v from=$aRow.types name=mimetype}
22 {$mimetype} {if (!$smarty.foreach.mimetype.last)}<br />{/if} 22 {$mimetype} {if (!$smarty.foreach.mimetype.last)}<br />{/if}
23 {/foreach} 23 {/foreach}
  24 + </p>
24 </td> 25 </td>
25 - <td>{if empty($aRow.command)}  
26 - <p class="important descriptiveText">{i18n}No indexer.{/i18n}</p>  
27 - {else}{$aRow.command}{/if}</td> 26 + <td class="title">
  27 + <p class="descriptiveText">{if empty($aRow.diagnostic)}{i18n}No indicated problem.{/i18n} {else}{$aRow.diagnostic}{/if}</p>
  28 + </td>
28 </tr> 29 </tr>
29 {/foreach} 30 {/foreach}
30 </tbody> 31 </tbody>
templates/ktstandard/action/discussion_thread_list_item.smarty
@@ -4,5 +4,5 @@ @@ -4,5 +4,5 @@
4 <td>{$thread->getNumberOfViews()}</td> 4 <td>{$thread->getNumberOfViews()}</td>
5 <td>{$thread->getNumberOfReplies()}</td> 5 <td>{$thread->getNumberOfReplies()}</td>
6 <td>{$last_comment->getDate()}</td> 6 <td>{$last_comment->getDate()}</td>
7 - <td>{if $thread->getState()}Closed at metadata version {$thread->getCloseMetadataVersion()}{else}Open{/if}</td> 7 + <td>{if $thread->getState()}Closed at metadata version {$thread->getCloseMetadataVersion()}. <br /><strong>Reason:</strong> {$thread->getCloseReason()}{else}Open{/if}</td>
8 </tr> 8 </tr>