Pandora FMS community forums
numaric sort for monitor detail page - Printable Version

+- Pandora FMS community forums (https://pandorafms.org/forum)
+-- Forum: Pandora FMS (https://pandorafms.org/forum/forum-3.html)
+--- Forum: Suggestions and new feature request (https://pandorafms.org/forum/forum-12.html)
+--- Thread: numaric sort for monitor detail page (/thread-7351.html)



numaric sort for monitor detail page - helplakmal - 01-28-2014

hi,

I think ascending and descending sort in data column in "Monitor Details" should be numaric sort.because most of the time we received numeric values as data and numeric sort has greater importance than string sort in this case.so i changed few lines in code to get that and it is working fine i guess.

Code:
551c551,552
<                               $order = array('field' => 'tagente_estado.datos', 'order' => 'ASC');
---
>                               // $order = array('field' => 'tagente_estado.datos', 'order' => 'ASC');
>                               $order = array('field' => 'CAST(tagente_estado.datos AS DECIMAL(12,2))', 'order' => 'ASC');
555c556,557
<                               $order = array('field' => 'tagente_estado.datos', 'order' => 'DESC');
---
>                               // $order = array('field' => 'tagente_estado.datos', 'order' => 'DESC');
>                               $order = array('field' => 'CAST(tagente_estado.datos AS DECIMAL(12,2))', 'order' => 'DESC');

Regards