Commit d2f87f6830a9f0c10b9642ed21b33f9a01ceb253
1 parent
47a574a2
re-adding, bad filename case
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1406 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
192 additions
and
0 deletions
presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/assignGroupToUnitUI.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 | +// gets main page | |
| 12 | +function getPage($iGroupID, $iUnitID) { | |
| 13 | + global $default; | |
| 14 | + $oGroup = null; | |
| 15 | + $oUnit = null; | |
| 16 | + | |
| 17 | + if (isset($iGroupID)) { | |
| 18 | + $oGroup = Group::get($iGroupID); | |
| 19 | + $heading = "<tr>Are you Sure you wish to assign the Group to the Unit? </tr>\n"; | |
| 20 | + }else{ | |
| 21 | + $heading = "<tr>Please Assign a Group to a Unit: </tr>\n"; | |
| 22 | + } | |
| 23 | + | |
| 24 | + | |
| 25 | + if (isset($iUnitID)) { | |
| 26 | + $oUnit = Unit::get($iUnitID); | |
| 27 | + | |
| 28 | + } | |
| 29 | + | |
| 30 | + $sToRender .= "<br></br>\n"; | |
| 31 | + $sToRender .= "<b>Assign Group to Unit:</b>\n"; | |
| 32 | + $sToRender .= "<table>\n"; | |
| 33 | + $sToRender .= "<br></br>\n"; | |
| 34 | + $sToRender .= $heading; | |
| 35 | + $sToRender .= "<br>\n"; | |
| 36 | + $sToRender .= "<tr>\n"; | |
| 37 | + $sToRender .= "</tr>\n"; | |
| 38 | + $sToRender .= "<td>Group Name: </td><td>" . getGroupDisplay($oGroup) . "</td>\n"; | |
| 39 | + $sToRender .= "<tr>\n"; | |
| 40 | + $sToRender .= "</tr>\n"; | |
| 41 | + $sToRender .= "<tr>\n"; | |
| 42 | + $sToRender .= "<td>Unit Name: </td><td>" . getUnitDisplay($oUnit) . "</td>\n"; | |
| 43 | + $sToRender .= "</tr>\n"; | |
| 44 | + $sToRender .= "<tr>\n"; | |
| 45 | + $sToRender .= "</tr>\n"; | |
| 46 | + $sToRender .= "<tr>\n"; | |
| 47 | + $sToRender .= "</tr>\n"; | |
| 48 | + $sToRender .= "<td></td><td>" . getAssignButton($oGroup); | |
| 49 | + $sToRender .= getCancelButton($oGroup); | |
| 50 | + $sToRender .= "</td></table>\n"; | |
| 51 | + | |
| 52 | + | |
| 53 | + return $sToRender; | |
| 54 | +} | |
| 55 | + | |
| 56 | +// page when failure occurred | |
| 57 | +function getPageFail($iGroupID) { | |
| 58 | + global $default; | |
| 59 | + $oGroup = null; | |
| 60 | + $oUnit = null; | |
| 61 | + | |
| 62 | + if (isset($iGroupID)) { | |
| 63 | + $oGroup = Group::get($iGroupID); | |
| 64 | + } | |
| 65 | + // find otu which unit the group belogns to | |
| 66 | + $iUnitID = GroupUnitLink::groupBelongsToUnit($iGroupID); | |
| 67 | + // get the id of that unit | |
| 68 | + $oUnit= Unit::get($iUnitID); | |
| 69 | + | |
| 70 | + $sToRender .= "<br></br>\n"; | |
| 71 | + $sToRender .= "<b>Sorry, Assignment Failed</b>\n"; | |
| 72 | + $sToRender .= "<table>\n"; | |
| 73 | + $sToRender .= "<br></br>\n"; | |
| 74 | + $sToRender .= "<tr></tr>\n"; | |
| 75 | + $sToRender .= "<tr>Group Already Belongs to A Unit\n"; | |
| 76 | + $sToRender .= "</tr>\n"; | |
| 77 | + $sToRender .= "<tr>\n"; | |
| 78 | + $sToRender .= "<td>Group Name: </td><td><b>" . $oGroup->getName() . "</b></td>\n"; | |
| 79 | + $sToRender .= "</tr>\n"; | |
| 80 | + $sToRender .= "<tr>\n"; | |
| 81 | + $sToRender .= "<td>Unit Name: </td><td><b>" . $oUnit->getName($iUnitID) . "</b></td>\n"; | |
| 82 | + $sToRender .= "</tr>\n"; | |
| 83 | + $sToRender .= "<tr>\n"; | |
| 84 | + $sToRender .= "</tr>\n"; | |
| 85 | + $sToRender .= "<tr>\n"; | |
| 86 | + $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=assignGroupToUnit\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 87 | + $sToRender .= "</tr>\n"; | |
| 88 | + | |
| 89 | + $sToRender .= "</table>\n"; | |
| 90 | + | |
| 91 | + | |
| 92 | + return $sToRender; | |
| 93 | +} | |
| 94 | + | |
| 95 | +// page that comes up when there is nothing selected | |
| 96 | +function getPageNotSelected() { | |
| 97 | + global $default; | |
| 98 | + | |
| 99 | + $sToRender .= "<br></br>\n"; | |
| 100 | + $sToRender .= "<b>Sorry, Selection Failed</b>\n"; | |
| 101 | + $sToRender .= "<table>\n"; | |
| 102 | + $sToRender .= "<br></br>\n"; | |
| 103 | + $sToRender .= "<tr></tr>\n"; | |
| 104 | + $sToRender .= "<tr><td>Please select BOTH a Group AND a Unit</td></tr>\n"; | |
| 105 | + $sToRender .= "<tr></tr>\n"; | |
| 106 | + $sToRender .= "<tr></tr>\n"; | |
| 107 | + $sToRender .= "<tr>\n"; | |
| 108 | + $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=assignGroupToUnit\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 109 | + $sToRender .= "</tr>\n"; | |
| 110 | + $sToRender .= "</table>\n"; | |
| 111 | + | |
| 112 | + | |
| 113 | + return $sToRender; | |
| 114 | +} | |
| 115 | + | |
| 116 | +//if edition successful | |
| 117 | +function getPageSuccess() { | |
| 118 | + global $default; | |
| 119 | + | |
| 120 | + $sToRender .= "<br></br>\n"; | |
| 121 | + $sToRender .= "<b>Success!</b>\n"; | |
| 122 | + $sToRender .= "<table>\n"; | |
| 123 | + $sToRender .= "<br></br>\n"; | |
| 124 | + $sToRender .= "<tr></tr>\n"; | |
| 125 | + $sToRender .= "<tr><td>The Group was successfully assigned to the specified Unit</td></tr>\n"; | |
| 126 | + $sToRender .= "<tr></tr>\n"; | |
| 127 | + $sToRender .= "<tr></tr>\n"; | |
| 128 | + $sToRender .= "<tr>\n"; | |
| 129 | + $sToRender .= "<td></td><td align = right><a href=\"$default->rootUrl/control.php?action=assignGroupToUnit\"><img src =\"$default->graphicsUrl/widgets/back.gif\" border = \"0\" /></a></td>\n"; | |
| 130 | + $sToRender .= "</tr>\n"; | |
| 131 | + $sToRender .= "</table>\n"; | |
| 132 | + | |
| 133 | + | |
| 134 | + return $sToRender; | |
| 135 | +} | |
| 136 | + | |
| 137 | +// display the listbox initially ..then just display the text | |
| 138 | +function getGroupDisplay($oGroup) { | |
| 139 | + global $default; | |
| 140 | + //$from = "," . $default->owl_groups_units_table . " AS GU"; | |
| 141 | + //$where = "(ST.id = GU.group_id)"; | |
| 142 | + | |
| 143 | + | |
| 144 | + if (!isset($oGroup)) { | |
| 145 | + $oPatternListBox = & new PatternListBox($default->owl_groups_table, "name", "id", "fGroupID"); | |
| 146 | + //$oPatternListBox->setWhereClause($where); | |
| 147 | + //$oPatternListBox->setFromClause($from); | |
| 148 | + //$oPatternListBox->setIncludeDefaultValue(true); | |
| 149 | + //$oPatternListBox->setPostBackOnChange(true); | |
| 150 | + return $oPatternListBox->render(); | |
| 151 | + } else { | |
| 152 | + return "<input type=\"hidden\" name=\"fGroupID\" value=\"" . $oGroup->iId . "\">\n" . | |
| 153 | + $oGroup->getName(); | |
| 154 | + } | |
| 155 | + | |
| 156 | +} | |
| 157 | + | |
| 158 | +// display the listbox initially ..then just display the text | |
| 159 | +function getUnitDisplay($oUnit) { | |
| 160 | + global $default; | |
| 161 | + if (!isset($oUnit)) { | |
| 162 | + $oPatternListBox = & new PatternListBox($default->owl_units_table, "name", "id", "fUnitID"); | |
| 163 | + //$oPatternLiListBoxstBox->setPostBackOnChange(true); | |
| 164 | + return $oPatternListBox->render(); | |
| 165 | + } else { | |
| 166 | + return "<input type=\"hidden\" name=\"fUnitID\" value=\"" . $oUnit->iId . "\">\n" . | |
| 167 | + $oUnit->getName(); | |
| 168 | + } | |
| 169 | + | |
| 170 | +} | |
| 171 | + | |
| 172 | +// show button after group selected | |
| 173 | +function getAssignButton($oGroup) { | |
| 174 | + global $default; | |
| 175 | + if (!isset($oGroup)) { | |
| 176 | + return "<td align = right><input type=\"image\" src =\"$default->graphicsUrl/widgets/select.gif\" value=\"submit\" /></td>\n"; | |
| 177 | + } else { | |
| 178 | + return "<td align = right><input type=\"image\" src =\"$default->graphicsUrl/widgets/assign.gif\" value=\"submit\" /></td>\n"; | |
| 179 | + } | |
| 180 | +} | |
| 181 | +// show button after group selected | |
| 182 | +function getCancelButton($oGroup) { | |
| 183 | + global $default; | |
| 184 | + if (!isset($oGroup)) { | |
| 185 | + //return "<td align = right><a href=\"$default->rootUrl/control.php?action=groupManagement\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" value=\"cancel\" /></a></td>\n"; | |
| 186 | + } else { | |
| 187 | + return "<td align = right><a href=\"$default->rootUrl/control.php?action=assignGroupToUnit\"><img src =\"$default->graphicsUrl/widgets/cancel.gif\" border = \"0\" /></a></td>\n"; | |
| 188 | + } | |
| 189 | +} | |
| 190 | + | |
| 191 | + | |
| 192 | +?> | |
| 0 | 193 | \ No newline at end of file | ... | ... |