diff options
Diffstat (limited to 'httemplate/view')
-rw-r--r-- | httemplate/view/elements/svc_Common.html | 12 | ||||
-rw-r--r-- | httemplate/view/svc_cert.cgi | 8 | ||||
-rw-r--r-- | httemplate/view/svc_hardware.cgi | 6 | ||||
-rw-r--r-- | httemplate/view/svc_phone.cgi | 13 |
4 files changed, 27 insertions, 12 deletions
diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html index 46b9c28fa..a7f8f6df4 100644 --- a/httemplate/view/elements/svc_Common.html +++ b/httemplate/view/elements/svc_Common.html @@ -59,16 +59,20 @@ function areyousure(href) { % foreach my $f ( @$fields ) { % -% my($field, $type, $value, $hack_strict_refs); +% my($field, $type, $value); % if ( ref($f) ) { % $field = $f->{'field'}; -% $hack_strict_refs = \&{ $f->{'value'} } if $f->{'value'}; -% $value = $f->{'value'} ? &$hack_strict_refs($svc_x) : $svc_x->$field; % $type = $f->{'type'} || 'text'; +% if ( $f->{'value_callback'} ) { +% my $hack_strict_refs = \&{ $f->{'value_callback'} }; +% $value = &$hack_strict_refs($svc_x); +% } else { +% $value = exists($f->{'value'}) ? $f->{'value'} : $svc_x->$field; +% } % } else { % $field = $f; -% $value = $svc_x->$field; % $type = 'text'; +% $value = $svc_x->$field; % } % % my $columndef = $part_svc->part_svc_column($field); diff --git a/httemplate/view/svc_cert.cgi b/httemplate/view/svc_cert.cgi index 0cd66b422..964b808ab 100644 --- a/httemplate/view/svc_cert.cgi +++ b/httemplate/view/svc_cert.cgi @@ -17,7 +17,7 @@ my %labels = map { $_ => ( ref($fields->{$_}) my @fields = ( { field=>'privatekey', - value=> sub { + value_callback=> sub { my $svc_cert = shift; if ( $svc_cert->privatekey && $svc_cert->check_privatekey ) { '<FONT COLOR="#33ff33">Verification OK</FONT>'; @@ -31,7 +31,7 @@ my @fields = ( qw( common_name organization organization_unit city state country cert_contact ), { 'field'=>'csr', - 'value'=> sub { + 'value_callback'=> sub { my $svc_cert = shift; if ( $svc_cert->csr ) { @@ -67,7 +67,7 @@ my @fields = ( }, }, { 'field'=>'certificate', - 'value'=> sub { + 'value_callback'=> sub { my $svc_cert = shift; if ( $svc_cert->certificate ) { @@ -137,7 +137,7 @@ my @fields = ( }, }, { 'field'=>'cacert', - 'value'=> sub { + 'value_callback'=> sub { my $svc_cert = shift; if ( $svc_cert->cacert ) { diff --git a/httemplate/view/svc_hardware.cgi b/httemplate/view/svc_hardware.cgi index 7f5e889d8..aa3ff0091 100644 --- a/httemplate/view/svc_hardware.cgi +++ b/httemplate/view/svc_hardware.cgi @@ -15,15 +15,15 @@ my %labels = map { $_ => ( ref($fields->{$_}) } keys %$fields; my $model = { field => 'typenum', type => 'text', - value => sub { $_[0]->hardware_type->description } + value_callback => sub { $_[0]->hardware_type->description } }; my $status = { field => 'statusnum', type => 'text', - value => sub { $_[0]->status_label } + value_callback => sub { $_[0]->status_label } }; my $note = { field => 'note', type => 'text', - value => sub { encode_entities($_[0]->note) } + value_callback => sub { encode_entities($_[0]->note) } }; my @fields = ( diff --git a/httemplate/view/svc_phone.cgi b/httemplate/view/svc_phone.cgi index e956e7d49..ed95c4cea 100644 --- a/httemplate/view/svc_phone.cgi +++ b/httemplate/view/svc_phone.cgi @@ -18,7 +18,18 @@ my %labels = map { $_ => ( ref($fields->{$_}) my @fields = qw( countrycode phonenum sim_imsi ); push @fields, 'domain' if $conf->exists('svc_phone-domain'); -push @fields, qw( pbx_title sip_password pin phone_name forwarddst email ); +push @fields, qw( pbx_title ); + +if ( $conf->exists('showpasswords') ) { + push @fields, qw( sip_password ); +} else { + push @fields, { 'field' => 'sip_password', #'_HIDDEN_sip_password', + 'type' => 'fixed', + 'value' => '<I>('. mt('hidden') .')</I>', + }; +} + +push @fields, qw( pin phone_name forwarddst email ); if ( $conf->exists('svc_phone-lnp') ) { push @fields, 'lnp_status', |