From 343eff0feb81094bf3e47ab994caae126fa8dfe8 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Mon, 31 Aug 2015 16:31:37 -0700 Subject: [PATCH] repeatability cleanup, #37340 --- FS/FS/TicketSystem/RT_External.pm | 8 ++++---- FS/FS/UI/Web.pm | 1 + FS/FS/cdr.pm | 2 +- FS/FS/part_pkg/prorate_calendar.pm | 2 +- httemplate/browse/part_pkg.cgi | 1 + httemplate/browse/part_svc.cgi | 2 +- httemplate/edit/part_pkg.cgi | 21 ++++++++++++++------- httemplate/elements/email-link.html | 3 ++- httemplate/elements/form-create_ticket.html | 2 +- httemplate/search/cust_bill.html | 4 ++-- 10 files changed, 28 insertions(+), 18 deletions(-) diff --git a/FS/FS/TicketSystem/RT_External.pm b/FS/FS/TicketSystem/RT_External.pm index c2aac2db7..20d78c8fc 100644 --- a/FS/FS/TicketSystem/RT_External.pm +++ b/FS/FS/TicketSystem/RT_External.pm @@ -316,22 +316,22 @@ sub href_params_new_ticket { my $subtype = $object->table; my $pkey = $object->get($object->primary_key); - my %param = ( + my @param = ( 'Queue' => ($cust_main->agent->ticketing_queueid || $default_queueid), 'new-MemberOf'=> "freeside://freeside/$subtype/$pkey", 'Requestors' => $requestors, ); - ( $self->baseurl.'Ticket/Create.html', %param ); + ( $self->baseurl.'Ticket/Create.html', @param ); } sub href_new_ticket { my $self = shift; - my( $base, %param ) = $self->href_params_new_ticket(@_); + my( $base, @param ) = $self->href_params_new_ticket(@_); my $uri = new URI $base; - $uri->query_form(%param); + $uri->query_form(@param); $uri; } diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm index 69de5e157..d73d9cfc0 100644 --- a/FS/FS/UI/Web.pm +++ b/FS/FS/UI/Web.pm @@ -623,6 +623,7 @@ sub random_id { if (!defined $NO_RANDOM_IDS) { my $conf = FS::Conf->new; $NO_RANDOM_IDS = $conf->exists('no_random_ids') ? 1 : 0; + warn "TEST MODE--RANDOM ID NUMBERS DISABLED\n" if $NO_RANDOM_IDS; } if ( $NO_RANDOM_IDS ) { if ( $digits > 0 ) { diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm index db9832a4b..cdca6fc75 100644 --- a/FS/FS/cdr.pm +++ b/FS/FS/cdr.pm @@ -1458,7 +1458,7 @@ as keys (for use with part_pkg::voip_cdr) and "pretty" format names as values. sub invoice_formats { map { ($_ => $export_names{$_}->{'name'}) } grep { $export_names{$_}->{'invoice_header'} } - keys %export_names; + sort keys %export_names; } =item invoice_header FORMAT diff --git a/FS/FS/part_pkg/prorate_calendar.pm b/FS/FS/part_pkg/prorate_calendar.pm index 83a80f5d0..c50cae0d7 100644 --- a/FS/FS/part_pkg/prorate_calendar.pm +++ b/FS/FS/part_pkg/prorate_calendar.pm @@ -36,7 +36,7 @@ use base 'FS::part_pkg::flat'; }, 'fieldorder' => [ 'cutoff_day', 'prorate_defer_bill', 'prorate_round_day', 'prorate_verbose' ], 'freq' => 'm', - 'weight' => 20, + 'weight' => 23, ); my %freq_max_days = ( # the length of the shortest period of each cycle type 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 .= ''; 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 .= ''. $href->{$field}{'name'}. ''; + $html .= ''. $href->{$field}{'name'}. ' + '; my $format = sub { shift }; $format = $href->{$field}{'format'} if exists($href->{$field}{'format'}); @@ -1005,9 +1010,11 @@ my $html_bottom = sub { $html .= ''; } $html .= ''; - - $html .= qq('; + + $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'); 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; } Tickets 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!!, @values; } - keys %search + sort keys %search ), qq!! } qw( print_ email_ fax_ ftp_ spool_ ) ). -- 2.11.0