FYI - Add a Nice Go to reply button in the view ticket page

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
corsari
Posts: 12
Joined: Sun Dec 29, 2024 4:06 pm

FYI - Add a Nice Go to reply button in the view ticket page

Post by corsari »

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

Code: Select all

            jQuery('.back-to-top').click(function(event) {
                event.preventDefault();
                jQuery('html, body').animate({scrollTop: 0}, duration);
                return false;
            })
        });
        </script>
right after the closing tag </script> add a new line and add this code

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>
save the file

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>
right after the closing tag </h3> add a new line and add this code

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>
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.
shadedk
Posts: 35
Joined: Fri Aug 07, 2020 1:17 pm

Re: FYI - Add a Nice Go to reply button in the view ticket page

Post by shadedk »

Hello Corsari,

If you under: Settings => Help Desk => Hesk Desk Settings, set the "Reply form" to "Show form at top" then the reply form is always show as the first thing on the page, so it is quick and easy to access.
corsari
Posts: 12
Joined: Sun Dec 29, 2024 4:06 pm

Re: FYI - Add a Nice Go to reply button in the view ticket page

Post by corsari »

That is unwanted

Because when opening a ticket , I want the last message in the viewport

Infact in my post , in the first three lines you can read

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.

Thank you for the hint , the option was known but the form at top is too bulky , or if you prefer, it takes too much space .
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Re: FYI - Add a Nice Go to reply button in the view ticket page

Post by Klemen »

Thanks for sharing your solution.

People have different preferences, and I think it won't be hard to include such a solution in the 3.6.x release.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply