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


PHP Ticket_User::find方法代码示例

本文整理汇总了PHP中Ticket_User::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Ticket_User::find方法的具体用法?PHP Ticket_User::find怎么用?PHP Ticket_User::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ticket_User的用法示例。


在下文中一共展示了Ticket_User::find方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Ticket

            Event::log($_POST['tickets_id'], "ticket", 4, "tracking", $_SESSION["glpiname"] . " " . __('Deletion of an actor to the ticket'));
        }
    }
    Html::back();
} else {
    if (isset($_POST['update']) and $_POST['_users_id_assign'] > 0) {
        $assign_ticket_right = $_SESSION['glpiactiveprofile']['assign_ticket'];
        $_SESSION['glpiactiveprofile']['assign_ticket'] = 1;
        // Add
        $ticket = new Ticket();
        $input = array();
        $input['id'] = $_POST['tickets_id'];
        $input['_itil_assign'] = array('_type' => 'user', 'users_id' => $_POST['_users_id_assign']);
        $ticket->update($input);
        $ticket_user = new Ticket_User();
        $a_users = $ticket_user->find("`tickets_id`='" . $_POST['tickets_id'] . "'\n         AND `type`='2'");
        foreach ($a_users as $data) {
            if ($data['users_id'] != $_POST['_users_id_assign']) {
                $ticket_user->delete($data);
                Event::log($_POST['tickets_id'], "ticket", 4, "tracking", $_SESSION["glpiname"] . " " . __('Deletion of an actor to the ticket'));
            }
        }
        $_SESSION['glpiactiveprofile']['assign_ticket'] = $assign_ticket_right;
        Html::back();
    } else {
        if (isset($_POST['addgroup'])) {
            $peGroup_Group = new PluginEscalationGroup_Group();
            $peGroup_Group->add($_POST);
            Html::back();
        } else {
            if (isset($_POST['deleteitem'])) {
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:group_group.form.php

示例2: Ticket

 static function assign_me($tickets_id)
 {
     $tu = new Ticket_User();
     $found = $tu->find("`tickets_id` = '{$tickets_id}'\n                           AND `users_id` = '" . $_SESSION['glpiID'] . "'\n                           AND `type` = '" . CommonITILActor::ASSIGN . "'");
     if (empty($found)) {
         $ticket = new Ticket();
         $ticket->update(array('id' => $tickets_id, '_itil_assign' => array('users_id' => $_SESSION['glpiID'], '_type' => 'user')));
     }
 }
开发者ID:korial29,项目名称:escalade,代码行数:9,代码来源:ticket.class.php

示例3: 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

示例4: createSubTicket

 /**
  * 
  * @param type $items_id id of the ticket
  */
 static function createSubTicket($items_id)
 {
     global $CFG_GLPI;
     if ($_POST['slas_id'] == 0 || $_POST['groupsubticket'] == 0) {
         //         return;
     }
     $ticket = new Ticket();
     $ticketFollowup = new TicketFollowup();
     $ticketTask = new TicketTask();
     $document_Item = new Document_Item();
     $ticket_User = new Ticket_User();
     $group_Ticket = new Group_Ticket();
     // Disable send notification
     $use_mailing = $CFG_GLPI["use_mailing"];
     $CFG_GLPI["use_mailing"] = false;
     $ticket->getFromDB($items_id);
     unset($ticket->fields['id']);
     $ticket->fields['_link']['link'] = 1;
     $ticket->fields['_link']['tickets_id_1'] = 0;
     $ticket->fields['_link']['tickets_id_2'] = $items_id;
     $ticket->fields['bypassgrouponadd'] = true;
     $ticket->fields['slas_id'] = $_POST['slas_id'];
     $ticket->fields['date'] = date("Y-m-d H:i:s");
     $ticket->fields = Toolbox::addslashes_deep($ticket->fields);
     foreach ($ticket->fields as $key => $value) {
         if ($value == '') {
             unset($ticket->fields[$key]);
         }
     }
     $new_tickets_id = $ticket->add($ticket->fields);
     $a_followups = $ticketFollowup->find("`tickets_id`='" . $items_id . "'", "`id`");
     foreach ($a_followups as $data) {
         unset($data['id']);
         $data = Toolbox::addslashes_deep($data);
         $data['tickets_id'] = $new_tickets_id;
         $ticketFollowup->add($data);
     }
     $a_tasks = $ticketTask->find("`tickets_id`='" . $items_id . "'", "`id`");
     foreach ($a_tasks as $data) {
         unset($data['id']);
         $data = Toolbox::addslashes_deep($data);
         $data['tickets_id'] = $new_tickets_id;
         foreach ($data as $key => $value) {
             if ($value == '') {
                 unset($data[$key]);
             }
         }
         $ticketTask->add($data);
     }
     $a_documents = $document_Item->find("`items_id`='" . $items_id . "'\n         AND `itemtype`='Ticket'", "`id`");
     foreach ($a_documents as $data) {
         unset($data['id']);
         $data = Toolbox::addslashes_deep($data);
         $data['items_id'] = $new_tickets_id;
         $document_Item->add($data);
     }
     $a_ticketusers = $ticket_User->find("`tickets_id`='" . $items_id . "'\n         AND `type`='1'", "`id`");
     foreach ($a_ticketusers as $data) {
         unset($data['id']);
         $data = Toolbox::addslashes_deep($data);
         $data['tickets_id'] = $new_tickets_id;
         $ticket_User->add($data);
     }
     $a_ticketgroups = $group_Ticket->find("`tickets_id`='" . $items_id . "'\n         AND `type`='1'", "`id`");
     foreach ($a_ticketgroups as $data) {
         unset($data['id']);
         $data = Toolbox::addslashes_deep($data);
         $data['tickets_id'] = $new_tickets_id;
         $group_Ticket->add($data);
     }
     $CFG_GLPI["use_mailing"] = $use_mailing;
     $input = array();
     $input['tickets_id'] = $new_tickets_id;
     $input['groups_id'] = $_POST['groupsubticket'];
     $input['type'] = 2;
     $group_Ticket->add($input);
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:81,代码来源:ticketcopy.class.php

示例5: Ticket

 static function assign_me($tickets_id)
 {
     global $CFG_GLPI;
     $tu = new Ticket_User();
     $found = $tu->find("`tickets_id` = '{$tickets_id}' \n                           AND `users_id` = '" . $_SESSION['glpiID'] . "'\n                           AND `type` = '" . CommonITILActor::ASSIGN . "'");
     if (empty($found)) {
         $ticket = new Ticket();
         $ticket->update(array('id' => $tickets_id, '_itil_assign' => array('users_id' => $_SESSION['glpiID'], '_type' => 'user')));
     }
     Html::redirect($CFG_GLPI['root_doc'] . "/front/ticket.form.php?id={$tickets_id}");
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:11,代码来源:ticket.class.php


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