Re: [rt-users] Subject required
I insert this code and it seems to work # aggiunto if (($ARGS{'id'} eq 'new') ($ARGS{'Subject'} eq '')) { my $msg = 'Ticket creation error: Subject required.'; my $QueueObj = new RT::Queue($session{'CurrentUser'}); $QueueObj-Load($ARGS{'Queue'}) || Abort(loc(Queue could not be loaded.)); my $key = Digest::MD5::md5_hex( rand(1024) ); push @{ $session{Actions}-{$key} ||= [] }, $msg; $session{'i'}++; RT::Interface::Web::Redirect( RT-Config-Get('WebURL') . Ticket/Create.html?Queue= . $QueueObj-id . results= . $key ); } #fine thank for suggestions Marco - Original Message - From: David Chandek-Stark To: Emmanuel Lacour Cc: rt-users@lists.bestpractical.com ; [EMAIL PROTECTED] Sent: Monday, September 29, 2008 9:56 PM Subject: Re: [rt-users] Subject required I happened to be working on this at the moment b/c the addition of the WYSIWYG editor in RT 3.8 broke my previous client-side method of requiring a description in a new ticket. After concluding that the client side methods were not very sustainable, I decided to try my hand at a server-side validation method. What I came up with uses the Initial callback of /Ticket/Display.html (haven't yet looked at the SelfService UI) and appears to work: %INIT if ( defined($ARGSRef-{'id'}) ($ARGSRef-{'id'} eq 'new') defined($ARGSRef-{'Subject'}) ($ARGSRef-{'Subject'} eq '') ) { my $msg = 'Ticket creation error: Subject required.'; my $QueueObj = new RT::Queue($session{'CurrentUser'}); $QueueObj-Load($ARGSRef-{'Queue'}) || Abort(loc(Queue could not be loaded.)); my $key = Digest::MD5::md5_hex( rand(1024) ); push @{ $session{Actions}-{$key} ||= [] }, $msg; $session{'i'}++; RT::Interface::Web::Redirect( RT-Config-Get('WebURL') . Ticket/Create.html?Queue= . $QueueObj-id . results= . $key ); } /%INIT %ARGS $ARGSRef $TicketObj /%ARGS Some of this code I copied from /Ticket/Display.html w/o completely understanding how it works ... Cheers, David [EMAIL PROTECTED] wrote on 09/29/2008 08:43:50 AM: On Mon, Sep 29, 2008 at 02:38:43PM +0200, Emmanuel Lacour wrote: On Mon, Sep 29, 2008 at 02:18:09PM +0200, Marco Avvisano wrote: It's possible in 3.8.1 configure a way to ensure that a ticket will always have a Subject? No, you have to modify RT. I think there is an example at http://wiki.bestpractical.com/. http://wiki.bestpractical.com/view/MandatorySubject ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com -- ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] Subject required
On Mon, Sep 29, 2008 at 02:18:09PM +0200, Marco Avvisano wrote: It's possible in 3.8.1 configure a way to ensure that a ticket will always have a Subject? No, you have to modify RT. I think there is an example at http://wiki.bestpractical.com/. ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] Subject required
On Mon, Sep 29, 2008 at 02:38:43PM +0200, Emmanuel Lacour wrote: On Mon, Sep 29, 2008 at 02:18:09PM +0200, Marco Avvisano wrote: It's possible in 3.8.1 configure a way to ensure that a ticket will always have a Subject? No, you have to modify RT. I think there is an example at http://wiki.bestpractical.com/. http://wiki.bestpractical.com/view/MandatorySubject ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] Subject required
I happened to be working on this at the moment b/c the addition of the WYSIWYG editor in RT 3.8 broke my previous client-side method of requiring a description in a new ticket. After concluding that the client side methods were not very sustainable, I decided to try my hand at a server-side validation method. What I came up with uses the Initial callback of /Ticket/Display.html (haven't yet looked at the SelfService UI) and appears to work: %INIT if ( defined($ARGSRef-{'id'}) ($ARGSRef-{'id'} eq 'new') defined($ARGSRef-{'Subject'}) ($ARGSRef-{'Subject'} eq '') ) { my $msg = 'Ticket creation error: Subject required.'; my $QueueObj = new RT::Queue($session{'CurrentUser'}); $QueueObj-Load($ARGSRef-{'Queue'}) || Abort(loc(Queue could not be loaded.)); my $key = Digest::MD5::md5_hex( rand(1024) ); push @{ $session{Actions}-{$key} ||= [] }, $msg; $session{'i'}++; RT::Interface::Web::Redirect( RT-Config-Get('WebURL') . Ticket/Create.html?Queue= . $QueueObj-id . results= . $key ); } /%INIT %ARGS $ARGSRef $TicketObj /%ARGS Some of this code I copied from /Ticket/Display.html w/o completely understanding how it works ... Cheers, David [EMAIL PROTECTED] wrote on 09/29/2008 08:43:50 AM: On Mon, Sep 29, 2008 at 02:38:43PM +0200, Emmanuel Lacour wrote: On Mon, Sep 29, 2008 at 02:18:09PM +0200, Marco Avvisano wrote: It's possible in 3.8.1 configure a way to ensure that a ticket will always have a Subject? No, you have to modify RT. I think there is an example at http://wiki.bestpractical.com/. http://wiki.bestpractical.com/view/MandatorySubject ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com