[freeside-commits] freeside/httemplate/browse part_pkg.cgi, 1.49, 1.50

Ivan,,, ivan at wavetail.420.am
Sun Feb 22 00:41:30 PST 2009


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

Modified Files:
	part_pkg.cgi 
Log Message:
add agent type list to package def browse, RT#4880

Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/part_pkg.cgi,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- part_pkg.cgi	9 Feb 2009 01:49:28 -0000	1.49
+++ part_pkg.cgi	22 Feb 2009 08:41:27 -0000	1.50
@@ -30,6 +30,7 @@
 my $acl_edit        = $curuser->access_right($edit);
 my $acl_edit_global = $curuser->access_right($edit_global);
 my $acl_config      = $curuser->access_right('Configuration'); #to edit services
+                                                               #and agent types
 
 die "access denied"
   unless $acl_edit || $acl_edit_global;
@@ -174,6 +175,40 @@
 #    $part_pkg->freq_pretty; #.'<BR>'
 };
 
+###
+# Agent goes here if displayed
+###
+
+#agent type
+if ( $acl_edit_global ) {
+  #really we just want a count, but this is fine unless someone has tons
+  my @all_agent_types = map {$_->typenum} qsearch('agent_type',{});
+  if ( scalar(@all_agent_types) > 1 ) {
+    push @header, 'Agent types';
+    my $typelink = $p. 'edit/agent_type.cgi?';
+    push @fields, sub { my $part_pkg = shift;
+                        [
+                          map { warn $_;
+                                my $agent_type = $_->agent_type;
+                                warn $agent_type;
+                                [ 
+                                  { 'data'  => $agent_type->atype, #escape?
+                                    'align' => 'left',
+                                    'link'  => ( $acl_config
+                                                   ? $typelink.
+                                                     $agent_type->typenum
+                                                   : ''
+                                               ),
+                                  },
+                                ];
+                              }
+                              $part_pkg->type_pkgs
+                        ];
+                      };
+    $align .= 'l';
+  }
+}
+
 #if ( $cgi->param('active') ) {
   push @header, 'Customer<BR>packages';
   my %col = (



More information about the freeside-commits mailing list