Subversion Repositories computer_asset_manager_v1

Rev

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

Rev Author Line No. Line
49 rodolico 1
/* moving sysinfo summary from a report to a callable */
2
insert into _system( group_name,key_name,theValue,added_date ) values ( 'device view', 'SysInfo', 'callable.php:sysinfoView', now() );
3
update report set screen_report = null where name = 'Sysinfo Reports';
4
/* this is a cleanup, and should be in the main function. It creates a view which shows only devices which are systems */
5
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');
6
/* add maintenance report */
7
insert into _system( group_name,key_name,theValue,added_date ) values ( 'device view', 'Maintenance', 'callable.php:maintenanceView', now() );
63 rodolico 8
/* Don't really want this, but some code depends on it. Should really use session var */
9
insert into _system values ( null,'System','root url', '/computer_asset_manager', now(), null );
49 rodolico 10
 
50 rodolico 11
delete from report where name = 'New Report';
12
insert into report ( name, query, parameters ) values ('Backup History','select
13
   backups_run.start_time Started,
14
   backups_run.end_time Ended,
15
   backups_run.version Version,
16
   format(backups_run.files_count,0) Files,
17
   format(backups_run.files_size/1024/1024,0) \'Size (M)\',
18
   format(backups_run.transferred_count,0) Transfer,
19
   format(backups_run.skipped,0) Skipped,
20
   format(backups_run.files_deleted,0) Deleted,
21
   format(backups_run.data_sent/1024/1024,2) \'MB Out\',
22
   format(backups_run.data_received/1024/1024,2) \'MB In\',
23
   backups_run.disk_used Disk
24
from
25
   backups_run join backups using (backups_id)
26
where
27
   backups.device_id = <device_id>
28
order by
29
   backups_run.report_date desc
30
limit <count>','device_id++Device ID++++
31
count++Number of Reports++++');
32
 
33
insert into _system( group_name,key_name,theValue,added_date ) values ( 'device view', 'Backup', 'callable.php:backupView', now() );
54 rodolico 34
 
55 rodolico 35
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;
36
create or replace view view_current_client_systems as 
37
   select 
38
      device.device_id,
39
      concat(device.name, ' (', view_current_client_site.name, ')') 'Device' 
40
   from 
41
      device join view_current_client_site using (site_id) 
42
      join device_type using (device_type_id) 
43
   where 
44
      device_type.show_as_system = 'Y' 
45
      and device.removed_date is null;
46
 
47
create or replace view view_current_client as select name, client_id from client where removed_date is null;
48