function delpayment_exec($Frm, $Err) { if (!$Err) { PaymentMethod::delete($Frm->GetNmValueI('id')); $Frm->_gui->informer->OK("Удалено"); page_reloadSubSec(); } }
// oplata $tbl = $GUI->Table("sprav" . $n); if (user_can($GUI->mmenu->selected->id, $GUI->mmenu->selected->selected->id, $_SESSION["user"]["data"]["group_id"], "Редактировать")) { $tbl->RowEvent2 = "document.location.href=\"?section=sprav&subsection=1&edit=%var%\""; } /* $r = $tbl->NewColumn(); $r->Caption = "Номер"; $r->DoSort = true; $r->Key = "id"; */ $r = $tbl->NewColumn(); $r->Caption = "Наименование"; $r->DoSort = true; $r->Key = "name"; $r = $tbl->NewColumn(); $r->Caption = "В форме заказа"; $r->DoSort = true; $r->Key = "onsite"; $r->Process = "tp_payments_onsite"; $r = $tbl->NewColumn(); $r->Caption = ""; $r->Process = "tp_payments_cmds"; foreach (PaymentMethod::findAll() as $method) { $tbl->AddRow($method, "id"); } $tbl->InlineSort(true); if (user_can($GUI->mmenu->selected->id, $GUI->mmenu->selected->selected->id, $_SESSION["user"]["data"]["group_id"], "Добавить")) { $GUI->cmdmenu->AddItem("Добавить", "?section=sprav&subsection=1&add"); } }
/** * @deprecated * @param $payment_id * @return mixed */ function get_payment_name($payment_id) { try { $payment_method = PaymentMethod::find($payment_id); return $payment_method['name']; } catch (InvalidArgumentException $e) { return 'не указана'; } catch (EntityNotFoundException $e) { return 'не указана'; } }