From 2e928dafa3cf6383ea9e97f48af61af05e5a292a Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 31 Dec 2009 02:20:33 +0000 Subject: [PATCH] prospecting: proper contact error handling when you add a prospect --- httemplate/edit/elements/edit.html | 20 ++++++---- httemplate/edit/process/elements/process.html | 25 +++++++++--- httemplate/edit/prospect_main.html | 42 +++++++++++++++++--- httemplate/elements/contact.html | 56 ++++++++++----------------- httemplate/elements/menu.html | 7 ++++ 5 files changed, 96 insertions(+), 54 deletions(-) diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 4935ddc1a..43b7afe11 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -40,14 +40,14 @@ Example: 'disabled' => 0, 'onchange' => 'javascript_function', - #m2 stuff only tested w/selectlayers so far - #might work w/select too, dunno others 'm2name_table' => 'table_name', 'm2name_namecol' => 'name_column', #OR# '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 + #OR# + 'o2m_table' => 'm2_label' => 'Label', # 'm2_new_default' => \@table_name_objects, #default @@ -235,6 +235,7 @@ Example: % $layer_values = &{ $f->{'layer_values_callback'} }( $cgi, $object ) % if $f->{'layer_values_callback'} % && ! $f->{'m2name_table'} +% && ! $f->{'o2m_table'} % && ! $f->{'m2m_method'}; % % warn "layer values: ". Dumper($layer_values) @@ -356,12 +357,15 @@ Example: % % my $fieldnum = ''; % my $curr_value = ''; -% if ( $f->{'m2name_table'} || $f->{'m2m_method'} ) { #XXX test this for all -% #types of fields +% if ( $f->{'m2name_table'} || $f->{'o2m_table'} || $f->{'m2m_method'} ) { +% % my($table, $col); % if ( $f->{'m2name_table'} ) { % $table = $f->{'m2name_table'}; % $col = $f->{'m2name_namecol'}; +% } elsif ( $f->{'o2m_table'} ) { +% $table = $f->{'o2m_table'}; +% $col = dbdef->table($f->{'o2m_table'})->primary_key; % } elsif ( $f->{'m2m_method'} ) { % $table = $f->{'m2m_method'}; % $col = $f->{'m2m_dstcol'}; @@ -374,8 +378,8 @@ Example: % @existing = &{ $f->{'m2_error_callback'} }( $cgi, $object ); % } elsif ( $object->$pkey() ) { # $mode eq 'edit'||'clone' % @existing = $object->$table(); -% warn scalar(@existing). " from $object->$table: ". join('/', @existing) -% if $opt{'debug'}; +% warn scalar(@existing). " from $object->$table: ". join('/', @existing) +% if $opt{'debug'}; % } elsif ( $f->{'m2_new_default'} ) { # && $mode eq 'new' % @existing = @{ $f->{'m2_new_default'} }; % } @@ -459,7 +463,7 @@ Example: % ( $fieldnum ? ('cell_style' => 'border-top:1px solid black') : () ), % ); % -% if ( $f->{'m2name_table'} || $f->{'m2m_method'} ) { +% if ( $f->{'m2name_table'} || $f->{'o2m_table'} || $f->{'m2m_method'} ) { % $include[0] =~ s(^/elements/tr-)(/elements/); % my @label = @include; % $label[0] = '/elements/tr-td-label.html'; @@ -492,7 +496,7 @@ Example: <% include( @include ) %> % } -% if ( $f->{'m2name_table'} || $f->{'m2m_method'} ) { +% if ( $f->{'m2name_table'} || $f->{'o2m_table'} || $f->{'m2m_method'} ) {