diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 902b773735a..651fa556e8a 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -111,6 +111,7 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes') $newdiscount1->description = $discount->description.' (1)'; $newdiscount2->description = $discount->description.' (2)'; } + $newdiscount1->fk_user = $discount->fk_user; $newdiscount2->fk_user = $discount->fk_user; $newdiscount1->fk_soc = $discount->fk_soc; @@ -121,7 +122,7 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes') $newdiscount2->datec = $discount->datec; $newdiscount1->tva_tx = $discount->tva_tx; $newdiscount2->tva_tx = $discount->tva_tx; - $newdiscount1->amount_ttc = $_POST["amount_ttc_1"]; + $newdiscount1->amount_ttc = $amount_ttc_1; $newdiscount2->amount_ttc = price2num($discount->amount_ttc - $newdiscount1->amount_ttc); $newdiscount1->amount_ht = price2num($newdiscount1->amount_ttc / (1 + $newdiscount1->tva_tx / 100), 'MT'); $newdiscount2->amount_ht = price2num($newdiscount2->amount_ttc / (1 + $newdiscount2->tva_tx / 100), 'MT'); diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 91c6ab23910..caea252c571 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2015 Frederic France * Copyright (C) 2018 Josep LluĂ­s Amador + * Copyright (C) 2020 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -83,6 +84,7 @@ class box_contacts extends ModeleBoxes if ($user->rights->societe->lire && $user->rights->societe->contact->lire) { $sql = "SELECT sp.rowid as id, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc, sp.statut as status"; + $sql .= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile, sp.email as spemail"; $sql .= ", s.nom as socname, s.name_alias, s.email as semail"; $sql .= ", s.client, s.fournisseur, s.code_client, s.code_fournisseur"; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 91803dc32db..a9b908203fe 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -393,6 +393,7 @@ class ExtraFields if (empty($required)) $required = 0; if (empty($unique)) $unique = 0; if (empty($alwayseditable)) $alwayseditable = 0; + if (empty($totalizable)) $totalizable = 0; if (!empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/", $attrname) && !is_numeric($attrname)) { @@ -456,7 +457,7 @@ class ExtraFields $sql .= "'".$this->db->idate(dol_now())."',"; $sql .= " ".($enabled ? "'".$this->db->escape($enabled)."'" : "1").","; $sql .= " ".($help ? "'".$this->db->escape($help)."'" : "null").","; - $sql .= " ".($totalizable ? '1' : '0'); + $sql .= " ".($totalizable ? 'TRUE' : 'FALSE'); $sql .= ')'; dol_syslog(get_class($this)."::create_label", LOG_DEBUG); @@ -805,7 +806,7 @@ class ExtraFields $sql .= " '".$this->db->escape($params)."',"; $sql .= " '".$this->db->escape($list)."', "; $sql .= " '".$this->db->escape($printable)."', "; - $sql .= " ".$totalizable.","; + $sql .= " ".($totalizable ? 'TRUE' : 'FALSE').","; $sql .= " ".(($default != '') ? "'".$this->db->escape($default)."'" : "null").","; $sql .= " ".($computed ? "'".$this->db->escape($computed)."'" : "null").","; $sql .= " ".$user->id.","; @@ -945,7 +946,7 @@ class ExtraFields $this->attributes[$tab->elementtype]['langfile'][$tab->name] = $tab->langs; $this->attributes[$tab->elementtype]['list'][$tab->name] = $tab->list; $this->attributes[$tab->elementtype]['printable'][$tab->name] = $tab->printable; - $this->attributes[$tab->elementtype]['totalizable'][$tab->name] = $tab->totalizable; + $this->attributes[$tab->elementtype]['totalizable'][$tab->name] = ($tab->totalizable ? 1 : 0); $this->attributes[$tab->elementtype]['entityid'][$tab->name] = $tab->entity; $this->attributes[$tab->elementtype]['enabled'][$tab->name] = $tab->enabled; $this->attributes[$tab->elementtype]['help'][$tab->name] = $tab->help; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5f06d72139e..8129c810303 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1298,7 +1298,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab $tabsname = str_replace("@", "", $picto); $out .= '
'; $out .= ''.$langs->trans("More").'... ('.$nbintab.')'; - $out .= '
'; + $out .= '
'; $out .= $outmore; $out .= '
'; $out .= '
'; diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index a0ac6ecfae1..f4415b7aed5 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -107,7 +107,7 @@ function dol_decode($chain, $key = '1') * If constant MAIN_SECURITY_SALT is defined, we use it as a salt (used only if hashing algorightm is something else than 'password_hash'). * * @param string $chain String to hash - * @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'. + * @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap with no salt, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'. * @return string Hash of string * @see getRandomPassword() */ @@ -122,7 +122,7 @@ function dol_hash($chain, $type = '0') } // Salt value - if (!empty($conf->global->MAIN_SECURITY_SALT)) $chain = $conf->global->MAIN_SECURITY_SALT.$chain; + if (! empty($conf->global->MAIN_SECURITY_SALT) && $type != '4' && $type !== 'md5openldap') $chain = $conf->global->MAIN_SECURITY_SALT.$chain; if ($type == '1' || $type == 'sha1') return sha1($chain); elseif ($type == '2' || $type == 'sha1md5') return sha1(md5($chain)); diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 81f86b1642d..6d7b17f7fe0 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1320,9 +1320,9 @@ class Cronjob extends CommonObject if ($processing) $moretext = ' ('.$langs->trans("Running").')'; elseif ($lastresult) $moretext .= ' ('.$langs->trans("Error").')'; - $this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Draft').$moretext; + $this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Disabled').$moretext; $this->labelStatus[self::STATUS_ENABLED] = $langs->trans('Enabled').$moretext; - $this->labelStatusShort[self::STATUS_DISABLED] = $langs->trans('Draft'); + $this->labelStatusShort[self::STATUS_DISABLED] = $langs->trans('Disabled'); $this->labelStatusShort[self::STATUS_ENABLED] = $langs->trans('Enabled'); }