Commit 2af9c31426cb079eda6d80addcd5e872933333d9
1 parent
1f534df7
Added default user to document routing
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2023 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
36 additions
and
4 deletions
presentation/lookAndFeel/knowledgeTree/foldermanagement/addFolderCollaborationBL.php
| ... | ... | @@ -24,7 +24,7 @@ if (checkSession()) { |
| 24 | 24 | if (isset($fForStore)) { |
| 25 | 25 | //attempt to create the new folder collaboration entry |
| 26 | 26 | include_once("$default->fileSystemRoot/lib/foldermanagement/FolderCollaboration.inc"); |
| 27 | - $oFolderCollaboration = & new FolderCollaboration($fFolderID, $fGroupID, $fSequenceNumber, $fRoleID); | |
| 27 | + $oFolderCollaboration = & new FolderCollaboration($fFolderID, $fGroupID, $fSequenceNumber, $fRoleID, $fUserID); | |
| 28 | 28 | if ($oFolderCollaboration->create()) { |
| 29 | 29 | //on successful creation, redirect to the folder edit page |
| 30 | 30 | include_once("$default->fileSystemRoot/presentation/Html.inc"); | ... | ... |
presentation/lookAndFeel/knowledgeTree/foldermanagement/addFolderCollaborationUI.inc
| ... | ... | @@ -29,9 +29,12 @@ function getPage($iFolderID, $iGroupID, $iRoleID, $iSequenceNumber) { |
| 29 | 29 | $sToRender .= "<br>\n"; |
| 30 | 30 | $sToRender .= "<table>\n"; |
| 31 | 31 | $sToRender .= "<tr>\n"; |
| 32 | - $sToRender .= "<td>Group</td><td>" . getGroupDropDown($iGroupID) . "</td>\n"; | |
| 32 | + $sToRender .= "<td>Group</td><td>" . getGroupDropDown($iGroupID, $iFolderID) . "</td>\n"; | |
| 33 | 33 | $sToRender .= "</tr>\n"; |
| 34 | 34 | $sToRender .= "<tr>\n"; |
| 35 | + $sToRender .= "<td>User</td><td>" . getUserDropDown($iGroupID) . "</td>\n"; | |
| 36 | + $sToRender .= "</tr>\n"; | |
| 37 | + $sToRender .= "<tr>\n"; | |
| 35 | 38 | $sToRender .= "<td>Role</td><td>" . getRoleDropDown($iRoleID) . "</td>\n"; |
| 36 | 39 | $sToRender .= "</tr>\n"; |
| 37 | 40 | $sToRender .= "<tr>\n"; |
| ... | ... | @@ -44,7 +47,7 @@ function getPage($iFolderID, $iGroupID, $iRoleID, $iSequenceNumber) { |
| 44 | 47 | |
| 45 | 48 | $sToRender .= "\n\n<script language=\"javascript\">\n<!--\n"; |
| 46 | 49 | $sToRender .= "function validateForm(theForm) {\n"; |
| 47 | - $sToRender .= "\tif (!(validNum(theForm.fSequenceNumber,'Sequence no.')) || !(validRequired(theForm.fSequenceNumber,'Sequence no.'))) {\n"; | |
| 50 | + $sToRender .= "\tif (!(validRequired(theForm.fGroupID,'Group')) || !(validRequired(theForm.fUserID,'User')) || !(validNum(theForm.fSequenceNumber,'Sequence no.')) || !(validRequired(theForm.fSequenceNumber,'Sequence no.'))) {\n"; | |
| 48 | 51 | $sToRender .= "\t\treturn false;\n\t}\n"; |
| 49 | 52 | $sToRender .= "return true;\n}\n"; |
| 50 | 53 | $sToRender .= "//-->\n</script>\n\n"; |
| ... | ... | @@ -60,8 +63,19 @@ function getFolderPath($iFolderID) { |
| 60 | 63 | return "<table border=\"0\" width=\"100%\"><tr><td bgcolor=\"$sTDBGColour\">$sFolderPathLink</td></tr></table>\n"; |
| 61 | 64 | } |
| 62 | 65 | |
| 63 | -function getGroupDropDown($iGroupID) { | |
| 66 | +function getGroupDropDown($iGroupID, $iFolderID) { | |
| 64 | 67 | global $default; |
| 68 | + $oPatternListBox = & new PatternListBox("$default->owl_groups_table", "name", "id", "fGroupID"); | |
| 69 | + $oPatternListBox->setPostBackOnChange(true); | |
| 70 | + $oPatternListBox->setOnChangeAction("setActionAndSubmit('" . $_SERVER["PHP_SELF"] . "?fFolderID=$iFolderID');"); | |
| 71 | + if (isset($iGroupID)) { | |
| 72 | + $oPatternListBox->setSelectedValue($iGroupID); | |
| 73 | + } | |
| 74 | + | |
| 75 | + | |
| 76 | + //this code restricts the user to seeing only | |
| 77 | + //the groups in their unit | |
| 78 | + /*$oPatternListBox; | |
| 65 | 79 | if (Permission::userIsSystemAdministrator()) { |
| 66 | 80 | $oPatternListBox = & new PatternListBox("$default->owl_groups_table", "name", "id", "fGroupID"); |
| 67 | 81 | } else { |
| ... | ... | @@ -70,9 +84,27 @@ function getGroupDropDown($iGroupID) { |
| 70 | 84 | } |
| 71 | 85 | $oPatternListBox->setEmptyErrorMessage("There are no groups"); |
| 72 | 86 | $oPatternListBox->setIncludeDefaultValue(false); |
| 87 | + $oPatternListBox->setPostBackOnChange(true); | |
| 88 | + $oPatternListBox->setOnChangeAction("setActionAndSubmit('" . $_SERVER["PHP_SELF"] . "?fFolderID=$iFolderID');"); | |
| 73 | 89 | if (isset($iGroupID)) { |
| 74 | 90 | $oPatternListBox->setSelectedValue($iGroupID); |
| 91 | + }*/ | |
| 92 | + return $oPatternListBox->render(); | |
| 93 | +} | |
| 94 | + | |
| 95 | +function getUserDropDown($iGroupID) { | |
| 96 | + global $default; | |
| 97 | + if (!(isset($iGroupID))) { | |
| 98 | + $iGroupID = -1; | |
| 75 | 99 | } |
| 100 | + | |
| 101 | + $oPatternListBox = & new PatternListBox("$default->owl_users_table", "name", "id", "fUserID", "UGL.group_id = $iGroupID"); | |
| 102 | + $oPatternListBox->setFromClause("INNER JOIN $default->owl_users_groups_table AS UGL ON ST.id = UGL.user_id"); | |
| 103 | + | |
| 104 | + if ($iGroupID == -1) { | |
| 105 | + $oPatternListBox->setEmptyErrorMessage("Select a group"); | |
| 106 | + $oPatternListBox->setIncludeDefaultValue(false); | |
| 107 | + } | |
| 76 | 108 | return $oPatternListBox->render(); |
| 77 | 109 | } |
| 78 | 110 | ... | ... |