Index: branches/unlabeled/unlabeled-1.2.2/kernel/units/custom_fields/custom_fields_tag_processor.php =================================================================== diff -u -r5727 -r5856 --- branches/unlabeled/unlabeled-1.2.2/kernel/units/custom_fields/custom_fields_tag_processor.php (.../custom_fields_tag_processor.php) (revision 5727) +++ branches/unlabeled/unlabeled-1.2.2/kernel/units/custom_fields/custom_fields_tag_processor.php (.../custom_fields_tag_processor.php) (revision 5856) @@ -43,6 +43,15 @@ return $this->Application->ProcessParsedTag($source_prefix, 'Error', $params); } + function setParamValue(&$params, $param_name) + { + if (!isset($params[$param_name])) { + $params[$param_name] = $this->Application->Parser->GetParam($param_name, 1); + } + + return $params[$param_name]; + } + /** * Prints list content using block specified * @@ -52,14 +61,17 @@ */ function PrintList($params) { + $this->setParamValue($params, 'SourcePrefix'); + $this->setParamValue($params, 'value_field'); + $list =& $this->GetList($params); $id_field = $this->Application->getUnitOption($this->Prefix,'IDField'); $list->Query(); $o = ''; $list->GoFirst(); - - $block_params=$this->prepareTagParams($params); + + $block_params = $this->prepareTagParams($params); $block_params['name'] = $this->SelectParam($params, 'render_as,block'); $block_params['pass_params'] = 'true'; @@ -69,6 +81,14 @@ $source_object =& $this->Application->recallObject($source_prefix); } + // $deep_level if GetParam = 1 used in case if PrintList is called during parsing "grid" block (=> +1 to deep_level) + $display_original = $this->setParamValue($params, 'display_original'); + if ($display_original) { + $block_params['display_original'] = $display_original; + $block_params['original_title'] = $this->setParamValue($params, 'original_title'); + $original_object =& $this->Application->recallObject($source_prefix.'.original'); + } + if ($this->Special == 'general') { $this->groupRecords($list->Records, 'Heading'); } @@ -79,6 +99,10 @@ if ($source_prefix) { $list->SetDBField($params['value_field'], $source_object->GetDBField('cust_'.$list->GetDBField('FieldName'))); + if ($display_original) { + $list->SetDBField('OriginalValue', $original_object->GetField('cust_'.$list->GetDBField('FieldName'))); + } + $block_params['field'] = 'cust_'.$list->GetDBField('FieldName'); $block_params['show_heading'] = ($prev_heading != $list->GetDBField('Heading') ) ? 1 : 0; }