Ejemplo n.º 1
0
<?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
 */
$autoreply_queue = array();
//set_time_limit(10);
// find all the mail setting accounts to check.
foreach (module_ticket::get_accounts() as $account) {
    $updated_tickets = module_ticket::import_email($account['ticket_account_id']);
    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.
                        </table>
 <?php 
    $fieldset_data = array('heading' => array('type' => 'h3', 'main' => true, 'title' => 'Edit Ticket Account'), 'elements_before' => ob_get_clean());
    echo module_form::generate_fieldset($fieldset_data);
    unset($fieldset_data);
    $form_actions = array('class' => 'action_bar action_bar_center action_bar_single', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Save')), array('type' => 'submit', 'name' => 'butt_save_test', 'value' => 'Save & Test Search', 'onclick' => "alert('This may take some time, please wait...');;"), array('type' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Delete'), 'onclick' => "return confirm('" . _l('Really delete this record?') . "');"), array('type' => 'button', 'name' => 'cancel', 'value' => _l('Cancel'), 'class' => 'submit_button', 'onclick' => "window.location.href='" . module_ticket::link_open_account(false) . "';")));
    echo module_form::generate_form_actions($form_actions);
    ?>


        </form>

    <?php 
} else {
    print_heading(array('title' => 'Ticket Email Accounts', 'type' => 'h2', 'main' => true, 'button' => array('url' => module_ticket::link_open_account('new'), 'title' => 'Add New Account', 'type' => 'add')));
    $ticket_accounts = module_ticket::get_accounts();
    ?>


    <table width="100%" border="0" cellspacing="0" cellpadding="2" class="tableclass tableclass_rows">
        <thead>
        <tr class="title">
            <th><?php 
    echo _l('Ticket Account');
    ?>
</th>
            <th><?php 
    echo _l('Email Address');
    ?>
</th>
            <th><?php