Open-AudIT
https://www.open-audit.org/phpBB3/

Sort Order of Groups
https://www.open-audit.org/phpBB3/viewtopic.php?f=20&t=6389
Page 1 of 1

Author:  Brick [ Tue Dec 16, 2014 8:11 pm ]
Post subject:  Sort Order of Groups

Hi all,

i can't find out, how to change default sort column in a Group.

e.g. Menu -- Start -- Windows Computers ... allways sort by IP Adress.
would change this to Hostname.

Tryed out to change the SQL Statement "ORDER BY"... didn't work.

in a query.xml you have <report_sort_column>0</report_sort_column>, but in a group.xml you haven't.

[code]<?xml version="1.0" encoding="ISO-8859-1"?>
<group>
<details>
<group_name>Windows Computers</group_name>
<group_padded_name></group_padded_name>
<group_dynamic_select><![CDATA[SELECT distinct(system.system_id) FROM system WHERE system.man_os_group = 'Windows' AND system.man_status = 'production']]></group_dynamic_select>
<group_parent>1</group_parent>
<group_description>Any items that have their status attribute set to 'production' and have their os_name attribute containing 'windows'.</group_description>
<group_category>os</group_category>
<group_icon>windows</group_icon>
<group_display_sql><![CDATA[SELECT system.man_icon, system.man_os_family, system.hostname, system.system_id, system.man_ip_address, system.man_manufacturer, system.man_model, system.man_serial, sys_sw_windows.windows_user_name, oa_location.location_name FROM system LEFT JOIN oa_group_sys ON system.system_id = oa_group_sys.system_id LEFT JOIN sys_sw_windows ON (system.system_id = sys_sw_windows.system_id AND system.timestamp = sys_sw_windows.timestamp) LEFT JOIN oa_location ON (system.man_location_id = oa_location.location_id) WHERE oa_group_sys.group_id = ?]]></group_display_sql>
</details>[/code]

any ideas ?

Cheers Brick

Author:  Mark [ Wed Dec 17, 2014 8:35 am ]
Post subject:  Re: Sort Order of Groups

Hi,

If you look in the file code_igniter/application/controllers/main.php in the function list_devices (near the end of the function) you'll see
[code]$this->data['sortcolumn'] = '2';[/code]
Obviously this is less than ideal. I'll log a ticket so we can add a group_sort_column to the XML definitions. In the mean time, if you edit the XML and move the hostname column to column #2, it should work as intended. BTW - counting for this starts at 0 so hostname would effectively be the third column in the definition.

Author:  Brick [ Wed Dec 17, 2014 4:23 pm ]
Post subject:  Re: Sort Order of Groups

Hi,

Ok, works fine, thanks !!

by the way, there are many
[code]$this->data['sortcolumn'] = '2';[/code]

so you must choose this one, if anybody else want to change it
[code]$this->data['count'] = count($this->data['query'])
...
...
$this->data['sortcolumn'] = '2';[/code]

(Line 481)

so, yes.. it would be nice to change these settings in the XML files.. would be much easier to find..

cheers Brick

Page 1 of 1 All times are UTC + 10 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/