Subversion Repositories computer_asset_manager_v2

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 rodolico 1
<?php
2
 
3
/* Auto generated from SQL script by ./sql2admin_hash.pl version 1.01. */
4
 
5
global $DATABASE_DEFINITION; // make variable available to all scripts
6
 
7
define ( 'MAX_INPUT_FIELD_DISPLAY', 40 ); // this is the maximum input field size
8
define ( 'FILES_DIRECTORY', '/files/' );  // relative URL where pictures are stored
9
define ( 'EDIT_IMAGE_HEIGHT', 100 );      // height for thumbnail of pictures
10
define ( 'MAX_UPLOAD_FILE_SIZE', 1024*1024*10 ); // 10 meg
11
define ( 'DEFAULT_TEXTAREA_HEIGHT', 5 );
12
define ( 'DEFAULT_TABLE', 'owners');
13
 
14
$DATABASE_DEFINITION = array(
15
   'users' => array( 
16
      'table name' => 'users',
17
      'display name' => 'Users',
18
      'comment' => 'logins to system',
19
      'key field' => 'id',
20
      'display columns' => array(
21
         'ID',
22
         'Uername',
23
         'Group',
24
         'e-mail',
25
         'Created',
26
         'Removed'
27
      ),
28
      'display query' => 'select users.id,users.username,groups.name "group",users.email,date(users.created) created,date(users.removed) removed from users left outer join groups on users.group_id = groups.id',
29
      'field info' => array(
30
         'id' => array(
31
            'display name' => 'Id' ,
32
            'keyfield' => true ,
33
            'required' => true ,
34
            'readonly' => true ,
35
            'autoincrement' => true ,
36
            'type' => 'int' ,
37
            'width' => 0
38
         ),
39
         'username' => array(
40
            'display name' => 'Username' ,
41
            'unique'  =>  true ,
42
            'comment' => 'login user name' ,
43
            'required' => true ,
44
            'type' => 'string' ,
45
            'width' => 64
46
         ),
47
         'password' => array(
48
            'display name' => 'Password' ,
49
            'comment' => 'encrypted password' ,
50
            'required' => true ,
51
            'type' => 'password' ,
52
            'width' => 32
53
         ),
54
         'group_id' => array(
55
            'display name' => 'Group Id' ,
56
            'type' => 'lookup' ,
57
            'table' => 'groups' ,
58
            'keyfield' => 'id' ,
59
            'display_field' => 'name'
60
         ),
61
         'where_clause' => array(
62
            'display name' => 'Where Clause' ,
63
            'comment' => 'appended to all queries used to limit the access the user has to records' ,
64
            'type' => 'text' ,
65
            'width' => 0
66
         ),
67
         'email' => array(
68
            'display name' => 'Email' ,
69
            'comment' => 'email address so we can contact them' ,
70
            'type' => 'string' ,
71
            'width' => 64
72
         ),
73
         'notes' => array(
74
            'display name' => 'Notes' ,
75
            'comment' => 'Any notes you want' ,
76
            'type' => 'text' ,
77
            'width' => 0
78
         ),
79
         'created' => array(
80
            'display name' => 'Created' ,
81
            'required' => true ,
82
            'type' => 'datetime' ,
83
            'width' => 0
84
         ),
85
         'removed' => array(
86
            'display name' => 'Removed' ,
87
            'comment' => 'Date removed' ,
88
            'required' => false ,
89
            'type' => 'datetime' ,
90
            'width' => 0
91
         )
92
      )
93
   ),
94
   'groups' => array( 
95
      'table name' => 'groups',
96
      'display name' => 'Groups',
97
      'comment' => 'holds users groups for the ACL code',
98
      'key field' => 'id',
99
      'display columns' => array(
100
         'id',
101
         'name',
102
         'created',
103
         'modified'
104
      ),
105
      'display query' => 'select id,name,created,modified from groups',
106
      'field info' => array(
107
         'id' => array(
108
            'display name' => 'Id' ,
109
            'keyfield' => true ,
110
            'required' => true ,
111
            'readonly' => true ,
112
            'autoincrement' => true ,
113
            'type' => 'int' ,
114
            'width' => 0
115
         ),
116
         'name' => array(
117
            'display name' => 'Name' ,
118
            'unique'  =>  true ,
119
            'comment' => 'name of this group' ,
120
            'required' => true ,
121
            'type' => 'string' ,
122
            'width' => 100
123
         ),
124
         'created' => array(
125
            'display name' => 'Created' ,
126
            'required' => true ,
127
            'type' => 'datetime' ,
128
            'width' => 0
129
         ),
130
         'modified' => array(
131
            'display name' => 'Modified' ,
132
            'required' => false ,
133
            'type' => 'datetime' ,
134
            'width' => 0
135
         )
136
      )
137
   ),
138
   'owners' => array( 
139
      'table name' => 'owners',
140
      'display name' => 'Owners',
141
      'comment' => 'holds owners information',
142
      'key field' => 'id',
143
      'display columns' => array(
144
         'id',
145
         'name',
146
         'notes',
147
         'created',
148
         'removed'
149
      ),
150
      'display query' => 'select id,name,notes,created,removed from owners',
151
      'field info' => array(
152
         'id' => array(
153
            'display name' => 'Id' ,
154
            'keyfield' => true ,
155
            'required' => true ,
156
            'readonly' => true ,
157
            'autoincrement' => true ,
158
            'type' => 'int' ,
159
            'width' => 0
160
         ),
161
         'name' => array(
162
            'display name' => 'Name' ,
163
            'unique'  =>  true ,
164
            'comment' => 'Name of owner' ,
165
            'required' => true ,
166
            'type' => 'string' ,
167
            'width' => 64
168
         ),
169
         'notes' => array(
170
            'display name' => 'Notes' ,
171
            'comment' => 'Any notes you want' ,
172
            'type' => 'text' ,
173
            'width' => 0
174
         ),
175
         'created' => array(
176
            'display name' => 'Created' ,
177
            'required' => true ,
178
            'type' => 'datetime' ,
179
            'width' => 0
180
         ),
181
         'removed' => array(
182
            'display name' => 'Removed' ,
183
            'comment' => 'Date removed' ,
184
            'required' => false ,
185
            'type' => 'datetime' ,
186
            'width' => 0
187
         )
188
      )
189
   ),
190
   'sites' => array( 
191
      'table name' => 'sites',
192
      'display name' => 'Sites',
193
      'comment' => 'holds site information',
194
      'key field' => 'id',
195
      'display columns' => array(
196
         'id',
197
         'name',
198
         'notes',
199
         'created',
200
         'removed'
201
      ),
202
      'display query' => 'select id,name,notes,created,removed from sites',
203
      'field info' => array(
204
         'id' => array(
205
            'display name' => 'Id' ,
206
            'keyfield' => true ,
207
            'required' => true ,
208
            'readonly' => true ,
209
            'autoincrement' => true ,
210
            'type' => 'int' ,
211
            'width' => 0
212
         ),
213
         'name' => array(
214
            'display name' => 'Name' ,
215
            'unique'  =>  true ,
216
            'comment' => 'Name of site' ,
217
            'required' => true ,
218
            'type' => 'string' ,
219
            'width' => 64
220
         ),
221
         'notes' => array(
222
            'display name' => 'Notes' ,
223
            'comment' => 'Any notes you want' ,
224
            'type' => 'text' ,
225
            'width' => 0
226
         ),
227
         'created' => array(
228
            'display name' => 'Created' ,
229
            'required' => true ,
230
            'type' => 'datetime' ,
231
            'width' => 0
232
         ),
233
         'removed' => array(
234
            'display name' => 'Removed' ,
235
            'comment' => 'Date removed' ,
236
            'required' => false ,
237
            'type' => 'datetime' ,
238
            'width' => 0
239
         )
240
      )
241
   ),
242
   'device_types' => array( 
243
      'table name' => 'device_types',
244
      'display name' => 'Device Types',
245
      'comment' => 'holds types of devices, such as computer, router, etc...',
246
      'key field' => 'id',
247
      'display columns' => array(
248
         'id',
249
         'name',
250
         'system',
251
         'notes',
252
         'created',
253
         'removed'
254
      ),
255
      'display query' => 'select id,name,system,notes,created,removed from device_types',
256
      'field info' => array(
257
         'id' => array(
258
            'display name' => 'Id' ,
259
            'keyfield' => true ,
260
            'required' => true ,
261
            'readonly' => true ,
262
            'autoincrement' => true ,
263
            'type' => 'int' ,
264
            'width' => 0
265
         ),
266
         'name' => array(
267
            'display name' => 'Name' ,
268
            'unique'  =>  true ,
269
            'comment' => 'short name for display' ,
270
            'required' => true ,
271
            'type' => 'string' ,
272
            'width' => 64
273
         ),
274
         'system' => array(
275
            'display name' => 'System' ,
276
            'comment' => 'If true (1) this is a system. Set to 0 for printers etc...' ,
277
            'type' => 'tinyint' ,
278
            'width' => 1
279
         ),
280
         'notes' => array(
281
            'display name' => 'Notes' ,
282
            'comment' => 'Any notes you want' ,
283
            'type' => 'text' ,
284
            'width' => 0
285
         ),
286
         'created' => array(
287
            'display name' => 'Created' ,
288
            'required' => true ,
289
            'type' => 'datetime' ,
290
            'width' => 0
291
         ),
292
         'removed' => array(
293
            'display name' => 'Removed' ,
294
            'comment' => 'Date removed' ,
295
            'required' => false ,
296
            'type' => 'datetime' ,
297
            'width' => 0
298
         )
299
      )
300
   ),
301
   'attributes' => array( 
302
      'table name' => 'attributes',
303
      'display name' => 'Attributes',
304
      'comment' => 'lookup table of possible attributes to devices',
305
      'key field' => 'id',
306
      'display columns' => array(
307
         'id',
308
         'name',
309
         'notes',
310
         'created',
311
         'removed'
312
      ),
313
      'display query' => 'select id,name,notes,created,removed from attributes',
314
      'field info' => array(
315
         'id' => array(
316
            'display name' => 'Id' ,
317
            'keyfield' => true ,
318
            'required' => true ,
319
            'readonly' => true ,
320
            'autoincrement' => true ,
321
            'type' => 'int' ,
322
            'width' => 0
323
         ),
324
         'name' => array(
325
            'display name' => 'Name' ,
326
            'unique'  =>  true ,
327
            'comment' => 'short name for display' ,
328
            'required' => true ,
329
            'type' => 'string' ,
330
            'width' => 64
331
         ),
332
         'notes' => array(
333
            'display name' => 'Notes' ,
334
            'comment' => 'Any notes you want' ,
335
            'type' => 'text' ,
336
            'width' => 0
337
         ),
338
         'created' => array(
339
            'display name' => 'Created' ,
340
            'required' => true ,
341
            'type' => 'datetime' ,
342
            'width' => 0
343
         ),
344
         'removed' => array(
345
            'display name' => 'Removed' ,
346
            'comment' => 'Date removed' ,
347
            'required' => false ,
348
            'type' => 'datetime' ,
349
            'width' => 0
350
         )
351
      )
352
   ),
353
   'devices' => array( 
354
      'table name' => 'devices',
355
      'display name' => 'Devices',
356
      'comment' => 'holds computers, cards that make them up, etc...',
357
      'key field' => 'id',
358
      'display columns' => array(
359
         'id',
360
         'serial_number',
361
         'name',
362
         'parent_id',
363
         'device_type_id',
364
         'site_id',
365
         'owner_id',
366
         'notes',
367
         'created',
368
         'removed'
369
      ),
370
      'display query' => 'select id,serial_number,name,parent_id,device_type_id,site_id,owner_id,notes,created,removed from devices',
371
      'field info' => array(
372
         'id' => array(
373
            'display name' => 'Id' ,
374
            'keyfield' => true ,
375
            'required' => true ,
376
            'readonly' => true ,
377
            'autoincrement' => true ,
378
            'type' => 'int' ,
379
            'width' => 0
380
         ),
381
         'serial_number' => array(
382
            'display name' => 'Serial Number' ,
383
            'comment' => 'serial number of device' ,
384
            'required' => false ,
385
            'type' => 'string' ,
386
            'width' => 64
387
         ),
388
         'name' => array(
389
            'display name' => 'Name' ,
390
            'comment' => 'name of device' ,
391
            'required' => true ,
392
            'type' => 'string' ,
393
            'width' => 255
394
         ),
395
         'parent_id' => array(
396
            'display name' => 'Parent Id' ,
397
            'type' => 'lookup' ,
398
            'table' => 'devices' ,
399
            'keyfield' => 'id' ,
400
            'display_field' => 'name'
401
         ),
402
         'device_type_id' => array(
403
            'display name' => 'Device Type Id' ,
404
            'type' => 'lookup' ,
405
            'table' => 'device_types' ,
406
            'keyfield' => 'id' ,
407
            'display_field' => 'name'
408
         ),
409
         'site_id' => array(
410
            'display name' => 'Site Id' ,
411
            'type' => 'lookup' ,
412
            'table' => 'sites' ,
413
            'keyfield' => 'id' ,
414
            'display_field' => 'name'
415
         ),
416
         'owner_id' => array(
417
            'display name' => 'Owner Id' ,
418
            'type' => 'lookup' ,
419
            'table' => 'owners' ,
420
            'keyfield' => 'id' ,
421
            'display_field' => 'name'
422
         ),
423
         'notes' => array(
424
            'display name' => 'Notes' ,
425
            'comment' => 'Any notes you want' ,
426
            'type' => 'text' ,
427
            'width' => 0
428
         ),
429
         'created' => array(
430
            'display name' => 'Created' ,
431
            'required' => true ,
432
            'type' => 'datetime' ,
433
            'width' => 0
434
         ),
435
         'removed' => array(
436
            'display name' => 'Removed' ,
437
            'comment' => 'Date removed' ,
438
            'required' => false ,
439
            'type' => 'datetime' ,
440
            'width' => 0
441
         )
442
      )
443
   ),
444
   'device_aliases' => array( 
445
      'table name' => 'device_aliases',
446
      'display name' => 'Device Aliases',
447
      'comment' => 'aliases for devices',
448
      'key field' => 'id',
449
      'display columns' => array(
450
         'id',
451
         'name',
452
         'device_id',
453
         'notes',
454
         'created',
455
         'removed'
456
      ),
457
      'display query' => 'select id,name,device_id,notes,created,removed from device_aliases',
458
      'field info' => array(
459
         'id' => array(
460
            'display name' => 'Id' ,
461
            'keyfield' => true ,
462
            'required' => true ,
463
            'readonly' => true ,
464
            'autoincrement' => true ,
465
            'type' => 'int' ,
466
            'width' => 0
467
         ),
468
         'name' => array(
469
            'display name' => 'Name' ,
470
            'unique'  =>  true ,
471
            'comment' => 'short name for display' ,
472
            'required' => true ,
473
            'type' => 'string' ,
474
            'width' => 64
475
         ),
476
         'device_id' => array(
477
            'display name' => 'Device Id' ,
478
            'type' => 'lookup' ,
479
            'table' => 'devices' ,
480
            'keyfield' => 'id' ,
481
            'display_field' => 'name'
482
         ),
483
         'notes' => array(
484
            'display name' => 'Notes' ,
485
            'comment' => 'Any notes you want' ,
486
            'type' => 'text' ,
487
            'width' => 0
488
         ),
489
         'created' => array(
490
            'display name' => 'Created' ,
491
            'required' => true ,
492
            'type' => 'datetime' ,
493
            'width' => 0
494
         ),
495
         'removed' => array(
496
            'display name' => 'Removed' ,
497
            'comment' => 'Date removed' ,
498
            'required' => false ,
499
            'type' => 'datetime' ,
500
            'width' => 0
501
         )
502
      )
503
   ),
504
   'attributes_devices' => array( 
505
      'table name' => 'attributes_devices',
506
      'display name' => 'Attributes Devices',
507
      'comment' => 'Each device can have multiple attributes and values',
508
      'key field' => 'id',
509
      'display columns' => array(
510
         'id',
511
         'device_id',
512
         'attributes_id',
513
         'attribute_value',
514
         'created',
515
         'removed'
516
      ),
517
      'display query' => 'select id,device_id,attributes_id,attribute_value,created,removed from attributes_devices',
518
      'field info' => array(
519
         'id' => array(
520
            'display name' => 'Id' ,
521
            'keyfield' => true ,
522
            'required' => true ,
523
            'readonly' => true ,
524
            'autoincrement' => true ,
525
            'type' => 'int' ,
526
            'width' => 0
527
         ),
528
         'device_id' => array(
529
            'display name' => 'Device Id' ,
530
            'type' => 'lookup' ,
531
            'table' => 'devices' ,
532
            'keyfield' => 'id' ,
533
            'display_field' => 'name'
534
         ),
535
         'attributes_id' => array(
536
            'display name' => 'Attributes Id' ,
537
            'type' => 'lookup' ,
538
            'table' => 'attributes' ,
539
            'keyfield' => 'id' ,
540
            'display_field' => 'name'
541
         ),
542
         'attribute_value' => array(
543
            'display name' => 'Attribute Value' ,
544
            'comment' => 'the actual value of the attribute in question' ,
545
            'type' => 'text' ,
546
            'width' => 0
547
         ),
548
         'created' => array(
549
            'display name' => 'Created' ,
550
            'required' => true ,
551
            'type' => 'datetime' ,
552
            'width' => 0
553
         ),
554
         'removed' => array(
555
            'display name' => 'Removed' ,
556
            'comment' => 'Date removed' ,
557
            'required' => false ,
558
            'type' => 'datetime' ,
559
            'width' => 0
560
         )
561
      )
562
   ),
563
   'files' => array( 
564
      'table name' => 'files',
565
      'display name' => 'Files',
566
      'comment' => 'Files which can be associated with an owner site or device',
567
      'key field' => 'id',
568
      'display columns' => array(
569
         'id',
570
         'original_name',
571
         'name_on_disk',
572
         'mime_type_id',
573
         'device_id',
574
         'site_id',
575
         'owner_id',
576
         'created',
577
         'removed'
578
      ),
579
      'display query' => 'select id,original_name,name_on_disk,mime_type_id,device_id,site_id,owner_id,created,removed from files',
580
      'field info' => array(
581
         'id' => array(
582
            'display name' => 'Id' ,
583
            'keyfield' => true ,
584
            'required' => true ,
585
            'readonly' => true ,
586
            'autoincrement' => true ,
587
            'type' => 'int' ,
588
            'width' => 0
589
         ),
590
         'original_name' => array(
591
            'display name' => 'Original Name' ,
592
            'comment' => 'original file name' ,
593
            'required' => true ,
594
            'type' => 'string' ,
595
            'width' => 64
596
         ),
597
         'name_on_disk' => array(
598
            'display name' => 'Name On Disk' ,
599
            'unique'  =>  true ,
600
            'comment' => 'name of file on disk' ,
601
            'required' => true ,
602
            'type' => 'string' ,
603
            'width' => 64
604
         ),
605
         'mime_type_id' => array(
606
            'display name' => 'Mime Type Id' ,
607
            'type' => 'lookup' ,
608
            'table' => 'mime_types' ,
609
            'keyfield' => 'id' ,
610
            'display_field' => 'name'
611
         ),
612
         'device_id' => array(
613
            'display name' => 'Device Id' ,
614
            'type' => 'lookup' ,
615
            'table' => 'devices' ,
616
            'keyfield' => 'id' ,
617
            'display_field' => 'name'
618
         ),
619
         'site_id' => array(
620
            'display name' => 'Site Id' ,
621
            'type' => 'lookup' ,
622
            'table' => 'sites' ,
623
            'keyfield' => 'id' ,
624
            'display_field' => 'name'
625
         ),
626
         'owner_id' => array(
627
            'display name' => 'Owner Id' ,
628
            'type' => 'lookup' ,
629
            'table' => 'owners' ,
630
            'keyfield' => 'id' ,
631
            'display_field' => 'name'
632
         ),
633
         'created' => array(
634
            'display name' => 'Created' ,
635
            'required' => true ,
636
            'type' => 'datetime' ,
637
            'width' => 0
638
         ),
639
         'removed' => array(
640
            'display name' => 'Removed' ,
641
            'comment' => 'Date removed' ,
642
            'required' => false ,
643
            'type' => 'datetime' ,
644
            'width' => 0
645
         )
646
      )
647
   ),
648
   'mime_types' => array( 
649
      'table name' => 'mime_types',
650
      'display name' => 'Mime Types',
651
      'comment' => 'just keeps a list of standard MIME types for use with filess',
652
      'key field' => 'id',
653
      'display columns' => array(
654
         'id',
655
         'name',
656
         'embed',
657
         'extension'
658
      ),
659
      'display query' => 'select id,name,embed,extension from mime_types',
660
      'field info' => array(
661
         'id' => array(
662
            'display name' => 'Id' ,
663
            'keyfield' => true ,
664
            'required' => true ,
665
            'readonly' => true ,
666
            'autoincrement' => true ,
667
            'type' => 'int' ,
668
            'width' => 0
669
         ),
670
         'name' => array(
671
            'display name' => 'Name' ,
672
            'comment' => 'the web definition of the mime type' ,
673
            'required' => true ,
674
            'type' => 'string' ,
675
            'width' => 64
676
         ),
677
         'embed' => array(
678
            'display name' => 'Embed' ,
679
            'comment' => 'If true (1) can be viewed on web page' ,
680
            'default' => 0 ,
681
            'type' => 'tinyint' ,
682
            'width' => 1
683
         ),
684
         'extension' => array(
685
            'display name' => 'Extension' ,
686
            'comment' => 'standard file extension used for this MIME type' ,
687
            'type' => 'string' ,
688
            'width' => 5
689
         )
690
      )
691
   )
692
);
693
 
694
 
695
include( 'database_def_local.php' );
696
 
697
?>