Commit c0828f9e0a8e1070209884a7885df97e13b91528
1 parent
342a68d2
Rip out collaboration-related code from the document view.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3990 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
0 additions
and
98 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
| ... | ... | @@ -301,100 +301,6 @@ function renderDocumentArchiveSettings($oDocument, $bEditable) { |
| 301 | 301 | return $sToRender; |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | -function renderEditableDocumentRouting($oDocument) { | |
| 305 | - global $default; | |
| 306 | - /*ok*/ $sQuery = array("SELECT D.id as document_id, GFAL.id as id, R.name AS role_name, COALESCE(U.name, U2.name) AS name, GFAL.precedence AS precedence, COALESCE(FURL.active,0) AS active, COALESCE(FURL.done, 0) AS done, 'Edit User' as edit " . | |
| 307 | - "FROM $default->documents_table AS D INNER JOIN $default->groups_folders_approval_table AS GFAL ON D.folder_id = GFAL.folder_id " . | |
| 308 | - "INNER JOIN $default->roles_table AS R ON GFAL.role_id = R.id " . | |
| 309 | - "LEFT OUTER JOIN $default->folders_user_roles_table AS FURL ON FURL.group_folder_approval_id = GFAL.id AND FURL.document_id = D.id " . | |
| 310 | - "LEFT OUTER JOIN $default->users_table AS U ON FURL.user_id = U.id " . | |
| 311 | - "LEFT OUTER JOIN $default->users_table AS U2 ON GFAL.user_id = U2.id " . | |
| 312 | - "WHERE D.id = ? " . | |
| 313 | - "ORDER BY GFAL.precedence, role_name ASC", $oDocument->getID()); | |
| 314 | - $aColumns = array("role_name", "name", "precedence", "active", "done", "edit"); | |
| 315 | - $aColumnHeaders = array(_("Role"), _("User"), _("Seq"), _("Active"), _("Done"), _("Edit")); | |
| 316 | - $aColumnTypes = array(1,1,1,2,2,3); | |
| 317 | - $aDBColumnArray = array("id","document_id","active","done"); | |
| 318 | - $aQueryStringVariableNames = array("fFolderCollaborationID", "fDocumentID","fIsActive","fIsDone"); | |
| 319 | - $aLinkURLs = array(5=>"$default->rootUrl/control.php?action=modifyDocumentRouting"); | |
| 320 | - | |
| 321 | - $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "500", $aLinkURLs,$aDBColumnArray,$aQueryStringVariableNames); | |
| 322 | - $oPatternTableSqlQuery->setTableHeading(_("Document Routing")); | |
| 323 | - $oPatternTableSqlQuery->setDisplayColumnHeadings(true); | |
| 324 | - | |
| 325 | - $sToRender .= "\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n"; | |
| 326 | - $sToRender .= "\t<tr>\n"; | |
| 327 | - $sToRender .= "\t\t<td>" . $oPatternTableSqlQuery->render() . "</td>\n"; | |
| 328 | - $sToRender .= "\t</tr>"; | |
| 329 | - $sToRender .= "\t<tr>\n"; | |
| 330 | - // display the begin collaboration button if: | |
| 331 | - // collaboration cannot be started or approved/rejected unless the document is not checked out | |
| 332 | - // the document has collaboration | |
| 333 | - // collaboration hasn't started | |
| 334 | - // the current user created the document, or is a system adminstrator | |
| 335 | - if (!$oDocument->getIsCheckedOut() && | |
| 336 | - $oDocument->hasCollaboration() && | |
| 337 | - (!DocumentCollaboration::documentCollaborationStarted($oDocument->getID())) && | |
| 338 | - ( ($_SESSION["userID"] == $oDocument->getCreatorID()) || Permission::userIsSystemAdministrator() ) ) { | |
| 339 | - //if not all collaboration steps have been set, then you cannot start the collaboration process | |
| 340 | - //only the creator of the document can start the collaboration process | |
| 341 | - $sToRender .= "\t\t<td><a href=" . $_SERVER['PHP_SELF'] . "?fDocumentID=" . $oDocument->getID() . "&fBeginCollaboration=1><img src=\"" . KTHtml::getBeginButton() . "\" border=\"0\"/></a>"; | |
| 342 | - $sToRender .= "</td>\n"; | |
| 343 | - // else if collboration has started and the current user has been assigned this step, display the approve/reject buttons | |
| 344 | - } else if (DocumentCollaboration::userIsPerformingCurrentCollaborationStep($oDocument->getID())) { | |
| 345 | - //if the current user is responsible for an active step in the collaboration process | |
| 346 | - $sToRender .= "\t\t<td><table border=\"0\"><tr>\n"; | |
| 347 | - $sToRender .= "\t\t<td><b>" . _("You currently have an active role in the collaboration process") . "</b></td>\n"; | |
| 348 | - // collaboration cannot be started or approved/rejected if the document is checked out | |
| 349 | - if (!$oDocument->getIsCheckedOut()) { | |
| 350 | - $sToRender .= "\t\t<td align=\"center\"><a onClick=\"return confirm('" . _("Are you sure you want to approve? You will not have access to this document until the collaboration process is complete (unless the document is rejected in a subsequent step)") . "');\" href=" . $_SERVER['PHP_SELF'] . "?fDocumentID=" . $oDocument->getID() . "&fCollaborationStepComplete=1><img src=\"" . KTHtml::getApproveButton() . "\" border=\"0\"/></a></td>\n"; | |
| 351 | - $sToRender .= "\t\t<td align=\"center\"><a href=\"$default->rootUrl/control.php?action=collaborationStepReject&fDocumentID=" . $oDocument->getID() . "\"><img src=\"" . KTHtml::getRejectButton() . "\" border=\"0\"/></a></td>\n"; | |
| 352 | - } | |
| 353 | - $sToRender .= "\t\t</tr></table></td>\n"; | |
| 354 | - } | |
| 355 | - | |
| 356 | - $sToRender .= "\t</tr>"; | |
| 357 | - $sToRender .= "\t</table>\n"; | |
| 358 | - | |
| 359 | - return $sToRender; | |
| 360 | -} | |
| 361 | - | |
| 362 | -function renderNonEditableDocumentRouting($oDocument) { | |
| 363 | - global $default; | |
| 364 | - /*ok*/ $sQuery = array("SELECT D.id as document_id, GFAL.id as id, R.name AS role_name, COALESCE(U.Name, 'Not assigned') AS name, GFAL.precedence AS precedence, COALESCE(FURL.active,0) AS active, COALESCE(FURL.done, 0) AS done " . | |
| 365 | - "FROM $default->documents_table AS D INNER JOIN $default->groups_folders_approval_table AS GFAL ON D.folder_id = GFAL.folder_id " . | |
| 366 | - "INNER JOIN $default->roles_table AS R ON GFAL.role_id = R.id " . | |
| 367 | - "LEFT OUTER JOIN $default->folders_user_roles_table AS FURL ON FURL.group_folder_approval_id = GFAL.id AND FURL.document_id = D.id " . | |
| 368 | - "LEFT OUTER JOIN $default->users_table AS U ON FURL.user_id = U.id " . | |
| 369 | - "WHERE D.id = ? " . | |
| 370 | - "ORDER BY GFAL.precedence, role_name ASC", $oDocument->getID()); | |
| 371 | - | |
| 372 | - $aColumns = array("role_name", "name", "precedence", "active", "done"); | |
| 373 | - $aColumnHeaders = array(_("Role"), _("User"), _("Seq"), _("Active"), _("Done")); | |
| 374 | - $aColumnTypes = array(1,1,1,2,2); | |
| 375 | - $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "500", "$default->rootUrl/control.php?action=modifyDocumentRouting",$aDBColumnArray,$aQueryStringVariableNames); | |
| 376 | - $oPatternTableSqlQuery->setTableHeading(_("Document Routing")); | |
| 377 | - $oPatternTableSqlQuery->setDisplayColumnHeadings(true); | |
| 378 | - | |
| 379 | - $sToRender .= "\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n"; | |
| 380 | - $sToRender .= "\t<tr>\n"; | |
| 381 | - $sToRender .= "\t\t<td>" . $oPatternTableSqlQuery->render() . "</td>\n"; | |
| 382 | - $sToRender .= "\t</tr>"; | |
| 383 | - | |
| 384 | - if (DocumentCollaboration::userIsPerformingCurrentCollaborationStep($oDocument->getID())) { | |
| 385 | - //if the current user is responsible for an active step in the collaboration process | |
| 386 | - $sToRender .= "\t\t<tr><td><table border=\"0\"><tr>\n"; | |
| 387 | - $sToRender .= "\t\t<td><b>" . _("You currently have an active role in the collaboration process") . "</b></td>\n"; | |
| 388 | - $sToRender .= "\t\t<td align=\"center\"><a href=" . $_SERVER['PHP_SELF'] . "?fDocumentID=" . $oDocument->getID() . "&fCollaborationStepComplete=1><img src=\"" . KTHtml::getApproveButton() . "\" border=\"0\"/></a></td>\n"; | |
| 389 | - $sToRender .= "\t\t<td align=\"center\"><a href=\"$default->rootUrl/control.php?action=collaborationStepReject&fDocumentID=" . $oDocument->getID() . "\"><img src=\"" . KTHtml::getRejectButton() . "\" border=\"0\"/></a></td>\n"; | |
| 390 | - $sToRender .= "\t\t</tr></table></td></tr>\n"; | |
| 391 | - } | |
| 392 | - | |
| 393 | - $sToRender .= "\t</table>\n"; | |
| 394 | - | |
| 395 | - return $sToRender; | |
| 396 | -} | |
| 397 | - | |
| 398 | 304 | function renderEditableLinkedDocuments($oDocument) { |
| 399 | 305 | global $default; |
| 400 | 306 | |
| ... | ... | @@ -628,7 +534,6 @@ function getPage($oDocument, $bEdit, $sStatusMessage = "") { |
| 628 | 534 | $sToRender .= renderDocumentSection("genericMetaData", _("Generic Meta Data"), $bDisplayLink, $oDocument->getID()); |
| 629 | 535 | $sToRender .= renderDocumentSection("typeSpecificMetaData", _("Type Specific Meta Data"), $bDisplayLink, $oDocument->getID()); |
| 630 | 536 | $sToRender .= renderDocumentSection("archiveSettings", _("Archive Settings"), $bDisplayLink, $oDocument->getID()); |
| 631 | - $sToRender .= renderDocumentSection("documentRouting", _("Document Routing"), $bDisplayLink, $oDocument->getID()); | |
| 632 | 537 | $sToRender .= renderDocumentSection("linkedDocuments", _("Linked Documents"), $bDisplayLink, $oDocument->getID()); |
| 633 | 538 | $sToRender .= renderDocumentSection("metadataVersions", _("Metadata Versions"), $bDisplayLink, $oDocument->getID()); |
| 634 | 539 | |
| ... | ... | @@ -648,10 +553,8 @@ function getPage($oDocument, $bEdit, $sStatusMessage = "") { |
| 648 | 553 | $sToRender .= renderSectionDiv("typeSpecificMetaData", renderTypeSpecificMetaData($oDocument, $bEdit)); |
| 649 | 554 | $sToRender .= renderSectionDiv("archiveSettings", renderDocumentArchiveSettings($oDocument, $bEdit)); |
| 650 | 555 | if ($bEdit) { |
| 651 | - $sToRender .= renderSectionDiv("documentRouting", renderEditableDocumentRouting($oDocument)); | |
| 652 | 556 | $sToRender .= renderSectionDiv("linkedDocuments", renderEditableLinkedDocuments($oDocument) . renderDependantDocuments($oDocument, $bEdit)); |
| 653 | 557 | } else { |
| 654 | - $sToRender .= renderSectionDiv("documentRouting", renderNonEditableDocumentRouting($oDocument)); | |
| 655 | 558 | $sToRender .= renderSectionDiv("linkedDocuments", renderNonEditableLinkedDocuments($oDocument, $bEdit) . renderDependantDocuments($oDocument, $bEdit)); |
| 656 | 559 | } |
| 657 | 560 | $sToRender .= renderSectionDiv("metadataVersions", renderDocumentVersions($oDocument)); |
| ... | ... | @@ -692,7 +595,6 @@ function getStatusPage($oDocument, $sStatusMessage) { |
| 692 | 595 | $sToRender .= renderDocumentSection("genericMetaData", _("Generic Meta Data"), $bDisplayLink, $oDocument->getID()); |
| 693 | 596 | $sToRender .= renderDocumentSection("typeSpecificMetaData", _("Type Specific Meta Data"), $bDisplayLink, $oDocument->getID()); |
| 694 | 597 | $sToRender .= renderDocumentSection("archiveSettings", _("Archive Settings"), $bDisplayLink, $oDocument->getID()); |
| 695 | - $sToRender .= renderDocumentSection("documentRouting", _("Document Routing"), $bDisplayLink, $oDocument->getID()); | |
| 696 | 598 | $sToRender .= renderDocumentSection("linkedDocuments", _("Linked Documents"), $bDisplayLink, $oDocument->getID()); |
| 697 | 599 | $sToRender .= renderDocumentSection("metadataVersions", _("Document Versions"), $bDisplayLink, $oDocument->getID()); |
| 698 | 600 | $sToRender .= "</table>"; | ... | ... |