예제 #1
0
 public function defFields()
 {
     $mu_id = R3EcogisHelper::getDefaultMunicipality();
     $fields = array(array('name' => 'st_id', 'type' => 'number', 'is_primary_key' => true), array('name' => 'mu_id', 'type' => 'lookup', 'width' => 200, 'label' => _('Comune'), 'kind' => $this->act != 'add' ? 'readonly' : null, 'required' => true, 'lookup' => array('table' => 'municipality', 'list_field' => 'mu_name_<LANG>'), 'filter' => array('type' => 'select', 'fields' => array('mu_id', 'mu_name_<LANG>'), 'where' => 'do_id=<DOMAIN_ID>', 'cond_where' => array('mu_id' => $mu_id)), 'visible' => $mu_id == '', 'default' => $mu_id), array('name' => 'st_code', 'type' => 'text', 'label' => _('Codice'), 'filter' => array('type' => 'text', 'label' => 'Codice/nome', 'mask' => "(%s ILIKE '%%%2\$s%%') OR (st_name_1 ILIKE '%%%2\$s%%') OR (st_name_2 ILIKE '%%%2\$s%%')"), 'width' => 200, 'attr' => array('sortable' => true, 'order_fields' => 'st_code_pad, st_name_1, st_name_2, st_id')), array('name' => 'st_name_1', 'type' => 'text', 'required' => true, 'label' => _('Nome') . getLangNameShort(1), 'delete_name' => true), array('name' => 'st_name_2', 'type' => 'text', 'required' => R3AuthInstance::get()->getConfigValue('APPLICATION', 'NUM_LANGUAGES', 1) > 1, 'visible' => R3AuthInstance::get()->getConfigValue('APPLICATION', 'NUM_LANGUAGES', 1) > 1, 'label' => _('Nome') . getLangNameShort(2)), array('name' => 'st_lkp_name_1', 'type' => 'text', 'required' => false, 'label' => _('Nome lookup') . getLangNameShort(1)), array('name' => 'st_lkp_name_2', 'type' => 'text', 'required' => false, 'visible' => R3AuthInstance::get()->getConfigValue('APPLICATION', 'NUM_LANGUAGES', 1) > 1, 'label' => _('Nome lookup') . getLangNameShort(2)), array('name' => 'st_visible', 'type' => 'boolean', 'default' => true, 'label' => _('Visibile')));
     return $fields;
 }
예제 #2
0
 public function defFields()
 {
     $mu_id = R3EcogisHelper::getDefaultMunicipality();
     $fields = array(array('name' => 'cm_id', 'type' => 'number', 'is_primary_key' => true), array('name' => 'mu_id', 'type' => 'lookup', 'width' => 200, 'label' => _('Comune'), 'required' => true, 'lookup' => array('table' => 'municipality', 'list_field' => 'mu_name_<LANG>'), 'filter' => array('type' => 'select', 'fields' => array('mu_id', 'mu_name_<LANG>'), 'where' => 'do_id=<DOMAIN_ID>', 'cond_where' => array('mu_id' => $mu_id)), 'visible' => $mu_id == '', 'default' => $mu_id), array('name' => 'cm_code', 'type' => 'text', 'label' => _('Codice'), 'width' => 200), array('name' => 'cm_name_1', 'type' => 'text', 'required' => true, 'label' => _('Nome') . getLangNameShort(1), 'delete_name' => true), array('name' => 'cm_name_2', 'type' => 'text', 'required' => R3AuthInstance::get()->getConfigValue('APPLICATION', 'NUM_LANGUAGES', 1) > 1, 'visible' => R3AuthInstance::get()->getConfigValue('APPLICATION', 'NUM_LANGUAGES', 1) > 1, 'label' => _('Nome') . getLangNameShort(2)), array('name' => 'cm_visible', 'type' => 'boolean', 'default' => true, 'label' => _('Visibile')));
     return $fields;
 }