3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
5 %# (Except where explictly superceded by other copyright notices)
7 %# This work is made available to you under the terms of Version 2 of
8 %# the GNU General Public License. A copy of that license should have
9 %# been provided with this software, but in any event can be snarfed
12 %# This work is distributed in the hope that it will be useful, but
13 %# WITHOUT ANY WARRANTY; without even the implied warranty of
14 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 %# General Public License for more details.
17 %# Unless otherwise specified, all modifications, corrections or
18 %# extensions to this work which alter its source code become the
19 %# property of Best Practical Solutions, LLC when submitted for
20 %# inclusion in the work.
24 % my $approving = $Ticket->DependedOnBy();
25 % if ($approving->Count) {
26 <h3><&|/l&>Tickets which depend on this approval:</&></h3>
30 <TD WIDTH="25" bgcolor="#999999"> </TD><TD>
33 while (my $link = $approving->Next()) {
34 next unless ($link->BaseURI->IsLocal());
35 my $text = '<a name="' . $link->BaseObj->Id . '">';
37 my $type = $link->BaseObj->Type;
38 my $dep = $m->scomp('ShowDependency', Ticket => $link->BaseObj, _seen => $_seen);
40 if ($type eq 'approval') {
41 $head .= $m->scomp('/Elements/TitleBoxStart', title => loc("Approval #[_1]: [_2]", $link->BaseObj->Id, $link->BaseObj->Subject));
43 $text .= $m->scomp('/Ticket/Elements/ShowCustomFields', Ticket => $link->BaseObj);
44 } elsif ($type eq 'ticket') {
45 $head .= $m->scomp('/Elements/TitleBoxStart', title => loc("Ticket #[_1]: [_2]", $link->BaseObj->Id, $link->BaseObj->Subject));
47 $text .= $m->scomp('/Ticket/Elements/ShowSummary', Ticket => $link->BaseObj);
49 $head .= $m->scomp('/Elements/TitleBoxStart', title => loc("#[_1]: [_2]", $link->BaseObj->Id, $link->BaseObj->Subject));
53 $text .= $m->scomp('/Ticket/Elements/ShowHistory' , Ticket => $link->BaseObj, Collapsed => ($type ne 'ticket'), ShowTitle => 0, ShowHeaders => 0, ShowDisplayModes => 0, ShowTitleBarCommands => 0);
55 $head .= $m->scomp('/Elements/TitleBoxEnd');
56 $text .= $m->scomp('/Elements/TitleBoxEnd');
59 $show{$link->BaseObj->Id} = {
66 foreach my $id (sort keys %show) {
67 if ($_seen->{$id}++) {
68 $refer .= "<a href='#txn-$id'>" . $show{$id}{head} . "</a>";
72 $m->print($show{$id}{text});