diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 0a77e11981b..3d70cc185af 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1595,8 +1595,9 @@ class ExtraFields $element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element if ($element == 'socpeople') { $element = 'contact'; + } else if ( $element == 'projet' ) { + $element = 'project'; } - //$out = $form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, '', 0, 0, ''); $out = $form->selectForForms($tmparray[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, '', 0, 0, '', $element.':options_'.$key); } elseif ($type == 'password') { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index f9543a35498..c4012a96276 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -4,7 +4,7 @@ * Copyright (C) 2012-2016 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Raphaël Doursenaud - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2023 Lenin Rivas * * This program is free software; you can redistribute it and/or modify @@ -2233,7 +2233,7 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz", &$errorstring // Create recursive directory iterator /** @var SplFileInfo[] $files */ $files = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($rootPath), + new RecursiveDirectoryIterator($rootPath, FilesystemIterator::UNIX_PATHS), RecursiveIteratorIterator::LEAVES_ONLY ); @@ -2496,7 +2496,7 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = // This does not return symbolic links /** @var SplFileInfo[] $files */ $files = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($inputdir), + new RecursiveDirectoryIterator($inputdir, FilesystemIterator::UNIX_PATHS), RecursiveIteratorIterator::LEAVES_ONLY ); diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 4d1bc1cd5e6..fcf4c865a2a 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2,7 +2,7 @@ /* Copyright (C) 2006-2015 Laurent Destailleur * Copyright (C) 2010 Regis Houssin * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Gauthier VERDOL * @@ -588,11 +588,11 @@ function project_admin_prepare_head() * @param string $var Color * @param int $showproject Show project columns * @param int $taskrole Array of roles of user for each tasks - * @param int $projectsListId List of id of project allowed to user (string separated with comma) + * @param string $projectsListId List of id of project allowed to user (string separated with comma) * @param int $addordertick Add a tick to move task * @param int $projectidfortotallink 0 or Id of project to use on total line (link to see all time consumed for project) * @param string $dummy Not used. - * @param string $showbilltime Add the column 'TimeToBill' and 'TimeBilled' + * @param int $showbilltime Add the column 'TimeToBill' and 'TimeBilled' * @param array $arrayfields Array with displayed coloumn information * @param array $arrayofselected Array with selected fields * @return int Nb of tasks shown diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index c19448cb689..fdc1f870c41 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -89,8 +89,10 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode /** * Constructor + * + * @param DoliDB $db Database object */ - public function __construct() + public function __construct($db) { $this->code_null = 0; $this->code_modifiable = 1; diff --git a/htdocs/core/modules/societe/mod_codeclient_leopard.php b/htdocs/core/modules/societe/mod_codeclient_leopard.php index f70642b9f71..18bb5dcf5fe 100644 --- a/htdocs/core/modules/societe/mod_codeclient_leopard.php +++ b/htdocs/core/modules/societe/mod_codeclient_leopard.php @@ -65,8 +65,10 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode /** * Constructor + * + * @param DoliDB $db Database object */ - public function __construct() + public function __construct($db) { $this->code_null = 1; $this->code_modifiable = 1; diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index 4ae2207fecf..5e788514204 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -65,8 +65,10 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode /** * Constructor + * + * @param DoliDB $db Database object */ - public function __construct() + public function __construct($db) { $this->code_null = 1; $this->code_modifiable = 1; diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index da73a332a8a..7ae10512f3a 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -59,6 +59,14 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator */ abstract class ModeleThirdPartyCode extends CommonNumRefGenerator { + + /** + * Constructor + * + * @param DoliDB $db Database object + */ + abstract public function __construct($db); + /** * @var int Automatic numbering */ diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index e999747f1e1..f4309ce0e31 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3362,7 +3362,7 @@ class Societe extends CommonObject break; } } - $mod = new $module(); + $mod = new $module($this->db); $this->code_client = $mod->getNextValue($objsoc, $type); $this->prefixCustomerIsRequired = $mod->prefixIsRequired; @@ -3394,7 +3394,7 @@ class Societe extends CommonObject break; } } - $mod = new $module(); + $mod = new $module($this->db); $this->code_fournisseur = $mod->getNextValue($objsoc, $type); @@ -3424,7 +3424,7 @@ class Societe extends CommonObject } } - $mod = new $module(); + $mod = new $module($this->db); dol_syslog(get_class($this)."::codeclient_modifiable code_client=".$this->code_client." module=".$module); if ($mod->code_modifiable_null && !$this->code_client) { @@ -3464,7 +3464,7 @@ class Societe extends CommonObject } } - $mod = new $module(); + $mod = new $module($this->db); dol_syslog(get_class($this)."::codefournisseur_modifiable code_founisseur=".$this->code_fournisseur." module=".$module); if ($mod->code_modifiable_null && !$this->code_fournisseur) { @@ -3510,7 +3510,7 @@ class Societe extends CommonObject } } - $mod = new $module(); + $mod = new $module($this->db); dol_syslog(get_class($this)."::check_codeclient code_client=".$this->code_client." module=".$module); $result = $mod->verif($this->db, $this->code_client, $this, 0); @@ -3551,7 +3551,7 @@ class Societe extends CommonObject } } - $mod = new $module(); + $mod = new $module($this->db); dol_syslog(get_class($this)."::check_codefournisseur code_fournisseur=".$this->code_fournisseur." module=".$module); $result = $mod->verif($this->db, $this->code_fournisseur, $this, 1);