• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Ticket类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Ticket的典型用法代码示例。如果您正苦于以下问题:PHP Ticket类的具体用法?PHP Ticket怎么用?PHP Ticket使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: validateTicket

 public function validateTicket(Ticket $ticket)
 {
     // this is all the numbers that has been matched for the ticket
     $numbers = [[], [], []];
     // this is the count of the different rows
     $rows = [0, 0, 0];
     // this is the array of the numbers that completed the different rows
     $winningNumbers = [0, 0, 0];
     // the number of rows completed
     $completedRows = 0;
     // the last row with a valid number
     $winningRow = 0;
     foreach ($this->drawnNumbers as $number) {
         $row = $ticket->getNumberRow($number);
         // number is located in a row in the ticket
         if (!is_null($row)) {
             $numbers[$row][] = $number;
             $winningRow = $row;
             if (++$rows[$row] == 5) {
                 $winningNumbers[$completedRows] = $number;
                 $completedRows++;
             }
         }
     }
     if ($completedRows >= $this->rows) {
         return ["win" => True, "numbers" => $numbers, "winningNumbers" => $winningNumbers, "winningRow" => $winningRow];
     } else {
         return ["win" => False, "numbers" => $numbers, "winningNumbers" => $winningNumbers, "winningRow" => $winningRow];
     }
 }
开发者ID:jorzhikgit,项目名称:bingo,代码行数:30,代码来源:Round.php


示例2: getallAction

 protected function getallAction()
 {
     $translate = $this->application->getBootstrap()->getResource('translate');
     $view = $this->application->getBootstrap()->getResource('view');
     $view->setScriptPath(APPLICATION_PATH . '/views/scripts');
     $acl = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('formacl');
     $queueticketObj = new Queueticket();
     $queueticketRows = $queueticketObj->fetchAll("ghost = false");
     foreach ($queueticketRows as $queueticketRow) {
         try {
             $mail = new Zend_Mail_Storage_Imap(array('host' => $queueticketRow['input_email_host'], 'user' => $queueticketRow['input_email_user'], 'password' => $queueticketRow['input_email_password']));
             for ($i = 1; $i <= $mail->countMessages(); $i++) {
                 $message = $mail->getMessage($i);
                 if (!$message->hasFlag(Zend_Mail_Storage::FLAG_SEEN)) {
                     $values = array('subject' => $message->subject, 'content' => $message->getContent(), 'priority' => substr($queueticketRow['available_priority'], 0, 1), 'state' => substr($queueticketRow['available_states'], 0, 1), 'start' => date("c"), 'id_queue' => $queueticketRow['id']);
                     $model = new Ticket();
                     $row = $model->createRow($values);
                     $row->save();
                     $mail->setFlags($i, array(Zend_Mail_Storage::FLAG_SEEN));
                 }
             }
         } catch (Exception $e) {
             print_r($e->getMessage());
         }
     }
 }
开发者ID:knatorski,项目名称:SMS,代码行数:26,代码来源:ticketgeter.php


示例3: afterAdd

 static function afterAdd(Group_Ticket $item)
 {
     global $DB;
     //Toolbox::logDebug(__METHOD__, $item);
     $config = PluginBehaviorsConfig::getInstance();
     if ($config->getField('add_notif')) {
         if ($item->getField('type') == CommonITILActor::ASSIGN) {
             $ticket = new Ticket();
             if ($ticket->getFromDB($item->getField('tickets_id'))) {
                 NotificationEvent::raiseEvent('plugin_behaviors_ticketnewgrp', $ticket);
             }
         }
     }
     // Check is the connected user is a tech
     if (!is_numeric(Session::getLoginUserID(false)) || !Session::haveRight('own_ticket', 1)) {
         return false;
         // No check
     }
     $config = PluginBehaviorsConfig::getInstance();
     if ($config->getField('single_tech_mode') != 0 && $item->input['type'] == CommonITILActor::ASSIGN) {
         $crit = array('tickets_id' => $item->input['tickets_id'], 'type' => CommonITILActor::ASSIGN);
         foreach ($DB->request('glpi_groups_tickets', $crit) as $data) {
             if ($data['id'] != $item->getID()) {
                 $gu = new Group_Ticket();
                 $gu->delete($data);
             }
         }
         if ($config->getField('single_tech_mode') == 2) {
             foreach ($DB->request('glpi_tickets_users', $crit) as $data) {
                 $gu = new Ticket_User();
                 $gu->delete($data);
             }
         }
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:35,代码来源:group_ticket.class.php


示例4: testCreateTicketWithActors

 /**
  * @dataProvider ticketProvider
  */
 public function testCreateTicketWithActors($ticketActors)
 {
     $ticket = new Ticket();
     $ticket->add(array('name' => 'ticket title', 'description' => 'a description') + $ticketActors);
     $this->assertFalse($ticket->isNewItem());
     $ticketId = $ticket->getID();
     foreach ($ticketActors as $actorType => $actorsList) {
         // Convert single actor (scalar value) to array
         if (!is_array($actorsList)) {
             $actorsList = array($actorsList);
         }
         // Check all actors are assigned to the ticket
         foreach ($actorsList as $index => $actor) {
             $notify = isset($actorList['_users_id_requester_notif']['use_notification'][$index]) ? $actorList['_users_id_requester_notif']['use_notification'][$index] : 1;
             $alternateEmail = isset($actorList['_users_id_requester_notif']['use_notification'][$index]) ? $actorList['_users_id_requester_notif']['alternative_email'][$index] : '';
             switch ($actorType) {
                 case '_users_id_assign':
                     $this->_testTicketUser($ticket, $actor, CommonITILActor::REQUESTER, $notify, $alternateEmail);
                     break;
                 case '_users_id_observer':
                     $this->_testTicketUser($ticket, $actor, CommonITILActor::OBSERVER, $notify, $alternateEmail);
                     break;
                 case '_users_id_assign':
                     $this->_testTicketUser($ticket, $actor, CommonITILActor::ASSIGN, $notify, $alternateEmail);
                     break;
             }
         }
     }
 }
开发者ID:glpi-project,项目名称:glpi,代码行数:32,代码来源:TicketTest.php


示例5: plugin_vip_item_delete

 static function plugin_vip_item_delete(Ticket $ticket)
 {
     global $DB;
     $ticketid = $ticket->getField('id');
     $delticketquery = "DELETE FROM glpi_plugin_vip_tickets\n\t\t\t\t\t\t\t\t WHERE id = " . $ticketid;
     $delvipticket = $DB->query($delticketquery);
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:7,代码来源:ticket.class.php


示例6: pdfForTicket

 static function pdfForTicket(PluginPdfSimplePDF $pdf, Ticket $ticket)
 {
     $survey = new TicketSatisfaction();
     $pdf->setColumnsSize(100);
     $pdf->displayTitle("<b>" . __('Satisfaction survey') . "</b>");
     if (!$survey->getFromDB($ticket->getID())) {
         $pdf->displayLine(__('No generated survey'));
     } else {
         if ($survey->getField('type') == 2) {
             $url = Entity::generateLinkSatisfaction($ticket);
             $pdf->displayLine(sprintf(__('%1$s (%2$s)'), __('External survey'), $url));
         } else {
             if ($survey->getField('date_answered')) {
                 $sat = $survey->getField('satisfaction');
                 $tabsat = array(0 => __('None'), 1 => __('1 star', 'pdf'), 2 => __('2 stars', 'pdf'), 3 => __('3 stars', 'pdf'), 4 => __('4 stars', 'pdf'), 5 => __('5 stars', 'pdf'));
                 if (isset($tabsat[$sat])) {
                     $sat = $tabsat[$sat] . "  ({$sat}/5)";
                 }
                 $pdf->displayLine('<b>' . sprintf(__('%1$s: %2$s'), __('Response date to the satisfaction survey') . '</b>', Html::convDateTime($survey->getField('date_answered'))));
                 $pdf->displayLine('<b>' . sprintf(__('%1$s: %2$s'), __('Satisfaction with the resolution of the ticket') . '</b>', $sat));
                 $pdf->displayText('<b>' . sprintf(__('%1$s: %2$s'), __('Comments') . '</b>', $survey->getField('comment')));
             } else {
                 // No answer
                 $pdf->displayLine(sprintf(__('%1$s: %2$s'), __('Creation date of the satisfaction survey'), Html::convDateTime($survey->getField('date_begin'))));
                 $pdf->displayLine(__('No answer', 'pdf'));
             }
         }
     }
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:30,代码来源:ticketsatisfaction.class.php


示例7: pdfForTicket

 static function pdfForTicket(PluginPdfSimplePDF $pdf, Ticket $job)
 {
     global $CFG_GLPI, $DB;
     $ID = $job->getField('id');
     //////////////followups///////////
     $query = "SELECT *\n                FROM `glpi_ticketcosts`\n                WHERE `tickets_id` = '{$ID}'\n                ORDER BY `begin_date`";
     $result = $DB->query($query);
     if (!$DB->numrows($result)) {
         $pdf->setColumnsSize(100);
         $pdf->displayLine(__('No ticket cost for this ticket', 'pdf'));
     } else {
         $pdf->setColumnsSize(60, 20, 20);
         $pdf->displayTitle("<b>" . TicketCost::getTypeName($DB->numrows($result)), __('Ticket duration'), CommonITILObject::getActionTime($job->fields['actiontime']) . "</b>");
         $pdf->setColumnsSize(20, 10, 10, 10, 10, 10, 10, 10, 10);
         $pdf->setColumnsAlign('center', 'center', 'center', 'left', 'right', 'right', 'right', 'right', 'right');
         $pdf->displayTitle("<b><i>" . __('Name') . "</i></b>", "<b><i>" . __('Begin date') . "</i></b>", "<b><i>" . __('End date') . "</i></b>", "<b><i>" . __('Budget') . "</i></b>", "<b><i>" . __('Duration') . "</i></b>", "<b><i>" . __('Time cost') . "</i></b>", "<b><i>" . __('Fixed cost') . "</i></b>", "<b><i>" . __('Material cost') . "</i></b>", "<b><i>" . __('Total cost') . "</i></b>");
         while ($data = $DB->fetch_array($result)) {
             $cost = TicketCost::computeTotalCost($data['actiontime'], $data['cost_time'], $data['cost_fixed'], $data['cost_material']);
             $pdf->displayLine($data['name'], Html::convDate($data['begin_date']), Html::convDate($data['end_date']), Dropdown::getDropdownName('glpi_budgets', $data['budgets_id']), CommonITILObject::getActionTime($data['actiontime']), Html::formatNumber($data['cost_time']), Html::formatNumber($data['cost_fixed']), Html::formatNumber($data['cost_material']), Html::formatNumber($cost));
             $total_time += $data['actiontime'];
             $total_costtime += $data['actiontime'] * $data['cost_time'] / HOUR_TIMESTAMP;
             $total_fixed += $data['cost_fixed'];
             $total_material += $data['cost_material'];
             $total += $cost;
         }
         $pdf->setColumnsSize(50, 10, 10, 10, 10, 10);
         $pdf->setColumnsAlign('right', 'right', 'right', 'right', 'right', 'right');
         $pdf->displayLine('<b>' . __('Total'), CommonITILObject::getActionTime($total_time), Html::formatNumber($total_costtime), Html::formatNumber($total_fixed), Html::formatNumber($total_material), Html::formatNumber($total));
     }
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:ticketcost.class.php


示例8: pdfForTicket

 static function pdfForTicket(PluginPdfSimplePDF $pdf, Ticket $ticket)
 {
     global $CFG_GLPI, $DB;
     $pdf->setColumnsSize(100);
     $pdf->displayTitle("<b>" . __('Approvals for the ticket') . "</b>");
     if (!Session::haveRight('validate_request', 1) && !Session::haveRight('validate_incident', 1) && !Session::haveRight('create_incident_validation', 1) && !Session::haveRight('create_request_validation', 1)) {
         return false;
     }
     $ID = $ticket->getField('id');
     $query = "SELECT *\n                FROM `glpi_ticketvalidations`\n                WHERE `tickets_id` = '" . $ticket->getField('id') . "'\n                ORDER BY submission_date DESC";
     $result = $DB->query($query);
     $number = $DB->numrows($result);
     if ($number) {
         $pdf->setColumnsSize(20, 19, 21, 19, 21);
         $pdf->displayTitle(_x('item', 'State'), __('Request date'), __('Approval requester'), __('Approval date'), __('Approver'));
         while ($row = $DB->fetch_assoc($result)) {
             $pdf->setColumnsSize(20, 19, 21, 19, 21);
             $pdf->displayLine(TicketValidation::getStatus($row['status']), Html::convDateTime($row["submission_date"]), getUserName($row["users_id"]), Html::convDateTime($row["validation_date"]), getUserName($row["users_id_validate"]));
             $tmp = trim($row["comment_submission"]);
             $pdf->displayText("<b><i>" . sprintf(__('%1$s: %2$s'), __('Request comments') . "</i></b>", empty($tmp) ? __('None') : $tmp, 1));
             if ($row["validation_date"]) {
                 $tmp = trim($row["comment_validation"]);
                 $pdf->displayText("<b><i>" . sprintf(__('%1$s: %2$s'), __('Approval comments') . "</i></b>", empty($tmp) ? __('None') : $tmp, 1));
             }
         }
     } else {
         $pdf->displayLine(__('No item found'));
     }
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:30,代码来源:ticketvalidation.class.php


示例9: loadCustomCssJs

    /**
     * Register custom CSS/JS for the page
     * @return void
     */
    public function loadCustomCssJs()
    {
        $html = $this->head['html'];
        parent::loadCustomCssJs();
        $this->head['html'] = $html;
        if (is_null($this->resourceArray['properties'])) {
            $this->resourceArray['properties'] = array();
        }
        $this->resourceArray['properties']['tickets'] = $this->resource->getProperties('tickets');
        /** @var Tickets $Tickets */
        $Tickets = $this->modx->getService('Tickets');
        $Tickets->loadManagerFiles($this, array('config' => true, 'utils' => true, 'css' => true, 'ticket' => true, 'comments' => true));
        $this->addLastJavascript($Tickets->config['jsUrl'] . 'mgr/ticket/update.js');
        $ready = array('xtype' => 'tickets-page-ticket-update', 'resource' => $this->resource->get('id'), 'record' => $this->resourceArray, 'publish_document' => (int) $this->canPublish, 'preview_url' => $this->previewUrl, 'locked' => (int) $this->locked, 'lockedText' => $this->lockedText, 'canSave' => (int) $this->canSave, 'canEdit' => (int) $this->canEdit, 'canCreate' => (int) $this->canCreate, 'canDuplicate' => (int) $this->canDuplicate, 'canDelete' => (int) $this->canDelete, 'show_tvs' => (int) (!empty($this->tvCounts)), 'mode' => 'update');
        $this->addHtml('
		<script type="text/javascript">
		// <![CDATA[
		MODx.config.publish_document = ' . (int) $this->canPublish . ';
		MODx.onDocFormRender = "' . $this->onDocFormRender . '";
		MODx.ctx = "' . $this->ctx . '";
		Ext.onReady(function() {
			MODx.load(' . $this->modx->toJSON($ready) . ');
		});
		// ]]>
		</script>');
    }
开发者ID:soulcreate,项目名称:Tickets,代码行数:30,代码来源:update.class.php


示例10: ticket_count

 function ticket_count()
 {
     $cc = new ConstraintChain();
     $cc->add(new Constraint('ticket_release_version_id', '=', $this->id));
     $ticket = new Ticket();
     $tickets = $ticket->getAll($cc);
     return count($tickets);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:8,代码来源:TicketReleaseVersion.php


示例11: post_addItem

 function post_addItem()
 {
     if ($this->fields['itemtype'] == 'Ticket') {
         $ticket = new Ticket();
         $ticket->update(array('id' => $this->fields['items_id'], 'date_mod' => $_SESSION["glpi_currenttime"], '_forcenotif' => true, '_donotadddocs' => true));
     }
     parent::post_addItem();
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:8,代码来源:document_item.class.php


示例12: afterUpdate

 static function afterUpdate(TicketSatisfaction $ticketsatisfaction)
 {
     $config = PluginBehaviorsConfig::getInstance();
     $ticket = new Ticket();
     if ($config->getField('add_notif') && $ticket->getFromDB($ticketsatisfaction->getField('tickets_id')) && $ticketsatisfaction->input["date_answered"]) {
         NotificationEvent::raiseEvent('plugin_behaviors_replysurvey', $ticket);
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:8,代码来源:ticketsatisfaction.class.php


示例13: garbage

 function garbage()
 {
     $deadline = date('Y-m-d H:i:s', time() - 24 * 60 * 60 * 5);
     // keep tickets for 5 days.
     App::import('model', 'Core.Ticket');
     $ticketObj = new Ticket();
     $data = $ticketObj->query('DELETE from tickets WHERE created < \'' . $deadline . '\'');
 }
开发者ID:jamiemill,项目名称:missioncontrol_core,代码行数:8,代码来源:tickets.php


示例14: reply_on_ticket

/**
* This function is beign used to reply on a ticket.
* It will first check if the user who executed this function is a mod/admin or the topic creator himself. If this is not the case the page will be redirected to an error page.
* in case the isset($_POST['hidden'] is set and the user is a mod, the message will be hidden for the topic starter. The reply will be created. If $_POST['ChangeStatus']) & $_POST['ChangePriority'] is set
* it will try to update the status and priority. Afterwards the page is being redirecte to the ticket again.
* @author Daan Janssens, mentored by Matthew Lagoe
*/
function reply_on_ticket()
{
    global $INGAME_WEBPATH;
    global $WEBPATH;
    //if logged in
    if (WebUsers::isLoggedIn() && isset($_POST['ticket_id'])) {
        $ticket_id = filter_var($_POST['ticket_id'], FILTER_SANITIZE_NUMBER_INT);
        $target_ticket = new Ticket();
        $target_ticket->load_With_TId($ticket_id);
        //check if the user who executed this function is a mod/admin or the topic creator himself.
        if ($target_ticket->getAuthor() == unserialize($_SESSION['ticket_user'])->getTUserId() || Ticket_User::isMod(unserialize($_SESSION['ticket_user']))) {
            try {
                $author = unserialize($_SESSION['ticket_user'])->getTUserId();
                if (isset($_POST['Content'])) {
                    $content = $_POST['Content'];
                } else {
                    $content = "";
                }
                $hidden = 0;
                if (isset($_POST['hidden']) && Ticket_User::isMod(unserialize($_SESSION['ticket_user']))) {
                    $hidden = 1;
                }
                //create the reply
                Ticket::createReply($content, $author, $ticket_id, $hidden);
                //try to update the status & priority in case these are set.
                if (isset($_POST['ChangeStatus']) && isset($_POST['ChangePriority']) && Ticket_User::isMod(unserialize($_SESSION['ticket_user']))) {
                    $newStatus = filter_var($_POST['ChangeStatus'], FILTER_SANITIZE_NUMBER_INT);
                    $newPriority = filter_var($_POST['ChangePriority'], FILTER_SANITIZE_NUMBER_INT);
                    Ticket::updateTicketStatusAndPriority($ticket_id, $newStatus, $newPriority, $author);
                }
                header("Cache-Control: max-age=1");
                if (Helpers::check_if_game_client()) {
                    header("Location: " . $INGAME_WEBPATH . "?page=show_ticket&id=" . $ticket_id);
                } else {
                    header("Location: " . $WEBPATH . "?page=show_ticket&id=" . $ticket_id);
                }
                throw new SystemExit();
            } catch (PDOException $e) {
                //ERROR: LIB DB is not online!
                print_r($e);
                //header("Location: index.php");
                throw new SystemExit();
            }
        } else {
            //ERROR: No access!
            $_SESSION['error_code'] = "403";
            header("Cache-Control: max-age=1");
            header("Location: index.php?page=error");
            throw new SystemExit();
        }
    } else {
        //ERROR: not logged in!
        header("Cache-Control: max-age=1");
        header("Location: index.php");
        throw new SystemExit();
    }
}
开发者ID:cls1991,项目名称:ryzomcore,代码行数:64,代码来源:reply_on_ticket.php


示例15: afterPurge

 static function afterPurge(Document_Item $document_item)
 {
     $config = PluginBehaviorsConfig::getInstance();
     if ($config->getField('add_notif') && $document_item->fields['itemtype'] == 'Ticket' && isset($_POST['item'])) {
         // prevent not use in case of purge ticket
         $ticket = new Ticket();
         $ticket->getFromDB($document_item->fields['items_id']);
         NotificationEvent::raiseEvent('plugin_behaviors_document_itemdel', $ticket);
     }
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:10,代码来源:document_item.class.php


示例16: update

 public function update()
 {
     $q = "UPDATE messages SET text = '" . DB::esc($this->text) . "', modified = '" . date('Y-m-d G:i:s') . "', updated = 1\n              WHERE id = " . DB::esc($this->id);
     $res = DB::query($q);
     if (!$res) {
         throw new Exception(DB::getMySQLiObject()->error);
     }
     $ticket = new Ticket(array('message_id' => DB::esc($this->id), 'text' => DB::esc($this->text)));
     $ticket->updateText();
 }
开发者ID:JJWTimmer,项目名称:BLAM,代码行数:10,代码来源:Message.class.php


示例17: post_addItem

 function post_addItem()
 {
     $t = new Ticket();
     $no_stat_computation = true;
     if ($this->input['type'] == Ticket::ASSIGN) {
         $no_stat_computation = false;
     }
     $t->updateDateMod($this->fields['tickets_id'], $no_stat_computation);
     parent::post_addItem();
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:10,代码来源:group_ticket.class.php


示例18: process

 public function process()
 {
     if (!($data = $this->handleFile())) {
         return $this->failure($this->modx->lexicon('ticket_err_file_ns'));
     }
     $properties = $this->mediaSource->getPropertyList();
     $tmp = explode('.', $data['name']);
     $extension = strtolower(end($tmp));
     $image_extensions = $allowed_extensions = array();
     if (!empty($properties['imageExtensions'])) {
         $image_extensions = array_map('trim', explode(',', strtolower($properties['imageExtensions'])));
     }
     if (!empty($properties['allowedFileTypes'])) {
         $allowed_extensions = array_map('trim', explode(',', strtolower($properties['allowedFileTypes'])));
     }
     if (!empty($allowed_extensions) && !in_array($extension, $allowed_extensions)) {
         return $this->failure($this->modx->lexicon('ticket_err_file_ext'));
     } elseif (in_array($extension, $image_extensions)) {
         $type = 'image';
     } else {
         $type = $extension;
     }
     $hash = sha1($data['stream']);
     $path = '0/';
     $filename = !empty($properties['imageNameType']) && $properties['imageNameType'] == 'friendly' ? $this->ticket->cleanAlias($data['name']) : $hash . '.' . $extension;
     if (strpos($filename, '.' . $extension) === false) {
         $filename .= '.' . $extension;
     }
     // Check for existing file
     $where = $this->modx->newQuery($this->classKey, array('class' => $this->class));
     if (!empty($this->ticket->id)) {
         $where->andCondition(array('parent:IN' => array(0, $this->ticket->id)));
     } else {
         $where->andCondition(array('parent' => 0));
     }
     $where->andCondition(array('file' => $filename, 'OR:hash:=' => $hash), null, 1);
     if ($this->modx->getCount($this->classKey, $where)) {
         return $this->failure($this->modx->lexicon('ticket_err_file_exists', array('file' => $data['name'])));
     }
     /* @var TicketFile $ticket_file */
     $ticket_file = $this->modx->newObject('TicketFile', array('parent' => 0, 'name' => $data['name'], 'file' => $filename, 'path' => $path, 'source' => $this->mediaSource->id, 'type' => $type, 'createdon' => date('Y-m-d H:i:s'), 'createdby' => $this->modx->user->id, 'deleted' => 0, 'hash' => $hash, 'size' => $data['size'], 'class' => $this->class, 'properties' => $data['properties']));
     $this->mediaSource->createContainer($ticket_file->path, '/');
     unset($this->mediaSource->errors['file']);
     $file = $this->mediaSource->createObject($ticket_file->get('path'), $ticket_file->get('file'), $data['stream']);
     if ($file) {
         $url = $this->mediaSource->getObjectUrl($ticket_file->get('path') . $ticket_file->get('file'));
         $ticket_file->set('url', $url);
         $ticket_file->save();
         $ticket_file->generateThumbnail($this->mediaSource);
         return $this->success('', $ticket_file->toArray());
     } else {
         $this->modx->log(modX::LOG_LEVEL_ERROR, '[Tickets] Could not save file: ' . print_r($this->mediaSource->getErrors(), 1));
         return $this->failure($this->modx->lexicon('ticket_err_file_save'));
     }
 }
开发者ID:soulcreate,项目名称:Tickets,代码行数:55,代码来源:upload.class.php


示例19: formatAlertContent

 private function formatAlertContent(Ticket $ticket, $time)
 {/*{{{*/
     $inspector = $ticket->getInspector();
     $leaderName = '';
     if (false == $inspector->isLeader() && false == $ticket->getInspectGroup()->getLeader()->isNull())
     {
         $leader = $ticket->getInspectGroup()->getLeader();
         $leaderName = ", 组长: ".$leader->realName;
     }
     return $inspector->realName."(".$ticket->getInspectGroup()->displayName.") ".get_class($ticket->source).": {$ticket->source->id} {$time}分钟".$leaderName.";\n";
 }/*}}}*/
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:11,代码来源:inspect.php


示例20: pdfForTicket

 static function pdfForTicket(PluginPdfSimplePDF $pdf, Ticket $job, $private)
 {
     global $CFG_GLPI, $DB;
     $ID = $job->getField('id');
     //////////////Tasks///////////
     $RESTRICT = "";
     if (!$private) {
         // Don't show private'
         $RESTRICT = " AND `is_private` = '0' ";
     } else {
         if (!Session::haveRight("show_full_ticket", "1")) {
             // No right, only show connected user private one
             $RESTRICT = " AND (`is_private` = '0'\n                          OR `users_id` ='" . Session::getLoginUserID() . "' ) ";
         }
     }
     $query = "SELECT *\n                FROM `glpi_tickettasks`\n                WHERE `tickets_id` = '{$ID}'\n                      {$RESTRICT}\n                ORDER BY `date` DESC";
     $result = $DB->query($query);
     if (!$DB->numrows($result)) {
         $pdf->setColumnsSize(100);
         $pdf->displayLine(__('No task found.'));
     } else {
         $pdf->displayTitle("<b>" . TicketTask::getTypeName($DB->numrows($result) . "</b>"));
         $pdf->setColumnsSize(20, 20, 20, 20, 20);
         $pdf->displayTitle("<b><i>" . __('Type') . "</i></b>", "<b><i>" . __('Date') . "</i></b>", "<b><i>" . __('Duration') . "</i></b>", "<b><i>" . __('Writer') . "</i></b>", "<b><i>" . __('Planning') . "</i></b>");
         while ($data = $DB->fetch_array($result)) {
             $actiontime = Html::timestampToString($data['actiontime'], false);
             $planification = '';
             if (empty($data['begin'])) {
                 if (isset($data["state"])) {
                     $planification = Planning::getState($data["state"]) . "<br>";
                 }
                 $planification .= _e('None');
             } else {
                 if (isset($data["state"])) {
                     $planification = sprintf(__('%1$s: %2$s'), _x('item', 'State'), Planning::getState($data["state"]));
                 }
                 $planificiation = sprintf(__('%1$s - %2$s'), $planification, Html::convDateTime($data["begin"]) . " -> " . Html::convDateTime($data["end"]));
                 $planificiation = sprintf(__('%1$s - %2$s'), $planification, sprintf(__('%1$s  %2$s'), __('By'), getUserName($data["users_id_tech"])));
             }
             if ($data['taskcategories_id']) {
                 $lib = Dropdown::getDropdownName('glpi_taskcategories', $data['taskcategories_id']);
             } else {
                 $lib = '';
             }
             if ($data['is_private']) {
                 $lib = sprintf(__('%1$s (%2$s)'), $lib, __('Private'));
             }
             toolbox::logdebug("lib", $data);
             $pdf->displayLine(Html::clean($lib), Html::convDateTime($data["date"]), Html::timestampToString($data["actiontime"], 0), Html::clean(getUserName($data["users_id"])), Html::clean($planification), 1);
             $pdf->displayText("<b><i>" . sprintf(__('%1$s: %2$s'), __('Description') . "</i></b>", Html::clean($data["content"]), 1));
         }
     }
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:54,代码来源:tickettask.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP TicketValidation类代码示例发布时间:2022-05-23
下一篇:
PHP Thumbnail类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap