2
0
forked from Wavyzz/dolibarr
Commit Graph

877 Commits

Author SHA1 Message Date
ptibogxiv
d40e0c6026 Fix api_setup.class.php (#30938)
new fix because old disappared
2024-09-12 21:09:28 +02:00
Frédéric FRANCE
80d1f47d4d fix ignored phpstan (most of expects string, int given) (#30649)
* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

fix ignored phpstan

fix ignored phpstan

fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

fix ignored phpstan

fix ignored phpstan

fix ignored phpstan

fix ignored phpstan

fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* fix ignored phpstan

* more ignore

* more ignore

* more ignore

* more ignore

* more ignore

* more ignore

* more ignore

* more ignore

* more ignore

* more ignore

* more ignore

* more ignore

* more ignore

* more ignore

* more ignore

* more ignore

* more ignore

* 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 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 phpstan

* fix phpstan
2024-09-05 16:05:37 +02:00
Laurent Destailleur
14d5b4bcc3 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-09-02 12:14:51 +02:00
ptibogxiv
5ddf586413 FIX api.class.php for expense reports (#30818)
* FIX api.class.php

Descriptions of line in expense reports are named comments

* Update api.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-09-01 15:10:08 +02:00
MaximilienR-easya
89a1e74df3 Force usage of another authentication when there is only openid_connect since he doesn't work for api, ws, and cdav login (#30777) 2024-08-29 09:20:02 +02:00
atm-lena
545015d27b NEW llxHeader BodyCss divers (#30723)
Co-authored-by: atm-lena <lena.papazian@atm-consulting.fr>
2024-08-23 15:22:03 +02:00
Laurent Destailleur
5797a0db3f Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-08-22 02:54:55 +02:00
ptibogxiv
99bcf84a31 Fix api_setup.class.php (#30682) 2024-08-20 03:18:40 +02:00
MDW
b0087aaf61 Qual: Enable phan on modulebuilder (#30652)
* Allow null for buyer, and force '' for  in printObjectLine(s)

* Allow null for Contact in show_actions_done

* Qual: Enable phan on modulebuilder

# Qual: Enable phan on modulebuilder

Most files of the modulebuilder template can be checked as regular files.
It will help improve the template

* Update baseline (enable modulebuilder notices)

* Add properties that are expected to exist on modules_boxes

* Qual: Ignore false positive (phan)

* Set phpdoc type to include null on formAddObjectLine

* Qual: Fixes for modulebuilder (phan, phpstan, bugs, format)

* Fix phpcs for intracom

* Make ModeleBoxes:showBox() signature match child class's

* Fix *box::showBox() phpdoc types

* Update index.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-08-18 18:16:08 +02:00
MDW
75ed925f06 Qual: Fix PhanPluginUnknownObjectMethodCall ("part 1") (#30563)
* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add typing hint to fix phan notice.

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add typing hint in phan config to fix phan notice.

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint to fix phan notice.

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for linkedObjectBlock

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for linkedObjectBlock

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for linkedObjects

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

# Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints)

Add/improve typing hint for PhanPluginUnknownObjectMethodCall

* Fix: MemberNumRefNumbers getExample does not take any arguments

Found thanks to adding the typing for phan!

* Qual: Correct forced type for $module

* Qual: Ignore phan false positive

* Qual: phan/Correct module type and ignore false positive

* Qual: phan/Ignore false positive

* Qual: phan/Ignore false positive, replace depr.prop with method

* Qual: Fix typing for count by adding is_array check

* Qual: replace depr.prop `nom` with method

* Qual: phan/Correct module type and ignore false positive

* Qual: phan/Correct module type and ignore false positive

* Qual: phan/Correct module type and ignore false positive

* Qual: phan/Fix depr.prop with getter and ignore false positive

* Qual: phan/Correct module type and ignore false positive

* Qual: phan/Correct module type and ignore false positive

* Qual: phan/Correct module type and ignore false positive

* Qual: Improve typing for mymodule template

* Make info method arguments match calls

* Make PrintingDriver abstract class because we added abstract methods

* Add phpdoc typing for phan

* Update getExample function signature for compatibility

* Update getExample function signature for compatibility

* Update getExample function signature for compatibility

* Update header wit correct information

* Update getExample method signature

* Update getExample method signature

* Correct reference to class in comment

* Force php phan typing for numbering modules

* Correct $_GLOBALS to $GLOBALS

* Add phpdoc to indicat type of properties

* Correct default to null

* Improve getNextValue typehint

* Improve getNextValue typehint

* Qual: Improve ModeleNumRefTakepos typing

* Qual: Improve ModeleNumRefRecruitmentJobPosition typing

* Fix default for $langs

* Do not use non-existing ModeleNumRefTakepos::nom

* Allow getNextValue argument to be null

* Correct $_GLOBAL into $GLOBALS

* Improve typing for ldap functions

* Allow null for outputlangs argument

* Improve typing for printOriginLine

* Improve typing for linkedObject access

* Fix PhanTypeMismatchArgumentNullableInternal and optimize

* Fix PhanPossiblyUndeclaredVariable by setting default value

* Ignore PhanPluginDuplicateExpressionAssignmentOperation - needs PHP7.4

* getToolTip does not accept null, changed to ''

* Improve getNextValue typing

* Change PrintingDriver back to normal class (instantiated)

And add errors for functions that should be overloaded

* Adjust pringOriginLine typing to match parent

* Fix phpdoc for getNextValue

* Fix phan typing

* Add/Improve phpdoc typing hints

* Qual: Adjustments to match typing

* Update typing for unit, use GETPOSTINT

* ModeleNumRefTask needs Project

* Fix several notices appearing after update from develop

* Index for choices is int, use GETPOSTINT

* Qual: Ignore empty foreach

* Force BOMLine on object line

* phan typing to indicate that linked objects are BOM

* Type the correct variable name (phan)

* Add typing for $langs

* Type to CommonNumRefGenerator (no class for availabilities)

* Resolve several phan notices after update from dev branch

* Extra typing fixes

* Move common attributes to parent class (phan)

* Add typing to Calendar class

* Improve typing hints

* Add typing to pdf_eagle_proforma

* Qual: Add typing for token in generic_oauthcallback.php

* Add typing for objMod

* Correct getNextValue function signature (phpstan)

* Fix typing (phpstan)

* Update version declarations (fix phpstan)

* Fix phpstan typing issues

* Adjust typing (phpstan)

* Qual: Update baseline & conf to detect 25% of PhanPluginUnknownObjectMethodCall
2024-08-17 19:32:52 +02:00
Laurent Destailleur
2f643b8f99 Fix API_DISABLE_LOGIN_API 2024-08-17 16:30:47 +02:00
Laurent Destailleur
03bc26dcbb Fix API_DISABLE_LOGIN_API 2024-08-17 16:29:52 +02:00
thibdrev
e5c0150be4 qual: avoid double negations by introducing getDolGlobalBool() (#30618)
* Update index.php

* Update api.class.php

* Update pdf_eratosthene.modules.php

* Update pdf_sponge.modules.php

* Update pdf_cyan.modules.php

* Update partnershiputils.class.php

* Update paypalfunctions.lib.php

* Update societe.class.php

* Update functions.lib.php - create getDolGlobalBool()

* Update index.php

* Update api.class.php

* Update pdf_eratosthene.modules.php

* Update pdf_sponge.modules.php

* Update pdf_cyan.modules.php

* Update partnershiputils.class.php

* Update paypalfunctions.lib.php

* Update societe.class.php

* Update functions.lib.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-08-13 22:50:31 +02:00
ptibogxiv
700ee5b39e NEW translation with action triggers API (#30595)
* NEW translation with action triggers API

* Update api_setup.class.php
2024-08-13 12:16:10 +02:00
Jon Bendtsen
f1678b7524 NEW: API_LOGINS_ALLOWED_FOR_GET_EXTRAFIELD (#30562)
* introducing new global variable API_LOGINS_ALLOWED_FOR_GET_EXTRAFIELDS, code copied and modified from public function getModules()

* trying to use a different method to read the variable

---------

Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
2024-08-11 00:06:00 +02:00
Jon Bendtsen
d4387e7e16 replacing ->global-> with getDolGlobalString because phan complained in a different commit (#30589)
Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
2024-08-10 23:23:09 +02:00
MDW
aa49419e8f Qual: Fix/initial type cannot be inferred (#30591)
* Update baseline

* Add/update phpdoc typings

* Fix type for AssetDepreciationOptions as is

* Fix typing for Asset->depreciation_lines

* $card is used in derived classes, add it back to ActionsAdherentCardCommon

* Adjust code with typing/corrections for defined types

* Fix typos, code update to match typing, extra typing

* Add type cast for numeric operation

* Phpdoc/cast adjustments detected because of new phpdoc hints
2024-08-10 23:21:46 +02:00
MDW
45ed4caeb2 Qual: Enable Phan Simplify rule and fix notices (#30537)
* Qual: Phan - Enable Simplyfy expression

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Qual: Simplify expression (phan notice)

* Update functions2.lib.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-08-07 03:05:02 +02:00
Jon Bendtsen
227bca1867 NEW API /setup endpoint for getting action triggers (#30538)
* New API /setup endpoint for getting action triggers. This makes it easier to know which ID number to specify to enable PROPAL_VALIDATE notifications

* introducing page and limit, also because phan was complaining

---------

Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
2024-08-07 03:00:51 +02:00
MDW
8b71242997 Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests (#30544)
* Remove PhanPluginDuplicateExpressionAssignmentOperation from baseline

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* fixup! Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

* Qual: Apply PhanPluginDuplicateExpressionAssignmentOperation as phan suggests

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-08-07 02:53:45 +02:00
Laurent Destailleur
f002fb4ed1 Use the non deprecated function loadRights instead of getrights 2024-08-02 10:36:43 +02:00
Laurent Destailleur
2068f29b44 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-08-01 10:51:25 +02:00
Laurent Destailleur
ee0412dd27 Fix phan warning 2024-07-31 18:54:52 +02:00
Christian Humpel
b96c7f8318 NEW API Document implementation for MRP (MO) (#30488)
* Get /documents

* PUT /documents/builddoc

* POST /documents/upload
2024-07-31 15:43:13 +02:00
Laurent Destailleur
6b6631fe22 Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-05-31 16:51:46 +02:00
Laurent Destailleur
5ee4af14ed Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2024-05-31 16:30:50 +02:00
battosai30
f0bf49f942 FIX: #29439 incomplete API return (#29796)
* Update api_documents.class.php

* Update api_documents.class.php

* Update api_documents.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-05-31 15:24:31 +02:00
Laurent Destailleur
b10117851c Look and feel v20 2024-05-29 14:29:46 +02:00
Laurent Destailleur
e054e4380c Clean code 2024-05-02 16:25:44 +02:00
Laurent Destailleur
9e654e65dd Debug v20 2024-04-29 11:04:19 +02:00
Jon Bendtsen
cb7ac3abef Fix API GET extrafield returns 404 when not found. In general better (error) descriptions. (#29341)
* fix: get non existent => 404 + more detailed error descriptions

* FIX entity now loaded from Dolibarr, not user input. Also now shown in json.

* getting the entity data from the API user

---------

Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
2024-04-21 09:46:11 +01:00
Jon Bendtsen
a7e53f4e33 NEW: API can create, get and update extrafields #29249 (#29270)
* NEW: API can Post extrafields #29249 v2

* suppressing phan

* removing trailing space

* mix of POST to create and PUT to update into one package

* can now also get a single extrafield based on attrname and elementtype

---------

Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
2024-04-12 02:02:22 +02:00
Lucas Marcouiller
2655cd156b New api call counter (#29323)
Co-authored-by: Hystepik <lmarcouiller@nltechno.com>
2024-04-11 19:14:10 +02:00
Jon Bendtsen
f7eb0b9fde NEW: API setup update extrafields from name, elementtype and json (#29273)
* NEW: API setup update extrafields from name, elementtype and json

* default_value

* fix SQL injection

* more SQL injection prevention

* Sanitized

---------

Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-04-10 12:02:57 +02:00
Jon Bendtsen
1207ce21cc NEW: API setup delete extrafields from name and elementtype v2 (#29269)
* NEW: API delete extrafields from name and elementtype

* 401 came back, but was 403'ed again

* Fix sql injection

---------

Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-04-08 11:11:53 +02:00
Laurent Destailleur
b5de782c6b Fix use the good HTTP code 2024-04-07 14:59:25 +02:00
Jon Bendtsen
3e3c4056fc all current columns in llx_extrafields can now be seen in the json (#29253)
Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
2024-04-06 17:42:03 +02:00
Laurent Destailleur
d25ef761ad Merge pull request #29152 from mdeweerd/test/compat/deprecations
Fix Tests for compatibility with deprecations
2024-04-02 13:41:04 +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
Laurent Destailleur
594da940fa Sanitize input 2024-04-02 11:57:30 +02:00
MDW
e3f1fc3682 Cope with magic and real properties aliases in _filterObjectProperties 2024-04-02 11:25:16 +02:00
Laurent Destailleur
3e8c3edd6d Clean code from _GET 2024-03-28 17:10:22 +01:00
MDW
a094ad38fc Fix spelling (using beta codespell)
# Fix spelling (using beta codespell

New spelling fixes - ignoring thirdparty which should be either third-party
or third party.
2024-03-20 00:35:01 +01:00
Laurent Destailleur
5d073ac208 Fix hasRights into hasRight 2024-03-19 22:02:42 +01:00
MDW
a408288ba1 Fix & enable PhanPluginUnknownClosureParamType
# Fix & enable PhanPluginUnknownClosureParamType

Typing of anonymous functions to fix this notice.
Optimised some minor things.
2024-03-14 22:42:26 +01:00
MDW
9cc3476765 Fix: PHPDoc annotations in unappropriate comment (#28713)
* Fix: PHPDoc annotations in unappropriate comment

# Fix: PHPDoc annotations in unappropriate comment

PHPDoc annotations need to be in /** */ or // comments.
Fixed that (change type, move comment, add suppress directive)

* Fix: PHPDoc annotations in unappropriate comment

# Fix: PHPDoc annotations in unappropriate comment

PHPDoc annotations need to be in /** */ or // comments.
Fixed that (change type, move comment, add suppress directive)

* Fix: PHPDoc annotations in unappropriate comment

# Fix: PHPDoc annotations in unappropriate comment

PHPDoc annotations need to be in /** */ or // comments.
Fixed that (change type, move comment, add suppress directive)

* Fix: PHPDoc annotations in unappropriate comment

# Fix: PHPDoc annotations in unappropriate comment

PHPDoc annotations need to be in /** */ or // comments.
Fixed that (change type, move comment, add suppress directive)

* Update dolreceiptprinter.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-03-08 21:27:09 +01:00
MDW
ec8f2a420d Fix: Use of deprecated fichinter in dynamic modulename (#28456)
# Fix: Use of deprecated fichinter in dynamic modulename

The modulename is computed dynamically and could use deprecated fichinter
module name.
Also optimised the test.
2024-02-27 15:29:58 +01:00
Frédéric FRANCE
b6fdae934a fix phpstan (#28405)
Method DolibarrApi::_checkValForAPI() should return string but returns array.
2024-02-25 10:05:26 +01:00
Laurent Destailleur
23492676b0 Removed definitely modelpdf (replaced with model_pdf) 2024-02-22 12:30:35 +01:00
MDW
8655d5a86b QUAL Use phan to help detect new issues (#27706)
* Qual: Add phan flow

- Add phan configuration (config, baseline, stubs);
- Add github action;
- Update apstats.php.

* Add directives to ignore false phan notices

* Qual: Add typing hints for extrafields TPL files

# Qual: Add typing hints for extrafields TPL files

Add typing hints for phan on view files

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-02-21 18:14:29 +01:00