示例#1
0
    public function init()
    {
        $this->links = array();
        $this->ticket_types = array();
        $this->module_name = "ticket";
        $this->module_position = 25;
        self::$ticket_statuses = array(1 => _l('Unassigned'), 2 => _l('New'), 3 => _l('Replied'), _TICKET_STATUS_IN_PROGRESS_ID => _l('In Progress'), _TICKET_STATUS_RESOLVED_ID => _l('Resolved'), 7 => _l('Canceled'));
        /*$this->ajax_search_keys = array(
              _DB_PREFIX.'ticket' => array(
                  'plugin' => 'ticket',
                  'search_fields' => array(
                      'ticket_id',
                      'subject',
                  ),
                  'key' => 'ticket_id',
                  'title' => _l('Ticket: '),
              ),
          );*/
        module_config::register_css('ticket', 'tickets.css');
        module_config::register_js('ticket', 'tickets.js');
        hook_add('invoice_admin_list_job', 'module_ticket::hook_invoice_admin_list_job');
        hook_add('invoice_sidebar', 'module_ticket::hook_invoice_sidebar');
        hook_add('customer_contact_moved', 'module_ticket::hook_customer_contact_moved');
        hook_add('customer_deleted', 'module_ticket::hook_customer_deleted');
        // filter var hooks
        hook_add('generate_fieldset_options', 'module_ticket::hook_filter_generate_fieldset_options');
        hook_add('get_quote', 'module_ticket::hook_filter_get_quote');
        hook_add('quote_save', 'module_ticket::hook_quote_save');
        hook_add('quote_delete', 'module_ticket::hook_quote_delete');
        hook_add('api_callback_ticket', 'module_ticket::api_filter_ticket');
        if (class_exists('module_template', false)) {
            module_template::init_template('ticket_email_notify', 'Dear {STAFF_NAME},<br>
<br>
A support ticket has been assigned to you.<br>
Ticket Number: <strong>{TICKET_NUMBER}</strong><br>
Ticket Subject: <strong>{TICKET_SUBJECT}</strong><br>
To view this ticket please <a href="{TICKET_URL}">click here</a>.<br><br>
Thank you,<br><br>
{FROM_NAME}
', 'Ticket Assigned: {TICKET_NUMBER}', array('STAFF_NAME' => 'Staff Name', 'TICKET_NUMBER' => 'Ticket Number', 'TICKET_SUBJECT' => 'Ticket Subject', 'TICKET_URL' => 'Link to ticket for customer'));
            module_template::init_template('ticket_container', '<span style="font-size:10px; color:#666666;">{REPLY_LINE}</span>
<span style="font-size:10px; color:#666666;">Your ticket has been updated, please see the message below:</span>


{MESSAGE}


<span style="font-size:10px; color:#666666;">Ticket Number: <strong>{TICKET_NUMBER}</strong></span>
<span style="font-size:10px; color:#666666;">Ticket Status: <strong>{TICKET_STATUS}</strong></span>
<span style="font-size:10px; color:#666666;">Your position in the support queue: <strong>{POSITION_CURRENT} out of {POSITION_ALL}</strong>.</span>
<span style="font-size:10px; color:#666666;">Estimated time for a reply: <strong>within {DAYS} days</strong></span>
<span style="font-size:10px; color:#666666;">You can view the status of your support query at any time by following this link:</span>
<span style="font-size:10px; color:#666666;"><a href="{URL}" style="color:#666666;">View Ticket {TICKET_NUMBER} History Online</a></span>

', 'The email sent along with all ticket replies.', 'text');
            module_template::init_template('ticket_admin_email', '{MESSAGE}


<span style="font-size:12px; color:#666666; font-weight: bold;">Ticket Details:</span>
<span style="font-size:10px; color:#666666;">Number of messages: <strong>{MESSAGE_COUNT}</strong></span>
<span style="font-size:10px; color:#666666;">Ticket Number: <strong>{TICKET_NUMBER}</strong></span>
<span style="font-size:10px; color:#666666;">Ticket Status: <strong>{TICKET_STATUS}</strong></span>
<span style="font-size:10px; color:#666666;">Position in the support queue: <strong>{POSITION_CURRENT} out of {POSITION_ALL}</strong>.</span>
<span style="font-size:10px; color:#666666;">Estimated time for a reply: <strong>within {DAYS} days</strong></span>
<span style="font-size:10px; color:#666666;">View the ticket: <strong>{URL_ADMIN}</strong></span>
        ', 'Sent as an email to the administrator when a new ticket is created.', 'text');
            module_template::init_template('ticket_autoreply', 'Hello,

Thank you for your email. We will reply shortly.

        ', 'Sent as an email after a support ticket is received.', 'text');
            module_template::init_template('ticket_rejection', 'Hello,

Please submit all NEW support tickets via our website by following this link:
{TICKET_URL}

New support tickets are no longer accepted via email due to high levels of spam causing delays for everyone.

Thanks,

        ', 'Email Bounced: {SUBJECT}.', 'text');
        }
    }