Commit Graph

11176 Commits

Author SHA1 Message Date
Laurent Destailleur
85ed3ad6d0 restore dolPrintLabel() 2024-02-21 14:51:44 +01:00
MDW
db223a041f Qual: Optimisation in load criteria (dol_dir_list) (#28263)
# Qual: Optimisation in load criteria (dol_dir_list)

By moving the "$sortcriteria" conditions into the load conditions, the
comparison between strings is less frequent.

The original test can probably even be removed as it is part of load_*.

The only side-effect that I can see is with the hook, but I think
in theory there should not be a negative side-effect, only a positive
one as this tells the hook to load the data we need without relying
on the hook to make the proper interpretation of the searchcriteria.
2024-02-20 19:36:30 +01:00
Laurent Destailleur
8acd3451d1 Doc 2024-02-20 18:40:14 +01:00
Laurent Destailleur
e36c2b2e29 doc 2024-02-20 18:29:11 +01:00
Laurent Destailleur
ae49542197 Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-02-20 14:50:51 +01:00
Laurent Destailleur
0492fb6098 FIX close #28279 2024-02-20 14:46:56 +01:00
MDW
246ec58531 Qual: Refactor for distinction between encodings (STEP6) (Was PR #28228 !) (#28281)
* Qual: Refactor for distinction between encodings

# Qual: Refactor for distinction between encodings

Renamed path/file variable to equivalents with prefix os_ and utf8.
Also added $utf8_fullpath to optimize.

* Fix: Fix mixed os_path/utf8_path

# Fix: Fix mixed os_path/utf8_path

This fixes the mixing of a os_path encoding en utf8_path encoding
by reorganising the statement order.

Also avoid a os_encode call by reusing data already available.
2024-02-20 02:09:00 +01:00
MDW
b2d90629e7 Qual: Apply php-cs-fixer to make only manual changes stand-out (#28300)
* Qual: Apply php-cs-fixer to make only manual changes stand-out

# Qual: Apply php-cs-fixer to make only manual changes stand-out

A few changes will be proposed in the future to these files.  This already commits
the esthetic changes using php-cs-fixes.

* Qual: Apply php-cs-fixer to make only manual changes stand-out

# Qual: Apply php-cs-fixer to make only manual changes stand-out

A few changes will be proposed in the future to these files.  This already commits
the esthetic changes using php-cs-fixes.

* Qual: Apply php-cs-fixer to make only manual changes stand-out

# Qual: Apply php-cs-fixer to make only manual changes stand-out

A few changes will be proposed in the future to these files.  This already commits
the esthetic changes using php-cs-fixes.
2024-02-20 01:27:46 +01:00
Laurent Destailleur
dff5d3ac93 Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-02-19 18:24:57 +01:00
Laurent Destailleur
43996fff1f Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2024-02-19 18:23:48 +01:00
Laurent Destailleur
dbeb4427dd Close #28261 2024-02-19 18:06:05 +01:00
Laurent Destailleur
7a45255427 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2024-02-19 18:02:14 +01:00
Laurent Destailleur
ebae0f60fc Clean code 2024-02-19 18:01:16 +01:00
Lucas Marcouiller
f84ae10dbf Fix some php warnings (#28278)
Co-authored-by: Hystepik <lmarcouiller@nltechno.com>
2024-02-19 17:57:16 +01:00
notmarrco
2c3eff1896 NEW: API Add some api endpoints (#25126)
* feat(api): Add updateLine to Bank api + add salaries api

* feat(api): Add "deleteLine" to bank api

* fix(api): Remove unneeded mandatory field "salary"

* feat(api): Add PaymentSalaries and PaymentExpenseReports API

* fix(bankaccount): Fix bad phpdoc return type

* fix(bankaccount): Fix bad phpdoc return type and comments

* add updateLabel function to AccountLine

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-02-19 17:03:07 +01:00
Regis Houssin
832284e710 FIX avoid error "Column 'entity' in where clause is ambiguous" (#28270) 2024-02-19 15:20:08 +01:00
MDW
fd674e6fe6 Qual: Fastest test first, and test object type (STEP2) (#28259)
* Qual: Remove useless ignore case on regex

# Qual: Remove useless ignore case on regex

The ignore case on this regex is useless and may have a performance impact.

* Qual: Fastest test first, and test object type

# Qual: Fastest test first, and test object type

The test on nohook should be fastest, and the instanceof test helps
static tool checkers and supposedly also helps performance
2024-02-19 15:18:20 +01:00
MDW
e24429ca2a Qual: Remove useless ignore case on regex (#28258)
# Qual: Remove useless ignore case on regex

The ignore case on this regex is useless and may have a performance impact.
2024-02-19 15:17:03 +01:00
Laurent Destailleur
978dd06c67 Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-02-19 15:02:37 +01:00
Laurent Destailleur
323063e5aa Removed dolPrintLabel(). Must use dolPrintHTML... 2024-02-19 14:30:02 +01:00
Laurent Destailleur
2365402137 NEW $noescapetags param of dol_escape_html works if attributes 2024-02-19 12:16:06 +01:00
Laurent Destailleur
5e4be61e7a Clean code 2024-02-19 10:16:50 +01:00
Laurent Destailleur
1ec1704de9 FIX Picto for mime 2024-02-19 09:58:42 +01:00
Lenin Rivas
a84ee2f1fb Contact phone mobile show Link to whatsapp (#28265)
* Contact phone mobile show Link to whatsapp

* Contact phone mobile with icon link to whatsapp

* Contact phone mobile show icon link to Whatsapp
2024-02-19 09:32:28 +01:00
MDW
275d190a2a Qual: Add verification on filters (dol_dir_list) (#28234)
# Qual: Add verification on filters (dol_dir_list)

As-is, '/' must be escaped in the regexes, this adds code to enforce
that requirement and avoid mistakes.

Even if the mathod using '{}' as delimiters is applied this check
could remain in place.

Also, returning empty array immediately - when the directory could
not be opened, closedir() can not be applied.
2024-02-18 23:44:35 +01:00
Laurent Destailleur
685cdecca5 FIX Picto for mime 2024-02-18 22:39:31 +01:00
Laurent Destailleur
50b4e6f81a NEW Add a link "Fill with layout" 2024-02-18 21:15:26 +01:00
Laurent Destailleur
1c0068c248 Doc 2024-02-18 18:27:10 +01:00
Laurent Destailleur
e6120d409f Clean code 2024-02-18 17:00:42 +01:00
Frédéric FRANCE
cb995b293d add photos in category banner (#28221) 2024-02-18 15:39:42 +01:00
Laurent Destailleur
f48ab54513 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2024-02-18 15:16:22 +01:00
Laurent Destailleur
44f718232c Doc 2024-02-18 15:13:56 +01:00
MDW
f5dd7d7c93 FIX: Fix unneeded access outside open_basedir when looking for modules (#28237)
* FIX: Fix unneeded access outside open_basedir when looking for modules

# FIX: Fix unneeded access outside open_basedir when looking for modules

Change the order in which the if conditions are tested so that an is_dir("dir/..") is avoided
by first testing if the subpath starts with a dot.

Also changed uppercased the first 3 letters of the file before comparing to CVS.

Finally, improved the typing hint and documentation.

The PHPUNIT test failed like this:

```
35) ExportTest::testExportModulesDatasets
is_dir(): open_basedir restriction in effect. File(D:\a\dolibarr\dolibarr\htdocs/..) is not within the allowed path(s): (D:\a\dolibarr\dolibarr\htdocs;D:\a\dolibarr\dolibarr\documents;D:\a\dolibarr\dolibarr\test;D:\a\dolibarr\dolibarr\dev\initdemo;c:\tools\php)

D:\a\dolibarr\dolibarr\htdocs\core\lib\functions2.lib.php:100
D:\a\dolibarr\dolibarr\htdocs\exports\class\export.class.php:119
D:\a\dolibarr\dolibarr\test\phpunit\ExportTest.php:463
```

* Fix spelling
2024-02-18 15:09:01 +01:00
Laurent Destailleur
a72077731f FIX Bad CRLF when sending text only content. Fix dol_htmlwithnojs() 2024-02-18 02:23:04 +01:00
Laurent Destailleur
4b6347e7e7 FIX Bad CRLF when sending text only content. Fix dol_htmlwithnojs() 2024-02-18 02:11:15 +01:00
Laurent Destailleur
3f99cce347 Fix #yogosha20850 2024-02-17 20:53:56 +01:00
Laurent Destailleur
8abe663d6f Add phpunit to test the rename/move into a corrupted pdf file. 2024-02-17 18:59:57 +01:00
Laurent Destailleur
750e3270ac Enhance apstats 2024-02-17 16:46:06 +01:00
Laurent Destailleur
00f69f90e6 FIX Pb in redirect of a website page in USEDOLIBARRSERVER mode 2024-02-17 15:11:20 +01:00
Laurent Destailleur
a23addd21e FIX Pb in redirect of a website page in USEDOLIBARRSERVER mode 2024-02-17 15:10:42 +01:00
Laurent Destailleur
713ee984d7 Fix syntax error 2024-02-17 14:40:45 +01:00
Laurent Destailleur
7f49fd355a NEW Add id of last page accessed in website 2024-02-17 14:35:57 +01:00
Laurent Destailleur
f9f549ef26 Work on generic filter 2024-02-17 04:07:34 +01:00
Laurent Destailleur
c711791197 Work on custom reports 2024-02-16 23:56:07 +01:00
MDW
844bc42240 FIX: Check valid mail server record correction. (#28197)
# FIX: Check valid mail server record correction.

The test for isValidMXRecord did not pass on Windows platform:

```bash
php -r '$a=getmxrr("yhaoo.com", $mxhosts, $weight);var_dump([$a,$mxhosts]);'

array(2) {
  [0] =>
  bool(true)
  [1] =>
  array(1) {
    [0] =>
    string(1) "."
  }
}

array(2) {
  [0] =>
  bool(true)
  [1] =>
  array(3) {
    [0] =>
    string(21) "mta5.am0.yahoodns.net"
    [1] =>
    string(21) "mta7.am0.yahoodns.net"
    [2] =>
    string(21) "mta6.am0.yahoodns.net"
  }
}

```

So an "invalid" MX record can be returned as a dot '.'.
2024-02-16 13:03:16 +01:00
Frédéric FRANCE
7cb8177de1 fix typos (#28198) 2024-02-16 12:13:25 +01:00
Frédéric FRANCE
647cf21b54 fix warnings in select_resource_list (#28189)
* fix warnings in select_resource_list

* fix warnings in select_resource_list

* fix warnings in select_resource_list

* fix warnings in select_resource_list
2024-02-16 02:40:27 +01:00
Laurent Destailleur
77db116447 Debug custom report 2024-02-16 02:11:04 +01:00
Laurent Destailleur
b48455c9d7 Can remove filter entries 2024-02-16 01:50:03 +01:00
Laurent Destailleur
7107b5feb3 Debug custom report filter management 2024-02-16 01:19:53 +01:00