[freeside-commits] freeside/httemplate/elements selectlayers.html, 1.3, 1.4
Ivan,,,
ivan at wavetail.420.am
Sat Apr 11 23:14:02 PDT 2009
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv10309
Modified Files:
selectlayers.html
Log Message:
add svc_phone on new customer first package, RT#4315
Index: selectlayers.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/selectlayers.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- selectlayers.html 15 Apr 2008 13:42:40 -0000 1.3
+++ selectlayers.html 12 Apr 2009 06:14:00 -0000 1.4
@@ -63,18 +63,29 @@
<SCRIPT TYPE="text/javascript">
% }
% unless ( grep $opt{$_}, qw(html_only select_only layers_only) ) {
- //alert('start function define');
+
+% if ( $opt{layermap} ) {
+% my %map = %{ $opt{layermap} };
+ var layermap = { "":"",
+ <% join(',', map { qq("$_":"$map{$_}") } keys %map ) %>
+ };
+% }
+
function <% $key %>changed(what) {
<% $opt{'onchange'} %>
var <% $key %>layer = what.options[what.selectedIndex].value;
-% foreach my $layer ( keys %$options ) {
-
+% foreach my $layer ( @layers ) {
+%
+% if ( $opt{layermap} ) {
+ if ( layermap[ <% $key %>layer ] == "<% $layer %>" ) {
+% } else {
if (<% $key %>layer == "<% $layer %>" ) {
+% }
-% foreach my $not ( grep { $_ ne $layer } keys %$options ) {
+% foreach my $not ( grep { $_ ne $layer } @layers ) {
% my $element = "document.getElementById('${key}d$not').style";
<% $element %>.display = "none";
<% $element %>.zIndex = 0;
@@ -90,7 +101,6 @@
//<% $opt{'onchange'} %>
}
- //alert('end function define');
% }
% unless ( grep $opt{$_}, qw(html_only js_only select_only layers_only) ) {
</SCRIPT>
@@ -124,10 +134,16 @@
%
% unless ( grep $opt{$_}, qw(js_only select_only) ) {
-% foreach my $layer ( keys %$options ) {
+% foreach my $layer ( @layers ) {
+% my $selected_layer;
+% if ( $opt{layermap} ) {
+% $selected_layer = $opt{layermap}->{$selected};
+% } else {
+% $selected_layer = $selected;
+% }
<DIV ID="<% $key %>d<% $layer %>"
- STYLE="<% $layer eq $selected
+ STYLE="<% $selected_layer eq $layer
? 'display: "" ; z-index: 1'
: 'display: none; z-index: 0'
%>"
@@ -162,6 +178,14 @@
my $between = exists($opt{html_between}) ? $opt{html_between} : '';
my $options = \%options;
+my @layers = ();
+if ( $opt{layermap} ) {
+ my %layers = map { $opt{layermap}->{$_} => 1 } keys %options;
+ @layers = keys %layers;
+} else {
+ @layers = keys %options;
+}
+
my $selected = exists($opt{curr_value}) ? $opt{curr_value} : '';
#XXX eek. also eek $layer_fields in the layer_callback() call...
More information about the freeside-commits
mailing list