From ee8f3cbbe53994804a0f5c167e93fe69ed604057 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Jun 2013 17:58:34 +0200 Subject: [PATCH 1/4] Fix: css when using checkbox into label --- htdocs/theme/amarok/style.css.php | 4 ++++ htdocs/theme/auguria/style.css.php | 4 ++++ htdocs/theme/bureau2crea/style.css.php | 4 ++++ htdocs/theme/cameleo/style.css.php | 4 ++++ htdocs/theme/eldy/style.css.php | 3 +++ 5 files changed, 19 insertions(+) diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 7dd45121a00..0428b87081c 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -2160,6 +2160,10 @@ div.ui-radio margin: 4px; position: static; } +div.ui-checkbox label+input, div.ui-radio label+input { + position: absolute; +} + .ui-mobile fieldset { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid #AAAAAA !important; diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index e1aa84de0cb..b94a7f6120d 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -2344,6 +2344,10 @@ div.ui-radio margin: 4px; position: static; } +div.ui-checkbox label+input, div.ui-radio label+input { + position: absolute; +} + .ui-mobile fieldset { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid #AAAAAA !important; diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 1c3ca899365..71f4a87f037 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -2558,6 +2558,10 @@ div.ui-radio margin: 4px; position: static; } +div.ui-checkbox label+input, div.ui-radio label+input { + position: absolute; +} + .ui-mobile fieldset { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid #AAAAAA !important; diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index 4225e7f822e..e4e17e13c36 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -2390,6 +2390,10 @@ div.ui-radio margin: 4px; position: static; } +div.ui-checkbox label+input, div.ui-radio label+input { + position: absolute; +} + .ui-mobile fieldset { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid #AAAAAA !important; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index fdf48f71774..926798586ea 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2718,6 +2718,9 @@ div.ui-radio, div.ui-checkbox margin: 4px; position: static; } +div.ui-checkbox label+input, div.ui-radio label+input { + position: absolute; +} .ui-mobile fieldset { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid #AAAAAA !important; From 4f84b1e774b05111389bc565a6bda44eeed2cc8f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Jun 2013 17:43:30 +0200 Subject: [PATCH 2/4] Fix: Bad error management --- htdocs/core/class/rssparser.class.php | 51 ++++++++++++++------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index ebc71a9bfa8..13c7db642b1 100755 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -183,6 +183,7 @@ class RssParser include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $rss=''; $str=''; // This will contain content of feed // Check parameters @@ -213,7 +214,7 @@ class RssParser } else { - dol_syslog("RssParser::parser cache file ".$newpathofdestfile." is not found or older than now - cachedelay (".$nowgmt." - ".$cachedelay.") so we can't use it."); + dol_syslog(get_class($this)."::parser cache file ".$newpathofdestfile." is not found or older than now - cachedelay (".$nowgmt." - ".$cachedelay.") so we can't use it."); } } @@ -235,7 +236,6 @@ class RssParser //var_dump($opts);exit; $context = stream_context_create($opts); - // FIXME avoid error if no connection $str = file_get_contents($this->_urlRSS, false, $context); } catch (Exception $e) { @@ -243,36 +243,39 @@ class RssParser } } - // Convert $str into xml - if (! empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) + if ($str !== false) { - //print 'xx'.LIBXML_NOCDATA; - libxml_use_internal_errors(false); - $rss = simplexml_load_string($str, "SimpleXMLElement", LIBXML_NOCDATA); + // Convert $str into xml + if (! empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) + { + //print 'xx'.LIBXML_NOCDATA; + libxml_use_internal_errors(false); + $rss = simplexml_load_string($str, "SimpleXMLElement", LIBXML_NOCDATA); + } + else + { + $xmlparser=xml_parser_create(''); + if (!is_resource($xmlparser)) { + $this->error="ErrorFailedToCreateParser"; return -1; + } + + xml_set_object($xmlparser, $this); + xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element'); + xml_set_character_data_handler($xmlparser, 'feed_cdata'); + $status = xml_parse($xmlparser, $str); + xml_parser_free($xmlparser); + $rss=$this; + //var_dump($rss->_format);exit; + } } - else - { - $xmlparser=xml_parser_create(''); - if (!is_resource($xmlparser)) { - $this->error="ErrorFailedToCreateParser"; return -1; - } - - xml_set_object($xmlparser, $this); - xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element'); - xml_set_character_data_handler($xmlparser, 'feed_cdata'); - $status = xml_parse($xmlparser, $str); - xml_parser_free($xmlparser); - $rss=$this; - //var_dump($rss->_format);exit; - } - + // If $rss loaded if ($rss) { // Save file into cache if (empty($foundintocache) && $cachedir) { - dol_syslog("RssParser::parser cache file ".$newpathofdestfile." is saved onto disk."); + dol_syslog(get_class($this)."::parser cache file ".$newpathofdestfile." is saved onto disk."); if (! dol_is_dir($cachedir)) dol_mkdir($cachedir); $fp = fopen($newpathofdestfile, 'w'); fwrite($fp, $str); From 134187ef947766411cf4db985fa1b236c8a44515 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Jul 2013 00:05:39 +0200 Subject: [PATCH 3/4] Fix: Overlapping of company name. Fix: Missing state for ome countries. --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 3 ++- .../modules/expedition/doc/pdf_expedition_rouget.modules.php | 5 +++-- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 3 ++- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 3 ++- htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php | 3 ++- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 3 ++- .../modules/supplier_invoice/pdf/pdf_canelle.modules.php | 3 ++- .../core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 3 ++- 9 files changed, 18 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1173c418d6a..ae1b934c928 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -703,7 +703,7 @@ function dol_format_address($object,$withcountry=0,$sep="\n") // Address $ret .= $object->address; // Zip/Town/State - if (in_array($object->country_code,array('US','AU'))) // US: title firstname name \n address lines \n town, state, zip \n country + if (in_array($object->country_code,array('US','AU')) || ! empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS)) // US: title firstname name \n address lines \n town, state, zip \n country { $ret .= ($ret ? $sep : '' ).$object->town; if ($object->state && in_array($object->country_code,$countriesusingstate)) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 4622c4fc055..38753901d2e 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1147,9 +1147,10 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy=$pdf->getY(); // Show sender information - $pdf->SetXY($posx+2,$posy+8); + $pdf->SetXY($posx+2,$posy); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php index 368527612f1..d99e3b3d407 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php @@ -565,7 +565,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition $posx=$this->marge_gauche; $posy=42; $hautcadre=40; - if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur - 80 - $this->marge_droite; + if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; // Show sender frame $pdf->SetTextColor(0,0,0); @@ -581,10 +581,11 @@ class pdf_expedition_rouget extends ModelePdfExpedition $pdf->SetTextColor(0,0,60); $pdf->SetFont('','B',$default_font_size); $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy=$pdf->getY(); // Show sender information $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+8); + $pdf->SetXY($posx+2,$posy); $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index b74d31dad14..d726b3fc770 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1367,9 +1367,10 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy=$pdf->getY(); // Show sender information - $pdf->SetXY($posx+2,$posy+8); + $pdf->SetXY($posx+2,$posy); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index d40dfb3c8f3..13e6ba6f3a5 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -531,10 +531,11 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetTextColor(0,0,60); $pdf->SetFont('','B',$default_font_size); $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy=$pdf->getY(); // Show sender information $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+8); + $pdf->SetXY($posx+2,$posy); $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index 5b7b385ab27..13d37d3bb21 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -723,9 +723,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B',$default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy=$pdf->getY(); // Show sender information - $pdf->SetXY($posx+2,$posy+8); + $pdf->SetXY($posx+2,$posy); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index c8450c9369c..84ac223466b 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1212,9 +1212,10 @@ class pdf_azur extends ModelePDFPropales $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy=$pdf->getY(); // Show sender information - $pdf->SetXY($posx+2,$posy+8); + $pdf->SetXY($posx+2,$posy); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index e17755a5a4c..afd2e62b518 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -931,9 +931,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy=$pdf->getY(); // Show sender information - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($this->emetteur->name,44)*4)); + $pdf->SetXY($posx+2,$posy); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 013834fcb55..566d1e195bc 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -1000,9 +1000,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B', $default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy=$pdf->getY(); // Show sender information - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($this->emetteur->name,44)*4)); + $pdf->SetXY($posx+2,$posy); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); From 59c97afeed11782b5d631bb6dd02692f5431bec3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Jul 2013 02:10:22 +0200 Subject: [PATCH 4/4] Fix: Bad calculation. Missing global. --- htdocs/commande/class/commandestats.class.php | 4 ---- htdocs/compta/facture/class/facturestats.class.php | 10 ++++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 40714e98811..6de20836f35 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -95,7 +95,6 @@ class CommandeStats extends Stats */ function getNbByMonth($year) { - global $conf; global $user; $sql = "SELECT date_format(c.date_commande,'%m') as dm, count(*) nb"; @@ -117,7 +116,6 @@ class CommandeStats extends Stats */ function getNbByYear() { - global $conf; global $user; $sql = "SELECT date_format(c.date_commande,'%Y') as dm, count(*), sum(c.".$this->field.")"; @@ -138,7 +136,6 @@ class CommandeStats extends Stats */ function getAmountByMonth($year) { - global $conf; global $user; $sql = "SELECT date_format(c.date_commande,'%m') as dm, sum(c.".$this->field.")"; @@ -160,7 +157,6 @@ class CommandeStats extends Stats */ function getAverageByMonth($year) { - global $conf; global $user; $sql = "SELECT date_format(c.date_commande,'%m') as dm, avg(c.".$this->field.")"; diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 0fe45fc6c66..c2e42addbb5 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -92,6 +92,8 @@ class FactureStats extends Stats */ function getNbByMonth($year) { + global $user; + $sql = "SELECT MONTH(f.datef) as dm, COUNT(*)"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -113,6 +115,8 @@ class FactureStats extends Stats */ function getNbByYear() { + global $user; + $sql = "SELECT YEAR(f.datef) as dm, COUNT(*)"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -132,6 +136,8 @@ class FactureStats extends Stats */ function getAmountByMonth($year) { + global $user; + $sql = "SELECT date_format(datef,'%m') as dm, SUM(f.".$this->field.")"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -153,6 +159,8 @@ class FactureStats extends Stats */ function getAverageByMonth($year) { + global $user; + $sql = "SELECT date_format(datef,'%m') as dm, AVG(f.".$this->field.")"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -171,6 +179,8 @@ class FactureStats extends Stats */ function getAllByYear() { + global $user; + $sql = "SELECT date_format(datef,'%Y') as year, COUNT(*) as nb, SUM(f.".$this->field.") as total, AVG(f.".$this->field.") as avg"; $sql.= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";