From 923bad4da68e20fafdd2b41001182f3378f38ee8 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sat, 10 Mar 2018 23:59:34 +0100 Subject: [PATCH 1/7] add sql log on install debug new global variable INSTALL_DISPLAY_SQL_LOG to display sql log on module install --- htdocs/core/modules/DolibarrModules.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index eaf674d5eea..5eb049f8323 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1049,7 +1049,7 @@ class DolibarrModules // Can not be abstract, because we need to insta { if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data') { - $result=run_sql($dir.$file,1,'',1); + $result=run_sql($dir.$file, $conf->global->INSTALL_DISPLAY_SQL_LOG, '', 1); if ($result <= 0) $error++; } } @@ -1067,7 +1067,7 @@ class DolibarrModules // Can not be abstract, because we need to insta { if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data') { - $result=run_sql($dir.$file,1,'',1); + $result=run_sql($dir.$file, $conf->global->INSTALL_DISPLAY_SQL_LOG, '', 1); if ($result <= 0) $error++; } } @@ -1085,7 +1085,7 @@ class DolibarrModules // Can not be abstract, because we need to insta { if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data') { - $result=run_sql($dir.$file,1,'',1); + $result=run_sql($dir.$file, $conf->global->INSTALL_DISPLAY_SQL_LOG, '', 1); if ($result <= 0) $error++; } } @@ -1103,7 +1103,7 @@ class DolibarrModules // Can not be abstract, because we need to insta { if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,6) == 'update') { - $result=run_sql($dir.$file,1,'',1); + $result=run_sql($dir.$file, $conf->global->INSTALL_DISPLAY_SQL_LOG, '', 1); if ($result <= 0) $error++; } } From bfaffe6692edb2a80e07bc333462c76be9ba0c41 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sun, 11 Mar 2018 10:51:05 +0100 Subject: [PATCH 2/7] Changes Done --- htdocs/core/modules/DolibarrModules.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 5eb049f8323..c1c570e8269 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1049,7 +1049,7 @@ class DolibarrModules // Can not be abstract, because we need to insta { if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data') { - $result=run_sql($dir.$file, $conf->global->INSTALL_DISPLAY_SQL_LOG, '', 1); + $result=run_sql($dir.$file, empty($conf->global->INSTALL_DISPLAY_SQL_LOG)?0:1, '', 1); if ($result <= 0) $error++; } } @@ -1067,7 +1067,7 @@ class DolibarrModules // Can not be abstract, because we need to insta { if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data') { - $result=run_sql($dir.$file, $conf->global->INSTALL_DISPLAY_SQL_LOG, '', 1); + $result=run_sql($dir.$file, empty($conf->global->INSTALL_DISPLAY_SQL_LOG)?0:1, '', 1); if ($result <= 0) $error++; } } @@ -1085,7 +1085,7 @@ class DolibarrModules // Can not be abstract, because we need to insta { if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data') { - $result=run_sql($dir.$file, $conf->global->INSTALL_DISPLAY_SQL_LOG, '', 1); + $result=run_sql($dir.$file, empty($conf->global->INSTALL_DISPLAY_SQL_LOG)?0:1, '', 1); if ($result <= 0) $error++; } } @@ -1103,7 +1103,7 @@ class DolibarrModules // Can not be abstract, because we need to insta { if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,6) == 'update') { - $result=run_sql($dir.$file, $conf->global->INSTALL_DISPLAY_SQL_LOG, '', 1); + $result=run_sql($dir.$file, empty($conf->global->INSTALL_DISPLAY_SQL_LOG)?0:1, '', 1); if ($result <= 0) $error++; } } From 26dbd4f3a1199fb673b00588e0ba9f4e1e01588a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 11 Mar 2018 11:43:12 +0100 Subject: [PATCH 3/7] Update linkedobjectblock.tpl.php --- htdocs/ticketsup/tpl/linkedobjectblock.tpl.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/ticketsup/tpl/linkedobjectblock.tpl.php b/htdocs/ticketsup/tpl/linkedobjectblock.tpl.php index cd23471129e..4c1a00c3d82 100644 --- a/htdocs/ticketsup/tpl/linkedobjectblock.tpl.php +++ b/htdocs/ticketsup/tpl/linkedobjectblock.tpl.php @@ -16,6 +16,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +// Protection to avoid direct call of template +if (empty($conf) || ! is_object($conf)) +{ + print "Error, template page can't be called as URL"; + exit; +} ?> @@ -55,4 +61,4 @@ foreach ($linkedObjectBlock as $object) { - \ No newline at end of file + From 7ffce2a28f99df117c269e3389c2128d7803061d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Mar 2018 16:48:44 +0100 Subject: [PATCH 4/7] Dolibarize --- htdocs/core/class/html.formticketsup.class.php | 2 +- htdocs/ticketsup/class/ticketsup.class.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formticketsup.class.php b/htdocs/core/class/html.formticketsup.class.php index 0c10c256e83..329d23a7c51 100644 --- a/htdocs/core/class/html.formticketsup.class.php +++ b/htdocs/core/class/html.formticketsup.class.php @@ -624,7 +624,7 @@ class FormTicketsup $filterarray = explode(',', $filtertype); } - $ticketstat->load_cache_severities_tickets(); + $ticketstat->loadCacheSeveritiesTickets(); print '