summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-select-reason.html
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-12-06 09:50:32 -0800
committerMark Wells <mark@freeside.biz>2014-12-06 09:50:32 -0800
commit715120170b58861d2957266a2802df2e412979c8 (patch)
treef480774d2c8e005c1bb5bbbe6ed0a1467a373112 /httemplate/elements/tr-select-reason.html
parent56efb22e0fe7adb1aebad517c6975edbf6e1c921 (diff)
slightly more cautious fix for sorting the reason selector, #31702
Diffstat (limited to 'httemplate/elements/tr-select-reason.html')
-rwxr-xr-xhttemplate/elements/tr-select-reason.html5
1 files changed, 2 insertions, 3 deletions
diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html
index 2dce9effe..52dc956d5 100755
--- a/httemplate/elements/tr-select-reason.html
+++ b/httemplate/elements/tr-select-reason.html
@@ -70,8 +70,7 @@ Example:
'id' => $id,
'table' => 'reason',
'records' => \@reasons,
- 'label_callback' => sub { my $reason = shift;
- $reason->type . ' : ' . $reason->reason },
+ 'name_col' => 'label',
'disable_empty' => 1,
'pre_options' => [ 0 => 'Select reason...' ],
'post_options' => \@post_options,
@@ -177,11 +176,11 @@ if ($class eq 'C') {
my @reasons = qsearch({
'table' => 'reason',
+ 'select' => "reason.*, (type || ' : ' || reason) AS label",
'addl_from' => ' LEFT JOIN reason_type'.
' ON (reason.reason_type = reason_type.typenum)',
'hashref' => { disabled => '' },
'extra_sql' => " AND reason_type.class = '$class'",
- 'order_by' => ' ORDER BY type, reason',
});
my %all_hints;