diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 44a12b76f36..52cb1370cfc 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -1,7 +1,7 @@ * Copyright (C) 2016 Florian Henry - * Copyright (C) 2016-2018 Alexandre Spangaro + * Copyright (C) 2016-2019 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -164,7 +164,7 @@ if ($action == 'export_csv') print $object->get_compte_desc($line->numero_compte) . $sep; print price($line->debit) . $sep; print price($line->credit) . $sep; - print price($line->credit - $line->debit) . $sep; + print price($line->debit - $line->credit) . $sep; print "\n"; } @@ -293,9 +293,9 @@ if ($action != 'export_csv') print '' . length_accountg($line->numero_compte) . ''; print '' . $description . ''; - print '' . price($line->debit) . ''; - print '' . price($line->credit) . ''; - print '' . price($line->credit - $line->debit) . ''; + print '' . price($line->debit) . ''; + print '' . price($line->credit) . ''; + print '' . price($line->debit - $line->credit) . ''; print '' . $link; print ''; print "\n"; @@ -305,11 +305,11 @@ if ($action != 'export_csv') $sous_total_credit += $line->credit; } - print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ''; + print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_debit - $sous_total_credit)) . ''; print " \n"; print ''; - print '' . $langs->trans("AccountBalance") . ':' . price($total_debit) . '' . price($total_credit) . '' . price(price2num($total_credit - $total_debit)) . ''; + print '' . $langs->trans("AccountBalance") . ':' . price($total_debit) . '' . price($total_credit) . '' . price(price2num($total_debit - $total_credit)) . ''; print " \n"; print ''; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 0d3980318a4..9591a24fa78 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -424,7 +424,7 @@ class AdherentType extends CommonObject global $langs; if ($morphy == 'phy') { return $langs->trans("Physical"); } elseif ($morphy == 'mor') { return $langs->trans("Moral"); } - else return $langs->trans("Physical & Morale"); + else return $langs->trans("MorPhy"); //return $morphy; } diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 233d2601871..849d787c220 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -283,7 +283,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') print ''; if ($objp->morphy == 'phy') { print $langs->trans("Physical"); } elseif ($objp->morphy == 'mor') { print $langs->trans("Moral"); } - else print $langs->trans("Physical & Morale"); + else print $langs->trans("MorPhy"); print ''; print ''.yn($objp->subscription).''; print ''.yn($objp->vote).''; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index a7170b799a2..a7a0767c6b5 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -40,7 +40,7 @@ $type = GETPOST('type', 'az09'); $action=GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $removeelem = GETPOST('removeelem', 'int'); -$elemid = GETPOST('elemid', 'alpha'); +$elemid = GETPOST('elemid', 'int'); if ($id == "" && $label == "") { diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index b6f5d9328f8..88dfcef7d7f 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -835,7 +835,7 @@ else { // EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent. // You ensure that every user is using its own SMTP server when using the mass emailing module. - $linktoadminemailbefore=''; + $linktoadminemailbefore=''; $linktoadminemailend=''; setEventMessages($langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]), null, 'warnings'); setEventMessages($langs->trans("MailSendSetupIs2", $linktoadminemailbefore, $linktoadminemailend, $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $listofmethods['smtps']), null, 'warnings'); diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index adb817f418f..a454ac80488 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -335,15 +335,15 @@ class Mailing extends CommonObject $target_array=array(); - $sql = "SELECT fk_contact, "; - $sql.=" lastname, "; - $sql.=" firstname,"; - $sql.=" email,"; - $sql.=" other,"; - $sql.=" source_url,"; - $sql.=" source_id ,"; - $sql.=" source_type "; - $sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles "; + $sql = "SELECT fk_contact,"; + $sql.= " lastname,"; + $sql.= " firstname,"; + $sql.= " email,"; + $sql.= " other,"; + $sql.= " source_url,"; + $sql.= " source_id ,"; + $sql.= " source_type"; + $sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles"; $sql.= " WHERE fk_mailing = ".$fromid; $result=$this->db->query($sql); @@ -353,14 +353,16 @@ class Mailing extends CommonObject { while ($obj = $this->db->fetch_object($result)) { - $target_array[]=array('fk_contact'=>$obj->fk_contact, - 'lastname'=>$obj->lastname, - 'firstname'=>$obj->firstname, - 'email'=>$obj->email, - 'other'=>$obj->other, - 'source_url'=>$obj->source_url, - 'source_id'=>$obj->source_id, - 'source_type'=>$obj->source_type); + $target_array[]=array( + 'fk_contact'=>$obj->fk_contact, + 'lastname'=>$obj->lastname, + 'firstname'=>$obj->firstname, + 'email'=>$obj->email, + 'other'=>$obj->other, + 'source_url'=>$obj->source_url, + 'source_id'=>$obj->source_id, + 'source_type'=>$obj->source_type + ); } } } diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 92ba7f621cb..9f9435a986c 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -739,8 +739,11 @@ class BonPrelevement extends CommonObject $sql = "SELECT count(f.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; - $sql.= " WHERE f.fk_statut = ".Facture::STATUS_VALIDATED; - $sql.= " AND f.entity IN (".getEntity('invoice').")"; + $sql.= " WHERE f.entity IN (".getEntity('invoice').")"; + if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) + { + $sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; + } $sql.= " AND f.rowid = pfd.fk_facture"; $sql.= " AND pfd.traite = 0"; $sql.= " AND f.total_ttc > 0"; diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index dce08c5c66b..7d9e22c45e7 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -208,7 +208,10 @@ $sql.= " ".MAIN_DB_PREFIX."societe as s,"; $sql.= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql.= " WHERE s.rowid = f.fk_soc"; $sql.= " AND f.entity IN (".getEntity('invoice').")"; -$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) +{ + $sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +} $sql.= " AND f.total_ttc > 0"; $sql.= " AND pfd.traite = 0"; $sql.= " AND pfd.fk_facture = f.rowid"; diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index a34fde042e5..6c1ea278430 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -93,7 +93,10 @@ if ($socid) $sql.= " AND f.fk_soc = ".$socid; if (!$status) $sql.= " AND pfd.traite = 0"; if ($status) $sql.= " AND pfd.traite = ".$status; $sql.= " AND f.total_ttc > 0"; -$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) +{ + $sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +} $sql.= " AND pfd.fk_facture = f.rowid"; if (dol_strlen(trim(GETPOST('search_societe', 'alpha')))) { diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 44db7dd2625..468d4807c65 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -102,7 +102,10 @@ $sql.= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql.= " WHERE s.rowid = f.fk_soc"; $sql.= " AND f.entity IN (".getEntity('invoice').")"; $sql.= " AND f.total_ttc > 0"; -$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) +{ + $sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; +} $sql.= " AND pfd.traite = 0 AND pfd.fk_facture = f.rowid"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND f.fk_soc = ".$socid; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 430aad5e7e7..629fe589e56 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -433,7 +433,7 @@ if (empty($reshook)) } $qty = GETPOST('qty'.$predef); - $remise_percent = GETPOST('remise_percent'.$predef); + $remise_percent = ((GETPOST('remise_percent'.$predef) != '') ? GETPOST('remise_percent'.$predef) : 0); if ($qty == '') { @@ -566,7 +566,8 @@ if (empty($reshook)) $info_bits=0; if ($tva_npr) $info_bits |= 0x01; - if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& ($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min)))) + if (((! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) + || empty($conf->global->MAIN_USE_ADVANCED_PERMS) ) && ($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min)))) { $object->error = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, -1, $conf->currency)); $result = -1 ; diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 416a0b46144..72116993505 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -173,7 +173,7 @@ class box_activity extends ModeleBoxes $totalnb += $data[$j]->nb; $this->info_box_contents[$line][3] = array( - 'td' => 'class="right"', + 'td' => 'class="nowrap right"', 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency), ); $this->info_box_contents[$line][4] = array( @@ -256,7 +256,7 @@ class box_activity extends ModeleBoxes $totalnb += $data[$j]->nb; $this->info_box_contents[$line][3] = array( - 'td' => 'class="right"', + 'td' => 'class="nowrap right"', 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency), ); $this->info_box_contents[$line][4] = array( @@ -340,7 +340,7 @@ class box_activity extends ModeleBoxes ); $this->info_box_contents[$line][3] = array( - 'td' => 'class="right"', + 'td' => 'class="nowrap right"', 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency) ); diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 525562d308d..1928ac7cc94 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -134,7 +134,7 @@ class box_comptes extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', + 'td' => 'class="right nowraponall"', 'text' => price($solde, 0, $langs, 0, -1, -1, $objp->currency_code) ); diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index bdecbde39de..095709c2ea8 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -179,12 +179,12 @@ class box_produits_alerte_stock extends ModeleBoxes } $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', + 'td' => 'class="right nowraponall"', 'text' => $price, ); $this->info_box_contents[$line][] = array( - 'td' => 'class="nowrap"', + 'td' => 'class="right"', 'text' => $price_base_type, ); diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 59a3a8afec6..1ae1172de1d 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -135,7 +135,7 @@ class box_supplier_orders extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', + 'td' => 'class="right nowrap"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency), ); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 49efea8c04d..c470231e5de 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4237,7 +4237,7 @@ class Form $formconfirm.= ''; $formconfirm.= $this->selectyesno("confirm", $newselectedchoice); $formconfirm.= ''; - $formconfirm.= 'trans("Validate").'">'; + $formconfirm.= ''; $formconfirm.= ''."\n"; $formconfirm.= ''."\n"; diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index a27863cf055..581fca03f8b 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -88,7 +88,6 @@ class mailing_advthirdparties extends MailingTargets dol_syslog(get_class($this)."::add_to_target_spec mailing ".$num." targets found", LOG_DEBUG); - $old = ''; while ($i < $num) { $obj = $this->db->fetch_object($result); @@ -144,7 +143,6 @@ class mailing_advthirdparties extends MailingTargets dol_syslog(get_class($this)."::add_to_target_spec mailing ".$num." targets found"); - $old = ''; while ($i < $num) { $obj = $this->db->fetch_object($result); diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index fc9c63e4a40..472e77e1974 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -78,6 +78,7 @@ print 'Option rebuild_product_thumbs (\'test\' or \'confirmed\') is '.(GETPOST(' print 'Option force_disable_of_modules_not_found (\'test\' or \'confirmed\') is '.(GETPOST('force_disable_of_modules_not_found', 'alpha')?GETPOST('force_disable_of_modules_not_found', 'alpha'):'undefined').'
'."\n"; print 'Option clean_perm_table (\'test\' or \'confirmed\') is '.(GETPOST('clean_perm_table', 'alpha')?GETPOST('clean_perm_table', 'alpha'):'undefined').'
'."\n"; print 'Option force_utf8_on_tables, for mysql/mariadb only (\'test\' or \'confirmed\') is '.(GETPOST('force_utf8_on_tables', 'alpha')?GETPOST('force_utf8_on_tables', 'alpha'):'undefined').'
'."\n"; +print 'Option repair_link_dispatch_lines_supplier_order_lines, (\'test\' or \'confirmed\') is '.(GETPOST('repair_link_dispatch_lines_supplier_order_lines', 'alpha')?GETPOST('repair_link_dispatch_lines_supplier_order_lines', 'alpha'):'undefined').'
'."\n"; print '
'; print ''; @@ -1275,6 +1276,144 @@ if ($ok && GETPOST('force_utf8_on_tables', 'alpha')) } } +// +if ($ok && GETPOST('repair_link_dispatch_lines_supplier_order_lines')) { + /* + * This script is meant to be run when upgrading from a dolibarr version < 3.8 + * to a newer version. + * + * Version 3.8 introduces a new column in llx_commande_fournisseur_dispatch, which + * matches the dispatch to a specific supplier order line (so that if there are + * several with the same product, the user can specifically tell which products of + * which line were dispatched where). + * + * However when migrating, the new column has a default value of 0, which means that + * old supplier orders whose lines were dispatched using the old dolibarr version + * have unspecific dispatch lines, which are not taken into account by the new version, + * thus making the order look like it was never dispatched at all. + * + * This scripts sets this foreign key to the first matching supplier order line whose + * product (and supplier order of course) are the same as the dispatch’s. + * + * If the dispatched quantity is more than indicated on the order line (this happens if + * there are several order lines for the same product), it creates new dispatch lines + * pointing to the other order lines accordingly, until all the dispatched quantity is + * accounted for. + */ + + $repair_link_dispatch_lines_supplier_order_lines = GETPOST('repair_link_dispatch_lines_supplier_order_lines', 'alpha'); + + + echo ''; + echo ''; + + $sql_dispatch = 'SELECT * FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch WHERE COALESCE(fk_commandefourndet, 0) = 0'; + $db->begin(); + $resql_dispatch = $db->query($sql_dispatch); + $n_processed_rows = 0; + $errors = array(); + if ($resql_dispatch) { + if ($db->num_rows($resql_dispatch) == 0) { + echo ''; + exit; + } + while ($obj_dispatch = $db->fetch_object($resql_dispatch)) { + $sql_line = 'SELECT line.rowid, line.qty FROM ' . MAIN_DB_PREFIX . 'commande_fournisseurdet AS line' + . ' WHERE line.fk_commande = ' . $obj_dispatch->fk_commande + . ' AND line.fk_product = ' . $obj_dispatch->fk_product; + $resql_line = $db->query($sql_line); + + // s’il y a plusieurs lignes avec le même produit sur cette commande fournisseur, + // on divise la ligne de dispatch en autant de lignes qu’on en a sur la commande pour le produit + // et on met la quantité de la ligne dans la limite du "budget" indiqué par dispatch.qty + + $remaining_qty = $obj_dispatch->qty; + $first_iteration = true; + if (!$resql_line) { + echo ''; + $errors[] = $sql_line; + $n_processed_rows++; + continue; + } + if ($db->num_rows($resql_line) == 0) continue; + while ($obj_line = $db->fetch_object($resql_line)) { + if (!$remaining_qty) break; + if (!$obj_line->rowid) { + continue; + } + $qty_for_line = min($remaining_qty, $obj_line->qty); + if ($first_iteration) { + $sql_attach = 'UPDATE ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch' + . ' SET fk_commandefourndet = ' . $obj_line->rowid . ', qty = ' . $qty_for_line + . ' WHERE rowid = ' . $obj_dispatch->rowid; + $first_iteration = false; + } else { + $sql_attach_values = array( + $obj_dispatch->fk_commande, + $obj_dispatch->fk_product, + $obj_line->rowid, + $qty_for_line, + $obj_dispatch->fk_entrepot, + $obj_dispatch->fk_user, + $obj_dispatch->datec ? '"' . $db->escape($obj_dispatch->datec) . '"' : 'NULL', + $obj_dispatch->comment ? '"' . $db->escape($obj_dispatch->comment) . '"' : 'NULL', + $obj_dispatch->status ?: 'NULL', + $obj_dispatch->tms ? '"' . $db->escape($obj_dispatch->tms) . '"': 'NULL', + $obj_dispatch->batch ?: 'NULL', + $obj_dispatch->eatby ? '"' . $db->escape($obj_dispatch->eatby) . '"': 'NULL', + $obj_dispatch->sellby ? '"' . $db->escape($obj_dispatch->sellby) . '"': 'NULL' + ); + $sql_attach_values = join(', ', $sql_attach_values); + + $sql_attach = 'INSERT INTO ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch' + . ' (fk_commande, fk_product, fk_commandefourndet, qty, fk_entrepot, fk_user, datec, comment, status, tms, batch, eatby, sellby)' + . ' VALUES (' . $sql_attach_values . ')'; + } + + if ($repair_link_dispatch_lines_supplier_order_lines == 'confirmed') + { + $resql_attach = $db->query($sql_attach); + } + else + { + $resql_attach = true; // Force success in test mode + } + + if ($resql_attach) { + $remaining_qty -= $qty_for_line; + } else { + $errors[] = $sql_attach; + } + + $first_iteration = false; + } + $n_processed_rows++; + + // report progress every 256th row + if (!($n_processed_rows & 0xff)) { + echo '\n"; + flush(); + ob_flush(); + } + } + } else { + echo '\n"; + echo $sql_dispatch . "\n"; + } + echo '\n"; + echo '\n"; + + if (count($errors)) { + $db->rollback(); + echo ''; + } else { + $db->commit(); + } + $db->close(); + + echo ''; + echo ''; +} print '
Repair llx_commande_fournisseur_dispatch.fk_commandefourndet
Repair in progress. This may take a while.
Nothing to do.
Unable to find a matching supplier order line for dispatch #' . $obj_dispatch->rowid . '
Processed ' . $n_processed_rows . ' rows with ' . count($errors) . ' errors…' . "
Unable to find any dispatch without an fk_commandefourndet.' . "
Fixed ' . $n_processed_rows . ' rows with ' . count($errors) . ' errors…' . "
DONE.' . "
The transaction was rolled back due to errors: nothing was changed by the script.

SQL queries with errors:

' . join('
', $errors) . '
'; diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index 41974ca8b79..854e7f37bd5 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -97,16 +97,14 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets * This is the main function that returns the array of emails * * @param int $mailing_id Id of emailing - * @param array $cibles Array with targets * @return int <0 if error, number of emails added if ok */ - public function add_to_target($mailing_id, $cibles) + public function add_to_target($mailing_id) { // phpcs:enable $target = array(); $j = 0; - $sql = " select rowid as id, email, firstname, lastname, plan, partner"; $sql.= " from ".MAIN_DB_PREFIX."myobject"; $sql.= " where email IS NOT NULL AND email != ''"; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 8d65a88acad..dd88c3dfa8a 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -284,14 +284,14 @@ class Product extends CommonObject * @var int */ public $barcode_type; - + /** * Main Barcode type code * * @var string */ public $barcode_type_code; - + /** * Additional barcodes (Some products have different barcodes according to the country of origin of manufacture) * @@ -447,7 +447,7 @@ class Product extends CommonObject $error=0; // Clean parameters - $this->ref = dol_string_nospecial(trim($this->ref)); + $this->ref = dol_sanitizeFileName(dol_string_nospecial(trim($this->ref))); $this->label = trim($this->label); $this->price_ttc=price2num($this->price_ttc); $this->price=price2num($this->price); @@ -2052,7 +2052,7 @@ class Product extends CommonObject $sql.= " fk_price_expression, price_autogen"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; if ($id) { - $sql.= " WHERE rowid = ".$this->db->escape($id); + $sql.= " WHERE rowid = ".(int) $id; } else { $sql.= " WHERE entity IN (".getEntity($this->element).")"; if ($ref) { diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 9a97f49135d..6246fec5a4f 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -515,7 +515,7 @@ $moreforfilter=''; // If the user can view user other than himself $moreforfilter.='
'; $moreforfilter.='
'.$langs->trans('User'). '
'; -$includeonly='hierachyme'; +$includeonly='hierarchyme'; if (empty($user->rights->user->user->lire)) $includeonly=array($user->id); $moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200 marginleftonly'); $moreforfilter.='
'; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 6343d40cbf7..1bacbab465c 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -564,7 +564,7 @@ if (! empty($conf->categorie->enabled)) // If the user can view user other than himself $moreforfilter.='
'; $moreforfilter.='
'.$langs->trans('User'). '
'; -$includeonly='hierachyme'; +$includeonly='hierarchyme'; if (empty($user->rights->user->user->lire)) $includeonly=array($user->id); $moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter.='
'; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 03c814d65bf..40bebc5ce6a 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -515,7 +515,7 @@ if (! empty($conf->categorie->enabled)) // If the user can view user other than himself $moreforfilter.='
'; $moreforfilter.=$langs->trans('ProjectsWithThisUserAsContact'). ': '; -$includeonly='hierachyme'; +$includeonly='hierarchyme'; if (empty($user->rights->user->user->lire)) $includeonly=array($user->id); $moreforfilter.=$form->select_dolusers($search_project_user?$search_project_user:'', 'search_project_user', 1, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter.='
'; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index cf683671c5d..9defab81a73 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -393,6 +393,7 @@ class Stripe extends CommonObject { $metadata['dol_type'] = $object->element; $metadata['dol_id'] = $object->id; + if (is_object($object->thirdparty) && $object->thirdparty->id > 0) $metadata['dol_thirdparty_id'] = $object->thirdparty->id; } $dataforintent = array( diff --git a/htdocs/theme/md/img/title_ticket.png b/htdocs/theme/md/img/title_ticket.png new file mode 100644 index 00000000000..b1cf5df0e75 Binary files /dev/null and b/htdocs/theme/md/img/title_ticket.png differ diff --git a/htdocs/theme/md/img/title_ticketsup.png b/htdocs/theme/md/img/title_ticketsup.png deleted file mode 100644 index 3ec332075e6..00000000000 Binary files a/htdocs/theme/md/img/title_ticketsup.png and /dev/null differ