Esempio n. 1
0
hook_handle_callback('layout_column_half', 1, '35');
/** TICKET DETAILS */
$responsive_summary = array();
$responsive_summary[] = '#' . module_ticket::ticket_number($ticket['ticket_id']);
if ($ticket['status_id'] == 2 || $ticket['status_id'] == 3 || $ticket['status_id'] == 5) {
    $responsive_summary[] = ordinal($ticket['position']);
}
$responsive_summary[] = htmlspecialchars($ticket['subject']);
$fieldset_data = array('heading' => array('title' => _l('Ticket Details'), 'type' => 'h3', 'responsive' => array('summary' => implode(', ', $responsive_summary))), 'elements' => array(array('title' => _l('Ticket Number'), 'fields' => array(function () use($ticket) {
    ?>

						<span class="ticket_status_<?php 
    echo (int) $ticket['status_id'];
    ?>
"><?php 
    echo module_ticket::ticket_number($ticket['ticket_id']);
    ?>
</span>
	                    <?php 
    if ($ticket['status_id'] == 2 || $ticket['status_id'] == 3 || $ticket['status_id'] == 5) {
        echo _l('(%s out of %s tickets)', ordinal($ticket['position']), $ticket['total_pending']);
    }
    ?>

	                    <input type="hidden" name="status_id" value="<?php 
    echo $ticket['status_id'];
    ?>
">
						<?php 
}))));
if ($ticket['last_message_timestamp']) {
     // do the ticket processing.
     // assign a new status?
     if ((int) $_SESSION['ticket_bulk_status_id'] > 0) {
         update_insert('ticket_id', $ticket_id, 'ticket', array('status_id' => $_SESSION['ticket_bulk_status_id']));
     }
     if ($_SESSION['ticket_bulk_send_message'] && $_SESSION['ticket_bulk_send_message_content']) {
         // send our reply! tricky!
         // who from? just like the admin is writing it I guess.
         // hack: so that the tickets do not loose their positions in the queue we want to keep the same 'last message' timestamp on the thread.
         $ticket_data = module_ticket::get_ticket($ticket_id);
         $from_user_id = $ticket_data['assigned_user_id'] ? $ticket_data['assigned_user_id'] : 1;
         // the <br> is a hack so that our script knows this is html.
         $message = $_SESSION['ticket_bulk_send_message_content'] . '<br><br>';
         // replace our values.
         $to_user = module_user::get_user($ticket_data['user_id'], false);
         $replace = array('name' => $to_user['name'], 'ticket_id' => module_ticket::ticket_number($ticket_id), 'ticket_url' => module_ticket::link_public($ticket_id), 'ticket_url_cancel' => module_ticket::link_public_status($ticket_id, 7), 'ticket_url_resolved' => module_ticket::link_public_status($ticket_id, 6), 'ticket_url_inprogress' => module_ticket::link_public_status($ticket_id, 5));
         foreach ($replace as $key => $val) {
             $message = str_replace('{' . strtoupper($key) . '}', $val, $message);
             $message = str_replace('{' . $key . '}', $val, $message);
         }
         $ticket_message_id = module_ticket::send_reply($ticket_id, $message, $from_user_id, $ticket_data['user_id'], 'admin');
         if ($ticket_message_id) {
             // success!
             // do the timestamp.
             update_insert('ticket_message_id', $ticket_message_id, 'ticket_message', array('message_time' => $ticket_data['last_message_timestamp'] + 1));
             update_insert('ticket_id', $ticket_id, 'ticket', array('last_message_timestamp' => $ticket_data['last_message_timestamp'] + 1));
         }
     }
     ?>
 <script type="text/javascript">
     window.parent.document.getElementById('ticket_<?php 
Esempio n. 3
0
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title><?php 
/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
_e('Ticket :');
?>
 <?php 
echo module_ticket::ticket_number($ticket_id);
?>
</title>

<link rel="stylesheet" href="<?php 
echo _BASE_HREF;
?>
css/styles.css?ver=5" type="text/css" />
<link rel="stylesheet" href="<?php 
echo _BASE_HREF;
?>
css/desktop.css?ver=5" type="text/css" />
<link type="text/css" href="<?php 
echo _BASE_HREF;
?>
css/smoothness/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" />
Esempio n. 4
0
 public static function hook_filter_generate_fieldset_options($callback_name, $fieldset_options)
 {
     if (is_array($fieldset_options) && isset($fieldset_options['id']) && $fieldset_options['id'] == 'quote_advanced') {
         $ticket_quote_rel_data = array();
         $customer_id = 0;
         // which customer to bring related quotes in from.
         if (isset($_REQUEST['ticket_id']) && (int) $_REQUEST['ticket_id'] > 0) {
             $ticket_data = module_ticket::get_ticket($_REQUEST['ticket_id'], false);
             if ($ticket_data && $ticket_data['ticket_id'] == $_REQUEST['ticket_id']) {
                 // we're creating a new quote linked to this particular ticket
                 $ticket_quote_rel_data[] = $ticket_data['ticket_id'];
                 $customer_id = $ticket_data['customer_id'];
             }
         }
         if (isset($_REQUEST['quote_id']) && (int) $_REQUEST['quote_id'] > 0) {
             // we're opening an existing quote, find any matching linked tickets.
             $quote_data = module_quote::get_quote($_REQUEST['quote_id']);
             if ($quote_data && $quote_data['quote_id'] == $_REQUEST['quote_id']) {
                 if ($quote_data['customer_id']) {
                     $customer_id = $quote_data['customer_id'];
                 }
                 // any existing ones from within the database?
                 $existing = get_multiple('ticket_quote_rel', array('quote_id' => $quote_data['quote_id']));
                 foreach ($existing as $e) {
                     if ($e['ticket_id']) {
                         $ticket_quote_rel_data[] = $e['ticket_id'];
                     }
                 }
             }
         }
         $select_values = array();
         if ($customer_id > 0) {
             $tickets = module_ticket::get_tickets(array('customer_id' => $customer_id));
             while ($row = mysql_fetch_assoc($tickets)) {
                 $select_values[$row['ticket_id']] = module_ticket::ticket_number($row['ticket_id']) . ' ' . substr($row['subject'], 0, 20) . '...';
             }
         }
         if (!count($ticket_quote_rel_data)) {
             $ticket_quote_rel_data = array(false);
         }
         $ticket_links = array();
         foreach ($ticket_quote_rel_data as $ticket_id) {
             if ($ticket_id > 0) {
                 $ticket_links[] = module_ticket::link_open($ticket_id, true);
             }
         }
         $fieldset_options['elements']['ticket_rel_ids'] = array('title' => 'Linked Tickets', 'fields' => array('<div id="ticket_rel_ids_holder">', array('type' => 'select', 'name' => 'ticket_rel_ids[]', 'options' => $select_values, 'multiple' => 'ticket_rel_ids_holder', 'values' => $ticket_quote_rel_data), '</div>', '<div>' . implode(' ', $ticket_links) . '</div>'));
     }
     return $fieldset_options;
 }