diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 3102438b474..17196f82e6f 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -97,14 +97,14 @@ class Utils if ($choice == 'allfiles') { // Delete all files (except install.lock, do not follow symbolic links) if ($dolibarr_main_data_root) { - $filesarray = dol_dir_list($dolibarr_main_data_root, "all", 0, '', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1); + $filesarray = dol_dir_list($dolibarr_main_data_root, "all", 0, '', '(\.lock|\.unlock)$', 'name', SORT_ASC, 0, 0, '', 1); } } if ($choice == 'logfile' || $choice == 'logfiles') { // Define files log if ($dolibarr_main_data_root) { - $filesarray = dol_dir_list($dolibarr_main_data_root, "files", 0, '.*\.log[\.0-9]*(\.gz)?$', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1); + $filesarray = dol_dir_list($dolibarr_main_data_root, "files", 0, '.*\.log[\.0-9]*(\.gz)?$', '(\.lock|\.unlock)$', 'name', SORT_ASC, 0, 0, '', 1); } if (!empty($conf->syslog->enabled)) { diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 8988ffce455..101734cb5cc 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -180,6 +180,7 @@ if (empty($reshook)) { } if ($action == 'save_price') { + $ref_fourn_price_id = GETPOSTINT('ref_fourn_price_id'); $id_fourn = GETPOST("id_fourn"); if (empty($id_fourn)) { $id_fourn = GETPOST("search_id_fourn"); @@ -264,7 +265,7 @@ if (empty($reshook)) { if (!$error) { $db->begin(); - if (!$error) { + if (empty($ref_fourn_price_id)) { $ret = $object->add_fournisseur($user, $id_fourn, $ref_fourn_old, $quantity); // This insert record with no value for price. Values are update later with update_buyprice if ($ret == -3) { $error++; @@ -285,8 +286,8 @@ if (empty($reshook)) { if (!$error) { $supplier = new Fournisseur($db); $result = $supplier->fetch($id_fourn); - if (GETPOSTISSET('ref_fourn_price_id')) { - $object->fetch_product_fournisseur_price(GETPOST('ref_fourn_price_id', 'int')); + if ($ref_fourn_price_id > 0) { + $object->fetch_product_fournisseur_price($ref_fourn_price_id); } $extralabels = $extrafields->fetch_name_optionals_label("product_fournisseur_price"); $extrafield_values = $extrafields->getOptionalsFromPost("product_fournisseur_price"); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 16e9b0b54ef..88281457fc3 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1684,7 +1684,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '