ver. 0.269: ShopPaymentMethod refactor + Apilo keepalive

This commit is contained in:
2026-02-14 15:22:02 +01:00
parent 847fdbbf3f
commit 9c23e7f16b
31 changed files with 1832 additions and 269 deletions

View File

@@ -0,0 +1 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>

View File

@@ -0,0 +1 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -1,65 +0,0 @@
<?php
global $gdb;
foreach ( $this -> apilo_payment_types_list as $payment_type )
{
if ( isset( $payment_type['name'] ) && isset( $payment_type['id'] ) )
$payment_types[ $payment_type['id'] ] = $payment_type['name'];
}
$grid = new \grid( 'pp_shop_payment_methods' );
$grid -> gdb_opt = $gdb;
$grid -> debug = true;
$grid -> order = [ 'column' => 'id', 'type' => 'ASC' ];
$grid -> search = [
[ 'name' => 'Nazwa', 'db' => 'name', 'type' => 'text' ],
[ 'name' => 'Aktywny', 'db' => 'status', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
], [
'name' => 'Nazwa',
'db' => 'name'
], [
'name' => 'Aktywny',
'db' => 'status',
'replace' => [ 'array' => [ 0 => '<span style="color: #FF0000;">nie</span>', 1 => 'tak' ] ],
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ]
], [
'name' => 'Typ płatności Apilo',
'db' => 'apilo_payment_type_id',
'replace' => [ 'array' => $payment_types ],
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ]
]
];
$grid -> columns_edit = [
[
'name' => 'Nazwa',
'db' => 'name',
'type' => 'text',
'readonly-edit' => true
], [
'name' => 'Opis',
'db' => 'description',
'type' => 'textarea'
], [
'db' => 'apilo_payment_type_id',
'type' => 'select',
'name' => 'Typ płatności Apilo',
'replace' => [ 'array' => $payment_types ],
], [
'name' => 'Aktywny',
'db' => 'status',
'type' => 'select',
'default_value' => 1,
'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ]
]
];
$grid -> actions = [ 'edit' => true ];
echo $grid -> draw();