2
0
forked from Wavyzz/dolibarr

# WARNING: head commit changed in the meantime

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
This commit is contained in:
Laurent Destailleur
2022-02-04 15:40:28 +01:00
9 changed files with 35 additions and 8 deletions

View File

@@ -2304,7 +2304,11 @@ abstract class CommonObject
// Triggers
if (!$error && !$notrigger) {
// Call triggers
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++;
}

View File

@@ -241,8 +241,15 @@ class Utils
// MYSQL
if ($type == 'mysql' || $type == 'mysqli') {
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

View File

@@ -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

View File

@@ -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

View File

@@ -276,7 +276,7 @@ function DisplayPositionCard(&$object)
$morehtmlref = '<div class="refidno">';
$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 .= '<br>'.$langs->trans('Job').' : '.$job->getNomUrl(1);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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);