Commit 7bf69e75dcbe9913b56d3a12bb9fd14f76ba5046
1 parent
e790aaa3
Show workflow state in the document details page.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3754 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
9 additions
and
2 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
| ... | ... | @@ -26,6 +26,8 @@ |
| 26 | 26 | * @package documentmanagement |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | +require_once(KT_LIB_DIR . '/workflow/workflowstate.inc.php'); | |
| 30 | + | |
| 29 | 31 | function renderDocumentPath($oDocument, $bDisplayActions = false) { |
| 30 | 32 | global $default; |
| 31 | 33 | $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); |
| ... | ... | @@ -77,7 +79,6 @@ function renderDocumentData($oDocument, $bEditable, $sStatusMessage = "") { |
| 77 | 79 | $map = array(); |
| 78 | 80 | $iDocumentCount = 0; |
| 79 | 81 | foreach ($aDocuments as $iDocumentID) { |
| 80 | - $map['Metadata Version'] = KTUtil::arrayGet($map, 'Metadata Version', array_fill(0, $iDocumentsLen, null)); | |
| 81 | 82 | $oThisDocument =& Document::get($iDocumentID); |
| 82 | 83 | if (PEAR::isError($oThisDocument)) { |
| 83 | 84 | continue; |
| ... | ... | @@ -85,13 +86,19 @@ function renderDocumentData($oDocument, $bEditable, $sStatusMessage = "") { |
| 85 | 86 | if ($oThisDocument === false) { |
| 86 | 87 | continue; |
| 87 | 88 | } |
| 88 | - $map['Metadata Version'][$iDocumentCount] = $oThisDocument->getMetadataVersion(); | |
| 89 | 89 | $aRow = DBUtil::getOneResult(array($sQuery, array($iDocumentID))); |
| 90 | 90 | foreach ($aColumns as $dbname => $prettyname) { |
| 91 | 91 | $newarray = KTUtil::arrayGet($map, $prettyname, array_fill(0, $iDocumentsLen, null)); |
| 92 | 92 | $newarray[$iDocumentCount] = $aRow[$dbname]; |
| 93 | 93 | $map[$prettyname] = $newarray; |
| 94 | 94 | } |
| 95 | + $oState =& KTWorkflowState::getByDocument($oThisDocument); | |
| 96 | + $map['Workflow state'] = KTUtil::arrayGet($map, 'Metadata Version', array_fill(0, $iDocumentsLen, null)); | |
| 97 | + if ($oState) { | |
| 98 | + $map['Workflow state'][$iDocumentCount] = $oState->getHumanName(); | |
| 99 | + } else { | |
| 100 | + $map['Workflow state'][$iDocumentCount] = "Not in workflow"; | |
| 101 | + } | |
| 95 | 102 | $iDocumentCount++; |
| 96 | 103 | } |
| 97 | 104 | ... | ... |