diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 72cd1ad5124..9dd04ca1ea6 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -627,8 +627,8 @@ if ($action == 'exportcsv') { print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; - print '"' . $langs->trans("Code_tiers") . '"' . $sep; - print '"' . utf8_decode ( dol_trunc($companystatic->name, 16) ) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("Code_tiers") . '"' . $sep; + print '"' . $langs->trans("Thirdparty") . '"' . $sep; + print '"' . utf8_decode ( dol_trunc($companystatic->name, 16) ) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("Thirdparty") . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep; print '"' . $journal . '"' ; @@ -694,7 +694,7 @@ if ($action == 'exportcsv') { print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; - print '"' . $langs->trans("Code_tiers") . '"' . $sep; + print '"' . $langs->trans("Thirdparty") . '"' . $sep; print '"' . utf8_decode ( dol_trunc($companystatic->name, 16) ) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("VAT") . ' NPR"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep; diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index c10cc2b311f..f56d5c9010e 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -578,8 +578,8 @@ if ($action == 'exportcsv') { print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; - print '"' . $langs->trans("Code_tiers") . '"' . $sep; - print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Code_tiers") . '"' . $sep; + print '"' . $langs->trans("Thirdparty") . '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Thirdparty") . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . $journal . '"'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7b940e35378..23758a1de5e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1457,7 +1457,7 @@ class Form * @param int $force_entity 0 or Id of environment to force * @param int $maxlength Maximum length of string into list (0=no limit) * @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status - * @param string $morefilter Add more filters into sql request + * @param string $morefilter Add more filters into sql request (Example: 'employee = 1') * @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list * @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty. * @param string $morecss More css @@ -1530,7 +1530,6 @@ class Form $sql.= " ORDER BY u.lastname ASC"; } - dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 20a9b85cf86..3d92d5f9019 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -738,6 +738,10 @@ class Ldap */ function serverPing($host, $port=389, $timeout=1) { + // Replace ldaps:// by ssl:// + if (preg_match('/^ldaps:\/\/([^\/]+)\/?$/',$host, $regs)) { + $host = 'ssl://'.$regs[1]; + } $op = @fsockopen($host, $port, $errno, $errstr, $timeout); if (!$op) return false; //DC is N/A else { diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 1e5b8d183e4..e7773e08de4 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -593,7 +593,7 @@ if (empty($reshook)) // FROM $expediteur = new User($db); - $expediteur->fetch($object->fk_user_valid); + $expediteur->fetch($object->fk_user_approve > 0 ? $object->fk_user_approve : $object->fk_user_validator); $emailFrom = $expediteur->email; if ($emailFrom && $emailTo) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 6c197b16e01..c3a6b2341f1 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -44,7 +44,6 @@ class ExpenseReport extends CommonObject public $date_fin; - var $fk_user_validator; var $status; var $fk_statut; // -- 0=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=payed, 99=denied var $fk_c_paiement; @@ -78,14 +77,16 @@ class ExpenseReport extends CommonObject var $detail_cancel; var $fk_user_cancel; + var $fk_user_validator; // User that is defined to approve + // Validation - var $date_valid; + var $date_valid; // User making validation var $fk_user_valid; var $user_valid_infos; // Approve var $date_approve; - var $fk_user_approve; + var $fk_user_approve; // User that has approved // Paiement var $user_paid_infos; @@ -179,6 +180,7 @@ class ExpenseReport extends CommonObject $sql.= ",date_create"; $sql.= ",fk_user_author"; $sql.= ",fk_user_validator"; + $sql.= ",fk_user_approve"; $sql.= ",fk_user_modif"; $sql.= ",fk_statut"; $sql.= ",fk_c_paiement"; @@ -196,6 +198,7 @@ class ExpenseReport extends CommonObject $sql.= ", '".$this->db->idate($now)."'"; $sql.= ", ".$fuserid; $sql.= ", ".($this->fk_user_validator > 0 ? $this->fk_user_validator:"null"); + $sql.= ", ".($this->fk_user_approve > 0 ? $this->fk_user_approve:"null"); $sql.= ", ".($this->fk_user_modif > 0 ? $this->fk_user_modif:"null"); $sql.= ", ".($this->fk_statut > 1 ? $this->fk_statut:0); $sql.= ", ".($this->modepaymentid?$this->modepaymentid:"null"); @@ -386,6 +389,7 @@ class ExpenseReport extends CommonObject } $sql.= " , fk_user_validator = ".($this->fk_user_validator > 0 ? $this->fk_user_validator:"null"); $sql.= " , fk_user_valid = ".($this->fk_user_valid > 0 ? $this->fk_user_valid:"null"); + $sql.= " , fk_user_approve = ".($this->fk_user_approve > 0 ? $this->fk_user_approve:"null"); $sql.= " , fk_user_modif = ".$user->id; $sql.= " , fk_statut = ".($this->fk_statut >= 0 ? $this->fk_statut:'0'); $sql.= " , fk_c_paiement = ".($this->fk_c_paiement > 0 ? $this->fk_c_paiement:"null"); @@ -495,7 +499,8 @@ class ExpenseReport extends CommonObject $this->user_author_infos = dolGetFirstLastname($user_author->firstname, $user_author->lastname); $user_approver = new User($this->db); - if ($this->fk_user_validator > 0) $user_approver->fetch($this->fk_user_validator); + if ($this->fk_user_approve > 0) $user_approver->fetch($this->fk_user_approve); + elseif ($this->fk_user_validator > 0) $user_approver->fetch($this->fk_user_validator); // For backward compatibility $this->user_validator_infos = dolGetFirstLastname($user_approver->firstname, $user_approver->lastname); $this->fk_statut = $obj->status; @@ -744,9 +749,9 @@ class ExpenseReport extends CommonObject $this->fk_statut = 5; $this->fk_user_author = $user->id; + $this->fk_user_validator = $user->id; $this->fk_user_valid = $user->id; $this->fk_user_approve = $user->id; - $this->fk_user_validator = $user->id; $this->note_private='Private note'; $this->note_public='SPECIMEN'; diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 59cb522d7d5..799b0907a92 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -814,21 +814,27 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create print '