X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2FREAL_cust_pkg.cgi;h=606cf87e73e15f6f7372164778d6d8cc5875702c;hb=62b18c75989a1b00a25079f8f110992aaad81bba;hp=fea85456f540212e1b26946d9f7ce162700e50aa;hpb=0930d22ffc440f80c1b222b2e750cadbabd9e8f6;p=freeside.git diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi index fea85456f..606cf87e7 100755 --- a/httemplate/edit/REAL_cust_pkg.cgi +++ b/httemplate/edit/REAL_cust_pkg.cgi @@ -9,9 +9,37 @@ +
<% include('/elements/footer.html') %> +<%shared> -<%once> +my $conf = new FS::Conf; +my $date_format = $conf->config('date_format') || '%m/%d/%Y'; -#my $format = "%c %z (%Z)"; -my $format = "%m/%d/%Y %T %z (%Z)"; +my $format = $date_format. ' %T'; # %z (%Z)'; -#false laziness w/view/cust_main/packages.html -#my( $billed_or_prepaid, +my $contract_only = $FS::CurrentUser::CurrentUser->access_right('Edit customer package dates') ? 0 : 1; -%once> +%shared> <%init> +# see $contract_only in shared block above die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Edit customer package dates'); + unless $FS::CurrentUser::CurrentUser->access_right('Edit customer package dates') + or $FS::CurrentUser::CurrentUser->access_right('Change package contract end date'); my $error = ''; my( $pkgnum, $cust_pkg ); @@ -133,24 +221,23 @@ my( $pkgnum, $cust_pkg ); if ( $cgi->param('error') ) { $pkgnum = $cgi->param('pkgnum'); - if ( $cgi->param('error') eq '_bill_areyousure' ) { - if ( $cgi->param('bill') =~ /^([\s\d\/\:\-\(\w\)]*)$/ ) { - my $bill = $1; - $cgi->param('error', ''); - $error = "You are attempting to set the next bill date to $bill, which is - in the past. This will charge the customer for the interval - from $bill until now. Are you sure you want to do this? ". - ''; - } + + if ( $cgi->param('error') =~ /^_/ ) { + + my @errors = (); + my %errors = map { $_=>1 } split(',', $cgi->param('error')); + $cgi->param('error', ''); + $error = join('