From f00c16b7e3e6306723ea8b3029e061cff100b901 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Wed, 20 Feb 2013 16:48:48 -0800 Subject: save changes to credit card billing address, #940 --- httemplate/misc/process/payment.cgi | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'httemplate/misc/process') diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index 506e26684..981614e76 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -210,7 +210,15 @@ if ( $cgi->param('save') ) { $new->set( 'paycvv' => ''); } - $new->set( $_ => $cgi->param($_) ) foreach @{$payby2fields{$payby}}; + if ( $payby eq 'CARD' ) { + my $bill_location = FS::cust_location->new; + $bill_location->set( $_ => $cgi->param($_) ) + foreach @{$payby2fields{$payby}}; + $new->set('bill_location' => $bill_location); + # will do nothing if the fields are all unchanged + } else { + $new->set( $_ => $cgi->param($_) ) foreach @{$payby2fields{$payby}}; + } my $error = $new->replace($cust_main); errorpage("payment processed successfully, but error saving info: $error") -- cgit v1.2.1 From a5e611f5ffc045a59fee9e1b03f8ac79ef794d00 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Wed, 27 Feb 2013 12:34:17 -0800 Subject: "Edit password" ACL, #21178, part 1 --- httemplate/misc/process/change-password.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 httemplate/misc/process/change-password.html (limited to 'httemplate/misc/process') diff --git a/httemplate/misc/process/change-password.html b/httemplate/misc/process/change-password.html new file mode 100644 index 000000000..7005439cc --- /dev/null +++ b/httemplate/misc/process/change-password.html @@ -0,0 +1,21 @@ +<%init> +my $curuser = $FS::CurrentUser::CurrentUser; +die "access denied" unless $curuser->access_right('Edit password'); + +$cgi->param('svcnum') =~ /^(\d+)$/ or die "illegal svcnum"; +my $svcnum = $1; +my $svc_acct = FS::svc_acct->by_key($svcnum) + or die "svc_acct $svcnum not found"; +my $error = $svc_acct->set_password($cgi->param('password')) + || $svc_acct->replace; + +# annoyingly specific to view/svc_acct.cgi, for now... +$cgi->delete('password'); + +% if ( $error ) { +% $cgi->param('svcnum', $svcnum); +% $cgi->param("changepw${svcnum}_error", $error); +% } else { +% $cgi->query_string($svcnum); +% } +<% $cgi->redirect($fsurl.'view/svc_acct.cgi?'.$cgi->query_string) %> -- cgit v1.2.1 From 2920cfc494c2811ca7879d6ecaa353d216c9f69d Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Wed, 27 Feb 2013 12:47:34 -0800 Subject: "Edit password" ACL, #21178, part 2 --- httemplate/misc/process/change-password.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'httemplate/misc/process') diff --git a/httemplate/misc/process/change-password.html b/httemplate/misc/process/change-password.html index 7005439cc..7cab9c4e3 100644 --- a/httemplate/misc/process/change-password.html +++ b/httemplate/misc/process/change-password.html @@ -1,11 +1,16 @@ <%init> my $curuser = $FS::CurrentUser::CurrentUser; -die "access denied" unless $curuser->access_right('Edit password'); $cgi->param('svcnum') =~ /^(\d+)$/ or die "illegal svcnum"; my $svcnum = $1; my $svc_acct = FS::svc_acct->by_key($svcnum) or die "svc_acct $svcnum not found"; +my $part_svc = $svc_acct->part_svc; +die "access denied" unless ( + $curuser->access_right('Provision customer service') or + ( $curuser->access_right('Edit password') and + ! $part_svc->restrict_edit_password ) + ); my $error = $svc_acct->set_password($cgi->param('password')) || $svc_acct->replace; -- cgit v1.2.1 From dfc85a4245f2d15f258d840b98f0508c50228e40 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Mon, 25 Mar 2013 15:47:34 -0700 Subject: email opt-out flag, #19312 --- httemplate/misc/process/manage_cust_email.html | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 httemplate/misc/process/manage_cust_email.html (limited to 'httemplate/misc/process') diff --git a/httemplate/misc/process/manage_cust_email.html b/httemplate/misc/process/manage_cust_email.html new file mode 100644 index 000000000..5bf1470d1 --- /dev/null +++ b/httemplate/misc/process/manage_cust_email.html @@ -0,0 +1,32 @@ +<% $cgi->redirect($fsurl.'misc/manage_cust_email.html?' . + $cgi->query_string) %> +<%init> +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Edit customer'); + +my $error; +foreach my $custnum ($cgi->param('custnum')) { + my $cust = FS::cust_main->by_key($custnum) + or die "customer not found: $custnum\n"; + my $new_invoice_noemail = + $cgi->param('custnum'.$custnum.'_invoice_email') ? '' : 'Y'; + my $new_message_noemail = + $cgi->param('custnum'.$custnum.'_message_email') ? '' : 'Y'; + if ( $new_invoice_noemail ne $cust->invoice_noemail + or $new_message_noemail ne $cust->message_noemail ) { + + $cust->set('invoice_noemail', $new_invoice_noemail); + $cust->set('message_noemail', $new_message_noemail); + $error ||= $cust->replace; + + } + $cgi->delete('custnum'.$custnum.'_invoice_email'); + $cgi->delete('custnum'.$custnum.'_message_email'); +} +$cgi->delete('custnum'); +if ( $error ) { + $cgi->param('error' => $error); # probably unnecessary... +} else { + $cgi->param('done' => 1) unless $error; +} + -- cgit v1.2.1 From c0c1485222462c4df5aac8e209a865c984262d3c Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Fri, 19 Apr 2013 13:05:56 -0700 Subject: package contacts / "name per packages", RT#22185 --- httemplate/misc/process/change_pkg_contact.html | 49 +++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 httemplate/misc/process/change_pkg_contact.html (limited to 'httemplate/misc/process') diff --git a/httemplate/misc/process/change_pkg_contact.html b/httemplate/misc/process/change_pkg_contact.html new file mode 100644 index 000000000..2795c1197 --- /dev/null +++ b/httemplate/misc/process/change_pkg_contact.html @@ -0,0 +1,49 @@ +<% header(emt("Package contact $past_method")) %> + + + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Change customer package'); + +#untaint pkgnum +my $pkgnum = $cgi->param('pkgnum'); +$pkgnum =~ /^(\d+)$/ or die "Illegal pkgnum"; +$pkgnum = $1; + +my $cust_pkg = qsearchs( 'cust_pkg', {'pkgnum'=>$pkgnum} ); #needs agent virt + +my $contactnum = $cgi->param('contactnum'); +$contactnum =~ /^(-?\d*)$/ or die "Illegal contactnum"; +$contactnum = $1; + +my $past_method = $cust_pkg->contactnum ? 'changed' : 'added'; + +my $error = ''; + +if ( $contactnum == -1 ) { + + #little false laziness w/edit/process/quick-cust_pkg.cgi, also the whole + # thing should be a single transaction + my $contact = new FS::contact { + 'custnum' => $cust_pkg->custnum, + map { $_ => scalar($cgi->param("contactnum_$_")) } qw( first last ) + }; + $error = $contact->insert; + $cust_pkg->contactnum( $contact->contactnum ); + +} else { + $cust_pkg->contactnum($contactnum); +} + +$error ||= $cust_pkg->replace; + +if ($error) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "change_pkg_contact.html?". $cgi->query_string ); +} + + -- cgit v1.2.1 From b3495184423119719067c5438a0f09eabda16306 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 6 Jun 2013 11:34:24 -0700 Subject: fix error display on invoice voids, RT#23453 --- httemplate/misc/process/void-cust_bill.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/misc/process') diff --git a/httemplate/misc/process/void-cust_bill.html b/httemplate/misc/process/void-cust_bill.html index 899901a50..accee27fd 100755 --- a/httemplate/misc/process/void-cust_bill.html +++ b/httemplate/misc/process/void-cust_bill.html @@ -1,6 +1,6 @@ %if ( $error ) { % $cgi->param('error', $error); -<% $cgi->redirect(popurl(1). "void-cust_bill.html?". $cgi->query_string ) %> +<% $cgi->redirect(popurl(2). "void-cust_bill.html?". $cgi->query_string ) %> %} else { <& /elements/header-popup.html, 'Invoice voided' &>