public function vatsObject() { global $ilAccess; if (!$ilAccess->checkAccess('read', '', $this->object->getRefId())) { $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilErr->MESSAGE); } include_once 'Services/Table/classes/class.ilTable2GUI.php'; $tbl = new ilTable2GUI($this, 'vats'); $tbl->setId('pay_vats_tbl'); $tbl->setFormAction($this->ctrl->getFormAction($this), 'createVat'); $tbl->setTitle($this->lng->txt('payment_tax_rates')); $tbl->setRowTemplate('tpl.shop_vats_list_row.html', 'Services/Payment'); $tbl->setDefaultOrderField('title'); $tbl->addColumn('', 'check', '1%'); $tbl->addColumn($this->lng->txt('vat_title'), 'vat_title', '33%'); $tbl->addColumn($this->lng->txt('vat_rate'), 'vat_rate', '33%'); $tbl->addColumn('', 'commands', '33%'); $oShopVatsList = new ilShopVatsList(); $oShopVatsList->read(); $result = array(); $_SESSION['count_vats'] = $oShopVatsList->getNumItems(); if ($oShopVatsList->hasItems()) { $tbl->enable('select_all'); $tbl->setSelectAllCheckbox('vat_id'); $counter = 0; foreach ($oShopVatsList as $oVAT) { $result[$counter]['check'] = ilUtil::formCheckbox(0, 'vat_id[]', $oVAT->getId()); $result[$counter]['vat_title'] = $oVAT->getTitle(); $result[$counter]['vat_rate'] = ilShopUtils::_formatVAT((double) $oVAT->getRate()); $this->ctrl->setParameter($this, 'vat_id', $oVAT->getId()); $result[$counter]['edit_text'] = $this->lng->txt('edit'); $result[$counter]['edit_url'] = $this->ctrl->getLinkTarget($this, 'editVat'); $result[$counter]['delete_text'] = $this->lng->txt('delete'); $result[$counter]['delete_url'] = $this->ctrl->getLinkTarget($this, 'confirmDeleteVat'); $this->ctrl->clearParameters($this); ++$counter; } $tbl->addMultiCommand('confirmDeleteVat', $this->lng->txt('delete')); } else { $tbl->disable('header'); $tbl->disable('footer'); $tbl->setNoEntriesText($this->lng->txt('paya_no_vats_assigned')); } $tbl->setData($result); $tbl->addCommandButton('createVat', $this->lng->txt('paya_insert_vats')); $this->tpl->setContent($tbl->getHTML()); return true; }