From 7353f670ef61e617a9dfb6c258907eb70e0345f6 Mon Sep 17 00:00:00 2001 From: levinse Date: Sun, 26 Dec 2010 04:09:26 +0000 Subject: added basic LNP capability to svc_phone including SS, RT10948 --- httemplate/edit/elements/edit.html | 13 +++++++++++++ httemplate/edit/part_svc.cgi | 9 +++++++++ httemplate/edit/process/svc_phone.html | 6 +++++- httemplate/edit/svc_phone.cgi | 35 +++++++++++++++++++++++----------- 4 files changed, 51 insertions(+), 12 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 142d0c3..cab5167 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -356,6 +356,19 @@ Example: % %include_common, % %opt, % ); +% +% if ( $include eq 'tr-input-date-field' ) { +% # it's either hacking it here, or changing a lot more stuff +% @include = ( +% "/elements/$include.html", { +% 'name' => $field, +% 'value' => $opt{curr_value}, +% 'label' => $label, +% 'noinit' => $f->{noinit}, +% } +% ); +% } +% % @include; % }; % diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index d156ccd..437f7e8 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -334,6 +334,15 @@ that field. % 'multiple' => ($flag eq 'S'), % ); % +% } elsif ( $def->{type} eq 'select-lnp_status.html' ) { +% +% $html .= include('/elements/select-lnp_status.html', +% 'curr_value' => $value, +% 'element_name' => "${layer}__${field}", +% 'element_etc' => $disabled, +% 'multiple' => ($flag eq 'S'), +% ); +% % } elsif ( $def->{type} eq 'radius_usergroup_selector' ) { % % #XXX disable the RADIUS usergroup selector? ugh it sure does need diff --git a/httemplate/edit/process/svc_phone.html b/httemplate/edit/process/svc_phone.html index e02ec5c..ddc9382 100644 --- a/httemplate/edit/process/svc_phone.html +++ b/httemplate/edit/process/svc_phone.html @@ -1,6 +1,7 @@ <% include( 'elements/svc_Common.html', 'table' => 'svc_phone', 'args_callback' => $args_callback, + 'value_callback' => $value_callback, ) %> <%init> @@ -24,6 +25,9 @@ my $args_callback = sub { }; - +my $value_callback = sub { + my ($field, $value) = @_; + ($field =~ /_date$/) ? parse_datetime($value) : $value; +}; diff --git a/httemplate/edit/svc_phone.cgi b/httemplate/edit/svc_phone.cgi index b77d962..6482165 100644 --- a/httemplate/edit/svc_phone.cgi +++ b/httemplate/edit/svc_phone.cgi @@ -1,17 +1,6 @@ <% include( 'elements/svc_Common.html', 'table' => 'svc_phone', 'fields' => \@fields, - 'labels' => { - 'svcnum' => 'Service', - 'countrycode' => 'Country code', - 'phonenum' => 'Phone number', - 'domsvc' => 'Domain', - 'sip_password' => 'SIP password', - 'pin' => 'Voicemail PIN', - 'phone_name' => 'Name', - 'pbxsvc' => 'PBX', - 'locationnum' => 'E911 location', - }, 'svc_new_callback' => sub { my( $cgi, $svc_x, $part_svc, $cust_pkg, $fields, $opt ) = @_; $svc_x->locationnum($cust_pkg->locationnum) if $cust_pkg; @@ -73,5 +62,29 @@ push @fields, { field => 'pbxsvc', { field => 'custnum', type=> 'hidden' }, #for new cust_locations ; +if ( $conf->exists('svc_phone-lnp') ) { + push @fields, + { value => 'Number Portability', + type => 'tablebreak-tr-title', + colspan => 7, + }, + { field => 'lnp_status', + type => 'select-lnp_status', + }, + { field => 'portable', + type => 'checkbox', + }, + 'lrn', + { field => 'lnp_desired_due_date', + type => 'input-date-field', + }, + { field => 'lnp_due_date', + type => 'input-date-field', + noinit => 1, + }, + 'lnp_other_provider', + 'lnp_other_provider_account', +; +} -- cgit v1.1