From 269a59e11aa92d65e0ba352f661975a8bc9a164c Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 5 Aug 2014 14:17:29 +0200 Subject: [PATCH 01/11] Fix : warning was not calculated on the right date --- htdocs/commande/liste.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 2e96a5451d4..64ac19fe1ad 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -334,7 +334,7 @@ if ($resql) print ''; print ''; - if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_valid),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay)) + if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning"); if(!empty($objp->note_private)) { From 3499c69b7d096b13b52e6292f33ffb397bba74dc Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 6 Aug 2014 08:54:22 +0200 Subject: [PATCH 02/11] Fix : search contact by phone was mistaking phone pro and phone perso --- htdocs/contact/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 1c735d787b4..234dff307a6 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -172,11 +172,11 @@ if (strlen($search_phone)) } if (strlen($search_phoneper)) { - $sql .= " AND p.phone LIKE '%".$db->escape($search_phoneper)."%'"; + $sql .= " AND p.phone_perso LIKE '%".$db->escape($search_phoneper)."%'"; } if (strlen($search_phonepro)) { - $sql .= " AND p.phone_perso LIKE '%".$db->escape($search_phonepro)."%'"; + $sql .= " AND p.phone LIKE '%".$db->escape($search_phonepro)."%'"; } if (strlen($search_phonemob)) { From 546b31b9d0921e5f66531bdc1d1dd72ed59fce80 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 6 Aug 2014 12:02:44 +0200 Subject: [PATCH 03/11] Fix : Filtering on fourn paiement list was not working --- htdocs/fourn/facture/paiement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 6f8c3bc1920..0a15fa1bdae 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -399,7 +399,7 @@ if (empty($action)) { $sql .= ' AND p.rowid='.$db->escape($search_ref); } - if (! empty($search_account)) + if (! empty($search_account) && $search_account > 0) { $sql .= ' AND b.fk_account='.$db->escape($search_account); } From 9e8a8b4da5ad2d010b3fddea513cecb828ef6dda Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Aug 2014 01:18:20 +0200 Subject: [PATCH 04/11] Fix: regex syntax --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4457e627976..7fba7f50247 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -446,7 +446,7 @@ if (! defined('NOLOGIN')) $dol_authmode=$conf->authmode; // This properties is defined only when logged, to say what mode was successfully used $dol_tz=$_POST["tz"]; $dol_tz_string=$_POST["tz_string"]; - $dol_tz_string=preg_replace('/\s*\(.+\)/$','',$dol_tz_string); + $dol_tz_string=preg_replace('/\s*\(.+\)$/','',$dol_tz_string); $dol_tz_string=preg_replace('/,/','/',$dol_tz_string); $dol_tz_string=preg_replace('/\s/','_',$dol_tz_string); $dol_dst=0; From 8205a0e1b5c376220e45f4f4a1debdef310d6202 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Aug 2014 10:50:08 +0200 Subject: [PATCH 05/11] Fix: Better comment and var name --- htdocs/user/class/user.class.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 60a7648be35..df4128ba747 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2222,10 +2222,10 @@ class User extends CommonObject * fullname = nom avec chemin complet du user * fullpath = chemin complet compose des id * - * @param int $markafterid Removed all users including the leaf $markafterid in user tree. - * @return array Array of users. this->users and this->parentof are set. + * @param int $deleteafterid Removed all users including the leaf $deleteafterid (and all its child) in user tree. + * @return array Array of users. this->users and this->parentof are set. */ - function get_full_tree($markafterid=0) + function get_full_tree($deleteafterid=0) { global $conf,$user; @@ -2276,14 +2276,14 @@ class User extends CommonObject $this->build_path_from_id_user($key,0); // Process a branch from the root user key (this user has no parent) } - // Exclude leaf including $markafterid from tree - if ($markafterid) + // Exclude leaf including $deleteafterid from tree + if ($deleteafterid) { - //print "Look to discard user ".$markafterid."\n"; - $keyfilter1='^'.$markafterid.'$'; - $keyfilter2='_'.$markafterid.'$'; - $keyfilter3='^'.$markafterid.'_'; - $keyfilter4='_'.$markafterid.'_'; + //print "Look to discard user ".$deleteafterid."\n"; + $keyfilter1='^'.$deleteafterid.'$'; + $keyfilter2='_'.$deleteafterid.'$'; + $keyfilter3='^'.$deleteafterid.'_'; + $keyfilter4='_'.$deleteafterid.'_'; foreach($this->users as $key => $val) { if (preg_match('/'.$keyfilter1.'/',$val['fullpath']) || preg_match('/'.$keyfilter2.'/',$val['fullpath']) @@ -2325,7 +2325,7 @@ class User extends CommonObject $this->users[$id_user]['fullname'] = $this->users[$id_user]['lastname']; $i=0; $cursor_user=$id_user; - while ((empty($protection) || $i < $protection) && ! empty($this->parentof[$cursor_user])) // Loop on each parent, one after one + while ((empty($protection) || $i < $protection) && ! empty($this->parentof[$cursor_user])) { $this->users[$id_user]['fullpath'] = '_'.$this->parentof[$cursor_user].$this->users[$id_user]['fullpath']; $this->users[$id_user]['fullname'] = $this->users[$this->parentof[$cursor_user]]['lastname'].' >> '.$this->users[$id_user]['fullname']; From 8630f397bc066fa02c7e59e8368f7aafad7c1457 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Aug 2014 18:02:17 +0200 Subject: [PATCH 06/11] Fix: Do not force size. Must be done by function or css. --- htdocs/societe/soc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index fad70d5bd2e..daa782581e4 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1423,7 +1423,7 @@ else print ''; print ''.$langs->trans("Logo").''; print ''; - if ($object->logo) print $form->showphoto('societe',$object,50); + if ($object->logo) print $form->showphoto('societe',$object); $caneditfield=1; if ($caneditfield) { From bb355ec7bd217bddb5a9e4103ac6d593ee154ba2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Aug 2014 18:06:23 +0200 Subject: [PATCH 07/11] Fix: Do not force size. Must be done by function or css. --- htdocs/societe/soc.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index daa782581e4..aff54f85233 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1507,9 +1507,9 @@ else if ($showlogo || $showbarcode) { $htmllogobar.=''; - if ($showlogo) $htmllogobar.=$form->showphoto('societe',$object,50); + if ($showlogo) $htmllogobar.=$form->showphoto('societe',$object); if ($showlogo && $showbarcode) $htmllogobar.='

'; - if ($showbarcode) $htmllogobar.=$form->showbarcode($object,50); + if ($showbarcode) $htmllogobar.=$form->showbarcode($object); $htmllogobar.=''; } @@ -1937,7 +1937,6 @@ else if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC)) { print '
'; - //print ''; // Logo+barcode - $rowspan=4; + $rowspan=6; if (! empty($conf->global->SOCIETE_USEPREFIX)) $rowspan++; if (! empty($object->client)) $rowspan++; if (! empty($conf->fournisseur->enabled) && $object->fournisseur && ! empty($user->rights->fournisseur->lire)) $rowspan++; @@ -1588,12 +1588,12 @@ else if (empty($conf->global->SOCIETE_DISABLE_STATE)) print ''; // EMail - print ''; // Web - print ''; From b2638625c918cd8e9360980ce105cf21f5800b9d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Aug 2014 14:36:40 +0200 Subject: [PATCH 09/11] Add comment to warn about a bug --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 40248cd6596..b2276b1cdc6 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -427,7 +427,7 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height) global $conf; // Add a background image on document - if (! empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF)) + if (! empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF)) // Warning, this option make TCPDF generation beeing crazy and some content disappeared behin the image { $pdf->SetAutoPageBreak(0,0); // Disable auto pagebreak before adding image $pdf->Image($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF, (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_X)?$conf->global->MAIN_USE_BACKGROUND_ON_PDF_X:0), (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y)?$conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y:0), 0, $page_height); From 5026320fec7175fbd51a3d59e259c032b6a3e391 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Aug 2014 14:44:41 +0200 Subject: [PATCH 10/11] Fix: Longueur zone texte libre incorrecte. --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index b2276b1cdc6..cc7ede21ea9 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -795,7 +795,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass if ($line) // Free text { $pdf->SetXY($dims['lm'],-$posy); - $pdf->MultiCell($width, 3, $line, 0, $align, 0); + $pdf->MultiCell(0, 3, $line, 0, $align, 0); $posy-=$freetextheight; } From bcc0f244f046a0ea603d1f98cec0e9180e148558 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Aug 2014 19:21:31 +0200 Subject: [PATCH 11/11] Fix: Used wrong image --- htdocs/theme/eldy/style.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index c4e9b87ff44..309d6f87e46 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -681,7 +681,7 @@ div.mainmenu.click2dial { } div.mainmenu.companies { - background-image: url(); + background-image: url(); } div.mainmenu.commercial {
'; print ''; // ancre /* From 723bad0ece0bf460a060b7a78fff40c1d2b04802 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Aug 2014 18:22:00 +0200 Subject: [PATCH 08/11] Fix: colspan --- htdocs/societe/soc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index aff54f85233..0e2e58f73e8 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1497,7 +1497,7 @@ else print '
'.$langs->trans('State').''.$object->state.'
'.$langs->trans('EMail').''; + print '
'.$langs->trans('EMail').''; print dol_print_email($object->email,0,$object->id,'AC_EMAIL'); print '
'.$langs->trans('Web').''; + print '
'.$langs->trans('Web').''; print dol_print_url($object->url); print '