diff --git a/lib/NGCP/Panel/Controller/Subscriber.pm b/lib/NGCP/Panel/Controller/Subscriber.pm index 82788fc1b0..a53e375bac 100644 --- a/lib/NGCP/Panel/Controller/Subscriber.pm +++ b/lib/NGCP/Panel/Controller/Subscriber.pm @@ -43,17 +43,14 @@ use NGCP::Panel::Form::Subscriber::TrustedSource; use NGCP::Panel::Form::Subscriber::Location; use NGCP::Panel::Form::Subscriber::SpeedDial; use NGCP::Panel::Form::Subscriber::AutoAttendant; -use NGCP::Panel::Form::Faxserver::Name; -use NGCP::Panel::Form::Faxserver::Password; use NGCP::Panel::Form::Faxserver::Active; -use NGCP::Panel::Form::Faxserver::SendStatus; -use NGCP::Panel::Form::Faxserver::SendCopy; use NGCP::Panel::Form::Faxserver::Destination; +use NGCP::Panel::Form::Faxserver::Name; use NGCP::Panel::Form::MailToFax::Active; +use NGCP::Panel::Form::MailToFax::ACL; use NGCP::Panel::Form::MailToFax::SecretKey; use NGCP::Panel::Form::MailToFax::SecretKeyRenew; use NGCP::Panel::Form::MailToFax::SecretRenewNotify; -use NGCP::Panel::Form::MailToFax::ACL; use NGCP::Panel::Form::Subscriber::Webfax; use NGCP::Panel::Form::Subscriber::ResetPassword; use NGCP::Panel::Form::Subscriber::RecoverPassword; @@ -2905,18 +2902,6 @@ sub edit_fax :Chained('base') :PathPart('preferences/fax/edit') :Args(1) { } last SWITCH; }; - /^password$/ && do { - $form = NGCP::Panel::Form::Faxserver::Password->new(ctx => $c); - $params = { 'password' => $faxpref->password }; - $form->process(params => $posted ? $c->req->params : $params); - NGCP::Panel::Utils::Navigation::check_form_buttons( - c => $c, form => $form, fields => {}, back_uri => $c->req->uri, - ); - if($posted && $form->validated) { - $faxpref->update({ password => $form->field('password')->value }); - } - last SWITCH; - }; /^active$/ && do { $form = NGCP::Panel::Form::Faxserver::Active->new; $params = { 'active' => $faxpref->active }; @@ -2929,30 +2914,6 @@ sub edit_fax :Chained('base') :PathPart('preferences/fax/edit') :Args(1) { } last SWITCH; }; - /^send_status$/ && do { - $form = NGCP::Panel::Form::Faxserver::SendStatus->new; - $params = { 'send_status' => $faxpref->send_status }; - $form->process(params => $posted ? $c->req->params : $params); - NGCP::Panel::Utils::Navigation::check_form_buttons( - c => $c, form => $form, fields => {}, back_uri => $c->req->uri, - ); - if($posted && $form->validated) { - $faxpref->update({ send_status => $form->field('send_status')->value }); - } - last SWITCH; - }; - /^send_copy$/ && do { - $form = NGCP::Panel::Form::Faxserver::SendCopy->new; - $params = { 'send_copy' => $faxpref->send_copy }; - $form->process(params => $posted ? $c->req->params : $params); - NGCP::Panel::Utils::Navigation::check_form_buttons( - c => $c, form => $form, fields => {}, back_uri => $c->req->uri, - ); - if($posted && $form->validated) { - $faxpref->update({ send_copy => $form->field('send_copy')->value }); - } - last SWITCH; - }; /^destinations$/ && do { $form = NGCP::Panel::Form::Faxserver::Destination->new; unless($posted) { @@ -2961,7 +2922,6 @@ sub edit_fax :Chained('base') :PathPart('preferences/fax/edit') :Args(1) { push @dests, { destination => $dest->destination, filetype => $dest->filetype, - cc => $dest->cc, incoming => $dest->incoming, outgoing => $dest->outgoing, status => $dest->status, @@ -2981,7 +2941,6 @@ sub edit_fax :Chained('base') :PathPart('preferences/fax/edit') :Args(1) { $prov_subscriber->voip_fax_destinations->create({ destination => $dest->field('destination')->value, filetype => $dest->field('filetype')->value, - cc => $dest->field('cc')->value, incoming => $dest->field('incoming')->value, outgoing => $dest->field('outgoing')->value, status => $dest->field('status')->value, diff --git a/lib/NGCP/Panel/Form/Faxserver/API.pm b/lib/NGCP/Panel/Form/Faxserver/API.pm index eb5c03ceab..f7246c5800 100644 --- a/lib/NGCP/Panel/Form/Faxserver/API.pm +++ b/lib/NGCP/Panel/Form/Faxserver/API.pm @@ -33,35 +33,19 @@ has_field 'active' => ( required => 0, ); - -has_field 'send_copy' => ( - type => 'Boolean', - label => 'Send Copies', - required => 0, -); - - - -has_field 'send_status' => ( - type => 'Boolean', - label => 'Send Reports', - required => 0, -); - - has_field 'destinations' => ( type => 'Repeatable', setup_for_js => 1, do_wrapper => 1, do_label => 0, - tags => { + tags => { controls_div => 1, }, ); has_field 'destinations.destination' => ( - type => 'Text', - label => 'Destination', + type => 'Email', + label => 'Destination Email', required => 1, ); @@ -77,12 +61,6 @@ has_field 'destinations.filetype' => ( required => 1, ); -has_field 'destinations.cc' => ( - type => 'Boolean', - label => 'Incoming Email as CC', - default => 0, -); - has_field 'destinations.incoming' => ( type => 'Boolean', label => 'Deliver Incoming Faxes', diff --git a/lib/NGCP/Panel/Form/Faxserver/Destination.pm b/lib/NGCP/Panel/Form/Faxserver/Destination.pm index 4930e094df..b2e0734124 100644 --- a/lib/NGCP/Panel/Form/Faxserver/Destination.pm +++ b/lib/NGCP/Panel/Form/Faxserver/Destination.pm @@ -18,7 +18,7 @@ has_field 'destination' => ( setup_for_js => 1, do_wrapper => 1, do_label => 0, - tags => { + tags => { controls_div => 1, }, wrapper_class => [qw/hfh-rep/], @@ -29,8 +29,8 @@ has_field 'destination.id' => ( ); has_field 'destination.destination' => ( - type => 'Text', - label => 'Destination', + type => 'Email', + label => 'Destination Email', required => 1, wrapper_class => [qw/hfh-rep-field/], ); @@ -48,13 +48,6 @@ has_field 'destination.filetype' => ( wrapper_class => [qw/hfh-rep-field/], ); -has_field 'destination.cc' => ( - type => 'Boolean', - label => 'Incoming Email as CC', - default => 0, - wrapper_class => [qw/hfh-rep-field/], -); - has_field 'destination.incoming' => ( type => 'Boolean', label => 'Deliver Incoming Faxes', diff --git a/lib/NGCP/Panel/Form/Faxserver/Password.pm b/lib/NGCP/Panel/Form/Faxserver/Password.pm deleted file mode 100644 index b5637858c6..0000000000 --- a/lib/NGCP/Panel/Form/Faxserver/Password.pm +++ /dev/null @@ -1,49 +0,0 @@ -package NGCP::Panel::Form::Faxserver::Password; - -use HTML::FormHandler::Moose; -extends 'HTML::FormHandler'; -#use Moose::Util::TypeConstraints; -use NGCP::Panel::Utils::Form; - -use HTML::FormHandler::Widget::Block::Bootstrap; - -has '+widget_wrapper' => ( default => 'Bootstrap' ); -has_field 'submitid' => ( type => 'Hidden' ); -sub build_render_list {[qw/submitid fields actions/]} -sub build_form_element_class { [qw/form-horizontal/] } - -has_field 'password' => ( - type => 'Text', - label => 'Password', - required => 0, -); - -has_field 'save' => ( - type => 'Submit', - value => 'Save', - element_class => [qw/btn btn-primary/], - label => '', -); - -has_block 'fields' => ( - tag => 'div', - class => [qw/modal-body/], - render_list => [qw/password/], -); - -has_block 'actions' => ( - tag => 'div', - class => [qw/modal-footer/], - render_list => [qw/save/], -); - -sub validate_password { - my ($self, $field) = @_; - my $c = $self->form->ctx; - return unless $c; - - NGCP::Panel::Utils::Form::validate_password(c => $c, field => $field); -} - -1; -# vim: set tabstop=4 expandtab: diff --git a/lib/NGCP/Panel/Form/Faxserver/SendCopy.pm b/lib/NGCP/Panel/Form/Faxserver/SendCopy.pm deleted file mode 100644 index 7f00c0ae45..0000000000 --- a/lib/NGCP/Panel/Form/Faxserver/SendCopy.pm +++ /dev/null @@ -1,40 +0,0 @@ -package NGCP::Panel::Form::Faxserver::SendCopy; - -use HTML::FormHandler::Moose; -extends 'HTML::FormHandler'; -#use Moose::Util::TypeConstraints; - -use HTML::FormHandler::Widget::Block::Bootstrap; - -has '+widget_wrapper' => ( default => 'Bootstrap' ); -has_field 'submitid' => ( type => 'Hidden' ); -sub build_render_list {[qw/submitid fields actions/]} -sub build_form_element_class { [qw/form-horizontal/] } - -has_field 'send_copy' => ( - type => 'Boolean', - label => 'Send Copies', - required => 0, -); - -has_field 'save' => ( - type => 'Submit', - value => 'Save', - element_class => [qw/btn btn-primary/], - label => '', -); - -has_block 'fields' => ( - tag => 'div', - class => [qw/modal-body/], - render_list => [qw/send_copy/], -); - -has_block 'actions' => ( - tag => 'div', - class => [qw/modal-footer/], - render_list => [qw/save/], -); - -1; -# vim: set tabstop=4 expandtab: diff --git a/lib/NGCP/Panel/Form/Faxserver/SendStatus.pm b/lib/NGCP/Panel/Form/Faxserver/SendStatus.pm deleted file mode 100644 index c914a30d22..0000000000 --- a/lib/NGCP/Panel/Form/Faxserver/SendStatus.pm +++ /dev/null @@ -1,40 +0,0 @@ -package NGCP::Panel::Form::Faxserver::SendStatus; - -use HTML::FormHandler::Moose; -extends 'HTML::FormHandler'; -#use Moose::Util::TypeConstraints; - -use HTML::FormHandler::Widget::Block::Bootstrap; - -has '+widget_wrapper' => ( default => 'Bootstrap' ); -has_field 'submitid' => ( type => 'Hidden' ); -sub build_render_list {[qw/submitid fields actions/]} -sub build_form_element_class { [qw/form-horizontal/] } - -has_field 'send_status' => ( - type => 'Boolean', - label => 'Send Reports', - required => 0, -); - -has_field 'save' => ( - type => 'Submit', - value => 'Save', - element_class => [qw/btn btn-primary/], - label => '', -); - -has_block 'fields' => ( - tag => 'div', - class => [qw/modal-body/], - render_list => [qw/send_status/], -); - -has_block 'actions' => ( - tag => 'div', - class => [qw/modal-footer/], - render_list => [qw/save/], -); - -1; -# vim: set tabstop=4 expandtab: diff --git a/share/templates/subscriber/preferences.tt b/share/templates/subscriber/preferences.tt index 988cd4ca23..95cd12163f 100644 --- a/share/templates/subscriber/preferences.tt +++ b/share/templates/subscriber/preferences.tt @@ -282,22 +282,6 @@ -