Commit ca772ff81ed645e2737d60827e93320999e2a02e
1 parent
b151e31b
duplicate
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1569 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
0 additions
and
189 deletions
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/removeGroupFromUnit.inc deleted
| 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->rootUrl/control.php?action=removeGroupFromUnit\"><img src =\"$default->graphicsUrl/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->rootUrl/control.php?action=removeGroupFromUnit\"><img src =\"$default->graphicsUrl/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->rootUrl/control.php?action=removeGroupFromUnit\"><img src =\"$default->graphicsUrl/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->graphicsUrl/widgets/select.gif\" value=\"submit\" border=\"0\"/></td>\n"; | ||
| 173 | - } else { | ||
| 174 | - return "<td align = right><input type=\"image\" src =\"$default->graphicsUrl/widgets/delete.gif\" value=\"submit\" border=\"0\"/></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->rootUrl/control.php?action=groupManagement\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" value=\"cancel\" /></a></td>\n"; | ||
| 183 | - } else { | ||
| 184 | - return "<td align = right><a href=\"$default->rootUrl/control.php?action=removeGroupFromUnit\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | ||
| 185 | - } | ||
| 186 | -} | ||
| 187 | - | ||
| 188 | - | ||
| 189 | -?> | ||
| 190 | \ No newline at end of file | 0 | \ No newline at end of file |