public function fetchDataSet()
 {
     $result = parent::fetchDataSet();
     $resultSet = array();
     $messageFile_loaded = false;
     foreach ($result as $record) {
         $form = unserialize($record['form']);
         $data = unserialize($record['data']);
         if (!$messageFile_loaded) {
             $this->objectMessages = MessageHelper::loadMessage($form['message_file'], $form['package']);
             $formObj = Openbiz::getObject($this->parentFormName);
             I18n::AddLangData("common", substr($formObj->package, 0, intval(strpos($formObj->package, '.'))));
             $messageFile_loaded = true;
         }
         if (is_array($data)) {
             foreach ($data as $key => $value) {
                 $elemObjMeta = $data[$key]['element'];
                 $elemObjMeta = $this->replaceElementClass($elemObjMeta);
                 if ($elemObjMeta["ATTRIBUTES"]['FIELDTYPE'] == 'ExtendField') {
                     $extendSettingId = (int) str_replace("extend_field_", $replace, $elemObjMeta["ATTRIBUTES"]['NAME']);
                     $elemObjMeta["ATTRIBUTES"] = Openbiz::getService("extend.lib.ExtendFieldService")->translateElemArr($elemObjMeta["ATTRIBUTES"], $extendSettingId);
                 }
                 $objName = $elemObjMeta["ATTRIBUTES"]['CLASS'];
                 $formObj = Openbiz::getObject($this->parentFormName);
                 $elemObj = new $objName($elemObjMeta, $formObj);
                 $data[$key]['label'] = $elemObj->renderLabel();
                 $elemObj->setValue($data[$key]['old']);
                 $elemObj->text = str_replace("{@:Elem[" . $elemObj->objectName . "].Value}", $data[$key]['old'], $elemObj->text);
                 $data[$key]['old'] = $elemObj->render();
                 $elemObj = new $objName($elemObjMeta, $formObj);
                 $elemObj->setValue($data[$key]['new']);
                 $elemObj->text = str_replace("{@:Elem[" . $elemObj->objectName . "].Value}", $data[$key]['new'], $elemObj->text);
                 $data[$key]['new'] = $elemObj->render();
                 unset($data[$key]['element']);
             }
         }
         $record['data'] = $data;
         unset($record['form']);
         $resultSet[] = $record;
     }
     return $resultSet;
 }
示例#2
0
 protected function translateList(&$list, $tag)
 {
     $package = $this->getSelectFrom();
     I18n::AddLangData(substr($package, 0, intval(strpos($package, '.'))), "extend");
     parent::translateList($list, $tag);
 }