MT#16017 cleaned up Fax preferences

- removed send_copy, send_status, password fields
    - removed destination.cc field

Change-Id: I8dd952c6be0e7fac78ac6560d56efd10b75ac180
changes/58/4558/2
Kirill Solomko 10 years ago
parent c7b7d6a3b5
commit 5c54121e0a

@ -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,

@ -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',

@ -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',

@ -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:

@ -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:

@ -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:

@ -282,22 +282,6 @@
</td>
</tr>
<tr class="sw_action_row">
<td>[% c.loc('Password for Sendfax') %]</td>
<td>
[% faxpref.password %]
</td>
<td class="ngcp-actions-column">
<div class="sw_actions">
[% IF c.user.roles == "subscriber" || c.user.roles == "subscriberadmin" || ((c.user.roles == "admin" || c.user.roles == "reseller") && c.user.read_only != 1) -%]
<a class="btn btn-primary btn-small" href="[% c.uri_for_action("/subscriber/edit_fax", [c.req.captures.0], 'password') %]">
<i class="icon-edit"></i> [% c.loc('Edit') %]
</a>
[% END -%]
</div>
</td>
</tr>
<tr class="sw_action_row">
<td>[% c.loc('Active') %]</td>
<td>
@ -314,38 +298,6 @@
</td>
</tr>
<tr class="sw_action_row">
<td>[% c.loc('Send Reports') %]</td>
<td>
[% faxpref.send_status ? c.loc('yes') : ('no') %]
</td>
<td class="ngcp-actions-column">
<div class="sw_actions">
[% IF c.user.roles == "subscriber" || c.user.roles == "subscriberadmin" || ((c.user.roles == "admin" || c.user.roles == "reseller") && c.user.read_only != 1) -%]
<a class="btn btn-primary btn-small" href="[% c.uri_for_action("/subscriber/edit_fax", [c.req.captures.0], 'send_status') %]">
<i class="icon-edit"></i> [% c.loc('Edit') %]
</a>
[% END -%]
</div>
</td>
</tr>
<tr class="sw_action_row">
<td>[% c.loc('Send Copies') %]</td>
<td>
[% faxpref.send_copy ? c.loc('yes') : c.loc('no') %]
</td>
<td class="ngcp-actions-column">
<div class="sw_actions">
[% IF c.user.roles == "subscriber" || c.user.roles == "subscriberadmin" || ((c.user.roles == "admin" || c.user.roles == "reseller") && c.user.read_only != 1) -%]
<a class="btn btn-primary btn-small" href="[% c.uri_for_action("/subscriber/edit_fax", [c.req.captures.0], 'send_copy') %]">
<i class="icon-edit"></i> [% c.loc('Edit') %]
</a>
[% END -%]
</div>
</td>
</tr>
<tr class="sw_action_row">
<td>[% c.loc('Destinations') %]</td>
<td>

@ -775,14 +775,11 @@ sub test_faxserversettings {
active => JSON::PP::true,
destinations => [ {destination => 'test_fax_destination_'.$t.'@example.com', #??
filetype => 'TIFF',
cc => JSON::PP::true,
incoming => JSON::PP::true,
outgoing => JSON::PP::false,
status => JSON::PP::true,} ],
name => 'fax_server_settings_'.$t,
password => 'fax_server_settings_password_'.$t,
send_copy => JSON::PP::false,
send_status => JSON::PP::false,
}));
$res = $ua->request($req);
is($res->code, 200, _get_request_test_message("PUT test faxserversettings"));

Loading…
Cancel
Save