summaryrefslogtreecommitdiff
path: root/httemplate/view/svc_hardware.cgi
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-03-14 13:44:00 -0700
committerMark Wells <mark@freeside.biz>2012-03-14 13:44:00 -0700
commita69299c596de60f4b26db7431165f7f3ffe928e2 (patch)
tree076319cad385baeb8bcf6fe9ce0ac980ccab50c7 /httemplate/view/svc_hardware.cgi
parentda590709ee5f3e6a661950fcfce39dbbf9d6add4 (diff)
svc_hardware MAC address input format, #16266
Diffstat (limited to 'httemplate/view/svc_hardware.cgi')
-rw-r--r--httemplate/view/svc_hardware.cgi20
1 files changed, 19 insertions, 1 deletions
diff --git a/httemplate/view/svc_hardware.cgi b/httemplate/view/svc_hardware.cgi
index 1d882352b..725358cad 100644
--- a/httemplate/view/svc_hardware.cgi
+++ b/httemplate/view/svc_hardware.cgi
@@ -6,6 +6,7 @@
%>
<%init>
+my $conf = new FS::Conf;
my $fields = FS::svc_hardware->table_info->{'fields'};
my %labels = map { $_ => ( ref($fields->{$_})
? $fields->{$_}{'label'}
@@ -24,5 +25,22 @@ my $note = { field => 'note',
type => 'text',
value => sub { encode_entities($_[0]->note) }
};
-my @fields = ($model, qw( serial hw_addr ip_addr smartcard ), $status, $note );
+my $hw_addr ={ field => 'hw_addr',
+ type => 'text',
+ value => sub {
+ my $hw_addr = $_[0]->hw_addr;
+ $conf->exists('svc_hardware-check_mac_addr') ?
+ join(':', $hw_addr =~ /../g) : $hw_addr
+ },
+ };
+
+my @fields = (
+ $model,
+ 'serial',
+ $hw_addr,
+ 'ip_addr',
+ 'smartcard',
+ $status,
+ $note,
+);
</%init>