Commit Graph

1329 Commits

Author SHA1 Message Date
Frédéric FRANCE
93e111a615 fix phpstan is falsy (#30016) 2024-06-15 16:03:53 +02:00
Mathieu Moulin
abcb1dad4b Define CommonObject relation in CommonObjectLine classes (#29956) 2024-06-10 16:08:39 +02:00
Frédéric FRANCE
741e75ee47 add phpdoc (#29832)
* add phpdoc

* fix phan

* fix phan

* fix phan

* fix phan

* fix phan

* fix phan

* fix phan

* fix phan

* fix phan

* add phpdoc

* fix phan

* fix phan
2024-06-04 14:46:54 +02:00
Yannis Hoareau
26e09f85d2 FIX: Unsigned propal having signing date (#29825)
* FIX propal dates: setting sign date only if signed

* FIX propal dates: clearing sign date when reopenning a propal

* FIX propal dates: reworked + not clearing sign date

Not clearing the sign date anymore because of 17.0 configuration that allow the user to choose if he wants to keep the previous sign date or the current date.

* FIX propal dates: move comma to fix sql syntax error

* FIX propal dates: add SQL request to update database

This SQL request is meant to set the sign date and the signing user to null to match the fix

* Update 15.0.0-16.0.0.sql

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-06-04 10:52:29 +02:00
Frédéric FRANCE
652c8526fa fix cti (#29813)
* fix cti

* fix cti

* no photo in asset lines

* no photo in asset lines

* no photo in asset lines

* no photo in asset lines

* no photo in recruitment lines

* no photo in recruitment lines

* fix

* fix dead catch
2024-06-03 13:44:14 +02:00
Laurent Destailleur
832aca30dc Debug v20 2024-05-29 22:19:52 +02:00
Frédéric FRANCE
d0830b3159 fix phpstan (#29602)
* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix travis

* fix phpstan

* fix phpstan

* fix phan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

fix phpstan

fix phpstan

fix phpstan

fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix travis

* fix phpstan

* fix phpstan

* fix phpstan

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-05-05 00:34:19 +02:00
Laurent Destailleur
b5de782c6b Fix use the good HTTP code 2024-04-07 14:59:25 +02:00
Laurent Destailleur
fd9475be03 Use same doc comment eveywhere. 2024-04-07 12:26:27 +02:00
Laurent Destailleur
38fb00489d PHPDoc 2024-04-05 13:44:59 +02:00
Laurent Destailleur
0fe0cd7c01 Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-04-04 11:39:02 +02:00
Laurent Destailleur
404ba88107 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2024-04-04 11:19:45 +02:00
Laurent Destailleur
7715513ac9 Some API HTTP return code were moved from 401 to 403 to better follow
REST specification.
2024-04-02 14:47:49 +02:00
Laurent Destailleur
51f862ad28 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2024-04-02 13:21:00 +02:00
Laurent Destailleur
990216b13f NEW Api parameters are sanitized by the WAF, same code than GET/POST 2024-04-02 13:07:13 +02:00
Jon Bendtsen
4cdc8f643a will allow updating a single Complementary Attribute without specifying all of them that we don't want to change. Similar to # 29115 but just for proposals 2024-04-01 09:54:18 +02:00
Regis Houssin
85a08a9288 FIX sometimes a string type instead integer is return, why ? 2024-03-31 19:17:58 +02:00
MDW
04c3e80fc5 Fix typing 2024-03-29 18:26:48 +01:00
Laurent Destailleur
233629ed3a Merge branch 'develop' into phpstan_user 2024-03-29 12:20:23 +01:00
Laurent Destailleur
5a6791aa5a Clean code 2024-03-29 11:43:26 +01:00
Laurent Destailleur
0fbaf8b118 Fix example 2024-03-29 11:25:33 +01:00
Frédéric France
5b1af95864 fix phpstan 2024-03-28 20:16:32 +01:00
MDW
5c5ad3260c Fix PhanNonClassMethodCall with extra test 2024-03-24 15:40:21 +01:00
MDW
c4fe7773cb Fix PhanTypeInvalid{Left,Right}OperandOfNumericOp mostly by typing, casting, idate 2024-03-23 02:06:21 +01:00
MDW
e44e29c446 Fix $mybool |=... which is binary op, not boolean op
# Fix $mybool |=... which is binary op, not boolean op

This fixes PhanTypeInvalidLeftOperandOfBitwiseOp.
Replace $var |= ... with $var = ... || $var .
Add cast before ... when needed (@include does not always return bool).
|= always evaluates expression, there for || $var, not $var ||
2024-03-21 13:45:03 +01:00
MDW
0a1a663e34 Fix PhanTypeMismatchReturnNullable with initialisation 2024-03-20 21:58:35 +01:00
Laurent Destailleur
43d1d33e0d Update propal.class.php 2024-03-20 04:08:43 +01:00
MDW
1303b0fe76 Fix arg to preg_replace() with cast, fix PHPdoc, Add FIXME
The handling of special_code seems suspicious -> FIXME
2024-03-20 04:08:28 +01:00
MDW
c5479f4520 Fix: Update typing for qty as float 2024-03-19 20:37:38 +01:00
MDW
fd9d48faac Fix phpstan CommonObject->fields - notnull is optional field 2024-03-19 00:32:00 +01:00
Laurent Destailleur
e15f243e95 Clean code - Remove a deprecated tag that should not exists. 2024-03-16 11:51:32 +01:00
MDW
23785393a3 Add csslist to json keys 2024-03-15 03:55:52 +01:00
MDW
00e65bb09d Fix PhanTypeMismatchPropertyDefault 2024-03-15 03:44:44 +01:00
Laurent Destailleur
c867bc2706 Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-03-13 22:36:45 +01:00
Laurent Destailleur
8bfc0779c4 Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2024-03-13 22:20:08 +01:00
Laurent Destailleur
a0b26ae7cd FIX Amount of localtaxes in foreign currency was wrong on screen and PDF 2024-03-13 22:04:44 +01:00
MDW
fb2aadf006 Fix PhanPluginRedundantAssignment 2024-03-13 00:40:36 +01:00
MDW
88d59896ec Qual: 'enabled' in fields can be string ('isModEnabled(...)')
# Qual: 'enabled' in fields can be string ('isModEnabled(...)')

Update PHPdoc to allow that enabled is a string
2024-03-12 13:38:08 +01:00
MDW
ed703c7241 Fix: Repeat fields typing in CommonClass children
# Fix: Repeat fields typing in CommonClass children

phpstan needs typing to be 'co-variant' and therefore typing must be repeated as
the method is not to initialise the property in the constructor, but to override
the proparty by a 'local' definition in the child class
2024-03-11 17:38:55 +01:00
JeromeBARBOTIN
5371db3c0b FIX: Verification of variables (#28623)
* Verifcation of variables

Modification of the variable setting before its use.

* To check if the property exists

* Modification as per @frederic34 suggestion

* Update propal.class.php

* Application of coding rules

Modification of the called function.

* Verification of variables

* Verification of variable

* Typo error

* Update actions_sendmails.inc.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-03-08 22:50:15 +01:00
Laurent Destailleur
7ab339e97f Fix regression 2024-03-08 17:54:32 +01:00
Frédéric FRANCE
fba15178eb all initAsSpecimen return int (#28577)
* all initAsSpecimen return int

* all initAsSpecimen return int

* all initAsSpecimen return int
2024-03-02 16:38:35 +01:00
MDW
c332251816 Fix: Replace deprecated module names in code strings (#28462)
* Fix: Replace deprecated module names in code strings

# Fix: Replace deprecated module names in code strings

A few cases that slipped through the manual replacements

* Qual: Enable deprecation notices in CodingPhpTest for isModEnabled

# Qual: Enable deprecation notices in CodingPhpTest for isModEnabled

As all detections are now fixed, we can enable the deprecation notice
trigger in the CodingPhpTest.
2024-02-28 23:01:01 +01:00
Goldron
6876f9fcc3 Fixes an error by initializing ->line in the insert_discount method. (#28407)
* Fixes an error by initializing ->line in the insert_discount method.

* Update propal.class.php

---------

Co-authored-by: David IGREJA <david@siladel.fr>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-02-25 09:58:24 +01:00
thibdrev
d4faa5e2b5 qual: phpstan - Property CommonObjectLine::$fk_unit (int|null) does not accept string|null. (#28372)
* Update propal.class.php

htdocs/comm/propal/class/propal.class.php	746	Property CommonObjectLine::$fk_unit (int|null) does not accept string|null.

htdocs/comm/propal/class/propal.class.php	963	Property CommonObjectLine::$fk_unit (int|null) does not accept string|null.

* Update commande.class.php

htdocs/commande/class/commande.class.php	1692	Property CommonObjectLine::$fk_unit (int|null) does not accept string|null.

htdocs/commande/class/commande.class.php	3273	Property CommonObjectLine::$fk_unit (int|null) does not accept string|null.

* Update facture.class.php

htdocs/compta/facture/class/facture.class.php	3990	Property CommonObjectLine::$fk_unit (int|null) does not accept string|null.

htdocs/compta/facture/class/facture.class.php	4243	Property CommonObjectLine::$fk_unit (int|null) does not accept string|null.

* Update fournisseur.commande.class.php

htdocs/fourn/class/fournisseur.commande.class.php	2149	Property CommonObjectLine::$fk_unit (int|null) does not accept string|null.

htdocs/fourn/class/fournisseur.commande.class.php	3031	Property CommonObjectLine::$fk_unit (int|null) does not accept string|null.

* Update fournisseur.facture.class.php

htdocs/fourn/class/fournisseur.facture.class.php	2257	Property CommonObjectLine::$fk_unit (int|null) does not accept string|null.

htdocs/fourn/class/fournisseur.facture.class.php	2453	Property CommonObjectLine::$fk_unit (int|null) does not accept string|null.
2024-02-23 17:13:15 +01:00
MDW
7b54824d49 Fix #28071 - New branch to fix bad merge (#28083)
* Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

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

* Qual: Introduce getDataToShowPhoto to prepare generic code

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

* Fix missing trans

* Fix langs

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

* Remove useless files in web templates

* Clean code

* Fix duplicate translation key

* Fix duplicate translation key

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

* Fix duplicate key

* Fix $object

* Debug v19

* WIP SMSing

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

* WIP EMAILINGS_SUPPORT_ALSO_SMS

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

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

* WIP SMSing

* Debug the "validate" feature

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

* Clean code

* Move rights->x->y into hasRight('x', 'y')

* Move rights->x->y into hasRight('x', 'y')

* Move rights->x->y into hasRight('x', 'y')

* Move rights->x->y into hasRight('x', 'y')

* Move rights->x->y into hasRight('x', 'y')

* Move rights->x->y into hasRight('x', 'y')

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

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

* Enhance rector to fix empty($user->rights->modulex->perm1)

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

* Fix template to use v19 dev rules

* Fix use v19 dev rules

* Fix phpunit

* Debug v19

* Clean code

* Use rector to convert user->rights into user->hasRight

* Clean code

* Use rector to convert user->rights into user->hasRight

* Use rector to convert user->rights into user->hasRight

* Clean code

* Fix phpcs

* add editorconfig for sql files (#27999)

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>

* add model_pdf field in llx_ticket-ticket.sql (#27996)

* add model_pdf field in llx_ticket-ticket.sql

* Update 19.0.0-20.0.0.sql

* Update 19.0.0-20.0.0.sql

* Improve wording in README (#27994)

* fix phpstan (#27989)

* fix phpstan

* Update UserRightsToFunction.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>

* Qual: Fix spelling/working in datapolicy translations (#28006)

# Qual: Fix spelling/wording in datapolicy translations

Fixed some spelling and wording in datapolicy translations.

* qual: phpstan for htdocs/ticket/class/ticketstats.class.php (#27986)

htdocs/ticket/class/ticketstats.class.php	98	Parameter #1 $year (string) of method TicketStats::getNbByMonth() should be compatible with parameter $year (int) of method Stats::getNbByMonth()

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

* Fix user with readonly perm on email template must be able to read.

* Fix doc

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

* Better message

* Add missing fields in merge of thirdparty

* Debug v19 selection of ticket printer per terminal

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

* Use constant

* NEW: Adding a recipient on emails sent, change status to sent partialy.

* fix travis (#28052)

* fix travis

* Update partnership.class.php

* fix php doc (#28047)

* fix undefined array key (#28048)

* Add region and departament for Cuba (#28046)

* Update llx_10_c_regions.sql

Add Cuba Regions (id_country=77)

* Update llx_20_c_departements.sql

Add Provinces Cuba (id country=77)

* Find the typo (#28050)

* Find the typo

* clean code

* add last_main_doc field to product (#28045)

* add las_main_doc field to product

* add field fetch

* NEW Add Categorie filter for ActionComm (#28041)

* New Add Categorie filter for ActionComm

New Add Categorie filter for ActionComm

* Fix space errors

Fix space errors

* Fix space errors 2

Fix space errors 2

* Update cunits.class.php (#28056)

FIX: error SQL when creating a Cunit

* Update codespell-lines-ignore.txt to avoid PR merge conflict

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
Co-authored-by: Frédéric FRANCE <frederic34@users.noreply.github.com>
Co-authored-by: thibdrev <thibault.drevet@gmail.com>
Co-authored-by: sonikf <93765174+sonikf@users.noreply.github.com>
Co-authored-by: Ikarus <44511582+LeKarSol@users.noreply.github.com>
Co-authored-by: Anthony Damhet <73399671+EchoLoGeek@users.noreply.github.com>
Co-authored-by: Quentin-Seekness <72733832+Quentin-Seekness@users.noreply.github.com>
2024-02-09 15:58:49 +01:00
thibdrev
40450e4313 qual: phpstan for htdocs/comm/propal/class/propal.class.php (#28034)
* qual: phpstan for htdocs/comm/propal/class/propal.class.php

htdocs/comm/propal/class/propal.class.php	75	Property Propal::$table_element_line (int) does not accept default value of type string.
htdocs/comm/propal/class/propal.class.php	1414	Property CommonObject::$fk_delivery_address (int) does not accept string.
htdocs/comm/propal/class/propal.class.php	1426	Property CommonObject::$fk_project (int) does not accept string.
htdocs/comm/propal/class/propal.class.php	1499	Property CommonObject::$user_author (User) does not accept int.

* Update propal.class.php

use $object->user_creation_id rather than $object->user_author
2024-02-08 00:22:11 +01:00
Laurent Destailleur
1d6cbe1fda Fix GETPOST use should be avoid in classes 2024-02-02 23:46:12 +01:00
Laurent Destailleur
c9823f2b8d Move 401 to 403 2024-02-01 19:34:13 +01:00
Frédéric France
03e29c6960 fix param 2024-01-20 09:22:38 +01:00