Commit 702ade26897a0ff88ac0212361f12d279e314e5d

Authored by mukhtar
1 parent a5bdc823

moved checkout button to the front


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1441 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
@@ -193,6 +193,15 @@ function getEditPage($oDocument) { @@ -193,6 +193,15 @@ function getEditPage($oDocument) {
193 $sToRender .= "</table>\n"; 193 $sToRender .= "</table>\n";
194 $sToRender .= "<table>\n"; 194 $sToRender .= "<table>\n";
195 $sToRender .= "<tr>\n"; 195 $sToRender .= "<tr>\n";
  196 +
  197 + // display the check in button if the document is checked out and you checked the document out
  198 + if ($oDocument->getIsCheckedOut() && ($oDocument->getCheckedOutUserID() == $_SESSION["userID"])) {
  199 + $sToRender .= "<td><a href=\"" . generateControllerLink("checkInDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/checkin.gif\" border=\"0\" /></a></td>\n";
  200 + // otherwise display the check out button
  201 + } else {
  202 + $sToRender .= "<td><a href=\"" . generateControllerLink("checkOutDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/checkout.gif\" border=\"0\" /></a></td>\n";
  203 + }
  204 +
196 if ($default->phpSniff->property("browser") == "ie") { 205 if ($default->phpSniff->property("browser") == "ie") {
197 $sToRender .= "<td><a href=\"http://" . $default->serverName . $_SERVER["PHP_SELF"] . "?fDocumentID=" . $oDocument->getID() . "&fForDownload=1\"><img src=\"$default->graphicsUrl/widgets/download.gif\" border=\"0\" /></a></td>\n"; 206 $sToRender .= "<td><a href=\"http://" . $default->serverName . $_SERVER["PHP_SELF"] . "?fDocumentID=" . $oDocument->getID() . "&fForDownload=1\"><img src=\"$default->graphicsUrl/widgets/download.gif\" border=\"0\" /></a></td>\n";
198 } else { 207 } else {
@@ -202,14 +211,7 @@ function getEditPage($oDocument) { @@ -202,14 +211,7 @@ function getEditPage($oDocument) {
202 $sToRender .= "<td><a href=\"" . generateControllerLink("deleteDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/delete.gif\" border=\"0\" /></a></td>\n"; 211 $sToRender .= "<td><a href=\"" . generateControllerLink("deleteDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/delete.gif\" border=\"0\" /></a></td>\n";
203 $sToRender .= "<td><a href=\"" . generateControllerLink("viewHistory", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/history.gif\" border=\"0\" /></a></td>\n"; 212 $sToRender .= "<td><a href=\"" . generateControllerLink("viewHistory", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/history.gif\" border=\"0\" /></a></td>\n";
204 213
205 - // display the check in button if the document is checked out and you checked the document out  
206 - if ($oDocument->getIsCheckedOut() && ($oDocument->getCheckedOutUserID() == $_SESSION["userID"])) {  
207 - $sToRender .= "<td><a href=\"" . generateControllerLink("checkInDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/checkin.gif\" border=\"0\" /></a></td>\n";  
208 - // otherwise display the check out button  
209 - } else {  
210 - $sToRender .= "<td><a href=\"" . generateControllerLink("checkOutDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/checkout.gif\" border=\"0\" /></a></td>\n";  
211 - }  
212 - 214 +
213 // display the unsubscribe button if the user is subscribed to the document 215 // display the unsubscribe button if the user is subscribed to the document
214 if (Subscription::exists($_SESSION["userID"], $oDocument->getID(), SubscriptionConstants::subscriptionType("DocumentSubscription"))) { 216 if (Subscription::exists($_SESSION["userID"], $oDocument->getID(), SubscriptionConstants::subscriptionType("DocumentSubscription"))) {
215 $sToRender .= "<td><a href=\"" . generateControllerLink("removeSubscription", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/unsubscribe.gif\" border=\"0\" /></a></td>\n"; 217 $sToRender .= "<td><a href=\"" . generateControllerLink("removeSubscription", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/unsubscribe.gif\" border=\"0\" /></a></td>\n";