From aee7d6829c5cf2f38ed19aa627b8dd9aabab31ec Mon Sep 17 00:00:00 2001 From: Irina Peshinskaya Date: Mon, 23 Jul 2018 13:54:38 +0200 Subject: [PATCH] TT#41013 Separate edit and create form for extension subsctibers Change-Id: Ib46a3d2cfaa3c6addcd86a545b4e302a2370f295 --- lib/NGCP/Panel/Controller/Subscriber.pm | 3 +- .../Customer/PbxExtensionSubscriberEdit.pm | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 lib/NGCP/Panel/Form/Customer/PbxExtensionSubscriberEdit.pm diff --git a/lib/NGCP/Panel/Controller/Subscriber.pm b/lib/NGCP/Panel/Controller/Subscriber.pm index dd4d15d331..2648b2431e 100644 --- a/lib/NGCP/Panel/Controller/Subscriber.pm +++ b/lib/NGCP/Panel/Controller/Subscriber.pm @@ -2371,8 +2371,7 @@ sub edit_master :Chained('master') :PathPart('edit') :Args(0) :Does(ACL) :ACLDet $form = NGCP::Panel::Form::get("NGCP::Panel::Form::Customer::PbxExtensionSubscriberEditSubadmin", $c); } else { $is_admin = 1; - $form = NGCP::Panel::Form::get("NGCP::Panel::Form::Customer::PbxExtensionSubscriber", $c); - $form->field('username')->inactive(1); + $form = NGCP::Panel::Form::get("NGCP::Panel::Form::Customer::PbxExtensionSubscriberEdit", $c); } $pbx_ext = 1; } diff --git a/lib/NGCP/Panel/Form/Customer/PbxExtensionSubscriberEdit.pm b/lib/NGCP/Panel/Form/Customer/PbxExtensionSubscriberEdit.pm new file mode 100644 index 0000000000..13b56c58a3 --- /dev/null +++ b/lib/NGCP/Panel/Form/Customer/PbxExtensionSubscriberEdit.pm @@ -0,0 +1,38 @@ +package NGCP::Panel::Form::Customer::PbxExtensionSubscriberEdit; + +use HTML::FormHandler::Moose; + +extends 'NGCP::Panel::Form::Customer::PbxExtensionSubscriber'; + +#This separate package exists to avoid collisions between cached edit form with one that is used for subscriber creation + +has_block 'fields' => ( + tag => 'div', + class => [qw/modal-body/], + render_list => [qw/domain group_select alias_select pbx_extension display_name email webusername webpassword password administrative lock status external_id timezone profile_set profile/ ], +); + +1; + +=head1 NAME + +NGCP::Panel::Form::PbxExtensionSubscriberEdit + +=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: