1 <& /elements/header-popup.html, mt("Change Package Contact") &>
3 <& /elements/error.html &>
5 <FORM ACTION="<% $p %>misc/process/change_pkg_contact.html" METHOD=POST>
6 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
8 <% ntable('#cccccc') %>
11 <TH ALIGN="right"><% mt('Package') |h %></TH>
12 <TD COLSPAN=7 BGCOLOR="#dddddd">
13 <% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><B><% $part_pkg->pkg |h %></B> - <% $part_pkg->comment |h %>
17 % if ( $cust_pkg->contactnum ) {
19 <TH ALIGN="right"><% mt('Current Contact') %></TH>
20 <TD COLSPAN=7 BGCOLOR="#dddddd">
21 <% $cust_pkg->contact_obj->line |h %>
26 <& /elements/tr-select-contact.html,
27 'label' => mt('New Contact'), #XXX test
29 'cust_main' => $cust_pkg->cust_main,
35 <INPUT TYPE = "submit"
36 VALUE = "<% $cust_pkg->contactnum ? mt("Change contact") : mt("Add contact") |h %>"
45 my $conf = new FS::Conf;
47 my $curuser = $FS::CurrentUser::CurrentUser;
50 unless $curuser->access_right('Change customer package');
52 my $pkgnum = scalar($cgi->param('pkgnum'));
53 $pkgnum =~ /^(\d+)$/ or die "illegal pkgnum $pkgnum";
58 'table' => 'cust_pkg',
59 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
60 'hashref' => { 'pkgnum' => $pkgnum },
61 'extra_sql' => ' AND '. $curuser->agentnums_sql,
62 }) or die "unknown pkgnum $pkgnum";
64 my $cust_main = $cust_pkg->cust_main
65 or die "can't get cust_main record for custnum ". $cust_pkg->custnum.
66 " ( pkgnum ". cust_pkg->pkgnum. ")";
68 my $part_pkg = $cust_pkg->part_pkg;