Commit d79876dcf1ce9ee9df7dcf17db4304d3fa1f9749

Authored by Michael Joseph
1 parent edab0096

added view document requires and call new ui methods from viewUI to display check in page


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1207 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/checkInDocumentBL.php
@@ -17,13 +17,31 @@ @@ -17,13 +17,31 @@
17 require_once("../../../../config/dmsDefaults.php"); 17 require_once("../../../../config/dmsDefaults.php");
18 18
19 if (checkSession()) { 19 if (checkSession()) {
20 - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");  
21 - require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");  
22 - require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc");  
23 - require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc"); 20 + require_once("$default->fileSystemRoot/lib/email/Email.inc");
  21 +
  22 + require_once("$default->fileSystemRoot/lib/users/User.inc");
  23 +
24 require_once("$default->fileSystemRoot/lib/documentmanagement/PhysicalDocumentManager.inc"); 24 require_once("$default->fileSystemRoot/lib/documentmanagement/PhysicalDocumentManager.inc");
25 - require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionEngine.inc");  
26 - require_once("documentUI.inc"); 25 + require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc");
  26 + require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc");
  27 +
  28 + require_once("$default->fileSystemRoot/lib/foldermanagement/FolderCollaboration.inc");
  29 + require_once("$default->fileSystemRoot/lib/foldermanagement/FolderUserRole.inc");
  30 + require_once("$default->fileSystemRoot/lib/roles/Role.inc");
  31 + require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");
  32 +
  33 + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListFromQuery.inc");
  34 + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc");
  35 + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");
  36 + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListFromQuery.inc");
  37 + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc");
  38 +
  39 + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/documentUI.inc");
  40 + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc");
  41 + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc");
  42 + require_once("$default->fileSystemRoot/presentation/Html.inc");
  43 +
  44 + require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionEngine.inc");
27 45
28 $oPatternCustom = & new PatternCustom(); 46 $oPatternCustom = & new PatternCustom();
29 47
@@ -83,8 +101,7 @@ if (checkSession()) { @@ -83,8 +101,7 @@ if (checkSession()) {
83 $default->log->info("checkInDocumentBL.php fired $count subscription alerts for checked out document " . $oDocument->getName()); 101 $default->log->info("checkInDocumentBL.php fired $count subscription alerts for checked out document " . $oDocument->getName());
84 102
85 //redirect to the document view page 103 //redirect to the document view page
86 - redirect("$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $oDocument->getID());  
87 - 104 + redirect("$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $oDocument->getID());
88 } else { 105 } else {
89 // document update failed 106 // document update failed
90 $oPatternCustom->setHtml(renderErrorPage("An error occurred while storing this document in the database")); 107 $oPatternCustom->setHtml(renderErrorPage("An error occurred while storing this document in the database"));
@@ -96,11 +113,11 @@ if (checkSession()) { @@ -96,11 +113,11 @@ if (checkSession()) {
96 } 113 }
97 } else { 114 } else {
98 $sErrorMessage = "Please select a document by first clicking on 'Browse'. Then click 'Check-In'"; 115 $sErrorMessage = "Please select a document by first clicking on 'Browse'. Then click 'Check-In'";
99 - $oPatternCustom->setHtml(renderCheckInPage($oDocument)); 116 + $oPatternCustom->setHtml(getCheckInEditPage($oDocument));
100 } 117 }
101 } else { 118 } else {
102 // prompt the user for a check in comment and the file 119 // prompt the user for a check in comment and the file
103 - $oPatternCustom->setHtml(renderCheckInPage($oDocument)); 120 + $oPatternCustom->setHtml(getCheckInEditPage($oDocument));
104 } 121 }
105 } else { 122 } else {
106 // this document isn't checked out 123 // this document isn't checked out
presentation/lookAndFeel/knowledgeTree/documentmanagement/checkOutDocumentBL.php
@@ -17,13 +17,32 @@ @@ -17,13 +17,32 @@
17 require_once("../../../../config/dmsDefaults.php"); 17 require_once("../../../../config/dmsDefaults.php");
18 18
19 if (checkSession()) { 19 if (checkSession()) {
20 - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");  
21 - require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");  
22 - require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc");  
23 - require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc"); 20 +
  21 + require_once("$default->fileSystemRoot/lib/email/Email.inc");
  22 +
  23 + require_once("$default->fileSystemRoot/lib/users/User.inc");
  24 +
24 require_once("$default->fileSystemRoot/lib/documentmanagement/PhysicalDocumentManager.inc"); 25 require_once("$default->fileSystemRoot/lib/documentmanagement/PhysicalDocumentManager.inc");
25 - require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionEngine.inc");  
26 - require_once("documentUI.inc"); 26 + require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc");
  27 + require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc");
  28 +
  29 + require_once("$default->fileSystemRoot/lib/foldermanagement/FolderCollaboration.inc");
  30 + require_once("$default->fileSystemRoot/lib/foldermanagement/FolderUserRole.inc");
  31 + require_once("$default->fileSystemRoot/lib/roles/Role.inc");
  32 + require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");
  33 +
  34 + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListFromQuery.inc");
  35 + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc");
  36 + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");
  37 + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListFromQuery.inc");
  38 + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc");
  39 +
  40 + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/documentUI.inc");
  41 + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc");
  42 + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc");
  43 + require_once("$default->fileSystemRoot/presentation/Html.inc");
  44 +
  45 + require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionEngine.inc");
27 46
28 $oPatternCustom = & new PatternCustom(); 47 $oPatternCustom = & new PatternCustom();
29 48
@@ -41,6 +60,8 @@ if (checkSession()) { @@ -41,6 +60,8 @@ if (checkSession()) {
41 $oDocument->setIsCheckedOut(true); 60 $oDocument->setIsCheckedOut(true);
42 // set the user checking the document out 61 // set the user checking the document out
43 $oDocument->setCheckedOutUserID($_SESSION["userID"]); 62 $oDocument->setCheckedOutUserID($_SESSION["userID"]);
  63 + // update modification time
  64 + $oDocument->setLastModifiedDate(getCurrentDateTime());
44 // update it 65 // update it
45 if ($oDocument->update()) { 66 if ($oDocument->update()) {
46 67
@@ -55,8 +76,9 @@ if (checkSession()) { @@ -55,8 +76,9 @@ if (checkSession()) {
55 array( "modifiedDocumentName" => $oDocument->getName() )); 76 array( "modifiedDocumentName" => $oDocument->getName() ));
56 $default->log->info("checkOutDocumentBL.php fired $count subscription alerts for checked out document " . $oDocument->getName()); 77 $default->log->info("checkOutDocumentBL.php fired $count subscription alerts for checked out document " . $oDocument->getName());
57 78
58 - //redirect to the document view page  
59 - redirect("$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $oDocument->getID()); 79 + // display checkout success message in the document view page
  80 + $oPatternCustom->setHtml(getCheckOutEditPage($oDocument, true));
  81 +
60 82
61 } else { 83 } else {
62 // document update failed 84 // document update failed
@@ -64,7 +86,7 @@ if (checkSession()) { @@ -64,7 +86,7 @@ if (checkSession()) {
64 } 86 }
65 } else { 87 } else {
66 // prompt the user for a checkout comment 88 // prompt the user for a checkout comment
67 - $oPatternCustom->setHtml(renderCheckOutPage($oDocument)); 89 + $oPatternCustom->setHtml(getCheckOutEditPage($oDocument));
68 } 90 }
69 } else { 91 } else {
70 // this document is already checked out 92 // this document is already checked out