Fix: Too many parameter

This commit is contained in:
Laurent Destailleur 2014-08-01 14:26:13 +02:00
parent e18caccdc9
commit bb8ec0c8f9
17 changed files with 78 additions and 74 deletions

View File

@ -94,7 +94,7 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0)
print "Invoice ".$i." for socid ".$socid; print "Invoice ".$i." for socid ".$socid;
$facture = new Facture($db, $socids[$socid]); $facture = new Facture($db);
$facture->date = time(); $facture->date = time();
$facture->cond_reglement_id = 3; $facture->cond_reglement_id = 3;
$facture->mode_reglement_id = 3; $facture->mode_reglement_id = 3;

View File

@ -122,7 +122,7 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
$soc = new Societe($db); $soc = new Societe($db);
$propal = new Propal($db, $socids[$socid]); $propal = new Propal($db);
$obj = $conf->global->PROPALE_ADDON; $obj = $conf->global->PROPALE_ADDON;
$modPropale = new $obj; $modPropale = new $obj;
@ -130,6 +130,7 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
$propal->ref = $numpr; $propal->ref = $numpr;
$propal->contactid = $contids[$socids[$socid]][0]; $propal->contactid = $contids[$socids[$socid]][0];
$propal->socid = $socids[$socid];
$propal->datep = time(); $propal->datep = time();
$propal->cond_reglement_id = 3; $propal->cond_reglement_id = 3;
$propal->mode_reglement_id = 3; $propal->mode_reglement_id = 3;

View File

@ -187,7 +187,7 @@ class Adherent extends CommonObject
if (dol_textishtml($text,1)) $msgishtml = 1; if (dol_textishtml($text,1)) $msgishtml = 1;
$infos=''; $infos='';
if ($this->civility_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel(1)."\n"; if ($this->civility_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel()."\n";
$infos.= $langs->transnoentities("id").": ".$this->id."\n"; $infos.= $langs->transnoentities("id").": ".$this->id."\n";
$infos.= $langs->transnoentities("Lastname").": ".$this->lastname."\n"; $infos.= $langs->transnoentities("Lastname").": ".$this->lastname."\n";
$infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n"; $infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n";
@ -210,7 +210,7 @@ class Adherent extends CommonObject
$substitutionarray=array( $substitutionarray=array(
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
'%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id, '%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id,
'%CIVILITY%'=>$this->getCivilityLabel($msgishtml?0:1), '%CIVILITY%'=>$this->getCivilityLabel(),
'%FIRSTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname, '%FIRSTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
'%LASTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname, '%LASTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
'%FULLNAME%'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs), '%FULLNAME%'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
@ -350,7 +350,7 @@ class Adherent extends CommonObject
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('MEMBER_CREATE',$user); $result=$this->call_trigger('MEMBER_CREATE',$user);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
// End call triggers // End call triggers
} }
@ -599,7 +599,7 @@ class Adherent extends CommonObject
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('MEMBER_MODIFY',$user); $result=$this->call_trigger('MEMBER_MODIFY',$user);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
// End call triggers // End call triggers
} }
} }
@ -774,7 +774,7 @@ class Adherent extends CommonObject
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('MEMBER_DELETE',$user); $result=$this->call_trigger('MEMBER_DELETE',$user);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
// End call triggers // End call triggers
} }
@ -830,7 +830,7 @@ class Adherent extends CommonObject
} }
$this->db->begin(); $this->db->begin();
// Mise a jour // Mise a jour
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET pass = '".$this->db->escape($password_indatabase)."'"; $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET pass = '".$this->db->escape($password_indatabase)."'";
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
@ -877,7 +877,7 @@ class Adherent extends CommonObject
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('MEMBER_NEW_PASSWORD',$user); $result=$this->call_trigger('MEMBER_NEW_PASSWORD',$user);
if ($result < 0) { $error++; $this->db->rollback(); return -1; } if ($result < 0) { $error++; $this->db->rollback(); return -1; }
// End call triggers // End call triggers
} }
@ -1292,7 +1292,7 @@ class Adherent extends CommonObject
// Call trigger // Call trigger
$result=$this->call_trigger('MEMBER_SUBSCRIPTION',$user); $result=$this->call_trigger('MEMBER_SUBSCRIPTION',$user);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
// End call triggers // End call triggers
} }
@ -1351,7 +1351,7 @@ class Adherent extends CommonObject
// Call trigger // Call trigger
$result=$this->call_trigger('MEMBER_VALIDATE',$user); $result=$this->call_trigger('MEMBER_VALIDATE',$user);
if ($result < 0) { $error++; $this->db->rollback(); return -1; } if ($result < 0) { $error++; $this->db->rollback(); return -1; }
// End call triggers // End call triggers
$this->db->commit(); $this->db->commit();
@ -1399,7 +1399,7 @@ class Adherent extends CommonObject
// Call trigger // Call trigger
$result=$this->call_trigger('MEMBER_RESILIATE',$user); $result=$this->call_trigger('MEMBER_RESILIATE',$user);
if ($result < 0) { $error++; $this->db->rollback(); return -1; } if ($result < 0) { $error++; $this->db->rollback(); return -1; }
// End call triggers // End call triggers
$this->db->commit(); $this->db->commit();
@ -1530,7 +1530,7 @@ class Adherent extends CommonObject
/** /**
* Return civility label of a member * Return civility label of a member
* *
* @return string Translated name of civility * @return string Translated name of civility (translated with transnoentitiesnoconv)
*/ */
function getCivilityLabel() function getCivilityLabel()
{ {

View File

@ -139,7 +139,7 @@ class Commande extends CommonOrder
{ {
$file = $conf->global->COMMANDE_ADDON.".php"; $file = $conf->global->COMMANDE_ADDON.".php";
$classname = $conf->global->COMMANDE_ADDON; $classname = $conf->global->COMMANDE_ADDON;
// Include file with class // Include file with class
foreach ($conf->file->dol_document_root as $dirroot) foreach ($conf->file->dol_document_root as $dirroot)
{ {
@ -262,7 +262,7 @@ class Commande extends CommonOrder
// We decrement stock of product (and sub-products) // We decrement stock of product (and sub-products)
$result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderValidatedInDolibarr",$num)); $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderValidatedInDolibarr",$num));
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;
$this->error=$mouvP->error; $this->error=$mouvP->error;
} }
@ -305,7 +305,7 @@ class Commande extends CommonOrder
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('ORDER_VALIDATE',$user); $result=$this->call_trigger('ORDER_VALIDATE',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
} }
@ -436,7 +436,7 @@ class Commande extends CommonOrder
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('ORDER_REOPEN',$user); $result=$this->call_trigger('ORDER_REOPEN',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
} }
else else
@ -495,9 +495,9 @@ class Commande extends CommonOrder
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('ORDER_CLOSE',$user); $result=$this->call_trigger('ORDER_CLOSE',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
if (! $error) if (! $error)
{ {
$this->statut=3; $this->statut=3;
@ -558,7 +558,7 @@ class Commande extends CommonOrder
$mouvP = new MouvementStock($this->db); $mouvP = new MouvementStock($this->db);
// We increment stock of product (and sub-products) // We increment stock of product (and sub-products)
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref)); $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref));
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;
$this->error=$mouvP->error; $this->error=$mouvP->error;
@ -572,7 +572,7 @@ class Commande extends CommonOrder
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('ORDER_CANCEL',$user); $result=$this->call_trigger('ORDER_CANCEL',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
} }
@ -764,9 +764,10 @@ class Commande extends CommonOrder
if ($origin == 'propal' && $origin_id) if ($origin == 'propal' && $origin_id)
{ {
// On recupere les differents contact interne et externe // On recupere les differents contact interne et externe
$prop = new Propal($this->db, $this->socid, $origin_id); $prop = new Propal($this->db);
$prop->fetch($origin_id);
// On recupere le commercial suivi propale // We get ids of sales representatives of proposal
$this->userid = $prop->getIdcontact('internal', 'SALESREPFOLL'); $this->userid = $prop->getIdcontact('internal', 'SALESREPFOLL');
if ($this->userid) if ($this->userid)
@ -775,7 +776,7 @@ class Commande extends CommonOrder
$this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal'); $this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
} }
// On recupere le contact client suivi propale // We get ids of customer follower of proposal
$this->contactid = $prop->getIdcontact('external', 'CUSTOMER'); $this->contactid = $prop->getIdcontact('external', 'CUSTOMER');
if ($this->contactid) if ($this->contactid)
@ -813,7 +814,7 @@ class Commande extends CommonOrder
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('ORDER_CREATE',$user); $result=$this->call_trigger('ORDER_CREATE',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
} }
@ -908,7 +909,7 @@ class Commande extends CommonOrder
// Call trigger // Call trigger
$result=$this->call_trigger('ORDER_CLONE',$user); $result=$this->call_trigger('ORDER_CLONE',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
} }
@ -2228,7 +2229,7 @@ class Commande extends CommonOrder
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('ORDER_CLASSIFY_BILLED',$user); $result=$this->call_trigger('ORDER_CLASSIFY_BILLED',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
if (! $error) if (! $error)
@ -2447,7 +2448,7 @@ class Commande extends CommonOrder
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('ORDER_DELETE',$user); $result=$this->call_trigger('ORDER_DELETE',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
} }
@ -3189,7 +3190,7 @@ class OrderLine extends CommonOrderLine
// Call trigger // Call trigger
$result=$this->call_trigger('LINEORDER_DELETE',$user); $result=$this->call_trigger('LINEORDER_DELETE',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
if (!$error) { if (!$error) {
@ -3312,7 +3313,7 @@ class OrderLine extends CommonOrderLine
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('LINEORDER_INSERT',$user); $result=$this->call_trigger('LINEORDER_INSERT',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
} }
@ -3427,7 +3428,7 @@ class OrderLine extends CommonOrderLine
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('LINEORDER_UPDATE',$user); $result=$this->call_trigger('LINEORDER_UPDATE',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
} }

View File

@ -88,7 +88,7 @@ if ($action == 'update' && ! $_POST["cancel"])
if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->banque->configurer) if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->banque->configurer)
{ {
// Modification // Modification
$account = new Account($db, $_GET["id"]); $account = new Account($db);
$account->delete($_GET["id"]); $account->delete($_GET["id"]);
header("Location: ".DOL_URL_ROOT."/compta/bank/index.php"); header("Location: ".DOL_URL_ROOT."/compta/bank/index.php");

View File

@ -3,7 +3,7 @@
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copytight (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copytight (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copytight (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copytight (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -57,7 +57,7 @@ if ($_POST["action"] == 'add')
$error=0; $error=0;
// Create account // Create account
$account = new Account($db,0); $account = new Account($db);
$account->ref = dol_sanitizeFileName(trim($_POST["ref"])); $account->ref = dol_sanitizeFileName(trim($_POST["ref"]));
$account->label = trim($_POST["label"]); $account->label = trim($_POST["label"]);
@ -119,7 +119,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
$error=0; $error=0;
// Update account // Update account
$account = new Account($db, $_POST["id"]); $account = new Account($db);
$account->fetch($_POST["id"]); $account->fetch($_POST["id"]);
$account->ref = dol_string_nospecial(trim($_POST["ref"])); $account->ref = dol_string_nospecial(trim($_POST["ref"]));
@ -325,9 +325,9 @@ if ($action == 'create')
print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_desired" value="'.($_POST["account_min_desired"]?$_POST["account_min_desired"]:$account->account_min_desired).'"></td></tr>'; print '<td colspan="3"><input size="12" type="text" class="flat" name="account_min_desired" value="'.($_POST["account_min_desired"]?$_POST["account_min_desired"]:$account->account_min_desired).'"></td></tr>';
print '</table>'; print '</table>';
print '<br>'; print '<br>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Accountancy code // Accountancy code
if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED))
@ -340,11 +340,11 @@ if ($action == 'create')
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>'; print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>'; print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
} }
// Accountancy journal // Accountancy journal
print '<tr><td valign="top">'.$langs->trans("AccountancyJournal").'</td>'; print '<tr><td valign="top">'.$langs->trans("AccountancyJournal").'</td>';
print '<td colspan="3"><input type="text" name="accountancy_journal" value="'.$account->accountancy_journal.'"></td></tr>'; print '<td colspan="3"><input type="text" name="accountancy_journal" value="'.$account->accountancy_journal.'"></td></tr>';
print '</table>'; print '</table>';
print '<center><br><input value="'.$langs->trans("CreateAccount").'" type="submit" class="button"></center>'; print '<center><br><input value="'.$langs->trans("CreateAccount").'" type="submit" class="button"></center>';
@ -458,19 +458,19 @@ else
print '<td colspan="3">'.$account->comment.'</td></tr>'; print '<td colspan="3">'.$account->comment.'</td></tr>';
print '</table>'; print '</table>';
print '<br>'; print '<br>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Accountancy code // Accountancy code
print '<tr><td valign="top" width="25%">'.$langs->trans("AccountancyCode").'</td>'; print '<tr><td valign="top" width="25%">'.$langs->trans("AccountancyCode").'</td>';
print '<td colspan="3">'.$account->account_number.'</td></tr>'; print '<td colspan="3">'.$account->account_number.'</td></tr>';
// Accountancy journal // Accountancy journal
print '<tr><td valign="top">'.$langs->trans("AccountancyJournal").'</td>'; print '<tr><td valign="top">'.$langs->trans("AccountancyJournal").'</td>';
print '<td colspan="3">'.$account->accountancy_journal.'</td></tr>'; print '<td colspan="3">'.$account->accountancy_journal.'</td></tr>';
print '</table>'; print '</table>';
print '</div>'; print '</div>';
@ -611,7 +611,7 @@ else
$doleditor=new DolEditor('account_comment',(isset($_POST["account_comment"])?$_POST["account_comment"]:$account->comment),'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70); $doleditor=new DolEditor('account_comment',(isset($_POST["account_comment"])?$_POST["account_comment"]:$account->comment),'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70);
$doleditor->Create(); $doleditor->Create();
print '</td></tr>'; print '</td></tr>';
// Accountancy code // Accountancy code
if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED))
{ {
@ -623,7 +623,7 @@ else
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>'; print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>'; print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';
} }
// Accountancy journal // Accountancy journal
print '<tr><td valign="top">'.$langs->trans("AccountancyJournalCode").'</td>'; print '<tr><td valign="top">'.$langs->trans("AccountancyJournalCode").'</td>';
print '<td colspan="3"><input type="text" name="accountancy_journal" value="'.(isset($_POST["accountancy_journal"])?$_POST["accountancy_journal"]:$account->accountancy_journal).'"></td></tr>'; print '<td colspan="3"><input type="text" name="accountancy_journal" value="'.(isset($_POST["accountancy_journal"])?$_POST["accountancy_journal"]:$account->accountancy_journal).'"></td></tr>';

View File

@ -113,11 +113,10 @@ class box_graph_propales_permonth extends ModeleBoxes
$nowarray=dol_getdate(dol_now(),true); $nowarray=dol_getdate(dol_now(),true);
if (empty($endyear)) $endyear=$nowarray['year']; if (empty($endyear)) $endyear=$nowarray['year'];
$startyear=$endyear-1; $startyear=$endyear-1;
$mode='customer';
$WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320'; $WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320';
$HEIGHT='192'; $HEIGHT='192';
$stats = new PropaleStats($this->db, $socid, $mode, 0); $stats = new PropaleStats($this->db, $socid, 0);
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($shownb) if ($shownb)
@ -126,8 +125,7 @@ class box_graph_propales_permonth extends ModeleBoxes
$datatype1 = array_pad(array(), ($endyear-$startyear+1), 'bars'); $datatype1 = array_pad(array(), ($endyear-$startyear+1), 'bars');
$filenamenb = $dir."/".$prefix."propalsnbinyear-".$endyear.".png"; $filenamenb = $dir."/".$prefix."propalsnbinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&amp;file=propalsnbinyear-'.$endyear.'.png'; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&amp;file=propalsnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&amp;file=propalsnbinyear-'.$endyear.'.png';
$px1 = new DolGraph(); $px1 = new DolGraph();
$mesg = $px1->isGraphKo(); $mesg = $px1->isGraphKo();

View File

@ -335,11 +335,12 @@ class Translate
* Return translated value of key. Search in lang file, then into database. * Return translated value of key. Search in lang file, then into database.
* Key must be any complete entry into lang file: CurrencyEUR, ... * Key must be any complete entry into lang file: CurrencyEUR, ...
* If not found, return key. * If not found, return key.
* WARNING: To avoid infinite loop (getLabelFromKey->transnoentities->getTradFromKey), getLabelFromKey must * The string return is not formated (translated with transnoentitiesnoconv)
* not be called with same value than input. * NOTE: To avoid infinite loop (getLabelFromKey->transnoentities->getTradFromKey), if you modify this function,
* check that getLabelFromKey is not called with same value than input.
* *
* @param string $key Key to translate * @param string $key Key to translate
* @return string Translated string * @return string Translated string (translated with transnoentitiesnoconv)
*/ */
private function getTradFromKey($key) private function getTradFromKey($key)
{ {
@ -347,7 +348,6 @@ class Translate
if (! is_string($key)) return 'ErrorBadValueForParamNotAString'; // Avoid multiple errors with code not using function correctly. if (! is_string($key)) return 'ErrorBadValueForParamNotAString'; // Avoid multiple errors with code not using function correctly.
//print 'xx'.$key;
$newstr=$key; $newstr=$key;
if (preg_match('/^Currency([A-Z][A-Z][A-Z])$/i',$key,$reg)) if (preg_match('/^Currency([A-Z][A-Z][A-Z])$/i',$key,$reg))
{ {

View File

@ -165,7 +165,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
$info=$object->_load_ldap_info(); $info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info); $dn=$object->_load_ldap_dn($info);
$result=$ldap->delete($dn,$info,$user); $result=$ldap->delete($dn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
@ -322,7 +322,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
$info=$object->_load_ldap_info(); $info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info); $dn=$object->_load_ldap_dn($info);
$result=$ldap->delete($dn,$info,$user); $result=$ldap->delete($dn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
@ -399,7 +399,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
$info=$object->_load_ldap_info(); $info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info); $dn=$object->_load_ldap_dn($info);
$result=$ldap->delete($dn,$info,$user); $result=$ldap->delete($dn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
@ -576,7 +576,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
$info=$object->_load_ldap_info(); $info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info); $dn=$object->_load_ldap_dn($info);
$result=$ldap->delete($dn,$info,$user); $result=$ldap->delete($dn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;

View File

@ -52,14 +52,14 @@ if ($_GET["id"])
//on veut supprimer une cat<61>gorie //on veut supprimer une cat<61>gorie
if ($_REQUEST["cat"]) if ($_REQUEST["cat"])
{ {
$cat = new Categorie($db,$_REQUEST["cat"]); $cat = new Categorie($db);
$cat->del_product($product); $cat->del_product($product);
} }
//on veut ajouter une cat<61>gorie //on veut ajouter une cat<61>gorie
if (isset($_REQUEST["add_cat"]) && $_REQUEST["add_cat"]>=0) if (isset($_REQUEST["add_cat"]) && $_REQUEST["add_cat"]>=0)
{ {
$cat = new Categorie($db,$_REQUEST["add_cat"]); $cat = new Categorie($db);
$cat->add_product($product); $cat->add_product($product);
} }

View File

@ -149,7 +149,7 @@ if ($resql)
if (isset($catid)) if (isset($catid))
{ {
print "<div id='ways'>"; print "<div id='ways'>";
$c = new Categorie($db, $catid); $c = new Categorie($db);
$ways = $c->print_all_ways(' &gt; ','fourn/product/liste.php'); $ways = $c->print_all_ways(' &gt; ','fourn/product/liste.php');
print " &gt; ".$ways[0]."<br>\n"; print " &gt; ".$ways[0]."<br>\n";
print "</div><br>"; print "</div><br>";

View File

@ -1070,7 +1070,7 @@ else
// Liste des utiliseurs du groupes choisi dans la config // Liste des utiliseurs du groupes choisi dans la config
$idGroupValid = $cp->getConfCP('userGroup'); $idGroupValid = $cp->getConfCP('userGroup');
$validator = new UserGroup($db,$idGroupValid); $validator = new UserGroup($db);
$valideur = $validator->listUsersForGroup('',1); $valideur = $validator->listUsersForGroup('',1);
print '<td>'; print '<td>';

View File

@ -1412,7 +1412,7 @@ function migrate_price_propal($db,$langs,$conf)
dolibarr_install_syslog("upgrade2: Line $rowid: propalid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); dolibarr_install_syslog("upgrade2: Line $rowid: propalid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc");
print ". "; print ". ";
$propalligne->update_total($rowid); $propalligne->update_total();
/* On touche pas a propal mere /* On touche pas a propal mere
@ -1521,7 +1521,7 @@ function migrate_price_contrat($db,$langs,$conf)
dolibarr_install_syslog("upgrade2: Line $rowid: contratdetid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent -> $total_ht, $total_tva, $total_ttc"); dolibarr_install_syslog("upgrade2: Line $rowid: contratdetid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent -> $total_ht, $total_tva, $total_ttc");
print ". "; print ". ";
$contratligne->update_total($rowid); $contratligne->update_total();
$i++; $i++;
} }
@ -1606,7 +1606,7 @@ function migrate_price_commande($db,$langs,$conf)
dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc");
print ". "; print ". ";
$commandeligne->update_total($rowid); $commandeligne->update_total();
/* On touche pas a facture mere /* On touche pas a facture mere
$commande = new Commande($db); $commande = new Commande($db);
@ -1720,7 +1720,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf)
dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc");
print ". "; print ". ";
$commandeligne->update_total($rowid); $commandeligne->update_total();
/* On touche pas a facture mere /* On touche pas a facture mere
$commande = new Commande($db); $commande = new Commande($db);

View File

@ -411,7 +411,7 @@ if (! defined('NOLOGIN'))
// Call of triggers // Call of triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,GETPOST('entity','int')); $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf);
if ($result < 0) { if ($result < 0) {
$error++; $error++;
} }
@ -514,10 +514,11 @@ if (! defined('NOLOGIN'))
$_SESSION["dol_loginmesg"]=$user->error; $_SESSION["dol_loginmesg"]=$user->error;
} }
// TODO We should use a hook here, not a trigger.
// Call triggers // Call triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,$_POST["entity"]); $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf);
if ($result < 0) { if ($result < 0) {
$error++; $error++;
} }
@ -556,10 +557,11 @@ if (! defined('NOLOGIN'))
$_SESSION["dol_loginmesg"]=$user->error; $_SESSION["dol_loginmesg"]=$user->error;
} }
// TODO We should use a hook here, not a trigger.
// Call triggers // Call triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,(isset($_POST["entity"])?$_POST["entity"]:0)); $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf);
if ($result < 0) { if ($result < 0) {
$error++; $error++;
} }
@ -572,10 +574,11 @@ if (! defined('NOLOGIN'))
{ {
if (! empty($conf->global->MAIN_ACTIVATE_UPDATESESSIONTRIGGER)) // We do not execute such trigger at each page load by default (triggers are time consuming) if (! empty($conf->global->MAIN_ACTIVATE_UPDATESESSIONTRIGGER)) // We do not execute such trigger at each page load by default (triggers are time consuming)
{ {
// TODO We should use a hook here, not a trigger.
// Call triggers // Call triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers('USER_UPDATE_SESSION',$user,$user,$langs,$conf,$conf->entity); $result=$interface->run_triggers('USER_UPDATE_SESSION',$user,$user,$langs,$conf);
if ($result < 0) { if ($result < 0) {
$error++; $error++;
} }
@ -588,7 +591,7 @@ if (! defined('NOLOGIN'))
// If we are here, this means authentication was successfull. // If we are here, this means authentication was successfull.
if (! isset($_SESSION["dol_login"])) if (! isset($_SESSION["dol_login"]))
{ {
// New session for this login. // New session for this login has started.
$error=0; $error=0;
// Store value into session (values always stored) // Store value into session (values always stored)
@ -617,10 +620,11 @@ if (! defined('NOLOGIN'))
$user->update_last_login_date(); $user->update_last_login_date();
// TODO We should use a hook here, not a trigger
// Call triggers // Call triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers('USER_LOGIN',$user,$user,$langs,$conf,GETPOST('entity','int')); $result=$interface->run_triggers('USER_LOGIN',$user,$user,$langs,$conf);
if ($result < 0) { if ($result < 0) {
$error++; $error++;
} }

View File

@ -80,7 +80,7 @@ print '<table class="border" width="100%">';
$client = false; $client = false;
if ($socid > 0) { if ($socid > 0) {
$soc = new Societe($db, $socid); $soc = new Societe($db);
$soc->fetch($socid); $soc->fetch($socid);
if ($soc->client) if ($soc->client)

View File

@ -62,7 +62,7 @@ llxHeader('',$langs->trans("ThirdParty").' - '.$langs->trans("Margins"),$help_ur
if ($socid > 0) if ($socid > 0)
{ {
$societe = new Societe($db, $socid); $societe = new Societe($db);
$societe->fetch($socid); $societe->fetch($socid);
/* /*

View File

@ -42,7 +42,7 @@ if (!empty($_SESSION["dol_authmode"]) && ($_SESSION["dol_authmode"] == 'forceuse
// Appel des triggers // Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers('USER_LOGOUT',$user,$user,$langs,$conf,$conf->entity); $result=$interface->run_triggers('USER_LOGOUT',$user,$user,$langs,$conf);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
// Fin appel triggers // Fin appel triggers