mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 17:18:13 +01:00
test phpstan (#36069)
* test phpstan * test phpstan * test phpstan * test phpstan * test phpstan * test phpstan * test phpstan * test phpstan * test phpstan * test phpstan * test phpstan * test phpstan * clean baseline * test * test
This commit is contained in:
@@ -36,6 +36,12 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/accountancy/admin/journals_list.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always true\.$#'
|
||||
identifier: if.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/accountancy/admin/productaccount.php
|
||||
|
||||
-
|
||||
message: '#^Right side of && is always true\.$#'
|
||||
identifier: booleanAnd.rightAlwaysTrue
|
||||
@@ -774,12 +780,24 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/admin/modules.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''common''\|''commonkanban'' and ''expdev'' will always evaluate to false\.$#'
|
||||
identifier: equal.alwaysFalse
|
||||
count: 1
|
||||
path: ../../../htdocs/admin/modules.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/admin/modules.php
|
||||
|
||||
-
|
||||
message: '#^Result of && is always false\.$#'
|
||||
identifier: booleanAnd.alwaysFalse
|
||||
count: 2
|
||||
path: ../../../htdocs/admin/modules.php
|
||||
|
||||
-
|
||||
message: '#^Right side of && is always true\.$#'
|
||||
identifier: booleanAnd.rightAlwaysTrue
|
||||
@@ -870,6 +888,18 @@ parameters:
|
||||
count: 5
|
||||
path: ../../../htdocs/admin/sms.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''add'' and ''add'' will always evaluate to true\.$#'
|
||||
identifier: equal.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/admin/spip.php
|
||||
|
||||
-
|
||||
message: '#^Result of \|\| is always true\.$#'
|
||||
identifier: booleanOr.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/admin/spip.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always true\.$#'
|
||||
identifier: if.alwaysTrue
|
||||
@@ -906,18 +936,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/admin/system/dolibarr.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always true\.$#'
|
||||
identifier: if.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/admin/system/filecheck.php
|
||||
|
||||
-
|
||||
message: '#^Left side of && is always true\.$#'
|
||||
identifier: booleanAnd.leftAlwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/admin/system/filecheck.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \!\= between '''' and ''kanban'' will always evaluate to true\.$#'
|
||||
identifier: notEqual.alwaysTrue
|
||||
@@ -1662,6 +1680,18 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/categories/card.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''hierarchy'' and ''common'' will always evaluate to false\.$#'
|
||||
identifier: equal.alwaysFalse
|
||||
count: 1
|
||||
path: ../../../htdocs/categories/categorie_list.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''hierarchy'' and ''hierarchy'' will always evaluate to true\.$#'
|
||||
identifier: equal.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/categories/categorie_list.php
|
||||
|
||||
-
|
||||
message: '#^Method Categorie\:\:get_full_arbo\(\) should return \-1\|array\<int, array\{rowid\: int, id\: int, fk_parent\: int, label\: string, description\: string, color\: string, position\: string, visible\: int, \.\.\.\}\> but returns array\<array\{rowid\: mixed, id\: mixed, fk_parent\: mixed, label\: mixed, description\: mixed, color\: mixed, position\: mixed, visible\: mixed, \.\.\.\}\>\.$#'
|
||||
identifier: return.type
|
||||
@@ -1842,6 +1872,12 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/comm/action/index.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#16 \$usergroupid of function print_actions_filter expects array\<int\>\|int, string given\.$#'
|
||||
identifier: argument.type
|
||||
count: 3
|
||||
path: ../../../htdocs/comm/action/index.php
|
||||
|
||||
-
|
||||
message: '#^Ternary operator condition is always true\.$#'
|
||||
identifier: ternary.alwaysTrue
|
||||
@@ -1902,12 +1938,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/comm/action/pertype.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always false\.$#'
|
||||
identifier: if.alwaysFalse
|
||||
count: 1
|
||||
path: ../../../htdocs/comm/action/pertype.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \!\= between ''show_pertype'' and ''show_day'' will always evaluate to true\.$#'
|
||||
identifier: notEqual.alwaysTrue
|
||||
@@ -2220,6 +2250,30 @@ parameters:
|
||||
count: 4
|
||||
path: ../../../htdocs/comm/mailing/targetemailing.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''setemail_errorsto''\|''setevenunsubscribe''\|''setreplyto'' and ''setemail_replyto'' will always evaluate to false\.$#'
|
||||
identifier: equal.alwaysFalse
|
||||
count: 1
|
||||
path: ../../../htdocs/comm/mailing/targetemailing.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''setevenunsubscribe''\|''setreplyto'' and ''setfrom'' will always evaluate to false\.$#'
|
||||
identifier: equal.alwaysFalse
|
||||
count: 1
|
||||
path: ../../../htdocs/comm/mailing/targetemailing.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''setevenunsubscribe''\|''setreplyto'' and ''settitle'' will always evaluate to false\.$#'
|
||||
identifier: equal.alwaysFalse
|
||||
count: 1
|
||||
path: ../../../htdocs/comm/mailing/targetemailing.php
|
||||
|
||||
-
|
||||
message: '#^Result of && is always false\.$#'
|
||||
identifier: booleanAnd.alwaysFalse
|
||||
count: 2
|
||||
path: ../../../htdocs/comm/mailing/targetemailing.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$filter might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
@@ -2307,7 +2361,7 @@ parameters:
|
||||
-
|
||||
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
count: 1
|
||||
count: 3
|
||||
path: ../../../htdocs/commande/list.php
|
||||
|
||||
-
|
||||
@@ -2370,6 +2424,18 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/accounting-files.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#1 \$array of function array_sum expects array, string given\.$#'
|
||||
identifier: argument.type
|
||||
count: 2
|
||||
path: ../../../htdocs/compta/ajaxpayment.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$array of function array_key_exists expects array, string given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/ajaxpayment.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$ve might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
@@ -2406,6 +2472,12 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/bank/bankentries_list.php
|
||||
|
||||
-
|
||||
message: '#^Ternary operator condition is always true\.$#'
|
||||
identifier: ternary.alwaysTrue
|
||||
count: 2
|
||||
path: ../../../htdocs/compta/bank/bankentries_list.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
@@ -2694,6 +2766,48 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/cashcontrol/cashcontrol_card.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''close'' and ''close'' will always evaluate to true\.$#'
|
||||
identifier: equal.alwaysTrue
|
||||
count: 4
|
||||
path: ../../../htdocs/compta/cashcontrol/cashcontrol_card.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''close'' and ''start'' will always evaluate to false\.$#'
|
||||
identifier: equal.alwaysFalse
|
||||
count: 4
|
||||
path: ../../../htdocs/compta/cashcontrol/cashcontrol_card.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''create''\|''start'' and ''close'' will always evaluate to false\.$#'
|
||||
identifier: equal.alwaysFalse
|
||||
count: 2
|
||||
path: ../../../htdocs/compta/cashcontrol/cashcontrol_card.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''start'' and ''close'' will always evaluate to false\.$#'
|
||||
identifier: equal.alwaysFalse
|
||||
count: 2
|
||||
path: ../../../htdocs/compta/cashcontrol/cashcontrol_card.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''start'' and ''start'' will always evaluate to true\.$#'
|
||||
identifier: equal.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/cashcontrol/cashcontrol_card.php
|
||||
|
||||
-
|
||||
message: '#^Result of && is always false\.$#'
|
||||
identifier: booleanAnd.alwaysFalse
|
||||
count: 6
|
||||
path: ../../../htdocs/compta/cashcontrol/cashcontrol_card.php
|
||||
|
||||
-
|
||||
message: '#^Result of \|\| is always true\.$#'
|
||||
identifier: booleanOr.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/cashcontrol/cashcontrol_card.php
|
||||
|
||||
-
|
||||
message: '#^Ternary operator condition is always false\.$#'
|
||||
identifier: ternary.alwaysFalse
|
||||
@@ -3084,6 +3198,12 @@ parameters:
|
||||
count: 2
|
||||
path: ../../../htdocs/compta/facture/list.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
count: 2
|
||||
path: ../../../htdocs/compta/facture/list.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
@@ -3468,12 +3588,24 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/prelevement/create.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \!\= between ''''\|''0''\|''direct\-debit'' and ''bank\-transfer'' will always evaluate to true\.$#'
|
||||
identifier: notEqual.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/prelevement/create.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$massaction might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/prelevement/demandes.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''bank\-transfer'' and ''bank\-transfer'' will always evaluate to true\.$#'
|
||||
identifier: equal.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/prelevement/list.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
@@ -3492,6 +3624,12 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/recap-compta.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''RECETTES\-DEPENSES'' and ''CREANCES\-DETTES'' will always evaluate to false\.$#'
|
||||
identifier: equal.alwaysFalse
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/resultat/clientfourn.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$description might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
@@ -3510,12 +3648,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/resultat/index.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$sql might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 5
|
||||
path: ../../../htdocs/compta/resultat/index.php
|
||||
|
||||
-
|
||||
message: '#^Call to function is_array\(\) with non\-empty\-array\<array\{NP\: mixed, N\?\: \(float\|int\), M\?\: non\-empty\-array\<0\|1\|2\|3\|4\|5\|6\|7\|8\|9\|10\|11, mixed\>\}\> will always evaluate to true\.$#'
|
||||
identifier: function.alreadyNarrowedType
|
||||
@@ -3798,12 +3930,24 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/stats/index.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''BOOKKEEPINGCOLLECTED''\|''RECETTES\-DEPENSES'' and ''RECETTES\-DEPENSES'' will always evaluate to true\.$#'
|
||||
identifier: equal.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/stats/supplier_turnover.php
|
||||
|
||||
-
|
||||
message: '#^Ternary operator condition is always false\.$#'
|
||||
identifier: ternary.alwaysFalse
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/stats/supplier_turnover.php
|
||||
|
||||
-
|
||||
message: '#^Ternary operator condition is always true\.$#'
|
||||
identifier: ternary.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/compta/stats/supplier_turnover.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$description might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
@@ -4101,7 +4245,7 @@ parameters:
|
||||
-
|
||||
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
count: 1
|
||||
count: 6
|
||||
path: ../../../htdocs/contact/list.php
|
||||
|
||||
-
|
||||
@@ -9198,12 +9342,6 @@ parameters:
|
||||
count: 3
|
||||
path: ../../../htdocs/exports/export.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$heightforframes might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../../htdocs/externalsite/frames.php
|
||||
|
||||
-
|
||||
message: '#^If condition is always true\.$#'
|
||||
identifier: if.alwaysTrue
|
||||
@@ -9924,6 +10062,12 @@ parameters:
|
||||
count: 3
|
||||
path: ../../../htdocs/holiday/define_holiday.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#1 \$array of function array_keys expects array, string given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: ../../../htdocs/holiday/define_holiday.php
|
||||
|
||||
-
|
||||
message: '#^Ternary operator condition is always false\.$#'
|
||||
identifier: ternary.alwaysFalse
|
||||
@@ -10248,6 +10392,12 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/hrm/compare.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''edit'' and ''edit'' will always evaluate to true\.$#'
|
||||
identifier: equal.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/hrm/establishment/card.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$k might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
@@ -10968,6 +11118,12 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/modulebuilder/index.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''objects'' and ''specifications'' will always evaluate to false\.$#'
|
||||
identifier: equal.alwaysFalse
|
||||
count: 1
|
||||
path: ../../../htdocs/modulebuilder/index.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always true\.$#'
|
||||
identifier: booleanNot.alwaysTrue
|
||||
@@ -11574,6 +11730,18 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/opensurvey/results.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#5 \$day of function dol_mktime expects int, string given\.$#'
|
||||
identifier: argument.type
|
||||
count: 2
|
||||
path: ../../../htdocs/opensurvey/wizard/choix_date.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#5 \$day of function mktime expects int\|null, string given\.$#'
|
||||
identifier: argument.type
|
||||
count: 2
|
||||
path: ../../../htdocs/opensurvey/wizard/choix_date.php
|
||||
|
||||
-
|
||||
message: '#^Left side of && is always false\.$#'
|
||||
identifier: booleanAnd.leftAlwaysFalse
|
||||
@@ -12162,6 +12330,12 @@ parameters:
|
||||
count: 2
|
||||
path: ../../../htdocs/product/list.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
count: 1
|
||||
path: ../../../htdocs/product/list.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''add_customer_price'' and ''add_customer_price'' will always evaluate to true\.$#'
|
||||
identifier: equal.alwaysTrue
|
||||
@@ -12828,6 +13002,12 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/projet/agenda.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''gettasks'' and ''gettasks'' will always evaluate to true\.$#'
|
||||
identifier: equal.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/projet/ajax/projects.php
|
||||
|
||||
-
|
||||
message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#'
|
||||
identifier: function.alreadyNarrowedType
|
||||
@@ -13167,7 +13347,7 @@ parameters:
|
||||
-
|
||||
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
count: 1
|
||||
count: 2
|
||||
path: ../../../htdocs/projet/list.php
|
||||
|
||||
-
|
||||
@@ -13296,12 +13476,6 @@ parameters:
|
||||
count: 5
|
||||
path: ../../../htdocs/projet/tasks/list.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''0''\|array\{\} and '''' will always evaluate to false\.$#'
|
||||
identifier: equal.alwaysFalse
|
||||
count: 1
|
||||
path: ../../../htdocs/projet/tasks/list.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between 0 and 0 will always evaluate to true\.$#'
|
||||
identifier: equal.alwaysTrue
|
||||
@@ -13662,6 +13836,12 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/public/onlinesign/newonlinesign.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''expedition'' and ''expedition'' will always evaluate to true\.$#'
|
||||
identifier: equal.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/public/onlinesign/newonlinesign.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always false\.$#'
|
||||
identifier: booleanNot.alwaysFalse
|
||||
@@ -15168,6 +15348,12 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/societe/consumption.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
count: 5
|
||||
path: ../../../htdocs/societe/list.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
@@ -15595,7 +15781,7 @@ parameters:
|
||||
path: ../../../htdocs/takepos/printbox.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \!\= between mixed and '''' will always evaluate to true\.$#'
|
||||
message: '#^Loose comparison using \!\= between non\-empty\-string and '''' will always evaluate to true\.$#'
|
||||
identifier: notEqual.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/takepos/receipt.php
|
||||
@@ -16404,6 +16590,12 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/webhook/target_list.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$mode in empty\(\) always exists and is not falsy\.$#'
|
||||
identifier: empty.variable
|
||||
count: 1
|
||||
path: ../../../htdocs/webhook/target_list.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''auto'' and ''auto'' will always evaluate to true\.$#'
|
||||
identifier: equal.alwaysTrue
|
||||
@@ -16674,12 +16866,42 @@ parameters:
|
||||
count: 2
|
||||
path: ../../../htdocs/website/index.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \!\= between ''editcss'' and ''createcontainer'' will always evaluate to true\.$#'
|
||||
identifier: notEqual.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/website/index.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''createcontainer'' and ''createcontainer'' will always evaluate to true\.$#'
|
||||
identifier: equal.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/website/index.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''createsite'' and ''createcontainer'' will always evaluate to false\.$#'
|
||||
identifier: equal.alwaysFalse
|
||||
count: 1
|
||||
path: ../../../htdocs/website/index.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison using \=\= between ''createsite'' and ''createsite'' will always evaluate to true\.$#'
|
||||
identifier: equal.alwaysTrue
|
||||
count: 1
|
||||
path: ../../../htdocs/website/index.php
|
||||
|
||||
-
|
||||
message: '#^Negated boolean expression is always false\.$#'
|
||||
identifier: booleanNot.alwaysFalse
|
||||
count: 1
|
||||
path: ../../../htdocs/website/index.php
|
||||
|
||||
-
|
||||
message: '#^Result of \|\| is always true\.$#'
|
||||
identifier: booleanOr.alwaysTrue
|
||||
count: 2
|
||||
path: ../../../htdocs/website/index.php
|
||||
|
||||
-
|
||||
message: '#^Right side of && is always true\.$#'
|
||||
identifier: booleanAnd.rightAlwaysTrue
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2020 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -60,8 +60,14 @@ if (!$user->admin) {
|
||||
}
|
||||
|
||||
$moduledir = 'workstation';
|
||||
$myTmpObjects = array();
|
||||
$myTmpObjects['workstation'] = array('label' => 'Workstation', 'includerefgeneration' => 1, 'includedocgeneration' => 0, 'class' => 'Workstation');
|
||||
$myTmpObjects = [
|
||||
'workstation' => [
|
||||
'label' => 'Workstation',
|
||||
'includerefgeneration' => 1,
|
||||
'includedocgeneration' => 0,
|
||||
'class' => 'Workstation',
|
||||
],
|
||||
];
|
||||
|
||||
$tmpobjectkey = GETPOST('object', 'aZ09');
|
||||
if ($tmpobjectkey && !array_key_exists($tmpobjectkey, $myTmpObjects)) {
|
||||
@@ -97,9 +103,7 @@ if ($action == 'updateMask') {
|
||||
} elseif ($action == 'specimen') {
|
||||
$modele = GETPOST('module', 'alpha');
|
||||
|
||||
$nameofclass = ucfirst($tmpobjectkey);
|
||||
$tmpobject = new $nameofclass($db);
|
||||
'@phan-var-force Workstation $tmpobject';
|
||||
$tmpobject = new Workstation($db);
|
||||
$tmpobject->initAsSpecimen();
|
||||
|
||||
// Search template files
|
||||
@@ -359,6 +363,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
||||
require_once $dir.'/'.$file;
|
||||
$module = new $classname($db);
|
||||
'@phan-var-force ModelePDFWorkstation $module';
|
||||
/** @var ModelePDFWorkstation $module */
|
||||
|
||||
$modulequalified = 1;
|
||||
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
|
||||
@@ -441,9 +446,6 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
||||
}
|
||||
}
|
||||
|
||||
/*if (empty($setupnotempty)) {
|
||||
print '<br>'.$langs->trans("NothingToSetup");
|
||||
}*/
|
||||
|
||||
// Page end
|
||||
print dol_get_fiche_end();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2014-2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Copyright (C) 2014-2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||
* Copyright (C) 2021-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 Yoan Mollard <ymollard@users.noreply.github.com>
|
||||
@@ -424,32 +424,29 @@ if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta
|
||||
/*
|
||||
* Donations
|
||||
*/
|
||||
|
||||
if (isModEnabled('don')) {
|
||||
echo '<tr class="trforbreak"><td colspan="4">'.$langs->trans("Donations").'</td></tr>';
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
$sql = "SELECT p.rowid as rowid, p.ref as project_ref, sum(d.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON d.fk_projet = p.rowid";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('donation').")";
|
||||
$sql .= " AND d.fk_statut in (1,2)";
|
||||
} else {
|
||||
$sql = "SELECT p.rowid as rowid, p.ref as project_ref, sum(d.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = d.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON d.fk_projet = p.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('donation').")";
|
||||
$sql .= " AND d.fk_statut >= 2";
|
||||
}
|
||||
if (!empty($date_start)) {
|
||||
$sql .= " AND d.datedon >= '".$db->idate($date_start)."'";
|
||||
}
|
||||
if (!empty($date_end)) {
|
||||
$sql .= " AND d.datedon <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
$sql = "SELECT p.rowid as rowid, p.ref as project_ref, sum(d.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON d.fk_projet = p.rowid";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('donation').")";
|
||||
$sql .= " AND d.fk_statut in (1,2)";
|
||||
} else {
|
||||
$sql = "SELECT p.rowid as rowid, p.ref as project_ref, sum(d.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = d.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON d.fk_projet = p.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('donation').")";
|
||||
$sql .= " AND d.fk_statut >= 2";
|
||||
}
|
||||
if (!empty($date_start)) {
|
||||
$sql .= " AND d.datedon >= '".$db->idate($date_start)."'";
|
||||
}
|
||||
if (!empty($date_end)) {
|
||||
$sql .= " AND d.datedon <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
$sql .= " GROUP BY p.rowid, p.ref";
|
||||
$newsortfield = $sortfield;
|
||||
@@ -635,57 +632,54 @@ if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta
|
||||
/*
|
||||
* Salaries
|
||||
*/
|
||||
|
||||
if (isModEnabled('salaries')) {
|
||||
echo '<tr class="trforbreak"><td colspan="4">'.$langs->trans("Salaries").'</td></tr>';
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
$column = 's.dateep'; // We use the date of end of period of salary
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
$column = 's.dateep'; // We use the date of end of period of salary
|
||||
|
||||
$sql = "SELECT p.rowid as rowid, p.ref as project_ref, sum(s.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = s.fk_user";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON s.fk_projet = p.rowid";
|
||||
$sql .= " WHERE s.entity IN (".getEntity('salary').")";
|
||||
if (!empty($date_start)) {
|
||||
$sql .= " AND ".$db->sanitize($column)." >= '".$db->idate($date_start)."'";
|
||||
}
|
||||
if (!empty($date_end)) {
|
||||
$sql .= " AND ".$db->sanitize($column)." <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
} else {
|
||||
$column = 'ps.datep';
|
||||
$sql = "SELECT p.rowid as rowid, p.ref as project_ref, sum(s.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = s.fk_user";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON s.fk_projet = p.rowid";
|
||||
$sql .= " WHERE s.entity IN (".getEntity('salary').")";
|
||||
if (!empty($date_start)) {
|
||||
$sql .= " AND ".$db->sanitize($column)." >= '".$db->idate($date_start)."'";
|
||||
}
|
||||
if (!empty($date_end)) {
|
||||
$sql .= " AND ".$db->sanitize($column)." <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
} else {
|
||||
$column = 'ps.datep';
|
||||
|
||||
$sql = "SELECT pr.rowid as rowid, pr.ref as project_ref, sum(ps.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as ps";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid = ps.fk_salary";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = s.fk_user";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr ON s.fk_projet = pr.rowid";
|
||||
$sql .= " WHERE ps.entity IN (".getEntity('payment_salary').")";
|
||||
if (!empty($date_start)) {
|
||||
$sql .= " AND ".$db->sanitize($column)." >= '".$db->idate($date_start)."'";
|
||||
}
|
||||
if (!empty($date_end)) {
|
||||
$sql .= " AND ".$db->sanitize($column)." <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
$sql = "SELECT pr.rowid as rowid, pr.ref as project_ref, sum(ps.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as ps";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid = ps.fk_salary";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = s.fk_user";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr ON s.fk_projet = pr.rowid";
|
||||
$sql .= " WHERE ps.entity IN (".getEntity('payment_salary').")";
|
||||
if (!empty($date_start)) {
|
||||
$sql .= " AND ".$db->sanitize($column)." >= '".$db->idate($date_start)."'";
|
||||
}
|
||||
|
||||
|
||||
$sql .= " GROUP BY rowid, project_ref";
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') {
|
||||
$newsortfield = 'project_ref';
|
||||
if (!empty($date_end)) {
|
||||
$sql .= " AND ".$db->sanitize($column)." <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
if ($newsortfield == 'amount_ht') {
|
||||
$newsortfield = 'amount';
|
||||
}
|
||||
if ($newsortfield == 'amount_ttc') {
|
||||
$newsortfield = 'amount';
|
||||
}
|
||||
$sql .= $db->order($newsortfield, $sortorder);
|
||||
}
|
||||
|
||||
|
||||
$sql .= " GROUP BY rowid, project_ref";
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') {
|
||||
$newsortfield = 'project_ref';
|
||||
}
|
||||
if ($newsortfield == 'amount_ht') {
|
||||
$newsortfield = 'amount';
|
||||
}
|
||||
if ($newsortfield == 'amount_ttc') {
|
||||
$newsortfield = 'amount';
|
||||
}
|
||||
$sql .= $db->order($newsortfield, $sortorder);
|
||||
|
||||
dol_syslog("by project, get salaries");
|
||||
$result = $db->query($sql);
|
||||
$subtotal_ht = 0;
|
||||
@@ -750,44 +744,41 @@ if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta
|
||||
/*
|
||||
* Expense report
|
||||
*/
|
||||
|
||||
if (isModEnabled('expensereport')) {
|
||||
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
|
||||
$langs->load('trips');
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
$sql = "SELECT ed.rowid as rowid, ed.fk_projet, p.rowid as project_rowid, p.ref as project_ref, sum(ed.total_ht) as amount_ht, sum(ed.total_ttc) as amount_ttc";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as ed";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."expensereport as e ON ed.fk_expensereport = e.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON ed.fk_projet = p.rowid";
|
||||
$sql .= " WHERE e.entity IN (".getEntity('expensereport').")";
|
||||
$sql .= " AND e.fk_statut >= 5";
|
||||
$langs->load('trips');
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
$sql = "SELECT ed.rowid as rowid, ed.fk_projet, p.rowid as project_rowid, p.ref as project_ref, sum(ed.total_ht) as amount_ht, sum(ed.total_ttc) as amount_ttc";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as ed";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."expensereport as e ON ed.fk_expensereport = e.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON ed.fk_projet = p.rowid";
|
||||
$sql .= " WHERE e.entity IN (".getEntity('expensereport').")";
|
||||
$sql .= " AND e.fk_statut >= 5";
|
||||
|
||||
$column = 'e.date_valid';
|
||||
} else {
|
||||
$sql = "SELECT ed.rowid as rowid, ed.fk_projet, p.rowid as project_rowid, p.ref as project_ref, sum(DISTINCT pe.amount) as amount_ht, sum(DISTINCT pe.amount) as amount_ttc";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as ed";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."expensereport as e ON ed.fk_expensereport = e.rowid";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = e.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON ed.fk_projet = p.rowid";
|
||||
$sql .= " WHERE e.entity IN (".getEntity('expensereport').")";
|
||||
$sql .= " AND e.fk_statut >= 5";
|
||||
$column = 'e.date_valid';
|
||||
} else {
|
||||
$sql = "SELECT ed.rowid as rowid, ed.fk_projet, p.rowid as project_rowid, p.ref as project_ref, sum(DISTINCT pe.amount) as amount_ht, sum(DISTINCT pe.amount) as amount_ttc";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as ed";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."expensereport as e ON ed.fk_expensereport = e.rowid";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = e.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON ed.fk_projet = p.rowid";
|
||||
$sql .= " WHERE e.entity IN (".getEntity('expensereport').")";
|
||||
$sql .= " AND e.fk_statut >= 5";
|
||||
|
||||
$column = 'pe.datep';
|
||||
}
|
||||
if (!empty($date_start)) {
|
||||
$sql .= " AND ".$db->sanitize($column)." >= '".$db->idate($date_start)."'";
|
||||
}
|
||||
if (!empty($date_end)) {
|
||||
$sql .= " AND ".$db->sanitize($column)." <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
|
||||
$sql .= " GROUP BY ed.rowid, ed.fk_projet, p.rowid, p.ref";
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') {
|
||||
$newsortfield = 'project_ref';
|
||||
}
|
||||
$sql .= $db->order($newsortfield, $sortorder);
|
||||
$column = 'pe.datep';
|
||||
}
|
||||
if (!empty($date_start)) {
|
||||
$sql .= " AND ".$db->sanitize($column)." >= '".$db->idate($date_start)."'";
|
||||
}
|
||||
if (!empty($date_end)) {
|
||||
$sql .= " AND ".$db->sanitize($column)." <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
|
||||
$sql .= " GROUP BY ed.rowid, ed.fk_projet, p.rowid, p.ref";
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') {
|
||||
$newsortfield = 'project_ref';
|
||||
}
|
||||
$sql .= $db->order($newsortfield, $sortorder);
|
||||
|
||||
echo '<tr class="trforbreak"><td colspan="4">'.$langs->trans("ExpenseReport").'</td></tr>';
|
||||
|
||||
@@ -860,8 +851,7 @@ if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta
|
||||
* Various Payments
|
||||
*/
|
||||
//$conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY = 1;
|
||||
|
||||
if (getDolGlobalString('ACCOUNTING_REPORTS_INCLUDE_VARPAY') && isModEnabled("bank") && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
|
||||
if (getDolGlobalString('ACCOUNTING_REPORTS_INCLUDE_VARPAY') && isModEnabled("bank")) {
|
||||
$subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
|
||||
@@ -953,8 +943,7 @@ if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta
|
||||
/*
|
||||
* Payment Loan
|
||||
*/
|
||||
|
||||
if (getDolGlobalString('ACCOUNTING_REPORTS_INCLUDE_LOAN') && isModEnabled('don') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
|
||||
if (getDolGlobalString('ACCOUNTING_REPORTS_INCLUDE_LOAN') && isModEnabled('don')) {
|
||||
$subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 Benjamin B. <b.crozon@trebisol.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
|
||||
@@ -822,30 +822,39 @@ function GETPOSTISARRAY($paramname, $method = 0)
|
||||
* Note: The property $user->default_values is loaded by main.php when loading the user.
|
||||
*
|
||||
* @param string $paramname Name of parameter to found
|
||||
* @param string $check Type of check
|
||||
* '' or 'none'=no check (deprecated)
|
||||
* 'password'=allow characters for a password
|
||||
* 'email'=allow characters for an email "email@domain.com"
|
||||
* 'url'=allow characters for an url
|
||||
* 'array', 'array:restricthtml' or 'array:aZ09' to check it's an array
|
||||
* 'int'=check it's numeric (integer or float)
|
||||
* 'intcomma'=check it's integer+comma ('1,2,3,4...')
|
||||
* 'alphanohtml'=check there is no html content and no " and no ../ ('alpha' is an alias of 'alphanohtml')
|
||||
* 'alphawithlgt'=alpha with lgt and no " and no ../ (Can be used for email string like "Name <email@domain.com>")
|
||||
* 'aZ'=check it's a-z only
|
||||
* 'aZ09'=check it's simple alpha string (recommended for keys, it includes a-z0-9_\-\.)
|
||||
* 'aZ09arobase'=check it's a string for an element type ('myobject@mymodule')
|
||||
* 'aZ09comma'=check it's a string for a sortfield or sortorder
|
||||
* 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string)
|
||||
* 'nohtml'=check there is no html content
|
||||
* 'restricthtml'=check html content is restricted to some tags only
|
||||
* 'custom'= custom filter specify $filter and $options)
|
||||
* @param 'int'|'intcomma'|'array'|'array:int'|'array:intcomma'|'array:alpha'|'array:alphanohtml'|'array:aZ09'|'array:restricthtml'|'password'|'email'|'alpha'|'alphanohtml'|'nohtml'|'restricthtml'|'alphawithlgt'|'aZ09'|'aZ'|'aZ09arobase'|'aZ09comma'|'url'|'san_alpha'|'custom'|'none'|'restricthtmlallowclass'|'restricthtmlallowunvalid'|'restricthtmlallowiframe'|'restricthtmlallowlinkscript'|'' $check Type of check
|
||||
* '' or 'none'=no check (deprecated)
|
||||
* 'password'=allow characters for a password
|
||||
* 'email'=allow characters for an email "email@domain.com"
|
||||
* 'url'=allow characters for an url
|
||||
* 'array', 'array:restricthtml' or 'array:aZ09' to check it's an array
|
||||
* 'int'=check it's numeric (integer or float)
|
||||
* 'intcomma'=check it's integer+comma ('1,2,3,4...')
|
||||
* 'alphanohtml'=check there is no html content and no " and no ../ ('alpha' is an alias of 'alphanohtml')
|
||||
* 'alphawithlgt'=alpha with lgt and no " and no ../ (Can be used for email string like "Name <email@domain.com>")
|
||||
* 'aZ'=check it's a-Z only
|
||||
* 'aZ09'=check it's simple alpha string (recommended for keys, it includes a-Z0-9_\-\.)
|
||||
* 'aZ09arobase'=check it's a string for an element type ('myobject@mymodule')
|
||||
* 'aZ09comma'=check it's a string for a sortfield or sortorder
|
||||
* 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string)
|
||||
* 'nohtml'=check there is no html content
|
||||
* 'restricthtml'=check html content is restricted to some tags only
|
||||
* 'custom'= custom filter specify $filter and $options)
|
||||
* 'restricthtmlallowclass'
|
||||
* 'restricthtmlallowunvalid'
|
||||
* 'restricthtmlallowiframe'
|
||||
* 'restricthtmlallowlinkscript'
|
||||
* @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get)
|
||||
* @param ?int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails)
|
||||
* @param mixed $options Options to pass to filter_var when $check is set to 'custom'
|
||||
* @param int $noreplace Force disable of replacement of __xxx__ strings.
|
||||
* @return string|array<mixed> Value found (string or array), or '' if check fails
|
||||
* @phpstan-return ($check is 'array:int' ? numeric-string[]|array{} : ($check is 'array:az09' ? string[] : ($check is 'array:restricthtml' ? string[] : string|array<mixed>)))
|
||||
* @phpstan-return (
|
||||
* $check is 'int' ? numeric-string|'' :
|
||||
* $check is 'array:int' ? numeric-string[]|array{} :
|
||||
* $check is 'array' | 'array:aZ09' | 'array:alpha' | 'array:intcomma' | 'array:restricthtml' ? string[] :
|
||||
* $check is 'alpha' | 'aZ' | 'aZ09' | 'aZ09arobase' | 'aZ09comma' | 'password' | 'email' | 'url' | 'alphanohtml' |'nohtml' | 'restricthtml' | 'alphawithlgt' | 'intcomma' | 'restricthtmlallowclass' | 'restricthtmlallowunvalid' | 'restricthtmlallowiframe' | 'restricthtmlallowlinkscript' ? string : string|array<mixed>
|
||||
* )
|
||||
*/
|
||||
function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null, $options = null, $noreplace = 0)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2008-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -135,7 +135,7 @@ if ($action == 'add' && $permissiontoadd) {
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
} else {
|
||||
header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager'.($module ? '&module='.$module : ''));
|
||||
header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager&module='.$module);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ $cancel = GETPOST('cancel', 'aZ09');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
|
||||
$module = GETPOST('module', 'alpha');
|
||||
$module = GETPOST('module', 'alpha');
|
||||
$website = GETPOST('website', 'alpha');
|
||||
$pageid = GETPOSTINT('pageid');
|
||||
$pageid = GETPOSTINT('pageid');
|
||||
if (empty($module)) {
|
||||
$module = 'ecm';
|
||||
}
|
||||
@@ -465,16 +465,16 @@ if ($action != 'edit' && $action != 'delete' && $action != 'deletefile') {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($permissiontoadd) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().($module ? '&module='.$module : '').'§ion='.$section.'">'.$langs->trans('Edit').'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&module='.$module.'§ion='.$section.'">'.$langs->trans('Edit').'</a>';
|
||||
}
|
||||
|
||||
if ($permissiontoadd) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&token='.newToken().($module ? '&module='.$module : '').'&catParent='.$section.'">'.$langs->trans('ECMAddSection').'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&token='.newToken().'&module='.$module.'&catParent='.$section.'">'.$langs->trans('ECMAddSection').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('ECMAddSection').'</a>';
|
||||
}
|
||||
|
||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().($module ? '&module='.urlencode($module) : '').'§ion='.urlencode($section).($backtopage ? '&backtopage='.urlencode($backtopage) : ''), '', $permissiontoadd);
|
||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'&module='.urlencode($module).'§ion='.urlencode($section).($backtopage ? '&backtopage='.urlencode($backtopage) : ''), '', $permissiontoadd);
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
@@ -497,7 +497,7 @@ if ($action == 'delete' || $action == 'delete_dir') {
|
||||
);
|
||||
}
|
||||
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode(GETPOST('section', 'alpha')).($module ? '&module='.$module : '').($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $relativepathwithoutslash), 'confirm_deletedir', $formquestion, 1, 1);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode(GETPOST('section', 'alpha')).'&module='.$module.($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $relativepathwithoutslash), 'confirm_deletedir', $formquestion, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ if (empty($reshook)) {
|
||||
$ret = -1;
|
||||
foreach ($TSkillsToAdd as $k => $v) {
|
||||
$skillAdded = new SkillRank($db);
|
||||
$skillAdded->fk_skill = $v;
|
||||
$skillAdded->fk_skill = (int) $v;
|
||||
$skillAdded->fk_object = $id;
|
||||
$skillAdded->objecttype = $objecttype;
|
||||
$ret = $skillAdded->create($user);
|
||||
@@ -177,7 +177,7 @@ if (empty($reshook)) {
|
||||
$objEval = $db->fetch_object($result);
|
||||
$line = new EvaluationLine($db);
|
||||
$line->fk_evaluation = $objEval->rowid;
|
||||
$line->fk_skill = $v;
|
||||
$line->fk_skill = (int) $v;
|
||||
$line->required_rank = 0;
|
||||
$line->fk_rank = 0;
|
||||
|
||||
|
||||
@@ -272,9 +272,10 @@ if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
if (empty($search_projectstatus) && $search_projectstatus == '') {
|
||||
$search_projectstatus = 1;
|
||||
}
|
||||
// already done at line 85
|
||||
// if (empty($search_projectstatus) && $search_projectstatus == '') {
|
||||
// $search_projectstatus = 1;
|
||||
// }
|
||||
|
||||
/*
|
||||
* View
|
||||
|
||||
@@ -711,7 +711,7 @@ if (empty($reshook)) {
|
||||
setEventMessages($langs->trans("ErrorFailedToSetNewPassword"), null, 'errors');
|
||||
} else {
|
||||
// Success
|
||||
if ($action == 'confirm_passwordsend' && $confirm == 'yes') { // Test on permission already done
|
||||
if ($action == 'confirm_passwordsend') { // Test on permission already done
|
||||
if ($object->send_password($user, $newpassword) > 0) {
|
||||
setEventMessages($langs->trans("PasswordChangedAndSentTo", $object->email), null, 'mesgs');
|
||||
} else {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2023-2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2023-2024 Lionel Vessiller <lvessiller@easya.solutions>
|
||||
* Copyright (C) 2023-2024 Patrice Andreani <pandreani@easya.solutions>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -92,7 +92,7 @@ class FormListWebPortal
|
||||
public $contextpage = '';
|
||||
|
||||
/**
|
||||
* @var string[] Search filters
|
||||
* @var array<string|int> Search filters
|
||||
*/
|
||||
public $search = array();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user