2
0
forked from Wavyzz/dolibarr
Commit Graph

1525 Commits

Author SHA1 Message Date
Laurent Destailleur
29dc12dd58 Option MAIN_DISALLOW_URL_INTO_DESCRIPTIONS accept 1 or 2 value.
Value 1 should be ready to be on by default in a next version.
Fix #yogosha18900
2023-12-10 16:19:05 +01:00
Laurent Destailleur
729451faa2 FIX To support domain names with TLD on 2 levels. 2023-12-06 00:46:00 +01:00
Laurent Destailleur
c9fc494796 FIX To support domain names with TLD on 2 levels. 2023-12-06 00:27:52 +01:00
Laurent Destailleur
de7d3c2bf8 Fix with php-cs-fixer 2023-12-04 11:22:28 +01:00
Laurent Destailleur
0d1983766e Fix order of param 2023-12-01 19:48:26 +01:00
Laurent Destailleur
da244466b7 Add phpunit on utf8_check and utf8_valid 2023-11-30 21:22:20 +01:00
Laurent Destailleur
c417949a7e Fix phpunit 2023-11-30 00:06:05 +01:00
Laurent Destailleur
3e1d5b1748 Fix for MAIN_RESTRICTHTML_ONLY_VALID_HTML 2023-11-29 23:17:22 +01:00
Laurent Destailleur
d809825c21 Fix phpunit 2023-11-29 22:02:10 +01:00
Laurent Destailleur
0d61ee74c7 Fix phpunit 2023-11-29 20:32:03 +01:00
Laurent Destailleur
43f9210ab4 SEC: Add option MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY 2023-11-29 20:19:21 +01:00
Laurent Destailleur
955ecd1c16 Fix params in phpunit 2023-11-28 15:35:31 +01:00
Laurent Destailleur
1d589fd74e Fix warnings 2023-11-27 13:26:44 +01:00
Laurent Destailleur
4ecab54c28 Fix phpunit 2023-11-14 12:02:09 +01:00
Laurent Destailleur
659cdfa975 Add a test with a german char 2023-11-06 20:35:41 +01:00
Laurent Destailleur
604b01e803 Show error message 2023-11-06 00:56:44 +01:00
Alexandre Janniaux
c3b3840f08 QUAL Refactor merging companies and fix #26272 with Reception objects (#26320)
* societe: add missing model_pdf field

The field is used by the class but wasn't declared.

* societe: expose Societe::mergeCompany

The code is directly copied from societe/card.php with as less changes
as possible.

The original code came from deb91ad7c1.

* societe: remove fields from property copy

$phone_pro and $fk_project are not existing for societe. This was added
from deb91ad7c1.

* SocieteTest: test the merge functionality

This test is a simple smoke test to check that the mergeCompany() will
work correctly on simple case and actually merge the details of the
company.

More complex deduplication pattern with objects referencing the deleted
Societe object, will be written for each of the different object class
in their respective test file.

* societe: card: use the new mergeCompany function

Since the code is almost the same, there should be no differences in
behaviour right now.

* societe: api_thirdparties: use Societe::mergeCompany()

* societe: fix issue when merging companies

When a Societe object is merged against another, its related objects are
supposed to reference the new Societe object so that the databse doesn't
raise foreign key errors.

The list references the objects that need to be transformed, and
Reception objects weren't part of this list.

Fix #26272

* ReceptionTest: check company merge hook

Before a Societe object is destroyed from the database, every object
referencing the FK should be destroyed or should reference another
object.

In the case of two companies being merged, the case arises and Reception
objects need to be moved to the new company. This commit brings a
non-regression test for this case.

Refs #26272

* Update societe.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2023-10-26 16:30:38 +02:00
Alexandre Janniaux
9fe9eee18a FIX|Fix some minor issues on Reception and add a new test for it (#26310)
* reception: reOpen: mirror $this->statut in $this->status

$this->statut is the deprecated variable, $this->status should also get
the correct value.

* reception: setDraft: mirror $this->statut in $this->status

$this->statut is the deprecated variable, $this->status should also get
the correct value.

* reception: add missing $weight field

Fix warning:

    Undefined property: Reception::$weight

* societe: add country_id field

* reception: use getDolGlobalInt when suitable

Using empty() implies that the value actually exists on the stdClass at
$conf->global, but it's not always the case. getDolGlobalInt will handle
this smoothly by checking first, which solves warnings like those:

    Undefined property: stdClass::$STOCK_CALCULATE_ON_RECEPTION

* ReceptionTest: add new test

The test checks the usual workflow of the Reception class, with, on the
one hand, the common CRUD operations:
 - create
 - fetch
 - update
 - delete

And on the other hand, the status handling for Reception:
 - valid: STATUS_DRAFT -> STATUS_VALID
 - setClosed: STATUS_VALID -> STATUS_CLOSED
 - reOpen: STATUS_CLOSED -> STATUS_VALID
 - setDraft: STATUS_VALID -> STATUS_DRAFT

The stocks lines are not tested yet, and the error cases, like any other
transition not described above, are not tested either. The permissions
for some of the operations are hardcoded for the test and there is no
failure check when the permission is not set yet.
2023-10-21 16:28:30 +02:00
Laurent Destailleur
7a694d3485 Fix phpunit 2023-10-20 03:59:02 +02:00
Laurent Destailleur
9a8db612b3 Fix phpunit error 2023-10-17 15:48:38 +02:00
Laurent Destailleur
c1b74f9338 Fix phpunit regression 2023-09-29 17:04:11 +02:00
Laurent Destailleur
72e17fe60e Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2023-09-29 16:53:54 +02:00
Laurent Destailleur
b21a24aa97 Add AssetModel in AllTest 2023-09-26 20:52:49 +02:00
Hystepik
d157e8f660 New asset model phpunit test 2023-09-25 14:54:32 +02:00
Laurent Destailleur
557fe235d1 Fix warnings 2023-09-10 19:41:14 +02:00
Laurent Destailleur
b2ae9ea888 Fix warnings 2023-09-10 15:23:32 +02:00
Laurent Destailleur
ad9e11542c Fix phpunit warning 2023-09-10 15:16:46 +02:00
Laurent Destailleur
bc71380410 Fix sql errors 2023-09-09 21:16:58 +02:00
Laurent Destailleur
fb5f4c1dc2 NEW Add phpunit for REST API of contacts 2023-09-08 21:12:59 +02:00
Laurent Destailleur
33288ee66a Try to fix phpunit on dol_eval 2023-09-08 19:10:44 +02:00
Laurent Destailleur
6dbd7e35f2 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2023-09-08 14:17:17 +02:00
Laurent Destailleur
c379420d86 Fix regression in dol_eval 2023-09-08 14:12:12 +02:00
Laurent Destailleur
d91ce60ab4 Merge pull request #25819 from frederic34/setascustomer
deprecate set_as_client
2023-09-08 11:23:06 +02:00
Laurent Destailleur
e9787451a8 Disallow more use of parenthesis into dol_eval 2023-09-08 05:51:06 +02:00
Frédéric FRANCE
26dff90658 deprecate set_as_client 2023-09-06 14:38:35 +02:00
Laurent Destailleur
150de687bf Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into develop 2023-09-05 20:13:38 +02:00
Laurent Destailleur
0ed6a63fb0 FIX #CVE-2023-4197 2023-09-05 00:49:01 +02:00
Laurent Destailleur
552a079379 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into develop 2023-08-27 16:05:46 +02:00
Laurent Destailleur
45d323a6f8 Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2023-08-27 16:02:57 +02:00
Laurent Destailleur
4302a6bc04 Fix empty on getDolGlobal 2023-08-27 15:55:44 +02:00
Laurent Destailleur
c0e2d55549 Fix warnings 2023-08-26 00:43:51 +02:00
Laurent Destailleur
1293f48018 Fix phpunit 2023-08-26 00:05:58 +02:00
Laurent Destailleur
a0455c72a3 Test phpunit 2023-08-25 23:44:55 +02:00
Laurent Destailleur
a296751543 Fix phpunit 2023-08-25 22:04:37 +02:00
Laurent Destailleur
4c2645147c Fix phpunit API warnings 2023-08-25 15:52:31 +02:00
Laurent Destailleur
7e062f9391 Fix phpunit API warnings 2023-08-25 15:49:09 +02:00
Laurent Destailleur
c6a30bcf9e Fix phpunit 2023-08-25 15:45:12 +02:00
Laurent Destailleur
256fe9ecf8 Add more REST phpunit tests 2023-08-25 14:48:41 +02:00
Laurent Destailleur
bcd3401e47 Fix phpunit 2023-08-25 13:58:27 +02:00
oussamanhairech
572192a01f #14295 Rest API Contact test 2023-08-24 18:21:06 +02:00