From 42e45d4a7a2a0ec0905aebb08fa3656f5f5c4665 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 6 Jan 2021 21:14:40 +0100 Subject: [PATCH 1/7] Fix date and datetime type in commonfield_add.tpl --- htdocs/core/tpl/commonfields_add.tpl.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index 0bf2a60d0fe..0645505ea34 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -55,6 +55,8 @@ foreach ($object->fields as $key => $val) print ''; if (in_array($val['type'], array('int', 'integer'))) $value = GETPOST($key, 'int'); elseif ($val['type'] == 'text' || $val['type'] == 'html') $value = GETPOST($key, 'none'); + elseif ($val['type'] == 'date') $value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); + elseif ($val['type'] == 'datetime') $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); else $value = GETPOST($key, 'alpha'); if ($val['noteditable']) print $object->showOutputField($val, $key, $value, '', '', '', 0); else print $object->showInputField($val, $key, $value, '', '', '', 0); From 8918299364a4fe7e26fad0c73ffcc7327e7c1be5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Jan 2021 21:24:37 +0100 Subject: [PATCH 2/7] Update commonfields_add.tpl.php --- htdocs/core/tpl/commonfields_add.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index 0645505ea34..c7311fa717d 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -55,7 +55,7 @@ foreach ($object->fields as $key => $val) print ''; if (in_array($val['type'], array('int', 'integer'))) $value = GETPOST($key, 'int'); elseif ($val['type'] == 'text' || $val['type'] == 'html') $value = GETPOST($key, 'none'); - elseif ($val['type'] == 'date') $value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); + elseif ($val['type'] == 'date') $value = dol_mktime(0, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); elseif ($val['type'] == 'datetime') $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); else $value = GETPOST($key, 'alpha'); if ($val['noteditable']) print $object->showOutputField($val, $key, $value, '', '', '', 0); From 1b7d194e18b7eb60cdacb56828626b2e77ca0fcc Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 7 Jan 2021 09:03:25 +0100 Subject: [PATCH 3/7] Finish fix on add form values --- htdocs/core/tpl/commonfields_add.tpl.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index c7311fa717d..13bbdd0c857 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -55,9 +55,10 @@ foreach ($object->fields as $key => $val) print ''; if (in_array($val['type'], array('int', 'integer'))) $value = GETPOST($key, 'int'); elseif ($val['type'] == 'text' || $val['type'] == 'html') $value = GETPOST($key, 'none'); - elseif ($val['type'] == 'date') $value = dol_mktime(0, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); + elseif ($val['type'] == 'date') $value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); elseif ($val['type'] == 'datetime') $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); - else $value = GETPOST($key, 'alpha'); + elseif ($val['type'] == 'boolean') $value = (GETPOST($key) == 'on' ? 1 : 0); + else $value = GETPOST($key, 'alphanohtml'); if ($val['noteditable']) print $object->showOutputField($val, $key, $value, '', '', '', 0); else print $object->showInputField($val, $key, $value, '', '', '', 0); print ''; From 24c926b32f046bb7b60d5c4858cb6f63287182c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jan 2021 15:09:16 +0100 Subject: [PATCH 4/7] Update doc --- htdocs/includes/odtphp/odf.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index d84559eb459..c2a145f5e90 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -155,9 +155,9 @@ class Odf '', '' ); - + $this->vars[$tag] = $this->_replaceHtmlWithOdtTag($this->_getDataFromHtml($value), $customStyles, $fontDeclarations); - + foreach ($customStyles as $key => $val) { array_push($automaticStyles, '' . $val . ''); } @@ -181,7 +181,7 @@ class Odf $this->contentXml = str_replace('', $fonts . '', $this->contentXml); } else $this->vars[$tag] = preg_replace('/(\r\n|\r|\n)/i', "", $value); - + return $this; } @@ -804,6 +804,7 @@ IMG; // Export to PDF using LibreOffice if ($conf->global->MAIN_ODT_AS_PDF == 'libreoffice') { + // Install prerequisites: apt install soffice libreoffice-common libreoffice-writer libreoffice-java-common // using windows libreoffice that must be in path // using linux/mac libreoffice that must be in path // Note PHP Config "fastcgi.impersonate=0" must set to 0 - Default is 1 @@ -840,7 +841,7 @@ IMG; } else { - // deprecated old method + // deprecated old method using odt2pdf.sh (native, jodconverter, ...) $tmpname=preg_replace('/\.odt/i', '', $name); if (!empty($conf->global->MAIN_DOL_SCRIPTS_ROOT)) From 243b227c33891ee3f105dfbe98f725d1586eacdf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jan 2021 15:09:49 +0100 Subject: [PATCH 5/7] Fix prerequisites --- htdocs/includes/odtphp/odf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index c2a145f5e90..87cbf621da7 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -804,7 +804,7 @@ IMG; // Export to PDF using LibreOffice if ($conf->global->MAIN_ODT_AS_PDF == 'libreoffice') { - // Install prerequisites: apt install soffice libreoffice-common libreoffice-writer libreoffice-java-common + // Install prerequisites: apt install soffice libreoffice-common libreoffice-writer // using windows libreoffice that must be in path // using linux/mac libreoffice that must be in path // Note PHP Config "fastcgi.impersonate=0" must set to 0 - Default is 1 From fe7be8362f02cafa17a844db7871a99466227fc7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jan 2021 12:03:28 +0100 Subject: [PATCH 6/7] Fix td balance --- htdocs/admin/system/filecheck.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index b1124e88add..22bd07155d8 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -273,7 +273,7 @@ if (!$error && $xml) } else { - $out .= ''.$langs->trans("None").''; + $out .= ''.$langs->trans("None").''; } $out .= ''; $out .= ''; @@ -328,7 +328,7 @@ if (!$error && $xml) } else { - $out .= ''.$langs->trans("None").''; + $out .= ''.$langs->trans("None").''; } $out .= ''; $out .= ''; @@ -383,7 +383,7 @@ if (!$error && $xml) } else { - $out .= ''.$langs->trans("None").''; + $out .= ''.$langs->trans("None").''; } $out .= ''; $out .= ''; From 788ef257a97ab0eaa648b50b60d0b7998fe35925 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Jan 2021 13:02:05 +0100 Subject: [PATCH 7/7] Fix GETPOST for qty --- htdocs/bom/bom_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index b28cf459094..2507f0cfa97 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -198,7 +198,7 @@ if (empty($reshook)) $error = 0; // Set if we used free entry or predefined product - $qty = price2num(GETPOST('qty', 'int')); + $qty = price2num(GETPOST('qty', 'alpha')); $qty_frozen = GETPOST('qty_frozen', 'int'); $disable_stock_change = GETPOST('disable_stock_change', 'int'); $efficiency = price2num(GETPOST('efficiency', 'int'));