Add type reference table geraetetypen for geraete and anbaugeraete
authorJoey Schulze <joey@infodrom.org>
Tue, 9 Mar 2010 19:42:46 +0000 (20:42 +0100)
committerJoey Schulze <joey@infodrom.org>
Tue, 9 Mar 2010 19:42:46 +0000 (20:42 +0100)
masks/anbaugeraete.php
masks/geraete.php

index d4ea0c7..626795e 100644 (file)
@@ -3,15 +3,22 @@
 $mask = array(
              'table' => 'anbaugeraete',
              'title' => 'Anbaugeräte',
+             'join' => array('geraetetypen ON anbaugeraete.geraetetyp = geraetetypen.id'),
              'list' => array(
                              'id' => array(
                                            'name' => 'ID',
                                            'visible' => false,
+                                           'sql' => 'anbaugeraete.id',
                                            ),
                              'anbaugeraet' => array(
                                            'name' => 'Anbaugerät',
                                            'width' => 150,
                                            ),
+                             'geraetetyp' => array(
+                                           'name' => 'Gerätetyp',
+                                           'width' => 70,
+                                           'sql' => 'geraetetypen.name',
+                                           ),
                              'anbgerstdsatz' => array(
                                            'name' => 'Stundensatz',
                                            'type' => 'number',
@@ -38,6 +45,11 @@ $mask = array(
                                            'size' => 24,
                                            'required' => true,
                                            ),
+                             'geraetetyp' => array(
+                                           'name' => 'Gerätetyp',
+                                           'type' => 'select',
+                                           'options' => 'SELECT id,name AS text FROM geraetetypen ORDER BY name',
+                                           ),
                              'anbgerstdsatz' => array(
                                            'name' => 'Stundensatz',
                                            'type' => 'decimal',
index fc00430..2c961db 100644 (file)
@@ -3,16 +3,23 @@
 $mask = array(
              'table' => 'gerate',
              'title' => 'Geräte',
+             'join' => array('geraetetypen ON gerate.geraetetyp = geraetetypen.id'),
              'sort' => 1,
              'list' => array(
                              'id' => array(
                                            'name' => 'ID',
                                            'visible' => false,
+                                           'sql' => 'gerate.id',
                                            ),
                              'geraet' => array(
                                            'name' => 'Gerät',
                                            'width' => 200,
                                            ),
+                             'geraetetyp' => array(
+                                           'name' => 'Gerätetyp',
+                                           'width' => 70,
+                                           'sql' => 'geraetetypen.name',
+                                           ),
                              'gerstdsatz' => array(
                                            'name' => 'Stundensatz',
                                            'type' => 'number',
@@ -39,6 +46,11 @@ $mask = array(
                                            'size' => 24,
                                            'required' => true,
                                            ),
+                             'geraetetyp' => array(
+                                           'name' => 'Gerätetyp',
+                                           'type' => 'select',
+                                           'options' => 'SELECT id,name AS text FROM geraetetypen ORDER BY name',
+                                           ),
                              'gerstdsatz' => array(
                                            'name' => 'Stundensatz',
                                            'type' => 'decimal',