Example #1
0
    private function _setTableRow(base_html_model_Table $table, BaseObject $obj)
    {
//        $user = Flat::user();
//        if (!$user->isEntitled($obj->getPermissionForViewMode(DisplayClass::VIEW))) {
//            return;
//        }
        $row = new base_html_model_table_Row();
        $row->setId(strtolower(get_class($obj)) . '_' . $obj->getLogicalKey());
        foreach ($this->showColumns as $colName => $colLabel) {
            $cell = new base_html_model_table_Cell();
            $cell->setCssClass($colName);
            $cell->setContent($obj->getField($colName));
            $row->addCell($cell);
        }

        $objClass = get_class($obj);
        $taskLinks  = Html::url($_SERVER['SCRIPT_NAME'] . '?controller=base_pages_input_controller_BaseObject&class=' . $objClass . '&LK=' . $obj->getLogicalKey() . '&mode=view', Html::pictogram('view'), ['title' => 'Anzeigen']);
        $taskLinks .= Html::url($_SERVER['SCRIPT_NAME'] . '?controller=base_pages_input_controller_BaseObject&class=' . $objClass . '&LK=' . $obj->getLogicalKey() . '&mode=edit', Html::pictogram('edit'), ['title' => 'Bearbeiten']);
        $taskLinks .= Html::url(HTML_ROOT . '/de/ajax.php?controller=base_ajax_delete_Controller&class=' . $objClass . '&LK=' . $obj->getLogicalKey(), Html::pictogram('delete'), ['class' => 'ajaxOnClick', 'title' => 'Löschen']);
        $cell = new base_html_model_table_Cell();
        $cell->setCssClass('task');
        $cell->setContent($taskLinks);
        $row->addCell($cell);

        $table->addRow($row);
    }
Example #2
0
            $cell->setCssId($fi->getFieldName());
            $cell->setContent($fi->getFieldLabel());
            $headRow->addCell($cell);
            $fis[] = $fi;
        }

        $cell = new base_html_model_table_Cell();
        $cell->setCssClass('orderAmount');
        $cell->setContent('Bestellmenge');
        $headRow->addCell($cell);
        $table->addHeadRow($headRow);

        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);