diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 35ad3b8c3a1..63bc0f2b04d 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1045,8 +1045,6 @@ else $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref=$object->getFullName($langs); - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); diff --git a/htdocs/contact/info.php b/htdocs/contact/info.php index 3ad4f0779af..0250691e88d 100644 --- a/htdocs/contact/info.php +++ b/htdocs/contact/info.php @@ -32,36 +32,50 @@ $langs->load("companies"); // Security check -$contactid = GETPOST("id",'int'); +$id = GETPOST("id",'int'); if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe'); +$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); -$contact = new Contact($db); +$object = new Contact($db); /* * View */ + +$form=new Form($db); + $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); -if ($contactid > 0) +if ($id > 0) { - $result = $contact->fetch($contactid, $user); + $result = $object->fetch($id, $user); - $contact->info($contactid); + $object->info($id); - $head = contact_prepare_head($contact); + $head = contact_prepare_head($object); dol_fiche_head($head, 'info', $title, 0, 'contact'); - // TODO Put here ref of card + $linkback = ''.$langs->trans("BackToList").''; - dol_print_object_info($contact); + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); + + print '
'; + + print '
'; + + print '
'; + + dol_print_object_info($object); + + print '
'; + dol_fiche_end(); } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 72ccaaf6d06..419df05a679 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -456,22 +456,28 @@ abstract class CommonObject if ($this->elemet == 'contact') { $contactid=$this->id; - $thirdpartyid=$object->id; + $thirdpartyid=$object->fk_soc; + } + if ($this->elemet == 'user') + { + $contactid=$this->contact_id; + $thirdpartyid=$object->fk_soc; } $out=''; $outdone=0; $coords = $this->getFullAddress(1,', '); - if (! empty($conf->use_javascript_ajax)) + if ($coords) { - $namecoords = $this->getFullName($langs,1).'
'.$coords; - // hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile - $out.=''; - $out.=img_picto($langs->trans("Address"), 'object_address.png'); - $out.=' '; - } - if ($coords) { + if (! empty($conf->use_javascript_ajax)) + { + $namecoords = $this->getFullName($langs,1).'
'.$coords; + // hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile + $out.=''; + $out.=img_picto($langs->trans("Address"), 'object_address.png'); + $out.=' '; + } $out.=dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1); $outdone++; $outdone++; } @@ -483,8 +489,8 @@ abstract class CommonObject $outdone++; } - if ($this->phone_pro || $this->phone_mobile || $this->phone_perso || $this->fax) $out.=($outdone?'
':''); - if ($this->phone && empty($this->phone_pro)) { // For object storing pro phone into ->phone + if ($this->phone_pro || $this->phone_mobile || $this->phone_perso || $this->fax || $this->office_phone || $this->user_mobile || $this->office_fax) $out.=($outdone?'
':''); + if ($this->phone && empty($this->phone_pro)) { // For objects that store pro phone into ->phone $out.=dol_print_phone($this->phone,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePro")); $outdone++; } if (! empty($this->phone_pro)) { @@ -499,6 +505,15 @@ abstract class CommonObject if (! empty($this->fax)) { $out.=dol_print_phone($this->fax,$country_code['code'],$contactid,$thirdpartyid,'AC_FAX',' ','fax',$langs->trans("Fax")); $outdone++; } + if (! empty($this->office_phone)) { + $out.=dol_print_phone($this->office_phone,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePro")); $outdone++; + } + if (! empty($this->user_mobile)) { + $out.=dol_print_phone($this->user_mobile,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhoneMobile")); $outdone++; + } + if (! empty($this->office_fax)) { + $out.=dol_print_phone($this->fax,$country_code['code'],$contactid,$thirdpartyid,'AC_FAX',' ','fax',$langs->trans("Fax")); $outdone++; + } $out.='
'; $outdone=0; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8dd0725b1b8..17771a56782 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5157,7 +5157,7 @@ class Form { $ret.=dol_htmlentities($object->name); } - else if ($object->element == 'contact') + else if (in_array($object->element, array('contact', 'user', 'member'))) { $ret.=dol_htmlentities($object->getFullName($langs)); } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 627a9aaffca..bbcd9a4555f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -868,19 +868,16 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r 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($modulepart,$object,0,0,0,'photoref').'
'; //if ($showlogo) $morehtmlleft.='
'.$form->showphoto('societe',$object,0,0,0,'photoref').'
'; if ($showbarcode) $morehtmlleft.='
'.$form->showbarcode($object).'
'; - 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 ($object->element == 'societe' && ! 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.='
'; @@ -981,8 +978,8 @@ function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='') else // Other: title firstname name \n address lines \n zip town \n country { - $ret .= ($ret ? $sep : '' ).$object->zip; - $ret .= ($object->town?(($object->zip?' ':'').$object->town):''); + $ret .= $object->zip ? (($ret ? $sep : '' ).$object->zip) : ''; + $ret .= ($object->town?(($object->zip?' ':$sep).$object->town):''); if ($object->state && in_array($object->country_code,$countriesusingstate)) { $ret.=($ret?", ":'').$object->state; @@ -1683,6 +1680,8 @@ function dol_print_address($address, $htmlid, $mode, $id, $noprint=0) { $out.=nl2br($address); $showgmap=$showomap=0; + + // TODO Add a hook here if ($mode=='thirdparty' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS)) $showgmap=1; if ($mode=='contact' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS_CONTACTS)) $showgmap=1; if ($mode=='member' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS_MEMBERS)) $showgmap=1; @@ -1690,7 +1689,6 @@ function dol_print_address($address, $htmlid, $mode, $id, $noprint=0) if ($mode=='contact' && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_CONTACTS)) $showomap=1; if ($mode=='member' && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_MEMBERS)) $showomap=1; - // TODO Add a hook here if ($showgmap) { $url=dol_buildpath('/google/gmaps.php?mode='.$mode.'&id='.$id,1); diff --git a/htdocs/societe/info.php b/htdocs/societe/info.php index 198d31666c3..a415ae57b1c 100644 --- a/htdocs/societe/info.php +++ b/htdocs/societe/info.php @@ -57,6 +57,8 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e * View */ +$form=new Form($b); + $title=$langs->trans("ThirdParty"); if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Info"); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; @@ -82,11 +84,21 @@ if ($socid > 0) dol_fiche_head($head, 'info', $langs->trans("ThirdParty"), 0, 'company'); + $linkback = ''.$langs->trans("BackToList").''; - print '
'; + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); + + + print '
'; + + print '
'; + + print '
'; + dol_print_object_info($object); - print '
'; + print '
'; + dol_fiche_end(); } diff --git a/htdocs/user/card.php b/htdocs/user/card.php index b74b921c735..35f504c334f 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1192,15 +1192,16 @@ else $rowspan=19; - print ''; - - // Ref - print ''; - print ''; - print ''."\n"; + dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin); + + + print '
'; + print '
'; + + print '
'; + print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); - print '
'; + if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->adherent->enabled)) $rowspan++; @@ -1208,25 +1209,9 @@ else if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3; if (! empty($conf->agenda->enabled)) $rowspan++; - // Lastname - print ''; - print ''; - - // Photo - print ''; - - print ''."\n"; - - // Firstname - print ''; - print ''; - print ''."\n"; - // Position/Job print ''; - print ''; + print ''; print ''."\n"; // Gender @@ -1239,11 +1224,11 @@ else print ''; if (! empty($object->ldap_sid) && $object->statut==0) { - print ''; + print ''; } else { - print ''; + print ''; } print ''."\n"; @@ -1253,24 +1238,24 @@ else { if ($passDoNotExpire) { - print ''; + print ''; } else if($userChangePassNextLogon) { - print ''; + print ''; } else if($userDisabled) { - print ''; + print ''; } else { - print ''; + print ''; } } else { - print ''; - print ''."\n"; } - // Tel pro - print ''; - print ''; - print ''."\n"; - - // Tel mobile - print ''; - print ''; - print ''."\n"; - - // Fax - print ''; - print ''; - print ''."\n"; - // Skype if (! empty($conf->skype->enabled)) { print ''; - print ''; + print ''; print "\n"; } - // EMail - print ''; - print ''; - print "\n"; - // Signature print ''; - print ''; - print ''; print "\n"; @@ -1389,14 +1354,14 @@ else $text=$langs->trans("TJM"); print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classtjm'); print ''; - print ''; print "\n"; // Salary print ''; - print ''; print "\n"; @@ -1404,7 +1369,7 @@ else // Weeklyhours print ''; - print ''; print "\n"; @@ -1413,38 +1378,39 @@ else if ($conf->salaries->enabled) { print ''; - print ''; + print ''; } // Color user if (! empty($conf->agenda->enabled)) { print ''; - print ''; print "\n"; } - // Status - print ''; - print ''; - print ''."\n"; - - print ''; - print ''; + print '
'.$langs->trans("Lastname").''.$object->lastname.''; - print $form->showphoto('userphoto',$object,100); - print '
'.$langs->trans("Firstname").''.$object->firstname.'
'.$langs->trans("PostOrFunction").''.$object->job.''.$object->job.'
'.$langs->trans("Login").''.$langs->trans("LoginAccountDisableInDolibarr").''.$langs->trans("LoginAccountDisableInDolibarr").''.$object->login.''.$object->login.'
'.$langs->trans("LdapUacf_".$statutUACF).''.$langs->trans("LdapUacf_".$statutUACF).''.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).''.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).''.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).''.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).''.$langs->trans("DomainPassword").''.$langs->trans("DomainPassword").''; + print ''; if ($object->pass) print preg_replace('/./i','*',$object->pass); else { @@ -1284,14 +1269,14 @@ else // API key if(! empty($conf->api->enabled) && $user->admin) { print '
'.$langs->trans("ApiKey").''; + print ''; if (! empty($object->api_key)) print $langs->trans("Hidden"); print ''; } // Administrator - print '
'.$langs->trans("Administrator").''; + print '
'.$langs->trans("Administrator").''; if (! empty($conf->multicompany->enabled) && $object->admin && ! $object->entity) { print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin"); @@ -1310,7 +1295,7 @@ else print '
'; $text=$langs->trans("Type"); print $form->textwithpicto($text, $langs->trans("InternalExternalDesc")); - print ''; + print ''; $type=$langs->trans("Internal"); if ($object->societe_id > 0) $type=$langs->trans("External"); print $type; @@ -1320,39 +1305,19 @@ else // Ldap sid if ($object->ldap_sid) { - print '
'.$langs->trans("Type").''; + print '
'.$langs->trans("Type").''; print $langs->trans("DomainUser",$ldap->domainFQDN); print '
'.$langs->trans("PhonePro").''.dol_print_phone($object->office_phone,'',0,0,1).'
'.$langs->trans("PhoneMobile").''.dol_print_phone($object->user_mobile,'',0,0,1).'
'.$langs->trans("Fax").''.dol_print_phone($object->office_fax,'',0,0,1).'
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,0,1).''.dol_print_skype($object->skype,0,0,1).'
'.$langs->trans("EMail").''.dol_print_email($object->email,0,0,1).'
'.$langs->trans('Signature').''; print dol_htmlentitiesbr($object->signature); @@ -1360,7 +1325,7 @@ else // Hierarchy print '
'.$langs->trans("HierarchicalResponsible").''; + print ''; if (empty($object->fk_user)) print $langs->trans("None"); else { $huser=new User($db); @@ -1379,7 +1344,7 @@ else $text=$langs->trans("THM"); print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm'); print ''; + print ''; print ($object->thm!=''?price($object->thm,'',$langs,1,-1,-1,$conf->currency):''); print '
'; + print ''; print ($object->tjm!=''?price($object->tjm,'',$langs,1,-1,-1,$conf->currency):''); print '
'.$langs->trans("Salary").''; + print ''; print ($object->salary!=''?price($object->salary,'',$langs,1,-1,-1,$conf->currency):''); print '
'.$langs->trans("WeeklyHours").''; + print ''; print price2num($object->weeklyhours); print '
'.$langs->trans("AccountancyCode").''.$object->accountancy_code.''.$object->accountancy_code.'
'.$langs->trans("ColorUser").''; + print ''; print $formother->showColor($object->color, ''); print '
'.$langs->trans("Status").''; - print $object->getLibStatut(4); - print '
'.$langs->trans("LastConnexion").''.dol_print_date($object->datelastlogin,"dayhour").'
'; + + print '
'; + print '
'; + + print '
'; + print ''; + + print ''; + print ''; print "\n"; print ''; - print ''; + print ''; print "\n"; if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) { print ''; - print ''; + print ''; print "\n"; } @@ -1452,7 +1418,7 @@ else if (! empty($conf->societe->enabled)) { print ''; - print ''; - print '
'.$langs->trans("LastConnexion").''.dol_print_date($object->datelastlogin,"dayhour").'
'.$langs->trans("PreviousConnexion").''.dol_print_date($object->datepreviouslogin,"dayhour").''.dol_print_date($object->datepreviouslogin,"dayhour").'
'.$langs->trans("OpenIDURL").''.$object->openid.''.$object->openid.'
'.$langs->trans("LinkToCompanyContact").''; + print ''; if (isset($object->societe_id) && $object->societe_id > 0) { $societe = new Societe($db); @@ -1480,7 +1446,7 @@ else { $langs->load("members"); print '
'.$langs->trans("LinkedToDolibarrMember").''; + print ''; if ($object->fk_member) { $adh=new Adherent($db); @@ -1502,7 +1468,7 @@ else { if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) { - print '
'.$langs->trans("Entity").''; + print '
'.$langs->trans("Entity").''; if (empty($object->entity)) { print $langs->trans("AllEntities"); @@ -1517,7 +1483,7 @@ else } // Other attributes - $parameters=array('colspan' => ' colspan="2"'); + $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { @@ -1525,6 +1491,11 @@ else } print "
\n"; + print '
'; + + print '
'; + print '
'; + dol_fiche_end(); @@ -1761,12 +1732,16 @@ else print ''; - print ''; - print ''; - print ''; - + // Ref/ID + if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) + { + print ''; + print ''; + print ''; + } + // Lastname print ""; print ''; diff --git a/htdocs/user/info.php b/htdocs/user/info.php index e2fdcc7b6ec..f069ac4782b 100644 --- a/htdocs/user/info.php +++ b/htdocs/user/info.php @@ -54,6 +54,8 @@ if (($object->id != $user->id) && (! $user->rights->user->user->lire)) * View */ +$form = new Form($db); + llxHeader(); $object->info($id); @@ -64,12 +66,24 @@ $title = $langs->trans("User"); dol_fiche_head($head, 'info', $title, 0, 'user'); -print '
'.$langs->trans("Ref").''; - print $object->id; - print '
'.$langs->trans("Ref").''; + print $object->id; + print '
'.$langs->trans("Lastname").'
'; +$linkback = ''.$langs->trans("BackToList").''; + +dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); + + +print '
'; + +print '
'; + +print '
'; + dol_print_object_info($object); -print '
'; print ''; -$db->close(); + +dol_fiche_end(); + llxFooter(); +$db->close();