From 437d0823080b599b48ed28b4e7bfe15ac9e4e289 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 24 Nov 2012 00:06:54 +0100 Subject: [PATCH 1/3] Fix : multicompany comptability --- htdocs/core/lib/company.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index a5fe3c5d1f2..8ddf40e2abf 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -777,7 +777,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; $sql.= " WHERE u.rowid = a.fk_user_author"; - $sql.= " AND a.entity IN (".getEntity('actioncomm').")"; + $sql.= " AND a.entity IN (".getEntity('agenda', 1).")"; if (get_class($object) == 'Adherent') { $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; if (! empty($object->id)) @@ -916,7 +916,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; $sql.= " WHERE u.rowid = a.fk_user_author"; - $sql.= " AND a.entity IN (".getEntity('actioncomm').")"; + $sql.= " AND a.entity IN (".getEntity('agenda', 1).")"; if (get_class($object) == 'Adherent') $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; if (get_class($object) == 'Adherent' && $object->id) $sql.= " AND a.fk_element = ".$object->id; if (get_class($object) == 'Societe' && $object->id) $sql.= " AND a.fk_soc = ".$object->id; From 925e59e24646aeff87ed81fab5b317609f5276a4 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 28 Nov 2012 11:04:54 +0100 Subject: [PATCH 2/3] Fix : default country on contact creation was not set properly --- htdocs/contact/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 3027eb22026..cb5dc583c97 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -462,7 +462,7 @@ else // Country if (dol_strlen(trim($object->fk_pays)) == 0) $object->fk_pays = $objsoc->country_id; // Predefined with third party print ''.$langs->trans("Country").''; - print $form->select_country((isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id),'country_id'); + print $form->select_country((isset($_POST["country_id"])?$_POST["country_id"]:$object->fk_pays),'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print ''; From a9941480f1493677f5cf107761fcbbea1791c79f Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 28 Nov 2012 15:34:42 +0100 Subject: [PATCH 3/3] Fix : contact default country --- htdocs/contact/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index bfc1e721e3e..2e28c7e2a5c 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -461,7 +461,7 @@ else // Country print ''.$langs->trans("Country").''; - print $form->select_country((isset($_POST["country_id"])?$_POST["country_id"]:$object->fk_pays),'country_id'); + print $form->select_country((isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id),'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print '';