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),
@ -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

@ -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)

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

@ -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"]));

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