diff --git a/config/config.ini b/config/config.ini
index e5d158f..91d068a 100644
--- a/config/config.ini
+++ b/config/config.ini
@@ -206,13 +206,31 @@ uiUrl = ${rootUrl}/presentation/lookAndFeel/knowledgeTree
stopwordsFile = ${fileSystemRoot}/config/stopwords.txt
[webservice]
+; Directory to which all uploads via webservices are persisted before moving into the repository
uploadDirectory = ${varDirectory}/uploads
+
+; Url which is sent to clients via web service calls so they can then download file via HTTP GET
downloadUrl = ${rootUrl}/ktwebservice/download.php
+
+; Period indicating how long a file should be retained in the uploads directory.
uploadExpiry = 30
+
+; Period indicating how long a download link will be available
downloadExpiry = 30
+
+; Random text used to construct a hash. This can be customised on installations so there is less chance of overlap between installations.
randomKeyText = bkdfjhg23yskjdhf2iu
+
+; Validating session counts can interfere with access. It is best to leave this disabled, unless very strict access is required.
validateSessionCount = false
+; If the document type is invalid when adding a document, we can be tollerant and just default to the Default document type.
+useDefaultDocumentTypeIfInvalid = true
+
+; The web service debugging if the logLevel is set to DEBUG. We can set the value to 4 or 5 to get more verbose web service logging.
+; Level 4 logs the name of functions being accessed. Level 5 logs the SOAP XML requests and responses.
+debug = false
+
[session]
; session timeout (in seconds)
sessionTimeout = 1200
diff --git a/lib/util/ktutil.inc b/lib/util/ktutil.inc
index 9416729..bb8f3b0 100644
--- a/lib/util/ktutil.inc
+++ b/lib/util/ktutil.inc
@@ -748,6 +748,7 @@ class KTUtil {
// {{{ isAbsolutePath
static function isAbsolutePath($sPath) {
+
if (substr($sPath, 0, 1) == '/') {
return true;
}
@@ -949,6 +950,79 @@ class KTUtil {
return $aRet;
}
+
+ /**
+ * Generates breadcrumbs for a browsable collection
+ *
+ * @param object $oFolder The folder being browsed to
+ * @param integer $iFolderId The id of the folder
+ * @param array $aURLParams The url parameters for each folder/breadcrumb link
+ * @return unknown
+ */
+ function generate_breadcrumbs($oFolder, $iFolderId, $aURLParams) {
+ static $aFolders = array();
+ static $aBreadcrumbs = array();
+
+ // Check if selected folder is a parent of the current folder
+ if(in_array($iFolderId, $aFolders)){
+ $temp = array_flip($aFolders);
+ $key = $temp[$iFolderId];
+ array_splice($aFolders, $key);
+ array_splice($aBreadcrumbs, $key);
+ return $aBreadcrumbs;
+ }
+
+ // Check for the parent of the selected folder unless its the root folder
+ $iParentId = $oFolder->getParentID();
+
+ if(is_null($iParentId)){
+ // folder is root
+ return '';
+ }
+
+ if($iFolderId != 1 && in_array($iParentId, $aFolders)){
+ $temp = array_flip($aFolders);
+ $key = $temp[$iParentId];
+ array_splice($aFolders, $key);
+ array_splice($aBreadcrumbs, $key);
+ array_push($aFolders, $iFolderId);
+
+ $aParams = $aURLParams;
+ $aParams['fFolderId'] = $iFolderId;
+ $url = KTUtil::addQueryString($_SERVER['PHP_SELF'], $aParams);
+ $aBreadcrumbs[] = array('url' => $url, 'name' => $oFolder->getName());
+ return $aBreadcrumbs;
+ }
+
+ // Get the root folder name
+ $oRootFolder = Folder::get(1);
+ $sRootFolder =$oRootFolder->getName();
+
+ // Create the breadcrumbs
+ $folder_path_names = $oFolder->getPathArray();
+ array_unshift($folder_path_names, $sRootFolder);
+ $folder_path_ids = explode(',', $oFolder->getParentFolderIds());
+ $folder_path_ids[] = $oFolder->getId();
+ if ($folder_path_ids[0] == 0) {
+ array_shift($folder_path_ids);
+ array_shift($folder_path_names);
+ }
+
+ $iCount = count($folder_path_ids);
+ $range = range(0, $iCount - 1);
+ foreach ($range as $index) {
+ $id = $folder_path_ids[$index];
+ $name = $folder_path_names[$index];
+
+ $aParams = $aURLParams;
+ $aParams['fFolderId'] = $id;
+ $url = KTUtil::addQueryString($_SERVER['PHP_SELF'], $aParams);
+ $aBreadcrumbs[] = array('url' => $url, 'name' => $name);
+ }
+ $aFolders = $folder_path_ids;
+ return $aBreadcrumbs;
+ }
+
}
/**
diff --git a/plugins/ktcore/admin/archivedDocuments.php b/plugins/ktcore/admin/archivedDocuments.php
index 3072083..c9533d2 100755
--- a/plugins/ktcore/admin/archivedDocuments.php
+++ b/plugins/ktcore/admin/archivedDocuments.php
@@ -5,32 +5,32 @@
* KnowledgeTree Open Source Edition
* Document Management Made Simple
* Copyright (C) 2004 - 2008 The Jam Warehouse Software (Pty) Limited
- *
+ *
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation.
- *
+ *
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program. If not, see
";
- $fields = $oFieldset->getFields();
- $values = (array) KTUtil::arrayGet($data, 'fieldset_' . $oFieldset->getId());
- foreach ($fields as $oField)
- {
- $val = KTUtil::arrayGet($values, 'metadata_' . $oField->getId());
+ $doctype_fieldsets = KTFieldSet::getForDocumentType($doctypeid);
+ foreach($doctype_fieldsets as $fieldset)
+ {
+ $fs_ids[] = $fieldset->getId();
+ }
- // FIXME "null" has strange meanings here.
- if (!is_null($val))
- {
- $MDPack[] = array(
- $oField,
- $val
- );
- }
- }
- }
+ $MDPack = array();
+ foreach ($fieldsets as $oFieldset)
+ {
+ if ($oFieldset->getIsGeneric() || in_array($oFieldset->getId(), $fs_ids))
+ {
+ $fields = $oFieldset->getFields();
+
+ foreach ($fields as $oField)
+ {
+ $val = isset($field_values[$oField->getId()]) ? $field_values[$oField->getId()] : '';
+
+ if (!empty($val))
+ {
+ $MDPack[] = array($oField, $val);
+ }
+ }
+ }
+ }
- }
+ $core_res = KTDocumentUtil::saveMetadata($this->oDocument, $MDPack, array('novalidate' => true));
- $core_res = KTDocumentUtil::saveMetadata($this->oDocument, $MDPack);
+ if (PEAR::isError($core_res)) {
+ DBUtil::rollback();
+ return $core_res;
+ }
+ DBUtil::commit();
- $oKTTriggerRegistry = KTTriggerRegistry::getSingleton();
+ $oKTTriggerRegistry = KTTriggerRegistry::getSingleton();
$aTriggers = $oKTTriggerRegistry->getTriggers('edit', 'postValidate');
foreach ($aTriggers as $aTrigger) {
$sTrigger = $aTrigger[0];
$oTrigger = new $sTrigger;
$aInfo = array(
- "document" => $this->oDocument,
- "aOptions" => $MDPack,
+ "document" => $this->oDocument,
+ "aOptions" => $MDPack,
);
$oTrigger->setInfo($aInfo);
$ret = $oTrigger->postValidate();
@@ -366,4 +374,4 @@ class KTDocumentEditAction extends KTDocumentAction {
}
// }}}
-?>
+?>
\ No newline at end of file
diff --git a/plugins/ktstandard/KTDocumentLinks.php b/plugins/ktstandard/KTDocumentLinks.php
index 8190a2f..b92f7c6 100644
--- a/plugins/ktstandard/KTDocumentLinks.php
+++ b/plugins/ktstandard/KTDocumentLinks.php
@@ -247,7 +247,7 @@ class KTDocumentLinkAction extends KTDocumentAction {
$aURLParams = $aBaseParams;
$aURLParams['action'] = 'new';
- $aBreadcrumbs = $this->_generate_breadcrumbs($oFolder, $iFolderId, $aURLParams);
+ $aBreadcrumbs = KTUtil::generate_breadcrumbs($oFolder, $iFolderId, $aURLParams);
$aTemplateData = array(
'context' => $this,
@@ -438,59 +438,6 @@ class KTDocumentLinkAction extends KTDocumentAction {
$this->successRedirectToMain(_kt('Document link deleted'), sprintf('fDocumentId=%d', $oParentDocument->getId()));
exit(0);
}
-
- function _generate_breadcrumbs($oFolder, $iFolderId, $aURLParams) {
- static $aFolders = array();
- static $aBreadcrumbs = array();
-
- // Check if selected folder is a parent of the current folder
- if(in_array($iFolderId, $aFolders)){
- $temp = array_flip($aFolders);
- $key = $temp[$iFolderId];
- array_splice($aFolders, $key);
- array_splice($aBreadcrumbs, $key);
- return $aBreadcrumbs;
- }
-
- // Check for the parent of the selected folder unless its the root folder
- $iParentId = $oFolder->getParentID();
- if($iFolderId != 1 && in_array($iParentId, $aFolders)){
- $temp = array_flip($aFolders);
- $key = $temp[$iParentId];
- array_splice($aFolders, $key);
- array_splice($aBreadcrumbs, $key);
- array_push($aFolders, $iFolderId);
-
- $aParams = $aURLParams;
- $aParams['fFolderId'] = $iFolderId;
- $url = KTUtil::addQueryString($_SERVER['PHP_SELF'], $aParams);
- $aBreadcrumbs[] = array('url' => $url, 'name' => $oFolder->getName());
- return $aBreadcrumbs;
- }
-
- // Create the breadcrumbs
- $folder_path_names = $oFolder->getPathArray();
- $folder_path_ids = explode(',', $oFolder->getParentFolderIds());
- $folder_path_ids[] = $oFolder->getId();
- if ($folder_path_ids[0] == 0) {
- array_shift($folder_path_ids);
- array_shift($folder_path_names);
- }
-
- $iCount = count($folder_path_ids);
- $range = range(0, $iCount - 1);
- foreach ($range as $index) {
- $id = $folder_path_ids[$index];
- $name = $folder_path_names[$index];
-
- $aParams = $aURLParams;
- $aParams['fFolderId'] = $id;
- $url = KTUtil::addQueryString($_SERVER['PHP_SELF'], $aParams);
- $aBreadcrumbs[] = array('url' => $url, 'name' => $name);
- }
- $aFolders = $folder_path_ids;
- return $aBreadcrumbs;
- }
}
class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
diff --git a/resources/js/search2widget.js b/resources/js/search2widget.js
index d6230a3..a82fd8c 100644
--- a/resources/js/search2widget.js
+++ b/resources/js/search2widget.js
@@ -176,7 +176,7 @@ function createSearchBar(div, suffix)
value: quickQuery,
selectOnFocus:true,
id:'txtSearchBar' + suffix,
- width: 110
+ width: (suffix == 1)?180:110
}), button);
var map = new Ext.KeyMap("txtSearchBar" + suffix,
@@ -190,7 +190,7 @@ function createSearchBar(div, suffix)
var el = Ext.get(div);
if (suffix == 1)
{
- el.applyStyles('position:relative; top: -3px');
+ el.applyStyles('position:relative; top: -15px; margin-right: 15px');
}
else
{
diff --git a/search2/indexing/indexers/JavaXMLRPCLuceneIndexer.inc.php b/search2/indexing/indexers/JavaXMLRPCLuceneIndexer.inc.php
index 4795220..e3a7fa9 100644
--- a/search2/indexing/indexers/JavaXMLRPCLuceneIndexer.inc.php
+++ b/search2/indexing/indexers/JavaXMLRPCLuceneIndexer.inc.php
@@ -202,7 +202,7 @@ class JavaXMLRPCLuceneIndexer extends Indexer
}
else
{
- $_SESSION['KTErrorMessage'][] = _kt('The XMLRPC Server did not respond correctly. Please notify the system administrator to investigate.');
+ $_SESSION['KTErrorMessage'][] = _kt('The Document Indexer did not respond correctly. Your search results will not include content results. Please notify the system administrator to investigate why the Document Indexer is not running.');
}
return $results;
}
diff --git a/templates/kt3/standard_page.smarty b/templates/kt3/standard_page.smarty
index 72b17b9..fbd7472 100644
--- a/templates/kt3/standard_page.smarty
+++ b/templates/kt3/standard_page.smarty
@@ -158,7 +158,7 @@
-
{i18n}Use the folder collection and path below to browse to the folder containing the documents you wish to restore.{/i18n} +
+