default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / view / cust_main / packages / location.html
1 % if ( $cust_pkg->change_from_pkg
2 %      and $cust_pkg->change_from_pkg->locationnum == $cust_pkg->locationnum)
3 % {
4 % # don't show the location
5 % } else {
6 %   if ( !$opt{'cust_pkg-group_by_location'} ) {
7 %     if ( $default ) {
8         <DIV STYLE="font-style: italic; font-size: small">
9 %     }
10
11       <% $loc->location_label( 'join_string'     => '<BR>',
12                                'double_space'    => ' &nbsp; ',
13                                'escape_function' => \&encode_entities,
14                                'countrydefault'  => $countrydefault,
15                                'cust_main'       => $opt{'cust_main'},
16                              )
17       %>
18
19 %     if ( $loc->latitude && $loc->longitude ) {
20           <BR>
21           <FONT SIZE=-1>
22           <!-- <% $loc->latitude %>, <% $loc->longitude %> -->
23           <& /elements/coord-links.html, {
24                'latitude'        => $loc->latitude,
25                'longitude'       => $loc->longitude,
26                'name'            => $opt{'cust_main'}->name_short.
27                                       ': '. $opt{'part_pkg'}->pkg,
28                'company_address' => $opt{'company_address'},
29              }
30           &>
31           </FONT>
32 %     }
33 %     if ( $loc->country eq 'US' ) {
34 %       if ( $loc->censustract ) {
35            <BR>
36            <FONT SIZE=-1>
37            <% $loc->censustract %> (<% $loc->censusyear %> census)
38            </FONT>
39 %       } elsif ( $opt{'cust_main-require_censustract'} ) {
40             <BR>
41             <FONT SIZE=-1 COLOR="#ee3300">
42             <% emt('Census tract unknown') %>
43             </FONT>
44 %       }
45 %     }
46
47 %     if ( $default ) {
48       </DIV>
49 %     }
50 %   } # all of this is hidden if packages are grouped by location, because
51 %     # it's in the top banner
52
53 % } # if the package is a scheduled future package change without location
54 %   # change, then don't show any of this at all.  It's all implied by the
55 %   # preceding package.
56 <%init>
57
58 my %opt = @_;
59
60 my $cust_pkg       = $opt{'cust_pkg'};
61 my $countrydefault = $opt{'countrydefault'} || 'US';
62 my $statedefault   = $opt{'statedefault'}
63                      || ($countrydefault eq 'US' ? 'CA' : '');
64
65 my $loc = $cust_pkg->cust_location_or_main('_cache'=>$opt{cust_location_cache});
66 # dubious--they should all have a location now
67 my $default = $cust_pkg->locationnum == $opt{'cust_main'}->ship_locationnum;
68
69 </%init>