function Admin_Reply($ticket, $params) { if (!$params['user_message']) { return; } $status = $ticket->getStatus(); if ($status->is_closed) { FSS_EMail::Admin_Close($ticket, $params['subject'], $params['user_message'], $params['files']); } else { FSS_EMail::Admin_Reply($ticket, $params['subject'], $params['user_message'], $params['files']); } }
function ticket_status_id() { // update status in ticket // redirect if the config is set to $ticketid = FSS_Input::getInt('ticketid'); $ticket_status_id = FSS_Input::getInt('ticket_status_id'); if ($ticketid < 1) { exit; } if ($ticket_status_id < 1) { exit; } $link = FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=ticket&ticketid=' . $ticketid, false); // check permission for new status $statuss = SupportHelper::getStatuss(); $new_status = $statuss[$ticket_status_id]; if ($new_status->is_closed && !$this->view->can_Close()) { JFactory::getApplication()->redirect($link); exit; } $ticket = new SupportTicket(); if ($ticket->Load($ticketid)) { $old_st = $ticket->getStatus(); $ticket->updateStatus($ticket_status_id); $new_st = $ticket->getStatus(); // if we have closed the ticket, and return on close is set, then we should do a redirect dependant on the setting if ($new_st->is_closed && SupportUsers::getSetting("return_on_close")) { $link = SupportHelper::parseRedirectType($old_st->id, SupportUsers::getSetting("return_on_close")); } if ($new_st->is_closed && !$old_st->is_closed) { // SEND CLOSED EMAIL HERE! if (!FSS_Settings::get('support_email_on_close_no_dropdown')) { FSS_EMail::Admin_Close($ticket, $ticket->title, '', array()); } } } JFactory::getApplication()->redirect($link); exit; }