[freeside-commits] freeside/httemplate/misc location.cgi,1.2,1.3
Ivan,,,
ivan at wavetail.420.am
Mon Dec 28 11:18:22 PST 2009
Update of /home/cvs/cvsroot/freeside/httemplate/misc
In directory wavetail.420.am:/tmp/cvs-serv11618/httemplate/misc
Modified Files:
location.cgi
Log Message:
beginning of prospect/CRM/contact work
Index: location.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/location.cgi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- location.cgi 10 Jan 2009 00:43:06 -0000 1.2
+++ location.cgi 28 Dec 2009 19:18:20 -0000 1.3
@@ -3,12 +3,23 @@
my $locationnum = $cgi->param('arg');
+my $curuser = $FS::CurrentUser::CurrentUser;
+
my $cust_location = qsearchs({
'select' => 'cust_location.*',
'table' => 'cust_location',
'hashref' => { 'locationnum' => $locationnum },
- 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
- 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+ 'addl_from' => ' LEFT JOIN cust_main USING ( custnum ) ',
+ ' LEFT JOIN prospect_main USING ( prospectnum ) ',
+ 'extra_sql' => ' AND ( '.
+ ' ( custnum IS NOT NULL AND '.
+ $curuser->agentnums_sql( table=>'cust_main' ).
+ ' ) '.
+ ' OR '.
+ ' ( prospectnum IS NOT NULL AND '.
+ $curuser->agentnums_sql( table=>'prospect_main' ).
+ ' ) '.
+ ' )',
});
my %hash = ();
More information about the freeside-commits
mailing list