Commit c1285731e9a04389fc5a6911c386214a59e61623
1 parent
a6247f40
Document Checkout admin added
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2189 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
200 additions
and
0 deletions
presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/editDocCheckoutBL.php
0 โ 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | +* BL information for adding a Link | ||
| 4 | +* | ||
| 5 | +* @author Mukhtar Dharsey | ||
| 6 | +* @date 5 February 2003 | ||
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | ||
| 8 | +* | ||
| 9 | +*/ | ||
| 10 | + | ||
| 11 | +require_once("../../../../../config/dmsDefaults.php"); | ||
| 12 | + | ||
| 13 | +if (checkSession()) { | ||
| 14 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | ||
| 15 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternEditableListFromQuery.inc"); | ||
| 16 | + require_once("editDocCheckoutUI.inc"); | ||
| 17 | + require_once("$default->fileSystemRoot/lib/documentmanagement/document.inc"); | ||
| 18 | + require_once("$default->fileSystemRoot/lib/security/permission.inc"); | ||
| 19 | + require_once("$default->fileSystemRoot/lib/links/link.inc"); | ||
| 20 | + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | ||
| 21 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | ||
| 22 | + require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | ||
| 23 | + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | ||
| 24 | + require_once("$default->fileSystemRoot/presentation/Html.inc"); | ||
| 25 | + | ||
| 26 | + global $default; | ||
| 27 | + $oPatternCustom = & new PatternCustom(); | ||
| 28 | + | ||
| 29 | + $oPatternCustom->addHtml(renderHeading("Edit Document Checkout")); | ||
| 30 | + | ||
| 31 | + if (isset($fUpdate)){ | ||
| 32 | + if (isset($fDocID)){ | ||
| 33 | + $oDoc = Document::get($fDocID); | ||
| 34 | + | ||
| 35 | + if (($oDoc->getIsCheckedOut() > 0 && $fDocCheckout=="on" ) || | ||
| 36 | + ($oDoc->getIsCheckedOut() == 0 && $fDocCheckout=="" )){ | ||
| 37 | + | ||
| 38 | + $oPatternCustom->setErrorMessage("No changes were made to the document checkout."); | ||
| 39 | + }else { | ||
| 40 | + if ($fDocCheckout=="on"){ | ||
| 41 | + $oDoc->setIsCheckedOut(1); | ||
| 42 | + }else { | ||
| 43 | + $oDoc->setIsCheckedOut(0); | ||
| 44 | + $oDoc->setCheckedOutUserID(-1); | ||
| 45 | + } | ||
| 46 | + if ($oDoc->update()){ | ||
| 47 | + $oPatternCustom->addHtml(getEditCheckoutSuccessPage()); | ||
| 48 | + } else { | ||
| 49 | + $oPatternCustom->setErrorMessage("Error while trying to update the document checkout."); | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + } | ||
| 53 | + } else if (isset($fDocID)){ | ||
| 54 | + $oPatternCustom->addHtml($fDocCheckout . getEditCheckoutPage($fDocID)); | ||
| 55 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fUpdate=1&fDocID=$fDocID"); | ||
| 56 | + } | ||
| 57 | + //render the page | ||
| 58 | + $main->setCentralPayload($oPatternCustom); | ||
| 59 | + $main->setHasRequiredFields(true); | ||
| 60 | + $main->render(); | ||
| 61 | +} | ||
| 62 | +?> |
presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/editDocCheckoutUI.inc
0 โ 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | +* Presentation information for adding a link | ||
| 4 | +* | ||
| 5 | +* @author Mukhtar Dharsey | ||
| 6 | +* @date 5 February 2003 | ||
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | ||
| 8 | +* | ||
| 9 | +*/ | ||
| 10 | + | ||
| 11 | + | ||
| 12 | +function getEditCheckoutSuccessPage(){ | ||
| 13 | + global $default; | ||
| 14 | + | ||
| 15 | + $sToRender .= "Succesfully updated document checkout.\n"; | ||
| 16 | + $sToRender .= "<a href=\"$default->rootUrl/control.php?action=listDocs\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a>"; | ||
| 17 | + | ||
| 18 | + return $sToRender; | ||
| 19 | + | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +function getEditCheckoutPage($fDocID){ | ||
| 23 | + global $default; | ||
| 24 | + | ||
| 25 | + $oDoc = Document::get($fDocID); | ||
| 26 | + | ||
| 27 | + $sToRender .= "<table>\n"; | ||
| 28 | + $sToRender .= "<tr>\n"; | ||
| 29 | + $sToRender .= "<td>\n"; | ||
| 30 | + $sToRender .= "<b>Document Name: </b>" . $oDoc->getName(); | ||
| 31 | + $sToRender .= "</td>\n"; | ||
| 32 | + $sToRender .= "</tr>\n"; | ||
| 33 | + $sToRender .= "<tr>\n"; | ||
| 34 | + $sToRender .= "<td>\n"; | ||
| 35 | + $sToRender .= "<b>Checked out?: </b>"; | ||
| 36 | + | ||
| 37 | + if($oDoc->getIsCheckedOut() > 0){ | ||
| 38 | + $bCheckedOut = "checked"; | ||
| 39 | + } | ||
| 40 | + $sToRender .= "<input type=checkbox $bCheckedOut name=fDocCheckout>"; | ||
| 41 | + | ||
| 42 | + $sToRender .= "</td>\n"; | ||
| 43 | + $sToRender .= "</tr>\n"; | ||
| 44 | + $sToRender .= "<tr>\n"; | ||
| 45 | + $sToRender .= "<td align=right>\n"; | ||
| 46 | + $sToRender .= getUpdateButton(); | ||
| 47 | + $sToRender .= "</td>\n"; | ||
| 48 | + $sToRender .= "<td >\n"; | ||
| 49 | + $sToRender .= getCancelButton(); | ||
| 50 | + $sToRender .= "</td>\n"; | ||
| 51 | + $sToRender .= "</tr>\n"; | ||
| 52 | + $sToRender .= "</table>\n"; | ||
| 53 | + | ||
| 54 | + return $sToRender; | ||
| 55 | + | ||
| 56 | +} | ||
| 57 | + | ||
| 58 | +// gets the updatebutton when a unit is selected | ||
| 59 | +function getUpdateButton() { | ||
| 60 | + global $default; | ||
| 61 | + | ||
| 62 | + return "<input type=\"image\" src =\"$default->graphicsUrl/widgets/update.gif\" value=\"submit\" border=\"0\"/>\n"; | ||
| 63 | +} | ||
| 64 | + | ||
| 65 | +// gets the cancel button when a unit is selected | ||
| 66 | +function getCancelButton() { | ||
| 67 | + global $default; | ||
| 68 | + | ||
| 69 | + return "<a href=\"$default->rootUrl/control.php?action=listDocs\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\" /></a>\n"; | ||
| 70 | +} | ||
| 71 | + | ||
| 72 | +?> | ||
| 0 | \ No newline at end of file | 73 | \ No newline at end of file |
presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/listDocumentsBL.php
0 โ 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | +* BL information for viewing a Discussion | ||
| 4 | +* | ||
| 5 | +* @author Omar Rahbeeni | ||
| 6 | +* @date 19 May 2003 | ||
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | ||
| 8 | +* | ||
| 9 | +*/ | ||
| 10 | + | ||
| 11 | + require_once("../../../../../config/dmsDefaults.php"); | ||
| 12 | + | ||
| 13 | +if (checkSession()) { | ||
| 14 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc"); | ||
| 15 | + //require_once("listOrgUI.inc"); | ||
| 16 | + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | ||
| 17 | + require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); | ||
| 18 | + require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | ||
| 19 | + require_once("$default->fileSystemRoot/lib/users/User.inc"); | ||
| 20 | + require_once("$default->fileSystemRoot/lib/security/permission.inc"); | ||
| 21 | + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | ||
| 22 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | ||
| 23 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc"); | ||
| 24 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc"); | ||
| 25 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | ||
| 26 | + require_once("$default->fileSystemRoot/lib/discussions/DiscussionThread.inc"); | ||
| 27 | + require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc"); | ||
| 28 | + require_once("$default->fileSystemRoot/presentation/Html.inc"); | ||
| 29 | + | ||
| 30 | + | ||
| 31 | + $oPatternCustom = & new PatternCustom(); | ||
| 32 | + | ||
| 33 | +if(checkSession()) { | ||
| 34 | + | ||
| 35 | + $oPatternCustom->addHtml(renderHeading("Documents")); // Create the Heading | ||
| 36 | + | ||
| 37 | + | ||
| 38 | + $main->setFormAction($_SERVER['PHP_SELF']); | ||
| 39 | + | ||
| 40 | + $sQuery = "SELECT documents.id as DocId, documents.name as Name, documents.filename as File, is_checked_out as CheckedOut, " . | ||
| 41 | + "CASE WHEN users.name Is Null THEN '<font color=blue>* No one</font>' ELSE users.name END AS UserName, " . | ||
| 42 | + "'Edit Checkout' " . | ||
| 43 | + "FROM documents left join users " . | ||
| 44 | + "on documents.checked_out_user_id = users.id "; | ||
| 45 | + | ||
| 46 | + $aColumns = array("Name", "File", "CheckedOut", "UserName", "Edit Checkout"); | ||
| 47 | + $aColumnNames = array("Name", "File", "Checked Out?", "Checked Out to", "Edit Checkout"); | ||
| 48 | + $aColumnTypes = array(1,1,2,1,3); | ||
| 49 | + $aDBColumnArray = array("DocId"); | ||
| 50 | + $aQueryStringVariableNames = array("fDocID"); | ||
| 51 | + | ||
| 52 | + $aHyperLinkURL = array( 4=> "$default->rootUrl/control.php?action=editDocCheckout"); | ||
| 53 | + | ||
| 54 | + $oSearchResults = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkURL,$aDBColumnArray,$aQueryStringVariableNames); | ||
| 55 | + | ||
| 56 | + $oSearchResults->setDisplayColumnHeadings(true); | ||
| 57 | + $htmlTables = $oSearchResults->render() ; | ||
| 58 | + | ||
| 59 | + $oPatternCustom->addHtml($htmlTables); | ||
| 60 | + | ||
| 61 | + } // end of if checksession | ||
| 62 | + | ||
| 63 | + $main->setCentralPayload($oPatternCustom); | ||
| 64 | + $main->render(); | ||
| 65 | +} | ||
| 66 | +?> |