Commit 61adf64a0433d630d668e92f2c57344d836c0e8e

Authored by Megan Watson
1 parent 0aaf309a

KTS-2746

"CLONE -Put the custom metadata fields in alphabetical order(SUP-304)"
Fixed. Added a new config under ui. Put a usort on the fields.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7781 c91229c3-7414-0410-bfa2-8a42b809f60b
config/config.ini
@@ -135,6 +135,9 @@ fakeMimetype = default @@ -135,6 +135,9 @@ fakeMimetype = default
135 ; "dot" command location 135 ; "dot" command location
136 dot = dot 136 dot = dot
137 137
  138 +; sort the metadata fields alphabetically
  139 +metadata_sort = true
  140 +
138 [i18n] 141 [i18n]
139 ; Default language for the interface 142 ; Default language for the interface
140 defaultLanguage = en 143 defaultLanguage = en
@@ -197,7 +200,7 @@ uiUrl = ${rootUrl}/presentation/lookAndFeel/knowledgeTree @@ -197,7 +200,7 @@ uiUrl = ${rootUrl}/presentation/lookAndFeel/knowledgeTree
197 200
198 ;dedicated feed url 201 ;dedicated feed url
199 ;dedicatedrsstitle = RSS Feed Title 202 ;dedicatedrsstitle = RSS Feed Title
200 -;dedicatedrssurl = 203 +;dedicatedrssurl =
201 204
202 ; files 205 ; files
203 stopwordsFile = ${fileSystemRoot}/config/stopwords.txt 206 stopwordsFile = ${fileSystemRoot}/config/stopwords.txt
lib/widgets/fieldsetDisplay.inc.php
@@ -5,32 +5,32 @@ @@ -5,32 +5,32 @@
5 * KnowledgeTree Open Source Edition 5 * KnowledgeTree Open Source Edition
6 * Document Management Made Simple 6 * Document Management Made Simple
7 * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited 7 * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited
8 - * 8 + *
9 * This program is free software; you can redistribute it and/or modify it under 9 * This program is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License version 3 as published by the 10 * the terms of the GNU General Public License version 3 as published by the
11 * Free Software Foundation. 11 * Free Software Foundation.
12 - * 12 + *
13 * This program is distributed in the hope that it will be useful, but WITHOUT 13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 * details. 16 * details.
17 - * 17 + *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 - * 20 + *
21 * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, 21 * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place,
22 * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. 22 * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com.
23 - * 23 + *
24 * The interactive user interfaces in modified source and object code versions 24 * The interactive user interfaces in modified source and object code versions
25 * of this program must display Appropriate Legal Notices, as required under 25 * of this program must display Appropriate Legal Notices, as required under
26 * Section 5 of the GNU General Public License version 3. 26 * Section 5 of the GNU General Public License version 3.
27 - * 27 + *
28 * In accordance with Section 7(b) of the GNU General Public License version 3, 28 * In accordance with Section 7(b) of the GNU General Public License version 3,
29 * these Appropriate Legal Notices must retain the display of the "Powered by 29 * these Appropriate Legal Notices must retain the display of the "Powered by
30 - * KnowledgeTree" logo and retain the original copyright notice. If the display of the 30 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
31 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices 31 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
32 - * must display the words "Powered by KnowledgeTree" and retain the original  
33 - * copyright notice. 32 + * must display the words "Powered by KnowledgeTree" and retain the original
  33 + * copyright notice.
34 * Contributor( s): ______________________________________ 34 * Contributor( s): ______________________________________
35 * 35 *
36 */ 36 */
@@ -45,20 +45,20 @@ @@ -45,20 +45,20 @@
45 * "document_id" => $iDocumentId 45 * "document_id" => $iDocumentId
46 * 46 *
47 */ 47 */
48 - 48 +
49 // boilerplate 49 // boilerplate
50 -require_once(KT_LIB_DIR . "/templating/templating.inc.php");  
51 -require_once(KT_LIB_DIR . "/database/dbutil.inc"); 50 +require_once(KT_LIB_DIR . '/templating/templating.inc.php');
  51 +require_once(KT_LIB_DIR . '/database/dbutil.inc');
52 52
53 -require_once(KT_LIB_DIR . "/documentmanagement/MDTree.inc"); // :( 53 +require_once(KT_LIB_DIR . '/documentmanagement/MDTree.inc'); // :(
54 54
55 55
56 56
57 // data acquisition 57 // data acquisition
58 -require_once(KT_LIB_DIR . "/users/User.inc"); 58 +require_once(KT_LIB_DIR . '/users/User.inc');
59 require_once(KT_LIB_DIR . '/documentmanagement/MetaData.inc'); 59 require_once(KT_LIB_DIR . '/documentmanagement/MetaData.inc');
60 -require_once(KT_LIB_DIR . "/widgets/FieldsetDisplayRegistry.inc.php");  
61 -require_once(KT_LIB_DIR . "/widgets/fieldWidgets.php"); 60 +require_once(KT_LIB_DIR . '/widgets/FieldsetDisplayRegistry.inc.php');
  61 +require_once(KT_LIB_DIR . '/widgets/fieldWidgets.php');
62 62
63 63
64 /* it may be useful to move this to a factory, eventually? */ 64 /* it may be useful to move this to a factory, eventually? */
@@ -77,9 +77,9 @@ function getWidgetForMetadataField($field, $current_value, $page, $errors = null @@ -77,9 +77,9 @@ function getWidgetForMetadataField($field, $current_value, $page, $errors = null
77 if ($errors === null) { 77 if ($errors === null) {
78 $fieldErrors = array(); 78 $fieldErrors = array();
79 } else { 79 } else {
80 - $fieldErrors = $errors; 80 + $fieldErrors = $errors;
81 } 81 }
82 - 82 +
83 83
84 // now we need to break, based on a few aspects of the oField (DocumentField) 84 // now we need to break, based on a few aspects of the oField (DocumentField)
85 if ($field->getHasLookup()) { 85 if ($field->getHasLookup()) {
@@ -90,34 +90,47 @@ function getWidgetForMetadataField($field, $current_value, $page, $errors = null @@ -90,34 +90,47 @@ function getWidgetForMetadataField($field, $current_value, $page, $errors = null
90 // extract the lookup. 90 // extract the lookup.
91 if ($vocab === null) { // allow override 91 if ($vocab === null) { // allow override
92 $lookups = MetaData::getEnabledByDocumentField($field); 92 $lookups = MetaData::getEnabledByDocumentField($field);
93 - $fieldOptions["vocab"] = array(); // FIXME handle lookups  
94 - $fieldOptions['vocab'][''] = _kt('Select a value'); 93 + $fieldOptions['vocab'] = array(); // FIXME handle lookups
  94 + $fieldOptions['vocab'][''] = _kt('Select a value');
95 foreach ($lookups as $md) { 95 foreach ($lookups as $md) {
96 - $fieldOptions["vocab"][$md->getName()] = $md->getName(); 96 + $fieldOptions['vocab'][$md->getName()] = $md->getName();
97 } 97 }
98 } else { 98 } else {
99 - $fieldOptions["vocab"] = $vocab; 99 + $fieldOptions['vocab'] = $vocab;
100 } 100 }
101 -  
102 - $oField = new KTLookupWidget($fieldLabel, $fieldDescription, $fieldName, $fieldValue, $page, $fieldRequired, null, $fieldErrors, $fieldOptions); 101 +
  102 + $oField = new KTLookupWidget($fieldLabel, $fieldDescription, $fieldName, $fieldValue, $page, $fieldRequired, null, $fieldErrors, $fieldOptions);
103 } else { 103 } else {
104 // FIXME vocab's are _not_ supported for tree-inputs. this means conditional-tree-widgets are not unsupported. 104 // FIXME vocab's are _not_ supported for tree-inputs. this means conditional-tree-widgets are not unsupported.
105 - 105 +
106 // for trees, we are currently brutal. 106 // for trees, we are currently brutal.
107 $fieldTree = new MDTree(); 107 $fieldTree = new MDTree();
108 $fieldTree->buildForField($field->getId()); 108 $fieldTree->buildForField($field->getId());
109 $fieldTree->setActiveItem($current_value); 109 $fieldTree->setActiveItem($current_value);
110 $fieldOptions['tree'] = $fieldTree->_evilTreeRenderer($fieldTree, $fieldName); 110 $fieldOptions['tree'] = $fieldTree->_evilTreeRenderer($fieldTree, $fieldName);
111 -  
112 - $oField = new KTTreeWidget($fieldLabel, $fieldDescription, $fieldName, $fieldValue, $page, $fieldRequired, null, $fieldErrors, $fieldOptions); 111 +
  112 + $oField = new KTTreeWidget($fieldLabel, $fieldDescription, $fieldName, $fieldValue, $page, $fieldRequired, null, $fieldErrors, $fieldOptions);
113 } 113 }
114 } else { 114 } else {
115 - $oField = new KTBaseWidget($fieldLabel, $fieldDescription, $fieldName, $fieldValue, $page, $fieldRequired, null, $fieldErrors, $fieldOptions); 115 + $oField = new KTBaseWidget($fieldLabel, $fieldDescription, $fieldName, $fieldValue, $page, $fieldRequired, null, $fieldErrors, $fieldOptions);
116 } 116 }
117 117
118 return $oField; 118 return $oField;
119 } 119 }
120 120
  121 +/**
  122 + * Compare the fields within a fieldset for alphabetising.
  123 + *
  124 + * @param object $a
  125 + * @param object $b
  126 + * @return integer
  127 + */
  128 +function compareFieldSetField($a, $b)
  129 +{
  130 + if ($a['field']->getName() == $b['field']->getName()) return 0;
  131 + if ($a['field']->getName() < $b['field']->getName()) return -1;
  132 + return 1;
  133 +}
121 134
122 // FIXME need to establish some kind of api to pass in i18n information. 135 // FIXME need to establish some kind of api to pass in i18n information.
123 class KTFieldsetDisplay { 136 class KTFieldsetDisplay {
@@ -126,33 +139,33 @@ class KTFieldsetDisplay { @@ -126,33 +139,33 @@ class KTFieldsetDisplay {
126 function KTFieldsetDisplay($oFieldset) { 139 function KTFieldsetDisplay($oFieldset) {
127 $this->fieldset = $oFieldset; 140 $this->fieldset = $oFieldset;
128 } 141 }
129 - 142 +
130 143
131 function _dateHelper($dDate) { 144 function _dateHelper($dDate) {
132 $dColumnDate = strtotime($dDate); 145 $dColumnDate = strtotime($dDate);
133 - return date("Y-m-d H:i", $dColumnDate); 146 + return date('Y-m-d H:i', $dColumnDate);
134 } 147 }
135 -  
136 - 148 +
  149 +
137 function _sizeHelper($size) { 150 function _sizeHelper($size) {
138 $finalSize = $size; 151 $finalSize = $size;
139 $label = 'b'; 152 $label = 'b';
140 - 153 +
141 if ($finalSize > 1000) { $label='Kb'; $finalSize = floor($finalSize/1000); } 154 if ($finalSize > 1000) { $label='Kb'; $finalSize = floor($finalSize/1000); }
142 if ($finalSize > 1000) { $label='Mb'; $finalSize = floor($finalSize/1000); } 155 if ($finalSize > 1000) { $label='Mb'; $finalSize = floor($finalSize/1000); }
143 return $finalSize . $label; 156 return $finalSize . $label;
144 } 157 }
145 - 158 +
146 function _mimeHelper($iMimeTypeId) { 159 function _mimeHelper($iMimeTypeId) {
147 // FIXME lazy cache this. 160 // FIXME lazy cache this.
148 // FIXME extend mime_types to have something useful to say. 161 // FIXME extend mime_types to have something useful to say.
149 $sQuery = 'SELECT * FROM mime_types WHERE id = ?'; 162 $sQuery = 'SELECT * FROM mime_types WHERE id = ?';
150 $res = DBUtil::getOneResult(array($sQuery, array($iMimeTypeId))); 163 $res = DBUtil::getOneResult(array($sQuery, array($iMimeTypeId)));
151 - 164 +
152 if (PEAR::isError($res)) { 165 if (PEAR::isError($res)) {
153 return _kt('unknown type'); 166 return _kt('unknown type');
154 } 167 }
155 - 168 +
156 if (!empty($res['friendly_name'])) { 169 if (!empty($res['friendly_name'])) {
157 return _kt($res['friendly_name']); 170 return _kt($res['friendly_name']);
158 } else { 171 } else {
@@ -160,19 +173,19 @@ class KTFieldsetDisplay { @@ -160,19 +173,19 @@ class KTFieldsetDisplay {
160 } 173 }
161 174
162 } 175 }
163 -  
164 - 176 +
  177 +
165 // this should multiplex i18n_title 178 // this should multiplex i18n_title
166 function getTitle() { return $this->sTitle; } 179 function getTitle() { return $this->sTitle; }
167 - 180 +
168 function render($aDocumentData) { 181 function render($aDocumentData) {
169 return '<p class="ktError">Warning: Abstract Fieldset created.</p>'; 182 return '<p class="ktError">Warning: Abstract Fieldset created.</p>';
170 } 183 }
171 - 184 +
172 function renderComparison($aDocumentData, $aComparisonData) { 185 function renderComparison($aDocumentData, $aComparisonData) {
173 return '<div class="ktError">Not implemented: comparison rendering</div>'; 186 return '<div class="ktError">Not implemented: comparison rendering</div>';
174 } 187 }
175 - 188 +
176 // we need the $main to (potentially) add js, etc. 189 // we need the $main to (potentially) add js, etc.
177 function renderEdit($document_data) { 190 function renderEdit($document_data) {
178 return '<div class="ktError">Not Implemented: fieldset editing.</div>'; 191 return '<div class="ktError">Not Implemented: fieldset editing.</div>';
@@ -188,29 +201,29 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay { @@ -188,29 +201,29 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay {
188 201
189 // DON'T take anything. 202 // DON'T take anything.
190 function GenericFieldsetDisplay() { 203 function GenericFieldsetDisplay() {
191 - 204 +
192 } 205 }
193 - 206 +
194 function render($aDocumentData) { 207 function render($aDocumentData) {
195 // we do a fair bit of fetching, etc. in here. 208 // we do a fair bit of fetching, etc. in here.
196 - $document = $aDocumentData["document"]; 209 + $document = $aDocumentData['document'];
197 210
198 // creation 211 // creation
199 $creator =& User::get($document->getCreatorId()); 212 $creator =& User::get($document->getCreatorId());
200 if (PEAR::isError($creator)) { 213 if (PEAR::isError($creator)) {
201 - $creator_name = "<span class='ktError'>" . _kt("Unable to find the document's creator") . "</span>"; 214 + $creator_name = '<span class="ktError">' . _kt("Unable to find the document's creator") . '</span>';
202 } else { 215 } else {
203 $creator_name = $creator->getName(); 216 $creator_name = $creator->getName();
204 } 217 }
205 $owner =& User::get($document->getOwnerId()); 218 $owner =& User::get($document->getOwnerId());
206 if (PEAR::isError($owner)) { 219 if (PEAR::isError($owner)) {
207 - $owner_name = "<span class='ktError'>" . _kt("Unable to find the document's owner") . "</span>"; 220 + $owner_name = '<span class="ktError">' . _kt("Unable to find the document's owner") . '</span>';
208 } else { 221 } else {
209 $owner_name = $owner->getName(); 222 $owner_name = $owner->getName();
210 } 223 }
211 $modified_user =& User::get($document->getModifiedUserId()); 224 $modified_user =& User::get($document->getModifiedUserId());
212 if (PEAR::isError($modified_user)) { 225 if (PEAR::isError($modified_user)) {
213 - $modified_user_name = "<span class='ktError'>" . _kt("Unable to find the document's modifier") . "</span>"; 226 + $modified_user_name = '<span class="ktError">' . _kt("Unable to find the document's modifier") . '</span>';
214 } else { 227 } else {
215 $modified_user_name = $modified_user->getName(); 228 $modified_user_name = $modified_user->getName();
216 } 229 }
@@ -218,48 +231,48 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay { @@ -218,48 +231,48 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay {
218 231
219 // last mod 232 // last mod
220 $last_modified_date = $this->_dateHelper($document->getLastModifiedDate()); 233 $last_modified_date = $this->_dateHelper($document->getLastModifiedDate());
221 - 234 +
222 // document type // FIXME move this to view.php 235 // document type // FIXME move this to view.php
223 - $document_type = $aDocumentData["document_type"]->getName(); 236 + $document_type = $aDocumentData['document_type']->getName();
224 237
225 $oWorkflow = KTWorkflowUtil::getWorkflowForDocument($document); 238 $oWorkflow = KTWorkflowUtil::getWorkflowForDocument($document);
226 $oState = KTWorkflowUtil::getWorkflowStateForDocument($document); 239 $oState = KTWorkflowUtil::getWorkflowStateForDocument($document);
227 -  
228 -  
229 - $oTemplating =& KTTemplating::getSingleton();  
230 - $oTemplate = $oTemplating->loadTemplate("kt3/fieldsets/generic"); 240 +
  241 +
  242 + $oTemplating =& KTTemplating::getSingleton();
  243 + $oTemplate = $oTemplating->loadTemplate('kt3/fieldsets/generic');
231 $aTemplateData = array( 244 $aTemplateData = array(
232 - "context" => $this,  
233 - "document_data" => $aDocumentData,  
234 - "document" => $aDocumentData["document"],  
235 -  
236 - "filename" => $document->getFileName(),  
237 -  
238 - "creator" => $creator_name,  
239 - "owner" => $owner_name,  
240 - "creation_date" => $creation_date,  
241 -  
242 - "last_modified_by" => $modified_user_name,  
243 - "last_modified_date" => $last_modified_date,  
244 -  
245 - "document_type" => $document_type,  
246 -  
247 - "workflow_state" => $oState,  
248 - "workflow" => $oWorkflow, 245 + 'context' => $this,
  246 + 'document_data' => $aDocumentData,
  247 + 'document' => $aDocumentData['document'],
  248 +
  249 + 'filename' => $document->getFileName(),
  250 +
  251 + 'creator' => $creator_name,
  252 + 'owner' => $owner_name,
  253 + 'creation_date' => $creation_date,
  254 +
  255 + 'last_modified_by' => $modified_user_name,
  256 + 'last_modified_date' => $last_modified_date,
  257 +
  258 + 'document_type' => $document_type,
  259 +
  260 + 'workflow_state' => $oState,
  261 + 'workflow' => $oWorkflow,
249 ); 262 );
250 263
251 - return $oTemplate->render($aTemplateData); 264 + return $oTemplate->render($aTemplateData);
252 } 265 }
253 - 266 +
254 function renderComparison($aDocumentData, $aComparisonData) { 267 function renderComparison($aDocumentData, $aComparisonData) {
255 // we do a fair bit of fetching, etc. in here. 268 // we do a fair bit of fetching, etc. in here.
256 - $document = $aDocumentData["document"];  
257 - $comparison_document = $aComparisonData["document"]; 269 + $document = $aDocumentData['document'];
  270 + $comparison_document = $aComparisonData['document'];
258 271
259 // creation 272 // creation
260 $creator =& User::get($document->getCreatorId()); 273 $creator =& User::get($document->getCreatorId());
261 if (PEAR::isError($creator)) { 274 if (PEAR::isError($creator)) {
262 - $creator = "<span class='ktError'>" . _kt("Unable to find the document's creator") . "</span>"; 275 + $creator = '<span class="ktError">' . _kt("Unable to find the document's creator") . '</span>';
263 } else { 276 } else {
264 $creator = $creator->getName(); 277 $creator = $creator->getName();
265 } 278 }
@@ -268,30 +281,30 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay { @@ -268,30 +281,30 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay {
268 // last mod 281 // last mod
269 $last_modified_date = $this->_dateHelper($document->getVersionCreated()); 282 $last_modified_date = $this->_dateHelper($document->getVersionCreated());
270 $comparison_last_modified_date = $this->_dateHelper($comparison_document->getVersionCreated()); 283 $comparison_last_modified_date = $this->_dateHelper($comparison_document->getVersionCreated());
271 - 284 +
272 // document type // FIXME move this to view.php 285 // document type // FIXME move this to view.php
273 - $document_type = $aDocumentData["document_type"]->getName();  
274 - $comparison_document_type = $aComparisonData["document_type"]->getName();  
275 - 286 + $document_type = $aDocumentData['document_type']->getName();
  287 + $comparison_document_type = $aComparisonData['document_type']->getName();
  288 +
276 $modified_user =& User::get($document->getVersionCreatorId()); 289 $modified_user =& User::get($document->getVersionCreatorId());
277 if (PEAR::isError($modified_user)) { 290 if (PEAR::isError($modified_user)) {
278 - $modified_user = "<span class='ktError'>" . _kt("Unable to find the document's modifier") . "</span>"; 291 + $modified_user = "<span class='ktError'>" . _kt("Unable to find the document's modifier") . '</span>';
279 } else { 292 } else {
280 $modified_user = $modified_user->getName(); 293 $modified_user = $modified_user->getName();
281 } 294 }
282 295
283 $owner_user =& User::get($document->getOwnerId()); 296 $owner_user =& User::get($document->getOwnerId());
284 if (PEAR::isError($owner_user)) { 297 if (PEAR::isError($owner_user)) {
285 - $owner_user = "<span class='ktError'>" . _kt("Unable to find the document's owner") . "</span>"; 298 + $owner_user = "<span class='ktError'>" . _kt("Unable to find the document's owner") . '</span>';
286 } else { 299 } else {
287 $owner_user = $owner_user->getName(); 300 $owner_user = $owner_user->getName();
288 } 301 }
289 - 302 +
290 303
291 304
292 $comparison_modified_user =& User::get($comparison_document->getVersionCreatorId()); 305 $comparison_modified_user =& User::get($comparison_document->getVersionCreatorId());
293 if (PEAR::isError($comparison_modified_user)) { 306 if (PEAR::isError($comparison_modified_user)) {
294 - $comparison_modified_user = "<span class='ktError'>" . _kt("Unable to find the document's modifier") . "</span>"; 307 + $comparison_modified_user = "<span class='ktError'>" . _kt("Unable to find the document's modifier") . '</span>';
295 } else { 308 } else {
296 $comparison_modified_user = $comparison_modified_user->getName(); 309 $comparison_modified_user = $comparison_modified_user->getName();
297 } 310 }
@@ -300,59 +313,59 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay { @@ -300,59 +313,59 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay {
300 $oState = KTWorkflowUtil::getWorkflowStateForDocument($document); 313 $oState = KTWorkflowUtil::getWorkflowStateForDocument($document);
301 $oComparisonWorkflow = KTWorkflowUtil::getWorkflowForDocument($comparison_document); 314 $oComparisonWorkflow = KTWorkflowUtil::getWorkflowForDocument($comparison_document);
302 $oComparisonState = KTWorkflowUtil::getWorkflowStateForDocument($comparison_document); 315 $oComparisonState = KTWorkflowUtil::getWorkflowStateForDocument($comparison_document);
303 -  
304 -  
305 - $oTemplating =& KTTemplating::getSingleton();  
306 - $oTemplate = $oTemplating->loadTemplate("kt3/fieldsets/generic_versioned"); 316 +
  317 +
  318 + $oTemplating =& KTTemplating::getSingleton();
  319 + $oTemplate = $oTemplating->loadTemplate('kt3/fieldsets/generic_versioned');
307 $aTemplateData = array( 320 $aTemplateData = array(
308 - "context" => $this,  
309 - "document_data" => $aDocumentData,  
310 - "document" => $aDocumentData["document"],  
311 -  
312 - "title" => $document->getName(),  
313 - "comparison_title" => $comparison_document->getName(),  
314 -  
315 - "filename" => $document->getFileName(),  
316 - "comparison_filename" => $comparison_document->getFileName(),  
317 -  
318 - "creator" => $creator,  
319 - "creation_date" => $creation_date,  
320 - "owner" => $owner_user,  
321 -  
322 - "last_modified_by" => $modified_user,  
323 - "last_modified_date" => $last_modified_date,  
324 -  
325 - "comparison_last_modified_by" => $comparison_modified_user,  
326 - "comparison_last_modified_date" => $comparison_last_modified_date,  
327 -  
328 - "document_type" => $document_type,  
329 - "comparison_document_type" => $comparison_document_type,  
330 -  
331 - "workflow_state" => $oState,  
332 - "comparison_workflow_state" => $oComparisonState,  
333 - "workflow" => $oWorkflow,  
334 - "comparison_workflow" => $oComparisonWorkflow,  
335 -  
336 - "comparison_document" => $aComparisonData["document"], 321 + 'context' => $this,
  322 + 'document_data' => $aDocumentData,
  323 + 'document' => $aDocumentData['document'],
  324 +
  325 + 'title' => $document->getName(),
  326 + 'comparison_title' => $comparison_document->getName(),
  327 +
  328 + 'filename' => $document->getFileName(),
  329 + 'comparison_filename' => $comparison_document->getFileName(),
  330 +
  331 + 'creator' => $creator,
  332 + 'creation_date' => $creation_date,
  333 + 'owner' => $owner_user,
  334 +
  335 + 'last_modified_by' => $modified_user,
  336 + 'last_modified_date' => $last_modified_date,
  337 +
  338 + 'comparison_last_modified_by' => $comparison_modified_user,
  339 + 'comparison_last_modified_date' => $comparison_last_modified_date,
  340 +
  341 + 'document_type' => $document_type,
  342 + 'comparison_document_type' => $comparison_document_type,
  343 +
  344 + 'workflow_state' => $oState,
  345 + 'comparison_workflow_state' => $oComparisonState,
  346 + 'workflow' => $oWorkflow,
  347 + 'comparison_workflow' => $oComparisonWorkflow,
  348 +
  349 + 'comparison_document' => $aComparisonData['document'],
337 ); 350 );
338 -  
339 - return $oTemplate->render($aTemplateData); 351 +
  352 + return $oTemplate->render($aTemplateData);
340 } 353 }
341 - 354 +
342 function renderEdit($document_data) { 355 function renderEdit($document_data) {
343 global $main; // FIXME remove direct access to $main 356 global $main; // FIXME remove direct access to $main
344 - $oField = new KTBaseWidget(_kt("Document Title"), 357 + $oField = new KTBaseWidget(_kt('Document Title'),
345 sprintf(_kt("The document title is used as the main name of a document throughout %s&trade;."), APP_NAME), 358 sprintf(_kt("The document title is used as the main name of a document throughout %s&trade;."), APP_NAME),
346 - "generic_title", $document_data["document"]->getName(), $main, true, null, array()); 359 + 'generic_title', $document_data['document']->getName(), $main, true, null, array());
347 $aFields = array($oField); // its the only one editable from the basic set (currently). 360 $aFields = array($oField); // its the only one editable from the basic set (currently).
348 -  
349 - $oTemplating =& KTTemplating::getSingleton();  
350 - $oTemplate = $oTemplating->loadTemplate("kt3/fieldsets/simple_editable"); 361 +
  362 + $oTemplating =& KTTemplating::getSingleton();
  363 + $oTemplate = $oTemplating->loadTemplate('kt3/fieldsets/simple_editable');
351 $aTemplateData = array( 364 $aTemplateData = array(
352 - "context" => $this,  
353 - "fields" => $aFields,  
354 - "title" => _kt("Generic Document Information"),  
355 - "description" => sprintf(_kt("The information in this section is stored by %s&trade; for every document."), APP_NAME), 365 + 'context' => $this,
  366 + 'fields' => $aFields,
  367 + 'title' => _kt('Generic Document Information'),
  368 + 'description' => sprintf(_kt("The information in this section is stored by %s&trade; for every document."), APP_NAME),
356 ); 369 );
357 return $oTemplate->render($aTemplateData); 370 return $oTemplate->render($aTemplateData);
358 } 371 }
@@ -361,177 +374,184 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay { @@ -361,177 +374,184 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay {
361 374
362 // The generic object 375 // The generic object
363 class SimpleFieldsetDisplay extends KTFieldsetDisplay { 376 class SimpleFieldsetDisplay extends KTFieldsetDisplay {
364 - 377 +
365 function render($aDocumentData) { 378 function render($aDocumentData) {
366 // we do a fair bit of fetching, etc. in here. 379 // we do a fair bit of fetching, etc. in here.
367 - $document = $aDocumentData["document"];  
368 - 380 + $document = $aDocumentData['document'];
  381 +
369 // we need to extract the fields. 382 // we need to extract the fields.
370 $fields =& $this->fieldset->getFields(); 383 $fields =& $this->fieldset->getFields();
371 -  
372 - 384 +
  385 +
373 // we now grab that subset of items which fit in here. 386 // we now grab that subset of items which fit in here.
374 // FIXME link value -> lookup where appropriate. 387 // FIXME link value -> lookup where appropriate.
375 // FIXME probably need to be more careful about the _type_ of field here. 388 // FIXME probably need to be more careful about the _type_ of field here.
376 $fieldset_values = array(); 389 $fieldset_values = array();
377 foreach ($fields as $oField) { 390 foreach ($fields as $oField) {
378 - $val = KTUtil::arrayGet($aDocumentData["field_values"], $oField->getId(), null);  
379 - $fieldset_values[] = array("field" => $oField, "value" => $val, ); 391 + $val = KTUtil::arrayGet($aDocumentData['field_values'], $oField->getId(), null);
  392 + $fieldset_values[] = array('field' => $oField, 'value' => $val, );
  393 + }
  394 +
  395 + // Alphabetise the metadata fields within a fieldset if set in config
  396 + $oKTConfig =& KTConfig::getSingleton();
  397 + $use_sort = $oKTConfig->get('ui/metadata_sort', false);
  398 +
  399 + if($use_sort){
  400 + usort($fieldset_values, 'compareFieldSetField');
380 } 401 }
381 -  
382 -  
383 -  
384 - $oTemplating =& KTTemplating::getSingleton();  
385 - $oTemplate = $oTemplating->loadTemplate("kt3/fieldsets/simple"); 402 +
  403 +
  404 + $oTemplating =& KTTemplating::getSingleton();
  405 + $oTemplate = $oTemplating->loadTemplate('kt3/fieldsets/simple');
386 $aTemplateData = array( 406 $aTemplateData = array(
387 - "context" => $this,  
388 - "document_data" => $aDocumentData,  
389 - "document" => $aDocumentData["document"],  
390 - "fieldset" => $this->fieldset,  
391 - "fieldset_values" => $fieldset_values,  
392 - "description" => $this->fieldset->getDescription(), 407 + 'context' => $this,
  408 + 'document_data' => $aDocumentData,
  409 + 'document' => $aDocumentData['document'],
  410 + 'fieldset' => $this->fieldset,
  411 + 'fieldset_values' => $fieldset_values,
  412 + 'description' => $this->fieldset->getDescription(),
393 ); 413 );
394 - return $oTemplate->render($aTemplateData); 414 + return $oTemplate->render($aTemplateData);
395 } 415 }
396 - 416 +
397 function renderComparison($aDocumentData, $aComparisonData) { 417 function renderComparison($aDocumentData, $aComparisonData) {
398 // we do a fair bit of fetching, etc. in here. 418 // we do a fair bit of fetching, etc. in here.
399 - $document = $aDocumentData["document"];  
400 - 419 + $document = $aDocumentData['document'];
  420 +
401 // we need to extract the fields. 421 // we need to extract the fields.
402 $fields =& $this->fieldset->getFields(); 422 $fields =& $this->fieldset->getFields();
403 -  
404 - 423 +
  424 +
405 // we now grab that subset of items which fit in here. 425 // we now grab that subset of items which fit in here.
406 // FIXME link value -> lookup where appropriate. 426 // FIXME link value -> lookup where appropriate.
407 // FIXME probably need to be more careful about the _type_ of field here. 427 // FIXME probably need to be more careful about the _type_ of field here.
408 $fieldset_values = array(); 428 $fieldset_values = array();
409 foreach ($fields as $oField) { 429 foreach ($fields as $oField) {
410 - $curr_val = KTUtil::arrayGet($aDocumentData["field_values"], $oField->getId(), null);  
411 - $old_val = KTUtil::arrayGet($aComparisonData["field_values"], $oField->getId(), null);  
412 - $fieldset_values[] = array("field" => $oField, "current_value" => $curr_val, "previous_value" => $old_val); 430 + $curr_val = KTUtil::arrayGet($aDocumentData['field_values'], $oField->getId(), null);
  431 + $old_val = KTUtil::arrayGet($aComparisonData['field_values'], $oField->getId(), null);
  432 + $fieldset_values[] = array('field' => $oField, 'current_value' => $curr_val, 'previous_value' => $old_val);
413 } 433 }
414 -  
415 -  
416 - $oTemplating =& KTTemplating::getSingleton();  
417 - $oTemplate = $oTemplating->loadTemplate("kt3/fieldsets/simple_versioned"); 434 +
  435 +
  436 + $oTemplating =& KTTemplating::getSingleton();
  437 + $oTemplate = $oTemplating->loadTemplate('kt3/fieldsets/simple_versioned');
418 $aTemplateData = array( 438 $aTemplateData = array(
419 - "context" => $this,  
420 - "document_data" => $aDocumentData,  
421 - "document" => $aDocumentData["document"],  
422 - "fieldset" => $this->fieldset,  
423 - "fieldset_values" => $fieldset_values, 439 + 'context' => $this,
  440 + 'document_data' => $aDocumentData,
  441 + 'document' => $aDocumentData['document'],
  442 + 'fieldset' => $this->fieldset,
  443 + 'fieldset_values' => $fieldset_values,
424 ); 444 );
425 - return $oTemplate->render($aTemplateData);  
426 - }  
427 - 445 + return $oTemplate->render($aTemplateData);
  446 + }
  447 +
428 function renderEdit($document_data) { 448 function renderEdit($document_data) {
429 global $main; // FIXME remove direct access to $main 449 global $main; // FIXME remove direct access to $main
430 - 450 +
431 $aFields = array(); 451 $aFields = array();
432 - 452 +
433 $fields =& $this->fieldset->getFields(); 453 $fields =& $this->fieldset->getFields();
434 - 454 +
435 foreach ($fields as $oField) { 455 foreach ($fields as $oField) {
436 - $val = KTUtil::arrayGet($document_data["field_values"], $oField->getId(), null);  
437 - 456 + $val = KTUtil::arrayGet($document_data['field_values'], $oField->getId(), null);
  457 +
438 $has_errors = KTUtil::arrayGet($document_data['errors'], $oField->getId(),false); 458 $has_errors = KTUtil::arrayGet($document_data['errors'], $oField->getId(),false);
439 if ($has_errors !== false) { 459 if ($has_errors !== false) {
440 // FIXME when the actual errors (meaningful) are passed out, fix this. 460 // FIXME when the actual errors (meaningful) are passed out, fix this.
441 $errors = array(_kt('The system rejected your value for this field.')); 461 $errors = array(_kt('The system rejected your value for this field.'));
442 - } else { 462 + } else {
443 $errors = null; 463 $errors = null;
444 } 464 }
445 - 465 +
446 $aFields[] = getWidgetForMetadataField($oField, $val, $main, $errors); // FIXME handle errors 466 $aFields[] = getWidgetForMetadataField($oField, $val, $main, $errors); // FIXME handle errors
447 } 467 }
448 $fieldset_name = $this->fieldset->getName(); 468 $fieldset_name = $this->fieldset->getName();
449 $fieldset_description = $this->fieldset->getDescription(); 469 $fieldset_description = $this->fieldset->getDescription();
450 - $oTemplating =& KTTemplating::getSingleton();  
451 - $oTemplate = $oTemplating->loadTemplate("kt3/fieldsets/simple_editable"); 470 + $oTemplating =& KTTemplating::getSingleton();
  471 + $oTemplate = $oTemplating->loadTemplate('kt3/fieldsets/simple_editable');
452 $aTemplateData = array( 472 $aTemplateData = array(
453 - "context" => $this,  
454 - "fields" => $aFields,  
455 - "title" => $fieldset_name,  
456 - "description" => $fieldset_description, 473 + 'context' => $this,
  474 + 'fields' => $aFields,
  475 + 'title' => $fieldset_name,
  476 + 'description' => $fieldset_description,
457 ); 477 );
458 -  
459 - 478 +
  479 +
460 return $oTemplate->render($aTemplateData); 480 return $oTemplate->render($aTemplateData);
461 } 481 }
462 - 482 +
463 } 483 }
464 484
465 485
466 // Handle the conditional case. 486 // Handle the conditional case.
467 class ConditionalFieldsetDisplay extends SimpleFieldsetDisplay { 487 class ConditionalFieldsetDisplay extends SimpleFieldsetDisplay {
468 - 488 +
469 function renderEdit($document_data) { 489 function renderEdit($document_data) {
470 global $main; // FIXME remove direct access to $main 490 global $main; // FIXME remove direct access to $main
471 $oPage =& $main; 491 $oPage =& $main;
472 - 492 +
473 // FIXME do this from inside the widgetry mojo. 493 // FIXME do this from inside the widgetry mojo.
474 $oPage->requireCSSResource('resources/css/kt-treewidget.css'); 494 $oPage->requireCSSResource('resources/css/kt-treewidget.css');
475 - 495 +
476 // FIXME this currently doesn't work, since we use NBM's half-baked Ajax on add/bulk ;) 496 // FIXME this currently doesn't work, since we use NBM's half-baked Ajax on add/bulk ;)
477 $oPage->requireJSResource('resources/js/taillog.js'); 497 $oPage->requireJSResource('resources/js/taillog.js');
478 $oPage->requireJSResource('resources/js/conditional_usage.js'); 498 $oPage->requireJSResource('resources/js/conditional_usage.js');
479 -  
480 - $aFields = array(); 499 +
  500 + $aFields = array();
481 $fields =& $this->fieldset->getFields(); 501 $fields =& $this->fieldset->getFields();
482 $values = array(); 502 $values = array();
483 $errors = $document_data['errors']; 503 $errors = $document_data['errors'];
484 504
485 $have_values = false; 505 $have_values = false;
486 foreach ($fields as $oField) { 506 foreach ($fields as $oField) {
487 - $val = KTUtil::arrayGet($document_data["field_values"], $oField->getId(), null); 507 + $val = KTUtil::arrayGet($document_data['field_values'], $oField->getId(), null);
488 if ($val !== null) { 508 if ($val !== null) {
489 $have_values = true; 509 $have_values = true;
490 -  
491 - }  
492 - 510 +
  511 + }
  512 +
493 $values[$oField->getId()] = $val; 513 $values[$oField->getId()] = $val;
494 - } 514 + }
  515 +
495 516
496 -  
497 // now, we need to do some extra work on conditional widgets. 517 // now, we need to do some extra work on conditional widgets.
498 // how? 518 // how?
499 - 519 +
500 $fieldset_name = $this->fieldset->getName(); 520 $fieldset_name = $this->fieldset->getName();
501 $fieldset_description = _kt($this->fieldset->getDescription()); // need a better approach. how do we handle database-resident translations? 521 $fieldset_description = _kt($this->fieldset->getDescription()); // need a better approach. how do we handle database-resident translations?
502 - $fieldset_description .= _kt("Note that the options which are available depends on previous choices within this fieldset.");  
503 - 522 + $fieldset_description .= _kt('Note that the options which are available depends on previous choices within this fieldset.');
  523 +
504 // FIXME handle the editable case _with_ values. 524 // FIXME handle the editable case _with_ values.
505 - 525 +
506 if ($have_values) { 526 if ($have_values) {
507 - $oTemplating =& KTTemplating::getSingleton();  
508 - $oTemplate = $oTemplating->loadTemplate("kt3/fieldsets/conditional_editable_values"); 527 + $oTemplating =& KTTemplating::getSingleton();
  528 + $oTemplate = $oTemplating->loadTemplate('kt3/fieldsets/conditional_editable_values');
509 $aTemplateData = array( 529 $aTemplateData = array(
510 - "context" => $this,  
511 - "fields" => $fields =& $this->fieldset->getFields(), 530 + 'context' => $this,
  531 + 'fields' => $fields =& $this->fieldset->getFields(),
512 'fieldset_id' => $this->fieldset->getId(), 532 'fieldset_id' => $this->fieldset->getId(),
513 - "title" => $fieldset_name,  
514 - "description" => $fieldset_description, 533 + 'title' => $fieldset_name,
  534 + 'description' => $fieldset_description,
515 'values' => $values, 535 'values' => $values,
516 'errors' => $errors, 536 'errors' => $errors,
517 ); 537 );
518 - 538 +
519 return $oTemplate->render($aTemplateData); 539 return $oTemplate->render($aTemplateData);
520 } // else { 540 } // else {
521 -  
522 - $oTemplating =& KTTemplating::getSingleton();  
523 - $oTemplate = $oTemplating->loadTemplate("kt3/fieldsets/conditional_editable"); 541 +
  542 + $oTemplating =& KTTemplating::getSingleton();
  543 + $oTemplate = $oTemplating->loadTemplate('kt3/fieldsets/conditional_editable');
524 $aTemplateData = array( 544 $aTemplateData = array(
525 - "context" => $this,  
526 - "field" => $oField, // first field, widget. 545 + 'context' => $this,
  546 + 'field' => $oField, // first field, widget.
527 'fieldset_id' => $this->fieldset->getId(), 547 'fieldset_id' => $this->fieldset->getId(),
528 - "title" => $fieldset_name,  
529 - "description" => $fieldset_description, 548 + 'title' => $fieldset_name,
  549 + 'description' => $fieldset_description,
530 ); 550 );
531 - 551 +
532 return $oTemplate->render($aTemplateData); 552 return $oTemplate->render($aTemplateData);
533 } 553 }
534 - 554 +
535 } 555 }
536 556
537 -?> 557 -?>
  558 +?>
538 \ No newline at end of file 559 \ No newline at end of file
view.php
@@ -5,64 +5,64 @@ @@ -5,64 +5,64 @@
5 * KnowledgeTree Open Source Edition 5 * KnowledgeTree Open Source Edition
6 * Document Management Made Simple 6 * Document Management Made Simple
7 * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited 7 * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited
8 - * 8 + *
9 * This program is free software; you can redistribute it and/or modify it under 9 * This program is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License version 3 as published by the 10 * the terms of the GNU General Public License version 3 as published by the
11 * Free Software Foundation. 11 * Free Software Foundation.
12 - * 12 + *
13 * This program is distributed in the hope that it will be useful, but WITHOUT 13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 * details. 16 * details.
17 - * 17 + *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 - * 20 + *
21 * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, 21 * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place,
22 * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. 22 * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com.
23 - * 23 + *
24 * The interactive user interfaces in modified source and object code versions 24 * The interactive user interfaces in modified source and object code versions
25 * of this program must display Appropriate Legal Notices, as required under 25 * of this program must display Appropriate Legal Notices, as required under
26 * Section 5 of the GNU General Public License version 3. 26 * Section 5 of the GNU General Public License version 3.
27 - * 27 + *
28 * In accordance with Section 7(b) of the GNU General Public License version 3, 28 * In accordance with Section 7(b) of the GNU General Public License version 3,
29 * these Appropriate Legal Notices must retain the display of the "Powered by 29 * these Appropriate Legal Notices must retain the display of the "Powered by
30 - * KnowledgeTree" logo and retain the original copyright notice. If the display of the 30 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
31 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices 31 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
32 - * must display the words "Powered by KnowledgeTree" and retain the original  
33 - * copyright notice. 32 + * must display the words "Powered by KnowledgeTree" and retain the original
  33 + * copyright notice.
34 * Contributor( s): ______________________________________ 34 * Contributor( s): ______________________________________
35 */ 35 */
36 36
37 // boilerplate. 37 // boilerplate.
38 -require_once("config/dmsDefaults.php");  
39 -require_once(KT_LIB_DIR . "/templating/templating.inc.php");  
40 -require_once(KT_LIB_DIR . "/templating/kt3template.inc.php");  
41 -require_once(KT_LIB_DIR . "/dispatcher.inc.php");  
42 -require_once(KT_LIB_DIR . "/util/ktutil.inc");  
43 -require_once(KT_LIB_DIR . "/database/dbutil.inc");  
44 -require_once(KT_LIB_DIR . "/util/sanitize.inc"); 38 +require_once('config/dmsDefaults.php');
  39 +require_once(KT_LIB_DIR . '/templating/templating.inc.php');
  40 +require_once(KT_LIB_DIR . '/templating/kt3template.inc.php');
  41 +require_once(KT_LIB_DIR . '/dispatcher.inc.php');
  42 +require_once(KT_LIB_DIR . '/util/ktutil.inc');
  43 +require_once(KT_LIB_DIR . '/database/dbutil.inc');
  44 +require_once(KT_LIB_DIR . '/util/sanitize.inc');
45 45
46 // document related includes 46 // document related includes
47 -require_once(KT_LIB_DIR . "/documentmanagement/Document.inc");  
48 -require_once(KT_LIB_DIR . "/documentmanagement/DocumentType.inc");  
49 -require_once(KT_LIB_DIR . "/documentmanagement/DocumentFieldLink.inc");  
50 -require_once(KT_LIB_DIR . "/documentmanagement/documentmetadataversion.inc.php");  
51 -require_once(KT_LIB_DIR . "/documentmanagement/documentcontentversion.inc.php");  
52 -require_once(KT_LIB_DIR . "/metadata/fieldset.inc.php");  
53 -require_once(KT_LIB_DIR . "/security/Permission.inc"); 47 +require_once(KT_LIB_DIR . '/documentmanagement/Document.inc');
  48 +require_once(KT_LIB_DIR . '/documentmanagement/DocumentType.inc');
  49 +require_once(KT_LIB_DIR . '/documentmanagement/DocumentFieldLink.inc');
  50 +require_once(KT_LIB_DIR . '/documentmanagement/documentmetadataversion.inc.php');
  51 +require_once(KT_LIB_DIR . '/documentmanagement/documentcontentversion.inc.php');
  52 +require_once(KT_LIB_DIR . '/metadata/fieldset.inc.php');
  53 +require_once(KT_LIB_DIR . '/security/Permission.inc');
54 54
55 // widget includes. 55 // widget includes.
56 -require_once(KT_LIB_DIR . "/widgets/portlet.inc.php");  
57 -require_once(KT_LIB_DIR . "/widgets/fieldsetDisplay.inc.php");  
58 -require_once(KT_LIB_DIR . "/widgets/FieldsetDisplayRegistry.inc.php");  
59 -require_once(KT_LIB_DIR . "/actions/documentaction.inc.php");  
60 -require_once(KT_LIB_DIR . "/browse/browseutil.inc.php"); 56 +require_once(KT_LIB_DIR . '/widgets/portlet.inc.php');
  57 +require_once(KT_LIB_DIR . '/widgets/fieldsetDisplay.inc.php');
  58 +require_once(KT_LIB_DIR . '/widgets/FieldsetDisplayRegistry.inc.php');
  59 +require_once(KT_LIB_DIR . '/actions/documentaction.inc.php');
  60 +require_once(KT_LIB_DIR . '/browse/browseutil.inc.php');
61 61
62 62
63 class ViewDocumentDispatcher extends KTStandardDispatcher { 63 class ViewDocumentDispatcher extends KTStandardDispatcher {
64 var $sName = 'ktcore.actions.document.displaydetails'; 64 var $sName = 'ktcore.actions.document.displaydetails';
65 - var $sSection = "view_details"; 65 + var $sSection = 'view_details';
66 var $sHelpPage = 'ktcore/browse.html'; 66 var $sHelpPage = 'ktcore/browse.html';
67 67
68 var $actions; 68 var $actions;
@@ -77,21 +77,21 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -77,21 +77,21 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
77 77
78 function check() { 78 function check() {
79 if (!parent::check()) { return false; } 79 if (!parent::check()) { return false; }
80 - 80 +
81 $this->persistParams(array('fDocumentId')); 81 $this->persistParams(array('fDocumentId'));
82 - 82 +
83 return true; 83 return true;
84 } 84 }
85 85
86 // FIXME identify the current location somehow. 86 // FIXME identify the current location somehow.
87 function addPortlets($currentaction = null) { 87 function addPortlets($currentaction = null) {
88 $currentaction = $this->sName; 88 $currentaction = $this->sName;
89 - 89 +
90 $actions = KTDocumentActionUtil::getDocumentActionsForDocument($this->oDocument, $this->oUser, 'documentinfo'); 90 $actions = KTDocumentActionUtil::getDocumentActionsForDocument($this->oDocument, $this->oUser, 'documentinfo');
91 $oPortlet = new KTActionPortlet(sprintf(_kt('Document info'))); 91 $oPortlet = new KTActionPortlet(sprintf(_kt('Document info')));
92 $oPortlet->setActions($actions, $currentaction); 92 $oPortlet->setActions($actions, $currentaction);
93 - $this->oPage->addPortlet($oPortlet);  
94 - 93 + $this->oPage->addPortlet($oPortlet);
  94 +
95 $this->actions = KTDocumentActionUtil::getDocumentActionsForDocument($this->oDocument, $this->oUser); 95 $this->actions = KTDocumentActionUtil::getDocumentActionsForDocument($this->oDocument, $this->oUser);
96 $oPortlet = new KTActionPortlet(sprintf(_kt('Document actions'), $this->oDocument->getName())); 96 $oPortlet = new KTActionPortlet(sprintf(_kt('Document actions'), $this->oDocument->getName()));
97 $oPortlet->setActions($this->actions, $currentaction); 97 $oPortlet->setActions($this->actions, $currentaction);
@@ -100,9 +100,9 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -100,9 +100,9 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
100 100
101 function do_main() { 101 function do_main() {
102 // fix legacy, broken items. 102 // fix legacy, broken items.
103 - if (KTUtil::arrayGet($_REQUEST, "fDocumentID", true) !== true) {  
104 - $_REQUEST["fDocumentId"] = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, "fDocumentID"));  
105 - unset($_REQUEST["fDocumentID"]); 103 + if (KTUtil::arrayGet($_REQUEST, 'fDocumentID', true) !== true) {
  104 + $_REQUEST['fDocumentId'] = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, 'fDocumentID'));
  105 + unset($_REQUEST['fDocumentID']);
106 } 106 }
107 107
108 $document_data = array(); 108 $document_data = array();
@@ -118,7 +118,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -118,7 +118,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
118 return $this->do_error(); 118 return $this->do_error();
119 } 119 }
120 $document_id = $oDocument->getId(); 120 $document_id = $oDocument->getId();
121 - $document_data["document_id"] = $oDocument->getId(); 121 + $document_data['document_id'] = $oDocument->getId();
122 122
123 123
124 if (!KTBrowseUtil::inAdminMode($this->oUser, $oDocument->getFolderId())) { 124 if (!KTBrowseUtil::inAdminMode($this->oUser, $oDocument->getFolderId())) {
@@ -143,20 +143,20 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -143,20 +143,20 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
143 $this->oPage->setSecondaryTitle($oDocument->getName()); 143 $this->oPage->setSecondaryTitle($oDocument->getName());
144 144
145 $aOptions = array( 145 $aOptions = array(
146 - "documentaction" => "viewDocument",  
147 - "folderaction" => "browse", 146 + 'documentaction' => 'viewDocument',
  147 + 'folderaction' => 'browse',
148 ); 148 );
149 149
150 $this->oDocument =& $oDocument; 150 $this->oDocument =& $oDocument;
151 $this->aBreadcrumbs = kt_array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions)); 151 $this->aBreadcrumbs = kt_array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions));
152 - $this->oPage->setBreadcrumbDetails(_kt("document details"));  
153 - $this->addPortlets("Document Details"); 152 + $this->oPage->setBreadcrumbDetails(_kt('document details'));
  153 + $this->addPortlets('Document Details');
154 154
155 - $document_data["document"] = $oDocument;  
156 - $document_data["document_type"] =& DocumentType::get($oDocument->getDocumentTypeID()); 155 + $document_data['document'] = $oDocument;
  156 + $document_data['document_type'] =& DocumentType::get($oDocument->getDocumentTypeID());
157 $is_valid_doctype = true; 157 $is_valid_doctype = true;
158 158
159 - if (PEAR::isError($document_data["document_type"])) { 159 + if (PEAR::isError($document_data['document_type'])) {
160 $this->oPage->addError(_kt('The document you requested has an invalid <strong>document type</strong>. Unfortunately, this means that we cannot effectively display it.')); 160 $this->oPage->addError(_kt('The document you requested has an invalid <strong>document type</strong>. Unfortunately, this means that we cannot effectively display it.'));
161 $is_valid_doctype = false; 161 $is_valid_doctype = false;
162 } 162 }
@@ -171,7 +171,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -171,7 +171,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
171 171
172 //var_dump($field_values); 172 //var_dump($field_values);
173 173
174 - $document_data["field_values"] = $field_values; 174 + $document_data['field_values'] = $field_values;
175 175
176 // Fieldset generation. 176 // Fieldset generation.
177 // 177 //
@@ -186,7 +186,9 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -186,7 +186,9 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
186 186
187 $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton(); 187 $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton();
188 188
189 - foreach (KTMetadataUtil::fieldsetsForDocument($oDocument) as $oFieldset) { 189 + $aDocFieldsets = KTMetadataUtil::fieldsetsForDocument($oDocument);
  190 +
  191 + foreach ($aDocFieldsets as $oFieldset) {
190 $displayClass = $fieldsetDisplayReg->getHandler($oFieldset->getNamespace()); 192 $displayClass = $fieldsetDisplayReg->getHandler($oFieldset->getNamespace());
191 array_push($fieldsets, new $displayClass($oFieldset)); 193 array_push($fieldsets, new $displayClass($oFieldset));
192 } 194 }
@@ -216,35 +218,35 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -216,35 +218,35 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
216 $aViewletActions = KTDocumentActionUtil::getDocumentActionsForDocument($this->oDocument, $this->oUser, 'documentviewlet'); 218 $aViewletActions = KTDocumentActionUtil::getDocumentActionsForDocument($this->oDocument, $this->oUser, 'documentviewlet');
217 foreach ($aViewletActions as $oAction) { 219 foreach ($aViewletActions as $oAction) {
218 $aInfo = $oAction->getInfo(); 220 $aInfo = $oAction->getInfo();
219 - 221 +
220 if ($aInfo !== null) { 222 if ($aInfo !== null) {
221 - $aViewlets[] = $oAction->display_viewlet(); // use the action, since we display_viewlet() later. 223 + $aViewlets[] = $oAction->display_viewlet(); // use the action, since we display_viewlet() later.
222 } 224 }
223 - }  
224 -  
225 - $viewlet_data = implode(" ", $aViewlets); 225 + }
  226 +
  227 + $viewlet_data = implode(' ', $aViewlets);
226 $viewlet_data = trim($viewlet_data); 228 $viewlet_data = trim($viewlet_data);
227 - 229 +
228 $content_class = 'view'; 230 $content_class = 'view';
229 if (!empty($viewlet_data)) { 231 if (!empty($viewlet_data)) {
230 $content_class = 'view withviewlets'; 232 $content_class = 'view withviewlets';
231 - } 233 + }
232 $this->oPage->setContentClass($content_class); 234 $this->oPage->setContentClass($content_class);
233 -  
234 235
235 - 236 +
  237 +
236 $oTemplating =& KTTemplating::getSingleton(); 238 $oTemplating =& KTTemplating::getSingleton();
237 - $oTemplate = $oTemplating->loadTemplate("ktcore/document/view"); 239 + $oTemplate = $oTemplating->loadTemplate('ktcore/document/view');
238 $aTemplateData = array( 240 $aTemplateData = array(
239 - "context" => $this,  
240 - "sCheckoutUser" => $checkout_user,  
241 - "isCheckoutUser" => ($this->oUser->getId() == $oDocument->getCheckedOutUserId()),  
242 - "canCheckin" => $bCanCheckin,  
243 - "document_id" => $document_id,  
244 - "document" => $oDocument,  
245 - "documentName" => $oDocument->getName(),  
246 - "document_data" => $document_data,  
247 - "fieldsets" => $fieldsets, 241 + 'context' => $this,
  242 + 'sCheckoutUser' => $checkout_user,
  243 + 'isCheckoutUser' => ($this->oUser->getId() == $oDocument->getCheckedOutUserId()),
  244 + 'canCheckin' => $bCanCheckin,
  245 + 'document_id' => $document_id,
  246 + 'document' => $oDocument,
  247 + 'documentName' => $oDocument->getName(),
  248 + 'document_data' => $document_data,
  249 + 'fieldsets' => $fieldsets,
248 'viewlet_data' => $viewlet_data, 250 'viewlet_data' => $viewlet_data,
249 ); 251 );
250 //return '<pre>' . print_r($aTemplateData, true) . '</pre>'; 252 //return '<pre>' . print_r($aTemplateData, true) . '</pre>';
@@ -256,86 +258,86 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -256,86 +258,86 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
256 // fDocumentId (document to compare against) 258 // fDocumentId (document to compare against)
257 // fComparisonVersion (the metadata_version of the appropriate document) 259 // fComparisonVersion (the metadata_version of the appropriate document)
258 function do_viewComparison() { 260 function do_viewComparison() {
259 - 261 +
260 $document_data = array(); 262 $document_data = array();
261 $document_id = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, 'fDocumentId')); 263 $document_id = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
262 if ($document_id === null) { 264 if ($document_id === null) {
263 $this->oPage->addError(sprintf(_kt("No document was requested. Please <a href=\"%s\">browse</a> for one."), KTBrowseUtil::getBrowseBaseUrl())); 265 $this->oPage->addError(sprintf(_kt("No document was requested. Please <a href=\"%s\">browse</a> for one."), KTBrowseUtil::getBrowseBaseUrl()));
264 return $this->do_error(); 266 return $this->do_error();
265 } 267 }
266 -  
267 - $document_data["document_id"] = $document_id;  
268 - 268 +
  269 + $document_data['document_id'] = $document_id;
  270 +
269 $base_version = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, 'fBaseVersion')); 271 $base_version = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, 'fBaseVersion'));
270 - 272 +
271 // try get the document. 273 // try get the document.
272 $oDocument =& Document::get($document_id, $base_version); 274 $oDocument =& Document::get($document_id, $base_version);
273 if (PEAR::isError($oDocument)) { 275 if (PEAR::isError($oDocument)) {
274 $this->oPage->addError(sprintf(_kt("The base document you attempted to retrieve is invalid. Please <a href=\"%s\">browse</a> for one."), KTBrowseUtil::getBrowseBaseUrl())); 276 $this->oPage->addError(sprintf(_kt("The base document you attempted to retrieve is invalid. Please <a href=\"%s\">browse</a> for one."), KTBrowseUtil::getBrowseBaseUrl()));
275 return $this->do_error(); 277 return $this->do_error();
276 } 278 }
277 - 279 +
278 if (!Permission::userHasDocumentReadPermission($oDocument)) { 280 if (!Permission::userHasDocumentReadPermission($oDocument)) {
279 // FIXME inconsistent. 281 // FIXME inconsistent.
280 $this->oPage->addError(_kt('You are not allowed to view this document')); 282 $this->oPage->addError(_kt('You are not allowed to view this document'));
281 return $this->permissionDenied(); 283 return $this->permissionDenied();
282 } 284 }
283 - 285 +
284 $this->oDocument =& $oDocument; 286 $this->oDocument =& $oDocument;
285 $this->oPage->setSecondaryTitle($oDocument->getName()); 287 $this->oPage->setSecondaryTitle($oDocument->getName());
286 $aOptions = array( 288 $aOptions = array(
287 - "documentaction" => "viewDocument",  
288 - "folderaction" => "browse", 289 + 'documentaction' => 'viewDocument',
  290 + 'folderaction' => 'browse',
289 ); 291 );
290 - 292 +
291 $this->aBreadcrumbs = kt_array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions)); 293 $this->aBreadcrumbs = kt_array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions));
292 - $this->oPage->setBreadcrumbDetails(_kt("compare versions"));  
293 - 294 + $this->oPage->setBreadcrumbDetails(_kt('compare versions'));
  295 +
294 $comparison_version = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, 'fComparisonVersion')); 296 $comparison_version = sanitizeForSQL(KTUtil::arrayGet($_REQUEST, 'fComparisonVersion'));
295 if ($comparison_version=== null) { 297 if ($comparison_version=== null) {
296 $this->oPage->addError(sprintf(_kt("No comparison version was requested. Please <a href=\"%s\">select a version</a>."), KTUtil::addQueryStringSelf('action=history&fDocumentId=' . $document_id))); 298 $this->oPage->addError(sprintf(_kt("No comparison version was requested. Please <a href=\"%s\">select a version</a>."), KTUtil::addQueryStringSelf('action=history&fDocumentId=' . $document_id)));
297 return $this->do_error(); 299 return $this->do_error();
298 } 300 }
299 - 301 +
300 $oComparison =& Document::get($oDocument->getId(), $comparison_version); 302 $oComparison =& Document::get($oDocument->getId(), $comparison_version);
301 if (PEAR::isError($oComparison)) { 303 if (PEAR::isError($oComparison)) {
302 $this->errorRedirectToMain(_kt('Invalid document to compare against.')); 304 $this->errorRedirectToMain(_kt('Invalid document to compare against.'));
303 } 305 }
304 $comparison_data = array(); 306 $comparison_data = array();
305 $comparison_data['document_id'] = $oComparison->getId(); 307 $comparison_data['document_id'] = $oComparison->getId();
306 -  
307 - $document_data["document"] = $oDocument; 308 +
  309 + $document_data['document'] = $oDocument;
308 $comparison_data['document'] = $oComparison; 310 $comparison_data['document'] = $oComparison;
309 -  
310 - $document_data["document_type"] =& DocumentType::get($oDocument->getDocumentTypeID());  
311 - $comparison_data["document_type"] =& DocumentType::get($oComparison->getDocumentTypeID());  
312 - 311 +
  312 + $document_data['document_type'] =& DocumentType::get($oDocument->getDocumentTypeID());
  313 + $comparison_data['document_type'] =& DocumentType::get($oComparison->getDocumentTypeID());
  314 +
313 // follow twice: once for normal, once for comparison. 315 // follow twice: once for normal, once for comparison.
314 $is_valid_doctype = true; 316 $is_valid_doctype = true;
315 -  
316 - if (PEAR::isError($document_data["document_type"])) { 317 +
  318 + if (PEAR::isError($document_data['document_type'])) {
317 $this->oPage->addError(_kt('The document you requested has an invalid <strong>document type</strong>. Unfortunately, this means that we cannot effectively display it.')); 319 $this->oPage->addError(_kt('The document you requested has an invalid <strong>document type</strong>. Unfortunately, this means that we cannot effectively display it.'));
318 $is_valid_doctype = false; 320 $is_valid_doctype = false;
319 } 321 }
320 - 322 +
321 // we want to grab all the md for this doc, since its faster that way. 323 // we want to grab all the md for this doc, since its faster that way.
322 $mdlist =& DocumentFieldLink::getList(array('metadata_version_id = ?', array($oDocument->getMetadataVersionId()))); 324 $mdlist =& DocumentFieldLink::getList(array('metadata_version_id = ?', array($oDocument->getMetadataVersionId())));
323 - 325 +
324 $field_values = array(); 326 $field_values = array();
325 foreach ($mdlist as $oFieldLink) { 327 foreach ($mdlist as $oFieldLink) {
326 $field_values[$oFieldLink->getDocumentFieldID()] = $oFieldLink->getValue(); 328 $field_values[$oFieldLink->getDocumentFieldID()] = $oFieldLink->getValue();
327 } 329 }
328 -  
329 - $document_data["field_values"] = $field_values; 330 +
  331 + $document_data['field_values'] = $field_values;
330 $mdlist =& DocumentFieldLink::getList(array('metadata_version_id = ?', array($comparison_version))); 332 $mdlist =& DocumentFieldLink::getList(array('metadata_version_id = ?', array($comparison_version)));
331 - 333 +
332 $field_values = array(); 334 $field_values = array();
333 foreach ($mdlist as $oFieldLink) { 335 foreach ($mdlist as $oFieldLink) {
334 $field_values[$oFieldLink->getDocumentFieldID()] = $oFieldLink->getValue(); 336 $field_values[$oFieldLink->getDocumentFieldID()] = $oFieldLink->getValue();
335 } 337 }
336 -  
337 - $comparison_data["field_values"] = $field_values;  
338 - 338 +
  339 + $comparison_data['field_values'] = $field_values;
  340 +
339 // Fieldset generation. 341 // Fieldset generation.
340 // 342 //
341 // we need to create a set of FieldsetDisplay objects 343 // we need to create a set of FieldsetDisplay objects
@@ -343,47 +345,47 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -343,47 +345,47 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
343 // to the view (i.e. ZX3). Unfortunately, we don't have 345 // to the view (i.e. ZX3). Unfortunately, we don't have
344 // any of the plumbing to do it, so we handle this here. 346 // any of the plumbing to do it, so we handle this here.
345 $fieldsets = array(); 347 $fieldsets = array();
346 - 348 +
347 // we always have a generic. 349 // we always have a generic.
348 array_push($fieldsets, new GenericFieldsetDisplay()); 350 array_push($fieldsets, new GenericFieldsetDisplay());
349 - 351 +
350 // FIXME can we key this on fieldset namespace? or can we have duplicates? 352 // FIXME can we key this on fieldset namespace? or can we have duplicates?
351 // now we get the other fieldsets, IF there is a valid doctype. 353 // now we get the other fieldsets, IF there is a valid doctype.
352 - 354 +
353 if ($is_valid_doctype) { 355 if ($is_valid_doctype) {
354 // these are the _actual_ fieldsets. 356 // these are the _actual_ fieldsets.
355 $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton(); 357 $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton();
356 - 358 +
357 // and the generics 359 // and the generics
358 $activesets = KTFieldset::getGenericFieldsets(); 360 $activesets = KTFieldset::getGenericFieldsets();
359 foreach ($activesets as $oFieldset) { 361 foreach ($activesets as $oFieldset) {
360 $displayClass = $fieldsetDisplayReg->getHandler($oFieldset->getNamespace()); 362 $displayClass = $fieldsetDisplayReg->getHandler($oFieldset->getNamespace());
361 array_push($fieldsets, new $displayClass($oFieldset)); 363 array_push($fieldsets, new $displayClass($oFieldset));
362 } 364 }
363 - 365 +
364 $activesets = KTFieldset::getForDocumentType($oDocument->getDocumentTypeID()); 366 $activesets = KTFieldset::getForDocumentType($oDocument->getDocumentTypeID());
365 foreach ($activesets as $oFieldset) { 367 foreach ($activesets as $oFieldset) {
366 $displayClass = $fieldsetDisplayReg->getHandler($oFieldset->getNamespace()); 368 $displayClass = $fieldsetDisplayReg->getHandler($oFieldset->getNamespace());
367 array_push($fieldsets, new $displayClass($oFieldset)); 369 array_push($fieldsets, new $displayClass($oFieldset));
368 } 370 }
369 } 371 }
370 - 372 +
371 // FIXME handle ad-hoc fieldsets. 373 // FIXME handle ad-hoc fieldsets.
372 $this->addPortlets(); 374 $this->addPortlets();
373 - $oTemplate = $this->oValidator->validateTemplate("ktcore/document/compare"); 375 + $oTemplate = $this->oValidator->validateTemplate('ktcore/document/compare');
374 $aTemplateData = array( 376 $aTemplateData = array(
375 - "context" => $this,  
376 - "document_id" => $document_id,  
377 - "document" => $oDocument,  
378 - "document_data" => $document_data,  
379 - "comparison_data" => $comparison_data,  
380 - "comparison_document" => $oComparison,  
381 - "fieldsets" => $fieldsets, 377 + 'context' => $this,
  378 + 'document_id' => $document_id,
  379 + 'document' => $oDocument,
  380 + 'document_data' => $document_data,
  381 + 'comparison_data' => $comparison_data,
  382 + 'comparison_document' => $oComparison,
  383 + 'fieldsets' => $fieldsets,
382 ); 384 );
383 - //var_dump($aTemplateData["comparison_data"]); 385 + //var_dump($aTemplateData['comparison_data']);
384 return $oTemplate->render($aTemplateData); 386 return $oTemplate->render($aTemplateData);
385 } 387 }
386 - 388 +
387 function do_error() { 389 function do_error() {
388 return '&nbsp;'; // don't actually do anything. 390 return '&nbsp;'; // don't actually do anything.
389 } 391 }
@@ -399,4 +401,4 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -399,4 +401,4 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
399 $oDispatcher = new ViewDocumentDispatcher; 401 $oDispatcher = new ViewDocumentDispatcher;
400 $oDispatcher->dispatch(); 402 $oDispatcher->dispatch();
401 403
402 -?> 404 -?>
  405 +?>
403 \ No newline at end of file 406 \ No newline at end of file