\n";
return $sToRender;
}
// if no group selected show selection fail page
function getPageNotSelected() {
global $default;
$sToRender .= renderHeading(_("Remove Group From Unit"));
$sToRender .= "
\n";
return $sToRender;
}
// show success page if removed from unit successfully
function getPageSuccess($iGroupID) {
global $default;
$sToRender .= renderHeading(_("Remove Group From Unit"));
$sToRender .= "
\n";
$sToRender .= "
" . _("Success") . "!
\n";
$sToRender .= "
\n";
$sToRender .= "
" . _("The Group was successfully removed from the Unit") . "
\n";
return $sToRender;
}
// show listbox of groups belonging to groups_units_link table
function getGroupDisplay($oGroup) {
global $default;
if (!isset($oGroup)) {
$oPatternListBox = & new PatternListBox($default->groups_table, "name", "id", "fGroupID");
if (Permission::userIsSystemAdministrator()) {
$default->log->info("getGroupDisplay sysadmin");
// if this is the system administrator, prepend group names with unit name
$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()) {
$default->log->info("getGroupDisplay unitadmin");
// else if this is a unit administrator, only display the groups in your unit
$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 unit details on confirm deletion page
function getUnitDisplay($oUnit) {
global $default;
if (!isset($oUnit)) {
//$oPatternListBox = & new PatternListBox($default->units_table, "name", "id", "fUnitID");
//$oPatternLiListBoxstBox->setPostBackOnChange(true);
//return $oPatternListBox->render();
} else {
return "iId . "\">\n" .
$oUnit->getName();
}
}
// show delete button or select button
function getDeleteButton($oGroup) {
global $default;
if (!isset($oGroup)) {
return "
\n";
} else {
return "
\n";
}
}
// show cancel button
function getCancelButton($oGroup) {
global $default;
if (!isset($oGroup)) {
return "