当前位置: 首页>>代码示例>>PHP>>正文


PHP CommonDBTM::countGroups方法代码示例

本文整理汇总了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)) {
开发者ID:glpi-project,项目名称:glpi,代码行数:67,代码来源:notificationtargetcommonitilobject.class.php

示例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)) {
开发者ID:geldarr,项目名称:hack-space,代码行数:67,代码来源:notificationtargetcommonitilobject.class.php


注:本文中的CommonDBTM::countGroups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。