Merge branch 'xss_fixes' of https://github.com/mcreenan/Freeside
[freeside.git] / httemplate / view / cust_main / packages / contact.html
1 % if ( $contact ) {
2     <% $contact->line |h %>
3 % if ( $show_link ) {
4         <FONT SIZE=-1>
5           (&nbsp;<%pkg_change_contact_link($cust_pkg)%>&nbsp;)
6         </FONT>
7 %    }
8 % } elsif ( $show_link ) {
9         <FONT SIZE=-1>
10           (&nbsp;<%pkg_add_contact_link($cust_pkg)%>&nbsp;)
11         </FONT>
12 % }
13 <%init>
14
15 my $conf = new FS::Conf;
16 my %opt = @_;
17
18 my $cust_pkg       = $opt{'cust_pkg'};
19
20 my $show_link = 
21   ! $cust_pkg->get('cancel')
22   && $FS::CurrentUser::CurrentUser->access_right('Change customer package');
23
24 my $contact = $cust_pkg->contact_obj;
25
26 sub pkg_change_contact_link {
27   my $cust_pkg = shift;
28   #my $pkgpart = $cust_pkg->pkgpart;
29   include( '/elements/popup_link-cust_pkg.html',
30     'action'      => $p. "misc/change_pkg_contact.html",
31     'label'       => emt('Change'), # contact'),
32     'actionlabel' => emt('Change'),
33     'cust_pkg'    => $cust_pkg,
34     'width'       => 616,
35     'height'      => 220,
36   );
37 }
38
39 sub pkg_add_contact_link {
40   my $cust_pkg = shift;
41   #my $pkgpart = $cust_pkg->pkgpart;
42   include( '/elements/popup_link-cust_pkg.html',
43     'action'      => $p. "misc/change_pkg_contact.html",
44     'label'       => emt('Add contact'),
45     'actionlabel' => emt('Change'),
46     'cust_pkg'    => $cust_pkg,
47     'width'       => 616,
48     'height'      => 192,
49   );
50 }
51
52 #sub edit_contact_link {
53 #  my $contactnum = shift;
54 #  include( '/elements/popup_link.html',
55 #    'action'      => $p. "edit/cust_contact.cgi?contactnum=$contactnum",
56 #    'label'       => emt('Edit contact'),
57 #    'actionlabel' => emt('Edit'),
58 #  );
59 #}
60
61 </%init>