コード例 #1
0
</th>
        </tr>
        </thead>
        <tbody>
            <?php 
    $c = 0;
    $types = module_ticket::get_types();
    foreach ($ticket_accounts as $ticket_account) {
        ?>
                <tr class="<?php 
        echo $c++ % 2 ? "odd" : "even";
        ?>
">
                    <td class="row_action" nowrap="">
                        <?php 
        echo module_ticket::link_open_account($ticket_account['ticket_account_id'], true);
        ?>
                    </td>
                    <td>
                        <?php 
        echo htmlspecialchars($ticket_account['email']);
        ?>
                    </td>
                    <td>
                        <?php 
        echo htmlspecialchars(isset($types[$ticket_account['default_type']]) ? $types[$ticket_account['default_type']]['name'] : $ticket_account['default_type']);
        ?>
                    </td>
                    <td>
                        <?php 
        echo module_customer::link_open($ticket_account['default_customer_id'], true);
コード例 #2
0
    ?>

                        <?php 
    if (module_config::c('ticket_turn_around_rate_show', 1)) {
        ?>

                        <tr>
                            <th class="width1">
                                <?php 
        echo _l('Rate');
        ?>

                            </th>
                            <td>
                                <?php 
        $rate = module_ticket::get_reply_rate();
        echo _l('We are currently processing about %s tickets every 24 hours', $rate['daily']);
        ?>

                            </td>
                        </tr>
                            <?php 
    }
    ?>

                        </tbody>
                    </table>

                    <?php 
}
?>
コード例 #3
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
 */
if (!module_config::can_i('view', 'Settings')) {
    redirect_browser(_BASE_HREF);
}
print_heading('Ticket Embed Form');
?>
<p>
    <?php 
_e('Place this in an iframe on your website, or as a link on your website, and people can submit support tickets.');
?>
</p>
<p><a href="<?php 
echo module_ticket::link_public_new();
?>
" target="_blank"><?php 
echo module_ticket::link_public_new();
?>
</a></p>

    <p>If you want to customise this ticket submit form, please open the ticket submit form and "View Source" in your web browser. Save this source to a file (eg: ticket.html) and upload it to your website (eg: yourwebsite.com/ticket.html). Test this form works on your website. If it works, open this form up in a web development tool (eg: PhpStorm, Dreamweaver or Notepad) and edit the form to suit your needs. As long as all the FORM and INPUT tags are left the same then the form should work. This way you can customise the form to look however you like (ie: match your website style).</p>
コード例 #4
0
ファイル: ticket_admin.php プロジェクト: sgh1986915/php-crm
    $link_name = _l('No Product') . " <span class='menu_label'>" . mysql_num_rows($product_tickets) . '</span>';
    $ticket_count = module_ticket::get_ticket_count(0);
    if ($ticket_count && $ticket_count['priority'] > 0) {
        $link_name .= " <span class='menu_label important'>" . $ticket_count['priority'] . "</span> ";
        //    $link_name .= ' <em>+ '.$ticket_count['priority'].'</em>';
    }
    //$link_name .= '</span>';
    array_unshift($links, array("name" => $link_name, 'm' => 'ticket', 'p' => 'ticket_admin', 'default_page' => 'ticket_admin_open', 'order' => 2, 'menu_include_parent' => 0, 'allow_nesting' => 0, 'current' => !$showing_ticket && isset($_REQUEST['faq_product_id']) && $_REQUEST['faq_product_id'] == 0, 'args' => array('faq_product_id' => 0, 'ticket_id' => false)));
    /*if(!$showing_ticket && (!isset($_REQUEST['faq_product_id']) || !$_REQUEST['faq_product_id'])){
          // hack for search to work correctly.
          $_REQUEST['search'] = isset($_REQUEST['search']) ? $_REQUEST['search'] : array();
          $_REQUEST['search']['faq_product_id'] = 0;
      }*/
    $products = module_faq::get_faq_products_rel();
    $order = 3;
    foreach ($products as $product_id => $product_name) {
        $ticket_count = module_ticket::get_ticket_count($product_id);
        if (!$ticket_count || !$ticket_count['count']) {
            continue;
        }
        $link_name = htmlspecialchars($product_name) . " <span class='menu_label'>" . $ticket_count['count'] . '</span>';
        if ($ticket_count && $ticket_count['priority'] > 0) {
            $link_name .= " <span class='menu_label important'>" . $ticket_count['priority'] . "</span> ";
            //$link_name .= ' <em>+ '.$ticket_count['priority'].'</em>';
        }
        //$link_name .= '</span>';
        array_unshift($links, array("name" => $link_name, 'm' => 'ticket', 'p' => 'ticket_admin', 'default_page' => 'ticket_admin_open', 'order' => ++$order, 'menu_include_parent' => 0, 'allow_nesting' => 0, 'current' => isset($_REQUEST['faq_product_id']) && $_REQUEST['faq_product_id'] == $product_id, 'args' => array('faq_product_id' => $product_id, 'ticket_id' => false)));
    }
} else {
    include 'ticket_admin_open.php';
}
コード例 #5
0
ファイル: group.php プロジェクト: sgh1986915/php-crm
 /**
  * @static
  * @param $args
  * @return array
  *
  * The newsletter system requests updated customer / user data from this group plugin.
  * It does this when building the member list, and also 
  */
 public static function newsletter_callback($args)
 {
     if (!isset($args['owner_table']) || !$args['owner_table']) {
         return array();
     }
     switch ($args['owner_table']) {
         case 'user':
             if ((int) $args['owner_id'] > 0) {
                 $sql = "SELECT c.customer_name AS company_name, c.customer_name AS customer_name";
                 $sql .= " , pu.user_id ";
                 $sql .= " , c.customer_id ";
                 $sql .= " ,c.credit ";
                 $sql .= " , pu.name AS user_name, pu.name AS first_name, pu.last_name AS last_name, pu.phone AS phone, pu.`email` AS `email`, pu.`mobile` AS `mobile`";
                 $sql .= " , a.line_1, a.line_2, a.suburb, a.state, a.region, a.country, a.post_code ";
                 $sql .= ' FROM `' . _DB_PREFIX . "user` pu";
                 $sql .= " LEFT JOIN `" . _DB_PREFIX . "customer` c ON pu.customer_id = c.customer_id";
                 $sql .= ' LEFT JOIN `' . _DB_PREFIX . "address` a ON c.customer_id = a.owner_id AND a.owner_table = 'customer' AND a.address_type = 'physical'";
                 $sql .= " WHERE pu.user_id = " . (int) $args['owner_id'];
                 $user = qa1($sql);
                 if (!is_array($user) || !isset($user['user_id']) || !$user['user_id']) {
                     return false;
                 }
                 if (isset($args['basic']) && $args['basic']) {
                     return $user;
                 }
                 //                    $name_parts = explode(" ",preg_replace('/\s+/',' ',$user['user_name']));
                 //                    $user['first_name'] = array_shift($name_parts);
                 //                    $user['last_name'] = implode(' ',$name_parts);
                 // get extras for the user.
                 $extras = module_extra::get_extras(array('owner_table' => 'user', 'owner_id' => $user['user_id']));
                 foreach ($extras as $extra) {
                     if (!strlen(trim($extra['extra']))) {
                         continue;
                     }
                     $key = $extra['extra_key'];
                     $x = 1;
                     while (isset($user[$key])) {
                         $key = $extra['extra_key'] . $x;
                         $x++;
                     }
                     $user[$key] = trim($extra['extra']);
                 }
                 // get extras for the customer.
                 if (isset($user['customer_id']) && $user['customer_id'] > 0) {
                     $extras = module_extra::get_extras(array('owner_table' => 'customer', 'owner_id' => $user['customer_id']));
                     foreach ($extras as $extra) {
                         if (!strlen(trim($extra['extra']))) {
                             continue;
                         }
                         $key = $extra['extra_key'];
                         $x = 1;
                         while (isset($user[$key])) {
                             $key = $extra['extra_key'] . $x;
                             $x++;
                         }
                         $user[$key] = trim($extra['extra']);
                     }
                 }
                 if ($user['customer_id']) {
                     $user['_edit_link'] = module_user::link_open_contact($user['user_id'], false, $user);
                 } else {
                     $user['_edit_link'] = module_user::link_open($user['user_id'], false, $user);
                 }
                 return $user;
             }
             break;
         case 'customer':
             if (module_config::c('newsletter_send_all_customer_contacts', 1)) {
                 // update - we use the above 'user' callback and return a listing for each contact in the array.
                 // using the special _multi flag hack to tell our newsletter plugin that this result contains multiple entries.
                 $users = array('_multi' => true);
                 $sql = "SELECT u.user_id FROM `" . _DB_PREFIX . "user` u WHERE u.customer_id = " . (int) $args['owner_id'];
                 $contacts = qa($sql);
                 foreach ($contacts as $contact) {
                     $data_args = array('owner_id' => $contact['user_id'], 'owner_table' => 'user');
                     $users[$contact['user_id']] = self::newsletter_callback($data_args);
                     if ($users[$contact['user_id']]) {
                         $users[$contact['user_id']]['data_args'] = json_encode($data_args);
                     }
                 }
                 return $users;
             } else {
                 $sql = "SELECT c.customer_name AS company_name, c.customer_name AS customer_name";
                 $sql .= " ,c.credit ";
                 $sql .= " , pu.user_id ";
                 $sql .= " , c.customer_id ";
                 $sql .= " , pu.name AS user_name, pu.name AS first_name, pu.last_name AS last_name, pu.phone AS phone, pu.`email` AS `email`, pu.`mobile` AS `mobile`";
                 $sql .= " , a.line_1, a.line_2, a.suburb, a.state, a.region, a.country, a.post_code ";
                 $sql .= " FROM `" . _DB_PREFIX . "customer` c ";
                 $sql .= ' LEFT JOIN `' . _DB_PREFIX . "address` a ON c.customer_id = a.owner_id AND a.owner_table = 'customer' AND a.address_type = 'physical'";
                 $sql .= ' LEFT JOIN `' . _DB_PREFIX . "user` pu ON c.primary_user_id = pu.user_id";
                 $sql .= " WHERE c.customer_id = " . (int) $args['owner_id'];
                 $user = qa1($sql);
                 if (!$user || !isset($user['customer_id'])) {
                     return array();
                 }
                 //$name_parts = explode(" ",preg_replace('/\s+/',' ',$user['user_name']));
                 //$user['first_name'] = array_shift($name_parts);
                 //$user['last_name'] = implode(' ',$name_parts);
                 if (isset($args['basic']) && $args['basic']) {
                     return $user;
                 }
                 // get extras for the customer.
                 $extras = module_extra::get_extras(array('owner_table' => 'customer', 'owner_id' => $user['customer_id']));
                 foreach ($extras as $extra) {
                     if (!strlen(trim($extra['extra']))) {
                         continue;
                     }
                     $key = $extra['extra_key'];
                     $x = 1;
                     while (isset($user[$key])) {
                         $key = $extra['extra_key'] . $x;
                         $x++;
                     }
                     $user[$key] = trim($extra['extra']);
                 }
                 if (isset($user['user_id']) && $user['user_id'] > 0) {
                     // get extras for the user.
                     $extras = module_extra::get_extras(array('owner_table' => 'user', 'owner_id' => $user['user_id']));
                     foreach ($extras as $extra) {
                         if (!strlen(trim($extra['extra']))) {
                             continue;
                         }
                         $key = $extra['extra_key'];
                         $x = 1;
                         while (isset($user[$key])) {
                             $key = $extra['extra_key'] . $x;
                             $x++;
                         }
                         $user[$key] = trim($extra['extra']);
                     }
                 }
                 $user['_edit_link'] = module_customer::link_open($user['customer_id'], false, $user);
                 return $user;
             }
         case 'website':
             $sql = "SELECT c.customer_name AS company_name";
             $sql .= " ,c.credit ";
             $sql .= " ,w.name AS website_name";
             $sql .= " ,w.url AS website_url";
             $sql .= " , pu.user_id ";
             $sql .= " , c.customer_id ";
             $sql .= " , pu.name AS user_name, pu.phone AS phone, pu.`email` AS `email`, pu.`mobile` AS `mobile`";
             $sql .= " , a.line_1, a.line_2, a.suburb, a.state, a.region, a.country, a.post_code ";
             $sql .= " FROM `" . _DB_PREFIX . "website` w ";
             $sql .= ' LEFT JOIN `' . _DB_PREFIX . "customer` c ON w.customer_id = c.customer_id";
             $sql .= ' LEFT JOIN `' . _DB_PREFIX . "address` a ON c.customer_id = a.owner_id AND a.owner_table = 'customer' AND a.address_type = 'physical'";
             $sql .= ' LEFT JOIN `' . _DB_PREFIX . "user` pu ON c.primary_user_id = pu.user_id";
             $sql .= " WHERE w.website_id = " . (int) $args['owner_id'];
             $user = qa1($sql);
             $name_parts = explode(" ", preg_replace('/\\s+/', ' ', $user['user_name']));
             $user['first_name'] = array_shift($name_parts);
             $user['last_name'] = implode(' ', $name_parts);
             if (isset($args['basic']) && $args['basic']) {
                 return $user;
             }
             // get extras for the website.
             $extras = module_extra::get_extras(array('owner_table' => 'website', 'owner_id' => $args['owner_id']));
             foreach ($extras as $extra) {
                 if (!strlen(trim($extra['extra']))) {
                     continue;
                 }
                 $key = $extra['extra_key'];
                 $x = 1;
                 while (isset($user[$key])) {
                     $key = $extra['extra_key'] . $x;
                     $x++;
                 }
                 $user[$key] = trim($extra['extra']);
             }
             // then get extras for the company
             $extras = module_extra::get_extras(array('owner_table' => 'customer', 'owner_id' => $user['customer_id']));
             foreach ($extras as $extra) {
                 if (!strlen(trim($extra['extra']))) {
                     continue;
                 }
                 $key = $extra['extra_key'];
                 $x = 1;
                 while (isset($user[$key])) {
                     $key = $extra['extra_key'] . $x;
                     $x++;
                 }
                 $user[$key] = trim($extra['extra']);
             }
             if (isset($user['user_id']) && $user['user_id'] > 0) {
                 // get extras for the user.
                 $extras = module_extra::get_extras(array('owner_table' => 'user', 'owner_id' => $user['user_id']));
                 foreach ($extras as $extra) {
                     if (!strlen(trim($extra['extra']))) {
                         continue;
                     }
                     $key = $extra['extra_key'];
                     $x = 1;
                     while (isset($user[$key])) {
                         $key = $extra['extra_key'] . $x;
                         $x++;
                     }
                     $user[$key] = trim($extra['extra']);
                 }
             }
             $user['_edit_link'] = module_customer::link_open($user['customer_id'], false, $user);
             return $user;
         case 'ticket':
             //echo 'Getting ticket for '.$args['owner_id'] . ' and basic is '.var_export($args['basic'],true);exit;
             return module_ticket::get_newsletter_recipient($args['owner_id'], isset($args['basic']) && $args['basic']);
         case 'member':
             return module_member::get_newsletter_recipient($args['owner_id'], isset($args['basic']) && $args['basic']);
         case 'newsletter_subscription':
             return module_member::get_newsletter_recipient($args['owner_id'], isset($args['basic']) && $args['basic']);
     }
     return array();
 }
コード例 #6
0
}
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>
コード例 #7
0
 * IP Address: 67.79.165.254
 */
if (module_config::c('ticket_allow_priority', 0) || $ticket['priority'] == _TICKET_PRIORITY_STATUS_ID) {
    $responsive_summary = array();
    ob_start();
    ?>
    <table class="tableclass tableclass_form tableclass_full">
        <tbody>
        <tr>
            <td>
                <?php 
    if ($ticket['priority'] != _TICKET_PRIORITY_STATUS_ID) {
        echo '<p>';
        _e("Current ticket position is: <strong>%s of %s</strong>.", ordinal($ticket['position']), $ticket['total_pending']);
        echo '<br/>';
        $x = module_ticket::get_ticket_count($ticket['faq_product_id']);
        _e('Priority Support will change this to: <strong>%s of %s</strong>.', ordinal($x['priority'] + 1), $ticket['total_pending']);
        echo '<br/>';
        _e('This means your question will be answered faster.');
        echo '</p>';
    }
    if ($ticket['invoice_id']) {
        $invoice_data = module_invoice::get_invoice($ticket['invoice_id']);
        if (!$invoice_data || $invoice_data['invoice_id'] != $ticket['invoice_id']) {
            // ticket invoice has been deleted.
            // unlink it from this ticket.
            if ($ticket['ticket_id']) {
                update_insert('ticket_id', $ticket['ticket_id'], 'ticket', array('invoice_id' => 0));
            }
            echo 'invoice removed... please refresh';
        } else {
コード例 #8
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
 */
if (!$ticket_safe) {
    die('failed');
}
$ticket_id = (int) $_REQUEST['ticket_id'];
$ticket = module_ticket::get_ticket($ticket_id);
print_heading(_l('Notify Staff About Ticket: %s', module_ticket::ticket_number($ticket['ticket_id'])));
// template for sending emails.
// are we sending the paid one? or the dueone.
$template = module_template::get_template_by_key('ticket_email_notify');
$ticket['ticket_number'] = module_ticket::ticket_number($ticket['ticket_id']);
$ticket['from_name'] = module_security::get_loggedin_name();
$ticket['ticket_url'] = module_ticket::link_open($ticket_id);
$ticket['ticket_subject'] = $ticket['subject'];
// sending to the staff member.
$to = module_user::get_user($ticket['assigned_user_id']);
$ticket['staff_name'] = $to['name'] . ' ' . $to['last_name'];
$to = array($to);
$template->assign_values($ticket);
module_email::print_compose(array('to' => $to, 'bcc' => module_config::c('admin_email_address', ''), 'content' => $template->render('html'), 'subject' => $template->replace_description(), 'success_url' => module_ticket::link_open($ticket_id), 'cancel_url' => module_ticket::link_open($ticket_id)));
コード例 #9
0
ファイル: ticket.php プロジェクト: sgh1986915/php-crm
    public static function hook_invoice_sidebar($callback, $invoice_id)
    {
        // see if any tickets match this  invoice.
        $tickets = get_multiple('ticket', array('invoice_id' => $invoice_id));
        if ($tickets) {
            foreach ($tickets as $ticket) {
                ?>

                <h3><?php 
                _e('Priority Support Ticket');
                ?>
</h3>
                <table border="0" cellspacing="0" cellpadding="2" class="tableclass tableclass_form tableclass_full">
                    <tbody>
                    <tr>
                        <th class="width1">
                            <?php 
                _e('Ticket');
                ?>

                        </th>
                        <td>
                            <?php 
                echo module_ticket::link_open($ticket['ticket_id'], true, $ticket);
                ?>

                        </td>
                    </tr>
                    <tr>
                        <th>
                            <?php 
                _e('Subject');
                ?>

                        </th>
                        <td>
                            <?php 
                echo htmlspecialchars($ticket['subject']);
                ?>

                        </td>
                    </tr>
                    <tr>
                        <th>
                            <?php 
                _e('Status');
                ?>

                        </th>
                        <td>
                            <?php 
                $s = module_ticket::get_statuses();
                echo $s[$ticket['status_id']];
                ?>

                        </td>
                    </tr>
                    </tbody>
                </table>
                <?php 
            }
        }
    }
コード例 #10
0
               <input type="hidden" name="creator_hash" value="<?php echo module_ticket::creator_hash(module_security::get_loggedin_id());?>">
               <strong>
               <?php echo htmlspecialchars($send_as_name);?>
               &lt;<?php echo htmlspecialchars($send_as_address);?>&gt;
               </strong>
               <?php _e('Reply To:');?> <strong><?php echo htmlspecialchars($to_user_a['email']);?></strong>
           </td>
       </tr> */
    ?>

		        </tbody>
	        </table>

	        <?php 
    $form_actions = array('class' => 'action_bar action_bar_center action_bar_single', 'elements' => array());
    if (module_ticket::can_edit_tickets() && module_config::c('ticket_allow_cc_bcc', 1)) {
        $form_actions['elements'][] = array('type' => 'button', 'name' => 'show_cc_bcc', 'value' => _l('Add CC/BCC'), 'onclick' => "\$('#ticket_cc_bcc').show(); \$(this).hide();");
    }
    if ($next_ticket) {
        $form_actions['elements'][] = array('type' => 'submit', 'class' => 'submit_button', 'name' => 'newmsg', 'value' => _l('Submit Message'));
        $form_actions['elements'][] = array('type' => 'save_button', 'name' => 'newmsg_next', 'value' => _l('Submit Message & Go To Next Ticket'));
        $form_actions['elements'][] = array('type' => 'hidden', 'name' => 'next_ticket_id', 'value' => $next_ticket);
    } else {
        if ($prev_ticket) {
            $form_actions['elements'][] = array('type' => 'save_button', 'name' => 'newmsg', 'value' => _l('Submit Message'));
            $form_actions['elements'][] = array('type' => 'save_button', 'name' => 'newmsg_next', 'value' => _l('Submit Message & Go To Prev Ticket'));
            $form_actions['elements'][] = array('type' => 'hidden', 'name' => 'next_ticket_id', 'value' => $prev_ticket);
        } else {
            $form_actions['elements'][] = array('type' => 'save_button', 'name' => 'newmsg', 'value' => _l('Submit Message'));
        }
    }
コード例 #11
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
 */
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://'))));
コード例 #12
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
 */
//$ticket_id > 0 &&
if (module_config::c('ticket_allow_extra_data', 1)) {
    $extras = module_ticket::get_ticket_extras_keys($ticket['ticket_account_id']);
    if (count($extras)) {
        $extra_summary = array();
        foreach ($extras as $extra) {
            if (isset($ticket['extra_data'][$extra['ticket_data_key_id']]) && $ticket['extra_data'][$extra['ticket_data_key_id']]['value'] && strpos($ticket['extra_data'][$extra['ticket_data_key_id']]['value'], 'encrypt:') === false) {
                $extra_summary[] = $ticket['extra_data'][$extra['ticket_data_key_id']]['value'];
            }
        }
        $fieldset_data = array('heading' => array('title' => _l('Extra Information'), 'type' => 'h3', 'responsive' => array('summary' => implode(', ', $extra_summary))), 'elements' => array());
        foreach ($extras as $extra) {
            $fieldset_data['elements'][] = array('title' => htmlspecialchars($extra['key']), 'fields' => array(function () use($extra, $ticket) {
                // we do a hook in here with the encryption plugin.
                // if some of these fields are marked for encryption we display a nice lock
                // and some stars instead of the value.
                // if there isn't a value then we don't display any stars, just a lock symbol
                // we also have to show an "unlock" button so the admin can unlock the value.
                if (!isset($extras_editable) || $extras_editable) {
                    module_form::generate_form_element(array('type' => $extra['type'], 'name' => 'ticket_extra[' . $extra['ticket_data_key_id'] . ']', 'value' => isset($ticket['extra_data'][$extra['ticket_data_key_id']]) ? $ticket['extra_data'][$extra['ticket_data_key_id']]['value'] : '', 'options' => isset($extra['options']) && $extra['options'] ? unserialize($extra['options']) : array(), 'class' => 'no_permissions', 'encrypt' => class_exists('module_encrypt', false) && isset($extra['encrypt_key_id']) && $extra['encrypt_key_id'], 'page_name' => 'ticket_extras', 'id' => 'ticket_extras_' . $extra['ticket_data_key_id']));
コード例 #13
0
ファイル: ticket_billing.php プロジェクト: sgh1986915/php-crm
<?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_id > 0 && module_config::c('ticket_allow_billing', 1) && module_ticket::can_edit_tickets()) {
    $done_in_ticket_billing = true;
    $responsive_summary = array();
    $quotes = array();
    if (class_exists('module_quote', false) && module_quote::is_plugin_enabled()) {
        $quotes = module_quote::get_quotes(array('ticket_id' => $ticket_id));
        foreach ($quotes as $quote) {
            $responsive_summary[] = module_quote::link_open($quote['quote_id'], true, $quote);
        }
    }
    $fieldset_data = array('heading' => array('type' => 'h3', 'title' => 'Ticket Billing', 'responsive' => array('summary' => implode(', ', $responsive_summary))), 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array());
    $c = array();
    $res = module_customer::get_customers();
    while ($row = array_shift($res)) {
        $c[$row['customer_id']] = $row['customer_name'];
    }
    if ($ticket['customer_id'] < 0) {
        $ticket['customer_id'] = false;
    }
    $fieldset_data['elements'][] = array('title' => _l('Customer'), 'fields' => array(array('type' => 'select', 'name' => 'change_customer_id', 'value' => $ticket['customer_id'], 'options' => $c), array('type' => 'button', 'name' => 'new_customer', 'value' => _l('New'), 'onclick' => "window.location.href='" . module_customer::link_open('new', false) . "&move_user_id=" . $ticket['user_id'] . "';")));
コード例 #14
0
ファイル: faq.php プロジェクト: sgh1986915/php-crm
 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;
 }
コード例 #15
0
                 </th>
                 <td>
                     <?php 
 echo print_select_box(module_group::get_groups('ticket'), 'group_id', false, '', true, 'name');
 ?>
                 </td>
             </tr>
             <tr>
                 <th>
                     <?php 
 echo _l('Change Ticket Status');
 ?>
                 </th>
                 <td>
                     <?php 
 echo print_select_box(module_ticket::get_statuses(), 'status_id', '');
 ?>
                 </td>
             </tr>
             <tr>
                 <th>
                     <?php 
 echo _l('Send Ticket Reply Message');
 ?>
                 </th>
                 <td>
                     <input type="checkbox" name="send_message" value="1"> <?php 
 _e('Yes, send below message to each ticket in group:');
 ?>
                     <div>
                     <textarea name="send_message_content" id="send_message_content" rows="10" cols="30" style="width:450px; height: 350px;"></textarea>
コード例 #16
0
		<?php 
$c = 0;
$time = time();
$today = strtotime(date('Y-m-d'));
$seconds_into_today = $time - $today;
foreach ($pagination['rows'] as $ticket) {
    //$ticket = module_ticket::get_ticket($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>
                <td>
                    <?php 
    // todo, pass off to envato module as a hook
    $ticket['subject'] = preg_replace('#Message sent via your Den#', '', $ticket['subject']);
    if ($ticket['priority']) {
    }
    if ($ticket['unread']) {
        echo '<strong>';
        echo ' ' . _l('* ') . ' ';
コード例 #17
0
ファイル: faq_questions.php プロジェクト: sgh1986915/php-crm
    ?>


	<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 
コード例 #18
0
ファイル: faq_products.php プロジェクト: sgh1986915/php-crm
<?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' => '');
    }
    ?>
コード例 #19
0
    ?>
</th>
        </tr>
        </thead>
        <tbody>
            <?php 
    $c = 0;
    foreach ($ticket_data_keys as $ticket_data_key) {
        ?>
                <tr class="<?php 
        echo $c++ % 2 ? "odd" : "even";
        ?>
">
                    <td class="row_action" nowrap="">
                        <?php 
        echo module_ticket::link_open_field($ticket_data_key['ticket_data_key_id'], true);
        ?>
                    </td>
                    <td>
                        <?php 
        echo htmlspecialchars($ticket_data_key['key']);
        ?>
                    </td>
                    <td>
                        <?php 
        echo htmlspecialchars($ticket_data_key['type']);
        ?>
                    </td>
                    <td>
                        <?php 
        echo htmlspecialchars($ticket_data_key['order']);
コード例 #20
0
/** 
 * 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
 */
$page_title = _l('Ticket Staff Report');
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : array('date_from' => print_date(date('Y-m-d', strtotime('-1 month'))), 'date_to' => print_date(date('Y-m-d')));
if (!module_statistic::can_i('view', 'Ticket Staff Report')) {
    redirect_browser(_BASE_HREF);
}
$staff_members = module_ticket::get_ticket_staff();
// we get all the ticket messages that were sent within this time period
// (without autoresponders?)
$sql = "SELECT * FROM `" . _DB_PREFIX . "ticket_message` WHERE message_time >= " . (int) strtotime(input_date($search['date_from'])) . " AND message_time <= " . (int) strtotime(input_date($search['date_to']));
$messages = qa($sql);
?>

<form action="" method="post" id="statistic_form">
     <?php 
$search_bar = array('elements' => array('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'] : '')))));
echo module_form::search_bar($search_bar);
?>

</form>

<p>&nbsp;</p>
コード例 #21
0
    $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' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Delete'), 'onclick' => "return confirm('" . _l('Really delete this record?') . "');")));
    echo module_form::generate_form_actions($form_actions);
    ?>


    </form>

    <?php 
} else {
    print_heading(array('title' => 'Ticket Types/Departments', 'type' => 'h2', 'main' => true, 'button' => array('url' => module_ticket::link_open_type('new'), 'title' => 'Add New Type', 'type' => 'add')));
    $staff = module_ticket::get_ticket_staff_rel();
    /** START TABLE LAYOUT **/
    $table_manager = module_theme::new_table_manager();
    $columns = array();
    $columns['type'] = array('title' => _l('Type/Department'), 'callback' => function ($ticket_type) {
        echo module_ticket::link_open_type($ticket_type['ticket_type_id'], true);
    }, 'cell_class' => 'row_action');
    $columns['public'] = array('title' => _l('Public'), 'callback' => function ($ticket_type) {
        $yn = get_yes_no();
        echo _l($yn[$ticket_type['public']]);
    });
    $columns['staff'] = array('title' => _l('Staff'), 'callback' => function ($ticket_type) use($staff) {
        echo isset($staff[$ticket_type['default_user_id']]) ? $staff[$ticket_type['default_user_id']] : _l('Default');
    });
    $table_manager->set_id('ticket_type_list');
    $table_manager->set_columns($columns);
    $table_manager->set_rows($ticket_types);
    $table_manager->pagination = true;
    $table_manager->print_table();
    /** END TABLE LAYOUT **/
}
コード例 #22
0
ファイル: read_emails.php プロジェクト: sgh1986915/php-crm
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) {
            module_ticket::send_autoreply($ticket_id);
        }
    }
}
コード例 #23
0
                                                            <script type="text/javascript">
                                                                set_add_del('file_attachment_holder');
                                                            </script>
                                                            <br class="clear">
                                                        </div>
                                                        <?php 
    }
    ?>

                                                        <div style="line-height: 25px; padding:10px;">
                                                            <input type="hidden" name="creator_id" value="<?php 
    echo module_security::get_loggedin_id();
    ?>
">
                                                                    <input type="hidden" name="creator_hash" value="<?php 
    echo module_ticket::creator_hash(module_security::get_loggedin_id());
    ?>
">
                                                                <?php 
    _e('Send message as:');
    ?>

                                                                <strong>
                                                                    <?php 
    echo htmlspecialchars($send_as_name);
    ?>

                                                                    &lt;<?php 
    echo htmlspecialchars($send_as_address);
    ?>
&gt;
コード例 #24
0
 <a href="<?php 
            echo module_ticket::link_public($ticket_id);
            ?>
" target="_blank"><?php 
            _e('click here');
            ?>
</a> <?php 
        }));
    }
    echo module_form::generate_fieldset($fieldset_data);
    unset($fieldset_data);
    handle_hook('ticket_sidebar', $ticket_id);
}
// end can edit
hook_handle_callback('layout_column_half', 2, '65');
if ($ticket_id > 0 && module_ticket::can_edit_tickets() && !$ticket['assigned_user_id']) {
    ob_start();
    ?>

            <div class="content_box_wheader" style="padding-bottom: 20px">
                <p>
                    <?php 
    _e('This ticket is not assigned to anyone.');
    ?>
<br/>
                    <?php 
    _e('If you are able to solve this ticket please assign it to yourself.');
    ?>

                </p>
                <input type="button" name="butt_assign_me" value="<?php 
コード例 #25
0
    ?>
" class="submit_button delete_button" />
        <?php 
}
?>

        <input type="button" name="cancel" value="<?php 
echo _l('Cancel');
?>
" onclick="window.location.href='<?php 
echo module_ticket::link_open(false);
?>
';" class="submit_button" />
    </p>
    <?php 
if ((int) $ticket_id && module_ticket::can_edit_tickets()) {
    ?>

    <p align="center">
        <input type="submit" name="mark_as_unread" value="<?php 
    echo _l('Mark as unread');
    ?>
" class="submit_button" />
    </p>
        <?php 
}
?>



</form>