Index: trunk/core/kernel/db/db_tag_processor.php =================================================================== diff -u -r3983 -r4029 --- trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 3983) +++ trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 4029) @@ -553,7 +553,19 @@ return $value; } - + + function SetField($params) + { + // + + $object =& $this->getObject($params); + $dst_field = $this->SelectParam($params, 'name,field'); + + list($prefix_special, $src_field) = explode(':', $params['src']); + $src_object =& $this->Application->recallObject($prefix_special); + $object->SetDBField($dst_field, $src_object->GetDBField($src_field)); + } + /** * Checks if parameter is passed * Note: works like Tag and line simple method too @@ -860,7 +872,7 @@ */ function prepareInputName($params) { - $field = $params['field']; + $field = $this->SelectParam($params, 'name,field'); $object =& $this->getObject($params); $formatter_class = getArrayValue($object->Fields, $field, 'formatter'); @@ -1257,28 +1269,19 @@ */ function CustomField($params) { - $object =& $this->getObject($params); - - $field = $this->SelectParam($params, 'name,field'); - - $lang_id = $this->Application->GetVar('m_lang'); - - $sql = ' SELECT cv.l'.$lang_id.'_Value FROM '.TABLE_PREFIX.'CustomField cf - LEFT JOIN '.TABLE_PREFIX.'CustomMetaData cv - ON cf.CustomFieldId = cv.CustomFieldId - WHERE cf.Type = '.$this->Application->getUnitOption($this->Prefix, 'ItemType').' - AND cv.ResourceId = '.$object->GetDBField('ResourceId').' - AND cf.FieldName = "'.$field.'"'; - return $this->Conn->GetOne($sql); + $params['name'] = 'cust_'.$this->SelectParam($params, 'name,field'); + return $this->Field($params); } function CustomFieldLabel($params) { - $object =& $this->Application->recallObject($this->Prefix); // not using Special here (for what purpose ?) + $object =& $this->getObject($params); $field = $this->SelectParam($params, 'name,field'); - $sql = ' SELECT FieldLabel FROM '.TABLE_PREFIX.'CustomField WHERE FieldName = "'.$field.'"'; + $sql = 'SELECT FieldLabel + FROM '.$this->Application->getUnitOption('cf', 'TableName').' + WHERE FieldName = '.$this->Conn->qstr($field); return $this->Application->Phrase($this->Conn->GetOne($sql)); }