Commit 74e50a60549d5b2e188e7190680221fbccd1859e

Authored by Neil Blakey-Milner
1 parent eda505c3

Remove last vestiges of old permission and routing system


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4032 c91229c3-7414-0410-bfa2-8a42b809f60b
config/siteMap.inc
@@ -65,25 +65,10 @@ $default->siteMap->addPage("copyFolderPermissions", "/presentation/lookAndFeel/k @@ -65,25 +65,10 @@ $default->siteMap->addPage("copyFolderPermissions", "/presentation/lookAndFeel/k
65 $default->siteMap->addPage("modifyFolderData", "/presentation/lookAndFeel/knowledgeTree/foldermanagement/modifyFolderDataBL.php", "Manage Documents", User, "Modify Folder Data", false); 65 $default->siteMap->addPage("modifyFolderData", "/presentation/lookAndFeel/knowledgeTree/foldermanagement/modifyFolderDataBL.php", "Manage Documents", User, "Modify Folder Data", false);
66 $default->siteMap->addPage("deleteFolder", "/presentation/lookAndFeel/knowledgeTree/foldermanagement/deleteFolderBL.php", "Manage Documents", User, _("Delete Current Folder")); 66 $default->siteMap->addPage("deleteFolder", "/presentation/lookAndFeel/knowledgeTree/foldermanagement/deleteFolderBL.php", "Manage Documents", User, _("Delete Current Folder"));
67 67
68 -  
69 -// folder access  
70 -$default->siteMap->addPage("addGroupFolderLink", "/presentation/lookAndFeel/knowledgeTree/foldermanagement/addGroupFolderLinkBL.php", "Manage Documents", User, "Add Folder Access", false);  
71 -$default->siteMap->addPage("modifyGroupFolderLink", "/presentation/lookAndFeel/knowledgeTree/foldermanagement/editGroupFolderLinkBL.php", "Manage Documents", User, "Edit Folder Access", false);  
72 -$default->siteMap->addPage("deleteGroupFolderLink", "/presentation/lookAndFeel/knowledgeTree/foldermanagement/deleteGroupFolderLinkBL.php", "Manage Documents", User, "Delete Folder Access", false);  
73 -  
74 // document actions 68 // document actions
75 $default->siteMap->addPage("modifyDocumentTypeMetaData", "/presentation/lookAndFeel/knowledgeTree/documentmanagement/modifySpecificMetaDataBL.php", "Manage Documents", User, ""); 69 $default->siteMap->addPage("modifyDocumentTypeMetaData", "/presentation/lookAndFeel/knowledgeTree/documentmanagement/modifySpecificMetaDataBL.php", "Manage Documents", User, "");
76 -$default->siteMap->addPage("modifyDocumentRouting", "/presentation/lookAndFeel/knowledgeTree/documentmanagement/collaborationBL.php", "Manage Documents", User, "");  
77 -$default->siteMap->addPage("collaborationStepReject", "/presentation/lookAndFeel/knowledgeTree/documentmanagement/collaborationRollbackBL.php", "Manage Documents", User, "");  
78 -$default->siteMap->addPage("modifyFolderCollaboration", "/presentation/lookAndFeel/knowledgeTree/foldermanagement/collaborationBL.php", "Manage Documents", User, "", false);  
79 -$default->siteMap->addPage("addFolderCollaboration", "/presentation/lookAndFeel/knowledgeTree/foldermanagement/addFolderCollaborationBL.php", "Manage Documents", User, "", false);  
80 -$default->siteMap->addPage("deleteFolderCollaboration", "/presentation/lookAndFeel/knowledgeTree/foldermanagement/deleteFolderCollaborationBL.php", "Manage Documents", User, "", false);  
81 -$default->siteMap->addPage("viewDependantDocument", "/presentation/lookAndFeel/knowledgeTree/foldermanagement/viewDependantDocumentsBL.php", "Manage Documents", User, "", false);  
82 -$default->siteMap->addPage("deleteDependantDocument", "/presentation/lookAndFeel/knowledgeTree/foldermanagement/deleteDependantDocumentBL.php", "Manage Documents", User, "", false);  
83 $default->siteMap->addPage("removeDocumentLink", "/presentation/lookAndFeel/knowledgeTree/documentmanagement/removeDocumentLinkBL.php", "Manage Documents", User, "", false); 70 $default->siteMap->addPage("removeDocumentLink", "/presentation/lookAndFeel/knowledgeTree/documentmanagement/removeDocumentLinkBL.php", "Manage Documents", User, "", false);
84 $default->siteMap->addPage("addDocumentLink", "/presentation/lookAndFeel/knowledgeTree/documentmanagement/addDocumentLinkBL.php", "Manage Documents", User, "", false); 71 $default->siteMap->addPage("addDocumentLink", "/presentation/lookAndFeel/knowledgeTree/documentmanagement/addDocumentLinkBL.php", "Manage Documents", User, "", false);
85 -$default->siteMap->addPage("createDependantDocument", "/presentation/lookAndFeel/knowledgeTree/documentmanagement/createDependantDocumentBL.php", "Manage Documents", User, "", false);  
86 -$default->siteMap->addPage("escalateDependantDocument", "/presentation/lookAndFeel/knowledgeTree/documentmanagement/escalateDependantDocumentBL.php", "Manage Documents", User, "", false);  
87 72
88 $default->siteMap->addPage("addSubscription", "/presentation/lookAndFeel/knowledgeTree/subscriptions/addSubscriptionBL.php", "Manage Documents", User, _("Add Folder Subscription")); 73 $default->siteMap->addPage("addSubscription", "/presentation/lookAndFeel/knowledgeTree/subscriptions/addSubscriptionBL.php", "Manage Documents", User, _("Add Folder Subscription"));
89 $default->siteMap->addPage("removeSubscription", "/presentation/lookAndFeel/knowledgeTree/subscriptions/removeSubscriptionBL.php", "Manage Documents", User, _("Remove Folder Subscription")); 74 $default->siteMap->addPage("removeSubscription", "/presentation/lookAndFeel/knowledgeTree/subscriptions/removeSubscriptionBL.php", "Manage Documents", User, _("Remove Folder Subscription"));
config/tableMappings.inc
@@ -51,12 +51,6 @@ $default->folder_doctypes_table = "folder_doctypes_link"; @@ -51,12 +51,6 @@ $default->folder_doctypes_table = "folder_doctypes_link";
51 $default->folder_subscriptions_table = "folder_subscriptions"; 51 $default->folder_subscriptions_table = "folder_subscriptions";
52 // stores folders 52 // stores folders
53 $default->folders_table = "folders"; 53 $default->folders_table = "folders";
54 -// links folders to users (and roles) for approval collaboration  
55 -$default->folders_user_roles_table = "folders_users_roles_link";  
56 -// stores approval collaboration information- approval roles mapped to folders with order  
57 -$default->groups_folders_approval_table = "groups_folders_approval_link";  
58 -// links groups to folders  
59 -$default->groups_folders_table = "groups_folders_link";  
60 // stores group information 54 // stores group information
61 $default->groups_table = "groups_lookup"; 55 $default->groups_table = "groups_lookup";
62 // links groups to units 56 // links groups to units
@@ -102,8 +96,6 @@ $default->web_sites_table = "web_sites"; @@ -102,8 +96,6 @@ $default->web_sites_table = "web_sites";
102 //stores help text 96 //stores help text
103 $default->help_table = "help"; 97 $default->help_table = "help";
104 $default->document_text_table = "document_text"; 98 $default->document_text_table = "document_text";
105 -$default->dependant_document_template_table = "dependant_document_template";  
106 -$default->dependant_document_instance_table = "dependant_document_instance";  
107 $default->document_link_table = "document_link"; 99 $default->document_link_table = "document_link";
108 // archive settings 100 // archive settings
109 $default->document_archiving_table = "document_archiving_link"; 101 $default->document_archiving_table = "document_archiving_link";
lib/dashboard/Dashboard.inc
@@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
2 require_once(KT_LIB_DIR . "/subscriptions/SubscriptionManager.inc"); 2 require_once(KT_LIB_DIR . "/subscriptions/SubscriptionManager.inc");
3 require_once(KT_LIB_DIR . "/web/WebDocument.inc"); 3 require_once(KT_LIB_DIR . "/web/WebDocument.inc");
4 require_once(KT_LIB_DIR . "/links/Link.inc"); 4 require_once(KT_LIB_DIR . "/links/Link.inc");
5 -require_once(KT_LIB_DIR . "/documentmanagement/DependantDocumentInstance.inc");  
6 require_once(KT_LIB_DIR . "/archiving/ArchiveRestorationRequest.inc"); 5 require_once(KT_LIB_DIR . "/archiving/ArchiveRestorationRequest.inc");
7 /** 6 /**
8 * $Id$ 7 * $Id$
@@ -72,25 +71,6 @@ class Dashboard { @@ -72,25 +71,6 @@ class Dashboard {
72 } 71 }
73 72
74 /** 73 /**
75 - * Retrieves the collaboration documents that the current user has pending  
76 - *  
77 - * @param integer the user to retrieve pending collaboration documents for  
78 - */  
79 - function getPendingCollaborationDocuments(){  
80 - global $default;  
81 -  
82 - $sQuery = array("SELECT document_id FROM $default->folders_user_roles_table WHERE active = ? AND user_id = ?", array(true, $this->iUserID));/*ok*/  
83 - $aDocumentList = array();  
84 - $sql = $default->db;  
85 - if ($sql->query($sQuery)) {  
86 - while ($sql->next_record()) {  
87 - $aDocumentList[] = & Document::get($sql->f("document_id"));  
88 - }  
89 - }  
90 - return $aDocumentList;  
91 - }  
92 -  
93 - /**  
94 * Retrieve checked out documents for this user 74 * Retrieve checked out documents for this user
95 * 75 *
96 * @return array of documents 76 * @return array of documents
@@ -118,22 +98,6 @@ class Dashboard { @@ -118,22 +98,6 @@ class Dashboard {
118 } 98 }
119 99
120 /** 100 /**
121 - * Retrieves details of supporting documents that the current user must create  
122 - */  
123 - function getDependantDocuments() {  
124 - global $default;  
125 - $sQuery = array("SELECT id FROM $default->dependant_document_instance_table WHERE user_id = ?", $this->iUserID);/*ok*/  
126 - $aDocumentList = array();  
127 - $sql = $default->db;  
128 - $sql->query($sQuery);  
129 - while ($sql->next_record()) {  
130 - $aDocumentList[] = & DependantDocumentInstance::get($sql->f("id"));  
131 - }  
132 - return $aDocumentList;  
133 - }  
134 -  
135 -  
136 - /**  
137 * Retrieves Public Folders 101 * Retrieves Public Folders
138 */ 102 */
139 function getPublicFolders() { 103 function getPublicFolders() {
lib/documentmanagement/Document.inc
@@ -389,113 +389,6 @@ class Document extends KTEntity { @@ -389,113 +389,6 @@ class Document extends KTEntity {
389 } 389 }
390 // }}} 390 // }}}
391 391
392 - // {{{ collaboration/approval  
393 -  
394 - // {{{ beginCollaborationProcess  
395 - /**  
396 - * Begin the current document's collaboration process  
397 - *  
398 - */  
399 - function beginCollaborationProcess() {  
400 - global $default;  
401 - //get the steps in this document's collaboration process  
402 - $sQuery = array("SELECT FURL.id, GFAL.precedence " ./*ok*/  
403 - "FROM $default->folders_user_roles_table AS FURL " .  
404 - "INNER JOIN $default->groups_folders_approval_table AS GFAL ON FURL.group_folder_approval_id = GFAL.id " .  
405 - "WHERE document_id = ? " .  
406 - "ORDER BY GFAL.precedence ASC", $this->iId);  
407 - $sql = $default->db;  
408 - $sql->query($sQuery);  
409 - if ($sql->next_record()) {  
410 - //get the first step in the collaboration process  
411 - $iMinimumSequenceNumber = $sql->f("precedence");  
412 - $oFolderUserRole = FolderUserRole::get($sql->f("id"));  
413 - $oFolderUserRole->setActive(true);  
414 - $oFolderUserRole->update();  
415 - $oFolderCollaboration = FolderCollaboration::get($oFolderUserRole->getGroupFolderApprovalID());  
416 - //get the role the user must perform  
417 - $oRole = Role::get($oFolderCollaboration->getRoleID());  
418 - //get the user to email  
419 - $oUser = User::get($oFolderUserRole->getUserID());  
420 - // FIXME: delegate this to message templating handling messaging layer  
421 - // construct and send the mail  
422 - $sBody = $oUser->getUserName() . ", your role of '" . $oRole->getName() . "' in the document, '" . $this->sName . "' collaboration process is now active. " .  
423 - "Click " . generateLink("/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php", "fDocumentID=" . $this->iId, "here") . " to access " .  
424 - "the document";  
425 - $oEmail = & new Email();  
426 - $oEmail->send($oUser->getEmail(), "Document collaboration role active", $sBody);  
427 - DocumentCollaboration::createDependantDocuments($oFolderUserRole);  
428 -  
429 - //check if there are any other parallel steps that have to be started  
430 - while ($sql->next_record()) {  
431 - if ($sql->f("precedence") == $iMinimumSequenceNumber) {  
432 - $oFolderUserRole = FolderUserRole::get($sql->f("id"));  
433 - $oFolderUserRole->setActive(true);  
434 - $oFolderUserRole->update();  
435 - $oFolderCollaboration = FolderCollaboration::get($oFolderUserRole->getGroupFolderApprovalID());  
436 - //get the role the user must perform  
437 - $oRole = Role::get($oFolderCollaboration->getRoleID());  
438 - //get the user to email  
439 - $oUser = User::get($oFolderUserRole->getUserID());  
440 - // FIXME: delegate this to message templating handling messaging layer  
441 - // construct and send the mail  
442 - $sBody = $oUser->getUserName() . ", your role of '" . $oRole->getName() . "' in the document, '" . $this->sName . "' collaboration process is now active. " .  
443 - "Click " . generateLink("/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php", "fDocumentID=" . $this->iId, "here") . " to access " .  
444 - "the document";  
445 - $oEmail = & new Email();  
446 - $oEmail->send($oUser->getEmail(), "Document collaboration role active", $sBody);  
447 - DocumentCollaboration::createDependantDocuments($oFolderUserRole);  
448 - } else {  
449 - return;  
450 - }  
451 - }  
452 - }  
453 - }  
454 - // }}}  
455 -  
456 - // {{{ endCollaborationProcess  
457 - function endCollaborationProcess() {  
458 - global $default;  
459 - $sql = $default->db;  
460 - //get the current step  
461 - //if the user is assinged to two or more roles, make sure we get the current  
462 - //one by ordering by precedence  
463 - $sql->query(array("SELECT FURL.id AS id, GFAT.precedence " ./*ok*/  
464 - "FROM $default->groups_folders_approval_table AS GFAT " .  
465 - "INNER JOIN $default->folders_user_roles_table AS FURL ON GFAT.id = FURL.group_folder_approval_id " .  
466 - "WHERE document_id = ? AND FURL.user_id = ? " .  
467 - "AND done = 0 " .  
468 - "ORDER BY precedence ASC", array($this->iId, $_SESSION["userID"])));  
469 - if ($sql->next_record()) {  
470 - //set it as done  
471 - $oFolderUserRole = FolderUserRole::get($sql->f("id"));  
472 - $oFolderUserRole->setActive(false);  
473 - $oFolderUserRole->setDone(true);  
474 - $oFolderUserRole->setDateTime(getCurrentDateTime());  
475 - return $oFolderUserRole->update();  
476 - }  
477 - return false;  
478 - }  
479 - // }}}  
480 -  
481 - // {{{ hasCollaboration  
482 - /**  
483 - * Checks if there is collaboration for this document  
484 - *  
485 - * @param integer the id of the document  
486 - */  
487 - function hasCollaboration() {  
488 - global $default;  
489 - $sql = $default->db;  
490 - $sql->query(array("SELECT id AS count from $default->groups_folders_approval_table WHERE folder_id = ?", $this->iFolderID));/*ok*/  
491 - if ($sql->next_record()) {  
492 - return true;  
493 - }  
494 - return false;  
495 - }  
496 - // }}}  
497 - // }}}  
498 -  
499 // {{{ get 392 // {{{ get
500 function &get($iId) { 393 function &get($iId) {
501 return KTEntityUtil::get('Document', $iId); 394 return KTEntityUtil::get('Document', $iId);
lib/foldermanagement/Folder.inc
@@ -584,31 +584,6 @@ class Folder extends KTEntity { @@ -584,31 +584,6 @@ class Folder extends KTEntity {
584 } 584 }
585 return false; 585 return false;
586 } 586 }
587 -  
588 - /**  
589 - * Returns whether this folder has any documents currently in collaboration  
590 - */  
591 - function hasDocumentInCollaboration($iFolderID) {  
592 - global $default;  
593 - $sDocumentIDs = Folder::getDocumentIDs($iFolderID);  
594 - if (strlen($sDocumentIDs) > 0) {  
595 - $aDocumentIDs = split(',', $sDocumentIDs);  
596 - $sQms = DBUtil::paramArray($aDocumentIDs);  
597 -  
598 - $sQuery = "SELECT * FROM folders_users_roles_link WHERE document_id in ($sQms) AND (active = ?)";/*ok*/  
599 - $aParams = $aDocumentIDs;  
600 - $aParams[] = true;  
601 - $sql = $default->db;  
602 - $sql->query(array($sQuery, $aParams));  
603 - if ($sql->next_record()) {  
604 - return true;  
605 - }  
606 - return false;  
607 - } else {  
608 - // no documents  
609 - return false;  
610 - }  
611 - }  
612 587
613 function getByParentIDAndLookupID($iParentID, $iLookupID) { 588 function getByParentIDAndLookupID($iParentID, $iLookupID) {
614 return KTEntityUtil::getByDict('Folder', array( 589 return KTEntityUtil::getByDict('Folder', array(
lib/groups/Group.inc
@@ -111,25 +111,6 @@ class Group extends KTEntity { @@ -111,25 +111,6 @@ class Group extends KTEntity {
111 } 111 }
112 112
113 /** 113 /**
114 - * Checks if this group has outstanding approval process  
115 - * requirements  
116 - */  
117 - function hasRoutingSteps() {  
118 - global $default;  
119 -  
120 - $sql = $default->db;  
121 - $query = "SELECT id FROM $default->groups_folders_approval_table WHERE group_id = ?";/*ok*/  
122 - $aParams = array($this->iId);  
123 - $sql->query(array($query, $aParams));  
124 - $rows = $sql->num_rows();  
125 - if ($rows > 0){  
126 - return true;  
127 - } else {  
128 - return false;  
129 - }  
130 - }  
131 -  
132 - /**  
133 * Static function. 114 * Static function.
134 * Given a groups primary key it will create a 115 * Given a groups primary key it will create a
135 * Group object and populate it with the 116 * Group object and populate it with the
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/removeGroupBL.php
@@ -45,22 +45,17 @@ if (checkSession()) { @@ -45,22 +45,17 @@ if (checkSession()) {
45 45
46 if (isset($fGroupID)) { 46 if (isset($fGroupID)) {
47 $oGroup = Group::get($fGroupID); 47 $oGroup = Group::get($fGroupID);
48 - if (!$oGroup->hasRoutingSteps()) {  
49 - if (isset($fForDelete)) {  
50 - if ($oGroup->delete()) {  
51 - // FIXME: refactor getStatusPage in Html.inc  
52 - $oPatternCustom->setHtml(statusPage(_("Remove Group"), _("Group successfully removed"), "", "listGroups"));  
53 - } else {  
54 - $oPatternCustom->setHtml(statusPage(_("Remove Group"), _("Group deletion failed!"), _("There was an error deleting this group. Please try again later."), "listGroups"));  
55 - } 48 + if (isset($fForDelete)) {
  49 + if ($oGroup->delete()) {
  50 + // FIXME: refactor getStatusPage in Html.inc
  51 + $oPatternCustom->setHtml(statusPage(_("Remove Group"), _("Group successfully removed"), "", "listGroups"));
56 } else { 52 } else {
57 - $oPatternCustom->setHtml(getDeletePage($fGroupID));  
58 - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForDelete=1"); 53 + $oPatternCustom->setHtml(statusPage(_("Remove Group"), _("Group deletion failed!"), _("There was an error deleting this group. Please try again later."), "listGroups"));
59 } 54 }
60 } else { 55 } else {
61 - $oPatternCustom->setHtml(statusPage(_("Remove Group"), _("This group is part of a document routing step!"), _("This group can not be deleted because it is involved in the document routing process."), "listGroups")); 56 + $oPatternCustom->setHtml(getDeletePage($fGroupID));
  57 + $main->setFormAction($_SERVER["PHP_SELF"] . "?fForDelete=1");
62 } 58 }
63 - } else {  
64 $oPatternCustom->setHtml(statusPage(_("Remove Group"), _("No group was selected for deletion"), "", "listGroups")); 59 $oPatternCustom->setHtml(statusPage(_("Remove Group"), _("No group was selected for deletion"), "", "listGroups"));
65 } 60 }
66 61
presentation/lookAndFeel/knowledgeTree/documentmanagement/addDocument.php
@@ -27,11 +27,9 @@ @@ -27,11 +27,9 @@
27 require_once("../../../../config/dmsDefaults.php"); 27 require_once("../../../../config/dmsDefaults.php");
28 require_once(KT_LIB_DIR . '/dispatcher.inc.php'); 28 require_once(KT_LIB_DIR . '/dispatcher.inc.php');
29 29
30 -// KTUtil::extractGPC('fFolderID', 'fStore', 'fDocumentTypeID', 'fName', 'fDependantDocumentID');  
31 30
32 require_once(KT_LIB_DIR . '/documentmanagement/Document.inc'); 31 require_once(KT_LIB_DIR . '/documentmanagement/Document.inc');
33 require_once(KT_LIB_DIR . '/foldermanagement/Folder.inc'); 32 require_once(KT_LIB_DIR . '/foldermanagement/Folder.inc');
34 -require_once(KT_LIB_DIR . '/documentmanagement/DependantDocumentInstance.inc');  
35 require_once(KT_LIB_DIR . '/documentmanagement/DocumentLink.inc'); 33 require_once(KT_LIB_DIR . '/documentmanagement/DocumentLink.inc');
36 34
37 require_once(KT_LIB_DIR . '/storage/storagemanager.inc.php'); 35 require_once(KT_LIB_DIR . '/storage/storagemanager.inc.php');
@@ -216,35 +214,6 @@ class KTAddDocumentDispatcher extends KTStandardDispatcher { @@ -216,35 +214,6 @@ class KTAddDocumentDispatcher extends KTStandardDispatcher {
216 exit(0); 214 exit(0);
217 } 215 }
218 216
219 - //the document was created/uploaded due to a collaboration step in another  
220 - //document and must be linked to that document  
221 - if (isset($fDependantDocumentID)) {  
222 - $oDependantDocument = DependantDocumentInstance::get($fDependantDocumentID);  
223 - $oDocumentLink = & new DocumentLink($oDependantDocument->getParentDocumentID(), $oDocument->getID(), -1); // XXX: KT_LINK_DEPENDENT  
224 - if ($oDocumentLink->create()) {  
225 - //no longer a dependant document, but a linked document  
226 - $oDependantDocument->delete();  
227 - } else {  
228 - //an error occured whilst trying to link the two documents automatically. Email the parent document  
229 - //original to inform him/her that the two documents must be linked manually  
230 - $oParentDocument = Document::get($oDependantDocument->getParentDocumentID());  
231 - $oUserDocCreator = User::get($oParentDocument->getCreatorID());  
232 -  
233 - $sBody = $oUserDocCreator->getName() . ", an error occured whilst attempting to automatically link the document, '" .  
234 - $oDocument->getName() . "' to the document, '" . $oParentDocument->getName() . "'. These two documents " .  
235 - " are meant to be linked for collaboration purposes. As creator of the document, ' " . $oParentDocument->getName() . "', you are requested to " .  
236 - "please link them manually by browsing to the parent document, " .  
237 - generateControllerLink("viewDocument","fDocumentId=" . $oParentDocument->getID(), $oParentDocument->getName()) .  
238 - " and selecting the link button. " . $oDocument->getName() . " can be found at " . $oDocument->getDisplayPath();  
239 -  
240 - $oEmail = & new Email();  
241 - $oEmail->send($oUserDocCreator->getEmail(), "Automatic document linking failed", $sBody);  
242 -  
243 - //document no longer dependant document, but must be linked manually  
244 - $oDependantDocument->delete();  
245 - }  
246 - }  
247 -  
248 $this->commitTransaction(); 217 $this->commitTransaction();
249 //redirect to the document details page 218 //redirect to the document details page
250 controllerRedirect("viewDocument", "fDocumentId=" . $oDocument->getID()); 219 controllerRedirect("viewDocument", "fDocumentId=" . $oDocument->getID());
presentation/lookAndFeel/knowledgeTree/documentmanagement/checkInDocumentBL.php
@@ -44,10 +44,7 @@ require_once("$default->fileSystemRoot/lib/users/User.inc"); @@ -44,10 +44,7 @@ require_once("$default->fileSystemRoot/lib/users/User.inc");
44 require_once("$default->fileSystemRoot/lib/documentmanagement/PhysicalDocumentManager.inc"); 44 require_once("$default->fileSystemRoot/lib/documentmanagement/PhysicalDocumentManager.inc");
45 require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc"); 45 require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc");
46 require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); 46 require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc");
47 -require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentCollaboration.inc");  
48 47
49 -require_once("$default->fileSystemRoot/lib/foldermanagement/FolderCollaboration.inc");  
50 -require_once("$default->fileSystemRoot/lib/foldermanagement/FolderUserRole.inc");  
51 require_once("$default->fileSystemRoot/lib/roles/Role.inc"); 48 require_once("$default->fileSystemRoot/lib/roles/Role.inc");
52 require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); 49 require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");
53 50
presentation/lookAndFeel/knowledgeTree/documentmanagement/checkInDocumentUI.inc
@@ -51,13 +51,7 @@ function renderCheckInPage($oDocument) { @@ -51,13 +51,7 @@ function renderCheckInPage($oDocument) {
51 $sToRender .= "<tr><td><input type=\"text\" name=\"fCheckInComment\" size=\"30\"/></td></tr>\n"; 51 $sToRender .= "<tr><td><input type=\"text\" name=\"fCheckInComment\" size=\"30\"/></td></tr>\n";
52 $sToRender .= "<input type=\"hidden\" name=\"fForStore\" value=\"1\"/>\n"; 52 $sToRender .= "<input type=\"hidden\" name=\"fForStore\" value=\"1\"/>\n";
53 $sToRender .= "<input type=\"hidden\" name=\"fDocumentID\" value=\"" . $oDocument->getID() . "\"/>\n"; 53 $sToRender .= "<input type=\"hidden\" name=\"fDocumentID\" value=\"" . $oDocument->getID() . "\"/>\n";
54 - // if collaboration has started then revisions are minor  
55 - if (DocumentCollaboration::documentCollaborationStarted($oDocument->getID())) {  
56 - $sToRender .= "<input type=\"hidden\" name=\"fCheckInType\" value=\"minor\"/>\n";  
57 - // else there is no collaboration, revisions are major (or override?)  
58 - } else {  
59 - $sToRender .= "<input type=\"hidden\" name=\"fCheckInType\" value=\"major\"/>\n";  
60 - } 54 + $sToRender .= "<input type=\"hidden\" name=\"fCheckInType\" value=\"major\"/>\n";
61 55
62 /* 56 /*
63 $sToRender .= "<tr><td>\n"; 57 $sToRender .= "<tr><td>\n";
presentation/lookAndFeel/knowledgeTree/documentmanagement/checkOutDocumentBL.php
@@ -42,8 +42,6 @@ if (checkSession()) { @@ -42,8 +42,6 @@ if (checkSession()) {
42 require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc"); 42 require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc");
43 require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); 43 require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc");
44 44
45 - require_once("$default->fileSystemRoot/lib/foldermanagement/FolderCollaboration.inc");  
46 - require_once("$default->fileSystemRoot/lib/foldermanagement/FolderUserRole.inc");  
47 require_once("$default->fileSystemRoot/lib/roles/Role.inc"); 45 require_once("$default->fileSystemRoot/lib/roles/Role.inc");
48 require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); 46 require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");
49 47
presentation/lookAndFeel/knowledgeTree/documentmanagement/deleteDocumentBL.php
@@ -31,7 +31,6 @@ require_once(&quot;../../../../config/dmsDefaults.php&quot;); @@ -31,7 +31,6 @@ require_once(&quot;../../../../config/dmsDefaults.php&quot;);
31 KTUtil::extractGPC('fDeleteConfirmed', 'fDocumentIDs', 'fRememberDocumentID'); 31 KTUtil::extractGPC('fDeleteConfirmed', 'fDocumentIDs', 'fRememberDocumentID');
32 32
33 require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); 33 require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");
34 -require_once("$default->fileSystemRoot/lib/foldermanagement/FolderUserRole.inc");  
35 require_once("$default->fileSystemRoot/lib/users/User.inc"); 34 require_once("$default->fileSystemRoot/lib/users/User.inc");
36 require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); 35 require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc");
37 require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc"); 36 require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc");
@@ -47,58 +46,53 @@ require_once(&quot;deleteDocumentUI.inc&quot;); @@ -47,58 +46,53 @@ require_once(&quot;deleteDocumentUI.inc&quot;);
47 46
48 $aNondeletedDocs = array(); 47 $aNondeletedDocs = array();
49 48
50 -if (checkSession()) {  
51 -  
52 - if (isset($fRememberDocumentID)) {  
53 - $fDocumentIDs = $_SESSION['documents'][$fRememberDocumentID];  
54 - } else {  
55 - $sUniqueID = KTUtil::randomString();  
56 - $_SESSION["documents"][$sUniqueID] = $fDocumentIDs;  
57 - $fRememberDocumentID = $sUniqueID;  
58 - }  
59 -  
60 - if (isset($fDocumentIDs)) {  
61 -  
62 - // Check permission and collaboration for all documents  
63 - for ($i = 0; $i < count($fDocumentIDs); $i++) {  
64 -  
65 - $oDocument = Document::get($fDocumentIDs[$i]);  
66 - if (!Permission::userHasDocumentWritePermission($oDocument)) {  
67 -  
68 - // user does not have permission to delete the document  
69 - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");  
70 - $oPatternCustom = & new PatternCustom();  
71 - $oPatternCustom->setHtml(renderErrorPage(_("You do not have, at least, permission to delete one document") . ": " .  
72 - $oDocument->getName() . "<br>" . _("Please deselect it and retry.")));  
73 - $main->setCentralPayload($oPatternCustom);  
74 - $main->render();  
75 - return;  
76 -  
77 - } else {  
78 -  
79 - // check if there is collaboration for this document  
80 - $aFolderUserRoles = FolderUserRole::getList(array("document_id = ?", $fDocumentIDs[$i]));/*ok*/  
81 - // check if any of them are active  
82 - $bActive = false;  
83 - for ($j=0; $j<count($aFolderUserRoles); $j++) {  
84 - $default->log->info("delDoc bActive=" . ($bActive ? "1" : "0") . ";folderUserRoleID=" . $aFolderUserRoles[$j]->getGroupFolderApprovalID() . "; active=" . ($aFolderUserRoles[$j]->getActive() ? "1" : "0"));  
85 - $bActive = $bActive || $aFolderUserRoles[$j]->getActive();  
86 - }  
87 -  
88 - if ($bActive) {  
89 -  
90 - // there are active collaboration roles for this doc  
91 - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");  
92 - $oPatternCustom = & new PatternCustom();  
93 - $oPatternCustom->setHtml(renderErrorPage(_("You can't, at least, delete one document") . ": " .  
94 - $oDocument->getName() . "<br>" . _("It's still in collaboration")));  
95 - $main->setCentralPayload($oPatternCustom);  
96 - $main->render();  
97 - return;  
98 - }  
99 - } 49 +if (!checkSession()) {
  50 + die();
  51 +}
  52 +
  53 +if (isset($fRememberDocumentID)) {
  54 + $fDocumentIDs = $_SESSION['documents'][$fRememberDocumentID];
  55 +} else {
  56 + $sUniqueID = KTUtil::randomString();
  57 + $_SESSION["documents"][$sUniqueID] = $fDocumentIDs;
  58 + $fRememberDocumentID = $sUniqueID;
  59 +}
  60 +
  61 +if (!isset($fDocumentIDs)) {
  62 + //no document selected for deletion
  63 + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
  64 + $oPatternCustom = & new PatternCustom();
  65 + $oPatternCustom->setHtml(renderErrorPage(_("No document currently selected")));
  66 + $main->setCentralPayload($oPatternCustom);
  67 + $main->render();
  68 + exit(0);
  69 +}
  70 +
  71 +
  72 +// Check permission and collaboration for all documents
  73 +for ($i = 0; $i < count($fDocumentIDs); $i++) {
  74 + $oDocument = Document::get($fDocumentIDs[$i]);
  75 +
  76 + if (!Permission::userHasDocumentWritePermission($oDocument)) {
  77 + // user does not have permission to delete the document
  78 + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
  79 + $oPatternCustom = & new PatternCustom();
  80 + $oPatternCustom->setHtml(renderErrorPage(_("You do not have, at least, permission to delete one document") . ": " .
  81 + $oDocument->getName() . "<br>" . _("Please deselect it and retry.")));
  82 + $main->setCentralPayload($oPatternCustom);
  83 + $main->render();
  84 + exit(0);
100 } 85 }
  86 +}
101 87
  88 +if (!isset($fDeleteConfirmed)) {
  89 + //get confirmation first
  90 + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
  91 + $oPatternCustom = & new PatternCustom();
  92 + $oPatternCustom->addHtml(getPage($fRememberDocumentID));
  93 + $main->setCentralPayload($oPatternCustom);
  94 + $main->render();
  95 +}
102 96
103 /* Delete all files 97 /* Delete all files
104 If an error occured while deleting a file, then: 98 If an error occured while deleting a file, then:
@@ -111,127 +105,97 @@ if (checkSession()) { @@ -111,127 +105,97 @@ if (checkSession()) {
111 - if is not empty then show the nondeleted files list 105 - if is not empty then show the nondeleted files list
112 */ 106 */
113 107
114 - // Delete all files with possible rollback  
115 - if (isset($fDeleteConfirmed)) {  
116 -  
117 - // deletion of all documents are confirmed  
118 - for ($i = 0; $i < count($fDocumentIDs); $i++) {  
119 -  
120 - $oDocument = Document::get($fDocumentIDs[$i]);  
121 - if (isset($oDocument)) {  
122 - // New transaction  
123 - $sDocumentPath = Folder::getFolderPath($oDocument->getFolderID()) . $oDocument->getFileName();  
124 - $oDocumentTransaction = & new DocumentTransaction($fDocumentIDs[$i], "Document deleted", DELETE);  
125 - $oDocumentTransaction->create();  
126 -  
127 - // flip the status id  
128 - $oDocument->setStatusID(DELETED);  
129 -  
130 - // store  
131 - if ($oDocument->update()) {  
132 - // now move the document to the delete folder  
133 - if (PhysicalDocumentManager::delete($oDocument)) {  
134 - // successfully deleted the document  
135 - $default->log->info("deleteDocumentBL.php successfully deleted document " .  
136 - $oDocument->getFileName() . " from folder " .  
137 - Folder::getFolderPath($oDocument->getFolderID()) .  
138 - " id=" . $oDocument->getFolderID());  
139 -  
140 - // delete all collaboration roles  
141 - for ($j=0; $j<count($aFolderUserRoles); $j++) {  
142 - $default->log->info("delDoc deleting folderuserroleID=" . $aFolderUserRoles[$j]->getGroupFolderApprovalID());  
143 - $aFolderUserRoles[$j]->delete();  
144 - }  
145 -  
146 - // fire subscription alerts for the deleted document  
147 - $count = SubscriptionEngine::fireSubscription($fDocumentIDs[$i],  
148 - SubscriptionConstants::subscriptionAlertType("RemoveSubscribedDocument"),  
149 - SubscriptionConstants::subscriptionType("DocumentSubscription"),  
150 - array( "folderID" => $oDocument->getFolderID(),  
151 - "removedDocumentName" => $oDocument->getName(),  
152 - "folderName" => Folder::getFolderDisplayPath($oDocument->getFolderID())));  
153 - $default->log->info("deleteDocumentBL.php fired $count subscription alerts for removed document " . $oDocument->getName());  
154 -  
155 - // remove all document subscriptions for this document  
156 - if (SubscriptionManager::removeSubscriptions($fDocumentIDs[$i], SubscriptionConstants::subscriptionType("DocumentSubscription"))) {  
157 - $default->log->info("deleteDocumentBL.php removed all subscriptions for this document");  
158 - } else {  
159 - $default->log->error("deleteDocumentBL.php couldn't remove document subscriptions");  
160 - }  
161 -  
162 - } else {  
163 - //could not delete the document from the file system  
164 - $default->log->error("deleteDocumentBL.php Filesystem error deleting document " . $oDocument->getFileName() . " from folder " . Folder::getFolderPath($oDocument->getFolderID()) . " id=" . $oDocument->getFolderID());  
165 - //reverse the document deletion  
166 - $oDocument->setStatusID(LIVE);  
167 - $oDocument->update();  
168 - //get rid of the document transaction  
169 - $oDocumentTransaction->delete();  
170 -  
171 - // Store the doc with problem  
172 - array_push($aNondeletedDocs, array($oDocument, _("Could not delete document on file system")));  
173 -  
174 - }  
175 - } else {  
176 - //could not update the documents status in the db  
177 - $default->log->error("deleteDocumentBL.php DB error deleting document " . $oDocument->getFileName() . " from folder " . Folder::getFolderPath($oDocument->getFolderID()) . " id=" . $oDocument->getFolderID()); 108 +for ($i = 0; $i < count($fDocumentIDs); $i++) {
  109 + $oDocument = Document::get($fDocumentIDs[$i]);
  110 + if (isset($oDocument)) {
  111 + // Store the doc with problem
  112 + array_push($aNondeletedDocs, array($oDocument, _("Could not load document in database")));
  113 + }
  114 +
  115 + // New transaction
  116 + $sDocumentPath = Folder::getFolderPath($oDocument->getFolderID()) . $oDocument->getFileName();
  117 + $oDocumentTransaction = & new DocumentTransaction($fDocumentIDs[$i], "Document deleted", DELETE);
  118 + $oDocumentTransaction->create();
  119 +
  120 + // flip the status id
  121 + $oDocument->setStatusID(DELETED);
  122 +
  123 + // store
  124 + if ($oDocument->update()) {
  125 + //could not update the documents status in the db
  126 + $default->log->error("deleteDocumentBL.php DB error deleting document " .
  127 + $oDocument->getFileName() . " from folder " .
  128 + Folder::getFolderPath($oDocument->getFolderID()) .
  129 + " id=" . $oDocument->getFolderID());
  130 +
  131 + //get rid of the document transaction
  132 + $oDocumentTransaction->delete();
  133 +
  134 + // Store the doc with problem
  135 + array_push($aNondeletedDocs, array($oDocument,
  136 + _("Could not update document in database")));
  137 + }
  138 +
  139 + // now move the document to the delete folder
  140 + if (PhysicalDocumentManager::delete($oDocument)) {
  141 + //could not delete the document from the file system
  142 + $default->log->error("deleteDocumentBL.php Filesystem error deleting document " .
  143 + $oDocument->getFileName() . " from folder " .
  144 + Folder::getFolderPath($oDocument->getFolderID()) .
  145 + " id=" . $oDocument->getFolderID());
  146 + //reverse the document deletion
  147 + $oDocument->setStatusID(LIVE);
  148 + $oDocument->update();
  149 + //get rid of the document transaction
  150 + $oDocumentTransaction->delete();
  151 +
  152 + // Store the doc with problem
  153 + array_push($aNondeletedDocs, array($oDocument, _("Could not delete document on file system")));
  154 + }
  155 +
  156 + // successfully deleted the document
  157 + $default->log->info("deleteDocumentBL.php successfully deleted document " .
  158 + $oDocument->getFileName() . " from folder " .
  159 + Folder::getFolderPath($oDocument->getFolderID()) .
  160 + " id=" . $oDocument->getFolderID());
  161 +
  162 + // fire subscription alerts for the deleted document
  163 + $count = SubscriptionEngine::fireSubscription($fDocumentIDs[$i],
  164 + SubscriptionConstants::subscriptionAlertType("RemoveSubscribedDocument"),
  165 + SubscriptionConstants::subscriptionType("DocumentSubscription"),
  166 + array(
  167 + "folderID" => $oDocument->getFolderID(),
  168 + "removedDocumentName" => $oDocument->getName(),
  169 + "folderName" => Folder::getFolderDisplayPath($oDocument->getFolderID()),
  170 + ));
  171 + $default->log->info("deleteDocumentBL.php fired $count subscription alerts for removed document " . $oDocument->getName());
178 172
179 - //get rid of the document transaction  
180 - $oDocumentTransaction->delete();  
181 -  
182 - // Store the doc with problem  
183 - array_push($aNondeletedDocs, array($oDocument, _("Could not update document in database")));  
184 -  
185 - }  
186 - } else {  
187 - //could not load document object  
188 -  
189 - // Store the doc with problem  
190 - array_push($aNondeletedDocs, array($oDocument, _("Could not load document in database")));  
191 -  
192 - }  
193 - }  
194 -  
195 - // List nondeleted documents  
196 - if (!empty($aNondeletedDocs) ) {  
197 -  
198 - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");  
199 - $oPatternCustom = & new PatternCustom();  
200 -  
201 - $sError = _("An error occured deleting the following document(s):") . "<br><br>";  
202 - foreach ($aNondeletedDocs as $oDoc) {  
203 - $sError .= $oDoc[0]->getDisplayPath() . ":&nbsp;&nbsp;&nbsp;" .$oDoc[1] . "<br>";  
204 - }  
205 - $sError .= "<br>" . _("The other documents are been deleted.");  
206 -  
207 - $oPatternCustom->addHtml(renderErrorPage($sError));  
208 - $main->setCentralPayload($oPatternCustom);  
209 - $main->render();  
210 -  
211 - reset($aNondeletedDocs);  
212 -  
213 - } else {  
214 - // redirect to the browse folder page  
215 - redirect("$default->rootUrl/control.php?action=browse&fFolderID=" . $oDocument->getFolderID());  
216 - }  
217 -  
218 -  
219 - } else {  
220 - //get confirmation first  
221 - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");  
222 - $oPatternCustom = & new PatternCustom();  
223 - $oPatternCustom->addHtml(getPage($fRememberDocumentID));  
224 - $main->setCentralPayload($oPatternCustom);  
225 - $main->render();  
226 - }  
227 - } else {  
228 - //no document selected for deletion  
229 - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");  
230 - $oPatternCustom = & new PatternCustom();  
231 - $oPatternCustom->setHtml(renderErrorPage(_("No document currently selected")));  
232 - $main->setCentralPayload($oPatternCustom);  
233 - $main->render();  
234 - } 173 + // remove all document subscriptions for this document
  174 + if (SubscriptionManager::removeSubscriptions($fDocumentIDs[$i], SubscriptionConstants::subscriptionType("DocumentSubscription"))) {
  175 + $default->log->info("deleteDocumentBL.php removed all subscriptions for this document");
  176 + } else {
  177 + $default->log->error("deleteDocumentBL.php couldn't remove document subscriptions");
  178 + }
  179 +}
  180 +
  181 +// List nondeleted documents
  182 +if (!empty($aNondeletedDocs) ) {
  183 + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
  184 + $oPatternCustom = & new PatternCustom();
  185 +
  186 + $sError = _("An error occured deleting the following document(s):") . "<br><br>";
  187 + foreach ($aNondeletedDocs as $oDoc) {
  188 + $sError .= $oDoc[0]->getDisplayPath() . ":&nbsp;&nbsp;&nbsp;" .$oDoc[1] . "<br>";
  189 + }
  190 + $sError .= "<br>" . _("The other documents are been deleted.");
  191 +
  192 + $oPatternCustom->addHtml(renderErrorPage($sError));
  193 + $main->setCentralPayload($oPatternCustom);
  194 + $main->render();
  195 + exit(0);
235 } 196 }
236 197
  198 +// redirect to the browse folder page
  199 +redirect("$default->rootUrl/control.php?action=browse&fFolderID=" . $oDocument->getFolderID());
  200 +exit(0);
237 ?> 201 ?>
presentation/lookAndFeel/knowledgeTree/documentmanagement/editDocument.php
@@ -11,7 +11,6 @@ require_once(KT_LIB_DIR . &#39;/dispatcher.inc.php&#39;); @@ -11,7 +11,6 @@ require_once(KT_LIB_DIR . &#39;/dispatcher.inc.php&#39;);
11 11
12 require_once(KT_LIB_DIR . '/documentmanagement/Document.inc'); 12 require_once(KT_LIB_DIR . '/documentmanagement/Document.inc');
13 require_once(KT_LIB_DIR . '/foldermanagement/Folder.inc'); 13 require_once(KT_LIB_DIR . '/foldermanagement/Folder.inc');
14 -require_once(KT_LIB_DIR . '/documentmanagement/DependantDocumentInstance.inc');  
15 require_once(KT_LIB_DIR . '/documentmanagement/DocumentLink.inc'); 14 require_once(KT_LIB_DIR . '/documentmanagement/DocumentLink.inc');
16 15
17 require_once(KT_LIB_DIR . '/documentmanagement/documentutil.inc.php'); 16 require_once(KT_LIB_DIR . '/documentmanagement/documentutil.inc.php');
presentation/lookAndFeel/knowledgeTree/documentmanagement/webDocumentBL.php
@@ -7,7 +7,6 @@ KTUtil::extractGPC(&#39;fUploadUrl&#39;, &#39;fUploaded&#39;, &#39;fWebDocumentID&#39;); @@ -7,7 +7,6 @@ KTUtil::extractGPC(&#39;fUploadUrl&#39;, &#39;fUploaded&#39;, &#39;fWebDocumentID&#39;);
7 require_once("$default->fileSystemRoot/lib/email/Email.inc"); 7 require_once("$default->fileSystemRoot/lib/email/Email.inc");
8 require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); 8 require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");
9 require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); 9 require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc");
10 -require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentCollaboration.inc");  
11 require_once("$default->fileSystemRoot/lib/web/WebDocument.inc"); 10 require_once("$default->fileSystemRoot/lib/web/WebDocument.inc");
12 require_once("$default->fileSystemRoot/lib/web/WebSite.inc"); 11 require_once("$default->fileSystemRoot/lib/web/WebSite.inc");
13 require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); 12 require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");
presentation/lookAndFeel/knowledgeTree/foldermanagement/deleteFolderBL.php
@@ -31,7 +31,6 @@ require_once(&quot;../../../../config/dmsDefaults.php&quot;); @@ -31,7 +31,6 @@ require_once(&quot;../../../../config/dmsDefaults.php&quot;);
31 KTUtil::extractGPC('fDeleteConfirmed', 'fFolderID'); 31 KTUtil::extractGPC('fDeleteConfirmed', 'fFolderID');
32 32
33 require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); 33 require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc");
34 -require_once("$default->fileSystemRoot/lib/foldermanagement/FolderCollaboration.inc");  
35 require_once("$default->fileSystemRoot/lib/foldermanagement/FolderDocTypeLink.inc"); 34 require_once("$default->fileSystemRoot/lib/foldermanagement/FolderDocTypeLink.inc");
36 require_once("$default->fileSystemRoot/lib/foldermanagement/PhysicalFolderManagement.inc"); 35 require_once("$default->fileSystemRoot/lib/foldermanagement/PhysicalFolderManagement.inc");
37 require_once("$default->fileSystemRoot/lib/groups/GroupUnitLink.inc"); 36 require_once("$default->fileSystemRoot/lib/groups/GroupUnitLink.inc");
@@ -63,12 +62,6 @@ if (checkSession()) { @@ -63,12 +62,6 @@ if (checkSession()) {
63 // successfully deleted the folder from the file system 62 // successfully deleted the folder from the file system
64 $default->log->info("deleteFolderBL.php successfully deleted folder " . $oFolder->getName() . " from parent folder " . Folder::getFolderPath($oFolder->getParentID()) . " id=" . $oFolder->getParentID()); 63 $default->log->info("deleteFolderBL.php successfully deleted folder " . $oFolder->getName() . " from parent folder " . Folder::getFolderPath($oFolder->getParentID()) . " id=" . $oFolder->getParentID());
65 64
66 - // delete folder collaboration entries  
67 - $aFolderCollaboration = FolderCollaboration::getList(array("folder_id = ?", $fFolderID));/*ok*/  
68 - for ($i=0; $i<count($aFolderCollaboration); $i++) {  
69 - $aFolderCollaboration[$i]->delete();  
70 - }  
71 -  
72 // delete folder document types link 65 // delete folder document types link
73 $aFolderDocTypeLink = FolderDocTypeLink::getList(array("folder_id = ?", $fFolderID));/*ok*/ 66 $aFolderDocTypeLink = FolderDocTypeLink::getList(array("folder_id = ?", $fFolderID));/*ok*/
74 for ($i=0; $i<count($aFolderDocTypeLink); $i++) { 67 for ($i=0; $i<count($aFolderDocTypeLink); $i++) {
presentation/lookAndFeel/knowledgeTree/foldermanagement/editBL.php
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 30
31 require_once("../../../../config/dmsDefaults.php"); 31 require_once("../../../../config/dmsDefaults.php");
32 32
33 -KTUtil::extractGPC('fCollaborationDelete', 'fCollaborationEdit', 'fFolderID', 'fShowSection'); 33 +KTUtil::extractGPC('fFolderID', 'fShowSection');
34 34
35 if (!checkSession()) { 35 if (!checkSession()) {
36 exit(0); 36 exit(0);
@@ -82,33 +82,6 @@ if (!Permission::userHasFolderWritePermission($oFolder)) { @@ -82,33 +82,6 @@ if (!Permission::userHasFolderWritePermission($oFolder)) {
82 exit(0); 82 exit(0);
83 } 83 }
84 84
85 -if (isset($fCollaborationEdit)) {  
86 - //user attempted to edit the folder collaboration process but could not because there is  
87 - //a document currently in this process  
88 - $oPatternCustom->setHtml(getStatusPage($fFolderID, _("You cannot edit this folder collaboration process as a document is currently undergoing this collaboration process")));  
89 -  
90 - $main->setHasRequiredFields(true);  
91 - $_SESSION["pageAccess"][$default->rootUrl . '/presentation/lookAndFeel/knowledgeTree/store.php'] = true;  
92 - $main->setFormAction("$default->rootUrl/presentation/lookAndFeel/knowledgeTree/store.php?fReturnURL=" . urlencode("$default->rootUrl/control.php?action=browse&fFolderID=$fFolderID"));  
93 -} else if (isset($fCollaborationDelete)) {  
94 - //user attempted to delete the folder collaboration process but could not because there is  
95 - //a document currently in this process  
96 - $oPatternCustom->setHtml(getStatusPage($fFolderID, _("You cannot delete this folder collaboration process as a document is currently undergoing this collaboration process")));  
97 - $main->setHasRequiredFields(true);  
98 - $_SESSION["pageAccess"][$default->rootUrl . '/presentation/lookAndFeel/knowledgeTree/store.php'] = true;  
99 - $main->setFormAction("$default->rootUrl/presentation/lookAndFeel/knowledgeTree/store.php?fReturnURL=" . urlencode("$default->rootUrl/control.php?action=browse&fFolderID=$fFolderID"));  
100 -} else {  
101 - // does this folder have a document in it that has started collaboration?  
102 - $bCollaboration = Folder::hasDocumentInCollaboration($fFolderID);  
103 - $main->setDHTMLScrolling(false);  
104 - $main->setOnLoadJavaScript("switchDiv('" . (isset($fShowSection) ? $fShowSection : "folderData") . "', 'folder')");  
105 -  
106 - $oPatternCustom->setHtml(getPage($fFolderID, "", $bCollaboration));  
107 - $main->setHasRequiredFields(true);  
108 - $_SESSION["pageAccess"][$default->rootUrl . '/presentation/lookAndFeel/knowledgeTree/store.php'] = true;  
109 - $main->setFormAction("$default->rootUrl/presentation/lookAndFeel/knowledgeTree/store.php?fReturnURL=" . urlencode("$default->rootUrl/control.php?action=browse&fFolderID=$fFolderID"));  
110 -}  
111 -  
112 $main->setCentralPayload($oPatternCustom); 85 $main->setCentralPayload($oPatternCustom);
113 $main->render(); 86 $main->render();
114 87
presentation/lookAndFeel/knowledgeTree/foldermanagement/editUI.inc
@@ -68,44 +68,6 @@ function getFolderData($iFolderID, $sDivName, $sStatusMessage = &quot;&quot;) { @@ -68,44 +68,6 @@ function getFolderData($iFolderID, $sDivName, $sStatusMessage = &quot;&quot;) {
68 } 68 }
69 } 69 }
70 70
71 -function getFolderRouting($iFolderID, $sDivName, $bCollaboration) {  
72 - global $default;  
73 - //had to use coalesce and left outer join for user_id because this column was a new addition  
74 - //and the user_ids for existing documents before this change will be null  
75 - /*ok*/ $sQuery = array("SELECT GFAL.id as id, GFAL.folder_id AS folder_id, COALESCE(G.name, 'Not Assigned') AS group_name, G.id AS group_id, GFAL.role_id AS role_id, R.name AS role_name, GFAL.precedence AS precedence, COALESCE(U.id, -1) AS user_id, COALESCE(U.name, 'Not Assigned') AS user_name, 'Edit' as edit, 'Delete' as del, 'Dependant docs' as depn " .  
76 - "FROM $default->groups_folders_approval_table AS GFAL INNER JOIN roles AS R ON GFAL.role_id = R.id " .  
77 - "LEFT OUTER JOIN $default->groups_table AS G ON G.id = GFAL.group_id " .  
78 - "LEFT OUTER JOIN $default->users_table AS U ON U.id = GFAL.user_id " .  
79 - "WHERE GFAL.folder_id = ? " .  
80 - "ORDER BY GFAL.precedence, role_name ASC", $iFolderID);  
81 -  
82 - $aColumns = array("group_name", "role_name", "precedence", "user_name", "edit", "del", "depn");  
83 - $aColumnHeaders = array(_("Group"), _("Role"), _("Seq"), _("User"), "", "");  
84 - $aColumnTypes = array(1,1,1,1,3,3,3);  
85 - $aDBColumnArray = array("id","folder_id","group_id","user_id","precedence","role_id");  
86 - $aQueryStringVariableNames = array("fFolderCollaborationID", "fFolderID", "fGroupID","fUserID","fSequenceNumber","fRoleID");  
87 - $aLinkURLs = array(4=>"$default->rootUrl/control.php?action=modifyFolderCollaboration",5=>"$default->rootUrl/control.php?action=deleteFolderCollaboration", 6=>"$default->rootUrl/control.php?action=viewDependantDocument");  
88 -  
89 - $oPatternTableSqlQuery = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnHeaders, "610", $aLinkURLs, $aDBColumnArray,$aQueryStringVariableNames);  
90 - $oPatternTableSqlQuery->setTableHeading(_("Document Routing"));  
91 - $oPatternTableSqlQuery->setDisplayColumnHeadings(true);  
92 -  
93 - $sToRender .= "<table>";  
94 - if ($bCollaboration) {  
95 - $sToRender .= "<tr><td><font color=\"red\">" . _("Documents in this folder are currently undergoing this collaboration process, so these steps can't be altered") . "</font></td></tr>";  
96 - }  
97 - $sToRender .= "<tr><td>" . $oPatternTableSqlQuery->render() . "</td></tr>";  
98 - if (!$bCollaboration) {  
99 - $sToRender .= "<tr>\n";  
100 - $sToRender .= "<td>\n";  
101 - $sToRender .= "<a href=\"$default->rootUrl/control.php?action=addFolderCollaboration&fFolderID=$iFolderID\"><img src=\"" . KTHtml::getAddButton() . "\" border=\"0\" /></a>\n";  
102 - $sToRender .= "</td>\n";  
103 - $sToRender .= "</tr>\n";  
104 - }  
105 - $sToRender .= "</table>";  
106 - return renderSectionDiv($sDivName, $sToRender);  
107 -}  
108 -  
109 function getFolderDocTypes($iFolderID, $sDivName) { 71 function getFolderDocTypes($iFolderID, $sDivName) {
110 $sTable = KTUtil::getTableName('folder_doctypes'); 72 $sTable = KTUtil::getTableName('folder_doctypes');
111 $aQuery = array( 73 $aQuery = array(
@@ -153,7 +115,7 @@ function renderFolderSection($sSectionName, $sHeadingText, $bDisplayLink, $iFold @@ -153,7 +115,7 @@ function renderFolderSection($sSectionName, $sHeadingText, $bDisplayLink, $iFold
153 return "<tr bgcolor=\"" . getColour($iColour) . "\"><td width=\"100%\">$sLink</td></tr>\n"; 115 return "<tr bgcolor=\"" . getColour($iColour) . "\"><td width=\"100%\">$sLink</td></tr>\n";
154 } 116 }
155 117
156 -function getPage($iFolderID, $sStatusMessage, $bCollaboration = false) { 118 +function getPage($iFolderID, $sStatusMessage) {
157 global $default; 119 global $default;
158 120
159 $sToRender = "<div id=\"headings\" style=\"position:relative;visibility:visible;top:2px;left:2px;\">"; 121 $sToRender = "<div id=\"headings\" style=\"position:relative;visibility:visible;top:2px;left:2px;\">";
@@ -168,7 +130,6 @@ function getPage($iFolderID, $sStatusMessage, $bCollaboration = false) { @@ -168,7 +130,6 @@ function getPage($iFolderID, $sStatusMessage, $bCollaboration = false) {
168 $bDisplayLink = ($sStatusMessage) ? true : false; 130 $bDisplayLink = ($sStatusMessage) ? true : false;
169 131
170 $sToRender .= renderFolderSection("folderData", _("Folder Data"), $bDisplayLink, $iFolderID); 132 $sToRender .= renderFolderSection("folderData", _("Folder Data"), $bDisplayLink, $iFolderID);
171 - $sToRender .= renderFolderSection("folderRouting", _("Document Routing"), $bDisplayLink, $iFolderID);  
172 $sToRender .= renderFolderSection("documentTypes", _("Document Types"), $bDisplayLink, $iFolderID); 133 $sToRender .= renderFolderSection("documentTypes", _("Document Types"), $bDisplayLink, $iFolderID);
173 $sToRender .= "</table>"; 134 $sToRender .= "</table>";
174 $sToRender .= "</td><td><table border=1>"; 135 $sToRender .= "</td><td><table border=1>";
@@ -180,7 +141,6 @@ function getPage($iFolderID, $sStatusMessage, $bCollaboration = false) { @@ -180,7 +141,6 @@ function getPage($iFolderID, $sStatusMessage, $bCollaboration = false) {
180 $sToRender .= "<div id=\"contentDiv\" style=\"position:relative;visibility:hidden;width:500px;\">"; 141 $sToRender .= "<div id=\"contentDiv\" style=\"position:relative;visibility:hidden;width:500px;\">";
181 } 142 }
182 $sToRender .= getFolderData($iFolderID, "folderData"); 143 $sToRender .= getFolderData($iFolderID, "folderData");
183 - $sToRender .= getFolderRouting($iFolderID, "folderRouting", $bCollaboration);  
184 $sToRender .= getFolderDocTypes($iFolderID, "documentTypes"); 144 $sToRender .= getFolderDocTypes($iFolderID, "documentTypes");
185 if (!$default->bNN4) { 145 if (!$default->bNN4) {
186 $sToRender .= "</div>"; 146 $sToRender .= "</div>";
@@ -202,7 +162,6 @@ function getStatusPage($iFolderID, $sStatusMessage) { @@ -202,7 +162,6 @@ function getStatusPage($iFolderID, $sStatusMessage) {
202 $bDisplayLink = ($sStatusMessage) ? true : false; 162 $bDisplayLink = ($sStatusMessage) ? true : false;
203 163
204 $sToRender .= renderFolderSection("folderData", _("Folder Data"), $bDisplayLink, $iFolderID); 164 $sToRender .= renderFolderSection("folderData", _("Folder Data"), $bDisplayLink, $iFolderID);
205 - $sToRender .= renderFolderSection("folderRouting", _("Document Routing"), $bDisplayLink, $iFolderID);  
206 $sToRender .= renderFolderSection("documentTypes", _("Document Types"), $bDisplayLink, $iFolderID); 165 $sToRender .= renderFolderSection("documentTypes", _("Document Types"), $bDisplayLink, $iFolderID);
207 $sToRender .= renderFolderSection("folderPermissions", _("Folder Permissions"), $bDisplayLink, $iFolderID); 166 $sToRender .= renderFolderSection("folderPermissions", _("Folder Permissions"), $bDisplayLink, $iFolderID);
208 167
presentation/lookAndFeel/knowledgeTree/help/modifyDocumentRoutingHelp.html deleted
1 -<h2>Modify Document Routing</h2>  
2 -  
3 -<ol>  
4 - <li>Use the drowp-down list to select the player that will fulfil the  
5 -selected role. <b> Note: </b>Only users belonging to the displayed group  
6 -will appear in the drop-down list.</li>  
7 - <li>Click the Update button to save your selection or the Cancel button  
8 -to discard it.</li>  
9 -</ol>  
presentation/lookAndFeel/knowledgeTree/js/divSwitch.js
@@ -6,8 +6,8 @@ @@ -6,8 +6,8 @@
6 function switchDiv(div_id, object) 6 function switchDiv(div_id, object)
7 { 7 {
8 var aDocumentDivs = new Array("documentData", "genericMetaData", "typeSpecificMetaData", 8 var aDocumentDivs = new Array("documentData", "genericMetaData", "typeSpecificMetaData",
9 - "archiveSettings", "documentRouting", "linkedDocuments");  
10 - var aFolderDivs = new Array("folderData", "folderRouting", "documentTypes", "folderPermissions"); 9 + "archiveSettings", "linkedDocuments", "metadataVersions");
  10 + var aFolderDivs = new Array("folderData", "documentTypes", "folderPermissions");
11 var aSearchDivs = new Array("searchLess", "searchMore"); 11 var aSearchDivs = new Array("searchLess", "searchMore");
12 12
13 var style_sheet = getStyleObject(div_id); 13 var style_sheet = getStyleObject(div_id);