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 .= "
getID() . "&fForDownload=1") . "\"> graphicsUrl/widgets/download.gif\" border=\"0\" /> | \n";
$sToRender .= "getID() . "&fForDiscussion=1") . "\"> graphicsUrl/widgets/discussion.gif\" border=\"0\" /> | \n";
+ //$sToRender .= "getID()) . "\"> 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| " . renderDocumentArchiveSettings($oDocument) . " | \n";
+ $sToRender .= "\t ";
+ // if there are no archiving settings then allow their addition
+ $oArchiveSettings = ArchiveSettings::getFromDocumentID($iDocumentID);
+ if (!$oArchiveSettings) {
+ $sToRender .= "\t\n";
+ $sToRender .= "\t\trootUrl/control.php?action=modifyDocumentArchiveSettings&fDocumentID=$iDocumentID\"> graphicsUrl/widgets/edit.gif\" border=\"0\"/> | \n";
+ $sToRender .= "\t ";
+ }
+ */
$sToRender .= "\t\n";
$sToRender .= "\t\t| " . renderEditableDocumentRouting($oDocument) . " | \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\tgetID() . "&fBeginCollaboration=1> 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";
}
@@ -239,7 +275,7 @@ function getEditPage($oDocument) {
$sToRender .= "getID() . "&fForPublish=1> graphicsUrl/widgets/publish.gif\" border=\"0\"/> | \n";
}
}
- $sToRender .= "\t ";
+ $sToRender .= "\t";
$sToRender .= "\t ";
$sToRender .= "\n";
$sToRender .= "\n";
|