You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcp-panel/lib/NGCP/Panel/Form/Customer/PbxExtensionSubscriberEditS...

67 lines
1.6 KiB

package NGCP::Panel::Form::Customer::PbxExtensionSubscriberEditSubadmin;
use HTML::FormHandler::Moose;
use NGCP::Panel::Field::PosInteger;
extends 'NGCP::Panel::Form::Customer::PbxExtensionSubscriberEdit';
has_field 'alias_select' => (
type => '+NGCP::Panel::Field::DataTable',
label => 'Numbers',
do_label => 0,
do_wrapper => 0,
required => 0,
template => 'helpers/datatables_multifield.tt',
ajax_src => '/invalid',
table_titles => ['#', 'Number', 'Subscriber'],
table_fields => ['id', 'number', 'subscriber_username'],
);
has_block 'fields' => (
tag => 'div',
class => [qw/modal-body/],
render_list => [qw/group extension display_name webusername webpassword password external_id alias_select/ ],
);
sub update_fields {
my $self = shift;
my $c = $self->ctx;
my $pkg = __PACKAGE__;
$c->log->debug("my form: $pkg");
$self->field('alias_select')->ajax_src(
"".$c->uri_for_action("/subscriber/aliases_ajax", $c->req->captures)
);
my $group = $self->field('group');
$group->field('id')->ajax_src(
$c->uri_for_action('/customer/pbx_group_ajax', [$c->stash->{customer_id}])->as_string
);
$self->field('password')->required(0); # optional on edit
}
1;
=head1 NAME
NGCP::Panel::Form::Customer::PbxExtensionSubscriberEditSubadmin
=head1 DESCRIPTION
Form to modify a subscriber.
=head1 METHODS
=head1 AUTHOR
Gerhard Jungwirth
=head1 LICENSE
This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
# vim: set tabstop=4 expandtab: