Commit aab186c3a3102ad651de957a6c2f64b11c0b203b

Authored by michael
1 parent c1590939

(#2806) corrected publishing conditions and error messages


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2478 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
... ... @@ -460,7 +460,8 @@ function displayDependantDocumentButton($oDocument, $bEdit) {
460 460  
461 461 function displayPublishButton($oDocument, $bEdit) {
462 462 // only display the publish button for unpublished documents
463   - if (DocumentCollaboration::documentIsPendingWebPublishing($oDocument->getID())) {
  463 + if (!DocumentCollaboration::documentIsPublished($oDocument->getID()) &&
  464 + !DocumentCollaboration::documentIsPendingWebPublishing($oDocument->getID())) {
464 465 // if there is collaboration
465 466 if ($oDocument->hasCollaboration()) {
466 467 // only display publish button if collaboration is complete and you're the last user in the collaboration process (or a sysadmin)
... ... @@ -478,7 +479,11 @@ function displayPublishButton($oDocument, $bEdit) {
478 479 }
479 480 }
480 481 } else {
481   - $sDisabledText = "This document is already published.";
  482 + if (DocumentCollaboration::documentIsPublished($oDocument->getID())) {
  483 + $sDisabledText = "This document is already published.";
  484 + } else if (DocumentCollaboration::documentIsPendingWebPublishing($oDocument->getID())) {
  485 + $sDisabledText = "This document has been marked as pending publishing and the web publisher has been notified.";
  486 + }
482 487 }
483 488 return "<tr><td align=\"left\">" . displayButton("viewDocument", "fDocumentID=" . $oDocument->getID() . "&fForPublish=1", "publish", $sDisabledText) . "</td></tr>\n";
484 489 }
... ...