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

This commit is contained in:
Laurent Destailleur
2024-11-08 15:59:35 +01:00
46 changed files with 286 additions and 997 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -13,20 +13,20 @@ return [
// PhanPossiblyUndeclaredGlobalVariable : 520+ occurrences
// PhanUndeclaredGlobalVariable : 350+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 320+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 210+ occurrences
// PhanPluginUnknownArrayMethodReturnType : 180+ occurrences
// PhanTypeMismatchProperty : 160+ occurrences
// PhanPluginUnknownArrayMethodParamType : 130+ occurrences
// PhanPluginUnknownPropertyType : 130+ occurrences
// PhanPluginUnknownArrayMethodParamType : 120+ occurrences
// PhanPossiblyUndeclaredVariable : 110+ occurrences
// PhanPluginUndeclaredVariableIsset : 65+ occurrences
// PhanTypeMismatchArgumentNullableInternal : 50+ occurrences
// PhanRedefineFunction : 45+ occurrences
// PhanTypeExpectedObjectPropAccess : 40+ occurrences
// PhanTypeMismatchDimFetch : 40+ occurrences
// PhanPluginEmptyStatementIf : 35+ occurrences
// PhanPluginUnknownArrayFunctionParamType : 35+ occurrences
// PhanPluginUnknownArrayFunctionReturnType : 30+ occurrences
// PhanTypeInvalidDimOffset : 30+ occurrences
// PhanTypeMismatchDimFetch : 30+ occurrences
// PhanUndeclaredConstant : 15+ occurrences
// PhanEmptyForeach : 10+ occurrences
// PhanPluginUnknownObjectMethodCall : 10+ occurrences
@@ -39,6 +39,7 @@ return [
// PhanPluginDuplicateExpressionBinaryOp : 7 occurrences
// PhanParamTooMany : 5 occurrences
// PhanPossiblyNullTypeMismatchProperty : 5 occurrences
// PhanTypeMismatchReturn : 5 occurrences
// PhanPluginDuplicateArrayKey : 4 occurrences
// PhanEmptyFQSENInClasslike : 3 occurrences
// PhanInvalidFQSENInClasslike : 3 occurrences
@@ -47,10 +48,7 @@ return [
// PhanTypeMismatchDimAssignment : 2 occurrences
// PhanAccessMethodProtected : 1 occurrence
// PhanParamTooFew : 1 occurrence
// PhanPluginRedundantReturnComment : 1 occurrence
// PhanTypeConversionFromArray : 1 occurrence
// PhanTypeMismatchArgumentReal : 1 occurrence
// PhanTypeMismatchReturn : 1 occurrence
// PhanTypeSuspiciousStringExpression : 1 occurrence
// Currently, file_suppressions and directory_suppressions are the only supported suppressions
@@ -258,7 +256,7 @@ return [
'htdocs/core/class/notify.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/smtps.class.php' => ['PhanTypeConversionFromArray'],
'htdocs/core/class/timespent.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/core/customreports.php' => ['PhanPluginEmptyStatementIf', 'PhanPluginRedundantReturnComment', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetchNullable'],
'htdocs/core/customreports.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetchNullable'],
'htdocs/core/datepicker.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/core/db/sqlite3.class.php' => ['PhanTypeMismatchReturn'],
'htdocs/core/extrafieldsinimport.inc.php' => ['PhanTypeMismatchArgumentNullableInternal'],
@@ -287,8 +285,8 @@ return [
'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
'htdocs/core/modules/facture/doc/pdf_crabe.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanTypeMismatchReturn', 'PhanUndeclaredProperty'],
'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/facture/modules_facture.php' => ['PhanPluginUnknownPropertyType'],
'htdocs/core/modules/fichinter/mod_pacific.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
@@ -296,7 +294,6 @@ return [
'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'],
'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanTypeMismatchProperty'],
'htdocs/core/modules/mailings/contacts1.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/mailings/modules_mailings.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
'htdocs/core/modules/mailings/thirdparties.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/member/modules_cards.php' => ['PhanPluginUnknownArrayFunctionParamType'],
'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
@@ -308,7 +305,7 @@ return [
'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'],
'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'],
'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/propale/modules_propale.php' => ['PhanPluginUnknownPropertyType'],
@@ -330,8 +327,8 @@ return [
'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'],
'htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'],
'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/core/search_page.php' => ['PhanEmptyForeach', 'PhanPluginBothLiteralsBinaryOp'],
'htdocs/core/tpl/ajaxrow.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'],
@@ -362,13 +359,8 @@ return [
'htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php' => ['PhanUndeclaredProperty'],
'htdocs/cron/card.php' => ['PhanPluginBothLiteralsBinaryOp'],
'htdocs/cron/list.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/debugbar/class/DataCollector/DolConfigCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/debugbar/class/DataCollector/DolMemoryCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/debugbar/class/DataCollector/DolQueryCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/debugbar/class/DataCollector/DolibarrCollector.php' => ['PhanPluginUnknownArrayMethodReturnType'],
'htdocs/debugbar/class/DataCollector/DolMemoryCollector.php' => ['PhanTypeMismatchReturn'],
'htdocs/debugbar/class/DataCollector/DolQueryCollector.php' => ['PhanTypeMismatchReturn'],
'htdocs/delivery/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/delivery/class/delivery.class.php' => ['PhanUndeclaredProperty'],
'htdocs/delivery/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
@@ -709,7 +701,7 @@ return [
'htdocs/webservices/server_supplier_invoice.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'],
'htdocs/webservices/server_thirdparty.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
'htdocs/webservices/server_user.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayFunctionReturnType', 'PhanUndeclaredProperty'],
'htdocs/website/class/website.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/website/class/website.class.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'],
'htdocs/website/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
'htdocs/website/samples/wrapper.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/website/websiteaccount_card.php' => ['PhanUndeclaredProperty'],

View File

@@ -912,6 +912,9 @@ abstract class CommonDocGenerator
array('line_date_start', 'date_start', 'day', 'auto', null),
array('line_date_start_locale', 'date_start', 'day', 'tzserver', $outputlangs),
array('line_date_start_rfc', 'date_start', 'dayrfc', 'auto', null),
array('line_date_start_real', 'date_start_real', 'day', 'auto', null),
array('line_date_start_real_locale', 'date_start_real', 'day', 'tzserver', $outputlangs),
array('line_date_start_real_rfc', 'date_start_real', 'dayrfc', 'auto', null),
array('line_date_end', 'date_end', 'day', 'auto', null),
array('line_date_end_locale', 'date_end', 'day', 'tzserver', $outputlangs),
array('line_date_end_rfc', 'date_end', 'dayrfc', 'auto', null)

View File

@@ -349,7 +349,7 @@ function getDefaultDatesForTransfer()
* @param Conf $conf Config
* @param ?int $from_time [=null] Get current time or set time to find fiscal period
* @param 'tzserver'|'gmt' $gm 'gmt' => we return GMT timestamp (recommended), 'tzserver' => we return in the PHP server timezone
* @param int $withenddateonly Do not return period if and date is not defined
* @param int $withenddateonly Do not return period if end date is not defined
* @return array{date_start:int,date_end:int} Period of fiscal year : [date_start, date_end]
*/
function getCurrentPeriodOfFiscalYear($db, $conf, $from_time = null, $gm = 'tzserver', $withenddateonly = 1)
@@ -358,6 +358,8 @@ function getCurrentPeriodOfFiscalYear($db, $conf, $from_time = null, $gm = 'tzse
$now_arr = dol_getdate($now);
if ($from_time === null) {
$from_time = $now;
} else {
$now_arr = dol_getdate($from_time);
}
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';

View File

@@ -1024,7 +1024,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '',
*/
function num_between_day($timestampStart, $timestampEnd, $lastday = 0)
{
if ($timestampStart < $timestampEnd) {
if ($timestampStart <= $timestampEnd) {
if ($lastday == 1) {
$bit = 0;
} else {

View File

@@ -12897,7 +12897,7 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
* @param string $elementType Element type (Value of $object->element or value of $object->element@$object->module). Example:
* 'action', 'facture', 'project', 'project_task' or
* 'myobject@mymodule' (or old syntax 'mymodule_myobject' like 'project_task')
* @return array{module:string,element:string,table_element:string,subelement:string,classpath:string,classfile:string,classname:string,dir_output:string,dir_temp:string} array('module'=>, 'classpath'=>, 'element'=>, 'subelement'=>, 'classfile'=>, 'classname'=>, 'dir_output'=>, 'dir_temp'=>)
* @return array{module:string,element:string,table_element:string,subelement:string,classpath:string,classfile:string,classname:string,dir_output:string,dir_temp:string,parent_element:string} array('module'=>, 'classpath'=>, 'element'=>, 'subelement'=>, 'classfile'=>, 'classname'=>, 'dir_output'=>, 'dir_temp'=>)
* @see fetchObjectByElement(), getMultidirOutput()
*/
function getElementProperties($elementType)

View File

@@ -233,7 +233,7 @@ class doc_generic_contract_odt extends ModelePDFContract
$outputlangs->charset_output = 'UTF-8';
// Load translation files required by page
$outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "deliveries"));
if ($conf->contract->multidir_output[$object->entity]) {
// If $object is id instead of object

View File

@@ -96,7 +96,7 @@ class pdf_octopus extends ModelePDFFactures
public $heightforfooter;
/**
* @var int tab_top
* @var float tab_top
*/
public $tab_top;
@@ -130,7 +130,7 @@ class pdf_octopus extends ModelePDFFactures
/**
* Situation invoices
*
* @var array{derniere_situation:Facture,date_derniere_situation:int,current:array} Data of situation
* @var array{derniere_situation?:Facture,date_derniere_situation?:int,cumul_anterieur:array<'HT'|'HTnet'|'retenue_garantie'|'total_a_payer'|'travaux_sup'|'TTC'|'TVA'|int,mixed>,current:array{HT:float,HTnet:float,TVA:float,TTC:float,retenue_garantie:float,travaux_sup:float,total_a_payer:float,derniere_situation?:Facture,date_derniere_situation:int},nouveau_cumul:array<int|string,mixed|float|int>}
*/
public $TDataSituation;
@@ -1958,10 +1958,10 @@ class pdf_octopus extends ModelePDFFactures
* @param int $tab_height Height of table (rectangle)
* @param int $nexY Y (not used)
* @param Translate $outputlangs Langs object
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int $hidebottom Hide bottom bar of array
* @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int<0,1> $hidebottom Hide bottom bar of array
* @param string $currency Currency code
* @param Translate $outputlangsbis Langs object bis
* @param ?Translate $outputlangsbis Langs object bis
* @return void
*/
protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '', $outputlangsbis = null)
@@ -2052,10 +2052,10 @@ class pdf_octopus extends ModelePDFFactures
*
* @param TCPDI|TCPDF $pdf Object PDF
* @param Facture $object Object to show
* @param int $showaddress 0=no, 1=yes (usually set to 1 for first page, and 0 for next pages)
* @param int<0,1> $showaddress 0=no, 1=yes (usually set to 1 for first page, and 0 for next pages)
* @param Translate $outputlangs Object lang for output
* @param Translate $outputlangsbis Object lang for output bis
* @return array top shift of linked object lines
* @param ?Translate $outputlangsbis Object lang for output bis
* @return array{top_shift:float,shipp_shift:float} Top shift of linked object lines
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
{
@@ -2755,8 +2755,8 @@ class pdf_octopus extends ModelePDFFactures
* @param int $tab_height Height of table (rectangle)
* @param int $nexY Y (not used)
* @param Translate $outputlangs Langs object
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int $hidebottom Hide bottom bar of array
* @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int<0,1> $hidebottom Hide bottom bar of array
* @param string $currency Currency code
* @return void
*/
@@ -2980,7 +2980,7 @@ class pdf_octopus extends ModelePDFFactures
*
* @param Facture $object Facture
*
* @return array
* @return array{derniere_situation?:Facture,date_derniere_situation?:int,cumul_anterieur:array<'HT'|'HTnet'|'retenue_garantie'|'total_a_payer'|'travaux_sup'|'TTC'|'TVA'|int,mixed>,current:array{HT:float,HTnet:float,TVA:float,TTC:float,retenue_garantie:float,travaux_sup:float,total_a_payer:float,derniere_situation?:Facture,date_derniere_situation:int},nouveau_cumul:array<int|string,mixed|float|int>}
*
* Details of returned table
*
@@ -3101,7 +3101,8 @@ class pdf_octopus extends ModelePDFFactures
foreach ($TDiffKey as $i) {
if (empty($object->lines[$i]->fk_prev_id)) {
$TDataSituation['nouveau_cumul']['travaux_sup'] += $object->lines[$i]->total_ht;
// Next line is useless because 'nouveau_cumul' is overwritten below
// $TDataSituation['nouveau_cumul']['travaux_sup'] += $object->lines[$i]->total_ht;
$TDataSituation['current']['travaux_sup'] += $object->lines[$i]->total_ht;
}
}
@@ -3116,10 +3117,10 @@ class pdf_octopus extends ModelePDFFactures
/**
* Calculates the sum of two arrays, key by key, taking into account nested arrays
*
* @param array $a [$a description]
* @param array $b [$b description]
* @param array<int|string,int|float|mixed[]> $a [$a description]
* @param array<int|string,int|float|mixed[]> $b [$b description]
*
* @return array [return description]
* @return array<int|string,int|float|mixed[]> [return description]
*/
public function sumSituation($a, $b)
{
@@ -3231,8 +3232,8 @@ class pdf_octopus extends ModelePDFFactures
* @param float $y Ordinate of first point
* @param float $l ??
* @param float $h ??
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int $hidebottom Hide bottom
* @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int<0,1> $hidebottom Hide bottom
* @return void
*/
/*
@@ -3257,8 +3258,8 @@ class pdf_octopus extends ModelePDFFactures
* @param float $w Width of the rectangle
* @param float $h Height of the rectangle
* @param float $r Corner radius (can be an array for different radii per corner)
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int $hidebottom Hide bottom
* @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int<0,1> $hidebottom Hide bottom
* @param string $style Draw style (e.g. 'D' for draw, 'F' for fill, 'DF' for both)
* @return void
*/
@@ -3279,10 +3280,10 @@ class pdf_octopus extends ModelePDFFactures
/**
* Get data about invoice
*
* @param int $id invoice id
* @param boolean $forceReadFromDB set to true if you want to force refresh data from SQL
* @param int $id invoice id
* @param bool $forceReadFromDB set to true if you want to force refresh data from SQL
*
* @return array [return description]
* @return array{HT:float,HTnet:float,TVA:float,TTC:float,retenue_garantie:float,travaux_sup:float,total_a_payer:float,derniere_situation?:Facture,date_derniere_situation:int}
*/
public function btpGetInvoiceAmounts($id, $forceReadFromDB = false)
{
@@ -3346,9 +3347,11 @@ class pdf_octopus extends ModelePDFFactures
$ret['retenue_garantie'] = $retenue_garantie;
//Clean up before keep in "cache"
unset($ret['derniere_situation']->db);
unset($ret['derniere_situation']->fields);
unset($ret['derniere_situation']->lines);
if (array_key_exists('derniere_situation', $ret)) {
unset($ret['derniere_situation']->db);
unset($ret['derniere_situation']->fields);
unset($ret['derniere_situation']->lines);
}
// print "<p>Store to cache $id : " . json_encode($_cache_btpProrataGetInvoiceAmounts[$id]) . "</p>";
return $ret;

View File

@@ -94,12 +94,12 @@ class pdf_sponge extends ModelePDFFactures
public $heightforfooter;
/**
* @var int tab_top
* @var float tab_top
*/
public $tab_top;
/**
* @var int tab_top_newpage
* @var float tab_top_newpage
*/
public $tab_top_newpage;
@@ -2066,10 +2066,10 @@ class pdf_sponge extends ModelePDFFactures
* @param float|int $tab_height Height of table (rectangle)
* @param int $nexY Y (not used)
* @param Translate $outputlangs Langs object
* @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int $hidebottom Hide bottom bar of array
* @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
* @param int<0,1> $hidebottom Hide bottom bar of array
* @param string $currency Currency code
* @param Translate $outputlangsbis Langs object bis
* @param ?Translate $outputlangsbis Langs object bis
* @return void
*/
protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '', $outputlangsbis = null)
@@ -2133,8 +2133,8 @@ class pdf_sponge extends ModelePDFFactures
* @param Facture $object Object to show
* @param int $showaddress 0=no, 1=yes (usually set to 1 for first page, and 0 for next pages)
* @param Translate $outputlangs Object lang for output
* @param Translate $outputlangsbis Object lang for output bis
* @return array top shift of linked object lines
* @param ?Translate $outputlangsbis Object lang for output bis
* @return array{top_shift:float,shipp_shift:float} Top shift of linked object lines
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
{

View File

@@ -98,12 +98,12 @@ class mailing_advthirdparties extends MailingTargets
if (!array_key_exists($obj->email, $cibles)) {
$cibles[$obj->email] = array(
'email' => $obj->email,
'fk_contact' => $obj->fk_contact,
'fk_contact' => (int) $obj->fk_contact,
'name' => $obj->name,
'firstname' => $obj->firstname,
'other' => '',
'source_url' => $this->url($obj->id, 'thirdparty'),
'source_id' => $obj->id,
'source_id' => (int) $obj->id,
'source_type' => 'thirdparty'
);
}
@@ -151,12 +151,12 @@ class mailing_advthirdparties extends MailingTargets
if (!array_key_exists($obj->email, $cibles)) {
$cibles[$obj->email] = array(
'email' => $obj->email,
'fk_contact' => $obj->id,
'fk_contact' => (int) $obj->id,
'lastname' => $obj->lastname,
'firstname' => $obj->firstname,
'other' => '',
'source_url' => $this->url($obj->id, 'contact'),
'source_id' => $obj->id,
'source_id' => (int) $obj->id,
'source_type' => 'contact'
);
}

View File

@@ -458,7 +458,7 @@ class mailing_contacts1 extends MailingTargets
if ($old != $obj->email) {
$cibles[$j] = array(
'email' => $obj->email,
'fk_contact' => $obj->fk_contact,
'fk_contact' => (int) $obj->fk_contact,
'lastname' => $obj->lastname,
'firstname' => $obj->firstname,
'other' =>
@@ -466,7 +466,7 @@ class mailing_contacts1 extends MailingTargets
($langs->transnoentities("UserTitle").'='.($obj->civility_id ? $langs->transnoentities("Civility".$obj->civility_id) : '')).';'.
($langs->transnoentities("PostOrFunction").'='.$obj->jobposition),
'source_url' => $this->url($obj->id),
'source_id' => $obj->id,
'source_id' => (int) $obj->id,
'source_type' => 'contact'
);
$old = $obj->email;

View File

@@ -108,12 +108,12 @@ class mailing_eventorganization extends MailingTargets
$otherTxt .= $addDescription;
$cibles[$j] = array(
'email' => $obj->email,
'fk_project' => $obj->fk_project,
'fk_project' => (int) $obj->fk_project,
'lastname' => $obj->lastname,
'firstname' => $obj->firstname,
'other' => $otherTxt,
'source_url' => $this->url($obj->id, $obj->source),
'source_id' => $obj->id,
'source_id' => (int) $obj->id,
'source_type' => $obj->source
);
$old = $obj->email;

View File

@@ -301,7 +301,7 @@ class mailing_fraise extends MailingTargets
if ($old != $obj->email) {
$cibles[$j] = array(
'email' => $obj->email,
'fk_contact' => $obj->fk_contact,
'fk_contact' => (int) $obj->fk_contact,
'lastname' => $obj->lastname,
'firstname' => $obj->firstname,
'other' =>
@@ -310,7 +310,7 @@ class mailing_fraise extends MailingTargets
($langs->transnoentities("DateEnd").'='.dol_print_date($this->db->jdate($obj->datefin), 'day')).';'.
($langs->transnoentities("Company").'='.$obj->societe),
'source_url' => $this->url($obj->id),
'source_id' => $obj->id,
'source_id' => (int) $obj->id,
'source_type' => 'member'
);
$old = $obj->email;

View File

@@ -73,7 +73,10 @@ class MailingTargets // This can't be abstract as it is used for some method
public $sql;
public $evenunsubscribe = 0; // Set this to 1 if you want to flag you also want to include email in target that has opt-out.
/**
* @var int<0,1> Set this to 1 if you want to flag you also want to include email in target that has opt-out.
*/
public $evenunsubscribe = 0;
/**
@@ -190,7 +193,7 @@ class MailingTargets // This can't be abstract as it is used for some method
* Add a list of targets into the database
*
* @param int $mailing_id Id of emailing
* @param array $cibles Array with targets
* @param array<array{fk_contact?:int,lastname:string,firstname:string,email:string,other:string,source_url:string,source_id?:int,source_type:string,id?:int}> $cibles Array with targets
* @return int Return integer < 0 if error, nb added if OK
*/
public function addTargetsToDatabase($mailing_id, $cibles)
@@ -199,6 +202,7 @@ class MailingTargets // This can't be abstract as it is used for some method
$this->db->begin();
// Insert emailing targets from array into database
$j = 0;
$num = count($cibles);
@@ -217,7 +221,7 @@ class MailingTargets // This can't be abstract as it is used for some method
$sql .= "'".$this->db->escape($targetarray['email'])."',";
$sql .= "'".$this->db->escape($targetarray['other'])."',";
$sql .= "'".$this->db->escape($targetarray['source_url'])."',";
$sql .= (empty($targetarray['source_id']) ? 'null' : "'".$this->db->escape($targetarray['source_id'])."'").",";
$sql .= (empty($targetarray['source_id']) ? 'null' : (int) $targetarray['source_id']).",";
$sql .= "'".$this->db->escape(dol_hash($conf->file->instance_unique_id.";".$targetarray['email'].";".$targetarray['lastname'].";".((int) $mailing_id).";".getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY'), 'md5'))."',";
$sql .= "'".$this->db->escape($targetarray['source_type'])."')";
dol_syslog(__METHOD__, LOG_DEBUG);
@@ -302,8 +306,8 @@ class MailingTargets // This can't be abstract as it is used for some method
* Return list of widget. Function used by admin page htdoc/admin/widget.
* List is sorted by widget filename so by priority to run.
*
* @param array $forcedir null=All default directories. This parameter is used by modulebuilder module only.
* @return array Array list of widget
* @param ?array<string> $forcedir null=All default directories. This parameter is used by modulebuilder module only.
* @return array<array{picto:string,file:string,fullpath:string,relpath:string,iscoreorexternal:'external'|'internal',version:string,status:string,info:string}> Array list of widgets
*/
public static function getEmailingSelectorsList($forcedir = null)
{

View File

@@ -130,12 +130,12 @@ class mailing_partnership extends MailingTargets
$otherTxt .= $addDescription;
$cibles[$j] = array(
'email' => $obj->email,
'fk_contact' => $obj->fk_contact,
'fk_contact' => (int) $obj->fk_contact,
'lastname' => $obj->name, // For a thirdparty, we must use name
'firstname' => '', // For a thirdparty, lastname is ''
'other' => $otherTxt,
'source_url' => $this->url($obj->id, $obj->source),
'source_id' => $obj->id,
'source_id' => (int) $obj->id,
'source_type' => $obj->source
);
$old = $obj->email;

View File

@@ -203,7 +203,7 @@ class mailing_pomme extends MailingTargets
if ($old != $obj->email) {
$cibles[$j] = array(
'email' => $obj->email,
'fk_contact' => $obj->fk_contact,
'fk_contact' => (int) $obj->fk_contact,
'lastname' => $obj->lastname,
'firstname' => $obj->firstname,
'other' =>
@@ -211,7 +211,7 @@ class mailing_pomme extends MailingTargets
($langs->transnoentities("UserTitle").'='.$obj->civility_id).';'.
($langs->transnoentities("PhonePro").'='.$obj->office_phone),
'source_url' => $this->url($obj->id),
'source_id' => $obj->id,
'source_id' => (int) $obj->id,
'source_type' => 'user'
);
$old = $obj->email;

View File

@@ -197,12 +197,12 @@ class mailing_thirdparties extends MailingTargets
$otherTxt .= $addDescription;
$cibles[$j] = array(
'email' => $obj->email,
'fk_contact' => $obj->fk_contact,
'fk_contact' => (int) $obj->fk_contact,
'lastname' => $obj->name, // For a thirdparty, we must use name
'firstname' => '', // For a thirdparty, lastname is ''
'other' => $otherTxt,
'source_url' => $this->url($obj->id),
'source_id' => $obj->id,
'source_id' => (int) $obj->id,
'source_type' => 'thirdparty'
);
$old = $obj->email;

View File

@@ -141,7 +141,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
('Contract='.$obj->fk_contrat).';'.
('ContactLine='.$obj->cdid),
'source_url' => $this->url($obj->id),
'source_id' => $obj->id,
'source_id' => (int) $obj->id,
'source_type' => 'thirdparty'
);
$old = $obj->email;

View File

@@ -173,7 +173,7 @@ class mailing_xinputfile extends MailingTargets
'firstname' => $firstname,
'other' => $other,
'source_url' => '',
'source_id' => '',
'source_id' => 0,
'source_type' => 'file'
);
$old = $email;

View File

@@ -143,7 +143,7 @@ class mailing_xinputuser extends MailingTargets
'firstname' => $firstname,
'other' => $other,
'source_url' => '',
'source_id' => '',
'source_id' => 0,
'source_type' => 'file'
);

View File

@@ -141,7 +141,7 @@ class doc_generic_task_odt extends ModelePDFTask
* @param CommonObject $object Main object to use as data source
* @param Translate $outputlangs Lang object to use for output
* @param string $array_key Name of the key for return array
* @return array Array of substitution
* @return array<string,int|string> Array of substitution
*/
public function get_substitutionarray_object($object, $outputlangs, $array_key = 'object')
{
@@ -185,7 +185,7 @@ class doc_generic_task_odt extends ModelePDFTask
* @param Task $task Task Object
* @param Translate $outputlangs Lang object to use for output
* @param string $array_key Name of the key for return array
* @return array Return a substitution array
* @return array<string,int|string> Return a substitution array
*/
public function get_substitutionarray_tasks($task, $outputlangs, $array_key = 'task')
{
@@ -226,9 +226,9 @@ class doc_generic_task_odt extends ModelePDFTask
/**
* Define array with couple substitution key => substitution value
*
* @param array $contact Contact array
* @param array{id:int,rowid:int,libelle:string,lastname:string,firstname:string,fullname:string,socname:string,email:string} $contact Contact array
* @param Translate $outputlangs Lang object to use for output
* @return array Return a substitution array
* @return array<string,int|string> Return a substitution array
*/
public function get_substitutionarray_project_contacts($contact, $outputlangs)
{
@@ -249,9 +249,9 @@ class doc_generic_task_odt extends ModelePDFTask
/**
* Define array with couple substitution key => substitution value
*
* @param array $file file array
* @param array{name:string,path:string,level1name:string,relativename:string,fullname:string,date:string,size:int,perm:int,type:string} $file file array
* @param Translate $outputlangs Lang object to use for output
* @return array Return a substitution array
* @return array<string,int|string> Return a substitution array
*/
public function get_substitutionarray_project_file($file, $outputlangs)
{
@@ -267,9 +267,9 @@ class doc_generic_task_odt extends ModelePDFTask
/**
* Define array with couple substitution key => substitution value
*
* @param array $refdetail Reference array
* @param array{type:string,ref:string,date:int,socname:string,amountht:float|string,amountttc:float|string,status:string} $refdetail Reference array
* @param Translate $outputlangs Lang object to use for output
* @return array Return a substitution array
* @return array<string,int|string> Return a substitution array
*/
public function get_substitutionarray_project_reference($refdetail, $outputlangs)
{
@@ -289,9 +289,9 @@ class doc_generic_task_odt extends ModelePDFTask
/**
* Define array with couple substitution key => substitution value
*
* @param array $taskresource Resource array
* @param array{rowid:int,libelle:string,lastname:string,firstname:string,fullname:string,socname:string,email:string} $taskresource Resource array
* @param Translate $outputlangs Lang object to use for output
* @return array Return a substitution array
* @return array<string,int|string> Return a substitution array
*/
public function get_substitutionarray_tasksressource($taskresource, $outputlangs)
{
@@ -313,9 +313,9 @@ class doc_generic_task_odt extends ModelePDFTask
/**
* Define array with couple substitution key => substitution value
*
* @param array $tasktime times object
* @param array{rowid:int,task_date:string,task_duration:int,note:string,fk_user:int,lastname:string,firstname:string,fullcivname:string} $tasktime times object
* @param Translate $outputlangs Lang object to use for output
* @return array Return a substitution array
* @return array<string,string|int> Return a substitution array
*/
public function get_substitutionarray_taskstime($tasktime, $outputlangs)
{

View File

@@ -418,7 +418,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket
* @param CommonObject $object user
* @param Translate $outputlangs translation object
* @param string $array_key key for array
* @return array array of substitutions
* @return array<string,int|string> array of substitutions
*/
public function get_substitutionarray_object($object, $outputlangs, $array_key = 'object')
{

View File

@@ -449,7 +449,7 @@ class doc_generic_user_odt extends ModelePDFUser
* @param CommonObject $object user
* @param Translate $outputlangs translation object
* @param string $array_key key for array
* @return array array of substitutions
* @return array<string,int|string> array of substitutions
*/
public function get_substitutionarray_object($object, $outputlangs, $array_key = 'object')
{

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2017-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2017-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
@@ -17,7 +17,7 @@
*/
/**
* \file core/triggers/interface_99_modZapier_ZapierTriggers.class.php
* \file htdocs/core/triggers/interface_99_modZapier_ZapierTriggers.class.php
* \ingroup zapier
* \brief File for Zappier Triggers.
*/

View File

@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2017 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>
*

View File

@@ -1,5 +1,6 @@
<?php
/* 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
@@ -32,7 +33,7 @@ class DolConfigCollector extends ConfigCollector
/**
* Return widget settings
*
* @return array Array
* @return array<string,array{icon?:string,widget?:string,tooltip?:string,map:string,default:string}> Array
*/
public function getWidgets()
{
@@ -51,7 +52,7 @@ class DolConfigCollector extends ConfigCollector
/**
* Return collected data
*
* @return array Array of collected data
* @return array{count:int,messages:string[]} Array of collected data
*/
public function collect()
{
@@ -63,7 +64,7 @@ class DolConfigCollector extends ConfigCollector
/**
* Returns an array with config data
*
* @return array Array of config
* @return array<string,array<string,string|mixed[]>> Array of config
*/
protected function getConfig()
{
@@ -93,7 +94,7 @@ class DolConfigCollector extends ConfigCollector
* Convert an object to array
*
* @param mixed $obj Object
* @return array Array
* @return array<string,mixed> Array
*/
protected function objectToArray($obj)
{

View File

@@ -1,5 +1,6 @@
<?php
/* 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
@@ -32,7 +33,7 @@ class DolExceptionsCollector extends ExceptionsCollector
/**
* Return widget settings
*
* @return array Array
* @return array<string,array{icon?:string,widget?:string,tooltip?:string,map:string,default:string}> Array
*/
public function getWidgets()
{

View File

@@ -66,7 +66,8 @@ class DolLogsCollector extends MessagesCollector
/**
* Return widget settings
*
* @return array<string,array{icon?:string,widget?:string,map:string,default:string}> Array
* @return array<string,array{icon?:string,indicator?:string,widget?:string,tooltip?:string|array{html:string,class:string},map:string,default:string}> Array
*/
public function getWidgets()
{

View File

@@ -1,5 +1,6 @@
<?php
/* 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
@@ -31,7 +32,7 @@ class DolMemoryCollector extends MemoryCollector
/**
* Return value of indicator
*
* @return array Array
* @return array{peak_usage:string,peak_usage_str:string} Array
*/
public function collect()
{
@@ -48,7 +49,7 @@ class DolMemoryCollector extends MemoryCollector
/**
* Return widget settings
*
* @return array Array
* @return array<string,array{icon?:string,widget?:string,tooltip?:string,map:string,default:string}> Array
*/
public function getWidgets()
{

View File

@@ -55,7 +55,7 @@ class DolQueryCollector extends DataCollector implements Renderable, AssetProvid
/**
* Return collected data
*
* @return array Array of collected data
* @return array<string,mixed> Array of collected data
*/
public function collect()
{
@@ -102,7 +102,7 @@ class DolQueryCollector extends DataCollector implements Renderable, AssetProvid
/**
* Return widget settings
*
* @return array Array
* @return array<string,array{icon?:string,widget?:string,tooltip?:string,map:string,default:string}> Array
*/
public function getWidgets()
{
@@ -127,7 +127,7 @@ class DolQueryCollector extends DataCollector implements Renderable, AssetProvid
/**
* Return assets
*
* @return array Array
* @return array<string,string> Array
*/
public function getAssets()
{

View File

@@ -1,5 +1,6 @@
<?php
/* 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
@@ -32,7 +33,7 @@ class DolRequestDataCollector extends RequestDataCollector
/**
* Collects the data from the collectors
*
* @return array Array of collected data
* @return array<string,mixed> Array of collected data
*/
public function collect()
{
@@ -68,7 +69,7 @@ class DolRequestDataCollector extends RequestDataCollector
/**
* Return widget settings
*
* @return array Array
* @return array<string,array{icon?:string,widget?:string,tooltip?:string,map:string,default:string}> Array
*/
public function getWidgets()
{

View File

@@ -1,5 +1,6 @@
<?php
/* 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
@@ -31,7 +32,7 @@ class DolTimeDataCollector extends TimeDataCollector
/**
* Return widget settings
*
* @return array Array
* @return array<string,array{icon?:string,widget?:string,tooltip?:string,map:string,default:string}> Array
*/
public function getWidgets()
{

View File

@@ -45,7 +45,7 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid
/**
* Return collected data
*
* @return array Array of collected data
* @return array<string,mixed> Array of collected data
*/
public function collect()
{
@@ -125,7 +125,7 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid
/**
* Return widget settings
*
* @return array Array
* @return array<string,array{icon?:string,indicator?:string,widget?:string,tooltip?:string|array{html:string,class:string},map:string,default:string}> Array
*/
public function getWidgets()
{
@@ -164,9 +164,9 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid
}
/**
* Return collector assests
* Return collector assets
*
* @return array Array
* @return array<string,string> Array
*/
public function getAssets()
{

View File

@@ -925,7 +925,7 @@ class EcmFiles extends CommonObject
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
}
if (!empty($this->gen_or_uploaded)) {
$datas['gen_or_upload'] .= '<br><b>'.$langs->trans('GenOrUpload').':</b> '.$this->gen_or_uploaded;
$datas['gen_or_upload'] = '<br><b>'.$langs->trans('GenOrUpload').':</b> '.$this->gen_or_uploaded;
}
return $datas;
@@ -996,7 +996,7 @@ class EcmFiles extends CommonObject
if (empty($this->filename)) {
$result .= ($linkstart.img_object(($notooltip ? '' : $label), 'label', ($notooltip ? '' : 'class="paddingright"')).$linkend);
} else {
$result .= ($linkstart.img_mime($this->filename, ($notooltip ? '' : $label), ($notooltip ? '' : 'class="paddingright"')).$linkend);
$result .= ($linkstart.img_mime($this->filename, ($notooltip ? '' : dol_escape_htmltag($label, 1)), ($notooltip ? '' : ' paddingright')).$linkend);
}
if ($withpicto != 2) {
$result .= ' ';

View File

@@ -0,0 +1,20 @@
-- ===================================================================
-- Copyright (C) 2024 Abbes Bahfir <contact@01consulting.eu>
--
-- 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
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- ===================================================================
ALTER TABLE llx_pos_cash_fence_extrafields ADD UNIQUE INDEX uk_pos_cash_fence_extrafields (fk_object);

View File

@@ -0,0 +1,26 @@
-- ===================================================================
-- Copyright (C) 2024 Abbes Bahfir <contact@01consulting.eu>
--
-- 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
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- ===================================================================
create table llx_pos_cash_fence_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@@ -131,13 +131,13 @@ class mailing_mailing_mymodule_selector1 extends MailingTargets
$obj = $this->db->fetch_object($result);
if ($old != $obj->email) {
$target[$j] = array(
'email' => $obj->email,
'id' => $obj->id,
'firstname' => $obj->firstname,
'lastname' => $obj->lastname,
//'other' => $obj->label,
'email' => (string) $obj->email,
'id' => (int) $obj->id,
'firstname' => (string) $obj->firstname,
'lastname' => (string) $obj->lastname,
'other' => '', // (string) $obj->label,
'source_url' => $this->url($obj->id),
'source_id' => $obj->id,
'source_id' => (int) $obj->id,
'source_type' => 'myobject@mymodule'
);
$old = $obj->email;

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-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
@@ -57,22 +57,22 @@ function printingAdminPrepareHead($mode)
$h++;
}
/** TODO This feature seem to be not ready yet.
/* TODO This feature seem to be not ready yet.
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=userconf";
$head[$h][1] = $langs->trans("UserConf");
$head[$h][2] = 'userconf';
$h++;
*/
//$object=new stdClass();
// $object=new stdClass();
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
//complete_head_from_modules($conf,$langs,$object,$head,$h,'printingadmin');
// complete_head_from_modules($conf,$langs,$object,$head,$h,'printingadmin');
//complete_head_from_modules($conf,$langs,$object,$head,$h,'printing','remove');
// complete_head_from_modules($conf,$langs,$object,$head,$h,'printing','remove');
return $head;
}

View File

@@ -166,7 +166,7 @@ $form = new Form($db);
$formproduct = new FormProduct($db);
$product_fourn = new ProductFournisseur($db);
$productstatic = new Product($db);
$resql = false;
// action recherche des produits par mot-cle et/ou par categorie
if ($action == 'search') {
$current_lang = $langs->getDefaultLang();

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2014 Maxime Kohlhaas <support@atm-consulting.fr>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2014 Maxime Kohlhaas <support@atm-consulting.fr>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,6 +26,15 @@
* $cols
*/
/**
* @var CommonObject $object
* @var Conf $conf
* @var HookManager $hookmanager
* @var Translate $conf
*
* @var string $action
* @var array<string,mixed> $parameters
*/
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) {
print "Error, template page can't be called as URL";

View File

@@ -20,6 +20,16 @@
* $backtopage
*/
/**
* @var Conf $conf
* @var DoliDB $db
* @var Product|MouvementStock $object
* @var FormProduct $formproduct
* @var FormProjets $formproject
* @var Translate $langs
*
* @var string $backtopage
*/
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) {
print "Error, template page can't be called as URL";
@@ -37,12 +47,10 @@ if (empty($conf) || !is_object($conf)) {
<!-- BEGIN PHP TEMPLATE STOCKCORRECTION.TPL.PHP -->
<?php
/**
* @var Product $object
*/
$productref = '';
if ($object->element == 'product') {
/** @var Product $object */
$productref = $object->ref;
}
@@ -152,6 +160,7 @@ print '<table class="border centpercent">';
// Warehouse or product
print '<tr>';
if ($object->element == 'product') {
/** @var Product $object */
print '<td class="fieldrequired">'.$langs->trans("Warehouse").'</td>';
print '<td>';
$ident = (GETPOST("dwid") ? GETPOSTINT("dwid") : (GETPOST('id_entrepot') ? GETPOSTINT('id_entrepot') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone')));
@@ -162,6 +171,7 @@ if ($object->element == 'product') {
print '</td>';
}
if ($object->element == 'stockmouvement') {
/** @var MouvementStock $object */
print '<td class="fieldrequired">'.$langs->trans("Product").'</td>';
print '<td>';
print img_picto('', 'product');
@@ -171,6 +181,7 @@ if ($object->element == 'stockmouvement') {
print '<td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td>';
print '<td>';
if ($object->element == 'product' || $object->element == 'stockmouvement') {
/** @var Product|MouvementStock $object */
print '<select name="mouvement" id="mouvement" class="minwidth100 valignmiddle">';
print '<option value="0">'.$langs->trans("Add").'</option>';
print '<option value="1"'.(GETPOST('mouvement') ? ' selected="selected"' : '').'>'.$langs->trans("Delete").'</option>';
@@ -183,6 +194,7 @@ print '</tr>';
// If product is a Kit, we ask if we must disable stock change of subproducts
if (getDolGlobalString('PRODUIT_SOUSPRODUITS') && $object->element == 'product' && $object->hasFatherOrChild(1)) {
/** @var Product $object */
print '<tr>';
print '<td></td>';
print '<td colspan="3">';
@@ -197,6 +209,7 @@ if (isModEnabled('productbatch') &&
(($object->element == 'product' && $object->hasbatch())
|| ($object->element == 'stockmouvement'))
) {
/** @var Product|MouvementStock $object */
print '<tr>';
print '<td'.($object->element == 'stockmouvement' ? '' : ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">';
if ($pdluoid > 0) {

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2010-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-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
@@ -20,6 +20,16 @@
* $backtopage
*/
/**
* @var Conf $conf
* @var DoliDB $db
* @var Product|MouvementStock $object
* @var FormProduct $formproduct
* @var Translate $langs
*
* @var string $backtopage
*/
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) {
print "Error, template page can't be called as URL";
@@ -38,6 +48,7 @@ if (empty($conf) || !is_object($conf)) {
<?php
$productref = '';
if ($object->element == 'product') {
/** @var Product $object */
$productref = $object->ref;
}
@@ -77,6 +88,7 @@ print '<table class="border centpercent">';
// Source warehouse or product
print '<tr>';
if ($object->element == 'product') {
/** @var Product $object */
print '<td class="fieldrequired">'.$langs->trans("WarehouseSource").'</td>';
print '<td>';
print img_picto('', 'stock');
@@ -86,6 +98,7 @@ if ($object->element == 'product') {
print '</td>';
}
if ($object->element == 'stockmouvement') {
/** @var MouvementStock $object */
print '<td class="fieldrequired">'.$langs->trans("Product").'</td>';
print '<td>';
print img_picto('', 'product');
@@ -104,6 +117,7 @@ if (isModEnabled('productbatch') &&
(($object->element == 'product' && $object->hasbatch())
|| ($object->element == 'stockmouvement'))
) {
/** @var Product|MouvementStock $object */
print '<tr>';
print '<td'.($object->element == 'stockmouvement' ? '' : ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">';
if ($pdluoid > 0) {

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2010-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,7 +21,10 @@
* \ingroup projet
* \brief Gantt diagram of a project
*/
/**
* @var DoliDB $db
* @var Translate $langs
*/
?>
<div id="principal_content" style="margin-left: 0;">

View File

@@ -84,12 +84,12 @@ $contactstatic = new Contact($db);
$task = new Task($db);
$arrayofcss = array('/includes/jsgantt/jsgantt.css');
$arrayofjs = [];
if (!empty($conf->use_javascript_ajax)) {
$arrayofjs = array(
'/includes/jsgantt/jsgantt.js',
'/projet/jsgantt_language.js.php?lang='.$langs->defaultlang
);
$arrayofjs = [
'/includes/jsgantt/jsgantt.js',
'/projet/jsgantt_language.js.php?lang='.$langs->defaultlang
];
}
//$title=$langs->trans("Gantt").($object->ref?' - '.$object->ref.' '.$object->name:'');

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2013-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,6 +18,17 @@
*/
// variable $listofopplabel and $listofoppstatus should be defined
/**
* @var Conf $conf
* @var Form $form
* @var DoliDB $db
* @var Translate $langs
* @var User $user
*
* @var string $projectsListId
* @var int $socid
* @var string[] $listofoppstatus
*/
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
$sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount";

View File

@@ -370,9 +370,9 @@ class Website extends CommonObject
* @param string $sortfield Sort field
* @param int $limit limit
* @param int $offset offset limit
* @param string|array $filter filter array
* @param string|array<string,string> $filter filter array
* @param string $filtermode filter mode (AND or OR)
* @return array|int int <0 if KO, array of pages if OK
* @return Website[]|int<-1,-1> int <0 if KO, array of pages if OK
*/
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND')
{
@@ -1516,7 +1516,7 @@ class Website extends CommonObject
/**
* Component to select language inside a container (Full CSS Only)
*
* @param array|string $languagecodes 'auto' to show all languages available for page, or language codes array like array('en','fr','de','es')
* @param string[]|'auto' $languagecodes 'auto' to show all languages available for page, or language codes array like array('en','fr','de','es')
* @param Translate $weblangs Language Object
* @param string $morecss More CSS class on component
* @param string $htmlname Suffix for HTML name
@@ -1854,7 +1854,7 @@ class Website extends CommonObject
/**
* Save state for File
* @param mixed $etat state
* @param mixed $pathname path of file
* @param string $pathname path of file
* @return int|false
*/
public function saveState($etat, $pathname)
@@ -1866,8 +1866,8 @@ class Website extends CommonObject
* Compare two files has not same name but same content
* @param string $dossierSource filepath of folder source
* @param string $dossierDestination filepath of folder dest
* @param mixed $fichierModifie files modified
* @return array empty if KO, array if OK
* @param array{fullname:string} $fichierModifie files modified
* @return array<mixed,mixed|mixed> empty if KO, array if OK
*/
public function compareFichierModifie($dossierSource, $dossierDestination, $fichierModifie)
{
@@ -1966,8 +1966,8 @@ class Website extends CommonObject
* show difference between to string
* @param string $str1 first string
* @param string $str2 second string
* @param array $exceptNumPge num of page files we don't want to change
* @return array|int<-1,-1> -1 if KO, array if OK
* @param int[] $exceptNumPge num of page files we don't want to change
* @return array<mixed,mixed|mixed> Array
*/
protected function showDifferences($str1, $str2, $exceptNumPge = array())
{
@@ -1985,8 +1985,8 @@ class Website extends CommonObject
for ($i = 0;$i < $countNumPage; $i++) {
$linefound[$i] = array();
$linefound[$i]['meta'] = '/content="' . preg_quote($exceptNumPge[$i], '/') . '" \/>/';
$linefound[$i]['output'] = '/dolWebsiteOutput\(\$tmp, "html", ' . preg_quote($exceptNumPge[$i], '/') . '\);/';
$linefound[$i]['meta'] = '/content="' . preg_quote((string) $exceptNumPge[$i], '/') . '" \/>/';
$linefound[$i]['output'] = '/dolWebsiteOutput\(\$tmp, "html", ' . preg_quote((string) $exceptNumPge[$i], '/') . '\);/';
}
if (isset($linefound[1])) {
@@ -2059,8 +2059,8 @@ class Website extends CommonObject
* Replace line by line in file using numbers of the lines
*
* @param string $inplaceFile path of file to modify in place
* @param array $differences array of differences between files
* @return int Return 0 if we can replace, <0 if not (-2=not writable)
* @param array<int|string,string|array<string,string>> $differences array of differences between files
* @return int<-2,0> Return 0 if we can replace, <0 if not (-2=not writable)
*/
protected function replaceLineUsingNum($inplaceFile, $differences)
{