<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I insert this code and it seems to
work</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2># aggiunto<BR>if (($ARGS{'id'} eq 'new') &&
($ARGS{'Subject'} eq ''))<BR> {<BR> my $msg
= 'Ticket creation error: Subject required.';<BR> my $QueueObj
= new RT::Queue($session{'CurrentUser'});<BR>
$QueueObj->Load($ARGS{'Queue'}) || Abort(loc("Queue could not be
loaded."));<BR> my $key = Digest::MD5::md5_hex( rand(1024)
);<BR> push @{ $session{"Actions"}->{$key} ||= [] },
$msg;<BR> $session{'i'}++;<BR>
RT::Interface::Web::Redirect( RT->Config->Get('WebURL') .
"Ticket/Create.html?Queue=" . $QueueObj->id . "&results=" . $key
);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>}<BR>#fine<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>thank for suggestions</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Marco</FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV></FONT>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=david.chandek.stark@duke.edu
href="mailto:david.chandek.stark@duke.edu">David Chandek-Stark</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=elacour@easter-eggs.com
href="mailto:elacour@easter-eggs.com">Emmanuel Lacour</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Cc:</B> <A
title=rt-users@lists.bestpractical.com
href="mailto:rt-users@lists.bestpractical.com">rt-users@lists.bestpractical.com</A>
; <A title=rt-users-bounces@lists.bestpractical.com
href="mailto:rt-users-bounces@lists.bestpractical.com">rt-users-bounces@lists.bestpractical.com</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, September 29, 2008 9:56
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [rt-users] Subject
required</DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><FONT face=Arial size=2></FONT><BR></DIV><BR><FONT
face=sans-serif size=2>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:</FONT> <BR><BR><TT><FONT size=2><%INIT></FONT></TT>
<BR><TT><FONT size=2>if ( defined($ARGSRef->{'id'}) &&
($ARGSRef->{'id'} eq 'new') && </FONT></TT><BR><TT><FONT
size=2> defined($ARGSRef->{'Subject'}) &&
($ARGSRef->{'Subject'} eq '')</FONT></TT> <BR><TT><FONT size=2>
) {</FONT></TT> <BR><TT><FONT size=2> my $msg = 'Ticket
creation error: Subject required.';</FONT></TT> <BR><TT><FONT size=2>
my $QueueObj = new RT::Queue($session{'CurrentUser'});</FONT></TT>
<BR><TT><FONT size=2> $QueueObj->Load($ARGSRef->{'Queue'})
|| Abort(loc("Queue could not be loaded."));</FONT></TT> <BR><TT><FONT
size=2> my $key = Digest::MD5::md5_hex( rand(1024) );</FONT></TT>
<BR><TT><FONT size=2> push @{ $session{"Actions"}->{$key} ||=
[] }, $msg;</FONT></TT> <BR><TT><FONT size=2>
$session{'i'}++;</FONT></TT> <BR><TT><FONT size=2>
RT::Interface::Web::Redirect( RT->Config->Get('WebURL') .
"Ticket/Create.html?Queue=" . $QueueObj->id . "&results=" . $key
);</FONT></TT> <BR><TT><FONT size=2>}</FONT></TT> <BR><TT><FONT
size=2></%INIT></FONT></TT> <BR><TT><FONT
size=2><%ARGS></FONT></TT> <BR><TT><FONT size=2>$ARGSRef</FONT></TT>
<BR><TT><FONT size=2>$TicketObj</FONT></TT> <BR><TT><FONT
size=2></%ARGS></FONT></TT> <BR><BR><FONT face=sans-serif size=2>Some of
this code I copied from /Ticket/Display.html w/o completely understanding how
it works ...</FONT> <BR><BR><FONT face=sans-serif size=2>Cheers,</FONT>
<BR><FONT face=sans-serif size=2>David</FONT> <BR><BR><TT><FONT
size=2>rt-users-bounces@lists.bestpractical.com wrote on 09/29/2008 08:43:50
AM:<BR><BR>> On Mon, Sep 29, 2008 at 02:38:43PM +0200, Emmanuel Lacour
wrote:<BR>> > On Mon, Sep 29, 2008 at 02:18:09PM +0200, Marco Avvisano
wrote:<BR>> > > <BR>> > > It's possible in 3.8.1
configure a way to ensure that a ticket <BR>> will always <BR>> >
> have a Subject?<BR>> > > <BR>> > <BR>> > No, you
have to modify RT. I think there is an example at<BR>> > </FONT></TT><A
href="http://wiki.bestpractical.com/"><TT><FONT
size=2>http://wiki.bestpractical.com/.<BR>> > <BR>> <BR>>
</FONT></TT><A
href="http://wiki.bestpractical.com/view/MandatorySubject"><TT><FONT
size=2>http://wiki.bestpractical.com/view/MandatorySubject<BR>> <BR>>
_______________________________________________<BR>> </FONT></TT><A
href="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users"><TT><FONT
size=2>http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users<BR>>
<BR>> Community help: </FONT></TT><A
href="http://wiki.bestpractical.com/"><TT><FONT
size=2>http://wiki.bestpractical.com<BR>> Commercial support:
sales@bestpractical.com<BR>> <BR>> <BR>> Discover RT's hidden secrets
with RT Essentials from O'Reilly Media. <BR>> Buy a copy at </FONT></TT><A
href="http://rtbook.bestpractical.com/"><TT><FONT
size=2>http://rtbook.bestpractical.com<BR></FONT></TT></A></A></A></A></A>
<P>
<HR>
<P></P>_______________________________________________<BR>http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users<BR><BR>Community
help: http://wiki.bestpractical.com<BR>Commercial support:
sales@bestpractical.com<BR><BR><BR>Discover RT's hidden secrets with RT
Essentials from O'Reilly Media. <BR>Buy a copy at
http://rtbook.bestpractical.com</BLOCKQUOTE></BODY></HTML>