protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for INTERES_ID field
     //
     $editor = new ComboBox('interes_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."INTERES"');
     $field = new IntegerField('INTERES_ID');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('NOMBRE');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('NOMBRE', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('INTERES ID', 'INTERES_ID', $editor, $this->dataset, 'INTERES_ID', 'NOMBRE', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for CATEGORIA_INTERES_ID field
     //
     $editor = new ComboBox('categoria_interes_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."CATEGORIA_INTERES"');
     $field = new IntegerField('CATEGORIA_INTERES_ID');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('NOMBRE');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('NOMBRE', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('CATEGORIA INTERES ID', 'CATEGORIA_INTERES_ID', $editor, $this->dataset, 'CATEGORIA_INTERES_ID', 'NOMBRE', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
Exemple #2
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for Tipo_Documento field
     //
     $editor = new ComboBox('tipo_documento_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`cod_documentos`');
     $field = new IntegerField('Codigo');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('Descripcion');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('Descripcion', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Tipo Documento', 'Tipo_Documento', $editor, $this->dataset, 'Codigo', 'Descripcion', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Num_Identificacion field
     //
     $editor = new TextEdit('num_identificacion_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Num Identificacion', 'Num_Identificacion', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for DV field
     //
     $editor = new TextEdit('dv_edit');
     $editColumn = new CustomEditColumn('DV', 'DV', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Primer_Apellido field
     //
     $editor = new TextEdit('primer_apellido_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Primer Apellido', 'Primer_Apellido', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Segundo_Apellido field
     //
     $editor = new TextEdit('segundo_apellido_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Segundo Apellido', 'Segundo_Apellido', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Primer_Nombre field
     //
     $editor = new TextEdit('primer_nombre_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Primer Nombre', 'Primer_Nombre', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Otros_Nombres field
     //
     $editor = new TextEdit('otros_nombres_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Otros Nombres', 'Otros_Nombres', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for RazonSocial field
     //
     $editor = new TextEdit('razonsocial_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('RazonSocial', 'RazonSocial', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Direccion field
     //
     $editor = new TextEdit('direccion_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Direccion', 'Direccion', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Cod_Dpto field
     //
     $editor = new AutocomleteComboBox('cod_dpto_edit', $this->CreateLinkBuilder());
     $editor->SetSize('250px');
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`cod_departamentos`');
     $field = new IntegerField('Cod_dpto');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('Nombre');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('Nombre', GetOrderTypeAsSQL(otAscending));
     $editColumn = new DynamicLookupEditColumn('Cod Dpto', 'Cod_Dpto', 'Cod_Dpto_Nombre', 'insert_Cod_Dpto_Nombre_search', $editor, $this->dataset, $lookupDataset, 'Cod_dpto', 'Nombre', '');
     $editColumn->SetInsertDefaultValue($this->RenderText('76'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Cod_Mcipio field
     //
     $editor = new TextEdit('cod_mcipio_edit');
     $editor->SetSize(10);
     $editor->SetMaxLength(10);
     $editColumn = new CustomEditColumn('Cod Mcipio', 'Cod_Mcipio', $editor, $this->dataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('111'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Pais_Domicilio field
     //
     $editor = new AutocomleteComboBox('pais_domicilio_edit', $this->CreateLinkBuilder());
     $editor->SetSize('250px');
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`cod_paises`');
     $field = new IntegerField('Codigo');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('Pais');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('Pais', GetOrderTypeAsSQL(otAscending));
     $editColumn = new DynamicLookupEditColumn('Pais Domicilio', 'Pais_Domicilio', 'Pais_Domicilio_Pais', 'insert_Pais_Domicilio_Pais_search', $editor, $this->dataset, $lookupDataset, 'Codigo', 'Pais', '');
     $editColumn->SetInsertDefaultValue($this->RenderText('169'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Telefono field
     //
     $editor = new TextEdit('telefono_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Telefono', 'Telefono', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Ciudad field
     //
     $editor = new TextEdit('ciudad_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Ciudad', 'Ciudad', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Contacto field
     //
     $editor = new TextEdit('contacto_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Contacto', 'Contacto', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for TelContacto field
     //
     $editor = new TextEdit('telcontacto_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('TelContacto', 'TelContacto', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Email field
     //
     $editor = new TextEdit('email_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Email', 'Email', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for empresa_id field
     //
     $editor = new ComboBox('empresa_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`empresa`');
     $field = new IntegerField('id', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('habilitacion');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('nit');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('nombre');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('tipo');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('direccion');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('telefono');
     $lookupDataset->AddField($field, false);
     $field = new StringField('depto');
     $lookupDataset->AddField($field, false);
     $field = new StringField('mupio');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('nombre', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Empresa Id', 'empresa_id', $editor, $this->dataset, 'id', 'nombre', $lookupDataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('1'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for codigo field
     //
     $editor = new TextEdit('codigo_edit');
     $editor->SetSize(20);
     $editor->SetMaxLength(20);
     $editColumn = new CustomEditColumn('Codigo', 'codigo', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for estado field
     //
     $editor = new ComboBox('estado_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $editor->AddValue('I', $this->RenderText('Inactivo'));
     $editor->AddValue('A', $this->RenderText('Activo'));
     $editColumn = new CustomEditColumn('Estado', 'estado', $editor, $this->dataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('A'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for regimen field
     //
     $editor = new ComboBox('regimen_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $editor->AddValue('1', $this->RenderText('Contributivo'));
     $editor->AddValue('2', $this->RenderText('Subsidiado'));
     $editor->AddValue('3', $this->RenderText('Vinculado'));
     $editor->AddValue('4', $this->RenderText('Particular'));
     $editor->AddValue('5', $this->RenderText('Otro'));
     $editColumn = new CustomEditColumn('Regimen', 'regimen', $editor, $this->dataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('1'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for program_name field
     //
     $editor = new TextEdit('program_name_edit');
     $editor->SetSize(50);
     $editor->SetMaxLength(50);
     $editColumn = new CustomEditColumn(' Name', 'program_name', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for description field
     //
     $editor = new TextAreaEdit('description_edit', 50, 8);
     $editColumn = new CustomEditColumn('Description', 'description', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for lead field
     //
     $editor = new ComboBox('lead_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`staff`');
     $field = new IntegerField('staff_id', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('username');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('email');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('picture');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('password');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('dept_id');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('position');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('emp_number');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('username', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Lead', 'lead', $editor, $this->dataset, 'username', 'username', $lookupDataset);
     $editColumn->SetCaptionTemplate($this->RenderText('%username%'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for date_start field
     //
     $editor = new DateTimeEdit('date_start_edit', false, 'Y-m-d', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Date Start', 'date_start', $editor, $this->dataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for date_end field
     //
     $editor = new DateTimeEdit('date_end_edit', false, 'Y-m-d', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Date End', 'date_end', $editor, $this->dataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
Exemple #4
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for id_insumo field
     //
     $editor = new ComboBox('id_insumo_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(
         new PgConnectionFactory(),
         GetConnectionOptions(),
         '"public"."ods_insumo"');
     $field = new IntegerField('id_insumo', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('no_insumo');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_tipo_insumo');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('no_insumo', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn(
         'Id Insumo', 
         'id_insumo', 
         $editor, 
         $this->dataset, 'id_insumo', 'no_insumo', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant())
     {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     }
     else
     {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
Exemple #5
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for ivo-codart field
     //
     $editor = new AutocomleteComboBox('ivo-codart_edit', $this->CreateLinkBuilder());
     $editor->SetSize('250px');
     $editor->setAllowClear(true);
     $editor->setMinimumInputLength(0);
     $lookupDataset = new TableDataset(new MyPDOConnectionFactory(), GetConnectionOptions(), '`elenco_articoli_view`');
     $field = new StringField('art-codart');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('descrizione');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('descrizione', GetOrderTypeAsSQL(otAscending));
     $editColumn = new DynamicLookupEditColumn('Codice Articolo', 'ivo-codart', 'ivo-codart_descrizione', 'insert_ivo-codart_descrizione_search', $editor, $this->dataset, $lookupDataset, 'art-codart', 'descrizione', '');
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ivo-codvoc field
     //
     $editor = new ComboBox('ivo-codvoc_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyPDOConnectionFactory(), GetConnectionOptions(), '`voci_costo`');
     $field = new IntegerField('id', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new IntegerField('voc-codvoce');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('voc-descriz');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('voc-semanual');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('voc-formula');
     $lookupDataset->AddField($field, false);
     $field = new StringField('voc-flagart');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('voc-przunit');
     $lookupDataset->AddField($field, false);
     $field = new DateTimeField('datains');
     $lookupDataset->AddField($field, false);
     $field = new DateTimeField('datamod');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('voc-descriz', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Codice Tipo Voce', 'ivo-codvoc', $editor, $this->dataset, 'voc-codvoce', 'voc-descriz', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ivo-przunit field
     //
     $editor = new TextEdit('ivo-przunit_edit');
     $editColumn = new CustomEditColumn('Prezzo unitario', 'ivo-przunit', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ivo-flagart field
     //
     $editor = new CheckBox('ivo-flagart_edit');
     $editColumn = new CustomEditColumn('Altro articolo', 'ivo-flagart', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ivo-flagsmu field
     //
     $editor = new CheckBox('ivo-flagsmu_edit');
     $editColumn = new CustomEditColumn('Prevede smusso', 'ivo-flagsmu', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ivo-dataini field
     //
     $editor = new DateTimeEdit('ivo-dataini_edit', false, 'd-m-Y', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Data decorrenza listino', 'ivo-dataini', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ivo-datafin field
     //
     $editor = new DateTimeEdit('ivo-datafin_edit', false, 'd-m-Y', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Data fine decorrenza listino', 'ivo-datafin', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for programm_id field
     //
     $editor = new ComboBox('programm_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`program`');
     $field = new IntegerField('program_id', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('program_name');
     $lookupDataset->AddField($field, false);
     $field = new StringField('year');
     $lookupDataset->AddField($field, false);
     $field = new StringField('multi');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('description');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('lead');
     $lookupDataset->AddField($field, false);
     $field = new DateField('date_start');
     $lookupDataset->AddField($field, false);
     $field = new DateField('date_end');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('progress');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('notes');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('program_name', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Project Type', 'programm_id', $editor, $this->dataset, 'program_id', 'program_name', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for project_name field
     //
     $editor = new TextEdit('project_name_edit');
     $editColumn = new CustomEditColumn('Project Name', 'project_name', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $validator = new CustomRegExpValidator('^[A-Za-z0-9 ]+[-]*[A-Za-z0-9 ]*$', StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RegExpValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for date_start field
     //
     $editor = new DateTimeEdit('date_start_edit', false, 'Y-m-d', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Date Start', 'date_start', $editor, $this->dataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for date_end field
     //
     $editor = new DateTimeEdit('date_end_edit', true, 'Y-m-d', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Date End', 'date_end', $editor, $this->dataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for year field
     //
     $editor = new TextEdit('year_edit');
     $editColumn = new CustomEditColumn('Year', 'year', $editor, $this->dataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('2015'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $validator = new NumberValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('NumberValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for notes field
     //
     $editor = new TextAreaEdit('notes_edit', 50, 8);
     $editColumn = new CustomEditColumn('Objectives', 'notes', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for priority field
     //
     $editor = new ComboBox('priority_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`Priority`');
     $field = new IntegerField('id', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('Name');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('Name', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Priority', 'priority', $editor, $this->dataset, 'Name', 'Name', $lookupDataset);
     $editColumn->SetCaptionTemplate($this->RenderText('%Name%'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for lead field
     //
     $editor = new ComboBox('lead_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`staff`');
     $field = new IntegerField('staff_id', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('username');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('email');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('picture');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('password');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('dept_id');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('position');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('emp_number');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('username', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Project Lead', 'lead', $editor, $this->dataset, 'staff_id', 'username', $lookupDataset);
     $editColumn->SetCaptionTemplate($this->RenderText('%username%'));
     $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_USER_ID%'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for approved_budget field
     //
     $editor = new TextEdit('approved_budget_edit');
     $editor->SetPlaceholder($this->RenderText('currency value without comma'));
     $editor->SetPrefix($this->RenderText('$'));
     $editor->SetSuffix($this->RenderText('.00'));
     $editColumn = new CustomEditColumn('Approved Budget', 'approved_budget', $editor, $this->dataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('0'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $validator = new CustomRegExpValidator('^[0-9]*$', StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RegExpValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for budget_spent field
     //
     $editor = new TextEdit('budget_spent_edit');
     $editor->SetPlaceholder($this->RenderText('currency value without comma'));
     $editor->SetPrefix($this->RenderText('$'));
     $editor->SetSuffix($this->RenderText('.00'));
     $editColumn = new CustomEditColumn('Budget Spent', 'budget_spent', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $editColumn->SetInsertDefaultValue($this->RenderText('0'));
     $validator = new CustomRegExpValidator('^[0-9]*$', StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RegExpValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for multi_year field
     //
     $editor = new CheckBox('multi_year_edit');
     $editColumn = new CustomEditColumn('Multi Year', 'multi_year', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for public_engagement field
     //
     $editor = new ComboBox('public_engagement_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $editor->AddValue('0 - No Public Engagement (CAO Authorization Only)', $this->RenderText('0 - No Public Engagement  (CAO Authorization Only)'));
     $editor->AddValue('1 - Inform', $this->RenderText('1 - Inform'));
     $editor->AddValue('2 - Consult', $this->RenderText('2 - Consult'));
     $editor->AddValue('3 - Involve ', $this->RenderText('3 - Involve'));
     $editor->AddValue('4 - Collaborate', $this->RenderText('4 - Collaborate'));
     $editor->AddValue('5- Empower', $this->RenderText('5 - Empower'));
     $editColumn = new CustomEditColumn('Public Engagement', 'public_engagement', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for level_of_service field
     //
     $editor = new ComboBox('level_of_service_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $editor->AddValue('Maintain existing Level Of Service', $this->RenderText('Maintain existing Level Of Service'));
     $editor->AddValue('Upgrade Level Of Service', $this->RenderText('Upgrade Level Of Service'));
     $editor->AddValue('Downgrade Level Of Service', $this->RenderText('Downgrade Level Of Service'));
     $editor->AddValue('New Level Of Service/Asset(s)', $this->RenderText('New Level Of Service/Asset(s)'));
     $editor->AddValue('Eliminate Level Of Service/Asset(s)', $this->RenderText('Eliminate Level Of Service/Asset(s)'));
     $editor->AddValue('One-Time only Project', $this->RenderText('One-Time only Project'));
     $editColumn = new CustomEditColumn('Level Of Service', 'level_of_service', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for approved field
     //
     $editor = new CheckBox('approved_edit');
     $editColumn = new CustomEditColumn('Approved by CAO', 'approved', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for progress field
     //
     $editor = new ComboBox('progress_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $editor->AddValue('0', $this->RenderText('Zero Percent'));
     $editor->AddValue('0.10', $this->RenderText('10 Percent'));
     $editor->AddValue('0.20', $this->RenderText('20 Percent'));
     $editor->AddValue('0.30', $this->RenderText('30 Percent'));
     $editor->AddValue('0.40', $this->RenderText('40 Percent'));
     $editor->AddValue('0.5', $this->RenderText('50 Percent'));
     $editor->AddValue('0.6', $this->RenderText('60 Percent'));
     $editor->AddValue('0.7', $this->RenderText('70 Percent'));
     $editor->AddValue('0.8', $this->RenderText('80 Percent'));
     $editor->AddValue('0.9', $this->RenderText('90 Percent'));
     $editor->AddValue('1', $this->RenderText('100 Percent'));
     $editColumn = new CustomEditColumn('Progress', 'progress', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $editColumn->SetInsertDefaultValue($this->RenderText('0'));
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for dept_id field
     //
     $editor = new ComboBox('dept_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`department`');
     $field = new IntegerField('DEPT_ID', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('DEPARTMENT');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('MANAGER');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('DIRECTOR');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('LOCATION');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('PHONE_NO');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('DEPARTMENT', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Department', 'dept_id', $editor, $this->dataset, 'DEPT_ID', 'DEPARTMENT', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
Exemple #7
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for id_accion field
     //
     $editor = new ComboBox('id_accion_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $editor->setInlineStyles('width: 440px;');
     $lookupDataset = new TableDataset(
         new PgConnectionFactory(),
         GetConnectionOptions(),
         '"public"."sga_accion"');
     $field = new IntegerField('id_accion', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new IntegerField('id_tipo_espacio');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_tipo_bien');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_origen');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_metodologia');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_periodicidad');
     $lookupDataset->AddField($field, false);
     $field = new BooleanField('fl_a_demanda');
     $lookupDataset->AddField($field, false);
     $field = new StringField('ds_referencia');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_tipo_accion');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_sector');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('nu_personas');
     $lookupDataset->AddField($field, false);
     $field = new TimeField('tm_carga_horaria');
     $lookupDataset->AddField($field, false);
     $field = new StringField('fe_horas');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('ds_referencia', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn(
         'Acción', 
         'id_accion', 
         $editor, 
         $this->dataset, 'id_accion', 'ds_referencia', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for id_espacio field
     //
     $editor = new ComboBox('id_espacio_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $editor->setInlineStyles('width: 440px;');
     $lookupDataset = new TableDataset(
         new PgConnectionFactory(),
         GetConnectionOptions(),
         '"public"."sga_espacio"');
     $field = new IntegerField('id_espacio', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new IntegerField('id_tipo_espacio');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_espacio_contenedor');
     $lookupDataset->AddField($field, false);
     $field = new StringField('co_espacio');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('no_espacio');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('co_plano');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_planta');
     $lookupDataset->AddField($field, false);
     $field = new StringField('ds_referencia');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_sector');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('ds_referencia', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn(
         'Espacio', 
         'id_espacio', 
         $editor, 
         $this->dataset, 'id_espacio', 'ds_referencia', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for id_periodicidad field
     //
     $editor = new ComboBox('id_periodicidad_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(
         new PgConnectionFactory(),
         GetConnectionOptions(),
         '"public"."sga_periodicidad"');
     $field = new IntegerField('id_periodicidad', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('no_periodicidad');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('va_frecuencia');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('no_periodicidad', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn(
         'Periodicidad', 
         'id_periodicidad', 
         $editor, 
         $this->dataset, 'id_periodicidad', 'no_periodicidad', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for ds_detalle field
     //
     $editor = new TextAreaEdit('ds_detalle_edit', 50, 8);
     $editColumn = new CustomEditColumn('Detalle', 'ds_detalle', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for fe_inicio field
     //
     $editor = new DateTimeEdit('fe_inicio_edit', true, 'd/m/Y H:i:s', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Fecha Início', 'fe_inicio', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for nu_personas field
     //
     $editor = new TextEdit('nu_personas_edit');
     $editColumn = new CustomEditColumn('Personas', 'nu_personas', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for tm_carga_horaria field
     //
     $editor = new TimeEdit('tm_carga_horaria_edit');
     $editColumn = new CustomEditColumn('Carga Horária', 'tm_carga_horaria', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for fe_horas field
     //
     $editor = new MultiValueSelect('fe_horas_edit');
     $editor->AddValue('00:00', $this->RenderText('00:00'));
     $editor->AddValue('00:15', $this->RenderText('00:15'));
     $editor->AddValue('00:30', $this->RenderText('00:30'));
     $editor->AddValue('00:45', $this->RenderText('00:45'));
     $editor->AddValue('01:00', $this->RenderText('01:00'));
     $editor->AddValue('01:15', $this->RenderText('01:15'));
     $editor->AddValue('01:30', $this->RenderText('01:30'));
     $editor->AddValue('01:45', $this->RenderText('01:45'));
     $editor->AddValue('02:00', $this->RenderText('02:00'));
     $editor->AddValue('02:15', $this->RenderText('02:15'));
     $editor->AddValue('02:30', $this->RenderText('02:30'));
     $editor->AddValue('02:45', $this->RenderText('02:45'));
     $editor->AddValue('03:00', $this->RenderText('03:00'));
     $editor->AddValue('03:15', $this->RenderText('03:15'));
     $editor->AddValue('03:30', $this->RenderText('03:30'));
     $editor->AddValue('03:45', $this->RenderText('03:45'));
     $editor->AddValue('04:00', $this->RenderText('04:00'));
     $editor->AddValue('04:15', $this->RenderText('04:15'));
     $editor->AddValue('04:30', $this->RenderText('04:30'));
     $editor->AddValue('04:45', $this->RenderText('04:45'));
     $editor->AddValue('05:00', $this->RenderText('05:00'));
     $editor->AddValue('05:15', $this->RenderText('05:15'));
     $editor->AddValue('05:30', $this->RenderText('05:30'));
     $editor->AddValue('05:45', $this->RenderText('05:45'));
     $editor->AddValue('06:00', $this->RenderText('06:00'));
     $editor->AddValue('06:15', $this->RenderText('06:15'));
     $editor->AddValue('06:30', $this->RenderText('06:30'));
     $editor->AddValue('06:45', $this->RenderText('06:45'));
     $editor->AddValue('07:00', $this->RenderText('07:00'));
     $editor->AddValue('07:15', $this->RenderText('07:15'));
     $editor->AddValue('07:30', $this->RenderText('07:30'));
     $editor->AddValue('07:45', $this->RenderText('07:45'));
     $editor->AddValue('08:00', $this->RenderText('08:00'));
     $editor->AddValue('08:15', $this->RenderText('08:15'));
     $editor->AddValue('08:30', $this->RenderText('08:30'));
     $editor->AddValue('08:45', $this->RenderText('08:45'));
     $editor->AddValue('09:00', $this->RenderText('09:00'));
     $editor->AddValue('09:15', $this->RenderText('09:15'));
     $editor->AddValue('09:30', $this->RenderText('09:30'));
     $editor->AddValue('09:45', $this->RenderText('09:45'));
     $editor->AddValue('10:00', $this->RenderText('10:00'));
     $editor->AddValue('10:15', $this->RenderText('10:15'));
     $editor->AddValue('10:30', $this->RenderText('10:30'));
     $editor->AddValue('10:45', $this->RenderText('10:45'));
     $editor->AddValue('11:00', $this->RenderText('11:00'));
     $editor->AddValue('11:15', $this->RenderText('11:15'));
     $editor->AddValue('11:30', $this->RenderText('11:30'));
     $editor->AddValue('11:45', $this->RenderText('11:45'));
     $editor->AddValue('12:00', $this->RenderText('12:00'));
     $editor->AddValue('12:15', $this->RenderText('12:15'));
     $editor->AddValue('12:30', $this->RenderText('12:30'));
     $editor->AddValue('12:45', $this->RenderText('12:45'));
     $editor->AddValue('13:00', $this->RenderText('13:00'));
     $editor->AddValue('13:15', $this->RenderText('13:15'));
     $editor->AddValue('13:30', $this->RenderText('13:30'));
     $editor->AddValue('13:45', $this->RenderText('13:45'));
     $editor->AddValue('14:00', $this->RenderText('14:00'));
     $editor->AddValue('14:15', $this->RenderText('14:15'));
     $editor->AddValue('14:30', $this->RenderText('14:30'));
     $editor->AddValue('14:45', $this->RenderText('14:45'));
     $editor->AddValue('15:00', $this->RenderText('15:00'));
     $editor->AddValue('15:15', $this->RenderText('15:15'));
     $editor->AddValue('15:30', $this->RenderText('15:30'));
     $editor->AddValue('15:45', $this->RenderText('15:45'));
     $editor->AddValue('16:00', $this->RenderText('16:00'));
     $editor->AddValue('16:15', $this->RenderText('16:15'));
     $editor->AddValue('16:30', $this->RenderText('16:30'));
     $editor->AddValue('16:45', $this->RenderText('16:45'));
     $editor->AddValue('17:00', $this->RenderText('17:00'));
     $editor->AddValue('17:15', $this->RenderText('17:15'));
     $editor->AddValue('17:30', $this->RenderText('17:30'));
     $editor->AddValue('17:45', $this->RenderText('17:45'));
     $editor->AddValue('18:00', $this->RenderText('18:00'));
     $editor->AddValue('18:15', $this->RenderText('18:15'));
     $editor->AddValue('18:30', $this->RenderText('18:30'));
     $editor->AddValue('18:45', $this->RenderText('18:45'));
     $editor->AddValue('19:00', $this->RenderText('19:00'));
     $editor->AddValue('19:15', $this->RenderText('19:15'));
     $editor->AddValue('19:30', $this->RenderText('19:30'));
     $editor->AddValue('19:45', $this->RenderText('19:45'));
     $editor->AddValue('20:00', $this->RenderText('20:00'));
     $editor->AddValue('20:15', $this->RenderText('20:15'));
     $editor->AddValue('20:30', $this->RenderText('20:30'));
     $editor->AddValue('20:45', $this->RenderText('20:45'));
     $editor->AddValue('21:00', $this->RenderText('21:00'));
     $editor->AddValue('21:15', $this->RenderText('21:15'));
     $editor->AddValue('21:30', $this->RenderText('21:30'));
     $editor->AddValue('21:45', $this->RenderText('21:45'));
     $editor->AddValue('22:00', $this->RenderText('22:00'));
     $editor->AddValue('22:15', $this->RenderText('22:15'));
     $editor->AddValue('22:30', $this->RenderText('22:30'));
     $editor->AddValue('22:45', $this->RenderText('22:45'));
     $editor->AddValue('23:00', $this->RenderText('23:00'));
     $editor->AddValue('23:15', $this->RenderText('23:15'));
     $editor->AddValue('23:30', $this->RenderText('23:30'));
     $editor->AddValue('23:45', $this->RenderText('23:45'));
     $editor->setMaxSelectionSize(0);
     $editColumn = new CustomEditColumn('Horas Ejecución', 'fe_horas', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant())
     {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     }
     else
     {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
Exemple #8
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for id_persona field
     //
     $editor = new ComboBox('id_persona_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."ods_persona"');
     $field = new IntegerField('id_persona', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new IntegerField('id_tipo_persona');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('co_dni_cuit');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('co_legajo');
     $lookupDataset->AddField($field, false);
     $field = new StringField('no_persona');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_empresa');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_area');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('id_tipo_persona', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Id Persona', 'id_persona', $editor, $this->dataset, 'id_persona', 'id_tipo_persona', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for id_lugar field
     //
     $editor = new ComboBox('id_lugar_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."ods_lugar"');
     $field = new IntegerField('id_lugar', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('co_lugar');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('no_lugar');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('ds_direccion');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('co_lugar', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Id Lugar', 'id_lugar', $editor, $this->dataset, 'id_lugar', 'co_lugar', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for id_origen_lectura field
     //
     $editor = new ComboBox('id_origen_lectura_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."ods_origen_lectura"');
     $field = new IntegerField('id_origen_lectura');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('co_origen_lectura');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('no_origen_lectura');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('co_origen_lectura', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Id Origen Lectura', 'id_origen_lectura', $editor, $this->dataset, 'id_origen_lectura', 'co_origen_lectura', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for fe_fecha_lectura field
     //
     $editor = new DateTimeEdit('fe_fecha_lectura_edit', true, 'Y-m-d H:i:s', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Fe Fecha Lectura', 'fe_fecha_lectura', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for no_usuario field
     //
     $editor = new TextEdit('no_usuario_edit');
     $editor->SetSize(10);
     $editor->SetMaxLength(10);
     $editColumn = new CustomEditColumn('Nombre Usuario', 'no_usuario', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ds_usuario field
     //
     $editor = new TextEdit('ds_usuario_edit');
     $editor->SetSize(50);
     $editor->SetMaxLength(50);
     $editColumn = new CustomEditColumn('Descripción Usuario', 'ds_usuario', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for co_lector field
     //
     $editor = new TextEdit('co_lector_edit');
     $editColumn = new CustomEditColumn('Código Lector', 'co_lector', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ds_observaciones field
     //
     $editor = new TextAreaEdit('ds_observaciones_edit', 50, 8);
     $editColumn = new CustomEditColumn('Observaciones', 'ds_observaciones', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $editColumn->SetAllowSetToDefault(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for id_carga field
     //
     $editor = new TextEdit('id_carga_edit');
     $editColumn = new CustomEditColumn('Id Carga', 'id_carga', $editor, $this->dataset);
     $editColumn->SetAllowSetToDefault(true);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
Exemple #9
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for id_tarea_plan field
     //
     $editor = new ComboBox('id_tarea_plan_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(
         new PgConnectionFactory(),
         GetConnectionOptions(),
         '"public"."ods_tarea_plan"');
     $field = new IntegerField('id_tarea_plan', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new IntegerField('id_accion');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_bien');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_periodicidad');
     $lookupDataset->AddField($field, false);
     $field = new StringField('ds_detalle');
     $lookupDataset->AddField($field, false);
     $field = new StringField('ds_referencia');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_espacio');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('id_periodicidad', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn(
         'Id Tarea Plan', 
         'id_tarea_plan', 
         $editor, 
         $this->dataset, 'id_tarea_plan', 'id_periodicidad', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for fe_ejecucion field
     //
     $editor = new DateTimeEdit('fe_ejecucion_edit', true, 'Y-m-d H:i:s', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Fecha Ejecucion', 'fe_ejecucion', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for fl_realizada field
     //
     $editor = new CheckBox('fl_realizada_edit');
     $editColumn = new CustomEditColumn('Fl Realizada', 'fl_realizada', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $editColumn->SetAllowSetToDefault(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for ds_observaciones field
     //
     $editor = new TextAreaEdit('ds_observaciones_edit', 50, 8);
     $editColumn = new CustomEditColumn('Ds Observaciones', 'ds_observaciones', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant())
     {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     }
     else
     {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
Exemple #10
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for id_persona field
     //
     $editor = new ComboBox('id_persona_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."ods_persona"');
     $field = new IntegerField('id_persona', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new IntegerField('id_tipo_persona');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('co_dni_cuit');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('co_legajo');
     $lookupDataset->AddField($field, false);
     $field = new StringField('no_persona');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_empresa');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_area');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('id_tipo_persona', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Id Persona', 'id_persona', $editor, $this->dataset, 'id_persona', 'id_tipo_persona', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for id_tarea field
     //
     $editor = new ComboBox('id_tarea_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."ods_tarea"');
     $field = new IntegerField('id_tarea', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new IntegerField('id_tarea_plan');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateTimeField('fe_ejecucion');
     $lookupDataset->AddField($field, false);
     $field = new BooleanField('fl_realizada');
     $lookupDataset->AddField($field, false);
     $field = new StringField('ds_observaciones');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('id_tarea_plan', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Id Tarea', 'id_tarea', $editor, $this->dataset, 'id_tarea', 'id_tarea_plan', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for USERNAME field
     //
     $editor = new ComboBox('username_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."PERSONA"');
     $field = new StringField('USERNAME');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('ES_ADMIN');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateField('NACIMIENTO');
     $lookupDataset->AddField($field, false);
     $field = new StringField('PRIMER_APELLIDO');
     $lookupDataset->AddField($field, false);
     $field = new StringField('SEGUNDO_APELLIDO');
     $lookupDataset->AddField($field, false);
     $field = new StringField('NOMBRE');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('GENERO_ID');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('CIUDAD_ID');
     $lookupDataset->AddField($field, false);
     $field = new StringField('SLOGAN');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('EMAIL');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('CLAVE');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('ES_ADMIN', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('USERNAME', 'USERNAME', $editor, $this->dataset, 'USERNAME', 'ES_ADMIN', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ES_REAL field
     //
     $editor = new TextEdit('es_real_edit');
     $editor->SetSize(1);
     $editor->SetMaxLength(1);
     $editColumn = new CustomEditColumn('ES REAL', 'ES_REAL', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for COLOR_OJOS_ID field
     //
     $editor = new ComboBox('color_ojos_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."COLOR_OJOS"');
     $field = new IntegerField('COLOR_OJOS_ID');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('NOMBRE');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('NOMBRE', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('COLOR OJOS ID', 'COLOR_OJOS_ID', $editor, $this->dataset, 'COLOR_OJOS_ID', 'NOMBRE', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for COLOR_PIEL_ID field
     //
     $editor = new ComboBox('color_piel_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."COLOR_PIEL"');
     $field = new IntegerField('COLOR_PIEL_ID');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('NOMBRE');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('NOMBRE', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('COLOR PIEL ID', 'COLOR_PIEL_ID', $editor, $this->dataset, 'COLOR_PIEL_ID', 'NOMBRE', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for CONTEXTURA_ID field
     //
     $editor = new ComboBox('contextura_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."CONTEXTURA"');
     $field = new IntegerField('CONTEXTURA_ID');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('TIPO');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('TIPO', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('CONTEXTURA ID', 'CONTEXTURA_ID', $editor, $this->dataset, 'CONTEXTURA_ID', 'TIPO', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for NIVEL_EDUCACION_ID field
     //
     $editor = new ComboBox('nivel_educacion_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."NIVEL_EDUCACION"');
     $field = new IntegerField('NIVEL_EDUCACION_ID');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('GRADO');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('GRADO', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('NIVEL EDUCACION ID', 'NIVEL_EDUCACION_ID', $editor, $this->dataset, 'NIVEL_EDUCACION_ID', 'GRADO', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ESTADO_CIVIL_ID field
     //
     $editor = new ComboBox('estado_civil_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."ESTADO_CIVIL"');
     $field = new IntegerField('ESTADO_CIVIL_ID');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('NOMBRE');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('NOMBRE', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('ESTADO CIVIL ID', 'ESTADO_CIVIL_ID', $editor, $this->dataset, 'ESTADO_CIVIL_ID', 'NOMBRE', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for FUMADOR_ID field
     //
     $editor = new ComboBox('fumador_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."FUMADOR"');
     $field = new IntegerField('FUMADOR_ID');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('TIPO');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('TIPO', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('FUMADOR ID', 'FUMADOR_ID', $editor, $this->dataset, 'FUMADOR_ID', 'TIPO', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for BEBEDOR_ID field
     //
     $editor = new ComboBox('bebedor_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."BEBEDOR"');
     $field = new IntegerField('BEBEDOR_ID');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('TIPO');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('TIPO', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('BEBEDOR ID', 'BEBEDOR_ID', $editor, $this->dataset, 'BEBEDOR_ID', 'TIPO', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for FRECUENCIA_EJERCICIO_ID field
     //
     $editor = new ComboBox('frecuencia_ejercicio_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."FRECUENCIA_EJERCICIO"');
     $field = new IntegerField('FRECUENCIA_EJERCICIO_ID');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('RANGO');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('RANGO', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('FRECUENCIA EJERCICIO ID', 'FRECUENCIA_EJERCICIO_ID', $editor, $this->dataset, 'FRECUENCIA_EJERCICIO_ID', 'RANGO', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for SALARIO_ID field
     //
     $editor = new ComboBox('salario_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."SALARIO"');
     $field = new IntegerField('SALARIO_ID');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('RANGO');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('RANGO', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('SALARIO ID', 'SALARIO_ID', $editor, $this->dataset, 'SALARIO_ID', 'RANGO', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ALTURA field
     //
     $editor = new TextEdit('altura_edit');
     $editColumn = new CustomEditColumn('ALTURA', 'ALTURA', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for PESO field
     //
     $editor = new TextEdit('peso_edit');
     $editColumn = new CustomEditColumn('PESO', 'PESO', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for NUM_HIJOS field
     //
     $editor = new TextEdit('num_hijos_edit');
     $editColumn = new CustomEditColumn('NUM HIJOS', 'NUM_HIJOS', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for QUIERE_HIJOS field
     //
     $editor = new TextEdit('quiere_hijos_edit');
     $editor->SetSize(1);
     $editor->SetMaxLength(1);
     $editColumn = new CustomEditColumn('QUIERE HIJOS', 'QUIERE_HIJOS', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for TIPO_RELACION_ID field
     //
     $editor = new ComboBox('tipo_relacion_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."TIPO_RELACION"');
     $field = new IntegerField('TIPO_RELACION_ID');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('NOMBRE');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateField('FECHA_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FECHA_MODIFICACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_MODIFICACION');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('NOMBRE', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('TIPO RELACION ID', 'TIPO_RELACION_ID', $editor, $this->dataset, 'TIPO_RELACION_ID', 'NOMBRE', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for project_id field
     //
     $editor = new ComboBox('project_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`project`');
     $field = new IntegerField('project_id', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new IntegerField('programm_id');
     $lookupDataset->AddField($field, false);
     $field = new StringField('project_name');
     $lookupDataset->AddField($field, false);
     $field = new DateField('date_start');
     $lookupDataset->AddField($field, false);
     $field = new DateField('date_end');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('approved_budget');
     $lookupDataset->AddField($field, false);
     $field = new StringField('notes');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('priority');
     $lookupDataset->AddField($field, false);
     $field = new StringField('lead');
     $lookupDataset->AddField($field, false);
     $field = new StringField('level_of_service');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('multi_year');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('public_engagement');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('year');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('approved');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('progress');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('staff_id');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('dept_id');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('budget_spent');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('admin_flag');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('project_name', GetOrderTypeAsSQL(otAscending));
     $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '%CURRENT_USER_ID%  = 1  OR project.lead=%CURRENT_USER_ID%'));
     $editColumn = new LookUpEditColumn('Project', 'project_id', $editor, $this->dataset, 'project_id', 'project_name', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for task_name field
     //
     $editor = new AutocomleteComboBox('task_name_edit', $this->CreateLinkBuilder());
     $editor->SetSize('250px');
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`task_names`');
     $field = new IntegerField('id', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('Name');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('Name', GetOrderTypeAsSQL(otAscending));
     $editColumn = new DynamicLookupEditColumn('Name', 'task_name', 'task_name_Name', 'insert_task_name_Name_search', $editor, $this->dataset, $lookupDataset, 'Name', 'Name', '');
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for notes field
     //
     $editor = new TextAreaEdit('notes_edit', 50, 8);
     $editColumn = new CustomEditColumn('Notes', 'notes', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for hrs field
     //
     $editor = new SpinEdit('hrs_edit');
     $editColumn = new CustomEditColumn('Allocated Hours', 'hrs', $editor, $this->dataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('21'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $validator = new NumberValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('NumberValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for assigned_to field
     //
     $editor = new ComboBox('assigned_to_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`staff`');
     $field = new IntegerField('staff_id', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('username');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('email');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('picture');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('password');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('dept_id');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('position');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('emp_number');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('username', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Assigned To', 'assigned_to', $editor, $this->dataset, 'staff_id', 'username', $lookupDataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_USER_ID%'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for date_start field
     //
     $editor = new DateTimeEdit('date_start_edit', false, 'Y-m-d', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Date Start', 'date_start', $editor, $this->dataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for date_end field
     //
     $editor = new DateTimeEdit('date_end_edit', true, 'Y-m-d', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Date End', 'date_end', $editor, $this->dataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
Exemple #13
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for Referencia field
     //
     $editor = new TextEdit('referencia_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Referencia', 'Referencia', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for NombreAct field
     //
     $editor = new TextAreaEdit('nombreact_edit', 50, 8);
     $editColumn = new CustomEditColumn('NombreAct', 'NombreAct', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Marca field
     //
     $editor = new TextEdit('marca_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Marca', 'Marca', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Serie field
     //
     $editor = new TextEdit('serie_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Serie', 'Serie', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ValorEstimado field
     //
     $editor = new TextEdit('valorestimado_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('ValorEstimado', 'ValorEstimado', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Bodega field
     //
     $editor = new ComboBox('bodega_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`bodega`');
     $field = new IntegerField('idBodega', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('Nombre');
     $lookupDataset->AddField($field, false);
     $field = new StringField('Direccion');
     $lookupDataset->AddField($field, false);
     $field = new StringField('Ciudad');
     $lookupDataset->AddField($field, false);
     $field = new StringField('Telefono');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('Nombre', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Bodega', 'Bodega', $editor, $this->dataset, 'idBodega', 'Nombre', $lookupDataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('1'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for CuentaPUC field
     //
     $editor = new TextEdit('cuentapuc_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('CuentaPUC', 'CuentaPUC', $editor, $this->dataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('1520'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
 protected function AddFieldColumns(Grid $grid)
 {
     //
     // View column for name field
     //
     $column = new TextViewColumn('name', 'Name', $this->dataset);
     $column->SetOrderable(true);
     /* <inline edit column> */
     //
     // Edit column for name field
     //
     $editor = new TextEdit('name_edit');
     $editColumn = new CustomEditColumn('Name', 'name', $editor, $this->dataset);
     $editColumn->setVisible(false);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetEditOperationColumn($editColumn);
     /* </inline edit column> */
     /* <inline insert column> */
     //
     // Edit column for name field
     //
     $editor = new TextEdit('name_edit');
     $editColumn = new CustomEditColumn('Name', 'name', $editor, $this->dataset);
     $editColumn->setVisible(false);
     $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_USER_NAME%'));
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetInsertOperationColumn($editColumn);
     /* </inline insert column> */
     $column->SetDescription($this->RenderText(''));
     $column->SetFixedWidth(null);
     $grid->AddViewColumn($column);
     //
     // View column for date field
     //
     $column = new DateTimeViewColumn('date', 'Date', $this->dataset);
     $column->SetDateTimeFormat('Y-m-d');
     $column->SetOrderable(true);
     /* <inline edit column> */
     //
     // Edit column for date field
     //
     $editor = new DateTimeEdit('date_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Date', 'date', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetEditOperationColumn($editColumn);
     /* </inline edit column> */
     /* <inline insert column> */
     //
     // Edit column for date field
     //
     $editor = new DateTimeEdit('date_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Date', 'date', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetInsertOperationColumn($editColumn);
     /* </inline insert column> */
     $column->SetDescription($this->RenderText(''));
     $column->SetFixedWidth(null);
     $grid->AddViewColumn($column);
     //
     // View column for Task field
     //
     $column = new TextViewColumn('task_id_Task', 'Project & Task', $this->dataset);
     $column->SetOrderable(true);
     /* <inline edit column> */
     //
     // Edit column for task_id field
     //
     $editor = new ComboBox('task_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`taskview`');
     $field = new IntegerField('task_id');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('project_id');
     $lookupDataset->AddField($field, false);
     $field = new StringField('assigned_to');
     $lookupDataset->AddField($field, false);
     $field = new DateField('date_start');
     $lookupDataset->AddField($field, false);
     $field = new DateField('date_end');
     $lookupDataset->AddField($field, false);
     $field = new StringField('task_name');
     $lookupDataset->AddField($field, false);
     $field = new StringField('notes');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('hrs');
     $lookupDataset->AddField($field, false);
     $field = new StringField('wo');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('staff_id');
     $lookupDataset->AddField($field, false);
     $field = new StringField('Task');
     $lookupDataset->AddField($field, false);
     $field = new StringField('Assigned');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('Task', GetOrderTypeAsSQL(otAscending));
     $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), 'assigned_to=%CURRENT_USER_ID%'));
     $editColumn = new LookUpEditColumn('Project & Task', 'task_id', $editor, $this->dataset, 'task_id', 'Task', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetEditOperationColumn($editColumn);
     /* </inline edit column> */
     /* <inline insert column> */
     //
     // Edit column for task_id field
     //
     $editor = new ComboBox('task_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`taskview`');
     $field = new IntegerField('task_id');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('project_id');
     $lookupDataset->AddField($field, false);
     $field = new StringField('assigned_to');
     $lookupDataset->AddField($field, false);
     $field = new DateField('date_start');
     $lookupDataset->AddField($field, false);
     $field = new DateField('date_end');
     $lookupDataset->AddField($field, false);
     $field = new StringField('task_name');
     $lookupDataset->AddField($field, false);
     $field = new StringField('notes');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('hrs');
     $lookupDataset->AddField($field, false);
     $field = new StringField('wo');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('staff_id');
     $lookupDataset->AddField($field, false);
     $field = new StringField('Task');
     $lookupDataset->AddField($field, false);
     $field = new StringField('Assigned');
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('Task', GetOrderTypeAsSQL(otAscending));
     $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), 'assigned_to=%CURRENT_USER_ID%'));
     $editColumn = new LookUpEditColumn('Project & Task', 'task_id', $editor, $this->dataset, 'task_id', 'Task', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetInsertOperationColumn($editColumn);
     /* </inline insert column> */
     $column->SetDescription($this->RenderText(''));
     $column->SetFixedWidth(null);
     $grid->AddViewColumn($column);
     //
     // View column for hours field
     //
     $column = new TextViewColumn('hours', 'Hours', $this->dataset);
     $column->SetOrderable(true);
     /* <inline edit column> */
     //
     // Edit column for hours field
     //
     $editor = new TextEdit('hours_edit');
     $editColumn = new CustomEditColumn('Hours', 'hours', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetEditOperationColumn($editColumn);
     /* </inline edit column> */
     /* <inline insert column> */
     //
     // Edit column for hours field
     //
     $editor = new TextEdit('hours_edit');
     $editColumn = new CustomEditColumn('Hours', 'hours', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetInsertOperationColumn($editColumn);
     /* </inline insert column> */
     $column->SetDescription($this->RenderText(''));
     $column->SetFixedWidth(null);
     $grid->AddViewColumn($column);
     //
     // View column for notes field
     //
     $column = new TextViewColumn('notes', 'Notes', $this->dataset);
     $column->SetOrderable(true);
     /* <inline edit column> */
     //
     // Edit column for notes field
     //
     $editor = new TextEdit('notes_edit');
     $editColumn = new CustomEditColumn('Notes', 'notes', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetEditOperationColumn($editColumn);
     /* </inline edit column> */
     /* <inline insert column> */
     //
     // Edit column for notes field
     //
     $editor = new TextEdit('notes_edit');
     $editColumn = new CustomEditColumn('Notes', 'notes', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetInsertOperationColumn($editColumn);
     /* </inline insert column> */
     $column->SetDescription($this->RenderText(''));
     $column->SetFixedWidth(null);
     $grid->AddViewColumn($column);
 }
Exemple #15
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for id_tipo_espacio field
     //
     $editor = new ComboBox('id_tipo_espacio_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."ods_tipo_espacio"');
     $field = new IntegerField('id_tipo_espacio', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('no_tipo_espacio');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_tipo_espacio_padre');
     $lookupDataset->AddField($field, false);
     $field = new StringField('ds_referencia');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('ds_referencia', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Id Tipo Espacio', 'id_tipo_espacio', $editor, $this->dataset, 'id_tipo_espacio', 'ds_referencia', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for id_espacio_contenedor field
     //
     $editor = new ComboBox('id_espacio_contenedor_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."ods_espacio"');
     $field = new IntegerField('id_espacio', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new IntegerField('id_tipo_espacio');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_espacio_contenedor');
     $lookupDataset->AddField($field, false);
     $field = new StringField('co_espacio');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('no_espacio');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('nu_planta');
     $lookupDataset->AddField($field, false);
     $field = new StringField('co_plano');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('co_espacio', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Id Espacio Contenedor', 'id_espacio_contenedor', $editor, $this->dataset, 'id_espacio', 'co_espacio', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for co_espacio field
     //
     $editor = new TextEdit('co_espacio_edit');
     $editor->SetSize(5);
     $editor->SetMaxLength(5);
     $editColumn = new CustomEditColumn('Código Espacio', 'co_espacio', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for no_espacio field
     //
     $editor = new TextEdit('no_espacio_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Nombre Espacio', 'no_espacio', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for nu_planta field
     //
     $editor = new TextEdit('nu_planta_edit');
     $editColumn = new CustomEditColumn('Número Planta', 'nu_planta', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for co_plano field
     //
     $editor = new TextEdit('co_plano_edit');
     $editor->SetSize(50);
     $editor->SetMaxLength(50);
     $editColumn = new CustomEditColumn('Código Plano', 'co_plano', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for username field
     //
     $editor = new TextEdit('username_edit');
     $editor->SetSize(50);
     $editor->SetMaxLength(50);
     $editColumn = new CustomEditColumn('Username', 'username', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for email field
     //
     $editor = new TextEdit('email_edit');
     $editor->SetSize(50);
     $editor->SetMaxLength(50);
     $editColumn = new CustomEditColumn('Email', 'email', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for password field
     //
     $editor = new TextEdit('password_edit');
     $editor->SetPasswordMode(true);
     $editColumn = new CustomEditColumn('Password', 'password', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for dept_id field
     //
     $editor = new ComboBox('dept_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`department`');
     $field = new IntegerField('DEPT_ID', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('DEPARTMENT');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('MANAGER');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('DIRECTOR');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('LOCATION');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('PHONE_NO');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('DEPARTMENT', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Department', 'dept_id', $editor, $this->dataset, 'DEPT_ID', 'DEPARTMENT', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for position field
     //
     $editor = new TextEdit('position_edit');
     $editor->SetSize(50);
     $editor->SetMaxLength(50);
     $editColumn = new CustomEditColumn('Position', 'position', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for emp_number field
     //
     $editor = new TextEdit('emp_number_edit');
     $editor->SetSize(20);
     $editor->SetMaxLength(20);
     $editColumn = new CustomEditColumn('Employee No', 'emp_number', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for picture field
     //
     $editor = new ImageUploader('picture_edit');
     $editor->SetShowImage(true);
     $editColumn = new UploadFileToFolderColumn('Picture', 'picture', $editor, $this->dataset, false, false, 'images');
     $editColumn->OnCustomFileName->AddListener('picture_GenerateFileName_insert', $this);
     $editColumn->SetReplaceUploadedFileIfExist(true);
     $editColumn->SetGenerationImageThumbnails('picture', 'images', Delegate::CreateFromMethod($this, 'picture_Thumbnail_GenerateFileName_insert'), new ImageFitByHeightResizeFilter(100));
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
Exemple #17
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for id_accion field
     //
     $editor = new ComboBox('id_accion_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(
         new PgConnectionFactory(),
         GetConnectionOptions(),
         '"public"."sga_accion"');
     $field = new IntegerField('id_accion', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new IntegerField('id_tipo_espacio');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_tipo_bien');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_origen');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_metodologia');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_periodicidad');
     $lookupDataset->AddField($field, false);
     $field = new BooleanField('fl_a_demanda');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('ds_referencia');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_tipo_accion');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_sector');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('ds_referencia', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn(
         'Acción', 
         'id_accion', 
         $editor, 
         $this->dataset, 'id_accion', 'ds_referencia', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for id_espacio field
     //
     $editor = new ComboBox('id_espacio_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(
         new PgConnectionFactory(),
         GetConnectionOptions(),
         '"public"."sga_espacio"');
     $field = new IntegerField('id_espacio', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new IntegerField('id_tipo_espacio');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_espacio_contenedor');
     $lookupDataset->AddField($field, false);
     $field = new StringField('co_espacio');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('no_espacio');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('co_plano');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_planta');
     $lookupDataset->AddField($field, false);
     $field = new StringField('ds_referencia');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_sector');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('ds_referencia', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn(
         'Espacio', 
         'id_espacio', 
         $editor, 
         $this->dataset, 'id_espacio', 'ds_referencia', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for id_bien field
     //
     $editor = new ComboBox('id_bien_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(
         new PgConnectionFactory(),
         GetConnectionOptions(),
         '"public"."sga_bien"');
     $field = new IntegerField('id_bien', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new IntegerField('id_tipo_bien');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('id_espacio');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('ds_observacion');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('nu_cantidad');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('ds_observacion', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn(
         'Bien', 
         'id_bien', 
         $editor, 
         $this->dataset, 'id_bien', 'ds_observacion', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for id_periodicidad field
     //
     $editor = new ComboBox('id_periodicidad_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(
         new PgConnectionFactory(),
         GetConnectionOptions(),
         '"public"."sga_periodicidad"');
     $field = new IntegerField('id_periodicidad', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('no_periodicidad');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('va_frecuencia');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('no_periodicidad', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn(
         'Periodicidad', 
         'id_periodicidad', 
         $editor, 
         $this->dataset, 'id_periodicidad', 'no_periodicidad', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for ds_detalle field
     //
     $editor = new TextAreaEdit('ds_detalle_edit', 50, 8);
     $editColumn = new CustomEditColumn('Detalle', 'ds_detalle', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for fe_inicio field
     //
     $editor = new DateTimeEdit('fe_inicio_edit', true, 'd/m/Y H:i:s', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Fecha Início', 'fe_inicio', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant())
     {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     }
     else
     {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
Exemple #18
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for FOTO_ID field
     //
     $editor = new TextEdit('foto_id_edit');
     $editColumn = new CustomEditColumn('FOTO ID', 'FOTO_ID', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for RUTA field
     //
     $editor = new ImageUploader('ruta_edit');
     $editor->SetShowImage(false);
     $editColumn = new FileUploadingColumn('RUTA', 'RUTA', $editor, $this->dataset, false, false, 'GE_FOTOGrid_RUTA_handler_insert');
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for USERNAME field
     //
     $editor = new ComboBox('username_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."PERSONA"');
     $field = new StringField('USERNAME');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('ES_ADMIN');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateField('NACIMIENTO');
     $lookupDataset->AddField($field, false);
     $field = new StringField('PRIMER_APELLIDO');
     $lookupDataset->AddField($field, false);
     $field = new StringField('SEGUNDO_APELLIDO');
     $lookupDataset->AddField($field, false);
     $field = new StringField('NOMBRE');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('GENERO_ID');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('CIUDAD_ID');
     $lookupDataset->AddField($field, false);
     $field = new StringField('SLOGAN');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('EMAIL');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('CLAVE');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('ES_ADMIN', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('USERNAME', 'USERNAME', $editor, $this->dataset, 'USERNAME', 'ES_ADMIN', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for TITULO field
     //
     $editor = new TextEdit('titulo_edit');
     $editor->SetSize(40);
     $editor->SetMaxLength(40);
     $editColumn = new CustomEditColumn('TITULO', 'TITULO', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
Exemple #19
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for FEC_WINK field
     //
     $editor = new DateTimeEdit('fec_wink_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('FEC WINK', 'FEC_WINK', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for USERNAME_EMISOR field
     //
     $editor = new ComboBox('username_emisor_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."PERSONA"');
     $field = new StringField('USERNAME');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('ES_ADMIN');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateField('NACIMIENTO');
     $lookupDataset->AddField($field, false);
     $field = new StringField('PRIMER_APELLIDO');
     $lookupDataset->AddField($field, false);
     $field = new StringField('SEGUNDO_APELLIDO');
     $lookupDataset->AddField($field, false);
     $field = new StringField('NOMBRE');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('GENERO_ID');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('CIUDAD_ID');
     $lookupDataset->AddField($field, false);
     $field = new StringField('SLOGAN');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('EMAIL');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('CLAVE');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('ES_ADMIN', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('USERNAME EMISOR', 'USERNAME_EMISOR', $editor, $this->dataset, 'USERNAME', 'ES_ADMIN', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for USERNAME_RECEPTOR field
     //
     $editor = new ComboBox('username_receptor_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."PERSONA"');
     $field = new StringField('USERNAME');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('ES_ADMIN');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new DateField('NACIMIENTO');
     $lookupDataset->AddField($field, false);
     $field = new StringField('PRIMER_APELLIDO');
     $lookupDataset->AddField($field, false);
     $field = new StringField('SEGUNDO_APELLIDO');
     $lookupDataset->AddField($field, false);
     $field = new StringField('NOMBRE');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('GENERO_ID');
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('CIUDAD_ID');
     $lookupDataset->AddField($field, false);
     $field = new StringField('SLOGAN');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_CREACION');
     $lookupDataset->AddField($field, false);
     $field = new DateField('FEC_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('USUARIO_ULTIMA_MOD');
     $lookupDataset->AddField($field, false);
     $field = new StringField('EMAIL');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('CLAVE');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('ES_ADMIN', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('USERNAME RECEPTOR', 'USERNAME_RECEPTOR', $editor, $this->dataset, 'USERNAME', 'ES_ADMIN', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for project_name field
     //
     $editor = new TextEdit('project_name_edit');
     $editColumn = new CustomEditColumn('Project Name', 'project_name', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for approved_budget field
     //
     $editor = new TextEdit('approved_budget_edit');
     $editColumn = new CustomEditColumn('Approved Budget', 'approved_budget', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $validator = new NumberValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('NumberValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for lead field
     //
     $editor = new ComboBox('lead_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`staff`');
     $field = new IntegerField('staff_id', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('username');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('email');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('picture');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('password');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new IntegerField('dept_id');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('position');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('emp_number');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->SetOrderBy('username', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn('Lead', 'lead', $editor, $this->dataset, 'staff_id', 'username', $lookupDataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(false);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }