From a33071d7792079351849291616c41447427f805f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Jun 2019 12:52:35 +0200 Subject: [PATCH 1/5] FIX #11421 --- htdocs/bom/class/bom.class.php | 8 ++++---- htdocs/emailcollector/class/emailcollector.class.php | 4 ++-- .../emailcollector/class/emailcollectoraction.class.php | 6 +++--- .../emailcollector/class/emailcollectorfilter.class.php | 4 ++-- htdocs/modulebuilder/template/class/myobject.class.php | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 5d9f1f50cbc..73682c7698c 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -183,9 +183,9 @@ class BOM extends CommonObject // Translate some data of arrayofkeyval foreach($this->fields as $key => $val) { - if (is_array($this->fields[$key]['arrayofkeyval'])) + if (is_array($val['arrayofkeyval'])) { - foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2) + foreach($val['arrayofkeyval'] as $key2 => $val2) { $this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2); } @@ -1084,9 +1084,9 @@ class BOMLine extends CommonObject // Translate some data of arrayofkeyval foreach($this->fields as $key => $val) { - if (is_array($this->fields[$key]['arrayofkeyval'])) + if (is_array($val['arrayofkeyval'])) { - foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2) + foreach($val['arrayofkeyval'] as $key2 => $val2) { $this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2); } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index b22d7b23607..86b7e5a547d 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -209,9 +209,9 @@ class EmailCollector extends CommonObject // Translate some data of arrayofkeyval foreach($this->fields as $key => $val) { - if (is_array($this->fields[$key]['arrayofkeyval'])) + if (is_array($val['arrayofkeyval'])) { - foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2) + foreach($val['arrayofkeyval'] as $key2 => $val2) { $this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2); } diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index 96f650c9fc0..e8062497534 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -164,11 +164,11 @@ class EmailCollectorAction extends CommonObject // Translate some data of arrayofkeyval foreach($this->fields as $key => $val) { - if (is_array($this->fields[$key]['arrayofkeyval'])) + if (is_array($val['arrayofkeyval'])) { - foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2) + foreach($val['arrayofkeyval'] as $key2 => $val2) { - $this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2); + $this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2); } } } diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index 5c7c7184ffc..69ab957040d 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -133,9 +133,9 @@ class EmailCollectorFilter extends CommonObject // Translate some data of arrayofkeyval foreach($this->fields as $key => $val) { - if (is_array($this->fields[$key]['arrayofkeyval'])) + if (is_array($val['arrayofkeyval'])) { - foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2) + foreach($val['arrayofkeyval'] as $key2 => $val2) { $this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2); } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 0025c00165d..13157b2c18f 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -225,9 +225,9 @@ class MyObject extends CommonObject // Translate some data of arrayofkeyval foreach($this->fields as $key => $val) { - if (is_array($this->fields[$key]['arrayofkeyval'])) + if (is_array($val['arrayofkeyval'])) { - foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2) + foreach($val['arrayofkeyval'] as $key2 => $val2) { $this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2); } From 97827f5172d227981d936c7a6daeaf3a7e350837 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Jun 2019 01:44:49 +0200 Subject: [PATCH 2/5] Fix print --- htdocs/product/stats/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 399cc59b7c2..c8b34a1182d 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -388,7 +388,7 @@ if ($result || empty($id)) } else { - print $dategenerated=($mesg?''.$mesg.'':$langs->trans("ChartNotGenerated")); + $dategenerated=($mesg?''.$mesg.'':$langs->trans("ChartNotGenerated")); } $linktoregenerate='id).((string) $type != ''?'&type='.$type:'').'&action=recalcul&mode='.$mode.'&search_year='.$search_year.'&search_categ='.$search_categ.'">'.img_picto($langs->trans("ReCalculate").' ('.$dategenerated.')', 'refresh').''; From 8aebcc45b229f783c6d62ac88b8051a9bbd2adf5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Jun 2019 01:54:38 +0200 Subject: [PATCH 3/5] Fix message to not show sometimes --- htdocs/product/stats/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index c8b34a1182d..b95613c0e68 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -350,9 +350,9 @@ if ($result || empty($id)) dol_print_error($db, 'Error for calculating graph on key='.$key.' - '.$object->error); } } - } - $mesg = $langs->trans("ChartGenerated"); + //setEventMessages($langs->trans("ChartGenerated"), null, 'mesgs'); + } } // Show graphs @@ -390,7 +390,7 @@ if ($result || empty($id)) { $dategenerated=($mesg?''.$mesg.'':$langs->trans("ChartNotGenerated")); } - $linktoregenerate='id).((string) $type != ''?'&type='.$type:'').'&action=recalcul&mode='.$mode.'&search_year='.$search_year.'&search_categ='.$search_categ.'">'.img_picto($langs->trans("ReCalculate").' ('.$dategenerated.')', 'refresh').''; + $linktoregenerate='id).((string) $type != ''?'&type='.$type:'').'&action=recalcul&mode='.$mode.'&search_year='.$search_year.'&search_categ='.$search_categ.'">'.img_picto($langs->trans("ReCalculate").' ('.$dategenerated.')', 'refresh').''; // Show graph print ''; From 93b0e452468beb61c1cc75feb6a622df71db3c09 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Jun 2019 02:27:58 +0200 Subject: [PATCH 4/5] Fix duplicate class in some cases --- htdocs/product/class/product.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 02de9b4d47d..fc966f7f19a 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4033,7 +4033,7 @@ class Product extends CommonObject } $linkclose.= ' title="'.dol_escape_htmltag($label, 1, 1).'"'; - $linkclose.= ' class="classfortooltip"'; + $linkclose.= ' class="nowraponall classfortooltip"'; /* $hookmanager->initHooks(array('productdao')); @@ -4042,6 +4042,10 @@ class Product extends CommonObject if ($reshook > 0) $linkclose = $hookmanager->resPrint; */ } + else + { + $linkclose = ' class="nowraponall"'; + } if ($option == 'supplier' || $option == 'category') { $url = DOL_URL_ROOT.'/product/fournisseurs.php?id='.$this->id; @@ -4062,7 +4066,7 @@ class Product extends CommonObject } } - $linkstart = ''; $linkend=''; From 72084f4684afeca200b0f135741eb9ca162c1444 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Jun 2019 16:49:32 +0200 Subject: [PATCH 5/5] Fix protected --- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 6 +++--- .../core/modules/bank/doc/pdf_sepamandate.modules.php | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 5deb40fc7ad..a6ec1eabcd9 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -287,7 +287,7 @@ class pdf_ban extends ModeleBankAccountDoc * @param int $hidebottom Hide bottom bar of array * @return void */ - private function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0) + protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0) { global $conf,$mysoc; @@ -303,7 +303,7 @@ class pdf_ban extends ModeleBankAccountDoc * @param Translate $outputlangs Object lang for output * @return void */ - private function _pagehead(&$pdf, $object, $showaddress, $outputlangs) + protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { global $langs,$conf,$mysoc; @@ -389,7 +389,7 @@ class pdf_ban extends ModeleBankAccountDoc * @param int $hidefreetext 1=Hide free text * @return integer */ - private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) + protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) { global $conf; $showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 9783c4690b2..657a3146e6e 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -430,7 +430,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc * @param int $hidebottom Hide bottom bar of array * @return void */ - private function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0) + protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0) { global $conf,$mysoc; @@ -448,7 +448,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc * @param Translate $outputlangs Langs object * @return void */ - private function _tableau_info(&$pdf, $object, $posy, $outputlangs) + protected function _tableau_info(&$pdf, $object, $posy, $outputlangs) { // phpcs:enable global $conf, $mysoc; @@ -485,7 +485,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc * @param Translate $outputlangs Objet langs * @return int Position pour suite */ - private function _signature_area(&$pdf, $object, $posy, $outputlangs) + protected function _signature_area(&$pdf, $object, $posy, $outputlangs) { // phpcs:enable $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -526,7 +526,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc * @param Translate $outputlangs Object lang for output * @return void */ - private function _pagehead(&$pdf, $object, $showaddress, $outputlangs) + protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { global $langs,$conf,$mysoc; @@ -618,7 +618,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc * @param int $hidefreetext 1=Hide free text * @return integer */ - private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) + protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) { global $conf; $showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;