Commit 638e7b4b9cab0c5e330e12053108ecf5517403ad

Authored by kevin_fourie
1 parent b7d05020

Merged in from DEV trunk...

KTS-2591
"When updating folder permissions for a folder with an & in its name the progresstext appears as '&amp'"
Fixed. The message is being htmlentitied for cross-scripting, added a str_replace for the &.

Reviewed by: Conrad Vermeulen
Committed by: Megan Watson

KTS-2599
"Indexing files with no extractors associated results in the index queue filling up"
Fixed. 

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

KTS-2584
"Postscrip extractor is disabled on linux"
Fixed. The issue was that the full path to the application was not used and that the parameters were incorrect.

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson

BBS-1059 / SUP-411
"On the 3.4.2 Version of KTTools, reason is mandatory field for each action, i would like to desactivate this."
Added new client policies for reasons.

Committed By: Isaac Lundall
Reviewed By: Conrad Vermeulen

KTS-2618
"#jsonlookup.js# is blocking migration to launchpad and is a temporary file that is not required"
Deleted.

Committed By: Conrad Vermeulen
Reviewed By: Daniel Chalef


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@7592 c91229c3-7414-0410-bfa2-8a42b809f60b
config/config.ini
... ... @@ -340,6 +340,13 @@ safemode = on
340 340 ;document is added to knowledgetree via KTtools. They default to true.
341 341 explorerMetadataCapture = true
342 342 officeMetadataCapture = true
  343 +;These settings govern whether reasons are asked for in KTtools
  344 +captureReasonsDelete = true
  345 +captureReasonsCheckin = true
  346 +captureReasonsCheckout = true
  347 +captureReasonsCancelCheckout = true
  348 +captureReasonsCopyInKT = true
  349 +captureReasonsMoveInKT = true
343 350  
344 351 ; settings for the Disk Usage dashlet
345 352 [DiskUsage]
... ...
config/dmsDefaults.php
... ... @@ -496,7 +496,12 @@ class KTInit {
496 496  
497 497 $oKTConfig->setdefaultns('clientToolPolicies', 'explorerMetadataCapture', true);
498 498 $oKTConfig->setdefaultns('clientToolPolicies', 'officeMetadataCapture', true);
499   -
  499 + $oKTConfig->setdefaultns('clientToolPolicies', 'captureReasonsDelete', true);
  500 + $oKTConfig->setdefaultns('clientToolPolicies', 'captureReasonsCheckin', true);
  501 + $oKTConfig->setdefaultns('clientToolPolicies', 'captureReasonsCheckout', true);
  502 + $oKTConfig->setdefaultns('clientToolPolicies', 'captureReasonsCancelCheckout', true);
  503 + $oKTConfig->setdefaultns('clientToolPolicies', 'captureReasonsCopyInKT', true);
  504 + $oKTConfig->setdefaultns('clientToolPolicies', 'captureReasonsMoveInKT', true);
500 505  
501 506 $res = $this->readConfig();
502 507 if (PEAR::isError($res)) { return $res; }
... ...
ktwebservice/webservice.php
... ... @@ -2,7 +2,7 @@
2 2  
3 3 /**
4 4 *
5   - * $Id:$
  5 + * $Id$
6 6 *
7 7 * This implements the KnowledgeTree Web Service in SOAP.
8 8 *
... ... @@ -3306,6 +3306,36 @@ class KTWebService
3306 3306 'value' => bool2str($config->get('clientToolPolicies/officeMetadataCapture')),
3307 3307 'type' => 'boolean'
3308 3308 ),
  3309 + array(
  3310 + 'name' => 'capture_reasons_delete',
  3311 + 'value' => bool2str($config->get('clientToolPolicies/captureReasonsDelete')),
  3312 + 'type' => 'boolean'
  3313 + ),
  3314 + array(
  3315 + 'name' => 'capture_reasons_checkin',
  3316 + 'value' => bool2str($config->get('clientToolPolicies/captureReasonsCheckin')),
  3317 + 'type' => 'boolean'
  3318 + ),
  3319 + array(
  3320 + 'name' => 'capture_reasons_checkout',
  3321 + 'value' => bool2str($config->get('clientToolPolicies/captureReasonsCheckout')),
  3322 + 'type' => 'boolean'
  3323 + ),
  3324 + array(
  3325 + 'name' => 'capture_reasons_cancelcheckout',
  3326 + 'value' => bool2str($config->get('clientToolPolicies/captureReasonsCancelCheckout')),
  3327 + 'type' => 'boolean'
  3328 + ),
  3329 + array(
  3330 + 'name' => 'capture_reasons_copyinkt',
  3331 + 'value' => bool2str($config->get('clientToolPolicies/captureReasonsCopyInKT')),
  3332 + 'type' => 'boolean'
  3333 + ),
  3334 + array(
  3335 + 'name' => 'capture_reasons_moveinkt',
  3336 + 'value' => bool2str($config->get('clientToolPolicies/captureReasonsMoveInKT')),
  3337 + 'type' => 'boolean'
  3338 + ),
3309 3339 );
3310 3340  
3311 3341  
... ...
lib/documentmanagement/observers.inc.php
... ... @@ -5,32 +5,32 @@
5 5 * KnowledgeTree Open Source Edition
6 6 * Document Management Made Simple
7 7 * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited
8   - *
  8 + *
9 9 * This program is free software; you can redistribute it and/or modify it under
10 10 * the terms of the GNU General Public License version 3 as published by the
11 11 * Free Software Foundation.
12   - *
  12 + *
13 13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 16 * details.
17   - *
  17 + *
18 18 * You should have received a copy of the GNU General Public License
19 19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20   - *
  20 + *
21 21 * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place,
22 22 * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com.
23   - *
  23 + *
24 24 * The interactive user interfaces in modified source and object code versions
25 25 * of this program must display Appropriate Legal Notices, as required under
26 26 * Section 5 of the GNU General Public License version 3.
27   - *
  27 + *
28 28 * In accordance with Section 7(b) of the GNU General Public License version 3,
29 29 * these Appropriate Legal Notices must retain the display of the "Powered by
30   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  30 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
31 31 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
32   - * must display the words "Powered by KnowledgeTree" and retain the original
33   - * copyright notice.
  32 + * must display the words "Powered by KnowledgeTree" and retain the original
  33 + * copyright notice.
34 34 * Contributor( s): ______________________________________
35 35 *
36 36 */
... ... @@ -83,7 +83,9 @@ class JavascriptObserver {
83 83 printf('<script language="javascript">kt_add_document_newFile("%s")</script>', $msg->getString());
84 84 return;
85 85 }
86   - printf('<script language="javascript">kt_add_document_addMessage("%s")</script>', htmlentities($msg->getString(),ENT_QUOTES,'UTF-8'));
  86 + $message = htmlentities($msg->getString(),ENT_QUOTES,'UTF-8');
  87 + $message = str_replace('&amp;', '&', $message);
  88 + printf('<script language="javascript">kt_add_document_addMessage("%s")</script>', $message);
87 89 }
88 90  
89 91 function redirectToDocument($id) {
... ...
lib/upgrades/UpgradeFunctions.inc.php
... ... @@ -1005,6 +1005,12 @@ class UpgradeFunctions {
1005 1005 // clientToolPolicies Section
1006 1006 $ini->addItem('clientToolPolicies', 'explorerMetadataCapture', 'true', "These two settings control whether or not the client is prompted for metadata when a\r\n;document is added to knowledgetree via KTtools. They default to true.");
1007 1007 $ini->addItem('clientToolPolicies', 'officeMetadataCapture', 'true');
  1008 + $ini->addItem('clientToolPolicies', 'captureReasonsDelete', 'true', "These settings govern whether reasons are asked for in KTtools.");
  1009 + $ini->addItem('clientToolPolicies', 'captureReasonsCheckin', 'true');
  1010 + $ini->addItem('clientToolPolicies', 'captureReasonsCheckout', 'true');
  1011 + $ini->addItem('clientToolPolicies', 'captureReasonsCancelCheckout', 'true');
  1012 + $ini->addItem('clientToolPolicies', 'captureReasonsCopyInKT', 'true');
  1013 + $ini->addItem('clientToolPolicies', 'captureReasonsMoveInKT', 'true');
1008 1014  
1009 1015 // DiskUsage Section
1010 1016 $ini->addItem('DiskUsage', 'warningThreshold', '10', "When free space in a mount point is less than this percentage,\r\n; the disk usage dashlet will highlight the mount in ORANGE", "settings for the Disk Usage dashlet");
... ...
resources/js/#jsonlookup.js# deleted
1   -var _aLookupWidgets = {};
2   -
3   -function getJSONLookupWidget(name) {
4   - if(!isUndefinedOrNull(_aLookupWidgets[name])) {
5   - return _aLookupWidgets[name];
6   - } else {
7   - return false;
8   - }
9   -}
10   -
11   -function JSONLookupWidget() {
12   -}
13   -
14   -JSONLookupWidget.prototype = {
15   -
16   - /* bind_add and bind_remove are functions to be called with the key:value's of selected items */
17   -
18   - 'initialize' : function(name, action) {
19   - bindMethods(this);
20   -
21   - this.sName = name;
22   - this.sAction = action;
23   -
24   -
25   - this.oSelectAvail = $('select_' + name + '_avail');
26   - this.oSelectAssigned = $('select_' + name + '_assigned');
27   - this.oFilterAvail = $('filter_' + name + '_avail');
28   - this.oFilterAssigned = $('filter_' + name + '_assigned');
29   -
30   - this.savedFilter = this.oFilterAvail.value;
31   - this.savedSelector = this.oFilterAssigned.value;
32   - this.filterTimer = null;
33   -
34   - this.aItemsAdded = [];
35   - this.aItemsRemoved = [];
36   -
37   - connect(this.oFilterAvail, 'onkeyup', this, 'onchangeFilter');
38   - connect(this.oFilterAssigned, 'onkeyup', this, 'onchangeSelector');
39   - connect(name + '_add', 'onclick', this, 'onclickAdd');
40   - connect(name + '_remove', 'onclick', this, 'onclickRemove');
41   - connect(name + '_show_all', 'onclick', this, 'onclickShowAll');
42   -
43   - this.triggers = {};
44   - this.triggers['add'] = null;
45   - this.triggers['remove'] = null;
46   -
47   - this.initialValuesLoaded = false;
48   - var d = this.getValues();
49   - d.addCallback(this.postInitialize);
50   - },
51   -
52   - 'addTrigger' : function(event, func) {
53   - this.triggers[event] = func;
54   - },
55   -
56   -
57   - // values handling
58   -
59   - 'getValues' : function(all) {
60   - var act = this.sAction;
61   - if(!isUndefinedOrNull(all)) {
62   - act += '&' + queryString({'filter' : '%'});
63   - } else if(this.savedFilter) {
64   - act += '&' + queryString({'filter' : this.savedFilter});
65   - } else if(!this.initialValuesLoaded) {
66   - act += '&' + queryString({'selected' : '1'});
67   - }
68   -
69   - var d = loadJSONDoc(act);
70   - d.addErrback(this.errGetValues);
71   - d.addCallback(checkKTError);
72   - d.addCallback(this.saveValues);
73   - d.addCallback(this.renderValues);
74   - return d;
75   - },
76   -
77   - 'errGetValues' : function(res) {
78   - alert('There was an error retrieving data. Please check connectivity and try again.');
79   - this.oValues = {'off':'-- Error fetching values --'};
80   - this.renderValues();
81   - },
82   -
83   - 'saveValues' : function(res) {
84   - this.oValues = res;
85   - return res;
86   - },
87   -
88   - 'renderValues' : function() {
89   - var aOptions = [];
90   - var bSelFound = false;
91   - for(var k in this.oValues) {
92   - var found = false;
93   - for(var i=0; i<this.oSelectAssigned.options.length; i++) {
94   - if(this.oSelectAssigned.options[i].value == k) {
95   - found = true; break;
96   - }
97   - }
98   -
99   - if(found) {
100   - continue;
101   - }
102   -
103   -
104   - var aParam = {'value':k};
105   - if(k == 'off') {
106   - aParam['disabled'] = 'disabled';
107   - }
108   -
109   - var val = this.oValues[k];
110   - var sDisp = val;
111   -
112   - if(!isUndefinedOrNull(val['display'])) {
113   - var sDisp = val['display'];
114   - if(!isUndefinedOrNull(val['selected']) && val['selected'] === true) {
115   - val['selected'] = undefined;
116   - aParam['selected'] = true;
117   - bSelFound = true;
118   - aParam['value'] = k;
119   - }
120   - }
121   - var oO = OPTION(aParam, sDisp);
122   - aOptions.push(oO);
123   - }
124   -
125   - replaceChildNodes(this.oSelectAvail, aOptions);
126   - if(bSelFound) {
127   - this.onclickAdd();
128   - }
129   - },
130   -
131   - 'postInitialize' : function(res) {
132   - if(!isUndefinedOrNull(this.triggers['postInitialize'])) {
133   - this.triggers['postInitialize']();
134   - }
135   - },
136   -
137   -
138   - 'modItems' : function(type, value) {
139   - var aTarget = (type == 'add') ? 'aItemsAdded' : 'aItemsRemoved';
140   - var aOtherTarget = (type == 'remove') ? 'aItemsAdded' : 'aItemsRemoved';
141   -
142   - // check against other - if other has value, remove it from other, skip next bit
143   - var aNewOther = [];
144   - var exists = false;
145   - var i = 0;
146   - for(i=0; i<this[aOtherTarget].length; i++) {
147   - if(this[aOtherTarget][i]!=value) {
148   - aNewOther.push(this[aOtherTarget][i]);
149   - } else {
150   - exists = true;
151   - }
152   - }
153   - if(exists) {
154   - this[aOtherTarget] = aNewOther;
155   - var sHidden = this.sName + '_items_' + ((type == 'remove') ? 'added' : 'removed');
156   - $(sHidden).value = this[aOtherTarget].join(",");
157   - return;
158   - }
159   -
160   - exists = false;
161   - for(i=0; i<this[aTarget].length; i++) {
162   - if(this[aTarget][i] == value) {
163   - exists = true;
164   - break;
165   - }
166   - }
167   -
168   - if(!exists) {
169   - this[aTarget].push(value);
170   - var sHidden = this.sName + '_items_' + ((type == 'add') ? 'added' : 'removed');
171   - $(sHidden).value = this[aTarget].join(",");
172   - }
173   -
174   - },
175   -
176   -
177   - // signals handling
178   -
179   - 'onchangeFilter' : function(e) {
180   - if(this.savedFilter != this.oFilterAvail.value) {
181   - this.savedFilter = this.oFilterAvail.value;
182   - if(!isUndefinedOrNull(this.filterTimer)) {
183   - this.filterTimer.canceller();
184   - }
185   - this.filterTimer = callLater(0.2, this.getValues);
186   - }
187   - return true;
188   - },
189   -
190   - 'onchangeSelector' : function(e) {
191   - if(this.savedSelector != this.oFilterAssigned.value) {
192   - this.savedSelector = this.oFilterAssigned.value;
193   - forEach(this.oSelectAssigned.options, bind(function(o) {
194   - if(!this.savedSelector.length) {
195   - o.selected = false;
196   - } else {
197   - if(o.innerHTML.toLowerCase().search(this.savedSelector) != -1) {
198   - o.selected = true;
199   - } else {
200   - o.selected = false;
201   - }
202   - }
203   - }, this));
204   - }
205   - },
206   -
207   - '_moveOptions' : function(dir) {
208   - },
209   -
210   - 'onclickAdd' : function(e) {
211   - var aCurOptions = extend([], this.oSelectAssigned.options);
212   - forEach(this.oSelectAvail.options, bind(
213   - function(o) {
214   - try {
215   - if(o.value == 'off') return;
216   - var a = o.selected;
217   - if(a == 'selected' || a === true) {
218   - this.modItems('add', o.value);
219   - try {
220   - o.selected = false;
221   - } catch(e) {
222   - o.setAttribute('selected', false);
223   - }
224   - aCurOptions.push(o);
225   -
226   - if(!isUndefinedOrNull(this.triggers['add'])) {
227   - this.triggers['add'](this.oValues[o.value]);
228   - }
229   - }
230   - } catch(e) {
231   - log('exception');
232   - // forEach(keys(e), function(k) { log(k,':', e[k]); });
233   - }
234   - }, this));
235   -
236   - aCurOptions.sort(keyComparator('innerHTML'));
237   - replaceChildNodes(this.oSelectAssigned, aCurOptions);
238   -
239   - },
240   -
241   - 'onclickRemove' : function(e) {
242   - var aOptions = [];
243   - forEach(this.oSelectAssigned.options, bind(function(o) {
244   - if(o.selected == 'selected' || o.selected === true) {
245   - this.modItems('remove', o.value);
246   - if(!isUndefinedOrNull(this.triggers['remove'])) {
247   - var obj = { 'type' : (o.value.substring(0,1) == 'g') ? 'group' : 'role',
248   - 'id' : o.value.substring(1) };
249   - this.triggers['remove'](obj);
250   - }
251   - } else {
252   - aOptions.push(o);
253   - }
254   - }, this));
255   - replaceChildNodes(this.oSelectAssigned, aOptions);
256   - this.renderValues();
257   - },
258   -
259   - 'onclickShowAll' : function(e) {
260   - this.oFilterAvail.value = '';
261   - this.savedFilter = '';
262   - this.getValues(true);
263   - e.stop();
264   - }
265   -}
266   -
267   -function initJSONLookup(name, action) {
268   - return function() {
269   - _aLookupWidgets[name] = new JSONLookupWidget();
270   - _aLookupWidgets[name].initialize(name, action);
271   - }
272   -}
273   -
274   -
275   -
276 0 \ No newline at end of file
search2/indexing/extractorCore.inc.php
... ... @@ -456,7 +456,7 @@ abstract class ApplicationExtractor extends ExternalDocumentExtractor
456 456 {
457 457 $sources = array('{source}','{target}');
458 458 $target = array($this->sourcefile, $this->targetfile);
459   - $cmdline = $this->command . ' ' . str_replace($sources,$target, $this->params);
  459 + $cmdline = $this->application . ' ' . str_replace($sources,$target, $this->params);
460 460  
461 461 return $cmdline;
462 462 }
... ...
search2/indexing/extractors/PDFExtractor.inc.php
... ... @@ -40,7 +40,10 @@ class PDFExtractor extends ApplicationExtractor
40 40 {
41 41 public function __construct()
42 42 {
43   - parent::__construct('externalBinary','pdftotext','pdftotext',_kt('PDF Text Extractor'),'-nopgbrk -enc UTF-8 \'{source}\' \'{target}\'');
  43 + $config = KTConfig::getSingleton();
  44 + $params = $config->get('extractorParameters/pdftotext', '-nopgbrk -enc UTF-8 \'{source}\' \'{target}\'');
  45 +
  46 + parent::__construct('externalBinary','pdftotext','pdftotext',_kt('PDF Text Extractor'),$params);
44 47 }
45 48  
46 49 public function getSupportedMimeTypes()
... ...
search2/indexing/extractors/PSExtractor.inc.php
... ... @@ -40,7 +40,10 @@ class PSExtractor extends ApplicationExtractor
40 40 {
41 41 public function __construct()
42 42 {
43   - parent::__construct('externalBinary','pstotext','pstotext',_kt('PostScript Text Extractor'),'-nopgbrk -enc UTF-8 {source} {target}');
  43 + $config = KTConfig::getSingleton();
  44 + $params = $config->get('extractorParameters/pstotext', '\'{source}\' > \'{target}\'');
  45 +
  46 + parent::__construct('externalBinary','pstotext','pstotext',_kt('PostScript Text Extractor'), $params);
44 47 }
45 48  
46 49 public function getSupportedMimeTypes()
... ... @@ -56,6 +59,7 @@ class PSExtractor extends ApplicationExtractor
56 59 {
57 60 if (OS_WINDOWS)
58 61 {
  62 + // pstotext is not available under windows, so no need to diagnose it
59 63 return null;
60 64 }
61 65 return parent::diagnose();
... ...
search2/indexing/indexerCore.inc.php
... ... @@ -755,7 +755,7 @@ abstract class Indexer
755 755 INNER JOIN document_metadata_version dmv ON d.metadata_version_id=dmv.id
756 756 INNER JOIN document_content_version dcv ON dmv.content_version_id=dcv.id
757 757 INNER JOIN mime_types mt ON dcv.mime_id=mt.id
758   - INNER JOIN mime_extractors me ON mt.extractor_id=me.id
  758 + LEFT JOIN mime_extractors me ON mt.extractor_id=me.id
759 759 WHERE
760 760 (iff.processdate IS NULL or iff.processdate < cast(cast('$date' as date) -1 as date)) AND dmv.status_id=1
761 761 ORDER BY indexdate
... ... @@ -807,12 +807,6 @@ abstract class Indexer
807 807 $default->log->debug(sprintf(_kt("Indexing docid: %d extension: '%s' mimetype: '%s' extractor: '%s'"), $docId, $extension,$mimeType,$extractorClass));
808 808 }
809 809  
810   - if (!$this->isExtractorEnabled($extractorClass))
811   - {
812   - $default->log->info(sprintf(_kt("diagnose: Not indexing docid: %d because extractor '%s' is disabled."), $docId, $extractorClass));
813   - continue;
814   - }
815   -
816 810 if (empty($extractorClass))
817 811 {
818 812 if ($this->debug)
... ... @@ -824,9 +818,15 @@ abstract class Indexer
824 818 continue;
825 819 }
826 820  
  821 + if (!$this->isExtractorEnabled($extractorClass))
  822 + {
  823 + $default->log->info(sprintf(_kt("diagnose: Not indexing docid: %d because extractor '%s' is disabled."), $docId, $extractorClass));
  824 + continue;
  825 + }
  826 +
827 827 if ($this->debug)
828 828 {
829   - $default->log->info(sprintf(_kt("Processing document %d.\n"),$docId));
  829 + $default->log->info(sprintf(_kt("Processing docid: %d.\n"),$docId));
830 830 }
831 831  
832 832 $removeFromQueue = true;
... ...