} else { // user not assigned to a customer. } } echo print_select_box($c, 'change_user_id', $ticket['user_id']); } else { // if ($create_user['customer_id']) { echo module_user::link_open_contact($ticket['user_id'], true, array(), true); } else { echo module_user::link_open($ticket['user_id'], true, array(), true); } echo ' ' . htmlspecialchars($create_user['email']); } })); $fieldset_data['elements'][] = array('title' => _l('Type/Department'), 'fields' => array(array('type' => 'select', 'name' => 'ticket_type_id', 'value' => $ticket['ticket_type_id'], 'options' => module_ticket::get_types(), 'blank' => module_ticket::can_edit_tickets(), 'options_array_id' => 'name'))); if (class_exists('module_faq', false) && module_config::c('ticket_faq_link', 1) && module_faq::get_faq_products() > 0) { $fieldset_data['elements'][] = array('title' => _l('Product'), 'fields' => array(function () use($ticket, $ticket_id) { if (module_ticket::can_edit_tickets()) { echo print_select_box(module_faq::get_faq_products_rel(), 'faq_product_id', $ticket['faq_product_id']); _h('Use this to link a ticket to a product. Set products in Settings > FAQ. This allows you to have different FAQ items for different products. Users are shown the FAQ items before submitting a support ticket.'); } else { echo friendly_key(module_faq::get_faq_products_rel(), $ticket['faq_product_id']); } // show a button that does a jquery popup with the list of faq items and an option to create new one. //if(module_faq::can_i('edit','FAQ')){ echo ' '; echo popup_link('<a href="' . module_faq::link_open_list($ticket['faq_product_id']) . '">' . _l('FAQ') . '</a>', array('force' => true, 'width' => 1100, 'height' => 600)); //} })); } if (module_config::c('ticket_support_accounts', 1) && module_ticket::get_accounts_rel()) {
<?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 (!module_config::can_i('view', 'Settings') || !module_faq::can_i('edit', 'FAQ')) { redirect_browser(_BASE_HREF); } $faq_products = module_faq::get_faq_products(); $types = module_ticket::get_types(); if (class_exists('module_envato', false)) { $all_items_rel = module_envato::get_envato_items_rel(); } if (isset($_REQUEST['faq_product_id']) && $_REQUEST['faq_product_id']) { $show_other_settings = false; $faq_product_id = (int) $_REQUEST['faq_product_id']; if ($faq_product_id > 0) { $faq_product = module_faq::get_faq_product($faq_product_id); } else { $faq_product = array(); } if (!$faq_product) { $faq_product = array('name' => '', 'envato_item_ids' => '', 'default_type_id' => ''); } ?>
<form action="" method="<?php echo _DEFAULT_FORM_METHOD; ?> "> <input type="hidden" name="customer_id" value="<?php echo isset($_REQUEST['customer_id']) ? (int) $_REQUEST['customer_id'] : ''; ?> "> <?php module_form::print_form_auth(); $search_bar = array('elements' => array('ticket_id' => array('title' => _l('Number:'), 'field' => array('type' => 'text', 'name' => 'search[ticket_id]', 'value' => isset($search['ticket_id']) ? $search['ticket_id'] : '', 'size' => 5)), 'name' => array('title' => _l('Subject:'), 'field' => array('type' => 'text', 'name' => 'search[generic]', 'value' => isset($search['generic']) ? $search['generic'] : '', 'size' => 10)), 'ticket_content' => array('title' => _l('Message:'), 'field' => array('type' => 'text', 'name' => 'search[ticket_content]', 'value' => isset($search['ticket_content']) ? $search['ticket_content'] : '', 'size' => 10)), 'contact' => array('title' => _l('Contact:'), 'field' => array('type' => 'text', 'name' => 'search[contact]', 'value' => isset($search['contact']) ? $search['contact'] : '', 'size' => 10)), 'date' => array('title' => _l('Date:'), 'fields' => array(array('type' => 'date', 'name' => 'search[date_from]', 'value' => isset($search['date_from']) ? $search['date_from'] : ''), _l('to'), array('type' => 'date', 'name' => 'search[date_to]', 'value' => isset($search['date_to']) ? $search['date_to'] : ''))), 'type' => array('title' => _l('Type:'), 'field' => array('type' => 'select', 'name' => 'search[ticket_type_id]', 'value' => isset($search['ticket_type_id']) ? $search['ticket_type_id'] : '', 'options' => module_ticket::get_types(), 'options_array_id' => 'name')), 'Status' => array('title' => _l('Status:'), 'field' => array('type' => 'select', 'name' => 'search[status_id]', 'value' => isset($search['status_id']) ? $search['status_id'] : '', 'options' => $search_statuses, 'blank' => _l('All'))), 'Priority' => array('title' => _l('Priority:'), 'field' => array('type' => 'select', 'name' => 'search[priority]', 'value' => isset($search['priority']) ? $search['priority'] : '', 'options' => module_ticket::get_ticket_priorities())), 'Staff' => array('title' => _l('Staff:'), 'field' => array('type' => 'select', 'name' => 'search[assigned_user_id]', 'value' => isset($search['assigned_user_id']) ? $search['assigned_user_id'] : '', 'options' => module_ticket::get_ticket_staff_rel())))); if (class_exists('module_faq', false) && module_config::c('ticket_show_product_list', 1)) { $search_bar['elements']['Product'] = array('title' => _l('Product:'), 'field' => array('type' => 'select', 'name' => 'search[faq_product_id]', 'value' => isset($search['faq_product_id']) ? $search['faq_product_id'] : '', 'options' => module_faq::get_faq_products_rel())); } if (class_exists('module_envato', false)) { $search_bar['elements']['envato'] = array('title' => _l('Envato:'), 'field' => array('type' => 'select', 'name' => 'search[envato_item_id]', 'value' => isset($search['envato_item_id']) ? $search['envato_item_id'] : '', 'options' => array(-1 => 'No product') + module_envato::get_envato_items_rel())); } echo module_form::search_bar($search_bar); if (class_exists('module_envato', false) && module_config::c('envato_show_ticket_earning', 0)) { $item_ticket_count = array(); $envato_count = module_cache::get('ticket', 'envato_ticket_earning'); //if($envato_count===false){ while ($ticket = mysql_fetch_assoc($tickets)) { $items = module_envato::get_items_by_ticket($ticket['ticket_id']); if (count($items)) { foreach ($items as $item_id => $item) {
public static function api_filter_faq($hook, $response, $endpoint, $method) { $response['faq'] = true; switch ($method) { case 'list_products': $faq_products = module_faq::get_faq_products(); $types = module_ticket::get_types(); if (class_exists('module_envato', false)) { $all_items = module_envato::get_envato_items(); $all_items_rel = array(); foreach ($all_items as $all_item) { $all_items_rel[$all_item['item_id']] = $all_item; } } foreach ($faq_products as $faq_product_id => $faq_product) { $faq_products[$faq_product_id]['default_type'] = isset($types[$faq_product['default_type_id']]) ? $types[$faq_product['default_type_id']] : false; if (class_exists('module_envato', false)) { $linked_items = explode('|', $faq_product['envato_item_ids']); foreach ($linked_items as $id => $linked_item) { if (!strlen(trim($linked_item))) { unset($linked_items[$id]); } if (isset($all_items_rel[$linked_item])) { $linked_items[$id] = $all_items_rel[$linked_item]; } } $faq_products[$faq_product_id]['envato_items'] = $linked_items; } } $response['faq_products'] = $faq_products; break; } return $response; }
?> <input type="text" name="search[date_to]" value="<?php echo isset($search['date_to']) ? htmlspecialchars($search['date_to']) : ''; ?> " class="date_field"> </td> <td width="30"> <?php echo _l('Type:'); ?> </td> <td> <?php echo print_select_box(module_ticket::get_types(), 'search[ticket_type_id]', isset($search['ticket_type_id']) ? $search['ticket_type_id'] : ''); ?> </td> <td width="30"> <?php echo _l('Status:'); ?> </td> <td> <?php echo print_select_box($search_statuses, 'search[status_id]', isset($search['status_id']) ? $search['status_id'] : ''); ?> </td>
<table border="0" cellspacing="0" cellpadding="2" class="tableclass tableclass_form tableclass_full"> <tbody> <?php if (module_config::c('ticket_public_show_type_dropdown', 1)) { ?> <tr> <th> <?php _e('Type/Department'); ?> </th> <td> <?php $types = module_ticket::get_types(true); echo print_select_box($types, 'ticket_type_id', isset($_REQUEST['ticket_type_id']) && isset($types[$_REQUEST['ticket_type_id']]) ? $_REQUEST['ticket_type_id'] : $ticket_account['default_type'], '', false, 'name'); ?> </td> </tr> <?php } ?> <?php if (module_config::c('ticket_allow_priority_selection', 0)) { $priorities = module_ticket::get_ticket_priorities(); if (isset($priorities[_TICKET_PRIORITY_STATUS_ID])) { unset($priorities[_TICKET_PRIORITY_STATUS_ID]); }
<?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 (!module_config::can_i('view', 'Settings')) { redirect_browser(_BASE_HREF); } $ticket_types = module_ticket::get_types(false); if (isset($_REQUEST['ticket_type_id']) && $_REQUEST['ticket_type_id']) { $show_other_settings = false; $ticket_type_id = (int) $_REQUEST['ticket_type_id']; if ($ticket_type_id > 0) { $ticket_type = module_ticket::get_ticket_type($ticket_type_id); } else { $ticket_type = array(); } if (!$ticket_type) { $ticket_type = array('name' => '', 'public' => '1', 'default_user_id' => 0); } ?> <form action="" method="post"> <input type="hidden" name="_process" value="save_ticket_type">
?> <form action="" method="post"> <input type="hidden" name="_process" value="save_faq"> <input type="hidden" name="faq_id" value="<?php echo $faq_id; ?> " /> <?php $fieldset_data = array('heading' => array('type' => 'h3', 'title' => 'Edit FAQ'), 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array()); $fieldset_data['elements'][] = array('title' => 'Question', 'fields' => array(array('type' => 'text', 'name' => 'question', 'value' => $faq['question']))); $fieldset_data['elements'][] = array('title' => 'Answer', 'fields' => array(array('type' => 'wysiwyg', 'name' => 'answer', 'value' => $faq['answer']))); $fieldset_data['elements'][] = array('title' => 'Linked Products', 'fields' => array(function () use($faq) { $default_types = module_ticket::get_types(); foreach (module_faq::get_faq_products_rel() as $faq_product_id => $product_name) { $faq_product = module_faq::get_faq_product($faq_product_id); ?> <div> <input type="checkbox" name="faq_product_ids[]" value="<?php echo $faq_product_id; ?> " id="multi_<?php echo $faq_product_id; ?> " <?php echo in_array($faq_product_id, $faq['faq_product_ids']) ? ' checked' : ''; ?> > <label for="multi_<?php
<?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 (!module_config::can_i('view', 'Settings')) { redirect_browser(_BASE_HREF); } $c = array(); $customers = module_customer::get_customers(); foreach ($customers as $customer) { $c[$customer['customer_id']] = $customer['customer_name']; } $pop3imap_accounts = array(); foreach (module_ticket::get_accounts() as $account) { $pop3imap_accounts[$account['ticket_account_id']] = $account['name']; } module_config::print_settings_form(array('heading' => array('title' => 'Ticket Settings', 'type' => 'h2', 'main' => true), 'settings' => array(array('key' => 'ticket_show_summary', 'default' => 1, 'type' => 'checkbox', 'description' => 'Show unread ticket count in the menu item.'), array('key' => 'ticket_recaptcha', 'default' => 1, 'type' => 'checkbox', 'description' => 'Show recaptcha on ticket form'), array('key' => 'ticket_show_position', 'default' => 1, 'type' => 'checkbox', 'description' => 'Show ticket position (eg: 1st of 10)'), array('key' => 'ticket_allow_priority', 'default' => 1, 'type' => 'checkbox', 'description' => 'Allow priority paid support'), array('key' => 'ticket_priority_cost', 'default' => 10, 'type' => 'currency', 'description' => 'Cost of a priority support ticket'), array('key' => 'faq_ticket_show_product_selection', 'default' => 1, 'type' => 'checkbox', 'description' => 'Show FAQ product selection', 'help' => 'If you have the FAQ module installed this will show a drop down list of products and commoon support questions before the user creates a support ticket.'), array('key' => 'ticket_allow_extra_data', 'default' => 1, 'type' => 'checkbox', 'description' => 'Allow for extra input boxes on tickets', 'help' => 'For FTP usernames and passwords, or whatever else you need'), array('key' => 'ticket_from_creators_email', 'default' => 0, 'type' => 'checkbox', 'description' => 'Customer replies go directly to staff', 'help' => 'Enable this option and any customer email replies will go back to the staff member who sent the support ticket (rather than into the system). Recommended unticking this option.'), array('key' => 'ticket_admin_email_alert', 'default' => '', 'type' => 'text', 'description' => 'Send notifications of new tickets to this address.'), array('key' => 'ticket_admin_alert_subject', 'default' => 'Support Ticket Updated: #%s', 'type' => 'text', 'description' => 'The subject to have in ticket notification emails.'), array('key' => 'ticket_public_header', 'default' => 'Submit a support ticket', 'type' => 'text', 'description' => 'Message to display at the top of the embed ticket form.'), array('key' => 'ticket_public_welcome', 'default' => '', 'type' => 'textarea', 'description' => 'Text to display at the top of the embed ticket form.', 'help' => 'You can use text or html code'), array('key' => 'ticket_default_customer_id', 'default' => 1, 'type' => 'select', 'options' => $c, 'description' => 'Which customer to assign tickets to from the public Ticket Embed Form', 'help' => 'Only use this default customer if the customer cannot be found based on the ticket users email address.'), array('key' => 'ticket_type_id_default', 'default' => 0, 'type' => 'select', 'options' => module_ticket::get_types(), 'array_id' => 'name', 'description' => 'What default ticket type for tickets'), array('key' => 'ticket_default_account_id', 'default' => 0, 'type' => 'select', 'options' => $pop3imap_accounts, 'description' => 'Which default POP3/IMAP account to use'), array('key' => 'ticket_public_new_redirect', 'default' => '', 'type' => 'text', 'description' => 'Public New Ticket Redirect URL', 'help' => 'When a user submits a new public ticket, take them to this URL. Leave blank to use default. Use full URL with http://'), array('key' => 'ticket_public_reply_redirect', 'default' => '', 'type' => 'text', 'description' => 'Public Reply Ticket Redirect URL', 'help' => 'When a user submits a reply to the public ticket form, take them to this URL. Leave blank to use default. Use full URL with http://'))));
</td> </tr> <tr> <th> <?php echo _l('Type/Department'); ?> </th> <td> <?php if (module_ticket::can_edit_tickets()) { echo print_select_box(module_ticket::get_types(), 'ticket_type_id', $ticket['ticket_type_id'], '', true); //echo print_select_box(module_ticket::get_types(),'type',$ticket['type'],'',true,false,true); } else { echo print_select_box(module_ticket::get_types(), 'ticket_type_id', $ticket['ticket_type_id'], '', false); } ?> </td> </tr> <?php if (module_config::c('ticket_support_accounts', 1) && module_ticket::get_accounts_rel()) { ?> <tr> <th> <?php echo _l('Account'); ?>