From 701582714275987391430415e881b370a15e36b1 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Fri, 26 Jan 2024 09:01:32 +0100 Subject: [PATCH 01/24] qual: phpstan for htdocs/core/class/menubase.class.php htdocs/core/class/menubase.class.php 500 Property Menubase::$fk_menu (int) does not accept string. htdocs/core/class/menubase.class.php 501 Property Menubase::$position (int) does not accept string. htdocs/core/class/menubase.class.php 509 Property Menubase::$user (int) does not accept string. htdocs/core/class/menubase.class.php 510 Property Menubase::$tms (int) does not accept string. --- htdocs/core/class/menubase.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index b0a7768d91995..96cf95ceb6ab2 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -497,8 +497,8 @@ public function initAsSpecimen() $this->module = 'specimen'; $this->type = 'top'; $this->mainmenu = ''; - $this->fk_menu = '0'; - $this->position = ''; + $this->fk_menu = 0; + $this->position = 0; $this->url = 'http://dummy'; $this->target = ''; $this->title = 'Specimen menu'; @@ -506,8 +506,8 @@ public function initAsSpecimen() $this->leftmenu = ''; $this->perms = ''; $this->enabled = ''; - $this->user = ''; - $this->tms = ''; + $this->user = 0; + $this->tms = dol_now(); } From 1c04c210c85604d1f74fe9cd8739c32654ec1d01 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Fri, 26 Jan 2024 09:05:31 +0100 Subject: [PATCH 02/24] qual: phpdoc - add "@since Dolibarr V20" to GETPOSTFLOAT() documentation --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 482a757cc38e9..d2832da108c5b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -966,6 +966,7 @@ function GETPOSTINT($paramname, $method = 0) * @param string $paramname Name of the $_GET or $_POST parameter * @param string|int $rounding Type of rounding ('', 'MU', 'MT, 'MS', 'CU', 'CT', integer) {@see price2num()} * @return float Value converted into float + * @since Dolibarr V20 */ function GETPOSTFLOAT($paramname, $rounding = '') { From 6459ef53f0d9d5dc2fa45c5733df5baf89ef2e2e Mon Sep 17 00:00:00 2001 From: thibdrev Date: Fri, 26 Jan 2024 09:07:04 +0100 Subject: [PATCH 03/24] qual: phpstan for htdocs/datapolicy/class/actions_datapolicy.class.php htdocs/datapolicy/class/actions_datapolicy.class.php 118 Property CommonObject::$state_id (int) does not accept string. htdocs/datapolicy/class/actions_datapolicy.class.php 120 Property CommonObject::$country_id (int) does not accept string. --- htdocs/datapolicy/class/actions_datapolicy.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php index 805cc537f3868..b36608a32c619 100644 --- a/htdocs/datapolicy/class/actions_datapolicy.class.php +++ b/htdocs/datapolicy/class/actions_datapolicy.class.php @@ -115,9 +115,9 @@ public function doActions($parameters, &$object, &$action, $hookmanager) $object->fax = ''; $object->state = ''; $object->country = ''; - $object->state_id = ''; + $object->state_id = 0; $object->socialnetworks = ''; - $object->country_id = ''; + $object->country_id = 0; $object->note_private = dol_concatdesc($object->note_private, $langs->trans('ANONYMISER_AT', dol_print_date(dol_now()))); if ($object->update($object->id, $user, 0)) { From 51de68d87b17ddc53431f1d7c0c608cd5364cb4d Mon Sep 17 00:00:00 2001 From: thibdrev Date: Fri, 26 Jan 2024 09:09:16 +0100 Subject: [PATCH 04/24] qual: phpstan for htdocs/delivery/card.php htdocs/delivery/card.php 105 Property Delivery::$fk_incoterms (int) does not accept array|string. --- htdocs/delivery/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 54e1cb1e07f5c..f87ac1bada3a3 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -102,7 +102,7 @@ $object->note = GETPOST("note", 'restricthtml'); $object->note_private = GETPOST("note", 'restricthtml'); $object->commande_id = GETPOST("commande_id", 'int'); - $object->fk_incoterms = GETPOST('incoterm_id', 'int'); + $object->fk_incoterms = GETPOSTINT('incoterm_id'); /* ->entrepot_id seems to not exists if (!getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && isModEnabled('stock')) { From 2032e5c5b3427f88b981e7ac3def7643bec379a2 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Fri, 26 Jan 2024 09:12:37 +0100 Subject: [PATCH 05/24] qual: phpstan for htdocs/don/card.php htdocs/don/card.php 192 Property Don::$amount (float) does not accept string. --- htdocs/don/card.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 44e5b207156fd..3b39c59d52c78 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -185,19 +185,19 @@ if (!$error) { $object->fetch($id); - $object->firstname = (string) GETPOST("firstname", 'alpha'); - $object->lastname = (string) GETPOST("lastname", 'alpha'); - $object->societe = (string) GETPOST("societe", 'alpha'); - $object->address = (string) GETPOST("address", 'alpha'); - $object->amount = price2num(GETPOST("amount", 'alpha'), '', 2); - $object->town = (string) GETPOST("town", 'alpha'); - $object->zip = (string) GETPOST("zipcode", 'alpha'); - $object->country_id = (int) GETPOST('country_id', 'int'); - $object->email = (string) GETPOST("email", 'alpha'); + $object->firstname = GETPOST("firstname", 'alpha'); + $object->lastname = GETPOST("lastname", 'alpha'); + $object->societe = GETPOST("societe", 'alpha'); + $object->address = GETPOST("address", 'alpha'); + $object->amount = GETPOSTFLOAT("amount"); + $object->town = GETPOST("town", 'alpha'); + $object->zip = GETPOST("zipcode", 'alpha'); + $object->country_id = GETPOSTINT('country_id'); + $object->email = GETPOST("email", 'alpha'); $object->date = $donation_date; $object->public = $public_donation; - $object->fk_project = (int) GETPOST("fk_project", 'int'); - $object->modepaymentid = (int) GETPOST('modepayment', 'int'); + $object->fk_project = GETPOSTINT("fk_project"); + $object->modepaymentid = GETPOSTINT('modepayment'); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); From ea176d3d25bb2d51acb2874fd00ed8e50a3c98d0 Mon Sep 17 00:00:00 2001 From: Christophe TREMBLAY-GUILLOUX Date: Fri, 26 Jan 2024 10:33:01 +0100 Subject: [PATCH 06/24] MINOR : replacing translation --- htdocs/cron/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 3a1298f271f1e..2e6e53aab5f1b 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -482,7 +482,7 @@ function initfields() } else { $input .= ' />'; } - $input .= ""; + $input .= ""; print $input; print ""; From ab7896a21746c2a0738e1fade00a7982d315927d Mon Sep 17 00:00:00 2001 From: Christophe TREMBLAY-GUILLOUX Date: Fri, 26 Jan 2024 10:34:53 +0100 Subject: [PATCH 07/24] MINOR: declaring missing attribut, asked by Code Editors to detect variable --- htdocs/cron/class/cronjob.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index ff917cc263405..3d7e31b3f26d8 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -184,6 +184,11 @@ class Cronjob extends CommonObject */ public $autodelete; + /** + * @var array Cronjob + */ + public $lines; + const STATUS_DISABLED = 0; const STATUS_ENABLED = 1; @@ -512,7 +517,6 @@ public function fetch($id, $objectname = '', $methodname = '') /** * Load list of cron jobs in a memory array from the database - * @TODO Use object CronJob and not CronJobLine. * * @param string $sortorder sort order * @param string $sortfield sort field From 3ae575348bf13ccab2fe81d7e8d0d434fc994139 Mon Sep 17 00:00:00 2001 From: Christophe TREMBLAY-GUILLOUX Date: Fri, 26 Jan 2024 10:35:25 +0100 Subject: [PATCH 08/24] MINOR: bad description --- htdocs/core/lib/date.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index aa99d09dfe64e..43aed0f605597 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -647,7 +647,7 @@ function dol_get_last_hour($date, $gm = 'tzserver') * @param int $date Date GMT * @param mixed $gm False or 0 or 'tzserver' = Return date to compare with server TZ, * 'gmt' to compare with GMT date. - * @return int Date for last hour of a given date + * @return int Date for first hour of a given date */ function dol_get_first_hour($date, $gm = 'tzserver') { From 906472988499eac1dd92923779c01a77810b0291 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Fri, 26 Jan 2024 13:19:40 +0100 Subject: [PATCH 09/24] =?UTF-8?q?qual:=20profid.lib.php=20-=20Belgium=20Nu?= =?UTF-8?q?m=C3=A9ro=20d'Entreprise=20shall=20start=20with=200=20or=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to: https://economie.fgov.be/fr/themes/entreprises/banque-carrefour-des/actualites/structure-du-numero > se présente sous la forme Zxxx.xxx.xxx, le premier chiffre étant 0 ou 1. --- htdocs/core/lib/profid.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/profid.lib.php b/htdocs/core/lib/profid.lib.php index de4f5c70403b6..b3d705a1860aa 100644 --- a/htdocs/core/lib/profid.lib.php +++ b/htdocs/core/lib/profid.lib.php @@ -155,7 +155,7 @@ function isValidTinForBE($str) $str = trim($str); $str = preg_replace('/(\s)/', '', $str); - if (preg_match('/(^[0-9]{4}\.[0-9]{3}\.[0-9]{3}$)/', $str)) { + if (preg_match('/(^[0-1]{1}[0-9]{3}\.[0-9]{3}\.[0-9]{3}$)/', $str)) { return true; } else { return false; From 441b499a823394c7dce588a3c177676c3d343abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 26 Jan 2024 13:23:41 +0100 Subject: [PATCH 10/24] fix tests --- htdocs/core/class/html.formmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 285e37edbf498..9592ed0a2914b 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -889,7 +889,7 @@ public function get_form($addfileaction = 'addfile', $removefileaction = 'remove //input prompt AI require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; - if (isModEnabled('ai') && getDolGlobalConst('AI_CHATGPT_API_KEY')) { + if (isModEnabled('ai') && getDolGlobalString('AI_CHATGPT_API_KEY')) { $out .= $this->getHtmlForInstruction(); } // Message From 7a1e42a6278136afbd605be7ef9d02711ca577b9 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Fri, 26 Jan 2024 13:38:30 +0100 Subject: [PATCH 11/24] NEW rename const on third-party card --- htdocs/install/mysql/migration/19.0.0-20.0.0.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql index 6a3f61a22d2e2..d1f6998aa2e46 100644 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql @@ -208,3 +208,6 @@ ALTER TABLE llx_categorie ADD COLUMN position integer DEFAULT 0 AFTER color; ALTER TABLE llx_product DROP COLUMN onportal; ALTER TABLE llx_knowledgemanagement_knowledgerecord MODIFY COLUMN answer longtext; + +-- Rename const to add customer categories on not customer/prospect third-party if enabled +UPDATE llx_const SET name = 'THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT' WHERE name = 'THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER'; From 2775c78ae0a6d35229a225d4a4575d09d044c94a Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 26 Jan 2024 20:36:35 +0100 Subject: [PATCH 12/24] Qual: Run php-cs on changed files only with pre-commit Use a github action to detect changed PHP files and run php-cs on those files. (The method suggested by the pre-commit documentation did not work). --- .github/workflows/pre-commit.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 5e5c4fc0cb5d6..e96c5ef4ba049 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -14,6 +14,17 @@ jobs: - name: Install required tools run: sudo apt-get update && sudo apt-get install cppcheck if: false + + # The next uses the git API because there is no clone yet. + # This is faster for a big repo. + - name: Get all changed php files (if PR) + id: changed-php + uses: tj-actions/changed-files@v42 + if: github.event_name == 'pull_request' + with: + files: | + **.php + # Checkout git sources to analyze - uses: actions/checkout@v4 # Action setup-python needs a requirements.txt or pyproject.toml @@ -42,6 +53,24 @@ jobs: set -o pipefail pre-commit gc pre-commit run --show-diff-on-failure --color=always --all-files | tee ${RAW_LOG} + + # The next uses git, which is slow for a bit repo. + # - name: Get all changed php files (if PR) + # id: changed-php + # uses: tj-actions/changed-files@v42 + # if: github.event_name == 'pull_request' + # with: + # files: | + # **.php + + - name: Run some pre-commit hooks on selected changed files only + if: steps.changed-php.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-php.outputs.all_changed_files }} + run: | + set -o pipefail + pre-commit run php-cs ${ALL_CHANGED_FILES} | tee -a ${RAW_LOG} + # If error, we convert log in the checkstyle format - name: Convert Raw Log to CheckStyle format if: ${{ failure() }} From 340eaf1242c070baa0ab0e8c4225f7827d55088a Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 26 Jan 2024 21:43:27 +0100 Subject: [PATCH 13/24] Update some pre-commit hooks --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 49d115a235552..81159f37bed94 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ exclude: (?x)^( htdocs/includes/ckeditor/.* ) repos: # Several miscellaneous checks and fix (on yaml files, end of files fix) - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: no-commit-to-branch args: [--branch, develop, --pattern, \d+.0] @@ -87,7 +87,7 @@ repos: # Check format of yaml files - repo: https://github.com/adrienverge/yamllint.git - rev: v1.32.0 + rev: v1.33.0 hooks: - id: yamllint args: @@ -97,7 +97,7 @@ repos: # Execute codespell to fix typo errors (setup of codespell into dev/tools/codespell/) - repo: https://github.com/codespell-project/codespell - rev: v2.2.5 + rev: v2.2.6 hooks: - id: codespell # Due to a current limitation of configuration files, @@ -142,7 +142,7 @@ repos: # Check some shell scripts - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.9.0.5 + rev: v0.9.0.6 hooks: - id: shellcheck args: [-W, '100'] From bf80809a96b2b82cb5f235ef70483f3296b6fd9a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Jan 2024 01:34:53 +0100 Subject: [PATCH 14/24] Debug v19 --- .../modulebuilder/template/core/modules/modMyModule.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 7ff829ad41183..6954d50d110b1 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -169,7 +169,7 @@ public function __construct($db) 'fr_FR:ParentCompany'=>'Maison mère ou revendeur' )*/ - if (!isset($conf->mymodule) || !isset($conf->mymodule->enabled)) { + if (!isModEnabled("mymodule")) { $conf->mymodule = new stdClass(); $conf->mymodule->enabled = 0; } From 25a91c63cf03f5eb7f2da4fb558e73688c585f3c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Jan 2024 17:23:03 +0100 Subject: [PATCH 15/24] Debug webportal module --- htdocs/core/class/commonobject.class.php | 21 ++-- htdocs/core/modules/modOpenSurvey.class.php | 4 - htdocs/core/modules/modTakePos.class.php | 8 +- .../core/modules/modWebPortal.class.php | 29 ++--- htdocs/core/modules/modWebsite.class.php | 2 - htdocs/langs/en_US/website.lang | 75 +++++++++++- htdocs/modulebuilder/README.md | 2 +- .../public/webportal/webportal.main.inc.php | 4 +- htdocs/societe/class/societeaccount.class.php | 2 +- htdocs/webportal/README.md | 46 +++++++- htdocs/webportal/admin/setup.php | 33 +++++- htdocs/webportal/admin/setup_theme.php | 2 +- .../class/html.formcardwebportal.class.php | 2 +- htdocs/webportal/langs/en_US/webportal.lang | 110 ------------------ htdocs/webportal/lib/webportal.lib.php | 6 +- 15 files changed, 186 insertions(+), 160 deletions(-) rename htdocs/{webportal => }/core/modules/modWebPortal.class.php (94%) delete mode 100644 htdocs/webportal/langs/en_US/webportal.lang diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f204c5350899c..a854c706c4ce7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7314,10 +7314,8 @@ public function showInputField($val, $key, $value, $moreparam = '', $keysuffix = $out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0); } - $out .= ''; + if ((!isset($this->fields[$key]['default'])) || ($this->fields[$key]['notnull'] != 1) || $nbchoice >= 2) { + $out .= ''; } + $out .= $tmpselect; $out .= ''; } elseif ($type == 'sellist') { $out = ''; diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index 6030f23cbd40b..237e5086a30f0 100644 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -38,8 +38,6 @@ class modOpenSurvey extends DolibarrModules */ public function __construct($db) { - global $langs, $conf; - $this->db = $db; // Id for module (must be unique). @@ -181,8 +179,6 @@ public function __construct($db) */ public function init($options = '') { - global $conf, $langs; - $result = $this->_load_tables('/install/mysql/', 'opensurvey'); if ($result < 0) { return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default') diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index 383996d434589..ed237feadf6cd 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -40,7 +40,7 @@ class modTakePos extends DolibarrModules */ public function __construct($db) { - global $langs, $conf; + global $conf; $this->db = $db; @@ -54,7 +54,7 @@ public function __construct($db) // It is used to group modules by family in module setup page $this->family = "portal"; // Module position in the family on 2 digits ('01', '10', '20', ...) - $this->module_position = '60'; + $this->module_position = '45'; // Gives the possibility to the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this) //$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily"))); @@ -120,8 +120,8 @@ public function __construct($db) //1=>array('TAKEPOS_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1) ); - - if (!isset($conf->takepos) || !isset($conf->takepos->enabled)) { + // To avoid warning + if (!isModEnabled('takepos')) { $conf->takepos = new stdClass(); $conf->takepos->enabled = 0; } diff --git a/htdocs/webportal/core/modules/modWebPortal.class.php b/htdocs/core/modules/modWebPortal.class.php similarity index 94% rename from htdocs/webportal/core/modules/modWebPortal.class.php rename to htdocs/core/modules/modWebPortal.class.php index dd088dcd2e8a0..6bd2885f31a45 100644 --- a/htdocs/webportal/core/modules/modWebPortal.class.php +++ b/htdocs/core/modules/modWebPortal.class.php @@ -53,7 +53,7 @@ public function __construct($db) $this->family = "portal"; // Module position in the family on 2 digits ('01', '10', '20', ...) - $this->module_position = '80'; + $this->module_position = '47'; // Gives the possibility for the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this) //$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily"))); @@ -139,7 +139,7 @@ public function __construct($db) $this->conflictwith = array(); // The language file dedicated to your module - $this->langfiles = array("webportal@webportal"); + $this->langfiles = array("website"); // Prerequisites $this->phpmin = array(7, 0); // Minimum version of PHP required by module @@ -165,7 +165,8 @@ public function __construct($db) 'fr_FR:ParentCompany'=>'Maison mère ou revendeur' )*/ - if (!isset($conf->webportal) || !isset($conf->webportal->enabled)) { + // To avoid warnings + if (isModEnabled('webportal')) { $conf->webportal = new stdClass(); $conf->webportal->enabled = 0; } @@ -202,7 +203,7 @@ public function __construct($db) $this->dictionaries = array(); /* Example: $this->dictionaries=array( - 'langs'=>'webportal@webportal', + 'langs'=>'website', // List of tables we want to see into dictonnary editor 'tabname'=>array("table1", "table2", "table3"), // Label of tables @@ -287,7 +288,7 @@ public function __construct($db) 'mainmenu' => 'webportal', 'leftmenu' => '', 'url' => getDolGlobalString('WEBPORTAL_ROOT_URL', '/public/webportal/index.php'), - 'langs' => 'webportal@webportal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'langs' => 'website', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position' => 1000 + $r, 'enabled' => 'isModEnabled("webportal")', // Define condition to show or hide menu entry. Use 'isModEnabled("webportal")' if entry must be visible if module is enabled. 'perms' => '1', // Use 'perms'=>'$user->hasRight("webportal", "webportalpropal", "read")' if you want your menu with a permission rules @@ -302,7 +303,7 @@ public function __construct($db) 'mainmenu'=>'webportal', 'leftmenu'=>'webportalpropal', 'url'=>'/webportal/webportalindex.php', - 'langs'=>'webportal@webportal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'langs'=>'website', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>1000+$r, 'enabled'=>'isModEnabled("webportal")', // Define condition to show or hide menu entry. Use 'isModEnabled("webportal")' if entry must be visible if module is enabled. 'perms'=>'$user->hasRight("webportal", "webportalpropal", "read")', @@ -316,7 +317,7 @@ public function __construct($db) 'mainmenu'=>'webportal', 'leftmenu'=>'webportal_webportalpropal_list', 'url'=>'/webportal/webportalpropal_list.php', - 'langs'=>'webportal@webportal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'langs'=>'website', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>1000+$r, 'enabled'=>'isModEnabled("webportal")', // Define condition to show or hide menu entry. Use 'isModEnabled("webportal")' if entry must be visible if module is enabled. 'perms'=>'$user->hasRight("webportal", "webportalpropal", "read")' @@ -330,7 +331,7 @@ public function __construct($db) 'mainmenu'=>'webportal', 'leftmenu'=>'webportal_webportalpropal_new', 'url'=>'/webportal/webportalpropal_card.php?action=create', - 'langs'=>'webportal@webportal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'langs'=>'website', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>1000+$r, 'enabled'=>'isModEnabled("webportal")', // Define condition to show or hide menu entry. Use 'isModEnabled("webportal")' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. 'perms'=>'$user->hasRight("webportal", "webportalpropal", "write")' @@ -349,7 +350,7 @@ public function __construct($db) */ public function init($options = '') { - global $conf, $langs; + //global $conf, $langs; //$result = $this->_load_tables('/install/mysql/', 'webportal'); $result = $this->_load_tables('/webportal/sql/'); @@ -360,11 +361,11 @@ public function init($options = '') // Create extrafields during init //include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; //$extrafields = new ExtraFields($this->db); - //$result1=$extrafields->addExtraField('webportal_myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'webportal@webportal', 'isModEnabled("webportal")'); - //$result2=$extrafields->addExtraField('webportal_myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'webportal@webportal', 'isModEnabled("webportal")'); - //$result3=$extrafields->addExtraField('webportal_myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'webportal@webportal', 'isModEnabled("webportal")'); - //$result4=$extrafields->addExtraField('webportal_myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'webportal@webportal', 'isModEnabled("webportal")'); - //$result5=$extrafields->addExtraField('webportal_myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'webportal@webportal', 'isModEnabled("webportal")'); + //$result1=$extrafields->addExtraField('webportal_myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'website', 'isModEnabled("webportal")'); + //$result2=$extrafields->addExtraField('webportal_myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'website', 'isModEnabled("webportal")'); + //$result3=$extrafields->addExtraField('webportal_myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'website', 'isModEnabled("webportal")'); + //$result4=$extrafields->addExtraField('webportal_myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'website', 'isModEnabled("webportal")'); + //$result5=$extrafields->addExtraField('webportal_myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'website', 'isModEnabled("webportal")'); // Permissions $this->remove($options); diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php index 6a21435b48951..a1a573553b301 100644 --- a/htdocs/core/modules/modWebsite.class.php +++ b/htdocs/core/modules/modWebsite.class.php @@ -37,8 +37,6 @@ class modWebsite extends DolibarrModules */ public function __construct($db) { - global $langs, $conf; - $this->db = $db; $this->numero = 10000; diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 58d285b577d67..b64930a885548 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -161,5 +161,76 @@ Visibility=Visibility Everyone=Everyone AssignedContacts=Assigned contacts WebsiteTypeLabel=Type of Web site -WebsiteTypeDolibarrWebsite=Web site (CMS Dolibarr) -WebsiteTypeDolibarrPortal=Native Dolibarr portal +WebsiteTypeDolibarrWebsite=Web site (Module WebSite) +WebsiteTypeDolibarrPortal=Native and ready to use web portal (Module WebPortal) +WebPortalURL=Web portal URL +NewWebsiteAccount=New accounts for websites + + +ModuleWebPortalName = Web portal +ModuleWebPortalDesc = A ready to use native web portal for customers, suppliers, partners or members +WebPortalDescription = Public web portal module for membership and partnership +WebPortalSetup = WebPortal setup +WebPortalCSS=Web portal CSS +Settings = Settings +WebPortalSetupPage = WebPortal setup page +WEBPORTAL_ROOT_URL = Alternative virtual host URL +WebPortalRootUrlHelp = Public access url (http or https) if you have a virtual host or keep empty +WEBPORTAL_TITLE = Brand name on header of public page +UserAccountForWebPortalAreInThirdPartyTabHelp = Users accounts for WebPortal can be set on each third party card in Website accounts tab +WebPortalAccessHidden = Hidden +WebPortalAccessVisible = Visible +WebPortalAccessEdit = Editable +WEBPORTAL_MEMBER_CARD_ACCESS = Enable access to the membership record +WebPortalMemberCardAccessHelp = Enable access to the membership record (Hidden / Visible or Editable) +WEBPORTAL_PARTNERSHIP_CARD_ACCESS = Enable access to the partnership record +WebPortalPartnerShipCardAccessHelp = Enable access to the partnership record (Hidden / Visible or Editable) +WEBPORTAL_PROPAL_LIST_ACCESS = Enable access to the proposals +WEBPORTAL_ORDER_LIST_ACCESS = Enable access to the orders +WEBPORTAL_INVOICE_LIST_ACCESS = Enable access to the invoices +WEBPORTAL_USER_LOGGED = Select a user +WebPortalUserLoggedHelp = This user is used to update cards +WebPortalHomeTitle = Welcome +WebPortalHomeDesc = Welcome to the public interface +WebPortalPropalListMenu = Proposals +WebPortalPropalListTitle = List of proposals +WebPortalPropalListDesc = List of proposals +WebPortalPropalListNothing = Proposals not found +WebPortalOrderListMenu = Orders +WebPortalOrderListTitle = List of orders +WebPortalOrderListDesc = List of orders +WebPortalOrderListNothing = Orders not found +WebPortalInvoiceListMenu = Invoices +WebPortalInvoiceListTitle = List of invoices +WebPortalInvoiceListDesc = List of invoices +WebPortalInvoiceListNothing = Invoices not found +WebPortalMemberCardMenu = Member +WebPortalMemberCardTitle = Member card +WebPortalMemberCardDesc = Member card +WebPortalPartnershipCardMenu = Partnership +WebPortalPartnershipCardTitle = Partnership card +WebPortalPartnershipCardDesc = Partnership card +loginWebportalUserName = User name / email +loginWebportalPassword = Password +LoginNow = Login now +RemoveSearchFilters = Remove search filters +WEBPORTAL_PRIMARY_COLOR = Primary color +WEBPORTAL_SECONDARY_COLOR = Secondary color +WEBPORTAL_LOGIN_LOGO_URL = Login logo image URL +WEBPORTAL_MENU_LOGO_URL = Menu logo image URL +WEBPORTAL_MENU_LOGO_URLTooltip = Leave empty to use login logo +WEBPORTAL_LOGIN_BACKGROUND = Background login image URL +WEBPORTAL_BANNER_BACKGROUND = Background for banner +WEBPORTAL_BANNER_BACKGROUND_IS_DARK = Use dark theme for banner +AriaPrevPage = Previous page +AriaNextPage = Next page +AriaPageX = Page %s +WebPortalError404 = Page not found +WebPortalErrorPageNotExist = Page not exist +WebPortalErrorFetchThirdPartyAccountFromLogin = Error when loading third-party account (login : %s) +WebPortalErrorAuthentication = Authentication error +WebPortalErrorFetchLoggedThirdPartyAccount = Error when loading third-party account (login : %s) +WebPortalErrorFetchLoggedUser = Error when loading user (Id : %s) +WebPortalErrorFetchLoggedThirdParty = Error when loading third-party (Id : %s) +WebPortalErrorFetchLoggedMember = Error when loading member (Id : %s) +WebPortalErrorFetchLoggedPartnership = Error when loading partnership (Third-party Id : %s, Member Id : %s) diff --git a/htdocs/modulebuilder/README.md b/htdocs/modulebuilder/README.md index 26b0ecf717bfa..fa3752f7ceb4b 100644 --- a/htdocs/modulebuilder/README.md +++ b/htdocs/modulebuilder/README.md @@ -2,7 +2,7 @@ Module Builder ============== This is a module to provide embedded tools to develop your own application/features inside Dolibarr ERP CRM software. -It provide tools for module developers to kickstart their project and give an hands-on sample of which features Dolibarr +It provides tools for module developers to kickstart their project and give an hands-on sample of which features Dolibarr has to offer for module development. If you don't need to develop your own module/application, you just don't need this. diff --git a/htdocs/public/webportal/webportal.main.inc.php b/htdocs/public/webportal/webportal.main.inc.php index 5068317b45505..667c8f340eb51 100644 --- a/htdocs/public/webportal/webportal.main.inc.php +++ b/htdocs/public/webportal/webportal.main.inc.php @@ -85,7 +85,7 @@ function dol_getprefix($mode = '') } $langs->setDefaultLang($langcode); } - $langs->loadLangs(array('webportal@webportal', 'main')); + $langs->loadLangs(array('website', 'main')); } /* @@ -227,7 +227,7 @@ function dol_getprefix($mode = '') $langs = new Translate("", $conf); $langs->setDefaultLang($logged_thirdparty->default_lang); } - $langs->loadLangs(array('webportal@webportal', 'main')); + $langs->loadLangs(array('website', 'main')); } $context->logged_user = $logged_user; diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 04ca7bad2c8ee..2547a9c00c4e1 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -172,7 +172,7 @@ class SocieteAccount extends CommonObject */ public function __construct(DoliDB $db) { - global $conf, $langs; + global $langs; $this->db = $db; diff --git a/htdocs/webportal/README.md b/htdocs/webportal/README.md index e1e4064009e40..0dddedea0eb89 100644 --- a/htdocs/webportal/README.md +++ b/htdocs/webportal/README.md @@ -1 +1,45 @@ -Public web portal module for membership and partnership \ No newline at end of file +Module Web Portal +================ + +This is a module to provide a ready to use Web Portal for your customers, suppliers, partners or members of the mebership module. + +Accounts (login and pass) to acces this portal can be created for any thirdparty (from the tab "Web site accounts"). + +It is better to have a standalone web server with its own virtual host and domain name to use this module, so using the web portal does not +reaveal the domain and url of your backoffice installation. + + +It provides an interface to read or modify its data. This is for example, the list of the data than can be read (or modified): + +If the Thirdparty module is enabled: +* Read/modify Name, phone, email, addresses of thirdparty + +If the Patnership module is enabled: +* Read properties (status, stard date, end date) of its partnership. + +If the Proposal module is enabled: +* Read its orders + +If the Sale Order module is enabled: +* Read its orders + +If the Invoice module is enabled: +* Read its invoices + +If the Supplier module is enabled: +* Read its price requests +* Read its orders +* Read its invoices + +If module Membership is enabled: +* Read/modify Name, phone, email, addresses of thirdparty +* Read its membership status (start and end date, amount paid) + + + +Documentation +------------- + +[Module Web Portal](https://wiki.dolibarr.org/index.php/Module_Web_Portal) + + \ No newline at end of file diff --git a/htdocs/webportal/admin/setup.php b/htdocs/webportal/admin/setup.php index d0870bb54def6..334a97336cd4e 100644 --- a/htdocs/webportal/admin/setup.php +++ b/htdocs/webportal/admin/setup.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT . "/webportal/lib/webportal.lib.php"; // Translations -$langs->loadLangs(array("admin", "webportal")); +$langs->loadLangs(array("admin", "webportal", "website")); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('webportalsetup', 'globalsetup')); @@ -38,10 +38,6 @@ $backtopage = GETPOST('backtopage', 'alpha'); $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php -if (empty($action)) { - $action = 'edit'; -} - $value = GETPOST('value', 'alpha'); $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); @@ -70,7 +66,7 @@ $item->helpText = $langs->transnoentities('WebPortalRootUrlHelp'); require_once __DIR__ . '/../class/context.class.php'; $context = Context::getInstance(); -$item->fieldOutputOverride = ''.img_picto('', 'globe', 'class="pictofixedwidth"').Context::getRootConfigUrl().''; +//$item->fieldOutputOverride = ''.img_picto('', 'globe', 'class="pictofixedwidth"').Context::getRootConfigUrl().''; $formSetup->newItem('WEBPORTAL_TITLE')->defaultFieldValue = getDolGlobalString('MAIN_INFO_SOCIETE_NOM'); @@ -228,6 +224,7 @@ $action = 'edit'; } + /* * View */ @@ -248,9 +245,33 @@ $head = webportalAdminPrepareHead(); print dol_get_fiche_head($head, 'settings', $langs->trans($title), -1, "webportal"); +print '
'; + +// URL For webportal +print img_picto('', 'globe').' '.$langs->trans('WebPortalURL').'
'; +if (isModEnabled('multicompany')) { + $entity_qr = '?entity='.((int) $conf->entity); +} else { + $entity_qr = ''; +} + +// Define $urlwithroot +$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); +$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file +//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + +print ''; +print ajax_autoselect('publicurlmember'); +//print ''.img_picto('', 'globe', 'class="pictofixedwidth"').Context::getRootConfigUrl().''; + // Setup page goes here print info_admin($langs->trans("UserAccountForWebPortalAreInThirdPartyTabHelp")); +print '
'; + if ($action == 'edit') { print $formSetup->generateOutput(true); print '
'; diff --git a/htdocs/webportal/admin/setup_theme.php b/htdocs/webportal/admin/setup_theme.php index df6a3467a7d21..1e751389feade 100644 --- a/htdocs/webportal/admin/setup_theme.php +++ b/htdocs/webportal/admin/setup_theme.php @@ -124,7 +124,7 @@ print dol_get_fiche_head($head, 'themesettings', $langs->trans($title), -1, "webportal"); // Setup page goes here -print info_admin($langs->trans("UserAccountForWebPortalAreInThirdPartyTabHelp")); +//print info_admin($langs->trans("UserAccountForWebPortalAreInThirdPartyTabHelp")); if ($action == 'edit') { print $formSetup->generateOutput(true); diff --git a/htdocs/webportal/class/html.formcardwebportal.class.php b/htdocs/webportal/class/html.formcardwebportal.class.php index 1ac702e871ed1..a416cd700032c 100644 --- a/htdocs/webportal/class/html.formcardwebportal.class.php +++ b/htdocs/webportal/class/html.formcardwebportal.class.php @@ -161,7 +161,7 @@ public function init($elementEn, $id = 0, $permissiontoread = 0, $permissiontoad dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php'); // Load translation files required by the page - $langs->loadLangs(array('webportal@webportal', 'other')); + $langs->loadLangs(array('website', 'other')); // Get parameters //$id = $id > 0 ? $id : GETPOST('id', 'int'); diff --git a/htdocs/webportal/langs/en_US/webportal.lang b/htdocs/webportal/langs/en_US/webportal.lang deleted file mode 100644 index 13a19ba473198..0000000000000 --- a/htdocs/webportal/langs/en_US/webportal.lang +++ /dev/null @@ -1,110 +0,0 @@ -# Copyright (C) 2023-2024 Lionel Vessiller -# -# 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 . - -# -# Generic -# - -# Module label 'ModuleWebPortalName' -ModuleWebPortalName = Web portal -# Module description 'ModuleWebPortalDesc' -ModuleWebPortalDesc = Public web portal -WebPortalDescription = Public web portal module for membership and partnership - -# -# Admin page -# -WebPortalSetup = WebPortal setup -WebPortalCSS=Web portal CSS -Settings = Settings -WebPortalSetupPage = WebPortal setup page -WEBPORTAL_ROOT_URL = Public access url -WebPortalRootUrlHelp = Public access url (http or https) if you have a virtual host or keep empty -WEBPORTAL_TITLE = Brand name on header of public page -UserAccountForWebPortalAreInThirdPartyTabHelp = Users accounts for WebPortal can be set on each third party card in Website accounts tab -WebPortalAccessHidden = Hidden -WebPortalAccessVisible = Visible -WebPortalAccessEdit = Editable -WEBPORTAL_MEMBER_CARD_ACCESS = Enable access to the membership record -WebPortalMemberCardAccessHelp = Enable access to the membership record (Hidden / Visible or Editable) -WEBPORTAL_PARTNERSHIP_CARD_ACCESS = Enable access to the partnership record -WebPortalPartnerShipCardAccessHelp = Enable access to the partnership record (Hidden / Visible or Editable) -WEBPORTAL_PROPAL_LIST_ACCESS = Enable access to the proposals -WEBPORTAL_ORDER_LIST_ACCESS = Enable access to the orders -WEBPORTAL_INVOICE_LIST_ACCESS = Enable access to the invoices -WEBPORTAL_USER_LOGGED = Select a user -WebPortalUserLoggedHelp = This user is used to update cards - -# -# Public pages -# -WebPortalHomeTitle = Welcome -WebPortalHomeDesc = Welcome to the public interface -WebPortalPropalListMenu = Proposals -WebPortalPropalListTitle = List of proposals -WebPortalPropalListDesc = List of proposals -WebPortalPropalListNothing = Proposals not found -WebPortalOrderListMenu = Orders -WebPortalOrderListTitle = List of orders -WebPortalOrderListDesc = List of orders -WebPortalOrderListNothing = Orders not found -WebPortalInvoiceListMenu = Invoices -WebPortalInvoiceListTitle = List of invoices -WebPortalInvoiceListDesc = List of invoices -WebPortalInvoiceListNothing = Invoices not found -WebPortalMemberCardMenu = Member -WebPortalMemberCardTitle = Member card -WebPortalMemberCardDesc = Member card -WebPortalPartnershipCardMenu = Partnership -WebPortalPartnershipCardTitle = Partnership card -WebPortalPartnershipCardDesc = Partnership card -loginWebportalUserName = User name / email -loginWebportalPassword = Password -LoginNow = Login now -RemoveSearchFilters = Remove search filters - - -# -# Aria accessibility -# -AriaPrevPage = Previous page -AriaNextPage = Next page -AriaPageX = Page %s - -# -# Errors -# -WebPortalError404 = Page not found -WebPortalErrorPageNotExist = Page not exist -WebPortalErrorFetchThirdPartyAccountFromLogin = Error when loading third-party account (login : %s) -WebPortalErrorAuthentication = Authentication error -WebPortalErrorFetchLoggedThirdPartyAccount = Error when loading third-party account (login : %s) -WebPortalErrorFetchLoggedUser = Error when loading user (Id : %s) -WebPortalErrorFetchLoggedThirdParty = Error when loading third-party (Id : %s) -WebPortalErrorFetchLoggedMember = Error when loading member (Id : %s) -WebPortalErrorFetchLoggedPartnership = Error when loading partnership (Third-party Id : %s, Member Id : %s) - -# -# Color theme settings -# - -WEBPORTAL_PRIMARY_COLOR = Primary color -WEBPORTAL_SECONDARY_COLOR = Secondary color -WEBPORTAL_LOGIN_LOGO_URL = Login logo image URL -WEBPORTAL_MENU_LOGO_URL = Menu logo image URL -WEBPORTAL_MENU_LOGO_URLTooltip = Leave empty to use login logo -WEBPORTAL_LOGIN_BACKGROUND = Background login image URL -WEBPORTAL_BANNER_BACKGROUND = Background for banner -WEBPORTAL_BANNER_BACKGROUND_IS_DARK = Use dark theme for banner diff --git a/htdocs/webportal/lib/webportal.lib.php b/htdocs/webportal/lib/webportal.lib.php index 3e4f3f1012ce3..16d3ecc98766b 100644 --- a/htdocs/webportal/lib/webportal.lib.php +++ b/htdocs/webportal/lib/webportal.lib.php @@ -35,7 +35,7 @@ function webportalAdminPrepareHead() // $extrafields = new ExtraFields($db); // $extrafields->fetch_name_optionals_label('myobject'); - $langs->load("webportal@webportal"); + $langs->load("website"); $h = 0; $head = array(); @@ -74,9 +74,9 @@ function webportalAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@webportal:/webportal/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, null, $head, $h, 'webportal@webportal'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'website'); - complete_head_from_modules($conf, $langs, null, $head, $h, 'webportal@webportal', 'remove'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'website', 'remove'); return $head; } From 079b2aa3a0bac574e185770600fe5987f2be5815 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Jan 2024 17:58:19 +0100 Subject: [PATCH 16/24] Debug webportal --- htdocs/core/class/commonobject.class.php | 5 +++-- htdocs/langs/en_US/admin.lang | 2 +- htdocs/langs/en_US/main.lang | 2 +- htdocs/langs/en_US/website.lang | 4 ++-- htdocs/societe/class/societeaccount.class.php | 2 +- htdocs/webportal/admin/configcss.php | 2 +- htdocs/website/websiteaccount_card.php | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a854c706c4ce7..2261e8ee70d06 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7819,7 +7819,7 @@ public function showOutputField($val, $key, $value, $moreparam = '', $keysuffix $form = new Form($this->db); } - $label = empty($val['label']) ? '' : $val['label']; + //$label = empty($val['label']) ? '' : $val['label']; $type = empty($val['type']) ? '' : $val['type']; $size = empty($val['css']) ? '' : $val['css']; $reg = array(); @@ -8222,7 +8222,8 @@ public function showOutputField($val, $key, $value, $moreparam = '', $keysuffix $value = ''; } } elseif ($type == 'password') { - $value = preg_replace('/./i', '*', $value); + $value = ''.$langs->trans("Encrypted").''; + //$value = preg_replace('/./i', '*', $value); } elseif ($type == 'array') { $value = implode('
', $value); } else { // text|html|varchar diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 79272f0b6f51c..fac5f950a3096 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -685,7 +685,7 @@ Module5000Desc=Allows you to manage multiple companies Module6000Name=Inter-modules Workflow Module6000Desc=Workflow management between different modules (automatic creation of object and/or automatic status change) Module10000Name=Websites -Module10000Desc=Create websites (public) with a WYSIWYG editor. This is a webmaster or developer oriented CMS (it is better to know HTML and CSS language). Just setup your web server (Apache, Nginx, ...) to point to the dedicated Dolibarr directory to have it online on the internet with your own domain name. +Module10000Desc=CMS to create websites with a WYSIWYG editor. This is a webmaster or developer oriented Content Management System (it is better to know HTML and CSS language). Just setup your web server (Apache, Nginx, ...) to point to the dedicated Dolibarr directory to have it online on the internet with your own domain name. Module20000Name=Leave Request Management Module20000Desc=Define and track employee leave requests Module39000Name=Product Lots diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index cb2f8bedde50b..8c144fbae3ed9 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1260,4 +1260,4 @@ AmountSalary=Salary amount InvoiceSubtype=Invoice subtype ConfirmMassReverse=Bulk Reverse confirmation ConfirmMassReverseQuestion=Are you sure you want to reverse the %s selected record(s)? - +Encrypted=Encrypted diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index b64930a885548..7a808ed6c38cd 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -161,8 +161,8 @@ Visibility=Visibility Everyone=Everyone AssignedContacts=Assigned contacts WebsiteTypeLabel=Type of Web site -WebsiteTypeDolibarrWebsite=Web site (Module WebSite) -WebsiteTypeDolibarrPortal=Native and ready to use web portal (Module WebPortal) +WebsiteTypeDolibarrWebsite=Web site (Module WebSites CMS) +WebsiteTypeDolibarrPortal=Native and ready to use web portal (Module Web Portal) WebPortalURL=Web portal URL NewWebsiteAccount=New accounts for websites diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 2547a9c00c4e1..311135feb07ab 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -81,7 +81,7 @@ class SocieteAccount extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'default'=>1), 'login' => array('type'=>'varchar(64)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'notnull'=>1, 'position'=>10, 'showoncombobox'=>1), 'pass_encoding' => array('type'=>'varchar(24)', 'label'=>'PassEncoding', 'visible'=>0, 'enabled'=>1, 'position'=>30), - 'pass_crypted' => array('type'=>'password', 'label'=>'Password', 'visible'=>1, 'enabled'=>1, 'position'=>31, 'notnull'=>1), + 'pass_crypted' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>1, 'position'=>31, 'notnull'=>1), 'pass_temp' => array('type'=>'varchar(128)', 'label'=>'Temp', 'visible'=>0, 'enabled'=>0, 'position'=>32, 'notnull'=>-1,), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'index'=>1, 'picto'=>'company', 'css'=>'maxwidth300 widthcentpercentminusxx'), 'site' => array('type'=>'varchar(128)', 'label'=>'WebsiteTypeLabel', 'visible'=>0, 'enabled'=>0, 'position'=>41, 'notnull'=>1, 'default' => '', 'help'=>'Name of the website or service if this is account on an external website or service'), diff --git a/htdocs/webportal/admin/configcss.php b/htdocs/webportal/admin/configcss.php index 4ea291a5c7226..56842f4cf7436 100644 --- a/htdocs/webportal/admin/configcss.php +++ b/htdocs/webportal/admin/configcss.php @@ -137,7 +137,7 @@ print '
'; print ''; -print ''; +//print ''; print '
'; print ''; diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 36778b4545fa4..b80d6a6fdb73e 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -281,7 +281,7 @@ $head = websiteaccountPrepareHead($object); - print dol_get_fiche_head($head, 'card', $langs->trans("WebsiteAccount"), -1, 'websiteaccount@website'); + print dol_get_fiche_head($head, 'card', $langs->trans("WebsiteAccount"), -1, $object->picto); $formconfirm = ''; From 96b5008a2456ab9026dad46696f65f07d2bde8dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Jan 2024 18:04:12 +0100 Subject: [PATCH 17/24] Trans --- htdocs/langs/en_US/website.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 7a808ed6c38cd..1b076f689b474 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -188,7 +188,7 @@ WebPortalPartnerShipCardAccessHelp = Enable access to the partnership record (Hi WEBPORTAL_PROPAL_LIST_ACCESS = Enable access to the proposals WEBPORTAL_ORDER_LIST_ACCESS = Enable access to the orders WEBPORTAL_INVOICE_LIST_ACCESS = Enable access to the invoices -WEBPORTAL_USER_LOGGED = Select a user +WEBPORTAL_USER_LOGGED = Select an anonymous user WebPortalUserLoggedHelp = This user is used to update cards WebPortalHomeTitle = Welcome WebPortalHomeDesc = Welcome to the public interface From c084c76405caa5e5049d409b5bf6b6c072555f0d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Jan 2024 23:17:16 +0100 Subject: [PATCH 18/24] Enhance email selector --- .../mailing_mymodule_selector1.modules.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailing_mymodule_selector1.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailing_mymodule_selector1.modules.php index 8f242f3fd2e3c..c96228a00b425 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailing_mymodule_selector1.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailing_mymodule_selector1.modules.php @@ -61,8 +61,6 @@ public function formFilter() global $langs; $langs->load("members"); - $form = new Form($this->db); - $arraystatus = array(1=>'Option 1', 2=>'Option 2'); $s = ''; @@ -104,9 +102,9 @@ public function add_to_target($mailing_id) $target = array(); $j = 0; - $sql = " select rowid as id, label, firstname, lastname"; - $sql .= " from ".MAIN_DB_PREFIX."myobject"; - $sql .= " where email IS NOT NULL AND email <> ''"; + $sql = "SELECT rowid as id, firstname, lastname, email"; + $sql .= " FROM ".MAIN_DB_PREFIX."myobject"; + $sql .= " WHERE email IS NOT NULL AND email <> ''"; if (GETPOSTISSET('filter') && GETPOST('filter', 'alphanohtml') != 'none') { $sql .= " AND status = '".$this->db->escape(GETPOST('filter', 'alphanohtml'))."'"; } @@ -118,7 +116,7 @@ public function add_to_target($mailing_id) $num = $this->db->num_rows($result); $i = 0; - dol_syslog("mailinglist_mymodule_myobject.modules.php: mailing ".$num." targets found"); + dol_syslog(__METHOD__.":add_to_target ".$num." targets found"); $old = ''; while ($i < $num) { @@ -126,10 +124,10 @@ public function add_to_target($mailing_id) if ($old != $obj->email) { $target[$j] = array( 'email' => $obj->email, - 'name' => $obj->lastname, 'id' => $obj->id, 'firstname' => $obj->firstname, - 'other' => $obj->label, + 'lastname' => $obj->lastname, + //'other' => $obj->label, 'source_url' => $this->url($obj->id), 'source_id' => $obj->id, 'source_type' => 'myobject@mymodule' @@ -188,7 +186,9 @@ public function getSqlArrayForStats() */ public function getNbOfRecipients($sql = '') { - $sql = "select count(distinct(email)) as nb from ".MAIN_DB_PREFIX."myobject as p where email IS NOT NULL AND email != ''"; + $sql = "SELECT COUNT(DISTINCT(email)) as nb"; + $sql .= " FROM ".MAIN_DB_PREFIX."myobject as p"; + $sql .= " WHERE email IS NOT NULL AND email <> ''"; $a = parent::getNbOfRecipients($sql); From 6f19f3c1fb04b51d065020c8ea62491e1d2c9e8c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Jan 2024 23:38:18 +0100 Subject: [PATCH 19/24] Clean css --- htdocs/public/test/test_forms.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index d24171680b0cc..235c687472a42 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -23,14 +23,12 @@ ?> -

This page is a sample of page using Dolibarr HTML widget methods. It is designed to make test with
- css (add parameter &theme=newtheme to test another theme or edit css of current theme)
- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 and switch to small screen < 570 to enable with emulated jmobile)
- no javascript / usage for bind people (add parameter ">nojs=1 to force disable javascript)
- use with a text browser (add parameter ">textbrowser=1 to force detection of a text browser)
-

-
+


'."\n"; // Test2: form->selectDate using tzuser date -print "Test 2: We must have here 1970-01-01 00:00:00 selected (fields can be empty)
\n"; +print "Test 2: We must have here 1970-01-01 selected (fields can be empty)
\n"; print $form->selectDate(dol_get_first_day(1970, 1, false), 'test2', 1, 1, 1); print '

'."\n"; @@ -120,7 +118,7 @@ print ' '; + } return $html; } -/** - * Generate list of quickadd items - * - * @return string HTML output - */ + /** + * Generate list of quickadd items + * + * @return string HTML output + */ function printDropdownQuickadd() { global $conf, $user, $langs, $hookmanager; @@ -2849,11 +2851,11 @@ function printDropdownQuickadd() return $dropDownQuickAddHtml; } -/** - * Build the tooltip on top menu bookmark - * - * @return string HTML content - */ + /** + * Build the tooltip on top menu bookmark + * + * @return string HTML content + */ function top_menu_bookmark() { global $langs, $conf, $db, $user; @@ -2932,11 +2934,11 @@ function top_menu_bookmark() return $html; } -/** - * Build the tooltip on top menu tsearch - * - * @return string HTML content - */ + /** + * Build the tooltip on top menu tsearch + * + * @return string HTML content + */ function top_menu_search() { global $langs, $conf, $db, $user, $hookmanager; @@ -3099,20 +3101,20 @@ function top_menu_search() return $html; } -/** - * Show left menu bar - * - * @param array $menu_array_before Table of menu entries to show before entries of menu handler. This param is deprectaed and must be provided to ''. - * @param string $helppagename Name of wiki page for help ('' by default). - * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage - * For other external page: http://server/url - * @param string $notused Deprecated. Used in past to add content into left menu. Hooks can be used now. - * @param array $menu_array_after Table of menu entries to show after entries of menu handler - * @param int $leftmenuwithoutmainarea Must be set to 1. 0 by default for backward compatibility with old modules. - * @param string $title Title of web page - * @param int $acceptdelayedhtml 1 if caller request to have html delayed content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect) - * @return void - */ + /** + * Show left menu bar + * + * @param array $menu_array_before Table of menu entries to show before entries of menu handler. This param is deprectaed and must be provided to ''. + * @param string $helppagename Name of wiki page for help ('' by default). + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage + * For other external page: http://server/url + * @param string $notused Deprecated. Used in past to add content into left menu. Hooks can be used now. + * @param array $menu_array_after Table of menu entries to show after entries of menu handler + * @param int $leftmenuwithoutmainarea Must be set to 1. 0 by default for backward compatibility with old modules. + * @param string $title Title of web page + * @param int $acceptdelayedhtml 1 if caller request to have html delayed content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect) + * @return void + */ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_array_after = array(), $leftmenuwithoutmainarea = 0, $title = '', $acceptdelayedhtml = 0) { global $user, $conf, $langs, $db, $form; @@ -3357,12 +3359,12 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ } -/** - * Begin main area - * - * @param string $title Title - * @return void - */ + /** + * Begin main area + * + * @param string $title Title + * @return void + */ function main_area($title = '') { global $conf, $langs, $hookmanager; @@ -3418,13 +3420,13 @@ function main_area($title = '') } -/** - * Return helpbaseurl, helppage and mode - * - * @param string $helppagename Page name ('EN:xxx,ES:eee,FR:fff,DE:ddd...' or 'http://localpage') - * @param Translate $langs Language - * @return array Array of help urls - */ + /** + * Return helpbaseurl, helppage and mode + * + * @param string $helppagename Page name ('EN:xxx,ES:eee,FR:fff,DE:ddd...' or 'http://localpage') + * @param Translate $langs Language + * @return array Array of help urls + */ function getHelpParamFor($helppagename, $langs) { $helpbaseurl = ''; @@ -3469,22 +3471,22 @@ function getHelpParamFor($helppagename, $langs) } -/** - * Show a search area. - * Used when the javascript quick search is not used. - * - * @param string $urlaction Url post - * @param string $urlobject Url of the link under the search box - * @param string $title Title search area - * @param string $htmlmorecss Add more css - * @param string $htmlinputname Field Name input form - * @param string $accesskey Accesskey - * @param string $prefhtmlinputname Complement for id to avoid multiple same id in the page - * @param string $img Image to use - * @param int $showtitlebefore Show title before input text instead of into placeholder. This can be set when output is dedicated for text browsers. - * @param int $autofocus Set autofocus on field - * @return string - */ + /** + * Show a search area. + * Used when the javascript quick search is not used. + * + * @param string $urlaction Url post + * @param string $urlobject Url of the link under the search box + * @param string $title Title search area + * @param string $htmlmorecss Add more css + * @param string $htmlinputname Field Name input form + * @param string $accesskey Accesskey + * @param string $prefhtmlinputname Complement for id to avoid multiple same id in the page + * @param string $img Image to use + * @param int $showtitlebefore Show title before input text instead of into placeholder. This can be set when output is dedicated for text browsers. + * @param int $autofocus Set autofocus on field + * @return string + */ function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinputname, $accesskey = '', $prefhtmlinputname = '', $img = '', $showtitlebefore = 0, $autofocus = 0) { global $langs, $user; From 2a7a47d3ad6bc34bb1802a09515bad5dcc9f54a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Jan 2024 00:14:19 +0100 Subject: [PATCH 21/24] Debug v19 - missing migration line --- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index 3b287fbcf3e9e..6a136fdfc4b4d 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -147,6 +147,7 @@ UPDATE llx_product set stockable_product = 0 WHERE type = 1; ALTER TABLE llx_prelevement_lignes ADD COLUMN fk_user integer NULL; +ALTER TABLE llx_hrm_evaluation ADD COLUMN last_main_doc varchar(255); ALTER TABLE llx_hrm_evaluationdet ADD COLUMN comment TEXT; ALTER TABLE llx_resource ADD COLUMN address varchar(255) DEFAULT NULL AFTER fk_code_type_resource; From f3ce7a2a93e9818dbea5aa1066c3c32ff3429ea8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Jan 2024 00:37:48 +0100 Subject: [PATCH 22/24] Debug v19 Fix label of option --- htdocs/compta/facture/card-rec.php | 8 ++++---- htdocs/fourn/facture/card-rec.php | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index bb3c693839661..f396b437f11d6 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1595,17 +1595,17 @@ print ''; print ''; - // Status of generated invoices + // Status of auto generated invoices print ''; if ($action == 'auto_validate' || $object->frequency > 0) { - print $form->editfieldkey($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->hasRight('facture', 'creer')); + print $form->editfieldkey($langs->trans("StatusOfAutoGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->hasRight('facture', 'creer')); } else { - print $langs->trans("StatusOfGeneratedInvoices"); + print $langs->trans("StatusOfAutoGeneratedInvoices"); } print ''; $select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated'); if ($action == 'auto_validate' || $object->frequency > 0) { - print $form->editfieldval($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->hasRight('facture', 'creer'), $select); + print $form->editfieldval($langs->trans("StatusOfAutoGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->hasRight('facture', 'creer'), $select); } print ''; // Auto generate documents diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index d508a32abc5a4..332185c17ee56 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -1053,14 +1053,14 @@ print ""; // Auto validate the invoice - print "" . $langs->trans("StatusOfGeneratedInvoices") . ""; + print "" . $langs->trans("StatusOfAutoGeneratedInvoices") . ""; $select = array('0' => $langs->trans('BillStatusDraft'), '1' => $langs->trans('BillStatusValidated')); print $form->selectarray('auto_validate', $select, GETPOST('auto_validate')); print ""; // Auto generate document if (getDolGlobalString('INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION')) { - print "" . $langs->trans("StatusOfAutoGeneratedDocuments") . ""; + print "" . $langs->trans("StatusOfGeneratedDocuments") . ""; $select = array('0' => $langs->trans('DoNotGenerateDoc'), '1' => $langs->trans('AutoGenerateDoc')); print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf')); print ""; @@ -1484,14 +1484,14 @@ // Status of generated invoices print ''; if ($action == 'auto_validate' || $object->frequency > 0) { - print $form->editfieldkey($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate); + print $form->editfieldkey($langs->trans("StatusOfAutoGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate); } else { - print $langs->trans("StatusOfGeneratedInvoices"); + print $langs->trans("StatusOfAutoGeneratedInvoices"); } print ''; $select = 'select;0:' . $langs->trans('BillStatusDraft') . ',1:' . $langs->trans('BillStatusValidated'); if ($action == 'auto_validate' || $object->frequency > 0) { - print $form->editfieldval($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate, $select); + print $form->editfieldval($langs->trans("StatusOfAutoGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate, $select); } print ''; // Auto generate documents From 54db2001222d622a1e59240ba3641dbd1be65960 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Jan 2024 00:45:43 +0100 Subject: [PATCH 23/24] Update doc --- ChangeLog | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1e66b4ee536d0..18e094d66f21a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -169,8 +169,8 @@ NEW: updating for display Help title when try to delete Don (issue #25314) NEW: Upgrade in module builder in menu section NEW: use account address in sepa mandate (#23642) NEW: VAT rate - Add entity -NEW: webportal site account NEW: When an user unset the batch management of products, transformation of each batch stock mouvement in global stock mouvement +NEW: PDF Generation for each Human Resource Evaluations. SEC: #25512 applicative anti bruteforce - security on too many login attempts (#25520) SEC: Add action confirm_... as sensitive to need a CSRF token @@ -234,6 +234,8 @@ WARNING: -------- The following changes may create regressions for some external modules, but were necessary to make Dolibarr better: +* Recheck the setup of your module Workflow to see if you need to enable the new setting to have shipment set to billed automatically when + an invoice from a shipment is validated (and if your process is to make invoice on shipment and not on order), because this setup has changed. * The hook changeHelpURL is replaced by llxHeader * The property ->brouillon has been removed from all classes. It was not reliable and was a duplicate of ->status == self::STATUS_DRAFT. * The duplicated and deprecated property ->date_livraison that was renamed into ->delivery_date has been completely removed. @@ -242,19 +244,18 @@ The following changes may create regressions for some external modules, but were * The property ->user_creation to store ID of user of creation has been renamed into ->user_creation_id. * The property ->user_modification to store ID of user of modification has been renamed into ->user_modification_id. * The private array ->status_short, ->statuts and ->status_long are now array ->labelStatusShort and ->labelStatus everywhere. -* The duplicate property ->user_creat, ->date_creat, ->date_valid has been removed (use instead user_creation, date_creation, date_validation). +* The duplicate property ->user_creat, ->date_creat, ->date_valid have been removed (use instead user_creation, date_creation, date_validation). * The method get_substitutionarray_shipment_lines() has been removed. Use the generic get_substitutionarray_lines() instead. * The method ProductcustomerPrice->fetch_all_log() has been renamed into camel case ->fetchAllLog() -* Recheck the setup of your module Workflow to see if you need to enable the new setting to have shipment set to billed automatically when - an invoice from a shipment is validated (and if your process is to make invoice on shipment and not on order), because this setup has changed. * It was possible to use a variable $soc or $right inside a PHP code condition of some extrafields properties, this is no more true (this 2 variables are no more global variables). * New hook files of modules actions_mymodule.class.php should now "extends CommonHookActions" * Endpoint for API /partnershipapi and /recruitment has been renamed into /partnerships and /recruitments to follow name conventions. -* Hidden option ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USEr_ON_SALARY_BANK_PAYMENT has been renamed into ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USER_ON_SALARY_BANK_PAYMENT +* Hidden option ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USER_ON_SALARY_BANK_PAYMENT has been renamed into ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USER_ON_SALARY_BANK_PAYMENT * The delete() method of AdherentType, Contact, Delivery, MultiCurrency, CurrencyRate now need $user as first parameter. * A very high number of class properties (with old name in french) are now deprecated in favor of the property name in english. * The load of hook context productdao has been removed before calling loadvirtualstock. Modules must use the context of main parent page or 'all' for all cases. + ***** ChangeLog for 18.0.4 compared to 18.0.3 ***** FIX: $this->newref already exists and could have been modified by trigger but we still use a local variable for the filesystem-based renaming FIX: 16.0 only, backport fix for SQL error on global search product From b784cfe5aad5554b937aeddc020e02045cc2e46f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Jan 2024 00:48:41 +0100 Subject: [PATCH 24/24] Update doc --- ChangeLog | 1 - 1 file changed, 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 18e094d66f21a..54a1226cf7398 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,7 +8,6 @@ English Dolibarr ChangeLog For users: ---------- NEW: Compatibility with PHP 8.2 -NEW: Module for Advanced stock transfert is now stable (#26594) NEW: Module Workstation (used to enhance the module BOM and Manufacturing Order) is now stable NEW: Add a confirmation popup when deleting extrafields NEW: Add type 'icon' type for extrafields