Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Fri Mar 29, 2024 1:10 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Sort Order of Groups
PostPosted: Tue Dec 16, 2014 8:11 pm 
Offline
Newbie

Joined: Mon Dec 15, 2014 5:49 pm
Posts: 10
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Sort Order of Groups
PostPosted: Wed Dec 17, 2014 8:35 am 
Offline
Site Admin
User avatar

Joined: Mon Jun 07, 2004 11:48 am
Posts: 1964
Location: Brisbane, Australia
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.

_________________
Support and Development hours available from [url=https://opmantek.com]Opmantek[/url].
Please consider a purchase to help make Open-AudIT better for everyone.


Top
 Profile  
Reply with quote  
 Post subject: Re: Sort Order of Groups
PostPosted: Wed Dec 17, 2014 4:23 pm 
Offline
Newbie

Joined: Mon Dec 15, 2014 5:49 pm
Posts: 10
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group