FYI - Add a Nice Go to reply button in the view ticket page
Posted: Thu Jan 23, 2025 9:56 pm
Premise: My preferred setup for the ticket view page is to have the form for adding a reply located at the bottom of the page.
Note: In this thread, I demonstrate my hack to add a nice icon with a multilingual "Add a reply" label.
You can see the final result here https://ibb.co/PzJsxXg
The annoying issue:
When, as a staff member, you are viewing a ticket in my preferred mode and the ticket has several messages, adding a reply becomes tedious. You must manually scroll through the entire page, and the more messages there are, the longer and more frustrating the scrolling action becomes.
The proposal:
With this message, I propose to the developers team, adding a button, icon, or link to quickly scroll to the reply form.
Formally, this would serve as a scroll-to-bottom facilitation feature.
The solution:
consists in the editing of two files
edit the file /inc/header.inc.php
around line 216 find the code
right after the closing tag </script> add a new line and add this code
save the file
now open the file /admin/admin_ticket.php
around line 819 find the code
right after the closing tag </h3> add a new line and add this code
save the file
hack done
Now, on the line where the ticket subject sits, in the middle of the row, before the "Add note" button, you'll find the "Add reply" button.
Clicking it will make the ticket page scroll to the bottom.
Note: In this thread, I demonstrate my hack to add a nice icon with a multilingual "Add a reply" label.
You can see the final result here https://ibb.co/PzJsxXg
The annoying issue:
When, as a staff member, you are viewing a ticket in my preferred mode and the ticket has several messages, adding a reply becomes tedious. You must manually scroll through the entire page, and the more messages there are, the longer and more frustrating the scrolling action becomes.
The proposal:
With this message, I propose to the developers team, adding a button, icon, or link to quickly scroll to the reply form.
Formally, this would serve as a scroll-to-bottom facilitation feature.
The solution:
consists in the editing of two files
edit the file /inc/header.inc.php
around line 216 find the code
Code: Select all
jQuery('.back-to-top').click(function(event) {
event.preventDefault();
jQuery('html, body').animate({scrollTop: 0}, duration);
return false;
})
});
</script>
Code: Select all
<script>
jQuery(document).ready(function () {
jQuery('.go-to-bottom').click(function () {
jQuery("html, body").animate({
scrollTop: $('html, body').get(0).scrollHeight
}, 1000);
});
});
</script>
now open the file /admin/admin_ticket.php
around line 819 find the code
Code: Select all
<div class="tooltype right out-close">
<svg class="icon icon-lock">
<use xlink:href="<?php echo HESK_PATH; ?>img/sprite.svg#icon-lock"></use>
</svg>
<div class="tooltype__content">
<div class="tooltype__wrapper">
<?php echo $hesklang['loc'].' - '.$hesklang['isloc']; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php echo $ticket['subject']; ?>
</h3>
Code: Select all
<a href="#" class="go-to-bottom" title="<?php echo $hesklang['add_reply']; ?>" style="margin-right: 15px; text-decoration:none">
<svg class="icon icon-edit-ticket">
<use xlink:href="../img/sprite.svg#icon-edit-ticket"></use>
</svg>
<?php echo $hesklang['add_reply']; ?>
</a>
hack done

Now, on the line where the ticket subject sits, in the middle of the row, before the "Add note" button, you'll find the "Add reply" button.
Clicking it will make the ticket page scroll to the bottom.