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,6 +26,8 @@ | ||
| 26 | * @package documentmanagement | 26 | * @package documentmanagement |
| 27 | */ | 27 | */ |
| 28 | 28 | ||
| 29 | +require_once(KT_LIB_DIR . '/workflow/workflowstate.inc.php'); | ||
| 30 | + | ||
| 29 | function renderDocumentPath($oDocument, $bDisplayActions = false) { | 31 | function renderDocumentPath($oDocument, $bDisplayActions = false) { |
| 30 | global $default; | 32 | global $default; |
| 31 | $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); | 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,7 +79,6 @@ function renderDocumentData($oDocument, $bEditable, $sStatusMessage = "") { | ||
| 77 | $map = array(); | 79 | $map = array(); |
| 78 | $iDocumentCount = 0; | 80 | $iDocumentCount = 0; |
| 79 | foreach ($aDocuments as $iDocumentID) { | 81 | foreach ($aDocuments as $iDocumentID) { |
| 80 | - $map['Metadata Version'] = KTUtil::arrayGet($map, 'Metadata Version', array_fill(0, $iDocumentsLen, null)); | ||
| 81 | $oThisDocument =& Document::get($iDocumentID); | 82 | $oThisDocument =& Document::get($iDocumentID); |
| 82 | if (PEAR::isError($oThisDocument)) { | 83 | if (PEAR::isError($oThisDocument)) { |
| 83 | continue; | 84 | continue; |
| @@ -85,13 +86,19 @@ function renderDocumentData($oDocument, $bEditable, $sStatusMessage = "") { | @@ -85,13 +86,19 @@ function renderDocumentData($oDocument, $bEditable, $sStatusMessage = "") { | ||
| 85 | if ($oThisDocument === false) { | 86 | if ($oThisDocument === false) { |
| 86 | continue; | 87 | continue; |
| 87 | } | 88 | } |
| 88 | - $map['Metadata Version'][$iDocumentCount] = $oThisDocument->getMetadataVersion(); | ||
| 89 | $aRow = DBUtil::getOneResult(array($sQuery, array($iDocumentID))); | 89 | $aRow = DBUtil::getOneResult(array($sQuery, array($iDocumentID))); |
| 90 | foreach ($aColumns as $dbname => $prettyname) { | 90 | foreach ($aColumns as $dbname => $prettyname) { |
| 91 | $newarray = KTUtil::arrayGet($map, $prettyname, array_fill(0, $iDocumentsLen, null)); | 91 | $newarray = KTUtil::arrayGet($map, $prettyname, array_fill(0, $iDocumentsLen, null)); |
| 92 | $newarray[$iDocumentCount] = $aRow[$dbname]; | 92 | $newarray[$iDocumentCount] = $aRow[$dbname]; |
| 93 | $map[$prettyname] = $newarray; | 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 | $iDocumentCount++; | 102 | $iDocumentCount++; |
| 96 | } | 103 | } |
| 97 | 104 |