Esempio n. 1
0
$pdf = new GroupsPdf($preferences);
// Set document information
$pdf->SetTitle($doc_title);
$pdf->showPagination();
$pdf->setMargins(10, 20);
$pdf->setHeaderMargin(10);
$pdf->SetAutoPageBreak(true, 20);
$pdf->Open();
$pdf->AddPage();
$pdf->PageHeader($doc_title);
$pdf->SetFont(Pdf::FONT, '', SHEET_FONT);
$pdf->SetTextColor(0, 0, 0);
$groups = new Groups();
$groups_list = null;
if (isset($_GET['gid'])) {
    $groups_list = $groups->getList(true, $_GET['gid']);
} else {
    $groups_list = $groups->getList();
}
//var_dump($groups_list);
$first = true;
foreach ($groups_list as $group) {
    $id = $group->getId();
    if (!$login->isGroupManager($id)) {
        Analog::log('Trying to display group ' . $id . ' without appropriate permissions', Analog::INFO);
        continue;
    }
    // Header
    if ($first === false) {
        $pdf->ln(5);
    }
Esempio n. 2
0
                //something went wrong :'(
                $error_detected[] = _T("An error occured while storing the group.");
            }
        }
    }
}
if (isset($_GET['new'])) {
    $group = new Group();
    $group->setName($_GET['group_name']);
    if (!$login->isSuperAdmin()) {
        $group->setManagers(new Adherent($login->id));
    }
    $group->store();
    $id = $group->getId();
}
$groups_root = $groups->getList(false);
$groups_list = $groups->getList();
if (count($error_detected) > 0) {
    $tpl->assign('error_detected', $error_detected);
}
if (count($success_detected) > 0) {
    $tpl->assign('success_detected', $success_detected);
}
$tpl->assign('require_dialog', true);
$tpl->assign('require_tabs', true);
$tpl->assign('require_tree', true);
$tpl->assign('page_title', _T("Groups"));
$tpl->assign('groups_root', $groups_root);
$tpl->assign('groups', $groups_list);
if ($id === null && count($groups_root) > 0) {
    $group = $groups_root[0];