mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-22 09:21:30 +01:00
Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -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").': <b>'.$module->getVersion().'</b><br>';
|
||||
$facture->type = 0;
|
||||
$nextval = $module->getNextValue($mysoc, $facture);
|
||||
@@ -393,7 +394,8 @@ foreach ($dirmodels as $reldir) {
|
||||
$htmltooltip .= $langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
// Example for replacement
|
||||
// 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
|
||||
@@ -407,7 +409,7 @@ foreach ($dirmodels as $reldir) {
|
||||
$htmltooltip .= $langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// Example for credit invoice
|
||||
$facture->type = 2;
|
||||
$nextval = $module->getNextValue($mysoc, $facture);
|
||||
|
||||
@@ -57,8 +57,16 @@ print '<tr class="oddeven"><td width="300">'.$langs->trans("DriverType").'</td><
|
||||
// @phan-suppress-next-line PhanTypeSuspiciousStringExpression (user is defined in the stdClass)
|
||||
print '<tr class="oddeven"><td width="300">'.$langs->trans("User").'</td><td>'.$conf->db->user.'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td width="300">'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $dolibarr_main_db_pass).'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td width="300">'.$langs->trans("DBStoringCharset").'</td><td>'.$db->getDefaultCharacterSetDatabase().'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>'.$db->getDefaultCollationDatabase().'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td width="300">'.$langs->trans("DBStoringCharset").'</td><td>'.$db->getDefaultCharacterSetDatabase();
|
||||
if ($db->type == 'mysqli') {
|
||||
print ' '.$form->textwithpicto('', $langs->transnoentitiesnoconv("HelpMariaDBToGetPossibleValues", "SHOW CHARACTER SET"));
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>'.$db->getDefaultCollationDatabase();
|
||||
if ($db->type == 'mysqli') {
|
||||
print ' '.$form->textwithpicto('', $langs->transnoentitiesnoconv("HelpMariaDBToGetPossibleValues", "SHOW COLLATION"));
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
@@ -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 '<tr><td class="titlefield">'.$langs->trans('Discounts').'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td>';
|
||||
|
||||
$absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount);
|
||||
$absolute_creditnote = $soc->getAvailableDiscounts('', $filtercreditnote);
|
||||
|
||||
@@ -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.<br>\n";
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -2555,3 +2555,4 @@ MenuDict=Dictionary
|
||||
AddMoreParams=Add more parameters for connection (cookies, tokens, ...)<br> 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
|
||||
|
||||
@@ -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<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
|
||||
Reference in New Issue
Block a user