From 24533a22a23e211888fcc36a5177c0def5c77de3 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 8 Feb 2009 02:05:48 +0000 Subject: further work on agents editing own packages: allow them to see (but not edit) global packages for their type, RT#1331 --- httemplate/elements/select-cust-part_pkg.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'httemplate/elements/select-cust-part_pkg.html') diff --git a/httemplate/elements/select-cust-part_pkg.html b/httemplate/elements/select-cust-part_pkg.html index 57da5cd84..292662921 100644 --- a/httemplate/elements/select-cust-part_pkg.html +++ b/httemplate/elements/select-cust-part_pkg.html @@ -32,8 +32,10 @@ my $cust_main = $opt{'cust_main'} or die "cust_main not specified"; $opt{'extra_sql'} .= - ' AND 0 < ( SELECT COUNT(*) FROM type_pkgs '. - ' WHERE typenum = '. $cust_main->agent->typenum. - ' AND type_pkgs.pkgpart = part_pkg.pkgpart )'; + ' AND ( agentnum IS NOT NULL '. + ' OR 0 < ( SELECT COUNT(*) FROM type_pkgs '. + ' WHERE typenum = '. $cust_main->agent->typenum. + ' AND type_pkgs.pkgpart = part_pkg.pkgpart )'. + ' )'; -- cgit v1.2.1