From 8249179fb8ecb8899e6520c7d8cf3e33a4ebcd5c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Jul 2018 13:48:08 +0200 Subject: [PATCH 1/2] Fix duplicate tab "contact" on thirdparty --- htdocs/core/lib/company.lib.php | 58 ++++++++++++++++--------------- htdocs/core/lib/functions.lib.php | 1 + 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 2999833e81e..b5e036a708c 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -50,26 +50,38 @@ function societe_prepare_head(Societe $object) $head[$h][2] = 'card'; $h++; - if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) - { - //$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); - $nbContact = 0; // TODO - - $sql = "SELECT COUNT(p.rowid) as nb"; - $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; - $sql .= " WHERE p.fk_soc = ".$object->id; - $resql = $db->query($sql); - if ($resql) + if (empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) + { + if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { - $obj = $db->fetch_object($resql); - if ($obj) $nbContact = $obj->nb; - } + //$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); + $nbContact = 0; // TODO - $head[$h][0] = DOL_URL_ROOT.'/societe/contact.php?socid='.$object->id; - $head[$h][1] = $langs->trans('ContactsAddresses'); - if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; - $head[$h][2] = 'contact'; - $h++; + $sql = "SELECT COUNT(p.rowid) as nb"; + $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; + $sql .= " WHERE p.fk_soc = ".$object->id; + $resql = $db->query($sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + if ($obj) $nbContact = $obj->nb; + } + + $head[$h][0] = DOL_URL_ROOT.'/societe/contact.php?socid='.$object->id; + $head[$h][1] = $langs->trans('ContactsAddresses'); + if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + $head[$h][2] = 'contact'; + $h++; + } + } + else + { + $head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id; + $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); + $head[$h][1] = $langs->trans("ContactsAddresses"); + if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + $head[$h][2] = 'contact'; + $h++; } if ($object->client==1 || $object->client==2 || $object->client==3) @@ -100,16 +112,6 @@ function societe_prepare_head(Societe $object) $h++; } - if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) - { - $head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id; - $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); - $head[$h][1] = $langs->trans("ContactsAddresses"); - if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; - $head[$h][2] = 'contact'; - $h++; - } - if (! empty($conf->projet->enabled) && (!empty($user->rights->projet->lire) )) { $head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 714f155120d..0aab07bb398 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6940,6 +6940,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode= foreach($head as $key => $val) { $condition = (! empty($values[3]) ? verifCond($values[3]) : 1); + //var_dump($key.' - '.$tabname.' - '.$head[$key][2].' - '.$condition); if ($head[$key][2]==$tabname && $condition) { unset($head[$key]); From cbc4a04465abaa00eb4c627a431ab022622a8a71 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Jul 2018 18:05:49 +0200 Subject: [PATCH 2/2] Fix nowrap on smartphone --- htdocs/theme/eldy/style.css.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 49a980298ae..21ca0e5e586 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -700,10 +700,17 @@ div.divsearchfield { .divsearchfieldfilter { text-overflow: clip; overflow: auto; - white-space: nowrap; padding-bottom: 5px; opacity: 0.6; } +browser->layout == 'phone') { +?> +.divsearchfieldfilter { + white-space: nowrap; +} + div.confirmmessage { padding-top: 6px; }