\n";
return $sToRender;
}
// get page for removal
function getDeleteConfirmedPage($iUserID,$fGroupID) {
global $default;
$oUser = null;
$oGroup = null;
// change headings if User selected
if (isset($iUserID)) {
$oUser = User::get($iUserID);
$heading = "
" . _("Are you sure you wish to remove this user from the Group?") . "
";
}
// change headings if User selected
if (isset($fGroupID)) {
$oGroup = Group::get($fGroupID);
$Groupdisplay = "
\n";
return $sToRender;
}
// show listbox of Users belonging to Users_Groups_link table
function getUserDisplay($oUser) {
global $default;
if (!isset($oUser)) {
$oPatternListBox = & new PatternListBox($default->users_table, "username", "id", "fUserID");
if (Permission::userIsUnitAdministrator()) {
$oPatternListBox->setFromClause("INNER JOIN $default->users_groups_table UGL on ST.id=UGL.user_id " .
"INNER JOIN $default->groups_units_table GUL on UGL.group_id=GUL.group_id");
$oPatternListBox->setWhereClause("GUL.unit_id=" . User::getUnitID($_SESSION["userID"]));
}
$oPatternListBox->setPostBackOnChange(true);
return $oPatternListBox->render();
} else {
return "iId . "\">\n" .
$oUser->getUserName();
}
}
// display the listbox initially ..then just display the text
function getOtherGroupDisplay($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->groups_table, "name", "id", "fOtherGroupID");
$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->groups_table, "name", "id", "fOtherGroupID");
$oPatternListBox->setFromClause("INNER JOIN $default->groups_units_table GUL on ST.id=GUL.group_id");
$oPatternListBox->setWhereClause("GUL.unit_id=" . User::getUnitID($_SESSION["userID"]));
}
return $oPatternListBox->render();
} else {
return "iId . "\">\n" .
$oGroup->getName();
}
}
// show Group details on confirm deletion page
function getGroupDisplay($aGroup) {
global $default;
$sBgColor = "#F5F6EE";
$oGroup= null;
$sGroup = "
\n";
}
}
// show delete button or select button
function getSelectButton($oUser) {
global $default;
if (!isset($oUser)) {
return "graphicsUrl/widgets/select.gif\" value=\"submit\" border=\"0\"/>\n";
} else {
return "graphicsUrl/widgets/select.gif\" value=\"submit\" border=\"0\"/>\n";
}
}
// show cancel button
function getCancelButton($oUser) {
global $default;
if (!isset($oUser)) {
//return "