forked from Wavyzz/dolibarr
Compare commits
247 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e4c8a9cb5 | ||
|
|
13e64d2f79 | ||
|
|
ae3a0fce71 | ||
|
|
57c9649b50 | ||
|
|
e264163ab6 | ||
|
|
0858487119 | ||
|
|
955e9de1b7 | ||
|
|
c0a086fad8 | ||
|
|
8c093cfb31 | ||
|
|
7d61609462 | ||
|
|
a31f991b39 | ||
|
|
30c40afeb3 | ||
|
|
a3d04163b6 | ||
|
|
7a3649b6e5 | ||
|
|
f51bcf0038 | ||
|
|
cffa58a206 | ||
|
|
cfbe2bf995 | ||
|
|
7207ae2cae | ||
|
|
ed250bb6a4 | ||
|
|
8927eeff50 | ||
|
|
eba87ab295 | ||
|
|
7e1d4e1706 | ||
|
|
15020c99e7 | ||
|
|
9b43327af0 | ||
|
|
091166baa7 | ||
|
|
4efc96f67b | ||
|
|
7784c4fcc9 | ||
|
|
9aab49e5c7 | ||
|
|
4b615e541b | ||
|
|
94fbcbdad1 | ||
|
|
1bfc0004b1 | ||
|
|
ba12071ea3 | ||
|
|
b8da594c31 | ||
|
|
abc94a397a | ||
|
|
96a820476c | ||
|
|
cd60d09d9e | ||
|
|
ef4468153d | ||
|
|
0cf2164260 | ||
|
|
dd70d68b4c | ||
|
|
eba55d0cf2 | ||
|
|
51a28a4ac4 | ||
|
|
dad251493a | ||
|
|
ab8f78f29a | ||
|
|
8da328b183 | ||
|
|
dd5f2dd3a2 | ||
|
|
3964bd28db | ||
|
|
775164f84a | ||
|
|
c12905f0f3 | ||
|
|
e637a1e59a | ||
|
|
6fbd93999f | ||
|
|
4faf6f5d84 | ||
|
|
087e269103 | ||
|
|
5e0aaeb6e4 | ||
|
|
2860c5e3ab | ||
|
|
31d6aaf6b4 | ||
|
|
6ece5f6931 | ||
|
|
b610cc1c6c | ||
|
|
f3dbe81df4 | ||
|
|
3f58e7c5db | ||
|
|
b5b53e382e | ||
|
|
2c5e0a595b | ||
|
|
e91c5fc1c5 | ||
|
|
0876cb4cd9 | ||
|
|
6e4fb8dd8b | ||
|
|
739d8e1c6b | ||
|
|
2de728c074 | ||
|
|
e4cb1e023a | ||
|
|
108a5ff7cb | ||
|
|
029da815b2 | ||
|
|
78e993c9f3 | ||
|
|
28ff7c894b | ||
|
|
c377e5ea3d | ||
|
|
3f0a5cc689 | ||
|
|
948663deb4 | ||
|
|
1435172405 | ||
|
|
d437d382d8 | ||
|
|
a7fa238b71 | ||
|
|
e26eda3f5f | ||
|
|
458f773baf | ||
|
|
864a8b4b3e | ||
|
|
fec5a22c65 | ||
|
|
cf74af4401 | ||
|
|
c0c46fb704 | ||
|
|
591b8acd51 | ||
|
|
fca3980dce | ||
|
|
5d717113be | ||
|
|
0a31f3dc1a | ||
|
|
965bdbb342 | ||
|
|
a5d11a1ccf | ||
|
|
ba403dd33f | ||
|
|
c60927da61 | ||
|
|
58ca982e55 | ||
|
|
a9ced1098d | ||
|
|
23ea8d2907 | ||
|
|
de228c5687 | ||
|
|
bec87f5739 | ||
|
|
2f3105d884 | ||
|
|
a84c994368 | ||
|
|
bf49309d58 | ||
|
|
aaefb7b324 | ||
|
|
6dc8024d87 | ||
|
|
4dfc8bab93 | ||
|
|
4958015e93 | ||
|
|
5f5734e9af | ||
|
|
a571fab177 | ||
|
|
1c981ccb9d | ||
|
|
9ceab9b86b | ||
|
|
ce38ccc121 | ||
|
|
19f17ed114 | ||
|
|
8b746b64a0 | ||
|
|
ce5acda635 | ||
|
|
5543d68e5a | ||
|
|
d0c57dac34 | ||
|
|
000c32c137 | ||
|
|
cf072c1061 | ||
|
|
fc33d46c77 | ||
|
|
eced1c824a | ||
|
|
2deaac0fc4 | ||
|
|
d822421e10 | ||
|
|
61e3a57de7 | ||
|
|
efda27000e | ||
|
|
8077fae42e | ||
|
|
04fc2c0ce7 | ||
|
|
c6233e4a39 | ||
|
|
b725dd0309 | ||
|
|
e8d385ae42 | ||
|
|
a983dc7506 | ||
|
|
5256d6e046 | ||
|
|
b67487b2ca | ||
|
|
7eb8232b75 | ||
|
|
bd35d86268 | ||
|
|
85a02c5615 | ||
|
|
530a773eaa | ||
|
|
af95169d1d | ||
|
|
f73394435e | ||
|
|
9811569b2b | ||
|
|
04911bde25 | ||
|
|
b77ec22590 | ||
|
|
6f5e412bd5 | ||
|
|
9dc61adcc7 | ||
|
|
9c626bede4 | ||
|
|
f830a0f5e2 | ||
|
|
5995e01bd1 | ||
|
|
0d70c81897 | ||
|
|
f4ed3941a7 | ||
|
|
a9f5fd497a | ||
|
|
252cfb8207 | ||
|
|
63898426d2 | ||
|
|
8ea6fc3174 | ||
|
|
510cf36bbd | ||
|
|
57d637ac71 | ||
|
|
047c575d61 | ||
|
|
593e84906b | ||
|
|
0c3bf536f2 | ||
|
|
9954a0e4bb | ||
|
|
26a7130376 | ||
|
|
f02dee2e21 | ||
|
|
6f3080c67c | ||
|
|
12b2ba64eb | ||
|
|
78646d10bb | ||
|
|
ae5bb956ac | ||
|
|
da482018d2 | ||
|
|
262dd1600b | ||
|
|
fdd0ab8461 | ||
|
|
50f3960d80 | ||
|
|
f6d03fe28e | ||
|
|
9734fced56 | ||
|
|
e7af8e9d5e | ||
|
|
ae5d17815f | ||
|
|
e406d80338 | ||
|
|
03ac579b64 | ||
|
|
07c4c36520 | ||
|
|
20217806c6 | ||
|
|
fea4210570 | ||
|
|
c9a46ab0cc | ||
|
|
57b18a6bed | ||
|
|
d4958ce677 | ||
|
|
512b2477ef | ||
|
|
bd731d9213 | ||
|
|
2b2c8f076b | ||
|
|
fe2d229ba9 | ||
|
|
686c10e5be | ||
|
|
29a61164fe | ||
|
|
0476b36c6c | ||
|
|
8e16396d51 | ||
|
|
12a0029fb7 | ||
|
|
cd63ede35a | ||
|
|
f8563ace0d | ||
|
|
df8f099857 | ||
|
|
ae2866ccd7 | ||
|
|
8dca7d2b35 | ||
|
|
7c86a4766e | ||
|
|
97e829c7de | ||
|
|
288affa3a0 | ||
|
|
2054cca6e5 | ||
|
|
7acebd28ca | ||
|
|
95ecbb8940 | ||
|
|
712f0b897d | ||
|
|
ea1c23b562 | ||
|
|
aae64eee1e | ||
|
|
2980cd9ab2 | ||
|
|
3e9e47d4bd | ||
|
|
84d221988f | ||
|
|
e8061df976 | ||
|
|
e700e78f7d | ||
|
|
67cc580797 | ||
|
|
42252abc07 | ||
|
|
3e3751e161 | ||
|
|
a7f55f4778 | ||
|
|
54c151916d | ||
|
|
053d72c306 | ||
|
|
3cb56d3ec6 | ||
|
|
76f0bac703 | ||
|
|
f83f02e4e2 | ||
|
|
36ba5c6a71 | ||
|
|
986dc9c857 | ||
|
|
4fa72f7dfe | ||
|
|
b0e2ef4a6c | ||
|
|
026e61f1ec | ||
|
|
d443485939 | ||
|
|
a181469ff8 | ||
|
|
cfdcad0077 | ||
|
|
a08b63d561 | ||
|
|
b5dde982d5 | ||
|
|
a7cef1aa15 | ||
|
|
35862cebfa | ||
|
|
183d413b45 | ||
|
|
bbd84fd13e | ||
|
|
505543e18e | ||
|
|
84e5773de8 | ||
|
|
467ecb4a64 | ||
|
|
5453e3b3b2 | ||
|
|
e93a362a0d | ||
|
|
4c505619e3 | ||
|
|
062c39c40d | ||
|
|
23f708c0d4 | ||
|
|
dbed6bc0da | ||
|
|
e4bb5ed008 | ||
|
|
c2f1781fae | ||
|
|
dc7ff07517 | ||
|
|
0e18bd4be1 | ||
|
|
e25171b9f5 | ||
|
|
b57eb8284e | ||
|
|
cea35bd208 | ||
|
|
922354f366 | ||
|
|
4d6b63dbed | ||
|
|
284627b693 |
82
ChangeLog
82
ChangeLog
@@ -2,12 +2,51 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** 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 +89,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 +106,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 +133,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 +202,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 +211,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 +252,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 +267,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 *****
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
|
||||
@@ -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> ';
|
||||
@@ -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 -->';
|
||||
|
||||
@@ -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) {
|
||||
@@ -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>';
|
||||
}
|
||||
|
||||
@@ -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 ' <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>';
|
||||
|
||||
@@ -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 ' <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>';
|
||||
|
||||
@@ -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>
|
||||
@@ -466,34 +466,43 @@ class AccountancyExport
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : CIEL
|
||||
* Export format : CIEL (Format XIMPORT)
|
||||
* Format since 2003 compatible CIEL version > 2002 / Sage50
|
||||
* Last review for this format : 2021/07/28 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['num_ecriture'] = str_pad($data->piece_num, 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['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['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34);
|
||||
@@ -1287,7 +1296,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 +1461,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';
|
||||
}
|
||||
|
||||
@@ -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').")";
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
@@ -56,6 +58,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) == $accountancyexport::$EXPORT_TYPE_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;
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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&token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>';
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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');
|
||||
@@ -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>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($arrayofparameters as $constname => $val) {
|
||||
if ($val['enabled']==1) {
|
||||
@@ -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 ' ';
|
||||
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>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($arrayofparameters as $constname => $val) {
|
||||
if ($val['enabled']==1) {
|
||||
|
||||
@@ -230,6 +230,9 @@ if (!empty($conf->agenda->enabled)) {
|
||||
if (!empty($conf->eventorganization->enabled) && !empty($user->rights->eventorganization->read)) {
|
||||
$elementList['eventorganization_send'] = 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);
|
||||
$reshook = $hookmanager->executeHooks('emailElementlist', $parameters); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
@@ -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>';
|
||||
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -52,22 +52,22 @@ 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_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 +82,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');
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -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++;
|
||||
|
||||
@@ -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&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> </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&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&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>';
|
||||
|
||||
@@ -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,14 @@ if (function_exists('exec')) {
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).' <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)).' <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)).' <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') : '').' <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').' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Strict').")</span><br>\n";
|
||||
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).' <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)).' <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)).' <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)).' <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 +202,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 +224,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 +249,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 ' '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0);
|
||||
}
|
||||
@@ -335,7 +350,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 +363,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> <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> <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 <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).' <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").' ('.$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).' <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").' ('.$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").' ('.$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").' ('.$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 +385,14 @@ if (empty($conf->global->MAIN_EXEC_USE_POPEN)) {
|
||||
print $conf->global->MAIN_EXEC_USE_POPEN;
|
||||
}
|
||||
if ($execmethod == 1) {
|
||||
print ' <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 ' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)';
|
||||
print '</span>';
|
||||
}
|
||||
if ($execmethod == 2) {
|
||||
print ' <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 ' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)';
|
||||
print '</span>';
|
||||
}
|
||||
print "<br>";
|
||||
print '<br>';
|
||||
|
||||
@@ -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">';
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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';
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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&urlsource='.urlencode($url).'&url='.urlencode($url);
|
||||
$urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&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&urlsource='.urlencode($url).'&url='.urlencode($url);
|
||||
$urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&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&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&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)) {
|
||||
|
||||
@@ -2340,7 +2340,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);
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -182,7 +182,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++;
|
||||
@@ -278,7 +278,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++;
|
||||
@@ -375,7 +375,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++;
|
||||
@@ -472,7 +472,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++;
|
||||
@@ -862,7 +862,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>';
|
||||
@@ -979,7 +979,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>';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
* Copyright (C) 2005-2021 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
@@ -337,6 +337,7 @@ if ($object->fetch($id) >= 0) {
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') {
|
||||
$reg = array();
|
||||
if (preg_match("/(.*)\.modules\.php$/i", $file, $reg)) {
|
||||
if ($reg[1] == 'example') {
|
||||
continue;
|
||||
@@ -534,9 +535,9 @@ if ($object->fetch($id) >= 0) {
|
||||
|
||||
$morehtmlcenter = '';
|
||||
if ($allowaddtarget) {
|
||||
$morehtmlcenter = '<span class="opacitymedium">'.$langs->trans("ToClearAllRecipientsClickHere").'</span> <a href="'.$_SERVER["PHP_SELF"].'?clearlist=1&id='.$object->id.'" class="button reposition">'.$langs->trans("TargetsReset").'</a>';
|
||||
$morehtmlcenter = '<span class="opacitymedium">'.$langs->trans("ToClearAllRecipientsClickHere").'</span> <a href="'.$_SERVER["PHP_SELF"].'?clearlist=1&id='.$object->id.'" class="button reposition smallpaddingimp">'.$langs->trans("TargetsReset").'</a>';
|
||||
}
|
||||
$morehtmlcenter .= ' <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?exportcsv=1&id='.$object->id.'">'.$langs->trans("Download").'</a>';
|
||||
$morehtmlcenter .= ' <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?exportcsv=1&id='.$object->id.'">'.$langs->trans("Download").'</a>';
|
||||
|
||||
print_barre_liste($langs->trans("MailSelectedRecipients"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $morehtmlcenter, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit);
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ class Commande extends CommonOrder
|
||||
|
||||
/**
|
||||
* @var int Date expected for delivery
|
||||
* @see delivery_date
|
||||
* @see $delivery_date
|
||||
* @deprecated
|
||||
*/
|
||||
public $date_livraison;
|
||||
|
||||
@@ -1346,7 +1346,7 @@ if ($resql) {
|
||||
print '<td class="tdoverflowmax300"'.($titletoshow ? ' title="'.dol_escape_htmltag($titletoshow).'"' : '').'>';
|
||||
print $labeltoshow; // Already escaped
|
||||
|
||||
// Add links after description
|
||||
// Add info about links after description
|
||||
$cachebankaccount = array();
|
||||
foreach ($links as $key => $val) {
|
||||
print '<!-- '.$links[$key]['type'].' -->';
|
||||
@@ -1424,6 +1424,7 @@ if ($resql) {
|
||||
} elseif ($links[$key]['type'] == 'sc') {
|
||||
} elseif ($links[$key]['type'] == 'vat') {
|
||||
} elseif ($links[$key]['type'] == 'salary') {
|
||||
// Information is already shown using the payment_salary link. No need of this link.
|
||||
} else {
|
||||
// Show link with label $links[$key]['label']
|
||||
if (!empty($objp->label) && !empty($links[$key]['label'])) {
|
||||
@@ -1530,15 +1531,21 @@ if ($resql) {
|
||||
}
|
||||
|
||||
if ($companylinked_id) {
|
||||
// TODO Add a cache of loaded companies here
|
||||
// TODO Add a cache of loaded companies here ?
|
||||
$companystatic->fetch($companylinked_id);
|
||||
print $companystatic->getNomUrl(1);
|
||||
} elseif ($userlinked_id &&
|
||||
(($type_link == 'payment_salary' && !empty($user->rights->salaries->read))
|
||||
|| ($type_link == 'payment_sc' && !empty($user->rights->tax->charges->lire)))) {
|
||||
// TODO Add a cache of loaded users here
|
||||
$userstatic->fetch($userlinked_id);
|
||||
print $userstatic->getNomUrl(1);
|
||||
// Get object user from cache or load it
|
||||
if (!empty($conf->cache['user'][$userlinked_id])) {
|
||||
$tmpuser = $conf->cache['user'][$userlinked_id];
|
||||
} else {
|
||||
$tmpuser = new User($db);
|
||||
$tmpuser->fetch($userlinked_id);
|
||||
$conf->cache['user'][$userlinked_id] = $tmpuser;
|
||||
}
|
||||
print $tmpuser->getNomUrl(1);
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ if (empty($reshook)) {
|
||||
$object->ics = trim(GETPOST("ics", 'alpha'));
|
||||
$object->ics_transfer = trim(GETPOST("ics_transfer", 'alpha'));
|
||||
|
||||
$account_number = GETPOST('account_number', 'alpha');
|
||||
$account_number = GETPOST('account_number', 'alphanohtml');
|
||||
if (empty($account_number) || $account_number == '-1') {
|
||||
$object->account_number = '';
|
||||
} else {
|
||||
@@ -754,13 +754,13 @@ if ($action == 'create') {
|
||||
print '</td></tr>';
|
||||
|
||||
if ($conf->prelevement->enabled) {
|
||||
print '<tr><td>'.$langs->trans("ICS").'</td>';
|
||||
print '<tr><td>'.$langs->trans("ICS").' ('.$langs->trans("StandingOrder").')</td>';
|
||||
print '<td>'.$object->ics.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($conf->paymentbybanktransfer->enabled) {
|
||||
print '<tr><td>'.$langs->trans("ICSTransfer").'</td>';
|
||||
print '<tr><td>'.$langs->trans("ICS").' ('.$langs->trans("BankTransfer").')</td>';
|
||||
print '<td>'.$object->ics_transfer.'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -1053,12 +1053,12 @@ if ($action == 'create') {
|
||||
print '<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="11" type="text" class="flat" name="bic" value="'.$object->bic.'"></td></tr>';
|
||||
|
||||
if ($conf->prelevement->enabled) {
|
||||
print '<tr><td>'.$langs->trans("ICS").'</td>';
|
||||
print '<tr><td>'.$langs->trans("ICS").' ('.$langs->trans("StandingOrder").')</td>';
|
||||
print '<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics" value="'.$object->ics.'"></td></tr>';
|
||||
}
|
||||
|
||||
if ($conf->paymentbybanktransfer->enabled) {
|
||||
print '<tr><td>'.$langs->trans("ICSTransfer").'</td>';
|
||||
print '<tr><td>'.$langs->trans("ICS").' ('.$langs->trans("BankTransfer").')</td>';
|
||||
print '<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics_transfer" value="'.$object->ics_transfer.'"></td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@@ -399,9 +399,9 @@ class Account extends CommonObject
|
||||
/**
|
||||
* Add a link between bank line record and its source
|
||||
*
|
||||
* @param int $line_id Id ecriture bancaire
|
||||
* @param int $url_id Id parametre url
|
||||
* @param string $url Url
|
||||
* @param int $line_id Id of bank entry
|
||||
* @param int $url_id Id of object related to link
|
||||
* @param string $url Url (deprecated, we use now 'url_id' and 'type' instead)
|
||||
* @param string $label Link label
|
||||
* @param string $type Type of link ('payment', 'company', 'member', ...)
|
||||
* @return int <0 if KO, id line if OK
|
||||
@@ -412,13 +412,13 @@ class Account extends CommonObject
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url (";
|
||||
$sql .= "fk_bank";
|
||||
$sql .= ", url_id";
|
||||
$sql .= ", url";
|
||||
$sql .= ", url"; // deprecated
|
||||
$sql .= ", label";
|
||||
$sql .= ", type";
|
||||
$sql .= ") VALUES (";
|
||||
$sql .= " ".((int) $line_id);
|
||||
$sql .= ", '".$this->db->escape($url_id)."'";
|
||||
$sql .= ", '".$this->db->escape($url)."'";
|
||||
$sql .= ", ".((int) $url_id);
|
||||
$sql .= ", '".$this->db->escape($url)."'"; // dperecated
|
||||
$sql .= ", '".$this->db->escape($label)."'";
|
||||
$sql .= ", '".$this->db->escape($type)."'";
|
||||
$sql .= ")";
|
||||
|
||||
@@ -624,21 +624,21 @@ if ($result) {
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Conciliation")."</td>";
|
||||
print '<tr><td class="titlefieldcreate">'.$form->textwithpicto($langs->trans("AccountStatement"), $langs->trans("InputReceiptNumber"))."</td>";
|
||||
if ($user->rights->banque->consolidate) {
|
||||
print '<td>';
|
||||
if ($objp->rappro) {
|
||||
print $langs->trans("AccountStatement").' <input name="num_rel_bis" class="flat" value="'.$objp->num_releve.'"'.($objp->rappro ? ' disabled' : '').'>';
|
||||
print '<input name="num_rel_bis" class="flat" value="'.$objp->num_releve.'"'.($objp->rappro ? ' disabled' : '').'>';
|
||||
print '<input name="num_rel" type="hidden" value="'.$objp->num_releve.'">';
|
||||
} else {
|
||||
print $langs->trans("AccountStatement").' <input name="num_rel" class="flat" value="'.$objp->num_releve.'"'.($objp->rappro ? ' disabled' : '').'>';
|
||||
print '<input name="num_rel" class="flat" value="'.$objp->num_releve.'"'.($objp->rappro ? ' disabled' : '').'>';
|
||||
}
|
||||
if ($objp->num_releve) {
|
||||
print ' (<a href="'.DOL_URL_ROOT.'/compta/bank/releve.php?num='.$objp->num_releve.'&account='.$acct->id.'">'.$langs->trans("AccountStatement").' '.$objp->num_releve.')</a>';
|
||||
}
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td>'.$objp->num_releve.' </td>';
|
||||
print '<td>'.$objp->num_releve.'</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@@ -251,7 +251,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;
|
||||
|
||||
@@ -99,7 +99,7 @@ class CashControl extends CommonObject
|
||||
'fk_user_creat' =>array('type'=>'integer:User', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>600),
|
||||
'fk_user_valid' =>array('type'=>'integer:User', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>602),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'Import key', 'enabled'=>1, 'visible'=>0, 'position'=>700),
|
||||
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated')),
|
||||
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated')),
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -5274,7 +5274,8 @@ if ($action == 'create') {
|
||||
// Reopen a standard paid invoice
|
||||
if ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT)
|
||||
|| ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id))
|
||||
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id)))
|
||||
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id))
|
||||
|| ($object->type == Facture::TYPE_SITUATION && empty($discount->id)))
|
||||
&& ($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
|
||||
&& ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) { // A paid invoice (partially or completely)
|
||||
if ($object->close_code != 'replaced' || (!$objectidnext)) { // Not replaced by another invoice or replaced but the replacement invoice has been deleted
|
||||
|
||||
@@ -148,12 +148,6 @@ if ($type == 'bank-transfer') {
|
||||
llxHeader('', $title, $helpurl);
|
||||
|
||||
|
||||
/* *************************************************************************** */
|
||||
/* */
|
||||
/* Mode fiche */
|
||||
/* */
|
||||
/* *************************************************************************** */
|
||||
|
||||
if ($object->id > 0) {
|
||||
$selleruserevenustamp = $mysoc->useRevenueStamp();
|
||||
|
||||
@@ -471,6 +465,7 @@ if ($object->id > 0) {
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
// IBAN of seller or supplier
|
||||
$title = 'CustomerIBAN';
|
||||
if ($type == 'bank-transfer') {
|
||||
$title = 'SupplierIBAN';
|
||||
|
||||
@@ -200,7 +200,8 @@ if ($id > 0 || $ref) {
|
||||
|
||||
//print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$object->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td>'.dol_print_date($object->datec, 'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td><span class="amount">'.price($object->amount).'</span></td></tr>';
|
||||
|
||||
// Status
|
||||
/*
|
||||
@@ -325,19 +326,19 @@ if ($id > 0 || $ref) {
|
||||
|
||||
// Actions
|
||||
if ($action != 'settransmitted' && $action != 'setcredited') {
|
||||
print "\n<div class=\"tabsAction\">\n";
|
||||
print "\n".'<div class="tabsAction">'."\n";
|
||||
|
||||
if (empty($object->date_trans) && $user->rights->prelevement->bons->send) {
|
||||
print "<a class=\"butAction\" href=\"card.php?action=settransmitted&token='.newToken().'&id=".$object->id."\">".$langs->trans("SetToStatusSent")."</a>";
|
||||
print '<a class="butAction" href="card.php?action=settransmitted&token='.newToken().'&id='.$object->id.'">'.$langs->trans("SetToStatusSent").'</a>';
|
||||
}
|
||||
|
||||
if (!empty($object->date_trans) && $object->date_credit == 0) {
|
||||
print "<a class=\"butAction\" href=\"card.php?action=setcredited&token='.newToken().'&id=".$object->id."\">".$langs->trans("ClassCredited")."</a>";
|
||||
print '<a class="butAction" href="card.php?action=setcredited&token='.newToken().'&id='.$object->id.'">'.$langs->trans("ClassCredited").'</a>';
|
||||
}
|
||||
|
||||
print "<a class=\"butActionDelete\" href=\"card.php?action=delete&token='.newToken().'&id=".$object->id."\">".$langs->trans("Delete")."</a>";
|
||||
print '<a class="butActionDelete" href="card.php?action=delete&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Delete").'</a>';
|
||||
|
||||
print "</div>";
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
@@ -413,7 +414,7 @@ if ($id > 0 || $ref) {
|
||||
print "<td>";
|
||||
print $ligne->LibStatut($obj->statut, 2);
|
||||
print " ";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'&type='.$object->type.'">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'&type='.$object->type.'&token='.newtoken().'">';
|
||||
print sprintf("%06s", $obj->rowid);
|
||||
print '</a></td>';
|
||||
|
||||
@@ -434,7 +435,7 @@ if ($id > 0 || $ref) {
|
||||
if ($obj->statut == 2) {
|
||||
if ($user->rights->prelevement->bons->credit) {
|
||||
//print '<a class="butActionDelete" href="line.php?action=rejet&id='.$obj->rowid.'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
print '<a href="line.php?action=rejet&type='.$object->type.'&id='.$obj->rowid.'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
print '<a href="line.php?action=rejet&type='.$object->type.'&id='.$obj->rowid.'&token='.newtoken().'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
} else {
|
||||
//print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("StandingOrderReject").'</a>';
|
||||
}
|
||||
|
||||
@@ -82,7 +82,8 @@ class BonPrelevement extends CommonObject
|
||||
|
||||
const STATUS_DRAFT = 0;
|
||||
const STATUS_TRANSFERED = 1;
|
||||
const STATUS_CREDITED = 2;
|
||||
const STATUS_CREDITED = 2; // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type
|
||||
const STATUS_DEBITED = 2; // STATUS_CREDITED and STATUS_DEBITED is same. Difference is in ->type
|
||||
|
||||
|
||||
/**
|
||||
@@ -2343,17 +2344,22 @@ class BonPrelevement extends CommonObject
|
||||
//$langs->load("mymodule");
|
||||
$this->labelStatus[self::STATUS_DRAFT] = $langs->trans('StatusWaiting');
|
||||
$this->labelStatus[self::STATUS_TRANSFERED] = $langs->trans('StatusTrans');
|
||||
$this->labelStatus[self::STATUS_CREDITED] = $langs->trans('StatusCredited');
|
||||
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('StatusWaiting');
|
||||
$this->labelStatusShort[self::STATUS_TRANSFERED] = $langs->trans('StatusTrans');
|
||||
$this->labelStatusShort[self::STATUS_CREDITED] = $langs->trans('StatusCredited');
|
||||
if ($this->type == 'bank-transfer') {
|
||||
$this->labelStatus[self::STATUS_DEBITED] = $langs->trans('StatusDebited');
|
||||
$this->labelStatusShort[self::STATUS_DEBITED] = $langs->trans('StatusDebited');
|
||||
} else {
|
||||
$this->labelStatus[self::STATUS_CREDITED] = $langs->trans('StatusCredited');
|
||||
$this->labelStatusShort[self::STATUS_CREDITED] = $langs->trans('StatusCredited');
|
||||
}
|
||||
}
|
||||
|
||||
$statusType = 'status1';
|
||||
if ($status == self::STATUS_TRANSFERED) {
|
||||
$statusType = 'status3';
|
||||
}
|
||||
if ($status == self::STATUS_CREDITED) {
|
||||
if ($status == self::STATUS_CREDITED || $status == self::STATUS_DEBITED) {
|
||||
$statusType = 'status6';
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ $hookmanager->initHooks(array('directdebitcreatecard', 'globalcard'));
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$massaction = '';
|
||||
}
|
||||
@@ -95,7 +96,7 @@ if (empty($reshook)) {
|
||||
$bank = new Account($db);
|
||||
$bank->fetch($conf->global->{$default_account});
|
||||
if (empty($bank->ics) || empty($bank->ics_transfer)) {
|
||||
$errormessage = str_replace('{url}', $bank->getNomUrl(1), $langs->trans("ErrorICSmissing", '{url}'));
|
||||
$errormessage = str_replace('{url}', $bank->getNomUrl(1, '', '', -1, 1), $langs->trans("ErrorICSmissing", '{url}'));
|
||||
setEventMessages($errormessage, null, 'errors');
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/prelevement/create.php');
|
||||
exit;
|
||||
@@ -124,9 +125,13 @@ if (empty($reshook)) {
|
||||
}
|
||||
} else {
|
||||
if ($type != 'bank-transfer') {
|
||||
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
|
||||
$texttoshow = $langs->trans("DirectDebitOrderCreated", '{s}');
|
||||
$texttoshow = str_replace('{s}', $bprev->getNomUrl(1), $texttoshow);
|
||||
setEventMessages($texttoshow, null);
|
||||
} else {
|
||||
setEventMessages($langs->trans("CreditTransferOrderCreated", $bprev->getNomUrl(1)), null);
|
||||
$texttoshow = $langs->trans("CreditTransferOrderCreated", '{s}');
|
||||
$texttoshow = str_replace('{s}', $bprev->getNomUrl(1), $texttoshow);
|
||||
setEventMessages($texttoshow, null);
|
||||
}
|
||||
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$bprev->id);
|
||||
@@ -165,7 +170,11 @@ llxHeader('', $langs->trans("NewStandingOrder"));
|
||||
|
||||
if (prelevement_check_config($type) < 0) {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Withdraw")), null, 'errors');
|
||||
$modulenametoshow = "Withdraw";
|
||||
if ($type == 'bank-transfer') {
|
||||
$modulenametoshow = "PaymentByBankTransfer";
|
||||
}
|
||||
setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv($modulenametoshow)), null, 'errors');
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +215,7 @@ print $nb;
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("AmountTotal").'</td>';
|
||||
print '<td>';
|
||||
print '<td class="amount">';
|
||||
print price($pricetowithdraw);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@@ -225,8 +234,13 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||
if ($nb) {
|
||||
if ($pricetowithdraw) {
|
||||
print $langs->trans('BankToReceiveWithdraw').': ';
|
||||
$form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT, 'id_bankaccount', 0, "courant=1");
|
||||
$title = $langs->trans('BankToReceiveWithdraw').': ';
|
||||
if ($type == 'bank-transfer') {
|
||||
$title = $langs->trans('BankToPayCreditTransfer').': ';
|
||||
}
|
||||
print $title;
|
||||
print img_picto('', 'bank_account');
|
||||
print $form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT, 'id_bankaccount', 0, "courant=1", 0, '', 0, '', 1);
|
||||
print ' - ';
|
||||
|
||||
print $langs->trans('ExecutionDate').' ';
|
||||
@@ -430,7 +444,7 @@ if ($resql) {
|
||||
}
|
||||
print '</td>';
|
||||
// Amount
|
||||
print '<td class="right">';
|
||||
print '<td class="right amount">';
|
||||
print price($obj->amount, 0, $langs, 0, 0, -1, $conf->currency);
|
||||
print '</td>';
|
||||
// Date
|
||||
|
||||
@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('banks', 'categories', 'widthdrawals'));
|
||||
$langs->loadLangs(array('banks', 'categories', 'withdrawals'));
|
||||
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlist'; // To manage different context of search
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
|
||||
@@ -135,6 +136,7 @@ if (empty($reshook)) {
|
||||
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
$formfile = new FormFile($db);
|
||||
$tva_static = new Tva($db);
|
||||
$bankstatic = new Account($db);
|
||||
$accountingjournal = new AccountingJournal($db);
|
||||
@@ -445,7 +447,13 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Ref
|
||||
if (!empty($arrayfields['t.rowid']['checked'])) {
|
||||
print '<td>'.$tva_static->getNomUrl(1).'</td>';
|
||||
print '<td>';
|
||||
print $tva_static->getNomUrl(1);
|
||||
$filename = dol_sanitizeFileName($tva_static->ref);
|
||||
$filedir = $conf->tax->dir_output.'/vat/'.dol_sanitizeFileName($tva_static->ref);
|
||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$tva_static->id;
|
||||
print $formfile->getDocumentsLink($tva_static->element, $filename, $filedir, '', 'valignmiddle paddingleft2imp');
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@@ -1003,7 +1003,7 @@ if ($action == 'create') {
|
||||
$soc->fetch($socid);
|
||||
}
|
||||
|
||||
if (GETPOST('origin') && GETPOST('originid')) {
|
||||
if (GETPOST('origin') && GETPOST('originid', 'int')) {
|
||||
// Parse element/subelement (ex: project_task)
|
||||
$regs = array();
|
||||
$element = $subelement = GETPOST('origin');
|
||||
@@ -1013,7 +1013,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
if ($element == 'project') {
|
||||
$projectid = GETPOST('originid');
|
||||
$projectid = GETPOST('originid', 'int');
|
||||
} else {
|
||||
// For compatibility
|
||||
if ($element == 'order' || $element == 'commande') {
|
||||
@@ -1094,7 +1094,8 @@ if ($action == 'create') {
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td>';
|
||||
print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300');
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300 widthcentpercentminusxx maxwidth500');
|
||||
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
|
||||
print '</td>';
|
||||
}
|
||||
@@ -1121,11 +1122,13 @@ if ($action == 'create') {
|
||||
|
||||
// Commercial suivi
|
||||
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPFOLL").'</span></td><td>';
|
||||
print img_picto('', 'user', 'class="pictofixedwidth"');
|
||||
print $form->select_dolusers(GETPOST("commercial_suivi_id") ?GETPOST("commercial_suivi_id") : $user->id, 'commercial_suivi_id', 1, '');
|
||||
print '</td></tr>';
|
||||
|
||||
// Commercial signature
|
||||
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPSIGN").'</span></td><td>';
|
||||
print img_picto('', 'user', 'class="pictofixedwidth"');
|
||||
print $form->select_dolusers(GETPOST("commercial_signature_id") ?GETPOST("commercial_signature_id") : $user->id, 'commercial_signature_id', 1, '');
|
||||
print '</td></tr>';
|
||||
|
||||
@@ -1686,7 +1689,7 @@ if ($action == 'create') {
|
||||
$colspan++;
|
||||
}
|
||||
|
||||
// Ligne dates prevues
|
||||
// Line dates planed
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="'.$colspan.'">';
|
||||
print $langs->trans("DateStartPlanned").' ';
|
||||
@@ -1786,7 +1789,7 @@ if ($action == 'create') {
|
||||
print '<table class="notopnoleftnoright tableforservicepart2'.($cursorline < $nbofservices ? ' boxtablenobottom' : '').'" width="100%">';
|
||||
|
||||
print '<tr class="oddeven" '.$moreparam.'>';
|
||||
print '<td>'.$langs->trans("ServiceStatus").': '.$object->lines[$cursorline - 1]->getLibStatut(4).'</td>';
|
||||
print '<td><span class="valignmiddle hideonsmartphone">'.$langs->trans("ServiceStatus").':</span> '.$object->lines[$cursorline - 1]->getLibStatut(4).'</td>';
|
||||
print '<td width="30" class="right">';
|
||||
if ($user->socid == 0) {
|
||||
if ($object->statut > 0 && $action != 'activateline' && $action != 'unactivateline') {
|
||||
|
||||
@@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('products', 'contracts', 'companies'));
|
||||
|
||||
$optioncss = GETPOST('optioncss', 'aZ09');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
@@ -58,7 +60,6 @@ $search_name = GETPOST("search_name", 'alpha');
|
||||
$search_contract = GETPOST("search_contract", 'alpha');
|
||||
$search_service = GETPOST("search_service", 'alpha');
|
||||
$search_status = GETPOST("search_status", 'alpha');
|
||||
$statut = GETPOST('statut', 'int') ?GETPOST('statut', 'int') : 1;
|
||||
$search_product_category = GETPOST('search_product_category', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'contractservicelist'.$mode;
|
||||
@@ -412,16 +413,16 @@ if (!empty($filter_op2) && $filter_op2 != -1) {
|
||||
if (!empty($filter_opcloture) && $filter_opcloture != -1) {
|
||||
$param .= '&filter_opcloture='.urlencode($filter_opcloture);
|
||||
}
|
||||
if ($filter_dateouvertureprevue != '') {
|
||||
if ($filter_dateouvertureprevue_start != '') {
|
||||
$param .= '&opouvertureprevueday='.$opouvertureprevueday.'&opouvertureprevuemonth='.$opouvertureprevuemonth.'&opouvertureprevueyear='.$opouvertureprevueyear;
|
||||
}
|
||||
if ($filter_date1 != '') {
|
||||
if ($filter_date1_start != '') {
|
||||
$param .= '&op1day='.$op1day.'&op1month='.$op1month.'&op1year='.$op1year;
|
||||
}
|
||||
if ($filter_date2 != '') {
|
||||
if ($filter_date2_start != '') {
|
||||
$param .= '&op2day='.$op2day.'&op2month='.$op2month.'&op2year='.$op2year;
|
||||
}
|
||||
if ($filter_datecloture != '') {
|
||||
if ($filter_datecloture_start != '') {
|
||||
$param .= '&opclotureday='.$op2day.'&opcloturemonth='.$op2month.'&opclotureyear='.$op2year;
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
|
||||
@@ -1473,7 +1473,7 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd
|
||||
$parameters['toselect'] = $toselect;
|
||||
$parameters['uploaddir'] = $uploaddir;
|
||||
$parameters['massaction'] = $massaction;
|
||||
$parameters['diroutputmassaction'] = $diroutputmassaction;
|
||||
$parameters['diroutputmassaction'] = isset($diroutputmassaction) ? $diroutputmassaction : null;
|
||||
|
||||
$reshook = $hookmanager->executeHooks('doMassActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
|
||||
@@ -182,10 +182,15 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
|
||||
|
||||
$tmparray = array();
|
||||
if (trim($_POST['sendto'])) {
|
||||
// Recipients are provided into free text
|
||||
// Recipients are provided into free text field
|
||||
$tmparray[] = trim($_POST['sendto']);
|
||||
}
|
||||
|
||||
if (trim($_POST['tomail'])) {
|
||||
// Recipients are provided into free hidden text field
|
||||
$tmparray[] = trim($_POST['tomail']);
|
||||
}
|
||||
|
||||
if (count($receiver) > 0) {
|
||||
// Recipient was provided from combo list
|
||||
foreach ($receiver as $key => $val) {
|
||||
@@ -311,7 +316,7 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
|
||||
$deliveryreceipt = $_POST['deliveryreceipt'];
|
||||
|
||||
if ($action == 'send' || $action == 'relance') {
|
||||
$actionmsg2 = $langs->transnoentities('MailSentBy').' '.CMailFile::getValidAddress($from, 4, 0, 1).' '.$langs->transnoentities('at').' '.CMailFile::getValidAddress($sendto, 4, 0, 1);
|
||||
$actionmsg2 = $langs->transnoentities('MailSentBy').' '.CMailFile::getValidAddress($from, 4, 0, 1).' '.$langs->transnoentities('To').' '.CMailFile::getValidAddress($sendto, 4, 0, 1);
|
||||
if ($message) {
|
||||
$actionmsg = $langs->transnoentities('MailFrom').': '.dol_escape_htmltag($from);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTo').': '.dol_escape_htmltag($sendto));
|
||||
|
||||
@@ -110,13 +110,13 @@ if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUST
|
||||
}
|
||||
|
||||
if (!empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire) {
|
||||
$arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||
$arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_supplier_proposal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||
}
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED)) {
|
||||
$arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
|
||||
$arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_supplier_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
|
||||
}
|
||||
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED)) {
|
||||
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_supplier_invoice', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||
}
|
||||
|
||||
// Customer payments
|
||||
|
||||
@@ -1628,7 +1628,7 @@ class CMailFile
|
||||
* @return array array of email => name
|
||||
* @see getValidAddress()
|
||||
*/
|
||||
public function getArrayAddress($address)
|
||||
public static function getArrayAddress($address)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
@@ -531,7 +531,7 @@ abstract class CommonDocGenerator
|
||||
$totalUp += $line->subprice * $line->qty;
|
||||
}
|
||||
|
||||
// @GS: Calculate total up and total discount percentage
|
||||
// Calculate total up and total discount percentage
|
||||
// Note that this added fields does not match a field into database in Dolibarr (Dolibarr manage discount on lines not as a global property of object)
|
||||
$resarray['object_total_up'] = $totalUp;
|
||||
$resarray['object_total_up_locale'] = price($resarray['object_total_up'], 0, $outputlangs);
|
||||
|
||||
@@ -3791,7 +3791,6 @@ abstract class CommonObject
|
||||
} elseif ($objecttype == 'contact') {
|
||||
$module = 'societe';
|
||||
}
|
||||
|
||||
// Set classfile
|
||||
$classfile = strtolower($subelement);
|
||||
$classname = ucfirst($subelement);
|
||||
@@ -3823,6 +3822,11 @@ abstract class CommonObject
|
||||
$classfile = 'conferenceorboothattendee';
|
||||
$classname = 'ConferenceOrBoothAttendee';
|
||||
$module = 'eventorganization';
|
||||
} elseif ($objecttype == 'conferenceorbooth') {
|
||||
$classpath = 'eventorganization/class';
|
||||
$classfile = 'conferenceorbooth';
|
||||
$classname = 'ConferenceOrBooth';
|
||||
$module = 'eventorganization';
|
||||
}
|
||||
|
||||
// Here $module, $classfile and $classname are set
|
||||
@@ -4107,7 +4111,7 @@ abstract class CommonObject
|
||||
$sql .= " SET ".$fieldstatus." = ".((int) $status);
|
||||
// If status = 1 = validated, update also fk_user_valid
|
||||
if ($status == 1 && $elementTable == 'expensereport') {
|
||||
$sql .= ", fk_user_valid = ".$user->id;
|
||||
$sql .= ", fk_user_valid = ".((int) $user->id);
|
||||
}
|
||||
$sql .= " WHERE rowid=".((int) $elementId);
|
||||
|
||||
|
||||
@@ -680,9 +680,7 @@ class dolReceiptPrinter extends Printer
|
||||
foreach ($object->lines as $line) {
|
||||
$total_localtax1 += $line->total_localtax1;
|
||||
}
|
||||
foreach ($vatarray as $vatkey => $vatvalue) {
|
||||
$this->printer->text(str_pad(price($total_localtax1), 10, ' ', STR_PAD_LEFT)."\n");
|
||||
}
|
||||
$this->printer->text(str_pad(price($total_localtax1), 10, ' ', STR_PAD_LEFT)."\n");
|
||||
break;
|
||||
case 'DOL_PRINT_OBJECT_TAX2':
|
||||
//var_dump($object);
|
||||
@@ -690,9 +688,7 @@ class dolReceiptPrinter extends Printer
|
||||
foreach ($object->lines as $line) {
|
||||
$total_localtax2 += $line->total_localtax2;
|
||||
}
|
||||
foreach ($vatarray as $vatkey => $vatvalue) {
|
||||
$this->printer->text(str_pad(price($total_localtax2), 10, ' ', STR_PAD_LEFT)."\n");
|
||||
}
|
||||
$this->printer->text(str_pad(price($total_localtax2), 10, ' ', STR_PAD_LEFT)."\n");
|
||||
break;
|
||||
case 'DOL_PRINT_OBJECT_TOTAL':
|
||||
$title = $langs->trans('TotalHT');
|
||||
|
||||
@@ -66,10 +66,12 @@ class GoogleAPI
|
||||
$i = 0;
|
||||
|
||||
// Desired address
|
||||
$urladdress = "https://maps.google.com/maps/geo?q=".urlencode($address)."&output=xml&key=".$this->key;
|
||||
$urladdress = "https://maps.google.com/maps/geo?q=".urlencode($address)."&output=xml&key=".urlencode($this->key);
|
||||
|
||||
// Retrieve the URL contents
|
||||
$page = file_get_contents($urladdress);
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||
$pagearray = getURLContent($urladdress, 'GET');
|
||||
$page = $pagearray['content'];
|
||||
|
||||
$code = strstr($page, '<coordinates>');
|
||||
$code = strstr($code, '>');
|
||||
|
||||
@@ -969,7 +969,7 @@ class Form
|
||||
$out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">';
|
||||
}
|
||||
$out .= $labeltoshow;
|
||||
$out .= '</option>';
|
||||
$out .= '</option>'."\n";
|
||||
}
|
||||
}
|
||||
$out .= '</select>';
|
||||
@@ -1267,16 +1267,17 @@ class Form
|
||||
// mode 1
|
||||
$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '');
|
||||
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
|
||||
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 1003; }</style>';
|
||||
if (empty($hidelabel)) {
|
||||
print $langs->trans("RefOrLabel").' : ';
|
||||
} elseif ($hidelabel > 1) {
|
||||
$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
|
||||
$placeholder = $langs->trans("RefOrLabel");
|
||||
if ($hidelabel == 2) {
|
||||
$out .= img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
}
|
||||
$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
|
||||
$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
|
||||
if ($hidelabel == 3) {
|
||||
$out .= img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
@@ -1951,15 +1952,12 @@ class Form
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
// Enhance with select2
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
|
||||
$out .= ajax_combobox($htmlname);
|
||||
|
||||
// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
|
||||
$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
|
||||
if ($show_empty && !$multiple) {
|
||||
@@ -2067,6 +2065,12 @@ class Form
|
||||
$out .= '<option value="">'.$langs->trans("None").'</option>';
|
||||
}
|
||||
$out .= '</select>';
|
||||
|
||||
if ($num) {
|
||||
// Enhance with select2
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
|
||||
$out .= ajax_combobox($htmlname);
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
@@ -4720,7 +4724,7 @@ class Form
|
||||
$more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n";
|
||||
foreach ($formquestion as $key => $input) {
|
||||
if (is_array($input) && !empty($input)) {
|
||||
$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : '');
|
||||
$size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead.
|
||||
$moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : '');
|
||||
$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
|
||||
|
||||
@@ -6661,11 +6665,8 @@ class Form
|
||||
$urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter);
|
||||
// Activate the auto complete using ajax call.
|
||||
$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
|
||||
if ($placeholder) {
|
||||
$placeholder = ' placeholder="'.$placeholder.'"';
|
||||
}
|
||||
$out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 1003; }</style>';
|
||||
$out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '') .' />';
|
||||
} else {
|
||||
// Immediate load of table record. Note: filter is inside $objecttmp->filter
|
||||
$out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled);
|
||||
@@ -7642,6 +7643,10 @@ class Form
|
||||
$tplpath = 'expensereport';
|
||||
} elseif ($objecttype == 'subscription') {
|
||||
$tplpath = 'adherents';
|
||||
} elseif ($objecttype == 'conferenceorbooth') {
|
||||
$tplpath = 'eventorganization';
|
||||
} elseif ($objecttype == 'conferenceorboothattendee') {
|
||||
$tplpath = 'eventorganization';
|
||||
}
|
||||
|
||||
global $linkedObjectBlock;
|
||||
|
||||
@@ -97,7 +97,7 @@ class FormActions
|
||||
function select_status() {
|
||||
var defaultvalue = $('#select' + htmlname).val();
|
||||
var percentage = $('input[name=percentage]');
|
||||
var selected = '".(isset($selected) ? $selected : '')."';
|
||||
var selected = '".(isset($selected) ? dol_escape_js($selected) : '')."';
|
||||
var value = (selected>0?selected:(defaultvalue>=0?defaultvalue:''));
|
||||
|
||||
percentage.val(value);
|
||||
|
||||
@@ -981,13 +981,15 @@ class FormFile
|
||||
* You may want to call this into a div like this:
|
||||
* print '<div class="inline-block valignmiddle">'.$formfile->getDocumentsLink($element_doc, $filename, $filedir).'</div>';
|
||||
*
|
||||
* @param string $modulepart propal, facture, facture_fourn, ...
|
||||
* @param string $modulepart 'propal', 'facture', 'facture_fourn', ...
|
||||
* @param string $modulesubdir Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module.
|
||||
* @param string $filedir Full path to directory to scan
|
||||
* @param string $filter Filter filenames on this regex string (Example: '\.pdf$')
|
||||
* @param string $morecss Add more css to the download picto
|
||||
* @param string $allfiles 0=Only generated docs, 1=All files
|
||||
* @return string Output string with HTML link of documents (might be empty string). This also fill the array ->infofiles
|
||||
*/
|
||||
public function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = '')
|
||||
public function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = '', $morecss = 'valignmiddle', $allfiles = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@@ -1005,12 +1007,11 @@ class FormFile
|
||||
$entity = ((!empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default
|
||||
}
|
||||
|
||||
// Get list of files starting with name of ref (but not followed by "-" to discard uploaded files and get only generated files)
|
||||
// @todo Why not showing by default all files by just removing the '[^\-]+' at end of regex ?
|
||||
if (!empty($conf->global->MAIN_SHOW_ALL_FILES_ON_DOCUMENT_TOOLTIP)) {
|
||||
$filterforfilesearch = preg_quote(basename($modulesubdir), '/');
|
||||
// Get list of files starting with name of ref (Note: files with '^ref\.extension' are generated files, files with '^ref-...' are uploaded files)
|
||||
if ($allfiles || !empty($conf->global->MAIN_SHOW_ALL_FILES_ON_DOCUMENT_TOOLTIP)) {
|
||||
$filterforfilesearch = '^'.preg_quote(basename($modulesubdir), '/');
|
||||
} else {
|
||||
$filterforfilesearch = preg_quote(basename($modulesubdir), '/').'[^\-]+';
|
||||
$filterforfilesearch = '^'.preg_quote(basename($modulesubdir), '/').'\.';
|
||||
}
|
||||
$file_list = dol_dir_list($filedir, 'files', 0, $filterforfilesearch, '\.meta$|\.png$'); // We also discard .meta and .png preview
|
||||
|
||||
@@ -1019,7 +1020,7 @@ class FormFile
|
||||
$out .= '<!-- html.formfile::getDocumentsLink -->'."\n";
|
||||
if (!empty($file_list)) {
|
||||
$out = '<dl class="dropdown inline-block">
|
||||
<dt><a data-ajax="false" href="#" onClick="return false;">'.img_picto('', 'listlight', '', 0, 0, 0, '', 'valignmiddle').'</a></dt>
|
||||
<dt><a data-ajax="false" href="#" onClick="return false;">'.img_picto('', 'listlight', '', 0, 0, 0, '', $morecss).'</a></dt>
|
||||
<dd><div class="multichoicedoc" style="position:absolute;left:100px;" ><ul class="ulselectedfields">';
|
||||
$tmpout = '';
|
||||
|
||||
@@ -1182,7 +1183,7 @@ class FormFile
|
||||
);
|
||||
$reshook = $hookmanager->executeHooks('showFilesList', $parameters, $object);
|
||||
|
||||
if (isset($reshook) && $reshook != '') { // null or '' for bypass
|
||||
if (!empty($reshook)) { // null or '' for bypass
|
||||
return $reshook;
|
||||
} else {
|
||||
if (!is_object($form)) {
|
||||
|
||||
@@ -1255,7 +1255,7 @@ class FormMail extends Form
|
||||
*/
|
||||
public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '')
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $langs;
|
||||
|
||||
$ret = new ModelMail();
|
||||
|
||||
|
||||
@@ -515,7 +515,7 @@ class Notify
|
||||
case 'SHIPPING_VALIDATE':
|
||||
$link = '<a href="'.$urlwithroot.'/expedition/card.php?id='.$object->id.'&entity='.$object->entity.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->expedition->dir_output."/sending/".get_exdir(0, 0, 0, 1, $object, 'shipment');
|
||||
$object_type = 'expedition';
|
||||
$object_type = 'shipping';
|
||||
$labeltouse = $conf->global->SHIPPING_VALIDATE_TEMPLATE;
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated", $link);
|
||||
break;
|
||||
@@ -687,7 +687,7 @@ class Notify
|
||||
break;
|
||||
case 'BILL_PAYED':
|
||||
$link = '<a href="'.$urlwithroot.'/compta/facture/card.php?facid='.$object->id.'&entity='.$object->entity.'">'.$newref.'</a>';
|
||||
$dir_output = $$conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice');
|
||||
$dir_output = $conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice');
|
||||
$object_type = 'facture';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoicePayed", $link);
|
||||
break;
|
||||
|
||||
@@ -131,8 +131,8 @@ function check_events() {
|
||||
|
||||
if (value.type == 'agenda')
|
||||
{
|
||||
url = '<?php print DOL_URL_ROOT.'/comm/action/card.php?id='; ?>' + value.id_agenda;
|
||||
title = '<?php print dol_escape_js($langs->trans('EventReminder')) ?>';
|
||||
url = '<?php print DOL_URL_ROOT.'/comm/action/card.php?id='; ?>' + value.id_agenda;
|
||||
title = '<?php print dol_escape_js($langs->transnoentities('EventReminder')) ?>';
|
||||
}
|
||||
var extra = {
|
||||
icon: '<?php print DOL_URL_ROOT.'/theme/common/bell.png'; ?>',
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (C) 2014 delcroip <delcroip@gmail.com>
|
||||
* Copyright (C) 2015-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2021 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
*
|
||||
* 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
|
||||
@@ -257,7 +258,7 @@ function updateTotal(days,mode)
|
||||
result=parseTime(jQuery('.totalDay'+stringdays).text(),taskTime);
|
||||
if (result >= 0)
|
||||
{
|
||||
totalhour = totalhour + taskTime.getHours();
|
||||
totalhour = totalhour + taskTime.getHours() + result*24;
|
||||
totalmin = totalmin + taskTime.getMinutes();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1526,10 +1526,11 @@ function complete_elementList_with_modules(&$elementList)
|
||||
* @param array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label)
|
||||
* where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
|
||||
* @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (deprecated), 2=No form nor button at all, 3=No form nor button at all and each field has a unique name (form is output by caller, recommended)
|
||||
* @param string $helptext Help
|
||||
* @param string $helptext Tooltip help to use for the column name of values
|
||||
* @param string $text Text to use for the column name of values
|
||||
* @return void
|
||||
*/
|
||||
function form_constantes($tableau, $strictw3c = 0, $helptext = '')
|
||||
function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Value')
|
||||
{
|
||||
global $db, $langs, $conf, $user;
|
||||
global $_Avery_Labels;
|
||||
@@ -1550,7 +1551,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '')
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="">'.$langs->trans("Description").'</td>';
|
||||
print '<td>';
|
||||
$text = $langs->trans("Value");
|
||||
$text = $langs->trans($text);
|
||||
print $form->textwithpicto($text, $helptext, 1, 'help', '', 0, 2, 'idhelptext');
|
||||
print '</td>';
|
||||
if (empty($strictw3c)) {
|
||||
|
||||
@@ -61,13 +61,13 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
|
||||
// Filters
|
||||
//print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="get">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="year" value="'.$year.'">';
|
||||
print '<input type="hidden" name="month" value="'.$month.'">';
|
||||
print '<input type="hidden" name="day" value="'.$day.'">';
|
||||
print '<input type="hidden" name="year" value="'.((int) $year).'">';
|
||||
print '<input type="hidden" name="month" value="'.((int) $month).'">';
|
||||
print '<input type="hidden" name="day" value="'.((int) $day).'">';
|
||||
if ($massaction != 'predelete' && $massaction != 'preaffecttag') { // When $massaction == 'predelete', action may be already output to 'delete' by the mass action system.
|
||||
print '<input type="hidden" name="action" value="'.$action.'">';
|
||||
}
|
||||
print '<input type="hidden" name="search_showbirthday" value="'.$showbirthday.'">';
|
||||
print '<input type="hidden" name="search_showbirthday" value="'.((int) $showbirthday).'">';
|
||||
|
||||
if ($canedit) {
|
||||
print '<div class="divsearchfield">';
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/core/lib/barcode.lib.php
|
||||
* \brief Set of functions used for barcode generation
|
||||
* \brief Set of functions used for barcode generation (internal lib, also code 'phpbarcode')
|
||||
* \ingroup core
|
||||
*/
|
||||
|
||||
@@ -69,7 +69,7 @@ if (defined('PHP-BARCODE_PATH_COMMAND')) {
|
||||
* Print barcode
|
||||
*
|
||||
* @param string $code Code
|
||||
* @param string $encoding Encoding
|
||||
* @param string $encoding Encoding ('EAN13', 'ISBN', 'C128', 'UPC', 'CBR', 'QRCODE', 'DATAMATRIX', 'ANY'...)
|
||||
* @param integer $scale Scale
|
||||
* @param string $mode 'png' or 'jpg' ...
|
||||
* @return array|string $bars array('encoding': the encoding which has been used, 'bars': the bars, 'text': text-positioning info) or string with error message
|
||||
@@ -149,12 +149,10 @@ function barcode_encode($code, $encoding)
|
||||
dol_syslog("barcode.lib.php::barcode_encode Use genbarcode ".$genbarcode_loc." code=".$code." encoding=".$encoding);
|
||||
$bars = barcode_encode_genbarcode($code, $encoding);
|
||||
} else {
|
||||
print "barcode_encode needs an external programm for encodings other then EAN/ISBN (code=".$code.", encoding=".$encoding.")<BR>\n";
|
||||
print "barcode_encode needs an external program for encodings other then EAN/ISBN (code=".dol_escape_htmltag($code).", encoding=".dol_escape_htmltag($encoding).")<BR>\n";
|
||||
print "<UL>\n";
|
||||
print "<LI>download gnu-barcode from <A href=\"https://www.gnu.org/software/barcode/\">www.gnu.org/software/barcode/</A>\n";
|
||||
print "<LI>compile and install them\n";
|
||||
print "<LI>download genbarcode from <A href=\"http://www.ashberg.de/bar/\">www.ashberg.de/bar/</A>\n";
|
||||
print "<LI>compile and install them\n";
|
||||
print "<LI>specify path the genbarcode in barcode module setup\n";
|
||||
print "</UL>\n";
|
||||
print "<BR>\n";
|
||||
|
||||
@@ -1948,7 +1948,9 @@ function show_subsidiaries($conf, $langs, $db, $object)
|
||||
$socstatic = new Societe($db);
|
||||
|
||||
print load_fiche_titre($langs->trans("Subsidiaries"), '', '');
|
||||
print "\n".'<table class="noborder centpercent">'."\n";
|
||||
|
||||
print "\n".'<div class="div-table-responsive-no-min">'."\n";
|
||||
print '<table class="noborder centpercent">'."\n";
|
||||
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Company").'</td>';
|
||||
print '<td>'.$langs->trans("Address").'</td><td>'.$langs->trans("Zip").'</td>';
|
||||
@@ -1976,17 +1978,17 @@ function show_subsidiaries($conf, $langs, $db, $object)
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
print $socstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
print '<td>'.$obj->address.'</td>';
|
||||
print '<td>'.$obj->zip.'</td>';
|
||||
print '<td>'.$obj->town.'</td>';
|
||||
print '<td>'.$obj->code_client.'</td>';
|
||||
print '<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->address).'">'.dol_escape_htmltag($obj->address).'</td>';
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->zip).'">'.$obj->zip.'</td>';
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->town).'">'.$obj->town.'</td>';
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->code_client).'">'.$obj->code_client.'</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/societe/card.php?socid='.$obj->rowid.'&action=edit">';
|
||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/societe/card.php?socid='.((int) $obj->rowid).'&action=edit">';
|
||||
print img_edit();
|
||||
print '</a></td>';
|
||||
|
||||
@@ -1994,6 +1996,7 @@ function show_subsidiaries($conf, $langs, $db, $object)
|
||||
$i++;
|
||||
}
|
||||
print "\n</table>\n";
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
@@ -2235,7 +2235,7 @@ function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('(
|
||||
* Security check when accessing to a document (used by document.php, viewimage.php and webservices to get documents).
|
||||
* TODO Replace code that set $accesallowed by a call to restrictedArea()
|
||||
*
|
||||
* @param string $modulepart Module of document ('module', 'module_user_temp', 'module_user' or 'module_temp')
|
||||
* @param string $modulepart Module of document ('module', 'module_user_temp', 'module_user' or 'module_temp'). Exemple: 'medias', 'invoice', 'logs', 'tax-vat', ...
|
||||
* @param string $original_file Relative path with filename, relative to modulepart.
|
||||
* @param string $entity Restrict onto entity (0=no restriction)
|
||||
* @param User $fuser User object (forced)
|
||||
@@ -2263,10 +2263,13 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
$entity = 0;
|
||||
}
|
||||
}
|
||||
// Fix modulepart
|
||||
// Fix modulepart for backward compatibility
|
||||
if ($modulepart == 'users') {
|
||||
$modulepart = 'user';
|
||||
}
|
||||
if ($modulepart == 'tva') {
|
||||
$modulepart = 'tax-vat';
|
||||
}
|
||||
|
||||
//print 'dol_check_secure_access_document modulepart='.$modulepart.' original_file='.$original_file.' entity='.$entity;
|
||||
dol_syslog('dol_check_secure_access_document modulepart='.$modulepart.' original_file='.$original_file.' entity='.$entity);
|
||||
@@ -2436,7 +2439,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
$accessallowed = 1;
|
||||
}
|
||||
$original_file = (!empty($conf->product->multidir_temp[$entity]) ? $conf->product->multidir_temp[$entity] : $conf->service->multidir_temp[$entity]).'/'.$original_file;
|
||||
} elseif (in_array($modulepart, array('tax', 'tax-vat')) && !empty($conf->tax->dir_output)) {
|
||||
} elseif (in_array($modulepart, array('tax', 'tax-vat', 'tva')) && !empty($conf->tax->dir_output)) {
|
||||
// Wrapping for taxes
|
||||
if ($fuser->rights->tax->charges->{$lire}) {
|
||||
$accessallowed = 1;
|
||||
|
||||
@@ -2700,7 +2700,7 @@ function convertBackOfficeMediasLinksToPublicLinks($notetoshow)
|
||||
* Function to format a value into a defined format for French administration (no thousand separator & decimal separator force to ',' with two decimals)
|
||||
* Function used into accountancy FEC export
|
||||
*
|
||||
* @param float $amount Amount to format
|
||||
* @param float $amount Amount to format
|
||||
* @return string Chain with formatted upright
|
||||
* @see price2num() Format a numeric into a price for FEC files
|
||||
*/
|
||||
|
||||
@@ -98,7 +98,7 @@ function dol_decode($chain, $key = '1')
|
||||
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt (used only if hashing algorightm is something else than 'password_hash').
|
||||
*
|
||||
* @param string $chain String to hash
|
||||
* @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap with no salt, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
|
||||
* @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap with no salt, '5':sha256, '6':password_hash). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
|
||||
* @return string Hash of string
|
||||
* @see getRandomPassword()
|
||||
*/
|
||||
@@ -124,8 +124,10 @@ function dol_hash($chain, $type = '0')
|
||||
return md5($chain);
|
||||
} elseif ($type == '4' || $type == 'md5openldap') {
|
||||
return '{md5}'.base64_encode(mhash(MHASH_MD5, $chain)); // For OpenLdap with md5 (based on an unencrypted password in base)
|
||||
} elseif ($type == '5') {
|
||||
} elseif ($type == '5' || $type == 'sha256') {
|
||||
return hash('sha256', $chain);
|
||||
} elseif ($type == '6' || $type == 'password_hash') {
|
||||
return password_hash($chain, PASSWORD_DEFAULT);
|
||||
} elseif (!empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') {
|
||||
return sha1($chain);
|
||||
} elseif (!empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') {
|
||||
|
||||
@@ -334,7 +334,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
// Accounting
|
||||
$tmpentry = array(
|
||||
'enabled'=>(!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled) || !empty($conf->asset->enabled) || !empty($conf->intracommreport->enabled)),
|
||||
'perms'=>(!empty($user->rights->compta->resultat->lire) || !empty($user->rights->accounting->mouvements->lire) || !empty($user->rights->asset->read) || !empty($user->rights->intracommreport->read)),
|
||||
'perms'=>(!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)),
|
||||
'module'=>'comptabilite|accounting|asset|intracommreport'
|
||||
);
|
||||
$menu_arr[] = array(
|
||||
@@ -1205,7 +1205,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
|
||||
// Accounting (Double entries)
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
$permtoshowmenu = (!empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire);
|
||||
//$permtoshowmenu = (!empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire);
|
||||
//$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy');
|
||||
|
||||
// Configuration
|
||||
@@ -1342,10 +1342,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
}
|
||||
|
||||
// Accounting
|
||||
$newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->rights->accounting->mouvements->lire, '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"'));
|
||||
|
||||
// Balance
|
||||
$newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire);
|
||||
$newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->rights->accounting->mouvements->lire || $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"'));
|
||||
|
||||
// General Ledger
|
||||
$newmenu->add("/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->rights->accounting->mouvements->lire);
|
||||
@@ -1353,6 +1350,9 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
// Journals
|
||||
$newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Journals"), 1, $user->rights->accounting->mouvements->lire);
|
||||
|
||||
// Account Balance
|
||||
$newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire);
|
||||
|
||||
// Files
|
||||
if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) {
|
||||
$newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire);
|
||||
@@ -1732,11 +1732,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
|
||||
$titleboth = $langs->trans("LeadsOrProjects");
|
||||
$titlenew = $langs->trans("NewLeadOrProject"); // Leads and opportunities by default
|
||||
if ($conf->global->PROJECT_USE_OPPORTUNITIES == 0) {
|
||||
if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 0) {
|
||||
$titleboth = $langs->trans("Projects");
|
||||
$titlenew = $langs->trans("NewProject");
|
||||
}
|
||||
if ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
|
||||
if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
|
||||
$titleboth = $langs->trans("Leads");
|
||||
$titlenew = $langs->trans("NewLead");
|
||||
}
|
||||
@@ -1745,13 +1745,13 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
$newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="pictofixedwidth"'));
|
||||
$newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->rights->projet->creer);
|
||||
|
||||
if ($conf->global->PROJECT_USE_OPPORTUNITIES == 0) {
|
||||
if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 0) {
|
||||
$newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list');
|
||||
} elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 1) {
|
||||
} elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 1) {
|
||||
$newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $showmode, '', 'project', 'list');
|
||||
$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99&search_opp_status=openedopp&contextpage=lead', $langs->trans("ListOpenLeads"), 2, $showmode);
|
||||
$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', $langs->trans("ListOpenProjects"), 2, $showmode);
|
||||
} elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
|
||||
} elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
|
||||
$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans("List"), 2, $showmode);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/**
|
||||
* \file htdocs/core/modules/barcode/doc/phpbarcode.modules.php
|
||||
* \ingroup barcode
|
||||
* \brief File with class to generate barcode images using php barcode generator
|
||||
* \brief File with class to generate barcode images using php internal lib barcode generator
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/barcode/modules_barcode.class.php';
|
||||
@@ -126,7 +126,7 @@ class modPhpbarcode extends ModeleBarCode
|
||||
*
|
||||
* @param string $code Value to encode
|
||||
* @param string $encoding Mode of encoding
|
||||
* @param string $readable Code can be read
|
||||
* @param string $readable Code can be read (What is this ? is this used ?)
|
||||
* @param integer $scale Scale
|
||||
* @param integer $nooutputiferror No output if error
|
||||
* @return int <0 if KO, >0 if OK
|
||||
@@ -163,7 +163,7 @@ class modPhpbarcode extends ModeleBarCode
|
||||
if (!is_array($result)) {
|
||||
$this->error = $result;
|
||||
if (empty($nooutputiferror)) {
|
||||
print $this->error;
|
||||
print dol_escape_htmltag($this->error);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ class modTcpdfbarcode extends ModeleBarCode
|
||||
*
|
||||
* @param string $code Value to encode
|
||||
* @param string $encoding Mode of encoding
|
||||
* @param string $readable Code can be read
|
||||
* @param string $readable Code can be read (What is this ? is this used ?)
|
||||
* @param integer $scale Scale (not used with this engine)
|
||||
* @param integer $nooutputiferror No output if error (not used with this engine)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
|
||||
@@ -138,7 +138,7 @@ abstract class ModeleNumRefBarCode
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->loadLangs(array("admin", "companies"));
|
||||
|
||||
$s = '';
|
||||
$s .= $langs->trans("Name").': <b>'.$this->name.'</b><br>';
|
||||
|
||||
@@ -140,16 +140,20 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql .= " ORDER BY sp.poste";
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
$s .= $langs->trans("PostOrFunction").': ';
|
||||
$s .= '<select name="filter_jobposition" class="flat">';
|
||||
$s .= $langs->trans("PostOrFunction").' ';
|
||||
$s .= '<select name="filter_jobposition" class="flat marginrightonly" placeholder="'.dol_escape_htmltag($langs->trans("PostOrFunction")).'">';
|
||||
$s .= '<option value="all"> </option>';
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$s .= '<option value="'.dol_escape_htmltag($obj->poste).'">'.dol_escape_htmltag($obj->poste).' ('.$obj->nb.')</option>';
|
||||
$i++;
|
||||
if ($num > 0) {
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$s .= '<option value="'.dol_escape_htmltag($obj->poste).'">'.dol_escape_htmltag($obj->poste).' ('.$obj->nb.')</option>';
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
$s .= '<option disabled="disabled" value="">'.$langs->trans("None").'</option>';
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
@@ -159,7 +163,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$s .= ' ';
|
||||
|
||||
// Filter on contact category
|
||||
$s .= $langs->trans("ContactCategoriesShort").': ';
|
||||
$s .= $langs->trans("ContactCategoriesShort").' ';
|
||||
$sql = "SELECT c.label, count(distinct(sp.email)) AS nb";
|
||||
$sql .= " FROM ";
|
||||
$sql .= " ".MAIN_DB_PREFIX."socpeople as sp,";
|
||||
@@ -175,7 +179,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql .= " ORDER BY c.label";
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
$s .= '<select name="filter_category" class="flat">';
|
||||
$s .= '<select name="filter_category" class="flat marginrightonly">';
|
||||
$s .= '<option value="all"> </option>';
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
@@ -197,8 +201,8 @@ class mailing_contacts1 extends MailingTargets
|
||||
$s .= '<br>';
|
||||
|
||||
// Add prospect of a particular level
|
||||
$s .= $langs->trans("NatureOfThirdParty").': ';
|
||||
$s .= '<select name="filter" class="flat">';
|
||||
$s .= $langs->trans("NatureOfThirdParty").' ';
|
||||
$s .= '<select name="filter" class="flat marginrightonly">';
|
||||
$sql = "SELECT code, label";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_prospectlevel";
|
||||
$sql .= " WHERE active > 0";
|
||||
@@ -234,7 +238,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$s .= ' ';
|
||||
|
||||
// Filter on thirdparty category
|
||||
$s .= $langs->trans("CustomersProspectsCategoriesShort").': ';
|
||||
$s .= $langs->trans("CustomersProspectsCategoriesShort").' ';
|
||||
$sql = "SELECT c.label, count(distinct(sp.email)) AS nb";
|
||||
$sql .= " FROM ";
|
||||
$sql .= " ".MAIN_DB_PREFIX."socpeople as sp,";
|
||||
@@ -250,7 +254,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql .= " ORDER BY c.label";
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
$s .= '<select name="filter_category_customer" class="flat">';
|
||||
$s .= '<select name="filter_category_customer" class="flat marginrightonly maxwidth200">';
|
||||
$s .= '<option value="all"> </option>';
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
@@ -272,7 +276,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$s .= ' ';
|
||||
|
||||
// Filter on thirdparty category
|
||||
$s .= $langs->trans("SuppliersCategoriesShort").': ';
|
||||
$s .= $langs->trans("SuppliersCategoriesShort").' ';
|
||||
$sql = "SELECT c.label, count(distinct(sp.email)) AS nb";
|
||||
$sql .= " FROM ";
|
||||
$sql .= " ".MAIN_DB_PREFIX."socpeople as sp,";
|
||||
@@ -288,7 +292,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql .= " ORDER BY c.label";
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
$s .= '<select name="filter_category_supplier" class="flat">';
|
||||
$s .= '<select name="filter_category_supplier" class="flat marginrightonly maxwidth200">';
|
||||
$s .= '<option value="all"> </option>';
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
/**
|
||||
* \file htdocs/core/modules/mailings/pomme.modules.php
|
||||
* \ingroup mailing
|
||||
* \brief File of class to offer a selector of emailing targets with Rule 'Pomme'.
|
||||
* \brief File of class to offer a selector of emailing targets of users.
|
||||
*/
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
|
||||
|
||||
|
||||
/**
|
||||
* Class to offer a selector of emailing targets with Rule 'Peche'.
|
||||
* Class to offer a selector of emailing targets with Rule 'Pomme'.
|
||||
*/
|
||||
class mailing_pomme extends MailingTargets
|
||||
{
|
||||
@@ -119,16 +119,16 @@ class mailing_pomme extends MailingTargets
|
||||
$langs->load("users");
|
||||
|
||||
$s = '';
|
||||
$s .= $langs->trans("Status").': ';
|
||||
$s .= '<select name="filter" class="flat">';
|
||||
$s .= $langs->trans("Status").' ';
|
||||
$s .= '<select name="filter" class="flat marginrightonly">';
|
||||
$s .= '<option value="-1"> </option>';
|
||||
$s .= '<option value="1">'.$langs->trans("Enabled").'</option>';
|
||||
$s .= '<option value="0">'.$langs->trans("Disabled").'</option>';
|
||||
$s .= '</select>';
|
||||
|
||||
$s .= ' ';
|
||||
$s .= $langs->trans("Employee").': ';
|
||||
$s .= '<select name="filteremployee" class="flat">';
|
||||
$s .= $langs->trans("Employee").' ';
|
||||
$s .= '<select name="filteremployee" class="flat marginrightonly">';
|
||||
$s .= '<option value="-1"> </option>';
|
||||
$s .= '<option value="1">'.$langs->trans("Yes").'</option>';
|
||||
$s .= '<option value="0">'.$langs->trans("No").'</option>';
|
||||
|
||||
@@ -226,8 +226,8 @@ class mailing_thirdparties extends MailingTargets
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
$s = $langs->trans("Categories").': ';
|
||||
$s .= '<select name="filter" class="flat">';
|
||||
$s = $langs->trans("Categories").' ';
|
||||
$s .= '<select name="filter" class="flat marginrightonly">';
|
||||
|
||||
// Show categories
|
||||
$sql = "SELECT rowid, label, type, visible";
|
||||
@@ -276,7 +276,7 @@ class mailing_thirdparties extends MailingTargets
|
||||
|
||||
$s .= '</select> ';
|
||||
$s .= $langs->trans('ProspectCustomer');
|
||||
$s .= ': <select name="filter_client" class="flat">';
|
||||
$s .= ' <select name="filter_client" class="flat marginrightonly">';
|
||||
$s .= '<option value="-1"> </option>';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
|
||||
$s .= '<option value="2">'.$langs->trans('Prospect').'</option>';
|
||||
@@ -292,7 +292,7 @@ class mailing_thirdparties extends MailingTargets
|
||||
$s .= '</select> ';
|
||||
|
||||
$s .= $langs->trans("Status");
|
||||
$s .= ': <select name="filter_status" class="flat">';
|
||||
$s .= ' <select name="filter_status" class="flat marginrightonly">';
|
||||
$s .= '<option value="-1"> </option>';
|
||||
$s .= '<option value="1" selected>'.$langs->trans("Enabled").'</option>';
|
||||
$s .= '<option value="0">'.$langs->trans("Disabled").'</option>';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2021 Ferran Marcet <fmarcet@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
|
||||
@@ -148,19 +149,19 @@ class modStock extends DolibarrModules
|
||||
$this->rights[4][4] = 'mouvement';
|
||||
$this->rights[4][5] = 'creer';
|
||||
|
||||
$this->rights[5][0] = 1011;
|
||||
$this->rights[5][1] = 'inventoryReadPermission'; // Permission label
|
||||
$this->rights[5][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
|
||||
$this->rights[6][0] = 1012;
|
||||
$this->rights[6][1] = 'inventoryCreatePermission'; // Permission label
|
||||
$this->rights[6][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
$this->rights[5][0] = 1011;
|
||||
$this->rights[5][1] = 'inventoryReadPermission'; // Permission label
|
||||
$this->rights[5][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
|
||||
$this->rights[6][0] = 1012;
|
||||
$this->rights[6][1] = 'inventoryCreatePermission'; // Permission label
|
||||
$this->rights[6][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
$this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
|
||||
|
||||
$this->rights[8][0] = 1014;
|
||||
$this->rights[8][1] = 'inventoryValidatePermission'; // Permission label
|
||||
$this->rights[8][3] = 0; // Permission by default for new user (0/1)
|
||||
|
||||
@@ -122,8 +122,18 @@ class modTicket extends DolibarrModules
|
||||
}
|
||||
$this->dictionaries = array(
|
||||
'langs' => 'ticket',
|
||||
'tabname' => array(MAIN_DB_PREFIX."c_ticket_type", MAIN_DB_PREFIX."c_ticket_severity", MAIN_DB_PREFIX."c_ticket_category", MAIN_DB_PREFIX."c_ticket_resolution"),
|
||||
'tablib' => array("TicketDictType", "TicketDictSeverity", "TicketDictCategory", "TicketDictResolution"),
|
||||
'tabname' => array(
|
||||
MAIN_DB_PREFIX."c_ticket_type",
|
||||
MAIN_DB_PREFIX."c_ticket_severity",
|
||||
MAIN_DB_PREFIX."c_ticket_category",
|
||||
MAIN_DB_PREFIX."c_ticket_resolution"
|
||||
),
|
||||
'tablib' => array(
|
||||
"TicketDictType",
|
||||
"TicketDictSeverity",
|
||||
"TicketDictCategory",
|
||||
"TicketDictResolution"
|
||||
),
|
||||
'tabsql' => array(
|
||||
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_type as f',
|
||||
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_severity as f',
|
||||
@@ -135,7 +145,7 @@ class modTicket extends DolibarrModules
|
||||
'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public", "code,label,pos,use_default"),
|
||||
'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public", "code,label,pos,use_default"),
|
||||
'tabrowid' => array("rowid", "rowid", "rowid", "rowid"),
|
||||
'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled),
|
||||
'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled && !empty($conf->global->TICKET_ENABLE_RESOLUTION)),
|
||||
'tabhelp' => array(
|
||||
array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")),
|
||||
array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")),
|
||||
|
||||
@@ -118,7 +118,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("ProductCodeModel").'):</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="value1" value="'.(!empty($conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT) ? $conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT : '').'"'.$disabled.'>', $tooltip, 1, 1).'</td>';
|
||||
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"'.$disabled.'></td>';
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button small" value="'.$langs->trans("Modify").'" name="Button"'.$disabled.'></td>';
|
||||
|
||||
$texte .= '</tr>';
|
||||
|
||||
|
||||
@@ -193,7 +193,8 @@ abstract class ModeleProductCode
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->loadLangs(array("admin", "companies"));
|
||||
|
||||
$strikestart = '';
|
||||
$strikeend = '';
|
||||
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {
|
||||
|
||||
@@ -524,8 +524,8 @@ class doc_generic_task_odt extends ModelePDFTask
|
||||
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
|
||||
|
||||
dol_mkdir($conf->projet->dir_temp);
|
||||
if (!is_writable($conf->task->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->task->dir_temp;
|
||||
if (!is_writable($conf->projet->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->projet->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -198,7 +198,8 @@ abstract class ModeleThirdPartyCode
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->loadLangs(array("admin", "companies"));
|
||||
|
||||
$strikestart = '';
|
||||
$strikeend = '';
|
||||
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/core/search_page.php
|
||||
* \brief File to return a page with search boxes
|
||||
* \brief File to return a page with the complete search form (all search input fields)
|
||||
*/
|
||||
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
||||
@@ -77,7 +77,7 @@ $hookmanager->initHooks(array('searchform'));
|
||||
// Define $searchform
|
||||
$searchform = '';
|
||||
|
||||
if ($conf->use_javascript_ajax && 1 == 2) { // select2 is ko with jmobile
|
||||
if ($conf->use_javascript_ajax && 1 == 2) { // select2 is not best with smartphone
|
||||
if (!is_object($form)) {
|
||||
$form = new Form($db);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object,
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
$params = array();
|
||||
$params['cols'] = $parameters['colspanvalue'];
|
||||
$params['cols'] = isset($parameters['colspanvalue']) ? $parameters['colspanvalue'] : null;
|
||||
print $object->showOptionals($extrafields, 'edit', $params);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ if (!empty($extrafieldsobjectkey) && !empty($search_array_options) && is_array($
|
||||
if (is_array($crit)) {
|
||||
$crit = implode(' ', $crit); // natural_search() expects a string
|
||||
} elseif ($typ === 'select' and is_string($crit) and strpos($crit, ' ') === false) {
|
||||
$sql .= ' AND ('.$extrafieldsobjectprefix.$tmpkey.' = "'.$db->escape($crit).'")';
|
||||
$sql .= " AND (".$extrafieldsobjectprefix.$tmpkey." = '".$db->escape($crit)."')";
|
||||
continue;
|
||||
}
|
||||
$sql .= natural_search($extrafieldsobjectprefix.$tmpkey, $crit, $mode_search);
|
||||
|
||||
@@ -197,7 +197,7 @@ if ($massaction == 'presend') {
|
||||
// Allow Pre-Mass-Action hook (eg for confirmation dialog)
|
||||
$parameters = array(
|
||||
'toselect' => $toselect,
|
||||
'uploaddir' => $uploaddir
|
||||
'uploaddir' => isset($uploaddir) ? $uploaddir : null
|
||||
);
|
||||
|
||||
$reshook = $hookmanager->executeHooks('doPreMassActions', $parameters, $object, $action);
|
||||
|
||||
@@ -264,7 +264,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
||||
$qtyordred = array();
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
|
||||
//find all shippement on order origin
|
||||
// Find all shipments on order origin
|
||||
$order = new Commande($this->db);
|
||||
$ret = $order->fetch($object->origin_id);
|
||||
if ($ret < 0) {
|
||||
@@ -309,10 +309,10 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
||||
$diff_array = array_diff_assoc($qtyordred, $qtyshipped);
|
||||
if (count($diff_array) == 0) {
|
||||
//No diff => mean everythings is shipped
|
||||
$ret = $object->setStatut(Commande::STATUS_CLOSED, $object->origin_id, $object->origin, 'ORDER_CLOSE');
|
||||
$ret = $order->setStatut(Commande::STATUS_CLOSED, $object->origin_id, $object->origin, 'ORDER_CLOSE');
|
||||
if ($ret < 0) {
|
||||
$this->error = $object->error;
|
||||
$this->errors = $object->errors;
|
||||
$this->error = $order->error;
|
||||
$this->errors = $order->errors;
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -936,7 +936,11 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
}
|
||||
}
|
||||
|
||||
$object->actionmsg = dol_concatdesc($langs->transnoentities("Author").': '.$user->login, $object->actionmsg);
|
||||
if (!empty($user->login)) {
|
||||
$object->actionmsg = dol_concatdesc($langs->transnoentities("Author").': '.$user->login, $object->actionmsg);
|
||||
} elseif (isset($object->origin_email)) {
|
||||
$object->actionmsg = dol_concatdesc($langs->transnoentities("Author").': '.$object->origin_email, $object->actionmsg);
|
||||
}
|
||||
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user