Merge branch 'develop' into extrafields_object_filter

This commit is contained in:
Frédéric FRANCE 2024-11-25 21:43:27 +01:00 committed by GitHub
commit 95fadde61b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
121 changed files with 869 additions and 848 deletions

View file

@ -36,12 +36,13 @@ Definition:
As the Developer:
1. [Fork](https://help.github.com/articles/fork-a-repo) the [GitHub repository](https://github.com/Dolibarr/dolibarr).
2. Clone your fork.
3. Choose a branch(See the [Branches](#branches) section below).
4. Read our developer documentation on the [Dolibarr Wiki](https://wiki.dolibarr.org/index.php?title=Developer_documentation).
5. Commit and push your changes.
6. [Make a pull request](https://help.github.com/articles/creating-a-pull-request).
1. Check you agree with the terms of the [DCO - Developer's Certificate of Origin](https://github.com/Dolibarr/dolibarr/DCO)
2. [Fork](https://help.github.com/articles/fork-a-repo) the [GitHub repository](https://github.com/Dolibarr/dolibarr).
3. Clone your fork.
4. Choose a branch(See the [Branches](#branches) section below).
5. Read our developer documentation on the [Dolibarr Wiki](https://wiki.dolibarr.org/index.php?title=Developer_documentation).
6. Commit and push your changes.
7. [Make a pull request](https://help.github.com/articles/creating-a-pull-request).
As the PR Maintainer:

View file

@ -12,8 +12,9 @@ Security report are valid only on current stable version (see https://dolibarr.o
To report a vulnerability, for a private report, you can:
- Send your report on Vulnerability Disclosure Program (VDP) [https://app.yogosha.com/cvd/dolibarr/10VxeNx6Ui3rSEhAgX63US](https://app.yogosha.com/cvd/dolibarr/10VxeNx6Ui3rSEhAgX63US) (recommended for everybody)
- Send your report on Vulnerability Disclosure Program (VDP): Link will be updated soon (recommended for everybody)
<!--
- Send your report on Vulnerability Disclosure Program (VDP) [https://app.yogosha.com/cvd/dolibarr/10VxeNx6Ui3rSEhAgX63US](https://app.yogosha.com/cvd/dolibarr/10VxeNx6Ui3rSEhAgX63US) (recommended for everybody)
- Or if you have permissions, use GitHub security advisory at [https://github.com/Dolibarr/dolibarr/security/advisories/new](https://github.com/Dolibarr/dolibarr/security/advisories/new)
-->
- Or send an email to security@dolibarr.org with clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary.

View file

@ -972,12 +972,6 @@ parameters:
count: 2
path: ../../htdocs/adherents/class/adherent.class.php
-
message: '#^Call to function is_array\(\) with array\{\}\|array\{mixed\} will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/adherents/class/adherent.class.php
-
message: '#^Call to function method_exists\(\) with \$this\(Adherent\) and ''getLibStatut'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -1014,36 +1008,12 @@ parameters:
count: 5
path: ../../htdocs/adherents/class/adherent.class.php
-
message: '#^PHPDoc tag @var with type Contact is not subtype of native type \$this\(Adherent\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/adherents/class/adherent.class.php
-
message: '#^PHPDoc tag @var with type Societe is not subtype of native type \$this\(Adherent\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/adherents/class/adherent.class.php
-
message: '#^PHPDoc tag @var with type User is not subtype of native type \$this\(Adherent\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/adherents/class/adherent.class.php
-
message: '#^Parameter \#1 \$substitutionarray of function complete_substitutions_array expects array\<string, string\>, array\<string, int\|string\> given\.$#'
identifier: argument.type
count: 1
path: ../../htdocs/adherents/class/adherent.class.php
-
message: '#^Property Adherent\:\:\$email \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../htdocs/adherents/class/adherent.class.php
-
message: '#^Property Adherent\:\:\$first_subscription_amount \(int\|string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
@ -1056,16 +1026,10 @@ parameters:
count: 1
path: ../../htdocs/adherents/class/adherent.class.php
-
message: '#^Property Adherent\:\:\$societe \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../htdocs/adherents/class/adherent.class.php
-
message: '#^Ternary operator condition is always false\.$#'
identifier: ternary.alwaysFalse
count: 2
count: 1
path: ../../htdocs/adherents/class/adherent.class.php
-
@ -1224,18 +1188,6 @@ parameters:
count: 1
path: ../../htdocs/adherents/partnership.php
-
message: '#^Variable \$label might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../htdocs/adherents/stats/geo.php
-
message: '#^Variable \$theme_datacolor might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../htdocs/adherents/stats/geo.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
@ -5280,12 +5232,6 @@ parameters:
count: 2
path: ../../htdocs/compta/bank/bankentries_list.php
-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
count: 2
path: ../../htdocs/compta/bank/bankentries_list.php
-
message: '#^Left side of && is always true\.$#'
identifier: booleanAnd.leftAlwaysTrue
@ -5568,12 +5514,6 @@ parameters:
count: 3
path: ../../htdocs/compta/bank/list.php
-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
count: 2
path: ../../htdocs/compta/bank/releve.php
-
message: '#^Variable \$buttonreconcile might not be defined\.$#'
identifier: variable.undefined
@ -7674,12 +7614,6 @@ parameters:
count: 3
path: ../../htdocs/compta/tva/payments.php
-
message: '#^Call to function is_array\(\) with list\<array\{id\: mixed, descr\: mixed, pid\: mixed, pref\: mixed, ptype\: int, payment_id\: mixed, payment_ref\: mixed, payment_amount\: mixed, \.\.\.\}\|array\{id\: mixed, descr\: mixed, pid\: mixed, pref\: mixed, ptype\: mixed, payment_id\: mixed, payment_ref\: mixed, payment_amount\: mixed, \.\.\.\}\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/compta/tva/quadri_detail.php
-
message: '#^Call to function is_array\(\) with list\<array\{id\: mixed, descr\: mixed, pid\: mixed, pref\: mixed, ptype\: mixed, payment_id\: mixed, payment_ref\: mixed, payment_amount\: mixed, \.\.\.\}\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -7860,12 +7794,6 @@ parameters:
count: 1
path: ../../htdocs/contact/card.php
-
message: '#^Call to function is_array\(\) with array\{\}\|array\{mixed\} will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/contact/class/contact.class.php
-
message: '#^Call to function method_exists\(\) with \$this\(Contact\) and ''getLibStatut'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -7902,33 +7830,9 @@ parameters:
count: 3
path: ../../htdocs/contact/class/contact.class.php
-
message: '#^PHPDoc tag @var with type Contact is not subtype of native type \$this\(Contact\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/contact/class/contact.class.php
-
message: '#^PHPDoc tag @var with type Societe is not subtype of native type \$this\(Contact\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/contact/class/contact.class.php
-
message: '#^PHPDoc tag @var with type User is not subtype of native type \$this\(Contact\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/contact/class/contact.class.php
-
message: '#^Property CommonObject\:\:\$entity \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 2
path: ../../htdocs/contact/class/contact.class.php
-
message: '#^Property Contact\:\:\$email \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../htdocs/contact/class/contact.class.php
@ -7944,12 +7848,6 @@ parameters:
count: 1
path: ../../htdocs/contact/class/contact.class.php
-
message: '#^Ternary operator condition is always false\.$#'
identifier: ternary.alwaysFalse
count: 1
path: ../../htdocs/contact/class/contact.class.php
-
message: '#^Variable \$url in empty\(\) always exists and is not falsy\.$#'
identifier: empty.variable
@ -12348,24 +12246,6 @@ parameters:
count: 1
path: ../../htdocs/core/lib/project.lib.php
-
message: '#^Parameter \#1 \$inc of function projectLinesPerDay expects string, \(float\|int\) given\.$#'
identifier: argument.type
count: 1
path: ../../htdocs/core/lib/project.lib.php
-
message: '#^Parameter \#1 \$inc of function projectLinesPerMonth expects string, \(float\|int\) given\.$#'
identifier: argument.type
count: 1
path: ../../htdocs/core/lib/project.lib.php
-
message: '#^Parameter \#1 \$inc of function projectLinesPerWeek expects string, \(float\|int\) given\.$#'
identifier: argument.type
count: 1
path: ../../htdocs/core/lib/project.lib.php
-
message: '#^Property Task\:\:\$progress \(int\|string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
@ -17976,12 +17856,6 @@ parameters:
count: 2
path: ../../htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php
-
message: '#^Negated boolean expression is always false\.$#'
identifier: booleanNot.alwaysFalse
count: 2
path: ../../htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php
-
message: '#^Variable \$old_MAIN_MAIL_AUTOCOPY_TO might not be defined\.$#'
identifier: variable.undefined
@ -18438,12 +18312,6 @@ parameters:
count: 1
path: ../../htdocs/don/class/api_donations.class.php
-
message: '#^Call to function is_array\(\) with array\{\}\|array\{mixed\} 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 ''LibStatut'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -18480,42 +18348,12 @@ parameters:
count: 1
path: ../../htdocs/don/class/don.class.php
-
message: '#^PHPDoc tag @var with type Contact is not subtype of native type \$this\(Don\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/don/class/don.class.php
-
message: '#^PHPDoc tag @var with type Societe is not subtype of native type \$this\(Don\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/don/class/don.class.php
-
message: '#^PHPDoc tag @var with type User is not subtype of native type \$this\(Don\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/don/class/don.class.php
-
message: '#^Property Don\:\:\$email \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../htdocs/don/class/don.class.php
-
message: '#^Property Don\:\:\$societe \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../htdocs/don/class/don.class.php
-
message: '#^Ternary operator condition is always false\.$#'
identifier: ternary.alwaysFalse
count: 1
path: ../../htdocs/don/class/don.class.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
@ -19110,12 +18948,6 @@ parameters:
count: 1
path: ../../htdocs/eventorganization/class/conferenceorboothattendee.class.php
-
message: '#^Property CommonObject\:\:\$name \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../htdocs/eventorganization/class/conferenceorboothattendee.class.php
-
message: '#^Property ConferenceOrBoothAttendee\:\:\$lastname \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
@ -28374,12 +28206,6 @@ parameters:
count: 1
path: ../../htdocs/projet/activity/perday.php
-
message: '#^Parameter \#1 \$inc of function projectLinesPerDay expects string, int given\.$#'
identifier: argument.type
count: 1
path: ../../htdocs/projet/activity/perday.php
-
message: '#^Parameter \#11 \$isavailable of function projectLinesPerDay expects array\<int, array\{morning\: int\<0, 1\>, afternoon\: int\<0, 1\>\}\>, non\-empty\-array\<int\|string, array\{morning\: false, afternoon\: false, morning_reason\: ''public_holiday'', afternoon_reason\: ''public_holiday''\}\|array\{morning_reason\?\: string, afternoon_reason\?\: string\}\> given\.$#'
identifier: argument.type
@ -28458,12 +28284,6 @@ parameters:
count: 1
path: ../../htdocs/projet/activity/permonth.php
-
message: '#^Parameter \#1 \$inc of function projectLinesPerMonth expects string, int given\.$#'
identifier: argument.type
count: 1
path: ../../htdocs/projet/activity/permonth.php
-
message: '#^Parameter \#14 \$arrayfields of function projectLinesPerMonth expects array\<string\>, array\<string, array\<string, string\>\> given\.$#'
identifier: argument.type
@ -28518,12 +28338,6 @@ parameters:
count: 1
path: ../../htdocs/projet/activity/perweek.php
-
message: '#^Parameter \#1 \$inc of function projectLinesPerWeek expects string, int given\.$#'
identifier: argument.type
count: 1
path: ../../htdocs/projet/activity/perweek.php
-
message: '#^Parameter \#11 \$isavailable of function projectLinesPerWeek expects array\<int, array\{morning\: int\<0, 1\>, afternoon\: int\<0, 1\>\}\>, non\-empty\-array\<int, array\{morning\: false, afternoon\: false, morning_reason\: ''public_holiday'', afternoon_reason\: ''public_holiday''\}\|array\{morning_reason\?\: string, afternoon_reason\?\: string\}\> given\.$#'
identifier: argument.type
@ -29190,12 +29004,6 @@ parameters:
count: 1
path: ../../htdocs/projet/tasks.php
-
message: '#^Parameter \#1 \$inc of function projectLinesa expects string, int given\.$#'
identifier: argument.type
count: 1
path: ../../htdocs/projet/tasks.php
-
message: '#^Parameter \#13 \$arrayfields of function projectLinesa expects array\<string, float\|int\|string\|null\>, array\<string, array\<string, string\>\> given\.$#'
identifier: argument.type
@ -31416,12 +31224,6 @@ parameters:
count: 1
path: ../../htdocs/recruitment/class/recruitmentcandidature.class.php
-
message: '#^Call to function property_exists\(\) with \$this\(RecruitmentCandidature\) and ''phone'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/recruitment/class/recruitmentcandidature.class.php
-
message: '#^Call to function property_exists\(\) with RecruitmentCandidature and ''date_creation'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -31464,24 +31266,12 @@ parameters:
count: 1
path: ../../htdocs/recruitment/class/recruitmentcandidature.class.php
-
message: '#^Property CommonObject\:\:\$name \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../htdocs/recruitment/class/recruitmentcandidature.class.php
-
message: '#^Property RecruitmentCandidature\:\:\$fields \(array\<string, array\{type\: string, label\: string, enabled\: int\<0, 2\>\|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\:\:\$lastname \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../htdocs/recruitment/class/recruitmentcandidature.class.php
-
message: '#^Property RecruitmentCandidature\:\:\$status \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
@ -31836,30 +31626,6 @@ parameters:
count: 1
path: ../../htdocs/resource/card.php
-
message: '#^Call to function is_array\(\) with array\{\}\|array\{mixed\} will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/resource/class/dolresource.class.php
-
message: '#^PHPDoc tag @var with type Contact is not subtype of native type \$this\(Dolresource\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/resource/class/dolresource.class.php
-
message: '#^PHPDoc tag @var with type Societe is not subtype of native type \$this\(Dolresource\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/resource/class/dolresource.class.php
-
message: '#^PHPDoc tag @var with type User is not subtype of native type \$this\(Dolresource\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/resource/class/dolresource.class.php
-
message: '#^Property CommonObject\:\:\$ref \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
@ -31899,7 +31665,7 @@ parameters:
-
message: '#^Property Dolresource\:\:\$email \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 3
count: 2
path: ../../htdocs/resource/class/dolresource.class.php
-
@ -31944,12 +31710,6 @@ parameters:
count: 2
path: ../../htdocs/resource/class/dolresource.class.php
-
message: '#^Ternary operator condition is always false\.$#'
identifier: ternary.alwaysFalse
count: 1
path: ../../htdocs/resource/class/dolresource.class.php
-
message: '#^Call to function is_numeric\(\) with float\|int\<min, \-1\>\|int\<1, max\>\|\(non\-falsy\-string&numeric\-string\) will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -32724,12 +32484,6 @@ parameters:
count: 2
path: ../../htdocs/societe/class/companybankaccount.class.php
-
message: '#^Call to function is_array\(\) with array\{\}\|array\{mixed\} will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/societe/class/societe.class.php
-
message: '#^Call to function method_exists\(\) with \$this\(Societe\) and ''getLibStatut'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -32766,24 +32520,6 @@ parameters:
count: 6
path: ../../htdocs/societe/class/societe.class.php
-
message: '#^PHPDoc tag @var with type Contact is not subtype of native type \$this\(Societe\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/societe/class/societe.class.php
-
message: '#^PHPDoc tag @var with type Societe is not subtype of native type \$this\(Societe\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/societe/class/societe.class.php
-
message: '#^PHPDoc tag @var with type User is not subtype of native type \$this\(Societe\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/societe/class/societe.class.php
-
message: '#^Property Contact\:\:\$roles \(array\<int, array\{id\: int, socid\: int, element\: string, source\: string, code\: string, label\: string\}\>\) does not accept non\-empty\-list\<string\>\.$#'
identifier: assign.propertyType
@ -32802,16 +32538,10 @@ parameters:
count: 1
path: ../../htdocs/societe/class/societe.class.php
-
message: '#^Property Societe\:\:\$email \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../htdocs/societe/class/societe.class.php
-
message: '#^Property Societe\:\:\$entity \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 3
count: 2
path: ../../htdocs/societe/class/societe.class.php
-
@ -32850,12 +32580,6 @@ parameters:
count: 1
path: ../../htdocs/societe/class/societe.class.php
-
message: '#^Ternary operator condition is always false\.$#'
identifier: ternary.alwaysFalse
count: 1
path: ../../htdocs/societe/class/societe.class.php
-
message: '#^Property SocieteAccount\:\:\$fields \(array\<string, array\{type\: string, label\: string, enabled\: int\<0, 2\>\|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
@ -34518,12 +34242,6 @@ parameters:
count: 1
path: ../../htdocs/user/class/api_users.class.php
-
message: '#^Call to function is_array\(\) with array\{\}\|array\{mixed\} will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../htdocs/user/class/user.class.php
-
message: '#^Call to function method_exists\(\) with \$this\(User\) and ''getLibStatut'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
@ -34548,36 +34266,12 @@ parameters:
count: 3
path: ../../htdocs/user/class/user.class.php
-
message: '#^PHPDoc tag @var with type Contact is not subtype of native type \$this\(User\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/user/class/user.class.php
-
message: '#^PHPDoc tag @var with type Societe is not subtype of native type \$this\(User\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/user/class/user.class.php
-
message: '#^PHPDoc tag @var with type User is not subtype of native type \$this\(User\)\.$#'
identifier: varTag.nativeType
count: 1
path: ../../htdocs/user/class/user.class.php
-
message: '#^Parameter \#1 \$array of function dol_sort_array contains unresolvable type\.$#'
identifier: argument.unresolvableType
count: 1
path: ../../htdocs/user/class/user.class.php
-
message: '#^Property User\:\:\$email \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../htdocs/user/class/user.class.php
-
message: '#^Property User\:\:\$entity \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
@ -34644,12 +34338,6 @@ parameters:
count: 1
path: ../../htdocs/user/class/user.class.php
-
message: '#^Ternary operator condition is always false\.$#'
identifier: ternary.alwaysFalse
count: 1
path: ../../htdocs/user/class/user.class.php
-
message: '#^Variable \$whereforadd in empty\(\) always exists and is not falsy\.$#'
identifier: empty.variable

View file

@ -54,14 +54,6 @@ $search_subaccount = GETPOST('search_subaccount', 'alpha');
$search_label = GETPOST('search_label', 'alpha');
$search_type = GETPOST('search_type', 'intcomma');
// Security check
if ($user->socid > 0) {
accessforbidden();
}
if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden();
}
// Load variable for pagination
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
@ -92,6 +84,14 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
unset($arrayfields['reconcilable']);
}
// Security check
if ($user->socid > 0) {
accessforbidden();
}
if (!$user->hasRight('accounting', 'chartofaccount')) { // after this test, $user->hasRight('accounting', 'chartofaccount') is always valid
accessforbidden();
}
/*
* Actions
@ -124,6 +124,13 @@ if (empty($reshook)) {
$search_type = "";
$search_array_options = array();
}
if ($action == 'enable' /* && $user->hasRight('accounting', 'chartofaccount') */) { // test useless
setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'errors');
}
if ($action == 'disable' /* && $user->hasRight('accounting', 'chartofaccount') */) {
setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'errors');
}
}
@ -142,7 +149,7 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-adm
// Customer
$sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '1' as type, sa.entity, sa.client as nature";
$sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '1' as type, sa.entity, sa.client as nature, sa.fournisseur as nature2";
$sql .= " FROM ".MAIN_DB_PREFIX."societe sa";
$sql .= " WHERE sa.entity IN (".getEntity('societe').")";
$sql .= " AND sa.code_compta <> ''";
@ -163,7 +170,6 @@ if (strlen(trim($search_subaccount))) {
}
}
//var_dump($search_subaccount); exit;
if ($search_subaccount_tmp) {
if ($weremovedsomezero) {
$search_subaccount_tmp_clean = $search_subaccount_tmp;
@ -190,7 +196,8 @@ if (!empty($search_type) && $search_type >= 0) {
// Supplier
$sql .= " UNION ";
$sql .= " SELECT sa.rowid, sa.nom as label, sa.code_compta_fournisseur as subaccount, '2' as type, sa.entity, '0' as nature FROM ".MAIN_DB_PREFIX."societe sa";
$sql .= " SELECT sa.rowid, sa.nom as label, sa.code_compta_fournisseur as subaccount, '2' as type, sa.entity, sa.client as nature, sa.fournisseur as nature2";
$sql .= " FROM ".MAIN_DB_PREFIX."societe sa";
$sql .= " WHERE sa.entity IN (".getEntity('societe').")";
$sql .= " AND sa.code_compta_fournisseur <> ''";
//print $sql;
@ -237,7 +244,8 @@ if (!empty($search_type) && $search_type >= 0) {
// User - Employee
$sql .= " UNION ";
$sql .= " SELECT u.rowid, u.lastname as label, u.accountancy_code as subaccount, '3' as type, u.entity, '0' as nature FROM ".MAIN_DB_PREFIX."user u";
$sql .= " SELECT u.rowid, u.lastname as label, u.accountancy_code as subaccount, '3' as type, u.entity, '0' as nature, '0' as nature2";
$sql .= " FROM ".MAIN_DB_PREFIX."user u";
$sql .= " WHERE u.entity IN (".getEntity('user').")";
$sql .= " AND u.accountancy_code <> ''";
//print $sql;
@ -368,7 +376,7 @@ if ($resql) {
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="'.$search_label.'"></td>';
}
if (!empty($arrayfields['type']['checked'])) {
print '<td class="liste_titre center">'.$form->selectarray('search_type', array('1'=>$langs->trans('Customer'), '2'=>$langs->trans('Supplier'), '3'=>$langs->trans('Employee')), $search_type, 1).'</td>';
print '<td class="liste_titre center">'.$form->selectarray('search_type', array('1'=>$langs->trans('Customer').' / '.$langs->trans("Prospect"), '2'=>$langs->trans('Supplier'), '3'=>$langs->trans('Employee')), $search_type, 1).'</td>';
}
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
if (!empty($arrayfields['reconcilable']['checked'])) {
@ -409,12 +417,25 @@ if ($resql) {
}
print "</tr>\n";
$companystatic = new Societe($db);
$totalarray = array();
$totalarray['nbfield'] = 0;
$i = 0;
while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql);
if ($obj->type == 1) {
$companystatic->id = $obj->id;
$companystatic->client = $obj->nature;
$companystatic->fournisseur = 0;
}
if ($obj->type == 2) {
$companystatic->id = $obj->id;
$companystatic->client = 0;
$companystatic->fournisseur = $obj->nature2;
}
print '<tr class="oddeven">';
// Action column
@ -466,7 +487,12 @@ if ($resql) {
// Customer
if ($obj->type == 1) {
$s .= '<a class="customer-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->rowid.'">'.$langs->trans("Customer").'</a>';
$s .= '<a class="customer-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->rowid.'">';
$s .= $langs->trans("Customer");
$s .= '</a>';
if ($obj->nature == 2) {
$s .= ' <span class="warning">('.$langs->trans("Prospect").')</span>';
}
} elseif ($obj->type == 2) {
// Supplier
$s .= '<a class="vendor-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->rowid.'">'.$langs->trans("Supplier").'</a>';
@ -475,9 +501,6 @@ if ($resql) {
$s .= '<a class="user-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->rowid.'">'.$langs->trans("Employee").'</a>';
}
print $s;
if ($obj->nature == 2) {
print ' <span class="warning bold">('.$langs->trans("Prospect").')</span>';
}
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
@ -489,11 +512,11 @@ if ($resql) {
if (!empty($arrayfields['reconcilable']['checked'])) {
print '<td class="center">';
if (empty($obj->reconcilable)) {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=1&token='.newToken().'">';
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=1&page='.$page.'&token='.newToken().'">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
} else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&mode=1&token='.newToken().'">';
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&mode=1&page='.$page.'&token='.newToken().'">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a>';
}

View file

@ -1623,7 +1623,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (isModEnabled('mailman') && getDolGlobalString('ADHERENT_USE_SPIP')) {
$formquestion[] = array('type' => 'other', 'label' => $langs->transnoentitiesnoconv("SynchroSpipEnabled"), 'value' => '');
}
print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ValidateMember"), $langs->trans("ConfirmValidateMember"), "confirm_valid", $formquestion, 'yes', 1, 220);
print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ValidateMember"), $langs->trans("ConfirmValidateMember"), "confirm_valid", $formquestion, 'yes', 1, 250);
}
// Confirm resiliate

View file

@ -112,14 +112,14 @@ class Adherent extends CommonObject
public $civility;
/**
* @var string company name
* @var ?string company name
* @deprecated Use $company
* @see $company
*/
public $societe;
/**
* @var string company name
* @var ?string company name
*/
public $company;
@ -646,6 +646,9 @@ class Adherent extends CommonObject
}
}
// setEntity will set entity with the right value if empty or change it for the right value if multicompany module is active
$this->entity = setEntity($this);
$this->db->begin();
// Insert member
@ -658,7 +661,7 @@ class Adherent extends CommonObject
$sql .= ", ".($user->id > 0 ? $user->id : "null"); // Can be null because member can be created by a guest or a script
$sql .= ", null, null, '".$this->db->escape($this->morphy)."'";
$sql .= ", ".((int) $this->typeid);
$sql .= ", ".$conf->entity;
$sql .= ", ".((int) $this->entity);
$sql .= ", ".(!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null");
$sql .= ", ".(!empty($this->ip) ? "'".$this->db->escape($this->ip)."'" : "null");
$sql .= ")";
@ -3297,7 +3300,7 @@ class Adherent extends CommonObject
$return .= '<div class="info-box info-box-sm">';
$return .= '<span class="info-box-icon bg-infobox-action">';
if (property_exists($this, 'photo') || !empty($this->photo)) {
$return .= Form::showphoto('memberphoto', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1);
$return .= Form::showphoto('memberphoto', $this, 0, 60, 0, 'photokanban photowithmargin photologintooltip', 'small', 0, 1);
} else {
$return .= img_picto('', 'user');
}

View file

@ -95,6 +95,7 @@ print load_fiche_titre($title, '', $memberstatic->picto);
//dol_mkdir($dir);
$data = array();
$tab = null;
$label = '';
if ($mode) {
// Define sql
@ -263,6 +264,7 @@ if ($mode && !count($data)) {
// Show graphics
if (count($arrayjs) && $mode == 'memberbycountry') {
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
$color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
if (is_readable($color_file)) {
include $color_file;

View file

@ -608,7 +608,7 @@ if (getDolGlobalInt('MAIN_MULTILANGS')) {
// Public
$linkofpubliclist = DOL_MAIN_URL_ROOT.'/public/members/public_list.php'.((isModEnabled('multicompany')) ? '?entity='.$conf->entity : '');
print '<tr><td>'.$form->textwithpicto($langs->trans("PublicFile"), $langs->trans("Public", getDolGlobalString('MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist), 1, 'help', '', 0, 3, 'publicfile').'</td><td class="valeur">'.yn($object->public).'</td></tr>';
print '<tr><td>'.$form->textwithpicto($langs->trans("MembershipPublic"), $langs->trans("Public", getDolGlobalString('MAIN_INFO_SOCIETE_NOM'), $linkofpubliclist), 1, 'help', '', 0, 3, 'publicfile').'</td><td class="valeur">'.yn($object->public).'</td></tr>';
// Other attributes
$cols = 2;
@ -617,7 +617,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
// Third party Dolibarr
if (isModEnabled('societe')) {
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print '<table class="nobordernopadding centpercent"><tr><td>';
print $langs->trans("LinkedToDolibarrThirdParty");
print '</td>';
if ($action != 'editthirdparty' && $user->hasRight('adherent', 'creer')) {
@ -638,9 +638,9 @@ if (isModEnabled('societe')) {
print '<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>';
} else {
if ($object->fk_soc) {
if ($object->socid > 0) {
$company = new Societe($db);
$result = $company->fetch($object->fk_soc);
$result = $company->fetch($object->socid);
print $company->getNomUrl(1);
// Show link to invoices
@ -659,7 +659,7 @@ if (isModEnabled('societe')) {
// Login Dolibarr - Link to user
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print '<table class="nobordernopadding centpercent"><tr><td>';
print $langs->trans("LinkedToDolibarrUser");
print '</td>';
if ($action != 'editlogin' && $user->hasRight('adherent', 'creer')) {

View file

@ -532,7 +532,7 @@ if ($action == 'edit') {
// SuperAdministrator access only
if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE', $oauthservices, $conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE);
print $form->selectarray('MAIN_MAIL_SMTPS_OAUTH_SERVICE', $oauthservices, getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE'));
} else {
$text = $oauthservices[getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE')];
if (empty($text)) {

View file

@ -695,7 +695,7 @@ print "</td></tr>\n";
// Allow external download
print '<tr class="oddeven">';
print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
print '<td class="center" colspan="2">';
print '<td class="left" colspan="2">';
print ajax_constantonoff('ORDER_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
print '</td></tr>';
print '</form>';

View file

@ -80,6 +80,15 @@ $statuslist = array(
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if (GETPOSTISSET('TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION')) { // only for no js case
$param_disable_email = GETPOST('TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION', 'alpha');
$res = dolibarr_set_const($db, 'TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION', $param_disable_email, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
setEventMessages($db->lasterror(), null, 'errors');
}
}
if ($action == 'updateMask') {
$maskconstticket = GETPOST('maskconstticket', 'aZ09');
$maskticket = GETPOST('maskticket', 'alpha');
@ -112,17 +121,9 @@ if ($action == 'updateMask') {
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
$code = $reg[1];
$value = GETPOSTISSET($code) ? GETPOSTINT($code) : 1;
if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
$param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
}
} else {
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
}
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
}
} elseif (preg_match('/del_(.*)/', $action, $reg)) {
$code = $reg[1];
@ -240,15 +241,6 @@ if ($action == 'updateMask') {
if (!($res > 0)) {
$error++;
}
// For compatibility when javascript is not enabled
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 && empty($conf->use_javascript_ajax)) {
$param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
}
}
}
@ -605,21 +597,6 @@ print $formcategory->textwithpicto('', $langs->trans("TicketAutoChangeStatusOnAn
print '</td>';
print '</tr>';
// Check "Notify thirdparty" on ticket creation
print '<tr class="oddeven"><td>'.$langs->trans("TicketAutoCheckNotifyThirdParty").'</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $formcategory->selectarray("TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION", $arrval, getDolGlobalString('TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION'));
}
print '</td>';
print '<td class="center">';
print $formcategory->textwithpicto('', $langs->trans("TicketAutoCheckNotifyThirdPartyHelp"), 1, 'help');
print '</td>';
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("TicketsDelayBeforeFirstAnswer")."</td>";
print '<td class="left">
@ -646,13 +623,14 @@ print $formcategory->buttonsSaveCancel("Save", '', array(), 0, 'reposition');
print '</form>';
print '<br>';
/*
* Notification
* Emails
*/
// Admin var of module
print load_fiche_titre($langs->trans("Notification"), '', '');
print load_fiche_titre($langs->trans("Emails"), '', '');
print '<table class="noborder centpercent">';
@ -662,7 +640,8 @@ print '<input type="hidden" name="action" value="setvar">';
print '<input type="hidden" name="page_y" value="">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("Email").'</td>';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td></td>';
print '<td class="center" width="40">'.$langs->trans("ShortInfo").'</td>';
print "</tr>\n";
@ -687,28 +666,26 @@ print '</tr>';
// Email for notification of TICKET_CREATE
print '<tr class="oddeven"><td>'.$langs->trans("TicketEmailNotificationTo").'</td>';
print '<td class="left">';
print '<input type="text" class="minwidth200" name="TICKET_NOTIFICATION_EMAIL_TO" value="'.(getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') ? $conf->global->TICKET_NOTIFICATION_EMAIL_TO : '').'"></td>';
print '<input type="text" class="minwidth200" name="TICKET_NOTIFICATION_EMAIL_TO" value="'.getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO').'"></td>';
print '<td class="center">';
print $formcategory->textwithpicto('', $langs->trans("TicketEmailNotificationToHelp"), 1, 'help');
print '</td>';
print '</tr>';
// Also send to TICKET_NOTIFICATION_EMAIL_TO for responses (not only creation)
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailAlsoSendToMainAddress").'</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $formcategory->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS);
}
print '</td>';
print '<td class="center">';
print $formcategory->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help');
print '</td>';
print '</tr>';
// Check "Notify thirdparty" on ticket creation
print '<tr class="oddeven"><td>'.$langs->trans("TicketAutoCheckNotifyThirdParty").'</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $formcategory->selectarray("TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION", $arrval, getDolGlobalString('TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION'));
}
print '</td>';
print '<td class="center">';
print $formcategory->textwithpicto('', $langs->trans("TicketAutoCheckNotifyThirdPartyHelp"), 1, 'help');
print '</td>';
print '</tr>';
// Message header
$mail_intro = getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO', '');

View file

@ -84,15 +84,6 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') {
}
}
if (GETPOSTISSET('TICKET_DISABLE_CUSTOMER_MAILS')) { // only for no js case
$param_disable_email = GETPOST('TICKET_DISABLE_CUSTOMER_MAILS', 'alpha');
$res = dolibarr_set_const($db, 'TICKET_DISABLE_CUSTOMER_MAILS', $param_disable_email, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
$errors[] = $db->lasterror();
}
}
if (GETPOSTISSET('TICKET_SHOW_COMPANY_LOGO')) { // only for no js case
$param_show_module_logo = GETPOST('TICKET_SHOW_COMPANY_LOGO', 'alpha');
$res = dolibarr_set_const($db, 'TICKET_SHOW_COMPANY_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
@ -408,23 +399,6 @@ if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) {
print '</td>';
print '</tr>';
// Also send to main email address
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailAlsoSendToMainAddress").'</td>';
print '<td class="left">';
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, getDolGlobalInt('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS'));
}
print '</td>';
print '<td class="center width75">';
print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp", $langs->transnoentitiesnoconv("TicketEmailNotificationTo").' ('.$langs->transnoentitiesnoconv("Creation").')', $langs->trans("Settings")), 1, 'help');
print '</td>';
print '</tr>';
}
if (empty($conf->use_javascript_ajax)) {
print '<tr><td colspan="3" align="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></td>';
print '</tr>';
@ -516,20 +490,6 @@ if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) {
print '</td>';
print '</tr>';
// Activate email creation to user
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("TicketsDisableCustomerEmail"), $langs->trans("TicketsDisableEmailHelp"), 1, 'help');
print '</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('TICKET_DISABLE_CUSTOMER_MAILS');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("TICKET_DISABLE_CUSTOMER_MAILS", $arrval, getDolGlobalInt('TICKET_DISABLE_CUSTOMER_MAILS'));
}
print '</td>';
print '</tr>';
// Text of email after creatio of a ticket
$mail_mesg_new = getDolGlobalString("TICKET_MESSAGE_MAIL_NEW", $langs->trans('TicketNewEmailBody'));
print '<tr class="oddeven"><td>';
@ -564,6 +524,22 @@ if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) {
print '</td>';
print '</tr>';
// Also send to main email address
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailAlsoSendToMainAddress");
print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp", $langs->transnoentitiesnoconv("TicketEmailNotificationTo").' ('.$langs->transnoentitiesnoconv("Creation").')', $langs->trans("Settings")), 1, 'help');
print '</td>';
print '<td class="left">';
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, getDolGlobalInt('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS'));
}
print '</td>';
print '</tr>';
}
print '</table>';
print '</div>';

View file

@ -418,6 +418,6 @@ class DolibarrApi
*/
protected static function _forge_criteria_callback($matches)
{
return dolForgeCriteriaCallback($matches);
return dolForgeSQLCriteriaCallback($matches);
}
}

View file

@ -2139,8 +2139,8 @@ if ($id > 0) {
'type' => 'user',
//'transparency'=>$object->userassigned[$user->id]['transparency'],
'transparency' => $object->transparency, // Force transparency on ownerfrom event
'answer_status' => $object->userassigned[$object->userownerid]['answer_status'],
'mandatory' => $object->userassigned[$object->userownerid]['mandatory']
'answer_status' => (isset($object->userassigned[$object->userownerid]['answer_status']) ? $object->userassigned[$object->userownerid]['answer_status']: null),
'mandatory' => (isset($object->userassigned[$object->userownerid]['mandatory']) ? $object->userassigned[$object->userownerid]['mandatory']:null)
);
}
if (!empty($object->userassigned)) { // Now concat assigned users

View file

@ -2715,83 +2715,86 @@ class ActionComm extends CommonObject
// Load event
$res = $this->fetch($actionCommReminder->fk_actioncomm);
if ($res > 0) {
$res = $this->fetch_thirdparty();
}
if ($res > 0) {
// PREPARE EMAIL
$errormesg = '';
$res2 = $this->fetch_thirdparty();
if ($res2 >= 0) {
// PREPARE EMAIL
$errormesg = '';
// Make substitution in email content
$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $this);
// Make substitution in email content
$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $this);
complete_substitutions_array($substitutionarray, $langs, $this);
complete_substitutions_array($substitutionarray, $langs, $this);
// Content
$sendContent = make_substitutions($langs->trans($arraymessage->content), $substitutionarray);
// Content
$sendContent = make_substitutions($langs->trans($arraymessage->content), $substitutionarray);
//Topic
$sendTopic = (!empty($arraymessage->topic)) ? $arraymessage->topic : html_entity_decode($langs->transnoentities('EventReminder'));
//Topic
$sendTopic = (!empty($arraymessage->topic)) ? $arraymessage->topic : html_entity_decode($langs->transnoentities('EventReminder'));
// Recipient
$recipient = new User($this->db);
$res = $recipient->fetch($actionCommReminder->fk_user);
if ($res > 0) {
if (!empty($recipient->email)) {
$to = $recipient->email;
// Recipient
$recipient = new User($this->db);
$res = $recipient->fetch($actionCommReminder->fk_user);
if ($res > 0) {
if (!empty($recipient->email)) {
$to = $recipient->email;
} else {
$errormesg = "Failed to send remind to user id=".$actionCommReminder->fk_user.". No email defined for user.";
$error++;
}
} else {
$errormesg = "Failed to send remind to user id=".$actionCommReminder->fk_user.". No email defined for user.";
$errormesg = "Failed to load recipient with user id=".$actionCommReminder->fk_user;
$error++;
}
// Sender
$from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
if (empty($from)) {
$errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM";
$error++;
}
if (!$error) {
// Errors Recipient
$errors_to = getDolGlobalString('MAIN_MAIL_ERRORS_TO');
// Mail Creation
$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, array(), array(), array(), '', "", 0, 1, $errors_to, '', '', '', '', '');
// Sending Mail
if ($cMailFile->sendfile()) {
$nbMailSend++;
} else {
$errormesg = 'Failed to send email to: '.$to.' '.$cMailFile->error.implode(',', $cMailFile->errors);
$error++;
}
}
if (!$error) {
$actionCommReminder->status = $actionCommReminder::STATUS_DONE;
$res = $actionCommReminder->update($user);
if ($res < 0) {
$errorsMsg[] = "Failed to update status to done of ActionComm Reminder";
$error++;
break; // This is to avoid to have this error on all the selected email. If we fails here for one record, it may fails for others. We must solve first.
}
} else {
$actionCommReminder->status = $actionCommReminder::STATUS_ERROR;
$actionCommReminder->lasterror = dol_trunc($errormesg, 128, 'right', 'UTF-8', 1);
$res = $actionCommReminder->update($user);
if ($res < 0) {
$errorsMsg[] = "Failed to update status to error of ActionComm Reminder";
$error++;
break; // This is to avoid to have this error on all the selected email. If we fails here for one record, it may fails for others. We must solve first.
} else {
$errorsMsg[] = $errormesg;
}
}
} else {
$errormesg = "Failed to load recipient with user id=".$actionCommReminder->fk_user;
$errorsMsg[] = 'Failed to fetch record thirdparty on actioncomm with ID = '.$actionCommReminder->fk_actioncomm;
$error++;
}
// Sender
$from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
if (empty($from)) {
$errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM";
$error++;
}
if (!$error) {
// Errors Recipient
$errors_to = getDolGlobalString('MAIN_MAIL_ERRORS_TO');
// Mail Creation
$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, array(), array(), array(), '', "", 0, 1, $errors_to, '', '', '', '', '');
// Sending Mail
if ($cMailFile->sendfile()) {
$nbMailSend++;
} else {
$errormesg = 'Failed to send email to: '.$to.' '.$cMailFile->error.implode(',', $cMailFile->errors);
$error++;
}
}
if (!$error) {
$actionCommReminder->status = $actionCommReminder::STATUS_DONE;
$res = $actionCommReminder->update($user);
if ($res < 0) {
$errorsMsg[] = "Failed to update status to done of ActionComm Reminder";
$error++;
break; // This is to avoid to have this error on all the selected email. If we fails here for one record, it may fails for others. We must solve first.
}
} else {
$actionCommReminder->status = $actionCommReminder::STATUS_ERROR;
$actionCommReminder->lasterror = dol_trunc($errormesg, 128, 'right', 'UTF-8', 1);
$res = $actionCommReminder->update($user);
if ($res < 0) {
$errorsMsg[] = "Failed to update status to error of ActionComm Reminder";
$error++;
break; // This is to avoid to have this error on all the selected email. If we fails here for one record, it may fails for others. We must solve first.
} else {
$errorsMsg[] = $errormesg;
}
}
} else {
$errorsMsg[] = 'Failed to fetch record actioncomm with ID = '.$actionCommReminder->fk_actioncomm;
$error++;

View file

@ -1435,7 +1435,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$tmpcontact->fetch($event->contact_id);
$cachecontacts[$event->contact_id] = $tmpcontact;
}
$cases2[$h][$event->id]['string'] .= ', '.$cachecontacts[$event->contact_id]->getFullName($langs);
$cases3[$h][$event->id]['string'] .= ', '.$cachecontacts[$event->contact_id]->getFullName($langs);
}
}
if ($event->date_start_in_calendar < $c && $dateendtouse > $b2) {

View file

@ -1135,6 +1135,8 @@ class Propal extends CommonObject
$this->fk_multicurrency = 0;
$this->multicurrency_tx = 1;
}
// setEntity will set entity with the right value if empty or change it for the right value if multicompany module is active
$this->entity = setEntity($this);
// Set tmp vars
$delivery_date = $this->delivery_date;
@ -1229,7 +1231,7 @@ class Propal extends CommonObject
$sql .= ", ".($this->fk_project ? $this->fk_project : "null");
$sql .= ", ".(int) $this->fk_incoterms;
$sql .= ", '".$this->db->escape($this->location_incoterms)."'";
$sql .= ", ".setEntity($this);
$sql .= ", ".(int) $this->entity;
$sql .= ", ".(int) $this->fk_multicurrency;
$sql .= ", '".$this->db->escape($this->multicurrency_code)."'";
$sql .= ", ".(float) $this->multicurrency_tx;
@ -3566,7 +3568,7 @@ class Propal extends CommonObject
$this->multicurrency_code = $conf->currency;
// Lines
$nbp = 5;
$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
$xnbp = 0;
while ($xnbp < $nbp) {
$line = new PropaleLigne($this->db);

View file

@ -947,6 +947,7 @@ class Commande extends CommonOrder
$this->fk_multicurrency = 0;
$this->multicurrency_tx = 1;
}
$this->entity = setEntity($this);
dol_syslog(get_class($this)."::create user=".$user->id);
@ -1010,7 +1011,7 @@ class Commande extends CommonOrder
$sql .= ", ".(!empty($this->warehouse_id) && $this->warehouse_id > 0 ? ((int) $this->warehouse_id) : 'NULL');
$sql .= ", ".(int) $this->fk_incoterms;
$sql .= ", '".$this->db->escape($this->location_incoterms)."'";
$sql .= ", ".setEntity($this);
$sql .= ", ".(int) $this->entity;
$sql .= ", ".($this->module_source ? "'".$this->db->escape($this->module_source)."'" : "null");
$sql .= ", ".($this->pos_source != '' ? "'".$this->db->escape($this->pos_source)."'" : "null");
$sql .= ", ".(int) $this->fk_multicurrency;
@ -4049,8 +4050,9 @@ class Commande extends CommonOrder
$this->status = $this::STATUS_DRAFT;
// Lines
$nbp = 5;
$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
$xnbp = 0;
while ($xnbp < $nbp) {
$line = new OrderLine($this->db);

View file

@ -554,7 +554,11 @@ if ($id > 0 || !empty($ref)) {
// Bank card
$head = bank_prepare_head($object);
print dol_get_fiche_head($head, 'journal', $langs->trans("FinancialAccount"), 0, 'account');
$activetab = 'journal';
if ($action == 'reconcile') {
$activetab = 'reconcile';
}
print dol_get_fiche_head($head, $activetab, $langs->trans("FinancialAccount"), 0, 'account');
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
@ -566,7 +570,7 @@ if ($id > 0 || !empty($ref)) {
/*
* Buttons actions
*/
/* Moved into tab
if ($action != 'reconcile') {
if ($object->canBeConciliated() > 0) {
$allowautomaticconciliation = false; // TODO
@ -598,6 +602,7 @@ if ($id > 0 || !empty($ref)) {
}
}
}
*/
}
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro as conciliated, b.num_releve, b.num_chq,";
@ -1032,8 +1037,8 @@ if ($resql) {
print '<input type="submit" class="button" name="confirm_reconcile" value="'.$langs->trans("Conciliate").'">';
print ' <span class="opacitymedium">'.$langs->trans("otherwise").'</span> ';
print '<input type="submit" class="button small" name="confirm_savestatement" value="'.$langs->trans("SaveStatementOnly").'">';
print ' <span class="opacitymedium">'.$langs->trans("or").'</span> ';
print '<input type="submit" name="cancel" class="button button-cancel small" value="'.$langs->trans("Cancel").'">';
//print ' <span class="opacitymedium">'.$langs->trans("or").'</span> ';
//print '<input type="submit" name="cancel" class="button button-cancel small" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '<br>';

View file

@ -310,7 +310,7 @@ if (empty($numref)) {
print dol_get_fiche_end();
/* Moved as a tab
if ($object->canBeConciliated() > 0) {
$allowautomaticconciliation = false; // TODO
$titletoconciliatemanual = $langs->trans("Conciliate");
@ -339,6 +339,7 @@ if (empty($numref)) {
}
}
}
*/
// List of mass actions available
$arrayofmassactions = array(

View file

@ -216,7 +216,7 @@ if (GETPOST("account") || GETPOST("ref")) {
$morehtml = '';
$limit = 0;
print_barre_liste($langs->trans("RemainderToPay"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit, 0, 0, 1);
print_barre_liste($langs->trans("PlannedTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit, 0, 0, 1);
$solde = $object->solde(0);

View file

@ -29,6 +29,7 @@
require '../../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';

View file

@ -1311,7 +1311,7 @@ class FactureRec extends CommonInvoice
if (empty($this->date_when)) {
return false;
}
return dol_time_plus_duree($this->date_when, $this->frequency, $this->unit_frequency);
return dol_time_plus_duree($this->date_when, $this->frequency, $this->unit_frequency, 1);
}
/**
@ -1830,7 +1830,7 @@ class FactureRec extends CommonInvoice
if (empty($option) || $option != 'nolines') {
// Lines
$nbp = 5;
$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
$xnbp = 0;
while ($xnbp < $nbp) {
$line = new FactureLigne($this->db);

View file

@ -523,6 +523,7 @@ class Facture extends CommonInvoice
$this->fk_multicurrency = 0;
$this->multicurrency_tx = 1;
}
$this->entity = setEntity($this);
dol_syslog(get_class($this)."::create user=".$user->id." date=".$this->date);
@ -718,7 +719,7 @@ class Facture extends CommonInvoice
$sql .= ")";
$sql .= " VALUES (";
$sql .= "'(PROV)'";
$sql .= ", ".setEntity($this);
$sql .= ", ".(int) $this->entity;
$sql .= ", ".($this->ref_ext ? "'".$this->db->escape($this->ref_ext)."'" : "null");
$sql .= ", '".$this->db->escape($this->type)."'";
$sql .= ", ".($this->subtype ? "'".$this->db->escape($this->subtype)."'" : "null");
@ -1472,6 +1473,8 @@ class Facture extends CommonInvoice
$this->fk_account = $object->fk_account;
$this->cond_reglement_id = $object->cond_reglement_id;
$this->mode_reglement_id = $object->mode_reglement_id;
$this->fk_incoterms = $object->fk_incoterms;
$this->location_incoterms = $object->location_incoterms;
$this->availability_id = $object->availability_id;
$this->demand_reason_id = $object->demand_reason_id;
$this->delivery_date = $object->delivery_date;
@ -5156,7 +5159,7 @@ class Facture extends CommonInvoice
if (empty($option) || $option != 'nolines') {
// Lines
$nbp = 5;
$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
$xnbp = 0;
while ($xnbp < $nbp) {
$line = new FactureLigne($this->db);

View file

@ -136,7 +136,7 @@ class FactureStats extends Stats
}
if ($categid) {
$this->where .= ' AND EXISTS (SELECT rowid FROM '.MAIN_DB_PREFIX.'categorie_societe as cats WHERE cats.fk_soc = f.fk_soc AND cats.fk_categorie = '.((int) $categid).')';
$this->where .= ' AND EXISTS (SELECT cats.fk_categorie FROM '.MAIN_DB_PREFIX.'categorie_societe as cats WHERE cats.fk_soc = f.fk_soc AND cats.fk_categorie = '.((int) $categid).')';
}
}

View file

@ -990,7 +990,7 @@ if ($object->id > 0) {
// Iban
print '<td class="center"><span class="iban">';
print $obj->iban;
print dolDecrypt($obj->iban);
if ($obj->iban && $obj->bic) {
print " / ";
}
@ -1119,7 +1119,7 @@ if ($object->id > 0) {
// Iban
print '<td class="center"><span class="iban">';
print $obj->iban;
print dolDecrypt($obj->iban);
if ($obj->iban && $obj->bic) {
print " / ";
}

View file

@ -1068,7 +1068,7 @@ class BonPrelevement extends CommonObject
// phpcs:enable
global $conf, $langs, $user;
dol_syslog(__METHOD__ . " Bank=" . $banque . " Office=" . $agence . " mode=" . $mode . " format=" . $format, LOG_DEBUG);
dol_syslog(__METHOD__ . " Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format." type=".$type." did=".$did." fk_bank_account=".$fk_bank_account." sourcetype=".$sourcetype, LOG_DEBUG);
require_once DOL_DOCUMENT_ROOT . "/compta/facture/class/facture.class.php";
require_once DOL_DOCUMENT_ROOT . "/societe/class/societe.class.php";
@ -1150,7 +1150,7 @@ class BonPrelevement extends CommonObject
dol_syslog(__METHOD__ . " Read invoices for did=" . ((int) $did), LOG_DEBUG);
$sql = "SELECT f.rowid, pd.rowid as pfdrowid";
$sql .= ", f.".$this->db->sanitize($socOrUser);
$sql .= ", f.".$this->db->sanitize($socOrUser); // fk_soc or fk_user
$sql .= ", pd.code_banque, pd.code_guichet, pd.number, pd.cle_rib";
$sql .= ", pd.amount";
if ($sourcetype != 'salary') {
@ -1200,7 +1200,12 @@ class BonPrelevement extends CommonObject
while ($i < $num) {
$row = $this->db->fetch_row($resql); // TODO Replace with fetch_object()
'@phan-var-force array<int<0,12>,string> $row';
$factures[$i] = $row; // All fields
// All fields: 0=rowid, 1=pfdrowid, 2=$socOrUser, 3=code_banque, 4=code_guichet, 5=number, 6=key, 7=amount, 8=name, 9=ref, 10=bic, 11=iban, 12=frstrecur
$factures[$i] = $row;
// Decode BAN
$factures[$i][11] = dolDecrypt($factures[$i][11]);
if ($row[7] == 0) {
$error++;
@ -1232,20 +1237,10 @@ class BonPrelevement extends CommonObject
// Check BAN
$i = 0;
dol_syslog(__METHOD__ . " Check BAN", LOG_DEBUG);
dol_syslog(__METHOD__ . " Check BAN for each invoices or salary", LOG_DEBUG);
if (count($factures) > 0) {
foreach ($factures as $key => $fac) {
/*
if ($type != 'bank-transfer') {
$tmpinvoice = new Facture($this->db);
} else {
$tmpinvoice = new FactureFournisseur($this->db);
}
$resfetch = $tmpinvoice->fetch($fac[0]);
if ($resfetch >= 0) { // Field 0 of $fac is rowid of invoice
*/
// Check if $fac[8] s.nom is null
if ($fac[8] != null) {
if ($type != 'bank-transfer') {
@ -1259,6 +1254,7 @@ class BonPrelevement extends CommonObject
$verif = checkSwiftForAccount(null, $fac[10]);
if ($verif || (empty($fac[10]) && getDolGlobalInt("WITHDRAWAL_WITHOUT_BIC"))) {
dol_syslog(__METHOD__." now call checkIbanForAccount(null, ".$fac[11].")");
$verif = checkIbanForAccount(null, $fac[11]);
}
@ -1312,7 +1308,7 @@ class BonPrelevement extends CommonObject
$ok = 0;
// Withdraw invoices in factures_prev array
$out = count($factures_prev) . " invoices will be included.";
$out = count($factures_prev) . " invoices or salaries will be included.";
//print $out."\n";
dol_syslog($out);
@ -1901,8 +1897,9 @@ class BonPrelevement extends CommonObject
$cachearraytotestduplicate[$obj->idfac] = $obj->rowid;
$daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec);
$iban = dolDecrypt($obj->iban);
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->reffac, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type);
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->reffac, $obj->idfac, $iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type);
$this->total += $obj->somme;
$i++;
@ -2044,12 +2041,13 @@ class BonPrelevement extends CommonObject
$cachearraytotestduplicate[$obj->idfac] = $obj->rowid;
$daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec);
$iban = dolDecrypt($obj->iban);
$refobj = $obj->reffac;
if (empty($refobj) && !empty($forsalary)) { // If ref of salary not defined, we force a value
$refobj = "SAL" . $obj->idfac;
}
$fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $refobj, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type, $obj->fac_ref_supplier);
$fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $refobj, $obj->idfac, $iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type, $obj->fac_ref_supplier);
$this->total += $obj->somme;
$i++;

View file

@ -274,9 +274,9 @@ print '<table class="liste noborder centpercent">';
print '<tr class="liste_titre">';
if ($modecompta == 'BOOKKEEPING') {
print_liste_field_titre("PredefinedGroups", $_SERVER["PHP_SELF"], 'f.thirdparty_code,f.rowid', '', $param, '', $sortfield, $sortorder, 'width200 ');
print_liste_field_titre("PredefinedGroups", $_SERVER["PHP_SELF"], 'f.thirdparty_code,f.rowid', '', $param, '', $sortfield, $sortorder, '');
} else {
print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'width200 ');
print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, '');
}
print_liste_field_titre('');
if ($modecompta == 'BOOKKEEPING') {

View file

@ -60,6 +60,7 @@ $refresh = (GETPOSTISSET('submit') || GETPOSTISSET('vat_rate_show') || GETPOSTIS
$invoice_type = GETPOSTISSET('invoice_type') ? GETPOST('invoice_type', 'alpha') : '';
$vat_rate_show = GETPOSTISSET('vat_rate_show') ? GETPOST('vat_rate_show', 'alphanohtml') : -1;
// Set $date_start_xxx and $date_end_xxx...
include DOL_DOCUMENT_ROOT . '/compta/tva/initdatesforvat.inc.php';
// Variables provided by include:
'
@ -323,7 +324,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
foreach ($x_paye[$my_paye_rate]['facid'] as $id => $dummy) {
// ExpenseReport
if ($x_paye[$my_paye_rate]['ptype'][$id] == 'ExpenseReportPayment') {
if ($x_paye[$my_paye_rate]['ptype'][$id] === 'ExpenseReportPayment') {
$expensereport->id = $x_paye[$my_paye_rate]['facid'][$id];
$expensereport->ref = $x_paye[$my_paye_rate]['facnum'][$id];
$expensereport->type = $x_paye[$my_paye_rate]['type'][$id];
@ -441,7 +442,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
print "<tr>";
print '<td class="tax_rate" colspan="' . ($span + 1) . '">';
print $langs->trans('Rate') . ' : ' . vatrate($rate) . '%';
print ' - <a href="' . DOL_URL_ROOT . '/compta/tva/quadri_detail.php?invoice_type=customer';
print ' - <a class="reposition" href="' . DOL_URL_ROOT . '/compta/tva/quadri_detail.php?invoice_type=customer';
if ($invoice_type != 'customer' || !GETPOSTISSET('vat_rate_show') || GETPOST('vat_rate_show') != $rate) {
print '&amp;vat_rate_show=' . urlencode($rate);
}
@ -677,11 +678,11 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
$subtot_paye_total_ht = 0;
$subtot_paye_vat = 0;
if (is_array($x_both[$rate]['paye']['detail'])) {
if (is_array($x_both[$rate]['paye']['detail'])) { // @phpstan-ignore-line
print "<tr>";
print '<td class="tax_rate" colspan="' . ($span + 1) . '">';
print $langs->trans('Rate') . ' : ' . vatrate($rate) . '%';
print ' - <a href="' . DOL_URL_ROOT . '/compta/tva/quadri_detail.php?invoice_type=supplier';
print ' - <a class="reposition" href="' . DOL_URL_ROOT . '/compta/tva/quadri_detail.php?invoice_type=supplier';
if ($invoice_type != 'supplier' || !GETPOSTISSET('vat_rate_show') || GETPOST('vat_rate_show') != $rate) {
print '&amp;vat_rate_show=' . urlencode($rate);
}
@ -752,7 +753,6 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
$type = 1;
}
print '<tr class="oddeven">';
// Ref

View file

@ -508,7 +508,8 @@ class Contact extends CommonObject
$this->statut = 0; // This is to convert '' into '0' to avoid bad sql request
}
$this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity);
// setEntity will set entity with the right value if empty or change it for the right value if multicompany module is active
$this->entity = setEntity($this);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (";
$sql .= " datec";
@ -1530,7 +1531,7 @@ class Contact extends CommonObject
* @param string $morecss Add more css on link
* @return string String with URL
*/
public function getNomUrl($withpicto = 0, $option = '', $maxlen = 0, $moreparam = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = '')
public function getNomUrl($withpicto = 0, $option = '', $maxlen = 0, $moreparam = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = 'valignmiddle')
{
global $conf, $langs, $hookmanager;

View file

@ -166,26 +166,22 @@ if ($type == "p") {
$contextpage = 'contactprospectlist';
}
$title .= ' ('.$langs->trans("ThirdPartyProspects").')';
$urlfiche = "card.php";
}
if ($type == "c") {
if (empty($contextpage) || $contextpage == 'contactlist') {
$contextpage = 'contactcustomerlist';
}
$title .= ' ('.$langs->trans("ThirdPartyCustomers").')';
$urlfiche = "card.php";
} elseif ($type == "f") {
if (empty($contextpage) || $contextpage == 'contactlist') {
$contextpage = 'contactsupplierlist';
}
$title .= ' ('.$langs->trans("ThirdPartySuppliers").')';
$urlfiche = "card.php";
} elseif ($type == "o") {
if (empty($contextpage) || $contextpage == 'contactlist') {
$contextpage = 'contactotherlist';
}
$title .= ' ('.$langs->trans("OthersNotLinkedToThirdParty").')';
$urlfiche = "";
}
// Initialize a technical object
@ -1453,7 +1449,6 @@ while ($i < $imaxinloop) {
}
} else {
// Show here line of result
$j = 0;
print '<tr data-rowid="'.$object->id.'" class="oddeven"';
if ($contextpage == 'poslist') {
print ' onclick="location.href=\'list.php?action=change&contextpage=poslist&idcustomer='.$obj->socid.'&idcontact='.$obj->rowid.'&place='.urlencode($place).'\'"';

View file

@ -1024,6 +1024,7 @@ class Contrat extends CommonObject
$this->error .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("SalesRepresentativeFollowUp"));
$paramsok = 0;
}
$this->entity = setEntity($this);
if (!$paramsok) {
return -1;
}
@ -1043,7 +1044,7 @@ class Contrat extends CommonObject
$sql .= ",".($this->commercial_suivi_id > 0 ? ((int) $this->commercial_suivi_id) : "NULL");
$sql .= ",".($this->fk_project > 0 ? ((int) $this->fk_project) : "NULL");
$sql .= ", ".(dol_strlen($this->ref) <= 0 ? "null" : "'".$this->db->escape($this->ref)."'");
$sql .= ", ".((int) $conf->entity);
$sql .= ", ".((int) $this->entity);
$sql .= ", ".((int) $this->signed_status);
$sql .= ", ".(!empty($this->note_private) ? ("'".$this->db->escape($this->note_private)."'") : "NULL");
$sql .= ", ".(!empty($this->note_public) ? ("'".$this->db->escape($this->note_public)."'") : "NULL");
@ -2486,7 +2487,7 @@ class Contrat extends CommonObject
$this->note_public = 'This is a comment (public)';
$this->fk_project = 0;
// Lines
$nbp = 5;
$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
$xnbp = 0;
while ($xnbp < $nbp) {
$line = new ContratLigne($this->db);

View file

@ -637,7 +637,7 @@ abstract class CommonObject
public $comments = array();
/**
* @var string The name
* @var ?string The name
*/
public $name;
@ -6856,28 +6856,52 @@ abstract class CommonObject
}
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] == 'point') { // for point type
if (!empty($new_array_options[$key])) {
$sql .= ",ST_PointFromText('".$this->db->escape($new_array_options[$key])."')";
if (!preg_match('/error/i', $new_array_options[$key])) {
// Text must be a WKT string, so "POINT(15 20)"
$sql .= ",ST_PointFromText('".$this->db->escape($new_array_options[$key])."')";
} else {
dol_syslog("Bad syntax string for point ".$new_array_options[$key]." to generate SQL request", LOG_WARNING);
$sql .= ",null";
}
} else {
$sql .= ",null";
}
}
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] == 'multipts') { // for point type
if (!empty($new_array_options[$key])) {
$sql .= ",ST_MultiPointFromText('".$this->db->escape($new_array_options[$key])."')";
if (!preg_match('/error/i', $new_array_options[$key])) {
// Text must be a WKT string, so "MULTIPOINT(0 0, 20 20, 60 60)"
$sql .= ",ST_MultiPointFromText('".$this->db->escape($new_array_options[$key])."')";
} else {
dol_syslog("Bad syntax string for multipoint ".$new_array_options[$key]." to generate SQL request", LOG_WARNING);
$sql .= ",null";
}
} else {
$sql .= ",null";
}
}
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] == 'linestrg') { // for linestring type
if (!empty($new_array_options[$key])) {
$sql .= ",ST_LineFromText('".$this->db->escape($new_array_options[$key])."')";
if (!preg_match('/error/i', $new_array_options[$key])) {
// Text must be a WKT string, so "LINESTRING(0 0, 10 10, 20 25, 50 60)"
$sql .= ",ST_LineFromText('".$this->db->escape($new_array_options[$key])."')";
} else {
dol_syslog("Bad syntax string for line ".$new_array_options[$key]." to generate SQL request", LOG_WARNING);
$sql .= ",null";
}
} else {
$sql .= ",null";
}
}
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] == 'polygon') { // for polygon type
if (!empty($new_array_options[$key])) {
$sql .= ",ST_PolyFromText('".$this->db->escape($new_array_options[$key])."')";
if (!preg_match('/error/i', $new_array_options[$key])) {
// Text must be a WKT string, so "POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7, 5 5))"
$sql .= ",ST_PolyFromText('".$this->db->escape($new_array_options[$key])."')";
} else {
dol_syslog("Bad syntax string for polygon ".$new_array_options[$key]." to generate SQL request", LOG_WARNING);
$sql .= ",null";
}
} else {
$sql .= ",null";
}
@ -9395,14 +9419,14 @@ abstract class CommonObject
$out .= getPictoForType($extrafields->attributes[$this->table_element]['type'][$key], ($extrafields->attributes[$this->table_element]['type'][$key] == 'text' ? 'tdtop' : ''));
}
//$out .= '<!-- type = '.$extrafields->attributes[$this->table_element]['type'][$key].' -->';
$out .= $extrafields->showInputField($key, $value, '', $keysuffix, '', 0, $this->id, $this->table_element);
$out .= $extrafields->showInputField($key, $value, '', $keysuffix, '', 0, $this, $this->table_element);
break;
case "edit":
$listoftypestoshowpicto = explode(',', getDolGlobalString('MAIN_TYPES_TO_SHOW_PICTO', 'email,phone,ip,password'));
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], $listoftypestoshowpicto)) {
$out .= getPictoForType($extrafields->attributes[$this->table_element]['type'][$key], ($extrafields->attributes[$this->table_element]['type'][$key] == 'text' ? 'tdtop' : ''));
}
$out .= $extrafields->showInputField($key, $value, '', $keysuffix, '', '', $this->id, $this->table_element, 0, $this);
$out .= $extrafields->showInputField($key, $value, '', $keysuffix, '', '', $this, $this->table_element, 0, $this);
break;
}

View file

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2023 Frédéric France <frederic.france@netlogic.fr>
/* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@ -152,9 +152,9 @@ trait CommonPeople
/**
* Return full address for banner
*
* @param string $htmlkey HTML id to make banner content unique
* @param Object $object Object (thirdparty, thirdparty of contact for contact, null for a member)
* @return string Full address string
* @param string $htmlkey HTML id to make banner content unique
* @param CommonObject $object Object (thirdparty, thirdparty of contact for contact, null for a member)
* @return string Full address string
*/
public function getBannerAddress($htmlkey, $object)
{
@ -165,20 +165,24 @@ trait CommonPeople
$contactid = 0;
$thirdpartyid = 0;
$elementforaltlanguage = $this->element;
if ($this->element == 'societe') {
/** @var Societe $this */
if ($this->element === 'societe' && $this instanceof Societe) {
$thirdpartyid = $this->id;
}
if ($this->element == 'contact') {
/** @var Contact $this */
if ($this->element === 'contact' && $this instanceof Contact) {
$contactid = $this->id;
$thirdpartyid = empty($this->fk_soc) ? 0 : $this->fk_soc;
}
if ($this->element == 'user') {
/** @var User $this */
if ($this->element == 'member' && $this instanceof Adherent) {
$contactid = $this->id;
$thirdpartyid = empty($this->socid) ? 0 : $this->socid;
}
if ($this->element === 'user' && $this instanceof User) {
$contactid = $this->contact_id;
$thirdpartyid = empty($object->fk_soc) ? 0 : $object->fk_soc;
}
if ($this->element == 'recruitmentcandidature' && $this instanceof RecruitmentCandidature) {
$thirdpartyid = 0;
}
$out = '';
@ -210,7 +214,7 @@ trait CommonPeople
$arrayoflangcode[] = getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE');
}
if (is_array($arrayoflangcode) && count($arrayoflangcode)) {
if (/* is_array($arrayoflangcode) && */count($arrayoflangcode)) {
if (!is_object($extralanguages)) {
include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php';
$extralanguages = new ExtraLanguages($this->db);
@ -258,7 +262,7 @@ trait CommonPeople
// Phones
$outphonedone = 0;
if (!empty($this->phone) && empty($this->phone_pro)) { // For objects that store pro phone into ->phone
$out .= ($outphonedone ? ' ' : '');
// $out .= ($outphonedone ? ' ' : '');
$out .= dol_print_phone($this->phone, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', '&nbsp;', 'phone', $langs->trans("PhonePro"));
$outdone++;
$outphonedone++;
@ -387,7 +391,7 @@ trait CommonPeople
$this->address = dol_strtoupper($this->address);
$this->town = dol_strtoupper($this->town);
}
if (isset($this->email)) {
if (!empty($this->email)) {
$this->email = dol_strtolower($this->email);
}
if (isset($this->personal_email)) {

View file

@ -115,10 +115,15 @@ class DolGeoPHP
{
$value_key = '';
$geom = geoPHP::load($geojson, 'json');
if ($geom) {
'@phan-var-force Geometry $geom';
$value_key = $geom->out('wkt');
try {
$geom = geoPHP::load($geojson, 'json');
if ($geom) {
'@phan-var-force Geometry $geom';
$value_key = $geom->out('wkt');
}
} catch (Exception $e) {
// Do nothing
$value_key = 'Error: Bad value for property';
}
return $value_key;
}

View file

@ -1076,19 +1076,18 @@ class ExtraFields
* Return HTML string to put an input field into a page
* Code very similar with showInputField of common object
*
* @param string $key Key of attribute
* @param string $key Key of attribute
* @param string|array{start:int,end:int} $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value); for dates in filter mode, a range array('start'=><timestamp>, 'end'=><timestamp>) should be provided
* @param string $moreparam To add more parameters on html input tag
* @param string $keysuffix Suffix string to add after name and id of field (can be used to avoid duplicate names)
* @param string $keyprefix Prefix string to add before name and id of field (can be used to avoid duplicate names)
* @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric)
* @param int $objectid Current object id
* @param string $extrafieldsobjectkey The key to use to store retrieved data (commonly $object->table_element)
* @param int $mode 1=Used for search filters
* @param ?CommonObject $object Common object dolibarr
* @param string $moreparam To add more parameters on html input tag
* @param string $keysuffix Suffix string to add after name and id of field (can be used to avoid duplicate names)
* @param string $keyprefix Prefix string to add before name and id of field (can be used to avoid duplicate names)
* @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric)
* @param int|CommonObject $object Current object or object ID. Preferably, pass the object itself.
* @param string $extrafieldsobjectkey The key to use to store retrieved data (commonly $object->table_element)
* @param int $mode 1=Used for search filters
* @return string
*/
public function showInputField($key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '', $objectid = 0, $extrafieldsobjectkey = '', $mode = 0, $object = null)
public function showInputField($key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '', $object = 0, $extrafieldsobjectkey = '', $mode = 0)
{
global $conf, $langs, $form;
@ -1097,6 +1096,8 @@ class ExtraFields
$form = new Form($this->db);
}
$objectid = (is_numeric($object) ? $object : $object->id);
$out = '';
if (!preg_match('/options_$/', $keyprefix)) { // Because we work on extrafields, we add 'options_' to prefix if not already added
@ -1121,6 +1122,7 @@ class ExtraFields
$list = (string) dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '2');
$totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key];
$help = $this->attributes[$extrafieldsobjectkey]['help'][$key];
$alwayseditable = $this->attributes[$extrafieldsobjectkey]['alwayseditable'][$key];
$hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
//var_dump('key='.$key.' '.$value.' '.$moreparam.' '.$keysuffix.' '.$keyprefix.' '.$objectid.' '.$extrafieldsobjectkey.' '.$mode);
@ -1982,6 +1984,12 @@ class ExtraFields
if (!empty($hidden)) {
$out = '<input type="hidden" value="'.$value.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'"/>';
}
// If alwayseditable is false, and object is not in draft, then showOutputField
// @phan-suppress-next-line PhanUndeclaredConstantOfClass
if ($alwayseditable == 0 && is_object($object) && isset($object->status) && defined(get_class($object)."::STATUS_DRAFT") && $object->status != $object::STATUS_DRAFT) {
$out = $this->showOutputField($key, $value, $moreparam, $extrafieldsobjectkey, null, $object);
}
/* Add comments
if ($type == 'date') $out.=' (YYYY-MM-DD)';
elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)';
@ -2001,7 +2009,7 @@ class ExtraFields
* @param string $moreparam To add more parameters on html input tag (only checkbox use html input for output rendering)
* @param string $extrafieldsobjectkey Required (for example $object->table_element).
* @param Translate|null $outputlangs Output
* @param object $object The parent object of field to show
* @param CommonObject $object The parent object of field to show
* @return string Formatted value
*/
public function showOutputField($key, $value, $moreparam = '', $extrafieldsobjectkey = '', $outputlangs = null, $object = null)
@ -2035,7 +2043,7 @@ class ExtraFields
// If alwayseditable is false, and object is not in draft, then we show value instead of input field
$showValueInsteadOfInputField = 0; // Variable used to disable update of fields via ajax
// @phan-suppress-next-line PhanUndeclaredConstantOfClass
if ($alwayseditable == 0 && !is_numeric($object) && isset($object->status) && $object->status != $object::STATUS_DRAFT) {
if ($alwayseditable == 0 && is_object($object) && isset($object->status) && defined(get_class($object)."::STATUS_DRAFT") && $object->status != $object::STATUS_DRAFT) {
$showValueInsteadOfInputField = 1;
}

View file

@ -2767,9 +2767,9 @@ class Form
}
if (empty($hidelabel)) {
$out .= $langs->trans("RefOrLabel") . ' : ';
$placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"';
} elseif ($hidelabel > 1) {
$placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"';
$placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"';
if ($hidelabel == 2) {
$out .= img_picto($langs->trans("Search"), 'search');
}
@ -5263,14 +5263,15 @@ class Form
while ($i < $num) {
$obj = $this->db->fetch_object($result);
$iban = dolDecrypt($obj->iban_prefix);
if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
$out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $obj->iban_prefix . ' data-bic="' . $obj->bic . '" selected>';
$out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $iban . ' data-bic="' . $obj->bic . '" selected>';
} else {
$out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $obj->iban_prefix . ' data-bic="' . $obj->bic . '">';
$out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $iban . ' data-bic="' . $obj->bic . '">';
}
$out .= trim($obj->label);
if ($showibanbic) {
$out .= ' (' . $obj->iban_prefix . '/' .$obj->bic. ')';
$out .= ' (' . $iban . '/' .$obj->bic. ')';
}
$out .= '</option>';
$i++;

View file

@ -511,7 +511,7 @@ class FormAdmin
*/
public function selectTypeOfFields($htmlname, $type, $typewecanchangeinto = array())
{
global $type2label; // TODO Remove this
global $type2label; // TODO Remove this global
$out = '';

View file

@ -515,7 +515,9 @@ class vCard
$this->setOrg($company->name);
}
$this->setURL($company->url, "");
if (!empty($company->url)) {
$this->setURL($company->url, "");
}
if ($company->phone && empty($object->office_phone)) { // If we already set the type TYPE=WORK,VOICE with office_phone
$this->setPhoneNumber($company->phone, "TYPE=WORK,VOICE");

View file

@ -639,14 +639,14 @@ function ajax_event($htmlname, $events)
* @param string $suffix Suffix to use on the name of the switch picto when option is on. Example: '', '_red'
* @param string $mode Add parameter &mode= to the href link (Used for href link)
* @param string $morecss More CSS
* @param int $userconst 1=OnOff for user constant of user $userconst
* @param User|int $userconst If set, use the ajax On/Off for user or user ID $userconst
* @param string $showwarning String to show a warning when enabled the option
* @return string
* @see ajax_object_onoff() to update the status of an object
*/
function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2, $forcenoajax = 0, $setzeroinsteadofdel = 0, $suffix = '', $mode = '', $morecss = 'inline-block', $userconst = 0, $showwarning = '')
{
global $conf, $langs, $user;
global $conf, $langs, $user, $db;
$entity = ((isset($entity) && is_numeric($entity) && $entity >= 0) ? $entity : $conf->entity);
if (!isset($input)) {
@ -660,6 +660,15 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
$out = '<a '.($morecss ? 'class="'.$morecss.'" ' : '').' href="'.$_SERVER['PHP_SELF'].'?action=del_'.$code.'&token='.newToken().'&entity='.$entity.($mode ? '&mode='.$mode : '').($forcereload ? '&dol_resetcache=1' : '').'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
}
} else {
$userconstid = 0;
if (is_object($userconst)) {
$userconstid = $userconst->id;
} elseif (is_numeric($userconst) && $userconst > 0) {
$userconstid = $userconst;
$userconst = new User($db);
$userconst->fetch($userconstid);
}
$out = "\n<!-- Ajax code to switch constant ".$code." -->".'
<script>
$(document).ready(function() {
@ -669,7 +678,7 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
var entity = \''.dol_escape_js($entity).'\';
var strict = \''.dol_escape_js((string) $strict).'\';
var userid = \''.dol_escape_js((string) $user->id).'\';
var userconst = '.((int) $userconst).';
var userconst = '.((int) $userconstid).';
var yesButton = \''.dol_escape_js($langs->transnoentities("Yes")).'\';
var noButton = \''.dol_escape_js($langs->transnoentities("No")).'\';
var token = \''.currentToken().'\';
@ -680,6 +689,7 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
if (warning) {
alert(warning);
}
if (input.alert && input.alert.set) {
if (input.alert.set.yesButton) yesButton = input.alert.set.yesButton;
if (input.alert.set.noButton) noButton = input.alert.set.noButton;
@ -706,8 +716,8 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
});
</script>'."\n";
if ($userconst) {
$value = getDolUserString($code);
if (!empty($userconst) && $userconst instanceof User) {
$value = getDolUserString($code, '', $userconst);
} else {
$value = getDolGlobalString($code);
}
@ -724,7 +734,7 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
* On/off button to change a property status of an object
* This uses the ajax service objectonoff.php (May be called when MAIN_DIRECT_STATUS_UPDATE is set for some pages)
*
* @param Object $object Object to set
* @param CommonObject $object Object to set
* @param string $code Name of property in object : 'status' or 'status_buy' for product by example
* @param string $field Name of database field : 'tosell' or 'tobuy' for product by example
* @param string $text_on Text if on ('Text' or 'Text:Picto on:Css picto on')
@ -744,7 +754,6 @@ function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input =
if (empty($htmlname)) {
$htmlname = $code;
}
//var_dump($object->module); var_dump($object->element);
$out = '';

View file

@ -38,7 +38,8 @@
*/
function bank_prepare_head(Account $object)
{
global $db, $langs, $conf;
global $db, $langs, $conf, $user;
$h = 0;
$head = array();
@ -52,23 +53,44 @@ function bank_prepare_head(Account $object)
$head[$h][2] = 'journal';
$h++;
// if ($conf->global->MAIN_FEATURES_LEVEL >= 1)
// {
$head[$h][0] = DOL_URL_ROOT."/compta/bank/treso.php?account=".$object->id;
$head[$h][1] = $langs->trans("PlannedTransactions");
$head[$h][2] = 'cash';
$h++;
// }
if ($object->canBeConciliated() > 0) {
$allowautomaticconciliation = getDolGlobalBool('MAIN_ALLOW_AUTOMATIC_CONCILIATION'); // TODO
$titletoconciliatemanual = $langs->trans("Conciliate");
$titletoconciliateauto = $langs->trans("Conciliate");
if ($allowautomaticconciliation) {
$titletoconciliatemanual .= ' ('.$langs->trans("Manual").')';
$titletoconciliateauto .= ' ('.$langs->trans("Auto").')';
}
$head[$h][0] = DOL_URL_ROOT."/compta/bank/annuel.php?account=".$object->id;
$head[$h][1] = $langs->trans("IOMonthlyReporting");
$head[$h][2] = 'annual';
$h++;
$param = '';
$head[$h][0] = DOL_URL_ROOT."/compta/bank/graph.php?account=".$object->id;
$head[$h][1] = $langs->trans("Graph");
$head[$h][2] = 'graph';
$h++;
// If not cash account and can be reconciliate
if ($user->hasRight('banque', 'consolidate')) {
$head[$h][0] = DOL_URL_ROOT."/compta/bank/bankentries_list.php?id=".$object->id.'&action=reconcile&sortfield=b.datev,b.dateo,b.rowid&sortorder=asc,asc,asc&search_conciliated=0&search_account='.$object->id.$param;
$head[$h][1] = $titletoconciliatemanual;
$head[$h][2] = 'reconcile';
$h++;
}/* else {
$buttonreconcile = '<a class="butActionRefused classfortooltip" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$titletoconciliatemanual.'</a>';
}*/
if ($allowautomaticconciliation) {
// If not cash account and can be reconciliate
if ($user->hasRight('banque', 'consolidate')) {
$newparam = $param;
$newparam = preg_replace('/search_conciliated=\d+/i', '', $newparam);
$head[$h][0] = DOL_URL_ROOT."/compta/bank/bankentries_list.php?id=".$object->id.'&action=reconcile&sortfield=b.datev,b.dateo,b.rowid&sortorder=asc,asc,asc&search_conciliated=0&search_account='.$object->id.$newparam;
$head[$h][1] = $titletoconciliateauto;
$head[$h][2] = 'reconcileauto';
$h++;
//$buttonreconcile .= ' <a class="butAction" style="margin-bottom: 5px !important; margin-top: 5px !important" href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&sortfield=b.datev,b.dateo,b.rowid&sortorder=asc,asc,asc&search_conciliated=0'.$newparam.'">'.$titletoconciliateauto.'</a>';
}/* else {
$buttonreconcile .= ' <a class="butActionRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$titletoconciliateauto.'</a>';
}*/
}
}
if ($object->type != Account::TYPE_CASH || getDolGlobalString('BANK_CAN_RECONCILIATE_CASHACCOUNT')) {
$nbReceipts = 0;
@ -110,6 +132,21 @@ function bank_prepare_head(Account $object)
$head[$h][2] = 'document';
$h++;
$head[$h][0] = DOL_URL_ROOT."/compta/bank/annuel.php?account=".$object->id;
$head[$h][1] = $langs->trans("IOMonthlyReporting");
$head[$h][2] = 'annual';
$h++;
$head[$h][0] = DOL_URL_ROOT."/compta/bank/graph.php?account=".$object->id;
$head[$h][1] = $langs->trans("Graph");
$head[$h][2] = 'graph';
$h++;
$head[$h][0] = DOL_URL_ROOT."/compta/bank/treso.php?account=".$object->id;
$head[$h][1] = $langs->trans("PlannedTransactions");
$head[$h][2] = 'cash';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab

View file

@ -1898,7 +1898,7 @@ function dol_init_file_process($pathtoscan = '', $trackid = '')
* @param int<0,1> $generatethumbs 1=Generate also thumbs for uploaded image files
* @param ?Object $object Object used to set 'src_object_*' fields
* @param string $forceFullTestIndexation '1'=Force full text storage in database even if global option not set (consume a high level of data)
* @return int Return integer <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, nb of success if OK (>0)
* @see dol_remove_file_process()
*/
function dol_add_file_process($upload_dir, $allowoverwrite = 0, $updatesessionordb = 0, $varfiles = 'addedfile', $savingdocmask = '', $link = null, $trackid = '', $generatethumbs = 1, $object = null, $forceFullTestIndexation = '')
@ -2041,7 +2041,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $updatesessionor
}
}
if ($nbok > 0) {
$res = 1;
$res = $nbok;
setEventMessages($langs->trans("FileTransferComplete"), null, 'mesgs');
}
} else {

View file

@ -4039,7 +4039,7 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor
$link = str_replace('{socialid}', $value, getDolGlobalString($networkconstname));
if (preg_match('/^https?:\/\//i', $link)) {
$htmllink .= '<a href="'.dol_sanitizeUrl($link, 0).'" target="_blank" rel="noopener noreferrer">'.dol_escape_htmltag($value).'</a>';
} else {
} elseif ($link) {
$htmllink .= '<a href="'.dol_sanitizeUrl($link, 1).'" target="_blank" rel="noopener noreferrer">'.dol_escape_htmltag($value).'</a>';
}
} elseif (!empty($dictsocialnetworks[$type]['url'])) {
@ -13777,7 +13777,7 @@ function forgeSQLFromUniversalSearchCriteria($filter, &$errorstr = '', $noand =
}
}
$ret = ($noand ? "" : " AND ").($nopar ? "" : '(').preg_replace_callback('/'.$regexstring.'/i', 'dolForgeCriteriaCallback', $filter).($nopar ? "" : ')');
$ret = ($noand ? "" : " AND ").($nopar ? "" : '(').preg_replace_callback('/'.$regexstring.'/i', 'dolForgeSQLCriteriaCallback', $filter).($nopar ? "" : ')');
if (is_object($db)) {
$ret = str_replace('__NOW__', $db->idate(dol_now()), $ret);
@ -13938,14 +13938,14 @@ function dolForgeDummyCriteriaCallback($matches)
}
/**
* Function to forge a SQL criteria from a Dolibarr filter syntax string.
* Function to forge a SQL criteria from a USF (Universal Filter Syntax) string.
* This method is called by forgeSQLFromUniversalSearchCriteria()
*
* @param string[] $matches Array of found string by regex search.
* Example: "t.ref:like:'SO-%'" or "t.date_creation:<:'20160101'" or "t.date_creation:<:'2016-01-01 12:30:00'" or "t.nature:is:NULL"
* @return string Forged criteria. Example: "t.field LIKE 'abc%'"
*/
function dolForgeCriteriaCallback($matches)
function dolForgeSQLCriteriaCallback($matches)
{
global $db;

View file

@ -581,7 +581,7 @@ function project_admin_prepare_head()
/**
* Show task lines with a particular parent
*
* @param string $inc Line number (start to 0, then increased by recursive call)
* @param int $inc Line number (start to 0, then increased by recursive call)
* @param int $parent Id of parent task to show (0 to show all)
* @param Task[] $lines Array of lines
* @param int $level Level (start to 0, then increased/decrease by recursive call), or -1 to show all level in order of $lines without the recursive groupment feature.
@ -1168,7 +1168,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
/**
* Output a task line into a pertime input mode
*
* @param string $inc Line number (start to 0, then increased by recursive call)
* @param int $inc Line number (start to 0, then increased by recursive call)
* @param int $parent Id of parent task to show (0 to show all)
* @param ?User $fuser Restrict list to user if defined
* @param Task[] $lines Array of lines
@ -1398,7 +1398,7 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec
/**
* Output a task line into a pertime input mode
*
* @param string $inc Line number (start to 0, then increased by recursive call)
* @param int $inc Line number (start to 0, then increased by recursive call)
* @param int $parent Id of parent task to show (0 to show all)
* @param ?User $fuser Restrict list to user if defined
* @param Task[] $lines Array of lines
@ -1801,7 +1801,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
/**
* Output a task line into a perday input mode
*
* @param string $inc Line output identificator (start to 0, then increased by recursive call)
* @param int $inc Line output identificator (start to 0, then increased by recursive call)
* @param int $firstdaytoshow First day to show
* @param ?User $fuser Restrict list to user if defined
* @param int $parent Id of parent task to show (0 to show all)
@ -2207,7 +2207,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
/**
* Output a task line into a perday input mode
*
* @param string $inc Line output identificator (start to 0, then increased by recursive call)
* @param int $inc Line output identificator (start to 0, then increased by recursive call)
* @param int $firstdaytoshow First day to show
* @param User|null $fuser Restrict list to user if defined
* @param int $parent Id of parent task to show (0 to show all)

View file

@ -1160,8 +1160,8 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
$sql = "SELECT d.rowid, d.product_type as dtype, e.rowid as facid, d.$f_rate as rate, d.vat_src_code as vat_src_code, d.total_ht as total_ht, d.total_ttc as total_ttc, d.total_tva as total_vat, e.note_private as descr,";
$sql .= " d.total_localtax1 as total_localtax1, d.total_localtax2 as total_localtax2, ";
$sql .= " e.date_debut as date_start, e.date_fin as date_end, e.fk_user_author,";
$sql .= " e.ref as facnum, e.total_ttc as ftotal_ttc, e.date_create, d.fk_c_type_fees as type,";
$sql .= " p.fk_bank as payment_id, p.amount as payment_amount, p.rowid as pid, e.ref as pref";
$sql .= " e.ref as facnum, e.ref as pref, e.total_ttc as ftotal_ttc, e.date_create, d.fk_c_type_fees as type,";
$sql .= " p.fk_bank as payment_id, p.amount as payment_amount, p.rowid as pid";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as e";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport_det as d ON d.fk_expensereport = e.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."payment_expensereport as p ON p.fk_expensereport = e.rowid";
@ -1184,7 +1184,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
$sql .= " AND (d.product_type = -1";
$sql .= " OR e.date_debut is NOT null OR e.date_fin IS NOT NULL)"; // enhance detection of service
if (getDolGlobalString('MAIN_NOT_INCLUDE_ZERO_VAT_IN_REPORTS')) {
$sql .= " AND (d.".$f_rate." <> 0 OR d.total_tva <> 0)";
$sql .= " AND (d.".$db->sanitize($f_rate)." <> 0 OR d.total_tva <> 0)";
}
$sql .= " ORDER BY e.rowid";

View file

@ -689,7 +689,7 @@ class pdf_espadon extends ModelePdfExpedition
$weighttxt = round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, getDolGlobalInt('SHIPMENT_ROUND_WEIGHT_ON_PDF', 5)).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units, 1);
}
$voltxt = '';
if (empty($object->lines[$i]->fk_product_type) && $object->lines[$i]->volume) {
if (empty($object->lines[$i]->fk_product_type) && $object->lines[$i]->volume && !getDolGlobalString('SHIPPING_PDF_HIDE_VOLUME')) {
$voltxt = round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, getDolGlobalInt('SHIPMENT_ROUND_VOLUME_ON_PDF', 5)).' '.measuringUnitString(0, "volume", $object->lines[$i]->volume_units ? $object->lines[$i]->volume_units : 0, 1);
}
@ -883,13 +883,13 @@ class pdf_espadon extends ModelePdfExpedition
if (!empty($totalWeight)) {
$totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1);
}
if (!empty($totalVolume)) {
if (!empty($totalVolume) && !getDolGlobalString('SHIPPING_PDF_HIDE_VOLUME')) {
$totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1);
}
if (!empty($object->trueWeight)) {
$totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, (int) $object->weight_units, "weight", $outputlangs);
}
if (!empty($object->trueVolume)) {
if (!empty($object->trueVolume) && !getDolGlobalString('SHIPPING_PDF_HIDE_VOLUME')) {
if ($object->volume_units < 50) {
$totalVolumetoshow = showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs);
} else {

View file

@ -583,7 +583,7 @@ class pdf_rouget extends ModelePdfExpedition
$weighttxt = round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, getDolGlobalInt('SHIPMENT_ROUND_WEIGHT_ON_PDF', 5)).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units, 1);
}
$voltxt = '';
if (empty($object->lines[$i]->fk_product_type) && $object->lines[$i]->volume) {
if (empty($object->lines[$i]->fk_product_type) && $object->lines[$i]->volume && !getDolGlobalString('SHIPPING_PDF_HIDE_VOLUME')) {
$voltxt = round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, getDolGlobalInt('SHIPMENT_ROUND_VOLUME_ON_PDF', 5)).' '.measuringUnitString(0, "volume", $object->lines[$i]->volume_units ? $object->lines[$i]->volume_units : 0, 1);
}
@ -769,13 +769,13 @@ class pdf_rouget extends ModelePdfExpedition
if (!empty($totalWeight)) {
$totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs, -1, 'no', 1);
}
if (!empty($totalVolume)) {
if (!empty($totalVolume) && !getDolGlobalString('SHIPPING_PDF_HIDE_VOLUME')) {
$totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs, -1, 'no', 1);
}
if (!empty($object->trueWeight)) {
$totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, (int) $object->weight_units, "weight", $outputlangs);
}
if (!empty($object->trueVolume)) {
if (!empty($object->trueVolume) && !getDolGlobalString('SHIPPING_PDF_HIDE_VOLUME')) {
$totalVolumetoshow = showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs);
}

View file

@ -160,11 +160,13 @@ class InterfaceTicketEmail extends DolibarrTriggers
$see_ticket_assignee = 'SeeThisTicketIntomanagementInterface';
// Send email to notification email
// Note: $object->context['disableticketemail'] is set to 1 by public interface at creation because email sending is already managed by page
// $object->context['createdfrompublicinterface'] may also be defined when creation done from public interface
if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') && empty($object->context['disableticketemail'])) {
$sendto = !getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') ? '' : $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
if ($sendto) {
$this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs);
}
$sendto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO');
// if ($sendto) { // already test, can't be empty
$this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs);
// }
}
// Send email to assignee if an assignee was set at creation
@ -196,7 +198,9 @@ class InterfaceTicketEmail extends DolibarrTriggers
}
// Send email to customer
if (!getDolGlobalInt('TICKET_DISABLE_CUSTOMER_MAILS') && empty($object->context['disableticketemail']) && $object->notify_tiers_at_create) {
// Note: $object->context['disableticketemail'] is set to 1 by public interface at creation because email sending is already managed by page
// $object->context['createdfrompublicinterface'] may also be defined when creation done from public interface
if (empty($object->context['disableticketemail']) && $object->notify_tiers_at_create) {
$sendto = '';
// if contact selected send to email's contact else send to email's thirdparty
@ -244,15 +248,17 @@ class InterfaceTicketEmail extends DolibarrTriggers
$see_ticket_customer = 'TicketCloseEmailBodyInfosTrackUrlCustomer';
// Send email to notification email
// Note: $object->context['disableticketemail'] is set to 1 by public interface at creation but not at closing
if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') && empty($object->context['disableticketemail'])) {
$sendto = !getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') ? '' : $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
if ($sendto) {
$this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs);
}
$sendto = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO');
// if ($sendto) { // already test, can't be empty
$this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs);
// }
}
// Send email to customer.
if (!getDolGlobalString('TICKET_DISABLE_CUSTOMER_MAILS') && empty($object->context['disableticketemail'])) {
// Note: $object->context['disableticketemail'] is set to 1 by public interface at creation but not at closing
if (empty($object->context['disableticketemail'])) {
$linked_contacts = $object->listeContact(-1, 'thirdparty');
$linked_contacts = array_merge($linked_contacts, $object->listeContact(-1, 'internal'));
if (empty($linked_contacts) && getDolGlobalString('TICKET_NOTIFY_AT_CLOSING') && !empty($object->fk_soc)) {
@ -353,7 +359,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
$message_admin .= '<p>'.$langs->trans('Message').' : <br><br>'.$message.'</p><br>';
$message_admin .= '<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
$from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . '<' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>';
$from = (getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' ' : '') . '<' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>';
$trackid = 'tic'.$object->id;
@ -442,7 +448,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
$message_customer .= '<p>'.$langs->trans($see_ticket).' : <a href="'.$url_public_ticket.'">'.$url_public_ticket.'</a></p>';
$message_customer .= '<p>'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'</p>';
$from = (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? '' : getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' ').'<' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>';
$from = (getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' ' : '').'<' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>';
$trackid = 'tic'.$object->id;

View file

@ -138,6 +138,8 @@ $result = restrictedArea($user, 'expedition', $object->id, '');
$permissiondellink = $user->hasRight('expedition', 'delivery', 'creer'); // Used by the include of actions_dellink.inc.php
$permissiontoadd = $user->hasRight('expedition', 'creer');
$upload_dir = $conf->expedition->dir_output.'/sending';
$editColspan = 0;
$objectsrc = null;
$typeobject = null;
@ -146,6 +148,7 @@ $typeobject = null;
/*
* Actions
*/
$error = 0;
$parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
@ -169,7 +172,6 @@ if (empty($reshook)) {
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
// Actions to build doc
$upload_dir = $conf->expedition->dir_output.'/sending';
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Back to draft
@ -558,6 +560,14 @@ if (empty($reshook)) {
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
} elseif ($action == 'setdate_shipping' && $user->hasRight('expedition', 'creer')) {
$dateshipping = dol_mktime(GETPOSTINT('ship_hour'), GETPOSTINT('ship_min'), 0, GETPOSTINT('ship_month'), GETPOSTINT('ship_day'), GETPOSTINT('ship_year'));
$object->fetch($id);
$result = $object->setShippingDate($user, $dateshipping);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
} elseif (in_array($action, array('settracking_number', 'settracking_url', 'settrueWeight', 'settrueWidth', 'settrueHeight', 'settrueDepth', 'setshipping_method_id')) && $user->hasRight('expedition', 'creer')) {
// Action update
$error = 0;
@ -2059,10 +2069,10 @@ if ($action == 'create') {
print '</tr></table>';
print '</td><td colspan="2">';
if ($action == 'editdate_shipping') {
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<form name="setdate_shipping" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_livraison">';
print $form->selectDate($object->date_shipping ? $object->date_shipping : -1, 'liv_', 1, 1, 0, "setdate_shipping", 1, 0);
print '<input type="hidden" name="action" value="setdate_shipping">';
print $form->selectDate($object->date_shipping ? $object->date_shipping : -1, 'ship_', 1, 1, 0, "setdate_shipping", 1, 0);
print '<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans('Modify').'">';
print '</form>';
} else {

View file

@ -430,6 +430,7 @@ class Expedition extends CommonObject
if (empty($this->date_shipping) && !empty($this->date_expedition)) {
$this->date_shipping = $this->date_expedition;
}
$this->entity = setEntity($this);
$this->user = $user;
@ -462,7 +463,7 @@ class Expedition extends CommonObject
$sql .= ", signed_status";
$sql .= ") VALUES (";
$sql .= "'(PROV)'";
$sql .= ", ".((int) $conf->entity);
$sql .= ", ".((int) $this->entity);
$sql .= ", ".($this->ref_customer ? "'".$this->db->escape($this->ref_customer)."'" : "null");
$sql .= ", ".($this->ref_ext ? "'".$this->db->escape($this->ref_ext)."'" : "null");
$sql .= ", '".$this->db->idate($now)."'";
@ -2156,7 +2157,7 @@ class Expedition extends CommonObject
$this->note_private = 'Private note';
$this->note_public = 'Public note';
$nbp = 5;
$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
$xnbp = 0;
while ($xnbp < $nbp) {
$line = new ExpeditionLigne($this->db);
@ -2223,6 +2224,34 @@ class Expedition extends CommonObject
}
}
/**
* Set the shipping date
*
* @param User $user Object user that modify
* @param integer $shipping_date Date of shipping
* @return int Return integer <0 if KO, >0 if OK
*/
public function setShippingDate($user, $shipping_date)
{
if ($user->hasRight('expedition', 'creer')) {
$sql = "UPDATE ".MAIN_DB_PREFIX."expedition";
$sql .= " SET date_expedition = ".($shipping_date ? "'".$this->db->idate($shipping_date)."'" : 'null');
$sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::setShippingDate", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$this->date_shipping = $shipping_date;
return 1;
} else {
$this->error = $this->db->error();
return -1;
}
} else {
return -2;
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Fetch deliveries method and return an array. Load array this->meths(rowid=>label).

View file

@ -669,7 +669,7 @@ $companystatic = new Societe($db);
$formcompany = new FormCompany($db);
$shipment = new Expedition($db);
$title = $langs->trans('ListOfSendings');
$title = $langs->trans('Shipments');
$help_url = 'EN:Module_Shipments|FR:Module_Exp&eacute;ditions|ES:M&oacute;dulo_Expediciones';
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-expedition page-list');
@ -934,8 +934,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
exit;
}
$expedition = new Expedition($db);
if ($socid > 0) {
$soc = new Societe($db);
$soc->fetch($socid);
@ -1074,7 +1072,7 @@ print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dolly', 0, $newcardbutton, '', $limit, 0, 0, 1);
print_barre_liste($langs->trans('Shipments'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dolly', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "SendShippingRef";
$modelmail = "shipping_send";
@ -1085,7 +1083,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($massaction == 'createbills') {
print '<input type="hidden" name="massaction" value="confirm_createbills">';
print '<table class="noborder" width="100%" >';
print '<table class="noborder centpercent">';
print '<tr>';
print '<td class="titlefield">';
print $langs->trans('DateInvoice');

View file

@ -968,7 +968,7 @@ class ExpenseReport extends CommonObject
$this->note_private = 'Private note';
$this->note_public = 'SPECIMEN';
$nbp = 5;
$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
$xnbp = 0;
while ($xnbp < $nbp) {
$line = new ExpenseReportLine($this->db);

View file

@ -908,7 +908,7 @@ if ($action == 'create') {
$res = $soc->fetch($socid);
}
if (GETPOST('origin') && GETPOSTINT('originid')) {
if (GETPOST('origin', 'alphanohtml') && GETPOSTINT('originid')) {
// Parse element/subelement (ex: project_task)
$regs = array();
$element = $subelement = GETPOST('origin', 'alphanohtml');
@ -1076,6 +1076,7 @@ if ($action == 'create') {
if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
$newclassname = $classname;
if ($newclassname == 'Propal') {
$langs->load('propal');
$newclassname = 'CommercialProposal';
}
print '<tr><td>'.$langs->trans($newclassname).'</td><td colspan="2">'.$objectsrc->getNomUrl(1).'</td></tr>';
@ -1119,7 +1120,7 @@ if ($action == 'create') {
print $form->buttonsSaveCancel("CreateDraftIntervention");
// Show origin lines
if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
if (!empty($origin) && !empty($originid) && is_object($objectsrc) && !getDolGlobalInt('FICHINTER_DISABLE_DETAILS')) {
$title = $langs->trans('Services');
print load_fiche_titre($title);

View file

@ -295,6 +295,7 @@ class Fichinter extends CommonObject
dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
return -1;
}
$this->entity = setEntity($this);
$soc = new Societe($this->db);
$result = $soc->fetch($this->socid);
@ -325,7 +326,7 @@ class Fichinter extends CommonObject
$sql .= ", '".$this->db->idate($now)."'";
$sql .= ", '".$this->db->escape($this->ref)."'";
$sql .= ", ".($this->ref_client ? "'".$this->db->escape($this->ref_client)."'" : "null");
$sql .= ", ".((int) $conf->entity);
$sql .= ", ".((int) $this->entity);
$sql .= ", ".((int) $user->id);
$sql .= ", ".((int) $user->id);
$sql .= ", ".($this->description ? "'".$this->db->escape($this->description)."'" : "null");

View file

@ -1063,7 +1063,7 @@ while ($i < $imaxinloop) {
print '</tr>'."\n";
$total += $obj->duree;
$total += (isset($obj->duree) ? $obj->duree : 0);
}
$i++;
}

View file

@ -268,7 +268,7 @@ if (empty($dolibarr_strict_mode)) {
define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem core php (htdocs)
if (!file_exists(DOL_DOCUMENT_ROOT."/core/lib/functions.lib.php")) {
print "Error: Dolibarr config file content seems to be not correctly defined.<br>\n";
print "Error: Dolibarr config file content seems to be not correctly defined (file ".DOL_DOCUMENT_ROOT."/core/lib/functions.lib.php not found).<br>\n";
print "Please run dolibarr setup by calling page <b>/install</b>.<br>\n";
exit(1);
}

View file

@ -116,6 +116,8 @@ class CommandeFournisseur extends CommonOrder
/**
* @var ?int<0,9>
* @deprecated see $status
* @see $status
*/
public $statut; // 0=Draft -> 1=Validated -> 2=Approved -> 3=Ordered/Process running -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially
// -> 7=Canceled/Never received -> (reopen) 3=Process running
@ -892,7 +894,7 @@ class CommandeFournisseur extends CommonOrder
*/
public function getLibStatut($mode = 0)
{
return $this->LibStatut($this->statut, $mode, $this->billed);
return $this->LibStatut($this->status, $mode, $this->billed);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -992,7 +994,7 @@ class CommandeFournisseur extends CommonOrder
if ($user->hasRight("fournisseur", "commande", "read")) {
$datas['picto'] = '<u class="paddingrightonly">'.$langs->trans("SupplierOrder").'</u>';
if ($this->statut) {
if ($this->status) {
$datas['picto'] .= ' '.$this->getLibStatut(5);
}
if (!empty($this->ref)) {
@ -1156,6 +1158,7 @@ class CommandeFournisseur extends CommonOrder
$obj = new $classname();
'@phan-var-force ModeleNumRefSuppliersOrders $obj';
/** @var ModeleNumRefSuppliersOrders $obj */
$numref = $obj->getNextValue($soc, $this);
if ($numref != "") {
@ -1169,6 +1172,7 @@ class CommandeFournisseur extends CommonOrder
return -2;
}
}
/**
* Class invoiced the supplier order
*
@ -1598,6 +1602,7 @@ class CommandeFournisseur extends CommonOrder
$this->fk_multicurrency = 0;
$this->multicurrency_tx = 1;
}
$this->entity = setEntity($this);
// We set order into draft status
$this->statut = self::STATUS_DRAFT; // deprecated
@ -1630,7 +1635,7 @@ class CommandeFournisseur extends CommonOrder
$sql .= ", ".(isset($this->ref_supplier) ? "'".$this->db->escape($this->ref_supplier)."'" : "NULL");
$sql .= ", '".$this->db->escape($this->note_private)."'";
$sql .= ", '".$this->db->escape($this->note_public)."'";
$sql .= ", ".setEntity($this);
$sql .= ", ".((int) $this->entity);
$sql .= ", ".((int) $this->socid);
$sql .= ", ".($this->fk_project > 0 ? ((int) $this->fk_project) : "null");
$sql .= ", '".$this->db->idate($date)."'";
@ -3188,9 +3193,10 @@ class CommandeFournisseur extends CommonOrder
$this->multicurrency_code = $conf->currency;
$this->statut = 0;
$this->status = 0;
// Lines
$nbp = 5;
$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
$xnbp = 0;
while ($xnbp < $nbp) {
$line = new CommandeFournisseurLigne($this->db);

View file

@ -1307,7 +1307,7 @@ class FactureFournisseurRec extends CommonInvoice
if (empty($this->date_when)) {
return false;
}
return dol_time_plus_duree((int) $this->date_when, $this->frequency, $this->unit_frequency);
return dol_time_plus_duree((int) $this->date_when, $this->frequency, $this->unit_frequency, 1);
}
/**
@ -1783,7 +1783,7 @@ class FactureFournisseurRec extends CommonInvoice
if (empty($option) || $option != 'nolines') {
// Lines
$nbp = 5;
$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
$xnbp = 0;
while ($xnbp < $nbp) {
$line = new FactureLigne($this->db);

View file

@ -423,6 +423,7 @@ class FactureFournisseur extends CommonInvoice
$this->fk_multicurrency = 0;
$this->multicurrency_tx = 1;
}
$this->entity = setEntity($this);
$this->db->begin();
@ -577,7 +578,7 @@ class FactureFournisseur extends CommonInvoice
$sql .= "'(PROV)'";
$sql .= ", '".$this->db->escape($this->ref_supplier)."'";
$sql .= ", '".$this->db->escape($this->ref_ext)."'";
$sql .= ", ".((int) $conf->entity);
$sql .= ", ".((int) $this->entity);
$sql .= ", '".$this->db->escape($this->type)."'";
$sql .= ", ".((int) $this->subtype);
$sql .= ", '".$this->db->escape(isset($this->label) ? $this->label : (isset($this->libelle) ? $this->libelle : ''))."'";
@ -3071,7 +3072,7 @@ class FactureFournisseur extends CommonInvoice
$xnbp = 0;
if (empty($option) || $option != 'nolines') {
// Lines
$nbp = 5;
$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
while ($xnbp < $nbp) {
$line = new SupplierInvoiceLine($this->db);
$line->desc = $langs->trans("Description")." ".$xnbp;

View file

@ -242,7 +242,7 @@ if (!defined('DONOTLOADCONF') && file_exists($conffile) && filesize($conffile) >
$result = conf($dolibarr_main_document_root);
}
// Load database driver
if ($result) {
if ($result > 0) {
if (!empty($dolibarr_main_document_root) && !empty($dolibarr_main_db_type)) {
$result = include_once $dolibarr_main_document_root."/core/db/".$dolibarr_main_db_type.'.class.php';
if (!$result) {
@ -432,7 +432,7 @@ function conf($dolibarr_main_document_root)
global $dolibarr_main_instance_unique_id;
global $dolibarr_main_cookie_cryptkey;
$return = include_once $dolibarr_main_document_root.'/core/class/conf.class.php';
$return = @include_once $dolibarr_main_document_root.'/core/class/conf.class.php';
if (!$return) {
return -1;
}

View file

@ -349,7 +349,8 @@ ALTER TABLE llx_societe_commerciaux ADD COLUMN fk_c_type_contact_code varchar(32
-- VPGSQL8.2 DROP INDEX uk_societe_commerciaux;
ALTER TABLE llx_societe_commerciaux ADD UNIQUE INDEX uk_societe_commerciaux_c_type_contact (fk_soc, fk_user, fk_c_type_contact_code);
ALTER TABLE llx_c_type_contact ADD INDEX idx_c_type_contact_code (code);
ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_c_type_contact_code FOREIGN KEY (fk_c_type_contact_code) REFERENCES llx_c_type_contact(code);
--Removed, not unique. ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_c_type_contact_code FOREIGN KEY (fk_c_type_contact_code) REFERENCES llx_c_type_contact(code);
ALTER TABLE llx_societe_commerciaux DROP FOREIGN KEY fk_societe_commerciaux_fk_c_type_contact_code;
ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid);
ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_user FOREIGN KEY (fk_user) REFERENCES llx_user(rowid);

View file

@ -81,7 +81,9 @@ ALTER TABLE llx_product DROP FOREIGN KEY fk_product_default_warehouse;
DROP TABLE llx_contratdet_log;
ALTER TABLE llx_societe_rib MODIFY COLUMN iban_prefix varchar(60);
ALTER TABLE llx_societe_rib MODIFY COLUMN iban_prefix varchar(80);
ALTER TABLE llx_bank_account MODIFY COLUMN iban_prefix varchar(80);
ALTER TABLE llx_user_rib MODIFY COLUMN iban_prefix varchar(80);
ALTER TABLE llx_bom_bom ADD COLUMN last_main_doc varchar(255) AFTER model_pdf;

View file

@ -39,7 +39,7 @@ create table llx_bank_account
cle_rib varchar(5),
bic varchar(11), -- 11 according to ISO 9362
bic_intermediate varchar(11), -- 11 according to ISO 9362. Same as bic but for intermediate bank
iban_prefix varchar(34), -- full iban. 34 according to ISO 13616
iban_prefix varchar(80), -- full iban. 34 according to ISO 13616 but we set 80 to allow to store it with encryption information
country_iban varchar(2), -- deprecated
cle_iban varchar(2),
domiciliation varchar(255),

View file

@ -17,6 +17,6 @@
-- ===================================================================
ALTER TABLE llx_societe_commerciaux ADD UNIQUE INDEX uk_societe_commerciaux_c_type_contact (fk_soc, fk_user, fk_c_type_contact_code);
ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_c_type_contact_code FOREIGN KEY (fk_c_type_contact_code) REFERENCES llx_c_type_contact(code);
--Removed, not unique. ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_c_type_contact_code FOREIGN KEY (fk_c_type_contact_code) REFERENCES llx_c_type_contact(code);
ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid);
ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_user FOREIGN KEY (fk_user) REFERENCES llx_user(rowid);

View file

@ -39,7 +39,7 @@ create table llx_societe_rib
bic varchar(20), -- 11 according to ISO 9362 (we keep 20 for backward compatibility)
bic_intermediate varchar(11), -- 11 according to ISO 9362. Same as bic but for intermediate bank
iban_prefix varchar(60), -- full iban. 34 according to ISO 13616 ut we set 60 to allow to store it with encryption information
iban_prefix varchar(80), -- full iban. 34 according to ISO 13616 but we set 80 to allow to store it with encryption information
domiciliation varchar(255),
proprio varchar(60),

View file

@ -31,7 +31,7 @@ create table llx_user_rib
cle_rib varchar(5), -- key of bank account
bic varchar(11), -- 11 according to ISO 9362
bic_intermediate varchar(11), -- 11 according to ISO 9362. Same as bic but for intermediate bank
iban_prefix varchar(34), -- full iban. 34 according to ISO 13616
iban_prefix varchar(80), -- full iban. 34 according to ISO 13616 but we set 80 to allow to store it with encryption information
domiciliation varchar(255),
proprio varchar(60),
owner_address varchar(255),

View file

@ -133,7 +133,7 @@ DeleteTransaction=Delete entry
ConfirmDeleteTransaction=Are you sure you want to delete this entry?
ThisWillAlsoDeleteBankRecord=This will also delete generated bank entry
BankMovements=Movements
PlannedTransactions=Planned entries
PlannedTransactions=Upcoming entries
Graph=Graphs
ExportDataset_banque_1=Bank entries and account statement
ExportDataset_banque_2=Deposit slip

View file

@ -60,7 +60,7 @@ Numberspad=Numbers Pad
BillsCoinsPad=Coins and banknotes Pad
DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr
TakeposNeedsCategories=TakePOS needs at least one product category to work
TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS needs at least 1 product category under the category <b>%s</b> to work
TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS needs at least 1 sub-category under the product category <b>%s</b> to work
OrderNotes=Can add some notes to each ordered items
CashDeskBankAccountFor=Default account to use for payments in
NoPaimementModesDefined=No paiment mode defined in TakePOS configuration

View file

@ -98,4 +98,5 @@ NeedBusinessTravels=Need business travels
NoDescription=No description
TheJobProfileHasNoSkillsDefinedFixBefore=The evaluated job profile of this employee has no skill defined on it. Please add skill(s), then delete and restart the evaluation.
PDFStandardHrmEvaluation=Standard template to generate a PDF document for a competency assessment
SkillNotRequired=Skill not required
SkillNotRequired=Skill not required
LinkToUserCreated=Link to an employee if the applicant has been hired and converted into a user.

View file

@ -72,6 +72,7 @@ Language_fr_FR=French
Language_fr_GA=French (Gabon)
Language_fr_NC=French (New Caledonia)
Language_fr_SN=French (Senegal)
Language_fr_TN=French (Tunisia)
Language_fy_NL=Frisian
Language_gl_ES=Galician
Language_he_IL=Hebrew

View file

@ -97,7 +97,6 @@ ShowService=Show service
ProductsAndServicesArea=Product and Services area
ProductsArea=Product area
ServicesArea=Services area
ListOfStockMovements=List of stock movements
BuyingPrice=Buying price
PriceForEachProduct=Products with specific prices
SupplierCard=Vendor card

View file

@ -7,7 +7,6 @@ Receptions=Receptions
AllReceptions=All Receptions
ShowReception=Show Receptions
ReceptionsArea=Receptions area
ListOfReceptions=List of receptions
ReceptionMethod=Reception method
LastReceptions=Latest %s receptions
StatisticsOfReceptions=Statistics for receptions

View file

@ -8,13 +8,12 @@ Shipments=Shipments
ShowSending=Show Shipments
Receivings=Delivery Receipts
SendingsArea=Shipments area
ListOfSendings=List of shipments
SendingMethod=Shipping method
LastSendings=Latest %s shipments
StatisticsOfSendings=Statistics for shipments
NbOfSendings=Number of shipments
NumberOfShipmentsByMonth=Number of shipments by month
SendingCard=Shipment card
SendingCard=Shipment
NewSending=New shipment
CreateShipment=Create shipment
QtyShipped=Qty shipped

View file

@ -27,9 +27,6 @@ LotSerialList=List of lot/serials
SubjectToLotSerialOnly=Products subject to lot/serial only
Movements=Movements
ErrorWarehouseRefRequired=Warehouse reference name is required
ListOfWarehouses=List of warehouses
ListOfStockMovements=List of stock movements
ListOfInventories=List of inventories
MovementId=Movement ID
StockMovementForId=Movement ID %d
ListMouvementStockProject=List of stock movements associated to project
@ -348,3 +345,4 @@ QtyViewed=Quantity viewed
QtyStock=Quantity on stock
QtyRegulated=Quantity on stock correction
InventoryEntrepot=Warehouse identity
SelectedWarehouse=Select a warehouse

View file

@ -72,10 +72,10 @@ TicketPublicAccess=A public interface requiring no identification is available a
TicketSetupDictionaries=The type of ticket, severity and analytic codes are configurable from dictionaries
TicketParamModule=Module variable setup
TicketParamMail=Email setup
TicketEmailNotificationFrom=Sender e-mail for notification on answers
TicketEmailNotificationFromHelp=Sender e-mail to use to send the notification email when an answer is provided inside the back office. For example noreply@example.com
TicketEmailNotificationFrom=Sender e-mail for notification on tickets
TicketEmailNotificationFromHelp=Sender e-mail to use to send the notification emails for tickets creation or messages. For example noreply@example.com
TicketEmailNotificationTo=Notify ticket creation to this e-mail address
TicketEmailNotificationToHelp=If present, this e-mail address will be notified of a ticket creation
TicketEmailNotificationToHelp=If present, this e-mail address will be notified of a ticket creation (in addition to any other default recipients)
TicketNewEmailBodyLabel=Text message sent after creating a ticket
TicketNewEmailBodyHelp=The text specified here will be inserted into the email confirming the creation of a new ticket from the public interface. Information on the consultation of the ticket are automatically added.
TicketParamPublicInterface=Public interface setup
@ -96,7 +96,9 @@ TicketPublicInterfaceTextHelpMessageHelpAdmin=This text will appear above the me
ExtraFieldsTicket=Extra attributes
TicketCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL content to 1 to get it.
TicketsDisableEmail=Do not send emails for ticket creation or message recording
TicketsDisableEmailHelp=By default, emails are sent when new tickets or messages created. Enable this option to disable *all* email notifications
TicketsDisableEmailHelp=By default, notification emails to third parties are sent when new tickets or messages are created for both backoffice and public interface. Enable this option to disable email notifications to thirdparties when creation is done from backoffice.
TicketsNotifyThirdPartyFromBackOfficeByDefault=Notify third party by default on ticket creation from backoffice
TicketsNotifyThirdPartyFromBackOfficeByDefaultHelp=When creating a ticket from the backoffice, the option "Notify third party" will be checked by default
TicketsLogEnableEmail=Enable log by email
TicketsLogEnableEmailHelp=At each change, an email will be sent **to each contact** associated with the ticket.
TicketParams=Params
@ -119,7 +121,7 @@ TicketAutoChangeStatusOnAnswerHelp=When a user answers to a ticket, the status w
TicketNumberingModules=Tickets numbering module
TicketsModelModule=Document templates for tickets
TicketNotifyTiersAtCreation=Notify third party at creation
TicketsDisableCustomerEmail=Always disable emails when a ticket is created from public interface
TicketsDisableCustomerEmail=Always disable emails to third parties when a ticket is created from the backoffice
TicketsPublicNotificationNewMessage=Send email(s) when a new message/comment is added to a ticket
TicketsPublicNotificationNewMessageHelp=Send email(s) when a new message is added from public interface (to assigned user or the notifications email to (update) and/or the notifications email to)
TicketPublicNotificationNewMessageDefaultEmail=Notifications email to (update)

View file

@ -60,7 +60,7 @@ Numberspad=Pavé numérique
BillsCoinsPad=Pavé avec montant des Pièces et Billets
DolistorePosCategory=Modules TakePOS et autres solutions de PDV pour Dolibarr
TakeposNeedsCategories=TakePOS a besoin d'au moins une catégorie de produits pour fonctionner
TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS a besoin d'au moins 1 catégorie de produits dans la catégorie <b> %s </b> pour fonctionner
TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS a besoin d'au moins 1 sous-catégorie dans la catégorie de produit <b> %s </b> pour fonctionner
OrderNotes=Il est possible d'ajouter des notes sur chacun des produits commandés
CashDeskBankAccountFor=Compte par défaut à utiliser pour les paiements en
NoPaimementModesDefined=Aucun mode de paiement défini dans la configuration de TakePOS

View file

@ -0,0 +1,31 @@
# Dolibarr language file - Source file is en_US - main
DIRECTION=ltr
# Default for FONTFORPDF=helvetica
# Note for Chinese:
# msungstdlight or cid0ct are for traditional Chinese zh_TW (traditional does not render with Ubuntu pdf reader)
# stsongstdlight or cid0cs are for simplified Chinese zh_CN
# To read Chinese pdf with Linux: sudo apt-get install poppler-data
# cid0jp is for Japanish
# cid0kr is for Korean
# DejaVuSans is for some Eastern languages, some Asian languages and some Arabic languages
# freemono is for ru_RU or uk_UA, uz_UZ
# freeserif is for Tamil or Ethiopian
FONTFORPDF=helvetica
FONTSIZEFORPDF=10
SeparatorDecimal=,
SeparatorThousand=Space
FormatDateShort=%d/%m/%Y
FormatDateShortInput=%d/%m/%Y
FormatDateShortJava=dd/MM/yyyy
FormatDateShortJavaInput=dd/MM/yyyy
FormatDateShortJQuery=dd/mm/yy
FormatDateShortJQueryInput=dd/mm/yy
FormatHourShortJQuery=HH:MI
FormatHourShort=%H:%M
FormatHourShortDuration=%H:%M
FormatDateTextShort=%d %b %Y
FormatDateText=%d %B %Y
FormatDateHourShort=%d/%m/%Y %H:%M
FormatDateHourSecShort=%d/%m/%Y %H:%M:%S
FormatDateHourTextShort=%d %b %Y %H:%M
FormatDateHourText=%d %B %Y %H:%M

View file

@ -0,0 +1,2 @@
# Dolibarr language file - Source file is en_US - sendings
SendingCard=Bon livraison

View file

@ -650,6 +650,9 @@ print '<input type="submit" class="button reposition" value="'.$langs->trans("Mo
print '</div>';
print '<br>';
print load_fiche_titre($langs->trans("UserInterface"), '', '');

View file

@ -2539,6 +2539,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT
$total_ttc = $resultarray[2];
if (!getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
print '<!-- PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES -->'."\n";
print '<tr class="oddeven">';
print '<td colspan="3">' . $langs->trans('Default') . '</td>';
@ -2580,7 +2581,10 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT
print '<td class="right"></td>';
if (!empty($extralabels)) {
foreach ($extralabels as $key) {
print '<td class="right"></td>';
// Show field if not hidden
if (!empty($extrafields->attributes["product_customer_price"]['list'][$key]) && $extrafields->attributes["product_customer_price"]['list'][$key] != 3) {
print '<td class="right"></td>';
}
}
}
if ($user->hasRight('produit', 'supprimer') || $user->hasRight('service', 'supprimer')) {

View file

@ -217,7 +217,7 @@ if ($result || !($id > 0)) {
// Product
print '<tr class="nooddeven"><td class="titlefield">'.$langs->trans("ProductOrService").'</td><td>';
print img_picto('', 'product', 'class="pictofixedwidth"');
print $form->select_produits($id, 'id', '', 0, 0, 1, 2, '', ($conf->dol_optimize_smallscreen ? 1 : 0), array(), 0, '1', 0, 'widthcentpercentminusx maxwidth400');
print $form->select_produits($id, 'id', '', 0, 0, 1, 2, '', 0, array(), 0, $langs->trans("RefOrLabel"), 0, 'widthcentpercentminusx maxwidth400');
print '</td></tr>';
// Tag

View file

@ -478,7 +478,7 @@ class MouvementStock extends CommonObject
return -8;
}
} else {
if (isset($product->stock_warehouse[$entrepot_id]) && (empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty))) {
if (empty($product->stock_warehouse[$entrepot_id]) || empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty)) {
$langs->load("stocks");
$this->error = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref;
$this->errors[] = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref;

View file

@ -560,7 +560,7 @@ if ($resql) {
if ($msid) {
$texte = $langs->trans('StockMovementForId', $msid);
} else {
$texte = $langs->trans("ListOfStockMovements");
$texte = $langs->trans("StockMovements");
if ($id) {
$texte .= ' ('.$langs->trans("ForThisWarehouse").')';
}

View file

@ -832,7 +832,7 @@ $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
if ($msid) {
$title = $langs->trans('StockMovementForId', $msid);
} else {
$title = $langs->trans("ListOfStockMovements");
$title = $langs->trans("StockMovements");
if ($id) {
if (!empty($warehouse->ref)) {
$title .= ' ('.$warehouse->ref.')';
@ -1236,7 +1236,7 @@ if (!empty($arrayfields['pl.sellby']['checked'])) {
if (!empty($arrayfields['e.ref']['checked'])) {
print '<td class="liste_titre maxwidthonsmartphone left">';
//print '<input class="flat" type="text" size="8" name="search_warehouse" value="'.($search_warehouse).'">';
print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'maxwidth200');
print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'maxwidth150');
print '</td>';
}
if (!empty($arrayfields['m.fk_user_author']['checked'])) {
@ -1564,7 +1564,7 @@ while ($i < $imaxinloop) {
}
// Warehouse
if (!empty($arrayfields['e.ref']['checked'])) {
print '<td class="tdoverflowmax100">';
print '<td class="tdoverflowmax150">';
print $warehousestatic->getNomUrl(1);
print "</td>\n";
}
@ -1591,7 +1591,7 @@ while ($i < $imaxinloop) {
if (!empty($arrayfields['origin']['checked'])) {
print '<td class="nowraponall">'.$origin.'</td>';
}
// fk_project
// Project
if (!empty($arrayfields['m.fk_projet']['checked'])) {
print '<td>';
if ($obj->fk_project != 0) {

View file

@ -745,7 +745,7 @@ if ($usevirtualstock == 0) {
$stocklabel = $langs->trans('PhysicalStock');
}
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
$stocklabelbis = $stocklabel.' (Selected warehouse)';
$stocklabelbis = $stocklabel.' ('.$langs->trans('SelectedWarehouse').')';
$stocklabel .= ' ('.$langs->trans("AllWarehouses").')';
}
$texte = $langs->trans('Replenishment');

View file

@ -883,7 +883,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object-
print '</form>';
} elseif ($id > 0 || !empty($ref)) {
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
// Projet card in view mode
@ -1085,6 +1085,11 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object-
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
// Fields from hook
$parameters = array('arrayfields' => $arrayfields);
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '<td class="liste_titre maxwidthsearch">&nbsp;</td>';
// Action column

View file

@ -2119,6 +2119,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
break;
}
// Line is invoiced if it has an invoice_id
$invoiced = $task_time->invoice_id ? true : false;
$date1 = $db->jdate($task_time->element_date);
$date2 = $db->jdate($task_time->element_datehour);
@ -2156,7 +2159,18 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
$selected = 1;
}
print '&nbsp;';
print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
// Disable select if task not billable or already invoiced
$disabled = (intval($task_time->billable) != 1 || $invoiced);
$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';
if ($disabled) {
// If disabled, a dbl-click very close outside the control
// will re-enable it, so that user is not blocked if needed.
print '<span id="cbsp'. $task_time->rowid . '">'.$ctrl.'</span>';
print '<script>$("#cbsp' . $task_time->rowid . '").dblclick(()=>{ $("#cb' . $task_time->rowid . '").removeAttr("disabled") })</script>';
} else {
print $ctrl;
}
}
}
}
@ -2426,7 +2440,6 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
}
// Invoiced
$invoiced = false;
if (!empty($arrayfields['valuebilled']['checked'])) {
print '<td class="center">'; // invoice_id and invoice_line_id
if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
@ -2506,6 +2519,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
$selected = 1;
}
print '&nbsp;';
// Disable select if task not billable or already invoiced
$disabled = (intval($task_time->billable) != 1 || $invoiced);
$ctrl = '<input '.($disabled ? 'disabled' : '').' id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>';

View file

@ -225,13 +225,13 @@ if (is_array($object->lines) && (count($object->lines) > 0)) {
// We re-program the next execution and stores the last execution time for this job
$result = $cronjob->reprogram_jobs($userlogin, $now);
if ($result < 0) {
echo "Error cronjobid: ".$line->id." cronjob->reprogram_job: ".$cronjob->error."\n";
echo " - Error cronjobid: ".$line->id." cronjob->reprogram_job: ".$cronjob->error."\n";
echo "Enable module Log if not yet enabled, run again and take a look into dolibarr.log file\n";
dol_syslog("cron_run_jobs.php::reprogram_jobs Error".$cronjob->error, LOG_ERR);
exit;
exit(1);
}
echo "Job re-scheduled\n";
echo " - Job re-scheduled\n";
} else {
echo " - not qualified (datenextrunok=".($datenextrunok ?: 0).", datestartok=".($datestartok ?: 0).", dateendok=".($dateendok ?: 0).")\n";

View file

@ -57,7 +57,7 @@ include_once '../../../main.inc.php'; // Load $user and permissions
* @var DoliDB $db
*/
$action = GETPOST('action', 'aZ09');
$action = GETPOST('action', 'aZ09');
$id = GETPOSTINT('id');
$email = GETPOST('email', 'custom', 0, FILTER_VALIDATE_EMAIL);

View file

@ -99,7 +99,6 @@ if ($cancel) {
* View
*/
$form = new Form($db);
$v = new vCard();
$company = $mysoc;
@ -157,9 +156,20 @@ if (getDolUserInt('USER_PUBLIC_HIDE_USER_MOBILE', 0, $object)) {
}
if (getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS', 0, $object)) {
$object->socialnetworks = [];
} else {
// Show list of social networks for company
$listofnetworks = $object->socialnetworks;
if (!empty($listofnetworks)) {
foreach ($listofnetworks as $key => $networkVal) {
if (getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS_'.strtoupper($key), 0, $object)) {
unset($object->socialnetworks[$key]);
}
}
}
}
// By default, personal address not visible
// By default, personal birthdate and address is not visible
if (!getDolUserInt('USER_PUBLIC_SHOW_BIRTH', 0, $object)) {
$object->birth = null;
}
@ -174,10 +184,32 @@ if (!getDolUserInt('USER_PUBLIC_SHOW_ADDRESS', 0, $object)) {
if (getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) {
$company = null;
}
if (getDolUserInt('SOCIETE_PUBLIC_HIDE_EMAIL', 0, $object)) {
$mysoc->email = '';
}
if (getDolUserInt('SOCIETE_PUBLIC_HIDE_OFFICE_PHONE', 0, $object)) {
$mysoc->phone = '';
}
if (getDolUserInt('SOCIETE_PUBLIC_HIDE_OFFICE_FAX', 0, $object)) {
$mysoc->fax = '';
}
if (getDolUserInt('SOCIETE_PUBLIC_HIDE_URL', 0, $object)) {
$mysoc->url = '';
}
if (getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS_BUSINESS', 0, $object) && is_object($company)) {
$company->socialnetworks = [];
}
} else {
// Show list of social networks for company
$listofnetworks = $mysoc->socialnetworks;
if (!empty($listofnetworks)) {
foreach ($listofnetworks as $key => $networkVal) {
if (getDolUserInt('SOCIETE_PUBLIC_HIDE_SOCIALNETWORKS_'.strtoupper($key), 0, $object)) {
unset($mysoc->socialnetworks[$key]);
}
}
}
}
// Output vcard
if ($mode == 'vcard') {
@ -220,7 +252,7 @@ $arrayofjs = array();
$arrayofcss = array();
$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
llxHeader($head, $object->getFullName($langs).' - '.$langs->trans("PublicVirtualCard"), '', '', 0, 0, '', '', '', 'onlinepaymentbody'.(GETPOST('mode')=='preview' ? ' scalepreview cursorpointer virtualcardpreview' : ''), $replacemainarea, 1, 1);
llxHeader($head, $object->getFullName($langs).' - '.$langs->trans("PublicVirtualCard"), '', '', 0, 0, $arrayofjs, $arrayofcss, '', 'onlinepaymentbody'.(GETPOST('mode') == 'preview' ? ' scalepreview cursorpointer virtualcardpreview' : ''), $replacemainarea, 1, 1);
print '
<style>
@ -351,10 +383,10 @@ if (getDolUserInt('USER_PUBLIC_SHOW_ADDRESS', 0, $object) && $object->address) {
// Social networks
if (!empty($object->socialnetworks) && is_array($object->socialnetworks)) {
if (!getDolGlobalInt('USER_PUBLIC_HIDE_SOCIALNETWORKS')) {
if (!getDolUserString('USER_PUBLIC_HIDE_SOCIALNETWORKS', 0, $object)) {
$listOfSocialNetworks = $object->socialnetworks;
foreach ($listOfSocialNetworks as $key => $value) {
if (getDolGlobalString('USER_SOCIALNETWORK_'.strtoupper($key))) {
if (!getDolUserString('USER_HIDE_SOCIALNETWORK_'.strtoupper($key), 0, $object)) {
$usersection .= '<div class="flexitemsmall">'.dol_print_socialnetworks($key, 0, $object->id, strtolower($key), $socialnetworksdict).'</div>';
}
}
@ -424,9 +456,9 @@ if (!getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) {
// Social networks
if (!empty($mysoc->socialnetworks) && is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) {
if (!getDolGlobalInt('USER_PUBLIC_HIDE_SOCIALNETWORKS_BUSINESS', 0)) {
if (!getDolUserInt('USER_PUBLIC_HIDE_SOCIALNETWORKS_BUSINESS', 0, $object)) {
foreach ($mysoc->socialnetworks as $key => $value) {
if (getDolGlobalString('SOCIETE_PUBLIC_SOCIALNETWORKS_'.strtoupper($key))) {
if (!getDolUserInt('SOCIETE_PUBLIC_HIDE_SOCIALNETWORKS_'.strtoupper($key), 0, $object)) {
$companysection .= '<div class="flexitemsmall wordbreak">'.dol_print_socialnetworks($value, 0, $mysoc->id, $key, $socialnetworksdict).'</div>';
}
}

View file

@ -1528,7 +1528,7 @@ class Reception extends CommonObject
$this->fk_incoterms = 1;
$nbp = 5;
$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
$xnbp = 0;
while ($xnbp < $nbp) {
$line = new CommandeFournisseurDispatch($this->db);

View file

@ -608,9 +608,9 @@ $reception = new Reception($db);
$formcompany = new FormCompany($db);
$formfile = new FormFile($db);
$title = $langs->trans('Receptions');
$helpurl = 'EN:Module_Receptions|FR:Module_Receptions|ES:M&oacute;dulo_Receptiones';
llxHeader('', $langs->trans('ListOfReceptions'), $helpurl, '', 0, 0, '', '', '', 'bodyforlist mod-reception page-list');
llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'bodyforlist mod-reception page-list');
$sql = "SELECT e.rowid, e.ref, e.ref_supplier, e.date_reception as date_reception, e.date_delivery as delivery_date, l.date_delivery as date_reception2, e.fk_statut as status, e.billed,";
$sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,";
@ -906,13 +906,13 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
print_barre_liste($langs->trans('ListOfReceptions'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dollyrevert', 0, $newcardbutton, '', $limit, 0, 0, 1);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dollyrevert', 0, $newcardbutton, '', $limit, 0, 0, 1);
if ($massaction == 'createbills') {
//var_dump($_REQUEST);
print '<input type="hidden" name="massaction" value="confirm_createbills">';
print '<table class="noborder" width="100%" >';
print '<table class="noborder centpercent">';
print '<tr>';
print '<td class="titlefieldmiddle">';
print $langs->trans('DateInvoice');

View file

@ -18,21 +18,22 @@
*/
/**
* \file class/recruitmentcandidature.class.php
* \file recruitment/class/recruitmentcandidature.class.php
* \ingroup recruitment
* \brief This file is a CRUD class file for RecruitmentCandidature (Create/Read/Update/Delete)
*/
// Put here all includes required by your class file
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonpeople.class.php';
/**
* Class for RecruitmentCandidature
*/
class RecruitmentCandidature extends CommonObject
{
use CommonPeople;
/**
* @var string ID of module.
*/
@ -120,7 +121,7 @@ class RecruitmentCandidature extends CommonObject
'description' => array('type' => 'html', 'label' => 'Description', 'enabled' => 1, 'position' => 300, 'notnull' => 0, 'visible' => 3, 'cssview' => 'wordbreak'),
'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -4, 'csslist' => 'nowraponall'),
'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => -2, 'csslist' => 'nowraponall'),
'fk_user' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'LinkedToDolibarrUser', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => -1, 'csslist' => 'tdoverflowmax100'),
'fk_user' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Employee', 'picto' => 'user', 'help' => 'LinkToUserCreated', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => -1, 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist' => 'tdoverflowmax100'),
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,),
'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'position' => 1010, 'notnull' => -1, 'visible' => 0,),
'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'visible' => 2, 'index' => 1, 'default' => '0', 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Received', '3' => 'ContractProposed', '5' => 'ContractSigned', '8' => 'Refused', '9' => 'Canceled')),

View file

@ -117,7 +117,7 @@ if (empty($reshook)) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist;
} else {
$backtopage = dol_buildpath('/recruitment/recruitmentcandidature_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
$backtopage = DOL_URL_ROOT.'/recruitment/recruitmentcandidature_card.php?id='.($id > 0 ? $id : '__ID__');
}
}
}
@ -287,7 +287,7 @@ llxHeader('', $title, $help_url);
// Part to create
if ($action == 'create') {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("RecruitmentCandidature")), '', 'object_'.$object->picto);
print load_fiche_titre($title, '', 'object_'.$object->picto);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
@ -597,7 +597,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($user->hasRight('user', 'user', 'creer')) {
$useralreadyexists = $object->fk_user;
if (empty($useralreadyexists)) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create_user&token='.newToken().'">'.$langs->trans("CreateDolibarrLogin").'</a></div>';
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">'.$langs->trans("CreateDolibarrLogin").'</a></div>';
}

View file

@ -1410,6 +1410,7 @@ class Thirdparties extends DolibarrApi
$num = $this->db->num_rows($result);
while ($i < $num) {
$obj = $this->db->fetch_object($result);
$account = new CompanyBankAccount($this->db);
if ($account->fetch($obj->rowid)) {
$accounts[] = $account;

View file

@ -407,6 +407,8 @@ class CompanyPaymentMode extends CommonObject
$result = $this->fetchCommon($id, $ref, $morewhere);
$this->iban_prefix = dolDecrypt($this->iban_prefix);
// For backward compatibility
$this->iban = $this->iban_prefix;
$this->date_modification = $this->tms;

View file

@ -273,14 +273,14 @@ class Societe extends CommonObject
/**
* Thirdparty name
* @var string
* @var ?string
* @deprecated Use $name instead
* @see $name
*/
public $nom;
/**
* @var string Thirdparty name
* @var ?string Thirdparty name
*/
public $name;
@ -1038,7 +1038,7 @@ class Societe extends CommonObject
$result = $this->verify();
if ($result >= 0) {
$this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity);
$this->entity = setEntity($this);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (";
$sql .= "nom";
@ -1212,14 +1212,13 @@ class Societe extends CommonObject
$this->setUpperOrLowerCase();
$contact->phone_pro = $this->phone;
if (getDolGlobalString('CONTACTS_DEFAULT_ROLES')) {
$contact->roles = explode(',', getDolGlobalString('CONTACTS_DEFAULT_ROLES'));
$contact->roles = explode(',', getDolGlobalString('CONTACTS_DEFAULT_ROLES'));
}
$contactId = $contact->create($user, $notrigger);
if ($contactId < 0) {
$error++;
$this->error = $contact->error;
$this->errors = $contact->errors;
$this->setErrorsFromObject($contact);
dol_syslog(get_class($this)."::create_individual ERROR:".$this->error, LOG_ERR);
}
@ -1227,8 +1226,7 @@ class Societe extends CommonObject
$result = $contact->setCategories($tags);
if ($result < 0) {
$error++;
$this->error = $contact->error;
$this->errors = array_merge($this->errors, $contact->errors);
$this->setErrorsFromObject($contact);
dol_syslog(get_class($this)."::create_individual Affect Tag ERROR:".$this->error, LOG_ERR);
$contactId = $result;
}
@ -1237,8 +1235,7 @@ class Societe extends CommonObject
if (empty($error) && isModEnabled('mailing') && !empty($contact->email) && isset($no_email)) {
$result = $contact->setNoEmail($no_email);
if ($result < 0) {
$this->error = $contact->error;
$this->errors = array_merge($this->errors, $contact->errors);
$this->setErrorsFromObject($contact);
dol_syslog(get_class($this)."::create_individual set mailing status ERROR:".$this->error, LOG_ERR);
$contactId = $result;
}
@ -3178,7 +3175,7 @@ class Societe extends CommonObject
*/
public function getTypeUrl($withpicto = 0, $option = '', $notooltip = 0, $tag = 'a')
{
global $conf, $langs;
global $langs;
$s = '';
if (empty($option) || preg_match('/prospect/', $option)) {
@ -5297,7 +5294,7 @@ class Societe extends CommonObject
$dbs->query('DELETE FROM '.MAIN_DB_PREFIX.'societe_commerciaux WHERE rowid = '.((int) $obj->rowid));
}
// llx_societe_extrafields table must not be here because we don't care about the old thirdparty extrafields that are managed directly into mergeCompany.
// The table llx_societe_extrafields must NOT be in this list because we don't care about the old thirdparty extrafields that are managed directly into mergeCompany.
// Do not include llx_societe because it will be replaced later.
$tables = array(
'societe_account',
@ -5308,6 +5305,8 @@ class Societe extends CommonObject
'societe_rib'
);
// TODO When we merge societe_account, we may get 2 lines for the stripe account. Must fix this.
return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables);
}

View file

@ -359,7 +359,7 @@ class SocieteAccount extends CommonObject
$sql .= " AND sa.site = '".$this->db->escape($site)."' AND sa.status = ".((int) $status);
$sql .= " AND sa.key_account IS NOT NULL AND sa.key_account <> ''";
$sql .= " AND (sa.site_account = '' OR sa.site_account IS NULL OR sa.site_account = '".$this->db->escape($site_account)."')";
$sql .= " ORDER BY sa.site_account DESC"; // To get the entry with a site_account defined in priority
$sql .= " ORDER BY sa.site_account DESC, sa.rowid DESC"; // To get the entry with a site_account defined in priority
dol_syslog(get_class($this)."::getCustomerAccount Try to find the first system customer id for ".$site." of thirdparty id=".$id." (example: cus_.... for stripe)", LOG_DEBUG);
$result = $this->db->query($sql);
@ -396,6 +396,7 @@ class SocieteAccount extends CommonObject
$sql .= " AND sa.entity IN (".getEntity('societe').")";
$sql .= " AND sa.site = '".$this->db->escape($site)."' AND sa.status = ".((int) $status);
$sql .= " AND sa.fk_soc > 0";
$sql .= " ORDER BY sa.site_account DESC, sa.rowid DESC"; // To get the entry with a site_account defined in priority
dol_syslog(get_class($this)."::getCustomerAccount Try to find the first thirdparty id for ".$site." for external id=".$id, LOG_DEBUG);
$result = $this->db->query($sql);

View file

@ -666,16 +666,18 @@ if (empty($reshook)) {
$db->begin();
if (empty($newcu)) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '".$db->escape($tmpsite_account)."') AND fk_soc = ".$object->id." AND status = ".((int) $tmpservicestatus)." AND entity = ".$conf->entity;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account";
$sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '".$db->escape($tmpsite_account)."') AND fk_soc = ".((int) $object->id)." AND status = ".((int) $tmpservicestatus)." AND entity = ".$conf->entity;
} else {
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX."societe_account";
$sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '".$db->escape($tmpsite_account)."') AND fk_soc = ".((int) $object->id)." AND status = ".((int) $tmpservicestatus)." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified !
$sql .= " WHERE site = 'stripe' AND (site_account IS NULL or site_account = '' or site_account = '".$db->escape($tmpsite_account)."') AND fk_soc = ".((int) $object->id)." AND status = ".((int) $tmpservicestatus)." AND entity = ".$conf->entity; // Keep the = here for entity. Only 1 record must be modified !
}
$resql = $db->query($sql);
$num = $db->num_rows($resql); // Note: $num is always 0 on an update and delete, it is defined for select only.
if (!empty($newcu)) {
if (empty($num)) {
if (!empty($newcu)) { // If we did a select
if (empty($num)) { // and found nothing
$societeaccount = new SocieteAccount($db);
$societeaccount->fk_soc = $object->id;
$societeaccount->login = '';
@ -733,7 +735,7 @@ if (empty($reshook)) {
$db->begin();
if (empty($newsup)) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE fk_soc = ".$object->id." AND service = '".$db->escape($tmpservice)."' AND entity = ".$conf->entity;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE fk_soc = ".((int) $object->id)." AND service = '".$db->escape($tmpservice)."' AND entity = ".((int) $conf->entity);
// TODO Add site and site_account on oauth_token table
//$sql = "DELETE FROM ".MAIN_DB_PREFIX."oauth_token WHERE site = 'stripe' AND (site_account IS NULL or site_account = '".$db->escape($site_account)."') AND fk_soc = ".((int) $object->id)." AND service = '".$db->escape($service)."' AND entity = ".$conf->entity;
} else {

View file

@ -198,6 +198,7 @@ class Stripe extends CommonObject
$sql .= " AND sa.site = 'stripe' AND sa.status = ".((int) $status);
$sql .= " AND (sa.site_account IS NULL OR sa.site_account = '' OR sa.site_account = '".$this->db->escape($stripearrayofkeysbyenv[$status]['publishable_key'])."')";
$sql .= " AND sa.key_account IS NOT NULL AND sa.key_account <> ''";
$sql .= " ORDER BY sa.site_account DESC, sa.rowid DESC"; // To get the entry with a site_account defined in priority
dol_syslog(get_class($this)."::customerStripe search stripe customer id for thirdparty id=".$object->id, LOG_DEBUG);
$resql = $this->db->query($sql);
@ -1097,6 +1098,7 @@ class Stripe extends CommonObject
$sepa = $s->paymentMethods->create($dataforcard);
if (!$sepa) {
$this->error = 'Creation of payment method sepa_debit on Stripe has failed';
dol_syslog($this->error, LOG_ERR);
} else {
// link customer and src
//$cs = $this->getSetupIntent($description, $soc, $cu, '', $status);
@ -1109,6 +1111,7 @@ class Stripe extends CommonObject
if (!$cs) {
$this->error = 'Link SEPA <-> Customer failed';
dol_syslog($this->error, LOG_ERR);
} else {
dol_syslog("Update the payment mode of the customer");
@ -1188,6 +1191,7 @@ class Stripe extends CommonObject
$sql .= " WHERE sa.key_account = '".$this->db->escape($customer)."'";
//$sql.= " AND sa.entity IN (".getEntity('societe').")";
$sql .= " AND sa.site = 'stripe' AND sa.status = ".((int) $status);
$sql .= " ORDER BY sa.site_account DESC, sa.rowid DESC"; // To get the entry with a site_account defined in priority
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql);

Some files were not shown because too many files have changed in this diff Show more