From a1ae920b4acaa581b0eec5a04ff07118c27cb70c Mon Sep 17 00:00:00 2001 From: Drosis Nikos Date: Mon, 5 Oct 2015 17:46:02 +0300 Subject: [PATCH 01/17] For devices not supporting unicode characters --- htdocs/asterisk/cidlookup.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/asterisk/cidlookup.php b/htdocs/asterisk/cidlookup.php index ef4eaefe9c2..771b2e29979 100644 --- a/htdocs/asterisk/cidlookup.php +++ b/htdocs/asterisk/cidlookup.php @@ -30,7 +30,7 @@ include '../master.inc.php'; $phone = GETPOST('phone'); -$notfound = $langs->trans("Unknown"); +$notfound = $phone; // Security check if (empty($conf->clicktodial->enabled)) @@ -73,5 +73,9 @@ else dol_print_error($db,'Error'); $found = 'Error'; } +//Greek to Latin +$greek = array('α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο','π','ρ','ς','σ','τ','υ','φ','χ','ψ','ω','Α','Β','Γ','Δ','Ε','Ζ','Η','Θ','Ι','Κ','Λ','Μ','Ν','Ξ','Ο','Π','Ρ','Σ','Τ','Υ','Φ','Χ','Ψ','Ω','ά','έ','ή','ί','ό','ύ','ώ','ϊ','ΐ','Ά','Έ','Ή','Ί','Ό','Ύ','Ώ','Ϊ'); -echo $found; +$latin = array('a','b','g','d','e','z','h','th','i','k','l','m','n','ks','o','p','r','s','s','t','u','f','ch','ps','w','A','B','G','D','E','Z','H','TH','I','K','L','M','N','KS','O','P','R','S','T','U','F','CH','PS','W','a','e','h','i','o','u','w','i','i','A','E','H','I','O','U','W','I'); + +print str_replace($greek, $latin, $found); From 0222867a9479450391c69fab9d1e652e4c02fe00 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Oct 2015 12:01:09 +0200 Subject: [PATCH 02/17] The new banner for tab is moved into a shared functions --- htdocs/core/lib/functions.lib.php | 44 +++++++++++++++++++++++++++++++ htdocs/societe/soc.php | 26 +++--------------- htdocs/theme/eldy/style.css.php | 11 ++++---- htdocs/theme/md/style.css.php | 15 +++++------ 4 files changed, 59 insertions(+), 37 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7f4a1b8d855..a319b193662 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -840,6 +840,50 @@ function dol_get_fiche_end($notab=0) else return ''; } +/** + * Show tab footer of a card + * + * @param object $object Object to show + * @param string $paramid Name of parameter to use to name the id into the URL link + * @param string $morehtml More html content to output just before the nav bar + * @param int $shownav Show Condition (navigation is shown if value is 1) + * @param string $fieldid Nom du champ en base a utiliser pour select next et previous (we make the select max and min on this field) + * @param string $fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous + * @param string $morehtmlref More html to show after ref + * @param string $moreparam More param to add in nav link url. + * @param int $nodbprefix Do not include DB prefix to forge table name + * @param string $morehtmlleft More html code to show before ref + * @param string $morehtmlright More html code to show before navigation arrows + * @return void + */ +function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlright='') +{ + global $conf, $form, $user; + + //$showlogo=$object->logo; + $showlogo=1; + $showbarcode=empty($conf->barcode->enabled)?0:1; + if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0; + + print '
'; + //$morehtmlleft='
'.img_picto('', 'title_companies', '', '').'
'; + if ($showlogo) $morehtmlleft.='
'.$form->showphoto('societe',$object,0,0,0,'photoref').'
'; + //if ($showlogo) $morehtmlleft.='
'.$form->showphoto('societe',$object,0,0,0,'photoref').'
'; + if ($showbarcode) $morehtmlleft.='
'.$form->showbarcode($object).'
'; + if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { + $morehtmlright.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); + } else { + $morehtmlright.=$object->getLibStatut(2); + } + if (! empty($object->name_nalias)) $morehtmlref.='
'.$object->name_alias.'
'; + $morehtmlref.='
'; + $morehtmlref.=$object->getBannerAddress('refaddress',$object); + $morehtmlref.='
'; + print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlright); + print '
'; + print '
'; +} + /** * Show a string with the label tag dedicated to the HTML edit field. * diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index aad1a8aae48..04fe5336d7e 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1863,29 +1863,9 @@ else dol_htmloutput_errors($error,$errors); - //$showlogo=$object->logo; - $showlogo=1; - $showbarcode=empty($conf->barcode->enabled)?0:1; - if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0; - - print '
'; - //$morehtmlleft='
'.img_picto('', 'title_companies', '', '').'
'; - if ($showlogo) $morehtmlleft.='
'.$form->showphoto('societe',$object,0,0,0,'photoref').'
'; - //if ($showlogo) $morehtmlleft.='
'.$form->showphoto('societe',$object,0,0,0,'photoref').'
'; - if ($showbarcode) $morehtmlleft.='
'.$form->showbarcode($object).'
'; - if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - $morehtmlright.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); - } else { - $morehtmlright.=$object->getLibStatut(2); - } - $morehtml=''; - if (! empty($object->ame_nalias)) $morehtml.='
'.$object->name_alias.'
'; - $morehtml.='
'; - $morehtml.=$object->getBannerAddress('refaddress',$object); - $morehtml.='
'; - print $form->showrefnav($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom', $morehtml, '', 0, $morehtmlleft, $morehtmlright); - print '
'; - print '
'; + + dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 98713d0a77a..b1906a344b1 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1528,10 +1528,10 @@ div.tabsElem { div.tabBar { color: #; - padding-top: px; - padding-left: px; - padding-right: px; - padding-bottom: px; + padding-top: px; + padding-left: px; + padding-right: px; + padding-bottom: px; margin: 0px 0px 14px 0px; -moz-border-radius:4px; -webkit-border-radius: 4px; @@ -2064,10 +2064,9 @@ table.listwithfilterbefore { /* Pagination */ div.refidpadding { - /* padding-top: dol_use_jmobile)?'8':'12'; ?>px; */ + padding-top: dol_use_jmobile)?'3':'14'; ?>px; } div.refid { - /* padding-top: dol_use_jmobile)?'5':'12'; ?>px; */ font-weight: bold; color: #766; font-size: 160%; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 9fb050b0ef7..f909915d794 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -677,8 +677,8 @@ div.statusref { margin-bottom: 10px; } img.photoref { - height: 68px; - width: 68px; + height: 80px; + width: 80px; border: 1px solid #CCC; -moz-box-shadow: 3px 3px 4px #DDD; -webkit-box-shadow: 3px 3px 4px #DDD; @@ -1513,10 +1513,10 @@ div.tabsElem { margin-top: 8px; } /* To avoid overlap of tabs when not browser div.tabBar { color: #; - padding-top: 9px; - padding-left: px; - padding-right: px; - padding-bottom: 8px; + padding-top: px; + padding-left: px; + padding-right: px; + padding-bottom: px; margin: 0px 0px 14px 0px; -moz-border-radius:3px; -webkit-border-radius: 3px; @@ -1934,10 +1934,9 @@ table.listwithfilterbefore { /* Pagination */ div.refidpadding { - /* padding-top: dol_use_jmobile)?'8':'12'; ?>px; */ + padding-top: dol_use_jmobile)?'3':'14'; ?>px; } div.refid { - /* padding-top: dol_use_jmobile)?'5':'12'; ?>px; */ font-weight: bold; color: #766; font-size: 160%; From 7065b2aa7deddb70211eda71e233b42dda62d249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 10 Oct 2015 12:59:58 +0200 Subject: [PATCH 03/17] Update account.php --- htdocs/compta/bank/account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index deed3b1b97a..9a04a431ac6 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -952,7 +952,7 @@ if ($id > 0 || ! empty($ref)) if ($sep > 0) print ' '; // If we had at least one line in future else print $langs->trans("CurrentBalance"); print ' '.$object->currency_code.''; - print ''; + print ''; print ''; print ''; } else { From 0032ad695c8d7fb435f4f4f9bb9c632996798238 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Oct 2015 13:12:14 +0200 Subject: [PATCH 04/17] New look for thirdparty tab using the new common banner. End. Let's do the same for other tabs and elements now... --- htdocs/societe/soc.php | 17 ++++++++++++++++- htdocs/theme/eldy/style.css.php | 3 +++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 04fe5336d7e..9c8f4c90aa5 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1867,7 +1867,11 @@ else dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); - print '
'.price($solde, 0, $langs, 0, 0, -1, $object->currency_code).''.price($total, 0, $langs, 0, 0, -1, $object->currency_code).' 
'; + print '
'; + print '
'; + + print '
'; + print '
'; // Ref /* @@ -2202,6 +2206,14 @@ else else print ' '; print ''; + print '
'; + + print ''; + print '
'; + + print '
'; + print ''; + // Default language if (! empty($conf->global->MAIN_MULTILANGS)) { @@ -2338,6 +2350,9 @@ else print '
'; + print '
'; + print '
'; + dol_fiche_end(); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b1906a344b1..ed6c1291ef5 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -637,9 +637,12 @@ img.photoref { object-fit: contain } .underrefbanner { +} +.underbanner { border-bottom: 2px solid #888; } + /* ============================================================================== */ /* Menu top et 1ere ligne tableau */ /* ============================================================================== */ From b6b410a99c32082b95b1b0bda013a0698ef0a970 Mon Sep 17 00:00:00 2001 From: Drosis Nikos Date: Sat, 10 Oct 2015 16:01:39 +0300 Subject: [PATCH 05/17] Update cidlookup.php --- htdocs/asterisk/cidlookup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asterisk/cidlookup.php b/htdocs/asterisk/cidlookup.php index 771b2e29979..e50a1a74a1b 100644 --- a/htdocs/asterisk/cidlookup.php +++ b/htdocs/asterisk/cidlookup.php @@ -30,7 +30,7 @@ include '../master.inc.php'; $phone = GETPOST('phone'); -$notfound = $phone; +$notfound = $langs->trans("Unknown"); // Security check if (empty($conf->clicktodial->enabled)) From fb50daaa40962bebd96f289b91471ef6c4dc784d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Oct 2015 16:09:01 +0200 Subject: [PATCH 06/17] Fix bad parameter --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index d7fbaedfeba..565078a9d3b 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -706,7 +706,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $contactstatic->web = $obj->web; $contactstatic->skype = $obj->skype; - $country_code = getCountry($obj->country_id, 'all'); + $country_code = getCountry($obj->country_id, 2); $contactstatic->country_code = $country_code; print ""; From 525f9841faf80f5ff915bbc23c3de24286511a26 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Oct 2015 18:38:22 +0200 Subject: [PATCH 07/17] Fix doxygen --- htdocs/core/class/commonobject.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 76fd73a324d..a4bacf4d34c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -437,10 +437,11 @@ abstract class CommonObject /** * Return full address of contact * - * @param Societe $object Object Societe or null + * @param string $htmlkey HTML id to make banner content unique + * @param Object $object Object (thirdparty, thirdparty of contact for contact, null for a member) * @return string Full address string */ - function getBannerAddress($htmlkey, $object=null) + function getBannerAddress($htmlkey, $object) { global $conf, $langs; @@ -465,7 +466,7 @@ abstract class CommonObject $outdone++; } - if (! in_array($object->country_code,$countriesusingstate) && empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS) + if (! in_array($this->country_code,$countriesusingstate) && empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS) && ! empty($conf->global->SOCIETE_DISABLE_STATE) && $this->state) { $out.=($outdone?'
':'').$this->state; From 6ec77e2ca096bf9e540f338eab8ed18c62e99031 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Oct 2015 12:27:04 +0200 Subject: [PATCH 08/17] New banner card on contact card. --- htdocs/contact/card.php | 108 ++++++++++++++--------- htdocs/core/class/commonobject.class.php | 37 +++++--- htdocs/core/class/html.form.class.php | 11 ++- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 38 +++++--- htdocs/langs/en_US/main.lang | 1 + htdocs/societe/soc.php | 19 ++-- htdocs/theme/eldy/style.css.php | 8 +- htdocs/theme/md/style.css.php | 2 +- 9 files changed, 152 insertions(+), 74 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 2db5523c5bd..35ad3b8c3a1 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -4,10 +4,10 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -773,11 +773,14 @@ else print ''; - // Ref - print ''; - + // Ref/ID + if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) + { + print ''; + } + // Lastname print ''; print ''; @@ -1040,23 +1043,34 @@ else } - print '
'.$langs->trans("Ref").''; - print $object->ref; - print '
'.$langs->trans("ID").''; + print $object->ref; + print '
lastname).'" autofocus="autofocus">
'; - $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref=$object->getFullName($langs); + + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); + + + print '
'; + print '
'; + + print '
'; + print '
'; + // Ref - print ''; // Name print ''; print ''; - + */ + // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - print ''; } - + */ + print ''; // Civility - print ''; // Role - print ''; + print ''; // Address + /* print ''; @@ -1112,68 +1129,72 @@ else // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; - } + print ''; + }*/ // Phone + /* print ''; print ''; print ''; print ''; - + */ + // Email - print ''; + //print ''; if (! empty($conf->mailing->enabled)) { $langs->load("mails"); - print ''; - print ''; + print ''; + print ''; } - else - { - print ''; - } - print ''; // Instant message and no email - print ''; + print ''; if (!empty($conf->mailing->enabled)) { - print ''; + print ''; } - else - { - print ''; - } - print ''; // Skype if (! empty($conf->skype->enabled)) { - print ''; + print ''; } - print ''; // Note Public - print ''; // Note Private - print ''; + print ''; + */ + + print '
'.$langs->trans("Ref").''; + /*print '
'.$langs->trans("Ref").''; print $form->showrefnav($object, 'id', $linkback); print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''.$langs->trans("Firstname").''.$object->firstname.'
'.$langs->trans("ThirdParty").''; + print '
'.$langs->trans("ThirdParty").''; if ($object->socid > 0) { $objsoc->fetch($object->socid); @@ -1070,6 +1084,7 @@ else } // Photo + /* if ($object->photo) { print ''; @@ -1080,18 +1095,20 @@ else print ' '; print '
'.$langs->trans("UserTitle").''; + print '
'.$langs->trans("UserTitle").''; print $object->getCivilityLabel(); print '
'.$langs->trans("PostOrFunction").''.$object->poste.'
'.$langs->trans("PostOrFunction").''.$object->poste.'
'.$langs->trans("Address").''; dol_print_address($object->address,'gmap','contact',$object->id); print '
'.$langs->trans('State').''.$object->state.'
'.$langs->trans('State').''.$object->state.'
'.$langs->trans("PhonePro").''.dol_print_phone($object->phone_pro,$object->country_code,$object->id,$object->socid,'AC_TEL').''.$langs->trans("PhonePerso").''.dol_print_phone($object->phone_perso,$object->country_code,$object->id,$object->socid,'AC_TEL').'
'.$langs->trans("PhoneMobile").''.dol_print_phone($object->phone_mobile,$object->country_code,$object->id,$object->socid,'AC_TEL').''.$langs->trans("Fax").''.dol_print_phone($object->fax,$object->country_code,$object->id,$object->socid,'AC_FAX').'
'.$langs->trans("EMail").''.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').'
'.$langs->trans("EMail").''.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').'
'.$langs->trans("NbOfEMailingsSend").''.$object->getNbOfEMailings().'
'.$langs->trans("NbOfEMailingsSend").''.$object->getNbOfEMailings().'
 
'.$langs->trans("IM").''.$object->jabberid.'
'.$langs->trans("IM").''.$object->jabberid.'
'.$langs->trans("No_Email").''.yn($object->no_email).'
'.$langs->trans("No_Email").''.yn($object->no_email).'
 
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).'
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).'
'.$langs->trans("ContactVisibility").''; + print '
'.$langs->trans("ContactVisibility").''; print $object->LibPubPriv($object->priv); print '
'.$langs->trans("NotePublic").''; + /* + print '
'.$langs->trans("NotePublic").''; print nl2br($object->note_public); print '
'.$langs->trans("NotePrivate").''; + print '
'.$langs->trans("NotePrivate").''; print nl2br($object->note_private); - - // Statut - print '
'.$langs->trans("Status").'
'; + + print ''; + print '
'; + + print '
'; + print ''; + + // Statut + /*print ''; print ''; print ''."\n"; - + */ + // Categories if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { print ''; @@ -1240,7 +1261,10 @@ else print ''; print "
'.$langs->trans("Status").''; print $object->getLibStatut(4); print '
' . $langs->trans( "Categories" ) . '
"; - + + print '
'; + print '
'; + print dol_fiche_end(); // Barre d'actions diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 76fd73a324d..7ca7627333d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -446,9 +446,19 @@ abstract class CommonObject $countriesusingstate=array('AU','US','IN','GB','ES','UK','TR'); - $out=''; + $contacti=0; + $thirdpartyid=0; + if ($this->elemet == 'societe') + { + $thirdpartyid=$this->id; + } + if ($this->elemet == 'contact') + { + $contactid=$this->id; + $thirdpartyid=$object->id; + } - $out.=''; + $out=''; $outdone=0; $coords = $this->getFullAddress(1,', '); @@ -471,19 +481,22 @@ abstract class CommonObject $out.=($outdone?'
':'').$this->state; $outdone++; } - + if ($this->phone_pro || $this->phone_mobile || $this->phone_perso || $this->fax) $out.=($outdone?'
':''); - if ($this->phone_pro) { - $out.=dol_print_phone($this->phone_pro,$country_code['code'],$this->rowid,$object->id,'AC_TEL',' ','phone'); $outdone++; + if ($this->phone && empty($this->phone_pro)) { // For object storing pro phone into ->phone + $out.=dol_print_phone($this->phone,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePro")); $outdone++; } - if ($this->phone_mobile) { - $out.=dol_print_phone($this->phone_mobile,$country_code['code'],$this->rowid,$object->id,'AC_TEL',' ','phone'); $outdone++; + if (! empty($this->phone_pro)) { + $out.=dol_print_phone($this->phone_pro,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePro")); $outdone++; } - if ($this->phone_perso) { - $out.=dol_print_phone($this->phone_perso,$country_code['code'],$this->rowid,$object->id,'AC_TEL',' ','phone'); $outdone++; + if (! empty($this->phone_mobile)) { + $out.=dol_print_phone($this->phone_mobile,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhoneMobile")); $outdone++; } - if ($this->fax) { - $out.=dol_print_phone($this->fax,$country_code['code'],$this->rowid,$object->id,'AC_FAX',' ','fax'); $outdone++; + if (! empty($this->phone_perso)) { + $out.=dol_print_phone($this->phone_perso,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePerso")); $outdone++; + } + if (! empty($this->fax)) { + $out.=dol_print_phone($this->fax,$country_code['code'],$contactid,$thirdpartyid,'AC_FAX',' ','fax',$langs->trans("Fax")); $outdone++; } $out.='
'; @@ -503,7 +516,7 @@ abstract class CommonObject if ($this->skype) $out.=($outdone?'
':'').dol_print_skype($this->skype,$this->id,$object->id,'AC_SKYPE'); } - $out.=''; + $out.=''; return $out; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4aea23291c2..8dd0725b1b8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5152,7 +5152,16 @@ class Form $ret.='
'; - $ret.=dol_htmlentities($object->$fieldref); + // For thirdparty and contact, the ref is he id, so we show something else + if ($object->element == 'societe') + { + $ret.=dol_htmlentities($object->name); + } + else if ($object->element == 'contact') + { + $ret.=dol_htmlentities($object->getFullName($langs)); + } + else $ret.=dol_htmlentities($object->$fieldref); if ($morehtmlref) { $ret.=' '.$morehtmlref; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index d7fbaedfeba..565078a9d3b 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -706,7 +706,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $contactstatic->web = $obj->web; $contactstatic->skype = $obj->skype; - $country_code = getCountry($obj->country_id, 'all'); + $country_code = getCountry($obj->country_id, 2); $contactstatic->country_code = $country_code; print ""; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a319b193662..627a9aaffca 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -858,27 +858,40 @@ function dol_get_fiche_end($notab=0) */ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlright='') { - global $conf, $form, $user; + global $conf, $form, $user, $langs; //$showlogo=$object->logo; $showlogo=1; $showbarcode=empty($conf->barcode->enabled)?0:1; if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0; - + $modulepart='societe'; + if ($object->element == 'contact') $modulepart='contact'; + if ($object->element == 'member') $modulepart='memberphoto'; + if ($object->element == 'user') $modulepart='userphoto'; + print '
'; //$morehtmlleft='
'.img_picto('', 'title_companies', '', '').'
'; - if ($showlogo) $morehtmlleft.='
'.$form->showphoto('societe',$object,0,0,0,'photoref').'
'; + if ($showlogo) $morehtmlleft.='
'.$form->showphoto($modulepart,$object,0,0,0,'photoref').'
'; //if ($showlogo) $morehtmlleft.='
'.$form->showphoto('societe',$object,0,0,0,'photoref').'
'; if ($showbarcode) $morehtmlleft.='
'.$form->showbarcode($object).'
'; - if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - $morehtmlright.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); - } else { - $morehtmlright.=$object->getLibStatut(2); + if ($object->element == 'societe') + { + if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { + $morehtmlright.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); + } else { + $morehtmlright.=$object->getLibStatut(2); + } } if (! empty($object->name_nalias)) $morehtmlref.='
'.$object->name_alias.'
'; $morehtmlref.='
'; $morehtmlref.=$object->getBannerAddress('refaddress',$object); $morehtmlref.='
'; + if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && in_array($object->element, array('societe', 'contact', 'member'))) + { + $morehtmlref.='
'; + $morehtmlref.=$langs->trans("TechnicalID").': '.$object->id; + $morehtmlref.='
'; + } print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlright); print '
'; print '
'; @@ -1484,12 +1497,13 @@ function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64) * @param string $country Country code to use for formatting * @param int $cid Id of contact if known * @param int $socid Id of third party if known - * @param string $addlink ''=no link to create action, 'AC_TEL'=add link to clicktodial (if module enabled) and add link to create event (if conf->global->AGENDA_ADDACTIONFORPHONE set) + * @param string $addlink ''=no link to create action, 'AC_TEL'=add link to clicktodial (if module enabled) and add link to create event (if conf->global->AGENDA_ADDACTIONFORPHONE set) * @param string $separ Separation between numbers for a better visibility example : xx.xx.xx.xx.xx * @param string $withpicto Show picto + * @param string $titlealt Text to show on alt * @return string Formated phone number */ -function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ=" ",$withpicto='') +function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ=" ",$withpicto='',$titlealt='') { global $conf,$user,$langs,$mysoc; @@ -1569,7 +1583,11 @@ function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ=" } } - return '
'.($withpicto?img_picto(($withpicto=='fax'?$langs->trans("Fax"):$langs->trans("Phone")), 'object_'.($withpicto=='fax'?'phoning_fax':'phoning').'.png').' ':'').$newphone.'
'; + if (empty($titlealt)) + { + $titlealt=($withpicto=='fax'?$langs->trans("Fax"):$langs->trans("Phone")); + } + return '
'.($withpicto?img_picto($titlealt, 'object_'.($withpicto=='fax'?'phoning_fax':'phoning').'.png').' ':'').$newphone.'
'; } /** diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 0bd4fa7431b..ce3f8edc0d8 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -97,6 +97,7 @@ DolibarrHasDetectedError=Dolibarr has detected a technical error InformationToHelpDiagnose=This is information that can help diagnostic MoreInformation=More information TechnicalInformation=Technical information +TechnicalID=Technical ID NotePublic=Note (public) NotePrivate=Note (private) PrecisionUnitIsLimitedToXDecimals=Dolibarr was setup to limit precision of unit prices to %s decimals. diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 9c8f4c90aa5..a603f52e226 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1447,6 +1447,14 @@ else print ''; + // Ref/ID + if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) + { + print ''; + } + // Name print ''; print ''; @@ -2140,7 +2148,7 @@ else } elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") { - print ''; if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1))) @@ -2162,7 +2170,7 @@ else } elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") { - print ''; if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2))) @@ -2325,7 +2333,7 @@ else if (! empty($conf->adherent->enabled)) { $langs->load("members"); - print ''; + print ''; print '
'.$langs->trans("ID").''; + print $object->ref; + print '
'.fieldLabel('ThirdPartyName','name',1).'
'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; + print '
'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; print yn($object->localtax1_assuj); print '
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; + print '
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; print yn($object->localtax2_assuj); print '
'.$langs->trans("LinkedToDolibarrMember").'
'.$langs->trans("LinkedToDolibarrMember").''; $adh=new Adherent($db); $result=$adh->fetch('','',$object->id); @@ -2349,8 +2357,9 @@ else } print '
'; - - print '
'; + print ''; + + print ''; print '
'; dol_fiche_end(); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index ed6c1291ef5..7aa68f69340 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -623,7 +623,7 @@ div.divphotoref { div.statusref { float: right; padding-right: 12px; - margin-top: 9px; + margin-top: 7px; margin-bottom: 10px; } img.photoref { @@ -2132,11 +2132,15 @@ div.pagination li.pagination span.inactive { cursor: default; } div.pagination li.litext a { -border: none; + border: none; padding-right: 10px; padding-left: 4px; font-weight: bold; } +div.pagination li.litext a:hover { + background-color: transparent; + background-image: none; +} dol_use_jmobile)) { ?> div.pagination li.litext { padding-top: 13px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index f909915d794..161ca0113eb 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -673,7 +673,7 @@ div.divphotoref { div.statusref { float: right; padding-right: 12px; - margin-top: 9px; + margin-top: 7px; margin-bottom: 10px; } img.photoref { From 8cd17c01658feba4c2973a8bc89087261f905564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 11 Oct 2015 13:01:28 +0200 Subject: [PATCH 09/17] =?UTF-8?q?FIX=20[=20bug=20#3197=20]=C2=A0Trigger=20?= =?UTF-8?q?LINECONTRACT=5FCREATE=20does=20not=20follow=20common=20denomina?= =?UTF-8?q?tion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Close #3197 --- htdocs/contrat/class/contrat.class.php | 4 ++-- htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 6fa4e5c46a8..76a868a7888 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1332,7 +1332,7 @@ class Contrat extends CommonObject if (empty($error)) { // Call trigger - $result=$this->call_trigger('LINECONTRACT_CREATE',$user); + $result=$this->call_trigger('LINECONTRACT_INSERT',$user); if ($result < 0) { $this->db->rollback(); @@ -2644,7 +2644,7 @@ class ContratLigne extends CommonObjectLine if (!$notrigger) { // Call trigger - $result = $this->call_trigger('LINECONTRACT_CREATE', $user); + $result = $this->call_trigger('LINECONTRACT_INSERT', $user); if ($result < 0) { $this->db->rollback(); return -1; diff --git a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN index fd4d59538f3..84f67660c41 100644 --- a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN +++ b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN @@ -167,7 +167,7 @@ class InterfaceDemo extends DolibarrTriggers case 'CONTRACT_CANCEL': case 'CONTRACT_CLOSE': case 'CONTRACT_DELETE': - case 'LINECONTRACT_CREATE': + case 'LINECONTRACT_INSERT': case 'LINECONTRACT_UPDATE': case 'LINECONTRACT_DELETE': From 0ba6bdb7c29cbdafa4caf2c7a11e7400878ab788 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Oct 2015 13:26:22 +0200 Subject: [PATCH 10/17] CSS enhancement --- htdocs/core/lib/usergroups.lib.php | 2 +- htdocs/core/tpl/objectline_create.tpl.php | 8 ++++---- htdocs/theme/eldy/style.css.php | 5 ++++- htdocs/theme/md/style.css.php | 4 ++++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 10b97265a93..23e122b89f6 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -462,7 +462,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) if ($color) print ''; else print $langs->trans("Default"); } - print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '   ('.$langs->trans("Default").': 6e7896, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print ''; } diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 938a615ea77..64c49894de1 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -114,12 +114,12 @@ else { } // Free line - echo ''; + echo ''; // Show radio free line if ($forceall >= 0 && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) { echo '