diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index a1030a68292..afa64c0733e 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -374,6 +374,7 @@ else /* * Onglets */ + $head=array(); if ($id > 0) { // Si edition contact deja existant @@ -386,9 +387,6 @@ else $head = contact_prepare_head($object); $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); - dol_fiche_head($head, 'card', $title, 0, 'contact'); - - dol_htmloutput_events(); } if ($user->rights->societe->contact->creer) @@ -438,13 +436,16 @@ else print ''."\n"; } - print '
'; print '
'; print ''; print ''; print ''; + + dol_fiche_head($head, 'card', '', 0, ''); + print ''; + // Name print ''; print ''; @@ -611,8 +612,9 @@ else } print ''; - print "
lastname).'" autofocus="autofocus">


"; + print ""; + print dol_fiche_end(); print '
'; print ''; @@ -674,6 +676,8 @@ else print ''; if (! empty($backtopage)) print ''; + dol_fiche_head($head, 'card', $title, 0, 'contact'); + print ''; // Ref @@ -856,7 +860,9 @@ else else print $langs->trans("NoDolibarrAccess"); print ''; - print '

'; + print ''; + + print dol_fiche_end(); print '
'; print ''; @@ -878,6 +884,8 @@ else dol_htmloutput_errors($error,$errors); + dol_fiche_head($head, 'card', $title, 0, 'contact'); + if ($action == 'create_user') { // Full firstname and lastname separated with a dot : firstname.lastname @@ -1078,7 +1086,7 @@ else print ""; - print "
"; + print dol_fiche_end(); // Barre d'actions print '
'; @@ -1113,7 +1121,8 @@ else } } - print "

"; + print "
"; + print "
"; if (! empty($conf->agenda->enabled)) { diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 6a7776b27bd..cbb7ee94823 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -560,7 +560,7 @@ class Contact extends CommonObject $this->email = $obj->email; $this->jabberid = $obj->jabberid; - $this->skype = $obj->skype; + $this->skype = $obj->skype; $this->priv = $obj->priv; $this->mail = $obj->email; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 4dd9a51d0b7..0504727b61e 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -561,6 +561,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $search_status = GETPOST("search_status",'int'); if ($search_status=='') $search_status=1; // always display activ customer first $search_name = GETPOST("search_name",'alpha'); + $search_addressphone = GETPOST("search_addressphone",'alpha'); if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="p.lastname"; @@ -603,18 +604,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''; print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"p.lastname","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Poste"),$_SERVER["PHP_SELF"],"p.poste","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PhonePro"),$_SERVER["PHP_SELF"],"p.phone","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mobile","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email","",$param,'',$sortfield,$sortorder); - if (! empty($conf->skype->enabled)) - { - $colspan++; - print ''.$langs->trans("Skype").''; - } + print_liste_field_titre($langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email"),$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$param,'',$sortfield,$sortorder); - // Copy to clipboard - print " "; // Add to agenda if (! empty($conf->agenda->enabled) && ! empty($user->rights->agenda->myactions->create)) { @@ -627,32 +618,24 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''; + // Name - Position print ''; print ''; print ''; - print ' '; - print ' '; + // Address / Phone + print ''; + //print ''; + print ''; + // Email print ' '; - print ' '; - - print ' '; - if (! empty($conf->skype->enabled)) - { - $colspan++; - print ' '; - } - // Status print ''; - print $form->selectarray('search_status', array('-1'=>'','0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); + print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0,1),'1'=>$contactstatic->LibStatut(1,1)),$search_status); print ''; - // Copy to clipboard - print " "; - // Add to agenda if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { @@ -668,7 +651,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ""; - $sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays as country_id, p.poste, p.phone, p.phone_mobile, p.fax, p.email, p.skype, p.statut "; + $sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays as country_id, p.poste, p.phone, p.phone_mobile, p.phone_perso, p.fax, p.email, p.skype, p.statut "; $sql .= ", p.civility as civility_id, p.address, p.zip, p.town"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $sql .= " WHERE p.fk_soc = ".$object->id; @@ -680,7 +663,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $result = $db->query($sql); $num = $db->num_rows($result); - $var=false; + $var=true; if ($num) { $i=0; @@ -698,74 +681,50 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $contactstatic->firstname = $obj->firstname; $contactstatic->civility_id = $obj->civility_id; print $contactstatic->getNomUrl(1,'',0,'&backtopage='.urlencode($backtopage)); + print ''; + if ($obj->poste) print $obj->poste; print ''; - print ''.$obj->poste.''; - $country_code = getCountry($obj->country_id, 'all'); - // Lien click to dial + // Address and phone print ''; - print dol_print_phone($obj->phone,$country_code['code'],$obj->rowid,$object->id,'AC_TEL'); - print ''; - print ''; - print dol_print_phone($obj->phone_mobile,$country_code['code'],$obj->rowid,$object->id,'AC_TEL'); - print ''; - print ''; - print dol_print_phone($obj->fax,$country_code['code'],$obj->rowid,$object->id,'AC_FAX'); - print ''; - print ''; - print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL'); - print ''; + $outdone=0; + $contactstatic->address = $obj->address; + $contactstatic->zip = $obj->zip; + $contactstatic->town = $obj->town; + $contactstatic->country_id = $obj->country_id; + $coords = $contactstatic->getFullAddress(1,', '); + if (! empty($conf->use_javascript_ajax)) + { + $namecoords = $contactstatic->getFullName($langs,1).'
'.$coords; + // hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile + print ''; + print img_picto($langs->trans("Address"), 'object_address.png'); + print ' '; + } + if ($coords) { print dol_print_address($coords,'address_contact_'.$obj->rowid, 'contact', $obj->rowid); $outdone++; } + if ($obj->phone || $obj->phone_mobile || $obj->phone_perso) print ($outdone?'
':''); + if ($obj->phone) { print dol_print_phone($obj->phone,$country_code['code'],$obj->rowid,$object->id,'AC_TEL',' ','phone'); $outdone++; } + if ($obj->phone_mobile) { print dol_print_phone($obj->phone_mobile,$country_code['code'],$obj->rowid,$object->id,'AC_TEL',' ','phone'); $outdone++; } + if ($obj->phone_perso) { print dol_print_phone($obj->phone_perso,$country_code['code'],$obj->rowid,$object->id,'AC_TEL',' ','phone'); $outdone++; } + if ($obj->fax) { print dol_print_phone($obj->fax,$country_code['code'],$obj->rowid,$object->id,'AC_FAX',' ','fax'); $outdone++; } + print '
'; + $outdone=0; + if ($obj->email) print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL',0,0,1); if (! empty($conf->skype->enabled)) { - print ''; - print dol_print_skype($obj->skype,$obj->rowid,$object->id,'AC_SKYPE'); - print ''; + if ($obj->skype) print ($outdone?'
':'').dol_print_skype($obj->skype,$obj->rowid,$object->id,'AC_SKYPE'); } + print ''; // Status print ''.$contactstatic->getLibStatut(5).''; - print ''; - if (! empty($conf->use_javascript_ajax)) - { - // Copy to clipboard - $coords = ''; - if (!empty($object->name)) $coords .= $object->name."
"; - $coords .= $contactstatic->getFullName($langs,1).' '; - $coords .= "
"; - if (!empty($obj->address)) - { - $coords .= dol_nl2br($obj->address,1,true)."
"; - if (!empty($obj->zip)) $coords .= $obj->zip.' '; - if (!empty($obj->town)) $coords .= $obj->town; - if (!empty($obj->country_id)) $coords .= "
".$country_code['label']; - } - else if (!empty($object->address)) - { - $coords .= dol_nl2br($object->address,1,true)."
"; - if (!empty($object->zip)) $coords .= $object->zip.' '; - if (!empty($object->town)) $coords .= $object->town; - if (!empty($object->country_id)) $coords .= "
".$country_code['label']; - } - // hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile - print ''; - print img_picto($langs->trans("Address"), 'object_address.png'); - print ''; - } - print ''; - // Add to agenda if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { print ''; - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) - { - print ''; - print img_object($langs->trans("Rendez-Vous"),"action_rdv"); - print ' '; - } print ''; print img_object($langs->trans("Event"),"action"); print ''; @@ -787,7 +746,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') } else { - print ""; + print ""; print ''.$langs->trans("None").''; print "\n"; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f4e1fe159fe..8f1b4ecd54f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -683,7 +683,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p if (count($keys)) $maxkey=max($keys); } - // Show tabs + // Show tabs $bactive=false; // if =0 we don't use the feature $limittoshow=($conf->global->MAXTABS_IN_CARD?$conf->global->MAXTABS_IN_CARD:99); @@ -754,7 +754,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p $out.='
Plus'; $out.='
'.$outmore.'
'; $out.="\n"; - + $out.="