2
0
forked from Wavyzz/dolibarr

Merge branch 'develop' into Fix-#32193

This commit is contained in:
Lucas Marcouiller
2024-12-13 09:14:43 +01:00
committed by GitHub
10 changed files with 100 additions and 20 deletions

View File

@@ -61,16 +61,16 @@ print load_fiche_titre($langs->trans("SetupArea"), '', 'tools');
if (getDolGlobalString('MAIN_MOTD_SETUPPAGE')) { if (getDolGlobalString('MAIN_MOTD_SETUPPAGE')) {
$conf->global->MAIN_MOTD_SETUPPAGE = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>/i', '<br>', $conf->global->MAIN_MOTD_SETUPPAGE); $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>/i', '<br>', getDolGlobalString('MAIN_MOTD_SETUPPAGE'));
if (getDolGlobalString('MAIN_MOTD_SETUPPAGE')) { if (getDolGlobalString('MAIN_MOTD_SETUPPAGE')) {
$i = 0; $i = 0;
$reg = array(); $reg = array();
while (preg_match('/__\(([a-zA-Z|@]+)\)__/i', $conf->global->MAIN_MOTD_SETUPPAGE, $reg) && $i < 100) { while (preg_match('/__\(([a-zA-Z|@]+)\)__/i', getDolGlobalString('MAIN_MOTD_SETUPPAGE'), $reg) && $i < 100) {
$tmp = explode('|', $reg[1]); $tmp = explode('|', $reg[1]);
if (!empty($tmp[1])) { if (!empty($tmp[1])) {
$langs->load($tmp[1]); $langs->load($tmp[1]);
} }
$conf->global->MAIN_MOTD_SETUPPAGE = preg_replace('/__\('.preg_quote($reg[1]).'\)__/i', $langs->trans($tmp[0]), $conf->global->MAIN_MOTD_SETUPPAGE); $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace('/__\('.preg_quote($reg[1]).'\)__/i', $langs->trans($tmp[0]), getDolGlobalString('MAIN_MOTD_SETUPPAGE'));
$i++; $i++;
} }

View File

@@ -1059,9 +1059,24 @@ if ($action == 'edit') {
$text .= /* ($text ? '<br><br>' : ''). */$langs->trans("WarningPHPMailSPF", getDolGlobalString('MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD')); $text .= /* ($text ? '<br><br>' : ''). */$langs->trans("WarningPHPMailSPF", getDolGlobalString('MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD'));
} }
if (getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS')) { // Not defined by default. Depend on platform. if (getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS')) { // Not defined by default. Depend on platform.
$ipstoshow = '';
// List of IP shown as record to add as allowed IP if we use the smtp method. Value is '1.2.3.4, [aaaa:bbbb:cccc:dddd]' // List of IP shown as record to add as allowed IP if we use the smtp method. Value is '1.2.3.4, [aaaa:bbbb:cccc:dddd]'
// TODO Add a key to allow to show the IP/name of server detected dynamically $arrayipstoshow = explode(',', getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS'));
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMail2", getDolGlobalString('MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS')); foreach ($arrayipstoshow as $iptoshow) {
// If MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is an URL to get/show the public IP/name of server detected dynamically
if (preg_match('/^http/i', $iptoshow)) {
$tmpresult = getURLContent($iptoshow, 'GET', '', 1, array(), array('http', 'https'), 0);
if (!empty($tmpresult['content'])) {
$iptoshow = $tmpresult['content'];
} else {
$iptoshow = ''; // Failed to get IP
}
}
$ipstoshow .= ($ipstoshow ? ', ' : '').trim($iptoshow);
}
if ($ipstoshow) {
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMail2", $ipstoshow);
}
} }
} }

View File

@@ -2011,7 +2011,6 @@ class ExtraFields
} }
//if ($computed) $value = // $value is already calculated into $value before calling this method //if ($computed) $value = // $value is already calculated into $value before calling this method
$showsize = 0; $showsize = 0;
if ($type == 'date') { if ($type == 'date') {
$showsize = 10; $showsize = 10;
@@ -2039,9 +2038,9 @@ class ExtraFields
} elseif ($type == 'double') { } elseif ($type == 'double') {
if (!empty($value)) { if (!empty($value)) {
//$value=price($value); //$value=price($value);
$sizeparts = explode(",", $size); //$sizeparts = explode(",", $size);
$number_decimals = array_key_exists(1, $sizeparts) ? $sizeparts[1] : 0; //$number_decimals = array_key_exists(1, $sizeparts) ? $sizeparts[1] : 0;
$value = price($value, 0, $outputlangs, 0, 0, $number_decimals, ''); $value = price($value, 0, $outputlangs, 0, 0, -2, '');
} }
} elseif ($type == 'boolean') { } elseif ($type == 'boolean') {
$checked = ''; $checked = '';

View File

@@ -11733,7 +11733,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
*/ */
function showDirectDownloadLink($object) function showDirectDownloadLink($object)
{ {
global $conf, $langs; global $langs;
$out = ''; $out = '';
$url = $object->getLastMainDocLink($object->element); $url = $object->getLastMainDocLink($object->element);
@@ -11845,6 +11845,25 @@ function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata = 0, $param
} }
} }
/**
* Make content of an input box selected when we click into input field.
*
* @param int $idcode Id of special code
* @return string
*/
function getLabelSpecialCode($idcode)
{
global $langs;
$arrayspecialines = array(1 => 'Transport', 2 => 'EcoTax', 3 => 'Option');
if ($idcode > 10) {
return 'Module ID '.$idcode;
}
if (!empty($arrayspecialines[$idcode])) {
return $langs->trans($arrayspecialines[$idcode]);
}
return '';
}
/** /**
* Make content of an input box selected when we click into input field. * Make content of an input box selected when we click into input field.

View File

@@ -400,4 +400,37 @@ class modAccounting extends DolibarrModules
'b.multicurrency_code'=>"US (Necessary if devise is different than EUR)", 'b.multicurrency_code'=>"US (Necessary if devise is different than EUR)",
); );
} }
/**
* Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
public function init($options = '')
{
$result = $this->_load_tables('/install/mysql/', 'accounting');
if ($result < 0) {
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
}
$sql = array();
return $this->_init($sql, $options);
}
/**
* Function called when module is disabled.
* Remove from database constants, boxes and permissions from Dolibarr database.
* Data directories are not deleted
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
public function remove($options = '')
{
$sql = array();
return $this->_remove($sql, $options);
}
} }

View File

@@ -312,8 +312,8 @@ $tooltiponpricemultiprice = '';
$tooltiponpriceend = ''; $tooltiponpriceend = '';
$tooltiponpriceendmultiprice = ''; $tooltiponpriceendmultiprice = '';
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$tooltiponprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht, 0, '', 0, 0); $tooltiponprice .= $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht, 0, '', 0, 0);
$tooltiponpricemultiprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->multicurrency_total_ht, 0, '', 0, 0); $tooltiponpricemultiprice .= $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->multicurrency_total_ht, 0, '', 0, 0);
$tooltiponprice .= '<br>'.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_tva, 0, '', 0, 0); $tooltiponprice .= '<br>'.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_tva, 0, '', 0, 0);
$tooltiponpricemultiprice .= '<br>'.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->multicurrency_total_tva, 0, '', 0, 0); $tooltiponpricemultiprice .= '<br>'.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->multicurrency_total_tva, 0, '', 0, 0);
if (is_object($object->thirdparty)) { if (is_object($object->thirdparty)) {
@@ -347,6 +347,19 @@ if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$tooltiponprice .= '<br>'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc, 0, '', 0, 0); $tooltiponprice .= '<br>'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc, 0, '', 0, 0);
$tooltiponpricemultiprice .= '<br>'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->multicurrency_total_ttc, 0, '', 0, 0); $tooltiponpricemultiprice .= '<br>'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->multicurrency_total_ttc, 0, '', 0, 0);
if (!empty($line->special_code) || $line->product_type == 9) {
$tooltiponprice .= '<br>';
$tooltiponpricemultiprice .= '<br>';
if (!empty($line->special_code)) {
$tooltiponprice .= '<br>'.$langs->trans("SpecialLine").' : '.getLabelSpecialCode($line->special_code);
$tooltiponpricemultiprice .= '<br>'.$langs->trans("SpecialLine").' : '.getLabelSpecialCode($line->special_code);
}
if ($line->product_type == 9) {
$tooltiponprice .= '<br>'.$langs->trans("SpecialLine").' : '.$langs->trans("GroupingLine");
$tooltiponpricemultiprice .= '<br>'.$langs->trans("SpecialLine").' : '.$langs->trans("GroupingLine");
}
}
$tooltiponprice = '<span class="classfortooltip" title="'.dol_escape_htmltag($tooltiponprice).'">'; $tooltiponprice = '<span class="classfortooltip" title="'.dol_escape_htmltag($tooltiponprice).'">';
$tooltiponpricemultiprice = '<span class="classfortooltip" title="'.dol_escape_htmltag($tooltiponpricemultiprice).'">'; $tooltiponpricemultiprice = '<span class="classfortooltip" title="'.dol_escape_htmltag($tooltiponpricemultiprice).'">';

View File

@@ -498,7 +498,7 @@ ActionRunningNotStarted=To start
ActionRunningShort=In progress ActionRunningShort=In progress
ActionDoneShort=Finished ActionDoneShort=Finished
ActionUncomplete=Incomplete ActionUncomplete=Incomplete
LatestLinkedEvents=Latest %s linked events LatestLinkedEvents=The last %s events
CompanyFoundation=Company/Organization CompanyFoundation=Company/Organization
Accountant=Accountant Accountant=Accountant
ContactsForCompany=Contacts for this third party ContactsForCompany=Contacts for this third party
@@ -1341,3 +1341,6 @@ Operator=Operator
AllFieldsRequired=All fields are required. AllFieldsRequired=All fields are required.
IsDefined=Is defined IsDefined=Is defined
IsNotDefined=Is not defined IsNotDefined=Is not defined
SpecialLine=Special Line
EcoTax=Eco-Tax
GroupingLine=Grouping line

View File

@@ -496,7 +496,7 @@ ActionRunningNotStarted=A réaliser
ActionRunningShort=En cours ActionRunningShort=En cours
ActionDoneShort=Terminé ActionDoneShort=Terminé
ActionUncomplete=Incomplet ActionUncomplete=Incomplet
LatestLinkedEvents=Les %s derniers événements liés LatestLinkedEvents=Les %s derniers événements
CompanyFoundation=Société/Organisation CompanyFoundation=Société/Organisation
Accountant=Comptable Accountant=Comptable
ContactsForCompany=Contacts de ce tiers ContactsForCompany=Contacts de ce tiers

View File

@@ -4695,12 +4695,11 @@ table.hidepaginationnext .paginationnext {
} }
/* Set the color for hover lines */ /* Set the color for hover lines */
.oddeven:hover, .evenodd:hover, .oddevenimport:hover, .evenoddimport:hover, .impair:hover, .pair:hover .oddeven:hover:not(.nohover), .evenodd:hover:not(.nohover), .oddevenimport:hover:not(.nohover), .evenoddimport:hover:not(.nohover), .impair:hover:not(.nohover), .pair:hover:not(.nohover) {
{
background: var(--colorbacklinepairhover) !important; /* Must be background to be stronger than background of odd or even */ background: var(--colorbacklinepairhover) !important; /* Must be background to be stronger than background of odd or even */
} }
.tredited, .tredited td { .tredited, .tredited td {
background: var(--colorbacklinepairchecked) !important; /* Must be background to be stronger than background of odd or even */ background: var(--colorbacklinepairchecked) !important; /* Must be background to be stronger than background of odd or even */
border-bottom: 0 !important; border-bottom: 0 !important;

View File

@@ -4761,7 +4761,6 @@ ul.noborder li:nth-child(odd):not(.liste_titre) {
/* Set the color for hover lines */ /* Set the color for hover lines */
.tmenucompanylogo.nohover, .tmenucompanylogo.nohover:hover { .tmenucompanylogo.nohover, .tmenucompanylogo.nohover:hover {
opacity: unset !important; opacity: unset !important;
} }
@@ -4770,11 +4769,11 @@ ul.noborder li:nth-child(odd):not(.liste_titre) {
box-shadow: unset; box-shadow: unset;
-webkit-box-shadow: unset; -webkit-box-shadow: unset;
} }
.oddeven:hover:not(.nohover), .evenodd:hover:not(.nohover), .oddevenimport:hover:not(.nohover), .evenoddimport:hover:not(.nohover), .impair:hover:not(.nohover), .pair:hover:not(.nohover) {
.oddeven:hover, .evenodd:hover, .oddevenimport:hover, .evenoddimport:hover, .impair:hover, .pair:hover
{ {
background: rgb(<?php echo $colorbacklinepairhover; ?>) !important; background: rgb(<?php echo $colorbacklinepairhover; ?>) !important;
} }
.tredited { .tredited {
background: rgb(<?php echo $colorbacklinepairchecked; ?>) !important; /* Must be background to be stronger than background of odd or even */ background: rgb(<?php echo $colorbacklinepairchecked; ?>) !important; /* Must be background to be stronger than background of odd or even */
} }