ShowGraph 2.69 KB
Newer Older
Ruslan Zakirov's avatar
Ruslan Zakirov committed
1
%# BEGIN BPS TAGGED BLOCK {{{
Jesse Vincent's avatar
Jesse Vincent committed
2
%#
Ruslan Zakirov's avatar
Ruslan Zakirov committed
3
%# COPYRIGHT:
Jesse Vincent's avatar
Jesse Vincent committed
4
%#
5
%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
Kevin Falcone's avatar
Kevin Falcone committed
6
%#                                          <sales@bestpractical.com>
Jesse Vincent's avatar
Jesse Vincent committed
7
%#
Ruslan Zakirov's avatar
Ruslan Zakirov committed
8
%# (Except where explicitly superseded by other copyright notices)
Jesse Vincent's avatar
Jesse Vincent committed
9
10
%#
%#
Ruslan Zakirov's avatar
Ruslan Zakirov committed
11
%# LICENSE:
Jesse Vincent's avatar
Jesse Vincent committed
12
%#
Ruslan Zakirov's avatar
Ruslan Zakirov committed
13
14
15
16
%# This work is made available to you under the terms of Version 2 of
%# the GNU General Public License. A copy of that license should have
%# been provided with this software, but in any event can be snarfed
%# from www.gnu.org.
Jesse Vincent's avatar
Jesse Vincent committed
17
%#
Ruslan Zakirov's avatar
Ruslan Zakirov committed
18
19
20
21
%# This work is distributed in the hope that it will be useful, but
%# WITHOUT ANY WARRANTY; without even the implied warranty of
%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%# General Public License for more details.
Jesse Vincent's avatar
Jesse Vincent committed
22
%#
Ruslan Zakirov's avatar
Ruslan Zakirov committed
23
24
25
26
27
%# You should have received a copy of the GNU General Public License
%# along with this program; if not, write to the Free Software
%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
%# 02110-1301 or visit their web page on the internet at
%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
Jesse Vincent's avatar
Jesse Vincent committed
28
29
%#
%#
Ruslan Zakirov's avatar
Ruslan Zakirov committed
30
%# CONTRIBUTION SUBMISSION POLICY:
Jesse Vincent's avatar
Jesse Vincent committed
31
%#
Ruslan Zakirov's avatar
Ruslan Zakirov committed
32
33
34
35
36
%# (The following paragraph is not intended to limit the rights granted
%# to you to modify and distribute this software under the terms of
%# the GNU General Public License and is only of importance to you if
%# you choose to contribute your changes and enhancements to the
%# community by submitting them to Best Practical Solutions, LLC.)
Jesse Vincent's avatar
Jesse Vincent committed
37
%#
Ruslan Zakirov's avatar
Ruslan Zakirov committed
38
39
40
41
42
43
44
45
%# By intentionally submitting any modifications, corrections or
%# derivatives to this work, or any other work intended for use with
%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
%# you are the copyright holder for those contributions and you grant
%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
%# royalty-free, perpetual, license to use, copy, create derivative
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
Jesse Vincent's avatar
Jesse Vincent committed
46
%#
Ruslan Zakirov's avatar
Ruslan Zakirov committed
47
%# END BPS TAGGED BLOCK }}}
48
<div><img src="<% RT->Config->Get('WebPath') %>/Ticket/Graphs/<% $id %>?<% $m->comp('/Elements/QueryString', %ARGS) %>" usemap="#<% $graph->{'NAME'} || 'test' %>" style="border: none" />
49
<% safe_run_child { Encode::decode( "UTF-8", $graph->as_cmapx ) } |n %>
Ruslan Zakirov's avatar
Ruslan Zakirov committed
50
51
52
</div>
<& ShowLegends, %ARGS, Ticket => $ticket &>
<%ARGS>
53
$id => undef
Ruslan Zakirov's avatar
Ruslan Zakirov committed
54
55
</%ARGS>
<%INIT>
56
57
use RT::Util 'safe_run_child';

Ruslan Zakirov's avatar
Ruslan Zakirov committed
58
59
60
61
62
63
64
65
my $ticket = RT::Ticket->new( $session{'CurrentUser'} );
$ticket->Load( $id );
unless ( $ticket->id ) {
    $RT::Logger->error("Couldn't load ticket $id");
    return;
}
$ARGS{'id'} = $id = $ticket->id;

Alex Vandiver's avatar
Alex Vandiver committed
66
require RT::Graph::Tickets;
67
my $graph = RT::Graph::Tickets->TicketLinks(
Ruslan Zakirov's avatar
Ruslan Zakirov committed
68
    %ARGS,
69
    Graph  => undef,
Ruslan Zakirov's avatar
Ruslan Zakirov committed
70
71
72
    Ticket => $ticket,
);
</%INIT>