Exemplo n.º 1
0
 /**
  * Returns this ticket priority.
  *
  * Result is cached until the end of script.
  *
  * @param bool $reload True to reload data from server. False to use the cached value (if present).
  * @return kyTicketPriority
  */
 public function getPriority($reload = false)
 {
     if ($this->priority !== null && !$reload) {
         return $this->priority;
     }
     if ($this->priority_id === null) {
         return null;
     }
     $this->priority = kyTicketPriority::get($this->priority_id);
     return $this->priority;
 }
Exemplo n.º 2
0
         $smarty->assign('_imageURL', WHMCS_URL . 'templates/kayako/images');
         $templatefile = 'ticketform';
     } else {
         header('Location: ' . WHMCS_URL . 'submitticket.php');
     }
 } else {
     if ($_REQUEST['step'] == 3) {
         if (!empty($_POST)) {
             //Set Defaults for a new ticket
             $_defaultStatusID = kyTicketStatus::getAll()->filterByType(kyTicketStatus::TYPE_PUBLIC)->first()->getId();
             $_defaultPriorityID = kyTicketPriority::getAll()->filterByType(kyTicketStatus::TYPE_PUBLIC)->first()->getId();
             $_defaultTypeID = kyTicketType::getAll()->filterByType(kyTicketStatus::TYPE_PUBLIC)->first()->getId();
             kyTicket::setDefaults($_defaultStatusID, $_defaultPriorityID, $_defaultTypeID);
             //Create ticket
             $_department = kyDepartment::get($_POST['departmentid']);
             $_priority = kyTicketPriority::get($_POST['ticketpriorityid']);
             $_ticket = kyTicket::createNewAuto($_department, $clientsdetails['firstname'] . ' ' . $clientsdetails['lastname'], $clientsdetails['email'], $_POST['ticketmessage'], $_POST['ticketsubject'])->setPriority($_priority)->setIgnoreAutoResponder($_settings['ignoreautoresponder'])->create();
             $_ticketPosts = $_ticket->getPosts();
             //Save ticket attachments
             foreach ($_FILES['ticketattachments']['tmp_name'] as $_key => $_ticketAttachment) {
                 kyTicketAttachment::createNewFromFile($_ticketPosts[0], $_ticketAttachment, $_FILES['ticketattachments']['name'][$_key])->create();
             }
             //Save custom fields
             $_ticket->setCustomFieldValuesFromPOST();
             $_ticket->updateCustomFields();
             $smarty->assign('_ticketDisplayID', $_ticket->getDisplayId());
             $smarty->assign('_ticketSubject', $_POST['ticketsubject']);
             $smarty->assign('_ticketMessage', nl2br($_POST['ticketmessage']));
             $templatefile = 'ticketConfirmation';
         } else {
             header('Location: ' . WHMCS_URL . 'submitticket.php');
        ?>
</td>
					<td><?php 
        echo kyTicketStatus::get($list->getStatusId())->getTitle();
        ?>
</td>
					<td style=" background-color: <?php 
        echo kyTicketPriority::get($list->getPriorityId())->getBackgroundColor();
        ?>
;">
                    <span style="color: <?php 
        echo kyTicketPriority::get($list->getPriorityId())->getForegroundColor();
        ?>
;">
                        <?php 
        echo kyTicketPriority::get($list->getPriorityId())->getTitle();
        ?>
                    </span>
					</td>
				</tr>
			<?php 
    }
    ?>
		<?php 
} else {
    ?>
			<tr>
				<td colspan="7">No records...</td>
			</tr>
		<?php 
}
" <?php 
    if ($status->id == $ticket_details->getStatusId()) {
        echo "selected";
    }
    ?>
 ><?php 
    echo $status->title;
    ?>
</option>
						<?php 
}
?>
					</select>
				</td>
				<td style="background-color: <?php 
echo kyTicketPriority::get($ticket_details->getPriorityId())->getBackgroundColor();
?>
;">
					<select name="priority">
						<?php 
foreach ($priority_list as $priority) {
    ?>
							<option
								value="<?php 
    echo $priority->id;
    ?>
" <?php 
    if ($priority->id == $ticket_details->getPriorityId()) {
        echo "selected";
    }
    ?>