add(" div#form_screw, div#form_decommission { padding-left: 10px; padding-right: 10px; font-size: 90%; color: #555; }"); JavaScript::instance()->file('hardware.js'); JavaScript::instance()->add("Hallinta.pageInit = component_init;"); $mask = array( 'table' => 'hw_component', 'title' => 'Komponenten', 'list' => array( 'id' => array( 'name' => 'ID', 'visible' => false, ), 'hwtype' => array( 'name' => 'Typ', 'sqltype' => 'int', 'width' => 90, 'filter' => 's', 'specs' => array('ClassName' => 'aligncenter'), 'control' => "new Rico.TableColumn.lookup(".grid_lookup_sql('hw_types','id','name').", 0, '')", 'distinct' => "SELECT DISTINCT hwtype,hw_types.name FROM hw_component JOIN hw_types ON hwtype = hw_types.id ORDER BY name", ), 'name' => array( 'name' => 'Name', 'width' => 230, 'filter' => 't', ), 'serno' => array( 'name' => 'Serial', 'width' => 180, 'visible' => false, ), 'price' => array( 'name' => 'Preis', 'width' => 50, 'specs' => array('decPlaces' => 2, 'ClassName' => 'alignrightpad', 'canSort' => false), ), 'owner' => array( 'name' => 'Eigner', 'sqltype' => 'int', 'width' => 55, 'filter' => 's', 'specs' => array('ClassName' => 'aligncenter'), 'control' => "new Rico.TableColumn.lookup(".grid_lookup_sql('hw_organisation','id','name').", 0, '')", 'distinct' => "SELECT DISTINCT owner,hw_organisation.name FROM hw_component JOIN hw_organisation ON owner = hw_organisation.id ORDER BY name", ), 'starttime' => array( 'name' => 'Start', 'width' => 75, 'type' => 'date', 'specs' => array('dateFmt' => 'yyyy-mm-dd'), ), 'endtime' => array( 'name' => 'End', 'width' => 75, 'type' => 'date', 'specs' => array('dateFmt' => 'yyyy-mm-dd'), ), 'status' => array( 'name' => 'Status', 'sqltype' => 'int', 'width' => 50, 'filter' => 's', 'control' => "new Rico.TableColumn.lookup(".grid_lookup_sql('hw_status','id','name').", 0, '')", 'distinct' => "SELECT DISTINCT status,hw_status.name FROM hw_component JOIN hw_status ON owner = hw_status.id ORDER BY name", ), ), 'edit' => array( 'hwtype' => array( 'name' => 'Typ', 'type' => 'select', 'options' => 'SELECT id,name AS text FROM hw_types ORDER BY name', ), 'name' => array( 'name' => 'Name', 'type' => 'text', 'size' => 25, ), 'serno' => array( 'name' => 'Serial Number', 'type' => 'text', 'size' => 20, ), 'price' => array( 'name' => 'Preis', 'type' => 'decimal', 'size' => 10, ), 'owner' => array( 'name' => 'Besitzer', 'type' => 'select', 'options' => 'SELECT id,name AS text FROM hw_organisation ORDER BY name', ), 'starttime' => array( 'name' => 'Von', 'type' => 'date', 'size' => 8, 'null' => true, ), 'endtime' => array( 'name' => 'Bis', 'type' => 'date', 'size' => 8, 'null' => true, ), 'status' => Array( 'name' => 'Status', 'type' => 'select', 'options' => 'SELECT id,name AS text FROM hw_status ORDER BY id', ), 'comment' => array( 'name' => 'Bemerkung', 'type' => 'textarea', ), 'screw' => array( 'type' => 'html', 'code' => Template::render('screw/buttons', []), 'sql' => false, ), ), 'second' => array( 'screw' => array( 'title' => 'Verwendung', 'table' => 'hw_screw', 'table_edit' => 'hw_screw', 'rows' => 10, 'join' => array( 'hw_compound ON compound = hw_compound.id', ), 'where' => 'component = {id} ORDER BY starttime', 'list' => array( 'id' => array( 'name' => 'ID', 'visible' => false, 'edit' => array('Writeable' => false, 'EntryType' => 'H', 'Length' => 4, 'isKey' => true), 'sql' => 'hw_screw.id', ), 'compound' => array( 'name' => 'Verbund', 'width' => 180, 'sql' => 'hw_compound.name', ), 'starttime' => array( 'name' => 'Von', 'type' => 'date', 'specs' => array('dateFmt' => 'yyyy-mm-dd'), 'width' => 80, 'edit' => array('EntryType' => 'D', 'isNullable' => true, 'Writeable' => true), 'sql' => 'hw_screw.starttime' ), 'endtime' => array( 'name' => 'Bis', 'type' => 'date', 'specs' => array('dateFmt' => 'yyyy-mm-dd'), 'width' => 80, 'edit' => array('EntryType' => 'D', 'isNullable' => true, 'Writeable' => true), 'sql' => 'hw_screw.endtime' ), 'usage' => array( 'name' => 'Verwendung', 'width' => 270, 'edit' => array('EntryType' => 'T', 'isNullable' => false, 'Writeable' => true), ), ), ), ), );