projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
62157b2
)
Agent virtualize the attachment report. See RT#24899.
author
Justin DeVuyst
<justin@devuyst.com>
Sat, 4 Mar 2017 00:23:15 +0000
(19:23 -0500)
committer
Justin DeVuyst
<justin@devuyst.com>
Sat, 4 Mar 2017 00:23:15 +0000
(19:23 -0500)
httemplate/browse/cust_attachment.html
patch
|
blob
|
history
diff --git
a/httemplate/browse/cust_attachment.html
b/httemplate/browse/cust_attachment.html
index
f81ec1b
..
bc9597f
100755
(executable)
--- a/
httemplate/browse/cust_attachment.html
+++ b/
httemplate/browse/cust_attachment.html
@@
-11,10
+11,7
@@
<INPUT TYPE="hidden" NAME="orderby" VALUE="$orderby">
<INPUT TYPE="hidden" NAME="show_deleted" VALUE="$disabled">!
,
<INPUT TYPE="hidden" NAME="orderby" VALUE="$orderby">
<INPUT TYPE="hidden" NAME="show_deleted" VALUE="$disabled">!
,
- 'query' => { 'table' => 'cust_attachment',
- 'hashref' => $hashref,
- 'order_by' => 'ORDER BY '.$orderby,
- },
+ 'query' => $query,
'count_query' => $count_query,
'header' => [ selflink('#',orderby => 'attachnum'),
selflink('Customer',orderby => 'custnum'),
'count_query' => $count_query,
'header' => [ selflink('#',orderby => 'attachnum'),
selflink('Customer',orderby => 'custnum'),
@@
-90,14
+87,20
@@
else {
}
}
}
}
-my $hashref = $disabled ?
- { disabled => { op => '>', value => 0 } } :
- { disabled => '' };
+my $orderby = $cgi->param('orderby') || 'custnum';
-my $count_query = 'SELECT COUNT(*) FROM cust_attachment WHERE '. ($disabled ?
- 'disabled > 0' : 'disabled IS NULL');
+my $query = {
+ table => 'cust_attachment',
+ hashref => { disabled => $disabled ? { op => '>', value => 0 } : undef, },
+ order_by => "ORDER BY $orderby",
+ addl_from => 'JOIN cust_main USING (custnum)',
+ extra_sql => ' AND ' . $curuser->agentnums_sql,
+};
-my $orderby = $cgi->param('orderby') || 'custnum';
+my $count_query = 'SELECT COUNT(*) FROM cust_attachment'
+ . ' JOIN cust_main USING (custnum)'
+ . ' WHERE ' . $curuser->agentnums_sql
+ . ' AND disabled ' . ( $disabled ? '> 0' : 'IS NULL' );
my $sub_cust = sub {
my $c = qsearchs('cust_main', { custnum => shift->custnum } );
my $sub_cust = sub {
my $c = qsearchs('cust_main', { custnum => shift->custnum } );