From: ivan Date: Sat, 29 Mar 2008 08:15:45 +0000 (+0000) Subject: okay. and thank goodness its on 1.9. really fix error reporting on quick package... X-Git-Tag: root_of_webpay_support~791 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=3f23bdfaef8eb6bb092b72ea741b63e243f8ab19 okay. and thank goodness its on 1.9. really fix error reporting on quick package order this time. have to change cust cancel popup slightly too, but its for the better (easier custnum parsing). and lastly make it easier for reason selection to be reused without stickiness-on-errors being a big pain in the ass --- diff --git a/httemplate/elements/popup_link-cust_main.html b/httemplate/elements/popup_link-cust_main.html index 3b1363f49..a927f39f2 100644 --- a/httemplate/elements/popup_link-cust_main.html +++ b/httemplate/elements/popup_link-cust_main.html @@ -41,7 +41,8 @@ if (ref(@_[0]) eq 'HASH') { ($action, $label, $actionlabel, $color, $cust_main) = @_; } -$action .= '?'. $cust_main->custnum; +$action .= ( $action =~ /\?/ ) ? ';' : '?'; +$action .= 'custnum='. $cust_main->custnum; <% $cust_main diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html index 4051e7d20..d85538f0c 100755 --- a/httemplate/elements/tr-select-reason.html +++ b/httemplate/elements/tr-select-reason.html @@ -1,3 +1,34 @@ +<%doc> + +Example: + + include( '/elements/tr-select-reason.html', + + #required + 'field' => 'reasonnum', + 'reason_class' => 'C', # currently 'C', 'R', or 'S' + # for cancel, credit, or suspend + + #recommended + 'cgi' => $cgi, #easiest way for things to be properly "sticky" on errors + + #optional + 'control_button' => 'element_name', #button to be enabled when a reason is + #selected + 'id' => 'element_id', + + #deprecated ways to keep things "sticky" on errors + # (requires duplicate code in each using file to parse cgi params) + 'curr_value' => $curr_value, + 'curr_value' => { + 'typenum' => $typenum, + 'reason' => $reason, + }, + + ) + + + +<% include('/elements/error.html') %> +
@@ -19,8 +21,9 @@ function enable_order_pkg () { Package <% include('/elements/select-cust-part_pkg.html', - 'cust_main' => $cust_main, - 'onchange' => 'enable_order_pkg', + 'curr_value' => scalar( $cgi->param('pkgpart') ), + 'cust_main' => $cust_main, + 'onchange' => 'enable_order_pkg', ) %> @@ -50,8 +53,7 @@ die "access denied" my $conf = new FS::Conf; -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; +$cgi->param('custnum') =~ /^(\d+)$/; my $custnum = $1; my $cust_main = qsearchs({ 'table' => 'cust_main', diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 0f1d608aa..ec79c0814 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -591,6 +591,7 @@ sub order_pkg_link { include( '/elements/popup_link-cust_main.html', 'actionlabel' => 'Order new package', 'color' => '#333399', 'cust_main' => shift, + 'closetext' => 'Close', } ) }