2
0
forked from Wavyzz/dolibarr

Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2024-05-10 12:03:33 +02:00
10 changed files with 49 additions and 36 deletions

View File

@@ -54,7 +54,7 @@ FIX: #24265 regression cannot see all product on takepos (#28753)
FIX: #26015
FIX: #28205
FIX: #28251 Fixing subpermission name on api_multicurrencies.class.php (#28252)
FIX: #28347 FIX: #28962 FIX: #29224 FIX: #29035 (#29303)
FIX: #28347 FIX: occurred#28962 FIX: #29224 FIX: #29035 (#29303)
FIX: #28369
FIX: #28429
FIX: #28491 (#28522)

View File

@@ -89,7 +89,7 @@ print "</tr>\n";
print '<tr class="oddeven"><td>';
print $langs->trans("ClickToDialUseTelLink").'</td><td>';
print $form->selectyesno("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", $conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS, 1).'<br>';
print $form->selectyesno("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", getDolGlobalString('CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS'), 1).'<br>';
print '<br>';
print '<span class="opacitymedium small">'.$langs->trans("ClickToDialUseTelLinkDesc").'</span>';
print '</td></tr>';

View File

@@ -1865,7 +1865,7 @@ if ($id > 0) {
}
if (in_array($value, array('label', 'libelle', 'libelle_facture')) && empty($tabcomplete[$tabname[$id]]['help'][$value])) {
if (!is_array($tabcomplete[$tabname[$id]]['help'])) { // protection when $tabcomplete[$tabname[$id]]['help'] is a an empty string, we must force it into an array
if (!isset($tabcomplete[$tabname[$id]]['help']) || !is_array($tabcomplete[$tabname[$id]]['help'])) { // protection when $tabcomplete[$tabname[$id]]['help'] is a an empty string, we must force it into an array
$tabcomplete[$tabname[$id]]['help'] = array();
}
$tabcomplete[$tabname[$id]]['help'][$value] = $langs->trans('LabelUsedByDefault');

View File

@@ -294,7 +294,7 @@ if (isModEnabled('invoice')) {
'1'=>$langs->trans("InvoiceOptionCategoryOfOperationsYes1"),
'2'=>$langs->trans("InvoiceOptionCategoryOfOperationsYes2")
);
print $form->selectarray("INVOICE_CATEGORY_OF_OPERATION", $arrval, $conf->global->INVOICE_CATEGORY_OF_OPERATION, 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
print $form->selectarray("INVOICE_CATEGORY_OF_OPERATION", $arrval, getDolGlobalString('INVOICE_CATEGORY_OF_OPERATION'), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
print '</td></tr>';
print '<tr class="oddeven"><td>';

View File

@@ -18,8 +18,7 @@
/**
* \file htdocs/asterisk/wrapper.php
* \brief File that is entry point to call an Asterisk server
* \remarks To be used, an Asterisk user must be created by adding this
* in /etc/asterisk/manager.conf
* \remarks To be used, an Asterisk user must be created by adding this in /etc/asterisk/manager.conf
* [dolibarr]
* secret = dolibarr
* deny=0.0.0.0/0.0.0.0

View File

@@ -47,10 +47,11 @@ $massaction = GETPOST('massaction', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'paymentlist';
$mode = GETPOST('mode', 'alpha');
$facid = GETPOSTINT('facid');
$socid = GETPOSTINT('socid');
$userid = GETPOSTINT('userid');
$facid = GETPOST('facid', 'int');
$socid = GETPOST('socid', 'int');
$userid = GETPOST('userid', 'int');
$search_ref = GETPOST("search_ref", "alpha");
$search_date_startday = GETPOSTINT('search_date_startday');
@@ -69,7 +70,7 @@ $search_amount = GETPOST("search_amount", 'alpha'); // alpha because we must be
$search_status = GETPOST('search_status', 'intcomma');
$search_sale = GETPOSTINT('search_sale');
$mode = GETPOST('mode', 'alpha');
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');

View File

@@ -125,7 +125,6 @@ abstract class CommonNumRefGenerator
*/
public function info($langs)
{
global $langs;
return $langs->trans("NoDescription");
}

View File

@@ -1082,6 +1082,9 @@ class ExtraFields
$help = $this->attributes[$extrafieldsobjectkey]['help'][$key];
$hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
//var_dump('key='.$key.' '.$value.' '.$moreparam.' '.$keysuffix.' '.$keyprefix.' '.$objectid.' '.$extrafieldsobjectkey.' '.$mode);
//var_dump('label='.$label.' type='.$type.' param='.var_export($param, 1));
if ($computed) {
if (!preg_match('/^search_/', $keyprefix)) {
return '<span class="opacitymedium">'.$langs->trans("AutomaticallyCalculated").'</span>';
@@ -1691,10 +1694,10 @@ class ExtraFields
}
}
} elseif ($type == 'link') {
$param_list = array_keys($param['options']); // $param_list='ObjectName:classPath'
$param_list = array_keys($param['options']); // $param_list[0] = 'ObjectName:classPath' but can also be 'ObjectName:classPath:1:(status:=:1)'
/* Removed.
The selectForForms is called with parameter $objectfield defined, so that the app can retrieve the filter inside the ajax component instead of being provided as parameters. The
filter was used to pass SQL requests leading to serious SQL injection problems. This should not be possible. Also the call of the ajax was broken by some WAF.
The selectForForms is called with parameter $objectfield defined, so the app can retrieve the filter inside the ajax component instead of being provided as parameters. The
filter was used to pass SQL requests leading to serious SQL injection problem. This should not be possible. Also the call of the ajax was broken by some WAF.
if (strpos($param_list[0], '$ID$') !== false && !empty($objectid)) {
$param_list[0] = str_replace('$ID$', $objectid, $param_list[0]);
}*/
@@ -1709,8 +1712,11 @@ class ExtraFields
$element = 'project';
}
//$out = $form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, '', 0, 0, '');
$out = $form->selectForForms($tmparray[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, '', 0, 0, '', $element.':options_'.$key);
//$objectdesc = $param_list[0]; // Example: 'ObjectName:classPath:1:(status:=:1)' Replaced by next line: this was propagated also a filter by ajax call that was blocked by some WAF
$objectdesc = $tmparray[0]; // Example: 'ObjectName:classPath' To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found.
$objectfield = $element.':options_'.$key; // Example: 'actioncomm:options_fff' To be used in priority to know object linked with all its definition (including filters)
$out = $form->selectForForms($objectdesc, $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, '', 0, 0, '', $objectfield);
} elseif (in_array($type, ['point', 'multipts', 'linestrg', 'polygon'])) {
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgeophp.class.php';
$dolgeophp = new DolGeoPHP($this->db);

View File

@@ -8216,6 +8216,8 @@ class Form
{
global $conf, $extrafields, $user;
//var_dump($objectdesc); debug_print_backtrace();
$objectdescorig = $objectdesc;
$objecttmp = null;
$InfoFieldList = array();
@@ -8226,11 +8228,13 @@ class Form
if ($objectfield) { // We must retrieve the objectdesc from the field or extrafield
// Example: $objectfield = 'product:options_package' or 'myobject@mymodule:options_myfield'
$tmparray = explode(':', $objectfield);
$objectdesc = '';
// Get instance of object from $element
$objectforfieldstmp = fetchObjectByElement(0, strtolower($tmparray[0]));
if (is_object($objectforfieldstmp)) {
$objectdesc = '';
$reg = array();
if (preg_match('/^options_(.*)$/', $tmparray[1], $reg)) {
// For a property in extrafields
@@ -8247,11 +8251,12 @@ class Form
} else {
// For a property in ->fields
if (array_key_exists($tmparray[1], $objectforfieldstmp->fields)) {
$objectdesc = $objectforfieldstmp->fields[$tmparray[1]]['type']; // should be integer:ObjectClass...
$objectdesc = $objectforfieldstmp->fields[$tmparray[1]]['type'];
$objectdesc = preg_replace('/^integer[^:]*:/', '', $objectdesc);
}
}
}
}
if ($objectdesc) {
// Example of value for $objectdesc:
@@ -8267,7 +8272,7 @@ class Form
$InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
$classname = $InfoFieldList[0];
$classpath = $InfoFieldList[1];
$classpath = empty($InfoFieldList[1]) ? '' : $InfoFieldList[1];
//$addcreatebuttonornot = empty($InfoFieldList[2]) ? 0 : $InfoFieldList[2];
$filter = empty($InfoFieldList[3]) ? '' : $InfoFieldList[3];
$sortfield = empty($InfoFieldList[4]) ? '' : $InfoFieldList[4];

View File

@@ -6580,7 +6580,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
$currency_code = $conf->currency;
}
$listofcurrenciesbefore = array('AUD', 'CAD', 'CNY', 'COP', 'CLP', 'GBP', 'HKD', 'MXN', 'PEN', 'USD', 'CRC');
$listofcurrenciesbefore = array('AUD', 'CAD', 'CNY', 'COP', 'CLP', 'GBP', 'HKD', 'MXN', 'PEN', 'USD', 'CRC', 'ZAR');
$listoflanguagesbefore = array('nl_NL');
if (in_array($currency_code, $listofcurrenciesbefore) || in_array($outlangs->defaultlang, $listoflanguagesbefore)) {
$cursymbolbefore .= $outlangs->getCurrencySymbol($currency_code);
@@ -12441,7 +12441,7 @@ function getElementProperties($elementType)
}
}
// For compatibility and to work with non standard path
if ($elementType == "action") {
if ($elementType == "action" || $elementType == "actioncomm") {
$classpath = 'comm/action/class';
$subelement = 'Actioncomm';
$module = 'agenda';
@@ -12764,6 +12764,9 @@ function fetchObjectByElement($element_id, $element_type, $element_ref = '', $us
} else {
$ismodenabled = isModEnabled($element_prop['module']);
}
//var_dump('element_type='.$element_type);
//var_dump($element_prop);
//var_dump($element_prop['module'].' '.$ismodenabled);
if (is_array($element_prop) && (empty($element_prop['module']) || $ismodenabled)) {
if ($useCache === 1