From 8908f977b8b95d186767685b8edc5368faa160da Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 14 Nov 2012 11:31:08 +0100 Subject: [PATCH] Fix: converting line delimiters !!! --- htdocs/cashdesk/class/Facturation.class.php | 4 +- htdocs/categories/class/categorie.class.php | 2 +- htdocs/compta/bank/fiche.php | 12 +-- htdocs/compta/facture.php | 14 ++-- htdocs/core/class/CMailFile.class.php | 8 +- htdocs/core/lib/functions.lib.php | 84 +++++++++---------- htdocs/core/lib/price.lib.php | 30 +++---- htdocs/core/modules/action/rapport.pdf.php | 8 +- .../modules/facture/doc/pdf_crabe.modules.php | 4 +- .../modules/propale/doc/pdf_azur.modules.php | 10 +-- .../pdf/pdf_canelle.modules.php | 6 +- htdocs/externalsite/admin/externalsite.php | 2 +- htdocs/product/stock/class/entrepot.class.php | 2 +- 13 files changed, 93 insertions(+), 93 deletions(-) diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index 9eda4232281..6c3f40d0acf 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -96,8 +96,8 @@ class Facturation $societe = new Societe($db); $societe->fetch($thirdpartyid); - $product = new Product($db); - $product->fetch($this->id); + $product = new Product($db); + $product->fetch($this->id); $sql = "SELECT taux"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva"; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 6c4d1ed0d23..596d5901fbe 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -86,7 +86,7 @@ class Categorie $resql = $this->db->query($sql); if ($resql) { - if ($this->db->num_rows($resql) > 0) + if ($this->db->num_rows($resql) > 0) { $res = $this->db->fetch_array($resql); diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index 75aaff172c5..b1d503b8760 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -88,12 +88,12 @@ if ($_POST["action"] == 'add') $action='create'; // Force chargement page en mode creation $error++; } - if (empty($account->label)) - { - setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), 'errors'); - $action='create'; // Force chargement page en mode creation - $error++; - } + if (empty($account->label)) + { + setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), 'errors'); + $action='create'; // Force chargement page en mode creation + $error++; + } if (! $error) { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 73e8555a8a3..67194b610d5 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -280,14 +280,14 @@ else if ($action == 'setconditions' && $user->rights->facture->creer) $object->cond_reglement_code=0; // To clean property $object->cond_reglement_id=0; // To clean property $result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int')); - if ($result < 0) dol_print_error($db,$object->error); + if ($result < 0) dol_print_error($db,$object->error); - $old_date_lim_reglement=$object->date_lim_reglement; - $new_date_lim_reglement=$object->calculate_date_lim_reglement(); - if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement=$new_date_lim_reglement; - if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement=$object->date; - $result=$object->update($user); - if ($result < 0) dol_print_error($db,$object->error); + $old_date_lim_reglement=$object->date_lim_reglement; + $new_date_lim_reglement=$object->calculate_date_lim_reglement(); + if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement=$new_date_lim_reglement; + if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement=$object->date; + $result=$object->update($user); + if ($result < 0) dol_print_error($db,$object->error); } else if ($action == 'setpaymentterm' && $user->rights->facture->creer) { diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 82c1e63abf4..3f97b88ad21 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -651,10 +651,10 @@ class CMailFile // Sender //$out.= "Sender: ".getValidAddress($this->addr_from,2)).$this->eol2; - $out.= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol2; + $out.= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol2; if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA)) { - $out.= "To: ".$this->getValidAddress($this->addr_to,0,1).$this->eol2; + $out.= "To: ".$this->getValidAddress($this->addr_to,0,1).$this->eol2; } $out.= "Return-Path: ".$this->getValidAddress($this->addr_from,0,1).$this->eol2; if (isset($this->reply_to) && $this->reply_to) $out.= "Reply-To: ".$this->getValidAddress($this->reply_to,2).$this->eol2; @@ -747,8 +747,8 @@ class CMailFile // Make RFC821 Compliant, replace bare linefeeds $strContent = preg_replace("/(?global->MAIN_FIX_FOR_BUGGED_MTA)) - { + if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) + { $strContent = preg_replace("/\r\n/si", "\n", $strContent); } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index aef25a6d679..86fb33f545c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2819,54 +2819,54 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller) require DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; } - $ret=0; - $found=0; + $ret=0; + $found=0; - if ($idprod > 0) - { - // Load product - $product=new Product($db); - $result=$product->fetch($idprod); - - if ($mysoc->country_code == $thirdparty_seller->country_code) // If selling country is ours - { + if ($idprod > 0) + { + // Load product + $product=new Product($db); + $result=$product->fetch($idprod); + + if ($mysoc->country_code == $thirdparty_seller->country_code) // If selling country is ours + { /* Not defined yet, so we don't use this if ($local==1) $ret=$product->localtax1_tx; elseif ($local==2) $ret=$product->localtax2_tx; $found=1; - */ - } - else - { - // TODO Read default product vat according to countrycode and product - - - } - } - - if (! $found) - { - // If vat of product for the country not found or not defined, we return higher vat of country. - $sql = "SELECT taux as vat_rate, localtax1, localtax2"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; - $sql.= " WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$thirdparty_seller->country_code."'"; - $sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC"; - $sql.= $db->plimit(1); - - $resql=$db->query($sql); - if ($resql) - { - $obj=$db->fetch_object($resql); - if ($obj) - { - if ($local==1) $ret=$obj->localtax1; + */ + } + else + { + // TODO Read default product vat according to countrycode and product + + + } + } + + if (! $found) + { + // If vat of product for the country not found or not defined, we return higher vat of country. + $sql = "SELECT taux as vat_rate, localtax1, localtax2"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; + $sql.= " WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$thirdparty_seller->country_code."'"; + $sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC"; + $sql.= $db->plimit(1); + + $resql=$db->query($sql); + if ($resql) + { + $obj=$db->fetch_object($resql); + if ($obj) + { + if ($local==1) $ret=$obj->localtax1; elseif ($local==2) $ret=$obj->localtax2; - } - } - else dol_print_error($db); - } - - dol_syslog("get_product_localtax_for_country: ret=".$ret); + } + } + else dol_print_error($db); + } + + dol_syslog("get_product_localtax_for_country: ret=".$ret); return $ret; } diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 714fdb9a578..dfca755bcac 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -57,30 +57,30 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt if (empty($seller) || ! is_object($seller)) $seller=$mysoc; // If seller is a customer, $seller is not provided, we use $mysoc $countryid=$seller->country_id; if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj; - if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj; + if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj; // Now we search localtaxes information ourself (rates and types). - $sql = "SELECT taux, localtax1, localtax2, localtax1_type, localtax2_type"; + $sql = "SELECT taux, localtax1, localtax2, localtax1_type, localtax2_type"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as cv"; - //$sql.= ", ".MAIN_DB_PREFIX."c_pays as cc"; + //$sql.= ", ".MAIN_DB_PREFIX."c_pays as cc"; $sql.= " WHERE cv.taux = ".$txtva; //$sql.= " AND cv.fk_pays = cc.rowid and cc.code = '".$mysoc->country_code."'"; - $sql.= " AND cv.fk_pays = ".$countryid; - dol_syslog("search vat information sql=".$sql); - $resql = $db->query($sql); - if ($resql) - { + $sql.= " AND cv.fk_pays = ".$countryid; + dol_syslog("search vat information sql=".$sql); + $resql = $db->query($sql); + if ($resql) + { $obj = $db->fetch_object($resql); if ($obj) - { - $localtax1_rate=$obj->localtax1; - $localtax2_rate=$obj->localtax2; - $localtax1_type=$obj->localtax1_type; - $localtax2_type=$obj->localtax2_type; + { + $localtax1_rate=$obj->localtax1; + $localtax2_rate=$obj->localtax2; + $localtax1_type=$obj->localtax1_type; + $localtax2_type=$obj->localtax2_type; //var_dump($localtax1_rate.' '.$localtax2_rate.' '.$localtax1_type.' '.$localtax2_type);exit; - } + } } - else dol_print_error($db); + else dol_print_error($db); // initialize total (may be HT or TTC depending on price_base_type) $tot_sans_remise = $pu * $qty; diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index bb0af3993e6..39f84608864 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -42,10 +42,10 @@ class CommActionRapport var $title; var $subject; - var $marge_gauche; - var $marge_droite; - var $marge_haute; - var $marge_basse; + var $marge_gauche; + var $marge_droite; + var $marge_haute; + var $marge_basse; /** diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 13e18567271..77d09e85691 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -500,8 +500,8 @@ class pdf_crabe extends ModelePDFFactures $tab3_top = $posy + 8; $tab3_width = 80; $tab3_height = 4; - if ($this->page_largeur < 210) // To work with US executive format - { + if ($this->page_largeur < 210) // To work with US executive format + { $tab3_posx -= 20; } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 05485e86f73..77d9d849d2a 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -283,13 +283,13 @@ class pdf_azur extends ModelePDFPropales $pdf->startTransaction(); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager); - $pageposafter=$pdf->getPage(); + $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->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,0,$hookmanager); $pageposafter=$pdf->getPage(); $posyafter=$pdf->GetY(); @@ -298,15 +298,15 @@ class pdf_azur extends ModelePDFPropales if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page { $pdf->AddPage('','',true); - if (! empty($tplidx)) $pdf->useTemplate($tplidx); + if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager); $pdf->setPage($pagenb+1); } } else { - // We found a page break - $showpricebeforepagebreak=0; + // We found a page break + $showpricebeforepagebreak=0; } } else // No pagebreak 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 dece24da350..b0a2b33e2e7 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -739,9 +739,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $tab3_top = $posy + 8; $tab3_width = 80; $tab3_height = 4; - if ($this->page_largeur < 210) // To work with US executive format - { - $tab3_posx -= 20; + if ($this->page_largeur < 210) // To work with US executive format + { + $tab3_posx -= 20; } $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/externalsite/admin/externalsite.php b/htdocs/externalsite/admin/externalsite.php index 830d191bc82..986a92e8968 100644 --- a/htdocs/externalsite/admin/externalsite.php +++ b/htdocs/externalsite/admin/externalsite.php @@ -79,7 +79,7 @@ $linkback=''.$langs->trans("BackToM print_fiche_titre($langs->trans("ExternalSiteSetup"),$linkback,'setup'); print $langs->trans("Module100Desc")."
\n"; -print '
'; +print '
'; print '
'; print ''; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 35fb8faec4e..09da96dabb2 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -265,7 +265,7 @@ class Entrepot extends CommonObject $result = $this->db->query($sql); if ($result) { - if ($this->db->num_rows($result) > 0) + if ($this->db->num_rows($result) > 0) { $obj=$this->db->fetch_object($result);