package categories (meta package classes) and grouping invoices by them
[freeside.git] / httemplate / edit / elements / edit.html
index 150ed85..86eb2b3 100644 (file)
@@ -41,10 +41,9 @@ Example:
                     'm2name_table'   => 'table_name',
                     'm2name_namecol' => 'name_column',
                     #OR#
-                    'm2m_table'        =>
-                    'm2m_target_table' =>
-                    'm2m_srccol'  => #opt, if not the same as this table
-                    'm2m_dstcol'  => #opt, if not the same as target table
+                    'm2m_method'       =>
+                    #'m2m_srccol'  => #opt, if not the same as this table
+                    'm2m_dstcol'  => #required for now, eventuaully opt, if not the same as target table
 
                     'm2_label'   => 'Label',        #
                     'm2_new_default' => \@table_name_objects, #default
@@ -92,7 +91,7 @@ Example:
     'agent_null_right' => 'Access Right Name',
    
     #run when re-displaying with an error
-    'error_callback' => sub { my( $cgi, $object, $fields_listref ) = @_; },
+    'error_callback' => sub { my( $cgi, $object, $fields_listref, $opt_hashref ) = @_; },
    
     #run when editing
     'edit_callback' => sub { my( $cgi, $object, $fields_listref ) = @_; },
@@ -107,7 +106,7 @@ Example:
     'new_callback' => sub { my( $cgi, $object, $fields_listref ) = @_; },
    
     #run before display to return a different value
-    'value_callback' => sub { my( $columname, $value ) = @_; },
+    'value_callback' => sub { my( $columname, $value ) = @_; },
 
     #XXX describe
     'field_callback' => sub { },
@@ -196,7 +195,7 @@ Example:
 %   $layer_values = &{ $f->{'layer_values_callback'} }( $cgi, $object )
 %     if $f->{'layer_values_callback'}
 %     && ! $f->{'m2name_table'}
-%     && ! $f->{'m2m_table'};
+%     && ! $f->{'m2m_method'};
 %
 %   warn "layer values: ". Dumper($layer_values)
 %     if $opt{'debug'};
@@ -213,6 +212,7 @@ Example:
 %     #select(-*)
 %     'options'       => $f->{'options'},
 %     'labels'        => $f->{'labels'},
+%     'empty_label'   => $f->{'empty_label'},
 %     'multiple'      => $f->{'multiple'},
 %     'disable_empty' => $f->{'disable_empty'},
 %     #select-reason
@@ -277,17 +277,15 @@ Example:
 %
 %   my $fieldnum = '';
 %   my $curr_value = '';
-%   if ( $f->{'m2name_table'} || $f->{'m2m_table'} ) { #XXX test this for all
+%   if ( $f->{'m2name_table'} || $f->{'m2m_method'} ) { #XXX test this for all
 %                                                      #types of fields
 %     my($table, $col);
 %     if ( $f->{'m2name_table'} ) {
 %       $table = $f->{'m2name_table'};
 %       $col   = $f->{'m2name_namecol'};
-%     } elsif ( $f->{'m2m_table'} ) {
-%       $table = $f->{'m2m_table'}; #XXX method name
-%       $col   = $f->{'m2m_dstcol'}; #XXX or get it from schema, defualt to
-%                                    #same name as primary key of
-%                                    #m2m_target_table
+%     } elsif ( $f->{'m2m_method'} ) {
+%       $table = $f->{'m2m_method'};
+%       $col   = $f->{'m2m_dstcol'};
 %     }
 %     $fieldnum = 0;
 %     $layer_prefix_on = 1;
@@ -357,7 +355,7 @@ Example:
 
     <% include( @include ) %>
 
-%   if ( $f->{'m2name_table'} || $f->{'m2m_table'} ) {
+%   if ( $f->{'m2name_table'} || $f->{'m2m_method'} ) {
 
       <SCRIPT TYPE="text/javascript">
 
@@ -551,7 +549,7 @@ if ( $cgi->param('error') ) {
     map { $_ => scalar($cgi->param($_)) } fields($table)
   });
 
-  &{$opt{'error_callback'}}($cgi, $object, $fields)
+  &{$opt{'error_callback'}}($cgi, $object, $fields, \%opt )
     if $opt{'error_callback'};
 
 } elsif ( $cgi->keywords || $cgi->param($pkey) ) { #editing