2 <DIV STYLE="font-style: italic; font-size: small">
5 <% $loc->location_label( 'join_string' => '<BR>',
6 'double_space' => ' ',
7 'escape_function' => \&encode_entities,
8 'countrydefault' => $countrydefault,
12 % if ( $loc->latitude && $loc->longitude ) {
15 <% $loc->latitude %>, <% $loc->longitude %>
16 <& /elements/coord-links.html,
19 $opt{'cust_main'}->name_short. ': '. $opt{'part_pkg'}->pkg,
20 $opt{'cust_main'}->agentnum,
29 % if ( ! $cust_pkg->get('cancel')
30 % && $FS::CurrentUser::CurrentUser->access_right('Change customer package')
35 % unless ( $opt{no_links} ) {
36 ( <%pkg_change_location_link($cust_pkg)%> )
38 % if ( $cust_pkg->locationnum && ! $opt{no_links} ) {
39 ( <%edit_location_link($cust_pkg->locationnum)%> )
46 my $conf = new FS::Conf;
49 my $cust_pkg = $opt{'cust_pkg'};
50 my $countrydefault = $opt{'countrydefault'} || 'US';
51 my $statedefault = $opt{'statedefault'}
52 || ($countrydefault eq 'US' ? 'CA' : '');
54 my $loc = $cust_pkg->cust_location_or_main;
55 # dubious--they should all have a location now
56 my $default = $cust_pkg->locationnum == $opt{'cust_main'}->ship_locationnum;
58 sub pkg_change_location_link {
60 my $pkgpart = $cust_pkg->pkgpart;
61 include( '/elements/popup_link-cust_pkg.html',
62 'action' => $p. "misc/change_pkg.cgi?locationnum=-1;pkgpart=$pkgpart;".
63 "address1=;address2=;city=;county=;state=$statedefault;".
64 "zip=;country=$countrydefault",
65 'label' => emt('Change location'),
66 'actionlabel' => emt('Change'),
67 'cust_pkg' => $cust_pkg,
71 sub edit_location_link {
72 my $locationnum = shift;
73 include( '/elements/popup_link.html',
74 'action' => $p. "edit/cust_location.cgi?locationnum=$locationnum",
75 'label' => emt('Edit location'),
76 'actionlabel' => emt('Edit'),