diff --git a/browse.php b/browse.php index fb08a15..6472642 100755 --- a/browse.php +++ b/browse.php @@ -171,6 +171,7 @@ class BrowseDispatcher extends KTStandardDispatcher { "context" => $this, "collection" => $collection, 'browse_mode' => $this->browse_mode, + 'isEditable' => true, ); return $oTemplate->render($aTemplateData); } diff --git a/lib/browse/PartialQuery.inc.php b/lib/browse/PartialQuery.inc.php index 4f214a1..a1ee65f 100644 --- a/lib/browse/PartialQuery.inc.php +++ b/lib/browse/PartialQuery.inc.php @@ -57,8 +57,11 @@ class BrowseQuery extends PartialQuery{ function _getDocumentQuery($aOptions = null) { $oUser = User::get($_SESSION['userID']); - list($sPermissionString, $aPermissionParams, $sPermissionJoin) = KTSearchUtil::permissionToSQL($oUser, $this->sPermissionName); - + $res = KTSearchUtil::permissionToSQL($oUser, $this->sPermissionName); + if (PEAR::isError($res)) { + return $res; + } + list($sPermissionString, $aPermissionParams, $sPermissionJoin) = $res; $aPotentialWhere = array($sPermissionString, 'D.folder_id = ?', 'D.status_id = 1'); $aWhere = array(); foreach ($aPotentialWhere as $sWhere) { @@ -86,7 +89,11 @@ class BrowseQuery extends PartialQuery{ function _getFolderQuery($aOptions = null) { $oUser = User::get($_SESSION['userID']); - list($sPermissionString, $aPermissionParams, $sPermissionJoin) = KTSearchUtil::permissionToSQL($oUser, $this->sPermissionName, "F"); + $res = KTSearchUtil::permissionToSQL($oUser, $this->sPermissionName, "F"); + if (PEAR::isError($res)) { + return $res; + } + list($sPermissionString, $aPermissionParams, $sPermissionJoin) = $res; $aPotentialWhere = array($sPermissionString, 'F.parent_id = ?'); $aWhere = array(); @@ -118,6 +125,7 @@ class BrowseQuery extends PartialQuery{ 'select' => 'count(F.id) AS cnt', ); $aQuery = $this->_getFolderQuery($aOptions); + if (PEAR::isError($aQuery)) { return 0; } $iRet = DBUtil::getOneResultKey($aQuery, 'cnt'); return $iRet; } @@ -127,12 +135,15 @@ class BrowseQuery extends PartialQuery{ 'select' => 'count(D.id) AS cnt', ); $aQuery = $this->_getDocumentQuery($aOptions); + if (PEAR::isError($aQuery)) { return 0; } $iRet = DBUtil::getOneResultKey($aQuery, 'cnt'); return $iRet; } function getFolders($iBatchSize, $iBatchStart, $sSortColumn, $sSortOrder, $sJoinClause = null, $aJoinParams = null) { - list($sQuery, $aParams) = $this->_getFolderQuery(); + $res = $this->_getFolderQuery(); + if (PEAR::isError($res)) { return array(); } + list($sQuery, $aParams) = $res; $sQuery .= " ORDER BY " . $sSortColumn . " " . $sSortOrder . " "; $sQuery .= " LIMIT ?, ?"; @@ -147,7 +158,9 @@ class BrowseQuery extends PartialQuery{ } function getDocuments($iBatchSize, $iBatchStart, $sSortColumn, $sSortOrder, $sJoinClause = null, $aJoinParams = null) { - list($sQuery, $aParams) = $this->_getDocumentQuery(); + $res = $this->_getDocumentQuery(); + if (PEAR::isError($res)) { return array(); } // no permissions + list($sQuery, $aParams) = $res; $sQuery .= " ORDER BY " . $sSortColumn . " " . $sSortOrder . " "; $sQuery .= " LIMIT ?, ?"; @@ -225,6 +238,7 @@ class SimpleSearchQuery extends PartialQuery { 'select' => 'count(DISTINCT D.id) AS cnt', ); $aQuery = $this->getQuery($aOptions); + if (PEAR::isError($aQuery)) { return 0; } $iRet = DBUtil::getOneResultKey($aQuery, 'cnt'); return $iRet; } @@ -238,8 +252,9 @@ class SimpleSearchQuery extends PartialQuery { $aOptions = array( 'select' => 'DISTINCT D.id AS id', ); - list($sQuery, $aParams) = $this->getQuery($aOptions); - + $res = $this->getQuery($aOptions); + if (PEAR::isError($res)) { return array(); } + list($sQuery, $aParams) = $res; $sQuery .= " ORDER BY " . $sSortColumn . " " . $sSortOrder . " "; $sQuery .= " LIMIT ?, ?"; @@ -302,6 +317,7 @@ class BooleanSearchQuery extends PartialQuery { 'select' => 'count(DISTINCT D.id) AS cnt', ); $aQuery = $this->getQuery($aOptions); + if (PEAR::isError($aQuery)) { return 0; } $iRet = DBUtil::getOneResultKey($aQuery, 'cnt'); return $iRet; } @@ -315,8 +331,9 @@ class BooleanSearchQuery extends PartialQuery { $aOptions = array( 'select' => 'DISTINCT D.id AS id', ); - list($sQuery, $aParams) = $this->getQuery($aOptions); - + $res = $this->getQuery($aOptions); + if (PEAR::isError($res)) { return array(); } + list($sQuery, $aParams) = $res; $sQuery .= " ORDER BY " . $sSortColumn . " " . $sSortOrder . " "; $sQuery .= " LIMIT ?, ?"; diff --git a/lib/permissions/permissiondescriptor.inc.php b/lib/permissions/permissiondescriptor.inc.php index 14cb0c2..1fabb8e 100644 --- a/lib/permissions/permissiondescriptor.inc.php +++ b/lib/permissions/permissiondescriptor.inc.php @@ -189,6 +189,7 @@ class KTPermissionDescriptor extends KTEntity { if (is_null($aOptions)) { $aOptions = array(); } + if (count($aGroups) === 0) { return array(); } $ids = KTUtil::arrayGet($aOptions, 'ids'); $aGroupIDs = array(); foreach ($aGroups as $oGroup) { @@ -291,6 +292,7 @@ class KTPermissionDescriptor extends KTEntity { if (is_null($aOptions)) { $aOptions = array(); } + if (count($aRoles) === 0) { return array(); } $ids = KTUtil::arrayGet($aOptions, 'ids'); $aRoleIDs = array(); foreach ($aRoles as $oRole) { @@ -393,6 +395,7 @@ class KTPermissionDescriptor extends KTEntity { if (is_null($aOptions)) { $aOptions = array(); } + if (count($aUsers) === 0) { return array(); } $ids = KTUtil::arrayGet($aOptions, 'ids'); $aUserIDs = array(); foreach ($aUsers as $oUser) { diff --git a/lib/search/searchutil.inc.php b/lib/search/searchutil.inc.php index ba267c6..7fbcac3 100644 --- a/lib/search/searchutil.inc.php +++ b/lib/search/searchutil.inc.php @@ -166,6 +166,9 @@ class KTSearchUtil { "; $aGroups = GroupUtil::listGroupsForUserExpand($oUser); $aPermissionDescriptors = KTPermissionDescriptor::getByGroups($aGroups, array('ids' => true)); + if (count($aPermissionDescriptors) === 0) { + return PEAR::raiseError('You have no permissions'); + } $sPermissionDescriptors = DBUtil::paramArray($aPermissionDescriptors); $sSQLString = "PLA.permission_descriptor_id IN ($sPermissionDescriptors)"; $aParams = array($oPermission->getId()); @@ -220,8 +223,13 @@ class KTSearchUtil { $sToSearch = KTUtil::arrayGet($aOrigReq, 'fToSearch', 'Live'); // actually never present in this version. - list ($sPermissionString, $aPermissionParams, $sPermissionJoin) = KTSearchUtil::permissionToSQL($oUser, $sPermissionName); - + $res = KTSearchUtil::permissionToSQL($oUser, $sPermissionName); + if (PEAR::isError($res)) { // only occurs if the group has no permissions. + return $res; + } else { + list ($sPermissionString, $aPermissionParams, $sPermissionJoin) = $res; + } + /* * This is to overcome the problem where $sPermissionString (or * even $sSQLSearchString) is empty, leading to leading or @@ -300,6 +308,9 @@ class KTSearchUtil { ); $aOptions = array('select' => 'COUNT(DISTINCT(D.id)) AS cnt'); $aQuery = KTSearchUtil::criteriaToQuery($aCriteriaSet, null, null, $aOptions); + if (PEAR::isError($aQuery)) { // caused by no permissions being set. + return false; + } $cnt = DBUtil::getOneResultKey($aQuery, 'cnt'); if (PEAR::isError($cnt)) { return $cnt; diff --git a/plugins/ktcore/KTCorePlugin.php b/plugins/ktcore/KTCorePlugin.php index a832c12..f2f181e 100644 --- a/plugins/ktcore/KTCorePlugin.php +++ b/plugins/ktcore/KTCorePlugin.php @@ -33,8 +33,7 @@ class KTCorePlugin extends KTPlugin { $this->registerDashlet('KTNotificationDashlet', 'ktcore.dashlet.notifications', 'KTDashlets.php'); $this->registerDashlet('KTCheckoutDashlet', 'ktcore.dashlet.checkout', 'KTDashlets.php'); - $this->registerAdminPage('authentication', 'KTAuthenticationAdminPage', 'principals', 'Authentication', 'FIXME: describe authentication', 'authentication/authenticationadminpage.inc.php'); - $this->registeri18n('knowledgeTree', KT_DIR . '/i18n'); + $this->registerAdminPage('authentication', 'KTAuthenticationAdminPage', 'principals', _('Authentication'), _('By default, KnowledgeTree controls its own users and groups and stores all information about them inside the database. In many situations, an organisation will already have a list of users and groups, and needs to use that existing information to allow access to the DMS. These Authentication Sources allow the system administrator to specify additional sources of authentication data.'), 'authentication/authenticationadminpage.inc.php'); $this->registeri18n('knowledgeTree', KT_DIR . '/i18n'); $this->registerPortlet(array('browse', 'dashboard'), 'KTSearchPortlet', 'ktcore.portlets.search', diff --git a/plugins/ktcore/KTPortlets.php b/plugins/ktcore/KTPortlets.php index 197b022..8e95c44 100644 --- a/plugins/ktcore/KTPortlets.php +++ b/plugins/ktcore/KTPortlets.php @@ -3,6 +3,8 @@ require_once(KT_LIB_DIR . '/actions/portletregistry.inc.php'); require_once(KT_LIB_DIR . '/widgets/portlet.inc.php'); +require_once(KT_LIB_DIR . '/search/savedsearch.inc.php'); + class KTSearchPortlet extends KTPortlet { function KTSearchPortlet() { @@ -11,8 +13,16 @@ class KTSearchPortlet extends KTPortlet { function render() { $oTemplating = new KTTemplating; $oTemplate = $oTemplating->loadTemplate("kt3/portlets/search_portlet"); + + $aSearches = KTSavedSearch::getList(); + // empty on error. + if (PEAR::isError($aSearches)) { + $aSearches = array(); + } + $aTemplateData = array( "context" => $this, + "saved_searches" => $aSearches, ); return $oTemplate->render($aTemplateData); diff --git a/plugins/ktcore/admin/ajaxComplexConditionals.php b/plugins/ktcore/admin/ajaxComplexConditionals.php index 6a58c36..45f66c9 100755 --- a/plugins/ktcore/admin/ajaxComplexConditionals.php +++ b/plugins/ktcore/admin/ajaxComplexConditionals.php @@ -1,12 +1,12 @@ 'action=manageConditional&fFieldsetId=' . $oFieldset->getId(), 'name' => _('Manage conditional fieldset'), ); - $this->aBreadcrumbs[] = array( - 'name' => _('Manage simple conditional'), - ); + $this->oPage->setBreadcrumbDetails(_('Manage simple conditional')); $aTemplateData = array( "context" => &$this, @@ -101,9 +99,7 @@ class ManageConditionalDispatcher extends KTAdminDispatcher { 'query' => 'action=manageConditional&fFieldsetId=' . $oFieldset->getId(), 'name' => _('Manage conditional fieldset'), ); - $this->aBreadcrumbs[] = array( - 'name' => _('Manage complex conditional'), - ); + $this->oPage->setBreadcrumbDetails(_('Manage complex conditional')); $aTemplateData = array( "context" => &$this, "fieldset_id" => $fieldset_id, diff --git a/plugins/ktcore/admin/savedSearch.php b/plugins/ktcore/admin/savedSearch.php index 7ff6d8c..a5aeb17 100755 --- a/plugins/ktcore/admin/savedSearch.php +++ b/plugins/ktcore/admin/savedSearch.php @@ -10,7 +10,10 @@ class KTSavedSearchDispatcher extends KTStandardDispatcher { var $bAutomaticTransaction = true; function check() { - $this->oPage->setTitle(_('Manage Saved Searches')); + $this->aBreadcrumbs[] = array( + 'url' => $_SERVER['PHP_SELF'], + 'name' => _('Saved Searches'), + ); return true; } @@ -34,10 +37,26 @@ class KTSavedSearchDispatcher extends KTStandardDispatcher { "aCriteria" => $aCriteria, "searchButton" => _("Save"), 'context' => $this, - "sNameTitle" => _('New Stored Search'), + "sNameTitle" => _('New Saved Search'), ); return $oTemplate->render($aTemplateData); } + + function do_delete() { + $id = KTUtil::arrayGet($_REQUEST, 'fSavedSearchId'); + $oSearch = KTSavedSearch::get($id); + + if (PEAR::isError($oSearch) || ($oSearch == false)) { + $this->errorRedirectToMain(_('No Such search')); + } + + $res = $oSearch->delete(); + if (PEAR::isError($res) || ($res == false)) { + return $this->errorRedirectToMain(_('Failed to delete search')); + } + + $this->successRedirectToMain(_('Search Deleted')); + } function do_view() { diff --git a/plugins/ktcore/admin/userManagement.php b/plugins/ktcore/admin/userManagement.php index 90c6ef5..b8b2238 100755 --- a/plugins/ktcore/admin/userManagement.php +++ b/plugins/ktcore/admin/userManagement.php @@ -59,17 +59,19 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { if ($add_user !== false) { $add_user = true; } $edit_user = KTUtil::arrayGet($_REQUEST, 'edit_user', false); + $aOptions = array('autocomplete' => false); + $add_fields = array(); - $add_fields[] = new KTStringWidget(_('Username'),_('The username the user will enter to gain access to the KnowledgeTree. e.g. jsmith'), 'username', null, $this->oPage, true); - $add_fields[] = new KTStringWidget(_('Name'),_('The full name of the user. This is shown in reports and listings. e.g. John Smith'), 'name', null, $this->oPage, true); - $add_fields[] = new KTStringWidget(_('Email Address'), _('The email address of the user. Notifications and alerts are mailed to this address if email notifications is set below. e.g. jsmith@acme.com'), 'email_address', null, $this->oPage, false); - $add_fields[] = new KTCheckboxWidget(_('Email Notifications'), _("If this is specified then the user will have notifications sent to the email address entered above. If it isn't set, then the user will only see notifications on the Dashboard"), 'email_notifications', true, $this->oPage, false); - $add_fields[] = new KTPasswordWidget(_('Password'), _('Specify an initial password for the user.'), 'password', null, $this->oPage, true); - $add_fields[] = new KTPasswordWidget(_('Confirm Password'), _('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true); + $add_fields[] = new KTStringWidget(_('Username'),_('The username the user will enter to gain access to the KnowledgeTree. e.g. jsmith'), 'username', null, $this->oPage, true, null, null, $aOptions); + $add_fields[] = new KTStringWidget(_('Name'),_('The full name of the user. This is shown in reports and listings. e.g. John Smith'), 'name', null, $this->oPage, true, null, null, $aOptions); + $add_fields[] = new KTStringWidget(_('Email Address'), _('The email address of the user. Notifications and alerts are mailed to this address if email notifications is set below. e.g. jsmith@acme.com'), 'email_address', null, $this->oPage, false, null, null, $aOptions); + $add_fields[] = new KTCheckboxWidget(_('Email Notifications'), _("If this is specified then the user will have notifications sent to the email address entered above. If it isn't set, then the user will only see notifications on the Dashboard"), 'email_notifications', true, $this->oPage, false, null, null, $aOptions); + $add_fields[] = new KTPasswordWidget(_('Password'), _('Specify an initial password for the user.'), 'password', null, $this->oPage, true, null, null, $aOptions); + $add_fields[] = new KTPasswordWidget(_('Confirm Password'), _('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true, null, null, $aOptions); // nice, easy bits. - $add_fields[] = new KTStringWidget(_('Mobile Number'), _("The mobile phone number of the user. If the system is configured to send notifications to cellphones, then this number will be SMS'd with notifications. e.g. 999 9999 999"), 'mobile_number', null, $this->oPage, false); - $add_fields[] = new KTStringWidget(_('Maximum Sessions'), _('As a safety precaution, it is useful to limit the number of times a given account can log in, before logging out. This prevents a single account being used by many different people.'), 'max_sessions', '3', $this->oPage, true); + $add_fields[] = new KTStringWidget(_('Mobile Number'), _("The mobile phone number of the user. If the system is configured to send notifications to cellphones, then this number will be SMS'd with notifications. e.g. 999 9999 999"), 'mobile_number', null, $this->oPage, false, null, null, $aOptions); + $add_fields[] = new KTStringWidget(_('Maximum Sessions'), _('As a safety precaution, it is useful to limit the number of times a given account can log in, before logging out. This prevents a single account being used by many different people.'), 'max_sessions', '3', $this->oPage, true, null, null, $aOptions); $aAuthenticationSources =& KTAuthenticationSource::getList(); diff --git a/plugins/ktcore/authentication/authenticationadminpage.inc.php b/plugins/ktcore/authentication/authenticationadminpage.inc.php index 92ca6d7..ca5aa13 100644 --- a/plugins/ktcore/authentication/authenticationadminpage.inc.php +++ b/plugins/ktcore/authentication/authenticationadminpage.inc.php @@ -4,13 +4,15 @@ require_once(KT_LIB_DIR . '/dispatcher.inc.php'); require_once(KT_LIB_DIR . '/authentication/authenticationproviderregistry.inc.php'); require_once(KT_LIB_DIR . '/authentication/authenticationsource.inc.php'); +require_once(KT_LIB_DIR . '/widgets/fieldWidgets.php'); + class KTAuthenticationAdminPage extends KTAdminDispatcher { function do_main() { $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']); $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/manage'); $fields = array(); - $fields[] = new KTStringWidget(_('Name'), 'FIXME', 'name', "", $this->oPage, true); + $fields[] = new KTStringWidget(_('Name'), _('A short name which helps identify this source of authentication data.'), 'name', "", $this->oPage, true); $aVocab = array(); $oRegistry =& KTAuthenticationProviderRegistry::getSingleton(); @@ -19,7 +21,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { $aVocab[$aProvider[2]] = $aProvider[0]; } $fieldOptions = array("vocab" => $aVocab); - $fields[] = new KTLookupWidget(_('Authentication provider'), 'FIXME', 'authentication_provider', null, $this->oPage, true, null, $fieldErrors, $fieldOptions); + $fields[] = new KTLookupWidget(_('Authentication provider'), _('The type of source (e.g. LDAP)'), 'authentication_provider', null, $this->oPage, true, null, $fieldErrors, $fieldOptions); $aSources = KTAuthenticationSource::getList(); diff --git a/preferences.php b/preferences.php index b5c33c8..acce037 100644 --- a/preferences.php +++ b/preferences.php @@ -27,12 +27,13 @@ class PreferencesDispatcher extends KTStandardDispatcher { $oUser =& $this->oUser; + $aOptions = array('autocomplete' => false); $edit_fields = array(); - $edit_fields[] = new KTStringWidget(_('Name'),_('Your full name. This is shown in reports and listings. e.g. John Smith'), 'name', $oUser->getName(), $this->oPage, true); - $edit_fields[] = new KTStringWidget(_('Email Address'),_('Your email address. Notifications and alerts are mailed to this address if email notifications is set below. e.g. jsmith@acme.com'), 'email_address', $oUser->getEmail(), $this->oPage, false); - $edit_fields[] = new KTCheckboxWidget(_('Email Notifications'),_('If this is specified then the you will receive certain notifications. If it is not set, then you will only see notifications on the Dashboard'), 'email_notifications', $oUser->getEmailNotification(), $this->oPage, false); - $edit_fields[] = new KTStringWidget(_('Mobile Number'), _('Your mobile phone number. If the system is configured to send notifications to cellphones, then this number will be sent an SMS with notifications. e.g. +27 99 999 9999'), 'mobile_number', $oUser->getMobile(), $this->oPage, false); + $edit_fields[] = new KTStringWidget(_('Name'),_('Your full name. This is shown in reports and listings. e.g. John Smith'), 'name', $oUser->getName(), $this->oPage, true, null, null, $aOptions); + $edit_fields[] = new KTStringWidget(_('Email Address'),_('Your email address. Notifications and alerts are mailed to this address if email notifications is set below. e.g. jsmith@acme.com'), 'email_address', $oUser->getEmail(), $this->oPage, false, null, null, $aOptions); + $edit_fields[] = new KTCheckboxWidget(_('Email Notifications'),_('If this is specified then the you will receive certain notifications. If it is not set, then you will only see notifications on the Dashboard'), 'email_notifications', $oUser->getEmailNotification(), $this->oPage, false, null, null, $aOptions); + $edit_fields[] = new KTStringWidget(_('Mobile Number'), _('Your mobile phone number. If the system is configured to send notifications to cellphones, then this number will be sent an SMS with notifications. e.g. +27 99 999 9999'), 'mobile_number', $oUser->getMobile(), $this->oPage, false, null, null, $aOptions); $oTemplating = new KTTemplating; $oTemplate = $oTemplating->loadTemplate("ktcore/principals/preferences"); @@ -50,9 +51,11 @@ class PreferencesDispatcher extends KTStandardDispatcher { $oUser =& $this->oUser; + $aOptions = array('autocomplete' => false); + $edit_fields = array(); - $edit_fields[] = new KTPasswordWidget(_('Password'), _('Specify your new password.'), 'password', null, $this->oPage, true); - $edit_fields[] = new KTPasswordWidget(_('Confirm Password'), _('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true); + $edit_fields[] = new KTPasswordWidget(_('Password'), _('Specify your new password.'), 'password', null, $this->oPage, true, null, null, $aOptions); + $edit_fields[] = new KTPasswordWidget(_('Confirm Password'), _('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true, null, null, $aOptions); $oTemplating = new KTTemplating; diff --git a/resources/css/kt-framing.css b/resources/css/kt-framing.css index 488cf1f..80cc1c7 100644 --- a/resources/css/kt-framing.css +++ b/resources/css/kt-framing.css @@ -183,11 +183,25 @@ a.main_nav_item { { margin: 0 0 1.5em 0; border: 0; - padding: 0; + padding: 0 0 0.5em; border: 1px solid #888; background: #f3f3f3; } +#portletbar .portlet a { + text-decoration: none; + border-bottom: 1px solid blue; +} + +#portletbar .portlet a:visited { + border-bottom: 1px solid purple; +} + +#portletbar .portlet a:hover { + color: red; + border-bottom: 1px solid red; +} + #portletbar .portlet h4 { margin: 0; @@ -212,7 +226,7 @@ a.main_nav_item { { display: block; padding: 0; - margin: 0.15em 0.5em 0.15em 0; + margin: 0.5em 0.5em 0.15em 0; text-align: right; border: 0; } @@ -663,3 +677,9 @@ The text will be hidden for screen view. The generic fahrner-ish approach comes color: #999; font-size: small; } + +hr { + border-width: 1px 0 0 0; + border-style: solid; + border-color: #888; +} \ No newline at end of file diff --git a/search/booleanSearch.php b/search/booleanSearch.php index db03add..52c6715 100755 --- a/search/booleanSearch.php +++ b/search/booleanSearch.php @@ -40,6 +40,7 @@ class BooleanSearchDispatcher extends KTStandardDispatcher { } function do_performSearch() { + $title = _('Advanced Search Results'); $datavars = KTUtil::arrayGet($_REQUEST, 'boolean_search'); if (!is_array($datavars)) { $datavars = unserialize($datavars); @@ -52,20 +53,25 @@ class BooleanSearchDispatcher extends KTStandardDispatcher { if (!empty($iSavedSearchId)) { $oSearch = KTSavedSearch::get($iSavedSearchId); $datavars = $oSearch->getSearch(); + $title = _('Saved Search: ') . $oSearch->getName(); } if (empty($datavars)) { $this->errorRedirectToMain(_('You need to have at least 1 condition.')); } - - $res = $this->handleCriteriaSet($datavars, KTUtil::arrayGet($_REQUEST, 'fStartIndex', 1)); + + $res = $this->handleCriteriaSet($datavars, KTUtil::arrayGet($_REQUEST, 'fStartIndex', 1), $title); return $res; } - function handleCriteriaSet($aCriteriaSet, $iStartIndex) { + function handleCriteriaSet($aCriteriaSet, $iStartIndex, $sTitle=null) { $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _("Boolean search")); - $this->oPage->setBreadcrumbDetails(_('searching')); + if ($sTitle == null) { + $this->oPage->setBreadcrumbDetails(_('searching')); + } else { + $this->oPage->setBreadcrumbDetails($sTitle); + } $collection = new DocumentCollection; $this->browseType = "Folder"; @@ -106,6 +112,7 @@ class BooleanSearchDispatcher extends KTStandardDispatcher { $aTemplateData = array( "context" => $this, "collection" => $collection, + "custom_title" => $sTitle, ); return $oTemplate->render($aTemplateData); } diff --git a/templates/kt3/browse.smarty b/templates/kt3/browse.smarty index 45635ba..7ea2760 100644 --- a/templates/kt3/browse.smarty +++ b/templates/kt3/browse.smarty @@ -4,12 +4,20 @@ {$context->oPage->requireJSResource('resources/js/toggleselect.js')} +{if ($custom_title != null)} +
{i18n}By default, KnowledgeTree controls its +own users and groups and stores all information about them inside the database. +In many situations, an organisation will already have a list of users and groups, +and needs to use that existing information to allow access to the DMS. +These Authentication Sources allow the system administrator to +specify additional sources of authentication data.{/i18n}
+ {if $providers} +{else} +{i18n}Only the standard database authentication is currently available. +If you need to use a different authentication type (e.g. LDAP) you will need to +ensure that the Plugin is enabled.{/i18n}
{i18n}No additional authentication sources have been defined.{/i18n}
{i18n}No fieldsets are currently associated with this type.{/i18n}
+{i18n}No fieldsets are currently associated with this type.{/i18n}
{i18n}There are no fieldsets available for adding.{/i18n} FIXME link to fieldset creation from here.
+{i18n}No fieldsets are available to be added. To add a fieldset, please go to +DMS Administration{/i18n} » {i18n}Document Metadata and Workflow Configuration{/i18n} » {i18n}Document Field Management{/i18n}
{i18n}Saved searches are searches which are particular to your location +For example, you could define a search which returns all documents in a particular workflow state, +or all documents which are considered "common" within your organisation (leave policy, +newsletters, etc.) based on a category or fieldset value.{/i18n}
-