/** * @param ConnectionFactory $connectionFactory * @param array $connectionOptions * @param string $tableName * @param string $userNameFieldName * @param string $passwordFieldName */ private function CreateDataset(ConnectionFactory $connectionFactory, $connectionOptions, $tableName, $userNameFieldName, $passwordFieldName) { $this->dataset = new TableDataset($connectionFactory, $connectionOptions, $tableName); $field = new StringField($userNameFieldName); $this->dataset->AddField($field, true); $field = new StringField($passwordFieldName); $this->dataset->AddField($field, 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 id_tipo_accion field // $editor = new ComboBox('id_tipo_accion_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset( new PgConnectionFactory(), GetConnectionOptions(), '"public"."sga_tipo_accion"'); $field = new IntegerField('id_tipo_accion', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('no_tipo_accion'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('id_tipo_accion_padre'); $lookupDataset->AddField($field, false); $field = new StringField('ds_referencia'); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('ds_referencia', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn( 'Tipo Accion', 'id_tipo_accion', $editor, $this->dataset, 'id_tipo_accion', 'ds_referencia', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // 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"."sga_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( 'Tipo Espacio', 'id_tipo_espacio', $editor, $this->dataset, 'id_tipo_espacio', 'ds_referencia', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for id_sector field // $editor = new ComboBox('id_sector_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset( new PgConnectionFactory(), GetConnectionOptions(), '"public"."sga_sector"'); $field = new IntegerField('id_sector', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('no_sector'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('no_sector', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn( 'Sector', 'id_sector', $editor, $this->dataset, 'id_sector', 'no_sector', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for id_origen field // $editor = new ComboBox('id_origen_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset( new PgConnectionFactory(), GetConnectionOptions(), '"public"."sga_origen"'); $field = new IntegerField('id_origen', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('no_origen'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('no_origen', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn( 'Origen', 'id_origen', $editor, $this->dataset, 'id_origen', 'no_origen', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for id_metodologia field // $editor = new ComboBox('id_metodologia_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset( new PgConnectionFactory(), GetConnectionOptions(), '"public"."sga_metodologia"'); $field = new IntegerField('id_metodologia', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('no_metodologia'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('ds_metodologia'); $lookupDataset->AddField($field, false); $field = new IntegerField('id_origen'); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('no_metodologia', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn( 'Metodología', 'id_metodologia', $editor, $this->dataset, 'id_metodologia', 'no_metodologia', $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 fl_a_demanda field // $editor = new CheckBox('fl_a_demanda_edit'); $editColumn = new CustomEditColumn('A Demanda', 'fl_a_demanda', $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_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); } }
private function CreateUserGrantsDataset() { $result = new TableDataset($this->connectionFactory, $this->connectionOptions, $this->userPermsTable); $result->AddField(new IntegerField($this->userPerms_UserId), true); $result->AddField(new StringField($this->userPerms_PageName), true); $result->AddField(new StringField($this->userPerms_Grant), true); return $result; }
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); } }
protected function AddInsertColumns(Grid $grid) { // // Edit column for id_tipo_accion field // $editor = new ComboBox('id_tipo_accion_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset( new PgConnectionFactory(), GetConnectionOptions(), '"public"."sga_tipo_accion"'); $field = new IntegerField('id_tipo_accion', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('no_tipo_accion'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('id_tipo_accion_padre'); $lookupDataset->AddField($field, false); $field = new StringField('ds_referencia'); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('ds_referencia', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn( 'Tipo Accion', 'id_tipo_accion', $editor, $this->dataset, 'id_tipo_accion', 'ds_referencia', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // 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"."sga_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( 'Tipo Espacio', 'id_tipo_espacio', $editor, $this->dataset, 'id_tipo_espacio', 'ds_referencia', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for id_tipo_bien field // $editor = new ComboBox('id_tipo_bien_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset( new PgConnectionFactory(), GetConnectionOptions(), '"public"."sga_tipo_bien"'); $field = new IntegerField('id_tipo_bien', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('no_tipo_bien'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('id_tipo_bien_padre'); $lookupDataset->AddField($field, false); $field = new StringField('ds_referencia'); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('ds_referencia', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn( 'Tipo Bien', 'id_tipo_bien', $editor, $this->dataset, 'id_tipo_bien', 'ds_referencia', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for id_origen field // $editor = new ComboBox('id_origen_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset( new PgConnectionFactory(), GetConnectionOptions(), '"public"."sga_origen"'); $field = new IntegerField('id_origen', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('no_origen'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('no_origen', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn( 'Origen', 'id_origen', $editor, $this->dataset, 'id_origen', 'no_origen', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for id_metodologia field // $editor = new ComboBox('id_metodologia_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset( new PgConnectionFactory(), GetConnectionOptions(), '"public"."sga_metodologia"'); $field = new IntegerField('id_metodologia', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('no_metodologia'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('ds_metodologia'); $lookupDataset->AddField($field, false); $field = new IntegerField('id_origen'); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('no_metodologia', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn( 'Metodología', 'id_metodologia', $editor, $this->dataset, 'id_metodologia', 'no_metodologia', $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 fl_a_demanda field // $editor = new CheckBox('fl_a_demanda_edit'); $editColumn = new CustomEditColumn('A Demanda', 'fl_a_demanda', $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); } }
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); } }
protected function AddInsertColumns(Grid $grid) { // // Edit column for office_id field // $editor = new ComboBox('office_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."office"'); $field = new IntegerField('id'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('title'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('num_positions'); $lookupDataset->AddField($field, false); $field = new StringField('responsibilities'); $lookupDataset->AddField($field, false); $field = new IntegerField('term_length_months'); $lookupDataset->AddField($field, false); $field = new StringField('filing_fee'); $lookupDataset->AddField($field, false); $field = new BooleanField('partisan'); $lookupDataset->AddField($field, false); $field = new StringField('age_requirements'); $lookupDataset->AddField($field, false); $field = new StringField('res_requirements'); $lookupDataset->AddField($field, false); $field = new StringField('prof_requirements'); $lookupDataset->AddField($field, false); $field = new IntegerField('salary'); $lookupDataset->AddField($field, false); $field = new StringField('notes'); $lookupDataset->AddField($field, false); $field = new IntegerField('office_rank'); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('title', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn('Office Title', 'office_id', $editor, $this->dataset, 'id', 'title', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for name field // $editor = new TextEdit('name_edit'); $editor->SetSize(35); $editor->SetMaxLength(35); $editColumn = new CustomEditColumn('Document Name or Description', '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 link field // $editor = new TextAreaEdit('link_edit', 50, 8); $editColumn = new CustomEditColumn('URL to Document', 'link', $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); } }
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); } }
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); } }
protected function AddInsertColumns(Grid $grid) { // // Edit column for state field // $editor = new ComboBox('state_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."state"'); $field = new StringField('abbr'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('name'); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('name', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn('State', 'state', $editor, $this->dataset, 'abbr', 'name', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for name field // $editor = new TextEdit('name_edit'); $editor->SetSize(50); $editor->SetMaxLength(50); $editColumn = new CustomEditColumn('District Name', 'name', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for level_id field // $editor = new ComboBox('level_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."level"'); $field = new StringField('id'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('name'); $lookupDataset->AddField($field, false); $field = new IntegerField('rank'); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('name', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn('Level of Government', 'level_id', $editor, $this->dataset, 'id', 'name', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for election_div_id field // $editor = new MultiLevelComboBoxEditor('election_div_id_edit', $this->CreateLinkBuilder()); $dataset0 = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."state"'); $field = new StringField('abbr'); $field->SetIsNotNull(true); $dataset0->AddField($field, true); $field = new StringField('name'); $dataset0->AddField($field, false); $editor->AddLevel($dataset0, 'abbr', 'name', $this->RenderText('State'), null); $dataset1 = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."election_div"'); $field = new IntegerField('id'); $field->SetIsNotNull(true); $dataset1->AddField($field, true); $field = new StringField('name'); $field->SetIsNotNull(true); $dataset1->AddField($field, false); $field = new StringField('phys_addr_addr1'); $dataset1->AddField($field, false); $field = new StringField('phys_addr_addr2'); $dataset1->AddField($field, false); $field = new StringField('phys_addr_city'); $dataset1->AddField($field, false); $field = new StringField('phys_addr_state'); $dataset1->AddField($field, false); $field = new StringField('phys_addr_zip'); $dataset1->AddField($field, false); $field = new StringField('mail_addr_addr1'); $dataset1->AddField($field, false); $field = new StringField('mail_addr_addr2'); $dataset1->AddField($field, false); $field = new StringField('mail_addr_city'); $dataset1->AddField($field, false); $field = new StringField('mail_addr_state'); $dataset1->AddField($field, false); $field = new StringField('mail_addr_zip'); $dataset1->AddField($field, false); $field = new StringField('phone'); $dataset1->AddField($field, false); $field = new StringField('fax'); $dataset1->AddField($field, false); $field = new StringField('website'); $dataset1->AddField($field, false); $field = new StringField('notes'); $dataset1->AddField($field, false); $dataset1->SetOrderBy('name', GetOrderTypeAsSQL(otAscending)); $editor->AddLevel($dataset1, 'id', 'name', $this->RenderText('Election Division'), new ForeignKeyInfo('abbr', 'phys_addr_state')); $editColumn = new MultiLevelLookupEditColumn('Election Division', 'election_div_id', $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); } }
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); } }
protected function CreateGridAdvancedSearchControl(Grid $grid) { $this->AdvancedSearchControl = new AdvancedSearchControl('clientiasearch', $this->dataset, $this->GetLocalizerCaptions(), $this->GetColumnVariableContainer(), $this->CreateLinkBuilder()); $this->AdvancedSearchControl->setTimerInterval(1000); $lookupDataset = new TableDataset(new MyPDOConnectionFactory(), GetConnectionOptions(), '`clienti`'); $field = new IntegerField('id', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('cli-codcli'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('cli-ragsoc'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('cli-codlis'); $lookupDataset->AddField($field, false); $field = new DateTimeField('datains'); $lookupDataset->AddField($field, false); $field = new DateTimeField('datamod'); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('cli-codcli', GetOrderTypeAsSQL(otAscending)); $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateLookupSearchInput('cli-codcli', $this->RenderText('Codice Cliente'), $lookupDataset, 'cli-codcli', 'cli-codcli', false, 8)); $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('cli-ragsoc', $this->RenderText('Ragione sociale'))); }
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); } }
protected function AddInsertColumns(Grid $grid) { // // Edit column for idFacturas field // $editor = new TextEdit('idfacturas_edit'); $editColumn = new CustomEditColumn('IdFacturas', 'idFacturas', $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 Fecha field // $editor = new TextEdit('fecha_edit'); $editor->SetSize(20); $editor->SetMaxLength(20); $editColumn = new CustomEditColumn('Fecha', 'Fecha', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for OCompra field // $editor = new TextEdit('ocompra_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('OCompra', 'OCompra', $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 OSalida field // $editor = new TextEdit('osalida_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('OSalida', 'OSalida', $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 FormaPago field // $editor = new TextEdit('formapago_edit'); $editor->SetSize(20); $editor->SetMaxLength(20); $editColumn = new CustomEditColumn('FormaPago', 'FormaPago', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Subtotal field // $editor = new TextEdit('subtotal_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Subtotal', 'Subtotal', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for IVA field // $editor = new TextEdit('iva_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('IVA', 'IVA', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for Descuentos field // $editor = new TextEdit('descuentos_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Descuentos', 'Descuentos', $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 Total field // $editor = new TextEdit('total_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Total', 'Total', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for SaldoFact field // $editor = new TextEdit('saldofact_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('SaldoFact', 'SaldoFact', $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 TotalCostos field // $editor = new TextEdit('totalcostos_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('TotalCostos', 'TotalCostos', $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 Cotizaciones_idCotizaciones field // $editor = new TextEdit('cotizaciones_idcotizaciones_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Cotizaciones IdCotizaciones', 'Cotizaciones_idCotizaciones', $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 EmpresaPro_idEmpresaPro field // $editor = new TextEdit('empresapro_idempresapro_edit'); $editColumn = new CustomEditColumn('EmpresaPro IdEmpresaPro', 'EmpresaPro_idEmpresaPro', $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 Usuarios_idUsuarios field // $editor = new TextEdit('usuarios_idusuarios_edit'); $editColumn = new CustomEditColumn('Usuarios IdUsuarios', 'Usuarios_idUsuarios', $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 Clientes_idClientes field // $editor = new TextEdit('clientes_idclientes_edit'); $editColumn = new CustomEditColumn('Clientes IdClientes', 'Clientes_idClientes', $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 CentroCosto field // $editor = new ComboBox('centrocosto_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`servicio`'); $field = new IntegerField('id', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new IntegerField('empresa_id'); $lookupDataset->AddField($field, false); $field = new StringField('nombre'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('estado'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('nombre', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn('CentroCosto', 'CentroCosto', $editor, $this->dataset, '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 off-numoff field // $editor = new TextEdit('off-numoff_edit'); $editColumn = new CustomEditColumn('Off-numoff', 'off-numoff', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for off-codcli field // $editor = new ComboBox('off-codcli_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new MyPDOConnectionFactory(), GetConnectionOptions(), '`clienti`'); $field = new IntegerField('id', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('cli-codcli'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('cli-ragsoc'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('cli-codlis'); $lookupDataset->AddField($field, false); $field = new DateTimeField('datains'); $lookupDataset->AddField($field, false); $field = new DateTimeField('datamod'); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('cli-ragsoc', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn('cod.Cliente', 'off-codcli', $editor, $this->dataset, 'cli-codcli', 'cli-ragsoc', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for off-descriz field // $editor = new TextEdit('off-descriz_edit'); $editor->SetSize(50); $editor->SetMaxLength(50); $editColumn = new CustomEditColumn('Off-descriz', 'off-descriz', $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 off-gg-termine-consegna field // $editor = new TextEdit('off-gg-termine-consegna_edit'); $editColumn = new CustomEditColumn('Off-gg-termine-consegna', 'off-gg-termine-consegna', $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 off-datains field // $editor = new DateTimeEdit('off-datains_edit', true, 'd-m-Y', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Data inserimento', 'off-datains', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for off-dataeva field // $editor = new DateTimeEdit('off-dataeva_edit', true, 'd-m-Y', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Data evasione', 'off-dataeva', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for datains field // $editor = new DateTimeEdit('datains_edit', false, 'd-m-Y', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Data ins', 'datains', $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 election_div_id field // $editor = new MultiLevelComboBoxEditor('election_div_id_edit', $this->CreateLinkBuilder()); $dataset0 = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."state"'); $field = new StringField('abbr'); $field->SetIsNotNull(true); $dataset0->AddField($field, true); $field = new StringField('name'); $dataset0->AddField($field, false); $editor->AddLevel($dataset0, 'abbr', 'name', $this->RenderText('State'), null); $dataset1 = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."election_div"'); $field = new IntegerField('id'); $field->SetIsNotNull(true); $dataset1->AddField($field, true); $field = new StringField('name'); $field->SetIsNotNull(true); $dataset1->AddField($field, false); $field = new StringField('phys_addr_addr1'); $dataset1->AddField($field, false); $field = new StringField('phys_addr_addr2'); $dataset1->AddField($field, false); $field = new StringField('phys_addr_city'); $dataset1->AddField($field, false); $field = new StringField('phys_addr_state'); $dataset1->AddField($field, false); $field = new StringField('phys_addr_zip'); $dataset1->AddField($field, false); $field = new StringField('mail_addr_addr1'); $dataset1->AddField($field, false); $field = new StringField('mail_addr_addr2'); $dataset1->AddField($field, false); $field = new StringField('mail_addr_city'); $dataset1->AddField($field, false); $field = new StringField('mail_addr_state'); $dataset1->AddField($field, false); $field = new StringField('mail_addr_zip'); $dataset1->AddField($field, false); $field = new StringField('phone'); $dataset1->AddField($field, false); $field = new StringField('fax'); $dataset1->AddField($field, false); $field = new StringField('website'); $dataset1->AddField($field, false); $field = new StringField('notes'); $dataset1->AddField($field, false); $dataset1->SetOrderBy('name', GetOrderTypeAsSQL(otAscending)); $editor->AddLevel($dataset1, 'id', 'name', $this->RenderText('Election Division'), new ForeignKeyInfo('abbr', 'phys_addr_state')); $editColumn = new MultiLevelLookupEditColumn('Election Division', 'election_div_id', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for name field // $editor = new TextEdit('name_edit'); $editor->SetSize(35); $editor->SetMaxLength(35); $editColumn = new CustomEditColumn('Document Name or Description', '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 link field // $editor = new TextAreaEdit('link_edit', 50, 8); $editColumn = new CustomEditColumn('URL to Document', 'link', $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); } }
protected function CreateGrid() { $result = new Grid($this, $this->dataset, 'listino_articoliGrid'); if ($this->GetSecurityInfo()->HasDeleteGrant()) { $result->SetAllowDeleteSelected(false); } else { $result->SetAllowDeleteSelected(false); } ApplyCommonPageSettings($this, $result); $result->SetUseImagesForActions(true); $result->SetUseFixedHeader(false); $result->SetShowLineNumbers(true); $result->SetAllowOrdering(false); $result->SetHighlightRowAtHover(false); $result->SetWidth(''); $result->BeforeUpdateRecord->AddListener('listino_articoliGrid' . '_' . 'BeforeUpdateRecord', $this); $result->BeforeInsertRecord->AddListener('listino_articoliGrid' . '_' . 'BeforeInsertRecord', $this); $this->CreateGridSearchControl($result); $this->CreateGridAdvancedSearchControl($result); $this->AddFieldColumns($result); $this->AddSingleRecordViewColumns($result); $this->AddEditColumns($result); $this->AddInsertColumns($result); $this->AddPrintColumns($result); $this->AddExportColumns($result); $this->AddOperationsColumns($result); $this->SetShowPageList(true); $this->SetHidePageListByDefault(false); $this->SetExportToExcelAvailable(false); $this->SetExportToWordAvailable(false); $this->SetExportToXmlAvailable(false); $this->SetExportToCsvAvailable(false); $this->SetExportToPdfAvailable(false); $this->SetPrinterFriendlyAvailable(false); $this->SetSimpleSearchAvailable(false); $this->SetAdvancedSearchAvailable(false); $this->SetFilterRowAvailable(true); $this->SetVisualEffectsEnabled(true); $this->SetShowTopPageNavigator(true); $this->SetShowBottomPageNavigator(false); // // Http Handlers // // // View column for lisdesc field // $column = new TextViewColumn('lisdesc', 'Descrizione', $this->dataset); $column->SetOrderable(true); $handler = new ShowTextBlobHandler($this->dataset, $this, 'listino_articoliGrid_lisdesc_handler_list', $column); GetApplication()->RegisterHTTPHandler($handler); // // View column for lisdesc field // $column = new TextViewColumn('lisdesc', 'Descrizione', $this->dataset); $column->SetOrderable(true); $handler = new ShowTextBlobHandler($this->dataset, $this, 'listino_articoliGrid_lisdesc_handler_view', $column); GetApplication()->RegisterHTTPHandler($handler); $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)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '')); $handler = new DynamicSearchHandler($lookupDataset, $this, 'edit_lis-codart_descrizione_search', 'art-codart', 'descrizione', null); GetApplication()->RegisterHTTPHandler($handler); $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)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '')); $handler = new DynamicSearchHandler($lookupDataset, $this, 'insert_lis-codart_descrizione_search', 'art-codart', 'descrizione', null); GetApplication()->RegisterHTTPHandler($handler); return $result; }
protected function CreateGrid() { $result = new Grid($this, $this->dataset, 'clientesGrid'); if ($this->GetSecurityInfo()->HasDeleteGrant()) { $result->SetAllowDeleteSelected(false); } else { $result->SetAllowDeleteSelected(false); } ApplyCommonPageSettings($this, $result); $result->SetUseImagesForActions(true); $result->SetUseFixedHeader(false); $result->SetShowLineNumbers(false); $result->SetHighlightRowAtHover(false); $result->SetWidth(''); $this->CreateGridSearchControl($result); $this->CreateGridAdvancedSearchControl($result); $this->AddFieldColumns($result); $this->AddSingleRecordViewColumns($result); $this->AddEditColumns($result); $this->AddInsertColumns($result); $this->AddPrintColumns($result); $this->AddExportColumns($result); $this->AddOperationsColumns($result); $this->SetShowPageList(true); $this->SetHidePageListByDefault(false); $this->SetExportToExcelAvailable(true); $this->SetExportToWordAvailable(true); $this->SetExportToXmlAvailable(true); $this->SetExportToCsvAvailable(true); $this->SetExportToPdfAvailable(true); $this->SetPrinterFriendlyAvailable(true); $this->SetSimpleSearchAvailable(true); $this->SetAdvancedSearchAvailable(true); $this->SetFilterRowAvailable(true); $this->SetVisualEffectsEnabled(true); $this->SetShowTopPageNavigator(true); $this->SetShowBottomPageNavigator(true); // // Http Handlers // // // View column for RazonSocial field // $column = new TextViewColumn('RazonSocial', 'RazonSocial', $this->dataset); $column->SetOrderable(true); /* <inline edit column> */ // // 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); $column->SetEditOperationColumn($editColumn); /* </inline edit column> */ /* <inline insert column> */ // // 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); $column->SetInsertOperationColumn($editColumn); /* </inline insert column> */ $handler = new ShowTextBlobHandler($this->dataset, $this, 'RazonSocial_handler', $column); GetApplication()->RegisterHTTPHandler($handler); $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)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '')); $handler = new DynamicSearchHandler($lookupDataset, $this, 'inline_edit_Cod_Dpto_Nombre_search', 'Cod_dpto', 'Nombre', null); GetApplication()->RegisterHTTPHandler($handler); $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)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '')); $handler = new DynamicSearchHandler($lookupDataset, $this, 'inline_insert_Cod_Dpto_Nombre_search', 'Cod_dpto', 'Nombre', null); GetApplication()->RegisterHTTPHandler($handler); $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)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '')); $handler = new DynamicSearchHandler($lookupDataset, $this, 'inline_edit_Pais_Domicilio_Pais_search', 'Codigo', 'Pais', null); GetApplication()->RegisterHTTPHandler($handler); $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)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '')); $handler = new DynamicSearchHandler($lookupDataset, $this, 'inline_insert_Pais_Domicilio_Pais_search', 'Codigo', 'Pais', null); GetApplication()->RegisterHTTPHandler($handler); // // View column for Telefono field // $column = new TextViewColumn('Telefono', 'Telefono', $this->dataset); $column->SetOrderable(true); /* <inline edit column> */ // // 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); $column->SetEditOperationColumn($editColumn); /* </inline edit column> */ /* <inline insert column> */ // // 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); $column->SetInsertOperationColumn($editColumn); /* </inline insert column> */ $handler = new ShowTextBlobHandler($this->dataset, $this, 'Telefono_handler', $column); GetApplication()->RegisterHTTPHandler($handler); // // View column for Contacto field // $column = new TextViewColumn('Contacto', 'Contacto', $this->dataset); $column->SetOrderable(true); /* <inline edit column> */ // // 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); $column->SetEditOperationColumn($editColumn); /* </inline edit column> */ /* <inline insert column> */ // // 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); $column->SetInsertOperationColumn($editColumn); /* </inline insert column> */ $handler = new ShowTextBlobHandler($this->dataset, $this, 'Contacto_handler', $column); GetApplication()->RegisterHTTPHandler($handler); // // View column for RazonSocial field // $column = new TextViewColumn('RazonSocial', 'RazonSocial', $this->dataset); $column->SetOrderable(true); $handler = new ShowTextBlobHandler($this->dataset, $this, 'RazonSocial_handler', $column); GetApplication()->RegisterHTTPHandler($handler); // // View column for Telefono field // $column = new TextViewColumn('Telefono', 'Telefono', $this->dataset); $column->SetOrderable(true); $handler = new ShowTextBlobHandler($this->dataset, $this, 'Telefono_handler', $column); GetApplication()->RegisterHTTPHandler($handler); // // View column for Contacto field // $column = new TextViewColumn('Contacto', 'Contacto', $this->dataset); $column->SetOrderable(true); $handler = new ShowTextBlobHandler($this->dataset, $this, 'Contacto_handler', $column); GetApplication()->RegisterHTTPHandler($handler); $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)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '')); $handler = new DynamicSearchHandler($lookupDataset, $this, 'edit_Cod_Dpto_Nombre_search', 'Cod_dpto', 'Nombre', null); GetApplication()->RegisterHTTPHandler($handler); $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)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '')); $handler = new DynamicSearchHandler($lookupDataset, $this, 'edit_Pais_Domicilio_Pais_search', 'Codigo', 'Pais', null); GetApplication()->RegisterHTTPHandler($handler); $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)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '')); $handler = new DynamicSearchHandler($lookupDataset, $this, 'insert_Cod_Dpto_Nombre_search', 'Cod_dpto', 'Nombre', null); GetApplication()->RegisterHTTPHandler($handler); $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)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '')); $handler = new DynamicSearchHandler($lookupDataset, $this, 'insert_Pais_Domicilio_Pais_search', 'Codigo', 'Pais', null); GetApplication()->RegisterHTTPHandler($handler); return $result; }
protected function AddInsertColumns(Grid $grid) { // // Edit column for EVENTO_ID field // $editor = new TextEdit('evento_id_edit'); $editColumn = new CustomEditColumn('EVENTO ID', 'EVENTO_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 NOMBRE field // $editor = new TextEdit('nombre_edit'); $editor->SetSize(30); $editor->SetMaxLength(30); $editColumn = new CustomEditColumn('NOMBRE', 'NOMBRE', $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 FECHA_HORA field // $editor = new DateTimeEdit('fecha_hora_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('FECHA HORA', 'FECHA_HORA', $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 LUGAR field // $editor = new TextEdit('lugar_edit'); $editor->SetSize(30); $editor->SetMaxLength(30); $editColumn = new CustomEditColumn('LUGAR', 'LUGAR', $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 DESCRIPCION field // $editor = new TextAreaEdit('descripcion_edit', 50, 8); $editColumn = new CustomEditColumn('DESCRIPCION', 'DESCRIPCION', $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 ComboBox('ciudad_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."CIUDAD"'); $field = new IntegerField('CIUDAD_ID'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('NOMBRE'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('PAIS_ID'); $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('CIUDAD', 'CIUDAD', $editor, $this->dataset, 'CIUDAD_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 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); } }
protected function AddInsertColumns(Grid $grid) { // // Edit column for USERNAME field // $editor = new TextEdit('username_edit'); $editor->SetSize(10); $editor->SetMaxLength(10); $editColumn = new CustomEditColumn('USERNAME', 'USERNAME', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $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); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for EJERCICIO_ID field // $editor = new ComboBox('ejercicio_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."EJERCICIO"'); $field = new IntegerField('EJERCICIO_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('EJERCICIO ID', 'EJERCICIO_ID', $editor, $this->dataset, 'EJERCICIO_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 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); } }
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 CreateGrid() { $result = new Grid($this, $this->dataset, 'carteraGrid'); if ($this->GetSecurityInfo()->HasDeleteGrant()) { $result->SetAllowDeleteSelected(false); } else { $result->SetAllowDeleteSelected(false); } ApplyCommonPageSettings($this, $result); $result->SetUseImagesForActions(true); $result->SetUseFixedHeader(false); $result->SetShowLineNumbers(false); $result->SetHighlightRowAtHover(false); $result->SetWidth(''); $this->CreateGridSearchControl($result); $this->CreateGridAdvancedSearchControl($result); $this->AddFieldColumns($result); $this->AddSingleRecordViewColumns($result); $this->AddEditColumns($result); $this->AddInsertColumns($result); $this->AddPrintColumns($result); $this->AddExportColumns($result); $this->AddOperationsColumns($result); $this->SetShowPageList(true); $this->SetHidePageListByDefault(false); $this->SetExportToExcelAvailable(true); $this->SetExportToWordAvailable(true); $this->SetExportToXmlAvailable(true); $this->SetExportToCsvAvailable(true); $this->SetExportToPdfAvailable(true); $this->SetPrinterFriendlyAvailable(true); $this->SetSimpleSearchAvailable(true); $this->SetAdvancedSearchAvailable(true); $this->SetFilterRowAvailable(true); $this->SetVisualEffectsEnabled(true); $this->SetShowTopPageNavigator(true); $this->SetShowBottomPageNavigator(true); // // Http Handlers // $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`clientes`'); $field = new IntegerField('idClientes', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new IntegerField('Tipo_Documento'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Num_Identificacion'); $lookupDataset->AddField($field, false); $field = new IntegerField('DV'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Primer_Apellido'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Segundo_Apellido'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Primer_Nombre'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Otros_Nombres'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('RazonSocial'); $lookupDataset->AddField($field, false); $field = new StringField('Direccion'); $lookupDataset->AddField($field, false); $field = new StringField('Cod_Dpto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Cod_Mcipio'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Pais_Domicilio'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Telefono'); $lookupDataset->AddField($field, false); $field = new StringField('Ciudad'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Contacto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('TelContacto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Email'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('CIUU'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('empresa_id'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('codigo'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('regimen'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('estado'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('RazonSocial', GetOrderTypeAsSQL(otAscending)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '')); $handler = new DynamicSearchHandler($lookupDataset, $this, 'inline_edit_Cliente_RazonSocial_search', 'idClientes', 'RazonSocial', null); GetApplication()->RegisterHTTPHandler($handler); $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`clientes`'); $field = new IntegerField('idClientes', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new IntegerField('Tipo_Documento'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Num_Identificacion'); $lookupDataset->AddField($field, false); $field = new IntegerField('DV'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Primer_Apellido'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Segundo_Apellido'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Primer_Nombre'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Otros_Nombres'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('RazonSocial'); $lookupDataset->AddField($field, false); $field = new StringField('Direccion'); $lookupDataset->AddField($field, false); $field = new StringField('Cod_Dpto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Cod_Mcipio'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Pais_Domicilio'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Telefono'); $lookupDataset->AddField($field, false); $field = new StringField('Ciudad'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Contacto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('TelContacto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Email'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('CIUU'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('empresa_id'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('codigo'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('regimen'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('estado'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('RazonSocial', GetOrderTypeAsSQL(otAscending)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '')); $handler = new DynamicSearchHandler($lookupDataset, $this, 'inline_insert_Cliente_RazonSocial_search', 'idClientes', 'RazonSocial', null); GetApplication()->RegisterHTTPHandler($handler); // // View column for Observaciones field // $column = new TextViewColumn('Observaciones', 'Observaciones', $this->dataset); $column->SetOrderable(true); /* <inline edit column> */ // // Edit column for Observaciones field // $editor = new TextAreaEdit('observaciones_edit', 50, 8); $editColumn = new CustomEditColumn('Observaciones', 'Observaciones', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $column->SetEditOperationColumn($editColumn); /* </inline edit column> */ /* <inline insert column> */ // // Edit column for Observaciones field // $editor = new TextAreaEdit('observaciones_edit', 50, 8); $editColumn = new CustomEditColumn('Observaciones', 'Observaciones', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $column->SetInsertOperationColumn($editColumn); /* </inline insert column> */ $handler = new ShowTextBlobHandler($this->dataset, $this, 'Observaciones_handler', $column); GetApplication()->RegisterHTTPHandler($handler); // // View column for Observaciones field // $column = new TextViewColumn('Observaciones', 'Observaciones', $this->dataset); $column->SetOrderable(true); $handler = new ShowTextBlobHandler($this->dataset, $this, 'Observaciones_handler', $column); GetApplication()->RegisterHTTPHandler($handler); $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`clientes`'); $field = new IntegerField('idClientes', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new IntegerField('Tipo_Documento'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Num_Identificacion'); $lookupDataset->AddField($field, false); $field = new IntegerField('DV'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Primer_Apellido'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Segundo_Apellido'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Primer_Nombre'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Otros_Nombres'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('RazonSocial'); $lookupDataset->AddField($field, false); $field = new StringField('Direccion'); $lookupDataset->AddField($field, false); $field = new StringField('Cod_Dpto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Cod_Mcipio'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Pais_Domicilio'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Telefono'); $lookupDataset->AddField($field, false); $field = new StringField('Ciudad'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Contacto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('TelContacto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Email'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('CIUU'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('empresa_id'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('codigo'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('regimen'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('estado'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('RazonSocial', GetOrderTypeAsSQL(otAscending)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '')); $handler = new DynamicSearchHandler($lookupDataset, $this, 'edit_Cliente_RazonSocial_search', 'idClientes', 'RazonSocial', null); GetApplication()->RegisterHTTPHandler($handler); $lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`clientes`'); $field = new IntegerField('idClientes', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new IntegerField('Tipo_Documento'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Num_Identificacion'); $lookupDataset->AddField($field, false); $field = new IntegerField('DV'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Primer_Apellido'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Segundo_Apellido'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Primer_Nombre'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Otros_Nombres'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('RazonSocial'); $lookupDataset->AddField($field, false); $field = new StringField('Direccion'); $lookupDataset->AddField($field, false); $field = new StringField('Cod_Dpto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Cod_Mcipio'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Pais_Domicilio'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Telefono'); $lookupDataset->AddField($field, false); $field = new StringField('Ciudad'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Contacto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('TelContacto'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('Email'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('CIUU'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('empresa_id'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('codigo'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('regimen'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('estado'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $lookupDataset->SetOrderBy('RazonSocial', GetOrderTypeAsSQL(otAscending)); $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), '')); $handler = new DynamicSearchHandler($lookupDataset, $this, 'insert_Cliente_RazonSocial_search', 'idClientes', 'RazonSocial', null); GetApplication()->RegisterHTTPHandler($handler); return $result; }
protected function AddInsertColumns(Grid $grid) { // // Edit column for no_tipo_espacio field // $editor = new TextEdit('no_tipo_espacio_edit'); $editor->SetSize(100); $editor->SetMaxLength(100); $editColumn = new CustomEditColumn('No Tipo Espacio', 'no_tipo_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 id_tipo_espacio_padre field // $editor = new ComboBox('id_tipo_espacio_padre_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset( new PgConnectionFactory(), GetConnectionOptions(), '"public"."sga_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('no_tipo_espacio', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn( 'Id Tipo Espacio Padre', 'id_tipo_espacio_padre', $editor, $this->dataset, 'id_tipo_espacio', 'no_tipo_espacio', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ds_referencia field // $editor = new TextAreaEdit('ds_referencia_edit', 50, 8); $editColumn = new CustomEditColumn('Ds Referencia', 'ds_referencia', $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 district_id field // $editor = new MultiLevelComboBoxEditor('district_id_edit', $this->CreateLinkBuilder()); $dataset0 = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."state"'); $field = new StringField('abbr'); $field->SetIsNotNull(true); $dataset0->AddField($field, true); $field = new StringField('name'); $dataset0->AddField($field, false); $editor->AddLevel($dataset0, 'abbr', 'name', $this->RenderText('State'), null); $dataset1 = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."district"'); $field = new IntegerField('id'); $field->SetIsNotNull(true); $dataset1->AddField($field, true); $field = new StringField('state'); $dataset1->AddField($field, false); $field = new StringField('name'); $dataset1->AddField($field, false); $field = new StringField('level_id'); $dataset1->AddField($field, false); $field = new IntegerField('election_div_id'); $dataset1->AddField($field, false); $editor->AddLevel($dataset1, 'id', 'name', $this->RenderText('Political District Name'), new ForeignKeyInfo('abbr', 'state')); $editColumn = new MultiLevelLookupEditColumn('Political District Name', 'district_id', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for office_id field // $editor = new MultiLevelComboBoxEditor('office_id_edit', $this->CreateLinkBuilder()); $dataset0 = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."state"'); $field = new StringField('abbr'); $field->SetIsNotNull(true); $dataset0->AddField($field, true); $field = new StringField('name'); $dataset0->AddField($field, false); $editor->AddLevel($dataset0, 'abbr', 'name', $this->RenderText('State'), null); $selectQuery = 'SELECT op.id office_id, o.title office_title, ed.id election_div_id, ed.name ed_name, ed.phys_addr_state state, concat(d.name, \' - \', o.title) officeTitle FROM office_position op JOIN district d ON op.district_id = d.id JOIN election_div ed ON d.election_div_id = ed.id JOIN office o ON op.office_id = o.id'; $insertQuery = array(); $updateQuery = array(); $deleteQuery = array(); $dataset1 = new QueryDataset(new PgConnectionFactory(), GetConnectionOptions(), $selectQuery, $insertQuery, $updateQuery, $deleteQuery, 'office_title_by_election_div'); $field = new IntegerField('office_id'); $dataset1->AddField($field, false); $field = new StringField('office_title'); $dataset1->AddField($field, false); $field = new IntegerField('election_div_id'); $dataset1->AddField($field, true); $field = new StringField('ed_name'); $dataset1->AddField($field, false); $field = new StringField('state'); $dataset1->AddField($field, false); $field = new StringField('officetitle'); $dataset1->AddField($field, false); $editor->AddLevel($dataset1, 'election_div_id', 'election_div_name', $this->RenderText('Election Division'), new ForeignKeyInfo('abbr', 'election_div_state')); $dataset2 = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."office"'); $field = new IntegerField('id'); $field->SetIsNotNull(true); $dataset2->AddField($field, true); $field = new StringField('title'); $field->SetIsNotNull(true); $dataset2->AddField($field, false); $field = new IntegerField('num_positions'); $dataset2->AddField($field, false); $field = new StringField('responsibilities'); $dataset2->AddField($field, false); $field = new IntegerField('term_length_months'); $dataset2->AddField($field, false); $field = new StringField('filing_fee'); $dataset2->AddField($field, false); $field = new BooleanField('partisan'); $dataset2->AddField($field, false); $field = new StringField('age_requirements'); $dataset2->AddField($field, false); $field = new StringField('res_requirements'); $dataset2->AddField($field, false); $field = new StringField('prof_requirements'); $dataset2->AddField($field, false); $field = new IntegerField('salary'); $dataset2->AddField($field, false); $field = new StringField('notes'); $dataset2->AddField($field, false); $field = new IntegerField('office_rank'); $dataset2->AddField($field, false); $dataset2->SetOrderBy('title', GetOrderTypeAsSQL(otAscending)); $editor->AddLevel($dataset2, 'id', 'title', $this->RenderText('Office Title'), new ForeignKeyInfo('election_div_id', 'election_div_id')); $editColumn = new MultiLevelLookupEditColumn('Office Title', 'office_id', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for office_holder_id field // $editor = new MultiLevelComboBoxEditor('office_holder_id_edit', $this->CreateLinkBuilder()); $dataset0 = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."state"'); $field = new StringField('abbr'); $field->SetIsNotNull(true); $dataset0->AddField($field, true); $field = new StringField('name'); $dataset0->AddField($field, false); $editor->AddLevel($dataset0, 'abbr', 'name', $this->RenderText('State'), null); $selectQuery = 'SELECT oh.id, oh.state, concat(oh.last_name, \', \', oh.first_name, \' \', oh.middle_name) AS fullName FROM office_holder oh ORDER BY oh.last_name, oh.first_name'; $insertQuery = array(); $updateQuery = array(); $deleteQuery = array(); $dataset1 = new QueryDataset(new PgConnectionFactory(), GetConnectionOptions(), $selectQuery, $insertQuery, $updateQuery, $deleteQuery, 'officeHolderIDs'); $field = new IntegerField('id'); $dataset1->AddField($field, false); $field = new StringField('state'); $dataset1->AddField($field, false); $field = new StringField('fullname'); $dataset1->AddField($field, false); $dataset1->SetOrderBy('fullname', GetOrderTypeAsSQL(otAscending)); $editor->AddLevel($dataset1, 'id', 'fullname', $this->RenderText('Office Holder Id'), new ForeignKeyInfo('abbr', 'state')); $editColumn = new MultiLevelLookupEditColumn('Office Holder Id', 'office_holder_id', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for position_name field // $editor = new TextEdit('position_name_edit'); $editor->SetSize(25); $editor->SetMaxLength(25); $editColumn = new CustomEditColumn('Position Name', 'position_name', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for term_start field // $editor = new DateTimeEdit('term_start_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Term Start', 'term_start', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for term_end field // $editor = new DateTimeEdit('term_end_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Term End', 'term_end', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for filing_deadline field // $editor = new DateTimeEdit('filing_deadline_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Filing Deadline', 'filing_deadline', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for next_election field // $editor = new DateTimeEdit('next_election_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Next Election', 'next_election', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $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 office_rank field // $editor = new TextEdit('office_rank_edit'); $editColumn = new CustomEditColumn('Office Rank', 'office_rank', $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(10); $editor->SetMaxLength(10); $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 ES_ADMIN field // $editor = new TextEdit('es_admin_edit'); $editor->SetSize(1); $editor->SetMaxLength(1); $editColumn = new CustomEditColumn('ES ADMIN', 'ES_ADMIN', $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 NACIMIENTO field // $editor = new DateTimeEdit('nacimiento_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('NACIMIENTO', 'NACIMIENTO', $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(30); $editor->SetMaxLength(30); $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(50); $editor->SetMaxLength(50); $editColumn = new CustomEditColumn('SEGUNDO APELLIDO', 'SEGUNDO_APELLIDO', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for NOMBRE field // $editor = new TextEdit('nombre_edit'); $editor->SetSize(40); $editor->SetMaxLength(40); $editColumn = new CustomEditColumn('NOMBRE', 'NOMBRE', $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 GENERO_ID field // $editor = new ComboBox('genero_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."GENERO"'); $field = new IntegerField('GENERO_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('GENERO ID', 'GENERO_ID', $editor, $this->dataset, 'GENERO_ID', 'NOMBRE', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for CIUDAD_ID field // $editor = new ComboBox('ciudad_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."CIUDAD"'); $field = new IntegerField('CIUDAD_ID'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('NOMBRE'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new IntegerField('PAIS_ID'); $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('CIUDAD ID', 'CIUDAD_ID', $editor, $this->dataset, 'CIUDAD_ID', 'NOMBRE', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for SLOGAN field // $editor = new TextAreaEdit('slogan_edit', 50, 8); $editColumn = new CustomEditColumn('SLOGAN', 'SLOGAN', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for EMAIL field // $editor = new TextAreaEdit('email_edit', 50, 8); $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 CLAVE field // $editor = new TextEdit('clave_edit'); $editor->SetSize(20); $editor->SetMaxLength(20); $editColumn = new CustomEditColumn('CLAVE', 'CLAVE', $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); } }
protected function AddInsertColumns(Grid $grid) { // // Edit column for ofa-numoff field // $editor = new TextEdit('ofa-numoff_edit'); $editColumn = new CustomEditColumn('Numero Offerta', 'ofa-numoff', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ofa-codart field // $editor = new ComboBox('ofa-codart_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect')); $lookupDataset = new TableDataset(new MyPDOConnectionFactory(), GetConnectionOptions(), '`articoli`'); $field = new IntegerField('id', null, null, true); $field->SetIsNotNull(true); $lookupDataset->AddField($field, true); $field = new StringField('art-codart'); $field->SetIsNotNull(true); $lookupDataset->AddField($field, false); $field = new StringField('art-descart'); $lookupDataset->AddField($field, false); $field = new StringField('art-dessup'); $lookupDataset->AddField($field, false); $field = new StringField('art-codprod'); $lookupDataset->AddField($field, false); $field = new StringField('art-codfam'); $lookupDataset->AddField($field, false); $field = new StringField('unita_misura'); $lookupDataset->AddField($field, false); $field = new StringField('art-gruppo-merc'); $lookupDataset->AddField($field, false); $field = new StringField('art-categoria-omogenea'); $lookupDataset->AddField($field, false); $field = new IntegerField('art-lungsmu'); $lookupDataset->AddField($field, false); $field = new DateTimeField('datains'); $lookupDataset->AddField($field, false); $field = new DateTimeField('datamod'); $lookupDataset->AddField($field, false); $lookupDataset->setOrderByField('art-descart', GetOrderTypeAsSQL(otAscending)); $editColumn = new LookUpEditColumn('Codice articolo', 'ofa-codart', $editor, $this->dataset, 'art-codart', 'art-descart', $lookupDataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ofa-descart field // $editor = new TextEdit('ofa-descart_edit'); $editor->SetSize(45); $editor->SetMaxLength(45); $editColumn = new CustomEditColumn('Ofa-descart', 'ofa-descart', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ofa-lunghezza field // $editor = new TextEdit('ofa-lunghezza_edit'); $editColumn = new CustomEditColumn('Lunghezza', 'ofa-lunghezza', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ofa-larghezza field // $editor = new TextEdit('ofa-larghezza_edit'); $editColumn = new CustomEditColumn('Ofa-larghezza', 'ofa-larghezza', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ofa-spessore field // $editor = new TextEdit('ofa-spessore_edit'); $editColumn = new CustomEditColumn('Ofa-spessore', 'ofa-spessore', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ofa-quantita field // $editor = new TextEdit('ofa-quantita_edit'); $editColumn = new CustomEditColumn('Ofa-quantita', 'ofa-quantita', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ofa-przacq-net field // $editor = new TextEdit('ofa-przacq-net_edit'); $editColumn = new CustomEditColumn('Ofa-przacq-net', 'ofa-przacq-net', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ofa-przacq-lor field // $editor = new TextEdit('ofa-przacq-lor_edit'); $editColumn = new CustomEditColumn('Ofa-przacq-lor', 'ofa-przacq-lor', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ofa-totuni field // $editor = new TextEdit('ofa-totuni_edit'); $editColumn = new CustomEditColumn('Ofa-totuni', 'ofa-totuni', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ofa-totunit-fin field // $editor = new TextEdit('ofa-totunit-fin_edit'); $editColumn = new CustomEditColumn('Ofa-totunit-fin', 'ofa-totunit-fin', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ofa-totgen field // $editor = new TextEdit('ofa-totgen_edit'); $editColumn = new CustomEditColumn('Ofa-totgen', 'ofa-totgen', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for ofa-przven field // $editor = new TextEdit('ofa-przven_edit'); $editColumn = new CustomEditColumn('Ofa-przven', 'ofa-przven', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for datains field // $editor = new DateTimeEdit('datains_edit', true, 'Y-m-d H:i:s', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Datains', 'datains', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); // // Edit column for datamod field // $editor = new DateTimeEdit('datamod_edit', true, 'Y-m-d H:i:s', GetFirstDayOfWeek()); $editColumn = new CustomEditColumn('Datamod', 'datamod', $editor, $this->dataset); $editColumn->SetAllowSetToNull(true); $editColumn->SetAllowSetToDefault(true); $this->ApplyCommonColumnEditProperties($editColumn); $grid->AddInsertColumn($editColumn); if ($this->GetSecurityInfo()->HasAddGrant()) { $grid->SetShowAddButton(true); $grid->SetShowInlineAddButton(false); } else { $grid->SetShowInlineAddButton(false); $grid->SetShowAddButton(false); } }