Commit eea1136e8055c6c33b6e82cda50eec545e058cf6

Authored by kevin_fourie
1 parent 4d6f1784

Merged in from DEV trunk...

Version change to 3.5.2a for bugfix release.

KTS-3150
"WebDAV Interface - "&" in folder names causes error"
Fixed. Replaced the & with %26.

Committed by: Megan Watson
Reviewed by: Isaac Lundall

KTS-3156
"Fix incorrect fonts in 3.5.2"
Fixed.

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

KTS-3157
"Fieldset fields aren't being sorted alphabetically when editing the metadata"
Fixed. Added the sort into the getByFieldset function that gets used everywhere.

Committed By: Megan Watson
Reviewed By: Conrad Vermeulen

KTS-3022
"Change the plugins to use relative paths"
Fixed. On setup the plugins and plugin helpers now call fixfilename which finds the correct relative paths. Fixed the ktutil function isAbsolutePath.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@8253 c91229c3-7414-0410-bfa2-8a42b809f60b
docs/VERSION-NAME.txt
1   -3.5.3 beta1
  1 +3.5.2a
... ...
docs/VERSION-OSS.txt
1   -3.5.3 beta1
  1 +3.5.2a
... ...
docs/VERSION.txt
1   -3.5.3 beta1
  1 +3.5.2
... ...
ktwebdav/lib/KTWebDAVServer.inc.php
... ... @@ -585,6 +585,8 @@ class KTWebDAVServer extends HTTP_WebDAV_Server
585 585 if($this->dav_client == 'MC'){
586 586 $path = str_replace('%2F', '/', urlencode($path));
587 587 }
  588 + $path = str_replace('&', '%26', $path);
  589 +
588 590 $info = array();
589 591 $info["path"] = $path;
590 592 $info["props"] = array();
... ... @@ -666,6 +668,8 @@ class KTWebDAVServer extends HTTP_WebDAV_Server
666 668 if($this->dav_client == 'MC'){
667 669 $path = str_replace('%2F', '/', urlencode(utf8_encode($path)));
668 670 }
  671 + $path = str_replace('&', '%26', $path);
  672 +
669 673 // create result array
670 674 $info = array();
671 675 $info["path"] = $path;
... ...
lib/documentmanagement/DocumentField.inc
... ... @@ -41,6 +41,21 @@ require_once(KT_LIB_DIR . '/metadata/metadatautil.inc.php');
41 41 require_once(KT_LIB_DIR . '/documentmanagement/DocumentType.inc');
42 42 require_once(KT_LIB_DIR . "/util/sanitize.inc");
43 43  
  44 +/**
  45 + * Compare the fields within a fieldset for alphabetising.
  46 + *
  47 + * @param object $a
  48 + * @param object $b
  49 + * @return integer
  50 + */
  51 +function compareFields($a, $b)
  52 +{
  53 + if ($a->getName() == $b->getName()) return 0;
  54 + if ($a->getName() < $b->getName()) return -1;
  55 + return 1;
  56 +}
  57 +
  58 +
44 59 class DocumentField extends KTEntity {
45 60  
46 61 /** primary key value */
... ... @@ -130,11 +145,20 @@ class DocumentField extends KTEntity {
130 145 } else {
131 146 $iFieldsetId = $oFieldset;
132 147 }
133   - return KTEntityUtil::getByDict('DocumentField', array(
  148 + $aFields = KTEntityUtil::getByDict('DocumentField', array(
134 149 'parent_fieldset' => $iFieldsetId,
135 150 ), array(
136 151 'multi' => true,
137 152 ));
  153 +
  154 + // Alphabetise the metadata fields within a fieldset if set in config
  155 + $oKTConfig =& KTConfig::getSingleton();
  156 + $use_sort = $oKTConfig->get('ui/metadata_sort', false);
  157 +
  158 + if($use_sort){
  159 + usort($aFields, 'compareFields');
  160 + }
  161 + return $aFields;
138 162 }
139 163  
140 164 function &getByFieldsetAndName($oFieldset, $sName) {
... ...
lib/plugins/plugin.inc.php
... ... @@ -213,11 +213,12 @@ class KTPlugin {
213 213 }
214 214  
215 215 function registerHelpLanguage($sPlugin, $sLanguage, $sBasedir) {
  216 + $sBasedir = (!empty($sBasedir)) ? $this->_fixFilename($sBasedir) : '';
216 217 $this->_aHelpLanguage[$sLanguage] = array($sPlugin, $sLanguage, $sBasedir);
217 218  
218 219 // Register helper in DB
219 220 $params = $sPlugin.'|'.$sLanguage.'|'.$sBasedir;
220   - $this->registerPluginHelper($sLanguage, $sClassName, $sFilename, $params, 'general', 'help_language');
  221 + $this->registerPluginHelper($sLanguage, $sClassName, '', $params, 'general', 'help_language');
221 222 }
222 223  
223 224 function registerColumn($sName, $sNamespace, $sClassName, $sFile) {
... ... @@ -363,7 +364,11 @@ class KTPlugin {
363 364 $sFilename = sprintf("%s/%s", $sDirPath, $sFilename);
364 365 }
365 366 }
  367 +
  368 + $sKtDir = str_replace('\\', '/', KT_DIR);
  369 + $sFilename = realpath($sFilename);
366 370 $sFilename = str_replace('\\', '/', $sFilename);
  371 + $sFilename = str_replace($sKtDir.'/', '', $sFilename);
367 372 return $sFilename;
368 373 }
369 374  
... ... @@ -652,7 +657,7 @@ class KTPlugin {
652 657 function run_setup() {
653 658 return true;
654 659 }
655   -
  660 +
656 661 function setAvailability($sNamespace, $bAvailable = true){
657 662 $aValues = array('unavailable' => $bAvailable);
658 663 $aWhere = array('namespace' => $sNamespace);
... ... @@ -767,6 +772,7 @@ class KTPlugin {
767 772 }
768 773 return $path;
769 774 }
  775 +
770 776 }
771 777  
772 778 ?>
773 779 \ No newline at end of file
... ...
lib/plugins/pluginregistry.inc.php
... ... @@ -54,6 +54,7 @@ class KTPluginRegistry {
54 54 * @param unknown_type $sFilename
55 55 */
56 56 function registerPlugin($sClassName, $sNamespace, $sFilename = null) {
  57 + $sFilename = (!empty($sFilename)) ? KTPlugin::_fixFilename($sFilename) : '';
57 58 $this->_aPluginDetails[$sNamespace] = array($sClassName, $sNamespace, $sFilename);
58 59  
59 60 $object = $sClassName.'|'.$sNamespace.'|'.$sFilename;
... ... @@ -66,15 +67,9 @@ class KTPluginRegistry {
66 67 }
67 68 $aDetails = KTUtil::arrayGet($this->_aPluginDetails, $sNamespace);
68 69 if (empty($aDetails)) {
69   - // plugin hasn't been registered - check the DB
70   -// $query = "SELECT * FROM plugin_helper WHERE namespace = '{$sNamespace}'";
71   -// $plugin = DBUtil::getOneResult($query);
72   -// if(empty($plugin)){
73 70 return null;
74   -// }
75   -// $aDetails = explode('|', $plugin['object']);
76 71 }
77   - $sFilename = $aDetails[2];
  72 + $sFilename = KT_DIR.'/'.$aDetails[2];
78 73 if (!empty($sFilename)) {
79 74 require_once($sFilename);
80 75 }
... ...
lib/plugins/pluginutil.inc.php
... ... @@ -178,7 +178,7 @@ class KTPluginUtil {
178 178  
179 179 $query = "SELECT h.classname, h.pathname, h.plugin FROM plugin_helper h
180 180 INNER JOIN plugins p ON (p.namespace = h.plugin)
181   - WHERE p.disabled = 0 AND h.viewtype='{$sType}' AND h.classtype='plugin' ORDER BY p.orderby";
  181 + WHERE p.disabled = 0 AND h.classtype='plugin' ORDER BY p.orderby";
182 182 $aPluginHelpers = DBUtil::getResultArray($query);
183 183 }
184 184  
... ... @@ -188,15 +188,16 @@ class KTPluginUtil {
188 188 $path = $aItem['pathname'];
189 189  
190 190 if (!empty($path)) {
  191 + $path = KT_DIR.'/'.$path;
191 192 require_once($path);
192   - }
193 193  
194   - $oPlugin = new $classname($path);
195   - if($oPlugin->load()){
196   - $aPlugins[] = $oPlugin;
197   - }else{
198   - $aDisabled[] = "'{$aItem['plugin']}'";
199   - }
  194 + $oPlugin = new $classname($path);
  195 + if($oPlugin->load()){
  196 + $aPlugins[] = $oPlugin;
  197 + }else{
  198 + $aDisabled[] = "'{$aItem['plugin']}'";
  199 + }
  200 + }
200 201 }
201 202  
202 203 $sDisabled = implode(',', $aDisabled);
... ...
lib/util/ktutil.inc
... ... @@ -795,6 +795,10 @@ class KTUtil {
795 795 $sPath = str_replace('\\', '/', $sPath);
796 796 $sReal = str_replace('\\', '/', realpath($sPath));
797 797  
  798 + if(substr($sPath, -1, 1) == '/'){
  799 + $sReal .= '/';
  800 + }
  801 +
798 802 return (strtolower($sReal) == strtolower($sPath));
799 803  
800 804 if (substr($sPath, 0, 1) == '/') {
... ...
thirdpartyjs/extjs/examples/examples.css
1   -/*
2   - * Ext JS Library 1.1 Beta 1
3   - * Copyright(c) 2006-2007, Ext JS, LLC.
4   - * licensing@extjs.com
5   - *
6   - * http://www.extjs.com/license
7   - */
8   -
9   -body {
10   - font-family:verdana,tahoma,helvetica;
11   - padding:20px;
12   - padding-top:32px;
13   - font-size:13px;
14   - background-color:#fff !important;
15   -}
16   -p {
17   - margin-bottom:15px;
18   -}
19   -h1 {
20   - font-size:large;
21   - margin-bottom:20px;
22   -}
23   -.example-info{
24   - width:150px;
25   - border:1px solid #c3daf9;
26   - border-top:1px solid #DCEAFB;
27   - border-left:1px solid #DCEAFB;
28   - background:#ecf5fe url(info-bg.gif) repeat-x;
29   - font-size:10px;
30   - padding:8px;
31   -}
32   -pre.code{
33   - background: #F8F8F8;
34   - border: 1px solid #e8e8e8;
35   - padding:10px;
36   - margin:10px;
37   - margin-left:0px;
38   - border-left:5px solid #e8e8e8;
39   - font-size: 12px !important;
40   - line-height:14px !important;
41   -}
42   -.msg .x-box-mc {
43   - font-size:14px;
44   -}
45   -#msg-div {
46   - position:absolute;
47   - left:35%;
48   - top:10px;
49   - width:250px;
50   - z-index:20000;
51   -}
52   -.x-grid3-row-body p {
53   - margin:5px 5px 10px 5px !important;
54   -}
  1 +/*
  2 + * Ext JS Library 1.1 Beta 1
  3 + * Copyright(c) 2006-2007, Ext JS, LLC.
  4 + * licensing@extjs.com
  5 + *
  6 + * http://www.extjs.com/license
  7 + */
  8 +
  9 +
  10 +.example-info{
  11 + width:150px;
  12 + border:1px solid #c3daf9;
  13 + border-top:1px solid #DCEAFB;
  14 + border-left:1px solid #DCEAFB;
  15 + background:#ecf5fe url(info-bg.gif) repeat-x;
  16 + font-size:10px;
  17 + padding:8px;
  18 +}
  19 +pre.code{
  20 + background: #F8F8F8;
  21 + border: 1px solid #e8e8e8;
  22 + padding:10px;
  23 + margin:10px;
  24 + margin-left:0px;
  25 + border-left:5px solid #e8e8e8;
  26 + font-size: 12px !important;
  27 + line-height:14px !important;
  28 +}
  29 +.msg .x-box-mc {
  30 + font-size:14px;
  31 +}
  32 +#msg-div {
  33 + position:absolute;
  34 + left:35%;
  35 + top:10px;
  36 + width:250px;
  37 + z-index:20000;
  38 +}
  39 +.x-grid3-row-body p {
  40 + margin:5px 5px 10px 5px !important;
  41 +}
... ...