[rt-users] New ticket layout change

Parish, Brent bparish at cognex.com
Fri Sep 18 18:55:45 EDT 2015


I suspect the JavaScript answer is probably the cleanest and most flexible way.

In our environment, I have a number of departments that have all asked for their own (small) customizations for the SelfService Create Ticket page.

First I copied the CreateTicketInQueue.html page into local/html/SelfService.
Then I made a simple change to it:  An 'if' statement that checks for the presence of an HTML file in the same SelfService directory, matching the queue name.
If that HTML file is found, it will load that HTML file instead of the default 'Create.html' file.
For example, If I have a queue named "Helpdesk" and a local/html/SelfService/Helpdesk.html file is found, RT loads that one.
 
--- CreateTicketInQueue.html.orig       2015-06-19 22:46:35.970131253 -0400
+++ CreateTicketInQueue.html    2015-05-15 12:33:16.802273062 -0400
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
 %#                                          <sales at bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
@@ -47,16 +47,21 @@
 %# END BPS TAGGED BLOCK }}}
 <& Elements/Header, Title => loc("Create a ticket") &>

-<h1><&|/l&>Select a queue for your new ticket</&></h1>
+<h1><&|/l&>Please select a queue (department) for your new ticket</&></h1>

-<dl>
+<table style='qlist'>
 % while (my $queue = $queues->Next) {
 % next unless $queue->CurrentUserHasRight('CreateTicket');

-<dt><a href="<%RT->Config->Get('WebPath')%>/SelfService/Create.html?Queue=<%$queue->id%>"><%$queue->Name%></a></dt>
-<dd><%$queue->Description%></dd>
+% my $QueueName = $queue->Name;
+% if (-e "/opt/rt4/local/html/SelfService/$QueueName.html") {
+<tr><td class="qname"><a class="qname" href="<%RT->Config->Get('WebPath')%>/SelfService/<%$queue->Name%>.html?Queue=<%$queue->id%>"><%$queue->Name%></a></td>
+% } else {
+<tr><td class="qname"><a class="qname" href="<%RT->Config->Get('WebPath')%>/SelfService/Create.html?Queue=<%$queue->id%>"><%$queue->Name%></a></td>
 % }
-</dl>
+<td><%$queue->Description%></td>
+% }
+</table>
 <%init>
 my $queues = RT::Queues->new($session{'CurrentUser'});
 $queues->UnLimit;

Then within each of the queue name HTML files I customize which fields are available (Sometimes), change how they appear on the page, add 'help' text for some fields, etc.

- Brent




-----Original Message-----
From: rt-users [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Matt Zagrabelny
Sent: Friday, September 18, 2015 10:59 AM
To: Kobus Bensch
Cc: rt-users at lists.bestpractical.com
Subject: Re: [rt-users] New ticket layout change

On Fri, Sep 18, 2015 at 5:27 AM, Kobus Bensch <kobus.bensch at trustpayglobal.com> wrote:
> Hi
>
> I am in the process of creating an electronic change request system in RT.
> At the moment the layout is as follows:
>
> ----------------------------------------------------------------------
> -----------------------------------------------------------
> |  Create new ticket                                     |  Basics
> |  Requestor                                                 | Queue
> |  CC |  Status
> |  Admin CC                                                  | Owner
> |  Subject |-------------------------------------------
> |  Describe Issue                                          |Assets
> | |-------------------------------------------
> | |Custom Fields
> | |CF1
> | |cf2
> | |cf3
> | |cf4
> | |cfr5
> | |cf6
> | |cf7
> | |etc
> ----------------------------------------------------------------------
> -----------------------------------------------------------
> How do I move the Custom field section to the left and across the 
> whole page for this one queue if possible?

JavaScript.

I've not rearranged the page with JS, but I'd imagine it could be done. Good luck.

> How do I change the filed sizes for CF's on a per field basis?

JavaScript.

I have done quite a bit of work with CFs via JS and there is some overhead to pay to get initially setup due to the JS needing to use the 'id' of the element. I'd be happy to write up what I've done, but let me know if you're serious about the undertaking - it'll probably take 10 or 20 minutes to write it up.

Cheers,

-m


More information about the rt-users mailing list