示例#1
0
文件: offer.php 项目: kafruhs/fws
        foreach ($objs as $obj) {
            $obj['name'] .= ' ' . $obj->getField('amount') . ' ' . $obj->getField('unit') . ' ' . $obj->getField('dosage');
            $row = new base_html_model_table_Row();
            $row->setId($obj['LK']);
            foreach ($fis as $fi) {
                $formElement = base_form_element_Factory::createElement($fi);
                $formElement->setMultiline();
                $formElement->setName($fi->getFieldName());
                $formElement->setValue($obj->getField($fi->getFieldName()));
                $displayClassName = 'base_displayclass_' . ucfirst($fi->getDisplayClass());
                /** @var DisplayClass $dpC */
//                $dpC = new $displayClassName($obj);
//                $displayMode = $dpC->getDisplayMode(DisplayClass::VIEW);
                $formElement->setDisplayMode(DisplayClass::VIEW);
                $cell = new base_html_model_table_Cell();
                $cell->setCssID($fi->getFieldName());
                $cell->setCssClass($formElement->getClass());
                $cell->setContent($formElement->display());
                $row->addCell($cell);
            }
            $cell = new base_html_model_table_Cell();
            $cell->setCssClass('orderAmount');
            $medOrder = Factory::createObject('MedOrder');
            $fi = $medOrder->getFieldinfo('amount');
            $formElement = base_form_element_Factory::createElement($fi);
            $formElement->setClass($formElement->getClass() . ' orderAmount');
            $formElement->setMultiline();
            $formElement->setName('orderAmount');
            $formElement->setValue(0);
            $formElement->setDisplayMode(DisplayClass::EDIT);
            $content = $formElement->display();