[freeside-commits] freeside/httemplate/browse part_pkg.cgi, 1.48, 1.49 access_group.html, 1.8, 1.9

Ivan,,, ivan at wavetail.420.am
Sun Feb 8 17:49:30 PST 2009


Update of /home/cvs/cvsroot/freeside/httemplate/browse
In directory wavetail.420.am:/tmp/cvs-serv4506/httemplate/browse

Modified Files:
	part_pkg.cgi access_group.html 
Log Message:
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

Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/part_pkg.cgi,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- part_pkg.cgi	8 Feb 2009 02:05:48 -0000	1.48
+++ part_pkg.cgi	9 Feb 2009 01:49:28 -0000	1.49
@@ -46,25 +46,11 @@
 
 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 @@
     One or more service definitions are grouped together into a package 
     definition and given pricing information.  Customers purchase packages
     rather than purchase services directly.<BR><BR>
+    <FORM METHOD="POST" ACTION="${p}edit/part_pkg.cgi">
     <A HREF="${p}edit/part_pkg.cgi"><I>Add a new package definition</I></A>
+    or
+    !.include('/elements/select-part_pkg.html', 'element_name' => 'clone' ). qq!
+    <INPUT TYPE="submit" VALUE="Clone existing package">
+    </FORM>
     <BR><BR>
   !;
 #}

Index: access_group.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/access_group.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- access_group.html	25 Jan 2009 22:20:00 -0000	1.8
+++ access_group.html	9 Feb 2009 01:49:28 -0000	1.9
@@ -81,9 +81,7 @@
     '<TR><TH BGCOLOR="#dcdcdc">'. $_. '</TH></TR>'.
     '<TR><TD>'.
 
-     join('<BR>', grep { warn "$access_group->access_right($_): ".
-                              $access_group->access_right($_). "\n";
-                         $access_group->access_right($_); }
+     join('<BR>', grep { $access_group->access_right($_); }
                    map { ref($_) ? $_->{'rightname'} : $_; }
                        @{ $rights{$_} }
          ).



More information about the freeside-commits mailing list