Commit 27768c9a19348582fc46950d2df16acf9a67f8a0
1 parent
cc076d12
Changed User Management in Admin pages
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1944 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
10 changed files
with
704 additions
and
31 deletions
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/addUserToGroupBL.php
| ... | ... | @@ -29,23 +29,24 @@ if (checkSession()) { |
| 29 | 29 | |
| 30 | 30 | if(!isset($fUserSet)) { |
| 31 | 31 | // build first page |
| 32 | - $oPatternCustom->setHtml(getPage(null,null)); | |
| 32 | + $oPatternCustom->setHtml(getPage($fUserID,null)); | |
| 33 | 33 | $main->setFormAction($_SERVER["PHP_SELF"] . "?fUserSet=1"); |
| 34 | 34 | } else { |
| 35 | 35 | // do a check to see both drop downs selected |
| 36 | - if($fUserID == -1 Or $fGroupID ==-1) { | |
| 37 | - $oPatternCustom->setHtml(getPageNotSelected()); | |
| 36 | + if($fUserID == -1 Or $fGroupID ==-1 OR $fUserID=="" Or $fGroupID == "") { | |
| 37 | + $oPatternCustom->setHtml(getPageNotSelected("&fUserID=$fUserID")); | |
| 38 | 38 | } else { |
| 39 | 39 | $oPatternCustom->setHtml(getPage($fUserID,$fGroupID)); |
| 40 | 40 | $main->setFormAction($_SERVER["PHP_SELF"] . "?fUserSet=1&fUserAssign=1"); |
| 41 | - } | |
| 41 | + | |
| 42 | + } | |
| 42 | 43 | } |
| 43 | 44 | |
| 44 | 45 | if (isset($fUserAssign)) { |
| 45 | 46 | // else add to db and then goto page succes |
| 46 | 47 | $oUserGroup = new GroupUserLink($fGroupID,$fUserID); |
| 47 | 48 | if($oUserGroup->create()) { |
| 48 | - $oPatternCustom->setHtml(getPageSuccess()); | |
| 49 | + $oPatternCustom->setHtml(getPageSuccess("&fUserID=$fUserID")); | |
| 49 | 50 | } else { |
| 50 | 51 | $oPatternCustom->setHtml(getPageFail()); |
| 51 | 52 | } | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/addUserToGroupUI.inc
| ... | ... | @@ -15,21 +15,23 @@ function getPage($iUserID, $iGroupID) { |
| 15 | 15 | $oGroup = null; |
| 16 | 16 | |
| 17 | 17 | if (isset($iUserID)) { |
| 18 | - $oUser = User::get($iUserID); | |
| 19 | - $heading = "<tr><td colspan=\"2\">Are you Sure you wish to assign the User to the Group?</td></tr>\n"; | |
| 18 | + $heading = "<tr><td colspan=\"2\">Please Assign the User to a Group:</td></tr>\n"; | |
| 19 | + $oUser = User::get($iUserID); | |
| 20 | + //$heading = "<tr><td colspan=\"2\">Are you Sure you wish to assign the User to the Group?</td></tr>\n"; | |
| 20 | 21 | } else{ |
| 21 | 22 | $heading = "<tr><td colspan=\"2\">Please Assign a User to a Group:</td></tr>\n"; |
| 22 | 23 | } |
| 23 | 24 | if (isset($iGroupID)) { |
| 24 | 25 | $oGroup = Group::get($iGroupID); |
| 25 | 26 | } |
| 26 | - | |
| 27 | + $sQueryString = "&fUserID=$iUserID"; | |
| 28 | + | |
| 27 | 29 | $sToRender .= "<table width=\"600\">" . renderHeading("Add User to Group") . "</table>"; |
| 28 | 30 | $sToRender .= "<table>\n"; |
| 29 | 31 | $sToRender .= $heading; |
| 30 | 32 | $sToRender .= "<tr>\n"; |
| 31 | - $sToRender .= "</tr>\n"; | |
| 32 | - $sToRender .= "<td>User Name: </td><td>" . getUserDisplay($oUser) . "</td>\n"; | |
| 33 | + $sToRender .= "</tr>\n"; | |
| 34 | + $sToRender .= "<td>User Name: </td><td><input type=hidden id=\"fUserID\" name=\"fUserID\" value=\"" . $oUser->getID() . "\">" . $oUser->getName() . "</a></td>\n"; | |
| 33 | 35 | $sToRender .= "<tr>\n"; |
| 34 | 36 | $sToRender .= "</tr>\n"; |
| 35 | 37 | $sToRender .= "<tr>\n"; |
| ... | ... | @@ -40,7 +42,7 @@ function getPage($iUserID, $iGroupID) { |
| 40 | 42 | $sToRender .= "<tr>\n"; |
| 41 | 43 | $sToRender .= "</tr>\n"; |
| 42 | 44 | $sToRender .= "<td></td><td>" . getAssignButton($oUser); |
| 43 | - $sToRender .= getCancelButton($oUser); | |
| 45 | + $sToRender .= "<td><a href=\"$default->rootUrl/control.php?action=editUserGroups$sQueryString\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a></td>"; | |
| 44 | 46 | $sToRender .= "</td></table>\n"; |
| 45 | 47 | |
| 46 | 48 | |
| ... | ... | @@ -49,17 +51,17 @@ function getPage($iUserID, $iGroupID) { |
| 49 | 51 | |
| 50 | 52 | |
| 51 | 53 | // page that comes up when there is nothing selected |
| 52 | -function getPageNotSelected() { | |
| 54 | +function getPageNotSelected($sQueryString) { | |
| 53 | 55 | global $default; |
| 54 | 56 | |
| 55 | 57 | $sToRender .= "<table width=\"600\">" . renderHeading("Add User to Group") . "</table>"; |
| 56 | 58 | $sToRender .= "<table>\n"; |
| 57 | 59 | $sToRender .= "<tr><td><b>Sorry, Selection Failed</b></td></tr>\n"; |
| 58 | - $sToRender .= "<tr><td>Please select BOTH a User AND a Group</td></tr>\n"; | |
| 60 | + $sToRender .= "<tr><td>Please select Group</td></tr>\n"; | |
| 59 | 61 | $sToRender .= "<tr></tr>\n"; |
| 60 | 62 | $sToRender .= "<tr></tr>\n"; |
| 61 | 63 | $sToRender .= "<tr>\n"; |
| 62 | - $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=addUserToGroup\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 64 | + $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=addUserToGroup$sQueryString\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 63 | 65 | $sToRender .= "</tr>\n"; |
| 64 | 66 | $sToRender .= "</table>\n"; |
| 65 | 67 | |
| ... | ... | @@ -68,7 +70,7 @@ function getPageNotSelected() { |
| 68 | 70 | } |
| 69 | 71 | |
| 70 | 72 | //if addition successful |
| 71 | -function getPageSuccess() { | |
| 73 | +function getPageSuccess($sQueryString) { | |
| 72 | 74 | global $default; |
| 73 | 75 | |
| 74 | 76 | $sToRender .= "<table width=\"600\">" . renderHeading("Add User to Group") . "</table>"; |
| ... | ... | @@ -78,7 +80,7 @@ function getPageSuccess() { |
| 78 | 80 | $sToRender .= "<tr></tr>\n"; |
| 79 | 81 | $sToRender .= "<tr></tr>\n"; |
| 80 | 82 | $sToRender .= "<tr>\n"; |
| 81 | - $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=addUserToGroup\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 83 | + $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=addUserToGroup$sQueryString\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 82 | 84 | $sToRender .= "</tr>\n"; |
| 83 | 85 | $sToRender .= "</table>\n"; |
| 84 | 86 | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/editUserGroupsBL.php
0 โ 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* BL information for adding a User | |
| 4 | +* | |
| 5 | +* @author Mukhtar Dharsey | |
| 6 | +* @date 5 February 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | +require_once("../../../../../config/dmsDefaults.php"); | |
| 11 | + | |
| 12 | +if (checkSession()) { | |
| 13 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 14 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc"); | |
| 15 | + require_once("editUserGroupsUI.inc"); | |
| 16 | + require_once("../adminUI.inc"); | |
| 17 | + require_once("$default->fileSystemRoot/lib/groups/Group.inc"); | |
| 18 | + require_once("$default->fileSystemRoot/lib/users/User.inc"); | |
| 19 | + require_once("$default->fileSystemRoot/lib/groups/GroupUserLink.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/foldermanagement/Folder.inc"); | |
| 24 | + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | |
| 25 | + require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 26 | + | |
| 27 | + $oPatternCustom = & new PatternCustom(); | |
| 28 | + | |
| 29 | + if(isset($fUserID)) { //isset($fUserSet)) { | |
| 30 | + // do a check to see both drop downs selected | |
| 31 | + if($fUserID == -1) { | |
| 32 | + $oPatternCustom->setHtml(getPageNotSelected()); | |
| 33 | + } else { | |
| 34 | + $faGroupID = GroupUserLink::getGroups($fUserID); | |
| 35 | + $oPatternCustom->setHtml(getGroupPage($fUserID,$faGroupID)); | |
| 36 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fUserSet=1&fGroupSet=1"); | |
| 37 | + } | |
| 38 | + } else { | |
| 39 | + // build first page | |
| 40 | + $oPatternCustom->setHtml(getPage(null,null)); | |
| 41 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fUserSet=1"); | |
| 42 | + } | |
| 43 | + | |
| 44 | + if(isset($fGroupSet)) { | |
| 45 | + if($fOtherGroupID) { | |
| 46 | + $oPatternCustom->setHtml("Add"); | |
| 47 | + } else { | |
| 48 | + $oPatternCustom->setHtml("Delete"); | |
| 49 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fDeleteConfirmed=1&fGroupID=$fGroupID"); | |
| 50 | + } | |
| 51 | + } | |
| 52 | + | |
| 53 | + if (isset($fDeleteConfirmed)) { | |
| 54 | + // else add to db and then goto page succes | |
| 55 | + $oUserGroup = new GroupUserLink($fGroupID, $fUserID); | |
| 56 | + $oUserGroup->setUserGroupID($fGroupID,$fUserID); | |
| 57 | + if($oUserGroup->delete()) { | |
| 58 | + $oPatternCustom->setHtml(getPageSuccess()); | |
| 59 | + } else { | |
| 60 | + $oPatternCustom->setHtml(getPageFail()); | |
| 61 | + } | |
| 62 | + } | |
| 63 | + | |
| 64 | + // render page | |
| 65 | + $main->setCentralPayload($oPatternCustom); | |
| 66 | + $main->render(); | |
| 67 | +} | |
| 68 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/editUserGroupsUI.inc
0 โ 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information for adding a User | |
| 4 | +* | |
| 5 | +* @author Mukhtar Dharsey | |
| 6 | +* @date 5 February 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | + | |
| 11 | +// get page for removal | |
| 12 | +function getPage($iUserID) { | |
| 13 | + global $default; | |
| 14 | + $oUser = null; | |
| 15 | + $oGroup = null; | |
| 16 | + | |
| 17 | + // change headings if User selected | |
| 18 | + if (isset($iUserID)) { | |
| 19 | + $oUser = User::get($iUserID); | |
| 20 | + } else { | |
| 21 | + $heading = "<tr><td>Please select a User:</td></tr>\n"; | |
| 22 | + } | |
| 23 | + | |
| 24 | + $sToRender .= "<table width=\"600\">" . renderHeading("Edit User Groups") . "</table>"; | |
| 25 | + $sToRender .= "<table>\n"; | |
| 26 | + $sToRender .= $heading; | |
| 27 | + $sToRender .= "<tr>\n"; | |
| 28 | + $sToRender .= "</tr>\n"; | |
| 29 | + $sToRender .= "<td>User Name: " . getUserDisplay($oUser) . "</td>\n"; | |
| 30 | + $sToRender .= "<tr>\n"; | |
| 31 | + $sToRender .= "</tr>\n"; | |
| 32 | + $sToRender .= "<tr>\n"; | |
| 33 | + $sToRender .= "</tr>\n"; | |
| 34 | + $sToRender .= "<tr>\n"; | |
| 35 | + $sToRender .= "</tr>\n"; | |
| 36 | + $sToRender .= "</td></table>\n"; | |
| 37 | + | |
| 38 | + return $sToRender; | |
| 39 | +} | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | +// get page for removal | |
| 44 | +function getGroupPage($iUserID, $aGroup) { | |
| 45 | + global $default; | |
| 46 | + $oUser = null; | |
| 47 | + $oGroup = null; | |
| 48 | + | |
| 49 | + // change headings if User selected | |
| 50 | + if (isset($iUserID)) { | |
| 51 | + $oUser = User::get($iUserID); | |
| 52 | + } | |
| 53 | + | |
| 54 | + // change headings if User selected | |
| 55 | + if (isset($fGroupID)) { | |
| 56 | + $oGroup = Group::get($fGroupID); | |
| 57 | + echo "what: " . $oGroup->getName(); | |
| 58 | + } | |
| 59 | + | |
| 60 | + // when Groupid is gotten show the name | |
| 61 | + if (!isset($oGroup)) { | |
| 62 | + $Groupdisplay = " <b>Current Groups </b>" . getGroupDisplay($aGroup) . "\n"; | |
| 63 | + } else { | |
| 64 | + $Groupdisplay = "<td>Group Name: " . $oGroup->getName() . "</td>\n"; | |
| 65 | + | |
| 66 | + } | |
| 67 | + $OtherGroupdisplay = " Group Name: " . getOtherGroupDisplay($oGroup) . "\n"; | |
| 68 | + $sFontTag .= "<font face=\"Arial\" color=\"#0066cc\">"; | |
| 69 | + $sTableTag .= "<table width=100% border=0 cellspacing=0>"; | |
| 70 | + $sBgColor = "#F5F6EE"; | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + $sToRender .= "<table width=\"600\">"; | |
| 75 | + $sToRender .= renderHeading("Edit User Groups"); | |
| 76 | + $sToRender .= "</table>"; | |
| 77 | + | |
| 78 | + $sToRender .= "<table width=\"600\" border=0>"; | |
| 79 | + $sToRender .= "<tr><td width=100%><b>User Name: </b>" . getUserDisplay($oUser) . "</td><td>"; | |
| 80 | + $sToRender .= "<a href=\"$default->rootUrl/control.php?action=listUsers\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a>"; | |
| 81 | + $sToRender .= "</td></tr>\n"; | |
| 82 | + $sToRender .= "</table>"; | |
| 83 | + | |
| 84 | + $sToRender .= "<table width=\"600\" border=0><tr><td>"; | |
| 85 | + $sToRender .= "<table border=0 >"; | |
| 86 | + | |
| 87 | + $sToRender .= "<tr ><td valign=top>" . $Groupdisplay . "</td></tr>\n"; | |
| 88 | + $sToRender .= "<tr><td height=100><br></td></tr>\n"; | |
| 89 | + $sToRender .= "</table>"; | |
| 90 | + | |
| 91 | + $sToRender .= "</td><td valign=top>\n"; | |
| 92 | + | |
| 93 | + $sToRender .= "<table border=0 cellspacing=1>\n"; | |
| 94 | + $sToRender .= "<tr><td><b>Options</b></td></tr>"; | |
| 95 | + $sToRender .= "<tr><td width=200 bgcolor=$sBgColor>"; | |
| 96 | + $sToRender .= "<br> Add user to a group<br><br>"; | |
| 97 | + $sToRender .= "</td><td>"; | |
| 98 | + $sToRender .= "<a href=\"$default->rootUrl/control.php?action=addUserToGroup&fUserID=$iUserID\"><img border=0 src=\"$default->graphicsUrl/widgets/select.gif\"></img></a>"; | |
| 99 | + $sToRender .= "</td></tr>"; | |
| 100 | + $sToRender .= "<tr><td width=200 bgcolor=$sBgColor>"; | |
| 101 | + $sToRender .= "<br> Remove user from a group<br><br>"; | |
| 102 | + $sToRender .= "</td><td>"; | |
| 103 | + $sToRender .= "<a href=\"$default->rootUrl/control.php?action=removeUserFromGroup&fUserID=$iUserID\"><img border=0 src=\"$default->graphicsUrl/widgets/select.gif\"></img></a>"; | |
| 104 | + $sToRender .= "</td></tr>"; | |
| 105 | + $sToRender .= "</table>\n"; | |
| 106 | + | |
| 107 | + $sToRender .= "</td></tr>"; | |
| 108 | + $sToRender .= "</table>\n"; | |
| 109 | + | |
| 110 | + return $sToRender; | |
| 111 | +} | |
| 112 | + | |
| 113 | +// get page for removal | |
| 114 | +function getDeleteConfirmedPage($iUserID,$fGroupID) { | |
| 115 | + global $default; | |
| 116 | + $oUser = null; | |
| 117 | + $oGroup = null; | |
| 118 | + | |
| 119 | + // change headings if User selected | |
| 120 | + if (isset($iUserID)) { | |
| 121 | + $oUser = User::get($iUserID); | |
| 122 | + $heading = "<tr><td>Are you sure you wish to remove this user from the Group?</td></tr>"; | |
| 123 | + } | |
| 124 | + | |
| 125 | + // change headings if User selected | |
| 126 | + if (isset($fGroupID)) { | |
| 127 | + $oGroup = Group::get($fGroupID); | |
| 128 | + $Groupdisplay = "<td>Group Name: " . $oGroup->getName() . "</td>\n"; | |
| 129 | + } | |
| 130 | + | |
| 131 | + $sToRender .= "<table width=\"600\">" . renderHeading("Edit User Groups") . "</table>"; | |
| 132 | + $sToRender .= "<table>\n"; | |
| 133 | + $sToRender .= "<tr>\n"; | |
| 134 | + $sToRender .= $heading; | |
| 135 | + $sToRender .= "</tr>\n"; | |
| 136 | + $sToRender .= "<td>User Name: " . getUserDisplay($oUser) . "</td>\n"; | |
| 137 | + $sToRender .= "<tr>\n"; | |
| 138 | + $sToRender .= "</tr>\n"; | |
| 139 | + $sToRender .= "<tr>\n"; | |
| 140 | + $sToRender .= $Groupdisplay; | |
| 141 | + $sToRender .= "</tr>\n"; | |
| 142 | + $sToRender .= "<tr>\n"; | |
| 143 | + $sToRender .= "</tr>\n"; | |
| 144 | + $sToRender .= "<tr>\n"; | |
| 145 | + $sToRender .= "</tr>\n"; | |
| 146 | + $sToRender .= "<td></td><td>" . getDeleteButton($oUser); | |
| 147 | + $sToRender .= "<td></td><td>" . getCancelButton($oUser); | |
| 148 | + $sToRender .= "</td></table>\n"; | |
| 149 | + | |
| 150 | + | |
| 151 | + return $sToRender; | |
| 152 | +} | |
| 153 | + | |
| 154 | +// show paig if deletion fails | |
| 155 | +function getPageFail() { | |
| 156 | + global $default; | |
| 157 | + | |
| 158 | + $sToRender .= "<table width=\"600\">" . renderHeading("Edit User Groups") . "</table>"; | |
| 159 | + $sToRender .= "<table>\n"; | |
| 160 | + $sToRender .= "<tr><td><b>Sorry, Removal Failed</b></td></tr>\n"; | |
| 161 | + $sToRender .= "<tr></tr>\n"; | |
| 162 | + $sToRender .= "</tr>\n"; | |
| 163 | + $sToRender .= "<tr>\n"; | |
| 164 | + $sToRender .= "</tr>\n"; | |
| 165 | + $sToRender .= "<tr>\n"; | |
| 166 | + $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=removeUserFromGroup\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 167 | + $sToRender .= "</tr>\n"; | |
| 168 | + | |
| 169 | + $sToRender .= "</table>\n"; | |
| 170 | + | |
| 171 | + | |
| 172 | + return $sToRender; | |
| 173 | +} | |
| 174 | + | |
| 175 | +// show success page if removed from Group successfully | |
| 176 | +function getPageSuccess() { | |
| 177 | + global $default; | |
| 178 | + | |
| 179 | + $sToRender .= "<table width=\"600\">" . renderHeading("Edit User Groups") . "</table>"; | |
| 180 | + $sToRender .= "<table>\n"; | |
| 181 | + $sToRender .= "<tr><td><b>Success!</b></td></tr>\n"; | |
| 182 | + $sToRender .= "<tr></tr>\n"; | |
| 183 | + $sToRender .= "<tr><td>The User was successfully removed from the Group</td></tr>\n"; | |
| 184 | + $sToRender .= "<tr></tr>\n"; | |
| 185 | + $sToRender .= "<tr></tr>\n"; | |
| 186 | + $sToRender .= "<tr>\n"; | |
| 187 | + $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=listUsers\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 188 | + $sToRender .= "</tr>\n"; | |
| 189 | + $sToRender .= "</table>\n"; | |
| 190 | + | |
| 191 | + | |
| 192 | + return $sToRender; | |
| 193 | +} | |
| 194 | +// show listbox of Users belonging to Users_Groups_link table | |
| 195 | +function getUserDisplay($oUser) { | |
| 196 | + global $default; | |
| 197 | + if (!isset($oUser)) { | |
| 198 | + $oPatternListBox = & new PatternListBox($default->owl_users_table, "username", "id", "fUserID"); | |
| 199 | + if (Permission::userIsUnitAdministrator()) { | |
| 200 | + $oPatternListBox->setFromClause("INNER JOIN $default->owl_users_groups_table UGL on ST.id=UGL.user_id " . | |
| 201 | + "INNER JOIN $default->owl_groups_units_table GUL on UGL.group_id=GUL.group_id"); | |
| 202 | + $oPatternListBox->setWhereClause("GUL.unit_id=" . User::getUnitID($_SESSION["userID"])); | |
| 203 | + } | |
| 204 | + $oPatternListBox->setPostBackOnChange(true); | |
| 205 | + return $oPatternListBox->render(); | |
| 206 | + } else { | |
| 207 | + return "<input type=\"hidden\" name=\"fUserID\" value=\"" . $oUser->iId . "\">\n" . | |
| 208 | + $oUser->getUserName(); | |
| 209 | + } | |
| 210 | +} | |
| 211 | + | |
| 212 | +// display the listbox initially ..then just display the text | |
| 213 | +function getOtherGroupDisplay($oGroup) { | |
| 214 | + global $default; | |
| 215 | + if (!isset($oGroup)) { | |
| 216 | + if (Permission::userIsSystemAdministrator()) { | |
| 217 | + // if this is the system administrator, prepend group names with unit name | |
| 218 | + $oPatternListBox = & new PatternListBox($default->owl_groups_table, "name", "id", "fOtherGroupID"); | |
| 219 | + $oPatternListBox->setFromClause("LEFT OUTER JOIN groups_units_link GUL on ST.id=GUL.group_id " . | |
| 220 | + "LEFT OUTER JOIN units_lookup UL on GUL.unit_id=UL.id"); | |
| 221 | + $oPatternListBox->setCompositeDisplayName("DISTINCT COALESCE(CONCAT(CONCAT(UL.name, '-'),ST.name),ST.name)"); | |
| 222 | + } else if (Permission::userIsUnitAdministrator()) { | |
| 223 | + // else if this is a unit administrator, only display the groups in your unit | |
| 224 | + $oPatternListBox = & new PatternListBox($default->owl_groups_table, "name", "id", "fOtherGroupID"); | |
| 225 | + $oPatternListBox->setFromClause("INNER JOIN $default->owl_groups_units_table GUL on ST.id=GUL.group_id"); | |
| 226 | + $oPatternListBox->setWhereClause("GUL.unit_id=" . User::getUnitID($_SESSION["userID"])); | |
| 227 | + } | |
| 228 | + return $oPatternListBox->render(); | |
| 229 | + } else { | |
| 230 | + return "<input type=\"hidden\" name=\"fOtherGroupID\" value=\"" . $oGroup->iId . "\">\n" . | |
| 231 | + $oGroup->getName(); | |
| 232 | + } | |
| 233 | +} | |
| 234 | +// show Group details on confirm deletion page | |
| 235 | +function getGroupDisplay($aGroup) { | |
| 236 | + global $default; | |
| 237 | + | |
| 238 | + $sBgColor = "#F5F6EE"; | |
| 239 | + $oGroup= null; | |
| 240 | + $sGroup = "<table cellspacing=1 border=0>"; | |
| 241 | + for ($i=0;$i < count($aGroup);$i++) { | |
| 242 | + $oGroup= Group::get($aGroup[$i]); | |
| 243 | + $Options .= "<tr><td>" . ($i+1) . "</td><td bgcolor=$sBgColor>". $oGroup->getName() ."</td></tr>\n"; | |
| 244 | + } | |
| 245 | + $sGroup .= $Options . "</table>"; | |
| 246 | + return $sGroup; | |
| 247 | + | |
| 248 | + /*$oGroup= null; | |
| 249 | + $sGroup = "<select name=\"fGroupID\">"; | |
| 250 | + for ($i=0;$i < count($aGroup);$i++) { | |
| 251 | + $oGroup= Group::get($aGroup[$i]); | |
| 252 | + $Options .= "<OPTION value= \"". $oGroup->iId . "\">". $oGroup->getName() ."</OPTION>\n"; | |
| 253 | + } | |
| 254 | + $sGroup .= $Options . "</SELECT>"; | |
| 255 | + return $sGroup;*/ | |
| 256 | +} | |
| 257 | + | |
| 258 | + | |
| 259 | +// show delete button or select button | |
| 260 | +function getDeleteButton($oUser) { | |
| 261 | + global $default; | |
| 262 | + if (!isset($oUser)) { | |
| 263 | + return "<td align = right><input type=\"image\" src =\"$default->graphicsUrl/widgets/select.gif\" value=\"submit\" border=\"0\"/></td>\n"; | |
| 264 | + } else { | |
| 265 | + return "<td align = right><input type=\"image\" src =\"$default->graphicsUrl/widgets/delete.gif\" value=\"submit\" border=\"0\"/></td>\n"; | |
| 266 | + } | |
| 267 | +} | |
| 268 | + | |
| 269 | + | |
| 270 | +// show delete button or select button | |
| 271 | +function getSelectButton($oUser) { | |
| 272 | + global $default; | |
| 273 | + if (!isset($oUser)) { | |
| 274 | + return "<input type=\"image\" src =\"$default->graphicsUrl/widgets/select.gif\" value=\"submit\" border=\"0\"/>\n"; | |
| 275 | + } else { | |
| 276 | + return "<input type=\"image\" src =\"$default->graphicsUrl/widgets/select.gif\" value=\"submit\" border=\"0\"/>\n"; | |
| 277 | + } | |
| 278 | +} | |
| 279 | +// show cancel button | |
| 280 | +function getCancelButton($oUser) { | |
| 281 | + global $default; | |
| 282 | + if (!isset($oUser)) { | |
| 283 | + //return "<td align = right><a href=\"$default->rootUrl/control.php?action=UserManagement\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" value=\"cancel\" /></a></td>\n"; | |
| 284 | + } | |
| 285 | + else { | |
| 286 | + return "<a href=\"$default->rootUrl/control.php?action=listUsers\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a>\n"; | |
| 287 | + } | |
| 288 | +} | |
| 289 | + | |
| 290 | + | |
| 291 | +?> | |
| 0 | 292 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/editUserUI.inc
| ... | ... | @@ -76,7 +76,7 @@ function getEditPageSuccess() { |
| 76 | 76 | $sToRender .= "<tr></tr>\n"; |
| 77 | 77 | $sToRender .= "<tr></tr>\n"; |
| 78 | 78 | $sToRender .= "<tr>\n"; |
| 79 | - $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=editUser\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 79 | + $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=listUsers&\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 80 | 80 | $sToRender .= "</tr>\n"; |
| 81 | 81 | $sToRender .= "</table>\n"; |
| 82 | 82 | |
| ... | ... | @@ -134,8 +134,8 @@ function getCancelButton($oUser) { |
| 134 | 134 | global $default; |
| 135 | 135 | if (!isset($oUser)) { |
| 136 | 136 | return "<a href=\"$default->rootUrl/control.php?action=userManagement\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" value=\"cancel\" border=\"0\"/></a>\n"; |
| 137 | - } else { | |
| 138 | - return "<a href=\"$default->rootUrl/control.php?action=editUser\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\" /></a>\n"; | |
| 137 | + } else { | |
| 138 | + return "<a href=\"$default->rootUrl/control.php?action=listUsers\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\" /></a>\n"; | |
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | ?> |
| 142 | 142 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/listUsersBL.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("ListUsersUI.inc"); | |
| 16 | + require_once("../adminUI.inc"); | |
| 17 | + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | |
| 18 | + require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); | |
| 19 | + require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | |
| 20 | + require_once("$default->fileSystemRoot/lib/users/User.inc"); | |
| 21 | + require_once("$default->fileSystemRoot/lib/security/permission.inc"); | |
| 22 | + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 23 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | |
| 24 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc"); | |
| 25 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc"); | |
| 26 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 27 | + require_once("$default->fileSystemRoot/lib/discussions/DiscussionThread.inc"); | |
| 28 | + require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc"); | |
| 29 | + require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 30 | + | |
| 31 | + | |
| 32 | + $oPatternCustom = & new PatternCustom(); | |
| 33 | + | |
| 34 | +if(checkSession()) { | |
| 35 | + | |
| 36 | + $oPatternCustom->addHtml("<table width=600>"); // Create the Heading | |
| 37 | + $oPatternCustom->addHtml(renderHeading("Current System Users")); // Create the Heading | |
| 38 | + $oPatternCustom->addHtml("</table>"); // Create the Heading | |
| 39 | + | |
| 40 | + $oPatternCustom->addHtml("<table align='left' border=0><tr><td><b>Filter by group </b></td><td>"); // | |
| 41 | + if (isset($fGroupID)) { // Check if should use the query string OR ... | |
| 42 | + $sFilterOptions = getFilterOptions($fGroupID); | |
| 43 | + $oPatternCustom->addHtml($sFilterOptions . "</td></tr></table>\n"); // Get Groups Dropdown for filter option | |
| 44 | + } else { // ... should use session variable | |
| 45 | + $sFilterOptions = getFilterOptions($_SESSION['UserGroupFilter'][0]->iSessionGroupID); | |
| 46 | + $oPatternCustom->addHtml(getFilterOptions($sFilterOptions) . "</td></tr></table>"); // Get Groups Dropdown for filter option | |
| 47 | + } | |
| 48 | + $oPatternCustom->addHtml(getSubmit()); | |
| 49 | + $oPatternCustom->addHtml("<br><br><br>"); | |
| 50 | + $main->setFormAction($_SERVER['PHP_SELF']); | |
| 51 | + | |
| 52 | + | |
| 53 | + if($fGroupID == "") { // Used when user wants to filter by group | |
| 54 | + $sQuery = "SELECT users.id as userID, users.name as name, username, " . | |
| 55 | + "'Edit' , 'Delete', 'Edit Groups' " . | |
| 56 | + "FROM users " . | |
| 57 | + "ORDER BY users.name"; | |
| 58 | + $_SESSION['UserGroupFilter'][0]->iSessionGroupID = ""; | |
| 59 | + | |
| 60 | + } else { // List all users on the system | |
| 61 | + if (isset($fGroupID)) { | |
| 62 | + $_SESSION['UserGroupFilter'][0]->iSessionGroupID = $fGroupID ; | |
| 63 | + } else { | |
| 64 | + $fGroupID = $_SESSION['UserGroupFilter'][0]->iSessionGroupID; | |
| 65 | + } | |
| 66 | + $sQuery = "SELECT users.id as userID, users.name as name, username, " . | |
| 67 | + "'Edit' , 'Delete', 'Edit Groups' , users_groups_link.group_id " . | |
| 68 | + "FROM users inner JOIN users_groups_link ON users.id = users_groups_link.user_id " . | |
| 69 | + "WHERE users_groups_link.group_id = $fGroupID " . | |
| 70 | + "ORDER BY users.name"; | |
| 71 | + } | |
| 72 | + | |
| 73 | + $aColumns = array("name", "username", "Edit", "Delete", "Edit Groups"); | |
| 74 | + $aColumnNames = array("Name", "Username", "Edit", "Delete", "Edit Groups"); | |
| 75 | + $aColumnTypes = array(1,1,3,3,3); | |
| 76 | + $aDBColumnArray = array("userID"); | |
| 77 | + $aQueryStringVariableNames = array("fUserID"); | |
| 78 | + | |
| 79 | + $aHyperLinkURL = array( 2=> "$default->rootUrl/control.php?action=editUser", | |
| 80 | + 3=> "$default->rootUrl/control.php?action=removeUser", | |
| 81 | + 4=> "$default->rootUrl/control.php?action=editUserGroups"); //"$default->rootUrl/control.php?action=removeUserFromGroup"); | |
| 82 | + | |
| 83 | + $oSearchResults = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkURL,$aDBColumnArray,$aQueryStringVariableNames); | |
| 84 | + | |
| 85 | + $oSearchResults->setDisplayColumnHeadings(true); | |
| 86 | + $htmlTables = $oSearchResults->render() ; | |
| 87 | + | |
| 88 | + $oPatternCustom->addHtml($htmlTables); | |
| 89 | + | |
| 90 | + } // end of if checksession | |
| 91 | + | |
| 92 | + $main->setCentralPayload($oPatternCustom); | |
| 93 | + $main->render(); | |
| 94 | +} | |
| 95 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/listUsersUI.inc
0 โ 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information for adding a unit | |
| 4 | +* | |
| 5 | +* @author Omar Rahbeeni | |
| 6 | +* @date 19 May 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | + | |
| 11 | +function getSubmit() { | |
| 12 | + global $default; | |
| 13 | + $sToRender = "<input type=\"image\" src =\"$default->graphicsUrl/widgets/select.gif\" value=\"submit\" border=\"0\"/>\n"; | |
| 14 | + return $sToRender; | |
| 15 | +} | |
| 16 | + | |
| 17 | +// display the listbox initially ..then just display the text | |
| 18 | +function getGroupDisplay($oGroup, $iSelectedValue = 0) { | |
| 19 | + global $default; | |
| 20 | + if (!isset($oGroup)) { | |
| 21 | + if (Permission::userIsSystemAdministrator()) { | |
| 22 | + // if this is the system administrator, prepend group names with unit name | |
| 23 | + $oPatternListBox = & new PatternListBox($default->owl_groups_table, "name", "id", "fGroupID"); | |
| 24 | + $oPatternListBox->setFromClause("LEFT OUTER JOIN groups_units_link GUL on ST.id=GUL.group_id " . | |
| 25 | + "LEFT OUTER JOIN units_lookup UL on GUL.unit_id=UL.id"); | |
| 26 | + $oPatternListBox->setCompositeDisplayName("DISTINCT COALESCE(CONCAT(CONCAT(UL.name, '-'),ST.name),ST.name)"); | |
| 27 | + } else if (Permission::userIsUnitAdministrator()) { | |
| 28 | + // else if this is a unit administrator, only display the groups in your unit | |
| 29 | + $oPatternListBox = & new PatternListBox($default->owl_groups_table, "name", "id", "fGroupID"); | |
| 30 | + $oPatternListBox->setFromClause("INNER JOIN $default->owl_groups_units_table GUL on ST.id=GUL.group_id"); | |
| 31 | + $oPatternListBox->setWhereClause("GUL.unit_id=" . User::getUnitID($_SESSION["userID"])); | |
| 32 | + } | |
| 33 | + if ($iSelectedValue != 0) { | |
| 34 | + $oPatternListBox->setSelectedValue($iSelectedValue); | |
| 35 | + } | |
| 36 | + | |
| 37 | + return $oPatternListBox->render(); | |
| 38 | + } else { | |
| 39 | + return "<input type=\"hidden\" name=\"fGroupID\" value=\"" . $oGroup->iId . "\">\n" . | |
| 40 | + $oGroup->getName(); | |
| 41 | + } | |
| 42 | + | |
| 43 | +} | |
| 44 | + | |
| 45 | + | |
| 46 | +function getFilterOptions($fGroupID = 0){ | |
| 47 | + global $default; | |
| 48 | + $sToRender .= getGroupDisplay($aGroups, $fGroupID); | |
| 49 | + /* | |
| 50 | + $sToRender .= "<table width=100%><tr>\n"; | |
| 51 | + $sToRender .= "<td align=right width=100%><a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $oThread->getDocumentID() . "&fAddComment=1") . "\"><img src=\"$default->graphicsUrl/widgets/addcomment.gif\" border=\"0\" /></a></td>\n"; | |
| 52 | + $sToRender .= "<td align=right width=10><img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" /></td>\n"; | |
| 53 | + | |
| 54 | + $sToRender .= "</tr></table>\n";*/ | |
| 55 | + return $sToRender ; | |
| 56 | +} | |
| 57 | + | |
| 58 | +function getPageButtons($oThread){ | |
| 59 | + global $default; | |
| 60 | + | |
| 61 | + $sToRender .= "<table width=100%><tr>\n"; | |
| 62 | + $sToRender .= "<td align=right width=100%><a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $oThread->getDocumentID() . "&fAddComment=1") . "\"><img src=\"$default->graphicsUrl/widgets/addcomment.gif\" border=\"0\" /></a></td>\n"; | |
| 63 | + $sToRender .= "<td align=right width=10><img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" /></td>\n"; | |
| 64 | + | |
| 65 | + $sToRender .= "</tr></table>\n"; | |
| 66 | + //$sToRender .= "<a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $oThread->getDocumentID() . "&fAddComment=1") . "\"><img src=\"$default->graphicsUrl/widgets/addcomment.gif\" border=\"0\" /></a>\n"; | |
| 67 | + //$sToRender .= "<img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" />\n"; | |
| 68 | + | |
| 69 | + return $sToRender ; | |
| 70 | +} | |
| 71 | + | |
| 72 | +// If there are no threads to view for a document | |
| 73 | +function getViewFailPage($sMessage) | |
| 74 | +{ | |
| 75 | + global $default; | |
| 76 | + | |
| 77 | + if (strlen($sMessage)>0){ | |
| 78 | + $sToRender = $sMessage; | |
| 79 | + } | |
| 80 | + else $sToRender = "Current document has no discussion. Press the ADD button to start a discussion."; | |
| 81 | + | |
| 82 | + return $sToRender; | |
| 83 | +} | |
| 84 | + | |
| 85 | +/** | |
| 86 | + * Page to create a new thread | |
| 87 | + * | |
| 88 | + * @param $fDocumentID -> a valid document ID | |
| 89 | + */ | |
| 90 | +function getNewThreadOption($fDocumentID) { | |
| 91 | + global $default; | |
| 92 | + | |
| 93 | + $sToRender .= "Would you like to create a new Discussion thread for this document?"; | |
| 94 | + $sToRender .= " "; | |
| 95 | + $sToRender .= "<a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $fDocumentID . "&fNewThread=1") . "\"><img src=\"$default->graphicsUrl/widgets/new.gif\" border=\"0\"></a>"; | |
| 96 | + $sToRender .= "<a href=\"" . generateControllerLink("viewDocument", "fDocumentID=" . $fDocumentID) . "\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"></a>"; | |
| 97 | + | |
| 98 | + return $sToRender; | |
| 99 | +} | |
| 100 | + | |
| 101 | +/** | |
| 102 | + * Renders the heading for the page | |
| 103 | + * | |
| 104 | + * @param $sHeading -> text heading for the page | |
| 105 | + */ | |
| 106 | +function renderHeading1($sHeading) { | |
| 107 | + global $default; | |
| 108 | + | |
| 109 | + $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); | |
| 110 | + $sColor = $default->siteMap->getSectionColour($sSectionName, "th"); | |
| 111 | + $sToRender = "<table border=\"0\" width=\"600\">\n"; | |
| 112 | + $sToRender .= "<tr align=\"left\"><th class=\"sectionHeading\" bgcolor=\"$sColor\"><font color=\"ffffff\">$sHeading</font></th></tr>\n"; | |
| 113 | + $sToRender .= "<tr/>\n"; | |
| 114 | + $sToRender .= "<tr/>\n"; | |
| 115 | + $sToRender .= "</table>\n"; | |
| 116 | + return $sToRender; | |
| 117 | +} | |
| 118 | + | |
| 119 | +/** | |
| 120 | + * Renders the path for the document | |
| 121 | + * | |
| 122 | + * @param $fDocumentID -> a valid document ID | |
| 123 | + */ | |
| 124 | +function renderDocumentPath($iDocumentID) { | |
| 125 | + global $default; | |
| 126 | + | |
| 127 | + $oDocument = & Document::get($iDocumentID); | |
| 128 | + $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); | |
| 129 | + $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td"); | |
| 130 | + $sDocumentPath = displayFolderPathLink(Folder::getFolderPathAsArray($oDocument->getFolderID()), Folder::getFolderPathNamesAsArray($oDocument->getFolderID()), "$default->rootUrl/control.php?action=browse") . " > "; | |
| 131 | + $sDocumentPath .= "<a href=\"$default->rootUrl/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php?fDocumentID=" . $oDocument->getID() . "&fForInlineView=1\">" . $oDocument->getName() . "</a>"; | |
| 132 | + return "<table border=0 cellpadding=\"5\" width = 100%><tr><td bgcolor=\"$sTDBGColour\">$sDocumentPath</td></tr></table>\n"; | |
| 133 | +} | |
| 134 | + | |
| 135 | +/** | |
| 136 | + * Views the list of comments for a document | |
| 137 | + * Prints out 1 comment | |
| 138 | + * User needs to call this function many times to list all comments | |
| 139 | + * | |
| 140 | + * @param $iNum -> its the iterative index of the current comment | |
| 141 | + * @param $iThread -> a valid Thread Object | |
| 142 | + * @param $oComment -> a valid Comment Object | |
| 143 | + * @param $oUser -> a valid User Object (Logged in user) | |
| 144 | + */ | |
| 145 | +function getViewComment($iNum,$oThread,$oComment,$oUser) { | |
| 146 | + global $default; | |
| 147 | + | |
| 148 | + $iSubjectChars = 59; | |
| 149 | + // If iNum is odd then highlight it | |
| 150 | + if (($iNum%2) == 1) $BGcolor = "#F5F6EE"; | |
| 151 | + if (($iNum%2) == 0) $UserBGcolor = "#F5F6EE"; | |
| 152 | + | |
| 153 | + // If the Subject string is too long | |
| 154 | + if (strlen($oComment->getSubject())>$iSubjectChars ) $dotdot = " ..."; | |
| 155 | + if (strlen($oUser->getUserName())> 13 ) $Userdotdot = " ..."; | |
| 156 | + | |
| 157 | + // If this is the first Subject line then create a table | |
| 158 | + if ($iNum == 1) { | |
| 159 | + $sHeading = "Document Discussion Comments"; | |
| 160 | + | |
| 161 | + $sToRender .= renderHeading($sHeading ); | |
| 162 | + $sToRender .= renderDocumentPath($oThread->getDocumentID()); | |
| 163 | + $sToRender .= "<table border=0 width=100%><tr>"; | |
| 164 | + $sToRender .= "<td width=100><b>Views: </b> " . $oThread->getNumberOfViews() . "</td>"; | |
| 165 | + $sToRender .= "<td width=20></td>"; | |
| 166 | + $sToRender .= "<td><b>Replies: </b> " . $oThread->getNumberOfReplies() . "</td>"; | |
| 167 | + $sToRender .= "<td align=right><a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $oThread->getDocumentID() . "&fAddComment=1") . "\"><img src=\"$default->graphicsUrl/widgets/addcomment.gif\" border=\"0\" /></a>"; | |
| 168 | + $sToRender .= "<img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" ></td>"; | |
| 169 | + $sToRender .= "</tr></table><br>\n"; | |
| 170 | + $sToRender .= "<table border=\"0\" width=\"100%\">\n"; | |
| 171 | + $sToRender .= "<tr><td></td>\n"; | |
| 172 | + $sToRender .= "<td><b>Subject</b></td>\n"; | |
| 173 | + $sToRender .= "<td><b>Author</b></td>\n"; | |
| 174 | + $sToRender .= "<td><b>Date</b></td>\n"; | |
| 175 | + $sToRender .= "</tr>\n"; | |
| 176 | + } | |
| 177 | + | |
| 178 | + $sToRender .= "<tr><td>$iNum </td><td style=\"background-color:$BGcolor\" width=450><a style=\"width:94%\" href=\"" . $_SERVER['PHP_SELF'] . "?fViewComment=1&iCommentID=" . $oComment->getID() . "&iDocumentID=" . $oThread->getDocumentID() . "\" title=\"" . $oComment->getSubject() . "\">" . substr($oComment->getSubject(),0,$iSubjectChars ) . $dotdot . "</a></td>\n"; | |
| 179 | + $sToRender .= "<td style=\"background-color:$UserBGcolor\" width=\"100\" title=\"$oUser->getUserName()\">" . substr($oUser->getUserName(),0,10) . $Userdotdot . "</td>\n"; | |
| 180 | + $sToRender .= "<td style=\"background-color:$BGcolor\" width=\"80\">" . $oComment->getDate() . "<td></tr>\n"; | |
| 181 | + | |
| 182 | + // If this is the last subject line then close the table | |
| 183 | + if ($iNum == ($oThread->getNumberOfReplies())) { $sToRender .= "\n</table>\n\n";} | |
| 184 | + return $sToRender; | |
| 185 | +} | |
| 186 | + | |
| 187 | +/** | |
| 188 | + * Views a single thread comment with its text body | |
| 189 | + * | |
| 190 | + * @param $iDocumentID -> a valid Document ID | |
| 191 | + * @param $oComment -> a valid Comment Object | |
| 192 | + * @param $oUser -> a valid User Object (Logged in user) | |
| 193 | + */ | |
| 194 | +function getCommentBody($oComment, $iDocumentID, $oUser) { | |
| 195 | + global $default; | |
| 196 | + | |
| 197 | + $sHeading = "Document Comment"; | |
| 198 | + | |
| 199 | + $sToRender .= renderHeading($sHeading); | |
| 200 | + $sToRender .= renderDocumentPath($iDocumentID); | |
| 201 | + | |
| 202 | + $sToRender .= "<br><table width=100% border=0><tr ><td colspan=2><b>Author: </b>" . $oUser->getUserName() . "</td>\n"; | |
| 203 | + $sToRender .= "<td align=right>\n"; | |
| 204 | + $sToRender .= "<a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $iDocumentID . "&fReplyComment=1&fCommentID=" . $oComment->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/reply.gif\" border=\"0\" /></a>"; | |
| 205 | + $sToRender .= "</td><td width=30><img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" ></td></tr>\n"; | |
| 206 | + $sToRender .= "<tr><td width=\"1\" style=\"background-color:#F5F6EE;\" valign=\"top\"><b>Subject: </b></td><td width=405 style=\"background-color:#F5F6EE;\">"; | |
| 207 | + $sToRender .= "<a>" . $oComment->getSubject() . "</a>"; | |
| 208 | + $sToRender .= "</td><td colspan=2><b>Date: </b><font color=\"#056DCE\">" . $oComment->getDate() . "</font> </td></tr><tr><td colspan=4 valign=top>"; | |
| 209 | + $sToRender .= "<DIV> "; | |
| 210 | + $sToRender .= urldecode(str_replace("%0D%0A","<br>",str_replace("+", " ",$oComment->getBody()))); // Div Views as HTML | |
| 211 | + $sToRender .= "</DIV></td>"; | |
| 212 | + | |
| 213 | + $sToRender .= "</tr></table> "; | |
| 214 | + | |
| 215 | + return $sToRender; | |
| 216 | +} | |
| 217 | + | |
| 218 | +?> | |
| 0 | 219 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/removeUserFromGroupBL.php
| ... | ... | @@ -26,7 +26,7 @@ if (checkSession()) { |
| 26 | 26 | |
| 27 | 27 | $oPatternCustom = & new PatternCustom(); |
| 28 | 28 | |
| 29 | - if(isset($fUserSet)) { | |
| 29 | + if(isset($fUserID)) { //isset($fUserSet)) { | |
| 30 | 30 | // do a check to see both drop downs selected |
| 31 | 31 | if($fUserID == -1) { |
| 32 | 32 | $oPatternCustom->setHtml(getPageNotSelected()); |
| ... | ... | @@ -51,7 +51,7 @@ if (checkSession()) { |
| 51 | 51 | $oUserGroup = new GroupUserLink($fGroupID, $fUserID); |
| 52 | 52 | $oUserGroup->setUserGroupID($fGroupID,$fUserID); |
| 53 | 53 | if($oUserGroup->delete()) { |
| 54 | - $oPatternCustom->setHtml(getPageSuccess()); | |
| 54 | + $oPatternCustom->setHtml(getPageSuccess($fUserID)); | |
| 55 | 55 | } else { |
| 56 | 56 | $oPatternCustom->setHtml(getPageFail()); |
| 57 | 57 | } | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/removeUserFromGroupUI.inc
| ... | ... | @@ -33,11 +33,9 @@ function getPage($iUserID) { |
| 33 | 33 | $sToRender .= "</tr>\n"; |
| 34 | 34 | $sToRender .= "<tr>\n"; |
| 35 | 35 | $sToRender .= "</tr>\n"; |
| 36 | - //$sToRender .= "<td></td><td>" . getDeleteButton($oUser); | |
| 37 | - //$sToRender .= "<td></td><td>" . getCancelButton($oUser); | |
| 36 | + | |
| 38 | 37 | $sToRender .= "</td></table>\n"; |
| 39 | 38 | |
| 40 | - | |
| 41 | 39 | return $sToRender; |
| 42 | 40 | } |
| 43 | 41 | |
| ... | ... | @@ -154,7 +152,7 @@ function getPageFail() { |
| 154 | 152 | } |
| 155 | 153 | |
| 156 | 154 | // show success page if removed from Group successfully |
| 157 | -function getPageSuccess() { | |
| 155 | +function getPageSuccess($fUserID) { | |
| 158 | 156 | global $default; |
| 159 | 157 | |
| 160 | 158 | $sToRender .= "<table width=\"600\">" . renderHeading("Remove User From Group") . "</table>"; |
| ... | ... | @@ -165,7 +163,7 @@ function getPageSuccess() { |
| 165 | 163 | $sToRender .= "<tr></tr>\n"; |
| 166 | 164 | $sToRender .= "<tr></tr>\n"; |
| 167 | 165 | $sToRender .= "<tr>\n"; |
| 168 | - $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=removeUserFromGroup\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 166 | + $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=editUserGroups&fUserID=$fUserID\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 169 | 167 | $sToRender .= "</tr>\n"; |
| 170 | 168 | $sToRender .= "</table>\n"; |
| 171 | 169 | |
| ... | ... | @@ -233,7 +231,7 @@ function getCancelButton($oUser) { |
| 233 | 231 | //return "<td align = right><a href=\"$default->rootUrl/control.php?action=UserManagement\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" value=\"cancel\" /></a></td>\n"; |
| 234 | 232 | } |
| 235 | 233 | else { |
| 236 | - return "<td align = right><a href=\"$default->rootUrl/control.php?action=removeUserFromGroup\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 234 | + return "<td align = right><a href=\"$default->rootUrl/control.php?action=editUserGroups&fUserID=" . $oUser->getID() . "\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 237 | 235 | } |
| 238 | 236 | } |
| 239 | 237 | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/usermanagement/removeUserUI.inc
| ... | ... | @@ -52,7 +52,7 @@ function getDeleteSuccessPage() { |
| 52 | 52 | $sToRender .= "<tr></tr>\n"; |
| 53 | 53 | $sToRender .= "<tr></tr>\n"; |
| 54 | 54 | $sToRender .= "<tr>\n"; |
| 55 | - $sToRender .= "<td align = right><a href=\"$default->rootUrl/control.php?action=removeUser\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 55 | + $sToRender .= "<td align = right><a href=\"$default->rootUrl/control.php?action=listUsers\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 56 | 56 | $sToRender .= "</tr>\n"; |
| 57 | 57 | $sToRender .= "</table>\n"; |
| 58 | 58 | |
| ... | ... | @@ -71,7 +71,7 @@ function getDeleteFailPage() { |
| 71 | 71 | $sToRender .= "</tr>\n"; |
| 72 | 72 | $sToRender .= "<tr></tr>\n"; |
| 73 | 73 | $sToRender .= "</tr>\n"; |
| 74 | - $sToRender .= "<tr><td align = right><a href=\"$default->rootUrl/control.php?action=removeUser\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td></tr>\n"; | |
| 74 | + $sToRender .= "<tr><td align = right><a href=\"$default->rootUrl/control.php?action=listUsers\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td></tr>\n"; | |
| 75 | 75 | $sToRender .= "</table>\n"; |
| 76 | 76 | |
| 77 | 77 | return $sToRender; |
| ... | ... | @@ -147,7 +147,7 @@ function getUserDetails($oUser) { |
| 147 | 147 | function getDeleteButton($oUser) { |
| 148 | 148 | global $default; |
| 149 | 149 | return "<td align = right><input type=\"image\" src =\"$default->graphicsUrl/widgets/delete.gif\" value=\"submit\" border=\"0\"/></td>\n". |
| 150 | - "<td align = right><a href=\"$default->rootUrl/control.php?action=removeUser\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 150 | + "<td><a href=\"$default->rootUrl/control.php?action=listUsers\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\" /></a></td>\n"; | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
| ... | ... | @@ -158,7 +158,7 @@ function getCancelButton($oUser) { |
| 158 | 158 | return "<td align = right><a href=\"$default->rootUrl/control.php?action=userAdministration\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" value=\"cancel\" /></a></td>\n"; |
| 159 | 159 | } |
| 160 | 160 | else { |
| 161 | - return "<td align = right><a href=\"$default->rootUrl/control.php?action=removeUser\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 161 | + return "<td align = right><a href=\"$default->rootUrl/control.php?action=removeUser\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | ... | ... |