diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d898628013e48..a992c0a13f635 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -36,7 +36,7 @@ Definition: As the Developer: -1. Check you agree with the terms of the [DCO - Developer's Certificate of Origin](https://github.com/Dolibarr/dolibarr/DCO) +1. Check you agree with the terms of the [DCO - Developer's Certificate of Origin](https://github.com/Dolibarr/dolibarr/blob/develop/DCO) 2. [Fork](https://help.github.com/articles/fork-a-repo) the [GitHub repository](https://github.com/Dolibarr/dolibarr). 3. Clone your fork. 4. Choose a branch(See the [Branches](#branches) section below). diff --git a/.github/changed-lines-count-labeler.yml b/.github/changed-lines-count-labeler.yml new file mode 100644 index 0000000000000..39e663821fb99 --- /dev/null +++ b/.github/changed-lines-count-labeler.yml @@ -0,0 +1,3 @@ +# Add this tag for any changes for more than 1 line +"Pending analysis of PR (maintenance team)": + min: 1 diff --git a/.github/workflows/pr-18-autolabel.yaml b/.github/workflows/pr-18-autolabel.yaml new file mode 100644 index 0000000000000..feb9ee17c9702 --- /dev/null +++ b/.github/workflows/pr-18-autolabel.yaml @@ -0,0 +1,21 @@ +name: "Set label for v18" +on: + pull_request: + types: [opened, synchronize, reopened] + branches: + - "18.0" + push: + branches: + - "18.0" + +jobs: + changed-lines-count-labeler: + runs-on: ubuntu-latest + name: An action for automatically labelling pull requests based on the changed lines count + steps: + - name: Set a label + uses: vkirilichev/changed-lines-count-labeler@v0.2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: .github/changed-lines-count-labeler.yml + continue-on-error: true diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml new file mode 100644 index 0000000000000..67075183b6011 --- /dev/null +++ b/.github/workflows/pr-18.yaml @@ -0,0 +1,55 @@ +name: Set reviewer for v18 +on: + pull_request: + types: [opened, synchronize, reopened] + branches: + - "18.0" + push: + branches: + - "18.0" + +jobs: + pr18: + runs-on: ubuntu-latest + + #env: + # GH_TOKEN: ${{ github.token }} + # GH_TOKENS: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install GitHub CLI + run: | + sudo apt update + sudo apt install gh -y + + - name: Assign reviewer + env: + #REVIEWER: "eldy,lvessiller-opendsi,rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer + REVIEWER: "rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer + run: | + # shellcheck disable=2086 + echo "Run action by ${{ github.actor }}" + # shellcheck disable=2086 + echo "github.token=${{ github.token }}" + # shellcheck disable=2086 + echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" + # shellcheck disable=2086 + echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH" + # shellcheck disable=2086 + echo Get the pr_number + # shellcheck disable=2086 + pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH) + # shellcheck disable=2086 + echo "pr_number=$pr_number" + # shellcheck disable=2086 + echo Authenticate login gh + # shellcheck disable=2086 + gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}" + # shellcheck disable=2086 + gh auth setup-git + # shellcheck disable=2086 + gh pr edit $pr_number --add-reviewer "$REVIEWER" + continue-on-error: true diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000000000..dc0bfbdf63c00 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,38 @@ +name: Test github actions +on: + workflow_dispatch: + pull_request: + types: [opened, reopened, synchronize] + branches: + - "18.0" + +env: + ENVGHT: ${{ secrets.GITHUB_TOKEN }} + ENVGHU: ${{ github.token }} + VARAAA: ${{ vars.AAA }} + SECBBB: ${{ secrets.BBB }} + VARREPORGCCC: ${{ vars.CCC }} + ENVFIX: "abc" + +jobs: + testjob: + runs-on: ubuntu-latest + steps: + - name: Log + run: | + echo "Run action by ${{ github.actor }}" + echo "github.token=${{ github.token }}" + echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" + echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH" + echo "repo-token: ${{secrets.GITHUB_TOKEN}}" + echo "variable org: ${{vars.AAA}}" + echo "env prg: ${{env.AAA}}" + echo "env prg: ${{env.VARAAA}}" + echo "secret org: ${{secrets.BBB}}" + echo "variable repository of orga: ${{vars.CCC}}" + echo "ENVGHT: ${{env.ENVGHT}}" + echo "ENVGHU: ${{env.ENVGHU}}" + echo "VARAAA: ${{vars.AAA}}" + echo "ENVAAA: ${{env.VARAAA}}" + echo "VARREPORGCCC: ${{env.VARREPORGCCC}}" + echo "ENVFIX: ${{env.ENVFIX}}" diff --git a/.gitignore b/.gitignore index 830429de679d7..0a6e4cf66552e 100644 --- a/.gitignore +++ b/.gitignore @@ -90,3 +90,6 @@ phpstan_custom.neon /.php-cs-fixer.cache /.php_cs.cache /.cache + +# ignore .htaccess files +.htaccess diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e6953f0457828..5f75f64fc1600 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: # git commit -a -m "My message" --no-verify # (Recommendation: run git commit -a .. once, then with `--no-verify`) - id: no-commit-to-branch - args: [--branch, develop, --pattern, \d+.0] + args: [--branch, develop, --pattern, \d+.0$] # This checks that xml files are correct - id: check-xml exclude: | diff --git a/build/phpstan/bootstrap_action.php b/build/phpstan/bootstrap_action.php index 2bcc70dd965f3..f1a6a638f910f 100644 --- a/build/phpstan/bootstrap_action.php +++ b/build/phpstan/bootstrap_action.php @@ -27,6 +27,7 @@ } // Defined some constants and load Dolibarr env to reduce PHPStan bootstrap that fails to load a lot of things. +$dolibarr_main_document_root = __DIR__ . '/../../htdocs'; define('DOL_DOCUMENT_ROOT', __DIR__ . '/../../htdocs'); define('DOL_DATA_ROOT', __DIR__ . '/../../documents'); define('DOL_URL_ROOT', '/'); @@ -42,6 +43,7 @@ * @var User $user */ - global $conf, $db, $hookmanager, $langs, $mysoc, $user; +global $conf, $db, $hookmanager, $langs, $mysoc, $user; +global $dolibarr_main_document_root; // include_once DOL_DOCUMENT_ROOT . '/../../htdocs/main.inc.php'; diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 9b055ffc31c7f..a3ec77162003b 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -228,12 +228,6 @@ parameters: count: 4 path: ../../htdocs/accountancy/bookkeeping/export.php - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 1 - path: ../../htdocs/accountancy/bookkeeping/list.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -252,12 +246,6 @@ parameters: count: 3 path: ../../htdocs/accountancy/bookkeeping/list.php - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 1 - path: ../../htdocs/accountancy/bookkeeping/listbyaccount.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -312,12 +300,6 @@ parameters: count: 4 path: ../../htdocs/accountancy/class/accountancycategory.class.php - - - message: '#^Property AccountancyCategory\:\:\$sdcpermonth type has no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: ../../htdocs/accountancy/class/accountancycategory.class.php - - message: '#^Property AccountancyCategory\:\:\$sens \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -481,7 +463,7 @@ parameters: path: ../../htdocs/accountancy/class/accountingaccount.class.php - - message: '#^Call to function array_key_exists\(\) with ''error'' and array\{ref\: mixed, label\: mixed, acquisition_value_ht\: mixed, depreciation\: non\-empty\-array\\}\>, disposal\?\: array\{date\: mixed, amount\: mixed, subject_to_vat\: bool\}\} will always evaluate to false\.$#' + message: '#^Call to function array_key_exists\(\) with ''error'' and array\{ref\: mixed, label\: mixed, acquisition_value_ht\: mixed, depreciation\: non\-empty\-array\\}\>, disposal\?\: array\{date\: mixed, amount\: mixed, subject_to_vat\: bool\}\} will always evaluate to false\.$#' identifier: function.impossibleType count: 1 path: ../../htdocs/accountancy/class/accountingjournal.class.php @@ -643,7 +625,7 @@ parameters: path: ../../htdocs/accountancy/class/lettering.class.php - - message: '#^Parameter \#1 \$link_by_element of method Lettering\:\:getGroupElements\(\) expects array\\>, array\\> given\.$#' + message: '#^Parameter \#1 \$link_by_element of method Lettering\:\:getGroupElements\(\) expects array\\>, array\\> given\.$#' identifier: argument.type count: 1 path: ../../htdocs/accountancy/class/lettering.class.php @@ -900,60 +882,6 @@ parameters: count: 1 path: ../../htdocs/adherents/admin/member.php - - - message: '#^Cannot access property \$control on mixed\.$#' - identifier: property.nonObject - count: 23 - path: ../../htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php - - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 23 - path: ../../htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php - - - - message: '#^Cannot access property \$control on mixed\.$#' - identifier: property.nonObject - count: 27 - path: ../../htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php - - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 26 - path: ../../htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php - - - - message: '#^Cannot access property \$control on mixed\.$#' - identifier: property.nonObject - count: 30 - path: ../../htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php - - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 28 - path: ../../htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -966,10 +894,16 @@ parameters: count: 1 path: ../../htdocs/adherents/card.php + - + message: '#^Call to function is_array\(\) with array will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: ../../htdocs/adherents/class/adherent.class.php + - message: '#^Call to function is_array\(\) with array\ will always evaluate to true\.$#' identifier: function.alreadyNarrowedType - count: 2 + count: 1 path: ../../htdocs/adherents/class/adherent.class.php - @@ -1014,12 +948,6 @@ parameters: count: 1 path: ../../htdocs/adherents/class/adherent.class.php - - - message: '#^Property Adherent\:\:\$first_subscription_amount \(int\|string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: ../../htdocs/adherents/class/adherent.class.php - - message: '#^Property Adherent\:\:\$last_subscription_amount \(int\|string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -1170,12 +1098,6 @@ parameters: count: 1 path: ../../htdocs/adherents/messaging.php - - - message: '#^Variable \$socid might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/adherents/messaging.php - - message: '#^Property Partnership\:\:\$entity \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -1188,54 +1110,12 @@ parameters: count: 1 path: ../../htdocs/adherents/partnership.php - - - message: '#^Variable \$label might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/adherents/stats/geo.php - - - - message: '#^Variable \$theme_datacolor might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/adherents/stats/geo.php - - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 1 - path: ../../htdocs/adherents/subscription.php - - message: '#^Variable \$bankline in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable count: 1 path: ../../htdocs/adherents/subscription/card.php - - - message: '#^Empty array passed to foreach\.$#' - identifier: foreach.emptyArray - count: 1 - path: ../../htdocs/adherents/subscription/list.php - - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 2 - path: ../../htdocs/adherents/subscription/list.php - - - - message: '#^Result of && is always false\.$#' - identifier: booleanAnd.alwaysFalse - count: 1 - path: ../../htdocs/adherents/subscription/list.php - - - - message: '#^Right side of && is always false\.$#' - identifier: booleanAnd.rightAlwaysFalse - count: 1 - path: ../../htdocs/adherents/subscription/list.php - - message: '#^Variable \$object might not be defined\.$#' identifier: variable.undefined @@ -1260,18 +1140,6 @@ parameters: count: 2 path: ../../htdocs/admin/agenda.php - - - message: '#^Variable \$label might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/admin/agenda_other.php - - - - message: '#^Variable \$label might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/admin/agenda_reminder.php - - message: '#^Variable \$errorsaved in empty\(\) always exists and is always falsy\.$#' identifier: empty.variable @@ -1500,18 +1368,6 @@ parameters: count: 1 path: ../../htdocs/admin/mails.php - - - message: '#^Right side of && is always true\.$#' - identifier: booleanAnd.rightAlwaysTrue - count: 3 - path: ../../htdocs/admin/mails.php - - - - message: '#^Ternary operator condition is always false\.$#' - identifier: ternary.alwaysFalse - count: 3 - path: ../../htdocs/admin/mails.php - - message: '#^Variable \$text in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -1680,24 +1536,6 @@ parameters: count: 1 path: ../../htdocs/admin/oauthlogintokens.php - - - message: '#^Negated boolean expression is always false\.$#' - identifier: booleanNot.alwaysFalse - count: 5 - path: ../../htdocs/admin/openid_connect.php - - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 5 - path: ../../htdocs/admin/openid_connect.php - - - - message: '#^Variable \$bc might not be defined\.$#' - identifier: variable.undefined - count: 10 - path: ../../htdocs/admin/openid_connect.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -1728,30 +1566,6 @@ parameters: count: 1 path: ../../htdocs/admin/security_file.php - - - message: '#^Parameter \#4 \$deliveryreceipt of class CSMSFile constructor expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/admin/sms.php - - - - message: '#^Parameter \#5 \$deferred of class CSMSFile constructor expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/admin/sms.php - - - - message: '#^Parameter \#6 \$priority of class CSMSFile constructor expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/admin/sms.php - - - - message: '#^Parameter \#7 \$class of class CSMSFile constructor expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/admin/sms.php - - message: '#^Variable \$smsfile might not be defined\.$#' identifier: variable.undefined @@ -1872,18 +1686,6 @@ parameters: count: 1 path: ../../htdocs/admin/system/security.php - - - message: '#^Variable \$arrayofstreamtodisable might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/admin/system/security.php - - - - message: '#^Variable \$conffile might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/admin/system/security.php - - message: '#^Variable \$dolibarr_main_document_root might not be defined\.$#' identifier: variable.undefined @@ -1974,6 +1776,48 @@ parameters: count: 2 path: ../../htdocs/admin/tools/purge.php + - + message: '#^Method Documentation\:\:displayMenu\(\) has parameter \$menu with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: ../../htdocs/admin/tools/ui/class/documentation.class.php + + - + message: '#^Method Documentation\:\:displaySummary\(\) has parameter \$menu with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: ../../htdocs/admin/tools/ui/class/documentation.class.php + + - + message: '#^Method Documentation\:\:setMenu\(\) should return mixed but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../htdocs/admin/tools/ui/class/documentation.class.php + + - + message: '#^Method Documentation\:\:showCode\(\) has parameter \$lines with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: ../../htdocs/admin/tools/ui/class/documentation.class.php + + - + message: '#^Property Documentation\:\:\$menu type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: ../../htdocs/admin/tools/ui/class/documentation.class.php + + - + message: '#^Property Documentation\:\:\$summary type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: ../../htdocs/admin/tools/ui/class/documentation.class.php + + - + message: '#^Property Documentation\:\:\$view type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: ../../htdocs/admin/tools/ui/class/documentation.class.php + - message: '#^Variable \$massactionbutton in empty\(\) always exists and is always falsy\.$#' identifier: empty.variable @@ -2502,12 +2346,6 @@ parameters: count: 2 path: ../../htdocs/asset/class/asset.class.php - - - message: '#^Property Asset\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, position\: 1, notnull\: 1, visible\: 0, noteditable\: 1, index\: 1, \.\.\.\}, ref\: array\{type\: ''varchar\(128\)'', label\: ''Ref'', enabled\: 1, position\: 20, notnull\: 1, visible\: 1, noteditable\: 0, index\: 1, \.\.\.\}, label\: array\{type\: ''varchar\(255\)'', label\: ''Label'', enabled\: 1, position\: 30, notnull\: 1, visible\: 1, searchall\: 1, css\: ''minwidth300'', \.\.\.\}, fk_asset_model\: array\{type\: ''integer\:AssetModel…'', label\: ''AssetModel'', enabled\: 1, position\: 40, notnull\: 0, visible\: 1, index\: 1, validate\: 1\}, qty\: array\{type\: ''real'', label\: ''Qty'', enabled\: 1, position\: 50, notnull\: 1, visible\: 0, default\: ''1'', isameasure\: 1, \.\.\.\}, acquisition_type\: array\{type\: ''smallint'', label\: ''AssetAcquisitionType'', enabled\: 1, position\: 60, notnull\: 1, visible\: 1, arrayofkeyval\: array\{''AssetAcquisitionTyp…'', ''AssetAcquisitionTyp…''\}, validate\: 1\}, asset_type\: array\{type\: ''smallint'', label\: ''AssetType'', enabled\: 1, position\: 70, notnull\: 1, visible\: 1, arrayofkeyval\: array\{''AssetTypeIntangible'', ''AssetTypeTangible'', ''AssetTypeInProgress'', ''AssetTypeFinancial''\}, validate\: 1\}, not_depreciated\: array\{type\: ''boolean'', label\: ''AssetNotDepreciated'', enabled\: 1, position\: 80, notnull\: 0, default\: ''0'', visible\: 1, validate\: 1\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/asset/class/asset.class.php - - message: '#^Property Asset\:\:\$status \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -2706,42 +2544,12 @@ parameters: count: 1 path: ../../htdocs/asset/tpl/depreciation_options_view.tpl.php - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../htdocs/asset/tpl/depreciation_options_view.tpl.php - - message: '#^Variable \$parameters might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/asset/tpl/depreciation_options_view.tpl.php - - - message: '#^Unable to resolve the template type T in call to function dol_sort_array$#' - identifier: argument.templateType - count: 1 - path: ../../htdocs/asset/tpl/depreciation_view.tpl.php - - - - message: '#^Variable \$assetdepreciationoptions might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../htdocs/asset/tpl/depreciation_view.tpl.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/asset/tpl/depreciation_view.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../htdocs/asset/tpl/depreciation_view.tpl.php - - message: '#^Variable \$parameters might not be defined\.$#' identifier: variable.undefined @@ -2796,12 +2604,6 @@ parameters: count: 1 path: ../../htdocs/blockedlog/class/blockedlog.class.php - - - message: '#^Variable \$aaa might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/blockedlog/class/blockedlog.class.php - - message: '#^Property BOM\:\:\$status \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -2952,12 +2754,6 @@ parameters: count: 1 path: ../../htdocs/bom/class/bom.class.php - - - message: '#^Property BOM\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, visible\: \-2, position\: 1, notnull\: 1, index\: 1, comment\: ''Id''\}, entity\: array\{type\: ''integer'', label\: ''Entity'', enabled\: 1, visible\: 0, notnull\: 1, default\: 1, index\: 1, position\: 5\}, ref\: array\{type\: ''varchar\(128\)'', label\: ''Ref'', enabled\: 1, noteditable\: 1, visible\: 4, position\: 10, notnull\: 1, default\: ''\(PROV\)'', \.\.\.\}, label\: array\{type\: ''varchar\(255\)'', label\: ''Label'', enabled\: 1, visible\: 1, position\: 30, notnull\: 1, searchall\: 1, showoncombobox\: ''2'', \.\.\.\}, bomtype\: array\{type\: ''integer'', label\: ''Type'', enabled\: 1, visible\: 1, position\: 33, notnull\: 1, default\: ''0'', arrayofkeyval\: array\{''Manufacturing'', ''Disassemble''\}, \.\.\.\}, fk_product\: array\{type\: ''integer\:Product…'', label\: ''Product'', picto\: ''product'', enabled\: 1, visible\: 1, position\: 35, notnull\: 1, index\: 1, \.\.\.\}, description\: array\{type\: ''text'', label\: ''Description'', enabled\: 1, visible\: \-1, position\: 60, notnull\: \-1\}, qty\: array\{type\: ''real'', label\: ''Quantity'', enabled\: 1, visible\: 1, default\: 1, position\: 55, notnull\: 1, isameasure\: 1, \.\.\.\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/bom/class/bom.class.php - - message: '#^Property BOM\:\:\$label \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -3006,132 +2802,24 @@ parameters: count: 1 path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - message: '#^Cannot access property \$db on mixed\.$#' - identifier: property.nonObject - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - - message: '#^Variable \$action might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - - message: '#^Variable \$buyer might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - message: '#^Variable \$dateSelector might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - - message: '#^Variable \$i might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - - message: '#^Variable \$line might not be defined\.$#' - identifier: variable.undefined - count: 20 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - - message: '#^Variable \$seller might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - - - message: '#^Variable \$var might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/bom/tpl/objectline_edit.tpl.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue count: 1 path: ../../htdocs/bom/tpl/objectline_title.tpl.php - - - message: '#^Cannot access property \$db on mixed\.$#' - identifier: property.nonObject - count: 2 - path: ../../htdocs/bom/tpl/objectline_view.tpl.php - - - - message: '#^Cannot access property \$id on mixed\.$#' - identifier: property.nonObject - count: 4 - path: ../../htdocs/bom/tpl/objectline_view.tpl.php - - - - message: '#^Cannot access property \$status on mixed\.$#' - identifier: property.nonObject - count: 1 - path: ../../htdocs/bom/tpl/objectline_view.tpl.php - - - - message: '#^Cannot access property \$total_cost on mixed\.$#' - identifier: property.nonObject - count: 1 - path: ../../htdocs/bom/tpl/objectline_view.tpl.php - - message: '#^Property CommonDict\:\:\$label \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property count: 1 path: ../../htdocs/bom/tpl/objectline_view.tpl.php - - - message: '#^Variable \$action might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/bom/tpl/objectline_view.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 8 - path: ../../htdocs/bom/tpl/objectline_view.tpl.php - - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../htdocs/bookcal/availabilities_agenda.php - - - - message: '#^Negated boolean expression is always false\.$#' - identifier: booleanNot.alwaysFalse - count: 1 - path: ../../htdocs/bookcal/availabilities_agenda.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -3180,36 +2868,6 @@ parameters: count: 1 path: ../../htdocs/bookcal/availabilities_card.php - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../htdocs/bookcal/availabilities_contact.php - - - - message: '#^Negated boolean expression is always false\.$#' - identifier: booleanNot.alwaysFalse - count: 1 - path: ../../htdocs/bookcal/availabilities_contact.php - - - - message: '#^Right side of && is always true\.$#' - identifier: booleanAnd.rightAlwaysTrue - count: 2 - path: ../../htdocs/bookcal/availabilities_contact.php - - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../htdocs/bookcal/availabilities_document.php - - - - message: '#^Negated boolean expression is always false\.$#' - identifier: booleanNot.alwaysFalse - count: 1 - path: ../../htdocs/bookcal/availabilities_document.php - - message: '#^Empty array passed to foreach\.$#' identifier: foreach.emptyArray @@ -3234,18 +2892,6 @@ parameters: count: 1 path: ../../htdocs/bookcal/availabilities_list.php - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../htdocs/bookcal/availabilities_note.php - - - - message: '#^Negated boolean expression is always false\.$#' - identifier: booleanNot.alwaysFalse - count: 1 - path: ../../htdocs/bookcal/availabilities_note.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -3474,12 +3120,6 @@ parameters: count: 1 path: ../../htdocs/bookcal/class/availabilities.class.php - - - message: '#^Property Availabilities\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, position\: 1, notnull\: 1, visible\: 2, noteditable\: 1, index\: 1, \.\.\.\}, label\: array\{type\: ''varchar\(255\)'', label\: ''Label'', enabled\: 1, position\: 20, notnull\: 0, visible\: 1, searchall\: 1, css\: ''minwidth300'', \.\.\.\}, fk_bookcal_calendar\: array\{type\: ''integer\:Calendar…'', label\: ''Calendar'', enabled\: 1, position\: 25, notnull\: 1, visible\: 1, css\: ''maxwidth500…'', csslist\: ''tdoverflowmax100''\}, description\: array\{type\: ''text'', label\: ''Description'', enabled\: 1, position\: 60, notnull\: 0, visible\: 3, validate\: 1\}, note_public\: array\{type\: ''html'', label\: ''NotePublic'', enabled\: 1, position\: 61, notnull\: 0, visible\: 0, cssview\: ''wordbreak'', validate\: 1\}, note_private\: array\{type\: ''html'', label\: ''NotePrivate'', enabled\: 1, position\: 62, notnull\: 0, visible\: 0, cssview\: ''wordbreak'', validate\: 1\}, date_creation\: array\{type\: ''datetime'', label\: ''DateCreation'', enabled\: 1, position\: 500, notnull\: 1, visible\: \-2\}, tms\: array\{type\: ''timestamp'', label\: ''DateModification'', enabled\: 1, position\: 501, notnull\: 0, visible\: \-2\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/bookcal/class/availabilities.class.php - - message: '#^Property Availabilities\:\:\$status \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -3709,7 +3349,7 @@ parameters: path: ../../htdocs/categories/class/categorie.class.php - - message: '#^Method Categorie\:\:get_full_arbo\(\) should return \-1\|array\ but returns array\\.$#' + message: '#^Method Categorie\:\:get_full_arbo\(\) should return \-1\|array\ but returns array\\.$#' identifier: return.type count: 1 path: ../../htdocs/categories/class/categorie.class.php @@ -3727,7 +3367,7 @@ parameters: path: ../../htdocs/categories/class/categorie.class.php - - message: '#^Property Categorie\:\:\$cats \(array\\) does not accept array\\.$#' + message: '#^Property Categorie\:\:\$cats \(array\\) does not accept array\\.$#' identifier: assign.propertyType count: 2 path: ../../htdocs/categories/class/categorie.class.php @@ -4602,12 +4242,6 @@ parameters: count: 1 path: ../../htdocs/comm/propal/class/propal.class.php - - - message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../htdocs/comm/propal/class/propal.class.php - - message: '#^Property CommonObject\:\:\$ref \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -4788,12 +4422,6 @@ parameters: count: 1 path: ../../htdocs/comm/propal/tpl/linkedobjectblock.tpl.php - - - message: '#^Variable \$id might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/comm/recap-client.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -5004,12 +4632,6 @@ parameters: count: 1 path: ../../htdocs/commande/class/commande.class.php - - - message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../htdocs/commande/class/commande.class.php - - message: '#^Property CommonObject\:\:\$ref \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -5442,12 +5064,6 @@ parameters: count: 1 path: ../../htdocs/compta/bank/class/paymentvarious.class.php - - - message: '#^Call to function property_exists\(\) with \$this\(PaymentVarious\) and ''fk_bank'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/compta/bank/class/paymentvarious.class.php - - message: '#^Property PaymentVarious\:\:\$accountid \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -5652,42 +5268,12 @@ parameters: count: 1 path: ../../htdocs/compta/bank/various_payment/list.php - - - message: '#^Variable \$accountingaccount might not be defined\.$#' - identifier: variable.undefined - count: 5 - path: ../../htdocs/compta/bank/various_payment/list.php - - - - message: '#^Variable \$accountingjournal might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/compta/bank/various_payment/list.php - - - - message: '#^Variable \$accountstatic might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../htdocs/compta/bank/various_payment/list.php - - - - message: '#^Variable \$bankline might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/compta/bank/various_payment/list.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable count: 1 path: ../../htdocs/compta/bank/various_payment/list.php - - - message: '#^Variable \$variousstatic might not be defined\.$#' - identifier: variable.undefined - count: 12 - path: ../../htdocs/compta/bank/various_payment/list.php - - message: '#^Loose comparison using \=\= between ''card'' and ''card'' will always evaluate to true\.$#' identifier: equal.alwaysTrue @@ -5731,7 +5317,7 @@ parameters: path: ../../htdocs/compta/cashcontrol/class/cashcontrol.class.php - - message: '#^Call to function is_array\(\) with non\-empty\-array\ will always evaluate to true\.$#' + message: '#^Call to function is_array\(\) with non\-empty\-array\<\(float\|int\)\> will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 path: ../../htdocs/compta/cashcontrol/report.php @@ -6006,12 +5592,6 @@ parameters: count: 3 path: ../../htdocs/compta/facture/class/facture-rec.class.php - - - message: '#^Parameter \#1 \$qty of function calcul_price_total expects float, string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/compta/facture/class/facture-rec.class.php - - message: '#^Parameter \#1 \$vatrate of function getLocalTaxesFromRate expects int\|string, float given\.$#' identifier: argument.type @@ -6024,12 +5604,6 @@ parameters: count: 1 path: ../../htdocs/compta/facture/class/facture-rec.class.php - - - message: '#^Parameter \#2 \$pu of function calcul_price_total expects float, string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/compta/facture/class/facture-rec.class.php - - message: '#^Property CommonObject\:\:\$array_options \(array\\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -6084,12 +5658,6 @@ parameters: count: 3 path: ../../htdocs/compta/facture/class/facture.class.php - - - message: '#^Parameter \#1 \$qty of function calcul_price_total expects float, string given\.$#' - identifier: argument.type - count: 2 - path: ../../htdocs/compta/facture/class/facture.class.php - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' identifier: argument.type @@ -6102,42 +5670,18 @@ parameters: count: 2 path: ../../htdocs/compta/facture/class/facture.class.php - - - message: '#^Parameter \#15 \$pu_devise of function calcul_price_total expects float, string given\.$#' - identifier: argument.type - count: 2 - path: ../../htdocs/compta/facture/class/facture.class.php - - message: '#^Parameter \#2 \$alreadypaid of method CommonInvoice\:\:getLibStatut\(\) expects int, float given\.$#' identifier: argument.type count: 1 path: ../../htdocs/compta/facture/class/facture.class.php - - - message: '#^Parameter \#2 \$pu of function calcul_price_total expects float, string given\.$#' - identifier: argument.type - count: 2 - path: ../../htdocs/compta/facture/class/facture.class.php - - message: '#^Parameter \#4 \$txtva of method Facture\:\:addline\(\) expects float, string given\.$#' identifier: argument.type count: 1 path: ../../htdocs/compta/facture/class/facture.class.php - - - message: '#^Parameter \#5 \$uselocaltax1_rate of function calcul_price_total expects float, string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/compta/facture/class/facture.class.php - - - - message: '#^Parameter \#6 \$uselocaltax2_rate of function calcul_price_total expects float, string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/compta/facture/class/facture.class.php - - message: '#^Property CommonInvoice\:\:\$close_code \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -6204,12 +5748,6 @@ parameters: count: 1 path: ../../htdocs/compta/facture/class/facture.class.php - - - message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 3 - path: ../../htdocs/compta/facture/class/facture.class.php - - message: '#^Property CommonObject\:\:\$ref \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -6237,7 +5775,7 @@ parameters: - message: '#^Property Facture\:\:\$ref_client \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property - count: 2 + count: 1 path: ../../htdocs/compta/facture/class/facture.class.php - @@ -7027,7 +6565,7 @@ parameters: path: ../../htdocs/compta/resultat/index.php - - message: '#^Call to function is_array\(\) with non\-empty\-array\\}\> will always evaluate to true\.$#' + message: '#^Call to function is_array\(\) with non\-empty\-array\\}\> will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 path: ../../htdocs/compta/resultat/result.php @@ -7626,12 +7164,6 @@ parameters: count: 3 path: ../../htdocs/compta/tva/payments.php - - - message: '#^Call to function is_array\(\) with list\ will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/compta/tva/quadri_detail.php - - message: '#^Call to function is_array\(\) with list\ will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -7722,60 +7254,6 @@ parameters: count: 1 path: ../../htdocs/contact/ajax/contact.php - - - message: '#^Cannot access property \$control on mixed\.$#' - identifier: property.nonObject - count: 24 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php - - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 24 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php - - - - message: '#^Cannot access property \$control on mixed\.$#' - identifier: property.nonObject - count: 31 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php - - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 29 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_edit.tpl.php - - - - message: '#^Cannot access property \$control on mixed\.$#' - identifier: property.nonObject - count: 34 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php - - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 32 - path: ../../htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -8455,7 +7933,7 @@ parameters: path: ../../htdocs/core/actions_linkedfiles.inc.php - - message: '#^Call to function is_array\(\) with non\-empty\-array\ will always evaluate to true\.$#' + message: '#^Call to function is_array\(\) with non\-empty\-array\ will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 path: ../../htdocs/core/actions_massactions.inc.php @@ -8502,12 +7980,6 @@ parameters: count: 1 path: ../../htdocs/core/actions_massactions.inc.php - - - message: '#^Variable \$action might not be defined\.$#' - identifier: variable.undefined - count: 14 - path: ../../htdocs/core/actions_massactions.inc.php - - message: '#^Variable \$from might not be defined\.$#' identifier: variable.undefined @@ -8526,12 +7998,6 @@ parameters: count: 1 path: ../../htdocs/core/actions_massactions.inc.php - - - message: '#^Variable \$month might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/core/actions_massactions.inc.php - - message: '#^Variable \$newlang in empty\(\) always exists and is always falsy\.$#' identifier: empty.variable @@ -8562,12 +8028,6 @@ parameters: count: 1 path: ../../htdocs/core/actions_massactions.inc.php - - - message: '#^Variable \$year might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/core/actions_massactions.inc.php - - message: '#^Variable \$classfile might not be defined\.$#' identifier: variable.undefined @@ -8808,24 +8268,12 @@ parameters: count: 1 path: ../../htdocs/core/boxes/box_actions.php - - - message: '#^Variable \$nblines might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/core/boxes/box_actions.php - - message: '#^Constructor of class box_actions_future has an unused parameter \$param\.$#' identifier: constructor.unusedParameter count: 1 path: ../../htdocs/core/boxes/box_actions_future.php - - - message: '#^Variable \$nblines might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/core/boxes/box_actions_future.php - - message: '#^Constructor of class box_activity has an unused parameter \$param\.$#' identifier: constructor.unusedParameter @@ -8934,12 +8382,6 @@ parameters: count: 1 path: ../../htdocs/core/boxes/box_dolibarr_state_board.php - - - message: '#^Property box_external_rss\:\:\$paramdef has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../htdocs/core/boxes/box_external_rss.php - - message: '#^Constructor of class box_factures has an unused parameter \$param\.$#' identifier: constructor.unusedParameter @@ -9036,12 +8478,6 @@ parameters: count: 1 path: ../../htdocs/core/boxes/box_graph_invoices_supplier_permonth.php - - - message: '#^Variable \$mesg might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/boxes/box_graph_invoices_supplier_permonth.php - - message: '#^Constructor of class box_graph_nb_ticket_last_x_days has an unused parameter \$param\.$#' identifier: constructor.unusedParameter @@ -9078,12 +8514,6 @@ parameters: count: 1 path: ../../htdocs/core/boxes/box_graph_orders_permonth.php - - - message: '#^Variable \$mesg might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/boxes/box_graph_orders_permonth.php - - message: '#^Constructor of class box_graph_orders_supplier_permonth has an unused parameter \$param\.$#' identifier: constructor.unusedParameter @@ -9102,12 +8532,6 @@ parameters: count: 1 path: ../../htdocs/core/boxes/box_graph_orders_supplier_permonth.php - - - message: '#^Variable \$mesg might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/boxes/box_graph_orders_supplier_permonth.php - - message: '#^Comparison operation "\>" between 0 and 0 is always false\.$#' identifier: greater.alwaysFalse @@ -9126,30 +8550,6 @@ parameters: count: 1 path: ../../htdocs/core/boxes/box_graph_product_distribution.php - - - message: '#^Variable \$mesg might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/boxes/box_graph_product_distribution.php - - - - message: '#^Variable \$px1 might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/core/boxes/box_graph_product_distribution.php - - - - message: '#^Variable \$px2 might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/core/boxes/box_graph_product_distribution.php - - - - message: '#^Variable \$px3 might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/core/boxes/box_graph_product_distribution.php - - message: '#^Constructor of class box_graph_propales_permonth has an unused parameter \$param\.$#' identifier: constructor.unusedParameter @@ -9162,12 +8562,6 @@ parameters: count: 1 path: ../../htdocs/core/boxes/box_graph_propales_permonth.php - - - message: '#^Variable \$mesg might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/boxes/box_graph_propales_permonth.php - - message: '#^Constructor of class box_graph_ticket_by_severity has an unused parameter \$param\.$#' identifier: constructor.unusedParameter @@ -9276,24 +8670,12 @@ parameters: count: 1 path: ../../htdocs/core/boxes/box_project.php - - - message: '#^Variable \$num might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/boxes/box_project.php - - message: '#^Constructor of class box_project_opportunities has an unused parameter \$param\.$#' identifier: constructor.unusedParameter count: 1 path: ../../htdocs/core/boxes/box_project_opportunities.php - - - message: '#^Variable \$num might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/boxes/box_project_opportunities.php - - message: '#^Constructor of class box_propales has an unused parameter \$param\.$#' identifier: constructor.unusedParameter @@ -9870,24 +9252,6 @@ parameters: count: 1 path: ../../htdocs/core/class/commonorder.class.php - - - message: '#^Property CommonOrderLine\:\:\$localtax1_type has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../htdocs/core/class/commonorder.class.php - - - - message: '#^Property CommonOrderLine\:\:\$localtax2_type has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../htdocs/core/class/commonorder.class.php - - - - message: '#^Property CommonOrderLine\:\:\$price has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../htdocs/core/class/commonorder.class.php - - message: '#^Parameter \#2 \$pt of method CommonStickerGenerator\:\:Set_Char_Size\(\) expects int, float given\.$#' identifier: argument.type @@ -10434,12 +9798,6 @@ parameters: count: 2 path: ../../htdocs/core/class/dolgraph.class.php - - - message: '#^Property EmailSenderProfile\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', visible\: \-1, enabled\: 1, position\: 1, notnull\: 1, index\: 1, comment\: ''Id''\}, entity\: array\{type\: ''integer'', label\: ''Entity'', visible\: \-1, enabled\: 1, position\: 20, notnull\: 1, index\: 1\}, label\: array\{type\: ''varchar\(255\)'', label\: ''Label'', visible\: 1, enabled\: 1, position\: 30, notnull\: 1\}, email\: array\{type\: ''varchar\(255\)'', label\: ''Email'', visible\: 1, enabled\: 1, position\: 40, notnull\: \-1\}, private\: array\{type\: ''integer\:User\:user…'', label\: ''User'', visible\: 1, enabled\: 1, position\: 50, default\: ''0'', notnull\: 1\}, signature\: array\{type\: ''html'', label\: ''Signature'', visible\: 3, enabled\: 1, position\: 400, notnull\: \-1, index\: 1\}, position\: array\{type\: ''integer'', label\: ''Position'', visible\: 1, enabled\: 1, position\: 405, notnull\: \-1, index\: 1\}, date_creation\: array\{type\: ''datetime'', label\: ''DateCreation'', visible\: \-1, enabled\: 1, position\: 500, notnull\: 1\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/core/class/emailsenderprofile.class.php - - message: '#^Call to function is_array\(\) with array\ will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -11143,7 +10501,7 @@ parameters: path: ../../htdocs/core/class/notify.class.php - - message: '#^Call to function is_array\(\) with non\-empty\-array\ will always evaluate to true\.$#' + message: '#^Call to function is_array\(\) with non\-empty\-array\ will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 path: ../../htdocs/core/class/openid.class.php @@ -11778,12 +11136,6 @@ parameters: count: 1 path: ../../htdocs/core/lib/company.lib.php - - - message: '#^Property Contact\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 0\|1, visible\: 0\|1, position\: 1\}, name\: array\{type\: ''varchar\(128\)'', label\: ''Name'', enabled\: 1, visible\: 1, notnull\: 1, showoncombobox\: 1, index\: 1, position\: 10, \.\.\.\}, poste\: array\{type\: ''varchar\(128\)'', label\: ''PostOrFunction'', enabled\: 1, visible\: 1, notnull\: 1, showoncombobox\: 2, index\: 1, position\: 20\}, address\: array\{type\: ''varchar\(128\)'', label\: ''Address'', enabled\: 1, visible\: 1, notnull\: 1, showoncombobox\: 3, index\: 1, position\: 30\}, note_private\: array\{type\: ''html'', label\: ''NotePrivate'', enabled\: 0\|1, visible\: 3, position\: 35\}, role\: array\{type\: ''checkbox'', label\: ''Role'', enabled\: 1, visible\: 1, notnull\: 1, showoncombobox\: 4, index\: 1, position\: 40\}, birthday\: array\{type\: ''date'', label\: ''Birthday'', enabled\: 1, visible\: \-1, notnull\: 0, position\: 45\}, statut\: array\{type\: ''integer'', label\: ''Status'', enabled\: 1, visible\: 1, notnull\: 1, default\: ''0'', index\: 1, position\: 50, \.\.\.\}\}\.$#' - identifier: assign.propertyType - count: 3 - path: ../../htdocs/core/lib/company.lib.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -12864,12 +12216,6 @@ parameters: count: 1 path: ../../htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php - - - message: '#^Variable \$outputlangsbis might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php - - message: '#^Property mod_asset_standard\:\:\$prefix has no type specified\.$#' identifier: missingType.property @@ -14215,7 +13561,7 @@ parameters: path: ../../htdocs/core/modules/hrm/mod_evaluation_standard.php - - message: '#^Call to function is_array\(\) with non\-empty\-array will always evaluate to true\.$#' + message: '#^Call to function is_array\(\) with non\-empty\-list\ will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 path: ../../htdocs/core/modules/import/import_csv.modules.php @@ -14430,12 +13776,6 @@ parameters: count: 2 path: ../../htdocs/core/modules/member/doc/pdf_standard_member.class.php - - - message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/core/modules/member/doc/pdf_standard_member.class.php - - message: '#^Parameter \#6 \$epaisseur of method CommonStickerGenerator\:\:_Croix\(\) expects int, float given\.$#' identifier: argument.type @@ -15444,54 +14784,18 @@ parameters: count: 1 path: ../../htdocs/core/modules/oauth/generic_oauthcallback.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/modules/oauth/github_oauthcallback.php - - message: '#^Variable \$state might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/core/modules/oauth/github_oauthcallback.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/modules/oauth/microsoft2_oauthcallback.php - - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/modules/oauth/microsoft_oauthcallback.php - - message: '#^Strict comparison using \=\=\= between null and null will always evaluate to true\.$#' identifier: identical.alwaysTrue count: 2 path: ../../htdocs/core/modules/oauth/stripelive_oauthcallback.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/modules/oauth/stripelive_oauthcallback.php - - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/modules/oauth/stripetest_oauthcallback.php - - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/modules/openid_connect/callback.php - - message: '#^Property mod_payment_cicada\:\:\$prefix has no type specified\.$#' identifier: missingType.property @@ -17400,24 +16704,6 @@ parameters: count: 2 path: ../../htdocs/core/tpl/list_print_total.tpl.php - - - message: '#^Variable \$action might not be defined\.$#' - identifier: variable.undefined - count: 5 - path: ../../htdocs/core/tpl/object_currency_amount.tpl.php - - - - message: '#^Variable \$object might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/core/tpl/object_currency_amount.tpl.php - - - - message: '#^Variable \$usercancreate might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/core/tpl/object_currency_amount.tpl.php - - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue @@ -17580,18 +16866,6 @@ parameters: count: 1 path: ../../htdocs/core/tpl/objectline_view.tpl.php - - - message: '#^Variable \$action might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/core/tpl/objectline_view.tpl.php - - - - message: '#^Variable \$i might not be defined\.$#' - identifier: variable.undefined - count: 5 - path: ../../htdocs/core/tpl/objectline_view.tpl.php - - message: '#^Variable \$objp might not be defined\.$#' identifier: variable.undefined @@ -17610,228 +16884,12 @@ parameters: count: 3 path: ../../htdocs/core/tpl/objectlinked_lineimport.tpl.php - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 29 - path: ../../htdocs/core/tpl/onlinepaymentlinks.tpl.php - - - - message: '#^Variable \$servicename might not be defined\.$#' - identifier: variable.undefined - count: 6 - path: ../../htdocs/core/tpl/onlinepaymentlinks.tpl.php - - message: '#^Variable \$langs might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/core/tpl/originproductline.tpl.php - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$disabled might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$dol_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$focus_element might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 10 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$mode might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$urllogo might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$user might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$username might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$disabled might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$dol_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$focus_element might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 18 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$mode might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$newpass1 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$newpass2 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$passworduidhash might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$setnewpassword might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$urllogo might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$user might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$username might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/core/tpl/resource_add.tpl.php - - - - message: '#^Variable \$element might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/resource_add.tpl.php - - - - message: '#^Variable \$element_id might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/resource_add.tpl.php - - - - message: '#^Variable \$element_ref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/resource_add.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/core/tpl/resource_add.tpl.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - - - message: '#^Variable \$element might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - - - message: '#^Variable \$element_id might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - - - message: '#^Variable \$linked_resources might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - - - message: '#^Variable \$mode might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - - - message: '#^Variable \$resource_type might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - message: '#^Variable \$shippingline might not be defined\.$#' identifier: variable.undefined @@ -18078,18 +17136,6 @@ parameters: count: 4 path: ../../htdocs/cron/class/cronjob.class.php - - - message: '#^Variable \$ExecTimeLimit in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/cron/class/cronjob.class.php - - - - message: '#^Variable \$MemoryLimit in empty\(\) always exists and is always falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/cron/class/cronjob.class.php - - message: '#^Ternary operator condition is always true\.$#' identifier: ternary.alwaysTrue @@ -18240,42 +17286,6 @@ parameters: count: 1 path: ../../htdocs/document.php - - - message: '#^Variable \$hidedesc might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/don/card.php - - - - message: '#^Variable \$hidedetails might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/don/card.php - - - - message: '#^Variable \$hideref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/don/card.php - - - - message: '#^Variable \$newlang in empty\(\) always exists and is always falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/don/card.php - - - - message: '#^Variable \$soc might not be defined\.$#' - identifier: variable.undefined - count: 8 - path: ../../htdocs/don/card.php - - - - message: '#^Variable \$totalpaid might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/don/card.php - - message: '#^Method Donations\:\:_validate\(\) has parameter \$data with no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -18324,39 +17334,9 @@ parameters: count: 1 path: ../../htdocs/don/class/api_donations.class.php - - - message: '#^Call to function method_exists\(\) with \$this\(Don\) and ''LibStatut'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/don/class/don.class.php - - - - message: '#^Call to function method_exists\(\) with \$this\(Don\) and ''getNomUrl'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/don/class/don.class.php - - - - message: '#^Call to function property_exists\(\) with \$this\(Don\) and ''amount'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/don/class/don.class.php - - - - message: '#^Call to function property_exists\(\) with \$this\(Don\) and ''date'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/don/class/don.class.php - - message: '#^Call to function property_exists\(\) with \$this\(Don\) and ''societe'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType - count: 2 - path: ../../htdocs/don/class/don.class.php - - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue count: 1 path: ../../htdocs/don/class/don.class.php @@ -18726,12 +17706,6 @@ parameters: count: 1 path: ../../htdocs/ecm/file_card.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/ecm/file_card.php - - message: '#^Variable \$module might not be defined\.$#' identifier: variable.undefined @@ -18810,12 +17784,6 @@ parameters: count: 1 path: ../../htdocs/emailcollector/class/emailcollector.class.php - - - message: '#^Property EmailCollector\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', visible\: 2, enabled\: 1, position\: 1, notnull\: 1, index\: 1\}, entity\: array\{type\: ''integer'', label\: ''Entity'', enabled\: 1, visible\: 0, default\: 1, notnull\: 1, index\: 1, position\: 20\}, ref\: array\{type\: ''varchar\(128\)'', label\: ''Ref'', enabled\: 1, visible\: 1, notnull\: 1, showoncombobox\: 1, index\: 1, position\: 10, \.\.\.\}, label\: array\{type\: ''varchar\(255\)'', label\: ''Label'', visible\: 1, enabled\: 1, position\: 30, notnull\: \-1, searchall\: 1, help\: ''Example\: My Email…'', \.\.\.\}, description\: array\{type\: ''text'', label\: ''Description'', visible\: \-1, enabled\: 1, position\: 60, notnull\: \-1, cssview\: ''small'', csslist\: ''small…''\}, host\: array\{type\: ''varchar\(255\)'', label\: ''EMailHost'', visible\: 1, enabled\: 1, position\: 90, notnull\: 1, searchall\: 1, comment\: ''IMAP server'', \.\.\.\}, port\: array\{type\: ''varchar\(10\)'', label\: ''EMailHostPort'', visible\: 1, enabled\: 1, position\: 91, notnull\: 1, searchall\: 0, comment\: ''IMAP server port'', \.\.\.\}, imap_encryption\: array\{type\: ''varchar\(16\)'', label\: ''ImapEncryption'', visible\: \-1, enabled\: 1, position\: 92, searchall\: 0, comment\: ''IMAP encryption'', help\: ''ImapEncryptionHelp'', \.\.\.\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/emailcollector/class/emailcollector.class.php - - message: '#^Right side of && is always true\.$#' identifier: booleanAnd.rightAlwaysTrue @@ -18840,18 +17808,6 @@ parameters: count: 1 path: ../../htdocs/emailcollector/class/emailcollector.class.php - - - message: '#^Property EmailCollectorAction\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, visible\: \-1, position\: 1, notnull\: 1, index\: 1, comment\: ''Id''\}, fk_emailcollector\: array\{type\: ''integer'', label\: ''Id of emailcollector'', foreignkey\: ''emailcollector\.rowid''\}, type\: array\{type\: ''varchar\(128\)'', label\: ''Type'', enabled\: 1, visible\: 1, position\: 10, notnull\: 1, index\: 1\}, actionparam\: array\{type\: ''text'', label\: ''ParamForAction'', enabled\: 1, visible\: 1, position\: 40, notnull\: \-1\}, date_creation\: array\{type\: ''datetime'', label\: ''DateCreation'', enabled\: 1, visible\: \-2, position\: 500, notnull\: 1\}, tms\: array\{type\: ''timestamp'', label\: ''DateModification'', enabled\: 1, visible\: \-2, position\: 501, notnull\: 1\}, fk_user_creat\: array\{type\: ''integer'', label\: ''UserAuthor'', enabled\: 1, visible\: \-2, position\: 510, notnull\: 1, foreignkey\: ''llx_user\.rowid''\}, fk_user_modif\: array\{type\: ''integer'', label\: ''UserModif'', enabled\: 1, visible\: \-2, position\: 511, notnull\: \-1\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/emailcollector/class/emailcollectoraction.class.php - - - - message: '#^Property EmailCollectorFilter\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, visible\: \-1, position\: 1, notnull\: 1, index\: 1, comment\: ''Id''\}, fk_emailcollector\: array\{type\: ''integer'', label\: ''Id of emailcollector'', foreignkey\: ''emailcollector\.rowid''\}, type\: array\{type\: ''varchar\(128\)'', label\: ''Type'', enabled\: 1, visible\: 1, position\: 10, notnull\: 1\}, rulevalue\: array\{type\: ''varchar\(255\)'', label\: ''ValueOfRule'', enabled\: 1, visible\: 1, position\: 30, notnull\: \-1, help\: ''Value of Rule''\}, date_creation\: array\{type\: ''datetime'', label\: ''DateCreation'', enabled\: 1, visible\: \-2, position\: 500, notnull\: 1\}, tms\: array\{type\: ''timestamp'', label\: ''DateModification'', enabled\: 1, visible\: \-2, position\: 501, notnull\: 1\}, fk_user_creat\: array\{type\: ''integer'', label\: ''UserAuthor'', enabled\: 1, visible\: \-2, position\: 510, notnull\: 1, foreignkey\: ''llx_user\.rowid''\}, fk_user_modif\: array\{type\: ''integer'', label\: ''UserModif'', enabled\: 1, visible\: \-2, position\: 511, notnull\: \-1\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/emailcollector/class/emailcollectorfilter.class.php - - message: '#^Call to function method_exists\(\) with \$this\(ConferenceOrBooth\) and ''getLibStatut'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -18900,12 +17856,6 @@ parameters: count: 1 path: ../../htdocs/eventorganization/class/conferenceorbooth.class.php - - - message: '#^Property ConferenceOrBooth\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{id\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, position\: 1, notnull\: 1, visible\: 0, noteditable\: 1, index\: 1, \.\.\.\}, ref\: array\{type\: ''integer'', label\: ''Ref'', enabled\: 1, position\: 1, notnull\: 1, visible\: 2, noteditable\: 1, index\: 1, \.\.\.\}, label\: array\{type\: ''varchar\(255\)'', label\: ''Label'', enabled\: 1, position\: 30, notnull\: 1, visible\: 1, searchall\: 1, css\: ''minwidth300'', \.\.\.\}, fk_project\: array\{type\: ''integer\:Project…'', label\: ''Project'', enabled\: ''isModEnabled\(…'', position\: 52, notnull\: \-1, visible\: 1, index\: 1, picto\: ''project'', \.\.\.\}, fk_soc\: array\{type\: ''integer\:Societe…'', label\: ''ThirdParty'', enabled\: ''\$conf\-\>societe\-…'', position\: 50, notnull\: \-1, visible\: 1, index\: 1, help\: ''OrganizationEventLi…'', \.\.\.\}, note\: array\{type\: ''html'', label\: ''Description'', enabled\: 1, position\: 60, notnull\: 0, visible\: 3\}, fk_action\: array\{type\: ''sellist\:c…'', label\: ''ConferenceOrBoothFo…'', enabled\: 1, position\: 60, notnull\: 1, visible\: 1, css\: ''width200'', csslist\: ''tdoverflowmax100''\}, datep\: array\{type\: ''datetime'', label\: ''DateStart'', enabled\: 1, position\: 70, notnull\: 0, visible\: 1, showoncombobox\: ''2''\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/eventorganization/class/conferenceorbooth.class.php - - message: '#^Property ConferenceOrBooth\:\:\$status \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -19020,12 +17970,6 @@ parameters: count: 1 path: ../../htdocs/eventorganization/conferenceorbooth_contact.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/eventorganization/conferenceorbooth_contact.php - - message: '#^Variable \$mode might not be defined\.$#' identifier: variable.undefined @@ -19056,12 +18000,6 @@ parameters: count: 1 path: ../../htdocs/eventorganization/conferenceorbooth_document.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/eventorganization/conferenceorbooth_document.php - - message: '#^Comparison operation "\>" between 0 and 0 is always false\.$#' identifier: greater.alwaysFalse @@ -19116,12 +18054,6 @@ parameters: count: 4 path: ../../htdocs/eventorganization/conferenceorboothattendee_card.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/eventorganization/conferenceorboothattendee_card.php - - message: '#^Variable \$text might not be defined\.$#' identifier: variable.undefined @@ -19188,12 +18120,6 @@ parameters: count: 1 path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/eventorganization/core/actions_massactions_mail.inc.php - - message: '#^Variable \$from might not be defined\.$#' identifier: variable.undefined @@ -19422,12 +18348,6 @@ parameters: count: 2 path: ../../htdocs/expedition/class/expedition.class.php - - - message: '#^Property Expedition\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../htdocs/expedition/class/expedition.class.php - - message: '#^Property Expedition\:\:\$ref_customer \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -20796,12 +19716,6 @@ parameters: count: 1 path: ../../htdocs/fourn/class/fournisseur.commande.class.php - - - message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../htdocs/fourn/class/fournisseur.commande.class.php - - message: '#^Property CommonObject\:\:\$ref_ext \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -21036,12 +19950,6 @@ parameters: count: 1 path: ../../htdocs/fourn/class/fournisseur.facture.class.php - - - message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../htdocs/fourn/class/fournisseur.facture.class.php - - message: '#^Property CommonObject\:\:\$ref_ext \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -21384,42 +20292,6 @@ parameters: count: 1 path: ../../htdocs/fourn/commande/document.php - - - message: '#^Variable \$badgeStatus0 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/fourn/commande/index.php - - - - message: '#^Variable \$badgeStatus1 might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/fourn/commande/index.php - - - - message: '#^Variable \$badgeStatus4 might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/fourn/commande/index.php - - - - message: '#^Variable \$badgeStatus6 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/fourn/commande/index.php - - - - message: '#^Variable \$badgeStatus9 might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/fourn/commande/index.php - - - - message: '#^Variable \$socid might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/fourn/commande/index.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -21804,102 +20676,12 @@ parameters: count: 1 path: ../../htdocs/fourn/facture/paiement.php - - - message: '#^Left side of && is always true\.$#' - identifier: booleanAnd.leftAlwaysTrue - count: 2 - path: ../../htdocs/fourn/facture/paiement.php - - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 1 - path: ../../htdocs/fourn/facture/paiement.php - - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/fourn/facture/paiement.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/fourn/facture/paiement.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/fourn/facture/paiement.php - - - - message: '#^Variable \$formquestion might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/fourn/facture/paiement.php - - - - message: '#^Variable \$i might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/fourn/facture/paiement.php - - message: '#^Variable \$moreforfilter might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/fourn/facture/paiement.php - - - message: '#^Variable \$multicurrency_creditnotes might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/fourn/facture/paiement.php - - - - message: '#^Variable \$multicurrency_deposits might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/fourn/facture/paiement.php - - - - message: '#^Variable \$multicurrency_payment might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/fourn/facture/paiement.php - - - - message: '#^Variable \$multicurrency_remaintopay might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/fourn/facture/paiement.php - - - - message: '#^Variable \$objcanvas might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/fourn/facture/paiement.php - - - - message: '#^Variable \$ref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/fourn/facture/paiement.php - - - - message: '#^Variable \$sign might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/fourn/facture/paiement.php - - - - message: '#^Variable \$text might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/fourn/facture/paiement.php - - message: '#^Variable \$obj might not be defined\.$#' identifier: variable.undefined @@ -22023,42 +20805,6 @@ parameters: - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse - count: 2 - path: ../../htdocs/holiday/card.php - - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 8 - path: ../../htdocs/holiday/card.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 8 - path: ../../htdocs/holiday/card.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 8 - path: ../../htdocs/holiday/card.php - - - - message: '#^Variable \$canread might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/holiday/card.php - - - - message: '#^Variable \$endhalfdaykey might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/holiday/card.php - - - - message: '#^Variable \$starthalfdaykey might not be defined\.$#' - identifier: variable.undefined count: 1 path: ../../htdocs/holiday/card.php @@ -22332,12 +21078,6 @@ parameters: count: 1 path: ../../htdocs/hrm/class/evaluation.class.php - - - message: '#^Property Evaluation\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, position\: 1, notnull\: 1, visible\: 0, noteditable\: 1, index\: 1, \.\.\.\}, ref\: array\{type\: ''varchar\(128\)'', label\: ''Ref'', enabled\: 1, position\: 20, notnull\: 1, visible\: 4, noteditable\: 1, default\: ''\(PROV\)'', \.\.\.\}, label\: array\{type\: ''varchar\(255\)'', label\: ''Label'', enabled\: 1, position\: 30, notnull\: 0, visible\: 1, searchall\: 1, css\: ''minwidth300'', \.\.\.\}, description\: array\{type\: ''text'', label\: ''Description'', enabled\: 1, position\: 60, notnull\: 0, visible\: 3\}, note_public\: array\{type\: ''html'', label\: ''NotePublic'', enabled\: 1, position\: 61, notnull\: 0, visible\: 0\}, note_private\: array\{type\: ''html'', label\: ''NotePrivate'', enabled\: 1, position\: 62, notnull\: 0, visible\: 0\}, date_creation\: array\{type\: ''datetime'', label\: ''DateCreation'', enabled\: 1, position\: 500, notnull\: 1, visible\: \-2\}, tms\: array\{type\: ''timestamp'', label\: ''DateModification'', enabled\: 1, position\: 501, notnull\: 0, visible\: \-2\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/hrm/class/evaluation.class.php - - message: '#^Property Evaluation\:\:\$status \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -24511,25 +23251,7 @@ parameters: path: ../../htdocs/master.inc.php - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/master.inc.php - - - - message: '#^Variable \$dolibarr_main_url_root_alt might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/master.inc.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/master.inc.php - - - - message: '#^Call to function is_array\(\) with array\ will always evaluate to true\.$#' + message: '#^Call to function is_array\(\) with array\ will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 path: ../../htdocs/modulebuilder/index.php @@ -24852,12 +23574,6 @@ parameters: count: 1 path: ../../htdocs/modulebuilder/template/class/myobject.class.php - - - message: '#^Property MyObject\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, position\: 1, notnull\: 1, visible\: 0, noteditable\: 1, index\: 1, \.\.\.\}, ref\: array\{type\: ''varchar\(128\)'', label\: ''Ref'', enabled\: 1, position\: 20, notnull\: 1, visible\: 1, index\: 1, searchall\: 1, \.\.\.\}, label\: array\{type\: ''varchar\(255\)'', label\: ''Label'', enabled\: 1, position\: 30, notnull\: 0, visible\: 1, alwayseditable\: ''1'', searchall\: 1, \.\.\.\}, amount\: array\{type\: ''price'', label\: ''Amount'', enabled\: 1, position\: 40, notnull\: 0, visible\: 1, default\: ''null'', isameasure\: 1, \.\.\.\}, qty\: array\{type\: ''real'', label\: ''Qty'', enabled\: 1, position\: 45, notnull\: 0, visible\: 1, default\: ''0'', isameasure\: 1, \.\.\.\}, fk_soc\: array\{type\: ''integer\:Societe…'', label\: ''ThirdParty'', picto\: ''company'', enabled\: ''isModEnabled\(…'', position\: 50, notnull\: \-1, visible\: 1, index\: 1, \.\.\.\}, fk_project\: array\{type\: ''integer\:Project…'', label\: ''Project'', picto\: ''project'', enabled\: ''isModEnabled\(…'', position\: 52, notnull\: \-1, visible\: ''\-1'', index\: 1, \.\.\.\}, description\: array\{type\: ''text'', label\: ''Description'', enabled\: 1, position\: 60, notnull\: 0, visible\: ''3'', validate\: 1\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/modulebuilder/template/class/myobject.class.php - - message: '#^Property MyObject\:\:\$status \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -24918,12 +23634,6 @@ parameters: count: 1 path: ../../htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php - - - message: '#^Parameter \#3 \$tab_height of method pdf_standard_myobject\:\:_tableau\(\) expects int, float given\.$#' - identifier: argument.type - count: 6 - path: ../../htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php - - message: '#^Property pdf_standard_myobject\:\:\$cols \(array\\) does not accept non\-empty\-array\\.$#' identifier: assign.propertyType @@ -24984,12 +23694,6 @@ parameters: count: 1 path: ../../htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php - - - message: '#^Variable \$object might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -25044,18 +23748,6 @@ parameters: count: 2 path: ../../htdocs/modulebuilder/template/myobject_agenda.php - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../htdocs/modulebuilder/template/myobject_agenda.php - - - - message: '#^Negated boolean expression is always false\.$#' - identifier: booleanNot.alwaysFalse - count: 1 - path: ../../htdocs/modulebuilder/template/myobject_agenda.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -25077,19 +23769,7 @@ parameters: - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse - count: 3 - path: ../../htdocs/modulebuilder/template/myobject_card.php - - - - message: '#^If condition is always true\.$#' - identifier: if.alwaysTrue - count: 1 - path: ../../htdocs/modulebuilder/template/myobject_card.php - - - - message: '#^Negated boolean expression is always false\.$#' - identifier: booleanNot.alwaysFalse - count: 1 + count: 2 path: ../../htdocs/modulebuilder/template/myobject_card.php - @@ -25122,30 +23802,6 @@ parameters: count: 1 path: ../../htdocs/modulebuilder/template/myobject_card.php - - - message: '#^Right side of && is always true\.$#' - identifier: booleanAnd.rightAlwaysTrue - count: 5 - path: ../../htdocs/modulebuilder/template/myobject_card.php - - - - message: '#^Variable \$permissiontoadd in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/modulebuilder/template/myobject_card.php - - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../htdocs/modulebuilder/template/myobject_contact.php - - - - message: '#^Negated boolean expression is always false\.$#' - identifier: booleanNot.alwaysFalse - count: 1 - path: ../../htdocs/modulebuilder/template/myobject_contact.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -25164,24 +23820,6 @@ parameters: count: 1 path: ../../htdocs/modulebuilder/template/myobject_contact.php - - - message: '#^Right side of && is always true\.$#' - identifier: booleanAnd.rightAlwaysTrue - count: 2 - path: ../../htdocs/modulebuilder/template/myobject_contact.php - - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../htdocs/modulebuilder/template/myobject_document.php - - - - message: '#^Negated boolean expression is always false\.$#' - identifier: booleanNot.alwaysFalse - count: 1 - path: ../../htdocs/modulebuilder/template/myobject_document.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -25212,18 +23850,6 @@ parameters: count: 1 path: ../../htdocs/modulebuilder/template/myobject_list.php - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../htdocs/modulebuilder/template/myobject_list.php - - - - message: '#^Negated boolean expression is always false\.$#' - identifier: booleanNot.alwaysFalse - count: 1 - path: ../../htdocs/modulebuilder/template/myobject_list.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -25242,24 +23868,6 @@ parameters: count: 1 path: ../../htdocs/modulebuilder/template/myobject_list.php - - - message: '#^Variable \$permissiontodelete in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/modulebuilder/template/myobject_list.php - - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../htdocs/modulebuilder/template/myobject_note.php - - - - message: '#^Negated boolean expression is always false\.$#' - identifier: booleanNot.alwaysFalse - count: 1 - path: ../../htdocs/modulebuilder/template/myobject_note.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -25716,12 +24324,6 @@ parameters: count: 1 path: ../../htdocs/opensurvey/card.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/opensurvey/card.php - - message: '#^Variable \$id might not be defined\.$#' identifier: variable.undefined @@ -25812,66 +24414,18 @@ parameters: count: 1 path: ../../htdocs/opensurvey/class/opensurveysondage.class.php - - - message: '#^Empty array passed to foreach\.$#' - identifier: foreach.emptyArray - count: 1 - path: ../../htdocs/opensurvey/list.php - - - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/opensurvey/list.php - - - - message: '#^Variable \$nbuser might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/opensurvey/list.php - - - - message: '#^Variable \$search_all might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/opensurvey/list.php - - message: '#^Offset int\<0, max\> on array\, int\<0, max\>\> in isset\(\) always exists and is not nullable\.$#' identifier: isset.offset count: 1 path: ../../htdocs/opensurvey/results.php - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/opensurvey/results.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/opensurvey/results.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/opensurvey/results.php - - message: '#^Variable \$cleinsertion might not be defined\.$#' identifier: variable.undefined count: 2 path: ../../htdocs/opensurvey/results.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/opensurvey/results.php - - message: '#^Variable \$erreur_ajout_date in isset\(\) always exists and is not nullable\.$#' identifier: isset.variable @@ -25920,12 +24474,6 @@ parameters: count: 1 path: ../../htdocs/opensurvey/wizard/create_survey.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/partnership/admin/website.php - - message: '#^Left side of && is always false\.$#' identifier: booleanAnd.leftAlwaysFalse @@ -26040,12 +24588,6 @@ parameters: count: 1 path: ../../htdocs/partnership/class/partnership.class.php - - - message: '#^Property Partnership\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, position\: 1, notnull\: 1, visible\: 0, noteditable\: 1, index\: 1, \.\.\.\}, ref\: array\{type\: ''varchar\(128\)'', label\: ''Ref'', enabled\: 1, position\: 10, notnull\: 1, visible\: 4, noteditable\: 1, default\: ''\(PROV\)'', \.\.\.\}, entity\: array\{type\: ''integer'', label\: ''Entity'', enabled\: ''isModEnabled\(…'', position\: 15, notnull\: 1, visible\: \-2, default\: ''1'', index\: 1\}, fk_type\: array\{type\: ''integer…'', label\: ''Type'', enabled\: 1, position\: 20, notnull\: 1, visible\: 1, csslist\: ''tdoverflowmax125''\}, fk_soc\: array\{type\: ''integer\:Societe…'', label\: ''ThirdParty'', picto\: ''company'', enabled\: 1, position\: 50, notnull\: \-1, visible\: 1, index\: 1, \.\.\.\}, note_public\: array\{type\: ''html'', label\: ''NotePublic'', enabled\: 1, position\: 61, notnull\: 0, visible\: 0\}, note_private\: array\{type\: ''html'', label\: ''NotePrivate'', enabled\: 1, position\: 62, notnull\: 0, visible\: 0\}, date_creation\: array\{type\: ''datetime'', label\: ''DateCreation'', enabled\: 1, position\: 500, notnull\: 1, visible\: \-2, csslist\: ''nowraponall''\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/partnership/class/partnership.class.php - - message: '#^Property Partnership\:\:\$status \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -26268,18 +24810,6 @@ parameters: count: 1 path: ../../htdocs/product/canvas/product/actions_card_product.class.php - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/canvas/product/tpl/card_create.tpl.php - - - - message: '#^Variable \$refalreadyexists might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/canvas/product/tpl/card_create.tpl.php - - message: '#^Property ActionsCardService\:\:\$field_list has no type specified\.$#' identifier: missingType.property @@ -26292,30 +24822,6 @@ parameters: count: 1 path: ../../htdocs/product/canvas/service/actions_card_service.class.php - - - message: '#^Cannot access property \$control on mixed\.$#' - identifier: property.nonObject - count: 2 - path: ../../htdocs/product/canvas/service/tpl/card_create.tpl.php - - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/canvas/service/tpl/card_create.tpl.php - - - - message: '#^Variable \$refalreadyexists might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/canvas/service/tpl/card_create.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/product/canvas/service/tpl/card_create.tpl.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -26580,12 +25086,6 @@ parameters: count: 1 path: ../../htdocs/product/class/product.class.php - - - message: '#^Property Product\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, visible\: \-2, notnull\: 1, index\: 1, position\: 1, comment\: ''Id''\}, ref\: array\{type\: ''varchar\(128\)'', label\: ''Ref'', enabled\: 1, visible\: 1, notnull\: 1, showoncombobox\: 1, index\: 1, position\: 10, \.\.\.\}, entity\: array\{type\: ''integer'', label\: ''Entity'', enabled\: 1, visible\: 0, default\: ''1'', notnull\: 1, index\: 1, position\: 5\}, label\: array\{type\: ''varchar\(255\)'', label\: ''Label'', enabled\: 1, visible\: 1, notnull\: 1, showoncombobox\: 2, position\: 15, csslist\: ''tdoverflowmax250''\}, barcode\: array\{type\: ''varchar\(255\)'', label\: ''Barcode'', enabled\: ''isModEnabled\(…'', position\: 20, visible\: \-1, showoncombobox\: 3, cssview\: ''tdwordbreak'', csslist\: ''tdoverflowmax125''\}, fk_barcode_type\: array\{type\: ''integer'', label\: ''BarcodeType'', enabled\: 1, position\: 21, notnull\: 0, visible\: \-1\}, note_public\: array\{type\: ''html'', label\: ''NotePublic'', enabled\: 1, visible\: 0, position\: 61\}, note\: array\{type\: ''html'', label\: ''NotePrivate'', enabled\: 1, visible\: 0, position\: 62\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/product/class/product.class.php - - message: '#^Property Product\:\:\$fk_default_bom \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -26604,36 +25104,6 @@ parameters: count: 1 path: ../../htdocs/product/class/product.class.php - - - message: '#^Property Product\:\:\$stats_bom has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../htdocs/product/class/product.class.php - - - - message: '#^Property Product\:\:\$stats_facture_fournisseur has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../htdocs/product/class/product.class.php - - - - message: '#^Property Product\:\:\$stats_facturerec has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../htdocs/product/class/product.class.php - - - - message: '#^Property Product\:\:\$stats_mrptoconsume has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../htdocs/product/class/product.class.php - - - - message: '#^Property Product\:\:\$stats_mrptoproduce has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../htdocs/product/class/product.class.php - - message: '#^Property Product\:\:\$status \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -26664,12 +25134,6 @@ parameters: count: 2 path: ../../htdocs/product/class/product.class.php - - - message: '#^Ternary operator condition is always true\.$#' - identifier: ternary.alwaysTrue - count: 1 - path: ../../htdocs/product/class/product.class.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -27462,12 +25926,6 @@ parameters: count: 2 path: ../../htdocs/product/stock/class/entrepot.class.php - - - message: '#^Property Entrepot\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''ID'', enabled\: 1, visible\: 0, notnull\: 1, position\: 10\}, entity\: array\{type\: ''integer'', label\: ''Entity'', enabled\: 1, visible\: 0, default\: ''1'', notnull\: 1, index\: 1, position\: 15\}, ref\: array\{type\: ''varchar\(255\)'', label\: ''Ref'', enabled\: 1, visible\: 1, showoncombobox\: 1, position\: 25, searchall\: 1\}, description\: array\{type\: ''text'', label\: ''Description'', enabled\: 1, visible\: \-2, position\: 35, searchall\: 1\}, lieu\: array\{type\: ''varchar\(64\)'', label\: ''LocationSummary'', enabled\: 1, visible\: 1, position\: 40, showoncombobox\: 2, searchall\: 1\}, fk_parent\: array\{type\: ''integer\:Entrepot…'', label\: ''ParentWarehouse'', enabled\: 1, visible\: \-2, position\: 41\}, fk_project\: array\{type\: ''integer\:Project…'', label\: ''Project'', enabled\: ''\$conf\-\>project\-…'', visible\: \-1, position\: 42\}, address\: array\{type\: ''varchar\(255\)'', label\: ''Address'', enabled\: 1, visible\: \-2, position\: 45, searchall\: 1\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/product/stock/class/entrepot.class.php - - message: '#^Call to function is_object\(\) with object will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -27888,12 +26346,6 @@ parameters: count: 1 path: ../../htdocs/product/stock/movement_list.php - - - message: '#^Variable \$whClass might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/movement_list.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -28410,12 +26862,6 @@ parameters: count: 1 path: ../../htdocs/projet/admin/project.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/projet/admin/website.php - - message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -28566,12 +27012,6 @@ parameters: count: 1 path: ../../htdocs/projet/class/project.class.php - - - message: '#^Property Project\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''ID'', enabled\: 1, visible\: \-1, notnull\: 1, position\: 10\}, fk_project\: array\{type\: ''integer'', label\: ''Parent'', enabled\: 1, visible\: 1, notnull\: 0, position\: 12\}, ref\: array\{type\: ''varchar\(50\)'', label\: ''Ref'', enabled\: 1, visible\: 1, showoncombobox\: 1, position\: 15, searchall\: 1\}, title\: array\{type\: ''varchar\(255\)'', label\: ''ProjectLabel'', enabled\: 1, visible\: 1, notnull\: 1, position\: 17, showoncombobox\: 2, searchall\: 1\}, entity\: array\{type\: ''integer'', label\: ''Entity'', default\: ''1'', enabled\: 1, visible\: 3, notnull\: 1, position\: 19\}, fk_soc\: array\{type\: ''integer'', label\: ''Thirdparty'', enabled\: 1, visible\: 0, position\: 20\}, dateo\: array\{type\: ''date'', label\: ''DateStart'', enabled\: 1, visible\: \-1, position\: 30\}, datee\: array\{type\: ''date'', label\: ''DateEnd'', enabled\: 1, visible\: 1, position\: 35\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/projet/class/project.class.php - - message: '#^Property Project\:\:\$ip \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -28914,12 +27354,6 @@ parameters: count: 1 path: ../../htdocs/projet/list.php - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 1 - path: ../../htdocs/projet/list.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -29040,12 +27474,6 @@ parameters: count: 2 path: ../../htdocs/projet/tasks.php - - - message: '#^Variable \$param might not be defined\.$#' - identifier: variable.undefined - count: 17 - path: ../../htdocs/projet/tasks.php - - message: '#^Variable \$permissiontodelete might not be defined\.$#' identifier: variable.undefined @@ -29418,12 +27846,6 @@ parameters: count: 1 path: ../../htdocs/public/bookcal/index.php - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 9 - path: ../../htdocs/public/clicktodial/cidlookup.php - - message: '#^Variable \$langs might not be defined\.$#' identifier: variable.undefined @@ -29434,78 +27856,6 @@ parameters: message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 - path: ../../htdocs/public/company/new.php - - - - message: '#^If condition is always true\.$#' - identifier: if.alwaysTrue - count: 1 - path: ../../htdocs/public/company/new.php - - - - message: '#^Negated boolean expression is always false\.$#' - identifier: booleanNot.alwaysFalse - count: 1 - path: ../../htdocs/public/company/new.php - - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/public/company/new.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 11 - path: ../../htdocs/public/company/new.php - - - - message: '#^Variable \$ext in empty\(\) always exists and is always falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/public/company/new.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/public/company/new.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 23 - path: ../../htdocs/public/company/new.php - - - - message: '#^Variable \$object might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/public/company/new.php - - - - message: '#^Variable \$php_self might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/public/company/new.php - - - - message: '#^Variable \$user might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/public/company/new.php - - - - message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/public/cron/cron_run_jobs_by_url.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 5 path: ../../htdocs/public/cron/cron_run_jobs_by_url.php - @@ -29532,30 +27882,6 @@ parameters: count: 1 path: ../../htdocs/public/demo/index.php - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 21 - path: ../../htdocs/public/demo/index.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/public/demo/index.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/public/demo/index.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 8 - path: ../../htdocs/public/demo/index.php - - message: '#^Variable \$conf might not be defined\.$#' identifier: variable.undefined @@ -29580,18 +27906,6 @@ parameters: count: 7 path: ../../htdocs/public/donations/donateurs_code.php - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 9 - path: ../../htdocs/public/emailing/mailing-read.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 12 - path: ../../htdocs/public/emailing/mailing-unsubscribe.php - - message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -29682,12 +27996,6 @@ parameters: count: 2 path: ../../htdocs/public/fichinter/agendaexport.php - - - message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/public/members/new.php - - message: '#^Call to preg_quote\(\) is missing delimiter / to be effective\.$#' identifier: argument.invalidPregQuote @@ -29706,12 +28014,6 @@ parameters: count: 1 path: ../../htdocs/public/members/new.php - - - message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/public/members/public_card.php - - message: '#^Property Adherent\:\:\$photo \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -29730,42 +28032,6 @@ parameters: count: 17 path: ../../htdocs/public/members/public_card.php - - - message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/public/members/public_list.php - - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/public/members/public_list.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 12 - path: ../../htdocs/public/members/public_list.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 6 - path: ../../htdocs/public/members/public_list.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/public/notice.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/public/notice.php - - message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -29868,42 +28134,6 @@ parameters: count: 1 path: ../../htdocs/public/payment/newpayment.php - - - message: '#^Variable \$PAYPAL_API_KO might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/public/payment/newpayment.php - - - - message: '#^Variable \$PAYPAL_API_OK might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/public/payment/newpayment.php - - - - message: '#^Variable \$PAYPAL_API_PASSWORD might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/public/payment/newpayment.php - - - - message: '#^Variable \$PAYPAL_API_SANDBOX might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/public/payment/newpayment.php - - - - message: '#^Variable \$PAYPAL_API_SIGNATURE might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/public/payment/newpayment.php - - - - message: '#^Variable \$PAYPAL_API_USER might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/public/payment/newpayment.php - - message: '#^Variable \$attendee might not be defined\.$#' identifier: variable.undefined @@ -30810,12 +29040,6 @@ parameters: count: 2 path: ../../htdocs/reception/class/reception.class.php - - - message: '#^Property Reception\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../htdocs/reception/class/reception.class.php - - message: '#^Property Reception\:\:\$ref_supplier \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -31278,12 +29502,6 @@ parameters: count: 1 path: ../../htdocs/recruitment/class/recruitmentcandidature.class.php - - - message: '#^Property RecruitmentCandidature\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, position\: 1, notnull\: 1, visible\: 0, noteditable\: 1, index\: 1, \.\.\.\}, entity\: array\{type\: ''integer'', label\: ''Entity'', enabled\: 1, visible\: 0, position\: 5, notnull\: 1, default\: ''1'', index\: 1\}, ref\: array\{type\: ''varchar\(128\)'', label\: ''Ref'', enabled\: 1, position\: 10, notnull\: 1, visible\: 4, noteditable\: 1, default\: ''\(PROV\)'', \.\.\.\}, fk_recruitmentjobposition\: array\{type\: ''integer…'', label\: ''Job'', enabled\: 1, position\: 15, notnull\: 0, visible\: 1, index\: 1, picto\: ''recruitmentjobposit…'', \.\.\.\}, note_public\: array\{type\: ''html'', label\: ''NotePublic'', enabled\: 1, position\: 61, notnull\: 0, visible\: 0\}, note_private\: array\{type\: ''html'', label\: ''NotePrivate'', enabled\: 1, position\: 62, notnull\: 0, visible\: 0\}, fk_user_creat\: array\{type\: ''integer\:User\:user…'', label\: ''UserAuthor'', enabled\: 1, position\: 510, notnull\: \-1, visible\: \-2, foreignkey\: ''user\.rowid'', csslist\: ''tdoverflowmax100''\}, fk_user_modif\: array\{type\: ''integer\:User\:user…'', label\: ''UserModif'', enabled\: 1, position\: 511, notnull\: \-1, visible\: \-2, csslist\: ''tdoverflowmax100''\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/recruitment/class/recruitmentcandidature.class.php - - message: '#^Property RecruitmentCandidature\:\:\$status \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -31350,36 +29568,18 @@ parameters: count: 1 path: ../../htdocs/recruitment/class/recruitmentjobposition.class.php - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 2 - path: ../../htdocs/recruitment/class/recruitmentjobposition.class.php - - message: '#^Property CommonObject\:\:\$ismultientitymanaged \(int\<0, 1\>\|string\) in isset\(\) is not nullable\.$#' identifier: isset.property count: 1 path: ../../htdocs/recruitment/class/recruitmentjobposition.class.php - - - message: '#^Property RecruitmentJobPosition\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, position\: 1, notnull\: 1, visible\: 0, noteditable\: 1, index\: 1, \.\.\.\}, entity\: array\{type\: ''integer'', label\: ''Entity'', enabled\: 1, visible\: 0, position\: 5, notnull\: 1, default\: ''1'', index\: 1\}, ref\: array\{type\: ''varchar\(128\)'', label\: ''Ref'', enabled\: 1, position\: 10, notnull\: 1, visible\: 4, noteditable\: 1, default\: ''\(PROV\)'', \.\.\.\}, label\: array\{type\: ''varchar\(255\)'', label\: ''JobLabel'', enabled\: 1, position\: 30, notnull\: 1, visible\: 1, searchall\: 1, css\: ''minwidth500'', \.\.\.\}, qty\: array\{type\: ''integer'', label\: ''NbOfEmployeesExpect…'', enabled\: 1, position\: 45, notnull\: 1, visible\: 1, default\: ''1'', isameasure\: 1, \.\.\.\}, fk_project\: array\{type\: ''integer\:Project…'', label\: ''Project'', enabled\: ''\$conf\-\>project\-…'', position\: 52, notnull\: \-1, visible\: \-1, index\: 1, css\: ''maxwidth500'', \.\.\.\}, fk_user_recruiter\: array\{type\: ''integer\:User\:user…'', label\: ''ResponsibleOfRecrui…'', enabled\: 1, position\: 54, notnull\: 1, visible\: 1, foreignkey\: ''user\.rowid'', css\: ''maxwidth500'', \.\.\.\}, email_recruiter\: array\{type\: ''varchar\(255\)'', label\: ''EmailRecruiter'', enabled\: 1, position\: 54, notnull\: 0, visible\: \-1, help\: ''ToUseAGenericEmail'', picto\: ''email''\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/recruitment/class/recruitmentjobposition.class.php - - message: '#^Property RecruitmentJobPosition\:\:\$status \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property count: 1 path: ../../htdocs/recruitment/class/recruitmentjobposition.class.php - - - message: '#^Variable \$error in empty\(\) always exists and is always falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/recruitment/class/recruitmentjobposition.class.php - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, RecruitmentJobPosition given\.$#' identifier: argument.type @@ -31428,12 +29628,6 @@ parameters: count: 1 path: ../../htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php - - - message: '#^Variable \$outputlangsbis might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php - - message: '#^Variable \$badgeStatus0 might not be defined\.$#' identifier: variable.undefined @@ -32034,12 +30228,6 @@ parameters: count: 1 path: ../../htdocs/salaries/list.php - - - message: '#^Variable \$resteapayer might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/salaries/list.php - - message: '#^Variable \$selected might not be defined\.$#' identifier: variable.undefined @@ -32058,24 +30246,12 @@ parameters: count: 2 path: ../../htdocs/salaries/paiement_salary.php - - - message: '#^Variable \$sumpaid might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/salaries/paiement_salary.php - - message: '#^Negated boolean expression is always false\.$#' identifier: booleanNot.alwaysFalse count: 2 path: ../../htdocs/salaries/payments.php - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 1 - path: ../../htdocs/salaries/payments.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -32160,24 +30336,6 @@ parameters: count: 1 path: ../../htdocs/societe/ajax/company.php - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/societe/canvas/company/tpl/card_create.tpl.php - - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/societe/canvas/company/tpl/card_edit.tpl.php - - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/societe/canvas/company/tpl/card_view.tpl.php - - message: '#^Variable \$db might not be defined\.$#' identifier: variable.undefined @@ -32202,24 +30360,6 @@ parameters: count: 3 path: ../../htdocs/societe/canvas/company/tpl/card_view.tpl.php - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/societe/canvas/individual/tpl/card_create.tpl.php - - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/societe/canvas/individual/tpl/card_edit.tpl.php - - - - message: '#^Variable \$canvas might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/societe/canvas/individual/tpl/card_view.tpl.php - - message: '#^Variable \$objcanvas might not be defined\.$#' identifier: variable.undefined @@ -32490,12 +30630,6 @@ parameters: count: 1 path: ../../htdocs/societe/class/companybankaccount.class.php - - - message: '#^Property CompanyBankAccount\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../htdocs/societe/class/companybankaccount.class.php - - message: '#^Call to function method_exists\(\) with \$this\(Societe\) and ''getLibStatut'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -32556,12 +30690,6 @@ parameters: count: 2 path: ../../htdocs/societe/class/societe.class.php - - - message: '#^Property Societe\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept non\-empty\-array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\.$#' - identifier: assign.propertyType - count: 3 - path: ../../htdocs/societe/class/societe.class.php - - message: '#^Property Societe\:\:\$fournisseur \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -32592,12 +30720,6 @@ parameters: count: 1 path: ../../htdocs/societe/class/societe.class.php - - - message: '#^Property SocieteAccount\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', visible\: \-2, enabled\: 1, position\: 1, notnull\: 1, index\: 1, comment\: ''Id''\}, 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, autofocusoncreate\: 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_temp\: array\{type\: ''varchar\(128\)'', label\: ''Temp'', visible\: 0, enabled\: 0, position\: 32, notnull\: \-1\}, fk_soc\: array\{type\: ''integer\:Societe…'', label\: ''ThirdParty'', visible\: 1, enabled\: 1, position\: 40, notnull\: \-1, index\: 1, picto\: ''company'', \.\.\.\}, site\: array\{type\: ''varchar\(128\)'', label\: ''WebsiteTypeLabel'', visible\: 0, enabled\: 0, position\: 41, notnull\: 1, default\: '''', help\: ''Name of the website…'', \.\.\.\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/societe/class/societeaccount.class.php - - message: '#^Loose comparison using \=\= between 0 and 1 will always evaluate to false\.$#' identifier: equal.alwaysFalse @@ -32683,7 +30805,7 @@ parameters: path: ../../htdocs/societe/notify/card.php - - message: '#^Call to function is_array\(\) with array\ will always evaluate to true\.$#' + message: '#^Call to function is_array\(\) with array\ will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 path: ../../htdocs/societe/paymentmodes.php @@ -32712,24 +30834,6 @@ parameters: count: 1 path: ../../htdocs/societe/paymentmodes.php - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 3 - path: ../../htdocs/societe/paymentmodes.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 3 - path: ../../htdocs/societe/paymentmodes.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 3 - path: ../../htdocs/societe/paymentmodes.php - - message: '#^Ternary operator condition is always true\.$#' identifier: ternary.alwaysTrue @@ -32772,12 +30876,6 @@ parameters: count: 2 path: ../../htdocs/societe/price.php - - - message: '#^Variable \$extrafields might not be defined\.$#' - identifier: variable.undefined - count: 14 - path: ../../htdocs/societe/price.php - - message: '#^Variable \$prodcustprice might not be defined\.$#' identifier: variable.undefined @@ -33372,18 +31470,6 @@ parameters: count: 1 path: ../../htdocs/takepos/printbox.php - - - message: '#^Path in require\(\) "//takepos/invoice\.php" is not a file or it does not exist\.$#' - identifier: require.fileNotFound - count: 1 - path: ../../htdocs/takepos/public/auto_order.php - - - - message: '#^Path in require\(\) "//takepos/phone\.php" is not a file or it does not exist\.$#' - identifier: require.fileNotFound - count: 1 - path: ../../htdocs/takepos/public/auto_order.php - - message: '#^Parameter \#2 \$addpercent of function vatrate expects bool, int given\.$#' identifier: argument.type @@ -33678,12 +31764,6 @@ parameters: count: 1 path: ../../htdocs/theme/md/flags-sprite.inc.php - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/theme/md/info-box.inc.php - - message: '#^Variable \$left might not be defined\.$#' identifier: variable.undefined @@ -33918,18 +31998,6 @@ parameters: count: 1 path: ../../htdocs/ticket/class/ticket.class.php - - - message: '#^Property CommonObject\:\:\$entity \(int\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: ../../htdocs/ticket/class/ticket.class.php - - - - message: '#^Property CommonObject\:\:\$model_pdf \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 2 - path: ../../htdocs/ticket/class/ticket.class.php - - message: '#^Property CommonObject\:\:\$ref \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -34140,18 +32208,6 @@ parameters: count: 1 path: ../../htdocs/ticket/index.php - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 3 - path: ../../htdocs/ticket/list.php - - - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/ticket/list.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -34500,12 +32556,6 @@ parameters: count: 2 path: ../../htdocs/user/home.php - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 2 - path: ../../htdocs/user/list.php - - message: '#^Offset ''u\.salary'' on array\{u\.salary\: \(float\|int\)\} in isset\(\) always exists and is not nullable\.$#' identifier: isset.offset @@ -34704,54 +32754,6 @@ parameters: count: 1 path: ../../htdocs/variants/list.php - - - message: '#^Variable \$rowid might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/variants/list.php - - - - message: '#^Cannot access property \$lines on mixed\.$#' - identifier: property.nonObject - count: 1 - path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php - - - - message: '#^Variable \$action might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php - - - - message: '#^Variable \$this might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/variants/tpl/productattributevalueline_create.tpl.php - - - - message: '#^Variable \$action might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/variants/tpl/productattributevalueline_title.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/variants/tpl/productattributevalueline_title.tpl.php - - message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -35046,12 +33048,6 @@ parameters: count: 1 path: ../../htdocs/webportal/class/webportalmember.class.php - - - message: '#^Property WebPortalMember\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, visible\: 0, notnull\: 1, position\: 10\}, ref\: array\{type\: ''varchar\(30\)'', label\: ''Ref'', default\: ''1'', enabled\: 1, visible\: 5, notnull\: 1, position\: 12, index\: 1, \.\.\.\}, entity\: array\{type\: ''integer'', label\: ''Entity'', default\: ''1'', enabled\: 1, visible\: \-2, notnull\: 1, position\: 15, index\: 1\}, lastname\: array\{type\: ''varchar\(50\)'', label\: ''Lastname'', enabled\: 1, visible\: 4, position\: 30, showonheader\: 1\}, firstname\: array\{type\: ''varchar\(50\)'', label\: ''Firstname'', enabled\: 1, visible\: 4, position\: 35, showonheader\: 1\}, gender\: array\{type\: ''varchar\(10\)'', label\: ''Gender'', enabled\: 1, visible\: 4, position\: 50, arrayofkeyval\: array\{man\: ''Genderman'', woman\: ''Genderwoman'', other\: ''Genderother''\}, showonheader\: 1\}, company\: array\{type\: ''varchar\(128\)'', label\: ''Societe'', enabled\: 1, visible\: 4, position\: 65, showonheader\: 1\}, address\: array\{type\: ''text'', label\: ''Address'', enabled\: 1, visible\: 4, position\: 75, showonheader\: 1\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/webportal/class/webportalmember.class.php - - message: '#^Strict comparison using \=\=\= between ''nolink'' and ''nolink'' will always evaluate to true\.$#' identifier: identical.alwaysTrue @@ -35112,12 +33108,6 @@ parameters: count: 1 path: ../../htdocs/webportal/class/webportalpartnership.class.php - - - message: '#^Property WebPortalPartnership\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, position\: 1, notnull\: 1, visible\: 0, noteditable\: 1, index\: 1, \.\.\.\}, ref\: array\{type\: ''varchar\(128\)'', label\: ''Ref'', enabled\: 1, position\: 10, notnull\: 1, visible\: 5, noteditable\: 1, default\: ''\(PROV\)'', \.\.\.\}, entity\: array\{type\: ''integer'', label\: ''Entity'', enabled\: 1, position\: 15, notnull\: 1, visible\: \-2, default\: ''1'', index\: 1\}, fk_type\: array\{type\: ''integer…'', label\: ''Type'', enabled\: 1, position\: 20, notnull\: 1, visible\: 5, csslist\: ''''\}, fk_soc\: array\{type\: ''integer\:Societe…'', label\: ''ThirdParty'', picto\: ''company'', enabled\: 1, position\: 50, notnull\: \-1, visible\: 5, index\: 1, \.\.\.\}, note_public\: array\{type\: ''html'', label\: ''NotePublic'', enabled\: 1, position\: 61, notnull\: 0, visible\: 0\}, note_private\: array\{type\: ''html'', label\: ''NotePrivate'', enabled\: 1, position\: 62, notnull\: 0, visible\: 0\}, date_creation\: array\{type\: ''datetime'', label\: ''DateCreation'', enabled\: 1, position\: 500, notnull\: 1, visible\: \-2\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/webportal/class/webportalpartnership.class.php - - message: '#^Call to function method_exists\(\) with \$this\(WebPortalPropal\) and ''getLibStatut'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -35286,12 +33276,6 @@ parameters: count: 1 path: ../../htdocs/website/class/websitepage.class.php - - - message: '#^Property WebsitePage\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, visible\: \-1, notnull\: 1, index\: 1, position\: 1, comment\: ''Id''\}, pageurl\: array\{type\: ''varchar\(16\)'', label\: ''WEBSITE_PAGENAME'', enabled\: 1, visible\: 1, notnull\: 1, index\: 1, position\: 10, searchall\: 1, \.\.\.\}, aliasalt\: array\{type\: ''varchar\(255\)'', label\: ''AliasAlt'', enabled\: 1, visible\: 1, notnull\: 1, index\: 0, position\: 11, searchall\: 0, \.\.\.\}, type_container\: array\{type\: ''varchar\(16\)'', label\: ''Type'', enabled\: 1, visible\: 1, notnull\: 1, index\: 0, position\: 12, comment\: ''Type of container''\}, title\: array\{type\: ''varchar\(255\)'', label\: ''Label'', enabled\: 1, visible\: 1, position\: 30, searchall\: 1, help\: ''UseTextBetween5And7…''\}, description\: array\{type\: ''varchar\(255\)'', label\: ''Description'', enabled\: 1, visible\: 1, position\: 30, searchall\: 1\}, image\: array\{type\: ''varchar\(255\)'', label\: ''Image'', enabled\: 1, visible\: 1, position\: 32, searchall\: 0, help\: ''Relative path of…''\}, keywords\: array\{type\: ''varchar\(255\)'', label\: ''Keywords'', enabled\: 1, visible\: 1, position\: 45, searchall\: 0\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/website/class/websitepage.class.php - - message: '#^Call to function is_array\(\) with list\ will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -35544,12 +33528,6 @@ parameters: count: 1 path: ../../htdocs/workstation/class/workstation.class.php - - - message: '#^Property Workstation\:\:\$fields \(array\\|string, position\: int, notnull\?\: int, visible\: int\<\-2, 5\>\|string, noteditable\?\: int\<0, 1\>, default\?\: string, \.\.\.\}\>\) does not accept default value of type array\{rowid\: array\{type\: ''integer'', label\: ''TechnicalID'', enabled\: 1, position\: 1, notnull\: 1, visible\: 0, noteditable\: 1, index\: 1, \.\.\.\}, entity\: array\{type\: ''integer'', label\: ''Entity'', enabled\: 1, visible\: 0, position\: 5, notnull\: 1, default\: ''1'', index\: 1\}, ref\: array\{type\: ''varchar\(128\)'', label\: ''Ref'', enabled\: 1, position\: 10, notnull\: 1, visible\: 1, noteditable\: 0, default\: '''', \.\.\.\}, label\: array\{type\: ''varchar\(255\)'', label\: ''Label'', enabled\: 1, position\: 30, notnull\: 1, visible\: 1, searchall\: 1, css\: ''minwidth300'', \.\.\.\}, type\: array\{type\: ''varchar\(8\)'', label\: ''Type'', enabled\: 1, position\: 32, default\: ''1'', notnull\: 1, visible\: 1, arrayofkeyval\: array\{HUMAN\: ''Human'', MACHINE\: ''Machine'', BOTH\: ''HumanMachine''\}\}, note_public\: array\{type\: ''html'', label\: ''NotePublic'', enabled\: 1, position\: 61, notnull\: 0, visible\: 0\}, note_private\: array\{type\: ''html'', label\: ''NotePrivate'', enabled\: 1, position\: 62, notnull\: 0, visible\: 0\}, date_creation\: array\{type\: ''datetime'', label\: ''DateCreation'', enabled\: 1, position\: 500, notnull\: 1, visible\: \-2, csslist\: ''nowraponall''\}, \.\.\.\}\.$#' - identifier: property.defaultValue - count: 1 - path: ../../htdocs/workstation/class/workstation.class.php - - message: '#^Property Workstation\:\:\$ismultientitymanaged \(int\<0, 1\>\|string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -35652,144 +33630,24 @@ parameters: count: 1 path: ../../htdocs/zapier/class/api_zapier.class.php - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../scripts/bank/export-bank-receipts.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 27 - path: ../../scripts/bank/export-bank-receipts.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/bank/export-bank-receipts.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 9 - path: ../../scripts/bank/export-bank-receipts.php - - message: '#^Variable \$num in isset\(\) always exists and is not nullable\.$#' identifier: isset.variable count: 1 path: ../../scripts/bank/export-bank-receipts.php - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 6 - path: ../../scripts/company/sync_contacts_dolibarr2ldap.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 5 - path: ../../scripts/company/sync_contacts_dolibarr2ldap.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/company/sync_contacts_dolibarr2ldap.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../scripts/company/sync_contacts_dolibarr2ldap.php - - - - message: '#^Variable \$user might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../scripts/company/sync_contacts_dolibarr2ldap.php - - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../scripts/contracts/email_expire_services_to_customers.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 8 - path: ../../scripts/contracts/email_expire_services_to_customers.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/contracts/email_expire_services_to_customers.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../scripts/contracts/email_expire_services_to_customers.php - - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../scripts/contracts/email_expire_services_to_representatives.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/contracts/email_expire_services_to_representatives.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../scripts/contracts/email_expire_services_to_representatives.php - - message: '#^Result of \|\| is always false\.$#' identifier: booleanOr.alwaysFalse count: 1 path: ../../scripts/doc/regenerate_docs.php - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/doc/regenerate_docs.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../scripts/doc/regenerate_docs.php - - message: '#^Variable \$dir in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable count: 1 path: ../../scripts/doc/regenerate_docs.php - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/doc/regenerate_docs.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../scripts/doc/regenerate_docs.php - - message: '#^Variable \$newlang in empty\(\) always exists and is always falsy\.$#' identifier: empty.variable @@ -35808,30 +33666,6 @@ parameters: count: 1 path: ../../scripts/emailings/mailing-send.php - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../scripts/emailings/mailing-send.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/emailings/mailing-send.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/emailings/mailing-send.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../scripts/emailings/mailing-send.php - - message: '#^Variable \$mesg might not be defined\.$#' identifier: variable.undefined @@ -35850,84 +33684,6 @@ parameters: count: 1 path: ../../scripts/emailings/reset-invalid-emails.php - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 21 - path: ../../scripts/emailings/reset-invalid-emails.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/emailings/reset-invalid-emails.php - - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../scripts/invoices/email_unpaid_invoices_to_customers.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/invoices/email_unpaid_invoices_to_customers.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../scripts/invoices/email_unpaid_invoices_to_customers.php - - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../scripts/invoices/email_unpaid_invoices_to_representatives.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 6 - path: ../../scripts/invoices/email_unpaid_invoices_to_representatives.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/invoices/email_unpaid_invoices_to_representatives.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../scripts/invoices/email_unpaid_invoices_to_representatives.php - - - - message: '#^Variable \$conf might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../scripts/invoices/rebuild_merge_pdf.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../scripts/invoices/rebuild_merge_pdf.php - - - - message: '#^Variable \$hookmanager might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../scripts/invoices/rebuild_merge_pdf.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../scripts/invoices/rebuild_merge_pdf.php - - message: '#^Variable \$user might not be defined\.$#' identifier: variable.undefined diff --git a/dev/initdemo/README.md b/dev/initdemo/README.md index de796d3606601..3ec1de227f076 100644 --- a/dev/initdemo/README.md +++ b/dev/initdemo/README.md @@ -10,7 +10,7 @@ Init demo The script `initdemo.sh` will erase the current database with data from `dev/initdemo/mysqldump_dolibarr_x.y.z.sql` and copy files from `documents_demo` to the official document directory. -You many to execute `chmod 700 initdemo.sh` +You may need to execute `chmod 700 initdemo.sh` then run `./initdemo.sh` to launch the Graphical User Interface. After loading the demo files, the admin login may be one of the following: diff --git a/dev/initdemo/initdemo.sh b/dev/initdemo/initdemo.sh index ef30d8686f169..59a11351760d6 100755 --- a/dev/initdemo/initdemo.sh +++ b/dev/initdemo/initdemo.sh @@ -51,6 +51,13 @@ then fi +# ----------------------------- check if dialog available +command -v dialog >/dev/null 2>&1 || { + echo "Error: command dialog not found. On Linux, you can install it with: apt install dialog" + exit +} + + # ----------------------------- if no params on command line if [ "$passwd" = "" ] then @@ -179,17 +186,19 @@ fi if [ "$passwd" != "" ] then export passwd="-p$passwd" + export passwdshown="-p*****" fi #echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile" #mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile #echo "drop old table" +echo "drop table" echo "drop table if exists llx_accounting_account;" | mysql "-P$port" "-u$admin" "$passwd" "$base" -echo "mysql -P$port -u$admin -p***** $base < '$mydir/$dumpfile'" +echo "mysql -P$port -u$admin $passwdshown $base < '$mydir/$dumpfile'" mysql "-P$port" "-u$admin" "$passwd" "$base" < "$mydir/$dumpfile" export res=$? if [ $res -ne 0 ]; then - echo "Error to load database dump with mysql -P$port -u$admin -p***** $base < '$mydir/$dumpfile'" + echo "Error to load database dump with: mysql -P$port -u$admin $passwdshown $base < '$mydir/$dumpfile'" exit fi diff --git a/dev/setup/pre-commit/README.md b/dev/setup/pre-commit/README.md index 5dd6defd12a43..f256cbf26e8f2 100644 --- a/dev/setup/pre-commit/README.md +++ b/dev/setup/pre-commit/README.md @@ -27,10 +27,10 @@ the project: `pre-commit-config.yaml`. If you do not have python installed, install [python](https://www.python.org) first.\ `sudo apt install python3` - If you do not have [`pip`](https://pypi.org/project/pip), install that as well.\\ - `sudo apt install pip` + If you do not have [`pip`](https://pypi.org/project/pip), install that as well.\ + `sudo apt install pip` - Then you can install pre-commit tool: + Then you can install pre-commit tool:\ `python3 -m pip install pre-commit` 2. In your local git clone of the project, run `pre-commit install` to add the hooks @@ -96,4 +96,6 @@ CI also runs pre-commit to help maintain code quality. Note: Code for precommits are saved into: -.cache/pre-commit/repo*/py_env-python3/lib/python*/site-packages/pre_commit_hooks/no_commit_to_branch.py +.cache/pre-commit/repo.../pre_commit_hooks/php-....sh +and +.cache/pre-commit/repo.../py_env-python3/lib/python.../site-packages/pre_commit_hooks/no_commit_to_branch.py diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index b6fd7ed4adbcf..825257dadbe62 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -149,7 +149,7 @@ $output_arrtd = array(); if ($dirphpstan != 'disabled') { - $commandcheck = ($dirphpstan ? $dirphpstan.'/' : '').'phpstan --level='.$PHPSTANLEVEL.' -v analyze -a build/phpstan/bootstrap.php --memory-limit 8G --error-format=github -c ~/preview.dolibarr.org/dolibarr/phpstan.v1.neon'; + $commandcheck = ($dirphpstan ? $dirphpstan.'/' : '').'phpstan --level='.$PHPSTANLEVEL.' -v analyze -a build/phpstan/bootstrap.php --memory-limit 8G --error-format=github -c ~/preview.dolibarr.org/dolibarr/dev/tools/phpstan/phpstan_v1_apstats.neon'; print 'Execute PHPStan to get the technical debt: '.$commandcheck."\n"; $resexectd = 0; exec($commandcheck, $output_arrtd, $resexectd); @@ -883,7 +883,7 @@ $html .= '
'."\n"; $html .= '
'."\n"; $html .= ''."\n"; -$html .= ''."\n"; +$html .= ''."\n"; foreach ($arrayofalerts as $key => $alert) { $cve = ''; $yogosha = empty($alert['issueidyogosha']) ? '' : $alert['issueidyogosha']; diff --git a/dev/tools/codespell/codespell-lines-ignore.txt b/dev/tools/codespell/codespell-lines-ignore.txt index f013fa5ede579..b7cfa4033c0bc 100644 --- a/dev/tools/codespell/codespell-lines-ignore.txt +++ b/dev/tools/codespell/codespell-lines-ignore.txt @@ -55,7 +55,7 @@ preg_match('/:([!<>=\s]+|in|notin|like|notlike):/', $tmpcrit, $reg); print ''.$langs->trans("TransferStock").''; print ''.$langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")).''; - print ''; + print ''; "sme", $action = 'transfert'; $cle_rib = strtolower(checkES($rib, $CCC)); @@ -71,7 +71,7 @@ $reday = GETPOSTINT('reday'); $sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; - $sql .= ", '".$this->db->idate($this->periode)."'"; + $sql .= ", '".$this->db->idate($this->period)."'"; $sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode as period, cs.import_key"; $sql .= ", periode = '".$this->db->idate($this->period ? $this->period : $this->periode)."'"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, fk_projet, entity, fk_user_author, fk_user, date_creation)"; @@ -83,14 +83,12 @@ $title = $langs->trans('Product')." ".$shortlabel." - ".$langs->trans('Referers'); $title = $langs->trans('Service')." ".$shortlabel." - ".$langs->trans('Referers'); $title = $langs->transnoentities("Balance")." - ".$langs->transnoentities("AllTime"); - // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire if (!empty($arrayfields['cs.periode']['checked'])) { if ($newamount == 0 || empty($this->date_ech) || (empty($this->period) && empty($this->periode))) { if ($user->hasRight('stock', 'mouvement', 'creer')) { if (GETPOSTISSET("reday") && GETPOSTISSET("remonth") && GETPOSTISSET("reyear")) { if (empty($reyear) || empty($remonth) || empty($reday)) { * @param float|string $selectedrate Force preselected vat rate. Can be '8.5' or '8.5 (NOO)' for example. Use '' for no forcing. - $date = $obj->periode; $datepaid = dol_mktime(12, 0, 0, GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear")); $datepaid = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); $datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); @@ -128,7 +126,6 @@ print ''; print ''; - print '\n"; print ajax_combobox("mouvement"); print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.lastname,cs.periode", "", $param, 'class="left"', $sortfield, $sortorder); print_liste_field_titre($arrayfields['cs.amount']['label'], $_SERVER["PHP_SELF"], "cs.amount,cs.periode", '', $param, 'class="right"', $sortfield, $sortorder); @@ -150,8 +147,8 @@ $permissiontoadd = $user->hasRight('stock', 'mouvement', 'creer'); $permissiontodelete = $user->hasRight('stock', 'mouvement', 'creer'); // There is no deletion permission for stock movement as we should never delete $permissiontoread = $user->hasRight('stock', 'mouvement', 'lire'); $sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, cs.fk_account, c.libelle, c.accountancy_code, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, pay.code"; -$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,"; -$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total, cs.paye,"; +$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode as period, cs.fk_account,"; +$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode as period, cs.date_ech, cs.amount as total, cs.paye,"; $sql = "SELECT id_users, nom as name, id_sondage, reponses"; $sql = 'SELECT nom as name, reponses'; $title = $langs->trans("Referers", $object->name); diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 209abe87e077c..6d3df7446b45b 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -10,47 +10,46 @@ return [ // # Issue statistics: // PhanUndeclaredProperty : 560+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 370+ occurrences - // PhanUndeclaredGlobalVariable : 300+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 320+ occurrences + // PhanUndeclaredGlobalVariable : 290+ occurrences // PhanTypeMismatchArgumentProbablyReal : 230+ occurrences // PhanPluginUnknownArrayMethodReturnType : 180+ occurrences - // PhanTypeMismatchProperty : 140+ occurrences - // PhanPluginUnknownPropertyType : 130+ occurrences + // PhanTypeMismatchProperty : 130+ occurrences // PhanPluginUnknownArrayMethodParamType : 120+ occurrences - // PhanPossiblyUndeclaredVariable : 110+ occurrences - // PhanPluginUndeclaredVariableIsset : 60+ occurrences + // PhanPluginUnknownPropertyType : 110+ occurrences + // PhanPossiblyUndeclaredVariable : 65+ occurrences // PhanRedefineFunction : 45+ occurrences // PhanTypeExpectedObjectPropAccess : 45+ occurrences // PhanTypeMismatchArgumentNullableInternal : 40+ occurrences + // PhanPluginSuspiciousParamOrder : 35+ occurrences // PhanTypeInvalidDimOffset : 30+ occurrences // PhanTypeMismatchDimFetch : 30+ occurrences // PhanPluginEmptyStatementIf : 15+ occurrences - // PhanUndeclaredConstant : 15+ occurrences // PhanPluginUnknownObjectMethodCall : 10+ occurrences // PhanTypeComparisonFromArray : 10+ occurrences // PhanTypeMismatchDimFetchNullable : 10+ occurrences // PhanUndeclaredMethod : 10+ occurrences - // PhanEmptyForeach : 9 occurrences + // PhanEmptyForeach : 8 occurrences // PhanPluginBothLiteralsBinaryOp : 7 occurrences // PhanPluginDuplicateExpressionBinaryOp : 7 occurrences // PhanPluginSuspiciousParamPosition : 7 occurrences - // PhanTypeArraySuspiciousNull : 7 occurrences + // PhanTypeArraySuspiciousNull : 6 occurrences + // PhanParamTooMany : 5 occurrences // PhanPossiblyNullTypeMismatchProperty : 5 occurrences - // PhanParamTooMany : 4 occurrences - // PhanPluginDuplicateArrayKey : 4 occurrences // PhanEmptyFQSENInClasslike : 3 occurrences // PhanInvalidFQSENInClasslike : 3 occurrences // PhanTypeMismatchReturn : 3 occurrences - // PhanPluginUnknownArrayPropertyType : 2 occurrences // PhanTypeExpectedObjectPropAccessButGotNull : 2 occurrences // PhanTypeMismatchDimAssignment : 2 occurrences // PhanTypeSuspiciousStringExpression : 2 occurrences + // PhanUndeclaredTypeParameter : 2 occurrences // PhanAccessMethodProtected : 1 occurrence + // PhanPluginUnknownArrayPropertyType : 1 occurrence // PhanTypeConversionFromArray : 1 occurrence + // PhanTypeMismatchArgumentInternalProbablyReal : 1 occurrence // Currently, file_suppressions and directory_suppressions are the only supported suppressions 'file_suppressions' => [ - 'htdocs/accountancy/class/accountancycategory.class.php' => ['PhanPluginUnknownArrayPropertyType'], 'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanUndeclaredProperty'], 'htdocs/adherents/list.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/adherents/type.php' => ['PhanTypeMismatchProperty'], @@ -61,7 +60,7 @@ return [ 'htdocs/api/class/api_login.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/api/class/api_setup.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/api/class/api_status.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeInvalidDimOffset'], + 'htdocs/asset/class/asset.class.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanTypeInvalidDimOffset'], 'htdocs/asset/class/assetmodel.class.php' => ['PhanUndeclaredProperty'], 'htdocs/asset/tpl/accountancy_codes_edit.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -107,7 +106,6 @@ return [ 'htdocs/compta/bank/various_payment/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/compta/bank/various_payment/document.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/compta/bank/various_payment/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/compta/bank/various_payment/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], 'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/compta/cashcontrol/cashcontrol_list.php' => ['PhanTypeMismatchProperty'], 'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -129,40 +127,18 @@ return [ 'htdocs/compta/tva/clients.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'], 'htdocs/compta/tva/payments.php' => ['PhanTypeMismatchArgumentNullableInternal'], 'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'], - 'htdocs/contact/perso.php' => ['PhanTypeMismatchProperty'], 'htdocs/contrat/agenda.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/contrat/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/contrat/class/api_contracts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'], 'htdocs/core/actions_massactions.inc.php' => ['PhanUndeclaredProperty'], 'htdocs/core/actions_printing.inc.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/actions_sendmails.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/core/actions_sendmails.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/core/ajax/ajaxdirtree.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/boxes/box_actions.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/boxes/box_actions_future.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/boxes/box_external_rss.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/boxes/box_graph_invoices_permonth.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/boxes/box_graph_invoices_supplier_permonth.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/boxes/box_graph_nb_tickets_type.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/boxes/box_graph_new_vs_close_ticket.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/boxes/box_graph_orders_permonth.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/boxes/box_graph_orders_supplier_permonth.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/boxes/box_graph_product_distribution.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/boxes/box_graph_propales_permonth.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/boxes/box_graph_ticket_by_severity.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/boxes/box_last_modified_ticket.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/boxes/box_last_ticket.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/boxes/box_project.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/boxes/box_project_opportunities.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/boxes/box_services_contracts.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/boxes/box_task.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/boxes/box_validated_projects.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/class/canvas.class.php' => ['PhanParamTooMany', 'PhanUndeclaredMethod'], 'htdocs/core/class/ccountry.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/cgenericdic.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/core/class/commonorder.class.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/class/commonpeople.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/commonsocialnetworks.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/conf.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchProperty'], @@ -175,6 +151,7 @@ return [ 'htdocs/core/class/html.formcompany.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/html.formfile.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/html.formmail.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/class/ldap.class.php' => ['PhanTypeMismatchArgumentInternalProbablyReal'], 'htdocs/core/class/notify.class.php' => ['PhanUndeclaredProperty'], 'htdocs/core/class/smtps.class.php' => ['PhanTypeConversionFromArray'], 'htdocs/core/class/timespent.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], @@ -192,49 +169,65 @@ return [ 'htdocs/core/lib/project.lib.php' => ['PhanUndeclaredProperty'], 'htdocs/core/lib/xcal.lib.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], 'htdocs/core/modules/barcode/doc/phpbarcode.modules.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredVariable'], - 'htdocs/core/modules/barcode/mod_barcode_product_standard.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/barcode/mod_barcode_product_standard.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginUnknownPropertyType'], + 'htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/cheque/mod_chequereceipt_thyme.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/commande/mod_commande_saphir.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/commande/modules_commande.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgumentNullableInternal'], + 'htdocs/core/modules/contract/mod_contract_magre.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/delivery/doc/pdf_storm.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/delivery/doc/pdf_typhon.modules.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/modules/delivery/mod_delivery_saphir.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/delivery/mod_delivery_saphir.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], 'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/core/modules/expedition/mod_expedition_ribera.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/expensereport/mod_expensereport_sand.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/facture/doc/pdf_crabe.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/facture/modules_facture.php' => ['PhanPluginUnknownPropertyType'], + 'htdocs/core/modules/fichinter/mod_arctic.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/fichinter/mod_pacific.php' => ['PhanPossiblyUndeclaredVariable'], + 'htdocs/core/modules/holiday/mod_holiday_immaculate.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], 'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'], 'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanTypeMismatchProperty'], 'htdocs/core/modules/mailings/contacts1.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/mailings/thirdparties.modules.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], 'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/core/modules/payment/mod_payment_ant.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/printing/printgcp.modules.php' => ['PhanTypeMismatchDimFetch'], 'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable'], + 'htdocs/core/modules/product/mod_codeproduct_elephant.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/core/modules/product_batch/mod_lot_advanced.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/core/modules/product_batch/mod_sn_advanced.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/project/mod_project_universal.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/project/task/mod_task_universal.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/propale/mod_propale_saphir.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/propale/modules_propale.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/societe/mod_codecompta_aquarium.php' => ['PhanPluginUnknownPropertyType'], - 'htdocs/core/modules/societe/mod_codecompta_digitaria.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], + 'htdocs/core/modules/reception/mod_reception_moonstone.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/core/modules/societe/mod_codecompta_aquarium.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginUnknownPropertyType'], + 'htdocs/core/modules/societe/mod_codecompta_digitaria.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], 'htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'], @@ -243,24 +236,24 @@ return [ 'htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/supplier_order/modules_commandefournisseur.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php' => ['PhanPluginUnknownPropertyType'], + 'htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'], + 'htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/core/modules/takepos/mod_takepos_ref_universal.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'], + 'htdocs/core/modules/ticket/mod_ticket_universal.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'], - 'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'], + 'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], 'htdocs/core/search_page.php' => ['PhanEmptyForeach', 'PhanPluginBothLiteralsBinaryOp'], - 'htdocs/core/tpl/ajaxrow.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], + 'htdocs/core/tpl/ajaxrow.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/commonfields_view.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/core/tpl/document_actions_post_headers.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/tpl/extrafields_edit.tpl.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/core/tpl/extrafields_list_search_title.tpl.php' => ['PhanPluginUndeclaredVariableIsset'], + 'htdocs/core/tpl/document_actions_post_headers.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/extrafields_view.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/tpl/filemanager.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/tpl/formlayoutai.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], - 'htdocs/core/tpl/list_print_total.tpl.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/core/tpl/massactions_pre.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/core/tpl/notes.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/core/tpl/filemanager.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'], + 'htdocs/core/tpl/formlayoutai.tpl.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/core/tpl/massactions_pre.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/core/tpl/notes.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/tpl/object_discounts.tpl.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/objectline_create.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -284,11 +277,10 @@ return [ 'htdocs/delivery/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/document.php' => ['PhanRedefineFunction'], 'htdocs/don/admin/donation.php' => ['PhanUndeclaredMethod'], - 'htdocs/don/card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/don/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/don/class/api_donations.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/don/class/don.class.php' => ['PhanParamTooMany'], 'htdocs/don/document.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/don/index.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/don/info.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/don/list.php' => ['PhanTypeMismatchProperty'], 'htdocs/don/note.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], @@ -299,9 +291,9 @@ return [ 'htdocs/ecm/dir_card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/ecm/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/emailcollector/lib/emailcollector.lib.php' => ['PhanUndeclaredTypeParameter'], 'htdocs/eventorganization/class/conferenceorboothattendee.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/eventorganization/conferenceorbooth_card.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/eventorganization/conferenceorbooth_contact.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/eventorganization/conferenceorbooth_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/eventorganization/conferenceorboothattendee_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/eventorganization/conferenceorboothattendee_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -325,12 +317,12 @@ return [ 'htdocs/expensereport/tpl/expensereport_linktofile.tpl.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/expensereport/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/fichinter/card-rec.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/fichinter/card-rec.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/fichinter/class/api_interventions.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], 'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'], 'htdocs/fichinter/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fichinter/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/filefunc.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/filefunc.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/fourn/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/class/api_supplier_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/fourn/class/api_supplier_orders.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], @@ -347,13 +339,12 @@ return [ 'htdocs/fourn/facture/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], 'htdocs/fourn/facture/list-rec.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/fourn/facture/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/fourn/facture/paiement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], + 'htdocs/fourn/facture/paiement.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/fourn/paiement/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/fourn/paiement/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/ftp/admin/ftpclient.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/ftp/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/holiday/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/holiday/card_group.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], 'htdocs/holiday/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/holiday/view_log.php' => ['PhanTypeMismatchDimFetch'], @@ -376,19 +367,17 @@ return [ 'htdocs/imports/emptyexample.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/imports/import.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/install/check.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], - 'htdocs/install/fileconf.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/install/inc.php' => ['PhanPluginUndeclaredVariableIsset'], + 'htdocs/install/fileconf.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/install/index.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/install/repair.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], + 'htdocs/install/repair.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/install/step2.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], - 'htdocs/install/step5.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/install/upgrade.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/intracommreport/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanUndeclaredProperty'], 'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/knowledgemanagement/knowledgerecord_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/loan/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/loan/card.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/loan/document.php' => ['PhanUndeclaredProperty'], 'htdocs/loan/note.php' => ['PhanUndeclaredProperty'], 'htdocs/loan/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -399,7 +388,7 @@ return [ 'htdocs/mrp/class/mo.class.php' => ['PhanTypeMismatchProperty'], 'htdocs/mrp/mo_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/mrp/mo_movements.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'], - 'htdocs/mrp/mo_production.php' => ['PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/mrp/mo_production.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/mrp/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/mrp/tpl/originproductline.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/multicurrency/class/api_multicurrencies.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], @@ -407,7 +396,6 @@ return [ 'htdocs/opcachepreload.php' => ['PhanEmptyForeach'], 'htdocs/opensurvey/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/opensurvey/class/opensurveysondage.class.php' => ['PhanTypeMismatchProperty'], - 'htdocs/opensurvey/list.php' => ['PhanEmptyForeach', 'PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/opensurvey/results.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable'], 'htdocs/opensurvey/wizard/choix_date.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/opensurvey/wizard/create_survey.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -418,18 +406,17 @@ return [ 'htdocs/partnership/partnership_list.php' => ['PhanUndeclaredProperty'], 'htdocs/printing/index.php' => ['PhanUndeclaredProperty'], 'htdocs/product/admin/product.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/ajax/products.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/product/ajax/products.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/product/class/api_products.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'], 'htdocs/product/class/html.formproduct.class.php' => ['PhanUndeclaredProperty'], 'htdocs/product/class/productfournisseurprice.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/product/document.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/product/index.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/product/inventory/card.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/product/inventory/class/inventory.class.php' => ['PhanUndeclaredProperty'], 'htdocs/product/inventory/inventory.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/product/inventory/list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/product/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], + 'htdocs/product/list.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/product/price.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/product/reassort.php' => ['PhanTypeExpectedObjectPropAccessButGotNull'], 'htdocs/product/stats/card.php' => ['PhanTypeComparisonFromArray'], @@ -440,8 +427,8 @@ return [ 'htdocs/product/stock/class/mouvementstock.class.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/product/stock/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/product/stock/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/product/stock/movement_card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/product/stock/movement_list.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/product/stock/movement_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/product/stock/movement_list.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/product/stock/product.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/product/stock/productlot_card.php' => ['PhanUndeclaredProperty'], 'htdocs/product/stock/productlot_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -465,7 +452,7 @@ return [ 'htdocs/projet/element.php' => ['PhanUndeclaredProperty'], 'htdocs/projet/ganttchart.inc.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/projet/ganttview.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/graph_opportunities.inc.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'], + 'htdocs/projet/graph_opportunities.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/projet/index.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/projet/list.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], @@ -476,11 +463,11 @@ return [ 'htdocs/projet/tasks/list.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/projet/tasks/note.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/tasks/task.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/tasks/time.php' => ['PhanEmptyForeach', 'PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/projet/tasks/time.php' => ['PhanEmptyForeach', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/public/agenda/agendaexport.php' => ['PhanRedefineFunction'], 'htdocs/public/bookcal/index.php' => ['PhanRedefineFunction'], - 'htdocs/public/company/new.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'], + 'htdocs/public/company/new.php' => ['PhanRedefineFunction'], 'htdocs/public/cron/cron_run_jobs_by_url.php' => ['PhanUndeclaredProperty'], 'htdocs/public/demo/index.php' => ['PhanRedefineFunction'], 'htdocs/public/donations/donateurs_code.php' => ['PhanRedefineFunction'], @@ -503,7 +490,6 @@ return [ 'htdocs/public/project/viewandvote.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/recruitment/view.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/stripe/ipn.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/test/test_arrays.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/public/ticket/create_ticket.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty'], 'htdocs/public/ticket/view.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'], @@ -515,15 +501,15 @@ return [ 'htdocs/reception/class/reception.class.php' => ['PhanUndeclaredProperty'], 'htdocs/reception/contact.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/reception/dispatch.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/reception/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/reception/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/reception/note.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/recruitment/admin/setup.php' => ['PhanEmptyForeach'], 'htdocs/recruitment/admin/setup_candidatures.php' => ['PhanEmptyForeach'], 'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/class/recruitmentjobposition.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php' => ['PhanUndeclaredProperty'], - 'htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php' => ['PhanUndeclaredProperty'], + 'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], + 'htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredProperty'], 'htdocs/recruitment/index.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/recruitment/recruitmentcandidature_card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/recruitment/recruitmentcandidature_list.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], @@ -537,7 +523,7 @@ return [ 'htdocs/salaries/card.php' => ['PhanPossiblyUndeclaredGlobalVariable'], 'htdocs/salaries/class/api_salaries.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/salaries/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/salaries/paiement_salary.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/salaries/paiement_salary.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/salaries/virement_request.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/societe/admin/societe.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], 'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], @@ -545,7 +531,7 @@ return [ 'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/societe/class/societe.class.php' => ['PhanTypeMismatchProperty'], 'htdocs/societe/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/societe/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'], 'htdocs/societe/price.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/tpl/linesalesrepresentative.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -559,22 +545,19 @@ return [ 'htdocs/takepos/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/takepos/floors.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/takepos/freezone.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/takepos/index.php' => ['PhanPluginUndeclaredVariableIsset'], 'htdocs/takepos/invoice.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/takepos/pay.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/takepos/split.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/takepos/split.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/theme/eldy/badges.inc.php' => ['PhanRedefineFunction'], 'htdocs/theme/eldy/btn.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/theme/eldy/dropdown.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/theme/eldy/flags-sprite.inc.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/theme/eldy/info-box.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/theme/eldy/main_menu_fa_icons.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/theme/eldy/progress.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/theme/md/badges.inc.php' => ['PhanRedefineFunction'], 'htdocs/theme/md/btn.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/theme/md/dropdown.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/theme/md/flags-sprite.inc.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/theme/md/info-box.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/theme/md/progress.inc.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/ticket/card.php' => ['PhanUndeclaredProperty'], 'htdocs/ticket/class/actions_ticket.class.php' => ['PhanUndeclaredProperty'], @@ -622,7 +605,6 @@ return [ 'htdocs/workstation/workstation_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/zapier/class/api_zapier.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/zapier/class/hook.class.php' => ['PhanUndeclaredProperty'], - 'internal' => ['PhanUndeclaredConstant'], ], // 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed. // (directory_suppressions will currently be ignored by subsequent calls to --save-baseline, but may be preserved in future Phan releases) diff --git a/phpstan.v1.neon b/dev/tools/phpstan/phpstan_v1_apstats.neon similarity index 99% rename from phpstan.v1.neon rename to dev/tools/phpstan/phpstan_v1_apstats.neon index b4c987d2c410f..6b59956030956 100644 --- a/phpstan.v1.neon +++ b/dev/tools/phpstan/phpstan_v1_apstats.neon @@ -48,6 +48,7 @@ parameters: treatPhpDocTypesAsCertain: false ignoreErrors: - '#.*phan-var#' + - '#is always#' internalErrorsCountLimit: 50 cache: nodesByFileCountMax: 512 diff --git a/dev/translation/ignore_translation_keys.lst b/dev/translation/ignore_translation_keys.lst index d870ff1504b07..9a34c97bc3f19 100644 --- a/dev/translation/ignore_translation_keys.lst +++ b/dev/translation/ignore_translation_keys.lst @@ -580,7 +580,6 @@ NewProperty NoActiveEstablishmentDefined NoAddMember NoAuthorityURLDefined -NoBankAccountFound NoCurrencyRateSelected NoEntriesToShow NoEstablishmentFound diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index e5a37b8b70903..8790cb6c9bc8c 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -54,14 +54,6 @@ $search_label = GETPOST('search_label', 'alpha'); $search_type = GETPOST('search_type', 'intcomma'); -// Security check -if ($user->socid > 0) { - accessforbidden(); -} -if (!$user->hasRight('accounting', 'chartofaccount')) { - accessforbidden(); -} - // Load variable for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -92,6 +84,14 @@ unset($arrayfields['reconcilable']); } +// Security check +if ($user->socid > 0) { + accessforbidden(); +} +if (!$user->hasRight('accounting', 'chartofaccount')) { // after this test, $user->hasRight('accounting', 'chartofaccount') is always valid + accessforbidden(); +} + /* * Actions @@ -124,6 +124,13 @@ $search_type = ""; $search_array_options = array(); } + + if ($action == 'enable' /* && $user->hasRight('accounting', 'chartofaccount') */) { // test useless + setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'errors'); + } + if ($action == 'disable' /* && $user->hasRight('accounting', 'chartofaccount') */) { + setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'errors'); + } } @@ -142,7 +149,7 @@ // Customer -$sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '1' as type, sa.entity, sa.client as nature"; +$sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '1' as type, sa.entity, sa.client as nature, sa.fournisseur as nature2"; $sql .= " FROM ".MAIN_DB_PREFIX."societe sa"; $sql .= " WHERE sa.entity IN (".getEntity('societe').")"; $sql .= " AND sa.code_compta <> ''"; @@ -163,7 +170,6 @@ } } - //var_dump($search_subaccount); exit; if ($search_subaccount_tmp) { if ($weremovedsomezero) { $search_subaccount_tmp_clean = $search_subaccount_tmp; @@ -190,7 +196,8 @@ // Supplier $sql .= " UNION "; -$sql .= " SELECT sa.rowid, sa.nom as label, sa.code_compta_fournisseur as subaccount, '2' as type, sa.entity, '0' as nature FROM ".MAIN_DB_PREFIX."societe sa"; +$sql .= " SELECT sa.rowid, sa.nom as label, sa.code_compta_fournisseur as subaccount, '2' as type, sa.entity, sa.client as nature, sa.fournisseur as nature2"; +$sql .= " FROM ".MAIN_DB_PREFIX."societe sa"; $sql .= " WHERE sa.entity IN (".getEntity('societe').")"; $sql .= " AND sa.code_compta_fournisseur <> ''"; //print $sql; @@ -237,7 +244,8 @@ // User - Employee $sql .= " UNION "; -$sql .= " SELECT u.rowid, u.lastname as label, u.accountancy_code as subaccount, '3' as type, u.entity, '0' as nature FROM ".MAIN_DB_PREFIX."user u"; +$sql .= " SELECT u.rowid, u.lastname as label, u.accountancy_code as subaccount, '3' as type, u.entity, '0' as nature, '0' as nature2"; +$sql .= " FROM ".MAIN_DB_PREFIX."user u"; $sql .= " WHERE u.entity IN (".getEntity('user').")"; $sql .= " AND u.accountancy_code <> ''"; //print $sql; @@ -368,7 +376,7 @@ print ''; } if (!empty($arrayfields['type']['checked'])) { - print ''; + print ''; } if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { if (!empty($arrayfields['reconcilable']['checked'])) { @@ -409,12 +417,25 @@ } print "\n"; + $companystatic = new Societe($db); + $totalarray = array(); $totalarray['nbfield'] = 0; $i = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); + if ($obj->type == 1) { + $companystatic->id = $obj->id; + $companystatic->client = $obj->nature; + $companystatic->fournisseur = 0; + } + if ($obj->type == 2) { + $companystatic->id = $obj->id; + $companystatic->client = 0; + $companystatic->fournisseur = $obj->nature2; + } + print ''; // Action column @@ -466,7 +487,12 @@ // Customer if ($obj->type == 1) { - $s .= ''.$langs->trans("Customer").''; + $s .= ''; + $s .= $langs->trans("Customer"); + $s .= ''; + if ($obj->nature == 2) { + $s .= ' ('.$langs->trans("Prospect").')'; + } } elseif ($obj->type == 2) { // Supplier $s .= ''.$langs->trans("Supplier").''; @@ -475,9 +501,6 @@ $s .= ''.$langs->trans("Employee").''; } print $s; - if ($obj->nature == 2) { - print ' ('.$langs->trans("Prospect").')'; - } print ''; if (!$i) { $totalarray['nbfield']++; @@ -489,11 +512,11 @@ if (!empty($arrayfields['reconcilable']['checked'])) { print '\n"; // Publish member information on public annuary -$linkofpubliclist = DOL_MAIN_URL_ROOT.'/public/members/public_list.php'.((isModEnabled('multicompany')) ? '?entity='.((int) $conf->entity) : ''); -print '\n"; +/* Feature disabled by default for security purpose. + $linkofpubliclist = DOL_MAIN_URL_ROOT.'/public/members/public_list.php'.((isModEnabled('multicompany')) ? '?entity='.((int) $conf->entity) : ''); + print '\n"; +*/ // Allow members to change type on renewal forms /* To test during next beta diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php index e80c263c78e25..630205413d3f7 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php @@ -19,8 +19,11 @@ /** * @var Adherent $object + * @var Canvas $this * @var Conf $conf * @var Translate $langs + * + * @var string $canvas */ // Protection to avoid direct call of template diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php index 0b19fcb851a33..626833d838544 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2012 Philippe Grand +/* Copyright (C) 2010 Regis Houssin + * Copyright (C) 2012 Philippe Grand * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -19,8 +19,11 @@ /** * @var Adherent $object + * @var Canvas $this * @var Conf $conf * @var Translate $langs + * + * @var string $canvas */ // Protection to avoid direct call of template diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php index 30bd5eded837b..54c3acafa6ac6 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2012-2022 Philippe Grand +/* Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2012-2022 Philippe Grand * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -19,9 +19,12 @@ /** * @var Adherent $object + * @var Canvas $this * @var Conf $conf * @var Translate $langs * @var User $user + * + * @var string $canvas */ // Protection to avoid direct call of template diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 153644333b709..c4ea3c8fbce51 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1126,9 +1126,9 @@ function refreshNatureCss() { // State if (!getDolGlobalString('MEMBER_DISABLE_STATE')) { print ''; - print ''; + print ''; // Website print ''; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 7ad5ee54ee71b..a401823fc3c1c 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -43,7 +43,7 @@ /** - * Class to manage members of a foundation + * Class to manage members of a foundation. */ class Adherent extends CommonObject { @@ -236,12 +236,12 @@ class Adherent extends CommonObject public $need_subscription; /** - * @var int user_id + * @var int|null user_id */ public $user_id; /** - * @var string user_login + * @var string|null user_login */ public $user_login; @@ -254,32 +254,32 @@ class Adherent extends CommonObject // Fields loaded by fetch_subscriptions() from member table /** - * @var int|string date + * @var int|string|null date */ public $first_subscription_date; /** - * @var int|string date + * @var int|string|null date */ public $first_subscription_date_start; /** - * @var int|string date + * @var int|string|null date */ public $first_subscription_date_end; /** - * @var int|string date + * @var int|string|null date */ public $first_subscription_amount; /** - * @var int|string date + * @var int|string|null date */ public $last_subscription_date; /** - * @var int|string date + * @var int|string|null date */ public $last_subscription_date_start; @@ -317,7 +317,7 @@ class Adherent extends CommonObject /** - * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), @@ -374,7 +374,7 @@ class Adherent extends CommonObject */ const STATUS_VALIDATED = 1; /** - * Resiliated + * Resiliated (membership end and was not renew) */ const STATUS_RESILIATED = 0; /** @@ -829,7 +829,8 @@ public function update($user, $notrigger = 0, $nosyncuser = 0, $nosyncuserpass = $sql .= ", fk_user_mod = ".($user->id > 0 ? $user->id : 'null'); // Can be null because member can be create by a guest $sql .= " WHERE rowid = ".((int) $this->id); - // If we change the type of membership, we set also label of new type + // If we change the type of membership, we set also label of new type.. + '@phan-var-force Adherent $oldcopy'; if (!empty($this->oldcopy) && $this->typeid != $this->oldcopy->typeid) { $sql2 = "SELECT libelle as label"; $sql2 .= " FROM ".MAIN_DB_PREFIX."adherent_type"; @@ -3076,11 +3077,13 @@ public function sendReminderForExpiredSubscription($daysbeforeendlist = '10', $f $tmp = dol_getdate($now); $datetosearchfor = dol_time_plus_duree(dol_mktime(0, 0, 0, $tmp['mon'], $tmp['mday'], $tmp['year'], 'tzserver'), (int) $daysbeforeend, 'd'); + $datetosearchforend = dol_time_plus_duree(dol_mktime(23, 59, 59, $tmp['mon'], $tmp['mday'], $tmp['year'], 'tzserver'), (int) $daysbeforeend, 'd'); $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'adherent'; $sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity('adherent').")" here, we want the batch to be on its entity only; $sql .= " AND statut = 1"; - $sql .= " AND datefin = '".$this->db->idate($datetosearchfor)."'"; + $sql .= " AND datefin >= '".$this->db->idate($datetosearchfor)."'"; + $sql .= " AND datefin <= '".$this->db->idate($datetosearchforend)."'"; if ((int) $fk_adherent_type > 0) { $sql .= " AND fk_adherent_type = ".((int) $fk_adherent_type); } @@ -3104,11 +3107,14 @@ public function sendReminderForExpiredSubscription($daysbeforeendlist = '10', $f $nbko++; $listofmembersko[$adherent->id] = $adherent->id; } else { - $adherent->fetch_thirdparty(); - - // Language code to use ($languagecodeformember) is default language of thirdparty, if no thirdparty, the language found from country of member then country of thirdparty, and if still not found we use the language of company. - $languagefromcountrycode = getLanguageCodeFromCountryCode($adherent->country_code ? $adherent->country_code : $adherent->thirdparty->country_code); - $languagecodeformember = (empty($adherent->thirdparty->default_lang) ? ($languagefromcountrycode ? $languagefromcountrycode : $mysoc->default_lang) : $adherent->thirdparty->default_lang); + $thirdpartyres = $adherent->fetch_thirdparty(); + if ($thirdpartyres === -1) { + $languagecodeformember = $mysoc->default_lang; + } else { + // Language code to use ($languagecodeformember) is default language of thirdparty, if no thirdparty, the language found from country of member then country of thirdparty, and if still not found we use the language of company. + $languagefromcountrycode = getLanguageCodeFromCountryCode($adherent->country_code ? $adherent->country_code : $adherent->thirdparty->country_code); + $languagecodeformember = (empty($adherent->thirdparty->default_lang) ? ($languagefromcountrycode ? $languagefromcountrycode : $mysoc->default_lang) : $adherent->thirdparty->default_lang); + } // Send reminder email $outputlangs = new Translate('', $conf); diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index dee174fb5db22..f31f75ea7b17d 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -98,7 +98,7 @@ class Subscription extends CommonObject public $fk_bank; /** - * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 8769e9916ccdc..21f24487c24c3 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -235,10 +235,10 @@ $massaction = ''; } -$permissiontoread = ($user->hasRight('adherent', 'lire') == 1); -$permissiontodelete = ($user->hasRight('adherent', 'supprimer') == 1); -$permissiontoadd = ($user->hasRight('adherent', 'creer') == 1); -$uploaddir = $conf->adherent->dir_output; +$permissiontoread = $user->hasRight('adherent', 'lire'); +$permissiontodelete = $user->hasRight('adherent', 'supprimer'); +$permissiontoadd = $user->hasRight('adherent', 'creer'); +$uploaddir = $conf->member->dir_output; $error = 0; $parameters = array('socid' => isset($socid) ? $socid : null, 'arrayfields' => &$arrayfields); @@ -280,7 +280,6 @@ $search_filter = ""; $search_status = ""; $search_import_key = ''; - $catid = ""; $search_all = ""; $toselect = array(); $search_datec_start = ''; @@ -523,7 +522,7 @@ $sql .= natural_search("d.firstname", $search_firstname); } if ($search_lastname) { - $sql .= natural_search(array("d.firstname", "d.lastname", "d.societe"), $search_lastname); + $sql .= natural_search("d.lastname", $search_lastname); } if ($search_gender != '' && $search_gender != '-1') { $sql .= natural_search("d.gender", $search_gender); @@ -532,7 +531,7 @@ $sql .= natural_search("d.login", $search_login); } if ($search_company) { - $sql .= natural_search("s.nom", $search_company); + $sql .= natural_search(array("s.nom", "d.societe"), $search_company); } if ($search_email) { $sql .= natural_search("d.email", $search_email); diff --git a/htdocs/adherents/messaging.php b/htdocs/adherents/messaging.php index af48d7cf822c1..de637315753f4 100644 --- a/htdocs/adherents/messaging.php +++ b/htdocs/adherents/messaging.php @@ -81,7 +81,10 @@ if (!$sortorder) { $sortorder = 'DESC,DESC'; } - +$socid = GETPOSTINT('socid'); +if ($user->socid > 0) { + $socid = $user->socid; +} // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('agendathirdparty', 'globalcard')); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 3b7b80d6935cf..069f89de048c0 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -179,35 +179,33 @@ if (empty($reshook) && $action == 'setsocid' && $permissiontoaddmember) { $error = 0; - if (!$error) { - if (GETPOSTINT('socid') != $object->socid) { // If link differs from currently in database - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; - $sql .= " WHERE fk_soc = ".((int) GETPOSTINT('socid')); - $resql = $db->query($sql); - if ($resql) { - $obj = $db->fetch_object($resql); - if ($obj && $obj->rowid > 0) { - $othermember = new Adherent($db); - $othermember->fetch($obj->rowid); - $thirdparty = new Societe($db); - $thirdparty->fetch(GETPOSTINT('socid')); - $error++; - setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name), null, 'errors'); - } + if (GETPOSTINT('socid') != $object->socid) { // If link differs from currently in database + $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "adherent"; + $sql .= " WHERE fk_soc = " . ((int) GETPOSTINT('socid')); + $resql = $db->query($sql); + if ($resql) { + $obj = $db->fetch_object($resql); + if ($obj && $obj->rowid > 0) { + $othermember = new Adherent($db); + $othermember->fetch($obj->rowid); + $thirdparty = new Societe($db); + $thirdparty->fetch(GETPOSTINT('socid')); + $error++; + setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name), null, 'errors'); } + } - if (!$error) { - $result = $object->setThirdPartyId(GETPOSTINT('socid')); - if ($result < 0) { - dol_print_error(null, $object->error); - } - $action = ''; + if (!$error) { + $result = $object->setThirdPartyId(GETPOSTINT('socid')); + if ($result < 0) { + dol_print_error(null, $object->error); } + $action = ''; } } } -if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'subscription' && !$cancel) { +if (empty($reshook) && $user->hasRight('adherent', 'cotisation', 'creer') && $action == 'subscription' && !$cancel) { $error = 0; $langs->load("banks"); @@ -701,7 +699,7 @@ if ($action != 'addsubscription' && $action != 'create_thirdparty') { print '
'; - if ($object->statut > 0) { + if ($object->status > 0) { print '"; } else { print ''; diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index aa50ccc6a4f58..c34a84824cc32 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -63,7 +63,7 @@ $search_note = GETPOST('search_note', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); -$search_all = ''; +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $date_select = GETPOST("date_select", 'alpha'); @@ -98,6 +98,8 @@ // List of fields to search into when doing a "search in all" $fieldstosearchall = array( + 'c.rowid' => 'Ref', + 'c.note' => "Label", ); $arrayfields = array( 'd.ref' => array('label' => "Ref", 'checked' => 1), @@ -105,7 +107,7 @@ 'd.lastname' => array('label' => "Lastname", 'checked' => 1), 'd.firstname' => array('label' => "Firstname", 'checked' => 1), 'd.login' => array('label' => "Login", 'checked' => 1), - 't.libelle' => array('label' => "Label", 'checked' => 1), + 'c.note' => array('label' => "Label", 'checked' => 1), 'd.bank' => array('label' => "BankAccount", 'checked' => 1, 'enabled' => (isModEnabled('bank'))), /*'d.note_public'=>array('label'=>"NotePublic", 'checked'=>0), 'd.note_private'=>array('label'=>"NotePrivate", 'checked'=>0),*/ @@ -166,7 +168,7 @@ // Mass actions $objectclass = 'Subscription'; $objectlabel = 'Subscription'; - $uploaddir = $conf->adherent->dir_output; + $uploaddir = $conf->member->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -395,7 +397,6 @@ if ($search_all) { $setupstring = ''; - // @phan-suppress-next-line PhanEmptyForeach foreach ($fieldstosearchall as $key => $val) { $fieldstosearchall[$key] = $langs->trans($val); $setupstring .= $key."=".$val.";"; @@ -474,7 +475,7 @@ print ''; } -if (!empty($arrayfields['t.libelle']['checked'])) { +if (!empty($arrayfields['c.note']['checked'])) { print '
'; @@ -557,8 +558,8 @@ print_liste_field_titre($arrayfields['d.login']['label'], $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder); $totalarray['nbfield']++; } -if (!empty($arrayfields['t.libelle']['checked'])) { - print_liste_field_titre($arrayfields['t.libelle']['label'], $_SERVER["PHP_SELF"], "c.note", $param, "", '', $sortfield, $sortorder); +if (!empty($arrayfields['c.note']['checked'])) { + print_liste_field_titre($arrayfields['c.note']['label'], $_SERVER["PHP_SELF"], "c.note", $param, "", '', $sortfield, $sortorder); $totalarray['nbfield']++; } if (!empty($arrayfields['d.bank']['checked'])) { @@ -725,7 +726,7 @@ } // Label - if (!empty($arrayfields['t.libelle']['checked'])) { + if (!empty($arrayfields['c.note']['checked'])) { print ''; diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index c4490d27cb843..e0cff71b11ed1 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -223,11 +223,11 @@ $selectedvalue = 1; } -print "
Commit IDDateReported on
Yogosha
Reported on
GIT
Reported on
CVE
TitleBranch of fix
Commit IDDateReported on
Yogosha
Reported on
GIT
Reported on
CVE
TitleBranch of fix
'.dol_print_date($db->jdate($obj->periode), 'day').''.dol_print_date($db->jdate($obj->period), 'day').''.$langs->trans("Referers").''.$langs->trans("NbOfMembers").' ('.$langs->trans("AllTime").')
'.$langs->trans("Period")."".dol_print_date($charge->periode, 'day')."
'.$form->selectarray('search_type', array('1'=>$langs->trans('Customer'), '2'=>$langs->trans('Supplier'), '3'=>$langs->trans('Employee')), $search_type, 1).''.$form->selectarray('search_type', array('1'=>$langs->trans('Customer').' / '.$langs->trans("Prospect"), '2'=>$langs->trans('Supplier'), '3'=>$langs->trans('Employee')), $search_type, 1).'
'; if (empty($obj->reconcilable)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index ebf0dec33965b..60409e47f0f68 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -495,6 +495,8 @@ $permissiontodelete = $user->hasRight('societe', 'supprimer'); $permissiontoadd = $user->hasRight('societe', 'creer'); $uploaddir = $conf->societe->dir_output; + + global $error; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; if (!$error && $action == 'deletebookkeepingwriting' && $confirm == "yes" && $user->hasRight('accounting', 'mouvements', 'supprimer')) { diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 62c058fbf958c..7834b2a6d0fd2 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -459,6 +459,8 @@ $permissiontodelete = $user->hasRight('societe', 'supprimer'); $permissiontoadd = $user->hasRight('societe', 'creer'); $uploaddir = $conf->societe->dir_output; + + global $error; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; if (!$error && $action == 'deletebookkeepingwriting' && $confirm == "yes" && $user->hasRight('accounting', 'mouvements', 'supprimer')) { diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index d71dc306478c1..379e2b802e152 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2016 Jamal Elbaz * Copyright (C) 2016-2017 Alexandre Spangaro * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * 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 @@ -129,7 +129,7 @@ class AccountancyCategory // extends CommonObject public $sdc; /** - * @var array Sum debit credit per month + * @var array Sum debit credit per month */ public $sdcpermonth; diff --git a/htdocs/accountancy/class/accountancyimport.class.php b/htdocs/accountancy/class/accountancyimport.class.php index bcf7905f223fa..a35235e0218fc 100644 --- a/htdocs/accountancy/class/accountancyimport.class.php +++ b/htdocs/accountancy/class/accountancyimport.class.php @@ -136,7 +136,7 @@ public function computeDirection(&$arrayrecord, $listfields, $record_key) $sens = 'C'; } - return "'" . $this->db->escape($sens) . "'"; + return $sens; } return "''"; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 53e6efa493495..f8573c3f75e71 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -3,7 +3,8 @@ * Copyright (C) 2015-2022 Alexandre Spangaro * Copyright (C) 2015-2020 Florian Henry * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Jose MARTINEZ * * 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 @@ -68,7 +69,7 @@ class BookKeeping extends CommonObject public $doc_date; /** - * @var int Deadline for payment + * @var int|null|'' Deadline for payment */ public $date_lim_reglement; @@ -324,7 +325,7 @@ public function create(User $user, $notrigger = 0) $this->piece_num = 0; // First check if line not yet already in bookkeeping. - // Note that we must include 'doc_type - fk_doc - numero_compte - label' to be sure to have unicity of line (because we may have several lines + // Note that we must include 'doc_type - fk_doc - numero_compte - label - subledger_account (if not empty)' to be sure to have unicity of line (because we may have several lines // with same doc_type, fk_doc, numero_compte for 1 invoice line when using localtaxes with same account) // WARNING: This is not reliable, label may have been modified. This is just a small protection. // The page that make transfer make the test on couple (doc_type - fk_doc) only. @@ -338,6 +339,9 @@ public function create(User $user, $notrigger = 0) } $sql .= " AND numero_compte = '".$this->db->escape($this->numero_compte)."'"; $sql .= " AND label_operation = '".$this->db->escape($this->label_operation)."'"; + if (!empty($this->subledger_account)) { + $sql .= " AND subledger_account = '".$this->db->escape($this->subledger_account)."'"; + } $sql .= " AND entity = ".$conf->entity; // Do not use getEntity for accounting features $resql = $this->db->query($sql); @@ -2863,10 +2867,8 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep $sql = 'SELECT'; $sql .= " t.numero_compte,"; - $sql .= " t.label_compte,"; if ($separate_auxiliary_account) { - $sql .= " t.subledger_account,"; - $sql .= " t.subledger_label,"; + $sql .= " NULLIF(t.subledger_account, '') as subledger_account,"; // fix db issues with Null or "" values } $sql .= " aa.pcg_type,"; $sql .= " (SUM(t.credit) - SUM(t.debit)) as opening_balance"; @@ -2878,10 +2880,11 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep $sql .= ' AND aa.pcg_type IN (' . $this->db->sanitize(implode(',', $pcg_type_filter), 1) . ')'; $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'"; $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'"; - $sql .= ' GROUP BY t.numero_compte, t.label_compte, aa.pcg_type'; + $sql .= ' GROUP BY t.numero_compte, aa.pcg_type'; if ($separate_auxiliary_account) { - $sql .= ' ,t.subledger_account, t.subledger_label'; + $sql .= " , NULLIF(t.subledger_account, '')"; } + $sql .= ' HAVING (SUM(t.credit) - SUM(t.debit)) != 0 '; // Exclude rows with opening_balance = 0 $sql .= $this->db->order("t.numero_compte", "ASC"); $resql = $this->db->query($sql); @@ -2902,24 +2905,41 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep $bookkeeping = new BookKeeping($this->db); $bookkeeping->doc_date = $new_fiscal_period->date_start; - $bookkeeping->date_lim_reglement = 0; - $bookkeeping->doc_ref = $new_fiscal_period->label; + + $bookkeeping->date_lim_reglement = ''; + $bookkeeping->doc_ref = $fiscal_period->label; + $bookkeeping->date_creation = $now; $bookkeeping->doc_type = 'closure'; - $bookkeeping->fk_doc = $new_fiscal_period->id; + $bookkeeping->fk_doc = $fiscal_period->id; $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add $bookkeeping->thirdparty_code = ''; if ($separate_auxiliary_account) { $bookkeeping->subledger_account = $obj->subledger_account; - $bookkeeping->subledger_label = $obj->subledger_label; + $sql = 'SELECT'; + $sql .= " subledger_label"; + $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element; + $sql .= " WHERE subledger_account = '" . $this->db->escape($obj->subledger_account) . "'"; + $sql .= " ORDER BY doc_date DESC"; + $sql .= " LIMIT 1"; + $result = $this->db->query($sql); + if (!$result) { + $this->errors[] = 'Error: ' . $this->db->lasterror(); + dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); + $error++; + } + $objtmp = $this->db->fetch_object($result); + $bookkeeping->subledger_label = $objtmp->subledger_label; // latest subledger label used } else { - $bookkeeping->subledger_account = ''; - $bookkeeping->subledger_label = ''; + $bookkeeping->subledger_account = null; + $bookkeeping->subledger_label = null; } $bookkeeping->numero_compte = $obj->numero_compte; - $bookkeeping->label_compte = $obj->label_compte; + $accountingaccount = new AccountingAccount($this->db); + $accountingaccount->fetch(0, $obj->numero_compte); + $bookkeeping->label_compte = $accountingaccount->label; // latest account label used $bookkeeping->label_operation = $new_fiscal_period->label; $bookkeeping->montant = $mt; @@ -2933,8 +2953,7 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep $result = $bookkeeping->create($user); if ($result < 0) { - $this->error = $bookkeeping->error; - $this->errors = $bookkeeping->errors; + $this->setErrorsFromObject($bookkeeping); $error++; break; } @@ -2949,21 +2968,35 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep $bookkeeping = new BookKeeping($this->db); $bookkeeping->doc_date = $new_fiscal_period->date_start; - $bookkeeping->date_lim_reglement = 0; - $bookkeeping->doc_ref = $new_fiscal_period->label; + + $bookkeeping->date_lim_reglement = ''; + $bookkeeping->doc_ref = $fiscal_period->label; + $bookkeeping->date_creation = $now; $bookkeeping->doc_type = 'closure'; - $bookkeeping->fk_doc = $new_fiscal_period->id; + $bookkeeping->fk_doc = $fiscal_period->id; $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add $bookkeeping->thirdparty_code = ''; if ($separate_auxiliary_account) { - $bookkeeping->subledger_label = ''; $bookkeeping->subledger_account = $obj->subledger_account; - $bookkeeping->subledger_label = $obj->subledger_label; + $sql = 'SELECT'; + $sql .= " subledger_label"; + $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element; + $sql .= " WHERE subledger_account = '" . $this->db->escape($obj->subledger_account) . "'"; + $sql .= " ORDER BY doc_date DESC"; + $sql .= " LIMIT 1"; + $result = $this->db->query($sql); + if (!$result) { + $this->errors[] = 'Error: ' . $this->db->lasterror(); + dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); + $error++; + } + $objtmp = $this->db->fetch_object($result); + $bookkeeping->subledger_label = $objtmp->subledger_label; // latest subledger label used } else { - $bookkeeping->subledger_account = ''; - $bookkeeping->subledger_label = ''; + $bookkeeping->subledger_account = null; + $bookkeeping->subledger_label = null; } $bookkeeping->numero_compte = $accountingaccount->account_number; @@ -2981,8 +3014,7 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep $result = $bookkeeping->create($user); if ($result < 0) { - $this->error = $bookkeeping->error; - $this->errors = $bookkeeping->errors; + $this->setErrorsFromObject($bookkeeping); $error++; } } diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 923f977c544f8..964369fb54576 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -864,14 +864,14 @@ public function getLinkedDocumentByGroup($document_ids, $doc_type) $sql = "SELECT DISTINCT tl2.fk_link, tl2.fk_doc"; $sql .= " FROM ("; // @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset - $sql .= " SELECT DISTINCT " . $this->db->ifsql("tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tl.".$this->db->sanitize($linked_info['fk_link']))." AS fk_link, tl.".$this->db->sanitize($linked_info['fk_doc'])." AS fk_doc"; + $sql .= " SELECT DISTINCT " . $this->db->ifsql("tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent'])." IS NOT NULL", "tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tl.".$this->db->sanitize($linked_info['fk_link']))." AS fk_link, tl.".$this->db->sanitize($linked_info['fk_doc'])." AS fk_doc"; $sql .= " FROM " . MAIN_DB_PREFIX .$this->db->sanitize($linked_info['table'])." AS tl"; // @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $this->db->sanitize($linked_info['table_link_line']) . " AS tll ON tll.".$this->db->sanitize($linked_info['fk_table_link_line']) . " = tl.".$this->db->sanitize($linked_info['fk_line_link']); $sql .= ") AS tl"; $sql .= " LEFT JOIN ("; // @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset - $sql .= " SELECT DISTINCT " . $this->db->ifsql("tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tl.".$this->db->sanitize($linked_info['fk_link']))." AS fk_link, tl.".$this->db->sanitize($linked_info['fk_doc'])." AS fk_doc"; + $sql .= " SELECT DISTINCT " . $this->db->ifsql("tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent'])." IS NOT NULL", "tll.".$this->db->sanitize($linked_info['fk_table_link_line_parent']), "tl.".$this->db->sanitize($linked_info['fk_link']))." AS fk_link, tl.".$this->db->sanitize($linked_info['fk_doc'])." AS fk_doc"; $sql .= " FROM " . MAIN_DB_PREFIX .$this->db->sanitize($linked_info['table'])." AS tl"; // @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $this->db->sanitize($linked_info['table_link_line']) . " AS tll ON tll.".$this->db->sanitize($linked_info['fk_table_link_line']) . " = tl.".$this->db->sanitize($linked_info['fk_line_link']); diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index ecf9ce56121b4..2b166dff8d9f4 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -461,12 +461,12 @@ fk_facture, COUNT(fd.rowid) as nb FROM - ".MAIN_DB_PREFIX."facturedet as fd + ".MAIN_DB_PREFIX."facturedet as fd WHERE fd.product_type <= 2 AND fd.fk_code_ventilation <= 0 AND fd.total_ttc <> 0 - AND fk_facture IN (".$db->sanitize(implode(",", array_keys($tabfac))).") + AND fk_facture IN (".$db->sanitize(implode(",", array_keys($tabfac))).") GROUP BY fk_facture "; $resql = $db->query($sql); diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 472a376635ae7..b8d13a3737797 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -127,7 +127,9 @@ $res3 = dolibarr_set_const($db, 'ADHERENT_DEFAULT_SENDINFOBYMAIL', GETPOST('ADHERENT_DEFAULT_SENDINFOBYMAIL', 'alpha'), 'chaine', 0, '', $conf->entity); $res3 = dolibarr_set_const($db, 'ADHERENT_CREATE_EXTERNAL_USER_LOGIN', GETPOST('ADHERENT_CREATE_EXTERNAL_USER_LOGIN', 'alpha'), 'chaine', 0, '', $conf->entity); $res4 = dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity); - $res7 = dolibarr_set_const($db, 'MEMBER_PUBLIC_ENABLED', GETPOST('MEMBER_PUBLIC_ENABLED', 'alpha'), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MEMBER_PUBLIC_ENABLED')) { + $res7 = dolibarr_set_const($db, 'MEMBER_PUBLIC_ENABLED', GETPOST('MEMBER_PUBLIC_ENABLED', 'alpha'), 'chaine', 0, '', $conf->entity); + } $res8 = dolibarr_set_const($db, 'MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF', GETPOST('MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF', 'alpha'), 'chaine', 0, '', $conf->entity); $res9 = dolibarr_set_const($db, 'MEMBER_SUBSCRIPTION_START_AFTER', GETPOST('MEMBER_SUBSCRIPTION_START_AFTER', 'alpha'), 'chaine', 0, '', $conf->entity); // Use vat for invoice creation @@ -138,7 +140,7 @@ $res6 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); } } - if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0 || $res7 < 0) { + if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0 || $res7 < 0 || $res8 < 0 || $res9 < 0) { setEventMessages('ErrorFailedToSaveData', null, 'errors'); $db->rollback(); } else { @@ -549,10 +551,12 @@ print "
'.$langs->trans("Public", getDolGlobalString('MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist).''; -print $form->selectyesno('MEMBER_PUBLIC_ENABLED', getDolGlobalInt('MEMBER_PUBLIC_ENABLED'), 1, false, 0, 1); -print "
'.$langs->trans("Public", getDolGlobalString('MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist).''; + print $form->selectyesno('MEMBER_PUBLIC_ENABLED', getDolGlobalInt('MEMBER_PUBLIC_ENABLED'), 1, false, 0, 1); + print "
'.$langs->trans('State').''; - if ($soc->country_id) { + if ($soc->country_id || GETPOSTISSET('country_id')) { print img_picto('', 'state', 'class="pictofixedwidth"'); - print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : $soc->state_id, $soc->country_code); + print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : $soc->state_id, GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : $soc->country_code); } else { print $countrynotdefined; } @@ -1351,7 +1351,7 @@ function initfieldrequired() { // EMail print '
'.(getDolGlobalString("ADHERENT_MAIL_REQUIRED") ? '' : '').$langs->trans("EMail").(getDolGlobalString("ADHERENT_MAIL_REQUIRED") ? '' : '').''.img_picto('', 'object_email', 'class="pictofixedwidth"').'email).'">
'.img_picto('', 'object_email', 'class="pictofixedwidth"').'email).'">
'.$form->editfieldkey('Web', 'member_url', GETPOST('member_url', 'alpha'), $object, 0).''; print ''; print ''; print dol_escape_htmltag(dolGetFirstLineOfText($obj->note_private)); print '
"; +print "
"; print ""; print '"; -print '"; +print ''; print ""; // Show external agenda diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index fcf6023b8348b..5f50050e53c6b 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -53,6 +53,7 @@ $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php $param = GETPOST('param', 'alpha'); @@ -221,7 +222,7 @@ $sql = "SELECT nom"; $sql .= " FROM ".MAIN_DB_PREFIX."document_model"; $sql .= " WHERE type = 'action'"; -$sql .= " AND entity = ".$conf->entity; +$sql .= " AND entity = ".((int) $conf->entity); $resql = $db->query($sql); if ($resql) { @@ -346,7 +347,7 @@ print ''."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; // AGENDA_DEFAULT_VIEW diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index d27d081d66e40..14821a3da45e2 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -48,6 +48,7 @@ $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php $param = GETPOST('param', 'alpha'); @@ -182,7 +183,7 @@ print ''."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; // AGENDA REMINDER BROWSER diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 6c065ba69e3c0..3d380e1134486 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -121,7 +121,7 @@ print ''; print ""; -print ""; +print ""; //print ""; print ""; print ""; @@ -180,8 +180,8 @@ clearstatcache(); -//if ($mesg) print "
$mesg
"; -print "
"; + +print "

"; // Define $urlwithroot diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 3eb837e7a5fe3..360488a241015 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2011-2023 Alexandre Spangaro + * Copyright (C) 2011-2024 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2019-2024 Frédéric France @@ -723,10 +723,8 @@ 'supplier_proposal' => img_picto('', 'supplier_proposal', 'class="pictofixedwidth"').$langs->trans('SupplierProposal'), 'order_supplier' => img_picto('', 'supplier_order', 'class="pictofixedwidth"').$langs->trans('SupplierOrder'), 'invoice_supplier' => img_picto('', 'supplier_invoice', 'class="pictofixedwidth"').$langs->trans('SupplierBill'), + 'conferenceorbooth' => img_picto('', 'eventorganization', 'class="pictofixedwidth"').$langs->trans('ConferenceOrBooth'), ); - if (getDolGlobalString('MAIN_FEATURES_LEVEL') && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { - $elementList['conferenceorbooth'] = img_picto('', 'eventorganization', 'class="pictofixedwidth"').$langs->trans('ConferenceOrBooth'); - } complete_elementList_with_modules($elementList); @@ -1146,7 +1144,7 @@ $tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename); if ($rowid) { - $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); + $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 1 WHERE ".$db->escape($rowidcol)." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } elseif ($code) { $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); } else { @@ -1158,7 +1156,7 @@ if (!$result) { dol_print_error($db); } - } { + } else { dol_print_error(null, "No DB entry or no code"); } } @@ -1187,7 +1185,7 @@ if (!$result) { dol_print_error($db); } - } { + } else { dol_print_error(null, "No DB entry or no code"); } } @@ -1216,7 +1214,7 @@ if (!$result) { dol_print_error($db); } - } { + } else { dol_print_error(null, "No DB entry or no code"); } } @@ -1245,7 +1243,7 @@ if (!$result) { dol_print_error($db); } - } { + } else { dol_print_error(null, "No DB entry or no code"); } } @@ -1274,7 +1272,7 @@ if (!$result) { dol_print_error($db); } - } { + } else { dol_print_error(null, "No DB entry or no code"); } } @@ -1303,7 +1301,7 @@ if (!$result) { dol_print_error($db); } - } { + } else { dol_print_error(null, "No DB entry or no code"); } } @@ -1381,7 +1379,26 @@ $tablecode = 't.code'; $tableprefix = ''; - $tableprefixarray = array(DICT_FORME_JURIDIQUE => 'f.code', DICT_DEPARTEMENTS => 'd.code_departement', DICT_REGIONS => 'r.code_region', DICT_COUNTRY => 'c.code', DICT_CIVILITY => 'c.code', DICT_ACTIONCOMM => 'a.code', DICT_CURRENCIES => 'code_iso', DICT_ECOTAXE => 'e.code', DICT_HOLIDAY_TYPES => 'h.code', DICT_CHARGESOCIALES => 'a.code', DICT_HRM_PUBLIC_HOLIDAY => 'a.code', DICT_UNITS => 'r.code', DICT_SOCIALNETWORKS => 's.code', 45 => 'f.code', 46 => 'f.code', 47 => 'f.code', 48 => 'f.code'); + $tableprefixarray = array( + DICT_FORME_JURIDIQUE => 'f.code', + DICT_DEPARTEMENTS => 'd.code_departement', + DICT_REGIONS => 'r.code_region', + DICT_COUNTRY => 'c.code', + DICT_CIVILITY => 'c.code', + DICT_ACTIONCOMM => 'a.code', + DICT_CHARGESOCIALES => 'a.code', + DICT_TYPENT => 't.code', + DICT_CURRENCIES => 'c.code_iso', + DICT_ECOTAXE => 'e.code', + DICT_HOLIDAY_TYPES => 'h.code', + DICT_HRM_PUBLIC_HOLIDAY => 'a.code', + DICT_UNITS => 'r.code', + DICT_SOCIALNETWORKS => 's.code', + 45 => 'f.code', + 46 => 'f.code', + 47 => 'f.code', + 48 => 'f.code', + ); if (!empty($tableprefixarray[$id])) { $tablecode = $tableprefixarray[$id]; $tableprefix = preg_replace('/\..*$/', '.', $tablecode); diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 2fe24da05e96a..0aa392a0c528d 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -61,16 +61,16 @@ if (getDolGlobalString('MAIN_MOTD_SETUPPAGE')) { - $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace('//i', '
', $conf->global->MAIN_MOTD_SETUPPAGE); + $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace('//i', '
', getDolGlobalString('MAIN_MOTD_SETUPPAGE')); if (getDolGlobalString('MAIN_MOTD_SETUPPAGE')) { $i = 0; $reg = array(); - while (preg_match('/__\(([a-zA-Z|@]+)\)__/i', $conf->global->MAIN_MOTD_SETUPPAGE, $reg) && $i < 100) { + while (preg_match('/__\(([a-zA-Z|@]+)\)__/i', getDolGlobalString('MAIN_MOTD_SETUPPAGE'), $reg) && $i < 100) { $tmp = explode('|', $reg[1]); if (!empty($tmp[1])) { $langs->load($tmp[1]); } - $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace('/__\('.preg_quote($reg[1]).'\)__/i', $langs->trans($tmp[0]), $conf->global->MAIN_MOTD_SETUPPAGE); + $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace('/__\('.preg_quote($reg[1]).'\)__/i', $langs->trans($tmp[0]), getDolGlobalString('MAIN_MOTD_SETUPPAGE')); $i++; } diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 02714bc87df7a..afda0e317333f 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -55,7 +55,7 @@ $usersignature = $user->signature; // For action = test or send, we ensure that content is not html, even for signature, because for this we want a test with NO html. -if ($action == 'test' || ($action == 'send' && $trackid = 'test')) { +if ($action == 'test' || ($action == 'send' && $trackid == 'test')) { $usersignature = dol_string_nohtmltag($usersignature, 2); } @@ -412,7 +412,7 @@ function change_smtp_auth_method() { print ''; } else { print '
'; @@ -549,7 +549,7 @@ function change_smtp_auth_method() { print ''; - print ''; // DKIM Selector print ''; - print ''; // DKIM PRIVATE KEY print ''; - print ''; print '
'.$langs->trans("Parameter")."'.$langs->trans("Value")."
'.$langs->trans("Parameters").' '.$langs->trans("Value").'
'.$langs->trans("Parameters").' '.$langs->trans("Value").'
".$langs->trans("Parameter")."".$langs->trans("Value")."".$langs->trans("Examples")." 
'; - $mainserver = (getDolGlobalString('MAIN_MAIL_SMTP_SERVER') ? $conf->global->MAIN_MAIL_SMTP_SERVER : ''); + $mainserver = getDolGlobalString('MAIN_MAIL_SMTP_SERVER'); $smtpserver = ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined"); if ($linuxlike) { print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); @@ -443,7 +443,7 @@ function change_smtp_auth_method() { print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } else { - $mainport = (getDolGlobalString('MAIN_MAIL_SMTP_PORT') ? $conf->global->MAIN_MAIL_SMTP_PORT : ''); + $mainport = getDolGlobalString('MAIN_MAIL_SMTP_PORT'); $smtpport = ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined"); if ($linuxlike) { print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); @@ -495,14 +495,14 @@ function change_smtp_auth_method() { // ID if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { - $mainstmpid = (getDolGlobalString('MAIN_MAIL_SMTPS_ID') ? $conf->global->MAIN_MAIL_SMTPS_ID : ''); + $mainstmpid = getDolGlobalString('MAIN_MAIL_SMTPS_ID'); print '
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''; // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID, $htmltext, 1, 'superadmin'); + print $form->textwithpicto(getDolGlobalString('MAIN_MAIL_SMTPS_ID'), $htmltext, 1, 'superadmin'); print ''; } print '
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_TLS', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS') ? $conf->global->MAIN_MAIL_EMAIL_TLS : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_TLS', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS') ? getDolGlobalString('MAIN_MAIL_EMAIL_TLS') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -562,7 +562,7 @@ function change_smtp_auth_method() { print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS') ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS') ? getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -575,7 +575,7 @@ function change_smtp_auth_method() { print '
'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED') ? $conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED') ? getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -588,7 +588,7 @@ function change_smtp_auth_method() { print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").''; if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('swiftmailer')))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_DKIM_ENABLED', (getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_ENABLED') ? $conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_DKIM_ENABLED', (getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_ENABLED') ? getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_ENABLED') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -599,17 +599,17 @@ function change_smtp_auth_method() { // DKIM Domain print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_DOMAIN").'
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_SELECTOR").'
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY").''; + print ''; print '
'; @@ -632,13 +632,13 @@ function change_smtp_auth_method() { print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined")); print ' '.$help; print ''; - print ''; // Default from type $liste = array(); $liste['user'] = $langs->trans('UserEmail'); - $liste['company'] = $langs->trans('CompanyEmail').' ('.(!getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')'; + $liste['company'] = $langs->trans('CompanyEmail').' ('.(!getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') ? $langs->trans("NotDefined") : getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')).')'; print ''.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE'), 0); @@ -716,7 +716,7 @@ function change_smtp_auth_method() { if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) { //print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { - print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_SERVER') ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').''; + print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_SERVER').''; } @@ -724,7 +724,7 @@ function change_smtp_auth_method() { if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) { //print ''.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { - print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_PORT') ? $conf->global->MAIN_MAIL_SMTP_PORT : '').''; + print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_PORT').''; } // AUTH method @@ -909,7 +909,7 @@ function change_smtp_auth_method() { print '' . getDolGlobalString('MAIN_MAIL_EMAIL_FROM'); if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM')) { print img_warning($langs->trans("Mandatory")); - } elseif (!isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) { + } elseif (!isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM'))) { print img_warning($langs->trans("ErrorBadEMail")); } print ''; @@ -957,7 +957,7 @@ function change_smtp_auth_method() { // Errors To print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; print ''.(getDolGlobalString('MAIN_MAIL_ERRORS_TO')); - if (getDolGlobalString('MAIN_MAIL_ERRORS_TO') && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) { + if (getDolGlobalString('MAIN_MAIL_ERRORS_TO') && !isValidEmail(getDolGlobalString('MAIN_MAIL_ERRORS_TO'))) { print img_warning($langs->trans("ErrorBadEMail")); } print ''; @@ -1003,7 +1003,7 @@ function change_smtp_auth_method() { if (!getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) { if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') != 'mail' || !$linuxlike) { - if (function_exists('fsockopen') && $port && $server) { + if (function_exists('fsockopen') /* && $port && $server */) { // $port and $server can't be empty print ''.$langs->trans("DoTestServerAvailability").''; } } else { @@ -1044,24 +1044,39 @@ function change_smtp_auth_method() { // mthode php mail if (getDolGlobalString('MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD')) { // Not defined by default. Depend on platform. // List of string to add in SPF if the setup use the mail method. Example 'include:sendgrid.net include:spf.mydomain.com' - $text .= ($text ? '

' : '').$langs->trans("WarningPHPMailSPFDMARC"); + $text .= /* ($text ? '

' : ''). */$langs->trans("WarningPHPMailSPFDMARC"); } else { // MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'. if (getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS')) { // List of IP shown as record to add in SPF if we use the mail method - $text .= ($text ? '

' : '').$langs->trans("WarningPHPMailSPFDMARC"); + $text .= /* ($text ? '

' : ''). */$langs->trans("WarningPHPMailSPFDMARC"); } } } else { // method smtps or swiftmail if (getDolGlobalString('MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD')) { // Should be required only if you have preset the Dolibarr to use your own SMTP and you want to warn users to update their domain name to match your SMTP server. // List of string to add in SPF if we use the smtp method. Example 'include:spf.mydomain.com' - $text .= ($text ? '

' : '').$langs->trans("WarningPHPMailSPF", getDolGlobalString('MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD')); + $text .= /* ($text ? '

' : ''). */$langs->trans("WarningPHPMailSPF", getDolGlobalString('MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD')); } if (getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS')) { // Not defined by default. Depend on platform. + $ipstoshow = ''; // List of IP shown as record to add as allowed IP if we use the smtp method. Value is '1.2.3.4, [aaaa:bbbb:cccc:dddd]' - // TODO Add a key to allow to show the IP/name of server detected dynamically - $text .= ($text ? '

' : '').$langs->trans("WarningPHPMail2", getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS')); + $arrayipstoshow = explode(',', getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS')); + foreach ($arrayipstoshow as $iptoshow) { + // If MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is an URL to get/show the public IP/name of server detected dynamically + if (preg_match('/^http/i', $iptoshow)) { + $tmpresult = getURLContent($iptoshow, 'GET', '', 1, array(), array('http', 'https'), 0); + if (!empty($tmpresult['content'])) { + $iptoshow = $tmpresult['content']; + } else { + $iptoshow = ''; // Failed to get IP + } + } + $ipstoshow .= ($ipstoshow ? ', ' : '').trim($iptoshow); + } + if ($ipstoshow) { + $text .= ($text ? '

' : '').$langs->trans("WarningPHPMail2", $ipstoshow); + } } } diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 78d1e381804f4..e91f1058b3da9 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -363,7 +363,7 @@ function change_smtp_auth_method() { // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_EMAILING); + print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')); } else { $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')]; if (empty($text)) { @@ -386,7 +386,7 @@ function change_smtp_auth_method() { print ''; } else { print ''; - $mainserver = (getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING') ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : ''); + $mainserver = getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING'); $smtpserver = ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined"); if ($linuxlike) { print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); @@ -418,7 +418,7 @@ function change_smtp_auth_method() { print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } else { - $mainport = (getDolGlobalString('MAIN_MAIL_SMTP_PORT_EMAILING') ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : ''); + $mainport = getDolGlobalString('MAIN_MAIL_SMTP_PORT_EMAILING'); $smtpport = ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined"); if ($linuxlike) { print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); @@ -441,7 +441,7 @@ function change_smtp_auth_method() { print ''; // AUTH method - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").''; $vartosmtpstype = 'MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING'; if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { @@ -469,22 +469,22 @@ function change_smtp_auth_method() { } // ID - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { - $mainstmpid = (getDolGlobalString('MAIN_MAIL_SMTPS_ID_EMAILING') ? $conf->global->MAIN_MAIL_SMTPS_ID_EMAILING : ''); + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { + $mainstmpid = getDolGlobalString('MAIN_MAIL_SMTPS_ID_EMAILING'); print '' . $langs->trans("MAIN_MAIL_SMTPS_ID") . ''; // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin'); + print $form->textwithpicto(getDolGlobalString('MAIN_MAIL_SMTPS_ID_EMAILING'), $htmltext, 1, 'superadmin'); print ''; } print ''; } // PW - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { $mainsmtppw = getDolGlobalString('MAIN_MAIL_SMTPS_PW_EMAILING'); print '' . $langs->trans("MAIN_MAIL_SMTPS_PW") . ''; // SuperAdministrator access only @@ -499,13 +499,13 @@ function change_smtp_auth_method() { } // OAUTH service provider - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").''; // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { // @phan-suppress-next-line PhanPluginSuspiciousParamOrder - print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING); + print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING', $oauthservices, getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING')); } else { $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING')]; if (empty($text)) { @@ -521,9 +521,9 @@ function change_smtp_auth_method() { // TLS print ''.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_EMAILING', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS_EMAILING') ? $conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_EMAILING', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS_EMAILING') ? getDolGlobalString('MAIN_MAIL_EMAIL_TLS_EMAILING') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -534,9 +534,9 @@ function change_smtp_auth_method() { // STARTTLS print ''.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_EMAILING', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_EMAILING') ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_EMAILING', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_EMAILING') ? getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_EMAILING') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -547,9 +547,9 @@ function change_smtp_auth_method() { // SMTP_ALLOW_SELF_SIGNED_EMAILING print ''.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING') ? $conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING') ? getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -593,14 +593,14 @@ function change_smtp_auth_method() { if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'mail')) { //print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { - print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING') ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : '').''; + print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING').''; } // Port if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'mail')) { //print ''.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { - print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_PORT_EMAILING') ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : '').''; + print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_PORT_EMAILING').''; } // AUTH method @@ -618,12 +618,12 @@ function change_smtp_auth_method() { } // SMTPS ID - if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").''.getDolGlobalString('MAIN_MAIL_SMTPS_ID_EMAILING').''; } // SMTPS PW - if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING') != "XOAUTH2") { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING') != "XOAUTH2") { print ''.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', getDolGlobalString('MAIN_MAIL_SMTPS_PW_EMAILING')).''; } @@ -641,7 +641,7 @@ function change_smtp_auth_method() { // Nothing } else { print ''.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalString('MAIN_MAIL_EMAIL_TLS_EMAILING')); } else { @@ -658,7 +658,7 @@ function change_smtp_auth_method() { // Nothing } else { print ''.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_EMAILING')); } else { @@ -675,7 +675,7 @@ function change_smtp_auth_method() { // Nothing } else { print ''.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING')); } else { @@ -773,8 +773,8 @@ function change_smtp_auth_method() { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); $formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test"); - $formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM); - $formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM); + $formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : getDolGlobalString('MAIN_MAIL_EMAIL_FROM')); + $formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : getDolGlobalString('MAIN_MAIL_EMAIL_FROM')); $formmail->fromid = $user->id; $formmail->fromalsorobot = 1; $formmail->withfromreadonly = 0; diff --git a/htdocs/admin/mails_ingoing.php b/htdocs/admin/mails_ingoing.php index 12bd4d93ce8d5..734d83f619c7b 100644 --- a/htdocs/admin/mails_ingoing.php +++ b/htdocs/admin/mails_ingoing.php @@ -127,7 +127,7 @@ // SMTPS oauth service if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE') === "XOAUTH2") { - $text = $oauthservices[$conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE]; + $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE')]; if (empty($text)) { $text = $langs->trans("Undefined").img_warning(); } diff --git a/htdocs/admin/mails_passwordreset.php b/htdocs/admin/mails_passwordreset.php index 29c8d20334207..5f3b07ce7ee2d 100644 --- a/htdocs/admin/mails_passwordreset.php +++ b/htdocs/admin/mails_passwordreset.php @@ -358,7 +358,7 @@ function change_smtp_auth_method() { // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SENDMODE_PASSWORDRESET', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET); + print $form->selectarray('MAIN_MAIL_SENDMODE_PASSWORDRESET', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET')); } else { $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET')]; if (empty($text)) { @@ -381,7 +381,7 @@ function change_smtp_auth_method() { print ''; } else { print ''; - $mainserver = (getDolGlobalString('MAIN_MAIL_SMTP_SERVER_PASSWORDRESET') ? $conf->global->MAIN_MAIL_SMTP_SERVER_PASSWORDRESET : ''); + $mainserver = getDolGlobalString('MAIN_MAIL_SMTP_SERVER_PASSWORDRESET'); $smtpserver = ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined"); if ($linuxlike) { print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); @@ -413,7 +413,7 @@ function change_smtp_auth_method() { print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } else { - $mainport = (getDolGlobalString('MAIN_MAIL_SMTP_PORT_PASSWORDRESET') ? $conf->global->MAIN_MAIL_SMTP_PORT_PASSWORDRESET : ''); + $mainport = getDolGlobalString('MAIN_MAIL_SMTP_PORT_PASSWORDRESET'); $smtpport = ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined"); if ($linuxlike) { print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); @@ -436,7 +436,7 @@ function change_smtp_auth_method() { print ''; // AUTH method - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").''; $vartosmtpstype = 'MAIN_MAIL_SMTPS_AUTH_TYPE_PASSWORDRESET'; if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { @@ -464,22 +464,22 @@ function change_smtp_auth_method() { } // ID - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')))) { - $mainstmpid = (getDolGlobalString('MAIN_MAIL_SMTPS_ID_PASSWORDRESET') ? $conf->global->MAIN_MAIL_SMTPS_ID_PASSWORDRESET : ''); + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { + $mainstmpid = getDolGlobalString('MAIN_MAIL_SMTPS_ID_PASSWORDRESET'); print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").''; // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_PASSWORDRESET, $htmltext, 1, 'superadmin'); + print $form->textwithpicto(getDolGlobalString('MAIN_MAIL_SMTPS_ID_PASSWORDRESET'), $htmltext, 1, 'superadmin'); print ''; } print ''; } // PW - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { $mainsmtppw = getDolGlobalString('MAIN_MAIL_SMTPS_PW_PASSWORDRESET'); print ''.$langs->trans("MAIN_MAIL_SMTPS_PW").''; // SuperAdministrator access only @@ -494,11 +494,11 @@ function change_smtp_auth_method() { } // OAUTH service provider - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").''; // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_PASSWORDRESET', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_PASSWORDRESET); + print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_PASSWORDRESET', $oauthservices, getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_PASSWORDRESET')); } else { $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_PASSWORDRESET')]; if (empty($text)) { @@ -514,9 +514,9 @@ function change_smtp_auth_method() { // TLS print ''.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_PASSWORDRESET', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS_PASSWORDRESET') ? $conf->global->MAIN_MAIL_EMAIL_TLS_PASSWORDRESET : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_PASSWORDRESET', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS_PASSWORDRESET') ? getDolGlobalString('MAIN_MAIL_EMAIL_TLS_PASSWORDRESET') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -528,9 +528,9 @@ function change_smtp_auth_method() { // STARTTLS print ''.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET') ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET') ? getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -541,9 +541,9 @@ function change_smtp_auth_method() { // SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET print ''.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET') ? $conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET') ? getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -587,14 +587,14 @@ function change_smtp_auth_method() { if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET') == 'mail')) { //print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { - print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_SERVER_PASSWORDRESET') ? $conf->global->MAIN_MAIL_SMTP_SERVER_PASSWORDRESET : '').''; + print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_PASSWORDRESET').''; } // Port if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET') == 'mail')) { //print ''.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { - print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_PORT_PASSWORDRESET') ? $conf->global->MAIN_MAIL_SMTP_PORT_PASSWORDRESET : '').''; + print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_PORT_PASSWORDRESET').''; } // AUTH method @@ -612,12 +612,12 @@ function change_smtp_auth_method() { } // SMTPS ID - if (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").'' . getDolGlobalString('MAIN_MAIL_SMTPS_ID_PASSWORDRESET').''; } // SMTPS PW - if (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_PASSWORDRESET') != "XOAUTH2") { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_PASSWORDRESET') != "XOAUTH2") { print ''.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', getDolGlobalString('MAIN_MAIL_SMTPS_PW_PASSWORDRESET')).''; } @@ -635,7 +635,7 @@ function change_smtp_auth_method() { // Nothing } else { print ''.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalString('MAIN_MAIL_EMAIL_TLS_PASSWORDRESET')); } else { @@ -652,7 +652,7 @@ function change_smtp_auth_method() { // Nothing } else { print ''.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET')); } else { @@ -669,7 +669,7 @@ function change_smtp_auth_method() { // Nothing } else { print ''.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET')); } else { diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 29887bba7707d..a586d8407bb67 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -1,8 +1,8 @@ - * Copyright (C) 2018 Ferran Marcet +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * 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 @@ -55,7 +55,6 @@ $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) $id = GETPOSTINT('id'); -$rowid = GETPOST('rowid', 'alpha'); // Load variable for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; @@ -83,8 +82,8 @@ // Default sort order (if not yet defined by previous GETPOST) if (!$sortfield) { - reset($object->fields); // Reset is required to avoid key() to return null. - $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. + reset($object->fields); // Reset is required to avoid key() to return null. + $sortfield = "t.position"; // Set here default search field. By default 1st field in definition. } if (!$sortorder) { $sortorder = "ASC"; @@ -804,14 +803,11 @@ $url .= '&limit='.((int) $limit); } if ($page) { - $url .= '&page='.urlencode((string) ($page)); - } - if ($sortfield) { - $url .= '&sortfield='.urlencode($sortfield); - } - if ($sortorder) { - $url .= '&page='.urlencode($sortorder); + $url .= '&page='.urlencode((string) $page); } + $url .= '&sortfield='.urlencode((string) $sortfield); + $url .= '&page='.urlencode((string) $sortorder); + print ''.img_edit().''; //print '   '; print ''.img_delete().'   '; @@ -828,7 +824,6 @@ } } - print ''."\n"; } diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index 4ffa822f96661..6666861cf89e7 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -358,7 +358,7 @@ function change_smtp_auth_method() { // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SENDMODE_TICKET', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_TICKET); + print $form->selectarray('MAIN_MAIL_SENDMODE_TICKET', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET')); } else { $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET')]; if (empty($text)) { @@ -381,7 +381,7 @@ function change_smtp_auth_method() { print ''; } else { print ''; - $mainserver = (getDolGlobalString('MAIN_MAIL_SMTP_SERVER_TICKET') ? $conf->global->MAIN_MAIL_SMTP_SERVER_TICKET : ''); + $mainserver = getDolGlobalString('MAIN_MAIL_SMTP_SERVER_TICKET'); $smtpserver = ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined"); if ($linuxlike) { print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); @@ -413,7 +413,7 @@ function change_smtp_auth_method() { print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } else { - $mainport = (getDolGlobalString('MAIN_MAIL_SMTP_PORT_TICKET') ? $conf->global->MAIN_MAIL_SMTP_PORT_TICKET : ''); + $mainport = getDolGlobalString('MAIN_MAIL_SMTP_PORT_TICKET'); $smtpport = ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined"); if ($linuxlike) { print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); @@ -436,7 +436,7 @@ function change_smtp_auth_method() { print ''; // AUTH method - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").''; $vartosmtpstype = 'MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET'; if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { @@ -464,22 +464,22 @@ function change_smtp_auth_method() { } // ID - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { - $mainstmpid = (getDolGlobalString('MAIN_MAIL_SMTPS_ID_TICKET') ? $conf->global->MAIN_MAIL_SMTPS_ID_TICKET : ''); + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { + $mainstmpid = getDolGlobalString('MAIN_MAIL_SMTPS_ID_TICKET'); print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").''; // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_TICKET, $htmltext, 1, 'superadmin'); + print $form->textwithpicto(getDolGlobalString('MAIN_MAIL_SMTPS_ID_TICKET'), $htmltext, 1, 'superadmin'); print ''; } print ''; } // PW - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { $mainsmtppw = getDolGlobalString('MAIN_MAIL_SMTPS_PW_TICKET'); print ''.$langs->trans("MAIN_MAIL_SMTPS_PW").''; // SuperAdministrator access only @@ -494,11 +494,11 @@ function change_smtp_auth_method() { } // OAUTH service provider - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").''; // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET); + print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET', $oauthservices, getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET')); } else { $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET')]; if (empty($text)) { @@ -513,9 +513,9 @@ function change_smtp_auth_method() { // TLS print ''.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_TICKET', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS_TICKET') ? $conf->global->MAIN_MAIL_EMAIL_TLS_TICKET : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_TICKET', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS_TICKET') ? getDolGlobalString('MAIN_MAIL_EMAIL_TLS_TICKET') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -526,9 +526,9 @@ function change_smtp_auth_method() { // STARTTLS print ''.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_TICKET', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_TICKET') ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS_TICKET : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_TICKET', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_TICKET') ? getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_TICKET') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -539,9 +539,9 @@ function change_smtp_auth_method() { // SMTP_ALLOW_SELF_SIGNED_TICKET print ''.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_TICKET', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_TICKET') ? $conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_TICKET : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_TICKET', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_TICKET') ? getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_TICKET') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -585,14 +585,14 @@ function change_smtp_auth_method() { if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'mail')) { //print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { - print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_SERVER_TICKET') ? $conf->global->MAIN_MAIL_SMTP_SERVER_TICKET : '').''; + print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_TICKET').''; } // Port if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'mail')) { //print ''.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { - print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_PORT_TICKET') ? $conf->global->MAIN_MAIL_SMTP_PORT_TICKET : '').''; + print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_PORT_TICKET').''; } // AUTH method @@ -610,12 +610,12 @@ function change_smtp_auth_method() { } // SMTPS ID - if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) { - print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").'' . getDolGlobalString('MAIN_MAIL_SMTPS_ID_TICKET').''; + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { + print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").''.getDolGlobalString('MAIN_MAIL_SMTPS_ID_TICKET').''; } // SMTPS PW - if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET') != "XOAUTH2") { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET') != "XOAUTH2") { print ''.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', getDolGlobalString('MAIN_MAIL_SMTPS_PW_TICKET')).''; } @@ -633,7 +633,7 @@ function change_smtp_auth_method() { // Nothing } else { print ''.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalString('MAIN_MAIL_EMAIL_TLS_TICKET')); } else { @@ -650,7 +650,7 @@ function change_smtp_auth_method() { // Nothing } else { print ''.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_TICKET')); } else { @@ -667,7 +667,7 @@ function change_smtp_auth_method() { // Nothing } else { print ''.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_TICKET')); } else { diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 6b6faa7d4818e..f9cde4b5363c2 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -290,9 +290,8 @@ if (!is_numeric($checkRes) && $checkRes != '') { $langs->load("errors"); setEventMessages($modulename.' : '.$langs->trans($checkRes), null, 'errors'); + $error++; } - - $error++; } catch (Exception $e) { // Nothing done } diff --git a/htdocs/admin/openid_connect.php b/htdocs/admin/openid_connect.php index 7a42c90369d60..c5f80897c5e14 100644 --- a/htdocs/admin/openid_connect.php +++ b/htdocs/admin/openid_connect.php @@ -37,10 +37,11 @@ * @var User $user */ -$langs->load("admin"); -$langs->load("openidconnect"); +$langs->loadLangs(["admin", "openidconnect"]); -if (!$user->admin) accessforbidden(); +if (!$user->admin) { + accessforbidden(); +} $action = GETPOST('action', 'alpha'); @@ -143,8 +144,6 @@ print ''; print ''; -$var=true; - print ''; print ''; print ''."\n"; @@ -153,8 +152,7 @@ print "\n"; // MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM -$var = !$var; -print '' . "\n"; +print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; // MAIN_AUTHENTICATION_OIDC_CLIENT_ID -$var = !$var; -print '' . "\n"; +print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; // MAIN_AUTHENTICATION_OIDC_CLIENT_SECRET -$var = !$var; -print '' . "\n"; +print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; // MAIN_AUTHENTICATION_OIDC_SCOPES -$var = !$var; -print '' . "\n"; +print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; // MAIN_AUTHENTICATION_OIDC_AUTHORIZE_URL -$var = !$var; -print '' . "\n"; +print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; // MAIN_AUTHENTICATION_OIDC_TOKEN_URL -$var = !$var; -print '' . "\n"; +print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; // MAIN_AUTHENTICATION_OIDC_USERINFO_URL -$var = !$var; -print '' . "\n"; +print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; // MAIN_AUTHENTICATION_OIDC_LOGOUT_URL -$var = !$var; -print '' . "\n"; +print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; // REDIRECT_URL -$var = !$var; -print '' . "\n"; +print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; // LOGOUT_URL -$var = !$var; -print '' . "\n"; +print '' . "\n"; print ''."\n"; print ''."\n"; print ''; print ''; print ''; print '\n\n"; $found++; - + print ''; print ''; print ''; print ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/expedition/mod_expedition_ribera.php b/htdocs/core/modules/expedition/mod_expedition_ribera.php index 30bd7abd94bac..a6394c0df169c 100644 --- a/htdocs/core/modules/expedition/mod_expedition_ribera.php +++ b/htdocs/core/modules/expedition/mod_expedition_ribera.php @@ -83,7 +83,7 @@ public function info($langs) $tooltip .= '
'.$langs->trans("GenericMaskCodes5b"); $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; $texte .= '
'.$langs->trans("Parameters").'
'.$langs->trans("MainAuthenticationOidcLoginClaimName").''.$langs->trans("MainAuthenticationOidcLoginClaimDesc").'' . "\n"; @@ -162,8 +160,7 @@ print '
'.$langs->trans("MainAuthenticationOidcClientIdName").''.$langs->trans("MainAuthenticationOidcClientIdDesc").'' . "\n"; @@ -171,8 +168,7 @@ print '
'.$langs->trans("MainAuthenticationOidcClientSecretName").''.$langs->trans("MainAuthenticationOidcClientSecretDesc").'' . "\n"; @@ -180,8 +176,7 @@ print '
'.$langs->trans("MainAuthenticationOidcScopesName").''.$langs->trans("MainAuthenticationOidcScopesDesc").'' . "\n"; @@ -189,8 +184,7 @@ print '
'.$langs->trans("MainAuthenticationOidcAuthorizeUrlName").''.$langs->trans("MainAuthenticationOidcAuthorizeUrlDesc").'' . "\n"; @@ -198,8 +192,7 @@ print '
'.$langs->trans("MainAuthenticationOidcTokenUrlName").''.$langs->trans("MainAuthenticationOidcTokenUrlDesc").'' . "\n"; @@ -207,8 +200,7 @@ print '
'.$langs->trans("MainAuthenticationOidcUserinfoUrlName").''.$langs->trans("MainAuthenticationOidcUserinfoUrlDesc").'' . "\n"; @@ -216,8 +208,7 @@ print '
'.$langs->trans("MainAuthenticationOidcLogoutUrlName").''.$langs->trans("MainAuthenticationOidcLogoutUrlDesc").'' . "\n"; @@ -225,8 +216,7 @@ print '
'.$langs->trans("MainAuthenticationOidcRedirectUrlName").''.$langs->trans("MainAuthenticationOidcRedirectUrlDesc").'' . "\n"; @@ -234,8 +224,7 @@ print '
'.$langs->trans("MainAuthenticationOidcLogoutRedirectUrlName").''.$langs->trans("MainAuthenticationOidcLogoutRedirectUrlDesc").'' . "\n"; @@ -256,3 +245,4 @@ print dol_get_fiche_end(); llxFooter(); +$db->close(); diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 7b412be5824e0..433d7a325fdf2 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -76,6 +76,7 @@ $res3 = 1; $res4 = 1; $res5 = 1; + $res6 = 1; if (GETPOSTISSET('MAIN_APPLICATION_TITLE')) { $res1 = dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", GETPOST("MAIN_APPLICATION_TITLE", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } @@ -91,7 +92,10 @@ if (GETPOSTISSET('MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS')) { $res5 = dolibarr_set_const($db, "MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS", GETPOST("MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS", 'alphanohtml'), 'int', 0, '', $conf->entity); } - if ($res1 && $res2 && $res3 && $res4 && $res5) { + if (GETPOSTISSET('MAIN_SECURITY_MAX_NUMBER_FAILED_AUTH')) { + $res6 = dolibarr_set_const($db, "MAIN_SECURITY_MAX_NUMBER_FAILED_AUTH", GETPOST("MAIN_SECURITY_MAX_NUMBER_FAILED_AUTH", 'alphanohtml'), 'int', 0, '', $conf->entity); + } + if ($res1 && $res2 && $res3 && $res4 && $res5 && $res6) { setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } } @@ -167,7 +171,8 @@ print '
'.$langs->trans("SessionTimeOut").''; if (ini_get("session.gc_probability") == 0) { - print $form->textwithpicto('', $langs->trans("SessionsPurgedByExternalSystem", ini_get("session.gc_maxlifetime"))); + // For external cleaning of session, the delay used may be the one into the ini file, so get_cfg_var("session.gc_maxlifetime"), not the one overloaded in runtime. + print $form->textwithpicto('', $langs->trans("SessionsPurgedByExternalSystem", get_cfg_var("session.gc_maxlifetime"))); } else { print $form->textwithpicto('', $langs->trans("SessionExplanation", ini_get("session.gc_probability"), ini_get("session.gc_divisor"), ini_get("session.gc_maxlifetime"))); } diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index dbfb0e7a8e963..ad815dc5bc83f 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -1,7 +1,7 @@ - * Copyright (C) 2009 Regis Houssin - * Copyright (C) 2013 Juanjo Menent +/* Copyright (C) 2007-2011 Laurent Destailleur + * Copyright (C) 2009 Regis Houssin + * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2020-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -83,10 +83,10 @@ } $sendto = GETPOST("sendto", 'alphanohtml'); $body = GETPOST('message', 'alphanohtml'); - $deliveryreceipt = GETPOST("deliveryreceipt", 'alphanohtml'); - $deferred = GETPOST('deferred', 'alphanohtml'); - $priority = GETPOST('priority', 'alphanohtml'); - $class = GETPOST('class', 'alphanohtml'); + $deliveryreceipt = GETPOSTINT("deliveryreceipt"); + $deferred = GETPOSTINT('deferred'); + $priority = GETPOSTINT('priority'); + $class = GETPOSTINT('class'); $errors_to = GETPOST("errorstosms", 'alphanohtml'); // Create form object diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index c8b56a0dc1979..43d6b981a3b8d 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -386,7 +386,7 @@ $found++; if (isModEnabled("reception")) { - print ''; + print ''; print '
'.$langs->trans("StockOnReception").''; @@ -405,7 +405,7 @@ print "
'.$langs->trans("StockOnReceptionOnClosing").''; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index b0f657e9411d6..2861b0fce9bc9 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -38,6 +38,9 @@ * @var HookManager $hookmanager * @var Translate $langs * @var User $user + * + * @var string[] $arrayofstreamtodisable // $arrayofstreamtodisable is defined into filefunc.inc.php + * @var string $conffile // $conffile is defined into filefunc.inc.php */ // Load translation files required by the page diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index adc8de229008e..5fc190a7d55a0 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -46,7 +46,7 @@ } $radio_dump = GETPOST('radio_dump'); -$showpass = GETPOST('showpass'); +$action = GETPOST('action', 'aZ09'); /* @@ -148,11 +148,12 @@
'; - print ''.$langs->trans('RestoreMySQL').''; - print '
'; - // Parameters execution - $command = $db->getPathOfRestore(); + print '
'; + print ''.$langs->trans('RestoreMySQL').''; + print '
'; + + // Parameters execution + $command = $db->getPathOfRestore(); if (preg_match("/\s/", $command)) { $command = $command = escapeshellarg($command); // Use quotes on command } @@ -170,17 +171,17 @@ $paramclear .= " -p".$dolibarr_main_db_pass; } - echo $langs->trans("ImportMySqlDesc"); - print '
'; - print '
'; - print ajax_autoselect('restorecommand'); + print $langs->trans("ImportMySqlDesc"); + print '
'; + print '
'; + print ajax_autoselect('restorecommand'); - if (!GETPOST("showpass") && $dolibarr_main_db_pass) { - print '
'.$langs->trans("UnHidePassword").''; + if (GETPOST("action") != 'showpass' && $dolibarr_main_db_pass) { + print '
'.$langs->trans("UnHidePassword").''; } - //else print '
'.$langs->trans("HidePassword").''; - print '
'; - print '
'; + //else print '
'.$langs->trans("HidePassword").''; + print '
'; + print ''; } elseif (in_array($type, array('pgsql'))) { print '
'; print 'Restore PostgreSQL'; @@ -212,7 +213,7 @@ echo $langs->trans("ImportPostgreSqlDesc"); print '
'; - print '
'; + print '
'; print ajax_autoselect('restorecommand'); print '
'; diff --git a/htdocs/admin/tools/ui/class/documentation.class.php b/htdocs/admin/tools/ui/class/documentation.class.php index 584f6c36a7f9c..4de7133c9e620 100644 --- a/htdocs/admin/tools/ui/class/documentation.class.php +++ b/htdocs/admin/tools/ui/class/documentation.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * 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 @@ -57,6 +58,7 @@ class Documentation * Constructor * * @param DoliDB $db Database handler + * @return void */ public function __construct(DoliDB $db) { @@ -75,7 +77,6 @@ public function __construct(DoliDB $db) */ private function setMenu() { - global $hookmanager; @@ -223,7 +224,8 @@ public function docFooter() } /** - * Output sidebar + * Output sidebar + * * @return void */ public function showSidebar() @@ -312,7 +314,8 @@ public function showBreadcrumb() } /** - * Output summary + * Output summary + * * @param int $showsubmenu Show Sub menus: 0 = No, 1 = Yes * @param int $showsubmenu_summary Show summary of sub menus: 0 = No, 1 = Yes * @return void @@ -320,6 +323,7 @@ public function showBreadcrumb() public function showSummary($showsubmenu = 1, $showsubmenu_summary = 1) { $i = 0; + $menu_entry = []; if (!empty($this->view)) : // On se place au bon niveau foreach ($this->view as $view) { @@ -384,16 +388,16 @@ public function displaySummary($menu, $level = 0, $showsubmenu = 1, $showsubmenu * Output a View Code area * * @param array $lines Lines of code to show + * @param string $option Source code language ('html', 'php' etc) * @return void */ - public function showCode($lines = array()) + public function showCode($lines = array(), $option = 'html') { - print '
';
-		if (!empty($lines)) {
-			foreach ($lines as $lineofcode) {
-				print dol_htmlentities($lineofcode).'
'; - } - } - print '
'; + require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; + print '
'; + $content = implode("\n", $lines) . "\n"; + $doleditor = new DolEditor(md5($content), $content, '', 0, 'Basic', 'In', true, false, 'ace', 0, '99%', 1); + print $doleditor->Create(1, '', false, '', $option); + print '
'; } } diff --git a/htdocs/admin/tools/ui/components/badges.php b/htdocs/admin/tools/ui/components/badges.php index e47b8090ce4fc..0d147b603bea2 100644 --- a/htdocs/admin/tools/ui/components/badges.php +++ b/htdocs/admin/tools/ui/components/badges.php @@ -1,36 +1,39 @@ + * Copyright (C) 2024 Frédéric France * - * This program and files/directory inner it is free software: you can - * redistribute it and/or modify it under the terms of the - * GNU Affero General Public License (AGPL) as published by - * the Free Software Foundation, either version 3 of the License, or + * 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 AGPL for more details. + * GNU General Public License for more details. * - * You should have received a copy of the GNU AGPL - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -$res=0; -if (! $res && file_exists("../../main.inc.php")) : $res=@include '../../main.inc.php'; -endif; -if (! $res && file_exists("../../../main.inc.php")) : $res=@include '../../../main.inc.php'; -endif; -if (! $res && file_exists("../../../../main.inc.php")) : $res=@include '../../../../main.inc.php'; -endif; +// Load Dolibarr environment +require '../../../../main.inc.php'; + +/** + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + */ // Protection if external user -if ($user->socid > 0) : accessforbidden(); -endif; +if ($user->socid > 0) { + accessforbidden(); +} // Includes -dol_include_once('admin/tools/ui/class/documentation.class.php'); +require_once DOL_DOCUMENT_ROOT . '/admin/tools/ui/class/documentation.class.php'; // Load documentation translations $langs->load('uxdocumentation'); @@ -38,8 +41,13 @@ // $documentation = new Documentation($db); +$morejs = [ + '/includes/ace/src/ace.js', + '/includes/ace/src/ext-statusbar.js', + '/includes/ace/src/ext-language_tools.js', +]; // Output html head + body - Param is Title -$documentation->docHeader('Badges'); +$documentation->docHeader('Badges', $morejs); // Set view for menu and breadcrumb // Menu must be set in constructor of documentation class @@ -49,7 +57,7 @@ $documentation->showSidebar(); ?>
- + showBreadCrumb(); ?>
@@ -310,4 +318,4 @@ docFooter(); -?> \ No newline at end of file +?> diff --git a/htdocs/admin/tools/ui/components/buttons.php b/htdocs/admin/tools/ui/components/buttons.php index 1ad142730f09f..0fe09e06d027a 100644 --- a/htdocs/admin/tools/ui/components/buttons.php +++ b/htdocs/admin/tools/ui/components/buttons.php @@ -1,45 +1,52 @@ + * Copyright (C) 2024 Frédéric France * - * This program and files/directory inner it is free software: you can - * redistribute it and/or modify it under the terms of the - * GNU Affero General Public License (AGPL) as published by - * the Free Software Foundation, either version 3 of the License, or + * 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 AGPL for more details. + * GNU General Public License for more details. * - * You should have received a copy of the GNU AGPL - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -$res=0; -if (! $res && file_exists("../../main.inc.php")) : $res=@include '../../main.inc.php'; -endif; -if (! $res && file_exists("../../../main.inc.php")) : $res=@include '../../../main.inc.php'; -endif; -if (! $res && file_exists("../../../../main.inc.php")) : $res=@include '../../../../main.inc.php'; -endif; +// Load Dolibarr environment +require '../../../../main.inc.php'; + +/** + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + */ // Protection if external user -if ($user->socid > 0) : accessforbidden(); -endif; +if ($user->socid > 0) { + accessforbidden(); +} // Includes -dol_include_once('admin/tools/ui/class/documentation.class.php'); +require_once DOL_DOCUMENT_ROOT . '/admin/tools/ui/class/documentation.class.php'; // Load documentation translations $langs->load('uxdocumentation'); // $documentation = new Documentation($db); - +$morejs = [ + '/includes/ace/src/ace.js', + '/includes/ace/src/ext-statusbar.js', + '/includes/ace/src/ext-language_tools.js', +]; // Output html head + body - Param is Title -$documentation->docHeader('Buttons'); +$documentation->docHeader('Buttons', $morejs); // Set view for menu and breadcrumb // Menu must be set in constructor of documentation class @@ -128,7 +135,7 @@ ' */', 'print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight, $params);', ); - echo $documentation->showCode($lines); ?> + echo $documentation->showCode($lines, 'php'); ?>
@@ -144,7 +151,7 @@ $id = 'button-id-7'; $url = '#'.$id; $params = array( - 'confirm' => true + 'confirm' => [], ); print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight, $params); @@ -170,7 +177,7 @@ $id = 'button-id-9'; $url = '#'.$id; $params = array( - 'confirm' => true + 'confirm' => [], ); print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight, $params); ?>
@@ -179,7 +186,7 @@ ' true', + ' \'confirm\' => [],', ');', '', '// Custom parameters', @@ -189,13 +196,13 @@ ' \'title\' => \'Your title to display\',', ' \'action-btn-label\' => \'Your confirm label\',', ' \'cancel-btn-label\' => \'Your cancel label\',', - ' \'content\' => \'Content to display with HTML compatible
  • test 01
  • test 02
  • test 03
\'', + ' \'content\' => \'Content to display with HTML compatible
  • test 01
  • test 02
  • test 03
\',', ' )', ');', '', 'print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight, $params);', ); - echo $documentation->showCode($lines); ?> + echo $documentation->showCode($lines, 'php'); ?> @@ -214,13 +221,15 @@ 'lang'=>'documentation@documentation', 'url'=> $submenu_url.'#'.$id, 'label' => 'My SubAction 1', - 'perm' => 1 + 'perm' => true, + 'enabled' => true, ), array( 'lang'=>'documentation@documentation', 'url'=> $submenu_url.'#'.$id, 'label' => 'My SubAction 2', - 'perm' => 0 + 'perm' => false, + 'enabled' => true, ), ); $params = array(); @@ -250,7 +259,7 @@ ');', 'print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight, $params);' ); - echo $documentation->showCode($lines); ?> + echo $documentation->showCode($lines, 'php'); ?> @@ -277,7 +286,7 @@ 'print \' \';', ); - echo $documentation->showCode($lines); ?> + echo $documentation->showCode($lines, 'php'); ?> @@ -313,18 +322,16 @@ 'print dolGetButtonTitle($btnLabel, \'\', \'fa fa-file\', \'#\', \'\', $status);', ); - echo $documentation->showCode($lines); ?>
+ echo $documentation->showCode($lines, 'php'); ?>
trans('Label'); + $btnLabel = $langs->trans('Label', 'php'); print dolGetButtonTitle($btnLabel, '', 'fa fa-download', '#', '', 0, ['forcenohideoftext'=>1]); // Not Enough Permissions print dolGetButtonTitle($btnLabel, '', 'fa fa-download', '#', '', 1, ['forcenohideoftext'=>1]); // Active print dolGetButtonTitle($btnLabel, '', 'fa fa-download', '#', '', 2, ['forcenohideoftext'=>1]); // Active and selected print dolGetButtonTitle($btnLabel, '', 'fa fa-download', '#', '', -1, ['forcenohideoftext'=>1]); // Functionality is disabled print dolGetButtonTitle($btnLabel, '', 'fa fa-download', '#', '', -2, ['forcenohideoftext'=>1]); // Disabled without info - ?>
@@ -343,15 +350,9 @@ '$status = -2; // Disabled without info', 'print dolGetButtonTitle($btnLabel, \'\', \'fa fa-download\', \'#\', \'\', $status, [\'forcenohideoftext\'=>1]);', ); - echo $documentation->showCode($lines); ?> + echo $documentation->showCode($lines, 'php'); ?>
- - - - - - diff --git a/htdocs/admin/tools/ui/components/event-message.php b/htdocs/admin/tools/ui/components/event-message.php index 98e3080c7d30f..f612f05a0c2dd 100644 --- a/htdocs/admin/tools/ui/components/event-message.php +++ b/htdocs/admin/tools/ui/components/event-message.php @@ -1,37 +1,39 @@ + * Copyright (C) 2024 Frédéric France * - * This program and files/directory inner it is free software: you can - * redistribute it and/or modify it under the terms of the - * GNU Affero General Public License (AGPL) as published by - * the Free Software Foundation, either version 3 of the License, or + * 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 AGPL for more details. + * GNU General Public License for more details. * - * You should have received a copy of the GNU AGPL - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -$res=0; -if (! $res && file_exists("../../main.inc.php")) : $res=@include '../../main.inc.php'; -endif; -if (! $res && file_exists("../../../main.inc.php")) : $res=@include '../../../main.inc.php'; -endif; -if (! $res && file_exists("../../../../main.inc.php")) : $res=@include '../../../../main.inc.php'; -endif; +// Load Dolibarr environment +require '../../../../main.inc.php'; +/** + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + */ // Protection if external user -if ($user->socid > 0) : accessforbidden(); -endif; +if ($user->socid > 0) { + accessforbidden(); +} // Includes -dol_include_once('admin/tools/ui/class/documentation.class.php'); +require_once DOL_DOCUMENT_ROOT . '/admin/tools/ui/class/documentation.class.php'; // Load documentation translations $langs->load('uxdocumentation'); @@ -55,9 +57,13 @@ // $documentation = new Documentation($db); - +$morejs = [ + '/includes/ace/src/ace.js', + '/includes/ace/src/ext-statusbar.js', + '/includes/ace/src/ext-language_tools.js', +]; // Output html head + body - Param is Title -$documentation->docHeader('SetEventMessages'); +$documentation->docHeader('SetEventMessages', $morejs); // Set view for menu and breadcrumb // Menu must be set in constructor of documentation class @@ -121,7 +127,7 @@ 'setEventMessages("message", null);', 'setEventMessages(null, messages[]);', ); - echo $documentation->showCode($lines); ?> + echo $documentation->showCode($lines, 'php'); ?> @@ -156,11 +162,12 @@ showCode($lines); ?> + echo $documentation->showCode($lines, 'php'); ?> diff --git a/htdocs/admin/tools/ui/components/index.php b/htdocs/admin/tools/ui/components/index.php index 32af131fb91c0..409d96d22a73c 100644 --- a/htdocs/admin/tools/ui/components/index.php +++ b/htdocs/admin/tools/ui/components/index.php @@ -1,36 +1,39 @@ + * Copyright (C) 2024 Frédéric France * - * This program and files/directory inner it is free software: you can - * redistribute it and/or modify it under the terms of the - * GNU Affero General Public License (AGPL) as published by - * the Free Software Foundation, either version 3 of the License, or + * 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 AGPL for more details. + * GNU General Public License for more details. * - * You should have received a copy of the GNU AGPL - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -$res=0; -if (! $res && file_exists("../../main.inc.php")) : $res=@include '../../main.inc.php'; -endif; -if (! $res && file_exists("../../../main.inc.php")) : $res=@include '../../../main.inc.php'; -endif; -if (! $res && file_exists("../../../../main.inc.php")) : $res=@include '../../../../main.inc.php'; -endif; +// Load Dolibarr environment +require '../../../../main.inc.php'; + +/** + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + */ // Protection if external user -if ($user->socid > 0) : accessforbidden(); -endif; +if ($user->socid > 0) { + accessforbidden(); +} // Includes -dol_include_once('admin/tools/ui/class/documentation.class.php'); +require_once DOL_DOCUMENT_ROOT . '/admin/tools/ui/class/documentation.class.php'; // Load documentation translations $langs->load('uxdocumentation'); @@ -48,7 +51,7 @@ $documentation->showSidebar(); ?>
- + showBreadCrumb(); ?>
@@ -56,11 +59,11 @@

trans('DocComponentsTitle'); ?>

trans('DocComponentsMainDescription'); ?>

- showSummary(); ?> + showSummary(); ?>
docFooter(); -?> \ No newline at end of file +?> diff --git a/htdocs/admin/tools/ui/components/progress-bars.php b/htdocs/admin/tools/ui/components/progress-bars.php index f860fabb5798d..fda0b0527fc42 100644 --- a/htdocs/admin/tools/ui/components/progress-bars.php +++ b/htdocs/admin/tools/ui/components/progress-bars.php @@ -1,36 +1,39 @@ + * Copyright (C) 2024 Frédéric France * - * This program and files/directory inner it is free software: you can - * redistribute it and/or modify it under the terms of the - * GNU Affero General Public License (AGPL) as published by - * the Free Software Foundation, either version 3 of the License, or + * 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 AGPL for more details. + * GNU General Public License for more details. * - * You should have received a copy of the GNU AGPL - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -$res=0; -if (! $res && file_exists("../../main.inc.php")) : $res=@include '../../main.inc.php'; -endif; -if (! $res && file_exists("../../../main.inc.php")) : $res=@include '../../../main.inc.php'; -endif; -if (! $res && file_exists("../../../../main.inc.php")) : $res=@include '../../../../main.inc.php'; -endif; +// Load Dolibarr environment +require '../../../../main.inc.php'; + +/** + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + */ // Protection if external user -if ($user->socid > 0) : accessforbidden(); -endif; +if ($user->socid > 0) { + accessforbidden(); +} // Includes -dol_include_once('admin/tools/ui/class/documentation.class.php'); +require_once DOL_DOCUMENT_ROOT . '/admin/tools/ui/class/documentation.class.php'; // Load documentation translations $langs->load('uxdocumentation'); @@ -38,8 +41,13 @@ // $documentation = new Documentation($db); +$morejs = [ + '/includes/ace/src/ace.js', + '/includes/ace/src/ext-statusbar.js', + '/includes/ace/src/ext-language_tools.js', +]; // Output html head + body - Param is Title -$documentation->docHeader('Progress-bars'); +$documentation->docHeader('Progress-bars', $morejs); // Set view for menu and breadcrumb // Menu must be set in constructor of documentation class @@ -247,6 +255,7 @@ '
', '', '', + '', ); echo $documentation->showCode($lines); ?> diff --git a/htdocs/admin/tools/ui/components/test_arrays.php b/htdocs/admin/tools/ui/components/test_arrays.php index 8954e0cd7a309..0e02e1b88855d 100644 --- a/htdocs/admin/tools/ui/components/test_arrays.php +++ b/htdocs/admin/tools/ui/components/test_arrays.php @@ -1,17 +1,43 @@ + * + * 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 . */ // Load Dolibarr environment -@include '../../main.inc.php'; +require '../../../../main.inc.php'; + +/** + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + * + * @var int $dolibarr_main_prod + */ // Security if ($dolibarr_main_prod) { accessforbidden('Access forbidden when $dolibarr_main_prod is set to 1'); } +// Protection if external user +if ($user->socid > 0) { + accessforbidden(); +} - +$optioncss = GETPOST('optioncsss', 'alpha'); /* * View @@ -19,7 +45,9 @@ $form = new Form($db); -$usedolheader = 1; // 1 = Test inside a dolibarr page, 0 = Use hard coded header +// 1 = Test inside a dolibarr page, 0 = Use hard coded header +// Using a dolibarr constant avoid phpstan hardcoded value always true or false +$usedolheader = getDolGlobalInt('MAIN_TEST_UI_IN_DOLIBARR_PAGE', 1); // HEADER //-------- @@ -163,15 +191,14 @@ $productspecimen->initAsSpecimen(); $object = $productspecimen; $param = ''; -$actioncode = ''; -$status = ''; -$filter = ''; -$filtert = ''; -$socid = 0; -$type = 0; -$usergroup = 0; - -$sortfield = 'aaa'; +$actioncode = getDolGlobalString('MAIN_TEST_UI_ACTION_CODE'); // '' by default +$status = getDolGlobalString('MAIN_TEST_UI_STATUS'); // '' by default; +$filter = getDolGlobalString('MAIN_TEST_UI_FILTER'); // '' by default; +$filtert = getDolGlobalString('MAIN_TEST_UI_FILTERT'); // '' by default; +$socid = getDolGlobalInt('MAIN_TEST_UI_SOCID', 0); // 0 by default; +$type = getDolGlobalInt('MAIN_TEST_UI_TYPE', 0); // 0 by default; +$usergroup = getDolGlobalInt('MAIN_TEST_UI_USERGROUP', 0); // 0 by default; +$sortfield = getDolGlobalString('MAIN_TEST_UI_SORTFIELD', 'aaa'); // 'aaa' by default; $sortorder = 'ASC'; $tasksarray = array(1, 2, 3); // To force having several lines $tagidfortablednd = 'tablelines3'; @@ -242,18 +269,16 @@ $moreforfilter .= $form->selectarray('search_ddd', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidth300', 1); // List with js combo forced $moreforfilter .= ''; -if (!empty($moreforfilter)) { - print '
'; - print $moreforfilter; - $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print '
'; -} +print '
'; +print $moreforfilter; +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +print '
'; ?> -" id="tablelines3"> +
" id="tablelines3"> trans('title1'), 0, $_SERVER["PHP_SELF"], 'aaa', '', '', 'align="left"', $sortfield, $sortorder); ?> diff --git a/htdocs/admin/tools/ui/components/test_buttons.php b/htdocs/admin/tools/ui/components/test_buttons.php index 8eef7aa0b6cd9..449196c25a233 100644 --- a/htdocs/admin/tools/ui/components/test_buttons.php +++ b/htdocs/admin/tools/ui/components/test_buttons.php @@ -1,4 +1,20 @@ + * + * 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 . + */ + if (!defined('NOREQUIRESOC')) { define('NOREQUIRESOC', '1'); } @@ -25,9 +41,18 @@ } session_cache_limiter('public'); -require_once '../../main.inc.php'; +require '../../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; +/** + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + * + * @var int $dolibarr_main_prod + */ + // Security if ($dolibarr_main_prod) { accessforbidden(); @@ -129,7 +154,7 @@ $url = '#'.$id; $userRight = 1; $params = array( - 'confirm' => true + 'confirm' => [], ); print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight, $params); @@ -142,13 +167,13 @@ $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; $params = array( - 'confirm' => array( + 'confirm' => array( 'url' => 'your confirm action url', 'title' => 'Your title to display', 'action-btn-label' => 'Your confirm label', 'cancel-btn-label' => 'Your cancel label', - 'content' => 'Content to display with HTML compatible
  • test 01
  • test 02
  • test 03
' - ) + 'content' => 'Content to display with HTML compatible
  • test 01
  • test 02
  • test 03
', + ) ); print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight, $params); @@ -168,7 +193,7 @@ $url = '#'.$id; $userRight = 0; $params = array( - 'confirm' => true + 'confirm' => [], ); print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight, $params); @@ -181,13 +206,13 @@ $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; $params = array( - 'confirm' => array( + 'confirm' => array( 'url' => 'your confirm action url', 'title' => 'Your title to display', 'action-btn-label' => 'Your confirm label', 'cancel-btn-label' => 'Your cancel label', - 'content' => 'Content to display with HTML compatible
  • test 01
  • test 02
  • test 03
' - ) + 'content' => 'Content to display with HTML compatible
  • test 01
  • test 02
  • test 03
', + ) ); print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight, $params); diff --git a/htdocs/admin/tools/ui/components/test_forms.php b/htdocs/admin/tools/ui/components/test_forms.php index 60f351eb9948d..60c32389b0de7 100644 --- a/htdocs/admin/tools/ui/components/test_forms.php +++ b/htdocs/admin/tools/ui/components/test_forms.php @@ -14,6 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. //define("NOLOGIN",1); // This means this output page does not require to be logged. /*if (!defined('NOSESSION')) { @@ -21,9 +22,18 @@ }*/ // Load Dolibarr environment -require '../../main.inc.php'; +require '../../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +/** + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + * + * @var int $dolibarr_main_prod + */ + // Security if ($dolibarr_main_prod) { accessforbidden('Access forbidden when $dolibarr_main_prod is set to 1'); diff --git a/htdocs/admin/tools/ui/content/tables.php b/htdocs/admin/tools/ui/content/tables.php index 00fd9bbf666f0..9ab70ba6f3826 100644 --- a/htdocs/admin/tools/ui/content/tables.php +++ b/htdocs/admin/tools/ui/content/tables.php @@ -1,32 +1,31 @@ + * Copyright (C) 2024 Frédéric France * - * This program and files/directory inner it is free software: you can - * redistribute it and/or modify it under the terms of the - * GNU Affero General Public License (AGPL) as published by - * the Free Software Foundation, either version 3 of the License, or + * 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 AGPL for more details. + * GNU General Public License for more details. * - * You should have received a copy of the GNU AGPL - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -$res=0; -if (! $res && file_exists("../../main.inc.php")) { - $res=@include '../../main.inc.php'; -} -if (! $res && file_exists("../../../main.inc.php")) { - $res=@include '../../../main.inc.php'; -} -if (! $res && file_exists("../../../../main.inc.php")) { - $res=@include '../../../../main.inc.php'; -} +// Load Dolibarr environment +require '../../../../main.inc.php'; + +/** + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + */ // Protection if external user if ($user->socid > 0) { @@ -34,7 +33,7 @@ } // Includes -dol_include_once('admin/tools/ui/class/documentation.class.php'); +require_once DOL_DOCUMENT_ROOT . '/admin/tools/ui/class/documentation.class.php'; // Load documentation translations $langs->load('uxdocumentation'); diff --git a/htdocs/admin/tools/ui/index.php b/htdocs/admin/tools/ui/index.php index 2e64da27e4ed0..76baca72436c7 100644 --- a/htdocs/admin/tools/ui/index.php +++ b/htdocs/admin/tools/ui/index.php @@ -1,36 +1,38 @@ + * Copyright (C) 2024 Frédéric France * - * This program and files/directory inner it is free software: you can - * redistribute it and/or modify it under the terms of the - * GNU Affero General Public License (AGPL) as published by - * the Free Software Foundation, either version 3 of the License, or + * 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 AGPL for more details. + * GNU General Public License for more details. * - * You should have received a copy of the GNU AGPL - * along with this program. If not, see . + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -$res=0; -if (! $res && file_exists("../main.inc.php")) : $res=@include '../main.inc.php'; -endif; -if (! $res && file_exists("../../main.inc.php")) : $res=@include '../../main.inc.php'; -endif; -if (! $res && file_exists("../../../main.inc.php")) : $res=@include '../../../main.inc.php'; -endif; +// Load Dolibarr environment +require '../../../main.inc.php'; + +/** + * @var DoliDB $db + * @var Translate $langs + * @var User $user + */ // Protection if external user -if ($user->socid > 0) : accessforbidden(); -endif; +if ($user->socid > 0) { + accessforbidden(); +} // Includes -dol_include_once('admin/tools/ui/class/documentation.class.php'); +require_once DOL_DOCUMENT_ROOT . '/admin/tools/ui/class/documentation.class.php'; // Load documentation translations $langs->load('uxdocumentation'); @@ -48,7 +50,7 @@ $documentation->showSidebar(); ?>
- + showBreadCrumb(); ?>
@@ -61,4 +63,4 @@ docFooter(); -?> \ No newline at end of file +?> diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 75d92306f1634..433f08bcd805e 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -418,6 +418,6 @@ protected function _checkFilters($sqlfilters, &$error = '') */ protected static function _forge_criteria_callback($matches) { - return dolForgeCriteriaCallback($matches); + return dolForgeSQLCriteriaCallback($matches); } } diff --git a/htdocs/api/index.php b/htdocs/api/index.php index dd6afb8ddc3b4..7dab6412a7c1e 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -174,6 +174,7 @@ static function () { if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) { $refreshcache = true; if (!is_writable($conf->api->dir_temp)) { + dol_syslog("ErrorFailedToWriteInApiTempDirectory ".$conf->api->dir_temp, LOG_ERR); print 'Erreur temp dir api/temp not writable'; header('HTTP/1.1 500 temp dir api/temp not writable'); exit(0); diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 9531347d58073..9b6e857f8fa77 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -132,7 +132,7 @@ // Action dispose object if ($action == 'confirm_disposal' && $confirm == 'yes' && $permissiontoadd) { - $object->disposal_date = dol_mktime(12, 0, 0, GETPOSTINT('disposal_datemonth'), GETPOSTINT('disposal_dateday'), GETPOSTINT('disposal_dateyear')); // for date without hour, we use gmt + $object->disposal_date = dol_mktime(0, 0, 0, GETPOSTINT('disposal_datemonth'), GETPOSTINT('disposal_dateday'), GETPOSTINT('disposal_dateyear'), 'gmt'); // for date without hour, we use gmt $object->disposal_amount_ht = GETPOSTINT('disposal_amount'); $object->fk_disposal_type = GETPOSTINT('fk_disposal_type'); $disposal_invoice_id = GETPOSTINT('disposal_invoice_id'); @@ -273,7 +273,7 @@ // Disposal $langs->load('bills'); - $disposal_date = dol_mktime(12, 0, 0, GETPOSTINT('disposal_datemonth'), GETPOSTINT('disposal_dateday'), GETPOSTINT('disposal_dateyear')); // for date without hour, we use gmt + $disposal_date = dol_mktime(0, 0, 0, GETPOSTINT('disposal_datemonth'), GETPOSTINT('disposal_dateday'), GETPOSTINT('disposal_dateyear'), 'gmt'); // for date without hour, we use gmt $disposal_amount = GETPOSTINT('disposal_amount'); $fk_disposal_type = GETPOSTINT('fk_disposal_type'); $disposal_invoice_id = GETPOSTINT('disposal_invoice_id'); diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index ca2060ac4b207..9dc62995ffc3f 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -84,16 +84,16 @@ class Asset extends CommonObject */ /** - * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'noteditable' => 0, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => "Reference of object"), - 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => '2', 'validate' => 1,), + 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,), 'fk_asset_model' => array('type' => 'integer:AssetModel:asset/class/assetmodel.class.php:1:((status:=:1) and (entity:IN:__SHARED_ENTITIES__))', 'label' => 'AssetModel', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => 1,), 'qty' => array('type' => 'real', 'label' => 'Qty', 'enabled' => 1, 'position' => 50, 'notnull' => 1, 'visible' => 0, 'default' => '1', 'isameasure' => 1, 'css' => 'maxwidth75imp', 'validate' => 1,), - 'acquisition_type' => array('type' => 'smallint', 'label' => 'AssetAcquisitionType', 'enabled' => 1, 'position' => 60, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array('0' => 'AssetAcquisitionTypeNew', '1' => 'AssetAcquisitionTypeOccasion'), 'validate' => 1,), - 'asset_type' => array('type' => 'smallint', 'label' => 'AssetType', 'enabled' => 1, 'position' => 70, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array('0' => 'AssetTypeIntangible', '1' => 'AssetTypeTangible', '2' => 'AssetTypeInProgress', '3' => 'AssetTypeFinancial'), 'validate' => 1,), + 'acquisition_type' => array('type' => 'smallint', 'label' => 'AssetAcquisitionType', 'enabled' => 1, 'position' => 60, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => 'AssetAcquisitionTypeNew', 1 => 'AssetAcquisitionTypeOccasion'), 'validate' => 1,), + 'asset_type' => array('type' => 'smallint', 'label' => 'AssetType', 'enabled' => 1, 'position' => 70, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => 'AssetTypeIntangible', 1 => 'AssetTypeTangible', 2 => 'AssetTypeInProgress', 3 => 'AssetTypeFinancial'), 'validate' => 1,), 'not_depreciated' => array('type' => 'boolean', 'label' => 'AssetNotDepreciated', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'default' => '0', 'visible' => 1, 'validate' => 1,), 'date_acquisition' => array('type' => 'date', 'label' => 'AssetDateAcquisition', 'enabled' => 1, 'position' => 90, 'notnull' => 1, 'visible' => 1,), 'date_start' => array('type' => 'date', 'label' => 'AssetDateStart', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => -1,), @@ -115,7 +115,7 @@ class Asset extends CommonObject 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => 0,), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'position' => 1010, 'notnull' => -1, 'visible' => 0,), - 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '0', 'visible' => 2, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '9' => 'Canceled'), 'validate' => 1,), + 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '0', 'visible' => 2, 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 9 => 'Canceled'), 'validate' => 1,), ); /** @@ -231,12 +231,6 @@ class Asset extends CommonObject */ public $status; - /** - * @var static object oldcopy - */ - public $oldcopy; - - /** * @var AssetDepreciationOptions Used for computed fields of depreciation options class. */ @@ -1120,7 +1114,7 @@ public function calculationDepreciation() } else { $nb_days = min($nb_days_in_year, $nb_days_real); } - $depreciation_ht = (double) price2num($period_amount * $nb_days / $nb_days_in_year, 'MT'); + $depreciation_ht = (float) price2num($period_amount * $nb_days / $nb_days_in_year, 'MT'); } if (getDolGlobalInt('ASSET_ROUND_INTEGER_NUMBER_UPWARDS') == 1) { if ($idx_loop < $max_loop) { // avoid last depreciation value diff --git a/htdocs/asset/class/assetdepreciationoptions.class.php b/htdocs/asset/class/assetdepreciationoptions.class.php index 4b325efc02f9e..ecd6d276726dc 100644 --- a/htdocs/asset/class/assetdepreciationoptions.class.php +++ b/htdocs/asset/class/assetdepreciationoptions.class.php @@ -66,7 +66,7 @@ class AssetDepreciationOptions extends CommonObject */ /** - * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); @@ -82,7 +82,7 @@ class AssetDepreciationOptions extends CommonObject 'depreciation_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDepreciationType', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDepreciationTypeLinear', 1 => 'AssetDepreciationOptionDepreciationTypeDegressive', 2 => 'AssetDepreciationOptionDepreciationTypeExceptional'), 'validate' => 1,), 'degressive_coefficient' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionDegressiveRate', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,'enabled_field' => 'economic:depreciation_type:1'), 'duration' => array('type' => 'integer', 'label' => 'AssetDepreciationOptionDuration', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,), - 'duration_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDurationType', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDurationTypeAnnual', 1 => 'AssetDepreciationOptionDurationTypeMonthly'/*, '2'=>'AssetDepreciationOptionDurationTypeDaily'*/), 'validate' => 1,), + 'duration_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDurationType', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDurationTypeAnnual', 1 => 'AssetDepreciationOptionDurationTypeMonthly'/*, 2=>'AssetDepreciationOptionDurationTypeDaily'*/), 'validate' => 1,), 'rate' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionRate', 'enabled' => 1, 'position' => 50, 'visible' => 3, 'default' => '0', 'isameasure' => 1, 'validate' => 1, 'computed' => '$object->asset_depreciation_options->getRate("economic")',), 'accelerated_depreciation_option' => array('type' => 'boolean', 'label' => 'AssetDepreciationOptionAcceleratedDepreciation', 'enabled' => 1, 'position' => 60, 'column_break' => true, 'notnull' => 0, 'default' => '0', 'visible' => 1, 'validate' => 1,), 'amount_base_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDepreciationHT', 'enabled' => 'isset($object) && get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 90, 'notnull' => 0, 'required' => 1, 'visible' => 1, 'default' => '$object->reversal_amount_ht > 0 ? $object->reversal_amount_ht : $object->acquisition_value_ht', 'isameasure' => 1, 'validate' => 1,), @@ -98,7 +98,7 @@ class AssetDepreciationOptions extends CommonObject 'depreciation_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDepreciationType', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDepreciationTypeLinear', 1 => 'AssetDepreciationOptionDepreciationTypeDegressive', 2 => 'AssetDepreciationOptionDepreciationTypeExceptional'), 'validate' => 1,), 'degressive_coefficient' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionDegressiveRate', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,'enabled_field' => 'accelerated_depreciation:depreciation_type:1'), 'duration' => array('type' => 'integer', 'label' => 'AssetDepreciationOptionDuration', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,), - 'duration_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDurationType', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDurationTypeAnnual', 1 => 'AssetDepreciationOptionDurationTypeMonthly'/*, '2'=>'AssetDepreciationOptionDurationTypeDaily'*/), 'validate' => 1,), + 'duration_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDurationType', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDurationTypeAnnual', 1 => 'AssetDepreciationOptionDurationTypeMonthly'/*, 2=>'AssetDepreciationOptionDurationTypeDaily'*/), 'validate' => 1,), 'rate' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionRate', 'enabled' => 1, 'position' => 50, 'visible' => 3, 'default' => '0', 'isameasure' => 1, 'validate' => 1, 'computed' => '$object->asset_depreciation_options->getRate("accelerated_depreciation")',), 'amount_base_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDepreciationHT', 'enabled' => 'isset($object) && get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 80, 'column_break' => true, 'notnull' => 0, 'required' => 1, 'visible' => 1, 'default' => '$object->reversal_amount_ht > 0 ? $object->reversal_amount_ht : $object->acquisition_value_ht', 'isameasure' => 1, 'validate' => 1,), 'amount_base_deductible_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDeductibleHT', 'enabled' => 'isset($object) && get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 90, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,), @@ -262,7 +262,7 @@ public function setDeprecationOptionsFromPost($class_type = 0) if (in_array($field_info['type'], array('text', 'html'))) { $value = GETPOST($html_name, 'restricthtml'); } elseif ($field_info['type'] == 'date') { - $value = dol_mktime(12, 0, 0, GETPOSTINT($html_name . 'month'), GETPOSTINT($html_name . 'day'), GETPOSTINT($html_name . 'year')); // for date without hour, we use gmt + $value = dol_mktime(0, 0, 0, GETPOSTINT($html_name . 'month'), GETPOSTINT($html_name . 'day'), GETPOSTINT($html_name . 'year'), 'gmt'); // for date without hour, we use gmt } elseif ($field_info['type'] == 'datetime') { $value = dol_mktime(GETPOSTINT($html_name . 'hour'), GETPOSTINT($html_name . 'min'), GETPOSTINT($html_name . 'sec'), GETPOSTINT($html_name . 'month'), GETPOSTINT($html_name . 'day'), GETPOSTINT($html_name . 'year'), 'tzuserrel'); } elseif ($field_info['type'] == 'duration') { diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index 1f2442e2418a6..753b89a4a35ac 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -89,7 +89,7 @@ class AssetModel extends CommonObject */ /** - * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/asset/tpl/depreciation_options_view.tpl.php b/htdocs/asset/tpl/depreciation_options_view.tpl.php index 7b35097b4c68b..0f0a28adf63e6 100644 --- a/htdocs/asset/tpl/depreciation_options_view.tpl.php +++ b/htdocs/asset/tpl/depreciation_options_view.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW +/* Copyright (C) 2021 Open-Dsi + * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -30,6 +30,7 @@ * @var Form $form * @var HookManager $hookmanager * @var AssetDepreciationOptions $assetdepreciationoptions + * @var Translate $langs */ ' @phan-var-force ?Form $form diff --git a/htdocs/asset/tpl/depreciation_view.tpl.php b/htdocs/asset/tpl/depreciation_view.tpl.php index 9fcf366ae3ff5..c0a6d3e1e91b9 100644 --- a/htdocs/asset/tpl/depreciation_view.tpl.php +++ b/htdocs/asset/tpl/depreciation_view.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW +/* Copyright (C) 2021 Open-Dsi + * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -27,8 +27,13 @@ */ /** + * @var AssetDepreciationOptions $assetdepreciationoptions + * @var DoliDB $db * @var Form $form * @var HookManager $hookmanager + * @var Translate $langs + * + * @var string $action */ // Protection to avoid direct call of template diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 95da9f8f9eeab..01cb2c58f1cc3 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -80,7 +80,7 @@ if (GETPOST('search_endyear') != '') { $search_end = dol_mktime(23, 59, 59, $search_endmonth, $search_endday, $search_endyear); } -$search_code = GETPOST('search_code', 'alpha'); +$search_code = GETPOST('search_code', 'array:alpha'); $search_ref = GETPOST('search_ref', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); @@ -138,7 +138,7 @@ $search_fk_user = ''; $search_start = -1; $search_end = -1; - $search_code = ''; + $search_code = array(); $search_ref = ''; $search_amount = ''; $search_showonlyerrors = 0; @@ -496,15 +496,13 @@ // Actions code print '
'; // Ref print ''; -// Link to ref -print ''; - // Amount print ''; @@ -521,6 +519,9 @@ print ''; // Status note +//print ''; + +// Link to original ref into business software print ''; // Action column @@ -543,12 +544,12 @@ print getTitleFieldOfList($langs->trans('Author'), 0, $_SERVER["PHP_SELF"], 'user_fullname', '', $param, '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList($langs->trans('Action'), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList($langs->trans('Ref'), 0, $_SERVER["PHP_SELF"], 'ref_object', '', $param, '', $sortfield, $sortorder, '')."\n"; -print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList($langs->trans('Amount'), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ')."\n"; -print getTitleFieldOfList($langs->trans('DataOfArchivedEvent'), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ', 0, $langs->trans('DataOfArchivedEventHelp').'
'.$langs->trans('DataOfArchivedEventHelp2'), 1)."\n"; +print getTitleFieldOfList($langs->trans('DataOfArchivedEvent'), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ', 0, $langs->trans('DataOfArchivedEventHelp'), 1)."\n"; print getTitleFieldOfList($langs->trans('Fingerprint'), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, '')."\n"; -print getTitleFieldOfList($langs->trans('Status'), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; -print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; +print getTitleFieldOfList($form->textwithpicto($langs->trans('Status'), $langs->trans('DataOfArchivedEventHelp2')), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; +//print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; +print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, '')."\n"; // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, 'class="center"', $sortfield, $sortorder, '')."\n"; @@ -633,12 +634,6 @@ print dol_escape_htmltag($block->ref_object); print ''; - // Link to source object - print ''; @@ -666,14 +661,18 @@ } else { print 'OK'; } - print ''; + //print ''; // Note - print ''; + // Link to source object + print ''; - print ''; + + // Manufacturing cost + print ''; + + // Find sell price of generated product. We suppose we sell it to a company like ours (same country...). + $object->fetch_product(); + $manufacturedvalued = ''; + if (!empty($object->product)) { + $tmparray = $object->product->getSellPrice($mysoc, $mysoc); + $manufacturedvalued = $tmparray['pu_ht'] * $object->qty; + } + print ''; // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; @@ -658,7 +661,7 @@ // Services $filtertype = 1; - $res = $object->fetchLinesbytypeproduct(1); // Load all lines services into ->lines + $res = $object->fetchLinesbytypeproduct($filtertype); // Load all lines services into ->lines $object->calculateCosts(); print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMServicesList'), '', 'service'); diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index 9292c9b262142..ed592c8ff9169 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -33,6 +33,7 @@ * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ @@ -188,8 +189,24 @@ $keyforbreak = 'duration'; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; - print ''; - print ''; + // Manufacturing cost + print ''; + + // Find sell price of generated product. We suppose we sell it to a company like ours (same country...). + $object->fetch_product(); + $manufacturedvalued = ''; + if (!empty($object->product)) { + global $mysoc; + $tmparray = $object->product->getSellPrice($mysoc, $mysoc); + $manufacturedvalued = $tmparray['pu_ht'] * $object->qty; + } + print ''; // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index fe3d40c3f329c..b6fa70ade310a 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -98,19 +98,19 @@ class BOM extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), - 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'default' => 1, 'index' => 1, 'position' => 5), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'default' => '1', 'index' => 1, 'position' => 5), 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'noteditable' => 1, 'visible' => 4, 'position' => 10, 'notnull' => 1, 'default' => '(PROV)', 'index' => 1, 'searchall' => 1, 'comment' => "Reference of BOM", 'showoncombobox' => 1, 'csslist' => 'nowraponall'), - 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'notnull' => 1, 'searchall' => 1, 'showoncombobox' => '2', 'autofocusoncreate' => 1, 'css' => 'minwidth300 maxwidth400', 'csslist' => 'tdoverflowmax200'), + 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'notnull' => 1, 'searchall' => 1, 'showoncombobox' => 2, 'autofocusoncreate' => 1, 'css' => 'minwidth300 maxwidth400', 'csslist' => 'tdoverflowmax200'), 'bomtype' => array('type' => 'integer', 'label' => 'Type', 'enabled' => 1, 'visible' => 1, 'position' => 33, 'notnull' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'Manufacturing', 1 => 'Disassemble'), 'css' => 'minwidth175', 'csslist' => 'minwidth175 center'), //'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')), 'fk_product' => array('type' => 'integer:Product:product/class/product.class.php:1:((finished:is:null) or (finished:!=:0))', 'label' => 'Product', 'picto' => 'product', 'enabled' => 1, 'visible' => 1, 'position' => 35, 'notnull' => 1, 'index' => 1, 'help' => 'ProductBOMHelp', 'css' => 'maxwidth500', 'csslist' => 'tdoverflowmax100'), 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => -1, 'position' => 60, 'notnull' => -1,), - 'qty' => array('type' => 'real', 'label' => 'Quantity', 'enabled' => 1, 'visible' => 1, 'default' => 1, 'position' => 55, 'notnull' => 1, 'isameasure' => 1, 'css' => 'maxwidth50imp right'), - //'efficiency' => array('type'=>'real', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>-1, 'default'=>1, 'position'=>100, 'notnull'=>0, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLossForProductProduced'), + 'qty' => array('type' => 'real', 'label' => 'Quantity', 'enabled' => 1, 'visible' => 1, 'default' => '1', 'position' => 55, 'notnull' => 1, 'isameasure' => 1, 'css' => 'maxwidth50imp right'), + //'efficiency' => array('type'=>'real', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>-1, 'default'=>'1', 'position'=>100, 'notnull'=>0, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLossForProductProduced'), 'duration' => array('type' => 'duration', 'label' => 'EstimatedDuration', 'enabled' => 1, 'visible' => -1, 'position' => 101, 'notnull' => -1, 'css' => 'maxwidth50imp', 'help' => 'EstimatedDurationDesc'), 'fk_warehouse' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label' => 'WarehouseForProduction', 'picto' => 'stock', 'enabled' => 1, 'visible' => -1, 'position' => 102, 'css' => 'maxwidth500', 'csslist' => 'tdoverflowmax100'), 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => -2, 'position' => 161, 'notnull' => -1,), @@ -123,7 +123,7 @@ class BOM extends CommonObject 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'picto' => 'user', 'enabled' => 1, 'visible' => -2, 'position' => 512, 'notnull' => 0, 'csslist' => 'tdoverflowmax100'), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 1000, 'notnull' => -1,), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 1010), - 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 2, 'position' => 1000, 'notnull' => 1, 'default' => 0, 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Enabled', 9 => 'Disabled')), + 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 2, 'position' => 1000, 'notnull' => 1, 'default' => '0', 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Enabled', 9 => 'Disabled')), ); /** @@ -1409,7 +1409,7 @@ public function doScheduledJob() */ public function calculateCosts() { - global $conf, $hookmanager; + global $hookmanager; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $this->unit_cost = 0; diff --git a/htdocs/bom/class/bomline.class.php b/htdocs/bom/class/bomline.class.php index f449120975863..92328b09fcdd0 100644 --- a/htdocs/bom/class/bomline.class.php +++ b/htdocs/bom/class/bomline.class.php @@ -80,7 +80,7 @@ class BOMLine extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'LineID', 'enabled' => 1, 'visible' => -1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 704a16507cfff..9670bef4fad33 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -112,7 +112,7 @@ // Service and workstations are active if ($filtertype == 1 && isModEnabled('workstation')) { - print ''; + print ''; } // Cost print ''; diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index 4ae80f9591502..48fa81082b1ab 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -1,13 +1,13 @@ - * Copyright (C) 2010-2012 Laurent Destailleur - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2012 Cédric Salvador - * Copyright (C) 2012-2014 Raphaël Doursenaud - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2018 Frédéric France - * Copyright (C) 2024 Vincent Maury - * Copyright (C) 2024 MDW +/* Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2010-2012 Laurent Destailleur + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012 Cédric Salvador + * Copyright (C) 2012-2014 Raphaël Doursenaud + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2024 Vincent Maury + * Copyright (C) 2024 MDW * * 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 @@ -34,7 +34,19 @@ */ require_once DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php"; - +/** + * @var BOMLine $line + * @var CommonObject $this + * @var CommonObject $object + * @var HookManager $hookmanager + * @var Societe $buyer + * @var Societe $seller + * @var Translate $langs + * + * @var string $action + * @var int $i + * @var bool $var + */ // Protection to avoid direct call of template if (empty($object) || !is_object($object)) { diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 9addf407186f1..def205588662c 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -37,12 +37,15 @@ /** * @var Conf $conf + * @var CommonObject $this + * @var CommonObject $object * @var CommonObjectLine $line * @var Translate $langs * @var User $user * * @var int $i * @var int $num + * @var string $action */ ' @phan-var-force CommonObjectLine $line diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index ddaa5d99b74a5..6cccf182dad42 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -1,6 +1,5 @@ - * Copyright (C) 2022 Alice Adminson +/* Copyright (C) 2017-2024 Laurent Destailleur * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -93,16 +92,8 @@ $upload_dir = $conf->bookcal->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } -// There is several ways to check permission. -// Set $enablepermissioncheck to 1 to enable a minimum low level of checks -$enablepermissioncheck = 0; -if ($enablepermissioncheck) { - $permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read'); - $permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write'); -} else { - $permissiontoread = 1; - $permissiontoadd = 1; -} +$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read'); +$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write'); // Security check (enable the most restrictive one) //if ($user->socid > 0) accessforbidden(); diff --git a/htdocs/bookcal/availabilities_contact.php b/htdocs/bookcal/availabilities_contact.php index 96f32655b773b..bcd852ee5e6c4 100644 --- a/htdocs/bookcal/availabilities_contact.php +++ b/htdocs/bookcal/availabilities_contact.php @@ -1,6 +1,5 @@ - * Copyright (C) 2022 Alice Adminson +/* Copyright (C) 2007-2024 Laurent Destailleur * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -58,16 +57,8 @@ // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals -// There is several ways to check permission. -// Set $enablepermissioncheck to 1 to enable a minimum low level of checks -$enablepermissioncheck = 0; -if ($enablepermissioncheck) { - $permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read'); - $permission = $user->hasRight('bookcal', 'availabilities', 'write'); -} else { - $permissiontoread = 1; - $permission = 1; -} +$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read'); +$permission = $user->hasRight('bookcal', 'availabilities', 'write'); // Security check (enable the most restrictive one) //if ($user->socid > 0) accessforbidden(); diff --git a/htdocs/bookcal/availabilities_document.php b/htdocs/bookcal/availabilities_document.php index d0741f9b15414..1abdde9a49624 100644 --- a/htdocs/bookcal/availabilities_document.php +++ b/htdocs/bookcal/availabilities_document.php @@ -1,7 +1,6 @@ - * Copyright (C) 2022 Alice Adminson - * Copyright (C) 2024 MDW +/* Copyright (C) 2007-2024 Laurent Destailleur + * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -85,16 +84,8 @@ $upload_dir = $conf->bookcal->multidir_output[$object->entity ? $object->entity : $conf->entity]."/availabilities/".get_exdir(0, 0, 0, 1, $object); } -// There is several ways to check permission. -// Set $enablepermissioncheck to 1 to enable a minimum low level of checks -$enablepermissioncheck = 0; -if ($enablepermissioncheck) { - $permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read'); - $permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php -} else { - $permissiontoread = 1; - $permissiontoadd = 1; -} +$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read'); +$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php // Security check (enable the most restrictive one) //if ($user->socid > 0) accessforbidden(); diff --git a/htdocs/bookcal/availabilities_note.php b/htdocs/bookcal/availabilities_note.php index fdf3a402e742a..b11f001251ba7 100644 --- a/htdocs/bookcal/availabilities_note.php +++ b/htdocs/bookcal/availabilities_note.php @@ -1,6 +1,5 @@ - * Copyright (C) 2022 Alice Adminson +/* Copyright (C) 2007-2024 Laurent Destailleur * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -60,19 +59,9 @@ $upload_dir = $conf->bookcal->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } - -// There is several ways to check permission. -// Set $enablepermissioncheck to 1 to enable a minimum low level of checks -$enablepermissioncheck = 0; -if ($enablepermissioncheck) { - $permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read'); - $permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write'); - $permissionnote = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_setnotes.inc.php -} else { - $permissiontoread = 1; - $permissiontoadd = 1; - $permissionnote = 1; -} +$permissiontoread = $user->hasRight('bookcal', 'availabilities', 'read'); +$permissiontoadd = $user->hasRight('bookcal', 'availabilities', 'write'); +$permissionnote = $user->hasRight('bookcal', 'availabilities', 'write'); // Used by the include of actions_setnotes.inc.php // Security check (enable the most restrictive one) //if ($user->socid > 0) accessforbidden(); diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index c7e69ff01653b..1c5b7c78424a3 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -101,7 +101,7 @@ class Availabilities extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 2, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), @@ -119,10 +119,10 @@ class Availabilities extends CommonObject 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'position' => 1010, 'notnull' => -1, 'visible' => 0,), 'start' => array('type' => 'date', 'label' => 'Start Date', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'searchall' => 1,), 'end' => array('type' => 'date', 'label' => 'End Date', 'enabled' => 1, 'position' => 45, 'notnull' => 1, 'visible' => 1, 'searchall' => 1,), - 'duration' => array('type' => 'integer', 'label' => 'DurationOfRange', 'enabled' => 1, 'position' => 47, 'notnull' => 1, 'visible' => 1, 'default' => '30', 'css' => 'width50 right'), + 'duration' => array('type' => 'integer', 'label' => 'DurationOfRange', 'enabled' => 1, 'position' => 48, 'notnull' => 1, 'visible' => 1, 'default' => '30', 'css' => 'width50 right'), 'startHour' => array('type' => 'integer', 'label' => 'Start Hour', 'enabled' => 1, 'position' => 46, 'notnull' => 1, 'visible' => 1,), - 'endHour' => array('type' => 'integer', 'label' => 'End Hour', 'enabled' => 1, 'position' => 46.5, 'notnull' => 1, 'visible' => 1,), - 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '9' => 'Closed'), 'default' => '1', 'validate' => 1), + 'endHour' => array('type' => 'integer', 'label' => 'End Hour', 'enabled' => 1, 'position' => 47, 'notnull' => 1, 'visible' => 1,), + 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 9 => 'Closed'), 'default' => '1', 'validate' => 1), ); /** * @var int diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index d88e7a46fba58..a1acf818ba98a 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -101,7 +101,7 @@ class Calendar extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'right', 'comment' => "Id"), diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 1483c1b779011..09e0cb52c4748 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -295,21 +295,21 @@ class Categorie extends CommonObject public $imgHeight; public $fields = array( - "rowid" => array("type" => "integer", "label" => "TechnicalID", "enabled" => "1", 'position' => 10, 'notnull' => 1, "visible" => "-1",), - "fk_parent" => array("type" => "integer", "label" => "Fkparent", "enabled" => "1", 'position' => 20, 'notnull' => 1, "visible" => "-1", "css" => "maxwidth500 widthcentpercentminusxx",), - "label" => array("type" => "varchar(180)", "label" => "Label", "enabled" => "1", 'position' => 25, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1", "css" => "minwidth300", "cssview" => "wordbreak", "csslist" => "tdoverflowmax150",), - "ref_ext" => array("type" => "varchar(255)", "label" => "Refext", "enabled" => "1", 'position' => 30, 'notnull' => 0, "visible" => "0", "alwayseditable" => "1",), - "type" => array("type" => "integer", "label" => "Type", "enabled" => "1", 'position' => 35, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1",), - "description" => array("type" => "text", "label" => "Description", "enabled" => "1", 'position' => 40, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), - "color" => array("type" => "varchar(8)", "label" => "Color", "enabled" => "1", 'position' => 45, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), - "position" => array("type" => "integer", "label" => "Position", "enabled" => "1", 'position' => 50, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), - "fk_soc" => array("type" => "integer:Societe:societe/class/societe.class.php", "label" => "ThirdParty", "picto" => "company", "enabled" => "1", 'position' => 55, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1", "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150",), - "visible" => array("type" => "integer", "label" => "Visible", "enabled" => "1", 'position' => 60, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1",), - "import_key" => array("type" => "varchar(14)", "label" => "ImportId", "enabled" => "1", 'position' => 900, 'notnull' => 0, "visible" => "-2", "alwayseditable" => "1",), - "date_creation" => array("type" => "datetime", "label" => "Datecreation", "enabled" => "1", 'position' => 70, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), - "tms" => array("type" => "timestamp", "label" => "DateModification", "enabled" => "1", 'position' => 75, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1",), - "fk_user_creat" => array("type" => "integer:User:user/class/user.class.php", "label" => "UserAuthor", "enabled" => "1", 'position' => 80, 'notnull' => 0, "visible" => "-2", "alwayseditable" => "1", "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150",), - "fk_user_modif" => array("type" => "integer:User:user/class/user.class.php", "label" => "UserModif", "enabled" => "1", 'position' => 85, 'notnull' => -1, "visible" => "-2", "alwayseditable" => "1", "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150",), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => -1,), + 'fk_parent' => array('type' => 'integer', 'label' => 'Fkparent', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx',), + 'label' => array('type' => 'varchar(180)', 'label' => 'Label', 'enabled' => 1, 'position' => 25, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax150',), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'Refext', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 0, 'alwayseditable' => 1,), + 'type' => array('type' => 'integer', 'label' => 'Type', 'enabled' => 1, 'position' => 35, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1,), + 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), + 'color' => array('type' => 'varchar(8)', 'label' => 'Color', 'enabled' => 1, 'position' => 45, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), + 'position' => array('type' => 'integer', 'label' => 'Position', 'enabled' => 1, 'position' => 50, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'picto' => 'company', 'enabled' => 1, 'position' => 55, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150',), + 'visible' => array('type' => 'integer', 'label' => 'Visible', 'enabled' => 1, 'position' => 60, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1,), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 900, 'notnull' => 0, 'visible' => -2, 'alwayseditable' => 1,), + 'date_creation' => array('type' => 'datetime', 'label' => 'Datecreation', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 75, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1,), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => -2, 'alwayseditable' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150',), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 85, 'notnull' => -1, 'visible' => -2, 'alwayseditable' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150',), ); /** diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 211e2d1f7b4be..725e43717cdb3 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -526,7 +526,7 @@ $permission = ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')); $showclassifyform = ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')); - $prods = $object->getObjectsInCateg($type, 0, $limit, $offset); + $prods = $object->getObjectsInCateg($type, 0, $limit, $offset, 'ref'); if ($prods < 0) { dol_print_error($db, $object->error, $object->errors); } else { @@ -606,7 +606,7 @@ $permission = $user->hasRight('societe', 'creer'); $showclassifyform = $user->hasRight('societe', 'creer'); - $socs = $object->getObjectsInCateg($type, 0, $limit, $offset); + $socs = $object->getObjectsInCateg($type, 0, $limit, $offset, 'nom'); if ($socs < 0) { dol_print_error($db, $object->error, $object->errors); } else { @@ -686,7 +686,7 @@ $permission = $user->hasRight('societe', 'creer'); $showclassifyform = $user->hasRight('societe', 'creer'); - $socs = $object->getObjectsInCateg($type, 0, $limit, $offset); + $socs = $object->getObjectsInCateg($type, 0, $limit, $offset, 'nom'); if ($socs < 0) { dol_print_error($db, $object->error, $object->errors); @@ -770,7 +770,7 @@ $permission = $user->hasRight('adherent', 'creer'); $showclassifyform = $user->hasRight('adherent', 'creer'); - $members = $object->getObjectsInCateg($type, 0, $limit, $offset); + $members = $object->getObjectsInCateg($type, 0, $limit, $offset, 'lastname'); if ($members < 0) { dol_print_error($db, $object->error, $object->errors); } else { @@ -852,7 +852,7 @@ $permission = $user->hasRight('societe', 'creer'); $showclassifyform = $user->hasRight('societe', 'creer'); - $contacts = $object->getObjectsInCateg($type, 0, $limit, $offset); + $contacts = $object->getObjectsInCateg($type, 0, $limit, $offset, 'lastname'); if (is_numeric($contacts) && $contacts < 0) { dol_print_error($db, $object->error, $object->errors); } else { @@ -1103,7 +1103,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $showclassifyform = $user->hasRight("user", "user", "creer"); - $users = $object->getObjectsInCateg($type); + $users = $object->getObjectsInCateg($type, 0, 0, 0, 'lastname'); if ($users < 0) { dol_print_error($db, $object->error, $object->errors); } else { diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index e7f8a9b1139a9..010f405e54940 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1546,8 +1546,8 @@ function init_repeat() $listofuserid[$firstelem['id']]['transparency'] = (GETPOSTISSET('transparency') ? GETPOST('transparency', 'alpha') : 0); // 0 by default when refreshing } } - print '
'; - print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, array(), 0, '', array(), 0, 0, 0, 'AND u.statut != 0', 1, $listofuserid, $listofcontactid, $listofotherid); + print '
'; + print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, array(), 0, '', array(), 0, 0, 0, 'u.statut:<>:0', 1, $listofuserid, $listofcontactid, $listofotherid); print '
'; print '
'; @@ -1811,7 +1811,7 @@ function init_repeat() print "\n".''."\n"; } diff --git a/htdocs/core/class/dolgeophp.class.php b/htdocs/core/class/dolgeophp.class.php index 78f6bfed62073..d5211bcc4368e 100644 --- a/htdocs/core/class/dolgeophp.class.php +++ b/htdocs/core/class/dolgeophp.class.php @@ -115,10 +115,15 @@ public function getWkt($geojson) { $value_key = ''; - $geom = geoPHP::load($geojson, 'json'); - if ($geom) { - '@phan-var-force Geometry $geom'; - $value_key = $geom->out('wkt'); + try { + $geom = geoPHP::load($geojson, 'json'); + if ($geom) { + '@phan-var-force Geometry $geom'; + $value_key = $geom->out('wkt'); + } + } catch (Exception $e) { + // Do nothing + $value_key = 'Error: Bad value for property'; } return $value_key; } diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index ca71e0df442d9..79cff89f228f2 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1213,8 +1213,8 @@ private function draw_chart($file, $fileurl) // @phpstan-ignore-line $values[$x] = (is_numeric($tmpvalue) ? $tmpvalue : null); $arrayofgroupslegend[$i] = array( 'stacknum' => (int) $tmpykey[1], - 'legend' => $this->Legend[$tmpykey[1]], - 'legendwithgroup' => $this->Legend[$tmpykey[1]] . ' - ' . $tmpykey[2] + 'legend' => $this->Legend[$tmpykey[1]] ?? '', + 'legendwithgroup' => ($this->Legend[$tmpykey[1]] ?? '') . ' - ' . $tmpykey[2] ); } else { $tmpvalue = (array_key_exists('y_' . $i, $valarray) ? $valarray['y_' . $i] : $valarray[$i + 1]); diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 5d98275fa21a6..fb2f9a289e46b 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -87,7 +87,7 @@ class EmailSenderProfile extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id',), @@ -99,7 +99,7 @@ class EmailSenderProfile extends CommonObject 'position' => array('type' => 'integer', 'label' => 'Position', 'visible' => 1, 'enabled' => 1, 'position' => 405, 'notnull' => -1, 'index' => 1,), 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'visible' => -1, 'enabled' => 1, 'position' => 500, 'notnull' => 1,), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'visible' => -1, 'enabled' => 1, 'position' => 500, 'notnull' => 1,), - 'active' => array('type' => 'integer', 'label' => 'Status', 'visible' => 1, 'enabled' => 1, 'default' => 1, 'position' => 1000, 'notnull' => 1, 'index' => 1, 'arrayofkeyval' => array(0 => 'Disabled', 1 => 'Enabled')), + 'active' => array('type' => 'integer', 'label' => 'Status', 'visible' => 1, 'enabled' => 1, 'default' => '1', 'position' => 1000, 'notnull' => 1, 'index' => 1, 'arrayofkeyval' => array(0 => 'Disabled', 1 => 'Enabled')), ); /** diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 3331cceedfa56..d1f80baadb242 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -127,7 +127,7 @@ class Events // extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 6aca908bffda1..752a1527f5b71 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -13,6 +13,7 @@ * Copyright (C) 2022 Antonin MARCHAL * Copyright (C) 2024 MDW * Copyright (C) 2024 Benoît PASCAL + * Copyright (C) 2024 Joachim Kueter * * 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 @@ -46,7 +47,7 @@ class ExtraFields public $db; /** - * @var array,type:array,size:array,default:array,computed:array,unique:array,required:array,param:array,perms:array,list:array,pos:array,totalizable:array,help:array,printable:array,enabled:array,langfile:array,css:array,csslist:array,cssview:array,hidden:array,mandatoryfieldsofotherentities:array,loaded?:int,count:int}> New array to store extrafields definition Note: count set as present to avoid static analysis notices + * @var array,type:array,size:array,default:array,computed:array,unique:array,required:array,param:array,perms:array,list:array,pos:array,totalizable:array,help:array,printable:array,enabled:array,langfile:array,css:array,csslist:array,cssview:array,hidden:array,mandatoryfieldsofotherentities:array,alwayseditable:array>,loaded?:int,count:int}> New array to store extrafields definition Note: count set as present to avoid static analysis notices */ public $attributes = array(); @@ -180,7 +181,9 @@ public function addExtraField($attrname, $label, $type, $pos, $size, $elementtyp // Add declaration of field into table $result2 = $this->create_label($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $param, $alwayseditable, $perms, $list, $help, $default_value, $computed, $entity, $langfile, $enabled, $totalizable, $printable, $moreparams); $err2 = $this->errno; - if ($result2 > 0 || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS')) { + if ($result2 > 0 + || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS') + || ($type == 'separate' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS')) { $this->error = ''; $this->errno = '0'; return 1; @@ -648,7 +651,7 @@ private function delete_label($attrname, $elementtype = '') * @param int<0,1> $required Is field required or not * @param int<0,1> $pos Position of attribute * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) - * @param int $alwayseditable Is attribute always editable regardless of the document status + * @param int<0,1> $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check * @param string $list Visibility * @param string $help Help on tooltip @@ -1497,9 +1500,9 @@ public function showInputField($key, $value, $moreparam = '', $keysuffix = '', $ $sqlwhere .= ' AND entity = '.((int) $conf->entity); } $sql .= $sqlwhere; - //print $sql; - $sql .= ' ORDER BY '.implode(', ', $fields_label); + $sql .= $this->db->order(implode(',', $fields_label)); + //print $sql; dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); $resql = $this->db->query($sql); @@ -2008,7 +2011,6 @@ public function showOutputField($key, $value, $moreparam = '', $extrafieldsobjec } //if ($computed) $value = // $value is already calculated into $value before calling this method - $showsize = 0; if ($type == 'date') { $showsize = 10; @@ -2036,9 +2038,9 @@ public function showOutputField($key, $value, $moreparam = '', $extrafieldsobjec } elseif ($type == 'double') { if (!empty($value)) { //$value=price($value); - $sizeparts = explode(",", $size); - $number_decimals = array_key_exists(1, $sizeparts) ? $sizeparts[1] : 0; - $value = price($value, 0, $outputlangs, 0, 0, $number_decimals, ''); + //$sizeparts = explode(",", $size); + //$number_decimals = array_key_exists(1, $sizeparts) ? $sizeparts[1] : 0; + $value = price($value, 0, $outputlangs, 0, 0, -2, ''); } } elseif ($type == 'boolean') { $checked = ''; @@ -2851,7 +2853,11 @@ public function getOptionalsFromPost($extrafieldsobjectkey, $keysuffix = '', $ke if (!GETPOSTISSET($keyprefix."options_".$key.$keysuffix)) { continue; // Value was not provided, we should not set it. } + $value_key = GETPOST($keyprefix."options_".$key.$keysuffix); + if ($value_key === '') { + $value_key = null; + } } $array_options[$keyprefix."options_".$key] = $value_key; // No keyprefix here. keyprefix is used only for read. diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 8a7022106beef..8cef23ff28207 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -232,7 +232,7 @@ public function executeHooks($method, $parameters = array(), &$object = null, &$ // Define type of hook ('output' or 'addreplace'). $hooktype = 'addreplace'; - // TODO Remove hooks with type 'output' (example createFrom). All hooks must be converted into 'addreplace' hooks. + // TODO Remove hooks with type 'output' (example createFrom). All these hooks must be converted into 'addreplace' hooks. if (in_array($method, array( 'createFrom', 'dashboardAccountancy', diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d27e941d1e6d5..c8965d32c6ae0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1149,15 +1149,16 @@ public function select_incoterms($selected = '', $location_incoterms = '', $page * Return list of types of lines (product or service) * Example: 0=product, 1=service, 9=other (for external module) * - * @param string $selected Preselected type - * @param string $htmlname Name of field in html form - * @param int<0,1>|string $showempty Add an empty field - * @param int $hidetext Do not show label 'Type' before combo box (used only if there is at least 2 choices to select) - * @param integer $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, 2=Force to show only Products, 3=Force to show only services, -1=Force none (and set hidden field to 'service') - * @param string $morecss More css + * @param string $selected Preselected type + * @param string $htmlname Name of field in html form + * @param int<0,1>|string $showempty Add an empty field + * @param int $hidetext Do not show label 'Type' before combo box (used only if there is at least 2 choices to select) + * @param integer $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, 2=Force to show only Products, 3=Force to show only services, -1=Force none (and set hidden field to 'service') + * @param string $morecss More css + * @param int $useajaxcombo 1=Use ajaxcombo * @return void */ - public function select_type_of_lines($selected = '', $htmlname = 'type', $showempty = 0, $hidetext = 0, $forceall = 0, $morecss = "") + public function select_type_of_lines($selected = '', $htmlname = 'type', $showempty = 0, $hidetext = 0, $forceall = 0, $morecss = "", $useajaxcombo = 1) { // phpcs:enable global $langs; @@ -1166,11 +1167,11 @@ public function select_type_of_lines($selected = '', $htmlname = 'type', $showem if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service")) || (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) { if (empty($hidetext)) { - print $langs->trans("Type") . ': '; + print $langs->trans("Type").'...'; } print ''; - print ajax_combobox('select_' . $htmlname); + + if ($useajaxcombo) { + print ajax_combobox('select_' . $htmlname); + } //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); } if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) { @@ -2228,7 +2232,17 @@ public function select_dolusers($selected = '', $htmlname = 'userid', $show_empt $sql .= " AND u.fk_soc IS NULL"; } if (!empty($morefilter)) { - $sql .= " " . $morefilter; + $errormessage = ''; + $sql .= forgeSQLFromUniversalSearchCriteria($morefilter, $errormessage); + if ($errormessage) { + $this->errors[] = $errormessage; + dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR); + if ($outputmode == 0) { + return 'Error bad param $morefilter'; + } else { + return array(); + } + } } //Add hook to filter on user (for example on usergroup define in custom modules) @@ -2425,28 +2439,29 @@ public function select_dolusers($selected = '', $htmlname = 'userid', $show_empt * Return select list of users. Selected users are stored into session. * List of users are provided into $_SESSION['assignedtouser']. * - * @param string $action Value for $action - * @param string $htmlname Field name in form - * @param int<0,1> $show_empty 0=list without the empty value, 1=add empty value - * @param int[] $exclude Array list of users id to exclude - * @param int<0,1> $disabled If select list must be disabled - * @param int[]|string $include Array list of users id to include or 'hierarchy' to have only supervised users - * @param int[]|int $enableonly Array list of users id to be enabled. All other must be disabled - * @param string $force_entity '0' or Ids of environment to force - * @param int $maxlength Maximum length of string into list (0=no limit) - * @param int<0,1> $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status - * @param string $morefilter Add more filters into sql request - * @param int $showproperties Show properties of each attendees - * @param int[] $listofuserid Array with properties of each user - * @param int[] $listofcontactid Array with properties of each contact - * @param int[] $listofotherid Array with properties of each other contact - * @return string HTML select string + * @param string $action Value for $action + * @param string $htmlname Field name in form + * @param int<0,1> $show_empty 0=list without the empty value, 1=add empty value + * @param int[] $exclude Array list of users id to exclude + * @param int<0,1> $disabled If select list must be disabled + * @param int[]|''|'hierarchy'|'hierarchyme' $include Array list of users id to include or 'hierarchy' to have only supervised users + * @param int[]|int $enableonly Array list of users id to be enabled. All other must be disabled + * @param string $force_entity '0' or Ids of environment to force + * @param int $maxlength Maximum length of string into list (0=no limit) + * @param int<0,1> $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status + * @param string $morefilter Add more filters into sql request (Example: '(employee:=:1)'). This value must not come from user input. + * @param int $showproperties Show properties of each attendees + * @param int[] $listofuserid Array with properties of each user + * @param int[] $listofcontactid Array with properties of each contact + * @param int[] $listofotherid Array with properties of each other contact + * @param int $canremoveowner 1 if we can remove owner, 0=no way + * @return string HTML select string * @see select_dolgroups() */ - public function select_dolusers_forevent($action = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = array(), $enableonly = array(), $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $showproperties = 0, $listofuserid = array(), $listofcontactid = array(), $listofotherid = array()) + public function select_dolusers_forevent($action = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = array(), $enableonly = array(), $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $showproperties = 0, $listofuserid = array(), $listofcontactid = array(), $listofotherid = array(), $canremoveowner = 1) { // phpcs:enable - global $langs; + global $langs, $user; $userstatic = new User($this->db); $out = ''; @@ -2479,8 +2494,25 @@ public function select_dolusers_forevent($action = '', $htmlname = 'userid', $sh $ownerid = $value['id']; $out .= ' (' . $langs->trans("Owner") . ')'; } + // Add picto to delete owner/assignee if ($nbassignetouser > 1 && $action != 'view') { - $out .= ' '; + $canremoveassignee = 1; + if ($i == 0) { + // We are on the owner of the event + if (!$canremoveowner) { + $canremoveassignee = 0; + } + if (!$user->hasRight('agenda', 'allactions', 'create')) { + $canremoveassignee = 0; // Can't remove the owner + } + } else { + // We are not on the owner of the event but on a secondary assignee + } + if ($canremoveassignee) { + // If user has all permission, he should be ableto remove a assignee. + // If user has not all permission, he can onlyremove assignee of other (he can't remove itself) + $out .= ' '; + } } // Show my availability if ($showproperties) { @@ -2630,7 +2662,7 @@ public function select_dolresources_forevent($action = '', $htmlname = 'userid', * @param array $ajaxoptions Options for ajax_autocompleter * @param int $socid Thirdparty Id (to get also price dedicated to this customer) * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. - * @param int $forcecombo Force to use combo box + * @param int $forcecombo Force to use combo box. * @param string $morecss Add more css on select * @param int<0,1> $hidepriceinlabel 1=Hide prices in label * @param string $warehouseStatus Warehouse status filter to count the quantity in stock. Following comma separated filter options can be used @@ -2641,7 +2673,6 @@ public function select_dolresources_forevent($action = '', $htmlname = 'userid', * @param int<0,1> $nooutput No print if 1, return the output into a string * @param int<-1,1> $status_purchase Purchase status: -1=No filter on purchase status, 0=Products not on purchase, 1=Products on purchase * @param int $warehouseId Filter by Warehouses Id where there is real stock - * * @return void|string */ public function select_produits($selected = 0, $htmlname = 'productid', $filtertype = '', $limit = 0, $price_level = 0, $status = 1, $finished = 2, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $hidepriceinlabel = 0, $warehouseStatus = '', $selected_combinations = null, $nooutput = 0, $status_purchase = -1, $warehouseId = 0) @@ -2666,7 +2697,7 @@ public function select_produits($selected = 0, $htmlname = 'productid', $filtert } if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) { - $placeholder = ''; + $placeholder = (is_numeric($showempty) ? '' : 'placeholder="'.dolPrintHTML($showempty).'"'); if ($selected && empty($selected_input_value)) { require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; @@ -2688,6 +2719,7 @@ public function select_produits($selected = 0, $htmlname = 'productid', $filtert if ((int) $warehouseId > 0) { $urloption .= '&warehouseid=' . (int) $warehouseId; } + $out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions); if (isModEnabled('variants') && is_array($selected_combinations)) { @@ -2774,6 +2806,7 @@ public function select_produits($selected = 0, $htmlname = 'productid', $filtert $out .= img_picto($langs->trans("Search"), 'search'); } } + $out .= ''; if ($hidelabel == 3) { $out .= img_picto($langs->trans("Search"), 'search'); @@ -2794,16 +2827,16 @@ public function select_produits($selected = 0, $htmlname = 'productid', $filtert /** * Return list of BOM for customer in Ajax if Ajax activated or go to select_produits_list * - * @param string $selected Preselected BOM id - * @param string $htmlname Name of HTML select field (must be unique in page). - * @param int $limit Limit on number of returned lines - * @param int $status Sell status -1=Return all bom, 0=Draft BOM, 1=Validated BOM - * @param int $type type of the BOM (-1=Return all BOM, 0=Return disassemble BOM, 1=Return manufacturing BOM) - * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. - * @param string $morecss Add more css on select - * @param string $nooutput No print, return the output into a string - * @param int $forcecombo Force to use combo box - * @param string[] $TProducts Add filter on a defined product + * @param string $selected Preselected BOM id + * @param string $htmlname Name of HTML select field (must be unique in page). + * @param int $limit Limit on number of returned lines + * @param int $status Sell status -1=Return all bom, 0=Draft BOM, 1=Validated BOM + * @param int $type Type of the BOM (-1=Return all BOM, 0=Return disassemble BOM, 1=Return manufacturing BOM) + * @param string|int<0,1> $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param string $morecss Add more css on select + * @param string $nooutput No print, return the output into a string + * @param int $forcecombo Force to use combo box + * @param string[] $TProducts Add filter on a defined product * @return void|string */ public function select_bom($selected = '', $htmlname = 'bom_id', $limit = 0, $status = 1, $type = 0, $showempty = '1', $morecss = '', $nooutput = '', $forcecombo = 0, $TProducts = []) @@ -5095,7 +5128,7 @@ public function selectUnits($selected = '', $htmlname = 'units', $showempty = 0, $resql = $this->db->query($sql); if ($resql && $this->db->num_rows($resql) > 0) { if ($showempty) { - $return .= ''; + $return .= ''; } while ($res = $this->db->fetch_object($resql)) { @@ -5111,6 +5144,8 @@ public function selectUnits($selected = '', $htmlname = 'units', $showempty = 0, } } $return .= ''; + + $return .= ajax_combobox($htmlname); } return $return; } @@ -5138,7 +5173,7 @@ public function select_comptes($selected = '', $htmlname = 'accountid', $status $out = ''; - $langs->load("admin"); + $langs->loadLangs(array("admin", "banks")); $num = 0; $sql = "SELECT rowid, label, bank, clos as status, currency_code"; @@ -5164,7 +5199,7 @@ public function select_comptes($selected = '', $htmlname = 'accountid', $status if ($status == 0) { $out .= ''; // Group => Category @@ -469,12 +469,12 @@ function(response) { if ($public) { $filter = '(public:=:1)'; } - $this->selectGroupTickets($category_code, 'category_code', $filter, 2, 1, 0, 0, 'minwidth200 maxwidth500'); + $this->selectGroupTickets($category_code, 'category_code', $filter, 2, 'ifone', 0, 0, 'minwidth200 maxwidth500'); print ''; // Severity => Priority print ''; if (isModEnabled('knowledgemanagement')) { @@ -869,8 +869,8 @@ function(response) { * @param string|int[] $selected Id of preselected field or array of Ids * @param string $htmlname Nom de la zone select * @param string $filtertype To filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz)) - * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code - * @param int $empty 1=peut etre vide, 0 sinon + * @param int $format 0=id+label, 1=code+code, 2=code+label, 3=id+code + * @param int|string $empty 1 = can be empty or 'string' to show the string as the empty value, 0 = can't be empty, 'ifone' = can be empty but autoselected if there is one only * @param int $noadmininfo 0=Add admin info, 1=Disable admin info * @param int $maxlength Max length of label * @param string $morecss More CSS @@ -895,8 +895,8 @@ public function selectTypesTickets($selected = '', $htmlname = 'tickettype', $fi $ticketstat->loadCacheTypesTickets(); print ''; if ($empty) { - print ''; + print ''; } if (is_array($ticketstat->cache_category_tickets) && count($ticketstat->cache_category_tickets)) { @@ -1042,7 +1044,7 @@ public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', print ' selected="selected"'; } elseif ($arraycategories['use_default'] == "1" && empty($selected)) { print ' selected="selected"'; - } elseif (count($ticketstat->cache_category_tickets) == 1) { // If only 1 choice, we autoselect it + } elseif (count($ticketstat->cache_category_tickets) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it print ' selected="selected"'; } @@ -1075,7 +1077,7 @@ public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', } print ajax_combobox('select'.$htmlname); - } elseif ($htmlname != '') { + } elseif ($htmlname != '') { // complexe mode using selection of group using a combo for each level (when using a hierarchy of groups). $selectedgroups = array(); $groupvalue = ""; $groupticket = GETPOST($htmlname, 'aZ09'); @@ -1320,14 +1322,14 @@ public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', /** * Return html list of ticket severitys (priorities) * - * @param string $selected Id severity pre-selected - * @param string $htmlname Name of the select area - * @param string $filtertype To filter on field type in llx_c_ticket_severity (array('code'=>xx,'label'=>zz)) - * @param int $format 0 = id+label, 1 = code+code, 2 = code+label, 3 = id+code - * @param int $empty 1 = can be empty, 0 = or not - * @param int $noadmininfo 0 = add admin info, 1 = disable admin info - * @param int $maxlength Max length of label - * @param string $morecss More CSS + * @param string $selected Id severity pre-selected + * @param string $htmlname Name of the select area + * @param string $filtertype To filter on field type in llx_c_ticket_severity (array('code'=>xx,'label'=>zz)) + * @param int $format 0 = id+label, 1 = code+code, 2 = code+label, 3 = id+code + * @param int|string $empty 1 = can be empty or 'string' to show the string as the empty value, 0 = can't be empty, 'ifone' = can be empty but autoselected if there is one only + * @param int $noadmininfo 0 = add admin info, 1 = disable admin info + * @param int $maxlength Max length of label + * @param string $morecss More CSS * @return void */ public function selectSeveritiesTickets($selected = '', $htmlname = 'ticketseverity', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '') @@ -1348,7 +1350,7 @@ public function selectSeveritiesTickets($selected = '', $htmlname = 'ticketsever print ''; $text .= ''; $text .= ''; - $text .= '
'; -print $form->selectarray('search_code', $block_static->trackedevents, $search_code, 1, 0, 0, '', 1, 0, 0, 'ASC', 'maxwidth150', 1); +//print $form->selectarray('search_code', $block_static->trackedevents, $search_code, 1, 0, 0, '', 1, 0, 0, 'ASC', 'maxwidth150', 1); +print $form->multiselectarray('search_code', $block_static->trackedevents, $search_code, 0, 0, 'maxwidth150', 1); print ''; - print ''; // $object_link can be a ''; - // Amount print ''.price($block->amounts).''; + //print ''; if (!$checkresult[$block->id] || ($loweridinerror && $block->id >= $loweridinerror)) { // If error if ($checkresult[$block->id]) { print $form->textwithpicto('', $langs->trans('OkCheckFingerprintValidityButChainIsKo')); + } else { + //print $form->textwithpicto('', $langs->trans('KoCheckFingerprintValidity')); } + } else { + //print $form->textwithpicto('', $langs->trans('DataOfArchivedEventHelp2')); } if (getDolGlobalString('BLOCKEDLOG_USE_REMOTE_AUTHORITY') && getDolGlobalString('BLOCKEDLOG_AUTHORITY_URL')) { @@ -681,6 +680,12 @@ } print ''; + print ''; // $object_link can be a ''; + // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''; diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index ef209ae6b8549..c959800cef72f 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -169,7 +169,7 @@ public function loadTrackedEvents() // Customer Invoice/Facture / Payment if (isModEnabled('invoice')) { $this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE'; - $this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE'; + //$this->trackedevents['BILL_UPDATE'] = 'logBILL_UPDATE'; $this->trackedevents['BILL_SENTBYMAIL'] = 'logBILL_SENTBYMAIL'; $this->trackedevents['DOC_DOWNLOAD'] = 'BlockedLogBillDownload'; $this->trackedevents['DOC_PREVIEW'] = 'BlockedLogBillPreview'; @@ -532,7 +532,8 @@ public function setObjectData(&$object, $action, $amounts, $fuser = null) continue; // Discard some properties } if (!in_array($key, array( - 'ref', 'ref_client', 'ref_supplier', 'date', 'datef', 'datev', 'type', 'total_ht', 'total_tva', 'total_ttc', 'localtax1', 'localtax2', 'revenuestamp', 'datepointoftax', 'note_public', 'lines' + 'ref', 'ref_client', 'ref_supplier', 'date', 'datef', 'datev', 'type', 'total_ht', 'total_tva', 'total_ttc', 'localtax1', 'localtax2', 'revenuestamp', 'datepointoftax', 'note_public', 'lines', + 'module_source', 'pos_source' ))) { continue; // Discard if not into a dedicated list } @@ -542,7 +543,13 @@ public function setObjectData(&$object, $action, $amounts, $fuser = null) $lineid++; foreach ($tmpline as $keyline => $valueline) { if (!in_array($keyline, array( - 'ref', 'multicurrency_code', 'multicurrency_total_ht', 'multicurrency_total_tva', 'multicurrency_total_ttc', 'qty', 'product_type', 'product_label', 'vat_src_code', 'tva_tx', 'info_bits', 'localtax1_tx', 'localtax2_tx', 'total_ht', 'total_tva', 'total_ttc', 'total_localtax1', 'total_localtax2' + 'ref', 'product_type', 'product_label', + 'qty', + 'subprice', + 'vat_src_code', 'tva_tx', 'localtax1_tx', 'localtax2_tx', + 'total_ht', 'total_tva', 'total_ttc', 'total_localtax1', 'total_localtax2', + 'multicurrency_code', 'multicurrency_total_ht', 'multicurrency_total_tva', 'multicurrency_total_ttc', + 'info_bits', 'special_code', ))) { continue; // Discard if not into a dedicated list } @@ -846,12 +853,12 @@ public function fetch($id) */ public function dolEncodeBlockedData($data, $mode = 0) { + $aaa = ''; try { $aaa = json_encode($data); } catch (Exception $e) { - //print $e->getErrs); + // print $e->getErrs); } - //var_dump($aaa); return $aaa; } @@ -866,12 +873,12 @@ public function dolEncodeBlockedData($data, $mode = 0) */ public function dolDecodeBlockedData($data, $mode = 0) { + $aaa = null; try { $aaa = (object) jsonOrUnserialize($data); } catch (Exception $e) { - //print $e->getErrs); + // print $e->getErrs); } - //var_dump($aaa); return $aaa; } @@ -901,12 +908,10 @@ public function setCertified() */ public function create($user, $forcesignature = '') { - global $conf, $langs, $hookmanager; + global $conf, $langs; $langs->load('blockedlog'); - $error = 0; - // Clean data $this->amounts = (float) $this->amounts; @@ -941,9 +946,9 @@ public function create($user, $forcesignature = '') $this->db->begin(); - $previoushash = $this->getPreviousHash(1, 0); // This get last record and lock database until insert is done + $previoushash = $this->getPreviousHash(1, 0); // This get last record and lock database until insert is done and transaction closed - $keyforsignature = $this->buildKeyForSignature(); + $keyforsignature = $this->buildKeyForSignature(); // All the information for the has (meta data + data saved) include_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; @@ -1142,18 +1147,18 @@ public function getPreviousHash($withlock = 0, $beforeid = 0) /** * Return array of log objects (with criteria) * - * @param string $element element to search - * @param int $fk_object id of object to search - * @param int<0,max> $limit max number of element, 0 for all - * @param string $sortfield sort field - * @param string $sortorder sort order - * @param int $search_fk_user id of user(s) - * @param int $search_start start time limit - * @param int $search_end end time limit - * @param string $search_ref search ref - * @param string $search_amount search amount - * @param string $search_code search code - * @return BlockedLog[]|int<-2,-1> Array of object log or <0 if error + * @param string $element element to search + * @param int $fk_object id of object to search + * @param int<0,max> $limit max number of element, 0 for all + * @param string $sortfield sort field + * @param string $sortorder sort order + * @param int $search_fk_user id of user(s) + * @param int $search_start start time limit + * @param int $search_end end time limit + * @param string $search_ref search ref + * @param string $search_amount search amount + * @param string|string[] $search_code search code + * @return BlockedLog[]|int<-2,-1> Array of object log or <0 if error */ public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_fk_user = -1, $search_start = -1, $search_end = -1, $search_ref = '', $search_amount = '', $search_code = '') { @@ -1195,8 +1200,14 @@ public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sorto if ($search_amount != '') { $sql .= natural_search("amounts", $search_amount, 1); } - if ($search_code != '' && $search_code != '-1') { - $sql .= natural_search("action", $search_code, 3); + if (is_array($search_code)) { + if (!empty($search_code)) { + $sql .= natural_search("action", implode(',', $search_code), 3); + } + } else { + if ($search_code != '' && $search_code != '-1') { + $sql .= natural_search("action", $search_code, 3); + } } $sql .= $this->db->order($sortfield, $sortorder); diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index b72904ad0f3b9..7d1ffa9e6097b 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -425,10 +425,6 @@ $formquestion = array(); if (isModEnabled('bom')) { $langs->load("mrp"); - $forcecombo = 0; - if ($conf->browser->name == 'ie') { - $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy - } $formquestion = array( // 'text' => $langs->trans("ConfirmClone"), // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), @@ -453,10 +449,6 @@ $formquestion = array(); if (isModEnabled('bom')) { $langs->load("mrp"); - $forcecombo = 0; - if ($conf->browser->name == 'ie') { - $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy - } $formquestion = array( // 'text' => $langs->trans("ConfirmClone"), // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), @@ -482,10 +474,6 @@ if (isModEnabled('bom')) { $langs->load("mrp"); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; - $forcecombo = 0; - if ($conf->browser->name == 'ie') { - $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy - } $formquestion = array( // 'text' => $langs->trans("ConfirmClone"), // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), @@ -580,9 +568,24 @@ // Common attributes $keyforbreak = 'duration'; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; - $object->calculateCosts(); - print '
'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).''.price($object->total_cost).'
'.$langs->trans("UnitCost").''.price($object->unit_cost).'
'.$form->textwithpicto($langs->trans("ManufacturingCost"), $langs->trans("BOMTotalCost")).''; + print price($object->total_cost); + print ''; + if ($object->total_cost != $object->unit_cost) { + print '    ('.$form->textwithpicto(price($object->unit_cost), $langs->trans("ManufacturingUnitCost"), 1, 'help', '').')'; + } + print '
'.$langs->trans("ManufacturingGeneratedValue").''.price($manufacturedvalued).'
'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).''.price($object->total_cost).'
'.$langs->trans("UnitCost").''.price($object->unit_cost).'
'.$form->textwithpicto($langs->trans("ManufacturingCost"), $langs->trans("BOMTotalCost")).''; + print price($object->total_cost); + print ''; + if ($object->total_cost != $object->unit_cost) { + print '    ('.$form->textwithpicto(price($object->unit_cost), $langs->trans("ManufacturingUnitCost"), 1, 'help', '').')'; + } + print '
'.$langs->trans("ManufacturingGeneratedValue").''.price($manufacturedvalued).'
' . $form->textwithpicto($langs->trans('Workstation'), '') . '' . $form->textwithpicto($langs->trans('Workstation'), '') . '' . $form->textwithpicto($langs->trans('TotalCost'), '') . '
'; - $this->selectTypesTickets($type_code, 'type_code', '', 2, 1, 0, 0, 'minwidth200 maxwidth500'); + $this->selectTypesTickets($type_code, 'type_code', '', 2, 'ifone', 0, 0, 'minwidth200 maxwidth500'); print '
'; - $this->selectSeveritiesTickets($severity_code, 'severity_code', '', 2, 1, 0, 0, 'minwidth200 maxwidth500'); + $this->selectSeveritiesTickets($severity_code, 'severity_code', '', 2, 'ifone', 0, 0, 'minwidth200 maxwidth500'); print '
'; + $text .= '
'; $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Asset"), $langs->transnoentities("Asset")); $tooltip .= $langs->trans("GenericMaskCodes2"); @@ -81,7 +81,7 @@ public function info($langs) // Parametrage du prefix $text .= ''; - $text .= ''; + $text .= ''; $text .= ''; diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index 944e244fd17fd..ca5c3b7a3e046 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -95,7 +95,7 @@ public function info($langs) // Mask parameter //$texte.= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php index 9cb371267b639..cf3cb3135a4ae 100644 --- a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php @@ -131,7 +131,7 @@ public function info($langs) // Mask parameter //$texte.= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/bom/mod_bom_advanced.php b/htdocs/core/modules/bom/mod_bom_advanced.php index 18cbfa0cdb625..bc3ef9a72ff20 100644 --- a/htdocs/core/modules/bom/mod_bom_advanced.php +++ b/htdocs/core/modules/bom/mod_bom_advanced.php @@ -82,7 +82,7 @@ public function info($langs) // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php index c03e67d66870b..848b3ccbace30 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php @@ -76,7 +76,7 @@ public function info($langs) // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 9a371ccb0a29f..6f70914d9f74c 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -200,10 +200,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $nblines = (is_array($object->lines) ? count($object->lines) : 0); - $hidetop = 0; - if (getDolGlobalString('MAIN_PDF_DISABLE_COL_HEAD_TITLE')) { - $hidetop = getDolGlobalString('MAIN_PDF_DISABLE_COL_HEAD_TITLE'); - } + $hidetop = getDolGlobalInt('MAIN_PDF_DISABLE_COL_HEAD_TITLE'); // Loop on each lines to detect if there is at least one image to show $realpatharray = array(); @@ -366,6 +363,10 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $tab_top = 90 + $top_shift + $shipp_shift; $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + if (!$hidetop && getDolGlobalInt('MAIN_PDF_ENABLE_COL_HEAD_TITLE_REPEAT')) { + // TODO : make this hidden conf the default behavior for each PDF when each PDF managed this new Display + $tab_top_newpage+= $this->tabTitleHeight; + } $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; @@ -549,7 +550,24 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pageposbeforeprintlines = $pdf->getPage(); $pagenb = $pageposbeforeprintlines; for ($i = 0; $i < $nblines; $i++) { + $linePosition = $i + 1; $curY = $nexY; + + // in First Check line page break and add page if needed + if (isset($object->lines[$i]->pagebreak) && $object->lines[$i]->pagebreak) { + // New page + $pdf->AddPage(); + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } + + $pdf->setPage($pdf->getNumPages()); + $nexY = $tab_top_newpage; + } + + $this->resetAfterColsLinePositionsData($nexY, $pdf->getPage()); + + $pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage $pdf->SetTextColor(0, 0, 0); @@ -560,114 +578,76 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); + $curYBefore = $curY; - - $showpricebeforepagebreak = 1; + // Allows data in the first page if description is long enough to break in multiples pages + $showpricebeforepagebreak = getDolGlobalInt('MAIN_PDF_DATA_ON_FIRST_PAGE'); $posYAfterImage = 0; - $posYAfterDescription = 0; if ($this->getColumnStatus('photo')) { // We start with Photo of product line - if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // If photo too high, we moved completely on new page + $imageTopMargin = 1; + if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imageTopMargin + $imglinesize['height']) > ($this->page_hauteur - $heightforfooter)) { // If photo too high, we moved completely on new page $pdf->AddPage('', '', true); if (!empty($tplidx)) { $pdf->useTemplate($tplidx); } $pdf->setPage($pageposbefore + 1); - + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $curY = $tab_top_newpage; - - // Allows data in the first page if description is long enough to break in multiples pages - if (getDolGlobalInt('MAIN_PDF_DATA_ON_FIRST_PAGE')) { - $showpricebeforepagebreak = 1; - } else { - $showpricebeforepagebreak = 0; - } + $showpricebeforepagebreak = 0; } + // I remove the line commented below because it probably uselesss (or bug source) no need to change bottom margin because we have checked image fit + //$pdf->setPageOrientation('', 0, $heightforfooter + $heightforfreetext); // The only function to edit the bottom margin of current page to set it. + if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) { - $pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY + 1, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi + $pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY + $imageTopMargin, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi // $pdf->Image does not increase value return by getY, so we save it manually $posYAfterImage = $curY + $imglinesize['height']; + $this->setAfterColsLinePositionsData('photo', $posYAfterImage, $pdf->getPage()); } } + // restore Page orientation for text + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + // Description of product line if ($this->getColumnStatus('desc')) { - $pdf->startTransaction(); - $this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc); - $pageposafter = $pdf->getPage(); - - if ($pageposafter > $pageposbefore) { // There is a pagebreak - $pdf->rollbackTransaction(true); - $pageposafter = $pageposbefore; - //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. - - $this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc); - $pageposafter = $pdf->getPage(); - $posyafter = $pdf->GetY(); - if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // There is no space left for total+free text - if ($i == ($nblines - 1)) { // No more lines, and no space left to show total, so we create a new page - $pdf->AddPage('', '', true); - if (!empty($tplidx)) { - $pdf->useTemplate($tplidx); - } - $pdf->setPage($pageposafter + 1); - } - } else { - // We found a page break - // Allows data in the first page if description is long enough to break in multiples pages - if (getDolGlobalInt('MAIN_PDF_DATA_ON_FIRST_PAGE')) { - $showpricebeforepagebreak = 1; - } else { - $showpricebeforepagebreak = 0; - } - } - } else { // No pagebreak - $pdf->commitTransaction(); - } - $posYAfterDescription = $pdf->GetY(); + $this->setAfterColsLinePositionsData('desc', $pdf->GetY(), $pdf->getPage()); } - - $nexY = max($pdf->GetY(), $posYAfterImage); - - - $pageposafter = $pdf->getPage(); - + $afterPosData = $this->getMaxAfterColsLinePositionsData(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', 0, $heightforfooter); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page - if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { - $pdf->setPage($pageposafter); + if ($afterPosData['page'] > $pageposbefore && (empty($showpricebeforepagebreak) || ($curY + 4) > ($this->page_hauteur - $heightforfooter))) { + $pdf->setPage($afterPosData['page']); $curY = $tab_top_newpage; } $pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font - // # of line + // Line position if ($this->getColumnStatus('position')) { - $this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1)); + $this->printStdColumnContent($pdf, $curY, 'position', strval($linePosition)); } // VAT Rate if ($this->getColumnStatus('vat')) { $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'vat', $vat_rate); - $nexY = max($pdf->GetY(), $nexY); } // Unit price before discount if ($this->getColumnStatus('subprice')) { $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'subprice', $up_excl_tax); - $nexY = max($pdf->GetY(), $nexY); } // Quantity @@ -675,7 +655,6 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if ($this->getColumnStatus('qty')) { $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'qty', $qty); - $nexY = max($pdf->GetY(), $nexY); } @@ -683,28 +662,24 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if ($this->getColumnStatus('unit')) { $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); - $nexY = max($pdf->GetY(), $nexY); } // Discount on line if ($this->getColumnStatus('discount') && $object->lines[$i]->remise_percent) { $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'discount', $remise_percent); - $nexY = max($pdf->GetY(), $nexY); } // Total excl tax line (HT) if ($this->getColumnStatus('totalexcltax')) { $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'totalexcltax', $total_excl_tax); - $nexY = max($pdf->GetY(), $nexY); } // Total with tax line (TTC) if ($this->getColumnStatus('totalincltax')) { $total_incl_tax = pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'totalincltax', $total_incl_tax); - $nexY = max($pdf->GetY(), $nexY); } // Extrafields @@ -713,17 +688,18 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if ($this->getColumnStatus($extrafieldColKey)) { $extrafieldValue = $this->getExtrafieldContent($object->lines[$i], $extrafieldColKey, $outputlangs); $this->printStdColumnContent($pdf, $curY, $extrafieldColKey, $extrafieldValue); - $nexY = max($pdf->GetY(), $nexY); + $this->setAfterColsLinePositionsData('options_'.$extrafieldColKey, $pdf->GetY(), $pdf->getPage()); } } } + $afterPosData = $this->getMaxAfterColsLinePositionsData(); $parameters = array( 'object' => $object, 'i' => $i, 'pdf' => & $pdf, 'curY' => & $curY, - 'nexY' => & $nexY, + 'nexY' => & $afterPosData['y'], // for backward module hook compatibility Y will be accessible by $object->getMaxAfterColsLinePositionsData() 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails ); @@ -785,60 +761,86 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede } $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); + $afterPosData = $this->getMaxAfterColsLinePositionsData(); + $pdf->setPage($afterPosData['page']); + $nexY = $afterPosData['y']; + // Add line - if (getDolGlobalInt('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { - $pdf->setPage($pageposafter); + if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1) && $afterPosData['y'] < $this->page_hauteur - $heightforfooter - 5) { $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); - $pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY); + $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); $pdf->SetLineStyle(array('dash' => 0)); } + $nexY += 2; // Add space between lines + } - // Detect if some page were added automatically and output _tableau for past pages - while ($pagenb < $pageposafter) { - $pdf->setPage($pagenb); - if ($pagenb == $pageposbeforeprintlines) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); - } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); - } - $this->_pagefoot($pdf, $object, $outputlangs, 1); - $pagenb++; - $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { - $this->_pagehead($pdf, $object, 0, $outputlangs); - } - if (!empty($tplidx)) { - $pdf->useTemplate($tplidx); - } + // Add last page for document footer if there are not enough size left + $afterPosData = $this->getMaxAfterColsLinePositionsData(); + if ($afterPosData['y'] > $this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot) ) { + $pdf->AddPage(); + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); } - if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { // @phan-suppress-current-line PhanUndeclaredProperty - if ($pagenb == $pageposafter) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); + $pagenb++; + $pdf->setPage($pagenb); + } + + // Draw table frames and columns borders + $drawTabNumbPage = $pdf->getNumPages(); + for ($i=$pageposbeforeprintlines; $i<=$drawTabNumbPage; $i++) { + $pdf->setPage($i); + // reset page orientation each loop to override it if it was changed + $pdf->setPageOrientation('', 0, 0); // The only function to edit the bottom margin of current page to set it. + + $drawTabHideTop = $hidetop; + $drawTabTop = $tab_top_newpage; + $drawTabBottom = $this->page_hauteur - $heightforfooter;; + $hideBottom = 0; // TODO understand why it change to 1 or 0 during process + + if ($i == $pageposbeforeprintlines) { + // first page need to start after notes + $drawTabTop = $tab_top; + } elseif (!$drawTabHideTop) { + if (getDolGlobalInt('MAIN_PDF_ENABLE_COL_HEAD_TITLE_REPEAT')) { + $drawTabTop-= $this->tabTitleHeight; } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); - } - $this->_pagefoot($pdf, $object, $outputlangs, 1); - // New page - $pdf->AddPage(); - if (!empty($tplidx)) { - $pdf->useTemplate($tplidx); - } - $pagenb++; - if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { - $this->_pagehead($pdf, $object, 0, $outputlangs); + $drawTabHideTop = 1; } } - } - // Show square - if ($pagenb == $pageposbeforeprintlines) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code, $outputlangsbis); - } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code, $outputlangsbis); + // last page need to include document footer + if ($i == $pdf->getNumPages()) { + // remove document footer height to tab bottom position + $drawTabBottom-= $heightforfreetext + $heightforinfotot; + } + + $drawTabHeight = $drawTabBottom - $drawTabTop; + $this->_tableau($pdf, $drawTabTop, $drawTabHeight, 0, $outputlangs, $drawTabHideTop, $hideBottom, $object->multicurrency_code, $outputlangsbis); + + $hideFreeText = $i != $pdf->getNumPages() ? 1 : 0; // Display free text only in last page + $this->_pagefoot($pdf, $object, $outputlangs, $hideFreeText); + + $pdf->setPage($i); // in case of _pagefoot or _tableau change it + + // reset page orientation each loop to override it if it was changed by _pagefoot or _tableau change it + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + + // Don't print head on first page ($pageposbeforeprintlines) because already added previously + if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') && $i != $pageposbeforeprintlines) { + $this->_pagehead($pdf, $object, 0, $outputlangs); + } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } + + // reset text color before print footers + $pdf->SetTextColor(0, 0, 0); + + $pdf->setPage($pdf->getNumPages()); + $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; // Display infos area @@ -847,16 +849,8 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Display total zone $posy = $this->drawTotalTable($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs); - // Display payment area - /* - if ($deja_regle) - { - $posy=$this->drawPaymentsTable($pdf, $object, $posy, $outputlangs); - } - */ - // Pagefoot - $this->_pagefoot($pdf, $object, $outputlangs); + // Add number of pages in footer if (method_exists($pdf, 'AliasNbPages')) { $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod } diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php index a3280fa145539..bb0603ef0f0fb 100644 --- a/htdocs/core/modules/commande/mod_commande_saphir.php +++ b/htdocs/core/modules/commande/mod_commande_saphir.php @@ -82,7 +82,7 @@ public function info($langs) // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php index 7af0d9e16bb4b..e872357c63cfc 100644 --- a/htdocs/core/modules/contract/mod_contract_magre.php +++ b/htdocs/core/modules/contract/mod_contract_magre.php @@ -73,7 +73,7 @@ public function info($langs) $tooltip .= '
'.$langs->trans("GenericMaskCodes5b"); $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; $texte .= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").' ('.$langs->trans("BarCodeModel").'):
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").' ('.$langs->trans("BarCodeModel").'):
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'; diff --git a/htdocs/core/modules/delivery/mod_delivery_saphir.php b/htdocs/core/modules/delivery/mod_delivery_saphir.php index 60cbc9420ab6d..f09c8764d7ae4 100644 --- a/htdocs/core/modules/delivery/mod_delivery_saphir.php +++ b/htdocs/core/modules/delivery/mod_delivery_saphir.php @@ -87,7 +87,7 @@ public function info($langs) // Parametrage du prefix $texte .= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'; diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php index b0303de27ddbf..44d26eb9f0b8f 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php @@ -137,11 +137,11 @@ public function __construct($db) //$this->posxdate=88; //$this->posxtype=107; //$this->posxprojet=120; - $this->posxtva = 112; - $this->posxup = 127; - $this->posxqty = 150; - $this->postotalht = 160; - $this->postotalttc = 180; + $this->posxtva = 100; + $this->posxup = 120; + $this->posxqty = 146; + $this->postotalht = 154; + $this->postotalttc = 178; // if (!isModEnabled('project')) { // $this->posxtva-=20; // $this->posxup-=20; @@ -473,29 +473,29 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Show total area box $posy = $bottomlasttab + 5; $posy_start_of_totals = $posy; - $pdf->SetXY(130, $posy); - $pdf->MultiCell(70, 5, $outputlangs->transnoentities("TotalHT"), 1, 'L'); - $pdf->SetXY(180, $posy); - $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 180, 5, price($object->total_ht), 1, 'R'); + $pdf->SetXY(120, $posy); + $pdf->MultiCell(40, 5, $outputlangs->transnoentities("TotalHT"), 1, 'L'); + $pdf->SetXY(160, $posy); + $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 160, 5, price($object->total_ht), 1, 'C'); $pdf->SetFillColor(248, 248, 248); if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) { // TODO Show vat amount per tax level $posy += 5; - $pdf->SetXY(130, $posy); + $pdf->SetXY(120, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell(70, 5, $outputlangs->transnoentities("TotalVAT"), 1, 'L'); - $pdf->SetXY(180, $posy); - $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 180, 5, price($object->total_tva), 1, 'R'); + $pdf->MultiCell(40, 5, $outputlangs->transnoentities("TotalVAT"), 1, 'L'); + $pdf->SetXY(160, $posy); + $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 160, 5, price($object->total_tva), 1, 'C'); } $posy += 5; - $pdf->SetXY(130, $posy); + $pdf->SetXY(120, $posy); $pdf->SetFont('', 'B', 10); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell(70, 5, $outputlangs->transnoentities("TotalTTC"), 1, 'L'); - $pdf->SetXY(180, $posy); - $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 180, 5, price($object->total_ttc), 1, 'R'); + $pdf->MultiCell(40, 5, $outputlangs->transnoentities("TotalTTC"), 1, 'L'); + $pdf->SetXY(160, $posy); + $pdf->MultiCell($this->page_largeur - $this->marge_gauche - 160, 5, price($object->total_ttc), 1, 'C'); // show payments zone $sumPayments = $object->getSumPayments(); @@ -595,24 +595,24 @@ protected function printLine(&$pdf, $object, $linenumber, $curY, $default_font_s if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) { $vat_rate = pdf_getlinevatrate($object, $linenumber, $outputlangs, $hidedetails); $pdf->SetXY($this->posxtva, $curY); - $pdf->MultiCell($this->posxup - $this->posxtva - 0.8, 4, $vat_rate, 0, 'R'); + $pdf->MultiCell($this->posxup - $this->posxtva - 0.8, 4, $vat_rate, 0, 'C'); } // Unit price $pdf->SetXY($this->posxup, $curY); - $pdf->MultiCell($this->posxqty - $this->posxup - 0.8, 4, price($object->lines[$linenumber]->value_unit), 0, 'R'); + $pdf->MultiCell($this->posxqty - $this->posxup - 0.8, 4, price($object->lines[$linenumber]->value_unit), 0, 'C'); // Quantity $pdf->SetXY($this->posxqty, $curY); - $pdf->MultiCell($this->postotalht - $this->posxqty - 0.8, 4, $object->lines[$linenumber]->qty, 0, 'R'); + $pdf->MultiCell($this->postotalht - $this->posxqty - 0.8, 4, $object->lines[$linenumber]->qty, 0, 'C'); // Total without taxes $pdf->SetXY($this->postotalht, $curY); - $pdf->MultiCell($this->postotalttc - $this->postotalht - 0.8, 4, price($object->lines[$linenumber]->total_ht), 0, 'R'); + $pdf->MultiCell($this->postotalttc - $this->postotalht - 0.8, 4, price($object->lines[$linenumber]->total_ht), 0, 'C'); // Total with all taxes $pdf->SetXY($this->postotalttc - 1, $curY); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalttc + 1, 4, price($object->lines[$linenumber]->total_ttc), 0, 'R'); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalttc + 1, 4, price($object->lines[$linenumber]->total_ttc), 0, 'C'); // Comments $pdf->SetXY($this->posxcomment, $curY); @@ -1009,7 +1009,7 @@ protected function tablePayments(&$pdf, $object, $posy, $outputlangs) $sign = 1; $tab3_posx = $this->marge_gauche; $tab3_top = $posy; - $tab3_width = 88; + $tab3_width = 100; $tab3_height = 5; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -1026,8 +1026,8 @@ protected function tablePayments(&$pdf, $object, $posy, $outputlangs) $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Date"), 0, 'L', 0); $pdf->SetXY($tab3_posx + 19, $tab3_top + 1); // Old value 17 $pdf->MultiCell(15, 3, $outputlangs->transnoentities("Amount"), 0, 'C', 0); - $pdf->SetXY($tab3_posx + 35, $tab3_top + 1); - $pdf->MultiCell(30, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); + $pdf->SetXY($tab3_posx + 45, $tab3_top + 1); + $pdf->MultiCell(35, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); if (isModEnabled("bank")) { $pdf->SetXY($tab3_posx + 65, $tab3_top + 1); $pdf->MultiCell(25, 3, $outputlangs->transnoentities("BankAccount"), 0, 'L', 0); @@ -1062,9 +1062,9 @@ protected function tablePayments(&$pdf, $object, $posy, $outputlangs) $pdf->SetXY($tab3_posx, $tab3_top + $y + 1); $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->dp), 'day', false, $outputlangs, true), 0, 'L', 0); - $pdf->SetXY($tab3_posx + 17, $tab3_top + $y + 1); - $pdf->MultiCell(15, 3, price($sign * $row->amount, 0, $outputlangs), 0, 'R', 0); - $pdf->SetXY($tab3_posx + 35, $tab3_top + $y + 1); + $pdf->SetXY($tab3_posx + 20, $tab3_top + $y + 1); + $pdf->MultiCell(20, 3, price($sign * $row->amount, 0, $outputlangs), 0, 'L', 0); + $pdf->SetXY($tab3_posx + 45, $tab3_top + $y + 1); $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->p_code); $pdf->MultiCell(40, 3, $oper, 0, 'L', 0); @@ -1081,19 +1081,19 @@ protected function tablePayments(&$pdf, $object, $posy, $outputlangs) $y += $tab3_height; $pdf->SetXY($tab3_posx + 17, $tab3_top + $y); - $pdf->MultiCell(15, 3, price($totalpaid), 0, 'R', 0); - $pdf->SetXY($tab3_posx + 35, $tab3_top + $y); + $pdf->MultiCell(20, 3, price($totalpaid), 0, 'R', 0); + $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); $pdf->MultiCell(30, 4, $outputlangs->transnoentitiesnoconv("AlreadyPaid"), 0, 'L', 0); $y += $tab3_height - 2; $pdf->SetXY($tab3_posx + 17, $tab3_top + $y); - $pdf->MultiCell(15, 3, price($object->total_ttc), 0, 'R', 0); - $pdf->SetXY($tab3_posx + 35, $tab3_top + $y); + $pdf->MultiCell(20, 3, price($object->total_ttc), 0, 'R', 0); + $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); $pdf->MultiCell(30, 4, $outputlangs->transnoentitiesnoconv("AmountExpected"), 0, 'L', 0); $y += $tab3_height - 2; $remaintopay = $object->total_ttc - $totalpaid; $pdf->SetXY($tab3_posx + 17, $tab3_top + $y); - $pdf->MultiCell(15, 3, price($remaintopay), 0, 'R', 0); - $pdf->SetXY($tab3_posx + 35, $tab3_top + $y); + $pdf->MultiCell(20, 3, price($remaintopay), 0, 'R', 0); + $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); $pdf->MultiCell(30, 4, $outputlangs->transnoentitiesnoconv("RemainderToPay"), 0, 'L', 0); } } else { diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index 0c5962c871e1f..6f4f091f90ef9 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -87,7 +87,7 @@ public function info($langs) // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; $mask = getDolGlobalString('EXPENSEREPORT_SAND_MASK'); - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 6594616134bc1..a5c514576e134 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -102,7 +102,7 @@ class pdf_crabe extends ModelePDFFactures */ public function __construct($db) { - global $conf, $langs, $mysoc; + global $langs, $mysoc; // Translations $langs->loadLangs(array("main", "bills")); @@ -359,10 +359,10 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $certprivate = empty($user->conf->CERTIFICATE_CRT_PRIVATE) ? '' : $user->conf->CERTIFICATE_CRT_PRIVATE; // If user has no certificate, we try to take the company one if (!$cert) { - $cert = !getDolGlobalString('CERTIFICATE_CRT') ? '' : $conf->global->CERTIFICATE_CRT; + $cert = getDolGlobalString('CERTIFICATE_CRT'); } if (!$certprivate) { - $certprivate = !getDolGlobalString('CERTIFICATE_CRT_PRIVATE') ? '' : $conf->global->CERTIFICATE_CRT_PRIVATE; + $certprivate = getDolGlobalString('CERTIFICATE_CRT_PRIVATE'); } // If a certificate is found if ($cert) { @@ -1162,7 +1162,7 @@ protected function _tableau_versements_header($pdf, $object, $outputlangs, $defa protected function _tableau_info(&$pdf, $object, $posy, $outputlangs, $outputlangsbis) { // phpcs:enable - global $conf, $mysoc, $hookmanager; + global $mysoc, $hookmanager; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -1170,6 +1170,9 @@ protected function _tableau_info(&$pdf, $object, $posy, $outputlangs, $outputlan krsort($this->tva_array); + // Clean data type + $object->total_tva = (float) $object->total_tva; + // Show VAT details if ($object->total_tva != 0 && getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) { $pdf->SetFillColor(224, 224, 224); @@ -1227,16 +1230,19 @@ protected function _tableau_info(&$pdf, $object, $posy, $outputlangs, $outputlan } } - // If France, show VAT mention if not applicable - if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) { - $pdf->SetFont('', 'B', $default_font_size - 2); + // If France, show VAT mention if applicable + if (in_array($this->emetteur->country_code, array('FR')) && empty($object->total_tva)) { + $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); - if ($mysoc->forme_juridique_code == 92) { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoiceAsso"), 0, 'L', 0); - } else { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + if (empty($mysoc->tva_assuj)) { + if ($mysoc->forme_juridique_code == 92) { + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoiceAsso"), 0, 'L', 0); + } else { + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + } + } elseif (getDolGlobalString("INVOICE_VAT_SHOW_REVERSE_CHARGE_MENTION") && $this->emetteur->country_code != $object->thirdparty->country_code && $this->emetteur->isInEEC() && $object->thirdparty->isInEEC()) { + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedReverseChargeProcedure"), 0, 'L', 0); } - $posy = $pdf->GetY() + 4; } @@ -1367,7 +1373,7 @@ protected function _tableau_info(&$pdf, $object, $posy, $outputlangs, $outputlan if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // If payment mode unregulated or payment mode forced to CHQ if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) { - $diffsizetitle = (!getDolGlobalString('PDF_DIFFSIZE_TITLE') ? 3 : $conf->global->PDF_DIFFSIZE_TITLE); + $diffsizetitle = getDolGlobalInt('PDF_DIFFSIZE_TITLE', 3); if (getDolGlobalInt('FACTURE_CHQ_NUMBER') > 0) { $account = new Account($this->db); @@ -1385,7 +1391,7 @@ protected function _tableau_info(&$pdf, $object, $posy, $outputlangs, $outputlan $posy = $pdf->GetY() + 2; } } - if ($conf->global->FACTURE_CHQ_NUMBER == -1) { + if (getDolGlobalInt('FACTURE_CHQ_NUMBER') == -1) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0); @@ -1404,7 +1410,7 @@ protected function _tableau_info(&$pdf, $object, $posy, $outputlangs, $outputlan // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) { - $bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); + $bankid = ($object->fk_account <= 0 ? getDolGlobalString('FACTURE_RIB_NUMBER') : $object->fk_account); if ($object->fk_bank > 0) { $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank } @@ -1828,7 +1834,7 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs $index++; $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $conf->global->BILL_TEXT_TOTAL_FOOTER, 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, getDolGlobalString('BILL_TEXT_TOTAL_FOOTER'), 0, 'L', 0); } return ($tab2_top + ($tab2_hl * $index)); @@ -1877,7 +1883,6 @@ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $ $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); - //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index afaad9a39af63..6c75e61ae9cee 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -1329,7 +1329,7 @@ public function drawPaymentsTable(&$pdf, $object, $posy, $outputlangs) */ protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs, $outputlangsbis) { - global $conf, $mysoc, $hookmanager; + global $mysoc, $hookmanager; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -1337,6 +1337,9 @@ protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs, $outputlan krsort($this->tva_array); + // Clean data type + $object->total_tva = (float) $object->total_tva; + // Show VAT details if ($object->total_tva != 0 && getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) { $pdf->SetFillColor(224, 224, 224); @@ -1394,16 +1397,19 @@ protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs, $outputlan } } - // If France, show VAT mention if not applicable - if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) { - $pdf->SetFont('', 'B', $default_font_size - 2); + // If France, show VAT mention if applicable + if (in_array($this->emetteur->country_code, array('FR')) && empty($object->total_tva)) { + $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); - if ($mysoc->forme_juridique_code == 92) { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoiceAsso"), 0, 'L', 0); - } else { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + if (empty($mysoc->tva_assuj)) { + if ($mysoc->forme_juridique_code == 92) { + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoiceAsso"), 0, 'L', 0); + } else { + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + } + } elseif (getDolGlobalString("INVOICE_VAT_SHOW_REVERSE_CHARGE_MENTION") && $this->emetteur->country_code != $object->thirdparty->country_code && $this->emetteur->isInEEC() && $object->thirdparty->isInEEC()) { + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedReverseChargeProcedure"), 0, 'L', 0); } - $posy = $pdf->GetY() + 4; } @@ -1664,7 +1670,7 @@ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlan $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1); - $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled('multicurrency') && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht, 0, $outputlangs), 0, 'R', 1); @@ -2549,7 +2555,7 @@ protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) */ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { - global $conf, $hookmanager; + global $hookmanager; // Default field style for content $this->defaultContentsFieldsStyle = array( @@ -2871,7 +2877,6 @@ public function _tableFirstPage(&$pdf, $tab_top, $tab_height, $nexY, $outputlang $width = $this->page_largeur - $this->marge_gauche - $this->marge_droite - 83; - //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { //$pdf->Rect($this->posx_cumul_anterieur - 1, $tab_top, $width, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); $pdf->RoundedRect($this->posx_cumul_anterieur - 1, $tab_top, $width, 5, $this->corner_radius, '1001', 'F', explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); @@ -3069,8 +3074,6 @@ public function _tableFirstPage(&$pdf, $tab_top, $tab_height, $nexY, $outputlang */ public function getDataSituation(&$object) { - global $conf, $db; - // Fetch previous and next situations invoices. // Return all previous and next invoices (both standard and credit notes) $object->fetchPreviousNextSituationInvoice(); @@ -3233,7 +3236,6 @@ public function displayRetainedWarranty($object) return $object->displayRetainedWarranty(); } else { // FOR RETROCOMPATIBILITY - global $conf; // TODO : add a flag on invoices to store this conf USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL @@ -3365,7 +3367,7 @@ public function printRoundedRectBtp($pdf, $x, $y, $w, $h, $r, $hidetop = 0, $hid */ public function btpGetInvoiceAmounts($id, $forceReadFromDB = false) { - global $user,$langs,$conf,$mysoc,$db,$hookmanager,$nblignes; + global $user, $langs, $mysoc, $db, $hookmanager, $nblignes; $object = new Facture($db); $object->fetch($id); @@ -3517,7 +3519,7 @@ public function resumeLastPage(&$pdf, $object, $deja_regle, $posy, $outputlangs, if (count($propals)) { $propal = array_pop($propals); - $total_ht = ($conf->multicurrency->enabled && $propal->multicurrency_tx != 1) ? $propal->multicurrency_total_ht : $propal->total_ht; + $total_ht = (isModEnabled('multicurrency') && $propal->multicurrency_tx != 1) ? $propal->multicurrency_total_ht : $propal->total_ht; $remain_to_pay = $total_ht; $pdf->SetTextColor(0, 0, 60); @@ -3540,7 +3542,7 @@ public function resumeLastPage(&$pdf, $object, $deja_regle, $posy, $outputlangs, } elseif (count($orders)) { $order = array_pop($orders); - $total_ht = ($conf->multicurrency->enabled && $order->multicurrency_tx != 1 ? $order->multicurrency_total_ht : $order->total_ht); + $total_ht = (isModEnabled('multicurrency') && $order->multicurrency_tx != 1 ? $order->multicurrency_total_ht : $order->total_ht); $remain_to_pay = $total_ht; } @@ -3608,7 +3610,7 @@ public function resumeLastPage(&$pdf, $object, $deja_regle, $posy, $outputlangs, $pdf->SetXY($posx, $posy); $pdf->MultiCell($width, $height, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $invoice->multicurrency_tx != 1 ? $invoice->multicurrency_total_ht : $invoice->total_ht); + $total_ht = (isModEnabled('multicurrency') && $invoice->multicurrency_tx != 1 ? $invoice->multicurrency_total_ht : $invoice->total_ht); $pdf->SetXY($posx + $width, $posy); $pdf->MultiCell($width2, $height, price($sign * ($total_ht + (!empty($invoice->remise) ? $invoice->remise : 0)), 0, $outputlangs), 0, 'R', 1); @@ -3651,8 +3653,8 @@ public function resumeLastPage(&$pdf, $object, $deja_regle, $posy, $outputlangs, $index++; - $total_ht = ($conf->multicurrency->enabled && $invoice->multicurrency_tx != 1) ? $invoice->multicurrency_total_ht : $invoice->total_ht; - $total_ttc = ($conf->multicurrency->enabled && $invoice->multicurrency_tx != 1) ? $invoice->multicurrency_total_ttc : $invoice->total_ttc; + $total_ht = (isModEnabled('multicurrency') && $invoice->multicurrency_tx != 1) ? $invoice->multicurrency_total_ht : $invoice->total_ht; + $total_ttc = (isModEnabled('multicurrency') && $invoice->multicurrency_tx != 1) ? $invoice->multicurrency_total_ttc : $invoice->total_ttc; // Total TTC $pdf->SetXY($posx, $posy + $height * $index); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 7fb66eb5ae38f..7fa776dff12b9 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -702,7 +702,23 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pageposbeforeprintlines = $pdf->getPage(); $pagenb = $pageposbeforeprintlines; for ($i = 0; $i < $nblines; $i++) { + $linePosition = $i + 1; $curY = $nexY; + + // in First Check line page break and add page if needed + if (isset($object->lines[$i]->pagebreak) && $object->lines[$i]->pagebreak) { + // New page + $pdf->AddPage(); + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } + + $pdf->setPage($pdf->getNumPages()); + $nexY = $this->tab_top_newpage; + } + + $this->resetAfterColsLinePositionsData($nexY, $pdf->getPage()); + $pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage $pdf->SetTextColor(0, 0, 0); @@ -713,112 +729,76 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede } $pdf->setTopMargin($this->tab_top_newpage); - $page_bottom_margin = $this->heightforfooter + $this->heightforfreetext + $this->heightforinfotot + $this->getHeightForQRInvoice($pdf->getPage(), $object, $langs); - $pdf->setPageOrientation('', 1, $page_bottom_margin); + $pdf->setPageOrientation('', 1, $this->heightforfooter); $pageposbefore = $pdf->getPage(); + $curYBefore = $curY; - $showpricebeforepagebreak = 1; - $posYAfterImage = 0; - $posYAfterDescription = 0; + // Allows data in the first page if description is long enough to break in multiples pages + $showpricebeforepagebreak = getDolGlobalInt('MAIN_PDF_DATA_ON_FIRST_PAGE'); if ($this->getColumnStatus('photo')) { // We start with Photo of product line - if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - $page_bottom_margin)) { // If photo too high, we moved completely on new page + $imageTopMargin = 1; + if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imageTopMargin + $imglinesize['height']) > ($this->page_hauteur - $this->heightforfooter)) { // If photo too high, we moved completely on new page $pdf->AddPage('', '', true); if (!empty($tplidx)) { $pdf->useTemplate($tplidx); } $pdf->setPage($pageposbefore + 1); - + $pdf->setPageOrientation('', 1, $this->heightforfooter); // The only function to edit the bottom margin of current page to set it. $curY = $this->tab_top_newpage; - - // Allows data in the first page if description is long enough to break in multiples pages - if (getDolGlobalString('MAIN_PDF_DATA_ON_FIRST_PAGE')) { - $showpricebeforepagebreak = 1; - } else { - $showpricebeforepagebreak = 0; - } + $showpricebeforepagebreak = 0; } + $pdf->setPageOrientation('', 0, $this->heightforfooter + $this->heightforfreetext); // The only function to edit the bottom margin of current page to set it. if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) { - $pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY + 1, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi + $pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY + $imageTopMargin, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi // $pdf->Image does not increase value return by getY, so we save it manually $posYAfterImage = $curY + $imglinesize['height']; + + $this->setAfterColsLinePositionsData('photo', $posYAfterImage, $pdf->getPage()); } } + // restore Page orientation for text + $pdf->setPageOrientation('', 1, $this->heightforfooter); // The only function to edit the bottom margin of current page to set it. + // Description of product line if ($this->getColumnStatus('desc')) { - $pdf->startTransaction(); - $this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc); - $pageposafter = $pdf->getPage(); - - if ($pageposafter > $pageposbefore) { // There is a pagebreak - $pdf->rollbackTransaction(true); - $pageposafter = $pageposbefore; - $pdf->setPageOrientation('', 1, $this->heightforfooter); // The only function to edit the bottom margin of current page to set it. - - $this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc); - - $pageposafter = $pdf->getPage(); - $posyafter = $pdf->GetY(); - //var_dump($posyafter); var_dump(($this->page_hauteur - ($this->heightforfooter+$this->heightforfreetext+$this->heightforinfotot))); exit; - if ($posyafter > ($this->page_hauteur - $page_bottom_margin)) { // There is no space left for total+free text - if ($i == ($nblines - 1)) { // No more lines, and no space left to show total, so we create a new page - $pdf->AddPage('', '', true); - if (!empty($tplidx)) { - $pdf->useTemplate($tplidx); - } - $pdf->setPage($pageposafter + 1); - } - } else { - // We found a page break - // Allows data in the first page if description is long enough to break in multiples pages - if (getDolGlobalString('MAIN_PDF_DATA_ON_FIRST_PAGE')) { - $showpricebeforepagebreak = 1; - } else { - $showpricebeforepagebreak = 0; - } - } - } else { // No pagebreak - $pdf->commitTransaction(); - } - $posYAfterDescription = $pdf->GetY(); + $this->setAfterColsLinePositionsData('desc', $pdf->GetY(), $pdf->getPage()); } - $nexY = max($pdf->GetY(), $posYAfterImage, $posYAfterDescription); - $pageposafter = $pdf->getPage(); + $afterPosData = $this->getMaxAfterColsLinePositionsData(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $curY = $curYBefore; + $pdf->setPageOrientation('', 0, $this->heightforfooter); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page - if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { - $pdf->setPage($pageposafter); + if ($afterPosData['page'] > $pageposbefore && (empty($showpricebeforepagebreak) || ($curY + 4) > ($this->page_hauteur - $this->heightforfooter))) { + $pdf->setPage($afterPosData['page']); $curY = $this->tab_top_newpage; } $pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font - // # of line + // Line position if ($this->getColumnStatus('position')) { - $this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1)); + $this->printStdColumnContent($pdf, $curY, 'position', strval($linePosition)); } // VAT Rate if ($this->getColumnStatus('vat')) { $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'vat', $vat_rate); - $nexY = max($pdf->GetY(), $nexY); } // Unit price before discount if ($this->getColumnStatus('subprice')) { $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'subprice', $up_excl_tax); - $nexY = max($pdf->GetY(), $nexY); } // Quantity @@ -826,42 +806,36 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if ($this->getColumnStatus('qty')) { $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'qty', $qty); - $nexY = max($pdf->GetY(), $nexY); } // Situation progress if ($this->getColumnStatus('progress')) { $progress = pdf_getlineprogress($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'progress', $progress); - $nexY = max($pdf->GetY(), $nexY); } // Unit if ($this->getColumnStatus('unit')) { $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); - $nexY = max($pdf->GetY(), $nexY); } // Discount on line if ($this->getColumnStatus('discount') && $object->lines[$i]->remise_percent) { $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'discount', $remise_percent); - $nexY = max($pdf->GetY(), $nexY); } // Total excl tax line (HT) if ($this->getColumnStatus('totalexcltax')) { $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'totalexcltax', $total_excl_tax); - $nexY = max($pdf->GetY(), $nexY); } // Total with tax line (TTC) if ($this->getColumnStatus('totalincltax')) { $total_incl_tax = pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'totalincltax', $total_incl_tax); - $nexY = max($pdf->GetY(), $nexY); } // Extrafields @@ -870,18 +844,19 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if ($this->getColumnStatus($extrafieldColKey)) { $extrafieldValue = $this->getExtrafieldContent($object->lines[$i], $extrafieldColKey, $outputlangs); $this->printStdColumnContent($pdf, $curY, $extrafieldColKey, $extrafieldValue); - $nexY = max($pdf->GetY(), $nexY); + + $this->setAfterColsLinePositionsData('options_' . $extrafieldColKey, $pdf->GetY(), $pdf->getPage()); } } } - + $afterPosData = $this->getMaxAfterColsLinePositionsData(); $parameters = array( 'object' => $object, 'i' => $i, 'pdf' => & $pdf, 'curY' => & $curY, - 'nexY' => & $nexY, + 'nexY' => & $afterPosData['y'], // for backward module hook compatibility Y will be accessible by $object->getMaxAfterColsLinePositionsData() 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails ); @@ -960,7 +935,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if (!isset($this->tva[$vatrate])) { $this->tva[$vatrate] = 0; } - $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete + $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete $vatcode = $object->lines[$i]->vat_src_code; if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) { if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['tot_ht'])) { @@ -974,68 +949,92 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); } - $nexY = max($nexY, $posYAfterImage); + $afterPosData = $this->getMaxAfterColsLinePositionsData(); + $pdf->setPage($afterPosData['page']); + $nexY = $afterPosData['y']; // Add line - if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { - $pdf->setPage($pageposafter); + if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1) && $afterPosData['y'] < $this->page_hauteur - $this->heightforfooter - 5) { $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); - $pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY); + $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); $pdf->SetLineStyle(array('dash' => 0)); } - // Detect if some page were added automatically and output _tableau for past pages - while ($pagenb < $pageposafter) { - $pdf->setPage($pagenb); - $heightforqrinvoice = $this->getHeightForQRInvoice($pagenb, $object, $langs); - if ($pagenb == $pageposbeforeprintlines) { - $this->_tableau($pdf, $this->tab_top, $this->page_hauteur - $this->tab_top - $this->heightforfooter - $heightforqrinvoice, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); - } else { - $this->_tableau($pdf, $this->tab_top_newpage, $this->page_hauteur - $this->tab_top_newpage - $this->heightforfooter - $heightforqrinvoice, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); - } - $this->_pagefoot($pdf, $object, $outputlangs, 1, $this->getHeightForQRInvoice($pdf->getPage(), $object, $outputlangs)); - $pagenb++; - $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { - $this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis); - } - if (!empty($tplidx)) { - $pdf->useTemplate($tplidx); - } + $nexY += 2; // Add space between lines + } + + // Add last page for document footer if there are not enough size left + $afterPosData = $this->getMaxAfterColsLinePositionsData(); + $page_bottom_margin = $this->heightforfooter + $this->heightforfreetext + $this->heightforinfotot + $this->getHeightForQRInvoice($pdf->getPage(), $object, $langs); + + if ($afterPosData['y'] > $this->page_hauteur - $page_bottom_margin) { + $pdf->AddPage(); + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); } + $pagenb++; + $pdf->setPage($pagenb); + } - if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { // @phan-suppress-current-line PhanUndeclaredProperty - $heightforqrinvoice = $this->getHeightForQRInvoice($pagenb, $object, $langs); - if ($pagenb == $pageposafter) { - $this->_tableau($pdf, $this->tab_top, $this->page_hauteur - $this->tab_top - $this->heightforfooter - $heightforqrinvoice, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); + // Draw table frames and columns borders + $drawTabNumbPage = $pdf->getNumPages(); + for ($i=$pageposbeforeprintlines; $i<=$drawTabNumbPage; $i++) { + $pdf->setPage($i); + // reset page orientation each loop to override it if it was changed + $pdf->setPageOrientation('', 0, 0); // The only function to edit the bottom margin of current page to set it. + + $drawTabHideTop = $hidetop; + $drawTabTop = $this->tab_top_newpage; + $drawTabBottom = $this->page_hauteur - $this->heightforfooter;; + $hideBottom = 0; // TODO understand why it change to 1 or 0 during process + + if ($i == $pageposbeforeprintlines) { + // first page need to start after notes + $drawTabTop = $this->tab_top; + } elseif (!$drawTabHideTop) { + if (getDolGlobalInt('MAIN_PDF_ENABLE_COL_HEAD_TITLE_REPEAT')) { + $drawTabTop-= $this->tabTitleHeight; } else { - $this->_tableau($pdf, $this->tab_top_newpage, $this->page_hauteur - $this->tab_top_newpage - $this->heightforfooter - $heightforqrinvoice, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); - } - $this->_pagefoot($pdf, $object, $outputlangs, 1, $this->getHeightForQRInvoice($pdf->getPage(), $object, $outputlangs)); - // New page - $pdf->AddPage(); - if (!empty($tplidx)) { - $pdf->useTemplate($tplidx); - } - $pagenb++; - if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { - $this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis); + $drawTabHideTop = 1; } } - } - // Show square - $heightforqrinvoice = $this->getHeightForQRInvoice($pagenb, $object, $langs); - if ($pagenb == $pageposbeforeprintlines) { - $this->_tableau($pdf, $this->tab_top, $this->page_hauteur - $this->tab_top - $this->heightforinfotot - $this->heightforfreetext - $this->heightforfooter - $heightforqrinvoice, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code, $outputlangsbis); - $bottomlasttab = $this->page_hauteur - $this->heightforinfotot - $this->heightforfreetext - $this->heightforfooter - $heightforqrinvoice + 1; - } else { - $this->_tableau($pdf, $this->tab_top_newpage, $this->page_hauteur - $this->tab_top_newpage - $this->heightforinfotot - $this->heightforfreetext - $this->heightforfooter - $heightforqrinvoice, 0, $outputlangs, 1, 0, $object->multicurrency_code, $outputlangsbis); - $bottomlasttab = $this->page_hauteur - $this->heightforinfotot - $this->heightforfreetext - $this->heightforfooter - $heightforqrinvoice + 1; + // last page need to include document footer + if ($i == $pdf->getNumPages()) { + // remove document footer height to tab bottom position + $drawTabBottom-= $this->heightforfreetext + $this->heightforinfotot + $this->getHeightForQRInvoice($pdf->getPage(), $object, $outputlangs); + } + + $drawTabHeight = $drawTabBottom - $drawTabTop; + $this->_tableau($pdf, $drawTabTop, $drawTabHeight, 0, $outputlangs, $drawTabHideTop, $hideBottom, $object->multicurrency_code, $outputlangsbis); + + $hideFreeText = $i != $pdf->getNumPages() ? 1 : 0; // Display free text only in last page + + $this->_pagefoot($pdf, $object, $outputlangs, $hideFreeText, $this->getHeightForQRInvoice($pdf->getPage(), $object, $outputlangs)); + + $pdf->setPage($i); // in case of _pagefoot or _tableau change it + + // reset page orientation each loop to override it if it was changed by _pagefoot or _tableau change it + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + + // Don't print head on first page ($pageposbeforeprintlines) because already added previously + if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') && $i != $pageposbeforeprintlines) { + $this->_pagehead($pdf, $object, 0, $outputlangs); + } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } + + // reset text color before print footers + $pdf->SetTextColor(0, 0, 0); + + $pdf->setPage($pdf->getNumPages()); + + $bottomlasttab = $this->page_hauteur - $this->heightforinfotot - $this->heightforfreetext - $this->heightforfooter - $heightforqrinvoice + 1; + // Display infos area $posy = $this->drawInfoTable($pdf, $object, $bottomlasttab, $outputlangs, $outputlangsbis); @@ -1048,8 +1047,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $posy = $this->drawPaymentsTable($pdf, $object, $posy, $outputlangs); } - // Pagefoot - $this->_pagefoot($pdf, $object, $outputlangs, 0, $this->getHeightForQRInvoice($pdf->getPage(), $object, $langs)); + // Add number of pages in footer if (method_exists($pdf, 'AliasNbPages')) { $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod } @@ -1270,6 +1268,9 @@ protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs, $outputlan krsort($this->tva_array); + // Clean data type + $object->total_tva = (float) $object->total_tva; + // Show VAT details if ($object->total_tva != 0 && getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) { $pdf->SetFillColor(224, 224, 224); @@ -1327,16 +1328,19 @@ protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs, $outputlan } } - // If France, show VAT mention if not applicable - if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) { + // If France, show VAT mention if applicable + if (in_array($this->emetteur->country_code, array('FR')) && empty($object->total_tva)) { $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); - if ($mysoc->forme_juridique_code == 92) { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoiceAsso"), 0, 'L', 0); - } else { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + if (empty($mysoc->tva_assuj)) { + if ($mysoc->forme_juridique_code == 92) { + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoiceAsso"), 0, 'L', 0); + } else { + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + } + } elseif (getDolGlobalString("INVOICE_VAT_SHOW_REVERSE_CHARGE_MENTION") && $this->emetteur->country_code != $object->thirdparty->country_code && $this->emetteur->isInEEC() && $object->thirdparty->isInEEC()) { + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedReverseChargeProcedure"), 0, 'L', 0); } - $posy = $pdf->GetY() + 4; } @@ -1470,7 +1474,7 @@ protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs, $outputlan if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // If payment mode unregulated or payment mode forced to CHQ if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) { - $diffsizetitle = (!getDolGlobalString('PDF_DIFFSIZE_TITLE') ? 3 : $conf->global->PDF_DIFFSIZE_TITLE); + $diffsizetitle = getDolGlobalInt('PDF_DIFFSIZE_TITLE', 3); if (getDolGlobalInt('FACTURE_CHQ_NUMBER') > 0) { $account = new Account($this->db); @@ -1488,7 +1492,7 @@ protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs, $outputlan $posy = $pdf->GetY() + 2; } } - if ($conf->global->FACTURE_CHQ_NUMBER == -1) { + if (getDolGlobalInt('FACTURE_CHQ_NUMBER') == -1) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0); @@ -1572,7 +1576,7 @@ protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs, $outputlan */ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs, $outputlangsbis) { - global $conf, $mysoc, $hookmanager; + global $mysoc, $hookmanager; $sign = 1; if ($object->type == 2 && getDolGlobalString('INVOICE_POSITIVE_CREDIT_NOTE')) { @@ -2820,7 +2824,7 @@ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hide $this->cols['totalexcltax'] = array( 'rank' => $rank, 'width' => 26, // in mm - 'status' => !getDolGlobalString('PDF_PROPAL_HIDE_PRICE_EXCL_TAX'), + 'status' => !getDolGlobalBool('PDF_INVOICE_HIDE_PRICE_EXCL_TAX'), 'title' => array( 'textkey' => 'TotalHTShort' ), @@ -2831,7 +2835,7 @@ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hide $this->cols['totalincltax'] = array( 'rank' => $rank, 'width' => 26, // in mm - 'status' => getDolGlobalBool('PDF_PROPAL_SHOW_PRICE_INCL_TAX'), + 'status' => getDolGlobalBool('PDF_INVOICE_SHOW_PRICE_INCL_TAX'), 'title' => array( 'textkey' => 'TotalTTCShort' ), diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index 40dc103464243..3d3a93e8154b4 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -84,7 +84,7 @@ public function info($langs) // Setting the prefix $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipstandardmercure').''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipstandardmercure').''; $texte .= '  '; @@ -92,20 +92,20 @@ public function info($langs) // Prefix setting of credit note $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipcreditnotemercure').''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipcreditnotemercure').''; $texte .= ''; // Prefix setting of replacement invoices if (!getDolGlobalString('INVOICE_DISABLE_REPLACEMENT')) { $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipreplacementmercure').''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipreplacementmercure').''; $texte .= ''; } // Prefix setting of deposit if (!getDolGlobalString('INVOICE_DISABLE_DEPOSIT')) { $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipdownpaymentmercure').''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipdownpaymentmercure').''; $texte .= ''; } diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index 0ac08eb7e063f..a23fe52bbf63c 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -88,7 +88,7 @@ public function info($langs) // Setting the prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/holiday/mod_holiday_immaculate.php b/htdocs/core/modules/holiday/mod_holiday_immaculate.php index 03029517427a2..c8ed8ec59965d 100644 --- a/htdocs/core/modules/holiday/mod_holiday_immaculate.php +++ b/htdocs/core/modules/holiday/mod_holiday_immaculate.php @@ -73,7 +73,7 @@ public function info($langs) //$tooltip .= '
'.$langs->trans("GenericMaskCodes5b"); $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/hrm/mod_evaluation_advanced.php b/htdocs/core/modules/hrm/mod_evaluation_advanced.php index de221e52fee32..434512e1cb115 100644 --- a/htdocs/core/modules/hrm/mod_evaluation_advanced.php +++ b/htdocs/core/modules/hrm/mod_evaluation_advanced.php @@ -82,7 +82,7 @@ public function info($langs) // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 10b889aa345d3..6d9e7c32e22de 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -830,7 +830,7 @@ public function import_insert($arrayrecord, $array_match_file_to_database, $obji $tmp = explode('-', $tmpval, 2); $listfields[] = $keyfield; $listvalues[] = "'".$this->db->escape($tmp[1])."'"; - } elseif (preg_match('/^rule-/', $tmpval)) { + } elseif (preg_match('/^rule-/', $tmpval)) { // Example: rule-computeAmount, rule-computeDirection, ... $fieldname = $tmpkey; if (!empty($objimport->array_import_convertvalue[0][$fieldname])) { if ($objimport->array_import_convertvalue[0][$fieldname]['rule'] == 'compute') { diff --git a/htdocs/core/modules/member/doc/pdf_standard_member.class.php b/htdocs/core/modules/member/doc/pdf_standard_member.class.php index 3adbb53d53fe6..42113bb78cd47 100644 --- a/htdocs/core/modules/member/doc/pdf_standard_member.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard_member.class.php @@ -291,7 +291,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $mode = 'mem // List of values to scan for a replacement $substitutionarray = array( - '__ID__' => $object->id, + '__ID__' => (string) $object->id, '__REF__' => $object->ref, '__LOGIN__' => empty($object->login) ? '' : $object->login, '__FIRSTNAME__' => empty($object->firstname) ? '' : $object->firstname, @@ -309,7 +309,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $mode = 'mem '__YEAR__' => $year, '__MONTH__' => $month, '__DAY__' => $day, - '__DOL_MAIN_URL_ROOT__' => DOL_MAIN_URL_ROOT, + '__DOL_MAIN_URL_ROOT__' => (string) DOL_MAIN_URL_ROOT, '__SERVER__' => "https://".$_SERVER["SERVER_NAME"]."/" ); complete_substitutions_array($substitutionarray, $langs); diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 1dc084ee7cd73..a630b1f9fd3fb 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -400,4 +400,37 @@ public function __construct($db) 'b.multicurrency_code'=>"US (Necessary if devise is different than EUR)", ); } + + /** + * Function called when module is enabled. + * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. + * It also creates data directories + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + public function init($options = '') + { + $result = $this->_load_tables('/install/mysql/', 'accounting'); + 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') + } + + $sql = array(); + return $this->_init($sql, $options); + } + + /** + * Function called when module is disabled. + * Remove from database constants, boxes and permissions from Dolibarr database. + * Data directories are not deleted + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + public function remove($options = '') + { + $sql = array(); + return $this->_remove($sql, $options); + } } diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 47c766d525b1b..bc0d440bad833 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -211,6 +211,8 @@ public function __construct($db) // 'target'=>'', // 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both // $r++; + + // TODO Move the top menu entry into the code part (eldy_menu.php and auguria.sql) so we can have a top menu shown for resource module only. $this->menu[$r] = array( 'fk_menu' => 0, 'type' => 'top', diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 43ee332c399cc..bb6d39c942121 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -202,7 +202,7 @@ public function __construct($db) $this->export_label[$r] = 'CustomersOrdersAndOrdersLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r] = array(array("commande", "commande", "export")); $this->export_fields_array[$r] = array( - 's.rowid' => "IdCompany", 's.nom' => 'CompanyName', 'ps.nom' => 'ParentCompany', 's.code_client' => 'CustomerCode', 's.address' => 'Address', 's.zip' => 'Zip', 's.town' => 'Town', 'd.nom' => 'State', 'co.label' => 'Country', + 's.rowid' => "IdCompany", 's.nom' => 'CompanyName', 's.name_alias' => 'AliasNameShort', 'ps.nom' => 'ParentCompany', 's.code_client' => 'CustomerCode', 's.address' => 'Address', 's.zip' => 'Zip', 's.town' => 'Town', 'd.nom' => 'State', 'co.label' => 'Country', 'co.code' => "CountryCode", 's.phone' => 'Phone', 's.siren' => 'ProfId1', 's.siret' => 'ProfId2', 's.ape' => 'ProfId3', 's.idprof4' => 'ProfId4', 'c.rowid' => "Id", 'c.ref' => "Ref", 'c.ref_client' => "RefCustomer", 'c.fk_soc' => "IdCompany", 'c.date_creation' => "DateCreation", 'c.date_commande' => "OrderDate", 'c.date_livraison' => "DateDeliveryPlanned", 'c.amount_ht' => "Amount", 'c.total_ht' => "TotalHT", @@ -236,7 +236,7 @@ public function __construct($db) // 'p.rowid'=>'List:product:ref','p.ref'=>'Text','p.label'=>'Text' //); $this->export_TypeFields_array[$r] = array( - 's.nom' => 'Text', 'ps.nom' => 'Text', 's.code_client' => 'Text', 's.address' => 'Text', 's.zip' => 'Text', 's.town' => 'Text', 'co.label' => 'List:c_country:label:label', 'co.code' => 'Text', 's.phone' => 'Text', + 's.nom' => 'Text', 'ps.nom' => 'Text', 's.name_alias' => 'Text', 's.code_client' => 'Text', 's.address' => 'Text', 's.zip' => 'Text', 's.town' => 'Text', 'co.label' => 'List:c_country:label:label', 'co.code' => 'Text', 's.phone' => 'Text', 's.siren' => 'Text', 's.siret' => 'Text', 's.ape' => 'Text', 's.idprof4' => 'Text', 'c.ref' => "Text", 'c.ref_client' => "Text", 'c.date_creation' => "Date", 'c.date_commande' => "Date", 'c.date_livraison' => "Date", 'sm.code' => "Text", 'c.amount_ht' => "Numeric", 'c.total_ht' => "Numeric", 'c.total_ttc' => "Numeric", 'c.facture' => "Boolean", 'c.fk_statut' => 'Status', 'c.note_public' => "Text", 'pj.ref' => 'Text', @@ -246,7 +246,7 @@ public function __construct($db) 'cir.label'=>'Text', ); $this->export_entities_array[$r] = array( - 's.rowid' => "company", 's.nom' => 'company', 'ps.nom' => 'company', 's.code_client' => 'company', 's.address' => 'company', 's.zip' => 'company', 's.town' => 'company', 'd.nom' => 'company', 'co.label' => 'company', + 's.rowid' => "company", 's.nom' => 'company', 's.name_alias' => 'company', 'ps.nom' => 'company', 's.code_client' => 'company', 's.address' => 'company', 's.zip' => 'company', 's.town' => 'company', 'd.nom' => 'company', 'co.label' => 'company', 'co.code' => 'company', 's.phone' => 'company', 's.siren' => 'company', 's.ape' => 'company', 's.idprof4' => 'company', 's.siret' => 'company', 'c.rowid' => "order", 'c.ref' => "order", 'c.ref_client' => "order", 'c.fk_soc' => "order", 'c.date_creation' => "order", 'c.date_commande' => "order", 'c.amount_ht' => "order", 'c.total_ht' => "order", 'c.total_ttc' => "order", 'c.facture' => "order", 'c.fk_statut' => "order", 'c.note' => "order", diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index d80eb244a8d23..c20bb42dc2620 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -513,7 +513,7 @@ public function __construct($db) $this->export_permission[$r] = array(array("facture", "facture", "export", "other")); $this->export_fields_array[$r] = array( - 's.rowid' => "IdCompany", 's.nom' => 'CompanyName', 'ps.nom' => 'ParentCompany', 's.code_client' => 'CustomerCode', 's.address' => 'Address', 's.zip' => 'Zip', 's.town' => 'Town', 'c.code' => 'CountryCode', 'cd.nom' => 'State', + 's.rowid' => "IdCompany", 's.nom' => 'CompanyName', 's.name_alias' => 'AliasNameShort', 'ps.nom' => 'ParentCompany', 's.code_client' => 'CustomerCode', 's.address' => 'Address', 's.zip' => 'Zip', 's.town' => 'Town', 'c.code' => 'CountryCode', 'cd.nom' => 'State', 's.phone' => 'Phone', 's.siren' => 'ProfId1', 's.siret' => 'ProfId2', 's.ape' => 'ProfId3', 's.idprof4' => 'ProfId4', 's.code_compta' => 'CustomerAccountancyCode', @@ -585,7 +585,7 @@ public function __construct($db) } $this->export_TypeFields_array[$r] = array( - 's.rowid' => 'Numeric', 's.nom' => 'Text', 'ps.nom' => 'Text', 's.code_client' => 'Text', 's.address' => 'Text', 's.zip' => 'Text', 's.town' => 'Text', 'c.code' => 'Text', 'cd.nom' => 'Text', 's.phone' => 'Text', 's.siren' => 'Text', + 's.rowid' => 'Numeric', 's.nom' => 'Text', 's.name_alias' => 'Text', 'ps.nom' => 'Text', 's.code_client' => 'Text', 's.address' => 'Text', 's.zip' => 'Text', 's.town' => 'Text', 'c.code' => 'Text', 'cd.nom' => 'Text', 's.phone' => 'Text', 's.siren' => 'Text', 's.siret' => 'Text', 's.ape' => 'Text', 's.idprof4' => 'Text', 's.code_compta' => 'Text', 's.code_compta_fournisseur' => 'Text', 's.tva_intra' => 'Text', 't.libelle' => "Text", // 'ce.code'=>"List:c_effectif:libelle:code", "cfj.libelle"=>"Text", 'f.rowid' => 'Numeric', 'f.ref' => "Text", 'f.ref_client' => 'Text', 'f.fk_facture_source' => 'Numeric', 'f.type' => "Numeric", 'f.datec' => "Date", 'f.datef' => "Date", 'f.date_lim_reglement' => "Date", @@ -608,7 +608,7 @@ public function __construct($db) 'f.multicurrency_tx' => 'Number', 'f.multicurrency_total_ht' => 'Number', 'f.multicurrency_total_tva' => 'Number', 'f.multicurrency_total_ttc' => 'Number' ); $this->export_entities_array[$r] = array( - 's.rowid' => "company", 's.nom' => 'company', 'ps.nom' => 'company', 's.code_client' => 'company', 's.address' => 'company', 's.zip' => 'company', 's.town' => 'company', 'c.code' => 'company', 'cd.nom' => 'company', 's.phone' => 'company', + 's.rowid' => "company", 's.nom' => 'company', 's.name_alias' => 'company', 'ps.nom' => 'company', 's.code_client' => 'company', 's.address' => 'company', 's.zip' => 'company', 's.town' => 'company', 'c.code' => 'company', 'cd.nom' => 'company', 's.phone' => 'company', 's.siren' => 'company', 's.siret' => 'company', 's.ape' => 'company', 's.idprof4' => 'company', 's.code_compta' => 'company', 's.code_compta_fournisseur' => 'company', 's.tva_intra' => 'company', 't.libelle' => 'company', // 'ce.code'=>'company', 'cfj.libelle'=>'company' 'pj.ref' => 'project', 'pj.title' => 'project', 'fd.rowid' => 'invoice_line', 'fd.description' => "invoice_line", @@ -675,7 +675,7 @@ public function __construct($db) $this->export_icon[$r] = 'invoice'; $this->export_permission[$r] = array(array("facture", "facture", "export")); $this->export_fields_array[$r] = array( - 's.rowid' => "IdCompany", 's.nom' => 'CompanyName', 's.code_client' => 'CustomerCode', 's.address' => 'Address', 's.zip' => 'Zip', 's.town' => 'Town', 'c.code' => 'CountryCode', 'cd.nom' => 'State', + 's.rowid' => "IdCompany", 's.nom' => 'CompanyName', 's.name_alias' => 'AliasNameShort', 's.code_client' => 'CustomerCode', 's.address' => 'Address', 's.zip' => 'Zip', 's.town' => 'Town', 'c.code' => 'CountryCode', 'cd.nom' => 'State', 's.phone' => 'Phone', 's.siren' => 'ProfId1', 's.siret' => 'ProfId2', 's.ape' => 'ProfId3', 's.idprof4' => 'ProfId4', 's.code_compta' => 'CustomerAccountancyCode', 's.code_compta_fournisseur' => 'SupplierAccountancyCode', 's.tva_intra' => 'VATIntra', @@ -710,7 +710,7 @@ public function __construct($db) $this->export_fields_array[$r]['f.pos_source'] = 'POSTerminal'; } $this->export_TypeFields_array[$r] = array( - 's.rowid' => 'Numeric', 's.nom' => 'Text', 's.code_client' => 'Text', 's.address' => 'Text', 's.zip' => 'Text', 's.town' => 'Text', 'c.code' => 'Text', 'cd.nom' => 'Text', 's.phone' => 'Text', 's.siren' => 'Text', + 's.rowid' => 'Numeric', 's.nom' => 'Text', 's.name_alias' => 'Text', 's.code_client' => 'Text', 's.address' => 'Text', 's.zip' => 'Text', 's.town' => 'Text', 'c.code' => 'Text', 'cd.nom' => 'Text', 's.phone' => 'Text', 's.siren' => 'Text', 's.siret' => 'Text', 's.ape' => 'Text', 's.idprof4' => 'Text', 's.code_compta' => 'Text', 's.code_compta_fournisseur' => 'Text', 's.tva_intra' => 'Text', 'f.rowid' => "Numeric", 'f.ref' => "Text", 'f.ref_client' => 'Text', 'f.fk_facture_source' => 'Numeric', 'f.type' => "Numeric", 'f.datec' => "Date", 'f.datef' => "Date", 'f.date_lim_reglement' => "Date", 'f.fk_cond_reglement' => 'Numeric', 'f.fk_mode_reglement' => 'Numeric', @@ -725,7 +725,7 @@ public function __construct($db) $this->export_fields_array[$r]['f.pos_source'] = 'POSTerminal'; } $this->export_entities_array[$r] = array( - 's.rowid' => "company", 's.nom' => 'company', 's.code_client' => 'company', 's.address' => 'company', 's.zip' => 'company', 's.town' => 'company', 'c.code' => 'company', 'cd.nom' => 'company', 's.phone' => 'company', + 's.rowid' => "company", 's.nom' => 'company', 's.name_alias' => 'company', 's.code_client' => 'company', 's.address' => 'company', 's.zip' => 'company', 's.town' => 'company', 'c.code' => 'company', 'cd.nom' => 'company', 's.phone' => 'company', 's.siren' => 'company', 's.siret' => 'company', 's.ape' => 'company', 's.idprof4' => 'company', 's.code_compta' => 'company', 's.code_compta_fournisseur' => 'company', 's.tva_intra' => 'company', 'pj.ref' => 'project', 'pj.title' => 'project', 'p.rowid' => 'payment', 'p.ref' => 'payment', 'p.amount' => 'payment', 'pf.amount' => 'payment', 'p.datep' => 'payment', 'p.num_paiement' => 'payment', 'pt.code' => 'payment', 'pt.libelle' => 'payment', 'p.note' => 'payment', 'f.fk_user_author' => 'user', 'uc.login' => 'user', diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index c9bc793fb368b..62b15d2116ec5 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -44,7 +44,7 @@ class modStock extends DolibarrModules */ public function __construct($db) { - global $conf, $langs; + global $conf, $langs; // $conf is used by inc.php $this->db = $db; $this->numero = 52; @@ -156,6 +156,17 @@ public function __construct($db) $this->rights[$r][4] = 'mouvement'; $this->rights[$r][5] = 'creer'; + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { + // Not yet implemented. TODO + $r++; + $this->rights[$r][0] = 1008; + $this->rights[$r][1] = 'Read stock value'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'value_advance'; + $this->rights[$r][5] = 'read'; + } + $r++; $this->rights[$r][0] = 1011; $this->rights[$r][1] = 'inventoryReadPermission'; // Permission label diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index 208439f0cfa9e..b9d43c6099d62 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -269,6 +269,7 @@ public function __construct($db) public function init($options = '') { global $conf, $langs, $user, $mysoc; + $langs->load("cashdesk"); dolibarr_set_const($this->db, "TAKEPOS_PRINT_METHOD", "browser", 'chaine', 0, '', $conf->entity); @@ -301,7 +302,7 @@ public function init($options = '') $categories = new Categorie($this->db); $cate_arbo = $categories->get_full_arbo('product', 0, 1); if (is_array($cate_arbo)) { - if (!count($cate_arbo) || !getDolGlobalString('TAKEPOS_ROOT_CATEGORY_ID')) { + if (!count($cate_arbo) || (!getDolGlobalString('TAKEPOS_ROOT_CATEGORY_ID') || getDolGlobalString('TAKEPOS_ROOT_CATEGORY_ID') == '-1')) { $category = new Categorie($this->db); $category->label = $langs->trans("DefaultPOSCatLabel"); diff --git a/htdocs/core/modules/mrp/mod_mo_advanced.php b/htdocs/core/modules/mrp/mod_mo_advanced.php index 255a3e6da43b5..82286280b8eeb 100644 --- a/htdocs/core/modules/mrp/mod_mo_advanced.php +++ b/htdocs/core/modules/mrp/mod_mo_advanced.php @@ -83,7 +83,7 @@ public function info($langs) // Parametrage du prefix $text .= ''.$langs->trans("Mask").':'; - $text .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $text .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $text .= '  '; diff --git a/htdocs/core/modules/oauth/generic_oauthcallback.php b/htdocs/core/modules/oauth/generic_oauthcallback.php index 6916499daf604..2b47b7f798e6e 100644 --- a/htdocs/core/modules/oauth/generic_oauthcallback.php +++ b/htdocs/core/modules/oauth/generic_oauthcallback.php @@ -43,7 +43,7 @@ * @var Translate $langs * @var User $user * - * @var string $dolibarr_main_url_roott + * @var string $dolibarr_main_url_root */ use OAuth\Common\Storage\DoliStorage; use OAuth\Common\Consumer\Credentials; @@ -334,7 +334,7 @@ dol_syslog("we received the login/email to log to, it is ".$useremail); $tmparray = (empty($_SESSION['datafromloginform']) ? array() : $_SESSION['datafromloginform']); - $entitytosearchuser = (isset($tmparray['entity']) ? $tmparray['entity'] : -1); + $entitytosearchuser = ((isset($tmparray['entity']) && $tmparray['entity'] != '') ? $tmparray['entity'] : -1); // Delete the old token $storage->clearToken($genericstring); // Delete the token called ("Generic-".$storage->keyforprovider) diff --git a/htdocs/core/modules/oauth/github_oauthcallback.php b/htdocs/core/modules/oauth/github_oauthcallback.php index c2febb3597a01..3c96d1a97402e 100644 --- a/htdocs/core/modules/oauth/github_oauthcallback.php +++ b/htdocs/core/modules/oauth/github_oauthcallback.php @@ -32,7 +32,7 @@ * @var Translate $langs * @var User $user * - * @var string $dolibarr_main_url_roott + * @var string $dolibarr_main_url_root */ use OAuth\Common\Storage\DoliStorage; diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php index 741d1137001a2..924b78bc07fc6 100644 --- a/htdocs/core/modules/oauth/google_oauthcallback.php +++ b/htdocs/core/modules/oauth/google_oauthcallback.php @@ -47,7 +47,7 @@ * @var Translate $langs * @var User $user * - * @var string $dolibarr_main_url_roott + * @var string $dolibarr_main_url_root */ use OAuth\Common\Storage\DoliStorage; @@ -324,7 +324,7 @@ dol_syslog("we received the login/email to log to, it is ".$useremail); $tmparray = (empty($_SESSION['datafromloginform']) ? array() : $_SESSION['datafromloginform']); - $entitytosearchuser = (isset($tmparray['entity']) ? $tmparray['entity'] : -1); + $entitytosearchuser = ((isset($tmparray['entity']) && $tmparray['entity'] != '') ? $tmparray['entity'] : -1); // Delete the old token $storage->clearToken('Google'); // Delete the token called ("Google-".$storage->keyforprovider) diff --git a/htdocs/core/modules/oauth/microsoft2_oauthcallback.php b/htdocs/core/modules/oauth/microsoft2_oauthcallback.php index 29a494fc4677d..9f516f28043d9 100644 --- a/htdocs/core/modules/oauth/microsoft2_oauthcallback.php +++ b/htdocs/core/modules/oauth/microsoft2_oauthcallback.php @@ -32,7 +32,7 @@ * @var Translate $langs * @var User $user * - * @var string $dolibarr_main_url_roott + * @var string $dolibarr_main_url_root */ use OAuth\Common\Storage\DoliStorage; diff --git a/htdocs/core/modules/oauth/microsoft_oauthcallback.php b/htdocs/core/modules/oauth/microsoft_oauthcallback.php index 6fbee4bc049ba..3cc0c5da50c4f 100644 --- a/htdocs/core/modules/oauth/microsoft_oauthcallback.php +++ b/htdocs/core/modules/oauth/microsoft_oauthcallback.php @@ -32,7 +32,7 @@ * @var Translate $langs * @var User $user * - * @var string $dolibarr_main_url_roott + * @var string $dolibarr_main_url_root */ use OAuth\Common\Storage\DoliStorage; diff --git a/htdocs/core/modules/oauth/stripelive_oauthcallback.php b/htdocs/core/modules/oauth/stripelive_oauthcallback.php index a61dc56161fbb..0bb7d7d478615 100644 --- a/htdocs/core/modules/oauth/stripelive_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripelive_oauthcallback.php @@ -33,7 +33,7 @@ * @var Translate $langs * @var User $user * - * @var string $dolibarr_main_url_roott + * @var string $dolibarr_main_url_root */ use OAuth\Common\Storage\DoliStorage; diff --git a/htdocs/core/modules/oauth/stripetest_oauthcallback.php b/htdocs/core/modules/oauth/stripetest_oauthcallback.php index 2608a7b6fb62e..e20c8f35e75a0 100644 --- a/htdocs/core/modules/oauth/stripetest_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripetest_oauthcallback.php @@ -32,7 +32,7 @@ * @var Translate $langs * @var User $user * - * @var string $dolibarr_main_url_roott + * @var string $dolibarr_main_url_root */ use OAuth\Common\Storage\DoliStorage; diff --git a/htdocs/core/modules/openid_connect/callback.php b/htdocs/core/modules/openid_connect/callback.php index 9fd4ffde67dce..c55a4772053a4 100644 --- a/htdocs/core/modules/openid_connect/callback.php +++ b/htdocs/core/modules/openid_connect/callback.php @@ -30,7 +30,9 @@ require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; - +/** + * @var string $dolibarr_main_url_root + */ // Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second $arrayofjs = array( '/includes/jstz/jstz.min.js'.(empty($conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION)), diff --git a/htdocs/core/modules/payment/mod_payment_ant.php b/htdocs/core/modules/payment/mod_payment_ant.php index 3a1fe0a9fade9..5e3f0a4b37da9 100644 --- a/htdocs/core/modules/payment/mod_payment_ant.php +++ b/htdocs/core/modules/payment/mod_payment_ant.php @@ -85,7 +85,7 @@ public function info($langs) // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index 51d3943314c33..b0932e24308cf 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -98,7 +98,7 @@ public function info($langs) // Parametrage du prefix customers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("ProductCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; @@ -106,7 +106,7 @@ public function info($langs) // Parametrage du prefix suppliers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("ServiceCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/product_batch/mod_lot_advanced.php b/htdocs/core/modules/product_batch/mod_lot_advanced.php index 35fa10f867e17..d07ce3fd9e35a 100644 --- a/htdocs/core/modules/product_batch/mod_lot_advanced.php +++ b/htdocs/core/modules/product_batch/mod_lot_advanced.php @@ -86,7 +86,7 @@ public function info($langs) // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/product_batch/mod_sn_advanced.php b/htdocs/core/modules/product_batch/mod_sn_advanced.php index dfcba97ccaf5d..18a33833ed3d1 100644 --- a/htdocs/core/modules/product_batch/mod_sn_advanced.php +++ b/htdocs/core/modules/product_batch/mod_sn_advanced.php @@ -86,7 +86,7 @@ public function info($langs) // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/project/mod_project_universal.php b/htdocs/core/modules/project/mod_project_universal.php index 2be62efa5f399..4132956f86ef5 100644 --- a/htdocs/core/modules/project/mod_project_universal.php +++ b/htdocs/core/modules/project/mod_project_universal.php @@ -92,7 +92,7 @@ public function info($langs) // Prefix settings $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/project/task/mod_task_universal.php b/htdocs/core/modules/project/task/mod_task_universal.php index 08cee523fecbd..4fcb310c9416e 100644 --- a/htdocs/core/modules/project/task/mod_task_universal.php +++ b/htdocs/core/modules/project/task/mod_task_universal.php @@ -87,7 +87,7 @@ public function info($langs) // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 3e363c3be54f2..c52dc1b2c16fa 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -81,7 +81,6 @@ class pdf_cyan extends ModelePDFPropales */ public $cols; - /** * Constructor * @@ -194,10 +193,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $nblines = count($object->lines); - $hidetop = 0; - if (getDolGlobalString('MAIN_PDF_DISABLE_COL_HEAD_TITLE')) { - $hidetop = getDolGlobalString('MAIN_PDF_DISABLE_COL_HEAD_TITLE'); - } + $hidetop = getDolGlobalInt('MAIN_PDF_DISABLE_COL_HEAD_TITLE'); // Loop on each lines to detect if there is at least one image to show $realpatharray = array(); @@ -361,6 +357,10 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $tab_top = 90 + $top_shift; $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + if (!$hidetop && getDolGlobalInt('MAIN_PDF_ENABLE_COL_HEAD_TITLE_REPEAT')) { + // TODO : make this hidden conf the default behavior for each PDF when each PDF managed this new Display + $tab_top_newpage+= $this->tabTitleHeight; + } $nexY = $tab_top; @@ -558,8 +558,25 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Loop on each lines $pageposbeforeprintlines = $pdf->getPage(); $pagenb = $pageposbeforeprintlines; + for ($i = 0; $i < $nblines; $i++) { + $linePosition = $i + 1; $curY = $nexY; + + // in First Check line page break and add page if needed + if (isset($object->lines[$i]->pagebreak) && $object->lines[$i]->pagebreak) { + // New page + $pdf->AddPage(); + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } + + $pdf->setPage($pdf->getNumPages()); + $nexY = $tab_top_newpage; + } + + $this->resetAfterColsLinePositionsData($nexY, $pdf->getPage()); + $pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage $pdf->SetTextColor(0, 0, 0); @@ -570,112 +587,78 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); + $curYBefore = $curY; + + // Allows data in the first page if description is long enough to break in multiples pages + $showpricebeforepagebreak = getDolGlobalInt('MAIN_PDF_DATA_ON_FIRST_PAGE'); - $showpricebeforepagebreak = 1; $posYAfterImage = 0; - $posYAfterDescription = 0; if ($this->getColumnStatus('photo')) { // We start with Photo of product line - if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot))) { // If photo too high, we moved completely on new page + $imageTopMargin = 1; + if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imageTopMargin + $imglinesize['height']) > ($this->page_hauteur - $heightforfooter)) { // If photo too high, we moved completely on new page $pdf->AddPage('', '', true); if (!empty($tplidx)) { $pdf->useTemplate($tplidx); } $pdf->setPage($pageposbefore + 1); - + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $curY = $tab_top_newpage; - - // Allows data in the first page if description is long enough to break in multiples pages - if (getDolGlobalString('MAIN_PDF_DATA_ON_FIRST_PAGE')) { - $showpricebeforepagebreak = 1; - } else { - $showpricebeforepagebreak = 0; - } + $showpricebeforepagebreak = 0; } - + $pdf->setPageOrientation('', 0, $heightforfooter + $heightforfreetext); // The only function to edit the bottom margin of current page to set it. if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) { - $pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY + 1, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi + $pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY + $imageTopMargin, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi // $pdf->Image does not increase value return by getY, so we save it manually $posYAfterImage = $curY + $imglinesize['height']; + + $this->setAfterColsLinePositionsData('photo', $posYAfterImage, $pdf->getPage()); } } - // Description of product line - if ($this->getColumnStatus('desc')) { - $pdf->startTransaction(); + // restore Page orientation for text + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + if ($this->getColumnStatus('desc')) { $this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc); - $pageposafter = $pdf->getPage(); - - if ($pageposafter > $pageposbefore) { // There is a pagebreak (not enough space for total+free text+footer) - $pdf->rollbackTransaction(true); - - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it to simple footer, so we can retry as if we have just the simple footer. - - $this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc); - - $pageposafter = $pdf->getPage(); - $posyafter = $pdf->GetY(); - //var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit; - if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot))) { // There is no space left for total+free text but no page break. - if ($i == ($nblines - 1)) { // No more lines, and no space left to show total, so we create a new page manually because no break page was done automatically for the last part. - $pdf->AddPage('', '', true); - if (!empty($tplidx)) { - $pdf->useTemplate($tplidx); - } - $pdf->setPage($pageposafter + 1); - } - } else { - // We found a page break that was done automatically and there is ow enough space for total+free text+footer. - // Allows data in the first page if description is long enough to break in multiples pages - if (getDolGlobalString('MAIN_PDF_DATA_ON_FIRST_PAGE')) { - $showpricebeforepagebreak = 1; - } else { - $showpricebeforepagebreak = 0; - } - } - } else { // No pagebreak - $pdf->commitTransaction(); - } - $posYAfterDescription = $pdf->GetY(); + $this->setAfterColsLinePositionsData('desc', $pdf->GetY(), $pdf->getPage()); } - $nexY = $pdf->GetY(); - $pageposafter = $pdf->getPage(); - + $afterPosData = $this->getMaxAfterColsLinePositionsData(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $curY = $curYBefore; + $pdf->setPageOrientation('', 0, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + - // We suppose that a too long description or photo were moved completely on next page, so we set the value for $curY and current page that will be used by the following output. - if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { - $pdf->setPage($pageposafter); + // We suppose that a too long description or photo were moved completely on next page + if ($afterPosData['page'] > $pageposbefore && (empty($showpricebeforepagebreak) || ($curY + 4) > ($this->page_hauteur - $heightforfooter))) { + $pdf->setPage($afterPosData['page']); $curY = $tab_top_newpage; } $pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font + // # of line if ($this->getColumnStatus('position')) { - $this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1)); + $this->printStdColumnContent($pdf, $curY, 'position', strval($linePosition)); } // VAT Rate if ($this->getColumnStatus('vat')) { $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'vat', $vat_rate); - $nexY = max($pdf->GetY(), $nexY); } // Unit price before discount if ($this->getColumnStatus('subprice')) { $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'subprice', $up_excl_tax); - $nexY = max($pdf->GetY(), $nexY); } // Quantity @@ -683,7 +666,6 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if ($this->getColumnStatus('qty')) { $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'qty', $qty); - $nexY = max($pdf->GetY(), $nexY); } @@ -691,28 +673,24 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if ($this->getColumnStatus('unit')) { $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); - $nexY = max($pdf->GetY(), $nexY); } // Discount on line if ($this->getColumnStatus('discount') && $object->lines[$i]->remise_percent) { $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'discount', $remise_percent); - $nexY = max($pdf->GetY(), $nexY); } // Total excl tax line (HT) if ($this->getColumnStatus('totalexcltax')) { $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'totalexcltax', $total_excl_tax); - $nexY = max($pdf->GetY(), $nexY); } // Total with tax line (TTC) if ($this->getColumnStatus('totalincltax')) { $total_incl_tax = pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'totalincltax', $total_incl_tax); - $nexY = max($pdf->GetY(), $nexY); } // Extrafields @@ -721,19 +699,21 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if ($this->getColumnStatus($extrafieldColKey)) { $extrafieldValue = $this->getExtrafieldContent($object->lines[$i], $extrafieldColKey, $outputlangs); $this->printStdColumnContent($pdf, $curY, $extrafieldColKey, $extrafieldValue); - $nexY = max($pdf->GetY(), $nexY); + + $this->setAfterColsLinePositionsData('options_'.$extrafieldColKey, $pdf->GetY(), $pdf->getPage()); } } } + $afterPosData = $this->getMaxAfterColsLinePositionsData(); $parameters = array( - 'object' => $object, - 'i' => $i, - 'pdf' => & $pdf, - 'curY' => & $curY, - 'nexY' => & $nexY, - 'outputlangs' => $outputlangs, - 'hidedetails' => $hidedetails + 'object' => $object, + 'i' => $i, + 'pdf' => & $pdf, + 'curY' => & $curY, + 'nexY' => & $afterPosData['y'], // for backward module hook compatibility Y will be accessible by $object->getMaxAfterColsLinePositionsData() + 'outputlangs' => $outputlangs, + 'hidedetails' => $hidedetails ); $reshook = $hookmanager->executeHooks('printPDFline', $parameters, $this); // Note that $object may have been modified by hook @@ -804,13 +784,14 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede } $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); - if ($posYAfterImage > $posYAfterDescription) { - $nexY = max($nexY, $posYAfterImage); - } + + + $afterPosData = $this->getMaxAfterColsLinePositionsData(); + $pdf->setPage($afterPosData['page']); + $nexY = $afterPosData['y']; // Add line - if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { - $pdf->setPage($pageposafter); + if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1) && $afterPosData['y'] < $this->page_hauteur - $heightforfooter - 5) { $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); @@ -818,55 +799,76 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede } $nexY += 2; // Add space between lines + } - // Detect if some page were added automatically and output _tableau for past pages - while ($pagenb < $pageposafter) { - $pdf->setPage($pagenb); - if ($pagenb == $pageposbeforeprintlines) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); - } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); - } - $this->_pagefoot($pdf, $object, $outputlangs, 1); - $pagenb++; - $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { - $this->_pagehead($pdf, $object, 0, $outputlangs); - } - if (!empty($tplidx)) { - $pdf->useTemplate($tplidx); - } + + // Add last page for document footer if there are not enough size left + $afterPosData = $this->getMaxAfterColsLinePositionsData(); + if ($afterPosData['y'] > $this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot) ) { + $pdf->AddPage(); + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); } + $pagenb++; + $pdf->setPage($pagenb); + } - if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { // @phan-suppress-current-line PhanUndeclaredProperty - if ($pagenb == $pageposafter) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); + // Draw table frames and columns borders + $drawTabNumbPage = $pdf->getNumPages(); + for ($i=$pageposbeforeprintlines; $i<=$drawTabNumbPage; $i++) { + $pdf->setPage($i); + // reset page orientation each loop to override it if it was changed + $pdf->setPageOrientation('', 0, 0); // The only function to edit the bottom margin of current page to set it. + + $drawTabHideTop = $hidetop; + $drawTabTop = $tab_top_newpage; + $drawTabBottom = $this->page_hauteur - $heightforfooter;; + $hideBottom = 0; // TODO understand why it change to 1 or 0 during process + + if ($i == $pageposbeforeprintlines) { + // first page need to start after notes + $drawTabTop = $tab_top; + } elseif (!$drawTabHideTop) { + if (getDolGlobalInt('MAIN_PDF_ENABLE_COL_HEAD_TITLE_REPEAT')) { + $drawTabTop-= $this->tabTitleHeight; } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); - } - $this->_pagefoot($pdf, $object, $outputlangs, 1); - // New page - $pdf->AddPage(); - if (!empty($tplidx)) { - $pdf->useTemplate($tplidx); - } - $pagenb++; - if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { - $this->_pagehead($pdf, $object, 0, $outputlangs); + $drawTabHideTop = 1; } } - } - // Show square - if ($pagenb == $pageposbeforeprintlines) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code, $outputlangsbis); - $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1; - } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code, $outputlangsbis); - $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1; + // last page need to include document footer + if ($i == $pdf->getNumPages()) { + // remove document footer height to tab bottom position + $drawTabBottom-= $heightforsignature + $heightforfreetext + $heightforinfotot; + } + + $drawTabHeight = $drawTabBottom - $drawTabTop; + $this->_tableau($pdf, $drawTabTop, $drawTabHeight, 0, $outputlangs, $drawTabHideTop, $hideBottom, $object->multicurrency_code, $outputlangsbis); + + $hideFreeText = $i != $pdf->getNumPages() ? 1 : 0; // Display free text only in last page + $this->_pagefoot($pdf, $object, $outputlangs, $hideFreeText); + + $pdf->setPage($i); // in case of _pagefoot or _tableau change it + + // reset page orientation each loop to override it if it was changed by _pagefoot or _tableau change it + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + + // Don't print head on first page ($pageposbeforeprintlines) because already added previously + if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') && $i != $pageposbeforeprintlines) { + $this->_pagehead($pdf, $object, 0, $outputlangs); + } + if (!empty($tplidx)) { + $pdf->useTemplate($tplidx); + } } + // reset text color before print footers + $pdf->SetTextColor(0, 0, 0); + + $pdf->setPage($pdf->getNumPages()); + + $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1; + // Display infos area $posy = $this->drawInfoTable($pdf, $object, $bottomlasttab, $outputlangs); @@ -878,8 +880,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $posy = $this->drawSignatureArea($pdf, $object, $posy, $outputlangs); } - // Pagefoot - $this->_pagefoot($pdf, $object, $outputlangs); + // Add number of pages in footer if (method_exists($pdf, 'AliasNbPages')) { $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod } diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index 8f3e6402b6304..93ebf4f82980e 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -90,7 +90,7 @@ public function info($langs) // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; $mask = !getDolGlobalString('PROPALE_SAPHIR_MASK') ? '' : $conf->global->PROPALE_SAPHIR_MASK; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; diff --git a/htdocs/core/modules/reception/mod_reception_moonstone.php b/htdocs/core/modules/reception/mod_reception_moonstone.php index 3810da99bb171..a482366fc36b8 100644 --- a/htdocs/core/modules/reception/mod_reception_moonstone.php +++ b/htdocs/core/modules/reception/mod_reception_moonstone.php @@ -67,7 +67,7 @@ public function info($langs) $tooltip .= '
'.$langs->trans("GenericMaskCodes5b"); $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).''; $texte .= '  '; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index 566d7bb70f0ba..b01fcafb6db84 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -110,7 +110,7 @@ public function info($langs) // Parametrage du prefix customers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("CustomerCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipelephantcutomer').''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipelephantcutomer').''; $texte .= '  '; @@ -118,7 +118,7 @@ public function info($langs) // Parametrage du prefix suppliers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("SupplierCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipelephantsupplier').''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipelephantsupplier').''; $texte .= ''; // Date of switch to that numbering model diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index 0161aff09d6d8..868488bd4a216 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -87,7 +87,6 @@ public function __construct() */ public function info($langs) { - global $conf; global $form; $langs->load("companies"); @@ -100,8 +99,8 @@ public function info($langs) $texte .= ''; $texte .= ''; $texte .= ''; - $s1 = $form->textwithpicto('', $tooltip, 1, 1); - $s2 = $form->textwithpicto('', $tooltip, 1, 1); + $s1 = $form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); + $s2 = $form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php index 9a2b8aca0b0a1..01b04b0a33857 100644 --- a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php +++ b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php @@ -6,7 +6,8 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2011-2016 Philippe Grand * Copyright (C) 2014 Marcos García - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -25,7 +26,7 @@ /** * \file htdocs/core/modules/supplier_order/modules_commandefournisseur.php - * \ingroup order fournisseur + * \ingroup supplier order * \brief File that contains parent class for supplier orders models * and parent class for supplier orders numbering models */ diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php index 67592bde09a4c..628b7411ebfbf 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php @@ -86,7 +86,7 @@ public function info($langs) // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; @@ -139,7 +139,7 @@ public function getNextValue($objsoc, $object) return 0; } - $numFinal = get_next_value($db, $mask, 'paiementfourn', 'ref', '', $objsoc, $object->datepaye); + $numFinal = get_next_value($db, $mask, 'paiementfourn', 'ref', '', $objsoc, is_object($object) ?$object->datepaye :''); return $numFinal; } diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php index 4eada1d157855..9c83c7d917647 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php @@ -90,7 +90,7 @@ public function info($langs) // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php index 2affafe14ba4e..75768b9f87e11 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php @@ -84,7 +84,7 @@ public function info($langs) // Setting up the prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/ticket/mod_ticket_universal.php b/htdocs/core/modules/ticket/mod_ticket_universal.php index 81b263a931e96..dcac49b041acc 100644 --- a/htdocs/core/modules/ticket/mod_ticket_universal.php +++ b/htdocs/core/modules/ticket/mod_ticket_universal.php @@ -85,7 +85,7 @@ public function info($langs) // Prefix settings $text .= ''; - $text .= ''; + $text .= ''; $text .= ''; diff --git a/htdocs/core/modules/workstation/mod_workstation_advanced.php b/htdocs/core/modules/workstation/mod_workstation_advanced.php index f372547a3958b..c67765e88d814 100644 --- a/htdocs/core/modules/workstation/mod_workstation_advanced.php +++ b/htdocs/core/modules/workstation/mod_workstation_advanced.php @@ -83,7 +83,7 @@ public function info($langs) // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index 317aa2d1fe83e..310ea9b814bf5 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -314,7 +314,10 @@ $extrafields->fetch_name_optionals_label($elementtype); foreach ($extrafields->attributes[$elementtype]['label'] as $key => $val) { if ($key != 'ts_nameextra' && $key != 'ts_payeur') { - print ' 0) $rightpart .= ' fieldrequired'; // No fieldrequired in the view output if ($val['type'] == 'text' || $val['type'] == 'html') { $rightpart .= ' tdtop'; diff --git a/htdocs/core/tpl/extrafields_add.tpl.php b/htdocs/core/tpl/extrafields_add.tpl.php index a4000c2fa4d83..78cd0eaec9489 100644 --- a/htdocs/core/tpl/extrafields_add.tpl.php +++ b/htdocs/core/tpl/extrafields_add.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2014 Juanjo Menent +/* Copyright (C) 2014 Maxime Kohlhaas + * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/core/tpl/extrafields_edit.tpl.php b/htdocs/core/tpl/extrafields_edit.tpl.php index 2a623a3ba84bd..7d72a0cae3bd2 100644 --- a/htdocs/core/tpl/extrafields_edit.tpl.php +++ b/htdocs/core/tpl/extrafields_edit.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2014 Juanjo Menent +/* Copyright (C) 2014 Maxime Kohlhaas + * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 700824e7ae3f4..8d17be75f402a 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -257,7 +257,7 @@ print ''; print ''; print ''; - print $extrafields->showInputField($tmpkeyextra, $value, '', '', '', 0, $object->id, $object->table_element); + print $extrafields->showInputField($tmpkeyextra, $value, '', '', '', 0, $object, $object->table_element); print ''; diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php index 3e6af0c8a20af..d79d844484cb2 100644 --- a/htdocs/core/tpl/list_print_total.tpl.php +++ b/htdocs/core/tpl/list_print_total.tpl.php @@ -23,6 +23,46 @@ */ '@phan-var-force array{nbfield:int,type?:array,pos?:array,val?:array} $totalarray'; +if (!function_exists('printTotalValCell')) { // allow two list with total on same screen + + /** print a total cell value according to its type + * + * @param string $type of field (duration, string..) + * @param string $val the value to display + * + * @return void (direct print) + */ + function printTotalValCell($type, $val) + { + // if $totalarray['type'] not present we consider it as number + if (empty($type)) { + $type = 'real'; + } + switch ($type) { + case 'duration': + print ''; + break; + case 'string': // This type is no more used. type is now varchar(x) + print ''; + break; + case 'stock': + print ''; + break; + default: + print ''; + break; + } + } +} + // Move fields of totalizable into the common array pos and val if (!empty($totalarray['totalizable']) && is_array($totalarray['totalizable'])) { foreach ($totalarray['totalizable'] as $keytotalizable => $valtotalizable) { @@ -107,40 +147,3 @@ } //print ''; } - -/** print a total cell value according to its type - * - * @param string $type of field (duration, string..) - * @param string $val the value to display - * - * @return void (direct print) - */ -function printTotalValCell($type, $val) -{ - // if $totalarray['type'] not present we consider it as number - if (empty($type)) { - $type = 'real'; - } - switch ($type) { - case 'duration': - print ''; - break; - case 'string': // This type is no more used. type is now varchar(x) - print ''; - break; - case 'stock': - print ''; - break; - default: - print ''; - break; - } -} diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 077f7d4aeb1b2..7b9029cf6b819 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -3,6 +3,7 @@ * Copyright (C) 2011-2022 Laurent Destailleur * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Charlene Benke * * 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 @@ -281,11 +282,12 @@
"> +file->main_authentication) || $conf->file->main_authentication != 'googleoauth') { ?>
- + " name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autofocus="autofocus" autocapitalize="off" autocomplete="on" spellcheck="false" autocorrect="off" /> @@ -293,7 +295,6 @@
-file->main_authentication) || $conf->file->main_authentication != 'googleoauth') { ?>
'/core/modules/security/captcha/'), is_array($conf->modules_parts['captcha']) ? $conf->modules_parts['captcha'] : array()); + $dirModCaptcha = array_merge(array('main' => '/core/modules/security/captcha/'), (isset($conf->modules_parts['captcha']) && is_array($conf->modules_parts['captcha'])) ? $conf->modules_parts['captcha'] : array()); $fullpathclassfile = ''; foreach ($dirModCaptcha as $dir) { $fullpathclassfile = dol_buildpath($dir."modCaptcha".ucfirst($captcha).'.class.php', 0, 2); @@ -334,7 +335,7 @@ $classname = "modCaptcha".ucfirst($captcha); if (class_exists($classname)) { /** @var ModeleCaptcha $captchaobj */ - $captchaobj = new $classname($db, $conf, $langs, $user); + $captchaobj = new $classname($db, $conf, $langs, null); '@phan-var-force ModeleCaptcha $captchaobj'; if (is_object($captchaobj) && method_exists($captchaobj, 'getCaptchaCodeForForm')) { diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index b4164ac04c0ca..3cf6e4f82eb9a 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -377,7 +377,7 @@ foreach ($extrafields_list as $extraKey => $extraLabel) { $outputShowOutputFields .= ''; } $outputShowOutputFields .= ''; +//print 'Click'; + print "\n"; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index e50370f4c4502..93bc95c0a1291 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -52,6 +52,8 @@ * @var Translate $langs * @var User $user * + * @var string $action + * @var int $i * @var 0|1 $forceall * @var int $num * @var 0|1 $senderissupplier @@ -312,8 +314,8 @@ $tooltiponpriceend = ''; $tooltiponpriceendmultiprice = ''; if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { - $tooltiponprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht, 0, '', 0, 0); - $tooltiponpricemultiprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->multicurrency_total_ht, 0, '', 0, 0); + $tooltiponprice .= $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht, 0, '', 0, 0); + $tooltiponpricemultiprice .= $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->multicurrency_total_ht, 0, '', 0, 0); $tooltiponprice .= '
'.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_tva, 0, '', 0, 0); $tooltiponpricemultiprice .= '
'.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->multicurrency_total_tva, 0, '', 0, 0); if (is_object($object->thirdparty)) { @@ -347,6 +349,19 @@ $tooltiponprice .= '
'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc, 0, '', 0, 0); $tooltiponpricemultiprice .= '
'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->multicurrency_total_ttc, 0, '', 0, 0); + if (!empty($line->special_code) || $line->product_type == 9) { + $tooltiponprice .= '
'; + $tooltiponpricemultiprice .= '
'; + if (!empty($line->special_code)) { + $tooltiponprice .= '
'.$langs->trans("SpecialLine").' : '.getLabelSpecialCode($line->special_code); + $tooltiponpricemultiprice .= '
'.$langs->trans("SpecialLine").' : '.getLabelSpecialCode($line->special_code); + } + if ($line->product_type == 9) { + $tooltiponprice .= '
'.$langs->trans("SpecialLine").' : '.$langs->trans("GroupingLine"); + $tooltiponpricemultiprice .= '
'.$langs->trans("SpecialLine").' : '.$langs->trans("GroupingLine"); + } + } + $tooltiponprice = ''; $tooltiponpricemultiprice = ''; diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php index 59ef1023b2b0a..3964d67232d3b 100644 --- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -14,7 +14,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - +/** + * @var Conf $conf + * @var Translate $langs + * @var string $servicename + */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 272c21ded9d8e..d01fb3a5f99bf 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -23,7 +23,24 @@ if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', 1); } - +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * + * @var string $action + * @var string $captcha + * @var string $disabled + * @var string $dol_url_root + * @var string $focus_element + * @var string $mode + * @var string $message + * @var string $title + * @var string $urllogo + * @var string $user + * @var string $username + */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; @@ -39,14 +56,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -/** - * @var HookManager $hookmanager - * @var string $action - * @var string $captcha - * @var string $message - * @var string $title - */ - /* * View diff --git a/htdocs/core/tpl/passwordreset.tpl.php b/htdocs/core/tpl/passwordreset.tpl.php index 61a27c6853a86..05a7ccfb7ae44 100644 --- a/htdocs/core/tpl/passwordreset.tpl.php +++ b/htdocs/core/tpl/passwordreset.tpl.php @@ -22,7 +22,29 @@ if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', 1); } - +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * + * @var string $action + * @var string $captcha + * @var string $disabled + * @var string $dol_url_root + * @var string $focus_element + * @var string $mode + * @var string $message + * @var string $newpass1 + * @var string $newpass2 + * @var string $passworduidhash + * @var string $title + * @var string $urllogo + * @var string $user + * @var string $username + * + * @var int $setnewpassword + */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; @@ -30,7 +52,7 @@ } // DDOS protection -$size = (int) $_SERVER['CONTENT_LENGTH']; +$size = (int) ($_SERVER['CONTENT_LENGTH'] ?? 0); if ($size > 10000) { $langs->loadLangs(array("errors", "install")); httponly_accessforbidden('
'.$langs->trans("ErrorRequestTooLarge").'
'.$langs->trans("ClickHereToGoToApp").'
', 413, 1); @@ -38,14 +60,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -/** - * @var HookManager $hookmanager - * @var string $action - * @var string $captcha - * @var string $message - * @var string $title - */ - /* * View diff --git a/htdocs/core/tpl/resource_add.tpl.php b/htdocs/core/tpl/resource_add.tpl.php index 6b67021096bef..3cc89537d5b2e 100644 --- a/htdocs/core/tpl/resource_add.tpl.php +++ b/htdocs/core/tpl/resource_add.tpl.php @@ -1,6 +1,30 @@ + * + * 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 . + */ +/** + * @var Conf $conf + * @var DoliDB $db + * @var Translate $langs + * + * @var string $element + * @var int $element_id + * @var string $element_ref + */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; diff --git a/htdocs/core/tpl/resource_view.tpl.php b/htdocs/core/tpl/resource_view.tpl.php index 42ed0f8139de4..454cc61ded6e2 100644 --- a/htdocs/core/tpl/resource_view.tpl.php +++ b/htdocs/core/tpl/resource_view.tpl.php @@ -1,6 +1,32 @@ +/* Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * + * 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 . + */ + +/** + * @var Conf $conf + * @var DoliDB $db + * @var Translate $langs + * + * @var string $element + * @var int $element_id + * @var string $mode + * @var string $resource_type + * @var array,mandatory:int<0,1>}> $linked_resources */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { diff --git a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php index 87fd49d1f0eeb..d6ed6a6383f77 100644 --- a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php @@ -224,7 +224,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf case 'ORDER_CLASSIFY_BILLED': case 'ORDER_SETDRAFT': case 'LINEORDER_INSERT': - case 'LINEORDER_UPDATE': + case 'LINEORDER_MODIFY': case 'LINEORDER_DELETE': break; // Supplier orders @@ -239,7 +239,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // case 'ORDER_SUPPLIER_RECEIVE': // case 'LINEORDER_SUPPLIER_DISPATCH': // case 'LINEORDER_SUPPLIER_CREATE': - // case 'LINEORDER_SUPPLIER_UPDATE': + // case 'LINEORDER_SUPPLIER_MODIFY': // Proposals // case 'PROPAL_CREATE': @@ -251,7 +251,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // case 'PROPAL_CLOSE_REFUSED': // case 'PROPAL_DELETE': // case 'LINEPROPAL_INSERT': - // case 'LINEPROPAL_UPDATE': + // case 'LINEPROPAL_MODIFY': // case 'LINEPROPAL_DELETE': // SupplierProposal @@ -264,7 +264,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // case 'SUPPLIER_PROPOSAL_CLOSE_REFUSED': // case 'SUPPLIER_PROPOSAL_DELETE': // case 'LINESUPPLIER_PROPOSAL_INSERT': - // case 'LINESUPPLIER_PROPOSAL_UPDATE': + // case 'LINESUPPLIER_PROPOSAL_MODIFY': // case 'LINESUPPLIER_PROPOSAL_DELETE': // Contracts @@ -274,7 +274,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // case 'CONTRACT_CLOSE': // case 'CONTRACT_DELETE': // case 'LINECONTRACT_INSERT': - // case 'LINECONTRACT_UPDATE': + // case 'LINECONTRACT_MODIFY': // case 'LINECONTRACT_DELETE': // Bills @@ -288,19 +288,19 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // case 'BILL_DELETE': // case 'BILL_PAYED': // case 'LINEBILL_INSERT': - // case 'LINEBILL_UPDATE': + // case 'LINEBILL_MODIFY': // case 'LINEBILL_DELETE': //Supplier Bill // case 'BILL_SUPPLIER_CREATE': - // case 'BILL_SUPPLIER_UPDATE': + // case 'BILL_SUPPLIER_MODIFY': // case 'BILL_SUPPLIER_DELETE': // case 'BILL_SUPPLIER_PAYED': // case 'BILL_SUPPLIER_UNPAYED': // case 'BILL_SUPPLIER_VALIDATE': // case 'BILL_SUPPLIER_UNVALIDATE': // case 'LINEBILL_SUPPLIER_CREATE': - // case 'LINEBILL_SUPPLIER_UPDATE': + // case 'LINEBILL_SUPPLIER_MODIFY': // case 'LINEBILL_SUPPLIER_DELETE': // Payments @@ -316,7 +316,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // Donation // case 'DON_CREATE': - // case 'DON_UPDATE': + // case 'DON_MODIFY': // case 'DON_DELETE': // Interventions @@ -325,7 +325,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf // case 'FICHINTER_VALIDATE': // case 'FICHINTER_DELETE': // case 'LINEFICHINTER_CREATE': - // case 'LINEFICHINTER_UPDATE': + // case 'LINEFICHINTER_MODIFY': // case 'LINEFICHINTER_DELETE': // Members diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index f7bb85395c8b1..b814567f71002 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1223,7 +1223,7 @@ public function run_jobs(string $userlogin) dol_syslog(get_class($this)."::run_jobs jobtype=".$this->jobtype." userlogin=".$userlogin, LOG_DEBUG); // Increase limit of time. Works only if we are not in safe mode - $ExecTimeLimit = 600; + $ExecTimeLimit = getDolGlobalInt('MAIN_CRON_EXEC_TIME_LIMIT', 600); if (!empty($ExecTimeLimit)) { $err = error_reporting(); error_reporting(0); // Disable all errors @@ -1231,7 +1231,7 @@ public function run_jobs(string $userlogin) @set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64 error_reporting($err); } - $MemoryLimit = 0; + $MemoryLimit = getDolGlobalString('MAIN_CRON_MEMORY_LIMIT'); if (!empty($MemoryLimit)) { @ini_set('memory_limit', $MemoryLimit); } diff --git a/htdocs/debugbar/class/TraceableDB.php b/htdocs/debugbar/class/TraceableDB.php index ff200c8b44e89..9211e8e5faeea 100644 --- a/htdocs/debugbar/class/TraceableDB.php +++ b/htdocs/debugbar/class/TraceableDB.php @@ -496,7 +496,7 @@ public function errno() * Create a table into database * * @param string $table Name of table - * @param array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> $fields Associative table [field name][table of descriptions] + * @param array|string,position:int,notnull?:int,visible:int<-2,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>}> $fields Associative table [field name][table of descriptions] * @param string $primary_key Nom du champ qui sera la clef primaire * @param string $type Type de la table * @param ?array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur diff --git a/htdocs/document.php b/htdocs/document.php index 9b440a30e068a..067eac0d7bbed 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -5,8 +5,8 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010 Pierre Morin * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2022 Ferran Marcet - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2022 Ferran Marcet + * Copyright (C) 2024 Frédéric France * * 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 @@ -102,9 +102,12 @@ function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disab * Footer empty * * @ignore + * @param string $comment A text to add as HTML comment into HTML generated page + * @param string $zone 'private' (for private pages) or 'public' (for public pages) + * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter() +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) { } @@ -126,7 +129,7 @@ function llxFooter() $hashp = GETPOST('hashp', 'aZ09'); $modulepart = GETPOST('modulepart', 'alpha'); $urlsource = GETPOST('urlsource', 'alpha'); -$entity = GETPOSTINT('entity', $conf->entity); +$entity = GETPOSTINT('entity'); // Security check if (empty($modulepart) && empty($hashp)) { diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 1038cdb68d289..3f6e19412e747 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -140,8 +140,6 @@ // Action reopen object if ($action == 'confirm_reopen' && $confirm == 'yes' && $permissiontoadd) { - $object->fetch($id); - $result = $object->reopen($user); if ($result >= 0) { // Define output language @@ -149,7 +147,7 @@ if (method_exists($object, 'generateDocument')) { $outputlangs = $langs; $newlang = ''; - if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (getDolGlobalInt('MAIN_MULTILANGS') && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { @@ -161,7 +159,9 @@ } $model = $object->model_pdf; $ret = $object->fetch($id); // Reload to get new records - + $hidedetails = 0; + $hidedesc = 0; + $hideref = 0; $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } @@ -289,7 +289,6 @@ // Action delete object if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $permissiontodelete) { - $object->fetch($id); $result = $object->delete($user); if ($result > 0) { header("Location: index.php"); @@ -302,7 +301,6 @@ // Action validation if ($action == 'valid_promesse' && $permissiontoadd) { - $object->fetch($id); // @phan-suppress-next-line PhanPluginSuspiciousParamPosition if ($object->valid_promesse($id, $user->id) >= 0) { setEventMessages($langs->trans("DonationValidated", $object->ref), null); @@ -314,7 +312,6 @@ // Action cancel if ($action == 'set_cancel' && $permissiontoadd) { - $object->fetch($id); if ($object->set_cancel($id) >= 0) { $action = ''; } else { @@ -325,21 +322,16 @@ // Action set paid if ($action == 'set_paid' && $permissiontoadd) { $modepayment = GETPOSTINT('modepayment'); - - $object->fetch($id); if ($object->setPaid($id, $modepayment) >= 0) { $action = ''; } else { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'classin' && $user->hasRight('don', 'creer')) { - $object->fetch($id); $object->setProject($projectid); } if ($action == 'update_extras' && $permissiontoadd) { - $object->fetch($id); - $object->oldcopy = dol_clone($object, 2); // Fill array 'array_options' with data from update form @@ -405,7 +397,7 @@ // Company if (isModEnabled("societe") && getDolGlobalString('DONATION_USE_THIRDPARTIES')) { // Thirdparty - if ($soc->id > 0) { + if (!empty($soc) && $soc->id > 0) { print '
'; print ''; print '"; - //} if (isModEnabled('category')) { // Categories @@ -1771,6 +1772,7 @@ print ''; print '
'; // trans remove html entities $texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, '{s2}')."
\n"; diff --git a/htdocs/core/modules/societe/mod_codecompta_digitaria.php b/htdocs/core/modules/societe/mod_codecompta_digitaria.php index 28686db0ed699..857cb2d9521f5 100644 --- a/htdocs/core/modules/societe/mod_codecompta_digitaria.php +++ b/htdocs/core/modules/societe/mod_codecompta_digitaria.php @@ -112,10 +112,10 @@ public function info($langs) $texte .= ''; $texte .= ''; $texte .= ''; - $s1 = $form->textwithpicto('', $tooltip, 1, 1); - $s2 = $form->textwithpicto('', $tooltip, 1, 1); - $s3 = $form->textwithpicto('', $tooltip, 1, 1); - $s4 = $form->textwithpicto('', $tooltip, 1, 1); + $s1 = $form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); + $s2 = $form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); + $s3 = $form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); + $s4 = $form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name); $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index ed15e0e7351c9..bafa84d20c880 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -99,7 +99,7 @@ public function info($langs) // Setting the prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; @@ -107,19 +107,19 @@ public function info($langs) // Prefix setting of credit note $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; if (!getDolGlobalString('INVOICE_DISABLE_REPLACEMENT') && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { // Prefix setting of replacement $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; } // Prefix setting of deposit $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= '
'; // trans remove html entities $texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, '{s2}', '{s4}')."
\n"; diff --git a/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php b/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php index 6238778766891..0bc819da50b26 100644 --- a/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php +++ b/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php @@ -83,7 +83,7 @@ public function info($langs) // Parametrage du prefix $texte .= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").')'; $texte .= ':'.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipstandardtulip').''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipstandardtulip').' 
'.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipcredittuplie').''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipcredittuplie').'
'.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipreplacementtulip').''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipreplacementtulip').'
'.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):'.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltipdownpaymenttulip').''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltipdownpaymenttulip').'
'; diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php index 350e22302ea7f..707b64505d63d 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php @@ -91,7 +91,7 @@ public function info($langs) // Parametrage du prefix $texte .= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1, '', 0, 3, 'tooltiporchidee').''.$form->textwithpicto('', $tooltip, 1, 'help', '', 0, 3, 'tooltiporchidee').' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).'
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'.$extrafields->attributes[$elementtype]['label'][$key]; + if (isset($extrafields->attributes[$elementtype]['langfile'][$key])) { + $langs->load($extrafields->attributes[$elementtype]['langfile'][$key]); + } + print '
'.$langs->trans($extrafields->attributes[$elementtype]['label'][$key]); if (!empty($array_query['options_'.$key]) || (is_array($array_query['options_'.$key]) && count($array_query['options_'.$key]) > 0)) { print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); } @@ -330,9 +333,9 @@ } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') || ($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) { print ''; print '
'.$langs->trans("AdvTgtStartDt").''; - print $form->selectDate('', 'options_'.$key.'_st_dt'); + print $form->selectDate('', 'options_'.$key.'_st_dt', 0, 0, 1); print ''.$langs->trans("AdvTgtEndDt").''; - print $form->selectDate('', 'options_'.$key.'_end_dt'); + print $form->selectDate('', 'options_'.$key.'_end_dt', 0, 0, 1); print '
'; print '
'."\n"; @@ -348,19 +351,19 @@ $array_query['options_'.$key] ); print ''."\n"; - } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'select')) { - print $formadvtargetemaling->advMultiselectarray('options_'.$key, $extrafields->attributes[$key]['param']['options'], $array_query['options_'.$key]); + } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'select') { + print $formadvtargetemaling->advMultiselectarray('options_'.$key, $extrafields->attributes[$elementtype]['param'][$key]['options'], $array_query['options_'.$key]); print ''."\n"; - } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'sellist')) { - print $formadvtargetemaling->advMultiselectarraySelllist('options_'.$key, $extrafields->attributes[$key]['param']['options'], $array_query['options_'.$key]); + } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'sellist') { + print $formadvtargetemaling->advMultiselectarraySelllist('options_'.$key, $extrafields->attributes[$elementtype]['param'][$key]['options'], $array_query['options_'.$key]); print ''."\n"; } else { print ''; print '
'; if (is_array($array_query['options_'.$key])) { - print $extrafields->showInputField($key, implode(',', $array_query['options_'.$key])); + print $extrafields->showInputField($key, implode(',', $array_query['options_'.$key]), '', '', '', '', 0, 'societe', 1); } else { - print $extrafields->showInputField($key, $array_query['options_'.$key]); + print $extrafields->showInputField($key, $array_query['options_'.$key], '', '', '', '', 0, 'societe', 1); } print '
'; @@ -529,9 +532,9 @@ } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') || ($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) { print ''; print '
'.$langs->trans("AdvTgtStartDt").''; - print $form->selectDate('', 'options_'.$key.'_st_dt_cnct'); + print $form->selectDate('', 'options_'.$key.'_st_dt_cnct', 0, 0, 1); print ''.$langs->trans("AdvTgtEndDt").''; - print $form->selectDate('', 'options_'.$key.'_end_dt_cnct'); + print $form->selectDate('', 'options_'.$key.'_end_dt_cnct', 0, 0, 1); print '
'; print '
'."\n"; print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); @@ -546,17 +549,17 @@ $array_query['options_'.$key.'_cnct'] ); print ''."\n"; - } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'select')) { - print $formadvtargetemaling->advMultiselectarray('options_'.$key.'_cnct', $extrafields->attributes[$key]['param']['options'], $array_query['options_'.$key.'_cnct']); + } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'select') { + print $formadvtargetemaling->advMultiselectarray('options_'.$key.'_cnct', $extrafields->attributes[$elementtype]['param'][$key]['options'], $array_query['options_'.$key.'_cnct']); print ''."\n"; - } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'sellist')) { - print $formadvtargetemaling->advMultiselectarraySelllist('options_'.$key.'_cnct', $extrafields->attributes[$key]['param']['options'], $array_query['options_'.$key.'_cnct']); + } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'sellist') { + print $formadvtargetemaling->advMultiselectarraySelllist('options_'.$key.'_cnct', $extrafields->attributes[$elementtype]['param'][$key]['options'], $array_query['options_'.$key.'_cnct']); print ''."\n"; } else { if (is_array($array_query['options_'.$key.'_cnct'])) { - print $extrafields->showInputField($key, implode(',', $array_query['options_'.$key.'_cnct']), '', '_cnct'); + print $extrafields->showInputField($key, implode(',', $array_query['options_'.$key.'_cnct']), '', '_cnct', '', '', 0, 'socpeople', 1); } else { - print $extrafields->showInputField($key, $array_query['options_'.$key.'_cnct'], '', '_cnct'); + print $extrafields->showInputField($key, $array_query['options_'.$key.'_cnct'], '', '_cnct', '', '', 0, 'socpeople', 1); } print ''."\n"; } diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index 4ab671306ff79..b96eaafb67b7f 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -161,7 +161,7 @@ $value = $object->$key; $rightpart .= '
'; + print(!empty($val) ? convertSecondToTime((int) $val, 'allhourmin') : 0); + print ''; + print(!empty($val) ? $val : ''); + print ''; + print price2num(!empty($val) ? $val : 0, 'MS'); + print ''; + print price(!empty($val) ? $val : 0); + print ''; - print(!empty($val) ? convertSecondToTime((int) $val, 'allhourmin') : 0); - print ''; - print(!empty($val) ? $val : ''); - print ''; - print price2num(!empty($val) ? $val : 0, 'MS'); - print ''; - print price(!empty($val) ? $val : 0); - print ''.$langs->trans('ThirdParty').''; print $soc->getNomUrl(1); @@ -427,7 +419,7 @@ print ''.$langs->trans('ThirdParty').''; $filter = '((s.client:IN:1,2,3) AND (status:=:1))'; - print $form->select_company($soc->id, 'socid', $filter, 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + print $form->select_company('', 'socid', $filter, 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); // Option to reload page to retrieve customer information. Note, this clear other input if (getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) { print ''; + print ' + + '; } print '

'; diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 15ed29f8d9f38..cd942116585f8 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -1,7 +1,8 @@ - * Copyright (C) 2011-2012 Regis Houssin - * Copyright (C) 2024 MDW +/* Copyright (C) 2008-2012 Laurent Destailleur + * Copyright (C) 2011-2012 Regis Houssin + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -467,22 +468,10 @@ function hash_call($methodName, $nvpStr) } // Clean parameters - $PAYPAL_API_USER = ""; - if (getDolGlobalString('PAYPAL_API_USER')) { - $PAYPAL_API_USER = getDolGlobalString('PAYPAL_API_USER'); - } - $PAYPAL_API_PASSWORD = ""; - if (getDolGlobalString('PAYPAL_API_PASSWORD')) { - $PAYPAL_API_PASSWORD = getDolGlobalString('PAYPAL_API_PASSWORD'); - } - $PAYPAL_API_SIGNATURE = ""; - if (getDolGlobalString('PAYPAL_API_SIGNATURE')) { - $PAYPAL_API_SIGNATURE = getDolGlobalString('PAYPAL_API_SIGNATURE'); - } - $PAYPAL_API_SANDBOX = ""; - if (getDolGlobalString('PAYPAL_API_SANDBOX')) { - $PAYPAL_API_SANDBOX = getDolGlobalString('PAYPAL_API_SANDBOX'); - } + $PAYPAL_API_USER = getDolGlobalString('PAYPAL_API_USER'); + $PAYPAL_API_PASSWORD = getDolGlobalString('PAYPAL_API_PASSWORD'); + $PAYPAL_API_SIGNATURE = getDolGlobalString('PAYPAL_API_SIGNATURE'); + $PAYPAL_API_SANDBOX = getDolGlobalString('PAYPAL_API_SANDBOX'); // TODO END problem with triggers dol_syslog("Paypal API endpoint ".$API_Endpoint); @@ -514,8 +503,8 @@ function hash_call($methodName, $nvpStr) curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, ($ssl_verifypeer ? true : false)); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, ($ssl_verifypeer ? true : false)); - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, !getDolGlobalString('MAIN_USE_CONNECT_TIMEOUT') ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT); - curl_setopt($ch, CURLOPT_TIMEOUT, !getDolGlobalString('MAIN_USE_RESPONSE_TIMEOUT') ? 30 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, getDolGlobalInt('MAIN_USE_CONNECT_TIMEOUT', 5)); + curl_setopt($ch, CURLOPT_TIMEOUT, getDolGlobalInt('MAIN_USE_RESPONSE_TIMEOUT', 30)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); diff --git a/htdocs/paypal/lib/paypalfunctions.lib.php b/htdocs/paypal/lib/paypalfunctions.lib.php index b3a714489a28f..eba524caab4e5 100644 --- a/htdocs/paypal/lib/paypalfunctions.lib.php +++ b/htdocs/paypal/lib/paypalfunctions.lib.php @@ -1,7 +1,8 @@ - * Copyright (C) 2011 Regis Houssin - * Copyright (C) 2024 MDW +/* Copyright (C) 2010-2011 Laurent Destailleur + * Copyright (C) 2011 Regis Houssin + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -57,22 +58,10 @@ } // Clean parameters -$PAYPAL_API_USER = ""; -if (getDolGlobalString('PAYPAL_API_USER')) { - $PAYPAL_API_USER = getDolGlobalString('PAYPAL_API_USER'); -} -$PAYPAL_API_PASSWORD = ""; -if (getDolGlobalString('PAYPAL_API_PASSWORD')) { - $PAYPAL_API_PASSWORD = getDolGlobalString('PAYPAL_API_PASSWORD'); -} -$PAYPAL_API_SIGNATURE = ""; -if (getDolGlobalString('PAYPAL_API_SIGNATURE')) { - $PAYPAL_API_SIGNATURE = getDolGlobalString('PAYPAL_API_SIGNATURE'); -} -$PAYPAL_API_SANDBOX = ""; -if (getDolGlobalString('PAYPAL_API_SANDBOX')) { - $PAYPAL_API_SANDBOX = getDolGlobalString('PAYPAL_API_SANDBOX'); -} +$PAYPAL_API_USER = getDolGlobalString('PAYPAL_API_USER'); +$PAYPAL_API_PASSWORD = getDolGlobalString('PAYPAL_API_PASSWORD'); +$PAYPAL_API_SIGNATURE = getDolGlobalString('PAYPAL_API_SIGNATURE'); +$PAYPAL_API_SANDBOX = getDolGlobalString('PAYPAL_API_SANDBOX'); // Proxy $PROXY_HOST = getDolGlobalString('MAIN_PROXY_HOST'); diff --git a/htdocs/product/canvas/product/tpl/card_create.tpl.php b/htdocs/product/canvas/product/tpl/card_create.tpl.php index 5e4621b24c1a7..1f750f1108a48 100644 --- a/htdocs/product/canvas/product/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_create.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2010-2018 Regis Houssin + * Copyright (C) 2024 Frédéric France * * 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 @@ -16,10 +16,14 @@ * along with this program. If not, see . */ /** + * @var Canvas $this * @var Conf $conf * @var Form $form * @var Translate $langs * @var User $user + * + * @var string $canvas + * @var int $refalreadyexists */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { diff --git a/htdocs/product/canvas/product/tpl/card_edit.tpl.php b/htdocs/product/canvas/product/tpl/card_edit.tpl.php index b6a95262e0dd0..1248221093495 100644 --- a/htdocs/product/canvas/product/tpl/card_edit.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_edit.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2018 Regis Houssin * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/product/canvas/product/tpl/card_view.tpl.php b/htdocs/product/canvas/product/tpl/card_view.tpl.php index 3cf61f55d2fc1..e7b26f58762ec 100644 --- a/htdocs/product/canvas/product/tpl/card_view.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_view.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2018 Regis Houssin * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/product/canvas/service/tpl/card_create.tpl.php b/htdocs/product/canvas/service/tpl/card_create.tpl.php index 875b790e68841..6266cdbda478e 100644 --- a/htdocs/product/canvas/service/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_create.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2018 Regis Houssin * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -16,10 +16,14 @@ * along with this program. If not, see . */ /** + * @var Canvas $this * @var Conf $conf * @var Form $form * @var Translate $langs * @var User $user + * + * @var string $canvas + * @var int $refalreadyexists */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { diff --git a/htdocs/product/canvas/service/tpl/card_edit.tpl.php b/htdocs/product/canvas/service/tpl/card_edit.tpl.php index eb40955a2009e..a95415aac722d 100644 --- a/htdocs/product/canvas/service/tpl/card_edit.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_edit.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2018 Regis Houssin * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/product/canvas/service/tpl/card_view.tpl.php b/htdocs/product/canvas/service/tpl/card_view.tpl.php index 2b48f913b0e88..b5fd7372b3989 100644 --- a/htdocs/product/canvas/service/tpl/card_view.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_view.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2018 Regis Houssin * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 2c85b6b141ae1..38976910f295b 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1619,12 +1619,14 @@ if ($type == 1) { print '
'.$langs->trans("Duration").''; print img_picto('', 'clock', 'class="pictofixedwidth"'); - print ''; + print ''; print $formproduct->selectMeasuringUnits("duration_unit", "time", (GETPOSTISSET('duration_unit') ? GETPOST('duration_unit', 'alpha') : 'h'), 0, 1); // Mandatory period - print '       '; - print 'mandatory_period == 1 ? ' checked="checked"' : '').'>'; + if ($object->duration_value > 0) { + print '     '; + } + print 'mandatory_period == 1 ? ' checked="checked"' : '').'>'; print '
'.$langs->trans("VATRate").''; $defaultva = get_default_tva($mysoc, $mysoc); print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1); + print ajax_combobox("tva_tx"); print '
'; @@ -1783,6 +1785,7 @@ print ''.$langs->trans("SellingPrice").''; print ''; print $form->selectPriceBaseType(getDolGlobalString('PRODUCT_PRICE_BASE_TYPE'), "price_base_type"); + print ajax_combobox("select_price_base_type"); print ''; // Min price @@ -1794,6 +1797,7 @@ print ''.$langs->trans("VATRate").''; $defaultva = get_default_tva($mysoc, $mysoc); print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1); + print ajax_combobox("tva_tx"); print ''; print ''; @@ -2242,12 +2246,14 @@ if ($object->isService()) { // Duration print ''.$langs->trans("Duration").''; - print ' '; + print ' '; print $formproduct->selectMeasuringUnits("duration_unit", "time", $object->duration_unit, 0, 1); // Mandatory period - print '       '; - print 'mandatory_period == 1 ? ' checked="checked"' : '').'>'; + if ($object->duration_value > 0) { + print '     '; + } + print 'mandatory_period == 1 ? ' checked="checked"' : '').'>'; print '