Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
ldestailleur 2025-10-09 05:59:53 +02:00
commit 56c616d65a
8 changed files with 92 additions and 63 deletions

View file

@ -6840,12 +6840,6 @@ parameters:
count: 2
path: ../../../htdocs/core/lib/admin.lib.php
-
message: '#^Variable \$strictw3c in empty\(\) always exists and is not falsy\.$#'
identifier: empty.variable
count: 13
path: ../../../htdocs/core/lib/admin.lib.php
-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
@ -14580,12 +14574,6 @@ parameters:
count: 1
path: ../../../htdocs/public/eventorganization/subscriptionok.php
-
message: '#^Variable \$suffix might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/public/eventorganization/subscriptionok.php
-
message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType

View file

@ -37,6 +37,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
/**
* @var Conf $conf
@ -76,9 +77,63 @@ $error = 0;
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
global $conf;
if ($action == 'updateMask') {
$maskconst = GETPOST('maskconst', 'aZ09');
$maskvalue = GETPOST('maskvalue', 'alpha');
if ($action == 'set_default') {
$res = 0;
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
}
if (!($res > 0)) {
$error++;
}
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
} elseif ($action == 'specimen') { // For fiche expensereport
$modele = GETPOST('module', 'alpha');
$adherentspecimen = new Adherent($db);
$adherentspecimen->initAsSpecimen();
$adherentspecimen->status = 0; // Force statut draft to show watermark
// Search template files
$file = '';
$classname = '';
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir."core/modules/member/doc/pdf_".$modele.".modules.php", 0);
if (file_exists($file)) {
$classname = "pdf_".$modele;
break;
}
}
if ($classname !== '') {
require_once $file;
$module = new $classname($db);
'@phan-var-force ModelePDFMember $module';
/** @var ModelePDFMember $module */
if ($module->write_file($adherentspecimen, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=member&file=SPECIMEN.pdf");
return;
} else {
setEventMessages($module->error, $module->errors, 'errors');
dol_syslog($module->error, LOG_ERR);
}
} else {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
} elseif ($action == 'set_default') {
$ret = addDocumentModel($value, $type, $label, $scandir);
$res = true;
} elseif ($action == 'del_default') {
@ -286,6 +341,7 @@ foreach ($dirModMember as $dirroot) {
continue;
}
$modCodeMember = new $file();
/** @var ModeleNumRefMembers $modCodeMember */
// Show modules according to features level
if ($modCodeMember->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;

View file

@ -892,6 +892,16 @@ class Documents extends DolibarrApi
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$object = new Contact($this->db);
$fetchbyid = true;
} elseif ($modulepart == 'societe' || $modulepart == 'company') {
$modulepart = 'societe';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$object = new Societe($this->db);
$fetchbyid = true;
} elseif ($modulepart == 'ticket' ) {
$modulepart = 'ticket';
require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
$object = new Ticket($this->db);
$fetchbyid = true;
} elseif ($modulepart == 'contrat' || $modulepart == 'contract') {
$modulepart = 'contrat';
require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2009-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2009-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* 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
@ -94,9 +94,6 @@ function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages =
}
require_once '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
/**
* @var Conf $conf
* @var DoliDB $db
@ -105,6 +102,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
* @var User $user
*/
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// Security check
if (!isModEnabled('clicktodial')) {
accessforbidden();
@ -112,34 +112,9 @@ if (!isModEnabled('clicktodial')) {
// Define Asterisk setup
if (!getDolGlobalString('ASTERISK_HOST')) {
$conf->global->ASTERISK_HOST = "127.0.0.1";
}
if (!getDolGlobalString('ASTERISK_TYPE')) {
$conf->global->ASTERISK_TYPE = "SIP/";
}
if (!getDolGlobalString('ASTERISK_INDICATIF')) {
$conf->global->ASTERISK_INDICATIF = "0";
}
if (!getDolGlobalString('ASTERISK_PORT')) {
$conf->global->ASTERISK_PORT = 5038;
}
if (getDolGlobalString('ASTERISK_INDICATIF') == 'NONE') {
$conf->global->ASTERISK_INDICATIF = '';
}
if (!getDolGlobalString('ASTERISK_CONTEXT')) {
$conf->global->ASTERISK_CONTEXT = "from-internal";
}
if (!getDolGlobalString('ASTERISK_WAIT_TIME')) {
$conf->global->ASTERISK_WAIT_TIME = "30";
}
if (!getDolGlobalString('ASTERISK_PRIORITY')) {
$conf->global->ASTERISK_PRIORITY = "1";
}
if (!getDolGlobalString('ASTERISK_MAX_RETRY')) {
$conf->global->ASTERISK_MAX_RETRY = "2";
}
$login = GETPOST('login', 'alphanohtml');
$password = GETPOST('password', 'password');
@ -153,29 +128,29 @@ $caller = preg_replace('/[\n\r]/', '', $caller);
$called = preg_replace('/[\n\r]/', '', $called);
// IP address of Asterisk server
$strHost = getDolGlobalString('ASTERISK_HOST');
$strHost = getDolGlobalString('ASTERISK_HOST', '127.0.0.1');
// Specify the type of extension through which your extension is connected.
// ex: SIP/, IAX2/, ZAP/, etc
$channel = getDolGlobalString('ASTERISK_TYPE');
$channel = getDolGlobalString('ASTERISK_TYPE', 'SIP/');
// Outgoing call sign
$prefix = getDolGlobalString('ASTERISK_INDICATIF');
$prefix = getDolGlobalString('ASTERISK_INDICATIF', '0');
// Asterisk Port
$port = getDolGlobalString('ASTERISK_PORT');
$port = getDolGlobalInt('ASTERISK_PORT', 5038);
// Context ( generalement from-internal )
$strContext = getDolGlobalString('ASTERISK_CONTEXT');
$strContext = getDolGlobalString('ASTERISK_CONTEXT', 'from-internal');
// Waiting time before hanging up
$strWaitTime = getDolGlobalString('ASTERISK_WAIT_TIME');
$strWaitTime = getDolGlobalString('ASTERISK_WAIT_TIME', '30');
// Priority
$strPriority = getDolGlobalString('ASTERISK_PRIORITY');
$strPriority = getDolGlobalString('ASTERISK_PRIORITY', '1');
// Number of call attempts
$strMaxRetry = getDolGlobalString('ASTERISK_MAX_RETRY');
$strMaxRetry = getDolGlobalString('ASTERISK_MAX_RETRY', "2");
/*

View file

@ -465,7 +465,7 @@ if ($action == 'create') {
print '</td>';
// Amount
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.dol_escape_htmltag(GETPOST("amount")).'" size="10"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.dol_escape_htmltag(GETPOST("amount")).'" size="10" spellcheck="false"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
// Public donation
print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
@ -494,7 +494,7 @@ if ($action == 'create') {
}
print '</td></tr>';
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td>'.img_picto('', 'object_email', 'class="paddingrightonly"').'<input type="text" name="email" value="'.dol_escape_htmltag(GETPOST("email")).'" class="maxwidth200"></td></tr>';
print '<tr><td>'.$langs->trans("EMail").'</td><td>'.img_picto('', 'object_email', 'class="paddingrightonly"').'<input type="text" name="email" value="'.dol_escape_htmltag(GETPOST("email")).'" class="maxwidth200" spellcheck="false"></td></tr>';
}
// Payment mode
@ -588,7 +588,7 @@ if (!empty($id) && $action == 'edit') {
// Amount
if ($object->status == 0) {
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10" value="'.price($object->amount).'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10" value="'.price($object->amount).'" spellcheck="false"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
} else {
print '<tr><td>'.$langs->trans("Amount").'</td><td>';
print price($object->amount, 0, $langs, 0, 0, -1, $conf->currency);
@ -632,7 +632,7 @@ if (!empty($id) && $action == 'edit') {
}
print '</td></tr>';
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" class="maxwidth200" value="'.dol_escape_htmltag($object->email).'"></td></tr>';
print '<tr><td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" class="maxwidth200" value="'.dol_escape_htmltag($object->email).'" spellcheck="false"></td></tr>';
}
// Payment mode
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";

View file

@ -219,7 +219,7 @@ if ($action == 'create') {
print '<tr><td>'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
print '</td>';
print '<td colspan="2"><input name="num_payment" type="text" value="'.GETPOST('num_payment').'"></td></tr>'."\n";
print '<td colspan="2"><input name="num_payment" type="text" value="'.GETPOST('num_payment').'" spellcheck="false"></td></tr>'."\n";
// Check transmitter
print '<tr><td class="'.(GETPOST('paiementcode') == 'CHQ' ? 'fieldrequired ' : '').'fieldrequireddyn">'.$langs->trans('CheckTransmitter');

View file

@ -1308,7 +1308,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print '<input type="hidden" name="user_mobile" value="'.dol_escape_htmltag($ldap_mobile).'">';
print $ldap_mobile;
} else {
print '<input class="maxwidth200 widthcentpercentminusx" type="text" name="user_mobile" value="'.dol_escape_htmltag(GETPOST('user_mobile', 'alphanohtml')).'">';
print '<input class="maxwidth200 widthcentpercentminusx" type="text" name="user_mobile" value="'.dol_escape_htmltag(GETPOST('user_mobile', 'alphanohtml')).'" spellcheck="false">';
}
print '</td></tr>';
@ -1332,7 +1332,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print '<input type="hidden" name="email" value="'.dol_escape_htmltag($ldap_mail).'">';
print $ldap_mail;
} else {
print '<input type="text" name="email" class="maxwidth500 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOST('email', 'alphanohtml')).'">';
print '<input type="text" name="email" class="maxwidth500 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOST('email', 'alphanohtml')).'" spellcheck="false">';
}
print '</td></tr>';
@ -2377,7 +2377,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print "<tr>".'<td><span class="fieldrequired">'.$langs->trans("Login").'</span></td>';
print '<td>';
if ($user->admin && !$object->ldap_sid) {
print '<input maxlength="50" type="text" class="flat" name="login" value="'.$object->login.'">';
print '<input maxlength="50" type="text" class="flat" name="login" value="'.$object->login.'" spellcheck="false">';
} else {
print '<input type="hidden" name="login" value="'.$object->login.'">';
print $object->login;
@ -2769,7 +2769,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print '<td>';
print img_picto('', 'phoning_mobile', 'class="pictofixedwidth"');
if ($permissiontoedit && empty($object->ldap_sid)) {
print '<input type="text" name="user_mobile" class="flat maxwidth200 widthcentpercentminusx" value="'.$object->user_mobile.'">';
print '<input type="text" name="user_mobile" class="flat maxwidth200 widthcentpercentminusx" value="'.$object->user_mobile.'" spellcheck="false">';
} else {
print '<input type="hidden" name="user_mobile" value="'.$object->user_mobile.'">';
print $object->user_mobile;

View file

@ -718,7 +718,7 @@ if (!empty($id) || !empty($ref)) {
} ?>
<tr>
<td><label for="reference"><?php echo $langs->trans('Reference') ?></label></td>
<td><input type="text" id="reference" name="reference" value="<?php echo trim($reference) ?>"></td>
<td><input type="text" id="reference" name="reference" value="<?php echo trim($reference) ?>" spellcheck="false"></td>
</tr>
<?php
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {