feat: Add 'wygeneruj_temat' parameter to topic_save method and update related templates for enhanced topic management
This commit is contained in:
8
.vscode/ftp-kr.sync.cache.json
vendored
8
.vscode/ftp-kr.sync.cache.json
vendored
@@ -65,8 +65,8 @@
|
|||||||
"controls": {
|
"controls": {
|
||||||
"class.BackendSites.php": {
|
"class.BackendSites.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 2508,
|
"size": 2912,
|
||||||
"lmtime": 1746373999381,
|
"lmtime": 1747161357796,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"class.Crm.php": {
|
"class.Crm.php": {
|
||||||
@@ -121,8 +121,8 @@
|
|||||||
"factory": {
|
"factory": {
|
||||||
"class.BackendSites.php": {
|
"class.BackendSites.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 2566,
|
"size": 2816,
|
||||||
"lmtime": 1746374004947,
|
"lmtime": 1747161382015,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"class.Crm.php": {
|
"class.Crm.php": {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class BackendSites
|
|||||||
$values = \S::json_to_array( \S::get( 'values' ) );
|
$values = \S::json_to_array( \S::get( 'values' ) );
|
||||||
|
|
||||||
$id = \factory\BackendSites::topic_save(
|
$id = \factory\BackendSites::topic_save(
|
||||||
(int)$values[ 'id' ], $values[ 'strona' ], $values[ 'kategoria' ], $values[ 'kategoria_id' ], $values['link'], $values[ 'temat' ], $values[ 'data_publikacji' ], $values[ 'opublikowany' ], $values[ 'zaakceptowany' ]
|
(int)$values[ 'id' ], $values[ 'strona' ], $values[ 'kategoria' ], $values[ 'kategoria_id' ], $values['link'], $values[ 'temat' ], $values['wygeneruj_temat'], $values[ 'data_publikacji' ], $values[ 'opublikowany' ], $values[ 'zaakceptowany' ]
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( $id )
|
if ( $id )
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class BackendSites
|
|||||||
return $mdb -> update( 'zaplecze_tematy', [ 'zaakceptowany' => 1 ], [ 'id' => $id ] );
|
return $mdb -> update( 'zaplecze_tematy', [ 'zaakceptowany' => 1 ], [ 'id' => $id ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function topic_save( $id, $strona, $kategoria, $kategoria_id, $link, $temat, $data_publikacji, $opublikowany, $zaakceptowany )
|
static public function topic_save( $id, $strona, $kategoria, $kategoria_id, $link, $temat, $wygeneruj_temat, $data_publikacji, $opublikowany, $zaakceptowany )
|
||||||
{
|
{
|
||||||
global $mdb;
|
global $mdb;
|
||||||
if ( !$id )
|
if ( !$id )
|
||||||
@@ -32,6 +32,7 @@ class BackendSites
|
|||||||
'kategoria_id' => $kategoria_id,
|
'kategoria_id' => $kategoria_id,
|
||||||
'link' => $link ? $link : null,
|
'link' => $link ? $link : null,
|
||||||
'temat' => $temat,
|
'temat' => $temat,
|
||||||
|
'wygeneruj_temat' => $wygeneruj_temat == 'on' ? 1 : 0,
|
||||||
'data_publikacji' => $data_publikacji,
|
'data_publikacji' => $data_publikacji,
|
||||||
'opublikowany' => $opublikowany == 'on' ? 1 : 0,
|
'opublikowany' => $opublikowany == 'on' ? 1 : 0,
|
||||||
'zaakceptowany' => $zaakceptowany == 'on' ? 1 : 0,
|
'zaakceptowany' => $zaakceptowany == 'on' ? 1 : 0,
|
||||||
@@ -45,6 +46,7 @@ class BackendSites
|
|||||||
'kategoria_id' => $kategoria_id,
|
'kategoria_id' => $kategoria_id,
|
||||||
'link' => $link ? $link : null,
|
'link' => $link ? $link : null,
|
||||||
'temat' => $temat,
|
'temat' => $temat,
|
||||||
|
'wygeneruj_temat' => $wygeneruj_temat == 'on' ? 1 : 0,
|
||||||
'data_publikacji' => $data_publikacji,
|
'data_publikacji' => $data_publikacji,
|
||||||
'opublikowany' => $opublikowany == 'on' ? 1 : 0,
|
'opublikowany' => $opublikowany == 'on' ? 1 : 0,
|
||||||
'zaakceptowany' => $zaakceptowany == 'on' ? 1 : 0,
|
'zaakceptowany' => $zaakceptowany == 'on' ? 1 : 0,
|
||||||
|
|||||||
@@ -37,6 +37,13 @@ ob_start();
|
|||||||
'value' => $this -> topic['temat'],
|
'value' => $this -> topic['temat'],
|
||||||
'inline' => true
|
'inline' => true
|
||||||
] );?>
|
] );?>
|
||||||
|
<?= \Html::input_switch( [
|
||||||
|
'label' => 'Wygeneruj temat',
|
||||||
|
'name' => 'wygeneruj_temat',
|
||||||
|
'id' => 'wygeneruj_temat',
|
||||||
|
'checked' => $this -> topic['wygeneruj_temat'] == 1 ? true : false,
|
||||||
|
'inline' => true
|
||||||
|
] );?>
|
||||||
<?= \Html::input( [
|
<?= \Html::input( [
|
||||||
'label' => 'Data publikacji',
|
'label' => 'Data publikacji',
|
||||||
'name' => 'data_publikacji',
|
'name' => 'data_publikacji',
|
||||||
@@ -65,7 +72,7 @@ $grid = new \gridEdit;
|
|||||||
$grid -> id = 'client-edit';
|
$grid -> id = 'client-edit';
|
||||||
$grid -> gdb_opt = $gdb;
|
$grid -> gdb_opt = $gdb;
|
||||||
$grid -> include_plugins = true;
|
$grid -> include_plugins = true;
|
||||||
$grid -> title = 'Edycja <strong>tematu zbiorowego</strong>';
|
$grid -> title = 'Edycja <strong>tematu</strong>';
|
||||||
$grid -> fields = [
|
$grid -> fields = [
|
||||||
[
|
[
|
||||||
'db' => 'id',
|
'db' => 'id',
|
||||||
|
|||||||
@@ -28,9 +28,16 @@ $grid -> columns_view = [
|
|||||||
], [
|
], [
|
||||||
'name' => 'Link',
|
'name' => 'Link',
|
||||||
'db' => 'link',
|
'db' => 'link',
|
||||||
|
'cut' => 50,
|
||||||
], [
|
], [
|
||||||
'name' => 'Temat',
|
'name' => 'Temat',
|
||||||
'db' => 'temat',
|
'db' => 'temat',
|
||||||
|
], [
|
||||||
|
'name' => 'Wygeneruj temat',
|
||||||
|
'db' => 'wygeneruj_temat',
|
||||||
|
'td' => [ 'class' => 'g-center' ],
|
||||||
|
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
|
||||||
|
'php' => 'echo ( (int)[wygeneruj_temat] == 1 ) ? "tak" : "<span class=\"text-danger\">nie</span>";',
|
||||||
], [
|
], [
|
||||||
'name' => 'Data publikacji',
|
'name' => 'Data publikacji',
|
||||||
'db' => 'data_publikacji',
|
'db' => 'data_publikacji',
|
||||||
@@ -60,7 +67,7 @@ $grid -> columns_view = [
|
|||||||
];
|
];
|
||||||
$grid -> buttons = [
|
$grid -> buttons = [
|
||||||
[
|
[
|
||||||
'label' => 'Dodaj temat ogólny',
|
'label' => 'Dodaj temat',
|
||||||
'url' => '/backend_sites/topic_edit/',
|
'url' => '/backend_sites/topic_edit/',
|
||||||
'icon' => 'fa-plus-circle',
|
'icon' => 'fa-plus-circle',
|
||||||
'class' => 'btn-success'
|
'class' => 'btn-success'
|
||||||
|
|||||||
Reference in New Issue
Block a user