X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Felements%2Fedit.html;h=0f5f7bdb7d37db6a336f5931c9006a06ef143196;hp=1d472099b0dbdc34572388e722f906ffe53fb143;hb=b7d4aaee22ceda078bbfcca47038eb0bf4230a1c;hpb=d5988a9f7a3617de33da3058f2e9f1151b24420e
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index 1d472099b..0f5f7bdb7 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -515,12 +515,15 @@ Example:
% }
% foreach my $name_obj ( @existing ) {
%
+% my $m2_label = $f->{'m2_label'};
+% $m2_label = &{ $f->{'m2_label_callback'} }($name_obj) if $f->{'m2_label_callback'};
+%
% my $ex_label = ' '. ($f->{'m2_label'} || $field ). ' ';
+% '> '. ($m2_label || $field ). ' ';
%
% if ( $f->{'layer_values_callback'} ) {
% my %switches = ( 'mode' => $mode );
@@ -701,7 +704,7 @@ Example:
var row = table.insertRow(<%$field%>_rownum++);
- var label_cell = document.createElement('TD');
+ var label_cell = document.createElement('TH');
label_cell.id = '<% $field %>_label' + <%$field%>_fieldnum;
@@ -820,6 +823,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: true' => 'Please only enter numbers here.',
+% 'email: true' => '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;
+% $js_form_validate->{edit_topform}->{error_message}{$extra_fields} = $validate_error_messages{$validate_type};
+% }
+
% unless ($opt{'embed'}) {
@@ -869,6 +884,7 @@ Example:
my(%opt) = @_;
+my $conf = new FS::Conf;
my $curuser = $FS::CurrentUser::CurrentUser;
#false laziness w/process.html
@@ -881,6 +897,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 = {};