\n";
return $sToRender;
}
// show the list box when no group selected
// then shows a text box with the group's name
function getGroupDisplay($oGroup) {
global $default;
if (!isset($oGroup)) {
if (Permission::userIsSystemAdministrator()) {
// if this is the system administrator, prepend group names with unit name
$oPatternListBox = & new PatternListBox($default->owl_groups_table, "name", "id", "fGroupID");
$oPatternListBox->setFromClause("LEFT OUTER JOIN groups_units_link GUL on ST.id=GUL.group_id " .
"LEFT OUTER JOIN units_lookup UL on GUL.unit_id=UL.id");
$oPatternListBox->setCompositeDisplayName("DISTINCT COALESCE(CONCAT(CONCAT(UL.name, '-'),ST.name),ST.name)");
} else if (Permission::userIsUnitAdministrator()) {
// else if this is a unit administrator, only display the groups in your unit
$oPatternListBox = & new PatternListBox($default->owl_groups_table, "name", "id", "fGroupID");
$oPatternListBox->setFromClause("INNER JOIN $default->owl_groups_units_table GUL on ST.id=GUL.group_id");
$oPatternListBox->setWhereClause("GUL.unit_id=" . User::getUnitID($_SESSION["userID"]));
$oUnassignedUsersLB = & new PatternListBox($default->owl_groups_table, "name", "id", "fGroupID");
$oUnassignedUsersLB->setFromClause("LEFT OUTER JOIN $default->owl_groups_units_table GUL ON ST.id=GUL.group_id");
$oUnassignedUsersLB->setWhereClause("ISNULL(GUL.unit_id) AND ST.name <> 'Anonymous' AND ST.name <> 'System Administrators'");
$oPatternListBox->setAdditionalEntries($oUnassignedUsersLB->getEntries());
}
$oPatternListBox->setPostBackOnChange(true);
return $oPatternListBox->render();
} else {
return "iId . "\">\n" .
"getName() . "\">";
}
}
// returns the checkbox ticked or unticked
function getUnitAdminCheckBox($oGroup) {
if (!isset($oGroup)) {
return "";
} else {
return "getUnitAdmin() ? "CHECKED " : " ") . " />";
}
}
// returns the checkbox ticked or unticked
function getSysAdminCheckBox($oGroup) {
if (!isset($oGroup)) {
return "";
} else {
return "getSysAdmin() ? "CHECKED " : " ") . " />";
}
}
// gets the updatebutton when a group is selected
function getUpdateButton($oGroup) {
global $default;
if (!isset($oGroup)) {
return "Please select a group: ";
} else {
return "