Commit 7c4ed24185adac4b8abc9eea345b47ba09c61ec0
1 parent
5527c11c
no message
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@905 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
8 changed files
with
366 additions
and
18 deletions
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/editGroupBL.php
| ... | ... | @@ -25,13 +25,12 @@ if (checkSession()) { |
| 25 | 25 | $oPatternCustom = & new PatternCustom(); |
| 26 | 26 | $oPatternCustom->setHtml(getCreatePage($fGroupID)); |
| 27 | 27 | $main->setCentralPayload($oPatternCustom); |
| 28 | - $main->setFormAction("$default->owl_root_url/presentation/lookAndFeel/knowledgeTree/store.php?fRedirectURL=" . urlencode("$default->owl_root_url/control.php?action=editGroup&fGroupID=$fGroupID")); | |
| 28 | + $main->setFormAction("$default->owl_root_url/presentation/lookAndFeel/knowledgeTree/store.php?fRedirectURL=" . urlencode("$default->owl_root_url/control.php?action=editGroupSuccess")); | |
| 29 | 29 | $main->render(); |
| 30 | 30 | } else if (isset($fForStore)) { |
| 31 | 31 | $oGroup = Group::get($fGroupID); |
| 32 | 32 | $oGroup->setName($fGroupName); |
| 33 | 33 | |
| 34 | - echo "Group name:" . $fGroupName; | |
| 35 | 34 | if (isset($fGroupUnitAdmin)) { |
| 36 | 35 | $oGroup->setUnitAdmin(true); |
| 37 | 36 | } else { |
| ... | ... | @@ -44,9 +43,9 @@ if (checkSession()) { |
| 44 | 43 | $oGroup->setSysAdmin(false); |
| 45 | 44 | } |
| 46 | 45 | if ($oGroup->update()) { |
| 47 | - redirect($_SERVER["PHP_SELF"]); | |
| 46 | + redirect("$default->owl_root_url/control.php?action=editGroupSuccess"); | |
| 48 | 47 | } else { |
| 49 | - | |
| 48 | + redirect("$default->owl_root_url/control.php?action=editGroupFail"); | |
| 50 | 49 | } |
| 51 | 50 | } else if (isset($fGroupID)){ |
| 52 | 51 | $oPatternCustom = & new PatternCustom(); | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/editGroupFail.php
0 โ 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information when updating froup properties fail | |
| 4 | +* | |
| 5 | +* @author Mukhtar Dharsey | |
| 6 | +* @date 5 February 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | + | |
| 11 | +require_once("../../../../../config/dmsDefaults.php"); | |
| 12 | + | |
| 13 | +global $default; | |
| 14 | + | |
| 15 | +if(checkSession()) | |
| 16 | +{ | |
| 17 | + | |
| 18 | +// include the page template (with navbar) | |
| 19 | +require_once("$default->owl_fs_root/presentation/webPageTemplate.inc"); | |
| 20 | + | |
| 21 | + | |
| 22 | +$Center = "<br></br>\n" ; | |
| 23 | +$Center .= "<TABLE BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\">\n"; | |
| 24 | +$Center .= "<tr>\n"; | |
| 25 | +$Center .= "<td>Deletion Failed!</td>\n"; | |
| 26 | +$Center .= "</tr>\n"; | |
| 27 | +$Center .= "<tr></tr>\n"; | |
| 28 | +$Center .= "<tr><td>Please Ensure that The Group has been Removed from any Unit it belongs to</td></tr>\n"; | |
| 29 | +$Center .= "<tr></tr>\n"; | |
| 30 | +$Center .= "<tr></tr>\n"; | |
| 31 | +$Center .= "<tr>\n"; | |
| 32 | +$Center .= "<td align = right><a href=\"$default_owl_root_url/control.php?action=editGroup\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 33 | +$Center .= "</tr>\n"; | |
| 34 | +$Center .= "</table>\n"; | |
| 35 | + | |
| 36 | + | |
| 37 | +$oPatternCustom = & new PatternCustom(); | |
| 38 | +$oPatternCustom->setHtml($Center); | |
| 39 | +$main->setCentralPayload($oPatternCustom); | |
| 40 | +$main->render(); | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | +} | |
| 46 | + | |
| 47 | +?> | |
| 0 | 48 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/editGroupSuccess.php
0 โ 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information when updating group properties is successful | |
| 4 | +* | |
| 5 | +* @author Mukhtar Dharsey | |
| 6 | +* @date 5 February 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | + | |
| 11 | +require_once("../../../../../config/dmsDefaults.php"); | |
| 12 | + | |
| 13 | +global $default; | |
| 14 | + | |
| 15 | +if(checkSession()) | |
| 16 | +{ | |
| 17 | + | |
| 18 | +// include the page template (with navbar) | |
| 19 | +require_once("$default->owl_fs_root/presentation/webPageTemplate.inc"); | |
| 20 | + | |
| 21 | +$Center = "<br></br>\n" ; | |
| 22 | +$Center .= "<TABLE BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\">\n"; | |
| 23 | +$Center .= "<tr>\n"; | |
| 24 | +$Center .= "<td>Update SuccessFul!</td>\n"; | |
| 25 | +$Center .= "</tr>\n"; | |
| 26 | +$Center .= "<tr></tr>\n"; | |
| 27 | +$Center .= "<tr></tr>\n"; | |
| 28 | +$Center .= "<tr></tr>\n"; | |
| 29 | +$Center .= "<tr></tr>\n"; | |
| 30 | +$Center .= "<tr>\n"; | |
| 31 | +$Center .= "<td align = right><a href=\"$default_owl_root_url/control.php?action=editGroup\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 32 | +$Center .= "</tr>\n"; | |
| 33 | +$Center .= "</table>\n"; | |
| 34 | + | |
| 35 | + | |
| 36 | +$oPatternCustom = & new PatternCustom(); | |
| 37 | +$oPatternCustom->setHtml($Center); | |
| 38 | +$main->setCentralPayload($oPatternCustom); | |
| 39 | +$main->render(); | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | +} | |
| 45 | + | |
| 46 | +?> | |
| 0 | 47 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/editGroupUI.inc
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | $sQuery = "SELECT * FROM $default->owl_groups_table WHERE id = $iGroupID"; |
| 20 | 20 | $aDisplayColumns = array("name","is_sys_admin","is_unit_admin"); |
| 21 | 21 | $aStoreColumns = array("name","is_sys_admin","is_unit_admin"); |
| 22 | - $aColumnNames = array("Name","System admin", "Unit admin"); | |
| 22 | + $aColumnNames = array("Name:","System admin:", "Unit admin:"); | |
| 23 | 23 | $aDisplayColumnTypes = array(1,2,2); |
| 24 | 24 | $aDatabaseColumnTypes = array(1,2,2); |
| 25 | 25 | |
| ... | ... | @@ -35,9 +35,9 @@ |
| 35 | 35 | $sToRender .= "<td>" . $oPattern->render() . "</td>\n"; |
| 36 | 36 | $sToRender .= "</tr>\n"; |
| 37 | 37 | $sToRender .= "<tr>\n"; |
| 38 | + $sToRender .= "<td>Assign to a Unit:   " . getUnitDisplay() . "</td>\n"; | |
| 38 | 39 | $sToRender .= "</tr>\n"; |
| 39 | 40 | $sToRender .= "<tr>\n"; |
| 40 | - //$sToRender .="<input type=\"hidden\" name=\"fGroupName\" value=\"" . $oGroup->setName() . "\""; | |
| 41 | 41 | $sToRender .= "</tr>\n"; |
| 42 | 42 | |
| 43 | 43 | $sToRender .= "<td align = right><input type=\"image\" src =\"$default->owl_graphics_url/widgets/update.gif\" value=\"Update\" /></td>\n"; |
| ... | ... | @@ -56,27 +56,39 @@ function getEditPage($iGroupID) { |
| 56 | 56 | $oGroup = null; |
| 57 | 57 | if (isset($iGroupID)) { |
| 58 | 58 | $oGroup = Group::get($iGroupID); |
| 59 | + | |
| 59 | 60 | } |
| 60 | 61 | |
| 62 | + | |
| 61 | 63 | $sToRender .= "<br></br>\n"; |
| 62 | 64 | $sToRender .= "<b>Edit Group Properties:</b>\n"; |
| 63 | 65 | $sToRender .= "<table>\n"; |
| 64 | 66 | $sToRender .= "<br></br>\n"; |
| 65 | 67 | $sToRender .= "<tr></tr>\n"; |
| 66 | 68 | $sToRender .= "<tr>\n"; |
| 67 | - $sToRender .= "<td>" . getGroupDisplay($oGroup) . "</td>\n"; | |
| 68 | - $sToRender .= "</tr>\n"; | |
| 69 | - $sToRender .= "<tr>\n"; | |
| 70 | - $sToRender .= "<td>" . getUnitAdminCheckBox($oGroup) . "</td>\n"; | |
| 69 | + $sToRender .= "<td>Group Name: </td><td>" . getGroupDisplay($oGroup) . "</td>\n"; | |
| 71 | 70 | $sToRender .= "</tr>\n"; |
| 72 | 71 | $sToRender .= "<tr>\n"; |
| 73 | - $sToRender .= "<td>" . getSysAdminCheckBox($oGroup) . "</td>\n"; | |
| 74 | 72 | $sToRender .= "</tr>\n"; |
| 75 | 73 | $sToRender .= "<tr>\n"; |
| 74 | + | |
| 75 | + if (isset($iGroupID)) { | |
| 76 | + $sToRender .= "<td>Assign to Unit: </td><td>" . getUnitDisplay() . "</td>\n"; | |
| 77 | + $sToRender .= "</tr>\n"; | |
| 78 | + $sToRender .= "<tr>\n"; | |
| 79 | + $sToRender .= "<td>Unit Administrator: </td><td>" . getUnitAdminCheckBox($oGroup) . "</td>\n"; | |
| 80 | + $sToRender .= "</tr>\n"; | |
| 81 | + $sToRender .= "<tr>\n"; | |
| 82 | + $sToRender .= "<td>System Administrator: </td><td>" . getSysAdminCheckBox($oGroup) . "</td>\n"; | |
| 83 | + $sToRender .= "</tr>\n"; | |
| 84 | + $sToRender .= "<tr>\n"; | |
| 85 | + $sToRender .= "</tr>\n"; | |
| 86 | + } | |
| 87 | + | |
| 88 | + | |
| 76 | 89 | $sToRender .= "<tr>\n"; |
| 77 | 90 | $sToRender .= "</tr>\n"; |
| 78 | - $sToRender .= "</tr>\n"; | |
| 79 | - $sToRender .= getUpdateButton($oGroup); | |
| 91 | + $sToRender .= "<td></td>" . getUpdateButton($oGroup); | |
| 80 | 92 | $sToRender .= getCancelButton($oGroup); |
| 81 | 93 | $sToRender .= "</table>\n"; |
| 82 | 94 | |
| ... | ... | @@ -88,16 +100,25 @@ function getGroupDisplay($oGroup) { |
| 88 | 100 | global $default; |
| 89 | 101 | if (!isset($oGroup)) { |
| 90 | 102 | $oPatternListBox = & new PatternListBox($default->owl_groups_table, "name", "id", "fGroupID"); |
| 91 | - $oPatternListBox->setIncludeDefaultValue(true); | |
| 103 | + //$oPatternListBox->setIncludeDefaultValue(true); | |
| 92 | 104 | $oPatternListBox->setPostBackOnChange(true); |
| 93 | 105 | return $oPatternListBox->render(); |
| 94 | 106 | } else { |
| 95 | 107 | return "<input type=\"hidden\" name=\"fGroupID\" value=\"" . $oGroup->iId . "\">\n" . |
| 96 | - "<input type=\"text\" name=\"fGroupName\" value=\"" . $oGroup->getName() . "\""; | |
| 108 | + "<input size = \"40\" type=\"text\" name=\"fGroupName\" value=\"" . $oGroup->getName() . "\">"; | |
| 97 | 109 | } |
| 98 | 110 | |
| 99 | 111 | } |
| 100 | 112 | |
| 113 | +function getUnitDisplay() { | |
| 114 | + global $default; | |
| 115 | + $oPatternListBox = & new PatternListBox($default->owl_units_table, "name", "id", "fUnitID"); | |
| 116 | + return $oPatternListBox->render(); | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | +} | |
| 121 | + | |
| 101 | 122 | function getUnitAdminCheckBox($oGroup) { |
| 102 | 123 | if (!isset($oGroup)) { |
| 103 | 124 | return ""; |
| ... | ... | @@ -120,16 +141,16 @@ function getUpdateButton($oGroup) { |
| 120 | 141 | if (!isset($oGroup)) { |
| 121 | 142 | return "Please select a group"; |
| 122 | 143 | } else { |
| 123 | - return "<td align = right><input type=\"image\" src =\"$default->owl_graphics_url/widgets/update.gif\" value=\"update\" /></td>\n"; | |
| 144 | + return "<td align = right><input type=\"image\" src =\"$default->owl_graphics_url/widgets/update.gif\" value=\"submit\" /></td>\n"; | |
| 124 | 145 | } |
| 125 | 146 | } |
| 126 | 147 | |
| 127 | 148 | function getCancelButton($oGroup) { |
| 128 | 149 | global $default; |
| 129 | 150 | if (!isset($oGroup)) { |
| 130 | - return "<td align = right><a href=\"$default_owl_root_url/control.php?action=browse\"><img src =\"$default->owl_graphics_url/widgets/cancel.gif\" value=\"cancel\" /></a></td>\n"; | |
| 151 | + //return "<td align = right><a href=\"$default_owl_root_url/control.php?action=groupManagement\"><img src =\"$default->owl_graphics_url/widgets/cancel.gif\" value=\"cancel\" /></a></td>\n"; | |
| 131 | 152 | } else { |
| 132 | - return "<td align = right><a href=\"$default_owl_root_url/control.php?action=editGroup\"><img src =\"$default->owl_graphics_url/widgets/cancel.gif\" value=\"cancel\" /></a></td>\n"; | |
| 153 | + return "<td align = right><a href=\"$default_owl_root_url/control.php?action=editGroup\"><img src =\"$default->owl_graphics_url/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 133 | 154 | } |
| 134 | 155 | } |
| 135 | 156 | ?> |
| 136 | 157 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/removeGroupBL.php
0 โ 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* BL information for adding a group | |
| 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->owl_fs_root/lib/visualpatterns/PatternListBox.inc"); | |
| 14 | + require_once("$default->owl_fs_root/lib/visualpatterns/PatternEditableListFromQuery.inc"); | |
| 15 | + require_once("removeGroupUI.inc"); | |
| 16 | + require_once("$default->owl_fs_root/lib/security/permission.inc"); | |
| 17 | + require_once("$default->owl_fs_root/lib/groups/Group.inc"); | |
| 18 | + require_once("$default->owl_fs_root/presentation/webpageTemplate.inc"); | |
| 19 | + require_once("$default->owl_fs_root/lib/visualpatterns/PatternCustom.inc"); | |
| 20 | + require_once("$default->owl_fs_root/lib/foldermanagement/Folder.inc"); | |
| 21 | + require_once("$default->owl_fs_root/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | |
| 22 | + require_once("$default->owl_fs_root/presentation/Html.inc"); | |
| 23 | + | |
| 24 | + if (isset($fGroupID)) { | |
| 25 | + $oPatternCustom = & new PatternCustom(); | |
| 26 | + $oPatternCustom->setHtml(getDeletePage($fGroupID)); | |
| 27 | + $main->setCentralPayload($oPatternCustom); | |
| 28 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fForDelete=1"); | |
| 29 | + $main->render(); | |
| 30 | + | |
| 31 | + } else { | |
| 32 | + $oPatternCustom = & new PatternCustom(); | |
| 33 | + $oPatternCustom->setHtml(getDeletePage(null)); | |
| 34 | + $main->setCentralPayload($oPatternCustom); | |
| 35 | + $main->setFormAction($_SERVER["PHP_SELF"]); | |
| 36 | + $main->render(); | |
| 37 | + | |
| 38 | + } | |
| 39 | + | |
| 40 | + if (isset($fForDelete)) { | |
| 41 | + $oGroup = Group::get($fGroupID); | |
| 42 | + $oGroup->setName($fGroupName); | |
| 43 | + | |
| 44 | + if ($oGroup->delete()) { | |
| 45 | + redirect("$default->owl_root_url/control.php?action=removeGroupSuccess"); | |
| 46 | + } else { | |
| 47 | + redirect("$default->owl_root_url/control.php?action=removeGroupFail"); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} | |
| 51 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/removeGroupFail.php
0 โ 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information when updating froup properties fail | |
| 4 | +* | |
| 5 | +* @author Mukhtar Dharsey | |
| 6 | +* @date 5 February 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | + | |
| 11 | +require_once("../../../../../config/dmsDefaults.php"); | |
| 12 | + | |
| 13 | +global $default; | |
| 14 | + | |
| 15 | +if(checkSession()) | |
| 16 | +{ | |
| 17 | + | |
| 18 | +// include the page template (with navbar) | |
| 19 | +require_once("$default->owl_fs_root/presentation/webPageTemplate.inc"); | |
| 20 | + | |
| 21 | + | |
| 22 | +$Center = "<br></br>\n" ; | |
| 23 | +$Center .= "<TABLE BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\">\n"; | |
| 24 | +$Center .= "<tr>\n"; | |
| 25 | +$Center .= "<td>Deletion Failed!</td>\n"; | |
| 26 | +$Center .= "</tr>\n"; | |
| 27 | +$Center .= "<tr></tr>\n"; | |
| 28 | +$Center .= "<tr><td>Please Ensure that The Group has been Removed from any Unit it belongs to</td></tr>\n"; | |
| 29 | +$Center .= "<tr></tr>\n"; | |
| 30 | +$Center .= "<tr></tr>\n"; | |
| 31 | +$Center .= "<tr>\n"; | |
| 32 | +$Center .= "<td align = right><a href=\"$default_owl_root_url/control.php?action=removeGroup\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 33 | +$Center .= "</tr>\n"; | |
| 34 | +$Center .= "</table>\n"; | |
| 35 | + | |
| 36 | + | |
| 37 | +$oPatternCustom = & new PatternCustom(); | |
| 38 | +$oPatternCustom->setHtml($Center); | |
| 39 | +$main->setCentralPayload($oPatternCustom); | |
| 40 | +$main->render(); | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | +} | |
| 46 | + | |
| 47 | +?> | |
| 0 | 48 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/removeGroupSuccess.php
0 โ 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information when updating group properties is successful | |
| 4 | +* | |
| 5 | +* @author Mukhtar Dharsey | |
| 6 | +* @date 5 February 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | + | |
| 11 | +require_once("../../../../../config/dmsDefaults.php"); | |
| 12 | + | |
| 13 | +global $default; | |
| 14 | + | |
| 15 | +if(checkSession()) | |
| 16 | +{ | |
| 17 | + | |
| 18 | +// include the page template (with navbar) | |
| 19 | +require_once("$default->owl_fs_root/presentation/webPageTemplate.inc"); | |
| 20 | + | |
| 21 | +$Center = "<br></br>\n" ; | |
| 22 | +$Center .= "<TABLE BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\">\n"; | |
| 23 | +$Center .= "<tr>\n"; | |
| 24 | +$Center .= "<td>Group SuccessFully Removed!</td>\n"; | |
| 25 | +$Center .= "</tr>\n"; | |
| 26 | +$Center .= "<tr></tr>\n"; | |
| 27 | +$Center .= "<tr></tr>\n"; | |
| 28 | +$Center .= "<tr></tr>\n"; | |
| 29 | +$Center .= "<tr></tr>\n"; | |
| 30 | +$Center .= "<tr>\n"; | |
| 31 | +$Center .= "<td align = right><a href=\"$default_owl_root_url/control.php?action=removeGroup\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 32 | +$Center .= "</tr>\n"; | |
| 33 | +$Center .= "</table>\n"; | |
| 34 | + | |
| 35 | + | |
| 36 | +$oPatternCustom = & new PatternCustom(); | |
| 37 | +$oPatternCustom->setHtml($Center); | |
| 38 | +$main->setCentralPayload($oPatternCustom); | |
| 39 | +$main->render(); | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | +} | |
| 45 | + | |
| 46 | +?> | |
| 0 | 47 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/removeGroupUI.inc
0 โ 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | +* Presentation information for Deleting a group | |
| 5 | +* | |
| 6 | +* @author Mukhtar Dharsey | |
| 7 | +* @date 5 February 2003 | |
| 8 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 9 | +* | |
| 10 | +*/ | |
| 11 | + | |
| 12 | +function getDeletePage($iGroupID) { | |
| 13 | + global $default; | |
| 14 | + $oGroup = null; | |
| 15 | + if (isset($iGroupID)) { | |
| 16 | + $oGroup = Group::get($iGroupID); | |
| 17 | + $sToRender .= "<br></br>\n"; | |
| 18 | + $sToRender .= "<b>Are you sure you wish to Remove this Group?:</b>\n"; | |
| 19 | + } | |
| 20 | + else{ | |
| 21 | + $sToRender .= "<br></br>\n"; | |
| 22 | + $sToRender .= "<b>Remove Group From System:</b>\n"; | |
| 23 | + } | |
| 24 | + | |
| 25 | + $sToRender .= "<table>\n"; | |
| 26 | + $sToRender .= "<br></br>\n"; | |
| 27 | + $sToRender .= "<tr></tr>\n"; | |
| 28 | + $sToRender .= "<tr>\n"; | |
| 29 | + $sToRender .= "<td>" . getGroupDisplay($oGroup) . "</td>\n"; | |
| 30 | + $sToRender .= "</tr>\n"; | |
| 31 | + $sToRender .= "<tr>\n"; | |
| 32 | + $sToRender .= "</tr>\n"; | |
| 33 | + $sToRender .= "<tr>\n"; | |
| 34 | + $sToRender .= "<td>" . getUnitAdminCheckBox($oGroup) . "</td>\n"; | |
| 35 | + $sToRender .= "</tr>\n"; | |
| 36 | + $sToRender .= "<tr>\n"; | |
| 37 | + $sToRender .= "<td>" . getSysAdminCheckBox($oGroup) . "</td>\n"; | |
| 38 | + $sToRender .= "</tr>\n"; | |
| 39 | + $sToRender .= "<tr>\n"; | |
| 40 | + $sToRender .= "</tr>\n"; | |
| 41 | + $sToRender .= "<tr>\n"; | |
| 42 | + $sToRender .= "</tr>\n"; | |
| 43 | + $sToRender .= getDeleteButton($oGroup); | |
| 44 | + $sToRender .= "</table>\n"; | |
| 45 | + | |
| 46 | + | |
| 47 | + return $sToRender; | |
| 48 | +} | |
| 49 | + | |
| 50 | +function getGroupDisplay($oGroup) { | |
| 51 | + global $default; | |
| 52 | + if (!isset($oGroup)) { | |
| 53 | + $oPatternListBox = & new PatternListBox($default->owl_groups_table, "name", "id", "fGroupID"); | |
| 54 | + $oPatternListBox->setIncludeDefaultValue(true); | |
| 55 | + $oPatternListBox->setPostBackOnChange(true); | |
| 56 | + return $oPatternListBox->render(); | |
| 57 | + } else { | |
| 58 | + return "<input type=\"hidden\" name=\"fGroupID\" value=\"" . $oGroup->iId . "\">\n" . | |
| 59 | + "Group Name: <b>" . $oGroup->getName() . "</b>"; | |
| 60 | + } | |
| 61 | + | |
| 62 | +} | |
| 63 | + | |
| 64 | +function getUnitAdminCheckBox($oGroup) { | |
| 65 | + if (!isset($oGroup)) { | |
| 66 | + return ""; | |
| 67 | + } else { | |
| 68 | + return "Unit Administrator: <input type=\"checkbox\" name=\"fGroupUnitAdmin\" " . ($oGroup->getUnitAdmin() ? "CHECKED " : " ") . " />"; | |
| 69 | + } | |
| 70 | +} | |
| 71 | + | |
| 72 | +function getSysAdminCheckBox($oGroup) { | |
| 73 | + if (!isset($oGroup)) { | |
| 74 | + return ""; | |
| 75 | + } else { | |
| 76 | + return "System Administrator: <input type=\"checkbox\" name=\"fGroupSysAdmin\" " . ($oGroup->getSysAdmin() ? "CHECKED " : " ") . " />"; | |
| 77 | + } | |
| 78 | + | |
| 79 | +} | |
| 80 | + | |
| 81 | + | |
| 82 | +function getDeleteButton($oGroup) { | |
| 83 | + global $default; | |
| 84 | + if (!isset($oGroup)) { | |
| 85 | + return "Please select a group"; | |
| 86 | + } else { | |
| 87 | + return "<td align = right><input type=\"image\" src =\"$default->owl_graphics_url/widgets/Delete.gif\" value=\"submit\" /></td>\n". | |
| 88 | + "<td align = right><a href=\"$default_owl_root_url/control.php?action=removeGroup\"><img src =\"$default->owl_graphics_url/widgets/Cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 89 | + } | |
| 90 | +} | |
| 91 | +?> | ... | ... |