Need help with /Approvals/ & local/html/Ticket/Elements/ShowTransaction

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. :slight_smile:

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 jsmoriss@mvlan.net

ShowTransaction.diff (2.81 KB)

Aha!

I tried a bunch of things, but finally used the home page for
inspiration. :slight_smile:

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

js.On Wed, Jun 25, 2008 at 03:55:38PM +0000, Jean-Sebastien Morisset wrote:

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. :slight_smile:

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?

Jean-Sebastien Morisset, Sr. UNIX Administrator jsmoriss@mvlan.net