package contacts / "name per packages", RT#22185
[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   );
35 }
36
37 sub pkg_add_contact_link {
38   my $cust_pkg = shift;
39   #my $pkgpart = $cust_pkg->pkgpart;
40   include( '/elements/popup_link-cust_pkg.html',
41     'action'      => $p. "misc/change_pkg_contact.html",
42     'label'       => emt('Add contact'),
43     'actionlabel' => emt('Change'),
44     'cust_pkg'    => $cust_pkg,
45   );
46 }
47
48 #sub edit_contact_link {
49 #  my $contactnum = shift;
50 #  include( '/elements/popup_link.html',
51 #    'action'      => $p. "edit/cust_contact.cgi?contactnum=$contactnum",
52 #    'label'       => emt('Edit contact'),
53 #    'actionlabel' => emt('Edit'),
54 #  );
55 #}
56
57 </%init>