2
0
forked from Wavyzz/dolibarr

Compare commits

..

893 Commits

Author SHA1 Message Date
Laurent Destailleur
5221c9e38f Fix editline 2021-10-17 19:41:17 +02:00
Laurent Destailleur
7bcc76c1aa Fix margin rates and mark rates are 2 different columns 2021-10-17 19:41:02 +02:00
Laurent Destailleur
78523e852d css 2021-10-17 14:04:49 +02:00
Laurent Destailleur
30d25bcb52 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-17 14:03:07 +02:00
Laurent Destailleur
30ba753b34 css 2021-10-17 14:02:37 +02:00
Laurent Destailleur
bd73545d08 Merge pull request #18985 from henrynopo/patch-5
Fix the rounding issue in case of multi-currency
2021-10-17 13:50:35 +02:00
Laurent Destailleur
7bfad108a8 Merge pull request #18995 from aspangaro/14p11
FIX User salary card - translation problem
2021-10-17 13:49:44 +02:00
Laurent Destailleur
ccf78a1af4 FIX Use of accent into filename of GED 2021-10-17 12:30:08 +02:00
Laurent Destailleur
b30d7371a4 Fix allow ' - ' into file name 2021-10-17 12:21:22 +02:00
Alexandre SPANGARO
fb30136202 Translation 2021-10-17 08:12:28 +02:00
Alexandre SPANGARO
e9ecb2e1ee Translation 2021-10-17 08:11:34 +02:00
Alexandre SPANGARO
102c8a5772 FIX User salary card - translation problem 2021-10-17 08:02:28 +02:00
Laurent Destailleur
8bdece7101 CSS 2021-10-16 21:43:48 +02:00
Laurent Destailleur
ee6780c46e FIX #18968 2021-10-16 21:37:12 +02:00
Laurent Destailleur
68bb625ec7 Merge pull request #18976 from PyroShape/142
FIX : #18634 : Problem of virtual stock with reception module enabled
2021-10-16 21:23:08 +02:00
Laurent Destailleur
1c07385aba Update product.class.php 2021-10-16 21:22:53 +02:00
Laurent Destailleur
830e067eff Fix for tzuser 2021-10-16 21:03:47 +02:00
Laurent Destailleur
5a4383c9ac Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-16 20:07:19 +02:00
Laurent Destailleur
f2757a63a1 Clean code 2021-10-16 20:06:58 +02:00
Laurent Destailleur
308d408cd0 Merge pull request #18980 from OPEN-DSI/v14-fix-print-date-user-timezone
FIX user date timezone offset
2021-10-16 20:03:42 +02:00
Laurent Destailleur
2b5bc202fc Merge pull request #18984 from henrynopo/patch-2
Supplier Invoice Payment List
2021-10-16 19:19:34 +02:00
Laurent Destailleur
46eed3767f Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-16 12:54:05 +02:00
Laurent Destailleur
52890c64c1 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/compta/facture/stats/index.php
	htdocs/compta/prelevement/create.php
2021-10-16 12:53:57 +02:00
Laurent Destailleur
faf80b94e9 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/compta/facture/stats/index.php
2021-10-16 12:49:18 +02:00
Laurent Destailleur
a2733344e7 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-10-16 12:33:32 +02:00
Laurent Destailleur
07052196e2 Fix popup message on sepa creation 2021-10-16 12:33:19 +02:00
stickler-ci
fb79aaeb0c Fixing style errors. 2021-10-15 07:19:49 +00:00
Henry
0cb1972674 Update card.php 2021-10-15 15:07:48 +08:00
Henry
316bc16634 Update card.php 2021-10-15 15:05:13 +08:00
Henry
3d62ee22d3 Supplier Invoice Payment List
fix the missing multicurrency payments and remainders
2021-10-15 11:13:40 +08:00
lvessiller
5d22eeeff2 FIX user date timezone offset 2021-10-14 16:06:22 +02:00
Laurent Destailleur
3875d26a2f Fix filter for supplierinvoice stats 2021-10-14 15:55:12 +02:00
Laurent Destailleur
db3d16f080 Fix filter tag for supplier invoice statistics 2021-10-14 15:43:35 +02:00
Laurent Destailleur
bc230dbfc2 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 12.0 2021-10-14 12:00:33 +02:00
Laurent Destailleur
371c75e76a FIX list of categories in stats of supplier invoices 2021-10-14 11:58:21 +02:00
Benjamin Chantalat
3438a4a9f6 Add the module reception to the calcul of virtual stock 2021-10-14 09:33:26 +02:00
Laurent Destailleur
fe3e11a104 Merge pull request #18957 from OPEN-DSI/v14-fix-takepos-payment-style
FIX payment style and html5 tags
2021-10-12 16:45:56 +02:00
lvessiller
ab4da186c5 FIX 2 columns for total labels 2021-10-12 15:52:59 +02:00
lvessiller
1788508963 FIX payment style and html5 tags 2021-10-12 14:11:19 +02:00
Laurent Destailleur
d75138b362 Merge pull request #18946 from atm-lena/13.0_FIX_HookCreateDictionaryFieldList_HTMLTRTag
Hook createDictionaryFieldList :  tr html tag to right place
2021-10-12 12:46:04 +02:00
Laurent Destailleur
3a7681c186 Merge pull request #18945 from PyroShape/14b
FIX : Remove not complete order from the virtual stock
2021-10-12 12:44:22 +02:00
Laurent Destailleur
2e32254574 Fix rul to shipment files 2021-10-11 20:36:10 +02:00
Laurent Destailleur
c4ca9e92a6 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-11 20:18:46 +02:00
Laurent Destailleur
6b69e64fb6 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-10-11 20:18:08 +02:00
Laurent Destailleur
4e9c7c9efb FIX Attachment of pdf into shipment when sending email 2021-10-11 20:04:45 +02:00
Laurent Destailleur
3a32787f15 Fix for backward compatibility 2021-10-11 16:14:34 +02:00
Laurent Destailleur
5fc0802eb1 Fix for backward compatibility 2021-10-11 16:13:55 +02:00
atm-lena
7c8bde885b hook createDictioaryFieldList : tr html tag to right place 2021-10-11 16:03:56 +02:00
Benjamin Chantalat
91164951de Remove not complete order from virtual stock 2021-10-11 15:24:56 +02:00
Laurent Destailleur
4fba60d2bb Merge pull request #18925 from OPEN-DSI/v14-fix-cron-reload-user-langs
FIX reload user lang
2021-10-11 11:21:28 +02:00
Laurent Destailleur
9c749a37b1 Merge pull request #18930 from OPEN-DSI/v14-fix-optionals-create-card
FIX optional visibility on create card
2021-10-11 11:07:56 +02:00
Laurent Destailleur
c9972b9eea Merge pull request #18937 from PyroShape/142
Fix date format into supplier order info tab
2021-10-11 11:04:39 +02:00
Laurent Destailleur
b43dcb24f0 Update fournisseur.commande.class.php 2021-10-11 11:04:21 +02:00
Laurent Destailleur
8ba05cc242 Merge pull request #18936 from PyroShape/14
FIX #18875 in v14
2021-10-11 10:26:55 +02:00
Laurent Destailleur
ff5f371428 Fix add protection to avoid deletion of page when deleting a file 2021-10-10 20:46:06 +02:00
Benjamin Chantalat
6e60e1f453 Fix date format into supplier order info tab 2021-10-09 20:38:46 +02:00
Benjamin Chantalat
de17b367c8 FIX #18875 in v14 2021-10-09 20:14:16 +02:00
Laurent Destailleur
cdf1d37a1d Fix changelog 2021-10-08 18:52:01 +02:00
lvessiller
90be175c50 FIX load tranlate array after setting lang 2021-10-08 16:20:51 +02:00
lvessiller
be4a00213c FIX optional visibility on create card 2021-10-08 15:58:08 +02:00
Laurent Destailleur
2f61c4e93b Add onbeforecopy and onbeforecut into the WAF 2021-10-08 12:14:42 +02:00
lvessiller
1efc2eda69 FIX reload user lang 2021-10-08 11:54:38 +02:00
Laurent Destailleur
816e4cdde6 Comment 2021-10-08 10:59:11 +02:00
Laurent Destailleur
b905b1b4bc FIX missing filter status=1 on rss feeds 2021-10-07 16:09:32 +02:00
Laurent Destailleur
d245abe908 Fix rounding 2021-10-07 11:34:21 +02:00
Laurent Destailleur
68ac62d09c Fix phpcs 2021-10-07 11:05:06 +02:00
Laurent Destailleur
9b5909300e Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/comm/action/class/actioncomm.class.php
	htdocs/compta/paiement/card.php
	htdocs/fourn/facture/card.php
2021-10-07 11:00:00 +02:00
Laurent Destailleur
efd44b0ec0 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-10-07 10:57:03 +02:00
Laurent Destailleur
5910d10021 Add hidden option to allow to fix corrupted situations 2021-10-07 10:43:50 +02:00
Laurent Destailleur
ed6fefc493 Trans 2021-10-07 04:10:39 +02:00
Laurent Destailleur
ec545f8967 Fix data 2021-10-07 02:58:51 +02:00
Laurent Destailleur
5463a02887 Debug v14 2021-10-06 21:59:10 +02:00
Laurent Destailleur
6cb690e678 Debug v14 2021-10-06 21:56:48 +02:00
Laurent Destailleur
8fe37b20c0 Debug v14 2021-10-06 21:54:04 +02:00
Laurent Destailleur
cc0b709ad5 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-06 21:47:59 +02:00
Laurent Destailleur
2a5e654544 Debug v14 2021-10-06 21:47:46 +02:00
Laurent Destailleur
b34279da89 Debug v14 2021-10-06 21:46:01 +02:00
Laurent Destailleur
f95b0c3033 Debug 2021-10-06 21:43:30 +02:00
Laurent Destailleur
88a482c615 Fix phpcs 2021-10-06 18:40:32 +02:00
Laurent Destailleur
144de734ce Fix phpcs 2021-10-06 18:39:16 +02:00
Laurent Destailleur
1c53035e38 Doc 2021-10-06 16:19:36 +02:00
Laurent Destailleur
e3032ef1c4 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/fourn/facture/card.php
2021-10-06 16:06:25 +02:00
Laurent Destailleur
eba377cdf0 Merge pull request #18860 from FHenry/12_fix_selectline_from_supplier_order_to_supplier_invoice
fix: Supplier order => Supplier Invoice : line selector (checkbox) wasn't working
2021-10-06 15:31:14 +02:00
Laurent Destailleur
10f0434116 Update card.php 2021-10-06 15:30:19 +02:00
Laurent Destailleur
3c885c1fce Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-06 14:27:47 +02:00
Laurent Destailleur
92ae3c9d52 Fix label in graph 2021-10-06 14:26:48 +02:00
Laurent Destailleur
7a9eb0baa7 Merge pull request #18911 from ksar-ksar/patch-10
FIX #18910 : MRP List SQL query syntax error with more than one extrafileds.
2021-10-06 14:10:37 +02:00
Laurent Destailleur
4be2d1414e Fix regression 2021-10-06 14:03:10 +02:00
Francis Appels
dceb2b5341 Fix fatal error 2021-10-06 13:36:11 +02:00
Rüdiger Hahn
d963aa8832 Allow removal of tabs
For being able to remove or replace tabs, it is also necessary to call
this function with 'remove' mode.
2021-10-06 13:35:34 +02:00
Laurent Destailleur
b630b15991 Add missing line to remove a tab in modulebuilder 2021-10-06 13:33:13 +02:00
Laurent Destailleur
ea3e3b133d Debug eventorganization modules 2021-10-06 12:55:07 +02:00
Laurent Destailleur
ff29ac93ad Debug eventorganization modules 2021-10-06 12:43:40 +02:00
Laurent Destailleur
3709c6ff47 Fix phpcs 2021-10-06 11:53:27 +02:00
Laurent Destailleur
93b4853f8e Fix var_dump 2021-10-06 11:52:12 +02:00
ksar
6a20fcc5c0 FIX #18910 2021-10-06 11:24:42 +02:00
Laurent Destailleur
123c047e29 Fix look and feel v14 2021-10-05 13:34:25 +02:00
Laurent Destailleur
b11dbf069e FIX Bad use of a forced contact of another company on PDF/ODT documents 2021-10-05 13:11:54 +02:00
Laurent Destailleur
b559dc9053 css 2021-10-05 08:55:57 +02:00
Laurent Destailleur
e14676be49 Fix phpunit 2021-10-04 19:09:38 +02:00
Laurent Destailleur
91ee704dc3 Move trans from admin to main 2021-10-04 12:16:50 +02:00
Laurent Destailleur
1c56f65c27 Fix missing migration instruction 2021-10-04 11:49:49 +02:00
Laurent Destailleur
e46d064d5e Clean text 2021-10-03 20:36:03 +02:00
Laurent Destailleur
2c32c6c5c9 Fix contextpage for list of tickets 2021-10-03 19:17:23 +02:00
Laurent Destailleur
e558adbcfc Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-03 18:20:34 +02:00
Laurent Destailleur
d6e1a6be93 Look and feel v14 2021-10-03 18:20:01 +02:00
Laurent Destailleur
4c6f2fc4b5 Merge pull request #18874 from OPEN-DSI/v14-fix-product-per-entity-portability-sql
FIX Product accountancy affectation with product_perentity activated …
2021-10-02 21:04:11 +02:00
Laurent Destailleur
c149af82fe Merge pull request #18873 from JR-Polyline/patch-1
Fix dynamic prices not updating
2021-10-02 20:45:16 +02:00
Laurent Destailleur
d99b3d601a FIX #18854 2021-10-02 20:07:09 +02:00
lvessiller
fd7d1374c2 FIX Product accountancy affectation with product_perentity activated (PR #18620) 2021-10-01 16:37:54 +02:00
JR-Polyline
2be2423dee Fix dynamic prices not updating
When Dynamic price module active and an a math expression is used to compute buy price on supplier product card, the calculated price does not update on the card when saved.
Changing line 849 appears to solve this without any ill effect.
2021-10-01 21:30:25 +08:00
Laurent Destailleur
d68719226b Fix can install module with name module_abc-x.y.z (w).zip 2021-10-01 14:10:50 +02:00
Laurent Destailleur
157112758b Fix phpcs 2021-09-30 20:14:59 +02:00
Laurent Destailleur
166d3b08d6 Add LIBXML_NONET to simplexml_load_string 2021-09-30 20:12:01 +02:00
Florian HENRY
6d00097c89 fix 2021-09-30 16:37:52 +02:00
Laurent Destailleur
0bf1db2fd4 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-30 16:29:10 +02:00
Laurent Destailleur
ed264182c6 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/admin/dict.php
	htdocs/comm/action/class/actioncomm.class.php
	htdocs/product/card.php
	htdocs/takepos/receipt.php
2021-09-30 16:28:42 +02:00
Laurent Destailleur
44bb5ebf34 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/comm/action/class/actioncomm.class.php
2021-09-30 16:23:34 +02:00
Laurent Destailleur
bb6399e12a Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/admin/dict.php
	htdocs/comm/action/class/actioncomm.class.php
	htdocs/product/card.php
2021-09-30 16:21:36 +02:00
Laurent Destailleur
fc4a16b356 Fix avoid error when trigger run on downgraded version. 2021-09-30 16:18:07 +02:00
Florian HENRY
d0508d557b fix: checkbox for line selection between supplier order and supplier invoice was infective 2021-09-30 14:56:02 +02:00
Laurent Destailleur
422191def1 Merge pull request #18858 from FHenry/12_fix_dict_tva
fix: search code on tva dict
2021-09-30 14:05:07 +02:00
Laurent Destailleur
620d7109b5 Update dict.php 2021-09-30 14:04:56 +02:00
Florian HENRY
332fa77d90 fix: search code on tva dict 2021-09-30 13:49:02 +02:00
Laurent Destailleur
ee79df9bc7 Merge pull request #18839 from indelog/fix_list_of_autoecmfiles
Fix FormFile::list_of_autoecmfiles object_instance classname after hook
2021-09-30 13:39:16 +02:00
Laurent Destailleur
ae9643bbef Update html.formfile.class.php 2021-09-30 13:38:38 +02:00
Laurent Destailleur
3deb424b4f Merge pull request #18845 from indelog/fix_doc_prev_ecm
Fix show for external module in ecm index auto page
2021-09-30 13:36:49 +02:00
Norbert Penel
4e86f872ca it was impossible to update a task
after some investigation i saw those errors but they are maybe some more around here
2021-09-30 13:35:23 +02:00
Laurent Destailleur
98d8bad955 Merge pull request #18843 from indelog/fix_ecm_deletion
Fix append module suffix on src_object_type when create ecm file
2021-09-30 13:32:42 +02:00
Laurent Destailleur
4fe9a4fd30 Merge pull request #18846 from hregis/fix_avoid_warning_if_not_an_array
FIX avoid warning if $categories is an id
2021-09-30 13:30:37 +02:00
Laurent Destailleur
04fa5ff70b css 2021-09-30 01:50:11 +02:00
Laurent Destailleur
fca39d9179 css 2021-09-30 01:15:36 +02:00
Laurent Destailleur
3d239e7528 Trans 2021-09-29 17:28:06 +02:00
Laurent Destailleur
11c48a53a5 Fix name of file 2021-09-29 17:20:59 +02:00
Laurent Destailleur
a495d5e982 Fix translation 2021-09-29 17:14:37 +02:00
Laurent Destailleur
2dd55301de Fix duplicate field and look and feel 2021-09-29 17:06:51 +02:00
Laurent Destailleur
52fb627a64 Look and feel v14 2021-09-29 16:45:48 +02:00
Laurent Destailleur
1d35d8fd2d CSS popup company 2021-09-29 16:42:52 +02:00
Laurent Destailleur
34dacca77c Css 2021-09-29 16:31:40 +02:00
Laurent Destailleur
a395ff5ee3 Css 2021-09-29 16:19:47 +02:00
Laurent Destailleur
10ea7ddeef Fix link param 2021-09-29 12:31:25 +02:00
Regis Houssin
6e08ecde04 FIX indentation 2021-09-29 08:47:22 +02:00
Laurent Destailleur
baadf2dc6c Fix reposition 2021-09-29 01:51:34 +02:00
Laurent Destailleur
1e840fe7ed Code comment 2021-09-28 18:07:04 +02:00
Regis Houssin
43a47999d7 FIX avoid warning if $categories is an id 2021-09-28 16:35:01 +02:00
Indelog
fae0337b3e Fix show for external module in ecm index auto page
This set the correct `modulepart` parameter for link generated to
`document.php` of ecm auto index page if `src_object_type` for
ecm document has a module suffix (`@modulename`).
2021-09-28 16:22:28 +02:00
Indelog
5b8b55cfba Fix append module suffix on src_object_type when create ecm file
Files added to `llx_ecm_files` for externals modules never be removed on
object deletion.

When `CommonObject::deleteEcmFiles()` is called with `mode=1`, it  use
this sql filter to find the file related to the object which is removed
:

```
$sql .= " WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX."ecm_files WHERE src_object_type = '".$this->db->escape($this->table_element.(empty($this->module) ? '' : '@'.$this->module))."' AND src_object_id = ".((int) $this->id).")";
```

We see it append `'@'.$this->module` to `$this->table_element` but when
file is add to the `llx_ecm_files` by
`CommonObject::commonGenerateDocument()` , it added whiteout the
`'@'.$this->module` suffix. So the file is never remove from
`llx_ecm_files` when object is deleted.

This fix it by appending module suffix on `src_object_type` if object
has `module` property when add document to the `llx_ecm_files`.
2021-09-28 15:26:08 +02:00
Laurent Destailleur
abc7137c81 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-28 13:45:05 +02:00
Laurent Destailleur
fc56b88a1f FIX select list of orders not complete when field type of company is on 2021-09-28 13:44:42 +02:00
Laurent Destailleur
d7986fafbc Merge pull request #18810 from aspangaro/14p16
FIX Accountancy - Missing specific filename for export on format FEC2
2021-09-28 13:20:33 +02:00
Alexandre SPANGARO
9426af8f6a NEW #18820 Accountancy - Add product account in import/export of thirdparty (level 3) 2021-09-28 13:16:44 +02:00
Laurent Destailleur
21fa60a730 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-28 13:08:03 +02:00
Laurent Destailleur
e6290b3b62 Merge pull request #18836 from aspangaro/14p22
FIX Propal list - Problem of pagination on date
2021-09-28 12:17:22 +02:00
Laurent Destailleur
c3d539abff Merge pull request #18833 from marc-dll/12.0_FIX_product_extrafields_update
FIX: products/services card: hidden extrafields were overridden
2021-09-28 12:13:08 +02:00
Laurent Destailleur
a70f5dd90e Doc 2021-09-28 12:12:11 +02:00
Indelog
2472dff67b Fix FormFile::list_of_autoecmfiles object_instance classname after hook
FormFile::list_of_autoecmfiles() can instantiate object with parameters
resulting of hook `addSectionECMAuto` but for do this,
it use `${$hookmanager->resArray['classname']}` which return a
`null`. Instead we should do this
`$hookmanager->resArray['classname']`.
2021-09-28 12:08:45 +02:00
Laurent Destailleur
0e3ec3ea2d Trans 2021-09-28 11:56:43 +02:00
Laurent Destailleur
e6e224f33c Better translation 2021-09-28 11:53:00 +02:00
Laurent Destailleur
0750d4bb6e Look and feel v14 2021-09-28 00:21:54 +02:00
Alexandre SPANGARO
43ed88f056 FIX Propal list - Problem of pagination on date 2021-09-27 23:02:19 +02:00
Laurent Destailleur
ec3154075a Comment 2021-09-27 22:16:08 +02:00
Laurent Destailleur
0e1cc2b096 Fix cost price is 0. 2021-09-27 18:46:27 +02:00
Marc de Lima Lucio
6abe6462e6 FIX: products/services card: hidden extrafields were overridden 2021-09-27 14:33:57 +02:00
Laurent Destailleur
b77cadf39a Fix filter 2021-09-27 11:38:34 +02:00
Laurent Destailleur
9b825df158 Clean code 2021-09-27 11:36:40 +02:00
Laurent Destailleur
c9ae46db50 FIX Filter on categories 2021-09-27 11:34:26 +02:00
Laurent Destailleur
6d92591358 Fix look and feel v15 2021-09-27 11:28:34 +02:00
Laurent Destailleur
d5d4b8d8e0 Fix escape the undescore on search in website module 2021-09-26 14:21:23 +02:00
Laurent Destailleur
cb964a3ab3 Fix cancel button 2021-09-26 13:55:19 +02:00
Laurent Destailleur
c02b5b08ea Fix trans 2021-09-26 12:58:34 +02:00
Laurent Destailleur
a47cd22450 Fix sql 2021-09-25 21:15:53 +02:00
Laurent Destailleur
567334318a Fix sql eventorganization 2021-09-25 21:13:55 +02:00
Alexandre SPANGARO
4e212054a4 Merge branch '14.0' into 14p16 2021-09-25 07:13:03 +02:00
Alexandre SPANGARO
8f5f657e4d FIX Accountancy - Missing specific filename for export on format FEC2, Ciel & repare it 2021-09-25 07:12:33 +02:00
Laurent Destailleur
14728e385e Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-24 13:36:40 +02:00
Laurent Destailleur
a3c8f2ed56 Merge pull request #18771 from laudeco/hotfix/receipt_html
Allow to edit the header of receipt by using HTML
2021-09-24 13:33:08 +02:00
Laurent Destailleur
128bba1d9b Fix GETPOST 2021-09-24 13:29:03 +02:00
Laurent Destailleur
fd817ed015 Merge pull request #18800 from hregis/fix_wrong_request_sql
FIX check if greater 0
2021-09-24 13:10:24 +02:00
Laurent Destailleur
42a71e9303 Merge pull request #18812 from Hystepik/develop_v14#1
Fix #18809 : error on client tooltip
2021-09-24 13:10:00 +02:00
Laurent Destailleur
f85f81c2ee Merge pull request #18811 from aspangaro/14p20
FIX Accountancy - Option of export popup are inverted
2021-09-24 13:09:04 +02:00
Laurent Destailleur
dbf7a9a0d0 FIX payment using wrong type in takepos when too many payment mode 2021-09-24 11:48:43 +02:00
lmarcouiller
f88d12f55d Fix #18809 : error on client tooltip 2021-09-24 11:16:34 +02:00
Alexandre SPANGARO
3e485dcb41 FIX Accountancy - Option of export popup are inverted 2021-09-24 06:38:43 +02:00
Alexandre SPANGARO
15313b8d37 FIX Accountancy - Missing specific filename for export on format FEC2 2021-09-24 06:03:01 +02:00
Laurent Destailleur
cd46ccdb66 Code comment 2021-09-24 02:31:15 +02:00
Laurent Destailleur
b09c4166b3 Fix set position of lines in tasks of a project 2021-09-24 02:24:04 +02:00
Laurent Destailleur
3d22cbe4da Fix look and feel 2021-09-24 02:16:40 +02:00
Laurent Destailleur
4c80e0425b Fix date for tasks created during project creation 2021-09-24 02:10:42 +02:00
Laurent Destailleur
8fb5286260 FIX #18797 2021-09-24 02:02:12 +02:00
DevIntact
36a902167f Translation of event title for incoming email
Event title for incoming email is not translated while collected by cronjob. 
i.e : ActionAC_EMAIL_IN
2021-09-24 01:49:16 +02:00
Laurent Destailleur
a2a4a74964 Fix trans 2021-09-23 16:18:21 +02:00
Laurent Destailleur
3467faab6b Fix property 2021-09-23 03:20:15 +02:00
Laurent Destailleur
31d9eb192f Clean code 2021-09-23 02:51:36 +02:00
Laurent Destailleur
128f6d9a5c Fix combo box for thirdparties in invoice stats used bad component 2021-09-23 02:38:53 +02:00
Laurent Destailleur
51b6318f88 FIX Test when date of invoie is in future (pb with TZ and offset) 2021-09-23 02:14:01 +02:00
Laurent De Coninck
70e66627fe restrict the html 2021-09-22 20:14:47 +02:00
stickler-ci
2bd0fdd364 Fixing style errors. 2021-09-22 14:09:29 +00:00
Laurent Destailleur
87da490b58 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-22 15:26:35 +02:00
Laurent Destailleur
a20ae60e70 Merge pull request #18793 from hregis/fix_wrong_table_element_line
FIX init hookmanager after loading $conf values
2021-09-22 15:25:17 +02:00
Laurent Destailleur
6f9fc205ef Merge pull request #18796 from altairis-noe/warehouse_project_elements
FIX: add warehouse in projects' overview count
2021-09-22 15:24:05 +02:00
Noé Cendrier
066013c31f typo stickler 2021-09-22 15:15:39 +02:00
Laurent Destailleur
2824c8b8ab FIX support of localtax on expense report 2021-09-22 15:11:18 +02:00
Regis Houssin
144147c5d1 FIX check if greater 0 2021-09-22 14:58:03 +02:00
Regis Houssin
d91d14d10c FIX init hookmanager after loading $conf values 2021-09-22 12:48:05 +02:00
Laurent Destailleur
6c7c6c9efd FIX legal issue on expense report pdf (must also show price without tax) 2021-09-22 12:47:06 +02:00
kamel
9266b4e8fd FIX Button text on proposal card for create a invoice 2021-09-21 19:44:49 +02:00
Laurent Destailleur
b5d7a752f7 Merge pull request #18766 from ksar-ksar/patch-10
FIX #18735
2021-09-21 19:28:09 +02:00
Laurent Destailleur
f96ea0cba0 Merge pull request #18776 from OPEN-DSI/fix-invoice-supplier-selected-lines
FIX selected lines on supplier invoice create
2021-09-21 19:09:13 +02:00
Laurent Destailleur
b049b663b6 Merge pull request #18775 from bb2a/patch-1
# Fix # Users search erreur
2021-09-21 19:04:55 +02:00
Laurent Destailleur
e4c47e65c1 Merge pull request #18777 from ksar-ksar/patch-11
FIX #18767 : Adherent delete
2021-09-21 19:04:03 +02:00
Laurent Destailleur
04fb93370f Merge pull request #18780 from ksar-ksar/patch-12
Missing translations for Inventories
2021-09-21 17:53:53 +02:00
Noé Cendrier
c89468428e add warehouse in projects elements count 2021-09-21 17:22:55 +02:00
Laurent Destailleur
9ba7f019ea Fix css 2021-09-21 16:53:29 +02:00
Laurent Destailleur
76ee014b52 Fix add a hidden solution to fix a corrupted value for AWP. 2021-09-21 16:32:32 +02:00
Laurent Destailleur
a7ccbb4d9a css 2021-09-21 15:40:42 +02:00
Laurent Destailleur
841c4da0f8 Fix css 2021-09-21 15:39:05 +02:00
Laurent Destailleur
09fff2150e Fix: avoid to add line for event registration twice into invoice 2021-09-21 15:30:34 +02:00
Laurent Destailleur
e2c389a4a9 Fix delete invoice 2021-09-21 14:23:21 +02:00
Laurent Destailleur
b7105d572a Fix delete of invoice not complete (some fk_invoice still filled) 2021-09-21 14:20:01 +02:00
ksar
7a6a515386 Missing translations for Inventories 2021-09-21 12:18:37 +02:00
Laurent Destailleur
06f97f4f80 Look and feel v14 2021-09-21 12:04:28 +02:00
ksar
f2b39b3eeb FIX #18767 : Adherent delete
Adherent Delete was not working due to the fact that 
$features = 'adherent';
$feature2 = 'cotisation';
And $user->rights->$feature->$subfeature->supprimer does not exist

Also I used the double declaration of salaries.
2021-09-21 11:27:41 +02:00
lvessiller
991a7ffd43 FIX selected lines on supplier invoice create 2021-09-21 11:04:59 +02:00
Anthony Berton
35707d1f4f Update list.php 2021-09-21 09:13:01 +02:00
Laurent De Coninck
5e2d8eac2b Allow to edit the header of receipt by using HTML
In the current version the WYSIWYG oesn't allow any HTML by thus fix you
can use any button from the wysiwyg and it displays on the receipe.

[see: X]
2021-09-20 22:51:43 +02:00
Laurent Destailleur
9b828532cc Fix membership css 2021-09-20 16:41:22 +02:00
Laurent Destailleur
c75fbb7642 FIX fetch of product with modulebuilder load too much data 2021-09-20 16:00:11 +02:00
Laurent Destailleur
1e735c48aa Code comment 2021-09-20 15:31:57 +02:00
Laurent Destailleur
f1b8941e27 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-20 15:30:06 +02:00
Laurent Destailleur
45c5abea69 FIX calculateCosts of BOM must not be included into fetch 2021-09-20 15:29:55 +02:00
Laurent Destailleur
261c0fc908 Merge pull request #18761 from javieralapps4up/14.0
Fix: #18760 bad rights admin if advanced perms
2021-09-20 14:06:58 +02:00
Laurent Destailleur
b97ad33911 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-20 13:21:13 +02:00
Laurent Destailleur
0eff2fa15b FIX default language defined for IN country 2021-09-20 13:20:54 +02:00
Laurent Destailleur
be2a95ca51 Add language as_IN 2021-09-20 13:01:53 +02:00
javieralapps4up
0453a27bda Update main.inc.php 2021-09-20 12:24:44 +02:00
ksar
131677a5ea FIX #18735
File preview is not working
2021-09-20 11:50:10 +02:00
Laurent Destailleur
e433dabc64 Merge pull request #18762 from aspangaro/14p16
FIX #18698 Supplier invoice list - "alert" checkbox not working
2021-09-20 11:04:52 +02:00
Alexandre SPANGARO
ce56f52a30 FIX #18698 Supplier invoice list - "alert" checkbox not working 2021-09-20 03:28:30 +02:00
stickler-ci
1ea2182bf7 Fixing style errors. 2021-09-19 20:32:07 +00:00
javieralapps4up
77e493755f Fix: #18760 bad rights admin if advanced perms
Insufficient rights to view a group's card for admin users if advanced permissions are used
2021-09-19 22:26:49 +02:00
Laurent Destailleur
b5a27b4c15 css 2021-09-19 21:27:01 +02:00
Laurent Destailleur
25971e373d Fix css 2021-09-19 21:20:12 +02:00
Laurent Destailleur
6af9f3b142 Fix css 2021-09-19 21:18:30 +02:00
Laurent Destailleur
3dc3214047 CSS 2021-09-19 21:13:27 +02:00
Laurent Destailleur
ee362a42bd css 2021-09-19 21:06:09 +02:00
Laurent Destailleur
1f76165e46 Fix do not show link on objects for object with existing hard link field 2021-09-19 01:35:42 +02:00
Laurent Destailleur
2acb84b432 FIX unprivileged user can see task associated with a not allowed project 2021-09-19 01:30:39 +02:00
Laurent Destailleur
4faaa81277 Rename tool 2021-09-19 01:11:28 +02:00
Laurent Destailleur
facd6abec3 FIX user without permission can set ticket subject 2021-09-19 00:56:10 +02:00
Laurent Destailleur
052511d081 Fix sql error 2021-09-18 15:05:31 +02:00
Laurent Destailleur
0bf213acac Code comment 2021-09-18 13:25:12 +02:00
Laurent Destailleur
2810315dc5 Fix payment of registration of event 2021-09-18 13:19:29 +02:00
Laurent Destailleur
5fa62f25fa Fix registration of attendee 2021-09-18 12:39:26 +02:00
Laurent Destailleur
ceb368abd4 Fix message 2021-09-18 12:29:35 +02:00
Laurent Destailleur
0168a9860b Fix tooltip on website syntax disappear
Fix backard compatibility of getLabelStatus
2021-09-18 12:09:08 +02:00
Laurent Destailleur
dafc7d2617 Fix bad position of picto 2021-09-18 11:34:15 +02:00
Laurent Destailleur
ddcb4c149a css 2021-09-18 11:32:58 +02:00
Laurent Destailleur
0859438118 Show public and private note of attendee 2021-09-18 11:25:29 +02:00
Laurent Destailleur
0c67185dcf Add note on registration 2021-09-18 11:03:15 +02:00
Laurent Destailleur
675a30d500 Fix phpcs 2021-09-17 19:42:41 +02:00
Laurent Destailleur
3d9be1437a Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/comm/action/class/actioncomm.class.php
	htdocs/compta/paiement/list.php
	htdocs/fourn/paiement/list.php
	htdocs/projet/tasks/time.php
2021-09-17 12:29:58 +02:00
Laurent Destailleur
b546f21ef4 Merge branch '12.0' of https://github.com/dolibarr/dolibarr into 13.0
Conflicts:
	htdocs/comm/action/class/actioncomm.class.php
2021-09-17 12:21:25 +02:00
Laurent Destailleur
505517d142 Merge pull request #18629 from Gjuju/12.0
Fix : GET extrafields on API "get events list" requests
2021-09-17 12:16:32 +02:00
Laurent Destailleur
58fd4ad92f Merge pull request #18641 from Gecka-Apps/14.0-fix-takepos-payment-methods
14.0 fix takepos payment methods
2021-09-17 12:15:35 +02:00
Laurent Destailleur
dff038fddd Merge pull request #18705 from aspangaro/14p19
FIX Accountancy - Format Quadra export - Missing line type C to create automaticly a subledger account with label
2021-09-17 11:56:38 +02:00
Laurent Destailleur
b248d2f1cf Merge pull request #18709 from javieralapps4up/14.0
Fix #18707 date, account and payment type are lost when sorting by any field
2021-09-17 11:50:57 +02:00
Laurent Destailleur
c04604ea1c Merge pull request #18721 from fmarcet/13.0
Fix: On payment list, not filter by company when it is an external user
2021-09-17 11:48:54 +02:00
Laurent Destailleur
1c43a83a8b Merge pull request #18737 from marc-dll/12.0_FIX_projet_task_time_user_filter
FIX: task time: can't filter by user with pgsql + show error message
2021-09-17 11:31:45 +02:00
Lucas Marcouiller
20e8dd4c54 Fix error on html.for.class on ismultientitymanaged test
Conflicts:
	htdocs/core/class/html.form.class.php
2021-09-17 11:30:45 +02:00
stickler-ci
46e8f1bebf Fixing style errors. 2021-09-17 10:59:42 +02:00
antonin_tdj
5f19291285 Avoir Error 19 Constraint Violation (in case of password unchanged) 2021-09-17 10:59:35 +02:00
antonin_tdj
8f3ff32c82 fix ldap passw bug with activedirectory
Fix to avoid LDAP Error: 53 (Unwilling to perform) on Samba4 AD
2021-09-17 10:59:09 +02:00
Laurent Destailleur
20b50993bb Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-17 10:57:15 +02:00
Laurent Destailleur
d5d97e2d24 Merge pull request #18725 from aspangaro/14p16
FIX Accountancy - Some correction on export name
2021-09-17 10:52:48 +02:00
Marc de Lima Lucio
571d130c3c FIX: task time: keep on using natural_search 2021-09-17 10:51:37 +02:00
Laurent Destailleur
3a8a813c4e Merge pull request #18730 from esion-net/patch-2
NEW Expose bank account holder, label and number
2021-09-17 10:50:11 +02:00
Laurent Destailleur
bed697c98d Merge pull request #18732 from esion-net/patch-2
NEW Expose bank account holder, label and number
2021-09-17 10:49:51 +02:00
Laurent Destailleur
02bed7ce01 Fix sanitize 2021-09-17 10:45:59 +02:00
Laurent Destailleur
c052a50d75 Fix phpcs 2021-09-17 10:32:19 +02:00
Laurent Destailleur
8a67100a31 Fix phpcs 2021-09-17 10:31:28 +02:00
Laurent Destailleur
c559e5cc3e Fix missing label 2021-09-16 21:23:02 +02:00
Laurent Destailleur
bf173fdbf1 Debug module event organization 2021-09-16 21:19:16 +02:00
Laurent Destailleur
ae028baea1 Debug module event organization 2021-09-16 21:12:29 +02:00
Laurent Destailleur
0c0ef7b683 Debug module event organization 2021-09-16 20:56:14 +02:00
Laurent Destailleur
16331ce87b Better detection of company 2021-09-16 18:53:00 +02:00
Laurent Destailleur
bfe305dc47 Debug event organization module 2021-09-16 18:16:25 +02:00
Marc de Lima Lucio
88cd8fface FIX: task time: can't filter by user with pgsql + show error message 2021-09-16 17:53:47 +02:00
Laurent Destailleur
424ddcb218 Fix page of payment 2021-09-16 16:37:20 +02:00
Florian
3091448d1a Expose bank account holder, label and number
Useful for automated texts on invoices to have those values available as well.
2021-09-16 15:40:25 +02:00
Laurent Destailleur
5b07be0179 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/expedition/class/expedition.class.php
	htdocs/holiday/list.php
2021-09-16 13:33:49 +02:00
Laurent Destailleur
c68687bdf6 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/product/fournisseurs.php
2021-09-16 13:29:25 +02:00
Laurent Destailleur
87bb971d75 FIX autocalculation of the supplier price in main currency.
Conflicts:
	htdocs/product/fournisseurs.php
2021-09-16 13:22:22 +02:00
Laurent Destailleur
f26601e836 FIX autocalculation of the supplier price in main currency. 2021-09-16 13:17:00 +02:00
Laurent Destailleur
9918873719 Better log 2021-09-16 13:07:02 +02:00
Laurent Destailleur
3a04fc557b Fix email templates 2021-09-16 12:30:46 +02:00
Laurent Destailleur
0fc51b6564 Fix email content 2021-09-16 12:10:40 +02:00
Laurent Destailleur
b18e0e3d1e Add missing translation key 2021-09-16 12:04:46 +02:00
Alexandre SPANGARO
ed37f9fb7a FIX Accountancy - Some correction on export name 2021-09-16 06:40:43 +02:00
Laurent Destailleur
b18e25db87 Code comment 2021-09-16 03:13:44 +02:00
Laurent Destailleur
aab8d4a628 css 2021-09-16 02:24:25 +02:00
Laurent Destailleur
c907c6ed08 Fix trans 2021-09-16 02:19:08 +02:00
Laurent Destailleur
51d7622434 Fix trans 2021-09-16 02:18:00 +02:00
Laurent Destailleur
2b340579a1 Fix look 2021-09-15 21:12:16 +02:00
Laurent Destailleur
0ab399aa37 Fix try to find the thirdparty from contacts too. 2021-09-15 20:46:48 +02:00
Laurent Destailleur
f859967c24 Fix look and feel v14 2021-09-15 20:28:47 +02:00
Laurent Destailleur
db57aea163 Fix class does not exist 2021-09-15 20:05:37 +02:00
Laurent Destailleur
b1cb32c743 Fix some sql 2021-09-15 20:03:38 +02:00
Laurent Destailleur
5aaf8ff8f3 Fix sql 2021-09-15 19:58:55 +02:00
Laurent Destailleur
801bf83334 Css v14 2021-09-15 19:48:43 +02:00
Laurent Destailleur
eab4014f20 Rename url 2021-09-15 19:42:07 +02:00
Laurent Destailleur
29d9771b80 Code comment 2021-09-15 19:39:22 +02:00
Laurent Destailleur
4a2d3a55d4 FIX Selection of type "people" for membership must hide the company 2021-09-15 19:33:30 +02:00
Laurent Destailleur
3f7a75b0a3 FIX translation into email for member at membership validation. 2021-09-15 19:02:17 +02:00
Laurent Destailleur
599621cc1b Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-09-15 13:29:55 +02:00
Laurent Destailleur
724badb522 Fix deletion of shipment when there is batch record 2021-09-15 13:29:19 +02:00
Ferran Marcet
7a637104b2 Fix: Not filter by company when it is an external user 2021-09-15 11:29:12 +02:00
Laurent Destailleur
3f2f6c3ed3 Fix online registration 2021-09-14 21:12:11 +02:00
Laurent Destailleur
81863e45f4 Fix link 2021-09-14 18:09:50 +02:00
Laurent Destailleur
6dbf316e66 Fix links 2021-09-14 17:56:06 +02:00
Laurent Destailleur
5f612dfd7c Trans 2021-09-14 17:38:17 +02:00
Laurent Destailleur
2d64c3e560 Fix filter 2021-09-14 17:35:54 +02:00
Laurent Destailleur
21462d0b82 Fix can reset filter in setup 2021-09-14 17:24:53 +02:00
Laurent Destailleur
aeead15a62 css 2021-09-14 17:07:29 +02:00
Laurent Destailleur
c7721563c5 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-14 17:00:01 +02:00
Laurent Destailleur
f3fcb7a48a Fix insertion of email templates 2021-09-14 16:59:49 +02:00
javieralapps4up
e1203d115a Update list.php 2021-09-14 02:22:30 +02:00
javieralapps4up
0763846805 Bug: #18670 date, account and payment type are lost when sorting by any field
Filtereds $date, $search_account and $search_paymenttype are not saved when sorting by any field
2021-09-14 02:15:22 +02:00
Alexandre SPANGARO
eae4269745 Merge branch '14p19' of https://github.com/aspangaro/dolibarr into 14p19 2021-09-13 21:32:55 +02:00
Alexandre SPANGARO
42543ba005 Add alpha key 2021-09-13 21:29:31 +02:00
stickler-ci
6368ba9a6e Fixing style errors. 2021-09-13 19:21:53 +00:00
Alexandre SPANGARO
44f4f9e288 Merge branch '14.0' into 14p19 2021-09-13 21:13:26 +02:00
Alexandre SPANGARO
fe241cc71f FIX Accountancy - Format Quadra export - Missing line type C (act account) 2021-09-13 21:12:39 +02:00
Laurent Destailleur
7420e6ab9a Merge pull request #18693 from FHenry/14_fix_ldap_limit
fix: User class fetch method if LDAP Search LIMIT must be after ORDER BY
2021-09-13 17:04:43 +02:00
Julien Gainza
65c4a21898 FIX move fetch_optionnal into $ac_static->fetch() 2021-09-13 16:35:13 +02:00
Laurent Destailleur
1ec9d08557 Merge pull request #18701 from aspangaro/14p18
FIX Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50)
2021-09-13 16:33:43 +02:00
Laurent Destailleur
41f627b80d Prepare 14.0.3 2021-09-13 16:33:16 +02:00
Alexandre SPANGARO
d7236fad99 Merge branch '14.0' into 14p18 2021-09-13 14:51:17 +02:00
Alexandre SPANGARO
3ee258fefc FIX Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50) 2021-09-13 14:08:41 +02:00
Florian HENRY
d464922d71 fix: LDAP Search LIMIT must be after ORDER BY 2021-09-13 09:44:54 +02:00
Laurent Destailleur
ce9a10bd90 Fix description of some options 2021-09-13 03:43:25 +02:00
Laurent Destailleur
3ea617ef68 Fix missing trans 2021-09-13 03:07:57 +02:00
Laurent Destailleur
5869975ed1 Fix phpcs 2021-09-13 02:59:09 +02:00
Laurent Destailleur
900af89827 Fix filename 2021-09-13 02:47:27 +02:00
Laurent Destailleur
63767b1e31 Fix compression if buildzip is provided must be in zip format. 2021-09-13 02:42:55 +02:00
Laurent Destailleur
5756f0cfdf Fix code syntax 2021-09-13 01:36:18 +02:00
Laurent Destailleur
201e46f34b Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-13 01:18:37 +02:00
Laurent Destailleur
7efd810d57 Clean code 2021-09-13 01:18:24 +02:00
Laurent Destailleur
669213a6db Merge pull request #18685 from frederic34/patch-1
doxygen
2021-09-13 01:03:13 +02:00
Laurent Destailleur
6353987b15 css 2021-09-12 02:04:02 +02:00
Laurent Destailleur
ce33f39bb0 Clean code. Menu must be greyed in get_menudiv 2021-09-11 15:43:26 +02:00
Frédéric FRANCE
5658c7daea doxygen 2021-09-11 09:49:01 +02:00
Laurent Destailleur
c005a20cc0 Fix ldap with ssl 2021-09-11 03:27:59 +02:00
Laurent Destailleur
fd696f8c28 Prepare 14.0.2 2021-09-10 20:59:07 +02:00
Laurent Destailleur
9dcf3e49d0 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/core/class/extrafields.class.php
2021-09-10 20:50:34 +02:00
Laurent Destailleur
2f4463c983 FIX Collapsing of extrafields has disappeared. 2021-09-10 20:49:22 +02:00
Laurent Destailleur
5d512243b8 Merge pull request #18683 from FHenry/14_fix_search_evt_tab
fix: on Event tabs, if no evt type use in filter, filter on label and state not apply
2021-09-10 19:57:12 +02:00
Laurent Destailleur
3980e4a32b Merge pull request #18681 from FHenry/14_fix_extrafield_separator_type
fix: show display/hide icon on extrafield type separator
2021-09-10 19:49:26 +02:00
Laurent Destailleur
d50c518b70 Merge pull request #18676 from FHenry/14_fix_ajax_company_ambious_column
fix: when COMPANY_SHOW_ADDRESS_SELECTLIST is 1 ajax call to company.php is broken
2021-09-10 19:49:12 +02:00
Laurent Destailleur
78ec200c73 Merge pull request #18679 from FHenry/14_fix_cat_icon_perms
fix: do not display icon to edit/delete tags if user not authorize
2021-09-10 19:45:23 +02:00
Laurent Destailleur
fe92c2605d Fix look and feel v14 2021-09-10 17:45:27 +02:00
Laurent Destailleur
75cd63a29b Fix css and missing test 2021-09-10 17:39:58 +02:00
Florian HENRY
257686c2fe fix: on Event tabs, if no evt type use in filter, filter on label and state not apply 2021-09-10 15:45:03 +02:00
Florian HENRY
f3a555ec69 fix: show display/hide icon on extrafield type separator 2021-09-10 15:17:09 +02:00
Florian HENRY
962bda810c Merge branch '14.0' of github.com:Dolibarr/dolibarr into 14_fix_cat_icon_perms 2021-09-10 15:00:54 +02:00
Christian Foellmann
29820f446d fix import of product desc without wrong linebreaks 2021-09-10 13:37:42 +02:00
Florian HENRY
ef888d5fca Merge branch '14.0' of github.com:Dolibarr/dolibarr into 14_fix_ajax_company_ambious_column 2021-09-10 13:26:05 +02:00
Florian HENRY
c66181a00e fix: when COMPANY_SHOW_ADDRESS_SELECTLIST is 1 ajax call to company.php is broken 2021-09-10 13:25:40 +02:00
Juanjo Menent
1eb4975a76 fix: Bad date creation for project clone 2021-09-10 11:44:58 +02:00
Laurent Destailleur
4939cc9911 Fix trans 2021-09-10 11:04:59 +02:00
Laurent Destailleur
7526cb3b8b Fix VAT rate label and add Mali default vat rate 2021-09-10 09:44:06 +02:00
Laurent Destailleur
77247ec43a Add date valid/approval 2021-09-09 20:35:57 +02:00
Laurent Destailleur
f4786c8a0a Include ref into label of log history
Conflicts:
	htdocs/holiday/card.php
2021-09-09 19:50:39 +02:00
Laurent Destailleur
6465e8aa36 Include ref into label of log history 2021-09-09 19:47:51 +02:00
Laurent Destailleur
b8b5b97d78 Code comment 2021-09-09 19:47:15 +02:00
Laurent Destailleur
520ce4c3ac Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-09 19:21:45 +02:00
Laurent Destailleur
ffd7f60830 FIX #18589 #18617 2021-09-09 19:21:32 +02:00
Laurent Destailleur
647fa49202 Merge pull request #18667 from lainwir3d/fix_order_shipment_list_duplicates
FIX #18666 Order / Shipment list: Don't SQL JOIN category table when not necessary.
2021-09-09 18:59:28 +02:00
lainwir3d
63abe2f1ff FIX #18666 Order / Shipment list: Don't SQL JOIN category table when not necessary. 2021-09-09 19:56:28 +04:00
Florian HENRY
45ad23206a fix: do not display icon to edit/delete tags if not perms 2021-09-09 17:41:40 +02:00
Laurent Destailleur
a80950b96d Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-09 16:06:28 +02:00
Laurent Destailleur
5406e3d34e Fix phpcs 2021-09-09 16:06:16 +02:00
Laurent Destailleur
de005f5cd2 Merge pull request #18661 from Hystepik/develop_v14#4
Fix #18660 : fix rights of supplier order with API
2021-09-09 15:18:17 +02:00
Laurent Destailleur
5d5b7c3af4 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/comm/action/peruser.php
	htdocs/main.inc.php
2021-09-09 15:15:26 +02:00
Laurent Destailleur
30894b989c Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-09-09 15:12:16 +02:00
Laurent Destailleur
70f22f2648 # WARNING: head commit changed in the meantime
Merge
2021-09-09 15:12:02 +02:00
Laurent Destailleur
654bf4d672 Fix name of index #18623 2021-09-09 15:07:55 +02:00
Laurent Destailleur
4d5621ea6f Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-09 14:59:12 +02:00
Laurent Destailleur
f1758b6f0c Merge pull request #18623 from atm-gauthier/14.0_fix_salary_extrafields
14.0 fix salary extrafields are no more available
2021-09-09 14:58:54 +02:00
Laurent Destailleur
1a8364adcc Merge pull request #18637 from hregis/fix_multicompany
FIX multicompany transverse mode compatibility
2021-09-09 14:50:22 +02:00
lmarcouiller
4928d03c4f update to have modify ! to empty() 2021-09-09 14:44:17 +02:00
fr69400
ad0c4c518f Update row.php
right write doesn't exist for supplier_proposal

->line order dont works
2021-09-09 14:42:43 +02:00
lmarcouiller
8af6b8679e update with fournisseur && supplier_order 2021-09-09 14:40:39 +02:00
Laurent Destailleur
70eed40146 Merge pull request #18659 from Hystepik/develop_v14#3
Fix : reception list sql error
2021-09-09 14:17:10 +02:00
lmarcouiller
022f3e640d Fix #18660 : fix rights of supplier order with API 2021-09-09 13:28:30 +02:00
lmarcouiller
d451703bbf Fix : reception list sql error 2021-09-09 11:21:34 +02:00
Regis Houssin
303b0e7f31 FIX better sql request 2021-09-09 09:21:30 +02:00
Laurent Destailleur
e5b71a1a89 Merge pull request #18598 from henrynopo/patch-2
Increase the width of column for General Set-ups - Update dolibarr.php
2021-09-09 05:12:06 +02:00
Laurent Destailleur
de97b248f2 Update dolibarr.php 2021-09-09 05:11:56 +02:00
Laurent Destailleur
ea9a07fb3d Update dolibarr.php 2021-09-09 05:11:31 +02:00
Laurent Destailleur
a4d897f609 Merge pull request #18625 from jyhere/patch-1
Fix : unable to create a direct debit if ics_transfer is empty
2021-09-09 05:04:06 +02:00
Laurent Destailleur
adf4c94f45 Merge pull request #18631 from hregis/fix_maxlength_of_input
FIX increase maxlength of password input
2021-09-09 05:00:03 +02:00
Laurent Destailleur
9fe9d0e9bf Merge pull request #18630 from hregis/fix_wrong_table_element_line
FIX wrong table_element_line
2021-09-09 04:59:27 +02:00
Laurent Destailleur
3c215730db Merge pull request #18639 from Hystepik/develop_v14#1
Fix #18633 : fix error message
2021-09-09 04:56:54 +02:00
Laurent Destailleur
77b8d91895 Update 13.0.0-14.0.0.sql 2021-09-09 04:56:25 +02:00
Laurent Destailleur
ac8dfb2dd5 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-09 04:41:55 +02:00
Laurent Destailleur
d42492c67b Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/core/class/dolreceiptprinter.class.php
2021-09-09 04:41:39 +02:00
Laurent Destailleur
e20e80fae3 Merge pull request #18646 from ksar-ksar/patch-8
FIX #18591 : Remove double quotes of SQL Queries
2021-09-09 04:36:48 +02:00
Laurent Destailleur
6d7cb01951 Merge pull request #18645 from atm-adrien/FIX_add_token
FIX : Add token to remove error when removing widget
2021-09-09 04:31:03 +02:00
Laurent Destailleur
e4a7903700 Merge pull request #18657 from moreauftheobald/14.0_fiix_knowledgemanagement_menu
Fix: Enable Knowledge Management Menu
2021-09-09 03:23:26 +02:00
Laurent Destailleur
61d5152209 Update eldy.lib.php 2021-09-09 03:23:04 +02:00
Laurent Destailleur
0146153792 Merge pull request #18650 from aspangaro/14p18
css
2021-09-09 03:02:54 +02:00
Laurent Destailleur
348fe00ffb Merge pull request #18653 from Hystepik/develop_v14#2
Fix permission for salaries module
2021-09-09 03:02:34 +02:00
Laurent Destailleur
b87ac639fd Update card.php 2021-09-09 03:02:18 +02:00
Laurent Destailleur
89ed156d7e Complete getOutstandingBills() 2021-09-09 02:18:50 +02:00
Laurent Destailleur
39dd1e2dd1 Code comment 2021-09-09 02:00:07 +02:00
Laurent Destailleur
30856d5b18 FIX Relative discount with high nb of decimals 2021-09-08 22:09:02 +02:00
Laurent Destailleur
4705d41ed2 FIX Relative discount with high nb of decimals 2021-09-08 22:00:16 +02:00
Laurent Destailleur
8326ecee78 Fix phpcs 2021-09-08 21:19:40 +02:00
Laurent Destailleur
e0fa4e4b5c Fix phpcs 2021-09-08 21:19:01 +02:00
MOREAU FRANCK
04026dd0b0 fix Stickler CI review 2021-09-08 19:51:34 +02:00
Laurent Destailleur
57a2ea3a53 Fix sql error 2021-09-08 19:49:24 +02:00
MOREAU FRANCK
e9505c1109 Update V14 2021-09-08 18:23:44 +02:00
lmarcouiller
a5e670291e Fix permission for salaries module 2021-09-08 15:36:51 +02:00
Regis Houssin
8c95ada9fd FIX wrong users count in multicompany transverse mode 2021-09-08 10:25:27 +02:00
Alexandre SPANGARO
6c118b4dfb css 2021-09-08 04:31:38 +02:00
Laurent Destailleur
0b68da4e9e Debug organizedeventregistration module 2021-09-08 02:27:52 +02:00
Laurent Destailleur
f5903c9b02 Debug organizedeventregistration module 2021-09-08 02:17:00 +02:00
Laurent Destailleur
880ac07661 Debug organizedeventregistration module 2021-09-08 01:41:59 +02:00
Laurent Destailleur
b92784c04b Fix autoselect of thirdparty 2021-09-07 23:38:33 +02:00
Laurent Destailleur
3cc888f4df Debug event module 2021-09-07 23:19:36 +02:00
Laurent Destailleur
07d48e627e Debug event organization module 2021-09-07 23:19:16 +02:00
Laurent Destailleur
83ec43a2ee css 2021-09-07 17:44:57 +02:00
Laurent Destailleur
0edf2f344b Fix sql 2021-09-07 17:38:46 +02:00
ksar
e26e6288c2 FIX #18591 : Remove double quotes of SQL Queries
FIX #18591 : Remove double quotes of SQL Queries for postgresql compatibility
2021-09-07 15:22:02 +02:00
Adrien Raze
5f58eefc79 Merge branch '14.0' of https://github.com/Dolibarr/dolibarr into FIX_add_token 2021-09-07 14:48:23 +02:00
Adrien Raze
948d2bc4e9 FIX : Add token when remove the last widget on home page 2021-09-07 14:43:37 +02:00
Laurent Dinclaux
c8af143468 Fix coding standards 2021-09-07 23:27:31 +11:00
lmarcouiller
f3babd2819 Fix #18633 : fix error message 2021-09-07 13:59:36 +02:00
Laurent Dinclaux
807b4bf93e Fix cash payment in some cases. Make pay requests language independant and rely on payment method code. 2021-09-07 22:42:17 +11:00
Laurent Dinclaux
a39f469a50 Only check takepos configuration if a terminal is choosen, to prevent error message 2021-09-07 22:31:09 +11:00
Regis Houssin
52419f28c5 FIX add DISTINCT 2021-09-07 12:38:15 +02:00
Regis Houssin
4aaaa8e21a FIX multicompany transverse mode compatibility 2021-09-07 12:10:35 +02:00
Laurent Destailleur
02f21d478a Fix trans 2021-09-06 19:06:46 +02:00
Laurent Destailleur
51a751f088 Fix option MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT 2021-09-06 19:00:01 +02:00
Laurent Destailleur
f5f0b9debc Fix label for selection 2021-09-06 18:41:04 +02:00
Laurent Destailleur
e77d7d22a8 Trans 2021-09-06 18:34:18 +02:00
Laurent Destailleur
70d52aca1d Trans 2021-09-06 17:42:17 +02:00
Regis Houssin
7d8023fea7 FIX wrong table_element_line 2021-09-06 16:21:30 +02:00
Julien Gainza
9d89e48d15 Fix : Add extrafields on API "get events list" 2021-09-06 15:55:33 +02:00
stickler-ci
3537f68c7e Fixing style errors. 2021-09-06 13:24:22 +00:00
jyhere
18da6e6d6f Update create.php
Fix : unable to create a direct debit if ics and ics_transfer are empty even though ics_transfer is only used for bank transfer.
2021-09-06 15:20:47 +02:00
stickler-ci
1043bc964d Fixing style errors. 2021-09-06 12:58:06 +00:00
Gauthier PC portable 024
383c92f6c6 FIX : migration script 2021-09-06 14:52:11 +02:00
Laurent Destailleur
a57e8a14b8 Fix look and feel v14 2021-09-06 12:56:33 +02:00
Laurent Destailleur
38bd5e0902 Fix trans 2021-09-06 12:51:40 +02:00
Gauthier PC portable 024
be1c08ddfe FIX : salary extrafields don't work and table is not well named 2021-09-06 12:30:39 +02:00
Laurent Destailleur
b782e5986a Fix css 2021-09-06 03:29:46 +02:00
Laurent Destailleur
e4767e91ea Fix css 2021-09-06 03:26:43 +02:00
Laurent Destailleur
5850b68f79 Fix css 2021-09-06 03:22:06 +02:00
Regis Houssin
1c97393a69 FIX increase maxlength of password input 2021-09-05 15:35:06 +02:00
Laurent Destailleur
b58684af98 Fix trans 2021-09-05 14:31:33 +02:00
Laurent Destailleur
68bc85124b Merge pull request #18601 from frederic34/patch-8
fix #17634
2021-09-05 01:07:46 +02:00
Laurent Destailleur
5b9a583005 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-04 13:53:46 +02:00
Laurent Destailleur
4e7549ab7d css 2021-09-04 13:53:31 +02:00
Frédéric FRANCE
456f25d57e fix #17634 2021-09-04 11:30:03 +02:00
Henry
b13fc30a0a Update dolibarr.php 2021-09-04 12:25:40 +08:00
Laurent Destailleur
87b33c09e0 Merge pull request #18595 from FHenry/14_eventorg
NEW : Can register an attendees on project global (and also on conférence)
2021-09-03 20:50:21 +02:00
Laurent Destailleur
2e3b6b2fc8 Backport sql injection fix from develop 2021-09-03 18:00:28 +02:00
Florian HENRY
628c715878 ok for prod 2021-09-03 16:39:10 +02:00
Florian HENRY
96f9f8ae98 work on event 2021-09-03 15:40:33 +02:00
Laurent Destailleur
531037ddb6 Prepare 14.0.2 2021-09-03 11:04:49 +02:00
Laurent Destailleur
35e5480f2f Fix var init 2021-09-03 10:58:43 +02:00
henrynopo
4c1d857991 Update remx.php 2021-09-02 19:36:48 +02:00
henrynopo
6e5258f482 Update stocks.lang 2021-09-02 19:26:32 +02:00
Laurent Destailleur
9ec5470adf Merge pull request #18583 from ksar-ksar/patch-7
FIX #18565
2021-09-02 17:36:07 +02:00
ksar
260049c917 FIX #18565 2021-09-02 17:15:57 +02:00
Laurent Destailleur
7758c0b8a7 Fix phpcs 2021-09-02 16:06:19 +02:00
Laurent Destailleur
e22bd5c048 Fix better format address for jp in romaji 2021-09-02 10:39:56 +02:00
Laurent Destailleur
8193e792b5 Fix responsive 2021-09-01 22:39:01 +02:00
Laurent Destailleur
076bfd82a3 FIX option "Default value for field 'Refuse bulk emailings'" 2021-09-01 22:38:47 +02:00
Laurent Destailleur
03cfea2504 Fix const setup 2021-09-01 19:06:58 +02:00
Laurent Destailleur
7c7e89cc3b Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
2021-09-01 18:41:44 +02:00
Laurent Destailleur
831a66465f Fix trans 2021-09-01 18:28:21 +02:00
Christian Foellmann
f391b11da7 fix product nature on create 2021-09-01 18:23:38 +02:00
Laurent Destailleur
82d99bfa01 Merge pull request #18546 from lainwir3d/fix_restapi_order_mail_substitutes
FIX #18544 Shipment rest api: load thirdparty object when validating
2021-09-01 18:19:11 +02:00
Laurent Destailleur
f0a68d728a Merge pull request #18548 from henrynopo/patch-17
Fix error of SUPPLIER_INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED
2021-09-01 18:17:37 +02:00
Laurent Destailleur
7e8ce82e0a Merge pull request #18543 from lainwir3d/fix_restapi_global_user_variable
FIX #18542 REST API: set global $user variable to DolibarrApiAccess::user
2021-09-01 18:05:40 +02:00
Laurent Destailleur
0f325bdd65 Update api_access.class.php 2021-09-01 18:05:24 +02:00
Laurent Destailleur
82d878dd7a Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
2021-09-01 17:59:07 +02:00
Laurent Destailleur
74f3b98ea9 Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0
Conflicts:
	htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
2021-09-01 17:54:21 +02:00
Laurent Destailleur
3e4d7dfaba Fix $_SERVER["PHP_SEFL"] into $_SERVER["PHP_SELF"] 2021-09-01 17:44:54 +02:00
Laurent Destailleur
443827ff42 FIX #18531 2021-09-01 17:10:26 +02:00
Laurent Destailleur
b66bd781a4 Clean code 2021-09-01 16:26:59 +02:00
Vincent Dieltiens
2bad48bdcc FournisseurCommandDispatch extends CommonObjectLine instead of CommonObject 2021-09-01 16:25:29 +02:00
Laurent Destailleur
1027f1059e Merge pull request #18574 from FHenry/14_eventorg
fix: disabled module Event Org when project disabled
2021-09-01 16:17:55 +02:00
Laurent Destailleur
14ca7db5d7 Typo in log 2021-09-01 16:17:31 +02:00
Vincent Dieltiens
59e917cd5f regroup BILL_SUPPLIER_VALIDATE actions
Conflicts:
	htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
2021-09-01 16:14:44 +02:00
Vincent Dieltiens
65ccbb6249 Regroup BILL_SUPPLIER_VALIDATE triggers under the same condition 2021-09-01 16:06:36 +02:00
Florian HENRY
bb6dda087c Merge branch '14.0' of github.com:Dolibarr/dolibarr into 14_eventorg 2021-09-01 15:23:04 +02:00
Florian HENRY
bae73b9a52 disabled module on inactive 2021-09-01 15:16:11 +02:00
Laurent Destailleur
375557e092 FIX Menu List of project was not visible. 2021-09-01 15:10:02 +02:00
Laurent Destailleur
cd09099409 Merge pull request #18563 from atm-maxime/patch-3
Fix supplier invoice pdf generation canelle
2021-09-01 13:37:50 +02:00
Laurent Destailleur
fb0bd41178 Fix trans 2021-09-01 13:02:36 +02:00
Laurent Destailleur
bcd835ddbd Fix tooltips 2021-09-01 12:34:59 +02:00
Laurent Destailleur
a48473ba7a Missing trans exclude 2021-09-01 12:22:44 +02:00
Laurent Destailleur
da8dcaa0c9 Fix look and feel v14 2021-09-01 12:15:23 +02:00
Laurent Destailleur
dad4c34ec5 Debug module conference or booth 2021-08-31 23:51:45 +02:00
Maxime Kohlhaas
d09d036f06 Fix supplier invoice pdf generation canelle
Thirdparty wrongly fetched was causing errors on mass generation
2021-08-31 16:10:55 +02:00
Laurent Destailleur
c7444865a1 Fix css 2021-08-31 13:16:37 +02:00
Laurent Destailleur
bbf219fd7b FIX Export of website generates a package that contains a sql error 2021-08-31 13:09:52 +02:00
Laurent Destailleur
b29fc5552d Fix id in link 2021-08-30 22:10:26 +02:00
Laurent Destailleur
60832c6e87 css 2021-08-30 21:48:46 +02:00
Laurent Destailleur
426894f6a6 Fix not null column 2021-08-30 21:44:09 +02:00
Laurent Destailleur
8639956b79 Fix position of information on lines of documents 2021-08-30 21:22:00 +02:00
Laurent Destailleur
3e443e9146 Fix partnership module 2021-08-30 19:47:44 +02:00
Laurent Destailleur
5549186e3a Fix link 2021-08-30 19:28:49 +02:00
Laurent Destailleur
7c9909ee12 Fix label of list of members 2021-08-30 19:21:52 +02:00
Laurent Destailleur
d9bfd72c29 Fix missing login in tooltip 2021-08-30 19:13:02 +02:00
Laurent Destailleur
d1ef4bdbd1 Fix missing login in tooltip 2021-08-30 19:10:43 +02:00
Laurent Destailleur
18e7a5efa9 Trans 2021-08-30 19:00:15 +02:00
Laurent Destailleur
3c029d0ccf Fix sort on company on member list. 2021-08-30 18:57:41 +02:00
Laurent Destailleur
b78771f8c4 Fix select empty value for thirdparties select combo 2021-08-30 18:56:52 +02:00
Laurent Destailleur
9db5f85d4e Fix responsive 2021-08-30 18:42:41 +02:00
Laurent Destailleur
9c3ba22b02 Fix label of company of a thirdparty 2021-08-30 18:38:31 +02:00
henrynopo
3240a3652d Update card.php 2021-08-30 15:34:59 +08:00
henrynopo
7bf6daaca7 Update card.php 2021-08-30 15:33:26 +08:00
stickler-ci
01a44760a8 Fixing style errors. 2021-08-29 20:14:19 +00:00
lainwir3d
4381f67a64 FIX #18544 Shipment REST API: load thirdparty object into the shipment before validating. 2021-08-30 00:08:43 +04:00
lainwir3d
359dae6af8 FIX #18542 REST API: set global $user variable to DolibarrApiAccess::user. 2021-08-29 23:13:41 +04:00
Laurent Destailleur
74ad0586a9 Fix disabled 2021-08-29 20:42:14 +02:00
Laurent Destailleur
47b96e07b7 Fix init 2021-08-29 20:36:54 +02:00
Laurent Destailleur
daf32e9f14 Fix modules disabled in demo must remains disabled 2021-08-29 20:36:08 +02:00
Laurent Destailleur
81a8efd856 Restore error message 2021-08-28 20:14:23 +02:00
Laurent Destailleur
8870662200 Merge pull request #18475 from OPEN-DSI/v14-fix-invoice-fetch-not-found-syslog-level
FIX invoice fetch not found syslog debug level instead of error
2021-08-28 20:12:45 +02:00
Laurent Destailleur
feb2e71f0c Fix regression 2021-08-28 18:59:12 +02:00
Laurent Destailleur
8ab9c96b7e Fix 0 insert instead of null 2021-08-28 18:56:48 +02:00
Laurent Destailleur
e71ff148ba Fix phpcs 2021-08-28 18:42:26 +02:00
Laurent Destailleur
6afe9c88f6 Merge pull request #18491 from daraelmin/patch-3
Fix : conditiion always wrong when on following link
2021-08-28 18:21:37 +02:00
Laurent Destailleur
1c1caaccde Update member.php 2021-08-28 18:21:23 +02:00
Laurent Destailleur
3ce5674b76 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-08-28 18:01:06 +02:00
Laurent Destailleur
978511e127 Update fournisseur.facture.class.php
Conflicts:
	htdocs/fourn/class/fournisseur.facture.class.php
2021-08-28 17:59:45 +02:00
LVSInformatique
4f45228e7b Update list.php 2021-08-28 17:44:26 +02:00
Laurent Destailleur
881d176996 css 2021-08-28 17:30:53 +02:00
Laurent Destailleur
bb94ea7334 Fix debug car reception: Fill/reset link, colspan, translation 2021-08-28 17:24:05 +02:00
Laurent Destailleur
4c39816ce6 Merge pull request #18510 from henrynopo/patch-9
Fix - edit shipment Qty both predefined product while batch and stock are not enabled
2021-08-28 16:36:05 +02:00
stickler-ci
e60cf96c8e Fixing style errors. 2021-08-28 14:35:01 +00:00
Laurent Destailleur
31ca781236 Update card.php 2021-08-28 16:34:38 +02:00
stickler-ci
2ddebc123a Fixing style errors. 2021-08-28 14:32:44 +00:00
Laurent Destailleur
faf1d52d91 Update card.php 2021-08-28 16:32:22 +02:00
lmarcouiller
c509e3bc43 FIx error 500 on restler api PHP 8.0 2021-08-28 14:53:59 +02:00
Laurent Destailleur
12ce4bf7af Merge pull request #18522 from Hystepik/develop_v13#1
Fix #18519 : Modulebuilder api permission
2021-08-28 14:39:13 +02:00
Laurent Destailleur
45515fa8b2 fix css 2021-08-28 14:28:50 +02:00
Laurent Destailleur
20d0b0c564 Fix link in some tooltips 2021-08-28 13:56:59 +02:00
Laurent Destailleur
1fec53e7f2 Fix generate the phpunit file from modulebuilder 2021-08-28 13:37:35 +02:00
Laurent Destailleur
7001388159 Fix warning event late on tab Resources 2021-08-28 05:40:14 +02:00
Laurent Destailleur
64c4e25c02 Fix warning 2021-08-28 05:40:07 +02:00
Laurent Destailleur
acf0386a9b Fix css 2021-08-28 03:14:48 +02:00
lmarcouiller
ce7a301896 Fix #18519 : Modulebuilder api permission 2021-08-27 11:48:56 +02:00
Laurent Destailleur
c6c87cd813 Fix duplicated code and missing declaration 2021-08-26 21:37:00 +02:00
Laurent Destailleur
ac55a052b2 Fix warning abuot external users shown only if appropriate 2021-08-26 12:41:37 +02:00
Laurent Destailleur
931f712c5f Fix import gender man/woman, not 0/1 + import of thirdparty for members 2021-08-26 11:55:22 +02:00
henrynopo
a0c9cf2d8d Update card.php 2021-08-26 12:31:20 +08:00
Laurent Destailleur
65629711d0 FIX #18484 2021-08-25 14:53:14 +02:00
Laurent Destailleur
d022b3b0a1 FIx #18481 2021-08-25 12:24:13 +02:00
daraelmin
701b43d917 Add MEMBER_ALLOW_CHANGE_OF_TYPE in admin panel 2021-08-25 09:01:30 +02:00
daraelmin
29f98041e6 conditiion always wrong when on following link 2021-08-25 08:48:42 +02:00
Laurent Destailleur
5b7fb9a4bb Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-08-24 16:36:39 +02:00
Laurent Destailleur
ba594b20e0 Fix phpcs 2021-08-24 16:36:27 +02:00
lvessiller
a4a44faa7f FIX change LOG_DEBUG with LOG_WARNING in syslog and remove sql error in syslog (already done) 2021-08-24 16:21:55 +02:00
Laurent Destailleur
1c665c34cd Merge pull request #18485 from fappels/14_fix_supplier_order_card
Fix warning on supplier order card when reception enabled.
2021-08-24 15:31:05 +02:00
Laurent Destailleur
8aa262f302 Merge pull request #18453 from aspangaro/14p15
FIX #18353 Invoice list translation issue
2021-08-24 15:29:32 +02:00
Laurent Destailleur
a9b0c4ebc5 Merge pull request #18455 from aspangaro/14p10
FIX #18375 SQL Error on tasks statistics
2021-08-24 15:16:06 +02:00
Laurent Destailleur
2d870d0f81 Merge branch '14.0' into 14p10 2021-08-24 15:15:38 +02:00
henrynopo
73c0471ead Fix error of supplier invoice (variable amount)
This update fixed the coding error for addline of deposit invoice for variable amount.

In addition, there is no invoice template for supplier invoice, so I also corrected the respective description.
2021-08-24 15:12:15 +02:00
Laurent Destailleur
15da97f1da Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/accountancy/journal/expensereportsjournal.php
	htdocs/accountancy/journal/purchasesjournal.php
	htdocs/accountancy/journal/sellsjournal.php
	htdocs/compta/facture/card.php
	htdocs/product/price.php
2021-08-24 15:05:14 +02:00
Laurent Destailleur
591059847e Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/product/price.php
2021-08-24 15:00:35 +02:00
Laurent Destailleur
67baa48c16 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/fourn/facture/list.php
2021-08-24 14:56:13 +02:00
Laurent Destailleur
6fa5930e8d Fix label must not be translated 2021-08-24 14:54:46 +02:00
Laurent Destailleur
b10f75932f Merge pull request #18466 from aspangaro/14p16
FIX Supplier invoice list - Wrong language key used
2021-08-24 14:51:46 +02:00
Laurent Destailleur
8b2c82dd23 Fix position of fields 2021-08-24 14:27:18 +02:00
Alexandre SPANGARO
efb78d7431 FIX Invoice list - Wrong name for column total_tva 2021-08-24 14:22:36 +02:00
Alexandre SPANGARO
7b829bc899 FIX Field already present in SQL request 2021-08-24 14:22:21 +02:00
Laurent Destailleur
b28180d759 Merge pull request #18471 from aspangaro/12p19
FIX Accountancy - Some problems of length with general & subledger ac…
2021-08-24 14:19:16 +02:00
Laurent Destailleur
9816dff00a Merge pull request #18480 from henrynopo/patch-11
Fix - Supplier deposit invoice - auto convert to discount (error)
2021-08-24 14:09:39 +02:00
Laurent Destailleur
c6774505d8 FIX #18465 2021-08-24 14:05:02 +02:00
henrynopo
3c1bdd163f Update paiementfourn.class.php 2021-08-24 18:34:34 +08:00
Francis Appels
edeaa6009f Fix warning on supplier order card when reception enabled. 2021-08-24 10:48:26 +02:00
lvessiller
4efe2a0e09 FIX invoice fetch not found syslog debug level instead of error 2021-08-24 08:20:40 +02:00
Laurent Destailleur
a6ddc90d5b Fix responsive 2021-08-23 23:53:58 +02:00
Laurent Destailleur
7af023665f Clean var not defined 2021-08-23 19:37:11 +02:00
Laurent Destailleur
8485fee5f9 Cast numeric into on sql request 2021-08-23 19:33:24 +02:00
Laurent Destailleur
23829ae637 Cast numeric into on sql request 2021-08-23 18:56:46 +02:00
Laurent Destailleur
6d5329bbf8 Fix phpunit 2021-08-23 17:45:16 +02:00
Laurent Destailleur
d4b5ee6c85 Fix cast into variable into sql request. 2021-08-23 17:41:11 +02:00
Laurent Destailleur
edb239837c FIX #yogosha6944 Protection against traversal path. 2021-08-23 16:03:34 +02:00
Laurent Destailleur
cd141373fb Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-08-23 16:00:10 +02:00
Laurent Destailleur
d46dfd017a FIX #yogosha6944 Protection against traversal path. 2021-08-23 16:00:03 +02:00
Laurent Destailleur
fc6a0dfcaa FIX #yogosha6944 Protection against traversal path. 2021-08-23 15:47:18 +02:00
Laurent Destailleur
21852bd16b Show link to invoices on member record 2021-08-23 15:25:41 +02:00
Alexandre SPANGARO
a0378549b8 FIX Accountancy - Some problems of length with general & subledger account 2021-08-23 15:19:27 +02:00
Laurent Destailleur
5f16de8150 Code comment 2021-08-23 15:08:29 +02:00
Laurent Destailleur
a25346e302 FIX Date of payment of subscription must not be set to 1970-01-01.
Fix look and feel v14
2021-08-23 15:00:29 +02:00
Laurent Destailleur
983d7e5177 FIX Add option $noescapecommand in executeCLI for better compatibility 2021-08-23 12:26:16 +02:00
Laurent Destailleur
041784876d Fix option $nolog 2021-08-23 12:25:59 +02:00
Laurent Destailleur
227f01b000 Fix can add a redirection into the executeCLI method. 2021-08-23 12:25:48 +02:00
Laurent Destailleur
fdffc0c13a NEW Add param $nolog to avoid logging into dol_delete_recursive_dir() 2021-08-23 12:25:29 +02:00
Laurent Destailleur
0325b68bfb Fix missing autoselect 2021-08-23 10:17:36 +02:00
Alexandre SPANGARO
b5a4c58106 FIX Supplier invoice list - Wrong language key used 2021-08-22 22:42:40 +02:00
Laurent Destailleur
d3de81fecb Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/holiday/card.php
	htdocs/holiday/class/holiday.class.php
2021-08-22 19:34:13 +02:00
Laurent Destailleur
53a6e0cfaf Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-08-22 19:23:56 +02:00
Laurent Destailleur
fe17c13a5f FIX an approved holiday can be canceled by an admin. 2021-08-22 19:22:47 +02:00
Laurent Destailleur
ff3f85b214 Fix case sensitive 2021-08-22 01:44:52 +02:00
Laurent Destailleur
e6fa070c84 Fix phpcs 2021-08-22 01:21:31 +02:00
Laurent Destailleur
b3043ab3d6 Fix phpunit 2021-08-22 01:20:25 +02:00
Laurent Destailleur
4cd5a53b63 FIX Recommended session.cookie_samesite must be 'Lax' not 'Strict'. 2021-08-22 00:44:51 +02:00
Laurent Destailleur
49f6a634d0 Fix output of error message. br is no more encoded 2021-08-21 15:00:47 +02:00
Laurent Destailleur
ac5b16fd01 Fix lang 2021-08-21 13:41:04 +02:00
Laurent Destailleur
04a922b5f4 Implement the noescapetags into dol_escape_htmltag 2021-08-21 13:27:33 +02:00
Laurent Destailleur
17213ae65d More error messages on paypal payment. 2021-08-21 12:37:28 +02:00
Laurent Destailleur
68d24661db Try to fix the ' that show ' on PDF 2021-08-21 12:19:50 +02:00
Laurent Destailleur
bdf8c3ddc6 Fix test 2021-08-20 23:26:56 +02:00
Alexandre SPANGARO
af843ed82c Merge branch '14.0' into 14p10 2021-08-20 22:11:42 +02:00
Alexandre SPANGARO
53af4b0076 FIX #18375 SQL Error on tasks statistics 2021-08-20 22:11:26 +02:00
Alexandre SPANGARO
8bdf58b942 FIX #18353 Invoice list translation issue 2021-08-20 21:42:43 +02:00
Laurent Destailleur
35e48f3a27 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 12.0 2021-08-20 21:12:22 +02:00
Laurent Destailleur
9d285ea232 Fix: Can delete a price when date is in future to fix corrupted data 2021-08-20 21:11:20 +02:00
Laurent Destailleur
b52ad0500b Removed useless files 2021-08-20 16:25:51 +02:00
Laurent Destailleur
10ddd621ca Fix escape error message 2021-08-20 12:40:49 +02:00
Laurent Destailleur
03d2d24244 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-08-19 16:12:26 +02:00
Laurent Destailleur
e1dc5b5188 css 2021-08-19 16:12:13 +02:00
Laurent Destailleur
91792e3c0e Merge pull request #18441 from KlaasOl/patch-4
Update main.lang
2021-08-19 13:48:12 +02:00
Laurent Destailleur
c20d61029c Merge pull request #18442 from FHenry/fix_14_tokenCRSCF
fix: missing token CRCSF
2021-08-19 13:46:31 +02:00
Florian HENRY
223637317b fix: missing tocken CRCSF 2021-08-19 09:51:09 +02:00
Klaas Oldenburger
0d4badb50b Update main.lang
Change date format to Dutch standards
2021-08-19 08:26:37 +02:00
Laurent Destailleur
8f1b4df5f4 Fix deletion of old file 2021-08-19 02:54:58 +02:00
Laurent Destailleur
6d4aa1ad08 Fix deletion of old signature file 2021-08-19 02:51:24 +02:00
Laurent Destailleur
9b5a6f4298 Fix signature file must be zip if possible 2021-08-19 02:48:45 +02:00
Laurent Destailleur
4e4c8a9cb5 Prepare 14.0.1 2021-08-19 01:55:00 +02:00
Laurent Destailleur
13e64d2f79 Fix replace file_get_contents with getURLContent 2021-08-18 19:46:37 +02:00
Laurent Destailleur
ae3a0fce71 Fix phpcs 2021-08-18 02:16:30 +02:00
Laurent Destailleur
57c9649b50 FIX bad approver shown on holiday once approved 2021-08-18 00:12:25 +02:00
Laurent Destailleur
35ebaf7b79 Merge pull request #18282 from aspangaro/12p18
FIX: Manage credit note on situation invoice for calculate margin
2021-08-17 19:26:16 +02:00
Laurent Destailleur
e264163ab6 Fix phpcs 2021-08-17 19:11:48 +02:00
Laurent Destailleur
0858487119 Fix #18343 2021-08-17 18:52:33 +02:00
Laurent Destailleur
a19f8cd87d Merge pull request #18337 from atm-maxime/fix_holidays_users
Fix : we only want employee users for holidays
2021-08-17 18:37:38 +02:00
Laurent Destailleur
16c290f735 Merge pull request #18383 from marc-dll/12.0_FIX_invoice_tiny_negative_vat
FIX: invoice validation: when checking if any VAT rate has a negative amount, prevent false positives with -1.0E-14 amounts
2021-08-17 18:24:33 +02:00
Laurent Destailleur
955e9de1b7 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/fourn/class/fournisseur.facture.class.php
	htdocs/product/reassortlot.php
	htdocs/product/stock/product.php
	htdocs/product/stock/productlot_card.php
	htdocs/reception/card.php
2021-08-17 18:07:10 +02:00
Laurent Destailleur
ceaaff0186 Sellby always before Eatby #18361 2021-08-17 18:05:34 +02:00
Laurent Destailleur
c0a086fad8 Sellby always before Eatby #18361 2021-08-17 17:55:00 +02:00
Laurent Destailleur
8c093cfb31 Link to doc 2021-08-17 14:44:26 +02:00
Laurent Destailleur
7d61609462 FIX #yogosha6907 2021-08-17 13:13:04 +02:00
Laurent Destailleur
a31f991b39 Doc 2021-08-17 04:41:33 +02:00
Laurent Destailleur
30c40afeb3 Debug notification setup 2021-08-17 04:28:16 +02:00
Laurent Destailleur
a3d04163b6 Debug notification setup 2021-08-17 04:14:28 +02:00
Laurent Destailleur
7a3649b6e5 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-08-17 03:21:13 +02:00
Laurent Destailleur
f51bcf0038 Debug notification module 2021-08-17 03:20:57 +02:00
Laurent Destailleur
cffa58a206 Merge pull request #18400 from lainwir3d/fix_notif_shipping_validate_email_template
FIX #18399 Fix shipment validation email template override.
2021-08-17 03:06:47 +02:00
Laurent Destailleur
cfbe2bf995 Merge pull request #18422 from aspangaro/14p13
FIX Accountancy - SQL error on select journal on journal
2021-08-17 02:41:56 +02:00
Laurent Destailleur
7207ae2cae Fix warning 2021-08-17 02:33:58 +02:00
Laurent Destailleur
ed250bb6a4 Merge pull request #18408 from atm-maxime/fix_suppinv_clone_lines
Fix supplier invoice clone : missing data on lines (#18055)
2021-08-17 02:18:36 +02:00
Laurent Destailleur
8927eeff50 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-08-17 02:11:36 +02:00
Laurent Destailleur
eba87ab295 FIX filter on status Draft in modulebuilder 2021-08-17 02:09:38 +02:00
Laurent Destailleur
7e1d4e1706 Merge pull request #18417 from aspangaro/13p12
FIX #18389 Accountancy - Bug on LDcompta10 export for supplier invoice
2021-08-17 01:09:06 +02:00
Laurent Destailleur
15020c99e7 Update accountancyexport.class.php 2021-08-17 01:08:18 +02:00
Laurent Destailleur
9b43327af0 Update accountancyexport.class.php 2021-08-17 01:06:26 +02:00
Laurent Destailleur
091166baa7 Update accountancyexport.class.php 2021-08-17 01:03:07 +02:00
Laurent Destailleur
4efc96f67b Merge pull request #18426 from aspangaro/14p14
FIX Accountancy - SQL error when insert a manuel transaction
2021-08-17 00:32:59 +02:00
Laurent Destailleur
7784c4fcc9 Update bookkeeping.class.php 2021-08-17 00:32:33 +02:00
Laurent Destailleur
9aab49e5c7 Fix bad closing tr 2021-08-16 23:03:33 +02:00
Alexandre SPANGARO
4b615e541b FIX Accountancy - SQL error when insert a manuel transaction 2021-08-16 21:29:28 +02:00
Laurent Destailleur
94fbcbdad1 CSS For support page 2021-08-16 20:22:50 +02:00
Alexandre SPANGARO
1bfc0004b1 Better fix 2021-08-16 08:12:24 +02:00
Alexandre SPANGARO
ba12071ea3 FIX Accountancy - SQL error on select journal on journal 2021-08-16 07:57:40 +02:00
Alexandre SPANGARO
b8da594c31 Better fix 2021-08-16 05:47:25 +02:00
Alexandre SPANGARO
abc94a397a FIX #18389 Accountancy - Bug on LDcompta10 export for supplier invoice 2021-08-15 11:12:14 +02:00
Alexandre SPANGARO
f88abb9a6f Add parenthesis 2021-08-15 07:32:46 +02:00
Alexandre SPANGARO
0d467972cd Merge branch '12.0' into 12p18 2021-08-15 07:19:33 +02:00
Maxime Kohlhaas
96a820476c Fix supplier invoice clone : missing data on lines (#18055) 2021-08-13 10:45:43 +02:00
lainwir3d
cd60d09d9e FIX #18399 Fix shipment validation email template override.
Object type name for shipment was apparently wrong.
2021-08-12 16:16:45 +04:00
Laurent Destailleur
ef4468153d Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/core/class/commonobject.class.php
	htdocs/core/tpl/extrafields_list_search_sql.tpl.php
	htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
	htdocs/fourn/class/fournisseur.commande.class.php
2021-08-11 22:07:13 +02:00
Laurent Destailleur
0cf2164260 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
	htdocs/fourn/class/fournisseur.commande.class.php
2021-08-11 21:15:30 +02:00
Laurent Destailleur
dd70d68b4c Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 12.0 2021-08-11 21:06:42 +02:00
Laurent Destailleur
eba55d0cf2 Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0
Conflicts:
	htdocs/core/tpl/extrafields_list_search_sql.tpl.php
2021-08-11 21:06:33 +02:00
lmarcouiller
51a28a4ac4 Fix lang error on hrm/index.php 2021-08-11 20:48:22 +02:00
Laurent Destailleur
dad251493a Merge pull request #18355 from marc-dll/12.0_FIX_holiday_card_hooks
FIX: holiday card: hooks uninitialized
2021-08-11 19:58:50 +02:00
Laurent Destailleur
ab8f78f29a Merge pull request #18366 from atm-quentin/FIX_11_postgre_select_filter_extrafield
FIX compatibility postgre sql
2021-08-11 15:45:04 +02:00
Laurent Destailleur
8da328b183 Update extrafields_list_search_sql.tpl.php 2021-08-11 15:44:48 +02:00
Laurent Destailleur
dd5f2dd3a2 Merge pull request #18370 from cfoellmann/fix-link-supplier
fix link to supplier card of thirdparty on supplier_order list
2021-08-11 15:44:00 +02:00
Laurent Destailleur
3964bd28db Merge pull request #18385 from marc-dll/12.0_FIX_workflow_shipment_validate_trigger
FIX: shipping validation workflow: 'ORDER_CLOSE' trigger called from wrong object
2021-08-11 15:28:12 +02:00
stickler-ci
775164f84a Fixing style errors. 2021-08-11 15:21:14 +02:00
Anthony Berton
c12905f0f3 ok 2021-08-11 15:21:08 +02:00
Laurent Destailleur
e637a1e59a Merge pull request #18392 from atm-gauthier/FIX_fetch_lines_cmd_fourn_with_same_supplier_price
FIX : on supplier order, JOIN with product fourn price table must be …
2021-08-11 15:16:33 +02:00
Laurent Destailleur
6fbd93999f css 2021-08-11 13:33:51 +02:00
Laurent Destailleur
4faf6f5d84 Fix crlf 2021-08-10 19:28:06 +02:00
Gauthier PC portable 024
087e269103 FIX : on supplier order, JOIN with product fourn price table must be done with fk_soc too to avoid display several times a same line (because of same supplier product ref) 2021-08-10 17:34:47 +02:00
Laurent Destailleur
5e0aaeb6e4 Fix warning 2021-08-10 16:40:33 +02:00
Laurent Destailleur
2860c5e3ab Fix missing dir 2021-08-10 16:36:54 +02:00
Laurent Destailleur
31d6aaf6b4 FIX avoid to have link to create bookmar on page to create bookmark 2021-08-10 13:06:57 +02:00
Laurent Destailleur
6ece5f6931 FIX avoid to have link to create bookmar on page to create bookmark 2021-08-10 13:01:57 +02:00
Marc de Lima Lucio
b610cc1c6c FIX: shipping validation workflow: 'ORDER_CLOSE' trigger called from wrong object 2021-08-10 11:18:25 +02:00
Marc de Lima Lucio
08f21e3fc4 FIX: invoice validation: when checking if any vat rate has a negative amount, prevent false positives with -1E-14 amounts 2021-08-10 10:23:56 +02:00
Laurent Destailleur
f3dbe81df4 FIX Can't set cost price when product is not on purchase 2021-08-09 20:02:24 +02:00
Laurent Destailleur
3f58e7c5db Debug status of partnership 2021-08-09 18:31:34 +02:00
Laurent Destailleur
b5b53e382e Fix missing template 2021-08-09 18:01:41 +02:00
Laurent Destailleur
2c5e0a595b Fix init data missing 2021-08-09 17:58:08 +02:00
Laurent Destailleur
e91c5fc1c5 Clean code 2021-08-09 17:55:26 +02:00
Laurent Destailleur
0876cb4cd9 Fix button cancel 2021-08-09 17:46:36 +02:00
Laurent Destailleur
6e4fb8dd8b Fix debited instead of credited for bank transfer sepa status 2021-08-09 16:48:36 +02:00
Laurent Destailleur
739d8e1c6b Fix data structure 2021-08-09 16:19:23 +02:00
Laurent Destailleur
2de728c074 Fix trans 2021-08-09 16:12:20 +02:00
Christian Foellmann
e4cb1e023a fix link to supplier card of thirdparty on supplier_order list 2021-08-09 15:39:04 +02:00
Quentin VIAL-GOUTEYRON
108a5ff7cb FIX postgre filter select search extrafield 2021-08-09 15:14:25 +02:00
Laurent Destailleur
029da815b2 Code comment 2021-08-08 12:35:52 +02:00
Laurent Destailleur
78e993c9f3 Fix permission to read reports 2021-08-08 12:23:14 +02:00
Laurent Destailleur
28ff7c894b Fix missing permission 2021-08-08 12:14:40 +02:00
Laurent Destailleur
c377e5ea3d Fix undefined method 2021-08-08 12:09:18 +02:00
Laurent Destailleur
3f0a5cc689 Fix permission info on permissions group 2021-08-08 12:04:21 +02:00
Laurent Destailleur
948663deb4 Fix deprecated var 2021-08-07 13:59:07 +02:00
Laurent Destailleur
1435172405 Better help 2021-08-06 18:55:41 +02:00
Laurent Destailleur
d437d382d8 Fix trans 2021-08-06 18:48:05 +02:00
Laurent Destailleur
a7fa238b71 Position of option 2021-08-06 18:35:16 +02:00
Laurent Destailleur
e26eda3f5f Position of option 2021-08-06 18:34:35 +02:00
Laurent Destailleur
458f773baf Fix security options 2021-08-06 18:32:40 +02:00
Marc de Lima Lucio
864a8b4b3e FIX: holiday card: hooks uninitialized 2021-08-06 16:22:19 +02:00
Laurent Destailleur
fec5a22c65 Fix filter to find files of a ref. 2021-08-06 13:26:01 +02:00
Laurent Destailleur
cf74af4401 css 2021-08-06 13:07:07 +02:00
Laurent Destailleur
c0c46fb704 FIX Link of download main doc on vat list 2021-08-06 12:20:12 +02:00
Laurent Destailleur
591b8acd51 FIX show info of company into user dropdown 2021-08-05 15:57:51 +02:00
Laurent Destailleur
fca3980dce FIX Can't remove a permission of a group 2021-08-05 15:15:03 +02:00
Laurent Destailleur
5d717113be Add language key 2021-08-05 11:20:43 +02:00
Laurent Destailleur
0a31f3dc1a FIX #18341 lang not loaded 2021-08-04 23:11:59 +02:00
Laurent Destailleur
965bdbb342 Trans 2021-08-04 23:08:57 +02:00
Laurent Destailleur
a5d11a1ccf Fix warning 2021-08-04 15:46:00 +02:00
Laurent Destailleur
ba403dd33f Add missing security info 2021-08-04 15:21:01 +02:00
Laurent Destailleur
c60927da61 Add missing security info 2021-08-04 15:16:51 +02:00
Maxime Kohlhaas
803722e323 Fix : we only want employee users for holidays 2021-08-04 14:48:10 +02:00
Laurent Destailleur
58ca982e55 Fix trans 2021-08-04 14:01:57 +02:00
Laurent Destailleur
a9ced1098d Fix lang loaded 2021-08-04 13:51:54 +02:00
Laurent Destailleur
23ea8d2907 Fix link into message 2021-08-04 13:22:24 +02:00
Laurent Destailleur
de228c5687 Fix bad link. Can't delete SEPA bank transfer request 2021-08-04 13:18:03 +02:00
Laurent Destailleur
bec87f5739 Fix translation ICS 2021-08-04 13:12:07 +02:00
Laurent Destailleur
2f3105d884 Add CSRF protection 2021-08-04 13:05:07 +02:00
Laurent Destailleur
a84c994368 Fix no tooltip on link in error message 2021-08-04 12:43:36 +02:00
Laurent Destailleur
bf49309d58 Fix css 2021-08-04 12:41:27 +02:00
Laurent Destailleur
aaefb7b324 Fix css 2021-08-04 12:38:28 +02:00
Laurent Destailleur
6dc8024d87 Fix title 2021-08-04 12:30:48 +02:00
Laurent Destailleur
4dfc8bab93 Fix bad title 2021-08-04 12:28:13 +02:00
Laurent Destailleur
4958015e93 Fix token 2021-08-04 12:26:38 +02:00
Laurent Destailleur
5f5734e9af css 2021-08-04 00:09:33 +02:00
Laurent Destailleur
a571fab177 css 2021-08-03 23:54:36 +02:00
Laurent Destailleur
1c981ccb9d Fix look and feel v14 2021-08-03 17:03:34 +02:00
Laurent Destailleur
9ceab9b86b Doc 2021-08-03 15:47:00 +02:00
Laurent Destailleur
ce38ccc121 Merge pull request #18184 from ksar-ksar/patch-5
FIX #18181
2021-08-03 15:35:20 +02:00
Florian HENRY
19f17ed114 fix: bad setEventMessages input 2021-08-03 15:30:36 +02:00
Laurent Destailleur
8b746b64a0 Prepare 14.0.1 2021-08-03 15:04:29 +02:00
Laurent Destailleur
ce5acda635 Fix phpcs 2021-08-03 15:03:41 +02:00
Laurent Destailleur
5543d68e5a Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-08-03 15:02:24 +02:00
Laurent Destailleur
d0c57dac34 FIx #18217 - Salary - link 'salary' of bank_url not managed 2021-08-03 15:02:09 +02:00
Laurent Destailleur
000c32c137 FIx #18313 2021-08-02 20:20:52 +02:00
Laurent Destailleur
cf072c1061 Merge pull request #18314 from ATM-Consulting/FIX_deposit_mask_tulip
FIX: using Tulip, deposit mask doesn't get saved
2021-08-02 20:15:47 +02:00
atm-florian
fc33d46c77 FIX: using Tulip, deposit mask doesn't get saved 2021-08-02 18:56:45 +02:00
Laurent Destailleur
eced1c824a Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/accountancy/class/accountancyexport.class.php
	htdocs/core/class/html.form.class.php
	htdocs/projet/tasks/time.php
2021-08-02 18:47:09 +02:00
Laurent Destailleur
2deaac0fc4 Fix changelog 2021-08-02 18:34:38 +02:00
Laurent Destailleur
d822421e10 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/accountancy/class/accountancyexport.class.php
	htdocs/accountancy/tpl/export_journal.tpl.php
	htdocs/projet/tasks/time.php
2021-08-02 18:31:26 +02:00
Laurent Destailleur
61e3a57de7 Fix label 2021-08-02 18:23:05 +02:00
Laurent Destailleur
efda27000e Fix set of date of rum signature 2021-08-02 18:13:35 +02:00
Laurent Destailleur
8077fae42e Code comment 2021-08-02 17:56:58 +02:00
Laurent Destailleur
04fc2c0ce7 css 2021-08-02 17:49:27 +02:00
Laurent Destailleur
c6233e4a39 Merge pull request #18165 from trekmorris/patch-3
Update opensurvey.lang manually
2021-08-02 00:03:38 +02:00
Laurent Destailleur
b725dd0309 Merge pull request #18186 from frederic34/patch-8
fix variable
2021-08-01 23:46:42 +02:00
Laurent Destailleur
e8d385ae42 Merge pull request #18224 from aspangaro/14p9
FIX: Missing column Date validation in ledger & subledger
2021-08-01 23:26:25 +02:00
Laurent Destailleur
a983dc7506 Merge pull request #18214 from FHenry/12_fix_css_form_confirmlist
fix: since commit be62c2f7 selectlist from formconfirm were behind form confirm
2021-08-01 14:53:08 +02:00
Laurent Destailleur
5256d6e046 css 2021-07-31 17:34:41 +02:00
Laurent Destailleur
b67487b2ca Fix reposition 2021-07-31 17:28:43 +02:00
Laurent Destailleur
7eb8232b75 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-07-31 17:21:05 +02:00
Laurent Destailleur
bd35d86268 Debug v14 2021-07-31 17:20:48 +02:00
Laurent Destailleur
85a02c5615 Merge pull request #18288 from FHenry/14_deveventorg
NEW: EventOrganization Module #FoundationFunding
2021-07-31 16:57:07 +02:00
Laurent Destailleur
530a773eaa Merge pull request #18300 from cfoellmann/fix-tomail-field
fix `tomail` param in mail form usage
2021-07-31 16:55:01 +02:00
Laurent Destailleur
af95169d1d Update actions_sendmails.inc.php 2021-07-31 16:54:18 +02:00
Laurent Destailleur
f73394435e Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/expensereport/card.php
	htdocs/societe/list.php
2021-07-31 16:32:24 +02:00
Laurent Destailleur
9811569b2b FIX #18289 #18294 2021-07-31 16:22:50 +02:00
Laurent Destailleur
04911bde25 Merge pull request #18277 from atm-florianm/FIX_forum_post_37369_wrong_conf_used
FIX $conf->task used but it does not exist, use $conf->projet instead
2021-07-31 12:20:18 +02:00
Laurent Destailleur
b77ec22590 Merge pull request #18278 from aspangaro/12p17
FIX: Invoice - Missing button to reopen an abandoned situation invoice
2021-07-31 12:19:26 +02:00
Laurent Destailleur
6f5e412bd5 Merge pull request #18299 from Hystepik/develop_v14#3
Fix error in website module -> sitemap v14
2021-07-31 12:15:42 +02:00
Laurent Destailleur
9dc61adcc7 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-07-30 18:44:15 +02:00
Laurent Destailleur
9c626bede4 Fix dol_hash for sha256 2021-07-30 18:43:35 +02:00
Christian Foellmann
f830a0f5e2 fix tomail param in mail form usage 2021-07-30 15:20:41 +02:00
Laurent Destailleur
5995e01bd1 Merge pull request #18280 from ptibogxiv/patch-439
Fix for php 8
2021-07-30 15:19:54 +02:00
lmarcouiller
0d70c81897 ix error in website module -> sitemap 2021-07-30 15:16:38 +02:00
Laurent Destailleur
f4ed3941a7 Merge pull request #18287 from atm-maxime/12.0
Fix right check on thirdparty set on ticket card
2021-07-30 15:11:27 +02:00
Laurent Destailleur
a9f5fd497a Merge pull request #18291 from FHenry/14_fix_add_missing_hook_translationproductpage
fix: add hook management into product translation tab
2021-07-30 15:07:01 +02:00
Laurent Destailleur
252cfb8207 Merge pull request #18298 from ATM-Consulting/FIX_admin_pdf_page_saving_resets_all_boolean_consts
FIX: on admin/pdf.php (with javascript enabled) if you set some boole…
2021-07-30 14:59:30 +02:00
atm-florian
63898426d2 FIX: on admin/pdf.php (with javascript enabled) if you set some boolean confs then click on "save", all boolean values are reset 2021-07-30 13:36:54 +02:00
Florian HENRY
8ea6fc3174 fix: add hook management into product translation tab 2021-07-30 09:38:29 +02:00
Florian HENRY
510cf36bbd Merge branch '14.0' of github.com:Dolibarr/dolibarr into 14_deveventorg 2021-07-30 09:26:55 +02:00
Laurent Destailleur
57d637ac71 Fix set status of a ticket 2021-07-30 01:49:43 +02:00
Laurent Destailleur
047c575d61 Fix some errors on ticket module 2021-07-30 01:42:52 +02:00
Laurent Destailleur
593e84906b FIX bad closing div on error message 2021-07-30 01:16:04 +02:00
Laurent Destailleur
0c3bf536f2 Fix field resolution 2021-07-30 01:10:15 +02:00
Laurent Destailleur
9954a0e4bb Fix status of tickets 2021-07-30 00:40:06 +02:00
Laurent Destailleur
26a7130376 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-07-29 23:48:28 +02:00
Laurent Destailleur
f02dee2e21 Fix test on missing install.lock 2021-07-29 23:47:59 +02:00
Florian HENRY
6f3080c67c send mail from ConfOrBooth list to attendees or santd company 2021-07-29 19:24:12 +02:00
Maxime Kohlhaas
12b2ba64eb Fix right check on thirdparty set on ticket card 2021-07-29 17:49:37 +02:00
Florian HENRY
78646d10bb tpl object linked 2021-07-29 17:26:17 +02:00
Florian HENRY
ae5bb956ac fix invoice in stand registration pb 2021-07-29 17:18:05 +02:00
Alexandre SPANGARO
ca6dd8850a FIX: Manage credit note on situation invoice for calculate margin 2021-07-29 15:24:08 +02:00
ptibogxiv
da482018d2 Fix for php 8 2021-07-29 10:51:51 +02:00
Alexandre SPANGARO
262dd1600b FIX: Invoice - Missing button to reopen an abandoned situation invoice 2021-07-29 06:23:12 +02:00
atm-florian
fdd0ab8461 FIX $conf->task used but it does not exist, use $conf->projet instead 2021-07-28 23:56:44 +02:00
Laurent Destailleur
50f3960d80 Merge pull request #18276 from fappels/14_fix_update_product_lot
FIX update product lot
2021-07-28 23:01:02 +02:00
Francis Appels
f6d03fe28e Fix update product lot 2021-07-28 21:45:11 +02:00
Laurent Destailleur
9734fced56 Merge pull request #18221 from aspangaro/14p8
FIX: Accountancy - Search date on journal
2021-07-28 19:48:38 +02:00
Josep Lluís
e7af8e9d5e FIX totalDayAll hours in tasks
The extra days hours were not considered in total hours
2021-07-28 19:40:33 +02:00
Frédéric FRANCE
ae5d17815f Update dolreceiptprinter.class.php 2021-07-28 19:39:17 +02:00
Laurent Destailleur
e406d80338 Merge pull request #18233 from ptibogxiv/patch-431
fix for php8
2021-07-28 19:37:00 +02:00
Laurent Destailleur
03ac579b64 Merge pull request #18241 from FHenry/fix_numbertotext_ndf
fix: expense report line, on update qty must/can be decimal
2021-07-28 19:31:16 +02:00
Laurent Destailleur
07c4c36520 Merge pull request #18271 from Hystepik/develop_v14#2
Fix a bug in ecm for v14
2021-07-28 19:16:33 +02:00
Laurent Destailleur
20217806c6 Merge pull request #18227 from Hystepik/develop_v13#1
Fix #18185 : Filter fk_stcomm fixed
2021-07-28 19:11:04 +02:00
Laurent Destailleur
fea4210570 Merge pull request #18272 from laurantines/patch-3
Fix opp status required even if PROJECT_USE_OPPORTUNITIES off
2021-07-28 18:57:03 +02:00
Laurent Destailleur
c9a46ab0cc Merge pull request #18273 from aspangaro/12p17
FIX: Accountancy - Debug Export Sage50 / CIEL Compta / CIEL Compta Evo (Format XIMPORT)
2021-07-28 18:55:47 +02:00
Laurent Destailleur
57b18a6bed Merge pull request #18218 from aspangaro/14p6
Security
2021-07-28 17:55:54 +02:00
Laurent Destailleur
d4958ce677 Merge pull request #18220 from aspangaro/14p7
ChangeLog
2021-07-28 17:44:54 +02:00
Laurent Destailleur
512b2477ef Merge pull request #18225 from aspangaro/14p10
FIX: Accountancy - Rules to delete & modify transaction not applied in ledger & subledger
2021-07-28 17:43:49 +02:00
Laurent Destailleur
bd731d9213 Merge pull request #18226 from FHenry/fix_addtimespend
FIX: cannot add time spend when column ref is not displayed
2021-07-28 17:38:04 +02:00
Laurent Destailleur
2b2c8f076b Merge pull request #18231 from ptibogxiv/patch-429
Fix for php 8
2021-07-28 17:37:07 +02:00
Laurent Destailleur
fe2d229ba9 Merge pull request #18235 from ptibogxiv/patch-433
Fix for php8
2021-07-28 17:35:01 +02:00
Laurent Destailleur
686c10e5be Merge pull request #18236 from ptibogxiv/patch-434
Fix for php8
2021-07-28 17:31:45 +02:00
Laurent Destailleur
29a61164fe Merge pull request #18237 from ptibogxiv/patch-435
Fix subscription list
2021-07-28 17:30:42 +02:00
Laurent Destailleur
0476b36c6c Merge pull request #18238 from ptibogxiv/patch-436
Fix for php8
2021-07-28 17:29:54 +02:00
Laurent Destailleur
8e16396d51 Merge pull request #18239 from ptibogxiv/patch-437
fix for php8
2021-07-28 17:29:32 +02:00
Laurent Destailleur
12a0029fb7 Merge pull request #18240 from ptibogxiv/patch-438
Fix for php 8
2021-07-28 17:28:49 +02:00
Alexandre SPANGARO
cd63ede35a Correctif date 2021-07-28 16:46:57 +02:00
laurantines
f8563ace0d Fix opp statusbrequires even if PROJECT_USE_OPPORTUNITIES off
If I modify a project and do not have PROJECT_USE_OPPORTUNITIES enabled, I cannot change the project budget. I get the error message that ErrorOppStatusRequiredIfAmount. However, I do not have the opportunities enabled and it does not make sense for that message to appear when I have not added any opportunities.
2021-07-28 16:14:38 +02:00
lmarcouiller
df8f099857 Fix a bug in ecm for v14 2021-07-28 15:57:12 +02:00
Laurent Destailleur
ae2866ccd7 Merge pull request #18269 from ksar-ksar/patch-6
FIX #18267
2021-07-28 15:38:17 +02:00
Laurent Destailleur
8dca7d2b35 Merge pull request #18260 from FHenry/fix_addhook_addmoractionbutton_productprice
fix: add hook addMoreActionButton product price
2021-07-28 15:30:37 +02:00
Laurent Destailleur
7c86a4766e Merge pull request #18261 from fmarcet/14.0
Fix: Price level on company list not filtering
2021-07-28 15:29:15 +02:00
Laurent Destailleur
97e829c7de Merge pull request #18262 from aspangaro/12p17
FIX: Accountancy - Debug Export Sage50 / CIEL Compta / CIEL Compta Evo (Format XIMPORT)
2021-07-28 15:27:58 +02:00
Laurent Destailleur
288affa3a0 Merge pull request #18263 from OPEN-DSI/fix_00013
FIX: add include missing file '/core/actions_dellink.inc.php' in project card
2021-07-28 15:18:25 +02:00
ksar
2054cca6e5 FIX #18267 2021-07-28 15:14:18 +02:00
Alexandre SPANGARO
7acebd28ca Add information 2021-07-28 14:08:53 +02:00
kamel
95ecbb8940 FIX: add include missing file '/core/actions_dellink.inc.php' in project card 2021-07-28 12:05:46 +02:00
Alexandre SPANGARO
712f0b897d FIX: Accountancy - Debug Export Sage50 / CIEL Compta / CIEL Compta Evo (Format XIMPORT) 2021-07-28 12:02:45 +02:00
Ferran Marcet
ea1c23b562 Merge branch '14.0up' into 14.0 2021-07-28 11:50:40 +02:00
Ferran Marcet
aae64eee1e Fix: Not correct redirect link on lots 2021-07-28 11:48:38 +02:00
Ferran Marcet
2980cd9ab2 Fix: Price level on company list not filtering 2021-07-28 11:19:21 +02:00
Laurent Destailleur
3e9e47d4bd Merge pull request #18255 from ksar-ksar/patch-6
FIX of #18212 : Add url field
2021-07-28 11:17:18 +02:00
Florian HENRY
84d221988f fix: add hook addMoreActionButton product price 2021-07-28 11:17:07 +02:00
Laurent Destailleur
e8061df976 Merge pull request #18257 from frederic34/patch-13
remove debug
2021-07-28 11:11:03 +02:00
Laurent Destailleur
e700e78f7d Merge pull request #18258 from fmarcet/14.0
Fix: Bad rights on inventory module
2021-07-28 11:10:30 +02:00
Ferran Marcet
67cc580797 Fix: Bad rights on inventory module 2021-07-28 10:45:47 +02:00
Frédéric FRANCE
42252abc07 remove debug 2021-07-28 10:14:57 +02:00
ksar
3e3751e161 Add url field
#18212
2021-07-27 22:13:19 +02:00
Florian HENRY
a7f55f4778 fix: Expense report line, on update qty can be decimal 2021-07-26 15:43:57 +02:00
ptibogxiv
54c151916d Fix for php 8 2021-07-26 15:42:43 +02:00
ptibogxiv
053d72c306 fix for php8 2021-07-26 15:37:36 +02:00
ptibogxiv
3cb56d3ec6 Fix for php8 2021-07-26 15:35:31 +02:00
ptibogxiv
76f0bac703 Fix subscription list 2021-07-26 15:29:46 +02:00
ptibogxiv
f83f02e4e2 Fix for php8 2021-07-26 15:24:58 +02:00
ptibogxiv
36ba5c6a71 Fix for php8 2021-07-26 15:22:50 +02:00
stickler-ci
986dc9c857 Fixing style errors. 2021-07-26 13:06:42 +00:00
ptibogxiv
4fa72f7dfe fix for php8 2021-07-26 15:04:43 +02:00
ptibogxiv
b0e2ef4a6c Update extrafields_edit.tpl.php 2021-07-26 14:53:18 +02:00
ptibogxiv
026e61f1ec Update extrafields_edit.tpl.php 2021-07-26 14:53:06 +02:00
ptibogxiv
d443485939 Update extrafields_edit.tpl.php 2021-07-26 14:52:24 +02:00
ptibogxiv
a181469ff8 Update type.php 2021-07-26 14:34:45 +02:00
ptibogxiv
cfdcad0077 Update type.php 2021-07-26 14:30:38 +02:00
ptibogxiv
a08b63d561 Fix for php 8 2021-07-26 14:29:42 +02:00
lmarcouiller
b5dde982d5 Fix #18185 : for v13 2021-07-26 10:32:51 +02:00
Florian HENRY
a7cef1aa15 FIX: cannot add time spend when column ref is not displayed 2021-07-26 10:20:11 +02:00
Alexandre SPANGARO
35862cebfa Fix card presentation 2021-07-26 04:49:56 +02:00
Alexandre SPANGARO
183d413b45 FIX: Accountancy - Rules to delete & modify transaction not applied in ledger & subledger 2021-07-26 04:42:35 +02:00
Alexandre SPANGARO
bbd84fd13e FIX: Missing column Date validation in ledger & subledger 2021-07-26 04:08:05 +02:00
Laurent Destailleur
505543e18e Fix #yogosha6704 2021-07-26 00:37:47 +02:00
Alexandre SPANGARO
84e5773de8 FIX: Accountancy - Search date on journal 2021-07-25 22:37:20 +02:00
Alexandre SPANGARO
467ecb4a64 ChangeLog 2021-07-25 21:21:09 +02:00
Alexandre SPANGARO
5453e3b3b2 Security 2021-07-25 08:35:03 +02:00
Florian HENRY
e93a362a0d fix: since be62c2f7 commit selectlist from formconfirm were behind the form confirm 2021-07-23 18:33:18 +02:00
Laurent Destailleur
4c505619e3 FIX look and field v14 2021-07-23 00:02:14 +02:00
Laurent Destailleur
062c39c40d Fix html entities when we should not 2021-07-21 01:40:45 +02:00
Laurent Destailleur
23f708c0d4 Fix phpcs 2021-07-21 01:27:14 +02:00
Laurent Destailleur
dbed6bc0da Fix #yogosha6678 2021-07-21 01:18:48 +02:00
Laurent Destailleur
e4bb5ed008 Fix phpcs 2021-07-21 00:35:08 +02:00
Laurent Destailleur
c2f1781fae Fix #huntr5bb5a52-3b1c-40ad-9c64-61735f886736 2021-07-21 00:14:03 +02:00
Laurent Destailleur
dc7ff07517 Fix #huntr7144bb4b-338f-45f0-a70e-088ef1f4c037 2021-07-20 23:54:22 +02:00
Laurent Destailleur
0e18bd4be1 Fix #hunter2cd3fc73-65a1-4615-9143-9e7febd81a15 2021-07-20 23:15:31 +02:00
Laurent Destailleur
e25171b9f5 Fix phpcs 2021-07-20 23:03:19 +02:00
Laurent Destailleur
b57eb8284e Fix Improper Authorization Check reported by Ahsan Aziz. 2021-07-20 22:42:23 +02:00
Laurent Destailleur
cea35bd208 Fix pass was lost on error 2021-07-20 22:14:11 +02:00
Frédéric FRANCE
922354f366 Update projects.php 2021-07-20 18:19:27 +02:00
ksar
4d6b63dbed FIX #18181
FIX #18181
2021-07-20 16:14:47 +02:00
trekmorris
284627b693 Update opensurvey.lang manually
This file is not auto sync from transifex . So update it manually .
2021-07-16 23:55:29 +08:00
584 changed files with 8413 additions and 6689 deletions

168
ChangeLog
View File

@@ -2,12 +2,137 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 14.0.3 compared to 14.0.2 *****
FIX: #18698 Supplier invoice list - "alert" checkbox not working
FIX: #18735
FIX: #18767 : Member delete
FIX: #18854
FIX: #18910 : MRP List SQL query syntax error with more than one extrafileds.
FIX: Accountancy - Format Quadra export - Missing line type C to create automaticly a subledger account with label
FIX: Accountancy - Missing specific filename for export on format FEC2, Ciel & repare it
FIX: Accountancy - Option of export popup are inverted
FIX: Accountancy - Some correction on export name
FIX: Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50)
FIX: add warehouse in projects' overview count
FIX: autocalculation of the supplier price in main currency.
FIX: avoid warning if $categories is an id
FIX: Bad use of a forced contact of another company on PDF/ODT documents
FIX: Button text on proposal card to create a invoice
FIX: calculateCosts of BOM must not be included into fetch
FIX: check if greater 0
FIX: default language defined for IN country
FIX: fetch of product with modulebuilder load too much data
FIX: Filter on categories
FIX: indentation
FIX: init hookmanager after loading $conf values
FIX: legal issue on expense report pdf (must also show price without tax)
FIX: missing filter status=1 on rss feeds
FIX: move fetch_optionnal into $ac_static->fetch()
FIX: payment using wrong type in takepos when too many payment mode
FIX: Product accountancy affectation with product_perentity activated (PR #18620)
FIX: products/services card: hidden extrafields were overridden
FIX: Propal list - Problem of pagination on date
FIX: selected lines on supplier invoice create
FIX: Selection of type "people" for membership must hide the company
FIX: select list of orders not complete when field type of company is on
FIX: support of localtax on expense report
FIX: task time: can't filter by user with pgsql + show error message
FIX: task time: keep on using natural_search
FIX: Test when date of invoie is in future (pb with TZ and offset)
FIX: translation into email for member at membership validation.
FIX: unprivileged user can see task associated with a not allowed project
FIX: user without permission can set ticket subject
***** ChangeLog for 14.0.2 compared to 14.0.1 *****
FIX: #18353 Invoice list translation issue
FIX: #18375 SQL Error on tasks statistics
FIX: #18465
FIX: #18484
FIX: #18531
FIX: #18542 REST API: set global $user variable to DolibarrApiAccess::user.
FIX: #18544 Shipment REST API: load thirdparty object into the shipment before validating.
FIX: #18544 Shipment rest api: load thirdparty object when validating
FIX: #18565
FIX: #18589 #18617
FIX: #18591 : Remove double quotes of SQL Queries for postgresql compatibility
FIX: #18666 Order / Shipment list: Don't SQL JOIN category table when not necessary.
FIX: Accountancy - Some problems of length with general & subledger account
FIX: add DISTINCT
FIX: Add option $noescapecommand in executeCLI for better compatibility
FIX: Add token to remove error when removing widget
FIX: Add token when remove the last widget on home page
FIX: an approved holiday can be canceled by an admin.
FIX: better sql request
FIX: change LOG_DEBUG with LOG_WARNING in syslog and remove sql error in syslog (already done)
FIX: Collapsing of extrafields has disappeared.
FIX: Date of payment of subscription must not be set to 1970-01-01.
FIX: Export of website generates a package that contains a sql error
FIX: Field already present in SQL request
FIX: increase maxlength of password input
FIX: invoice fetch not found syslog debug level instead of error
FIX: Invoice list - Wrong name for column total_tva
FIX: invoice validation: when checking if any vat rate has a negative amount, prevent false positives with -1E-14 amounts
FIX: Manage credit note on situation invoice for calculate margin
FIX: Menu List of project was not visible.
FIX: migration script
FIX: multicompany transverse mode compatibility
FIX: option "Default value for field 'Refuse bulk emailings'"
FIX: Recommended session.cookie_samesite must be 'Lax' not 'Strict'.
FIX: Relative discount with high nb of decimals
FIX: salary extrafields don't work and table is not well named
FIX: Supplier invoice list - Wrong language key used
FIX: wrong table_element_line
FIX: wrong users count in multicompany transverse mode
FIX: #yogosha6944 Protection against traversal path.
***** ChangeLog for 14.0.1 compared to 14.0.0 *****
FIX: $conf->task used but it does not exist, use $conf->projet instead
FIX: #18181
FIX: #18212 : Add url field
FIX: #18267
FIX: #18289 #18294
FIX: #18341 lang not loaded
FIX: #18389 Accountancy - Bug on LDcompta10 export for supplier invoice
FIX: #18399 Fix shipment validation email template override.
FIX: Accountancy - Debug Export Sage50 / CIEL Compta / CIEL Compta Evo (Format XIMPORT)
FIX: Accountancy - Rules to delete & modify transaction not applied in ledger & subledger
FIX: Accountancy - Search date on journal
FIX: Accountancy - SQL error on select journal on journal
FIX: Accountancy - SQL error when insert a manuel transaction
FIX: add include missing file '/core/actions_dellink.inc.php' in project card
FIX: avoid to have link to create bookmark on page to create bookmark
FIX: bad approver shown on holiday once approved
FIX: bad closing div on error message
FIX: cannot add time spentd when column ref is not displayed
FIX: Can't remove a permission of a group
FIX: Can't set cost price when product is not on purchase
FIX: compatibility postgresql
FIX: filter on status Draft in modulebuilder
FIX: holiday card: hooks uninitialized
FIX: Invoice - Missing button to reopen an abandoned situation invoice
FIX: Link of download main doc on vat list
FIX: look and field v14
FIX: Missing column Date validation in ledger & subledger
FIX: on admin/pdf.php (with javascript enabled) if you set some boolean confs then click on "save", all boolean values are reset
FIX: on supplier order, JOIN with product fourn price table must be done with fk_soc too to avoid display several times a same line (because of same supplier product ref)
FIX: postgresql filter select search extrafield
FIX: shipping validation workflow: 'ORDER_NEW' trigger called from wrong object
FIX: show info of company into user dropdown
FIX: totalDayAll hours in tasks
FIX: update product lot
FIX: using Tulip, deposit mask was not saved
FIX: #yogosha6907
***** ChangeLog for 14.0.0 compared to 13.0.0 *****
For users:
----------
NEW: Module Recruitement to follow application to job positions is now stable.
NEW: Module Recruitment to follow application to job positions is now stable.
NEW: Feature to make Stock Inventories
NEW: Several security issues after a second private bug hunting campaign.
NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better)
@@ -50,7 +175,7 @@ NEW: Make public bookmarks editable by admin users only
NEW: If main logo not defined, can use the squarred logo on login page
NEW: The manifest file can use the squared image if available
NEW: Enhance the multicurrency rate editor
NEW: Normalyse Type company field with ajax combobox
NEW: Normalise Type company field with ajax combobox
NEW: preload product description on selection for customer propal/order/invoice
NEW: Search usergroups & resources
NEW: Setup Page for module creation with module builder enhancement #FoundationFunding
@@ -67,14 +192,15 @@ NEW: #16378 more E-Mail Contact substitution Values for better salutation
NEW: option to keep the "Automatically create the payment" checkbox empty on the tax creation page
Accountancy
NEW: Accountancy - Add FEC import
NEW: Accountancy - Add a confirmation form with options on export
NEW: Accountancy - Add select date from/to in already bind customer and supplier list
NEW: Accountancy - Format FEC - Add new field DateLimitReglmt
NEW: Accountancy - In ledger & journals, show link on bank transaction
NEW: Accountancy - Possibility to filter on journals in balance
NEW: Accountancy - Add a page to list subledger accounts
NEW: Multiselect ledger account code filter on book keeping list
NEW: Add FEC import
NEW: Add a confirmation form with options on export (for notified export and validate operations)
NEW: Add select date from/to in already bind customer and supplier list
NEW: FEC / FEC2 export - Add new field DateLimitReglmt
NEW: In ledger & journals, show link on bank transaction
NEW: Possibility to filter on journals in balance
NEW: Add a page to list subledger accounts
NEW: Multiselect journal code filter on journal / balance / ledger
NEW: Add first step to close fiscal year
Agenda
NEW: add support for Friday as a non working day
@@ -93,7 +219,7 @@ NEW: can filter files in ECM/GED on status Shared / Not shared
NEW: add a check to avoid an invoice date in the future
NEW: add the total of margin in invoice list
NEW: can set a percentage when creating an invoice from another object
NEW: Support down payment on supplier invoice (& somes ajustments)
NEW: Support down payment on supplier invoice (& some adjustments)
Margin
NEW: add the total of margin in invoice list
@@ -162,7 +288,7 @@ NEW: Add a security center page with all information and advices related to the
NEW: Add a performance center page with all information and advices related to the performance of your instance
Modules
NEW: Module Recruitement is now stable
NEW: Module Recruitment is now stable
NEW: start new experimental module Event Organization Management
NEW: start new experimental module Partnership Management
NEW: start new experimental module Knowledge Management
@@ -171,11 +297,14 @@ NEW: Check update availability for externals modules using a button on module pa
Module SimplePOS is deprecated - TakePOS is recommended for the future
new Options
NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field
NEW: add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field
NEW: add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
NEW: add constant ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY to manage binding with accountancy account declared on thirdparty card
NEW: add constant MAIN_PRODUCT_PERENTITY_SHARED to manage some informations (Accounting account) when product is shared on several entities
NEW: add constant MAIN_COMPANY_PERENTITY_SHARED to manage some informations (Accounting account) when company is shared on several entities
For developers:
@@ -209,7 +338,7 @@ NEW: hook printFieldListTitle for cabyprodserv.php
NEW: hook to allow external modules to add their own shortlist of recent objects
NEW: SQL-altering hooks in the turnover by product report
NEW: add form confirm hook on company card
NEW: add hook addSectionECMAuto method to add custom diretory into ECM auto files
NEW: add hook addSectionECMAuto method to add custom directory into ECM auto files
WARNING:
@@ -224,8 +353,9 @@ Following changes may create regressions for some external modules, but were nec
* If your database is PostgreSQL, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT)
* If your database is MySQL or MariaDB, you need at least version 5.1
* Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules
* removed deprecated subtituion key __REFCLIENT__ (replaced with __REF_CLIENT__)
* Removed deprecated substitution key __REFCLIENT__ (replaced with __REF_CLIENT__)
* Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries.
* v14 seems to work correctly on PHP v8 but it generates a lot of verbose warnings. Currently, v14 i snot yet officialy supported with PHP 8.
***** ChangeLog for 13.0.4 compared to 13.0.3 *****

View File

@@ -154,18 +154,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
### Other application/modules
- Electronic Document Management (EDM)
- Electronic Document Management (EDM)
- Bookmarks management
- Reporting
- Data export/import
- Barcodes
- Barcodes
- Margin calculations
- LDAP connectivity
- ClickToDial integration
- Mass emailing
- RSS integration
- Skype integration
- Social platforms linking
- Social platforms linking
- Payment platforms integration (PayPal, Stripe, Paybox...)
- Email-Collector
@@ -179,14 +179,11 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Multi-Users and groups with finely grained rights
- Multi-Currency
- Multi-Company (by adding of an external module)
- Very user friendly and easy to use
- customizable Dashboard
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
- APIs (REST, SOAP)
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
- Support a lot of country specific features:
- Spanish Tax RE and ISPF
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
@@ -197,7 +194,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Compatible with European GDPR rules
- ...
- Flexible PDF & ODT generation for invoices, proposals, orders...
-
- ...
### System Environment / Requirements

View File

@@ -48,17 +48,16 @@ $includecustom=0;
$includeconstants=array();
if (empty($argv[1])) {
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value] [buildzip=1]\n";
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
exit -1;
}
parse_str($argv[1]);
$i=0;
while ($i < $argc) {
if (! empty($argv[$i])) {
parse_str($argv[$i]);
parse_str($argv[$i]); // set all params $release, $includecustom, $includeconstant, $buildzip ...
}
if (preg_match('/includeconstant=/', $argv[$i])) {
$tmp=explode(':', $includeconstant, 3); // $includeconstant has been set with previous parse_str()
@@ -125,8 +124,8 @@ print "\n";
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
$outputdir=dirname(dirname(__FILE__)).'/htdocs/install';
print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
dol_delete_file($outputdir.'/filelist*.xml', 0, 1, 1);
print 'Delete current files '.$outputdir.'/filelist*.xml*'."\n";
dol_delete_file($outputdir.'/filelist*.xml*', 0, 1, 1);
$checksumconcat=array();
@@ -237,6 +236,22 @@ fputs($fp, '</dolibarr_script_dir_checksum>'."\n");
fputs($fp, '</checksum_list>'."\n");
fclose($fp);
print "File ".$outputfile." generated\n";
if (empty($buildzip)) {
print "File ".$outputfile." generated\n";
} else {
if ($buildzip == '1' || $buildzip == 'zip') {
$result = dol_compress_file($outputfile, $outputfile.'.zip', 'zip');
if ($result > 0) {
dol_delete_file($outputfile);
print "File ".$outputfile.".zip generated\n";
}
} elseif ($buildzip == '2' || $buildzip == 'gz') {
$result = dol_compress_file($outputfile, $outputfile.'.gz', 'gz');
if ($result > 0) {
dol_delete_file($outputfile);
print "File ".$outputfile.".gz generated\n";
}
}
}
exit(0);

View File

@@ -3,11 +3,26 @@
#
# Use this sample to search into a ldap
#
# ldapsearch -h hostname -x
# ldapsearch -h hostname -x -b "ou=people,dc=teclib,dc=infra"
# ldapsearch -h hostname -x -z 0 -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)"
# ldapsearch -h hostname -x -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)"
# Anonymous access
# ldapsearch -h hostname -p 389
#
# Login access (using a Bind DN)
# ldapsearch -h hostname -p 389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
# ldapsearch -d1 -H ldap://hostname:389 -x -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
#
# Login access in SSL (using a Bind DN)
# ldapsearch -H ldaps://hostnamme:636 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local
# If it fails, you may try to use "hostname" that is real name of certificate.
# You must also check that /etc/ldap/ldap.conf contains the line TLS_CACERT /etc/ssl/certs/ca-certificates.crt
# What to search
# ldapsearch -h hostname -p 389 -x -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local"
# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "ou=people,dc=teclib,dc=infra"
# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "o=somecompany.com" "(objectclass=*)"
#
# Example to test a ldap search:
# ldapsearch -h hostname -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password
# ldapsearch -h hostname -p 389 -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password

View File

@@ -1,234 +0,0 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/
/**
* \file dev/initdata/import-dbf.php
* \brief Script example to create a table from a large DBF file (openoffice)
* To purge data, you can have a look at purge-data.php
*/
// Test si mode batch
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = dirname(__FILE__) . '/';
if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit;
}
// Recupere root dolibarr
$path = dirname($_SERVER["PHP_SELF"]);
require $path . "./../htdocs/master.inc.php";
require $path . "/includes/dbase.class.php";
// Global variables
$version = DOL_VERSION;
$confirmed = 1;
$error = 0;
/*
* Main
*/
@set_time_limit(0);
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
$filepath = $argv[1];
$filepatherr = $filepath . '.err';
$startchar = empty($argv[2]) ? 0 : (int) $argv[2];
$deleteTable = empty($argv[3]) ? 1 : 0;
$startlinenb = empty($argv[3]) ? 1 : (int) $argv[3];
$endlinenb = empty($argv[4]) ? 0 : (int) $argv[4];
if (empty($filepath)) {
print "Usage: php $script_file myfilepath.dbf [removeChatColumnName] [startlinenb] [endlinenb]\n";
print "Example: php $script_file myfilepath.dbf 0 2 1002\n";
print "\n";
exit(-1);
}
if (!file_exists($filepath)) {
print "Error: File " . $filepath . " not found.\n";
print "\n";
exit(-1);
}
$ret = $user->fetch('', 'admin');
if (!$ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
exit;
}
$user->getrights();
// Ask confirmation
if (!$confirmed) {
print "Hit Enter to continue or CTRL+C to stop...\n";
$input = trim(fgets(STDIN));
}
// Open input and output files
$fhandle = dbase_open($filepath, 0);
if (!$fhandle) {
print 'Error: Failed to open file ' . $filepath . "\n";
exit(1);
}
$fhandleerr = fopen($filepatherr, 'w');
if (!$fhandleerr) {
print 'Error: Failed to open file ' . $filepatherr . "\n";
exit(1);
}
$langs->setDefaultLang($defaultlang);
$record_numbers = dbase_numrecords($fhandle);
$table_name = substr(basename($filepath), 0, strpos(basename($filepath), '.'));
print 'Info: ' . $record_numbers . " lines in file \n";
$header = dbase_get_header_info($fhandle);
if ($deleteTable) {
$db->query("DROP TABLE IF EXISTS `$table_name`");
}
$sqlCreate = "CREATE TABLE IF NOT EXISTS `$table_name` ( `id` INT(11) NOT NULL AUTO_INCREMENT ";
$fieldArray = array("`id`");
foreach ($header as $value) {
$fieldName = substr(str_replace('_', '', $value['name']), $startchar);
$fieldArray[] = "`$fieldName`";
$sqlCreate .= ", `" . $fieldName . "` VARCHAR({$value['length']}) NULL DEFAULT NULL ";
}
$sqlCreate .= ", PRIMARY KEY (`id`)) ENGINE = InnoDB";
$resql = $db->query($sqlCreate);
if ($resql !== false) {
print "Table $table_name created\n";
} else {
var_dump($db->errno());
print "Impossible : " . $sqlCreate . "\n";
die();
}
$i = 0;
$nboflines++;
$fields = implode(',', $fieldArray);
//var_dump($fieldArray);die();
$maxLength = 0;
for ($i = 1; $i <= $record_numbers; $i++) {
if ($startlinenb && $i < $startlinenb) {
continue;
}
if ($endlinenb && $i > $endlinenb) {
continue;
}
$row = dbase_get_record_with_names($fhandle, $i);
if ($row === false || (isset($row["deleted"]) && $row["deleted"] == '1')) {
continue;
}
$sqlInsert = "INSERT INTO `$table_name`($fields) VALUES (null,";
array_shift($row); // remove delete column
foreach ($row as $value) {
$sqlInsert .= "'" . $db->escape(utf8_encode($value)) . "', ";
}
replaceable_echo(implode("\t", $row));
$sqlInsert = rtrim($sqlInsert, ', ');
$sqlInsert .= ")";
$resql = $db->query($sqlInsert);
if ($resql === false) {
print "Impossible : " . $sqlInsert . "\n";
var_dump($row, $db->errno());
die();
}
// $fields = (object) $row;
// var_dump($fields);
continue;
}
die();
// commit or rollback
print "Nb of lines qualified: " . $nboflines . "\n";
print "Nb of errors: " . $error . "\n";
if ($mode != 'confirmforced' && ($error || $mode != 'confirm')) {
print "Rollback any changes.\n";
$db->rollback();
} else {
print "Commit all changes.\n";
$db->commit();
}
$db->close();
fclose($fhandle);
fclose($fhandleerr);
exit($error);
/**
* replaceable_echo
*
* @param string $message Message
* @param int $force_clear_lines Force clear messages
* @return void
*/
function replaceable_echo($message, $force_clear_lines = null)
{
static $last_lines = 0;
if (!is_null($force_clear_lines)) {
$last_lines = $force_clear_lines;
}
$toss = array();
$status = 0;
$term_width = exec('tput cols', $toss, $status);
if ($status) {
$term_width = 64; // Arbitrary fall-back term width.
}
$line_count = 0;
foreach (explode("\n", $message) as $line) {
$line_count += count(str_split($line, $term_width));
}
// Erasure MAGIC: Clear as many lines as the last output had.
for ($i = 0; $i < $last_lines; $i++) {
// Return to the beginning of the line
echo "\r";
// Erase to the end of the line
echo "\033[K";
// Move cursor Up a line
echo "\033[1A";
// Return to the beginning of the line
echo "\r";
// Erase to the end of the line
echo "\033[K";
// Return to the beginning of the line
echo "\r";
// Can be consolodated into
// echo "\r\033[K\033[1A\r\033[K\r";
}
$last_lines = $line_count;
echo $message . "\n";
}

View File

@@ -1,248 +0,0 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/
/**
* \file dev/initdata/import-product.php
* \brief Script example to insert products from a csv file.
* To purge data, you can have a look at purge-data.php
*/
// Test si mode batch
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = dirname(__FILE__) . '/';
if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit;
}
// Recupere root dolibarr
$path = preg_replace('/importdb-products.php/i', '', $_SERVER["PHP_SELF"]);
require $path . "../../htdocs/master.inc.php";
require $path . "includes/dbase.class.php";
include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
//$delimiter = ',';
//$enclosure = '"';
//$linelength = 10000;
//$escape = '/';
// Global variables
$version = DOL_VERSION;
$confirmed = 1;
$error = 0;
$tvas = [
'1' => "20.00",
'2' => "5.50",
'3' => "0.00",
'4' => "20.60",
'5' => "19.60",
];
$tvasD = [
'1' => "20",
'2' => "5.5",
'3' => "0",
'4' => "20",
'5' => "20",
];
/*
* Main
*/
@set_time_limit(0);
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
$table = $argv[1];
if (empty($argv[1])) {
print "Error: Which table ?\n";
print "\n";
exit(-1);
}
$ret = $user->fetch('', 'admin');
if (!$ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
exit;
}
$sql = "SELECT * FROM `$table` WHERE 1";
$resql = $db->query($sql);
if ($resql) {
while ($fields = $db->fetch_array($resql)) {
$errorrecord = 0;
if ($fields === false) {
continue;
}
$nboflines++;
$produit = new Product($db);
$produit->type = 0;
$produit->status = 1;
$produit->ref = trim($fields['REF']);
if ($produit->ref == '') {
continue;
}
print "Process line nb " . $j . ", ref " . $produit->ref;
$produit->label = trim($fields['LIBELLE']);
if ($produit->label == '') {
$produit->label = $produit->ref;
}
if (empty($produit->label)) {
continue;
}
//$produit->description = trim($fields[4] . "\n" . ($fields[5] ? $fields[5] . ' x ' . $fields[6] . ' x ' . $fields[7] : ''));
// $produit->volume = price2num($fields[8]);
// $produit->volume_unit = 0;
$produit->weight = price2num($fields['MASSE']);
$produit->weight_units = 0; // -3 = g
//$produit->customcode = $fields[10];
$produit->barcode = str_pad($fields['CODE'], 12, "0", STR_PAD_LEFT);
$produit->barcode_type = '2';
$produit->import_key = $fields['CODE'];
$produit->status = 1;
$produit->status_buy = 1;
$produit->finished = 1;
// $produit->multiprices[0] = price2num($fields['TARIF0']);
// $produit->multiprices[1] = price2num($fields['TARIF1']);
// $produit->multiprices[2] = price2num($fields['TARIF2']);
// $produit->multiprices[3] = price2num($fields['TARIF3']);
// $produit->multiprices[4] = price2num($fields['TARIF4']);
// $produit->multiprices[5] = price2num($fields['TARIF5']);
// $produit->multiprices[6] = price2num($fields['TARIF6']);
// $produit->multiprices[7] = price2num($fields['TARIF7']);
// $produit->multiprices[8] = price2num($fields['TARIF8']);
// $produit->multiprices[9] = price2num($fields['TARIF9']);
// $produit->price_min = null;
// $produit->price_min_ttc = null;
// $produit->price = price2num($fields[11]);
// $produit->price_ttc = price2num($fields[12]);
// $produit->price_base_type = 'TTC';
// $produit->tva_tx = price2num($fields[13]);
$produit->tva_tx = (int) ($tvas[$fields['CODTVA']]);
$produit->tva_npr = 0;
// $produit->cost_price = price2num($fields[16]);
//compta
$produit->accountancy_code_buy = trim($fields['COMACH']);
$produit->accountancy_code_sell = trim($fields['COMVEN']);
// $produit->accountancy_code_sell_intra=trim($fields['COMVEN']);
// $produit->accountancy_code_sell_export=trim($fields['COMVEN']);
// Extrafields
// $produit->array_options['options_ecotaxdeee'] = price2num($fields[17]);
$produit->seuil_stock_alerte = $fields['STALERTE'];
$ret = $produit->create($user, 0);
if ($ret < 0) {
print " - Error in create result code = " . $ret . " - " . $produit->errorsToString();
$errorrecord++;
} else {
print " - Creation OK with ref " . $produit->ref . " - id = " . $ret;
}
dol_syslog("Add prices");
// If we use price level, insert price for each level
if (!$errorrecord && 1) {
//$ret1 = $produit->updatePrice($produit->price_ttc, $produit->price_base_type, $user, $produit->tva_tx, $produit->price_min, 1, $produit->tva_npr, 0, 0, array());
$ret1 = false;
for ($i = 0; $i < 10; $i++) {
if ($fields['TARIF' . ($i)] == 0) {
continue;
}
$ret1 = $ret1 || $produit->updatePrice(price2num($fields['TARIF' . ($i)]), 'HT', $user, $produit->tva_tx, $produit->price_min, $i + 1, $produit->tva_npr, 0, 0, array()) < 0;
}
if ($ret1) {
print " - Error in updatePrice result " . $produit->errorsToString();
$errorrecord++;
} else {
print " - updatePrice OK";
}
}
// dol_syslog("Add multilangs");
// Add alternative languages
// if (!$errorrecord && 1) {
// $produit->multilangs['fr_FR'] = array('label' => $produit->label, 'description' => $produit->description, 'note' => $produit->note_private);
// $produit->multilangs['en_US'] = array('label' => $fields[3], 'description' => $produit->description, 'note' => $produit->note_private);
//
// $ret = $produit->setMultiLangs($user);
// if ($ret < 0) {
// print " - Error in setMultiLangs result code = " . $ret . " - " . $produit->errorsToString();
// $errorrecord++;
// } else {
// print " - setMultiLangs OK";
// }
// }
dol_syslog("Add stocks");
// stocks
if (!$errorrecord && $fields['STOCK'] != 0) {
$rets = $produit->correct_stock($user, 1, $fields['STOCK'], 0, 'Stock importé');
if ($rets < 0) {
print " - Error in correct_stock result " . $produit->errorsToString();
$errorrecord++;
} else {
print " - correct_stock OK";
}
}
//update date créa
if (!$errorrecord) {
$date = substr($fields['DATCREA'], 0, 4) . '-' . substr($fields['DATCREA'], 4, 2) . '-' . substr($fields['DATCREA'], 6, 2);
$retd = $db->query("UPDATE `llx_product` SET `datec` = '$date 00:00:00' WHERE `llx_product`.`rowid` = $produit->id");
if ($retd < 1) {
print " - Error in update date créa result " . $produit->errorsToString();
$errorrecord++;
} else {
print " - update date créa OK";
}
}
print "\n";
if ($errorrecord) {
print( 'Error on record nb ' . $i . " - " . $produit->errorsToString() . "\n");
var_dump($db);
die();
$error++; // $errorrecord will be reset
}
$j++;
}
} else {
die("error : $sql");
}
// commit or rollback
print "Nb of lines qualified: " . $nboflines . "\n";
print "Nb of errors: " . $error . "\n";
$db->close();
exit($error);

View File

@@ -1,365 +0,0 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/
/**
* \file dev/initdata/import-product.php
* \brief Script example to insert products from a csv file.
* To purge data, you can have a look at purge-data.php
*/
// Test si mode batch
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = dirname(__FILE__) . '/';
if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit;
}
// Recupere root dolibarr
$path = preg_replace('/importdb-thirdparties.php/i', '', $_SERVER["PHP_SELF"]);
require $path . "../../htdocs/master.inc.php";
require $path . "includes/dbase.class.php";
include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
//$delimiter = ',';
//$enclosure = '"';
//$linelength = 10000;
//$escape = '/';
// Global variables
$version = DOL_VERSION;
$confirmed = 1;
$error = 0;
$civilPrivate = array("MLLE",
"MM",
"MM/MADAME",
"MME",
"MME.",
"MME²",
"MMONSIEUR",
"MMR",
"MOBNSIEUR",
"MOMSIEUR",
"MON SIEUR",
"MONDIAL",
"MONIEUR",
"MONJSIEUR",
"MONNSIEUR",
"MONRIEUR",
"MONS",
"MONSIEÕR",
"MONSIER",
"MONSIERU",
"MONSIEU",
"monsieue",
"MONSIEUR",
"Monsieur     \"",
"MONSIEUR    \"",
"MONSIEUR   E",
"MONSIEUR  DENIS",
"MONSIEUR ET MME",
"MONSIEUR!",
"MONSIEUR.",
"MONSIEUR.MADAME",
"MONSIEUR3",
"MONSIEURN",
"MONSIEURT",
"MONSIEUR£",
"MONSIEYR",
"Monsigur",
"MONSIIEUR",
"MONSIUER",
"MONSIZEUR",
"MOPNSIEUR",
"MOSIEUR",
"MR",
"Mr  Mme",
"Mr - MME",
"MR BLANC",
"MR ET MME",
"mr mm",
"MR OU MME",
"Mr.",
"MR/MME",
"MRME",
"MRR",
"Mrs",
"Mademoiselle",
"MADAOME",
"madamme",
"MADAME",
"M0NSIEUR",
"M.et Madame",
"M. ET MR",
"M.",
"M%",
"M MME",
"M ET MME",
"M",
"M CROCE",
"M DIEVART",
);
/*
* Main
*/
@set_time_limit(0);
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
$table = $argv[1];
if (empty($argv[1])) {
print "Error: Quelle table ?\n";
print "\n";
exit(-1);
}
$ret = $user->fetch('', 'admin');
if (!$ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
exit;
}
$sql = "SELECT * FROM `$table` WHERE 1 "; //ORDER BY REMISE DESC,`LCIVIL` DESC";
$resql = $db->query($sql);
//$db->begin();
if ($resql) {
while ($fields = $db->fetch_array($resql)) {
$i++;
$errorrecord = 0;
if ($startlinenb && $i < $startlinenb) {
continue;
}
if ($endlinenb && $i > $endlinenb) {
continue;
}
$nboflines++;
$object = new Societe($db);
$object->import_key = $fields['CODE'];
$object->state = 1;
$object->client = 3;
$object->fournisseur = 0;
$object->name = $fields['FCIVIL'] . ' ' . $fields['FNOM'];
//$object->name_alias = $fields[0] != $fields[13] ? trim($fields[0]) : '';
$date = $fields['DATCREA'] ? $fields['DATCREA'] : ($fields['DATMOD'] ? $fields['DATMOD'] : '20200101');
$object->code_client = 'CU' . substr($date, 2, 2) . substr($date, 4, 2) . '-' . str_pad(substr($fields['CODE'], 0, 5), 5, "0", STR_PAD_LEFT);
$object->address = trim($fields['FADR1']);
if ($fields['FADR2']) {
$object->address .= "\n" . trim($fields['FADR2']);
}
if ($fields['FADR3']) {
$object->address .= "\n" . trim($fields['FADR3']);
}
$object->zip = trim($fields['FPOSTE']);
$object->town = trim($fields['FVILLE']);
if ($fields['FPAYS']) {
$object->country_id = dol_getIdFromCode($db, trim(ucwords(strtolower($fields['FPAYS']))), 'c_country', 'label', 'rowid');
} else {
$object->country_id = 1;
}
$object->phone = trim($fields['FTEL']) ? trim($fields['FTEL']) : trim($fields['FCONTACT']);
$object->phone = substr($object->phone, 0, 20);
$object->fax = trim($fields['FFAX']) ? trim($fields['FFAX']) : trim($fields['FCONTACT']);
$object->fax = substr($object->fax, 0, 20);
$object->email = trim($fields['FMAIL']);
// $object->idprof2 = trim($fields[29]);
$object->tva_intra = str_replace(['.', ' '], '', $fields['TVAINTRA']);
$object->tva_intra = substr($object->tva_intra, 0, 20);
$object->default_lang = 'fr_FR';
$object->cond_reglement_id = dol_getIdFromCode($db, 'PT_ORDER', 'c_payment_term', 'code', 'rowid', 1);
$object->multicurrency_code = 'EUR';
if ($fields['REMISE'] != '0.00') {
$object->remise_percent = abs($fields['REMISE']);
}
// $object->code_client = $fields[9];
// $object->code_fournisseur = $fields[10];
if ($fields['FCIVIL']) {
$labeltype = in_array($fields['FCIVIL'], $civilPrivate) ? 'TE_PRIVATE' : 'TE_SMALL';
$object->typent_id = dol_getIdFromCode($db, $labeltype, 'c_typent', 'code');
}
// Set price level
$object->price_level = $fields['TARIF'] + 1;
// if ($labeltype == 'Revendeur')
// $object->price_level = 2;
print "Process line nb " . $i . ", code " . $fields['CODE'] . ", name " . $object->name;
// Extrafields
$object->array_options['options_banque'] = $fields['BANQUE'];
$object->array_options['options_banque2'] = $fields['BANQUE2'];
$object->array_options['options_banquevalid'] = $fields['VALID'];
if (!$errorrecord) {
$ret = $object->create($user);
if ($ret < 0) {
print " - Error in create result code = " . $ret . " - " . $object->errorsToString();
$errorrecord++;
var_dump($object->code_client, $db);
die();
} else {
print " - Creation OK with name " . $object->name . " - id = " . $ret;
}
}
if (!$errorrecord) {
dol_syslog("Set price level");
$object->set_price_level($object->price_level, $user);
}
if (!$errorrecord && @$object->remise_percent) {
dol_syslog("Set remise client");
$object->set_remise_client($object->remise_percent, 'Importé', $user);
}
dol_syslog("Add contact");
// Insert an invoice contact if there is an invoice email != standard email
if (!$errorrecord && ($fields['LCIVIL'] || $fields['LNOM'])) {
$madame = array("MADAME",
"MADEMOISELLE",
"MELLE",
"MLLE",
"MM",
"Mme",
"MNE",
);
$monsieur = array("M",
"M ET MME",
"M MME",
"M.",
"M. MME",
"M. OU Mme",
"M.ou Madame",
"MONSEUR",
"MONSIER",
"MONSIEU",
"MONSIEUR",
"monsieur:mme",
"MONSIEUR¨",
"MONSIEZUR",
"MONSIUER",
"MONSKIEUR",
"MR",
);
$ret1 = $ret2 = 0;
$contact = new Contact($db);
if (in_array($fields['LCIVIL'], $madame)) {
// une dame
$contact->civility_id = 'MME';
$contact->lastname = $fields['LNOM'];
} elseif (in_array($fields['LCIVIL'], $monsieur)) {
// un monsieur
$contact->civility_id = 'MR';
$contact->lastname = $fields['LNOM'];
} elseif (in_array($fields['LCIVIL'], ['DOCTEUR'])) {
// un monsieur
$contact->civility_id = 'DR';
$contact->lastname = $fields['LNOM'];
} else {
// un a rattraper
$contact->lastname = $fields['LCIVIL'] . " " . $fields['LNOM'];
}
$contact->address = trim($fields['LADR1']);
if ($fields['LADR2']) {
$contact->address .= "\n" . trim($fields['LADR2']);
}
if ($fields['LADR3']) {
$contact->address .= "\n" . trim($fields['LADR3']);
}
$contact->zip = trim($fields['LPOSTE']);
$contact->town = trim($fields['LVILLE']);
if ($fields['FPAYS']) {
$contact->country_id = dol_getIdFromCode($db, trim(ucwords(strtolower($fields['LPAYS']))), 'c_country', 'label', 'rowid');
} else {
$contact->country_id = 1;
}
$contact->email = $fields['LMAIL'];
$contact->phone = trim($fields['LTEL']) ? trim($fields['LTEL']) : trim($fields['LCONTACT']);
$contact->fax = trim($fields['LFAX']) ? trim($fields['LFAX']) : trim($fields['LCONTACT']);
$contact->socid = $object->id;
$ret1 = $contact->create($user);
if ($ret1 > 0) {
//$ret2=$contact->add_contact($object->id, 'BILLING');
}
if ($ret1 < 0 || $ret2 < 0) {
print " - Error in create contact result code = " . $ret1 . " " . $ret2 . " - " . $contact->errorsToString();
$errorrecord++;
} else {
print " - create contact OK";
}
}
//update date créa
if (!$errorrecord) {
$datec = substr($date, 0, 4) . '-' . substr($date, 4, 2) . '-' . substr($date, 6, 2);
$retd = $db->query("UPDATE `llx_societe` SET `datec` = '$datec 00:00:00' WHERE `rowid` = $object->id");
if ($retd < 1) {
print " - Error in update date créa result " . $object->errorsToString();
$errorrecord++;
} else {
print " - update date créa OK";
}
}
print "\n";
if ($errorrecord) {
print( 'Error on record nb ' . $i . " - " . $object->errorsToString() . "\n");
var_dump($db, $object, $contact);
// $db->rollback();
die();
$error++; // $errorrecord will be reset
}
$j++;
}
} else {
die("error : $sql");
}
$db->commit();
// commit or rollback
print "Nb of lines qualified: " . $nboflines . "\n";
print "Nb of errors: " . $error . "\n";
$db->close();
exit($error);

View File

@@ -1,599 +0,0 @@
<?php
/**
* \file dev/initdata/dbf/includes/dbase.class.php
* \ingroup dev
* \brief Class to manage DBF databases
*/
// source : https://github.com/donfbecker/php-dbase
define('DBASE_RDONLY', 0);
define('DBASE_WRONLY', 1);
define('DBASE_RDWR', 2);
define('DBASE_TYPE_DBASE', 0);
define('DBASE_TYPE_FOXPRO', 1);
/**
* Class for DBase
*/
class DBase
{
private $fd;
private $headerLength = 0;
private $fields = array();
private $fieldCount = 0;
private $recordLength = 0;
private $recordCount = 0;
/**
* resource dbase_open
* @param string $filename filename
* @param int $mode mode
* @return DBase
*/
public static function open($filename, $mode)
{
if (!file_exists($filename)) {
return false;
}
$modes = array('r', 'w', 'r+');
$mode = $modes[$mode];
$fd = fopen($filename, $mode);
if (!$fd) {
return false;
}
return new DBase($fd);
}
/**
* resource dbase_create
* @param string $filename filename
* @param array $fields fields
* @param int $type DBASE_TYPE_DBASE
* @return DBase
*/
public static function create($filename, $fields, $type = DBASE_TYPE_DBASE)
{
if (file_exists($filename)) {
return false;
}
$fd = fopen($filename, 'c+');
if (!$fd) {
return false;
}
// Byte 0 (1 byte): Valid dBASE for DOS file; bits 0-2 indicate version number, bit 3
// indicates the presence of a dBASE for DOS memo file, bits 4-6 indicate the
// presence of a SQL table, bit 7 indicates the presence of any memo file
// (either dBASE m PLUS or dBASE for DOS)
self::putChar8($fd, 5);
// Byte 1-3 (3 bytes): Date of last update; formatted as YYMMDD
self::putChar8($fd, date('Y') - 1900);
self::putChar8($fd, date('m'));
self::putChar8($fd, date('d'));
// Byte 4-7 (32-bit number): Number of records in the database file. Currently 0
self::putInt32($fd, 0);
// Byte 8-9 (16-bit number): Number of bytes in the header.
self::putInt16($fd, 32 + (32 * count($fields)) + 1);
// Byte 10-11 (16-bit number): Number of bytes in record.
// Make sure the include the byte for deleted flag
$len = 1;
foreach ($fields as &$field) {
$len += self::length($field);
}
self::putInt16($fd, $len);
// Byte 12-13 (2 bytes): Reserved, 0 filled.
self::putInt16($fd, 0);
// Byte 14 (1 byte): Flag indicating incomplete transaction
// The ISMARKEDO function checks this flag. BEGIN TRANSACTION sets it to 1, END TRANSACTION and ROLLBACK reset it to 0.
self::putChar8($fd, 0);
// Byte 15 (1 byte): Encryption flag. If this flag is set to 1, the message Database encrypted appears. Changing this flag to 0 removes the message, but does not decrypt the file.
self::putChar8($fd, 0);
// Byte 16-27 (12 bytes): Reserved for dBASE for DOS in a multi-user environment
self::putInt32($fd, 0);
self::putInt32($fd, 0);
self::putInt32($fd, 0);
// Byte 28 (1 byte): Production .mdx file flag; 0x01 if there is a production .mdx file, 0x00 if not
self::putChar8($fd, 0);
// Byte 29 (1 byte): Language driver ID
// (no clue what this is)
self::putChar8($fd, 0);
// Byte 30-31 (2 bytes): Reserved, 0 filled.
self::putInt16($fd, 0);
// Byte 32 - n (32 bytes each): Field descriptor array
foreach ($fields as &$field) {
self::putString($fd, $field[0], 11); // Byte 0 - 10 (11 bytes): Field name in ASCII (zero-filled)
self::putString($fd, $field[1], 1); // Byte 11 (1 byte): Field type in ASCII (C, D, F, L, M, or N)
self::putInt32($fd, 0); // Byte 12 - 15 (4 bytes): Reserved
self::putChar8($fd, self::length($field)); // Byte 16 (1 byte): Field length in binary. The maximum length of a field is 254 (0xFE).
self::putChar8($fd, $field[3]); // Byte 17 (1 byte): Field decimal count in binary
self::putInt16($fd, 0); // Byte 18 - 19 (2 bytes): Work area ID
self::putChar8($fd, 0); // Byte 20 (1 byte): Example (??)
self::putInt32($fd, 0); // Byte 21 - 30 (10 bytes): Reserved
self::putInt32($fd, 0);
self::putInt16($fd, 0);
self::putChar8($fd, 0); // Byte 31 (1 byte): Production MDX field flag; 1 if field has an index tag in the production MDX file, 0 if not
}
// Byte n + 1 (1 byte): 0x0D as the field descriptor array terminator
self::putChar8($fd, 0x0D);
return new DBase($fd);
}
/**
* Create DBase instance
* @param mixed $fd file descriptor
* @return void
*/
private function __construct($fd)
{
$this->fd = $fd;
// Byte 4-7 (32-bit number): Number of records in the database file. Currently 0
fseek($this->fd, 4, SEEK_SET);
$this->recordCount = self::getInt32($fd);
// Byte 8-9 (16-bit number): Number of bytes in the header.
fseek($this->fd, 8, SEEK_SET);
$this->headerLength = self::getInt16($fd);
// Number of fields is (headerLength - 33) / 32)
$this->fieldCount = ($this->headerLength - 33) / 32;
// Byte 10-11 (16-bit number): Number of bytes in record.
fseek($this->fd, 10, SEEK_SET);
$this->recordLength = self::getInt16($fd);
// Byte 32 - n (32 bytes each): Field descriptor array
fseek($fd, 32, SEEK_SET);
for ($i = 0; $i < $this->fieldCount; $i++) {
$data = fread($this->fd, 32);
$field = array_map('trim', unpack('a11name/a1type/c4/c1length/c1precision/s1workid/c1example/c10/c1production', $data));
$this->fields[] = $field;
}
}
/**
* dbase_close
* @return void
*/
public function close()
{
fclose($this->fd);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* dbase_get_header_info
* @return array
*/
public function get_header_info()
{
// phpcs:disable
return $this->fields;
}
/**
* dbase_numfields
* @return int
*/
public function numfields()
{
return $this->fieldCount;
}
/**
* dbase_numrecords
* @return int
*/
public function numrecords()
{
return $this->recordCount;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* dbase_add_record
* @param array $record record
* @return bool
*/
public function add_record($record)
{
// phpcs:enable
if (count($record) != $this->fieldCount) {
return false;
}
// Seek to end of file, minus the end of file marker
fseek($this->fd, 0, SEEK_END);
// Put the deleted flag
self::putChar8($this->fd, 0x20);
// Put the record
if (!$this->putRecord($record)) {
return false;
}
// Update the record count
fseek($this->fd, 4);
self::putInt32($this->fd, ++$this->recordCount);
return true;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* dbase_replace_record
* @param array $record record
* @param int $record_number record number
* @return bool
*/
public function replace_record($record, $record_number)
{
// phpcs:enable
if (count($record) != $this->fieldCount) {
return false;
}
if ($record_number < 1 || $record_number > $this->recordCount) {
return false;
}
// Skip to the record location, plus the 1 byte for the deleted flag
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)) + 1);
return $this->putRecord($record);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* dbase_delete_record
* @param int $record_number record number
* @return bool
*/
public function delete_record($record_number)
{
// phpcs:enable
if ($record_number < 1 || $record_number > $this->recordCount) {
return false;
}
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)));
self::putChar8($this->fd, 0x2A);
return true;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* dbase_get_record
* @param int $record_number record number
* @return array
*/
public function get_record($record_number)
{
// phpcs:enable
if ($record_number < 1 || $record_number > $this->recordCount) {
return false;
}
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)));
$record = array(
'deleted' => self::getChar8($this->fd) == 0x2A ? 1 : 0
);
foreach ($this->fields as $i => &$field) {
$value = trim(fread($this->fd, $field['length']));
if ($field['type'] == 'L') {
$value = strtolower($value);
if ($value == 't' || $value == 'y') {
$value = true;
} elseif ($value == 'f' || $value == 'n') {
$value = false;
} else {
$value = null;
}
}
$record[$i] = $value;
}
return $record;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* dbase_get_record_with_names
* @param int $record_number record number
* @return array
*/
public function get_record_with_names($record_number)
{
// phpcs:enable
if ($record_number < 1 || $record_number > $this->recordCount) {
return false;
}
$record = $this->get_record($record_number);
foreach ($this->fields as $i => &$field) {
$record[$field['name']] = $record[$i];
unset($record[$i]);
}
return $record;
}
/**
* dbase_pack
* @return void
*/
public function pack()
{
$in_offset = $out_offset = $this->headerLength;
$new_count = 0;
$rec_count = $this->recordCount;
while ($rec_count > 0) {
fseek($this->fd, $in_offset, SEEK_SET);
$record = fread($this->fd, $this->recordLength);
$deleted = substr($record, 0, 1);
if ($deleted != '*') {
fseek($this->fd, $out_offset, SEEK_SET);
fwrite($this->fd, $record);
$out_offset += $this->recordLength;
$new_count++;
}
$in_offset += $this->recordLength;
$rec_count--;
}
ftruncate($this->fd, $out_offset);
// Update the record count
fseek($this->fd, 4);
self::putInt32($this->fd, $new_count);
}
/*
* A few utilitiy functions
*/
/**
* @param string $field field
* @return int
*/
private static function length($field)
{
switch ($field[1]) {
case 'D': // Date: Numbers and a character to separate month, day, and year (stored internally as 8 digits in YYYYMMDD format)
return 8;
case 'T': // DateTime (YYYYMMDDhhmmss.uuu) (FoxPro)
return 18;
case 'M': // Memo (ignored): All ASCII characters (stored internally as 10 digits representing a .dbt block number, right justified, padded with whitespaces)
case 'N': // Number: -.0123456789 (right justified, padded with whitespaces)
case 'F': // Float: -.0123456789 (right justified, padded with whitespaces)
case 'C': // String: All ASCII characters (padded with whitespaces up to the field's length)
return $field[2];
case 'L': // Boolean: YyNnTtFf? (? when not initialized)
return 1;
}
return 0;
}
/*
* Functions for reading and writing bytes
*/
/**
* getChar8
* @param mixed $fd file descriptor
* @return int
*/
private static function getChar8($fd)
{
return ord(fread($fd, 1));
}
/**
* putChar8
* @param mixed $fd file descriptor
* @param mixed $value value
* @return bool
*/
private static function putChar8($fd, $value)
{
return fwrite($fd, chr($value));
}
/**
* getInt16
* @param mixed $fd file descriptor
* @param int $n n
* @return bool
*/
private static function getInt16($fd, $n = 1)
{
$data = fread($fd, 2 * $n);
$i = unpack("S$n", $data);
if ($n == 1) {
return (int) $i[1];
} else {
return array_merge($i);
}
}
/**
* putInt16
* @param mixed $fd file descriptor
* @param mixed $value value
* @return bool
*/
private static function putInt16($fd, $value)
{
return fwrite($fd, pack('S', $value));
}
/**
* getInt32
* @param mixed $fd file descriptor
* @param int $n n
* @return bool
*/
private static function getInt32($fd, $n = 1)
{
$data = fread($fd, 4 * $n);
$i = unpack("L$n", $data);
if ($n == 1) {
return (int) $i[1];
} else {
return array_merge($i);
}
}
/**
* putint32
* @param mixed $fd file descriptor
* @param mixed $value value
* @return bool
*/
private static function putInt32($fd, $value)
{
return fwrite($fd, pack('L', $value));
}
/**
* putString
* @param mixed $fd file descriptor
* @param mixed $value value
* @param int $length length
* @return bool
*/
private static function putString($fd, $value, $length = 254)
{
$ret = fwrite($fd, pack('A' . $length, $value));
}
/**
* putRecord
* @param mixed $record record
* @return bool
*/
private function putRecord($record)
{
foreach ($this->fields as $i => &$field) {
$value = $record[$i];
// Number types are right aligned with spaces
if ($field['type'] == 'N' || $field['type'] == 'F' && strlen($value) < $field['length']) {
$value = str_repeat(' ', $field['length'] - strlen($value)) . $value;
}
self::putString($this->fd, $value, $field['length']);
}
return true;
}
}
if (!function_exists('dbase_open')) {
/**
* dbase_open
* @param string $filename filename
* @param int $mode mode
* @return DBase
*/
function dbase_open($filename, $mode)
{
return DBase::open($filename, $mode);
}
/**
* dbase_create
* @param string $filename filename
* @param array $fields fields
* @param int $type type
* @return DBase
*/
function dbase_create($filename, $fields, $type = DBASE_TYPE_DBASE)
{
return DBase::create($filename, $fields, $type);
}
/**
* dbase_close
* @param Resource $dbase_identifier dbase identifier
* @return bool
*/
function dbase_close($dbase_identifier)
{
return $dbase_identifier->close();
}
/**
* dbase_get_header_info
* @param Resource $dbase_identifier dbase identifier
* @return string
*/
function dbase_get_header_info($dbase_identifier)
{
return $dbase_identifier->get_header_info();
}
/**
* dbase_numfields
* @param Resource $dbase_identifier dbase identifier
* @return int
*/
function dbase_numfields($dbase_identifier)
{
$dbase_identifier->numfields();
}
/**
* dbase_numrecords
* @param Resource $dbase_identifier dbase identifier
* @return int
*/
function dbase_numrecords($dbase_identifier)
{
return $dbase_identifier->numrecords();
}
/**
* dbase_add_record
* @param Resource $dbase_identifier dbase identifier
* @param array $record record
* @return bool
*/
function dbase_add_record($dbase_identifier, $record)
{
return $dbase_identifier->add_record($record);
}
/**
* dbase_delete_record
* @param Resource $dbase_identifier dbase identifier
* @param int $record_number record number
* @return bool
*/
function dbase_delete_record($dbase_identifier, $record_number)
{
return $dbase_identifier->delete_record($record_number);
}
/**
* dbase_replace_record
* @param Resource $dbase_identifier dbase identifier
* @param array $record record
* @param int $record_number record number
* @return bool
*/
function dbase_replace_record($dbase_identifier, $record, $record_number)
{
return $dbase_identifier->replace_record($record, $record_number);
}
/**
* dbase_get_record
* @param Resource $dbase_identifier dbase identifier
* @param int $record_number record number
* @return bool
*/
function dbase_get_record($dbase_identifier, $record_number)
{
return $dbase_identifier->get_record($record_number);
}
/**
* dbase_get_record_with_names
* @param Resource $dbase_identifier dbase identifier
* @param int $record_number record number
* @return bool
*/
function dbase_get_record_with_names($dbase_identifier, $record_number)
{
return $dbase_identifier->get_record_with_names($record_number);
}
/**
* dbase_pack
* @param Resource $dbase_identifier dbase identifier
* @return bool
*/
function dbase_pack($dbase_identifier)
{
return $dbase_identifier->pack();
}
}

View File

@@ -91,7 +91,6 @@ if ($action == 'update') {
if (!$error) {
foreach ($list as $constname) {
$constvalue = GETPOST($constname, 'alpha');
var_dump($constname);
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}

View File

@@ -186,18 +186,35 @@ if ($action == 'update') {
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$sql.'</pre></span></div>';
$ko++;
} else {
$db->begin();
$sql = '';
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_perentity (fk_product, entity, '".$db->escape($accountancy_field_name)."')";
$sql .= " VALUES (".((int) $productid).", ".((int) $conf->entity).", '".$db->escape($accounting->account_number)."')";
$sql .= " ON DUPLICATE KEY UPDATE ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
$sql_exists = "SELECT rowid FROM " . MAIN_DB_PREFIX . "product_perentity";
$sql_exists .= " WHERE fk_product = " . ((int) $productid) . " AND entity = " . ((int) $conf->entity);
$resql_exists = $db->query($sql_exists);
if (!$resql_exists) {
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$resql_exists.'</pre></span></div>';
$ko++;
} else {
$nb_exists = $db->num_rows($resql_exists);
if ($nb_exists <= 0) {
// insert
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, '" . $db->escape($accountancy_field_name) . "')";
$sql .= " VALUES (" . ((int) $productid) . ", " . ((int) $conf->entity) . ", '" . $db->escape($accounting->account_number) . "')";
} else {
$obj_exists = $db->fetch_object($resql_exists);
// update
$sql = "UPDATE " . MAIN_DB_PREFIX . "product_perentity";
$sql .= " SET " . $accountancy_field_name . " = '" . $db->escape($accounting->account_number) . "'";
$sql .= " WHERE rowid = " . ((int) $obj_exists->rowid);
}
}
} else {
$sql = " UPDATE ".MAIN_DB_PREFIX."product";
$sql .= " SET ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
$sql .= " WHERE rowid = ".((int) $productid);
}
$db->begin();
dol_syslog("/accountancy/admin/productaccount.php sql=".$sql, LOG_DEBUG);
if ($db->query($sql)) {
$ok++;

View File

@@ -429,7 +429,7 @@ if ($action != 'export_csv') {
print '<tr class="oddeven">';
print '<td>'.$accounting_account.'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">'.price($opening_balance).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($opening_balance, 'MT')).'</td>';
}
$urlzoom = '';
@@ -443,9 +443,9 @@ if ($action != 'export_csv') {
}
}
// Debit
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->debit).'</a></td>';
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price(price2num($line->debit, 'MT')).'</a></td>';
// Credit
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->credit).'</a></td>';
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price(price2num($line->credit, 'MT')).'</a></td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
@@ -466,10 +466,10 @@ if ($action != 'export_csv') {
if (!empty($show_subgroup)) {
print '<tr class="liste_total"><td class="right">'.$langs->trans("SubTotal").':</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">'.price($sous_total_opening_balance).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($sous_total_opening_balance, 'MT')).'</td>';
}
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($sous_total_debit, 'MT')).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($sous_total_credit, 'MT')).'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
} else {
@@ -481,10 +481,10 @@ if ($action != 'export_csv') {
print '<tr class="liste_total"><td class="right">'.$langs->trans("AccountBalance").':</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">'.price($total_opening_balance).'</td>';
print '<td class="nowrap right">'.price(price2num($total_opening_balance, 'MT')).'</td>';
}
print '<td class="right nowraponall amount">'.price($total_debit).'</td>';
print '<td class="right nowraponall amount">'.price($total_credit).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($total_debit, 'MT')).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($total_credit, 'MT')).'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
} else {

View File

@@ -637,6 +637,8 @@ if ($action == 'create') {
print_liste_field_titre("Credit", "", "", "", "", 'class="right"');
if (empty($object->date_validation)) {
print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"');
} else {
print_liste_field_titre("");
}
print "</tr>\n";
@@ -683,8 +685,8 @@ if ($action == 'create') {
print '<td class="right nowraponall amount">'.price($line->debit).'</td>';
print '<td class="right nowraponall amount">'.price($line->credit).'</td>';
if (empty($line->date_export) || empty($line->date_validation)) {
print '<td class="center">';
print '<td class="center">';
if (empty($line->date_export) && empty($line->date_validation)) {
print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
print img_edit('', 0, 'class="marginrightonly"');
print '</a> &nbsp;';
@@ -713,7 +715,7 @@ if ($action == 'create') {
setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings');
}
if (empty($object->date_export) || empty($object->date_validation)) {
if (empty($object->date_export) && empty($object->date_validation)) {
if ($action == "" || $action == 'add') {
print '<tr class="oddeven">';
print '<!-- td columns in add mode -->';

View File

@@ -366,42 +366,42 @@ if (empty($reshook)) {
if (!empty($search_date_creation_start)) {
$filter['t.date_creation>='] = $search_date_creation_start;
$tmp = dol_getdate($search_date_creation_start);
$param .= '&date_creation_startmonth='.urlencode($tmp['mon']).'&date_creation_startday='.urlencode($tmp['mday']).'&date_creation_startyear='.urlencode($tmp['year']);
$param .= '&search_date_creation_startmonth='.urlencode($tmp['mon']).'&search_date_creation_startday='.urlencode($tmp['mday']).'&search_date_creation_startyear='.urlencode($tmp['year']);
}
if (!empty($search_date_creation_end)) {
$filter['t.date_creation<='] = $search_date_creation_end;
$tmp = dol_getdate($search_date_creation_end);
$param .= '&date_creation_endmonth='.urlencode($tmp['mon']).'&date_creation_endday='.urlencode($tmp['mday']).'&date_creation_endyear='.urlencode($tmp['year']);
$param .= '&search_date_creation_endmonth='.urlencode($tmp['mon']).'&search_date_creation_endday='.urlencode($tmp['mday']).'&search_date_creation_endyear='.urlencode($tmp['year']);
}
if (!empty($search_date_modification_start)) {
$filter['t.tms>='] = $search_date_modification_start;
$tmp = dol_getdate($search_date_modification_start);
$param .= '&date_modification_startmonth='.urlencode($tmp['mon']).'&date_modification_startday='.urlencode($tmp['mday']).'&date_modification_startyear='.urlencode($tmp['year']);
$param .= '&search_date_modification_startmonth='.urlencode($tmp['mon']).'&search_date_modification_startday='.urlencode($tmp['mday']).'&search_date_modification_startyear='.urlencode($tmp['year']);
}
if (!empty($search_date_modification_end)) {
$filter['t.tms<='] = $search_date_modification_end;
$tmp = dol_getdate($search_date_modification_end);
$param .= '&date_modification_endmonth='.urlencode($tmp['mon']).'&date_modification_endday='.urlencode($tmp['mday']).'&date_modification_endyear='.urlencode($tmp['year']);
$param .= '&search_date_modification_endmonth='.urlencode($tmp['mon']).'&search_date_modification_endday='.urlencode($tmp['mday']).'&search_date_modification_endyear='.urlencode($tmp['year']);
}
if (!empty($search_date_export_start)) {
$filter['t.date_export>='] = $search_date_export_start;
$tmp = dol_getdate($search_date_export_start);
$param .= '&date_export_startmonth='.urlencode($tmp['mon']).'&date_export_startday='.urlencode($tmp['mday']).'&date_export_startyear='.urlencode($tmp['year']);
$param .= '&search_date_export_startmonth='.urlencode($tmp['mon']).'&search_date_export_startday='.urlencode($tmp['mday']).'&search_date_export_startyear='.urlencode($tmp['year']);
}
if (!empty($search_date_export_end)) {
$filter['t.date_export<='] = $search_date_export_end;
$tmp = dol_getdate($search_date_export_end);
$param .= '&date_export_endmonth='.urlencode($tmp['mon']).'&date_export_endday='.urlencode($tmp['mday']).'&date_export_endyear='.urlencode($tmp['year']);
$param .= '&search_date_export_endmonth='.urlencode($tmp['mon']).'&search_date_export_endday='.urlencode($tmp['mday']).'&search_date_export_endyear='.urlencode($tmp['year']);
}
if (!empty($search_date_validation_start)) {
$filter['t.date_validated>='] = $search_date_validation_start;
$tmp = dol_getdate($search_date_validation_start);
$param .= '&date_validation_startmonth='.urlencode($tmp['mon']).'&date_validation_startday='.urlencode($tmp['mday']).'&date_validation_startyear='.urlencode($tmp['year']);
$param .= '&search_date_validation_startmonth='.urlencode($tmp['mon']).'&search_date_validation_startday='.urlencode($tmp['mday']).'&search_date_validation_startyear='.urlencode($tmp['year']);
}
if (!empty($search_date_validation_end)) {
$filter['t.date_validated<='] = $search_date_validation_end;
$tmp = dol_getdate($search_date_validation_end);
$param .= '&date_validation_endmonth='.urlencode($tmp['mon']).'&date_validation_endday='.urlencode($tmp['mday']).'&date_validation_endyear='.urlencode($tmp['year']);
$param .= '&search_date_validation_endmonth='.urlencode($tmp['mon']).'&search_date_validation_endday='.urlencode($tmp['mday']).'&search_date_validation_endyear='.urlencode($tmp['year']);
}
if (!empty($search_debit)) {
$filter['t.debit'] = $search_debit;
@@ -576,7 +576,7 @@ if (!empty($sortfield)) {
// Export into a file with format defined into setup (FEC, CSV, ...)
// Must be after definition of $sql
if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) {
// TODO Replace the fetchAll + ->export later that consume too much memory on large export with the query($sql) and loop on each line to export them.
// TODO Replace the fetchAll to get all ->line followed by call to ->export(). It consumew too much memory on large export. Replace this with the query($sql) and loop on each line to export them.
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1));
if ($result < 0) {
@@ -591,7 +591,7 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
if (!empty($accountancyexport->errors)) {
setEventMessages('', $accountancyexport->errors, 'errors');
} elseif (!$notifiedexportdate || !$notifiedvalidationdate) {
} elseif (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) {
// Specify as export : update field date_export or date_validated
$error = 0;
$db->begin();
@@ -602,17 +602,17 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
$sql .= " SET";
if (!$notifiedexportdate && !$notifiedvalidationdate) {
if (!empty($notifiedexportdate) && !empty($notifiedvalidationdate)) {
$sql .= " date_export = '".$db->idate($now)."'";
$sql .= ", date_validated = '".$db->idate($now)."'";
} elseif (!$notifiedexportdate) {
} elseif (!empty($notifiedexportdate)) {
$sql .= " date_export = '".$db->idate($now)."'";
} elseif (!$notifiedvalidationdate) {
} elseif (!empty($notifiedvalidationdate)) {
$sql .= " date_validated = '".$db->idate($now)."'";
}
$sql .= " WHERE rowid = ".((int) $movement->id);
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
dol_syslog("/accountancy/bookkeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
$result = $db->query($sql);
if (!$result) {
$error++;
@@ -822,7 +822,7 @@ if (!empty($arrayfields['t.piece_num']['checked'])) {
// Code journal
if (!empty($arrayfields['t.code_journal']['checked'])) {
print '<td class="liste_titre center">';
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1);
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'maxwidth150');
print '</td>';
}
// Date document
@@ -865,7 +865,7 @@ if (!empty($arrayfields['t.subledger_account']['checked'])) {
print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', $langs->trans('to'), 'maxwidth250', 'subledgeraccount');
print '</div>';
} else {
print '<input type="text" class="maxwidth100" name="search_accountancy_aux_code" value="'.$search_accountancy_aux_code.'">';
print '<input type="text" class="maxwidth75" name="search_accountancy_aux_code" value="'.$search_accountancy_aux_code.'">';
}
print '</td>';
}
@@ -904,10 +904,10 @@ print $hookmanager->resPrint;
if (!empty($arrayfields['t.date_creation']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_creation_start, 'date_creation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print $form->selectDate($search_date_creation_start, 'search_date_creation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_creation_end, 'date_creation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print $form->selectDate($search_date_creation_end, 'search_date_creation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '</div>';
print '</td>';
}
@@ -915,10 +915,10 @@ if (!empty($arrayfields['t.date_creation']['checked'])) {
if (!empty($arrayfields['t.tms']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_modification_start, 'date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print $form->selectDate($search_date_modification_start, 'search_date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_modification_end, 'date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '</td>';
}
@@ -926,10 +926,10 @@ if (!empty($arrayfields['t.tms']['checked'])) {
if (!empty($arrayfields['t.date_export']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_export_start, 'date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print $form->selectDate($search_date_export_start, 'search_date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_export_end, 'date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print $form->selectDate($search_date_export_end, 'search_date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '</div>';
print '</td>';
}
@@ -937,10 +937,10 @@ if (!empty($arrayfields['t.date_export']['checked'])) {
if (!empty($arrayfields['t.date_validated']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_validation_start, 'date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_validation_end, 'date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '</div>';
print '</td>';
}
@@ -1243,7 +1243,7 @@ while ($i < min($num, $limit)) {
// Action column
print '<td class="nowraponall center">';
if (empty($line->date_export) || empty($line->date_validation)) {
if (empty($line->date_export) && empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->creer) {
print '<a class="editfielda paddingleft marginrightonly" href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_edit() . '</a>';
}

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2016 Neil Orley <neil.orley@oeris.fr>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2020 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
@@ -56,6 +56,14 @@ $search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int');
$search_date_export_endday = GETPOST('search_date_export_endday', 'int');
$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int');
$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int');
$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int');
$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int');
$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int');
$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int');
$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear);
$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear);
$search_accountancy_code = GETPOST("search_accountancy_code");
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
@@ -81,7 +89,7 @@ if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_
}
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -144,6 +152,7 @@ $arrayfields = array(
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
);
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
@@ -221,6 +230,14 @@ if (empty($reshook)) {
$search_date_export_endyear = '';
$search_date_export_endmonth = '';
$search_date_export_endday = '';
$search_date_validation_start = '';
$search_date_validation_end = '';
$search_date_validation_startyear = '';
$search_date_validation_startmonth = '';
$search_date_validation_startday = '';
$search_date_validation_endyear = '';
$search_date_validation_endmonth = '';
$search_date_validation_endday = '';
$search_debit = '';
$search_credit = '';
$search_lettering_code = '';
@@ -301,6 +318,14 @@ if (empty($reshook)) {
$filter['t.date_export<='] = $search_date_export_end;
$param .= '&search_date_export_endmonth='.$search_date_export_endmonth.'&search_date_export_endday='.$search_date_export_endday.'&search_date_export_endyear='.$search_date_export_endyear;
}
if (!empty($search_date_validation_start)) {
$filter['t.date_validated>='] = $search_date_validation_start;
$param .= '&search_date_validation_startmonth='.$search_date_validation_startmonth.'&search_date_validation_startday='.$search_date_validation_startday.'&search_date_validation_startyear='.$search_date_validation_startyear;
}
if (!empty($search_date_validation_end)) {
$filter['t.date_validated<='] = $search_date_validation_end;
$param .= '&search_date_validation_endmonth='.$search_date_validation_endmonth.'&search_date_validation_endday='.$search_date_validation_endday.'&search_date_validation_endyear='.$search_date_validation_endyear;
}
}
if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
@@ -484,10 +509,9 @@ $moreforfilter = '';
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('AccountAccounting').': ';
$moreforfilter .= '<div class="nowrap inline-block">';
$moreforfilter .= $langs->trans('From').' ';
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, 'maxwidth200');
$moreforfilter .= ' '.$langs->trans('to').' ';
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200');
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), array(), 1, 1, 'maxwidth200');
$moreforfilter .= ' ';
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, 'maxwidth200');
$moreforfilter .= '</div>';
$moreforfilter .= '</div>';
@@ -564,6 +588,17 @@ if (!empty($arrayfields['t.date_export']['checked'])) {
print '</div>';
print '</td>';
}
// Date validation
if (!empty($arrayfields['t.date_validated']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '</div>';
print '</td>';
}
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields);
@@ -605,6 +640,9 @@ if (!empty($arrayfields['t.lettering_code']['checked'])) {
if (!empty($arrayfields['t.date_export']['checked'])) {
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
}
if (!empty($arrayfields['t.date_validated']['checked'])) {
print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center ');
}
// Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
@@ -632,20 +670,19 @@ while ($i < min($num, $limit)) {
$accountg = length_accountg($line->numero_compte);
//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_validating']['checked'])) { $colspanend++; }
if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; }
// Is it a break ?
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
$colnumber = 5;
$colnumberend = 7;
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) {
$colnumber--;
}
if (empty($arrayfields['t.date_export']['checked'])) {
$colnumber--;
}
$colspan = $totalarray['nbfield'] - $colnumber;
$colspanend = $totalarray['nbfield'] - $colnumberend;
// Show a subtotal by accounting account
if (isset($displayed_account_number)) {
print '<tr class="liste_total">';
@@ -845,6 +882,14 @@ while ($i < min($num, $limit)) {
}
}
// Validated operation date
if (!empty($arrayfields['t.date_validated']['checked'])) {
print '<td class="center">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
@@ -852,12 +897,14 @@ while ($i < min($num, $limit)) {
// Action column
print '<td class="nowraponall center">';
if (empty($line->date_export)) {
if (empty($line->date_export) && empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->creer) {
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_edit().'</a>';
print '<a class="editfielda paddingleft marginrightonly" href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_edit() . '</a>';
}
}
if (empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->supprimer) {
print ' &nbsp; <a class="paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
print '<a class="reposition paddingleft marginrightonly" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
}
}
print '</td>';
@@ -874,9 +921,7 @@ while ($i < min($num, $limit)) {
$i++;
}
if ($num > 0) {
$colspan = $totalarray['nbfield'] - $colnumber;
$colspanend = $totalarray['nbfield'] - $colnumberend;
if ($num > 0 && $colspan > 0) {
print '<tr class="liste_total">';
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.$accountg.':</td>';
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';

View File

@@ -2,8 +2,8 @@
/* Copyright (C) 2016 Neil Orley <neil.orley@oeris.fr>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2020 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.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
@@ -46,7 +46,7 @@ $search_date_endyear = GETPOST('search_date_endyear', 'int');
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
$search_date_endday = GETPOST('search_date_endday', 'int');
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
$search_date_end = dol_mktime(0, 0, 0, $search_date_endmonth, $search_date_endday, $search_date_endyear);
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int');
$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int');
@@ -55,7 +55,15 @@ $search_date_export_endyear = GETPOST('search_date_export_endyear', 'int');
$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int');
$search_date_export_endday = GETPOST('search_date_export_endday', 'int');
$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
$search_date_export_end = dol_mktime(0, 0, 0, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int');
$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int');
$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int');
$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int');
$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int');
$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int');
$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear);
$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear);
$search_accountancy_code = GETPOST("search_accountancy_code");
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
@@ -144,6 +152,7 @@ $arrayfields = array(
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
);
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
@@ -221,6 +230,14 @@ if (empty($reshook)) {
$search_date_export_endyear = '';
$search_date_export_endmonth = '';
$search_date_export_endday = '';
$search_date_validation_start = '';
$search_date_validation_end = '';
$search_date_validation_startyear = '';
$search_date_validation_startmonth = '';
$search_date_validation_startday = '';
$search_date_validation_endyear = '';
$search_date_validation_endmonth = '';
$search_date_validation_endday = '';
$search_debit = '';
$search_credit = '';
$search_lettering_code = '';
@@ -301,6 +318,14 @@ if (empty($reshook)) {
$filter['t.date_export<='] = $search_date_export_end;
$param .= '&search_date_export_endmonth='.$search_date_export_endmonth.'&search_date_export_endday='.$search_date_export_endday.'&search_date_export_endyear='.$search_date_export_endyear;
}
if (!empty($search_date_validation_start)) {
$filter['t.date_validated>='] = $search_date_validation_start;
$param .= '&search_date_validation_startmonth='.$search_date_validation_startmonth.'&search_date_validation_startday='.$search_date_validation_startday.'&search_date_validation_startyear='.$search_date_validation_startyear;
}
if (!empty($search_date_validation_end)) {
$filter['t.date_validated<='] = $search_date_validation_end;
$param .= '&search_date_validation_endmonth='.$search_date_validation_endmonth.'&search_date_validation_endday='.$search_date_validation_endday.'&search_date_validation_endyear='.$search_date_validation_endyear;
}
}
if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
@@ -373,7 +398,6 @@ $title_page = $langs->trans("Operations").' - '.$langs->trans("VueByAccountAccou
llxHeader('', $title_page);
// List
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
@@ -448,7 +472,6 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
@@ -488,10 +511,9 @@ $moreforfilter = '';
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('AccountAccounting').': ';
$moreforfilter .= '<div class="nowrap inline-block">';
$moreforfilter .= $langs->trans('From').' ';
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', 1, 'maxwidth200');
$moreforfilter .= ' '.$langs->trans('to').' ';
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', 1, 'maxwidth200');
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), 'maxwidth200');
$moreforfilter .= ' ';
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), 'maxwidth200');
$moreforfilter .= '</div>';
$moreforfilter .= '</div>';
@@ -568,6 +590,17 @@ if (!empty($arrayfields['t.date_export']['checked'])) {
print '</div>';
print '</td>';
}
// Date validation
if (!empty($arrayfields['t.date_validated']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '</div>';
print '</td>';
}
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields);
@@ -609,6 +642,9 @@ if (!empty($arrayfields['t.lettering_code']['checked'])) {
if (!empty($arrayfields['t.date_export']['checked'])) {
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
}
if (!empty($arrayfields['t.date_validated']['checked'])) {
print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center ');
}
// Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
@@ -636,21 +672,19 @@ while ($i < min($num, $limit)) {
$accountg = length_accounta($line->subledger_account);
//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_validating']['checked'])) { $colspanend++; }
if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; }
// Is it a break ?
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
$colnumber = 5;
$colnumberend = 7;
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) {
$colnumber--;
}
if (empty($arrayfields['t.date_export']['checked'])) {
$colnumber--;
}
$colspan = $totalarray['nbfield'] - $colnumber;
$colspanend = $totalarray['nbfield'] - $colnumberend;
// Show a subtotal by accounting account
if (isset($displayed_account_number)) {
print '<tr class="liste_total">';
@@ -859,6 +893,14 @@ while ($i < min($num, $limit)) {
}
}
// Validated operation date
if (!empty($arrayfields['t.date_validated']['checked'])) {
print '<td class="center">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
@@ -866,12 +908,14 @@ while ($i < min($num, $limit)) {
// Action column
print '<td class="nowraponall center">';
if (empty($line->date_export)) {
if (empty($line->date_export) && empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->creer) {
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_edit().'</a>';
print '<a class="editfielda paddingleft marginrightonly" href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_edit() . '</a>';
}
}
if (empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->supprimer) {
print ' &nbsp; <a class="paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
print '<a class="reposition paddingleft marginrightonly" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
}
}
print '</td>';
@@ -888,9 +932,7 @@ while ($i < min($num, $limit)) {
$i++;
}
if ($num > 0) {
$colspan = $totalarray['nbfield'] - $colnumber;
$colspanend = $totalarray['nbfield'] - $colnumberend;
if ($num > 0 && $colspan > 0) {
print '<tr class="liste_total">';
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.$accountg.':</td>';
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';

View File

@@ -5,7 +5,7 @@
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
* Copyright (C) 2016-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2017 Elarifr. Ari Elbaz <github@accedinfo.com>
* Copyright (C) 2017-2019 Frédéric France <frederic.france@netlogic.fr>
@@ -119,8 +119,8 @@ class AccountancyExport
self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'),
self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans('Modelcsv_LDCompta10'),
self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinum_v3'),
self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinumv3'),
self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinumv5'),
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
self::$EXPORT_TYPE_FEC2 => $langs->trans('Modelcsv_FEC2'),
);
@@ -466,38 +466,47 @@ class AccountancyExport
}
/**
* Export format : CIEL
* Export format : CIEL (Format XIMPORT)
* Format since 2003 compatible CIEL version > 2002 / Sage50
* Last review for this format : 2021-09-13 Alexandre Spangaro (aspangaro@open-dsi.fr)
*
* Help : https://sage50c.online-help.sage.fr/aide-technique/
* In sage software | Use menu : "Exchange" > "Importing entries..."
*
* If you want to force filename to "XIMPORT.TXT" for automatically import file present in a directory :
* use constant ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME
*
* @param array $TData data
* @return void
*/
public function exportCiel(&$TData)
{
global $conf;
$end_line = "\r\n";
$i = 1;
$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be yyyymmdd
foreach ($TData as $data) {
$code_compta = $data->numero_compte;
$code_compta = length_accountg($data->numero_compte);
if (!empty($data->subledger_account)) {
$code_compta = $data->subledger_account;
$code_compta = length_accounta($data->subledger_account);
}
$date_document = dol_print_date($data->doc_date, '%Y%m%d');
$date_echeance = dol_print_date($data->date_lim_reglement, '%Y%m%d');
$Tab = array();
$Tab['num_ecriture'] = str_pad($i, 5);
$Tab['code_journal'] = str_pad($data->code_journal, 2);
$Tab['date_ecriture'] = $date_ecriture;
$Tab['date_ope'] = dol_print_date($data->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
$Tab['num_piece'] = str_pad(self::trunc($data->piece_num, 12), 12);
$Tab['num_ecriture'] = str_pad($data->piece_num, 5);
$Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
$Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT);
$Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT);
$Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12);
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 11), 11);
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25);
$Tab['montant'] = str_pad(abs($data->debit - $data->credit), 13, ' ', STR_PAD_LEFT);
$Tab['montant'] = str_pad(price2fec(abs($data->debit - $data->credit)), 13, ' ', STR_PAD_LEFT);
$Tab['type_montant'] = str_pad($data->sens, 1);
$Tab['vide'] = str_repeat(' ', 18);
$Tab['vide'] = str_repeat(' ', 18); // Analytical accounting - Not managed in Dolibarr
$Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34);
$Tab['end'] = 'O2003';
$Tab['end'] = 'O2003'; // 0 = EUR | 2003 = Format Ciel
$Tab['end_line'] = $end_line;
@@ -507,14 +516,19 @@ class AccountancyExport
}
/**
* Export format : Quadratus
* Export format : Quadratus (Format ASCII)
* Format since 2015 compatible QuadraCOMPTA
* Last review for this format : 2021/09/13 Alexandre Spangaro (aspangaro@open-dsi.fr)
*
* Help : https://docplayer.fr/20769649-Fichier-d-entree-ascii-dans-quadracompta.html
* In QuadraCompta | Use menu : "Outils" > "Suivi des dossiers" > "Import ASCII(Compta)"
*
* @param array $TData data
* @return void
*/
public function exportQuadratus(&$TData)
{
global $conf;
global $conf, $db;
$end_line = "\r\n";
@@ -527,6 +541,44 @@ class AccountancyExport
$code_compta = $data->subledger_account;
}
$Tab = array();
if (!empty($data->subledger_account)) {
$Tab['type_ligne'] = 'C';
$Tab['num_compte'] = str_pad(self::trunc($data->subledger_account, 8), 8);
$Tab['lib_compte'] = str_pad(self::trunc($data->subledger_label, 30), 30);
if ($data->doc_type == 'customer_invoice') {
$Tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc($data->subledger_label, 6), 6));
$Tab['filler'] = str_repeat(' ', 52);
$Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, 8), 8);
} elseif ($data->doc_type == 'supplier_invoice') {
$Tab['lib_alpha'] = strtoupper(str_pad('F'.self::trunc($data->subledger_label, 6), 6));
$Tab['filler'] = str_repeat(' ', 52);
$Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, 8), 8);
} else {
$Tab['filler'] = str_repeat(' ', 59);
$Tab['coll_compte'] = str_pad(' ', 8);
}
$Tab['filler2'] = str_repeat(' ', 110);
$Tab['Maj'] = 2; // Partial update (alpha key, label, address, collectif, RIB)
if ($data->doc_type == 'customer_invoice') {
$Tab['type_compte'] = 'C';
} elseif ($data->doc_type == 'supplier_invoice') {
$Tab['coll_compte'] = 'F';
} else {
$Tab['coll_compte'] = 'G';
}
$Tab['filler3'] = str_repeat(' ', 235);
$Tab['end_line'] = $end_line;
print implode($Tab);
}
$Tab = array();
$Tab['type_ligne'] = 'M';
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 8), 8);
@@ -1287,7 +1339,9 @@ class AccountancyExport
/**
* Export format : LD Compta version 10 & higher
* http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf
* Last review for this format : 08-15-2021 Alexandre Spangaro (aspangaro@open-dsi.fr)
*
* Help : http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf
*
* @param array $objectLines data
*
@@ -1450,14 +1504,14 @@ class AccountancyExport
print $date_lim_reglement.$separator;
// CNPI
if ($line->doc_type == 'supplier_invoice') {
if (($line->debit - $line->credit) > 0) {
if (($line->amount) < 0) { // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign.
$nature_piece = 'AF';
} else {
$nature_piece = 'FF';
}
} elseif ($line->doc_type == 'customer_invoice') {
if (($line->debit - $line->credit) < 0) {
$nature_piece = 'AC';
if (($line->amount) < 0) {
$nature_piece = 'AC'; // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign.
} else {
$nature_piece = 'FC';
}

View File

@@ -297,7 +297,7 @@ class BookKeeping extends CommonObject
$sql .= " AND fk_doc = ".((int) $this->fk_doc);
if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) {
// DO NOT USE THIS IN PRODUCTION. This will generate a lot of trouble into reports and will corrupt database (by generating duplicate entries.
$sql .= " AND fk_docdet = ".$this->fk_docdet; // This field can be 0 if record is for several lines
$sql .= " AND fk_docdet = ".((int) $this->fk_docdet); // This field can be 0 if record is for several lines
}
$sql .= " AND numero_compte = '".$this->db->escape($this->numero_compte)."'";
$sql .= " AND label_operation = '".$this->db->escape($this->label_operation)."'";
@@ -729,7 +729,10 @@ class BookKeeping extends CommonObject
$sql .= " t.journal_label,";
$sql .= " t.piece_num,";
$sql .= " t.date_creation,";
$sql .= " t.date_export,";
// In llx_accounting_bookkeeping_tmp, field date_export doesn't exist
if ($mode != "_tmp") {
$sql .= " t.date_export,";
}
$sql .= " t.date_validated as date_validation";
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t';
$sql .= ' WHERE 1 = 1';
@@ -1024,6 +1027,12 @@ class BookKeeping extends CommonObject
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.credit' || $key == 't.debit') {
$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);
} else {
$sqlwhere[] = natural_search("t.code_journal", $value, 3, 1);
}
} else {
$sqlwhere[] = natural_search($key, $value, 0, 1);
}
@@ -1506,6 +1515,7 @@ class BookKeeping extends CommonObject
$sql = "DELETE";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql .= " WHERE piece_num = ".(int) $piecenum;
$sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion
$sql .= " AND entity IN (".getEntity('accountancy').")";
$resql = $this->db->query($sql);
@@ -1621,7 +1631,11 @@ class BookKeeping extends CommonObject
global $conf;
$sql = "SELECT piece_num, doc_date,code_journal, journal_label, doc_ref, doc_type,";
$sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation";
$sql .= " date_creation, tms as date_modification, date_validated as date_validation";
// In llx_accounting_bookkeeping_tmp, field date_export doesn't exist
if ($mode != "_tmp") {
$sql .= ", date_export";
}
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
$sql .= " WHERE piece_num = ".$piecenum;
$sql .= " AND entity IN (".getEntity('accountancy').")";
@@ -1698,7 +1712,11 @@ class BookKeeping extends CommonObject
$sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,";
$sql .= " numero_compte, label_compte, label_operation, debit, credit,";
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num,";
$sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation";
$sql .= " date_creation, tms as date_modification, date_validated as date_validation";
// In llx_accounting_bookkeeping_tmp, field date_export doesn't exist
if ($mode != "_tmp") {
$sql .= ", date_export";
}
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
$sql .= " WHERE piece_num = ".$piecenum;
$sql .= " AND entity IN (".getEntity('accountancy').")";

View File

@@ -265,8 +265,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '',
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td class="left">'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -314,7 +314,7 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind') {
print $langs->trans("Unknown");
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else {
print length_accountg($row[0]);
}
@@ -349,8 +349,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '',
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td class="left">'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -436,7 +436,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("TotalVente").'</td>';
print '<tr class="liste_titre"><td lass="left">'.$langs->trans("TotalVente").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -497,7 +497,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print "<br>\n";
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="400">'.$langs->trans("TotalMarge").'</td>';
print '<tr class="liste_titre"><td>'.$langs->trans("TotalMarge").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {

View File

@@ -369,9 +369,9 @@ if ($result) {
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneCustomer").'</span><br>';
print '<br><div class="inline-block divButAction">'.$langs->trans("ChangeAccount").'<br>';
print '<br><div class="inline-block divButAction paddingbottom">'.$langs->trans("ChangeAccount").' ';
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
$moreforfilter = '';

View File

@@ -154,8 +154,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '',
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td class="left">'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -197,7 +197,7 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind') {
print $langs->trans("Unknown");
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else {
print length_accountg($row[0]);
}
@@ -233,8 +233,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '',
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td class="left">'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -276,7 +276,7 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind') {
print $langs->trans("Unknown");
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else {
print length_accountg($row[0]);
}
@@ -314,7 +314,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("Total").'</td>';
print '<tr class="liste_titre"><td class="left">'.$langs->trans("Total").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {

View File

@@ -49,7 +49,7 @@ if (empty($user->rights->accounting->mouvements->lire)) {
if (empty($conf->comptabilite->enabled) && empty($conf->accounting->enabled) && empty($conf->asset->enabled) && empty($conf->intracommreport->enabled)) {
accessforbidden();
}
if (empty($user->rights->compta->resultat->lire) && empty($user->rights->accounting->mouvements->lire) && empty($user->rights->asset->read) && empty($user->rights->intracommreport->read)) {
if (empty($user->rights->compta->resultat->lire) && empty($user->rights->accounting->comptarapport->lire) && empty($user->rights->accounting->mouvements->lire) && empty($user->rights->asset->read) && empty($user->rights->intracommreport->read)) {
accessforbidden();
}

View File

@@ -177,7 +177,7 @@ $accountingjournalstatic->fetch($id_journal);
$journal = $accountingjournalstatic->code;
$journal_label = $accountingjournalstatic->label;
//print $sql;
dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
@@ -252,6 +252,7 @@ if ($result) {
);
// Set accountancy code for user
// $obj->accountancy_code is the accountancy_code of table u=user but it is defined only if a link with type 'user' exists)
$compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : '');
$tabuser[$obj->rowid] = array(
@@ -277,7 +278,7 @@ if ($result) {
$tabpay[$obj->rowid]["lib"] = dol_trunc($obj->label, 60);
}
// Load of url links to the line into llx_bank
// Load of url links to the line into llx_bank (so load llx_bank_url)
$links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> )
// By default
@@ -287,7 +288,7 @@ if ($result) {
// get_url may return -1 which is not traversable
if (is_array($links) && count($links) > 0) {
// Now loop on each link of record in bank.
// Now loop on each link of record in bank (code similar to bankentries_list.php)
foreach ($links as $key => $val) {
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) {
// So we excluded 'company' and 'user' here. We want only payment lines
@@ -302,6 +303,7 @@ if ($result) {
}
}
// Special case to ask later to add more request to get information for old links without company link.
if ($links[$key]['type'] == 'withdraw') {
$tabmoreinfo[$obj->rowid]['withdraw'] = 1;
}
@@ -401,6 +403,44 @@ if ($result) {
$paymentsalstatic->label = $links[$key]['label'];
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentsalstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id;
// This part of code is no more required. it is here to solve case where a link were missing (ith v14.0.0) and keep writing in accountancy complete.
// Note: A better way to fix this is to delete payement of salary and recreate it, or to fix the bookkeeping table manually after.
if (!empty($conf->global->ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USEr_ON_SALARY_BANK_PAYMENT)) {
$tmpsalary = new Salary($db);
$tmpsalary->fetch($paymentsalstatic->id);
$tmpsalary->fetch_user($tmpsalary->fk_user);
$userstatic->id = $tmpsalary->user->id;
$userstatic->name = $tmpsalary->user->name;
$userstatic->email = $tmpsalary->user->email;
$userstatic->firstname = $tmpsalary->user->firstname;
$userstatic->lastname = $tmpsalary->user->lastname;
$userstatic->statut = $tmpsalary->user->statut;
$userstatic->accountancy_code = $tmpsalary->user->accountancy_code;
if ($userstatic->id > 0) {
$tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0);
} else {
$tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen
}
if (empty($obj->typeop_user)) { // Add test to avoid to add amount twice if a link already exists also on user.
$compta_user = $userstatic->accountancy_code;
if ($compta_user) {
$tabtp[$obj->rowid][$compta_user] += $obj->amount;
$tabuser[$obj->rowid] = array(
'id' => $userstatic->id,
'name' => dolGetFirstLastname($userstatic->firstname, $userstatic->lastname),
'lastname' => $userstatic->lastname,
'firstname' => $userstatic->firstname,
'email' => $userstatic->email,
'accountancy_code' => $compta_user,
'status' => $userstatic->statut
);
}
}
}
} elseif ($links[$key]['type'] == 'payment_expensereport') {
$paymentexpensereportstatic->id = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= $paymentexpensereportstatic->getNomUrl(2);
@@ -468,7 +508,7 @@ if ($result) {
}
}
// If no links were found to know the amount on thirdparty, we init it to account 'NotDefined'.
// If no links were found to know the amount on thirdparty/user, we init it to account 'NotDefined'.
if (empty($tabtp[$obj->rowid])) {
$tabtp[$obj->rowid]['NotDefined'] = $tabbq[$obj->rowid][$compta_bank];
}
@@ -1162,9 +1202,9 @@ if (empty($action) || $action == 'view') {
if ($tabtype[$key] == 'unknown') {
// We will accept writing, but into a waiting account
if (empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) || $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE == '-1') {
print '<span class="error">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>';
print '<span class="error small">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>';
} else {
print '<span class="warning">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
print '<span class="warning small">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
}
} else {
// We will refuse writing
@@ -1187,7 +1227,7 @@ if (empty($action) || $action == 'view') {
if ($tabtype[$key] == 'member') {
$errorstring = 'MainAccountForSubscriptionPaymentNotDefined';
}
print '<span class="error">'.$langs->trans($errorstring).'</span>';
print '<span class="error small">'.$langs->trans($errorstring).'</span>';
}
} else {
print $accounttoshow;
@@ -1196,7 +1236,7 @@ if (empty($action) || $action == 'view') {
// Subledger account
print "<td>";
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payment with subledger
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payments that uses a subledger
$accounttoshowsubledger = length_accounta($k);
if ($accounttoshow != $accounttoshowsubledger) {
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') {
@@ -1205,14 +1245,14 @@ if (empty($action) || $action == 'view') {
var_dump($tabbq[$key]);*/
//print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
if (!empty($tabcompany[$key]['code_compta'])) {
if (in_array($tabtype[$key], array('payment_various'))) {
if (in_array($tabtype[$key], array('payment_various', 'payment_salary'))) {
// For such case, if subledger is not defined, we won't use subledger accounts.
print '<span class="warning">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>';
print '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>';
} else {
print '<span class="warning">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'</span>';
print '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'</span>';
}
} else {
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>';
print '<span class="error small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>';
}
} else {
print $accounttoshowsubledger;
@@ -1220,10 +1260,15 @@ if (empty($action) || $action == 'view') {
}
}
print "</td>";
print "<td>".$reflabel."</td>";
print '<td class="center">'.$val["type_payment"]."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print "</tr>";
}
}

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
@@ -610,7 +610,7 @@ if (empty($action) || $action == 'view') {
$userstatic->id = $tabuser[$key]['id'];
$userstatic->name = $tabuser[$key]['name'];
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$accountingaccount->label."</td>";
print '<td class="right nowraponall amount amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>";
}
@@ -627,7 +627,7 @@ if (empty($action) || $action == 'view') {
print "<td>".$expensereportstatic->getNomUrl(1)."</td>";
// Account
print "<td>";
$accountoshow = length_accounta($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
$accountoshow = length_accountg($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
print '<span class="error">'.$langs->trans("MainAccountForUsersNotDefined").'</span>';
} else {

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
@@ -648,7 +648,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"'.$val["refsologest"].'"'.$sep;
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER.'"'.$sep;
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.$langs->trans("Thirdparty").'"'.$sep;
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("Thirdparty").'"'.$sep;
@@ -717,9 +717,9 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"'.$date.'"'.$sep;
print '"'.$val["refsologest"].'"'.$sep;
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '"'.$langs->trans("Thirdparty").'"'.$sep;
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("VAT").' NPR"'.$sep;
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
@@ -894,7 +894,7 @@ if (empty($action) || $action == 'view') {
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
// Account
print "<td>";
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
print '<span class="error">'.$langs->trans("MainAccountForSuppliersNotDefined").'</span>';
} else {

View File

@@ -609,7 +609,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"'.$val["ref"].'"'.$sep;
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.$conf->global->ACCOUNTING_ACCOUNT_CUSTOMER.'"'.$sep;
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.$langs->trans("Thirdparty").'"'.$sep;
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("Thirdparty").'"'.$sep;
@@ -834,7 +834,7 @@ if (empty($action) || $action == 'view') {
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
// Account
print "<td>";
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
print '<span class="error">'.$langs->trans("MainAccountForCustomersNotDefined").'</span>';
} else {

View File

@@ -265,8 +265,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '',
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td class="left">'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -309,7 +309,7 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind') {
print $langs->trans("Unknown");
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else {
print length_accountg($row[0]);
}
@@ -344,8 +344,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '',
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td class="left">'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -425,7 +425,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("Total").'</td>';
print '<tr class="liste_titre"><td class="left">'.$langs->trans("Total").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {

View File

@@ -369,9 +369,9 @@ if ($result) {
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneSupplier").'</span><br>';
print '<br><div class="inline-block divButAction">'.$langs->trans("ChangeAccount").'<br>';
print '<br><div class="inline-block divButAction paddingbottom">'.$langs->trans("ChangeAccount").' ';
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
$moreforfilter = '';

View File

@@ -620,10 +620,12 @@ if ($result) {
}
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
if (!empty($objp->company_code_buy)) {
$objp->code_buy_t = $objp->company_code_buy;
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
$suggestedaccountingaccountfor = '';
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
if (!empty($objp->company_code_buy)) {
$objp->code_buy_t = $objp->company_code_buy;
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
$suggestedaccountingaccountfor = '';
}
}
if (!empty($objp->code_buy_p)) {
@@ -724,11 +726,13 @@ if ($result) {
$s .= $langs->trans("NotDefined");
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
}
print '<br>';
$s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
$shelp = '';
$s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : '<span style="'.$code_buy_t_notset.'">'.$langs->trans("NotDefined").'</span>');
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
print '<br>';
$s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
$shelp = '';
$s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : '<span style="'.$code_buy_t_notset.'">'.$langs->trans("NotDefined").'</span>');
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
}
print '</td>';
// Suggested accounting account

View File

@@ -16,6 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// $formatexportset ùust be defined
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) {
print "Error, template page can't be called as URL";
@@ -36,10 +38,12 @@ header('Content-Type: text/csv');
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
$accountancyexport = new AccountancyExport($db);
if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_FEC && $type_export == "general_ledger") { // Specific filename for FEC model export into the general ledger
// Specific filename for FEC model export into the general ledger
if (($accountancyexport->getFormatCode($formatexportset) == 'fec' || $accountancyexport->getFormatCode($formatexportset) == 'fec2')
&& $type_export == "general_ledger") {
// FEC format is defined here: https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle
if (empty($search_date_end)) {
// TODO Get the max date into bookeeping table
// TODO Get the max date into bookkeeping table
$search_date_end = dol_now();
}
$datetouseforfilename = $search_date_end;
@@ -56,6 +60,8 @@ if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$
$endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard');
$completefilename = $siren."FEC".$endaccountingperiod.".txt";
} elseif ($accountancyexport->getFormatCode($formatexportset) == 'ciel' && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
$completefilename = "XIMPORT.TXT";
} else {
$completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format;
}

View File

@@ -25,7 +25,7 @@
*/
/**
* \file htdocs/adherents/admin/adherent.php
* \file htdocs/adherents/admin/member.php
* \ingroup member
* \brief Page to setup the module Foundation
*/
@@ -205,16 +205,16 @@ print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
// Login/Pass required for members
print '<tr class="oddeven"><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED) ? 0 : 1), 1);
print "</td></tr>\n";
// Mail required for members
print '<tr class="oddeven"><td>'.$langs->trans("AdherentMailRequired").'</td><td>';
print $form->selectyesno('ADHERENT_MAIL_REQUIRED', (!empty($conf->global->ADHERENT_MAIL_REQUIRED) ? $conf->global->ADHERENT_MAIL_REQUIRED : 0), 1);
print "</td></tr>\n";
// Login/Pass required for members
print '<tr class="oddeven"><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED) ? 0 : 1), 1);
print "</td></tr>\n";
// Send mail information is on by default
print '<tr class="oddeven"><td>'.$langs->trans("MemberSendInformationByMailByDefault").'</td><td>';
print $form->selectyesno('ADHERENT_DEFAULT_SENDINFOBYMAIL', (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ? $conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL : 0), 1);
@@ -225,6 +225,13 @@ print '<tr class="oddeven"><td>'.$langs->trans("MemberCreateAnExternalUserForSub
print $form->selectyesno('ADHERENT_CREATE_EXTERNAL_USER_LOGIN', (!empty($conf->global->ADHERENT_CREATE_EXTERNAL_USER_LOGIN) ? $conf->global->ADHERENT_CREATE_EXTERNAL_USER_LOGIN : 0), 1);
print "</td></tr>\n";
// Allow members to change type on renewal forms
/* To test during next beta
print '<tr class="oddeven"><td>'.$langs->trans("MemberAllowchangeOfType").'</td><td>';
print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE) ? 0 : 1), 1);
print "</td></tr>\n";
*/
// Insert subscription into bank account
print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
$arraychoices = array('0'=>$langs->trans("None"));

View File

@@ -56,7 +56,7 @@ if ($action == 'setMEMBER_ENABLE_PUBLIC') {
if ($action == 'update') {
$public = GETPOST('MEMBER_ENABLE_PUBLIC');
$amount = GETPOST('MEMBER_NEWFORM_AMOUNT');
$amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2);
$editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT');
$payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE');
$forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int');
@@ -205,7 +205,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print '<tr class="oddeven" id="tramount"><td>';
print $langs->trans("DefaultAmount");
print '</td><td class="right">';
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">';
print '<input type="text" class="right width75" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">';
print "</td></tr>\n";
// Can edit

View File

@@ -645,7 +645,7 @@ if (empty($reshook)) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
@@ -716,7 +716,7 @@ if (empty($reshook)) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
@@ -787,7 +787,7 @@ if (empty($reshook)) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_EXCLUSION;
@@ -1506,7 +1506,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
@@ -1821,14 +1821,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$company = new Societe($db);
$result = $company->fetch($object->socid);
print $company->getNomUrl(1);
// Show link to invoices
$tmparray = $company->getOutstandingBills('customer');
if (!empty($tmparray['refs'])) {
print ' - '.img_picto($langs->trans("Invoices"), 'bill', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans("Invoices").' ('.count($tmparray['refs']).')';
// TODO Add alert if warning on at least one invoice late
print '</a>';
}
} else {
print $langs->trans("NoThirdPartyAssociatedToMember");
print '<span class="opacitymedium">'.$langs->trans("NoThirdPartyAssociatedToMember").'</span>';
}
}
print '</td></tr>';
}
// Login Dolibarr
// Login Dolibarr - Link to user
print '<tr><td>';
$editenable = $user->rights->adherent->creer && $user->rights->user->user->creer;
print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable);
@@ -1846,7 +1854,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
print '</td></tr>';
//VCard
// VCard
print '<tr><td>';
print $langs->trans("VCard").'</td><td colspan="3">';
print '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'">';
@@ -1941,7 +1949,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (!empty($conf->societe->enabled) && !$object->socid) {
if ($user->rights->societe->creer) {
if (Adherent::STATUS_DRAFT != $object->statut) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";;
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrThirdPartyDesc")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";;
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";
}
@@ -1954,7 +1962,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (!$user->socid && !$object->user_id) {
if ($user->rights->user->user->creer) {
if (Adherent::STATUS_DRAFT != $object->statut) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_user" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrLoginDesc")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
}
@@ -2002,8 +2010,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Generated documents
$filename = dol_sanitizeFileName($object->ref);
//$filename = 'tmp_cards.php';
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 0, $object, 'member');
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member');
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
$genallowed = $user->rights->adherent->lire;
$delallowed = $user->rights->adherent->creer;

View File

@@ -1900,8 +1900,8 @@ class Adherent extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
$sql .= " statut = ".self::STATUS_VALIDATED;
$sql .= ", datevalid = '".$this->db->idate($now)."'";
$sql .= ", fk_user_valid=".$user->id;
$sql .= " WHERE rowid = ".$this->id;
$sql .= ", fk_user_valid=".((int) $user->id);
$sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::validate", LOG_DEBUG);
$result = $this->db->query($sql);
@@ -2185,6 +2185,9 @@ class Adherent extends CommonObject
if (!empty($this->ref)) {
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
}
if (!empty($this->login)) {
$label .= '<br><b>'.$langs->trans('Login').':</b> '.$this->login;
}
if (!empty($this->firstname) || !empty($this->lastname)) {
$label .= '<br><b>'.$langs->trans('Name').':</b> '.$this->getFullName($langs);
}

View File

@@ -70,7 +70,7 @@ class AdherentStats extends Stats
$this->where .= " m.statut != -1";
$this->where .= " AND p.fk_adherent = m.rowid AND m.entity IN (".getEntity('adherent').")";
//if (!$user->rights->societe->client->voir && !$user->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
//if (!$user->rights->societe->client->voir && !$user->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .((int) $user->id);
if ($this->memberid) {
$this->where .= " AND m.rowid = ".((int) $this->memberid);
}

View File

@@ -175,7 +175,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
$parameters = array('socid'=>$socid);
$parameters = array('socid'=>isset($socid) ? $socid : null);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -317,6 +317,7 @@ $sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.p
$sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
$sql .= " d.note_private, d.note_public,";
$sql .= " s.nom,";
$sql .= " ".$db->ifsql("d.societe IS NULL", "s.nom", "d.societe")." as companyname,";
$sql .= " t.libelle as type, t.subscription,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
// Add fields from extrafields
@@ -491,7 +492,7 @@ if (GETPOSTISSET("search_status")) {
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'outofdate') {
$titre = $langs->trans("MembersListNotUpToDate");
}
if ($search_status == Adherent::STATUS_RESILIATED) {
if ((string) $search_status == (string) Adherent::STATUS_RESILIATED) { // The cast to string is required to have test false when search_status is ''
$titre = $langs->trans("MembersListResiliated");
}
if ($search_status == Adherent::STATUS_EXCLUDED) {
@@ -832,7 +833,7 @@ if (!empty($arrayfields['d.gender']['checked'])) {
print_liste_field_titre($arrayfields['d.gender']['label'], $_SERVER['PHP_SELF'], 'd.gender', $param, "", "", $sortfield, $sortorder);
}
if (!empty($arrayfields['d.company']['checked'])) {
print_liste_field_titre($arrayfields['d.company']['label'], $_SERVER["PHP_SELF"], 'd.societe', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre($arrayfields['d.company']['label'], $_SERVER["PHP_SELF"], 'companyname', '', $param, '', $sortfield, $sortorder);
}
if (!empty($arrayfields['d.login']['checked'])) {
print_liste_field_titre($arrayfields['d.login']['label'], $_SERVER["PHP_SELF"], 'd.login', '', $param, '', $sortfield, $sortorder);
@@ -905,6 +906,7 @@ while ($i < min($num, $limit)) {
$memberstatic->id = $obj->rowid;
$memberstatic->ref = $obj->ref;
$memberstatic->civility_id = $obj->civility;
$memberstatic->login = $obj->login;
$memberstatic->lastname = $obj->lastname;
$memberstatic->firstname = $obj->firstname;
$memberstatic->gender = $obj->gender;
@@ -919,9 +921,13 @@ while ($i < min($num, $limit)) {
if (!empty($obj->fk_soc)) {
$memberstatic->fetch_thirdparty();
$companyname = $memberstatic->thirdparty->name;
if ($memberstatic->thirdparty->id > 0) {
$companyname = $memberstatic->thirdparty->name;
$companynametoshow = $memberstatic->thirdparty->getNomUrl(1);
}
} else {
$companyname = $obj->company;
$companynametoshow = $obj->company;
}
$memberstatic->company = $companyname;
@@ -955,7 +961,8 @@ while ($i < min($num, $limit)) {
// Firstname
if (!empty($arrayfields['d.firstname']['checked'])) {
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">';
print $obj->firstname;
print $memberstatic->getNomUrl(0, 0, 'card', 'fistname');
//print $obj->firstname;
print "</td>\n";
if (!$i) {
$totalarray['nbfield']++;
@@ -964,7 +971,8 @@ while ($i < min($num, $limit)) {
// Lastname
if (!empty($arrayfields['d.lastname']['checked'])) {
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).'">';
print $obj->lastname;
print $memberstatic->getNomUrl(0, 0, 'card', 'lastname');
//print $obj->lastname;
print "</td>\n";
if (!$i) {
$totalarray['nbfield']++;
@@ -984,7 +992,7 @@ while ($i < min($num, $limit)) {
// Company
if (!empty($arrayfields['d.company']['checked'])) {
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($companyname).'">';
print $companyname;
print $companynametoshow;
print "</td>\n";
}
// Login
@@ -1094,7 +1102,9 @@ while ($i < min($num, $limit)) {
}
// EMail
if (!empty($arrayfields['d.email']['checked'])) {
print "<td>".dol_print_email($obj->email, 0, 0, 1)."</td>\n";
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->email).'">';
print dol_print_email($obj->email, 0, 0, 1, 64, 1, 1);
print "</td>\n";
}
// End of subscription date
$datefin = $db->jdate($obj->datefin);

View File

@@ -209,7 +209,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
// Subscription informations
$datesubscription = 0;
$datesubend = 0;
$paymentdate = 0;
$paymentdate = ''; // Do not use 0 here, default value is '' that means not filled where 0 means 1970-01-01
if (GETPOST("reyear", "int") && GETPOST("remonth", "int") && GETPOST("reday", "int")) {
$datesubscription = dol_mktime(0, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int"));
}
@@ -260,7 +260,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
}
// Check if a payment is mandatory or not
if (!$error && $adht->subscription) { // Member type need subscriptions
if ($adht->subscription) { // Member type need subscriptions
if (!is_numeric($amount)) {
// If field is '' or not a numeric value
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
@@ -268,28 +268,35 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$error++;
$action = 'addsubscription';
} else {
// If an amount has been provided, we check also fields that becomes mandatory when amount is not null.
if (!empty($conf->banque->enabled) && GETPOST("paymentsave") != 'none') {
if (GETPOST("subscription")) {
if (!GETPOST("label")) {
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"));
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
}
if (GETPOST("paymentsave") != 'invoiceonly' && !GETPOST("operation")) {
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
}
if (GETPOST("paymentsave") != 'invoiceonly' && !(GETPOST("accountid", 'int') > 0)) {
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount"));
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
}
} else {
if (GETPOST("accountid")) {
if (GETPOST("accountid", 'int')) {
$errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
}
}
if ($errmsg) {
$error++;
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
}
}
}
}
@@ -601,14 +608,22 @@ if ($rowid > 0) {
$company = new Societe($db);
$result = $company->fetch($object->fk_soc);
print $company->getNomUrl(1);
// Show link to invoices
$tmparray = $company->getOutstandingBills('customer');
if (!empty($tmparray['refs'])) {
print ' - '.img_picto($langs->trans("Invoices"), 'bill', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans("Invoices").' ('.count($tmparray['refs']).')';
// TODO Add alert if warning on at least one invoice late
print '</a>';
}
} else {
print $langs->trans("NoThirdPartyAssociatedToMember");
print '<span class="opacitymedium">'.$langs->trans("NoThirdPartyAssociatedToMember").'</span>';
}
}
print '</td></tr>';
}
// Login Dolibarr
// Login Dolibarr - Link to user
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("LinkedToDolibarrUser");
@@ -626,9 +641,11 @@ if ($rowid > 0) {
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', '');
} else {
if ($object->user_id) {
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
$linkeduser = new User($db);
$linkeduser->fetch($object->user_id);
print $linkeduser->getNomUrl(-1);
} else {
print $langs->trans("NoDolibarrAccess");
print '<span class="opacitymedium">'.$langs->trans("NoDolibarrAccess").'</span>';
}
}
print '</td></tr>';
@@ -970,17 +987,18 @@ if ($rowid > 0) {
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('MoreActions');
print '</td>';
print '<td>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice) ? ' checked' : '').'> '.$langs->trans("None").'<br>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice) ? ' checked' : '').'>';
print '<label for="none"> '.$langs->trans("None").'</label><br>';
// Add entry into bank accoun
if (!empty($conf->banque->enabled)) {
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.(!empty($bankdirect) ? ' checked' : '');
print '> '.$langs->trans("MoreActionBankDirect").'<br>';
print '><label for="bankdirect"> '.$langs->trans("MoreActionBankDirect").'</label><br>';
}
// Add invoice with no payments
if (!empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(!empty($invoiceonly) ? ' checked' : '');
//if (empty($object->fk_soc)) print ' disabled';
print '> '.$langs->trans("MoreActionInvoiceOnly");
print '><label for="invoiceonly"> '.$langs->trans("MoreActionInvoiceOnly");
if ($object->fk_soc) {
print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
} else {
@@ -1004,13 +1022,13 @@ if ($rowid > 0) {
}
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
}
print '<br>';
print '</label><br>';
}
// Add invoice with payments
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(!empty($bankviainvoice) ? ' checked' : '');
//if (empty($object->fk_soc)) print ' disabled';
print '> '.$langs->trans("MoreActionBankViaInvoice");
print '><label for="bankviainvoice"> '.$langs->trans("MoreActionBankViaInvoice");
if ($object->fk_soc) {
print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
} else {
@@ -1034,7 +1052,7 @@ if ($rowid > 0) {
}
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
}
print '<br>';
print '</label><br>';
}
print '</td></tr>';

View File

@@ -115,7 +115,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
$parameters = array('socid'=>$socid);
$parameters = array('socid'=>isset($socid) ? $socid : null);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -496,7 +496,7 @@ while ($i < min($num, $limit)) {
$adherent->gender = $obj->gender;
$adherent->morphy = $obj->morphy;
$adherent->email = $obj->email;
$adherent->typeid = $obj->type;
$adherent->typeid = $obj->fk_type;
$adherent->datefin = $db->jdate($obj->datef);
$typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);

View File

@@ -43,6 +43,8 @@ $action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$sall = GETPOST("sall", "alpha");
$filter = GETPOST("filter", 'alpha');
$search_lastname = GETPOST('search_lastname', 'alpha');
$search_login = GETPOST('search_login', 'alpha');
$search_email = GETPOST('search_email', 'alpha');
@@ -316,6 +318,19 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
print "</tr>";
$i++;
}
// If no record found
if ($num == 0) {
/*$colspan = 1;
foreach ($arrayfields as $key => $val) {
if (!empty($val['checked'])) {
$colspan++;
}
}*/
$colspan = 8;
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
}
print "</table>";
print '</div>';

View File

@@ -157,7 +157,7 @@ $form = new Form($db);
$formadmin = new FormAdmin($db);
$head = member_type_prepare_head($object);
$titre = $langs->trans("MemberType".$object->type);
$titre = $langs->trans("MemberType".$object->id);
// Calculate $cnt_trans
$cnt_trans = 0;

View File

@@ -115,7 +115,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
// Name
print '<tr class="oddeven"><td><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';

View File

@@ -226,6 +226,7 @@ if (empty($conf->cron->enabled)) {
// Get the max frequency of reminder
if ($job->id > 0) {
if ($job->status != $job::STATUS_ENABLED) {
$langs->load("cron");
print '<span class="opacitymedium warning">'.$langs->trans("JobXMustBeEnabled", $langs->transnoentitiesnoconv("sendEmailsReminder")).'</span>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_EMAIL&amp;token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>';

View File

@@ -165,24 +165,27 @@ $urlvcal = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal
$urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlvcal, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'vcal', '').'</span>');
$message .= '<div class="urllink">';
$message .= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
$message .= '<input type="text" id="onlinepaymenturl1" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
$message .= '</div>';
$message .= ajax_autoselect('onlinepaymenturl1');
$message .= '<br>';
$urlical = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
$urlical .= $urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlical, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', '').'</span>');
$message .= '<div class="urllink">';
$message .= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
$message .= '<input type="text" id="onlinepaymenturl2" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
$message .= '</div>';
$message .= ajax_autoselect('onlinepaymenturl2');
$message .= '<br>';
$urlrss = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
$urlrss .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlrss, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'rss', '').'</span>');
$message .= '<div class="urllink">';
$message .= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
$message .= '<input type="text" id="onlinepaymenturl3" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
$message .= '</div>';
$message .= ajax_autoselect('onlinepaymenturl3');
$message .= '<br>';
print $message;

View File

@@ -134,7 +134,7 @@ if (!empty($conf->global->CLICKTODIAL_URL)) {
print '<input type="hidden" name="token" value="'.newToken().'">';
print $langs->trans("LinkToTestClickToDial", $user->login).' : ';
print '<input class="flat" type="text" name="phonefortest" value="'.dol_escape_htmltag($phonefortest).'">';
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("RefreshPhoneLink")).'">';
print '<input type="submit" class="button small" value="'.dol_escape_htmltag($langs->trans("RefreshPhoneLink")).'">';
print '</form>';
$setupcomplete = 1;
@@ -149,7 +149,7 @@ if (!empty($conf->global->CLICKTODIAL_URL)) {
}
if ($setupcomplete) {
print $langs->trans("LinkToTest", $user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL');
print $langs->trans("LinkToTest", $user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL', '', 1);
} else {
$langs->load("errors");
print '<div class="warning">'.$langs->trans("WarningClickToDialUserSetupNotComplete").'</div>';

View File

@@ -696,7 +696,7 @@ $tooltiphelp = '';
if ($mysoc->country_code == 'FR') {
$tooltiphelp = '<i>'.$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i>";
}
print "<label for=\"use_vat\">".$form->textwithpicto($langs->trans("VATIsUsedDesc"), $tooltiphelp)."</label>";
print '<label for="use_vat">'.$form->textwithpicto($langs->trans("VATIsUsedDesc"), $tooltiphelp)."</label>";
print "</td></tr>\n";
@@ -706,7 +706,7 @@ $tooltiphelp = '';
if ($mysoc->country_code == 'FR') {
$tooltiphelp = "<i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i>\n";
}
print "<label for=\"no_vat\">".$form->textwithpicto($langs->trans("VATIsNotUsedDesc"), $tooltiphelp)."</label>";
print '<label for="no_vat">'.$form->textwithpicto($langs->trans("VATIsNotUsedDesc"), $tooltiphelp)."</label>";
print "</td></tr>\n";
print "</table>";
@@ -721,12 +721,12 @@ print "</tr>\n";
if ($mysoc->useLocalTax(1)) {
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="lt1" value="localtax1on"'.(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</td>";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="lt1" value="localtax1on"'.(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "").'> <label for="lt1">'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</label></td>";
print '<td colspan="2">';
print '<div class="nobordernopadding">';
$tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
$tooltiphelp = ($tooltiphelp != "LocalTax1IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."</i>\n" : "");
print '<label for="lt1">'.$form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
print $form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp);
if (!isOnlyOneLocalTax(1)) {
print '<br><label for="lt1">'.$langs->trans("LTRate").'</label>: ';
$formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1");
@@ -739,11 +739,11 @@ if ($mysoc->useLocalTax(1)) {
print "</div>";
print "</td></tr>\n";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="nolt1" value="localtax1off"'.((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</td>";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="nolt1" value="localtax1off"'.((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "").'> <label for="nolt1">'.$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</label></td>";
print '<td colspan="2">';
$tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code);
$tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."</i>\n" : "");
print "<label for=\"nolt1\">".$form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
print $form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp);
print "</td></tr>\n";
} else {
if (empty($mysoc->country_code)) {
@@ -765,7 +765,7 @@ print "</tr>\n";
if ($mysoc->useLocalTax(2)) {
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="lt2" value="localtax2on"'.(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="lt2" value="localtax2on"'.(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "").'> <label for="lt2">'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</label></td>";
print '<td colspan="2">';
print '<div class="nobordernopadding">';
print '<label for="lt2">'.$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label>";
@@ -780,7 +780,7 @@ if ($mysoc->useLocalTax(2)) {
print "</div>";
print "</td></tr>\n";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="nolt2" value="localtax2off"'.((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</td>";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="nolt2" value="localtax2off"'.((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "").'> <label for="nolt2">'.$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</label></td>";
print '<td colspan="2">';
print "<div>";
$tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code);
@@ -803,7 +803,7 @@ print "</table>";
print '<br>';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">';
print '<td width="25%">'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).'</td><td>'.$langs->trans("Description").'</td>';
print '<td>'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).'</td><td>'.$langs->trans("Description").'</td>';
print '<td class="right">&nbsp;</td>';
print "</tr>\n";
if ($mysoc->useRevenueStamp()) {

View File

@@ -104,13 +104,11 @@ print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
// Social networks
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Url").'</td><td>'.$langs->trans("SocialNetworkId").'</td><td></td>';
print '<td class="titlefieldcreate">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Url").'</td><td>'.$langs->trans("SocialNetworkId").'</td><td></td>';
print "</tr>\n";

View File

@@ -45,6 +45,11 @@ $arrayofparameters = array(
'DAV_ALLOW_ECM_DIR'=>array('css'=>'minwidth200', 'enabled'=>$conf->ecm->enabled)
);
// To fix when dire does not exists
dol_mkdir($conf->dav->dir_output.'/temp');
dol_mkdir($conf->dav->dir_output.'/public');
dol_mkdir($conf->dav->dir_output.'/private');
/*
* Actions

View File

@@ -1175,6 +1175,8 @@ if ($id) {
$sql .= natural_search("r.code_region", $search_code);
} elseif ($search_code != '' && $id == 7) {
$sql .= natural_search("a.code", $search_code);
} elseif ($search_code != '' && $id == 10) {
$sql .= natural_search("t.code", $search_code);
} elseif ($search_code != '' && $id != 9) {
$sql .= natural_search("code", $search_code);
}
@@ -1452,6 +1454,10 @@ if ($id) {
print $tdsoffields;
// Line to enter new values
print '<!-- line to add new entry -->';
print '<tr class="oddeven nodrag nodrop nohover">';
$obj = new stdClass();
// If data was already input, we define them in obj to populate input fields.
if (GETPOST('actionadd')) {
@@ -1471,9 +1477,6 @@ if ($id) {
unset($fieldlist[2]); // Remove field ??? if dictionary Regions
}
// Line to enter new values
print '<!-- line to add new entry -->';
print '<tr class="oddeven nodrag nodrop nohover">';
if (empty($reshook)) {
fieldList($fieldlist, $obj, $tabname[$id], 'add');

View File

@@ -232,7 +232,7 @@ class PrestaShopWebservice
if ($response != '') {
libxml_clear_errors();
libxml_use_internal_errors(true);
$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA);
$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
if (libxml_get_errors()) {
$msg = var_export(libxml_get_errors(), true);
libxml_clear_errors();

View File

@@ -84,7 +84,7 @@ class Dolistore
try {
$this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api);
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV'));
// $conf->global->MAIN_MODULE_DOLISTORE_API_KEY is for the login of basic auth. There is no password as it is public data.
// Here we set the option array for the Webservice : we want categories resources
@@ -134,7 +134,7 @@ class Dolistore
try {
$this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api);
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV'));
// $conf->global->MAIN_MODULE_DOLISTORE_API_KEY is for the login of basic auth. There is no password as it is public data.
// Here we set the option array for the Webservice : we want products resources
@@ -217,15 +217,15 @@ class Dolistore
for ($i = 0; $i < $nbofcateg; $i++) {
$cat = $this->categories[$i];
if ($cat->is_root_category == 1 && $parent == 0) {
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" ';
$html .= 'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'">'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>';
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.((int) $cat->id).'" ';
$html .= 'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'">'.dol_escape_htmltag($cat->name->language[$this->lang - 1]).' <sup>'.dol_escape_htmltag($cat->nb_products_recursive).'</sup></a></h3>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
} elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau
$select = ($cat->id == $this->categorie) ? ' selected' : '';
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"';
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.((int) $cat->id).'"';
$html .= ' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'" ';
$html .= '>'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a>';
$html .= '>'.dol_escape_htmltag($cat->name->language[$this->lang - 1]).' <sup>'.dol_escape_htmltag($cat->nb_products_recursive).'</sup></a>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
}
@@ -267,9 +267,9 @@ class Dolistore
// add image or default ?
if ($product->id_default_image != '') {
$image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image;
$images = '<a href="'.$image_url.'" class="documentpreview" target="_blank" mime="image/png" title="'.$product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version.'">';
$images .= '<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
$image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.((int) $product->id).'&id_image='.((int) $product->id_default_image);
$images = '<a href="'.urlencode($image_url).'" class="documentpreview" target="_blank" mime="image/png" title="'.dol_escape_htmltag($product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version).'">';
$images .= '<img src="'.urlencode($image_url).'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
} else {
$images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />';
}
@@ -277,11 +277,11 @@ class Dolistore
// free or pay ?
if ($product->price > 0) {
$price = '<h3>'.price(price2num($product->price, 'MT'), 0, $langs, 1, -1, -1, 'EUR').' '.$langs->trans("HT").'</h3>';
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
$download_link = '<a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
} else {
$price = '<h3>'.$langs->trans('Free').'</h3>';
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>';
$download_link .= '<br><br><a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
$download_link = '<a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>';
$download_link .= '<br><br><a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
}
//checking versions
@@ -319,14 +319,14 @@ class Dolistore
//.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a>
//output template
$html .= '<tr class="app oddeven '.$compatible.'">
<td class="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td>
<td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang - 1]
.'<br><small>'.$version.'</small></h2>
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang - 1].'</td>';
$html .= '<tr class="app oddeven '.dol_escape_htmltag($compatible).'">
<td class="center" width="210"><div class="newAppParent">'.dol_escape_htmltag($newapp.$images).'</div></td>
<td class="margeCote"><h2 class="appTitle">'.dol_escape_htmltag($product->name->language[$this->lang - 1])
.'<br><small>'.dol_escape_htmltag($version).'</small></h2>
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).'</small><br><br>'.dol_escape_htmltag($product->description_short->language[$this->lang - 1]).'</td>';
// do not load if display none
//$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>';
$html .= '<td class="margeCote center">'.$price.'</td>';
$html .= '<td class="margeCote center">'.dol_escape_htmltag($price).'</td>';
$html .= '<td class="margeCote">'.$download_link.'</td>';
$html .= '</tr>';
}
@@ -343,7 +343,7 @@ class Dolistore
public function get_previous_link($text = '<<')
{
// phpcs:enable
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
return '<a href="'.$this->get_previous_url().'" class="button">'.dol_escape_htmltag($text).'</a>';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -356,7 +356,7 @@ class Dolistore
public function get_next_link($text = '>>')
{
// phpcs:enable
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
return '<a href="'.$this->get_next_url().'" class="button">'.dol_escape_htmltag($text).'</a>';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps

View File

@@ -34,13 +34,9 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
// Translations
$langs->loadLangs(array("admin", "eventorganization"));
// Access control
if (!$user->admin) {
accessforbidden();
}
// Parameters
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
$value = GETPOST('value', 'alpha');
@@ -52,8 +48,8 @@ $arrayofparameters = array(
'EVENTORGANIZATION_TASK_LABEL'=>array('type'=>'textarea','enabled'=>1),
'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
//'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
//'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
@@ -70,11 +66,21 @@ $setupnotempty = 0;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
// Access control
if (empty($user->admin)) {
accessforbidden();
}
/*
* Actions
*/
if ($cancel) {
$action ='';
}
if ((float) DOL_VERSION >= 6) {
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
}
@@ -207,7 +213,7 @@ if ($action == 'edit') {
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
@@ -258,7 +264,7 @@ if ($action == 'edit') {
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany = new FormCompany($db);
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname, 'customerorprospect', 'form', '', 1);
} elseif ($val['type'] == 'securekey') {
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">';
if (!empty($conf->use_javascript_ajax)) {
@@ -293,7 +299,9 @@ if ($action == 'edit') {
print '</table>';
print '<br><div class="center">';
print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; ';
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>';
@@ -301,7 +309,7 @@ if ($action == 'edit') {
} else {
if (!empty($arrayofparameters)) {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
@@ -358,7 +366,7 @@ if ($action == 'edit') {
$product = new Product($db);
$resprod = $product->fetch($conf->global->{$constname});
if ($resprod > 0) {
print $product->ref;
print $product->getNomUrl(1);
} elseif ($resprod < 0) {
setEventMessages(null, $object->errors, "errors");
}

View File

@@ -47,6 +47,8 @@ if (!$user->admin) {
// Constant and translation of the module description
$modules = array(
'NOTE_PUBLIC' => 'FCKeditorForNotePublic',
'NOTE_PRIVATE' => 'FCKeditorForNotePrivate',
'SOCIETE' => 'FCKeditorForCompany',
'PRODUCTDESC' => 'FCKeditorForProduct',
'DETAILS' => 'FCKeditorForProductDetails',
@@ -54,11 +56,11 @@ $modules = array(
'MAILING' => 'FCKeditorForMailing',
'MAIL' => 'FCKeditorForMail',
'TICKET' => 'FCKeditorForTicket',
'NOTE_PUBLIC' => 'FCKeditorForNotePublic',
'NOTE_PRIVATE' => 'FCKeditorForNotePrivate',
);
// Conditions for the option to be offered
$conditions = array(
'NOTE_PUBLIC' => 1,
'NOTE_PRIVATE' => 1,
'SOCIETE' => 1,
'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)),
'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
@@ -66,11 +68,11 @@ $conditions = array(
'MAILING' => !empty($conf->mailing->enabled),
'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)),
'TICKET' => !empty($conf->ticket->enabled),
'NOTE_PUBLIC' => 1,
'NOTE_PRIVATE' => 1,
);
// Picto
$picto = array(
'NOTE_PUBLIC' => 'generic',
'NOTE_PRIVATE' => 'generic',
'SOCIETE' => 'generic',
'PRODUCTDESC' => 'product',
'DETAILS' => 'product',
@@ -78,8 +80,6 @@ $picto = array(
'MAILING' => 'email',
'MAIL' => 'email',
'TICKET' => 'ticket',
'NOTE_PUBLIC' => 'generic',
'NOTE_PRIVATE' => 'generic',
);

View File

@@ -109,8 +109,8 @@ $reshook = $hookmanager->executeHooks('addHomeSetup', $parameters, $object, $act
print $hookmanager->resPrint;
if (empty($reshook)) {
// Show into other
print '<span class="opacitymedium">'.$langs->trans("SetupDescription5")."</span><br>";
print "<br>";
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("SetupDescription5")."</span><br>";
print '<br class="hideonsmartphone">';
// Show logo
print '<div class="center"><div class="logo_setup"></div></div>';

View File

@@ -43,6 +43,7 @@ $action = GETPOST('action', 'aZ09');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('adminldap', 'globaladmin'));
/*
* Actions
*/
@@ -150,7 +151,7 @@ $arraylist['0'] = $langs->trans("No");
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr");
$arraylist['dolibarr2ldap'] = $langs->trans("DolibarrToLDAP");
print $form->selectarray('activesynchro', $arraylist, $conf->global->LDAP_SYNCHRO_ACTIVE);
print '</td><td>'.$langs->trans("LDAPDnSynchroActiveExample");
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnSynchroActiveExample").'</span>';
if ($conf->global->LDAP_SYNCHRO_ACTIVE && !$conf->global->LDAP_USER_DN) {
print '<br><font class="error">'.$langs->trans("LDAPSetupNotComplete").'</font>';
}
@@ -163,7 +164,7 @@ if (!empty($conf->societe->enabled)) {
$arraylist['0'] = $langs->trans("No");
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
print $form->selectarray('activecontact', $arraylist, $conf->global->LDAP_CONTACT_ACTIVE);
print '</td><td>'.$langs->trans("LDAPDnContactActiveExample").'</td></tr>';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnContactActiveExample").'</span></td></tr>';
}
// Synchro member active
@@ -174,7 +175,7 @@ if (!empty($conf->adherent->enabled)) {
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')';
print $form->selectarray('activemembers', $arraylist, $conf->global->LDAP_MEMBER_ACTIVE);
print '</td><td>'.$langs->trans("LDAPDnMemberActiveExample").'</td></tr>';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberActiveExample").'</span></td></tr>';
}
// Synchro member type active
@@ -185,7 +186,7 @@ if (!empty($conf->adherent->enabled)) {
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')';
print $form->selectarray('activememberstypes', $arraylist, $conf->global->LDAP_MEMBER_TYPE_ACTIVE);
print '</td><td>'.$langs->trans("LDAPDnMemberTypeActiveExample").'</td></tr>';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberTypeActiveExample").'</span></td></tr>';
}
// Fields from hook
@@ -214,33 +215,33 @@ $arraylist = array();
$arraylist['3'] = 'Version 3';
$arraylist['2'] = 'Version 2';
print $form->selectarray('LDAP_SERVER_PROTOCOLVERSION', $arraylist, $conf->global->LDAP_SERVER_PROTOCOLVERSION);
print '</td><td>'.$langs->trans("LDAPServerProtocolVersion").'</td></tr>';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerProtocolVersion").'</span></td></tr>';
// Serveur primaire
print '<tr class="oddeven"><td>';
print $langs->trans("LDAPPrimaryServer").'</td><td>';
print '<input size="25" type="text" name="host" value="'.$conf->global->LDAP_SERVER_HOST.'">';
print '</td><td>'.$langs->trans("LDAPServerExample").'</td></tr>';
print '<input class="minwidth200" type="text" name="host" value="'.$conf->global->LDAP_SERVER_HOST.'">';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerExample").'</span></td></tr>';
// Serveur secondaire
print '<tr class="oddeven"><td>';
print $langs->trans("LDAPSecondaryServer").'</td><td>';
print '<input size="25" type="text" name="slave" value="'.$conf->global->LDAP_SERVER_HOST_SLAVE.'">';
print '</td><td>'.$langs->trans("LDAPServerExample").'</td></tr>';
print '<input class="minwidth200" type="text" name="slave" value="'.$conf->global->LDAP_SERVER_HOST_SLAVE.'">';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerExample").'</span></td></tr>';
// Port
print '<tr class="oddeven"><td>'.$langs->trans("LDAPServerPort").'</td><td>';
if (!empty($conf->global->LDAP_SERVER_PORT)) {
print '<input size="25" type="text" name="port" value="'.$conf->global->LDAP_SERVER_PORT.'">';
print '<input class="width75" type="text" name="port" value="'.$conf->global->LDAP_SERVER_PORT.'">';
} else {
print '<input size="25" type="text" name="port" value="389">';
print '<input class="width75" type="text" name="port" value="389">';
}
print '</td><td>'.$langs->trans("LDAPServerPortExample").'</td></tr>';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerPortExample").'</span></td></tr>';
// DNserver
print '<tr class="oddeven"><td>'.$langs->trans("LDAPServerDn").'</td><td>';
print '<input size="25" type="text" name="dn" value="'.$conf->global->LDAP_SERVER_DN.'">';
print '</td><td>'.$langs->trans("LDAPServerDnExample").'</td></tr>';
print '<input class="minwidth300" type="text" name="dn" value="'.$conf->global->LDAP_SERVER_DN.'">';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerDnExample").'</span></td></tr>';
// Utiliser TLS
print '<tr class="oddeven"><td>'.$langs->trans("LDAPServerUseTLS").'</td><td>';
@@ -248,7 +249,7 @@ $arraylist = array();
$arraylist['0'] = $langs->trans("No");
$arraylist['1'] = $langs->trans("Yes");
print $form->selectarray('usetls', $arraylist, $conf->global->LDAP_SERVER_USE_TLS);
print '</td><td>'.$langs->trans("LDAPServerUseTLSExample").'</td></tr>';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerUseTLSExample").'</span></td></tr>';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("ForANonAnonymousAccess").'</td>';
@@ -257,18 +258,18 @@ print "</tr>\n";
// DNAdmin
print '<!-- LDAP_ADMIN_DN -->';
print '<tr class="oddeven"><td>'.$langs->trans("LDAPAdminDn").'</td><td>';
print '<input size="25" type="text" name="admin" value="'.$conf->global->LDAP_ADMIN_DN.'">';
print '</td><td>'.$langs->trans("LDAPAdminDnExample").'</td></tr>';
print '<input class="minwidth300" type="text" name="admin" value="'.$conf->global->LDAP_ADMIN_DN.'">';
print '</td><td class="maxwidthhalf"><span class="opacitymedium">'.$langs->trans("LDAPAdminDnExample").'</span></td></tr>';
// Pass
print '<!-- LDAP_ADMIN_PASS -->';
print '<tr class="oddeven"><td>'.$langs->trans("LDAPPassword").'</td><td>';
if (!empty($conf->global->LDAP_ADMIN_PASS)) {
print '<input size="25" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">'; // je le met en visible pour test
print '<input class="minwidth150" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">'; // je le met en visible pour test
} else {
print '<input size="25" type="text" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">';
print '<input class="minwidth150" type="text" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">';
}
print '</td><td>'.$langs->trans('Password').' (ex: secret)</td></tr>';
print '</td><td><span class="opacitymedium">'.$langs->trans('Password').' (ex: secret)</span></td></tr>';
print '</table>';

View File

@@ -132,6 +132,7 @@ print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td>'.$langs->trans("Example").'</td>';
print "</tr>\n";
print '<tr class="oddeven"><td>';
@@ -140,7 +141,8 @@ print '<input size="32" type="text" name="MAILING_EMAIL_FROM" value="'.$conf->gl
if (!empty($conf->global->MAILING_EMAIL_FROM) && !isValidEmail($conf->global->MAILING_EMAIL_FROM)) {
print ' '.img_warning($langs->trans("BadEMail"));
}
print '</td></tr>';
print '</td><td><span class="opacitymedium">'.dol_escape_htmltag(($mysoc->name ? $mysoc->name : 'MyName').' <noreply@example.com>').'</span></td>';
print '</tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("MailingEMailError").'</td><td>';
@@ -148,12 +150,14 @@ print '<input size="32" type="text" name="MAILING_EMAIL_ERRORSTO" value="'.$conf
if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && !isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO)) {
print ' '.img_warning($langs->trans("BadEMail"));
}
print '</td></tr>';
print '</td><td><span class="opacitymedium">webmaster@example.com></span></td>';
print '</tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("MailingDelay").'</td><td>';
print '<input class="width75" type="text" name="MAILING_DELAY" value="'.$conf->global->MAILING_DELAY.'">';
print '</td></tr>';
print '</td><td></td>';
print '</tr>';
// Constant to add salt into the unsubscribe and check read tag.
@@ -165,15 +169,17 @@ print '<input size="32" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" id="MAI
if (!empty($conf->use_javascript_ajax)) {
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
}
print '</td></tr>';
print '</td><td></td>';
print '</tr>';
// default blacklist from mailing
print '<tr class="oddeven">';
print '<td>' . $langs->trans("DefaultBlacklistMailingStatus") . '</td>';
print '<td>' . $langs->trans("DefaultBlacklistMailingStatus", $langs->transnoentitiesnoconv("No_Email")) . '</td>';
print '<td>';
$blacklist_setting=array(0=>$langs->trans('No'),1=>$langs->trans('Yes'),-1=>$langs->trans('DefaultStatusEmptyMandatory'));
$blacklist_setting=array(0=>$langs->trans('No'), 1=>$langs->trans('Yes'), 2=>$langs->trans('DefaultStatusEmptyMandatory'));
print $form->selectarray("MAILING_CONTACT_DEFAULT_BULK_STATUS", $blacklist_setting, $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS);
print '</td>';
print '<td></td>';
print '</tr>';
@@ -181,7 +187,8 @@ if (!empty($conf->use_javascript_ajax) && $conf->global->MAIN_FEATURES_LEVEL >=
print '<tr class="oddeven"><td>';
print $langs->trans("MailAdvTargetRecipients").'</td><td>';
print ajax_constantonoff('EMAILING_USE_ADVANCED_SELECTOR');
print '</td></tr>';
print '</td><td></td>';
print '</tr>';
}
print '</table>';

View File

@@ -160,6 +160,7 @@ if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) {
$tabhelp = array();
$tabhelp[25] = array(
'label'=>$langs->trans('EnterAnyCode'),
'topic'=>'<span class="small">'.$helpsubstit.'</span>',
'joinfiles'=>$langs->trans('AttachMainDocByDefault'),
'content'=>'<span class="small">'.$helpsubstit.'</span>',
@@ -228,7 +229,10 @@ if (!empty($conf->agenda->enabled)) {
$elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush'));
}
if (!empty($conf->eventorganization->enabled) && !empty($user->rights->eventorganization->read)) {
$elementList['eventorganization_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization'));
$elementList['conferenceorbooth'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization'));
}
if (!empty($conf->partnership->enabled) && !empty($user->rights->partnership->read)) {
$elementList['partnership_send'] = img_picto('', 'partnership', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToPartnership'));
}
$parameters = array('elementList'=>$elementList);
@@ -561,8 +565,8 @@ $sql = "SELECT rowid as rowid, module, label, type_template, lang, fk_user, priv
$sql .= " FROM ".MAIN_DB_PREFIX."c_email_templates";
$sql .= " WHERE entity IN (".getEntity('email_template').")";
if (!$user->admin) {
$sql .= " AND (private = 0 OR (private = 1 AND fk_user = ".$user->id."))"; // Show only public and private to me
$sql .= " AND (active = 1 OR fk_user = ".$user->id.")"; // Show only active or owned by me
$sql .= " AND (private = 0 OR (private = 1 AND fk_user = ".((int) $user->id)."))"; // Show only public and private to me
$sql .= " AND (active = 1 OR fk_user = ".((int) $user->id).")"; // Show only active or owned by me
}
if (empty($conf->global->MAIN_MULTILANGS)) {
$sql .= " AND (lang = '".$db->escape($langs->defaultlang)."' OR lang IS NULL OR lang = '')";
@@ -680,8 +684,8 @@ if ($action == 'view') {
$tmpaction = 'create';
$parameters = array(
'fieldlist' => $fieldlist,
'tabname' => $tabname[$id]
'fieldlist' => $fieldlist,
'tabname' => $tabname[$id]
);
$reshook = $hookmanager->executeHooks('createEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error = $hookmanager->error;
@@ -819,7 +823,7 @@ if ($resql) {
print '</td>';
} elseif ($value == 'fk_user') {
print '<td class="liste_titre">';
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 1, '', 0, '', 'maxwidth150');
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'maxwidth150');
print '</td>';
} elseif ($value == 'topic') {
print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
@@ -1068,8 +1072,8 @@ if ($resql) {
if ($showfield) {
print '<!-- '.$fieldlist[$field].' -->';
print '<td class="'.$class.'"';
if ($value == 'topic') {
print ' title="'.$valuetoshow.'"';
if (in_array($value, array('code', 'label', 'topic'))) {
print ' title="'.dol_escape_htmltag($valuetoshow).'"';
}
print '>';
print $valuetoshow;
@@ -1184,7 +1188,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
if ($value == 'fk_user') {
print '<td>';
if ($user->admin) {
print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 1, '', 0, '', 'maxwidth200');
print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'minwidth150 maxwidth300');
} else {
if ($context == 'add') { // I am not admin and we show the add form
print $user->getNomUrl(1); // Me

View File

@@ -133,7 +133,7 @@ if ($action == 'install') {
// $original_file should match format module_modulename-x.y[.z].zip
$original_file = basename($_FILES["fileinstall"]["name"]);
$original_file = preg_replace('/\(\d+\)\.zip$/i', '.zip', $original_file);
$original_file = preg_replace('/\s*\(\d+\)\.zip$/i', '.zip', $original_file);
$newfile = $conf->admin->dir_temp.'/'.$original_file.'/'.$original_file;
if (!$original_file) {
@@ -588,6 +588,11 @@ if ($mode == 'common' || $mode == 'commonkanban') {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
$disabled_modules = array();
if (!empty($_SESSION["disablemodules"])) {
$disabled_modules = explode(',', $_SESSION["disablemodules"]);
}
// Show list of modules
$oldfamily = '';
$foundoneexternalmodulewithupdate = 0;
@@ -613,6 +618,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
continue;
}
$modulenameshort = strtolower(preg_replace('/^mod/i', '', get_class($objMod)));
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
// Check filters
@@ -754,6 +760,11 @@ if ($mode == 'common' || $mode == 'commonkanban') {
$codeenabledisable = '';
$codetoconfig = '';
// Force disable of module disabled into session (for demo for example)
if (in_array($modulenameshort, $disabled_modules)) {
$objMod->disabled = true;
}
// Activate/Disable and Setup (2 columns)
if (!empty($conf->global->$const_name)) { // If module is already activated
// Set $codeenabledisable
@@ -761,6 +772,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
if (!empty($arrayofwarnings[$modName])) {
$codeenabledisable .= '<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
}
if (!empty($objMod->disabled)) {
$codeenabledisable .= $langs->trans("Disabled");
} elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1))) {
@@ -1013,16 +1025,16 @@ if ($mode == 'marketplace') {
print '<div class="liste_titre liste_titre_bydiv centpercent"><div class="divsearchfield">';
print '<form method="POST" class="centpercent" id="searchFormList" action="'.$dolistore->url.'">';
print '<form method="POST" class="centpercent" id="searchFormList" action="'.urlencode($dolistore->url).'">';
?>
<input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="mode" value="marketplace">
<div class="divsearchfield">
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo $options['search'] ?>"><br>
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo dol_escape_htmltag($options['search']) ?>"><br>
</div>
<div class="divsearchfield">
<input class="button buttongen" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
<a class="buttonreset" href="<?php echo $dolistore->url ?>"><?php echo $langs->trans('Reset') ?></a>
<a class="buttonreset" href="<?php echo urlencode($dolistore->url) ?>"><?php echo $langs->trans('Reset') ?></a>
&nbsp;
</div>
@@ -1039,7 +1051,7 @@ if ($mode == 'marketplace') {
<div id="category-tree-left">
<ul class="tree">
<?php echo $dolistore->get_categories(); ?>
<?php echo dol_escape_htmltag($dolistore->get_categories()); ?>
</ul>
</div>
<div id="listing-content">

View File

@@ -47,7 +47,7 @@ $error = 0;
*/
// Action to update or add a constant
if ($action == 'settemplates') {
if ($action == 'settemplates' && $user->admin) {
$db->begin();
if (!$error && is_array($_POST)) {
@@ -192,7 +192,8 @@ print "</tr>\n";
print '<tr class="oddeven"><td>';
print $langs->trans("NotificationEMailFrom").'</td>';
print '<td>';
print '<input size="32" type="email" name="email_from" value="'.$conf->global->NOTIFICATION_EMAIL_FROM.'">';
print img_picto('', 'email', 'class="pictofixedwidth"');
print '<input class="width300" type="email" name="email_from" value="'.$conf->global->NOTIFICATION_EMAIL_FROM.'">';
if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->global->NOTIFICATION_EMAIL_FROM)) {
print ' '.img_warning($langs->trans("ErrorBadEMail"));
}
@@ -270,7 +271,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
}
$helptext = '';
form_constantes($constantes, 3, $helptext);
form_constantes($constantes, 3, $helptext, 'EmailTemplate');
print '<div class="opacitymedium">';
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
if (!empty($conf->societe->enabled)) {
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
}
print '</div>';
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
} else {
@@ -316,15 +324,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
print '</td></tr>';
print '</table>';
}
print '<div class="opacitymedium">';
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
if (!empty($conf->societe->enabled)) {
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
print '<div class="opacitymedium">';
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
if (!empty($conf->societe->enabled)) {
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
}
print '</div>';
}
print '</div>';
print '</form>';
@@ -335,6 +342,7 @@ print '<br><br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setfixednotif">';
print '<input type="hidden" name="page_y" value="">';
print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', '');
@@ -376,6 +384,12 @@ foreach ($listofnotifiedevents as $notifiedevent) {
$elementLabel = $langs->trans('ExpenseReport');
}
$labelfortrigger = 'AmountHT';
$codehasnotrigger = 0;
if (preg_match('/^HOLIDAY/', $notifiedevent['code'])) {
$codehasnotrigger++;
}
print '<tr class="oddeven">';
print '<td>';
print img_picto('', $elementPicto, 'class="pictofixedwidth"');
@@ -384,6 +398,7 @@ foreach ($listofnotifiedevents as $notifiedevent) {
print '<td>'.$notifiedevent['code'].'</td>';
print '<td><span class="opacitymedium">'.$label.'</span></td>';
print '<td>';
$inputfieldalreadyshown = 0;
// Notification with threshold
foreach ($conf->global as $key => $val) {
if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) {
@@ -407,24 +422,35 @@ foreach ($listofnotifiedevents as $notifiedevent) {
}
print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
print '<br>';
$inputfieldalreadyshown++;
}
// New entry input fields
$s = '<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_new_key" value="">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
if (empty($inputfieldalreadyshown) || !$codehasnotrigger) {
$s = '<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_new_key" value="">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
}
print '</td>';
print '<td>';
// Notification with threshold
$inputfieldalreadyshown = 0;
foreach ($conf->global as $key => $val) {
if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) {
continue;
}
print $langs->trans("AmountHT").' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_amount" value="'.dol_escape_htmltag($reg[1]).'">';
print '<br>';
if (!$codehasnotrigger) {
print $langs->trans($labelfortrigger).' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_amount" value="'.dol_escape_htmltag($reg[1]).'">';
print '<br>';
$inputfieldalreadyshown++;
}
}
// New entry input fields
print $langs->trans("AmountHT").' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_new_amount" value="">';
if (!$codehasnotrigger) {
print $langs->trans($labelfortrigger).' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_new_amount" value="">';
}
print '</td>';
print '<td>';
@@ -437,7 +463,7 @@ print '</table>';
print '<br>';
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></div>';
print '<div class="center"><input type="submit" class="button button-save reposition" value="'.$langs->trans("Save").'"></div>';
print '</form>';

View File

@@ -92,7 +92,7 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit') {
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("Day").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("Day").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc"));

View File

@@ -150,42 +150,44 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td class="titlefieldcreate">'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print "</tr>";
// Bank account (from Banks module)
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("BankToPayCreditTransfer").'</td>';
print '<td class="left">';
$form->select_comptes($conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT, 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT', 0, "courant=1", 1);
print '<td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
print $form->select_comptes($conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT, 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT', 0, "courant=1", 1, '', 0, 'minwidth200', 1);
print '</td></tr>';
/* Moved to bank account data
// ICS
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("ICS").'</td>';
print '<td class="left">';
print '<td>';
print '<input type="text" name="PAYMENTBYBANKTRANSFER_ICS" value="'.$conf->global->PAYMENTBYBANKTRANSFER_ICS.'" size="15" ></td>';
print '</td></tr>';
*/
//User
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("ResponsibleUser").'</td>';
print '<td class="left">';
print $form->select_dolusers($conf->global->PAYMENTBYBANKTRANSFER_USER, 'PAYMENTBYBANKTRANSFER_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '<td>';
print img_picto('', 'user', 'class="pictofixedwidth"');
print $form->select_dolusers($conf->global->PAYMENTBYBANKTRANSFER_USER, 'PAYMENTBYBANKTRANSFER_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'minwidth200 maxwidth500');
print '</td>';
print '</tr>';
/*
//EntToEnd
print '<tr class="oddeven"><td>'.$langs->trans("END_TO_END").'</td>';
print '<td class="left">';
print '<input type="text" name="PRELEVEMENT_END_TO_END" value="'.$conf->global->PRELEVEMENT_END_TO_END.'" size="15" ></td>';
print '<td>';
print '<input type="text" name="PRELEVEMENT_END_TO_END" value="'.$conf->global->PRELEVEMENT_END_TO_END.'" class="width100"></td>';
print '</td></tr>';
//USTRD
print '<tr class="oddeven"><td>'.$langs->trans("USTRD").'</td>';
print '<td class="left">';
print '<input type="text" name="PRELEVEMENT_USTRD" value="'.$conf->global->PRELEVEMENT_USTRD.'" size="15" ></td>';
print '<td>';
print '<input type="text" name="PRELEVEMENT_USTRD" value="'.$conf->global->PRELEVEMENT_USTRD.'" class="width100"></td>';
print '</td></tr>';
*/
@@ -195,7 +197,7 @@ print '<td class="left">';
if (!$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS) {
$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS = 0;
}
print '<input type="text" name="PAYMENTBYBANKTRANSFER_ADDDAYS" value="'.$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS.'" size="15" ></td>';
print '<input type="text" name="PAYMENTBYBANKTRANSFER_ADDDAYS" value="'.$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS.'" class="width50"></td>';
print '</td></tr>';
print '</table>';
print '<br>';

View File

@@ -52,22 +52,23 @@ if ($cancel) {
}
if ($action == 'update') {
dolibarr_set_const($db, "MAIN_PDF_FORMAT", GETPOST("MAIN_PDF_FORMAT"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_FORMAT')) dolibarr_set_const($db, "MAIN_PDF_FORMAT", GETPOST("MAIN_PDF_FORMAT"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", GETPOST("MAIN_PDF_MARGIN_LEFT"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", GETPOST("MAIN_PDF_MARGIN_TOP"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", GETPOST("MAIN_PDF_MARGIN_BOTTOM"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MARGIN_LEFT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", GETPOST("MAIN_PDF_MARGIN_LEFT"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MARGIN_RIGHT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", GETPOST("MAIN_PDF_MARGIN_RIGHT"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MARGIN_TOP')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_TOP", GETPOST("MAIN_PDF_MARGIN_TOP"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MARGIN_BOTTOM')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", GETPOST("MAIN_PDF_MARGIN_BOTTOM"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", GETPOST("MAIN_PROFID1_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", GETPOST("MAIN_PROFID2_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", GETPOST("MAIN_PROFID3_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", GETPOST("MAIN_PROFID4_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PROFID1_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", GETPOST("MAIN_PROFID1_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PROFID2_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", GETPOST("MAIN_PROFID2_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PROFID3_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", GETPOST("MAIN_PROFID3_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PROFID4_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", GETPOST("MAIN_PROFID4_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PROFID5_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PROFID6_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_TVAINTRA_NOT_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (!empty($conf->projet->enabled)) {
if (GETPOST('PDF_SHOW_PROJECT_REF_OR_LABEL') == 'no') {
@@ -82,20 +83,20 @@ if ($action == 'update') {
}
}
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DESC"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_REF"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_DESC')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DESC"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_REF')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_REF"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_DOCUMENTS_LOGO_HEIGHT')) dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_INVERT_SENDER_RECIPIENT')) dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_USE_ISO_LOCATION')) dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_SECOND_TAX"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_THIRD_TAX"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MAIN_HIDE_SECOND_TAX')) dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_SECOND_TAX"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MAIN_HIDE_THIRD_TAX')) dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_THIRD_TAX"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "PDF_USE_ALSO_LANGUAGE_CODE", GETPOST('PDF_USE_ALSO_LANGUAGE_CODE', 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "SHOW_SUBPRODUCT_REF_IN_PDF", GETPOST('SHOW_SUBPRODUCT_REF_IN_PDF', 'alpha'), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE')) dolibarr_set_const($db, "PDF_USE_ALSO_LANGUAGE_CODE", GETPOST('PDF_USE_ALSO_LANGUAGE_CODE', 'alpha'), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('SHOW_SUBPRODUCT_REF_IN_PDF')) dolibarr_set_const($db, "SHOW_SUBPRODUCT_REF_IN_PDF", GETPOST('SHOW_SUBPRODUCT_REF_IN_PDF', 'alpha'), 'chaine', 0, '', $conf->entity);
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');

View File

@@ -53,6 +53,8 @@ if ($cancel) {
}
if ($action == 'update') {
if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity);
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");

View File

@@ -160,8 +160,9 @@ print "</tr>";
// Bank account (from Banks module)
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("BankToReceiveWithdraw").'</td>';
print '<td class="left">';
$form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT, 'PRELEVEMENT_ID_BANKACCOUNT', 0, "courant=1", 1);
print '<td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
print $form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT, 'PRELEVEMENT_ID_BANKACCOUNT', 0, "courant=1", 1, '', 0, 'minwidth200', 1);
print '</td></tr>';
/* Moved to bank account data
@@ -179,8 +180,9 @@ print '</td></tr>';
//User
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("ResponsibleUser").'</td>';
print '<td class="left">';
print $form->select_dolusers($conf->global->PRELEVEMENT_USER, 'PRELEVEMENT_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '<td>';
print img_picto('', 'user', 'class="pictofixedwidth"');
print $form->select_dolusers($conf->global->PRELEVEMENT_USER, 'PRELEVEMENT_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'minwidth200 maxwidth500');
print '</td>';
print '</tr>';
@@ -189,8 +191,8 @@ print '<tr class="oddeven"><td>';
$htmltext = $langs->trans("KeepThisEmptyInMostCases");
print $form->textwithpicto($langs->trans("END_TO_END"), $htmltext);
print '</td>';
print '<td class="left">';
print '<input type="text" name="PRELEVEMENT_END_TO_END" value="'.$conf->global->PRELEVEMENT_END_TO_END.'" size="15" ></td>';
print '<td>';
print '<input type="text" name="PRELEVEMENT_END_TO_END" value="'.$conf->global->PRELEVEMENT_END_TO_END.'" class="width100"></td>';
print '</td></tr>';
//USTRD
@@ -199,16 +201,16 @@ $htmltext = $langs->trans("KeepThisEmptyInMostCases");
print $form->textwithpicto($langs->trans("USTRD"), $htmltext);
print '</td>';
print '<td class="left">';
print '<input type="text" name="PRELEVEMENT_USTRD" value="'.$conf->global->PRELEVEMENT_USTRD.'" size="15" ></td>';
print '<input type="text" name="PRELEVEMENT_USTRD" value="'.$conf->global->PRELEVEMENT_USTRD.'" class="width100"></td>';
print '</td></tr>';
//ADDDAYS
print '<tr class="oddeven"><td>'.$langs->trans("ADDDAYS").'</td>';
print '<td class="left">';
print '<td>';
if (empty($conf->global->PRELEVEMENT_ADDDAYS)) {
$conf->global->PRELEVEMENT_ADDDAYS = 0;
}
print '<input type="text" name="PRELEVEMENT_ADDDAYS" value="'.$conf->global->PRELEVEMENT_ADDDAYS.'" size="5" ></td>';
print '<input type="text" name="PRELEVEMENT_ADDDAYS" value="'.$conf->global->PRELEVEMENT_ADDDAYS.'" class="width50"></td>';
print '</td></tr>';
print '</table>';

View File

@@ -59,8 +59,10 @@ $specimenthirdparty->initAsSpecimen();
if ($action == 'updateMask') {
$maskconstinvoice = GETPOST('maskconstinvoice', 'alpha');
$maskconstcredit = GETPOST('maskconstcredit', 'alpha');
$maskconstdeposit = GETPOST('maskconstdeposit', 'alpha');
$maskinvoice = GETPOST('maskinvoice', 'alpha');
$maskcredit = GETPOST('maskcredit', 'alpha');
$maskdeposit = GETPOST('maskdeposit', 'alpha');
if ($maskconstinvoice) {
$res = dolibarr_set_const($db, $maskconstinvoice, $maskinvoice, 'chaine', 0, '', $conf->entity);
@@ -68,6 +70,9 @@ if ($action == 'updateMask') {
if ($maskconstcredit) {
$res = dolibarr_set_const($db, $maskconstcredit, $maskcredit, 'chaine', 0, '', $conf->entity);
}
if ($maskconstdeposit) {
$res = dolibarr_set_const($db, $maskconstdeposit, $maskdeposit, 'chaine', 0, '', $conf->entity);
}
if (!($res > 0)) {
$error++;

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2021 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
@@ -21,9 +21,13 @@
/**
* \file htdocs/admin/system/database-tables.php
* \brief Page with information on database tables
* \brief Page with information on database tables. Add also some maintenance action to convert tables.
*/
if (! defined('CSRFCHECK_WITH_TOKEN')) {
define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
}
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -126,14 +130,14 @@ if (!$base) {
print '</td>';
print '<td>'.$obj->Engine.'</td>';
if (isset($obj->Engine) && $obj->Engine == "MyISAM") {
print '<td><a class="reposition" href="database-tables.php?action=convert&amp;table='.$obj->Name.'">'.$langs->trans("Convert").' InnoDb</a></td>';
print '<td><a class="reposition" href="database-tables.php?action=convert&table='.urlencode($obj->Name).'&token='.newToken().'">'.$langs->trans("Convert").' InnoDb</a></td>';
} else {
print '<td>&nbsp;</td>';
}
print '<td>';
print $obj->Row_format;
if (isset($obj->Row_format) && (in_array($obj->Row_format, array("Compact")))) {
print '<br><a class="reposition" href="database-tables.php?action=convertdynamic&amp;table='.$obj->Name.'">'.$langs->trans("Convert").' Dynamic</a>';
print '<br><a class="reposition" href="database-tables.php?action=convertdynamic&table='.urlencode($obj->Name).'&token='.newToken().'">'.$langs->trans("Convert").' Dynamic</a>';
}
print '</td>';
print '<td align="right">'.$obj->Rows.'</td>';
@@ -145,7 +149,7 @@ if (!$base) {
print '<td align="right">'.$obj->Check_time.'</td>';
print '<td align="right">'.$obj->Collation;
if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "utf8mb4_unicode_ci", "latin1_swedish_ci")))) {
print '<br><a class="reposition" href="database-tables.php?action=convertutf8&amp;table='.$obj->Name.'">'.$langs->trans("Convert").' UTF8</a>';
print '<br><a class="reposition" href="database-tables.php?action=convertutf8&table='.urlencode($obj->Name).'&token='.newtoken().'">'.$langs->trans("Convert").' UTF8</a>';
}
print '</td>';
print '</tr>';

View File

@@ -51,7 +51,7 @@ if ($action == 'getlastversion') {
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
//var_dump($result['content']);
if (function_exists('simplexml_load_string')) {
$sfurl = simplexml_load_string($result['content']);
$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
} else {
setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors');
}
@@ -505,7 +505,7 @@ if ($resql) {
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td class="tdoverflowmax300">'.$obj->name.'</td>'."\n";
print '<td class="tdoverflowmax600" title="'.dol_escape_htmltag($obj->name).'">'.dol_escape_htmltag($obj->name).'</td>'."\n";
print '<td class="tdoverflowmax300">';
if (isASecretKey($obj->name)) {
if (empty($dolibarr_main_prod)) {

View File

@@ -171,7 +171,7 @@ if (GETPOST('target') == 'remote') {
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
$xmlfile = $xmlarray['content'];
//print "xmlfilestart".$xmlfile."xmlfileend";
$xml = simplexml_load_string($xmlfile);
$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
} else {
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
setEventMessages($errormsg, null, 'errors');

View File

@@ -63,7 +63,7 @@ print '<br>';
print '<strong>'.$langs->trans("XDebug").'</strong>: ';
$test = !function_exists('xdebug_is_enabled');
if ($test) {
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis");
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
} else {
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>';

View File

@@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
// Load translation files required by the page
$langs->loadLangs(array("install", "other", "admin"));
$langs->loadLangs(array("install", "other", "admin", "errors"));
if (!$user->admin) {
accessforbidden();
@@ -88,10 +88,20 @@ if (function_exists('exec')) {
}
print '<br>';
print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).' &nbsp; <span class="opacitymedium">'.$langs->trans("Deprecated")." (removed in PHP 5.4)</span><br>\n";
print "<strong>PHP session.use_strict_mode</strong> = ".(ini_get('session.use_strict_mode') ? ini_get('session.use_strict_mode') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.use_only_cookies</strong> = ".(ini_get('session.use_only_cookies') ? ini_get('session.use_only_cookies') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.cookie_httponly</strong> = ".(ini_get('session.cookie_httponly') ? ini_get('session.cookie_httponly') : '').' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? ini_get('session.cookie_samesite') : 'None');
if (!ini_get('session.cookie_samesite') || ini_get('session.cookie_samesite') == 'Lax') {
print ' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Lax').")</span>";
} elseif (ini_get('session.cookie_samesite') == 'Strict') {
print ' &nbsp; '.img_warning().' <span class="opacitymedium">'.$langs->trans("WarningPaypalPaymentNotCompatibleWithStrict")."</span>";
}
print "<br>\n";
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath").', '.$langs->transnoentitiesnoconv("Example").' '.$_SERVER["DOCUMENT_ROOT"]).')</span>')."<br>\n";
print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
//print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).' &nbsp; <span class="opacitymedium">'.$langs->trans("Deprecated")." (removed in PHP 5.4)</span><br>\n";
print "<strong>PHP disable_functions</strong> = ";
$arrayoffunctionsdisabled = explode(',', ini_get('disable_functions'));
$arrayoffunctionstodisable = explode(',', 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals');
@@ -198,6 +208,7 @@ if (empty($fileswithwritepermission)) {
}
}
print '<br>';
print '<br>';
print '<strong>'.$langs->trans("PermissionsOnFile", $conffile).'</strong>: '; // $conffile is defined into filefunc.inc.php
$perms = fileperms($dolibarr_main_document_root.'/'.$conffile);
@@ -219,6 +230,16 @@ if ($perms) {
print img_warning().' '.$langs->trans("FailedToReadFile", $conffile);
}
print '<br>';
print '<br>';
$installlock = DOL_DATA_ROOT.'/install.lock';
print '<strong>'.$langs->trans("DolibarrSetup").'</strong>: ';
if (file_exists($installlock)) {
print img_picto('', 'tick').' '.$langs->trans("InstallAndUpgradeLockedBy", $installlock);
} else {
print img_warning().' '.$langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT);
}
print '<br>';
// File conf.php
@@ -234,7 +255,7 @@ if (empty($dolibarr_main_prod)) {
}
print '<br>';
print '<strong>$dolibarr_nocsrfcheck</strong>: '.$dolibarr_nocsrfcheck;
print '<strong>$dolibarr_nocsrfcheck</strong>: '.(empty($dolibarr_nocsrfcheck) ? '0' : $dolibarr_nocsrfcheck);
if (!empty($dolibarr_nocsrfcheck)) {
print ' &nbsp; '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0);
}
@@ -335,7 +356,7 @@ if (empty($conf->global->MAIN_SECURITY_HASH_ALGO)) {
if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
print '<br><strong>MAIN_SECURITY_SALT</strong> = '.(empty($conf->global->MAIN_SECURITY_SALT) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_SALT).'<br>';
} else {
print '<span class="opacitymedium">('.$langs->trans("Recommanded").': password_hash)</span>';
print '<span class="opacitymedium">('.$langs->trans("Recommended").': password_hash)</span>';
print '<br>';
}
if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
@@ -348,16 +369,19 @@ if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
}
print '<br>';
print '<strong>MAIN_SECURITY_ANTI_SSRF_SERVER_IP</strong> = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span> &nbsp; <span class="opacitymedium">('.$langs->trans("Example").': static-ips-of-server - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added)</span>' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."<br>";
print '<strong>MAIN_SECURITY_ANTI_SSRF_SERVER_IP</strong> = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span> &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': List of static IPs of server separated with coma - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added)</span>' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."<br>";
print '<br>';
print '<strong>MAIN_ALLOW_SVG_FILES_AS_IMAGES</strong> = '.(empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES) ? '0 &nbsp; <span class="opacitymedium">('.$langs->trans("Recommanded").': 0)</span>' : $conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES)."<br>";
print '<strong>MAIN_ALLOW_SVG_FILES_AS_IMAGES</strong> = '.(empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES) ? '0' : $conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES).' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 0)</span><br>';
print '<br>';
print '<strong>MAIN_RESTRICTHTML_ONLY_VALID_HTML</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommanded").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)."<br>";
print '<strong>MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE</strong> = '.(empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE).' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 1)</span><br>';
print '<br>';
print '<strong>MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommanded").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."<br>";
print '<strong>MAIN_RESTRICTHTML_ONLY_VALID_HTML</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)."<br>";
print '<br>';
print '<strong>MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."<br>";
print '<br>';
print '<strong>MAIN_EXEC_USE_POPEN</strong> = ';
@@ -367,10 +391,14 @@ if (empty($conf->global->MAIN_EXEC_USE_POPEN)) {
print $conf->global->MAIN_EXEC_USE_POPEN;
}
if ($execmethod == 1) {
print ' &nbsp; <span class="opacitymedium">("exec" PHP method will be used for shell commands)</span>';
print '<span class="opacitymedium">, "exec" PHP method will be used for shell commands';
print ' &nbsp; ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)';
print '</span>';
}
if ($execmethod == 2) {
print ' &nbsp; <span class="opacitymedium">("popen" PHP method will be used for shell commands)</span>';
print '<span class="opacitymedium">, "popen" PHP method will be used for shell commands';
print ' &nbsp; ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)';
print '</span>';
}
print "<br>";
print '<br>';

View File

@@ -136,7 +136,7 @@ $title = $langs->trans("Backup");
print load_fiche_titre($title, '', 'title_setup');
//print_barre_liste($langs->trans("Backup"), '', '', '', '', '', $langs->trans("BackupDesc",DOL_DATA_ROOT), 0, 0, 'title_setup');
print '<div class="center opacitymedium">';
print '<div class="center">';
print $langs->trans("BackupDesc", DOL_DATA_ROOT);
print '</div>';
print '<br>';
@@ -147,8 +147,11 @@ print '<input type="hidden" name="token" value="'.newToken().'" />';
print '<input type="hidden" name="export_type" value="server" />';
print '<fieldset id="fieldsetexport"><legend class="legendforfieldsetstep" style="font-size: 3em">1</legend>';
print '<span class="opacitymedium">';
print $langs->trans("BackupDesc3", $dolibarr_main_db_name).'<br>';
//print $langs->trans("BackupDescY").'<br>';
print '</span>';
print '<br>';
print '<div id="backupdatabaseleft" class="fichehalfleft" >';
@@ -157,7 +160,7 @@ $title = $langs->trans("BackupDumpWizard");
print load_fiche_titre($title);
print '<table width="100%" class="'.(!empty($useinecm) ? 'nobordernopadding' : 'liste').' nohover">';
print '<table class="'.(!empty($useinecm) ? 'nobordernopadding' : 'liste noborderbottom').' nohover centpercent">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b><br>';
@@ -554,8 +557,10 @@ print '<input type="hidden" name="page_y" value="" />';
print '<fieldset><legend class="legendforfieldsetstep" style="font-size: 3em">2</legend>';
print '<span class="opacitymedium">';
print $langs->trans("BackupDesc2", DOL_DATA_ROOT).'<br>';
print $langs->trans("BackupDescX").'<br><br>';
print '</span>';
print '<div id="backupfilesleft" class="fichehalfleft">';

View File

@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2006-2021 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@inodbox.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -22,6 +22,10 @@
* \brief Page to import database
*/
if (! defined('CSRFCHECK_WITH_TOKEN')) {
define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
}
require '../../main.inc.php';
// Load translation files required by the page
@@ -72,7 +76,7 @@ jQuery(document).ready(function() {
print load_fiche_titre($langs->trans("Restore"), '', 'title_setup');
print '<div class="center opacitymedium">';
print '<div class="center">';
print $langs->trans("RestoreDesc", DOL_DATA_ROOT);
print '</div>';
print '<br>';
@@ -81,7 +85,9 @@ print '<br>';
<fieldset>
<legend style="font-size: 3em">1</legend>
<?php
print '<span class="opacitymedium">';
print $langs->trans("RestoreDesc2", DOL_DATA_ROOT).'<br><br>';
print '</span>';
?>
</fieldset>
@@ -90,7 +96,9 @@ print $langs->trans("RestoreDesc2", DOL_DATA_ROOT).'<br><br>';
<fieldset>
<legend style="font-size: 3em">2</legend>
<?php
print '<span class="opacitymedium">';
print $langs->trans("RestoreDesc3", $dolibarr_main_db_name).'<br><br>';
print '</span>';
?>
<?php print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b>'; ?><br><br>

View File

@@ -22,6 +22,10 @@
* \brief Page to export documents into a compressed file
*/
if (! defined('CSRFCHECK_WITH_TOKEN')) {
define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
}
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';

View File

@@ -22,9 +22,14 @@
* \brief List of PHP sessions
*/
if (! defined('CSRFCHECK_WITH_TOKEN')) {
define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
}
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("companies", "install", "users", "other"));
@@ -185,14 +190,14 @@ print '<div class="tabsAction">';
if (empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=lock">'.$langs->trans("LockNewSessions").'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=lock&token='.newToken().'">'.$langs->trans("LockNewSessions").'</a>';
} else {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=confirm_unlock">'.$langs->trans("UnlockNewSessions").'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=confirm_unlock&token='.newToken().'">'.$langs->trans("UnlockNewSessions").'</a>';
}
if ($savehandler == 'files') {
if (count($listofsessions)) {
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=purge">'.$langs->trans("PurgeSessions").'</a>';
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=purge&token='.newToken().'">'.$langs->trans("PurgeSessions").'</a>';
}
}

View File

@@ -21,15 +21,15 @@
* \brief Page to purge files (temporary or not)
*/
if (! defined('CSRFCHECK_WITH_TOKEN')) {
define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
}
require '../../main.inc.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$langs->load("admin");
if (!$user->admin) {
accessforbidden();
}
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$choice = GETPOST('choice', 'aZ09');
@@ -42,10 +42,15 @@ if (!empty($conf->syslog->enabled)) {
$filelog = preg_replace('/DOL_DATA_ROOT/i', DOL_DATA_ROOT, $filelog);
}
if (!$user->admin) {
accessforbidden();
}
/*
* Actions
*/
if ($action == 'purge' && !preg_match('/^confirm/i', $choice) && ($choice != 'allfiles' || $confirm == 'yes')) {
// Increase limit of time. Works only if we are not in safe mode
$ExecTimeLimit = 600;
@@ -105,7 +110,7 @@ if (!empty($conf->syslog->enabled)) {
print '<input type="radio" name="choice" id="choicetempfiles" value="tempfiles"';
print (!$choice || $choice == 'tempfiles' || $choice == 'allfiles') ? ' checked' : '';
print '> <label for="choicetempfiles">'.$langs->trans("PurgeDeleteTemporaryFiles").'</label><br><br>';
print '> <label for="choicetempfiles">'.$langs->trans("PurgeDeleteTemporaryFilesShort").'</label><br><br>';
print '<input type="radio" name="choice" id="choiceallfiles" value="confirm_allfiles"';
print ($choice && $choice == 'confirm_allfiles') ? ' checked' : '';

View File

@@ -22,6 +22,10 @@
* \brief Page to make a Dolibarr online upgrade
*/
if (! defined('CSRFCHECK_WITH_TOKEN')) {
define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
}
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -57,7 +61,7 @@ $version = '0.0';
if ($action == 'getlastversion') {
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
//var_dump($result['content']);
$sfurl = simplexml_load_string($result['content']);
$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
}
@@ -100,7 +104,7 @@ if (function_exists('curl_init')) {
print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("UpdateServerOffline").'</b><br>';
}
} else {
print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion" class="button">'.$langs->trans("Check").'</a><br>';
print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion&token='.newToken().'" class="button smallpaddingimp">'.$langs->trans("Check").'</a><br>';
}
}
@@ -113,14 +117,14 @@ print '<hr>';
print $langs->trans("ThisIsProcessToFollow").'<br>';
print '<b>'.$langs->trans("StepNb", 1).'</b>: ';
$fullurl = '<a href="'.$urldolibarr.'" target="_blank">'.$urldolibarr.'</a>';
print $langs->trans("DownloadPackageFromWebSite", $fullurl).'<br>';
print str_replace('{s}', $fullurl, $langs->trans("DownloadPackageFromWebSite", '{s}')).'<br>';
print '<b>'.$langs->trans("StepNb", 2).'</b>: ';
print $langs->trans("UnpackPackageInDolibarrRoot", $dolibarrroot).'<br>';
print str_replace('{s}', $dolibarrroot, $langs->trans("UnpackPackageInDolibarrRoot", '{s}')).'<br>';
print '<b>'.$langs->trans("StepNb", 3).'</b>: ';
print $langs->trans("RemoveLock", $dolibarrdataroot.'/install.lock').'<br>';
print '<b>'.$langs->trans("StepNb", 4).'</b>: ';
$fullurl = '<a href="'.DOL_URL_ROOT.'/install/" target="_blank">'.DOL_URL_ROOT.'/install/</a>';
print $langs->trans("CallUpdatePage", $fullurl).'<br>';
print str_replace('{s}', $fullurl, $langs->trans("CallUpdatePage", '{s}')).'<br>';
print '<b>'.$langs->trans("StepNb", 5).'</b>: ';
print $langs->trans("RestoreLock", $dolibarrdataroot.'/install.lock').'<br>';
@@ -133,8 +137,9 @@ print '<br>';
print $langs->trans("AddExtensionThemeModuleOrOther").'<br>';
print '<hr>';
print $langs->trans("GoModuleSetupArea", DOL_URL_ROOT.'/admin/modules.php?mode=deploy', $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Modules"));
$texttoshow = $langs->trans("GoModuleSetupArea", DOL_URL_ROOT.'/admin/modules.php?mode=deploy', '{s2}');
$texttoshow = str_replace('{s2}', img_picto('', 'tools', 'class="pictofixedwidth"').$langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Modules"), $texttoshow);
print $texttoshow;
// End of page
llxFooter();

View File

@@ -37,6 +37,7 @@ if (!$user->admin) {
$id = GETPOST('rowid', 'int');
$action = GETPOST('action', 'aZ09');
$optioncss = GETPOST('optionscss', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ09');
$langcode = GETPOST('langcode', 'alphanohtml');
$transkey = GETPOST('transkey', 'alphanohtml');
@@ -458,18 +459,8 @@ if ($mode == 'searchkey') {
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder);
print '<td align="center"></td>';
print "</tr>\n";
// Line to search new record
print "\n";
print '<tr class="oddeven"><td>';
print '<tr class="liste_titre_filter"><td>';
//print $formadmin->select_language($langcode,'langcode',0,null,$langs->trans("All"),0,0,'',1);
print $formadmin->select_language($langcode, 'langcode', 0, null, 0, 0, 0, 'maxwidth250', 1);
print '</td>'."\n";
@@ -495,6 +486,15 @@ if ($mode == 'searchkey') {
print '</td>';
print '</tr>';
print '<tr class="liste_titre">';
print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder);
print '<td align="center"></td>';
print "</tr>\n";
if ($sortfield == 'transkey' && strtolower($sortorder) == 'asc') {
ksort($recordtoshow);
}
@@ -541,7 +541,7 @@ if ($mode == 'searchkey') {
print $form->textwithpicto('', $htmltext, 1, 'info');
} elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) {
//print $key.'-'.$val;
print '<a class="reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&langcode='.urlencode($langcode).'&transkey='.urlencode($key).'">'.img_edit_add($langs->trans("Overwrite")).'</a>';
print '<a class="reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&langcode='.urlencode($langcode).'&transkey='.urlencode($key).'">'.img_edit_add($langs->trans("TranslationOverwriteKey")).'</a>';
}
if (!empty($conf->global->MAIN_FEATURES_LEVEL)) {

View File

@@ -80,7 +80,7 @@ class DolibarrApiAccess implements iAuthenticate
public function __isAllowed()
{
// phpcs:enable
global $conf, $db;
global $conf, $db, $user;
$login = '';
$stored_key = '';
@@ -147,8 +147,13 @@ class DolibarrApiAccess implements iAuthenticate
if ($result <= 0) {
throw new RestException(503, 'Error when fetching user :'.$fuser->error.' (conf->entity='.$conf->entity.')');
}
$fuser->getrights();
// Set the property $user to the $user of API
static::$user = $fuser;
// Set also the global variable $user to the $user of API
$user = $fuser;
if ($fuser->socid) {
static::$role = 'external';

View File

@@ -504,7 +504,7 @@ class Documents extends DolibarrApi
* Test sample for medias file: { "filename": "mynewfile.txt", "modulepart": "medias", "ref": "", "subdir": "image/mywebsite", "filecontent": "Y29udGVudCB0ZXh0Cg==", "fileencoding": "base64", "overwriteifexists": "0" }.
*
* @param string $filename Name of file to create ('FA1705-0123.txt')
* @param string $modulepart Name of module or area concerned by file upload ('facture', 'project', 'project_task', ...)
* @param string $modulepart Name of module or area concerned by file upload ('product', 'service', 'invoice', 'proposal', 'project', 'project_task', 'supplier_invoice', 'expensereport', 'member', ...)
* @param string $ref Reference of object (This will define subdir automatically and store submited file into it)
* @param string $subdir Subdirectory (Only if ref not provided)
* @param string $filecontent File content (string with file content. An empty file will be created if this parameter is not provided)

View File

@@ -1683,7 +1683,7 @@ class Setup extends DolibarrApi
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
$xmlfile = $xmlarray['content'];
//print "xmlfilestart".$xmlfile."endxmlfile";
$xml = simplexml_load_string($xmlfile);
$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
} else {
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
throw new RestException(500, $errormsg);

View File

@@ -389,7 +389,7 @@ if ($action == 'create') {
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook)) {
print $object->showOptionals($extrafields, 'edit', $parameters);
print $object->showOptionals($extrafields, 'create', $parameters);
}
print '<tbody>';
print "</table>\n";

View File

@@ -79,7 +79,10 @@ $form = new Form($db);
$block_static = new BlockedLog($db);
$block_static->loadTrackedEvents();
llxHeader('', $langs->trans("BlockedLogSetup"));
$title = $langs->trans("BlockedLogSetup");
$help_url="EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable";
llxHeader('', $title, $help_url);
$linkback = '';
if ($withtab) {

View File

@@ -275,8 +275,9 @@ if (GETPOST('withtab', 'alpha')) {
} else {
$title = $langs->trans("BrowseBlockedLog");
}
$help_url="EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable";
llxHeader('', $langs->trans("BrowseBlockedLog"));
llxHeader('', $title, $help_url);
$MAXLINES = 10000;

View File

@@ -17,9 +17,9 @@
*/
/**
* \file htdocs/blockedlog/ajax/block-info.php
* \file htdocs/blockedlog/ajax/check_signature.php
* \ingroup blockedlog
* \brief block-info
* \brief This page is not used yet.
*/
@@ -38,13 +38,15 @@ if (!defined('NOREQUIREHTML')) {
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/authority.class.php';
if (empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
exit('BLOCKEDLOG_AUTHORITY_URL not set');
}
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/authority.class.php';
$auth = new BlockedLogAuthority($db);
$auth->syncSignatureWithAuthority();
@@ -63,8 +65,11 @@ if (is_array($bocks)) {
$hash = $auth->getBlockchainHash();
$url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.$auth->signature.'&h='.$hash;
// Call external authority
$url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.urlencode($auth->signature).'&h='.urlencode($hash);
$resarray = getURLContent($url, 'GET', '', 1, array(), array(), 2);
$res = $resarray['content'];
$res = file_get_contents($url);
//echo $url;
echo $res;
echo dol_escape_htmltag($res);

View File

@@ -71,6 +71,10 @@ if (empty($action) && empty($id) && empty($ref)) {
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
if ($object->id > 0) {
$object->calculateCosts();
}
// Security check - Protection if external user
//if ($user->socid > 0) accessforbidden();
@@ -112,8 +116,13 @@ if (empty($reshook)) {
$triggermodname = 'BOM_MODIFY'; // Name of trigger action code to execute when we modify record
// Actions cancel, add, update, delete or clone
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
// The fetch/fetch_lines was redone into the inc.php so we must recall the calculateCosts()
if ($action == 'confirm_validate' && $object->id > 0) {
$object->calculateCosts();
}
// Actions when linking object each other
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
@@ -311,8 +320,6 @@ if (($id || $ref) && $action == 'edit') {
// Part to show record
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
$res = $object->fetch_optionals();
$head = bomPrepareHead($object);
print dol_get_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom');

View File

@@ -297,7 +297,7 @@ $sql .= $object->getFieldList('t');
// Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : '');
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.' ' : '');
}
}
// Add fields from hooks
@@ -325,7 +325,7 @@ foreach ($search as $key => $val) {
}
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
if ($search[$key] == '-1' || $search[$key] === '0') {
if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
$search[$key] = '';
}
$mode_search = 2;

View File

@@ -98,7 +98,7 @@ class BOM extends CommonObject
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1, 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'),
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'),
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth175', 'csslist'=>'minwidth175 center'),
//'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')),
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax100'),
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
@@ -381,7 +381,7 @@ class BOM extends CommonObject
if ($result > 0 && !empty($this->table_element_line)) {
$this->fetchLines();
}
$this->calculateCosts();
//$this->calculateCosts(); // This consume a high number of subrequests. Do not call it into fetch but when you need it.
return $result;
}
@@ -431,13 +431,13 @@ class BOM extends CommonObject
if (count($filter) > 0) {
foreach ($filter as $key => $value) {
if ($key == 't.rowid') {
$sqlwhere[] = $key.'='.$value;
$sqlwhere[] = $key.' = '.((int) $value);
} elseif (strpos($key, 'date') !== false) {
$sqlwhere[] = $key.' = \''.$this->db->idate($value).'\'';
$sqlwhere[] = $key." = '".$this->db->idate($value)."'";
} elseif ($key == 'customsql') {
$sqlwhere[] = $value;
} else {
$sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\'';
$sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'";
}
}
}
@@ -946,7 +946,7 @@ class BOM extends CommonObject
$this->lines = array();
$objectline = new BOMLine($this->db);
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.$this->id));
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.((int) $this->id)));
if (is_numeric($result)) {
$this->error = $this->error;
@@ -1035,7 +1035,8 @@ class BOM extends CommonObject
}
/**
* BOM costs calculation based on cost_price or pmp of each BOM line
* BOM costs calculation based on cost_price or pmp of each BOM line.
* Set the property ->total_cost and ->unit_cost of BOM.
*
* @return void
*/
@@ -1045,30 +1046,36 @@ class BOM extends CommonObject
$this->unit_cost = 0;
$this->total_cost = 0;
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$productFournisseur = new ProductFournisseur($this->db);
foreach ($this->lines as &$line) {
if (is_array($this->lines) && count($this->lines)) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$productFournisseur = new ProductFournisseur($this->db);
$tmpproduct = new Product($this->db);
$result = $tmpproduct->fetch($line->fk_product);
if ($result < 0) {
$this->error = $tmpproduct->error;
return -1;
}
$line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);
if (empty($line->unit_cost)) {
if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) {
$line->unit_cost = $productFournisseur->fourn_unitprice;
foreach ($this->lines as &$line) {
$tmpproduct->cost_price = 0;
$tmpproduct->pmp = 0;
$result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading
if ($result < 0) {
$this->error = $tmpproduct->error;
return -1;
}
$line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);
if (empty($line->unit_cost)) {
if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) {
$line->unit_cost = $productFournisseur->fourn_unitprice;
}
}
$line->total_cost = price2num($line->qty * $line->unit_cost, 'MT');
$this->total_cost += $line->total_cost;
}
$line->total_cost = price2num($line->qty * $line->unit_cost, 'MT');
$this->total_cost += $line->total_cost;
}
$this->total_cost = price2num($this->total_cost, 'MT');
if ($this->qty) {
$this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
$this->total_cost = price2num($this->total_cost, 'MT');
if ($this->qty) {
$this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
}
}
}
}

View File

@@ -54,7 +54,9 @@ function bomAdminPrepareHead()
//$this->tabs = array(
// 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__'
//); // to remove a tab
complete_head_from_modules($conf, $langs, null, $head, $h, 'bom');
complete_head_from_modules($conf, $langs, null, $head, $h, 'bom@mrp');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom@mrp', 'remove');
return $head;
}

View File

@@ -72,10 +72,12 @@ function printDropdownBookmarksList()
// Url to go on create new bookmark page
$newbtn = '';
if (!empty($user->rights->bookmark->creer)) {
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;urlsource='.urlencode($url).'&amp;url='.urlencode($url);
$urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;url='.urlencode($url);
$newbtn .= '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.dol_escape_htmltag($urltoadd).'" >';
$newbtn .= img_picto('', 'add', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'</a>';
if (!preg_match('/bookmarks\/card.php/', $_SERVER['PHP_SELF'])) {
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;urlsource='.urlencode($url).'&amp;url='.urlencode($url);
$urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;url='.urlencode($url);
$newbtn .= '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.dol_escape_htmltag($urltoadd).'" >';
$newbtn .= img_picto('', 'add', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'</a>';
}
}
// Menu with list of bookmarks
@@ -105,9 +107,11 @@ function printDropdownBookmarksList()
$searchForm .= dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...</option>';
// Url to go on create new bookmark page
if (!empty($user->rights->bookmark->creer)) {
$urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;url='.urlencode($url);
$searchForm .= '<option value="newbookmark" class="optionblue" rel="'.dol_escape_htmltag($urltoadd).'"';
$searchForm .= ' data-html="'.dol_escape_htmltag(img_picto('', 'bookmark').' '.$langs->trans('AddThisPageToBookmarks').'...').'">'.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks').'...').'</option>';
if (!preg_match('/bookmarks\/card.php/', $_SERVER['PHP_SELF'])) {
$urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;url='.urlencode($url);
$searchForm .= '<option value="newbookmark" class="optionblue" rel="'.dol_escape_htmltag($urltoadd).'"';
$searchForm .= ' data-html="'.dol_escape_htmltag(img_picto('', 'bookmark').' '.$langs->trans('AddThisPageToBookmarks').'...').'">'.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks').'...').'</option>';
}
}
$i = 0;
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {

View File

@@ -266,7 +266,7 @@ if ($user->rights->categorie->creer) {
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook)) {
print $object->showOptionals($extrafields, 'edit', $parameters);
print $object->showOptionals($extrafields, 'create', $parameters);
}
print '</table>';

View File

@@ -540,7 +540,7 @@ class Categorie extends CommonObject
$sql .= ", visible = ".(int) $this->visible;
$sql .= ", fk_parent = ".(int) $this->fk_parent;
$sql .= ", fk_user_modif = ".(int) $user->id;
$sql .= " WHERE rowid = ".$this->id;
$sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
if ($this->db->query($sql)) {
@@ -686,7 +686,7 @@ class Categorie extends CommonObject
if ($this->db->query($sql)) {
if (!empty($conf->global->CATEGORIE_RECURSIV_ADD)) {
$sql = 'SELECT fk_parent FROM '.MAIN_DB_PREFIX.'categorie';
$sql .= " WHERE rowid = ".$this->id;
$sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::add_type", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -774,7 +774,7 @@ class Categorie extends CommonObject
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type]);
$sql .= " WHERE fk_categorie = ".$this->id;
$sql .= " WHERE fk_categorie = ".((int) $this->id);
$sql .= " AND fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".((int) $obj->id);
dol_syslog(get_class($this).'::del_type', LOG_DEBUG);
@@ -826,11 +826,11 @@ class Categorie extends CommonObject
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type])." as c";
$sql .= ", ".MAIN_DB_PREFIX.(empty($this->MAP_OBJ_TABLE[$type]) ? $type : $this->MAP_OBJ_TABLE[$type])." as o";
$sql .= " WHERE o.entity IN (".getEntity($obj->element).")";
$sql .= " AND c.fk_categorie = ".$this->id;
$sql .= " AND c.fk_categorie = ".((int) $this->id);
$sql .= " AND c.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = o.rowid";
// Protection for external users
if (($type == 'customer' || $type == 'supplier') && $user->socid > 0) {
$sql .= " AND o.rowid = ".$user->socid;
$sql .= " AND o.rowid = ".((int) $user->socid);
}
if ($limit > 0 || $offset > 0) {
$sql .= $this->db->plimit($limit + 1, $offset);
@@ -870,7 +870,7 @@ class Categorie extends CommonObject
public function containsObject($type, $object_id)
{
$sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type]);
$sql .= " WHERE fk_categorie = ".$this->id." AND fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".((int) $object_id);
$sql .= " WHERE fk_categorie = ".((int) $this->id)." AND fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".((int) $object_id);
dol_syslog(get_class($this)."::containsObject", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
@@ -1501,7 +1501,7 @@ class Categorie extends CommonObject
$sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".(int) $id;
// This seems useless because the table already contains id of category of 1 unique type. So commented.
// So now it works also with external added categories.
//$sql .= " AND c.type = ".$this->MAP_ID[$type];
//$sql .= " AND c.type = ".((int) $this->MAP_ID[$type]);
$sql .= " AND c.entity IN (".getEntity('category').")";
$res = $this->db->query($sql);
@@ -1796,7 +1796,7 @@ class Categorie extends CommonObject
foreach ($langs_available as $key => $value) {
$sql = "SELECT rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_lang";
$sql .= " WHERE fk_category=".$this->id;
$sql .= " WHERE fk_category=".((int) $this->id);
$sql .= " AND lang = '".$this->db->escape($key)."'";
$result = $this->db->query($sql);
@@ -1806,10 +1806,10 @@ class Categorie extends CommonObject
$sql2 = "UPDATE ".MAIN_DB_PREFIX."categorie_lang";
$sql2 .= " SET label='".$this->db->escape($this->label)."',";
$sql2 .= " description='".$this->db->escape($this->description)."'";
$sql2 .= " WHERE fk_category=".$this->id." AND lang='".$this->db->escape($key)."'";
$sql2 .= " WHERE fk_category=".((int) $this->id)." AND lang='".$this->db->escape($key)."'";
} else {
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."categorie_lang (fk_category, lang, label, description)";
$sql2 .= " VALUES(".$this->id.",'".$key."','".$this->db->escape($this->label);
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label);
$sql2 .= "','".$this->db->escape($this->multilangs["$key"]["description"])."')";
}
dol_syslog(get_class($this).'::setMultiLangs', LOG_DEBUG);
@@ -1822,10 +1822,10 @@ class Categorie extends CommonObject
$sql2 = "UPDATE ".MAIN_DB_PREFIX."categorie_lang";
$sql2 .= " SET label='".$this->db->escape($this->multilangs["$key"]["label"])."',";
$sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'";
$sql2 .= " WHERE fk_category=".$this->id." AND lang='".$this->db->escape($key)."'";
$sql2 .= " WHERE fk_category=".((int) $this->id)." AND lang='".$this->db->escape($key)."'";
} else {
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."categorie_lang (fk_category, lang, label, description)";
$sql2 .= " VALUES(".$this->id.",'".$key."','".$this->db->escape($this->multilangs["$key"]["label"]);
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"]);
$sql2 .= "','".$this->db->escape($this->multilangs["$key"]["description"])."')";
}
@@ -1864,7 +1864,7 @@ class Categorie extends CommonObject
$sql = "SELECT lang, label, description";
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_lang";
$sql .= " WHERE fk_category=".$this->id;
$sql .= " WHERE fk_category=".((int) $this->id);
$result = $this->db->query($sql);
if ($result) {

View File

@@ -205,10 +205,14 @@ foreach ($fulltree as $key => $val) {
$entry .= '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'">'.img_view().'</a>';
$entry .= '</td>';
$entry .= '<td class="right" width="20px;">';
$entry .= '<a class="editfielda" href="'.DOL_URL_ROOT.'/categories/edit.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'">'.img_edit().'</a>';
if ($user->rights->categorie->creer) {
$entry .= '<a class="editfielda" href="' . DOL_URL_ROOT . '/categories/edit.php?id=' . $val['id'] . '&type=' . $type . $moreparam . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type) . '">' . img_edit() . '</a>';
}
$entry .= '</td>';
$entry .= '<td class="right" width="20px;">';
$entry .= '<a class="deletefilelink" href="'.DOL_URL_ROOT.'/categories/viewcat.php?action=delete&token='.newToken().'&id='.$val['id'].'&type='.$type.$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'">'.img_delete().'</a>';
if ($user->rights->categorie->supprimer) {
$entry .= '<a class="deletefilelink" href="' . DOL_URL_ROOT . '/categories/viewcat.php?action=delete&token=' . newToken() . '&id=' . $val['id'] . '&type=' . $type . $moreparam . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type . $moreparam) . '&backtolist=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type . $moreparam) . '">' . img_delete() . '</a>';
}
$entry .= '</td>';
$entry .= '</tr>';

View File

@@ -70,9 +70,18 @@ $offsetvalue = GETPOST('offsetvalue', 'int');
$offsetunit = GETPOST('offsetunittype_duration', 'aZ09');
$remindertype = GETPOST('selectremindertype', 'aZ09');
$modelmail = GETPOST('actioncommsendmodel_mail', 'int');
$complete = GETPOST('complete', 'alpha'); // 'na' must be allowed
if ($complete == 'na' || $complete == -2) {
$complete = -1;
}
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
if ($fulldayevent) {
$datep = dol_mktime('00', '00', 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
$datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
} else {
$datep = dol_mktime($aphour, $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
$datef = dol_mktime($p2hour, $p2min, '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
}
// Security check
$socid = GETPOST('socid', 'int');
@@ -240,7 +249,7 @@ if (empty($reshook) && $action == 'add') {
exit;
}
$percentage = in_array(GETPOST('status'), array(-1, 100)) ?GETPOST('status') : (in_array(GETPOST('complete'), array(-1, 100)) ?GETPOST('complete') : GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
$percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status
// Clean parameters
$datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser');
@@ -471,7 +480,7 @@ if (empty($reshook) && $action == 'update') {
$apmin = GETPOST('apmin', 'int');
$p2hour = GETPOST('p2hour', 'int');
$p2min = GETPOST('p2min', 'int');
$percentage = in_array(GETPOST('status'), array(-1, 100)) ?GETPOST('status') : (in_array(GETPOST('complete'), array(-1, 100)) ?GETPOST('complete') : GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
$percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status
// Clean parameters
if ($aphour == -1) {
@@ -1074,15 +1083,15 @@ if ($action == 'create') {
// Status
print '<tr><td>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td>';
print '<td>';
$percent = GETPOST('complete')!=='' ? GETPOST('complete') : -1;
$percent = $complete !=='' ? $complete : -1;
if (GETPOSTISSET('status')) {
$percent = GETPOST('status');
} elseif (GETPOSTISSET('percentage')) {
$percent = GETPOST('percentage');
$percent = GETPOST('percentage', 'int');
} else {
if (GETPOST('complete') == '0' || GETPOST("afaire") == 1) {
if ($complete == '0' || GETPOST("afaire") == 1) {
$percent = '0';
} elseif (GETPOST('complete') == 100 || GETPOST("afaire") == 2) {
} elseif ($complete == 100 || GETPOST("afaire") == 2) {
$percent = 100;
}
}
@@ -1222,12 +1231,16 @@ if ($action == 'create') {
// Object linked
if (!empty($origin) && !empty($originid)) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
print '<tr><td class="titlefieldcreate">'.$langs->trans("LinkedObject").'</td>';
print '<td colspan="3">'.dolGetElementUrl($originid, $origin, 1).'</td></tr>';
print '<input type="hidden" name="fk_element" value="'.GETPOST('originid', 'int').'">';
print '<input type="hidden" name="elementtype" value="'.GETPOST('origin').'">';
print '<input type="hidden" name="originid" value="'.GETPOST('originid', 'int').'">';
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
if (! in_array($origin, array('societe', 'project', 'task', 'user'))) {
// We do not use link for object that already contains a hard coded
print '<tr><td class="titlefieldcreate">'.$langs->trans("LinkedObject").'</td>';
print '<td colspan="3">'.dolGetElementUrl($originid, $origin, 1).'</td></tr>';
print '<input type="hidden" name="fk_element" value="'.GETPOST('originid', 'int').'">';
print '<input type="hidden" name="elementtype" value="'.GETPOST('origin').'">';
print '<input type="hidden" name="originid" value="'.GETPOST('originid', 'int').'">';
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
}
}
$reg = array();
@@ -1254,7 +1267,7 @@ if ($action == 'create') {
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook)) {
print $object->showOptionals($extrafields, 'edit', $parameters);
print $object->showOptionals($extrafields, 'create', $parameters);
}
print '</table>';
@@ -1348,7 +1361,7 @@ if ($id > 0) {
$result5 = $object->fetch_optionals();
if ($listUserAssignedUpdated || $donotclearsession) {
$percentage = in_array(GETPOST('status'), array(-1, 100)) ?GETPOST('status') : (in_array(GETPOST('complete'), array(-1, 100)) ?GETPOST('complete') : GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
$percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser');
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser');
@@ -1542,7 +1555,7 @@ if ($id > 0) {
// Status
print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3">';
$percent = GETPOST("percentage") ? GETPOST("percentage") : $object->percentage;
$percent = GETPOSTISSET("percentage") ? GETPOST("percentage", "int") : $object->percentage;
$formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200');
print '</td></tr>';

View File

@@ -585,12 +585,15 @@ class ActionComm extends CommonObject
//dol_syslog(var_export($this->userassigned, true));
$already_inserted = array();
foreach ($this->userassigned as $key => $val) {
if (!is_array($val)) { // For backward compatibility when val=id
// 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);
}
if ($val['id'] > 0) {
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(".$this->id.", 'user', ".$val['id'].", ".(empty($val['mandatory']) ? '0' : $val['mandatory']).", ".(empty($val['transparency']) ? '0' : $val['transparency']).", ".(empty($val['answer_status']) ? '0' : $val['answer_status']).")";
@@ -612,7 +615,10 @@ class ActionComm extends CommonObject
if (!empty($this->socpeopleassigned)) {
$already_inserted = array();
foreach ($this->socpeopleassigned as $id => $val) {
if (!empty($already_inserted[$val['id']])) continue;
// Common value with new behavior is to have $val = iduser and $this->socpeopleassigned is an array of iduser => $val.
if (!empty($already_inserted[$id])) {
continue;
}
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
$sql .= " VALUES(".$this->id.", 'socpeople', ".$id.", 0, 0, 0)";
@@ -623,7 +629,7 @@ class ActionComm extends CommonObject
dol_syslog('Error to process socpeopleassigned: ' . $this->db->lasterror(), LOG_ERR);
$this->errors[] = $this->db->lasterror();
} else {
$already_inserted[$val['id']] = true;
$already_inserted[$id] = true;
}
}
}
@@ -729,13 +735,14 @@ class ActionComm extends CommonObject
/**
* Load object from database
*
* @param int $id Id of action to get
* @param string $ref Ref of action to get
* @param string $ref_ext Ref ext to get
* @param string $email_msgid Email msgid
* @return int <0 if KO, >0 if OK
* @param int $id Id of action to get
* @param string $ref Ref of action to get
* @param string $ref_ext Ref ext to get
* @param string $email_msgid Email msgid
* @param string $loadresources 1=Load also resources
* @return int <0 if KO, >0 if OK
*/
public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '')
public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '', $loadresources = 1)
{
global $langs;
@@ -852,8 +859,13 @@ class ActionComm extends CommonObject
$this->event_paid = $obj->event_paid;
$this->status = $obj->status;
$this->fetchResources();
$this->fetch_optionals();
if ($loadresources) {
$this->fetchResources();
}
}
$this->db->free($resql);
} else {
$this->error = $this->db->lasterror();
@@ -875,7 +887,7 @@ class ActionComm extends CommonObject
$sql = 'SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency';
$sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm_resources';
$sql .= ' WHERE fk_actioncomm = '.$this->id;
$sql .= ' WHERE fk_actioncomm = '.((int) $this->id);
$sql .= " AND element_type IN ('user', 'socpeople')";
$resql = $this->db->query($sql);
if ($resql) {
@@ -919,7 +931,7 @@ class ActionComm extends CommonObject
// phpcs:enable
$sql = "SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm_resources";
$sql .= " WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
$sql .= " WHERE element_type = 'user' AND fk_actioncomm = ".((int) $this->id);
$resql2 = $this->db->query($sql);
if ($resql2) {
@@ -996,7 +1008,7 @@ class ActionComm extends CommonObject
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_reminder";
$sql .= " WHERE fk_actioncomm = ".$this->id;
$sql .= " WHERE fk_actioncomm = ".((int) $this->id);
$res = $this->db->query($sql);
if (!$res) {
@@ -1159,7 +1171,7 @@ class ActionComm extends CommonObject
// Now insert assignedusers
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources where fk_actioncomm = ".$this->id." AND element_type = 'user'";
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources where fk_actioncomm = ".((int) $this->id)." AND element_type = 'user'";
$resql = $this->db->query($sql);
$already_inserted = array();
@@ -1184,7 +1196,7 @@ class ActionComm extends CommonObject
}
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources where fk_actioncomm = ".$this->id." AND element_type = 'socpeople'";
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources where fk_actioncomm = ".((int) $this->id)." AND element_type = 'socpeople'";
$resql = $this->db->query($sql);
if (!empty($this->socpeopleassigned)) {
@@ -1320,7 +1332,7 @@ class ActionComm extends CommonObject
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
}
if (!$user->rights->agenda->allactions->read) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_resources AS ar ON a.id = ar.fk_actioncomm AND ar.element_type ='user' AND ar.fk_element = ".$user->id;
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_resources AS ar ON a.id = ar.fk_actioncomm AND ar.element_type ='user' AND ar.fk_element = ".((int) $user->id);
}
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
$sql .= " WHERE 1 = 1";
@@ -1329,14 +1341,14 @@ class ActionComm extends CommonObject
}
$sql .= " AND a.entity IN (".getEntity('agenda').")";
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
}
if ($user->socid) {
$sql .= " AND a.fk_soc = ".$user->socid;
$sql .= " AND a.fk_soc = ".((int) $user->socid);
}
if (!$user->rights->agenda->allactions->read) {
$sql .= " AND (a.fk_user_author = ".$user->id." OR a.fk_user_action = ".$user->id." OR a.fk_user_done = ".$user->id;
$sql .= " OR ar.fk_element = ".$user->id; // Added by PV
$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 .= " OR ar.fk_element = ".((int) $user->id);
$sql .= ")";
}
@@ -2226,7 +2238,7 @@ class ActionComm extends CommonObject
//Select all action comm reminders for event
$sql = "SELECT rowid as id, typeremind, dateremind, status, offsetvalue, offsetunit, fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm_reminder";
$sql .= " WHERE fk_actioncomm = ".$this->id;
$sql .= " WHERE fk_actioncomm = ".((int) $this->id);
if ($onlypast) {
$sql .= " AND dateremind <= '".$this->db->idate(dol_now())."'";
}
@@ -2340,7 +2352,7 @@ class ActionComm extends CommonObject
$sendContent = make_substitutions($langs->trans($arraymessage->content), $substitutionarray);
//Topic
$sendTopic = (!empty($arraymessage->topic)) ? $arraymessage->topic : html_entity_decode($langs->trans('EventReminder'));
$sendTopic = (!empty($arraymessage->topic)) ? $arraymessage->topic : html_entity_decode($langs->transnoentities('EventReminder'));
// Recipient
$recipient = new User($this->db);

View File

@@ -484,7 +484,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
@@ -689,7 +689,7 @@ if ($pid) {
$sql .= " AND a.fk_project=".((int) $pid);
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
}
if ($socid > 0) {
$sql .= ' AND a.fk_soc = '.$socid;

View File

@@ -47,7 +47,7 @@ $massaction = GETPOST('massaction', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search
$resourceid = GETPOST("search_resourceid", "int") ?GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int");
$pid = GETPOST("search_projectid", 'int', 3) ?GETPOST("search_projectid", 'int', 3) : GETPOST("projectid", 'int', 3);
$search_status = (GETPOST("search_status", 'alpha') != '') ?GETPOST("search_status", 'alpha') : GETPOST("status", 'alpha');
$search_status = (GETPOST("search_status", 'aZ09') != '') ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09');
$type = GETPOST('search_type', 'alphanohtml') ?GETPOST('search_type', 'alphanohtml') : GETPOST('type', 'alphanohtml');
$optioncss = GETPOST('optioncss', 'alpha');
$year = GETPOST("year", 'int');
@@ -447,7 +447,7 @@ if ($pid) {
$sql .= " AND a.fk_project=".((int) $pid);
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
}
if ($socid > 0) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -608,7 +608,7 @@ if ($resql) {
$viewmode = '';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';

View File

@@ -416,7 +416,7 @@ $massactionbutton = '';
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
@@ -558,7 +558,7 @@ if ($pid) {
$sql .= " AND a.fk_project=".((int) $pid);
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
}
if ($socid > 0) {
$sql .= ' AND a.fk_soc = '.((int) $socid);

View File

@@ -426,7 +426,7 @@ $massactionbutton = '';
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
@@ -579,7 +579,7 @@ if ($pid) {
$sql .= " AND a.fk_project = ".((int) $pid);
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
}
if ($socid > 0) {
$sql .= ' AND a.fk_soc = '.((int) $socid);
@@ -892,15 +892,23 @@ while ($currentdaytoshow < $lastdaytoshow) {
}
} else {
/* Use this list to have for all users */
$sql = "SELECT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
$sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
if ($usergroup > 0) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
$sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
$sql .= " WHERE ug.entity IN (".getEntity('usergroup').")";
$sql .= " AND ug.fk_user = u.rowid ";
} else {
if ($usergroup > 0) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
}
$sql .= " WHERE u.entity IN (".getEntity('user').")";
}
$sql .= " WHERE u.statut = 1 AND u.entity IN (".getEntity('user').")";
if ($usergroup > 0) {
$sql .= " AND u.statut = 1";
if ($usergroup > 0) {
$sql .= " AND ug.fk_usergroup = ".((int) $usergroup);
}
//print $sql;
$resql = $db->query($sql);
if ($resql) {

View File

@@ -826,7 +826,7 @@ if ($object->id > 0) {
$sql .= ", p.datep as dp, p.fin_validite as date_limit";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
$sql .= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id";
$sql .= " AND s.rowid = ".$object->id;
$sql .= " AND s.rowid = ".((int) $object->id);
$sql .= " AND p.entity IN (".getEntity('propal').")";
$sql .= " ORDER BY p.datep DESC";
@@ -891,7 +891,7 @@ if ($object->id > 0) {
$sql .= ", c.facture as billed";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
$sql .= " WHERE c.fk_soc = s.rowid ";
$sql .= " AND s.rowid = ".$object->id;
$sql .= " AND s.rowid = ".((int) $object->id);
$sql .= " AND c.entity IN (".getEntity('commande').')';
$sql .= " ORDER BY c.date_commande DESC";
@@ -907,7 +907,7 @@ if ($object->id > 0) {
$sql2 .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql2 .= ', '.MAIN_DB_PREFIX.'commande as c';
$sql2 .= ' WHERE c.fk_soc = s.rowid';
$sql2 .= ' AND s.rowid = '.$object->id;
$sql2 .= ' AND s.rowid = '.((int) $object->id);
// Show orders with status validated, shipping started and delivered (well any order we can bill)
$sql2 .= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))";
@@ -967,7 +967,7 @@ if ($object->id > 0) {
$sql .= ', s.nom';
$sql .= ', s.rowid as socid';
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."expedition as e";
$sql .= " WHERE e.fk_soc = s.rowid AND s.rowid = ".$object->id;
$sql .= " WHERE e.fk_soc = s.rowid AND s.rowid = ".((int) $object->id);
$sql .= " AND e.entity IN (".getEntity('expedition').")";
$sql .= ' GROUP BY e.rowid';
$sql .= ', e.ref';
@@ -1032,7 +1032,7 @@ if ($object->id > 0) {
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
$sql .= " WHERE c.fk_soc = s.rowid ";
$sql .= " AND s.rowid = ".$object->id;
$sql .= " AND s.rowid = ".((int) $object->id);
$sql .= " AND c.entity IN (".getEntity('contract').")";
$sql .= " ORDER BY c.datec DESC";
@@ -1106,7 +1106,7 @@ if ($object->id > 0) {
$sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
$sql .= " WHERE f.fk_soc = s.rowid";
$sql .= " AND s.rowid = ".$object->id;
$sql .= " AND s.rowid = ".((int) $object->id);
$sql .= " AND f.entity IN (".getEntity('intervention').")";
$sql .= " ORDER BY f.tms DESC";
@@ -1171,7 +1171,7 @@ if ($object->id > 0) {
$sql .= ', f.suspended as suspended';
$sql .= ', s.nom, s.rowid as socid';
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id;
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $object->id);
$sql .= " AND f.entity IN (".getEntity('invoice').")";
$sql .= ' GROUP BY f.rowid, f.titre, f.total_ht, f.total_tva, f.total_ttc,';
$sql .= ' f.date_last_gen, f.datec, f.frequency, f.unit_frequency,';
@@ -1263,7 +1263,7 @@ if ($object->id > 0) {
$sql .= ', SUM(pf.amount) as am';
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON f.rowid=pf.fk_facture';
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id;
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $object->id);
$sql .= " AND f.entity IN (".getEntity('invoice').")";
$sql .= ' GROUP BY f.rowid, f.ref, f.type, f.total_ht, f.total_tva, f.total_ttc,';
$sql .= ' f.datef, f.datec, f.paye, f.fk_statut,';

View File

@@ -90,7 +90,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc";
$sql .= " WHERE s.fk_stcomm = st.id";
$sql .= " AND p.entity IN (".getEntity('socpeople').")";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($type == "c") {
$sql .= " AND s.client IN (1, 3)";

View File

@@ -106,10 +106,16 @@ print load_fiche_titre($langs->trans("CommercialArea"), '', 'commercial');
print '<div class="fichecenter"><div class="fichethirdleft">';
print getCustomerProposalPieChart($socid);
print '<br>';
print getCustomerOrderPieChart($socid);
print '<br>';
$tmp = getCustomerProposalPieChart($socid);
if ($tmp) {
print $tmp;
print '<br>';
}
$tmp = getCustomerOrderPieChart($socid);
if ($tmp) {
print $tmp;
print '<br>';
}
/*
* Draft customer proposals
@@ -130,7 +136,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
$sql .= " AND p.fk_soc = s.rowid";
$sql .= " AND p.fk_statut = ".Propal::STATUS_DRAFT;
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -182,7 +188,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$propalstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
print '<td class="nowrap right tdamount">'.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).'</td>';
print '<td class="nowrap right tdamount amount">'.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).'</td>';
print '</tr>';
$i++;
@@ -227,7 +233,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
$sql .= " AND p.fk_statut = ".SupplierProposal::STATUS_DRAFT;
$sql .= " AND p.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -278,7 +284,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$supplierproposalstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
print '<td class="nowrap right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '</tr>';
$i++;
@@ -323,7 +329,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$sql .= " AND c.fk_statut = ".Commande::STATUS_DRAFT;
$sql .= " AND c.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND c.fk_soc = ".((int) $socid);
@@ -375,7 +381,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$orderstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
print '<td class="nowrap right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '</tr>';
$i++;
@@ -420,10 +426,10 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
$sql .= " AND cf.fk_statut = ".CommandeFournisseur::STATUS_DRAFT;
$sql .= " AND cf.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND cf.fk_soc = ".$socid;
$sql .= " AND cf.fk_soc = ".((int) $socid);
}
$resql = $db->query($sql);
@@ -472,7 +478,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$supplierorderstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
print '<td class="nowrap right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '</tr>';
$i++;
@@ -517,7 +523,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
$sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")";
$sql .= " AND s.client IN (".Societe::CUSTOMER.", ".Societe::PROSPECT.", ".Societe::CUSTOMER_AND_PROSPECT.")";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = $socid";
@@ -613,7 +619,7 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S
$sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")";
$sql .= " AND s.fournisseur = ".Societe::SUPPLIER;
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -719,7 +725,7 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
$sql .= " AND c.fk_soc = s.rowid";
$sql .= " AND c.fk_product = p.rowid";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -794,7 +800,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
$sql .= " AND p.fk_soc = s.rowid";
$sql .= " AND p.fk_statut = ".Propal::STATUS_VALIDATED;
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -862,7 +868,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
print '<td class="right tddate">'.dol_print_date($db->jdate($obj->dp), 'day').'</td>';
print '<td class="right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '<td class="right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>';
print '</tr>';
@@ -910,7 +916,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$sql .= " AND c.fk_soc = s.rowid";
$sql .= " AND c.fk_statut IN (".Commande::STATUS_VALIDATED.", ".Commande::STATUS_SHIPMENTONPROCESS.")";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -979,7 +985,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
print '<td class="right tddate">'.dol_print_date($db->jdate($obj->dv), 'day').'</td>';
print '<td class="right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '<td class="right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '<td align="center" width="14">'.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).'</td>';
print '</tr>';

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