ver. 0.269: ShopPaymentMethod refactor + Apilo keepalive
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
|
||||
@@ -0,0 +1 @@
|
||||
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
|
||||
@@ -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();
|
||||
Reference in New Issue
Block a user