From 1dae21e6084774c0181c2e4e5cb8ed0a56cfb3cc Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Tue, 9 Mar 2021 18:44:06 +0100 Subject: [PATCH 1/6] FIX: Buttons to disable bindings not working --- htdocs/accountancy/admin/index.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 00922f90454..64ebf2d1ab0 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -7,6 +7,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2021 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -385,11 +386,11 @@ foreach ($list_binding as $key) print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_SALES").''; if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -398,11 +399,11 @@ print ''; print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").''; if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -411,11 +412,11 @@ print ''; print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").''; if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } From ccf71cd980bf12c34bae4708faba2f853b21849f Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 10 Mar 2021 11:56:44 +0100 Subject: [PATCH 2/6] fix modulebuilder boxes showboxes --- htdocs/core/class/html.formother.class.php | 4 +++- htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index c71029769f2..090d1d796eb 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1076,7 +1076,7 @@ class FormOther { if (empty($user->conf->$confuserzone) || $box->fk_user == $user->id) $boxidactivatedforuser[$box->id] = $box->id; // We keep only boxes to show for user } - +//var_dump($boxidactivatedforuser); // Define selectboxlist $arrayboxtoactivatelabel = array(); if (!empty($user->conf->$confuserzone)) @@ -1209,6 +1209,7 @@ class FormOther if (!empty($conf->global->MAIN_BOXES_MAXLINES)) $box_max_lines = $conf->global->MAIN_BOXES_MAXLINES; $ii = 0; + foreach ($boxactivated as $key => $box) { if ((!empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue; @@ -1220,6 +1221,7 @@ class FormOther //print 'box_order '.$boxactivated[$ii]->box_order.'
'; // Show box $box->loadBox($box_max_lines); + //var_dump($key,$box); $boxlista .= $box->showBox(null, null, 1); } } diff --git a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php index e356792ed42..46fe523600d 100644 --- a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php +++ b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php @@ -206,6 +206,6 @@ class mymodulewidget1 extends ModeleBoxes { // You may make your own code here… // … or use the parent's class function using the provided head and contents templates - parent::showBox($this->info_box_head, $this->info_box_contents); + return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } From bd6aae71a2522cb373a1758675547b11ac7d5bd3 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 10 Mar 2021 11:58:21 +0100 Subject: [PATCH 3/6] fix modulebuilder boxes showboxes --- htdocs/core/class/html.formother.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 090d1d796eb..c71029769f2 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1076,7 +1076,7 @@ class FormOther { if (empty($user->conf->$confuserzone) || $box->fk_user == $user->id) $boxidactivatedforuser[$box->id] = $box->id; // We keep only boxes to show for user } -//var_dump($boxidactivatedforuser); + // Define selectboxlist $arrayboxtoactivatelabel = array(); if (!empty($user->conf->$confuserzone)) @@ -1209,7 +1209,6 @@ class FormOther if (!empty($conf->global->MAIN_BOXES_MAXLINES)) $box_max_lines = $conf->global->MAIN_BOXES_MAXLINES; $ii = 0; - foreach ($boxactivated as $key => $box) { if ((!empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue; @@ -1221,7 +1220,6 @@ class FormOther //print 'box_order '.$boxactivated[$ii]->box_order.'
'; // Show box $box->loadBox($box_max_lines); - //var_dump($key,$box); $boxlista .= $box->showBox(null, null, 1); } } From 05532ca6b7092210695d92e3f07d70a874cb1b1b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 12 Mar 2021 08:35:13 +0100 Subject: [PATCH 4/6] FIX missing video mime --- htdocs/core/lib/functions.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 052e5e3efc9..02b7b209124 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8387,8 +8387,9 @@ function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0) // Audio if (preg_match('/\.(mp3|ogg|au|wav|wma|mid)$/i', $tmpfile)) { $mime = 'audio'; $imgmime = 'audio.png'; $famime = 'file-audio-o'; } // Video - if (preg_match('/\.ogv$/i', $tmpfile)) { $mime = 'video/ogg'; $imgmime = 'video.png'; $famime = 'file-video-o'; } - if (preg_match('/\.webm$/i', $tmpfile)) { $mime = 'video/webm'; $imgmime = 'video.png'; $famime = 'file-video-o'; } + if (preg_match('/\.mp4$/i', $tmpfile)) { $mime = 'video/mp4'; $imgmime = 'video.png'; $famime = 'file-video-o'; } + if (preg_match('/\.(ogv|ogg)$/i', $tmpfile)) { $mime = 'video/ogg'; $imgmime = 'video.png'; $famime = 'file-video-o'; } + if (preg_match('/\.(webm|wbm)$/i', $tmpfile)) { $mime = 'video/webm'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.avi$/i', $tmpfile)) { $mime = 'video/x-msvideo'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.divx$/i', $tmpfile)) { $mime = 'video/divx'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.xvid$/i', $tmpfile)) { $mime = 'video/xvid'; $imgmime = 'video.png'; $famime = 'file-video-o'; } From 290f49a3e07d9524bf3e99b4db3b3492b1b41989 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 12 Mar 2021 08:39:36 +0100 Subject: [PATCH 5/6] FIX wrong extension --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 02b7b209124..6ffd88ea45b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8388,7 +8388,7 @@ function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0) if (preg_match('/\.(mp3|ogg|au|wav|wma|mid)$/i', $tmpfile)) { $mime = 'audio'; $imgmime = 'audio.png'; $famime = 'file-audio-o'; } // Video if (preg_match('/\.mp4$/i', $tmpfile)) { $mime = 'video/mp4'; $imgmime = 'video.png'; $famime = 'file-video-o'; } - if (preg_match('/\.(ogv|ogg)$/i', $tmpfile)) { $mime = 'video/ogg'; $imgmime = 'video.png'; $famime = 'file-video-o'; } + if (preg_match('/\.ogv$/i', $tmpfile)) { $mime = 'video/ogg'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.(webm|wbm)$/i', $tmpfile)) { $mime = 'video/webm'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.avi$/i', $tmpfile)) { $mime = 'video/x-msvideo'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.divx$/i', $tmpfile)) { $mime = 'video/divx'; $imgmime = 'video.png'; $famime = 'file-video-o'; } From 5375add08c9e982ee9155552c6619a0a14c244d6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 12 Mar 2021 08:41:56 +0100 Subject: [PATCH 6/6] FIX just add mp4 --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6ffd88ea45b..b63f9d72f26 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8389,7 +8389,7 @@ function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0) // Video if (preg_match('/\.mp4$/i', $tmpfile)) { $mime = 'video/mp4'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.ogv$/i', $tmpfile)) { $mime = 'video/ogg'; $imgmime = 'video.png'; $famime = 'file-video-o'; } - if (preg_match('/\.(webm|wbm)$/i', $tmpfile)) { $mime = 'video/webm'; $imgmime = 'video.png'; $famime = 'file-video-o'; } + if (preg_match('/\.webm$/i', $tmpfile)) { $mime = 'video/webm'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.avi$/i', $tmpfile)) { $mime = 'video/x-msvideo'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.divx$/i', $tmpfile)) { $mime = 'video/divx'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.xvid$/i', $tmpfile)) { $mime = 'video/xvid'; $imgmime = 'video.png'; $famime = 'file-video-o'; }