PauloV Posted February 15, 2014 Report Share Posted February 15, 2014 Hello, Wen we have a signature, and open a ticket, wen we select an Predefined Response, it posts after the signature, and not before the signature. Regards, Paulo Vidal Michael 1 Quote Link to comment Share on other sites More sharing options...
Michael Posted February 16, 2014 Report Share Posted February 16, 2014 I'm not sure if that's a bug or a feature request mate but yeah it would help haha. PauloV 1 Quote Link to comment Share on other sites More sharing options...
MemoryX2 Posted February 16, 2014 Report Share Posted February 16, 2014 I'm not sure if that's a bug or a feature request mate but yeah it would help haha. While it may not be specifically a built in feature I really see that as a bug. PauloV 1 Quote Link to comment Share on other sites More sharing options...
Paul Posted February 16, 2014 Report Share Posted February 16, 2014 Consider this: You're typing something, and then you want to enter the predefined response. It appears as the end of what you're typing. Perfect. But it has no idea where your response ends, and where your signature begins. Either we have to enter the predefined response at the beginning of the reply, or the end. I'm sure a case could be made for both methods. Quote Link to comment Share on other sites More sharing options...
PauloV Posted February 16, 2014 Author Report Share Posted February 16, 2014 Hello, I also consider a annoying "bug" (its not actualy a bug, but its very annoying, lol) I will trie to see how WHMCS/Hostbill/ClentExec has implemented this, because on outher solutions it works that way Maybe some javascript execution after click on "Predefined Response" that gets the ticket text, add first the Predefined Response and after the rest of the ticket text I think its easy I will post a solution later Regards, Paulo V Quote Link to comment Share on other sites More sharing options...
PauloV Posted February 16, 2014 Author Report Share Posted February 16, 2014 (edited) Hello see next post with a working solution Regards, Paulo V Edited February 20, 2014 by Paulo V Quote Link to comment Share on other sites More sharing options...
PauloV Posted February 17, 2014 Author Report Share Posted February 17, 2014 Final solution that is 100% working, and now, can add also responses on character focus, the way that should work Open plugins/support_manager/views/default/admin_tickets_add.pdt on line 177 change from: function setPredefinedResponse(response_id) { $(document).blestaRequest('GET', '" . $this->Html->safe($this->base_uri . "plugin/support_manager/admin_tickets/getresponse/") . "' + response_id, {}, function(data) { if (data) { $('#details').val($('#details').val() + data); $('#details').scrollTop($('#details')[0].scrollHeight); } }, null, {dataType:'json'} ); } To: jQuery.fn.extend({ insertAtCaret: function(myValue){ return this.each(function(i) { if (document.selection) { //For browsers like Internet Explorer this.focus(); sel = document.selection.createRange(); sel.text = myValue; this.focus(); } else if (this.selectionStart || this.selectionStart == '0') { //For browsers like Firefox and Webkit based var startPos = this.selectionStart; var endPos = this.selectionEnd; var scrollTop = this.scrollTop; this.value = this.value.substring(0, startPos)+myValue+this.value.substring(endPos,this.value.length); this.focus(); this.selectionStart = startPos + myValue.length; this.selectionEnd = startPos + myValue.length; this.scrollTop = scrollTop; } else { this.value += myValue; this.focus(); } }) } }); function setPredefinedResponse(response_id) { $(document).blestaRequest('GET', '" . $this->Html->safe($this->base_uri . "plugin/support_manager/admin_tickets/getresponse/") . "' + response_id, {}, function(data) { if (data) { $('#details').insertAtCaret(data); } }, null, {dataType:'json'} ); } Please test and send feedback Regards, Paulo V PauloV 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.