Commit Graph

354 Commits

Author SHA1 Message Date
Laurent Destailleur
5a9e0f7493 Debug v20 2024-05-17 12:53:21 +02:00
Laurent Destailleur
b7317e3e7c Fix warning 2024-05-05 00:02:25 +02:00
Florian Mortgat
702709f890 New declare dictionaries more easily (#29600)
* NEW: method to help declare dictionaries more easily

* Example use of `declareNewDictionary()` method (redeclaring dictionaries of module Ticket with the new method)

* minor fixes: $this->db->prefix() in modTicket.class.php
2024-05-03 19:03:00 +02:00
Laurent Destailleur
5c018013ed Debug v20 2024-04-29 19:38:02 +02:00
Laurent Destailleur
ca57bac266 Removed a deprecated page 2024-04-26 23:45:39 +02:00
Laurent Destailleur
7f780fcb57 It seems constant are for storing data only and used for
DolibarrModules.class.php file only (main code shoud only use
->hasRight), so i try to move them.
2024-04-08 11:53:49 +02:00
Regis Houssin
68eb5e409a NEW module user rights enhancement (#29150)
* NEW module user rights enhancement

* FIX syntax error

* FIX fuck

* FIX syntax error

* FIX Add label with the current language (key or with PermissionXXX)

* FIX wrong test

* FIX optimize

* FIX doc

* FIX add class "Rights" for constant

* FIX replace with constants

* FIX missing constant

* FIX wrong check

* TODO sql error : data too long for column 'libelle'

* FIX syntax error

* FIX synax error "the return"... i'll be back

* FIX use operator with double question mark

* FIX add comment

* FIX just remplace integer with constant

* FIX remove unused code

* FIX add an example

* FIX remove the possibility to have entity = 0 (too complicated)

* FIX perms must not be empty

* FIX sql syntax error

* FIX phpstan undefined property DolibarrModules::$modules

* FIX same fix of frederic34

* Update llx_rights_def.sql

* Update DolibarrModules.class.php

* Update DolibarrModules.class.php

* Update DolibarrModules.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-04-08 11:40:02 +02:00
Laurent Destailleur
0e5440f256 Fix bad var 2024-04-06 13:33:42 +02:00
Laurent Destailleur
2ca5518625 Fix use of dynamic property conf->xxx->enabled must be abandonned. 2024-04-05 16:51:27 +02:00
Florian Mortgat
8b00b89f9d FIX: $conf must reflect enabled/disabled state of modules (#29126) 2024-04-05 16:36:02 +02:00
Laurent Destailleur
f03eb260de Nicer combo of companies for external modules 2024-04-03 13:20:26 +02:00
MDW
1ee639bb81 Adjust to real typings 2024-03-27 10:18:35 +01:00
Laurent Destailleur
686463a292 Fix phan warning 2024-03-24 06:37:09 +01:00
Laurent Destailleur
d1c9475089 Better management of MD file with style HTML tags 2024-03-24 03:23:07 +01:00
MDW
2496d20d4f Fix nullable return with if($ok == 1) in stead of if($ok)
# Fix nullable return with if($ok == 1) in stead of if($ok)

This seems to be a bug in Phan where if($ok) changes the type of $ok.
Testing with '$ok == 1' instead fixes the issue.

This has been reported to the phan team.
2024-03-21 00:28:14 +01:00
MDW
942239b5d6 Update PHPdoc to show nullable return 2024-03-20 23:54:32 +01:00
MDW
9ecb4bd639 Fix null return by returning empty string in else case 2024-03-20 21:58:47 +01:00
MDW
f91d32de86 Qual: Fix typing - module_parts['hooks'] may be empty
# Qual: Fix typing - moduleparts['hooks'] may be empty

PHPstan reported on initialisation mismatch when module_parts['hooks']
is initialised to empty array.  This change makes the fields optional.
2024-03-15 10:46:20 +01:00
Laurent Destailleur
c664cdae0f NEW Init of a module with a website template copy also the preview 2024-03-14 12:39:42 +01:00
MDW
8e1b6543b8 Qual: Typing : make all $module_parts fields optional and add missing
# Qual: Typing : make all $module_parts fields optional and add missing

According to the initialisations of the modules all fields for $module_parts are optional
and some keys were missing in the definition.
This is updated.
2024-03-11 18:13:04 +01:00
Laurent Destailleur
39ea68ace4 Try fix phan 2024-03-11 15:20:56 +01:00
MDW
aee0509473 Qual: Force typing on variable fixing several phan notices (#28740)
* Qual: Force typing on variable fixing several phan notices

# Qual: Force typing on variable fixing several phan notices

Forcing DolibarrModules on $objMod after assignment to fix typing checks

* Qual: Fix typing on import_label/export_label
2024-03-11 12:56:55 +01:00
MDW
37afba949e Fix most PhanTypeMismatchDimAssignment notices (#28739)
* Qual: Add typing to fix PhanTypeMismatchDimAssignment notice

* Fix: Initialise array for code in somme

* Qual: Update type hint for  argument in _Set_Format

* Qual: Update type hint for childtables

* Qual: Add typing to attributes

* Qual: Add typing for _msgContent

* Qual: Suppress PhanTypeMismatchDimAssignment

* Qual: Add typing for liste

* Qual: Add typing to fields

* Qual: Add typing hint for $objMod

* Qual: Modify assignment of array with bool keys for phan typing

Demonstration:
```
php -r '$a=[true=>"yes",false=>"no"];var_dump($a);'
# Result demonstrates bool keys are converted to int.
Command line code:1:
array(2) {
  [1] =>
  string(3) "yes"
  [0] =>
  string(2) "no"
}
```

* Qual: Add typing hint to indicate value is not null

* Force non-null type on $paramname

* Qual: Add typing hint to getCats()

* Update inc.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-03-10 01:53:04 +01:00
Frédéric FRANCE
a2c92f183c Phpstan fix (#28637)
* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan
2024-03-05 17:12:36 +01:00
Laurent Destailleur
ce010a54c7 Clean code and prepare a more powerfull phpunit check for sql forging. 2024-03-05 00:22:12 +01:00
Laurent Destailleur
838c748fae Reduce variable parts into website template so risk of git conflict is
lower
2024-02-22 17:30:54 +01:00
thibdrev
999af4951b qual: phpstan - various "$hidden (bool) does not accept string." (#28350)
* Update modWebsite.class.php

* Update DolibarrModules.class.php

* Update modCron.class.php

* Update modSocialNetworks.class.php

* qual: phpstan for htdocs/core/modules/modCollab.class.php

htdocs/core/modules/modCollab.class.php	68	Property DolibarrModules::$hidden (bool) does not accept string.
2024-02-22 13:27:04 +01:00
William Mead
a833d059d9 Fixed getModulePosition type return. Fixed missing langs. (#28131) 2024-02-13 09:14:28 +01:00
Laurent Destailleur
904bc424b4 Fix missing $langs 2024-02-12 16:43:46 +01:00
Laurent Destailleur
1caf853528 Work on website templates from modules 2024-02-12 02:52:35 +01:00
MDW
89004f7e03 Qual: Spelling htdocs/core (#27491)
Highlights:
- initialY in pdf_standard.modules.php was unused
  - remove (otherwise -> initially) (+same in other file)
2024-01-13 19:48:20 +01:00
MDW
39769482b1 Qual: Fix typing hints for DoliDB (#27484)
# Qual: Fix typing hints for DoliDB

This should help the static tools for type and method checking.
2024-01-13 15:50:02 +01:00
Laurent Destailleur
b28ae5d8d3 Clean code 2023-12-27 12:12:20 +01:00
Frédéric FRANCE
61b79fda17 avoid phpstan error with phpdoc 2023-12-06 15:46:39 +01:00
Laurent Destailleur
9e1b90e4a1 Fix with php-cs-fixer 2023-12-04 12:07:31 +01:00
Laurent Destailleur
7c756574b6 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2023-12-02 14:52:36 +01:00
Alexandre SPANGARO
ccfb5e2730 Debug v18 (#26877)
* Fix column name - Colspan problem

* Update DolibarrModules.class.php
2023-11-28 09:18:16 +01:00
Laurent Destailleur
53dab922fd Fix php8.2 warnings 2023-11-27 11:39:32 +01:00
Frédéric FRANCE
be9cbeb1b6 Update DolibarrModules.class.php (#26770) 2023-11-20 23:45:35 +01:00
Laurent Destailleur
62c1baaa61 Clean param 2023-10-20 21:01:59 +02:00
Laurent Destailleur
01a139158d Debug v19 2023-10-16 21:15:03 +02:00
Laurent Destailleur
cbb60d8b5e Debug v19 2023-10-14 16:23:28 +02:00
Laurent Destailleur
c507adeef7 NEW Top menu support picto of modules that are font awesome picto. 2023-10-13 15:00:51 +02:00
Laurent Destailleur
c0f27e5a57 Fix warning 2023-08-06 00:30:00 +02:00
Laurent Destailleur
b52c79dcfe Fix warnings 2023-08-04 04:37:10 +02:00
Florent Poinsaut
47ea0c274b Fix delete_module_parts with multicompagny (#25411) 2023-07-23 19:48:59 +02:00
Laurent Destailleur
b1e0b317c9 Debug v18 2023-06-29 13:16:44 +02:00
Laurent Destailleur
fb51c902a6 Debug v18 2023-06-28 12:05:51 +02:00
Laurent Destailleur
d5170e0f4b Debug v18 2023-06-26 23:10:44 +02:00
Laurent Destailleur
b6a061f795 Debug v18 - warnings and pgsql migration 2023-06-26 23:02:17 +02:00