Commit 82fa496563e04a44e0ffb230a473d914b6807417
1 parent
3b5e2f55
Get all related fieldsets using KTMetadataUtil::fieldsetsForDocument()
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4023 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
7 additions
and
23 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/view.php
| ... | ... | @@ -141,28 +141,12 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { |
| 141 | 141 | // we always have a generic. |
| 142 | 142 | array_push($fieldsets, new GenericFieldsetDisplay()); |
| 143 | 143 | |
| 144 | - // FIXME can we key this on fieldset namespace? or can we have duplicates? | |
| 145 | - // now we get the other fieldsets, IF there is a valid doctype. | |
| 146 | - if ($is_valid_doctype) { | |
| 147 | - // these are the _actual_ fieldsets. | |
| 148 | - $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton(); | |
| 149 | - // and the generics | |
| 150 | - $activesets = KTFieldset::getGenericFieldsets(); | |
| 151 | - foreach ($activesets as $oFieldset) { | |
| 152 | - $displayClass = $fieldsetDisplayReg->getHandler($oFieldset->getNamespace()); | |
| 153 | - array_push($fieldsets, new $displayClass($oFieldset)); | |
| 154 | - } | |
| 155 | - | |
| 156 | - $activesets = KTFieldset::getForDocumentType($oDocument->getDocumentTypeID()); | |
| 157 | - foreach ($activesets as $oFieldset) { | |
| 158 | - $displayClass = $fieldsetDisplayReg->getHandler($oFieldset->getNamespace()); | |
| 159 | - array_push($fieldsets, new $displayClass($oFieldset)); | |
| 160 | - } | |
| 161 | - | |
| 162 | - | |
| 163 | - } | |
| 164 | - | |
| 165 | - // FIXME handle ad-hoc fieldsets. | |
| 144 | + $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton(); | |
| 145 | + | |
| 146 | + foreach (KTMetadataUtil::fieldsetsForDocument($oDocument) as $oFieldset) { | |
| 147 | + $displayClass = $fieldsetDisplayReg->getHandler($oFieldset->getNamespace()); | |
| 148 | + array_push($fieldsets, new $displayClass($oFieldset)); | |
| 149 | + } | |
| 166 | 150 | |
| 167 | 151 | $oTemplating = new KTTemplating; |
| 168 | 152 | $oTemplate = $oTemplating->loadTemplate("kt3/view_document"); |
| ... | ... | @@ -359,4 +343,4 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { |
| 359 | 343 | $oDispatcher = new ViewDocumentDispatcher; |
| 360 | 344 | $oDispatcher->dispatch(); |
| 361 | 345 | |
| 362 | -?> | |
| 363 | 346 | \ No newline at end of file |
| 347 | +?> | ... | ... |