Hi everyone,

I'm using an extension to ./local/html/Ticket/Elements/ShowTransaction
that allows me to create dependant tickets based on the current
correspondence in the ticket's history.

Before adding the "create ticket" button bellow a correspondence, I use
the following check:

% if ( $Transaction->Type =~ /^(Create|Correspond|Comment)$/ && 
$Ticket->QueueObj->Name !~ /^Approval$/) {

This works fine, EXCEPT when viewing approvals with the /Approvals/
page. The /Approvals/ page shows each approval ticket, and includes the
history of every dependant ticket. This history list uses
./local/html/Ticket/Elements/ShowTransaction, so the "create ticket"
buttons are displayed. I'd like to avoid this. :-)

So, my question is, how can I expand the above "if" test in
./local/html/Ticket/Elements/ShowTransaction to check that it's being
called by the /Approvals/ page?

And in case you were interested in the complete code, I've attached a
diff.

Thanks,
js.
-- 
Jean-Sebastien Morisset, Sr. UNIX Administrator <[EMAIL PROTECTED]>
47a48
> 
64d64
< 
90a91,92
> $Verbose => 0
> $Default => 0
103,104c105
<     }
<     else {
---
>     } else {
107,108c108
< }
< elsif (    ( $Transaction->Field =~ /^Owner$/ )
---
> } elsif (    ( $Transaction->Field =~ /^Owner$/ )
112,113c112
< }
< elsif ( $Transaction->Type =~ /^(AddLink|DeleteLink)$/ ) {
---
> } elsif ( $Transaction->Type =~ /^(AddLink|DeleteLink)$/ ) {
115,116c114
< }
< elsif ( $Transaction->Type =~ /^(Status|Set|Told)$/ ) {
---
> } elsif ( $Transaction->Type =~ /^(Status|Set|Told)$/ ) {
119,120c117
<     }
<     else {
---
>     } else {
123,124c120
< }
< else {
---
> } else {
162d157
< 
194a190,239
> 
> % if ( $Transaction->Type =~ /^(Create|Correspond|Comment)$/ && 
> $Ticket->QueueObj->Name !~ /^Approval$/) {
> 
> <p align="right">
> <form action="<% $RT::WebPath %>/Ticket/Create.html" 
> name="CreateTicketInQueue">
> 
> <script type="text/javascript">
>       function setrelationship (select) {
>               var wert = select.options[select.options.selectedIndex].value;
>               select.form.elements["new-MemberOf"].value = "";
>               select.form.elements["new-DependsOn"].value = ""; 
>               select.form.elements["new-RefersTo"].value = "";
>               select.form.elements["MemberOf-new"].value = "";
>               select.form.elements["DependsOn-new"].value = "";
>               select.form.elements["RefersTo-new"].value = "";
>               select.form.elements[wert].value = "<%$Ticket->Id%>";
>       } 
> </script>
> 
> <input type="hidden" name="new-MemberOf" value="">
> <input type="hidden" name="MemberOf-new" value="">
> <input type="hidden" name="new-DependsOn" value="">
> <input type="hidden" name="DependsOn-new" value="<%$Ticket->Id%>">
> <input type="hidden" name="new-RefersTo" value="">
> <input type="hidden" name="RefersTo-new" value="">
> <input type="hidden" name="id" value="<%$desc%>">
> <input type="hidden" name="CloneTicket" value="<%$Ticket->Id%>">
> <input type="hidden" name="Subject" value="">
> <input type="hidden" name="QuoteTransaction" value="<%$Transaction->Id%>">
> <input type="hidden" name="Status" value="new">
> <input type="hidden" name="Requestors" value="">
> <input type="hidden" name="Owner" value="Nobody">
> <input type="hidden" name="Cc" 
> value="<%$Ticket->Requestors->MemberEmailAddressesAsString%>,<%$Ticket->Cc->MemberEmailAddressesAsString%>">
> 
> Create new
> <select name="how-depends" onchange="setrelationship(this)">
>       <option value="DependsOn-new" selected>Child (dependent)</option>
>       <option value="new-MemberOf">Child (independent)</option>
>       <option value="new-DependsOn">Parent (dependent)</option>
>       <option value="MemberOf-new">Parent (independent)</option>
>       <option value="new-RefersTo">Refers to</option>
>       <option value="RefersTo-new">Refered to by</option>
> </select>
> 
> <input type="submit" value="Ticket"> in
>       <& /Elements/SelectQueue, Name => 'Queue', %ARGS, ShowNullOption => 0, 
> ShowAllQueues => 0 &>
> </form>
> </p>
> 
> % }
_______________________________________________
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

Reply via email to