From a6e28e40b7366ffbc48852bb2ce859e6bb0c2fd2 Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Tue, 22 Jul 2003 09:06:22 +0000 Subject: [PATCH] tidied and added sysadmin access overrides for document routing and publishing buttons --- presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc b/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc index 2dde180..f847ba3 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc @@ -207,13 +207,20 @@ function renderEditableDocumentRouting($oDocument) { $sToRender .= "\t\t" . $oPatternTableSqlQuery->render() . "\n"; $sToRender .= "\t"; $sToRender .= "\t\n"; - // FIXME display messages instead of just not displaying button - // 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())) { + // display the begin collaboration button if: + // collaboration cannot be started or approved/rejected unless the document is not checked out + // the document has collaboration + // collaboration hasn't started + // the current user created the document, or is a system adminstrator + if (!$oDocument->getIsCheckedOut() && + $oDocument->hasCollaboration() && + (!DocumentCollaboration::documentCollaborationStarted($oDocument->getID())) && + ( ($_SESSION["userID"] == $oDocument->getCreatorID()) || Permission::userIsSystemAdministrator() ) ) { //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\tgraphicsUrl/widgets/begin.gif\" border=\"0\"/>"; $sToRender .= "\n"; + // else if collboration has started and the current user has been assigned this step, display the approve/reject buttons } else if (DocumentCollaboration::userIsPerformingCurrentCollaborationStep($oDocument->getID())) { //if the current user is responsible for an active step in the collaboration process $sToRender .= "\t\t\n"; @@ -224,18 +231,19 @@ function renderEditableDocumentRouting($oDocument) { $sToRender .= "\t\t\n"; } $sToRender .= "\t\t
rootUrl/control.php?action=collaborationStepReject&fDocumentID=" . $oDocument->getID() . "\">graphicsUrl/widgets/reject.gif\" border=\"0\"/>
\n"; - } - if (!DocumentCollaboration::documentIsPendingWebPublishing($oDocument->getID())) { - // only display for unpublished documents + } + + // only display the publish button for unpublished documents + if (!DocumentCollaboration::documentIsPendingWebPublishing($oDocument->getID())) { // if there is collaboration if ($oDocument->hasCollaboration()) { - // only display publish button if collaboration is complete and you're the last user in the collaboration process - if (DocumentCollaboration::documentCollaborationDone($oDocument->getID()) && ($_SESSION["userID"] == DocumentCollaboration::getLastCollaboratorID($oDocument->getID()))) { + // only display publish button if collaboration is complete and you're the last user in the collaboration process (or a sysadmin) + if (DocumentCollaboration::documentCollaborationDone($oDocument->getID()) && + ( ($_SESSION["userID"] == DocumentCollaboration::getLastCollaboratorID($oDocument->getID())) || Permission::userIsSystemAdministrator() ) ) { $sToRender .= "graphicsUrl/widgets/publish.gif\" border=\"0\"/>\n"; } - } else if ($_SESSION["userID"] == $oDocument->getCreatorID()) { - // no collaboration for this folder, so only the creator can request publication - // ??: or an administrator? + } else if ( ($_SESSION["userID"] == $oDocument->getCreatorID()) || Permission::userIsSystemAdministrator() ) { + // no collaboration for this folder, so only the creator (or an administrator) can request publication $sToRender .= "graphicsUrl/widgets/publish.gif\" border=\"0\"/>\n"; } } -- libgit2 0.21.4