/** * Create the combobox with the Canned Answers * * @param unknown_type $ArResponses * @return unknown */ public static function createCannedCombo($ArResponses) { $StHtml = ''; if (F1DeskUtils::IsSupporter()) { $StHtml = "<select class='inputCombo' id='cannedAnswers'>"; if ($ArResponses[0]['IDCannedResponse'] != '') { foreach ($ArResponses as $Response) { $StHtml .= "<option value='" . f1desk_escape_string($Response['TxMessage'], true, true) . "' >" . $Response['StTitle'] . "</option>"; } } else { $StHtml .= "<option value='null'>" . NO_ANSWER . "</option>"; } $StHtml .= '</select>'; $StHtml .= "<button class='button' onclick='Ticket.addCannedResponse(); return false;'>" . ADD . "</button>"; } return $StHtml; }
foreach ($ArAttached as $IDAttach) { if (!F1DeskUtils::isAttached($IDTicket, $IDAttach)) { $ObjTicket->attachTicket($IDTicket, $IDAttach); } } } } elseif (!empty($_POST) && $_POST['StAction'] == 'addSupporters') { $ArSupporters = F1DeskUtils::getAllSupporters(); if ($ArSupporters[0]['IDSupporter'] == 0) { array_shift($ArSupporters); } } /*************************************** * Create Data * ****************************************/ if (F1DeskUtils::isSupporter()) { $BoCreate = F1DeskUtils::getPermission('BoCreateTicket', getSessionProp('IDSupporter')); if ($BoCreate) { $ArDepartments = F1DeskUtils::getPublicDepartments(false); } else { $ArDepartments = F1DeskUtils::getDepartmentsFormatted(getSessionProp('IDSupporter')); } } else { $ArDepartments = F1DeskUtils::getPublicDepartments(); } $ArTypes = F1DeskUtils::listTicketTypes(); $ArPriorities = F1DeskUtils::listPriorities(); $ArCategories = F1DeskUtils::listCategories(); if (F1DeskUtils::IsSupporter()) { $ArSub = F1DeskUtils::getSubDepartments(getSessionProp('IDSupporter')); }
/** * Creates a reply to Ticket given * * @param int $IDWriter * @param int $IDTicket * @param str $TxMessage * @param str $StMsgType * @param arr $ArFiles * @return boolean * * @author Matheus Ashton <*****@*****.**> */ public function answerTicket($IDWriter, $IDTicket, $TxMessage, $StMsgType, $ArFiles = array()) { #check if the answer came from a supporter or a client if (F1DeskUtils::IsSupporter()) { $this->_supporterAnswer($IDWriter, $IDTicket, $TxMessage, $StMsgType, $ArFiles); } else { $this->_clientAnswer($IDWriter, $IDTicket, $TxMessage, $ArFiles); } #Setting Ticket as not read $StTableName = DBPREFIX . 'isRead'; $StCondition = "IDTicket = {$IDTicket}"; $this->deleteFromTable($StTableName, $StCondition); return true; }