X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Felements%2Fedit.html;h=819b8bdbf5dfa08256b8f5d6ad2353b35d3439b3;hb=ae6359efac06d899093f799052ef8d472effbe98;hp=9f37388305f538c652d1ef22d8a1185881d8861c;hpb=1d14074a4fd89c93ba431501cff5a16e3c4a6c9b;p=freeside.git diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 9f3738830..819b8bdbf 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -114,6 +114,9 @@ Example: #we're in a popup (no title/menu/searchboxes) 'popup' => 1, + #if you need to access the submit button + 'submit_id' => 'mysubmitbuttonid', + #we're embedded (rows only: no header at all, no html_init, no error # display, no
, no hidden fields for table name or primary key, no # display of primary key, no submit button, no html_foot, no footer) @@ -398,6 +401,8 @@ Example: % % my $layer_prefix_on = ''; % +% my $submitid = $opt{submit_id} ? $opt{submit_id} : ''; +% % my $include_sub = sub { % my %opt = @_; % @@ -422,6 +427,7 @@ Example: % 'field' => "$field$fieldnum", % 'id' => "$field$fieldnum", #separate? % 'label_id' => $field."_label$fieldnum", #don't want field0_label0... +% 'submit_id' => $submitid, % %include_common, % %opt, % ); @@ -669,7 +675,7 @@ Example: var newrow = <% include(@layer_opt, html_only=>1) |js_string %>; % #until the rest have html/js_only -% if ( $type eq 'selectlayers' || $type =~ /^select-cgp_rule_/ ) { +% if ( ($type eq 'selectlayers') || ($type =~ /^select-cgp_rule_/) || ($type eq 'contact') ) { var newfunc = <% include(@layer_opt, js_only=>1) |js_string %>; % } else { var newfunc = ''; @@ -814,6 +820,18 @@ Example: : $opt{'html_bottom'} %> +% ## set extra field values for validation. ie price plan fields +% my $extra_fields_to_validate = $opt{'extra_fields_validate'}; +% my %validate_error_messages = ( +% 'digits' => 'Please only enter numbers here.', +% 'email' => 'Please enter a valid email here.', +% ); +% foreach my $extra_fields (keys %$extra_fields_to_validate) { +% my $validate_type = $extra_fields_to_validate->{$extra_fields}; +% $js_form_validate->{edit_topform}->{validate_fields}{$extra_fields} = $validate_type.': true'; +% $js_form_validate->{edit_topform}->{error_message}{$extra_fields} = $validate_error_messages{$validate_type}; +% } + % unless ($opt{'embed'}) {
@@ -863,6 +881,7 @@ Example: my(%opt) = @_; +my $conf = new FS::Conf; my $curuser = $FS::CurrentUser::CurrentUser; #false laziness w/process.html @@ -875,6 +894,8 @@ my $fields = $opt{'fields'} my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields; push @actualfields, $pkey; +push @actualfields, 'ip_addr' if $table eq 'svc_broadband'; +push @actualfields, 'usergroup' if ($table eq 'svc_broadband' && $conf->exists('svc_broadband-radius')); my $js_form_validate = {};