[rt-users] SelfService update for "New ticket"

Rick Russell rickr at rice.edu
Wed Jun 15 23:14:39 EDT 2005


Ruslan U. Zakirov wrote:
> Please send `diff -u` patch.

Since Ken is Real Busy getting our RT 3.4 installation up and running, I'll
post his diff:

Kenneth Marshall wrote:

>This is a patch to RT-3.4.2 share/html/SelfService/Elements/Tabs
>to drop directly to the Create screen if the user only has access
>to a single queue. Otherwise the tree of queues will be displayed.
>Ken Marshall

diff -u share/html/SelfService/Elements/Tabs local/html/SelfService/Elements/Tabs

--- share/html/SelfService/Elements/Tabs	2005-05-02 12:25:35.000000000 -0500
+++ local/html/SelfService/Elements/Tabs	2005-06-10 07:36:06.000000000 -0500
@@ -52,6 +52,18 @@
  &>
  <a name="skipnav" id="skipnav" accesskey="8"></a>
  <%INIT>
+my $queues = RT::Queues->new($session{'CurrentUser'});
+$queues->UnLimit;
+
+my $queue_count = 0;
+my $queue_id = 1;
+
+while (my $queue = $queues->Next) {
+  next unless $queue->CurrentUserHasRight('CreateTicket');
+  $queue_id = $queue->id;
+  $queue_count++;
+  last if ($queue_count > 1);
+}

  if ($Title) {
  $Title = loc ("RT Self Service") . " / " . $Title;
@@ -65,11 +77,19 @@
                        },
               B => { title => loc('Closed tickets'),
                           path => 'SelfService/Closed.html',
-                       },
-             C => { title => loc('New ticket'),
-                    path => 'SelfService/CreateTicketInQueue.html'
-                    }
+                       }
             };
+
+if ($queue_count > 1) {
+        $tabs->{C} = { title => loc('New ticket'),
+                       path => 'SelfService/CreateTicketInQueue.html'
+                       };
+} else {
+        $tabs->{C} = { title => loc('New ticket'),
+                       path => 'SelfService/Create.html?Queue=' . $queue_id
+                       };
+}
+
  if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf',
  				       Object => $RT::System )) {
  	$tabs->{Z} = { title => loc('Preferences'),


-- 
For computer help, call xHELP (x4357 or 713-348-4357)
On the web: http://helpdesk.rice.edu/
--
Rick Russell
Helpdesk Supervisor, Client Services
IT/Academic & Research Computing
Rice University
Voice: 713.348.5267  Fax: 713.348.6099
--
OpenPGP/GnuPG Public Key at ldap://certificate.rice.edu
761D 1C20 6428 580F BD98  F5E5 5C8C 56CA C7CB B669

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20050615/c5a76e63/attachment.sig>


More information about the rt-users mailing list