Commit 82e3b2e0246622156bf84d52e81e896030aee157

Authored by Brad Shuttleworth
1 parent 3506ac6a

Brad Shuttleworth 2006-01-20 KTS-106: Saved Searches cannot be deleted als...

Brad Shuttleworth 2006-01-20 KTS-153:  Complex conditionals edit page ca...
    Brad Shuttleworth 2006-01-20 if there are no permission descriptors, the...
    Brad Shuttleworth 2006-01-20 KTS-96:  username incorrectly filled in by ...
    Brad Shuttleworth 2006-01-20 KTS-111: extra helptext on default provider.
    Brad Shuttleworth 2006-01-20 fix for KTS-111
    Brad Shuttleworth 2006-01-20 KTS-139: remove comment about fieldset-crea...


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4616 c91229c3-7414-0410-bfa2-8a42b809f60b
browse.php
... ... @@ -171,6 +171,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
171 171 "context" => $this,
172 172 "collection" => $collection,
173 173 'browse_mode' => $this->browse_mode,
  174 + 'isEditable' => true,
174 175 );
175 176 return $oTemplate->render($aTemplateData);
176 177 }
... ...
lib/browse/PartialQuery.inc.php
... ... @@ -57,8 +57,11 @@ class BrowseQuery extends PartialQuery{
57 57  
58 58 function _getDocumentQuery($aOptions = null) {
59 59 $oUser = User::get($_SESSION['userID']);
60   - list($sPermissionString, $aPermissionParams, $sPermissionJoin) = KTSearchUtil::permissionToSQL($oUser, $this->sPermissionName);
61   -
  60 + $res = KTSearchUtil::permissionToSQL($oUser, $this->sPermissionName);
  61 + if (PEAR::isError($res)) {
  62 + return $res;
  63 + }
  64 + list($sPermissionString, $aPermissionParams, $sPermissionJoin) = $res;
62 65 $aPotentialWhere = array($sPermissionString, 'D.folder_id = ?', 'D.status_id = 1');
63 66 $aWhere = array();
64 67 foreach ($aPotentialWhere as $sWhere) {
... ... @@ -86,7 +89,11 @@ class BrowseQuery extends PartialQuery{
86 89  
87 90 function _getFolderQuery($aOptions = null) {
88 91 $oUser = User::get($_SESSION['userID']);
89   - list($sPermissionString, $aPermissionParams, $sPermissionJoin) = KTSearchUtil::permissionToSQL($oUser, $this->sPermissionName, "F");
  92 + $res = KTSearchUtil::permissionToSQL($oUser, $this->sPermissionName, "F");
  93 + if (PEAR::isError($res)) {
  94 + return $res;
  95 + }
  96 + list($sPermissionString, $aPermissionParams, $sPermissionJoin) = $res;
90 97  
91 98 $aPotentialWhere = array($sPermissionString, 'F.parent_id = ?');
92 99 $aWhere = array();
... ... @@ -118,6 +125,7 @@ class BrowseQuery extends PartialQuery{
118 125 'select' => 'count(F.id) AS cnt',
119 126 );
120 127 $aQuery = $this->_getFolderQuery($aOptions);
  128 + if (PEAR::isError($aQuery)) { return 0; }
121 129 $iRet = DBUtil::getOneResultKey($aQuery, 'cnt');
122 130 return $iRet;
123 131 }
... ... @@ -127,12 +135,15 @@ class BrowseQuery extends PartialQuery{
127 135 'select' => 'count(D.id) AS cnt',
128 136 );
129 137 $aQuery = $this->_getDocumentQuery($aOptions);
  138 + if (PEAR::isError($aQuery)) { return 0; }
130 139 $iRet = DBUtil::getOneResultKey($aQuery, 'cnt');
131 140 return $iRet;
132 141 }
133 142  
134 143 function getFolders($iBatchSize, $iBatchStart, $sSortColumn, $sSortOrder, $sJoinClause = null, $aJoinParams = null) {
135   - list($sQuery, $aParams) = $this->_getFolderQuery();
  144 + $res = $this->_getFolderQuery();
  145 + if (PEAR::isError($res)) { return array(); }
  146 + list($sQuery, $aParams) = $res;
136 147 $sQuery .= " ORDER BY " . $sSortColumn . " " . $sSortOrder . " ";
137 148  
138 149 $sQuery .= " LIMIT ?, ?";
... ... @@ -147,7 +158,9 @@ class BrowseQuery extends PartialQuery{
147 158 }
148 159  
149 160 function getDocuments($iBatchSize, $iBatchStart, $sSortColumn, $sSortOrder, $sJoinClause = null, $aJoinParams = null) {
150   - list($sQuery, $aParams) = $this->_getDocumentQuery();
  161 + $res = $this->_getDocumentQuery();
  162 + if (PEAR::isError($res)) { return array(); } // no permissions
  163 + list($sQuery, $aParams) = $res;
151 164 $sQuery .= " ORDER BY " . $sSortColumn . " " . $sSortOrder . " ";
152 165  
153 166 $sQuery .= " LIMIT ?, ?";
... ... @@ -225,6 +238,7 @@ class SimpleSearchQuery extends PartialQuery {
225 238 'select' => 'count(DISTINCT D.id) AS cnt',
226 239 );
227 240 $aQuery = $this->getQuery($aOptions);
  241 + if (PEAR::isError($aQuery)) { return 0; }
228 242 $iRet = DBUtil::getOneResultKey($aQuery, 'cnt');
229 243 return $iRet;
230 244 }
... ... @@ -238,8 +252,9 @@ class SimpleSearchQuery extends PartialQuery {
238 252 $aOptions = array(
239 253 'select' => 'DISTINCT D.id AS id',
240 254 );
241   - list($sQuery, $aParams) = $this->getQuery($aOptions);
242   -
  255 + $res = $this->getQuery($aOptions);
  256 + if (PEAR::isError($res)) { return array(); }
  257 + list($sQuery, $aParams) = $res;
243 258 $sQuery .= " ORDER BY " . $sSortColumn . " " . $sSortOrder . " ";
244 259 $sQuery .= " LIMIT ?, ?";
245 260  
... ... @@ -302,6 +317,7 @@ class BooleanSearchQuery extends PartialQuery {
302 317 'select' => 'count(DISTINCT D.id) AS cnt',
303 318 );
304 319 $aQuery = $this->getQuery($aOptions);
  320 + if (PEAR::isError($aQuery)) { return 0; }
305 321 $iRet = DBUtil::getOneResultKey($aQuery, 'cnt');
306 322 return $iRet;
307 323 }
... ... @@ -315,8 +331,9 @@ class BooleanSearchQuery extends PartialQuery {
315 331 $aOptions = array(
316 332 'select' => 'DISTINCT D.id AS id',
317 333 );
318   - list($sQuery, $aParams) = $this->getQuery($aOptions);
319   -
  334 + $res = $this->getQuery($aOptions);
  335 + if (PEAR::isError($res)) { return array(); }
  336 + list($sQuery, $aParams) = $res;
320 337 $sQuery .= " ORDER BY " . $sSortColumn . " " . $sSortOrder . " ";
321 338 $sQuery .= " LIMIT ?, ?";
322 339  
... ...
lib/permissions/permissiondescriptor.inc.php
... ... @@ -189,6 +189,7 @@ class KTPermissionDescriptor extends KTEntity {
189 189 if (is_null($aOptions)) {
190 190 $aOptions = array();
191 191 }
  192 + if (count($aGroups) === 0) { return array(); }
192 193 $ids = KTUtil::arrayGet($aOptions, 'ids');
193 194 $aGroupIDs = array();
194 195 foreach ($aGroups as $oGroup) {
... ... @@ -291,6 +292,7 @@ class KTPermissionDescriptor extends KTEntity {
291 292 if (is_null($aOptions)) {
292 293 $aOptions = array();
293 294 }
  295 + if (count($aRoles) === 0) { return array(); }
294 296 $ids = KTUtil::arrayGet($aOptions, 'ids');
295 297 $aRoleIDs = array();
296 298 foreach ($aRoles as $oRole) {
... ... @@ -393,6 +395,7 @@ class KTPermissionDescriptor extends KTEntity {
393 395 if (is_null($aOptions)) {
394 396 $aOptions = array();
395 397 }
  398 + if (count($aUsers) === 0) { return array(); }
396 399 $ids = KTUtil::arrayGet($aOptions, 'ids');
397 400 $aUserIDs = array();
398 401 foreach ($aUsers as $oUser) {
... ...
lib/search/searchutil.inc.php
... ... @@ -166,6 +166,9 @@ class KTSearchUtil {
166 166 ";
167 167 $aGroups = GroupUtil::listGroupsForUserExpand($oUser);
168 168 $aPermissionDescriptors = KTPermissionDescriptor::getByGroups($aGroups, array('ids' => true));
  169 + if (count($aPermissionDescriptors) === 0) {
  170 + return PEAR::raiseError('You have no permissions');
  171 + }
169 172 $sPermissionDescriptors = DBUtil::paramArray($aPermissionDescriptors);
170 173 $sSQLString = "PLA.permission_descriptor_id IN ($sPermissionDescriptors)";
171 174 $aParams = array($oPermission->getId());
... ... @@ -220,8 +223,13 @@ class KTSearchUtil {
220 223  
221 224 $sToSearch = KTUtil::arrayGet($aOrigReq, 'fToSearch', 'Live'); // actually never present in this version.
222 225  
223   - list ($sPermissionString, $aPermissionParams, $sPermissionJoin) = KTSearchUtil::permissionToSQL($oUser, $sPermissionName);
224   -
  226 + $res = KTSearchUtil::permissionToSQL($oUser, $sPermissionName);
  227 + if (PEAR::isError($res)) { // only occurs if the group has no permissions.
  228 + return $res;
  229 + } else {
  230 + list ($sPermissionString, $aPermissionParams, $sPermissionJoin) = $res;
  231 + }
  232 +
225 233 /*
226 234 * This is to overcome the problem where $sPermissionString (or
227 235 * even $sSQLSearchString) is empty, leading to leading or
... ... @@ -300,6 +308,9 @@ class KTSearchUtil {
300 308 );
301 309 $aOptions = array('select' => 'COUNT(DISTINCT(D.id)) AS cnt');
302 310 $aQuery = KTSearchUtil::criteriaToQuery($aCriteriaSet, null, null, $aOptions);
  311 + if (PEAR::isError($aQuery)) { // caused by no permissions being set.
  312 + return false;
  313 + }
303 314 $cnt = DBUtil::getOneResultKey($aQuery, 'cnt');
304 315 if (PEAR::isError($cnt)) {
305 316 return $cnt;
... ...
plugins/ktcore/KTCorePlugin.php
... ... @@ -33,8 +33,7 @@ class KTCorePlugin extends KTPlugin {
33 33 $this->registerDashlet('KTNotificationDashlet', 'ktcore.dashlet.notifications', 'KTDashlets.php');
34 34 $this->registerDashlet('KTCheckoutDashlet', 'ktcore.dashlet.checkout', 'KTDashlets.php');
35 35  
36   - $this->registerAdminPage('authentication', 'KTAuthenticationAdminPage', 'principals', 'Authentication', 'FIXME: describe authentication', 'authentication/authenticationadminpage.inc.php');
37   - $this->registeri18n('knowledgeTree', KT_DIR . '/i18n');
  36 + $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 <strong>Authentication Sources</strong> allow the system administrator to specify additional sources of authentication data.'), 'authentication/authenticationadminpage.inc.php'); $this->registeri18n('knowledgeTree', KT_DIR . '/i18n');
38 37  
39 38 $this->registerPortlet(array('browse', 'dashboard'),
40 39 'KTSearchPortlet', 'ktcore.portlets.search',
... ...
plugins/ktcore/KTPortlets.php
... ... @@ -3,6 +3,8 @@
3 3 require_once(KT_LIB_DIR . '/actions/portletregistry.inc.php');
4 4 require_once(KT_LIB_DIR . '/widgets/portlet.inc.php');
5 5  
  6 +require_once(KT_LIB_DIR . '/search/savedsearch.inc.php');
  7 +
6 8 class KTSearchPortlet extends KTPortlet {
7 9  
8 10 function KTSearchPortlet() {
... ... @@ -11,8 +13,16 @@ class KTSearchPortlet extends KTPortlet {
11 13 function render() {
12 14 $oTemplating = new KTTemplating;
13 15 $oTemplate = $oTemplating->loadTemplate("kt3/portlets/search_portlet");
  16 +
  17 + $aSearches = KTSavedSearch::getList();
  18 + // empty on error.
  19 + if (PEAR::isError($aSearches)) {
  20 + $aSearches = array();
  21 + }
  22 +
14 23 $aTemplateData = array(
15 24 "context" => $this,
  25 + "saved_searches" => $aSearches,
16 26 );
17 27  
18 28 return $oTemplate->render($aTemplateData);
... ...
plugins/ktcore/admin/ajaxComplexConditionals.php
1 1 <?php
2   -require_once("../../../../../../config/dmsDefaults.php");
  2 +require_once("../../../config/dmsDefaults.php");
3 3 require_once(KT_LIB_DIR . "/templating/templating.inc.php");
4 4 require_once(KT_LIB_DIR . "/documentmanagement/DocumentField.inc");
5 5 require_once(KT_LIB_DIR . "/database/dbutil.inc");
6 6 require_once(KT_LIB_DIR . "/util/ktutil.inc");
7 7 require_once(KT_LIB_DIR . "/dispatcher.inc.php");
8 8 $sectionName = "Administration";
9   -require_once(KT_DIR . "/presentation/webpageTemplate.inc");
  9 +
10 10  
11 11 require_once(KT_LIB_DIR . "/metadata/fieldset.inc.php");
12 12 require_once(KT_LIB_DIR . "/metadata/fieldbehaviour.inc.php");
... ...
plugins/ktcore/admin/manageConditionals.php
... ... @@ -63,9 +63,7 @@ class ManageConditionalDispatcher extends KTAdminDispatcher {
63 63 'query' => 'action=manageConditional&fFieldsetId=' . $oFieldset->getId(),
64 64 'name' => _('Manage conditional fieldset'),
65 65 );
66   - $this->aBreadcrumbs[] = array(
67   - 'name' => _('Manage simple conditional'),
68   - );
  66 + $this->oPage->setBreadcrumbDetails(_('Manage simple conditional'));
69 67  
70 68 $aTemplateData = array(
71 69 "context" => &$this,
... ... @@ -101,9 +99,7 @@ class ManageConditionalDispatcher extends KTAdminDispatcher {
101 99 'query' => 'action=manageConditional&fFieldsetId=' . $oFieldset->getId(),
102 100 'name' => _('Manage conditional fieldset'),
103 101 );
104   - $this->aBreadcrumbs[] = array(
105   - 'name' => _('Manage complex conditional'),
106   - );
  102 + $this->oPage->setBreadcrumbDetails(_('Manage complex conditional'));
107 103 $aTemplateData = array(
108 104 "context" => &$this,
109 105 "fieldset_id" => $fieldset_id,
... ...
plugins/ktcore/admin/savedSearch.php
... ... @@ -10,7 +10,10 @@ class KTSavedSearchDispatcher extends KTStandardDispatcher {
10 10 var $bAutomaticTransaction = true;
11 11  
12 12 function check() {
13   - $this->oPage->setTitle(_('Manage Saved Searches'));
  13 + $this->aBreadcrumbs[] = array(
  14 + 'url' => $_SERVER['PHP_SELF'],
  15 + 'name' => _('Saved Searches'),
  16 + );
14 17 return true;
15 18 }
16 19  
... ... @@ -34,10 +37,26 @@ class KTSavedSearchDispatcher extends KTStandardDispatcher {
34 37 "aCriteria" => $aCriteria,
35 38 "searchButton" => _("Save"),
36 39 'context' => $this,
37   - "sNameTitle" => _('New Stored Search'),
  40 + "sNameTitle" => _('New Saved Search'),
38 41 );
39 42 return $oTemplate->render($aTemplateData);
40 43 }
  44 +
  45 + function do_delete() {
  46 + $id = KTUtil::arrayGet($_REQUEST, 'fSavedSearchId');
  47 + $oSearch = KTSavedSearch::get($id);
  48 +
  49 + if (PEAR::isError($oSearch) || ($oSearch == false)) {
  50 + $this->errorRedirectToMain(_('No Such search'));
  51 + }
  52 +
  53 + $res = $oSearch->delete();
  54 + if (PEAR::isError($res) || ($res == false)) {
  55 + return $this->errorRedirectToMain(_('Failed to delete search'));
  56 + }
  57 +
  58 + $this->successRedirectToMain(_('Search Deleted'));
  59 + }
41 60  
42 61 function do_view() {
43 62  
... ...
plugins/ktcore/admin/userManagement.php
... ... @@ -59,17 +59,19 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
59 59 if ($add_user !== false) { $add_user = true; }
60 60 $edit_user = KTUtil::arrayGet($_REQUEST, 'edit_user', false);
61 61  
  62 + $aOptions = array('autocomplete' => false);
  63 +
62 64  
63 65 $add_fields = array();
64   - $add_fields[] = new KTStringWidget(_('Username'),_('The username the user will enter to gain access to the KnowledgeTree. e.g. <strong>jsmith</strong>'), 'username', null, $this->oPage, true);
65   - $add_fields[] = new KTStringWidget(_('Name'),_('The full name of the user. This is shown in reports and listings. e.g. <strong>John Smith</strong>'), 'name', null, $this->oPage, true);
66   - $add_fields[] = new KTStringWidget(_('Email Address'), _('The email address of the user. Notifications and alerts are mailed to this address if <strong>email notifications</strong> is set below. e.g. <strong>jsmith@acme.com</strong>'), 'email_address', null, $this->oPage, false);
67   - $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 <strong>Dashboard</strong>"), 'email_notifications', true, $this->oPage, false);
68   - $add_fields[] = new KTPasswordWidget(_('Password'), _('Specify an initial password for the user.'), 'password', null, $this->oPage, true);
69   - $add_fields[] = new KTPasswordWidget(_('Confirm Password'), _('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true);
  66 + $add_fields[] = new KTStringWidget(_('Username'),_('The username the user will enter to gain access to the KnowledgeTree. e.g. <strong>jsmith</strong>'), 'username', null, $this->oPage, true, null, null, $aOptions);
  67 + $add_fields[] = new KTStringWidget(_('Name'),_('The full name of the user. This is shown in reports and listings. e.g. <strong>John Smith</strong>'), 'name', null, $this->oPage, true, null, null, $aOptions);
  68 + $add_fields[] = new KTStringWidget(_('Email Address'), _('The email address of the user. Notifications and alerts are mailed to this address if <strong>email notifications</strong> is set below. e.g. <strong>jsmith@acme.com</strong>'), 'email_address', null, $this->oPage, false, null, null, $aOptions);
  69 + $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 <strong>Dashboard</strong>"), 'email_notifications', true, $this->oPage, false, null, null, $aOptions);
  70 + $add_fields[] = new KTPasswordWidget(_('Password'), _('Specify an initial password for the user.'), 'password', null, $this->oPage, true, null, null, $aOptions);
  71 + $add_fields[] = new KTPasswordWidget(_('Confirm Password'), _('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true, null, null, $aOptions);
70 72 // nice, easy bits.
71   - $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. <strong>999 9999 999</strong>"), 'mobile_number', null, $this->oPage, false);
72   - $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);
  73 + $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. <strong>999 9999 999</strong>"), 'mobile_number', null, $this->oPage, false, null, null, $aOptions);
  74 + $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);
73 75  
74 76 $aAuthenticationSources =& KTAuthenticationSource::getList();
75 77  
... ...
plugins/ktcore/authentication/authenticationadminpage.inc.php
... ... @@ -4,13 +4,15 @@ require_once(KT_LIB_DIR . &#39;/dispatcher.inc.php&#39;);
4 4 require_once(KT_LIB_DIR . '/authentication/authenticationproviderregistry.inc.php');
5 5 require_once(KT_LIB_DIR . '/authentication/authenticationsource.inc.php');
6 6  
  7 +require_once(KT_LIB_DIR . '/widgets/fieldWidgets.php');
  8 +
7 9 class KTAuthenticationAdminPage extends KTAdminDispatcher {
8 10 function do_main() {
9 11 $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']);
10 12 $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/manage');
11 13 $fields = array();
12 14  
13   - $fields[] = new KTStringWidget(_('Name'), 'FIXME', 'name', "", $this->oPage, true);
  15 + $fields[] = new KTStringWidget(_('Name'), _('A short name which helps identify this source of authentication data.'), 'name', "", $this->oPage, true);
14 16  
15 17 $aVocab = array();
16 18 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
... ... @@ -19,7 +21,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
19 21 $aVocab[$aProvider[2]] = $aProvider[0];
20 22 }
21 23 $fieldOptions = array("vocab" => $aVocab);
22   - $fields[] = new KTLookupWidget(_('Authentication provider'), 'FIXME', 'authentication_provider', null, $this->oPage, true, null, $fieldErrors, $fieldOptions);
  24 + $fields[] = new KTLookupWidget(_('Authentication provider'), _('The type of source (e.g. <strong>LDAP</strong>)'), 'authentication_provider', null, $this->oPage, true, null, $fieldErrors, $fieldOptions);
23 25  
24 26 $aSources = KTAuthenticationSource::getList();
25 27  
... ...
preferences.php
... ... @@ -27,12 +27,13 @@ class PreferencesDispatcher extends KTStandardDispatcher {
27 27  
28 28 $oUser =& $this->oUser;
29 29  
  30 + $aOptions = array('autocomplete' => false);
30 31  
31 32 $edit_fields = array();
32   - $edit_fields[] = new KTStringWidget(_('Name'),_('Your full name. This is shown in reports and listings. e.g. <strong>John Smith</strong>'), 'name', $oUser->getName(), $this->oPage, true);
33   - $edit_fields[] = new KTStringWidget(_('Email Address'),_('Your email address. Notifications and alerts are mailed to this address if <strong>email notifications</strong> is set below. e.g. <strong>jsmith@acme.com</strong>'), 'email_address', $oUser->getEmail(), $this->oPage, false);
34   - $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 <strong>Dashboard</strong>'), 'email_notifications', $oUser->getEmailNotification(), $this->oPage, false);
35   - $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. <strong>+27 99 999 9999</strong>'), 'mobile_number', $oUser->getMobile(), $this->oPage, false);
  33 + $edit_fields[] = new KTStringWidget(_('Name'),_('Your full name. This is shown in reports and listings. e.g. <strong>John Smith</strong>'), 'name', $oUser->getName(), $this->oPage, true, null, null, $aOptions);
  34 + $edit_fields[] = new KTStringWidget(_('Email Address'),_('Your email address. Notifications and alerts are mailed to this address if <strong>email notifications</strong> is set below. e.g. <strong>jsmith@acme.com</strong>'), 'email_address', $oUser->getEmail(), $this->oPage, false, null, null, $aOptions);
  35 + $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 <strong>Dashboard</strong>'), 'email_notifications', $oUser->getEmailNotification(), $this->oPage, false, null, null, $aOptions);
  36 + $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. <strong>+27 99 999 9999</strong>'), 'mobile_number', $oUser->getMobile(), $this->oPage, false, null, null, $aOptions);
36 37  
37 38 $oTemplating = new KTTemplating;
38 39 $oTemplate = $oTemplating->loadTemplate("ktcore/principals/preferences");
... ... @@ -50,9 +51,11 @@ class PreferencesDispatcher extends KTStandardDispatcher {
50 51  
51 52 $oUser =& $this->oUser;
52 53  
  54 + $aOptions = array('autocomplete' => false);
  55 +
53 56 $edit_fields = array();
54   - $edit_fields[] = new KTPasswordWidget(_('Password'), _('Specify your new password.'), 'password', null, $this->oPage, true);
55   - $edit_fields[] = new KTPasswordWidget(_('Confirm Password'), _('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true);
  57 + $edit_fields[] = new KTPasswordWidget(_('Password'), _('Specify your new password.'), 'password', null, $this->oPage, true, null, null, $aOptions);
  58 + $edit_fields[] = new KTPasswordWidget(_('Confirm Password'), _('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true, null, null, $aOptions);
56 59  
57 60  
58 61 $oTemplating = new KTTemplating;
... ...
resources/css/kt-framing.css
... ... @@ -183,11 +183,25 @@ a.main_nav_item {
183 183 {
184 184 margin: 0 0 1.5em 0;
185 185 border: 0;
186   - padding: 0;
  186 + padding: 0 0 0.5em;
187 187 border: 1px solid #888;
188 188 background: #f3f3f3;
189 189 }
190 190  
  191 +#portletbar .portlet a {
  192 + text-decoration: none;
  193 + border-bottom: 1px solid blue;
  194 +}
  195 +
  196 +#portletbar .portlet a:visited {
  197 + border-bottom: 1px solid purple;
  198 +}
  199 +
  200 +#portletbar .portlet a:hover {
  201 + color: red;
  202 + border-bottom: 1px solid red;
  203 +}
  204 +
191 205 #portletbar .portlet h4
192 206 {
193 207 margin: 0;
... ... @@ -212,7 +226,7 @@ a.main_nav_item {
212 226 {
213 227 display: block;
214 228 padding: 0;
215   - margin: 0.15em 0.5em 0.15em 0;
  229 + margin: 0.5em 0.5em 0.15em 0;
216 230 text-align: right;
217 231 border: 0;
218 232 }
... ... @@ -663,3 +677,9 @@ The text will be hidden for screen view. The generic fahrner-ish approach comes
663 677 color: #999;
664 678 font-size: small;
665 679 }
  680 +
  681 +hr {
  682 + border-width: 1px 0 0 0;
  683 + border-style: solid;
  684 + border-color: #888;
  685 +}
666 686 \ No newline at end of file
... ...
search/booleanSearch.php
... ... @@ -40,6 +40,7 @@ class BooleanSearchDispatcher extends KTStandardDispatcher {
40 40 }
41 41  
42 42 function do_performSearch() {
  43 + $title = _('Advanced Search Results');
43 44 $datavars = KTUtil::arrayGet($_REQUEST, 'boolean_search');
44 45 if (!is_array($datavars)) {
45 46 $datavars = unserialize($datavars);
... ... @@ -52,20 +53,25 @@ class BooleanSearchDispatcher extends KTStandardDispatcher {
52 53 if (!empty($iSavedSearchId)) {
53 54 $oSearch = KTSavedSearch::get($iSavedSearchId);
54 55 $datavars = $oSearch->getSearch();
  56 + $title = _('Saved Search: ') . $oSearch->getName();
55 57 }
56 58  
57 59 if (empty($datavars)) {
58 60 $this->errorRedirectToMain(_('You need to have at least 1 condition.'));
59 61 }
60   -
61   - $res = $this->handleCriteriaSet($datavars, KTUtil::arrayGet($_REQUEST, 'fStartIndex', 1));
  62 +
  63 + $res = $this->handleCriteriaSet($datavars, KTUtil::arrayGet($_REQUEST, 'fStartIndex', 1), $title);
62 64  
63 65 return $res;
64 66 }
65 67  
66   - function handleCriteriaSet($aCriteriaSet, $iStartIndex) {
  68 + function handleCriteriaSet($aCriteriaSet, $iStartIndex, $sTitle=null) {
67 69 $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _("Boolean search"));
68   - $this->oPage->setBreadcrumbDetails(_('searching'));
  70 + if ($sTitle == null) {
  71 + $this->oPage->setBreadcrumbDetails(_('searching'));
  72 + } else {
  73 + $this->oPage->setBreadcrumbDetails($sTitle);
  74 + }
69 75 $collection = new DocumentCollection;
70 76 $this->browseType = "Folder";
71 77  
... ... @@ -106,6 +112,7 @@ class BooleanSearchDispatcher extends KTStandardDispatcher {
106 112 $aTemplateData = array(
107 113 "context" => $this,
108 114 "collection" => $collection,
  115 + "custom_title" => $sTitle,
109 116 );
110 117 return $oTemplate->render($aTemplateData);
111 118 }
... ...
templates/kt3/browse.smarty
... ... @@ -4,12 +4,20 @@
4 4  
5 5 {$context->oPage->requireJSResource('resources/js/toggleselect.js')}
6 6  
  7 +{if ($custom_title != null)}
  8 +<h2>{$custom_title}</h2>
  9 +{/if}
  10 +
7 11 <form action="{$smarty.server.PHP_SELF}" METHOD="POST">
8 12 <input type="hidden" name="action" value="startDelete" />
  13 +{if ($isEditable)}
9 14 <input type="hidden" name="fFolderid" value="{$context->oFolder->getId()}" />
  15 +{/if}
10 16 {$collection->render()}
  17 +{if ($isEditable)}
11 18 <div class="form_actions">
12 19 <input type="submit" name="submit[delete]" value="{i18n}Delete{/i18n}" />
13 20 </div>
  21 +{/if}
14 22 </form>
15 23 {* we break encapsulation pretty badly here. *}
16 24 \ No newline at end of file
... ...
templates/kt3/fields/base.smarty
... ... @@ -11,5 +11,5 @@
11 11 <p class="errorMessage"></p>
12 12 {/if}
13 13  
14   - <input type="text" name="{$name}" {if $has_id}id="{$id}"{/if} {if $has_value}value="{$value}"{/if}/><input type="hidden" name="kt_core_fieldsets_expect[{$name}]" value ="1" />
  14 + <input type="text" name="{$name}" {if $has_id}id="{$id}"{/if} {if $has_value}value="{$value}"{/if}{if ($options.autocomplete === false)}autocomplete="off"{/if}/><input type="hidden" name="kt_core_fieldsets_expect[{$name}]" value ="1" />
15 15 </div>
... ...
templates/kt3/portlets/search_portlet.smarty
1 1 <form action="{$rootUrl}/search/simpleSearch.php" method="GET">
2 2 <input type="text" name="fSearchableText" id="portlet-search-text" size="15" /><input type="submit" value="{i18n}search{/i18n}" class="searchbutton" />
3 3 </form>
  4 +
  5 +{if (!empty($saved_searches))}
  6 +<h4>Saved Searches</h4>
4 7 <ul class="actionlist">
5   -<li><a href="{$rootUrl}/search/booleanSearch.php">{i18n}Boolean Search{/i18n}</a></li>
  8 +{foreach item=oSearch from=$saved_searches}
  9 +<li><a href="{"booleanSearch"|generateControllerUrl}&qs[action]=performSearch&qs[fSavedSearchId]={$oSearch->getId()}">{$oSearch->getName()}</a></li>
  10 +{/foreach}
  11 +</ul>
  12 +<hr />
  13 +{/if}
  14 +<ul class="actionlist">
  15 +<li><a href="{$rootUrl}/search/booleanSearch.php">{i18n}Advanced Search{/i18n}</a></li>
6 16 </ul>
... ...
templates/ktcore/authentication/manage.smarty
1 1 <h2>{i18n}Authentication Sources{/i18n}</h2>
2 2  
  3 +<p class="descriptiveText">{i18n}By default, KnowledgeTree controls its
  4 +own users and groups and stores all information about them inside the database.
  5 +In many situations, an organisation will already have a list of users and groups,
  6 +and needs to use that existing information to allow access to the DMS.
  7 +These <strong>Authentication Sources</strong> allow the system administrator to
  8 +specify additional sources of authentication data.{/i18n}</p>
  9 +
3 10 {if $providers}
4 11 <form method="POST">
5 12 <fieldset><legend>{i18n}Add an authentication source{/i18n}</legend>
... ... @@ -14,6 +21,10 @@
14 21 </div>
15 22 </fieldset>
16 23 </form>
  24 +{else}
  25 +<div class="ktInfo"><p>{i18n}Only the standard database authentication is currently available.
  26 +If you need to use a different authentication type (e.g. LDAP) you will need to
  27 +ensure that the Plugin is enabled.{/i18n}<p></div>
17 28 {/if}
18 29  
19 30 {if $sources}
... ... @@ -24,5 +35,7 @@
24 35 <li><a href="?action=viewsource&source_id={$oSource->getId()}">{$oSource->getName()}</a></li>
25 36 {/foreach}
26 37 </ul>
  38 +{else}
  39 +<div class="ktInfo"><p>{i18n}No additional authentication sources have been defined.{/i18n}</p></div>
27 40 {/if}
28 41  
... ...
templates/ktcore/documenttypes/edit.smarty
... ... @@ -39,7 +39,7 @@
39 39 </fieldset>
40 40 </form>
41 41 {else}
42   -<p>{i18n}No fieldsets are currently associated with this type.{/i18n}</p>
  42 +<div class="ktInfo"><p>{i18n}No fieldsets are currently associated with this type.{/i18n}</p></div>
43 43 { /if }
44 44  
45 45 { if $aAvailableFieldsets }
... ... @@ -59,5 +59,6 @@
59 59 </form>
60 60  
61 61 {else}
62   -<p>{i18n}There are no fieldsets available for adding.{/i18n} <strong>FIXME link to fieldset creation from here.</strong></p>
  62 +<div class="ktInfo"><p>{i18n}No fieldsets are available to be added. To add a fieldset, please go to
  63 +DMS Administration{/i18n} &raquo; {i18n}Document Metadata and Workflow Configuration{/i18n} &raquo {i18n}Document Field Management{/i18n} </p></div>
63 64 { /if }
... ...
templates/ktcore/metadata/conditional/editcomplex.smarty
... ... @@ -103,14 +103,17 @@ false;&quot;&gt;{i18n}Change Assignments for this field.{/i18n}&lt;/a&gt;
103 103 </tbody>
104 104 </table>
105 105  
106   -
  106 +<!--
107 107 <table id="brad-log">
  108 +<thead>
108 109 <tr>
109 110 <th>Severity</th>
110 111 <th>Time</th>
111 112 <th>Entry</th>
112 113 </tr>
  114 +</thead>
113 115 <tbody >
114 116  
115 117 </tbody>
116 118 </table>
  119 +-->
117 120 \ No newline at end of file
... ...
templates/ktcore/search/administration/savedsearches.smarty
1   -<h1>{i18n}Saved searches{/i18n}</h1>
  1 +<h2>{i18n}Saved searches{/i18n}</h2>
  2 +
  3 +<p class="descriptiveText">{i18n}Saved searches are searches which are particular to your location
  4 +For example, you could define a search which returns all documents in a particular workflow state,
  5 +or all documents which are considered "common" within your organisation (leave policy,
  6 +newsletters, etc.) based on a category or fieldset value.{/i18n}</p>
2 7  
3   -<h2>{i18n}Create a new saved search{/i18n}</h2>
4 8 <form action="{$smarty.server.PHP_SELF}" method="POST">
  9 +<fieldset>
  10 +<legend>{i18n}Create a new saved search{/i18n}</legend>
  11 +<div class="form_actions">
5 12 <input type="hidden" name="action" value="new" />
6 13 <input type="submit" name="submit" value="{i18n}New{/i18n}" />
  14 +</div>
  15 +</fieldset>
7 16 </form>
8 17  
9 18 {if $saved_searches}
10   -<h2>{i18n}Edit existing saved searches{/i18n}</h2>
11   -<form action="{$smarty.server.PHP_SELF}" method="POST">
12   -<input type="hidden" name="action" value="edit" />
13   -{entity_radios entities=$saved_searches name="fSavedSearchId" assign=aRadios}
14   -{foreach from=$aRadios item=sRadio}
15   -{$sRadio}<br />
16   -{/foreach}
17   -<input type="submit" name="submit" value="{i18n}Edit{/i18n}" />
18   -</form>
  19 +<h2>{i18n}Existing Searches{/i18n}</h2>
19 20  
20   -<h2>{i18n}Run a saved search{/i18n}</h2>
21   -<form action="{"booleanSearch"|generateControllerUrl}" method="GET">
22   -<input type="hidden" name="action" value="booleanSearch" />
23   -<input type="hidden" name="qs[action]" value="performSearch" />
24   -{entity_radios entities=$saved_searches name="qs[fSavedSearchId]" assign=aRadios}
25   -{foreach from=$aRadios item=sRadio}
26   -{$sRadio}<br />
  21 +<table class="listing">
  22 +<thead>
  23 + <tr>
  24 + <th>{i18n}Search Name{/i18n}</th>
  25 + <th>{i18n}Edit{/i18n}</th>
  26 + <th>{i18n}Delete{/i18n}</th>
  27 + <th>{i18n}View Results{/i18n}</th>
  28 + </tr>
  29 +</thead>
  30 +<tbody>
  31 +{foreach item=oSearch from=$saved_searches}
  32 + <tr>
  33 + <td>{$oSearch->getName()}</td>
  34 + <td><a href="{$smarty.server.PHP_SELF}?action=edit&fSavedSearchId={$oSearch->getId()}" class="ktAction ktEdit">Edit</a></td>
  35 + <td><a href="{$smarty.server.PHP_SELF}?action=delete&fSavedSearchId={$oSearch->getId()}" class="ktAction ktDelete">Edit</a></td>
  36 + <td><a href="{"booleanSearch"|generateControllerUrl}&qs[action]=performSearch&qs[fSavedSearchId]={$oSearch->getId()}">Run Search</a></td>
  37 + </tr>
27 38 {/foreach}
28   -<input type="submit" name="submit" value="{i18n}Run{/i18n}" />
29   -</form>
  39 +</tbody>
  40 +</table>
  41 +{else}
  42 +<div class="ktInfo"><p>{i18n}No Saved Searches have been defined.{/i18n}</p></div>
30 43 {/if}
31   -
... ...