Compare commits

...

524 Commits

Author SHA1 Message Date
ldestailleur
c0db33caf2 Having LTS in v18 and not in v19, v20... lets think that only v18 is LTS
and LTS is propagated during merge. Better to keep the mention into
Changelog only or into doc.
2025-06-24 14:04:21 +02:00
ldestailleur
8159249209 Fix changelog 2025-06-22 17:26:59 +02:00
Pichi1966
9f76298e58 FIX BankTransfer information in line.php (#34425)
* Prepare 18.0.7

* FIX BankTransfer information in line.php

FIX BankTransfer information in line.php

This is too fix a wrong information in line.php.
The mention of WithDrawalsReceipts instead of BankTransfers is wrong information

* Suppress Tab in line.php

---------

Co-authored-by: VESSILLER <lvessiller@open-dsi.fr>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-06-22 12:57:33 +02:00
Pichi1966
f1ecb023ff FIX BankTransfer link in rejets.php (#34424)
* Prepare 18.0.7

* FIX BankTransfer link in rejets.php

FIX BankTransfer link in rejets.php
This is to fix a wrong action link in rejets.php.
The link was sending to a WithDrawals screen creating confusion.

---------

Co-authored-by: VESSILLER <lvessiller@open-dsi.fr>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-06-22 12:57:09 +02:00
lvessiller-opendsi
ce1243140f FIX js warning (Backport commit 84d982c) (#34555)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-06-22 12:49:52 +02:00
Marc
52c827c2bb FIX #34541 (#34597) 2025-06-21 14:35:20 +02:00
lvessiller-opendsi
c263fccb5f Prepare 18.0.7 (#34575)
* Prepare 18.0.7

* Changelog for 18.0.7 LTS
2025-06-19 14:58:38 +02:00
ldestailleur
719de0aef3 Disable not working github actions 2025-06-19 10:51:51 +02:00
ldestailleur
4cc3be24d3 Doc 2025-06-19 10:46:15 +02:00
Eric - CAP-REL
b1109f6803 add env var for non-origin repository (#34577) 2025-06-19 10:44:18 +02:00
ldestailleur
fda1499eee Fix CI 2025-06-18 14:28:36 +02:00
Pichi1966
4bb42de5d6 FIX BankTransfer link in list.php (#34513)
FIX BankTransfer link in list.php

This is to fix a wrong action link in list.php.
The link was sending to a WithDraw screen creating confusion.
2025-06-15 03:03:42 +02:00
Laurent Destailleur
f31270df2a Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-06-15 00:50:35 +02:00
Laurent Destailleur
d50a938d12 Doc 2025-06-15 00:50:25 +02:00
Marc de Lima Lucio
478a8a4d52 FIX: try to fix v18 github action workflow (#34439)
* FIX: try to fix v18 github action workflow

* FIX: try to fix v18 github action workflow, part 2

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-06-15 00:30:44 +02:00
Laurent Destailleur
fa135a216b Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-06-15 00:23:45 +02:00
Laurent Destailleur
79779b1d2f Doc 2025-06-15 00:23:13 +02:00
Marc de Lima Lucio
456adc1e95 FIX: receptions: crash from api because of classes not found (#34523) 2025-06-14 23:59:21 +02:00
Marc de Lima Lucio
06dc4f5426 FIX: event info tab: php 8.1 warning (#34458)
* FIX: event info tab: php 8.1 warning

* Update info.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-06-14 11:59:03 +02:00
Marc de Lima Lucio
467c772504 FIX: common fields: php warning with select input field (#34495) 2025-06-14 11:58:25 +02:00
Laurent Destailleur
1bd6757e62 Fix CI 2025-06-14 02:15:10 +02:00
Marc de Lima Lucio
1c52426b90 FIX: expensereport: php warning when generating pdf with multilangs (#34492) 2025-06-14 02:09:01 +02:00
Marc de Lima Lucio
bc18656fd5 FIX: files lib: multiple php 8.1 warnings (#34462) 2025-06-14 00:27:36 +02:00
Marc de Lima Lucio
c77c4efcb8 FIX: accountancy lettering: php8.1 warning (#34469) 2025-06-13 23:57:37 +02:00
Marc de Lima Lucio
cada04442b FIX: manufacturing orders: php 8.1 warnings on agenda tab (#34475) 2025-06-13 23:49:11 +02:00
Benjamin Falière
4bd11f64d7 FIX (#34448)
Co-authored-by: Benjamin Falière <benjamin.faliere@altairis.fr>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-06-13 23:45:18 +02:00
Marc de Lima Lucio
9c45f42e4f FIX: product translation: redirect after successful action (#34403)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-06-13 17:25:33 +02:00
Marc de Lima Lucio
c9f743983a FIX: accountancy expensereport journal: php 8.1 warning (#34457) 2025-06-13 17:11:40 +02:00
Laurent Destailleur
1497541129 Fix travis 2025-06-13 15:30:30 +02:00
lvessiller-opendsi
878474f1d1 FIX element must be visible to set focus on select input when using default values (#34406) 2025-06-12 12:23:55 +02:00
Marc de Lima Lucio
0afd5cc7e3 FIX: social contribution payment: correct error reporting (#34002)
* FIX: social contribution payment: correct error reporting

* FIX: social contribution payment: correclty handle return of adding payment to bank
2025-06-11 21:22:37 +02:00
William Mead
1aaa29ad9e Fixed expense report permission. Added contributor details. (#34368) 2025-06-08 14:37:23 +02:00
noec764
4096b00bd5 FIX: Too heavy sql query (#34371)
Co-authored-by: Noé <noe@scopen.fr>
2025-06-08 14:26:44 +02:00
Marc de Lima Lucio
dcc4334768 FIX: warnings when printing start/end date on line tpl (#34359) 2025-06-05 18:34:56 +02:00
Marc de Lima Lucio
f137074a98 FIX: cash control report: php warning (#34358) 2025-06-05 18:30:06 +02:00
Marc de Lima Lucio
f8f31daa16 FIX: accountancy fec export: remove dol_print_date warning (#34363) 2025-06-05 18:29:33 +02:00
Marc de Lima Lucio
35528a5885 FIX: prevent log warning with online signature url (#34361) 2025-06-05 18:29:12 +02:00
HENRY Florian
8853bfd51a fix: ref_client GETPOST facture/card.php should be alpha (#34311)
* fix: ref_client GETPOST facture/card.php should be alpha

* Update card.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-06-04 14:09:03 +02:00
lvessiller-opendsi
ce0f46a483 FIX local taxes text in PDF (#34343) 2025-06-03 17:03:15 +02:00
ldestailleur
9a8a07e85a Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-06-02 14:27:14 +02:00
Marc de Lima Lucio
26bcc944cf FIX: projects: go back to edit view after cloning (#34221)
* FIX: projects: go back to edit view after cloning

* FIX: projects: go back to edit view after cloning
2025-05-27 21:23:16 +02:00
Eric - CAP-REL
d2d9590019 Fix to make protection ok when no stock and (#34207)
STOCK_ALLOW_NEGATIVE_TRANSFER on

Co-authored-by: Laurent Destailleur <eldy@users.sourceforge.net>
2025-05-27 21:16:38 +02:00
ThomasNgr-OpenDSI
fe4b1ff34d FIX modification de dates de pièces comptables sur plusieurs entités différentes (#34226) 2025-05-27 20:16:41 +02:00
HENRY Florian
4e95aab6b5 fix: On Clone Invoice, ref_customer is not clean (#34296) 2025-05-27 15:58:28 +02:00
William Mead
4fb79ba8a1 FIX API expense report line comments (v18+) (#34297)
* Fixed API expense report line comments

* Added contributor details
2025-05-27 15:57:48 +02:00
Marc de Lima Lucio
a42593db0d FIX: asset depreciation: php warnings (#34219) 2025-05-22 21:17:58 +02:00
Marc de Lima Lucio
cfc766ebbe FIX: accountancy general ledger: last total not shown if last account group shown has only one entry (#34251) 2025-05-22 19:29:49 +02:00
HENRY Florian
51e4ce05c9 FIX: mandatory extrafelds on lines are not checked (#34228)
* FIX: mandatory extrafelds on lines are not checked

* FIX: mandatory extrafelds on lines are not checked
2025-05-22 17:40:41 +02:00
Marc de Lima Lucio
819c3fd08a FIX: accountancy: bad filter on custom account groups (#34205) 2025-05-20 22:42:34 +02:00
atm-lucas
4c6955017f Adding mapping to module rights (#34212) 2025-05-20 21:47:08 +02:00
HENRY Florian
de40214a09 fix: multi filter journal in accountancy/bookkeeping/list.php and in export (#34217)
* fix: filter journal IN

* fix: filter journal IN
2025-05-20 20:33:31 +02:00
Marc de Lima Lucio
491ecaccfe FIX: asset depreciation: division by zero (#34218) 2025-05-20 20:32:08 +02:00
Marc de Lima Lucio
3b3f3fa29b FIX: product suplier tab: last modif date column was wrongly dependant of module barcode (#34170)
* FIX: product suplier tab: last modif date column was wrongly dependant of module barcode

* FIX: product suplier tab: last modif date column was wrongly dependant of module barcode, part 2
2025-05-17 14:05:42 +02:00
lvessiller-opendsi
efb9327896 FIX local taxes text in object line view mode (#34103) 2025-05-12 20:09:16 +02:00
Frédéric FRANCE
223f0c2763 fix translation (#34086) 2025-05-09 23:46:07 +02:00
Laurent Destailleur (aka Eldy)
b85bfc40f4 Fix phpunit 2025-05-06 11:59:08 +02:00
lvessiller-opendsi
cc78023a44 FIX allow double colon and string obfuscation in dol eval for computed extra fields (#34015)
* FIX allow double colon and string obfuscation in dol eval for computed extra fields

* Update functions.lib.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-05-06 11:50:28 +02:00
Marc de Lima Lucio
9b74628e29 FIX: accountancy balance: keep subtotals when sorting (#34001) 2025-05-04 11:27:19 +02:00
Marc de Lima Lucio
0ef0d339b5 FIX: pgsql: error when creating sequences in migration scripts (#34021)
* FIX: pgsql: error in migration from 15 to 16

* FIX: pgsql: error in migration from 7 to 8
2025-05-04 11:26:34 +02:00
Laurent Destailleur
5bf5d23495 Update AbstractClient.php 2025-05-04 11:22:54 +02:00
Marc de Lima Lucio
02588036c2 FIX: oauth: php 8 warnings (#34027)
* FIX: oauth: fix php 8 warnings (backport of 9edfb1d113)

* FIX: oauth: fix php 8 warnings (backport of 9edfb1d113), part 2
2025-05-04 11:20:26 +02:00
Marc de Lima Lucio
8e0d3911e6 FIX: pgsql: case sensitivity in select queries (#34028) 2025-05-04 11:19:59 +02:00
Marc de Lima Lucio
3929ef0bfa FIX: accountancy: warning when account not found in plan (#34030) 2025-05-04 10:50:33 +02:00
William Mead
c3b35d4da5 Fixed PHPDoc. Added contributor details. (#33988) 2025-04-29 06:40:04 +02:00
ThomasNgr-OpenDSI
5e887e8850 Fix : on update of an order line, the TTC price would be used as HT price (#33940)
* Fix : on update of an order line, the TTC price would be used as HT price

* Update commande.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-04-22 11:48:22 +02:00
William Mead
61df34acd6 Fixed public ticket layout for Safari (#33933) 2025-04-21 10:42:51 +02:00
Frédéric FRANCE
f5b11b78da fix typo (#33920) 2025-04-19 11:46:22 +02:00
lvessiller-opendsi
d7758f9ae6 FIX bank payment rejection on SEPA (backport commit 100a657) (#33838) 2025-04-14 19:25:41 +02:00
ldestailleur
8434e6567f Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-04-10 14:17:05 +02:00
ldestailleur
2c38bea2b0 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-04-10 14:16:58 +02:00
ldestailleur
096b59913d Merge branch '16.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2025-04-10 14:16:34 +02:00
ldestailleur
d38b9e6248 Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2025-04-10 14:16:11 +02:00
ldestailleur
f256deb54b Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2025-04-10 14:15:48 +02:00
ThomasNgr-OpenDSI
7fa3474ecd FIX : constant PAYMENTBYBANKTRANSFER_ADDDAYS was never saved (#33799) 2025-04-09 15:44:51 +02:00
Marc de Lima Lucio
363b05d314 FIX: warehouse list: broken status filter (#33667) 2025-04-02 12:30:53 +02:00
ldestailleur
3fe6132c94 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-03-31 11:52:55 +02:00
ldestailleur
238f684576 Fix extension of debian.tar file 2025-03-31 11:52:47 +02:00
Eric - CAP-REL
e6ebf315ed package: make dir if needed (#33644) 2025-03-28 23:09:50 +01:00
Eric - CAP-REL
70e4d1ccd0 build zip & tar package : add more files on exclude list (#33634) 2025-03-28 15:00:37 +01:00
Eric - CAP-REL
a8a95cba75 debian build package on bookworm (#33635) 2025-03-28 10:19:08 +01:00
Laurent Destailleur (aka Eldy)
1a015cd91e Exclude more files 2025-03-27 15:01:50 +01:00
ldestailleur
9b36b6e965 Fix typo 2025-03-24 14:43:40 +01:00
ldestailleur
cbb9f5aa0c Replace hard coded value with var 2025-03-24 14:41:02 +01:00
ldestailleur
ef159f919e Backport fix in v20 #33536 2025-03-19 16:10:25 +01:00
ldestailleur
3e8c5651cd Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-03-19 14:09:48 +01:00
ldestailleur
0a4f1ffc06 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-03-19 14:09:41 +01:00
atm-lucas
42a1cde41a useless product fetch on invoice create (#33505) 2025-03-19 14:00:03 +01:00
MDW
324f9631d7 FIX: Replace compromised tj-actions/changed-files (#33481)
# FIX: Replace compromised tj-actions/changed-files

See https://www.stepsecurity.io/blog/harden-runner-detection-tj-actions-changed-files-action-is-compromised .

(Backport from develop)
2025-03-15 16:38:56 +01:00
Eric - CAP-REL
8073c0e1be FIX : close all services on contract will close all lines (#33466)
* close line : line could be inactive or open

* Update contrat.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-03-15 12:03:37 +01:00
Eric - CAP-REL
b256c9aaba fix missing alter table for tms auto update timestamp (#33451)
* fix missing alter table for tms auto update timestamp

* two tables was renamed 13.0 -> 16.0
2025-03-15 10:55:17 +01:00
ldestailleur
4897c9de7f Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-03-14 12:20:56 +01:00
ldestailleur
2058d572d9 Merge branch '16.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2025-03-14 12:17:06 +01:00
ldestailleur
089fab828b Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2025-03-14 12:14:10 +01:00
ldestailleur
fa05dc44ce Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2025-03-14 11:29:14 +01:00
ldestailleur
5b9453e302 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2025-03-14 11:28:33 +01:00
ldestailleur
d81a2d060e Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2025-03-14 11:27:49 +01:00
Eric - CAP-REL
8d9dc8c87d translation "by amoun" link (#33440) 2025-03-13 23:04:41 +01:00
Eric - CAP-REL
97aaff7395 13.0 fix migration missing tms auto update (#33443)
* tms field in llx_product is not updated to default timestamp

* but that's not the only one ...
2025-03-13 23:01:52 +01:00
HENRY Florian
7a1fa20959 fix: allow positive line in creditnote invoice if FACTURE_ENABLE_NEGATIVE_LINES and INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN (#33434)
* fix: allow positive line in creditnote invoice if FACTURE_ENABLE_NEGATIVE_LINES and INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN

* fix: allow positive line in creditnote invoice if FACTURE_ENABLE_NEGATIVE_LINES and INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN
2025-03-13 11:18:17 +01:00
warnerbryce
2f36edef3b FIX : PAIEMENT Wrong field displayed for DateChequeReceived (#33390) 2025-03-12 19:29:04 +01:00
Florian Mortgat
f7fe6c4f1a FIX warnings (#33423)
* FIX warnings

* fix: empty({function call})
2025-03-12 19:15:24 +01:00
atm-adrien
b9f4ddb021 FIX : Count on supplier invoice list does not match count in DB (#33351) 2025-03-11 03:00:46 +01:00
Eric - CAP-REL
6f4b2a8905 allow spaces on natural search (#33324)
* allow spaces on natural search like documentation says

* clear comment

* sanitize backport from 19.0

* update sanitize call to be compatible with dolibarr 19.0 backported function
2025-03-11 02:13:06 +01:00
Laurent Destailleur
0e95f70b8d Merge pull request #33329 from am97/fix/18.0/accountancy_code_sort
Fix: sort $aux_account after adding all items
2025-03-05 14:23:46 +01:00
Andrés Maldonado
dd7189b1d0 Fix: sort $aux_account after adding all items
Currently, some items are added to $aux_account, then the array is
sorted, then more items are added. In the end, the list visible in the
UI is not sorted.
2025-03-04 17:28:27 +01:00
Laurent Destailleur
cd21d385d6 Merge pull request #33229 from BenjaminFlr/fixTicketNotifMail
FIX(ticket): Notification email without public interface
2025-03-01 10:39:24 +01:00
Laurent Destailleur
86442aa7f0 Merge pull request #33264 from OPEN-DSI/18.0_fix_show_mail_error_validate_expense_report
FIX : Show true error when send notify email at validate expense report
2025-03-01 00:24:04 +01:00
Kamel Khelifa
39cd4fcb9e FIX : Show true error when send notify email at validate expense report 2025-02-27 16:43:42 +01:00
Benjamin Falière
4272cfa7e4 Restore url public ticket 2025-02-26 10:06:43 +01:00
Benjamin Falière
db56e5c8ea Replace getDolGlobalString by getDolGlobalInt 2025-02-25 21:09:59 +01:00
Benjamin Falière
0c573812e9 Remove empty on getDolGlobalString() 2025-02-25 16:03:07 +01:00
Benjamin Falière
4cf6394f01 FIX(ticket): Notification email without public interface
Remove link to public interface from automatic notification email if not enabled.
2025-02-25 15:43:21 +01:00
Laurent Destailleur
00ccb45bc4 Merge pull request #33131 from Easya-Solutions/18_fix_invoice_create
FIX invoice creation : use dol_include_once instead of require_once to allow external modules.
2025-02-21 18:05:24 +01:00
Laurent Destailleur
8aa1d1165f Merge pull request #33146 from Easya-Solutions/18.0_fix-wrong-label-status-product-tooltip
FIX #33145 wrong label status buy on product tooltip
2025-02-21 11:38:28 +01:00
VESSILLER
5911d7d0c0 Protect product object for line label 2025-02-20 08:21:50 +01:00
VESSILLER
41e54529b0 FIX #33145 wrong label status buy on prodcut tooltip 2025-02-19 17:26:54 +01:00
tnegre
f89aff96f7 FIX invoice creation : use dol_include_once instead of require_once to allow external modules 2025-02-19 11:45:07 +01:00
Laurent Destailleur
54df3c2991 Merge pull request #33084 from rycks/18.0_fix_change_deposit_conditions_value
set deposit percent to zero on change
2025-02-19 11:41:28 +01:00
Laurent Destailleur
85bce8b71f Merge pull request #33118 from Easya-Solutions/18.0_fix-accountancy-export-quadratus
FIX #33117 accountancy export Quadratus when doc ref is less than 10 char
2025-02-18 20:49:31 +01:00
VESSILLER
9d9d890c97 FIX accountancy export Quadratus when doc ref is less than 10 char 2025-02-18 12:07:19 +01:00
Laurent Destailleur
f511e2e523 Merge pull request #33099 from Easya-Solutions/18_fix_cve_2024-34051
FIX #CVE-2024-34051
2025-02-17 19:45:24 +01:00
Laurent Destailleur (aka Eldy)
bd9bf8b5a8 FIX #CVE-2024-34051 2025-02-17 12:24:03 +01:00
Eric Seigne
5fd5eae3b1 set deposit percent to zero on change 2025-02-14 09:35:57 +01:00
Laurent Destailleur
6aa4d6a940 Merge pull request #33072 from FHenry/18_fix_supplierorder_catcherroroncreate
fix: On Supplier Order create, if insertExtrafield failed, Dolibarr do not return error and continue
2025-02-13 17:29:22 +01:00
Florian HENRY
7997e927a0 fix: On Supplier Order create, if insertExtrafield failed, Dolibarr do not return error and continue 2025-02-13 14:59:15 +01:00
Laurent Destailleur
9516f9bbd2 Merge pull request #33039 from Easya-Solutions/18.0_fix-fileupload-with-ref-as-prefix
FIX #33038 drag and drop files are not prefixed with object reference
2025-02-12 22:48:43 +01:00
VESSILLER
f7bd03fb75 FIX #33038 drag and drop files are not prefixed with object reference 2025-02-12 16:02:00 +01:00
Laurent Destailleur
ea60024712 Merge pull request #33024 from Easya-Solutions/18.0_fix-shipment-with-same-product-in-other-subkit
FIX display full tree on shipment card when a kit contains a same component in other sub-kit
2025-02-12 04:02:13 +01:00
VESSILLER
edea44bccb FIX display full tree on shipment card when a kit contains a same component in other sub-kit 2025-02-11 17:12:15 +01:00
Laurent Destailleur
09df62600e Merge pull request #32616 from rycks/18.0_fix_zero_is_a_value_into_dictionnary
zero could be a value
2025-02-11 09:07:29 +01:00
Eric Seigne
94eaf5d089 cancel first idea 2025-02-11 00:32:57 +01:00
Eric Seigne
d04ac67ecd backport 20.0 solution 2025-02-11 00:31:59 +01:00
Laurent Destailleur
81b9286ea4 Merge pull request #32999 from Easya-Solutions/18_FIX_missing_unset_post
Fix missing unset post fourn_ref
2025-02-10 13:21:34 +01:00
Laurent Destailleur
c648bd8c90 Merge pull request #32982 from Easya-Solutions/18.0_fix-shipment-dispatch-serial-warehouses
FIX bad dispatched quantities for batches on shipment card
2025-02-10 12:52:42 +01:00
Laurent Destailleur
99a291f878 Merge pull request #32979 from rycks/18.0_user_author_deprecated
fk_user_author instead of user_author into update
2025-02-10 11:57:25 +01:00
ulysse-vldn
47f10cdc29 Fix missing unset post fourn_ref 2025-02-10 09:55:47 +01:00
VESSILLER
7eba8832e6 FIX bad dispatched quantities for batches on shipment card 2025-02-07 15:47:36 +01:00
Eric Seigne
03340d6016 in case of old code in other part makes a direct assignation 2025-02-07 15:13:20 +01:00
Eric Seigne
d288fe74a2 fk_user_author instead of user_author into update 2025-02-07 15:05:49 +01:00
Laurent Destailleur
28d588fd40 Merge pull request #32832 from Easya-Solutions/18.0_add_missing_hook_action_list
Missing hook PrintFieldListFrom on actions list
2025-02-06 18:23:15 +01:00
Laurent Destailleur (aka Eldy)
9fc78cd1b6 Fix regression 2025-02-05 18:16:09 +01:00
Laurent Destailleur
34298f6c8c Merge pull request #32947 from Easya-Solutions/18.0_fix-shipment-updated-message
FIX wrong message on update shipment
2025-02-05 16:39:11 +01:00
VESSILLER
bbbba45fc1 FIX wrong message on update shipment 2025-02-05 11:19:36 +01:00
Laurent Destailleur (aka Eldy)
bfb97edccf Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-02-05 10:59:49 +01:00
Laurent Destailleur (aka Eldy)
989c9b9548 Debug v22 2025-02-05 10:59:25 +01:00
Laurent Destailleur (aka Eldy)
82b7326c99 Merge branch '17.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2025-02-05 10:49:20 +01:00
Laurent Destailleur (aka Eldy)
d2e6335e95 Merge branch '16.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2025-02-05 10:49:14 +01:00
Laurent Destailleur (aka Eldy)
711f21e8a0 Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2025-02-05 10:48:43 +01:00
Laurent Destailleur (aka Eldy)
e1c343cedd Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2025-02-05 10:48:16 +01:00
Laurent Destailleur
51def8d31d Merge pull request #32411 from Easya-Solutions/18_fix_search_ticket_list
FIX select group and severity search fields on ticket list
2025-02-03 15:53:24 +01:00
Laurent Destailleur
bbb8b0f01f Merge pull request #32830 from hregis/17.0
FIX compatibility with multicompany
2025-01-30 13:25:07 +01:00
Laurent Destailleur (aka Eldy)
c115a76d4e Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-01-30 12:41:34 +01:00
Laurent Destailleur
63ab8d9f75 Merge pull request #32871 from atm-irvine/fix_undefined_properties
fix(contrat,facture-rec): undefined properties
2025-01-30 12:40:08 +01:00
Irvine Fleith
7848d77830 fix(contrat,facture-rec): undefined properties 2025-01-30 09:58:29 +01:00
ThomasNgr-OpenDSI
737a807456 Merge branch '18.0' into 18.0_add_missing_hook_action_list 2025-01-30 09:19:21 +01:00
Laurent Destailleur
e6a6426b5b Merge pull request #32850 from atm-irvine/fix_missing_hook_printFieldListSearchParam
fix(services-list): added missing hook printFieldListSearchParam in services list
2025-01-29 16:49:48 +01:00
Irvine Fleith
f3dc94d334 fix(services-list): added missing hook printFieldListSearchParam 2025-01-29 10:14:46 +01:00
Laurent Destailleur
e4f0c1a42b Merge pull request #32829 from Easya-Solutions/18.0_fix-hook-product-list-missing
Backport from v20 missing executeHooks printFieldListFrom in product list page
2025-01-28 23:47:20 +01:00
Laurent Destailleur
44d6803d12 Merge pull request #32834 from atm-irvine/fix_missing_hook_printFieldListWhere
fix(services-list): added missing hook printFieldListWhere
2025-01-28 23:46:14 +01:00
Laurent Destailleur
f80e83b846 Merge pull request #32833 from Easya-Solutions/18_fix_inner_join_action_list
action/list.php : replace comma-joins by INNER JOIN
2025-01-28 23:45:41 +01:00
Irvine Fleith
bdcd7b5ef3 fix(services-list): added missing hook printFieldListWhere 2025-01-28 14:47:10 +01:00
tnegre
17d1c279ab action/list.php : replace comma-joins by INNER JOIN 2025-01-28 14:44:10 +01:00
tnegre
dd40aea380 Add hook PrintFieldListFrom on actions list 2025-01-28 14:18:26 +01:00
Regis Houssin
f9ec70f1db FIX compatibility with multicompany 2025-01-28 14:05:59 +01:00
VESSILLER
83bc7b70a0 Backport from v20 missing executeHooks printFieldListFrom in product list page 2025-01-28 13:34:49 +01:00
tnegre
2cbede2ef8 Merge branch '18.0' into 18_fix_search_ticket_list 2025-01-27 15:20:18 +01:00
tnegre
729e6c4aba Revert "set empty value for choice"
This reverts commit e8aaa51edc.
2025-01-27 15:12:24 +01:00
Laurent Destailleur
a2e865587f Merge pull request #32812 from hregis/fix_18_wrong_margin
FIX wrong left margin (v18 to develop ?)
2025-01-27 14:29:19 +01:00
Laurent Destailleur
c6ab6cd57e Merge pull request #32811 from hregis/fix_18_cannot_delete_file_task
FIX can not delete files in task card
2025-01-27 14:25:18 +01:00
Regis Houssin
837b2ff060 FIX wrong left margin (v18 to develop ?) 2025-01-27 13:59:12 +01:00
Laurent Destailleur
c7ee83b3b9 FIX can not delete files in task card 2025-01-27 12:39:24 +01:00
Laurent Destailleur
a404b80988 Merge pull request #32757 from rycks/18.0_missing_hookmanager_on_some_odt_modules
missing hookmanager like others doc_generic*odt modules
2025-01-23 00:42:46 +01:00
Eric Seigne
cbe15c7c71 missing hookmanager like others doc_generic*odt modules 2025-01-22 23:53:16 +01:00
Laurent Destailleur
278b07099c Merge pull request #32729 from hregis/fix_18_wrong_update_param
FIX wrong update function parameter
2025-01-21 08:26:40 +01:00
Regis Houssin
576e70c3ce FIX wrong update function parameter 2025-01-20 22:32:30 +01:00
Laurent Destailleur
5433aa8d2e Merge pull request #32720 from Easya-Solutions/18.0_fix-supplier-order-linked-line-delete
FIX delete supplier order when at least one line linked to customer order line
2025-01-20 15:14:05 +01:00
Laurent Destailleur
b67fdb3e51 Merge pull request #32719 from Easya-Solutions/14.0_fix-supplier-order-linked-line-delete
FIX delete supplier order line when linked to customer order line
2025-01-20 15:13:22 +01:00
VESSILLER
7f2a253625 Uniformize SQL concat char 2025-01-20 12:17:12 +01:00
VESSILLER
ad60a50d4d Uniformize SQL concat char 2025-01-20 11:58:58 +01:00
VESSILLER
08a976fd85 FIX delete supplier order when at least one line linked to customer order line 2025-01-20 11:56:54 +01:00
VESSILLER
426f4305b0 FIX delete supplier order when at least one line linked to customer order line 2025-01-20 11:48:37 +01:00
VESSILLER
db47ce3bb1 FIX delete supplier order line when linked to customer order line 2025-01-20 11:33:24 +01:00
Laurent Destailleur (aka Eldy)
1b42078d1e Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-01-20 10:24:30 +01:00
Laurent Destailleur (aka Eldy)
736890b244 Merge 2025-01-20 10:15:31 +01:00
Laurent Destailleur (aka Eldy)
2664518bd3 Merge branch '17.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2025-01-20 10:14:52 +01:00
Laurent Destailleur (aka Eldy)
c6f90d8361 Merge branch '16.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2025-01-20 10:14:44 +01:00
Laurent Destailleur (aka Eldy)
cc732621ab Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2025-01-20 10:14:25 +01:00
Laurent Destailleur (aka Eldy)
04fed9526a Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2025-01-20 10:13:04 +01:00
Laurent Destailleur
9f4692e1c9 Merge pull request #31460 from OPEN-DSI/18.0_fix_return_hook_sendmail
FIX: Fix return value of hook sendMail when hook return -1 who must be return false in sendfile() function
2025-01-20 09:23:44 +01:00
Laurent Destailleur
1fa3b63fdc Merge pull request #32346 from aspangaro/18_fixloanpayment
FIX #32339 Delete a loan settlement is partial
2025-01-20 04:13:26 +01:00
Laurent Destailleur
af2889e982 Merge pull request #32505 from IC-William/fix-email-notification-ticket-assignee-18
FIX send email to assigned user on ticket create
2025-01-20 04:08:23 +01:00
Laurent Destailleur
4d925db3cd Merge pull request #32515 from Easya-Solutions/18_fix_many_tags_in_string
FIX ODT substitution when many HTML tags in string
2025-01-20 04:06:50 +01:00
Laurent Destailleur
36d91f1c07 Merge pull request #32563 from marc-dll/18.0_FIX_variants_copy_multiprices
FIX: product variants copy: also copy multiprice variations
2025-01-20 04:03:44 +01:00
Laurent Destailleur
bcc260dc08 Merge pull request #32650 from ATM-Consulting/FIX_towStatusOnInvoiceLinkedObjectBlock
FIX : Many status on invoice linked object block
2025-01-20 02:53:18 +01:00
Laurent Destailleur
9507b89fec Merge pull request #32674 from fappels/18_fix_fatal_error_on_kit
FIX: #26250 fatal error on kit
2025-01-20 00:12:10 +01:00
Francis Appels
a52a218ae4 Use same patch like in #26454 2025-01-16 19:17:47 +01:00
Laurent Destailleur
0409b8b9c5 Merge pull request #32652 from FHenry/18_fix_fetch_expensereport_wihtout_entity_check_by_ref
fix: add entity in where for fetch when fetch by ref
2025-01-16 15:41:45 +01:00
Laurent Destailleur
f68cf0034a Merge pull request #32683 from ATM-Consulting/FIX/133/TK2501-3514/api-put
FIX 17.0 API endpoints "PUT": prevent overwriting all extrafields if only some are supplied in the request
2025-01-16 11:41:26 +01:00
atm-florian
ba4e97f07b FIX 17.0 API endpoints "PUT": prevent overwriting all extrafields if only some are supplied in the request cf. PR #29237
+ security for Tickets API: disable updating rowid
2025-01-16 10:37:29 +01:00
Laurent Destailleur (aka Eldy)
c2c3879032 Clean php file 2025-01-16 00:36:56 +01:00
Laurent Destailleur (aka Eldy)
c4529ed986 Clean file 2025-01-16 00:35:38 +01:00
Laurent Destailleur (aka Eldy)
8b7eaf360e Fix phpunit 2025-01-15 20:08:13 +01:00
Laurent Destailleur (aka Eldy)
2f317f0f52 Merge branch '17.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2025-01-15 20:07:40 +01:00
Laurent Destailleur (aka Eldy)
bd35af1360 Fix phpunit 2025-01-15 20:07:31 +01:00
Francis Appels
351a7bd6bb FIX: #26250 fatal error on kit 2025-01-15 19:01:18 +01:00
Laurent Destailleur
fe6d59c090 Merge pull request #32651 from ATM-Consulting/FIX/133/bug/pre-commit-debug-bar-fails
Apply suggestion by @mdeweerd to ensure pre-commit will pass.
2025-01-15 15:53:48 +01:00
Laurent Destailleur
d4e66426e7 Merge pull request #32621 from ATM-Consulting/FIX/132/bug/cache-collisions-dol-getIdFromCode
FIX 17.0 - collisions in cache for dol_getIdFromCode
2025-01-15 15:51:23 +01:00
Laurent Destailleur
88d81aa943 Merge pull request #27159 from atm-lena/17.0_FIX_MultilangsTranslationPDFLinesDescription
FIX Multilangs : PDF lines description
2025-01-15 15:38:48 +01:00
Laurent Destailleur
f24f4e012d Merge pull request #32557 from Easya-Solutions/18_fix_join_soc_commerciaux
fix join societe_commerciaux in societe list
2025-01-15 15:12:42 +01:00
Laurent Destailleur
60ea952b78 Merge pull request #32338 from Easya-Solutions/18.0_fix_error_delete_loan
FIX : display error when loan can't be deleted
2025-01-15 15:08:22 +01:00
Laurent Destailleur
5354b54ec0 Merge pull request #32663 from Easya-Solutions/14_FIX_socpeopleassigned_update_event
Backport Fix bad management when inserting contacts of actioncomm
2025-01-15 14:40:07 +01:00
Laurent Destailleur
49feeee85e Merge pull request #32654 from atm-irvine/fix_search_thirdparty_by_name
fix(services-list): search thirdparty by name
2025-01-15 14:37:32 +01:00
Laurent Destailleur
42d8591758 Merge pull request #32660 from Easya-Solutions/14_FIX_selectcontacts_param_update_event
FIX selectcontact is loading all contacts when update event
2025-01-15 14:35:32 +01:00
Laurent Destailleur (aka Eldy)
cf156e024d Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-01-15 12:16:03 +01:00
Laurent Destailleur (aka Eldy)
6b0c8f39d5 Merge branch '16.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2025-01-15 12:15:28 +01:00
Laurent Destailleur (aka Eldy)
2c2e01d14c Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2025-01-15 12:14:06 +01:00
Laurent Destailleur (aka Eldy)
abc1d1dcb3 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2025-01-15 12:13:44 +01:00
Laurent Destailleur
628189f57f Backport of #00e65eb
Fix bad management when inserting contacts of actioncomm
2025-01-15 11:00:05 +01:00
uvaldenaire-opendsi
748dcd0881 FIX selectcontact is loading all contacts if socid is empty and MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT is not set 2025-01-15 10:12:16 +01:00
Florian HENRY
2d1d6f13c9 chore: review 2025-01-15 09:10:11 +01:00
Laurent Destailleur
4f98ca37e2 Merge pull request #32653 from mdeweerd/pr32651
Fix ci 17.0 and up - Install maximum php version found in check.php
2025-01-15 01:11:52 +01:00
Irvine Fleith
a34eaa07ed fix(services-list): search thirdparty by name 2025-01-14 16:19:52 +01:00
MDW
20f2293c01 Always install expected php version 2025-01-14 16:15:04 +01:00
MDW
7869e45954 Move installation of php before pre-commit run 2025-01-14 16:15:03 +01:00
MDW
9af7eaf08c Use PHP version from check.php 2025-01-14 16:15:01 +01:00
Florian HENRY
79ed9c7e37 fix: add entity in where for fetch when fetch by ref 2025-01-14 16:08:40 +01:00
Laurent Destailleur
eb8167bc57 Merge pull request #32414 from altairisfr/fix_status_ticket
FIX: status ticket update for new message
2025-01-14 14:35:24 +01:00
atm-florian
df992477be Apply suggestion by @mdeweerd to ensure pre-commit will pass. 2025-01-14 14:34:09 +01:00
Florian Mortgat
79c55149b2 Update htdocs/core/lib/functions.lib.php 2025-01-14 11:00:38 +01:00
Adrien Raze
ac1077bfe3 FIX : There were many status indicator in the invoice linked object block (propal card) 2025-01-14 09:48:13 +01:00
Laurent Destailleur
a46c47c134 Merge pull request #32542 from Al-thi/fix/stock-import
FIX #21294 Stock import sql query
2025-01-13 02:43:37 +01:00
atm-florian
762e4ec8d1 updated local pre-commit hook -> fix typo 2025-01-10 17:01:59 +01:00
atm-florian
77f982d1a8 FIX 17.0 - collisions in cache for dol_getIdFromCode 2025-01-10 16:25:27 +01:00
Laurent Destailleur
7a7146c03d Merge pull request #32600 from Easya-Solutions/14_fix_selectcontacts_socid_param
fix selectcontacts  param
2025-01-10 12:03:36 +01:00
Eric Seigne
a34d760a88 fix edit : display zero value instead of nothing 2025-01-10 11:28:46 +01:00
Eric Seigne
e9eb22f8f0 zero could be a value 2025-01-10 11:17:06 +01:00
Maxime Kohlhaas
e1a47ed0fb Merge branch '17.0' of github.com:Dolibarr/dolibarr into 18.0 2025-01-09 18:08:00 +01:00
Maxime Kohlhaas
6388f6e62a Merge branch '16.0' of github.com:Dolibarr/dolibarr into 17.0 2025-01-09 18:07:09 +01:00
Maxime Kohlhaas
e2605fbf64 Merge branch '15.0' of github.com:Dolibarr/dolibarr into 16.0 2025-01-09 18:05:33 +01:00
Maxime Kohlhaas
90c24b3d95 Merge branch '14.0' of https://github.com/Dolibarr/dolibarr into 15.0 2025-01-09 18:01:51 +01:00
uvaldenaire-opendsi
0912b3b04f fix selectcontacts param 2025-01-09 15:09:38 +01:00
tnegre
7e82f70c77 add case when HTML tags contain attributes 2025-01-09 11:05:45 +01:00
Laurent Destailleur
2dd81deb13 Merge pull request #32568 from atm-maxime/14.0
Fix : cron job user rights force reload
2025-01-07 21:29:15 +01:00
Maxime Kohlhaas
273ec857a3 Fix : cron job user rights force reload 2025-01-07 18:39:19 +01:00
Marc de Lima Lucio
ef564caf28 FIX: qual 2025-01-07 17:37:30 +01:00
Marc de Lima Lucio
3ef6299c83 FIX: phpcs 2025-01-07 17:20:57 +01:00
Marc de Lima Lucio
ec58ee940a FIX: product variants copy: also copy multiprice variations 2025-01-07 17:09:48 +01:00
Laurent Destailleur
2519278269 Merge pull request #32558 from Easya-Solutions/14_fix_join_soc_commerciaux
fix join societe_commerciaux in societe list
2025-01-07 15:54:42 +01:00
uvaldenaire-opendsi
74881ae251 fix join societe_commerciaux in societe list 2025-01-07 13:51:34 +01:00
uvaldenaire-opendsi
c218eaa6ed fix join societe_commerciaux in societe list 2025-01-07 13:45:59 +01:00
Alexis Thietard
b7cb799af0 FIX #21294 Stock import sql query
To respect the PostgreSQL update statement syntax, cf.
https://www.postgresql.org/docs/17/sql-update.html

```
column_name
    The name of a column in the table named by table_name. The column name can
    be qualified with a subfield name or array subscript, if needed. Do not
    include the table's name in the specification of a target column — for
    example, UPDATE table_name SET table_name.col = 1 is invalid.
```

Signed-off-by: Alexis Thietard <alexis.thietard@rtone.fr>
2025-01-06 14:36:50 +01:00
tnegre
78bf506790 fix tests in error 2025-01-06 09:44:04 +01:00
tnegre
61b03b0c05 Testing ODF : revert parameters order for assertEquals() 2025-01-06 09:44:04 +01:00
tnegre
b31962f7e2 fix 2025-01-06 09:44:04 +01:00
tnegre
112220da86 BUG: when there are two identical HTML tags in a substitution string, everything is taken between first opening tag and last closing tag. Write test to reproduce. 2025-01-06 09:44:04 +01:00
Laurent Destailleur
1fafc1b6ad Merge branch '18.0' into fix-email-notification-ticket-assignee-18 2025-01-05 17:30:02 +01:00
Frédéric France
eb4e059683 fix 2025-01-05 17:29:46 +01:00
Laurent Destailleur
b5ff688841 Merge branch '18.0' into fix-email-notification-ticket-assignee-18 2025-01-05 17:23:20 +01:00
Laurent Destailleur (aka Eldy)
8805b8cac4 Exclude test files 2025-01-05 17:22:30 +01:00
Laurent Destailleur
d01a99cd79 Merge branch '18.0' into fix-email-notification-ticket-assignee-18 2025-01-05 17:16:58 +01:00
Laurent Destailleur (aka Eldy)
1866713082 Avoid error 2025-01-05 17:10:00 +01:00
Laurent Destailleur (aka Eldy)
9ecc88230f Test pr action 2025-01-05 17:08:02 +01:00
Laurent Destailleur
8ddd050a34 Merge pull request #32487 from rycks/18.0_fix_name_to_lastname_socpeople
there is no "name" field into llx_socpeople table
2025-01-02 16:53:57 +01:00
William Mead
4c4b773de5 Fix send on assign 2025-01-02 14:59:44 +01:00
William Mead
37a815af53 Cleaned code 2025-01-02 14:50:14 +01:00
William Mead
f60f34cdf8 Backport fix for send email to assigned user on ticket create 2025-01-02 14:07:46 +01:00
Laurent Destailleur (aka Eldy)
4267f5f010 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-12-31 17:18:15 +01:00
Laurent Destailleur (aka Eldy)
f08c9605db Merge branch '16.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2024-12-31 17:17:45 +01:00
Laurent Destailleur (aka Eldy)
e41dfcbbb3 Fix phpcs 2024-12-31 17:17:00 +01:00
Laurent Destailleur (aka Eldy)
a0b6aa28a7 Fix phpcs 2024-12-31 17:13:43 +01:00
Laurent Destailleur (aka Eldy)
c273495261 Fix ci 2024-12-31 17:12:37 +01:00
Eric Seigne
220090813d there is no "name" field into llx_socpeople table 2024-12-30 10:28:23 +01:00
Laurent Destailleur
e65ee097a5 Merge pull request #30915 from MaximilienR-easya/18.0_Backport_yogosha
Backport #yogosha18281
2024-12-30 04:58:37 +01:00
Laurent Destailleur (aka Eldy)
92963af09f Fix yml syntax 2024-12-29 17:04:54 +01:00
Laurent Destailleur (aka Eldy)
8ccdbf374b Update test 2024-12-29 15:57:17 +01:00
Laurent Destailleur (aka Eldy)
0300209b3d Missing new line 2024-12-24 02:00:37 +01:00
Laurent Destailleur
a5f51dc969 Merge pull request #32433 from frederic34/15.0-fix_ci
fix CI for branch 15.0
2024-12-19 18:58:29 +01:00
Frédéric France
04b7fdd4c4 fix CI 2024-12-19 18:32:16 +01:00
Laurent Destailleur (aka Eldy)
e3c44568a0 Test github action 2024-12-19 18:31:15 +01:00
Laurent Destailleur
37f3fccc35 Merge pull request #32383 from atm-etienne/fix/130/remove_dol_syslog_throws
Fix/130/remove dol syslog throws
2024-12-19 18:10:38 +01:00
Laurent Destailleur
fedcec58a6 Update errors.lang 2024-12-19 18:09:50 +01:00
Laurent Destailleur
be95c92c45 Update functions.lib.php 2024-12-19 18:07:02 +01:00
Laurent Destailleur (aka Eldy)
810fd7e744 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-12-19 17:51:14 +01:00
Laurent Destailleur (aka Eldy)
c6afa1a6cb Merge branch '17.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2024-12-19 17:50:40 +01:00
Laurent Destailleur (aka Eldy)
29eedd2ac4 Merge branch '16.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2024-12-19 17:50:34 +01:00
Laurent Destailleur (aka Eldy)
ead519811c Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2024-12-19 17:50:09 +01:00
Laurent Destailleur
5203652796 Merge pull request #32430 from Benoit-PASCAL/fix-fetch-action-linked-object
fix: fetch action linked object
2024-12-19 17:49:50 +01:00
Laurent Destailleur
750ed5e91c Merge pull request #32412 from Easya-Solutions/17.0_fix_no_commit_to_branch
pre-commit : change regex for hook no-commit-to-branch to block only `18.0`, not `18.0_branch_description`
2024-12-19 17:38:15 +01:00
Benoît PASCAL
425c23d28c fix: fetch action linked object 2024-12-19 15:38:19 +01:00
Noé Cendrier
900a91a0a2 Merge pull request #22 from altairis-melina/fix_statut_ticket
Fix: Statut ticket
2024-12-18 11:40:07 +01:00
Mélina JOUM
ce06c12da6 FIX: GETPOST('private_message') 2024-12-18 11:19:56 +01:00
tnegre
b73bcd68a9 pre-commit : change regex for hook no-commit-to-branch in order to allow branches BEGINNING by 18.0, such as 18.0_fix_foo 2024-12-18 10:47:46 +01:00
tnegre
86833633ef fix 2024-12-18 10:26:26 +01:00
tnegre
21ac3b28ef Merge branch '18.0' into 18.0_fix_error_delete_loan 2024-12-18 09:50:13 +01:00
Etienne BENDER
6aee2db1d4 Remove use of getDolGlobalInt() 2024-12-17 09:01:04 +01:00
Laurent Destailleur (aka Eldy)
a6da3b189a Not required, but for better code consistency 2024-12-16 12:59:16 +01:00
Laurent Destailleur
65d6403fa3 Merge branch '18.0' into 18_fixloanpayment 2024-12-13 14:05:43 +01:00
Laurent Destailleur (aka Eldy)
62c1d500e8 Avoid errors 2024-12-13 14:05:04 +01:00
Alexandre SPANGARO
ef090aa895 CI 2024-12-13 06:22:44 +01:00
Alexandre SPANGARO
d9be3efa90 FIX #32339 Delete a loan settlement is partial 2024-12-13 06:18:45 +01:00
tnegre
a4785adb3d FIX : display error when loan can't be deleted 2024-12-12 15:31:40 +01:00
Laurent Destailleur (aka Eldy)
3c22179183 Rename file 2024-12-09 14:20:28 +01:00
Etienne BENDER
a96d13d5aa Add translation for bad log level 2024-12-09 10:56:35 +01:00
Etienne BENDER
f1868ee162 Replace dol_syslog throws by default log level 2024-12-09 10:50:29 +01:00
Laurent Destailleur (aka Eldy)
cfd4919829 Test 2024-12-09 08:40:25 +01:00
Laurent Destailleur (aka Eldy)
30893bf676 Test 2024-12-09 08:36:07 +01:00
Laurent Destailleur (aka Eldy)
28213b3129 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-12-08 16:44:08 +01:00
Laurent Destailleur (aka Eldy)
c3ede4413d Test 2024-12-08 16:01:45 +01:00
Laurent Destailleur (aka Eldy)
21eca275e9 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-12-08 15:54:01 +01:00
Laurent Destailleur (aka Eldy)
127b9701ff Test 2024-12-08 15:53:25 +01:00
Laurent Destailleur (aka Eldy)
ee7201fc61 Test 2024-12-08 15:43:42 +01:00
Laurent Destailleur (aka Eldy)
c075e078e9 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-12-08 15:41:37 +01:00
Laurent Destailleur (aka Eldy)
f9eb6b69f5 Test 2024-12-08 15:41:29 +01:00
Laurent Destailleur (aka Eldy)
3d9b7ed7d3 Test 2024-12-08 15:40:35 +01:00
Laurent Destailleur (aka Eldy)
6920b72cf4 Test 2024-12-08 15:35:03 +01:00
Laurent Destailleur (aka Eldy)
9a9602f418 Test 2024-12-08 15:09:08 +01:00
Laurent Destailleur (aka Eldy)
0960fcba2a Test 2024-12-08 15:02:43 +01:00
Laurent Destailleur (aka Eldy)
9b46ed9c2d Test 2024-12-08 14:57:17 +01:00
Laurent Destailleur (aka Eldy)
d055b1fb29 Test 2024-12-08 14:36:07 +01:00
Laurent Destailleur (aka Eldy)
9411ac2144 Test 2024-12-08 14:35:30 +01:00
Laurent Destailleur (aka Eldy)
eb2b35e3b1 Test 2024-12-08 14:32:16 +01:00
Laurent Destailleur (aka Eldy)
ab5f9a0884 Tst 2024-12-08 14:31:00 +01:00
Laurent Destailleur (aka Eldy)
b4ece8d154 Fix 2024-12-08 14:25:10 +01:00
Laurent Destailleur (aka Eldy)
75e504ffbc Test 2024-12-08 14:20:15 +01:00
Laurent Destailleur (aka Eldy)
3877f257b4 Test 2024-12-08 14:13:13 +01:00
Laurent Destailleur (aka Eldy)
6f2d8b23b4 Test 2024-12-08 14:09:47 +01:00
Laurent Destailleur (aka Eldy)
80326acb71 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-12-08 14:08:07 +01:00
Laurent Destailleur (aka Eldy)
d9035eecda Test 2024-12-08 14:07:37 +01:00
Laurent Destailleur (aka Eldy)
da6f1fbc9a Test 2024-12-08 14:04:10 +01:00
Laurent Destailleur (aka Eldy)
4bb2b9f971 Test 2024-12-08 13:51:23 +01:00
Laurent Destailleur (aka Eldy)
a0864dfb3f Fix test 2024-12-08 13:05:24 +01:00
Laurent Destailleur (aka Eldy)
d3d534efee Test 2024-12-08 12:54:25 +01:00
Laurent Destailleur (aka Eldy)
2e94f7dbd4 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-12-08 12:52:59 +01:00
Laurent Destailleur (aka Eldy)
2c4b3bf6ad Test 2024-12-08 12:52:44 +01:00
tnegre
e8aaa51edc set empty value for choice 2024-12-06 14:06:54 +01:00
tnegre
e48e1e27d5 replace code from develop to match DLB18 variable name 2024-12-06 12:07:37 +01:00
Laurent Destailleur (aka Eldy)
c86b50e3fc The $empty param must follow same rules than other select component. 2024-12-06 11:57:27 +01:00
Laurent Destailleur
42368b37e9 Merge pull request #32251 from ATM-Consulting/FIX/130/coeur/fetch-return-value-bad-test
Fix 17.0 missing test of return value
2024-12-05 19:28:42 +01:00
Laurent Destailleur
addefdf0cf Merge pull request #32247 from atm-irvine/fix_missing_error_cron_createrecurringinvoice
Added new error message for CRON createRecurringInvoice
2024-12-05 18:14:40 +01:00
Laurent Destailleur
59642d8d93 Merge pull request #32131 from frederic34/patch-10
backport of PR 32080
2024-12-05 16:47:42 +01:00
Laurent Destailleur
a26eecf0fd Merge pull request #32190 from JonBendtsen/v18_Updating_Invoice_Notes_32134
throw RestException(500) if update of invoice fails #32134
2024-12-05 16:39:56 +01:00
Laurent Destailleur
69449668a8 Merge pull request #32205 from atm-quentin/FIX_total_time
Fix for incorrect total time calculation in project overview tab
2024-12-05 16:21:51 +01:00
Laurent Destailleur
084d99f670 Merge pull request #32216 from Easya-Solutions/18.0_fix_ticket_list
Ticket : don't autofill search field for ticket type on multiselect
2024-12-05 16:12:22 +01:00
atm-florian
15c19b99c9 FIX 17.0: warnings due to uninitialized variables + delete code that doesn't apply to recurring invoices (AFAIK, there is no recurring credit note feature) 2024-12-05 12:15:20 +01:00
atm-florian
c418a6ff57 FIX 17.0 - missing error handling for FactureRec::fetch in card-rec.php 2024-12-05 12:14:13 +01:00
Irvine Fleith
3aad5fd283 Added new error message for CRON createRecurringInvoice 2024-12-05 09:02:51 +01:00
Frédéric FRANCE
d04b1e57d2 Merge branch '18.0' into patch-10 2024-12-03 21:39:47 +01:00
tnegre
f5c715c6a7 Ticket : don't autofill search field for ticket type on multiselect 2024-12-03 15:05:39 +01:00
Quentin VIAL--GOUTEYRON
d8fecc1522 FIX : in projet/element.php total_time is always back to 0 2024-12-03 08:39:34 +01:00
Jon Bendtsen
30a9da8fbf Merge branch '18.0' into v18_Updating_Invoice_Notes_32134 2024-12-02 07:31:35 +01:00
Jon Bendtsen
e6712300d5 phan fix, remove code never reached 2024-12-02 07:29:18 +01:00
Laurent Destailleur (aka Eldy)
c547362ae9 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-12-02 01:41:04 +01:00
Laurent Destailleur (aka Eldy)
9ec4575c43 Merge branch '16.0' of git@github.com:/Dolibarr/dolibarr.git into 17.0 2024-12-02 01:38:41 +01:00
Günter Lukas
4962dd1a81 Fix #29353 (#32151)
Hidden extrafields are NULL on update. Can only happen with extrafields in positions of commercial elements (facture, propal, commande, etc)
2024-12-02 00:48:13 +01:00
Mathieu Moulin
6337a987d8 Fix handling of boolean extrafields in list filters (#32109)
* Fix show payment URL in massaction context when not one email per recipient

* Debug v20 - fix param for filter on boolean

* FIX : Fix case when the value of a extrafields of the type 'boolean', 'select' or other have an option with a value equal to '0'.
It's not reselected when the filter is set.

* Revert "Fix show payment URL in massaction context when not one email per recipient"

This reverts commit 0986d487f1.

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
Co-authored-by: kkhelifa <kkhelifa@open-dsi.fr>
2024-12-01 23:28:49 +01:00
Jon Bendtsen
7a500976d2 Merge branch '18.0' into v18_Updating_Invoice_Notes_32134 2024-12-01 10:27:43 +01:00
Jon Bendtsen
0e1744a6ec throw RestException(500) if update of invoice fails #32134 2024-12-01 10:24:25 +01:00
Frédéric FRANCE
29a7a410c8 backport of https://github.com/Dolibarr/dolibarr/pull/32080
backport of fix part
2024-11-28 13:28:34 +01:00
Mathieu Moulin
e9009ede87 Fix double hook printFieldPreListTitle in command list (#32108)
* Fix command list : remove double hook printFieldPreListTitle

* Remove files
2024-11-27 22:02:29 +01:00
Frédéric FRANCE
7b16039084 fix test (#32110) 2024-11-27 18:02:59 +01:00
Thomas C.
acdab170a7 fix (#32012) 2024-11-22 17:58:21 +01:00
Laurent Destailleur
32b18d6bfd Execute 2024-11-22 15:22:22 +01:00
Jon Bendtsen
9cd7d381a6 flip supplier proposal and orders to show up as negative in the project Profit overview (#32048)
Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
2024-11-22 13:25:25 +01:00
Frédéric FRANCE
e35b534ee2 fix ajax tooltip lib_foot.js.php (#32044)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-11-22 13:22:05 +01:00
Laurent Destailleur
682544ad45 Update test.yaml (#32054)
* Update test.yaml

* Update test.yaml

* Update test.yaml

* Update test.yaml

* Update test.yaml

* Update test.yaml

* Update test.yaml

* Update test.yaml

* Update test.yaml

* Update test.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update test.yaml

* Update test.yaml

* Update test.yaml

* Update test.yaml

* Update test.yaml

* Update test.yaml

* Update test.yaml

* Update test.yaml

* Update pr-18.yaml

* Update test.yaml
2024-11-22 13:08:56 +01:00
Laurent Destailleur
53ffe42f92 Test CI 2024-11-22 00:27:58 +01:00
Laurent Destailleur
c2a037842d Add test 2024-11-22 00:22:26 +01:00
Laurent Destailleur
552bebf564 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-11-22 00:20:23 +01:00
Laurent Destailleur
ec93f50863 Test 2024-11-22 00:15:14 +01:00
HENRY Florian
240c5bb311 fix: buyer and sellers in supplier invoice and supplier order list are not corectly defined (#32028)
* fix: buyer and sellers in supplier invoice and supplier order list are not corectly defined

* chore: revert bad changes
2024-11-21 23:00:41 +01:00
lvessiller-opendsi
c12a7e144a FIX TakePos barcode rule (#31857)
* FIX TakePos barcode rule

* Keep last test confition on barcode rule
2024-11-21 19:07:58 +01:00
HENRY Florian
991f53db9e FIX: use tax with code on supplier order line give tax code missing in supplier invoice (#32018)
* FIX: use vat with code on supplier order result code missing in supplier invoice

* FIX: use vat with code on supplier order result code missing in supplier invoice
2024-11-21 17:46:54 +01:00
Laurent Destailleur
877fd00353 Update pr-18.yaml 2024-11-21 13:21:58 +01:00
Frédéric FRANCE
d420d035de Update pr-18.yaml (#32024)
* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

* Update pr-18.yaml

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-11-21 13:02:14 +01:00
alkaan
115323dec8 FIX : removes traces of <<<HEAD conflicts following the postponement of branch 13 modifications (#32014)
Co-authored-by: John Fleuret <john.fleuret@atgp.net>
2024-11-20 20:57:22 +01:00
Laurent Destailleur
ac6c57e90e Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-11-19 12:59:14 +01:00
Laurent Destailleur
9c4bb84460 Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 17.0 2024-11-19 12:57:19 +01:00
Laurent Destailleur
5a58b8e721 Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2024-11-19 12:56:37 +01:00
Laurent Destailleur
b068fdc9b3 Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2024-11-19 12:56:19 +01:00
Laurent Destailleur
b8533e1853 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2024-11-19 12:49:19 +01:00
Laurent Destailleur
753e5e535d Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2024-11-19 12:47:14 +01:00
Laurent Destailleur
99774022a5 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-11-19 03:36:44 +01:00
Laurent Destailleur
c5ebc9b7bd Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 17.0 2024-11-19 03:33:15 +01:00
Florian Charlaix
f2f3e478d1 New Add a workflow to let @lvessiller-opendsi and @rycks merge 18.0 PR by accepting reviews (#31898)
* Add a workflow to let @lvessiller-opendsi and @crycks merge 18.0 PR by accepting reviews

* Try to fix permissions
2024-11-18 17:58:56 +01:00
Benoît PASCAL
f10d9464a1 fix: get file link in invoice list with multicompany (#31966) 2024-11-18 17:58:25 +01:00
lvessiller-opendsi
580d789a00 FIX send mail to BCC when email formated as Fullname <email> (#31983) 2024-11-18 14:56:09 +01:00
uvaldenaire-opendsi
98d106e6b5 Fix delete project when mrp module never enabled (#31982)
Co-authored-by: Laurent Destailleur <eldy@users.sourceforge.net>
2024-11-18 14:55:20 +01:00
Laurent Destailleur
bca77bddb8 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-11-17 10:31:38 +01:00
Laurent Destailleur
7ca9f0022a Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-11-17 10:31:11 +01:00
Mathieu Moulin
a602309e04 Fix user::load_previous_next_ref() with MULTICOMPANY_TRANSVERSE_MODE bad sql query (cartesian product replaced by INNER JOIN) (#31946) 2024-11-16 18:19:59 +01:00
Mathieu Moulin
f51935a258 Fix slow user card when many users in same group, disable loading of all other users (#31947) 2024-11-16 18:10:08 +01:00
Thomas C.
976399c2d9 fix (#31683) 2024-11-16 10:57:03 +01:00
Mathieu Moulin
cd6ed63768 Fix Specimen warning in supplier admin when database has no products (#31867) 2024-11-16 10:45:01 +01:00
Mathieu Moulin
348981a419 Fix show payment URL in massaction context when not one email per recipient (#31927) 2024-11-16 00:06:15 +01:00
Mathieu Moulin
adf59f2599 Fix mod_facture_fournisseur_tulip::getExample & get_next_value if no object in parameter (#31878) 2024-11-16 00:00:05 +01:00
kkhelifa-opendsi
d0323fa27d FIX : Update on a sold line of bank entrie set the type to empty, now it's fixed #22539 (#31888) 2024-11-15 23:53:04 +01:00
William Mead
038f8d5dff Backported default ticket severity fix (#31908) 2024-11-15 23:44:08 +01:00
William Mead
bab49d66c5 Backported default ticket type fix (#31912) 2024-11-15 23:36:54 +01:00
Francis Appels
230eee4ead FIX issue #28222 Edit date extrafield diplayed on all on lines (#31914)
* FIX issue #28222 Edit date extrafield diplayed on all on lines

* wrong id
2024-11-15 23:31:12 +01:00
Marc de Lima Lucio
ce9a1b3661 FIX: swiftmailer: correctly set errors-to header (#31826) 2024-11-15 14:10:35 +01:00
MaximilienR-easya
4feb9def4e Fix Preview present even when there is no corresponding file (#30585)
* Fix cas de previews de fichier non existant

* another way to detect missing or missnamed file than using file_exists function
2024-11-13 22:52:42 +01:00
lvessiller-opendsi
dccde49388 FIX calculate start date of cloned task from cloned project (#31799)
* FIX calculate start date of cloned task from cloned project

* Fix wrong strat comment
2024-11-13 21:31:22 +01:00
Laurent Destailleur
a039a00277 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-11-13 16:35:07 +01:00
Laurent Destailleur
d30a0ea066 Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 17.0 2024-11-13 16:32:54 +01:00
Laurent Destailleur
ab6c74ae88 Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2024-11-13 16:29:18 +01:00
Laurent Destailleur
fbca98ec2a Merge 2024-11-13 16:25:00 +01:00
thomas-Ngr
93f23fe452 ODF : fix : escape specials chars in IF ELSE ENDIF $key (#31796)
* ODF : fix : escape specials chars in IF ELSE ENDIF $key

* fix missing brackets

* add delimiter to preg_quote

---------

Co-authored-by: Brice Werry <bwerry@open-dsi.fr>
2024-11-13 16:18:08 +01:00
Eric - CAP-REL
67c2a48fc9 Add missing extrafields on strato pdf model (#31790)
* undef var

* add main extrafields on object

* remove dev debug sorry !

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-11-13 12:39:10 +01:00
Laurent Destailleur
792ff4044e Typo 2024-11-13 12:08:46 +01:00
Laurent Destailleur
29ef86a245 Typo 2024-11-13 11:51:32 +01:00
Laurent Destailleur
d5add8aa49 typo 2024-11-13 10:56:56 +01:00
Laurent Destailleur
d3b9a83055 Fix changelog 2024-11-13 10:56:14 +01:00
Laurent Destailleur
f4b2269e2e Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-11-13 00:26:53 +01:00
uvaldenaire-opendsi
0eee1ad18b Qual: remove php 8.2 warnings by casting trim() argument to string. (#28162) (#31693)
In create and update methods of societe class, the trim function triggered warnings when the argument passed is null.
Cast string properties to string to avoid php warnings when the property is null.

Co-authored-by: UltraViolet33 <93035200+UltraViolet33@users.noreply.github.com>
2024-11-12 19:45:52 +01:00
lvessiller-opendsi
d5e2f89edc FIX can validate shipment without stock movement (#31780) 2024-11-12 14:25:36 +01:00
uvaldenaire-opendsi
67bcc242db fix trim null value on invoice creation (#31682)
* fix trim null value on invoice creation

* fix trim with null value for note_public
2024-11-10 11:18:05 +01:00
lvessiller-opendsi
8a55e2f6a4 FIX old copy not needed in supplier order create method (#31733) 2024-11-08 17:51:44 +01:00
Juanjo Menent
5eb5033aba FIX #25853 Thirdparty Massaction (#25868)
* FIX #25853 Thirdparty Massaction

* FIX #25704 Taxes Deleted from Vendor Invoices

* FIX #25704 Taxes Deleted from Vendor Invoices

* FIX #25704 Taxes Deleted from Vendor Invoices

* Update fournisseur.facture.class.php

---------

Co-authored-by: Juanjo Menent <jmenent@2byte.es>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-11-07 04:41:48 +01:00
Florian Mortgat
723c8278ce FIX 17.0 fatal when updating recurring supplier invoice line with php8 ($remise_percent is '' instead of 0) (#31713) 2024-11-06 19:20:38 +01:00
uvaldenaire-opendsi
bbf83c7053 fix dol_getdate() when timestamp is an empty string (#31714) 2024-11-06 19:17:33 +01:00
HENRY Florian
b8286ab8f3 fix: List of UserGroup display wrong count of records( actual: nb group * nb user * nb perms (*nb entities)) instead of count of group (#31687)
* fix: group list count nb group * nb user * nb perms

* fix: synk.io security issue with zappier sample package in version Dolibarr 18.0
2024-11-05 15:37:04 +01:00
atm-jonathan
7133c6529b FIX show preview pdf list expensereport (#31694)
* show preview pdf list expensereport

* conditions added
2024-11-05 13:51:26 +01:00
lvessiller-opendsi
e0a3756c6e FIX update status on create supplier order for trigger (#31642) 2024-10-30 23:35:39 +01:00
thomas-Ngr
c396a08cb2 fix const WORKFLOW_RECEPTION_CLASSIFY_CLOSED_INVOICE (#31601)
* rename const WORKFLOW_EXPEDITION_CLASSIFY_CLOSED_INVOICE to WORKFLOW_RECEPTION_CLASSIFY_CLOSED_INVOICE

* edit wrong SQL erquest
2024-10-29 17:34:30 +01:00
Laurent Destailleur
0981c69515 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-10-29 15:48:21 +01:00
Laurent Destailleur
1987ea2eb7 Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 17.0 2024-10-29 15:47:51 +01:00
Laurent Destailleur
6a4ee18380 Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2024-10-29 15:47:17 +01:00
Laurent Destailleur
b3a2908b48 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2024-10-29 15:46:43 +01:00
Laurent Destailleur
910f7e8564 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2024-10-29 15:46:12 +01:00
Laurent Destailleur
7cf1a97673 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2024-10-29 15:44:55 +01:00
Laurent Destailleur
cf57e7e88b Merge 2024-10-29 15:44:25 +01:00
Laurent Destailleur
8b4dcb1194 FIX email templates for expense report not visible 2024-10-29 15:43:16 +01:00
Laurent Destailleur
a186e16568 Backport fix for mysql 8 export 2024-10-29 15:32:54 +01:00
kkhelifa-opendsi
eaa31ed4a3 FIX: Fix bug select columns and acces to the public ticket list from the public ticket card (case when we have connected to another client before, the track id stocked in session overwrite the new track id from the public ticket card) (#31000) 2024-10-28 21:16:17 +01:00
Laurent Destailleur
0e62008db6 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-10-24 18:03:59 +02:00
Laurent Destailleur
aa096448be Merge branch '18.0' of github.com:Dolibarr/dolibarr into 18.0 2024-10-24 03:07:20 +02:00
Laurent Destailleur
d9d0618eec Fix avoid unexpected deletion on accounting account when using multicompany 2024-10-24 03:06:23 +02:00
Thomas C.
39afafc585 FIX: If you have no stock of your product, an error is displayed when you delete the reception. (#31504)
* fix

* delete

* f

* indent

* indent
2024-10-23 23:11:02 +02:00
HENRY Florian
b37b2ba76f fix: test on const with space.... (#31505) 2024-10-23 23:08:05 +02:00
atm-corentin
c48b035a15 FIX issue on action set condition in particular when you set a deposi… (#31518)
* fix issue on action set condition in particular when you set a deposit cond on propal

* fix some identation issues

* fix retour github actions pre commit

* Update card.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-10-23 22:59:46 +02:00
Frédéric FRANCE
1d197e42bb fix shippable tooltip value overwritten (#31468) 2024-10-20 00:11:04 +02:00
Frédéric FRANCE
b0c7b8750a fix overwritten value (#31470) 2024-10-20 00:10:54 +02:00
Laurent Destailleur
a0b791a4a6 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-10-19 13:59:35 +02:00
Florian Mortgat
abefce7ae2 FIX 17.0: supplier invoice template card: buyer and seller swapped in VAT-related function calls (probably a copy-paste from customer invoice templates) (#31446) 2024-10-19 01:55:58 +02:00
atm-irvine
352bdaf9c4 FIX : Extrafield following between rec invoice and classic invoice (#31445) 2024-10-19 01:33:31 +02:00
Kamel Khelifa
87c16498ca FIX: Fix return value of hook sendMail when hook return -1 who must be return false in sendfile() function 2024-10-18 14:26:04 +02:00
Laurent Destailleur
35f3a4f441 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-10-17 00:59:17 +02:00
Laurent Destailleur
111e3fcd32 Revert "NEW - Add a new hook on order list (#31315)"
This reverts commit 1e64870a9e.
2024-10-17 00:52:42 +02:00
Laurent Destailleur
d819d88718 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-10-14 20:18:46 +02:00
Laurent Destailleur
278eea6fae Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 17.0 2024-10-14 20:18:22 +02:00
Laurent Destailleur
fa22ebd893 Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2024-10-14 19:31:08 +02:00
Laurent Destailleur
793e77bc5f Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2024-10-14 19:21:00 +02:00
thomas-Ngr
70a453a5c2 FIX: substitutions THIRDPARTY_XXX are not available for actioncomm reminders (#31385) 2024-10-14 11:57:55 +02:00
UltraViolet33
33c6d95b1c Backport Fix wrong invoice status when invoice has discount (#31323)
Co-authored-by: Ulysse Valdenaire <uvaldenaire@easya.solutions>
2024-10-13 21:04:17 +02:00
atm-lucas
1e64870a9e NEW - Add a new hook on order list (#31315)
* Add a new hook on order list

* pr correction
2024-10-11 15:53:43 +02:00
Laurent Destailleur
94ed718782 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-10-07 15:15:01 +02:00
Laurent Destailleur
40965b63b5 Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 17.0 2024-10-07 15:13:17 +02:00
Laurent Destailleur
3391d3db05 Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2024-10-07 15:12:00 +02:00
Laurent Destailleur
9509929f5d Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2024-10-07 15:11:42 +02:00
Laurent Destailleur
63d4b5e3d8 FIX Backport fix fatal error on price with some truncating setup 2024-10-06 22:17:26 +02:00
atm-irvine
f287d100a3 Use <= 0 instead of ! because delete method returns -1 or 1 (#31268)
* Use <= 0 instead of ! because delete method returns -1 or 1

* Added contact

* Removed user from parameters
2024-10-04 11:49:44 +02:00
thomas-Ngr
336d3ad8e5 finish fix (#31203) 2024-10-03 21:03:13 +02:00
cbeasley-sbb
9af212a542 Update ticket.class.php Bug-fix Issue #31206 (#31208)
Fix Issue #31206 for the v.18 branch because unrelated tests failing on develop branch.
2024-10-03 20:33:02 +02:00
thomas-Ngr
e71631abe0 fix : missing update for extrafields on holidays (#31256) 2024-10-03 19:33:33 +02:00
Sylvain Legrand
5d58a33f37 Fix tz array (#31240)
The list of time zones included in the 'get_tz_array()' function no longer matches the list of zones supported by PHP!
See the pages "https://www.php.net/manual/fr/timezones.php"

When using these values, this caused a 500 error: "PHP Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone (Pacific/Enderbury) " for example =>
$arraytz = get_tz_array();
foreach ($arraytz as $key => $value) {
$date = new DateTime();
$date->setTimezone(new DateTimeZone($value));
}

When several zone names could be used for the same time zone, I favored the canonical name (The primary, preferred zone name).
See the table "https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"
2024-10-03 15:38:41 +02:00
Laurent Destailleur
25ea797aed Fix not default template for BOM 2024-09-30 18:26:24 +02:00
Laurent Destailleur
97eacefa6b Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-09-29 22:41:54 +02:00
Laurent Destailleur
f5fbbcfcb8 Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 17.0 2024-09-29 22:40:45 +02:00
Laurent Destailleur
2c67c8b6ff Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2024-09-29 22:32:01 +02:00
Laurent Destailleur
d0fb08adf4 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2024-09-29 22:31:42 +02:00
Laurent Destailleur
624493fb26 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2024-09-29 22:30:07 +02:00
Laurent Destailleur
6eddee9a78 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2024-09-29 22:29:19 +02:00
Laurent Destailleur
52138372ce Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 12.0 2024-09-29 22:27:54 +02:00
Laurent Destailleur
a27538f582 Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0 2024-09-29 22:27:42 +02:00
Florian Mortgat
385927fe06 FIX: box_actions.php still uses fk_user_done which no longer exists (#31190)
Co-authored-by: FlorianMortgat <5845502+FlorianMortgat@users.noreply.github.com>
2024-09-29 22:18:18 +02:00
Laurent Destailleur
a621032643 Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2024-09-29 19:28:05 +02:00
Laurent Destailleur
32646cb7f4 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2024-09-29 19:25:49 +02:00
Florian Mortgat
74b67eb6c6 FIX - use price() to display qty on a product's stats tab to avoid showing too many decimals when rounding errors are possible (#31165) 2024-09-29 15:57:05 +02:00
Florian Mortgat
231fc6ce70 FIX: if you call fetchLines several times, your $object->lines contains duplicates (#31167) 2024-09-29 15:27:24 +02:00
Laurent Destailleur
1dfc091c9b Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-09-26 19:11:23 +02:00
Laurent Destailleur
df7fffcab3 Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 17.0 2024-09-26 19:10:44 +02:00
Laurent Destailleur
b517e068ed Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2024-09-26 19:09:54 +02:00
Laurent Destailleur
8a330ecaa9 Merge remote-tracking branch 'origin/14.0' into 15.0 2024-09-26 19:07:02 +02:00
Laurent Destailleur
eef0d0bddb Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2024-09-26 18:48:45 +02:00
Laurent Destailleur
c1889afd7b Merge remote-tracking branch 'origin/12.0' into 13.0 2024-09-26 18:47:39 +02:00
Laurent Destailleur
644f365455 Merge remote-tracking branch 'origin/11.0' into 12.0 2024-09-26 18:47:12 +02:00
Laurent Destailleur
667890247c Merge remote-tracking branch 'origin/10.0' into 11.0 2024-09-26 18:46:30 +02:00
Florian Mortgat
c727bbb530 FIX: when qty is not an integer, apply price() (#31138)
* FIX: when qty is not an integer, apply price() to avoid displaying precision errors if php.ini's precision settings are too high

* Apply eldy's suggestion to use price's parameters rather than a test
2024-09-26 18:41:41 +02:00
UltraViolet33
79edf0fb15 Fix delete commande fournisseur line linked to commandedet (#31136)
When a commande fournisseur line is deleted, the wrong commandedet.fk_commandefourndet was set to NULL
and the commande fournisseur line deletion was impossible if it was link to a commandet.

Co-authored-by: Ulysse Valdenaire <uvaldenaire@easya.solutions>
2024-09-26 17:18:27 +02:00
HENRY Florian
c0f5e314e1 fix: DOL_DATA_ROOT do not have last / by defaut, and last_main_doc not have first / (#31090) 2024-09-26 03:51:06 +02:00
Laurent Destailleur
e125ab4783 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-09-26 03:36:52 +02:00
Laurent Destailleur
a8cb076bbd Fix move 2024-09-26 03:34:32 +02:00
Laurent Destailleur
691f76d1e0 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-09-26 03:32:43 +02:00
Laurent Destailleur
4ea503f366 Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 17.0 2024-09-26 03:30:40 +02:00
Laurent Destailleur
65c9bd7dcf Merge remote-tracking branch 'origin/15.0' into 16.0 2024-09-26 03:25:38 +02:00
Laurent Destailleur
16a0d1d7d5 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2024-09-26 03:23:00 +02:00
thomas-Ngr
bb40a43c5f FIX Add same security test whe nuploading files from API than from GUI (#31114)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-09-26 03:13:34 +02:00
lvessiller-opendsi
e4a93da82e FIX mysql error during dump for enable sandbox M999999 (#31116) 2024-09-25 22:54:31 +02:00
MaximilienR-easya
6de574bf5c Fix a problem when we have an extrafield on the line (#31104) 2024-09-25 22:18:26 +02:00
Laurent Destailleur
2f773e9326 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2024-09-23 21:45:03 +02:00
Laurent Destailleur
1594afdef7 Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 17.0 2024-09-23 21:44:25 +02:00
Laurent Destailleur
ad154a368f Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into 16.0 2024-09-23 21:43:48 +02:00
Laurent Destailleur
171494ddfc Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0 2024-09-23 21:43:24 +02:00
William Mead
21d8c40fc0 Fixed select list for long third party names (#30948) 2024-09-23 03:55:18 +02:00
MaximilienR-easya
fd0338cb1c Backport Fix error on empty(NOLOGIN) (#30594)
* initial commit

* Backport Fix from develop

* Fix precommit

* Correction as sugested in the PR

* Deleted too much last commit

* this time it's good
2024-09-23 03:53:22 +02:00
HENRY Florian
61c5a61623 fix: better error reporting in CMailFile (#31058) 2024-09-20 17:46:52 +02:00
mrozniecki
bad8ee865d Fix title encode 2024-09-20 14:34:34 +02:00
Benjamin Falière
dcba3347d8 Retroport: FIX determine multi-currency price on object line create tpl (#28021) (#30535)
* NEW determine multi-currency price on object line create tpl (#28021)

* Update html.form.class.php

---------

Co-authored-by: lvessiller-opendsi <lvessiller@open-dsi.fr>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-09-18 03:22:38 +02:00
HENRY Florian
126dc77ef3 fix: add missing hook in propal and invoice (contact and document tabs) (#30518)
* add missing hook in propal contact and document

* add missing hook in propal contact and document

* add missing hook in propal and invoice (contact and document)

* add missing hook in propal and invoice (contact and document)

* add missing hook in propal and invoice (contact and document)

* review: change inithook place
2024-09-18 03:03:05 +02:00
MaximilienR-easya
f64a07861d Fix php8 change, '' != 0 since php8 (#30997)
* Fix php8 change, '' != 0 since php8

* Update dispatch.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-09-18 01:25:28 +02:00
mrozniecki
1ee3c5e5a0 Backport fix title 2024-09-13 12:08:58 +02:00
William Mead
1a81d7fc16 FIX late order search option (v18+) (#30692)
* Fixed search late order. Added search late order checkbox. Added contributor details.

* Removed late date alert checkbox
2024-09-13 04:14:41 +02:00
William Mead
4cd82df73c FIX late propal search option (v18+) (#30687)
* Fixed search late propal. Added search late propal checkbox.

* Removed late date alert checkbox
2024-09-13 04:07:24 +02:00
mrozniecki
0be0c1a1c1 Backport #yogosha18281 2024-09-10 14:01:04 +02:00
thomas-Ngr
9f5ef68123 fix replenish with multicurrency (#30832)
* fix replenish

* Use multicurrency supplier price instead of recomputing from EUR supplier price
2024-09-05 16:01:31 +02:00
atm-lena
66a175e48d langs of recipient 2024-01-22 14:52:51 +01:00
atm-lena
e24da32424 Load multilangs in function pdf_getlinedesc() 2024-01-16 14:13:28 +01:00
atm-lena
a13b720598 Merge branch '17.0' of https://github.com/Dolibarr/dolibarr into 17.0_FIX_MultilangsTranslationPDFLinesDescription 2024-01-16 14:08:52 +01:00
atm-lena
86971c7b86 Clean Conditions 2023-12-22 09:30:35 +01:00
atm-lena
daccab5a07 Merge branch '17.0' of https://github.com/Dolibarr/dolibarr into 17.0_FIX_MultilangsTranslationPDFLinesDescription 2023-12-22 09:22:38 +01:00
atm-lena
4d32d93ee2 Clean Travis 2023-12-18 17:28:41 +01:00
atm-lena
abc9eb7bdc Clean Code 2023-12-18 13:44:19 +01:00
atm-lena
ec19dcc8f8 Invoice 2023-12-18 13:34:50 +01:00
atm-lena
9051e411d0 FIX Multilangs : PDF lines description 2023-12-18 12:00:41 +01:00
250 changed files with 2624 additions and 1056 deletions

View File

@@ -0,0 +1,3 @@
# Add this tag for any changes for more than 1 line
"Pending analysis of PR (maintenance team)":
min: 1

86
.github/scripts/get_changed_php.sh vendored Executable file
View File

@@ -0,0 +1,86 @@
#!/bin/bash
# Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
set -euo pipefail
# This script retrieves the list of changed PHP files for a pull request
# using the GitHub API and sets two outputs:
# - any_changed: "true" if at least one PHP file changed, "false" otherwise
# - all_changed_files: space-separated list of changed PHP file paths
#
# Required environment variables:
# GITHUB_TOKEN - GitHub token with repo access
# GITHUB_REPOSITORY - "owner/repo"
# GITHUB_EVENT_PATH - Path to the event JSON payload
# Verify required environment variables are set
if [[ -z "${GITHUB_TOKEN:-}" ]]; then
echo "GITHUB_TOKEN is not set" >&2
exit 1
fi
if [[ -z "${GITHUB_REPOSITORY:-}" ]]; then
echo "GITHUB_REPOSITORY is not set" >&2
exit 1
fi
if [[ -z "${GITHUB_EVENT_PATH:-}" ]]; then
echo "GITHUB_EVENT_PATH is not set" >&2
exit 1
fi
# Extract the pull request number from the event payload
pr_number=$(jq --raw-output '.pull_request.number' "$GITHUB_EVENT_PATH")
if [[ "$pr_number" == "null" ]]; then
echo "Not a pull request event"
exit 0
fi
# Split repository into owner and repo name
# Split repository into owner and repo name using Bash parameter expansion
owner="${GITHUB_REPOSITORY%%/*}" # Extract text before the first '/'
repo="${GITHUB_REPOSITORY##*/}" # Extract text after the last '/'
page=1
per_page=100
changed_php_files=()
# Loop through all pages to gather changed files
while true; do
response=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
"https://api.github.com/repos/${owner}/${repo}/pulls/${pr_number}/files?per_page=${per_page}&page=${page}")
# Filter for files ending with .php and add them to the list
mapfile -t files < <(echo "$response" | jq -r '.[] | select(.filename | test("\\.php$")) | .filename')
changed_php_files+=("${files[@]}")
# Check if we have reached the last page (less than per_page results)
count=$(echo "$response" | jq 'length')
if (( count < per_page )); then
break
fi
((page++))
done
# Build a space-separated string of changed PHP files
# This does not cope with files that have spaces.
# But such files do not exist in the project (at least not for the
# files we are filtering).
all_changed_files=$(IFS=" " ; echo "${changed_php_files[*]}")
# Determine changed files flag
if [ -z "$all_changed_files" ]; then
any_changed="false"
else
any_changed="true"
fi
# Set outputs for GitHub Actions if GITHUB_OUTPUT is available
if [ -n "${GITHUB_OUTPUT:-}" ]; then
echo "any_changed=${any_changed}" >> "$GITHUB_OUTPUT"
echo "all_changed_files=${all_changed_files}" >> "$GITHUB_OUTPUT"
else
# Otherwise, print the outputs
echo "any_changed=${any_changed}"
echo "all_changed_files=${all_changed_files}"
fi

View File

@@ -0,0 +1,21 @@
name: "Set label for v18"
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- "18.0"
push:
branches:
- "18.0"
jobs:
changed-lines-count-labeler:
runs-on: ubuntu-latest
name: An action for automatically labelling pull requests based on the changed lines count
steps:
- name: Set a label
uses: vkirilichev/changed-lines-count-labeler@v0.2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/changed-lines-count-labeler.yml
continue-on-error: true

45
.github/workflows/pr-18.yaml.disabled vendored Normal file
View File

@@ -0,0 +1,45 @@
# Action to prepare the github action
# Go on Dolibarr - Settings - Developer settings - Enter a name + webhook to disable + Permissions (see app test) + Can install by any account
# Click on generate the private keys
# Click on Install application - choose user of the Organization
# Go on Organisation - Secret and variables and create a secret PR18_SECRET_KEY and copy the content of received private key. Choose the repository access to "Repository Dolibarr".
# Go on Organisation - Secret and variables and create a variable PR18_APP_ID and copy the ID of the previously create ID. Choose the repository access to "Repository Dolibarr".
#
name: Set reviewer for v18
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- "18.0"
push:
branches:
- "18.0"
jobs:
pr18:
runs-on: ubuntu-latest
#env:
# GH_TOKEN: ${{ github.token }}
# GH_TOKENS: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.PR18_APP_ID }}
private-key: ${{ secrets.PR18_SECRET_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Assign reviewer
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
url: ${{ github.event.pull_request.html_url }}
run: |
gh pr edit "$url" --add-reviewer rycks
gh pr edit "$url" --add-reviewer lvessiller-opendsi

View File

@@ -14,18 +14,18 @@ jobs:
run: sudo apt-get update && sudo apt-get install cppcheck
if: false
# Checkout git sources to analyze
- uses: actions/checkout@v4
# The next uses the git API because there is no clone yet.
# This is faster for a big repo.
- name: Get all changed php files (if PR)
id: changed-php
uses: tj-actions/changed-files@v42
if: github.event_name == 'pull_request'
with:
files: |
**.php
if: env.gh_event == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./.github/scripts/get_changed_php.sh
# Checkout git sources to analyze
- uses: actions/checkout@v4
# Action setup-python needs a requirements.txt or pyproject.toml
# This ensures one of them exists.
- name: Create requirements.txt if no requirements.txt or pyproject.toml
@@ -42,6 +42,21 @@ jobs:
with:
path: ~/.cache/pre-commit/
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Extract PHP version
id: extract-php-version
run: |
PHP_VERSION=$(sed -n 's/.*\$arrayphpmaxversionwarning\s*=\s*array\s*(\s*\([0-9]\+\)\s*,\s*\([0-9]\+\).*/\1.\2/p' htdocs/install/check.php)
echo "PHP_VERSION=$PHP_VERSION" >> $GITHUB_ENV
- name: Setup PHPCS
uses: shivammathur/setup-php@v2
# Install proper php version, and also install phpcs which may be needed
with:
php-version: ${{ env.PHP_VERSION }} # Version from check.php
coverage: none # disable xdebug, pcov
tools: phpcs
# Run all the precommit tools (defined into pre-commit-config.yaml).
# We can force exclusion of some of them here.
- name: Run pre-commit hooks
@@ -62,24 +77,6 @@ jobs:
# files: |
# **.php
- name: Setup PHPCS
uses: shivammathur/setup-php@v2
# Install when we're going to run phpcs
if: |
steps.changed-php.outputs.any_changed == 'true'
||
(
github.event_name == 'push'
&& (
github.event.ref == 'refs/heads/develop'
|| endsWith(github.event.ref, '.0')
)
)
with:
php-version: 8.1
coverage: none # disable xdebug, pcov
tools: phpcs
- name: Run some pre-commit hooks on selected changed files only
if: steps.changed-php.outputs.any_changed == 'true'
env:

View File

@@ -8,7 +8,7 @@ on:
types: [created]
workflow_dispatch:
permissions: {} # none
permissions: {} # no restriction by default
jobs:
stale:

28
.github/workflows/test.yaml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: Test github actions
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
push:
env:
ENVGHT: ${{ secrets.GITHUB_TOKEN }}
ENVGHU: ${{ github.token }}
TEST_ACCESS_KEY: ${{ secrets.TEST_ACCESS_KEY }}
TEST_VAR_REPO: ${{ vars.TEST_VAR_REPO }}
ENVLOCAL: "varenvlocal"
jobs:
testjob:
runs-on: ubuntu-latest
steps:
- name: Log
run: |
echo "Run action by ${{ github.actor }}"
echo "github.token=${{ github.token }}"
echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH"
echo "repo-token: ${{secrets.GITHUB_TOKEN}}"
echo "secret repository TEST_ACCESS_KEY: ${{secrets.TEST_ACCESS_KEY}}"
echo "variable repository : ${{vars.TEST_VAR_REPO}}"
echo "ENVLOCAL: ${{env.ENVLOCAL}}"

View File

@@ -6,7 +6,7 @@ repos:
rev: v4.5.0
hooks:
- id: no-commit-to-branch
args: [--branch, develop, --pattern, \d+.0]
args: [--branch, develop, --pattern, \d+.0$]
- id: check-yaml
args: [--unsafe]
- id: check-json
@@ -81,6 +81,8 @@ repos:
]
pass_filenames: false # Run on all files
- id: php-lint
exclude:
(?x)^(htdocs/includes/symfony/var-dumper/Tests/.*)$
- id: php-stan
stages: [manual]
files: \.(php)$

View File

@@ -2,9 +2,9 @@
# from Dolibarr GitHub repository.
# For syntax, see https://docs.travis-ci.com/user/languages/php/
# We use dist: bionic = 18.04, focal = 20.04
# We use dist: focal = 20.04, jammy = 22.04
os: linux
dist: focal
dist: jammy
language: generic
@@ -21,7 +21,7 @@ services:
addons:
mariadb: '10.5'
mariadb: '10.6'
env:
@@ -123,7 +123,8 @@ install:
sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
sudo chmod -R a+rwx /usr/local/bin/composer
composer -V
composer -n config -g vendor-dir htdocs/includes
sudo composer -n config -g vendor-dir htdocs/includes
sudo chmod -R a+rwx /home/travis/.config/composer
echo
- |
@@ -193,8 +194,8 @@ before_script:
phpcs -i | head -
# Check PHP Vardump check version
echo "PHP Vardump check version"
which var_dump_check
var_dump_check --version
which var-dump-check
var-dump-check --version
# Check PHPUnit version
echo "PHPUnit version"
which phpunit

209
ChangeLog
View File

@@ -2,6 +2,205 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 18.0.7 compared to 18.0.6 *****
138 files changed, 1622 insertions(+), 530 deletions(-)
FIX: 17.0 API endpoints "PUT": prevent overwriting all extrafields if only some are supplied in the request cf. PR #29237
FIX: 17.0 - collisions in cache for dol_getIdFromCode
FIX: 17.0 - missing error handling for FactureRec::fetch in card-rec.php
FIX: 17.0: warnings due to uninitialized variables + delete code that doesn't apply to recurring invoices (AFAIK, there is no recurring credit note feature)
FIX: #21294 Stock import sql query
FIX: #26250 fatal error on kit
FIX: #32339 Delete a loan settlement is partial
FIX: #33038 drag and drop files are not prefixed with object reference
FIX: #33117 accountancy export Quadratus when doc ref is less than 10 char
FIX: #33145 wrong label status buy on product tooltip
FIX: accountancy export Quadratus when doc ref is less than 10 char
FIX: bad dispatched quantities for batches on shipment card
FIX: bank payment rejection on SEPA (backport commit 100a657) (#33838)
FIX: calculate start date of cloned task from cloned project (#31799)
FIX: can not delete files in task card
FIX: close all services on contract will close all lines (#33466)
FIX: compatibility with multicompany
FIX: constant PAYMENTBYBANKTRANSFER_ADDDAYS was never saved (#33799)
FIX: Count on supplier invoice list does not match count in DB (#33351)
FIX: #CVE-2024-34051
FIX: delete supplier order line when linked to customer order line
FIX: delete supplier order when at least one line linked to customer order line
FIX: display error when loan can't be deleted
FIX: display full tree on shipment card when a kit contains a same component in other sub-kit
FIX: Fix case when the value of a extrafields of the type 'boolean', 'select' or other have an option with a value equal to '0'.
FIX: Fix return value of hook sendMail when hook return -1 who must be return false in sendfile() function
FIX: GETPOST('private_message')
FIX: in projet/element.php total_time is always back to 0
FIX: invoice creation : use dol_include_once instead of require_once to allow external modules
FIX: invoice creation : use dol_include_once instead of require_once to allow external modules.
FIX: issue #28222 Edit date extrafield displayed on all on lines (#31914)
FIX: Many status on invoice linked object block
FIX: Multilangs : PDF lines description
FIX: ODT substitution when many HTML tags in string
FIX: old copy not needed in supplier order create method (#31733)
FIX: PAIEMENT Wrong field displayed for DateChequeReceived (#33390)
FIX: phpcs
FIX: product variants copy: also copy multiprice variations
FIX: qual
FIX: removes traces of <<<HEAD conflicts following the postponement of branch 13 modifications (#32014)
FIX: Replace compromised tj-actions/changed-files (#33481)
FIX: selectcontact is loading all contacts if socid is empty and MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT is not set
FIX: selectcontact is loading all contacts when update event
FIX: select group and severity search fields on ticket list
FIX: send email to assigned user on ticket create
FIX: send mail to BCC when email formatted as Fullname <email> (#31983)
FIX: Show true error when send notify email at validate expense report
FIX: status ticket update for new message
FIX: swiftmailer: correctly set errors-to header (#31826)
FIX: TakePos barcode rule (#31857)
FIX: There were many status indicator in the invoice linked object block (propal card)
FIX(ticket): Notification email without public interface
FIX: Update on a sold line of bank entries set the type to empty, now it's fixed #22539 (#31888)
FIX: update status on create supplier order for trigger (#31642)
FIX: use tax with code on supplier order line give tax code missing in supplier invoice (#32018)
FIX: use vat with code on supplier order result code missing in supplier invoice
FIX: warehouse list: broken status filter (#33667)
FIX: warnings (#33423)
FIX: wrong left margin (v18 to develop ?)
FIX: wrong message on update shipment
FIX: wrong update function parameter
***** ChangeLog for 18.0.6 compared to 18.0.5 *****
FIX: 16.0 - parent company gets emptied when updating a third party from the card in edit mode (#28269)
FIX: 16.0 - the e-mail templates configured in the notification module are not used if the recipient is a fixed e-mail address (#29407)
FIX: 17.0: $num doesn't take trigger-modified newref into account, leading to inconsistencies if BILL_SUPPLIER_VALIDATE changes the invoice's ref (#28684)
FIX: 17.0: fatal when updating recurring supplier invoice line with php8 ($remise_percent is '' instead of 0) (#31713)
FIX: 17.0: supplier invoice template card: buyer and seller swapped in VAT-related function calls (probably a copy-paste from customer invoice templates) (#31446)
FIX: #24265 regression cannot see all product on takepos (#28753)
FIX: #25853 Thirdparty Massaction (#25868)
FIX: #28205
FIX: #28251 Fixing subpermission name on api_multicurrencies.class.php (#28252)
FIX: #28369
FIX: #28518 (#28520)
FIX: #28978 FIX: #28976
FIX: #29029 Impossible to delete an order line
FIX: #29114 Missing contact term in intervention
FIX: #29114 Translate contact term in intervention
FIX: #29439 incomplete API return (#29796)
FIX: #29496 filtering a record should not hide its child not filtered
FIX: #30010 Use conf TICKET_MESSAGE_MAIL_INTRO instead of translation key (#30081)
FIX: #30274 Add the include before executing dolibarr_set_const (#30320)
FIX: #30467
FIX: #30768 allocate the correct invoice_line_id to the element timespent (#30769)
FIX: Accountancy export with file or not
FIX: Accountancy - Generate entries of expense report with localtax (#30411)
FIX: Accountancy - Not trunc id_import
FIX: accounting FEC import (Issue #28306) (#29414)
FIX: Add new hidden conf "DISABLE_QTY_OVERWRITTEN" (#28523)
FIX: Add same security test when uploading files from API than from GUI (#31114)
FIX: Amount of localtaxes in foreign currency was wrong on screen and PDF
FIX: an error in a complex else condition
FIX: ASSET: annual depreciation starting year (Again ;-)) #26084 (#30040)
FIX: avoid error "Column 'entity' in where clause is ambiguous" (#28270)
FIX: avoid from re-initializing array result on nested hook getEntity (#30626)
FIX: avoid php warnings (#29247)
FIX: avoid to delete "lock" and "unlock" files
FIX: avoid Unknown column 'pfp.ref_fourn' (#28145)
FIX: background color for enabled modules (#29378)
FIX: Backport fix fatal error on price with some truncating setup
FIX: Backport page inventory.php from v18 to fix pagination bugs causing data loss (#29688)
FIX: back to page on error in contact card (#29627)
FIX: Bad calculation of $nbtotalofrecord (#30183)
FIX: box_actions.php still uses fk_user_done which no longer exists (#31190)
FIX: can validate shipment without stock movement (#31780)
FIX: Condition on newDateLimReglement
FIX: Conflict with autoload (#30399)
FIX: const WORKFLOW_RECEPTION_CLASSIFY_NEWD_INVOICE (#31601)
FIX: contact/address title is always "New Contact/Address" even if the contact/address already exists (#29581)
FIX: Display the date according to user language on substitutions (#29510)
FIX: Display the real_PMP on inventory when its value is equal to 0 (#22291)
FIX: Don't display column when it's out of date (#28271)
FIX: email templates for expense report not visible
FIX: Error mesg show untranslated extrafield name (#30227)
FIX: Error message overwrote when a error occurs during update of product multilangs (#30841)
FIX: Error When cloning fourn price no default value for tva_tx (#28368)
FIX: executeHooks $object default value (#29647)
FIX: expedition PDF models using units labels (#30358)
FIX: Extrafield following between rec invoice and classic invoice (#31445)
FIX: fatal error on loading pictures in attached documents of an event (#30553)
FIX: fatal error Unsupported operand types when recording load payment
FIX: Fix bug select columns and access to the public ticket list from the public ticket card (case when we have connected to another client before, the track id stocked in session overwrite the new track id from the public ticket card) (#31000)
FIX: Fix create shipping with product who have negative stocks on warehouse but the negative stock transfer is allowed (#26217)
FIX: Fix save directory for invoice ODT and multientities
FIX: group by qty in product margin tab (#29853)
FIX: Hierarchy Employee view do not filter on employee = 1 (#29496)
FIX: if you call fetchLines several times, your $object->lines contains duplicates (#31167)
FIX: If you have no stock of your product, an error is displayed when you delete the reception. (#31504)
FIX: incorrect page numbering in PDF #29458 (#29476)
FIX: inventoryDeletePermission id define twice
FIX: issue on action set condition in particular when you set a deposi… (#31518)
FIX: issue to get the right files exported in Quadratrus export.php (#30004)
FIX: lang output for sales representative on PDF (#30469)
FIX: late order search option (#30692) and propal (#30687)
FIX: lettering (auto) for invoice deposit with company discount (#29633)
FIX: made invalid code shape error more user friendly (#29498)
FIX: Merge of thirdparties must also move uploaded files
FIX: missing entity parameter for ajax_constantonoff
FIX: missing hide "new" button where "product" or "service" module are disable
FIX: mo cloning (#29686)
FIX: modification date from label in accounting bookkeeping list (#30038)
FIX: Move the trigger for delete order line before the SQL request
FIX: multiple problems with multicompany
FIX: mysql error during dump for enable sandbox M999999 (#31116)
FIX: notification: error 500 in fixed emails due to a bad copy/paste (#29580)
FIX: notification module: for supplier orders (any of the 3 triggers), user can choose an e-mail template in conf, but the conf is not used when sending the notification (#28216)
FIX: Not qualified lines for reception (#29473)
FIX: not redirect when error occurs on updating card (#29388)
FIX: Not trancate the multicurrency rate shown on cards (even if the global MAIN_MAX_DECIMALS_SHOWN is set to 0) (#28211)
FIX: on change ref for bank account attachment are lost (#30529)
FIX: Option MAIN_DOC_USE_TIMING can be a string with date format
FIX: orders to bill menu (#30179)
FIX: Payment on customer invoice - Remove accountid in url if empty for apply default value (#28156)
FIX: PDF Fatal error : Backport fix from #23972
FIX: PDF Translations Extrafields
FIX: permission on payment file of a tax
FIX: php8: Fatal when empty $tmpvat is an empty string (no silent conversion to '0' when used in arithmetic operations) (#29451)
FIX: PHP 8 warning on output of successful cronjob (#29922)
FIX: PHP exception on getSpecialCode (#29646)
FIX: php warning global conf (#29478)
FIX: pos: invoice date incorrectly set because of timezome mismatches (reverts #36e91da) (#30184)
FIX: public project form return an error if SOCIETE_EMAIL_UNIQUE (#29942)
FIX: purge files cron: php warnings when rest module enabled (#30919)
FIX: PUT /thirdparties/{id} and PUT /contacts/{id} should throw exception if update returns < 0 (#29596)
FIX: Regression #29340
FIX: Repair the replenishment list (#29336)
FIX: REPLENISH MANY FOURN WHEN ORDER ALREADY CREATE (#29710)
FIX: round capital societe (#29211)
FIX: search and add extrafields to tasks when conf disabled (#29542)
FIX: show preview pdf list expensereport (#31694)
FIX: sometimes a string type instead integer is return, why ?
FIX: Special code is now transmitted by args only in order supplier (#28546) (#28619)
FIX: SQL syntax error in DDLUpdateField
FIX: subscription must be editable when accounting isn't reconciled (#28469)
FIX: substitutions THIRDPARTY_XXX are not available for actioncomm reminders (#31385)
FIX: Supplier Order search on date valid (#30448)
FIX: supplier price duplicate entry on update supplier product ref (#29290)
FIX: syntax error
FIX: TakePOS | Add product / Delete line of existing invoice
FIX: Ticket new message notification sent twice
FIX: transfer in accountancy for expense reports.
FIX: Unsigned propal having signing date (#29825)
FIX: Update asset.class.php
FIX: update date_echeance of supplier invoices when we update invoice date in the past (#29886)
FIX: use $conf->browser->os instead
FIX: use price() to display qty on a product's stats tab to avoid showing too many decimals when rounding errors are possible (#31165)
FIX: User List - Function is show in wrong column when module HRM enabled (#30186)
fix: when invoice is created by WORKFLOW_ORDER_AUTOCREATE_INVOICE on ORDER_NEW, the invoice must have the default bank account of the thirdparty is it's empty on order (#29462)
FIX: when qty is not an integer, apply price() (#31138)
FIX: Wrong currency shown in TakePOS payment page
FIX: wrong shortcut key for macintosh
FIX: wrong sql request with product category filter
FIX: wrong stock permission number
***** ChangeLog for 18.0.5 compared to 18.0.4 *****
FIX: 17.0: deprecated field should only be a fallback
FIX: 17.0 - php8 warnings: test for $field existence before checking if it is null or empty
@@ -366,7 +565,7 @@ NEW: No overwrite of optionals during put() contact
NEW: Notifications: add Customer Order delivered (ORDER_NEW) in module Notification
NEW: Notifications: for Sign or Refused Propal from Online Page
NEW: Now we can edit amount on VAT and salaries clone action
NEW: only get openned contact from liste_contact function, to not have acces to closed contact as mail receiver
NEW: only get open contact from liste_contact function, to not have access to closed contact as mail receiver
NEW: Option to manage deposit slips for more payment modes (not only
NEW: Option to show column for field and line selection on the left
NEW: Orders: add sub total in order list det
@@ -2611,7 +2810,7 @@ NEW: add quick dropdown menu in top right menu (experimental with MAIN_USE_TOP_M
NEW: add region in export companies and contacts
NEW: add rights on margin info on invoice list
NEW: add search param for close date on order list
NEW: add show preview for mail attachement on form mail
NEW: add show preview for mail attachment on form mail
NEW: add State/Province origin for products
NEW: add the workflow interaction close intervention on closing ticket
NEW: add tracking number in list and search_all items
@@ -3996,7 +4195,7 @@ FIX: access to public interface when origin email has an alias.
FIX: Alias name is not into the email recipient label.
FIX: allow standalone credit note even if no invoice
FIX: an admin can not access his own permissions after enabling advanced permissions
FIX: Attachement of linked files on ticket when sending a message
FIX: Attachment of linked files on ticket when sending a message
FIX: avoid non numeric warning
FIX: Bad currency var used in stripe for connect
FIX: Bad list of ticket on public interface for ticket emailcollector
@@ -4792,7 +4991,7 @@ NEW: hidden option to define an invoice template for each invoice type
NEW: Highlight lines on lists when they are checked
NEW: Notification module support expense report+holiday validation and approval
NEW: On customer/supplier card, add simple tooltip to amount boxes
NEW: Page to check if the operations/items created between two dates have attached item(s) and possibility to download all attachements
NEW: Page to check if the operations/items created between two dates have attached item(s) and possibility to download all attachments
NEW: possibility to add all rights of all modules in one time
NEW: redirect if only one result on global search on card
NEW: Permission to ignore price min
@@ -6236,7 +6435,7 @@ NEW: No external check of version without explicit click in about page.
NEW: ODT docs for USER USERGROUP CONTRACT and PRODUCT class
NEW: odt usergroup
NEW: On invoices generated by template, we save if invoice come from a source template.
NEW: option to copy into attachement files of events, files send by mail (with auto event creation)
NEW: option to copy into attachment files of events, files send by mail (with auto event creation)
NEW: PDF with numbertoword
NEW: Permit multiple file upload in linked documents
NEW: PHP 7.1 compatibility

View File

@@ -4,7 +4,7 @@
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
# \author (c)2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
#
# This is list of constant you can set to have generated packages moved into a specific dir:
# This is list of constant you can set to have generated packages moved into a specific dir:
#DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'
#DESTISTABLE='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/stable'
#DESTIMODULES='/media/HDDATA1_LD/Mes Sites/Web/Admin1/wwwroot/files/modules'
@@ -18,10 +18,12 @@ use Term::ANSIColor;
# Change this to defined target for option 98 and 99
$PROJECT="dolibarr";
$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/dolibarr_documents/website/www.dolibarr.org/files";
$PUBLISHBETARC="$ENV{'DESTIASSOLOGIN'}\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/dolibarr_documents/website/www.dolibarr.org/files";
$PUBLISHSTABLE="$ENV{'DESTISFLOGIN'}\@frs.sourceforge.net:/home/frs/project/dolibarr";
# due to implicit origin on git commands, example
# implicit origin, lionel upstream, eric dolibarr
$GITREMOTENAME="$ENV{'GITREMOTENAME'}";
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
%REQUIREMENTPUBLISH=(
@@ -36,7 +38,7 @@ $PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/
"RPM_FEDORA"=>"rpmbuild",
"RPM_MANDRIVA"=>"rpmbuild",
"RPM_OPENSUSE"=>"rpmbuild",
"DEB"=>"dpkg dpatch",
"DEB"=>"dpkg",
"FLATPACK"=>"flatpack",
"EXEDOLIWAMP"=>"ISCC.exe",
"SNAPSHOT"=>"tar"
@@ -98,6 +100,13 @@ if (! -d $ENV{"DESTIBETARC"} || ! -d $ENV{"DESTISTABLE"})
exit 1;
}
if (! $ENV{"GITREMOTENAME"})
{
print "Error: environment variable GITREMOTENAME does not exist. You can set it to 'origin' or any other git remote name.\n";
print "$PROG.$Extension aborted.\n";
sleep 2;
exit 1;
}
# Detect OS type
# --------------
if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS='linux'; $CR=''; }
@@ -129,7 +138,7 @@ if (! $TEMP || ! -d $TEMP) {
print "$PROG.$Extension aborted.\n";
sleep 2;
exit 2;
}
}
$BUILDROOT="$TEMP/buildroot";
@@ -172,7 +181,7 @@ $newbuild = $BUILD;
$newbuild =~ s/(dev|alpha)/1/gi; # dev
$newbuild =~ s/beta(.?)/2/gi; # beta (we want beta1, beta2, betax to be same package name)
$newbuild =~ s/rc(.?)/3/gi; # rc (we want rc1, rc2, rcx to be same package name)
if ($newbuild !~ /-/) { $newbuild.='-4'; } # finale is same than rc.
if ($newbuild !~ /-/) { $newbuild.='-4'; } # finale is same than rc.
# now newbuild is 0-1 or 0-4 for example. Note that for native package (see debian/source/format), we should not use a dash part but to get a better version management
$build = $newbuild;
$build =~ s/-.*$//g;
@@ -190,8 +199,8 @@ for (0..@ARGV-1) {
if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; $batch=1; }
if ($ARGV[$_] =~ /^-*desti=(.+)/i) { $DESTI=$1; }
if ($ARGV[$_] =~ /^-*prefix=(.+)/i) {
$PREFIX=$1;
$FILENAMESNAPSHOT.="-".$PREFIX;
$PREFIX=$1;
$FILENAMESNAPSHOT.="-".$PREFIX;
}
}
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTIBETARC is defined
@@ -210,7 +219,7 @@ print "Target directory (DESTI) : $DESTI\n";
# Choose package targets
#-----------------------
if ($target) {
if ($target eq "ALL") {
if ($target eq "ALL") {
foreach my $key (@LISTETARGET) {
if ($key ne 'SNAPSHOT' && $key ne 'SF' && $key ne 'ASSO') { $CHOOSEDTARGET{$key}=1; }
}
@@ -236,10 +245,10 @@ else {
printf(" %2d - %-14s (%s)\n",$cpt,"ASSO (publish)","Need ".$REQUIREMENTPUBLISH{"ASSO"});
$cpt=99;
printf(" %2d - %-14s (%s)\n",$cpt,"SF (publish)","Need ".$REQUIREMENTPUBLISH{"SF"});
# Ask which target to build
print "Choose one target number or several separated with space (0 - ".$cpt."): ";
$NUM_SCRIPT=<STDIN>;
$NUM_SCRIPT=<STDIN>;
chomp($NUM_SCRIPT);
if ($NUM_SCRIPT !~ /^[0-9\s]+$/)
{
@@ -286,11 +295,11 @@ foreach my $target (sort keys %CHOOSEDTARGET) {
print "Error: You asked creation of several rpms. Because all rpm have same name, you must defined an environment variable DESTI to tell packager where it can create subdirs for each generated package.\n";
exit;
}
$atleastonerpm=1;
}
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target}))
$atleastonerpm=1;
}
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target}))
{
# Test
# Test
print "Test requirement for target $target: Search '$req'... ";
$newreq=$req; $newparam='';
if ($newreq eq 'zip') { $newparam.='-h'; }
@@ -299,12 +308,12 @@ foreach my $target (sort keys %CHOOSEDTARGET) {
print "Test command ".$cmd."... ";
$ret=`$cmd`;
$coderetour=$?; $coderetour2=$coderetour>>8;
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) {
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) {
# Not found error, we try in PROGPATH
$ret=`"$PROGPATH/$ALTERNATEPATH{$req}/$req\" 2>&1`;
$coderetour=$?; $coderetour2=$coderetour>>8;
$REQUIREMENTTARGET{$target}="$PROGPATH/$ALTERNATEPATH{$req}/$req";
}
}
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/))) {
# Not found error
@@ -333,7 +342,7 @@ $nbofpublishneedchangelog=0;
foreach my $target (sort keys %CHOOSEDTARGET) {
if ($target eq '-CHKSUM') { $nbofpublishneedchangelog++; }
if ($CHOOSEDTARGET{$target} < 0) { next; }
if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP' && $target ne '-CHKSUM')
if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP' && $target ne '-CHKSUM')
{
$nboftargetneedbuildroot++;
}
@@ -397,10 +406,10 @@ if ($nboftargetok) {
print "Go to directory $SOURCE\n";
$olddir=getcwd();
chdir("$SOURCE");
print "Clean $SOURCE/htdocs/includes/autoload.php\n";
$ret=`rm -f $SOURCE/htdocs/includes/autoload.php`;
$ret=`git ls-files . --exclude-standard --others`;
if ($ret)
{
@@ -409,12 +418,16 @@ if ($nboftargetok) {
print "Canceled.\n";
exit;
}
print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filelist_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n";
$ret=`php $SOURCE/build/generate_filelist_xml.php release=$MAJOR.$MINOR.$BUILD`;
print $ret."\n";
# Copy to final dir
$NEWDESTI=$DESTI;
if ( !-d "$NEWDESTI/signatures" ) {
use File::Path qw( make_path );
make_path "$NEWDESTI/signatures" or die "Failed to create path: $NEWDESTI/signatures";
}
print "Copy \"$SOURCE/htdocs/install/filelist-$MAJOR.$MINOR.$BUILD.xml\" to $NEWDESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml\n";
use File::Copy qw(copy);
copy "$SOURCE/htdocs/install/filelist-$MAJOR.$MINOR.$BUILD.xml", "$NEWDESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml";
@@ -427,32 +440,32 @@ if ($nboftargetok) {
print "Go to directory $SOURCE\n";
$olddir=getcwd();
chdir("$SOURCE");
print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
$ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`;
if ($ret =~ /(already exists|existe déjà)/)
{
print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? ";
$QUESTIONOVERWRITETAG=<STDIN>;
$QUESTIONOVERWRITETAG=<STDIN>;
chomp($QUESTIONOVERWRITETAG);
if ($QUESTIONOVERWRITETAG =~ /(o|y)/)
{
print 'Run git tag -a -f -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
print 'Run git push -f --tags'."\n";
$ret=`git push -f --tags`;
print 'Run git push $GITREMOTENAME -f --tags'."\n";
$ret=`git push $GITREMOTENAME -f --tags`;
#$ret=`git push -f origin "$MAJOR.$MINOR.$BUILD"`;
}
}
else
{
print 'Run git push --tags'."\n";
$ret=`git push --tags`;
print 'Run git push $GITREMOTENAME --tags'."\n";
$ret=`git push $GITREMOTENAME --tags`;
#$ret=`git push origin "$MAJOR.$MINOR.$BUILD"`;
}
chdir("$olddir");
}
# Update buildroot if required
#-----------------------------
if ($nboftargetneedbuildroot)
@@ -462,7 +475,7 @@ if ($nboftargetok) {
print "Delete directory $BUILDROOT\n";
$ret=`rm -fr "$BUILDROOT"`;
mkdir "$BUILDROOT";
mkdir "$BUILDROOT/$PROJECT";
print "Copy $SOURCE into $BUILDROOT/$PROJECT\n";
@@ -488,7 +501,7 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/phpstan.neon`;
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
$ret=`rm -f $BUILDROOT/$PROJECT/README-*.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/Doli*-*`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`;
@@ -555,20 +568,20 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot11.png`;
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`;
# Security to avoid to package data files
# Security to avoid to package data files
print "Remove documents dir\n";
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
print "Remove subdir of custom dir\n";
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files
# Removed known external modules to avoid any error when packaging from env where external modules are tested
# Removed known external modules to avoid any error when packaging from env where external modules are tested
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/abricot*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/accountingexport*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/allscreens*`;
@@ -593,15 +606,15 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/webmail*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/common/fontawesome-5/svgs`;
# Removed other test files
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
# Removed files installed by the awful composer
# Removed files installed by the awful composer
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/bin`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
@@ -640,14 +653,14 @@ if ($nboftargetok) {
# Build package for each target
#------------------------------
foreach my $target (sort keys %CHOOSEDTARGET)
foreach my $target (sort keys %CHOOSEDTARGET)
{
if ($CHOOSEDTARGET{$target} < 0) { next; }
if ($target eq '-CHKSUM') { next; }
print "\nBuild package for target $target\n";
if ($target eq 'SNAPSHOT')
if ($target eq 'SNAPSHOT')
{
$NEWDESTI=$DESTI;
@@ -671,13 +684,13 @@ if ($nboftargetok) {
next;
}
if ($target eq 'TGZ')
if ($target eq 'TGZ')
{
$NEWDESTI=$DESTI;
if ($NEWDESTI =~ /stable/)
{
mkdir($DESTI.'/standard');
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
}
print "Remove target $FILENAMETGZ.tgz...\n";
@@ -691,7 +704,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ/build/exe`;
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages
print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n";
$cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMETGZ.tgz\" $FILENAMETGZ";
print "$cmd\n";
@@ -703,14 +716,14 @@ if ($nboftargetok) {
next;
}
if ($target eq 'XZ')
if ($target eq 'XZ')
{
$NEWDESTI=$DESTI;
if ($NEWDESTI =~ /stable/)
{
mkdir($DESTI.'/standard');
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
}
}
print "Remove target $FILENAMEXZ.xz...\n";
unlink("$NEWDESTI/$FILENAMEXZ.xz");
@@ -723,7 +736,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$FILENAMEXZ/build/exe`;
$ret=`rm -fr $BUILDROOT/$FILENAMEXZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages
print "Compress $FILENAMEXZ into $FILENAMEXZ.xz...\n";
print "Go to directory $BUILDROOT\n";
@@ -739,15 +752,15 @@ if ($nboftargetok) {
$ret=`mv "$BUILDROOT/$FILENAMEXZ.xz" "$NEWDESTI/$FILENAMEXZ.xz"`;
next;
}
if ($target eq 'ZIP')
if ($target eq 'ZIP')
{
$NEWDESTI=$DESTI;
if ($NEWDESTI =~ /stable/)
{
mkdir($DESTI.'/standard');
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
}
}
print "Remove target $FILENAMEZIP.zip...\n";
unlink("$NEWDESTI/$FILENAMEZIP.zip");
@@ -770,14 +783,14 @@ if ($nboftargetok) {
print $cmd."\n";
$ret= `$cmd`;
chdir("$olddir");
# Move to final dir
print "Move $FILENAMEZIP.zip to $NEWDESTI/$FILENAMEZIP.zip\n";
$ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$NEWDESTI/$FILENAMEZIP.zip"`;
next;
}
if ($target =~ /RPM/) # Linux only
if ($target =~ /RPM/) # Linux only
{
$NEWDESTI=$DESTI;
$subdir="package_rpm_generic";
@@ -788,7 +801,7 @@ if ($nboftargetok) {
{
mkdir($DESTI.'/'.$subdir);
if (-d $DESTI.'/'.$subdir) { $NEWDESTI=$DESTI.'/'.$subdir; }
}
}
if ($RPMDIR eq "") { $RPMDIR=$ENV{'HOME'}."/rpmbuild"; }
@@ -801,7 +814,7 @@ if ($nboftargetok) {
print "Create directory $BUILDROOT/$FILENAMETGZ2\n";
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`;
print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2\n";
$cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'";
$ret=`$cmd`;
@@ -827,7 +840,7 @@ if ($nboftargetok) {
if ($target =~ /FEDO/i) { $BUILDFICSRC="${FILENAME}_fedora.spec"; }
if ($target =~ /MAND/i) { $BUILDFICSRC="${FILENAME}_mandriva.spec"; }
if ($target =~ /OPEN/i) { $BUILDFICSRC="${FILENAME}_opensuse.spec"; }
use Date::Language;
$lang=Date::Language->new('English');
$datestring = $lang->time2str("%a %b %e %Y", time);
@@ -845,7 +858,7 @@ if ($nboftargetok) {
}
close SPECFROM;
close SPECTO;
print "Copy patch file to $RPMDIR/SOURCES\n";
$ret=`cp "$SOURCE/build/rpm/dolibarr-forrpm.patch" "$RPMDIR/SOURCES"`;
$ret=`chmod 644 $RPMDIR/SOURCES/dolibarr-forrpm.patch`;
@@ -867,14 +880,14 @@ if ($nboftargetok) {
next;
}
if ($target eq 'DEB')
if ($target eq 'DEB')
{
$NEWDESTI=$DESTI;
if ($NEWDESTI =~ /stable/)
{
mkdir($DESTI.'/package_debian-ubuntu');
if (-d $DESTI.'/package_debian-ubuntu') { $NEWDESTI=$DESTI.'/package_debian-ubuntu'; }
}
}
$olddir=getcwd();
@@ -955,13 +968,18 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/jquery/plugins/select2/LICENSE`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mike42/escpos-php/LICENSE.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mobiledetect/mobiledetectlib/LICENSE.txt`;
# Removed files we don't need (already removed)
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/_source`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/.codeclimate.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/.pre-commit-config.yaml`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/.vscode`;
$ret=`find $BUILDROOT/$PROJECT.tmp/ -type f -name '.editorconfig' -exec rm {} \\;`;
$ret=`find $BUILDROOT/$PROJECT.tmp/ -type f -name '.travis.yml' -exec rm {} \\;`;
# Rename upstream changelog to match debian rules
$ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`;
# Prepare source package (init debian dir)
print "Create directory $BUILDROOT/$PROJECT.tmp/debian\n";
$ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`;
@@ -999,7 +1017,7 @@ if ($nboftargetok) {
$ret=`cp -f "$SOURCE/build/debian/dolibarr.postrm" "$BUILDROOT/$PROJECT.tmp/debian"`;
$ret=`cp -f "$SOURCE/build/debian/dolibarr.templates" "$BUILDROOT/$PROJECT.tmp/debian"`;
$ret=`cp -f "$SOURCE/build/debian/install.forced.php.install" "$BUILDROOT/$PROJECT.tmp/debian"`;
# Set owners and permissions
#print "Set owners on files/dir\n";
#$ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`;
@@ -1030,8 +1048,8 @@ if ($nboftargetok) {
$ret=`$cmd`;
$cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.sh' -type f -exec chmod 755 {} \\; ";
$ret=`$cmd`;
print "Rename directory $BUILDROOT/$PROJECT.tmp into $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";
$cmd="mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
$ret=`$cmd`;
@@ -1039,14 +1057,14 @@ if ($nboftargetok) {
print "Go into directory $BUILDROOT\n";
chdir("$BUILDROOT");
# We need a tarball to be able to build "quilt" debian package (not required for native but we need patch so it is not a native)
print "Compress $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build into $BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz...\n";
$cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz\" $PROJECT-$MAJOR.$MINOR.$build";
print $cmd."\n";
$ret=`$cmd`;
# Creation of source package
# Creation of source package
print "Go into directory $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";
chdir("$BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build");
#$cmd="dpkg-source -b $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
@@ -1065,12 +1083,12 @@ if ($nboftargetok) {
$ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`;
#$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; # xz file is generated when build/debian/sources/option
#$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; # xz file is generated when build/debian/sources/option
$ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`;
next;
}
if ($target eq 'EXEDOLIWAMP')
{
$NEWDESTI=$DESTI;
@@ -1078,22 +1096,22 @@ if ($nboftargetok) {
{
mkdir($DESTI.'/package_windows');
if (-d $DESTI.'/package_windows') { $NEWDESTI=$DESTI.'/package_windows'; }
}
}
print "Remove target $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe...\n";
unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe";
if ($OS eq 'windows') {
print "Check that ISCC.exe is in your PATH.\n";
} else {
print "Check that in your Wine setup, you have created a Z: drive that point to your / directory.\n";
}
$SOURCEBACK=$SOURCE;
$SOURCEBACK =~ s/\//\\/g;
print "Prepare file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" from \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\"\n";
#$ret=`cat "$SOURCE/build/exe/doliwamp/doliwamp.iss" | sed -e 's/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g' > "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;
open(IN, '<' . $SOURCE."/build/exe/doliwamp/doliwamp.iss") or die $!;
open(OUT, '>' . "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss") or die $!;
@@ -1106,7 +1124,7 @@ if ($nboftargetok) {
close(OUT);
print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" on OS $OS\n";
if ($OS eq 'windows') {
$cmd= "ISCC.exe \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"";
} else {
@@ -1120,26 +1138,26 @@ if ($nboftargetok) {
print "Move \"$SOURCE\\build\\$FILENAMEEXEDOLIWAMP.exe\" to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
rename("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe","$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe");
print "Move $SOURCE/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
use File::Copy;
#$ret=`mv "$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`;
$ret=move("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe", "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe");
print "Remove tmp file $SOURCE/build/exe/doliwamp/doliwamp.tmp.iss\n";
#$ret=`rm "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;
$ret=unlink("$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss");
next;
}
}
# Publish package for each target
#--------------------------------
foreach my $target (sort keys %CHOOSEDPUBLISH)
foreach my $target (sort keys %CHOOSEDPUBLISH)
{
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
print "\nList of files to publish (BUILD=$BUILD)\n";
%filestoscansf=(
"$DESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml"=>'none', # none means it won't be published on SF
@@ -1162,7 +1180,8 @@ if ($nboftargetok) {
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'package_debian-ubuntu',
#"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows',
"$DESTI/standard/$FILENAMETGZ.tgz"=>'standard',
@@ -1197,26 +1216,26 @@ if ($nboftargetok) {
print "\n";
}
if ($target eq 'SF' || $target eq 'ASSO')
if ($target eq 'SF' || $target eq 'ASSO')
{
print "\n";
if ($target eq 'SF') { $PUBLISH = $PUBLISHSTABLE; }
if ($target eq 'ASSO' && $BUILD =~ /[a-z]/i) { $PUBLISH = $PUBLISHBETARC.'/lastbuild'; }
if ($target eq 'ASSO' && $BUILD =~ /^[0-9]+$/) { $PUBLISH = $PUBLISHBETARC.'/stable'; }
$NEWPUBLISH=$PUBLISH;
print "Publish to target $NEWPUBLISH. Click enter or CTRL+C...\n";
# Ask which target to build
$NUM_SCRIPT=<STDIN>;
$NUM_SCRIPT=<STDIN>;
chomp($NUM_SCRIPT);
print "Create empty dir /tmp/emptydir. We need it to create target dir using rsync.\n";
$ret=`mkdir -p "/tmp/emptydir/"`;
%filestoscan=%filestoscansf;
foreach my $file (sort keys %filestoscan)
{
$found=0;
@@ -1226,30 +1245,30 @@ if ($nboftargetok) {
if ($target eq 'SF') {
if ($filestoscan{$file} eq 'none') {
next;
}
}
$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
}
elsif ($target eq 'ASSO' and $NEWPUBLISH =~ /stable/) {
$destFolder="$NEWPUBLISH/$filestoscanstableasso{$file}";
}
}
elsif ($target eq 'ASSO' and $NEWPUBLISH !~ /stable/) {
$destFolder="$NEWPUBLISH";
}
}
else # No more used
{
$dirnameonly=$file;
$dirnameonly =~ s/.*\/([^\/]+)\/[^\/]+$/$1/;
$dirnameonly =~ s/.*\/([^\/]+)\/[^\/]+$/$1/;
$filenameonly=$file;
$filenameonly =~ s/.*\/[^\/]+\/([^\/])+$/$1/;
$filenameonly =~ s/.*\/[^\/]+\/([^\/])+$/$1/;
$destFolder="$NEWPUBLISH/$dirnameonly";
}
print "\n";
print "Publish file ".$file." to ".$destFolder."\n";
# mkdir
# mkdir
#my $ssh = Net::SSH::Perl->new("frs.sourceforge.net");
#$ssh->login("$user","$pass");
#$ssh->login("$user","$pass");
#use String::ShellQuote qw( shell_quote );
#$ssh->cmd('mkdir '.shell_quote($destFolder).' && exit');
@@ -1258,20 +1277,20 @@ if ($nboftargetok) {
#$sftp->mkdir($destFolder)
#$command="ssh eldy,dolibarr\@frs.sourceforge.net mkdir -p \"$destFolder\"";
#print "$command\n";
#print "$command\n";
#my $ret=`$command 2>&1`;
$command="rsync -s -e 'ssh' --recursive /tmp/emptydir/ \"".$destFolder."\"";
print "$command\n";
print "$command\n";
my $ret=`$command 2>&1`;
$command="rsync -s -e 'ssh' \"$file\" \"".$destFolder."\"";
print "$command\n";
print "$command\n";
my $ret2=`$command 2>&1`;
print "$ret2\n";
}
}
}
}
}
print "\n----- Summary -----\n";

View File

@@ -3,6 +3,13 @@
.git
.gitignore
.scrutinizer.yml
.travis.yml
.vscode
.idea
.editorconfig
.codeclimate.yml
.pre-commit-config.yaml
.mailmap
Thumbs.db
build/exe
build/html

View File

@@ -22,3 +22,9 @@ dolibarr*.deb
dolibarr*.zip
cvschangelogbuilder_dolibarr*
dolibarr_install.log
.travis.yml
.vscode
.idea
.editorconfig
.codeclimate.yml
.pre-commit-config.yaml

View File

@@ -15,7 +15,7 @@
"npm": ">=5.6.0"
},
"dependencies": {
"zapier-platform-core": "11.3.1"
"zapier-platform-core": "15.0.1"
},
"devDependencies": {
"mocha": "^5.2.0",

View File

@@ -87,7 +87,7 @@ $tablib[32] = "DictionaryAccountancyCategory";
// Requests to extract data
$tabsql = array();
$tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1";
$tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid AND c.active=1 AND a.entity IN (".getEntity('c_accounting_category').")";
// Criteria to sort dictionaries
$tabsqlsort = array();
@@ -99,11 +99,11 @@ $tabfield[32] = "code,label,range_account,category_type,formula,position,country
// Name of editing fields for record modification
$tabfieldvalue = array();
$tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id";
$tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id,entity";
// Name of the fields in the table for inserting a record
$tabfieldinsert = array();
$tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country";
$tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country,entity";
// Name of the rowid if the field is not of type autoincrement
// Example: "" if id field is "rowid" and has autoincrement on

View File

@@ -197,6 +197,9 @@ if (empty($reshook)) {
$filter['t.reconciled_option'] = $search_not_reconciled;
$param .= '&search_not_reconciled='.urlencode($search_not_reconciled);
}
if (!empty($show_subgroup)) {
$param .= '&show_subgroup='.urlencode($show_subgroup);
}
// param with type of list
$url_param = substr($param, 1); // remove first "&"

View File

@@ -348,7 +348,7 @@ if (empty($reshook)) {
$listofaccountsforgroup2 = array();
if (is_array($listofaccountsforgroup)) {
foreach ($listofaccountsforgroup as $tmpval) {
$listofaccountsforgroup2[] = "'".$db->escape($tmpval['id'])."'";
$listofaccountsforgroup2[] = "'".$db->escape($tmpval['account_number'])."'";
}
}
$filter['t.search_accounting_code_in'] = join(',', $listofaccountsforgroup2);

View File

@@ -332,7 +332,7 @@ if (empty($reshook)) {
$listofaccountsforgroup2 = array();
if (is_array($listofaccountsforgroup)) {
foreach ($listofaccountsforgroup as $tmpval) {
$listofaccountsforgroup2[] = "'".$db->escape($tmpval['id'])."'";
$listofaccountsforgroup2[] = "'".$db->escape($tmpval['account_number'])."'";
}
}
$filter['t.search_accounting_code_in'] = join(',', $listofaccountsforgroup2);

View File

@@ -291,7 +291,7 @@ if (empty($reshook)) {
$listofaccountsforgroup2 = array();
if (is_array($listofaccountsforgroup)) {
foreach ($listofaccountsforgroup as $tmpval) {
$listofaccountsforgroup2[] = "'".$db->escape($tmpval['id'])."'";
$listofaccountsforgroup2[] = "'".$db->escape($tmpval['account_number'])."'";
}
}
$filter['t.search_accounting_code_in'] = join(',', $listofaccountsforgroup2);
@@ -932,6 +932,21 @@ $sous_total_credit = 0;
$totalarray['val']['totaldebit'] = 0;
$totalarray['val']['totalcredit'] = 0;
$colspan = 0; // colspan before field 'label of operation'
$colspanend = 3; // colspan after debit/credit
if (!empty($arrayfields['t.piece_num']['checked'])) { $colspan++; }
if (!empty($arrayfields['t.code_journal']['checked'])) { $colspan++; }
if (!empty($arrayfields['t.doc_date']['checked'])) { $colspan++; }
if (!empty($arrayfields['t.doc_ref']['checked'])) { $colspan++; }
if (!empty($arrayfields['t.label_operation']['checked'])) { $colspan++; }
if (!empty($arrayfields['t.date_export']['checked'])) { $colspanend++; }
if (!empty($arrayfields['t.date_validated']['checked'])) { $colspanend++; }
if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; }
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
$colspan++;
$colspanend--;
}
while ($i < min($num, $limit)) {
$line = $object->lines[$i];
@@ -945,21 +960,6 @@ while ($i < min($num, $limit)) {
}
//if (empty($accountg)) $accountg = '-';
$colspan = 0; // colspan before field 'label of operation'
$colspanend = 3; // colspan after debit/credit
if (!empty($arrayfields['t.piece_num']['checked'])) { $colspan++; }
if (!empty($arrayfields['t.code_journal']['checked'])) { $colspan++; }
if (!empty($arrayfields['t.doc_date']['checked'])) { $colspan++; }
if (!empty($arrayfields['t.doc_ref']['checked'])) { $colspan++; }
if (!empty($arrayfields['t.label_operation']['checked'])) { $colspan++; }
if (!empty($arrayfields['t.date_export']['checked'])) { $colspanend++; }
if (!empty($arrayfields['t.date_validated']['checked'])) { $colspanend++; }
if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; }
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
$colspan++;
$colspanend--;
}
// Is it a break ?
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
// Show a subtotal by accounting account
@@ -1027,8 +1027,6 @@ while ($i < min($num, $limit)) {
//if (empty($displayed_account_number)) $displayed_account_number='-';
$sous_total_debit = 0;
$sous_total_credit = 0;
$colspan = 0;
}
print '<tr class="oddeven">';

View File

@@ -966,7 +966,7 @@ class AccountancyExport
// We need to keep the 10 lastest number of invoice doc_ref not the beginning part that is the unusefull almost same part
// $tab['num_piece3'] = str_pad(self::trunc($line->piece_num, 10), 10);
$tab['num_piece3'] = substr(self::trunc($line->doc_ref, 20), -10);
$tab['num_piece3'] = str_pad(substr(self::trunc($line->doc_ref, 20), -10), 10);
$tab['reserved'] = str_repeat(' ', 10); // position 159
$tab['currency_amount'] = str_repeat(' ', 13); // position 169
// get document file

View File

@@ -967,7 +967,7 @@ class BookKeeping extends CommonObject
$line->multicurrency_amount = $obj->multicurrency_amount;
$line->multicurrency_code = $obj->multicurrency_code;
$line->lettering_code = $obj->lettering_code;
$line->date_lettering = $obj->date_lettering;
$line->date_lettering = $this->db->jdate($obj->date_lettering);
$line->fk_user_author = $obj->fk_user_author;
$line->import_key = $obj->import_key;
$line->code_journal = $obj->code_journal;
@@ -1068,7 +1068,7 @@ class BookKeeping extends CommonObject
$sqlwhere[] = natural_search($key, $value, 1, 1);
} elseif ($key == 't.code_journal' && !empty($value)) {
if (is_array($value)) {
$sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1);
$sqlwhere[] = natural_search("t.code_journal", (string) join(',', $value), 3, 1);
} else {
$sqlwhere[] = natural_search("t.code_journal", $value, 3, 1);
}
@@ -1119,7 +1119,7 @@ class BookKeeping extends CommonObject
$line->amount = $obj->amount;
$line->sens = $obj->sens;
$line->lettering_code = $obj->lettering_code;
$line->date_lettering = $obj->date_lettering;
$line->date_lettering = $this->db->jdate($obj->date_lettering);
$line->fk_user_author = $obj->fk_user_author;
$line->import_key = $obj->import_key;
$line->code_journal = $obj->code_journal;
@@ -1399,6 +1399,7 @@ class BookKeeping extends CommonObject
*/
public function updateByMvt($piece_num = '', $field = '', $value = '', $mode = '')
{
global $conf;
$error = 0;
$this->db->begin();
@@ -1406,6 +1407,7 @@ class BookKeeping extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element.$mode;
$sql .= " SET ".$field." = ".(is_numeric($value) ? ((float) $value) : "'".$this->db->escape($value)."'");
$sql .= " WHERE piece_num = ".((int) $piece_num);
$sql .= " AND entity = " . ((int) $conf->entity);
$resql = $this->db->query($sql);
@@ -2147,7 +2149,7 @@ class BookKeeping extends CommonObject
dol_syslog(get_class($this)."::select_account", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$obj = '';
$obj = (object) array('label' => '');
if ($this->db->num_rows($resql)) {
$obj = $this->db->fetch_object($resql);
}

View File

@@ -574,7 +574,7 @@ class Lettering extends BookKeeping
$grouped_lines = array();
foreach (self::$doc_type_infos as $doc_type => $doc_type_info) {
if (!is_array($bookkeeping_lines_by_type[$doc_type])) {
if (empty($bookkeeping_lines_by_type[$doc_type]) || !is_array($bookkeeping_lines_by_type[$doc_type])) {
continue;
}

View File

@@ -238,7 +238,7 @@ if ($action == 'writebookkeeping' && !$error) {
$db->begin();
// Error if some lines are not binded/ready to be journalized
if ($errorforinvoice[$key] == 'somelinesarenotbound') {
if (!empty($errorforinvoice[$key]) && $errorforinvoice[$key] == 'somelinesarenotbound') {
$error++;
$errorforline++;
setEventMessages($langs->trans('ErrorInvoiceContainsLinesNotYetBounded', $val['ref']), null, 'errors');

View File

@@ -348,6 +348,12 @@ class Members extends DolibarrApi
}
}
} else {
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
$member->array_options[$index] = $this->_checkValForAPI($field, $val, $member);
}
continue;
}
$member->$field = $value;
}
}

View File

@@ -193,6 +193,12 @@ class MembersTypes extends DolibarrApi
if ($field == 'id') {
continue;
}
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
$membertype->array_options[$index] = $this->_checkValForAPI($field, $val, $membertype);
}
continue;
}
// Process the status separately because it must be updated using
// the validate(), resiliate() and exclude() methods of the class AdherentType.
$membertype->$field = $value;

View File

@@ -186,6 +186,12 @@ class Subscriptions extends DolibarrApi
if ($field == 'id') {
continue;
}
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
$subscription->array_options[$index] = $this->_checkValForAPI($field, $val, $subscription);
}
continue;
}
$subscription->$field = $value;
}

View File

@@ -2004,6 +2004,11 @@ if ($id > 0) {
$canbemodified = 1;
}
if ($tabname[$id] == "c_product_nature" && in_array($obj->code, array(0, 1))) {
$canbedisabled = 0;
$canbemodified = 0;
$iserasable = 0;
}
// Build Url. The table is id=, the id of line is rowid=
$rowidcol = $tabrowid[$id];
// If rowidcol not defined

View File

@@ -43,7 +43,7 @@ if (!$user->admin) {
$usersignature = $user->signature;
// For action = test or send, we ensure that content is not html, even for signature, because for this we want a test with NO html.
if ($action == 'test' || ($action == 'send' && $trackid = 'test')) {
if ($action == 'test' || ($action == 'send' && $trackid == 'test')) {
$usersignature = dol_string_nohtmltag($usersignature, 2);
}

View File

@@ -104,7 +104,9 @@ if ($action == "set") {
if (!($res > 0)) {
$error++;
}
} elseif (!$error) {
}
if (!$error) {
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {

View File

@@ -161,7 +161,7 @@ $workflowcodes = array(
),
// Automatic classification reception
'WORKFLOW_EXPEDITION_CLASSIFY_CLOSED_INVOICE'=>array(
'WORKFLOW_RECEPTION_CLASSIFY_CLOSED_INVOICE'=>array(
'family'=>'classify_reception',
'position'=>95,
'enabled'=>(isModEnabled("reception") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))),

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2025 William Mead <william@m34d.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -174,14 +175,6 @@ class DolibarrApi
unset($object->stats_mrptoconsume);
unset($object->stats_mrptoproduce);
unset($object->element);
unset($object->element_for_permission);
unset($object->fk_element);
unset($object->table_element);
unset($object->table_element_line);
unset($object->class_element_line);
unset($object->picto);
unset($object->fieldsforcombobox);
unset($object->regeximgext);
@@ -202,10 +195,18 @@ class DolibarrApi
unset($object->prefix_comm);
if (!isset($object->table_element) || $object->table_element != 'ticket') {
if (!isset($object->table_element) || ! in_array($object->table_element, array('expensereport_det', 'ticket'))) {
unset($object->comments);
}
unset($object->element);
unset($object->element_for_permission);
unset($object->fk_element);
unset($object->table_element);
unset($object->table_element_line);
unset($object->class_element_line);
unset($object->picto);
// Remove the $oldcopy property because it is not supported by the JSON
// encoder. The following error is generated when trying to serialize
// it: "Error encoding/decoding JSON: Type is not supported"

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2023 Romain Neil <contact@romain-neil.fr>
* Copyright (C) 2025 William Mead <william@m34d.com>
*
* This program is free software you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -481,7 +482,7 @@ class Documents extends DolibarrApi
} elseif ($modulepart == 'expensereport') {
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
if (!DolibarrApiAccess::$user->rights->expensereport->read && !DolibarrApiAccess::$user->rights->expensereport->read) {
if (!DolibarrApiAccess::$user->rights->expensereport->lire) {
throw new RestException(401);
}
@@ -890,7 +891,7 @@ class Documents extends DolibarrApi
// Move the temporary file at its final emplacement
$result = dol_move($destfiletmp, $dest_file, 0, $overwriteifexists, 1, 1, $moreinfo);
if (!$result) {
throw new RestException(500, "Failed to move file into '".$destfile."'");
throw new RestException(500, "Failed to move file into '".$dest_file."'");
}
return dol_basename($destfile);

View File

@@ -999,7 +999,7 @@ class Asset extends CommonObject
//-----------------------------------------------------
$nb_days_in_year = !empty($conf->global->ASSET_DEPRECIATION_DURATION_PER_YEAR) ? $conf->global->ASSET_DEPRECIATION_DURATION_PER_YEAR : 365;
$nb_days_in_month = !empty($conf->global->ASSET_DEPRECIATION_DURATION_PER_MONTH) ? $conf->global->ASSET_DEPRECIATION_DURATION_PER_MONTH : 30;
$period_amount = (double) price2num($depreciation_period_amount / $fields['duration'], 'MT');
$period_amount = (float) ($fields['duration'] > 0 ? price2num($depreciation_period_amount / $fields['duration'], 'MT') : 0);
$first_period_found = false;
$first_period_date = isset($begin_period) && $begin_period > $fiscal_period_start ? $begin_period : $fiscal_period_start;

View File

@@ -165,7 +165,7 @@ class AssetDepreciationOptions extends CommonObject
// Unset required option (notnull) if field disabled
if (!empty($field_info['enabled_field'])) {
$info = explode(':', $field_info['enabled_field']);
if ($this->deprecation_options[$info[0]][$info[1]] != $info[2] && isset($this->fields[$field_key]['notnull'])) {
if (!empty($this->deprecation_options[$info[0]][$info[1]]) && $this->deprecation_options[$info[0]][$info[1]] != $info[2] && isset($this->fields[$field_key]['notnull'])) {
unset($this->fields[$field_key]['notnull']);
}
}
@@ -285,7 +285,7 @@ class AssetDepreciationOptions extends CommonObject
foreach ($this->deprecation_options_fields as $mode_key => $mode_info) {
if (!empty($mode_info['enabled_field'])) {
$info = explode(':', $mode_info['enabled_field']);
if ($deprecation_options[$info[0]][$info[1]] != $info[2]) {
if (!empty($this->deprecation_options[$info[0]][$info[1]]) && $deprecation_options[$info[0]][$info[1]] != $info[2]) {
unset($deprecation_options[$info[0]][$info[1]]);
}
}
@@ -356,7 +356,7 @@ class AssetDepreciationOptions extends CommonObject
foreach ($this->deprecation_options_fields as $mode_key => $mode_info) {
if (!empty($mode_info['enabled_field'])) {
$info = explode(':', $mode_info['enabled_field']);
if ($deprecation_options[$info[0]][$info[1]] != $info[2]) {
if (!empty($this->deprecation_options[$info[0]][$info[1]]) && $deprecation_options[$info[0]][$info[1]] != $info[2]) {
unset($deprecation_options[$info[0]][$info[1]]);
}
}
@@ -469,7 +469,7 @@ class AssetDepreciationOptions extends CommonObject
if (!$error && !empty($this->deprecation_options[$mode_key])) {
if (!empty($mode_info['enabled_field'])) {
$info = explode(':', $mode_info['enabled_field']);
if ($this->deprecation_options[$info[0]][$info[1]] != $info[2]) {
if (!empty($this->deprecation_options[$info[0]][$info[1]]) && $this->deprecation_options[$info[0]][$info[1]] != $info[2]) {
continue;
}
}

View File

@@ -240,6 +240,12 @@ class Boms extends DolibarrApi
if ($field == 'id') {
continue;
}
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
$this->bom->array_options[$index] = $this->_checkValForAPI($field, $val, $this->bom);
}
continue;
}
$this->bom->$field = $value;
}

View File

@@ -237,6 +237,12 @@ class Categories extends DolibarrApi
if ($field == 'id') {
continue;
}
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
$this->category->array_options[$index] = $this->_checkValForAPI($field, $val, $this->category);
}
continue;
}
$this->category->$field = $value;
}
@@ -267,8 +273,8 @@ class Categories extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if (!$this->category->delete(DolibarrApiAccess::$user)) {
throw new RestException(401, 'error when delete category');
if ($this->category->delete(DolibarrApiAccess::$user) <= 0) {
throw new RestException(500, 'Error when delete category : ' . $this->category->error);
}
return array(

View File

@@ -1960,7 +1960,12 @@ if ($id > 0) {
// related contact
print '<tr><td>'.$langs->trans("ActionOnContact").'</td><td>';
print '<div class="maxwidth200onsmartphone">';
print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(empty($conf->global->MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT) ? $object->socid : 0, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid');
if (getDolGlobalInt('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT')) {
$select_contact_default = 0; // select "all" contacts by default : avoid to use it if there is a lot of contacts
} else {
$select_contact_default = -1; // select "none" by default
}
print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(!empty($object->socid) ? $object->socid : $select_contact_default, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid');
print '</div>';
print '</td>';
print '</tr>';

View File

@@ -619,7 +619,7 @@ class ActionComm extends CommonObject
foreach ($this->userassigned as $key => $val) {
// Common value with new behavior is to have $val = array('id'=>iduser, 'transparency'=>0|1) and $this->userassigned is an array of iduser => $val.
if (!is_array($val)) { // For backward compatibility when $val='id'.
$val = array('id'=>$val);
$val = array('id' => $val);
}
if ($val['id'] > 0) {
@@ -1258,9 +1258,11 @@ class ActionComm extends CommonObject
$already_inserted = array();
foreach (array_keys($this->socpeopleassigned) as $key => $val) {
if (!is_array($val)) { // For backward compatibility when val=id
$val = array('id'=>$val);
$val = array('id' => $val);
}
if (!empty($already_inserted[$val['id']])) {
continue;
}
if (!empty($already_inserted[$val['id']])) continue;
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
$sql .= " VALUES(".((int) $this->id).", 'socpeople', ".((int) $val['id']).", 0, 0, 0)";
@@ -2518,80 +2520,86 @@ class ActionComm extends CommonObject
// Load event
$res = $this->fetch($actionCommReminder->fk_actioncomm);
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, '', $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.join(',', $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

@@ -270,6 +270,12 @@ class AgendaEvents extends DolibarrApi
continue;
}
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
$this->actioncomm->array_options[$index] = $this->_checkValForAPI($field, $val, $this->actioncomm);
}
continue;
}
$this->actioncomm->$field = $this->_checkValForAPI($field, $value, $this->actioncomm);
}

View File

@@ -53,6 +53,9 @@ if ($user->socid && $socid) {
$result = restrictedArea($user, 'societe', $socid);
}
$object = new ActionComm($db);
$object->fetch($id);
$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->hasRight('agenda', 'myactions', 'create'));
@@ -65,8 +68,6 @@ $form = new Form($db);
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda|DE:Modul_Terminplanung';
llxHeader('', $langs->trans("Agenda"), $help_url);
$object = new ActionComm($db);
$object->fetch($id);
$object->info($object->id);
$head = actions_prepare_head($object);

View File

@@ -442,20 +442,25 @@ if (empty($user->rights->societe->client->voir) && !$socid) {
}
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql .= " ,".MAIN_DB_PREFIX."c_actioncomm as c";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action";
// We must filter on resource table
if ($resourceid > 0) {
$sql .= ", ".MAIN_DB_PREFIX."element_resources as r";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as r ON r.element_type = 'action' AND r.element_id = a.id";
}
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0) {
$sql .= ", ".MAIN_DB_PREFIX."actioncomm_resources as ar";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar ON ar.fk_actioncomm = a.id AND ar.element_type='user'";
}
if ($usergroup > 0) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
}
$sql .= " WHERE c.id = a.fk_action";
$sql .= ' AND a.entity IN ('.getEntity('agenda').')';
// Add table from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= " WHERE a.entity IN (".getEntity('agenda').")";
// Condition on actioncode
if (!empty($actioncode)) {
if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
@@ -486,7 +491,7 @@ if (!empty($actioncode)) {
}
}
if ($resourceid > 0) {
$sql .= " AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".((int) $resourceid);
$sql .= " AND r.resource_id = ".((int) $resourceid);
}
if ($pid) {
$sql .= " AND a.fk_project=".((int) $pid);
@@ -497,10 +502,6 @@ if (empty($user->rights->societe->client->voir) && !$socid) {
if ($socid > 0) {
$sql .= " AND s.rowid = ".((int) $socid);
}
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0) {
$sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
}
if ($type) {
$sql .= " AND c.id = ".((int) $type);
}

View File

@@ -868,9 +868,9 @@ if ($object->id > 0) {
$filedir = $conf->propal->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
if (is_array($file_list) && !empty($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
@@ -980,9 +980,9 @@ if ($object->id > 0) {
$filedir = $conf->commande->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
if (is_array($file_list) && !empty($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
@@ -1074,9 +1074,9 @@ if ($object->id > 0) {
$filedir = $conf->expedition->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
if (is_array($file_list) && !empty($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
@@ -1180,9 +1180,9 @@ if ($object->id > 0) {
$filedir = $conf->contrat->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
if (is_array($file_list) && !empty($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
@@ -1271,9 +1271,9 @@ if ($object->id > 0) {
$filedir = $conf->ficheinter->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
if (is_array($file_list) && !empty($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {
@@ -1471,9 +1471,9 @@ if ($object->id > 0) {
$filedir = $conf->facture->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
$file_list = null;
if (!empty($filedir)) {
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
}
if (is_array($file_list)) {
if (is_array($file_list) && !empty($file_list)) {
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
if ($filedir) {

View File

@@ -37,7 +37,7 @@ if (!$sortorder) {
$sortorder = "ASC";
}
if (!$sortfield) {
$sortfield = "p.name";
$sortfield = "p.lastname";
}
if ($page < 0) {
$page = 0;
@@ -81,7 +81,7 @@ if ($type == "f") {
*/
$sql = "SELECT s.rowid, s.nom as name, st.libelle as stcomm";
$sql .= ", p.rowid as cidp, p.name, p.firstname, p.email, p.phone";
$sql .= ", p.rowid as cidp, p.lastname, p.firstname, p.email, p.phone";
$sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st,";
if (empty($user->rights->societe->client->voir) && !$socid) {
$sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
@@ -106,7 +106,7 @@ if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
}
if (!empty($search_lastname)) {
$sql .= " AND p.name LIKE '%".$db->escape($search_lastname)."%'";
$sql .= " AND p.lastname LIKE '%".$db->escape($search_lastname)."%'";
}
if (!empty($search_firstname)) {
$sql .= " AND p.firstname LIKE '%".$db->escape($search_firstname)."%'";
@@ -115,8 +115,8 @@ if (!empty($search_company)) {
$sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'";
}
if (!empty($contactname)) { // acces a partir du module de recherche
$sql .= " AND (p.name LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') ";
$sortfield = "p.name";
$sql .= " AND (p.lastname LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') ";
$sortfield = "p.lastname";
$sortorder = "ASC";
}
@@ -136,7 +136,7 @@ if ($resql) {
print '<table class="liste centpercent">';
print '<tr class="liste_titre">';
print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.name", $begin, $param, "", $sortfield, $sortorder);
print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.lastname", $begin, $param, "", $sortfield, $sortorder);
print_liste_field_titre("Firstname", $_SERVER["PHP_SELF"], "p.firstname", $begin, $param, "", $sortfield, $sortorder);
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", $begin, $param, "", $sortfield, $sortorder);
print_liste_field_titre("Email");

View File

@@ -146,7 +146,6 @@ $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if (empty($reshook)) {
$backurlforlist = DOL_URL_ROOT.'/comm/propal/list.php';
@@ -1614,7 +1613,20 @@ if (empty($reshook)) {
$result = $object->set_demand_reason($user, GETPOST('demand_reason_id', 'int'));
} elseif ($action == 'setconditions' && $usercancreate) {
// Terms of payment
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), GETPOST('cond_reglement_id_deposit_percent', 'alpha'));
$sql = "SELECT code ";
$sql .= "FROM " . $db->prefix() . "c_payment_term";
$sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int'));
$result = $db->query($sql);
if ($result) {
$obj = $db->fetch_object($result);
if ($obj->code == 'DEP30PCTDEL') {
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), GETPOST('cond_reglement_id_deposit_percent', 'alpha'));
} else {
$object->deposit_percent = 0;
$object->update($user);
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), $object->deposit_percent);
}
}
} elseif ($action == 'setremisepercent' && $usercancreate) {
$result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2));
} elseif ($action == 'setremiseabsolue' && $usercancreate) {
@@ -3125,7 +3137,7 @@ if ($action == 'create') {
if ($object->statut != Propal::STATUS_DRAFT && $useonlinesignature) {
print '<br><!-- Link to sign -->';
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
print showOnlineSignatureUrl('proposal', $object->ref).'<br>';
print showOnlineSignatureUrl('proposal', $object->ref, $object).'<br>';
}
print '</div><div class="fichehalfright">';

View File

@@ -695,6 +695,12 @@ class Proposals extends DolibarrApi
if ($field == 'id') {
continue;
}
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
$this->propal->array_options[$index] = $this->_checkValForAPI($field, $val, $this->propal);
}
continue;
}
$this->propal->$field = $value;
}

View File

@@ -3517,7 +3517,7 @@ class Propal extends CommonObject
$response->label = $label;
$response->labelShort = $labelShort;
$response->url = DOL_URL_ROOT.'/comm/propal/list.php?search_status='.$status.'&mainmenu=commercial&leftmenu=propals';
$response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?search_status='.$status.'&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc';
$response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?search_option=late&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc';
$response->img = img_object('', "propal");
// This assignment in condition is not a bug. It allows walking the results.
@@ -4443,8 +4443,17 @@ class PropaleLigne extends CommonObjectLine
// End call triggers
}
$this->db->commit();
return 1;
if (!$error) {
$this->db->commit();
return 1;
}
foreach ($this->errors as $errmsg) {
dol_syslog(get_class($this)."::insert ".$errmsg, LOG_ERR);
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
}
$this->db->rollback();
return -1 * $error;
} else {
$this->error = $this->db->error()." sql=".$sql;
$this->db->rollback();
@@ -4650,8 +4659,17 @@ class PropaleLigne extends CommonObjectLine
// End call triggers
}
$this->db->commit();
return 1;
if (!$error) {
$this->db->commit();
return 1;
}
foreach ($this->errors as $errmsg) {
dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
}
$this->db->rollback();
return -1 * $error;
} else {
$this->error = $this->db->error();
$this->db->rollback();

View File

@@ -67,11 +67,11 @@ $socid = '';
if (!empty($user->socid)) {
$socid = $user->socid;
}
$hookmanager->initHooks(array('proposalcontactcard', 'globalcard'));
restrictedArea($user, 'propal', $object->id);
$usercancreate = $user->hasRight("propal", "creer");
/*
* Add a new contact
*/

View File

@@ -81,6 +81,7 @@ $socid = '';
if (!empty($user->socid)) {
$socid = $user->socid;
}
$hookmanager->initHooks(array('propaldocument', 'globalcard'));
restrictedArea($user, 'propal', $object->id);
$usercancreate = $user->hasRight("propal", "creer");

View File

@@ -17,6 +17,7 @@
* Copyright (C) 2021 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -146,6 +147,12 @@ $search_status = GETPOST('search_status', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
$object_statut = GETPOST('search_statut', 'alpha');
$search_option = GETPOST('search_option', 'alpha');
if ($search_option == 'late') {
$search_status = '1';
$object_statut = '1';
}
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$mesg = (GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
@@ -389,6 +396,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_date_signature_endyear = '';
$search_date_signature_start = '';
$search_date_signature_end = '';
$search_option = '';
}
if ($object_statut != '') {
$search_status = $object_statut;
@@ -764,6 +772,9 @@ if ($search_date_signature_start) {
if ($search_date_signature_end) {
$sql .= " AND p.date_signature <= '".$db->idate($search_date_signature_end)."'";
}
if ($search_option == 'late') {
$sql .= " AND p.fin_validite < '".$db->idate(dol_now() - $conf->propal->cloture->warning_delay)."'";
}
// Search for tag/category ($searchCategoryProductList is an array of ID)
$searchCategoryProductOperator = -1;
$searchCategoryProductList = array($search_product_category);
@@ -1042,6 +1053,9 @@ if ($resql) {
if ($search_date_signature_endyear) {
$param .= '&search_date_signature_endyear='.urlencode($search_date_signature_endyear);
}
if ($search_option) {
$param .= "&search_option=".urlencode($search_option);
}
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
@@ -1166,6 +1180,7 @@ if ($resql) {
$moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', $tmptitle, 0, 0, $tmptitle);
$moreforfilter .= '</div>';
}
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {

View File

@@ -871,17 +871,17 @@ if (empty($reshook)) {
// Set unit price to use
if (!empty($price_ht) || $price_ht === '0') {
$pu_ht = price2num($price_ht, 'MU');
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
$pu_ht = (float) price2num($price_ht, 'MU');
$pu_ttc = (float) price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
} elseif (!empty($price_ttc) || $price_ttc === '0') {
$pu_ttc = price2num($price_ttc, 'MU');
$pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
$pu_ttc = (float) price2num($price_ttc, 'MU');
$pu_ht = (float) price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
} elseif ($tmpvat != $tmpprodvat) {
// Is this still used ?
if ($price_base_type != 'HT') {
$pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
$pu_ht = (float) price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
} else {
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
$pu_ttc = (float) price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
}
}

View File

@@ -653,6 +653,12 @@ class Orders extends DolibarrApi
if ($field == 'id') {
continue;
}
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
$this->commande->array_options[$index] = $this->_checkValForAPI($field, $val, $this->commande);
}
continue;
}
$this->commande->$field = $value;
}

View File

@@ -13,6 +13,7 @@
* Copyright (C) 2016-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2021-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -3280,7 +3281,7 @@ class Commande extends CommonOrder
$this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
$this->line->remise_percent = $remise_percent;
$this->line->subprice = $subprice;
$this->line->subprice = (float) $pu_ht;
$this->line->info_bits = $info_bits;
$this->line->special_code = $special_code;
$this->line->total_ht = $total_ht;
@@ -3614,6 +3615,7 @@ class Commande extends CommonOrder
$response->label = $langs->trans("OrdersToProcess");
$response->labelShort = $langs->trans("Opened");
$response->url = DOL_URL_ROOT.'/commande/list.php?search_status=-3&mainmenu=commercial&leftmenu=orders';
$response->url_late = DOL_URL_ROOT.'/commande/list.php?search_option=late&mainmenu=commercial&leftmenu=orders';
$response->img = img_object('', "order");
$generic_commande = new Commande($this->db);

View File

@@ -12,6 +12,7 @@
* Copyright (C) 2016-2023 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2021 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -118,6 +119,10 @@ $search_fk_cond_reglement = GETPOST('search_fk_cond_reglement', 'int');
$search_fk_shipping_method = GETPOST('search_fk_shipping_method', 'int');
$search_fk_mode_reglement = GETPOST('search_fk_mode_reglement', 'int');
$search_fk_input_reason = GETPOST('search_fk_input_reason', 'int');
$search_option = GETPOST('search_option', 'alpha');
if ($search_option == 'late') {
$search_status = '-2';
}
$diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
@@ -293,6 +298,7 @@ if (empty($reshook)) {
$search_fk_shipping_method = '';
$search_fk_mode_reglement = '';
$search_fk_input_reason = '';
$search_option = '';
}
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
@@ -601,6 +607,9 @@ if (empty($reshook)) {
if ($search_status != '') {
$param .= '&search_status='.urlencode($search_status);
}
if ($search_option) {
$param .= "&search_option=".urlencode($search_option);
}
if ($search_orderday) {
$param .= '&search_orderday='.urlencode($search_orderday);
}
@@ -915,7 +924,9 @@ if ($search_status <> '') {
$sql .= ' AND (c.fk_statut IN (1,2))'; // validated, in process
}
}
if ($search_option == 'late') {
$sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->commande->client->warning_delay)."'";
}
if ($search_datecloture_start) {
$sql .= " AND c.date_cloture >= '".$db->idate($search_datecloture_start)."'";
}
@@ -1169,6 +1180,9 @@ if ($socid > 0) {
if ($search_status != '') {
$param .= '&search_status='.urlencode($search_status);
}
if ($search_option) {
$param .= "&search_option=".urlencode($search_option);
}
if ($search_datecloture_start) {
$param .= '&search_datecloture_startday='.dol_print_date($search_datecloture_start, '%d').'&search_datecloture_startmonth='.dol_print_date($search_datecloture_start, '%m').'&search_datecloture_startyear='.dol_print_date($search_datecloture_start, '%Y');
}
@@ -1466,6 +1480,7 @@ if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURIN
$moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', 1, 0, 0, $tmptitle, 0, 0, array(), 'maxwidth250 widthcentpercentminusx');
$moreforfilter .= '</div>';
}
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
@@ -1477,9 +1492,6 @@ if (empty($reshook)) {
if (!empty($moreforfilter)) {
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}
@@ -2620,7 +2632,7 @@ while ($i < $imaxinloop) {
$productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
} else {
$generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
$generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
$generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
}
if ($reliquat > $generic_product->stock_reel) {

View File

@@ -2016,7 +2016,7 @@ if ($resql) {
$productstat_cachevirtual[$obj->fk_product]['stock_reel'] = $generic_product->stock_theorique;
} else {
$generic_product->stock_reel = $productstat_cache[$obj->fk_product]['stock_reel'];
$generic_product->stock_theorique = $productstat_cachevirtual[$obj->fk_product]['stock_reel'] = $generic_product->stock_theorique;
$generic_product->stock_theorique = $productstat_cachevirtual[$obj->fk_product]['stock_reel'];
}
if ($reliquat > $generic_product->stock_reel) {

View File

@@ -332,6 +332,12 @@ class BankAccounts extends DolibarrApi
if ($field == 'id') {
continue;
}
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
$account->array_options[$index] = $this->_checkValForAPI($field, $val, $account);
}
continue;
}
$account->$field = $this->_checkValForAPI($field, $value, $account);
}

View File

@@ -163,7 +163,8 @@ if ($user->rights->banque->modifier && $action == "update") {
$sql .= " SET ";
// Always opened
if (GETPOSTISSET('value')) {
$sql .= " fk_type='".$db->escape(GETPOST('value'))."',";
$type = GETPOST('value');
$sql .= " fk_type='".$db->escape(empty($type) && $object->fk_type == 'SOLD' ? 'SOLD' : $type)."',";
}
if (GETPOSTISSET('num_chq')) {
$sql .= " num_chq='".$db->escape(GETPOST("num_chq"))."',";

View File

@@ -253,7 +253,7 @@ if ($resql) {
// Date ope
print '<td class="nowrap left">';
print '<span id="dateoperation_'.$objp->rowid.'">'.dol_print_date($db->jdate($objp->do), "day")."</span>";
print '<span id="dateoperation_'.$objp->facid.'">'.dol_print_date($db->jdate($objp->do), "day")."</span>";
print "</td>\n";
if (!$i) {
$totalarray['nbfield']++;

View File

@@ -91,7 +91,10 @@ $pagenext = $page + 1;
$object = new FactureRec($db);
if (($id > 0 || $ref) && $action != 'create' && $action != 'add') {
$ret = $object->fetch($id, $ref);
if (!$ret) {
if ($ret < 0) {
dol_print_error($db, $object->error, $object->errors);
exit;
} elseif (! $ret) {
setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors');
}
}
@@ -1304,14 +1307,10 @@ if ($action == 'create') {
}
print '</tr></table>';
print '</td><td>';
if ($object->type != Facture::TYPE_CREDIT_NOTE) {
if ($action == 'editconditions') {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
} else {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none');
}
if ($action == 'editconditions') {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
} else {
print '&nbsp;';
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none');
}
print '</td></tr>';
@@ -1735,6 +1734,7 @@ if ($action == 'create') {
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$morehtmlcenter = '';
$somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
print '</div>';

View File

@@ -98,7 +98,7 @@ $origin = GETPOST('origin', 'alpha');
$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility
$fac_rec = GETPOST('fac_rec', 'int');
$facid = GETPOST('facid', 'int');
$ref_client = GETPOST('ref_client', 'int');
$ref_client = GETPOST('ref_client', 'alpha');
$rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1;
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : 0);
@@ -321,7 +321,7 @@ if (empty($reshook)) {
$object->date = dol_now();
}
if (!empty($conf->global-> INVOICE_CHECK_POSTERIOR_DATE)) {
if (!empty($conf->global->INVOICE_CHECK_POSTERIOR_DATE)) {
$last_of_type = $object->willBeLastOfSameType(true);
if (empty($object->date_validation) && !$last_of_type[0]) {
setEventMessages($langs->transnoentities("ErrorInvoiceIsNotLastOfSameType", $object->ref, dol_print_date($object->date, 'day'), dol_print_date($last_of_type[1], 'day')), null, 'errors');
@@ -643,7 +643,7 @@ if (empty($reshook)) {
$object->setValueFrom('ref', GETPOST('ref'), '', null, '', '', $user, 'BILL_MODIFY');
} elseif ($action == 'setref_client' && $usercancreate) {
$object->fetch($id);
$object->set_ref_client(GETPOST('ref_client'));
$object->set_ref_client(GETPOST('ref_client', 'alpha'));
} elseif ($action == 'confirm_valid' && $confirm == 'yes' && $usercanvalidate) {
// Classify to validated
$idwarehouse = GETPOST('idwarehouse', 'int');
@@ -4487,6 +4487,9 @@ if ($action == 'create') {
$morehtmlref .= '</div>';
$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
$object->totalcreditnotes = $totalcreditnotes;
$object->totaldeposits = $totaldeposits;
$object->remaintopay = price2num($object->total_ttc - $object->totalpaid - $object->totalcreditnotes - $object->totaldeposits, 'MT');
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '');
@@ -5039,7 +5042,9 @@ if ($action == 'create') {
$current_situation_counter = array();
foreach ($object->tab_previous_situation_invoice as $prev_invoice) {
$tmptotalpaidforthisinvoice = $prev_invoice->getSommePaiement();
$tmptotalallpayments = $prev_invoice->getSommePaiement(0);
$tmptotalallpayments += $prev_invoice->getSumDepositsUsed(0);
$tmptotalallpayments += $prev_invoice->getSumCreditNotesUsed(0);
$total_prev_ht += $prev_invoice->total_ht;
$total_prev_ttc += $prev_invoice->total_ttc;
$current_situation_counter[] = (($prev_invoice->type == Facture::TYPE_CREDIT_NOTE) ?-1 : 1) * $prev_invoice->situation_counter;
@@ -5052,11 +5057,14 @@ if ($action == 'create') {
}
print '<td class="right"><span class="amount">'.price($prev_invoice->total_ht).'</span></td>';
print '<td class="right"><span class="amount">'.price($prev_invoice->total_ttc).'</span></td>';
print '<td class="right">'.$prev_invoice->getLibStatut(3, $tmptotalpaidforthisinvoice).'</td>';
print '<td class="right">'.$prev_invoice->getLibStatut(3, $tmptotalallpayments).'</td>';
print '</tr>';
}
}
$totalallpayments = $object->getSommePaiement(0);
$totalallpayments += $object->getSumCreditNotesUsed(0);
$totalallpayments += $object->getSumDepositsUsed(0);
$total_global_ht += $total_prev_ht;
$total_global_ttc += $total_prev_ttc;
@@ -5072,7 +5080,7 @@ if ($action == 'create') {
}
print '<td class="right"><span class="amount">'.price($object->total_ht).'</span></td>';
print '<td class="right"><span class="amount">'.price($object->total_ttc).'</span></td>';
print '<td class="right">'.$object->getLibStatut(3, $object->getSommePaiement()).'</td>';
print '<td class="right">'.$object->getLibStatut(3, $totalallpayments).'</td>';
print '</tr>';
@@ -5114,7 +5122,9 @@ if ($action == 'create') {
$total_next_ht = $total_next_ttc = 0;
foreach ($object->tab_next_situation_invoice as $next_invoice) {
$totalpaid = $next_invoice->getSommePaiement();
$totalpaid = $next_invoice->getSommePaiement(0);
$totalcreditnotes = $next_invoice->getSumCreditNotesUsed(0);
$totaldeposits = $next_invoice->getSumDepositsUsed(0);
$total_next_ht += $next_invoice->total_ht;
$total_next_ttc += $next_invoice->total_ttc;
@@ -5127,7 +5137,7 @@ if ($action == 'create') {
}
print '<td class="right"><span class="amount">'.price($next_invoice->total_ht).'</span></td>';
print '<td class="right"><span class="amount">'.price($next_invoice->total_ttc).'</span></td>';
print '<td class="right">'.$next_invoice->getLibStatut(3, $totalpaid).'</td>';
print '<td class="right">'.$next_invoice->getLibStatut(3, $totalpaid + $totalcreditnotes + $totaldeposits).'</td>';
print '</tr>';
}

View File

@@ -622,6 +622,12 @@ class Invoices extends DolibarrApi
if ($field == 'id') {
continue;
}
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
$this->invoice->array_options[$index] = $this->_checkValForAPI($field, $val, $this->invoice);
}
continue;
}
$this->invoice->$field = $value;
}
@@ -632,11 +638,11 @@ class Invoices extends DolibarrApi
}
}
if ($this->invoice->update(DolibarrApiAccess::$user)) {
if ($this->invoice->update(DolibarrApiAccess::$user) > 0) {
return $this->get($id);
} else {
throw new RestException(500, $this->invoice->error);
}
return false;
}
/**

View File

@@ -131,6 +131,13 @@ class FactureRec extends CommonInvoice
public $cond_reglement_code; // Code in llx_c_paiement
public $mode_reglement_code; // Code in llx_c_paiement
public $fk_multicurrency;
public $multicurrency_code;
public $multicurrency_tx;
public $multicurrency_total_ht;
public $multicurrency_total_tva;
public $multicurrency_total_ttc;
public $suspended; // status
public $auto_validate; // 0 to create in draft, 1 to create and validate the new invoice
@@ -1340,6 +1347,14 @@ class FactureRec extends CommonInvoice
$facture->multicurrency_tx = $facturerec->multicurrency_tx;
}
if (isset($facture->array_options) && isset($facturerec->array_options)) {
foreach ($facturerec->array_options as $key => $value) {
if (isset($facture->array_options[$key])) {
$facture->array_options[$key] = $value;
}
}
}
$invoiceidgenerated = $facture->create($user);
if ($invoiceidgenerated <= 0) {
$this->errors = $facture->errors;
@@ -1389,6 +1404,7 @@ class FactureRec extends CommonInvoice
$nb_create++;
$this->output .= $langs->trans("InvoiceGeneratedFromTemplate", $facture->ref, $facturerec->ref)."\n";
} else {
$this->output .= $langs->trans("InvoiceGeneratedFromTemplateError", $facture->ref, $facturerec->ref, $this->error)."\n";
$this->db->rollback("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref);
}

View File

@@ -503,8 +503,8 @@ class Facture extends CommonInvoice
$this->ref_client = trim($this->ref_client);
$this->note = (isset($this->note) ? trim($this->note) : trim($this->note_private)); // deprecated
$this->note_private = (isset($this->note_private) ? trim($this->note_private) : trim($this->note_private));
$this->note_public = trim($this->note_public);
$this->note_private = (isset($this->note_private) ? trim($this->note_private) : '');
$this->note_public = (isset($this->note_public) ? trim($this->note_public) : '');
if (!$this->cond_reglement_id) {
$this->cond_reglement_id = 0;
}
@@ -1013,13 +1013,13 @@ class Facture extends CommonInvoice
*/
if (!$error && $this->fac_rec > 0) {
foreach ($_facrec->lines as $i => $val) {
// For line from template invoice, we use data from template invoice
/*
if ($_facrec->lines[$i]->fk_product) {
$prod = new Product($this->db);
$res = $prod->fetch($_facrec->lines[$i]->fk_product);
}
// For line from template invoice, we use data from template invoice
/*
$tva_tx = get_default_tva($mysoc,$soc,$prod->id);
$tva_npr = get_default_npr($mysoc,$soc,$prod->id);
if (empty($tva_tx)) $tva_npr=0;
@@ -1294,6 +1294,7 @@ class Facture extends CommonInvoice
$object->date_modification = '';
$object->date_validation = '';
$object->ref_client = '';
$object->ref_customer = '';
$object->close_code = '';
$object->close_note = '';
if (getDolGlobalInt('MAIN_DONT_KEEP_NOTE_ON_CLONING') == 1) {
@@ -2522,6 +2523,9 @@ class Facture extends CommonInvoice
if (isset($this->retained_warranty)) {
$this->retained_warranty = floatval($this->retained_warranty);
}
if (!isset($this->fk_user_author) && isset($this->user_author) ) {
$this->fk_user_author = $this->user_author;
}
// Check parameters
@@ -2551,7 +2555,7 @@ class Facture extends CommonInvoice
$sql .= " total_ttc=".(isset($this->total_ttc) ? $this->total_ttc : "null").",";
$sql .= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '') ? $this->db->escape($this->revenuestamp) : "null").",";
$sql .= " fk_statut=".(isset($this->statut) ? $this->db->escape($this->statut) : "null").",";
$sql .= " fk_user_author=".(isset($this->user_author) ? $this->db->escape($this->user_author) : "null").",";
$sql .= " fk_user_author=".(isset($this->fk_user_author) ? $this->db->escape($this->fk_user_author) : "null").",";
$sql .= " fk_user_valid=".(isset($this->fk_user_valid) ? $this->db->escape($this->fk_user_valid) : "null").",";
$sql .= " fk_facture_source=".(isset($this->fk_facture_source) ? $this->db->escape($this->fk_facture_source) : "null").",";
$sql .= " fk_projet=".(isset($this->fk_project) ? $this->db->escape($this->fk_project) : "null").",";
@@ -4231,6 +4235,11 @@ class Facture extends CommonInvoice
$rangmax = $this->line_max($fk_parent_line);
$this->line->rang = $rangmax + 1;
}
$apply_abs_price_on_credit_note=false;
if ($this->type == self::TYPE_CREDIT_NOTE && !getDolGlobalInt('FACTURE_ENABLE_NEGATIVE_LINES') && !getDolGlobalInt('INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN')) {
$apply_abs_price_on_credit_note = true;
}
$this->line->id = $rowid;
$this->line->rowid = $rowid;
@@ -4247,14 +4256,14 @@ class Facture extends CommonInvoice
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
$this->line->remise_percent = $remise_percent;
$this->line->subprice = ($this->type == self::TYPE_CREDIT_NOTE ?-abs($pu_ht) : $pu_ht); // For credit note, unit price always negative, always positive otherwise
$this->line->subprice = ($apply_abs_price_on_credit_note?-abs($pu_ht) : $pu_ht); // For credit note, unit price always negative, always positive otherwise
$this->line->date_start = $date_start;
$this->line->date_end = $date_end;
$this->line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ht) : $total_ht); // For credit note and if qty is negative, total is negative
$this->line->total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_tva) : $total_tva);
$this->line->total_ht = (($apply_abs_price_on_credit_note || $qty < 0) ?-abs($total_ht) : $total_ht); // For credit note and if qty is negative, total is negative
$this->line->total_tva = (($apply_abs_price_on_credit_note || $qty < 0) ?-abs($total_tva) : $total_tva);
$this->line->total_localtax1 = $total_localtax1;
$this->line->total_localtax2 = $total_localtax2;
$this->line->total_ttc = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ttc) : $total_ttc);
$this->line->total_ttc = (($apply_abs_price_on_credit_note || $qty < 0) ?-abs($total_ttc) : $total_ttc);
$this->line->info_bits = $info_bits;
$this->line->special_code = $special_code;
$this->line->product_type = $type;
@@ -5844,9 +5853,9 @@ class Facture extends CommonInvoice
$joinFileName = [];
$joinFileMime = [];
if ($arraymessage->joinfiles == 1 && !empty($tmpinvoice->last_main_doc)) {
$joinFile[] = DOL_DATA_ROOT.$tmpinvoice->last_main_doc;
$joinFile[] = DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc;
$joinFileName[] = basename($tmpinvoice->last_main_doc);
$joinFileMime[] = dol_mimetype(DOL_DATA_ROOT.$tmpinvoice->last_main_doc);
$joinFileMime[] = dol_mimetype(DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc);
}
// Mail Creation
@@ -6401,7 +6410,7 @@ class FactureLigne extends CommonInvoiceLine
// If fk_remise_except is defined, the discount is linked to the invoice
// which flags it as "consumed".
if ($this->fk_remise_except) {
if ($this->fk_remise_except && empty($error)) {
$discount = new DiscountAbsolute($this->db);
$result = $discount->fetch($this->fk_remise_except);
if ($result >= 0) {
@@ -6438,7 +6447,7 @@ class FactureLigne extends CommonInvoiceLine
}
}
if (!$notrigger) {
if (!$notrigger && empty($error)) {
// Call trigger
$result = $this->call_trigger('LINEBILL_INSERT', $user);
if ($result < 0) {
@@ -6448,8 +6457,17 @@ class FactureLigne extends CommonInvoiceLine
// End call triggers
}
$this->db->commit();
return $this->id;
if (!$error) {
$this->db->commit();
return $this->id;
}
foreach ($this->errors as $errmsg) {
dol_syslog(get_class($this)."::insert ".$errmsg, LOG_ERR);
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
}
$this->db->rollback();
return -1 * $error;
} else {
$this->error = $this->db->lasterror();
$this->db->rollback();
@@ -6620,8 +6638,18 @@ class FactureLigne extends CommonInvoiceLine
}
// End call triggers
}
$this->db->commit();
return 1;
if (!$error) {
$this->db->commit();
return 1;
}
foreach ($this->errors as $errmsg) {
dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
}
$this->db->rollback();
return -1 * $error;
} else {
$this->error = $this->db->error();
$this->db->rollback();

View File

@@ -55,12 +55,11 @@ $object = new Facture($db);
if ($id > 0 || !empty($ref)) {
$ret = $object->fetch($id, $ref, '', '', (!empty($conf->global->INVOICE_USE_SITUATION) ? $conf->global->INVOICE_USE_SITUATION : 0));
}
$hookmanager->initHooks(array('invoicecontactcard', 'globalcard'));
$result = restrictedArea($user, 'facture', $object->id);
$usercancreate = $user->hasRight("facture", "creer");
/*
* Add a new contact
*/

View File

@@ -79,6 +79,7 @@ $permissiontoadd = $user->hasRight('facture', 'creer');
if ($user->socid) {
$socid = $user->socid;
}
$hookmanager->initHooks(array('invoicedocument', 'globalcard'));
$result = restrictedArea($user, 'facture', $object->id, '');
$usercancreate = $user->hasRight("facture", "creer");

View File

@@ -422,8 +422,8 @@ if ($action == 'makepayment_confirm' && $user->hasRight('facture', 'paiement'))
$paiementAmount = $facture->getSommePaiement();
$totalcreditnotes = $facture->getSumCreditNotesUsed();
$totaldeposits = $facture->getSumDepositsUsed();
$totalpay = $paiementAmount + $totalcreditnotes + $totaldeposits;
$remaintopay = price2num($facture->total_ttc - $totalpay);
$totalallpayments = $paiementAmount + $totalcreditnotes + $totaldeposits;
$remaintopay = price2num($facture->total_ttc - $totalallpayments);
if ($remaintopay != 0) {
$resultBank = $facture->setBankAccount($bankid);
if ($resultBank < 0) {
@@ -1821,7 +1821,7 @@ if ($resql) {
$totalarray['val']['f.total_tva'] = 0;
$totalarray['val']['f.total_ht'] = 0;
$totalarray['val']['f.total_ttc'] = 0;
$totalarray['val']['totalam'] = 0;
$totalarray['val']['dynamount_payed'] = 0;
$totalarray['val']['rtp'] = 0;
@@ -1910,8 +1910,8 @@ if ($resql) {
$multicurrency_totalcreditnotes = $facturestatic->getSumCreditNotesUsed(1);
$multicurrency_totaldeposits = $facturestatic->getSumDepositsUsed(1);
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = price2num($facturestatic->total_ttc - $totalpay);
$totalallpayments = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = $obj->total_ttc - $totalallpayments;
$multicurrency_totalpay = $multicurrency_paiement + $multicurrency_totalcreditnotes + $multicurrency_totaldeposits;
$multicurrency_remaintopay = price2num($facturestatic->multicurrency_total_ttc - $multicurrency_totalpay);
@@ -1923,13 +1923,16 @@ if ($resql) {
if ($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) { // If credit note closed, we take into account the amount not yet consumed
$remaincreditnote = $discount->getAvailableDiscounts($companystatic, '', 'rc.fk_facture_source='.$facturestatic->id);
$remaintopay = -$remaincreditnote;
$totalpay = price2num($facturestatic->total_ttc - $remaintopay);
$totalallpayments = price2num($facturestatic->total_ttc - $remaintopay);
$multicurrency_remaincreditnote = $discount->getAvailableDiscounts($companystatic, '', 'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1);
$multicurrency_remaintopay = -$multicurrency_remaincreditnote;
$multicurrency_totalpay = price2num($facturestatic->multicurrency_total_ttc - $multicurrency_remaintopay);
}
$facturestatic->alreadypaid = $paiement;
$facturestatic->totalpaid = $paiement;
$facturestatic->totalcreditnotes = $totalcreditnotes;
$facturestatic->totaldeposits = $totaldeposits;
$marginInfo = array();
if ($with_margin_info === true) {
@@ -2002,6 +2005,8 @@ if ($resql) {
$filename = dol_sanitizeFileName($obj->ref);
$filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($obj->ref);
$filepath = $conf->invoice->multidir_output[$obj->entity] ?? $conf->invoice->dir_output;
$filedir = $filepath . '/' . $filename;
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->id;
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print '</td>';
@@ -2382,14 +2387,14 @@ if ($resql) {
}
if (!empty($arrayfields['dynamount_payed']['checked'])) {
print '<td class="right nowraponall amount">'.(!empty($totalpay) ? price($totalpay, 0, $langs) : '&nbsp;').'</td>'; // TODO Use a denormalized field
print '<td class="right nowraponall amount">'.(!empty($totalallpayments) ? price($totalallpayments, 0, $langs) : '&nbsp;').'</td>'; // TODO Use a denormalized field
if (!$i) {
$totalarray['nbfield']++;
}
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 'totalam';
$totalarray['pos'][$totalarray['nbfield']] = 'dynamount_payed';
}
$totalarray['val']['totalam'] += $totalpay;
$totalarray['val']['dynamount_payed'] += $totalallpayments;
}
// Pending amount
@@ -2580,7 +2585,7 @@ if ($resql) {
// Status
if (!empty($arrayfields['f.fk_statut']['checked'])) {
print '<td class="nowrap right">';
print $facturestatic->getLibStatut(5, $paiement);
print $facturestatic->getLibStatut(5, $totalallpayments);
print "</td>";
if (!$i) {
$totalarray['nbfield']++;

View File

@@ -86,11 +86,21 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
print '</td>';
print '<td class="linkedcol-statut right">';
$totalallpayments = 0;
$totalcalculated = false;
if (method_exists($objectlink, 'getSommePaiement')) {
print $objectlink->getLibStatut(3, $objectlink->getSommePaiement());
} else {
print $objectlink->getLibStatut(3);
$totalcalculated = true;
$totalallpayments += $objectlink->getSommePaiement();
}
if (method_exists($objectlink, 'getSumDepositsUsed')) {
$totalcalculated = true;
$totalallpayments += $objectlink->getSumDepositsUsed();
}
if (method_exists($objectlink, 'getSumCreditNotesUsed')) {
$totalcalculated = true;
$totalallpayments += $objectlink->getSumCreditNotesUsed();
}
print $objectlink->getLibStatut(3, ($totalcalculated ? $totalallpayments : -1));
print '</td>';
print '<td class="linkedcol-action right"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
print "</tr>\n";

View File

@@ -215,6 +215,9 @@ if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
$thirdpartystatic->code_compta = $obj->code_compta;
//$thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
$totalallpayments = $tmpinvoice->getSommePaiement(0);
$totalallpayments += $tmpinvoice->getSumCreditNotesUsed(0);
$totalallpayments += $tmpinvoice->getSumDepositsUsed(0);
print '<tr class="oddeven">';
print '<td class="nowrap">';
@@ -247,7 +250,7 @@ if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
print '<td class="right" title="'.dol_escape_htmltag($langs->trans("DateModificationShort").' : '.dol_print_date($db->jdate($obj->tms), 'dayhour', 'tzuserrel')).'">'.dol_print_date($db->jdate($obj->tms), 'day', 'tzuserrel').'</td>';
print '<td>'.$tmpinvoice->getLibStatut(3, $obj->am).'</td>';
print '<td>'.$tmpinvoice->getLibStatut(3, $totalallpayments).'</td>';
print '</tr>';
@@ -377,6 +380,8 @@ if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
print '<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).'</span></td>';
print '<td class="right" title="'.dol_escape_htmltag($langs->trans("DateModificationShort").' : '.dol_print_date($db->jdate($obj->tms), 'dayhour', 'tzuserrel')).'">'.dol_print_date($db->jdate($obj->tms), 'day', 'tzuserrel').'</td>';
$alreadypaid = $facstatic->getSommePaiement();
$alreadypaid += $facstatic->getSumCreditNotesUsed();
$alreadypaid += $facstatic->getSumDepositsUsed();
print '<td>'.$facstatic->getLibStatut(3, $alreadypaid).'</td>';
print '</tr>';
$total_ht += $obj->total_ht;

View File

@@ -544,7 +544,7 @@ if ($action == 'new') {
if (count($lines[$bid])) {
foreach ($lines[$bid] as $lid => $value) {
print '<tr class="oddeven">';
print '<td>'.dol_print_date($value["date"], 'day').'</td>';
print '<td>'.dol_print_date($value["paymentdate"], 'day').'</td>';
print '<td>'.$value["numero"]."</td>\n";
print '<td>'.$value["emetteur"]."</td>\n";
print '<td>'.$value["banque"]."</td>\n";

View File

@@ -1269,7 +1269,7 @@ class Paiement extends CommonObject
$facturestatic = new Facture($this->db);
foreach ($arraybill as $billid) {
$facturestatic->fetch($billid);
$label .= '<br> '.$facturestatic->getNomUrl(1, '', 0, 0, '', 1).' '.$facturestatic->getLibStatut(2, 1);
$label .= '<br> '.$facturestatic->getNomUrl(1, '', 0, 0, '', 1).' '.$facturestatic->getLibStatut(2, -1);
}
}
}

View File

@@ -51,7 +51,7 @@ $charge = new ChargeSociales($db);
* Actions
*/
if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'yes')) {
if ($action == 'add_payment') {
$error = 0;
if ($cancel) {
@@ -89,7 +89,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
}
}
if (count($amounts) <= 0) {
if (empty($amounts)) {
$error++;
setEventMessages($langs->trans("ErrorNoPaymentDefined"), null, 'errors');
$action = 'create';
@@ -119,9 +119,9 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
if (!$error) {
$result = $paiement->addPaymentToBank($user, 'payment_sc', '(SocialContributionPayment)', GETPOST('accountid', 'int'), '', '');
if (!($result > 0)) {
if ($result <= 0) {
$error++;
setEventMessages($paiement->error, null, 'errors');
setEventMessages($paiement->error, $paiement->errors, 'errors');
$action = 'create';
}
}

View File

@@ -76,27 +76,28 @@ class RejetPrelevement
}
/**
* Create
* Create a reject
*
* @param User $user User object
* @param int $id Id
* @param string $motif Motif
* @param int $date_rejet Date rejet
* @param int $date_rejet Date reject
* @param int $bonid Bon id
* @param int $facturation Facturation
* @return void
* @param int $facturation 1=Bill the reject
* @return int Return >=0 if OK, <0 if KO
*/
public function create($user, $id, $motif, $date_rejet, $bonid, $facturation = 0)
{
global $langs, $conf;
global $langs;
$error = 0;
$this->id = $id;
$this->bon_id = $bonid;
$now = dol_now();
dol_syslog("RejetPrelevement::Create id $id");
$bankaccount = ($this->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT);
dol_syslog("RejetPrelevement::Create id ".$id);
$bankaccount = ($this->type == 'bank-transfer' ? getDolGlobalString('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT') : getDolGlobalString('PRELEVEMENT_ID_BANKACCOUNT'));
$facs = $this->getListInvoices(1);
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
@@ -152,17 +153,16 @@ class RejetPrelevement
$fac->fetch($facs[$i][0]);
// Make a negative payment
//$pai = new Paiement($this->db);
$amountrejected = $facs[$i][1];
// Make a negative payment
// Amount must be an array (id of invoice -> amount)
$pai->amounts = array();
/*
* We replace the comma with a point otherwise some
* PHP installs sends only the part integer negative
*/
//var_dump($this->type);exit;
$pai->amounts[$facs[$i][0]] = price2num($amountrejected * -1); // The payment must be negative because it is a refund
$pai->amounts[$facs[$i][0]] = price2num($facs[$i][1] * ($this->type == 'bank-transfer' ? 1 : -1));
$pai->datepaye = $date_rejet;
$pai->paiementid = 3; // type of payment: withdrawal
$pai->num_paiement = $fac->ref;
@@ -175,7 +175,13 @@ class RejetPrelevement
$error++;
dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i][0]);
} else {
$result = $pai->addPaymentToBank($user, 'payment', '(InvoiceRefused)', $bankaccount, '', '');
// We record entry into bank
$mode = 'payment';
if ($this->type == 'bank-transfer') {
$mode = 'payment_supplier';
}
$result = $pai->addPaymentToBank($user, $mode, '(InvoiceRefused)', $bankaccount, '', '');
if ($result < 0) {
dol_syslog("RejetPrelevement::Create AddPaymentToBan Error");
$error++;
@@ -200,9 +206,13 @@ class RejetPrelevement
if ($error == 0) {
dol_syslog("RejetPrelevement::Create Commit");
$this->db->commit();
return 1;
} else {
dol_syslog("RejetPrelevement::Create Rollback");
$this->db->rollback();
return -1;
}
}

View File

@@ -101,7 +101,7 @@ print '</span></td></tr></table></div><br>';
/*
* Invoices waiting for withdraw
*/
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,";
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut as status, f.paye, f.type,";
$sql .= " pfd.date_demande, pfd.amount,";
$sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
@@ -141,10 +141,13 @@ if ($resql) {
$invoicestatic->id = $obj->rowid;
$invoicestatic->ref = $obj->ref;
$invoicestatic->statut = $obj->fk_statut;
$invoicestatic->statut = $obj->status;
$invoicestatic->status = $obj->status;
$invoicestatic->paye = $obj->paye;
$invoicestatic->type = $obj->type;
$alreadypayed = $invoicestatic->getSommePaiement();
$totalallpayments = $invoicestatic->getSommePaiement(0);
$totalallpayments += $invoicestatic->getSumCreditNotesUsed(0);
$totalallpayments += $invoicestatic->getSumDepositsUsed(0);
$thirdpartystatic->id = $obj->socid;
$thirdpartystatic->name = $obj->name;
@@ -177,7 +180,7 @@ if ($resql) {
print '</td>';
print '<td class="right">';
print $invoicestatic->getLibStatut(3, $alreadypayed);
print $invoicestatic->getLibStatut(3, $totalallpayments);
print '</td>';
print '</tr>';
$i++;

View File

@@ -85,7 +85,7 @@ $error = 0;
if ($action == 'confirm_rejet' && $permissiontoadd) {
if (GETPOST("confirm") == 'yes') {
if (GETPOST('remonth', 'int')) {
$daterej = mktime(2, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
$daterej = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
}
if (empty($daterej)) {
@@ -166,7 +166,12 @@ if ($id) {
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
print $id.'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("WithdrawalsReceipts").'</td><td>';
if ($type == 'bank-transfer') {
print '<tr><td class="titlefield">'.$langs->trans("BankTransfers").'</td><td>';
} else {
print '<tr><td class="titlefield">'.$langs->trans("WithdrawalsReceipts").'</td><td>';
}
print $bon->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec, 'day').'</td></tr>';

View File

@@ -417,7 +417,7 @@ while ($i < $imaxinloop) {
print '<td>';
print $line->LibStatut($obj->statut_ligne, 2);
print "&nbsp;";
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.'">';
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.($type == 'bank-transfer' ? '&type=bank-transfer' : '').'">';
print substr('000000'.$obj->rowid_ligne, -6);
print '</a></td>';

View File

@@ -133,7 +133,7 @@ if ($result) {
print '<td>';
print $line->LibStatut($obj->statut, 2).'&nbsp;';
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'">';
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.($type == 'bank-transfer' ? '&type=bank-transfer' : '').'">';
print substr('000000'.$obj->rowid, -6)."</a></td>";
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.$obj->nom."</a></td>\n";

View File

@@ -159,7 +159,9 @@ if ($id > 0) {
print $fac->error."<br>";
continue;
}
$totalpaid = $fac->getSommePaiement();
$alreadypaid = $fac->getSommePaiement();
$alreadypaid += $fac->getSumDepositsUsed();
$alreadypaid += $fac->getSumCreditNotesUsed();
$userstatic->id = $objf->userid;
$userstatic->login = $objf->login;
@@ -169,7 +171,7 @@ if ($id > 0) {
'date' => $fac->date,
'datefieldforsort' => $fac->date.'-'.$fac->ref,
'link' => $fac->getNomUrl(1),
'status' => $fac->getLibStatut(2, $totalpaid),
'status' => $fac->getLibStatut(2, $alreadypaid),
'amount' => $fac->total_ttc,
'author' => $userstatic->getLoginUrl(1)
);

View File

@@ -579,7 +579,6 @@ class PaymentSocialContribution extends CommonObject
$result = $this->update_fk_bank($bank_line_id);
if ($result <= 0) {
$error++;
dol_print_error($this->db);
}
// Add link 'payment', 'payment_supplier', 'payment_sc' in bank_url between payment and bank transaction
@@ -591,7 +590,7 @@ class PaymentSocialContribution extends CommonObject
$result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
if ($result <= 0) {
$error++;
dol_print_error($this->db);
$this->setErrorsFromObject($acc);
}
}
@@ -603,7 +602,8 @@ class PaymentSocialContribution extends CommonObject
$socialcontrib->fetch($key);
$result = $acc->add_url_line($bank_line_id, $socialcontrib->id, DOL_URL_ROOT.'/compta/charges.php?id=', $socialcontrib->type_label.(($socialcontrib->lib && $socialcontrib->lib != $socialcontrib->type_label) ? ' ('.$socialcontrib->lib.')' : ''), 'sc');
if ($result <= 0) {
dol_print_error($this->db);
$this->setErrorsFromObject($acc);
$error++;
}
if ($socialcontrib->fk_user) {
@@ -620,14 +620,14 @@ class PaymentSocialContribution extends CommonObject
);
if ($result <= 0) {
$this->error = $acc->error;
$this->setErrorsFromObject($acc);
$error++;
}
}
}
}
} else {
$this->error = $acc->error;
$this->setErrorsFromObject($acc);
$error++;
}
}

View File

@@ -503,7 +503,7 @@ if ($modecompta == 'CREANCES-DETTES') {
// Quantity
print '<td class="right">';
print $qty[$key];
print price($qty[$key], 1, $langs, 0, 0);
print '</td>';
// Percent;

View File

@@ -719,7 +719,8 @@ while ($i < $imaxinloop) {
}
if (!empty($arrayfields['t.status']['checked'])) {
print '<td class="nowrap right">' . $tva_static->getLibStatut(5, $obj->alreadypayed) . '</td>';
$totalallpayments = $obj->alreadypayed;
print '<td class="nowrap right">' . $tva_static->getLibStatut(5, $totalallpayments) . '</td>';
if (!$i) {
$totalarray['nbfield']++;
}

View File

@@ -604,7 +604,7 @@ if (empty($reshook)) {
$info_bits |= 0x01;
}
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance))
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->hasRight('produit', 'ignore_price_min_advance'))
|| empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) {
$object->error = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, -1, $conf->currency));
$result = -1;
@@ -1713,7 +1713,7 @@ if ($action == 'create') {
$line = new ContratLigne($db);
$line->id = $objp->rowid;
$line->fetch_optionals();
print $line->showOptionals($extrafields, 'view', array('class'=>'oddeven', 'style'=>$moreparam, 'colspan'=>$colspan), '', '', 1);
print $line->showOptionals($extrafields, 'view', array('class'=>'oddeven', 'style'=>$moreparam, 'colspan'=>$colspan, 'tdclass' => 'notitlefieldcreate'), '', '', 1);
}
} else {
// Line in mode update
@@ -1817,7 +1817,7 @@ if ($action == 'create') {
$line = new ContratLigne($db);
$line->id = $objp->rowid;
$line->fetch_optionals();
print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', 1);
print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan, 'tdclass' => 'notitlefieldcreate'), '', '', 1);
}
}
@@ -1836,7 +1836,7 @@ if ($action == 'create') {
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
$colspan++;
}
if (isModEnabled('margin') && !empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) {
if (isModEnabled('margin') && getDolGlobalString('MARGIN_SHOW_ON_CONTRACT')) {
$colspan++;
}
@@ -2063,7 +2063,7 @@ if ($action == 'create') {
print '</div>';
// Form to add new line
if ($user->rights->contrat->creer && ($object->statut == 0)) {
if ($user->hasRight('contrat', 'creer') && ($object->statut == 0)) {
$dateSelector = 1;
print "\n";
@@ -2127,7 +2127,7 @@ if ($action == 'create') {
// Send
if (empty($user->socid)) {
if ($object->statut == 1) {
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->contrat->creer)) {
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('contrat', 'creer'))) {
print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', true, $params);
} else {
print dolGetButtonAction('', $langs->trans('SendMail'), 'default', '#', '', false, $params);
@@ -2136,7 +2136,7 @@ if ($action == 'create') {
}
if ($object->statut == 0 && $nbofservices) {
if ($user->rights->contrat->creer) {
if ($user->hasRight('contrat', 'creer')) {
print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid&token='.newToken(), '', true, $params);
} else {
$params['attr']['title'] = $langs->trans("NotEnoughPermissions");
@@ -2144,7 +2144,7 @@ if ($action == 'create') {
}
}
if ($object->statut == 1) {
if ($user->rights->contrat->creer) {
if ($user->hasRight('contrat', 'creer')) {
print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken(), '', true, $params);
} else {
$params['attr']['title'] = $langs->trans("NotEnoughPermissions");
@@ -2204,7 +2204,7 @@ if ($action == 'create') {
}
// Clone
if ($user->rights->contrat->creer) {
if ($user->hasRight('contrat', 'creer')) {
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken(), '', true, $params);
}
@@ -2240,7 +2240,7 @@ if ($action == 'create') {
print '<br><!-- Link to sign -->';
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
print showOnlineSignatureUrl('contract', $object->ref).'<br>';
print showOnlineSignatureUrl('contract', $object->ref, $object).'<br>';
}
print '</div><div class="fichehalfright">';

View File

@@ -509,6 +509,12 @@ class Contracts extends DolibarrApi
if ($field == 'id') {
continue;
}
if ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
$this->contract->array_options[$index] = $this->_checkValForAPI($field, $val, $this->contract);
}
continue;
}
$this->contract->$field = $value;
}

View File

@@ -3227,7 +3227,7 @@ class ContratLigne extends CommonObjectLine
$sql .= " t.label,"; // This field is not used. Only label of product
$sql .= " p.ref as product_ref,";
$sql .= " p.label as product_label,";
$sql .= " p.description as product_desc,";
$sql .= " p.description as product_description,";
$sql .= " p.fk_product_type as product_type,";
$sql .= " t.description,";
$sql .= " t.date_commande,";
@@ -3761,15 +3761,13 @@ class ContratLigne extends CommonObjectLine
$error = 0;
// statut actif : 4
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET statut = ".((int) ContratLigne::STATUS_CLOSED).",";
$sql .= " date_cloture = '".$this->db->idate($date_end_real)."',";
$sql .= " fk_user_cloture = ".((int) $user->id).",";
$sql .= " commentaire = '".$this->db->escape($comment)."'";
$sql .= " WHERE rowid = ".((int) $this->id)." AND statut = ".((int) ContratLigne::STATUS_OPEN);
$sql .= " WHERE rowid = ".((int) $this->id)." AND statut <> ".((int) ContratLigne::STATUS_CLOSED);
$resql = $this->db->query($sql);
if ($resql) {

View File

@@ -348,6 +348,11 @@ if (!empty($filter_opcloture) && $filter_opcloture == ' BETWEEN ') {
}
// Add where from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
// Add where from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= $db->order($sortfield, $sortorder);
//print $sql;
@@ -452,6 +457,10 @@ if ($optioncss != '') {
}
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// Add $param from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
$param .= $hookmanager->resPrint;
// List of mass actions available
$arrayofmassactions = array(

View File

@@ -477,6 +477,11 @@ if (!$error && $massaction == 'confirm_presend') {
$substitutionarray['__EMAIL__'] = $thirdparty->email;
$substitutionarray['__CHECK_READ__'] = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag=undefined&securitykey='.dol_hash(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY')."-undefined", 'md5').'" width="1" height="1" style="width:1px;height:1px" border="0"/>';
if ($oneemailperrecipient) {
$substitutionarray['__ONLINE_PAYMENT_URL__'] = '';
$substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = '';
}
$parameters = array('mode'=>'formemail');
if (!empty($listofobjectthirdparties)) {

View File

@@ -310,7 +310,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO
// <img alt="" src="'.$urlwithroot.'viewimage.php?modulepart=medias&amp;entity=1&amp;file=image/ldestailleur_166x166.jpg" style="height:166px; width:166px" />
$message = preg_replace('/(<img.*src=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^\/]*\/>)/', '\1'.$urlwithroot.'/viewimage.php\2modulepart=medias\3file=\4\5', $message);
$sendtobcc = GETPOST('sendtoccc');
$sendtobcc = GETPOST('sendtoccc', 'alphawithlgt');
// Autocomplete the $sendtobcc
// $autocopy can be MAIN_MAIL_AUTOCOPY_PROPOSAL_TO, MAIN_MAIL_AUTOCOPY_ORDER_TO, MAIN_MAIL_AUTOCOPY_INVOICE_TO, MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO...
if (!empty($autocopy)) {

View File

@@ -106,7 +106,7 @@ class box_actions extends ModeleBoxes
$sql .= " AND s.rowid = ".((int) $user->socid);
}
if (!$user->hasRight('agenda', 'allactions', 'read')) {
$sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id)." OR a.fk_user_done = ".((int) $user->id).")";
$sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id).")";
}
$sql .= " ORDER BY a.datep ASC";
$sql .= $this->db->plimit($max, 0);

View File

@@ -111,7 +111,7 @@ class box_activity extends ModeleBoxes
$data = array();
$sql = "SELECT p.fk_statut, SUM(p.total_ttc) as Mnttot, COUNT(*) as nb";
$sql = "SELECT p.fk_statut, SUM(p.total_ttc) as mnttot, COUNT(*) as nb";
$sql .= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
if (empty($user->rights->societe->client->voir) && !$user->socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -171,7 +171,7 @@ class box_activity extends ModeleBoxes
$this->info_box_contents[$line][3] = array(
'td' => 'class="nowraponall right amount"',
'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency),
'text' => price($data[$j]->mnttot, 1, $langs, 0, 0, -1, $conf->currency),
);
$this->info_box_contents[$line][4] = array(
'td' => 'class="right" width="18"',
@@ -200,7 +200,7 @@ class box_activity extends ModeleBoxes
$data = array();
$sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb";
$sql = "SELECT c.fk_statut, sum(c.total_ttc) as mnttot, count(*) as nb";
$sql .= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
if (empty($user->rights->societe->client->voir) && !$user->socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -257,7 +257,7 @@ class box_activity extends ModeleBoxes
$this->info_box_contents[$line][3] = array(
'td' => 'class="nowraponall right amount"',
'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency),
'text' => price($data[$j]->mnttot, 1, $langs, 0, 0, -1, $conf->currency),
);
$this->info_box_contents[$line][4] = array(
'td' => 'class="right" width="18"',
@@ -285,7 +285,7 @@ class box_activity extends ModeleBoxes
// part 1
$data = array();
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as mnttot, COUNT(*) as nb";
$sql .= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
if (empty($user->rights->societe->client->voir) && !$user->socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -342,7 +342,7 @@ class box_activity extends ModeleBoxes
$this->info_box_contents[$line][3] = array(
'td' => 'class="nowraponall right amount"',
'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency)
'text' => price($data[$j]->mnttot, 1, $langs, 0, 0, -1, $conf->currency)
);
// We add only for the current year
@@ -366,7 +366,7 @@ class box_activity extends ModeleBoxes
// part 2
$data = array();
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as mnttot, COUNT(*) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql .= " WHERE f.entity IN (".getEntity('invoice').')';
$sql .= " AND f.fk_soc = s.rowid";
@@ -415,7 +415,7 @@ class box_activity extends ModeleBoxes
$totalnb += $data[$j]->nb;
$this->info_box_contents[$line][3] = array(
'td' => 'class="nowraponall right amount"',
'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency),
'text' => price($data[$j]->mnttot, 1, $langs, 0, 0, -1, $conf->currency),
);
$this->info_box_contents[$line][4] = array(
'td' => 'class="right" width="18"',

View File

@@ -180,7 +180,7 @@ class box_validated_projects extends ModeleBoxes
$this->info_box_contents[$i][] = array(
'td' => 'class="center"',
'text' => $objp->startDate,
'text' => $objp->startdate,
);
$this->info_box_contents[$i][] = array(

View File

@@ -577,7 +577,7 @@ class CMailFile
if (!empty($this->errors_to)) {
try {
$headers->addTextHeader('Errors-To', $this->getArrayAddress($this->errors_to));
$headers->addTextHeader('Errors-To', $this->getValidAddress($this->errors_to, 0));
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
}
@@ -644,7 +644,6 @@ class CMailFile
$this->errors[] = $e->getMessage();
}
}
//if (!empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to));
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) {
try {
$this->message->setReadReceiptTo($this->getArrayAddress($this->addr_from));
@@ -687,7 +686,7 @@ class CMailFile
$this->error = "Error in hook maildao sendMail ".$reshook;
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
return $reshook;
return false;
}
if ($reshook == 1) { // Hook replace standard code
return true;
@@ -894,7 +893,7 @@ class CMailFile
}
} elseif ($this->sendmode == 'smtps') {
if (!is_object($this->smtps)) {
$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."<br>Constructor of object CMailFile was not initialized without errors.";
$this->error = "Failed to send mail with smtps lib to HOST=".ini_get('SMTP').", PORT=".$conf->global->$keyforsmtpport."<br>Constructor of object CMailFile was not initialized without errors.";
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
return false;
}
@@ -1190,9 +1189,10 @@ class CMailFile
$res = true;
if (!empty($this->error) || !empty($this->errors) || !$result) {
if (!empty($failedRecipients)) {
$this->errors[] = 'Transport failed for the following addresses: "' . join('", "', $failedRecipients) . '".';
$this->error = 'Transport failed for the following addresses: "' . join('", "', $failedRecipients) . '".';
$this->errors[] = $this->error;
}
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
dol_syslog("CMailFile::sendfile: mail end error=". join(' ', $this->errors), LOG_ERR);
$res = false;
if (!empty($conf->global->MAIN_MAIL_DEBUG)) {

View File

@@ -2111,7 +2111,9 @@ abstract class CommonObject
$sql = "SELECT MAX(te.".$fieldid.")";
$sql .= " FROM ".(empty($nodbprefix) ?$this->db->prefix():'').$this->table_element." as te";
if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
$sql .= ",".$this->db->prefix()."usergroup_user as ug";
if (empty($user->admin) || !empty($user->entity) || $conf->entity != 1) {
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON ug.fk_user = te.rowid";
}
}
if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) {
$tmparray = explode('@', $this->ismultientitymanaged);
@@ -2148,7 +2150,6 @@ abstract class CommonObject
if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql .= " AND te.entity IS NOT NULL"; // Show all users
} else {
$sql .= " AND ug.fk_user = te.rowid";
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
}
} else {
@@ -2181,7 +2182,9 @@ abstract class CommonObject
$sql = "SELECT MIN(te.".$fieldid.")";
$sql .= " FROM ".(empty($nodbprefix) ?$this->db->prefix():'').$this->table_element." as te";
if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
$sql .= ",".$this->db->prefix()."usergroup_user as ug";
if (empty($user->admin) || !empty($user->entity) || $conf->entity != 1) {
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON ug.fk_user = te.rowid";
}
}
if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) {
$tmparray = explode('@', $this->ismultientitymanaged);
@@ -2218,7 +2221,6 @@ abstract class CommonObject
if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql .= " AND te.entity IS NOT NULL"; // Show all users
} else {
$sql .= " AND ug.fk_user = te.rowid";
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
}
} else {
@@ -4056,8 +4058,12 @@ abstract class CommonObject
$classpath = 'adherents/class';
$module = 'adherent';
} elseif ($objecttype == 'contact') {
$module = 'societe';
$module = 'societe';
} elseif ($objecttype == 'action') {
$module = 'agenda';
$subelement = 'actionComm';
}
// Set classfile
$classfile = strtolower($subelement);
$classname = ucfirst($subelement);
@@ -5207,16 +5213,12 @@ abstract class CommonObject
$discount->fk_soc = $this->socid;
$this->tpl['label'] .= $discount->getNomUrl(0, 'discount');
} elseif (!empty($line->fk_product)) {
$productstatic = new Product($this->db);
$productstatic->id = $line->fk_product;
$productstatic->ref = $line->ref;
$productstatic->type = $line->fk_product_type;
if (empty($productstatic->ref)) {
if (empty($line->product)) {
$line->fetch_product();
$productstatic = $line->product;
}
$productstatic = $line->product;
$this->tpl['label'] .= $productstatic->getNomUrl(1);
$this->tpl['label'] .= (is_object($productstatic) ? $productstatic->getNomUrl(1) : $line->ref);
$this->tpl['label'] .= ' - '.(!empty($line->label) ? $line->label : $line->product_label);
// Dates
if ($line->product_type == 1 && ($date_start || $date_end)) {
@@ -7042,7 +7044,7 @@ abstract class CommonObject
}
$out .= '<select class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '').'>';
if ((!isset($this->fields[$key]['default'])) || ($this->fields[$key]['notnull'] != 1)) {
if ((!isset($this->fields[$key]['default'])) || empty($this->fields[$key]['notnull']) || ($this->fields[$key]['notnull'] != 1)) {
$out .= '<option value="0">&nbsp;</option>';
}
foreach ($param['options'] as $keyb => $valb) {
@@ -8208,6 +8210,10 @@ abstract class CommonObject
if (($mode == 'create') && abs($visibility) != 1 && abs($visibility) != 3) {
continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
} elseif (($mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3 && abs($visibility) != 4) {
// We need to make sure, that the values of hidden extrafields are also part of $_POST. Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost
$ef_name = 'options_' . $key;
$ef_value = $this->array_options[$ef_name];
$out .= '<input type="hidden" name="' . $ef_name . '" id="' . $ef_name . '" value="' . $ef_value . '" />' . "\n";
continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation
} elseif ($mode == 'view' && empty($visibility)) {
continue;
@@ -8329,7 +8335,7 @@ abstract class CommonObject
}
}
$datekey = $keyprefix.'options_'.$key.$keysuffix;
$value = (GETPOSTISSET($datekey)) ? dol_mktime(12, 0, 0, GETPOST($datekey.'month', 'int', 3), GETPOST($datekey.'day', 'int', 3), GETPOST($datekey.'year', 'int', 3)) : $datenotinstring;
$value = (GETPOSTISSET($datekey) && $this->id == GETPOST('elrowid', 'int')) ? dol_mktime(12, 0, 0, GETPOST($datekey.'month', 'int', 3), GETPOST($datekey.'day', 'int', 3), GETPOST($datekey.'year', 'int', 3)) : $datenotinstring;
}
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('datetime'))) {
$datenotinstring = null;
@@ -9517,6 +9523,7 @@ abstract class CommonObject
if ($resql) {
$num_rows = $this->db->num_rows($resql);
$i = 0;
$this->lines = array();
while ($i < $num_rows) {
$obj = $this->db->fetch_object($resql);
if ($obj) {

View File

@@ -58,6 +58,7 @@ class FileUpload
$pathname = str_replace('/class', '', $element_prop['classpath']);
$filename = $element_prop['classfile'];
$dir_output = $element_prop['dir_output'];
$savingDocMask = '';
//print 'fileupload.class.php: element='.$element.' pathname='.$pathname.' filename='.$filename.' dir_output='.$dir_output."\n";
@@ -73,6 +74,11 @@ class FileUpload
$object_ref = dol_sanitizeFileName($object->ref);
// add object reference as file name prefix if const MAIN_DISABLE_SUGGEST_REF_AS_PREFIX is not enabled
if (!getDolGlobalInt('MAIN_DISABLE_SUGGEST_REF_AS_PREFIX')) {
$savingDocMask = $object_ref.'-__file__';
}
// Special cases to forge $object_ref used to forge $upload_dir
if ($element == 'invoice_supplier') {
$object_ref = get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$object_ref;
@@ -98,6 +104,7 @@ class FileUpload
'script_url' => $_SERVER['PHP_SELF'],
'upload_dir' => $dir_output.'/'.$object_ref.'/',
'upload_url' => DOL_URL_ROOT.'/document.php?modulepart='.$element.'&attachment=1&file=/'.$object_ref.'/',
'saving_doc_mask' => $savingDocMask,
'param_name' => 'files',
// Set the following option to 'POST', if your server does not support
// DELETE requests. This is a parameter sent to the client:
@@ -417,6 +424,14 @@ class FileUpload
if ($validate) {
if (dol_mkdir($this->options['upload_dir']) >= 0) {
// add object reference as file name prefix if const MAIN_DISABLE_SUGGEST_REF_AS_PREFIX is not enabled
$fileNameWithoutExt = preg_replace('/\.[^\.]+$/', '', $file->name);
$savingDocMask = $this->options['saving_doc_mask'];
if ($savingDocMask && strpos($savingDocMask, $fileNameWithoutExt) !== 0) {
$fileNameWithPrefix = preg_replace('/__file__/', $file->name, $savingDocMask);
$file->name = $fileNameWithPrefix;
}
$file_path = $this->options['upload_dir'].$file->name;
$append_file = !$this->options['discard_aborted_uploads'] && is_file($file_path) && $file->size > filesize($file_path);

View File

@@ -3381,9 +3381,10 @@ class Form
}
$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, p.fk_product_type, p.stock, p.tva_tx as tva_tx_sale, p.default_vat_code as default_vat_code_sale,";
$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,";
$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, pfp.default_vat_code, pfp.fk_soc, s.nom as name,";
$sql .= " pfp.supplier_reputation";
$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice";
$sql .= ", pfp.multicurrency_code, pfp.multicurrency_unitprice";
$sql .= ", pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, pfp.default_vat_code, pfp.fk_soc, s.nom as name";
$sql .= ", pfp.supplier_reputation";
// if we use supplier description of the products
if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) {
$sql .= ", pfp.desc_fourn as description";
@@ -3689,6 +3690,10 @@ class Form
$optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"';
$optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"';
$optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"';
if (isModEnabled('multicurrency')) {
$optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"';
$optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"';
}
}
$optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"';
@@ -3710,6 +3715,10 @@ class Form
'disabled' => (empty($objp->idprodfournprice) ? true : false),
'description' => $objp->description
);
if (isModEnabled('multicurrency')) {
$outarrayentry['multicurrency_code'] = $objp->multicurrency_code;
$outarrayentry['multicurrency_unitprice'] = price2num($objp->multicurrency_unitprice, 'MU');
}
$parameters = array(
'objp' => &$objp,
@@ -3725,29 +3734,33 @@ class Form
// "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax
// "label" value of json key array is used by jQuery automatically as text for combo box
$out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n";
array_push(
$outarray,
array('key' => $outkey,
'value' => $outref,
'label' => $outvallabel,
'qty' => $outqty,
'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
'price_qty_ht_locale' => price($objp->fprice),
'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
'price_unit_ht_locale' => price($objp->unitprice),
'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
'tva_tx_formated' => price($objp->tva_tx),
'tva_tx' => price2num($objp->tva_tx),
'default_vat_code' => $objp->default_vat_code,
'discount' => $outdiscount,
'type' => $outtype,
'duration_value' => $outdurationvalue,
'duration_unit' => $outdurationunit,
'disabled' => (empty($objp->idprodfournprice) ? true : false),
'description' => $objp->description
)
$outarraypush = array(
'key' => $outkey,
'value' => $outref,
'label' => $outvallabel,
'qty' => $outqty,
'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
'price_qty_ht_locale' => price($objp->fprice),
'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
'price_unit_ht_locale' => price($objp->unitprice),
'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
'tva_tx_formated' => price($objp->tva_tx),
'tva_tx' => price2num($objp->tva_tx),
'default_vat_code' => $objp->default_vat_code,
'discount' => $outdiscount,
'type' => $outtype,
'duration_value' => $outdurationvalue,
'duration_unit' => $outdurationunit,
'disabled' => (empty($objp->idprodfournprice) ? true : false),
'description' => $objp->description
);
// Exemple of var_dump $outarray
if (isModEnabled('multicurrency')) {
$outarraypush['multicurrency_code'] = $objp->multicurrency_code;
$outarraypush['multicurrency_unitprice'] = price2num($objp->multicurrency_unitprice, 'MU');
}
array_push($outarray, $outarraypush);
// Example of var_dump $outarray
// array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp"
// ["label"]=>string(76) "ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)"
// ["qty"]=>string(1) "1" ["discount"]=>string(1) "0" ["disabled"]=>bool(false)
@@ -4319,7 +4332,7 @@ class Form
if (depositPercent.length > 0) {
$("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent);
} else {
$("#' . $htmlname . '_deposit_percent_container").hide();
$("#' . $htmlname . '_deposit_percent_container").hide().find("#' . $htmlname . '_deposit_percent").val(0);
}
return true;
@@ -6235,7 +6248,7 @@ class Form
$TCurrency = array();
$sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency";
$sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')";
$sql .= " WHERE entity IN ('" . getEntity('multicurrency') . "')";
if ($filter) {
$sql .= " AND " . $filter;
}
@@ -8389,7 +8402,7 @@ class Form
},
cache: true
},
language: select2arrayoflanguage,
language: (typeof select2arrayoflanguage === \'undefined\') ? \'en\' : select2arrayoflanguage,
containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
placeholder: "' . dol_escape_js($placeholder) . '",
escapeMarkup: function (markup) { return markup; }, // let our custom formatter work
@@ -8479,7 +8492,7 @@ class Form
$(".' . $htmlname . '").select2({
data: data,
language: select2arrayoflanguage,
language: (typeof select2arrayoflanguage === \'undefined\') ? \'en\' : select2arrayoflanguage,
containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
placeholder: "' . dol_escape_js($placeholder) . '",
escapeMarkup: function (markup) { return markup; }, // let our custom formatter work

View File

@@ -502,8 +502,6 @@ class FormAccounting extends Form
return -1;
}
ksort($aux_account);
$this->db->free($resql);
// Auxiliary user account
@@ -526,6 +524,8 @@ class FormAccounting extends Form
}
$this->db->free($resql);
ksort($aux_account);
if ($usecache) {
$this->options_cache[$usecache] = $aux_account;
}

View File

@@ -879,12 +879,12 @@ class FormMail extends Form
// Complete substitution array with the url to make online payment
$paymenturl = '';
$validpaymentmethod = array();
// Set the online payment url link into __ONLINE_PAYMENT_URL__ key
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$validpaymentmethod = getValidOnlinePaymentMethods('');
if (empty($this->substit['__REF__'])) {
$paymenturl = '';
} else {
// Set the online payment url link into __ONLINE_PAYMENT_URL__ key
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$langs->loadLangs(array('paypal', 'other'));
$typeforonlinepayment = 'free';
if ($this->param["models"] == 'order' || $this->param["models"] == 'order_send') {
@@ -898,14 +898,15 @@ class FormMail extends Form
}
$url = getOnlinePaymentUrl(0, $typeforonlinepayment, $this->substit['__REF__']);
$paymenturl = $url;
$validpaymentmethod = getValidOnlinePaymentMethods('');
}
if (count($validpaymentmethod) > 0 && $paymenturl) {
$langs->load('other');
$this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'] = str_replace('\n', "\n", $langs->transnoentities("PredefinedMailContentLink", $paymenturl));
$this->substit['__ONLINE_PAYMENT_URL__'] = $paymenturl;
} elseif (count($validpaymentmethod) > 0) {
$this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'] = '__ONLINE_PAYMENT_TEXT_AND_URL__';
$this->substit['__ONLINE_PAYMENT_URL__'] = '__ONLINE_PAYMENT_URL__';
} else {
$this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'] = '';
$this->substit['__ONLINE_PAYMENT_URL__'] = '';

View File

@@ -332,7 +332,7 @@ class FormTicket
// Type of Ticket
print '<tr><td class="titlefield"><span class="fieldrequired"><label for="selecttype_code">'.$langs->trans("TicketTypeRequest").'</span></label></td><td>';
$this->selectTypesTickets((GETPOST('type_code', 'alpha') ? GETPOST('type_code', 'alpha') : $this->type_code), 'type_code', '', 2, 1, 0, 0, 'minwidth200');
$this->selectTypesTickets((GETPOST('type_code', 'alpha') ? GETPOST('type_code', 'alpha') : $this->type_code), 'type_code', '', 2, 'ifone', 0, 0, 'minwidth200');
print '</td></tr>';
// Group => Category
@@ -342,12 +342,12 @@ class FormTicket
$filter = 'public=1';
}
$selected = (GETPOST('category_code') ? GETPOST('category_code') : $this->category_code);
$this->selectGroupTickets($selected, 'category_code', $filter, 2, 1, 0, 0, 'minwidth200');
$this->selectGroupTickets($selected, 'category_code', $filter, 2, 'ifone', 0, 0, 'minwidth200');
print '</td></tr>';
// Severity => Priority
print '<tr><td><span class="fieldrequired"><label for="selectseverity_code">'.$langs->trans("TicketSeverity").'</span></label></td><td>';
$this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', 2, 1);
$this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', 2, 'ifone');
print '</td></tr>';
if (!empty($conf->knowledgemanagement->enabled)) {
@@ -690,8 +690,8 @@ class FormTicket
* @param string|array $selected Id of preselected field or array of Ids
* @param string $htmlname Nom de la zone select
* @param string $filtertype To filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz))
* @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
* @param int $empty 1=peut etre vide, 0 sinon
* @param int $format 0=id+label, 1=code+code, 2=code+label, 3=id+code
* @param int|string $empty 1 = can be empty or 'string' to show the string as the empty value, 0 = can't be empty, 'ifone' = can be empty but autoselected if there is one only
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
* @param int $maxlength Max length of label
* @param string $morecss More CSS
@@ -715,9 +715,9 @@ class FormTicket
$ticketstat->loadCacheTypesTickets();
print '<select id="select'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.($multiselect?'[]':'').'"'.($multiselect?' multiple':'').'>';
print '<select id="select'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.($multiselect ? '[]' : '').'"'.($multiselect ? ' multiple' : '').'>';
if ($empty) {
print '<option value="">&nbsp;</option>';
print '<option value="">'.((is_numeric($empty) || $empty == 'ifone') ? '&nbsp;' : $empty).'</option>';
}
if (is_array($ticketstat->cache_types_tickets) && count($ticketstat->cache_types_tickets)) {
@@ -753,7 +753,9 @@ class FormTicket
print ' selected="selected"';
} elseif (in_array($id, $selected)) {
print ' selected="selected"';
} elseif ($arraytypes['use_default'] == "1" && !$selected && !$empty) {
} elseif ($arraytypes['use_default'] == "1" && empty($selected) && !$multiselect) {
print ' selected="selected"';
} elseif (count($ticketstat->cache_types_tickets) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it
print ' selected="selected"';
}
@@ -813,10 +815,10 @@ class FormTicket
$ticketstat = new Ticket($this->db);
$ticketstat->loadCacheCategoriesTickets($publicgroups ? 1 : -1); // get list of active ticket groups
if ($use_multilevel <= 0) {
if ($use_multilevel <= 0) { // Only one combo list to select the group of ticket (default)
print '<select id="select'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
if ($empty) {
print '<option value="">&nbsp;</option>';
print '<option value="">'.((is_numeric($empty) || $empty == 'ifone') ? '&nbsp;' : $empty).'</option>';
}
if (is_array($ticketstat->cache_category_tickets) && count($ticketstat->cache_category_tickets)) {
@@ -861,9 +863,9 @@ class FormTicket
print ' selected="selected"';
} elseif (isset($selected) && $selected == $id) {
print ' selected="selected"';
} elseif ($arraycategories['use_default'] == "1" && !$selected && !$empty) {
} elseif ($arraycategories['use_default'] == "1" && !$selected && (!$empty || $empty == 'ifone')) {
print ' selected="selected"';
} elseif (count($ticketstat->cache_category_tickets) == 1) {
} elseif (count($ticketstat->cache_category_tickets) == 1 && (!$empty || $empty == 'ifone')) {
print ' selected="selected"';
}
@@ -1135,14 +1137,14 @@ class FormTicket
/**
* Return html list of ticket severitys (priorities)
*
* @param string $selected Id severity pre-selected
* @param string $htmlname Name of the select area
* @param string $filtertype To filter on field type in llx_c_ticket_severity (array('code'=>xx,'label'=>zz))
* @param int $format 0 = id+label, 1 = code+code, 2 = code+label, 3 = id+code
* @param int $empty 1 = can be empty, 0 = or not
* @param int $noadmininfo 0 = add admin info, 1 = disable admin info
* @param int $maxlength Max length of label
* @param string $morecss More CSS
* @param string $selected Id severity pre-selected
* @param string $htmlname Name of the select area
* @param string $filtertype To filter on field type in llx_c_ticket_severity (array('code'=>xx,'label'=>zz))
* @param int $format 0 = id+label, 1 = code+code, 2 = code+label, 3 = id+code
* @param int|string $empty 1 = can be empty or 'string' to show the string as the empty value, 0 = can't be empty, 'ifone' = can be empty but autoselected if there is one only
* @param int $noadmininfo 0 = add admin info, 1 = disable admin info
* @param int $maxlength Max length of label
* @param string $morecss More CSS
* @return void
*/
public function selectSeveritiesTickets($selected = '', $htmlname = 'ticketseverity', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '')
@@ -1163,7 +1165,7 @@ class FormTicket
print '<select id="select'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
if ($empty) {
print '<option value="">&nbsp;</option>';
print '<option value="">'.((is_numeric($empty) || $empty == 'ifone') ? '&nbsp;' : $empty).'</option>';
}
if (is_array($ticketstat->cache_severity_tickets) && count($ticketstat->cache_severity_tickets)) {
@@ -1199,7 +1201,9 @@ class FormTicket
print ' selected="selected"';
} elseif (isset($selected) && $selected == $id) {
print ' selected="selected"';
} elseif ($arrayseverities['use_default'] == "1" && !$selected && !$empty) {
} elseif ($arrayseverities['use_default'] == "1" && empty($selected) && (!$empty || $empty == 'ifone')) {
print ' selected="selected"';
} elseif (count($ticketstat->cache_severity_tickets) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it
print ' selected="selected"';
}

View File

@@ -580,7 +580,7 @@ class Translate
*/
private function getTradFromKey($key)
{
global $conf, $db;
global $db;
if (!is_string($key)) {
//xdebug_print_function_stack('ErrorBadValueForParamNotAString');
@@ -660,7 +660,7 @@ class Translate
}
}
// Crypt string into HTML
// Encode string into HTML
$str = htmlentities($str, ENT_COMPAT, $this->charset_output); // Do not convert simple quotes in translation (strings in html are embraced by "). Use dol_escape_htmltag around text in HTML content
// Restore reliable HTML tags into original translation string
@@ -670,6 +670,10 @@ class Translate
$str
);
// Remove dangerous sequence we should never have. Not needed into a translated response.
// %27 is entity code for ' and is replaced by browser automatically when translation is inside a javascript code called by a click like on a href link.
$str = str_replace(array('%27', '&#39'), '', $str);
if ($maxsize) {
$str = dol_trunc($str, $maxsize);
}
@@ -739,6 +743,10 @@ class Translate
$str = sprintf($str, $param1, $param2, $param3, $param4, $param5); // Replace %s and %d except for FormatXXX strings.
}
// Remove dangerous sequence we should never have. Not needed into a translated response.
// %27 is entity code for ' and is replaced by browser automatically when translation is inside a javascript code called by a click like on a href link.
$str = str_replace(array('%27', '&#39'), '', $str);
return $str;
} else {
/*if ($key[0] == '$') {

View File

@@ -532,13 +532,13 @@ class Utils
} elseif ($compression == 'zstd') {
fclose($handle);
}
if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error
if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg) || preg_match('/^\/\*M?!999999/', $errormsg)) { // Start of file is ok, NOT an error
$errormsg = '';
} else {
// Renommer fichier sortie en fichier erreur
// Rename file out into a file error
//print "$outputfile -> $outputerror";
@dol_delete_file($outputerror, 1, 0, 0, null, false, 0);
@rename($outputfile, $outputerror);
@dol_move($outputfile, $outputerror, '0', 1, 0, 0);
// Si safe_mode on et command hors du parametre exec, on a un fichier out vide donc errormsg vide
if (!$errormsg) {
$langs->load("errors");

View File

@@ -158,12 +158,13 @@ abstract class DoliDB implements Database
*
* @param string $stringtosanitize String to escape
* @param int $allowsimplequote 1=Allow simple quotes in string. When string is used as a list of SQL string ('aa', 'bb', ...)
* @param string $allowsequals 1=Allow equals sign
* @param int $allowsequals 1=Allow equals sign
* @param int $allowsspace 1=Allow space char
* @return string String escaped
*/
public function sanitize($stringtosanitize, $allowsimplequote = 0, $allowsequals = 0)
public function sanitize($stringtosanitize, $allowsimplequote = 0, $allowsequals = 0, $allowsspace = 0)
{
return preg_replace('/[^a-z0-9_\-\.,'.($allowsequals ? '=' : '').($allowsimplequote ? "\'" : '').']/i', '', $stringtosanitize);
return preg_replace('/[^a-z0-9_\-\.,'.($allowsequals ? '=' : '').($allowsimplequote ? "\'" : '').($allowsspace ? ' ' : '').']/i', '', $stringtosanitize);
}
/**

View File

@@ -718,7 +718,7 @@ class DoliDBPgsql extends DoliDB
*/
public function escape($stringtoencode)
{
return pg_escape_string($stringtoencode);
return pg_escape_string($this->db, $stringtoencode);
}
/**

View File

@@ -252,7 +252,7 @@ if (!class_exists('MenuManager')) {
$menufound = 0;
$dirmenus = array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']);
foreach ($dirmenus as $dirmenu) {
$menufound = dol_include_once($dirmenu."standard/".$file_menu);
$menufound = dol_include_once($dirmenu."standard/".dol_sanitizeFileName($file_menu));
if ($menufound) {
break;
}
@@ -260,7 +260,7 @@ if (!class_exists('MenuManager')) {
if (!$menufound) { // If failed to include, we try with standard
dol_syslog("You define a menu manager '".$file_menu."' that can not be loaded.", LOG_WARNING);
$file_menu = 'eldy_menu.php';
include_once DOL_DOCUMENT_ROOT."/core/menus/standard/".$file_menu;
include_once DOL_DOCUMENT_ROOT."/core/menus/standard/".dol_sanitizeFileName($file_menu);
}
}
$menumanager = new MenuManager($db, empty($user->socid) ? 0 : 1);

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