diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-05-08 20:34:47 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-05-08 20:34:47 -0700 |
commit | e4e9e2f1fe6f48cf22486962c6bf84f50d201358 (patch) | |
tree | 9cf0119aee57e7b8568ac2e085c0caa085032562 /httemplate/edit/elements | |
parent | a68564e6856a7ea63763eeaf7962a5cb2df649af (diff) |
fix service definition modifiers (inventory, hardware) w/svc_broadband, RT#17659
Diffstat (limited to 'httemplate/edit/elements')
-rw-r--r-- | httemplate/edit/elements/edit.html | 2 | ||||
-rw-r--r-- | httemplate/edit/elements/svc_Common.html | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 73faad4c0..bf4e51f8c 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -317,7 +317,7 @@ Example: % $include_common{$_} = $f->{$_} foreach grep exists($f->{$_}), % qw( js_only html_only select_only layers_only cell_style ),#selectlayers,? % qw( empty_label ), # select-* -% qw( value_col ), # select-table +% qw( value_col compare_sub ), # select-table % qw( table name_col ), #(select,checkboxes)-table % qw( target_table link_table ), #checkboxes-table % qw( hashref agent_virt agent_null agent_null_right ),#*-table diff --git a/httemplate/edit/elements/svc_Common.html b/httemplate/edit/elements/svc_Common.html index 38716f06e..0d9d36c07 100644 --- a/httemplate/edit/elements/svc_Common.html +++ b/httemplate/edit/elements/svc_Common.html @@ -103,7 +103,15 @@ $f->{'extra_sql'} .= ' OR svcnum = '. $object->svcnum if $object->svcnum; $f->{'extra_sql'} .= ' ) '; - $f->{'disable_empty'} = $object->svcnum ? 1 : 0, + $f->{'disable_empty'} = $object->svcnum ? 1 : 0; + if ( $f->{'field'} eq 'mac_addr' ) { + $f->{'compare_sub'} = sub { + my($a, $b) = @_; + $a =~ s/[-: ]//g; + $b =~ s/[-: ]//g; + lc($a) eq lc($b); + }; + } } elsif ( $flag eq 'H' ) { $f->{'type'} = 'select-hardware_type'; $f->{'hashref'} = { @@ -127,6 +135,10 @@ $object->set('custnum', $cust_pkg->custnum); } + if ( my $cb = $opt{'svc_field_callback'} ) { + &{ $cb }( $cgi, $object, $f); + } + }, 'html_init' => sub { |