Commit 70e29b30f6b8ff627b6f5738f4fcf4b9dbd6e4c7

Authored by Kevin Fourie
1 parent 98de76f4

KTS-3057

"Cleanup link on System Folder Utilization dashlet points to an non-existing url"
Fixed. Cleaned up Url creation for Windows.

Committed By: Kevin Fourie
Reviewed By: Conrad Vermeulen

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8133 c91229c3-7414-0410-bfa2-8a42b809f60b
bin/openoffice/pdfgen.py
... ... @@ -84,7 +84,7 @@ except RuntimeException, e:
84 84 sys.stderr.write("An unknown error occured: " + e.Message + "\n")
85 85  
86 86 if doc == None:
87   - sys.stderr.write("OpenOffice could not load the document for conversion. This could indicate an unsupported minetype.\n")
  87 + sys.stderr.write("The document could not be opened for conversion. This could indicate an unsupported mimetype.\n")
88 88 sys.exit(1)
89 89  
90 90  
... ... @@ -100,5 +100,14 @@ p.Value = 'writer_pdf_Export'
100 100 properties.append(p)
101 101 properties = tuple(properties)
102 102  
103   -doc.storeToURL(url_save, properties)
104   -doc.dispose()
  103 +try:
  104 + doc.storeToURL(url_save, properties)
  105 + doc.dispose()
  106 +except IOException, e:
  107 + sys.stderr.write("URL (" + url_save + ") couldn't be found or was corrupt (" + e.Message + ")\n")
  108 + sys.exit(1)
  109 +except IllegalArgumentException, e:
  110 + sys.stderr.write("Given parameters don't conform to the specification ( " + e.Message + ")\n")
  111 + sys.exit(1)
  112 +except RuntimeException, e:
  113 + sys.stderr.write("An unknown error occured: " + e.Message + "\n")
... ...
plugins/housekeeper/DiskUsageDashlet.inc.php
... ... @@ -145,7 +145,16 @@ class DiskUsageDashlet extends KTBaseDashlet
145 145 $oRegistry =& KTPluginRegistry::getSingleton();
146 146 $oPlugin =& $oRegistry->getPlugin('ktcore.housekeeper.plugin');
147 147  
  148 + $config = KTConfig::getSingleton();
  149 + $rootUrl = $config->get('KnowledgeTree/rootUrl');
  150 +
148 151 $dispatcherURL = $oPlugin->getURLPath('HouseKeeperDispatcher.php');
  152 + if (!empty($rootUrl)) $dispatcherURL .= $rootUrl . $dispatcherURL;
  153 + if ( substr( $dispatcherURL, 0,1 ) == '/' || substr( $dispatcherURL, 0,1 ) == '\\')
  154 + {
  155 + $dispatcherURL = substr($dispatcherURL,1);
  156 + }
  157 + $dispatcherURL = str_replace( '\\', '/', $dispatcherURL);
149 158  
150 159  
151 160 $aTemplateData = array(
... ...
plugins/housekeeper/FolderUsageDashlet.inc.php
... ... @@ -156,12 +156,13 @@ class FolderUsageDashlet extends KTBaseDashlet
156 156  
157 157 $dispatcherURL = $oPlugin->getURLPath('HouseKeeperDispatcher.php');
158 158 if (!empty($rootUrl)) $dispatcherURL .= $rootUrl . $dispatcherURL;
159   - if (substr($dispatcherURL, 0,1 ) == '/')
  159 + if ( substr( $dispatcherURL, 0,1 ) == '/' || substr( $dispatcherURL, 0,1 ) == '\\')
160 160 {
161 161 $dispatcherURL = substr($dispatcherURL,1);
162 162 }
163   -
164   - $this->getUsage();
  163 + $dispatcherURL = str_replace( '\\', '/', $dispatcherURL);
  164 +
  165 + $this->getUsage();
165 166  
166 167 $aTemplateData = array(
167 168 'context' => $this,
... ...