\n"; $sToRender .= "\n"; $sToRender .= "" . _("Group Name") . ":\n"; $sToRender .= "\n"; $sToRender .= "\n"; $sToRender .= "\n"; $sToRender .= "" . _("Unit") . "" . getUnitListBox() . "\n"; $sToRender .= ""; $sToRender .= getCancelButton("listGroups") . "\n"; $sToRender .= "\n"; return $sToRender; } /** * Builds the unit selection list box */ function getUnitListBox() { global $default; if (Permission::userIsSystemAdministrator()) { // if this is the system administrator, show all the units $oPatternListBox = & new PatternListBox($default->units_table, "name", "id", "fUnitID"); } else if (Permission::userIsUnitAdministrator()) { // else if this is a unit administrator, only display the units you're an administrator for $oPatternListBox = & new PatternListBox($default->units_table, "name", "id", "fUnitID"); $oPatternListBox->setWhereClause("ST.id in (" . implode(",", User::getUnitIDs($_SESSION["userID"])) . ")"); } // javascript validation $sToRender .= "\n\n\n\n"; return $oPatternListBox->render() . $sToRender; } ?>