diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml new file mode 100644 index 00000000000..b8b18169b58 --- /dev/null +++ b/.github/workflows/pr-18.yaml @@ -0,0 +1,45 @@ +on: + pull_request: + types: [opened, synchronize, reopened] + branches: + - "18.0" + push: + branches: + - "18.0" + +permissions: write-all + +jobs: + run: + runs-on: ubuntu-latest + + env: + # GH_TOKEN: ${{ secrets.GH_TOKEN }} + GH_TOKEN: ${{ github.token }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install GitHub CLI + run: | + 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" + # shellcheck disable=2086 + pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH) + # shellcheck disable=2086 + gh pr edit $pr_number --add-reviewer "$REVIEWER" + continue-on-error: true diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000000..cf263dd0b57 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,19 @@ +on: + workflow_dispatch: + pull_request: + types: [opened, reopened, synchronize] + branches: + - "18.0" + +permissions: write-all + +jobs: + testjob: + runs-on: ubuntu-latest + steps: + - name: Log + run: | + echo "variable org: ${{vars.AAA}}" + echo "env prg: ${{env.AAA}}" + echo "secret org: ${{secrets.BBB}}" + echo "variable repository of orga: ${{vars.CCC}}" diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 192a9985d69..16a99021701 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -2460,12 +2460,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 +2904,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 @@ -3078,18 +3066,6 @@ parameters: 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 @@ -3432,12 +3408,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 @@ -8742,24 +8712,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 +8826,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 +8922,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 +8958,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 +8976,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 +8994,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 +9006,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 +9114,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 +9696,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 +10242,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 +11580,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 @@ -15378,54 +15240,18 @@ parameters: count: 1 path: ../../htdocs/core/modules/oauth/generic_oauthcallback.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/modules/oauth/github_oauthcallback.php - - message: '#^Variable \$state might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/core/modules/oauth/github_oauthcallback.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/modules/oauth/microsoft2_oauthcallback.php - - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/modules/oauth/microsoft_oauthcallback.php - - message: '#^Strict comparison using \=\=\= between null and null will always evaluate to true\.$#' identifier: identical.alwaysTrue count: 2 path: ../../htdocs/core/modules/oauth/stripelive_oauthcallback.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/modules/oauth/stripelive_oauthcallback.php - - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/modules/oauth/stripetest_oauthcallback.php - - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/modules/openid_connect/callback.php - - message: '#^Property mod_payment_cicada\:\:\$prefix has no type specified\.$#' identifier: missingType.property @@ -17526,228 +17352,12 @@ parameters: count: 3 path: ../../htdocs/core/tpl/objectlinked_lineimport.tpl.php - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 29 - path: ../../htdocs/core/tpl/onlinepaymentlinks.tpl.php - - - - message: '#^Variable \$servicename might not be defined\.$#' - identifier: variable.undefined - count: 6 - path: ../../htdocs/core/tpl/onlinepaymentlinks.tpl.php - - message: '#^Variable \$langs might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../htdocs/core/tpl/originproductline.tpl.php - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$disabled might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$dol_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$focus_element might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 10 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$mode might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$urllogo might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$user might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$username might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordforgotten.tpl.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$disabled might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$dol_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$focus_element might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 18 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$mode might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$newpass1 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$newpass2 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$passworduidhash might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$setnewpassword might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$urllogo might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$user might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$username might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/passwordreset.tpl.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/core/tpl/resource_add.tpl.php - - - - message: '#^Variable \$element might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/resource_add.tpl.php - - - - message: '#^Variable \$element_id might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/resource_add.tpl.php - - - - message: '#^Variable \$element_ref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/resource_add.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/core/tpl/resource_add.tpl.php - - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - - - message: '#^Variable \$element might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - - - message: '#^Variable \$element_id might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 7 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - - - message: '#^Variable \$linked_resources might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - - - message: '#^Variable \$mode might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - - - message: '#^Variable \$resource_type might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/core/tpl/resource_view.tpl.php - - message: '#^Variable \$shippingline might not be defined\.$#' identifier: variable.undefined @@ -18156,42 +17766,6 @@ parameters: count: 1 path: ../../htdocs/document.php - - - message: '#^Variable \$hidedesc might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/don/card.php - - - - message: '#^Variable \$hidedetails might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/don/card.php - - - - message: '#^Variable \$hideref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/don/card.php - - - - message: '#^Variable \$newlang in empty\(\) always exists and is always falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/don/card.php - - - - message: '#^Variable \$soc might not be defined\.$#' - identifier: variable.undefined - count: 8 - path: ../../htdocs/don/card.php - - - - message: '#^Variable \$totalpaid might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/don/card.php - - message: '#^Method Donations\:\:_validate\(\) has parameter \$data with no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -18240,39 +17814,9 @@ parameters: count: 1 path: ../../htdocs/don/class/api_donations.class.php - - - message: '#^Call to function method_exists\(\) with \$this\(Don\) and ''LibStatut'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/don/class/don.class.php - - - - message: '#^Call to function method_exists\(\) with \$this\(Don\) and ''getNomUrl'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/don/class/don.class.php - - - - message: '#^Call to function property_exists\(\) with \$this\(Don\) and ''amount'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/don/class/don.class.php - - - - message: '#^Call to function property_exists\(\) with \$this\(Don\) and ''date'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/don/class/don.class.php - - message: '#^Call to function property_exists\(\) with \$this\(Don\) and ''societe'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType - count: 2 - path: ../../htdocs/don/class/don.class.php - - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue count: 1 path: ../../htdocs/don/class/don.class.php @@ -18642,12 +18186,6 @@ parameters: count: 1 path: ../../htdocs/ecm/file_card.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/ecm/file_card.php - - message: '#^Variable \$module might not be defined\.$#' identifier: variable.undefined @@ -18726,12 +18264,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 @@ -18756,18 +18288,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 @@ -18816,12 +18336,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 @@ -18936,12 +18450,6 @@ parameters: count: 1 path: ../../htdocs/eventorganization/conferenceorbooth_contact.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/eventorganization/conferenceorbooth_contact.php - - message: '#^Variable \$mode might not be defined\.$#' identifier: variable.undefined @@ -18972,12 +18480,6 @@ parameters: count: 1 path: ../../htdocs/eventorganization/conferenceorbooth_document.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../htdocs/eventorganization/conferenceorbooth_document.php - - message: '#^Comparison operation "\>" between 0 and 0 is always false\.$#' identifier: greater.alwaysFalse @@ -19032,12 +18534,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 @@ -19104,12 +18600,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 @@ -21282,42 +20772,6 @@ parameters: count: 1 path: ../../htdocs/fourn/commande/document.php - - - message: '#^Variable \$badgeStatus0 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/fourn/commande/index.php - - - - message: '#^Variable \$badgeStatus1 might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/fourn/commande/index.php - - - - message: '#^Variable \$badgeStatus4 might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/fourn/commande/index.php - - - - message: '#^Variable \$badgeStatus6 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/fourn/commande/index.php - - - - message: '#^Variable \$badgeStatus9 might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/fourn/commande/index.php - - - - message: '#^Variable \$socid might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../htdocs/fourn/commande/index.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -21921,42 +21375,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 @@ -22230,12 +21648,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 @@ -24408,24 +23820,6 @@ parameters: count: 1 path: ../../htdocs/master.inc.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/master.inc.php - - - - message: '#^Variable \$dolibarr_main_url_root_alt might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/master.inc.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/master.inc.php - - message: '#^Call to function is_array\(\) with array\ will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -24750,12 +24144,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 @@ -24816,12 +24204,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 @@ -24882,12 +24264,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 @@ -25518,12 +24894,6 @@ parameters: count: 1 path: ../../htdocs/opensurvey/card.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/opensurvey/card.php - - message: '#^Variable \$id might not be defined\.$#' identifier: variable.undefined @@ -25614,66 +24984,18 @@ parameters: count: 1 path: ../../htdocs/opensurvey/class/opensurveysondage.class.php - - - message: '#^Empty array passed to foreach\.$#' - identifier: foreach.emptyArray - count: 1 - path: ../../htdocs/opensurvey/list.php - - - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/opensurvey/list.php - - - - message: '#^Variable \$nbuser might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/opensurvey/list.php - - - - message: '#^Variable \$search_all might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/opensurvey/list.php - - message: '#^Offset int\<0, max\> on array\, int\<0, max\>\> in isset\(\) always exists and is not nullable\.$#' identifier: isset.offset count: 1 path: ../../htdocs/opensurvey/results.php - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/opensurvey/results.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/opensurvey/results.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 1 - path: ../../htdocs/opensurvey/results.php - - message: '#^Variable \$cleinsertion might not be defined\.$#' identifier: variable.undefined count: 2 path: ../../htdocs/opensurvey/results.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/opensurvey/results.php - - message: '#^Variable \$erreur_ajout_date in isset\(\) always exists and is not nullable\.$#' identifier: isset.variable @@ -25722,12 +25044,6 @@ parameters: count: 1 path: ../../htdocs/opensurvey/wizard/create_survey.php - - - message: '#^Variable \$dolibarr_main_url_root might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/partnership/admin/website.php - - message: '#^Left side of && is always false\.$#' identifier: booleanAnd.leftAlwaysFalse @@ -25842,12 +25158,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 @@ -26382,12 +25692,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 @@ -27264,12 +26568,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 @@ -28206,12 +27504,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 @@ -28362,12 +27654,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 @@ -31062,12 +30348,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 @@ -31146,12 +30426,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 @@ -32328,12 +31602,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 @@ -32364,12 +31632,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 @@ -33426,12 +32688,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 @@ -34722,12 +33978,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 @@ -34788,12 +34038,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 @@ -34962,12 +34206,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 @@ -35220,12 +34458,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 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 ''; } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID, $htmltext, 1, 'superadmin'); + print $form->textwithpicto(getDolGlobalString('MAIN_MAIL_SMTPS_ID'), $htmltext, 1, 'superadmin'); print ''; } print ''; @@ -549,7 +549,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_TLS', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS') ? $conf->global->MAIN_MAIL_EMAIL_TLS : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_TLS', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS') ? getDolGlobalString('MAIN_MAIL_EMAIL_TLS') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -562,7 +562,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS') ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS') ? getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -575,7 +575,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED') ? $conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED') ? getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -588,7 +588,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").''; if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('swiftmailer')))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_DKIM_ENABLED', (getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_ENABLED') ? $conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_DKIM_ENABLED', (getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_ENABLED') ? getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_ENABLED') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -599,17 +599,17 @@ if ($action == 'edit') { // DKIM Domain print ''.$langs->trans("MAIN_MAIL_EMAIL_DKIM_DOMAIN").''; - print ''; // DKIM Selector print ''.$langs->trans("MAIN_MAIL_EMAIL_DKIM_SELECTOR").''; - print ''; // DKIM PRIVATE KEY print ''.$langs->trans("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY").''; - print ''; + print ''; print ''; print ''; @@ -632,13 +632,13 @@ if ($action == 'edit') { print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined")); print ' '.$help; print ''; - print ''; // Default from type $liste = array(); $liste['user'] = $langs->trans('UserEmail'); - $liste['company'] = $langs->trans('CompanyEmail').' ('.(!getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')'; + $liste['company'] = $langs->trans('CompanyEmail').' ('.(!getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') ? $langs->trans("NotDefined") : getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')).')'; print ''.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE'), 0); @@ -716,7 +716,7 @@ if ($action == 'edit') { if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) { //print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { - print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_SERVER') ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').''; + print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_SERVER').''; } @@ -724,7 +724,7 @@ if ($action == 'edit') { if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) { //print ''.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { - print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_PORT') ? $conf->global->MAIN_MAIL_SMTP_PORT : '').''; + print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_PORT').''; } // AUTH method @@ -909,7 +909,7 @@ if ($action == 'edit') { print '' . getDolGlobalString('MAIN_MAIL_EMAIL_FROM'); if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM')) { print img_warning($langs->trans("Mandatory")); - } elseif (!isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) { + } elseif (!isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM'))) { print img_warning($langs->trans("ErrorBadEMail")); } print ''; @@ -957,7 +957,7 @@ if ($action == 'edit') { // Errors To print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; print ''.(getDolGlobalString('MAIN_MAIL_ERRORS_TO')); - if (getDolGlobalString('MAIN_MAIL_ERRORS_TO') && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) { + if (getDolGlobalString('MAIN_MAIL_ERRORS_TO') && !isValidEmail(getDolGlobalString('MAIN_MAIL_ERRORS_TO'))) { print img_warning($langs->trans("ErrorBadEMail")); } print ''; diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 78d1e381804..e91f1058b3d 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -363,7 +363,7 @@ if ($action == 'edit') { // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_EMAILING); + print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')); } else { $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')]; if (empty($text)) { @@ -386,7 +386,7 @@ if ($action == 'edit') { print ''; } else { print ''; - $mainserver = (getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING') ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : ''); + $mainserver = getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING'); $smtpserver = ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined"); if ($linuxlike) { print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); @@ -418,7 +418,7 @@ if ($action == 'edit') { print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } else { - $mainport = (getDolGlobalString('MAIN_MAIL_SMTP_PORT_EMAILING') ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : ''); + $mainport = getDolGlobalString('MAIN_MAIL_SMTP_PORT_EMAILING'); $smtpport = ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined"); if ($linuxlike) { print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); @@ -441,7 +441,7 @@ if ($action == 'edit') { print ''; // AUTH method - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").''; $vartosmtpstype = 'MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING'; if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { @@ -469,22 +469,22 @@ if ($action == 'edit') { } // ID - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { - $mainstmpid = (getDolGlobalString('MAIN_MAIL_SMTPS_ID_EMAILING') ? $conf->global->MAIN_MAIL_SMTPS_ID_EMAILING : ''); + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { + $mainstmpid = getDolGlobalString('MAIN_MAIL_SMTPS_ID_EMAILING'); print '' . $langs->trans("MAIN_MAIL_SMTPS_ID") . ''; // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin'); + print $form->textwithpicto(getDolGlobalString('MAIN_MAIL_SMTPS_ID_EMAILING'), $htmltext, 1, 'superadmin'); print ''; } print ''; } // PW - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { $mainsmtppw = getDolGlobalString('MAIN_MAIL_SMTPS_PW_EMAILING'); print '' . $langs->trans("MAIN_MAIL_SMTPS_PW") . ''; // SuperAdministrator access only @@ -499,13 +499,13 @@ if ($action == 'edit') { } // OAUTH service provider - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").''; // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { // @phan-suppress-next-line PhanPluginSuspiciousParamOrder - print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING); + print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING', $oauthservices, getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING')); } else { $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING')]; if (empty($text)) { @@ -521,9 +521,9 @@ if ($action == 'edit') { // TLS print ''.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_EMAILING', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS_EMAILING') ? $conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_EMAILING', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS_EMAILING') ? getDolGlobalString('MAIN_MAIL_EMAIL_TLS_EMAILING') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -534,9 +534,9 @@ if ($action == 'edit') { // STARTTLS print ''.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_EMAILING', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_EMAILING') ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_EMAILING', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_EMAILING') ? getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_EMAILING') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -547,9 +547,9 @@ if ($action == 'edit') { // SMTP_ALLOW_SELF_SIGNED_EMAILING print ''.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING') ? $conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING') ? getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -593,14 +593,14 @@ if ($action == 'edit') { if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'mail')) { //print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { - print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING') ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : '').''; + print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING').''; } // Port if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'mail')) { //print ''.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { - print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_PORT_EMAILING') ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : '').''; + print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_PORT_EMAILING').''; } // AUTH method @@ -618,12 +618,12 @@ if ($action == 'edit') { } // SMTPS ID - if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").''.getDolGlobalString('MAIN_MAIL_SMTPS_ID_EMAILING').''; } // SMTPS PW - if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING') != "XOAUTH2") { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING') != "XOAUTH2") { print ''.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', getDolGlobalString('MAIN_MAIL_SMTPS_PW_EMAILING')).''; } @@ -641,7 +641,7 @@ if ($action == 'edit') { // Nothing } else { print ''.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalString('MAIN_MAIL_EMAIL_TLS_EMAILING')); } else { @@ -658,7 +658,7 @@ if ($action == 'edit') { // Nothing } else { print ''.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_EMAILING')); } else { @@ -675,7 +675,7 @@ if ($action == 'edit') { // Nothing } else { print ''.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING')); } else { @@ -773,8 +773,8 @@ if ($action == 'edit') { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); $formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test"); - $formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM); - $formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM); + $formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : getDolGlobalString('MAIN_MAIL_EMAIL_FROM')); + $formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : getDolGlobalString('MAIN_MAIL_EMAIL_FROM')); $formmail->fromid = $user->id; $formmail->fromalsorobot = 1; $formmail->withfromreadonly = 0; diff --git a/htdocs/admin/mails_ingoing.php b/htdocs/admin/mails_ingoing.php index 12bd4d93ce8..734d83f619c 100644 --- a/htdocs/admin/mails_ingoing.php +++ b/htdocs/admin/mails_ingoing.php @@ -127,7 +127,7 @@ print ''; // SMTPS oauth service if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE') === "XOAUTH2") { - $text = $oauthservices[$conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE]; + $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE')]; if (empty($text)) { $text = $langs->trans("Undefined").img_warning(); } diff --git a/htdocs/admin/mails_passwordreset.php b/htdocs/admin/mails_passwordreset.php index 29c8d203342..5f3b07ce7ee 100644 --- a/htdocs/admin/mails_passwordreset.php +++ b/htdocs/admin/mails_passwordreset.php @@ -358,7 +358,7 @@ if ($action == 'edit') { // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SENDMODE_PASSWORDRESET', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET); + print $form->selectarray('MAIN_MAIL_SENDMODE_PASSWORDRESET', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET')); } else { $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET')]; if (empty($text)) { @@ -381,7 +381,7 @@ if ($action == 'edit') { print ''; } else { print ''; // AUTH method - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { print ''; } // PW - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { $mainsmtppw = getDolGlobalString('MAIN_MAIL_SMTPS_PW_PASSWORDRESET'); print ''; } else { - print ''; + print ''; } // Port if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET') == 'mail')) { //print ''; } else { - print ''; + print ''; } // AUTH method @@ -612,12 +612,12 @@ if ($action == 'edit') { } // SMTPS ID - if (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { print ''; } // SMTPS PW - if (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_PASSWORDRESET') != "XOAUTH2") { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_PASSWORDRESET') != "XOAUTH2") { print ''; } @@ -635,7 +635,7 @@ if ($action == 'edit') { // Nothing } else { print ''; } else { print ''; // AUTH method - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { print ''; } // PW - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { $mainsmtppw = getDolGlobalString('MAIN_MAIL_SMTPS_PW_TICKET'); print ''; } else { - print ''; + print ''; } // Port if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'mail')) { //print ''; } else { - print ''; + print ''; } // AUTH method @@ -610,12 +610,12 @@ if ($action == 'edit') { } // SMTPS ID - if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) { - print ''; + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { + print ''; } // SMTPS PW - if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET') != "XOAUTH2") { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET') != "XOAUTH2") { print ''; } @@ -633,7 +633,7 @@ if ($action == 'edit') { // Nothing } else { 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..75c06444f63 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -188,8 +188,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/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/action/index.php b/htdocs/comm/action/index.php index 770f78b0304..a14381e1b46 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -704,7 +704,11 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on if (!empty($bookcalcalendars["calendars"])) { foreach ($bookcalcalendars["calendars"] as $key => $value) { $label = $value['label']; - $s .= '
 
'; + $s .= '
'; + $s .= ''; + $s .= '  
'; } } } diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 3f67f1ed4c6..57ce524af6b 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -363,7 +363,7 @@ if ($object->id > 0) { print '
'; print '
'; - $mainserver = (getDolGlobalString('MAIN_MAIL_SMTP_SERVER_PASSWORDRESET') ? $conf->global->MAIN_MAIL_SMTP_SERVER_PASSWORDRESET : ''); + $mainserver = getDolGlobalString('MAIN_MAIL_SMTP_SERVER_PASSWORDRESET'); $smtpserver = ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined"); if ($linuxlike) { print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); @@ -413,7 +413,7 @@ if ($action == 'edit') { print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } else { - $mainport = (getDolGlobalString('MAIN_MAIL_SMTP_PORT_PASSWORDRESET') ? $conf->global->MAIN_MAIL_SMTP_PORT_PASSWORDRESET : ''); + $mainport = getDolGlobalString('MAIN_MAIL_SMTP_PORT_PASSWORDRESET'); $smtpport = ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined"); if ($linuxlike) { print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); @@ -436,7 +436,7 @@ if ($action == 'edit') { print '
'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").''; $vartosmtpstype = 'MAIN_MAIL_SMTPS_AUTH_TYPE_PASSWORDRESET'; if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { @@ -464,22 +464,22 @@ if ($action == 'edit') { } // ID - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')))) { - $mainstmpid = (getDolGlobalString('MAIN_MAIL_SMTPS_ID_PASSWORDRESET') ? $conf->global->MAIN_MAIL_SMTPS_ID_PASSWORDRESET : ''); + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { + $mainstmpid = getDolGlobalString('MAIN_MAIL_SMTPS_ID_PASSWORDRESET'); print '
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''; // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_PASSWORDRESET, $htmltext, 1, 'superadmin'); + print $form->textwithpicto(getDolGlobalString('MAIN_MAIL_SMTPS_ID_PASSWORDRESET'), $htmltext, 1, 'superadmin'); print ''; } print '
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''; // SuperAdministrator access only @@ -494,11 +494,11 @@ if ($action == 'edit') { } // OAUTH service provider - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { print '
'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").''; // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_PASSWORDRESET', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_PASSWORDRESET); + print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_PASSWORDRESET', $oauthservices, getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_PASSWORDRESET')); } else { $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_PASSWORDRESET')]; if (empty($text)) { @@ -514,9 +514,9 @@ if ($action == 'edit') { // TLS print '
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_PASSWORDRESET', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS_PASSWORDRESET') ? $conf->global->MAIN_MAIL_EMAIL_TLS_PASSWORDRESET : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_PASSWORDRESET', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS_PASSWORDRESET') ? getDolGlobalString('MAIN_MAIL_EMAIL_TLS_PASSWORDRESET') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -528,9 +528,9 @@ if ($action == 'edit') { // STARTTLS print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET') ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET') ? getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -541,9 +541,9 @@ if ($action == 'edit') { // SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET print '
'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET') ? $conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET') ? getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -587,14 +587,14 @@ if ($action == 'edit') { if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET') == 'mail')) { //print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_SERVER_PASSWORDRESET') ? $conf->global->MAIN_MAIL_SMTP_SERVER_PASSWORDRESET : '').'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_PASSWORDRESET').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_PORT_PASSWORDRESET') ? $conf->global->MAIN_MAIL_SMTP_PORT_PASSWORDRESET : '').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_PORT_PASSWORDRESET').'
'.$langs->trans("MAIN_MAIL_SMTPS_ID").'' . getDolGlobalString('MAIN_MAIL_SMTPS_ID_PASSWORDRESET').'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', getDolGlobalString('MAIN_MAIL_SMTPS_PW_PASSWORDRESET')).'
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalString('MAIN_MAIL_EMAIL_TLS_PASSWORDRESET')); } else { @@ -652,7 +652,7 @@ if ($action == 'edit') { // Nothing } else { print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET')); } else { @@ -669,7 +669,7 @@ if ($action == 'edit') { // Nothing } else { print '
'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET) && in_array($conf->global->MAIN_MAIL_SENDMODE_PASSWORDRESET, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_PASSWORDRESET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET')); } else { diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index 4ffa822f966..6666861cf89 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -358,7 +358,7 @@ if ($action == 'edit') { // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SENDMODE_TICKET', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_TICKET); + print $form->selectarray('MAIN_MAIL_SENDMODE_TICKET', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET')); } else { $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET')]; if (empty($text)) { @@ -381,7 +381,7 @@ if ($action == 'edit') { print ''; - $mainserver = (getDolGlobalString('MAIN_MAIL_SMTP_SERVER_TICKET') ? $conf->global->MAIN_MAIL_SMTP_SERVER_TICKET : ''); + $mainserver = getDolGlobalString('MAIN_MAIL_SMTP_SERVER_TICKET'); $smtpserver = ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined"); if ($linuxlike) { print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); @@ -413,7 +413,7 @@ if ($action == 'edit') { print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; } else { - $mainport = (getDolGlobalString('MAIN_MAIL_SMTP_PORT_TICKET') ? $conf->global->MAIN_MAIL_SMTP_PORT_TICKET : ''); + $mainport = getDolGlobalString('MAIN_MAIL_SMTP_PORT_TICKET'); $smtpport = ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined"); if ($linuxlike) { print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); @@ -436,7 +436,7 @@ if ($action == 'edit') { print '
'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").''; $vartosmtpstype = 'MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET'; if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { @@ -464,22 +464,22 @@ if ($action == 'edit') { } // ID - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { - $mainstmpid = (getDolGlobalString('MAIN_MAIL_SMTPS_ID_TICKET') ? $conf->global->MAIN_MAIL_SMTPS_ID_TICKET : ''); + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { + $mainstmpid = getDolGlobalString('MAIN_MAIL_SMTPS_ID_TICKET'); print '
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''; // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_TICKET, $htmltext, 1, 'superadmin'); + print $form->textwithpicto(getDolGlobalString('MAIN_MAIL_SMTPS_ID_TICKET'), $htmltext, 1, 'superadmin'); print ''; } print '
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''; // SuperAdministrator access only @@ -494,11 +494,11 @@ if ($action == 'edit') { } // OAUTH service provider - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { print '
'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").''; // SuperAdministrator access only if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET); + print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET', $oauthservices, getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET')); } else { $text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET')]; if (empty($text)) { @@ -513,9 +513,9 @@ if ($action == 'edit') { // TLS print '
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_TICKET', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS_TICKET') ? $conf->global->MAIN_MAIL_EMAIL_TLS_TICKET : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_TICKET', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS_TICKET') ? getDolGlobalString('MAIN_MAIL_EMAIL_TLS_TICKET') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -526,9 +526,9 @@ if ($action == 'edit') { // STARTTLS print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_TICKET', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_TICKET') ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS_TICKET : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_TICKET', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_TICKET') ? getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_TICKET') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -539,9 +539,9 @@ if ($action == 'edit') { // SMTP_ALLOW_SELF_SIGNED_TICKET print '
'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_TICKET', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_TICKET') ? $conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_TICKET : 0), 1); + print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_TICKET', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_TICKET') ? getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_TICKET') : 0), 1); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -585,14 +585,14 @@ if ($action == 'edit') { if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'mail')) { //print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_SERVER_TICKET') ? $conf->global->MAIN_MAIL_SMTP_SERVER_TICKET : '').'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ? ini_get('SMTP') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_TICKET').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(getDolGlobalString('MAIN_MAIL_SMTP_PORT_TICKET') ? $conf->global->MAIN_MAIL_SMTP_PORT_TICKET : '').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ? ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.getDolGlobalString('MAIN_MAIL_SMTP_PORT_TICKET').'
'.$langs->trans("MAIN_MAIL_SMTPS_ID").'' . getDolGlobalString('MAIN_MAIL_SMTPS_ID_TICKET').'
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''.getDolGlobalString('MAIN_MAIL_SMTPS_ID_TICKET').'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', getDolGlobalString('MAIN_MAIL_SMTPS_PW_TICKET')).'
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalString('MAIN_MAIL_EMAIL_TLS_TICKET')); } else { @@ -650,7 +650,7 @@ if ($action == 'edit') { // Nothing } else { print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_TICKET')); } else { @@ -667,7 +667,7 @@ if ($action == 'edit') { // Nothing } else { print '
'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_TICKET')); } else { diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 6b6faa7d481..f9cde4b5363 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -290,9 +290,8 @@ if ($action == 'install' && $allowonlineinstall) { if (!is_numeric($checkRes) && $checkRes != '') { $langs->load("errors"); setEventMessages($modulename.' : '.$langs->trans($checkRes), null, 'errors'); + $error++; } - - $error++; } catch (Exception $e) { // Nothing done } diff --git a/htdocs/api/index.php b/htdocs/api/index.php index dd6afb8ddc3..7dab6412a7c 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -174,6 +174,7 @@ $refreshcache = (getDolGlobalString('API_PRODUCTION_DO_NOT_ALWAYS_REFRESH_CACHE' if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) { $refreshcache = true; if (!is_writable($conf->api->dir_temp)) { + dol_syslog("ErrorFailedToWriteInApiTempDirectory ".$conf->api->dir_temp, LOG_ERR); print 'Erreur temp dir api/temp not writable'; header('HTTP/1.1 500 temp dir api/temp not writable'); exit(0); diff --git a/htdocs/asset/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'), '') . '
'; - // Type Prospect/Customer/Supplier + // Nature Prospect/Customer/Supplier print ''; @@ -412,6 +412,7 @@ if ($object->id > 0) { } } print ''; + print ''; } print ''; @@ -432,8 +433,7 @@ if ($object->id > 0) { print ''; print ''; - print ''; print ''; 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 ''; - print ''; + print ''; print ''; $num = $db->num_rows($result); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 10b01316bf0..f917a201b28 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 diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 845b8d3d3d9..18439f484a3 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -160,9 +160,10 @@ class Proposals extends DolibarrApi * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'2016-01-01')" * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* + * @param int $loadlinkedobjects Load also linked object * @return array Array of order objects */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '', $pagination_data = false) + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '', $pagination_data = false, $loadlinkedobjects = 0) { if (!DolibarrApiAccess::$user->hasRight('propal', 'lire')) { throw new RestException(403); @@ -226,12 +227,18 @@ class Proposals extends DolibarrApi while ($i < $min) { $obj = $this->db->fetch_object($result); $proposal_static = new Propal($this->db); - if ($proposal_static->fetch($obj->rowid)) { + if ($proposal_static->fetch($obj->rowid) > 0) { // Add external contacts ids $tmparray = $proposal_static->liste_contact(-1, 'external', 1); if (is_array($tmparray)) { $proposal_static->contacts_ids = $tmparray; } + + if ($loadlinkedobjects) { + // retrieve linked objects + $proposal_static->fetchObjectLinked(); + } + $obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($proposal_static), $properties); } $i++; 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/propal/list.php b/htdocs/comm/propal/list.php index dd089bb36bc..2cc4be7ed80 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -757,8 +757,8 @@ if ($search_note_public) { if ($search_user > 0) { $sql .= " AND EXISTS ("; $sql .= " SELECT ec.fk_c_type_contact, ec.element_id, ec.fk_socpeople"; - $sql .= " FROM llx_element_contact as ec"; - $sql .= " INNER JOIN llx_c_type_contact as tc"; + $sql .= " FROM ".MAIN_DB_PREFIX."element_contact as ec"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_type_contact as tc"; $sql .= " ON ec.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal'"; $sql .= " WHERE ec.element_id = p.rowid AND ec.fk_socpeople = ".((int) $search_user).")"; } diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index 701d9238627..583e77a0ece 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -47,7 +47,8 @@ class Orders extends DolibarrApi */ public function __construct() { - global $db, $conf; + global $db; + $this->db = $db; $this->commande = new Commande($this->db); } @@ -160,12 +161,13 @@ class Orders extends DolibarrApi * @param string $sqlfilterlines Other criteria to filter answers separated by a comma. Syntax example "(tl.fk_product:=:'17') and (tl.price:<:'250')" * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* + * @param int $loadlinkedobjects Load also linked object * @return array Array of order objects * * @throws RestException 404 Not found * @throws RestException 503 Error */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $sqlfilterlines = '', $properties = '', $pagination_data = false) + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $sqlfilterlines = '', $properties = '', $pagination_data = false, $loadlinkedobjects = 0) { if (!DolibarrApiAccess::$user->hasRight('commande', 'lire')) { throw new RestException(403); @@ -239,12 +241,18 @@ class Orders extends DolibarrApi while ($i < $min) { $obj = $this->db->fetch_object($result); $commande_static = new Commande($this->db); - if ($commande_static->fetch($obj->rowid)) { + if ($commande_static->fetch($obj->rowid) > 0) { // Add external contacts ids $tmparray = $commande_static->liste_contact(-1, 'external', 1); if (is_array($tmparray)) { $commande_static->contacts_ids = $tmparray; } + + if ($loadlinkedobjects) { + // retrieve linked objects + $commande_static->fetchObjectLinked(); + } + // Add online_payment_url, cf #20477 require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; $commande_static->online_payment_url = getOnlinePaymentUrl(0, 'order', $commande_static->ref); @@ -1090,6 +1098,7 @@ class Orders extends DolibarrApi $shipment = new Expedition($this->db); $shipment->socid = $this->commande->socid; $shipment->origin_id = $this->commande->id; + $shipment->origin = $this->commande->element; $result = $shipment->create(DolibarrApiAccess::$user); if ($result <= 0) { throw new RestException(500, 'Error on creating expedition :'.$this->db->lasterror()); 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/commande/list.php b/htdocs/commande/list.php index c81932b460e..06806021db2 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1084,8 +1084,8 @@ if ($search_fk_input_reason > 0) { if ($search_user > 0) { $sql .= " AND EXISTS ("; $sql .= " SELECT ec.fk_c_type_contact, ec.element_id, ec.fk_socpeople"; - $sql .= " FROM llx_element_contact as ec"; - $sql .= " INNER JOIN llx_c_type_contact as tc"; + $sql .= " FROM ".MAIN_DB_PREFIX."element_contact as ec"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_type_contact as tc"; $sql .= " ON ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal'"; $sql .= " WHERE ec.element_id = c.rowid AND ec.fk_socpeople = ".((int) $search_user).")"; } diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 3dd37bf0d1b..057ef86ec08 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -609,9 +609,9 @@ $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappr $sql .= " b.fk_account, b.fk_type, b.fk_bordereau,"; $sql .= " ba.rowid as bankid, ba.ref as bankref"; // Add fields from extrafields -if (!empty($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); +if (!empty($extrafields->attributes[$extrafieldsobjectkey]['label'])) { + foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$extrafieldsobjectkey]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks @@ -624,8 +624,8 @@ if ($search_bid > 0) { } $sql .= " ".MAIN_DB_PREFIX."bank_account as ba,"; $sql .= " ".MAIN_DB_PREFIX."bank as b"; -if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (b.rowid = ef.fk_object)"; +if (!empty($extrafields->attributes[$extrafieldsobjectkey]['label']) && is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$extrafieldsobjectkey."_extrafields as ef on (b.rowid = ef.fk_object)"; } // Add fields from hooks @@ -1910,6 +1910,7 @@ if ($resql) { } // Extra fields + $obj = $objp; // Because extrafield template use $obj and not $objp as object variable name include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $objp, 'i' => $i, 'totalarray' => &$totalarray); 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..3db06e726d6 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -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 diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index b4867e8168a..78615f801ba 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -171,21 +171,22 @@ class Invoices extends DolibarrApi * * Get a list of invoices * - * @param string $sortfield Sort field - * @param string $sortorder Sort order - * @param int $limit Limit for list - * @param int $page Page number - * @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} - * @param string $status Filter by invoice status : draft | unpaid | paid | cancelled - * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" - * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names - * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0 - * @return array Array of invoice objects + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} + * @param string $status Filter by invoice status : draft | unpaid | paid | cancelled + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0 + * @param int $loadlinkedobjects Load also linked object + * @return array Array of invoice objects * * @throws RestException 404 Not found * @throws RestException 503 Error */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '', $properties = '', $pagination_data = false) + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '', $properties = '', $pagination_data = false, $loadlinkedobjects = 0) { if (!DolibarrApiAccess::$user->hasRight('facture', 'lire')) { throw new RestException(403); @@ -260,7 +261,7 @@ class Invoices extends DolibarrApi while ($i < $min) { $obj = $this->db->fetch_object($result); $invoice_static = new Facture($this->db); - if ($invoice_static->fetch($obj->rowid)) { + if ($invoice_static->fetch($obj->rowid) > 0) { // Get payment details $invoice_static->totalpaid = $invoice_static->getSommePaiement(); $invoice_static->totalcreditnotes = $invoice_static->getSumCreditNotesUsed(); @@ -272,6 +273,12 @@ class Invoices extends DolibarrApi if (is_array($tmparray)) { $invoice_static->contacts_ids = $tmparray; } + + if ($loadlinkedobjects) { + // retrieve linked objects + $invoice_static->fetchObjectLinked(); + } + // Add online_payment_url, copied from order require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; $invoice_static->online_payment_url = getOnlinePaymentUrl(0, 'invoice', $invoice_static->ref); @@ -1463,7 +1470,7 @@ class Invoices extends DolibarrApi * Add payment line to a specific invoice with the remain to pay as amount. * * @param int $id Id of invoice - * @param string $datepaye {@from body} Payment date {@type timestamp} + * @param string $datepaye {@from body} Payment date * @param int $paymentid {@from body} Payment mode Id {@min 1} * @param string $closepaidinvoices {@from body} Close paid invoices {@choice yes,no} * @param int $accountid {@from body} Account Id {@min 1} @@ -1584,7 +1591,7 @@ class Invoices extends DolibarrApi * Example of value for parameter arrayofamounts: {"1": {"amount": "99.99", "multicurrency_amount": ""}, "2": {"amount": "", "multicurrency_amount": "10"}} * * @param array $arrayofamounts {@from body} Array with id of invoices with amount to pay for each invoice - * @param string $datepaye {@from body} Payment date {@type timestamp} + * @param string $datepaye {@from body} Payment date * @param int $paymentid {@from body} Payment mode Id {@min 1} * @param string $closepaidinvoices {@from body} Close paid invoices {@choice yes,no} * @param int $accountid {@from body} Account Id {@min 1} diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index f9cd158244f..c8839eef4ea 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), diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 7f7eb71398b..883b9484d37 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), diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 36c2f2cd02f..33f8026d589 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -892,8 +892,8 @@ if ($search_fk_fac_rec_source) { if ($search_user > 0) { $sql .= " AND EXISTS ("; $sql .= " SELECT ec.fk_c_type_contact, ec.element_id, ec.fk_socpeople"; - $sql .= " FROM llx_element_contact as ec"; - $sql .= " INNER JOIN llx_c_type_contact as tc"; + $sql .= " FROM ".MAIN_DB_PREFIX."element_contact as ec"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_type_contact as tc"; $sql .= " ON ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal'"; $sql .= " WHERE ec.element_id = f.rowid AND ec.fk_socpeople = ".((int) $search_user).")"; } 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 ''; print '\n"; print '\n"; - print '\n"; + print '\n"; /*print '\n"; print '';*/ diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 7fd7ea75d88..24ce4487aed 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,), @@ -2394,12 +2394,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 +2582,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 +2601,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 +2666,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 ''; + print ''; 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 ''; + print ''; // Date - $date = $obj->periode; + $date = $obj->period; if (empty($date)) { $date = $obj->date_ech; } 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/card.php b/htdocs/contact/card.php index e5cb083f5b0..a3db32f86cb 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -250,7 +250,7 @@ if (empty($reshook)) { // Note: Correct date should be completed with location to have exact GM time of birth. $object->birthday = dol_mktime(0, 0, 0, GETPOSTINT("birthdaymonth"), GETPOSTINT("birthdayday"), GETPOSTINT("birthdayyear")); - $object->birthday_alert = GETPOSTINT("birthday_alert"); + $object->birthday_alert = (GETPOST('birthday_alert', 'alpha') == "on" ? 1 : 0); //Default language $object->default_lang = GETPOST('default_lang'); 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/contact/perso.php b/htdocs/contact/perso.php index bb4027978b1..5e0b71f4995 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -224,9 +224,9 @@ if ($action == 'edit') { print '     '; print ' '; if (!empty($object->birthday_alert)) { - print ''; + print ''; } else { - print ''; + print ''; } print ''; print ''; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 7a5311695ff..5df75ee1c28 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), @@ -486,10 +486,12 @@ class Contrat extends CommonObject $contratline->date_cloture = $now; // For backward compatibility $contratline->user_closing_id = $user->id; $contratline->statut = ContratLigne::STATUS_CLOSED; + $result = $contratline->close_line($user, $now, $comment, $notrigger); + if ($result < 0) { $error++; - $this->error = $contratline->error; + $this->error = $contratline->error.($contratline->error ? ' ('.$this->ref.')' : ''); $this->errors = $contratline->errors; break; } 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/commonobject.class.php b/htdocs/core/class/commonobject.class.php index da9598491b6..d8a38f532e8 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(); @@ -7469,7 +7469,7 @@ abstract class CommonObject $validationClass = ' --success'; // the -- is use as class state in css : .--success can't be be defined alone it must be define with another class like .my-class.--success or input.--success } - $valuemultiselectinput = array(); + //$valuemultiselectinput = array(); $out = ''; $type = ''; $isDependList = 0; @@ -7538,6 +7538,8 @@ abstract class CommonObject $required = (!empty($this->fields[$key]['required']) ? $this->fields[$key]['required'] : 0); // @phan-suppress-next-line PhanTypeMismatchProperty $autofocusoncreate = (!empty($this->fields[$key]['autofocusoncreate']) ? $this->fields[$key]['autofocusoncreate'] : 0); + // @phan-suppress-next-line PhanTypeMismatchProperty + $placeholder = (!empty($this->fields[$key]['placeholder']) ? $this->fields[$key]['placeholder'] : 0); // @phan-suppress-next-line PhanTypeMismatchProperty $langfile = (!empty($this->fields[$key]['langfile']) ? $this->fields[$key]['langfile'] : ''); @@ -7618,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 : '').($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 +8917,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 @@ -9201,6 +9203,10 @@ abstract class CommonObject if (($mode == 'create') && !in_array(abs($visibility), array(1, 3))) { continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list } elseif (($mode == 'edit') && !in_array(abs($visibility), array(1, 3, 4))) { + // We need to make sure, that the values of hidden extrafields are also part of $_POST. Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost + $ef_name = 'options_' . $key; + $ef_value = $this->array_options[$ef_name]; + $out .= '' . "\n"; continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation } elseif ($mode == 'view' && empty($visibility)) { continue; 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/conf.class.php b/htdocs/core/class/conf.class.php index 02e4d63e5f0..3848b19cc28 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -1082,6 +1082,11 @@ class Conf extends stdClass $this->global->USE_STRICT_CSV_RULES = 2; } + // By default, accept to create members with no login + if (!isset($this->global->ADHERENT_LOGIN_NOT_REQUIRED)) { + $this->global->ADHERENT_LOGIN_NOT_REQUIRED = 1; + } + // Use a SCA ready workflow with Stripe module (STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION by default if nothing defined) if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) { $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1; 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/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 b9a46a4ba3a..fe629b0153e 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -13,6 +13,7 @@ * Copyright (C) 2022 Antonin MARCHAL * Copyright (C) 2024 MDW * Copyright (C) 2024 Benoît PASCAL + * Copyright (C) 2024 Joachim Kueter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,7 +47,7 @@ class ExtraFields public $db; /** - * @var array,type:array,size:array,default:array,computed:array,unique:array,required:array,param:array,perms:array,list:array,pos:array,totalizable:array,help:array,printable:array,enabled:array,langfile:array,css:array,csslist:array,cssview:array,hidden:array,mandatoryfieldsofotherentities:array,loaded?:int,count:int}> New array to store extrafields definition Note: count set as present to avoid static analysis notices + * @var array,type:array,size:array,default:array,computed:array,unique:array,required:array,param:array,perms:array,list:array,pos:array,totalizable:array,help:array,printable:array,enabled:array,langfile:array,css:array,csslist:array,cssview:array,hidden:array,mandatoryfieldsofotherentities:array,alwayseditable:array>,loaded?:int,count:int}> New array to store extrafields definition Note: count set as present to avoid static analysis notices */ public $attributes = array(); @@ -180,7 +181,9 @@ class ExtraFields // Add declaration of field into table $result2 = $this->create_label($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $param, $alwayseditable, $perms, $list, $help, $default_value, $computed, $entity, $langfile, $enabled, $totalizable, $printable, $moreparams); $err2 = $this->errno; - if ($result2 > 0 || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS')) { + if ($result2 > 0 + || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS') + || ($type == 'separate' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS')) { $this->error = ''; $this->errno = '0'; return 1; @@ -648,7 +651,7 @@ 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 @@ -2899,7 +2902,11 @@ class ExtraFields if (!GETPOSTISSET($keyprefix."options_".$key.$keysuffix)) { continue; // Value was not provided, we should not set it. } + $value_key = GETPOST($keyprefix."options_".$key.$keysuffix); + if ($value_key === '') { + $value_key = null; + } } $array_options[$keyprefix."options_".$key] = $value_key; // No keyprefix here. keyprefix is used only for read. diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d4157ac59c0..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 .= " @@ -11313,6 +11315,13 @@ class Form '; + // Convert $arrayoffiltercriterias into a json object that can be used in jquery to build the search component dynamically + $arrayoffiltercriterias_json = json_encode($arrayoffiltercriterias); + $ret .= ''; + + $arrayoffilterfieldslabel = array(); foreach ($arrayoffiltercriterias as $key => $val) { $arrayoffilterfieldslabel[$key]['label'] = $val['label']; @@ -11356,6 +11365,19 @@ class Form $ret .= $form->selectDate(($dateOne ? $dateOne : -1), 'dateone', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, ''); $ret .= ''; + // Value selector (will be populated dynamically) based on search_filter_field value if a selected value has an array of values + $ret .= ''; + $ret .= ''; + $ret .= '
'; $ret .= '
'; @@ -11390,10 +11412,21 @@ class Form $ret .= '
'.$langs->trans('NatureOfThirdParty').''; print $object->getTypeUrl(1); print '
'; print $form->textwithpicto($langs->trans('VATIsUsed'),$langs->trans('VATIsUsedWhenSelling')); - print ''; + print ''; print yn($object->tva_assuj); print '
'; + 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/index.php b/htdocs/comm/mailing/index.php index 5151e5223d9..225ba2eb748 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -83,11 +83,11 @@ print ''; print '
'; print ''; print ''; -print ''; print ''; -print ''; +print ''; print "
'.$titlesearch.'
'; +print '
'; print $langs->trans("Ref").':
'; -print $langs->trans("Other").':
'; +print $langs->trans("Other").':

\n"; @@ -189,7 +189,7 @@ if ($result) { print ' | '.$langs->trans("Phone"); } print '
'.$langs->trans("AllEMailings").'...
'.$langs->trans("Ref").''.$chid.'
'.$langs->trans("Label").''.$charge->label."
'.$langs->trans("Type")."".$charge->type_label."
'.$langs->trans("Period")."".dol_print_date($charge->periode, 'day')."
'.$langs->trans("Period")."".dol_print_date($charge->period, 'day')."
'.$langs->trans("DateDue")."".dol_print_date($charge->date_ech,'day')."
'.$langs->trans("Amount")."".price($charge->amount,0,$outputlangs,1,-1,-1,$conf->currency).'
'.dol_print_date($db->jdate($obj->periode), 'day').''.dol_print_date($db->jdate($obj->period), 'day').''.$obj->type_label.''.dolPrintHTML($obj->type_label).'