Merge branch 'develop' into patch-11

This commit is contained in:
Frédéric FRANCE
2024-03-15 17:45:10 +01:00
committed by GitHub
81 changed files with 376 additions and 370 deletions

View File

@@ -69,6 +69,7 @@ return [
'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeArraySuspiciousNull'],
'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanParamSignatureMismatch', 'PhanParamSuspiciousOrder'],
'htdocs/core/modules/syslog/mod_syslog_syslog.php' => ['PhanParamSignatureMismatch'],
'htdocs/core/triggers/interface_80_modStripe_Stripe.class.php' => ['PhanTypeMismatchPropertyProbablyReal'],
'htdocs/don/class/don.class.php' => ['PhanParamTooMany'],
'htdocs/fourn/class/api_supplier_invoices.class.php' => ['PhanPluginSuspiciousParamOrder'],
'htdocs/intracommreport/list.php' => ['PhanAccessPropertyStaticAsNonStatic'],
@@ -79,6 +80,7 @@ return [
'htdocs/public/opensurvey/index.php' => ['PhanPluginSuspiciousParamOrder'],
'htdocs/public/payment/paymentok.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/public/recruitment/index.php' => ['PhanPluginSuspiciousParamOrder'],
'htdocs/societe/paymentmodes.php' => ['PhanTypeMismatchPropertyProbablyReal'],
'htdocs/societe/class/companybankaccount.class.php' => ['PhanParamSignatureMismatch'],
'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginSuspiciousParamPosition'],
'htdocs/takepos/invoice.php' => ['PhanPluginSuspiciousParamPosition'],

View File

@@ -446,7 +446,7 @@ return [
'PhanRedefinedClassReference',
// 'PhanPluginNoCommentOnClass',
// 'PhanPluginNotFullyQualifiedGlobalConstant',
'PhanTypeMismatchDefault',
// 'PhanTypeMismatchDefault',
// 'PhanPluginPHPDocHashComment',
'PhanPluginShortArrayList',
'PhanPluginUnknownArrayPropertyType',
@@ -457,7 +457,7 @@ return [
'PhanPluginUnknownClosureReturnType',
// 'PhanPluginNoCommentOnProtectedMethod',
// 'PhanTypeArraySuspicious',
'PhanTypeMismatchPropertyProbablyReal',
// 'PhanTypeMismatchPropertyProbablyReal',
// 'PhanPluginNoCommentOnPrivateMethod',
'PhanPluginUnknownArrayFunctionReturnType',
'PhanTypeInvalidLeftOperandOfAdd',
@@ -495,7 +495,7 @@ return [
'PhanTypeInvalidLeftOperandOfBitwiseOp',
// 'PhanTypeMismatchDimAssignment',
// 'PhanPluginDescriptionlessCommentOnProtectedMethod',
'PhanPluginPrintfIncompatibleArgumentTypeWeak',
// 'PhanPluginPrintfIncompatibleArgumentTypeWeak',
'PhanUndeclaredVariableAssignOp',
'PhanTypeExpectedObjectOrClassName',
'PhanEmptyFQSENInClasslike',
@@ -591,7 +591,7 @@ return [
// 'PhanPluginPossiblyStaticProtectedMethod',
'PhanTypeMismatchReturn',
// 'PhanPluginMoreSpecificActualReturnType',
'PhanTypeMismatchReturnProbablyReal',
// 'PhanTypeMismatchReturnProbablyReal',
'PhanPossiblyUndeclaredVariable',
'PhanTypeMismatchArgument',
// 'PhanPluginUnreachableCode',

View File

@@ -550,7 +550,11 @@ if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda'
//$param='month='.$monthshown.'&year='.$year;
$hourminsec = dol_print_date(dol_mktime(10, 0, 0, 1, 1, 1970, 'gmt'), '%H', 'gmt').'0000'; // Set $hourminsec to '100000' to auto set hour to 10:00 at creation
$newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')));
$urltocreateaction = DOL_URL_ROOT.'/comm/action/card.php?action=create';
$urltocreateaction .= '&apyear='.$tmpforcreatebutton['year'].'&apmonth='.$tmpforcreatebutton['mon'].'&apday='.$tmpforcreatebutton['mday'].'&aphour='.$tmpforcreatebutton['hours'].'&apmin='.$tmpforcreatebutton['minutes'];
$urltocreateaction .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''));
$newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', $urltocreateaction);
}
// Define the legend/list of calendard to show

View File

@@ -730,7 +730,7 @@ $url .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam
$newcardbutton = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, '', $user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create'));
$param .= '&mode='.$mode;
$param .= '&mode='.urlencode($mode);
print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, is_numeric($nbtotalofrecords) ? -1 * $nbtotalofrecords : $nbtotalofrecords, 'object_action', 0, $nav.$newcardbutton, '', $limit, 0, 0, 1, $viewmode);

View File

@@ -480,9 +480,11 @@ if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda'
$newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year'];
//$param='month='.$monthshown.'&year='.$year;
$hourminsec = '100000';
$newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')));
$urltocreateaction = DOL_URL_ROOT.'/comm/action/card.php?action=create';
$urltocreateaction .= '&apyear='.$tmpforcreatebutton['year'].'&apmonth='.$tmpforcreatebutton['mon'].'&apday='.$tmpforcreatebutton['mday'].'&aphour='.$tmpforcreatebutton['hours'].'&apmin='.$tmpforcreatebutton['minutes'];
$urltocreateaction .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''));
$newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', $urltocreateaction);
}
print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1, 'object_action', 0, $nav.'<span class="marginleftonly"></span>'.$newcardbutton, '', $limit, 1, 0, 1, $viewmode);

View File

@@ -129,8 +129,8 @@ if ($dateselect > 0) {
$tmp = !getDolGlobalString('MAIN_DEFAULT_WORKING_HOURS') ? '9-18' : $conf->global->MAIN_DEFAULT_WORKING_HOURS;
$tmp = str_replace(' ', '', $tmp); // FIX 7533
$tmparray = explode('-', $tmp);
$begin_h = GETPOSTINT('begin_h') != '' ? GETPOSTINT('begin_h') : ($tmparray[0] != '' ? $tmparray[0] : 9);
$end_h = GETPOSTINT('end_h') ? GETPOSTINT('end_h') : ($tmparray[1] != '' ? $tmparray[1] : 18);
$begin_h = GETPOSTISSET('begin_h') ? GETPOSTINT('begin_h') : ($tmparray[0] != '' ? $tmparray[0] : 9);
$end_h = GETPOSTISSET('end_h') ? GETPOSTINT('end_h') : ($tmparray[1] != '' ? $tmparray[1] : 18);
if ($begin_h < 0 || $begin_h > 23) {
$begin_h = 9;
}
@@ -144,8 +144,8 @@ if ($end_h <= $begin_h) {
$tmp = !getDolGlobalString('MAIN_DEFAULT_WORKING_DAYS') ? '1-5' : $conf->global->MAIN_DEFAULT_WORKING_DAYS;
$tmp = str_replace(' ', '', $tmp); // FIX 7533
$tmparray = explode('-', $tmp);
$begin_d = GETPOSTINT('begin_d') ? GETPOSTINT('begin_d') : ($tmparray[0] != '' ? $tmparray[0] : 1);
$end_d = GETPOSTINT('end_d') ? GETPOSTINT('end_d') : ($tmparray[1] != '' ? $tmparray[1] : 5);
$begin_d = GETPOSTISSET('begin_d') ? GETPOSTINT('begin_d') : ($tmparray[0] != '' ? $tmparray[0] : 1);
$end_d = GETPOSTISSET('end_d') ? GETPOSTINT('end_d') : ($tmparray[1] != '' ? $tmparray[1] : 5);
if ($begin_d < 1 || $begin_d > 7) {
$begin_d = 1;
}
@@ -496,9 +496,11 @@ if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda'
$newparam .= '&end_d='.urlencode($end_d);
}
//$param='month='.$monthshown.'&year='.$year;
$hourminsec = '100000';
$newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')));
$urltocreateaction = DOL_URL_ROOT.'/comm/action/card.php?action=create';
$urltocreateaction .= '&apyear='.$tmpforcreatebutton['year'].'&apmonth='.$tmpforcreatebutton['mon'].'&apday='.$tmpforcreatebutton['mday'].'&aphour='.$tmpforcreatebutton['hours'].'&apmin='.$tmpforcreatebutton['minutes'];
$urltocreateaction .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''));
$newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', $urltocreateaction);
}
$num = '';

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013-2023 Charlene BENKE <charlene@patas-monkey.com>
* Copyright (C) 2024 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
@@ -205,7 +206,7 @@ for ($mois = 1; $mois < 13; $mois++) {
print "<td>".dol_print_date(dol_mktime(1, 1, 1, $mois, 1, 2000), "%B")."</td>";
for ($annee = $year_start; $annee <= $year_end; $annee++) {
$case = sprintf("%04s-%02s", $annee, $mois);
$case = sprintf("%04d-%02d", $annee, $mois);
print '<td class="right" width="10%">&nbsp;';
if (isset($decaiss[$case]) && $decaiss[$case] > 0) {

View File

@@ -93,8 +93,10 @@ class Account extends CommonObject
public $bank;
/**
* Status
* Status closed
*
* @var int
* @deprecated Duplicate field. We already have the field $this->status
*/
public $clos = self::STATUS_OPEN;
@@ -200,13 +202,6 @@ class Account extends CommonObject
*/
public $type_lib = array();
/**
* Array listing all the potential status of an account.
* Defined in __construct
* @var array<int, string> array: int of the status => translated label of the status
*/
public $status = array();
/**
* Accountancy code
* @var string
@@ -387,17 +382,17 @@ class Account extends CommonObject
$this->db = $db;
$this->solde = 0;
$this->balance = 0;
$this->type_lib = array(
self::TYPE_SAVINGS => $langs->trans("BankType0"),
self::TYPE_CURRENT => $langs->trans("BankType1"),
self::TYPE_CASH => $langs->trans("BankType2"),
self::TYPE_SAVINGS => $langs->transnoentitiesnoconv("BankType0"),
self::TYPE_CURRENT => $langs->transnoentitiesnoconv("BankType1"),
self::TYPE_CASH => $langs->transnoentitiesnoconv("BankType2"),
);
$this->status = array(
self::STATUS_OPEN => $langs->trans("StatusAccountOpened"),
self::STATUS_CLOSED => $langs->trans("StatusAccountClosed")
$this->labelStatus = array(
self::STATUS_OPEN => $langs->transnoentitiesnoconv("StatusAccountOpened"),
self::STATUS_CLOSED => $langs->transnoentitiesnoconv("StatusAccountClosed")
);
}
@@ -2744,41 +2739,6 @@ class AccountLine extends CommonObjectLine
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
//global $langs;
//$langs->load('companies');
/*
if ($mode == 0)
{
if ($status==0) return $langs->trans("ActivityCeased");
if ($status==1) return $langs->trans("InActivity");
}
if ($mode == 1)
{
if ($status==0) return $langs->trans("ActivityCeased");
if ($status==1) return $langs->trans("InActivity");
}
if ($mode == 2)
{
if ($status==0) return img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"').' '.$langs->trans("ActivityCeased");
if ($status==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"').' '.$langs->trans("InActivity");
}
if ($mode == 3)
{
if ($status==0) return img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"');
if ($status==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"');
}
if ($mode == 4)
{
if ($status==0) return img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"').' '.$langs->trans("ActivityCeased");
if ($status==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"').' '.$langs->trans("InActivity");
}
if ($mode == 5)
{
if ($status==0) return $langs->trans("ActivityCeased").' '.img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"');
if ($status==1) return $langs->trans("InActivity").' '.img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"');
}*/
return '';
}

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2016-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2020 Laurent Destailleur <eldy@destailleur.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2024 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
@@ -260,12 +261,12 @@ print '<th class="liste_titre right">'.$langs->trans("PreviousPeriod").'</th>';
print '<th class="liste_titre right">'.$langs->trans("SelectedPeriod").'</th>';
foreach ($months as $k => $v) {
if (($k + 1) >= $date_startmonth && $k < $date_endmonth) {
print '<th class="liste_titre right width50">'.$langs->trans('MonthShort'.sprintf("%02s", ($k + 1))).'</th>';
print '<th class="liste_titre right width50">'.$langs->trans('MonthShort'.sprintf("%02d", ($k + 1))).'</th>';
}
}
foreach ($months as $k => $v) {
if (($k + 1) < $date_startmonth) {
print '<th class="liste_titre right width50">'.$langs->trans('MonthShort'.sprintf("%02s", ($k + 1))).'</th>';
print '<th class="liste_titre right width50">'.$langs->trans('MonthShort'.sprintf("%02d", ($k + 1))).'</th>';
}
}
print '</tr>';

View File

@@ -406,8 +406,8 @@ class ChargeSociales extends CommonObject
/**
* Calculate amount remaining to pay by year
*
* @param int $year Year
* @return int|float
* @param int $year Year
* @return int|float Returns -1 when error (Note: could be mistaken with an amount)
*/
public function solde($year = 0)
{

View File

@@ -548,12 +548,12 @@ class PaymentVAT extends CommonObject
$this->fk_tva = 0;
$this->datec = dol_now();
$this->tms = dol_now();
$this->datep = '';
$this->amount = '';
$this->datep = dol_now();
$this->amount = 100;
$this->fk_typepaiement = 0;
$this->num_payment = '';
$this->note_private = '';
$this->note_public = '';
$this->num_payment = '123456';
$this->note_private = 'Private note';
$this->note_public = 'Public note';
$this->fk_bank = 0;
$this->fk_user_creat = 0;
$this->fk_user_modif = 0;

View File

@@ -1683,7 +1683,7 @@ class Contrat extends CommonObject
$contractline->id = $contractlineid;
$result = $contractline->insertExtraFields();
if ($result < 0) {
$this->error[] = $contractline->error;
$this->errors[] = $contractline->error;
$error++;
}
}
@@ -1877,7 +1877,7 @@ class Contrat extends CommonObject
$result = $contractline->insertExtraFields();
if ($result < 0) {
$this->error[] = $contractline->error;
$this->errors[] = $contractline->error;
$error++;
}
}

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
@@ -29,6 +30,10 @@
// $triggersendname must be set (can be '')
// $actiontypecode can be set
// $object and $uobject may be defined
'
@phan-var-force Societe $mysoc
@phan-var-force CommonObject $object
';
/*
* Add file in email form
@@ -357,7 +362,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO
$substitutionarray['__EMAIL__'] = $sendto;
$substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag=undefined&securitykey='.dol_hash(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY')."-undefined", 'md5').'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '';
$parameters = array('mode'=>'formemail');
$parameters = array('mode' => 'formemail');
complete_substitutions_array($substitutionarray, $langs, $object, $parameters);
$subject = make_substitutions($subject, $substitutionarray);

View File

@@ -226,13 +226,13 @@ abstract class CommonObject
/**
* @var Project The related project object
* @deprecated
* @see project
* @deprecated Use $project instead
* @see $project
*/
public $projet;
/**
* @deprecated
* @deprecated Use $fk_project instead
* @see $fk_project
*/
public $fk_projet;
@@ -274,13 +274,13 @@ abstract class CommonObject
public $origin_id;
/**
* @var Object Origin object. This is set by fetch_origin() from this->origin and this->origin_id.
* @var ?CommonObject Origin object. This is set by fetch_origin() from this->origin and this->origin_id.
*/
public $origin_object;
/**
* @var string|CommonObject Sometime the type of the originating object ('commande', 'facture', ...), sometime the object (like onh MouvementStock)
* @deprecated Use now $origin_type and $origin_id;
* @var CommonObject|string|null Sometimes the type of the originating object ('commande', 'facture', ...), sometimes the object (as with MouvementStock)
* @deprecated Use now $origin_type and $origin_id;
* @see fetch_origin()
*/
public $origin;
@@ -322,7 +322,7 @@ abstract class CommonObject
/**
* @var int The object's status. Use status instead.
* @deprecated
* @deprecated Use $status instead
* @see setStatut()
*/
public $statut;
@@ -369,7 +369,7 @@ abstract class CommonObject
/**
* var int State ID
* @deprecated Use state_id. We can remove this property when the field 'fk_departement' have been renamed into 'state_id' in all tables
* @deprecated Use $state_id. We can remove this property when the field 'fk_departement' have been renamed into 'state_id' in all tables
*/
public $fk_departement;
@@ -447,7 +447,7 @@ abstract class CommonObject
/**
* @var int Payment terms ID
* @deprecated Kept for compatibility
* @deprecated Use $cond_reglement_id instead - Kept for compatibility
* @see cond_reglement_id;
*/
public $cond_reglement;
@@ -730,13 +730,13 @@ abstract class CommonObject
public $specimen = 0;
/**
* @var int Id of contact to send object (used by the trigger of module Agenda)
* @var int[] Id of contacts to send objects (mails, etc.)
*/
public $sendtoid;
/**
* @var float Amount already paid from getSommePaiement() (used to show correct status)
* @deprecated Duplicate of $totalpaid
* @deprecated Use $totalpaid instead
*/
public $alreadypaid;
/**
@@ -792,8 +792,8 @@ abstract class CommonObject
/**
* @var string[] List of child tables. To know object to delete on cascade.
* If name is like '@ClassName:FilePathClass:ParentFkFieldName', it will
* call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object.
* If name is like '@ClassName:FilePathClass:ParentFkFieldName', it will
* call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object.
*/
protected $childtablesoncascade = array();
@@ -4205,98 +4205,20 @@ abstract class CommonObject
if (!empty($this->linkedObjectsIds)) {
$tmparray = $this->linkedObjectsIds;
foreach ($tmparray as $objecttype => $objectids) { // $objecttype is a module name ('facture', 'mymodule', ...) or a module name with a suffix ('project_task', 'mymodule_myobj', ...)
// Parse element/subelement (ex: project_task, cabinetmed_consultation, ...)
$module = $element = $subelement = $objecttype;
$regs = array();
if ($objecttype != 'supplier_proposal' && $objecttype != 'order_supplier' && $objecttype != 'invoice_supplier'
&& preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) {
$module = $element = $regs[1];
$subelement = $regs[2];
}
$element_properties = getElementProperties($objecttype);
$element = $element_properties['element'];
$classPath = $element_properties['classpath'];
$classFile = $element_properties['classfile'];
$className = $element_properties['classname'];
$module = $element_properties['module'];
$classpath = $element.'/class';
// To work with non standard classpath or module name
if ($objecttype == 'facture') {
$classpath = 'compta/facture/class';
} elseif ($objecttype == 'facturerec') {
$classpath = 'compta/facture/class';
$module = 'facture';
} elseif ($objecttype == 'propal') {
$classpath = 'comm/propal/class';
} elseif ($objecttype == 'supplier_proposal') {
$classpath = 'supplier_proposal/class';
} elseif ($objecttype == 'shipping') {
$classpath = 'expedition/class';
$subelement = 'expedition';
$module = 'expedition';
} elseif ($objecttype == 'delivery') {
$classpath = 'delivery/class';
$subelement = 'delivery';
$module = 'shipping';
} elseif ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') {
$classpath = 'fourn/class';
$module = 'fournisseur';
} elseif ($objecttype == 'fichinter') {
$classpath = 'fichinter/class';
$subelement = 'fichinter';
$module = 'ficheinter';
} elseif ($objecttype == 'subscription') {
$classpath = 'adherents/class';
$module = 'adherent';
} elseif ($objecttype == 'contact') {
$module = 'societe';
}
// Set classfile
$classfile = strtolower($subelement);
$classname = ucfirst($subelement);
if ($objecttype == 'order') {
$classfile = 'commande';
$classname = 'Commande';
} elseif ($objecttype == 'invoice_supplier') {
$classfile = 'fournisseur.facture';
$classname = 'FactureFournisseur';
} elseif ($objecttype == 'order_supplier') {
$classfile = 'fournisseur.commande';
$classname = 'CommandeFournisseur';
} elseif ($objecttype == 'supplier_proposal') {
$classfile = 'supplier_proposal';
$classname = 'SupplierProposal';
} elseif ($objecttype == 'facturerec') {
$classfile = 'facture-rec';
$classname = 'FactureRec';
} elseif ($objecttype == 'subscription') {
$classfile = 'subscription';
$classname = 'Subscription';
} elseif ($objecttype == 'project' || $objecttype == 'projet') {
$classpath = 'projet/class';
$classfile = 'project';
$classname = 'Project';
} elseif ($objecttype == 'conferenceorboothattendee') {
$classpath = 'eventorganization/class';
$classfile = 'conferenceorboothattendee';
$classname = 'ConferenceOrBoothAttendee';
$module = 'eventorganization';
} elseif ($objecttype == 'conferenceorbooth') {
$classpath = 'eventorganization/class';
$classfile = 'conferenceorbooth';
$classname = 'ConferenceOrBooth';
$module = 'eventorganization';
} elseif ($objecttype == 'mo') {
$classpath = 'mrp/class';
$classfile = 'mo';
$classname = 'Mo';
$module = 'mrp';
}
// Here $module, $classfile and $classname are set, we can use them.
// Here $module, $classFile and $className are set, we can use them.
if (isModEnabled($module) && (($element != $this->element) || $alsosametype)) {
if ($loadalsoobjects && (is_numeric($loadalsoobjects) || ($loadalsoobjects === $objecttype))) {
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
//print '/'.$classpath.'/'.$classfile.'.class.php '.class_exists($classname);
if (class_exists($classname)) {
dol_include_once('/'.$classPath.'/'.$classFile.'.class.php');
if (class_exists($className)) {
foreach ($objectids as $i => $objectid) { // $i is rowid into llx_element_element
$object = new $classname($this->db);
$object = new $className($this->db);
$ret = $object->fetch($objectid);
if ($ret >= 0) {
$this->linkedObjects[$objecttype][$i] = $object;
@@ -8955,7 +8877,7 @@ abstract class CommonObject
/**
* Returns the rights used for this class
*
* @return int|stdClass Object of permission for the module
* @return null|int|stdClass Object of permission for the module
*/
public function getRights()
{

View File

@@ -524,7 +524,7 @@ function societe_admin_prepare_head()
* @param Translate $outputlangs Langs object for output translation
* @param int $entconv 0=Return value without entities and not converted to output charset, 1=Ready for html output
* @param string $searchlabel Label of country to search (warning: searching on label is not reliable)
* @return mixed Integer with country id or String with country code or translated country name or Array('id','code','label') or 'NotDefined'
* @return int|string|array{id:int,code:string,label:string} Integer with country id or String with country code or translated country name or Array('id','code','label') or 'NotDefined'
*/
function getCountry($searchkey, $withcode = '', $dbtouse = null, $outputlangs = null, $entconv = 1, $searchlabel = '')
{
@@ -1515,6 +1515,13 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
print '</a>';
}
// Delete
if ($user->hasRight('societe', 'contact', 'delete')) {
print '<a class="marginleftonly right" href="'.DOL_URL_ROOT.'/societe/contact.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
print img_delete();
print '</a>';
}
print '</td>';
}
@@ -1611,6 +1618,13 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
print '</a>';
}
// Delete
if ($user->hasRight('societe', 'contact', 'delete')) {
print '<a class="marginleftonly right" href="'.DOL_URL_ROOT.'/societe/contact.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&socid='.urlencode($obj->fk_soc).'">';
print img_delete();
print '</a>';
}
print '</td>';
}
@@ -2043,6 +2057,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
}
}
'@phan-var-force array<int,array{userid:int,type:string,tododone:string,apicto:string,acode:string,alabel:string,note:string,id:int,percent:int<0,100>,datestart:int,dateend:int,fk_element:string,elementtype:string,contact_id:string,lastname:string,firstname:string,contact_photo:string,socpeaopleassigned:int[],login:string,userfirstname:string,userlastname:string,userphoto:string}> $histo';
if (isModEnabled('agenda') || (isModEnabled('mailing') && !empty($objcon->email))) {
$delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;

View File

@@ -57,7 +57,7 @@ function dol_basename($pathfile)
* @param string $relativename For recursive purpose only. Must be "" at first call.
* @param int $donotfollowsymlinks Do not follow symbolic links
* @param int $nbsecondsold Only files older than $nbsecondsold
* @return array<array{name:string,path:string,level1name:string,relativename:string,fullname:string,date:string,size:int,perm:int,type:string}> Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file',...)
* @return array<array{name:string,path:string,level1name:string,relativename:string,fullname:string,date:string,size:int,perm:int,type:string}> Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file',...)>
* @see dol_dir_list_in_database()
*/
function dol_dir_list($utf8_path, $types = "all", $recursive = 0, $filter = "", $excludefilter = null, $sortcriteria = "name", $sortorder = SORT_ASC, $mode = 0, $nohook = 0, $relativename = "", $donotfollowsymlinks = 0, $nbsecondsold = 0)
@@ -2621,10 +2621,10 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles =
*
* @param string $dir Directory to scan
* @param string $regexfilter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
* @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function
* @param int $nohook Disable all hooks
* @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only
* @return array Array with properties (full path, date, ...) of to most recent file
* @param string[] $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function
* @param int<0,1> $nohook Disable all hooks
* @param int<0,3> $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only
* @return null|array{name:string,path:string,level1name:string,relativename:string,fullname:string,date:string,size:int,perm:int,type:string} null if none or Array with properties (full path, date, ...) of the most recent file
*/
function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('(\.meta|_preview.*\.png)$', '^\.'), $nohook = 0, $mode = 0)
{

View File

@@ -12176,6 +12176,10 @@ function getElementProperties($elementType)
$module = 'facture';
$subelement = 'facture';
$table_element = 'facture';
} elseif ($elementType == 'facturerec') {
$classpath = 'compta/facture/class';
$module = 'facture';
$classname = 'FactureRec';
} elseif ($elementType == 'commande' || $elementType == 'order') {
$classpath = 'commande/class';
$module = 'commande';
@@ -12316,6 +12320,16 @@ function getElementProperties($elementType)
$classname = 'EmailSenderProfile';
$table_element = 'c_email_senderprofile';
$subelement = '';
} elseif ($elementType == 'conferenceorboothattendee') {
$classpath = 'eventorganization/class';
$classfile = 'conferenceorboothattendee';
$classname = 'ConferenceOrBoothAttendee';
$module = 'eventorganization';
} elseif ($elementType == 'conferenceorbooth') {
$classpath = 'eventorganization/class';
$classfile = 'conferenceorbooth';
$classname = 'ConferenceOrBooth';
$module = 'eventorganization';
}
if (empty($classfile)) {
@@ -13866,9 +13880,9 @@ function GETPOSTDATE($prefix, $hourTime = '', $gm = 'auto')
* request.
*
* @param string $prefix Prefix used to build the date selector (for instance using Form::selectDate)
* @param int $timestamp If null, the timestamp will be created from request data
* @param bool $hourTime If timestamp is null, will be passed to GETPOSTDATE to construct the timestamp
* @param bool $gm If timestamp is null, will be passed to GETPOSTDATE to construct the timestamp
* @param ?int $timestamp If null, the timestamp will be created from request data
* @param string $hourTime If timestamp is null, will be passed to GETPOSTDATE to construct the timestamp
* @param string $gm If timestamp is null, will be passed to GETPOSTDATE to construct the timestamp
* @return string Portion of URL with query parameters for the specified date
*/
function buildParamDate($prefix, $timestamp = null, $hourTime = '', $gm = 'auto')

View File

@@ -639,7 +639,7 @@ function print_start_menu_entry($idsel, $classname, $showmode)
* @param string $idsel Id sel
* @param string $classname Class name
* @param string $atarget Target
* @param array{rowid:string,fk_menu:string,langs:string,enabled:int<0,2>,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string} $menuval All the $menuval array
* @param array{}|array{rowid:string,fk_menu:string,langs:string,enabled:int<0,2>,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string} $menuval All the $menuval array
* @return void
*/
function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, $atarget, $menuval = array())

View File

@@ -141,7 +141,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
public $menu = array();
/**
* @var array{triggers?:int<0,1>,login?:int<0,1>,substitutions?:int<0,1>,menus?:int<0,1>,theme?:int<0,1>,tpl?:int<0,1>,barcode?:int<0,1>,models?:int<0,1>,printing?:int<0,1>,css?:string[],js?:string[],hooks?:array{data:string[],entity:string},moduleforexternal?:int<0,1>,websitetemplates?:int<0,1>,contactelement?:int<0,1>} Module parts
* @var array{triggers?:int<0,1>,login?:int<0,1>,substitutions?:int<0,1>,menus?:int<0,1>,theme?:int<0,1>,tpl?:int<0,1>,barcode?:int<0,1>,models?:int<0,1>,printing?:int<0,1>,css?:string[],js?:string[],hooks?:array{data?:string[],entity?:string},moduleforexternal?:int<0,1>,websitetemplates?:int<0,1>,contactelement?:int<0,1>} Module parts
* array(
* // Set this to 1 if module has its own trigger directory (/mymodule/core/triggers)
* 'triggers' => 0,

View File

@@ -2,6 +2,8 @@
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2022-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2024 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
@@ -156,7 +158,7 @@ class mod_asset_standard extends ModeleNumRefAsset
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_asset_standard::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -148,7 +149,7 @@ class mod_bom_standard extends ModeleNumRefBoms
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_bom_standard::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -145,7 +146,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog(__METHOD__." return ".$this->prefix.$yymm."-".$num);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -160,7 +161,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -29,7 +30,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php';
*/
class mod_contract_serpis extends ModelNumRefContracts
{
// variables inherited from ModelNumRefContracts class
public $name = 'Serpis';
public $version = 'dolibarr';
@@ -145,7 +145,7 @@ class mod_contract_serpis extends ModelNumRefContracts
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_contract_serpis::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -163,7 +164,7 @@ class mod_delivery_jade extends ModeleNumRefDeliveryOrder
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_delivery_jade::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -151,7 +152,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_expedition_safor::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2017 Maxime Kohlhaas <support@atm-consulting.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -208,7 +209,7 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_expensereport_jade::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -200,7 +201,7 @@ class mod_facture_mars extends ModeleNumRefFactures
if ($max >= (pow(10, 4) - 1)) {
$num = $max; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max);
$num = sprintf("%04d", $max);
}
$ref = '';
@@ -229,7 +230,7 @@ class mod_facture_mars extends ModeleNumRefFactures
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -240,7 +241,7 @@ class mod_facture_terre extends ModeleNumRefFactures
if ($max >= (pow(10, 4) - 1)) {
$num = $max; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max);
$num = sprintf("%04d", $max);
}
$ref = '';
@@ -268,7 +269,7 @@ class mod_facture_terre extends ModeleNumRefFactures
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num);

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -156,7 +157,7 @@ class mod_pacific extends ModeleNumRefFicheinter
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
return $this->prefix.$yymm."-".$num;

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018-2023 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -30,7 +31,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/holiday/modules_holiday.php';
*/
class mod_holiday_madonna extends ModelNumRefHolidays
{
// variables inherited from ModelNumRefHolidays class
public $name = 'Madonna';
public $version = 'dolibarr';
@@ -146,7 +146,7 @@ class mod_holiday_madonna extends ModelNumRefHolidays
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_holiday_madonna::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -156,7 +157,7 @@ class mod_evaluation_standard extends ModeleNumRefEvaluation
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_evaluation_standard::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -263,12 +263,12 @@ class pdf_standard extends CommonStickerGenerator
/**
* Function to build PDF on disk, then output on HTTP stream.
*
* @param Adherent $object Member object. Old usage: Array of record information (array('textleft'=>,'textheader'=>, ...'id'=>,'photo'=>)
* @param Translate $outputlangs Lang object for output language
* @param string $srctemplatepath Full path of source filename for generator using a template file. Example: '5161', 'AVERYC32010', 'CARD', ...
* @param string $mode Tell if doc module is called for 'member', ...
* @param int $nooutput 1=Generate only file on disk and do not return it on response
* @param string $filename Name of output file (without extension)
* @param Adherent|array $object Member object. Old usage: Array of record information (array('textleft'=>,'textheader'=>, ...'id'=>,'photo'=>)
* @param Translate $outputlangs Lang object for output language
* @param string $srctemplatepath Full path of source filename for generator using a template file. Example: '5161', 'AVERYC32010', 'CARD', ...
* @param string $mode Tell if doc module is called for 'member', ...
* @param int $nooutput 1=Generate only file on disk and do not return it on response
* @param string $filename Name of output file (without extension)
* @return int 1=OK, 0=KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $mode = 'member', $nooutput = 0, $filename = 'tmp_cards')

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2021 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -31,7 +32,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/member/modules_member.class.php';
*/
class mod_member_advanced extends ModeleNumRefMembers
{
// variables inherited from ModeleNumRefMembers class
public $name = 'Advanced';
public $version = 'dolibarr';
@@ -150,7 +150,7 @@ class mod_member_advanced extends ModeleNumRefMembers
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_member_advanced::getNextValue return ".$this->prefix.$yymm."-".$num, LOG_INFO);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -148,7 +149,7 @@ class mod_mo_standard extends ModeleNumRefMos
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_mo_standard::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 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
@@ -154,7 +155,7 @@ class mod_payment_cicada extends ModeleNumRefPayments
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog(__METHOD__." return ".$this->prefix.$yymm."-".$num);

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2021 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -150,7 +151,7 @@ class mod_lot_standard extends ModeleNumRefBatch
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1;
} else { // If counter > 9999, we do not format on 4 chars, we take number as it is
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_lot_standard::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2021 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -150,7 +151,7 @@ class mod_sn_standard extends ModeleNumRefBatch
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1;
} else { // If counter > 9999, we do not format on 4 chars, we take number as it is
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_sn_standard::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -159,7 +160,7 @@ class mod_project_simple extends ModeleNumRefProjects
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_project_simple::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -156,7 +157,7 @@ class mod_task_simple extends ModeleNumRefTask
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_task_simple::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -157,7 +158,7 @@ class mod_propale_marbre extends ModeleNumRefPropales
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog(get_class($this)."::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -131,7 +132,7 @@ class mod_reception_beryl extends ModelNumRefReception
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_reception_beryl::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -137,7 +137,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
if ($max >= (pow(10, 5) - 1)) {
$num = $max + 1; // If counter > 99999, we do not format on 5 chars, we take number as it is
} else {
$num = sprintf("%05s", $max + 1);
$num = sprintf("%05d", $max + 1);
}
dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num);

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -157,7 +158,7 @@ class mod_stocktransfer_standard extends ModeleNumRefStockTransfer
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1;
} else { // If counter > 9999, we do not format on 4 chars, we take number as it is
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_stocktransfer_standard::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -214,7 +215,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
if ($max >= (pow(10, 4) - 1)) {
$num = $max; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max);
$num = sprintf("%04d", $max);
}
$ref = '';
@@ -242,7 +243,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -135,7 +136,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
* @param CommandeFournisseur $object Object
* @return string Value if OK, 0 if KO
*/
public function getNextValue($objsoc = '', $object = '')
public function getNextValue($objsoc, $object)
{
global $db, $conf;
@@ -166,7 +167,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
return $this->prefix.$yymm."-".$num;

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -126,7 +127,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
* @param CommandeFournisseur $object Object
* @return string|0 Value if OK, 0 if KO
*/
public function getNextValue($objsoc = '', $object = '')
public function getNextValue($objsoc, $object)
{
global $db, $conf;

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -155,7 +156,7 @@ class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog(__METHOD__." return ".$this->prefix.$yymm."-".$num);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -157,7 +158,7 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog(get_class($this)."::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2020 Open-DSI <support@open-dsi.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -166,7 +167,7 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos
if ($max >= (pow(10, 4) - 1)) {
$num = $max; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max);
$num = sprintf("%04d", $max);
}
$ref = '';
@@ -194,7 +195,7 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog(get_class($this)."::getNextValue return ".$this->prefix.$pos_source.'-'.$yymm.'-'.$num);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -156,7 +157,7 @@ class mod_ticket_simple extends ModeleNumRefTicket
$num = $max + 1;
} else {
// If counter > 9999, we do not format on 4 chars, we take number as it is
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_ticket_simple::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2020 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -146,7 +147,7 @@ class mod_workstation_standard extends ModeleNumRefWorkstation
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_workstation_standard::getNextValue return ".$this->prefix."-".$num);

View File

@@ -7,6 +7,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -615,7 +616,7 @@ class Delivery extends CommonObject
$result = $line->insertExtraFields();
if ($result < 0) {
$this->error[] = $line->error;
$this->errors[] = $line->error;
$error++;
}
}
@@ -826,7 +827,7 @@ class Delivery extends CommonObject
global $action;
$hookmanager->initHooks(array($this->element . 'dao'));
$parameters = array('id'=>$this->id, 'getnomurl' => &$result);
$parameters = array('id' => $this->id, 'getnomurl' => &$result);
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) {
$result = $hookmanager->resPrint;

View File

@@ -656,8 +656,6 @@ class ExpenseReport extends CommonObject
*/
public function fetch($id, $ref = '')
{
global $conf;
$sql = "SELECT d.rowid, d.entity, d.ref, d.note_public, d.note_private,"; // DEFAULT
$sql .= " d.detail_refuse, d.detail_cancel, d.fk_user_refuse, d.fk_user_cancel,"; // ACTIONS
$sql .= " d.date_refuse, d.date_cancel,"; // ACTIONS
@@ -885,6 +883,8 @@ class ExpenseReport extends CommonObject
$sql .= " WHERE f.rowid = ".((int) $id);
$sql .= " AND f.entity = ".$conf->entity;
$resql = $this->db->query($sql);
if ($resql) {
if ($this->db->num_rows($resql)) {
@@ -920,7 +920,7 @@ class ExpenseReport extends CommonObject
*/
public function initAsSpecimen()
{
global $user, $langs, $conf;
global $user, $langs;
$now = dol_now();
@@ -983,10 +983,10 @@ class ExpenseReport extends CommonObject
* @param User $user User
* @return int Return integer <0 if KO, >0 if OK
*/
public function fetch_line_by_project($projectid, $user = '')
public function fetch_line_by_project($projectid, $user)
{
// phpcs:enable
global $conf, $db, $langs;
global $langs;
$langs->load('trips');
@@ -1086,8 +1086,6 @@ class ExpenseReport extends CommonObject
public function fetch_lines()
{
// phpcs:enable
global $conf;
$this->lines = array();
$sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date, de.rang,';
@@ -1792,7 +1790,7 @@ class ExpenseReport extends CommonObject
*/
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1)
{
global $langs, $conf, $hookmanager;
global $langs, $hookmanager;
$result = '';
@@ -1906,7 +1904,7 @@ class ExpenseReport extends CommonObject
* @param float $qty Qty
* @param double $up Unit price (price with tax)
* @param int $fk_c_type_fees Type payment
* @param string $vatrate Vat rate (Can be '10' or '10 (ABC)')
* @param int<-1,0>|string $vatrate Vat rate (Can be '10' or '10 (ABC)')
* @param string $date Date
* @param string $comments Description
* @param int $fk_project Project id
@@ -1917,7 +1915,7 @@ class ExpenseReport extends CommonObject
*/
public function addline($qty = 0, $up = 0, $fk_c_type_fees = 0, $vatrate = 0, $date = '', $comments = '', $fk_project = 0, $fk_c_exp_tax_cat = 0, $type = 0, $fk_ecm_files = 0)
{
global $conf, $langs, $mysoc;
global $langs, $mysoc;
dol_syslog(get_class($this)."::addline qty=$qty, up=$up, fk_c_type_fees=$fk_c_type_fees, vatrate=$vatrate, date=$date, fk_project=$fk_project, type=$type, comments=$comments", LOG_DEBUG);
@@ -2029,7 +2027,7 @@ class ExpenseReport extends CommonObject
*/
public function checkRules($type = 0, $seller = '')
{
global $user, $conf, $db, $langs, $mysoc;
global $conf, $db, $langs, $mysoc;
$langs->load('trips');
@@ -2105,7 +2103,7 @@ class ExpenseReport extends CommonObject
*/
public function applyOffset($type = 0, $seller = '')
{
global $conf, $mysoc;
global $mysoc;
if (!getDolGlobalString('MAIN_USE_EXPENSE_IK')) {
return false;
@@ -2327,10 +2325,10 @@ class ExpenseReport extends CommonObject
/**
* deleteline
*
* @param int $rowid Row id
* @param User $fuser User
* @param int $notrigger 1=No trigger
* @return int Return integer <0 if KO, >0 if OK
* @param int $rowid Row id
* @param User|string $fuser User
* @param int<0,1> $notrigger 1=No trigger
* @return int<0,1> Return integer <0 if KO, >0 if OK
*/
public function deleteLine($rowid, $fuser = '', $notrigger = 0)
{
@@ -2473,8 +2471,6 @@ class ExpenseReport extends CommonObject
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
{
global $conf;
$outputlangs->load("trips");
if (!dol_strlen($modele)) {
@@ -2530,7 +2526,7 @@ class ExpenseReport extends CommonObject
*/
public function loadStateBoard()
{
global $conf, $user;
global $user;
$this->nb = array();
@@ -3040,7 +3036,7 @@ class ExpenseReportLine extends CommonObjectLine
*/
public function insert($notrigger = 0, $fromaddline = false)
{
global $user, $conf;
global $user;
$error = 0;
@@ -3182,7 +3178,7 @@ class ExpenseReportLine extends CommonObjectLine
*/
public function update(User $user)
{
global $langs, $conf;
global $langs;
$error = 0;

View File

@@ -307,7 +307,6 @@ class PaymentExpenseReport extends CommonObject
public function update($user = null, $notrigger = 0)
{
// phpcs:enable
global $conf, $langs;
$error = 0;
// Clean parameters
@@ -337,13 +336,8 @@ class PaymentExpenseReport extends CommonObject
$this->fk_user_modif = (int) $this->fk_user_modif;
}
// Check parameters
// Put here code to add control on parameters values
// Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."payment_expensereport SET";
$sql .= " fk_expensereport=".(isset($this->fk_expensereport) ? $this->fk_expensereport : "null").",";
$sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
$sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
@@ -355,8 +349,6 @@ class PaymentExpenseReport extends CommonObject
$sql .= " fk_bank=".(isset($this->fk_bank) ? $this->fk_bank : "null").",";
$sql .= " fk_user_creat=".(isset($this->fk_user_creat) ? $this->fk_user_creat : "null").",";
$sql .= " fk_user_modif=".(isset($this->fk_user_modif) ? $this->fk_user_modif : "null");
$sql .= " WHERE rowid=".((int) $this->id);
$this->db->begin();
@@ -393,7 +385,6 @@ class PaymentExpenseReport extends CommonObject
public function delete($user, $notrigger = 0)
{
// phpcs:enable
global $conf, $langs;
$error = 0;
$this->db->begin();
@@ -524,13 +515,14 @@ class PaymentExpenseReport extends CommonObject
$this->id = 0;
$this->fk_expensereport = 0;
$this->datec = '';
$this->datec = dol_now();
$this->tms = dol_now();
$this->datep = '';
$this->amount = '';
$this->datep = dol_now();
$this->amount = 100;
$this->fk_typepayment = 0;
$this->num_payment = '';
$this->note = '';
$this->num_payment = '123456';
$this->note_public = 'Public note';
$this->note_private = 'Private note';
$this->fk_bank = 0;
$this->fk_user_creat = 0;
$this->fk_user_modif = 0;
@@ -553,7 +545,7 @@ class PaymentExpenseReport extends CommonObject
*/
public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
{
global $langs, $conf;
global $langs;
$error = 0;

View File

@@ -12,6 +12,7 @@
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
* Copyright (C) 2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 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

View File

@@ -1929,7 +1929,7 @@ class CommandeFournisseur extends CommonOrder
* @param int $date_end Date end of service
* @param array $array_options extrafields array
* @param int|null $fk_unit Code of the unit to use. Null to use the default one
* @param string $pu_ht_devise Amount in currency
* @param int|string $pu_ht_devise Amount in currency
* @param string $origin 'order', ...
* @param int $origin_id Id of origin object
* @param int $rang Rank
@@ -2880,13 +2880,13 @@ class CommandeFournisseur extends CommonOrder
*
* @param int $rowid ID de la ligne de facture
* @param string $desc Line description
* @param float $pu Unit price
* @param float $qty Quantity
* @param float $remise_percent Percent discount on line
* @param float $txtva VAT rate
* @param float $txlocaltax1 Localtax1 tax
* @param float $txlocaltax2 Localtax2 tax
* @param float $price_base_type Type of price base
* @param int|float $pu Unit price
* @param int|float $qty Quantity
* @param int|float $remise_percent Percent discount on line
* @param int|float $txtva VAT rate
* @param int|float $txlocaltax1 Localtax1 tax
* @param int|float $txlocaltax2 Localtax2 tax
* @param string $price_base_type Type of price base
* @param int $info_bits Miscellaneous information
* @param int $type Type of line (0=product, 1=service)
* @param int $notrigger Disable triggers
@@ -2894,11 +2894,11 @@ class CommandeFournisseur extends CommonOrder
* @param integer $date_end Date end of service
* @param array $array_options Extrafields array
* @param int|null $fk_unit Code of the unit to use. Null to use the default one
* @param float $pu_ht_devise Unit price in currency
* @param int|float $pu_ht_devise Unit price in currency
* @param string $ref_supplier Supplier ref
* @return int Return integer < 0 if error, > 0 if ok
*/
public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $notrigger = 0, $date_start = '', $date_end = '', $array_options = [], $fk_unit = null, $pu_ht_devise = 0, $ref_supplier = '')
public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $notrigger = 0, $date_start = 0, $date_end = 0, $array_options = [], $fk_unit = null, $pu_ht_devise = 0, $ref_supplier = '')
{
global $mysoc, $conf, $langs;
dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $type, $fk_unit");
@@ -3243,8 +3243,8 @@ class CommandeFournisseur extends CommonOrder
/**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Object user
* @param int $mode "opened", "awaiting" for orders awaiting reception
* @param User $user Object user
* @param string $mode "opened", "awaiting" for orders awaiting reception
* @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board($user, $mode = 'opened')

View File

@@ -15,6 +15,7 @@
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2023 Nick Fragoulis
* Copyright (C) 2024 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
@@ -1196,9 +1197,9 @@ class FactureFournisseur extends CommonInvoice
}
if (isset($this->fk_project)) {
if (empty($this->fk_project)) {
$this->fk_project = null;
$this->fk_project = 0;
} else {
$this->fk_project = intval($this->fk_project);
$this->fk_project = (int) $this->fk_project;
}
}
if (isset($this->cond_reglement_id)) {
@@ -2064,7 +2065,7 @@ class FactureFournisseur extends CommonInvoice
* @param int $fk_remise_except Id discount used
* @return int >0 if OK, <0 if KO
*/
public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product = 0, $remise_percent = 0, $date_start = '', $date_end = '', $fk_code_ventilation = 0, $info_bits = '', $price_base_type = 'HT', $type = 0, $rang = -1, $notrigger = 0, $array_options = [], $fk_unit = null, $origin_id = 0, $pu_devise = 0, $ref_supplier = '', $special_code = '', $fk_parent_line = 0, $fk_remise_except = 0)
public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product = 0, $remise_percent = 0, $date_start = 0, $date_end = 0, $fk_code_ventilation = 0, $info_bits = 0, $price_base_type = 'HT', $type = 0, $rang = -1, $notrigger = 0, $array_options = [], $fk_unit = null, $origin_id = 0, $pu_devise = 0, $ref_supplier = '', $special_code = '', $fk_parent_line = 0, $fk_remise_except = 0)
{
global $langs, $mysoc, $conf;

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 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
@@ -154,7 +155,7 @@ class mod_knowledgerecord_standard extends ModeleNumRefKnowledgeRecord
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_knowledgerecord_standard::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -134,3 +134,5 @@ UserPublicPageDesc=You can enable a virtual card for this user. An url with the
EnablePublicVirtualCard=Enable the user's virtual business card
UserEnabledDisabled=User status changed: %s
AlternativeEmailForOAuth2=Alternative Email for OAuth2 login
ConfirmDeleteContact= Are you sure that you want delete this contact ?
ContactDeleted= Contact has been delete successfully

View File

@@ -4353,8 +4353,9 @@ if ($module == 'initmodule') {
$mod = strtolower($module);
$obj = strtolower($tabobj);
$newproperty = dolGetButtonTitle($langs->trans('NewProperty'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/modulebuilder/index.php?tab=objects&module='.urlencode($module).'&tabobj=createproperty&obj='.urlencode($tabobj));
$nbOfProperties = count($reflectorpropdefault['fields']);
print_barre_liste($langs->trans("ObjectProperties"), 0, $_SERVER["PHP_SELF"], '', '', '', '', '', 0, '', 0, $newproperty, '', '', 0, 0, 1);
print_barre_liste($langs->trans("ObjectProperties"), 0, $_SERVER["PHP_SELF"], '', '', '', '', '', $nbOfProperties, '', 0, $newproperty, '', '', 0, 0, 1);
//var_dump($reflectorpropdefault);exit;
print '<!-- Table with properties of object -->'."\n";

View File

@@ -5,6 +5,7 @@
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -90,7 +91,7 @@ class MultiCurrency extends CommonObject
public $fk_user;
/**
* @var CurrencyRate|null The currency rate
* @var ?CurrencyRate The currency rate
*/
public $rate;

View File

@@ -205,7 +205,7 @@ class Partnership extends CommonObject
public function create(User $user, $notrigger = 0)
{
if ($this->fk_soc <= 0 && $this->fk_member <= 0) {
$this->error[] = "ErrorThirpdartyOrMemberidIsMandatory";
$this->errors[] = "ErrorThirpdartyOrMemberidIsMandatory";
return -1;
}
@@ -522,7 +522,7 @@ class Partnership extends CommonObject
public function update(User $user, $notrigger = 0)
{
if ($this->fk_soc <= 0 && $this->fk_member <= 0) {
$this->error[] = "ErrorThirpdartyOrMemberidIsMandatory";
$this->errors[] = "ErrorThirpdartyOrMemberidIsMandatory"; // Mistyping in key is in translations
return -1;
}
if (empty($this->fk_user_creat)) { // For the case the object was created with empty user (from public page).

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 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
@@ -154,7 +155,7 @@ class mod_partnership_standard extends ModeleNumRefPartnership
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_partnership_standard::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -807,7 +807,7 @@ if (empty($reshook)) {
if ($fk_default_bom >= 0) {
$object->fk_default_bom = $fk_default_bom;
} else {
$object->fk_default_bom = null;
$object->fk_default_bom = 0;
}
$units = GETPOSTINT('units');

View File

@@ -311,7 +311,7 @@ class Product extends CommonObject
/**
* Status indicates whether the product is on sale '1' or not '0'
* @var int
* @deprecated
* @deprecated Use $status instead
* @see $status
*/
public $tosell;
@@ -326,7 +326,7 @@ class Product extends CommonObject
/**
* Status indicate whether the product is available for purchase '1' or not '0'
* @var int
* @deprecated
* @deprecated Use $status_buy instead
* @see $status_buy
*/
public $tobuy;
@@ -334,7 +334,7 @@ class Product extends CommonObject
/**
* Status indicates whether the product is a finished product '1' or a raw material '0'
*
* @var int
* @var ?int
*/
public $finished;
@@ -1971,7 +1971,7 @@ class Product extends CommonObject
// Add new price
$sql = "INSERT INTO ".$this->db->prefix()."product_price(price_level,date_price, fk_product, fk_user_author, price_label, price, price_ttc, price_base_type,tosell, tva_tx, default_vat_code, recuperableonly,";
$sql .= " localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, price_min,price_min_ttc,price_by_qty,entity,fk_price_expression) ";
$sql .= " VALUES(".($level ? ((int) $level) : 1).", '".$this->db->idate($now)."', ".((int) $this->id).", ".((int) $user->id).", ".(empty($this->price_label)?"null":"'".$this->db->escape($this->price_label)."'").", ".((float) price2num($this->price)).", ".((float) price2num($this->price_ttc)).",'".$this->db->escape($this->price_base_type)."',".((int) $this->status).", ".((float) price2num($this->tva_tx)).", ".($this->default_vat_code ? ("'".$this->db->escape($this->default_vat_code)."'") : "null").", ".((int) $this->tva_npr).",";
$sql .= " VALUES(".($level ? ((int) $level) : 1).", '".$this->db->idate($now)."', ".((int) $this->id).", ".((int) $user->id).", ".(empty($this->price_label) ? "null" : "'".$this->db->escape($this->price_label)."'").", ".((float) price2num($this->price)).", ".((float) price2num($this->price_ttc)).",'".$this->db->escape($this->price_base_type)."',".((int) $this->status).", ".((float) price2num($this->tva_tx)).", ".($this->default_vat_code ? ("'".$this->db->escape($this->default_vat_code)."'") : "null").", ".((int) $this->tva_npr).",";
$sql .= " ".price2num($this->localtax1_tx).", ".price2num($this->localtax2_tx).", '".$this->db->escape($this->localtax1_type)."', '".$this->db->escape($this->localtax2_type)."', ".price2num($this->price_min).", ".price2num($this->price_min_ttc).", ".price2num($this->price_by_qty).", ".((int) $conf->entity).",".($this->fk_price_expression > 0 ? ((int) $this->fk_price_expression) : 'null');
$sql .= ")";
@@ -2308,7 +2308,7 @@ class Product extends CommonObject
* @param double $newprice New price
* @param string $newpricebase HT or TTC
* @param User $user Object user that make change
* @param double $newvat New VAT Rate (For example 8.5. Should not be a string)
* @param ?double $newvat New VAT Rate (For example 8.5. Should not be a string)
* @param double $newminprice New price min
* @param int $level 0=standard, >0 = level if multilevel prices
* @param int $newnpr 0=Standard vat rate, 1=Special vat rate for French NPR VAT
@@ -2320,7 +2320,7 @@ class Product extends CommonObject
* @param int $notrigger Disable triggers
* @return int Return integer <0 if KO, >0 if OK
*/
public function updatePrice($newprice, $newpricebase, $user, $newvat = '', $newminprice = 0, $level = 0, $newnpr = 0, $newpbq = 0, $ignore_autogen = 0, $localtaxes_array = array(), $newdefaultvatcode = '', $price_label = '', $notrigger = 0)
public function updatePrice($newprice, $newpricebase, $user, $newvat = null, $newminprice = 0, $level = 0, $newnpr = 0, $newpbq = 0, $ignore_autogen = 0, $localtaxes_array = array(), $newdefaultvatcode = '', $price_label = '', $notrigger = 0)
{
global $conf, $langs;
@@ -2342,7 +2342,7 @@ class Product extends CommonObject
}
// Check parameters
if ($newvat == '') {
if ($newvat === null || $newvat == '') { // Maintain '' for backwards compatibility
$newvat = $this->tva_tx;
}

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Ion Agorria <ion@agorria.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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

View File

@@ -14,6 +14,7 @@
* Copyright (C) 2020-2021 Open-DSI <support@open-dsi.fr>
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2020-2023 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2024 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
@@ -296,7 +297,7 @@ if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
} else {
$labelp = $langs->transnoentitiesnoconv("SellingPrice")." ".$i;
}
$arrayfields['p.sellprice'.$i] = array('label' => $labelp, 'checked' => ($i == 1 ? 1 : 0), 'enabled' => getDolGlobalString('PRODUIT_MULTIPRICES'), 'position' => (float) ('40.'.sprintf('%03s', $i)));
$arrayfields['p.sellprice'.$i] = array('label' => $labelp, 'checked' => ($i == 1 ? 1 : 0), 'enabled' => getDolGlobalString('PRODUIT_MULTIPRICES'), 'position' => (float) ('40.'.sprintf('%03d', $i)));
$arraypricelevel[$i] = array($i);
}
}

View File

@@ -934,9 +934,9 @@ class Task extends CommonObjectLine
* @param string $filteronproj Filter on project ref or label
* @param string $filteronprojstatus Filter on project status ('-1'=no filter, '0,1'=Draft+Validated only)
* @param string $morewherefilter Add more filter into where SQL request (must start with ' AND ...')
* @param string $filteronprojuser Filter on user that is a contact of project
* @param string $filterontaskuser Filter on user assigned to task
* @param Extrafields $extrafields Show additional column from project or task
* @param int $filteronprojuser Filter on user that is a contact of project
* @param int $filterontaskuser Filter on user assigned to task
* @param ?Extrafields $extrafields Show additional column from project or task
* @param int $includebilltime Calculate also the time to bill and billed
* @param array $search_array_options Array of search filters. Not Used yet.
* @param int $loadextras Fetch all Extrafields on each project and task
@@ -945,9 +945,9 @@ class Task extends CommonObjectLine
* @param string $sortorder Sort order
* @return array|string Array of tasks
*/
public function getTasksArray($usert = null, $userp = null, $projectid = 0, $socid = 0, $mode = 0, $filteronproj = '', $filteronprojstatus = '-1', $morewherefilter = '', $filteronprojuser = 0, $filterontaskuser = 0, $extrafields = array(), $includebilltime = 0, $search_array_options = array(), $loadextras = 0, $loadRoleMode = 1, $sortfield = '', $sortorder = '')
public function getTasksArray($usert = null, $userp = null, $projectid = 0, $socid = 0, $mode = 0, $filteronproj = '', $filteronprojstatus = '-1', $morewherefilter = '', $filteronprojuser = 0, $filterontaskuser = 0, $extrafields = null, $includebilltime = 0, $search_array_options = array(), $loadextras = 0, $loadRoleMode = 1, $sortfield = '', $sortorder = '')
{
global $conf, $hookmanager;
global $hookmanager;
$tasks = array();
@@ -1054,7 +1054,7 @@ class Task extends CommonObjectLine
if ($filteronproj) {
$sql .= natural_search(array("p.ref", "p.title"), $filteronproj);
}
if ($filteronprojstatus && $filteronprojstatus != '-1') {
if ($filteronprojstatus && (int) $filteronprojstatus != '-1') {
$sql .= " AND p.fk_statut IN (".$this->db->sanitize($filteronprojstatus).")";
}
if ($morewherefilter) {

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2018-2020 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2018 Fédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 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
@@ -689,7 +690,7 @@ if ($event->type == 'payout.created') {
$companypaymentmode->stripe_card_ref = $db->escape($event->data->object->id);
$companypaymentmode->fk_soc = $idthirdparty;
$companypaymentmode->bank = null;
$companypaymentmode->label = null;
$companypaymentmode->label = '';
$companypaymentmode->number = $db->escape($event->data->object->id);
$companypaymentmode->last_four = $db->escape($event->data->object->card->last4);
$companypaymentmode->card_type = $db->escape($event->data->object->card->branding);
@@ -725,7 +726,7 @@ if ($event->type == 'payout.created') {
if ($companypaymentmode->id > 0) {
// If we found a payment mode with the ID
$companypaymentmode->bank = null;
$companypaymentmode->label = null;
$companypaymentmode->label = '';
$companypaymentmode->number = $db->escape($event->data->object->id);
$companypaymentmode->last_four = $db->escape($event->data->object->card->last4);
$companypaymentmode->proprio = $db->escape($event->data->object->billing_details->name);

View File

@@ -12,6 +12,7 @@
* Copyright (C) 2016-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr>
* Copyright (C) 2022-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -125,7 +126,7 @@ class Reception extends CommonObject
public $listmeths; // List of carriers
/**
* @var CommandeFournisseur
* @var ?CommandeFournisseur
*/
public $commandeFournisseur;
@@ -731,7 +732,11 @@ class Reception extends CommonObject
$this->fetch_origin();
if (empty($this->origin_object->lines)) {
$res = $this->origin_object->fetch_lines();
$this->commandeFournisseur = $this->origin_object; // deprecated
if ($this->origin_object instanceof CommandeFournisseur) {
$this->commandeFournisseur = $this->origin_object; // deprecated
} else {
$this->commandeFournisseur = null; // deprecated
}
if ($res < 0) {
return $res;
}
@@ -742,7 +747,7 @@ class Reception extends CommonObject
$qty_wished = array();
$supplierorderdispatch = new CommandeFournisseurDispatch($this->db);
$filter = array('t.fk_commande'=>$this->origin_id);
$filter = array('t.fk_commande' => $this->origin_id);
if (getDolGlobalInt('SUPPLIER_ORDER_USE_DISPATCH_STATUS')) {
$filter['t.status'] = 1; // Restrict to lines with status validated
}
@@ -1305,7 +1310,7 @@ class Reception extends CommonObject
global $action;
$hookmanager->initHooks(array($this->element . 'dao'));
$parameters = array('id'=>$this->id, 'getnomurl' => &$result);
$parameters = array('id' => $this->id, 'getnomurl' => &$result);
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) {
$result = $hookmanager->resPrint;

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -155,7 +156,7 @@ class mod_recruitmentcandidature_standard extends ModeleNumRefRecruitmentCandida
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_recruitmentcandidature_standard::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 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
@@ -155,7 +156,7 @@ class mod_recruitmentjobposition_standard extends ModeleNumRefRecruitmentJobPosi
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
$num = sprintf("%04s", $max + 1);
$num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_recruitmentjobposition_standard::getNextValue return ".$this->prefix.$yymm."-".$num);

View File

@@ -402,7 +402,8 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) {
if ($object->id > 0) {
$object->paye = 0;
$object->id = $object->ref = null;
$object->id = 0;
$object->ref = '';
if (GETPOST('amount', 'alphanohtml')) {
$object->amount = price2num(GETPOST('amount', 'alphanohtml'), 'MT', 2);

View File

@@ -562,12 +562,12 @@ if (empty($reshook)) {
} else {
if ($result == -3 && in_array('ErrorCustomerCodeAlreadyUsed', $object->errors)) {
$duplicate_code_error = true;
$object->code_client = null;
$object->code_client = '';
}
if ($result == -3 && in_array('ErrorSupplierCodeAlreadyUsed', $object->errors)) {
$duplicate_code_error = true;
$object->code_fournisseur = null;
$object->code_fournisseur = '';
}
if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { // TODO Sometime errors on duplicate on profid and not on code, so we must manage this case

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2024 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
@@ -167,7 +168,7 @@ class Contacts extends DolibarrApi
* @param int $includecount Count and return also number of elements the contact is used as a link for
* @param int $includeroles Includes roles of the contact
* @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names
* @return array Array of contact objects
* @return Contact[] Array of contact objects
*
* @throws RestException
*/
@@ -273,6 +274,8 @@ class Contacts extends DolibarrApi
*
* @param array $request_data Request datas
* @return int ID of contact
*
* @suppress PhanPluginUnknownArrayMethodParamType Luracast limitation
*/
public function post($request_data = null)
{
@@ -311,7 +314,7 @@ class Contacts extends DolibarrApi
*
* @param int $id Id of contact to update
* @param array $request_data Datas
* @return Object Updated object
* @return Object|false Updated object, false when issue toupdate
*/
public function put($id, $request_data = null)
{
@@ -389,6 +392,7 @@ class Contacts extends DolibarrApi
* @return int ID of user
*
* @url POST {id}/createUser
* @suppress PhanPluginUnknownArrayMethodParamType Luracast limitation
*/
public function createUser($id, $request_data = null)
{
@@ -573,8 +577,8 @@ class Contacts extends DolibarrApi
/**
* Validate fields before create or update object
*
* @param array|null $data Data to validate
* @return array
* @param string[]|null $data Data to validate
* @return string[]
* @throws RestException
*/
private function _validate($data)

View File

@@ -94,43 +94,43 @@ class CompanyBankAccount extends Account
'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'picto' => 'company', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150',),
'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 25, 'notnull' => 0, 'visible' => -1,),
'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => -1,),
'label' => array('type' => 'varchar(200)', 'label' => 'Label', 'enabled' => 1, 'position' => 35, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1', 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax150',),
'bank' => array('type' => 'varchar(255)', 'label' => 'Bank', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'code_banque' => array('type' => 'varchar(128)', 'label' => 'Codebanque', 'enabled' => 1, 'position' => 45, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'code_guichet' => array('type' => 'varchar(6)', 'label' => 'Codeguichet', 'enabled' => 1, 'position' => 50, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'number' => array('type' => 'varchar(255)', 'label' => 'Number', 'enabled' => 1, 'position' => 55, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'cle_rib' => array('type' => 'varchar(5)', 'label' => 'Clerib', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'bic' => array('type' => 'varchar(20)', 'label' => 'Bic', 'enabled' => 1, 'position' => 65, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'iban_prefix' => array('type' => 'varchar(34)', 'label' => 'Ibanprefix', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'domiciliation' => array('type' => 'varchar(255)', 'label' => 'Domiciliation', 'enabled' => 1, 'position' => 75, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'proprio' => array('type' => 'varchar(60)', 'label' => 'Proprio', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'owner_address' => array('type' => 'varchar(255)', 'label' => 'Owneraddress', 'enabled' => 1, 'position' => 85, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'default_rib' => array('type' => 'smallint(6)', 'label' => 'Defaultrib', 'enabled' => 1, 'position' => 90, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => '1',),
'state_id' => array('type' => 'integer', 'label' => 'Stateid', 'enabled' => 1, 'position' => 95, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'fk_country' => array('type' => 'integer', 'label' => 'Fkcountry', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1', 'css' => 'maxwidth500 widthcentpercentminusxx',),
'currency_code' => array('type' => 'varchar(3)', 'label' => 'Currencycode', 'enabled' => 1, 'position' => 105, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'rum' => array('type' => 'varchar(32)', 'label' => 'Rum', 'enabled' => 1, 'position' => 110, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'date_rum' => array('type' => 'date', 'label' => 'Daterum', 'enabled' => 1, 'position' => 115, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'frstrecur' => array('type' => 'varchar(16)', 'label' => 'Frstrecur', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 900, 'notnull' => 0, 'visible' => -2, 'alwayseditable' => '1',),
'last_four' => array('type' => 'varchar(4)', 'label' => 'Lastfour', 'enabled' => 1, 'position' => 130, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'card_type' => array('type' => 'varchar(255)', 'label' => 'Cardtype', 'enabled' => 1, 'position' => 135, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'cvn' => array('type' => 'varchar(255)', 'label' => 'Cvn', 'enabled' => 1, 'position' => 140, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'exp_date_month' => array('type' => 'integer', 'label' => 'Expdatemonth', 'enabled' => 1, 'position' => 145, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'exp_date_year' => array('type' => 'integer', 'label' => 'Expdateyear', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'country_code' => array('type' => 'varchar(10)', 'label' => 'Countrycode', 'enabled' => 1, 'position' => 155, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'approved' => array('type' => 'integer', 'label' => 'Approved', 'enabled' => 1, 'position' => 160, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'position' => 165, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'ending_date' => array('type' => 'date', 'label' => 'Endingdate', 'enabled' => 1, 'position' => 170, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'max_total_amount_of_all_payments' => array('type' => 'double(24,8)', 'label' => 'Maxtotalamountofallpayments', 'enabled' => 1, 'position' => 175, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'preapproval_key' => array('type' => 'varchar(255)', 'label' => 'Preapprovalkey', 'enabled' => 1, 'position' => 180, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'starting_date' => array('type' => 'date', 'label' => 'Startingdate', 'enabled' => 1, 'position' => 185, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'total_amount_of_all_payments' => array('type' => 'double(24,8)', 'label' => 'Totalamountofallpayments', 'enabled' => 1, 'position' => 190, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'stripe_card_ref' => array('type' => 'varchar(128)', 'label' => 'Stripecardref', 'enabled' => 1, 'position' => 195, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => '1',),
'comment' => array('type' => 'varchar(255)', 'label' => 'Comment', 'enabled' => 1, 'position' => 205, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'ipaddress' => array('type' => 'varchar(68)', 'label' => 'Ipaddress', 'enabled' => 1, 'position' => 210, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'stripe_account' => array('type' => 'varchar(128)', 'label' => 'Stripeaccount', 'enabled' => 1, 'position' => 215, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => '1',),
'label' => array('type' => 'varchar(200)', 'label' => 'Label', 'enabled' => 1, 'position' => 35, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax150',),
'bank' => array('type' => 'varchar(255)', 'label' => 'Bank', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'code_banque' => array('type' => 'varchar(128)', 'label' => 'Codebanque', 'enabled' => 1, 'position' => 45, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'code_guichet' => array('type' => 'varchar(6)', 'label' => 'Codeguichet', 'enabled' => 1, 'position' => 50, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'number' => array('type' => 'varchar(255)', 'label' => 'Number', 'enabled' => 1, 'position' => 55, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'cle_rib' => array('type' => 'varchar(5)', 'label' => 'Clerib', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'bic' => array('type' => 'varchar(20)', 'label' => 'Bic', 'enabled' => 1, 'position' => 65, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'iban_prefix' => array('type' => 'varchar(34)', 'label' => 'Ibanprefix', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'domiciliation' => array('type' => 'varchar(255)', 'label' => 'Domiciliation', 'enabled' => 1, 'position' => 75, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'proprio' => array('type' => 'varchar(60)', 'label' => 'Proprio', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'owner_address' => array('type' => 'varchar(255)', 'label' => 'Owneraddress', 'enabled' => 1, 'position' => 85, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'default_rib' => array('type' => 'smallint(6)', 'label' => 'Defaultrib', 'enabled' => 1, 'position' => 90, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1,),
'state_id' => array('type' => 'integer', 'label' => 'Stateid', 'enabled' => 1, 'position' => 95, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'fk_country' => array('type' => 'integer', 'label' => 'Fkcountry', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx',),
'currency_code' => array('type' => 'varchar(3)', 'label' => 'Currencycode', 'enabled' => 1, 'position' => 105, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'rum' => array('type' => 'varchar(32)', 'label' => 'Rum', 'enabled' => 1, 'position' => 110, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'date_rum' => array('type' => 'date', 'label' => 'Daterum', 'enabled' => 1, 'position' => 115, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'frstrecur' => array('type' => 'varchar(16)', 'label' => 'Frstrecur', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 900, 'notnull' => 0, 'visible' => -2, 'alwayseditable' => 1,),
'last_four' => array('type' => 'varchar(4)', 'label' => 'Lastfour', 'enabled' => 1, 'position' => 130, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'card_type' => array('type' => 'varchar(255)', 'label' => 'Cardtype', 'enabled' => 1, 'position' => 135, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'cvn' => array('type' => 'varchar(255)', 'label' => 'Cvn', 'enabled' => 1, 'position' => 140, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'exp_date_month' => array('type' => 'integer', 'label' => 'Expdatemonth', 'enabled' => 1, 'position' => 145, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'exp_date_year' => array('type' => 'integer', 'label' => 'Expdateyear', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'country_code' => array('type' => 'varchar(10)', 'label' => 'Countrycode', 'enabled' => 1, 'position' => 155, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'approved' => array('type' => 'integer', 'label' => 'Approved', 'enabled' => 1, 'position' => 160, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'position' => 165, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'ending_date' => array('type' => 'date', 'label' => 'Endingdate', 'enabled' => 1, 'position' => 170, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'max_total_amount_of_all_payments' => array('type' => 'double(24,8)', 'label' => 'Maxtotalamountofallpayments', 'enabled' => 1, 'position' => 175, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'preapproval_key' => array('type' => 'varchar(255)', 'label' => 'Preapprovalkey', 'enabled' => 1, 'position' => 180, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'starting_date' => array('type' => 'date', 'label' => 'Startingdate', 'enabled' => 1, 'position' => 185, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'total_amount_of_all_payments' => array('type' => 'double(24,8)', 'label' => 'Totalamountofallpayments', 'enabled' => 1, 'position' => 190, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'stripe_card_ref' => array('type' => 'varchar(128)', 'label' => 'Stripecardref', 'enabled' => 1, 'position' => 195, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1,),
'comment' => array('type' => 'varchar(255)', 'label' => 'Comment', 'enabled' => 1, 'position' => 205, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'ipaddress' => array('type' => 'varchar(68)', 'label' => 'Ipaddress', 'enabled' => 1, 'position' => 210, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'stripe_account' => array('type' => 'varchar(128)', 'label' => 'Stripeaccount', 'enabled' => 1, 'position' => 215, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => 0, 'position' => 230),
);

View File

@@ -133,6 +133,29 @@ if (empty($reshook)) {
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
}
if ($action == 'confirm_delete' && $user->hasRight('societe', 'contact', 'delete')) {
$id = GETPOST('id', 'int');
if (!empty($id) && $socid > 0) {
$db->begin();
$sql = "DELETE t, et FROM llx_socpeople AS t";
$sql .= " LEFT JOIN llx_socpeople_extrafields AS et ON t.rowid = et.fk_object";
$sql .= " WHERE t.fk_soc = ".((int) $socid);
$sql .= " AND t.rowid = ".((int) $id);
$sql .= " AND ((t.fk_user_creat = ".((int) $user->id)." AND t.priv = 1) OR t.priv = 0)";
$result = $db->query($sql);
if (!$result) {
setEventMessages($db->lasterror(), null, 'errors');
$db->rollback();
} else {
$db->commit();
setEventMessages('ContactDeleted', null, 'mesgs');
header("Location: ".$_SERVER['PHP_SELF']."?id=".$socid);
exit();
}
}
}
/*
* View
@@ -184,6 +207,18 @@ if ($action != 'presend') {
$result = show_contacts($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id, 1);
}
}
if ($action == 'delete') {
$formconfirm = $form->formconfirm(
$_SERVER["PHP_SELF"].'?id='.GETPOST('id').'&socid='.$object->id,
$langs->trans('Delete'),
$langs->trans('ConfirmDeleteContact', GETPOST('id', 'alpha')),
'confirm_delete',
'',
0,
1
);
print $formconfirm;
}
// End of page
llxFooter();

View File

@@ -76,7 +76,7 @@ class Ticket extends CommonObject
/**
* @var string Hash to identify ticket publicly
* @var ?string Hash to identify ticket publicly
*/
public $track_id;
@@ -97,17 +97,17 @@ class Ticket extends CommonObject
public $fk_contract;
/**
* @var string Person email who have create ticket
* @var ?string Email of person who created the ticket
*/
public $origin_email;
/**
* @var int User id who have create ticket
* @var int User id who created the ticket
*/
public $fk_user_create;
/**
* @var int User id who have ticket assigned
* @var int User id who the ticket is assigned to
*/
public $fk_user_assign;

View File

@@ -884,7 +884,7 @@ class ProductCombination
if ($result < 0) {
//In case the error is not related with an already existing product
if ($newproduct->error != 'ErrorProductAlreadyExists') {
$this->error[] = $newproduct->error;
$this->error = $newproduct->error;
$this->errors = $newproduct->errors;
$this->db->rollback();
return -1;

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
* Copyright (C) 2024 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
@@ -229,7 +230,7 @@ class RestAPIContactTest extends CommonClassTest
print_r($updateResponse);
// Check if the updated fields match the changes you made
$this->assertTrue($updateResponse['firstname'] === $updateBody['firstname'], 'Update might have failed');
$this->assertEquals($updateBody['firstname'], $updateResponse['firstname'], 'Update failed for request body: '.$updateRequestBody);
// Deleting the Contact
/*