Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed user GUI to change priority of already submitted ticket. #394

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions include/class.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ function getMsgTemplate($name) {
case 'msg_autoresp':
$tpl=array('subj'=>$this->ht['message_autoresp_subj'],'body'=>$this->ht['message_autoresp_body']);
break;
case 'msg_closing':
$tpl=array('subj'=>$this->ht['message_close_subj'],'body'=>$this->ht['message_close_body']);
break;
case 'ticket_notice':
$tpl=array('subj'=>$this->ht['ticket_notice_subj'],'body'=>$this->ht['ticket_notice_body']);
break;
Expand Down Expand Up @@ -158,16 +161,21 @@ function getNewMessageAutorepMsgTemplate() {
return $this->getMsgTemplate('msg_autoresp');
}

function getAutoRespMsgTemplate() {
function getAutoRespMsgTemplate() {
return $this->getMsgTemplate('ticket_autoresp');
}

function getAutoReplyMsgTemplate() {
return $this->getMsgTemplate('ticket_autoreply');
}

function getReplyMsgTemplate() {
return $this->getMsgTemplate('ticket_reply');
function getReplyMsgTemplate($closing=false) {
if($closing==true) {
return $this->getMsgTemplate('ticket_reply');
}
else {
return $this->getMsgTemplate('msg_closing');
}
}

function getOverlimitMsgTemplate() {
Expand Down Expand Up @@ -215,6 +223,9 @@ function updateMsgTemplate($vars, &$errors) {
case 'msg_autoresp':
$sql.=',message_autoresp_subj='.db_input($vars['subj']).',message_autoresp_body='.db_input($vars['body']);
break;
case 'msg_closing':
$sql.=',message_close_subj='.db_input($vars['subj']).',message_close_body='.db_input($vars['body']);
break;
case 'ticket_notice':
$sql.=',ticket_notice_subj='.db_input($vars['subj']).',ticket_notice_body='.db_input($vars['body']);
break;
Expand Down Expand Up @@ -299,6 +310,8 @@ function message_templates(){
'desc'=>'Canned Auto-reply sent to user on new ticket, based on filter matches. Overwrites "normal" auto-response.'),
'msg_autoresp'=>array('name'=>'New Message Auto-response',
'desc'=>'Confirmation sent to user when a new message is appended to an existing ticket.'),
'msg_closing'=>array('name'=>'Ticket closing reply',
'desc'=>'Message template used when responding to a ticket that ticket is closing.'),
'ticket_notice'=>array('name'=>'New Ticket Notice',
'desc'=>'Notice sent to user, if enabled, on new ticket created by staff on their behalf (e.g phone calls).'),
'overlimit_notice'=>array('name'=>'Over Limit Notice',
Expand Down Expand Up @@ -379,6 +392,8 @@ function save($id, $vars, &$errors) {
.' ,ticket_autoresp_body='.db_input($info['ticket_autoresp_body'])
.' ,ticket_autoreply_subj='.db_input($info['ticket_autoreply_subj'])
.' ,ticket_autoreply_body='.db_input($info['ticket_autoreply_body'])
.' ,ticket_close_subj='.db_input($info['ticket_close_subj'])
.' ,ticket_close_body='.db_input($info['ticket_close_body'])
.' ,ticket_notice_subj='.db_input($info['ticket_notice_subj'])
.' ,ticket_notice_body='.db_input($info['ticket_notice_body'])
.' ,ticket_alert_subj='.db_input($info['ticket_alert_subj'])
Expand Down
5 changes: 4 additions & 1 deletion include/class.ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ class Ticket {
var $team; //Team obj
var $topic; //Topic obj
var $tlock; //TicketLock obj
var $justClosed; //If the Ticket in closing

function Ticket($id){
$this->id = 0;
$this->load($id);
$this->justClosed=false;
}

function load($id=0) {
Expand Down Expand Up @@ -804,6 +806,7 @@ function setAnsweredState($isanswered) {
//Close the ticket
function close(){
global $thisstaff;
$this->justClosed=true;

$sql='UPDATE '.TICKET_TABLE.' SET closed=NOW(),isoverdue=0, duedate=NULL, updated=NOW(), status='.db_input('closed');
if($thisstaff) //Give the closing staff credit.
Expand Down Expand Up @@ -1565,7 +1568,7 @@ function postReply($vars, &$errors, $alert = true) {
if(!$dept || !($email=$dept->getEmail()))
$email = $cfg->getDefaultEmail();

if($tpl && ($msg=$tpl->getReplyMsgTemplate()) && $email) {
if($tpl && ($msg=$tpl->getReplyMsgTemplate($justClosed)) && $email) {

if($thisstaff && $vars['signature']=='mine')
$signature=$thisstaff->getSignature();
Expand Down
22 changes: 22 additions & 0 deletions include/client/view.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,28 @@
<textarea name="message" id="message" cols="50" rows="9" wrap="soft"><?php echo $info['message']; ?></textarea>
</td>
</tr>
<?php
if($cfg->allowPriorityChange() && ($priorities=Priority::getPriorities())) { ?>
<tr>
<td>Ticket Priority:</td>
<td>
<select id="priority" name="priorityId">
<?php
if(!$info['priorityId'])
$info['priorityId'] = $ticket->getPriorityId();
foreach($priorities as $id =>$name) {
echo sprintf('<option value="%d" %s>%s</option>',
$id, ($info['priorityId']==$id)?'selected="selected"':'', $name);

}
?>
</select>
<font class="error">&nbsp;<?php echo $errors['priorityId']; ?></font>
</td>
</tr>
<?php
}
?>
<?php
if($cfg->allowOnlineAttachments()) { ?>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion main.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

#Current version && schema signature (Changes from version to version)
define('THIS_VERSION','1.7-RC3+'); //Shown on admin panel
define('SCHEMA_SIGNATURE','00ff231f2ade8797a0e7f2a7fccd52f4'); //MD5 signature of the db schema. (used to trigger upgrades)
define('SCHEMA_SIGNATURE','4da609b7a2b69987a3365a391d8c953a'); //MD5 signature of the db schema. (used to trigger upgrades)
#load config info
$configfile='';
if(file_exists(ROOT_DIR.'ostconfig.php')) //Old installs prior to v 1.6 RC5
Expand Down
6 changes: 4 additions & 2 deletions setup/inc/sql/osTicket-mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ CREATE TABLE `%TABLE_PREFIX%email_template` (
`ticket_alert_body` text NOT NULL,
`message_autoresp_subj` varchar(255) NOT NULL default '',
`message_autoresp_body` text NOT NULL,
`message_close_subj` varchar(255) NOT NULL default '',
`message_close_body` text NOT NULL,
`message_alert_subj` varchar(255) NOT NULL default '',
`message_alert_body` text NOT NULL,
`note_alert_subj` varchar(255) NOT NULL,
Expand All @@ -319,8 +321,8 @@ CREATE TABLE `%TABLE_PREFIX%email_template` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- TODO: Dump revised copy before release!!!
INSERT INTO `%TABLE_PREFIX%email_template` (`tpl_id`, `cfg_id`, `isactive`, `name`, `notes`, `ticket_autoresp_subj`, `ticket_autoresp_body`, `ticket_autoreply_subj`, `ticket_autoreply_body`, `ticket_notice_subj`, `ticket_notice_body`, `ticket_alert_subj`, `ticket_alert_body`, `message_autoresp_subj`, `message_autoresp_body`, `message_alert_subj`, `message_alert_body`, `note_alert_subj`, `note_alert_body`, `assigned_alert_subj`, `assigned_alert_body`, `transfer_alert_subj`, `transfer_alert_body`, `ticket_overdue_subj`, `ticket_overdue_body`, `ticket_overlimit_subj`, `ticket_overlimit_body`, `ticket_reply_subj`, `ticket_reply_body`, `created`, `updated`) VALUES
(1, 1, 1, 'osTicket Default Template', 'Default osTicket templates', 'Support Ticket Opened [#%{ticket.number}]', '%{ticket.name},\r\n\r\nA request for support has been created and assigned ticket #%{ticket.number}. A representative will follow-up with you as soon as possible.\r\n\r\nYou can view this ticket''s progress online here: %{ticket.client_link}.\r\n\r\nIf you wish to send additional comments or information regarding this issue, please don''t open a new ticket. Simply login using the link above and update the ticket.\r\n\r\n%{signature}', 'Support Ticket Opened [#%{ticket.number}]', '%{ticket.name},\r\n\r\nA request for support has been created and assigned ticket #%{ticket.number} with the following auto-reply:\r\n\r\n%{response}\r\n\r\n\r\nWe hope this response has sufficiently answered your questions. If not, please do not open another ticket. If need be, representative will follow-up with you as soon as possible.\r\n\r\nYou can view this ticket''s progress online here: %{ticket.client_link}.', '[#%{ticket.number}] %{ticket.subject}', '%{ticket.name},\r\n\r\nOur customer care team has created a ticket, #%{ticket.number} on your behalf, with the following message.\r\n\r\n%{message}\r\n\r\nIf you wish to provide additional comments or information regarding this issue, please don''t open a new ticket. You can update or view this ticket''s progress online here: %{ticket.client_link}.\r\n\r\n%{signature}', 'New Ticket Alert', '%{recipient},\r\n\r\nNew ticket #%{ticket.number} created.\r\n\r\n-----------------------\r\nName: %{ticket.name}\r\nEmail: %{ticket.email}\r\nDept: %{ticket.dept.name}\r\n\r\n%{message}\r\n-----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.', '[#%{ticket.number}] Message Added', '%{ticket.name},\r\n\r\nYour reply to support request #%{ticket.number} has been noted.\r\n\r\nYou can view this support request progress online here: %{ticket.client_link}.\r\n\r\n%{signature}', 'New Message Alert', '%{recipient},\r\n\r\nNew message appended to ticket #%{ticket.number}\r\n\r\n----------------------\r\nName: %{ticket.name}\r\nEmail: %{ticket.email}\r\nDept: %{ticket.dept.name}\r\n\r\n%{message}\r\n----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.', 'New Internal Note Alert', '%{recipient},\r\n\r\nInternal note appended to ticket #%{ticket.number}\r\n\r\n----------------------\r\n* %{note.title} *\r\n\r\n%{note.message}\r\n----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.', 'Ticket #%{ticket.number} Assigned to you', '%{assignee},\r\n\r\nTicket #%{ticket.number} has been assigned to you by %{assigner}\r\n\r\n----------------------\r\n\r\n%{comments}\r\n\r\n----------------------\r\n\r\nTo view complete details, simply login to the support system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Support Ticket System - powered by osTicket.', 'Ticket Transfer #%{ticket.number} - %{ticket.dept.name}', '%{recipient},\r\n\r\nTicket #%{ticket.number} has been transferred to %{ticket.dept.name} department by %{staff.name}\r\n\r\n----------------------\r\n\r\n%{comments}\r\n\r\n----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.', 'Stale Ticket Alert', '%{recipient},\r\n\r\nA ticket, #%{ticket.number} assigned to you or in your department is seriously overdue.\r\n\r\n%{ticket.staff_link}\r\n\r\nWe should all work hard to guarantee that all tickets are being addressed in a timely manner.\r\n\r\n- Your friendly (although with limited patience) Support Ticket System - powered by osTicket.', 'Open Tickets Limit Reached', '%{ticket.name}\r\n\r\nYou have reached the maximum number of open tickets allowed.\r\n\r\nTo be able to open another ticket, one of your pending tickets must be closed. To update or add comments to an open ticket simply login using the link below.\r\n\r\n%{url}/tickets.php?e=%{ticket.email}\r\n\r\nThank you.\r\n\r\nSupport Ticket System', '[#%{ticket.number}] %{ticket.subject}', '%{ticket.name},\r\n\r\nA customer support staff member has replied to your support request, #%{ticket.number} with the following response:\r\n\r\n%{response}\r\n\r\nWe hope this response has sufficiently answered your questions. If not, please do not send another email. Instead, reply to this email or login to your account for a complete archive of all your support requests and responses.\r\n\r\n%{ticket.client_link}\r\n\r\n%{signature}', NOW(), NOW());
INSERT INTO `%TABLE_PREFIX%email_template` (`tpl_id`, `cfg_id`, `isactive`, `name`, `notes`, `ticket_autoresp_subj`, `ticket_autoresp_body`, `ticket_autoreply_subj`, `ticket_autoreply_body`, `ticket_notice_subj`, `ticket_notice_body`, `ticket_alert_subj`, `ticket_alert_body`, `message_autoresp_subj`, `message_autoresp_body`, `message_alert_subj`, `message_alert_body`, `note_alert_subj`, `note_alert_body`, `assigned_alert_subj`, `assigned_alert_body`, `transfer_alert_subj`, `transfer_alert_body`, `ticket_overdue_subj`, `ticket_overdue_body`, `ticket_overlimit_subj`, `ticket_overlimit_body`, `ticket_reply_subj`, `ticket_reply_body`, `created`, `updated`, `message_close_subj`, `message_close_body`) VALUES
(1, 1, 1, 'osTicket Default Template', 'Default osTicket templates', 'Support Ticket Opened [#%{ticket.number}]', '%{ticket.name},\r\n\r\nA request for support has been created and assigned ticket #%{ticket.number}. A representative will follow-up with you as soon as possible.\r\n\r\nYou can view this ticket''s progress online here: %{ticket.client_link}.\r\n\r\nIf you wish to send additional comments or information regarding this issue, please don''t open a new ticket. Simply login using the link above and update the ticket.\r\n\r\n%{signature}', 'Support Ticket Opened [#%{ticket.number}]', '%{ticket.name},\r\n\r\nA request for support has been created and assigned ticket #%{ticket.number} with the following auto-reply:\r\n\r\n%{response}\r\n\r\n\r\nWe hope this response has sufficiently answered your questions. If not, please do not open another ticket. If need be, representative will follow-up with you as soon as possible.\r\n\r\nYou can view this ticket''s progress online here: %{ticket.client_link}.', '[#%{ticket.number}] %{ticket.subject}', '%{ticket.name},\r\n\r\nOur customer care team has created a ticket, #%{ticket.number} on your behalf, with the following message.\r\n\r\n%{message}\r\n\r\nIf you wish to provide additional comments or information regarding this issue, please don''t open a new ticket. You can update or view this ticket''s progress online here: %{ticket.client_link}.\r\n\r\n%{signature}', 'New Ticket Alert', '%{recipient},\r\n\r\nNew ticket #%{ticket.number} created.\r\n\r\n-----------------------\r\nName: %{ticket.name}\r\nEmail: %{ticket.email}\r\nDept: %{ticket.dept.name}\r\n\r\n%{message}\r\n-----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.', '[#%{ticket.number}] Message Added', '%{ticket.name},\r\n\r\nYour reply to support request #%{ticket.number} has been noted.\r\n\r\nYou can view this support request progress online here: %{ticket.client_link}.\r\n\r\n%{signature}', 'New Message Alert', '%{recipient},\r\n\r\nNew message appended to ticket #%{ticket.number}\r\n\r\n----------------------\r\nName: %{ticket.name}\r\nEmail: %{ticket.email}\r\nDept: %{ticket.dept.name}\r\n\r\n%{message}\r\n----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.', 'New Internal Note Alert', '%{recipient},\r\n\r\nInternal note appended to ticket #%{ticket.number}\r\n\r\n----------------------\r\n* %{note.title} *\r\n\r\n%{note.message}\r\n----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.', 'Ticket #%{ticket.number} Assigned to you', '%{assignee},\r\n\r\nTicket #%{ticket.number} has been assigned to you by %{assigner}\r\n\r\n----------------------\r\n\r\n%{comments}\r\n\r\n----------------------\r\n\r\nTo view complete details, simply login to the support system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Support Ticket System - powered by osTicket.', 'Ticket Transfer #%{ticket.number} - %{ticket.dept.name}', '%{recipient},\r\n\r\nTicket #%{ticket.number} has been transferred to %{ticket.dept.name} department by %{staff.name}\r\n\r\n----------------------\r\n\r\n%{comments}\r\n\r\n----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.', 'Stale Ticket Alert', '%{recipient},\r\n\r\nA ticket, #%{ticket.number} assigned to you or in your department is seriously overdue.\r\n\r\n%{ticket.staff_link}\r\n\r\nWe should all work hard to guarantee that all tickets are being addressed in a timely manner.\r\n\r\n- Your friendly (although with limited patience) Support Ticket System - powered by osTicket.', 'Open Tickets Limit Reached', '%{ticket.name}\r\n\r\nYou have reached the maximum number of open tickets allowed.\r\n\r\nTo be able to open another ticket, one of your pending tickets must be closed. To update or add comments to an open ticket simply login using the link below.\r\n\r\n%{url}/tickets.php?e=%{ticket.email}\r\n\r\nThank you.\r\n\r\nSupport Ticket System', '[#%{ticket.number}] %{ticket.subject}', '%{ticket.name},\r\n\r\nA customer support staff member has replied to your support request, #%{ticket.number} with the following response:\r\n\r\n%{response}\r\n\r\nWe hope this response has sufficiently answered your questions. If not, please do not send another email. Instead, reply to this email or login to your account for a complete archive of all your support requests and responses.\r\n\r\n%{ticket.client_link}\r\n\r\n%{signature}', NOW(), NOW(),'[#%{ticket.number}] Closing ticket %{ticket.subject}','%{ticket.name},\r\n\r\nA customer support staff member has closed to your support request, #%{ticket.number} with the following response:\r\n\r\n%{response}\r\n\r\nWe hope this response has sufficiently answered your questions. If not, please do not send another email. Instead, reply to this email or login to your account for a complete archive of all your support requests and responses.\r\n\r\n%{ticket.client_link}\r\n\r\n%{signature}');

DROP TABLE IF EXISTS `%TABLE_PREFIX%file`;
CREATE TABLE `%TABLE_PREFIX%file` (
Expand Down
2 changes: 1 addition & 1 deletion setup/inc/sql/osTicket-mysql.sql.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
00ff231f2ade8797a0e7f2a7fccd52f4
4da609b7a2b69987a3365a391d8c953a
3 changes: 3 additions & 0 deletions tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
$ost->validateFileUploads($files); //Validator sets errors - if any.
$ticket->uploadAttachments($files, $msgid, 'M');
}
if($cfg->allowPriorityChange()) {
$ticket->setPriority($_POST['priorityId']);
}
$msg='Message Posted Successfully';
} else {
$errors['err']='Unable to post the message. Try again';
Expand Down