本文整理汇总了PHP中GetFirstDayOfWeek函数的典型用法代码示例。如果您正苦于以下问题:PHP GetFirstDayOfWeek函数的具体用法?PHP GetFirstDayOfWeek怎么用?PHP GetFirstDayOfWeek使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetFirstDayOfWeek函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for year field
//
$editor = new TextEdit('year_edit');
$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 pay_period_number field
//
$editor = new ComboBox('pay_period_number_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$editColumn = new CustomEditColumn('Pay Period Number', 'pay_period_number', $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 start_date field
//
$editor = new DateTimeEdit('start_date_edit', true, 'Y-m-d H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Start Date', 'start_date', $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 end_date field
//
$editor = new DateTimeEdit('end_date_edit', true, 'Y-m-d H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('End Date', 'end_date', $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);
}
}
示例2: GetFilterRowViewData
public function GetFilterRowViewData()
{
$result = array();
$result['Columns'] = array();
$advancedSearch = $this->GetPage()->AdvancedSearchControl;
$bands = $this->GetViewBands();
$isActionButtonPositionLeft = $bands[0]->GetName() == 'actions';
if ($advancedSearch && $this->GetFilterRowAvailable()) {
foreach ($this->GetViewBands() as $band) {
foreach ($band->GetColumns() as $column) {
$searchColumnViewData = null;
$columnName = $this->GetDataset()->IsLookupField($column->GetName()) ? $this->GetDataset()->IsLookupFieldNameByDisplayFieldName($column->GetName()) : $column->GetName();
$searchColumn = null;
if ($column instanceof CustomDatasetFieldViewColumn || $column instanceof CustomFormatValueViewColumnDecorator || $column instanceof ImageViewColumn) {
$searchColumn = $advancedSearch->FindSearchColumnByName($columnName);
}
if ($searchColumn) {
$searchColumnViewData = array();
$searchColumnViewData['FieldName'] = $columnName;
$searchColumnViewData['Value'] = $searchColumn->GetValue();
$searchColumnViewData['Attributes'] = '';
if ($column instanceof DateTimeViewColumn) {
$searchColumnViewData['Attributes'] = 'data-calendar="true" ' . 'data-picker-first-day-of-week="' . GetFirstDayOfWeek() . '" ';
} else {
if ($searchColumn instanceof LookupSearchColumn) {
$searchColumnViewData['Attributes'] = 'data-pg-typeahead="true" ' . 'data-pg-typeahead-handler="' . $searchColumn->GetHandlerName() . '" ' . 'data-post-value="' . $searchColumn->GetValue() . '"';
$searchColumnViewData['Value'] = $searchColumn->GetDisplayValue();
}
}
if ($searchColumn->IsFilterActive()) {
$searchColumnViewData['CurrentOperator'] = SearchFilterOperator::GetOperatorByName($searchColumn->GetFilterIndex())->GetViewData($this->GetPage()->GetLocalizerCaptions());
} else {
$defaultFilter = 'CONTAINS';
$availableFilterTypes = array_keys($searchColumn->GetAvailableFilterTypes());
if (count($availableFilterTypes) > 0) {
$defaultFilter = $availableFilterTypes[0];
}
$searchColumnViewData['CurrentOperator'] = SearchFilterOperator::GetOperatorByName($defaultFilter)->GetViewData($this->GetPage()->GetLocalizerCaptions());
}
$searchColumnViewData['Operators'] = $searchColumn->GetAvailableFilterTypesViewData();
}
$result['Columns'][$column->GetName()] = $searchColumnViewData;
}
}
$tempArray = array();
$resetButtonPlacementColumnName = null;
foreach ($this->GetViewBands() as $band) {
foreach ($band->GetColumns() as $column) {
$searchColumnViewData = null;
$columnName = $this->GetDataset()->IsLookupField($column->GetName()) ? $this->GetDataset()->IsLookupFieldNameByDisplayFieldName($column->GetName()) : $column->GetName();
$searchColumn = null;
if ($column instanceof CustomDatasetFieldViewColumn || $column instanceof CustomFormatValueViewColumnDecorator || $column instanceof ImageViewColumn) {
$searchColumn = $advancedSearch->FindSearchColumnByName($columnName);
}
if ($searchColumn) {
$tempArray[] = array('Name' => $columnName, 'IsPlacement' => false);
} else {
$tempArray[] = array('Name' => $columnName, 'IsPlacement' => true);
}
}
}
$resetButtonPlacementFound = false;
for ($i = 0; $i < count($tempArray); $i++) {
if (!$tempArray[$i]['IsPlacement'] && $i > 0) {
$result['Columns'][$tempArray[$i - 1]['Name']]['ResetButtonPlacement'] = true;
$result['Columns'][$tempArray[$i - 1]['Name']]['ResetButtonAlignment'] = $isActionButtonPositionLeft ? 'right' : 'left';
$resetButtonPlacementFound = true;
break;
} else {
if (!$tempArray[$i]['IsPlacement']) {
break;
}
}
}
if (!$resetButtonPlacementFound) {
for ($i = count($tempArray) - 1; $i >= 0; $i--) {
if (!$tempArray[$i]['IsPlacement'] && $i < count($tempArray) - 1) {
$result['Columns'][$tempArray[$i + 1]['Name']]['ResetButtonPlacement'] = true;
$result['Columns'][$tempArray[$i + 1]['Name']]['ResetButtonAlignment'] = $isActionButtonPositionLeft ? 'right' : 'left';
$resetButtonPlacementFound = true;
break;
} else {
if (!$tempArray[$i]['IsPlacement']) {
break;
}
}
}
}
}
return $result;
}
示例3: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for FEC_WINK field
//
$editor = new DateTimeEdit('fec_wink_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('FEC WINK', 'FEC_WINK', $editor, $this->dataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for USERNAME_EMISOR field
//
$editor = new ComboBox('username_emisor_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."PERSONA"');
$field = new StringField('USERNAME');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('ES_ADMIN');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new DateField('NACIMIENTO');
$lookupDataset->AddField($field, false);
$field = new StringField('PRIMER_APELLIDO');
$lookupDataset->AddField($field, false);
$field = new StringField('SEGUNDO_APELLIDO');
$lookupDataset->AddField($field, false);
$field = new StringField('NOMBRE');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('GENERO_ID');
$lookupDataset->AddField($field, false);
$field = new IntegerField('CIUDAD_ID');
$lookupDataset->AddField($field, false);
$field = new StringField('SLOGAN');
$lookupDataset->AddField($field, false);
$field = new DateField('FEC_CREACION');
$lookupDataset->AddField($field, false);
$field = new StringField('USUARIO_CREACION');
$lookupDataset->AddField($field, false);
$field = new DateField('FEC_ULTIMA_MOD');
$lookupDataset->AddField($field, false);
$field = new StringField('USUARIO_ULTIMA_MOD');
$lookupDataset->AddField($field, false);
$field = new StringField('EMAIL');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('CLAVE');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('ES_ADMIN', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('USERNAME EMISOR', 'USERNAME_EMISOR', $editor, $this->dataset, 'USERNAME', 'ES_ADMIN', $lookupDataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for USERNAME_RECEPTOR field
//
$editor = new ComboBox('username_receptor_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."PERSONA"');
$field = new StringField('USERNAME');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('ES_ADMIN');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new DateField('NACIMIENTO');
$lookupDataset->AddField($field, false);
$field = new StringField('PRIMER_APELLIDO');
$lookupDataset->AddField($field, false);
$field = new StringField('SEGUNDO_APELLIDO');
$lookupDataset->AddField($field, false);
$field = new StringField('NOMBRE');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('GENERO_ID');
$lookupDataset->AddField($field, false);
$field = new IntegerField('CIUDAD_ID');
$lookupDataset->AddField($field, false);
$field = new StringField('SLOGAN');
$lookupDataset->AddField($field, false);
$field = new DateField('FEC_CREACION');
$lookupDataset->AddField($field, false);
$field = new StringField('USUARIO_CREACION');
$lookupDataset->AddField($field, false);
$field = new DateField('FEC_ULTIMA_MOD');
$lookupDataset->AddField($field, false);
$field = new StringField('USUARIO_ULTIMA_MOD');
$lookupDataset->AddField($field, false);
$field = new StringField('EMAIL');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('CLAVE');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('ES_ADMIN', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('USERNAME RECEPTOR', 'USERNAME_RECEPTOR', $editor, $this->dataset, 'USERNAME', 'ES_ADMIN', $lookupDataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
//.........这里部分代码省略.........
示例4: AddInsertColumns
//.........这里部分代码省略.........
$field = new StringField('ds_referencia');
$lookupDataset->AddField($field, false);
$field = new IntegerField('id_sector');
$lookupDataset->AddField($field, false);
$lookupDataset->setOrderByField('ds_referencia', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn(
'Espacio',
'id_espacio',
$editor,
$this->dataset, 'id_espacio', 'ds_referencia', $lookupDataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for id_bien field
//
$editor = new ComboBox('id_bien_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(
new PgConnectionFactory(),
GetConnectionOptions(),
'"public"."sga_bien"');
$field = new IntegerField('id_bien', null, null, true);
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new IntegerField('id_tipo_bien');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('id_espacio');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('ds_observacion');
$lookupDataset->AddField($field, false);
$field = new IntegerField('nu_cantidad');
$lookupDataset->AddField($field, false);
$lookupDataset->setOrderByField('ds_observacion', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn(
'Bien',
'id_bien',
$editor,
$this->dataset, 'id_bien', 'ds_observacion', $lookupDataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for id_periodicidad field
//
$editor = new ComboBox('id_periodicidad_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(
new PgConnectionFactory(),
GetConnectionOptions(),
'"public"."sga_periodicidad"');
$field = new IntegerField('id_periodicidad', null, null, true);
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('no_periodicidad');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('va_frecuencia');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$lookupDataset->setOrderByField('no_periodicidad', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn(
'Periodicidad',
'id_periodicidad',
$editor,
$this->dataset, 'id_periodicidad', 'no_periodicidad', $lookupDataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for ds_detalle field
//
$editor = new TextAreaEdit('ds_detalle_edit', 50, 8);
$editColumn = new CustomEditColumn('Detalle', 'ds_detalle', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for fe_inicio field
//
$editor = new DateTimeEdit('fe_inicio_edit', true, 'd/m/Y H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Fecha Início', 'fe_inicio', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
if ($this->GetSecurityInfo()->HasAddGrant())
{
$grid->SetShowAddButton(true);
$grid->SetShowInlineAddButton(false);
}
else
{
$grid->SetShowInlineAddButton(false);
$grid->SetShowAddButton(false);
}
}
示例5: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for name field
//
$editor = new TextEdit('name_edit');
$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);
//
// Edit column for date field
//
$editor = new DateTimeEdit('date_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Timesheet Date', 'date', $editor, $this->dataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for task_name field
//
$editor = new TextEdit('task_name_edit');
$editColumn = new CustomEditColumn('Task Name', 'task_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 project_name field
//
$editor = new TextEdit('project_name_edit');
$editColumn = new CustomEditColumn('Project Name', 'project_name', $editor, $this->dataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for pay_period_number field
//
$editor = new ComboBox('pay_period_number_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$editColumn = new CustomEditColumn('Pay Period ', 'pay_period_number', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for hours field
//
$editor = new TextEdit('hours_edit');
$editColumn = new CustomEditColumn('Hours', 'hours', $editor, $this->dataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
if ($this->GetSecurityInfo()->HasAddGrant()) {
$grid->SetShowAddButton(false);
$grid->SetShowInlineAddButton(false);
} else {
$grid->SetShowInlineAddButton(false);
$grid->SetShowAddButton(false);
}
}
示例6: AddInsertColumns
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);
}
}
示例7: AddInsertColumns
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())));
//.........这里部分代码省略.........
示例8: AddInsertColumns
//.........这里部分代码省略.........
// Edit column for task_name field
//
$editor = new AutocomleteComboBox('task_name_edit', $this->CreateLinkBuilder());
$editor->SetSize('250px');
$lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`task_names`');
$field = new IntegerField('id', null, null, true);
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('Name');
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('Name', GetOrderTypeAsSQL(otAscending));
$editColumn = new DynamicLookupEditColumn('Name', 'task_name', 'task_name_Name', 'insert_task_name_Name_search', $editor, $this->dataset, $lookupDataset, 'Name', 'Name', '');
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for notes field
//
$editor = new TextAreaEdit('notes_edit', 50, 8);
$editColumn = new CustomEditColumn('Notes', 'notes', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for hrs field
//
$editor = new SpinEdit('hrs_edit');
$editColumn = new CustomEditColumn('Allocated Hours', 'hrs', $editor, $this->dataset);
$editColumn->SetInsertDefaultValue($this->RenderText('21'));
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$validator = new NumberValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('NumberValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for assigned_to field
//
$editor = new ComboBox('assigned_to_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`staff`');
$field = new IntegerField('staff_id', null, null, true);
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('username');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('email');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('picture');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('password');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('dept_id');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('position');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('emp_number');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('username', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('Assigned To', 'assigned_to', $editor, $this->dataset, 'staff_id', 'username', $lookupDataset);
$editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_USER_ID%'));
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for date_start field
//
$editor = new DateTimeEdit('date_start_edit', false, 'Y-m-d', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Date Start', 'date_start', $editor, $this->dataset);
$editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%'));
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for date_end field
//
$editor = new DateTimeEdit('date_end_edit', true, 'Y-m-d', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Date End', 'date_end', $editor, $this->dataset);
$editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%'));
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
if ($this->GetSecurityInfo()->HasAddGrant()) {
$grid->SetShowAddButton(true);
$grid->SetShowInlineAddButton(false);
} else {
$grid->SetShowInlineAddButton(false);
$grid->SetShowAddButton(false);
}
}
示例9: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for id_persona field
//
$editor = new ComboBox('id_persona_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."ods_persona"');
$field = new IntegerField('id_persona', null, null, true);
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new IntegerField('id_tipo_persona');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('co_dni_cuit');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('co_legajo');
$lookupDataset->AddField($field, false);
$field = new StringField('no_persona');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('id_empresa');
$lookupDataset->AddField($field, false);
$field = new IntegerField('id_area');
$lookupDataset->AddField($field, false);
$lookupDataset->setOrderByField('id_tipo_persona', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('Id Persona', 'id_persona', $editor, $this->dataset, 'id_persona', 'id_tipo_persona', $lookupDataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for id_lugar field
//
$editor = new ComboBox('id_lugar_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."ods_lugar"');
$field = new IntegerField('id_lugar', null, null, true);
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('co_lugar');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('no_lugar');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('ds_direccion');
$lookupDataset->AddField($field, false);
$lookupDataset->setOrderByField('co_lugar', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('Id Lugar', 'id_lugar', $editor, $this->dataset, 'id_lugar', 'co_lugar', $lookupDataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for id_origen_lectura field
//
$editor = new ComboBox('id_origen_lectura_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."ods_origen_lectura"');
$field = new IntegerField('id_origen_lectura');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('co_origen_lectura');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('no_origen_lectura');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$lookupDataset->setOrderByField('co_origen_lectura', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('Id Origen Lectura', 'id_origen_lectura', $editor, $this->dataset, 'id_origen_lectura', 'co_origen_lectura', $lookupDataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for fe_fecha_lectura field
//
$editor = new DateTimeEdit('fe_fecha_lectura_edit', true, 'Y-m-d H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Fe Fecha Lectura', 'fe_fecha_lectura', $editor, $this->dataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for no_usuario field
//
$editor = new TextEdit('no_usuario_edit');
$editor->SetSize(10);
$editor->SetMaxLength(10);
$editColumn = new CustomEditColumn('Nombre Usuario', 'no_usuario', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for ds_usuario field
//
$editor = new TextEdit('ds_usuario_edit');
$editor->SetSize(50);
$editor->SetMaxLength(50);
$editColumn = new CustomEditColumn('Descripción Usuario', 'ds_usuario', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
//.........这里部分代码省略.........
示例10: AddFieldColumns
protected function AddFieldColumns(Grid $grid)
{
//
// View column for name field
//
$column = new TextViewColumn('name', 'Name', $this->dataset);
$column->SetOrderable(true);
/* <inline edit column> */
//
// Edit column for name field
//
$editor = new TextEdit('name_edit');
$editColumn = new CustomEditColumn('Name', 'name', $editor, $this->dataset);
$editColumn->setVisible(false);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$column->SetEditOperationColumn($editColumn);
/* </inline edit column> */
/* <inline insert column> */
//
// Edit column for name field
//
$editor = new TextEdit('name_edit');
$editColumn = new CustomEditColumn('Name', 'name', $editor, $this->dataset);
$editColumn->setVisible(false);
$editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_USER_NAME%'));
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$column->SetInsertOperationColumn($editColumn);
/* </inline insert column> */
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for date field
//
$column = new DateTimeViewColumn('date', 'Date', $this->dataset);
$column->SetDateTimeFormat('Y-m-d');
$column->SetOrderable(true);
/* <inline edit column> */
//
// Edit column for date field
//
$editor = new DateTimeEdit('date_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Date', 'date', $editor, $this->dataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$column->SetEditOperationColumn($editColumn);
/* </inline edit column> */
/* <inline insert column> */
//
// Edit column for date field
//
$editor = new DateTimeEdit('date_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Date', 'date', $editor, $this->dataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$column->SetInsertOperationColumn($editColumn);
/* </inline insert column> */
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for Task field
//
$column = new TextViewColumn('task_id_Task', 'Project & Task', $this->dataset);
$column->SetOrderable(true);
/* <inline edit column> */
//
// Edit column for task_id field
//
$editor = new ComboBox('task_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`taskview`');
$field = new IntegerField('task_id');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('project_id');
$lookupDataset->AddField($field, false);
$field = new StringField('assigned_to');
$lookupDataset->AddField($field, false);
$field = new DateField('date_start');
$lookupDataset->AddField($field, false);
$field = new DateField('date_end');
$lookupDataset->AddField($field, false);
$field = new StringField('task_name');
$lookupDataset->AddField($field, false);
$field = new StringField('notes');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('hrs');
$lookupDataset->AddField($field, false);
$field = new StringField('wo');
$lookupDataset->AddField($field, false);
$field = new IntegerField('staff_id');
$lookupDataset->AddField($field, false);
$field = new StringField('Task');
//.........这里部分代码省略.........
示例11: AddInsertColumns
//.........这里部分代码省略.........
$dataset0->AddField($field, false);
$field = new StringField('level_of_service');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new StringField('multi_year');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new StringField('public_engagement');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new StringField('year');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new StringField('approved');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new StringField('progress');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new IntegerField('staff_id');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new IntegerField('dept_id');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new IntegerField('budget_spent');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new IntegerField('admin_flag');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$editor->AddLevel($dataset0, 'project_id', 'project_name', $this->RenderText('Project'), null);
$dataset1 = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`task`');
$field = new IntegerField('task_id', null, null, true);
$field->SetIsNotNull(true);
$dataset1->AddField($field, true);
$field = new IntegerField('project_id');
$dataset1->AddField($field, false);
$field = new StringField('assigned_to');
$dataset1->AddField($field, false);
$field = new DateField('date_start');
$dataset1->AddField($field, false);
$field = new DateField('date_end');
$dataset1->AddField($field, false);
$field = new StringField('task_name');
$dataset1->AddField($field, false);
$field = new StringField('notes');
$field->SetIsNotNull(true);
$dataset1->AddField($field, false);
$field = new IntegerField('hrs');
$dataset1->AddField($field, false);
$field = new StringField('wo');
$dataset1->AddField($field, false);
$field = new IntegerField('staff_id');
$dataset1->AddField($field, false);
$dataset1->SetOrderBy('task_name', GetOrderTypeAsSQL(otAscending));
$editor->AddLevel($dataset1, 'task_id', 'task_name', $this->RenderText('Task'), new ForeignKeyInfo('project_id', 'project_id'));
$editColumn = new MultiLevelLookupEditColumn('Task', 'task_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 hours field
//
$editor = new SpinEdit('hours_edit');
$editColumn = new CustomEditColumn('Hours', 'hours', $editor, $this->dataset);
$editColumn->SetInsertDefaultValue($this->RenderText('7'));
$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('Notes', 'notes', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for date field
//
$editor = new DateTimeEdit('date_edit', false, 'Y-m-d', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Date', 'date', $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);
}
}
示例12: AddInsertColumns
//.........这里部分代码省略.........
GetConnectionOptions(),
'"public"."sga_periodicidad"');
$field = new IntegerField('id_periodicidad', null, null, true);
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('no_periodicidad');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('va_frecuencia');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$lookupDataset->setOrderByField('no_periodicidad', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn(
'Periodicidad',
'id_periodicidad',
$editor,
$this->dataset, 'id_periodicidad', 'no_periodicidad', $lookupDataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for ds_detalle field
//
$editor = new TextAreaEdit('ds_detalle_edit', 50, 8);
$editColumn = new CustomEditColumn('Detalle', 'ds_detalle', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for fe_inicio field
//
$editor = new DateTimeEdit('fe_inicio_edit', true, 'd/m/Y H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Fecha Início', 'fe_inicio', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for nu_personas field
//
$editor = new TextEdit('nu_personas_edit');
$editColumn = new CustomEditColumn('Personas', 'nu_personas', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for tm_carga_horaria field
//
$editor = new TimeEdit('tm_carga_horaria_edit');
$editColumn = new CustomEditColumn('Carga Horária', 'tm_carga_horaria', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for fe_horas field
//
$editor = new MultiValueSelect('fe_horas_edit');
$editor->AddValue('00:00', $this->RenderText('00:00'));
$editor->AddValue('00:15', $this->RenderText('00:15'));
$editor->AddValue('00:30', $this->RenderText('00:30'));
$editor->AddValue('00:45', $this->RenderText('00:45'));
$editor->AddValue('01:00', $this->RenderText('01:00'));
示例13: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for base_datos field
//
$editor = new TextAreaEdit('base_datos_edit', 50, 8);
$editColumn = new CustomEditColumn('Base Datos', 'base_datos', $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_creacion field
//
$editor = new DateTimeEdit('fecha_creacion_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Fecha Creacion', 'fecha_creacion', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
if ($this->GetSecurityInfo()->HasAddGrant()) {
$grid->SetShowAddButton(false);
$grid->SetShowInlineAddButton(false);
} else {
$grid->SetShowInlineAddButton(false);
$grid->SetShowAddButton(false);
}
}
示例14: UpdateSearchControls
public function UpdateSearchControls()
{
/** @var AdvancedSearchControl $advancedSearch */
$advancedSearch = $this->GetPage()->AdvancedSearchControl;
if ($advancedSearch != null) {
foreach ($advancedSearch->GetSearchColumns() as $searchColumn) {
$columnName = $searchColumn->GetFieldName();
$column = $this->FindViewColumnByName($columnName);
/** @var Field $field */
if (!StringUtils::IsNullOrEmpty($column)) {
$field = $this->dataset->GetFieldByName($column->GetName());
} else {
$field = $this->dataset->GetFieldByName($columnName);
}
if ($field && $searchColumn) {
if ($searchColumn instanceof LookupSearchColumn) {
$this->filterBuilder->AddField($searchColumn, $searchColumn->GetFieldName(), $searchColumn->GetCaption(), $field->GetEngFieldType(), 'Select2Filter', array('handler' => $searchColumn->GetHandlerName()));
$searchColumnViewData['Value'] = $searchColumn->GetDisplayValue();
} else {
if ($field instanceof DateTimeField || $field instanceof DateField) {
$formatOptions = array('fdow' => GetFirstDayOfWeek());
if (!StringUtils::IsNullOrEmpty($column) && $column instanceof DateTimeViewColumn) {
$formatOptions['format'] = $column->GetOSDateTimeFormat();
}
$this->filterBuilder->AddField($searchColumn, $searchColumn->GetFieldName(), $searchColumn->GetCaption(), $field->GetEngFieldType(), null, $formatOptions);
} else {
$this->filterBuilder->AddField($searchColumn, $searchColumn->GetFieldName(), $searchColumn->GetCaption(), $field->GetEngFieldType(), null, null);
}
}
}
}
}
}
示例15: AddInsertColumns
//.........这里部分代码省略.........
$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);
}
}