diff --git a/htdocs/admin/invoice.php b/htdocs/admin/invoice.php
index e16756f2a4e..d4f30c23501 100644
--- a/htdocs/admin/invoice.php
+++ b/htdocs/admin/invoice.php
@@ -377,8 +377,9 @@ foreach ($dirmodels as $reldir) {
$facture = new Facture($db);
$facture->initAsSpecimen();
- // Example for standard invoice
$htmltooltip = '';
+
+ // Example for standard invoice
$htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
';
$facture->type = 0;
$nextval = $module->getNextValue($mysoc, $facture);
@@ -393,21 +394,22 @@ foreach ($dirmodels as $reldir) {
$htmltooltip .= $langs->trans($module->error).'
';
}
}
- // Example for replacement
- $facture->type = 1;
- $nextval = $module->getNextValue($mysoc, $facture);
- if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
- $htmltooltip .= $langs->trans("NextValueForReplacements").': ';
- if ($nextval) {
- if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
- $nextval = $langs->trans($nextval);
+ // Example for replacement invoice
+ if (!getDolGlobalString('INVOICE_DISABLE_REPLACEMENT')) {
+ $facture->type = 1;
+ $nextval = $module->getNextValue($mysoc, $facture);
+ if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
+ $htmltooltip .= $langs->trans("NextValueForReplacements").': ';
+ if ($nextval) {
+ if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
+ $nextval = $langs->trans($nextval);
+ }
+ $htmltooltip .= $nextval.'
';
+ } else {
+ $htmltooltip .= $langs->trans($module->error).'
';
}
- $htmltooltip .= $nextval.'
';
- } else {
- $htmltooltip .= $langs->trans($module->error).'
';
}
}
-
// Example for credit invoice
$facture->type = 2;
$nextval = $module->getNextValue($mysoc, $facture);
diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php
index e7134380fbd..503e0d88f95 100644
--- a/htdocs/admin/system/database.php
+++ b/htdocs/admin/system/database.php
@@ -57,8 +57,16 @@ print '
| '.$langs->trans("DriverType").' | <
// @phan-suppress-next-line PhanTypeSuspiciousStringExpression (user is defined in the stdClass)
print '
| '.$langs->trans("User").' | '.$conf->db->user.' |
'."\n";
print '| '.$langs->trans("Password").' | '.preg_replace('/./i', '*', $dolibarr_main_db_pass).' |
'."\n";
-print '| '.$langs->trans("DBStoringCharset").' | '.$db->getDefaultCharacterSetDatabase().' |
'."\n";
-print '| '.$langs->trans("DBSortingCharset").' | '.$db->getDefaultCollationDatabase().' |
'."\n";
+print '| '.$langs->trans("DBStoringCharset").' | '.$db->getDefaultCharacterSetDatabase();
+if ($db->type == 'mysqli') {
+ print ' '.$form->textwithpicto('', $langs->transnoentitiesnoconv("HelpMariaDBToGetPossibleValues", "SHOW CHARACTER SET"));
+}
+print ' |
'."\n";
+print '| '.$langs->trans("DBSortingCharset").' | '.$db->getDefaultCollationDatabase();
+if ($db->type == 'mysqli') {
+ print ' '.$form->textwithpicto('', $langs->transnoentitiesnoconv("HelpMariaDBToGetPossibleValues", "SHOW COLLATION"));
+}
+print ' |
'."\n";
print '';
print '';
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index d95ad2adc36..859cdd59a8b 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -2573,7 +2573,7 @@ if ($action == 'create') {
$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
}
- print '| '.$langs->trans('Discounts').' | ';
+ print ' |
| '.$langs->trans('Discounts').' | ';
$absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount);
$absolute_creditnote = $soc->getAvailableDiscounts('', $filtercreditnote);
diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php
index 8310377b170..d686d1cc4b6 100644
--- a/htdocs/core/db/mysqli.class.php
+++ b/htdocs/core/db/mysqli.class.php
@@ -122,8 +122,10 @@ class DoliDBMysqli extends DoliDB
$disableforcecharset = 0; // Set to 1 to test without charset forcing
if (empty($disableforcecharset) && $this->db->character_set_name() != $clientmustbe) {
try {
- //print "You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database ".$this->db->character_set_name();
- dol_syslog(get_class($this)."::DoliDBMysqli You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database ".$this->db->character_set_name(), LOG_WARNING);
+ //print "You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database, so to ".$this->db->character_set_name();
+ dol_syslog(get_class($this)."::DoliDBMysqli You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database, so to ".$this->db->character_set_name(), LOG_WARNING);
+ //
+
$this->db->set_charset($clientmustbe); // This set charset, but with a bad collation
} catch (Exception $e) {
print 'Failed to force character_set_client to '.$clientmustbe." (according to setup) to match the one of the server database. \n";
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index b804e827585..de9942c6bc3 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -1000,12 +1000,12 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
$maskuser_value = '';
}
- // Personalized field {XXX-1} à {XXX-9}
+ // Personalized field {XXX-1} à {XXX-99}
$maskperso = array();
$maskpersonew = array();
$tmpmask = $mask;
$regKey = array();
- while (preg_match('/\{([A-Z]+)\-([1-9])\}/', $tmpmask, $regKey)) {
+ while (preg_match('/\{([A-Z]+)\-([0-9]+)\}/', $tmpmask, $regKey)) {
$maskperso[$regKey[1]] = '{'.$regKey[1].'-'.$regKey[2].'}';
// @phan-suppress-next-line PhanParamSuspiciousOrder
$maskpersonew[$regKey[1]] = str_pad('', (int) $regKey[2], '_', STR_PAD_RIGHT);
diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php
index 05c1b0e7aba..11a4444902d 100644
--- a/htdocs/core/lib/security.lib.php
+++ b/htdocs/core/lib/security.lib.php
@@ -200,6 +200,9 @@ function dolDecrypt($chain, $key = '')
//var_dump('key='.$key);
$reg = array();
if (preg_match('/^dolcrypt:([^:]+):(.+)$/', $chain, $reg)) {
+ // Do not enable this log, except during debug
+ //dol_syslog("We try to decrypt the chain: ".$chain, LOG_DEBUG);
+
$ciphering = $reg[1];
if (function_exists('openssl_decrypt')) {
if (empty($key)) {
diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php
index 3d1c229fbc5..df68da385bf 100644
--- a/htdocs/core/tpl/contacts.tpl.php
+++ b/htdocs/core/tpl/contacts.tpl.php
@@ -208,7 +208,7 @@ if ($permission) {
// Prepare list
-// TODO: replace this with direct SQL string to use $db->sort($sortfield, $sortorder)
+// TODO: replace this with 1 single direct SQL (for both eyernal and external string to use $db->sort($sortfield, $sortorder)
$list = array();
foreach (array('internal', 'external') as $source) {
if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) {
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 72ef33df7b4..1f79ae581a6 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2555,3 +2555,4 @@ MenuDict=Dictionary
AddMoreParams=Add more parameters for connection (cookies, tokens, ...) Example: token : value token
ParamName=Name of parameter
ParamValue=Value of parameter
+HelpMariaDBToGetPossibleValues=You can get a list of possible values by running the following SQL command: %s
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 2194836b86a..2209ffcac1c 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -268,6 +268,13 @@ if (GETPOST('search_usage_event_organization')) {
}
$arrayfields['p.fk_project']['enabled'] = 0;
+// Force this field to be visible
+if ($contextpage == 'lead') {
+ $arrayfields['p.fk_opp_status']['enabled'] = 1;
+ $arrayfields['p.fk_opp_status']['visible'] = 1;
+}
+
+
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|