diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 867020b915d..35db7816738 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2304,7 +2304,11 @@ abstract class CommonObject // Triggers if (!$error && !$notrigger) { // Call triggers - $result = $this->call_trigger(strtoupper(get_class($this)).'_MODIFY', $user); + if (get_class($this) == 'Commande') { + $result = $this->call_trigger('ORDER_MODIFY', $user); + } else { + $result = $this->call_trigger(strtoupper(get_class($this)).'_MODIFY', $user); + } if ($result < 0) { $error++; } diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index b408985a92d..2fa329406fb 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -241,8 +241,15 @@ class Utils // MYSQL if ($type == 'mysql' || $type == 'mysqli') { - $cmddump = $conf->global->SYSTEMTOOLS_MYSQLDUMP; - + if (empty($conf->global->SYSTEMTOOLS_MYSQLDUMP)) { + $cmddump = $db->getPathOfDump(); + } else { + $cmddump = $conf->global->SYSTEMTOOLS_MYSQLDUMP; + } + if (empty($cmddump)) { + $this->error = "Failed to detect command to use for mysqldump. Try a manual backup before to set path of command."; + return -1; + } $outputfile = $outputdir.'/'.$file; // for compression format, we add extension diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c3215bdf18a..4439a38509b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9360,7 +9360,7 @@ function dolIsAllowedForPreview($file) /** - * Return mime type of a file + * Return MIME type of a file from its name with extension. * * @param string $file Filename we looking for MIME type * @param string $default Default mime type if extension not found in known list diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index bd31311f4bf..2401791bb5f 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -59,7 +59,7 @@ class Position extends CommonObject /** * @var int Does object support extrafields ? 0=No, 1=Yes */ - public $isextrafieldmanaged = 1; + public $isextrafieldmanaged = 0; /** * @var string String with name of icon for position. Must be the part after the 'object_' into object_position.png diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php index 3287091dcdb..c26d981a324 100644 --- a/htdocs/hrm/position_card.php +++ b/htdocs/hrm/position_card.php @@ -276,7 +276,7 @@ function DisplayPositionCard(&$object) $morehtmlref = '
'; $u_position = new User(($db)); $u_position->fetch($object->fk_user); - $morehtmlref .= $langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $morehtmlref .= $langs->trans('Employee').' : '.($u_position->id > 0 ? $u_position->getNomUrl(1) : ''); $job = new Job($db); $job->fetch($object->fk_job); $morehtmlref .= '
'.$langs->trans('Job').' : '.$job->getNomUrl(1); diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 12b0b92a13e..7a84c622b47 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -192,7 +192,7 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (14 -- MALI (id country=147) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1471, 147, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1471, 147, '18','0','VAT rate - standard', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1472, 147, '18','0','VAT rate - standard', 1); -- MONACO (id country=27) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 271, 27, '0','0','VAT rate 0 ou non applicable',1); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 9a1eda5c8fd..7f76dbeff65 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5370,7 +5370,18 @@ class Product extends CommonObject } $stock_commande_fournisseur = $this->stats_commande_fournisseur['qty']; } + if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->reception->enabled)) { + // Case module reception is not used + $filterStatus = '4'; + if (isset($includedraftpoforvirtual)) { + $filterStatus = '0,'.$filterStatus; + } + $result = $this->load_stats_reception(0, $filterStatus, 1); + if ($result < 0) dol_print_error($this->db, $this->error); + $stock_reception_fournisseur = $this->stats_reception['qty']; + } if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && !empty($conf->reception->enabled)) { + // Case module reception is used $filterStatus = '4'; if (isset($includedraftpoforvirtual)) { $filterStatus = '0,'.$filterStatus; diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 23258aa1e86..e8e7bbda3cd 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -288,7 +288,7 @@ if ($resql) { if ($search_sale) { $param .= "&search_sale=".urlencode($search_sale); } - if (!empty($search_categ) && $search_categ != '-1') { + if ($search_categ > 0) { $param .= "&search_categ=".urlencode($search_categ); } if ($toolowstock) { diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 24c41e5e927..dee62999cf4 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -229,6 +229,11 @@ $original_file = str_replace('..\\', '/', $original_file); // Find the subdirectory name as the reference $refname = basename(dirname($original_file)."/"); +// Check that file is allowed for view with viewimage.php +if (!dolIsAllowedForPreview($original_file)) { + accessforbidden('This file is not qualified for preview', 0, 0, 1); +} + // Security check if (empty($modulepart)) { accessforbidden('Bad value for parameter modulepart', 0, 0, 1);