Newer
Older
<?php csrf_token(); ?>
<input type="hidden" name="id" value="<?php echo $ticket->getId(); ?>">
<input type="hidden" name="a" value="process">
<input type="hidden" name="do" id="action" value="">
<hr style="margin-top:1em"/>
<p class="full-width">
<span class="buttons pull-left">
<input type="button" value="<?php echo __('Cancel');?>" class="close">
</span>
<span class="buttons pull-right">
<input type="submit" value="<?php echo __('OK');?>">
</span>
</p>
</form>
<div class="clear"></div>
</div>
<script type="text/javascript">
$(function() {
$(document).on('click', 'a.change-user', function(e) {
e.preventDefault();
var tid = <?php echo $ticket->getOwnerId(); ?>;
var cid = <?php echo $ticket->getOwnerId(); ?>;
var url = 'ajax.php/'+$(this).attr('href').substr(1);
$.userLookup(url, function(user) {
if(cid!=user.id
&& $('.dialog#confirm-action #changeuser-confirm').length) {
$('#newuser').html(user.name +' <'+user.email+'>');
$('.dialog#confirm-action #action').val('changeuser');
$('#confirm-form').append('<input type=hidden name=user_id value='+user.id+' />');
$('#overlay').show();
$('.dialog#confirm-action .confirm-action').hide();
$('.dialog#confirm-action p#changeuser-confirm')
.show()
.parent('div').show().trigger('click');
}
});
});
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
// Post Reply or Note action buttons.
$('a.post-response').click(function (e) {
var $r = $('ul.tabs > li > a'+$(this).attr('href')+'-tab');
if ($r.length) {
// Make sure ticket thread tab is visiable.
var $t = $('ul#ticket_tabs > li > a#ticket-thread-tab');
if ($t.length && !$t.hasClass('active'))
$t.trigger('click');
// Make the target response tab active.
if (!$r.hasClass('active'))
$r.trigger('click');
// Scroll to the response section.
var $stop = $(document).height();
var $s = $('div#response_options');
if ($s.length)
$stop = $s.offset().top-125
$('html, body').animate({scrollTop: $stop}, 'fast');
}
return false;
});
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
$(function() {
$("#cc_users").select2({width: '350px'});
$("#bcc_users").select2({width: '350px'});
});
$(function() {
$('#cc_users').on("select2:select", function(e) {
var el = $(this);
var tid = <?php echo $ticket->getThreadId(); ?>;
if(el.val().includes("NEW")) {
$("li[title='— Add New —']").remove();
var url = 'ajax.php/thread/' + tid + '/add-collaborator' ;
$.userLookup(url, function(user) {
e.preventDefault();
if($('.dialog#confirm-action').length) {
$('.dialog#confirm-action #action').val('addcc');
$('#confirm-form').append('<input type=hidden name=user_id value='+user.id+' />');
$('#overlay').show();
}
});
var arr = el.val();
var removeStr = "NEW";
arr.splice($.inArray(removeStr, arr),1);
$(this).val(arr);
}
});
$('#bcc_users').on("select2:select", function(e) {
var el = $(this);
var tid = <?php echo $ticket->getThreadId(); ?>;
if(el.val().includes("NEW")) {
$("li[title='— Add New —']").remove();
var url = 'ajax.php/thread/' + tid + '/add-collaborator' ;
$.userLookup(url, function(user) {
e.preventDefault();
if($('.dialog#confirm-action').length) {
$('.dialog#confirm-action #action').val('addbcc');
$('#confirm-form').append('<input type=hidden name=user_id value='+user.id+' />');
$('#overlay').show();
}
});
var arr = el.val();
var removeStr = "NEW";
arr.splice($.inArray(removeStr, arr),1);
$(this).val(arr);
}
});
$('#cc_users').on("select2:unselecting", function(e) {
var confirmation = confirm(__("Are you sure you want to remove the collaborator from receiving this reply?"));
if (confirmation == false) {
$('#cc_users').on("select2:opening", function(e) {
return false;
});
return false;
}
});
$('#bcc_users').on("select2:unselecting", function(e) {
var confirmation = confirm(__("Are you sure you want to remove the collaborator from receiving this reply?"));
if (confirmation == false) {
$('#bcc_users').on("select2:opening", function(e) {
return false;
});
return false;
}
});
});