From aaf2cca45f3488a81ffd713e148ea9c3572efaf8 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 27 Oct 2014 19:31:42 +0100 Subject: [PATCH 1/9] Fix bug n sellist extrafield filtered --- htdocs/core/class/extrafields.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 451598a5830..228fef11d10 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -727,11 +727,11 @@ class ExtraFields if (strpos($InfoFieldList[4], 'extra')!==false) { $sql.= ' as main, '.MAIN_DB_PREFIX .$InfoFieldList[0].'_extrafields as extra'; - $sqlwhere.= ' AND extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4]; + $sqlwhere.= ' WHERE extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4]; } else { - $sqlwhere.= ' AND '.$InfoFieldList[4]; + $sqlwhere.= ' WHERE '.$InfoFieldList[4]; } } if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it. From bd8b393d8a8e383e6345488be2836e61d7e1004c Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 5 Dec 2014 21:24:16 +0100 Subject: [PATCH 2/9] Fix [ bug #1740 ] Clone project make task date crazy --- htdocs/projet/class/task.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 4f883e1b743..68b6c867442 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1007,7 +1007,8 @@ class Task extends CommonObject $error=0; - $now=dol_now(); + //Use 00:00 of today if time is use on task. + $now=dol_mktime(0,0,0,dol_print_date(dol_now(),'%m'),dol_print_date(dol_now(),'%d'),dol_print_date(dol_now(),'%Y')); $datec = $now; From 146107280160f090dfd7fb1cdf8c37996ae3f7f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Dec 2014 01:12:52 +0100 Subject: [PATCH 3/9] Fix: Paypal link were broken dur to SSL v3 closed. --- ChangeLog | 2 ++ htdocs/paypal/lib/paypal.lib.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7a65eef7fc9..949492346b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 3.5.7 compared to 3.5.6 ***** +Fix: Paypal link were broken dur to SSL v3 closed. ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 31ed9b97ff8..3d9dcf16d02 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -683,7 +683,8 @@ function hash_call($methodName,$nvpStr) exit;*/ curl_setopt($ch, CURLOPT_URL, $API_Endpoint); curl_setopt($ch, CURLOPT_VERBOSE, 1); - curl_setopt($ch, CURLOPT_SSLVERSION, 3); // Force SSLv3 + //curl_setopt($ch, CURLOPT_SSLVERSION, 3); // Force SSLv3 + curl_setopt($ch, CURLOPT_SSLVERSION, 1); // Force TLSv1 //turning off the server and peer verification(TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); From 666e66e78f54ca45ed926f20e41fe442c20289d3 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 9 Dec 2014 05:04:12 +0100 Subject: [PATCH 4/9] Correct link in activity box --- htdocs/core/boxes/box_activity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index bddeb4b957e..8e0bd6a8a21 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -114,7 +114,7 @@ class box_activity extends ModeleBoxes $billurl="viewstatut=2&paye=1&year=".$objp->annee; $this->info_box_contents[$i][2] = array('td' => 'align="right"', - 'text' => $objp->nb, 'url' => DOL_URL_ROOT."/compta/facture/liste.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills" + 'text' => $objp->nb, 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills" ); $this->info_box_contents[$i][3] = array('td' => 'align="right"', From 81dc1415deabd45c2c3da2f4376d841c825166f4 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 9 Dec 2014 05:04:39 +0100 Subject: [PATCH 5/9] Untranslatable token in activity box --- htdocs/core/class/html.formother.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 5150f2d4e41..c54991af434 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1017,6 +1017,7 @@ class FormOther if ($nbboxactivated) { $langs->load("boxes"); + $langs->load("projects"); $emptybox=new ModeleBoxes($db); From a1bba472a03e146975fd932a1c91490cdddcf57d Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 12 Dec 2014 11:57:20 +0100 Subject: [PATCH 6/9] FIX: hook insertExtraFields must return a returnvalue (0,1,-1) --- htdocs/core/class/hookmanager.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 849b6bb0370..2a54354aedf 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -131,6 +131,7 @@ class HookManager // Define type of hook ('output', 'returnvalue' or 'addreplace'). 'addreplace' should be type for all hooks. 'output' and 'returnvalue' are deprecated. $hooktype='output'; if (preg_match('/^pdf_/',$method)) $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are returnvalue hooks. When there is 2 hooks of this type, only last one win. + if ($method =='insertExtraFields') $hooktype='returnvalue'; if (in_array( $method, array( From 27b47a4f4836f4bbb49898187a1be06d9ca00841 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 12 Dec 2014 14:31:36 +0100 Subject: [PATCH 7/9] FIX: dont put a mess with date and datetime extrafield value if already in right format (the bug was in propale/order/invoice extrafields, mainly visible with 2 datetime extrafields) --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5af3f5a93c3..3b7623f43ca 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2178,10 +2178,10 @@ abstract class CommonObject $this->array_options[$key] = price2num($this->array_options[$key]); break; case 'date': - $this->array_options[$key]=$this->db->idate($this->array_options[$key]); + if (is_numeric($this->array_options[$key])) $this->array_options[$key]=$this->db->idate($this->array_options[$key]); break; case 'datetime': - $this->array_options[$key]=$this->db->idate($this->array_options[$key]); + if (is_numeric($this->array_options[$key])) $this->array_options[$key]=$this->db->idate($this->array_options[$key]); break; } } From a4a1a991b85b88e418740837bcf4b0f5e0a846a1 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 15 Dec 2014 14:13:57 +0100 Subject: [PATCH 8/9] FIX: avoid milestones in margin calculation --- htdocs/margin/agentMargins.php | 1 + htdocs/margin/customerMargins.php | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 51166bc472b..30adf727318 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -119,6 +119,7 @@ $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ", ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE f.fk_soc = s.rowid"; $sql.= " AND sc.fk_soc = f.fk_soc"; +$sql.= " AND (d.product_type = 0 OR d.product_type = 1)"; if (! empty($conf->global->AGENT_CONTACT_TYPE)) $sql.= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = u.rowid) OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = u.rowid))"; else diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 6675753d4d6..38691d4f43b 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -173,6 +173,7 @@ $sql.= " WHERE f.fk_soc = s.rowid"; $sql.= " AND f.fk_statut > 0"; $sql.= " AND s.entity = ".$conf->entity; $sql.= " AND d.fk_facture = f.rowid"; +$sql.= " AND (d.product_type = 0 OR d.product_type = 1)"; if ($client) $sql.= " AND f.fk_soc = ".$socid; if (!empty($startdate)) From c9f69279c7ca0eca48e436e48f0e5570c4738305 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 16 Dec 2014 16:21:31 +0100 Subject: [PATCH 9/9] FIX: pagebreak on fichinter like in other documents --- .../fichinter/doc/pdf_soleil.modules.php | 33 ++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 6a0feda2e9d..ad5516f2bf6 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -255,19 +255,44 @@ class pdf_soleil extends ModelePDFFicheinter $txt=''.dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration),1,$outputlangs->charset_output).''; $desc=dol_htmlentitiesbr($objectligne->desc,1); - $pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt,$desc), 0, 1, 0); - + $pdf->startTransaction(); + $pdf->writeHTMLCell(0, 0, $curX, $curY, $txt.'
'.$desc, LR, 1, 0); + $pageposafter=$pdf->getPage(); + if ($pageposafter > $pageposbefore) // There is a pagebreak + { + $pdf->rollbackTransaction(true); + $pageposafter=$pageposbefore; + //print $pageposafter.'-'.$pageposbefore;exit; + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->writeHTMLCell(0, 0, $curX, $curY, $txt.'
'.$desc, LR, 1, 0); + $pageposafter=$pdf->getPage(); + $posyafter=$pdf->GetY(); + //var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit; + if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text + { + if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page + { + $pdf->AddPage('','',true); + $pdf->setPage($pageposafter+1); + } + } + } + else // No pagebreak + { + $pdf->commitTransaction(); + } + $nexY = $pdf->GetY(); $pageposafter=$pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - + // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore) { $pdf->setPage($pageposafter); $curY = $tab_top_newpage; } - + $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut // Detect if some page were added automatically and output _tableau for past pages