diff --git a/.github/changed-lines-count-labeler.yml b/.github/changed-lines-count-labeler.yml new file mode 100644 index 00000000000..39e663821fb --- /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 00000000000..4524d02815b --- /dev/null +++ b/.github/workflows/pr-18-autolabel.yaml @@ -0,0 +1,20 @@ +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 diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index b8b18169b58..67075183b60 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -1,3 +1,4 @@ +name: Set reviewer for v18 on: pull_request: types: [opened, synchronize, reopened] @@ -7,15 +8,13 @@ on: branches: - "18.0" -permissions: write-all - jobs: - run: + pr18: runs-on: ubuntu-latest - env: - # GH_TOKEN: ${{ secrets.GH_TOKEN }} - GH_TOKEN: ${{ github.token }} + #env: + # GH_TOKEN: ${{ github.token }} + # GH_TOKENS: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout repository @@ -26,20 +25,31 @@ jobs: sudo apt update sudo apt install gh -y - #- name: Authenticate GitHub CLI - # run: | - # echo "GH_TOKEN=$GH_TOKEN" - # gh auth login --with-token <<< "$GH_TOKEN" - - 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 "GH_TOKEN=$GH_TOKEN" + 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 index cf263dd0b57..dc0bfbdf63c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,3 +1,4 @@ +name: Test github actions on: workflow_dispatch: pull_request: @@ -5,7 +6,13 @@ on: branches: - "18.0" -permissions: write-all +env: + ENVGHT: ${{ secrets.GITHUB_TOKEN }} + ENVGHU: ${{ github.token }} + VARAAA: ${{ vars.AAA }} + SECBBB: ${{ secrets.BBB }} + VARREPORGCCC: ${{ vars.CCC }} + ENVFIX: "abc" jobs: testjob: @@ -13,7 +20,19 @@ jobs: 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 830429de679..0a6e4cf6655 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/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 121bb4c5ca8..b436d3ce5d3 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -882,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 @@ -1638,24 +1584,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 @@ -1686,30 +1614,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 @@ -2460,12 +2364,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 @@ -2910,12 +2808,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 @@ -3036,30 +2928,6 @@ parameters: 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 @@ -3072,24 +2940,6 @@ parameters: 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 @@ -3138,36 +2988,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 @@ -3192,18 +3012,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 @@ -3432,12 +3240,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 @@ -4740,12 +4542,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 @@ -5388,12 +5184,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 @@ -5598,42 +5388,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 @@ -6177,7 +5937,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 - @@ -8742,24 +8502,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 @@ -8868,12 +8616,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 @@ -8970,12 +8712,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 @@ -9012,12 +8748,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 @@ -9036,12 +8766,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 @@ -9060,30 +8784,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 @@ -9096,12 +8796,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 @@ -9210,24 +8904,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 @@ -9804,24 +9486,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 @@ -10368,12 +10032,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 @@ -11712,12 +11370,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 @@ -18402,12 +18054,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 @@ -18432,18 +18078,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 @@ -18492,12 +18126,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 @@ -18696,12 +18324,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 @@ -18768,12 +18390,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 @@ -21330,102 +20946,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 @@ -21549,42 +21075,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 @@ -21858,12 +21348,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 @@ -24360,12 +23844,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 @@ -24426,12 +23904,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 @@ -24492,12 +23964,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 @@ -25392,12 +24858,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 @@ -25932,12 +25392,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 @@ -26814,12 +26268,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 @@ -27756,12 +27204,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 @@ -27912,12 +27354,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 @@ -28758,12 +28194,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 @@ -28774,78 +28204,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 - @@ -28872,30 +28230,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 @@ -28920,18 +28254,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 @@ -29022,12 +28344,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 @@ -29046,12 +28362,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 @@ -29070,42 +28380,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 @@ -30612,12 +29886,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 @@ -30696,12 +29964,6 @@ parameters: 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 @@ -31878,12 +31140,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 @@ -31914,12 +31170,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 @@ -32670,18 +31920,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 @@ -32976,12 +32214,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 @@ -34272,12 +33504,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 @@ -34338,12 +33564,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 @@ -34512,12 +33732,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 @@ -34770,12 +33984,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 @@ -34878,30 +34086,6 @@ 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 @@ -34956,84 +34140,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/tools/codespell/codespell-lines-ignore.txt b/dev/tools/codespell/codespell-lines-ignore.txt index f013fa5ede5..b7cfa4033c0 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 ''.dol_print_date($db->jdate($obj->periode), 'day').''; + print ''.dol_print_date($db->jdate($obj->period), 'day').''; "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 ''; -$var=true; - print ''; print ''; print ''."\n"; @@ -153,8 +152,7 @@ print ''."\n"; print "\n"; // MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM -$var = !$var; -print '' . "\n"; +print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; print ''."\n"; print ''."\n"; print '' . "\n"; print ''."\n"; print ''."\n"; print '\n\n"; $found++; if (isModEnabled("reception")) { - print ''; + print ''; print ''; print ''; print '\n\n"; $found++; - + print ''; print ''; print ''; 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 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // 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 9292c9b2621..ed592c8ff91 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager + * @var Societe $mysoc * @var Translate $langs * @var User $user */ @@ -188,8 +189,24 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $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 fe3d40c3f32..b6fa70ade31 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 @@ class BOM extends CommonObject */ 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 f4491209758..92328b09fcd 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 704a16507cf..9670bef4fad 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -112,7 +112,7 @@ if ($nolinesbefore) { // Service and workstations are active if ($filtertype == 1 && isModEnabled('workstation')) { - print ''; + print ''; } // Cost print ''; diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 9addf407186..1c2c615a138 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -37,6 +37,8 @@ /** * @var Conf $conf + * @var CommonObject $this + * @var CommonObject $object * @var CommonObjectLine $line * @var Translate $langs * @var User $user diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index ddaa5d99b74..6cccf182dad 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 @@ if ($id > 0 || !empty($ref)) { $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 96f32655b77..bcd852ee5e6 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 @@ $extrafields->fetch_name_optionals_label($object->table_element); // 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 d0741f9b154..1abdde9a496 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 @@ if ($id > 0 || !empty($ref)) { $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 fdf3a402e74..b11f001251b 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 @@ if ($id > 0 || !empty($ref)) { $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 c7e69ff0165..1c5b7c78424 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 d88e7a46fba..a1acf818ba9 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 1483c1b7790..09e0cb52c47 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 211e2d1f7b4..725e43717cd 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -526,7 +526,7 @@ if ($type == Categorie::TYPE_PRODUCT) { $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 @@ if ($type == Categorie::TYPE_CUSTOMER) { $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 @@ if ($type == Categorie::TYPE_SUPPLIER) { $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 @@ if ($type == Categorie::TYPE_MEMBER) { $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 @@ if ($type == Categorie::TYPE_CONTACT) { $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 @@ if ($type == Categorie::TYPE_USER) { 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/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index 58f8c7e223a..a1d248df806 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/htdocs/comm/action/class/actioncommreminder.class.php @@ -71,7 +71,7 @@ class ActionCommReminder 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",), diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index d5d99d1c8da..ce1ef8fbcce 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -915,7 +915,7 @@ if ($object->fetch($id) >= 0) { // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; // Date sent print ''; @@ -999,11 +999,11 @@ if ($object->fetch($id) >= 0) { // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; @@ -819,12 +820,12 @@ while ($i < $imaxinloop) { // Bank account if ($arrayfields['bank']['checked']) { print ''; if (!$i) { diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index c8f65f77e15..5e67c50fb15 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -105,7 +105,10 @@ $pagenext = $page + 1; $object = new FactureRec($db); if (($id > 0 || $ref) && $action != 'create' && $action != 'add') { $ret = $object->fetch($id, $ref); - if (!$ret) { + if ($ret < 0) { + dol_print_error($db, $object->error, $object->errors); + exit; + } elseif (! $ret) { setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors'); } } @@ -1424,14 +1427,10 @@ if ($action == 'create') { } print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("MainAuthenticationOidcLoginClaimName").''.$langs->trans("MainAuthenticationOidcLoginClaimDesc").'' . "\n"; @@ -162,8 +160,7 @@ print '' . "\n"; +print '
'.$langs->trans("MainAuthenticationOidcClientIdName").''.$langs->trans("MainAuthenticationOidcClientIdDesc").'' . "\n"; @@ -171,8 +168,7 @@ print '' . "\n"; +print '
'.$langs->trans("MainAuthenticationOidcClientSecretName").''.$langs->trans("MainAuthenticationOidcClientSecretDesc").'' . "\n"; @@ -180,8 +176,7 @@ print '' . "\n"; +print '
'.$langs->trans("MainAuthenticationOidcScopesName").''.$langs->trans("MainAuthenticationOidcScopesDesc").'' . "\n"; @@ -189,8 +184,7 @@ print '' . "\n"; +print '
'.$langs->trans("MainAuthenticationOidcAuthorizeUrlName").''.$langs->trans("MainAuthenticationOidcAuthorizeUrlDesc").'' . "\n"; @@ -198,8 +192,7 @@ print '' . "\n"; +print '
'.$langs->trans("MainAuthenticationOidcTokenUrlName").''.$langs->trans("MainAuthenticationOidcTokenUrlDesc").'' . "\n"; @@ -207,8 +200,7 @@ print '' . "\n"; +print '
'.$langs->trans("MainAuthenticationOidcUserinfoUrlName").''.$langs->trans("MainAuthenticationOidcUserinfoUrlDesc").'' . "\n"; @@ -216,8 +208,7 @@ print '' . "\n"; +print '
'.$langs->trans("MainAuthenticationOidcLogoutUrlName").''.$langs->trans("MainAuthenticationOidcLogoutUrlDesc").'' . "\n"; @@ -225,8 +216,7 @@ print '' . "\n"; +print '
'.$langs->trans("MainAuthenticationOidcRedirectUrlName").''.$langs->trans("MainAuthenticationOidcRedirectUrlDesc").'' . "\n"; @@ -234,8 +224,7 @@ print '' . "\n"; +print '
'.$langs->trans("MainAuthenticationOidcLogoutRedirectUrlName").''.$langs->trans("MainAuthenticationOidcLogoutRedirectUrlDesc").'' . "\n"; @@ -256,3 +245,4 @@ print '
'; print dol_get_fiche_end(); llxFooter(); +$db->close(); diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 017194f70c4..433d7a325fd 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -76,6 +76,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { $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 (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { 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'); } } diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index dbfb0e7a8e9..ad815dc5bc8 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 @@ if ($action == 'send' && !$cancel) { } $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 258fd52e511..7e87218c977 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -371,7 +371,7 @@ print "
'.$langs->trans("StockOnReception").''; @@ -386,7 +386,7 @@ if (isModEnabled("reception")) { print "
'.$langs->trans("StockOnReceptionOnClosing").''; diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 6454ef43b84..9dc62995ffc 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,), ); /** @@ -1114,7 +1114,7 @@ class Asset extends CommonObject } 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 4b325efc02f..33bbb0f28cb 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,), diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index 1f2442e2418..753b89a4a35 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/bom/bom_card.php b/htdocs/bom/bom_card.php index b72904ad0f3..7d1ffa9e609 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -425,10 +425,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $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 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $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 ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea 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 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // 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'), '') . ''; + print ''; print ''; if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined $selected = 0; @@ -926,7 +926,7 @@ if ($object->fetch($id) >= 0) { } if ($obj->status == $object::STATUS_DRAFT) { // Not sent yet if ($user->hasRight('mailing', 'creer')) { - print ''.img_delete($langs->trans("RemoveRecipient")).''; + print ''.img_delete($langs->trans("RemoveRecipient")).''; } } /*if ($obj->status == -1) // Sent with error @@ -977,14 +977,14 @@ if ($object->fetch($id) >= 0) { // Date last update print ''; - print dol_print_date(dol_stringtotime($obj->tms), 'dayhour'); + print dol_print_date($db->jdate($obj->tms), 'dayhour', 'tzuserrel'); print ''; if ($obj->status != $object::STATUS_DRAFT) { // If status of target line is not draft // Date sent - print $obj->date_envoi; // @TODO Must store date in date format + print dol_print_date($db->jdate($obj->date_envoi), 'dayhour', 'tzuserrel'); // @TODO Must store date in date format } print ''; + print ''; print ''; if ($obj->status == $object::STATUS_DRAFT) { // If status of target line is not sent yet if ($user->hasRight('mailing', 'creer')) { - print ''.img_delete($langs->trans("RemoveRecipient")).''; + print ''.img_delete($langs->trans("RemoveRecipient")).''; } } /*if ($obj->status == -1) // Sent with error diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index 8061c973877..c30b2929ec1 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -323,7 +323,7 @@ class FormAdvTargetEmailing extends Form } } if (!empty($InfoFieldList[1])) { - $sql .= " ORDER BY nom"; + $sql .= $this->db->order($InfoFieldList[1]); } // $sql.= ' WHERE entity = '.$conf->entity; @@ -334,8 +334,10 @@ class FormAdvTargetEmailing extends Form if ($num) { while ($i < $num) { $obj = $this->db->fetch_object($resql); + $fieldtoread = $InfoFieldList[1]; $labeltoshow = dol_trunc($obj->$fieldtoread, 90); + $options_array[$obj->rowid] = $labeltoshow; $i++; } @@ -401,6 +403,20 @@ class FormAdvTargetEmailing extends Form global $conf, $langs; $form = new Form($this->db); + foreach ($options_array as $okey => $val) { + if ((string) $okey == '') { + continue; + } + + $valarray = explode('|', $val); + $val = $valarray[0]; + + if ($val) { + $options_array[$okey] = $langs->trans($val); + } else { + $options_array[$okey] = $val; + } + } $return = $form->multiselectarray($htmlname, $options_array, $selected_array, 0, 0, '', 0, 295); return $return; } diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 10b01316bf0..f2ca321604a 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -971,9 +971,10 @@ if (empty($reshook)) { // Define date start and date end for all line $alldate_start = dol_mktime(GETPOSTINT('alldate_starthour'), GETPOSTINT('alldate_startmin'), 0, GETPOSTINT('alldate_startmonth'), GETPOSTINT('alldate_startday'), GETPOSTINT('alldate_startyear')); $alldate_end = dol_mktime(GETPOSTINT('alldate_endhour'), GETPOSTINT('alldate_endmin'), 0, GETPOSTINT('alldate_endmonth'), GETPOSTINT('alldate_endday'), GETPOSTINT('alldate_endyear')); - foreach ($object->lines as $line) { + foreach ($object->lines as $key => $line) { if ($line->product_type == 1) { // only service line $result = $object->updateline($line->id, $line->subprice, $line->qty, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $alldate_start, $alldate_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); + $object->lines[$key] = $object->line; } } } elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha') !== '' && $usercancreate) { @@ -982,24 +983,26 @@ if (empty($reshook)) { $vat_rate = str_replace('*', '', $vat_rate); $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty, $mysoc); $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty, $mysoc); - foreach ($object->lines as $line) { + foreach ($object->lines as $key => $line) { $result = $object->updateline($line->id, $line->subprice, $line->qty, $line->remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); + $object->lines[$key] = $object->line; } } elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('remiseforalllines', 'alpha') !== '' && $usercancreate) { // Define a discount for all lines $remise_percent = (GETPOST('remiseforalllines') ? GETPOST('remiseforalllines') : 0); $remise_percent = str_replace('*', '', $remise_percent); - foreach ($object->lines as $line) { + foreach ($object->lines as $key => $line) { $tvatx = $line->tva_tx; if (!empty($line->vat_src_code)) { $tvatx .= ' ('.$line->vat_src_code.')'; } $result = $object->updateline($line->id, $line->subprice, $line->qty, $remise_percent, $tvatx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); + $object->lines[$key] = $object->line; } } elseif ($action == 'addline' && GETPOST('submitforallmargins', 'alpha') && GETPOST('marginforalllines') !== '' && $usercancreate) { // Define margin $margin_rate = (GETPOST('marginforalllines') ? GETPOST('marginforalllines') : 0); - foreach ($object->lines as &$line) { + foreach ($object->lines as $key => $line) { $subprice = price2num($line->pa_ht * (1 + $margin_rate / 100), 'MU'); $prod = new Product($db); $prod->fetch($line->fk_product); @@ -1009,23 +1012,28 @@ if (empty($reshook)) { setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings'); } // Manage $line->subprice and $line->multicurrency_subprice - $multicurrency_subprice = (float) $subprice * $line->multicurrency_subprice / $line->subprice; + if ($line->subprice <> 0) { + $multicurrency_subprice = (float) $subprice * $line->multicurrency_subprice / $line->subprice; + } else { + $multicurrency_subprice = 0; + } // Update DB $result = $object->updateline($line->id, $subprice, $line->qty, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $multicurrency_subprice); + $object->lines[$key] = $object->line; // Update $object with new margin info - $line->price = $subprice; - $line->marge_tx = $margin_rate; - $line->marque_tx = $margin_rate * $line->pa_ht / (float) $subprice; - $line->total_ht = $line->qty * (float) $subprice; - $line->total_tva = $line->tva_tx * $line->qty * (float) $subprice; - $line->total_ttc = (1 + $line->tva_tx) * $line->qty * (float) $subprice; - // Manage $line->subprice and $line->multicurrency_subprice - $line->multicurrency_total_ht = $line->qty * (float) $subprice * $line->multicurrency_subprice / $line->subprice; - $line->multicurrency_total_tva = $line->tva_tx * $line->qty * (float) $subprice * $line->multicurrency_subprice / $line->subprice; - $line->multicurrency_total_ttc = (1 + $line->tva_tx) * $line->qty * (float) $subprice * $line->multicurrency_subprice / $line->subprice; - // Used previous $line->subprice and $line->multicurrency_subprice above, now they can be set to their new values - $line->subprice = (float) $subprice; - $line->multicurrency_subprice = $multicurrency_subprice; + // $line->price = $subprice; + // $line->marge_tx = $margin_rate; + // $line->marque_tx = $margin_rate * $line->pa_ht / (float) $subprice; + // $line->total_ht = $line->qty * (float) $subprice; + // $line->total_tva = $line->tva_tx * $line->qty * (float) $subprice; + // $line->total_ttc = (1 + $line->tva_tx) * $line->qty * (float) $subprice; + // // Manage $line->subprice and $line->multicurrency_subprice + // $line->multicurrency_total_ht = $line->qty * (float) $subprice * $line->multicurrency_subprice / $line->subprice; + // $line->multicurrency_total_tva = $line->tva_tx * $line->qty * (float) $subprice * $line->multicurrency_subprice / $line->subprice; + // $line->multicurrency_total_ttc = (1 + $line->tva_tx) * $line->qty * (float) $subprice * $line->multicurrency_subprice / $line->subprice; + // // Used previous $line->subprice and $line->multicurrency_subprice above, now they can be set to their new values + // $line->subprice = (float) $subprice; + // $line->multicurrency_subprice = $multicurrency_subprice; } } elseif ($action == 'addline' && !GETPOST('submitforalllines', 'alpha') && !GETPOST('submitforallmargins', 'alpha') && $usercancreate) { // Add line // Set if we used free entry or predefined product @@ -1888,6 +1896,14 @@ if ($action == 'create') { if ($element == 'project') { $projectid = $originid; + + // Fetch project and thirdparty + $project = new Project($db); + $project->fetch($projectid); + if ($project->socid > 0) { + $soc = new Societe($db); + $soc->fetch($project->socid); + } } else { // For compatibility if ($element == 'order' || $element == 'commande') { @@ -1920,9 +1936,9 @@ if ($action == 'create') { $soc = $objectsrc->thirdparty; - $cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0)); - $mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0)); - $warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0)); + $cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0)); + $mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0)); + $warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0)); // Replicate extrafields $objectsrc->fetch_optionals(); @@ -1937,7 +1953,10 @@ if ($action == 'create') { } } } - } else { + } + + // Load default values from thirdparty + if (!empty($soc)) { $cond_reglement_id = empty($soc->cond_reglement_id) ? $cond_reglement_id : $soc->cond_reglement_id; $deposit_percent = empty($soc->deposit_percent) ? $deposit_percent : $soc->deposit_percent; $mode_reglement_id = empty($soc->mode_reglement_id) ? $mode_reglement_id : $soc->mode_reglement_id; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 57e8bb3b0b9..3359667e3b2 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -356,7 +356,7 @@ class Propal 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' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index 550baca1931..f50a69286ed 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2010 Laurent Destailleur +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -44,6 +44,7 @@ if (isModEnabled('invoice')) { // Security check $socid = GETPOSTINT("socid"); +$id = 0; if ($user->socid > 0) { $action = ''; $id = $user->socid; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 24532b36ba0..74f7c62ce1e 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -304,7 +304,7 @@ class Commande extends CommonOrder // 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' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/commande/class/orderline.class.php b/htdocs/commande/class/orderline.class.php index eaab17b3648..a311ef25233 100644 --- a/htdocs/commande/class/orderline.class.php +++ b/htdocs/commande/class/orderline.class.php @@ -359,10 +359,10 @@ class OrderLine extends CommonOrderLine $this->localtax2_tx = 0; } if (empty($this->localtax1_type)) { - $this->localtax1_type = 0; + $this->localtax1_type = '0'; } if (empty($this->localtax2_type)) { - $this->localtax2_type = 0; + $this->localtax2_type = '0'; } if (empty($this->total_localtax1)) { $this->total_localtax1 = 0; @@ -522,10 +522,10 @@ class OrderLine extends CommonOrderLine $this->localtax2_tx = 0; } if (empty($this->localtax1_type)) { - $this->localtax1_type = 0; + $this->localtax1_type = '0'; } if (empty($this->localtax2_type)) { - $this->localtax2_type = 0; + $this->localtax2_type = '0'; } if (empty($this->qty)) { $this->qty = 0; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 17971d298ba..73ee30a83fe 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -348,7 +348,7 @@ class Account 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' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index d0befa6c10f..836390e4188 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -1,7 +1,7 @@ * 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 @@ -198,7 +198,7 @@ class PaymentVarious 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( // TODO: fill this array @@ -833,6 +833,7 @@ class PaymentVarious extends CommonObject global $langs; $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); + $bankline = ((empty($arraydata['bankline']) || empty($arraydata['bankline']->id)) ? 0 : $arraydata['bankline']); $return = '
'; $return .= '
'; @@ -844,8 +845,8 @@ class PaymentVarious extends CommonObject if ($selected >= 0) { $return .= ''; } - if (property_exists($this, 'fk_bank')) { - $return .= ' | '.$this->fk_bank.''; + if (!empty($bankline) && $bankline instanceof AccountLine) { + $return .= ' | '.$bankline->getNomUrl(1).''; } if (property_exists($this, 'datep')) { $return .= '
'.$langs->trans("Date").' : '.dol_print_date($this->db->jdate($this->datep), 'day').''; diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index bfb4a783c65..195d635d8d5 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -239,27 +239,23 @@ if (empty($reshook)) { $form = new Form($db); $proj = null; +$accountingaccount = new AccountingAccount($db); +$bankline = new AccountLine($db); +$variousstatic = new PaymentVarious($db); +$accountstatic = null; +$accountingjournal = null; if ($arrayfields['account']['checked'] || $arrayfields['subledger']['checked']) { $formaccounting = new FormAccounting($db); } if ($arrayfields['bank']['checked'] && isModEnabled('accounting')) { $accountingjournal = new AccountingJournal($db); } -if ($arrayfields['ref']['checked']) { - $variousstatic = new PaymentVarious($db); -} if ($arrayfields['bank']['checked']) { - $accountstatic = new Account($db); + $accountstatic = new Account($db); } if ($arrayfields['project']['checked']) { $proj = new Project($db); } -if ($arrayfields['entry']['checked']) { - $bankline = new AccountLine($db); -} -if ($arrayfields['account']['checked']) { - $accountingaccount = new AccountingAccount($db); -} $title = $langs->trans("VariousPayments"); //$help_url = "EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject"; @@ -720,20 +716,25 @@ while ($i < $imaxinloop) { $variousstatic->label = $obj->label; $variousstatic->datep = $obj->datep; $variousstatic->type_payment = $obj->payment_code; - $bankline->fetch($obj->fk_bank); - $variousstatic->fk_bank = $bankline->getNomUrl(1); + $variousstatic->amount = $obj->amount; $accountingaccount->fetch(0, $obj->accountancy_code, 1); $variousstatic->accountancy_code = $accountingaccount->getNomUrl(0, 0, 1, $obj->accountingaccount, 1); if ($mode == 'kanban') { + if ($obj->fk_bank > 0) { + $bankline->fetch($obj->fk_bank); + } else { + $bankline->id = 0; + } + if ($i == 0) { print '
'; print '
'; } // Output Kanban - print $variousstatic->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + print $variousstatic->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected), 'bankline' => $bankline)); if ($i == ($imaxinloop) - 1) { print '
'; print '
'; - if ($obj->bid > 0) { + if (is_object($accountstatic) && $obj->bid > 0) { $accountstatic->id = $obj->bid; $accountstatic->ref = $obj->bref; $accountstatic->number = $obj->bnumber; - if (isModEnabled('accounting')) { + if (isModEnabled('accounting') && is_object($accountingjournal)) { $accountstatic->account_number = $obj->bank_account_number; $accountingjournal->fetch($obj->accountancy_journal); $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1); @@ -832,8 +833,6 @@ while ($i < $imaxinloop) { $accountstatic->label = $obj->blabel; print $accountstatic->getNomUrl(1); - } else { - print ' '; } print '
'; print ''; - if ($object->type != Facture::TYPE_CREDIT_NOTE) { - if ($action == 'editconditions') { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); - } else { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none'); - } + if ($action == 'editconditions') { + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); } else { - print ' '; + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none'); } print ''; @@ -1799,6 +1798,7 @@ if ($action == 'create') { // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); + $morehtmlcenter = ''; $somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); print ''; diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 78615f801ba..1476eb8e764 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -721,11 +721,11 @@ class Invoices extends DolibarrApi } } - if ($this->invoice->update(DolibarrApiAccess::$user)) { + if ($this->invoice->update(DolibarrApiAccess::$user) > 0) { return $this->get($id); + } else { + throw new RestException(500, $this->invoice->error); } - - return false; } /** diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index f9cd158244f..ef3d96fed53 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -234,7 +234,7 @@ class FactureRec extends CommonInvoice // 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' => -1, 'notnull' => 1, 'position' => 10), @@ -1478,6 +1478,7 @@ class FactureRec extends CommonInvoice $nb_create++; $this->output .= $langs->trans("InvoiceGeneratedFromTemplate", $facture->ref, $facturerec->ref)."\n"; } else { + $this->output .= $langs->trans("InvoiceGeneratedFromTemplateError", $facture->ref, $facturerec->ref, $this->error)."\n"; $this->db->rollback("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref); } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 7f7eb71398b..3ccd5441aa1 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -317,7 +317,7 @@ class Facture extends CommonInvoice // 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' => -1, 'notnull' => 1, 'position' => 1), @@ -486,7 +486,8 @@ class Facture extends CommonInvoice $this->type = self::TYPE_STANDARD; } - $this->ref_client = trim($this->ref_client); + $this->ref_client = trim($this->ref_client); // deprecated + $this->ref_customer = trim($this->ref_customer); $this->note_private = (isset($this->note_private) ? trim($this->note_private) : ''); $this->note = (isset($this->note) ? trim($this->note) : $this->note_private); // deprecated @@ -906,17 +907,18 @@ class Facture extends CommonInvoice 1 ); + if ($result < 0) { + $this->error = $newinvoiceline->error; + $this->errors = array_merge($this->errors, $newinvoiceline->errors); + $error++; + break; + } + // Defined the new fk_parent_line if ($result > 0 && $newinvoiceline->product_type == 9) { $fk_parent_line = $result; } } - if ($result < 0) { - $this->error = $newinvoiceline->error; - $this->errors = $newinvoiceline->errors; - $error++; - break; - } } } elseif (!$error && empty($this->fac_rec)) { // If this->lines is an array of invoice line arrays $fk_parent_line = 0; @@ -2514,9 +2516,13 @@ class Facture extends CommonInvoice if (isset($this->ref_ext)) { $this->ref_ext = trim($this->ref_ext); } - if (isset($this->ref_client)) { + // deprecated + if (!empty($this->ref_client)) { $this->ref_client = trim($this->ref_client); } + if (!empty($this->ref_customer)) { + $this->ref_customer = trim($this->ref_customer); + } if (isset($this->increment)) { $this->increment = trim($this->increment); } @@ -2545,7 +2551,6 @@ class Facture extends CommonInvoice $this->retained_warranty = (float) $this->retained_warranty; } - // Check parameters // Put here code to add control on parameters values @@ -2555,7 +2560,7 @@ class Facture extends CommonInvoice $sql .= " ref_ext=".(isset($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null").","; $sql .= " type=".(isset($this->type) ? $this->db->escape($this->type) : "null").","; $sql .= " subtype=".(isset($this->subtype) ? $this->db->escape($this->subtype) : "null").","; - $sql .= " ref_client=".(isset($this->ref_client) ? "'".$this->db->escape($this->ref_client)."'" : "null").","; + $sql .= " ref_client=".(!empty($this->ref_customer) ? "'".$this->db->escape($this->ref_customer)."'" : (isset($this->ref_client) ? "'".$this->db->escape($this->ref_client)."'" : "null")).","; $sql .= " increment=".(isset($this->increment) ? "'".$this->db->escape($this->increment)."'" : "null").","; $sql .= " fk_soc=".(isset($this->socid) ? $this->db->escape($this->socid) : "null").","; $sql .= " datec=".(strval($this->date_creation) != '' ? "'".$this->db->idate($this->date_creation)."'" : 'null').","; @@ -2760,7 +2765,8 @@ class Facture extends CommonInvoice } if (!$error) { - $this->ref_client = $ref_client; + $this->ref_client = $ref_client; //deprecated + $this->ref_customer = $ref_client; } if (!$notrigger && empty($error)) { @@ -2773,7 +2779,8 @@ class Facture extends CommonInvoice } if (!$error) { - $this->ref_client = $ref_client; + $this->ref_client = $ref_client; //deprecated + $this->ref_customer = $ref_client; $this->db->commit(); return 1; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 900a9b16101..cbe1c9b4111 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -334,8 +334,22 @@ class Paiement extends CommonObject if (empty($value)) { continue; } - // $key is id of invoice, $value is amount, $way is a 'dolibarr' if amount is in main currency, 'customer' if in foreign currency - $value_converted = MultiCurrency::getAmountConversionFromInvoiceRate($key, $value, $way); + $value_converted = false; + $tmparray = MultiCurrency::getInvoiceRate($key, 'facture'); + $invoice_multicurrency_tx = $tmparray['invoice_multicurrency_tx']; + $invoice_multicurrency_code = $tmparray['invoice_multicurrency_code']; + + // $key is id of invoice, $value is amount, $way is 'dolibarr' if amount is in main currency, 'customer' if in foreign currency + if ($invoice_multicurrency_tx) { + if ($way == 'dolibarr') { + $value_converted = (float) price2num($value * $invoice_multicurrency_tx, 'MU'); + } else { + $value_converted = (float) price2num($value / $invoice_multicurrency_tx, 'MU'); + } + } else { + $invoice_multicurrency_tx = false; + } + // Add controls of input validity if ($value_converted === false) { // We failed to find the conversion for one invoice @@ -344,8 +358,8 @@ class Paiement extends CommonObject } // Set the currency of the invoice - $currencyofinvoiceforthisline = empty($this->multicurrency_code[$key]) ? $conf->currency : $this->multicurrency_code[$key]; - // If a payment was enter into section of foreign currency of invoice, we want to pay in the currency if invoice + $currencyofinvoiceforthisline = empty($this->multicurrency_code[$key]) ? $invoice_multicurrency_code : $this->multicurrency_code[$key]; + // If a payment was entered into the section of the foreign currency of invoice, we want to pay in the currency of invoice $currencyofpaymentforthisline = empty($this->multicurrency_amounts[$key]) ? $conf->currency : $this->multicurrency_code[$key]; //var_dump("Invoice ID: ".$key.", amount in company cur:".$this->amounts[$key]." amount in invoice cur:".$this->multicurrency_amounts[$key]." => currencyofinvoice= ".$currencyofinvoiceforthisline." - currencyofpaymentforthisline =".$currencyofpaymentforthisline); @@ -1310,12 +1324,10 @@ class Paiement extends CommonObject */ public function getWay() { - global $conf; - $way = 'dolibarr'; if (isModEnabled('multicurrency')) { foreach ($this->multicurrency_amounts as $value) { - if (!empty($value)) { // one value found then payment is in invoice currency + if (!empty($value)) { // one value found into multicurrency_amounts so payment is in invoice currency $way = 'customer'; break; } diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index f1a51a873a5..aa477454751 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -195,7 +195,7 @@ if ($action == 'create') { print ''.$langs->trans("Ref").''.$chid.''; print ''.$langs->trans("Label").''.$charge->label."\n"; print ''.$langs->trans("Type")."".$charge->type_label."\n"; - print ''.$langs->trans("Period")."".dol_print_date($charge->periode, 'day')."\n"; + print ''.$langs->trans("Period")."".dol_print_date($charge->period, 'day')."\n"; /*print ''.$langs->trans("DateDue")."".dol_print_date($charge->date_ech,'day')."\n"; print ''.$langs->trans("Amount")."".price($charge->amount,0,$outputlangs,1,-1,-1,$conf->currency).'';*/ diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 7fd7ea75d88..376a958ee6a 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -194,7 +194,7 @@ class BonPrelevement 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' => 10, 'notnull' => 1, 'visible' => 0,), @@ -1090,6 +1090,7 @@ class BonPrelevement extends CommonObject // Pre-store some values into variables to simplify following sql requests if ($sourcetype != 'salary') { $entities = $type != 'bank-transfer' ? getEntity('invoice') : getEntity('supplier_invoice'); + $sqlTable = $type != 'bank-transfer' ? "facture" : "facture_fourn"; $socOrUser = 'fk_soc'; $societeOrUser = 'societe'; } else { @@ -1099,8 +1100,6 @@ class BonPrelevement extends CommonObject $societeOrUser = 'user'; } - $sqlTable = $type != 'bank-transfer' ? "facture" : "facture_fourn"; - $thirdpartyBANId = 0; // Check if there is an iban associated to the bank transfer request or if we take the default @@ -1160,7 +1159,7 @@ class BonPrelevement extends CommonObject $sql .= ", CONCAT(s.firstname,' ',s.lastname) as name"; $sql .= ", f.ref, sr.bic, sr.iban_prefix, 'FRST' as frstrecur"; } - $sql .= " FROM " . $this->db->prefix() . $sqlTable . " as f"; + $sql .= " FROM " . $this->db->prefix() . $sqlTable . " as f"; // f is salary, facture or facture_fourn $sql .= " LEFT JOIN " . $this->db->prefix() . "prelevement_demande as pd ON f.rowid = pd.fk_".$this->db->sanitize($sqlTable); $sql .= " LEFT JOIN " . $this->db->prefix() . $this->db->sanitize($societeOrUser)." as s ON s.rowid = f.".$this->db->sanitize($socOrUser); $sql .= " LEFT JOIN " . $this->db->prefix() . $this->db->sanitize($societeOrUser."_rib")." as sr ON s.rowid = sr.".$this->db->sanitize($socOrUser); @@ -2394,12 +2393,16 @@ class BonPrelevement extends CommonObject } else { $instrprty = 'NORM'; } + + // Set $categoryPurpose: CORE, TREA, SUPP, ... + $categoryPurpose = getDolGlobalString('PAYMENTBYBANKTRANSFER_CUSTOM_CATEGORY_PURPOSE', 'CORE'); + $XML_CREDITOR .= ' ' . $instrprty . '' . $CrLf; $XML_CREDITOR .= ' ' . $CrLf; $XML_CREDITOR .= ' SEPA' . $CrLf; $XML_CREDITOR .= ' ' . $CrLf; $XML_CREDITOR .= ' ' . $CrLf; - $XML_CREDITOR .= ' CORE' . $CrLf; + $XML_CREDITOR .= ' ' . $categoryPurpose . '' . $CrLf; $XML_CREDITOR .= ' ' . $CrLf; $XML_CREDITOR .= ' ' . $CrLf; } @@ -2578,6 +2581,7 @@ class BonPrelevement extends CommonObject $country = explode(':', $configuration->global->MAIN_INFO_SOCIETE_COUNTRY); $IdBon = sprintf("%05d", $obj->rowid); $RefBon = $obj->ref; + $localInstrument = getDolGlobalString('PAYMENTBYBANKTRANSFER_CUSTOM_LOCAL_INSTRUMENT', 'CORE'); if (!empty($configuration->global->SEPA_FORCE_TWO_DECIMAL)) { $total = number_format((float) price2num($total, 'MT'), 2, ".", ""); @@ -2596,7 +2600,7 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' SEPA' . $CrLf; $XML_SEPA_INFO .= ' ' . $CrLf; $XML_SEPA_INFO .= ' ' . $CrLf; - $XML_SEPA_INFO .= ' CORE' . $CrLf; + $XML_SEPA_INFO .= ' ' . $localInstrument . '' . $CrLf; $XML_SEPA_INFO .= ' ' . $CrLf; $XML_SEPA_INFO .= ' ' . $format . '' . $CrLf; $XML_SEPA_INFO .= ' ' . $CrLf; @@ -2661,7 +2665,7 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' SEPA' . $CrLf; $XML_SEPA_INFO .= ' ' . $CrLf; $XML_SEPA_INFO .= ' ' . $CrLf; - $XML_SEPA_INFO .= ' CORE' . $CrLf; + $XML_SEPA_INFO .= ' ' . $localInstrument . '' . $CrLf; $XML_SEPA_INFO .= ' ' . $CrLf; $XML_SEPA_INFO .= ' ' . $format . '' . $CrLf; $XML_SEPA_INFO .= ' ' . $CrLf; diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 72283b129b3..5bfe9ab6054 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -293,12 +293,13 @@ if (empty($reshook)) { $object->date_ech = dol_time_plus_duree($object->date_ech, 1, 'm'); } else { // Note date_ech is often a little bit higher than dateperiod + $newdateech = dol_mktime(0, 0, 0, GETPOSTINT('clone_date_echmonth'), GETPOSTINT('clone_date_echday'), GETPOSTINT('clone_date_echyear')); // = date of creation or due date $newdateperiod = dol_mktime(0, 0, 0, GETPOSTINT('clone_periodmonth'), GETPOSTINT('clone_periodday'), GETPOSTINT('clone_periodyear')); - $newdateech = dol_mktime(0, 0, 0, GETPOSTINT('clone_date_echmonth'), GETPOSTINT('clone_date_echday'), GETPOSTINT('clone_date_echyear')); + if ($newdateperiod) { $object->period = $newdateperiod; if (empty($newdateech)) { - $object->date_ech = $object->periode; + $object->date_ech = $object->period; } } if ($newdateech) { diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 7aa08227626..fcfffab7b7c 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -300,7 +300,7 @@ class ChargeSociales extends CommonObject $sql .= ", ".($this->mode_reglement_id > 0 ? ((int) $this->mode_reglement_id) : "NULL"); $sql .= ", '".$this->db->escape($this->label ? $this->label : $this->lib)."'"; $sql .= ", '".$this->db->idate($this->date_ech)."'"; - $sql .= ", '".$this->db->idate($this->periode)."'"; + $sql .= ", '".$this->db->idate($this->period)."'"; $sql .= ", '".price2num($newamount)."'"; $sql .= ", ".($this->fk_project > 0 ? ((int) $this->fk_project) : 'NULL'); $sql .= ", ".((int) $conf->entity); diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index cc84c6c53bd..f2a4f3ecba0 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -210,7 +210,7 @@ llxHeader('', $title, '', '', 0, 0, '', '', '', 'bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); $sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user,"; -$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,"; +$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode as period, cs.fk_account,"; if (isModEnabled('project')) { $sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,"; } @@ -748,7 +748,7 @@ while ($i < $imaxinloop) { // Date end period if (!empty($arrayfields['cs.periode']['checked'])) { - print ''.dol_print_date($db->jdate($obj->periode), 'day').''; + print ''.dol_print_date($db->jdate($obj->period), 'day').''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index a32d652fd1c..fe9816caf40 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -154,7 +154,7 @@ print ''; print ''; $sql = "SELECT c.id, c.libelle as type_label,"; -$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.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 .= " pc.rowid as pid, pc.datep, pc.amount as totalpaid, pc.num_paiement as num_payment, pc.fk_bank,"; $sql .= " pct.code as payment_code,"; $sql .= " u.rowid as uid, u.lastname, u.firstname, u.email, u.login, u.admin, u.statut,"; @@ -175,8 +175,8 @@ if ($search_sc_type > 0) { } if ($year > 0) { $sql .= " AND ("; - // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, - // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire + // If period defined, we use it as a date criteria, elsewe use the dure date, + // so we are compatible with case where period is not mandatory. $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 .= ")"; @@ -296,9 +296,9 @@ while ($i < min($num, $limit)) { print $socialcontrib->getNomUrl(1, ''); print ''; // Type - print ''.$obj->type_label.''; + print ''.dolPrintHTML($obj->type_label).''; // Date - $date = $obj->periode; + $date = $obj->period; if (empty($date)) { $date = $obj->date_ech; } diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index e6371094690..c2ebd13181e 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -498,22 +498,31 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) { //var_dump($annee.' '.$year_end.' '.$mois.' '.$month_end); if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) { if ($annee_decalage > $minyear && $case <= $casenow) { - if (!empty($cumulative[$caseprev]) && !empty($cumulative[$case])) { - $percent = (round(($cumulative[$case] - $cumulative[$caseprev]) / $cumulative[$caseprev], 4) * 100); - //print "X $cumulative[$case] - $cumulative[$caseprev] - $cumulative[$caseprev] - $percent X"; + if ($modecompta=='CREANCES-DETTES') { + $cumulative_previous_year = (!empty($cumulative_ht[$caseprev])?$cumulative_ht[$caseprev]:0); + $cumulative_year = (!empty($cumulative_ht[$case])?$cumulative_ht[$case]:0); + $isset_cumulative_previous_year = isset($cumulative_ht[$caseprev]); + } else { + $cumulative_previous_year = (!empty($cumulative[$caseprev])?$cumulative[$caseprev]:0); + $cumulative_year = (!empty($cumulative[$case])?$cumulative[$case]:0); + $isset_cumulative_previous_year = isset($cumulative_ht[$caseprev]); + } + if (!empty($cumulative_previous_year) && !empty($cumulative_year)) { + $percent = (round(($cumulative_year - $cumulative_previous_year) / $cumulative_previous_year, 4) * 100); + //print "X $cumulative_year - $cumulative_previous_year - $cumulative_previous_year - $percent X"; print($percent >= 0 ? "+$percent" : "$percent").'%'; } - if (!empty($cumulative[$caseprev]) && empty($cumulative[$case])) { + if (!empty($cumulative_previous_year) && empty($cumulative_year)) { print '-100%'; } - if (empty($cumulative[$caseprev]) && !empty($cumulative[$case])) { + if (empty($cumulative_previous_year) && !empty($cumulative_year)) { //print '+Inf%'; print '-'; } - if (isset($cumulative[$caseprev]) && empty($cumulative[$caseprev]) && empty($cumulative[$case])) { + if ($isset_cumulative_previous_year && empty($cumulative_previous_year) && empty($cumulative_year)) { print '+0%'; } - if (!isset($cumulative[$caseprev]) && empty($cumulative[$case])) { + if (!$isset_cumulative_previous_year && empty($cumulative_year)) { print '-'; } } else { @@ -618,7 +627,7 @@ print ''.$langs->trans("Total").''; for ($annee = $year_start; $annee <= $year_end; $annee++) { if ($modecompta == 'CREANCES-DETTES') { // Montant total HT - if ($total_ht[$annee] || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) { + if (isset($total_ht[$annee]) || ($annee >= $minyear && $annee <= max($nowyear, $maxyear))) { print ''; print(empty($total_ht[$annee]) ? '0' : price($total_ht[$annee])); print ""; @@ -638,19 +647,26 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) { // Pourcentage total if ($annee > $minyear && $annee <= max($nowyear, $maxyear)) { - if (!empty($total[$annee - 1]) && !empty($total[$annee])) { - $percent = (round(($total[$annee] - $total[$annee - 1]) / $total[$annee - 1], 4) * 100); + if ($modecompta == 'CREANCES-DETTES') { + $total_previous_year = (!empty($total_ht[$annee - 1])?$total_ht[$annee - 1]:0); + $total_year = (!empty($total_ht[$annee])?$total_ht[$annee]:0); + } else { + $total_previous_year = (!empty($total[$annee - 1])?$total[$annee - 1]:0); + $total_year = (!empty($total[$annee])?$total[$annee]:0); + } + if (!empty($total_previous_year) && !empty($total_year)) { + $percent = (round(($total_year - $total_previous_year) / $total_previous_year, 4) * 100); print ''; print($percent >= 0 ? "+$percent" : "$percent").'%'; print ''; } - if (!empty($total[$annee - 1]) && empty($total[$annee])) { + if (!empty($total_previous_year) && empty($total_year)) { print '-100%'; } - if (empty($total[$annee - 1]) && !empty($total[$annee])) { + if (empty($total_previous_year) && !empty($total_year)) { print '+'.$langs->trans('Inf').'%'; } - if (empty($total[$annee - 1]) && empty($total[$annee])) { + if (empty($total_previous_year) && empty($total_year)) { print '+0%'; } } else { diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index 9384a292aff..48fa39fce67 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -204,8 +204,8 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { $sql .= " AND tva.entity = " . $conf->entity; if ($year > 0) { $sql .= " AND ("; - // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, - // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire + // We'll use the specified period as the date filter, unless it's missing, in which case we'll use the due date. + // This is to handle situations where the period was optional. $sql .= " (tva.datev IS NOT NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')"; $sql .= " OR (tva.datev IS NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')"; $sql .= ")"; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 410ea609318..0a97ee8f407 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -87,7 +87,7 @@ class Contact extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * 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. + * 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>}> 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', 'css' => 'left'), diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 348fb069591..0f83d2dc1f4 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -263,7 +263,7 @@ class Contrat 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' => -1, 'notnull' => 1, 'position' => 10), @@ -1006,12 +1006,13 @@ class Contrat extends CommonObject /** * Create a contract into database * - * @param User $user User that create - * @return int Return integer <0 if KO, id of contract if OK + * @param User $user User that create + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, id of contract if OK */ - public function create($user) + public function create($user, $notrigger = 0) { - global $conf, $langs, $mysoc; + global $conf, $langs; // Check parameters $paramsok = 1; @@ -1167,22 +1168,18 @@ class Contrat extends CommonObject } } - if (!$error) { + if (!$error && !$notrigger) { // Call trigger $result = $this->call_trigger('CONTRACT_CREATE', $user); if ($result < 0) { $error++; } // End call triggers + } - if (!$error) { - $this->db->commit(); - return $this->id; - } else { - dol_syslog(get_class($this)."::create - 30 - ".$this->error, LOG_ERR); - $this->db->rollback(); - return -3; - } + if (!$error) { + $this->db->commit(); + return $this->id; } else { $this->error = "Failed to add contract"; dol_syslog(get_class($this)."::create - 20 - ".$this->error, LOG_ERR); diff --git a/htdocs/contrat/class/contratligne.class.php b/htdocs/contrat/class/contratligne.class.php index cf5b58f2397..23ecc65e94c 100644 --- a/htdocs/contrat/class/contratligne.class.php +++ b/htdocs/contrat/class/contratligne.class.php @@ -299,7 +299,7 @@ class ContratLigne 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' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 14b13b9e68b..17151fe3a4a 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -217,6 +217,7 @@ class box_actions extends ModeleBoxes if (getDolGlobalString('SHOW_DIALOG_HOMEPAGE')) { $actioncejour = false; $contents = $this->info_box_contents; + $nblines = 0; if (is_countable($contents) && count($contents) > 0) { $nblines = count($contents); } diff --git a/htdocs/core/boxes/box_actions_future.php b/htdocs/core/boxes/box_actions_future.php index 43eeed62e95..5d4e8dcd2e8 100644 --- a/htdocs/core/boxes/box_actions_future.php +++ b/htdocs/core/boxes/box_actions_future.php @@ -218,6 +218,7 @@ class box_actions_future extends ModeleBoxes if (getDolGlobalString('SHOW_DIALOG_HOMEPAGE')) { $actioncejour = false; $contents = $this->info_box_contents; + $nblines = 0; if (is_countable($contents) && count($contents) > 0) { $nblines = count($contents); } diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index 07829e463c4..688396580ae 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -40,6 +40,9 @@ class box_external_rss extends ModeleBoxes public $boxlabel = "BoxLastRssInfos"; public $depends = array("externalrss"); + /** + * @var string + */ public $paramdef; // Params of box definition (not user params) /** diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 68d5b65b7ff..af0dcbac277 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -133,6 +133,8 @@ class box_graph_invoices_permonth extends ModeleBoxes $stats = new FactureStats($this->db, $socid, $mode, 0); $stats->where = "f.fk_statut > 0"; + $px1 = null; + $px2 = null; // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($shownb) { @@ -247,14 +249,14 @@ class box_graph_invoices_permonth extends ModeleBoxes $stringtoshow .= '
'; $stringtoshow .= '
'; } - if ($shownb) { + if ($shownb && $px1 !== null) { $stringtoshow .= $px1->show(); } if ($shownb && $showtot) { $stringtoshow .= '
'; $stringtoshow .= '
'; } - if ($showtot) { + if ($showtot && $px2 !== null) { $stringtoshow .= $px2->show(); } if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 209147aafbb..f3d556b0933 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -87,7 +87,11 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $dir = ''; // We don't need a path because image file will not be saved into disk $prefix = ''; + $mesg = ''; $socid = 0; + $px1 = null; + $px2 = null; + if ($user->socid) { $socid = $user->socid; } @@ -242,14 +246,14 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $stringtoshow .= '
'; $stringtoshow .= '
'; } - if ($shownb) { + if ($shownb && $px1 !== null) { $stringtoshow .= $px1->show(); } if ($shownb && $showtot) { $stringtoshow .= '
'; $stringtoshow .= '
'; } - if ($showtot) { + if ($showtot && $px2 !== null) { $stringtoshow .= $px2->show(); } if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php index 2843b326f87..55ba0451351 100644 --- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php +++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php @@ -33,6 +33,9 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes { public $boxcode = "box_graph_nb_ticket_last_x_days"; public $boximg = "ticket"; + /** + * @var string + */ public $boxlabel; public $depends = array("ticket"); diff --git a/htdocs/core/boxes/box_graph_nb_tickets_type.php b/htdocs/core/boxes/box_graph_nb_tickets_type.php index 1a17fbf1de8..adbf831c989 100644 --- a/htdocs/core/boxes/box_graph_nb_tickets_type.php +++ b/htdocs/core/boxes/box_graph_nb_tickets_type.php @@ -33,6 +33,9 @@ class box_graph_nb_tickets_type extends ModeleBoxes { public $boxcode = "box_graph_nb_tickets_type"; public $boximg = "ticket"; + /** + * @var string + */ public $boxlabel; public $depends = array("ticket"); diff --git a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php index ca61d098f6a..f14889e34c9 100644 --- a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php +++ b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php @@ -33,6 +33,9 @@ class box_graph_new_vs_close_ticket extends ModeleBoxes { public $boxcode = "box_nb_tickets_type"; public $boximg = "ticket"; + /** + * @var string + */ public $boxlabel; public $depends = array("ticket"); diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 461cda11cb6..3a3cb66df2d 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -88,6 +88,9 @@ class box_graph_orders_permonth extends ModeleBoxes $dir = ''; // We don't need a path because image file will not be saved into disk $prefix = ''; + $mesg = ''; + $px1 = null; + $px2 = null; $socid = 0; if ($user->socid) { $socid = $user->socid; @@ -246,14 +249,14 @@ class box_graph_orders_permonth extends ModeleBoxes $stringtoshow .= '
'; $stringtoshow .= '
'; } - if ($shownb) { + if ($shownb && $px1 !== null) { $stringtoshow .= $px1->show(); } if ($shownb && $showtot) { $stringtoshow .= '
'; $stringtoshow .= '
'; } - if ($showtot) { + if ($showtot && $px2 !== null) { $stringtoshow .= $px2->show(); } if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 1964f4317ad..0f0e9f2df6f 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -87,6 +87,9 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $dir = ''; // We don't need a path because image file will not be saved into disk $prefix = ''; + $mesg = ''; + $px1 = null; + $px2 = null; $socid = 0; if ($user->socid) { $socid = $user->socid; @@ -245,14 +248,14 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $stringtoshow .= '
'; $stringtoshow .= '
'; } - if ($shownb) { + if ($shownb && $px1 !== null) { $stringtoshow .= $px1->show(); } if ($shownb && $showtot) { $stringtoshow .= '
'; $stringtoshow .= '
'; } - if ($showtot) { + if ($showtot && $px2 !== null) { $stringtoshow .= $px2->show(); } if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index f232fa8ef81..e405727d7ff 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -137,6 +137,10 @@ class box_graph_product_distribution extends ModeleBoxes $socid = empty($user->socid) ? 0 : $user->socid; + $mesg = ''; + $px1 = null; + $px2 = null; + $px3 = null; $userid = 0; // No filter on user creation $WIDTH = ($nbofgraph >= 2 || !empty($conf->dol_optimize_smallscreen)) ? '300' : '320'; @@ -373,30 +377,30 @@ class box_graph_product_distribution extends ModeleBoxes $stringtoshow .= '
'; if ($nbofgraph == 1) { - if ($showpropalnb) { + if ($showpropalnb && $px2 !== null) { $stringtoshow .= $px2->show(); - } elseif ($showordernb) { + } elseif ($showordernb && $px3 !== null) { $stringtoshow .= $px3->show(); - } else { + } elseif ($px1 !== null) { $stringtoshow .= $px1->show(); } } if ($nbofgraph == 2) { $stringtoshow .= '
'; - if (isModEnabled('propal') && $showpropalnb) { + if (isModEnabled('propal') && $showpropalnb && $px2 !== null) { $stringtoshow .= $px2->show(); - } elseif (isModEnabled('order') && $showordernb) { + } elseif (isModEnabled('order') && $showordernb && $px3 !== null) { $stringtoshow .= $px3->show(); } $stringtoshow .= '
'; - if (isModEnabled('invoice') && $showinvoicenb) { + if (isModEnabled('invoice') && $showinvoicenb && $px1 !== null) { $stringtoshow .= $px1->show(); - } elseif (isModEnabled('order') && $showordernb) { + } elseif (isModEnabled('order') && $showordernb && $px3 !== null) { $stringtoshow .= $px3->show(); } $stringtoshow .= '
'; } - if ($nbofgraph == 3) { + if ($nbofgraph == 3 && $px1 !== null && $px2 !== null && $px3 !== null) { $stringtoshow .= '
'; $stringtoshow .= $px2->show(); $stringtoshow .= '
'; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index bb9f0d14dbb..7e2fb8d27d1 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -90,6 +90,9 @@ class box_graph_propales_permonth extends ModeleBoxes $dir = ''; // We don't need a path because image file will not be saved into disk $prefix = ''; + $mesg = ''; + $px1 = null; + $px2 = null; $socid = 0; if ($user->socid) { $socid = $user->socid; @@ -242,14 +245,14 @@ class box_graph_propales_permonth extends ModeleBoxes $stringtoshow .= '
'; $stringtoshow .= '
'; } - if ($shownb) { + if ($shownb && $px1 !== null) { $stringtoshow .= $px1->show(); } if ($shownb && $showtot) { $stringtoshow .= '
'; $stringtoshow .= '
'; } - if ($showtot) { + if ($showtot && $px2 !== null) { $stringtoshow .= $px2->show(); } if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/box_graph_ticket_by_severity.php b/htdocs/core/boxes/box_graph_ticket_by_severity.php index 6dd7f3b6bff..e45e114cc73 100644 --- a/htdocs/core/boxes/box_graph_ticket_by_severity.php +++ b/htdocs/core/boxes/box_graph_ticket_by_severity.php @@ -33,6 +33,9 @@ class box_graph_ticket_by_severity extends ModeleBoxes { public $boxcode = "box_ticket_by_severity"; public $boximg = "ticket"; + /** + * @var string + */ public $boxlabel; public $depends = array("ticket"); diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index d10a3db50fd..7016d62449c 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -33,6 +33,9 @@ class box_last_modified_ticket extends ModeleBoxes { public $boxcode = "box_last_modified_ticket"; public $boximg = "ticket"; + /** + * @var string + */ public $boxlabel; public $depends = array("ticket"); diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index 8910aed5aa4..f251cd944bf 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -33,6 +33,9 @@ class box_last_ticket extends ModeleBoxes { public $boxcode = "box_last_ticket"; public $boximg = "ticket"; + /** + * @var string + */ public $boxlabel; public $depends = array("ticket"); diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index e58fa7047dc..3feaa9f666e 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -34,6 +34,9 @@ class box_project extends ModeleBoxes { public $boxcode = "project"; public $boximg = "object_projectpub"; + /** + * @var string + */ public $boxlabel; // var $depends = array("projet"); @@ -73,6 +76,7 @@ class box_project extends ModeleBoxes $totalMnt = 0; $totalnb = 0; $totalnbTask = 0; + $num = 0; $textHead = $langs->trans("OpenedProjects"); $this->info_box_head = array('text' => $textHead, 'limit' => dol_strlen($textHead)); diff --git a/htdocs/core/boxes/box_project_opportunities.php b/htdocs/core/boxes/box_project_opportunities.php index 9781657ccdd..35daf6083da 100644 --- a/htdocs/core/boxes/box_project_opportunities.php +++ b/htdocs/core/boxes/box_project_opportunities.php @@ -34,6 +34,9 @@ class box_project_opportunities extends ModeleBoxes { public $boxcode = "project_opportunities"; public $boximg = "object_projectpub"; + /** + * @var string + */ public $boxlabel; // var $depends = array("projet"); @@ -74,6 +77,7 @@ class box_project_opportunities extends ModeleBoxes $textHead = $langs->trans("OpenedProjectsOpportunities"); $this->info_box_head = array('text' => $textHead, 'limit' => dol_strlen($textHead)); + $num = 0; $i = 0; // list the summary of the orders if ($user->hasRight('projet', 'lire')) { diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 87acbc6c000..172e26153fa 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -166,7 +166,7 @@ class box_services_contracts extends ModeleBoxes } $description = $objp->description; - $s = $form->textwithtooltip($text, $description, 3, '', '', '', 0, ''); + $s = $form->textwithtooltip($text, $description, 3, 0, '', '', 0, ''); } else { $s = img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description); } diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 8fcfe21fb96..472f2116d22 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -34,6 +34,9 @@ class box_task extends ModeleBoxes { public $boxcode = "projettask"; public $boximg = "object_projecttask"; + /** + * @var string + */ public $boxlabel; public $depends = array("projet"); diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index 0bd6472805a..6c4ed512905 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -36,6 +36,9 @@ class box_validated_projects extends ModeleBoxes { public $boxcode = "validated_project"; public $boximg = "object_projectpub"; + /** + * @var string + */ public $boxlabel; //var $depends = array("projet"); diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 268de88d57f..d3f124a39a1 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1960,11 +1960,14 @@ class CMailFile // Check response from Server if ($_retVal = $this->server_parse($socket, "220")) { $_retVal = $socket; + } else { + $this->error = ($this->error ? $this->error." - " : "")."Succeed in opening socket but answer 220 not received"; } } else { $this->error = utf8_check('Error '.$errno.' - '.$errstr) ? 'Error '.$errno.' - '.$errstr : mb_convert_encoding('Error '.$errno.' - '.$errstr, 'UTF-8', 'ISO-8859-1'); } } + return $_retVal; } diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index 9c49e9071b7..e6e4c2de4ce 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -237,13 +237,14 @@ class Canvas * * @param string $action Action string * @param int $id Object id - * @return mixed Return return code of doActions of canvas + * @return ?mixed Return return code of doActions of canvas * @see https://wiki.dolibarr.org/index.php/Canvas_development */ public function doActions(&$action = 'view', $id = 0) { - if (method_exists($this->control, 'doActions')) { - $ret = $this->control->doActions($action, $id); + $control = $this->control; + if (method_exists($control, 'doActions')) { + $ret = $control->doActions($action, $id); return $ret; } return null; diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index 43a4bee56b9..1d798698e84 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -46,7 +46,7 @@ class Ccountry extends CommonDict public $code_iso; /** - * @var 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,comment?:string,validate?:int<0,1>}> + * @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>}> */ public $fields = array( 'label' => array('type' => 'varchar(250)', 'label' => 'Label', 'enabled' => 1, 'visible' => 1, 'position' => 15, 'notnull' => -1, 'showoncombobox' => 1) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 0443099f9dd..6d452392368 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -223,6 +223,11 @@ abstract class CommonDocGenerator */ public $cols; + /** + * @var array Array of position data + */ + public $afterColsLinePositions; + /** * @var array{fullpath:string} Array with result of doc generation. content is array('fullpath'=>$file) */ @@ -1253,6 +1258,64 @@ abstract class CommonDocGenerator } } + /** + * Get position in PDF after col display + * @return false|array{page:int,y:float|int,col:string} + */ + public function getMaxAfterColsLinePositionsData() + { + if (empty($this->afterColsLinePositions) || !is_array($this->afterColsLinePositions)) { + return false; + } + + $colId = ''; + $maxPage = $maxY = 0; + foreach ($this->afterColsLinePositions as $colKey => $value) { + if ($value['page'] > $maxPage) { + $colId = $colKey; + $maxPage = $value['page']; + $maxY = $value['y']; // if page is higher we need to reset y to new max page y + } elseif ($value['page'] == $maxPage) { + $maxY = max($value['y'], $maxY); + $colId = $colKey; + } + } + + return [ + 'col' => $colId, + 'y' => $maxY, + 'page' => $maxPage + ]; + } + + /** + * Used for reset afterColsLinePositions var in start of a new pdf draw line loop + * @param float $y the new $y position usually get by TCPDF::GetY() + * @param int $pageNumb the page number to reset at + * @return void + */ + public function resetAfterColsLinePositionsData(float $y, int $pageNumb) + { + $this->afterColsLinePositions = []; + $this->setAfterColsLinePositionsData('startLine', $y, $pageNumb); + } + + /** + * Used for to set afterColsLinePositions var in a pdf draw line loop + * @param string $colId the column id used as key in $this->cols or an unique id code like startLine or separateLine .... + * @param float $y the $y position usually get by TCPDF::GetY() where print data ended + * @param int $pageNumb the page number where print data ended + * @return void + */ + public function setAfterColsLinePositionsData(string $colId, float $y, int $pageNumb) + { + $this->afterColsLinePositions[$colId] = [ + 'page' => $pageNumb, + 'y' => $y + ]; + } + + /** * uasort callback function to Sort columns fields * @@ -1466,6 +1529,7 @@ abstract class CommonDocGenerator // set cell padding with column content definition $pdf->setCellPaddings(isset($colDef['content']['padding'][3]) ? $colDef['content']['padding'][3] : 0, isset($colDef['content']['padding'][0]) ? $colDef['content']['padding'][0] : 0, isset($colDef['content']['padding'][1]) ? $colDef['content']['padding'][1] : 0, isset($colDef['content']['padding'][2]) ? $colDef['content']['padding'][2] : 0); $pdf->writeHTMLCell($colDef['width'], 2, isset($colDef['xStartPos']) ? $colDef['xStartPos'] : 0, $curY, $columnText, 0, 1, 0, true, $colDef['content']['align']); + $this->setAfterColsLinePositionsData($colKey, $pdf->GetY(), $pdf->getPage()); // restore cell padding $pdf->setCellPaddings($curentCellPaddinds['L'], $curentCellPaddinds['T'], $curentCellPaddinds['R'], $curentCellPaddinds['B']); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 729e383e1db..caa1db00df2 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -140,7 +140,7 @@ abstract class 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(); @@ -6604,14 +6604,14 @@ abstract class CommonObject * Data to describe values to insert/update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) * This function delete record with all extrafields and insert them again from the array $this->array_options. * - * @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY) + * @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY). Must be used for action 'update_extras'. For other actions, trigger is called explicitly by caller. * @param User $userused Object user * @return int<-1,1> -1=error, O=did nothing, 1=OK * @see insertExtraLanguages(), updateExtraField(), deleteExtraField(), setValueFrom() */ public function insertExtraFields($trigger = '', $userused = null) { - global $conf, $langs, $user; + global $langs, $user; if (getDolGlobalString('MAIN_EXTRAFIELDS_DISABLED')) { return 0; @@ -7620,7 +7620,7 @@ abstract class CommonObject } elseif (in_array($type, array('real'))) { $out = ''; } elseif (preg_match('/varchar/', (string) $type)) { - $out = ' 0 ? ' maxlength="'.$size.'"' : '').' value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($placeholder?' placeholder="'.dolPrintHTMLForAttribute($placeholder).'"':'').($autofocusoncreate ? ' autofocus' : '').'>'; + $out = ' 0 ? ' maxlength="'.$size.'"' : '').' value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($placeholder ? ' placeholder="'.dolPrintHTMLForAttribute($placeholder).'"' : '').($autofocusoncreate ? ' autofocus' : '').'>'; } elseif (in_array($type, array('email', 'mail', 'phone', 'url', 'ip'))) { $out = ''; } elseif (preg_match('/^text/', (string) $type)) { @@ -8915,7 +8915,7 @@ abstract class CommonObject /** * Return validation test result for a field * - * @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 Array of properties of field to show + * @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 Array of properties of field to show * @param string $fieldKey Key of attribute * @param string $fieldValue Value of attribute * @return bool Return false if fail true on success, see $this->error for error message diff --git a/htdocs/core/class/commonorder.class.php b/htdocs/core/class/commonorder.class.php index f7c59dc8277..5fbf92c7446 100644 --- a/htdocs/core/class/commonorder.class.php +++ b/htdocs/core/class/commonorder.class.php @@ -183,6 +183,7 @@ abstract class CommonOrderLine extends CommonObjectLine * Unit price * @deprecated * @see $subprice + * @var float */ public $price; @@ -194,7 +195,7 @@ abstract class CommonOrderLine extends CommonObjectLine /** * Type of the product. 0 for product 1 for service - * @var int + * @var int<0,1> */ public $product_type = 0; @@ -234,7 +235,13 @@ abstract class CommonOrderLine extends CommonObjectLine */ public $localtax2_tx; + /** + * @var string + */ public $localtax1_type; + /** + * @var string + */ public $localtax2_type; /** diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index 0efdc0fc5c7..0d28daa0958 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -76,7 +76,7 @@ class DefaultValues 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' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 7d90b55bfad..3a695df5e97 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -181,6 +181,12 @@ class DiscountAbsolute extends CommonObject */ public $type_invoice_supplier_source; + /* Customer Discount */ + const TYPE_CUSTOMER = 0; + + /* Supplier Discount */ + const TYPE_SUPPLIER = 1; + /** * Constructor * diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index ca71e0df442..79cff89f228 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1213,8 +1213,8 @@ class DolGraph $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 5d98275fa21..fb2f9a289e4 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 3331cceedfa..d1f80baadb2 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 e33f64cd293..ecb4ada7f88 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -47,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(); @@ -651,7 +651,7 @@ class ExtraFields * @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 @@ -1500,9 +1500,9 @@ class ExtraFields $sqlwhere .= ' AND entity = '.((int) $conf->entity); } $sql .= $sqlwhere; - //print $sql; $sql .= $this->db->order(implode(',', $fields_label)); + //print $sql; dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 8a7022106be..8cef23ff282 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -232,7 +232,7 @@ class HookManager // 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 f149cc85e4a..61763c5af9a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7158,10 +7158,11 @@ class Form * @param string $labeladddateof Label to use for the $adddateof parameter. Deprecated. Used only when $adddateof is not an array. * @param string $placeholder Placeholder * @param 'auto'|'gmt'|'tzserver'|'tzuserrel' $gm 'auto' (for backward compatibility, avoid this), 'gmt' or 'tzserver' or 'tzuserrel' + * @param string $calendarpicto URL of the icon/image used to display the calendar * @return string Html for selectDate * @see form_date(), select_month(), select_year(), select_dayofweek() */ - public function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '', $openinghours = '', $stepminutes = 1, $labeladddateof = '', $placeholder = '', $gm = 'auto') + public function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '', $openinghours = '', $stepminutes = 1, $labeladddateof = '', $placeholder = '', $gm = 'auto', $calendarpicto = '') { global $conf, $langs; @@ -7312,9 +7313,10 @@ class Form } // Note: We don't need monthNames, monthNamesShort, dayNames, dayNamesShort, dayNamesMin, they are set globally on datepicker component in lib_head.js.php if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) { + $buttonImage = $calendarpicto ?: DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png"; $retstring .= " showOn: 'button', /* both has problem with autocompletion */ - buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png', + buttonImage: '" . $buttonImage . "', buttonImageOnly: true"; } $retstring .= " diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 52d4519caea..8c7524cd1a2 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -840,39 +840,6 @@ class FormFile $morecss = 'maxwidth100'; } $out .= $form->selectarray('model', $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', $morecss, 1, '', 0, 0); - // script for select the separator - /* TODO This must appear on export feature only - $out .= ''; - $out .= ''; - $out .= ''; - - $out .= ''; - */ if ($conf->use_javascript_ajax) { $out .= ajax_combobox('model'); } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index b43d9f57fac..c9475f163ab 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -2251,30 +2251,30 @@ class ModelMail 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' => 10, 'notnull' => 1, "visible" => "-1",), - "module" => array("type" => "varchar(32)", "label" => "Module", "enabled" => "1", 'position' => 20, 'notnull' => 0, "visible" => "-1",), - "type_template" => array("type" => "varchar(32)", "label" => "Typetemplate", "enabled" => "1", 'position' => 25, 'notnull' => 0, "visible" => "-1",), - "lang" => array("type" => "varchar(6)", "label" => "Lang", "enabled" => "1", 'position' => 30, 'notnull' => 0, "visible" => "-1",), - "private" => array("type" => "smallint(6)", "label" => "Private", "enabled" => "1", 'position' => 35, 'notnull' => 1, "visible" => "-1",), - "fk_user" => array("type" => "integer:User:user/class/user.class.php", "label" => "Fkuser", "enabled" => "1", 'position' => 40, 'notnull' => 0, "visible" => "-1", "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150",), - "datec" => array("type" => "datetime", "label" => "DateCreation", "enabled" => "1", 'position' => 45, 'notnull' => 0, "visible" => "-1",), - "tms" => array("type" => "timestamp", "label" => "DateModification", "enabled" => "1", 'position' => 50, 'notnull' => 1, "visible" => "-1",), - "label" => array("type" => "varchar(255)", "label" => "Label", "enabled" => "1", 'position' => 55, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1", "css" => "minwidth300", "cssview" => "wordbreak", "csslist" => "tdoverflowmax150",), - "position" => array("type" => "smallint(6)", "label" => "Position", "enabled" => "1", 'position' => 60, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), - "active" => array("type" => "integer", "label" => "Active", "enabled" => "1", 'position' => 65, 'notnull' => 1, "visible" => "-1", "alwayseditable" => "1",), - "topic" => array("type" => "text", "label" => "Topic", "enabled" => "1", 'position' => 70, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), - "content" => array("type" => "mediumtext", "label" => "Content", "enabled" => "1", 'position' => 75, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), - "content_lines" => array("type" => "text", "label" => "Contentlines", "enabled" => "getDolGlobalString('MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES')", 'position' => 80, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), - "enabled" => array("type" => "varchar(255)", "label" => "Enabled", "enabled" => "1", 'position' => 85, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), - "joinfiles" => array("type" => "varchar(255)", "label" => "Joinfiles", "enabled" => "1", 'position' => 90, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), - "email_from" => array("type" => "varchar(255)", "label" => "Emailfrom", "enabled" => "1", 'position' => 95, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), - "email_to" => array("type" => "varchar(255)", "label" => "Emailto", "enabled" => "1", 'position' => 100, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), - "email_tocc" => array("type" => "varchar(255)", "label" => "Emailtocc", "enabled" => "1", 'position' => 105, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), - "email_tobcc" => array("type" => "varchar(255)", "label" => "Emailtobcc", "enabled" => "1", 'position' => 110, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), - "defaultfortype" => array("type" => "smallint(6)", "label" => "Defaultfortype", "enabled" => "1", 'position' => 115, 'notnull' => 0, "visible" => "-1", "alwayseditable" => "1",), + "rowid" => array("type" => "integer", "label" => "TechnicalID", 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => -1,), + "module" => array("type" => "varchar(32)", "label" => "Module", 'enabled' => 1, 'position' => 20, 'notnull' => 0, 'visible' => -1,), + "type_template" => array("type" => "varchar(32)", "label" => "Typetemplate", 'enabled' => 1, 'position' => 25, 'notnull' => 0, 'visible' => -1,), + "lang" => array("type" => "varchar(6)", "label" => "Lang", 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => -1,), + "private" => array("type" => "smallint(6)", "label" => "Private", 'enabled' => 1, 'position' => 35, 'notnull' => 1, 'visible' => -1,), + "fk_user" => array("type" => "integer:User:user/class/user.class.php", "label" => "Fkuser", 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150",), + "datec" => array("type" => "datetime", "label" => "DateCreation", 'enabled' => 1, 'position' => 45, 'notnull' => 0, 'visible' => -1,), + "tms" => array("type" => "timestamp", "label" => "DateModification", 'enabled' => 1, 'position' => 50, 'notnull' => 1, 'visible' => -1,), + "label" => array("type" => "varchar(255)", "label" => "Label", 'enabled' => 1, 'position' => 55, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1, "css" => "minwidth300", "cssview" => "wordbreak", "csslist" => "tdoverflowmax150",), + "position" => array("type" => "smallint(6)", "label" => "Position", 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), + "active" => array("type" => "integer", "label" => "Active", 'enabled' => 1, 'position' => 65, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1,), + "topic" => array("type" => "text", "label" => "Topic", 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), + "content" => array("type" => "mediumtext", "label" => "Content", 'enabled' => 1, 'position' => 75, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), + "content_lines" => array("type" => "text", "label" => "Contentlines", "enabled" => "getDolGlobalString('MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES')", 'position' => 80, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), + "enabled" => array("type" => "varchar(255)", "label" => "Enabled", 'enabled' => 1, 'position' => 85, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), + "joinfiles" => array("type" => "varchar(255)", "label" => "Joinfiles", 'enabled' => 1, 'position' => 90, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), + "email_from" => array("type" => "varchar(255)", "label" => "Emailfrom", 'enabled' => 1, 'position' => 95, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), + "email_to" => array("type" => "varchar(255)", "label" => "Emailto", 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), + "email_tocc" => array("type" => "varchar(255)", "label" => "Emailtocc", 'enabled' => 1, 'position' => 105, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), + "email_tobcc" => array("type" => "varchar(255)", "label" => "Emailtobcc", 'enabled' => 1, 'position' => 110, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), + "defaultfortype" => array("type" => "smallint(6)", "label" => "Defaultfortype", 'enabled' => 1, 'position' => 115, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,), ); /** * @var int diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 36dc92fcce1..5537893d372 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -109,6 +109,7 @@ class FormMargin if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) { // Special case for old situation mode '@phan-var-force Facture $object'; + /** @var Facture $object */ if (($object->element == 'facture' && $object->type == $object::TYPE_SITUATION) || ($object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE && getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE') && $object->situation_counter > 0)) { // We need a compensation relative to $line->situation_percent diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index e920f35f098..6b1ab1cb007 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -1331,12 +1331,25 @@ class FormSetupItem public function generateOutputFieldColor() { global $langs; + $out = ''; $this->fieldAttr['disabled'] = null; $color = colorArrayToHex(colorStringToArray($this->fieldValue, array()), ''); - if ($color) { - return ''; + $useDefaultColor = false; + if (!$color && !empty($this->defaultFieldValue)) { + $color = $this->defaultFieldValue; + $useDefaultColor = true; } - return $langs->trans("Default"); + if ($color) { + $out.= ''; + } + + if ($useDefaultColor) { + $out.= ' '.$langs->trans("Default"); + } else { + $out.= ' #'.$color; + } + + return $out; } /** * generateInputFieldColor diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 30664b90218..348fe8a81e0 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -895,7 +895,7 @@ class FormTicket $ticketstat->loadCacheTypesTickets(); print ''; } print ''; + if (!$i) { + $totalarray['nbfield']++; + } } // Ref if (!empty($arrayfields['cf.ref']['checked'])) { @@ -2120,9 +2123,9 @@ if ($resql) { print ''; } print ''; - } - if (!$i) { - $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } } print "\n"; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index c5694200c8a..34349e99a91 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1347,7 +1347,7 @@ if (empty($reshook)) { } $tva_tx = $lines[$i]->tva_tx; - if (!empty($lines[$i]->vat_src_code) && !preg_match('/\(/', $tva_tx)) { + if (!empty($lines[$i]->vat_src_code) && !preg_match('/\(/', (string) $tva_tx)) { $tva_tx .= ' ('.$lines[$i]->vat_src_code.')'; } @@ -3595,7 +3595,7 @@ if ($action == 'create') { print ''; - // List of payments + // List of payments already done $totalpaid = 0; @@ -3649,8 +3649,8 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; if (isModEnabled("bank")) { print ''; } @@ -4172,7 +4172,7 @@ if ($action == 'create') { $urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id; $genallowed = $usercanread; $delallowed = $usercancreate; - $modelpdf = (!empty($object->model_pdf) ? $object->model_pdf : (!getDolGlobalString('INVOICE_SUPPLIER_ADDON_PDF') ? '' : $conf->global->INVOICE_SUPPLIER_ADDON_PDF)); + $modelpdf = (empty($object->model_pdf) ? getDolGlobalString('INVOICE_SUPPLIER_ADDON_PDF') : $object->model_pdf); print $formfile->showdocuments('facture_fournisseur', $subdir, $filedir, $urlsource, $genallowed, $delallowed, $modelpdf, 1, 0, 0, 40, 0, '', '', '', $societe->default_lang); $somethingshown = $formfile->numoffiles; diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index 78dc1efbeb1..d15646059f3 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -47,9 +47,10 @@ if (isModEnabled('project')) { $langs->loadLangs(array("bills", "other", "companies")); -$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); -$ref = GETPOST('ref', 'alpha'); +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); +$socid = GETPOSTINT('socid'); // Security check if ($user->socid) { diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index f02cb35d18e..8c52413f4a5 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -13,7 +13,7 @@ * Copyright (C) 2021 Charlene Benke * Copyright (C) 2022 Udo Tamm * Copyright (C) 2023 Sylvain Legrand - * 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 @@ -157,17 +157,18 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } +$formquestion = array(); if (empty($reshook)) { if (($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm == 'yes')) && $permissiontoadd) { - $datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + $datepaye = GETPOSTDATE('re', '12:00:00'); $paiement_id = 0; $totalpayment = 0; $atleastonepaymentnotnull = 0; $multicurrency_totalpayment = 0; - $formquestion = array(); // Generate payment array and check if there is payment higher than invoice and payment date before invoice date $tmpinvoice = new FactureFournisseur($db); + $i = 0; foreach ($_POST as $key => $value) { if (substr($key, 0, 7) == 'amount_') { $cursorfacid = substr($key, 7); @@ -187,7 +188,7 @@ if (empty($reshook)) { $amountsresttopay[$cursorfacid] = price2num($tmpinvoice->total_ttc - $tmpinvoice->getSommePaiement()); if ($amounts[$cursorfacid]) { // Check amount - if ($amounts[$cursorfacid] && (abs((float) $amounts[$cursorfacid]) > abs((float) $amountsresttopay[$cursorfacid]))) { + if ((abs((float) $amounts[$cursorfacid]) > abs((float) $amountsresttopay[$cursorfacid]))) { $addwarning = 1; $formquestion['text'] = img_warning($langs->trans("PaymentHigherThanReminderToPaySupplier")).' '.$langs->trans("HelpPaymentHigherThanReminderToPaySupplier"); } @@ -214,7 +215,7 @@ if (empty($reshook)) { $multicurrency_amountsresttopay[$cursorfacid] = price2num($tmpinvoice->multicurrency_total_ttc - $tmpinvoice->getSommePaiement(1)); if ($multicurrency_amounts[$cursorfacid]) { // Check amount - if ($multicurrency_amounts[$cursorfacid] && (abs((float) $multicurrency_amounts[$cursorfacid]) > abs((float) $multicurrency_amountsresttopay[$cursorfacid]))) { + if ((abs((float) $multicurrency_amounts[$cursorfacid]) > abs((float) $multicurrency_amountsresttopay[$cursorfacid]))) { $addwarning = 1; $formquestion['text'] = img_warning($langs->trans("PaymentHigherThanReminderToPaySupplier")).' '.$langs->trans("HelpPaymentHigherThanReminderToPaySupplier"); } @@ -304,10 +305,6 @@ if (empty($reshook)) { $multicurrency_tx[$key] = $tmpinvoice->multicurrency_tx; } - //var_dump($amounts); - //var_dump($multicurrency_amounts); - //exit; - if (!$error) { $db->begin(); @@ -318,31 +315,29 @@ if (empty($reshook)) { // Creation of payment line $paiement = new PaiementFourn($db); - $paiement->datepaye = $datepaye; + $paiement->datepaye = $datepaye; $correctedAmounts = []; foreach ($amounts as $key => $value) { $correctedAmounts[$key] = (float) $value; } - $paiement->amounts = $correctedAmounts; // Array of amounts + $paiement->amounts = $correctedAmounts; // Array of amounts $paiement->multicurrency_amounts = $multicurrency_amounts; $paiement->multicurrency_code = $multicurrency_code; // Array with all currency of payments dispatching $paiement->multicurrency_tx = $multicurrency_tx; // Array with all currency tx of payments dispatching - $paiement->paiementid = GETPOSTINT('paiementid'); - $paiement->num_payment = GETPOST('num_paiement', 'alphanohtml'); + $paiement->paiementid = GETPOSTINT('paiementid'); + $paiement->num_payment = GETPOST('num_paiement', 'alphanohtml'); $paiement->note_private = GETPOST('comment', 'alpha'); - $paiement->fk_account = GETPOSTINT('accountid'); + $paiement->fk_account = GETPOSTINT('accountid'); - if (!$error) { - // Create payment and update this->multicurrency_amounts if this->amounts filled or - // this->amounts if this->multicurrency_amounts filled. - // This also set ->amount and ->multicurrency_amount - $paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices') == 'on' ? 1 : 0), $thirdparty); - if ($paiement_id < 0) { - setEventMessages($paiement->error, $paiement->errors, 'errors'); - $error++; - } + // Create payment and update this->multicurrency_amounts if this->amounts filled or + // this->amounts if this->multicurrency_amounts filled. + // This also set ->amount and ->multicurrency_amount + $paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices') == 'on' ? 1 : 0), $thirdparty); + if ($paiement_id < 0) { + setEventMessages($paiement->error, $paiement->errors, 'errors'); + $error++; } if (!$error) { @@ -543,8 +538,11 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
'.($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('BankAccount').'
'; print dol_get_fiche_end(); - - $parameters = array('facid' => $facid, 'ref' => $ref, 'objcanvas' => $objcanvas); + $parameters = array( + 'facid' => $facid, + // 'ref' => $ref, + // 'objcanvas' => $objcanvas, + ); $reshook = $hookmanager->executeHooks('paymentsupplierinvoices', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks $error = $hookmanager->error; $errors = $hookmanager->errors; @@ -639,6 +637,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT'); // Multicurrency Price + $multicurrency_payment = 0; + $multicurrency_creditnotes = 0; + $multicurrency_deposits = 0; + $multicurrency_remaintopay = 0; if (isModEnabled("multicurrency")) { $multicurrency_payment = $invoice->getSommePaiement(1); $multicurrency_creditnotes = $invoice->getSumCreditNotesUsed(1); @@ -801,8 +803,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ' '; print ''; } - print ''.price($sign * $total_ttc).''; - print ''.price($sign * $totalrecu); + print ''.price($total_ttc).''; + print ''.price($totalrecu); if ($totalrecucreditnote) { print '+'.price($totalrecucreditnote); } @@ -810,7 +812,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '+'.price($totalrecudeposits); } print ''; - print ''.price($sign * (float) price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).''; + print ''.price((float) price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).''; print ''; // Autofilled print "\n"; } @@ -838,6 +840,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $preselectedchoice = $addwarning ? 'no' : 'yes'; print '
'; + $text = ''; if (!empty($totalpayment)) { $text = $langs->trans('ConfirmSupplierPayment', price($totalpayment), $langs->transnoentitiesnoconv("Currency".$conf->currency)); } diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 95bb39f7f3f..29595dc17a2 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -85,11 +85,11 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); +$canread = 0; if (($id > 0) || $ref) { $object->fetch($id, $ref); // Check current user can read this leave request - $canread = 0; if ($user->hasRight('holiday', 'readall')) { $canread = 1; } @@ -169,10 +169,10 @@ if (empty($reshook)) { $db->begin(); - $date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year')); - $date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year')); - $date_debut_gmt = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'), 1); - $date_fin_gmt = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'), 1); + $date_debut = GETPOSTDATE('date_debut_', '00:00:00'); + $date_fin = GETPOSTDATE('date_fin_', '00:00:00'); + $date_debut_gmt = GETPOSTDATE('date_debut_', '00:00:00', 1); + $date_fin_gmt = GETPOSTDATE('date_fin_', '00:00:00', 1); $starthalfday = GETPOST('starthalfday'); $endhalfday = GETPOST('endhalfday'); $type = GETPOST('type'); @@ -325,10 +325,10 @@ if (empty($reshook)) { } if ($action == 'update' && !GETPOSTISSET('savevalidator')) { // Test on permission done later - $date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year')); - $date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year')); - $date_debut_gmt = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'), 1); - $date_fin_gmt = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'), 1); + $date_debut = GETPOSTDATE('date_debut_', '00:00:00'); + $date_fin = GETPOSTDATE('date_fin_', '00:00:00'); + $date_debut_gmt = GETPOSTDATE('date_debut_', '00:00:00', 1); + $date_fin_gmt = GETPOSTDATE('date_fin_', '00:00:00', 1); $starthalfday = GETPOST('starthalfday'); $endhalfday = GETPOST('endhalfday'); $halfday = 0; @@ -542,6 +542,9 @@ if (empty($reshook)) { } elseif ($object->halfday == 0 || $object->halfday == 2) { $starthalfdaykey = "Morning"; $endhalfdaykey = "Afternoon"; + } else { + $starthalfdaykey = ""; + $endhalfdaykey = ""; } $link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id; @@ -1154,7 +1157,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { if (!GETPOST('date_debut_')) { // If visitor does not come from agenda print $form->selectDate(-1, 'date_debut_', 0, 0, 0, '', 1, 1); } else { - $tmpdate = dol_mktime(0, 0, 0, GETPOSTINT('date_debut_month'), GETPOSTINT('date_debut_day'), GETPOSTINT('date_debut_year')); + $tmpdate = GETPOSTDATE('date_debut_', '00:00:00'); print $form->selectDate($tmpdate, 'date_debut_', 0, 0, 0, '', 1, 1); } print '     '; @@ -1171,7 +1174,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { if (!GETPOST('date_fin_')) { print $form->selectDate(-1, 'date_fin_', 0, 0, 0, '', 1, 1); } else { - $tmpdate = dol_mktime(0, 0, 0, GETPOSTINT('date_fin_month'), GETPOSTINT('date_fin_day'), GETPOSTINT('date_fin_year')); + $tmpdate = GETPOSTDATE('date_fin_', '00:00:00'); print $form->selectDate($tmpdate, 'date_fin_', 0, 0, 0, '', 1, 1); } print '     '; @@ -1349,7 +1352,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { print $form->textwithpicto($langs->trans('DateDebCP'), $langs->trans("FirstDayOfHoliday")); print ''; print ''; - $tmpdate = dol_mktime(0, 0, 0, GETPOSTINT('date_debut_month'), GETPOSTINT('date_debut_day'), GETPOSTINT('date_debut_year')); + $tmpdate = GETPOSTDATE('date_debut_', '00:00:00'); print $form->selectDate($tmpdate ? $tmpdate : $object->date_debut, 'date_debut_'); print '     '; print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday') ? GETPOST('starthalfday') : $starthalfday)); @@ -1650,9 +1653,8 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { print '
'; print ''; // ancre - $includedocgeneration = 0; - // Documents + /* $includedocgeneration = 0; if ($includedocgeneration) { $objref = dol_sanitizeFileName($object->ref); $relativepath = $objref.'/'.$objref.'.pdf'; @@ -1661,7 +1663,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { $genallowed = ($user->hasRight('holiday', 'read') && $object->fk_user == $user->id) || $user->hasRight('holiday', 'readall'); // If you can read, you can build the PDF to read content $delallowed = ($user->hasRight('holiday', 'write') && $object->fk_user == $user->id) || $user->hasRight('holiday', 'writeall_advance'); // If you can create/edit, you can remove a file on card print $formfile->showdocuments('holiday:Holiday', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); - } + } */ // Show links to link elements //$tmparray = $form->showLinkToObjectBlock($object, null, array('myobject'), 1); diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index d22748bac0f..6bf9412b5bc 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -92,12 +92,12 @@ class Evaluation 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' => 'left', 'comment' => "Id"), 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 4, 'noteditable' => 1, 'default' => '(PROV)', 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'comment' => "Reference of object"), - 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => '2',), + 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2,), '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,), @@ -106,7 +106,7 @@ class Evaluation extends CommonObject 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php:0', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',), 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php:0', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2,), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,), - 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '0', 'visible' => 5, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '6' => 'Closed'),), + 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '0', 'visible' => 5, 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 6 => 'Closed'),), 'date_eval' => array('type' => 'date', 'label' => 'DateEval', 'enabled' => 1, 'position' => 502, 'notnull' => 1, 'visible' => 1,), 'fk_user' => array('type' => 'integer:User:user/class/user.class.php:0:(t.statut:!=:0)', 'label' => 'Employee', 'enabled' => 1, 'position' => 504, 'notnull' => 1, 'visible' => 1, 'picto' => 'user', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), 'fk_job' => array('type' => 'integer:Job:/hrm/class/job.class.php', 'label' => 'JobProfile', 'enabled' => 1, 'position' => 505, 'notnull' => 1, 'visible' => 1, 'picto' => 'jobprofile', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 48b85070bd8..1fbfd90531b 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -101,7 +101,7 @@ class EvaluationLine 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' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 1e39ecae61d..f83322621c4 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -90,7 +90,7 @@ class Job 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' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index af171a8857b..50705c1ece5 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -89,7 +89,7 @@ class Position 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, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index 0420da07873..6d6813b2c01 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -95,7 +95,7 @@ class Skill 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' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index 9beb444b05f..541ff986902 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -99,7 +99,7 @@ class Skilldet 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' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 6b84858021d..ea94f72fa88 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -93,7 +93,7 @@ class SkillRank 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' => 'left', 'comment' => "Id"), diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php index 5bca6f0940a..a1a232107fb 100644 --- a/htdocs/intracommreport/class/intracommreport.class.php +++ b/htdocs/intracommreport/class/intracommreport.class.php @@ -101,7 +101,7 @@ class IntracommReport 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 of properties of field to show + * @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 of properties of field to show */ public $fields = array( "rowid" => array("type" => "integer", "label" => "TechnicalID", "enabled" => 1, 'position' => 10, 'notnull' => 1, "visible" => "0",), diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 55c14201092..5cbcdc6efce 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -88,7 +88,7 @@ class KnowledgeRecord 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' => 'left', 'comment' => "Id"), @@ -107,7 +107,7 @@ class KnowledgeRecord extends CommonObject //'url' => array('type'=>'varchar(255)', 'label'=>'URL', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflow200', 'help'=>'UrlForInfoPage'), 'fk_c_ticket_category' => array('type' => 'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos', 'label' => 'SuggestedForTicketsInGroup', 'enabled' => 'isModEnabled("ticket")', 'position' => 520, 'notnull' => 0, 'visible' => -1, 'help' => 'YouCanLinkArticleToATicketCategory', 'csslist' => 'minwidth200 tdoverflowmax250'), 'answer' => array('type' => 'html', 'label' => 'Solution', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => 3, 'searchall' => 1, 'csslist' => 'tdoverflowmax300', 'copytoclipboard' => 1, 'tdcss' => 'titlefieldcreate nowraponall'), - 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'visible' => 5, 'default' => '0', 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '9' => 'Obsolete'),), + 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'visible' => 5, 'default' => '0', 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 9 => 'Obsolete'),), ); /** * @var int diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 4e6e1feef22..e6f04f74572 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -421,6 +421,7 @@ InvoiceAutoValidate=Validate invoices automatically GeneratedFromRecurringInvoice=Generated from template recurring invoice %s DateIsNotEnough=Date not reached yet InvoiceGeneratedFromTemplate=Invoice %s generated from recurring template invoice %s +InvoiceGeneratedFromTemplateError=Error Invoice %s generated from recurring template invoice %s : %s GeneratedFromTemplate=Generated from template invoice %s WarningInvoiceDateInFuture=Warning, the invoice date is higher than current date WarningInvoiceDateTooFarInFuture=Warning, the invoice date is too far from current date @@ -522,6 +523,7 @@ SendTo=sent to PaymentByTransferOnThisBankAccount=Payment by transfer to the following bank account VATIsNotUsedForInvoice=* Non applicable VAT art-293B of CGI VATIsNotUsedForInvoiceAsso=* Non applicable VAT art-261-7 of CGI +VATIsNotUsedReverseChargeProcedure=* Non applicable VAT art-259-1 of CGI LawApplicationPart1=By application of the law 80.335 of 12/05/80 LawApplicationPart2=the goods remain the property of LawApplicationPart3=the seller until full payment of @@ -666,6 +668,7 @@ MentionCategoryOfOperations0=Delivery of goods MentionCategoryOfOperations1=Provision of services MentionCategoryOfOperations2=Mixed - Delivery of goods & provision of services Salaries=Salaries +InvoiceSubtype=Invoice Subtype SalaryInvoice=Salary BillsAndSalaries=Bills & Salaries CreateCreditNoteWhenClientInvoiceExists=This option is enabled only when validated invoice(s) exist for a customer or when constant INVOICE_CREDIT_NOTE_STANDALONE is used(useful for some countries) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 1c6073a0189..0e6576f3176 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -349,6 +349,7 @@ ErrorUserClone=Error when clone categories user ErrorQtyOrderedLessQtyShipped = The quantity ordered cannot be less than the quantity shipped. ErrorVariousPaymentOnBankAccountWithADifferentCurrencyNotYetSupported=Error, creating a various payment on a bank account with a currency different than the currency of the company is not yet supported. ErrorStreamMustBeEnabled=The PHP stream %s is not available. Check your PHP modules and Dolibarr parameter $dolibarr_main_stream_to_disable. +ErrorYouTryToPayInvoicesWithDifferentCurrenciesInSamePayment=Error, you try to pay different invoices with different currencies in the same payment # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index fd303eff68b..61884ad2d54 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -95,6 +95,9 @@ ProductsToConsume=Products to consume ProductsToProduce=Products to produce UnitCost=Unit cost TotalCost=Total cost +ManufacturingCost=Manufacturing cost +ManufacturingUnitCost=Unit manufacturing cost +ManufacturingGeneratedValue=Manufacturing value generated BOMTotalCost=The cost to produce this BOM based on cost of each quantity and product to consume (use Cost price if defined, else Average Weighted Price if defined, else the Best purchase price) BOMTotalCostService=If the "Workstation" module is activated and a workstation is defined by default on the line, then the calculation is "quantity (converted into hours) x workstation ahr", otherwise "quantity x cost price of the service" GoOnTabProductionToProduceFirst=You must first have started the production to close a Manufacturing Order (See tab '%s'). But you can Cancel it. diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 62346cd3976..cd06cb211ef 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -111,24 +111,24 @@ class MyObject extends CommonObject * 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, "index" => 1, "searchall" => 1, "showoncombobox" => 1, "validate" => 1, "comment" => "Reference of object"), - "label" => array("type" => "varchar(255)", "label" => "Label", "enabled" => 1, 'position' => 30, 'notnull' => 0, "visible" => 1, "alwayseditable" => "1", "searchall" => 1, "css" => "minwidth300", "cssview" => "wordbreak", "help" => "Help text", "showoncombobox" => "2", "validate" => 1,), - "amount" => array("type" => "price", "label" => "Amount", "enabled" => 1, 'position' => 40, 'notnull' => 0, "visible" => 1, "default" => "null", "isameasure" => 1, "help" => "Help text for amount", "validate" => 1,), - "qty" => array("type" => "real", "label" => "Qty", "enabled" => 1, 'position' => 45, 'notnull' => 0, "visible" => 1, "default" => "0", "isameasure" => 1, "css" => "maxwidth75imp", "help" => "Help text for quantity", "validate" => 1,), - "fk_soc" => array("type" => "integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))", "label" => "ThirdParty", "picto" => "company", "enabled" => "isModEnabled('societe')", 'position' => 50, 'notnull' => -1, "visible" => 1, "index" => 1, "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150", "help" => "OrganizationEventLinkToThirdParty", "validate" => 1,), - "fk_project" => array("type" => "integer:Project:projet/class/project.class.php:1", "label" => "Project", "picto" => "project", "enabled" => "isModEnabled('project')", 'position' => 52, 'notnull' => -1, "visible" => "-1", "index" => 1, "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150", "validate" => 1,), - "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,), - "fk_user_creat" => array("type" => "integer:User:user/class/user.class.php", "label" => "UserAuthor", "picto" => "user", "enabled" => 1, 'position' => 510, 'notnull' => 1, "visible" => -2, "foreignkey" => "0", "csslist" => "tdoverflowmax150",), - "fk_user_modif" => array("type" => "integer:User:user/class/user.class.php", "label" => "UserModif", "picto" => "user", "enabled" => 1, 'position' => 511, 'notnull' => -1, "visible" => -2, "csslist" => "tdoverflowmax150",), - "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" => "integer", "label" => "Status", "enabled" => 1, 'position' => 2000, 'notnull' => 1, "visible" => 1, "index" => 1, "arrayofkeyval" => array("0" => "Draft", "1" => "Validated", "9" => "Canceled"), "validate" => 1,), + '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, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1, 'comment' => 'Reference of object'), + 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 1, 'alwayseditable' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => 'Help text', 'showoncombobox' => 2, 'validate' => 1,), + 'amount' => array('type' => 'price', 'label' => 'Amount', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => 1, 'default' => 'null', 'isameasure' => 1, 'help' => 'Help text for amount', 'validate' => 1,), + 'qty' => array('type' => 'real', 'label' => 'Qty', 'enabled' => 1, 'position' => 45, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'css' => 'maxwidth75imp', 'help' => 'Help text for quantity', 'validate' => 1,), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label' => 'ThirdParty', 'picto' => 'company', 'enabled' => 'isModEnabled("societe")', 'position' => 50, 'notnull' => -1, 'visible' => 1, 'index' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150', 'help' => 'OrganizationEventLinkToThirdParty', 'validate' => 1,), + 'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1', 'label' => 'Project', 'picto' => 'project', 'enabled' => 'isModEnabled("project")', 'position' => 52, 'notnull' => -1, 'visible' => -1, 'index' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150', 'validate' => 1,), + '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,), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'picto' => 'user', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => '0', 'csslist' => 'tdoverflowmax150',), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'picto' => 'user', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2, 'csslist' => 'tdoverflowmax150',), + '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' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', '1' => 'Validated', 9 => 'Canceled'), 'validate' => 1,), ); /** diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index f9f2a2762bf..3e9bfac76cf 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -170,7 +170,7 @@ class pdf_standard_myobject extends ModelePDFMyObject public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0) { // phpcs:enable - global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines; + global $user, $langs, $conf, $mysoc, $hookmanager, $nblines; dol_syslog("write_file outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang : 'null')); @@ -856,8 +856,8 @@ class pdf_standard_myobject extends ModelePDFMyObject * Show table for lines * * @param TCPDF|TCPDI $pdf Object PDF - * @param int $tab_top Top position of table - * @param int $tab_height Height of table (rectangle) + * @param float $tab_top Top position of table + * @param float $tab_height Height of table (rectangle) * @param int $nexY Y (not used) * @param Translate $outputlangs Langs object * @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title diff --git a/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php b/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php index 47d372c68ab..009d9876cb2 100644 --- a/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php +++ b/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php @@ -1,6 +1,7 @@ - * Copyright (C) 2024 MDW +/* Copyright (C) 2019 Laurent Destailleur + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * Copyright (C) ---Replace with your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify @@ -17,6 +18,11 @@ * along with this program. If not, see . */ +/** + * @var CommonObject $object + * @var Translate $langs + * @var User $user + */ // 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/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 6bde6bf10d1..864ad8adf9d 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -343,8 +343,14 @@ foreach ($search as $key => $val) { } $mode_search = 2; } - if ($search[$key] != '') { - $sql .= natural_search("t.".$db->sanitize($key), $search[$key], (($key == 'status') ? 2 : $mode_search)); + if (empty($object->fields[$key]['searchmulti'])) { + if (!is_array($search[$key]) && $search[$key] != '') { + $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (is_array($search[$key]) && !empty($search[$key])) { + $sql .= natural_search("t.".$db->escape($key), implode(',', $search[$key]), (($key == 'status') ? 2 : $mode_search)); + } } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { @@ -632,7 +638,11 @@ foreach ($object->fields as $key => $val) { if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { - print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), 1, 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1); + if (empty($val['searchmulti'])) { + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), 1, 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1); + } else { + print $form->multiselectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), 0, 0, 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1); + } } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1); } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 64048fde9d4..866051d44b2 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -82,7 +82,7 @@ class Mo 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' => -2, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index b02c662f514..8f4af567800 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -528,8 +528,6 @@ class MultiCurrency extends CommonObject */ public static function getIdAndTxFromCode($dbs, $code, $date_document = '') { - global $conf; - $sql1 = "SELECT m.rowid, mc.rate FROM ".MAIN_DB_PREFIX."multicurrency m"; $sql1 .= ' LEFT JOIN '.MAIN_DB_PREFIX.'multicurrency_rate mc ON (m.rowid = mc.fk_multicurrency)'; @@ -574,7 +572,8 @@ class MultiCurrency extends CommonObject if (!is_null($invoice_rate)) { $multicurrency_tx = $invoice_rate; } else { - $multicurrency_tx = self::getInvoiceRate($fk_facture, $table); + $tmparray = self::getInvoiceRate($fk_facture, $table); + $multicurrency_tx = $tmparray['invoice_multicurrency_tx']; } if ($multicurrency_tx) { @@ -593,18 +592,20 @@ class MultiCurrency extends CommonObject * * @param int $fk_facture id of facture * @param string $table facture or facture_fourn - * @return float|bool Rate of currency or false if error + * @return array{invoice_multicurrency_tx: float,invoice_multicurrency_code: string}|bool Rate and code of currency or false if error */ public static function getInvoiceRate($fk_facture, $table = 'facture') { global $db; - $sql = "SELECT multicurrency_tx FROM ".MAIN_DB_PREFIX.$table." WHERE rowid = ".((int) $fk_facture); + $sql = "SELECT multicurrency_tx, multicurrency_code"; + $sql .= " FROM ".MAIN_DB_PREFIX.$db->sanitize($table); + $sql .= " WHERE rowid = ".((int) $fk_facture); dol_syslog(__METHOD__, LOG_DEBUG); $resql = $db->query($sql); if ($resql && ($line = $db->fetch_object($resql))) { - return $line->multicurrency_tx; + return array('invoice_multicurrency_tx' => $line->multicurrency_tx, 'invoice_multicurrency_code' => $line->multicurrency_code); } return false; diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 3a952452586..8692dc1a3a5 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -101,7 +101,7 @@ class Opensurveysondage 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( 'id_sondage' => array('type' => 'varchar(16)', 'label' => 'Idsondage', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => -1,), diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 50ab5ce7bc3..cba1371caaf 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -99,7 +99,7 @@ class Partnership 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' => 'left', 'comment' => "Id"), @@ -123,7 +123,7 @@ class Partnership extends CommonObject 'last_check_backlink' => array('type' => 'datetime', 'label' => 'LastCheckBacklink', 'enabled' => 'getDolGlobalString("PARTNERSHIP_BACKLINKS_TO_CHECK")', 'position' => 72, 'notnull' => 0, 'visible' => -4, 'csslist' => 'nowraponall'), 'reason_decline_or_cancel' => array('type' => 'text', 'label' => 'ReasonDeclineOrCancel', 'enabled' => 1, 'position' => 73, 'notnull' => 0, 'visible' => -2,), 'ip' => array('type' => 'ip', 'label' => 'IPOfApplicant', 'enabled' => 1, 'position' => 74, 'notnull' => 0, 'visible' => -2,), - 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'visible' => 2, 'default' => '0', 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '2' => 'Approved', '3' => 'Refused', '9' => 'Terminated'),), + 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 2000, 'notnull' => 1, 'visible' => 2, 'default' => '0', 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 2 => 'Approved', 3 => 'Refused', 9 => 'Terminated'),), ); /** * @var int diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 558a6e285b6..c5ab3793d34 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -825,7 +825,7 @@ class Product 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' => -2, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 559a30f5bac..ec755c8d94c 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; class ProductCustomerPrice 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( 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 4, 'position' => 10, 'notnull' => 1, 'default' => '(PROV)', 'index' => 1, 'searchall' => 1, 'comment' => "Reference of object", 'showoncombobox' => 1, 'noteditable' => 1), diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index bf57ac8f7d4..ae5ad7fd5e9 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -81,7 +81,7 @@ class ProductFournisseurPrice 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' => 10, 'notnull' => 1, 'visible' => 0,), diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index cc256619bf5..65fd4a1c1ce 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -86,7 +86,7 @@ class Inventory 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',), @@ -835,7 +835,7 @@ class InventoryLine 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' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id',), diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index ba632ea3a59..df00f9381a6 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -108,7 +108,7 @@ if ($id > 0 || !empty($ref)) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - llxHeader("", "", $langs->trans("CardProduct".$product->type), '', 0, 0, '', '', '', '', 'mod-product page-stats_supplier_proposal'); + llxHeader("", $langs->trans("CardProduct".$product->type), '', '', 0, 0, '', '', '', 'mod-product page-stats_supplier_proposal'); if ($result > 0) { $head = product_prepare_head($product); diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 169ccd2c34f..ce953cf5a34 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -158,7 +158,7 @@ class Entrepot 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' => 'ID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 10), @@ -178,7 +178,7 @@ class Entrepot extends CommonObject //'fk_user_author' =>array('type'=>'integer', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-2, 'position'=>82), 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'position' => 300), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 301), - 'warehouse_usage' => array('type' => 'integer', 'label' => 'WarehouseUsage', 'enabled' => 'getDolGlobalInt("STOCK_USE_WAREHOUSE_USAGE")', 'visible' => 1, 'position' => 400, 'default' => 1, 'arrayofkeyval' => array(1 => 'InternalWarehouse', 2 => 'ExternalWarehouse')), + 'warehouse_usage' => array('type' => 'integer', 'label' => 'WarehouseUsage', 'enabled' => 'getDolGlobalInt("STOCK_USE_WAREHOUSE_USAGE")', 'visible' => 1, 'position' => 400, 'default' => '1', 'arrayofkeyval' => array(1 => 'InternalWarehouse', 2 => 'ExternalWarehouse')), //'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000), //'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPDF', 'enabled'=>1, 'visible'=>0, 'position'=>1010), 'statut' => array('type' => 'tinyint(4)', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'position' => 500, 'css' => 'minwidth50'), diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 86bd74c9503..fe0c342b3d9 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -144,7 +144,7 @@ class Productlot 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' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), @@ -1338,7 +1338,7 @@ class Productlot extends CommonObject /** * Return validation test result for a field * - * @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 Array of properties of field to show + * @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 Array of properties of field to show * @param string $fieldKey Key of attribute * @param string $fieldValue value of attribute * @return bool Return false if fail, true on success, set $this->error for error message diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index c684e2b0e33..a4d118e852d 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -140,7 +140,7 @@ class StockTransfer 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, 'comment' => "Id"), diff --git a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php index bcaf9d3d6f7..f1e1b546ff4 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php @@ -82,7 +82,7 @@ class StockTransferLine 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' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'comment' => "Id"), diff --git a/htdocs/projet/agenda.php b/htdocs/projet/agenda.php index 3aa654d4a65..256cf2d74a2 100644 --- a/htdocs/projet/agenda.php +++ b/htdocs/projet/agenda.php @@ -157,7 +157,7 @@ $morehtmlref .= '
'; // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 74f93c4505e..0eb947f56a6 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1365,7 +1365,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 993e6a07e68..20f33e445da 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -339,7 +339,7 @@ class Project 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' => 'ID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), @@ -368,7 +368,7 @@ class Project extends CommonObject // Properties for event organization 'date_start_event' => array('type' => 'date', 'label' => 'DateStartEvent', 'enabled' => "isModEnabled('eventorganization')", 'visible' => 1, 'position' => 200), 'date_end_event' => array('type' => 'date', 'label' => 'DateEndEvent', 'enabled' => "isModEnabled('eventorganization')", 'visible' => 1, 'position' => 201), - 'location' => array('type' => 'text', 'label' => 'Location', 'enabled' => 1, 'visible' => 3, 'position' => 55, 'searchall' => 202), + 'location' => array('type' => 'text', 'label' => 'Location', 'enabled' => 1, 'visible' => 3, 'position' => 202, 'searchall' => 1), 'accept_conference_suggestions' => array('type' => 'integer', 'label' => 'AllowUnknownPeopleSuggestConf', 'enabled' => 1, 'visible' => -1, 'position' => 210), 'accept_booth_suggestions' => array('type' => 'integer', 'label' => 'AllowUnknownPeopleSuggestBooth', 'enabled' => 1, 'visible' => -1, 'position' => 211), 'price_registration' => array('type' => 'double(24,8)', 'label' => 'PriceOfRegistration', 'enabled' => 1, 'visible' => -1, 'position' => 212), diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index e02404f9838..f116b941dcc 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -128,7 +128,7 @@ $morehtmlref .= '
'; // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($object, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index ce89643f847..4f2dde28a50 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -380,7 +380,7 @@ if ($id > 0 || !empty($ref)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 83c5416ceea..2830d46fa42 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -161,7 +161,7 @@ if ($object->id > 0) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index bed97fcfd14..6f3e138c587 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -267,7 +267,7 @@ $morehtmlref .= '
'; // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "te.rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "te.rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -1261,6 +1261,7 @@ foreach ($listofreferent as $key => $value) { } $num = count($elementarray); + $total_time = 0; for ($i = 0; $i < $num; $i++) { $tmp = explode('_', $elementarray[$i]); $idofelement = $tmp[0]; diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 12c99a354dc..33f7122723b 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -139,7 +139,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/messaging.php b/htdocs/projet/messaging.php index 065985317fa..f5d2cafb6e8 100644 --- a/htdocs/projet/messaging.php +++ b/htdocs/projet/messaging.php @@ -93,6 +93,17 @@ if (!$user->hasRight('projet', 'lire')) { * Actions */ +$object = new Project($db); + +if ($id > 0 || !empty($ref)) { + $object->fetch($id, $ref); + $object->fetch_thirdparty(); + if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object, 'fetchComments') && empty($object->comments)) { + $object->fetchComments(); + } + $object->info($object->id); +} + $parameters = array('id' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -112,16 +123,6 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' */ $form = new Form($db); -$object = new Project($db); - -if ($id > 0 || !empty($ref)) { - $object->fetch($id, $ref); - $object->fetch_thirdparty(); - if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object, 'fetchComments') && empty($object->comments)) { - $object->fetchComments(); - } - $object->info($object->id); -} $agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/'.$langs->trans("Agenda") : ''; $title = $langs->trans('Events').$agenda.' - '.$object->ref.' '.$object->name; if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/projectnameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) { @@ -157,7 +158,7 @@ $morehtmlref .= '
'; // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index e80fb0ff9a6..6130564e2da 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -126,7 +126,7 @@ if ($id > 0 || !empty($ref)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 40217eded88..6df3685b01a 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -616,7 +616,7 @@ if ($id > 0 || !empty($ref)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 4359afad90f..beac0f4cbb2 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -155,7 +155,7 @@ if ($id > 0 || !empty($ref)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -308,7 +308,7 @@ if ($id > 0 || !empty($ref)) { if (!GETPOST('withproject') || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); - $object->next_prev_filter = "fk_projet:IN:(".$db->sanitize($projectsListId).")"; + $object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId); } else { $object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id); } diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 495d4bb5712..f829533062a 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -212,7 +212,7 @@ if ($id > 0 || !empty($ref)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -335,7 +335,7 @@ if ($id > 0 || !empty($ref)) { if (!GETPOST('withproject') || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); - $object->next_prev_filter = "fk_projet:IN:(".$db->sanitize($projectsListId).")"; + $object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId); } else { $object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id); } diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index c4cf270b6a7..8f091a04a5e 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -169,7 +169,7 @@ if ($object->id > 0) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -293,7 +293,7 @@ if ($object->id > 0) { if (!GETPOST('withproject') || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); - $object->next_prev_filter = "fk_projet:IN:(".$db->sanitize($projectsListId).")"; + $object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId); } else { $object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id); } diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 77861e2f681..673c820368b 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -159,7 +159,7 @@ if ($object->id > 0) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -277,7 +277,7 @@ if ($object->id > 0) { if (!GETPOST('withproject') || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); - $object->next_prev_filter = " fk_projet:IN:(".$db->sanitize($projectsListId).")"; + $object->next_prev_filter = " fk_projet:IN:".$db->sanitize($projectsListId); } else { $object->next_prev_filter = " fk_projet:=:".((int) $projectstatic->id); } diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 68ff3707182..45811e74f5c 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -316,7 +316,7 @@ if ($id > 0 || !empty($ref)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); @@ -597,7 +597,7 @@ if ($id > 0 || !empty($ref)) { if (!GETPOST('withproject') || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); - $object->next_prev_filter = "fk_projet:IN:(".$db->sanitize($projectsListId).")"; + $object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId); } else { $object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id); } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index aad0471027b..1002df365a2 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -959,7 +959,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid:IN:(" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0') . ")"; + $projectstatic->next_prev_filter = "rowid:IN:" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0'); } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); @@ -1143,7 +1143,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if (!GETPOST('withproject') || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); - $object->next_prev_filter = "fk_projet:IN:(" . $db->sanitize($projectsListId) . ")"; + $object->next_prev_filter = "fk_projet:IN:" . $db->sanitize($projectsListId); } else { $object->next_prev_filter = "fk_projet:=:" . ((int) $projectstatic->id); } diff --git a/htdocs/public/clicktodial/cidlookup.php b/htdocs/public/clicktodial/cidlookup.php index 3ec7024855d..feb1253e760 100644 --- a/htdocs/public/clicktodial/cidlookup.php +++ b/htdocs/public/clicktodial/cidlookup.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 @@ -51,7 +52,10 @@ if (!defined('USESUFFIXINLOG')) { } include '../../main.inc.php'; - +/** + * @var Conf $conf + * @var DoliDB $db + */ $phone = GETPOST('phone'); $securitykey = GETPOST('securitykey'); diff --git a/htdocs/public/company/new.php b/htdocs/public/company/new.php index 7a3622d62b8..f7942e267c5 100644 --- a/htdocs/public/company/new.php +++ b/htdocs/public/company/new.php @@ -8,7 +8,7 @@ * Copyright (C) 2018 Alexandre Spangaro * Copyright (C) 2021 Waël Almoman * Copyright (C) 2022 Udo Tamm - * 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 @@ -46,9 +46,9 @@ if (!defined('NOBROWSERNOTIF')) { // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php // Because 2 entities can have the same ref $entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); -if (is_numeric($entity)) { - define("DOLENTITY", $entity); -} +// if (is_numeric($entity)) { // value is casted to int so always numeric +define("DOLENTITY", $entity); +// } // Load Dolibarr environment @@ -63,6 +63,14 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/cunits.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/public.lib.php'; + +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + * @var User $user + */ // Init vars $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); @@ -84,7 +92,7 @@ if (!getDolGlobalString('SOCIETE_ENABLE_PUBLIC')) { } -//permissions +// permissions $permissiontoadd = $user->hasRight('societe', 'creer'); @@ -132,16 +140,16 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ print '
'; // Output html code for logo - if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { - print ''; - } - print '
'; + // if ($urllogo) { // test always true + print '
'; + print '
'; + print ''; + print '
'; + if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { + print ''; } + print '
'; + // } if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) { print '
'; @@ -163,15 +171,13 @@ function llxFooterVierge() { global $conf, $langs; - $ext = ''; - print '
'; printCommonFooter('public'); if (!empty($conf->use_javascript_ajax)) { print "\n" . '' . "\n"; - print '' . "\n"; + print '' . "\n"; } print "\n"; @@ -219,13 +225,13 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he $societe->name = GETPOST('name', 'alphanohtml'); $societe->client = GETPOSTINT('client') ? GETPOSTINT('client') : $societe->client; - $societe->address = GETPOST('address', 'alphanohtml'); - $societe->country_id = GETPOSTINT('country_id'); - $societe->phone = GETPOST('phone', 'alpha'); - $societe->fax = GETPOST('fax', 'alpha'); - $societe->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); + $societe->address = GETPOST('address', 'alphanohtml'); + $societe->country_id = GETPOSTINT('country_id'); + $societe->phone = GETPOST('phone', 'alpha'); + $societe->fax = GETPOST('fax', 'alpha'); + $societe->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); $societe->client = 2 ; // our client is a prospect - $societe->code_client = '-1'; + $societe->code_client = '-1'; $societe->name_alias = GETPOST('name_alias', 'alphanohtml'); $societe->note_private = GETPOST('note_private', 'alphanohtml'); @@ -429,7 +435,7 @@ if (isModEnabled('mailing') && getDolGlobalString('THIRDPARTY_SUGGEST_ALSO_ADDRE print ''; } print '' . $form->editfieldkey($langs->trans('No_Email') . ' (' . $langs->trans('Contact') . ')', 'contact_no_email', '', $objectsoc, 0) . ''; - print 'browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '') . '>' . $form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($objectsoc->no_email) ? 0 : 1)), 1, false, 1) . ''; + print 'browser->layout == 'phone') /* || !isModEnabled('mailing') */ ? ' colspan="3"' : '') . '>' . $form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($objectsoc->no_email) ? 0 : 1)), 1, false, 1) . ''; } print ''; @@ -460,7 +466,7 @@ if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) { print ''; print ''; print ''; - print '' . img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"') . ''; + print '' . img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"') . ''; print ''; print ''; } diff --git a/htdocs/public/cron/cron_run_jobs_by_url.php b/htdocs/public/cron/cron_run_jobs_by_url.php index 012c18b08f2..2c2bd2e7670 100644 --- a/htdocs/public/cron/cron_run_jobs_by_url.php +++ b/htdocs/public/cron/cron_run_jobs_by_url.php @@ -4,6 +4,7 @@ * Copyright (C) 2013-2015 Laurent Destailleur * Copyright (C) 2017 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 @@ -69,8 +70,12 @@ require '../../main.inc.php'; // cron jobs library dol_include_once("/cron/class/cronjob.class.php"); - -global $langs, $conf; +/** + * @var Conf $conf + * @var DoliDB $db + * @var Translate $langs + */ +global $langs, $conf, $db; // Language Management $langs->loadLangs(array("admin", "cron", "dict")); diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index cbe3cb0c0f3..2c23ea5420c 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -39,7 +39,12 @@ if (!defined('NOIPCHECK')) { // Load Dolibarr environment require '../../main.inc.php'; require_once '../../core/lib/functions2.lib.php'; - +/** + * @var Conf $conf + * @var DoliDB $db + * @var HookManager $hookmanager + * @var Translate $langs + */ $langs->loadLangs(array("main", "install", "other")); $conf->dol_hide_topmenu = GETPOSTINT('dol_hide_topmenu'); diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php index 1a046fc2be6..9504034a64a 100644 --- a/htdocs/public/emailing/mailing-read.php +++ b/htdocs/public/emailing/mailing-read.php @@ -91,7 +91,9 @@ function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = // Load Dolibarr environment require '../../main.inc.php'; - +/** + * @var DoliDB $db + */ $mtid = GETPOST('mtid'); $email = GETPOST('email'); $tag = GETPOST('tag'); diff --git a/htdocs/public/emailing/mailing-unsubscribe.php b/htdocs/public/emailing/mailing-unsubscribe.php index 7987a082144..77079262073 100644 --- a/htdocs/public/emailing/mailing-unsubscribe.php +++ b/htdocs/public/emailing/mailing-unsubscribe.php @@ -56,8 +56,10 @@ if (! defined('NOREQUIREAJAX')) { // Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; - -global $user, $conf, $langs; +/** + * @var DoliDB $db + */ +global $user, $conf, $db, $langs; $langs->loadLangs(array("main", "mails")); diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 3389a688bda..df26dbf783a 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -55,9 +55,9 @@ if (!defined('NOBROWSERNOTIF')) { // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php // Because 2 entities can have the same ref. $entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); -if (is_numeric($entity)) { - define("DOLENTITY", $entity); -} +// if (is_numeric($entity)) { // $entity is casted to int +define("DOLENTITY", $entity); +// } // Load Dolibarr environment diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index a00be39a2d5..ed2a67f24ee 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -43,9 +43,9 @@ if (!defined('NOBROWSERNOTIF')) { // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php // Because 2 entities can have the same ref. $entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); -if (is_numeric($entity)) { - define("DOLENTITY", $entity); -} +// if (is_numeric($entity)) { // $entity is casted to int +define("DOLENTITY", $entity); +// } // Load Dolibarr environment require '../../main.inc.php'; diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index 97061659a70..5445587309c 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -42,12 +42,17 @@ if (!defined('NOBROWSERNOTIF')) { // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php // Because 2 entities can have the same ref. $entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); -if (is_numeric($entity)) { - define("DOLENTITY", $entity); -} +// if (is_numeric($entity)) { // $entity is casted to int +define("DOLENTITY", $entity); +// } // Load Dolibarr environment require '../../main.inc.php'; +/** + * @var Conf $conf + * @var DoliDB $db + * @var Translate $langs + */ // Security check if (!isModEnabled('member')) { diff --git a/htdocs/public/notice.php b/htdocs/public/notice.php index ab37aa7d420..ac1af27f150 100644 --- a/htdocs/public/notice.php +++ b/htdocs/public/notice.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 @@ -41,7 +42,10 @@ if (!defined('NOBROWSERNOTIF')) { // Load Dolibarr environment require '../main.inc.php'; - +/** + * @var DoliDB $db + * @var Translate $langs + */ /** * View diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index f6254029ae1..ed7aa6f3934 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -97,13 +97,13 @@ class RecruitmentCandidature 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, 'comment' => "Id"), '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)', 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'comment' => "Reference of candidature", 'csslist' => 'nowraponall'), - 'fk_recruitmentjobposition' => array('type' => 'integer:RecruitmentJobPosition:recruitment/class/recruitmentjobposition.class.php:0:(t.status:=:1)', 'label' => 'Job', 'enabled' => 1, 'position' => 15, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'picto' => 'recruitmentjobposition', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist' => 'minwidth100 nowraponall'), + 'fk_recruitmentjobposition' => array('type' => 'integer:RecruitmentJobPosition:recruitment/class/recruitmentjobposition.class.php:0', 'label' => 'Job', 'enabled' => '1', 'position' => 15, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'picto' => 'recruitmentjobposition', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist' => 'minwidth100 nowraponall'), '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/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => -1, 'visible' => -2, 'foreignkey' => 'user.rowid', 'csslist' => 'tdoverflowmax100'), @@ -115,7 +115,7 @@ class RecruitmentCandidature extends CommonObject 'date_birth' => array('type' => 'date', 'label' => 'DateOfBirth', 'enabled' => 1, 'position' => 70, 'visible' => -1,), 'email_msgid' => array('type' => 'varchar(255)', 'label' => 'EmailMsgID', 'visible' => -2, 'enabled' => 1, 'position' => 540, 'notnull' => -1, 'help' => 'EmailMsgIDDesc'), 'email_date' => array('type' => 'datetime', 'label' => 'EmailDate', 'visible' => -2, 'enabled' => 1, 'position' => 541), - //'fk_recruitment_origin' => array('type'=>'integer:CRecruitmentOrigin:recruitment/class/crecruitmentorigin.class.php', 'label'=>'Origin', 'enabled'=>'1', 'position'=>45, 'visible'=>1, 'index'=>1), + //'fk_recruitment_origin' => array('type'=>'integer:CRecruitmentOrigin:recruitment/class/crecruitmentorigin.class.php', 'label'=>'Origin', 'enabled'=>1, 'position'=>45, 'visible'=>1, 'index'=>1), 'remuneration_requested' => array('type' => 'integer', 'label' => 'RequestedRemuneration', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => -1,), 'remuneration_proposed' => array('type' => 'integer', 'label' => 'ProposedRemuneration', 'enabled' => 1, 'position' => 81, 'notnull' => 0, 'visible' => -1,), 'description' => array('type' => 'html', 'label' => 'Description', 'enabled' => 1, 'position' => 300, 'notnull' => 0, 'visible' => 3, 'cssview' => 'wordbreak'), @@ -124,8 +124,8 @@ class RecruitmentCandidature extends CommonObject 'fk_user' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Employee', 'picto' => 'user', 'help' => 'LinkToUserCreated', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => -1, 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist' => 'tdoverflowmax100'), '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, 'visible' => 2, 'index' => 1, 'default' => '0', 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Received', '3' => 'ContractProposed', '5' => 'ContractSigned', '8' => 'Refused', '9' => 'Canceled')), - "ip" => array("type" => "varchar(250)", "label" => "Ip", "enabled" => "1", 'position' => 700, 'notnull' => 0, "visible" => "0", "comment" => "ip used to create record (for public submission page)"), + 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'visible' => 2, 'index' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Received', 3 => 'ContractProposed', 5 => 'ContractSigned', 8 => 'Refused', 9 => 'Canceled')), + "ip" => array("type" => "varchar(250)", "label" => "Ip", "enabled" => 1, 'position' => 700, 'notnull' => 0, "visible" => 0, "comment" => "ip used to create record (for public submission page)"), ); /** * @var int @@ -224,7 +224,7 @@ class RecruitmentCandidature extends CommonObject */ public function __construct(DoliDB $db) { - global $conf, $langs; + global $langs; $this->db = $db; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 259af516ac4..0e5a14e12ea 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -102,13 +102,13 @@ class RecruitmentJobPosition 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, 'comment' => "Id"), '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)', 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'comment' => "Reference of object", 'css' => 'nowraponall'), - 'label' => array('type' => 'varchar(255)', 'label' => 'JobLabel', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth500', 'csslist' => 'tdoverflowmax300', 'showoncombobox' => '2', 'autofocusoncreate' => 1), + 'label' => array('type' => 'varchar(255)', 'label' => 'JobLabel', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth500', 'csslist' => 'tdoverflowmax300', 'showoncombobox' => 2, 'autofocusoncreate' => 1), 'qty' => array('type' => 'integer', 'label' => 'NbOfEmployeesExpected', 'enabled' => 1, 'position' => 45, 'notnull' => 1, 'visible' => 1, 'default' => '1', 'isameasure' => 1, 'css' => 'maxwidth75imp'), 'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1', 'label' => 'Project', 'enabled' => '$conf->project->enabled', 'position' => 52, 'notnull' => -1, 'visible' => -1, 'index' => 1, 'css' => 'maxwidth500', 'picto' => 'project'), 'fk_user_recruiter' => array('type' => 'integer:User:user/class/user.class.php:1:(statut:=:1)', 'label' => 'ResponsibleOfRecruitement', 'enabled' => 1, 'position' => 54, 'notnull' => 1, 'visible' => 1, 'foreignkey' => 'user.rowid', 'css' => 'maxwidth500', 'csslist' => 'tdoverflowmax150', 'picto' => 'user'), @@ -128,7 +128,7 @@ class RecruitmentJobPosition extends CommonObject 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'position' => 900, '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, 'visible' => 5, 'default' => '0', 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '3' => 'Recruited', '9' => 'Canceled'),), + 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'visible' => 5, 'default' => '0', 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 3 => 'Recruited', 9 => 'Canceled'),), ); /** * @var int diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index fe80fcb63de..b47557d5f45 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -97,6 +97,17 @@ $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'recruitment', $object->id, 'recruitment_recruitmentcandidature', 'recruitmentjobposition', '', 'rowid', $isdraft); +if (GETPOST("action", "aZ09") == 'create') { + $reg = array(); + preg_match('/^(integer|link):(.*):(.*):(.*):(.*)/i', $object->fields['fk_recruitmentjobposition']['type'], $reg); + if (!empty($reg)) { + $object->fields['fk_recruitmentjobposition']['type'] .= " AND (t.status:=:1)"; + } else { + $object->fields['fk_recruitmentjobposition']['type'] .= ":(t.status:=:1)"; + } +} + + /* * Actions */ diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index fbcf6b56a89..be9411ac5aa 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -155,7 +155,7 @@ class PaymentSalary extends CommonObject public $datev = ''; /** - * @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' => 0, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), diff --git a/htdocs/societe/class/client.class.php b/htdocs/societe/class/client.class.php index 45e47ab21b2..81187942d6e 100644 --- a/htdocs/societe/class/client.class.php +++ b/htdocs/societe/class/client.class.php @@ -34,7 +34,7 @@ class Client extends Societe /** * @var string Used to add a filter in Form::showrefnav method */ - public $next_prev_filter = "te.client:in:(1,2,3)"; + public $next_prev_filter = "te.client:in:1,2,3"; /** * @var array diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index a50c111dbfb..7847255fe64 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -86,7 +86,7 @@ class CompanyBankAccount extends Account // 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' => 10, 'notnull' => 1, 'visible' => -1,), diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 791aebdda2b..7bdebe75464 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -72,7 +72,7 @@ class CompanyPaymentMode 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' => 'Rowid', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index e1e66ac6edf..b449c4a1c26 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -172,7 +172,7 @@ class Societe 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' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), @@ -955,9 +955,9 @@ class Societe extends CommonObject $this->status = 1; if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { - $this->fields['address']['showoncombobox'] = getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST'); - $this->fields['zip']['showoncombobox'] = getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST'); - $this->fields['town']['showoncombobox'] = getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST'); + $this->fields['address']['showoncombobox'] = getDolGlobalInt('COMPANY_SHOW_ADDRESS_SELECTLIST'); + $this->fields['zip']['showoncombobox'] = getDolGlobalInt('COMPANY_SHOW_ADDRESS_SELECTLIST'); + $this->fields['town']['showoncombobox'] = getDolGlobalInt('COMPANY_SHOW_ADDRESS_SELECTLIST'); //$this->fields['fk_pays']['showoncombobox'] = $conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST; } } @@ -1010,6 +1010,11 @@ class Societe extends CommonObject $this->fk_multicurrency = 0; } + if (empty($this->country_id) && !empty($this->country_code)) { + $country_id = getCountry($this->country_code, '3'); + $this->country_id = is_int($country_id) ? $country_id : 0; + } + dol_syslog(get_class($this)."::create ".$this->name); $now = dol_now(); diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index e2e5adde729..57f09fd9329 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -93,12 +93,12 @@ class SocieteAccount 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' => -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), + '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), @@ -118,7 +118,7 @@ class SocieteAccount extends CommonObject 'fk_user_creat' => array('type' => 'integer', 'label' => 'UserAuthor', 'visible' => -2, 'enabled' => 1, 'position' => 500, 'notnull' => 1,), 'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModif', 'visible' => -2, 'enabled' => 1, 'position' => 500, 'notnull' => -1,), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'visible' => -2, 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'index' => 1,), - 'status' => array('type' => 'integer', 'label' => 'Status', 'visible' => 1, 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'index' => 1, 'default' => 1, 'arrayofkeyval' => array('1' => 'Active', '0' => 'Disabled')), + 'status' => array('type' => 'integer', 'label' => 'Status', 'visible' => 1, 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'index' => 1, 'default' => '1', 'arrayofkeyval' => array(1 => 'Active', 0 => 'Disabled')), ); /** diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index e557d95de02..604fb1dd176 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -290,28 +290,35 @@ if (empty($reshook)) { $remaintopay = $invoice->getRemainToPay(); if ($remaintopay > 0) { $payment = new Paiement($db); + $payment->datepaye = $now; $payment->fk_account = $bankaccount; - $payment->amounts[$invoice->id] = $amountofpayment; if ($pay == 'LIQ') { $payment->pos_change = GETPOSTFLOAT('excess'); } + $payment->amounts[$invoice->id] = $amountofpayment; // If user has not used change control, add total invoice payment // Or if user has used change control and the amount of payment is higher than remain to pay, add the remain to pay if ($amountofpayment <= 0 || $amountofpayment > $remaintopay) { $payment->amounts[$invoice->id] = $remaintopay; } + // We do not set $payments->multicurrency_amounts because we want payment to be in main currency. $payment->paiementid = $paiementid; $payment->num_payment = $invoice->ref; if ($pay != "delayed") { - $payment->create($user); + $res = $payment->create($user); + if ($res < 0) { + $error++; + dol_htmloutput_errors($langs->trans('Error').' '.$payment->error, $payment->errors, 1); + } + $res = $payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', ''); if ($res < 0) { $error++; - dol_htmloutput_errors($langs->trans('ErrorNoPaymentDefined'), $payment->errors, 1); + dol_htmloutput_errors($langs->trans('ErrorNoPaymentDefined').' '.$payment->error, $payment->errors, 1); } $remaintopay = $invoice->getRemainToPay(); // Recalculate remain to pay after the payment is recorded } elseif (getDolGlobalInt("TAKEPOS_DELAYED_TERMS")) { @@ -324,6 +331,7 @@ if (empty($reshook)) { $result = $invoice->setPaid($user); if ($result > 0) { $invoice->paye = 1; + $invoice->status = $invoice::STATUS_CLOSED; } // set payment method $invoice->setPaymentMethods($paiementid); diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index f60e08dd546..4bc6cf0d0b3 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -539,6 +539,7 @@ if (getDolGlobalString('TAKEPOS_CUSTOMER_DISPLAY')) { currency = '.$conf->currency.' - sessioncurrency = '.$sessioncurrency.' -->'."\n"; if (isModEnabled('multicurrency') && $sessioncurrency != "" && $conf->currency != $sessioncurrency) { // Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency $showothercurrency = 1; @@ -560,7 +561,7 @@ if (isModEnabled('multicurrency') && $sessioncurrency != "" && $conf->currency ! total_ttc) { ?>
trans('RemainToPay'); ?>: multicurrency_code); + echo price($remaintopay, 1, '', 1, -1, -1, $conf->currency); if ($showothercurrency) { print '   (' . price($remaintopay * $multicurrency->rate->rate) . ' ' . $sessioncurrency . ')'; } @@ -569,7 +570,7 @@ if (isModEnabled('multicurrency') && $sessioncurrency != "" && $conf->currency !
trans("Received"); ?>: multicurrency_code); + echo price(0, 1, '', 1, -1, -1, $conf->currency); if ($showothercurrency) { print '   (' . price(0 * $multicurrency->rate->rate) . ' ' . $sessioncurrency . ')'; } @@ -577,7 +578,7 @@ if (isModEnabled('multicurrency') && $sessioncurrency != "" && $conf->currency !
trans("Change"); ?>: multicurrency_code); + echo price(0, 1, '', 1, -1, -1, $conf->currency); if ($showothercurrency) { print '   (' . price(0 * $multicurrency->rate->rate) . ' ' . $sessioncurrency . ')'; } diff --git a/htdocs/takepos/public/auto_order.php b/htdocs/takepos/public/auto_order.php index 970044e2773..bb8472f5cab 100644 --- a/htdocs/takepos/public/auto_order.php +++ b/htdocs/takepos/public/auto_order.php @@ -35,7 +35,7 @@ if (!defined('NOBROWSERNOTIF')) { require '../../main.inc.php'; if (!getDolGlobalString('TAKEPOS_AUTO_ORDER')) { - accessforbidden('Auto order is not allwed'); // If Auto Order is disabled never allow access to this page (that is a NO LOGIN access) + accessforbidden('Auto order is not allowed'); // If Auto Order is disabled never allow access to this page (that is a NO LOGIN access) } $_SESSION["basiclayout"] = 1; // For the simple layout for public submission @@ -43,9 +43,9 @@ $_SESSION["takeposterminal"] = getDolGlobalInt('TAKEPOS_TERMINAL_NB_FOR_PUBLIC', define('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE', 1); if (GETPOSTISSET("mobilepage")) { - require DOL_URL_ROOT.'/takepos/invoice.php'; + require DOL_DOCUMENT_ROOT.'/takepos/invoice.php'; } elseif (GETPOSTISSET("genimg")) { require DOL_DOCUMENT_ROOT.'/takepos/genimg/index.php'; } else { - require DOL_URL_ROOT.'/takepos/phone.php'; + require DOL_DOCUMENT_ROOT.'/takepos/phone.php'; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index af9fd02c678..15558ad11d7 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2359,6 +2359,9 @@ td.showDragHandle { .bodyforlist #id-right { padding-bottom: 4px; } +.page-modulehelp div#id-right { + display: flex; +} /* DOL_XXX For having horizontal scroll into array (like with smartphone) */ @@ -2577,6 +2580,9 @@ div.fiche { print 'margin-bottom: 12px;'."\n"; } ?> } +.page-modulehelp div.fiche { + width: 100%; +} body.onlinepaymentbody div.fiche { /* For online payment page */ margin: 20px !important; } @@ -5418,7 +5424,7 @@ div.info { background: #eff8fc; color: #558; } -div.fiche div.info { +div.fiche div.info, div.fiche div.warning { box-shadow: 4px 4px 12px #e4e4e4; margin: 1em 0em 1.2em 0em; } diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 1f5608090d7..b2abe2b3f96 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW */ if (!defined('ISLOADEDBYSTEELSHEET')) { die('Must be call by steelsheet'); @@ -7,6 +8,11 @@ if (!defined('ISLOADEDBYSTEELSHEET')) { /** * @var Conf $conf */ +// Expected to be defined by including parent +' +@phan-var-force string $right +@phan-var-force string $left +'; ?> /*