first commit
This commit is contained in:
47
templates/finances/category-edit.php
Normal file
47
templates/finances/category-edit.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?
|
||||
global $db;
|
||||
|
||||
ob_start();
|
||||
echo \Html::input( [
|
||||
'name' => 'group_id',
|
||||
'id' => 'name',
|
||||
'value' => $this -> category ? $this -> category['group_id'] : $this -> group_id,
|
||||
'type' => 'hidden'
|
||||
] );
|
||||
echo \Html::input( [
|
||||
'label' => 'Nazwa',
|
||||
'name' => 'name',
|
||||
'id' => 'name',
|
||||
'value' => $this -> category['name'],
|
||||
'class' => 'require',
|
||||
'inline' => true
|
||||
] );
|
||||
|
||||
$out = ob_get_clean();
|
||||
|
||||
$grid = new \gridEdit;
|
||||
$grid -> id = 'category-edit';
|
||||
$grid -> gdb_opt = $gdb;
|
||||
$grid -> include_plugins = true;
|
||||
$grid -> title = \S::get( 'parent-id' ) ? 'edycja <strong>podkategorii</strong>' : 'edycja <strong>kategorii</strong>';
|
||||
$grid -> title_small = \S::get( 'parent-id' ) ? 'Zarządzaj ustawieniami podkategorii' : 'Zarządzaj ustawieniami kategorii';
|
||||
$grid -> fields = [
|
||||
[
|
||||
'db' => 'id',
|
||||
'type' => 'hidden',
|
||||
'value' => $this -> category['id']
|
||||
], [
|
||||
'db' => 'parent_id',
|
||||
'type' => 'hidden',
|
||||
'value' => $this -> category['id'] ? $this -> category['parent_id'] : \S::get( 'parent-id' )
|
||||
]
|
||||
];
|
||||
$grid -> external_code = $out;
|
||||
$grid -> actions = [
|
||||
'save' => [ 'url' => '/finances/category_save/', 'back_url' => '/finances/main_view/' ],
|
||||
'cancel' => [ 'url' => '/finances/main_view/' ]
|
||||
];
|
||||
$grid -> persist_edit = true;
|
||||
$grid -> id_param = 'id';
|
||||
echo $grid -> draw();
|
||||
?>
|
||||
Reference in New Issue
Block a user