#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 <FORM>, no hidden fields for table name or primary key, no
# display of primary key, no submit button, no html_foot, no footer)
% unless ( $opt{'no_pkey_display'} ) {
- <FONT SIZE="+1"><B>
+ <FONT CLASS="fsinnerbox-title">
<% ( $opt{labels} && exists $opt{labels}->{$pkey} )
? $opt{labels}->{$pkey}
: $pkey
%>
- </B></FONT>
+ </FONT>
#<% ( !$clone && $object->$pkey() ) || "(NEW)" %>
% }
% my $tablenum = $opt{'tablenum'} || 0;
<TABLE ID="TableNumber<% $tablenum++ %>"
- <% $opt{html_table_class} ? 'CLASS="'. $opt{html_table_class}. '"'
- : 'BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0'
- %>
+ CLASS="<% $opt{html_table_class} || 'fsinnerbox' %>"
>
% my $g_row = 0;
%
% my $layer_prefix_on = '';
%
+% my $submitid = $opt{submit_id} ? $opt{submit_id} : '';
+%
% my $include_sub = sub {
% my %opt = @_;
%
% 'field' => "$field$fieldnum",
% 'id' => "$field$fieldnum", #separate?
% 'label_id' => $field."_label$fieldnum", #don't want field0_label0...
+% 'submit_id' => $submitid,
% %include_common,
% %opt,
% );
% }
% 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 = '<INPUT TYPE="button" VALUE="X" TITLE="Remove this '.
% lc($f->{'m2_label'}).
% qq(" onClick="remove_$field($fieldnum);").
% ' STYLE="color:#ff0000;font-weight:bold;'.
% 'padding-left:2px;padding-right:2px"'.
-% '> '. ($f->{'m2_label'} || $field ). ' ';
+% '> '. ($m2_label || $field ). ' ';
%
% if ( $f->{'layer_values_callback'} ) {
% my %switches = ( 'mode' => $mode );
// only spawn if we're the last element... return if not
- var field_regex = /(\d+)(_[a-z_]+)?$/;
+ var field_regex = /(\d+)(_[a-z_0-9]+)?$/;
var match = field_regex.exec(what.name);
if ( !match ) {
alert(what.name + " didn't match for " + what);
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;
: $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'}) {
<BR>
my(%opt) = @_;
+my $conf = new FS::Conf;
my $curuser = $FS::CurrentUser::CurrentUser;
#false laziness w/process.html
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 = {};