X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Felements%2Ftr-select-reason.html;h=0df7c058abf362f35116fbd6ea233d70e2a2acc2;hb=ffda3975d8eefa8d08ae9e468dba33448e207ae6;hp=d85538f0c93851af114cf744bce9bf317b1701f3;hpb=624b2d44625f69d71175c3348cae635d580c890b;p=freeside.git
diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html
index d85538f0c..0df7c058a 100755
--- a/httemplate/elements/tr-select-reason.html
+++ b/httemplate/elements/tr-select-reason.html
@@ -6,8 +6,8 @@ Example:
#required
'field' => 'reasonnum',
- 'reason_class' => 'C', # currently 'C', 'R', or 'S'
- # for cancel, credit, or suspend
+ 'reason_class' => 'C', # currently 'C', 'R', 'F', or 'S'
+ # for cancel, credit, refund, or suspend
#recommended
'cgi' => $cgi, #easiest way for things to be properly "sticky" on errors
@@ -29,95 +29,119 @@ Example:
%doc>
+% # note style improvements.
+% # - no more conditionally included code here
+% # - callers are not expected to pass javascript fragments
+% # - no redundant checking of ACLs or parameters
+% # - form fields are grouped for easy management
+% # - use the standard select-table widget instead of ad hoc crap
+%# sadly can't just use add_inline here, as we have non-text fields
+<& tr-select-table.html,
+ 'label' => 'Reason',
+ 'field' => $name,
+ 'id' => $id,
+ 'table' => 'reason',
+ 'records' => \@reasons,
+ 'label_callback' => sub { my $reason = shift;
+ $reason->type . ' : ' . $reason->reason },
+ 'disable_empty' => 1,
+ 'pre_options' => [ 0 => 'Select reason...' ],
+ 'post_options' => [ -1 => 'Add new reason' ],
+ 'curr_value' => $init_reason,
+ 'onchange' => $id.'_changed()',
+&>
+
+% # "add new reason" fields
+% # should be a