| '.$langs->trans("Type").' | ';
- $default = getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT', 'AC_RDV');
+ $default = getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT', 'AC_OTH');
+ if (empty($default)) {
+ $default = 'AC_OTH';
+ }
print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"');
$selectedvalue = GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default);
print $formactions->select_type_actions($selectedvalue, "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot
diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php
index 371082df46f..663a65b60c2 100644
--- a/htdocs/comm/action/class/api_agendaevents.class.php
+++ b/htdocs/comm/action/class/api_agendaevents.class.php
@@ -316,7 +316,7 @@ class AgendaEvents extends DolibarrApi
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
- $this->actioncomm->array_options[$index] = $this->_checkValForAPI($field, $val, $this->actioncomm);
+ $this->actioncomm->array_options[$index] = $this->_checkValExtrafieldsForAPI($index, $val, $this->actioncomm);
}
continue;
}
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index 92733c42883..00abcdb2743 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -7,7 +7,7 @@
* Copyright (C) 2020 Pierre Ardoin
* Copyright (C) 2020 Tobias Sekan
* Copyright (C) 2024-2026 MDW
- * Copyright (C) 2024-2025 Frédéric France
+ * Copyright (C) 2024-2026 Frédéric France
*
* 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
@@ -31,6 +31,13 @@
// Load Dolibarr environment
require '../main.inc.php';
+/**
+ * @var Conf $conf
+ * @var DoliDB $db
+ * @var HookManager $hookmanager
+ * @var Translate $langs
+ * @var User $user
+ */
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
@@ -48,16 +55,8 @@ if (isModEnabled('intervention')) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
}
-/**
- * @var Conf $conf
- * @var DoliDB $db
- * @var HookManager $hookmanager
- * @var Translate $langs
- * @var User $user
- */
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
-$hookmanager = new HookManager($db);
$hookmanager->initHooks(array('commercialindex'));
// Load translation files required by the page
diff --git a/htdocs/comm/mailing/class/api_mailings.class.php b/htdocs/comm/mailing/class/api_mailings.class.php
index c8b8f7dc870..c66042274d7 100644
--- a/htdocs/comm/mailing/class/api_mailings.class.php
+++ b/htdocs/comm/mailing/class/api_mailings.class.php
@@ -466,7 +466,7 @@ class Mailings extends DolibarrApi
}
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
- $this->mailing->array_options[$index] = $this->_checkValForAPI($field, $val, $this->mailing);
+ $this->mailing->array_options[$index] = $this->_checkValExtrafieldsForAPI($index, $val, $this->mailing);
}
continue;
}
diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php
index 667b6ebea39..e761c2c1a95 100644
--- a/htdocs/comm/mailing/index.php
+++ b/htdocs/comm/mailing/index.php
@@ -4,7 +4,7 @@
* Copyright (C) 2010 Regis Houssin
* Copyright (C) 2019 Nicolas ZABOURI
* Copyright (C) 2024 MDW
- * Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024-2026 Frédéric France
*
* 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
@@ -28,9 +28,6 @@
// Load Dolibarr environment
require '../../main.inc.php';
-require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
-
/**
* @var Conf $conf
* @var DoliDB $db
@@ -38,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
* @var Translate $langs
* @var User $user
*/
-
-$hookmanager = new HookManager($db);
+require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('mailingindex'));
diff --git a/htdocs/comm/propal/agenda.php b/htdocs/comm/propal/agenda.php
index 4b906ce8065..d90a560adb0 100644
--- a/htdocs/comm/propal/agenda.php
+++ b/htdocs/comm/propal/agenda.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2024-2025 Frédéric France
+ * Copyright (C) 2024-2026 Frédéric France
* Copyright (C) 2025 MDW
*
* This program is free software; you can redistribute it and/or modify
@@ -23,6 +23,14 @@
* \brief Tab of events on Proposal
*/
require '../../main.inc.php';
+/**
+ * @var Conf $conf
+ * @var DoliDB $db
+ * @var ExtraFields $extrafields
+ * @var HookManager $hookmanager
+ * @var Translate $langs
+ * @var User $user
+ */
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
@@ -30,13 +38,6 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/propal.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
-/**
- * @var Conf $conf
- * @var DoliDB $db
- * @var HookManager $hookmanager
- * @var Translate $langs
- * @var User $user
- */
// Load translation files required by the page
$langs->loadLangs(array("propal", "other"));
@@ -80,7 +81,6 @@ if (!$sortorder) {
// Initialize a technical objects
$object = new Propal($db);
-$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->propal->multidir_output[$conf->entity] . '/temp/massgeneration/' . $user->id;
$hookmanager->initHooks(array('propalagenda', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
@@ -96,6 +96,7 @@ $permissiontoread = $user->hasRight("propal", "lire");
$permissiontoadd = $user->hasRight("propal", "creer");
// Security check
+$socid = '';
if (!empty($user->socid)) {
$socid = $user->socid;
}
@@ -150,7 +151,11 @@ if ($object->id > 0) {
// Object card
// ------------------------------------------------------------
- $linkback = '' . $langs->trans("BackToList") . '';
+ $query = ['restore_lastsearch_values' => 1];
+ if (!empty($socid) && $socid > 0) {
+ $query += ['socid' => $socid];
+ }
+ $linkback = '' . $langs->trans("BackToList") . '';
$morehtmlref = '';
// Ref customer
@@ -167,7 +172,7 @@ if ($object->id > 0) {
if ($action != 'classify') {
$morehtmlref .= ' ' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
}
- $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
+ $morehtmlref .= $form->form_project(dolBuildUrl($_SERVER['PHP_SELF'], ['id' => $object->id]), $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($object->fk_project)) {
$proj = new Project($db);
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 65ef049d0e4..05f06514944 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -12,7 +12,7 @@
* Copyright (C) 2013-2014 Florian Henry
* Copyright (C) 2014 Ferran Marcet
* Copyright (C) 2016 Marcos García
- * Copyright (C) 2018-2025 Frédéric France
+ * Copyright (C) 2018-2026 Frédéric France
* Copyright (C) 2020 Nicolas ZABOURI
* Copyright (C) 2022 Gauthier VERDOL
* Copyright (C) 2023 Lenin Rivas
@@ -182,14 +182,14 @@ if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if (empty($reshook)) {
- $backurlforlist = DOL_URL_ROOT . '/comm/propal/list.php';
+ $backurlforlist = dolBuildUrl(DOL_URL_ROOT . '/comm/propal/list.php');
if (empty($backtopage) || ($cancel && empty($id))) {
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist;
} else {
- $backtopage = DOL_URL_ROOT . '/comm/propal/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__');
+ $backtopage = dolBuildUrl(DOL_URL_ROOT . '/comm/propal/card.php', ['id' => ((!empty($id) && $id > 0) ? $id : '__ID__')]);
}
}
}
@@ -286,7 +286,7 @@ if (empty($reshook)) {
// Cancel proposal
$result = $object->setCancel($user);
if ($result > 0) {
- header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
+ header('Location: ' . dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]));
exit();
} else {
$langs->load("errors");
@@ -296,7 +296,7 @@ if (empty($reshook)) {
// Delete proposal
$result = $object->delete($user);
if ($result > 0) {
- header('Location: ' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1');
+ header('Location: ' . dolBuildUrl(DOL_URL_ROOT . '/comm/propal/list.php', ['restore_lastsearch_values' => 1]));
exit();
} else {
$langs->load("errors");
@@ -472,7 +472,7 @@ if (empty($reshook)) {
} elseif ($action == 'setdate_livraison' && $usercancreate) {
$result = $object->setDeliveryDate($user, dol_mktime(12, 0, 0, GETPOSTINT('date_livraisonmonth'), GETPOSTINT('date_livraisonday'), GETPOSTINT('date_livraisonyear')));
if ($result < 0) {
- dol_print_error($db, $object->error);
+ setEventMessages($object->error, $object->errors, 'errors');
}
} elseif ($action == 'setref_client' && $usercancreate) {
// Positionne ref client
@@ -483,8 +483,14 @@ if (empty($reshook)) {
} elseif ($action == 'set_incoterms' && isModEnabled('incoterm') && $usercancreate) {
// Set incoterm
$result = $object->setIncoterms(GETPOSTINT('incoterm_id'), GETPOST('location_incoterms'));
+ if ($result < 0) {
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
} elseif ($action == 'settags' && isModEnabled('category') && $usercancreate) { // Set tags
$result = $object->setCategories(GETPOST('categories', 'array'));
+ if ($result < 0) {
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
} elseif ($action == 'add' && $usercancreate) {
// Create proposal
$object->socid = $socid;
@@ -1003,10 +1009,16 @@ if (empty($reshook)) {
}
} elseif ($action == 'addline' && GETPOST('updateallvatlinesblock', 'alpha') && GETPOST('vatforblocklines', 'alpha') !== '' && $usercancreate) {
$tx_tva = GETPOST('vatforblocklines') ? GETPOST('vatforblocklines') : 0;
- $object->updateSubtotalLineBlockLines($langs, $object->getRangOfLine($lineid), 'tva', $tx_tva);
+ $result = $object->updateSubtotalLineBlockLines($langs, $object->getRangOfLine($lineid), 'tva', $tx_tva);
+ if ($result < 0) {
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
} elseif ($action == 'addline' && GETPOST('updatealldiscountlinesblock', 'alpha') && GETPOST('discountforblocklines', 'alpha') !== '' && $usercancreate) {
$discount = GETPOST('discountforblocklines') ? GETPOST('discountforblocklines') : 0;
- $object->updateSubtotalLineBlockLines($langs, $object->getRangOfLine($lineid), 'discount', $discount);
+ $result = $object->updateSubtotalLineBlockLines($langs, $object->getRangOfLine($lineid), 'discount', $discount);
+ if ($result < 0) {
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
}
include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php
index 5ac333a9d9e..241603931f2 100644
--- a/htdocs/comm/propal/class/api_proposals.class.php
+++ b/htdocs/comm/propal/class/api_proposals.class.php
@@ -931,7 +931,7 @@ class Proposals extends DolibarrApi
}
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
- $this->propal->array_options[$index] = $this->_checkValForAPI($field, $val, $this->propal);
+ $this->propal->array_options[$index] = $this->_checkValExtrafieldsForAPI($index, $val, $this->propal);
}
continue;
}
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index af2a5f56174..9529526d22c 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -13,7 +13,7 @@
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2014-2015 Marcos García
* Copyright (C) 2018 Nicolas ZABOURI
- * Copyright (C) 2018-2025 Frédéric France
+ * Copyright (C) 2018-2026 Frédéric France
* Copyright (C) 2018 Ferran Marcet
* Copyright (C) 2022 ATM Consulting
* Copyright (C) 2022 OpenDSI
@@ -3562,8 +3562,8 @@ class Propal extends CommonObject
$response->warning_delay = $delay_warning / 60 / 60 / 24;
$response->label = $label;
$response->labelShort = $labelShort;
- $response->url = DOL_URL_ROOT.'/comm/propal/list.php?search_status='.$status.'&mainmenu=commercial&leftmenu=propals';
- $response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?search_option=late&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc';
+ $response->url = dolBuildUrl(DOL_URL_ROOT.'/comm/propal/list.php', ['search_status' => $status, 'mainmenu' => 'commercial', 'leftmenu' => 'propals']);
+ $response->url_late = dolBuildUrl(DOL_URL_ROOT.'/comm/propal/list.php', ['search_option' => 'late', 'mainmenu' => 'commercial', 'leftmenu' => 'propals', 'sortfield' => 'p.datep', 'sortorder' => 'asc']);
$response->img = img_object('', "propal");
// This assignment in condition is not a bug. It allows walking the results.
@@ -3979,7 +3979,7 @@ class Propal extends CommonObject
if ($txttoshow) {
$result .= ' ';
- $result .= '';
+ $result .= '';
$result .= img_picto('', 'note');
$result .= '';
$result .= '';
@@ -4025,12 +4025,10 @@ class Propal extends CommonObject
$outputlangs->loadLangs(array("propale", "products"));
if (!dol_strlen($modele)) {
- $modele = 'azur';
+ $modele = getDolGlobalString('PROPALE_ADDON_PDF', 'cyan');
if ($this->model_pdf) {
$modele = $this->model_pdf;
- } elseif (getDolGlobalString('PROPALE_ADDON_PDF')) {
- $modele = getDolGlobalString('PROPALE_ADDON_PDF');
}
}
diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index 0bc7f7f9c5b..b76421abec7 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -5,7 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2013 Cédric Salvador
* Copyright (C) 2017 Ferran Marcet
- * Copyright (C) 2024-2025 Frédéric France
+ * Copyright (C) 2024-2026 Frédéric France
* Copyright (C) 2025 MDW
*
* This program is free software; you can redistribute it and/or modify
@@ -30,6 +30,13 @@
// Load Dolibarr environment
require '../../main.inc.php';
+/**
+ * @var Conf $conf
+ * @var DoliDB $db
+ * @var HookManager $hookmanager
+ * @var Translate $langs
+ * @var User $user
+ */
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -39,13 +46,6 @@ if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
-/**
- * @var Conf $conf
- * @var DoliDB $db
- * @var HookManager $hookmanager
- * @var Translate $langs
- * @var User $user
- */
// Load translation files required by the page
$langs->loadLangs(array('propal', 'compta', 'other', 'companies'));
@@ -133,8 +133,11 @@ if ($object->id > 0) {
// Proposal card
-
- $linkback = ''.$langs->trans("BackToList").'';
+ $query = ['restore_lastsearch_values' => 1];
+ if (!empty($socid) && $socid > 0) {
+ $query += ['socid' => $socid];
+ }
+ $linkback = ''.$langs->trans("BackToList").'';
$morehtmlref = '';
diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php
index 7ff7a943aaa..4438bed9e71 100644
--- a/htdocs/comm/propal/index.php
+++ b/htdocs/comm/propal/index.php
@@ -4,7 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2019 Nicolas ZABOURI
* Copyright (C) 2020 Tobias Sekan
- * Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024-2026 Frédéric France
*
* 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
@@ -28,10 +28,6 @@
// Load Dolibarr environment
require '../../main.inc.php';
-require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
-require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
-
/**
* @var Conf $conf
* @var DoliDB $db
@@ -39,9 +35,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
* @var Translate $langs
* @var User $user
*/
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
+require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
+
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
-$hookmanager = new HookManager($db);
$hookmanager->initHooks(array('proposalindex'));
// Load translation files required by the page
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 27380f64a83..96f416bfe5b 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -15,7 +15,7 @@
* Copyright (C) 2018 Nicolas ZABOURI
* Copyright (C) 2019-2026 Alexandre Spangaro
* Copyright (C) 2021 Anthony Berton
- * Copyright (C) 2021-2025 Frédéric France
+ * Copyright (C) 2021-2026 Frédéric France
* Copyright (C) 2022 Josep Lluís Amador
* Copyright (C) 2024-2026 MDW
* Copyright (C) 2024 William Mead
@@ -42,6 +42,14 @@
// Load Dolibarr environment
require '../../main.inc.php';
+/**
+ * @var Conf $conf
+ * @var DoliDB $db
+ * @var ExtraFields $extrafields
+ * @var HookManager $hookmanager
+ * @var Translate $langs
+ * @var User $user
+ */
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php';
@@ -58,13 +66,6 @@ if (isModEnabled('category')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php';
}
-/**
- * @var Conf $conf
- * @var DoliDB $db
- * @var HookManager $hookmanager
- * @var Translate $langs
- * @var User $user
- */
// Load translation files required by the page
$langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'sendings', 'categories'));
@@ -207,7 +208,6 @@ $diroutputmassaction = $conf->propal->multidir_output[$conf->entity].'/temp/mass
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$object = new Propal($db);
-$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
diff --git a/htdocs/comm/propal/messaging.php b/htdocs/comm/propal/messaging.php
index 26d865aba1d..5fe4b9c0ca7 100644
--- a/htdocs/comm/propal/messaging.php
+++ b/htdocs/comm/propal/messaging.php
@@ -2,7 +2,7 @@
/* Copyright (C) 2005-2016 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
* Copyright (C) 2024 MDW
- * Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024-2026 Frédéric France
* Copyright (C) 2025 Valentin Grimal
*
* This program is free software; you can redistribute it and/or modify
@@ -27,12 +27,6 @@
// Load Dolibarr environment
require '../../main.inc.php';
-require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
-require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
-require_once DOL_DOCUMENT_ROOT . '/core/lib/propal.lib.php';
-require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
-require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
-
/**
* @var Conf $conf
* @var DoliDB $db
@@ -40,6 +34,11 @@ require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
* @var Translate $langs
* @var User $user
*/
+require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
+require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
+require_once DOL_DOCUMENT_ROOT . '/core/lib/propal.lib.php';
+require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
+require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
// Load translation files required by the page
$langs->load("propal");
diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php
index 881731f4761..83ba8ffffe0 100644
--- a/htdocs/comm/propal/note.php
+++ b/htdocs/comm/propal/note.php
@@ -5,7 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2017 Ferran Marcet
- * Copyright (C) 2024-2025 Frédéric France
+ * Copyright (C) 2024-2026 Frédéric France
* Copyright (C) 2025 MDW
*
* This program is free software; you can redistribute it and/or modify
@@ -111,8 +111,11 @@ if ($object->id > 0) {
// Proposal card
-
- $linkback = ''.$langs->trans("BackToList").'';
+ $query = ['restore_lastsearch_values' => 1];
+ if (!empty($socid) && $socid > 0) {
+ $query += ['socid' => $socid];
+ }
+ $linkback = ''.$langs->trans("BackToList").'';
$morehtmlref = '';
@@ -130,7 +133,7 @@ if ($object->id > 0) {
if ($action != 'classify') {
$morehtmlref .= ' '.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
}
- $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
+ $morehtmlref .= $form->form_project(dolBuildUrl($_SERVER['PHP_SELF'], ['id' => $object->id]), $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($object->fk_project)) {
$proj = new Project($db);
diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php
index e40e3a9f313..0d4dbf4147b 100644
--- a/htdocs/commande/class/api_orders.class.php
+++ b/htdocs/commande/class/api_orders.class.php
@@ -869,7 +869,7 @@ class Orders extends DolibarrApi
}
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
- $this->commande->array_options[$index] = $this->_checkValForAPI($field, $val, $this->commande);
+ $this->commande->array_options[$index] = $this->_checkValExtrafieldsForAPI($index, $val, $this->commande);
}
continue;
}
diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php
index 593373cbfd3..a929a046064 100644
--- a/htdocs/compta/bank/class/api_bankaccounts.class.php
+++ b/htdocs/compta/bank/class/api_bankaccounts.class.php
@@ -357,7 +357,7 @@ class BankAccounts extends DolibarrApi
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
- $account->array_options[$index] = $this->_checkValForAPI($field, $val, $account);
+ $account->array_options[$index] = $this->_checkValExtrafieldsForAPI($index, $val, $account);
}
continue;
}
diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php
index af862991a82..1ea1dd0b71e 100644
--- a/htdocs/compta/charges/index.php
+++ b/htdocs/compta/charges/index.php
@@ -8,7 +8,7 @@
* Copyright (C) 2019 Nicolas ZABOURI
* Copyright (C) 2021 Gauthier VERDOL
* Copyright (C) 2024-2025 MDW
- * Copyright (C) 2024-2025 Frédéric France
+ * Copyright (C) 2024-2026 Frédéric France
* Copyright (C) 2026 Nick Fragoulis
*
* This program is free software; you can redistribute it and/or modify
@@ -33,15 +33,6 @@
// Load Dolibarr environment
require '../../main.inc.php';
-require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
-require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php';
-require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
-require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
-require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
-
-
/**
* @var Conf $conf
* @var DoliDB $db
@@ -50,8 +41,13 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
* @var Translate $langs
* @var User $user
*/
-
-$hookmanager = new HookManager($db);
+require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
+require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php';
+require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
+require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
+require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('specialexpensesindex'));
diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php
index e24375c24ef..7865114cd54 100644
--- a/htdocs/compta/deplacement/list.php
+++ b/htdocs/compta/deplacement/list.php
@@ -152,7 +152,7 @@ if ($resql) {
print_barre_liste($langs->trans("TripsAndExpenses"), $page, $_SERVER["PHP_SELF"], "&socid=$socid", $sortfield, $sortorder, '', $num);
$i = 0;
- print '';
// List of comments
if (!empty($object->comments)) {
// Default color for current user
- $TColors = array($user->id => array('bgcolor'=>'efefef', 'color'=>'555'));
+ $TColors = array($user->id => array('bgcolor' => 'efefef', 'color' => '555'));
$first = true;
foreach ($object->comments as $comment) {
$fk_user = $comment->fk_user_author;
@@ -83,7 +94,7 @@ if (!empty($object->comments)) {
$bgcolor = $userstatic->color;
}
$color = (colorIsLight($bgcolor)) ? '555' : 'fff';
- $TColors[$fk_user] = array('bgcolor'=>$bgcolor, 'color'=>$color);
+ $TColors[$fk_user] = array('bgcolor' => $bgcolor, 'color' => $color);
}
print '';
if ($fk_user != $user->id) {
diff --git a/htdocs/core/tpl/bloc_showhide.tpl.php b/htdocs/core/tpl/bloc_showhide.tpl.php
index 162971cf061..e0fe29be516 100644
--- a/htdocs/core/tpl/bloc_showhide.tpl.php
+++ b/htdocs/core/tpl/bloc_showhide.tpl.php
@@ -2,7 +2,7 @@
/* Copyright (C) 2012 Regis Houssin
* Copyright (C) 2013 Laurent Destailleur
* Copyright (C) 2018-2025 Frédéric France
- * Copyright (C) 2024 MDW
+ * Copyright (C) 2024-2026 MDW
*
* 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
@@ -21,7 +21,14 @@
* @var CommonObject $object
*
* @var string $blocname
+ * @var string $title
*/
+'
+@phan-var-force string $blocname
+@phan-var-force string $title
+@phan-var-force array $parameters
+';
+
// Protection to avoid direct call of template
if (empty($blocname)) {
print "Error, template page can't be called as URL";
diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php
index 0f1b77c39b1..35534905032 100644
--- a/htdocs/core/tpl/document_actions_post_headers.tpl.php
+++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php
@@ -5,7 +5,7 @@
* Copyright (C) 2015 Marcos García
* Copyright (C) 2019 Nicolas ZABOURI
* Copyright (C) 2024-2025 Frédéric France
- * Copyright (C) 2025 MDW
+ * Copyright (C) 2025-2026 MDW
* Copyright (C) 2025 Charlene Benke
*
* This program is free software; you can redistribute it and/or modify
@@ -29,20 +29,22 @@
/**
* @var Conf $conf
- * @var CommonObject $object
* @var DoliDB $db
* @var Form $form
* @var HookManager $hookmanager
* @var Translate $langs
*
+ * @var CommonObject $object
* @var FormFile $formfile
* @var string $action
* @var string $modulepart
* @var string $upload_dir
* @var string $param
- * @var string $moreparam = param to add to download link for the form_attach_new_file function
+ * @var string $moreparam Param to add to download link for the form_attach_new_file function
+ * @var string $sortfield
+ * @var string $sortorder
* @var string $relativepathwithnofile
- * @var int $permisstiontoadd Permission or not to add a file (can use also $permission) and permission or not to edit file name or crop file (can use also $permtoedit)
+ * @var int $permissiontoadd Permission or not to add a file (can use also $permission) and permission or not to edit file name or crop file (can use also $permtoedit)
* @var string $savingdocmask For example dol_sanitizeFileName($object->ref).'-__file__';
* @var int $withproject
*/
@@ -52,7 +54,20 @@ if (empty($langs) || !is_object($langs)) {
print "Error, template page can't be called as URL";
exit(1);
}
+/**
+ * @var array $filearray
+ * @var ?int<0,1> $permtoedit
+ * @var ?int<0,1> $permission
+ * @var int<0,1> $permissiontoadd
+ * @var ?string $savingdocmask
+ * @var CommonObject $object
+ * @var string $sortfield
+ * @var string $sortorder
+ */
'
+@phan-var-force string $action
+@phan-var-force string $modulepart
+@phan-var-force string $upload_dir
@phan-var-force array $filearray
@phan-var-force ?int<0,1> $permtoedit
@phan-var-force ?int<0,1> $permission
@@ -60,6 +75,8 @@ if (empty($langs) || !is_object($langs)) {
@phan-var-force ?string $savingdocmask
@phan-var-force ?string $param
@phan-var-force CommonObject $object
+@phan-var-force string $sortfield
+@phan-var-force string $sortorder
';
@@ -188,6 +205,13 @@ if (getDolGlobalString('MAIN_DOCUMENTS_LIST_IN_TWOCOLUMNS')) {
print '';
print ' ';
}
+
+// Force displaying form to attach files and documents
+$showHideAddButtonValue = 1;
+if (getDolGlobalInt('MAIN_DOCUMENTS_SHOW_FILE_ATTACHMENT_FORM')) {
+ $showHideAddButtonValue = 0;
+}
+
// List of document
$formfile->list_of_documents(
$filearray,
@@ -211,7 +235,7 @@ $formfile->list_of_documents(
0,
-1,
'',
- array('afteruploadtitle' => $formToUploadAFile, 'showhideaddbutton' => 1)
+ array('afteruploadtitle' => $formToUploadAFile, 'showhideaddbutton' => $showHideAddButtonValue)
);
if (getDolGlobalString('MAIN_DOCUMENTS_LIST_IN_TWOCOLUMNS')) {
@@ -221,6 +245,12 @@ if (getDolGlobalString('MAIN_DOCUMENTS_LIST_IN_TWOCOLUMNS')) {
print " ";
}
+// Force displaying form to link files and documents
+$showHideAddButtonValue = 1;
+if (getDolGlobalInt('MAIN_DOCUMENTS_SHOW_FILE_LINKING_FORM')) {
+ $showHideAddButtonValue = 0;
+}
+
//List of links
$formfile->listOfLinks(
$object,
@@ -229,7 +259,7 @@ $formfile->listOfLinks(
(string) GETPOSTINT('linkid'),
$param,
'formaddlink',
- array('afterlinktitle' => $formToAddALink, 'showhideaddbutton' => 1)
+ array('afterlinktitle' => $formToAddALink, 'showhideaddbutton' => $showHideAddButtonValue)
);
if (getDolGlobalString('MAIN_DOCUMENTS_LIST_IN_TWOCOLUMNS')) {
diff --git a/htdocs/core/tpl/extrafields_list_array_fields.tpl.php b/htdocs/core/tpl/extrafields_list_array_fields.tpl.php
index 7de6e424bb6..e4b06a25d86 100644
--- a/htdocs/core/tpl/extrafields_list_array_fields.tpl.php
+++ b/htdocs/core/tpl/extrafields_list_array_fields.tpl.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2025-2026 MDW
*/
// This tpl file is included into the init part of pages, so before action.
@@ -10,13 +10,19 @@
/**
* @var Conf $conf
*
+ * @var array $arrayfields
* @var string $extrafieldsobjectkey
* @var string $extrafieldsobjectprefix
* @var int $extrafieldspositionoffset
+ * @var ?CommonObject $object
*/
'
@phan-var-force array $arrayfields
+@phan-var-force string $extrafieldsobjectkey
+@phan-var-force string $extrafieldsobjectprefix
+@phan-var-force int $extrafieldspositionoffset
+@phan-var-force ?CommonObject $object
';
// Protection to avoid direct call of template
diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
index 2c41594dfcc..b22741dcf3f 100644
--- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
+++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2025 MDW
+ * Copyright (C) 2025-2026 MDW
*
* 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
@@ -25,10 +25,12 @@
*
* @var string $extrafieldsobjectkey
* @var string $extrafieldsobjectprefix
+ * @var int $i
*/
'
@phan-var-force CommonObject $object
@phan-var-force stdClass $obj
+@phan-var-force int $i
';
// Protection to avoid direct call of template
@@ -41,6 +43,8 @@ if (empty($extrafieldsobjectkey) && is_object($object)) {
$extrafieldsobjectkey = $object->table_element;
}
+$totalarray = array();
+
// Loop to show all columns of extrafields from $obj, $extrafields and $db
if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafieldsobjectkey])) { // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
if (array_key_exists('label', $extrafields->attributes[$extrafieldsobjectkey]) && is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) {
@@ -87,7 +91,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
print 'attributes[$extrafieldsobjectkey]['type'][$key], array('stars')) ? ' title="'.dol_escape_htmltag($title).'"' : '');
+ print($title && !in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('stars')) ? ' title="'.dol_escape_htmltag($title).'"' : '');
print '>';
print $cssclassview ? '' : '';
print $valuetoshow;
diff --git a/htdocs/core/tpl/extrafields_list_search_title.tpl.php b/htdocs/core/tpl/extrafields_list_search_title.tpl.php
index 3a54b1392e0..b04c57acf56 100644
--- a/htdocs/core/tpl/extrafields_list_search_title.tpl.php
+++ b/htdocs/core/tpl/extrafields_list_search_title.tpl.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2025-2026 MDW
* Copyright (C) 2025 Frédéric France
* Copyright (C) 2025 Laurent Destailleur
*
@@ -31,17 +31,21 @@
* @var ?int $disablesortlink
* @var string $sortfield
* @var string $sortorder
+ * @var string $param
*/
+'
+@phan-var-force ?int<0,1> $disablesortlink
+@phan-var-force string $sortfield
+@phan-var-force string $sortorder
+@phan-var-force string $param
+@phan-var-force ?array{nbfield?:int} $totalarray
+';
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) {
print "Error, template page can't be called as URL";
exit(1);
}
-'
-@phan-var-force ?int<0,1> $disablesortlink
-';
-
if (empty($extrafieldsobjectkey) && is_object($object)) {
$extrafieldsobjectkey = $object->table_element;
}
diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php
index 9b6e6f0c136..824d0f2a203 100644
--- a/htdocs/core/tpl/list_print_total.tpl.php
+++ b/htdocs/core/tpl/list_print_total.tpl.php
@@ -1,7 +1,7 @@
- * Copyright (C) 2025 MDW
+ * Copyright (C) 2025-2026 MDW
*
* 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
@@ -27,12 +27,14 @@
* @var int $num
* @var ?int $limit
* @var ?int $offset
+ * @var string $sql
* @var string $sqlfields
* @var string $moreinfoontotal
* @var array{nbfield:int,type?:array,pos?:array,val?:array} $totalarray
*/
'
@phan-var-force array{nbfield:int,type?:array,pos?:array,val?:array} $totalarray
+@phan-var-force string $sql
@phan-var-force ?string $sqlfields
@phan-var-force ?int $limit
';
diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php
index 8b9e2545f5c..a905cdc008f 100644
--- a/htdocs/core/tpl/objectline_edit.tpl.php
+++ b/htdocs/core/tpl/objectline_edit.tpl.php
@@ -7,7 +7,7 @@
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2018-2025 Frédéric France
* Copyright (C) 2022 OpenDSI
- * Copyright (C) 2024-2025 MDW
+ * Copyright (C) 2024-2026 MDW
* Copyright (C) 2024 Alexandre Spangaro
* Copyright (C) 2025 Lenin Rivas
*
@@ -51,6 +51,8 @@
*
* @var string $action
* @var int $dateSelector
+ * @var string $var
+ * @var int $i
*/
// Protection to avoid direct call of template
@@ -64,6 +66,7 @@ if (empty($object) || !is_object($object)) {
@phan-var-force Societe $seller
@phan-var-force Societe $buyer
@phan-var-force string $var
+@phan-var-force int $i
';
// Handle subtotals line edit
@@ -116,7 +119,7 @@ $coldisplay = 0;
?>
- |
+ |
* Copyright (C) 2024-2025 Frédéric France
* Copyright (C) 2025 Lenin Rivas
+ * Copyright (C) 2026 MDW
*
* 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
@@ -34,20 +35,28 @@
* @var Conf $conf
* @var User $user
*
- * @var int $disableedit
- * @var int $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
- * @var int $outputalsopricetotalwithtax
- * @var int $usemargins (0 to disable all margins columns, 1 to show according to margin setup)
+ * @var int<0,1> $disableedit
+ * @var int<0,1> $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
+ * @var int<0,1> $outputalsopricetotalwithtax
+ * @var int<0,1> $usemargins (0 to disable all margins columns, 1 to show according to margin setup)
+ * @var string $action
*/
- // Protection to avoid direct call of template
+// Protection to avoid direct call of template
if (empty($object) || !is_object($object)) {
print "Error, template page can't be called as URL";
exit(1);
}
-'@phan-var-force CommonObject|Facture $this
- @phan-var-force CommonObject $object';
+'
+@phan-var-force CommonObject|Facture $this
+@phan-var-force CommonObject $object
+@phan-var-force int<0,1> $disableedit
+@phan-var-force int<0,1> $inputalsopricewithtax
+@phan-var-force int<0,1> $outputalsopricetotalwithtax
+@phan-var-force int<0,1> $usemargins
+@phan-var-force string $action
+';
print "\n";
@@ -120,7 +129,7 @@ print ''.$langs->trans('PriceUHT').'multicurrency_code && $this->multicurrency_code != $conf->currency) {
print ' | '.$langs->trans('PriceUHT');
- print ' ('.$langs->getCurrencySymbol($this->multicurrency_code).') | ';
+ print ' ('.$langs->getCurrencySymbol($this->multicurrency_code).')';
}
// Price TTC / incl tax
@@ -222,7 +231,7 @@ print ''.$langs->trans('TotalHTShort').' | ';
// Multicurrency
if (isModEnabled("multicurrency") && $this->multicurrency_code && $this->multicurrency_code != $conf->currency) {
print ''.$langs->trans('TotalHTShort');
- print ' ('.$langs->getCurrencySymbol($this->multicurrency_code).') | ';
+ print ' ('.$langs->getCurrencySymbol($this->multicurrency_code).')';
}
if ($outputalsopricetotalwithtax) {
diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php
index 828f86d63d3..884d5e6d624 100644
--- a/htdocs/core/tpl/objectline_view.tpl.php
+++ b/htdocs/core/tpl/objectline_view.tpl.php
@@ -7,7 +7,7 @@
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2017 Juanjo Menent
* Copyright (C) 2022 OpenDSI
- * Copyright (C) 2024-2025 MDW
+ * Copyright (C) 2024-2026 MDW
* Copyright (C) 2024-2026 Alexandre Spangaro
* Copyright (C) 2024-2025 Frédéric France
* Copyright (C) 2025 Lenin Rivas
@@ -52,11 +52,12 @@
* @var ?Product $product_static
* @var string $action
* @var int $i
- * @var int $forceall
+ * @var int<0,1> $forceall
* @var int $num
* @var int $senderissupplier
* @var string $text
* @var string $description
+ * @var Object $objp
* @var int $dateSelector
*/
// Protection to avoid direct call of template
@@ -128,7 +129,7 @@ $coldisplay = 0;
>
- |
+ |
multicurrency_subprice * (1 + ($line->tva_tx / 100)), 'MU'); // one tax
}
- if (empty($line->fk_remise_except)) print (isset($upinctax) ? price($sign * $upinctax) : price($sign * $line->subprice)); // if upinctax can't be known, we show subprice excl ta
+ if (empty($line->fk_remise_except)) {
+ print(isset($upinctax) ? price($sign * $upinctax) : price($sign * $line->subprice));
+ } // if upinctax can't be known, we show subprice excl ta
?> |
multicurrency_code && $this->multicu
$multicurrency_upinctax = price2num($line->multicurrency_subprice * (1 + ($line->tva_tx / 100)), 'MU'); // one tax
}
if (empty($line->fk_remise_except)) {
- print (isset($multicurrency_upinctax) ? price($sign * $multicurrency_upinctax) : price($sign * $line->multicurrency_subprice)); // if upinctax can't be known, we show subprice excl ta
+ print(isset($multicurrency_upinctax) ? price($sign * $multicurrency_upinctax) : price($sign * $line->multicurrency_subprice)); // if upinctax can't be known, we show subprice excl ta
}
?>
@@ -576,7 +579,7 @@ if ($line->special_code == 3) {
print $tooltiponpriceend;
print '';
if (isModEnabled("multicurrency") && $this->multicurrency_code && $this->multicurrency_code != $conf->currency) {
- print '';
+ print ' | ';
print $tooltiponpricemultiprice;
print price($sign * $line->multicurrency_total_ht);
print $tooltiponpriceendmultiprice;
diff --git a/htdocs/core/tpl/originproductline.tpl.php b/htdocs/core/tpl/originproductline.tpl.php
index f49d79d4593..ba3eef890ad 100644
--- a/htdocs/core/tpl/originproductline.tpl.php
+++ b/htdocs/core/tpl/originproductline.tpl.php
@@ -3,6 +3,7 @@
* Copyright (C) 2017 Charlie Benke
* Copyright (C) 2022 Gauthier VERDOL
* Copyright (C) 2024-2025 Frédéric France
+ * Copyright (C) 2026 MDW
*
* 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
@@ -20,6 +21,7 @@
/**
* @var CommonObject $this
* @var Conf $conf
+ * @var Translate $langs
* @var CommonObjectLine $line
*/
// Protection to avoid direct call of template
diff --git a/htdocs/core/tpl/subtotal_view.tpl.php b/htdocs/core/tpl/subtotal_view.tpl.php
index f448a3a570c..e4f16422324 100644
--- a/htdocs/core/tpl/subtotal_view.tpl.php
+++ b/htdocs/core/tpl/subtotal_view.tpl.php
@@ -166,7 +166,7 @@ if ($line->qty > 0) { ?>
?>
|
multicurrency_code && $this->multicurrency_code != $conf->currency) { ?>
- |
+ |
qty < 0) {
// Base colspan if there is no module activated to display line correctly
diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php
index c88c3263845..d7dac05c270 100644
--- a/htdocs/delivery/card.php
+++ b/htdocs/delivery/card.php
@@ -7,7 +7,7 @@
* Copyright (C) 2013 Florian Henry
* Copyright (C) 2015 Claudio Aschieri
* Copyright (C) 2024-2025 Frédéric France
- * Copyright (C) 2025 MDW
+ * Copyright (C) 2025-2026 MDW
*
* 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
@@ -299,6 +299,7 @@ llxHeader('', $title, 'Livraison', '', 0, 0, '', '', '', 'mod-delivery page-card
$form = new Form($db);
$formfile = new FormFile($db);
+$objectsrc = null;
if ($action == 'create') {
// Create. Seems to no be used
@@ -371,7 +372,7 @@ if ($action == 'create') {
// Thirdparty
$morehtmlref .= ' '.$expedition->thirdparty->getNomUrl(1);
// Project
- if (isModEnabled('project')) {
+ if (isModEnabled('project') && $objectsrc !== null) {
$langs->load("projects");
$morehtmlref .= ' ';
if (0) { // @phpstan-ignore-line Do not change on shipment
@@ -722,14 +723,14 @@ if ($action == 'create') {
* Linked object block (of linked shipment)
*/
- // Show links to link elements
- print '';
+ // Show links to link elements
+ print ' ';
- // List of actions on element
- include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
+ // List of actions on element
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
- //$tmparray = $form->showLinkToObjectBlock($object, null, array('order'), 1);
- $somethingshown = $form->showLinkedObjectBlock($object, '');
+ //$tmparray = $form->showLinkToObjectBlock($object, null, array('order'), 1);
+ $somethingshown = $form->showLinkedObjectBlock($object, '');
}
diff --git a/htdocs/don/admin/donation_extrafields.php b/htdocs/don/admin/donation_extrafields.php
index f6a8e0bc40d..75240e2dbc7 100644
--- a/htdocs/don/admin/donation_extrafields.php
+++ b/htdocs/don/admin/donation_extrafields.php
@@ -1,7 +1,7 @@
* Copyright (C) 2015 Juanjo Menent
- * Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024-2026 Frédéric France
*
* 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
@@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
/**
* @var Conf $conf
* @var DoliDB $db
+ * @var ExtraFields $extrafields
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
@@ -39,7 +40,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
// Load translation files required by the page
$langs->loadLangs(array('companies', 'admin', 'donations'));
-$extrafields = new ExtraFields($db);
$form = new Form($db);
// List of supported format
diff --git a/htdocs/don/admin/website.php b/htdocs/don/admin/website.php
index dfcf86178ac..644ab81421f 100644
--- a/htdocs/don/admin/website.php
+++ b/htdocs/don/admin/website.php
@@ -4,7 +4,7 @@
* Copyright (C) 2006-2012 Regis Houssin
* Copyright (C) 2011 Juanjo Menent
* Copyright (C) 2024 Alexandre Spangaro
- * Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024-2026 Frédéric France
* Copyright (C) 2025 MDW
*
* This program is free software; you can redistribute it and/or modify
@@ -50,7 +50,6 @@ $langs->loadLangs(array("admin", "donations"));
$action = GETPOST('action', 'aZ09');
// Hook to be used by external payment modules (ie Payzen, ...)
-$hookmanager = new HookManager($db);
$hookmanager->initHooks(array('newpayment'));
if (!$user->admin) {
diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php
index a2737c5e0b7..b78a93db3c5 100644
--- a/htdocs/don/class/api_donations.class.php
+++ b/htdocs/don/class/api_donations.class.php
@@ -266,7 +266,7 @@ class Donations extends DolibarrApi
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
- $this->don->array_options[$index] = $this->_checkValForAPI($field, $val, $this->don);
+ $this->don->array_options[$index] = $this->_checkValExtrafieldsForAPI($index, $val, $this->don);
}
continue;
}
diff --git a/htdocs/don/list.php b/htdocs/don/list.php
index 3c826aa16d0..b65a4da20ea 100644
--- a/htdocs/don/list.php
+++ b/htdocs/don/list.php
@@ -5,7 +5,7 @@
* Copyright (C) 2013 Cédric Salvador
* Copyright (C) 2019 Thibault FOUCART
* Copyright (C) 2024-2025 MDW
- * Copyright (C) 2024-2025 Frédéric France
+ * Copyright (C) 2024-2026 Frédéric France
*
* 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
@@ -329,21 +329,6 @@ if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $sear
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-donation page-list bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
-// Example : Adding jquery code
-// print '';
-
$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
@@ -602,10 +587,10 @@ while ($i < $imaxinloop) {
$donationstatic->setVarsFromFetchObj($obj);
- $donationstatic->id = $obj->rowid;
+ $donationstatic->id = (int) $obj->rowid;
$donationstatic->ref = ($obj->ref ? $obj->ref : $obj->rowid);
$donationstatic->date = $db->jdate($obj->datedon);
- $donationstatic->status = $obj->status;
+ $donationstatic->status = (int) $obj->status;
$donationstatic->lastname = $obj->lastname;
$donationstatic->firstname = $obj->firstname;
$object = $donationstatic;
@@ -699,7 +684,7 @@ while ($i < $imaxinloop) {
print ''.price($obj->amount).' | ';
// Status
- print ''.$donationstatic->LibStatut($obj->status, 5).' | ';
+ print ''.$donationstatic->LibStatut($donationstatic->status, 5).' | ';
// Action column
if (empty($conf->main_checkbox_left_column)) {
diff --git a/htdocs/don/paiement/list.php b/htdocs/don/paiement/list.php
index 53b95f19638..719f8efb7dc 100644
--- a/htdocs/don/paiement/list.php
+++ b/htdocs/don/paiement/list.php
@@ -5,7 +5,7 @@
* Copyright (C) 2013 Cédric Salvador
* Copyright (C) 2019 Thibault FOUCART
* Copyright (C) 2024-2025 MDW
- * Copyright (C) 2024-2025 Frédéric France
+ * Copyright (C) 2024-2026 Frédéric France
*
* 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
@@ -49,8 +49,9 @@ $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; //
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sclist';
$mode = GETPOST('mode', 'alpha');
+$toselect = GETPOST('toselect', 'array:int'); // Array of ids of elements selected into a list
-$paiementid = GETPOSTINT('paiementid');
+$paiementid = GETPOSTINT('paiementid');
$search_ref = GETPOST("search_ref", "alpha");
$search_date_startday = GETPOSTINT('search_date_startday');
@@ -270,6 +271,7 @@ $num = $db->num_rows($resql);
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
+$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
@@ -340,10 +342,10 @@ if ($search_all) {
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields
-$massactionbutton = '';
-if ($massactionbutton) {
- $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
-}
+// $massactionbutton = '';
+// if ($massactionbutton) {
+// $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
+// }
$moreforfilter = '';
print ' | | |