From 061933c9735dfd7601f601e7f09fc7ecf7c2de34 Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 16 May 2003 15:45:55 +0000 Subject: [PATCH] added commented archiving ui only allow collaboration if the document is not checked out added confirmation message for document approval --- presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc | 50 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc b/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc index 92fadf9..eb7cb53 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc @@ -72,7 +72,6 @@ function renderGenericMetaData($oDocument) { } - function renderTypeSpecificMetaData($oDocument) { $sQuery = "SELECT DF.name AS name, DFL.value AS value " . "FROM documents AS D INNER JOIN document_fields_link AS DFL ON D.id = DFL.document_id " . @@ -133,6 +132,24 @@ function renderNonEditableDocumentRouting($oDocument) { } +function renderDocumentArchiveSettings($oDocument) { + global $default; + $sQuery = "SELECT d.id, expiration_date, utilisation_threshold, 'Edit' as edit FROM $default->owl_archive_settings_table AS a " . + "INNER JOIN $default->owl_documents_table as d on a.document_id=d.id " . + "WHERE d.id = " . $oDocument->getID(); + + $aColumns = array("expiration_date", "utilisation_threshold", "edit"); + $aColumnHeaders = array("Expiration Date", "Utilisation Threshold"); + $aColumnTypes = array(1,1,3); + $aDBColumnArray = array("id"); + $aQueryStringVariableNames = array("fDocumentID"); + $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "90%", "$default->rootUrl/control.php?action=modifyDocumentArchiveSettings",$aDBColumnArray,$aQueryStringVariableNames); + $oPatternTableSqlQuery->setTableHeading("Archiving Settings"); + $oPatternTableSqlQuery->setEmptyTableMessage("No archiving settings"); + $oPatternTableSqlQuery->setDisplayColumnHeadings(true); + return $oPatternTableSqlQuery->render(); +} + function displayActionButtons($oDocument, $bEdit) { global $default; if ($bEdit) { @@ -163,6 +180,7 @@ function displayActionButtons($oDocument, $bEdit) { } $sToRender .= "graphicsUrl/widgets/download.gif\" border=\"0\" />\n"; $sToRender .= "graphicsUrl/widgets/discussion.gif\" border=\"0\" />\n"; + //$sToRender .= "graphicsUrl/widgets/archive.gif\" border=\"0\" />\n"; return $sToRender; } @@ -206,12 +224,27 @@ function getEditPage($oDocument) { $sToRender .= "\n"; $sToRender .= "\n"; - $sToRender .= "\t\n"; + $sToRender .= "\t
\n"; + /* + $sToRender .= "\t\n"; + $sToRender .= "\t\t\n"; + $sToRender .= "\t"; + // if there are no archiving settings then allow their addition + $oArchiveSettings = ArchiveSettings::getFromDocumentID($iDocumentID); + if (!$oArchiveSettings) { + $sToRender .= "\t\n"; + $sToRender .= "\t\t\n"; + $sToRender .= "\t"; + } + */ $sToRender .= "\t\n"; $sToRender .= "\t\t\n"; $sToRender .= "\t"; + $sToRender .= "\t\n"; - if ($oDocument->hasCollaboration() && (!DocumentCollaboration::documentCollaborationStarted($oDocument->getID())) && ($_SESSION["userID"] == $oDocument->getCreatorID())) { + + // collaboration cannot be started or approved/rejected unless the document is not checked out + if (!$oDocument->getIsCheckedOut() && $oDocument->hasCollaboration() && (!DocumentCollaboration::documentCollaborationStarted($oDocument->getID())) && ($_SESSION["userID"] == $oDocument->getCreatorID())) { //if not all collaboration steps have been set, then you cannot start the collaboration process //only the creator of the document can start the collaboration process $sToRender .= "\t\t\n"; } @@ -239,7 +275,7 @@ function getEditPage($oDocument) { $sToRender .= "\n"; } } - $sToRender .= "\t"; + $sToRender .= "\t"; $sToRender .= "\t
" . renderDocumentArchiveSettings($oDocument) . "
rootUrl/control.php?action=modifyDocumentArchiveSettings&fDocumentID=$iDocumentID\">graphicsUrl/widgets/edit.gif\" border=\"0\"/>
" . renderEditableDocumentRouting($oDocument) . "
graphicsUrl/widgets/begin.gif\" border=\"0\"/>"; @@ -219,9 +252,12 @@ function getEditPage($oDocument) { } else if (DocumentCollaboration::userIsPerformingCurrentCollaborationStep($oDocument->getID())) { //if the current user is responsible for an active step in the collaboration process $sToRender .= "\t\t\n"; - $sToRender .= "\t\t\n"; - $sToRender .= "\t\t\n"; - $sToRender .= "\t\t\n"; + $sToRender .= "\t\t\n"; + // collaboration cannot be started or approved/rejected unless the document is not checked out + if (!$oDocument->getIsCheckedOut()) { + $sToRender .= "\t\t\n"; + $sToRender .= "\t\t\n"; + } $sToRender .= "\t\t
You currently have an active role
in the collaboration process
graphicsUrl/widgets/approve.gif\" border=\"0\"/>rootUrl/control.php?action=collaborationStepReject&fDocumentID=$iDocumentID\">graphicsUrl/widgets/reject.gif\" border=\"0\"/>You currently have an active role
in the collaboration process
graphicsUrl/widgets/approve.gif\" border=\"0\"/>rootUrl/control.php?action=collaborationStepReject&fDocumentID=$iDocumentID\">graphicsUrl/widgets/reject.gif\" border=\"0\"/>
graphicsUrl/widgets/publish.gif\" border=\"0\"/>
"; $sToRender .= "\n"; $sToRender .= "\n"; -- libgit2 0.21.4