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/PbxGroup.pm

34 lines
715 B

package NGCP::Panel::Form::Customer::PbxGroup;
use HTML::FormHandler::Moose;
extends 'NGCP::Panel::Form::Customer::PbxGroupBase';
has_field 'name' => (
type => 'Text',
required => 1,
label => 'Name',
);
has_field 'extension' => (
type => 'Text',
required => 1,
label => 'Extension',
);
has_block 'fields' => (
tag => 'div',
class => [qw/modal-body/],
render_list => [qw/name extension hunt_policy hunt_policy_timeout/],
);
sub validate_name {
my ($self, $field) = @_;
unless($field->value =~ /^[a-zA-Z0-9_\-\s]+$/) {
$field->add_error("Invalid group name, must only contain letters, digits, - and _ and spaces");
}
}
1;
# vim: set tabstop=4 expandtab: