diff --git a/ChangeLog b/ChangeLog
index a5d8b7c967e..0458780eeab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -254,6 +254,44 @@ The following changes may create regressions for some external modules, but were
* A very high number of class properties (with old name in french) are now deprecated in favor of the property name in english.
+***** ChangeLog for 18.0.4 compared to 18.0.3 *****
+FIX: $this->newref already exists and could have been modified by trigger but we still use a local variable for the filesystem-based renaming
+FIX: 16.0 only, backport fix for SQL error on global search product
+FIX: #25399 (#26694)
+FIX: #25458 intervention localizations (backport v17) (#26757)
+FIX: #26518
+FIX: #26536 Accountancy - Balance - Not divided lines by label & account, only by account (#26547)
+FIX: #26553 Supplier invoice - Do not display the delete button for reconciled payment (#26554)
+FIX: #26735
+FIX: #26994
+FIX: Accountancy - Possibility to write in bookkeeping expense report operation with some line not bound (#26545)
+FIX: add display of an error when attempting to delete a committed transaction (#26573)
+FIX: avoid warning : Cannot use a scalar value as an array (#26437)
+FIX: backport SQL error on global search product
+FIX: # Bug Estimated Stock at date value in V14 (#26479)
+FIX: commande context (#26497)
+FIX: delivery note disappear after generation
+FIX: double hook and paging search param in product list (#26767)
+FIX: Email reminder template must not be visible when option is off
+FIX: escape HTML tags in return value of getFullName() (#26735)
+FIX: Fix set private note (#26610)
+FIX: Fix when options FAC_FORCE_DATE_VALIDATION and INVOICE_CHECK_POSTERIOR_DATE enabled. The date is forced after the test and not before
+FIX: menu auguria
+FIX: pagination parameters on save and cancel buttons (#26605)
+FIX: pdf cornas page head multicell width (backport v17)
+FIX: php8 fatal on edit supplier order when multicurrency is activated (#26758)
+FIX: possible inconsistency between llx_ecm_files and file system when BILL_SUPPLIER_VALIDATES changes ref
+FIX: regression on planned bank entries (#26556)
+FIX: Social contribution - Payment list - Wrong information in type column (#26561)
+FIX: special_code update line keep old value. (#26819)
+FIX: substitute project variables in invoice documents (#26445)
+FIX: Test on permission for holiday tooltips
+FIX: v17: Param $notrigger in $societe->create() causes method to return true regardless of actual result of database functions (#26499)
+FIX: v18 SQL error in llx_c_forme_juridique.sql when installing
+FIX: Warehouse Global Amounts not displayed (#26478)
+FIX: warning param $lineID getSpecialCode is negatif (#26826)
+FIX: warning php8.2 undefined_array_key (#26830)
+
***** ChangeLog for 18.0.3 compared to 18.0.2 *****
FIX: #25793 Cannot add time spent (#26405)
FIX: #26100 Ticket - On edit, list of closed project must be excluded (#26223)
diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php
index d75c9fae8b2..442d991a453 100755
--- a/dev/initdata/purge-data.php
+++ b/dev/initdata/purge-data.php
@@ -148,8 +148,8 @@ $sqls=array(
"DELETE FROM ".MAIN_DB_PREFIX."product where datec < '__DATE__'",
),
'project'=>array(
- // TODO set fk_project to null on object that refer to project
- "DELETE FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_task IN (select rowid FROM ".MAIN_DB_PREFIX."projet_task WHERE fk_projet IN (select rowid FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__'))",
+ // TODO set fk_project to null on all objects/tables that refer to project
+ "DELETE FROM ".MAIN_DB_PREFIX."element_time WHERE elementtype = 'task' AND fk_element IN (select rowid FROM ".MAIN_DB_PREFIX."projet_task WHERE fk_projet IN (select rowid FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__'))",
"DELETE FROM ".MAIN_DB_PREFIX."projet_task WHERE fk_projet IN (select rowid FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__')",
"DELETE FROM ".MAIN_DB_PREFIX."projet where datec < '__DATE__'",
),
diff --git a/dev/tools/rector/src/Renaming/GlobalToFunction.php b/dev/tools/rector/src/Renaming/GlobalToFunction.php
index 656a7d4ff59..f81f2ee34c1 100644
--- a/dev/tools/rector/src/Renaming/GlobalToFunction.php
+++ b/dev/tools/rector/src/Renaming/GlobalToFunction.php
@@ -103,6 +103,7 @@ class GlobalToFunction extends AbstractRector
if ($node instanceof FuncCall) {
$tmpfunctionname = $this->getName($node);
+ // If function is ok(we must avoid a lot of cases like isset, empty)
if (in_array($tmpfunctionname, array('dol_escape_htmltag', 'make_substitutions', 'min', 'max', 'explode'))) {
$args = $node->getArgs();
$nbofparam = count($args);
diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php
index 8456732a2a1..1d475b67527 100644
--- a/htdocs/accountancy/class/accountingjournal.class.php
+++ b/htdocs/accountancy/class/accountingjournal.class.php
@@ -533,8 +533,6 @@ class AccountingJournal extends CommonObject
$element_link = $element_static->getNomUrl(1, 'with_label');
$element_name_formatted_0 = dol_trunc($element_static->label, 16);
- $element_name_formatted_1 = utf8_decode(dol_trunc($element_static->label, 32));
- $element_name_formatted_2 = utf8_decode(dol_trunc($element_static->label, 16));
$label_operation = $element_static->getNomUrl(0, 'label', 16);
$element = array(
diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index c92d0032176..87639008243 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -75,8 +75,13 @@ if ($reshook < 0) {
if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|| ($action == 'updateedit')) {
- $tmparray = getCountry(GETPOST('country_id', 'int'), 'all', $db, $langs, 0);
+ $tmparray = getCountry(GETPOSTINT('country_id'), 'all', $db, $langs, 0);
if (!empty($tmparray['id'])) {
+ if ($tmparray['code'] == 'FR' && $tmparray['id'] != $mysoc->country_id) {
+ // For FR, default value of option to show profid SIREN is on by default
+ $res = dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", 1, 'chaine', 0, '', $conf->entity);
+ }
+
$mysoc->country_id = $tmparray['id'];
$mysoc->country_code = $tmparray['code'];
$mysoc->country_label = $tmparray['label'];
diff --git a/htdocs/bom/class/api_boms.class.php b/htdocs/bom/class/api_boms.class.php
index 4b9ccda6b09..658543e68c3 100644
--- a/htdocs/bom/class/api_boms.class.php
+++ b/htdocs/bom/class/api_boms.class.php
@@ -559,7 +559,7 @@ class Boms extends DolibarrApi
*
* @return void
*/
- private function checkRefNumbering(): void
+ private function checkRefNumbering()
{
$ref = substr($this->bom->ref, 1, 4);
if ($this->bom->status > 0 && $ref == 'PROV') {
diff --git a/htdocs/bom/tpl/linkedobjectblock.tpl.php b/htdocs/bom/tpl/linkedobjectblock.tpl.php
index d00340a1322..082936be50a 100644
--- a/htdocs/bom/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/bom/tpl/linkedobjectblock.tpl.php
@@ -62,7 +62,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
$product_static->getNomUrl(1);
}
print '';
- echo '
'.dol_print_date($objectlink->date_creation, 'day').' | ';
+ echo ''.dol_print_date($objectlink->date_creation, 'day').' | ';
echo '';
if ($user->hasRight('commande', 'lire')) {
$total = $total + $objectlink->total_ht;
diff --git a/htdocs/bookcal/bookcalindex.php b/htdocs/bookcal/bookcalindex.php
index c236815a040..c2116980254 100644
--- a/htdocs/bookcal/bookcalindex.php
+++ b/htdocs/bookcal/bookcalindex.php
@@ -138,7 +138,7 @@ print '';
$NBMAX = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
-$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT
// Last modified myobject
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index f586cbca79a..21222ad3853 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -7,7 +7,7 @@
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2014 Cedric GROSS
* Copyright (C) 2015 Alexandre Spangaro
- * Copyright (C) 2018-2021 Frédéric France
+ * Copyright (C) 2018-2023 Frédéric France
* Copyright (C) 2019 Ferran Marcet
*
* This program is free software; you can redistribute it and/or modify
diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php
index 652f60552ff..5e403dff7a8 100644
--- a/htdocs/comm/action/list.php
+++ b/htdocs/comm/action/list.php
@@ -575,6 +575,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
/* The fast and low memory method to get and count full list converts the sql into a sql count */
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
+
$resql = $db->query($sqlforcount);
if ($resql) {
$objforcount = $db->fetch_object($resql);
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index 44a7565e9be..da07b9f9dd6 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -64,7 +64,7 @@ if (isset($user->socid) && $user->socid > 0) {
}
-$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
$maxofloop = (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD);
$now = dol_now();
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 791f67fcd56..0209622bd21 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -206,11 +206,18 @@ if (empty($reshook)) {
} elseif ($action == 'reopen' && $usercancreate) {
// Reopen a closed order
if ($object->statut == Commande::STATUS_CANCELED || $object->statut == Commande::STATUS_CLOSED) {
- $result = $object->set_reopen($user);
- if ($result > 0) {
- setEventMessages($langs->trans('OrderReopened', $object->ref), null);
+ if (dolGetGlobalInt('ORDER_REOPEN_TO_DRAFT')) {
+ $result = $object->setDraft($user, $idwarehouse);
+ if ($result < 0) {
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
} else {
- setEventMessages($object->error, $object->errors, 'errors');
+ $result = $object->set_reopen($user);
+ if ($result > 0) {
+ setEventMessages($langs->trans('OrderReopened', $object->ref), null);
+ } else {
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
}
}
} elseif ($action == 'confirm_delete' && $confirm == 'yes' && $usercandelete) {
diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php
index 7958762e720..cf30a608387 100644
--- a/htdocs/commande/index.php
+++ b/htdocs/commande/index.php
@@ -56,7 +56,7 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
-$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Maximum elements of the tables
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index 5b10b742d87..4ac22405287 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -701,6 +701,15 @@ class Account extends CommonObject
}
// Load librairies to check BAN
+ $balance = $this->balance;
+ if (empty($balance) && !empty($this->solde)) {
+ $balance = $this->solde;
+ }
+ if (empty($balance)) {
+ $balance = 0;
+ }
+
+ // Load the library to validate/check a BAN account
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
$now = dol_now();
@@ -779,7 +788,7 @@ class Account extends CommonObject
$accline = new AccountLine($this->db);
$accline->datec = $now;
$accline->label = '('.$langs->trans("InitialBankBalance").')';
- $accline->amount = price2num($this->solde);
+ $accline->amount = price2num($balance);
$accline->fk_user_author = $user->id;
$accline->fk_account = $this->id;
$accline->datev = $this->date_solde;
diff --git a/htdocs/compta/facture/index.php b/htdocs/compta/facture/index.php
index 36d118672e1..fe614a7d2dc 100644
--- a/htdocs/compta/facture/index.php
+++ b/htdocs/compta/facture/index.php
@@ -41,7 +41,7 @@ if (isset($user->socid) && $user->socid > 0) {
$socid = $user->socid;
}
-$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Maximum elements of the tables
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD;
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index d58a1cf15d4..f66b13dca46 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -925,6 +925,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
/* The fast and low memory method to get and count full list converts the sql into a sql count */
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
+
$resql = $db->query($sqlforcount);
if ($resql) {
$objforcount = $db->fetch_object($resql);
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index ec46ef0af3c..14aa6143769 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -67,7 +67,7 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
-$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Maximum elements of the tables
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
diff --git a/htdocs/core/boxes/box_funnel_of_prospection.php b/htdocs/core/boxes/box_funnel_of_prospection.php
index 257f351cfca..63cb9b68257 100644
--- a/htdocs/core/boxes/box_funnel_of_prospection.php
+++ b/htdocs/core/boxes/box_funnel_of_prospection.php
@@ -102,6 +102,7 @@ class box_funnel_of_prospection extends ModeleBoxes
$sql .= " FROM ".MAIN_DB_PREFIX."c_lead_status as cls";
$sql .= " WHERE active=1";
$sql .= " AND cls.code <> 'LOST'";
+ $sql .= " AND cls.code <> 'WON'";
$sql .= $this->db->order('cls.rowid', 'ASC');
$resql = $this->db->query($sql);
if ($resql) {
@@ -126,9 +127,6 @@ class box_funnel_of_prospection extends ModeleBoxes
case 'NEGO':
$colorseriesstat[$objp->rowid] = $badgeStatus4;
break;
- case 'WON':
- $colorseriesstat[$objp->rowid] = $badgeStatus6;
- break;
default:
break;
}
@@ -152,7 +150,7 @@ class box_funnel_of_prospection extends ModeleBoxes
$sql .= " WHERE p.entity IN (".getEntity('project').")";
$sql .= " AND p.fk_opp_status = cls.rowid";
$sql .= " AND p.fk_statut = 1"; // Opend projects only
- $sql .= " AND cls.code NOT IN ('LOST')";
+ $sql .= " AND cls.code NOT IN ('LOST', 'WON')";
$sql .= " GROUP BY p.fk_opp_status, cls.code";
$resql = $this->db->query($sql);
@@ -236,6 +234,7 @@ class box_funnel_of_prospection extends ModeleBoxes
$dolgraph->setShowPercent(1);
$dolgraph->setMirrorGraphValues(true);
$dolgraph->setBorderWidth(2);
+ $dolgraph->setBorderSkip('false');
$dolgraph->SetType(array('horizontalbars'));
$dolgraph->SetHeight('200');
$dolgraph->SetWidth('600');
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index ef31fb50485..e65226b13d1 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -167,8 +167,9 @@ abstract class CommonObject
* @var CommonObject To store a cloned copy of object before to edit it and keep track of old properties
*/
public $oldcopy;
+
/**
- * @var CommonObject To store old value of a modified ref
+ * @var string To store old value of a modified ref
*/
public $oldref;
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index 63987d29b9a..606ad2719af 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -94,6 +94,7 @@ class DolGraph
public $bgcolorgrid = array(255, 255, 255); // array(R,G,B)
public $datacolor; // array(array(R,G,B),...)
public $borderwidth = 1;
+ public $borderskip = 'start';
private $stringtoshow; // To store string to output graph into HTML page
@@ -311,6 +312,18 @@ class DolGraph
$this->borderwidth = $borderwidth;
}
+ /**
+ * Set border skip
+ *
+ * @param int $borderskip Can be 'start' to skip start border, 'end' to skip end border, 'middle' to skip middle border,
+ * 'false' to not skip any border, 'true' to skip all border
+ * @return void
+ */
+ public function setBorderSkip($borderskip)
+ {
+ $this->borderskip = $borderskip;
+ }
+
/**
* Set tooltips labels of the graph
*
@@ -1483,6 +1496,7 @@ class DolGraph
$this->stringtoshow .= 'borderWidth: \''.$this->borderwidth.'\', ';
}
$this->stringtoshow .= 'borderColor: \'' . $bordercolor . '\', ';
+ $this->stringtoshow .= 'borderSkipped: \'' . $this->borderskip . '\', ';
$this->stringtoshow .= 'backgroundColor: \'' . $color . '\', ';
if (!empty($arrayofgroupslegend) && !empty($arrayofgroupslegend[$i])) {
$this->stringtoshow .= 'stack: \'' . $arrayofgroupslegend[$i]['stacknum'] . '\', ';
diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index fe0f6c71e1f..0112d617ac4 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -1532,7 +1532,7 @@ class FormTicket
$ticketstat->socid = $ticketstat->fk_soc;
$ticketstat->fetch_thirdparty();
- if (is_array($ticketstat->thirdparty->email) && !in_array($ticketstat->thirdparty->email, $sendto)) {
+ if (!empty($ticketstat->thirdparty->email) && !in_array($ticketstat->thirdparty->email, $sendto)) {
$sendto[] = $ticketstat->thirdparty->email.' ('.$langs->trans('Customer').')';
}
}
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index cacfa0f4495..d899c86a22f 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -1584,7 +1584,7 @@ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprin
* @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket... to list events linked to an object
* @param Contact $objcon Filter on object contact to filter events on a contact
* @param int $noprint Return string but does not output it
- * @param string $actioncode Filter on actioncode
+ * @param string|string[] $actioncode Filter on actioncode
* @param string $donetodo Filter on event 'done' or 'todo' or ''=nofilter (all).
* @param array $filters Filter on other fields
* @param string $sortfield Sort field
@@ -1810,13 +1810,10 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$sql .= ' AND (';
foreach ($actioncode as $key => $code) {
if ($key != 0) {
- $sql .= "OR (";
+ $sql .= " OR ";
}
if (!empty($code)) {
- addEventTypeSQL($sql, $code);
- }
- if ($key != 0) {
- $sql .= ")";
+ addEventTypeSQL($sql, $code, "");
}
}
$sql .= ')';
@@ -2284,7 +2281,7 @@ function show_subsidiaries($conf, $langs, $db, $object)
$socstatic->name_alias = $obj->name_alias;
$socstatic->email = $obj->email;
$socstatic->code_client = $obj->code_client;
- $socstatic->code_fournisseur = $obj->code_client;
+ $socstatic->code_fournisseur = $obj->code_fournisseur;
$socstatic->code_compta = $obj->code_compta;
$socstatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
$socstatic->email = $obj->email;
@@ -2334,19 +2331,19 @@ function addEventTypeSQL(&$sql, $actioncode, $sqlANDOR = "AND")
if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
if ($actioncode == 'AC_NON_AUTO') {
- $sql .= " $sqlANDOR c.type != 'systemauto'";
+ $sql .= " $sqlANDOR c.type <> 'systemauto'";
} elseif ($actioncode == 'AC_ALL_AUTO') {
$sql .= " $sqlANDOR c.type = 'systemauto'";
} else {
if ($actioncode == 'AC_OTH') {
- $sql .= " $sqlANDOR c.type != 'systemauto'";
+ $sql .= " $sqlANDOR c.type <> 'systemauto'";
} elseif ($actioncode == 'AC_OTH_AUTO') {
$sql .= " $sqlANDOR c.type = 'systemauto'";
}
}
} else {
if ($actioncode == 'AC_NON_AUTO') {
- $sql .= " $sqlANDOR c.type != 'systemauto'";
+ $sql .= " $sqlANDOR c.type <> 'systemauto'";
} elseif ($actioncode == 'AC_ALL_AUTO') {
$sql .= " $sqlANDOR c.type = 'systemauto'";
} else {
diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
index 9e45515a15e..940a4f09a6d 100644
--- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
@@ -6,6 +6,7 @@
* Copyright (C) 2015 Marcos García
* Copyright (C) 2017 Ferran Marcet
* Copyright (C) 2018-2022 Frédéric France
+ * Copyright (C) 2023 William Mead
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1197,9 +1198,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$pdf->SetTextColor(0, 0, 60);
$pdf->SetFont('', 'B', $default_font_size + 3);
- $w = 100;
+ $w = 110;
- $posx = $this->page_largeur - $this->marge_droite - 100;
+ $posx = $this->page_largeur - $this->marge_droite - $w;
$posy = $this->marge_haute;
$pdf->SetXY($this->marge_gauche, $posy);
diff --git a/htdocs/eventorganization/eventorganizationindex.php b/htdocs/eventorganization/eventorganizationindex.php
index 60f5beefd70..7a2be5096ca 100644
--- a/htdocs/eventorganization/eventorganizationindex.php
+++ b/htdocs/eventorganization/eventorganizationindex.php
@@ -148,7 +148,7 @@ print '';
$NBMAX = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
-$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT
// Last modified myobject
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 6394000d007..5426fc1a8ac 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -638,7 +638,7 @@ if (empty($reshook)) {
$emailTo = $destinataire->email;
// CC
- $emailCC = $conf->global->NDF_CC_EMAILS;
+ $emailCC = getDolGlobalString('NDF_CC_EMAILS');
if (empty($emailTo)) {
$emailTo = $emailCC;
}
@@ -646,7 +646,7 @@ if (empty($reshook)) {
// FROM
$expediteur = new User($db);
$expediteur->fetch($object->fk_user_approve > 0 ? $object->fk_user_approve : $object->fk_user_validator);
- $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
+ $emailFrom = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
if ($emailFrom && $emailTo) {
$filename = array();
@@ -654,9 +654,9 @@ if (empty($reshook)) {
$mimetype = array();
// SUBJECT
- $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
+ $societeName = getDolGlobalString('MAIN_INFO_SOCIETE_NOM');
if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
- $societeName = $conf->global->MAIN_APPLICATION_TITLE;
+ $societeName = getDolGlobalString('MAIN_APPLICATION_TITLE');
}
$subject = $societeName." - ".$langs->transnoentities("ExpenseReportApproved");
diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php
index 98f5c15c5ce..87127b34010 100644
--- a/htdocs/fourn/class/api_supplier_invoices.class.php
+++ b/htdocs/fourn/class/api_supplier_invoices.class.php
@@ -235,7 +235,7 @@ class SupplierInvoices extends DolibarrApi
}
if ($this->invoice->create(DolibarrApiAccess::$user) < 0) {
- throw new RestException(500, "Error creating order", array_merge(array($this->invoice->error), $this->invoice->errors));
+ throw new RestException(500, "Error creating invoice ", array_merge(array($this->invoice->error), $this->invoice->errors));
}
return $this->invoice->id;
}
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 05f91cdb6af..65a00f8affc 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -1916,19 +1916,18 @@ class FactureFournisseur extends CommonInvoice
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
$oldref = dol_sanitizeFileName($this->ref);
- $newref = dol_sanitizeFileName($num);
$dirsource = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$oldref;
- $dirdest = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$newref;
+ $dirdest = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$this->newref;
if (!$error && file_exists($dirsource)) {
dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
if (@rename($dirsource, $dirdest)) {
dol_syslog("Rename ok");
- // Rename docs starting with $oldref with $newref
- $listoffiles = dol_dir_list($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$newref, 'files', 1, '^'.preg_quote($oldref, '/'));
+ // Rename docs starting with $oldref with $this->newref
+ $listoffiles = dol_dir_list($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id, 2, 0, 0, $this, 'invoice_supplier').$this->newref, 'files', 1, '^'.preg_quote($oldref, '/'));
foreach ($listoffiles as $fileentry) {
$dirsource = $fileentry['name'];
- $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource);
+ $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $this->newref, $dirsource);
$dirsource = $fileentry['path'].'/'.$dirsource;
$dirdest = $fileentry['path'].'/'.$dirdest;
@rename($dirsource, $dirdest);
diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php
index f3b9be0cced..8e0b6457e6f 100644
--- a/htdocs/fourn/facture/index.php
+++ b/htdocs/fourn/facture/index.php
@@ -38,7 +38,7 @@ if (isset($user->socid) && $user->socid > 0) {
$socid = $user->socid;
}
-$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Maximum elements of the tables
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php
index 486e47f8b38..bc9998adf82 100644
--- a/htdocs/hrm/class/skill.class.php
+++ b/htdocs/hrm/class/skill.class.php
@@ -20,7 +20,7 @@
*/
/**
- * \file class/skill.class.php
+ * \file htdocs/hrm/class/skill.class.php
* \ingroup hrm
* \brief This file is a CRUD class file for Skill (Create/Read/Update/Delete)
*/
@@ -244,14 +244,14 @@ class Skill extends CommonObject
* createSkills
*
* @param int $i Rank from which we want to create skilldets (level $i to HRM_MAXRANK wil be created)
- * @return null
+ * @return int Return integer <0 if KO, Id of created object if OK
*/
public function createSkills($i = 1)
{
global $conf, $user, $langs;
- $MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : self::DEFAULT_MAX_RANK_PER_SKILL;
- $defaultSkillDesc = getDolGlobalString('HRM_DEFAULT_SKILL_DESCRIPTION') ? $conf->global->HRM_DEFAULT_SKILL_DESCRIPTION : $langs->trans("NoDescription");
+ $MaxNumberSkill = getDolGlobalInt('HRM_MAXRANK', self::DEFAULT_MAX_RANK_PER_SKILL);
+ $defaultSkillDesc = getDolGlobalString('HRM_DEFAULT_SKILL_DESCRIPTION', $langs->trans("NoDescription"));
$error = 0;
diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php
index fe8b86c78b6..dbcca1b50d4 100644
--- a/htdocs/hrm/index.php
+++ b/htdocs/hrm/index.php
@@ -72,7 +72,7 @@ if (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') || !getDolGlobalString('MAIN_IN
$setupcompanynotcomplete = 1;
}
-$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
/*
@@ -90,6 +90,8 @@ if (isModEnabled('holiday') && !empty($setupcompanynotcomplete)) {
* View
*/
+$listofsearchfields = array();
+
$childids = $user->getAllChildIds();
$childids[] = $user->id;
@@ -187,7 +189,7 @@ print ' ';
-// Latest leave requests
+// Latest modified leave requests
if (isModEnabled('holiday') && $user->hasRight('holiday', 'read')) {
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.photo, u.statut as user_status,";
$sql .= " x.rowid, x.ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status";
@@ -271,7 +273,7 @@ if (isModEnabled('holiday') && $user->hasRight('holiday', 'read')) {
}
-// Latest expense report
+// Latest modified expense report
if (isModEnabled('expensereport') && $user->hasRight('expensereport', 'read')) {
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.statut as user_status, u.photo,";
$sql .= " x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status";
@@ -406,7 +408,7 @@ if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjo
$db->free($resql);
} else {
- print ' | | '.$langs->trans("None").' |
';
+ print '| '.$langs->trans("None").' |
';
}
print "";
print "";
diff --git a/htdocs/install/mysql/data/llx_c_forme_juridique.sql b/htdocs/install/mysql/data/llx_c_forme_juridique.sql
index f17ba7b1b21..fd094e387ef 100644
--- a/htdocs/install/mysql/data/llx_c_forme_juridique.sql
+++ b/htdocs/install/mysql/data/llx_c_forme_juridique.sql
@@ -110,7 +110,7 @@ insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '229', 'VS
-- France: Catégories niveau II - Extrait de https://www.insee.fr/fr/information/2028129 - Dernière mise à jour Septembre 2022
-insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'00','Organisme de placement collectif en valeurs mobilières sans personnalité morale');
+insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'09','Organisme de placement collectif en valeurs mobilières sans personnalité morale');
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'10','Entrepreneur individuel');
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'21','Indivision');
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'22','Société créée de fait');
diff --git a/htdocs/langs/en_US/recruitment.lang b/htdocs/langs/en_US/recruitment.lang
index d46ddaf389a..50085bd578f 100644
--- a/htdocs/langs/en_US/recruitment.lang
+++ b/htdocs/langs/en_US/recruitment.lang
@@ -79,3 +79,4 @@ WeAreRecruiting=We are recruiting. This is a list of open positions to be filled
NoPositionOpen=No positions open at the moment
ConfirmClose=Confirm cancellation
ConfirmCloseAsk=Are you sure you want to cancel this recruitment candidature
+recruitment=Recruitment
diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index 4e19a517e6c..a2e5d7fd27b 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -219,10 +219,6 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) {
// For DE, we need to invert our address with customer address
$conf->global->MAIN_INVERT_SENDER_RECIPIENT = 1;
}
- if ($mysoc->country_code == 'FR' && !isset($conf->global->MAIN_PROFID1_IN_ADDRESS)) {
- // For FR, default value of option to show profid SIRET is on by default. Decret n°2099-1299 2022-10-07
- $conf->global->MAIN_PROFID1_IN_ADDRESS = 1;
- }
if ($mysoc->country_code == 'FR' && !isset($conf->global->INVOICE_CATEGORY_OF_OPERATION)) {
// For FR, default value of option to show category of operations is on by default. Decret n°2099-1299 2022-10-07
$conf->global->INVOICE_CATEGORY_OF_OPERATION = 1;
@@ -249,6 +245,7 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) {
// Invoice subtype is a requirement for Greece.
$conf->global->INVOICE_SUBTYPE_ENABLED = 1;
}
+
if (($mysoc->localtax1_assuj || $mysoc->localtax2_assuj) && !isset($conf->global->MAIN_NO_INPUT_PRICE_WITH_TAX)) {
// For countries using the 2nd or 3rd tax, we disable input/edit of lines using the price including tax (because 2nb and 3rd tax not yet taken into account).
// Work In Progress to support all taxes into unit price entry when MAIN_UNIT_PRICE_WITH_TAX_IS_FOR_ALL_TAXES is set.
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index c64d042485b..e0b191c195a 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -299,7 +299,6 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql = preg_replace('/,\s*$/', '', $sql);
-//$sql .= ", COUNT(rc.rowid) as anotherfield";
$sqlfields = $sql; // $sql fields to remove for count total
@@ -388,6 +387,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
/* The fast and low memory method to get and count full list converts the sql into a sql count */
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
+
$resql = $db->query($sqlforcount);
if ($resql) {
$objforcount = $db->fetch_object($resql);
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index bbec24b64de..bcdd89b806b 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -4788,8 +4788,8 @@ class Product extends CommonObject
// phpcs:enable
$this->db->begin();
- $sql = 'INSERT INTO '.$this->db->prefix().'product_association (fk_product_pere, fk_product_fils, qty)';
- $sql .= " SELECT ".$toId.", fk_product_fils, qty FROM ".$this->db->prefix()."product_association";
+ $sql = 'INSERT INTO '.$this->db->prefix().'product_association (fk_product_pere, fk_product_fils, qty, incdec)';
+ $sql .= " SELECT ".$toId.", fk_product_fils, qty, incdec FROM ".$this->db->prefix()."product_association";
$sql .= " WHERE fk_product_pere = ".((int) $fromId);
dol_syslog(get_class($this).'::clone_association', LOG_DEBUG);
diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php
index 4b554de220e..735e7bc6b96 100644
--- a/htdocs/product/inventory/class/inventory.class.php
+++ b/htdocs/product/inventory/class/inventory.class.php
@@ -47,7 +47,7 @@ class Inventory extends CommonObject
public $table_element = 'inventory';
/**
- * @var array Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ * @var int Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
public $ismultientitymanaged = 1;
@@ -789,7 +789,7 @@ class InventoryLine extends CommonObjectLine
public $table_element = 'inventorydet';
/**
- * @var array Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ * @var int Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
public $ismultientitymanaged = 0;
diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php
index ce24972023f..f72ad23a3ef 100644
--- a/htdocs/product/stock/productlot_list.php
+++ b/htdocs/product/stock/productlot_list.php
@@ -229,6 +229,9 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql = preg_replace('/,\s*$/', '', $sql);
+
+$sqlfields = $sql;
+
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
@@ -317,7 +320,9 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
}
}*/
/* The fast and low memory method to get and count full list converts the sql into a sql count */
- $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql);
+ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
+ $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
+
$resql = $db->query($sqlforcount);
if ($resql) {
$objforcount = $db->fetch_object($resql);
diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php
index f2d3946579a..8e7c81d1200 100644
--- a/htdocs/projet/contact.php
+++ b/htdocs/projet/contact.php
@@ -158,6 +158,11 @@ if (empty($reshook)) {
// Add new contact
if ($action == 'addcontact_confirm' && $user->hasRight('projet', 'creer')) {
+ if (GETPOST('confirm', 'alpha') == 'no') {
+ header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
+ exit;
+ }
+
$contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index ce25b803c37..5fa292da439 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -60,7 +60,7 @@ if (!$user->hasRight('projet', 'lire')) {
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
-$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
/*
diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php
index 9f62c6265c5..873f5a80e50 100644
--- a/htdocs/public/agenda/agendaexport.php
+++ b/htdocs/public/agenda/agendaexport.php
@@ -86,7 +86,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$object = new ActionComm($db);
// Not older than
-if (!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) {
+if (empty($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) {
$conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY = 100; // default limit
}
diff --git a/htdocs/recruitment/index.php b/htdocs/recruitment/index.php
index cd2c16759f8..62513824e7c 100644
--- a/htdocs/recruitment/index.php
+++ b/htdocs/recruitment/index.php
@@ -330,7 +330,7 @@ print '';
$NBMAX = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
-$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
// Last modified job position
if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjobposition', 'read')) {
@@ -393,7 +393,7 @@ if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjo
$db->free($resql);
} else {
- print '
| '.$langs->trans("None").' |
';
+ print '| '.$langs->trans("None").' |
';
}
print "";
print "";
@@ -459,7 +459,7 @@ if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjo
$db->free($resql);
} else {
- print '| '.$langs->trans("None").' |
';
+ print '| '.$langs->trans("None").' |
';
}
print "";
print "";
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 2d6e1991846..ae4fe3dd971 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1775,7 +1775,7 @@ class Societe extends CommonObject
global $langs;
global $conf;
- if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($barcode) && empty($idprof1) && empty($idprof2) && empty($idprof3) && empty($idprof4) && empty($idprof5) && empty($idprof6) && empty($email)) {
+ if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($barcode) && empty($idprof1) && empty($idprof2) && empty($idprof3) && empty($idprof4) && empty($idprof5) && empty($idprof6) && empty($email) && empty($ref_alias)) {
return -1;
}
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 05826f80dbc..78e4e5e0ac4 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -266,12 +266,12 @@ if (empty($reshook)) {
$object->login = GETPOST("login", 'alphanohtml');
$object->api_key = GETPOST("api_key", 'alphanohtml');
$object->gender = GETPOST("gender", 'aZ09');
- $object->admin = GETPOST("admin", 'int');
+ $object->admin = GETPOSTINT("admin");
$object->address = GETPOST('address', 'alphanohtml');
$object->zip = GETPOST('zipcode', 'alphanohtml');
$object->town = GETPOST('town', 'alphanohtml');
- $object->country_id = GETPOST('country_id', 'int');
- $object->state_id = GETPOST('state_id', 'int');
+ $object->country_id = GETPOSTINT('country_id');
+ $object->state_id = GETPOSTINT('state_id');
$object->office_phone = GETPOST("office_phone", 'alphanohtml');
$object->office_fax = GETPOST("office_fax", 'alphanohtml');
$object->user_mobile = GETPOST("user_mobile", 'alphanohtml');
@@ -314,7 +314,7 @@ if (empty($reshook)) {
$object->dateendvalidity = $dateendvalidity;
$object->birth = $dateofbirth;
- $object->fk_warehouse = GETPOST('fk_warehouse', 'int');
+ $object->fk_warehouse = GETPOSTINT('fk_warehouse');
$object->lang = GETPOST('default_lang', 'aZ09');
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 16a1eeddcfc..251e06f6390 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -81,6 +81,11 @@ class User extends CommonObject
public $id = 0;
+ /**
+ * @var User old copy of User
+ */
+ public $oldcopy;
+
/**
* @var int
* @deprecated
diff --git a/htdocs/user/class/userbankaccount.class.php b/htdocs/user/class/userbankaccount.class.php
index 9a43479e2da..7718d1abccc 100644
--- a/htdocs/user/class/userbankaccount.class.php
+++ b/htdocs/user/class/userbankaccount.class.php
@@ -315,7 +315,7 @@ class UserBankAccount extends Account
$country_code_in_EEC = getCountriesInEEC();
return in_array($this->country_code, $country_code_in_EEC);
} else {
- return -1;
+ return false;
}
}
}
diff --git a/htdocs/webhook/webhookindex.php b/htdocs/webhook/webhookindex.php
index 47f6b42e776..2212fe61a46 100644
--- a/htdocs/webhook/webhookindex.php
+++ b/htdocs/webhook/webhookindex.php
@@ -144,7 +144,7 @@ print '';
$NBMAX = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
-$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT
// Last modified myobject
diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php
index fd7a217c30e..9b4fe24dbc3 100644
--- a/htdocs/website/class/websitepage.class.php
+++ b/htdocs/website/class/websitepage.class.php
@@ -868,7 +868,7 @@ class WebsitePage extends CommonObject
$now = dol_now();
- $this->fk_website = '';
+ $this->fk_website = 0;
$this->type_container = 'page';
$this->pageurl = 'specimen';
$this->aliasalt = 'specimenalt';
@@ -879,7 +879,7 @@ class WebsitePage extends CommonObject
$this->allowed_in_frames = 1;
$this->htmlheader = '';
$this->content = 'This is a html content';
- $this->status = '';
+ $this->status = self::STATUS_DRAFT;
$this->grabbed_from = '';
$this->date_creation = $now - (24 * 30 * 3600);
$this->date_modification = $now - (24 * 7 * 3600);
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index aa7ea1f78e7..e25f1d4b2ab 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -4808,7 +4808,7 @@ if ($mode == 'replacesite' || $massaction == 'replace') {
print '';
// Categories - Tags
- print '
';
+ print ' | ';
if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
// Get current categories
$existing = $c->containing($answerrecord->id, Categorie::TYPE_WEBSITE_PAGE, 'object');
|