Commit 22f78aad40ea9ac139d0f7a20f13848263a76e86
1 parent
a9d8be65
no message
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@973 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
18 changed files
with
1296 additions
and
8 deletions
config/dmsDefaults.php
| ... | ... | @@ -109,7 +109,7 @@ $default->owl_system_settings_table = "system_settings"; |
| 109 | 109 | // Table with unit information |
| 110 | 110 | $default->owl_units_table = "units_lookup"; |
| 111 | 111 | // Table with unit organisation link tables |
| 112 | -$default->owl_units_organisations_link_table = "units_organisations_link"; | |
| 112 | +$default->owl_units_organisations_table = "units_organisations_link"; | |
| 113 | 113 | // Table with user info |
| 114 | 114 | $default->owl_users_table = "users"; |
| 115 | 115 | // links groups to users |
| ... | ... | @@ -183,8 +183,8 @@ $default->siteMap->addPage("deleteFolderCollaboration", "/presentation/lookAndFe |
| 183 | 183 | $default->siteMap->addDefaultPage("administration", "/admin.php", "Administration", UnitAdmin, "Administration"); |
| 184 | 184 | $default->siteMap->addPage("userManagement", "/admin.php?sectionName=UserAdministration", "Administration", UnitAdmin, "User Management"); |
| 185 | 185 | $default->siteMap->addPage("groupManagement", "/admin.php?sectionName=groupAdministration", "Administration", UnitAdmin, "Group Management"); |
| 186 | -$default->siteMap->addPage("unitManagement", "/admin.php?sectionName=SystemAdministration", "Administration", SysAdmin, "Unit Management"); | |
| 187 | -$default->siteMap->addPage("orgManagement", "/admin.php?sectionName=SystemAdministration", "Administration", SysAdmin, "Organisation Management"); | |
| 186 | +$default->siteMap->addPage("unitManagement", "/admin.php?sectionName=unitAdministration", "Administration", SysAdmin, "Unit Management"); | |
| 187 | +$default->siteMap->addPage("orgManagement", "/admin.php?sectionName=orgAdministration", "Administration", SysAdmin, "Organisation Management"); | |
| 188 | 188 | $default->siteMap->addPage("roleManagement", "/admin.php?sectionName=SystemAdministration", "Administration", SysAdmin, "Role Management"); |
| 189 | 189 | $default->siteMap->addPage("systemAdministration", "/presentation/admin.php?sectionName=SystemAdministration", "Administration", SysAdmin, "System Settings"); |
| 190 | 190 | |
| ... | ... | @@ -198,6 +198,20 @@ $default->siteMap->addPage("removeGroup", "/presentation/lookAndFeel/knowledgeTr |
| 198 | 198 | $default->siteMap->addPage("assignGroupToUnit", "/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/assignGroupToUnitBL.php", "groupAdministration", UnitAdmin, "Assign Group to Unit"); |
| 199 | 199 | $default->siteMap->addPage("removeGroupFromUnit", "/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/removeGroupFromUnitBL.php", "groupAdministration", UnitAdmin, "Remove Group From Unit"); |
| 200 | 200 | |
| 201 | +//Unit management | |
| 202 | +$default->siteMap->addPage("addUnit", "/presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/addUnitBL.php", "unitAdministration", SysAdmin, "Add A Unit"); | |
| 203 | +$default->siteMap->addPage("editUnit", "/presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/editUnitBL.php", "unitAdministration", SysAdmin, "Edit Unit Properties"); | |
| 204 | +$default->siteMap->addPage("addUnitSuccess", "/presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/addUnitSuccess.php", "unitAdministration", SysAdmin, "Unit added Successfully",false); | |
| 205 | +$default->siteMap->addPage("removeUnit", "/presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/removeUnitBL.php", "unitAdministration", SysAdmin, "Remove a Unit"); | |
| 206 | +//$default->siteMap->addPage("assignGroupToUnit", "/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/assignGroupToUnitBL.php", "groupAdministration", UnitAdmin, "Assign Group to Unit"); | |
| 207 | +//$default->siteMap->addPage("removeGroupFromUnit", "/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/removeGroupFromUnitBL.php", "groupAdministration", UnitAdmin, "Remove Group From Unit"); | |
| 208 | + | |
| 209 | +//Organisation management | |
| 210 | +$default->siteMap->addPage("addOrg", "/presentation/lookAndFeel/knowledgeTree/administration/orgmanagement/addOrgBL.php", "orgAdministration", SysAdmin, "Add An Organisation"); | |
| 211 | +$default->siteMap->addPage("editOrg", "/presentation/lookAndFeel/knowledgeTree/administration/orgmanagement/editOrgBL.php", "orgAdministration", SysAdmin, "Edit Organisation Properties"); | |
| 212 | +$default->siteMap->addPage("addOrgSuccess", "/presentation/lookAndFeel/knowledgeTree/administration/orgmanagement/addOrgSuccess.php", "orgAdministration", SysAdmin, "Organisation added Successfully",false); | |
| 213 | +$default->siteMap->addPage("removeOrg", "/presentation/lookAndFeel/knowledgeTree/administration/orgmanagement/removeOrgBL.php", "orgAdministration", SysAdmin, "Remove an Organisation"); | |
| 214 | + | |
| 201 | 215 | //user management |
| 202 | 216 | $default->siteMap->addPage("addUser", "/tests/groups/adduser.php", "UserAdministration", UnitAdmin, "Add User to System"); |
| 203 | 217 | $default->siteMap->addPage("editUser", "/tests/groups/adduser.php", "UserAdministration", UnitAdmin, "Edit User Properties"); | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/editGroupUI.inc
| ... | ... | @@ -58,7 +58,6 @@ function getAddFailPage() { |
| 58 | 58 | |
| 59 | 59 | global $default; |
| 60 | 60 | |
| 61 | - | |
| 62 | 61 | $sToRender .= "<table>\n"; |
| 63 | 62 | $sToRender .= "<br></br>\n"; |
| 64 | 63 | $sToRender .= "<tr><b>Add Group Failed:</b></tr>\n"; |
| ... | ... | @@ -72,11 +71,8 @@ function getAddFailPage() { |
| 72 | 71 | $sToRender .= "</tr>\n"; |
| 73 | 72 | $sToRender .= "</table>\n"; |
| 74 | 73 | |
| 75 | - | |
| 76 | 74 | return $sToRender; |
| 77 | 75 | |
| 78 | - | |
| 79 | - | |
| 80 | 76 | } |
| 81 | 77 | |
| 82 | 78 | // if its the manual edit page..then display normally | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/removeGroupFromUnitBL.php
| ... | ... | @@ -12,7 +12,7 @@ require_once("../../../../../config/dmsDefaults.php"); |
| 12 | 12 | if (checkSession()) { |
| 13 | 13 | require_once("$default->owl_fs_root/lib/visualpatterns/PatternListBox.inc"); |
| 14 | 14 | require_once("$default->owl_fs_root/lib/visualpatterns/PatternCreate.inc"); |
| 15 | - require_once("removeGroupFromUnit.inc"); | |
| 15 | + require_once("removeGroupFromUnitUI.inc"); | |
| 16 | 16 | require_once("$default->owl_fs_root/lib/unitmanagement/Unit.inc"); |
| 17 | 17 | require_once("$default->owl_fs_root/lib/groups/Group.inc"); |
| 18 | 18 | require_once("$default->owl_fs_root/lib/groups/GroupUnitLink.inc"); | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/removeGroupFromUnitUI.inc
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information for adding a group | |
| 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($iGroupID, $iUnitID) { | |
| 13 | + global $default; | |
| 14 | + $oGroup = null; | |
| 15 | + $oUnit = null; | |
| 16 | + | |
| 17 | + // change headings if group selected | |
| 18 | + if (isset($iGroupID)) { | |
| 19 | + $oGroup = Group::get($iGroupID); | |
| 20 | + $heading = "<tr><td>Are you sure you wish to remove the Group from the Unit?</td> </tr>\n"; | |
| 21 | + }else{ | |
| 22 | + $heading = "<tr>Please select a Group: </tr>\n"; | |
| 23 | + } | |
| 24 | + | |
| 25 | + // when unitid is gotten show the name | |
| 26 | + if (isset($iUnitID)) { | |
| 27 | + $oUnit = Unit::get($iUnitID); | |
| 28 | + $unitdisplay = "<td>Unit Name: " . getUnitDisplay($oUnit) . "</td>\n"; | |
| 29 | + | |
| 30 | + } | |
| 31 | + else{ | |
| 32 | + $unitdisplay = ""; | |
| 33 | + } | |
| 34 | + | |
| 35 | + $sToRender .= "<br></br>\n"; | |
| 36 | + $sToRender .= "<b>Select a Group to Remove from its Unit:</b>\n"; | |
| 37 | + $sToRender .= "<table>\n"; | |
| 38 | + $sToRender .= "<br></br>\n"; | |
| 39 | + $sToRender .= $heading; | |
| 40 | + $sToRender .= "<br>\n"; | |
| 41 | + $sToRender .= "<tr>\n"; | |
| 42 | + $sToRender .= "</tr>\n"; | |
| 43 | + $sToRender .= "<td>Group Name: " . getGroupDisplay($oGroup) . "</td>\n"; | |
| 44 | + $sToRender .= "<tr>\n"; | |
| 45 | + $sToRender .= "</tr>\n"; | |
| 46 | + $sToRender .= "<tr>\n"; | |
| 47 | + $sToRender .= $unitdisplay; | |
| 48 | + $sToRender .= "</tr>\n"; | |
| 49 | + $sToRender .= "<tr>\n"; | |
| 50 | + $sToRender .= "</tr>\n"; | |
| 51 | + $sToRender .= "<tr>\n"; | |
| 52 | + $sToRender .= "</tr>\n"; | |
| 53 | + $sToRender .= "<td></td><td>" . getDeleteButton($oGroup); | |
| 54 | + $sToRender .= "<td></td><td>" . getCancelButton($oGroup); | |
| 55 | + $sToRender .= "</td></table>\n"; | |
| 56 | + | |
| 57 | + | |
| 58 | + return $sToRender; | |
| 59 | +} | |
| 60 | + | |
| 61 | +// show paig if deletion fails | |
| 62 | +function getPageFail($iGroupID) { | |
| 63 | + global $default; | |
| 64 | + $oGroup = null; | |
| 65 | + $oUnit = null; | |
| 66 | + | |
| 67 | + if (isset($iGroupID)) { | |
| 68 | + $oGroup = Group::get($iGroupID); | |
| 69 | + } | |
| 70 | + | |
| 71 | + $iUnitID = GroupUnitLink::groupBelongsToUnit($iGroupID); | |
| 72 | + | |
| 73 | + $oUnit= Unit::get($iUnitID); | |
| 74 | + | |
| 75 | + $sToRender .= "<br></br>\n"; | |
| 76 | + $sToRender .= "<b>Sorry, Removal Failed</b>\n"; | |
| 77 | + $sToRender .= "<table>\n"; | |
| 78 | + $sToRender .= "<br></br>\n"; | |
| 79 | + $sToRender .= "<tr></tr>\n"; | |
| 80 | + $sToRender .= "</tr>\n"; | |
| 81 | + $sToRender .= "<tr>\n"; | |
| 82 | + $sToRender .= "</tr>\n"; | |
| 83 | + $sToRender .= "<tr>\n"; | |
| 84 | + $sToRender .= "<td></td><td align = right><a href=\"$default_owl_root_url/control.php?action=removeGroupFromUnit\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 85 | + $sToRender .= "</tr>\n"; | |
| 86 | + | |
| 87 | + $sToRender .= "</table>\n"; | |
| 88 | + | |
| 89 | + | |
| 90 | + return $sToRender; | |
| 91 | +} | |
| 92 | +// if no group selected show selection fail page | |
| 93 | +function getPageNotSelected() { | |
| 94 | + global $default; | |
| 95 | + | |
| 96 | + $sToRender .= "<br></br>\n"; | |
| 97 | + $sToRender .= "<b>Sorry, Selection Failed</b>\n"; | |
| 98 | + $sToRender .= "<table>\n"; | |
| 99 | + $sToRender .= "<br></br>\n"; | |
| 100 | + $sToRender .= "<tr></tr>\n"; | |
| 101 | + $sToRender .= "<tr><td>Please select a Group</td></tr>\n"; | |
| 102 | + $sToRender .= "<tr></tr>\n"; | |
| 103 | + $sToRender .= "<tr></tr>\n"; | |
| 104 | + $sToRender .= "<tr>\n"; | |
| 105 | + $sToRender .= "<td></td><td align = right><a href=\"$default_owl_root_url/control.php?action=removeGroupFromUnit\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 106 | + $sToRender .= "</tr>\n"; | |
| 107 | + $sToRender .= "</table>\n"; | |
| 108 | + | |
| 109 | + | |
| 110 | + return $sToRender; | |
| 111 | +} | |
| 112 | +// show success page if removed from unit successfully | |
| 113 | +function getPageSuccess() { | |
| 114 | + global $default; | |
| 115 | + | |
| 116 | + $sToRender .= "<br></br>\n"; | |
| 117 | + $sToRender .= "<b>Success!</b>\n"; | |
| 118 | + $sToRender .= "<table>\n"; | |
| 119 | + $sToRender .= "<br></br>\n"; | |
| 120 | + $sToRender .= "<tr></tr>\n"; | |
| 121 | + $sToRender .= "<tr><td>The Group was successfully removed from the Unit</td></tr>\n"; | |
| 122 | + $sToRender .= "<tr></tr>\n"; | |
| 123 | + $sToRender .= "<tr></tr>\n"; | |
| 124 | + $sToRender .= "<tr>\n"; | |
| 125 | + $sToRender .= "<td></td><td align = right><a href=\"$default_owl_root_url/control.php?action=removeGroupFromUnit\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 126 | + $sToRender .= "</tr>\n"; | |
| 127 | + $sToRender .= "</table>\n"; | |
| 128 | + | |
| 129 | + | |
| 130 | + return $sToRender; | |
| 131 | +} | |
| 132 | +// show listbox of groups belonging to groups_units_link table | |
| 133 | +function getGroupDisplay($oGroup) { | |
| 134 | + global $default; | |
| 135 | + // added clauses to get those groups belonging to the groups_units_link table | |
| 136 | + $from = "," . $default->owl_groups_units_table . " AS GU"; | |
| 137 | + $where = "(ST.id = GU.group_id)"; | |
| 138 | + | |
| 139 | + | |
| 140 | + if (!isset($oGroup)) { | |
| 141 | + $oPatternListBox = & new PatternListBox($default->owl_groups_table, "name", "id", "fGroupID"); | |
| 142 | + $oPatternListBox->setWhereClause($where); | |
| 143 | + $oPatternListBox->setFromClause($from); | |
| 144 | + //$oPatternListBox->setIncludeDefaultValue(true); | |
| 145 | + //$oPatternListBox->setPostBackOnChange(true); | |
| 146 | + return $oPatternListBox->render(); | |
| 147 | + } else { | |
| 148 | + return "<input type=\"hidden\" name=\"fGroupID\" value=\"" . $oGroup->iId . "\">\n" . | |
| 149 | + $oGroup->getName(); | |
| 150 | + } | |
| 151 | + | |
| 152 | +} | |
| 153 | + | |
| 154 | +// show unit details on confirm deletion page | |
| 155 | +function getUnitDisplay($oUnit) { | |
| 156 | + global $default; | |
| 157 | + if (!isset($oUnit)) { | |
| 158 | + //$oPatternListBox = & new PatternListBox($default->owl_units_table, "name", "id", "fUnitID"); | |
| 159 | + //$oPatternLiListBoxstBox->setPostBackOnChange(true); | |
| 160 | + //return $oPatternListBox->render(); | |
| 161 | + } else { | |
| 162 | + return "<input type=\"hidden\" name=\"fUnitID\" value=\"" . $oUnit->iId . "\">\n" . | |
| 163 | + $oUnit->getName(); | |
| 164 | + } | |
| 165 | + | |
| 166 | +} | |
| 167 | + | |
| 168 | +// show delete button or select button | |
| 169 | +function getDeleteButton($oGroup) { | |
| 170 | + global $default; | |
| 171 | + if (!isset($oGroup)) { | |
| 172 | + return "<td align = right><input type=\"image\" src =\"$default->owl_graphics_url/widgets/select.gif\" value=\"submit\" /></td>\n"; | |
| 173 | + } else { | |
| 174 | + return "<td align = right><input type=\"image\" src =\"$default->owl_graphics_url/widgets/delete.gif\" value=\"submit\" /></td>\n"; | |
| 175 | + } | |
| 176 | +} | |
| 177 | + | |
| 178 | +// show cancel button | |
| 179 | +function getCancelButton($oGroup) { | |
| 180 | + global $default; | |
| 181 | + if (!isset($oGroup)) { | |
| 182 | + //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"; | |
| 183 | + } else { | |
| 184 | + return "<td align = right><a href=\"$default_owl_root_url/control.php?action=removeGroupFromUnit\"><img src =\"$default->owl_graphics_url/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 185 | + } | |
| 186 | +} | |
| 187 | + | |
| 188 | + | |
| 189 | +?> | |
| 0 | 190 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/orgmanagement/addOrgBL.php
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* BL information for adding a Org | |
| 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/PatternCreate.inc"); | |
| 15 | + require_once("addOrgUI.inc"); | |
| 16 | + require_once("$default->owl_fs_root/lib/unitmanagement/UnitOrganisationLink.inc"); | |
| 17 | + require_once("$default->owl_fs_root/lib/security/permission.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 | + $oPatternCustom = & new PatternCustom(); | |
| 25 | + $oPatternCustom->setHtml(getPage()); | |
| 26 | + $main->setCentralPayload($oPatternCustom); | |
| 27 | + $main->setFormAction("$default->owl_root_url/presentation/lookAndFeel/knowledgeTree/create.php?fRedirectURL=".urlencode("$default->owl_root_url/control.php?action=addOrgSuccess&fedit=1")); | |
| 28 | + $main->render(); | |
| 29 | +} | |
| 30 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/orgmanagement/addOrgSuccess.php
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information when adding a Org 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>Organisation added Successfully!</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=addOrg\"><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/orgmanagement/addOrgUI.inc
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information for adding a Org | |
| 4 | +* | |
| 5 | +* @author Mukhtar Dharsey | |
| 6 | +* @date 5 February 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | +// get add pages | |
| 11 | +function getPage() { | |
| 12 | + | |
| 13 | + global $default; | |
| 14 | + $aDisplayRowNames = array("Organisation Name:"); | |
| 15 | + $aParameterNumbers = array(0); | |
| 16 | + $aDisplayColumnTypes = array(1); | |
| 17 | + $aRequired = array(1); | |
| 18 | + //$aDropDownListTableNames = array(10=>"document_types_lookup"); | |
| 19 | + | |
| 20 | + // create a text field that is required | |
| 21 | + $oPatternCreate = & new PatternCreate("Organisation", "Orgmanagement\\Organisation.inc",$aDisplayRowNames, $aParameterNumbers, $aDisplayColumnTypes, $aRequired); | |
| 22 | + $oPatternCreate->setUniqueName("organisation"); | |
| 23 | + | |
| 24 | + $sToRender .= "<br></br>\n"; | |
| 25 | + $sToRender .= "<b>Add a New Organisation to the System:</b>\n"; | |
| 26 | + $sToRender .= "<table>\n"; | |
| 27 | + $sToRender .= "<br></br>\n"; | |
| 28 | + $sToRender .= "<tr></tr>\n"; | |
| 29 | + $sToRender .= "<tr>\n"; | |
| 30 | + $sToRender .= "<td>" . $oPatternCreate->render() . "</td>\n"; | |
| 31 | + $sToRender .= "</tr>\n"; | |
| 32 | + $sToRender .= "<tr>\n"; | |
| 33 | + $sToRender .= "</tr>\n"; | |
| 34 | + $sToRender .= "<tr>\n"; | |
| 35 | + $sToRender .= "</tr>\n"; | |
| 36 | + $sToRender .= "<td align = right><input type=\"image\" src =\"$default->owl_graphics_url/widgets/add.gif\" value=\"Submit\" /></td>\n"; | |
| 37 | + $sToRender .= "</table>\n"; | |
| 38 | + | |
| 39 | + return $sToRender; | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | +} | |
| 44 | +?> | |
| 0 | 45 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/orgmanagement/editOrgBL.php
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* BL information for editing a Org | |
| 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("editOrgUI.inc"); | |
| 16 | + require_once("$default->owl_fs_root/lib/security/permission.inc"); | |
| 17 | + require_once("$default->owl_fs_root/lib/Orgmanagement/Organisation.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 | + | |
| 25 | + $oPatternCustom = & new PatternCustom(); | |
| 26 | + | |
| 27 | + // if a new Org has been added | |
| 28 | + // coming from manual edit page | |
| 29 | + if (isset($fForStore)) { | |
| 30 | + $oOrg = Organisation::get($fOrgID); | |
| 31 | + $oOrg->setName($fOrgName); | |
| 32 | + | |
| 33 | + if ($oOrg->update()) { | |
| 34 | + // if successfull print out success message | |
| 35 | + $oPatternCustom->setHtml(getEditPageSuccess()); | |
| 36 | + | |
| 37 | + } else { | |
| 38 | + // if fail print out fail message | |
| 39 | + $oPatternCustom->setHtml(getEditPageFail()); | |
| 40 | + } | |
| 41 | + } else if (isset($fOrgID)){ | |
| 42 | + // post back on Org select from manual edit page | |
| 43 | + $oPatternCustom->setHtml(getEditPage($fOrgID)); | |
| 44 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fForStore=1"); | |
| 45 | + | |
| 46 | + | |
| 47 | + } else { | |
| 48 | + // if nothing happens...just reload edit page | |
| 49 | + $oPatternCustom->setHtml(getEditPage(null)); | |
| 50 | + $main->setFormAction($_SERVER["PHP_SELF"]); | |
| 51 | + | |
| 52 | + } | |
| 53 | + //render the page | |
| 54 | + $main->setCentralPayload($oPatternCustom); | |
| 55 | + $main->render(); | |
| 56 | +} | |
| 57 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/orgmanagement/editOrgUI.inc
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information for renaming a Org | |
| 4 | +* | |
| 5 | +* @author Mukhtar Dharsey | |
| 6 | +* @date 5 February 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | + | |
| 11 | +// if its the manual edit page..then display normally | |
| 12 | +function getEditPage($iOrgID) { | |
| 13 | + global $default; | |
| 14 | + $oOrg = null; | |
| 15 | + if (isset($iOrgID)) { | |
| 16 | + $oOrg = Organisation::get($iOrgID); | |
| 17 | + | |
| 18 | + } | |
| 19 | + | |
| 20 | + $sToRender .= "<br></br>\n"; | |
| 21 | + $sToRender .= "<b>Edit Organisation Properties:</b>\n"; | |
| 22 | + $sToRender .= "<table>\n"; | |
| 23 | + $sToRender .= "<br></br>\n"; | |
| 24 | + $sToRender .= "<tr></tr>\n"; | |
| 25 | + $sToRender .= "<tr>\n"; | |
| 26 | + $sToRender .= "<td>Organisation Name: </td><td>" . getOrgDisplay($oOrg) . "</td>\n"; | |
| 27 | + $sToRender .= "</tr>\n"; | |
| 28 | + $sToRender .= "<tr>\n"; | |
| 29 | + $sToRender .= "</tr>\n"; | |
| 30 | + $sToRender .= "<tr>\n"; | |
| 31 | + $sToRender .= "<tr>\n"; | |
| 32 | + $sToRender .= "</tr>\n"; | |
| 33 | + $sToRender .= "<td></td>" . getUpdateButton($oOrg); | |
| 34 | + $sToRender .= getCancelButton($oOrg); | |
| 35 | + $sToRender .= "</table>\n"; | |
| 36 | + | |
| 37 | + | |
| 38 | + return $sToRender; | |
| 39 | +} | |
| 40 | + | |
| 41 | +// if edition is successful print otu success page | |
| 42 | +function getEditPageSuccess() { | |
| 43 | + global $default; | |
| 44 | + | |
| 45 | + $sToRender .= "<br></br>\n"; | |
| 46 | + $sToRender .= "<b>Success!</b>\n"; | |
| 47 | + $sToRender .= "<table>\n"; | |
| 48 | + $sToRender .= "<br></br>\n"; | |
| 49 | + $sToRender .= "<tr></tr>\n"; | |
| 50 | + $sToRender .= "<tr><td>The Organisation was successfully modified</td></tr>\n"; | |
| 51 | + $sToRender .= "<tr></tr>\n"; | |
| 52 | + $sToRender .= "<tr></tr>\n"; | |
| 53 | + $sToRender .= "<tr>\n"; | |
| 54 | + $sToRender .= "<td></td><td align = right><a href=\"$default_owl_root_url/control.php?action=editOrg\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 55 | + $sToRender .= "</tr>\n"; | |
| 56 | + $sToRender .= "</table>\n"; | |
| 57 | + | |
| 58 | + | |
| 59 | + return $sToRender; | |
| 60 | +} | |
| 61 | + | |
| 62 | + | |
| 63 | +// gets the page if edition fails | |
| 64 | +function getEditPageFail() { | |
| 65 | + global $default; | |
| 66 | + | |
| 67 | + $sToRender .= "<br></br>\n"; | |
| 68 | + $sToRender .= "<b>Success!</b>\n"; | |
| 69 | + $sToRender .= "<table>\n"; | |
| 70 | + $sToRender .= "<br></br>\n"; | |
| 71 | + $sToRender .= "<tr></tr>\n"; | |
| 72 | + $sToRender .= "<tr><td>Organisation modification Failed!</td></tr>\n"; | |
| 73 | + $sToRender .= "<tr></tr>\n"; | |
| 74 | + $sToRender .= "<tr></tr>\n"; | |
| 75 | + $sToRender .= "<tr>\n"; | |
| 76 | + $sToRender .= "<td></td><td align = right><a href=\"$default_owl_root_url/control.php?action=editOrg\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 77 | + $sToRender .= "</tr>\n"; | |
| 78 | + $sToRender .= "</table>\n"; | |
| 79 | + | |
| 80 | + | |
| 81 | + return $sToRender; | |
| 82 | +} | |
| 83 | + | |
| 84 | +// show the list box when no Org selected | |
| 85 | +// then shows a text box with the Org's name | |
| 86 | +function getOrgDisplay($oOrg) { | |
| 87 | + global $default; | |
| 88 | + if (!isset($oOrg)) { | |
| 89 | + $oPatternListBox = & new PatternListBox($default->owl_organisations_table, "name", "id", "fOrgID"); | |
| 90 | + //$oPatternListBox->setIncludeDefaultValue(true); | |
| 91 | + $oPatternListBox->setPostBackOnChange(true); | |
| 92 | + return $oPatternListBox->render(); | |
| 93 | + } else { | |
| 94 | + return "<input type=\"hidden\" name=\"fOrgID\" value=\"" . $oOrg->iId . "\">\n" . | |
| 95 | + "<input size = \"40\" type=\"text\" name=\"fOrgName\" value=\"" . $oOrg->getName() . "\">"; | |
| 96 | + } | |
| 97 | + | |
| 98 | +} | |
| 99 | + | |
| 100 | + | |
| 101 | +// gets the updatebutton when a Org is selected | |
| 102 | +function getUpdateButton($oOrg) { | |
| 103 | + global $default; | |
| 104 | + if (!isset($oOrg)) { | |
| 105 | + return "Please select a Organisation: "; | |
| 106 | + } else { | |
| 107 | + return "<td align = right><input type=\"image\" src =\"$default->owl_graphics_url/widgets/update.gif\" value=\"submit\" /></td>\n"; | |
| 108 | + } | |
| 109 | +} | |
| 110 | + | |
| 111 | +// gets the cancel button when a Org is selected | |
| 112 | +function getCancelButton($oOrg) { | |
| 113 | + global $default; | |
| 114 | + if (!isset($oOrg)) { | |
| 115 | + //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"; | |
| 116 | + } else { | |
| 117 | + return "<td align = right><a href=\"$default_owl_root_url/control.php?action=editOrg\"><img src =\"$default->owl_graphics_url/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 118 | + } | |
| 119 | +} | |
| 120 | +?> | |
| 0 | 121 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/orgmanagement/removeOrgBL.php
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* BL information for adding a Org | |
| 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("removeOrgUI.inc"); | |
| 16 | + require_once("$default->owl_fs_root/lib/security/permission.inc"); | |
| 17 | + require_once("$default->owl_fs_root/lib/Orgmanagement/Organisation.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 | + $oPatternCustom = & new PatternCustom(); | |
| 25 | + | |
| 26 | + // get main page | |
| 27 | + if (isset($fOrgID)) { | |
| 28 | + | |
| 29 | + $oPatternCustom->setHtml(getDeletePage($fOrgID)); | |
| 30 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fForDelete=1"); | |
| 31 | + | |
| 32 | + // get delete page | |
| 33 | + } else { | |
| 34 | + $oPatternCustom->setHtml(getDeletePage(null)); | |
| 35 | + $main->setFormAction($_SERVER["PHP_SELF"]); | |
| 36 | + } | |
| 37 | + | |
| 38 | + // if delete entry | |
| 39 | + if (isset($fForDelete)) { | |
| 40 | + $oOrg = Organisation::get($fOrgID); | |
| 41 | + $oOrg->setName($fOrgName); | |
| 42 | + | |
| 43 | + if ($oOrg->delete()) { | |
| 44 | + $oPatternCustom->setHtml(getDeleteSuccessPage()); | |
| 45 | + | |
| 46 | + } else { | |
| 47 | + $oPatternCustom->setHtml(getDeleteFailPage()); | |
| 48 | + } | |
| 49 | + } | |
| 50 | + | |
| 51 | + $main->setCentralPayload($oPatternCustom); | |
| 52 | + $main->render(); | |
| 53 | +} | |
| 54 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/orgmanagement/removeOrgUI.inc
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | +* Presentation information for Deleting a Org | |
| 5 | +* | |
| 6 | +* @author Mukhtar Dharsey | |
| 7 | +* @date 5 February 2003 | |
| 8 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 9 | +* | |
| 10 | +*/ | |
| 11 | +// gets the delete stuff | |
| 12 | +function getDeletePage($iOrgID) { | |
| 13 | + global $default; | |
| 14 | + $oOrg = null; | |
| 15 | + if (isset($iOrgID)) { | |
| 16 | + $oOrg = Organisation::get($iOrgID); | |
| 17 | + $sToRender .= "<br></br>\n"; | |
| 18 | + $sToRender .= "<b>Are you sure you wish to Remove this Organisation?:</b>\n"; | |
| 19 | + } | |
| 20 | + else{ | |
| 21 | + $sToRender .= "<br></br>\n"; | |
| 22 | + $sToRender .= "<b>Remove Organisation 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>Organisation Name: " . getOrgDisplay($oOrg) . "</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 .= "</tr>\n"; | |
| 37 | + $sToRender .= "<tr>\n"; | |
| 38 | + $sToRender .= "</tr>\n"; | |
| 39 | + $sToRender .= getDeleteButton($oOrg); | |
| 40 | + $sToRender .= "</table>\n"; | |
| 41 | + | |
| 42 | + | |
| 43 | + return $sToRender; | |
| 44 | +} | |
| 45 | + | |
| 46 | +// get successfully deletion page | |
| 47 | +function getDeleteSuccessPage() { | |
| 48 | + | |
| 49 | +global $default; | |
| 50 | + | |
| 51 | +$sToRender = "<br></br>\n" ; | |
| 52 | +$sToRender .= "<TABLE BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\">\n"; | |
| 53 | +$sToRender .= "<tr>\n"; | |
| 54 | +$sToRender .= "<td><b>Organisation SuccessFully Removed!</b></td>\n"; | |
| 55 | +$sToRender .= "</tr>\n"; | |
| 56 | +$sToRender .= "<tr></tr>\n"; | |
| 57 | +$sToRender .= "<tr></tr>\n"; | |
| 58 | +$sToRender .= "<tr></tr>\n"; | |
| 59 | +$sToRender .= "<tr></tr>\n"; | |
| 60 | +$sToRender .= "<tr>\n"; | |
| 61 | +$sToRender .= "<td align = right><a href=\"$default_owl_root_url/control.php?action=removeOrg\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 62 | +$sToRender .= "</tr>\n"; | |
| 63 | +$sToRender .= "</table>\n"; | |
| 64 | + | |
| 65 | +return $sToRender; | |
| 66 | +} | |
| 67 | + | |
| 68 | +// get deletion failed page | |
| 69 | +function getDeleteFailPage() { | |
| 70 | + | |
| 71 | +global $default; | |
| 72 | + | |
| 73 | +$sToRender = "<br></br>\n" ; | |
| 74 | +$sToRender .= "<TABLE BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\">\n"; | |
| 75 | +$sToRender .= "<tr>\n"; | |
| 76 | +$sToRender .= "<td><b>Deletion Failed!</b></td>\n"; | |
| 77 | +$sToRender .= "</tr>\n"; | |
| 78 | +$sToRender .= "<tr></tr>\n"; | |
| 79 | +$sToRender .= "<tr></tr>\n"; | |
| 80 | +$sToRender .= "<tr><td>Please Ensure that the Org has been Removed from any Organisation it belongs to</td></tr>\n"; | |
| 81 | +$sToRender .= "<tr><td>Also Ensure that the Org has no groups belonging to it</td></tr>\n"; | |
| 82 | +$sToRender .= "<tr></tr>\n"; | |
| 83 | +$sToRender .= "</tr>\n"; | |
| 84 | +$sToRender .= "<tr><td align = right><a href=\"$default_owl_root_url/control.php?action=removeOrg\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td></tr>\n"; | |
| 85 | +$sToRender .= "</table>\n"; | |
| 86 | + | |
| 87 | +return $sToRender; | |
| 88 | +} | |
| 89 | + | |
| 90 | +// show listbox...or the text name | |
| 91 | +function getOrgDisplay($oOrg) { | |
| 92 | + global $default; | |
| 93 | + if (!isset($oOrg)) { | |
| 94 | + $oPatternListBox = & new PatternListBox($default->owl_organisations_table, "name", "id", "fOrgID"); | |
| 95 | + $oPatternListBox->setIncludeDefaultValue(true); | |
| 96 | + $oPatternListBox->setPostBackOnChange(true); | |
| 97 | + return $oPatternListBox->render(); | |
| 98 | + } else { | |
| 99 | + return "<input type=\"hidden\" name=\"fOrgID\" value=\"" . $oOrg->iId . "\">\n" . | |
| 100 | + "<b>" . $oOrg->getName() . "</b>"; | |
| 101 | + } | |
| 102 | + | |
| 103 | +} | |
| 104 | + | |
| 105 | + | |
| 106 | +// show delete button | |
| 107 | +function getDeleteButton($oOrg) { | |
| 108 | + global $default; | |
| 109 | + if (!isset($oOrg)) { | |
| 110 | + return "Please select a Org: "; | |
| 111 | + } else { | |
| 112 | + return "<td align = right><input type=\"image\" src =\"$default->owl_graphics_url/widgets/Delete.gif\" value=\"submit\" /></td>\n". | |
| 113 | + "<td align = right><a href=\"$default_owl_root_url/control.php?action=removeOrg\"><img src =\"$default->owl_graphics_url/widgets/Cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 114 | + } | |
| 115 | +} | |
| 116 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/addUnitBL.php
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* BL information for adding a unit | |
| 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/PatternCreate.inc"); | |
| 15 | + require_once("addUnitUI.inc"); | |
| 16 | + require_once("$default->owl_fs_root/lib/unitmanagement/Unit.inc"); | |
| 17 | + require_once("$default->owl_fs_root/lib/unitmanagement/UnitOrganisationLink.inc"); | |
| 18 | + require_once("$default->owl_fs_root/lib/security/permission.inc"); | |
| 19 | + require_once("$default->owl_fs_root/presentation/webpageTemplate.inc"); | |
| 20 | + require_once("$default->owl_fs_root/lib/visualpatterns/PatternCustom.inc"); | |
| 21 | + require_once("$default->owl_fs_root/lib/foldermanagement/Folder.inc"); | |
| 22 | + require_once("$default->owl_fs_root/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | |
| 23 | + require_once("$default->owl_fs_root/presentation/Html.inc"); | |
| 24 | + | |
| 25 | + $oPatternCustom = & new PatternCustom(); | |
| 26 | + | |
| 27 | + if (isset($fForStore)) { | |
| 28 | + | |
| 29 | + if($fUnitName != "" and $fOrgID !=-1) | |
| 30 | + { | |
| 31 | + $oUnit = new Unit($fUnitName); | |
| 32 | + | |
| 33 | + //$oOrg = Organisation($ | |
| 34 | + // if creation is successfull..get the unit id | |
| 35 | + if ($oUnit->create()) { | |
| 36 | + $unitID = $oUnit->getID(); | |
| 37 | + $oUnitOrg = new UnitOrganisationLink($unitID,$fOrgID); | |
| 38 | + | |
| 39 | + if($oUnitOrg->create()){ | |
| 40 | + // if successfull print out success message | |
| 41 | + $oPatternCustom->setHtml(getAddPageSuccess()); | |
| 42 | + }else{ | |
| 43 | + | |
| 44 | + // if fail print out fail message | |
| 45 | + $oPatternCustom->setHtml(getAddToOrgFail()); | |
| 46 | + } | |
| 47 | + | |
| 48 | + | |
| 49 | + } else { | |
| 50 | + // if fail print out fail message | |
| 51 | + $oPatternCustom->setHtml(getAddPageFail()); | |
| 52 | + } | |
| 53 | + }else{ | |
| 54 | + | |
| 55 | + $oPatternCustom->setHtml(getPageFail()); | |
| 56 | + } | |
| 57 | + | |
| 58 | + } else if (isset($fUnitID)){ | |
| 59 | + // post back on Unit select from manual edit page | |
| 60 | + $oPatternCustom->setHtml(getAddPage($fUnitID)); | |
| 61 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fForStore=1"); | |
| 62 | + }else { | |
| 63 | + // if nothing happens...just reload edit page | |
| 64 | + $oPatternCustom->setHtml(getAddPage(null)); | |
| 65 | + $main->setFormAction($_SERVER["PHP_SELF"]. "?fForStore=1"); | |
| 66 | + | |
| 67 | + } | |
| 68 | + | |
| 69 | + //$oPatternCustom->setHtml(getPage()); | |
| 70 | + | |
| 71 | + //$main->setFormAction("$default->owl_root_url/presentation/lookAndFeel/knowledgeTree/create.php?fRedirectURL=".urlencode("$default->owl_root_url/control.php?action=addUnitSuccess&fUnit")); | |
| 72 | + $main->setCentralPayload($oPatternCustom); | |
| 73 | + $main->render(); | |
| 74 | +} | |
| 75 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/addUnitSuccess.php
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information when adding a unit 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>Unit added Successfully!</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=addUnit\"><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/unitmanagement/addUnitUI.inc
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information for adding a unit | |
| 4 | +* | |
| 5 | +* @author Mukhtar Dharsey | |
| 6 | +* @date 5 February 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | +// get add pages | |
| 11 | +function getAddPage($unitID) { | |
| 12 | + | |
| 13 | + global $default; | |
| 14 | + | |
| 15 | + $oOrg = null; | |
| 16 | + if (isset($iOrgID)) { | |
| 17 | + $oOrg = Organisation::get($iOrgID); | |
| 18 | + | |
| 19 | + } | |
| 20 | + | |
| 21 | + //$aDisplayRowNames = array("Unit Name:"); | |
| 22 | + //$aParameterNumbers = array(0); | |
| 23 | + //$aDisplayColumnTypes = array(1); | |
| 24 | + //$aRequired = array(1); | |
| 25 | + //$aDropDownListTableNames = array(10=>"document_types_lookup"); | |
| 26 | + | |
| 27 | + // create a text field that is required | |
| 28 | + //$oPatternCreate = & new PatternCreate("Unit", "unitmanagement\\Unit.inc",$aDisplayRowNames, $aParameterNumbers, $aDisplayColumnTypes, $aRequired); | |
| 29 | + //$oPatternCreate->setUniqueName("unit"); | |
| 30 | + | |
| 31 | + $sToRender .= "<br></br>\n"; | |
| 32 | + $sToRender .= "<b>Add a New Unit to the System:</b>\n"; | |
| 33 | + $sToRender .= "<table>\n"; | |
| 34 | + $sToRender .= "<br></br>\n"; | |
| 35 | + $sToRender .= "<tr></tr>\n"; | |
| 36 | + $sToRender .= "<tr>\n"; | |
| 37 | + $sToRender .= "<td>Unit Name: </td><td><input size = \"40\" type=\"text\" name=\"fUnitName\"> </td>\n"; | |
| 38 | + $sToRender .= "</tr>\n"; | |
| 39 | + $sToRender .= "<tr>\n"; | |
| 40 | + $sToRender .= "<td>Select an Organisation: </td><td>" . getOrgDisplay($oOrg) ; | |
| 41 | + $sToRender .= "</tr>\n"; | |
| 42 | + $sToRender .= "<tr>\n"; | |
| 43 | + $sToRender .= "</tr>\n"; | |
| 44 | + $sToRender .= "<td></td><td align = right><input type=\"image\" src =\"$default->owl_graphics_url/widgets/add.gif\" value=\"Submit\" /></td>\n"; | |
| 45 | + $sToRender .= "</table>\n"; | |
| 46 | + | |
| 47 | + return $sToRender; | |
| 48 | + | |
| 49 | +} | |
| 50 | + | |
| 51 | +// if edition is successful print otu success page | |
| 52 | +function getAddPageSuccess() { | |
| 53 | + global $default; | |
| 54 | + | |
| 55 | + $sToRender .= "<br></br>\n"; | |
| 56 | + $sToRender .= "<b>Addition Successful!</b>\n"; | |
| 57 | + $sToRender .= "<table>\n"; | |
| 58 | + $sToRender .= "<br></br>\n"; | |
| 59 | + $sToRender .= "<tr></tr>\n"; | |
| 60 | + $sToRender .= "<tr><td>New Unit was successfully added</td></tr>\n"; | |
| 61 | + $sToRender .= "<tr></tr>\n"; | |
| 62 | + $sToRender .= "<tr></tr>\n"; | |
| 63 | + $sToRender .= "<tr>\n"; | |
| 64 | + $sToRender .= "<td></td><td align = right><a href=\"$default_owl_root_url/control.php?action=addUnit\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 65 | + $sToRender .= "</tr>\n"; | |
| 66 | + $sToRender .= "</table>\n"; | |
| 67 | + | |
| 68 | + return $sToRender; | |
| 69 | +} | |
| 70 | + | |
| 71 | +// if edition is successful print otu success page | |
| 72 | +function getAddPageFail() { | |
| 73 | + global $default; | |
| 74 | + | |
| 75 | + $sToRender .= "<br></br>\n"; | |
| 76 | + $sToRender .= "<b>Addition Unsuccessful</b>\n"; | |
| 77 | + $sToRender .= "<table>\n"; | |
| 78 | + $sToRender .= "<br></br>\n"; | |
| 79 | + $sToRender .= "<tr></tr>\n"; | |
| 80 | + $sToRender .= "<tr><td>The Unit was not added. Unit Name Already exists!</td></tr>\n"; | |
| 81 | + $sToRender .= "<tr></tr>\n"; | |
| 82 | + $sToRender .= "<tr></tr>\n"; | |
| 83 | + $sToRender .= "<tr>\n"; | |
| 84 | + $sToRender .= "<td></td><td align = right><a href=\"$default_owl_root_url/control.php?action=addUnit\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 85 | + $sToRender .= "</tr>\n"; | |
| 86 | + $sToRender .= "</table>\n"; | |
| 87 | + | |
| 88 | + | |
| 89 | + return $sToRender; | |
| 90 | +} | |
| 91 | + | |
| 92 | + | |
| 93 | +// if edition is successful print otu success page | |
| 94 | +function getPageFail() { | |
| 95 | + global $default; | |
| 96 | + | |
| 97 | + $sToRender .= "<br></br>\n"; | |
| 98 | + $sToRender .= "<b>Addition Unsuccessful</b>\n"; | |
| 99 | + $sToRender .= "<table>\n"; | |
| 100 | + $sToRender .= "<br></br>\n"; | |
| 101 | + $sToRender .= "<tr></tr>\n"; | |
| 102 | + $sToRender .= "<tr><td>Please enter a name AND Select the Organisation</td></tr>\n"; | |
| 103 | + $sToRender .= "<tr></tr>\n"; | |
| 104 | + $sToRender .= "<tr></tr>\n"; | |
| 105 | + $sToRender .= "<tr>\n"; | |
| 106 | + $sToRender .= "<td></td><td align = right><a href=\"$default_owl_root_url/control.php?action=addUnit\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 107 | + $sToRender .= "</tr>\n"; | |
| 108 | + $sToRender .= "</table>\n"; | |
| 109 | + | |
| 110 | + | |
| 111 | + return $sToRender; | |
| 112 | +} | |
| 113 | +// if edition is successful print otu success page | |
| 114 | +function getAddPageToOrgFail() { | |
| 115 | + global $default; | |
| 116 | + | |
| 117 | + $sToRender .= "<br></br>\n"; | |
| 118 | + $sToRender .= "<b>Addition to Organisation Unsuccessful</b>\n"; | |
| 119 | + $sToRender .= "<table>\n"; | |
| 120 | + $sToRender .= "<br></br>\n"; | |
| 121 | + $sToRender .= "<tr></tr>\n"; | |
| 122 | + $sToRender .= "<tr><td>The Unit was not added to the Organisation.</td></tr>\n"; | |
| 123 | + $sToRender .= "<tr></tr>\n"; | |
| 124 | + $sToRender .= "<tr></tr>\n"; | |
| 125 | + $sToRender .= "<tr>\n"; | |
| 126 | + $sToRender .= "<td></td><td align = right><a href=\"$default_owl_root_url/control.php?action=addUnit\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 127 | + $sToRender .= "</tr>\n"; | |
| 128 | + $sToRender .= "</table>\n"; | |
| 129 | + | |
| 130 | + | |
| 131 | + return $sToRender; | |
| 132 | +} | |
| 133 | + | |
| 134 | + | |
| 135 | +// show the list box when no unit selected | |
| 136 | +// then shows a text box with the unit's name | |
| 137 | +function getOrgDisplay($oOrg) { | |
| 138 | + global $default; | |
| 139 | + if (!isset($oOrg)) { | |
| 140 | + $oPatternListBox = & new PatternListBox($default->owl_organisations_table, "name", "id", "fOrgID"); | |
| 141 | + //$oPatternListBox->setIncludeDefaultValue(true); | |
| 142 | + //$oPatternListBox->setPostBackOnChange(true); | |
| 143 | + return $oPatternListBox->render(); | |
| 144 | + } else { | |
| 145 | + return "<input type=\"hidden\" name=\"fOrgID\" value=\"" . $oOrg->iId . "\">\n" . | |
| 146 | + "" . $oOrg->getName() . "\">"; | |
| 147 | + } | |
| 148 | + | |
| 149 | +} | |
| 150 | + | |
| 151 | +?> | |
| 0 | 152 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/editUnitBL.php
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* BL information for editing a unit | |
| 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("editUnitUI.inc"); | |
| 16 | + require_once("$default->owl_fs_root/lib/security/permission.inc"); | |
| 17 | + require_once("$default->owl_fs_root/lib/unitmanagement/Unit.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 | + | |
| 25 | + $oPatternCustom = & new PatternCustom(); | |
| 26 | + | |
| 27 | + // if a new unit has been added | |
| 28 | + // coming from manual edit page | |
| 29 | + if (isset($fForStore)) { | |
| 30 | + $oUnit = Unit::get($fUnitID); | |
| 31 | + $oUnit->setName($fUnitName); | |
| 32 | + | |
| 33 | + if ($oUnit->update()) { | |
| 34 | + // if successfull print out success message | |
| 35 | + $oPatternCustom->setHtml(getEditPageSuccess()); | |
| 36 | + | |
| 37 | + } else { | |
| 38 | + // if fail print out fail message | |
| 39 | + $oPatternCustom->setHtml(getEditPageFail()); | |
| 40 | + } | |
| 41 | + } else if (isset($fUnitID)){ | |
| 42 | + // post back on Unit select from manual edit page | |
| 43 | + $oPatternCustom->setHtml(getEditPage($fUnitID)); | |
| 44 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fForStore=1"); | |
| 45 | + | |
| 46 | + | |
| 47 | + } else { | |
| 48 | + // if nothing happens...just reload edit page | |
| 49 | + $oPatternCustom->setHtml(getEditPage(null)); | |
| 50 | + $main->setFormAction($_SERVER["PHP_SELF"]); | |
| 51 | + | |
| 52 | + } | |
| 53 | + //render the page | |
| 54 | + $main->setCentralPayload($oPatternCustom); | |
| 55 | + $main->render(); | |
| 56 | +} | |
| 57 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/editUnitUI.inc
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* Presentation information for renaming a unit | |
| 4 | +* | |
| 5 | +* @author Mukhtar Dharsey | |
| 6 | +* @date 5 February 2003 | |
| 7 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 8 | +* | |
| 9 | +*/ | |
| 10 | + | |
| 11 | +// if its the manual edit page..then display normally | |
| 12 | +function getEditPage($iUnitID) { | |
| 13 | + global $default; | |
| 14 | + $oUnit = null; | |
| 15 | + if (isset($iUnitID)) { | |
| 16 | + $oUnit = Unit::get($iUnitID); | |
| 17 | + | |
| 18 | + } | |
| 19 | + | |
| 20 | + $sToRender .= "<br></br>\n"; | |
| 21 | + $sToRender .= "<b>Edit Unit Properties:</b>\n"; | |
| 22 | + $sToRender .= "<table>\n"; | |
| 23 | + $sToRender .= "<br></br>\n"; | |
| 24 | + $sToRender .= "<tr></tr>\n"; | |
| 25 | + $sToRender .= "<tr>\n"; | |
| 26 | + $sToRender .= "<td>Unit Name: </td><td>" . getUnitDisplay($oUnit) . "</td>\n"; | |
| 27 | + $sToRender .= "</tr>\n"; | |
| 28 | + $sToRender .= "<tr>\n"; | |
| 29 | + $sToRender .= "</tr>\n"; | |
| 30 | + $sToRender .= "<tr>\n"; | |
| 31 | + $sToRender .= "<tr>\n"; | |
| 32 | + $sToRender .= "</tr>\n"; | |
| 33 | + $sToRender .= "<td></td>" . getUpdateButton($oUnit); | |
| 34 | + $sToRender .= getCancelButton($oUnit); | |
| 35 | + $sToRender .= "</table>\n"; | |
| 36 | + | |
| 37 | + | |
| 38 | + return $sToRender; | |
| 39 | +} | |
| 40 | + | |
| 41 | +// if edition is successful print otu success page | |
| 42 | +function getEditPageSuccess() { | |
| 43 | + global $default; | |
| 44 | + | |
| 45 | + $sToRender .= "<br></br>\n"; | |
| 46 | + $sToRender .= "<b>Success!</b>\n"; | |
| 47 | + $sToRender .= "<table>\n"; | |
| 48 | + $sToRender .= "<br></br>\n"; | |
| 49 | + $sToRender .= "<tr></tr>\n"; | |
| 50 | + $sToRender .= "<tr><td>The Unit was successfully modified</td></tr>\n"; | |
| 51 | + $sToRender .= "<tr></tr>\n"; | |
| 52 | + $sToRender .= "<tr></tr>\n"; | |
| 53 | + $sToRender .= "<tr>\n"; | |
| 54 | + $sToRender .= "<td></td><td align = right><a href=\"$default_owl_root_url/control.php?action=editUnit\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 55 | + $sToRender .= "</tr>\n"; | |
| 56 | + $sToRender .= "</table>\n"; | |
| 57 | + | |
| 58 | + | |
| 59 | + return $sToRender; | |
| 60 | +} | |
| 61 | + | |
| 62 | + | |
| 63 | +// gets the page if edition fails | |
| 64 | +function getEditPageFail() { | |
| 65 | + global $default; | |
| 66 | + | |
| 67 | + $sToRender .= "<br></br>\n"; | |
| 68 | + $sToRender .= "<b>Success!</b>\n"; | |
| 69 | + $sToRender .= "<table>\n"; | |
| 70 | + $sToRender .= "<br></br>\n"; | |
| 71 | + $sToRender .= "<tr></tr>\n"; | |
| 72 | + $sToRender .= "<tr><td>Unit modification Failed!</td></tr>\n"; | |
| 73 | + $sToRender .= "<tr></tr>\n"; | |
| 74 | + $sToRender .= "<tr></tr>\n"; | |
| 75 | + $sToRender .= "<tr>\n"; | |
| 76 | + $sToRender .= "<td></td><td align = right><a href=\"$default_owl_root_url/control.php?action=editUnit\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 77 | + $sToRender .= "</tr>\n"; | |
| 78 | + $sToRender .= "</table>\n"; | |
| 79 | + | |
| 80 | + | |
| 81 | + return $sToRender; | |
| 82 | +} | |
| 83 | + | |
| 84 | +// show the list box when no unit selected | |
| 85 | +// then shows a text box with the unit's name | |
| 86 | +function getUnitDisplay($oUnit) { | |
| 87 | + global $default; | |
| 88 | + if (!isset($oUnit)) { | |
| 89 | + $oPatternListBox = & new PatternListBox($default->owl_units_table, "name", "id", "fUnitID"); | |
| 90 | + //$oPatternListBox->setIncludeDefaultValue(true); | |
| 91 | + $oPatternListBox->setPostBackOnChange(true); | |
| 92 | + return $oPatternListBox->render(); | |
| 93 | + } else { | |
| 94 | + return "<input type=\"hidden\" name=\"fUnitID\" value=\"" . $oUnit->iId . "\">\n" . | |
| 95 | + "<input size = \"40\" type=\"text\" name=\"fUnitName\" value=\"" . $oUnit->getName() . "\">"; | |
| 96 | + } | |
| 97 | + | |
| 98 | +} | |
| 99 | + | |
| 100 | + | |
| 101 | +// gets the updatebutton when a unit is selected | |
| 102 | +function getUpdateButton($oUnit) { | |
| 103 | + global $default; | |
| 104 | + if (!isset($oUnit)) { | |
| 105 | + return "Please select a unit: "; | |
| 106 | + } else { | |
| 107 | + return "<td align = right><input type=\"image\" src =\"$default->owl_graphics_url/widgets/update.gif\" value=\"submit\" /></td>\n"; | |
| 108 | + } | |
| 109 | +} | |
| 110 | + | |
| 111 | +// gets the cancel button when a unit is selected | |
| 112 | +function getCancelButton($oUnit) { | |
| 113 | + global $default; | |
| 114 | + if (!isset($oUnit)) { | |
| 115 | + //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"; | |
| 116 | + } else { | |
| 117 | + return "<td align = right><a href=\"$default_owl_root_url/control.php?action=editUnit\"><img src =\"$default->owl_graphics_url/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 118 | + } | |
| 119 | +} | |
| 120 | +?> | |
| 0 | 121 | \ No newline at end of file | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/removeUnitBL.php
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* BL information for adding a Unit | |
| 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("removeUnitUI.inc"); | |
| 16 | + require_once("$default->owl_fs_root/lib/security/permission.inc"); | |
| 17 | + require_once("$default->owl_fs_root/lib/unitmanagement/Unit.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 | + $oPatternCustom = & new PatternCustom(); | |
| 25 | + | |
| 26 | + // get main page | |
| 27 | + if (isset($fUnitID)) { | |
| 28 | + | |
| 29 | + $oPatternCustom->setHtml(getDeletePage($fUnitID)); | |
| 30 | + $main->setFormAction($_SERVER["PHP_SELF"] . "?fForDelete=1"); | |
| 31 | + | |
| 32 | + // get delete page | |
| 33 | + } else { | |
| 34 | + $oPatternCustom->setHtml(getDeletePage(null)); | |
| 35 | + $main->setFormAction($_SERVER["PHP_SELF"]); | |
| 36 | + } | |
| 37 | + | |
| 38 | + // if delete entry | |
| 39 | + if (isset($fForDelete)) { | |
| 40 | + $oUnit = Unit::get($fUnitID); | |
| 41 | + $oUnit->setName($fUnitName); | |
| 42 | + | |
| 43 | + //$fUnitID = GroupUnitLink::groupBelongsToUnit($fGroupID) | |
| 44 | + | |
| 45 | + if ($oUnit->delete()) { | |
| 46 | + $oPatternCustom->setHtml(getDeleteSuccessPage()); | |
| 47 | + | |
| 48 | + } else { | |
| 49 | + $oPatternCustom->setHtml(getDeleteFailPage()); | |
| 50 | + } | |
| 51 | + | |
| 52 | + } | |
| 53 | + | |
| 54 | + $main->setCentralPayload($oPatternCustom); | |
| 55 | + $main->render(); | |
| 56 | +} | |
| 57 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/removeUnitUI.inc
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | +* Presentation information for Deleting a Unit | |
| 5 | +* | |
| 6 | +* @author Mukhtar Dharsey | |
| 7 | +* @date 5 February 2003 | |
| 8 | +* @package presentation.lookAndFeel.knowledgeTree. | |
| 9 | +* | |
| 10 | +*/ | |
| 11 | +// gets the delete stuff | |
| 12 | +function getDeletePage($iUnitID) { | |
| 13 | + global $default; | |
| 14 | + $oUnit = null; | |
| 15 | + if (isset($iUnitID)) { | |
| 16 | + $oUnit = Unit::get($iUnitID); | |
| 17 | + $sToRender .= "<br></br>\n"; | |
| 18 | + $sToRender .= "<b>Are you sure you wish to Remove this Unit?:</b>\n"; | |
| 19 | + } | |
| 20 | + else{ | |
| 21 | + $sToRender .= "<br></br>\n"; | |
| 22 | + $sToRender .= "<b>Remove Unit 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>Unit Name: " . getUnitDisplay($oUnit) . "</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 .= "</tr>\n"; | |
| 37 | + $sToRender .= "<tr>\n"; | |
| 38 | + | |
| 39 | + $sToRender .= getDeleteButton($oUnit); | |
| 40 | + $sToRender .= "</tr>\n"; | |
| 41 | + $sToRender .= "</table>\n"; | |
| 42 | + | |
| 43 | + | |
| 44 | + return $sToRender; | |
| 45 | +} | |
| 46 | + | |
| 47 | +// get successfully deletion page | |
| 48 | +function getDeleteSuccessPage() { | |
| 49 | + | |
| 50 | +global $default; | |
| 51 | + | |
| 52 | +$sToRender = "<br></br>\n" ; | |
| 53 | +$sToRender .= "<TABLE BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\">\n"; | |
| 54 | +$sToRender .= "<tr>\n"; | |
| 55 | +$sToRender .= "<td><b>Unit SuccessFully Removed!</b></td>\n"; | |
| 56 | +$sToRender .= "</tr>\n"; | |
| 57 | +$sToRender .= "<tr></tr>\n"; | |
| 58 | +$sToRender .= "<tr></tr>\n"; | |
| 59 | +$sToRender .= "<tr></tr>\n"; | |
| 60 | +$sToRender .= "<tr></tr>\n"; | |
| 61 | +$sToRender .= "<tr>\n"; | |
| 62 | +$sToRender .= "<td align = right><a href=\"$default_owl_root_url/control.php?action=removeUnit\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 63 | +$sToRender .= "</tr>\n"; | |
| 64 | +$sToRender .= "</table>\n"; | |
| 65 | + | |
| 66 | +return $sToRender; | |
| 67 | +} | |
| 68 | + | |
| 69 | +// get deletion failed page | |
| 70 | +function getDeleteFailPage() { | |
| 71 | + | |
| 72 | +global $default; | |
| 73 | + | |
| 74 | +$sToRender = "<br></br>\n" ; | |
| 75 | +$sToRender .= "<TABLE BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\">\n"; | |
| 76 | +$sToRender .= "<tr>\n"; | |
| 77 | +$sToRender .= "<td><b>Deletion Failed!</b></td>\n"; | |
| 78 | +$sToRender .= "</tr>\n"; | |
| 79 | +$sToRender .= "<tr></tr>\n"; | |
| 80 | +$sToRender .= "<tr></tr>\n"; | |
| 81 | +$sToRender .= "<tr><td>Please Ensure that the unit has no groups belonging to it</td></tr>\n"; | |
| 82 | +$sToRender .= "<tr></tr>\n"; | |
| 83 | +$sToRender .= "</tr>\n"; | |
| 84 | +$sToRender .= "<tr><td align = right><a href=\"$default_owl_root_url/control.php?action=removeUnit\"><img src =\"$default->owl_graphics_url/widgets/back.gif\" border = \"0\" /></a></td></tr>\n"; | |
| 85 | +$sToRender .= "</table>\n"; | |
| 86 | + | |
| 87 | +return $sToRender; | |
| 88 | +} | |
| 89 | + | |
| 90 | +// show listbox...or the text name | |
| 91 | +function getUnitDisplay($oUnit) { | |
| 92 | + global $default; | |
| 93 | + if (!isset($oUnit)) { | |
| 94 | + $oPatternListBox = & new PatternListBox($default->owl_units_table, "name", "id", "fUnitID"); | |
| 95 | + $oPatternListBox->setIncludeDefaultValue(true); | |
| 96 | + $oPatternListBox->setPostBackOnChange(true); | |
| 97 | + return $oPatternListBox->render(); | |
| 98 | + } else { | |
| 99 | + return "<input type=\"hidden\" name=\"fUnitID\" value=\"" . $oUnit->iId . "\">\n" . | |
| 100 | + "<b>" . $oUnit->getName() . "</b>"; | |
| 101 | + } | |
| 102 | + | |
| 103 | +} | |
| 104 | + | |
| 105 | + | |
| 106 | +// show delete button | |
| 107 | +function getDeleteButton($oUnit) { | |
| 108 | + global $default; | |
| 109 | + if (!isset($oUnit)) { | |
| 110 | + return "Please select a Unit: "; | |
| 111 | + } else { | |
| 112 | + return "<td align = right><input type=\"image\" src =\"$default->owl_graphics_url/widgets/Delete.gif\" value=\"submit\" /></td>\n". | |
| 113 | + "<td align = right><a href=\"$default_owl_root_url/control.php?action=removeUnit\"><img src =\"$default->owl_graphics_url/widgets/Cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 114 | + } | |
| 115 | +} | |
| 116 | +?> | ... | ... |