Commit 76bf57d1617b7da5f8d3fc9ced02e6a8d69a7820

Authored by Paul Barrett
2 parents 686b2b7a a5055f62

Merge branch 'master' of git@github.com:ktgit/knowledgetree

docs/kt-phpdoc.ini
... ... @@ -95,7 +95,9 @@ ignore = thirdparty/
95 95 ;; HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS
96 96 ;; PDF:default:default,CHM:default:default,XML:DocBook/peardoc2:default
97 97 ;output=HTML:frames:earthli,HTML:frames:default,HTML:frames:l0l33t,HTML:frames:phpdoc.de,HTML:frames:phphtmllib,HTML:frames:DOM/default,HTML:frames:DOM/l0l33t,HTML:frames:DOM/phpdoc.de,HTML:frames:DOM/earthli,HTML:frames:DOM/phphtmllib,HTML:frames:phpedit,HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS
98   -output=HTML:frames:DOM/earthli
  98 +;output=HTML:frames:earthli,HTML:frames:default,HTML:frames:l0l33t,HTML:frames:phpdoc.de,HTML:frames:phphtmllib,HTML:frames:DOM/default,HTML:frames:DOM/l0l33t,HTML:frames:DOM/phpdoc.de,HTML:frames:DOM/earthli,HTML:frames:DOM/phphtmllib,HTML:frames:phpedit,HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS
  99 +output=HTML:Smarty:PHP
  100 +;output=HTML:frames:DOM/earthli
99 101  
100 102 ;; turn this option on if you want highlighted source code for every file
101 103 ;; legal values: on/off
... ...
i18n/knowledgeTree.pot
... ... @@ -6669,7 +6669,7 @@ msgid "It is not possible to archive a shortcut. Please archive the target docum
6669 6669 msgstr ""
6670 6670  
6671 6671 #: plugins/ktcore/admin/documentFieldsv2.php:115
6672   -msgid "It is possibler to create different types of fieldsets. The most common kind is a \"normal\" fieldset, which can be configured to have different kinds of fields. The administrator may have installed additional plugins which provide different types of fieldsets."
  6672 +msgid "It is possible to create different types of fieldsets. The most common kind is a \"normal\" fieldset, which can be configured to have different kinds of fields. The administrator may have installed additional plugins which provide different types of fieldsets."
6673 6673 msgstr ""
6674 6674  
6675 6675 #: i18n/templates.c:7529
... ...
ktwebdav/lib/KTWebDAVServer.inc.php
... ... @@ -7,31 +7,31 @@
7 7 * Document Management Made Simple
8 8 * Copyright (C) 2008, 2009 KnowledgeTree Inc.
9 9 * Portions copyright The Jam Warehouse Software (Pty) Limited
10   - *
  10 + *
11 11 * This program is free software; you can redistribute it and/or modify it under
12 12 * the terms of the GNU General Public License version 3 as published by the
13 13 * Free Software Foundation.
14   - *
  14 + *
15 15 * This program is distributed in the hope that it will be useful, but WITHOUT
16 16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 17 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 18 * details.
19   - *
  19 + *
20 20 * You should have received a copy of the GNU General Public License
21 21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22   - *
23   - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  22 + *
  23 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
24 24 * California 94120-7775, or email info@knowledgetree.com.
25   - *
  25 + *
26 26 * The interactive user interfaces in modified source and object code versions
27 27 * of this program must display Appropriate Legal Notices, as required under
28 28 * Section 5 of the GNU General Public License version 3.
29   - *
  29 + *
30 30 * In accordance with Section 7(b) of the GNU General Public License version 3,
31 31 * these Appropriate Legal Notices must retain the display of the "Powered by
32   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  32 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
33 33 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
34   - * must display the words "Powered by KnowledgeTree" and retain the original
  34 + * must display the words "Powered by KnowledgeTree" and retain the original
35 35 * copyright notice.
36 36 * Contributor( s): ______________________________________
37 37 *
... ... @@ -228,7 +228,7 @@ class KTWebDAVServer extends HTTP_WebDAV_Server
228 228  
229 229 $ident = 'KTWEBDAV';
230 230 $conf = array('mode' => 0644, 'timeFormat' => '%X %x');
231   - $logger = &Log::singleton('file', '../var/log/ktwebdav-' . date('Y-m-d') . '.txt', $ident, $conf);
  231 + $logger = &Log::singleton('file', '../../var/log/ktwebdav-' . date('Y-m-d') . '.txt', $ident, $conf);
232 232 if ($type == 'error') $logger->log($entry, PEAR_LOG_ERR);
233 233 else $logger->log($entry, PEAR_LOG_INFO);
234 234 return true;
... ... @@ -272,6 +272,27 @@ class KTWebDAVServer extends HTTP_WebDAV_Server
272 272 $this->ktwebdavLog('_SERVER is ' . print_r($_SERVER, true), 'info', true);
273 273 }
274 274  
  275 + // Check for electronic signatures - if enabled exit
  276 + $oConfig =& KTConfig::getSingleton();
  277 + $enabled = $oConfig->get('e_signatures/enableApiSignatures', false);
  278 + if($enabled){
  279 + $this->ktwebdavLog('Electronic Signatures have been enabled, disabling WebDAV.', 'info');
  280 +
  281 + $data = "<html><head><title>KTWebDAV - The KnowledgeTree WebDAV Server</title></head>";
  282 + $data .= "<body>";
  283 + $data .= "<div align=\"center\"><IMG src=\"../resources/graphics/ktlogo-topbar_base.png\" width=\"308\" height=\"61\" border=\"0\"></div><br>";
  284 + $data .= "<div align=\"center\"><h2><strong>Welcome to KnowledgeTree WebDAV Server</strong></h2></div><br><br>";
  285 + $data .= "<div align=\"center\">The WebDAV Server has been disabled!</div><br><br>";
  286 + $data .= "<div align=\"center\">Electronic Signatures are enabled.</div><br><br>";
  287 + $data .= "</body>";
  288 +
  289 + header('HTTP/1.1 403 Forbidden');
  290 + header('Content-Type: text/html; charset="utf-8"');
  291 + echo $data;
  292 +
  293 + exit(0);
  294 + }
  295 +
275 296 // Get the client info
276 297 $this->checkSafeMode();
277 298  
... ...
ktwebservice/KTUploadManager.inc.php
... ... @@ -147,6 +147,11 @@ class KTUploadManager
147 147 $now=date('Y-m-d H:i:s');
148 148 $now_str=date('YmdHis');
149 149  
  150 + // Ensure the temp directory exists otherwise an error is thrown.
  151 + if (realpath($this->temp_dir) == FALSE) {
  152 + mkdir($this->temp_dir, 0777, true);
  153 + }
  154 +
150 155 $newtempfile = realpath($this->temp_dir) . '/' . $_SESSION['userID'] . '-'. $now_str;
151 156 if (OS_WINDOWS)
152 157 {
... ...
lib/foldermanagement/compressionArchiveUtil.inc.php
... ... @@ -289,7 +289,7 @@ class ZipFolder {
289 289  
290 290 if (!file_exists($sZipFile)) {
291 291 return PEAR::raiseError(_kt('The zip file has not been created, if you are downloading a large number of documents
292   - or a large document then it may take a few seconds to finish. Try refreshing the page.'));
  292 + or a large document then it may take a few minutes to finish.'));
293 293 }
294 294  
295 295 $mimeType = 'application/zip; charset=utf-8;';
... ...
lib/groups/Group.inc
... ... @@ -163,13 +163,16 @@ class Group extends KTEntity {
163 163  
164 164 /**
165 165 * Returns an array of Users in this group.
  166 + *
  167 + * @param Boolean Return Disabled Users or Not (defaults false)
  168 + *
166 169 */
167   - function &getUsers() {
  170 + function &getUsers($disabled = false) {
168 171 // legacy api.
169   - return $this->getMembers();
  172 + return $this->getMembers($disabled);
170 173 }
171 174  
172   - function &getMembers() {
  175 + function &getMembers($disabled = false) {
173 176 global $default;
174 177 require_once(KT_LIB_DIR . '/users/User.inc');
175 178 $sQuery = "SELECT user_id FROM $default->users_groups_table WHERE group_id = ?";
... ... @@ -178,10 +181,12 @@ class Group extends KTEntity {
178 181 $aMembers = array();
179 182 foreach ($aUserIds as $iUserId) {
180 183 $oUser = User::get($iUserId);
181   - if ((!PEAR::isError($oUser)) && ($oUser !== false)) {
  184 + $is_disabled = ($disabled) ? false : $oUser->getDisabled();
  185 + if ((!PEAR::isError($oUser)) && ($oUser !== false) && !$is_disabled) {
182 186 $aMembers[] = $oUser;
183 187 }
184 188 }
  189 +
185 190 return $aMembers;
186 191 }
187 192  
... ...
lib/storage/ondiskhashedstoragemanager.inc.php
... ... @@ -185,7 +185,10 @@ class KTOnDiskHashedStorageManager extends KTStorageManager {
185 185 global $default;
186 186  
187 187 //get the path to the document on the server
188   - $docRoot = $default->documentRoot;
  188 + //$docRoot = $default->documentRoot;
  189 + $oConfig =& KTConfig::getSingleton();
  190 + $docRoot = $oConfig->get('urls/documentRoot');
  191 +
189 192 $path = $docRoot .'/'. $oDocument->getStoragePath();
190 193  
191 194 // Ensure the file exists
... ...
lib/util/ktutil.inc
... ... @@ -171,7 +171,7 @@ class KTUtil {
171 171 $internal_url .= !empty($default->internal_server_port) ? ':' . $default->internal_server_port : '';
172 172 $internal_url .= !empty($default->rootUrl) ? $default->rootUrl : '';
173 173  
174   - $pos = strpos($internal_url, '://');
  174 + $pos = strpos($internal_url, 'http');
175 175 if($pos === false){
176 176 $port = $default->internal_server_port;
177 177 $internal_url = (($port == 443 || $port == 8443) ? 'https://' : 'http://') . $internal_url;
... ... @@ -1184,6 +1184,11 @@ class KTUtil {
1184 1184 }
1185 1185 }
1186 1186  
  1187 + /**
  1188 + * The system identifier is a unique ID defined in every installation of KnowledgeTree
  1189 + *
  1190 + * @return string The system identifier
  1191 + */
1187 1192 function getSystemIdentifier() {
1188 1193 $sIdentifier = KTUtil::getSystemSetting('kt_system_identifier');
1189 1194 if (empty($sIdentifier)) {
... ... @@ -1343,7 +1348,7 @@ class KTUtil {
1343 1348 return false;
1344 1349 }
1345 1350 }
1346   -
  1351 +
1347 1352 static
1348 1353 function camelize($string) {
1349 1354 $result = "";
... ...
plugins/i18n/french/translations/fr_FR/knowledgeTree.po
... ... @@ -6779,7 +6779,7 @@ msgid &quot;It is not possible to archive a shortcut. Please archive the target docum
6779 6779 msgstr "Il est impossible d'archiver un raccourci. Veuillez archiver ร  la place le document ou le dossier ciblรฉ."
6780 6780  
6781 6781 #: plugins/ktcore/admin/documentFieldsv2.php:115
6782   -msgid "It is possibler to create different types of fieldsets. The most common kind is a \"normal\" fieldset, which can be configured to have different kinds of fields. The administrator may have installed additional plugins which provide different types of fieldsets."
  6782 +msgid "It is possible to create different types of fieldsets. The most common kind is a \"normal\" fieldset, which can be configured to have different kinds of fields. The administrator may have installed additional plugins which provide different types of fieldsets."
6783 6783 msgstr "Il est possible de crรฉer diffรฉrents types de formulaires. Le plus commun est un formulaire \"normal\" , qui peut รชtre configurรฉ de facon ร  disposer de diffรฉrents types de champs. L'administrateur peut avoir installรฉ des plugins supplรฉmentaires qui fournissent diffรฉrents types de formulaires."
6784 6784  
6785 6785 #: i18n/templates.c:7160
... ...
plugins/i18n/german/translations/de_DE/knowledgeTree.po
... ... @@ -6785,7 +6785,7 @@ msgid &quot;It is not possible to archive a shortcut. Please archive the target docum
6785 6785 msgstr "Verknรผpfungen kรถnnen nicht archiviert werden. Bitte archivieren Sie das Zieldokument oder den Zielordner."
6786 6786  
6787 6787 #: plugins/ktcore/admin/documentFieldsv2.php:115
6788   -msgid "It is possibler to create different types of fieldsets. The most common kind is a \"normal\" fieldset, which can be configured to have different kinds of fields. The administrator may have installed additional plugins which provide different types of fieldsets."
  6788 +msgid "It is possible to create different types of fieldsets. The most common kind is a \"normal\" fieldset, which can be configured to have different kinds of fields. The administrator may have installed additional plugins which provide different types of fieldsets."
6789 6789 msgstr "Es ist mรถglich verschiedene Typen von Feldgruppen zu erstellen. Die รผbliche Form ist eine \"normale\" Feldgruppe, welche unterschiedliche Felder beinhalten kann. Der Administrator hat eventuell weitere Plugins installiert die verschiedene Typen von Feldgruppen bereitstellen."
6790 6790  
6791 6791 #: i18n/templates.c:7160
... ...
plugins/i18n/italian/translations/it_IT/knowledgeTree.po
... ... @@ -6926,7 +6926,7 @@ msgid &quot;It is not possible to archive a shortcut. Please archive the target docum
6926 6926 msgstr "Non รจ possibile archiviare un collegamento. Si prega di archiviare il documento scelto o la cartella."
6927 6927  
6928 6928 #: plugins/ktcore/admin/documentFieldsv2.php:115
6929   -msgid "It is possibler to create different types of fieldsets. The most common kind is a \"normal\" fieldset, which can be configured to have different kinds of fields. The administrator may have installed additional plugins which provide different types of fieldsets."
  6929 +msgid "It is possible to create different types of fieldsets. The most common kind is a \"normal\" fieldset, which can be configured to have different kinds of fields. The administrator may have installed additional plugins which provide different types of fieldsets."
6930 6930 msgstr "E' possibile crare tipi diversi di gruppi di attributi. Il tipo pi&ugrave; comune &egrave; un gruppo di attributi \"normale\", che pu&ograve; essere configurato in modo da avere vari tipi di campi. L'amministratore potrebbe avere installato dei componenti aggiuntivi addizionali che forniscono tipi diversi di gruppi di attributi."
6931 6931  
6932 6932 #: i18n/templates.c:7175
... ...
plugins/ktcore/KTBulkActions.php
... ... @@ -1081,7 +1081,10 @@ class KTBrowseBulkExportAction extends KTBulkAction {
1081 1081 $this->sExportCode = KTUtil::randomString();
1082 1082 $_SESSION['exportcode'] = $this->sExportCode;
1083 1083  
  1084 + // Save the return url in session so it is not lost when doing the download
1084 1085 $folderurl = $this->getReturnUrl();
  1086 + $_SESSION['export_return_url'] = $folderurl;
  1087 +
1085 1088 $sReturn = sprintf('<p>' . _kt('Return to the original <a href="%s">folder</a>') . "</p>\n", $folderurl);
1086 1089 $download_url = KTUtil::addQueryStringSelf("action=downloadZipFile&fFolderId={$this->oFolder->getId()}&exportcode={$this->sExportCode}");
1087 1090  
... ... @@ -1194,7 +1197,8 @@ class KTBrowseBulkExportAction extends KTBulkAction {
1194 1197  
1195 1198 if(PEAR::isError($res)){
1196 1199 $this->addErrorMessage($res->getMessage());
1197   - $redirectUrl = $this->getReturnUrl();
  1200 + $redirectUrl = $_SESSION['export_return_url'];
  1201 + unset($_SESSION['export_return_url']);
1198 1202 redirect($redirectUrl);
1199 1203 }
1200 1204 exit(0);
... ...
plugins/ktcore/admin/documentFieldsv2.php
... ... @@ -112,7 +112,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
112 112 $widgets[] = array('ktcore.widgets.selection', array(
113 113 'label' => _kt("Fieldset Type"),
114 114 'use_simple' => false,
115   - 'description' => _kt("It is possibler to create different types of fieldsets. The most common kind is a \"normal\" fieldset, which can be configured to have different kinds of fields. The administrator may have installed additional plugins which provide different types of fieldsets."),
  115 + 'description' => _kt("It is possible to create different types of fieldsets. The most common kind is a \"normal\" fieldset, which can be configured to have different kinds of fields. The administrator may have installed additional plugins which provide different types of fieldsets."),
116 116 'important_description' => _kt('Note that it is not possible to convert between different types of fieldsets, so please choose carefully.'),
117 117 'name' => 'fieldset_type',
118 118 'required' => true,
... ...
plugins/ktstandard/KTEmail.php
... ... @@ -66,6 +66,7 @@ function sendGroupEmails($aGroupIDs, &amp;$aUserEmails, &amp;$aEmailErrors) {
66 66 $default->log->info('sendingEmail to group ' . $oDestGroup->getName());
67 67 // for each group, retrieve all the users
68 68 foreach($aDestinationGroups as $oGroup){
  69 + // Need to only retrieve users that are not diabled.
69 70 $aUsers = kt_array_merge($aUsers, $oGroup->getUsers());
70 71 }
71 72  
... ... @@ -245,7 +246,7 @@ function sendEmailDocument($aDestEmailAddress, $iDocumentID, $sDocumentName, $sC
245 246 $sMessage .= sprintf(_kt("Your colleague, %s, wishes you to view the attached document entitled '%s'."), $oSendingUser->getName(), $sDocumentName);
246 247 $sMessage .= "\n\n";
247 248 if (strlen($sComment) > 0) {
248   - $sMessage .= '<br><br>' . _kt('Comments') . ':<br>' . $sComment;
  249 + $sMessage .= '<br><br>' . _kt('Comments') . ':<br>' . nl2br($sComment);
249 250 }
250 251 $sTitle = sprintf(_kt("Document (ID %s): %s from %s"), $iDocumentID, $sDocumentName, $oSendingUser->getName());
251 252  
... ... @@ -310,7 +311,7 @@ function sendEmailHyperlink($aDestEmailAddress, $iDocumentID, $sDocumentName, $s
310 311 $sMessage .= '<br>' . generateControllerLink('viewDocument', "fDocumentID=$iDocumentID", $sDocumentName, true);
311 312 // add optional comment
312 313 if (strlen($sComment) > 0) {
313   - $sMessage .= '<br><br>' . _kt('Comments') . ':<br>' . $sComment;
  314 + $sMessage .= '<br><br>' . _kt('Comments') . ':<br>' . nl2br($sComment);
314 315 }
315 316 $sMessage .= '</font>';
316 317 $sTitle = sprintf(_kt("Link (ID %s): %s from %s"), $iDocumentID, $sDocumentName, $oSendingUser->getName());
... ... @@ -441,7 +442,6 @@ class KTDocumentEmailAction extends KTDocumentAction {
441 442 function json_getGroups() {
442 443 $oConfig = KTConfig::getSingleton();
443 444 $bOnlyOwnGroup = $oConfig->get('email/onlyOwnGroups', false);
444   -
445 445 $sFilter = KTUtil::arrayGet($_REQUEST, 'filter', false);
446 446 $aGroupList = array('off'=> _kt('-- Please filter --'));
447 447  
... ... @@ -452,7 +452,6 @@ class KTDocumentEmailAction extends KTDocumentAction {
452 452 } else {
453 453 $aGroups = GroupUtil::listGroupsForUser($this->oUser, array('where' => $sWhere));
454 454 }
455   -
456 455 $aGroupList = array();
457 456 foreach($aGroups as $g) {
458 457 $aGroupList[$g->getId()] = $g->getName();
... ... @@ -545,13 +544,12 @@ class KTDocumentEmailAction extends KTDocumentAction {
545 544 $this->errorRedirectToMain(_kt('No recipients set'), sprintf('fDocumentId=%d', $this->oDocument->getId()));
546 545 exit(0);
547 546 }
548   -
  547 +
549 548 $iDocumentID = $this->oDocument->getID();
550 549 $sDocumentName = $this->oDocument->getName();
551 550  
552 551 $aEmailErrors = array();
553 552 $aUserEmails = array();
554   -
555 553 // send group emails
556 554 sendGroupEmails($aGroupIDs, $aUserEmails, $aEmailErrors);
557 555 // send user emails
... ... @@ -569,12 +567,12 @@ class KTDocumentEmailAction extends KTDocumentAction {
569 567 $aListEmails = array_keys($aUserEmails);
570 568 sendEmail($aListEmails, $iDocumentID, $sDocumentName, $fComment, (boolean)$fAttachDocument, $aEmailErrors);
571 569 }
572   -
  570 + // Display success or error, not both
573 571 if (count($aEmailErrors)) {
574 572 $_SESSION['KTErrorMessage'][] = join('<br />\n', $aEmailErrors);
  573 + } else {
  574 + $_SESSION['KTInfoMessage'][] = _kt('Email sent');
575 575 }
576   -
577   - $_SESSION['KTInfoMessage'][] = _kt('Email sent');
578 576 //go back to the document view page
579 577 controllerRedirect('viewDocument', sprintf("fDocumentId=%d", $this->oDocument->getId()));
580 578 }
... ...
resources/css/kt-framing.css
... ... @@ -1217,15 +1217,15 @@ The text will be hidden for screen view. The generic fahrner-ish approach comes
1217 1217 }
1218 1218  
1219 1219 .portlet_button a .arrow_download {
1220   - background: transparent url(../../resources/graphics/download_arrow.gif) top right no-repeat;
1221   - width: 27px;
  1220 + background: transparent url(../../resources/graphics/download_arrow.gif) center right no-repeat;
  1221 + width: 20px;
1222 1222 height: 47px;
1223 1223 float: right;
1224 1224 }
1225 1225  
1226 1226 .portlet_button a .arrow_upload {
1227   - background: transparent url(../../resources/graphics/upload_arrow.gif) top right no-repeat;
1228   - width: 27px;
  1227 + background: transparent url(../../resources/graphics/upload_arrow.gif) center right no-repeat;
  1228 + width: 20px;
1229 1229 height: 47px;
1230 1230 float: right;
1231 1231 }
... ...
resources/graphics/download_arrow.gif

662 Bytes | W: | H:

4.93 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
resources/graphics/upload_arrow.gif

662 Bytes | W: | H:

4.93 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
resources/js/search2widget.js
... ... @@ -87,6 +87,8 @@ function populateSavedSearch(menu)
87 87 var item = menu.addMenuItem({
88 88 text: sSearchTranslations[5], /*Saved Searches*/
89 89 menu: {
  90 + shadow: false,
  91 + minWidth: '150px',
90 92 items: []
91 93 }
92 94 });
... ... @@ -118,6 +120,7 @@ function createSearchBar(div, suffix)
118 120 {
119 121 var menu = new Ext.menu.Menu({
120 122 shadow: false,
  123 + minWidth: '200px',
121 124 items: [
122 125 {
123 126 text: sSearchTranslations[6], /* Advanced Search */
... ... @@ -131,6 +134,7 @@ function createSearchBar(div, suffix)
131 134 text: sSearchTranslations[8] , /*Quick Search Options*/
132 135 menu: {
133 136 shadow: false,
  137 + minWidth: '150px',
134 138 items: [
135 139 new Ext.menu.CheckItem({
136 140 text: sSearchTranslations[9], /* content and metadata */
... ... @@ -153,6 +157,7 @@ function createSearchBar(div, suffix)
153 157 text: sSearchTranslations[13] , /*Toggle results format*/
154 158 menu: {
155 159 shadow: false,
  160 + minWidth: '150px',
156 161 items: [
157 162 new Ext.menu.CheckItem({
158 163 text: sSearchTranslations[14], /* search engine format */
... ...
search2/documentProcessor/documentProcessor.inc.php
... ... @@ -144,6 +144,16 @@ class DocumentProcessor
144 144 global $default;
145 145 $default->log->debug('documentProcessor: starting');
146 146  
  147 + // Check for lock file to ensure processor is not currently running
  148 + $cacheDir = $default->cacheDirectory;
  149 + $lockFile = $cacheDir . DIRECTORY_SEPARATOR . 'document_processor.lock';
  150 +
  151 + if(file_exists($lockFile)){
  152 + // lock file exists, exit
  153 + $default->log->debug('documentProcessor: stopping, lock file in place '.$lockFile);
  154 + return ;
  155 + }
  156 +
147 157 if($default->enableIndexing){
148 158 // Setup indexing - load extractors, run diagnostics
149 159 if($this->indexer->preIndexingSetup() === false){
... ... @@ -160,6 +170,10 @@ class DocumentProcessor
160 170 return ;
161 171 }
162 172  
  173 + // indexing starting - create lock file
  174 + touch($lockFile);
  175 +
  176 +
163 177 // Process queue
164 178 foreach($queue as $item){
165 179  
... ... @@ -198,6 +212,11 @@ class DocumentProcessor
198 212 // update the indexer statistics
199 213 $this->indexer->updateIndexStats();
200 214  
  215 + // Remove lock file to indicate processing has completed
  216 + if(file_exists($lockFile)){
  217 + @unlink($lockFile);
  218 + }
  219 +
201 220 $default->log->debug('documentProcessor: stopping');
202 221 }
203 222  
... ...
search2/indexing/indexers/PHPLuceneIndexer.inc.php
... ... @@ -7,31 +7,31 @@
7 7 * Document Management Made Simple
8 8 * Copyright (C) 2008, 2009 KnowledgeTree Inc.
9 9 * Portions copyright The Jam Warehouse Software (Pty) Limited
10   - *
  10 + *
11 11 * This program is free software; you can redistribute it and/or modify it under
12 12 * the terms of the GNU General Public License version 3 as published by the
13 13 * Free Software Foundation.
14   - *
  14 + *
15 15 * This program is distributed in the hope that it will be useful, but WITHOUT
16 16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 17 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 18 * details.
19   - *
  19 + *
20 20 * You should have received a copy of the GNU General Public License
21 21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22   - *
23   - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  22 + *
  23 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
24 24 * California 94120-7775, or email info@knowledgetree.com.
25   - *
  25 + *
26 26 * The interactive user interfaces in modified source and object code versions
27 27 * of this program must display Appropriate Legal Notices, as required under
28 28 * Section 5 of the GNU General Public License version 3.
29   - *
  29 + *
30 30 * In accordance with Section 7(b) of the GNU General Public License version 3,
31 31 * these Appropriate Legal Notices must retain the display of the "Powered by
32   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  32 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
33 33 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
34   - * must display the words "Powered by KnowledgeTree" and retain the original
  34 + * must display the words "Powered by KnowledgeTree" and retain the original
35 35 * copyright notice.
36 36 * Contributor( s): ______________________________________
37 37 *
... ... @@ -67,9 +67,13 @@ class PHPLuceneIndexer extends Indexer
67 67 }
68 68 catch(Exception $ex)
69 69 {
70   - $this->lucene = null;
71   - if (!$catchException)
72   - throw $ex;
  70 + if($ex->getMessage() == "Index doesn't exists in the specified directory."){
  71 + $this->lucene = new Zend_Search_Lucene($indexPath, true);
  72 + }else {
  73 + $this->lucene = null;
  74 + if (!$catchException)
  75 + throw $ex;
  76 + }
73 77 }
74 78 }
75 79  
... ... @@ -94,13 +98,16 @@ class PHPLuceneIndexer extends Indexer
94 98 */
95 99 private function addDocument($docid, $content, $discussion, $title, $version)
96 100 {
97   - $doc = new Zend_Search_Lucene_Document();
98   - $doc->addField(Zend_Search_Lucene_Field::Text('DocumentID', PHPLuceneIndexer::longToString($docid)));
99   - $doc->addField(Zend_Search_Lucene_Field::Text('Content', $content, 'UTF-8'));
100   - $doc->addField(Zend_Search_Lucene_Field::Text('Discussion', $discussion, 'UTF-8'));
101   - $doc->addField(Zend_Search_Lucene_Field::Text('Title', $title, 'UTF-8'));
102   - $doc->addField(Zend_Search_Lucene_Field::Text('Version', $version, 'UTF-8'));
103   - $this->lucene->addDocument($doc);
  101 + $teaser = substr($content, 0, 250);
  102 +
  103 + $doc = new Zend_Search_Lucene_Document();
  104 + $doc->addField(Zend_Search_Lucene_Field::Text('DocumentID', PHPLuceneIndexer::longToString($docid)));
  105 + $doc->addField(Zend_Search_Lucene_Field::Text('Content', $content, 'UTF-8'));
  106 + $doc->addField(Zend_Search_Lucene_Field::unStored('Discussion', $discussion, 'UTF-8'));
  107 + $doc->addField(Zend_Search_Lucene_Field::Text('Title', $title, 'UTF-8'));
  108 + $doc->addField(Zend_Search_Lucene_Field::Text('Version', $version, 'UTF-8'));
  109 + $doc->addField(Zend_Search_Lucene_Field::unIndexed('Summary', $teaser, 'UTF-8'));
  110 + $this->lucene->addDocument($doc);
104 111 }
105 112  
106 113 /**
... ... @@ -232,6 +239,7 @@ class PHPLuceneIndexer extends Indexer
232 239  
233 240 $document_id = PHPLuceneIndexer::stringToLong($document->DocumentID);
234 241  
  242 + /*
235 243 $coreText = '';
236 244 if ($queryContent)
237 245 {
... ... @@ -243,6 +251,11 @@ class PHPLuceneIndexer extends Indexer
243 251 }
244 252  
245 253 $content = $query->highlightMatches($coreText);
  254 + */
  255 +
  256 + $teaser = $document->Summary;
  257 +
  258 + $content = $query->highlightMatches($teaser);
246 259  
247 260 $title = $document->Title;
248 261 $score = $hit->score;
... ... @@ -250,6 +263,7 @@ class PHPLuceneIndexer extends Indexer
250 263 // avoid adding duplicates. If it is in already, it has higher priority.
251 264 if (!array_key_exists($document_id, $results) || $score > $results[$document_id]->Score)
252 265 {
  266 + $item = new DocumentResultItem($document_id, $score, $title, $content);
253 267 $item = new QueryResultItem($document_id, $score, $title, $content);
254 268 if ($item->CanBeReadByUser)
255 269 {
... ... @@ -284,4 +298,8 @@ class PHPLuceneIndexer extends Indexer
284 298 return _kt('Document Indexer Library');
285 299 }
286 300 }
287   -?>
  301 +
  302 + public function isDocumentIndexed($documentId){
  303 + // do something
  304 + }
  305 +?>
288 306 \ No newline at end of file
... ...
search2/indexing/lib/XmlRpcLucene.inc.php
... ... @@ -297,7 +297,7 @@ class XmlRpcLucene
297 297 );
298 298 $result =& $this->client->send($function);
299 299  
300   - unset($buffer);
  300 + unset($content);
301 301  
302 302 if($result->faultCode()) {
303 303 $this->error($result, 'extractTextContent');
... ...
sql/mysql/install/data.sql
... ... @@ -1459,7 +1459,7 @@ LOCK TABLES `system_settings` WRITE;
1459 1459 INSERT INTO `system_settings` VALUES
1460 1460 (1,'lastIndexUpdate','0'),
1461 1461 (2,'knowledgeTreeVersion','3.6.1'),
1462   -(3,'databaseVersion','3.6.0'),
  1462 +(3,'databaseVersion','3.6.1'),
1463 1463 (4,'server_name','127.0.0.1');
1464 1464 /*!40000 ALTER TABLE `system_settings` ENABLE KEYS */;
1465 1465 UNLOCK TABLES;
... ... @@ -1753,7 +1753,8 @@ INSERT INTO `upgrades` VALUES
1753 1753 (214,'func*3.5.4a*0*removeOldFilesAndFolders354a','Remove old files and folders that are no longer needed.','2008-10-01 00:00:00',1,'upgrade*3.5.4a*99*upgrade3.5.4a'),
1754 1754 (215,'func*3.5.4a*0*removeOldFilesAndFolders354a1','Remove old files and folders that are no longer needed.','2008-10-01 00:00:00',1,'upgrade*3.5.4a*99*upgrade3.5.4a'),
1755 1755 (216,'upgrade*3.5.4a*99*upgrade3.5.4a','Upgrade from version 3.5.4 to 3.5.4a','2008-12-01 00:00:00',1,'upgrade*3.5.4a*99*upgrade3.5.4a'),
1756   -(217,'upgrade*3.6.0*99*upgrade3.6.0','Upgrade from version 3.5.4a to 3.6.0','2009-01-01 00:00:00',1,'upgrade*3.6.0*99*upgrade3.6.0');
  1756 +(217,'upgrade*3.6.0*99*upgrade3.6.0','Upgrade from version 3.5.4a to 3.6.0','2009-01-01 00:00:00',1,'upgrade*3.6.0*99*upgrade3.6.0'),
  1757 +(218,'upgrade*3.6.1*99*upgrade3.6.1','Upgrade from version 3.6.0 to 3.6.1','2009-04-01 00:00:00',1,'upgrade*3.6.1*99*upgrade3.6.1');
1757 1758 /*!40000 ALTER TABLE `upgrades` ENABLE KEYS */;
1758 1759 UNLOCK TABLES;
1759 1760  
... ...
templates/ktcore/search2/adv_query_builder.smarty
... ... @@ -183,15 +183,16 @@ function createRange(groupid, fid, type)
183 183 html += "<option value=\"is not\">{/literal}{i18n}not on{/i18n}{literal}";
184 184 break;
185 185 default:
186   - html += "<option value=\"is\">=";
187   - html += "<option value=\"is not\">!=";
188   - html += "<option value=\"\>\">\>";
189   - html += "<option value=\"\>=\">\>=";
190   - html += "<option value=\"\<\">\<";
191   - html += "<option value=\"\<=\">\<=";
  186 + html += "<option value=\"is\">{/literal}{i18n}equal to{/i18n}";
  187 + html += "<option value=\"is not\">{i18n}not equal to{/i18n}";
  188 + html += "<option value=\"\>\">{i18n}greater than{/i18n}";
  189 + html += "<option value=\"\>=\">{i18n}greater than or equal to{/i18n}";
  190 + html += "<option value=\"\<\">{i18n}less than{/i18n}";
  191 + html += "<option value=\"\<=\">{i18n}less than or equal to{/i18n}";
192 192 html += "<option value=\"between\">{/literal}{i18n}between{/i18n}{literal}";
193 193 break;
194 194 }
  195 +
195 196 html += "</SELECT>";
196 197  
197 198 html += "<td valign=top width=\"100\"><div id=\"field"+ groupid + '_' + fid +"start\"></div>";
... ... @@ -296,18 +297,17 @@ function onFilesizeChange(groupid, fid)
296 297  
297 298 function createFilesize(groupid, fid)
298 299 {
299   - var html = "<table><tr><td width=\"140\"";
  300 + var html = "<table><tr><td width=\"140\">";
300 301  
301 302 html += "<SELECT style=\"width: 140px\" id=\"field" + groupid + "_" + fid + "op\">";
302   - html += "<option value=\"\<\">\<";
303   - html += "<option value=\"\<=\">\<=";
304   - html += "<option value=\"\>\">\>";
305   - html += "<option value=\"\>=\">\>=";
306   - html += "<option value=\"=\">=";
307   - html += "<option value=\"!=\">!=";
  303 + html += "<option value=\"\<\">{/literal}{i18n}less than{/i18n}"; // <
  304 + html += "<option value=\"\<=\">{i18n}less than or equal to{/i18n}"; // <=
  305 + html += "<option value=\"\>\">{i18n}greater than{/i18n}"; // >
  306 + html += "<option value=\"\>=\">{i18n}greater than or equal to{/i18n}"; // >=
  307 + html += "<option value=\"=\">{i18n}equal to{/i18n}"; // =
  308 + html += "<option value=\"!=\">{i18n}not equal to{/i18n}{literal}"; // !=
308 309 html += "</SELECT>"
309 310  
310   -
311 311 html += "<td valign=top width=\"50px\"><div id=\"field"+ groupid + '_' + fid +"input\"></div>";
312 312 html += "<td>";
313 313 html += "<SELECT id=\"field" + groupid + "_" + fid + "factor\" onchange=\"onFilesizeChange( " + groupid + "," + fid + ")\">";
... ...
tutorials/KTAPI/KTAPI.pkg
... ... @@ -15,12 +15,13 @@
15 15 <refsect1 id="{@id intro}">
16 16 <title>Introduction</title>
17 17 <para>
18   - This is an introductory blurb about the KTAPI Package.
  18 + PLEASE NOTE: This is currently just a place holder for the API documentation and tutorials that are coming.
  19 + Many examples can already be found in the classes and methods documentation so have a look at the specific area you are interested in in the index. We intend updating and adding to this documentation each iteration.
19 20 </para>
20 21 <refsect2 id="{@id examples}">
21 22 <title>Examples</title>
22 23 <para>
23   - This is a blurb about the KTAPI examples offered here.
  24 + KTAPI examples can be found here.
24 25 </para>
25 26 <refsect3 id="{@id example1}">
26 27 <title>Example 1</title>
... ...