From df676d82034cb63ff357f8d8ed0f95ce788fb98b Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 9 Feb 2009 01:49:28 +0000 Subject: further work on agents editing own packages: fix fallout on package customization from turning agent_virt on in edit/part_pkg.cgi, add a "clone package" to package browse, like clone service, and have agent type selection disappear when you set an agentnum. RT#1331 --- httemplate/browse/part_pkg.cgi | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'httemplate/browse/part_pkg.cgi') diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index cdaa2c92a..1fed614a2 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -46,25 +46,11 @@ if ( $cgi->param('active') ) { my $extra_sql = ''; -#false laziness w/elements/select-part_pkg.html -my $agentnums = join(',', $curuser->agentnums); - unless ( $acl_edit_global ) { - $extra_sql .= " - WHERE ( - agentnum IS NOT NULL OR 0 < ( - SELECT COUNT(*) - FROM type_pkgs - LEFT JOIN agent_type USING ( typenum ) - LEFT JOIN agent AS typeagent USING ( typenum ) - WHERE type_pkgs.pkgpart = part_pkg.pkgpart - AND typeagent.agentnum IN ($agentnums) - ) - ) - "; + $extra_sql .= ' WHERE '. FS::part_pkg->curuser_pkgs_sql; } -#eofalse +my $agentnums = join(',', $curuser->agentnums); my $count_cust_pkg = " SELECT COUNT(*) FROM cust_pkg LEFT JOIN cust_main USING ( custnum ) WHERE cust_pkg.pkgpart = part_pkg.pkgpart @@ -97,7 +83,12 @@ my $html_init; One or more service definitions are grouped together into a package definition and given pricing information. Customers purchase packages rather than purchase services directly.

+
Add a new package definition + or + !.include('/elements/select-part_pkg.html', 'element_name' => 'clone' ). qq! + +


!; #} -- cgit v1.2.1