當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Group_User::getTable方法代碼示例

本文整理匯總了PHP中Group_User::getTable方法的典型用法代碼示例。如果您正苦於以下問題:PHP Group_User::getTable方法的具體用法?PHP Group_User::getTable怎麽用?PHP Group_User::getTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Group_User的用法示例。


在下文中一共展示了Group_User::getTable方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: notMultiple

 static function notMultiple($item)
 {
     if ($_SESSION['glpiactiveprofile']['interface'] == 'central') {
         $peConfig = new PluginEscalationConfig();
         $unique_assigned = $peConfig->getValue("unique_assigned", $item->fields['entities_id']);
         if ($unique_assigned == '1') {
             $ticket_User = new Ticket_User();
             $group_Ticket = new Group_Ticket();
             $group_User = new Group_User();
             if (isset($item->input['_itil_assign'])) {
                 if ($item->input['_itil_assign']['_type'] == 'user') {
                     $in_group = 0;
                     $a_groups = $group_Ticket->find("`type`='2'\n                     AND `tickets_id`='" . $item->fields['id'] . "'");
                     $groups = Group_User::getUserGroups($item->input['_itil_assign']['users_id']);
                     if (count($a_groups) > 0) {
                         foreach ($a_groups as $data) {
                             foreach ($groups as $dat) {
                                 if ($dat['id'] == $data['groups_id']) {
                                     $in_group = 1;
                                 }
                             }
                         }
                     }
                     //if ($in_group == '0') {
                     //   unset($item->input['_itil_assign']['users_id']);
                     //}
                 } else {
                     if ($item->input['_itil_assign']['_type'] == 'group') {
                         $a_groups = $group_Ticket->find("`type`='2'\n                     AND `tickets_id`='" . $item->getID() . "'");
                         if (count($a_groups) > 0) {
                             foreach ($a_groups as $data) {
                                 $group_Ticket->delete($data);
                             }
                         }
                         $a_users = $ticket_User->find("`type`='2'\n                     AND `tickets_id`='" . $item->getID() . "'");
                         foreach ($a_users as $data) {
                             if (countElementsInTable($group_User->getTable(), "`users_id`='" . $data['users_id'] . "'\n                             AND `groups_id`='" . $item->input['_itil_assign']['groups_id'] . "'") == '0') {
                                 $ticket_User->delete($data);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
開發者ID:geldarr,項目名稱:hack-space,代碼行數:46,代碼來源:group_group.class.php


注:本文中的Group_User::getTable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。