X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Flocations.html;h=689c9a390f6ede2e93d6a0c168c88b5ee5fb9a7a;hb=63973c641c4be00765fa27e55c57cc5b9aa4da19;hp=c95850b788b1a9c3e0d7cd3df483ebfdb6cca49a;hpb=2238711675eefa60cd2feb47c8d3e43d3e6f1860;p=freeside.git
diff --git a/httemplate/view/cust_main/locations.html b/httemplate/view/cust_main/locations.html
index c95850b78..689c9a390 100755
--- a/httemplate/view/cust_main/locations.html
+++ b/httemplate/view/cust_main/locations.html
@@ -5,12 +5,17 @@ span.loclabel {
background-color: #cccccc;
border: 1px solid black
}
+table.location {
+ width: 100%;
+ padding: 1px;
+ border-spacing: 0px;
+}
% foreach my $locationnum (@sorted) {
% my $packages = $packages_in{$locationnum};
% my $loc = $locations{$locationnum};
% next if $loc->disabled and scalar(@$packages) == 0;
-<& /elements/table-grid.html &>
+
-% if (! $locationnum) {
-Default service location:
-% }
-% elsif ( $loc->disabled ) {
+% if ( $loc->disabled ) {
% }
<% $loc->location_label %>
@@ -34,7 +36,7 @@ Default service location:
% }
|
% if (@$packages) {
-<& packages/section.html, 'packages' => $packages &>
+<& packages/section.html, 'packages' => $packages, 'cust_main' => $cust_main &>
% }
% } #foreach $locationnum
@@ -49,8 +51,7 @@ my %locations = map { $_->locationnum => $_ } qsearch({
'order_by' => 'ORDER BY country, state, city, address1, locationnum',
});
my @sections = keys %locations;
-$locations{''} = $cust_main;
-my %packages_in = map { $_ => [] } ('', @sections);
+my %packages_in = map { $_ => [] } (@sections);
my %active = (); # groups with non-canceled packages
foreach my $cust_pkg ( @$all_packages ) {
@@ -58,10 +59,13 @@ foreach my $cust_pkg ( @$all_packages ) {
push @{ $packages_in{$key} }, $cust_pkg;
$active{$key} = 1 if !$cust_pkg->getfield('cancel');
}
+# prevent disabling these
+$active{$cust_main->ship_locationnum} = 1;
+$active{$cust_main->bill_locationnum} = 1;
my @sorted = (
- '',
- grep ( { $active{$_} } @sections),
+ $cust_main->ship_locationnum,
+ grep ( { $active{$_} && $_ != $cust_main->ship_locationnum } @sections),
grep ( { !$active{$_} } @sections),
);
@@ -69,8 +73,8 @@ sub edit_location_link {
my $locationnum = shift;
include( '/elements/popup_link.html',
'action' => $p. "edit/cust_location.cgi?locationnum=$locationnum",
- 'label' => '('.mt('Edit location').')',
- 'actionlabel' => mt('Edit'),
+ 'label' => '('.emt('Edit location').')',
+ 'actionlabel' => emt('Edit'),
);
}
@@ -78,8 +82,8 @@ sub disable_location_link {
my $locationnum = shift;
include( '/elements/popup_link.html',
'action' => $p. "misc/disable-cust_location.cgi?locationnum=$locationnum",
- 'label' => '('.mt('Disable location').')',
- 'actionlabel' => mt('Disable'),
+ 'label' => '('.emt('Disable location').')',
+ 'actionlabel' => emt('Disable'),
);
}