Resend response properly working
This commit is contained in:
parent
e086322332
commit
4deedc73b4
@ -1501,14 +1501,19 @@ function hesk_getAdminButtonsInTicket($reply = 0, $white = 1)
|
|||||||
$options = $reply ? '' : '<div class="pull-right">';
|
$options = $reply ? '' : '<div class="pull-right">';
|
||||||
|
|
||||||
// Resend email notification
|
// Resend email notification
|
||||||
|
$replyDataAttribute = '';
|
||||||
if ($reply) {
|
if ($reply) {
|
||||||
$options .= '
|
$replyDataAttribute = 'data-reply-id="' . $reply['id'] . '"';
|
||||||
<button class="btn btn-default" data-action="resend-email-notification" data-reply-id="' . $reply['id'] . '" data-ticket-id="' . $ticket['id'] . '">
|
|
||||||
<i class="fa fa-envelope navy-blue"></i> Resend Email Notification[!]
|
|
||||||
</button>
|
|
||||||
';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$options .= '
|
||||||
|
<button class="btn btn-default" data-action="resend-email-notification" ' . $replyDataAttribute . ' data-ticket-id="' . $ticket['id'] . '">
|
||||||
|
<i class="fa fa-envelope navy-blue"></i> ' . $hesklang['resend_email_notification'] . '
|
||||||
|
</button>
|
||||||
|
<span id="lang_email_notification_sent" style="display: none">' . $hesklang['email_notification_sent'] . '</span>
|
||||||
|
<span id="lang_email_notification_resend_failed" style="display: none">' . $hesklang['email_notification_resend_failed'] . '</span>
|
||||||
|
';
|
||||||
|
|
||||||
/* Edit post */
|
/* Edit post */
|
||||||
if ($can_edit) {
|
if ($can_edit) {
|
||||||
$tmp = $reply ? '&reply=' . $reply['id'] : '';
|
$tmp = $reply ? '&reply=' . $reply['id'] : '';
|
||||||
|
@ -49,42 +49,26 @@ $(document).ready(function() {
|
|||||||
var ticketId = $this.data('ticket-id');
|
var ticketId = $this.data('ticket-id');
|
||||||
var replyId = $this.data('reply-id');
|
var replyId = $this.data('reply-id');
|
||||||
var heskUrl = $('span#heskUrl').text();
|
var heskUrl = $('span#heskUrl').text();
|
||||||
var apiUrl = heskUrl + '/api/v1-internal/staff/tickets/' + ticketId + '/resend-email?replyId=' + replyId;
|
var apiUrl = heskUrl + '/api/v1-internal/staff/tickets/' + ticketId + '/resend-email';
|
||||||
|
|
||||||
|
if (replyId !== undefined) {
|
||||||
|
apiUrl += '?replyId=' + replyId;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this.attr('disabled', true);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: apiUrl,
|
url: apiUrl,
|
||||||
headers: { 'X-Internal-Call': true },
|
headers: { 'X-Internal-Call': true },
|
||||||
success: function() {
|
success: function() {
|
||||||
$.jGrowl("Email notification sent!", { theme: 'alert-success', closeTemplate: '' });
|
$.jGrowl($('#lang_email_notification_sent').text(), { theme: 'alert-success', closeTemplate: '' });
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
$.jGrowl("Error occurred when trying to send notification email", { theme: 'alert-danger', closeTemplate: '' });
|
$.jGrowl($('#lang_email_notification_resend_failed').text(), { theme: 'alert-danger', closeTemplate: '' });
|
||||||
|
},
|
||||||
|
complete: function() {
|
||||||
|
$this.attr('disabled', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
window.onbeforeunload = function (e) {
|
|
||||||
e = e || window.event;
|
|
||||||
|
|
||||||
var plaintextEditorHasContents = $('textarea[name="message"]').val() !== '';
|
|
||||||
var htmlEditorHasContents = false;
|
|
||||||
|
|
||||||
if (tinymce.get("message") !== undefined) {
|
|
||||||
plaintextEditorHasContents = false;
|
|
||||||
htmlEditorHasContents = tinymce.get("message").getContent() !== '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (plaintextEditorHasContents || htmlEditorHasContents) {
|
|
||||||
var $langText = $('#lang_ticket_message_contents_exist');
|
|
||||||
|
|
||||||
// For IE and Firefox prior to version 4
|
|
||||||
if (e) {
|
|
||||||
e.returnValue = $langText.text();
|
|
||||||
}
|
|
||||||
|
|
||||||
// For Safari
|
|
||||||
return $langText.text();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
});
|
@ -48,6 +48,9 @@ $hesklang['EMAIL_HR']='------ Reply above this line ------';
|
|||||||
// ADDED OR MODIFIED IN Mods for HESK 3.1.0
|
// ADDED OR MODIFIED IN Mods for HESK 3.1.0
|
||||||
$hesklang['stack_trace_header'] = 'Stack Trace';
|
$hesklang['stack_trace_header'] = 'Stack Trace';
|
||||||
$hesklang['ticket_message_contents_exist'] = 'The ticket message is not empty. Are you sure you want to leave this page?';
|
$hesklang['ticket_message_contents_exist'] = 'The ticket message is not empty. Are you sure you want to leave this page?';
|
||||||
|
$hesklang['resend_email_notification'] = 'Re-send Email Notification';
|
||||||
|
$hesklang['email_notification_sent'] = 'Email notification sent!';
|
||||||
|
$hesklang['email_notification_resend_failed'] = 'Error occurred when trying to send notification email.';
|
||||||
|
|
||||||
// ADDED OR MODIFIED IN Mods for HESK 3.0.0
|
// ADDED OR MODIFIED IN Mods for HESK 3.0.0
|
||||||
$hesklang['you_have_x_messages'] = 'You have %s new %s'; // %s: Number of new messages, "message" or "messages", depending on #
|
$hesklang['you_have_x_messages'] = 'You have %s new %s'; // %s: Number of new messages, "message" or "messages", depending on #
|
||||||
|
Loading…
x
Reference in New Issue
Block a user