diff options
author | Mark Wells <mark@freeside.biz> | 2015-08-31 16:31:37 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-08-31 16:31:37 -0700 |
commit | 343eff0feb81094bf3e47ab994caae126fa8dfe8 (patch) | |
tree | af2b15e287856ec2bb8397ed1de878ba67ea724f /httemplate | |
parent | fd62e5c7a94361229febd28bf84cdd0e65a7028a (diff) |
repeatability cleanup, #37340
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/browse/part_pkg.cgi | 1 | ||||
-rwxr-xr-x | httemplate/browse/part_svc.cgi | 2 | ||||
-rwxr-xr-x | httemplate/edit/part_pkg.cgi | 21 | ||||
-rw-r--r-- | httemplate/elements/email-link.html | 3 | ||||
-rw-r--r-- | httemplate/elements/form-create_ticket.html | 2 | ||||
-rwxr-xr-x | httemplate/search/cust_bill.html | 4 |
6 files changed, 21 insertions, 12 deletions
diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index 2769f8512..11eca6702 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -537,6 +537,7 @@ push @fields, }, ]; } + sort grep { $options{$_} =~ /\S/ } grep { $_ !~ /^(setup|recur)_fee$/ and $_ !~ /^report_option_\d+$/ } diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi index ec5f321dd..88f8d8d19 100755 --- a/httemplate/browse/part_svc.cgi +++ b/httemplate/browse/part_svc.cgi @@ -161,7 +161,7 @@ function part_export_areyousure(href) { % } % % my($n1)=''; -% foreach my $field ( @fields ) { +% foreach my $field ( sort @fields ) { % % #a few lines of false laziness w/edit/part_svc.cgi % my $def = FS::part_svc->svc_table_fields($svcdb)->{$field}; diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index bdceb3364..2802ddc33 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -866,9 +866,13 @@ my $html_bottom = sub { #$html .= '</SELECT></TD></TR>'; my $href = $plans{$layer}->{'fields'}; - my @fields = exists($plans{$layer}->{'fieldorder'}) - ? @{$plans{$layer}->{'fieldorder'}} - : keys %{ $href }; + my @fields; + if ( $plans{$layer}->{'fieldorder'} ) { + @fields = @{ $plans{$layer}->{'fieldorder'} }; + } else { + warn "FS::part_pkg::$layer has no fieldorder.\n"; + @fields = keys %$href; + } # hash of dependencies for each of the Pricing Plan fields. # make sure NOT to use double-quotes inside the 'msg' value. @@ -906,7 +910,8 @@ my $html_bottom = sub { next if !$display; } - $html .= '<TR><TD ALIGN="right">'. $href->{$field}{'name'}. '</TD><TD>'; + $html .= '<TR><TD ALIGN="right">'. $href->{$field}{'name'}. '</TD><TD> + '; my $format = sub { shift }; $format = $href->{$field}{'format'} if exists($href->{$field}{'format'}); @@ -1005,9 +1010,11 @@ my $html_bottom = sub { $html .= '</TD></TR>'; } $html .= '</TABLE>'; - - $html .= qq(<INPUT TYPE="hidden" NAME="${layer}__OPTIONS" VALUE="). - join(',', keys %{ $href } ). '">'; + + $html .= include('/elements/hidden.html', + field => $layer.'__OPTIONS', + value => join(',', @fields) + ); $html; diff --git a/httemplate/elements/email-link.html b/httemplate/elements/email-link.html index 2612faabb..16935cf98 100644 --- a/httemplate/elements/email-link.html +++ b/httemplate/elements/email-link.html @@ -10,7 +10,8 @@ die "'table' required" if !$table; die "'search_hash' required" if !$search_hash; my $uri = new URI; -$uri->query_form($search_hash); +my @params = map { $_, $search_hash->{$_} } sort keys %$search_hash; +$uri->query_form(@params); my $query = $uri->query; my $label = ($opt{'label'} || 'Email a notice to these customers'); </%init> diff --git a/httemplate/elements/form-create_ticket.html b/httemplate/elements/form-create_ticket.html index 362e82397..d76c0d83e 100644 --- a/httemplate/elements/form-create_ticket.html +++ b/httemplate/elements/form-create_ticket.html @@ -6,7 +6,7 @@ function updateTicketLink() { link.href = "<% $new_base.'?'. join(';', map( { ($_ eq 'Queue') ? () : "$_=$new_param{$_}"} - keys %new_param),'Queue=') %>" + selector.options[selector.selectedIndex].value; + sort keys %new_param),'Queue=') %>" + selector.options[selector.selectedIndex].value; } </SCRIPT> <A NAME="tickets"><FONT CLASS="fsinnerbox-title">Tickets</FONT></A> diff --git a/httemplate/search/cust_bill.html b/httemplate/search/cust_bill.html index 62f5f7afa..88e291b5b 100755 --- a/httemplate/search/cust_bill.html +++ b/httemplate/search/cust_bill.html @@ -197,7 +197,7 @@ my $html_init = join("\n", map { ( my $action = $_ ) =~ s/_$//; include('/elements/progress-init.html', $_.'form', - [ keys %search ], + [ sort keys %search ], "../misc/${_}invoices.cgi", { 'message' => "Invoices re-${action}ed" }, #would be nice to show the number of them, but... $_, #key @@ -207,7 +207,7 @@ my $html_init = join("\n", map { my @values = ref($search{$f}) ? @{ $search{$f} } : $search{$f}; map qq!<INPUT TYPE="hidden" NAME="$f" VALUE="$_">!, @values; } - keys %search + sort keys %search ), qq!</FORM>! } qw( print_ email_ fax_ ftp_ spool_ ) ). |