コード例 #1
0
ファイル: clientes.php プロジェクト: Kenovix/san-miguel
 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;
 }
コード例 #2
0
 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('Programm Id', 'programm_id', $editor, $this->dataset, 'program_id', 'program_name', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for project_name field
     //
     $editor = new TextAreaEdit('project_name_edit', 50, 8);
     $editColumn = new CustomEditColumn('Project Name', 'project_name', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $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->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for date_end field
     //
     $editor = new DateTimeEdit('date_end_edit', true, 'Y-m-d H:i:s', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Date End', 'date_end', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for approved_budget field
     //
     $editor = new TextEdit('approved_budget_edit');
     $editColumn = new CustomEditColumn('Approved Budget', 'approved_budget', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $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);
     $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 priority field
     //
     $editor = new TextEdit('priority_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Priority', 'priority', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for lead field
     //
     $editor = new TextEdit('lead_edit');
     $editor->SetSize(50);
     $editor->SetMaxLength(50);
     $editColumn = new CustomEditColumn('Lead', 'lead', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for level_of_service field
     //
     $editor = new TextEdit('level_of_service_edit');
     $editor->SetSize(55);
     $editor->SetMaxLength(55);
     $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 multi_year field
     //
     $editor = new TextEdit('multi_year_edit');
     $editor->SetSize(10);
     $editor->SetMaxLength(10);
     $editColumn = new CustomEditColumn('Multi Year', 'multi_year', $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);
     //
     // Edit column for public_engagement field
     //
     $editor = new TextEdit('public_engagement_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Public Engagement', 'public_engagement', $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 year field
     //
     $editor = new TextEdit('year_edit');
     $editor->SetSize(4);
     $editor->SetMaxLength(4);
     $editColumn = new CustomEditColumn('Year', 'year', $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 TextEdit('approved_edit');
     $editor->SetSize(10);
     $editor->SetMaxLength(10);
     $editColumn = new CustomEditColumn('Approved', 'approved', $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);
     //
     // Edit column for progress field
     //
     $editor = new TextEdit('progress_edit');
     $editor->SetSize(11);
     $editor->SetMaxLength(11);
     $editColumn = new CustomEditColumn('Progress', 'progress', $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 TextEdit('dept_id_edit');
     $editColumn = new CustomEditColumn('Dept Id', 'dept_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 budget_spent field
     //
     $editor = new TextEdit('budget_spent_edit');
     $editColumn = new CustomEditColumn('Budget Spent', 'budget_spent', $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);
     }
 }
コード例 #3
0
ファイル: periodicidad.php プロジェクト: jsrxar/dto
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for no_periodicidad field
     //
     $editor = new TextEdit('no_periodicidad_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Nombre Periodicidad', 'no_periodicidad', $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 va_frecuencia field
     //
     $editor = new TextEdit('va_frecuencia_edit');
     $editColumn = new CustomEditColumn('Frecuencia', 'va_frecuencia', $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);
     }
 }
コード例 #4
0
ファイル: GE.ESTADO_CIVIL.php プロジェクト: kcallow/MatchMe
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for ESTADO_CIVIL_ID field
     //
     $editor = new TextEdit('estado_civil_id_edit');
     $editColumn = new CustomEditColumn('ESTADO CIVIL ID', 'ESTADO_CIVIL_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(20);
     $editor->SetMaxLength(20);
     $editColumn = new CustomEditColumn('NOMBRE', 'NOMBRE', $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);
     }
 }
コード例 #5
0
ファイル: Priority.php プロジェクト: BCDevExchange/WORKPLAN
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for Name field
     //
     $editor = new TextEdit('name_edit');
     $editor->SetSize(50);
     $editor->SetMaxLength(50);
     $editColumn = new CustomEditColumn('Name', '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);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
コード例 #6
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for project_id field
     //
     $editor = new TextEdit('project_id_edit');
     $editColumn = new CustomEditColumn('Project Id', 'project_id', $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);
     //
     // Edit column for project_type field
     //
     $editor = new TextEdit('project_type_edit');
     $editor->SetSize(50);
     $editor->SetMaxLength(50);
     $editColumn = new CustomEditColumn('Project Type', 'project_type', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for project_name field
     //
     $editor = new TextAreaEdit('project_name_edit', 50, 8);
     $editColumn = new CustomEditColumn('Project Name', 'project_name', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for date_start field
     //
     $editor = new DateTimeEdit('date_start_edit', true, 'Y-m-d H:i:s', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Date Start', 'date_start', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for date_end field
     //
     $editor = new DateTimeEdit('date_end_edit', true, 'Y-m-d H:i:s', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Date End', 'date_end', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for year field
     //
     $editor = new TextEdit('year_edit');
     $editor->SetSize(4);
     $editor->SetMaxLength(4);
     $editColumn = new CustomEditColumn('Year', 'year', $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 Objective field
     //
     $editor = new TextEdit('objective_edit');
     $editColumn = new CustomEditColumn('Objective', 'Objective', $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 priority field
     //
     $editor = new TextEdit('priority_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Priority', 'priority', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for project_lead field
     //
     $editor = new TextEdit('project_lead_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Project Lead', 'project_lead', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for approved_budget field
     //
     $editor = new TextEdit('approved_budget_edit');
     $editColumn = new CustomEditColumn('Approved Budget', 'approved_budget', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for budget_spent field
     //
     $editor = new TextEdit('budget_spent_edit');
     $editColumn = new CustomEditColumn('Budget Spent', 'budget_spent', $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 multi_year field
     //
     $editor = new TextEdit('multi_year_edit');
     $editor->SetSize(10);
     $editor->SetMaxLength(10);
     $editColumn = new CustomEditColumn('Multi Year', 'multi_year', $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);
     //
     // Edit column for public_engagement field
     //
     $editor = new TextEdit('public_engagement_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Public Engagement', 'public_engagement', $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 level_of_service field
     //
     $editor = new TextEdit('level_of_service_edit');
     $editor->SetSize(55);
     $editor->SetMaxLength(55);
     $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_by_cao field
     //
     $editor = new TextEdit('approved_by_cao_edit');
     $editor->SetSize(10);
     $editor->SetMaxLength(10);
     $editColumn = new CustomEditColumn('Approved By Cao', 'approved_by_cao', $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);
     //
     // Edit column for progress field
     //
     $editor = new TextEdit('progress_edit');
     $editor->SetSize(11);
     $editor->SetMaxLength(11);
     $editColumn = new CustomEditColumn('Progress', 'progress', $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 DEPARTMENT field
     //
     $editor = new TextEdit('department_edit');
     $editor->SetSize(20);
     $editor->SetMaxLength(20);
     $editColumn = new CustomEditColumn('DEPARTMENT', 'DEPARTMENT', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for total_hours field
     //
     $editor = new TextEdit('total_hours_edit');
     $editColumn = new CustomEditColumn('Total Hours', 'total_hours', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for assigned_hours field
     //
     $editor = new TextEdit('assigned_hours_edit');
     $editColumn = new CustomEditColumn('Assigned Hours', 'assigned_hours', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for assigned_progress field
     //
     $editor = new TextEdit('assigned_progress_edit');
     $editColumn = new CustomEditColumn('Assigned Progress', 'assigned_progress', $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);
     }
 }
コード例 #7
0
ファイル: GE.EVENTO.php プロジェクト: kcallow/MatchMe
 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);
     }
 }
コード例 #8
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for IP field
     //
     $editor = new TextEdit('ip_edit');
     $editor->SetSize(25);
     $editor->SetMaxLength(25);
     $editColumn = new CustomEditColumn('IP', 'IP', $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 NomMachine field
     //
     $editor = new TextEdit('nommachine_edit');
     $editor->SetSize(50);
     $editor->SetMaxLength(50);
     $editColumn = new CustomEditColumn('NomMachine', 'NomMachine', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for EtatMachine field
     //
     $editor = new CheckBox('etatmachine_edit');
     $editColumn = new CustomEditColumn('EtatMachine', 'EtatMachine', $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 Service1 field
     //
     $editor = new CheckBox('service1_edit');
     $editColumn = new CustomEditColumn('Service1', 'Service1', $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 Service2 field
     //
     $editor = new CheckBox('service2_edit');
     $editColumn = new CustomEditColumn('Service2', 'Service2', $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 Service3 field
     //
     $editor = new CheckBox('service3_edit');
     $editColumn = new CustomEditColumn('Service3', 'Service3', $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);
     }
 }
コード例 #9
0
 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);
     }
 }
コード例 #10
0
 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);
     }
 }
コード例 #11
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for programm_id field
     //
     $editor = new ComboBox('programm_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $editColumn = new CustomEditColumn('Project Type', 'programm_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 project_name field
     //
     $editor = new TextEdit('project_name_edit');
     $editor->SetSize(50);
     $editor->SetMaxLength(100);
     $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', false, 'Y-m-d', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Date End', 'date_end', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for approved_budget field
     //
     $editor = new TextEdit('approved_budget_edit');
     $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 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'));
     $editColumn = new CustomEditColumn('Priority', 'priority', $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 lead field
     //
     $editor = new ComboBox('lead_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $editColumn = new CustomEditColumn('Lead', 'lead', $editor, $this->dataset);
     $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 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 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);
     $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');
     $editor->SetSize(4);
     $editor->SetMaxLength(4);
     $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 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->SetInsertDefaultValue($this->RenderText('0'));
     $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'));
     $editColumn = new CustomEditColumn('Department', 'dept_id', $editor, $this->dataset);
     $editColumn->SetInsertDefaultValue($this->RenderText('%DEPT_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 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 NumberValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('NumberValidationMessage'), $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);
     }
 }
コード例 #12
0
ファイル: cartera.php プロジェクト: Kenovix/san-miguel
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for Cliente field
     //
     $editor = new AutocomleteComboBox('cliente_edit', $this->CreateLinkBuilder());
     $editor->SetSize('250px');
     $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));
     $editColumn = new DynamicLookupEditColumn('Cliente', 'Cliente', 'Cliente_RazonSocial', 'insert_Cliente_RazonSocial_search', $editor, $this->dataset, $lookupDataset, 'idClientes', 'RazonSocial', '');
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Telefono field
     //
     $editor = new TextEdit('telefono_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Telefono', 'Telefono', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Contacto field
     //
     $editor = new TextEdit('contacto_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Contacto', 'Contacto', $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 TelContacto field
     //
     $editor = new TextEdit('telcontacto_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('TelContacto', 'TelContacto', $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 Saldo field
     //
     $editor = new TextEdit('saldo_edit');
     $editColumn = new CustomEditColumn('Saldo', 'Saldo', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for FechaVencimiento field
     //
     $editor = new TextEdit('fechavencimiento_edit');
     $editor->SetSize(20);
     $editor->SetMaxLength(20);
     $editColumn = new CustomEditColumn('FechaVencimiento', 'FechaVencimiento', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for DiasCartera field
     //
     $editor = new TextEdit('diascartera_edit');
     $editColumn = new CustomEditColumn('DiasCartera', 'DiasCartera', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // 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);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Facturas_idFacturas field
     //
     $editor = new TextEdit('facturas_idfacturas_edit');
     $editColumn = new CustomEditColumn('Facturas IdFacturas', 'Facturas_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);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
コード例 #13
0
ファイル: tipo_lavorazioni.php プロジェクト: eroncalli/atig
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for lav-codlav field
     //
     $editor = new TextEdit('lav-codlav_edit');
     $editor->SetSize(10);
     $editor->SetMaxLength(10);
     $editColumn = new CustomEditColumn('Lav-codlav', 'lav-codlav', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for lav-descriz field
     //
     $editor = new TextEdit('lav-descriz_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Lav-descriz', 'lav-descriz', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for lav-critcalc field
     //
     $editor = new TextEdit('lav-critcalc_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Lav-critcalc', 'lav-critcalc', $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);
     }
 }
コード例 #14
0
 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);
     }
 }
コード例 #15
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for cli-codcli field
     //
     $editor = new TextEdit('cli-codcli_edit');
     $editor->SetSize(15);
     $editor->SetMaxLength(15);
     $editColumn = new CustomEditColumn('Cli-codcli', 'cli-codcli', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for descrizione field
     //
     $editor = new TextAreaEdit('descrizione_edit', 50, 8);
     $editColumn = new CustomEditColumn('Descrizione', 'descrizione', $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);
     }
 }
コード例 #16
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for DEPARTMENT field
     //
     $editor = new TextEdit('department_edit');
     $editor->SetSize(20);
     $editor->SetMaxLength(20);
     $editColumn = new CustomEditColumn('Department', 'DEPARTMENT', $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 LOCATION field
     //
     $editor = new TextEdit('location_edit');
     $editor->SetSize(20);
     $editor->SetMaxLength(20);
     $editColumn = new CustomEditColumn('Location', 'LOCATION', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for PHONE_NO field
     //
     $editor = new TextEdit('phone_no_edit');
     $editor->SetSize(20);
     $editor->SetMaxLength(20);
     $editColumn = new CustomEditColumn('Phone No', 'PHONE_NO', $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);
     }
 }
コード例 #17
0
ファイル: empresa.php プロジェクト: Kenovix/san-miguel
 protected function CreateGrid()
 {
     $result = new Grid($this, $this->dataset, 'empresaGrid');
     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 nombre field
     //
     $column = new TextViewColumn('nombre', 'Nombre', $this->dataset);
     $column->SetOrderable(true);
     /* <inline edit column> */
     //
     // Edit column for nombre field
     //
     $editor = new TextEdit('nombre_edit');
     $editor->SetSize(80);
     $editor->SetMaxLength(80);
     $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);
     $column->SetEditOperationColumn($editColumn);
     /* </inline edit column> */
     /* <inline insert column> */
     //
     // Edit column for nombre field
     //
     $editor = new TextEdit('nombre_edit');
     $editor->SetSize(80);
     $editor->SetMaxLength(80);
     $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);
     $column->SetInsertOperationColumn($editColumn);
     /* </inline insert column> */
     $handler = new ShowTextBlobHandler($this->dataset, $this, 'nombre_handler', $column);
     GetApplication()->RegisterHTTPHandler($handler);
     //
     // View column for depto field
     //
     $column = new TextViewColumn('depto', 'Depto', $this->dataset);
     $column->SetOrderable(true);
     /* <inline edit column> */
     //
     // Edit column for depto field
     //
     $editor = new TextAreaEdit('depto_edit', 50, 8);
     $editColumn = new CustomEditColumn('Depto', 'depto', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetEditOperationColumn($editColumn);
     /* </inline edit column> */
     /* <inline insert column> */
     //
     // Edit column for depto field
     //
     $editor = new TextAreaEdit('depto_edit', 50, 8);
     $editColumn = new CustomEditColumn('Depto', 'depto', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetInsertOperationColumn($editColumn);
     /* </inline insert column> */
     $handler = new ShowTextBlobHandler($this->dataset, $this, 'depto_handler', $column);
     GetApplication()->RegisterHTTPHandler($handler);
     //
     // View column for mupio field
     //
     $column = new TextViewColumn('mupio', 'Mupio', $this->dataset);
     $column->SetOrderable(true);
     /* <inline edit column> */
     //
     // Edit column for mupio field
     //
     $editor = new TextAreaEdit('mupio_edit', 50, 8);
     $editColumn = new CustomEditColumn('Mupio', 'mupio', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetEditOperationColumn($editColumn);
     /* </inline edit column> */
     /* <inline insert column> */
     //
     // Edit column for mupio field
     //
     $editor = new TextAreaEdit('mupio_edit', 50, 8);
     $editColumn = new CustomEditColumn('Mupio', 'mupio', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetInsertOperationColumn($editColumn);
     /* </inline insert column> */
     $handler = new ShowTextBlobHandler($this->dataset, $this, 'mupio_handler', $column);
     GetApplication()->RegisterHTTPHandler($handler);
     //
     // View column for nombre field
     //
     $column = new TextViewColumn('nombre', 'Nombre', $this->dataset);
     $column->SetOrderable(true);
     $handler = new ShowTextBlobHandler($this->dataset, $this, 'nombre_handler', $column);
     GetApplication()->RegisterHTTPHandler($handler);
     //
     // View column for depto field
     //
     $column = new TextViewColumn('depto', 'Depto', $this->dataset);
     $column->SetOrderable(true);
     $handler = new ShowTextBlobHandler($this->dataset, $this, 'depto_handler', $column);
     GetApplication()->RegisterHTTPHandler($handler);
     //
     // View column for mupio field
     //
     $column = new TextViewColumn('mupio', 'Mupio', $this->dataset);
     $column->SetOrderable(true);
     $handler = new ShowTextBlobHandler($this->dataset, $this, 'mupio_handler', $column);
     GetApplication()->RegisterHTTPHandler($handler);
     return $result;
 }
コード例 #18
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for task_name field
     //
     $editor = new TextEdit('task_name_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Task Name', 'task_name', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for priority_name field
     //
     $editor = new TextEdit('priority_name_edit');
     $editor->SetSize(50);
     $editor->SetMaxLength(50);
     $editColumn = new CustomEditColumn('Priority Name', 'priority_name', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for public_engagement field
     //
     $editor = new TextEdit('public_engagement_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $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 TextEdit('level_of_service_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Level Of Service', 'level_of_service', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for project_type field
     //
     $editor = new TextEdit('project_type_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Project Type', 'project_type', $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);
     }
 }
コード例 #19
0
ファイル: listino_articoli.php プロジェクト: eroncalli/atig
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for lis-codart field
     //
     $editor = new AutocomleteComboBox('lis-codart_edit', $this->CreateLinkBuilder());
     $editor->SetSize('350px');
     $editor->setAllowClear(true);
     $editor->setMinimumInputLength(0);
     $lookupDataset = new TableDataset(new MyPDOConnectionFactory(), GetConnectionOptions(), '`elenco_articoli_view`');
     $field = new StringField('art-codart');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $field = new StringField('descrizione');
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('descrizione', GetOrderTypeAsSQL(otAscending));
     $editColumn = new DynamicLookupEditColumn('Codice Articolo', 'lis-codart', 'lis-codart_descrizione', 'insert_lis-codart_descrizione_search', $editor, $this->dataset, $lookupDataset, 'art-codart', 'descrizione', '');
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for lisdesc field
     //
     $editor = new TextEdit('lisdesc_edit');
     $editor->SetSize(100);
     $editColumn = new CustomEditColumn('Descrizione', 'lisdesc', $editor, $this->dataset);
     $editColumn->SetReadOnly(true);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for lis-unimis field
     //
     $editor = new ComboBox('lis-unimis_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $editor->AddValue('N', $this->RenderText('Nessuna'));
     $editor->AddValue('LT', $this->RenderText('Litri'));
     $editor->AddValue('KG', $this->RenderText('Chili'));
     $editor->AddValue('CF', $this->RenderText('Confezione'));
     $editor->AddValue('MC', $this->RenderText('Metri cubi'));
     $editor->AddValue('MT', $this->RenderText('Metri'));
     $editColumn = new CustomEditColumn('Unità misura', 'lis-unimis', $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 lis-przacq field
     //
     $editor = new TextEdit('lis-przacq_edit');
     $editColumn = new CustomEditColumn('Prezzo acquisto', 'lis-przacq', $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);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for lis-moltipl field
     //
     $editor = new TextEdit('lis-moltipl_edit');
     $editColumn = new CustomEditColumn('Moltiplicatore', 'lis-moltipl', $editor, $this->dataset);
     $editColumn->SetReadOnly(true);
     $editColumn->SetInsertDefaultValue($this->RenderText('5'));
     $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 lis-oneriacc field
     //
     $editor = new TextEdit('lis-oneriacc_edit');
     $editor->SetSuffix($this->RenderText('%'));
     $editColumn = new CustomEditColumn('Oneri e accessori', 'lis-oneriacc', $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);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for lis-scarto field
     //
     $editor = new TextEdit('lis-scarto_edit');
     $editor->SetSuffix($this->RenderText('%'));
     $editColumn = new CustomEditColumn('Scarto', 'lis-scarto', $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);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for lis-dataini field
     //
     $editor = new DateTimeEdit('lis-dataini_edit', false, 'd-m-Y', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Data inizio decorrenza', 'lis-dataini', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATETIME%'));
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for lis-datafin field
     //
     $editor = new DateTimeEdit('lis-datafin_edit', false, 'd-m-Y', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Data fine decorrenza', 'lis-datafin', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $editColumn->SetInsertDefaultValue($this->RenderText('31-12-9999'));
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
コード例 #20
0
ファイル: cuentas.php プロジェクト: Kenovix/san-miguel
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for idPUC field
     //
     $editor = new TextEdit('idpuc_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('IdPUC', 'idPUC', $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(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Nombre', 'Nombre', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for Valor field
     //
     $editor = new TextEdit('valor_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('Valor', 'Valor', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for GupoCuentas_PUC field
     //
     $editor = new TextEdit('gupocuentas_puc_edit');
     $editor->SetSize(45);
     $editor->SetMaxLength(45);
     $editColumn = new CustomEditColumn('GupoCuentas PUC', 'GupoCuentas_PUC', $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);
     }
 }
コード例 #21
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for first_name field
     //
     $editor = new TextEdit('first_name_edit');
     $editor->SetSize(25);
     $editor->SetMaxLength(25);
     $editColumn = new CustomEditColumn('First Name', 'first_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 middle_name field
     //
     $editor = new TextEdit('middle_name_edit');
     $editor->SetSize(25);
     $editor->SetMaxLength(25);
     $editColumn = new CustomEditColumn('Middle Name', 'middle_name', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for last_name field
     //
     $editor = new TextEdit('last_name_edit');
     $editor->SetSize(25);
     $editor->SetMaxLength(25);
     $editColumn = new CustomEditColumn('Last Name', 'last_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 party_affiliation field
     //
     $editor = new TextEdit('party_affiliation_edit');
     $editor->SetSize(1);
     $editor->SetMaxLength(1);
     $editColumn = new CustomEditColumn('Party Affiliation', 'party_affiliation', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for address1 field
     //
     $editor = new TextEdit('address1_edit');
     $editor->SetSize(25);
     $editor->SetMaxLength(25);
     $editColumn = new CustomEditColumn('Address1', 'address1', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for address2 field
     //
     $editor = new TextEdit('address2_edit');
     $editor->SetSize(25);
     $editor->SetMaxLength(25);
     $editColumn = new CustomEditColumn('Address2', 'address2', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for city field
     //
     $editor = new TextEdit('city_edit');
     $editor->SetSize(25);
     $editor->SetMaxLength(25);
     $editColumn = new CustomEditColumn('City', 'city', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for state field
     //
     $editor = new TextEdit('state_edit');
     $editor->SetSize(2);
     $editor->SetMaxLength(2);
     $editColumn = new CustomEditColumn('State', 'state', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for zip field
     //
     $editor = new TextEdit('zip_edit');
     $editor->SetSize(5);
     $editor->SetMaxLength(5);
     $editColumn = new CustomEditColumn('Zip', 'zip', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for phone field
     //
     $editor = new TextEdit('phone_edit');
     $editor->SetSize(15);
     $editor->SetMaxLength(15);
     $editColumn = new CustomEditColumn('Phone', 'phone', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for fax field
     //
     $editor = new TextEdit('fax_edit');
     $editor->SetSize(15);
     $editor->SetMaxLength(15);
     $editColumn = new CustomEditColumn('Fax', 'fax', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for email_address field
     //
     $editor = new TextEdit('email_address_edit');
     $editor->SetSize(30);
     $editor->SetMaxLength(30);
     $editColumn = new CustomEditColumn('Email Address', 'email_address', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for website field
     //
     $editor = new TextEdit('website_edit');
     $editor->SetSize(50);
     $editor->SetMaxLength(50);
     $editColumn = new CustomEditColumn('Website', 'website', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for photo_link field
     //
     $editor = new TextAreaEdit('photo_link_edit', 50, 8);
     $editColumn = new CustomEditColumn('Photo Link', 'photo_link', $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);
     if ($this->GetSecurityInfo()->HasAddGrant()) {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     } else {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
コード例 #22
0
ファイル: facturas.php プロジェクト: Kenovix/san-miguel
 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);
     }
 }
コード例 #23
0
 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);
     }
 }
コード例 #24
0
ファイル: GE.webreports.php プロジェクト: kcallow/MatchMe
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for rpt_id field
     //
     $editor = new TextEdit('rpt_id_edit');
     $editColumn = new CustomEditColumn('Rpt Id', 'rpt_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 rpt_name field
     //
     $editor = new TextEdit('rpt_name_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Rpt Name', 'rpt_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 rpt_title field
     //
     $editor = new TextAreaEdit('rpt_title_edit', 50, 8);
     $editColumn = new CustomEditColumn('Rpt Title', 'rpt_title', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for rpt_cdate field
     //
     $editor = new DateTimeEdit('rpt_cdate_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Rpt Cdate', 'rpt_cdate', $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 rpt_mdate field
     //
     $editor = new DateTimeEdit('rpt_mdate_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek());
     $editColumn = new CustomEditColumn('Rpt Mdate', 'rpt_mdate', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for rpt_content field
     //
     $editor = new ImageUploader('rpt_content_edit');
     $editor->SetShowImage(false);
     $editColumn = new FileUploadingColumn('Rpt Content', 'rpt_content', $editor, $this->dataset, false, false, 'GE_webreportsGrid_rpt_content_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 rpt_owner field
     //
     $editor = new TextEdit('rpt_owner_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Rpt Owner', 'rpt_owner', $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 rpt_status field
     //
     $editor = new TextEdit('rpt_status_edit');
     $editor->SetSize(10);
     $editor->SetMaxLength(10);
     $editColumn = new CustomEditColumn('Rpt Status', 'rpt_status', $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);
     //
     // Edit column for rpt_type field
     //
     $editor = new TextEdit('rpt_type_edit');
     $editor->SetSize(10);
     $editor->SetMaxLength(10);
     $editColumn = new CustomEditColumn('Rpt Type', 'rpt_type', $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);
     }
 }
コード例 #25
0
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for ofv-numoff field
     //
     $editor = new TextEdit('ofv-numoff_edit');
     $editColumn = new CustomEditColumn('Ofv-numoff', 'ofv-numoff', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ofv-codvoce field
     //
     $editor = new TextEdit('ofv-codvoce_edit');
     $editColumn = new CustomEditColumn('Ofv-codvoce', 'ofv-codvoce', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ofv-quantita field
     //
     $editor = new TextEdit('ofv-quantita_edit');
     $editColumn = new CustomEditColumn('Ofv-quantita', 'ofv-quantita', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ofv-lunghezza field
     //
     $editor = new TextEdit('ofv-lunghezza_edit');
     $editColumn = new CustomEditColumn('Ofv-lunghezza', 'ofv-lunghezza', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ofv-larghezza field
     //
     $editor = new TextEdit('ofv-larghezza_edit');
     $editColumn = new CustomEditColumn('Ofv-larghezza', 'ofv-larghezza', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ofv-tiposmu field
     //
     $editor = new TextEdit('ofv-tiposmu_edit');
     $editor->SetSize(1);
     $editor->SetMaxLength(1);
     $editColumn = new CustomEditColumn('Ofv-tiposmu', 'ofv-tiposmu', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ofv-przacq field
     //
     $editor = new TextEdit('ofv-przacq_edit');
     $editColumn = new CustomEditColumn('Ofv-przacq', 'ofv-przacq', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ofv-sconto field
     //
     $editor = new TextEdit('ofv-sconto_edit');
     $editColumn = new CustomEditColumn('Ofv-sconto', 'ofv-sconto', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ofv-valuni-cal field
     //
     $editor = new TextEdit('ofv-valuni-cal_edit');
     $editColumn = new CustomEditColumn('Ofv-valuni-cal', 'ofv-valuni-cal', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     //
     // Edit column for ofv-valuni-fin field
     //
     $editor = new TextEdit('ofv-valuni-fin_edit');
     $editColumn = new CustomEditColumn('Ofv-valuni-fin', 'ofv-valuni-fin', $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);
     }
 }
コード例 #26
0
ファイル: offerte.php プロジェクト: eroncalli/atig
 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);
     }
 }
コード例 #27
0
ファイル: tipo_espacio.php プロジェクト: jsrxar/dto
 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);
     }
 }
コード例 #28
0
 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);
     }
 }
コード例 #29
0
ファイル: GE.PERSONA.php プロジェクト: kcallow/MatchMe
 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);
     }
 }
コード例 #30
0
 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);
     }
 }