本文整理匯總了PHP中Group_User::getDataForGroup方法的典型用法代碼示例。如果您正苦於以下問題:PHP Group_User::getDataForGroup方法的具體用法?PHP Group_User::getDataForGroup怎麽用?PHP Group_User::getDataForGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Group_User
的用法示例。
在下文中一共展示了Group_User::getDataForGroup方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: pdfForGroup
static function pdfForGroup(PluginPdfSimplePDF $pdf, Group $group, $tree)
{
global $DB, $CFG_GLPI;
$used = array();
$ids = array();
// Retrieve member list
$entityrestrict = Group_User::getDataForGroup($group, $used, $ids, '', $tree);
$title = "<b>" . sprintf(__('%1$s (%2$s)'), _n('User', 'Users', 2) . "</b>", __('D=Dynamic'));
$number = count($used);
if ($number > $_SESSION['glpilist_limit']) {
$title = sprintf(__('%1$s (%2$s)'), $title, $_SESSION['glpilist_limit'] . "/" . $number);
} else {
$title = sprintf(__('%1$s (%2$s)'), $title, $number);
}
$pdf->setColumnsSize(100);
$pdf->displayTitle($title);
if ($number) {
$user = new User();
$group = new Group();
if ($tree) {
$pdf->setColumnsSize(35, 45, 10, 10);
$pdf->displayTitle(User::getTypeName(1), Group::getTypeName(1), __('Manager'), __('Delegatee'));
} else {
$pdf->setColumnsSize(60, 20, 20);
$pdf->displayTitle(User::getTypeName(1), __('Manager'), __('Delegatee'));
}
for ($i = 0; $i < $number && $i < $_SESSION['glpilist_limit']; $i++) {
$data = $used[$i];
$name = Html::clean(getUserName($data["id"]));
if ($data["is_dynamic"]) {
$name = sprintf(__('%1$s (%2$s)'), $name, '<b>' . __('D') . '</b>');
}
if ($tree) {
$group->getFromDB($data["groups_id"]);
$pdf->displayLine($name, $group->getName(), Dropdown::getYesNo($data['is_manager']), Dropdown::getYesNo($data['is_userdelegate']));
} else {
$pdf->displayLine($name, Dropdown::getYesNo($data['is_manager']), Dropdown::getYesNo($data['is_userdelegate']));
}
}
} else {
$pdf->setColumnsAlign('center');
$pdf->displayLine(__('No item found'));
}
$pdf->displaySpace();
}