예제 #1
1
## Priorities
$priorities = sirportly_priorities();
$ca->assign("priorities", $priorities);
$ca->assign("priorityid", $_POST['priorities']);
## Custom fields
$sirportlyCustomFields = sirportlyCustomFields($deptid, $customfield);
$ca->assign("customfields", $sirportlyCustomFields);
$ca->assign('errormessage', $validate->getHTMLErrorOutput());
$ca->assign("allowedfiletypes", $CONFIG['TicketAllowedFileTypes']);
$ca->assign("subject", $subject);
$ca->assign("message", $message);
$ca->assign("captcha", $captcha);
$ca->assign("recapatchahtml", clientAreaReCaptchaHTML());
switch ($step) {
    case '2':
        $ca->setTemplate('/templates/sirportly/supportticketsubmit-steptwo.tpl');
        break;
    case '3':
        ## Upload any attachments and store their tokens
        $attachedFiles = sirportly_upload_attachments($_FILES['attachments']);
        ## New ticket params
        $params = array();
        $params['subject'] = $subject;
        $params['status'] = $newStatusId;
        $params['priority'] = $_POST['priorities'];
        $params['department'] = $deptid;
        $params['contact'] = $sirportlyContact;
        ## Custom field params
        foreach ($customfield as $cf => $value) {
            $params["custom[{$cf}]"] = $value;
        }
 * Sirportly WHMCS Support Tickets Module
 * @copyright Copyright (c) 2015 aTech Media Ltd
 * @version 3.0
 */
use WHMCS\ClientArea;
define("CLIENTAREA", true);
## Required files
require_once ROOTDIR . "/includes/sirportly/functions.php";
include_once ROOTDIR . "/includes/sirportly/config.php";
$ca = new ClientArea();
$ca->setPageTitle($_LANG['supportticketspagetitle']);
$ca->addToBreadCrumb('index.php', $whmcs->get_lang('globalsystemname'));
$ca->addToBreadCrumb('clientarea.php', $whmcs->get_lang('clientareatitle'));
$ca->addToBreadCrumb('supporttickets.php', $whmcs->get_lang('supportticketspagetitle'));
$ca->initPage();
## Setup the menus
Menu::addContext('support_module', 'sirportly');
## Load the sirportly contact
$sirportlyContact = findOrCreateSirportlyContact($_SESSION['uid'], $_SESSION['cid']);
## Fetch an array of sirportly contact_ids
$contact_ids = sirportlyContacts($_SESSION['uid'], $_SESSION['cid']);
## Fetch the tickets
$sirportlyTickets = sirportlyTickets($contact_ids);
foreach ($sirportlyTickets['results'] as $ticket) {
    $tickets[] = array('tid' => $ticket[1], 'c' => $ticket[0], 'department' => $ticket[4], 'subject' => $ticket[2], 'statusColor' => '#' . $ticket[5], 'status' => $ticket[6], 'lastreply' => fromMySQLDate($ticket[3], true, true));
}
$ca->assign('tickets', $tickets);
$ca->assign('noSearch', true);
$ca->assign('noPagination', false);
$ca->setTemplate('/templates/sirportly/supportticketslist.tpl');
$ca->output();
예제 #3
0
 * @copyright Copyright (c) 2015 aTech Media Ltd
 * @version 3.0
 */
use WHMCS\ClientArea;
define("CLIENTAREA", true);
## Required files
require_once ROOTDIR . "/includes/sirportly/functions.php";
include_once ROOTDIR . "/includes/sirportly/config.php";
$ca = new ClientArea();
$ca->setPageTitle($_LANG['supportticketsviewticket']);
$ca->addToBreadCrumb('index.php', $whmcs->get_lang('globalsystemname'));
$ca->addToBreadCrumb('clientarea.php', $whmcs->get_lang('clientareatitle'));
$ca->addToBreadCrumb('supporttickets.php', $whmcs->get_lang('supportticketspagetitle'));
$ca->addToBreadCrumb("viewticket.php", $whmcs->get_lang('supportticketsviewticket'));
$ca->initPage();
$ca->setTemplate('/templates/sirportly/viewticket.tpl');
$ca->requireLogin();
## Fetch the ticket from Sirportly
$response = _doSirportlyAPICall('tickets/ticket', array('reference' => $tid));
## Fetch an array of sirportly contact_ids
$contact_ids = sirportlyContacts($_SESSION['uid'], $_SESSION['cid']);
## Check to see if we encountered any errors
if (checkForSirportlyErrors($response)) {
    $ca->assign('invalidTicketId', true);
    $ca->output();
    return;
}
## Check to ensure that the ID matches and the user has access
if ($response['id'] != $c || !in_array($response['contact']['id'], $contact_ids)) {
    $ca->assign('invalidTicketId', true);
    $ca->output();