From 82d761027f268b998455d9b9f7e2a153c745f50f Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Tue, 10 Oct 2017 12:10:30 +0200 Subject: [PATCH] TT#23398 Sort sound handles and pbx devs Otherwise, sound handles and pbx devices are displayed in UI based on the order of insertion, which is not nice from a usability perspective. Change-Id: I584a40ec7a55e4317126a2eb073951b3c8ae8332 --- lib/NGCP/Panel/Controller/Customer.pm | 1 + lib/NGCP/Panel/Controller/Sound.pm | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/NGCP/Panel/Controller/Customer.pm b/lib/NGCP/Panel/Controller/Customer.pm index dc9aaef83e..c956ea7a78 100644 --- a/lib/NGCP/Panel/Controller/Customer.pm +++ b/lib/NGCP/Panel/Controller/Customer.pm @@ -1557,6 +1557,7 @@ sub pbx_device_create :Chained('base') :PathPart('pbx/device/create') :Args(0) { ->search({ 'device.reseller_id' => $c->stash->{contract}->contact->reseller_id, },{ + order_by => { -asc => 'name' }, join => { 'config' => 'device' }, }); my $form = NGCP::Panel::Form::get("NGCP::Panel::Form::Customer::PbxFieldDevice", $c); diff --git a/lib/NGCP/Panel/Controller/Sound.pm b/lib/NGCP/Panel/Controller/Sound.pm index 088e4cc238..bb77e578ea 100644 --- a/lib/NGCP/Panel/Controller/Sound.pm +++ b/lib/NGCP/Panel/Controller/Sound.pm @@ -461,6 +461,7 @@ sub handles_list :Chained('base') :PathPart('handles') :CaptureArgs(0) { { 'handles.id' => { '=' => \'files.handle_id'}, 'files.set_id' => $c->stash->{set_result}->id}, ], ], + order_by => { -asc => 'handles.name' } }); if($c->stash->{set_result}->contract_id) {