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

This commit is contained in:
Laurent Destailleur 2022-11-22 13:42:17 +01:00
commit f79e52bc85
4 changed files with 19 additions and 16 deletions

View File

@ -278,11 +278,11 @@ if (empty($conf->global->AGENDA_DISABLE_EXT)) {
// Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight'
$listofextcals[] = array(
'src' => getDolGlobalString($source),
'name' => getDolGlobalString($name),
'offsettz' => (!empty($conf->global->$offsettz) ? $conf->global->$offsettz : 0),
'color' => getDolGlobalString($color),
'default' => getDolGlobalString($default),
'buggedfile' => (isset($conf->global->buggedfile) ? $conf->global->buggedfile : 0)
'name' => dol_string_nohtmltag(getDolGlobalString($name)),
'offsettz' => (int) getDolGlobalInt($offsettz, 0),
'color' => dol_string_nohtmltag(getDolGlobalString($color)),
'default' => dol_string_nohtmltag(getDolGlobalString($default)),
'buggedfile' => dol_string_nohtmltag(getDolGlobalString('buggedfile', ''))
);
}
}
@ -303,11 +303,11 @@ if (empty($user->conf->AGENDA_DISABLE_EXT)) {
// Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight'
$listofextcals[] = array(
'src' => $user->conf->$source,
'name' => $user->conf->$name,
'offsettz' => (!empty($user->conf->$offsettz) ? $user->conf->$offsettz : 0),
'color' => $user->conf->$color,
'default' => $user->conf->$default,
'buggedfile' => (isset($user->conf->buggedfile) ? $user->conf->buggedfile : 0)
'name' => dol_string_nohtmltag($user->conf->$name),
'offsettz' => (int) (empty($user->conf->$offsettz) ? 0 : $user->conf->$offsettz),
'color' => dol_string_nohtmltag($user->conf->$color),
'default' => dol_string_nohtmltag($user->conf->$default),
'buggedfile' => dol_string_nohtmltag(isset($user->conf->buggedfile) ? $user->conf->buggedfile : '')
);
}
}
@ -614,7 +614,7 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on
$default = '';
}
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_ext'.$htmlname.'" name="check_ext'.$htmlname.'" value="1" '.$default.'> <label for="check_ext'.$htmlname.'">'.$val['name'].'</label> &nbsp; </div>';
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_ext'.$htmlname.'" name="check_ext'.$htmlname.'" value="1" '.$default.'> <label for="check_ext'.$htmlname.'">'.dol_escape_htmltag($val['name']).'</label> &nbsp; </div>';
}
}
@ -637,8 +637,7 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on
if (!preg_match('/showbirthday=/i', $newparam)) {
$newparam .= '&showbirthday=1';
}
$link = '<a href="'.dol_escape_htmltag($_SERVER['PHP_SELF']);
$link .= '?'.dol_escape_htmltag($newparam);
$link = '<a href="'.$_SERVER['PHP_SELF'].'?'.dol_escape_htmltag($newparam);
$link .= '">';
if (empty($showbirthday)) {
$link .= $langs->trans("AgendaShowBirthdayEvents");

View File

@ -4445,8 +4445,8 @@ class PropaleLigne extends CommonObjectLine
$sql .= ", qty='".price2num($this->qty)."'";
$sql .= ", subprice=".price2num($this->subprice)."";
$sql .= ", remise_percent=".price2num($this->remise_percent)."";
$sql .= ", price=".price2num($this->price).""; // TODO A virer
$sql .= ", remise=".price2num($this->remise).""; // TODO A virer
$sql .= ", price=".(float) price2num($this->price).""; // TODO A virer
$sql .= ", remise=".(float) price2num($this->remise).""; // TODO A virer
$sql .= ", info_bits='".$this->db->escape($this->info_bits)."'";
if (empty($this->skip_update_total)) {
$sql .= ", total_ht=".price2num($this->total_ht)."";

View File

@ -1755,6 +1755,7 @@ function weight_convert($weight, &$from_unit, $to_unit)
* weigh_convert(320, $f, 0) retournera 0.32
*
*/
$weight = is_numeric($weight) ? $weight : 0;
while ($from_unit <> $to_unit) {
if ($from_unit > $to_unit) {
$weight = $weight * 10;

View File

@ -174,6 +174,9 @@ if (empty($reshook)) {
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
foreach ($object->fields as $key => $val) {
$search[$key] = '';
if ($key == 'status') {
$search[$key] = -1;
}
if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
$search[$key.'_dtstart'] = '';
$search[$key.'_dtend'] = '';
@ -247,7 +250,7 @@ foreach ($search as $key => $val) {
if ($key == 'status' && $search[$key] == -1) {
continue;
}
if ($key == 'fk_parent_line') {
if ($key == 'fk_parent_line' && $search[$key] != '') {
$sql .= natural_search('moparent.ref', $search[$key], 0);
continue;
}