Skip to content

Commit b66935f

Browse files
authored
Merge branch 'develop' into patch-2
2 parents 4e3d6a9 + 31d8bbc commit b66935f

File tree

9 files changed

+117
-17
lines changed

9 files changed

+117
-17
lines changed

htdocs/core/customreports.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
'thirdparty' => array('label' => 'ThirdParties', 'picto' => 'company', 'ObjectClassName' => 'Societe', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/societe/class/societe.class.php", 'langs' => 'companies'),
165165
'contact' => array('label' => 'Contacts', 'picto' => 'contact', 'ObjectClassName' => 'Contact', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/contact/class/contact.class.php"),
166166
'proposal' => array('label' => 'Proposals', 'picto' => 'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php", 'langs' => 'propal'),
167+
'proposaldet' => array('label' => 'ProposalLines', 'picto' => 'proposal', 'ObjectClassName' => 'PropaleLigne', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propaleligne.class.php", 'langs' => 'propal'),
167168
'order' => array('label' => 'Orders', 'picto' => 'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/commande.class.php", 'langs' => 'orders'),
168169
'orderdet' => array('label' => 'SaleOrderLines', 'picto' => 'order', 'ObjectClassName' => 'OrderLine', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/orderline.class.php", 'langs' => 'orders'),
169170
'invoice' => array('label' => 'Invoices', 'picto' => 'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture.class.php", 'langs' => 'bills'),

htdocs/install/check.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
include_once 'inc.php';
3434

3535
/**
36+
* @var string $conffile
37+
* @var string $conffiletoshow
38+
*
3639
* @var Conf $conf already created in inc.php
3740
* @var Translate $langs
3841
*
@@ -42,8 +45,6 @@
4245
* @var string $dolibarr_main_db_user
4346
* @var string $dolibarr_main_db_pass
4447
* @var string $dolibarr_main_db_encrypted_pass
45-
* @var string $conffile
46-
* @var string $conffiletoshow
4748
*/
4849

4950
$err = 0;

htdocs/install/step1.php

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,27 @@
3232

3333
include 'inc.php';
3434

35-
global $langs;
36-
3735
/**
36+
* @var string $conffile
37+
* @var string $conffiletoshow
38+
*
39+
* @var Conf $conf
3840
* @var Translate $langs
41+
*
42+
* @var string $dolibarr_main_db_type
43+
* @var string $dolibarr_main_db_host
44+
* @var string $dolibarr_main_db_port
45+
* @var string $dolibarr_main_db_name
46+
* @var string $dolibarr_main_db_user
47+
* @var string $dolibarr_main_db_pass
48+
* @var string $dolibarr_main_document_root
49+
* @var string $dolibarr_main_db_encryption
50+
* @var string $dolibarr_main_db_encrypted_pass
51+
* @var string $dolibarr_main_db_cryptkey
3952
*/
4053

54+
global $langs;
55+
4156
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : (empty($argv[1]) ? '' : $argv[1]);
4257
$setuplang = GETPOST('selectlang', 'aZ09', 3) ? GETPOST('selectlang', 'aZ09', 3) : (empty($argv[2]) ? 'auto' : $argv[2]);
4358
$langs->setDefaultLang($setuplang);
@@ -87,6 +102,23 @@
87102
if (@file_exists($forcedfile)) {
88103
$useforcedwizard = true;
89104
include_once $forcedfile;
105+
/**
106+
* @var string $force_install_noedit
107+
* @var string $force_install_main_data_root
108+
* @var string $force_install_databaserootlogin
109+
* @var string $force_install_databaserootpass
110+
* @var string $force_install_type
111+
* @var string $force_install_dbserver
112+
* @var string $force_install_database
113+
* @var string $force_install_databaselogin
114+
* @var string $force_install_databasepass
115+
* @var string $force_install_port
116+
* @var string $force_install_prefix
117+
* @var string $force_install_createdatabase
118+
* @var string $force_install_createuser
119+
* @var string $force_install_mainforcehttps
120+
* @var string $force_install_distrib
121+
*/
90122
// If forced install is enabled, replace the post values. These are empty because form fields are disabled.
91123
if ($force_install_noedit) {
92124
$main_dir = detect_dolibarr_main_document_root();

htdocs/install/step2.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,23 @@
2626
*/
2727

2828
include 'inc.php';
29+
30+
/**
31+
* @var string $conffile
32+
* @var string $conffiletoshow
33+
*
34+
* @var Conf $conf
35+
* @var Translate $langs
36+
*
37+
* @var string $dolibarr_main_document_root
38+
*/
39+
2940
require_once $dolibarr_main_document_root.'/core/class/conf.class.php';
3041
require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php';
3142
require_once $dolibarr_main_document_root.'/core/lib/security.lib.php';
3243

3344
global $langs;
3445

35-
$step = 2;
3646
$ok = 0;
3747

3848

htdocs/install/step4.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@
2828

2929

3030
include_once 'inc.php';
31+
32+
/**
33+
* @var string $conffile
34+
* @var string $conffiletoshow
35+
*
36+
* @var Conf $conf
37+
* @var Translate $langs
38+
*
39+
* @var string $dolibarr_main_document_root
40+
*/
41+
3142
require_once $dolibarr_main_document_root.'/core/class/conf.class.php';
3243
require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php';
3344

htdocs/install/step5.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,31 @@
3939

4040
define('ALLOWED_IF_UPGRADE_UNLOCK_FOUND', 1);
4141
include_once 'inc.php';
42+
43+
/**
44+
* @var string $conffile
45+
* @var string $conffiletoshow
46+
*/
47+
4248
if (file_exists($conffile)) {
4349
include_once $conffile;
4450
}
51+
/**
52+
* @var Conf $conf
53+
* @var Translate $langs
54+
*
55+
* @var string $dolibarr_main_db_type
56+
* @var string $dolibarr_main_db_host
57+
* @var string $dolibarr_main_db_port
58+
* @var string $dolibarr_main_db_name
59+
* @var string $dolibarr_main_db_user
60+
* @var string $dolibarr_main_db_pass
61+
* @var string $dolibarr_main_document_root
62+
* @var string $dolibarr_main_db_encryption
63+
* @var string $dolibarr_main_db_encrypted_pass
64+
* @var string $dolibarr_main_db_cryptkey
65+
* @var string $modulesdir
66+
*/
4567
require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php';
4668
require_once $dolibarr_main_document_root.'/core/lib/security.lib.php'; // for dol_hash
4769
require_once $dolibarr_main_document_root.'/core/lib/functions2.lib.php';

htdocs/install/upgrade.php

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,25 @@
4949
print 'Error: Dolibarr config file was not found. This may means that Dolibarr is not installed yet. Please call the page "/install/index.php" instead of "/install/upgrade.php").';
5050
}
5151
require_once $conffile;
52-
require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php';
53-
54-
global $langs;
55-
5652
/**
5753
* @var Conf $conf
5854
* @var Translate $langs
55+
*
56+
* @var string $dolibarr_main_db_type
57+
* @var string $dolibarr_main_db_host
58+
* @var string $dolibarr_main_db_port
59+
* @var string $dolibarr_main_db_name
60+
* @var string $dolibarr_main_db_user
61+
* @var string $dolibarr_main_db_pass
62+
* @var string $dolibarr_main_document_root
63+
* @var string $dolibarr_main_db_encryption
64+
* @var string $dolibarr_main_db_encrypted_pass
65+
* @var string $dolibarr_main_db_cryptkey
5966
*/
67+
require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php';
68+
69+
global $langs;
6070

61-
$grant_query = '';
62-
$step = 2;
6371
$ok = 0;
6472

6573

@@ -130,13 +138,13 @@
130138
$error = 0;
131139

132140
// If password is encoded, we decode it
133-
if ((!empty($dolibarr_main_db_pass) && preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)) || preg_match('/dolcrypt:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) {
141+
if ((!empty($dolibarr_main_db_pass) && preg_match('/(crypted|dolcrypt):/i', (string) $dolibarr_main_db_pass)) || !empty($dolibarr_main_db_encrypted_pass)) {
134142
require_once $dolibarr_main_document_root.'/core/lib/security.lib.php';
135143
if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) {
136-
$dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass);
144+
$dolibarr_main_db_pass = preg_replace('/crypted:/i', '', (string) $dolibarr_main_db_pass);
137145
$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this as it is used to know the password was initially encrypted
138146
$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass);
139-
} elseif (preg_match('/dolcrypt:/i', $dolibarr_main_db_pass)) {
147+
} elseif (preg_match('/dolcrypt:/i', (string) $dolibarr_main_db_pass)) {
140148
$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this as it is used to know the password was initially encrypted
141149
$dolibarr_main_db_pass = dolDecrypt($dolibarr_main_db_pass);
142150
} else {

htdocs/install/upgrade2.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
* @var string $dolibarr_main_db_user
6464
* @var string $dolibarr_main_db_pass
6565
* @var string $dolibarr_main_document_root
66+
* @var string $dolibarr_main_db_encryption
67+
* @var string $dolibarr_main_db_encrypted_pass
68+
* @var string $dolibarr_main_db_cryptkey
6669
*/
6770
require_once $dolibarr_main_document_root.'/compta/facture/class/facture.class.php';
6871
require_once $dolibarr_main_document_root.'/comm/propal/class/propal.class.php';
@@ -146,13 +149,13 @@
146149
print '<table class="centpercent">';
147150

148151
// If password is encoded, we decode it
149-
if ((!empty($dolibarr_main_db_pass) && preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)) || !empty($dolibarr_main_db_encrypted_pass)) {
152+
if ((!empty($dolibarr_main_db_pass) && preg_match('/(crypted|dolcrypt):/i', (string) $dolibarr_main_db_pass)) || !empty($dolibarr_main_db_encrypted_pass)) {
150153
require_once $dolibarr_main_document_root.'/core/lib/security.lib.php';
151154
if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) {
152-
$dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass);
155+
$dolibarr_main_db_pass = preg_replace('/crypted:/i', '', (string) $dolibarr_main_db_pass);
153156
$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this as it is used to know the password was initially encrypted
154157
$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass);
155-
} elseif (preg_match('/dolcrypt:/i', $dolibarr_main_db_pass)) {
158+
} elseif (preg_match('/dolcrypt:/i', (string) $dolibarr_main_db_pass)) {
156159
$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this as it is used to know the password was initially encrypted
157160
$dolibarr_main_db_pass = dolDecrypt($dolibarr_main_db_pass);
158161
} else {

htdocs/product/card.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,18 @@
13631363
$sellOrEatByMandatoryList = null;
13641364
if (isModEnabled('productbatch')) {
13651365
$sellOrEatByMandatoryList = Product::getSellOrEatByMandatoryList();
1366+
1367+
$disableSellBy = getDolGlobalString('PRODUCT_DISABLE_SELLBY');
1368+
$disableEatBy = getDolGlobalString('PRODUCT_DISABLE_EATBY');
1369+
1370+
if ($disableSellBy) {
1371+
unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_BY]);
1372+
unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT]);
1373+
}
1374+
if ($disableEatBy) {
1375+
unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_EAT_BY]);
1376+
unset($sellOrEatByMandatoryList[Product::SELL_OR_EAT_BY_MANDATORY_ID_SELL_AND_EAT]);
1377+
}
13661378
}
13671379

13681380
$title = $langs->trans('ProductServiceCard');

0 commit comments

Comments
 (0)