Commit ebc6bb957ce2d289e5f165c68f0eec7fd9062227
1 parent
7c032e3c
added headings
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1576 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
70 additions
and
94 deletions
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/editGroupBL.php
| ... | ... | @@ -10,70 +10,61 @@ |
| 10 | 10 | require_once("../../../../../config/dmsDefaults.php"); |
| 11 | 11 | |
| 12 | 12 | if (checkSession()) { |
| 13 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 14 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternEditableListFromQuery.inc"); | |
| 15 | - require_once("editGroupUI.inc"); | |
| 16 | - require_once("$default->fileSystemRoot/lib/security/permission.inc"); | |
| 17 | - require_once("$default->fileSystemRoot/lib/groups/Group.inc"); | |
| 18 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 19 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | |
| 20 | - require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | |
| 21 | - require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | |
| 22 | - require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 23 | - | |
| 24 | - | |
| 25 | - $oPatternCustom = & new PatternCustom(); | |
| 26 | - | |
| 27 | - // if a new group has been added | |
| 28 | - if (isset($fFromCreate)) { | |
| 29 | - | |
| 30 | - if($fGroupID == -1){ | |
| 31 | - $oPatternCustom->setHtml(getAddFailPage()); | |
| 32 | - }else{ | |
| 33 | - $oPatternCustom->setHtml(getCreatePage($fGroupID)); | |
| 34 | - } | |
| 35 | - | |
| 36 | - $main->setFormAction("$default->rootUrl/presentation/lookAndFeel/knowledgeTree/store.php?fReturnURL=" . urlencode("$default->rootUrl/control.php?action=editGroupSuccess")); | |
| 37 | - | |
| 38 | - // coming from manual edit page | |
| 39 | - } else if (isset($fForStore)) { | |
| 40 | - $oGroup = Group::get($fGroupID); | |
| 41 | - $oGroup->setName($fGroupName); | |
| 42 | - | |
| 43 | - //check if checkbox checked | |
| 44 | - if (isset($fGroupUnitAdmin)) { | |
| 45 | - $oGroup->setUnitAdmin(true); | |
| 46 | - } else { | |
| 47 | - $oGroup->setUnitAdmin(false); | |
| 48 | - } | |
| 49 | - //check if checkbox checked | |
| 50 | - if (isset($fGroupSysAdmin)) { | |
| 51 | - $oGroup->setSysAdmin(true); | |
| 52 | - } else { | |
| 53 | - $oGroup->setSysAdmin(false); | |
| 54 | - } | |
| 55 | - if ($oGroup->update()) { | |
| 56 | - // if successfull print out success message | |
| 57 | - $oPatternCustom->setHtml(getEditPageSuccess()); | |
| 58 | - | |
| 59 | - } else { | |
| 60 | - // if fail print out fail message | |
| 61 | - $oPatternCustom->setHtml(getEditPageFail()); | |
| 62 | - } | |
| 63 | - } else if (isset($fGroupID)){ | |
| 64 | - // post back on group select from manual edit page | |
| 65 | - $oPatternCustom->setHtml(getEditPage($fGroupID)); | |
| 66 | - $main->setFormAction($_SERVER["PHP_SELF"] . "?fForStore=1"); | |
| 67 | - | |
| 68 | - | |
| 69 | - } else { | |
| 70 | - // if nothing happens...just reload edit page | |
| 71 | - $oPatternCustom->setHtml(getEditPage(null)); | |
| 72 | - $main->setFormAction($_SERVER["PHP_SELF"]); | |
| 73 | - | |
| 74 | - } | |
| 75 | - //render the page | |
| 76 | - $main->setCentralPayload($oPatternCustom); | |
| 77 | - $main->render(); | |
| 13 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 14 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternEditableListFromQuery.inc"); | |
| 15 | + require_once("editGroupUI.inc"); | |
| 16 | + require_once("../adminUI.inc"); | |
| 17 | + require_once("$default->fileSystemRoot/lib/security/permission.inc"); | |
| 18 | + require_once("$default->fileSystemRoot/lib/groups/Group.inc"); | |
| 19 | + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | |
| 20 | + require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | |
| 21 | + require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | |
| 22 | + require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | |
| 23 | + require_once("$default->fileSystemRoot/presentation/Html.inc"); | |
| 24 | + | |
| 25 | + | |
| 26 | + $oPatternCustom = & new PatternCustom(); | |
| 27 | + | |
| 28 | + // if a new group has been added | |
| 29 | + if (isset($fFromCreate)) { | |
| 30 | + | |
| 31 | + if($fGroupID == -1) { | |
| 32 | + $oPatternCustom->setHtml(getAddFailPage()); | |
| 33 | + } else { | |
| 34 | + $oPatternCustom->setHtml(getCreatePage($fGroupID)); | |
| 35 | + } | |
| 36 | + | |
| 37 | + $main->setFormAction("$default->rootUrl/presentation/lookAndFeel/knowledgeTree/store.php?fReturnURL=" . urlencode("$default->rootUrl/control.php?action=editGroupSuccess")); | |
| 38 | + | |
| 39 | + // coming from manual edit page | |
| 40 | + } | |
| 41 | + else if (isset($fForStore)) { | |
| 42 | + $oGroup = Group::get($fGroupID); | |
| 43 | + $oGroup->setName($fGroupName); | |
| 44 | + | |
| 45 | + //check if checkbox checked | |
| 46 | + $oGroup->setUnitAdmin(isset($fGroupUnitAdmin)); | |
| 47 | + //check if checkbox checked | |
| 48 | + $oGroup->setSysAdmin(isset($fGroupSysAdmin)); | |
| 49 | + | |
| 50 | + if ($oGroup->update()) { | |
| 51 | + // if successfull print out success message | |
| 52 | + $oPatternCustom->setHtml(getEditPageSuccess()); | |
| 53 | + } else { | |
| 54 | + // if fail print out fail message | |
| 55 | + $oPatternCustom->setHtml(getEditPageFail()); | |
| 56 | + } | |
| 57 | + } else if (isset($fGroupID)) { | |
| 58 | + // post back on group select from manual edit page | |
| 59 | + $oPatternCustom->setHtml(getEditPage($fGroupID)); | |
| 60 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fForStore=1"); | |
| 61 | + } else { | |
| 62 | + // if nothing happens...just reload edit page | |
| 63 | + $oPatternCustom->setHtml(getEditPage(null)); | |
| 64 | + $main->setFormAction($_SERVER["PHP_SELF"]); | |
| 65 | + } | |
| 66 | + //render the page | |
| 67 | + $main->setCentralPayload($oPatternCustom); | |
| 68 | + $main->render(); | |
| 78 | 69 | } |
| 79 | 70 | ?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/editGroupUI.inc
| ... | ... | @@ -12,9 +12,6 @@ function getCreatePage($iGroupID) { |
| 12 | 12 | |
| 13 | 13 | global $default; |
| 14 | 14 | $oGroup = null; |
| 15 | - //if (isset($iGroupID)) { | |
| 16 | - // $oGroup = Group::get($iGroupID); | |
| 17 | - //} | |
| 18 | 15 | |
| 19 | 16 | $sQuery = "SELECT * FROM $default->owl_groups_table WHERE id = $iGroupID"; |
| 20 | 17 | $aDisplayColumns = array("name","is_sys_admin","is_unit_admin"); |
| ... | ... | @@ -24,32 +21,24 @@ function getCreatePage($iGroupID) { |
| 24 | 21 | $aDatabaseColumnTypes = array(1,2,2); |
| 25 | 22 | |
| 26 | 23 | // get list of group properties...name...text field...is_Sys_admin and is_unit_admin..checkboxes |
| 27 | - $oPattern = & new PatternEditableListFromQuery($sQuery, $default->owl_groups_table, $aDisplayColumns, $aStoreColumns, $aColumnNames, $aDisplayColumnTypes, $aDatabaseColumnTypes) ; | |
| 24 | + $oPattern = & new PatternEditableListFromQuery($sQuery, $default->owl_groups_table, $aDisplayColumns, $aStoreColumns, $aColumnNames, $aDisplayColumnTypes, $aDatabaseColumnTypes); | |
| 28 | 25 | $oPattern->setUniqueName("groupEdit"); |
| 29 | 26 | $oPattern->setColumnsRequired(array(1,0,0)); |
| 30 | 27 | |
| 31 | - $sToRender .= "<b>Edit Group Properties:</b>\n"; | |
| 28 | + $sToRender .= "<table width=\"600\">" . renderHeading("Edit Group Properties") . "</table>"; | |
| 32 | 29 | $sToRender .= "<table>\n"; |
| 33 | - $sToRender .= "<br></br>\n"; | |
| 34 | 30 | $sToRender .= "<tr></tr>\n"; |
| 35 | 31 | $sToRender .= "<tr>\n"; |
| 36 | 32 | $sToRender .= "<td>" . $oPattern->render() . "</td>\n"; |
| 37 | 33 | $sToRender .= "</tr>\n"; |
| 38 | 34 | $sToRender .= "<tr>\n"; |
| 39 | - //$sToRender .= "<td>Assign to a Unit:   " . getUnitDisplay() . "</td>\n"; | |
| 40 | 35 | $sToRender .= "</tr>\n"; |
| 41 | 36 | $sToRender .= "<tr>\n"; |
| 42 | 37 | $sToRender .= "</tr>\n"; |
| 43 | 38 | |
| 44 | - $sToRender .= "<td align = right><input type=\"image\" src =\"$default->graphicsUrl/widgets/update.gif\" value=\"Update\" border=\"0\"/></td>\n"; | |
| 39 | + $sToRender .= "<td align=\"right\"><input type=\"image\" src=\"$default->graphicsUrl/widgets/update.gif\" value=\"Update\" border=\"0\"/></td>\n"; | |
| 45 | 40 | $sToRender .= "</table>\n"; |
| 46 | - | |
| 47 | - | |
| 48 | - | |
| 49 | 41 | return $sToRender; |
| 50 | - | |
| 51 | - | |
| 52 | - | |
| 53 | 42 | } |
| 54 | 43 | |
| 55 | 44 | |
| ... | ... | @@ -57,10 +46,10 @@ function getCreatePage($iGroupID) { |
| 57 | 46 | function getAddFailPage() { |
| 58 | 47 | |
| 59 | 48 | global $default; |
| 60 | - | |
| 49 | + | |
| 50 | + $sToRender .= "<table width=\"600\">" . renderHeading("Edit Group Properties") . "</table>"; | |
| 61 | 51 | $sToRender .= "<table>\n"; |
| 62 | - $sToRender .= "<br></br>\n"; | |
| 63 | - $sToRender .= "<tr><b>Add Group Failed:</b></tr>\n"; | |
| 52 | + $sToRender .= "<tr><td><b>Add Group Failed:</b></td></tr>\n"; | |
| 64 | 53 | $sToRender .= "<tr>\n"; |
| 65 | 54 | $sToRender .= "<td>Sorry, Group Already Exists!</td>\n"; |
| 66 | 55 | $sToRender .= "</tr>\n"; |
| ... | ... | @@ -84,11 +73,8 @@ function getEditPage($iGroupID) { |
| 84 | 73 | |
| 85 | 74 | } |
| 86 | 75 | |
| 87 | - | |
| 88 | - $sToRender .= "<br></br>\n"; | |
| 89 | - $sToRender .= "<b>Edit Group Properties:</b>\n"; | |
| 76 | + $sToRender .= "<table width=\"600\">" . renderHeading("Edit Group Properties") . "</table>"; | |
| 90 | 77 | $sToRender .= "<table>\n"; |
| 91 | - $sToRender .= "<br></br>\n"; | |
| 92 | 78 | $sToRender .= "<tr></tr>\n"; |
| 93 | 79 | $sToRender .= "<tr>\n"; |
| 94 | 80 | $sToRender .= "<td>Group Name: </td><td>" . getGroupDisplay($oGroup) . "</td>\n"; |
| ... | ... | @@ -125,10 +111,9 @@ function getEditPage($iGroupID) { |
| 125 | 111 | function getEditPageSuccess() { |
| 126 | 112 | global $default; |
| 127 | 113 | |
| 128 | - $sToRender .= "<br></br>\n"; | |
| 129 | - $sToRender .= "<b>Success!</b>\n"; | |
| 114 | + $sToRender .= "<table width=\"600\">" . renderHeading("Edit Group Properties") . "</table>"; | |
| 130 | 115 | $sToRender .= "<table>\n"; |
| 131 | - $sToRender .= "<br></br>\n"; | |
| 116 | + $sToRender .= "<tr><td><b>Success!</b></td></tr>\n"; | |
| 132 | 117 | $sToRender .= "<tr></tr>\n"; |
| 133 | 118 | $sToRender .= "<tr><td>The Group was successfully modified</td></tr>\n"; |
| 134 | 119 | $sToRender .= "<tr></tr>\n"; |
| ... | ... | @@ -147,10 +132,10 @@ function getEditPageSuccess() { |
| 147 | 132 | function getEditPageFail() { |
| 148 | 133 | global $default; |
| 149 | 134 | |
| 150 | - $sToRender .= "<br></br>\n"; | |
| 151 | - $sToRender .= "<b>Success!</b>\n"; | |
| 135 | + $sToRender .= "<table width=\"600\">" . renderHeading("Edit Group Properties") . "</table>"; | |
| 136 | + | |
| 152 | 137 | $sToRender .= "<table>\n"; |
| 153 | - $sToRender .= "<br></br>\n"; | |
| 138 | + $sToRender .= "<tr><td><b>Failure!</b></td></tr>\n"; | |
| 154 | 139 | $sToRender .= "<tr></tr>\n"; |
| 155 | 140 | $sToRender .= "<tr><td>The Group modification Failed!</td></tr>\n"; |
| 156 | 141 | $sToRender .= "<tr></tr>\n"; |
| ... | ... | @@ -230,9 +215,9 @@ function getUpdateButton($oGroup) { |
| 230 | 215 | function getCancelButton($oGroup) { |
| 231 | 216 | global $default; |
| 232 | 217 | if (!isset($oGroup)) { |
| 233 | - //return "<td align = right><a href=\"$default->rootUrl/control.php?action=groupManagement\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" value=\"cancel\" /></a></td>\n"; | |
| 218 | + return "<td align = right><a href=\"$default->rootUrl/control.php?action=groupManagement\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" value=\"cancel\" border=\"0\"/></a></td>\n"; | |
| 234 | 219 | } else { |
| 235 | - return "<td align = right><a href=\"$default->rootUrl/control.php?action=editGroup\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 220 | + return "<td align = right><a href=\"$default->rootUrl/control.php?action=editGroup\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"/></a></td>\n"; | |
| 236 | 221 | } |
| 237 | 222 | } |
| 238 | 223 | ?> |
| 239 | 224 | \ No newline at end of file | ... | ... |