From dc513dc29a0c2ffbf5bf4047fc4e53aef68c5c98 Mon Sep 17 00:00:00 2001 From: MatteoPistorello Date: Fri, 11 Mar 2022 13:01:11 +0100 Subject: [PATCH] Fix aggiunta record da plugin --- include/top.php | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/include/top.php b/include/top.php index 2c674f86d..b2d31d58b 100755 --- a/include/top.php +++ b/include/top.php @@ -502,30 +502,32 @@ if (Auth::check()) { '; // Tab dei plugin - $plugins = $dbo->fetchArray('SELECT id, title, options, options2 FROM zz_plugins WHERE idmodule_to='.prepare($id_module)." AND position='tab' AND enabled = 1 ORDER BY zz_plugins.order DESC"); - foreach ($plugins as $plugin) { + if (!empty($id_record)) { + $plugins = $dbo->fetchArray('SELECT id, title, options, options2 FROM zz_plugins WHERE idmodule_to='.prepare($id_module)." AND position='tab' AND enabled = 1 ORDER BY zz_plugins.order DESC"); + foreach ($plugins as $plugin) { + - - //Badge count per record plugin - $count = 0; - if (!empty($plugin['options2'])){ - $opt = json_decode($plugin['options2'], true); - }else{ - $opt = json_decode($plugin['options'], true); - } + //Badge count per record plugin + $count = 0; + if (!empty($plugin['options2'])){ + $opt = json_decode($plugin['options2'], true); + }else{ + $opt = json_decode($plugin['options'], true); + } - if (!empty($opt)){ - $q = str_replace('|id_parent|', $id_record, $opt['main_query'][0]['query']); - $count = $dbo->fetchNum($q); - } + if (!empty($opt)){ + $q = str_replace('|id_parent|', $id_record, $opt['main_query'][0]['query']); + $count = $dbo->fetchNum($q); + } - echo ' -
  • - - '.$plugin['title'].' - '.($count>0 ? $count: '').' - -
  • '; + echo ' +
  • + + '.$plugin['title'].' + '.($count>0 ? $count: '').' + +
  • '; + } } // Tab per le note interne @@ -536,7 +538,7 @@ if (Auth::check()) {
  • '.tr('Note interne').' - '.($notes->count() ?: '').' + '.($notes->count() ?: '').'
  • '; }