1 % if ( $cust_pkg->change_from_pkg
2 % and $cust_pkg->change_from_pkg->locationnum == $cust_pkg->locationnum )
4 % # don't show the location
7 <DIV STYLE="font-style: italic; font-size: small">
10 <% $loc->location_label( 'join_string' => '<BR>',
11 'double_space' => ' ',
12 'escape_function' => \&encode_entities,
13 'countrydefault' => $countrydefault,
17 % if ( $loc->latitude && $loc->longitude ) {
20 <% $loc->latitude %>, <% $loc->longitude %>
21 <& /elements/coord-links.html,
24 $opt{'cust_main'}->name_short. ': '. $opt{'part_pkg'}->pkg,
25 $opt{'cust_main'}->agentnum,
34 % if ( ! $cust_pkg->get('cancel')
35 % && $FS::CurrentUser::CurrentUser->access_right('Change customer package')
40 % unless ( $opt{no_links} or $opt{'change_from'} ) {
41 ( <%pkg_change_location_link($cust_pkg)%> )
43 % if ( $cust_pkg->locationnum && ! $opt{no_links} ) {
44 ( <%edit_location_link($cust_pkg->locationnum)%> )
51 my $conf = new FS::Conf;
54 my $cust_pkg = $opt{'cust_pkg'};
55 my $countrydefault = $opt{'countrydefault'} || 'US';
56 my $statedefault = $opt{'statedefault'}
57 || ($countrydefault eq 'US' ? 'CA' : '');
59 my $loc = $cust_pkg->cust_location_or_main;
60 # dubious--they should all have a location now
61 my $default = $cust_pkg->locationnum == $opt{'cust_main'}->ship_locationnum;
63 sub pkg_change_location_link {
65 my $pkgpart = $cust_pkg->pkgpart;
66 include( '/elements/popup_link-cust_pkg.html',
67 'action' => $p. "misc/change_pkg.cgi?locationnum=-1;pkgpart=$pkgpart;".
68 "address1=;address2=;city=;county=;state=$statedefault;".
69 "zip=;country=$countrydefault",
70 'label' => emt('Change location'),
71 'actionlabel' => emt('Change'),
72 'cust_pkg' => $cust_pkg,
78 sub edit_location_link {
79 my $locationnum = shift;
80 include( '/elements/popup_link.html',
81 'action' => $p. "edit/cust_location.cgi?locationnum=$locationnum",
82 'label' => emt('Edit location'),
83 'actionlabel' => emt('Edit'),