<?php if (module_config::c('ticket_allow_priority', 0)) { ?> <tr> <th class="width1"> <?php echo _l('Priority Support'); ?> </th> <td> <?php module_template::init_template('ticket_priority_support', '<em>New!</em> Need a <strong>fast</strong> reply? Priority support will place your ticket at the front of the support queue. <br/>Priority Support Cost: {COST}<br/>{CHECKBOX} <label for="do_priority">Yes, upgrade to <strong>priority support</strong> and move my ticket to position: {TICKET_POSITION}</label>', 'Displayed at the bottom of ticket support signup', 'code', array('cost' => 'Cost as defined by ticket_priority_code advanced setting', 'TICKET_POSITION' => 'displays the string (example) "1st out of 44"')); $template = module_template::get_template_by_key('ticket_priority_support'); $template->assign_values(array('cost' => dollar(module_config::c('ticket_priority_cost', 10), true, module_config::c('ticket_priority_currency', 1)), 'TICKET_POSITION' => _l('%s out of %s', ordinal(module_ticket::ticket_count('priority') + 1), $ticket['total_pending']), 'CHECKBOX' => '<input type="checkbox" name="do_priority" id="do_priority" value="1">')); echo $template->replace_content(); ?> </td> </tr> <?php } ?> <?php if (module_config::c('ticket_turn_around_days_show', 1)) { ?> <tr>
public function external_hook($hook) { switch ($hook) { case 'public': $faq_id = isset($_REQUEST['i']) ? (int) $_REQUEST['i'] : false; $hash = isset($_REQUEST['hash']) ? trim($_REQUEST['hash']) : false; if ($faq_id && $hash) { $correct_hash = $this->link_open_public($faq_id, true); if ($correct_hash == $hash) { $faq = array(); if ($faq_id > 0) { $faq = $this->get_faq($faq_id); } if ($faq) { $template = module_template::get_template_by_key('faq_item'); $faq['answer'] = self::html_faq($faq['answer']); $faq['faq_back'] = $this->link_open_public(-1) . (isset($_REQUEST['faq_product_id']) ? '&faq_product_id=' . (int) $_REQUEST['faq_product_id'] : ''); $template->assign_values($faq); $template->page_title = $faq['question']; echo $template->render('pretty_html'); } else { $template = module_template::get_template_by_key('faq_list'); $data = array(); ob_start(); include 'public/faq_listing.php'; $data['listing'] = ob_get_clean(); $template->assign_values($data); $template->page_title = _l('FAQ'); echo $template->render('pretty_html'); } } } break; case 'faq_list_json': @ob_end_clean(); header("Content-type: text/javascript"); $faq_id = isset($_REQUEST['faq_id']) ? (int) $_REQUEST['faq_id'] : false; if ($faq_id > 0) { $faq = $this->get_faq($faq_id); if ($faq) { $faq['url'] = module_faq::link_open_public($faq_id, false); echo json_encode($faq); /*$template = module_template::get_template_by_key('faq_item'); $faq['answer'] = forum_text($faq['answer']); $faq['faq_back'] = $this->link_open_public(-1).(isset($_REQUEST['faq_product_id']) ? '&faq_product_id='.(int)$_REQUEST['faq_product_id'] : ''); $template->assign_values($faq); $template->page_title = $faq['question']; echo $template->replace_content();*/ } exit; } $faq_product_id = isset($_REQUEST['faq_product_id']) ? (int) $_REQUEST['faq_product_id'] : false; $faq_search = isset($_REQUEST['faq_search']) ? $_REQUEST['faq_search'] : false; $faqs = $this->get_faqs(array('faq_product_id' => $faq_product_id, 'question' => $faq_search)); $faqs_json = array(); $all_products = module_faq::get_faq_products_rel(); foreach ($faqs as $faq) { $faq = module_faq::get_faq($faq['faq_id']); $faq_products = array(); foreach ($faq['faq_product_ids'] as $faq_product_id) { $faq_products[$faq_product_id] = $all_products[$faq_product_id]; } $faqs_json[$faq['faq_id']] = array('question' => $faq['question'], 'url' => module_faq::link_open_public($faq['faq_id'], false), 'products' => $faq_products); } echo json_encode($faqs_json); exit; break; case 'ticket_list': $faq_product_id = isset($_REQUEST['faq_product_id']) ? (int) $_REQUEST['faq_product_id'] : false; @ob_end_clean(); header("Content-type: text/javascript"); if ($faq_product_id) { $product = $this->get_faq_product($faq_product_id); // find the faq items that match this product id. if ($product && $product['faq_product_id'] == $faq_product_id) { $faqs = $this->get_faqs(array('faq_product_id' => $faq_product_id)); ob_start(); $x = 0; $half = ceil(count($faqs) / 2); ?> <tr> <th> <?php _e('FAQ'); ?> </th> <td> <?php _e('Please read through the below FAQ to see if the question has already been answered'); ?> </tr> <tr> <td colspan="2"> <table width="100%" class="tableclass tableclass_full table_faq_class"> <tbody> <tr> <td width="50%" valign="top"> <ul><?php for (true; $x < $half; $x++) { $data = array_shift($faqs); $faq = module_faq::get_faq($data['faq_id']); ?> <li> <a href="<?php echo module_faq::link_open_public($data['faq_id'], false); ?> " target="_blank"><?php echo htmlspecialchars($faq['question']); ?> </a> </li> <?php } ?> </ul> </td> <td width="50%" valign="top"> <ul><?php foreach ($faqs as $data) { $faq = module_faq::get_faq($data['faq_id']); ?> <li> <a href="<?php echo module_faq::link_open_public($data['faq_id'], false); ?> " target="_blank"><?php echo htmlspecialchars($faq['question']); ?> </a> </li> <?php } ?> </ul> </td> </tr> </tbody> </table> </td> </tr> <?php $html = preg_replace('#\\s+#', ' ', ob_get_clean()); ?> $('#faq_product_area').html('<?php echo addcslashes($html, "'"); ?> '); <?php if ($product['default_type_id']) { ?> $('#ticket_type_id').val(<?php echo (int) $product['default_type_id']; ?> ); <?php } // and now we have to set the ticket position. if (module_config::c('ticket_show_position', 1)) { $new_position = module_ticket::ticket_position(false, $faq_product_id); ?> $('#ticket_position_field').html('<?php echo addcslashes(_l('%s out of %s other support tickets', ordinal($new_position['current'] + 1), $new_position['total'] + 1), "'"); ?> '); <?php if (module_config::c('ticket_allow_priority', 0)) { $c = module_ticket::get_ticket_count($faq_product_id); ?> $('#priority_ticket_position').html('<?php _e('%s out of %s', ordinal($c['priority'] + 1), $new_position['total'] + 1); ?> '); <?php } } exit; } } ?> $('#faq_product_area').html(''); <?php if (module_config::c('ticket_show_position', 1)) { $new_position = module_ticket::ticket_position(); ?> $('#ticket_position_field').html('<?php echo addcslashes(_l('%s out of %s other support tickets', ordinal($new_position['current'] + 1), $new_position['total'] + 1), "'"); ?> '); <?php if (module_config::c('ticket_allow_priority', 0)) { ?> $('#priority_ticket_position').html('<?php _e('%s out of %s', ordinal(module_ticket::ticket_count('priority') + 1), $new_position['total'] + 1); ?> '); <?php } } break; } }
<tr> <th> <?php echo _l('Status'); ?> </th> <td> <?php //echo print_select_box(module_ticket::get_statuses(),'status_id',$ticket['status_id'],'',true,false,true); $s = module_ticket::get_statuses(); echo $s[$ticket['status_id']]; if ($ticket['status_id'] == 2 || $ticket['status_id'] == 3 || $ticket['status_id'] == 5) { if (module_config::c('ticket_show_position', 1)) { echo ' '; echo _l('(%s out of %s tickets)', ordinal($ticket['position']), module_ticket::ticket_count('pending')); } } ?> </td> </tr> </tbody> </table> <?php $fieldset_data = array('heading' => array('title' => _l('Ticket Details'), 'type' => 'h3'), 'elements_before' => ob_get_clean()); echo module_form::generate_fieldset($fieldset_data); unset($fieldset_data); if (file_exists(dirname(__FILE__) . '/../inc/ticket_priority_sidebar.php')) { include dirname(__FILE__) . '/../inc/ticket_priority_sidebar.php';