From 3eb52a3233685d35bf7e905e7485a79db0c98d3d Mon Sep 17 00:00:00 2001 From: Marco Capetta Date: Tue, 10 Dec 2019 16:36:41 +0100 Subject: [PATCH] TT#72408 Don't allow permanent reg with negative q-value Even if kamailo supports negative q-value it will handle them as positive one creating confusion in customers. Change-Id: Ia74f798c48191af1aacca5660448b664883b9860 --- lib/NGCP/Panel/Form/Subscriber/LocationEntry.pm | 14 ++------------ share/templates/helpers/datatables.tt | 5 ++++- share/templates/subscriber/master.tt | 4 +++- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/lib/NGCP/Panel/Form/Subscriber/LocationEntry.pm b/lib/NGCP/Panel/Form/Subscriber/LocationEntry.pm index 95e598a99e..337241ebb7 100644 --- a/lib/NGCP/Panel/Form/Subscriber/LocationEntry.pm +++ b/lib/NGCP/Panel/Form/Subscriber/LocationEntry.pm @@ -32,15 +32,14 @@ has_field 'q' => ( type => 'Float', label => 'Priority (q-value)', required => 1, - range_start => -1, + range_start => 0, range_end => 1, decimal_symbol => '.', default => 1, element_attr => { rel => ['tooltip'], - title => ['The contact priority for serial forking (float value, higher is stronger) between -1.00 to 1.00'] + title => ['The contact priority for serial forking (float value, higher is stronger) between 0 and 1.00'] }, - #validate_method => \&validate_q, ); has_field 'socket' => ( @@ -74,15 +73,6 @@ sub build_socket_options { return \@options; } -sub validate_q { - my ($self,$field) = @_; - if(($field->value < -1) || ($field->value > 1)){ - $field->add_error('Value of "q" must be a float value between -1 and 1'); - return; - } - return 1; -} - =pod sub validate { my $self = shift; diff --git a/share/templates/helpers/datatables.tt b/share/templates/helpers/datatables.tt index 85e5dd53c3..d4265ae7ad 100644 --- a/share/templates/helpers/datatables.tt +++ b/share/templates/helpers/datatables.tt @@ -91,7 +91,10 @@ $(document).ready(function() { FOR f IN helper.column_fields; IF helper.column_sort == f; -%] - [ [% loop.index %], "asc" ], + [ + [% loop.index %], + '[% helper.column_sort_order || "asc" %]' + ], [% END; END; diff --git a/share/templates/subscriber/master.tt b/share/templates/subscriber/master.tt index 015c80e2d4..af5c2355ae 100644 --- a/share/templates/subscriber/master.tt +++ b/share/templates/subscriber/master.tt @@ -285,7 +285,9 @@ function process_pbx_items(moveId,direction){ [% helper.name = c.loc('Registered Devices'); helper.identifier = 'registered_devices'; - #helper.column_sort = 'origtime'; + helper.column_sort = 'q'; + helper.column_sort_order = 'desc'; + helper.dt_columns = reg_dt_columns; helper.close_target = close_target;