[freeside-commits] freeside/httemplate/elements select-agent.html, 1.8, 1.9 tr-select-agent.html, 1.6, 1.7

Ivan,,, ivan at wavetail.420.am
Fri Feb 13 16:40:13 PST 2009


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

Modified Files:
	select-agent.html tr-select-agent.html 
Log Message:
clean up select-agent agent virtualization, RT#1405

Index: select-agent.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/select-agent.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- select-agent.html	28 Jun 2008 19:25:22 -0000	1.8
+++ select-agent.html	14 Feb 2009 00:40:11 -0000	1.9
@@ -1,10 +1,11 @@
 <% include( '/elements/select-table.html',
-                 'table'       => 'agent',
-                 'name_col'    => 'agent',
-                 'value'       => $agentnum || '',
-                 'empty_label' => 'all',
-                 'hashref'     => { 'disabled' => '' },
-                 'order_by'    => ' ORDER BY agent',
+                 'table'         => 'agent',
+                 'name_col'      => 'agent',
+                 'value'         => $agentnum || '',
+                 'agent_virt'    => 1,
+                 'empty_label'   => 'all',
+                 'hashref'       => { 'disabled' => '' },
+                 'order_by'      => ' ORDER BY agent',
                  'disable_empty' => $disable_empty,
                  %opt,
              )
@@ -18,12 +19,13 @@
   if $opt{'agents'};
 
 my $curuser = $FS::CurrentUser::CurrentUser;
-my $disable_empty = 1;
-if ( $opt{'agent_null_right'} &&
-     $curuser->access_right($opt{'agent_null_right'})
-   )
-{
-  $disable_empty--;
+my $disable_empty = 0;
+if ( $opt{'agent_null_right'} ) {
+  if ( $curuser->access_right($opt{'agent_null_right'}) ) {
+    $disable_empty = 0;
+  } else {
+    $disable_empty = 1;
+  }
 }
 
 </%init>

Index: tr-select-agent.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/tr-select-agent.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- tr-select-agent.html	21 Nov 2008 01:58:50 -0000	1.6
+++ tr-select-agent.html	14 Feb 2009 00:40:11 -0000	1.7
@@ -26,15 +26,8 @@
 my %opt = @_;
 my $agentnum = $opt{'curr_value'} || $opt{'value'};
 
-my @agents;
-if ( $opt{'agents'} ) {
-  #@agents = @{ $opt{'agents'} };
-  #here is the agent virtualization
-  my $agentnums_href = $FS::CurrentUser::CurrentUser->agentnums_href;
-  @agents = grep $agentnums_href->{$_->agentnum}, @{ $opt{'agents'} };
-  delete $opt{'agents'};
-} else {
-  @agents = $FS::CurrentUser::CurrentUser->agents;
-}
+my @agents = $opt{'agents'}
+               ? @{ $opt{'agents'} }
+               : $FS::CurrentUser::CurrentUser->agents;
 
 </%init>



More information about the freeside-commits mailing list