Commit 11124d4bfabda0c0affb73e578334344b5165db7

Authored by Michael Joseph
1 parent 2aac8c72

changed document routing active/done to booleans in pattern

(#2677) fixed archive and move display conditions


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2446 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
... ... @@ -194,7 +194,7 @@ function renderEditableDocumentRouting($oDocument) {
194 194 "ORDER BY GFAL.precedence, role_name ASC";
195 195 $aColumns = array("role_name", "name", "precedence", "active", "done", "edit");
196 196 $aColumnHeaders = array("Role", "User", "Seq", "Active", "Done", "");
197   - $aColumnTypes = array(1,1,1,1,1,3);
  197 + $aColumnTypes = array(1,1,1,2,2,3);
198 198 $aDBColumnArray = array("id","document_id","active","done");
199 199 $aQueryStringVariableNames = array("fFolderCollaborationID", "fDocumentID","fIsActive","fIsDone");
200 200 $aLinkURLs = array(5=>"$default->rootUrl/control.php?action=modifyDocumentRouting");
... ... @@ -252,7 +252,7 @@ function renderNonEditableDocumentRouting($oDocument) {
252 252  
253 253 $aColumns = array("role_name", "name", "precedence", "active", "done");
254 254 $aColumnHeaders = array("Role", "User", "Seq", "Active", "Done");
255   - $aColumnTypes = array(1,1,1,1,1);
  255 + $aColumnTypes = array(1,1,1,2,2);
256 256 $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "500", "$default->rootUrl/control.php?action=modifyDocumentRouting",$aDBColumnArray,$aQueryStringVariableNames);
257 257 $oPatternTableSqlQuery->setTableHeading("Document Routing");
258 258 $oPatternTableSqlQuery->setDisplayColumnHeadings(true);
... ... @@ -404,10 +404,11 @@ function displayMoveButton($oDocument, $bEdit) {
404 404 $sQueryString = "fFolderID=" . $oDocument->getFolderID() . "&fDocumentID=" . $oDocument->getID();
405 405 // documents in collaboration and checked out documents can't be moved
406 406 if ($oDocument->getIsCheckedOut()) {
407   - $sDisabledText = "The document is checked out";
  407 + $sDisabledText = "The document is checked out and cannot be moved.";
408 408 }
409   - if (DocumentCollaboration::documentCollaborationStarted($oDocument->getID())) {
410   - $sDisabledText = "The document is in collaboration";
  409 + if (DocumentCollaboration::documentCollaborationStarted($oDocument->getID()) &&
  410 + !DocumentCollaboration::documentCollaborationDone($oDocument->getID())) {
  411 + $sDisabledText = "The document is in collaboration and cannot be moved.";
411 412 }
412 413 } else {
413 414 $sDisabledText = "You do not have write access to this document";
... ... @@ -439,7 +440,9 @@ function displayArchiveButton($oDocument, $bEdit) {
439 440 // and if the document is not in collaboration
440 441 if ($bEdit) {
441 442 if (!$oDocument->getIsCheckedOut()) {
442   - if ($oDocument->hasCollaboration() || DocumentCollaboration::documentCollaborationStarted($oDocument->getID())) {
  443 + if ($oDocument->hasCollaboration() &&
  444 + DocumentCollaboration::documentCollaborationStarted($oDocument->getID()) &&
  445 + !DocumentCollaboration::documentCollaborationDone($oDocument->getID())) {
443 446 $sDisabledText = "This document is in collaboration and cannot be archived";
444 447 }
445 448 } else {
... ...