From: Ivan Kohler Date: Wed, 20 Jan 2016 12:46:18 +0000 (-0800) Subject: Merge branch 'master' of git.freeside.biz:/home/git/freeside X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=5d5ed9e94c8c9520f8d36ef23bbe47a135c35639;hp=c2a09342f58d6a6bb78594c388ededc681416d89 Merge branch 'master' of git.freeside.biz:/home/git/freeside --- diff --git a/FS/FS/cust_payby.pm b/FS/FS/cust_payby.pm index b9e79a2be..83b951eda 100644 --- a/FS/FS/cust_payby.pm +++ b/FS/FS/cust_payby.pm @@ -577,15 +577,20 @@ sub cgi_cust_payby_fields { payinfo1 payinfo2 payinfo3 paytype paystate payname_CHEK )]; } -=item cgi_hash_callback HASHREF +=item cgi_hash_callback HASHREF OLD Subroutine (not a class or object method). Processes a hash reference of web interface contet (transfers the data from pseudo-fields to real fields). +If OLD object is passed, also preserves locationnum, paystart_month, paystart_year, +payissue and payip. If the new field is blank but the old is not, the old field +will be preserved. + =cut sub cgi_hash_callback { my $hashref = shift; + my $old = shift; my %noauto = ( 'CARD' => 'DCRD', @@ -619,6 +624,14 @@ sub cgi_hash_callback { $hashref->{paydate}= $hashref->{paydate_month}. '-'. $hashref->{paydate_year}; + if ($old) { + foreach my $field ( qw(locationnum paystart_month paystart_year payissue payip) ) { + next if $hashref->{$field}; + next unless $old->get($field); + $hashref->{$field} = $old->get($field); + } + } + } =item search_sql diff --git a/FS/FS/o2m_Common.pm b/FS/FS/o2m_Common.pm index 430f00bbb..915393ae9 100644 --- a/FS/FS/o2m_Common.pm +++ b/FS/FS/o2m_Common.pm @@ -111,7 +111,7 @@ sub process_o2m { map { $_ => $opt{'params'}->{$add_param."_$_"} } @{ $opt{'fields'} } ); - &{ $opt{'hash_callback'} }( \%hash ) if $opt{'hash_callback'}; + &{ $opt{'hash_callback'} }( \%hash, $old_obj ) if $opt{'hash_callback'}; #next unless grep { $_ =~ /\S/ } values %hash; my $new_obj = "FS::$table"->new( { %$hashref, %hash } ); diff --git a/debian/control b/debian/control index 3eb088a67..25e792048 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Architecture: all Pre-Depends: freeside-lib # dbconfig-common Depends: ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends}, freeside-webui, - debconf, cron, openbsd-inetd, tcpd, undersmtpd, ssmtp + debconf, cron, openbsd-inetd, tcpd, undersmtpd, ssmtp, freeside-lib (>= 3.8git~20151123) Description: Billing and trouble ticketing for service providers Freeside is a web-based billing, trouble ticketing and network monitoring application. It includes features for ISPs and WISPs, hosting providers and @@ -103,8 +103,7 @@ Depends: freeside-lib,apache2,apache2-mpm-prefork,apache2-utils, libapache-dbi-perl,libapache2-mod-perl2,libapache2-request-perl, libapache-session-perl,openssl, libcgi-emulate-psgi-perl, libplack-perl (>= 1.0002) -Conflicts: apache2-mpm-worker -Breaks: libev-perl +Conflicts: apache2-mpm-worker, libev-perl Description: Web interface for Freeside billing and trouble ticketing Freeside is a web-based billing and trouble ticketing application. . diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index bdf3431d7..39cddc021 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -115,7 +115,6 @@ function samechanged(what) { %# billing info <& cust_main/billing.html, $cust_main, - 'payinfo' => $payinfo, 'invoicing_list' => \@invoicing_list, &> @@ -186,7 +185,7 @@ my $conf = new FS::Conf; #get record -my($custnum, $cust_main, $ss, $stateid, $payinfo, @invoicing_list); +my($custnum, $cust_main, $ss, $stateid, @invoicing_list); my $pkgpart_svcpart = ''; #first_pkg my($username, $password, $popnum, $saved_domsvc) = ( '', '', 0, 0 ); #svc_acct my %svc_phone = (); @@ -234,7 +233,6 @@ if ( $cgi->param('error') ) { $cust_main->setfield('paid' => $cgi->param('paid')) if $cgi->param('paid'); $ss = $cust_main->ss; # don't mask an entered value on errors $stateid = $cust_main->stateid; # don't mask an entered value on errors - $payinfo = $cust_main->payinfo; # don't mask an entered value on errors $cust_main->national_id( $cgi->param('national_id1') || $cgi->param('national_id2') ); @@ -282,7 +280,6 @@ if ( $cgi->param('error') ) { @invoicing_list = $cust_main->invoicing_list; $ss = $conf->exists('unmask_ss') ? $cust_main->ss : $cust_main->masked('ss'); $stateid = $cust_main->masked('stateid'); - $payinfo = $cust_main->paymask; } else { #new customer @@ -298,7 +295,6 @@ if ( $cgi->param('error') ) { unless $conf->exists('disablepostalinvoicedefault'); $ss = ''; $stateid = ''; - $payinfo = ''; $cgi->param('tagnum', FS::part_tag->default_tags); diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 7bca17b50..fbe3e485c 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -326,7 +326,6 @@ function toggle(obj) { my( $cust_main, %options ) = @_; my @invoicing_list = @{ $options{'invoicing_list'} }; -my $payinfo = $options{'payinfo'}; my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; diff --git a/httemplate/elements/cust_payby.html b/httemplate/elements/cust_payby.html index 6e2610bbe..5e0f09d3f 100644 --- a/httemplate/elements/cust_payby.html +++ b/httemplate/elements/cust_payby.html @@ -11,7 +11,8 @@