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

This commit is contained in:
ldestailleur 2025-09-12 13:30:12 +02:00
commit 8b57bb2e41
48 changed files with 211 additions and 337 deletions

View file

@ -0,0 +1,24 @@
# See syntax file on https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: "Check tag branch"
on:
push:
tags:
- "18.*"
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Verify tag is on main
run: |
TAG_COMMIT=$(git rev-list -n 1 $GITHUB_REF)
if ! git branch --contains $TAG_COMMIT | grep -q "18.0"; then
echo "The tag must be on branch 18.0"
exit 1
fi

View file

@ -1,4 +1,5 @@
name: Test github actions
on:
workflow_dispatch:
pull_request:

View file

@ -78,7 +78,7 @@ while ($i < $argc) {
$tmp = explode(':', $result['includeconstant'], 3); // $includeconstant has been set with previous parse_str()
if (count($tmp) != 3) {
print "Error: Bad parameter includeconstant=".$result['includeconstant'] ."\n";
exit -1;
exit(1);
}
$includeconstants[$tmp[0]][$tmp[1]] = $tmp[2];
}
@ -180,7 +180,7 @@ fputs($fp, '<dolibarr_htdocs_dir includecustom="'.$includecustom.'">'."\n");
// Define qualified files (must be same than into generate_filelist_xml.php and in api_setup.class.php)
$regextoinclude = '\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
$regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
$regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|escpos-php\/doc|escpos-php\/example|escpos-php\/test|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
$dir = '';

View file

@ -446,6 +446,15 @@ if ($nboftargetok) {
print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/dev/build/generate_filelist_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n";
$ret=`php $SOURCE/dev/build/generate_filelist_xml.php release=$MAJOR.$MINOR.$BUILD`;
my $retcode=$?;
if ($retcode!=0)
{
print "Error running generate_filelist_xml.php please check\n";
print $ret;
print "Canceled.\n";
exit;
}
print $ret."\n";
# Copy to final dir
$NEWDESTI=$DESTI;

View file

@ -696,114 +696,6 @@ parameters:
count: 1
path: ../../../htdocs/adherents/card.php
-
message: '#^Call to function is_array\(\) with array will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 2
path: ../../../htdocs/adherents/class/adherent.class.php
-
message: '#^Call to function method_exists\(\) with \$this\(Adherent\) and ''getLibStatut'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../../htdocs/adherents/class/adherent.class.php
-
message: '#^Call to function method_exists\(\) with \$this\(Adherent\) and ''getNomUrl'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../../htdocs/adherents/class/adherent.class.php
-
message: '#^Call to function property_exists\(\) with \$this\(Adherent\) and ''photo'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../../htdocs/adherents/class/adherent.class.php
-
message: '#^Call to function property_exists\(\) with \$this\(Adherent\) and ''societe'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../../htdocs/adherents/class/adherent.class.php
-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
count: 1
path: ../../../htdocs/adherents/class/adherent.class.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
count: 5
path: ../../../htdocs/adherents/class/adherent.class.php
-
message: '#^Property Adherent\:\:\$last_subscription_amount \(int\|string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../../htdocs/adherents/class/adherent.class.php
-
message: '#^Ternary operator condition is always false\.$#'
identifier: ternary.alwaysFalse
count: 1
path: ../../../htdocs/adherents/class/adherent.class.php
-
message: '#^Call to function method_exists\(\) with \$this\(AdherentType\) and ''getLibStatut'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../../htdocs/adherents/class/adherent_type.class.php
-
message: '#^Call to function method_exists\(\) with \$this\(AdherentType\) and ''getNomUrl'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../../htdocs/adherents/class/adherent_type.class.php
-
message: '#^Call to function property_exists\(\) with \$this\(AdherentType\) and ''amount'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../../htdocs/adherents/class/adherent_type.class.php
-
message: '#^Call to function property_exists\(\) with \$this\(AdherentType\) and ''vote'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../../htdocs/adherents/class/adherent_type.class.php
-
message: '#^Loose comparison using \!\= between '''' and ''nolink'' will always evaluate to true\.$#'
identifier: notEqual.alwaysTrue
count: 1
path: ../../../htdocs/adherents/class/adherent_type.class.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
count: 1
path: ../../../htdocs/adherents/class/adherent_type.class.php
-
message: '#^Property AdherentType\:\:\$duration \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../../htdocs/adherents/class/adherent_type.class.php
-
message: '#^Property AdherentType\:\:\$subscription \(int\<0, 1\>\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../../htdocs/adherents/class/adherent_type.class.php
-
message: '#^Property AdherentType\:\:\$vote \(int\<0, 1\>\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../../htdocs/adherents/class/adherent_type.class.php
-
message: '#^Call to function property_exists\(\) with \$this\(Subscription\) and ''amount'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -2124,12 +2016,6 @@ parameters:
count: 1
path: ../../../htdocs/bookcal/availabilities_card.php
-
message: '#^Property Availabilities\:\:\$status \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../../htdocs/bookcal/availabilities_card.php
-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
@ -2178,12 +2064,6 @@ parameters:
count: 1
path: ../../../htdocs/bookcal/booking_list.php
-
message: '#^Property Calendar\:\:\$status \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../../htdocs/bookcal/booking_list.php
-
message: '#^Variable \$lineid might not be defined\.$#'
identifier: variable.undefined
@ -2220,12 +2100,6 @@ parameters:
count: 1
path: ../../../htdocs/bookcal/calendar_card.php
-
message: '#^Property Calendar\:\:\$status \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../../htdocs/bookcal/calendar_card.php
-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
@ -10626,30 +10500,6 @@ parameters:
count: 1
path: ../../../htdocs/don/document.php
-
message: '#^Variable \$badgeStatus0 might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/don/index.php
-
message: '#^Variable \$badgeStatus1 might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/don/index.php
-
message: '#^Variable \$badgeStatus6 might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/don/index.php
-
message: '#^Variable \$badgeStatus9 might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/don/index.php
-
message: '#^Variable \$maxlength might not be defined\.$#'
identifier: variable.undefined
@ -10722,12 +10572,6 @@ parameters:
count: 1
path: ../../../htdocs/ecm/search.php
-
message: '#^Variable \$langs might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/ecm/tpl/enablefiletreeajax.tpl.php
-
message: '#^Variable \$param might not be defined\.$#'
identifier: variable.undefined
@ -18517,7 +18361,7 @@ parameters:
path: ../../../htdocs/societe/class/societe.class.php
-
message: '#^Property Contact\:\:\$roles \(array\<int, array\{id\: int, socid\: int, element\: string, source\: string, code\: string, label\: string\}\>|null\) does not accept non\-empty\-list\<string\>\.$#'
message: '#^Property Contact\:\:\$roles \(array\<int, array\{id\: int, socid\: int, element\: string, source\: string, code\: string, label\: string\}\>\|null\) does not accept non\-empty\-list\<string\>\.$#'
identifier: assign.propertyType
count: 1
path: ../../../htdocs/societe/class/societe.class.php

View file

@ -57,7 +57,7 @@ if (empty($argv[1])) {
print "Usage: $script_file nbofrecord\n";
print "Usage: $script_file 100\n";
print "\n";
exit(-1);
exit(1);
}
define('GEN_NUMBER_FACTURE', ((int) $argv[1]) ?? 1);

View file

@ -64,7 +64,7 @@ if (empty($argv[1])) {
print "Usage: $script_file nbofrecord\n";
print "Usage: $script_file 100\n";
print "\n";
exit(-1);
exit(1);
}
define('GEN_NUMBER_COMMANDE', ((int) $argv[1]) ?? 10);

View file

@ -62,7 +62,7 @@ if (empty($argv[1])) {
print "Usage: $script_file nbofrecord\n";
print "Usage: $script_file 100\n";
print "\n";
exit(-1);
exit(1);
}
define('GEN_NUMBER_PRODUIT', ((int) $argv[1]) ?? 100);

View file

@ -60,7 +60,7 @@ if (empty($argv[1])) {
print "Usage: $script_file nbofrecord\n";
print "Usage: $script_file 100\n";
print "\n";
exit(-1);
exit(1);
}
define('GEN_NUMBER_PROPAL', ((int) $argv[1]) ?? 10);

View file

@ -65,7 +65,7 @@ if (empty($argv[1])) {
print "Usage: $script_file nbofrecord\n";
print "Usage: $script_file 100\n";
print "\n";
exit(-1);
exit(1);
}
define('GEN_NUMBER_SOCIETE', ((int) $argv[1]) ?? 10);

View file

@ -71,12 +71,12 @@ if (empty($mode) || ! in_array($mode, array('test','confirm','confirmforced')) |
print "Usage: $script_file (test|confirm|confirmforced) filepath.csv [defaultlang] [startlinenb] [endlinenb]\n";
print "Usage: $script_file test myfilepath.csv fr_FR 2 1002\n";
print "\n";
exit(-1);
exit(1);
}
if (! file_exists($filepath)) {
print "Error: File ".$filepath." not found.\n";
print "\n";
exit(-1);
exit(1);
}
$ret = $user->fetch('', 'admin');

View file

@ -71,12 +71,12 @@ if (empty($mode) || ! in_array($mode, array('test','confirm','confirmforced')) |
print "Usage: $script_file (test|confirm|confirmforced) filepath.csv [startlinenb] [endlinenb]\n";
print "Usage: $script_file test myfilepath.csv 2 1002\n";
print "\n";
exit(-1);
exit(1);
}
if (! file_exists($filepath)) {
print "Error: File ".$filepath." not found.\n";
print "\n";
exit(-1);
exit(1);
}
$ret = $user->fetch('', 'admin');

View file

@ -71,12 +71,12 @@ if (empty($mode) || ! in_array($mode, array('test','confirm','confirmforced')) |
print "Usage: $script_file (test|confirm|confirmforced) filepath.csv [startlinenb] [endlinenb]\n";
print "Usage: $script_file test myfilepath.csv 2 1002\n";
print "\n";
exit(-1);
exit(1);
}
if (! file_exists($filepath)) {
print "Error: File ".$filepath." not found.\n";
print "\n";
exit(-1);
exit(1);
}
$ret=$user->fetch('', 'admin');

View file

@ -32,7 +32,7 @@ $path=__DIR__.'/';
// Test si mode batch
if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit(-1);
exit(1);
}
// Recupere root dolibarr
@ -187,13 +187,13 @@ if (empty($mode) || ! in_array($mode, array('test','confirm'))) {
print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
print "\n";
print "option can be ".implode(',', array_keys($sqls))."\n";
exit(-1);
exit(1);
}
if (empty($option)) {
print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
print "\n";
print "option must be defined with a value in list ".implode(',', array_keys($sqls))."\n";
exit(-1);
exit(1);
}
if ($option != 'all') {
$listofoptions=explode(',', $option);
@ -202,7 +202,7 @@ if ($option != 'all') {
print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
print "\n";
print "option '".$cursoroption."' must be in list ".implode(',', array_keys($sqls))."\n";
exit(-1);
exit(1);
}
}
}
@ -211,7 +211,7 @@ if (empty($date) || (! preg_match('/\d\d\d\d\-\d\d\-\d\d$/', $date) && $date !=
print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
print "\n";
print "date can be 'all' or 'YYYY-MM-DD' to delete record before YYYY-MM-DD\n";
exit(-1);
exit(1);
}
if ($date == 'all') {

View file

@ -84,7 +84,7 @@ if (empty($sourceserver) || empty($server) || empty($login) || empty($sourcefile
print "Usage: $script_file login@server:/src/file.(sql|gz|bz2) passssh databaseserver databasename loginbase passbase\n";
print "Return code: 0 if success, <>0 if error\n";
print "Warning, this script may take a long time.\n";
exit(-1);
exit(1);
}
@ -106,7 +106,7 @@ $connection = ssh2_connect($server, 22);
if ($connection) {
if (!@ssh2_auth_password($connection, $login, $password)) {
dol_syslog("Could not authenticate with username ".$login." . and password ".preg_replace('/./', '*', $password), LOG_ERR);
exit(-5);
exit(5);
} else {
//$stream = ssh2_exec($connection, '/usr/bin/php -i');
/*
@ -143,7 +143,7 @@ if ($connection) {
}
} else {
print 'Failed to connect to ssh2 to '.$server;
exit(-6);
exit(6);
}

View file

@ -72,7 +72,7 @@ print "Update dates to current year for database name = ".$db->database_name."\n
if (empty($confirm)) {
print "Usage: $script_file confirm\n";
print "Return code: 0 if success, <>0 if error\n";
exit(-1);
exit(1);
}

View file

@ -358,7 +358,6 @@ ErrorTechnicalError
ErrorThirdPartyIdIsMandatory
ErrorTicketIsNotValid
ErrorTitreAlreadyExists
ErrorUpdatingUsersCP
ErrorUserFetch
ErrorValueMustBeInteger
ErrorValueTooHigh
@ -806,7 +805,6 @@ Templates
TestPrinterTemplate
TestTemplateToPrinter
Theme
ThirdpartyHasNoDefaultBanAccount
ThisIsInformationOnDocumentToSign
ThisScreenAllowsYouToSignDocFrom
TicketCategoryShort
@ -843,8 +841,6 @@ UpdateUser
UpgradeHasBeenUnlocked
Url
Use of API for currency update is disabled by option MULTICURRENCY_DISABLE_SYNC_CURRENCYLAYER
UserRemovedFromGroup
UserSetInGroup
VCard
Vacant
ValidateAndSign
@ -870,7 +866,6 @@ Widgets
Windows
WorkingBoard
Workload
WrongAmount
XDebug
XmlCorrupted
Y

View file

@ -283,12 +283,12 @@ class Adherent extends CommonObject
public $last_subscription_date_start;
/**
* @var int|string date
* @var int|string|null date
*/
public $last_subscription_date_end;
/**
* @var int|string date
* @var null|float|string date, null until set
*/
public $last_subscription_amount;
@ -901,11 +901,9 @@ class Adherent extends CommonObject
$action = 'update';
// Actions on extra fields
if (!$error) {
$result = $this->insertExtraFields();
if ($result < 0) {
$error++;
}
$result = $this->insertExtraFields();
if ($result < 0) {
$error++;
}
// Update password
@ -948,7 +946,7 @@ class Adherent extends CommonObject
if (!$error && $nbrowsaffected) { // If something has change in main data
// Update information on linked user if it is an update
if (!$error && $this->user_id > 0 && !$nosyncuser) {
if ($this->user_id > 0 && !$nosyncuser) {
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
dol_syslog(get_class($this)."::update update linked user");
@ -1130,7 +1128,7 @@ class Adherent extends CommonObject
$this->db->begin();
if (!$error && !$notrigger) {
if (!$notrigger) {
// Call trigger
$result = $this->call_trigger('MEMBER_DELETE', $user);
if ($result < 0) {
@ -1633,13 +1631,13 @@ class Adherent extends CommonObject
$this->last_subscription_date = $this->db->jdate($obj->datec);
$this->last_subscription_date_start = $this->db->jdate($obj->dateh);
$this->last_subscription_date_end = $this->db->jdate($obj->datef);
$this->last_subscription_amount = $obj->subscription;
$this->last_subscription_amount = (float) $obj->subscription;
$subscription = new Subscription($this->db);
$subscription->id = $obj->rowid;
$subscription->fk_adherent = $obj->fk_adherent;
$subscription->fk_type = $obj->fk_type;
$subscription->amount = $obj->subscription;
$subscription->amount = (float) $obj->subscription;
$subscription->note = $obj->note_public;
$subscription->note_public = $obj->note_public;
$subscription->fk_bank = $obj->fk_bank;
@ -1742,6 +1740,8 @@ class Adherent extends CommonObject
$this->last_subscription_date_start = $date;
$this->last_subscription_date_end = $datefin;
$this->last_subscription_amount = $amount;
} else {
$error++;
}
if (!$error) {
@ -1911,8 +1911,7 @@ class Adherent extends CommonObject
$result = $invoice->create($user);
if ($result <= 0) {
$this->error = $invoice->error;
$this->errors = $invoice->errors;
$this->setErrorsFromObject($invoice);
$error++;
} else {
$this->invoice = $invoice;
@ -1934,8 +1933,7 @@ class Adherent extends CommonObject
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$result = $invoice->addline($label, 0, 1, $vattouse, 0, 0, $idprodsubscription, 0, $datesubscription, '', 0, 0, 0, 'TTC', $amount, 1);
if ($result <= 0) {
$this->error = $invoice->error;
$this->errors = $invoice->errors;
$this->setErrorsFromObject($invoice);
$error++;
}
}
@ -1944,8 +1942,7 @@ class Adherent extends CommonObject
// Validate invoice
$result = $invoice->validate($user);
if ($result <= 0) {
$this->error = $invoice->error;
$this->errors = $invoice->errors;
$this->setErrorsFromObject($invoice);
$error++;
}
}
@ -1973,22 +1970,18 @@ class Adherent extends CommonObject
$paiement->ext_payment_id = $ext_payment_id;
$paiement->ext_payment_site = $ext_payment_site;
if (!$error) {
// Create payment line for invoice
$paiement_id = $paiement->create($user);
if (!($paiement_id > 0)) {
$this->error = $paiement->error;
$this->errors = $paiement->errors;
$error++;
}
// Create payment line for invoice
$paiement_id = $paiement->create($user);
if (!($paiement_id > 0)) {
$this->setErrorsFromObject($paiement);
$error++;
}
if (!$error) {
// Add transaction into bank account
$bank_line_id = $paiement->addPaymentToBank($user, 'payment', '(SubscriptionPayment)', $accountid, $emetteur_nom, $emetteur_banque);
if (!($bank_line_id > 0)) {
$this->error = $paiement->error;
$this->errors = $paiement->errors;
$this->setErrorsFromObject($paiement);
$error++;
}
}
@ -2441,16 +2434,15 @@ class Adherent extends CommonObject
$result .= $linkstart;
if ($withpictoimg) {
$paddafterimage = '';
if (abs($withpictoimg) == 1 || abs($withpictoimg) == 4) {
$morecss .= ' paddingrightonly';
}
// Only picto
if ($withpictoimg > 0) {
$picto = '<span class="nopadding'.($morecss ? ' userimg'.$morecss : '').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip ? '' : $dataparams), 0, 0, $notooltip ? 0 : 1).'</span>';
$picto = '<span class="nopadding'.($morecss ? ' userimg'.$morecss : '').'">'.img_object('', 'user', ' '.($notooltip ? '' : $dataparams), 0, 0, $notooltip ? 0 : 1).'</span>';
} else {
// Picto must be a photo
$picto = '<span class="nopadding'.($morecss ? ' userimg'.$morecss : '').'"'.($paddafterimage ? ' '.$paddafterimage : '').'>';
$picto = '<span class="nopadding'.($morecss ? ' userimg'.$morecss : '').'">';
$picto .= Form::showphoto('memberphoto', $this, 0, 0, 0, 'userphoto'.(($withpictoimg == -3 || $withpictoimg == -4) ? 'small' : ''), 'mini', 0, 1);
$picto .= '</span>';
}
@ -2458,7 +2450,7 @@ class Adherent extends CommonObject
}
if (($withpictoimg > -2 && $withpictoimg != 2) || $withpictoimg == -4) {
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$result .= '<span class="nopadding valignmiddle'.((!isset($this->statut) || $this->statut) ? '' : ' strikefordisabled').
$result .= '<span class="nopadding valignmiddle'.((!isset($this->status) || $this->status) ? '' : ' strikefordisabled').
($morecss ? ' usertext'.$morecss : '').'">';
}
if ($mode == 'login') {
@ -3219,9 +3211,9 @@ class Adherent extends CommonObject
if ($message) {
$actionmsg = $langs->transnoentities('MailFrom').': '.dol_escape_htmltag($from);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTo').': '.dol_escape_htmltag($sendto));
if ($sendtocc) {
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".dol_escape_htmltag($sendtocc));
}
// if ($sendtocc) {
// $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".dol_escape_htmltag($sendtocc));
// }
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subject);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
$actionmsg = dol_concatdesc($actionmsg, $message);
@ -3289,10 +3281,31 @@ class Adherent extends CommonObject
} else {
$this->output = 'Found '.($nbok + $nbko).' members to send reminder to.';
$this->output .= ' Send email successfully to '.$nbok.' members';
if (is_array($listofmembersok)) {
$listofids = '';
$i = 0;
foreach ($listofmembersok as $idmember) {
if ($i > 100) {
$listofids .= ', ...';
break;
}
if (empty($listofids)) {
$listofids .= ' [';
} else {
$listofids .= ', ';
}
$listofids .= $idmember;
$i++;
}
if ($listofids) {
$listofids .= ']';
}
$this->output .= ($listofids ? ' ids='.$listofids : '');
if ($nbko) {
$this->output .= ' - Canceled for '.$nbko.' member (no email or email sending error)';
$listofids = '';
$i = 0;
foreach ($listofmembersok as $idmember) {
foreach ($listofmembersko as $idmember) {
if ($i > 100) {
$listofids .= ', ...';
break;
@ -3308,33 +3321,8 @@ class Adherent extends CommonObject
if ($listofids) {
$listofids .= ']';
}
$this->output .= ($listofids ? ' ids='.$listofids : '');
}
if ($nbko) {
$this->output .= ' - Canceled for '.$nbko.' member (no email or email sending error)';
if (is_array($listofmembersko)) {
$listofids = '';
$i = 0;
foreach ($listofmembersko as $idmember) {
if ($i > 100) {
$listofids .= ', ...';
break;
}
if (empty($listofids)) {
$listofids .= ' [';
} else {
$listofids .= ', ';
}
$listofids .= $idmember;
$i++;
}
if ($listofids) {
$listofids .= ']';
}
$this->output .= ($listofids ? ' ids='.$listofids : '');
}
}
}
return $nbko;
@ -3354,25 +3342,23 @@ class Adherent extends CommonObject
$return = '<div class="box-flex-item box-flex-grow-zero">';
$return .= '<div class="info-box info-box-sm">';
$return .= '<span class="info-box-icon bg-infobox-action">';
if (property_exists($this, 'photo') || !empty($this->photo)) {
if (!empty($this->photo)) {
$return .= Form::showphoto('memberphoto', $this, 0, 60, 0, 'photokanban photowithmargin photologintooltip', 'small', 0, 1);
} else {
$return .= img_picto('', 'user');
}
$return .= '</span>';
$return .= '<div class="info-box-content">';
$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'</span>';
$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl() . '</span>';
if ($selected >= 0) {
$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
$return .= '<br><span class="info-box-label paddingright">'.$this->getmorphylib('', 2).'</span>';
$return .= '<span class="info-box-label opacitymedium">'.$this->type.'</span>';
if (method_exists($this, 'getLibStatut')) {
$return .= '<br><div class="info-box-status paddingtop">';
$return .= $this->LibStatut($this->status, $this->need_subscription, $this->datefin, 5);
$return .= '</div>';
}
$return .= '<br><div class="info-box-status paddingtop">';
$return .= $this->LibStatut($this->status, $this->need_subscription, $this->datefin, 5);
$return .= '</div>';
$return .= '</div>';
$return .= '</div>';
$return .= '</div>';

View file

@ -141,7 +141,7 @@ class AdherentType extends CommonObject
public $morphy;
/**
* @var string
* @var ?string
*/
public $duration;
@ -156,7 +156,7 @@ class AdherentType extends CommonObject
public $duration_unit;
/**
* @var int<0,1> Subscription required (0 or 1)
* @var null|'0'|'1' Subscription required (0 or 1) default '1' in DB, null until value is fetched
*/
public $subscription;
@ -180,7 +180,7 @@ class AdherentType extends CommonObject
public $note_public;
/**
* @var int<0,1> Can vote
* @var null|int<0,1> Can vote, null until fetched
*/
public $vote;
@ -516,11 +516,9 @@ class AdherentType extends CommonObject
}
// Actions on extra fields
if (!$error) {
$result = $this->insertExtraFields();
if ($result < 0) {
$error++;
}
$result = $this->insertExtraFields();
if ($result < 0) {
$error++;
}
if (!$error && !$notrigger) {
@ -870,7 +868,7 @@ class AdherentType extends CommonObject
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("MemberType").'</u> '.$this->getLibStatut(4);
$datas['label'] = '<br>'.$langs->trans("Label").': '.$this->label;
if (isset($this->subscription)) {
$datas['subscription'] = '<br>'.$langs->trans("SubscriptionRequired").': '.yn($this->subscription);
$datas['subscription'] = '<br>'.$langs->trans("SubscriptionRequired").': '.yn((int) $this->subscription);
}
if (isset($this->vote)) {
$datas['vote'] = '<br>'.$langs->trans("VoteAllowed").': '.yn($this->vote);
@ -878,9 +876,23 @@ class AdherentType extends CommonObject
if (isset($this->duration)) {
$datas['duration'] = '<br>'.$langs->trans("Duration").': '.$this->duration_value;
if ($this->duration_value > 1) {
$dur = array("i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years"));
$dur = array(
"i" => $langs->trans("Minutes"),
"h" => $langs->trans("Hours"),
"d" => $langs->trans("Days"),
"w" => $langs->trans("Weeks"),
"m" => $langs->trans("Months"),
"y" => $langs->trans("Years")
);
} elseif ($this->duration_value > 0) {
$dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year"));
$dur = array(
"i" => $langs->trans("Minute"),
"h" => $langs->trans("Hour"),
"d" => $langs->trans("Day"),
"w" => $langs->trans("Week"),
"m" => $langs->trans("Month"),
"y" => $langs->trans("Year")
);
}
$datas['duration'] .= "&nbsp;" . (!empty($this->duration_unit) && isset($dur[$this->duration_unit]) ? $langs->trans($dur[$this->duration_unit]) : '');
}
@ -901,14 +913,12 @@ class AdherentType extends CommonObject
public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
{
$result = '';
$option = '';
$classfortooltip = 'classfortooltip';
$dataparams = '';
$params = [
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
'nofetch' => 1,
];
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
@ -920,16 +930,15 @@ class AdherentType extends CommonObject
}
$url = DOL_URL_ROOT.'/adherents/type.php?rowid='.((int) $this->id);
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && isset($_SERVER["PHP_SELF"]) && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
$add_save_lastsearch_values = 1;
}
if ($add_save_lastsearch_values) {
$url .= '&save_lastsearch_values=1';
}
// Add param to save lastsearch_values or not
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && isset($_SERVER["PHP_SELF"]) && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
$add_save_lastsearch_values = 1;
}
if ($add_save_lastsearch_values) {
$url .= '&save_lastsearch_values=1';
}
$linkstart = '<a href="'.$url.'"';
$linkstart .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkstart .= $dataparams.' class="'.$classfortooltip.'">';
@ -1074,7 +1083,7 @@ class AdherentType extends CommonObject
$this->label = 'MEMBERS TYPE SPECIMEN';
$this->note_public = 'This is a public note';
$this->mail_valid = 'This is welcome email';
$this->subscription = 1;
$this->subscription = '1';
$this->caneditamount = 0;
$this->vote = 0;
@ -1167,7 +1176,7 @@ class AdherentType extends CommonObject
$return .= img_picto('', $this->picto);
$return .= '</span>';
$return .= '<div class="info-box-content">';
$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'</span>';
$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl() . '</span>';
//$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
@ -1176,20 +1185,14 @@ class AdherentType extends CommonObject
} else {
$return .= '<span class="right">&nbsp;</span>';
}
if (property_exists($this, 'vote')) {
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("VoteAllowed").' : '.yn($this->vote).'</span>';
}
if (property_exists($this, 'amount')) {
if (is_null($this->amount) || $this->amount === '') {
$return .= '<br>';
} else {
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("Amount").'</span>';
$return .= '<span class="amount"> : '.price($this->amount).'</span>';
}
}
if (method_exists($this, 'getLibStatut')) {
$return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>';
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("VoteAllowed").' : '.yn($this->vote).'</span>';
if (is_null($this->amount) || $this->amount === '') {
$return .= '<br>';
} else {
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("Amount").'</span>';
$return .= '<span class="amount"> : '.price($this->amount).'</span>';
}
$return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>';
$return .= '</div>';
$return .= '</div>';
$return .= '</div>';

View file

@ -4,7 +4,7 @@
* Copyright (C) 2004-2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
*
* 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
@ -637,7 +637,7 @@ while ($i < $imaxinloop) {
$adht = new AdherentType($db);
$adht->fetch($typeid);
$adherent->need_subscription = $adht->subscription;
$adherent->need_subscription = (int) $adht->subscription;
if ($mode == 'kanban') {
if ($i == 0) {

View file

@ -172,7 +172,7 @@ if ($action == 'add' && $user->hasRight('adherent', 'configurer')) {
$object->label = trim($label);
$object->morphy = trim($morphy);
$object->status = (int) $status;
$object->subscription = (int) $subscription;
$object->subscription = (string) (int) $subscription;
$object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
$object->caneditamount = $caneditamount;
$object->duration_value = $duration_value;
@ -233,7 +233,7 @@ if ($action == 'update' && $user->hasRight('adherent', 'configurer')) {
$object->label = trim($label);
$object->morphy = trim($morphy);
$object->status = (int) $status;
$object->subscription = (int) $subscription;
$object->subscription = (string) (int) $subscription;
$object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
$object->caneditamount = $caneditamount;
$object->duration_value = $duration_value;
@ -639,7 +639,7 @@ if ($rowid > 0) {
print '</tr>';
print '<tr><td>'.$form->textwithpicto($langs->trans("SubscriptionRequired"), $langs->trans("SubscriptionRequiredDesc")).'</td><td>';
print yn($object->subscription);
print yn((int) $object->subscription);
print '</tr>';
// Amount

View file

@ -2734,7 +2734,7 @@ class Setup extends DolibarrApi
// Define qualified files (must be same than into generate_filelist_xml.php and in api_setup.class.php)
$regextoinclude = '\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
$regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
$regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|escpos-php\/doc|escpos-php\/example|escpos-php\/test|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
$scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude);
// Fill file_list with files in signature, new files, modified files

View file

@ -1832,6 +1832,7 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $
if (!$error && ($massaction == 'increaseholiday' || ($action == 'increaseholiday' && $confirm == 'yes')) && $permissiontoapprove && is_array($toselect)) {
'@phan-var-force Holiday $holiday'; // Supposing that $holiday is set, it is needed.
/** @var Holiday $holiday */
$db->begin();
$objecttmp = new $objectclass($db);
$nbok = 0;
@ -1919,6 +1920,7 @@ if (!$error && ($massaction == 'clonetasks' || ($action == 'clonetasks' && $conf
require_once DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON') . '.php';
$modTask = new $classnamemodtask();
'@phan-var-force ModeleNumRefTask $modTask';
/** @var ModeleNumRefTask $modTask */
$defaultref = $modTask->getNextValue(null, $clone_task);
}

View file

@ -1352,7 +1352,7 @@ abstract class CommonInvoice extends CommonObject
$bac = new CompanyBankAccount($this->db); // Table societe_rib
$result = $bac->fetch(0, '', $this->socid, 1, 'ban');
if ($result <= 0 || empty($bac->id)) {
$this->error = $langs->trans("ThirdpartyHasNoDefaultBanAccount");
$this->error = $langs->trans("ThirdpartyHasNoDefaultBankAccount");
$this->errors[] = $this->error;
dol_syslog(get_class($this)."::makeStripeSepaRequest ".$this->error);
return -1;

View file

@ -3240,7 +3240,11 @@ abstract class CommonObject
if (!$notrigger) {
// Call trigger
$this->context = array('shippingmethodupdate' => 1);
$result = $this->call_trigger(strtoupper(get_class($this)).'_MODIFY', $userused);
$triggerPrefix = (empty($this->TRIGGER_PREFIX) ? strtoupper(get_class($this)) : $this->TRIGGER_PREFIX);
if (get_class($this) == 'Commande') {
$triggerPrefix = 'ORDER'; // TODO Remove this when TRIGGER_PREFI in order is implemented
}
$result = $this->call_trigger($triggerPrefix.'_MODIFY', $userused);
if ($result < 0) {
$error++;
}

View file

@ -112,7 +112,7 @@ trait CommonPeople
$firstname = $this->firstname;
if (empty($lastname)) {
// societe is deprecated - @suppress-next-line PhanUndeclaredProperty
$lastname = (isset($this->lastname) ? $this->lastname : (isset($this->name) ? $this->name : (property_exists($this, 'nom') && isset($this->nom) ? $this->nom : (property_exists($this, 'societe') && isset($this->societe) ? $this->societe : (property_exists($this, 'company') && isset($this->company) ? $this->company : '')))));
$lastname = (isset($this->lastname) ? $this->lastname : (isset($this->name) ? $this->name : (property_exists($this, 'nom') && isset($this->nom) ? $this->nom : (property_exists($this, 'societe') && isset($this->societe) ? $this->societe : (property_exists($this, 'company') && isset($this->company) ? $this->company : ''))))); // @phpstan-ignore-line
}
$ret = '';

View file

@ -106,11 +106,11 @@ if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) {
if (empty($user) || empty($user->id)) {
print 'Page is called as an include but $user and its permission loaded with loadRights() are not defined. We stop here.';
exit(-1);
exit(1);
}
if (empty($object)) {
print 'Page is called as an include but $object is not defined. We stop here.';
exit(-1);
exit(1);
}
}

View file

@ -1444,7 +1444,7 @@ function dolCheckOnFileName($src_file, $dest_file = '')
* @param int $disablevirusscan 1=Disable virus scan
* @param integer $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error'])
* @param int $nohook Disable all hooks
* @param string $keyforsourcefile Key for source frile in _FILES (not used)
* @param string $keyforsourcefile Key for source file in _FILES (not used)
* @param string $upload_dir For information. Already included into $dest_file.
* @param int $mode 0=Default mode use to move a file from default system upload dir to $upload_dir. 1=Mode to move an uploaded file from $keyforsourcefile into $upload_dir.
* @return int|string 1 if OK, 2 if OK and .noexe appended, <0 or string if KO

View file

@ -304,7 +304,7 @@ class modProjet extends DolibarrModules
$this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r] = array('t'=>MAIN_DB_PREFIX.'projet', 'extra'=>MAIN_DB_PREFIX.'projet_extrafields'); // List of tables to insert into (insert done in same order)
$this->import_fields_array[$r] = array('t.ref'=>'ProjectRef*', 't.title'=>'Label*', 't.description'=>"Description", 't.fk_soc' => 'ThirdPartyName', 't.public'=>"Public", 't.fk_statut'=>"Status");
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('t.fk_opp_status'=>"OpportunityStatus", 't.opp_percent'=>"OpportunityProbability", 't.opp_amount'=>"OpportunityAmount", 't.note_public'=>"NotePublic", 't.note_private'=>"NotePrivate", 't.budget_amount'=>"Budget", 't.dateo'=>"DateStart", 't.datee'=>"DateEnd"));
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array('t.fk_opp_status'=>"OpportunityStatus", 't.opp_percent'=>"OpportunityProbability", 't.opp_amount'=>"OpportunityAmount", 't.note_public'=>"NotePublic", 't.note_private'=>"NotePrivate", 't.budget_amount'=>"Budget", 't.dateo'=>"DateStart", 't.datee'=>"DateEnd", 't.usage_opportunity' => "UsageOpportunity", 't.usage_task' => 'UsageTasks', 't.usage_bill_time' => 'UsageBillTimeShort'));
// Add extra fields
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'projet' AND entity IN (0,".$conf->entity.")";
$resql = $this->db->query($sql);
@ -329,7 +329,7 @@ class modProjet extends DolibarrModules
);
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
$this->import_regex_array[$r] = array('t.dateo'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', 't.datee'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', 't.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$');
$this->import_examplevalues_array[$r] = array('t.fk_soc'=>'ThirdParty', 't.ref'=>"auto or PJ2010-1234", 't.title'=>"My project", 't.fk_statut'=>'0,1 or 2', 't.datec'=>'1972-10-10', 't.note_private'=>"My private note", 't.note_public'=>"My public note");
$this->import_examplevalues_array[$r] = array('t.fk_soc'=>'ThirdParty', 't.ref'=>"auto or PJ2010-1234", 't.title'=>"My project", 't.fk_statut'=>'0,1 or 2', 't.datec'=>'1972-10-10', 't.note_private'=>"My private note", 't.note_public'=>"My public note", 't.usage_opportunity' => '0/1', 't.usage_task' => '0/1', 't.usage_bill_time' => '0/1');
// Import list of tasks
if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {

View file

@ -218,7 +218,7 @@ if ($id > 0 && empty($object->id)) {
$res = $object->fetch($id);
if ($object->id <= 0) {
dol_print_error($db, $object->error);
exit(-1);
exit(1);
}
}

View file

@ -173,14 +173,14 @@ if ($rss) {
dol_syslog("build_exportfile ".$error, LOG_ERR);
dol_delete_file($outputfiletmp, 0, 1);
print $error;
exit(-1);
exit(1);
}
} else {
dol_syslog("build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR);
dol_delete_file($outputfiletmp, 0, 1);
$langs->load("errors");
print $langs->trans("ErrorFailToCreateFile", $outputfile);
exit(-1);
exit(1);
}
}

View file

@ -173,14 +173,14 @@ if ($rss) {
dol_syslog("build_exportfile ".$error, LOG_ERR);
dol_delete_file($outputfiletmp, 0, 1);
print $error;
exit(-1);
exit(1);
}
} else {
dol_syslog("build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR);
dol_delete_file($outputfiletmp, 0, 1);
$langs->load("errors");
print $langs->trans("ErrorFailToCreateFile", $outputfile);
exit(-1);
exit(1);
}
}

View file

@ -173,14 +173,14 @@ if ($rss) {
dol_syslog("build_exportfile ".$error, LOG_ERR);
dol_delete_file($outputfiletmp, 0, 1);
print $error;
exit(-1);
exit(1);
}
} else {
dol_syslog("build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR);
dol_delete_file($outputfiletmp, 0, 1);
$langs->load("errors");
print $langs->trans("ErrorFailToCreateFile", $outputfile);
exit(-1);
exit(1);
}
}

View file

@ -173,14 +173,14 @@ if ($rss) {
dol_syslog("build_exportfile ".$error, LOG_ERR);
dol_delete_file($outputfiletmp, 0, 1);
print $error;
exit(-1);
exit(1);
}
} else {
dol_syslog("build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR);
dol_delete_file($outputfiletmp, 0, 1);
$langs->load("errors");
print $langs->trans("ErrorFailToCreateFile", $outputfile);
exit(-1);
exit(1);
}
}

View file

@ -170,14 +170,14 @@ if ($rss) {
dol_syslog("build_exportfile ".$error, LOG_ERR);
dol_delete_file($outputfiletmp, 0, 1);
print $error;
exit(-1);
exit(1);
}
} else {
dol_syslog("build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR);
dol_delete_file($outputfiletmp, 0, 1);
$langs->load("errors");
print $langs->trans("ErrorFailToCreateFile", $outputfile);
exit(-1);
exit(1);
}
}

View file

@ -90,6 +90,7 @@ PaymentMode=Payment method
PaymentModes=Payment methods
DefaultPaymentMode=Default Payment method
DefaultBankAccount=Default Bank Account
ThirdpartyHasNoDefaultBankAccount=No default bank account is set for the third party
IdPaymentMode=Payment method (id)
CodePaymentMode=Payment method (code)
LabelPaymentMode=Payment method (label)

View file

@ -161,3 +161,5 @@ ConsumeHolidaysAtTheEndOfTheMonthTheyAreTakenAt=Consume holidays at the end of t
PleaseDefineSomeTypeOfHolidayFirst=Please define first some types of holiday into the dictionary (Menu Home - Setup - dictionaries)
HolidayMailSenderAdress=Email address for holiday requests
HolidayMailSenderAdressHelp=If you leave this field blank, the default e-mail address will be used.
WrongAmount=Wrong amount of days
ErrorUpdatingUsersCP=Error updating users paid leaves

View file

@ -149,3 +149,5 @@ SocialNetworksUser=Social networks for user
MyTeam=My team
TotalAPICall=Total API Calls
TOTP=TOTP (Time-base One-Time Password)
UserRemovedFromGroup=User removed from group
UserSetInGroup=User set in group

View file

@ -75,7 +75,7 @@ function detectModule()
$tab = glob("core/modules/mod*.class.php");
if (count($tab) == 0) {
echo "[fail] Error on auto detect data : there is no mod*.class.php file into core/modules dir\n";
exit(-1);
exit(1);
}
if (count($tab) == 1) {
$file = $tab[0];
@ -87,11 +87,11 @@ function detectModule()
echo "extract data from $file\n";
if (!file_exists($file) || $name == "") {
echo "[fail] Error on auto detect data\n";
exit(-2);
exit(2);
}
} else {
echo "[fail] Error there is more than one mod*.class.php file into core/modules dir\n";
exit(-3);
exit(3);
}
//extract version from file
@ -105,7 +105,7 @@ function detectModule()
if (version_compare($version, '0.0.1', '>=') != 1) {
echo "[fail] Error auto extract version fail\n";
exit(-4);
exit(4);
}
echo "module name = $name, version = $version\n";
@ -145,11 +145,11 @@ function secureUnlink($path)
clearstatcache();
if (file_exists($path)) { // @phpstan-ignore-line
echo "[fail] unlink of $path fail !\n";
exit(-5);
exit(5);
}
} else {
echo "[fail] unlink of $path fail !\n";
exit(-6);
exit(6);
}
}
return true;
@ -298,7 +298,7 @@ foreach ($listOfModuleContent as $moduleContent) {
if (!rcopy($entry, $dst . '/' . $entry)) {
echo "[fail] Error on copy " . $entry . " to " . $dst . "/" . $entry . "\n";
echo "Please take time to analyze the problem and fix the bug\n";
exit(-8);
exit(8);
}
}
}
@ -312,5 +312,5 @@ if (file_exists($outzip)) {
echo "[success] module archive is ready : $outzip ...\n";
} else {
echo "[fail] build zip error\n";
exit(-9);
exit(9);
}

View file

@ -54,7 +54,7 @@ $path = __DIR__.'/';
// Test if batch mode
if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit(-1);
exit(1);
}
// Global variables
@ -95,7 +95,7 @@ if (!$res && file_exists("../../../master.inc.php")) {
}
if (!$res) {
print "Include of master fails";
exit(-1);
exit(1);
}
// After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file).
// $user is created but empty.
@ -129,7 +129,7 @@ $hookmanager->initHooks(array('cli'));
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
if (!isset($argv[1])) { // Check parameters
print "Usage: ".$script_file." param1 param2 ...\n";
exit(-1);
exit(1);
}
print '--- start'."\n";
print 'Argument 1='.$argv[1]."\n";

View file

@ -496,7 +496,8 @@ if (empty($reshook)) {
// Quick edit for extrafields
if ($action == 'update_extras' && $permissiontoeditextra) {
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
// we may use oldcopy->hasBatch( in triggers so keep 1
$object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty
$attribute_name = GETPOST('attribute', 'aZ09');

View file

@ -1494,7 +1494,7 @@ class Product extends CommonObject
if ($result >= 0) {
// $this->oldcopy should have been set by the caller of update (here properties were already modified)
if (is_null($this->oldcopy) || (is_object($this->oldcopy) && $this->oldcopy->isEmpty())) {
$this->oldcopy = dol_clone($this, 1);
$this->oldcopy = dol_clone($this, 1); // 1 to clone with methods to avoid fatal error with $this->oldcopy->hasbatch()
}
// Test if batch management is activated on existing product
// If yes, we create missing entries into product_batch

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify

View file

@ -61,7 +61,7 @@ if (is_numeric($entity)) {
// Error if CLI mode
if (php_sapi_name() == "cli") {
echo "Error: This page can't be used as a CLI script. For the CLI version of script, launch cron_run_job.php available into scripts/cron/ directory.\n";
exit(-1);
exit(1);
}
// core library
@ -179,12 +179,12 @@ if (is_array($object->lines) && (count($object->lines) > 0)) {
if ($result < 0) {
echo "\nUser Error: ".$user->error."\n";
dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR);
exit(-1);
exit(1);
} else {
if ($result == 0) {
echo "\nUser login: ".$userlogin." does not exists for entity ".$conf->entity."\n";
dol_syslog("User login:".$userlogin." does not exists", LOG_ERR);
exit(-1);
exit(1);
}
}
$user->loadRights();

View file

@ -2271,7 +2271,7 @@ if ($action == 'create') {
}
// Presend form
$modelmail = 'shipping_send';
$modelmail = 'reception_send';
$defaulttopic = 'SendReceptionRef';
$diroutput = $conf->reception->dir_output;
$trackid = 'rec'.$object->id;

View file

@ -952,7 +952,7 @@ if ($socid > 0 && empty($object->id)) {
$result = $object->fetch($socid);
if ($result <= 0) {
dol_print_error(null, $object->error);
exit(-1);
exit(1);
}
}

View file

@ -156,7 +156,7 @@ if (!getDolGlobalString('LDAP_MEMBER_DN')) {
}
if ($typeid <= 0) {
print $langs->trans("Error").': Parameter id_member_type is not a valid ref of an existing member type'."\n";
exit(-2);
exit(2);
}
if (!empty($dolibarr_main_db_readonly)) {

View file

@ -62,7 +62,7 @@ class AccountingAccountTest extends CommonClassTest
if (!isModEnabled('accounting')) {
print __METHOD__." module accounting must be enabled.\n";
exit(-1);
exit(1);
}
print __METHOD__."\n";