From a20170b30079e0b56c4d9d1a8e1ef670519608fa Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Thu, 1 Dec 2011 10:46:32 +0100 Subject: [PATCH 1/3] fix some language error --- htdocs/langs/fr_FR/admin.lang | 4 ++-- htdocs/langs/fr_FR/projects.lang | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index b4a3e212f2e..477a5d83c57 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1276,8 +1276,8 @@ FreeLegalTextOnChequeReceipts=Mention complémentaire sur les bordereaux de remi BankOrderShow=Ordre d'affichage des informations bancaires (pour les pays les détaillant) BankOrderGlobal=Général BankOrderGlobalDesc=Ordre d'affichage général -BankOrderES=Espagnole -BankOrderESDesc=Ordre d'affichage Espagnole +BankOrderES=Espagnol +BankOrderESDesc=Ordre d'affichage Espagnol ##### Multicompany ##### MultiCompanySetup=Configuration du module Multi-société ##### Suppliers ##### diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index 02fafee8ca2..6722ac6bb1d 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -52,7 +52,7 @@ ListOrdersAssociatedProject=Liste des commandes clients associées au projet ListInvoicesAssociatedProject=Liste des factures clients associées au projet ListPredefinedInvoicesAssociatedProject=Liste des factures clients prédéfinies associées au projet ListSupplierOrdersAssociatedProject=Liste des commandes fournisseurs associées au projet -ListSupplierInvoicesAssociatedProject=Liste des factures fournisseur associées au projet +ListSupplierInvoicesAssociatedProject=Liste des factures fournisseurs associées au projet ListContractAssociatedProject=Liste des contrats associés au projet ListFichinterAssociatedProject=Liste des interventions associées au projet ListTripAssociatedProject=Liste des notes de frais associés au projet @@ -83,7 +83,7 @@ NoTasks=Aucune tâche pour ce projet LinkedToAnotherCompany=Liés à autre société TaskIsNotAffectedToYou=Tâche qui ne vous est pas affectée ErrorTimeSpentIsEmpty=Le temps consommé n'est pas renseigné -ThisWillAlsoRemoveTasks=Cette opération détruira également les taches du projet (%s taches actuellement) et le suivi des consommés. +ThisWillAlsoRemoveTasks=Cette opération détruira également les tâches du projet (%s tâches actuellement) et le suivi des consommés. IfNeedToUseOhterObjectKeepEmpty=Si des objets (facture, commande, ...), appartenant à un autre tiers que celui choisi, doivent être liés au projet à créer, laisser vide afin de laisser le projet multi-tiers. ##### Types de contacts ##### TypeContact_project_internal_PROJECTLEADER=Chef de projet From de7682618dd79ac44edf10dc3e606d4f08fedd8c Mon Sep 17 00:00:00 2001 From: ph35 Date: Wed, 30 Nov 2011 23:45:28 +0800 Subject: [PATCH 2/3] Update htdocs/langs/fr_FR/contracts.lang --- htdocs/langs/fr_FR/contracts.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/fr_FR/contracts.lang b/htdocs/langs/fr_FR/contracts.lang index 48524434588..39eb49e2c2a 100644 --- a/htdocs/langs/fr_FR/contracts.lang +++ b/htdocs/langs/fr_FR/contracts.lang @@ -31,8 +31,8 @@ MenuClosedServices=Services fermés NewContract=Nouveau contrat AddContract=Créer contrat SearchAContract=Rechercher un contrat -DeleteAContract=Supprimer un contract -CloseAContract=Clôturer un contract +DeleteAContract=Supprimer un contrat +CloseAContract=Clôturer un contrat ConfirmDeleteAContract=Êtes-vous sûr de vouloir supprimer ce contrat et tous ses services ? ConfirmValidateContract=Êtes-vous sûr de vouloir valider ce contrat ? ConfirmCloseContract=Ceci fermera tous les services actifs et inactifs. Êtes-vous sûr de vouloir clôturer ce contrat ? From 56a0e26465ded964824078c0262447c5b0563089 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Dec 2011 17:09:01 +0100 Subject: [PATCH 3/3] Fix: Removed tons of warnings --- htdocs/adherents/admin/adherent.php | 3 +- htdocs/adherents/class/adherent.class.php | 30 ++++++--- htdocs/admin/dict.php | 7 ++- htdocs/admin/system/index.php | 7 --- htdocs/boxes.php | 10 +-- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/core/class/doleditor.class.php | 2 +- htdocs/core/class/dolgraph.class.php | 2 +- htdocs/core/class/smtps.class.php | 7 +-- htdocs/core/db/mysql.class.php | 6 +- htdocs/core/db/mysqli.class.php | 6 +- .../connectors/php/commands.php | 2 +- htdocs/core/lib/bookmark.lib.php | 62 ------------------- htdocs/core/lib/pdf.lib.php | 2 +- .../doc/pdf_expedition_merou.modules.php | 5 +- 15 files changed, 48 insertions(+), 105 deletions(-) delete mode 100644 htdocs/core/lib/bookmark.lib.php diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index a144f8259c4..971182eb7f6 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -387,7 +387,7 @@ function form_constantes($tableau) print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -469,7 +469,6 @@ function form_constantes($tableau) print ""; print "\n"; print "\n"; - $i++; } } print ''; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 694e696d6ee..9995caebb5b 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -256,6 +256,8 @@ class Adherent extends CommonObject { global $conf,$langs; + $error=0; + $now=dol_now(); // Check parameters @@ -655,14 +657,17 @@ class Adherent extends CommonObject /** * Fonction qui supprime l'adherent et les donnees associees + * * @param rowid Id de l'adherent a effacer * @return int <0 si KO, 0=rien a effacer, >0 si OK */ function delete($rowid) { global $conf, $langs, $user; - $result = 0; + $result = 0; + $error=0; + $this->db->begin(); // Suppression options @@ -721,9 +726,6 @@ class Adherent extends CommonObject $this->db->rollback(); return -1; } - - return $result; - } @@ -1139,6 +1141,8 @@ class Adherent extends CommonObject { global $conf,$langs,$user; + $error=0; + // Clean parameters if (! $montant) $montant=0; @@ -1172,7 +1176,7 @@ class Adherent extends CommonObject if ($result > 0) { // Change properties of object (used by triggers) - $this->last_subscription_date=$dateop; + $this->last_subscription_date=dol_now(); $this->last_subscription_amount=$montant; $this->last_subscription_date_start=$date; $this->last_subscription_date_end=$datefin; @@ -1203,13 +1207,17 @@ class Adherent extends CommonObject /** * Function that validate a member - * @param user user adherent qui valide - * @return int <0 if KO, 0 if nothing done, >0 if OK + * + * @param User $user user adherent qui valide + * @return int <0 if KO, 0 if nothing done, >0 if OK */ function validate($user) { global $langs,$conf; + $error=0; + + // Check parameters if ($this->statut == 1) { dol_syslog(get_class($this)."::validate statut of member does not allow this", LOG_WARNING); @@ -1251,13 +1259,17 @@ class Adherent extends CommonObject /** * Fonction qui resilie un adherent - * @param user user adherent qui resilie - * @return int <0 si ko, >0 si ok + * + * @param User $user User making change + * @return int <0 if KO, >0 if OK */ function resiliate($user) { global $langs,$conf; + $error=0; + + // Check paramaters if ($this->statut == 0) { dol_syslog(get_class($this)."::resiliate statut of member does not allow this", LOG_WARNING); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 020ea1f2f3d..65f1fc4f64a 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -765,7 +765,7 @@ if ($_GET["id"]) $reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; - if (empty($reshook)) fieldList($fieldlist,$obj); + if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$_GET["id"]]); print ' '; print ' '; @@ -975,9 +975,10 @@ llxFooter(); * * @param array $fieldlist Array of fields * @param Object $obj If we show a particular record, obj is filled with record fields + * @param string $tabname Name of SQL table * @return void */ -function fieldList($fieldlist,$obj='') +function fieldList($fieldlist,$obj='',$tabname='') { global $conf,$langs,$db; global $form; @@ -1027,7 +1028,7 @@ function fieldList($fieldlist,$obj='') print $form->selectarray('source', $sourceList,$obj->$fieldlist[$field]); print ''; } - elseif ($fieldlist[$field] == 'type' && $tabname[$_GET["id"]] == MAIN_DB_PREFIX."c_actioncomm") + elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm") { print ''; print 'user'; diff --git a/htdocs/admin/system/index.php b/htdocs/admin/system/index.php index 98edcc5fc2b..0ce5fb86190 100644 --- a/htdocs/admin/system/index.php +++ b/htdocs/admin/system/index.php @@ -100,13 +100,6 @@ if ($db->type == 'pgsql') $langs->load("errors"); //print '
'.$langs->trans("ErrorDatabaseParameterWrong",'standard_conforming_strings','on').'
'; } - // Check option backslash_quote is on - /*$paramarray=$db->getServerParametersValues('backslash_quote'); - if ($paramarray['backslash_quote'] != 'on' && $paramarray['backslash_quote'] != 1) - { - $langs->load("errors"); - print '
'.$langs->trans("ErrorDatabaseParameterWrong",'backslash_quote','on').'
'; - }*/ } print '
'; diff --git a/htdocs/boxes.php b/htdocs/boxes.php index 97608f107d9..ad661583a8f 100644 --- a/htdocs/boxes.php +++ b/htdocs/boxes.php @@ -156,11 +156,11 @@ class InfoBox /** * Constructor * - * @param DoliDb $DB Database handler + * @param DoliDb $db Database handler */ - function InfoBox($DB) + function InfoBox($db) { - $this->db=$DB; + $this->db=$db; } @@ -275,7 +275,7 @@ class InfoBox } dol_include_once($sourcefile); - $box=new $boxname($db,$obj->note); + $box=new $boxname($this->db,$obj->note); $box->rowid=$obj->rowid; $box->box_id=$obj->box_id; @@ -325,6 +325,8 @@ class InfoBox { global $conf; + $error=0; + require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"); dol_syslog("InfoBoxes::saveboxorder zone=".$zone." user=".$userid); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index b2248549356..eda377f7e9c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -207,7 +207,7 @@ class Facture extends CommonObject //$amount = $this->amount; //$remise = $this->remise; - $totalht = ($amount - $remise); + //$totalht = ($amount - $remise); $sql = "INSERT INTO ".MAIN_DB_PREFIX."facture ("; $sql.= " facnumber"; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 706067e1ace..5f4b6708309 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -66,7 +66,7 @@ class DolEditor { global $conf,$langs; - dol_syslog("DolEditor::DolEditor htmlname=".$htmlname." tool=".$tool); + dol_syslog("DolEditor::DolEditor htmlname=".$htmlname." toolbarname=".$toolbarname); if (! $rows) $rows=round($height/20); if (! $cols) $cols=($width?round($width/6):80); diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index da1637c9dba..2ef8ec650c9 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -544,7 +544,7 @@ class DolGraph $paddleft=50; $paddright=10; $strl=dol_strlen(max(abs($this->MaxValue),abs($this->MinValue))); - if ($strl > 6) $paddleft += ($strln * 4); + if ($strl > 6) $paddleft += ($strl * 4); $group->setPadding($paddleft, $paddright); // Width on left and right for Y axis values $group->legend->setSpace(0); $group->legend->setPadding(2,2,2,2); diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 66ccc4b385f..9156f42ab39 100755 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -565,8 +565,7 @@ class SMTPs // This feature is not yet implemented return true; - if ( $_path ) - $this->_mailPath = $_path; + //if ( $_path ) $this->_mailPath = $_path; } /** @@ -913,7 +912,7 @@ class SMTPs /** * An array of bares addresses for use with 'RCPT TO:' */ - unset ($_RCPT_list); + $_RCPT_list=array(); // walk down Recipients array and pull just email addresses foreach ( $this->_msgRecipients as $_host => $_list ) @@ -1324,7 +1323,7 @@ class SMTPs $this->_msgContent['image'][$strImageName]['data'] = $strContent; if ( $this->getMD5flag() ) - $this->_msgContent['image'][$strFileName]['md5'] = dol_hash($strContent); + $this->_msgContent['image'][$strImageName]['md5'] = dol_hash($strContent); } } // END DOL_CHANGE LDR diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index 08b3c6199a7..6b661073089 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -1193,7 +1193,7 @@ class DoliDBMysql $result=array(); $sql='SHOW VARIABLES'; - if ($filter) $sql.=" LIKE '".addslashes($key)."'"; + if ($filter) $sql.=" LIKE '".addslashes($filter)."'"; $resql=$this->query($sql); if ($resql) { @@ -1209,12 +1209,12 @@ class DoliDBMysql * \param filter Filter list on a particular value * \return string Value for parameter */ - function getServerStatusValues($key,$filter='') + function getServerStatusValues($filter='') { $result=array(); $sql='SHOW STATUS'; - if ($filter) $sql.=" LIKE '".addslashes($key)."'"; + if ($filter) $sql.=" LIKE '".addslashes($filter)."'"; $resql=$this->query($sql); if ($resql) { diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 493068890ad..345c88a4448 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -1200,12 +1200,12 @@ class DoliDBMysqli * \param filter Filter list on a particular value * \return string Value for parameter */ - function getServerParametersValues($key,$filter='') + function getServerParametersValues($filter='') { $result=array(); $sql='SHOW VARIABLES'; - if ($filter) $sql.=" LIKE '".addslashes($key)."'"; + if ($filter) $sql.=" LIKE '".addslashes($filter)."'"; $resql=$this->query($sql); if ($resql) { @@ -1226,7 +1226,7 @@ class DoliDBMysqli $result=array(); $sql='SHOW STATUS'; - if ($filter) $sql.=" LIKE '".addslashes($key)."'"; + if ($filter) $sql.=" LIKE '".addslashes($filter)."'"; $resql=$this->query($sql); if ($resql) { diff --git a/htdocs/core/filemanagerdol/connectors/php/commands.php b/htdocs/core/filemanagerdol/connectors/php/commands.php index b7710d0a9a9..1b7946848e8 100755 --- a/htdocs/core/filemanagerdol/connectors/php/commands.php +++ b/htdocs/core/filemanagerdol/connectors/php/commands.php @@ -290,7 +290,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '') //issue the CKEditor Callback SendCKEditorResults ($CKEcallback, $sFileUrl, ($sErrorNumber != 0 - ? 'Error '. $sErrorNumber. ' upload failed. '. $sErrorMsg + ? 'Error '. $sErrorNumber. ' upload failed.' : 'Upload Successful')); } diff --git a/htdocs/core/lib/bookmark.lib.php b/htdocs/core/lib/bookmark.lib.php deleted file mode 100644 index 33bcfb97c50..00000000000 --- a/htdocs/core/lib/bookmark.lib.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * or see http://www.gnu.org/ - */ - -/** - * \file htdocs/core/lib/bookmark.lib.php - * \brief List of functions for bookmark module - */ - -function showArrayOfBookmark($fac) -{ - $sql = "SELECT s.rowid as socid, s.nom, b.rowid as bid"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."bookmark as b"; - $sql .= " WHERE b.fk_soc = s.rowid AND b.fk_user = ".$user->id; - $sql .= " ORDER BY lower(s.nom) ASC"; - - $resql = $db->query($sql); - - if ( $resql ) - { - $num = $db->num_rows($resql); - $i = 0; - if ($num) - { - print ''; - print "\n"; - $var = True; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $var = !$var; - print ""; - print ''; - print ''; - print ''; - $i++; - } - print '
".$langs->trans("Bookmarks")."
'.$obj->nom.''.img_delete().'
'; - } - $db->free($resql); - } - else - { - dol_print_error($db); - } -} - -?> \ No newline at end of file diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index f73d3f7be60..7ef6027d0f1 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1218,7 +1218,7 @@ function pdf_getCurrencySymbol(&$pdf, $currency_code) $currency_sign = " ".utf8_encode('£'); break; default: - $currency_sign = " ".$currency; + $currency_sign = " ".$currency_code; break; } return $currency_sign; diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php index 9d14713d57a..44c0d67a858 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php @@ -428,9 +428,9 @@ Class pdf_expedition_merou extends ModelePdfExpedition //Definition Emplacement du bloc Societe $Xoff = 110; $blSocX=90; - $blSocY=21; + $blSocY=24; $blSocW=50; - $blSocX2=$blSocW+$blSocXs; + $blSocX2=$blSocW+$blSocX; // Sender name $pdf->SetTextColor(0,0,60); @@ -495,7 +495,6 @@ Class pdf_expedition_merou extends ModelePdfExpedition /**********************************/ //Emplacement Informations Expediteur (My Company) /**********************************/ - $Ydef = $Yoff; $blExpX=$Xoff-20; $blW=52; $Yoff = $Yoff+5;