<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I'm using RT 4.04.<br>
I want to make a callback on top of the page that if a CF is empty
when I resolve one ticket....<br>
I search in rt-users and I found this one user that do this:<br>
<br>
<br>
<font size="2" color="black" face="Verdana,Arial,Helvetica"><font
size="2" color="black" face="Verdana,Arial,Helvetica">Part 1:
"Modify.html/Default" callback (user submitted a form from <br>
The Basics) <br>
<br>
<%INIT> <br>
<font color="#660066"># Modify.html/Default <br>
</font> <br>
my $ARGSRef = $ARGS{'ARGSRef'}; <br>
<font color="#660066"># Bail if a resolve operation is not being
tried. <br>
</font>my $Status = $$ARGSRef{'Status'}; <br>
if ($Status !~ /resolved/) { <br>
return 1; <br>
} <br>
<br>
my $ticket = LoadTicket($$ARGSRef{'id'}); <br>
my $CustomFields =
$ticket->QueueObj->TicketCustomFields(); <br>
while (my $CustomField = $CustomFields->Next()) { <br>
my $nam = $CustomField->Name; <br>
my $val = $ticket->FirstCustomFieldValue($nam); <br>
<br>
if (($nam =~ /SomeRequiredField/i) and ($val =~ /^\s*$/)) { <br>
Abort("ERROR: SomeRequiredField must be set to allow resolving.
<br>
Please use your browser's 'Back' button to correct this issue as
<br>
desired."); <br>
} <br>
} <br>
<br>
return 1; <br>
<br>
</%INIT> <br>
<%ARGS> <br>
</%ARGS> <br>
<br>
<font color="#660066">======================================================================
<br>
</font> <br>
Part 2: "Update.html/Initial" callback. User clicked "Resolve" <br>
hyperlink on a ticket (upper right). <br>
<br>
<%INIT> <br>
my $ARGSRef = $ARGS{'ARGSRef'}; <br>
<br>
<font color="#660066"># Bail if a resolve operation is not being
tried. <br>
</font>my $DefaultStatus = $$ARGSRef{'DefaultStatus'}; <br>
if ($DefaultStatus !~ /resolved/) { <br>
return 1; <br>
} <br>
<br>
my $ticket = LoadTicket($$ARGSRef{'id'}); <br>
my $CustomFields =
$ticket->QueueObj->TicketCustomFields(); <br>
while (my $CustomField = $CustomFields->Next()) { <br>
my $nam = $CustomField->Name; <br>
my $val = $ticket->FirstCustomFieldValue($nam); <br>
<br>
if (($nam =~ /SomeRequiredField/i) and ($val =~ /^\s*$/)) { <br>
Abort("ERROR: SomeRequiredField must be set to allow resolving.
<br>
Please use your browser's 'Back' button to correct this issue as
<br>
desired."); } <br>
} <br>
<br>
return 1; <br>
<br>
</%INIT> <br>
<%ARGS> <br>
</%ARGS>
</font></font><br>
<br>
<br>
<br>
I can't understand how I can put this in RT , I suppose that <span
id="result_box" class="short_text" lang="en"><span class="hps">the
above code</span> <span class="hps">is written for</span> <span
class="hps">RT 3 and not for RT4 because I don't find 'Initial'
or 'Default'.<br>
<br>
Any ideas that </span></span><span id="result_box" class=""
lang="en"><span class="hps">how I can</span> <span class="hps">implement
or</span> <span class="hps">where exactly</span> <span
class="hps">I have to put</span> <span class="hps">the above
code</span> <span class="hps">to make me</span> <span
class="hps">a</span> <span class="hps">callback</span> <span
class="hps">with a message if there are any CF empty on resolve?<br>
<br>
<br>
THANKS!<br>
</span></span>
<pre class="moz-signature" cols="72">--
.......................................................................
__
/ / Daniel García Mejía
C E / S / C A Portals i Repositoris
/_/ Centre de Serveis Científics i Acadèmics de Catalunya
Gran Capità, 2-4 (Edifici Nexus) - 08034 Barcelona
T. (NULL) - F. 93 205 6979 - <a class="moz-txt-link-abbreviated" href="mailto:dgarcia@cesca.cat">dgarcia@cesca.cat</a>
.......................................................................
</pre>
</body>
</html>