當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。