Index: branches/5.1.x/core/admin_templates/incs/custom_blocks.tpl =================================================================== diff -u -N -r14241 -r14408 --- branches/5.1.x/core/admin_templates/incs/custom_blocks.tpl (.../custom_blocks.tpl) (revision 14241) +++ branches/5.1.x/core/admin_templates/incs/custom_blocks.tpl (.../custom_blocks.tpl) (revision 14408) @@ -110,7 +110,15 @@ ', '')" onmouseout="hide_form_error('')"> - +  *: + + +
+ + + + +
  - + + + + - +
+ + + + +
+
+ \ No newline at end of file Index: branches/5.1.x/core/admin_templates/users/users_edit_custom.tpl =================================================================== diff -u -N -r14241 -r14408 --- branches/5.1.x/core/admin_templates/users/users_edit_custom.tpl (.../users_edit_custom.tpl) (revision 14241) +++ branches/5.1.x/core/admin_templates/users/users_edit_custom.tpl (.../users_edit_custom.tpl) (revision 14408) @@ -49,23 +49,24 @@ - - - - - + + + + - - - - - +
+ + + +
+
+ \ No newline at end of file Index: branches/5.1.x/core/kernel/db/dbitem.php =================================================================== diff -u -N -r14241 -r14408 --- branches/5.1.x/core/kernel/db/dbitem.php (.../dbitem.php) (revision 14241) +++ branches/5.1.x/core/kernel/db/dbitem.php (.../dbitem.php) (revision 14408) @@ -1,6 +1,6 @@ Prefix.'-cdata.'.$this->Special, '.'); - $cdata =& $this->Application->recallObject($cdata_key, null, Array('skip_autoload' => true, 'populate_ml_fields' => true)); + $cdata_key = rtrim($this->Prefix . '-cdata.' . $this->Special, '.'); + $cdata =& $this->Application->recallObject($cdata_key, null, Array('skip_autoload' => true)); + /* @var $cdata kDBItem */ + $resource_id = $this->GetDBField('ResourceId'); $cdata->Load($resource_id, 'ResourceId'); $cdata->SetDBField('ResourceId', $resource_id); $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); /* @var $ml_formatter kMultiLanguage */ + $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper'); + /* @var $ml_helper kMultiLanguageHelper */ + foreach ($this->customFields as $custom_id => $custom_name) { - $force_primary = isset($cdata->Fields['cust_'.$custom_id]['force_primary']) && $cdata->Fields['cust_'.$custom_id]['force_primary']; - $cdata->SetDBField($ml_formatter->LangFieldName('cust_'.$custom_id, $force_primary), $this->GetDBField('cust_'.$custom_name)); + $field_options = $cdata->GetFieldOptions('cust_' . $custom_id); + $force_primary = isset($field_options['force_primary']) && $field_options['force_primary']; + + if ($force_primary) { + $cdata->SetDBField($ml_formatter->LangFieldName('cust_' . $custom_id, true), $this->GetDBField('cust_' . $custom_name)); + } + else { + for ($language_id = 1; $language_id <= $ml_helper->languageCount; $language_id++) { + if (!$ml_helper->LanguageFound($language_id)) { + continue; + } + + $cdata->SetDBField('l' . $language_id . '_cust_' . $custom_id, $this->GetDBField('l' . $language_id . '_cust_' . $custom_name)); + } + } } return $cdata->isLoaded() ? $cdata->Update() : $cdata->Create(); Index: branches/5.1.x/core/units/custom_fields/custom_fields_tag_processor.php =================================================================== diff -u -N -r14241 -r14408 --- branches/5.1.x/core/units/custom_fields/custom_fields_tag_processor.php (.../custom_fields_tag_processor.php) (revision 14241) +++ branches/5.1.x/core/units/custom_fields/custom_fields_tag_processor.php (.../custom_fields_tag_processor.php) (revision 14408) @@ -1,6 +1,6 @@ Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET if ($source_prefix) { - $list->SetDBField($params['value_field'], $source_object->GetDBField('cust_'.$list->GetDBField('FieldName'))); + $options = $source_object->GetFieldOptions('cust_'.$list->GetDBField('FieldName')); + + if ( isset($options['formatter']) && $options['formatter'] == 'kMultiLanguage' ) { + $language_prefix = 'l' . $this->Application->GetVar('m_lang') . '_'; + } + else { + $language_prefix = ''; + } + + $list->SetDBField($params['value_field'], $source_object->GetDBField($language_prefix . 'cust_'.$list->GetDBField('FieldName'))); + if ($display_original) { $list->SetDBField('OriginalValue', $original_object->GetField('cust_'.$list->GetDBField('FieldName'))); } + $block_params['field'] = $block_params['virtual_field'] = 'cust_'.$list->GetDBField('FieldName'); $block_params['show_heading'] = ($prev_heading != $list->GetDBField('Heading') ) ? 1 : 0; - $options = $source_object->GetFieldOptions('cust_'.$list->GetDBField('FieldName')); + $list->SetDBField('DirectOptions', isset($options['options']) ? $options['options'] : false); } Index: branches/5.1.x/core/units/custom_fields/custom_fields_config.php =================================================================== diff -u -N -r14241 -r14408 --- branches/5.1.x/core/units/custom_fields/custom_fields_config.php (.../custom_fields_config.php) (revision 14241) +++ branches/5.1.x/core/units/custom_fields/custom_fields_config.php (.../custom_fields_config.php) (revision 14408) @@ -1,6 +1,6 @@ Array ('title' => 'la_col_IsSystem', 'filter_block' => 'grid_options_filter'), ), ), - - 'SeparateTab' => Array ( - 'Icons' => Array ( - 'default' => 'icon16_item.png', - ), - 'Selector' => '', - 'Fields' => Array ( - 'FieldName' => Array ( 'title'=>'la_col_FieldName', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_like_filter', 'width' => 200, ), - 'Prompt' => Array ( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td', 'ElementTypeField' => 'ElementType', 'filter_block' => 'grid_empty_filter', 'width' => 200, ), - 'Value' => Array ( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td', 'filter_block' => 'grid_empty_filter', 'width' => 200, ), - 'Error' => Array ( 'title'=>'la_col_Error', 'data_block' => 'custom_error_td', 'filter_block' => 'grid_empty_filter', 'width' => 100, ), - ), - ), - - 'SeparateTabOriginal' => Array ( - 'Icons' => Array ( - 'default' => 'icon16_item.png', - ), - 'Selector' => '', - 'Fields' => Array ( - 'FieldName' => Array ( 'title'=>'la_col_FieldName', 'data_block' => 'grid_icon_td', 'filter_block' => 'grid_like_filter'), - 'Prompt' => Array ( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td', 'ElementTypeField' => 'ElementType', 'filter_block' => 'grid_empty_filter'), - 'Value' => Array ( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td', 'filter_block' => 'grid_empty_filter'), - 'OriginalValue' => Array ( 'title'=>'la_col_OriginalValue', 'data_block' => 'grid_original_td', 'filter_block' => 'grid_like_filter'), - ), - ), - ), ); \ No newline at end of file Index: branches/5.1.x/core/admin_templates/incs/grid_blocks.tpl =================================================================== diff -u -N -r14241 -r14408 --- branches/5.1.x/core/admin_templates/incs/grid_blocks.tpl (.../grid_blocks.tpl) (revision 14241) +++ branches/5.1.x/core/admin_templates/incs/grid_blocks.tpl (.../grid_blocks.tpl) (revision 14408) @@ -247,25 +247,6 @@ - - error-cell"> - - *:
- - - - ,-cdata', '-cdata:cust_', 'popups/translator', , 1);" title=""> - - - ');"> - - - - ,-cdata', '-cdata:cust_', 'popups/translator', );" title=""> - - -
-