本文整理汇总了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();
}