diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 2247df9493e..6094bb7e4f1 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -55,7 +55,7 @@ if ($action == "set") if (! $res > 0) $error++; $id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT','int'); - $account = new Account($db, $id); + $account = new Account($db); if($account->fetch($id)>0) { diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index fc9d0489e9a..85139b56ba9 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -50,7 +50,7 @@ print "
\n"; $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/'; $interfaces = new Interfaces($db); -$triggers = $interfaces->getTriggersList(0,'priority'); +$triggers = $interfaces->getTriggersList(); print ' diff --git a/htdocs/categories/admin/categorie_extrafields.php b/htdocs/categories/admin/categorie_extrafields.php index 2da54e77712..712f60f25cd 100644 --- a/htdocs/categories/admin/categorie_extrafields.php +++ b/htdocs/categories/admin/categorie_extrafields.php @@ -65,7 +65,7 @@ llxHeader('',$langs->trans("Categories"),$help_url); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("CategoriesSetup"),$linkback,'setup'); -$head = categoriesadmin_prepare_head(null); +$head = categoriesadmin_prepare_head(); dol_fiche_head($head, 'attributes_categories', $langs->trans("Categories"), 0, 'category'); diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 7f8ceac853e..e68d2e416f8 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -396,7 +396,7 @@ else if ($id || $ref) llxHeader("","",$langs->trans("Member")); - $head=member_prepare_head($member, $user); + $head=member_prepare_head($member); $titre=$langs->trans("Member"); $picto='user'; dol_fiche_head($head, 'category', $titre,0,$picto); @@ -471,7 +471,7 @@ else if ($id || $ref) llxHeader("","",$langs->trans("Contact")); - $head=contact_prepare_head($object, $user); + $head=contact_prepare_head($object); $titre=$langs->trans("ContactsAddresses"); $picto='contact'; dol_fiche_head($head, 'category', $titre,0,$picto); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 393082f3427..434cc92dcb6 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -258,9 +258,10 @@ class ActionComm extends CommonObject * Load object from database * * @param int $id Id of action to get + * @param string $ref Ref of action to get * @return int <0 if KO, >0 if OK */ - function fetch($id) + function fetch($id, $ref='') { global $langs; @@ -286,7 +287,9 @@ class ActionComm extends CommonObject $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc"; - $sql.= " WHERE a.id=".$id." AND a.fk_action=c.id"; + $sql.= " WHERE a.fk_action=c.id"; + if ($ref) $sql.= " AND a.id=".$ref; // No field ref, we use id + else $sql.= " AND a.id=".$id; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 76176930da3..524901336a7 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -327,11 +327,11 @@ if ($id > 0) print '"; print ''; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 4ca6175d785..40bfbe6490d 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -338,9 +338,10 @@ class Account extends CommonObject /** * Create bank account into database * + * @param User $user Object user making creation * @return int < 0 if KO, > 0 if OK */ - function create() + function create($user='') { global $langs,$conf; @@ -665,10 +666,9 @@ class Account extends CommonObject return 1; } else - { + { return 0; } - $this->db->free($result); } else { diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index c118186df27..770f2afd2ef 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -102,7 +102,7 @@ if ($_POST["action"] == 'add') if (! $error) { - $id = $account->create($user->id); + $id = $account->create($user); if ($id > 0) { $_GET["id"]=$id; // Force chargement page en mode visu @@ -306,7 +306,7 @@ if ($action == 'create') $doleditor=new DolEditor('account_comment',$account->comment,'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70); $doleditor->Create(); print ''; - + print '
'; if ($action == 'editconditions') { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->cond_reglement_id,'cond_reglement_id',-1,1); + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id',1); } else { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->cond_reglement_id,'none'); + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'none'); } print "
'; print '
'; @@ -510,7 +510,7 @@ else $account->fetch(GETPOST('id','int')); print_fiche_titre($langs->trans("EditFinancialAccount")); - + if ($conf->use_javascript_ajax) { print "\n".'