Commit 7441bdf5fa4871e4ed631e63177ad27cdc7c4dd6

Authored by kevin_fourie
1 parent 41d83abe

Merged in from STABLE trunk...

KTS-3459
"Make length of document and folder display names configurable."
Fixed. Added a new config setting to set the length.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.3a-Release-Branch@9254 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/ktcore/KTColumns.inc.php
... ... @@ -81,9 +81,12 @@ class AdvancedTitleColumn extends AdvancedColumn {
81 81 function renderFolderLink($aDataRow) {
82 82 /* this check has to be done so that any titles longer than 40 characters is not displayed incorrectly.
83 83 as mozilla cannot wrap text without white spaces */
84   - if (mb_strlen($aDataRow["folder"]->getName(), 'UTF-8') > 40) {
  84 + global $default;
  85 + $charLength = (isset($default->titleCharLength)) ? $default->titleCharLength : 40;
  86 +
  87 + if (mb_strlen($aDataRow["folder"]->getName(), 'UTF-8') > $charLength) {
85 88 mb_internal_encoding("UTF-8");
86   - $outStr = htmlentities(mb_substr($aDataRow["folder"]->getName(), 0, 40, 'UTF-8')."...", ENT_NOQUOTES, 'UTF-8');
  89 + $outStr = htmlentities(mb_substr($aDataRow["folder"]->getName(), 0, $charLength, 'UTF-8')."...", ENT_NOQUOTES, 'UTF-8');
87 90 }else{
88 91 $outStr = htmlentities($aDataRow["folder"]->getName(), ENT_NOQUOTES, 'UTF-8');
89 92 }
... ... @@ -97,9 +100,12 @@ class AdvancedTitleColumn extends AdvancedColumn {
97 100 function renderDocumentLink($aDataRow) {
98 101 /* this check has to be done so that any titles longer than 40 characters is not displayed incorrectly.
99 102 as mozilla cannot wrap text without white spaces */
100   - if (mb_strlen($aDataRow["document"]->getName(), 'UTF-8') > 40) {
  103 + global $default;
  104 + $charLength = (isset($default->titleCharLength)) ? $default->titleCharLength : 40;
  105 +
  106 + if (mb_strlen($aDataRow["document"]->getName(), 'UTF-8') > $charLength) {
101 107 mb_internal_encoding("UTF-8");
102   - $outStr = htmlentities(mb_substr($aDataRow["document"]->getName(), 0, 40, 'UTF-8')."...", ENT_NOQUOTES, 'UTF-8');
  108 + $outStr = htmlentities(mb_substr($aDataRow["document"]->getName(), 0, $charLength, 'UTF-8')."...", ENT_NOQUOTES, 'UTF-8');
103 109 }else{
104 110 $outStr = htmlentities($aDataRow["document"]->getName(), ENT_NOQUOTES, 'UTF-8');
105 111 }
... ...
sql/mysql/install/data.sql
... ... @@ -269,7 +269,8 @@ INSERT INTO `config_settings` VALUES
269 269 (95, 'KnowledgeTree', 'Redirect To Browse View', 'Defines whether to redirect to the Browse view (Browse Documemts) on login, instead of the Dashboard.<br>Default is \'False\'. ', 'redirectToBrowse', 'default', 'false', 'boolean', NULL, 1),
270 270 (96, 'KnowledgeTree', 'Redirect To Browse View: Exceptions', 'Specifies that, when \'Redirect To Browse\' is set to \'True\' all users, except for the users listed in the text field below are redirected to the Browse view on log in. The users listed for this setting are directed to the KnowledgeTree Dashboard. To define exceptions, add user names in the text field as follows, e.g. admin, joebloggs, etc.', 'redirectToBrowseExceptions', '', '', '', NULL, 1),
271 271 (97, 'session', 'Allow Automatic Sign In', 'Defines whether to automatically create a user account on first login for any user who does not yet exist in the system. Default is \'False\'.', 'allowAutoSignup', 'default', 'false', 'boolean', '', 1),
272   -(98, 'ldapAuthentication', 'Create Groups Automatically', 'Defines whether to allow LDAP groups to be created automatically. Default is \'False\'.', 'autoGroupCreation', 'default', 'false', 'boolean', '', 1);
  272 +(98, 'ldapAuthentication', 'Create Groups Automatically', 'Defines whether to allow LDAP groups to be created automatically. Default is \'False\'.', 'autoGroupCreation', 'default', 'false', 'boolean', '', 1),
  273 +(99, 'browse', 'Truncate Document and Folder Titles in Browse View', 'Defines the length of the document or folder title displayed in the browse view.', 'titleCharLength', 'default', '40', 'numeric_string', '', 1);
273 274 /*!40000 ALTER TABLE `config_settings` ENABLE KEYS */;
274 275 UNLOCK TABLES;
275 276  
... ... @@ -1711,7 +1712,8 @@ INSERT INTO `upgrades` VALUES
1711 1712 (196,'func*3.5.3*0*removeOldSearchPlugins','Remove the old Search Plugins files','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
1712 1713 (197,'sql*3.5.3*0*3.5.3/add_autoinc.sql','Add auto increment to tables SQL.','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
1713 1714 (198,'func*3.5.3*0*addAutoIncrementToTables','Add auto increment.','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
1714   -(199,'upgrade*3.5.3*99*upgrade3.5.3','Upgrade from version 3.5.2 to 3.5.3','2008-03-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3');
  1715 +(199,'sql*3.5.3*0*3.5.3/length_config_setting.sql','Add configurable name length.','2008-07-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3'),
  1716 +(200,'upgrade*3.5.3*99*upgrade3.5.3','Upgrade from version 3.5.2 to 3.5.3','2008-03-30 00:00:00',1,'upgrade*3.5.3*99*upgrade3.5.3');
1715 1717 /*!40000 ALTER TABLE `upgrades` ENABLE KEYS */;
1716 1718 UNLOCK TABLES;
1717 1719  
... ... @@ -2642,7 +2644,7 @@ UNLOCK TABLES;
2642 2644 LOCK TABLES `zseq_upgrades` WRITE;
2643 2645 /*!40000 ALTER TABLE `zseq_upgrades` DISABLE KEYS */;
2644 2646 INSERT INTO `zseq_upgrades` VALUES
2645   -(199);
  2647 +(200);
2646 2648 /*!40000 ALTER TABLE `zseq_upgrades` ENABLE KEYS */;
2647 2649 UNLOCK TABLES;
2648 2650  
... ...
sql/mysql/upgrade/3.5.3/length_config_setting.sql 0 → 100644
  1 +INSERT INTO `config_settings` (group_name, display_name, description, item, value, default_value, type, options, can_edit) VALUES
  2 +('browse', 'Truncate Document and Folder Titles in Browse View', 'Defines the length of the document or folder title displayed in the
  3 +browse view.', 'titleCharLength', 'default', '40', 'numeric_string', '', 1);
0 4 \ No newline at end of file
... ...