public function currenciesObject() { $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); $currency_res = ilPaymentCurrency::_getAvailableCurrencies(); // currency table $counter = 0; foreach ($currency_res as $cur) { $f_result[$counter]['currency_id'] = ilUtil::formRadioButton(0, 'currency_id', $cur['currency_id']); $f_result[$counter]['is_default'] = $cur['is_default'] == 1 ? $this->lng->txt('yes') : $this->lng->txt('no'); $f_result[$counter]['currency_unit'] = $cur['unit']; $f_result[$counter]['iso_code'] = $cur['iso_code']; $f_result[$counter]['currency_symbol'] = $cur['symbol']; $f_result[$counter]['conversion_rate'] = $cur['conversion_rate']; $counter++; } $tbl = new ilShopTableGUI($this); $tbl->setTitle($this->lng->txt("currencies")); $tbl->setId('tbl_show_currencies'); $tbl->setRowTemplate("tpl.shop_currencies_row.html", "Services/Payment"); $tbl->addColumn(' ', 'currency_id', '1%', true); $tbl->addColumn($this->lng->txt('is_default'), 'is_default', '5%'); $tbl->addColumn($this->lng->txt('currency_unit'), 'currency_unit', '10%'); $tbl->addColumn($this->lng->txt('iso_code'), 'iso_code', '20%'); $tbl->addColumn($this->lng->txt('currency_symbol'), 'currency_symbol', '20%'); $tbl->addColumn($this->lng->txt('conversion_rate'), 'conversion_rate', '15%'); $tbl->addColumn('', 'options', '5%'); $this->ctrl->setParameter($this, 'cmd', 'currencies'); $tbl->addMultiCommand('updateDefaultCurrency', $this->lng->txt('paya_set_default_currency')); $tbl->addMultiCommand("editCurrency", $this->lng->txt('edit')); $tbl->addMultiCommand("deleteCurrency", $this->lng->txt('delete')); $tbl->addCommandButton('addCurrency', $this->lng->txt('add_currency')); $tbl->setData($f_result); $this->tpl->setVariable('TABLE', $tbl->getHTML()); return true; }
private function __editPricesTable($a_result_set) { $tbl = new ilShopTableGUI($this); /** @var $tmp_obj ilObject */ $tmp_obj = ilObjectFactory::getInstanceByRefId($this->pobject->getRefId(), false); if ($tmp_obj) { $tbl->setTitle($tmp_obj->getTitle()); } else { $tbl->setTitle($this->lng->txt('object_not_found')); } $tbl->setId('tbl_bookings'); $tbl->setRowTemplate("tpl.shop_prices_row.html", "Services/Payment"); $tbl->addColumn(' ', 'price_id', '5%'); $tbl->addColumn($this->lng->txt('duration'), 'duration', '40%'); $tbl->addColumn($this->lng->txt('price_a'), 'price', '1%'); $tbl->addColumn($this->lng->txt('currency'), 'currency_unit', '10%'); $tbl->addColumn($this->lng->txt('extension_price'), 'extension', '10%'); $tbl->addColumn('', 'edit', '30%'); $tbl->setSelectAllCheckbox('price_id'); $tbl->addCommandButton('addPrice', $this->lng->txt('paya_add_price')); $tbl->addMultiCommand("deletePrice", $this->lng->txt("paya_delete_price")); $tbl->fillFooter(); $tbl->setData($a_result_set); $this->tpl->setVariable('TABLE', $tbl->getHTML()); return true; }
function __showTrusteesTable($a_result_set) { $tbl = new ilShopTableGUI($this); $tbl->setTitle($this->lng->txt("paya_trustee_table")); $tbl->setId('tbl_show_trustee'); $tbl->setRowTemplate("tpl.shop_users_row.html", "Services/Payment"); $tbl->addColumn(' ', 'trustee_id', '1%', true); $tbl->addColumn($this->lng->txt('login'), 'login', '10%'); $tbl->addColumn($this->lng->txt('firstname'), 'firstname', '20%'); $tbl->addColumn($this->lng->txt('lastname'), 'lastname', '20%'); $tbl->addColumn($this->lng->txt('paya_perm_stat'), 'perm_stat', '15%'); $tbl->addColumn($this->lng->txt('paya_perm_obj'), 'perm_obj', '15%'); $tbl->addColumn($this->lng->txt('paya_perm_coupons'), 'perm_coupons', '15%'); $tbl->addColumn('', 'options', '5%'); $tbl->setSelectAllCheckbox('trustee_id'); $tbl->addMultiCommand("deleteTrustee", $this->lng->txt("delete")); $tbl->addCommandButton('update', $this->lng->txt('apply')); $tbl->setData($a_result_set); $this->tpl->setVariable('TABLE', $tbl->getHTML()); return true; }
public function showCodes($a_show_delete = "") { $this->coupon_obj->setId($_GET['coupon_id']); if (!count($codes = $this->coupon_obj->getCodesByCouponId($_GET['coupon_id']))) { ilUtil::sendInfo($this->lng->txt('paya_coupons_codes_not_available')); $this->generateCodes(); return true; } $this->coupon_obj->getCouponById(ilUtil::stripSlashes($_GET['coupon_id'])); $this->ctrl->setParameter($this, 'coupon_id', $_GET['coupon_id']); $this->__showButtons(); $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); if ($a_show_delete) { switch ($a_show_delete) { case 'all': $del_cmd = 'performDeleteAllCodes'; $del_info = $this->lng->txt('paya_coupons_sure_delete_all_codes'); break; case 'selected': $del_cmd = 'performDeleteCodes'; $del_info = $this->lng->txt('paya_coupons_sure_delete_selected_codes'); break; } $oConfirmationGUI = new ilConfirmationGUI(); // set confirm/cancel commands $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this, $del_cmd)); $oConfirmationGUI->setHeaderText($del_info); $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "cancelDelete"); $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), $del_cmd); foreach ($codes as $code) { if (in_array($code['pcc_pk'], $_SESSION['paya_delete_codes'])) { $oConfirmationGUI->addItem('', $code['pcc_code'], $code['pcc_code']); } } $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHTML()); return true; } $_SESSION['paya_delete_codes'] = $_SESSION['paya_delete_codes'] ? $_SESSION['paya_delete_codes'] : array(); $counter = 0; foreach ($codes as $code) { $f_result[$counter]['coupon_id'] = ilUtil::formCheckbox(in_array($code['pcc_pk'], $_SESSION['paya_delete_codes']) ? 1 : 0, "codes[]", $code['pcc_pk']); $f_result[$counter]['coupon_code'] = $code['pcc_code']; $f_result[$counter]['usage_of_codes'] = $code['pcc_used'] . " " . strtolower($this->lng->txt('of')) . " " . $this->coupon_obj->getUses(); ++$counter; } $tbl = new ilShopTableGUI($this, 'showCodes'); $tbl->setTitle($this->lng->txt("paya_coupons_coupons")); $tbl->setId('tbl_show_codes'); $tbl->setRowTemplate("tpl.shop_coupons_row.html", "Services/Payment"); $tbl->addColumn('', 'coupon_id', '1%'); $tbl->addColumn($this->lng->txt('paya_coupons_code'), 'coupon_code', '30%'); $tbl->addColumn($this->lng->txt('paya_coupons_usage_of_codes'), 'usage_of_codes', '60%'); $tbl->setSelectAllCheckbox('codes[]'); $tbl->addCommandButton('generateCodes', $this->lng->txt('paya_coupons_generate_codes')); $tbl->addCommandButton('exportCodes', $this->lng->txt('export')); $tbl->addMultiCommand("deleteCodes", $this->lng->txt("delete")); $tbl->setData($f_result); $this->tpl->setVariable('TABLE', $tbl->getHTML()); return true; }