f47705c3d0fb0b03d714af7641ef45af40f82394
[freeside.git] / httemplate / view / cust_main / packages / contact.html
1 % if ( $contact ) {
2     <% $contact->line |h %>
3 % }
4
5 % if ( ! $cust_pkg->get('cancel')
6 %      && $FS::CurrentUser::CurrentUser->access_right('Change customer package')
7 %    )
8 % {
9   <FONT SIZE=-1>
10 %#XXX    (&nbsp;<%pkg_change_contact_link($cust_pkg)%>&nbsp;)
11 %#  %   if ( $cust_pkg->contactnum ) {
12 %#          (&nbsp;<%edit_contact_link($cust_pkg->contactnum)%>&nbsp;)
13 %#  %   }
14   </FONT>
15 % } 
16
17 </TD>
18 <%init>
19
20 my $conf = new FS::Conf;
21 my %opt = @_;
22
23 my $cust_pkg       = $opt{'cust_pkg'};
24
25 my $contact = $cust_pkg->contact_obj;
26
27 sub pkg_change_contact_link {
28   my $cust_pkg = shift;
29   my $pkgpart = $cust_pkg->pkgpart;
30   include( '/elements/popup_link-cust_pkg.html',
31 #XXX
32     'action'      => $p. "misc/change_pkg.cgi?contactnum=-1",
33     'label'       => emt('Change contact'),
34     'actionlabel' => emt('Change'),
35     'cust_pkg'    => $cust_pkg,
36   );
37 }
38
39 sub edit_contact_link {
40   my $contactnum = shift;
41   include( '/elements/popup_link.html',
42     'action'      => $p. "edit/cust_contact.cgi?contactnum=$contactnum",
43     'label'       => emt('Edit contact'),
44     'actionlabel' => emt('Edit'),
45   );
46 }
47
48 </%init>