agent virtualization, take one (stuff from "inactive" changeset snuck into cust_main...
[freeside.git] / httemplate / elements / select-table.html
index 96f0177..6c8089b 100644 (file)
@@ -10,6 +10,7 @@
   ##opt
   # 'empty_label' => '', #better specify it though, the default might change
   # 'hashref'     => {},
+  # 'extra_sql'   => '',
   # 'records'     => \@records, #instead of hashref
   # 'pre_options' => [ 'value' => 'option' ], #before normal options
 
   if ( $opt{'records'} ) {
     @records = @{ $opt{'records'} };
   } else {
-    @records = qsearch( $opt{'table'}, ( $opt{'hashref'} || {} ) );
+    @records = qsearch( {
+      'table'     => $opt{'table'},
+      'hashref'   => ( $opt{'hashref'} || {} ),
+      'extra_sql' => ( $opt{'extra_sql'} || '' ),
+    });
   }
 
   my @pre_options = $opt{'pre_options'} ? @{ $opt{'pre_options'} } : ();