Commit c6fbdee48c4893c0a974eb43343306703847eb1d

Authored by Michael Joseph
1 parent 1e7af37e

added ie ssl hack for inline viewing (#1665) and logic for displaying the web pu…

…blishing button (#1658)


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1535 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
... ... @@ -29,7 +29,13 @@ function renderDocumentPath($oDocument) {
29 29 global $default;
30 30 $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"])));
31 31 $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td");
32   - $sDocumentPath = displayFolderPathLink(Folder::getFolderPathAsArray($oDocument->getFolderID()), Folder::getFolderPathNamesAsArray($oDocument->getFolderID()), "$default->rootUrl/control.php?action=browse") . " > <a href=\"$default->rootUrl/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php?fDocumentID=" . $oDocument->getID() . "&fForInlineView=1\" target=\"View document\">" . $oDocument->getName() . "</a>";
  32 + $sDocumentPath = displayFolderPathLink(Folder::getFolderPathAsArray($oDocument->getFolderID()), Folder::getFolderPathNamesAsArray($oDocument->getFolderID()), "$default->rootUrl/control.php?action=browse") . " > ";
  33 + // IE ssl download hack- don't use ssl to download
  34 + if ($default->phpSniff->property("browser") == "ie") {
  35 + $sDocumentPath .= "<a href=\"http://" . $default->serverName . "$default->rootUrl/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php?fDocumentID=" . $oDocument->getID() . "&fForInlineView=1\" target=\"View document\">" . $oDocument->getName() . "</a>";
  36 + } else {
  37 + $sDocumentPath .= "<a href=\"$default->rootUrl/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php?fDocumentID=" . $oDocument->getID() . "&fForInlineView=1\" target=\"View document\">" . $oDocument->getName() . "</a>";
  38 + }
33 39 return "<table border=0 cellpadding=\"5\" width = 100%><tr><td bgcolor=\"$sTDBGColour\">$sDocumentPath</td></tr></table>\n";
34 40 }
35 41  
... ... @@ -181,11 +187,20 @@ function getEditPage($oDocument) {
181 187 $sToRender .= "\t\t<td align=\"center\"><a href=" . $_SERVER['PHP_SELF'] . "?fDocumentID=" . $oDocument->getID() . "&fCollaborationStepComplete=1><img src=\"$default->graphicsUrl/widgets/approve.gif\" border=\"0\"/></a></td>\n";
182 188 $sToRender .= "\t\t<td align=\"center\"><a href=\"$default->rootUrl/control.php?action=collaborationStepReject&fDocumentID=$iDocumentID\"><img src=\"$default->graphicsUrl/widgets/reject.gif\" border=\"0\"/></a></td>\n";
183 189 $sToRender .= "\t\t</tr></table></td>\n";
184   - } else if (!$oDocument->hasCollaboration() || Document::documentCollaborationDone($oDocument->getID())) {
185   - // only display publish button if there is no collaboration or collaboration is complete
186   - if (!Document::documentIsPendingWebPublishing($iDocumentID) && ($_SESSION["userID"] == $oDocument->getCreatorID())) {
187   - $sToRender .= "<td><a href=" . $_SERVER['PHP_SELF'] . "?fDocumentID=" . $oDocument->getID() . "&fForPublish=1><img src=\"$default->graphicsUrl/widgets/publish.gif\" border=\"0\"/></a></td>\n";
188   - }
  190 + }
  191 + // only display for unpublished documents
  192 + if (Document::documentIsPendingWebPublishing($iDocumentID)) {
  193 + // if there is collaboration
  194 + if ($oDocument->hasCollaboration()) {
  195 + // only display publish button if collaboration is complete and you're the last user in the collaboration process
  196 + if (Document::documentCollaborationDone($oDocument->getID()) && ($_SESSION["userID"] == Document::getLastCollaboratorID($iDocumentID))) {
  197 + $sToRender .= "<td><a href=" . $_SERVER['PHP_SELF'] . "?fDocumentID=" . $oDocument->getID() . "&fForPublish=1><img src=\"$default->graphicsUrl/widgets/publish.gif\" border=\"0\"/></a></td>\n";
  198 + }
  199 + } else if ($_SESSION["userID"] == $oDocument->getCreatorID()) {
  200 + // no collaboration for this folder, so only the originator can request publication
  201 + // ??: or an administrator?
  202 + $sToRender .= "<td><a href=" . $_SERVER['PHP_SELF'] . "?fDocumentID=" . $oDocument->getID() . "&fForPublish=1><img src=\"$default->graphicsUrl/widgets/publish.gif\" border=\"0\"/></a></td>\n";
  203 + }
189 204 }
190 205 $sToRender .= "\t</tr>";
191 206 $sToRender .= "\t</table>";
... ...