本文整理匯總了PHP中CommonDBTM::getGroups方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonDBTM::getGroups方法的具體用法?PHP CommonDBTM::getGroups怎麽用?PHP CommonDBTM::getGroups使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonDBTM
的用法示例。
在下文中一共展示了CommonDBTM::getGroups方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getDatasForObject
//.........這裏部分代碼省略.........
$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)) {
$groups = array();
foreach ($item->getGroups(CommonITILActor::ASSIGN) as $tmp) {
示例2: getDatasForObject
//.........這裏部分代碼省略.........
$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)) {
$groups = array();
foreach ($item->getGroups(CommonITILActor::ASSIGN) as $tmp) {