本文整理汇总了PHP中CommonDBTM::countGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonDBTM::countGroups方法的具体用法?PHP CommonDBTM::countGroups怎么用?PHP CommonDBTM::countGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonDBTM
的用法示例。
在下文中一共展示了CommonDBTM::countGroups方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDatasForObject
//.........这里部分代码省略.........
$datas["##{$objettype}.openbyuser##"] = $user_tmp->getName();
}
$datas["##{$objettype}.lastupdater##"] = '';
if ($item->getField('users_id_lastupdater')) {
$user_tmp = new User();
$user_tmp->getFromDB($item->getField('users_id_lastupdater'));
$datas["##{$objettype}.lastupdater##"] = $user_tmp->getName();
}
$datas["##{$objettype}.assigntousers##"] = '';
if ($item->countUsers(CommonITILActor::ASSIGN)) {
$users = array();
foreach ($item->getUsers(CommonITILActor::ASSIGN) as $tmp) {
$uid = $tmp['users_id'];
$user_tmp = new User();
if ($user_tmp->getFromDB($uid)) {
$users[$uid] = $user_tmp->getName();
}
}
$datas["##{$objettype}.assigntousers##"] = implode(', ', $users);
}
$datas["##{$objettype}.assigntosupplier##"] = '';
if ($item->countSuppliers(CommonITILActor::ASSIGN)) {
$suppliers = array();
foreach ($item->getSuppliers(CommonITILActor::ASSIGN) as $tmp) {
$uid = $tmp['suppliers_id'];
$supplier_tmp = new Supplier();
if ($supplier_tmp->getFromDB($uid)) {
$suppliers[$uid] = $supplier_tmp->getName();
}
}
$datas["##{$objettype}.assigntosupplier##"] = implode(', ', $suppliers);
}
$datas["##{$objettype}.groups##"] = '';
if ($item->countGroups(CommonITILActor::REQUESTER)) {
$groups = array();
foreach ($item->getGroups(CommonITILActor::REQUESTER) as $tmp) {
$gid = $tmp['groups_id'];
$groups[$gid] = Dropdown::getDropdownName('glpi_groups', $gid);
}
$datas["##{$objettype}.groups##"] = implode(', ', $groups);
}
$datas["##{$objettype}.observergroups##"] = '';
if ($item->countGroups(CommonITILActor::OBSERVER)) {
$groups = array();
foreach ($item->getGroups(CommonITILActor::OBSERVER) as $tmp) {
$gid = $tmp['groups_id'];
$groups[$gid] = Dropdown::getDropdownName('glpi_groups', $gid);
}
$datas["##{$objettype}.observergroups##"] = implode(', ', $groups);
}
$datas["##{$objettype}.observerusers##"] = '';
if ($item->countUsers(CommonITILActor::OBSERVER)) {
$users = array();
foreach ($item->getUsers(CommonITILActor::OBSERVER) as $tmp) {
$uid = $tmp['users_id'];
$user_tmp = new User();
if ($uid && $user_tmp->getFromDB($uid)) {
$users[] = $user_tmp->getName();
} else {
$users[] = $tmp['alternative_email'];
}
}
$datas["##{$objettype}.observerusers##"] = implode(', ', $users);
}
$datas["##{$objettype}.assigntogroups##"] = '';
if ($item->countGroups(CommonITILActor::ASSIGN)) {
示例2: getDatasForObject
//.........这里部分代码省略.........
$datas["##{$objettype}.openbyuser##"] = $user_tmp->getName();
}
$datas["##{$objettype}.lastupdater##"] = '';
if ($item->getField('users_id_lastupdater')) {
$user_tmp = new User();
$user_tmp->getFromDB($item->getField('users_id_lastupdater'));
$datas["##{$objettype}.lastupdater##"] = $user_tmp->getName();
}
$datas["##{$objettype}.assigntousers##"] = '';
if ($item->countUsers(CommonITILActor::ASSIGN)) {
$users = array();
foreach ($item->getUsers(CommonITILActor::ASSIGN) as $tmp) {
$uid = $tmp['users_id'];
$user_tmp = new User();
if ($user_tmp->getFromDB($uid)) {
$users[$uid] = $user_tmp->getName();
}
}
$datas["##{$objettype}.assigntousers##"] = implode(', ', $users);
}
$datas["##{$objettype}.assigntosupplier##"] = '';
if ($item->countSuppliers(CommonITILActor::ASSIGN)) {
$suppliers = array();
foreach ($item->getSuppliers(CommonITILActor::ASSIGN) as $tmp) {
$uid = $tmp['suppliers_id'];
$supplier_tmp = new Supplier();
if ($supplier_tmp->getFromDB($uid)) {
$suppliers[$uid] = $supplier_tmp->getName();
}
}
$datas["##{$objettype}.assigntosupplier##"] = implode(', ', $suppliers);
}
$datas["##{$objettype}.groups##"] = '';
if ($item->countGroups(CommonITILActor::REQUESTER)) {
$groups = array();
foreach ($item->getGroups(CommonITILActor::REQUESTER) as $tmp) {
$gid = $tmp['groups_id'];
$groups[$gid] = Dropdown::getDropdownName('glpi_groups', $gid);
}
$datas["##{$objettype}.groups##"] = implode(', ', $groups);
}
$datas["##{$objettype}.observergroups##"] = '';
if ($item->countGroups(CommonITILActor::OBSERVER)) {
$groups = array();
foreach ($item->getGroups(CommonITILActor::OBSERVER) as $tmp) {
$gid = $tmp['groups_id'];
$groups[$gid] = Dropdown::getDropdownName('glpi_groups', $gid);
}
$datas["##{$objettype}.observergroups##"] = implode(', ', $groups);
}
$datas["##{$objettype}.observerusers##"] = '';
if ($item->countUsers(CommonITILActor::OBSERVER)) {
$users = array();
foreach ($item->getUsers(CommonITILActor::OBSERVER) as $tmp) {
$uid = $tmp['users_id'];
$user_tmp = new User();
if ($uid && $user_tmp->getFromDB($uid)) {
$users[] = $user_tmp->getName();
} else {
$users[] = $tmp['alternative_email'];
}
}
$datas["##{$objettype}.observerusers##"] = implode(', ', $users);
}
$datas["##{$objettype}.assigntogroups##"] = '';
if ($item->countGroups(CommonITILActor::ASSIGN)) {