';
print ''.$langs->trans("ChangeIntoRepeatableIntervention").'';
diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php
index b00abadb9c3..224e3583bbd 100644
--- a/htdocs/holiday/list.php
+++ b/htdocs/holiday/list.php
@@ -117,7 +117,7 @@ $search_month_end = GETPOST('search_month_end', 'int');
$search_year_end = GETPOST('search_year_end', 'int');
$search_employee = GETPOST('search_employee', 'int');
$search_valideur = GETPOST('search_valideur', 'int');
-$search_status = GETPOST('search_statut', 'int');
+$search_status = GETPOST('search_status', 'int');
$search_type = GETPOST('search_type', 'int');
// Initialize technical objects
diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php
index 966dd7e8dee..eef3ca0dcbe 100644
--- a/htdocs/holiday/month_report.php
+++ b/htdocs/holiday/month_report.php
@@ -144,17 +144,17 @@ $sql .= " FROM ".MAIN_DB_PREFIX."holiday cp";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_holiday_types ct ON cp.fk_type = ct.rowid";
$sql .= " WHERE cp.rowid > 0";
-$sql .= " AND cp.statut = 3"; // 3 = Approved
+$sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED;
$sql .= " AND (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')";
if (!empty($search_ref)) {
$sql .= natural_search('cp.ref', $search_ref);
}
-if (!empty($search_employee)) {
- $sql .= " AND cp.fk_user = '".$db->escape($search_employee)."'";
+if (!empty($search_employee) && $search_employee > 0) {
+ $sql .= " AND cp.fk_user = ".((int) $search_employee);
}
-if (!empty($search_type)) {
- $sql .= ' AND cp.fk_type IN ('.$db->sanitize($search_type).')';
+if (!empty($search_type) && $search_type != '-1') {
+ $sql .= ' AND cp.fk_type IN ('.$db->escape($search_type).')';
}
if (!empty($search_description)) {
$sql .= natural_search('cp.description', $search_description);
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 2eaba13de3c..b7618f64739 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1987,7 +1987,7 @@ MAIN_PDF_MARGIN_RIGHT=Right margin on PDF
MAIN_PDF_MARGIN_TOP=Top margin on PDF
MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF
MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF
-MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal ligne
+MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line
MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF
NothingToSetup=There is no specific setup required for this module.
SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups
@@ -2140,4 +2140,5 @@ CheckForModuleUpdateHelp=This action will connect to editors of external modules
ModuleUpdateAvailable=An update is available
NoExternalModuleWithUpdate=No updates found for external modules
SwaggerDescriptionFile=Swagger API description file (for use with redoc for example)
-YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=You enabled deprecated WS API. You should use REST API instead.
\ No newline at end of file
+YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=You enabled deprecated WS API. You should use REST API instead.
+RandomlySelectedIfSeveral=Randomly selected if several pictures are available
\ No newline at end of file
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 2ccc5e63c8f..f76a6fec0ad 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -5422,11 +5422,11 @@ class Product extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
- * Retourne tableau de toutes les photos du produit
+ * Return an array with all photos of product found on disk. There is no sorting criteria.
*
- * @param string $dir Repertoire a scanner
- * @param int $nbmax Nombre maximum de photos (0=pas de max)
- * @return array Tableau de photos
+ * @param string $dir Directory to scan
+ * @param int $nbmax Number maxium of photos (0=no maximum)
+ * @return array Array of photos
*/
public function liste_photos($dir, $nbmax = 0)
{
@@ -5447,9 +5447,10 @@ class Product extends CommonObject
if (dol_is_file($dir.$file) && image_format_supported($file) >= 0) {
$nbphoto++;
- // On determine nom du fichier vignette
+ // We forge name of thumb.
$photo = $file;
$photo_vignette = '';
+ $regs = array();
if (preg_match('/('.$this->regeximgext.')$/i', $photo, $regs)) {
$photo_vignette = preg_replace('/'.$regs[0].'/i', '', $photo).'_small'.$regs[0];
}
@@ -5467,7 +5468,7 @@ class Product extends CommonObject
$tabobj[$nbphoto - 1] = $obj;
- // On continue ou on arrete de boucler ?
+ // Do we have to continue with next photo ?
if ($nbmax && $nbphoto >= $nbmax) {
break;
}
@@ -5482,9 +5483,9 @@ class Product extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
- * Efface la photo du produit et sa vignette
+ * Delete a photo and its thumbs
*
- * @param string $file Chemin de l'image
+ * @param string $file Path to image file
* @return void
*/
public function delete_photo($file)
diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php
index 959336c1671..5e609bbe301 100644
--- a/htdocs/product/stock/class/mouvementstock.class.php
+++ b/htdocs/product/stock/class/mouvementstock.class.php
@@ -370,8 +370,12 @@ class MouvementStock extends CommonObject
if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) {
$foundforbatch = 0;
$qtyisnotenough = 0;
+
foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch) {
- if ($batch != $batchcursor) continue;
+ if ((string) $batch != (string) $batchcursor) { // Lot '59' must be different than lot '59c'
+ continue;
+ }
+
$foundforbatch = 1;
if ($prodbatch->qty < abs($qty)) $qtyisnotenough = $prodbatch->qty;
break;
diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php
index b36d530d624..52addeba637 100644
--- a/htdocs/product/stock/stockatdate.php
+++ b/htdocs/product/stock/stockatdate.php
@@ -45,7 +45,7 @@ if ($user->socid) {
$result = restrictedArea($user, 'produit|service');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
-$hookmanager->initHooks(array('stockreplenishlist'));
+$hookmanager->initHooks(array('stockatdate'));
//checks if a product has been ordered
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 493a400c891..cd34b0f916f 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -1045,10 +1045,7 @@ if ($action == 'create') {
print '';
// Show product and description
- $product_static->type = $line->fk_product_type;
- $product_static->id = $line->fk_product;
- $product_static->ref = $line->ref;
- $product_static->status_batch = $line->product_tobatch;
+ $product_static = $product;
$text = $product_static->getNomUrl(1);
$text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label);
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 48cc882c052..b8bef7cad9a 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -508,6 +508,10 @@ if ($search_sale == -2) {
} elseif (!empty($search_sale) && $search_sale != '-1' || (empty($user->rights->societe->client->voir) && !$socid)) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
+// Add table from hooks
+$parameters = array();
+$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
+$sql .= $hookmanager->resPrint;
$sql .= " WHERE s.entity IN (".getEntity('societe').")";
//if (empty($user->rights->societe->client->voir) && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->societe->client->readallthirdparties_advance)) && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if (empty($user->rights->societe->client->voir) && !$socid) {
@@ -667,6 +671,10 @@ if (empty($reshook)) {
}
}
$sql .= $hookmanager->resPrint;
+// Add GroupBy from hooks
+$parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall);
+$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
+$sql .= $hookmanager->resPrint;
$sql .= $db->order($sortfield, $sortorder);