Subversion Repositories computer_asset_manager_v1

Rev

Rev 55 | Blame | Compare with Previous | Last modification | View Log | RSS feed

/* moving sysinfo summary from a report to a callable */
insert into _system( group_name,key_name,theValue,added_date ) values ( 'device view', 'SysInfo', 'callable.php:sysinfoView', now() );
update report set screen_report = null where name = 'Sysinfo Reports';
/* this is a cleanup, and should be in the main function. It creates a view which shows only devices which are systems */
create or replace view view_device_systems as select * from device where device_type_id in (select device_type_id from device_type where show_as_system = 'Y');
/* add maintenance report */
insert into _system( group_name,key_name,theValue,added_date ) values ( 'device view', 'Maintenance', 'callable.php:maintenanceView', now() );
/* Don't really want this, but some code depends on it. Should really use session var */
insert into _system values ( null,'System','root url', '/computer_asset_manager', now(), null );

delete from report where name = 'New Report';
insert into report ( name, query, parameters ) values ('Backup History','select
   backups_run.start_time Started,
   backups_run.end_time Ended,
   backups_run.version Version,
   format(backups_run.files_count,0) Files,
   format(backups_run.files_size/1024/1024,0) \'Size (M)\',
   format(backups_run.transferred_count,0) Transfer,
   format(backups_run.skipped,0) Skipped,
   format(backups_run.files_deleted,0) Deleted,
   format(backups_run.data_sent/1024/1024,2) \'MB Out\',
   format(backups_run.data_received/1024/1024,2) \'MB In\',
   backups_run.disk_used Disk
from
   backups_run join backups using (backups_id)
where
   backups.device_id = <device_id>
order by
   backups_run.report_date desc
limit <count>','device_id++Device ID++++
count++Number of Reports++++');

insert into _system( group_name,key_name,theValue,added_date ) values ( 'device view', 'Backup', 'callable.php:backupView', now() );

create or replace view view_current_client_site as select concat( client.name, ' - ', ifnull(site.name,'None' )) name, client.client_id,site.site_id from client left outer join site using (client_id) where client.removed_date is null and site.removed_date is null;
create or replace view view_current_client_systems as 
   select 
      device.device_id,
      concat(device.name, ' (', view_current_client_site.name, ')') 'Device' 
   from 
      device join view_current_client_site using (site_id) 
      join device_type using (device_type_id) 
   where 
      device_type.show_as_system = 'Y' 
      and device.removed_date is null;

create or replace view view_current_client as select name, client_id from client where removed_date is null;