projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge NG auth, RT#21563
[freeside.git]
/
httemplate
/
view
/
cust_main
/
locations.html
diff --git
a/httemplate/view/cust_main/locations.html
b/httemplate/view/cust_main/locations.html
index
ea6216e
..
689c9a3
100755
(executable)
--- 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
}
background-color: #cccccc;
border: 1px solid black
}
+table.location {
+ width: 100%;
+ padding: 1px;
+ border-spacing: 0px;
+}
</STYLE>
% foreach my $locationnum (@sorted) {
% my $packages = $packages_in{$locationnum};
% my $loc = $locations{$locationnum};
% next if $loc->disabled and scalar(@$packages) == 0;
</STYLE>
% foreach my $locationnum (@sorted) {
% my $packages = $packages_in{$locationnum};
% my $loc = $locations{$locationnum};
% next if $loc->disabled and scalar(@$packages) == 0;
-<
% include('/elements/table-grid.html') %
>
+<
TABLE CLASS="grid location"
>
<TR><TH COLSPAN=3 ALIGN="left" VALIGN="bottom"
STYLE="padding-bottom: 0px;
padding-left: 0px;
<TR><TH COLSPAN=3 ALIGN="left" VALIGN="bottom"
STYLE="padding-bottom: 0px;
padding-left: 0px;
@@
-18,10
+23,7
@@
STYLE="padding-bottom: 0px;
border-bottom-color: black;
border-bottom-width: 1px;">
<SPAN CLASS="loclabel">
border-bottom-color: black;
border-bottom-width: 1px;">
<SPAN CLASS="loclabel">
-% if (! $locationnum) {
-Default service location:
-% }
-% elsif ( $loc->disabled ) {
+% if ( $loc->disabled ) {
<FONT COLOR="#808080"><I>
% }
<% $loc->location_label %></SPAN>
<FONT COLOR="#808080"><I>
% }
<% $loc->location_label %></SPAN>
@@
-34,7
+36,7
@@
Default service location:
% }
</SPAN></TH></TR>
% if (@$packages) {
% }
</SPAN></TH></TR>
% if (@$packages) {
-<
% include('packages/section.html', 'packages' => $packages ) %
>
+<
& packages/section.html, 'packages' => $packages, 'cust_main' => $cust_main &
>
% }
</TABLE><BR>
% } #foreach $locationnum
% }
</TABLE><BR>
% } #foreach $locationnum
@@
-49,8
+51,7
@@
my %locations = map { $_->locationnum => $_ } qsearch({
'order_by' => 'ORDER BY country, state, city, address1, locationnum',
});
my @sections = keys %locations;
'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 ) {
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');
}
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 = (
my @sorted = (
-
''
,
- grep ( { $active{$_} } @sections),
+
$cust_main->ship_locationnum
,
+ grep ( { $active{$_}
&& $_ != $cust_main->ship_locationnum
} @sections),
grep ( { !$active{$_} } @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",
my $locationnum = shift;
include( '/elements/popup_link.html',
'action' => $p. "edit/cust_location.cgi?locationnum=$locationnum",
- 'label' => '(
Edit location
)',
- 'actionlabel' =>
'Edit'
,
+ 'label' => '(
'.emt('Edit location').'
)',
+ 'actionlabel' =>
emt('Edit')
,
);
}
);
}
@@
-78,10
+82,9
@@
sub disable_location_link {
my $locationnum = shift;
include( '/elements/popup_link.html',
'action' => $p. "misc/disable-cust_location.cgi?locationnum=$locationnum",
my $locationnum = shift;
include( '/elements/popup_link.html',
'action' => $p. "misc/disable-cust_location.cgi?locationnum=$locationnum",
- 'label' => '(
Disable location
)',
- 'actionlabel' =>
'Disable'
,
+ 'label' => '(
'.emt('Disable location').'
)',
+ 'actionlabel' =>
emt('Disable')
,
);
}
);
}
-
</%init>
</%init>