<?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 */ if (!$ticket_safe) { die('failed'); } $ticket_id = (int) $_REQUEST['ticket_id']; $ticket = module_ticket::get_ticket($ticket_id); if ($ticket['subject']) { $module->page_title = _l('Ticket: ' . htmlspecialchars($ticket['subject'])); } $admins_rel = module_ticket::get_ticket_staff_rel(); if (isset($admins_rel[module_security::get_loggedin_id()])) { $admins_rel[module_security::get_loggedin_id()] .= ' (me)'; } // work out if this user is an "administrator" or a "customer" // a user will have "edit" capabilities for tickets if they are an administrator // a user will only have "view" Capabilities for tickets if they are a "customer" // this will decide what options they have on the page (ie: assigning tickets to people) if ($ticket_id > 0 && $ticket && $ticket['ticket_id'] == $ticket_id) { if (class_exists('module_security', false)) { /*module_security::check_page(array( 'module' => $module->module_name,
if (is_array($updated_tickets)) { $autoreply_queue = array_merge($autoreply_queue, $updated_tickets); } } imap_errors(); //print_r($autoreply_queue); module_cache::clear('ticket'); foreach ($autoreply_queue as $ticket_id) { ob_start(); handle_hook('ticket_sidebar', $ticket_id); // to get envato hook working quicker ob_end_clean(); // we have to send the email to admin notifying them about this ticket too. // if this latest email came from an admin user (ie: the user is replying to a customer via email) // then we don't send_admin_alert or autoreply, we just send reply back to customer. $ticket_data = module_ticket::get_ticket($ticket_id); $last_ticket_message = module_ticket::get_ticket_message($ticket_data['last_ticket_message_id']); $admins_rel = module_ticket::get_ticket_staff_rel(); // if the last email was from admin, send customer alert. if (isset($admins_rel[$last_ticket_message['from_user_id']])) { // echo "sending a customer alert "; // print_r($last_ticket_message); module_ticket::send_customer_alert($ticket_id); } else { // last email must have been from a customer // alert the admin to it, and send an auto reply if the message is the first. module_ticket::send_admin_alert($ticket_id); //echo "Sent an alert to admin... sending autoreply..."; //print_r($ticket_data); //echo "<br><br>"; if (module_config::c('ticket_autoreply_every_message', 0) || $ticket_data['message_count'] <= 1) {
} if (class_exists('module_extra', false)) { $table_manager->display_extra('ticket', function ($ticket) { module_extra::print_table_data('ticket', $ticket['ticket_id']); }); } $table_manager->set_columns($columns); $time = time(); $today = strtotime(date('Y-m-d')); $table_manager->row_callback = function ($row_data) use($time, $today, $limit_time) { // load the full vendor data before displaying each row so we have access to more details /*if(class_exists('module_envato',false) && isset($_REQUEST['faq_product_envato_hack']) && (!$ticket['faq_product_id'] || $ticket['faq_product_id'] == $_REQUEST['faq_product_envato_hack'])){ }*/ $return = array(); if (isset($row_data['ticket_id']) && (int) $row_data['ticket_id'] > 0) { $return = module_ticket::get_ticket($row_data['ticket_id']); } $return['time'] = $time; $return['today'] = $today; $return['limit_time'] = $limit_time; return $return; }; $table_manager->set_rows($tickets); $table_manager->table_id = 'ticket_list'; $table_manager->table_class = $table_manager->table_class . ' '; //tbl_fixed // fixed width cells to stop overflowing. see ticket.css $table_manager->pagination = true; $table_manager->print_table(); ?> </form>
<th> <?php _e('Status'); ?> </th> </tr> </thead> <tbody> <tbody> <?php $c = 0; $time = time(); $today = strtotime(date('Y-m-d')); $seconds_into_today = $time - $today; $limit_time = strtotime('-' . module_config::c('ticket_turn_around_days', 5) . ' days', time()); while ($ticket = mysql_fetch_assoc($tickets)) { $ticket = module_ticket::get_ticket($ticket['ticket_id']); $ticket_ids[] = $ticket['ticket_id']; ?> <tr class="<?php echo $c++ % 2 ? "odd" : "even"; ?> "> <td class="row_action" nowrap=""> <?php echo module_ticket::link_open($ticket['ticket_id'], true, $ticket); ?> (<?php echo $ticket['message_count']; ?> ) </td>
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; }
<?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 */ $links = array(); if ((!isset($_GET['customer_id']) || !$_GET['customer_id']) && class_exists('module_faq', false) && (module_config::c('ticket_separate_product_queue', 0) || module_config::c('ticket_separate_product_menu', 0))) { $showing_ticket = false; if (isset($_GET['ticket_id']) && (int) $_GET['ticket_id'] > 0) { $ticket_data = module_ticket::get_ticket($_GET['ticket_id']); if ($ticket_data && $ticket_data['ticket_id'] == $_GET['ticket_id']) { $showing_ticket = true; $_REQUEST['faq_product_id'] = (int) $ticket_data['faq_product_id']; /* array_unshift($links,array( "name"=>_l('Ticket:')." <strong>".module_ticket::ticket_number($ticket_data['ticket_id']).'</strong>', 'm' => 'ticket', 'p' => 'ticket_admin', 'default_page' => 'ticket_admin_open', 'order' => 0, 'menu_include_parent' => 0, 'allow_nesting' => 0, 'current' => true, 'args'=>array( 'faq_product_id'=>false,