'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
print '
';
}
########## core/class/html.formaccounting.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/html.formaccounting.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/html.formaccounting.class.php 2025-06-27 11:43:40.177925000 +0000
@@ -666,6 +666,7 @@
public static function printJournalLine($langs, $date, $ref, $accountAccounting, $labelOperation, $paymentMode, $amount)
{
$out = '
'.$langs->trans('MailRecipients');
########## core/class/notify.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/notify.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/notify.class.php 2025-06-27 11:43:40.163934000 +0000
@@ -662,12 +662,10 @@
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
// Define some vars
- $application = constant('DOL_APPLICATION_TITLE');
- $applicationcustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
- if ($applicationcustom) {
- $application = (preg_match('/^\+/', $applicationcustom) ? $application : '').$applicationcustom;
+ $application = 'Dolibarr';
+ if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+ $application = getDolGlobalString('MAIN_APPLICATION_TITLE');
}
-
$from = getDolGlobalString('NOTIFICATION_EMAIL_FROM');
$object_type = '';
$link = '';
########## core/class/smtps.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/class/smtps.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/class/smtps.class.php 2025-06-27 11:43:40.173577000 +0000
@@ -78,11 +78,6 @@
private $_smtpsToken = null;
/**
- * @var ?string Message-ID to use
- */
- private $_msgId = null;
-
- /**
* @var ?array{org:string,real?:string,addr:string,user:string,host:string} Who sends the Message
* This can be defined via a INI file or via a setter method
*/
@@ -298,20 +293,8 @@
*/
private $_options = array();
-
- /**
- * Set Message-ID
- *
- * @param string $_msgId Message-ID to use
- * @return void
- */
- public function setMessageID($_msgId = '')
- {
- $this->_msgId = $_msgId;
- }
-
/**
- * Set options
+ * Set delivery receipt
*
* @param array> $_options An array of options for stream_context_create()
* @return void
@@ -1563,15 +1546,16 @@
$host = dol_getprefix('email');
+ //NOTE: Message-ID should probably contain the username of the user who sent the msg
$_header .= 'Subject: '.$this->getSubject()."\r\n";
$_header .= 'Date: '.date("r")."\r\n";
$trackid = $this->getTrackId();
if ($trackid) {
- $_header .= 'Message-ID: <'.(empty($this->_msgId) ? uniqid().'.SMTPs-dolibarr-'.$trackid.'@'.$host : $this->_msgId).">\r\n";
+ $_header .= 'Message-ID: <'.time().'.SMTPs-dolibarr-'.$trackid.'@'.$host.">\r\n";
$_header .= 'X-Dolibarr-TRACKID: '.$trackid.'@'.$host."\r\n";
} else {
- $_header .= 'Message-ID: <'.(empty($this->_msgId) ? uniqid().'.SMTPs@'.$host : $this->_msgId).">\r\n";
+ $_header .= 'Message-ID: <'.time().'.SMTPs@'.$host.">\r\n";
}
if (!empty($_SERVER['REMOTE_ADDR'])) {
$_header .= "X-RemoteAddr: ".$_SERVER['REMOTE_ADDR']."\r\n";
########## core/customreports.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/customreports.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/customreports.php 2025-06-27 11:43:40.346063000 +0000
@@ -1,6 +1,6 @@
- * Copyright (C) 2024-2025 MDW
+/* Copyright (C) 2020-2024 Laurent Destailleur
+ * Copyright (C) 2024-2025 MDW
* Copyright (C) 2024 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
@@ -39,10 +39,7 @@
* @var Translate $langs
* @var User $user
*
- * @var ?int[] $toselect Items selected on page, only used to see if not empty here
- * @var ?int $SHOWLEGEND Show legend or not
- * @var string $customreportkey Custom report key
- * @var string $customsql Custom SQL
+ * @var ?int[] $toselect Items selected on page, only used to see if not empty here
*/
'
@phan-var-force ?int[] $toselect
@@ -92,6 +89,8 @@
$pageprev = $page - 1;
$pagenext = $page + 1;
+ $diroutputmassaction = $conf->user->dir_temp.'/'.$user->id.'/customreport';
+
$object = null;
} else {
// When included into a main page
@@ -129,7 +128,7 @@
if (!empty($object)) {
$objecttype = $object->element.($object->module ? '@'.$object->module : '');
}
-if ((!is_string($objecttype) || empty($objecttype)) && isModEnabled('societe')) {
+if (!is_string($objecttype) || empty($objecttype)) {
$objecttype = 'thirdparty';
}
'@phan-var-force string $objecttype'; // Help phan that suggests $objecttype can be null
@@ -159,13 +158,12 @@
$ObjectClassName = '';
// Objects available by default
$arrayoftype = array(
- 'thirdparty' => array('label' => 'ThirdParties', 'picto' => 'company', 'ObjectClassName' => 'Societe', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/societe/class/societe.class.php", 'langs' => 'companies'),
+ 'thirdparty' => array('langs' => 'companies', 'label' => 'ThirdParties', 'picto' => 'company', 'ObjectClassName' => 'Societe', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/societe/class/societe.class.php"),
'contact' => array('label' => 'Contacts', 'picto' => 'contact', 'ObjectClassName' => 'Contact', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/contact/class/contact.class.php"),
- 'proposal' => array('label' => 'Proposals', 'picto' => 'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php", 'langs' => 'propal'),
- 'order' => array('label' => 'Orders', 'picto' => 'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/commande.class.php", 'langs' => 'orders'),
- 'orderdet' => array('label' => 'SaleOrderLines', 'picto' => 'order', 'ObjectClassName' => 'OrderLine', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/orderline.class.php", 'langs' => 'orders'),
- 'invoice' => array('label' => 'Invoices', 'picto' => 'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture.class.php", 'langs' => 'bills'),
- 'invoice_template' => array('label' => 'PredefinedInvoices', 'picto' => 'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture-rec.class.php", 'langs' => 'bills'),
+ 'proposal' => array('label' => 'Proposals', 'picto' => 'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php"),
+ 'order' => array('label' => 'Orders', 'picto' => 'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/commande.class.php"),
+ 'invoice' => array('langs' => 'facture', 'label' => 'Invoices', 'picto' => 'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture.class.php"),
+ 'invoice_template' => array('label' => 'PredefinedInvoices', 'picto' => 'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/class/facturerec.class.php", 'langs' => 'bills'),
'contract' => array('label' => 'Contracts', 'picto' => 'contract', 'ObjectClassName' => 'Contrat', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs' => 'contracts'),
'contractdet' => array('label' => 'ContractLines', 'picto' => 'contract', 'ObjectClassName' => 'ContratLigne', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs' => 'contracts'),
'bom' => array('label' => 'BOM', 'picto' => 'bom', 'ObjectClassName' => 'Bom', 'enabled' => isModEnabled('bom')),
@@ -211,7 +209,6 @@
if ($fileforclass !== null) {
dol_include_once($fileforclass);
-
$ObjectClassName = $arrayoftype[$objecttype]['ObjectClassName'];
}
if (!empty($ObjectClassName)) {
@@ -357,9 +354,10 @@
$features .= (empty($object->module) ? '' : '@'.$object->module);
}
-// Security check
restrictedArea($user, $features, 0, '');
+$error = 0;
+
/*
* Actions
@@ -386,7 +384,6 @@
}
}
-// Define $newarrayoftype that is array of object available for report
$newarrayoftype = array();
foreach ($arrayoftype as $key => $val) {
if (dol_eval((string) $val['enabled'], 1, 1, '1')) {
@@ -638,8 +635,7 @@
// Select object
print '';
print ' '.$langs->trans("StatisticsOn").' ';
-
- print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', 'minwidth250', 1, '', 0, 1);
+ print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', 'minwidth200', 1, '', 0, 1);
if (empty($conf->use_javascript_ajax)) {
print ' ';
} else {
@@ -655,41 +651,40 @@
}
print ' ';
- if (!empty($newarrayoftype)) {
- // Filter (you can use param &show_search_component_params_hidden=1 for debug)
- if (!empty($object)) {
- print '';
- print $form->searchComponent(array($object->element => $object->fields), $search_component_params, array(), $search_component_params_hidden, $arrayoffilterfields);
- print ' ';
- }
-
- // YAxis (add measures into array)
- $count = 0;
- //var_dump($arrayofmesures);
- print '';
- print '
';
- $simplearrayofmesures = array();
- foreach ($arrayofmesures as $key => $val) {
- $simplearrayofmesures[$key] = $arrayofmesures[$key]['label'];
- }
- print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300 widthcentpercentminusx', 1, 0, '', '', $langs->transnoentitiesnoconv("Measures")); // Fill the array $arrayofmeasures with possible fields
- print ' ';
-
- // XAxis
- $count = 0;
+ // Filter (you can use param &show_search_component_params_hidden=1 for debug)
+ if (!empty($object)) {
print '';
- print '
';
- //var_dump($arrayofxaxis);
- print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400 widthcentpercentminusx'); // Fill the array $arrayofxaxis with possible fields
+ print $form->searchComponent(array($object->element => $object->fields), $search_component_params, array(), $search_component_params_hidden, $arrayoffilterfields);
print ' ';
+ }
- // Group by
- $count = 0;
- print '';
- print '
';
- print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300 widthcentpercentminusx', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields
- print ' ';
+ // YAxis (add measures into array)
+ $count = 0;
+ //var_dump($arrayofmesures);
+ print '';
+ print '
';
+ $simplearrayofmesures = array();
+ foreach ($arrayofmesures as $key => $val) {
+ $simplearrayofmesures[$key] = $arrayofmesures[$key]['label'];
}
+ print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300 widthcentpercentminusx', 1, 0, '', '', $langs->transnoentitiesnoconv("Measures")); // Fill the array $arrayofmeasures with possible fields
+ print ' ';
+
+ // XAxis
+ $count = 0;
+ print '';
+ print '
';
+ //var_dump($arrayofxaxis);
+ print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400 widthcentpercentminusx'); // Fill the array $arrayofxaxis with possible fields
+ print ' ';
+
+ // Group by
+ $count = 0;
+ print '';
+ print '
';
+ print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300 widthcentpercentminusx', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields
+ print ' ';
+
if ($mode == 'grid') {
// YAxis
@@ -752,12 +747,13 @@
print '';
}
- if (!empty($newarrayoftype)) {
- print '';
- print '';
- print ' ';
- }
+ //if ($mode == 'graph') {
+ //
+ //}
+ print '';
+ print '';
+ print ' ';
print '';
print '';
}
@@ -1221,10 +1217,6 @@
print ''."\n";
print '';
-if (empty($newarrayoftype)) {
- $langs->load("admin");
- print info_admin($langs->trans("NoSupportedModulesHaveBeenActivated"), 0, 0, 'warning');
-}
if ($mode == 'grid') {
// TODO
########## core/js/lib_head.js.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/js/lib_head.js.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/js/lib_head.js.php 2025-06-27 11:43:40.363090000 +0000
@@ -677,11 +677,6 @@
});
if (forcereload) {
var url = window.location.href;
-
- /* reset action param */
- url = url.replace(/action=\w+/g, '');
-
- /* reset dol_resetcache param */
if (url.indexOf('dol_resetcache') < 0) {
if (url.indexOf('?') > -1) {
url = url + "&dol_resetcache=1";
@@ -689,8 +684,6 @@
url = url + "?dol_resetcache=1";
}
}
-
- /* reset page_y param */
var page_y = $(document).scrollTop();
url = url.replace(/page_y=\d+/g, '');
if (page_y > 0) {
########## core/lib/admin.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/admin.lib.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/admin.lib.php 2025-06-27 11:43:41.383895000 +0000
@@ -1575,7 +1575,7 @@
*/
function activateModulesRequiredByCountry($country_code)
{
- global $db;
+ global $db, $conf, $langs;
$modulesdir = dolGetModulesDirs();
@@ -1736,8 +1736,8 @@
/**
* Show array with constants to edit
*
- * @param array |array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label, 'tooltip'=>tooltip)
- * where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
+ * @param array|array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label)
+ * where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
* @param int<2,3> $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (deprecated), 2=No form nor button at all, 3=No form nor button at all and each field has a unique name (form is output by caller, recommended) (typed as int<2,3> to highlight the deprecated values)
* @param string $helptext Tooltip help to use for the column name of values
* @param string $text Text to use for the column name of values
########## core/lib/agenda.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/agenda.lib.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/agenda.lib.php 2025-06-27 11:43:41.385902000 +0000
@@ -104,7 +104,7 @@
// Assigned to user
print '';
print img_picto($langs->trans("ActionsToDoBy"), 'user', 'class="pictofixedwidth inline-block"');
- print $form->select_dolusers($filtert, 'search_filtert', 1, null, (int) !$canedit, '', '', '0', 0, 0, '', 2, '', 'minwidth100 maxwidth250 widthcentpercentminusx');
+ print $form->select_dolusers($filtert, 'search_filtert', 1, null, (int) !$canedit, '', '', '0', 0, 0, '', 0, '', 'minwidth100 maxwidth250 widthcentpercentminusx');
print ' ';
// Assigned to user group
########## core/lib/company.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/company.lib.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/company.lib.php 2025-06-27 11:43:41.398161000 +0000
@@ -219,7 +219,7 @@
$servicestatus = 0;
if (isModEnabled('stripe')) {
- if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha')*/) {
+ if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
$servicestatus = 1;
}
@@ -1399,10 +1399,10 @@
$param .= '&search_note_private='.urlencode($search_note_private);
}
if ($search_birthday_dtstart != '') {
- $param .= '&search_birthday_dtstart='.urlencode((string) $search_birthday_dtstart);
+ $param .= '&search_birthday_dtstart='.urlencode($search_birthday_dtstart);
}
if ($search_birthday_dtend != '') {
- $param .= '&search_birthday_dtend='.urlencode((string) $search_birthday_dtend);
+ $param .= '&search_birthday_dtend='.urlencode($search_birthday_dtend);
}
if ($optioncss != '') {
$param .= '&optioncss='.urlencode($optioncss);
@@ -1657,7 +1657,7 @@
// Photo - Name
if (!empty($arrayfields['t.name']['checked'])) {
print '';
- print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, 'user');
+ print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, '1');
print $contactstatic->getNomUrl(0, '', 0, '&backtopage='.urlencode($backtopage));
print ' | ';
}
########## core/lib/date.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/date.lib.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/date.lib.php 2025-06-27 11:43:41.295081000 +0000
@@ -1334,35 +1334,16 @@
return 'ErrorBadParameter_num_open_day';
}
+ //print 'num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday;
if ($timestampStart < $timestampEnd) {
- // --- 1. Calculate Gross Working Days ---
- // Gross working days = total days in range - non-working days (weekends & public holidays).
- $nbOpenDay = num_between_day($timestampStart, $timestampEnd, $lastday) - num_public_holiday($timestampStart, $timestampEnd, $country_code, $lastday);
+ $numdays = num_between_day($timestampStart, $timestampEnd, $lastday);
- // --- 2. Apply Contextual Half-Day Deductions ---
- $halfday = (int) $halfday; // Ensure $halfday is an integer for reliable comparisons.
-
- // Check if start/end days are working days just ONCE to optimize performance
- // by avoiding redundant calls to the potentially slow num_public_holiday() function.
- $isStartDayWorking = (num_public_holiday($timestampStart, $timestampStart, $country_code, 1) == 0);
- $isEndDayWorking = (num_public_holiday($timestampEnd, $timestampEnd, $country_code, 1) == 0);
-
- // Deduct 0.5 if the leave starts in the afternoon of a working day.
- if (($halfday == -1 || $halfday == 2) && $isStartDayWorking) {
- $nbOpenDay -= 0.5;
- }
-
- // Deduct 0.5 if the leave ends in the morning of a different, working day.
- if (($halfday == 1 || $halfday == 2) && date('Y-m-d', $timestampStart) != date('Y-m-d', $timestampEnd) && $isEndDayWorking) {
- $nbOpenDay -= 0.5;
+ $numholidays = num_public_holiday($timestampStart, $timestampEnd, $country_code, $lastday);
+ $nbOpenDay = ($numdays - $numholidays);
+ if ($inhour == 1 && $nbOpenDay <= 3) {
+ $nbOpenDay *= 24;
}
-
- // --- 3. Return Final Value ---
- if ($inhour == 1) {
- return $nbOpenDay * 24;
- }
-
- return $nbOpenDay;
+ return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday));
} elseif ($timestampStart == $timestampEnd) {
$numholidays = 0;
if ($lastday) {
########## core/lib/files.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/files.lib.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/files.lib.php 2025-06-27 11:43:41.308113000 +0000
@@ -47,8 +47,8 @@
* @param string $utf8_path Starting path from which to search. This is a full path.
* @param string $types Can be "directories", "files", or "all"
* @param int $recursive Determines whether subdirectories are searched
- * @param string|string[] $filter Regex or Array of Regex filter to restrict list. The regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function,
- * but must NOT contains the start and end '/'. Filter is checked into basename only.
+ * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function,
+ * but must not contains the start and end '/'. Filter is checked into basename only.
* @param string|string[] $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked both into fullpath and into basename (So '^xxx' may exclude 'xxx/dirscanned/...' and dirscanned/xxx').
* @param string $sortcriteria Sort criteria ('','fullname','relativename','name','date','size')
* @param int $sortorder Sort order (SORT_ASC, SORT_DESC)
@@ -66,39 +66,22 @@
global $object;
if ($recursive <= 1) { // Avoid too verbose log
+ // Verify filters (only on first call to function)
+ $filters_ok = true;
$error_info = "";
-
- // Verify filters (only on the first call of the function)
- $filter_ok = true;
- if (!is_array($filter)) {
- if (strlen($filter) > 25000) { // Note that limit depends on syntax of filter
- dol_syslog("Value for filter is too large", LOG_ERR);
- $filter_ok = false;
- } else {
- // Check that all '/' are escaped.
- if ((int) preg_match('/(?:^|[^\\\\])\//', $filter) > 0) {
- $excludefilter_ok = false;
- $error_info .= " error='filter_has_unescaped_slash'";
- dol_syslog("'$filter' has unescaped '/'", LOG_ERR);
- }
- }
- }
-
// Ensure we have an array for the exclusions
- $excludefilter_ok = true;
$exclude_array = ($excludefilter === null || $excludefilter === '') ? array() : (is_array($excludefilter) ? $excludefilter : array($excludefilter));
- foreach ($exclude_array as $f) {
+ foreach ((array($filter) + $exclude_array) as $f) {
// Check that all '/' are escaped.
if ((int) preg_match('/(?:^|[^\\\\])\//', $f) > 0) {
- $excludefilter_ok = false;
- $error_info .= " error='excludefilter_has_unescaped_slash'";
+ $filters_ok = false;
+ $error_info .= " error='$f unescaped_slash'";
dol_syslog("'$f' has unescaped '/'", LOG_ERR);
}
}
-
- dol_syslog("files.lib.php::dol_dir_list path=".$utf8_path." types=".$types." recursive=".$recursive." filter=".json_encode($filter)." excludefilter=".json_encode($excludefilter).$error_info);
- // print 'xxx'."files.lib.php::dol_dir_list path=".$utf8_path." types=".$types." recursive=".$recursive." filter=".json_encode($filter)." excludefilter=".json_encode($exclude_array);
- if (!$filter_ok || !$excludefilter_ok) {
+ dol_syslog("files.lib.php::dol_dir_list path=".$utf8_path." types=".$types." recursive=".$recursive." filter=".$filter." excludefilter=".json_encode($excludefilter).$error_info);
+ // print 'xxx'."files.lib.php::dol_dir_list path=".$utf8_path." types=".$types." recursive=".$recursive." filter=".$filter." excludefilter=".json_encode($exclude_array);
+ if (!$filters_ok) {
// Return empty array when filters are invalid
return array();
}
@@ -173,10 +156,11 @@
$utf8_file = $os_file;
}
+ $qualified = 1;
+
$utf8_fullpathfile = $utf8_path_cursor."/".$utf8_file; // Temp variable for speed
// Check if file is qualified
- $qualified = 1;
foreach ($excludefilterarray as $filt) {
if (preg_match('/'.$filt.'/i', $utf8_file) || preg_match('/'.$filt.'/i', $utf8_fullpathfile)) {
$qualified = 0;
@@ -201,28 +185,7 @@
$fileperm = dol_fileperm($utf8_fullpathfile);
}
- $qualifiedforfilter = 0;
- if (empty($filter)) {
- $qualifiedforfilter = 1;
- } else {
- $testpregmatch = false;
- if (is_array($filter)) {
- $chunks = array_chunk($filter, 500);
- foreach ($chunks as $chunk) {
- $testpregmatch = preg_match('/'.implode('|', $chunk).'/i', $utf8_file); // May failed if $filter too large
- if ($testpregmatch) {
- break;
- }
- }
- } else {
- $testpregmatch = preg_match('/'.$filter.'/i', $utf8_file); // May failed if $filter too large
- }
- if ($testpregmatch) {
- $qualifiedforfilter = 1;
- }
- }
-
- if ($qualifiedforfilter) { // We do not search key $filter into all $path, only into $file part
+ if (!$filter || preg_match('/'.$filter.'/i', $utf8_file)) { // We do not search key $filter into all $path, only into $file part
$reg = array();
preg_match('/([^\/]+)\/[^\/]+$/', $utf8_fullpathfile, $reg);
$level1name = (isset($reg[1]) ? $reg[1] : '');
@@ -256,28 +219,7 @@
$filesize = dol_filesize($utf8_fullpathfile);
}
- $qualifiedforfilter = 0;
- if (empty($filter)) {
- $qualifiedforfilter = 1;
- } else {
- $testpregmatch = false;
- if (is_array($filter)) {
- $chunks = array_chunk($filter, 500);
- foreach ($chunks as $chunk) {
- $testpregmatch = preg_match('/'.implode('|', $chunk).'/i', $utf8_file); // May failed if $filter too large
- if ($testpregmatch) {
- break;
- }
- }
- } else {
- $testpregmatch = preg_match('/'.$filter.'/i', $utf8_file); // May failed if $filter too large
- }
- if ($testpregmatch) {
- $qualifiedforfilter = 1;
- }
- }
-
- if ($qualifiedforfilter) { // We do not search key $filter into all $path, only into $file part
+ if (!$filter || preg_match('/'.$filter.'/i', $utf8_file)) { // We do not search key $filter into $utf8_path, only into $utf8_file
if (empty($nbsecondsold) || $filedate <= ($now - $nbsecondsold)) {
preg_match('/([^\/]+)\/[^\/]+$/', $utf8_fullpathfile, $reg);
$level1name = (isset($reg[1]) ? $reg[1] : '');
@@ -343,7 +285,7 @@
$sql .= ", description";
}
$sql .= " FROM ".MAIN_DB_PREFIX."ecm_files";
- if (!empty($object->entity)) {
+ if (!empty($object->entity) && $object->entity != $conf->entity) {
$sql .= " WHERE entity = ".((int) $object->entity);
} else {
$sql .= " WHERE entity = ".((int) $conf->entity);
@@ -390,7 +332,6 @@
"acl" => $obj->acl,
"share" => $obj->share,
"description" => ($mode ? $obj->description : '')
- // TODO Add 'content' with $mode == 2 ?
);
}
$i++;
@@ -464,7 +405,6 @@
//var_dump($relativedir);
//var_dump($filearray);
//var_dump($filearrayindatabase);
- //var_dump($object->entity);
// Complete filearray with properties found into $filearrayindatabase
foreach ($filearray as $key => $val) {
@@ -496,7 +436,6 @@
if (!preg_match('/([\\/]temp[\\/]|[\\/]thumbs|\.meta$)/', $rel_filename)) { // If not a tmp file
dol_syslog("list_of_documents We found a file called '".$filearray[$key]['name']."' not indexed into database. We add it");
-
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile = new EcmFiles($db);
@@ -513,10 +452,6 @@
$ecmfile->gen_or_uploaded = 'unknown';
$ecmfile->description = ''; // indexed content
$ecmfile->keywords = ''; // keyword content
- // When you scan file with dol_dir_list_in_database, you scan for files in entity of object (like with projects), even if you
- // are connected into another entity. So we must also create record that was not found into the entity scan, so the one of the object).
- $ecmfile->entity = empty($object->entity) ? $conf->entity : $object->entity;
-
$result = $ecmfile->create($user);
if ($result < 0) {
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
########## core/lib/ftp.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/ftp.lib.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/ftp.lib.php 2025-06-27 11:43:41.312317000 +0000
@@ -1,7 +1,7 @@
+/* Copyright (C) 2022-2023 Laurent Destailleur
* Copyright (C) 2022 Anthony Berton
- * Copyright (C) 2024 MDW
+ * Copyright (C) 2024 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
@@ -122,9 +122,9 @@
/**
* Tell if an entry is a FTP directory
*
- * @param resource|FTP\Connection $connect_id Connection handler
- * @param string $dir Directory
- * @return int 1=directory, 0=not a directory
+ * @param resource $connect_id Connection handler
+ * @param string $dir Directory
+ * @return int 1=directory, 0=not a directory
*/
function ftp_isdir($connect_id, $dir)
{
@@ -139,11 +139,13 @@
/**
* Tell if an entry is a FTP directory
*
- * @param resource|FTP\Connection $connect_id Connection handler
- * @return boolean Result of closing
+ * @param resource $connect_id Connection handler
+ * @return boolean Result of closing
*/
function dol_ftp_close($connect_id)
{
+ global $conf;
+
// Close FTP connection
if ($connect_id) {
if (!getDolGlobalString('FTP_CONNECT_WITH_SFTP')) {
@@ -156,18 +158,21 @@
/**
* Delete a FTP file
*
- * @param resource|FTP\Connection $connect_id Connection handler
- * @param string $file File
- * @param string $newsection Directory
+ * @param resource $connect_id Connection handler
+ * @param string $file File
+ * @param string $newsection $newsection
* @return bool
*/
function dol_ftp_delete($connect_id, $file, $newsection)
{
+ global $conf;
+
if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) {
$newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169
}
// Remote file
+ $filename = $file;
$remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file;
$newremotefileiso = mb_convert_encoding($remotefile, 'ISO-8859-1');
@@ -183,19 +188,22 @@
/**
* Download a FTP file
*
- * @param resource|FTP\Connection $connect_id Connection handler
- * @param string $localfile The local file path
- * @param string $file The remote file path
- * @param string $newsection Directory
+ * @param resource $connect_id Connection handler
+ * @param string $localfile The local file path
+ * @param string $file The remote file path
+ * @param string $newsection $newsection
* @return bool|resource
*/
function dol_ftp_get($connect_id, $localfile, $file, $newsection)
{
+ global $conf;
+
if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) {
$newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169
}
// Remote file
+ $filename = $file;
$remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file;
$newremotefileiso = mb_convert_encoding($remotefile, 'ISO-8859-1');
@@ -209,19 +217,22 @@
/**
* Upload a FTP file
*
- * @param resource|FTP\Connection $connect_id Connection handler
- * @param string $file File name
- * @param string $localfile The path to the local file
- * @param string $newsection Directory
+ * @param resource $connect_id Connection handler
+ * @param string $file File name
+ * @param string $localfile The path to the local file
+ * @param string $newsection $newsection
* @return bool
*/
function dol_ftp_put($connect_id, $file, $localfile, $newsection)
{
+ global $conf;
+
if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) {
$newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169
}
// Remote file
+ $filename = $file;
$remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file;
$newremotefileiso = mb_convert_encoding($remotefile, 'ISO-8859-1');
@@ -235,18 +246,21 @@
/**
* Remove FTP directory
*
- * @param resource|FTP\Connection $connect_id Connection handler
- * @param string $file File
- * @param string $newsection Directory
+ * @param resource $connect_id Connection handler
+ * @param string $file File
+ * @param string $newsection $newsection
* @return bool
*/
function dol_ftp_rmdir($connect_id, $file, $newsection)
{
+ global $conf;
+
if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) {
$newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169
}
// Remote file
+ $filename = $file;
$remotefile = $newsection.(preg_match('@[\\\/]$@', $newsection) ? '' : '/').$file;
$newremotefileiso = mb_convert_encoding($remotefile, 'ISO-8859-1');
@@ -261,13 +275,15 @@
/**
* Remove FTP directory
*
- * @param resource|FTP\Connection $connect_id Connection handler
- * @param string $newdir Dir create
- * @param string $newsection Directory
+ * @param resource $connect_id Connection handler
+ * @param string $newdir Dir create
+ * @param string $newsection $newsection
* @return bool|string
*/
function dol_ftp_mkdir($connect_id, $newdir, $newsection)
{
+ global $conf;
+
if (getDolGlobalString('FTP_CONNECT_WITH_SFTP')) {
$newsection = ssh2_sftp_realpath($connect_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169
}
########## core/lib/functions.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/functions.lib.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/functions.lib.php 2025-06-27 11:43:41.321005000 +0000
@@ -462,7 +462,7 @@
* @param string $type Type of database (mysql, pgsql...)
* @param string $host Address of database server
* @param string $user Authorized username
- * @param string $pass Password (clear)
+ * @param string $pass Password
* @param string $name Name of database
* @param int $port Port of database server
* @return DoliDB A DoliDB instance
@@ -1530,6 +1530,7 @@
dol_syslog('functions::dol_include_once Tried to load unexisting file: '.$relpath, LOG_WARNING);
return false;
}
+
if (!empty($classname) && !class_exists($classname)) {
return include $fullpath;
} else {
@@ -1995,7 +1996,7 @@
}
/**
- * Returns text slugified (lowercase and no special char, separator is "-").
+ * Returns text slugified (no special char, separator is "-".
*
* @param string $stringtoslugify String to slugify
* @return string Slugified string
@@ -4816,7 +4817,7 @@
if ($trusted) { // Return only IP we can rely on (not spoofable by the client)
$ip = (empty($_SERVER['REMOTE_ADDR']) ? '' : $_SERVER['REMOTE_ADDR']); // value may be the IP of a proxy
// Note that if apache module remoteip has been enabled, REMOTE_ADDR can contain the real client (the value from cloudFlare HTTP_CF_CONNECTING_IP for example)
- // This can happen if the proxy were added in the list of trusted proxy.
+ // if the proxy were added in the list of trusted proxy.
return $ip;
}
@@ -6513,7 +6514,7 @@
* @param int<0,2> $thead 0=To use with standard table format, 1=To use inside , 2=To use with
* @param string $file Url used when we click on sort picto
* @param string $field Field to use for new sorting. Empty if this field is not sortable. Example "t.abc" or "t.abc,t.def"
- * @param string $begin ("" by default)
+ * @param string $begin ("" by default)
* @param string $moreparam Add more parameters on sort url links ("" by default)
* @param string $moreattrib Add more attributes on th ("" by default). To add more css class, use param $prefix.
* @param ?string $sortfield Current field used to sort (Ex: 'd.datep,d.id')
@@ -6587,8 +6588,8 @@
}
}
$sortordertouseinlink = preg_replace('/,$/', '', $sortordertouseinlink);
- $out .= ' global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE) ? ' title="'.dol_escape_htmltag($langs->trans($name)).'"' : '');
$out .= '>';
}
if ($tooltip) {
@@ -6616,12 +6617,17 @@
}
if (!$sortorder || ($field1 != $sortfield1)) {
- // Nothing
+ //$out.= ''.img_down("A-Z",0).'';
+ //$out.= ' '.img_up("Z-A",0).'';
} else {
if (preg_match('/^DESC/', $sortorder)) {
+ //$out.= ' '.img_down("A-Z",0).'';
+ //$out.= ' '.img_up("Z-A",1).'';
$sortimg .= ' '.img_up("Z-A", 0, 'paddingright').'';
}
if (preg_match('/^ASC/', $sortorder)) {
+ //$out.= ' '.img_down("A-Z",1).'';
+ //$out.= ' '.img_up("Z-A",0).'';
$sortimg .= ' '.img_down("A-Z", 0, 'paddingright').'';
}
}
@@ -7052,7 +7058,7 @@
* Function to format a value into an amount for visual output
* Function used into PDF and HTML pages
*
- * @param int|float|string|null $amount Amount value to format
+ * @param string|float $amount Amount value to format
* @param int<0,1> $form Type of formatting: 1=HTML, 0=no formatting (no by default)
* @param Translate|string|null $outlangs Object langs for output. '' use default lang. 'none' use international separators.
* @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accuracy) before being inserted into database or after a computation, so this parameter should be useless.
@@ -7172,7 +7178,7 @@
* Function to use on each input amount before any numeric test or database insert. A better name for this function
* should be roundtext2num().
*
- * @param int|float|string|null $amount Amount to convert/clean or round
+ * @param string|float $amount Amount to convert/clean or round
* @param ''|'MU'|'MT'|'MS'|'CU'|'CT'|int<0,max> $rounding ''=No rounding
* 'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT)
* 'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT)
@@ -7260,7 +7266,6 @@
// - `[^,]*,`: Any sequence of characters that is not ',' with ',' accepted as the decimal point (from start of string because of earlier `^`);
// - `[^.]*\.`: Any sequence of characters that is not a '.' with '.' accepted as the decimal point (from start of string.
// - `(? [^.,]*)`: The sequence after the character accepted as the decimal point, not including it.
- $matches = array();
if (preg_match('/^(?[^,]*,|[^.]*\.)(?[^.,]*)$/u', $amount, $matches)) {
$intPart = $matches['int'];
$decPart = $matches['dec'];
@@ -7285,15 +7290,15 @@
if ($rounding) {
$nbofdectoround = '';
if ($rounding == 'MU') {
- $nbofdectoround = getDolGlobalInt('MAIN_MAX_DECIMALS_UNIT'); // usually 5
+ $nbofdectoround = getDolGlobalString('MAIN_MAX_DECIMALS_UNIT');
} elseif ($rounding == 'MT') {
- $nbofdectoround = getDolGlobalInt('MAIN_MAX_DECIMALS_TOT'); // usually 2 or 3
+ $nbofdectoround = getDolGlobalString('MAIN_MAX_DECIMALS_TOT');
} elseif ($rounding == 'MS') {
- $nbofdectoround = isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? getDolGlobalInt('MAIN_MAX_DECIMALS_STOCK') : 5;
+ $nbofdectoround = isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? $conf->global->MAIN_MAX_DECIMALS_STOCK : 5;
} elseif ($rounding == 'CU') {
- $nbofdectoround = getDolGlobalInt('MAIN_MAX_DECIMALS_CURRENCY_UNIT', getDolGlobalInt('MAIN_MAX_DECIMALS_UNIT')); // TODO Use param of currency
+ $nbofdectoround = max(getDolGlobalString('MAIN_MAX_DECIMALS_UNIT'), 8); // TODO Use param of currency
} elseif ($rounding == 'CT') {
- $nbofdectoround = getDolGlobalInt('MAIN_MAX_DECIMALS_CURRENCY_TOT', getDolGlobalInt('MAIN_MAX_DECIMALS_TOT')); // TODO Use param of currency
+ $nbofdectoround = max(getDolGlobalString('MAIN_MAX_DECIMALS_TOT'), 8); // TODO Use param of currency
} elseif (is_numeric($rounding)) {
$nbofdectoround = (int) $rounding;
}
@@ -8530,21 +8535,14 @@
{
if (is_null($allowed_attributes)) {
$allowed_attributes = array(
- "allow", "allowfullscreen", "alt", "async", "class", "contenteditable", "crossorigin", "data-html", "frameborder", "height", "href", "id", "name", "property", "rel", "src", "style", "target", "title", "type", "width",
+ "allow", "allowfullscreen", "alt", "async", "class", "content", "contenteditable", "crossorigin", "data-html", "frameborder", "height", "href", "id", "name", "property", "rel", "src", "style", "target", "title", "type", "width",
// HTML5
"header", "footer", "nav", "section", "menu", "menuitem"
);
}
- // Always add content and http-equiv for meta tags, required to force encoding and keep html content in utf8 by load/saveHTML functions.
- if (!in_array("content", $allowed_attributes)) {
- $allowed_attributes[] = "content";
- }
- if (!in_array("http-equiv", $allowed_attributes)) {
- $allowed_attributes[] = "http-equiv";
- }
if (class_exists('DOMDocument') && !empty($stringtoclean)) {
- $stringtoclean = ''.$stringtoclean.'';
+ $stringtoclean = ''.$stringtoclean.'';
// Warning: loadHTML does not support HTML5 on old libxml versions.
$dom = new DOMDocument('', 'UTF-8');
@@ -8595,15 +8593,12 @@
}
}
- $dom->encoding = 'UTF-8';
-
$return = $dom->saveHTML(); // This may add a LF at end of lines, so we will trim later
//$return = 'aaaabbssdd '."\naaa aabb ";
$return = preg_replace('/^'.preg_quote('', '/').'/', '', $return);
- $return = preg_replace('/^'.preg_quote('<', '/').'[^<>]*'.preg_quote('>', '/').'/', '', $return);
- $return = preg_replace('/'.preg_quote('', '/').'$/', '', trim($return));
-
+ $return = preg_replace('/^'.preg_quote('', '/').'/', '', $return);
+ $return = preg_replace('/'.preg_quote('', '/').'$/', '', $return);
return trim($return);
} else {
return $stringtoclean;
@@ -8775,24 +8770,17 @@
// like 'abc' that wrongly ends up, without the trick, with 'abc '
if (dol_textishtml($out)) {
- $out = ''.$out.' ';
+ $out = ''.$out.' ';
} else {
- $out = ''.dol_nl2br($out).' ';
+ $out = ''.dol_nl2br($out).' ';
}
$dom->loadHTML($out, LIBXML_HTML_NODEFDTD | LIBXML_ERR_NONE | LIBXML_HTML_NOIMPLIED | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_NOERROR | LIBXML_NOXMLDECL);
-
- $dom->encoding = 'UTF-8';
-
$out = trim($dom->saveHTML());
- // Remove the trick added to solve pb with text in utf8 and text without parent tag
- $out = preg_replace('/^'.preg_quote('', '/').'/', '', $out);
- $out = preg_replace('/^'.preg_quote('<', '/').'[^<>]+'.preg_quote('>', '/').'/', '', $out);
- $out = preg_replace('/'.preg_quote(' ', '/').'$/', '', trim($out));
- // $out = preg_replace('/^<\?xml encoding="UTF-8">/', '', $out);
- // $out = preg_replace('/<\/div>$/', '', $out);
- // var_dump('rrrrrrrrrrrrrrrrrrrrrrrrrrrrr'.$out);
+ // Remove the trick added to solve pb with text without parent tag
+ $out = preg_replace('/^<\?xml encoding="UTF-8"> /', '', $out);
+ $out = preg_replace('/<\/div>$/', '', $out);
} catch (Exception $e) {
// If error, invalid HTML string with no way to clean it
//print $e->getMessage();
@@ -8906,7 +8894,7 @@
$out = preg_replace('/on(repeat|begin|finish|beforeinput)[a-z]*\s*=/i', '', $out);
} while ($oldstringtoclean != $out);
- // Check the limit of external links that are automatically executed in a Rich text content. We count:
+ // Check the limit of external links that are automatically executed in a Rich text content. We count:
// '  , we can only accept " 
@@ -9304,9 +9292,7 @@
$substitutionarray = array_merge($substitutionarray, array(
'__MYCOMPANY_NAME__' => $mysoc->name,
'__MYCOMPANY_EMAIL__' => $mysoc->email,
- '__MYCOMPANY_URL__' => $mysoc->url,
'__MYCOMPANY_PHONE__' => dol_print_phone($mysoc->phone, '', 0, 0, '', " ", '', '', -1),
- '__MYCOMPANY_PHONEMOBILE__' => dol_print_phone($mysoc->phone_mobile, '', 0, 0, '', " ", '', '', -1),
'__MYCOMPANY_FAX__' => dol_print_phone($mysoc->fax, '', 0, 0, '', " ", '', '', -1),
'__MYCOMPANY_PROFID1__' => $mysoc->idprof1,
'__MYCOMPANY_PROFID2__' => $mysoc->idprof2,
@@ -9442,7 +9428,6 @@
}
} else {
'@phan-var-force Adherent|Delivery $object';
- /** @var Adherent|Delivery $object */
$substitutionarray['__ID__'] = $object->id;
$substitutionarray['__REF__'] = $object->ref;
$substitutionarray['__NEWREF__'] = $object->newref;
@@ -9483,7 +9468,6 @@
if (is_object($object) && ($object->element == 'adherent' || $object->element == 'member') && $object->id > 0) {
'@phan-var-force Adherent $object';
- /** @var Adherent $object */
$birthday = (empty($object->birth) ? '' : dol_print_date($object->birth, 'day'));
$substitutionarray['__MEMBER_ID__'] = (isset($object->id) ? $object->id : '');
@@ -9582,14 +9566,12 @@
if (is_object($object) && $object->element == 'recruitmentcandidature') {
'@phan-var-force RecruitmentCandidature $object';
- /** @var RecruitmentCandidature $object */
$substitutionarray['__CANDIDATE_FULLNAME__'] = $object->getFullName($outputlangs);
$substitutionarray['__CANDIDATE_FIRSTNAME__'] = isset($object->firstname) ? $object->firstname : '';
$substitutionarray['__CANDIDATE_LASTNAME__'] = isset($object->lastname) ? $object->lastname : '';
}
if (is_object($object) && $object->element == 'conferenceorboothattendee') {
'@phan-var-force ConferenceOrBoothAttendee $object';
- /** ConferenceOrBoothAttendee $object */
$substitutionarray['__ATTENDEE_FULLNAME__'] = $object->getFullName($outputlangs);
$substitutionarray['__ATTENDEE_FIRSTNAME__'] = isset($object->firstname) ? $object->firstname : '';
$substitutionarray['__ATTENDEE_LASTNAME__'] = isset($object->lastname) ? $object->lastname : '';
@@ -9597,7 +9579,6 @@
if (is_object($object) && $object->element == 'project') {
'@phan-var-force Project $object';
- /** @var Project $object */
$substitutionarray['__PROJECT_ID__'] = $object->id;
$substitutionarray['__PROJECT_REF__'] = $object->ref;
$substitutionarray['__PROJECT_NAME__'] = $object->title;
@@ -9631,26 +9612,22 @@
if (is_object($object) && $object->element == 'facture') {
'@phan-var-force Facture $object';
- /** @var Facture $object */
$substitutionarray['__INVOICE_SITUATION_NUMBER__'] = isset($object->situation_counter) ? $object->situation_counter : '';
}
if (is_object($object) && $object->element == 'shipping') {
'@phan-var-force Expedition $object';
- /** @var Expedition $object */
$substitutionarray['__SHIPPINGTRACKNUM__'] = $object->tracking_number;
$substitutionarray['__SHIPPINGTRACKNUMURL__'] = $object->tracking_url;
$substitutionarray['__SHIPPINGMETHOD__'] = $object->shipping_method;
}
if (is_object($object) && $object->element == 'reception') {
'@phan-var-force Reception $object';
- /** @var Reception $object */
$substitutionarray['__RECEPTIONTRACKNUM__'] = $object->tracking_number;
$substitutionarray['__RECEPTIONTRACKNUMURL__'] = $object->tracking_url;
}
if (is_object($object) && $object->element == 'contrat' && $object->id > 0 && is_array($object->lines)) {
'@phan-var-force Contrat $object';
- /** @var Contrat $object */
$dateplannedstart = '';
$datenextexpiration = '';
foreach ($object->lines as $line) {
@@ -9672,7 +9649,6 @@
// add substitution variables for ticket
if (is_object($object) && $object->element == 'ticket') {
'@phan-var-force Ticket $object';
- /** @var Ticket $object */
$substitutionarray['__TICKET_TRACKID__'] = $object->track_id;
$substitutionarray['__TICKET_SUBJECT__'] = $object->subject;
$substitutionarray['__TICKET_TYPE__'] = $object->type_code;
@@ -9803,55 +9779,46 @@
if (is_object($object) && $object->element == 'propal') {
'@phan-var-force Propal $object';
- /** @var Propal $object */
$substitutionarray['__URL_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/comm/propal/card.php?id=".$object->id;
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
$substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'proposal', $object->ref, 1, $object);
}
if (is_object($object) && $object->element == 'commande') {
'@phan-var-force Commande $object';
- /** @var Commande $object */
$substitutionarray['__URL_ORDER__'] = DOL_MAIN_URL_ROOT."/commande/card.php?id=".$object->id;
}
if (is_object($object) && $object->element == 'facture') {
'@phan-var-force Facture $object';
- /** @var Facture $object */
$substitutionarray['__URL_INVOICE__'] = DOL_MAIN_URL_ROOT."/compta/facture/card.php?id=".$object->id;
}
if (is_object($object) && $object->element == 'contrat') {
'@phan-var-force Contrat $object';
- /** @var Contrat $object */
$substitutionarray['__URL_CONTRACT__'] = DOL_MAIN_URL_ROOT."/contrat/card.php?id=".$object->id;
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
$substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'contract', $object->ref, 1, $object);
}
if (is_object($object) && $object->element == 'fichinter') {
'@phan-var-force Fichinter $object';
- /** @var Fichinter $object */
$substitutionarray['__URL_FICHINTER__'] = DOL_MAIN_URL_ROOT."/fichinter/card.php?id=".$object->id;
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
$substitutionarray['__ONLINE_SIGN_FICHINTER_URL__'] = getOnlineSignatureUrl(0, 'fichinter', $object->ref, 1, $object);
}
if (is_object($object) && $object->element == 'supplier_proposal') {
'@phan-var-force SupplierProposal $object';
- /** @var SupplierProposal $object */
$substitutionarray['__URL_SUPPLIER_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/supplier_proposal/card.php?id=".$object->id;
}
if (is_object($object) && $object->element == 'invoice_supplier') {
'@phan-var-force FactureFournisseur $object';
- /** @var FactureFournisseur $object */
$substitutionarray['__URL_SUPPLIER_INVOICE__'] = DOL_MAIN_URL_ROOT."/fourn/facture/card.php?id=".$object->id;
}
if (is_object($object) && $object->element == 'shipping') {
'@phan-var-force Expedition $object';
- /** @var Expedition $object */
$substitutionarray['__URL_SHIPMENT__'] = DOL_MAIN_URL_ROOT."/expedition/card.php?id=".$object->id;
}
}
if (is_object($object) && $object->element == 'action') {
'@phan-var-force ActionComm $object';
- /** @var ActionComm $object */
$substitutionarray['__EVENT_LABEL__'] = $object->label;
$substitutionarray['__EVENT_TYPE__'] = $outputlangs->trans("Action".$object->type_code);
$substitutionarray['__EVENT_DATE__'] = dol_print_date($object->datep, 'day', 'auto', $outputlangs);
@@ -9861,7 +9828,6 @@
}
if ((empty($exclude) || !in_array('objectamount', $exclude)) && (empty($include) || in_array('objectamount', $include))) {
'@phan-var-force Facture|FactureRec $object';
- /** @var Facture|FactureRec|null $object */
include_once DOL_DOCUMENT_ROOT.'/core/lib/functionsnumtoword.lib.php';
$substitutionarray['__DATE_YMD__'] = is_object($object) ? (isset($object->date) ? dol_print_date($object->date, 'day', false, $outputlangs) : null) : '';
@@ -9960,8 +9926,6 @@
'__MONTH_TEXT_SHORT__' => $outputlangs->trans('MonthShort'.sprintf("%02d", $tmp['mon'])),
'__MONTH_TEXT_MIN__' => $outputlangs->trans('MonthVeryShort'.sprintf("%02d", $tmp['mon'])),
'__YEAR__' => (string) $tmp['year'],
- '__YEAR_PREVIOUS_MONTH__' => (string) $tmp3['year'],
- '__YEAR_NEXT_MONTH__' => (string) $tmp5['year'],
'__PREVIOUS_DAY__' => (string) $tmp2['day'],
'__PREVIOUS_MONTH__' => (string) $tmp3['month'],
'__PREVIOUS_MONTH_TEXT__' => $outputlangs->trans('Month'.sprintf("%02d", $tmp3['month'])),
@@ -10908,14 +10872,14 @@
/**
* Replace eval function to add more security.
- * This function is called by verifCond() for example.
+ * This function is called by verifCond() or trans() and transnoentitiesnoconv().
*
* @param string $s String to evaluate
* @param int<0,1> $returnvalue 0=No return (deprecated, used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)).
* @param int<0,1> $hideerrors 1=Hide errors
- * @param string $onlysimplestring '0' (deprecated, do not use it anymore) = Accept all chars,
- * '1' (most common use) = Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';',
- * '2' (used for example for the compute property of extrafields) = Accept also '<[]'
+ * @param string $onlysimplestring '0' (deprecated, do not use it anymore)=Accept all chars,
+ * '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';',
+ * '2' (used for example for the compute property of extrafields)=Accept also '<[]'
* @return string Return result of eval (even if type can be int, it is safer to assume string and find all potential typing issues as abs(dol_eval(...)).
* @see verifCond(), checkPHPCode() to see sanitizing rules that should be very close.
* @phan-suppress PhanPluginUnsafeEval
@@ -11282,26 +11246,14 @@
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_GLOBAL', '_POST', '_REQUEST', 'ReflectionFunction'));
// We list all forbidden function as keywords we don't want to see (we don't mind it if is "kewyord(" or just "keyword", we don't want "keyword" at all)
- // We must exclude all functions that allow to execute another function. This includes all function that has a parameter with type "callable" to avoid things
- // like we can do with array_map and its callable parameter: dol_eval('json_encode(array_map(implode("",["ex","ec"]), ["id"]))', 1, 1, '0')
$forbiddenphpfunctions = array();
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("override_function", "session_id", "session_create_id", "session_regenerate_id"));
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("get_defined_functions", "get_defined_vars", "get_defined_constants", "get_declared_classes"));
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func", "call_user_func_array"));
-
- $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("array_all", "array_any", "array_diff_ukey", "array_filter", "array_find", "array_find_key", "array_map", "array_reduce", "array_intersect_uassoc", "array_intersect_ukey", "array_walk", "array_walk_recursive"));
- $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("usort", "uasort", "uksort", "preg_replace_callback", "preg_replace_callback_array", "header_register_callback"));
- $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("set_error_handler", "set_exception_handler", "libxml_set_external_entity_loader", "register_shutdown_function", "register_tick_function", "unregister_tick_function"));
- $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("spl_autoload_register", "spl_autoload_unregister", "iterator_apply", "session_set_save_handler"));
- $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("forward_static_call", "forward_static_call_array", "register_postsend_function"));
-
- $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("ob_start"));
-
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once"));
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("exec", "passthru", "shell_exec", "system", "proc_open", "popen"));
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_eval", "dol_eval_new", "dol_eval_standard", "dol_concatdesc", "executeCLI", "verifCond", "GETPOST")); // native dolibarr functions
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities
- $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("readline_completion_function", "readline_callback_handler_install"));
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_compress_dir", "dol_decode", "dol_delete_file", "dol_delete_dir", "dol_delete_dir_recursive", "dol_copy", "archiveOrBackupFile")); // more dolibarr functions
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask"));
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include"));
########## core/lib/geturl.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/geturl.lib.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/geturl.lib.php 2025-06-27 11:43:41.365699000 +0000
@@ -66,7 +66,7 @@
print $nvpStr;
exit;*/
curl_setopt($ch, CURLOPT_VERBOSE, 1);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Dolibarr geturl function'); // set the Dolibarr user agent name
+ curl_setopt($ch, CURLOPT_USERAGENT, 'Dolibarr geturl function');
// We use @ here because this may return warning if safe mode is on or open_basedir is on (following location is forbidden when safe mode is on).
// We force value to false so we will manage redirection ourself later.
@@ -178,7 +178,7 @@
do {
if ($maxRedirection < 1) {
- return array('http_code' => 400, 'content' => 'Maximum number of redirections reached', 'curl_error_no' => 1, 'curl_error_msg' => 'Maximum number of redirections reached');
+ break;
}
curl_setopt($ch, CURLOPT_URL, $newUrl);
@@ -192,7 +192,7 @@
if (in_array($hosttocheck, array('metadata.google.internal'))) {
$info['http_code'] = 400;
$info['content'] = 'Error bad hostname '.$hosttocheck.' (Used by Google metadata). This value for hostname is not allowed.';
- return array('http_code' => 400, 'content' => $info['content'], 'curl_error_no' => 1, 'curl_error_msg' => $info['content']);
+ break;
}
// Clean host name $hosttocheck to convert it into an IP $iptocheck
@@ -220,7 +220,7 @@
if ($tmpresult) {
$info['http_code'] = 400;
$info['content'] = $tmpresult;
- return array('http_code' => 400, 'content' => $tmpresult, 'curl_error_no' => 1, 'curl_error_msg' => $tmpresult);
+ break;
}
}
@@ -371,10 +371,9 @@
/**
* Function get second level domain name.
- * For example: https://www.abc.mydomain.com/dir/page.html returns 'mydomain' with mode 0, 'mydomain.om' with mode 1, 'abc.mydomain.com' with mode 2.
- * For example: part1@mydomain.com returns 'mydomain.com' with mode 1
+ * For example: https://www.abc.mydomain.com/dir/page.html return 'mydomain'
*
- * @param string $url Full URL or Email.
+ * @param string $url Full URL.
* @param int $mode 0=return 'mydomain', 1=return 'mydomain.com', 2=return 'abc.mydomain.com'
* @return string Returns domaine name
*/
@@ -399,10 +398,8 @@
$mode++;
}
- $tmpdomain = preg_replace('/^https?:\/\/[^:]+:[^@]+@/i', '', $url); // Remove http(s)://login@pass in https://login@pass:mydomain.com/path, so we now got mydomain.com/path
- $tmpdomain = preg_replace('/^https?:\/\//i', '', $tmpdomain); // Remove http(s)://
- $tmpdomain = preg_replace('/\/.*$/i', '', $tmpdomain); // Remove part after /
- $tmpdomain = preg_replace('/^[^@]+@/i', '', $tmpdomain); // Remove part1@ in part1@part2 (for emails)
+ $tmpdomain = preg_replace('/^https?:\/\//i', '', $url); // Remove http(s)://
+ $tmpdomain = preg_replace('/\/.*$/i', '', $tmpdomain); // Remove part after /
if ($mode == 3) {
$tmpdomain = preg_replace('/^.*\.([^\.]+)\.([^\.]+)\.([^\.]+)\.([^\.]+)$/', '\1.\2.\3.\4', $tmpdomain);
} elseif ($mode == 2) {
########## core/lib/pdf.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/pdf.lib.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/pdf.lib.php 2025-06-27 11:43:41.344170000 +0000
@@ -1873,9 +1873,7 @@
if ($detail->batch) {
$dte[] = $outputlangs->transnoentitiesnoconv('printBatch', $detail->batch);
}
- if ($detail->qty) {
- $dte[] = $outputlangs->transnoentitiesnoconv('printQty', (string) $detail->qty);
- }
+ $dte[] = $outputlangs->transnoentitiesnoconv('printQty', (string) $detail->qty);
// Add also info of planned warehouse for lot
if ($object->element == 'shipping' && $detail->fk_origin_stock > 0 && getDolGlobalInt('PRODUCTBATCH_SHOW_WAREHOUSE_ON_SHIPMENT')) {
@@ -2590,7 +2588,7 @@
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DatePropal");
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date, 'day', '', $outputlangs);
}
- } elseif ($objecttype == 'commande' || $objecttype == 'supplier_order' || $objecttype == 'order_supplier') {
+ } elseif ($objecttype == 'commande' || $objecttype == 'supplier_order') {
'@phan-var-force array $objects';
$outputlangs->load('orders');
@@ -2749,17 +2747,15 @@
}
/**
- * Return line total amount discount.
- * Calculated by taking the unit price (subprice) * quantity - (total without tax)
+ * Return line total amount discount
*
* @param Commande|Facture|Propal $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
- * @param int<0,1> $multicurrency 1=Get value in the foreign currency
* @return int|float|string Return total of line excl tax
*/
-function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = 0, $multicurrency = 0)
+function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = 0)
{
global $hookmanager;
@@ -2781,8 +2777,7 @@
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
- 'special_code' => $special_code,
- 'multicurrency' => $multicurrency
+ 'special_code' => $special_code
);
$action = '';
@@ -2797,11 +2792,7 @@
}
if (empty($hidedetails) || $hidedetails > 1) {
- if (empty($multicurrency)) {
- return (float) price2num($sign * (($object->lines[$i]->subprice * (float) $object->lines[$i]->qty) - $object->lines[$i]->total_ht), 'MT', 1);
- } else {
- return (float) price2num($sign * (($object->lines[$i]->multicurrency_subprice * (float) $object->lines[$i]->qty) - $object->lines[$i]->multicurrency_total_ht), 'MT', 1);
- }
+ return (float) price2num($sign * (($object->lines[$i]->subprice * (float) $object->lines[$i]->qty) - $object->lines[$i]->total_ht), 'MT', 1);
}
}
return 0;
########## core/lib/security.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/security.lib.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/security.lib.php 2025-06-27 11:43:41.245124000 +0000
@@ -178,7 +178,7 @@
* Note: If a backup is restored onto another instance with a different $conf->file->instance_unique_id, then decoded value will differ.
*
* @param string $chain string to decode
- * @param string $key If '', we use $conf->file->dolcrypt_key else $conf->file->instance_unique_id
+ * @param string $key If '', we use $conf->file->instance_unique_id
* @return string encoded string
* @since v17
* @see dolEncrypt(), dol_hash()
########## core/lib/security2.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/security2.lib.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/security2.lib.php 2025-06-27 11:43:41.247029000 +0000
@@ -152,14 +152,8 @@
// Title
$appli = constant('DOL_APPLICATION_TITLE');
$title = $appli.(getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '' : ' '.constant('DOL_VERSION'));
-
- $customapplication = getDolGlobalString('MAIN_APPLICATION_TITLE');
- if ($customapplication) {
- if (preg_match('/^\+/', $customapplication)) {
- $title .= $customapplication;
- } else {
- $title = $customapplication;
- }
+ if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+ $title = getDolGlobalString('MAIN_APPLICATION_TITLE');
}
$titletruedolibarrversion = constant('DOL_VERSION'); // $title used by login template after the @ to inform of true Dolibarr version
########## core/lib/website.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/lib/website.lib.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/lib/website.lib.php 2025-06-27 11:43:41.353025000 +0000
@@ -1512,14 +1512,9 @@
dol_mkdir(dirname($filetosave));
$fp = fopen($filetosave, "w");
- if ($fp) {
- fwrite($fp, $tmpgeturl['content']);
- fclose($fp);
- dolChmod($filetosave);
- } else {
- setEventMessages('Error failed to open file '.$filetosave.' for writing', null, 'errors');
- //print 'Failed to open file '.$filetosave.' for writing.';
- }
+ fwrite($fp, $tmpgeturl['content']);
+ fclose($fp);
+ dolChmod($filetosave);
}
}
}
########## core/login/functions_openid_connect.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/login/functions_openid_connect.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/login/functions_openid_connect.php 2025-06-27 11:43:40.379661000 +0000
@@ -121,7 +121,7 @@
return false;
}
- // Step 3: retrieve user info (login, email, ...) from OIDC server using token
+ // Step 3: retrieve user info using token
$userinfo_headers = array('Authorization: Bearer '.$token_content->access_token);
$userinfo_response = getURLContent(getDolGlobalString('MAIN_AUTHENTICATION_OIDC_USERINFO_URL'), 'GET', '', 1, $userinfo_headers, array('https'), 2);
$userinfo_content = json_decode($userinfo_response['content']);
@@ -159,12 +159,7 @@
// Success: retrieve claim to return to Dolibarr as login
$sql = 'SELECT login, entity, datestartvalidity, dateendvalidity';
$sql .= ' FROM '.MAIN_DB_PREFIX.'user';
- if ($login_claim === 'email') {
- // If login claim is email, check both login and email fields
- $sql .= " WHERE (login = '".$db->escape($userinfo_content->$login_claim)."' OR email = '".$db->escape($userinfo_content->$login_claim)."')";
- } else {
- $sql .= " WHERE login = '".$db->escape($userinfo_content->$login_claim)."'";
- }
+ $sql .= " WHERE login = '".$db->escape($userinfo_content->$login_claim)."'";
$sql .= ' AND entity IN (0,'.(array_key_exists('dol_entity', $_SESSION) ? ((int) $_SESSION["dol_entity"]) : 1).')';
dol_syslog("functions_openid::check_user_password_openid", LOG_DEBUG);
@@ -174,11 +169,6 @@
dol_syslog("functions_openid_connect::check_user_password_openid_connect::Error with sql query (".$db->error().")");
return false;
}
- $numres = $db->num_rows($resql);
- if ($numres > 1) {
- dol_syslog("functions_openid_connect::check_user_password_openid_connect::Error more than 1 result from the query");
- return false;
- }
$obj = $db->fetch_object($resql);
if (!$obj) {
dol_syslog("functions_openid_connect::check_user_password_openid_connect::Error no result from the query");
########## core/modules/accountancy/doc/pdf_balance.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/accountancy/doc/pdf_balance.modules.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/accountancy/doc/pdf_balance.modules.php 2025-06-27 11:43:40.564998000 +0000
@@ -502,7 +502,7 @@
$curY,
$nexY,
$default_font_size,
- $langs->transnoentities('GrandTotals'),
+ $langs->trans('GrandTotals'),
$tab_top_newpage,
$totalDebit,
$totalCredit,
########## core/modules/accountancy/doc/pdf_bookkeeping.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/accountancy/doc/pdf_bookkeeping.modules.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/accountancy/doc/pdf_bookkeeping.modules.php 2025-06-27 11:43:40.562967000 +0000
@@ -511,7 +511,7 @@
$curY,
$nexY,
$default_font_size,
- $langs->transnoentities('GrandTotals'),
+ $langs->trans('GrandTotals'),
$tab_top_newpage,
$totalDebit,
$totalCredit,
########## core/modules/accountancy/doc/pdf_ledger.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/accountancy/doc/pdf_ledger.modules.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/accountancy/doc/pdf_ledger.modules.php 2025-06-27 11:43:40.567274000 +0000
@@ -512,7 +512,7 @@
$curY,
$nexY,
$default_font_size,
- $langs->transnoentities('GrandTotals'),
+ $langs->trans('GrandTotals'),
$tab_top_newpage,
$totalDebit,
$totalCredit,
########## core/modules/asset/mod_asset_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/asset/mod_asset_standard.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/asset/mod_asset_standard.php 2025-06-27 11:43:40.698985000 +0000
@@ -98,7 +98,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
@@ -137,7 +137,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
########## core/modules/commande/doc/pdf_einstein.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/commande/doc/pdf_einstein.modules.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/commande/doc/pdf_einstein.modules.php 2025-06-27 11:43:40.648800000 +0000
@@ -937,41 +937,31 @@
// Get Total HT
$total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
- // Total discount
- $total_discount_on_lines = 0;
- $multicurrency_total_discount_on_lines = 0;
+ // Total remise
+ $total_line_remise = 0;
foreach ($object->lines as $i => $line) {
$resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2);
- $multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1);
-
- $total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0);
- $multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0);
- // If line was a negative line, we do not count the discount as a discount
+ $total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0);
+ // Gestion remise sous forme de ligne négative
if ($line->total_ht < 0) {
- $total_discount_on_lines += -$line->total_ht;
- $multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht;
+ $total_line_remise += -$line->total_ht;
}
}
+ if ($total_line_remise > 0) {
+ $pdf->SetFillColor(255, 255, 255);
+ $pdf->SetXY($col1x, $tab2_top + $tab2_hl);
+ $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
+ $pdf->SetXY($col2x, $tab2_top + $tab2_hl);
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true);
+
+ $index++;
- if ($total_discount_on_lines > 0) {
// Show total NET before discount
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true);
$pdf->SetXY($col2x, $tab2_top);
-
- $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines));
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true);
-
- $index++;
-
- $pdf->SetFillColor(255, 255, 255);
- $pdf->SetXY($col1x, $tab2_top + $tab2_hl);
- $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
- $pdf->SetXY($col2x, $tab2_top + $tab2_hl);
-
- $total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines);
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true);
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true);
$index++;
}
@@ -981,7 +971,7 @@
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', true);
- $total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', true);
@@ -1170,7 +1160,7 @@
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true);
- $total_localtax = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
+ $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true);
########## core/modules/commande/doc/pdf_eratosthene.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php 2025-06-27 11:43:40.642905000 +0000
@@ -1214,41 +1214,33 @@
// Get Total HT
$total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
- // Total discount
- $total_discount_on_lines = 0;
- $multicurrency_total_discount_on_lines = 0;
+ // Total remise
+ $total_line_remise = 0;
foreach ($object->lines as $i => $line) {
$resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2);
- $multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1);
-
- $total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0);
- $multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0);
- // If line was a negative line, we do not count the discount as a discount
+ $total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0);
+ // Gestion remise sous forme de ligne négative
if ($line->total_ht < 0) {
- $total_discount_on_lines += -$line->total_ht;
- $multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht;
+ $total_line_remise += -$line->total_ht;
}
}
+ $total_line_remise = (float) price2num($total_line_remise, 'MT', 1);
- if ($total_discount_on_lines > 0) {
- // Show total NET before discount
- $pdf->SetFillColor(255, 255, 255);
- $pdf->SetXY($col1x, $tab2_top);
- $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true);
- $pdf->SetXY($col2x, $tab2_top);
-
- $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines));
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true);
-
- $index++;
-
+ if ($total_line_remise > 0) {
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + $tab2_hl);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true);
- $total_discount_to_show = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines);
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true);
+ $index++;
+
+ // Show total NET before discount
+ $pdf->SetFillColor(255, 255, 255);
+ $pdf->SetXY($col1x, $tab2_top);
+ $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true);
+ $pdf->SetXY($col2x, $tab2_top);
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true);
$index++;
}
@@ -1257,7 +1249,7 @@
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', true);
- $total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', true);
@@ -1265,7 +1257,6 @@
$pdf->SetFillColor(248, 248, 248);
$total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
- $total_ttc_origin = $object->total_ttc;
$this->atleastoneratenotnull = 0;
if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) {
@@ -1300,7 +1291,7 @@
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true);
- $total_localtax = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
+ $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true);
@@ -1459,21 +1450,7 @@
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalTTC", $mysoc->country_code) : ''), $useborder, 'L', true);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
- if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) {
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true);
- } else {
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true);
-
- //$pdf->writeHTMLCell($largcol2, $tab2_hl, null, null, '('.price($sign * $object->total_ttc, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).') '.price($sign * $total_ttc, 0, $outputlangs), $useborder, 1, true, true, 'R');
- $index++;
- $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
- $pdf->SetTextColor(0, 0, 60);
- $pdf->SetFillColor(224, 224, 224);
- $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true);
-
- $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true);
- }
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true);
}
}
########## core/modules/expensereport/doc/pdf_standard_expensereport.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php 2025-06-27 11:43:40.779089000 +0000
@@ -713,7 +713,7 @@
$pdf->SetFont('', 'B', $default_font_size + 4);
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
- $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posx, 6, $outputlangs->trans("ExpenseReport"), 0, 'R');
+ $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posx, 6, $langs->trans("ExpenseReport"), 0, 'R');
$pdf->SetFont('', '', $default_font_size - 1);
########## core/modules/facture/doc/pdf_crabe.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/facture/doc/pdf_crabe.modules.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/facture/doc/pdf_crabe.modules.php 2025-06-27 11:43:40.518976000 +0000
@@ -1480,41 +1480,31 @@
// Get Total HT
$total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
- // Total discount
- $total_discount_on_lines = 0;
- $multicurrency_total_discount_on_lines = 0;
+ // Total remise
+ $total_line_remise = 0;
foreach ($object->lines as $i => $line) {
$resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2);
- $multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1);
-
- $total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0);
- $multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0);
- // If line was a negative line, we do not count the discount as a discount
+ $total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0);
+ // Gestion remise sous forme de ligne négative
if ($line->total_ht < 0) {
- $total_discount_on_lines += -$line->total_ht;
- $multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht;
+ $total_line_remise += -$line->total_ht;
}
}
+ if ($total_line_remise > 0) {
+ $pdf->SetFillColor(255, 255, 255);
+ $pdf->SetXY($col1x, $tab2_top + $tab2_hl);
+ $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
+ $pdf->SetXY($col2x, $tab2_top + $tab2_hl);
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true);
+
+ $index++;
- if ($total_discount_on_lines > 0) {
// Show total NET before discount
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true);
$pdf->SetXY($col2x, $tab2_top);
-
- $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines));
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true);
-
- $index++;
-
- $pdf->SetFillColor(255, 255, 255);
- $pdf->SetXY($col1x, $tab2_top + $tab2_hl);
- $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
- $pdf->SetXY($col2x, $tab2_top + $tab2_hl);
-
- $total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines);
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true);
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true);
$index++;
}
@@ -1524,7 +1514,7 @@
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total") : ''), 0, 'L', true);
- $total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ht, 0, $outputlangs), 0, 'R', true);
########## core/modules/facture/doc/pdf_sponge.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/facture/doc/pdf_sponge.modules.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/facture/doc/pdf_sponge.modules.php 2025-06-27 11:43:40.514927000 +0000
@@ -1755,7 +1755,7 @@
}
if ($fac->type === Facture::TYPE_CREDIT_NOTE) {
- $facSign = '-';
+ $facSign = '-'; // les avoirs
}
@@ -1798,41 +1798,31 @@
// Get Total HT
$total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
- // Total discount
- $total_discount_on_lines = 0;
- $multicurrency_total_discount_on_lines = 0;
+ // Total remise
+ $total_line_remise = 0;
foreach ($object->lines as $i => $line) {
$resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2);
- $multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1);
-
- $total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0);
- $multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0);
- // If line was a negative line, we do not count the discount as a discount
+ $total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0);
+ // Gestion remise sous forme de ligne négative
if ($line->total_ht < 0) {
- $total_discount_on_lines += -$line->total_ht;
- $multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht;
+ $total_line_remise += -$line->total_ht;
}
}
+ if ($total_line_remise > 0) {
+ $pdf->SetFillColor(255, 255, 255);
+ $pdf->SetXY($col1x, $tab2_top + $tab2_hl);
+ $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
+ $pdf->SetXY($col2x, $tab2_top + $tab2_hl);
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true);
+
+ $index++;
- if ($total_discount_on_lines > 0) {
// Show total NET before discount
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true);
$pdf->SetXY($col2x, $tab2_top);
-
- $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines));
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true);
-
- $index++;
-
- $pdf->SetFillColor(255, 255, 255);
- $pdf->SetXY($col1x, $tab2_top + $tab2_hl);
- $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
- $pdf->SetXY($col2x, $tab2_top + $tab2_hl);
-
- $total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines);
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true);
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true);
$index++;
}
@@ -1842,7 +1832,7 @@
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total") : ''), 0, 'L', true);
- $total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ht, 0, $outputlangs), 0, 'R', true);
@@ -2068,7 +2058,7 @@
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true);
- $total_localtax = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
+ $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true);
@@ -2097,17 +2087,8 @@
if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) {
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', true);
} else {
- $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', true);
-
+ $pdf->MultiCell($largcol2, $tab2_hl, '('.price($sign * $total_ttc_origin, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).') '.price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', true);
//$pdf->writeHTMLCell($largcol2, $tab2_hl, null, null, '('.price($sign * $object->total_ttc, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).') '.price($sign * $total_ttc, 0, $outputlangs), $useborder, 1, true, true, 'R');
- $index++;
- $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
- $pdf->SetTextColor(0, 0, 60);
- $pdf->SetFillColor(224, 224, 224);
- $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true);
-
- $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
- $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true);
}
// Retained warranty
@@ -2169,18 +2150,11 @@
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("Paid") : ''), 0, 'L', false);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
- //if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) {
- $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false);
- //} else {
- // $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false);
- //
- // $index++;
- // $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
- // $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("Paid") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true);
-
- // $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
- // $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle_origin + $depositsamount_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true);
- //}
+ if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) {
+ $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false);
+ } else {
+ $pdf->MultiCell($largcol2, $tab2_hl, '('.price($deja_regle_origin + $depositsamount_origin, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).') '.price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false);
+ }
// Credit note
if ($creditnoteamount) {
@@ -2215,17 +2189,7 @@
if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) {
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true);
} else {
- $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true);
-
- //$pdf->MultiCell($largcol2, $tab2_hl, '('.price($resteapayer_origin, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).') '.price($resteapayer, 0, $outputlangs), 0, 'R', true);
- $index++;
- $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
- $pdf->SetTextColor(0, 0, 60);
- $pdf->SetFillColor(224, 224, 224);
- $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true);
-
- $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
- $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true);
+ $pdf->MultiCell($largcol2, $tab2_hl, '('.price($resteapayer_origin, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).') '.price($resteapayer, 0, $outputlangs), 0, 'R', true);
}
$pdf->SetFont('', '', $default_font_size - 1);
########## core/modules/hrm/doc/pdf_standard_evaluation.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php 2025-06-27 11:43:40.538886000 +0000
@@ -115,8 +115,7 @@
*/
public function __construct($db)
{
- global $langs, $mysoc;
-
+ global $conf, $langs, $mysoc, $user;
// Translations
$langs->loadLangs(array("main", "hrm"));
@@ -306,8 +305,6 @@
$iniY = $tab_top + 7;
$nexY = $tab_top + 7;
- $showmorebeforepagebreak = 0;
-
$pdf->setTopMargin($tab_top_newpage);
// Loop on each lines
$i = 0;
@@ -327,10 +324,10 @@
$curY = $nexY;
$pdf->startTransaction();
- // Shod fields of line
$this->printLine($pdf, $object, $i, $curY, $default_font_size, $outputlangs, $hidedetails);
+
$pageposafter = $pdf->getPage();
if ($pageposafter > $pageposbefore) {
// There is a pagebreak
@@ -498,64 +495,39 @@
*/
protected function printLine(&$pdf, $object, $linenumber, $curY, $default_font_size, $outputlangs, $hidedetails = 0)
{
+ global $conf;
$objectligne = $object->lines[$linenumber];
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->SetTextColor(0, 0, 0);
- // Rank of employee
- $rankemptoshow = "-";
- if ($objectligne->rankorder > 0) {
- $rankemptoshow = (string) $objectligne->rankorder;
- } elseif ($objectligne->rankorder < 0) {
- $rankemptoshow = $outputlangs->transnoentitiesnoconv("NA");
- }
- $pdf->SetXY($this->posxrankemp, $curY);
- $pdf->MultiCell($this->posxrequiredrank - $this->posxrankemp - 0.8, 4, $rankemptoshow, 0, 'C');
-
- // Expected required Rank
- $rankexpectedtoshow = "-";
- if ($objectligne->required_rank > 0) {
- if ($objectligne->rankorder != 0) {
- $rankexpectedtoshow = $objectligne->required_rank;
- }
- } elseif ($objectligne->required_rank < 0) {
- $rankexpectedtoshow = $outputlangs->transnoentitiesnoconv("NA");
- }
- $pdf->SetXY($this->posxrequiredrank, $curY);
- $pdf->MultiCell($this->posxresult - $this->posxrequiredrank - 0.8, 4, $rankexpectedtoshow, 0, 'C');
-
// Result
$pdf->SetXY($this->posxresult - 1, $curY);
- if ($objectligne->required_rank < 0) { // NA
- $pdf->SetFillColor(255, 255, 255);
- } elseif ($objectligne->rankorder > $objectligne->required_rank) { // Higher than expected
+ if ($objectligne->rankorder > $objectligne->required_rank) {
// Teal Green
- $pdf->SetFillColor(20, 129, 111);
- } elseif ($objectligne->rankorder == $objectligne->required_rank) { // Same than expected
+ $pdf->SetFillColor(0, 109, 91);
+ } elseif ($objectligne->rankorder == $objectligne->required_rank) {
// Seafoam Green
- $pdf->SetFillColor(169, 236, 201);
- } elseif ($objectligne->rankorder < $objectligne->required_rank) { // Lower than expected
- // Red
+ $pdf->SetFillColor(159, 226, 191);
+ } elseif ($objectligne->rankorder < $objectligne->required_rank) {
+ // red
$pdf->SetFillColor(205, 92, 92);
}
- if ($objectligne->rankorder <= 0 || $objectligne->required_rank == 0) {
+ if ($objectligne->rankorder == 0 || $objectligne->required_rank == 0) {
// No fill color
- $pdf->SetFillColor(240, 240, 240);
- }
- $result = "-";
- if ($objectligne->required_rank < 0) {
- if ($objectligne->rankorder > 0) {
- $result = $objectligne->rankorder;
- }
- } elseif ($objectligne->rankorder < 0) {
- $result = $outputlangs->transnoentitiesnoconv("NA");
- } elseif ($objectligne->required_rank != 0 && $objectligne->rankorder != 0) {
- $result = $objectligne->rankorder . "/" . $objectligne->required_rank;
+ $pdf->SetFillColor(255, 255, 255);
}
+ $result = (($objectligne->required_rank != 0 && $objectligne->rankorder != 0) ? $objectligne->rankorder . "/" . $objectligne->required_rank : "-");
$pdf->MultiCell($this->posxresult - 210 - 0.8 - 4, 4, $result, 0, 'C', true);
- // The next fields can be on several lines so we output them at end so the pos on next line will work correctly
+
+ // required Rank
+ $pdf->SetXY($this->posxrequiredrank, $curY);
+ $pdf->MultiCell($this->posxresult - $this->posxrequiredrank - 0.8, 4, (($objectligne->required_rank != 0 && $objectligne->rankorder != 0) ? $objectligne->required_rank : "-"), 0, 'C');
+
+ // Rank Employee
+ $pdf->SetXY($this->posxrankemp, $curY);
+ $pdf->MultiCell($this->posxrequiredrank - $this->posxrankemp - 0.8, 4, (($objectligne->rankorder != 0) ? $objectligne->rankorder : "-"), 0, 'C');
// Skill
$skill = new Skill($this->db);
@@ -568,6 +540,8 @@
}
$pdf->writeHTMLCell($this->posxrankemp - $this->posxskill - 0.8, 4, $this->posxskill - 1, $curY, $comment, 0, 1);
+
+
// Line num
$pdf->SetXY($this->posxpiece, $curY);
$pdf->writeHTMLCell($this->posxskill - $this->posxpiece - 0.8, 3, $this->posxpiece - 1, $curY, (string) ($linenumber + 1), 0, 1, false, false, 'C');
########## core/modules/hrm/mod_evaluation_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/hrm/mod_evaluation_standard.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/hrm/mod_evaluation_standard.php 2025-06-27 11:43:40.540971000 +0000
@@ -98,7 +98,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
@@ -136,7 +136,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
########## core/modules/modCron.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/modCron.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/modCron.class.php 2025-06-27 11:43:40.811188000 +0000
@@ -39,6 +39,8 @@
*/
public function __construct($db)
{
+ global $langs, $conf;
+
$this->db = $db;
$this->numero = 2300;
@@ -139,8 +141,8 @@
'url'=>'/cron/list.php?leftmenu=admintools',
'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>500,
- 'enabled'=>'isModEnabled("cron") && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
- 'perms'=>'$user->hasRight("cron", "read")', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
+ 'enabled'=>'$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
+ 'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules
'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$r++;
########## core/modules/modMultiCurrency.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/modMultiCurrency.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/modMultiCurrency.class.php 2025-06-27 11:43:40.738613000 +0000
@@ -154,7 +154,7 @@
'parameters' => '0,0,cron',
'comment' => 'Update all the currencies using the currencylayer API. An API key needs to be given in the multi-currency module config page to have this job working. First param is not used, Second parameter is 0 to update only already existing currency defined into the Multicurrency module or 1 to add any currency. Third parameter must be "cron".',
'frequency' => 1,
- 'unitfrequency' => 604800,
+ 'unitfrequency' => 2678400,
'status' => $statusatinstall,
'test' => 'isModEnabled("cron")',
'datestart' => $datestart
########## core/modules/propale/doc/pdf_azur.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/propale/doc/pdf_azur.modules.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/propale/doc/pdf_azur.modules.php 2025-06-27 11:43:40.681909000 +0000
@@ -1111,8 +1111,7 @@
protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs, $outputlangsbis = null)
{
// phpcs:enable
- global $mysoc;
-
+ global $conf, $mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$tab2_top = $posy;
@@ -1133,41 +1132,31 @@
// Get Total HT
$total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
- // Total discount
- $total_discount_on_lines = 0;
- $multicurrency_total_discount_on_lines = 0;
+ // Total remise
+ $total_line_remise = 0;
foreach ($object->lines as $i => $line) {
$resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2);
- $multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1);
-
- $total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0);
- $multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0);
- // If line was a negative line, we do not count the discount as a discount
+ $total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0);
+ // Gestion remise sous forme de ligne négative
if ($line->total_ht < 0) {
- $total_discount_on_lines += -$line->total_ht;
- $multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht;
+ $total_line_remise += -$line->total_ht;
}
}
+ if ($total_line_remise > 0) {
+ $pdf->SetFillColor(255, 255, 255);
+ $pdf->SetXY($col1x, $tab2_top + $tab2_hl);
+ $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
+ $pdf->SetXY($col2x, $tab2_top + $tab2_hl);
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true);
+
+ $index++;
- if ($total_discount_on_lines > 0) {
// Show total NET before discount
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true);
$pdf->SetXY($col2x, $tab2_top);
-
- $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines));
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true);
-
- $index++;
-
- $pdf->SetFillColor(255, 255, 255);
- $pdf->SetXY($col1x, $tab2_top + $tab2_hl);
- $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
- $pdf->SetXY($col2x, $tab2_top + $tab2_hl);
-
- $total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines);
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true);
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true);
$index++;
}
@@ -1323,7 +1312,7 @@
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true);
- $total_localtax = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
+ $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true);
########## core/modules/propale/doc/pdf_cyan.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/propale/doc/pdf_cyan.modules.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/propale/doc/pdf_cyan.modules.php 2025-06-27 11:43:40.684047000 +0000
@@ -1087,8 +1087,7 @@
*/
public function drawInfoTable(&$pdf, $object, $posy, $outputlangs)
{
- global $mysoc;
-
+ global $conf, $mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$pdf->SetFont('', '', $default_font_size - 1);
@@ -1302,41 +1301,31 @@
// Get Total HT
$total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
- // Total discount
- $total_discount_on_lines = 0;
- $multicurrency_total_discount_on_lines = 0;
+ // Total remise
+ $total_line_remise = 0;
foreach ($object->lines as $i => $line) {
$resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2);
- $multicurrency_resdiscount = pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, 2, 1);
-
- $total_discount_on_lines += (is_numeric($resdiscount) ? $resdiscount : 0);
- $multicurrency_total_discount_on_lines += (is_numeric($multicurrency_resdiscount) ? $multicurrency_resdiscount : 0);
- // If line was a negative line, we do not count the discount as a discount
+ $total_line_remise += (is_numeric($resdiscount) ? $resdiscount : 0);
+ // Gestion remise sous forme de ligne négative
if ($line->total_ht < 0) {
- $total_discount_on_lines += -$line->total_ht;
- $multicurrency_total_discount_on_lines += -$line->multicurrency_total_ht;
+ $total_line_remise += -$line->total_ht;
}
}
+ if ($total_line_remise > 0) {
+ $pdf->SetFillColor(255, 255, 255);
+ $pdf->SetXY($col1x, $tab2_top + $tab2_hl);
+ $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
+ $pdf->SetXY($col2x, $tab2_top + $tab2_hl);
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true);
+
+ $index++;
- if ($total_discount_on_lines > 0) {
// Show total NET before discount
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true);
$pdf->SetXY($col2x, $tab2_top);
-
- $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines));
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true);
-
- $index++;
-
- $pdf->SetFillColor(255, 255, 255);
- $pdf->SetXY($col1x, $tab2_top + $tab2_hl);
- $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true);
- $pdf->SetXY($col2x, $tab2_top + $tab2_hl);
-
- $total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines);
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true);
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true);
$index++;
}
@@ -1354,7 +1343,6 @@
$pdf->SetFillColor(248, 248, 248);
$total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
- $total_ttc_origin = $object->total_ttc;
$this->atleastoneratenotnull = 0;
if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) {
@@ -1535,21 +1523,7 @@
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : ''), $useborder, 'L', true);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
- if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) {
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true);
- } else {
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true);
-
- //$pdf->writeHTMLCell($largcol2, $tab2_hl, null, null, '('.price($sign * $object->total_ttc, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).') '.price($sign * $total_ttc, 0, $outputlangs), $useborder, 1, true, true, 'R');
- $index++;
- $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
- $pdf->SetTextColor(0, 0, 60);
- $pdf->SetFillColor(224, 224, 224);
- $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true);
-
- $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
- $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true);
- }
+ $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true);
}
}
########## core/modules/societe/doc/doc_generic_odt.modules.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php 2025-06-27 11:43:40.441120000 +0000
@@ -95,7 +95,7 @@
*/
public function info($langs)
{
- global $langs;
+ global $conf, $langs;
// Load traductions files required by page
$langs->loadLangs(array("companies", "errors"));
########## core/modules/stocktransfer/mod_stocktransfer_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php 2025-06-27 11:43:40.463911000 +0000
@@ -99,7 +99,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
@@ -137,7 +137,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
########## core/modules/workstation/mod_workstation_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/modules/workstation/mod_workstation_standard.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/modules/workstation/mod_workstation_standard.php 2025-06-27 11:43:40.632264000 +0000
@@ -97,7 +97,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
########## core/tpl/login.tpl.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/tpl/login.tpl.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/tpl/login.tpl.php 2025-06-27 11:43:40.140838000 +0000
@@ -148,20 +148,12 @@
'/core/js/dst.js'.(empty($conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION))
);
-// We display application title
-$application = constant('DOL_APPLICATION_TITLE');
-$applicationcustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
-if ($applicationcustom) {
- $application = (preg_match('/^\+/', $applicationcustom) ? $application : '').$applicationcustom;
-}
-
-// We define login title
-if ($applicationcustom) {
- $titleofloginpage = $langs->trans('Login').' '.$application;
+// We display application title instead Login term
+if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+ $titleofloginpage = getDolGlobalString('MAIN_APPLICATION_TITLE');
} else {
$titleofloginpage = $langs->trans('Login');
}
-// Title of HTML page must have pattern ' @ (?:Doli[a-zA-Z]+ |)(\\d+)\\.(\\d+)\\.([^\\s]+)' to be detected as THE login page by webviews.
$titleofloginpage .= ' @ '.$titletruedolibarrversion; // $titletruedolibarrversion is defined by dol_loginfunction in security2.lib.php. We must keep the @, some tools use it to know it is login page and find true dolibarr version.
$disablenofollow = 1;
@@ -264,12 +256,12 @@
-
+
';
}
-echo dolPrintHTML($title);
+echo dol_escape_htmltag($title);
if ($disablenofollow) {
echo '';
}
########## core/tpl/massactions_pre.tpl.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/tpl/massactions_pre.tpl.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/tpl/massactions_pre.tpl.php 2025-06-27 11:43:40.142035000 +0000
@@ -333,7 +333,7 @@
// Make substitution in email content
$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $object);
- $substitutionarray['__EMAIL__'] = empty($sendto) ? '__EMAIL__' : $sendto;
+ $substitutionarray['__EMAIL__'] = $sendto;
$substitutionarray['__CHECK_READ__'] = ' .) ';
$substitutionarray['__ONLINE_PAYMENT_URL__'] = 'UrlToPayOnlineIfApplicable';
$substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = 'TextAndUrlToPayOnlineIfApplicable';
########## core/tpl/objectline_create.tpl.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/tpl/objectline_create.tpl.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/tpl/objectline_create.tpl.php 2025-06-27 11:43:40.121206000 +0000
@@ -26,29 +26,25 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
+ *
+ * Need to have the following variables defined:
+ * $object (invoice, order, ...)
+ * $conf
+ * $langs
+ * $dateSelector
+ * $forceall (0 by default, 1 for supplier invoices/orders)
+ * $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders)
+ * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
*/
-
/**
- * @var Conf $conf
* @var CommonObject $this
* @var CommonObject $object
* @var CommonObjectLine $line
- * @var ExtraFields $extrafields
* @var Form $form
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
- * @var Societe $buyer
- * @var Societe $seller
- *
- * @var string $action
- * @var string $usehm
- * @var int $dateSelector
- * @var int $forceall (0 by default, 1 for supplier invoices/orders)
- * @var int $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders)
- * @var int $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
*/
-
// Protection to avoid direct call of template
if (empty($object) || !is_object($object)) {
print "Error: this template page cannot be called directly as an URL";
@@ -631,18 +627,18 @@
}
if (!$date_start) {
- if (getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR') != '') {
+ if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) {
print 'jQuery("#date_starthour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR').'");';
}
- if (getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN') != '') {
+ if (isset($conf->global->MAIN_DEFAULT_DATE_START_MIN)) {
print 'jQuery("#date_startmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN').'");';
}
}
if (!$date_end) {
- if (getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR')) {
+ if (isset($conf->global->MAIN_DEFAULT_DATE_END_HOUR)) {
print 'jQuery("#date_endhour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR').'");';
}
- if (getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN')) {
+ if (isset($conf->global->MAIN_DEFAULT_DATE_END_MIN)) {
print 'jQuery("#date_endmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN').'");';
}
}
########## core/tpl/objectline_edit.tpl.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/tpl/objectline_edit.tpl.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/tpl/objectline_edit.tpl.php 2025-06-27 11:43:40.122882000 +0000
@@ -36,20 +36,15 @@
*/
/**
- * @var Conf $conf
+ * @var CommonObject $this
+ * @var CommonObject $object
+ * @var CommonObjectLine $line
* @var Form $form
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
- * @var ExtraFields $extrafields
- * @var CommonObject $this
- * @var CommonObject $object
- * @var CommonObjectLine $line
* @var Societe $seller
* @var Societe $buyer
- *
- * @var string $action
- * @var int $dateSelector
*/
// Protection to avoid direct call of template
@@ -413,7 +408,7 @@
}
}
}
- $hourmin = getDolGlobalInt('MAIN_USE_HOURMIN_IN_DATE_RANGE');
+ $hourmin = (isset($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE : '');
print $form->selectDate($line->date_start, 'date_start', $hourmin, $hourmin, $line->date_start ? 0 : 1, "updateline", 1, 0);
print ' '.$langs->trans('to').' ';
print $form->selectDate($line->date_end, 'date_end', $hourmin, $hourmin, $line->date_end ? 0 : 1, "updateline", 1, 0);
@@ -440,10 +435,12 @@
date_start) {
- if (getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR') != '') {
+ if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) {
print 'jQuery("#date_starthour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR').'");';
}
- if (getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN') != '') {
+
+
+ if (isset($conf->global->MAIN_DEFAULT_DATE_START_MIN)) {
print 'jQuery("#date_startmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN').'");';
}
@@ -458,10 +455,10 @@
}
}
if (!$line->date_end) {
- if (getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR') != '') {
+ if (isset($conf->global->MAIN_DEFAULT_DATE_END_HOUR)) {
print 'jQuery("#date_endhour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR').'");';
}
- if (getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN') != '') {
+ if (isset($conf->global->MAIN_DEFAULT_DATE_END_MIN)) {
print 'jQuery("#date_endmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN').'");';
}
########## core/tpl/objectline_title.tpl.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/tpl/objectline_title.tpl.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/tpl/objectline_title.tpl.php 2025-06-27 11:43:40.124049000 +0000
@@ -42,7 +42,6 @@
* @var Form $form
* @var HookManager $hookmanager
* @var Translate $langs
- * @var Conf $conf
* @var User $user
*/
@@ -122,7 +121,7 @@
// Multicurrency
if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
- print ' '.$langs->trans('PriceUTTC').' ('.$langs->getCurrencySymbol($this->multicurrency_code).') | ';
+ print ' '.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).' | ';
}
if (!empty($inputalsopricewithtax) && !getDolGlobalInt('MAIN_NO_INPUT_PRICE_WITH_TAX')) {
@@ -211,7 +210,7 @@
// Multicurrency
if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
- print ' '.$langs->trans('TotalHTShort').' ('.$langs->getCurrencySymbol($this->multicurrency_code).') | ';
+ print ' '.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).' | ';
}
if ($outputalsopricetotalwithtax) {
########## core/tpl/objectline_view.tpl.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/tpl/objectline_view.tpl.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/tpl/objectline_view.tpl.php 2025-06-27 11:43:40.125311000 +0000
@@ -26,7 +26,10 @@
*
* Need to have the following variables defined:
* $object (invoice, order, ...)
+ * $conf
+ * $langs
* $dateSelector
+ * $forceall (0 by default, 1 for supplier invoices/orders)
* $element (used to test $user->rights->$element->creer)
* $permtoedit (used to replace test $user->rights->$element->creer)
* $senderissupplier (0 by default, 1 for supplier invoices/orders)
@@ -51,9 +54,9 @@
*
* @var string $action
* @var int $i
- * @var int $forceall
+ * @var 0|1 $forceall
* @var int $num
- * @var int $senderissupplier
+ * @var 0|1 $senderissupplier
* @var string $text
* @var string $description
*/
########## core/triggers/interface_50_modAgenda_ActionsAuto.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php 2025-06-27 11:43:40.938603000 +0000
@@ -1603,7 +1603,7 @@
// Insertion action
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$actioncomm = new ActionComm($this->db);
- $actioncomm->type_code = $object->actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_TICKET_CREATE', 'AC_XXX'...)
+ $actioncomm->type_code = $object->actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
$actioncomm->code = 'AC_'.$action;
$actioncomm->label = $object->actionmsg2; // Label of event
$actioncomm->note_private = $object->actionmsg; // Description
@@ -1616,19 +1616,14 @@
$actioncomm->contact_id = $contactforactionid; // deprecated, now managed by setting $actioncomm->socpeopleassigned later
$actioncomm->authorid = $user->id; // User saving action
$actioncomm->userownerid = $user->id; // Owner of action
-
// Fields defined when action is an email (content should be into object->actionmsg to be added into event note, subject should be into object->actionmsg2 to be added into event label)
if (!property_exists($object, 'email_fields_no_propagate_in_actioncomm') || empty($object->email_fields_no_propagate_in_actioncomm)) {
- '@phan-var-force ActionComm $object'; // TODO: None of the dolibarr classes has all the fields, check class type or properties (email_date)
- // If event is to record a message after an email received, we use the date of email as date of event.
- if (!empty($object->email_date) && $actioncomm->type_code === 'AC_TICKET_CREATE') {
- $actioncomm->datep = $object->email_date;
- $actioncomm->datef = $object->email_date;
- }
+ '@phan-var-force ActionComm $object'; // TODO: Non of the dolibarr classes has all the fields, check class type or properties (email_date)
+ $actioncomm->datep = empty($object->email_date) ? $now : $object->email_date;
+ $actioncomm->datef = empty($object->email_date) ? $now : $object->email_date;
$actioncomm->email_msgid = empty($object->email_msgid) ? null : $object->email_msgid;
$actioncomm->email_from = empty($object->email_from) ? null : $object->email_from;
- $actioncomm->email_reply_to = empty($object->email_reply_to) ? null : $object->email_reply_to;
- $actioncomm->email_subject = empty($object->email_subject) ? null : $object->email_subject;
+ $actioncomm->email_sender = empty($object->email_sender) ? null : $object->email_sender;
$actioncomm->email_to = empty($object->email_to) ? null : $object->email_to;
$actioncomm->email_tocc = empty($object->email_tocc) ? null : $object->email_tocc;
$actioncomm->email_tobcc = empty($object->email_tobcc) ? null : $object->email_tobcc;
@@ -1662,8 +1657,6 @@
}
}
- $actioncomm->ip = getUserRemoteIP(1);
-
$ret = $actioncomm->create($user); // User creating action
if ($ret > 0 && getDolGlobalString('MAIN_COPY_FILE_IN_EVENT_AUTO')) {
########## core/triggers/interface_50_modEventOrganization_EventOrganization.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php 2025-06-27 11:43:40.944594000 +0000
@@ -71,7 +71,7 @@
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
- if (!isModEnabled('eventorganization')) {
+ if (empty($conf->eventorganization) || empty($conf->eventorganization->enabled)) {
return 0; // Module not active, we do nothing
}
########## core/triggers/interface_50_modTicket_TicketEmail.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php 2025-06-27 11:43:40.949377000 +0000
@@ -65,7 +65,7 @@
$ok = 0;
- if (!isModEnabled('ticket')) {
+ if (empty($conf->ticket) || !isModEnabled('ticket')) {
return 0; // Module not active, we do nothing
}
########## core/triggers/interface_80_modStripe_Stripe.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php 2025-06-27 11:43:40.951309000 +0000
@@ -81,7 +81,7 @@
$service = 'StripeTest';
$servicestatus = 0;
- if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+ if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
$service = 'StripeLive';
$servicestatus = 1;
}
########## cron/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/cron/card.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/cron/card.php 2025-06-27 11:43:40.016269000 +0000
@@ -438,7 +438,7 @@
print ' | ';
print $langs->trans('CronEvery')." | ";
print "";
- print ' | ';
if (!$i) {
########## emailcollector/class/emailcollector.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/emailcollector/class/emailcollector.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/emailcollector/class/emailcollector.class.php 2025-06-27 11:43:39.449201000 +0000
@@ -513,6 +513,8 @@
*/
public function fetchAll(User $user, $activeOnly = 0, $sortfield = 's.rowid', $sortorder = 'ASC', $limit = 100, $page = 0)
{
+ global $langs;
+
$obj_ret = array();
$sql = "SELECT s.rowid";
@@ -546,6 +548,7 @@
} else {
$this->errors[] = 'EmailCollector::fetchAll Error when retrieve emailcollector list';
dol_syslog('EmailCollector::fetchAll Error when retrieve emailcollector list', LOG_ERR);
+ $ret = -1;
}
if (!count($obj_ret)) {
dol_syslog('EmailCollector::fetchAll No emailcollector found', LOG_DEBUG);
@@ -1847,9 +1850,7 @@
$trackidfoundintomsgidid = $reg[1];
}
- // Now apply some filters.
-
- //If there is an emailcollector filter on trackid
+ // If there is an emailcollecter filter on trackid
if ($searchfilterdoltrackid > 0) {
if (empty($trackidfoundintorecipienttype) && empty($trackidfoundintomsgidtype)) {
if (empty($headers['References']) || !preg_match('/@'.preg_quote($host, '/').'/', $headers['References'])) {
@@ -1944,8 +1945,7 @@
if (getDolGlobalString('MAIN_IMAP_USE_PHPIMAP')) {
- $dateformated = dol_print_date($overview['date'], 'dayrfc', 'gmt'); // May generate a warning "dol_print_date($overview['date'], 'dayrfc', 'gmt')" in log
- dol_syslog("msgid=".$overview['message_id']." date=".$dateformated." from=".$overview['from']." to=".$overview['to']." subject=".$overview['subject']);
+ dol_syslog("msgid=".$overview['message_id']." date=".dol_print_date($overview['date'], 'dayrfc', 'gmt')." from=".$overview['from']." to=".$overview['to']." subject=".$overview['subject']);
// Removed emojis
$overview['subject'] = removeEmoji($overview['subject'], getDolGlobalInt('MAIN_EMAIL_COLLECTOR_ACCEPT_EMOJIS', 1));
@@ -2159,8 +2159,6 @@
// var_dump($headers['References']);
// var_dump($arrayofreferences);
- // We loop on References, but as soon as we found one that allow us to find an existing object,
- // we do a break (See line with comment "Exit loop of references").
foreach ($arrayofreferences as $reference) {
//print "Process mail ".$iforemailloop." email_msgid ".$msgid.", date ".dol_print_date($dateemail, 'dayhour', 'gmt').", subject ".$subject.", reference ".dol_escape_htmltag($reference)." \n";
if (!empty($trackidfoundintorecipienttype)) {
@@ -2322,7 +2320,7 @@
$projectid = $objectemail->id;
}
- if ($objectemail instanceof Ticket) { // For tickets, we have a column to store all met references, so we complete it if we need to.
+ if ($objectemail instanceof Ticket) {
$ticketid = $objectemail->id;
$changeonticket_references = false;
@@ -2341,8 +2339,7 @@
}
}
if ($changeonticket_references) {
- $operationslog .= ' We complete ticket ID='.$ticketid.' with property origin_references='.$objectemail->origin_references;
- $objectemail->update($user, 1); // We complete the references field with all references mentioned into this email. This field is for technical tracking purpose, not a user field, so no need to execute triggers
+ $objectemail->update($user, 1); // We complete the references field, that is a field for technical tracking purpose, not a user field, so no need to execute triggers
}
}
}
@@ -2455,8 +2452,7 @@
}
*/
-
- // Now do all operations for the email (extract variables and creating data)
+ // Do operations (extract variables and creating data)
if ($mode < 2) { // 0=Mode production, 1=Mode test (read IMAP and try SQL update then rollback), 2=Mode test with no SQL updates
foreach ($this->actions as $operation) {
$errorforthisaction = 0;
@@ -2513,10 +2509,7 @@
$tickettocreate = new Ticket($this->db);
$errorfetchticket = 0;
$alreadycreated = 0;
- if ($ticketid > 0) {
- $alreadycreated = $tickettocreate->fetch($ticketid);
- }
- if ($alreadycreated == 0 && !empty($trackid)) {
+ if (!empty($trackid)) {
$alreadycreated = $tickettocreate->fetch(0, '', $trackid);
}
if ($alreadycreated == 0 && !empty($msgid)) {
@@ -2530,7 +2523,7 @@
$operationslog .= ' Ticket not found using trackid='.$trackid.' or msgid='.$msgid;
$ticketalreadyexists = 0;
} else {
- $operationslog .= ' Ticket already found using trackid='.$trackid.' or msgid='.$msgid.", we replace operation 'ticket' with 'recordevent' to add a new message"; // We change the operation type to do
+ $operationslog .= ' Ticket already found using trackid='.$trackid.' or msgid='.$msgid; // We change the operation type to do
$ticketalreadyexists = 1;
$operation['type'] = 'recordevent';
}
@@ -2539,15 +2532,11 @@
}
}
- // Process now the operation according to its type
+ // Process now the operation type
// Search and create thirdparty
if ($operation['type'] == 'loadthirdparty' || $operation['type'] == 'loadandcreatethirdparty') {
- if ($thirdpartyid > 0) {
- // We already have found the thirdparty id to load, so we bypass the action loadthirdparty
- $idtouseforthirdparty = $thirdpartyid;
- $operationslog .= ' We already have found a related thirdparty id, so we bypass the action loadthirdparty and use idtouseforthirdparty='.$idtouseforthirdparty;
- } elseif (empty($operation['actionparam'])) {
+ if (empty($operation['actionparam'])) {
$errorforactions++;
$this->error = "Action loadthirdparty or loadandcreatethirdparty has empty parameter. Must be a rule like 'name=HEADER:^From:(.*);' or 'name=SET:xxx' or 'name=EXTRACT:(body|subject):regex where 'name' can be replaced with 'id' or 'email' to define how to set or extract data. More properties can also be set, for example client=SET:2;";
$this->errors[] = $this->error;
@@ -2877,7 +2866,7 @@
$alreadycreated = $actioncomm->fetch(0, '', '', $msgid);
if ($alreadycreated == 0) {
- $operationslog .= ' We did not find existing actioncomm with msgid='.$msgid;
+ $operationslog .= ' We did not find existing actionmail with msgid='.$msgid;
if ($projectstatic->id > 0) {
if ($projectfoundby) {
@@ -2990,8 +2979,6 @@
$operationslog .= ' Event created -> id='.dol_escape_htmltag((string) $actioncomm->id);
}
}
- } else {
- $operationslog .= ' An event in actioncomm table already exists for the msgid = '.$msgid.' so we bypass this action.';
}
} elseif ($operation['type'] == 'recordjoinpiece') {
$data = [];
@@ -3469,11 +3456,6 @@
}
}
}
- } else {
- // Do nothing in action ticket if ticket already exists.
- // Note that if we want to add a new event to a ticket, we should have a collector with action "Record event in agenda" or hope the type of action 'ticket' was
- // already replaced automatically by operation "recordevent".
- $operationslog .= ' Ticket already exists, so we bypass action "ticket"';
}
} elseif ($operation['type'] == 'candidature') {
// Create candidature
########## eventorganization/class/conferenceorbooth.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/eventorganization/class/conferenceorbooth.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/eventorganization/class/conferenceorbooth.class.php 2025-06-27 11:43:41.426304000 +0000
@@ -332,7 +332,7 @@
// Manage filter
if (is_array($filter)) { // deprecated, use $filter = USF syntax
- dol_syslog("You are using a deprecated use of fetchAll. filter parameter must be an USF string now.", LOG_WARNING);
+ dol_syslog("You are using a deprecated use of fetchAll. filter parameter mus be an USF string now.", LOG_WARNING);
$sqlwhere = array();
if (count($filter) > 0) {
foreach ($filter as $key => $value) {
########## eventorganization/class/conferenceorboothattendee.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/eventorganization/class/conferenceorboothattendee.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/eventorganization/class/conferenceorboothattendee.class.php 2025-06-27 11:43:41.429455000 +0000
@@ -476,7 +476,7 @@
// Manage filter
if (is_array($filter)) { // deprecated, use $filter = USF syntax
- dol_syslog("You are using a deprecated use of fetchAll. filter parameter must be an USF string now.", LOG_WARNING);
+ dol_syslog("You are using a deprecated use of fetchAll. filter parameter mus be an USF string now.", LOG_WARNING);
$sqlwhere = array();
if (count($filter) > 0) {
foreach ($filter as $key => $value) {
########## expedition/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/expedition/card.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/expedition/card.php 2025-06-27 11:43:46.888812000 +0000
@@ -213,7 +213,7 @@
setEventMessages($object->error, $object->errors, 'errors');
}
- $result = $object->setValueFrom('ref_customer', GETPOST('ref_customer', 'alpha'), '', null, 'text', '', $user, 'SHIPPING_MODIFY');
+ $result = $object->setValueFrom('ref_customer', GETPOST('ref_customer', 'alpha'), '', null, 'text', '', $user, 'SHIPMENT_MODIFY');
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$action = 'editref_customer';
@@ -236,7 +236,7 @@
if (!$error) {
// Actions on extra fields
- $result = $object->updateExtraField($attribute_name, 'SHIPPING_MODIFY');
+ $result = $object->updateExtraField($attribute_name, 'SHIPMENT_MODIFY');
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
########## expedition/class/api_shipments.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/expedition/class/api_shipments.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/expedition/class/api_shipments.class.php 2025-06-27 11:43:46.899487000 +0000
@@ -112,7 +112,7 @@
$obj_ret = array();
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
- $socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+ $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
########## expedition/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/expedition/list.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/expedition/list.php 2025-06-27 11:43:46.905939000 +0000
@@ -1688,7 +1688,7 @@
// Note public
if (!empty($arrayfields['e.note_public']['checked'])) {
print '';
- print ' '.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).' ';
+ print dolPrintHTML($obj->note_public);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -1697,7 +1697,7 @@
// Note private
if (!empty($arrayfields['e.note_private']['checked'])) {
print '';
- print ' '.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).' ';
+ print dolPrintHTML($obj->note_private);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
########## expedition/shipment.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/expedition/shipment.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/expedition/shipment.php 2025-06-27 11:43:46.909818000 +0000
@@ -209,7 +209,7 @@
}
if (!$error) {
- $result = $object->updateExtraField($attribute_name, 'SHIPPING_MODIFY');
+ $result = $object->updateExtraField($attribute_name, 'SHIPMENT_MODIFY');
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
########## expensereport/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/expensereport/card.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/expensereport/card.php 2025-06-27 11:43:47.069795000 +0000
@@ -174,7 +174,6 @@
/*
* Actions
*/
-
$error = 0;
$value_unit_ht = price2num(GETPOST('value_unit_ht', 'alpha'), 'MU');
@@ -411,9 +410,9 @@
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
- $tmpuser = new User($db);
- $tmpuser->fetch($object->fk_user_author);
- $newlang = $tmpuser->lang;
+ $user = new User($db);
+ $user->fetch($object->fk_user_author);
+ $newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -530,9 +529,9 @@
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
- $tmpuser = new User($db);
- $tmpuser->fetch($object->fk_user_author);
- $newlang = $tmpuser->lang;
+ $user = new User($db);
+ $user->fetch($object->fk_user_author);
+ $newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -644,9 +643,9 @@
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
- $tmpuser = new User($db);
- $tmpuser->fetch($object->fk_user_author);
- $newlang = $tmpuser->lang;
+ $user = new User($db);
+ $user->fetch($object->fk_user_author);
+ $newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -762,9 +761,9 @@
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
- $tmpuser = new User($db);
- $tmpuser->fetch($object->fk_user_author);
- $newlang = $tmpuser->lang;
+ $user = new User($db);
+ $user->fetch($object->fk_user_author);
+ $newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -880,9 +879,9 @@
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
- $tmpuser = new User($db);
- $tmpuser->fetch($object->fk_user_author);
- $newlang = $tmpuser->lang;
+ $user = new User($db);
+ $user->fetch($object->fk_user_author);
+ $newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -996,9 +995,9 @@
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
- $tmpuser = new User($db);
- $tmpuser->fetch($object->fk_user_author);
- $newlang = $tmpuser->lang;
+ $user = new User($db);
+ $user->fetch($object->fk_user_author);
+ $newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -1037,9 +1036,9 @@
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
- $tmpuser = new User($db);
- $tmpuser->fetch($object->fk_user_author);
- $newlang = $tmpuser->lang;
+ $user = new User($db);
+ $user->fetch($object->fk_user_author);
+ $newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -1050,13 +1049,9 @@
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
-
- header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
- exit;
}
}
-
if ($action == 'set_paid' && $id > 0 && $user->hasRight('expensereport', 'to_paid')) {
$object = new ExpenseReport($db);
$object->fetch($id);
@@ -1072,9 +1067,9 @@
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
- $tmpuser = new User($db);
- $tmpuser->fetch($object->fk_user_author);
- $newlang = $tmpuser->lang;
+ $user = new User($db);
+ $user->fetch($object->fk_user_author);
+ $newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -1088,78 +1083,74 @@
}
if ($result > 0) {
- // TODO We must never send an email without a setup or confirm option to choose if email is
- // sent or not. So we add a hidden constant to avoid this for the moment.
- if (getDolGlobalString('EXPENSEREPORT_SEND_EMAIL_ON_STATUS_PAID')) {
- // Send mail
-
- // TO
- $destinataire = new User($db);
- $destinataire->fetch($object->fk_user_author);
- $emailTo = $destinataire->email;
-
- // FROM
- $expediteur = new User($db);
- $expediteur->fetch($user->id);
- $emailFrom = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
-
- if ($emailFrom && $emailTo) {
- $filename = array();
- $filedir = array();
- $mimetype = array();
-
- // SUBJECT
- $societeName = getDolGlobalString('MAIN_INFO_SOCIETE_NOM');
- if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
- $societeName = getDolGlobalString('MAIN_APPLICATION_TITLE');
- }
-
- $subject = $societeName." - ".$langs->transnoentities("ExpenseReportPaid");
-
- // CONTENT
- $link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
- $link = ''.$link.'';
- $message = $langs->transnoentities("ExpenseReportPaidMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link);
-
- // Generate pdf before attachment
- $object->setDocModel($user, "");
- $resultPDF = expensereport_pdf_create($db, $object, '', "", $langs);
-
- // PREPARE SEND
- $mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1);
-
- if (empty($mailfile->error)) {
- // SEND
- $result = $mailfile->sendfile();
- if ($result) {
- $mesg = $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($emailFrom, 2), $mailfile->getValidAddress($emailTo, 2));
- setEventMessages($mesg, null, 'mesgs');
+ // Send mail
+
+ // TO
+ $destinataire = new User($db);
+ $destinataire->fetch($object->fk_user_author);
+ $emailTo = $destinataire->email;
+
+ // FROM
+ $expediteur = new User($db);
+ $expediteur->fetch($user->id);
+ $emailFrom = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
+
+ if ($emailFrom && $emailTo) {
+ $filename = array();
+ $filedir = array();
+ $mimetype = array();
+
+ // SUBJECT
+ $societeName = getDolGlobalString('MAIN_INFO_SOCIETE_NOM');
+ if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+ $societeName = getDolGlobalString('MAIN_APPLICATION_TITLE');
+ }
+
+ $subject = $societeName." - ".$langs->transnoentities("ExpenseReportPaid");
- header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
- exit;
+ // CONTENT
+ $link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
+ $link = ''.$link.'';
+ $message = $langs->transnoentities("ExpenseReportPaidMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link);
+
+ // Generate pdf before attachment
+ $object->setDocModel($user, "");
+ $resultPDF = expensereport_pdf_create($db, $object, '', "", $langs);
+
+ // PREPARE SEND
+ $mailfile = new CMailFile($subject, $emailTo, $emailFrom, $message, $filedir, $mimetype, $filename, '', '', 0, -1);
+
+ if (empty($mailfile->error)) {
+ // SEND
+ $result = $mailfile->sendfile();
+ if ($result) {
+ $mesg = $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($emailFrom, 2), $mailfile->getValidAddress($emailTo, 2));
+ setEventMessages($mesg, null, 'mesgs');
+ header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
+ exit;
+ } else {
+ $langs->load("other");
+ if ($mailfile->error) {
+ $mesg = '';
+ $mesg .= $langs->trans('ErrorFailedToSendMail', $emailFrom, $emailTo);
+ $mesg .= ' '.$mailfile->error;
+ setEventMessages($mesg, null, 'errors');
} else {
- $langs->load("other");
- if ($mailfile->error) {
- $mesg = '';
- $mesg .= $langs->trans('ErrorFailedToSendMail', $emailFrom, $emailTo);
- $mesg .= ' '.$mailfile->error;
- setEventMessages($mesg, null, 'errors');
- } else {
- setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings');
- }
+ setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings');
}
- } else {
- setEventMessages($mailfile->error, $mailfile->errors, 'errors');
}
} else {
- setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings');
+ setEventMessages($mailfile->error, $mailfile->errors, 'errors');
+ $action = '';
}
+ } else {
+ setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings');
+ $action = '';
}
} else {
setEventMessages($langs->trans("FailedToSetPaid"), null, 'warnings');
+ $action = '';
}
-
- $action = '';
}
if ($action == "addline" && $user->hasRight('expensereport', 'creer')) {
@@ -1254,9 +1245,12 @@
$outputlangs = $langs;
$newlang = GETPOST('lang_id', 'alpha');
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
- $tmpuser = new User($db);
- $tmpuser->fetch($object->fk_user_author);
- $newlang = $tmpuser->lang;
+ $user = new User($db);
+ $user->fetch($object->fk_user_author);
+ $newlang = $user->lang;
+ }
+ if (empty($newlang)) {
+ $newlang = $langs;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -1309,9 +1303,9 @@
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
- $tmpuser = new User($db);
- $tmpuser->fetch($object->fk_user_author);
- $newlang = $tmpuser->lang;
+ $user = new User($db);
+ $user->fetch($object->fk_user_author);
+ $newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -1408,9 +1402,9 @@
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
- $tmpuser = new User($db);
- $tmpuser->fetch($object->fk_user_author);
- $newlang = $tmpuser->lang;
+ $user = new User($db);
+ $user->fetch($object->fk_user_author);
+ $newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
@@ -1432,7 +1426,8 @@
unset($date);
}
- $action = '';
+ //header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
+ //exit;
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -1608,7 +1603,6 @@
// End of page
llxFooter();
-
$db->close();
exit;
@@ -1617,7 +1611,7 @@
$head = expensereport_prepare_head($object);
- if ($action == 'edit' && ($object->status <= ExpenseReport::STATUS_VALIDATED || $object->status == ExpenseReport::STATUS_REFUSED)) {
+ if ($action == 'edit' && ($object->status < 3 || $object->status == ExpenseReport::STATUS_REFUSED)) {
print " ';
########## exports/class/export.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/exports/class/export.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/exports/class/export.class.php 2025-06-27 11:43:38.903326000 +0000
@@ -426,6 +426,7 @@
}
break;
case 'Duree':
+ break;
case 'Numeric':
// if there is a signe +
if (strpos($ValueField, "+") > 0) {
@@ -648,6 +649,7 @@
$szMsg = $langs->trans('ExportDateFilter');
break;
case 'Duree':
+ break;
case 'Numeric':
$szMsg = $langs->trans('ExportNumericFilter');
break;
########## fichinter/class/api_interventions.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fichinter/class/api_interventions.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fichinter/class/api_interventions.class.php 2025-06-27 11:43:40.053134000 +0000
@@ -147,7 +147,7 @@
$obj_ret = array();
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
- $socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+ $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
########## fichinter/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fichinter/list.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fichinter/list.php 2025-06-27 11:43:40.062051000 +0000
@@ -996,7 +996,7 @@
// Note public
if (!empty($arrayfields['f.note_public']['checked'])) {
print ' ';
- print ' '.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).' ';
+ print dolPrintHTML($obj->note_public);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -1005,7 +1005,7 @@
// Note private
if (!empty($arrayfields['f.note_private']['checked'])) {
print ' ';
- print ' '.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).' ';
+ print dolPrintHTML($obj->note_private);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
########## filefunc.inc.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/filefunc.inc.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/filefunc.inc.php 2025-06-27 11:43:46.916637000 +0000
@@ -1,7 +1,7 @@
* Copyright (C) 2003 Xavier Dutoit
- * Copyright (C) 2004-2025 Laurent Destailleur
+ * Copyright (C) 2004-2017 Laurent Destailleur
* Copyright (C) 2004 Sebastien Di Cintio
* Copyright (C) 2004 Benoit Mortier
* Copyright (C) 2005-2011 Regis Houssin
@@ -9,8 +9,8 @@
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2010 Juanjo Menent
* Copyright (C) 2015 Bahfir Abbes
- * Copyright (C) 2024-2025 MDW
- * Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024-2025 MDW
+ * Copyright (C) 2024 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
@@ -63,7 +63,7 @@
define('DOL_APPLICATION_TITLE', 'Dolibarr');
}
if (!defined('DOL_VERSION')) {
- define('DOL_VERSION', '22.0.0'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
+ define('DOL_VERSION', '22.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
}
if (!defined('EURO')) {
@@ -488,11 +488,11 @@
if ((!empty($dolibarr_main_db_pass) && preg_match('/(dolcrypt|crypted):/i', $dolibarr_main_db_pass)) || !empty($dolibarr_main_db_encrypted_pass)) {
if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) {
$dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass);
- $dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this so we can use it later to know the password was initially encrypted
$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass);
- } elseif (!empty($dolibarr_main_db_pass) && preg_match('/dolcrypt:/i', $dolibarr_main_db_pass)) {
$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this so we can use it later to know the password was initially encrypted
+ } elseif (!empty($dolibarr_main_db_pass) && preg_match('/dolcrypt:/i', $dolibarr_main_db_pass)) {
$dolibarr_main_db_pass = dolDecrypt($dolibarr_main_db_pass, (empty($dolibarr_main_dolcrypt_key) ? (empty($dolibarr_main_instance_unique_id) ? '' : $dolibarr_main_instance_unique_id) : $dolibarr_main_dolcrypt_key));
+ $dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this so we can use it later to know the password was initially encrypted
} else {
$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
}
########## fourn/ajax/getSupplierPrices.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fourn/ajax/getSupplierPrices.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fourn/ajax/getSupplierPrices.php 2025-06-27 11:43:41.502671000 +0000
@@ -122,7 +122,7 @@
}
}
- $prices[] = array("id" => 'pmpprice', "price" => price2num($price, 'MU'), "label" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price()
+ $prices[] = array("id" => 'pmpprice', "price" => price2num($price), "label" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price()
}
// Add price for costprice (at end)
########## fourn/class/api_supplier_invoices.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fourn/class/api_supplier_invoices.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fourn/class/api_supplier_invoices.class.php 2025-06-27 11:43:41.527997000 +0000
@@ -117,7 +117,7 @@
$obj_ret = array();
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
- $socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+ $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
########## fourn/class/api_supplier_orders.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fourn/class/api_supplier_orders.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fourn/class/api_supplier_orders.class.php 2025-06-27 11:43:41.529272000 +0000
@@ -111,7 +111,7 @@
$obj_ret = array();
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
- $socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+ $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
########## fourn/class/fournisseur.commande.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fourn/class/fournisseur.commande.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fourn/class/fournisseur.commande.class.php 2025-06-27 11:43:41.533826000 +0000
@@ -3547,7 +3547,7 @@
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
{
- global $langs;
+ global $conf, $langs;
if (!dol_strlen($modele)) {
$modele = ''; // No doc template/generation by default
########## fourn/commande/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fourn/commande/list.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fourn/commande/list.php 2025-06-27 11:43:41.496322000 +0000
@@ -205,7 +205,7 @@
$arrayfields = array(
'u.login' => array('label' => "AuthorRequest", 'enabled' => '1', 'position' => 41),
's.name_alias' => array('label' => "AliasNameShort", 'position' => 51, 'checked' => '0'),
- 's.town' => array('label' => "Town", 'enabled' => '1', 'position' => 55, 'checked' => '0'),
+ 's.town' => array('label' => "Town", 'enabled' => '1', 'position' => 55, 'checked' => '1'),
's.zip' => array('label' => "Zip", 'enabled' => '1', 'position' => 56, 'checked' => '1'),
'state.nom' => array('label' => "StateShort", 'enabled' => '1', 'position' => 57),
'country.code_iso' => array('label' => "Country", 'enabled' => '1', 'position' => 58),
@@ -2103,7 +2103,7 @@
// Note public
if (!empty($arrayfields['cf.note_public']['checked'])) {
print '';
- print ' '.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).' ';
+ print dolPrintHTML($obj->note_public);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -2113,7 +2113,7 @@
// Note private
if (!empty($arrayfields['cf.note_private']['checked'])) {
print '';
- print ' '.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).' ';
+ print dolPrintHTML($obj->note_private);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
########## fourn/facture/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fourn/facture/card.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fourn/facture/card.php 2025-06-27 11:43:41.556380000 +0000
@@ -3638,7 +3638,7 @@
if (GETPOST('calculationrule')) {
$calculationrule = GETPOST('calculationrule', 'alpha');
} else {
- $calculationrule = (!getDolGlobalString('MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND_SUPPLIER') ? 'totalofround' : 'roundoftotal');
+ $calculationrule = (!getDolGlobalString('MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND') ? 'totalofround' : 'roundoftotal');
}
if ($calculationrule == 'totalofround') {
$calculationrulenum = 1;
########## fourn/facture/paiement.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/fourn/facture/paiement.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/fourn/facture/paiement.php 2025-06-27 11:43:41.548605000 +0000
@@ -232,7 +232,7 @@
}
}
- $formquestion[$i++] = array('type' => 'hidden', 'name' => $key, 'value' => GETPOSTFLOAT($key));
+ $formquestion[$i++] = array('type' => 'hidden', 'name' => $key, 'value' => GETPOSTINT($key));
}
}
########## holiday/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/holiday/list.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/holiday/list.php 2025-06-27 11:43:47.090912000 +0000
@@ -90,7 +90,7 @@
$sortorder = "DESC";
}
if (!$sortfield) {
- $sortfield = "cp.date_debut";
+ $sortfield = "cp.ref";
}
$search_all = trim(GETPOST('search_all', 'alphanohtml'));
########## hrm/class/skill.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/class/skill.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/class/skill.class.php 2025-06-27 11:43:46.998538000 +0000
@@ -197,7 +197,7 @@
*/
public function __construct(DoliDB $db)
{
- global $langs;
+ global $conf, $langs;
$this->db = $db;
@@ -245,8 +245,11 @@
*/
public function create(User $user, $notrigger = 0)
{
+ global $langs,$conf;
+
$resultcreate = $this->createCommon($user, $notrigger);
+
if ($resultcreate > 0) {
// skillDet create
$this->createSkills();
@@ -263,9 +266,9 @@
*/
public function createSkills($i = 1)
{
- global $user, $langs;
+ global $conf, $user, $langs;
- $maxNumberSkill = getDolGlobalInt('HRM_MAXRANK', self::DEFAULT_MAX_RANK_PER_SKILL);
+ $MaxNumberSkill = getDolGlobalInt('HRM_MAXRANK', self::DEFAULT_MAX_RANK_PER_SKILL);
$defaultSkillDesc = getDolGlobalString('HRM_DEFAULT_SKILL_DESCRIPTION', $langs->trans("NoDescription"));
$error = 0;
@@ -275,9 +278,8 @@
$this->db->begin();
// Create level 0 of skills
- /* Removed this. if a skill is not required for a job, the skill will just not be added to the job profile or will be added with expected level = N/A
$skilldet = new Skilldet($this->db);
- $skilldet->description = $langs->transnoentitiesnoconv('SkillNotRequired');
+ $skilldet->description = $langs->trans('SkillNotRequired');
$skilldet->rankorder = 0;
$skilldet->fk_skill = $this->id;
@@ -285,17 +287,15 @@
if ($result <= 0) {
$error++;
}
- */
// Create level of skills
- while ($i <= $maxNumberSkill) {
+ while ($i <= $MaxNumberSkill) {
$skilldet = new Skilldet($this->db);
$skilldet->description = $defaultSkillDesc . " " . $i;
$skilldet->rankorder = $i;
$skilldet->fk_skill = $this->id;
$result = $skilldet->create($user);
-
if ($result <= 0) {
$error++;
}
@@ -914,13 +914,11 @@
*/
public function LibStatut($status, $mode = 0)
{
- // phpcs:enable
if (empty($status)) {
$status = 0;
}
- return '';
- /*
+ // phpcs:enable
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
global $langs;
//$langs->load("hrm");
@@ -939,7 +937,6 @@
}
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
- */
}
/**
########## hrm/class/skilldet.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/class/skilldet.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/class/skilldet.class.php 2025-06-27 11:43:47.005722000 +0000
@@ -179,7 +179,7 @@
*/
public function __construct(DoliDB $db)
{
- global $langs;
+ global $conf, $langs;
$this->db = $db;
@@ -193,6 +193,12 @@
$this->fields['entity']['enabled'] = 0;
}
+ // Example to show how to set values of fields definition dynamically
+ /*if ($user->rights->hrm->skilldet->read) {
+ $this->fields['myfield']['visible'] = 1;
+ $this->fields['myfield']['noteditable'] = 0;
+ }*/
+
// Unset fields that are disabled
foreach ($this->fields as $key => $val) {
if (isset($val['enabled']) && empty($val['enabled'])) {
@@ -237,8 +243,7 @@
*/
public function createFromClone(User $user, $fromid)
{
- global $extrafields;
-
+ global $langs, $extrafields;
$error = 0;
dol_syslog(__METHOD__, LOG_DEBUG);
@@ -476,7 +481,7 @@
*/
public function validate($user, $notrigger = 0)
{
- global $conf;
+ global $conf, $langs;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -945,7 +950,7 @@
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
{
- global $langs;
+ global $conf, $langs;
$result = 0;
$includedocgeneration = 0;
########## hrm/compare.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/compare.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/compare.php 2025-06-27 11:43:46.981483000 +0000
@@ -216,63 +216,62 @@
-
+
+
+ 0 || $fk_usergroup2 > 0 || $fk_job > 0) { ?>
+
+
+ |
+ trans('Skill'); ?> |
+ trans('rank'); ?> |
+ trans('difference'); ?> |
+ trans('rank'); ?> |
+ |
+
+
+ ';
- 0 || $fk_usergroup2 > 0 || $fk_job > 0) {
$TUser1 = $TUser2 = array();
- $userlist1 = displayUsersListWithPicto($TUser1, $fk_usergroup1, 'list1'); // This fill also the $TUser1
+ $userlist1 = displayUsersListWithPicto($TUser1, $fk_usergroup1, 'list1');
+
+ $skill = new Skill($db);
$TSkill1 = getSkillForUsers($TUser1);
- if ($fk_job > 0) {
- $TSkill2 = getSkillForJob($fk_job);
+ if ($fk_job > 0) {
+ $TSkill2 = getSkillForJob($fk_job);
- $job = new Job($db);
- $job->fetch($fk_job);
- $userlist2 = '
+ $job = new Job($db);
+ $job->fetch($fk_job);
+ $userlist2 = '';
- } else {
- $userlist2 = displayUsersListWithPicto($TUser2, $fk_usergroup2, 'list2');
- $TSkill2 = getSkillForUsers($TUser2);
- }
+ } else {
+ $userlist2 = displayUsersListWithPicto($TUser2, $fk_usergroup2, 'list2');
+ $TSkill2 = getSkillForUsers($TUser2);
+ }
$TMergedSkills = mergeSkills($TSkill1, $TSkill2);
- ?>
-
-
- | trans('Employees'); ?> |
- trans('Skill'); ?> |
- trans('HighestRank'); ?> |
- trans('difference'); ?> |
- trans($fk_job > 0 ? 'ExpectedRank' : 'HighestRank'); ?> |
- |
-
- ';
-
- echo '';
echo $userlist1;
- echo ' | ';
- echo '' . skillList($TMergedSkills) . ' | ';
-
- echo '' . rate($TMergedSkills, 'rate1') . ' | ';
+ echo '';
+ echo '' . skillList($TMergedSkills) . ' | ';
+ echo '' . rate($TMergedSkills, 'rate1') . ' | ';
echo '' . diff($TMergedSkills) . ' | ';
+ echo '' . rate($TMergedSkills, 'rate2') . ' | ';
- echo '' . rate($TMergedSkills, 'rate2') . ' | ';
+ echo '';
- echo ' | ';
echo $userlist2;
- echo ' | ';
- echo '';
+ echo '';
?>
@@ -331,11 +330,10 @@
}
/**
- * Return a html list with rank information
- *
- * @param array $TMergedSkills Skill list for display
- * @param string $field Which column of comparison we are working with ('rate1' or 'rate2')
- * @return string String to show for level
+ * Return a html list with rank information
+ * @param array $TMergedSkills skill list for display
+ * @param string $field which column of comparison we are working with
+ * @return string
*/
function rate(&$TMergedSkills, $field)
{
@@ -350,7 +348,7 @@
$note = 'x';
$class .= ' none';
} else {
- $note = $sk->$field < 0 ? $langs->trans("NA") : $sk->$field;
+ $note = $sk->$field;
$how_many = ($field === 'rate1') ? $sk->how_many_max1 : $sk->how_many_max2;
}
@@ -360,8 +358,8 @@
$trad = $langs->trans('HighestRank');
}
- $out .= '-
-
' . $note . '' . ($how_many > 0 ? '' . $how_many . '' : '') . '
+ $out .= ' -
+
' . $note . '' . ($how_many > 0 ? '' . $how_many . '' : '') . '
';
}
@@ -393,10 +391,10 @@
}
/**
- * Create an array of lines [ skillLabel,description, maxrank on group1 , minrank needed for this skill ]
+ * create an array of lines [ skillLabel,description, maxrank on group1 , minrank needed for this skill ]
*
- * @param array $TSkill1 Skill list of first column
- * @param array $TSkill2 Skill list of second column
+ * @param array $TSkill1 skill list of first column
+ * @param array $TSkill2 skill list of second column
* @return array
*/
function mergeSkills($TSkill1, $TSkill2)
@@ -410,7 +408,6 @@
$Tab[$sk->fk_skill]->rate1 = $sk->rankorder;
$Tab[$sk->fk_skill]->how_many_max1 = $sk->how_many_max;
-
$Tab[$sk->fk_skill]->label = $sk->label;
$Tab[$sk->fk_skill]->description = $sk->description;
}
@@ -420,10 +417,9 @@
$Tab[$sk->fk_skill] = new stdClass();
}
$Tab[$sk->fk_skill]->rate2 = $sk->rankorder;
- $Tab[$sk->fk_skill]->how_many_max2 = $sk->how_many_max;
-
$Tab[$sk->fk_skill]->label = $sk->label;
$Tab[$sk->fk_skill]->description = $sk->description;
+ $Tab[$sk->fk_skill]->how_many_max2 = $sk->how_many_max;
}
return $Tab;
@@ -515,60 +511,52 @@
/**
* Allow to get skill(s) of a user
*
- * @param int[] $TUser array of employees we need to get skills
+ * @param int[] $TUser array of employees we need to get skills
* @return array
*/
function getSkillForUsers($TUser)
{
global $db;
- // I go back to the user with the highest score in a given group for all the skills assessed in that group
+ //I go back to the user with the highest score in a given group for all the skills assessed in that group
if (empty($TUser)) {
return array();
}
- $sql = 'SELECT sk.rowid, sk.label, sk.description, sk.skill_type,';
+ $sql = 'SELECT sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill, ';
$sql .= ' MAX(sr.rankorder) as rankorder';
$sql .= ' FROM '.MAIN_DB_PREFIX.'hrm_skill sk';
- $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'hrm_skillrank sr';
- $sql .= " WHERE sk.rowid = sr.fk_skill AND sr.objecttype = '".$db->escape(SkillRank::SKILLRANK_TYPE_USER)."'";
+ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'hrm_skillrank sr ON (sk.rowid = sr.fk_skill)';
+ $sql .= " WHERE sr.objecttype = '".$db->escape(SkillRank::SKILLRANK_TYPE_USER)."'";
$sql .= ' AND sr.fk_object IN ('.$db->sanitize(implode(',', $TUser)).')';
- $sql .= ' AND rankorder >= 0';
- $sql .= " GROUP BY sk.rowid, sk.label, sk.description, sk.skill_type"; // group by skill
- $sql .= " ORDER BY sk.rowid ASC";
+ $sql .= " GROUP BY sk.rowid, sk.label, sk.description, sk.skill_type, sr.fk_object, sr.objecttype, sr.fk_skill "; // group par competence
$resql = $db->query($sql);
$Tab = array();
if ($resql) {
- // For each skill, we count the number of times that the max score has been reached within a given group
+ //For each skill, we count the number of times that the max score has been reached within a given group
$num = 0;
while ($obj = $db->fetch_object($resql)) {
- $Tab[$num] = new stdClass();
-
- $Tab[$num]->fk_skill = $obj->rowid;
- $Tab[$num]->label = $obj->label;
- $Tab[$num]->description = $obj->description;
- $Tab[$num]->skill_type = $obj->skill_type;
- //$Tab[$num]->fk_object = $obj->fk_object;
- $Tab[$num]->objectType = SkillRank::SKILLRANK_TYPE_USER;
-
- $Tab[$num]->rankorder = $obj->rankorder;
-
- // Get how_many_max
$sql1 = "SELECT COUNT(rowid) as how_many_max FROM ".MAIN_DB_PREFIX."hrm_skillrank as sr";
$sql1 .= " WHERE sr.rankorder = ".((int) $obj->rankorder);
$sql1 .= " AND sr.objecttype = '".$db->escape(SkillRank::SKILLRANK_TYPE_USER)."'";
- $sql1 .= " AND sr.fk_skill = ".((int) $obj->rowid);
+ $sql1 .= " AND sr.fk_skill = ".((int) $obj->fk_skill);
$sql1 .= " AND sr.fk_object IN (".$db->sanitize(implode(',', $TUser)).")";
$resql1 = $db->query($sql1);
$objMax = $db->fetch_object($resql1);
+ $Tab[$num] = new stdClass();
+ $Tab[$num]->fk_skill = $obj->fk_skill;
+ $Tab[$num]->label = $obj->label;
+ $Tab[$num]->description = $obj->description;
+ $Tab[$num]->skill_type = $obj->skill_type;
+ $Tab[$num]->fk_object = $obj->fk_object;
+ $Tab[$num]->objectType = SkillRank::SKILLRANK_TYPE_USER;
+ $Tab[$num]->rankorder = $obj->rankorder;
$Tab[$num]->how_many_max = $objMax->how_many_max;
- $db->free($resql1);
-
$num++;
}
} else {
########## hrm/css/style.css
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/css/style.css 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/css/style.css 2025-06-27 11:43:46.973986000 +0000
@@ -24,14 +24,14 @@
}
#compare li {
- padding-top: 10px;
- padding-bottom: 10px;
+ padding: 10px;
overflow: auto;
- border-bottom: 2px solid #ccc;
+ border-bottom: 2px solid #98b880;
}
#compare ul.competence li,#compare ul.note li {
height:48px;
overflow: hidden;
+ border-bottom: 2px solid #6C286C;
}
#compare li:hover {
@@ -49,6 +49,7 @@
}
span.note {
+ font: bold Helvetica, Verdana, sans-serif;
background: #eee none repeat scroll 0 0;
border: 1px solid #ccc;
border-radius: 3px;
@@ -85,20 +86,39 @@
height: 25px;
border-width:3px;
}
-
-/* Must be same colors than into the pdf_standard_evaluation.modules.php */
-span.happy {
- background: rgb(169, 236, 201);
+span.toohappy {
+ background: #3097D1;
+ border:5px solid #3097D1;
}
span.veryhappy {
- background: rgb(20, 129, 111);
+ border:5px solid #3097D1;
+}
+span.toosad {
+ background: #ccc;
+ border:5px solid #ccc;
}
span.sad {
- background:rgb(205, 92, 92);
+ background:#bd4147;
+}
+/*span.diffnote {
+ display: inline-block;
+ background: url(img/smiley.png);
+ width:42px;
+ height: 42px;
+ overflow: hidden;
+}
+span.toohappy {
+ background-position: -105px 0px;
+}
+span.veryhappy {
+ background-position: -53px 0px;
}
span.toosad {
- background: rgb(205, 92, 92);
+ background-position: -105px -52px;
}
+span.sad {
+ background-position: 0px -52px;
+}*/
span.bubble {
background-color: #ccc;
########## hrm/evaluation_card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/evaluation_card.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/evaluation_card.php 2025-06-27 11:43:46.983114000 +0000
@@ -581,15 +581,15 @@
$Tab[$num]->required_rank = '' . $required_rank . '';
- if ($obj->userRankForSkill < 0 || $obj->required_rank < 0) {
+ if ($obj->userRankForSkill == -1) {
$title = $langs->trans('NA');
- $class .= 'na';
+ $class .= 'veryhappy diffnote';
} elseif ($obj->userRankForSkill > $obj->required_rank) {
$title = $langs->trans('MaxlevelGreaterThanShort');
- $class .= 'veryhappy';
+ $class .= 'veryhappy diffnote';
} elseif ($obj->userRankForSkill == $obj->required_rank) {
$title = $langs->trans('MaxLevelEqualToShort');
- $class .= 'happy';
+ $class .= 'happy diffnote';
} elseif ($obj->userRankForSkill < $obj->required_rank) {
$title = $langs->trans('MaxLevelLowerThanShort');
$class .= 'sad';
########## hrm/evaluation_list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/evaluation_list.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/evaluation_list.php 2025-06-27 11:43:47.041708000 +0000
@@ -91,10 +91,11 @@
// Default sort order (if not yet defined by previous GETPOST)
if (!$sortfield) {
- $sortfield = "t.ref"; // Set here default search field. By default 1st field in definition.
+ reset($object->fields); // Reset is required to avoid key() to return null.
+ $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
}
if (!$sortorder) {
- $sortorder = "DESC";
+ $sortorder = "ASC";
}
// Initialize array of search criteria
########## hrm/index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/index.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/index.php 2025-06-27 11:43:46.985277000 +0000
@@ -274,7 +274,7 @@
print ''.$userstatic->getNomUrl(-1, 'leave').' | ';
$leavecode = empty($typeleaves[$obj->fk_type]) ? 'Undefined' : $typeleaves[$obj->fk_type]['code'];
- print ''.dol_escape_htmltag($langs->trans($leavecode)).' | ';
+ print ''.dol_escape_htmltag($langs->trans($leavecode)).' | ';
$starthalfday = ($obj->halfday == -1 || $obj->halfday == 2) ? 'afternoon' : 'morning';
$endhalfday = ($obj->halfday == 1 || $obj->halfday == 2) ? 'morning' : 'afternoon';
########## hrm/skill_card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/hrm/skill_card.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/hrm/skill_card.php 2025-06-27 11:43:47.010915000 +0000
@@ -138,7 +138,6 @@
// action update on Skilldet must be done before real update action in core/actions_addupdatedelete.inc.php
$skilldetArray = GETPOST("descriptionline", "array:alphanohtml");
-
if (!$error) {
if (is_array($skilldetArray) && count($skilldetArray) > 0) {
if ($action == 'update' && $permissiontoadd) {
@@ -172,7 +171,6 @@
$arraySkill = $object->fetchLines();
'@phan-var-force Skilldet[] $arraySkill';
$index = 0;
-
foreach ($arraySkill as $skilldet) {
if ($skilldet->rankorder != 0) {
if (isset($skilldetArray[$index])) {
@@ -379,12 +377,11 @@
// $value = GETPOSTISSET($key) ? price2num(GETPOST($key, 'alphanohtml')) : $sk->$key;
// } elseif (preg_match('/^(text|html)/', $val['type'])) {
// $tmparray = explode(':', $val['type']);
- //if (!empty($tmparray[1])) {
- // $check = $tmparray[1];
- //} else {
- // $check = 'restricthtml';
- //}
- $check = 'restricthtml';
+ if (!empty($tmparray[1])) {
+ $check = $tmparray[1];
+ } else {
+ $check = 'restricthtml';
+ }
$skilldetArray = GETPOST("descriptionline", "array");
if (empty($skilldetArray)) {
########## index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/index.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/index.php 2025-06-27 11:43:48.787786000 +0000
@@ -94,16 +94,11 @@
$form = new Form($db);
}
-$appli = constant('DOL_APPLICATION_TITLE');
-$applicustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
-if ($applicustom) {
- $appli = (preg_match('/^\+/', $applicustom) ? $appli : '').$applicustom;
-} else {
- $appli .= " ".DOL_VERSION;
-}
-
// Title
-$title = $langs->trans("HomeArea").' - '.$appli;
+$title = $langs->trans("HomeArea").' - Dolibarr '.DOL_VERSION;
+if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+ $title = $langs->trans("HomeArea").' - ' . getDolGlobalString('MAIN_APPLICATION_TITLE');
+}
llxHeader('', $title);
########## knowledgemanagement/class/api_knowledgemanagement.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php 2025-06-27 11:43:57.317996000 +0000
@@ -147,7 +147,7 @@
throw new RestException(403);
}
- $socid = DolibarrApiAccess::$user->socid ?: 0;
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
########## knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php 2025-06-27 11:43:57.332875000 +0000
@@ -96,7 +96,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
@@ -134,7 +134,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
########## main.inc.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/main.inc.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/main.inc.php 2025-06-27 11:43:57.391828000 +0000
@@ -597,7 +597,7 @@
// Process error of captcha validation
if (!$ok) {
- dol_syslog('--- Security warning: Bad value for code, connection refused', LOG_NOTICE);
+ dol_syslog('Bad value for code, connection refused', LOG_NOTICE);
// Load translation files required by page
$langs->loadLangs(array('main', 'errors'));
@@ -667,13 +667,6 @@
$langs->setDefaultLang($langcode);
}
- // Test HTTP header
- if (!empty($_SERVER['HTTP_EXPOSED_CREDENTIAL_CHECK'])) {
- // TODO Read option $dolibarr_main_no_leaked_credentials with value 1, 2, ... and return
- //dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"].' refused by option $dolibarr_main_no_leaked_credentials='.$dolibarr_main_no_leaked_credentials, LOG_NOTICE);
- dol_syslog('--- Security warning: credentials reported as leaked were used to try to login. HTTP_EXPOSED_CREDENTIAL_CHECK='.((int) $_SERVER['HTTP_EXPOSED_CREDENTIAL_CHECK']), LOG_NOTICE);
- }
-
// Validation of login/pass/entity
// If ok, the variable login will be returned
// If error, we will put error message in session under the name dol_loginmesg
@@ -1653,9 +1646,8 @@
// Displays title
$appli = constant('DOL_APPLICATION_TITLE');
- $applicustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
- if ($applicustom) {
- $appli = (preg_match('/^\+/', $applicustom) ? $appli : '').$applicustom;
+ if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+ $appli = getDolGlobalString('MAIN_APPLICATION_TITLE');
}
print '';
@@ -2059,9 +2051,15 @@
// Define link to login card
$appli = constant('DOL_APPLICATION_TITLE');
- $applicustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
- if ($applicustom) {
- $appli = (preg_match('/^\+/', $applicustom) ? $appli : '').$applicustom;
+ if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+ $appli = getDolGlobalString('MAIN_APPLICATION_TITLE');
+ if (preg_match('/\d\.\d/', $appli)) {
+ if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
+ $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
+ }
+ } else {
+ $appli .= " ".DOL_VERSION;
+ }
} else {
$appli .= " ".DOL_VERSION;
}
@@ -2452,9 +2450,15 @@
// Define version to show
$appli = constant('DOL_APPLICATION_TITLE');
- $applicustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
- if ($applicustom) {
- $appli = (preg_match('/^\+/', $applicustom) ? $appli : '').$applicustom;
+ if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+ $appli = getDolGlobalString('MAIN_APPLICATION_TITLE');
+ if (preg_match('/\d\.\d/', $appli)) {
+ if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
+ $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
+ }
+ } else {
+ $appli .= " ".DOL_VERSION;
+ }
} else {
$appli .= " ".DOL_VERSION;
}
@@ -3315,18 +3319,19 @@
}
$appli = constant('DOL_APPLICATION_TITLE');
- $applicustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
- if ($applicustom) {
- $appli = (preg_match('/^\+/', $applicustom) ? $appli : '').$applicustom;
+ if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+ $appli = getDolGlobalString('MAIN_APPLICATION_TITLE');
+ $doliurl = '';
+ if (preg_match('/\d\.\d/', $appli)) {
+ if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
+ $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
+ }
+ } else {
+ $appli .= " ".DOL_VERSION;
+ }
} else {
$appli .= " ".DOL_VERSION;
}
-
- // Clean doliurl if we use a custom application name
- if ($applicustom) {
- $doliurl = '';
- }
-
print '';
- print ''; // End div tagtable
-
- print ' ';
- print '';
- print '';
+ print ' ';
print '';
} elseif ($module == 'deletemodule') {
print ''."\n";
########## modulebuilder/template/class/actions_mymodule.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/modulebuilder/template/class/actions_mymodule.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/modulebuilder/template/class/actions_mymodule.class.php 2025-06-27 11:43:57.434335000 +0000
@@ -102,9 +102,12 @@
*/
public function doActions($parameters, &$object, &$action, $hookmanager)
{
+ global $conf, $user, $langs;
+
$error = 0; // Error counter
/* print_r($parameters); print_r($object); echo "action: " . $action; */
+ // @phan-suppress-next-line PhanPluginEmptyStatementIf
if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) { // do something only for the context 'somecontext1' or 'somecontext2'
// Do what you want here...
// You can for example load and use call global vars like $fieldstosearchall to overwrite them, or update the database depending on $action and GETPOST values.
@@ -213,8 +216,7 @@
/* print_r($parameters); print_r($object); echo "action: " . $action; */
// @phan-suppress-next-line PhanPluginEmptyStatementIf
- if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) {
- // do something only for the context 'somecontext1' or 'somecontext2'
+ if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) { // do something only for the context 'somecontext1' or 'somecontext2'
}
return $ret;
########## modulebuilder/template/class/api_mymodule.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/modulebuilder/template/class/api_mymodule.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/modulebuilder/template/class/api_mymodule.class.php 2025-06-27 11:43:57.432943000 +0000
@@ -121,7 +121,7 @@
throw new RestException(403);
}
- $socid = DolibarrApiAccess::$user->socid ?: 0;
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
########## modulebuilder/template/class/myobject.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/modulebuilder/template/class/myobject.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/modulebuilder/template/class/myobject.class.php 2025-06-27 11:43:57.435959000 +0000
@@ -34,41 +34,30 @@
class MyObject extends CommonObject
{
/**
- * @var string ID of module.
+ * @var string ID of module.
*/
public $module = 'mymodule';
/**
- * @var string ID to identify managed object.
+ * @var string ID to identify managed object.
*/
public $element = 'myobject';
/**
- * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management (so extrafields know the link to the parent table).
+ * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management (so extrafields know the link to the parent table).
*/
public $table_element = 'mymodule_myobject';
/**
- * @var string If permission must be checkec with hasRight('mymodule', 'read') and not hasright('mymodyle', 'myobject', 'read'), you can uncomment this line
+ * @var string If permission must be checkec with hasRight('mymodule', 'read') and not hasright('mymodyle', 'myobject', 'read'), you can uncomment this line
*/
//public $element_for_permission = 'mymodule';
/**
- * @var string String with name of icon for myobject. Must be a 'fa-xxx' fontawesome code (or 'fa-xxx_fa_color_size') or 'myobject@mymodule' if picto is file 'img/object_myobject.png'.
+ * @var string String with name of icon for myobject. Must be a 'fa-xxx' fontawesome code (or 'fa-xxx_fa_color_size') or 'myobject@mymodule' if picto is file 'img/object_myobject.png'.
*/
public $picto = 'fa-file';
- /**
- * @var int<0,1> Does object support extrafields ? 0=No, 1=Yes
- */
- public $isextrafieldmanaged = 0;
-
- /**
- * @var int<0,1>|string|null Does this object support multicompany module ?
- * 0=No test on entity, 1=Test with field entity in local table, 'field@table'=Test entity into the field@table (example 'fk_soc@societe')
- */
- public $ismultientitymanaged = 0;
-
const STATUS_DRAFT = 0;
const STATUS_VALIDATED = 1;
@@ -123,24 +112,24 @@
* Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
- 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => 'Id', 'lang' => 'mymodule@mymodule'),
- 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => 'Reference of object', 'lang' => 'mymodule@mymodule'),
- 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 1, 'alwayseditable' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => 'Help text', 'showoncombobox' => 2, 'validate' => 1, 'lang' => 'mymodule@mymodule'),
- 'amount' => array('type' => 'price', 'label' => 'Amount', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => 1, 'default' => 'null', 'isameasure' => 1, 'help' => 'Help text for amount', 'validate' => 1, 'lang' => 'mymodule@mymodule'),
- 'qty' => array('type' => 'real', 'label' => 'Qty', 'enabled' => 1, 'position' => 45, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'css' => 'maxwidth75imp', 'help' => 'Help text for quantity', 'validate' => 1, 'lang' => 'mymodule@mymodule'),
- 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label' => 'ThirdParty', 'picto' => 'company', 'enabled' => 'isModEnabled("societe")', 'position' => 50, 'notnull' => -1, 'visible' => 1, 'index' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150', 'help' => 'OrganizationEventLinkToThirdParty', 'validate' => 1, 'lang' => 'mymodule@mymodule'),
- 'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1', 'label' => 'Project', 'picto' => 'project', 'enabled' => 'isModEnabled("project")', 'position' => 52, 'notnull' => -1, 'visible' => -1, 'index' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150', 'validate' => 1, 'lang' => 'mymodule@mymodule'),
- 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 3, 'validate' => 1, 'lang' => 'mymodule@mymodule'),
- 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 61, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => 1, 'lang' => 'mymodule@mymodule'),
- 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 62, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => 1, 'lang' => 'mymodule@mymodule'),
- 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -2, 'lang' => 'mymodule@mymodule'),
- 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => -2, 'lang' => 'mymodule@mymodule'),
- 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'picto' => 'user', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => '0', 'csslist' => 'tdoverflowmax150', 'lang' => 'mymodule@mymodule'),
- 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'picto' => 'user', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2, 'csslist' => 'tdoverflowmax150', 'lang' => 'mymodule@mymodule'),
- 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => 0, 'lang' => 'mymodule@mymodule'),
- 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2, 'lang' => 'mymodule@mymodule'),
- 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'position' => 1010, 'notnull' => -1, 'visible' => 0, 'lang' => 'mymodule@mymodule'),
- 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', '1' => 'Validated', 9 => 'Canceled'), 'validate' => 1, 'lang' => 'mymodule@mymodule'),
+ 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => 'Id'),
+ 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => 'Reference of object'),
+ 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 1, 'alwayseditable' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => 'Help text', 'showoncombobox' => 2, 'validate' => 1,),
+ 'amount' => array('type' => 'price', 'label' => 'Amount', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => 1, 'default' => 'null', 'isameasure' => 1, 'help' => 'Help text for amount', 'validate' => 1,),
+ 'qty' => array('type' => 'real', 'label' => 'Qty', 'enabled' => 1, 'position' => 45, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'css' => 'maxwidth75imp', 'help' => 'Help text for quantity', 'validate' => 1,),
+ 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label' => 'ThirdParty', 'picto' => 'company', 'enabled' => 'isModEnabled("societe")', 'position' => 50, 'notnull' => -1, 'visible' => 1, 'index' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150', 'help' => 'OrganizationEventLinkToThirdParty', 'validate' => 1,),
+ 'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1', 'label' => 'Project', 'picto' => 'project', 'enabled' => 'isModEnabled("project")', 'position' => 52, 'notnull' => -1, 'visible' => -1, 'index' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150', 'validate' => 1,),
+ 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 3, 'validate' => 1,),
+ 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 61, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => 1,),
+ 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 62, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => 1,),
+ 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -2,),
+ 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => -2,),
+ 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'picto' => 'user', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => '0', 'csslist' => 'tdoverflowmax150',),
+ 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'picto' => 'user', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2, 'csslist' => 'tdoverflowmax150',),
+ 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => 0,),
+ 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,),
+ 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'position' => 1010, 'notnull' => -1, 'visible' => 0,),
+ 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', '1' => 'Validated', 9 => 'Canceled'), 'validate' => 1,),
);
/**
@@ -251,6 +240,8 @@
global $langs;
$this->db = $db;
+ $this->ismultientitymanaged = 0;
+ $this->isextrafieldmanaged = 1;
if (!getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid']) && !empty($this->fields['ref'])) {
$this->fields['rowid']['visible'] = 0;
########## modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php 2025-06-27 11:43:57.449716000 +0000
@@ -97,7 +97,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) { // @phan-suppress-current-line PhanPluginEmptyStatementIf
+ } elseif ($object->ismultientitymanaged == 2) { // @phan-suppress-current-line PhanPluginEmptyStatementIf
// TODO
}
@@ -135,7 +135,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
########## modulebuilder/template/myobject_list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/modulebuilder/template/myobject_list.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/modulebuilder/template/myobject_list.php 2025-06-27 11:43:57.501437000 +0000
@@ -162,8 +162,8 @@
}
}
-// List of fields to search into when doing a "search in all"
$fieldstosearchall = array();
+// List of fields to search into when doing a "search in all"
// foreach ($object->fields as $key => $val) {
// if (!empty($val['searchall'])) {
// $fieldstosearchall['t.'.$key] = $val['label'];
@@ -850,13 +850,7 @@
} elseif ($key == 'rowid') {
print $object->showOutputField($val, $key, (string) $object->id, '');
} else {
- if ($val['type'] == 'html') {
- print '';
- }
print $object->showOutputField($val, $key, (string) $object->$key, '');
- if ($val['type'] == 'html') {
- print ' ';
- }
}
print '';
if (!$i) {
########## mrp/class/api_mos.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/mrp/class/api_mos.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/mrp/class/api_mos.class.php 2025-06-27 11:43:57.682041000 +0000
@@ -108,7 +108,7 @@
$obj_ret = array();
$tmpobject = new Mo($this->db);
- $socid = DolibarrApiAccess::$user->socid ?: 0;
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
########## mrp/class/mo.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/mrp/class/mo.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/mrp/class/mo.class.php 2025-06-27 11:43:57.684180000 +0000
@@ -2045,10 +2045,7 @@
if ($this->status != Mo::STATUS_VALIDATED && $this->status != Mo::STATUS_INPROGRESS) {
return false;
}
- if (empty($this->date_end_planned)) {
- return false;
- }
- return (dol_now() > ((int) $this->date_end_planned + $conf->mrp->progress->warning_delay));
+ return (dol_now() > ($this->date_end_planned + $conf->mrp->progress->warning_delay));
}
########## mrp/mo_list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/mrp/mo_list.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/mrp/mo_list.php 2025-06-27 11:43:57.693323000 +0000
@@ -32,6 +32,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
+
// load mrp libraries
require_once __DIR__.'/class/mo.class.php';
@@ -57,7 +58,6 @@
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$mode = GETPOST('mode', 'alpha');
-$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'
$id = GETPOSTINT('id');
@@ -65,7 +65,7 @@
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
-$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page');
+$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
$also_cancel_consumed_and_produced_lines = (GETPOST('alsoCancelConsumedAndProducedLines', 'alpha') ? 1 : 0);
$changeDate = GETPOST('change_date', 'alpha');
@@ -128,16 +128,15 @@
}
// Definition of array of fields for columns
-$tableprefix = 't';
$arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval((string) $val['visible'], 1);
- $arrayfields[$tableprefix.'.'.$key] = array(
+ $arrayfields['t.'.$key] = array(
'label' => $val['label'],
- 'checked' => (($visible < 0) ? '0' : '1'),
- 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
+ 'checked' => (($visible < 0) ? 0 : 1),
+ 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
'position' => $val['position'],
'help' => isset($val['help']) ? $val['help'] : ''
);
@@ -145,7 +144,7 @@
if ($key == 'fk_parent_line') {
$visible = (int) dol_eval((string) $val['visible'], 1);
- $arrayfields[$tableprefix.'.'.$key] = array(
+ $arrayfields['t.'.$key] = array(
'label' => $val['label'],
'checked' => (($visible <= 0) ? 0 : 1),
'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
@@ -183,7 +182,7 @@
$massaction = '';
}
-$parameters = array('arrayfields' => &$arrayfields);
+$parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -307,8 +306,8 @@
// Build and execute select
// --------------------------------------------------------------------
-$sql = "SELECT ";
-$sql .= " ".$object->getFieldList('t');
+$sql = 'SELECT ';
+$sql .= $object->getFieldList('t');
// Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
@@ -323,13 +322,13 @@
$sqlfields = $sql; // $sql fields to remove for count total
-$sql .= " FROM ".$db->prefix().$object->table_element." as t";
+$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)";
}
-$sql .= " LEFT JOIN ".$db->prefix()."mrp_production as lineparent ON t.fk_parent_line = lineparent.rowid";
-$sql .= " LEFT JOIN ".$db->prefix()."mrp_mo as moparent ON lineparent.fk_mo = moparent.rowid";
-$sql .= " LEFT JOIN ".$db->prefix()."product as p ON t.fk_product = p.rowid";
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_production as lineparent ON t.fk_parent_line = lineparent.rowid";
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_mo as moparent ON lineparent.fk_mo = moparent.rowid";
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON t.fk_product = p.rowid";
// Add table from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
@@ -432,7 +431,7 @@
dol_print_error($db);
}
- if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
+ if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}
@@ -482,9 +481,6 @@
if ($optioncss != '') {
$param .= '&optioncss='.urlencode($optioncss);
}
-if ($groupby != '') {
- $param .= '&groupby='.urlencode($groupby);
-}
foreach ($search as $key => $val) {
if (is_array($search[$key])) {
foreach ($search[$key] as $skey) {
@@ -493,9 +489,9 @@
}
}
} elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
- $param .= '&search_'.$key.'month='.GETPOSTINT('search_'.$key.'month');
- $param .= '&search_'.$key.'day='.GETPOSTINT('search_'.$key.'day');
- $param .= '&search_'.$key.'year='.GETPOSTINT('search_'.$key.'year');
+ $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int'));
+ $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int'));
+ $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int'));
} elseif ($search[$key] != '') {
$param .= '&search_'.$key.'='.urlencode($search[$key]);
}
@@ -674,7 +670,7 @@
}
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
- print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth125', 1);
+ print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1);
} elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
print '';
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
@@ -726,10 +722,9 @@
$cssforfield .= ($cssforfield ? ' ' : '').'center';
} elseif (in_array($val['type'], array('timestamp'))) {
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
- } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
+ } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
$cssforfield .= ($cssforfield ? ' ' : '').'right';
}
- $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
if (!empty($arrayfields['t.'.$key]['checked'])) {
if ($key == "fk_product") {
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 'p.ref', '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
@@ -742,7 +737,7 @@
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
-$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
+$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
@@ -784,7 +779,7 @@
$object->setVarsFromFetchObj($obj);
- if ($mode == 'kanban' || $mode == 'kanbangroupby') {
+ if ($mode == 'kanban') {
if ($i == 0) {
print '';
print '';
@@ -856,7 +851,7 @@
if (!empty($arrayfields['t.'.$key]['checked'])) {
print ' $key)) {
- print ' title="'.dolPrintHTMLForAttribute((string) $object->$key).'"';
+ print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
}
print '>';
if ($key == 'status') {
@@ -869,14 +864,7 @@
} elseif ($key == 'rowid') {
print $object->showOutputField($val, $key, (string) $object->id, '');
} else {
- if ($val['type'] == 'html') {
- print ' ';
- }
print $object->showOutputField($val, $key, (string) $object->$key, '');
- if ($val['type'] == 'html') {
- print ' ';
- }
-
if ($key == 'date_end_planned' && $object->hasDelay()) {
print img_warning($langs->trans('Alert').' - '.$langs->trans('Late'));
}
@@ -946,7 +934,7 @@
$db->free($resql);
$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
-$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print ' | | '."\n";
########## mrp/mo_movements.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/mrp/mo_movements.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/mrp/mo_movements.php 2025-06-27 11:43:57.695015000 +0000
@@ -97,7 +97,7 @@
$object = new Mo($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id;
-$hookmanager->initHooks(array('mocard', 'globalcard', 'mocardmovelist' )); // Note that conf->hooks_modules contains array
+$hookmanager->initHooks(array('mocard', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@@ -966,7 +966,7 @@
// Inventory code
if (!empty($arrayfields['m.inventorycode']['checked'])) {
print '';
- //print '';
+ //print '';
print dol_escape_htmltag($objp->inventorycode);
//print '';
print ' | ';
########## partnership/class/api_partnerships.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/partnership/class/api_partnerships.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/partnership/class/api_partnerships.class.php 2025-06-27 11:43:57.521976000 +0000
@@ -113,7 +113,7 @@
throw new RestException(403);
}
- $socid = DolibarrApiAccess::$user->socid ?: 0;
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
########## partnership/core/modules/partnership/mod_partnership_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php 2025-06-27 11:43:57.531293000 +0000
@@ -97,7 +97,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
@@ -135,7 +135,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
########## paypal/lib/paypal.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/paypal/lib/paypal.lib.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/paypal/lib/paypal.lib.php 2025-06-27 11:43:59.592903000 +0000
@@ -459,7 +459,7 @@
// TODO problem with triggers
$API_version = "98.0";
- if (getDolGlobalString('PAYPAL_API_SANDBOX')/* || GETPOST('forcesandbox', 'alpha') */) { // We can force sand box with param 'forcesandbox'
+ if (getDolGlobalString('PAYPAL_API_SANDBOX') || GETPOST('forcesandbox', 'alpha')) { // We can force sand box with param 'forcesandbox'
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
$API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
} else {
########## paypal/lib/paypalfunctions.lib.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/paypal/lib/paypalfunctions.lib.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/paypal/lib/paypalfunctions.lib.php 2025-06-27 11:43:59.593938000 +0000
@@ -49,7 +49,7 @@
' For the sandbox, the URL is https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=
' For the live site, the URL is https://www.paypal.com/webscr&cmd=_express-checkout&token=
*/
-if (getDolGlobalString('PAYPAL_API_SANDBOX')/* || GETPOST('forcesandbox', 'alpha') */) { // We can force sand box with param 'forcesandbox'
+if (getDolGlobalString('PAYPAL_API_SANDBOX') || GETPOST('forcesandbox', 'alpha')) { // We can force sand box with param 'forcesandbox'
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
$API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
} else {
########## product/ajax/products.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/ajax/products.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/ajax/products.php 2025-06-27 11:43:59.716228000 +0000
@@ -184,7 +184,7 @@
$sql .= " WHERE fk_product = ".((int) $id);
$sql .= " AND entity IN (".getEntity('productprice').")";
$sql .= " AND price_level = ".((int) $price_level);
- $sql .= " ORDER BY date_price DESC, rowid";
+ $sql .= " ORDER BY date_price";
$sql .= " DESC LIMIT 1";
$result = $db->query($sql);
########## product/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/card.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/card.php 2025-06-27 11:43:59.629832000 +0000
@@ -1363,18 +1363,6 @@
$sellOrEatByMandatoryList = null;
if (isModEnabled('productbatch')) {
$sellOrEatByMandatoryList = Product::getSellOrEatByMandatoryList();
-
- $disableSellBy = getDolGlobalString('PRODUCT_DISABLE_SELLBY');
- $disableEatBy = getDolGlobalString('PRODUCT_DISABLE_EATBY');
-
- if ($disableSellBy) {
- unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_BY]);
- unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT]);
- }
- if ($disableEatBy) {
- unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_EAT_BY]);
- unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT]);
- }
}
$title = $langs->trans('ProductServiceCard');
########## product/class/api_products.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/class/api_products.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/class/api_products.class.php 2025-06-27 11:43:59.748232000 +0000
@@ -3,7 +3,6 @@
* Copyright (C) 2019 Cedric Ancelin
* Copyright (C) 2024 Frédéric France
* Copyright (C) 2024-2025 MDW
- * Copyright (C) 2025 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
@@ -197,13 +196,15 @@
*/
public function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $sqlfilters = '', $ids_only = false, $variant_filter = 0, $pagination_data = false, $includestockdata = 0, $properties = '')
{
+ global $db, $conf;
+
if (!DolibarrApiAccess::$user->hasRight('produit', 'lire')) {
throw new RestException(403);
}
$obj_ret = array();
- $socid = DolibarrApiAccess::$user->socid ?: '';
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
$sql = "SELECT t.rowid, t.ref, t.ref_ext";
$sql .= " FROM ".$this->db->prefix()."product as t";
@@ -450,10 +451,8 @@
if ($this->product->tva_npr != $oldproduct->tva_npr) {
$pricemodified = true;
}
- if (!empty($this->product->default_vat_code)) {
- if ($this->product->default_vat_code != $oldproduct->default_vat_code) {
- $pricemodified = true;
- }
+ if ($this->product->default_vat_code != $oldproduct->default_vat_code) {
+ $pricemodified = true;
}
if ($this->product->price_base_type == 'TTC') {
@@ -799,7 +798,7 @@
throw new RestException(400, 'API not available: this mode of pricing is not enabled by setup');
}
- $socid = DolibarrApiAccess::$user->socid ?: '';
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
if ($socid > 0 && $socid != $thirdparty_id) {
throw new RestException(403, 'Getting prices for all customers or for the customer ID '.$thirdparty_id.' is not allowed for login '.DolibarrApiAccess::$user->login);
}
@@ -919,7 +918,7 @@
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
- $socid = DolibarrApiAccess::$user->socid ?: '';
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
if ($socid > 0 && $socid != $fourn_id) {
throw new RestException(403, 'Adding purchase price for the supplier ID '.$fourn_id.' is not allowed for login '.DolibarrApiAccess::$user->login);
}
@@ -1017,7 +1016,7 @@
$obj_ret = array();
// Force id of company for external users
- $socid = DolibarrApiAccess::$user->socid ?: '';
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
if ($socid > 0) {
if ($supplier != $socid || empty($supplier)) {
throw new RestException(403, 'As an external user, you can request only for your supplier id = '.$socid);
@@ -1130,7 +1129,7 @@
throw new RestException(403);
}
- $socid = DolibarrApiAccess::$user->socid ?: '';
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
$result = $this->product->fetch($id, $ref, $ref_ext, $barcode);
if (!$result) {
########## product/class/product.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/class/product.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/class/product.class.php 2025-06-27 11:43:59.745911000 +0000
@@ -363,14 +363,12 @@
/**
* Cost price
*
- * @var ?float
+ * @var float
*/
public $cost_price;
/**
- * Average price value for product entry into stock (PMP)
- *
- * @var ?float
+ * @var float Average price value for product entry in stock (PMP)
*/
public $pmp;
@@ -783,7 +781,7 @@
*
* @var array>
*/
- public $sousprods = array();
+ public $sousprods;
/**
* @var array,entity:CommonObject}> Path of subproducts. Build from ->sousprods with get_arbo_each_prod()
@@ -1958,9 +1956,9 @@
}
/**
- * Get the array of labels of Sell by or Eat by all mandatory flags for each status
+ * Get sell or eat by mandatory list
*
- * @return array{0:string,1:string,2:string,3:string} Array of labels of Sell by or Eat by all mandatory flags
+ * @return array{0:string,1:string,2:string,3:string} Sell or eat by mandatory list
*/
public static function getSellOrEatByMandatoryList()
{
@@ -1977,9 +1975,9 @@
}
/**
- * Get the label for sell by or eat by mandatory flag of the current product
+ * Get sell or eat by mandatory label
*
- * @return string Sell or eat by mandatory label
+ * @return string Sell or eat by mandatory label
*/
public function getSellOrEatByMandatoryLabel()
{
@@ -1996,8 +1994,8 @@
/**
* Update or add a translation for a product
*
- * @param User $user Object user making update
- * @return int Return integer <0 if KO, >0 if OK
+ * @param User $user Object user making update
+ * @return int Return integer <0 if KO, >0 if OK
*/
public function setMultiLangs($user)
{
@@ -3058,7 +3056,7 @@
$this->price_min = $obj->price_min;
$this->price_min_ttc = $obj->price_min_ttc;
$this->price_base_type = $obj->price_base_type;
- $this->cost_price = isset($obj->cost_price) ? (float) $obj->cost_price : null;
+ $this->cost_price = $obj->cost_price;
$this->default_vat_code = $obj->default_vat_code;
$this->tva_tx = $obj->tva_tx;
//! French VAT NPR
@@ -6111,7 +6109,7 @@
* @param float $nbpiece nb of units (should be always positive, use $movement to decide if we add or remove)
* @param int<0,1> $movement 0 = add, 1 = remove
* @param string $label Label of stock movement
- * @param int|float $price Unit price HT of product, used to calculate average weighted price (PMP in french). If 0, average weighted price is not changed.
+ * @param float $price Unit price HT of product, used to calculate average weighted price (PMP in french). If 0, average weighted price is not changed.
* @param string $inventorycode Inventory code
* @param string $origin_element Origin element type
* @param ?int $origin_id Origin id of element
@@ -6167,22 +6165,22 @@
/**
* Adjust stock in a warehouse for product with batch number
*
- * @param User $user User asking change
- * @param int $id_entrepot Id of warehouse
- * @param float $nbpiece Nb of units (should be always positive, use $movement to decide if we add or remove)
- * @param int<0,1> $movement 0 = add, 1 = remove
- * @param string $label Label of stock movement
- * @param int|float $price Price to use for stock eval
- * @param int|string $dlc eat-by date
- * @param int|string $dluo sell-by date
- * @param string $lot Lot number
- * @param string $inventorycode Inventory code
- * @param string $origin_element Origin element type
- * @param ?int $origin_id Origin id of element
- * @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (useful only if product is a subproduct)
- * @param ?ExtraFields $extrafields Array of extrafields
- * @param boolean $force_update_batch Force update batch
- * @return int Return integer <0 if KO, >0 if OK
+ * @param User $user user asking change
+ * @param int $id_entrepot id of warehouse
+ * @param float $nbpiece nb of units (should be always positive, use $movement to decide if we add or remove)
+ * @param int<0,1> $movement 0 = add, 1 = remove
+ * @param string $label Label of stock movement
+ * @param float $price Price to use for stock eval
+ * @param int|string $dlc eat-by date
+ * @param int|string $dluo sell-by date
+ * @param string $lot Lot number
+ * @param string $inventorycode Inventory code
+ * @param string $origin_element Origin element type
+ * @param ?int $origin_id Origin id of element
+ * @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (useful only if product is a subproduct)
+ * @param ?ExtraFields $extrafields Array of extrafields
+ * @param boolean $force_update_batch Force update batch
+ * @return int Return integer <0 if KO, >0 if OK
*/
public function correct_stock_batch($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $dlc = '', $dluo = '', $lot = '', $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null, $force_update_batch = false)
{
########## product/inventory/inventory.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/inventory/inventory.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/inventory/inventory.php 2025-06-27 11:43:59.768611000 +0000
@@ -1149,7 +1149,7 @@
}
$pmp_valuation = $pmp_expected * $valuetoshow;
print '';
- print is_null($pmp_expected) ? '' : price($pmp_expected);
+ print price($pmp_expected);
print '';
print ' | ';
print '';
@@ -1171,7 +1171,7 @@
$pmp_real = $product_static->pmp;
}
$pmp_valuation_real = $pmp_real * $qty_view;
- print '';
+ print '';
print ' | ';
print '';
print '';
@@ -1198,7 +1198,7 @@
print ' | ';
} else {
if (getDolGlobalString('INVENTORY_MANAGE_REAL_PMP')) {
- // PMP Expected
+ //PMP Expected
if (!empty($obj->pmp_expected)) {
$pmp_expected = $obj->pmp_expected;
} else {
@@ -1206,7 +1206,7 @@
}
$pmp_valuation = $pmp_expected * $valuetoshow;
print '';
- print is_null($pmp_expected) ? '' : price($pmp_expected);
+ print price($pmp_expected);
print ' | ';
print '';
print price($pmp_valuation);
@@ -1216,7 +1216,7 @@
print $obj->qty_view; // qty found
print ' | ';
- // PMP Real
+ //PMP Real
print '';
if (!empty($obj->pmp_real)) {
$pmp_real = $obj->pmp_real;
@@ -1224,7 +1224,7 @@
$pmp_real = $product_static->pmp;
}
$pmp_valuation_real = $pmp_real * $obj->qty_view;
- print is_null($pmp_real) ? '' : price($pmp_real);
+ print price($pmp_real);
print ' | ';
print '';
print price($pmp_valuation_real);
########## product/stats/commande_fournisseur.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stats/commande_fournisseur.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stats/commande_fournisseur.php 2025-06-27 11:43:59.732485000 +0000
@@ -279,7 +279,6 @@
$supplierorderstatic->id = $objp->commandeid;
$supplierorderstatic->ref = $objp->ref;
-
$supplierorderstatic->statut = $objp->status; // deprecated
$supplierorderstatic->status = $objp->status;
$supplierorderstatic->billed = $objp->billed;
########## product/stock/class/api_stockmovements.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/class/api_stockmovements.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/class/api_stockmovements.class.php 2025-06-27 11:43:59.701992000 +0000
@@ -48,7 +48,7 @@
*/
public function __construct()
{
- global $db;
+ global $db, $conf;
$this->db = $db;
$this->stockmovement = new MouvementStock($this->db);
}
@@ -89,7 +89,7 @@
* @param string $sortorder Sort order
* @param int $limit Limit for list
* @param int $page Page number
- * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.fk_product:=:1) and (t.date_creation:<:'20160101')"
+ * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.product_id:=:1) and (t.date_creation:<:'20160101')"
* @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names
* @return array Array of warehouse objects
* @phan-return MouvementStock[]
@@ -99,6 +99,8 @@
*/
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
{
+ global $conf;
+
$obj_ret = array();
if (!DolibarrApiAccess::$user->hasRight('stock', 'lire')) {
@@ -170,8 +172,8 @@
* @param string $dluo Sell-by date. {@from body} {@type date}
* @param string $origin_type Origin type (Element of source object, like 'project', 'inventory', ...)
* @param int $origin_id Origin id (Id of source object)
- * @return int ID of stock movement
*
+ * @return int ID of stock movement
* @throws RestException
*/
public function post($product_id, $warehouse_id, $qty, $type = 2, $lot = '', $movementcode = '', $movementlabel = '', $price = '', $datem = '', $dlc = '', $dluo = '', $origin_type = '', $origin_id = 0)
########## product/stock/class/api_warehouses.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/class/api_warehouses.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/class/api_warehouses.class.php 2025-06-27 11:43:59.700767000 +0000
@@ -46,7 +46,7 @@
*/
public function __construct()
{
- global $db;
+ global $db, $conf;
$this->db = $db;
$this->warehouse = new Entrepot($this->db);
}
@@ -99,6 +99,8 @@
*/
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $category = 0, $sqlfilters = '', $properties = '')
{
+ global $db, $conf;
+
$obj_ret = array();
if (!DolibarrApiAccess::$user->hasRight('stock', 'lire')) {
@@ -286,6 +288,9 @@
// phpcs:enable
$object = parent::_cleanObjectDatas($object);
+ // Remove the subscriptions because they are handled as a subresource.
+ //unset($object->subscriptions);
+
return $object;
}
########## product/stock/class/mouvementstock.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/class/mouvementstock.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/class/mouvementstock.class.php 2025-06-27 11:43:59.698264000 +0000
@@ -205,7 +205,7 @@
* 0=input (stock increase by a stock transfer), 1=output (stock decrease by a stock transfer),
* 2=output (stock decrease), 3=input (stock increase)
* Note that qty should be > 0 with 0 or 3, < 0 with 1 or 2.
- * @param int|float $price Unit price HT of product, used to calculate average weighted price (AWP or PMP in french). If 0, average weighted price is not changed.
+ * @param float $price Unit price HT of product, used to calculate average weighted price (AWP or PMP in french). If 0, average weighted price is not changed.
* @param string $label Label of stock movement
* @param string $inventorycode Inventory code
* @param int|string $datem Force date of movement
########## product/stock/massstockmove.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/massstockmove.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/massstockmove.php 2025-06-27 11:43:59.684499000 +0000
@@ -216,7 +216,7 @@
// Define value of products moved
$pricesrc = 0;
if (!empty($product->pmp)) {
- $pricesrc = (float) $product->pmp;
+ $pricesrc = $product->pmp;
}
$pricedest = $pricesrc;
########## product/stock/movement_list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/movement_list.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/movement_list.php 2025-06-27 11:43:59.646684000 +0000
@@ -400,6 +400,8 @@
if ($product->hasbatch()) {
$batch = GETPOST('batch_number', 'alphanohtml');
+ //$eatby=GETPOST('eatby');
+ //$sellby=GETPOST('sellby');
$eatby = dol_mktime(0, 0, 0, GETPOSTINT('eatbymonth'), GETPOSTINT('eatbyday'), GETPOSTINT('eatbyyear'));
$sellby = dol_mktime(0, 0, 0, GETPOSTINT('sellbymonth'), GETPOSTINT('sellbyday'), GETPOSTINT('sellbyyear'));
@@ -508,16 +510,17 @@
if ($product->hasbatch()) {
$pdluo = new Productbatch($db);
- $srcwarehouseid = 0;
-
- $eatby = dol_mktime(0, 0, 0, GETPOSTINT('eatbymonth'), GETPOSTINT('eatbyday'), GETPOSTINT('eatbyyear'));
- $sellby = dol_mktime(0, 0, 0, GETPOSTINT('sellbymonth'), GETPOSTINT('sellbyday'), GETPOSTINT('sellbyyear'));
+ $srcwarehouseid = 0;
+ $eatby = -1;
+ $sellby = -1;
if ($pdluoid > 0) {
$result = $pdluo->fetch($pdluoid);
if ($result) {
$srcwarehouseid = $pdluo->warehouseid;
$batch = $pdluo->batch;
+ $eatby = $pdluo->eatby;
+ $sellby = $pdluo->sellby;
} else {
setEventMessages($pdluo->error, $pdluo->errors, 'errors');
$error++;
@@ -525,6 +528,8 @@
} else {
$srcwarehouseid = $id;
$batch = GETPOST('batch_number', 'alphanohtml');
+ $eatby = $d_eatby;
+ $sellby = $d_sellby;
}
$result1 = -1;
@@ -537,7 +542,7 @@
GETPOSTFLOAT("nbpiece"),
1,
GETPOST("label", 'san_alpha'),
- (float) $pricesrc,
+ $pricesrc,
$eatby,
$sellby,
$batch,
@@ -554,7 +559,7 @@
GETPOSTFLOAT("nbpiece"),
0,
GETPOST("label", 'san_alpha'),
- (float) $pricedest,
+ $pricedest,
$eatby,
$sellby,
$batch,
@@ -573,7 +578,7 @@
GETPOSTFLOAT("nbpiece"),
1,
GETPOST("label", 'san_alpha'),
- (float) $pricesrc,
+ $pricesrc,
GETPOST('inventorycode', 'alphanohtml'),
'',
null,
@@ -588,7 +593,7 @@
GETPOSTFLOAT("nbpiece"),
0,
GETPOST("label", 'san_alpha'),
- (float) $pricedest,
+ $pricedest,
GETPOST('inventorycode', 'alphanohtml'),
'',
null,
@@ -826,6 +831,10 @@
}
}
+
+// Output page
+// --------------------------------------------------------------------
+
$i = 0;
$help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
if ($msid) {
@@ -992,8 +1001,6 @@
// Transfer of units
if ($action == "transfert") {
- $d_eatby = GETPOSTDATE('eatby'); // used by the tpl
- $d_sellby = GETPOSTDATE('sellby'); // used by the tpl
include DOL_DOCUMENT_ROOT.'/product/stock/tpl/stocktransfer.tpl.php';
print ' ';
}
########## product/stock/product.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/product.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/product.php 2025-06-27 11:43:59.648494000 +0000
@@ -434,7 +434,7 @@
(float) $nbpiece,
1,
GETPOST("label", 'alphanohtml'),
- (float) $pricesrc,
+ $pricesrc,
$eatby,
$sellby,
$batch,
@@ -452,7 +452,7 @@
(float) $nbpiece,
0,
GETPOST("label", 'alphanohtml'),
- (float) $pricedest,
+ $pricedest,
$eatby,
$sellby,
(string) $batch,
@@ -471,7 +471,7 @@
(float) $nbpiece,
1,
GETPOST("label", 'alphanohtml'),
- (float) $pricesrc,
+ $pricesrc,
GETPOST('inventorycode', 'alphanohtml')
);
if ($result1 < 0) {
@@ -486,7 +486,7 @@
(float) $nbpiece,
0,
GETPOST("label", 'alphanohtml'),
- (float) $pricedest,
+ $pricedest,
GETPOST('inventorycode', 'alphanohtml')
);
if ($result2 < 0) {
########## product/stock/stockatdate.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/stockatdate.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/stockatdate.php 2025-06-27 11:43:59.654222000 +0000
@@ -504,12 +504,6 @@
// Fields title search
print ' | ';
- if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print '| ';
- $searchpicto = $form->showFilterButtons('left');
- print $searchpicto;
- print ' | ';
- }
print ' | ';
print ' | ';
print ' | ';
@@ -526,13 +520,10 @@
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
- // Action column
- if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print '';
- $searchpicto = $form->showFilterButtons();
- print $searchpicto;
- print ' | ';
- }
+ print '';
+ $searchpicto = $form->showFilterAndCheckAddButtons(0);
+ print $searchpicto;
+ print ' | ';
print ' ';
$fieldtosortcurrentstock = 'stock';
@@ -542,10 +533,6 @@
// Lines of title
print '';
- // Action column
- if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'left ');
- }
print_liste_field_titre('ProductRef', $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder);
print_liste_field_titre('Label', $_SERVER["PHP_SELF"], 'p.label', $param, '', '', $sortfield, $sortorder);
@@ -570,10 +557,7 @@
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
- // Action column
- if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right ');
- }
+ print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right ');
print " \n";
}
@@ -674,11 +658,6 @@
} else {
print '';
- // Action column
- if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print ' | ';
- }
-
// Product ref
print ''.$prod->getNomUrl(1, '').' | ';
@@ -771,10 +750,8 @@
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
- // Action column
- if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print ' | ';
- }
+ // Action
+ print ' | ';
print ' '."\n";
}
########## product/stock/tpl/stocktransfer.tpl.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/product/stock/tpl/stocktransfer.tpl.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/product/stock/tpl/stocktransfer.tpl.php 2025-06-27 11:43:59.673978000 +0000
@@ -15,20 +15,20 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
+ *
+ * $object must be defined
+ * $backtopage
*/
/**
* @var Conf $conf
* @var DoliDB $db
* @var Form $form
+ * @var Product|MouvementStock $object
* @var FormProduct $formproduct
* @var Translate $langs
- * @var Product|Entrepot|MouvementStock $object
*
- * @var string $backtopage
- * @var ?int $id
- * @var int $d_eatby
- * @var int $d_sellby
+ * @var string $backtopage
*/
// Protection to avoid direct call of template
@@ -38,7 +38,7 @@
}
'
-@phan-var-force Entrepot|Product|MouvementStock $object
+@phan-var-force Entrepot|MouvementStock $object
@phan-var-force FormProduct $formproduct
@phan-var-force string $backtopage
';
@@ -86,7 +86,7 @@
}
print '';
-// Source product or stock movement
+// Source warehouse or product
print '';
if ($object->element == 'product') {
/** @var Product $object */
########## projet/class/api_projects.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/projet/class/api_projects.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/projet/class/api_projects.class.php 2025-06-27 11:43:57.742629000 +0000
@@ -209,7 +209,7 @@
$obj_ret = array();
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
- $socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+ $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
########## projet/class/api_tasks.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/projet/class/api_tasks.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/projet/class/api_tasks.class.php 2025-06-27 11:43:57.743993000 +0000
@@ -120,7 +120,7 @@
$obj_ret = array();
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
- $socids = DolibarrApiAccess::$user->socid ?: 0;
+ $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
@@ -500,7 +500,6 @@
* @return array
* @phan-return array{success:array{code:int,message:string}}
* @phpstan-return array{success:array{code:int,message:string}}
- * @throws RestException
*/
public function delete($id)
{
@@ -516,7 +515,7 @@
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
- if ($this->task->delete(DolibarrApiAccess::$user) <= 0) {
+ if (!$this->task->delete(DolibarrApiAccess::$user)) {
throw new RestException(500, 'Error when delete task : '.$this->task->error);
}
########## projet/class/project.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/projet/class/project.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/projet/class/project.class.php 2025-06-27 11:43:57.736832000 +0000
@@ -1415,7 +1415,7 @@
*
* @param int<0,2> $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param string $option Variant where the link point to ('', 'nolink')
- * @param int $addlabel 0=Default, 1=Add label into string, n>1=Add the n first chars of label in ref, -1=Label replace the ref
+ * @param int $addlabel 0=Default, 1=Add label into string, >1=Add first chars into string
* @param string $moreinpopup Text to add into popup
* @param string $sep Separator between ref and label if option addlabel is set
* @param int<0,1> $notooltip 1=Disable tooltip
@@ -1505,15 +1505,11 @@
$result .= img_object(($notooltip ? '' : $label), $picto, 'class="pictofixedwidth em088"', 0, 0, $notooltip ? 0 : 1);
}
if ($withpicto != 2) {
- if ($addlabel >= 0) {
- $result .= $this->ref;
- } else {
- $result .= $this->title;
- }
+ $result .= $this->ref;
}
$result .= $linkend;
if ($withpicto != 2) {
- $result .= (($addlabel > 0 && $this->title) ? ''.$sep.dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)).'' : '');
+ $result .= (($addlabel && $this->title) ? ''.$sep.dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)).'' : '');
}
global $action;
########## projet/class/task.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/projet/class/task.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/projet/class/task.class.php 2025-06-27 11:43:57.740919000 +0000
@@ -1010,7 +1010,7 @@
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param string $option 'withproject' or ''
* @param string $mode Mode 'task', 'time', 'contact', 'note', document' define page to link to.
- * @param int $addlabel 0=Default, 1=Add label into string, >1=Add first chars into string, -1=Label replace the ref
+ * @param int $addlabel 0=Default, 1=Add label into string, >1=Add first chars into string
* @param string $sep Separator between ref and label if option addlabel is set
* @param int $notooltip 1=Disable tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
@@ -1072,15 +1072,11 @@
$result .= img_object(($notooltip ? '' : $label), $picto, 'class="paddingright"', 0, 0, $notooltip ? 0 : 1);
}
if ($withpicto != 2) {
- if ($addlabel >= 0) {
- $result .= $this->ref;
- } else {
- $result .= $this->label;
- }
+ $result .= $this->ref;
}
$result .= $linkend;
if ($withpicto != 2) {
- $result .= (($addlabel > 0 && $this->label) ? ''.$sep.dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)).'' : '');
+ $result .= (($addlabel && $this->label) ? $sep.dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
}
$parameters = array('id' => $this->id, 'getnomurl' => &$result);
########## projet/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/projet/list.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/projet/list.php 2025-06-27 11:43:57.759581000 +0000
@@ -105,7 +105,8 @@
$pagenext = $page + 1;
$search_all = GETPOST('search_all', 'alphanohtml');
-$search_entity = GETPOSTINT('search_entity');
+$search_entity = ($user->entity > 0 ? $user->entity : GETPOSTINT('search_entity'));
+
$search_ref = GETPOST("search_ref", 'alpha');
$search_label = GETPOST("search_label", 'alpha');
$search_societe = GETPOST("search_societe", 'alpha');
@@ -617,10 +618,11 @@
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
+
if ($search_entity > 0) {
$sql .= " WHERE p.entity = ".((int) $search_entity);
} else {
- $sql .= " WHERE p.entity IN (".getEntity('project').')';
+ $sql .= " WHERE p.entity IN (".getEntity('project', (GETPOSTINT('search_current_entity') ? 0 : 1)).')';
}
if (!$user->hasRight('projet', 'all', 'lire')) {
$sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; // public and assigned to, or restricted to company for external users
@@ -963,7 +965,7 @@
$param .= '&search_date_start_startday='.urlencode((string) ($search_date_start_startday));
}
if ($search_date_start_start) {
- $param .= '&search_date_start_start='.urlencode((string) $search_date_start_start);
+ $param .= '&search_date_start_start='.urlencode($search_date_start_start);
}
if ($search_date_start_endmonth) {
$param .= '&search_date_start_endmonth='.urlencode((string) ($search_date_start_endmonth));
@@ -987,7 +989,7 @@
$param .= '&search_date_end_startday='.urlencode((string) ($search_date_end_startday));
}
if ($search_date_end_start) {
- $param .= '&search_date_end_start='.urlencode((string) $search_date_end_start);
+ $param .= '&search_date_end_start='.urlencode($search_date_end_start);
}
if ($search_date_end_endmonth) {
$param .= '&search_date_end_endmonth='.urlencode((string) ($search_date_end_endmonth));
@@ -999,7 +1001,7 @@
$param .= '&search_date_end_endday='.urlencode((string) ($search_date_end_endday));
}
if ($search_date_end_end) {
- $param .= '&search_date_end_end=' . urlencode((string) $search_date_end_end);
+ $param .= '&search_date_end_end=' . urlencode($search_date_end_end);
}
if ($search_date_creation_startmonth) {
$param .= '&search_date_creation_startmonth='.urlencode((string) ($search_date_creation_startmonth));
@@ -1011,7 +1013,7 @@
$param .= '&search_date_creation_startday='.urlencode((string) ($search_date_creation_startday));
}
if ($search_date_creation_start) {
- $param .= '&search_date_creation_start='.urlencode((string) $search_date_creation_start);
+ $param .= '&search_date_creation_start='.urlencode($search_date_creation_start);
}
if ($search_date_creation_endmonth) {
$param .= '&search_date_creation_endmonth='.urlencode((string) ($search_date_creation_endmonth));
@@ -1035,7 +1037,7 @@
$param .= '&search_date_modif_startday='.urlencode((string) ($search_date_modif_startday));
}
if ($search_date_modif_start) {
- $param .= '&search_date_modif_start='.urlencode((string) $search_date_modif_start);
+ $param .= '&search_date_modif_start='.urlencode($search_date_modif_start);
}
if ($search_date_modif_endmonth) {
$param .= '&search_date_modif_endmonth='.urlencode((string) ($search_date_modif_endmonth));
@@ -1047,7 +1049,7 @@
$param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday));
}
if ($search_date_modif_end) {
- $param .= '&search_date_modif_end=' . urlencode((string) $search_date_modif_end);
+ $param .= '&search_date_modif_end=' . urlencode($search_date_modif_end);
}
if (!empty($search_category_array)) {
foreach ($search_category_array as $tmpval) {
########## projet/tasks/time.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/projet/tasks/time.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/projet/tasks/time.php 2025-06-27 11:43:57.771080000 +0000
@@ -1,4 +1,5 @@
* Copyright (C) 2006-2023 Laurent Destailleur
* Copyright (C) 2010-2012 Regis Houssin
@@ -285,9 +286,6 @@
$error++;
}
- //If timespent date is not provided in POST (for eg, because in list the column date is hidden) we keep the actual date
- $timespent_date = dol_mktime(12, 0, 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear"));
-
if (!$error) {
if (GETPOSTINT('taskid') != $id) { // GETPOST('taskid') is id of new task
$id_temp = GETPOSTINT('taskid'); // should not overwrite $id
@@ -303,11 +301,11 @@
$object->timespent_old_duration = GETPOSTINT("old_duration");
$object->timespent_duration = GETPOSTINT("new_durationhour") * 60 * 60; // We store duration in seconds
$object->timespent_duration += (GETPOSTINT("new_durationmin") ? GETPOSTINT('new_durationmin') : 0) * 60; // We store duration in seconds
- if (GETPOST("timelinehour") != '' && GETPOST("timelinehour") >= 0 && !empty($timespent_date)) { // If hour was entered
+ if (GETPOST("timelinehour") != '' && GETPOST("timelinehour") >= 0) { // If hour was entered
$object->timespent_date = dol_mktime(GETPOSTINT("timelinehour"), GETPOSTINT("timelinemin"), 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear"));
$object->timespent_withhour = 1;
- } elseif (!empty($timespent_date)) {
- $object->timespent_date = $timespent_date;
+ } else {
+ $object->timespent_date = dol_mktime(12, 0, 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear"));
$object->timespent_withhour = 0;
}
$object->timespent_fk_user = GETPOSTINT("userid_line");
@@ -328,8 +326,7 @@
} else {
$object->fetch($id, $ref);
- $object->fetchTimeSpent(GETPOSTINT('lineid'));
-
+ $object->timespent_id = GETPOSTINT("lineid");
$object->timespent_note = GETPOST("timespent_note_line", "alphanohtml");
$object->timespent_old_duration = GETPOSTINT("old_duration");
$object->timespent_duration = GETPOSTINT("new_durationhour") * 60 * 60; // We store duration in seconds
@@ -337,8 +334,8 @@
if (GETPOST("timelinehour") != '' && GETPOST("timelinehour") >= 0) { // If hour was entered
$object->timespent_date = dol_mktime(GETPOSTINT("timelinehour"), GETPOSTINT("timelinemin"), 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear"));
$object->timespent_withhour = 1;
- } elseif (!empty($timespent_date)) {
- $object->timespent_date = $timespent_date;
+ } else {
+ $object->timespent_date = dol_mktime(12, 0, 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear"));
$object->timespent_withhour = 0;
}
$object->timespent_fk_user = GETPOSTINT("userid_line");
@@ -1493,7 +1490,7 @@
print $langs->trans('ServiceToUseOnLines');
print '';
print '| ';
- $form->select_produits(0, 'productid', 1, 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500');
+ $form->select_produits(0, 'productid', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500');
print ' | ';
print ' ';
}
@@ -1887,7 +1884,7 @@
if (isModEnabled("service") && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) {
print '';
print img_picto('', 'service');
- print $form->select_produits((GETPOSTISSET('fk_product') ? GETPOSTINT("fk_product") : ''), 'fk_product', 1, 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1);
+ print $form->select_produits((GETPOSTISSET('fk_product') ? GETPOSTINT("fk_product") : ''), 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1);
print ' | ';
}
}
@@ -2068,11 +2065,11 @@
}
if (!empty($allprojectforuser)) {
if (!empty($arrayfields['p.project_ref']['checked'])) {
- print_liste_field_titre($arrayfields['p.project_ref']['label'], $_SERVER['PHP_SELF'], 'p.ref', '', $param, '', $sortfield, $sortorder);
+ print_liste_field_titre("Project", $_SERVER['PHP_SELF'], 'p.ref', '', $param, '', $sortfield, $sortorder);
$totalarray['nbfield']++;
}
if (!empty($arrayfields['p.project_label']['checked'])) {
- print_liste_field_titre($arrayfields['p.project_label']['label'], $_SERVER['PHP_SELF'], 'p.title', '', $param, '', $sortfield, $sortorder);
+ print_liste_field_titre("ProjectLabel", $_SERVER['PHP_SELF'], 'p.title', '', $param, '', $sortfield, $sortorder);
$totalarray['nbfield']++;
}
}
@@ -2263,9 +2260,10 @@
}
}
+ // Project ref & label
if (!empty($allprojectforuser)) {
- // Project ref
if (!empty($arrayfields['p.project_ref']['checked'])) {
+ print '';
if (empty($conf->cache['project'][$task_time->fk_projet])) {
$tmpproject = new Project($db);
$tmpproject->fetch($task_time->fk_projet);
@@ -2273,14 +2271,12 @@
} else {
$tmpproject = $conf->cache['project'][$task_time->fk_projet];
}
- print ' | ';
print $tmpproject->getNomUrl(1);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
}
}
- // Project label
if (!empty($arrayfields['p.project_label']['checked'])) {
if (empty($conf->cache['project'][$task_time->fk_projet])) {
$tmpproject = new Project($db);
@@ -2289,12 +2285,8 @@
} else {
$tmpproject = $conf->cache['project'][$task_time->fk_projet];
}
- print '';
- if (!empty($arrayfields['p.project_ref']['checked'])) {
- print dolPrintHTML($tmpproject->title);
- } else {
- print $tmpproject->getNomUrl(1, '', -1);
- }
+ print ' | ';
+ print dol_escape_htmltag($tmpproject->title);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -2326,15 +2318,8 @@
// Task label
if (!empty($arrayfields['t.element_label']['checked'])) {
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
- print '';
- if (!empty($arrayfields['t.element_ref']['checked'])) {
- print dolPrintHTML($task_time->label);
- } else {
- $tasktmp->id = $task_time->fk_element;
- $tasktmp->ref = $task_time->ref;
- $tasktmp->label = $task_time->label;
- print $tasktmp->getNomUrl(1, 'withproject', 'time', -1);
- }
+ print ' | ';
+ print dol_escape_htmltag($task_time->label);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -2342,9 +2327,9 @@
}
}
- // User
+ // By User
if (!empty($arrayfields['author']['checked'])) {
- print '';
+ print ' | ';
if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
// Here $object is task. TODO Add a cache
if (empty($object->id)) {
@@ -2430,7 +2415,7 @@
print ' | ';
if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
print img_picto('', 'service');
- print $form->select_produits($task_time->fk_product, 'fk_product', 1, 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500', 0, '', null, 1);
+ print $form->select_produits($task_time->fk_product, 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500', 0, '', null, 1);
} elseif (!empty($task_time->fk_product)) {
$product = new Product($db);
$resultFetch = $product->fetch($task_time->fk_product);
@@ -2759,7 +2744,7 @@
// Date
if (!empty($arrayfields['t.element_date']['checked'])) {
- print ' | ';
+ print ' | ';
if ($action == 'splitline' && GETPOSTINT('lineid') == $task_time->rowid) {
if (empty($task_time->element_date_withhour)) {
print $form->selectDate(($date2 ? $date2 : $date1), 'timeline_2', 3, 3, 2, "timespent_date", 1, 0);
@@ -2774,20 +2759,20 @@
// Thirdparty
if (!empty($arrayfields['p.fk_soc']['checked'])) {
- print ' | ';
+ print ' | ';
print ' | ';
}
// Thirdparty alias
if (!empty($arrayfields['s.name_alias']['checked'])) {
- print '';
+ print ' | ';
print ' | ';
}
// Project ref
if (!empty($allprojectforuser)) {
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
- print '';
+ print ' | ';
print ' | ';
}
}
@@ -2795,7 +2780,7 @@
// Task ref
if (!empty($arrayfields['t.element_ref']['checked'])) {
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
- print '';
+ print ' | ';
$tasktmp->id = $task_time->fk_element;
$tasktmp->ref = $task_time->ref;
$tasktmp->label = $task_time->label;
@@ -2807,7 +2792,7 @@
// Task label
if (!empty($arrayfields['t.element_label']['checked'])) {
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
- print ' | ';
+ print ' | ';
print dol_escape_htmltag($task_time->label);
print ' | ';
}
@@ -2876,7 +2861,7 @@
// Value spent
if (!empty($arrayfields['value']['checked'])) {
print '';
- print '';
+ print '';
$value = 0;
print price($value, 1, $langs, 1, -1, -1, $conf->currency);
print '';
@@ -2888,7 +2873,7 @@
print ' | ';
$valuebilled = price2num($task_time->total_ht, '', 1);
if (isset($task_time->total_ht)) {
- print '';
+ print '';
print price($valuebilled, 1, $langs, 1, -1, -1, $conf->currency);
print '';
}
########## projet/tasks.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/projet/tasks.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/projet/tasks.php 2025-06-27 11:43:57.763828000 +0000
@@ -527,7 +527,7 @@
$param .= '&search_date_start_startday='.urlencode((string) ($search_date_start_startday));
}
if ($search_date_start_start) {
- $param .= '&search_date_start_start='.urlencode((string) $search_date_start_start);
+ $param .= '&search_date_start_start='.urlencode($search_date_start_start);
}
if ($search_date_start_endmonth) {
$param .= '&search_date_start_endmonth='.urlencode((string) ($search_date_start_endmonth));
@@ -539,7 +539,7 @@
$param .= '&search_date_start_endday='.urlencode((string) ($search_date_start_endday));
}
if ($search_date_start_end) {
- $param .= '&search_date_start_end='.urlencode((string) $search_date_start_end);
+ $param .= '&search_date_start_end='.urlencode($search_date_start_end);
}
if ($search_date_end_startmonth) {
$param .= '&search_date_end_startmonth='.urlencode((string) ($search_date_end_startmonth));
@@ -551,7 +551,7 @@
$param .= '&search_date_end_startday='.urlencode((string) ($search_date_end_startday));
}
if ($search_date_end_start) {
- $param .= '&search_date_end_start='.urlencode((string) $search_date_end_start);
+ $param .= '&search_date_end_start='.urlencode($search_date_end_start);
}
if ($search_date_end_endmonth) {
$param .= '&search_date_end_endmonth='.urlencode((string) ($search_date_end_endmonth));
@@ -563,7 +563,7 @@
$param .= '&search_date_end_endday='.urlencode((string) ($search_date_end_endday));
}
if ($search_date_end_end) {
- $param .= '&search_date_end_end=' . urlencode((string) $search_date_end_end);
+ $param .= '&search_date_end_end=' . urlencode($search_date_end_end);
}
if ($search_planedworkload) {
$param .= '&search_planedworkload='.urlencode($search_planedworkload);
########## public/demo/index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/public/demo/index.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/public/demo/index.php 2025-06-27 11:43:57.814989000 +0000
@@ -295,10 +295,8 @@
print '';
print '';
-print ' ';
-print ' '.$langs->trans("DemoDesc").' ';
-print $langs->trans("DemoDesc2", 'https://www.dolibarr.org/onlinedemo');
-print ' ';
+print ' ';
+print ' '.$langs->trans("DemoDesc").' ';
print ' '.$langs->trans("ChooseYourDemoProfil").' ';
print ' ';
print ' ';
########## public/payment/newpayment.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/public/payment/newpayment.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/public/payment/newpayment.php 2025-06-27 11:43:57.804206000 +0000
@@ -608,7 +608,7 @@
$service = 'StripeTest';
$servicestatus = 0;
- if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOSTINT('forcesandbox') */) {
+ if (getDolGlobalString('STRIPE_LIVE') && !GETPOSTINT('forcesandbox')) {
$service = 'StripeLive';
$servicestatus = 1;
}
@@ -818,7 +818,7 @@
if (getDolGlobalInt('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION')) {
$service = 'StripeTest';
$servicestatus = 0;
- if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOSTINT('forcesandbox') */) {
+ if (getDolGlobalString('STRIPE_LIVE') && !GETPOSTINT('forcesandbox')) {
$service = 'StripeLive';
$servicestatus = 1;
}
@@ -970,10 +970,10 @@
// Show sandbox warning
-if ((empty($paymentmethod) || $paymentmethod == 'paypal') && isModEnabled('paypal') && (getDolGlobalString('PAYPAL_API_SANDBOX')/* || GETPOSTINT('forcesandbox')*/)) { // We can force sand box with param 'forcesandbox'
+if ((empty($paymentmethod) || $paymentmethod == 'paypal') && isModEnabled('paypal') && (getDolGlobalString('PAYPAL_API_SANDBOX') || GETPOSTINT('forcesandbox'))) { // We can force sand box with param 'forcesandbox'
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), array(), 'warning');
}
-if ((empty($paymentmethod) || $paymentmethod == 'stripe') && isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOSTINT('forcesandbox')*/)) {
+if ((empty($paymentmethod) || $paymentmethod == 'stripe') && isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOSTINT('forcesandbox'))) {
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), array(), 'warning');
}
@@ -987,7 +987,7 @@
print ' '."\n";
print ' '."\n";
print ' ';
-//print ' ';
+print ' ';
print ' ';
print ' ';
print "\n";
@@ -2425,7 +2425,7 @@
print ' '."\n";
print ' '."\n";
print ' '."\n";
- //print ' ';
+ print ' ';
print ' ';
print ' ';
print ' ';
@@ -2456,7 +2456,7 @@
$service = 'StripeLive';
$servicestatus = 1;
- if (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */) {
+ if (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha')) {
$service = 'StripeTest';
$servicestatus = 0;
}
########## public/payment/paymentok.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/public/payment/paymentok.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/public/payment/paymentok.php 2025-06-27 11:43:57.808204000 +0000
@@ -290,12 +290,11 @@
// Add steps to validate payment is complete when we enter this page
-$service = $paymentmethod; // to have a default value. We may change it later for 'StripeLive' or 'StripeTest'...
+
// For Paypal: validate the payment (Paypal need another step after the callback return to validate the payment).
if (isModEnabled('paypal') && $paymentmethod === 'paypal') { // We call this page only if payment is ok on payment system
if (!empty($PAYPALTOKEN)) {
- // TODO: Move this block to the top to ensure all session variables (e.g., TRANSACTIONID, FinalPaymentAmt, currencyCodeType, etc.) are loaded before executing checks for any payment module.
// Get on url call
$onlinetoken = $PAYPALTOKEN;
$fulltag = $FULLTAG;
@@ -372,98 +371,23 @@
}
// For Paybox
-if (isModEnabled('paybox') && $paymentmethod === 'paybox') {
- // TODO Add a check to validate that payment is ok.
- $ispaymentok = true; // We will do the rest of code
+if (isModEnabled('paybox')) {
+ if ($paymentmethod === 'paybox') {
+ // TODO Add a check to validate that payment is ok.
+ $ispaymentok = true; // We call this page only if payment is ok on payment system
+ }
}
// For Stripe
-if (isModEnabled('stripe') && $paymentmethod === 'stripe') {
- // TODO: Move this block to the top to ensure all session variables (e.g., TRANSACTIONID, FinalPaymentAmt, currencyCodeType, etc.) are loaded before executing checks for any payment module.
- if (empty($TRANSACTIONID)) {
- $TRANSACTIONID = empty($_SESSION['TRANSACTIONID']) ? '' : $_SESSION['TRANSACTIONID']; // pi_... or ch_...
- if (empty($TRANSACTIONID) && GETPOST('payment_intent', 'alphanohtml')) {
- // For the case we use STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 2
- $TRANSACTIONID = GETPOST('payment_intent', 'alphanohtml');
- }
- }
- $FinalPaymentAmt = empty($_SESSION["FinalPaymentAmt"]) ? '' : $_SESSION["FinalPaymentAmt"];
- $currencyCodeType = empty($_SESSION['currencyCodeType']) ? '' : $_SESSION['currencyCodeType'];
-
- $service = 'StripeTest';
- $servicestatus = 0;
- if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOSTINT('forcesandbox') */) {
- $service = 'StripeLive';
- $servicestatus = 1;
- }
-
- // Check we are coming from the newpaymentpage
- if (GETPOST('paymentoksessioncode') !== $_SESSION['paymentoksessioncode']) {
- $error++;
- $errmsg = 'Attempted direct access to the paymentok page without a valid session.';
- dol_syslog($errmsg, LOG_ERR, 0, '_payment');
- }
-
- // Check on payment platform that the payment has been really validated
- if (!$error && $TRANSACTIONID) {
- // Stripe payment verification via Stripe API
- try {
- include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
- $stripe = new Stripe($db);
- $stripeacc = $stripe->getStripeAccount($service);
-
- // Use the correct Stripe API key
- global $stripearrayofkeysbyenv;
- \Stripe\Stripe::setApiKey($stripearrayofkeysbyenv[$servicestatus]['secret_key']);
-
- try {
- if (empty($stripeacc)) {
- $paymentIntent = \Stripe\PaymentIntent::retrieve($TRANSACTIONID);
- } else {
- $paymentIntent = \Stripe\PaymentIntent::retrieve($TRANSACTIONID, array("stripe_account" => $stripeacc));
- }
-
- // Check amount and currency
- $expectedAmount = (int) round($FinalPaymentAmt * 100); // Stripe uses cents
- $expectedCurrency = strtolower($currencyCodeType);
-
- if ((int) $paymentIntent->amount !== $expectedAmount || strtolower($paymentIntent->currency) !== $expectedCurrency) {
- $error++;
- $errmsg = 'Stripe payment information mismatch: expected amount ' . $expectedAmount . ' and currency ' . $expectedCurrency . ', got amount ' . $paymentIntent->amount . ' and currency ' . $paymentIntent->currency;
- dol_syslog($errmsg, LOG_ERR, 0, '_payment');
- }
- if ($paymentIntent->status !== 'succeeded') {
- $error++;
- $errmsg = 'Stripe payment not succeeded. Status: ' . $paymentIntent->status;
- dol_syslog($errmsg, LOG_ERR, 0, '_payment');
- }
- } catch (\Stripe\Exception\ApiErrorException $e) {
- $error++;
- $errormessage = "Stripe API error: ".$e->getMessage();
- dol_syslog($errormessage, LOG_ERR, 0, '_payment');
- setEventMessages($e->getMessage(), null, 'errors');
- } catch (Exception $e) {
- $error++;
- $errormessage = "CantRetrievePaymentIntent: ".$e->getMessage();
- dol_syslog($errormessage, LOG_ERR, 0, '_payment');
- setEventMessages($e->getMessage(), null, 'errors');
- }
- } catch (Exception $e) {
- $error++;
- $errmsg = 'Stripe API error: ' . $e->getMessage();
- dol_syslog($errmsg, LOG_ERR, 0, '_payment');
+if (isModEnabled('stripe')) {
+ if ($paymentmethod === 'stripe') {
+ // Check we are coming from the newpaymentpage
+ if (GETPOST('paymentoksessionkey') == $_SESSION['paymentoksessionkey']) {
+ // We can also request Stripe with payment_intent and payment_intent_client_secret the sameway we do in newpayment after comment "// Get here amount and currency used for payment".
+ $ispaymentok = true; // We call this page only if payment is ok on payment system
+ } else {
+ $ispaymentok = false; // We call this page only if payment is ok on payment system
}
- } else {
- $error++;
- $errmsg = 'Stripe payment verification failed: TRANSACTIONID is not set or session key does not match.';
- dol_syslog($errmsg, LOG_ERR, 0, '_payment');
- setEventMessages($errmsg, null, 'errors');
- }
-
- if (!$error) {
- $ispaymentok = true; // We will do the rest of code
- } else {
- $ispaymentok = false; // We won't do the rest of code
}
}
@@ -483,7 +407,6 @@
}
}
-// TODO: Move this block to the top to ensure all session variables (e.g., TRANSACTIONID, FinalPaymentAmt, currencyCodeType, etc.) are loaded before executing checks for any payment module.
// Get variable into the session env
if (empty($ipaddress)) {
$ipaddress = $_SESSION['ipaddress'];
@@ -793,7 +716,7 @@
}
if (!$error) {
- // If payment using Stripe, save the Stripe payment info into societe_account
+ // If payment using Strip, save the Stripe payment info into societe_account
if ($paymentmethod == 'stripe' && $autocreatethirdparty && $option == 'bankviainvoice') {
$thirdparty_id = ($object->socid ? $object->socid : $object->fk_soc);
@@ -801,7 +724,7 @@
$service = 'StripeTest';
$servicestatus = 0;
- if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+ if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
$service = 'StripeLive';
$servicestatus = 1;
}
@@ -1194,7 +1117,7 @@
$paiement->paiementid = $paymentTypeId;
$paiement->num_payment = '';
$paiement->note_public = 'Online payment ' . dol_print_date($now, 'standard') . ' from ' . $ipaddress;
- $paiement->ext_payment_id = $TRANSACTIONID; // 'pi_...' for Stripe, ... TODO Use 'pi_...:cus_...@pk_...'
+ $paiement->ext_payment_id = $TRANSACTIONID; // pi_... for Stripe, ...
$paiement->ext_payment_site = $service; // 'StripeLive' or 'Stripe', or ...
if (!$error) {
@@ -1328,8 +1251,8 @@
$paiement->paymenttype = $paymentTypeId;
$paiement->num_payment = '';
$paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress;
- $paiement->ext_payment_id = $TRANSACTIONID; // 'pi_...' for Stripe, ... TODO Use 'pi_...:cus_...@pk_...'
- $paiement->ext_payment_site = $service; // 'StripeLive' or 'Stripe', or ...
+ $paiement->ext_payment_id = $TRANSACTIONID;
+ $paiement->ext_payment_site = $service;
if (!$error) {
$paiement_id = $paiement->create($user, 1);
@@ -1463,8 +1386,8 @@
$paiement->paiementid = $paymentTypeId;
$paiement->num_payment = '';
$paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress.' for event registration';
- $paiement->ext_payment_id = $TRANSACTIONID; // 'pi_...' for Stripe, ... TODO Use 'pi_...:cus_...@pk_...'
- $paiement->ext_payment_site = $service; // 'StripeLive' or 'Stripe', or ...
+ $paiement->ext_payment_id = $TRANSACTIONID;
+ $paiement->ext_payment_site = $service;
if (!$error) {
$paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents
########## public/project/index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/public/project/index.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/public/project/index.php 2025-06-27 11:43:57.866368000 +0000
@@ -235,7 +235,7 @@
print ' '."\n";
print ' '."\n";
print ' ';
-//print ' ';
+print ' ';
print "\n";
########## public/project/viewandvote.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/public/project/viewandvote.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/public/project/viewandvote.php 2025-06-27 11:43:57.870521000 +0000
@@ -239,7 +239,7 @@
print ' '."\n";
print ' '."\n";
print ' ';
-//print ' ';
+print ' ';
print "\n";
########## public/stripe/ipn.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/public/stripe/ipn.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/public/stripe/ipn.php 2025-06-27 11:43:57.881274000 +0000
@@ -133,16 +133,10 @@
$event = \Stripe\Webhook::constructEvent($payload, $sig_header, $endpoint_secret);
} catch (UnexpectedValueException $e) {
// Invalid payload
- dol_syslog("***** Stripe IPN was called with UnexpectedValueException (invalid payload) service=".$service);
- dol_syslog("***** Stripe IPN was called with UnexpectedValueException (invalid payload) service=".$service, LOG_DEBUG, 0, '_payment');
httponly_accessforbidden('Invalid payload', 400);
} catch (\Stripe\Exception\SignatureVerificationException $e) {
- dol_syslog("***** Stripe IPN was called with SignatureVerificationException service=".$service);
- dol_syslog("***** Stripe IPN was called with SignatureVerificationException service=".$service, LOG_DEBUG, 0, '_payment');
- httponly_accessforbidden('Invalid signature. May be a hook for an event created by another Stripe env or a hack attempt ? Check setup of your keys whsec_...', 400);
+ httponly_accessforbidden('Invalid signature. May be a hook for an event created by another Stripe env ? Check setup of your keys whsec_...', 400);
} catch (Exception $e) {
- dol_syslog("***** Stripe IPN was called with Exception (".$e->getMessage().") service=".$service);
- dol_syslog("***** Stripe IPN was called with Exception (".$e->getMessage().") service=".$service, LOG_DEBUG, 0, '_payment');
httponly_accessforbidden('Error '.$e->getMessage(), 400);
}
@@ -366,14 +360,14 @@
global $stripearrayofkeysbyenv;
$error = 0;
$object = $event->data->object;
- $TRANSACTIONID = $object->id; // Example 'pi_123456789...'
+ $TRANSACTIONID = $object->id; // Example pi_123456789...
$ipaddress = $object->metadata->ipaddress;
$now = dol_now();
$currencyCodeType = strtoupper($object->currency);
$paymentmethodstripeid = $object->payment_method;
$customer_id = $object->customer;
$invoice_id = "";
- $paymentTypeCode = ""; // payment type according to Stripe
+ $paymentTypeCode = ""; // payment type according to Stripe
$paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr
$payment_amount = 0;
$payment_amountInDolibarr = 0;
@@ -455,9 +449,7 @@
}
$payment_amount = $payment_amountInDolibarr;
- // TODO Add this checks ? May not be required because the message is already decoded with $event = \Stripe\Webhook::constructEvent($payload, $sig_header, $endpoint_secret);
- // - Check payment_amount in Stripe (received) is same than the one in Dolibarr
- // - Check that payment intent is succeed (to avoid forged json webhook sent by malicious users)
+ // TODO Check payment_amount in Stripe (received) is same than the one in Dolibarr
$postactionmessages = array();
########## reception/class/api_receptions.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/reception/class/api_receptions.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/reception/class/api_receptions.class.php 2025-06-27 11:43:59.812337000 +0000
@@ -112,7 +112,7 @@
$obj_ret = array();
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
- $socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+ $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
########## reception/class/reception.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/reception/class/reception.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/reception/class/reception.class.php 2025-06-27 11:43:59.814016000 +0000
@@ -631,7 +631,7 @@
if ($qty == 0 || ($qty < 0 && !getDolGlobalInt('RECEPTION_ALLOW_NEGATIVE_QTY'))) {
continue;
}
- dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid);
+ dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid);
//var_dump($this->lines[$i]);
$mouvS = new MouvementStock($this->db);
@@ -2038,7 +2038,11 @@
$qty = $obj->qty;
- dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid);
+
+ if ($qty <= 0) {
+ continue;
+ }
+ dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid);
//var_dump($this->lines[$i]);
$mouvS = new MouvementStock($this->db);
########## recruitment/class/api_recruitments.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/recruitment/class/api_recruitments.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/recruitment/class/api_recruitments.class.php 2025-06-27 11:43:57.612671000 +0000
@@ -152,7 +152,7 @@
throw new RestException(403);
}
- $socid = DolibarrApiAccess::$user->socid ?: 0;
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
@@ -268,7 +268,7 @@
throw new RestException(403);
}
- $socid = DolibarrApiAccess::$user->socid ?: 0;
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
########## recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php 2025-06-27 11:43:57.618137000 +0000
@@ -97,7 +97,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
@@ -135,7 +135,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
########## recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php 2025-06-27 11:43:57.627623000 +0000
@@ -97,7 +97,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
@@ -135,7 +135,7 @@
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
- } elseif (!is_numeric($object->ismultientitymanaged)) {
+ } elseif ($object->ismultientitymanaged == 2) {
// TODO
}
########## resource/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/resource/card.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/resource/card.php 2025-06-27 11:43:57.649400000 +0000
@@ -46,11 +46,9 @@
$langs->loadLangs(array('resource', 'companies', 'other', 'main'));
// Get parameters
+$id = GETPOSTINT('id');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
-$backtopage = GETPOST('backtopage', 'alpha');
-
-$id = GETPOSTINT('id');
$ref = GETPOST('ref', 'alpha');
$address = GETPOST('address', 'alpha');
$zip = GETPOST('zipcode', 'alpha');
@@ -166,8 +164,6 @@
if (!$error) {
$res = $object->fetch($id);
if ($res > 0) {
- $oldref = $object->ref;
-
$object->ref = $ref;
$object->address = $address;
$object->zip = $zip;
@@ -189,14 +185,6 @@
$result = $object->update($user);
if ($result > 0) {
- if ($oldref != $ref) {
- // We renamed the ref so we must change the directory too
- include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
- $srcdir = $conf->resource->dir_output.'/'.dol_sanitizeFileName($oldref);
- $destdir = $conf->resource->dir_output.'/'.dol_sanitizeFileName($ref);
- dol_move_dir($srcdir, $destdir);
- }
-
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
} else {
@@ -281,7 +269,7 @@
// Ref
print ' | '.$langs->trans("ResourceFormLabel_ref").' | ';
- print ' | ';
+ print ' | ';
// Type
print ' | '.$langs->trans("ResourceType").' | ';
@@ -355,21 +343,21 @@
print ' | '.$form->editfieldkey('EMail', 'email', '', $object, 0).' | ';
print '';
print img_picto('', 'object_email', 'class="pictofixedwidth"');
- print ' | ';
+ print '';
print ' ';
// Max users
- print ' | '.$form->editfieldkey('MaxUsers', 'max_users', '', $object, 0, 'string', '', 0, 0, 'id', $langs->trans('MaxUsersResourceDesc')).' | ';
+ print ' | '.$form->editfieldkey('MaxUsers', 'max_users', '', $object, 0).' | ';
print '';
print img_picto('', 'object_user', 'class="pictofixedwidth"');
- print ' | ';
+ print '';
print ' ';
// URL
print ' | '.$form->editfieldkey('URL', 'url', '', $object, 0).' | ';
print '';
print img_picto('', 'object_url', 'class="pictofixedwidth"');
- print ' | ';
+ print '';
print ' ';
// Other attributes
@@ -402,7 +390,7 @@
print $formconfirm;
- $linkback = ' '.$langs->trans("BackToList").'';
+ $linkback = ' '.$langs->trans("BackToList").'';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref');
@@ -432,7 +420,7 @@
print ' ';
print '| '.$langs->trans("MaxUsers").' | ';
print '';
- print $object->max_users > 0 ? $object->max_users : '';
+ print $object->max_users;
print ' | ';
print ' ';
########## salaries/class/api_salaries.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/salaries/class/api_salaries.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/salaries/class/api_salaries.class.php 2025-06-27 11:43:57.377409000 +0000
@@ -363,7 +363,7 @@
* @phpstan-param ?array $request_data
* @return Object PaymentSalary object
*
- * @url PUT {id}/payments
+ * @url POST {id}/payments
*
* @throws RestException
*/
########## salaries/class/salary.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/salaries/class/salary.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/salaries/class/salary.class.php 2025-06-27 11:43:57.375367000 +0000
@@ -146,20 +146,19 @@
public $user;
/**
- * @var int<0,1> 1 if salary paid COMPLETELY, 0 otherwise (Note ->paye is still used for salary, the couple statut/close_code that replace it is for invoices only)
+ * @var int<0,1> 1 if salary paid COMPLETELY, 0 otherwise (do not use it anymore, use statut and close_code)
+ * @deprecated Use $status and $close_code
*/
public $paye;
+ const STATUS_UNPAID = 0;
+ const STATUS_PAID = 1;
+
/**
* @var float amount remain to pay
*/
public $resteapayer;
-
- const STATUS_UNPAID = 0;
- const STATUS_PAID = 1;
-
-
public $fields = array(
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'),
'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 10, 'visible' => 1, 'index' => 1, 'comment' => "Reference of object"),
########## societe/admin/societe.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/societe/admin/societe.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/societe/admin/societe.php 2025-06-27 11:43:59.843029000 +0000
@@ -206,6 +206,21 @@
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
+/* This code is not needed anymore as we can use the setprofid functions instead with key = 'VAT_INTRA'
+//Activate Set vat id unique
+if ($action == "setvatintraunique") {
+ $setvatintraunique = GETPOSTINT('value');
+ $res = dolibarr_set_const($db, "SOCIETE_VAT_INTRA_UNIQUE", $setvatintraunique, 'yesno', 0, '', $conf->entity);
+ if (!($res > 0)) {
+ $error++;
+ }
+ if (!$error) {
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ } else {
+ setEventMessages($langs->trans("Error"), null, 'errors');
+ }
+}
+*/
//Activate Set ref in list
if ($action == "setaddrefinlist") {
@@ -612,15 +627,22 @@
// Activate / Disable
if (in_array($name, $def)) {
- print ''."\n";
+ print " | \n";
+ //if ($conf->global->COMPANY_ADDON_PDF != "$name")
+ //{
print 'scandir.'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print '';
+ //}
+ //else
+ //{
+ // print img_picto($langs->trans("Enabled"),'on');
+ //}
print " | ";
} else {
if (versioncompare($module->phpmin, versionphparray()) > 0) {
print ''."\n";
- print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion", implode('.', $module->phpmin))), 'switch_off', 'class="opacitymedium"');
+ print img_picto(dol_escape_htmltag($langs->trans("ErrorModuleRequirePHPVersion", implode('.', $module->phpmin))), 'switch_off');
print " | ";
} else {
print ''."\n";
@@ -964,7 +986,7 @@
if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) {
// Default Prospect/Customer thirdparty type on customer création
print ' | ';
- print '| '.$langs->trans("DefaultCustomerType", $langs->transnoentitiesnoconv("MenuNewThirdParty"), $langs->transnoentitiesnoconv("MenuNewCustomer")).' | ';
+ print ''.$langs->trans("DefaultCustomerType").' | ';
print '';
print $formcompany->selectProspectCustomerType(getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT'), 'defaultcustomertype', 'defaultcustomertype', 'admin');
print ' | ';
########## societe/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/societe/card.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/societe/card.php 2025-06-27 11:43:59.909252000 +0000
@@ -994,7 +994,7 @@
$private = 0;
}
- // Load object modCodeClient
+ // Load object modCodeTiers
$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
$module = substr($module, 0, dol_strlen($module) - 4);
@@ -1008,7 +1008,6 @@
}
$modCodeClient = new $module($db);
'@phan-var-force ModeleThirdPartyCode $modCodeClient';
-
// Load object modCodeFournisseur
$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard');
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
@@ -1450,8 +1449,8 @@
// Prospect/Customer/Supplier
$selected = $object->client;
- $selectedcustomer = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==1 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
- $selectedprospect = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==2 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
+ $selectedcustomer = 0;
+ $selectedprospect = 0;
switch ($selected) {
case 1:
$selectedcustomer = 1;
@@ -1587,7 +1586,8 @@
print ' ';
}
- print '| | ';
+ $colspan = ($conf->browser->layout == 'phone' ? 2 : 4);
+ print '| | ';
// Address
print '| ';
########## societe/class/api_contacts.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/societe/class/api_contacts.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/societe/class/api_contacts.class.php 2025-06-27 11:43:59.871938000 +0000
@@ -193,7 +193,7 @@
}
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
- $socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+ $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
########## societe/document.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/societe/document.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/societe/document.php 2025-06-27 11:43:59.884673000 +0000
@@ -192,11 +192,10 @@
print dol_get_fiche_end();
-$modulepart = 'company';
+$modulepart = 'societe';
$permissiontoadd = $user->hasRight('societe', 'creer');
$permtoedit = $user->hasRight('societe', 'creer');
$param = '&id='.$object->id;
-$relativepathwithnofile = $object->id . '/';
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
// End of page
########## societe/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/societe/list.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/societe/list.php 2025-06-27 11:43:59.900571000 +0000
@@ -1117,7 +1117,7 @@
$param .= '&search_date_creation_startday='.urlencode((string) ($search_date_creation_startday));
}
if ($search_date_creation_start) {
- $param .= '&search_date_creation_start='.urlencode((string) $search_date_creation_start);
+ $param .= '&search_date_creation_start='.urlencode($search_date_creation_start);
}
if ($search_date_creation_endmonth) {
$param .= '&search_date_creation_endmonth='.urlencode((string) ($search_date_creation_endmonth));
@@ -1129,7 +1129,7 @@
$param .= '&search_date_creation_endday='.urlencode((string) ($search_date_creation_endday));
}
if ($search_date_creation_end) {
- $param .= '&search_date_creation_end='.urlencode((string) $search_date_creation_end);
+ $param .= '&search_date_creation_end='.urlencode($search_date_creation_end);
}
if ($search_date_modif_startmonth) {
$param .= '&search_date_modif_startmonth='.urlencode((string) ($search_date_modif_startmonth));
@@ -1141,7 +1141,7 @@
$param .= '&search_date_modif_startday='.urlencode((string) ($search_date_modif_startday));
}
if ($search_date_modif_start) {
- $param .= '&search_date_modif_start='.urlencode((string) $search_date_modif_start);
+ $param .= '&search_date_modif_start='.urlencode($search_date_modif_start);
}
if ($search_date_modif_endmonth) {
$param .= '&search_date_modif_endmonth='.urlencode((string) ($search_date_modif_endmonth));
@@ -1153,7 +1153,7 @@
$param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday));
}
if ($search_date_modif_end) {
- $param .= '&search_date_modif_end=' . urlencode((string) $search_date_modif_end);
+ $param .= '&search_date_modif_end=' . urlencode($search_date_modif_end);
}
// Add $param from extra fields
@@ -2325,7 +2325,7 @@
// Note public
if (!empty($arrayfields['s.note_public']['checked'])) {
print ' | ';
- print ' '.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).' ';
+ print ''.dolPrintHTML(dolGetFirstLineOfText($obj->note_public), 5).' ';
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -2334,7 +2334,7 @@
// Note private
if (!empty($arrayfields['s.note_private']['checked'])) {
print '';
- print ' '.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).' ';
+ print ''.dolPrintHTML(dolGetFirstLineOfText($obj->note_private), 5).' ';
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
########## societe/paymentmodes.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/societe/paymentmodes.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/societe/paymentmodes.php 2025-06-27 11:43:59.913054000 +0000
@@ -107,7 +107,7 @@
// Init Stripe objects
if (isModEnabled('stripe')) {
$service = 'StripeTest';
- if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+ if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
$service = 'StripeLive';
$servicestatus = 1;
}
@@ -906,10 +906,11 @@
$head = societe_prepare_head($object);
// Show sandbox warning
-//if (isModEnabled('paypal') && (getDolGlobalString('PAYPAL_API_SANDBOX')/* || GETPOST('forcesandbox','alpha') */)) {
-// dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), [], 'warning');
-//}
-if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+/*if (isModEnabled('paypal') && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox','alpha'))) // We can force sand box with param 'forcesandbox'
+{
+ dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), [], 'warning');
+}*/
+if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');
}
@@ -1166,7 +1167,7 @@
} else {
$service = 'StripeTest';
$servicestatus = 0;
- if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+ if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
$service = 'StripeLive';
$servicestatus = 1;
}
########## stripe/admin/stripe.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/stripe/admin/stripe.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/stripe/admin/stripe.php 2025-06-27 11:43:58.077610000 +0000
@@ -443,7 +443,7 @@
print $langs->trans("TERMINAL_LOCATION").'';
$service = 'StripeTest';
$servicestatus = 0;
- if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+ if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
$service = 'StripeLive';
$servicestatus = 1;
}
@@ -454,7 +454,7 @@
if (!empty($site_account)) {
\Stripe\Stripe::setApiKey($site_account);
}
- if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+ if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
$service = 'StripeTest';
$servicestatus = '0';
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');
########## stripe/charge.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/stripe/charge.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/stripe/charge.php 2025-06-27 11:43:58.082345000 +0000
@@ -77,7 +77,7 @@
llxHeader('', $langs->trans("StripeChargeList"));
-if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
$service = 'StripeTest';
$servicestatus = '0';
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');
########## stripe/class/actions_stripe.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/stripe/class/actions_stripe.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/stripe/class/actions_stripe.class.php 2025-06-27 11:43:58.072645000 +0000
@@ -66,9 +66,9 @@
*/
public function formObjectOptions($parameters, &$object, &$action)
{
- global $langs;
+ global $conf, $langs;
- if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+ if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
$service = 'StripeTest';
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');
} else {
@@ -196,7 +196,7 @@
if ($object->statut > Facture::STATUS_DRAFT && $object->statut < Facture::STATUS_ABANDONED && $object->paye == 0) {
$stripe = new Stripe($this->db);
if ($resteapayer > 0) {
- if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+ if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
$service = 'StripeTest';
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');
} else {
########## stripe/class/stripe.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/stripe/class/stripe.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/stripe/class/stripe.class.php 2025-06-27 11:43:58.074143000 +0000
@@ -345,22 +345,22 @@
* Note: This is used when option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on when making a payment from the public/payment/newpayment.php page
* but not when using the STRIPE_USE_NEW_CHECKOUT.
*
- * @param float $amount Amount
- * @param string $currency_code Currency code
- * @param string $tag Tag
- * @param string $description Description
- * @param ?CommonObject $object Object to pay with Stripe
- * @param ?string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe()
- * @param ?string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect
- * @param int<0,1> $status Status (0=test, 1=live)
- * @param int<0,1> $usethirdpartyemailforreceiptemail 1=use thirdparty email for receipt
- * @param 'automatic'|'manual'|'terminal' $mode Automatic=automatic confirmation/payment when conditions are ok, manual=need to call confirm() on intent, terminal=manual
- * @param bool $confirmnow False=default, true=try to confirm immediately after create (if conditions are ok)
- * @param ?string $payment_method 'pm_....' (if known)
- * @param int<0,1> $off_session If we use an already known payment method to pay when customer is not available during the checkout flow.
- * @param int<0,1> $noidempotency_key Do not use the idempotency_key when creating the PaymentIntent
- * @param int $did ID of an existing line into llx_prelevement_demande (Dolibarr intent). If provided, no new line will be created.
- * @return ?\Stripe\PaymentIntent Stripe PaymentIntent or null if not found and failed to create
+ * @param float $amount Amount
+ * @param string $currency_code Currency code
+ * @param string $tag Tag
+ * @param string $description Description
+ * @param ?CommonObject $object Object to pay with Stripe
+ * @param ?string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe()
+ * @param ?string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect
+ * @param int<0,1> $status Status (0=test, 1=live)
+ * @param int<0,1> $usethirdpartyemailforreceiptemail 1=use thirdparty email for receipt
+ * @param 'automatic'|'manual' $mode automatic=automatic confirmation/payment when conditions are ok, manual=need to call confirm() on intent
+ * @param bool $confirmnow false=default, true=try to confirm immediately after create (if conditions are ok)
+ * @param ?string $payment_method 'pm_....' (if known)
+ * @param int<0,1> $off_session If we use an already known payment method to pay when customer is not available during the checkout flow.
+ * @param int<0,1> $noidempotency_key Do not use the idempotency_key when creating the PaymentIntent
+ * @param int $did ID of an existing line into llx_prelevement_demande (Dolibarr intent). If provided, no new line will be created.
+ * @return ?\Stripe\PaymentIntent Stripe PaymentIntent or null if not found and failed to create
*/
public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false, $payment_method = null, $off_session = 0, $noidempotency_key = 1, $did = 0)
{
@@ -454,8 +454,6 @@
}
}
- $stripemode = $mode;
-
// list of payment method types
$paymentmethodtypes = array("card");
$descriptor = dol_trunc($tag, 10, 'right', 'UTF-8', 1);
@@ -478,11 +476,8 @@
if (getDolGlobalInt('STRIPE_SOFORT')) {
$paymentmethodtypes[] = "sofort";
}
- if ($mode == 'terminal') {
- if (getDolGlobalInt('STRIPE_CARD_PRESENT')) {
- $paymentmethodtypes = array("card_present");
- }
- $stripemode = 'manual';
+ if (getDolGlobalInt('STRIPE_CARD_PRESENT') && $mode == 'terminal') {
+ $paymentmethodtypes = array("card_present");
}
global $dolibarr_main_url_root;
@@ -491,7 +486,7 @@
$dataforintent = array(
"confirm" => $confirmnow, // try to confirm immediately after create (if conditions are ok)
- "confirmation_method" => $stripemode,
+ "confirmation_method" => $mode,
"amount" => $stripeamount,
"currency" => $currency_code,
"payment_method_types" => $paymentmethodtypes, // When payment_method_types is set, return_url is not required but payment mode can't be managed from dashboard
@@ -1080,7 +1075,7 @@
$service = 'StripeTest';
$servicestatus = 0;
- if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+ if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
$service = 'StripeLive';
$servicestatus = 1;
}
########## stripe/config.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/stripe/config.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/stripe/config.php 2025-06-27 11:43:58.083359000 +0000
@@ -44,7 +44,7 @@
);
$stripearrayofkeys = array();
-if (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */) {
+if (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha')) {
$stripearrayofkeys = $stripearrayofkeysbyenv[0]; // Test
} else {
$stripearrayofkeys = $stripearrayofkeysbyenv[1]; // Live
########## stripe/payout.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/stripe/payout.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/stripe/payout.php 2025-06-27 11:43:58.084402000 +0000
@@ -78,7 +78,7 @@
llxHeader('', $langs->trans("StripePayoutList"));
-if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
$service = 'StripeTest';
$servicestatus = '0';
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');
########## stripe/transaction.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/stripe/transaction.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/stripe/transaction.php 2025-06-27 11:43:58.075548000 +0000
@@ -76,7 +76,7 @@
llxHeader('', $langs->trans("StripeTransactionList"));
-if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
$service = 'StripeTest';
$servicestatus = '0';
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');
########## supplier_proposal/class/api_supplier_proposals.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/supplier_proposal/class/api_supplier_proposals.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/supplier_proposal/class/api_supplier_proposals.class.php 2025-06-27 11:43:59.820866000 +0000
@@ -238,7 +238,7 @@
$obj_ret = array();
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
- $socids = DolibarrApiAccess::$user->socid ?: $thirdparty_ids;
+ $socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
########## takepos/admin/terminal.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/takepos/admin/terminal.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/takepos/admin/terminal.php 2025-06-27 11:43:58.013385000 +0000
@@ -251,14 +251,14 @@
print ' | ';
$service = 'StripeTest';
$servicestatus = 0;
- if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+ if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
$service = 'StripeLive';
$servicestatus = 1;
}
global $stripearrayofkeysbyenv;
$site_account = $stripearrayofkeysbyenv[$servicestatus]['secret_key'];
\Stripe\Stripe::setApiKey($site_account);
- if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+ if (isModEnabled('stripe') && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
$service = 'StripeTest';
$servicestatus = '0';
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning');
########## takepos/index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/takepos/index.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/takepos/index.php 2025-06-27 11:43:57.959221000 +0000
@@ -711,15 +711,7 @@
* return void
*/
function Search2(keyCodeForEnter, moreorless) {
- var eventKeyCode = null;
-
- if (window.event && window.event.keyCode) {
- eventKeyCode = window.event.keyCode;
- }
- if (eventKeyCode === null && keyCodeForEnter !== '') {
- // No key code available, exit early if a key code is required
- return;
- }
+ var eventKeyCode = window.event.keyCode;
console.log("Search2 Call ajax search to replace products keyCodeForEnter="+keyCodeForEnter+", eventKeyCode="+eventKeyCode);
########## takepos/pay.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/takepos/pay.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/takepos/pay.php 2025-06-27 11:43:57.960926000 +0000
@@ -99,7 +99,7 @@
if (isModEnabled('stripe')) {
$service = 'StripeTest';
- if (getDolGlobalString('STRIPE_LIVE')/* && !GETPOST('forcesandbox', 'alpha') */) {
+ if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) {
$service = 'StripeLive';
$servicestatus = 1;
}
@@ -158,7 +158,7 @@
}
}
-if (isModEnabled('stripe') && isset($keyforstripeterminalbank) && (!getDolGlobalString('STRIPE_LIVE')/* || GETPOST('forcesandbox', 'alpha') */)) {
+if (isModEnabled('stripe') && isset($keyforstripeterminalbank) && (!getDolGlobalString('STRIPE_LIVE') || GETPOST('forcesandbox', 'alpha'))) {
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), [], 'warning', 1);
}
########## takepos/receipt.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/takepos/receipt.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/takepos/receipt.php 2025-06-27 11:43:57.966009000 +0000
@@ -79,7 +79,7 @@
top_htmlhead('', '', 1);
-if ((string) $place != '' && !empty($_SESSION["takeposterminal"])) {
+if ((string) $place != '') {
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture";
$sql .= " WHERE ref = '(PROV-POS".$db->escape($_SESSION["takeposterminal"]."-".$place).")'";
$sql .= " AND entity IN (".getEntity('invoice').")";
########## ticket/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/ticket/card.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/ticket/card.php 2025-06-27 11:44:00.066618000 +0000
@@ -707,7 +707,7 @@
$help_url = 'EN:Module_Ticket|FR:DocumentationModuleTicket';
-$title = $actionobject->getTitle($action, $object);
+$title = $actionobject->getTitle($action);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-ticket page-card');
########## ticket/class/actions_ticket.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/ticket/class/actions_ticket.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/ticket/class/actions_ticket.class.php 2025-06-27 11:44:00.068949000 +0000
@@ -169,11 +169,10 @@
/**
* Get action title
*
- * @param string $action Type of action
- * @param Ticket|null $object Object ticket
- * @return string Title of action
+ * @param string $action Type of action
+ * @return string Title of action
*/
- public function getTitle($action = '', $object = null)
+ public function getTitle($action = '')
{
global $langs;
@@ -182,11 +181,11 @@
} elseif ($action == 'edit') {
return $langs->trans("EditTicket");
} elseif ($action == 'view') {
- return $langs->trans("Ticket").(is_null($object) ? '' : ' '.$object->ref);
+ return $langs->trans("TicketCard");
} elseif ($action == 'add_message') {
return $langs->trans("TicketAddMessage");
} else {
- return $langs->trans("Ticket");
+ return $langs->trans("TicketsManagement");
}
}
########## ticket/class/api_tickets.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/ticket/class/api_tickets.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/ticket/class/api_tickets.class.php 2025-06-27 11:44:00.073625000 +0000
@@ -213,7 +213,7 @@
$obj_ret = array();
- $socid = DolibarrApiAccess::$user->socid ?: $socid;
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $socid;
$search_sale = null;
// If the internal user must only see his customers, force searching by him
########## ticket/class/ticket.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/ticket/class/ticket.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/ticket/class/ticket.class.php 2025-06-27 11:44:00.071989000 +0000
@@ -2823,10 +2823,8 @@
$from = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM');
- $replyto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_REPLYTO');
-
// don't try to send email if no recipient
- $this->sendTicketMessageByEmail($subject, $message, 0, $sendto, $listofpaths, $listofmimes, $listofnames, array(), $from, $replyto);
+ $this->sendTicketMessageByEmail($subject, $message, 0, $sendto, $listofpaths, $listofmimes, $listofnames, array(), $from);
}
}
} else {
@@ -2904,11 +2902,9 @@
$from = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM');
- $replyto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_REPLYTO');
-
// don't try to send email if no recipient
if (!empty($sendto)) {
- $this->sendTicketMessageByEmail($subject, $message, 0, $sendto, $listofpaths, $listofmimes, $listofnames, $sendtocc, $from, $replyto);
+ $this->sendTicketMessageByEmail($subject, $message, 0, $sendto, $listofpaths, $listofmimes, $listofnames, $sendtocc, $from);
}
}
@@ -2979,7 +2975,7 @@
$url_public_ticket = (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE') ?
(getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') !== '' ? getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') . '/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)).'?track_id='.urlencode($object->track_id);
- if (getDolGlobalInt('TICKET_INCLUDE_LINK_TO_PUBLIC_INTERFACE_IN_MESSAGE')) {
+ if (!getDolGlobalInt('TICKET_DO_NOT_INCLUDE_LINK_TO_CUSTOMER')) {
$message .= ' ' . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : ' . $object->track_id . ' ';
}
@@ -3019,9 +3015,7 @@
if (!empty($sendto)) {
$from = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM');
- $replyto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_REPLYTO');
-
- $result = $this->sendTicketMessageByEmail($subject, $message, 0, $sendto, $listofpaths, $listofmimes, $listofnames, $sendtocc, $from, $replyto);
+ $result = $this->sendTicketMessageByEmail($subject, $message, 0, $sendto, $listofpaths, $listofmimes, $listofnames, $sendtocc, $from);
if ($result) {
// update last_msg_sent date of ticket (for last message sent to external users)
$this->date_last_msg_sent = dol_now();
@@ -3034,8 +3028,7 @@
$sql .= " email_subject = '".$this->db->escape($subject)."',";
$sql .= " email_from = '".$this->db->escape($from)."',";
$sql .= " email_to = '".$this->db->escape(implode(',', $sendto))."',";
- $sql .= " email_tocc = '".$this->db->escape(implode(',', $sendtocc))."',";
- $sql .= " reply_to = '".$this->db->escape($replyto)."'";
+ $sql .= " email_tocc = '".$this->db->escape(implode(',', $sendtocc))."'";
$sql .= " WHERE id = ".((int) $id);
$resql = $this->db->query($sql);
@@ -3082,10 +3075,9 @@
* @param string[] $mimefilename_list List of attached file name in message
* @param array $array_receiver_cc Array of receiver in CC. Example array('john@doe.com')
* @param string $from Email from
- * @param string $replyto Reply to
* @return boolean True if mail sent to at least one receiver, false otherwise
*/
- public function sendTicketMessageByEmail($subject, $message, $send_internal_cc = 0, $array_receiver = array(), $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $array_receiver_cc = array(), $from = '', $replyto = '')
+ public function sendTicketMessageByEmail($subject, $message, $send_internal_cc = 0, $array_receiver = array(), $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $array_receiver_cc = array(), $from = '')
{
global $conf, $langs, $user;
@@ -3125,34 +3117,34 @@
if (is_array($array_receiver) && count($array_receiver) > 0) {
//foreach ($array_receiver as $key => $receiver) {
- $deliveryreceipt = 0;
- $filepath = $filename_list;
- $filename = $mimefilename_list;
- $mimetype = $mimetype_list;
+ $deliveryreceipt = 0;
+ $filepath = $filename_list;
+ $filename = $mimefilename_list;
+ $mimetype = $mimetype_list;
- // Send email
+ // Send email
- $old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('MAIN_MAIL_AUTOCOPY_TO');
+ $old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('MAIN_MAIL_AUTOCOPY_TO');
if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
}
- $upload_dir_tmp = $conf->user->dir_output."/".$user->id.'/temp';
+ $upload_dir_tmp = $conf->user->dir_output."/".$user->id.'/temp';
- include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
- $trackid = "tic".$this->id;
+ include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
+ $trackid = "tic".$this->id;
- $moreinheader = 'X-Dolibarr-Info: sendTicketMessageByEmail'."\r\n";
+ $moreinheader = 'X-Dolibarr-Info: sendTicketMessageByEmail'."\r\n";
if (!empty($this->email_msgid)) {
// We must also add 1 entry In-Reply-To: <$this->email_msgid> with Message-ID we respond from (See RFC5322).
$moreinheader .= 'In-Reply-To: <'.$this->email_msgid.'>'."\r\n";
// TODO We should now be able to give the in_reply_to as a dedicated parameter of new CMailFile() instead of into $moreinheader.
}
- // We should add here also a header 'References:'
- // According to RFC5322, we should add here all the References fields of the initial message concatenated with
- // the Message-ID of the message we respond from (but each ID must be once).
- $references = '';
+ // We should add here also a header 'References:'
+ // According to RFC5322, we should add here all the References fields of the initial message concatenated with
+ // the Message-ID of the message we respond from (but each ID must be once).
+ $references = '';
if (!empty($this->origin_references)) { // $this->origin_references should be '<'.$this->origin_references.'>'
$references .= (empty($references) ? '' : ' ').$this->origin_references;
}
@@ -3164,15 +3156,11 @@
// TODO We should now be able to give the references as a dedicated parameter of new CMailFile() instead of into $moreinheader.
}
- $receiverstring = '';
+ $receiverstring = '';
foreach ($array_receiver as $key => $receiver) {
$receiverstring .= ($receiverstring ? ',' : '').$receiver;
}
-
- $sendcontext = 'ticket';
-
- // Send email
- $mailfile = new CMailFile($subject, $receiverstring, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', $trackid, $moreinheader, $sendcontext, $replyto, $upload_dir_tmp);
+ $mailfile = new CMailFile($subject, $receiverstring, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', $trackid, $moreinheader, 'ticket', '', $upload_dir_tmp);
if ($mailfile->error) {
########## user/bank.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/bank.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/bank.php 2025-06-27 11:43:58.027218000 +0000
@@ -63,6 +63,16 @@
* @var User $user
*/
+// $moreparam is used, but it is unclear how it is set, keeping the variable and ensuring it exists.
+// $countrynotdefined is used, but it is unclear how it is set.
+'
+@phan-var-force ?string $moreparam
+@phan-var-force ?string $countrynotdefined
+';
+if (!isset($moreparam)) {
+ $moreparam = null;
+}
+
// Load translation files required by page
$langs->loadLangs(array('accountancy', 'companies', 'commercial', 'banks', 'bills', 'trips', 'holiday', 'salaries'));
@@ -218,8 +228,8 @@
$action = '';
}
-// update birth (pure personal information)
-if ($action == 'setbirth' && $permissiontowritehr && !$cancel) {
+// update birth
+if ($action == 'setbirth' && $usercanadd && !$cancel) {
$object->birth = dol_mktime(0, 0, 0, GETPOSTINT('birthmonth'), GETPOSTINT('birthday'), GETPOSTINT('birthyear'));
$result = $object->update($user);
if ($result < 0) {
@@ -273,8 +283,8 @@
}
}
-// update national_registration_number (pure personal information)
-if ($action == 'setnational_registration_number' && $permissiontowritehr && !$cancel) {
+// update national_registration_number
+if ($action == 'setnational_registration_number' && $usercanadd && !$cancel) {
$object->national_registration_number = (string) GETPOST('national_registration_number', 'alphanohtml');
$result = $object->update($user);
if ($result < 0) {
@@ -516,8 +526,8 @@
print ' | ';
print " \n";
- // Date of birth (pure personal information)
- if ($permissiontoreadhr) {
+ // Date of birth
+ if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write')) {
print '';
print '| ';
print $form->editfieldkey("DateOfBirth", 'birth', $object->birth, $object, $user->hasRight('user', 'user', 'creer'));
@@ -528,23 +538,23 @@
}
// Personal email
- if ($permissiontoreadhr || $permissiontosimpleedit) {
+ if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write') || $permissiontosimpleedit) {
print ' | ';
print '| ';
- print $form->editfieldkey("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->hasRight('user', 'user', 'creer') || $permissiontowritehr);
+ print $form->editfieldkey("UserPersonalEmail", 'personal_email', $object->personal_email, $object, (int) ($user->hasRight('user', 'user', 'creer') || $user->hasRight('hrm', 'write_personal_information', 'write')));
print ' | ';
- print $form->editfieldval("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->hasRight('user', 'user', 'creer') || $permissiontowritehr, 'email', '', null, null, '', 0, '');
+ print $form->editfieldval("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->hasRight('user', 'user', 'creer') || $user->hasRight('hrm', 'write_personal_information', 'write'), 'email', '', null, null, '', 0, '');
print ' | ';
print ' ';
}
// Personal phone
- if ($permissiontoreadhr || $permissiontosimpleedit) {
+ if ($user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write') || $permissiontosimpleedit) {
print '';
print '| ';
- print $form->editfieldkey("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->hasRight('user', 'user', 'creer') || $permissiontowritehr);
+ print $form->editfieldkey("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, (int) ($user->hasRight('user', 'user', 'creer') || $user->hasRight('hrm', 'write_personal_information', 'write')));
print ' | ';
- print $form->editfieldval("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->hasRight('user', 'user', 'creer') || $permissiontowritehr, 'phone', '', null, null, '', 0, '');
+ print $form->editfieldval("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->hasRight('user', 'user', 'creer') || $user->hasRight('hrm', 'write_personal_information', 'write'), 'phone', '', null, null, '', 0, '');
print ' | ';
print ' ';
}
@@ -555,7 +565,7 @@
print $form->editfieldkey("DefaultCategoryCar", 'default_c_exp_tax_cat', (string) $object->default_c_exp_tax_cat, $object, $user->hasRight('user', 'user', 'creer'));
print ' | ';
if ($action == 'editdefault_c_exp_tax_cat') {
- $ret = ' | ';
if ($action == 'editdefault_range') {
- $ret = ' | ";
print "";
@@ -1013,6 +1023,8 @@
if ($selectedcode) {
print img_picto('', 'state', 'class="pictofixedwidth"');
print $formcompany->select_state(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : $account->state_id, $selectedcode, 'account_state_id');
+ } else {
+ print $countrynotdefined;
}
print ' | ';
########## user/card.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/card.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/card.php 2025-06-27 11:43:58.050808000 +0000
@@ -2061,11 +2061,6 @@
print showValueWithClipboardCPButton($object->api_key, 1, $langs->transnoentities("Hidden")); // TODO Add an option to also reveal the hash, not only copy paste
print '';
}
-
- if (getDolGlobalString('API_ENABLE_COUNT_CALLS')) {
- print ' '.getDolUserInt('API_COUNT_CALL').'';
- }
-
print '';
}
if ((getDolGlobalInt('MAIN_ENABLE_LOGINS_PRIVACY') == 0) || (getDolGlobalInt('MAIN_ENABLE_LOGINS_PRIVACY') == 1 && $object->id == $user->id)) {
########## user/class/api_users.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/class/api_users.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/class/api_users.class.php 2025-06-27 11:43:58.030186000 +0000
@@ -90,7 +90,7 @@
$obj_ret = array();
// case of external user, $societe param is ignored and replaced by user's socid
- //$socid = DolibarrApiAccess::$user->socid ?: $societe;
+ //$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe;
$sql = "SELECT t.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."user AS t LEFT JOIN ".MAIN_DB_PREFIX."user_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
@@ -645,7 +645,7 @@
}
// case of external user, $societe param is ignored and replaced by user's socid
- //$socid = DolibarrApiAccess::$user->socid ?: $societe;
+ //$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe;
$sql = "SELECT t.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."usergroup AS t LEFT JOIN ".MAIN_DB_PREFIX."usergroup_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields
########## user/class/user.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/class/user.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/class/user.class.php 2025-06-27 11:43:58.033998000 +0000
@@ -590,25 +590,21 @@
$sql .= " LEFT JOIN ".$this->db->prefix()."c_departements as d ON u.fk_state = d.rowid";
$sql .= " LEFT JOIN ".$this->db->prefix()."establishment as s ON u.fk_establishment = s.rowid";
- if ($id > 0) {
- $sql .= " WHERE u.rowid = ".((int) $id);
+ if ($entity < 0) {
+ if ((!isModEnabled('multicompany') || !getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) && (!empty($user->entity))) {
+ $sql .= " WHERE u.entity IN (0, ".((int) $conf->entity).")";
+ } else {
+ $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database
+ }
} else {
- if ($entity < 0) {
- if ((! isModEnabled('multicompany') || ! getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) && (! empty($user->entity))) {
- $sql .= " WHERE u.entity IN (0, " . ((int) $conf->entity) . ")";
- } else {
- $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database
- }
+ // The fetch was forced on an entity
+ if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) {
+ $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database
} else {
- // The fetch was forced on an entity
- if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) {
- $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database
- } else {
- if ($entity != '' && $entity == 0) { // If $entity = 0
- $sql .= " WHERE u.entity = 0";
- } else { // if $entity is -1 or > 0
- $sql .= " WHERE u.entity IN (0, " . ((int) ($entity > 0 ? $entity : $conf->entity)) . ")";
- }
+ if ($entity != '' && $entity == 0) { // If $entity = 0
+ $sql .= " WHERE u.entity = 0";
+ } else { // if $entity is -1 or > 0
+ $sql .= " WHERE u.entity IN (0, ".((int) ($entity > 0 ? $entity : $conf->entity)).")";
}
}
}
@@ -626,8 +622,9 @@
$sql .= ")";
} elseif ($fk_socpeople > 0) {
$sql .= " AND u.fk_socpeople = ".((int) $fk_socpeople);
+ } else {
+ $sql .= " AND u.rowid = ".((int) $id);
}
-
$sql .= " ORDER BY u.entity ASC"; // Avoid random result when there is 2 login in 2 different entities
if ($sid) {
@@ -3879,12 +3876,13 @@
* fullpath = Full path composed of the ids: "_grandparentid_parentid_id"
*
* @param int $deleteafterid Removed all users including the leaf $deleteafterid (and all its child) in user tree.
- * @param string $filter SQL filter on users. This parameter must NOT come from user input.
+ * @param string $filter SQL filter on users. This parameter must not come from user input.
* @return int<-1,-1>|array,admin:int<0,1>,photo:string,fullpath:string,fullname:string,level:int}> Array of user information (also: $this->users). Note: $this->parentof is also set.
*/
public function get_full_tree($deleteafterid = 0, $filter = '')
{
// phpcs:enable
+ global $conf, $user;
global $hookmanager;
// Actions hooked (by external module)
@@ -3907,7 +3905,7 @@
$sql .= " WHERE u.entity IN (".getEntity('user').")";
}
if ($filter) {
- $sql .= " AND ".$filter; // already sanitized
+ $sql .= " AND ".$filter;
}
dol_syslog(get_class($this)."::get_full_tree get user list", LOG_DEBUG);
########## user/group/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/group/list.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/group/list.php 2025-06-27 11:43:58.057513000 +0000
@@ -371,23 +371,25 @@
print '';
// Action column
if ($conf->main_checkbox_left_column) {
- print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
- $totalarray['nbfield']++;
+ print '| ';
+ $searchpicto = $form->showFilterButtons('left');
+ print $searchpicto;
+ print ' | ';
}
-print_liste_field_titre("Group", $_SERVER["PHP_SELF"], "g.nom", '', $param, "", $sortfield, $sortorder);
+print_liste_field_titre("Group", $_SERVER["PHP_SELF"], "g.nom", $param, "", "", $sortfield, $sortorder);
$totalarray['nbfield']++;
//multicompany
if (isModEnabled('multicompany') && !getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) {
- print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], "g.entity", '', $param, '', $sortfield, $sortorder, 'center ');
+ print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], "g.entity", $param, "", '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++;
}
-print_liste_field_titre("NbOfUsers", $_SERVER["PHP_SELF"], "nb", '', $param, '', $sortfield, $sortorder, 'center ');
+print_liste_field_titre("NbOfUsers", $_SERVER["PHP_SELF"], "nb", $param, "", '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++;
-print_liste_field_titre("NbOfPermissions", $_SERVER["PHP_SELF"], "nbpermissions", '', $param, '', $sortfield, $sortorder, 'center ');
+print_liste_field_titre("NbOfPermissions", $_SERVER["PHP_SELF"], "nbpermissions", $param, "", '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++;
-print_liste_field_titre("DateCreationShort", $_SERVER["PHP_SELF"], "g.datec", '', $param, '', $sortfield, $sortorder, 'center ');
+print_liste_field_titre("DateCreationShort", $_SERVER["PHP_SELF"], "g.datec", $param, "", '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++;
-print_liste_field_titre("DateLastModification", $_SERVER["PHP_SELF"], "g.tms", '', $param, '', $sortfield, $sortorder, 'center ');
+print_liste_field_titre("DateLastModification", $_SERVER["PHP_SELF"], "g.tms", $param, "", '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++;
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
@@ -401,7 +403,7 @@
}*/
// Action column
if (!$conf->main_checkbox_left_column) {
- print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
+ print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
$totalarray['nbfield']++;
}
print ' '."\n";
########## user/group/perms.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/group/perms.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/group/perms.php 2025-06-27 11:43:58.059157000 +0000
@@ -54,7 +54,6 @@
$confirm = GETPOST('confirm', 'alpha');
$module = GETPOST('module', 'alpha');
$rights = GETPOSTINT('rights');
-$updatedmodulename = GETPOST('updatedmodulename', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'groupperms'; // To manage different context of search
if (!isset($id) || empty($id)) {
@@ -225,7 +224,6 @@
dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin);
-
print '';
print ' ';
@@ -266,7 +264,6 @@
print ' ';
-
if ($user->admin) {
print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
print ' ';
@@ -285,14 +282,16 @@
print ' '.$langs->trans("Module").' | ';
if ($permissiontoedit) {
print ' ';
- print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&module=allmodules&confirm=yes">'.$langs->trans("All")."";
+ print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&module=allmodules&confirm=yes">'.$langs->trans("All")."";
print '/';
- print 'id.'&action=delrights&&token='.newToken().'&entity='.$entity.'&module=allmodules&confirm=yes">'.$langs->trans("None")."";
+ print 'id.'&action=delrights&&token='.newToken().'&entity='.$entity.'&module=allmodules&confirm=yes">'.$langs->trans("None")."";
print ' | ';
} else {
print ' | ';
}
print ' | ';
+ //print ' '.$langs->trans("Permissions").' | ';
+
print ' ';
print ''.img_picto('', 'folder-open', 'class="paddingright"').''.$langs->trans("ExpandAll").'';
print ' | ';
@@ -305,7 +304,7 @@
$sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous"
$sql .= " AND r.entity = ".((int) $entity);
if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
- $sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is not enabled
+ $sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is disable
}
$sql .= " ORDER BY r.family_position, r.module_position, r.module, r.id";
@@ -408,12 +407,10 @@
if (in_array($obj->id, $permsgroupbyentity[$entity])) {
// Own permission by group
if ($permissiontoedit) {
- print ' | ';
- print 'id.'&action=delrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&updatedmodulename='.$obj->module.'">';
+ print ' | id.'&action=delrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes">';
//print img_edit_remove($langs->trans("Remove"));
print img_picto($langs->trans("Remove"), 'switch_on');
- print '';
- print ' | ';
+ print '';
}
print ' ';
print img_picto($langs->trans("Active"), 'tick');
@@ -421,20 +418,17 @@
} else {
// Do not own permission
if ($permissiontoedit) {
- print ' | ';
- print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&updatedmodulename='.$obj->module.'">';
+ print ' | id.'&action=addrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes">';
//print img_edit_add($langs->trans("Add"));
print img_picto($langs->trans("Add"), 'switch_off');
- print '';
- print ' | ';
+ print '';
}
print ' | ';
}
} else {
// Do not own permission
if ($permissiontoedit) {
- print ' ';
- print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&updatedmodulename='.$obj->module.'">';
+ print ' | id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
//print img_edit_add($langs->trans("Add"));
print img_picto($langs->trans("Add"), 'switch_off');
print ' | ';
@@ -444,7 +438,7 @@
print ' | ';
}
- // Description of permission (1 column)
+ // Description of permission (2 columns)
print ' ';
print $permlabel;
$idtouse = $obj->id;
@@ -468,8 +462,8 @@
if ($user->admin) {
print ' | ';
$htmltext = $langs->trans("ID").': '.$obj->id;
- $htmltext .= ' '.$langs->trans("Permission").': user->hasRight(\''.dol_escape_htmltag($obj->module).'\', \''.dol_escape_htmltag($obj->perms).'\''.($obj->subperms ? ', \''.dol_escape_htmltag($obj->subperms).'\'' : '').')';
- print $form->textwithpicto('', $htmltext, 1, 'help', 'inline-block marginrightonly');
+ $htmltext .= ' '.$langs->trans("Permission").': user->hasRight(\''.$obj->module.'\', \''.$obj->perms.'\''.($obj->subperms ? ', \''.$obj->subperms.'\'' : '').')';
+ print $form->textwithpicto('', $htmltext, 1, 'help', 'marginrightonly');
//print ''.$obj->id.'';
print ' | ';
} else {
@@ -490,15 +484,15 @@
moduletohide = $(this).data("hide-perms");
j = $(this).data("j");
if ($("#idforbreakperms_"+moduletohide).val() == 1) {
- console.log("idforbreakperms_"+moduletohide+" has value hidden=1, so we show all lines");
+ console.log("idforbreakperms_"+moduletohide+" has value hidden=1");
$(".trtohide_"+moduletohide).show();
$(".permtoshow_"+moduletohide).hide();
$(".permtohide_"+moduletohide).show();
$(".folderperms_"+moduletohide).hide();
$(".folderopenperms_"+moduletohide).show();
$("#idforbreakperms_"+moduletohide).val("0");
- } else if (! $(this).hasClass("tdforbreakpermsifnotempty")) {
- console.log("idforbreakperms_"+moduletohide+" has value hidden=0, so we hide all lines");
+ } else {
+ console.log("idforbreakperms_"+moduletohide+" has value hidden=0");
$(".trtohide_"+moduletohide).hide();
$(".folderopenperms_"+moduletohide).hide();
$(".folderperms_"+moduletohide).show();
@@ -525,7 +519,6 @@
document.cookie = "DOLUSER_PERMS_HIDE_GRP=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/ ";
}
});';
- print "\n";
// Button expand / collapse all
print '$(".showallperms").on("click", function(){
@@ -561,6 +554,7 @@
cursor: pointer;
}';
print '';
+ print ' ';
$parameters = array();
$reshook = $hookmanager->executeHooks('insertExtraFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
########## user/list.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/list.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/list.php 2025-06-27 11:43:58.062983000 +0000
@@ -305,6 +305,7 @@
$uploaddir = $conf->user->dir_output;
global $error;
+ include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
// Disable or Enable records
if (!$error && ($massaction == 'disable' || $massaction == 'reactivate') && $permissiontoadd) {
@@ -315,7 +316,7 @@
$nbok = 0;
foreach ($toselect as $toselectid) {
if ($toselectid == $user->id) {
- setEventMessages($langs->trans($massaction == 'disable' ? 'CantDisableYourself' : 'CanEnableYourself'), null, 'errors');
+ setEventMessages($langs->trans($massaction == 0 ? 'CantDisableYourself' : 'CanEnableYourself'), null, 'errors');
$error++;
break;
}
@@ -323,7 +324,7 @@
$result = $objecttmp->fetch($toselectid);
if ($result > 0) {
if ($objecttmp->admin) {
- setEventMessages($langs->trans($massaction == 'disable' ? 'CantDisableAnAdminUserWithMassActions' : 'CantEnableAnAdminUserWithMassActions', $objecttmp->login), null, 'errors');
+ setEventMessages($langs->trans($massaction == 0 ? 'CantDisableAnAdminUserWithMassActions' : 'CantEnableAnAdminUserWithMassActions', $objecttmp->login), null, 'errors');
$error++;
break;
}
@@ -359,12 +360,7 @@
} else {
$db->rollback();
}
-
- $massaction = '';
}
-
- // Generic mass actions
- include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
########## user/passwordforgotten.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/passwordforgotten.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/passwordforgotten.php 2025-06-27 11:43:58.065345000 +0000
@@ -190,16 +190,11 @@
$dol_url_root = DOL_URL_ROOT;
-$appli = constant('DOL_APPLICATION_TITLE');
-$applicustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
-if ($applicustom) {
- $appli = (preg_match('/^\+/', $applicustom) ? $appli : '').$applicustom;
-} else {
- $appli .= " ".DOL_VERSION;
-}
-
// Title
-$title = $appli; // $title is used in .tpl file
+$title = 'Dolibarr '.DOL_VERSION;
+if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
+ $title = getDolGlobalString('MAIN_APPLICATION_TITLE');
+}
// Select templates dir
$template_dir = '';
########## user/perms.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/user/perms.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/user/perms.php 2025-06-27 11:43:58.067233000 +0000
@@ -332,7 +332,6 @@
print '';
print ' ';
-
if ($user->admin) {
print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
}
@@ -348,6 +347,9 @@
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
+//$listofexpandedmodules = array();
+
+
print "\n";
print '';
print ' ';
@@ -364,6 +366,7 @@
print ' | ';
}
print ' | ';
+//print ' | ';
print '';
print ''.img_picto('', 'folder-open', 'class="paddingright"').''.$langs->trans("ExpandAll").'';
print ' | ';
@@ -629,7 +632,7 @@
// Do not own permission
if ($caneditperms) {
print ' | ';
- print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&updatedmodulename='.$obj->module.'">';
+ print 'id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'&updatedmodulename='.$obj->module.'">';
//print img_edit_add($langs->trans("Add"));
print img_picto($langs->trans("Add"), 'switch_off');
print '';
@@ -647,7 +650,7 @@
print '';
if ($caneditperms) {
print ' | ';
- print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&updatedmodulename='.$obj->module.'">';
+ print 'id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'&updatedmodulename='.$obj->module.'">';
//print img_edit_add($langs->trans("Add"));
print img_picto($langs->trans("Add"), 'switch_off');
print '';
########## variants/class/ProductCombination.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/variants/class/ProductCombination.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/variants/class/ProductCombination.class.php 2025-06-27 11:43:59.934774000 +0000
@@ -4,7 +4,6 @@
* Copyright (C) 2022 Open-Dsi
* Copyright (C) 2024-2025 MDW
* Copyright (C) 2024-2025 Frédéric France
- * Copyright (C) 2025 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
@@ -468,36 +467,34 @@
/**
* Deletes all product combinations of a parent product
*
- * @param User $user Object user
- * @param int $fk_product_parent Rowid of parent product
- * @return int Return integer <0 if KO, >0 if OK
+ * @param User $user Object user
+ * @param int $fk_product_parent Rowid of parent product
+ * @return int Return integer <0 KO >0 OK
*/
public function deleteByFkProductParent($user, $fk_product_parent)
{
- $arrayofparent = $this->fetchAllByFkProductParent($fk_product_parent);
-
- if (!is_array($arrayofparent)) { // No combinations found, return success
- return 1;
- }
-
$this->db->begin();
- foreach ($arrayofparent as $prodcomb) {
- $prodstatic = new Product($this->db);
+ $arrayofparent = $this->fetchAllByFkProductParent($fk_product_parent);
- $res = $prodstatic->fetch($prodcomb->fk_product_child);
+ if (is_array($arrayofparent)) {
+ foreach ($arrayofparent as $prodcomb) {
+ $prodstatic = new Product($this->db);
- if ($res > 0) {
- $res = $prodcomb->delete($user);
- }
+ $res = $prodstatic->fetch($prodcomb->fk_product_child);
- if ($res > 0 && !$prodstatic->isObjectUsed($prodstatic->id)) {
- $res = $prodstatic->delete($user);
- }
+ if ($res > 0) {
+ $res = $prodcomb->delete($user);
+ }
- if ($res < 0) {
- $this->db->rollback();
- return -1;
+ if ($res > 0 && !$prodstatic->isObjectUsed($prodstatic->id)) {
+ $res = $prodstatic->delete($user);
+ }
+
+ if ($res < 0) {
+ $this->db->rollback();
+ return -1;
+ }
}
}
########## waf.inc.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/waf.inc.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/waf.inc.php 2025-06-27 11:43:57.339048000 +0000
@@ -92,9 +92,9 @@
}
/**
- * Security: WAF layer for SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST, SERVER['PHP_SELF']).
- * Warning: Such a protection seems enough for SERVER['PHP_SELF'] but can't be enough for GET and POST. It is not reliable as it will always be possible
- * to bypass this. Good protection can only be guaranteed by escaping data during output.
+ * Security: WAF layer for SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST, PHP_SELF).
+ * Warning: Such a protection can't be enough. It is not reliable as it will always be possible to bypass this. Good protection can
+ * only be guaranteed by escaping data during output.
*
* @param string $val Brute value found into $_GET, $_POST or PHP_SELF
* @param int<0, 3> $type 0=POST, 1=GET, 2=PHP_SELF, 3=GET without sql reserved keywords (the less tolerant test)
@@ -235,7 +235,7 @@
}
}
if ($type == 2) {
- $inj += preg_match('/[:;"\'<>\?\(\){}\$%#]/', $val); // PHP_SELF is a file system (or url path without parameters). It can contains spaces.
+ $inj += preg_match('/[:;"\'<>\?\(\){}\$%]/', $val); // PHP_SELF is a file system (or url path without parameters). It can contains spaces.
}
return $inj;
@@ -264,7 +264,7 @@
} else {
http_response_code(403);
- // Get remote IP: PS: We do not use getUserRemoteIP(), function is not yet loaded and we need a value that can't be spoofed
+ // Get remote IP: PS: We do not use getRemoteIP(), function is not yet loaded and we need a value that can't be spoofed
$ip = (empty($_SERVER['REMOTE_ADDR']) ? 'unknown' : $_SERVER['REMOTE_ADDR']);
if ($stopcode) {
########## webservices/server_user.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/webservices/server_user.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/webservices/server_user.php 2025-06-27 11:44:00.048952000 +0000
@@ -561,7 +561,7 @@
$sql = "SELECT rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."c_country";
$sql .= " WHERE active = 1";
- $sql .= " AND code = '".$db->escape($thirdparty->country_code)."'";
+ $sql .= " AND code='".$db->escape($thirdparty->country_code)."'";
$resql = $db->query($sql);
if ($resql) {
@@ -575,12 +575,13 @@
$thirdparty->fax = $thirdpartywithuser['fax'];
$thirdparty->email = $thirdpartywithuser['email'];
$thirdparty->url = $thirdpartywithuser['url'];
- $thirdparty->idprof1 = $thirdpartywithuser['profid1'];
- $thirdparty->idprof2 = $thirdpartywithuser['profid2'];
- $thirdparty->idprof3 = $thirdpartywithuser['profid3'];
- $thirdparty->idprof4 = $thirdpartywithuser['profid4'];
- $thirdparty->idprof5 = $thirdpartywithuser['profid5'];
- $thirdparty->idprof6 = $thirdpartywithuser['profid6'];
+ $thirdparty->ape = $thirdpartywithuser['ape'];
+ $thirdparty->idprof1 = $thirdpartywithuser['prof1'];
+ $thirdparty->idprof2 = $thirdpartywithuser['prof2'];
+ $thirdparty->idprof3 = $thirdpartywithuser['prof3'];
+ $thirdparty->idprof4 = $thirdpartywithuser['prof4'];
+ $thirdparty->idprof5 = $thirdpartywithuser['prof5'];
+ $thirdparty->idprof6 = $thirdpartywithuser['prof6'];
$thirdparty->client = (int) $thirdpartywithuser['client'];
$thirdparty->fournisseur = (int) $thirdpartywithuser['fournisseur'];
########## website/index.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/website/index.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/website/index.php 2025-06-27 11:44:00.003022000 +0000
@@ -834,7 +834,6 @@
}
if (!$error) {
- // Download URL to grab
$tmp = getURLContent($urltograb, 'GET', '', 1, array(), array('http', 'https'), 0);
// Test charset of result and convert it into UTF-8 if not in this encoding charset
@@ -923,7 +922,7 @@
}
if (preg_match('/lang = $tmplang[0].(empty($tmplang[1]) ? '' : '_'.strtoupper($tmplang[1]));
+ $objectpage->lang = $tmplang[0].($tmplang[1] ? '_'.strtoupper($tmplang[1]) : '');
}
$tmp['content'] = preg_replace('/\s*/ims', '', $tmp['content']);
@@ -1082,7 +1081,7 @@
//dolChmod($file);
// $filename = 'image/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $linkwithoutdomain)?'':'/').$linkwithoutdomain;
- $pagecsscontent .= "\n".'/* Content of file '.$urltograbbis.' */'."\n";
+ $pagecsscontent .= '/* Content of file '.$urltograbbis.' */'."\n";
getAllImages($object, $objectpage, $urltograbbis, $tmpgeturl['content'], $action, 1, $grabimages, $grabimagesinto);
@@ -4733,8 +4732,6 @@
print ' ';
}
-
-
print '';
if ($action != 'createcontainer') {
@@ -5187,8 +5184,6 @@
print ' ';
if ($action == 'createcontainer') {
- $langs->load("website");
-
print '';
print '';
@@ -5196,17 +5191,14 @@
print ' ';
+
print ' ';
if (!empty($conf->use_javascript_ajax)) {
print ' ';
}
- print ' ';
+ print ' ';
print ' ';
-
- print info_admin($langs->trans("OnlyEditionOfSourceForGrabbedContentFuture"), 0, 0, 'warning tablecheckboxcreatefromfetching'.$hiddenfromfetchingafterload);
- print ' ';
-
print '';
}
@@ -5292,6 +5288,9 @@
});
';
}
+ //print '';
+
+ //print dol_get_fiche_end();
print '';
########## workstation/class/api_workstations.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/workstation/class/api_workstations.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/workstation/class/api_workstations.class.php 2025-06-27 11:44:00.017861000 +0000
@@ -117,7 +117,7 @@
$obj_ret = array();
- $socid = DolibarrApiAccess::$user->socid ?: '';
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
$sql = "SELECT t.rowid, t.ref";
$sql .= " FROM ".$this->db->prefix()."workstation_workstation as t";
########## zapier/class/api_zapier.class.php
--- /homez.786/ridinteadu/_serious_analysis/van_22.0.0/dolibarr-22.0.0/htdocs/zapier/class/api_zapier.class.php 2025-08-04 13:08:35.000000000 +0000
+++ /homez.786/ridinteadu/seriousalpha/dolibarr/htdocs/zapier/class/api_zapier.class.php 2025-06-27 11:44:00.107639000 +0000
@@ -155,7 +155,7 @@
$obj_ret = array();
- $socid = DolibarrApiAccess::$user->socid ?: 0;
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
// Set to 1 if there is a field socid in table of object
$restrictonsocid = 0;
| |