diff options
author | Mark Wells <mark@freeside.biz> | 2015-06-27 15:51:29 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-06-27 19:33:52 -0700 |
commit | 062f38f2f5d0da64c6fd0702d4df2e805473a1f5 (patch) | |
tree | ace3971025894ea6c0251f8a9ecd637c6cfe400e /httemplate/search/elements/match-classnum | |
parent | 68546df9b125f73764eda31f1dcb4e2c0555f859 (diff) |
reports with row grouping for payment/refund search, #25944
Diffstat (limited to 'httemplate/search/elements/match-classnum')
-rw-r--r-- | httemplate/search/elements/match-classnum | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/httemplate/search/elements/match-classnum b/httemplate/search/elements/match-classnum new file mode 100644 index 000000000..ed1efd53c --- /dev/null +++ b/httemplate/search/elements/match-classnum @@ -0,0 +1,12 @@ +<%args> +$param # name of the form field containing the classnum +$field => $param # SQL field that must match that form field +</%args> +<%init> +my @values = grep /^(\d+)$/, $cgi->param( $param ); +if (@values) { + return "COALESCE($field, 0) IN (" . join(',', @values) . ')'; +} else { + return; +} +</%init> |