The new banner tab is also on user card now

This commit is contained in:
Laurent Destailleur 2015-10-11 15:21:21 +02:00
parent db9d09c7a3
commit bd48ad265d
8 changed files with 150 additions and 124 deletions

View File

@ -1045,8 +1045,6 @@ else
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
$morehtmlref=$object->getFullName($langs);
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');

View File

@ -32,36 +32,50 @@ $langs->load("companies");
// Security check // Security check
$contactid = GETPOST("id",'int'); $id = GETPOST("id",'int');
if ($user->societe_id) $socid=$user->societe_id; 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 * View
*/ */
$form=new Form($db);
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas'); llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;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'); dol_fiche_head($head, 'info', $title, 0, 'contact');
// TODO Put here ref of card $linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
dol_print_object_info($contact); dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<br>';
dol_print_object_info($object);
print '</div>';
dol_fiche_end(); dol_fiche_end();
} }

View File

@ -456,22 +456,28 @@ abstract class CommonObject
if ($this->elemet == 'contact') if ($this->elemet == 'contact')
{ {
$contactid=$this->id; $contactid=$this->id;
$thirdpartyid=$object->id; $thirdpartyid=$object->fk_soc;
}
if ($this->elemet == 'user')
{
$contactid=$this->contact_id;
$thirdpartyid=$object->fk_soc;
} }
$out='<!-- BEGIN part to show address block -->'; $out='<!-- BEGIN part to show address block -->';
$outdone=0; $outdone=0;
$coords = $this->getFullAddress(1,', '); $coords = $this->getFullAddress(1,', ');
if (! empty($conf->use_javascript_ajax)) if ($coords)
{ {
$namecoords = $this->getFullName($langs,1).'<br>'.$coords; if (! empty($conf->use_javascript_ajax))
// hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile {
$out.='<a href="#" class="hideonsmartphone" onclick="return copyToClipboard(\''.dol_escape_js($namecoords).'\',\''.dol_escape_js($langs->trans("HelpCopyToClipboard")).'\');">'; $namecoords = $this->getFullName($langs,1).'<br>'.$coords;
$out.=img_picto($langs->trans("Address"), 'object_address.png'); // hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile
$out.='</a> '; $out.='<a href="#" class="hideonsmartphone" onclick="return copyToClipboard(\''.dol_escape_js($namecoords).'\',\''.dol_escape_js($langs->trans("HelpCopyToClipboard")).'\');">';
} $out.=img_picto($langs->trans("Address"), 'object_address.png');
if ($coords) { $out.='</a> ';
}
$out.=dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1); $outdone++; $out.=dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1); $outdone++;
$outdone++; $outdone++;
} }
@ -483,8 +489,8 @@ abstract class CommonObject
$outdone++; $outdone++;
} }
if ($this->phone_pro || $this->phone_mobile || $this->phone_perso || $this->fax) $out.=($outdone?'<br>':''); if ($this->phone_pro || $this->phone_mobile || $this->phone_perso || $this->fax || $this->office_phone || $this->user_mobile || $this->office_fax) $out.=($outdone?'<br>':'');
if ($this->phone && empty($this->phone_pro)) { // For object storing pro phone into ->phone 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','&nbsp;','phone',$langs->trans("PhonePro")); $outdone++; $out.=dol_print_phone($this->phone,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhonePro")); $outdone++;
} }
if (! empty($this->phone_pro)) { if (! empty($this->phone_pro)) {
@ -499,6 +505,15 @@ abstract class CommonObject
if (! empty($this->fax)) { if (! empty($this->fax)) {
$out.=dol_print_phone($this->fax,$country_code['code'],$contactid,$thirdpartyid,'AC_FAX','&nbsp;','fax',$langs->trans("Fax")); $outdone++; $out.=dol_print_phone($this->fax,$country_code['code'],$contactid,$thirdpartyid,'AC_FAX','&nbsp;','fax',$langs->trans("Fax")); $outdone++;
} }
if (! empty($this->office_phone)) {
$out.=dol_print_phone($this->office_phone,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhonePro")); $outdone++;
}
if (! empty($this->user_mobile)) {
$out.=dol_print_phone($this->user_mobile,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhoneMobile")); $outdone++;
}
if (! empty($this->office_fax)) {
$out.=dol_print_phone($this->fax,$country_code['code'],$contactid,$thirdpartyid,'AC_FAX','&nbsp;','fax',$langs->trans("Fax")); $outdone++;
}
$out.='<div style="clear: both;"></div>'; $out.='<div style="clear: both;"></div>';
$outdone=0; $outdone=0;

View File

@ -5157,7 +5157,7 @@ class Form
{ {
$ret.=dol_htmlentities($object->name); $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)); $ret.=dol_htmlentities($object->getFullName($langs));
} }

View File

@ -868,19 +868,16 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
if ($object->element == 'contact') $modulepart='contact'; if ($object->element == 'contact') $modulepart='contact';
if ($object->element == 'member') $modulepart='memberphoto'; if ($object->element == 'member') $modulepart='memberphoto';
if ($object->element == 'user') $modulepart='userphoto'; if ($object->element == 'user') $modulepart='userphoto';
print '<div class="arearef heightref valignmiddle" width="100%">'; print '<div class="arearef heightref valignmiddle" width="100%">';
//$morehtmlleft='<div class="floatleft inline-block valignmiddle divphotoref">'.img_picto('', 'title_companies', '', '').'</div>'; //$morehtmlleft='<div class="floatleft inline-block valignmiddle divphotoref">'.img_picto('', 'title_companies', '', '').'</div>';
if ($showlogo) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto($modulepart,$object,0,0,0,'photoref').'</div>'; if ($showlogo) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto($modulepart,$object,0,0,0,'photoref').'</div>';
//if ($showlogo) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto('societe',$object,0,0,0,'photoref').'</div>'; //if ($showlogo) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto('societe',$object,0,0,0,'photoref').'</div>';
if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>'; if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>';
if ($object->element == 'societe') 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');
if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { } else {
$morehtmlright.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); $morehtmlright.=$object->getLibStatut(2);
} else {
$morehtmlright.=$object->getLibStatut(2);
}
} }
if (! empty($object->name_nalias)) $morehtmlref.='<div class="refidno">'.$object->name_alias.'</div>'; if (! empty($object->name_nalias)) $morehtmlref.='<div class="refidno">'.$object->name_alias.'</div>';
$morehtmlref.='<div class="refidno">'; $morehtmlref.='<div class="refidno">';
@ -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 else // Other: title firstname name \n address lines \n zip town \n country
{ {
$ret .= ($ret ? $sep : '' ).$object->zip; $ret .= $object->zip ? (($ret ? $sep : '' ).$object->zip) : '';
$ret .= ($object->town?(($object->zip?' ':'').$object->town):''); $ret .= ($object->town?(($object->zip?' ':$sep).$object->town):'');
if ($object->state && in_array($object->country_code,$countriesusingstate)) if ($object->state && in_array($object->country_code,$countriesusingstate))
{ {
$ret.=($ret?", ":'').$object->state; $ret.=($ret?", ":'').$object->state;
@ -1683,6 +1680,8 @@ function dol_print_address($address, $htmlid, $mode, $id, $noprint=0)
{ {
$out.=nl2br($address); $out.=nl2br($address);
$showgmap=$showomap=0; $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=='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=='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; 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=='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; if ($mode=='member' && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_MEMBERS)) $showomap=1;
// TODO Add a hook here
if ($showgmap) if ($showgmap)
{ {
$url=dol_buildpath('/google/gmaps.php?mode='.$mode.'&id='.$id,1); $url=dol_buildpath('/google/gmaps.php?mode='.$mode.'&id='.$id,1);

View File

@ -57,6 +57,8 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
* View * View
*/ */
$form=new Form($b);
$title=$langs->trans("ThirdParty"); $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"); 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'; $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'); dol_fiche_head($head, 'info', $langs->trans("ThirdParty"), 0, 'company');
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
print '<table width="100%"><tr><td>'; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<br>';
dol_print_object_info($object); dol_print_object_info($object);
print '</td></tr></table>';
print '</div>';
dol_fiche_end(); dol_fiche_end();
} }

View File

@ -1192,15 +1192,16 @@ else
$rowspan=19; $rowspan=19;
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">';
print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin);
print '</td>';
print '</tr>'."\n";
dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">';
if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++; 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->societe->enabled)) $rowspan++;
if (! empty($conf->adherent->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->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3;
if (! empty($conf->agenda->enabled)) $rowspan++; if (! empty($conf->agenda->enabled)) $rowspan++;
// Lastname
print '<tr><td>'.$langs->trans("Lastname").'</td>';
print '<td colspan="2">'.$object->lastname.'</td>';
// Photo
print '<td align="center" valign="middle" width="25%" rowspan="'.$rowspan.'">';
print $form->showphoto('userphoto',$object,100);
print '</td>';
print '</tr>'."\n";
// Firstname
print '<tr><td>'.$langs->trans("Firstname").'</td>';
print '<td colspan="2">'.$object->firstname.'</td>';
print '</tr>'."\n";
// Position/Job // Position/Job
print '<tr><td>'.$langs->trans("PostOrFunction").'</td>'; print '<tr><td>'.$langs->trans("PostOrFunction").'</td>';
print '<td colspan="2">'.$object->job.'</td>'; print '<td>'.$object->job.'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
// Gender // Gender
@ -1239,11 +1224,11 @@ else
print '<tr><td>'.$langs->trans("Login").'</td>'; print '<tr><td>'.$langs->trans("Login").'</td>';
if (! empty($object->ldap_sid) && $object->statut==0) if (! empty($object->ldap_sid) && $object->statut==0)
{ {
print '<td colspan="2" class="error">'.$langs->trans("LoginAccountDisableInDolibarr").'</td>'; print '<td class="error">'.$langs->trans("LoginAccountDisableInDolibarr").'</td>';
} }
else else
{ {
print '<td colspan="2">'.$object->login.'</td>'; print '<td>'.$object->login.'</td>';
} }
print '</tr>'."\n"; print '</tr>'."\n";
@ -1253,24 +1238,24 @@ else
{ {
if ($passDoNotExpire) if ($passDoNotExpire)
{ {
print '<td colspan="2">'.$langs->trans("LdapUacf_".$statutUACF).'</td>'; print '<td>'.$langs->trans("LdapUacf_".$statutUACF).'</td>';
} }
else if($userChangePassNextLogon) else if($userChangePassNextLogon)
{ {
print '<td colspan="2" class="warning">'.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).'</td>'; print '<td class="warning">'.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).'</td>';
} }
else if($userDisabled) else if($userDisabled)
{ {
print '<td colspan="2" class="warning">'.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).'</td>'; print '<td class="warning">'.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).'</td>';
} }
else else
{ {
print '<td colspan="2">'.$langs->trans("DomainPassword").'</td>'; print '<td>'.$langs->trans("DomainPassword").'</td>';
} }
} }
else else
{ {
print '<td colspan="2">'; print '<td>';
if ($object->pass) print preg_replace('/./i','*',$object->pass); if ($object->pass) print preg_replace('/./i','*',$object->pass);
else else
{ {
@ -1284,14 +1269,14 @@ else
// API key // API key
if(! empty($conf->api->enabled) && $user->admin) { if(! empty($conf->api->enabled) && $user->admin) {
print '<tr><td>'.$langs->trans("ApiKey").'</td>'; print '<tr><td>'.$langs->trans("ApiKey").'</td>';
print '<td colspan="2">'; print '<td>';
if (! empty($object->api_key)) if (! empty($object->api_key))
print $langs->trans("Hidden"); print $langs->trans("Hidden");
print '<td>'; print '<td>';
} }
// Administrator // Administrator
print '<tr><td>'.$langs->trans("Administrator").'</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Administrator").'</td><td>';
if (! empty($conf->multicompany->enabled) && $object->admin && ! $object->entity) if (! empty($conf->multicompany->enabled) && $object->admin && ! $object->entity)
{ {
print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin"); print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin");
@ -1310,7 +1295,7 @@ else
print '<tr><td>'; print '<tr><td>';
$text=$langs->trans("Type"); $text=$langs->trans("Type");
print $form->textwithpicto($text, $langs->trans("InternalExternalDesc")); print $form->textwithpicto($text, $langs->trans("InternalExternalDesc"));
print '</td><td colspan="2">'; print '</td><td>';
$type=$langs->trans("Internal"); $type=$langs->trans("Internal");
if ($object->societe_id > 0) $type=$langs->trans("External"); if ($object->societe_id > 0) $type=$langs->trans("External");
print $type; print $type;
@ -1320,39 +1305,19 @@ else
// Ldap sid // Ldap sid
if ($object->ldap_sid) if ($object->ldap_sid)
{ {
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Type").'</td><td>';
print $langs->trans("DomainUser",$ldap->domainFQDN); print $langs->trans("DomainUser",$ldap->domainFQDN);
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
// Tel pro
print '<tr><td>'.$langs->trans("PhonePro").'</td>';
print '<td colspan="2">'.dol_print_phone($object->office_phone,'',0,0,1).'</td>';
print '</tr>'."\n";
// Tel mobile
print '<tr><td>'.$langs->trans("PhoneMobile").'</td>';
print '<td colspan="2">'.dol_print_phone($object->user_mobile,'',0,0,1).'</td>';
print '</tr>'."\n";
// Fax
print '<tr><td>'.$langs->trans("Fax").'</td>';
print '<td colspan="2">'.dol_print_phone($object->office_fax,'',0,0,1).'</td>';
print '</tr>'."\n";
// Skype // Skype
if (! empty($conf->skype->enabled)) if (! empty($conf->skype->enabled))
{ {
print '<tr><td>'.$langs->trans("Skype").'</td>'; print '<tr><td>'.$langs->trans("Skype").'</td>';
print '<td colspan="2">'.dol_print_skype($object->skype,0,0,1).'</td>'; print '<td>'.dol_print_skype($object->skype,0,0,1).'</td>';
print "</tr>\n"; print "</tr>\n";
} }
// EMail
print '<tr><td>'.$langs->trans("EMail").'</td>';
print '<td colspan="2">'.dol_print_email($object->email,0,0,1).'</td>';
print "</tr>\n";
// Signature // Signature
print '<tr><td class="tdtop">'.$langs->trans('Signature').'</td><td colspan="2">'; print '<tr><td class="tdtop">'.$langs->trans('Signature').'</td><td colspan="2">';
print dol_htmlentitiesbr($object->signature); print dol_htmlentitiesbr($object->signature);
@ -1360,7 +1325,7 @@ else
// Hierarchy // Hierarchy
print '<tr><td>'.$langs->trans("HierarchicalResponsible").'</td>'; print '<tr><td>'.$langs->trans("HierarchicalResponsible").'</td>';
print '<td colspan="2">'; print '<td>';
if (empty($object->fk_user)) print $langs->trans("None"); if (empty($object->fk_user)) print $langs->trans("None");
else { else {
$huser=new User($db); $huser=new User($db);
@ -1379,7 +1344,7 @@ else
$text=$langs->trans("THM"); $text=$langs->trans("THM");
print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm'); print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm');
print '</td>'; print '</td>';
print '<td colspan="2">'; print '<td>';
print ($object->thm!=''?price($object->thm,'',$langs,1,-1,-1,$conf->currency):''); print ($object->thm!=''?price($object->thm,'',$langs,1,-1,-1,$conf->currency):'');
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
@ -1389,14 +1354,14 @@ else
$text=$langs->trans("TJM"); $text=$langs->trans("TJM");
print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classtjm'); print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classtjm');
print '</td>'; print '</td>';
print '<td colspan="2">'; print '<td>';
print ($object->tjm!=''?price($object->tjm,'',$langs,1,-1,-1,$conf->currency):''); print ($object->tjm!=''?price($object->tjm,'',$langs,1,-1,-1,$conf->currency):'');
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
// Salary // Salary
print '<tr><td>'.$langs->trans("Salary").'</td>'; print '<tr><td>'.$langs->trans("Salary").'</td>';
print '<td colspan="2">'; print '<td>';
print ($object->salary!=''?price($object->salary,'',$langs,1,-1,-1,$conf->currency):''); print ($object->salary!=''?price($object->salary,'',$langs,1,-1,-1,$conf->currency):'');
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
@ -1404,7 +1369,7 @@ else
// Weeklyhours // Weeklyhours
print '<tr><td>'.$langs->trans("WeeklyHours").'</td>'; print '<tr><td>'.$langs->trans("WeeklyHours").'</td>';
print '<td colspan="2">'; print '<td>';
print price2num($object->weeklyhours); print price2num($object->weeklyhours);
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
@ -1413,38 +1378,39 @@ else
if ($conf->salaries->enabled) if ($conf->salaries->enabled)
{ {
print '<tr><td>'.$langs->trans("AccountancyCode").'</td>'; print '<tr><td>'.$langs->trans("AccountancyCode").'</td>';
print '<td colspan="2">'.$object->accountancy_code.'</td>'; print '<td>'.$object->accountancy_code.'</td>';
} }
// Color user // Color user
if (! empty($conf->agenda->enabled)) if (! empty($conf->agenda->enabled))
{ {
print '<tr><td>'.$langs->trans("ColorUser").'</td>'; print '<tr><td>'.$langs->trans("ColorUser").'</td>';
print '<td colspan="2">'; print '<td>';
print $formother->showColor($object->color, ''); print $formother->showColor($object->color, '');
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
} }
// Status print '</table>';
print '<tr><td>'.$langs->trans("Status").'</td>';
print '<td colspan="2">'; print '</div>';
print $object->getLibStatut(4); print '<div class="fichehalfright"><div class="ficheaddleft">';
print '</td>';
print '</tr>'."\n"; print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">';
print '<tr><td>'.$langs->trans("LastConnexion").'</td>';
print '<td colspan="2">'.dol_print_date($object->datelastlogin,"dayhour").'</td>'; print '<tr><td>'.$langs->trans("LastConnexion").'</td>';
print '<td>'.dol_print_date($object->datelastlogin,"dayhour").'</td>';
print "</tr>\n"; print "</tr>\n";
print '<tr><td>'.$langs->trans("PreviousConnexion").'</td>'; print '<tr><td>'.$langs->trans("PreviousConnexion").'</td>';
print '<td colspan="2">'.dol_print_date($object->datepreviouslogin,"dayhour").'</td>'; print '<td>'.dol_print_date($object->datepreviouslogin,"dayhour").'</td>';
print "</tr>\n"; print "</tr>\n";
if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER))
{ {
print '<tr><td>'.$langs->trans("OpenIDURL").'</td>'; print '<tr><td>'.$langs->trans("OpenIDURL").'</td>';
print '<td colspan="2">'.$object->openid.'</td>'; print '<td>'.$object->openid.'</td>';
print "</tr>\n"; print "</tr>\n";
} }
@ -1452,7 +1418,7 @@ else
if (! empty($conf->societe->enabled)) if (! empty($conf->societe->enabled))
{ {
print '<tr><td>'.$langs->trans("LinkToCompanyContact").'</td>'; print '<tr><td>'.$langs->trans("LinkToCompanyContact").'</td>';
print '<td colspan="2">'; print '<td>';
if (isset($object->societe_id) && $object->societe_id > 0) if (isset($object->societe_id) && $object->societe_id > 0)
{ {
$societe = new Societe($db); $societe = new Societe($db);
@ -1480,7 +1446,7 @@ else
{ {
$langs->load("members"); $langs->load("members");
print '<tr><td>'.$langs->trans("LinkedToDolibarrMember").'</td>'; print '<tr><td>'.$langs->trans("LinkedToDolibarrMember").'</td>';
print '<td colspan="2">'; print '<td>';
if ($object->fk_member) if ($object->fk_member)
{ {
$adh=new Adherent($db); $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) if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
{ {
print '<tr><td>'.$langs->trans("Entity").'</td><td width="75%" class="valeur">'; print '<tr><td>'.$langs->trans("Entity").'</td><td>';
if (empty($object->entity)) if (empty($object->entity))
{ {
print $langs->trans("AllEntities"); print $langs->trans("AllEntities");
@ -1517,7 +1483,7 @@ else
} }
// Other attributes // 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 $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)) if (empty($reshook) && ! empty($extrafields->attribute_label))
{ {
@ -1525,6 +1491,11 @@ else
} }
print "</table>\n"; print "</table>\n";
print '</div>';
print '</div></div>';
print '<div style="clear:both"></div>';
dol_fiche_end(); dol_fiche_end();
@ -1761,12 +1732,16 @@ else
print '<table width="100%" class="border">'; print '<table width="100%" class="border">';
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>'; // Ref/ID
print '<td colspan="2">'; if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID))
print $object->id; {
print '</td>'; print '<tr><td>'.$langs->trans("Ref").'</td>';
print '</tr>'; print '<td>';
print $object->id;
print '</td>';
print '</tr>';
}
// Lastname // Lastname
print "<tr>"; print "<tr>";
print '<td class="fieldrequired">'.$langs->trans("Lastname").'</td>'; print '<td class="fieldrequired">'.$langs->trans("Lastname").'</td>';

View File

@ -54,6 +54,8 @@ if (($object->id != $user->id) && (! $user->rights->user->user->lire))
* View * View
*/ */
$form = new Form($db);
llxHeader(); llxHeader();
$object->info($id); $object->info($id);
@ -64,12 +66,24 @@ $title = $langs->trans("User");
dol_fiche_head($head, 'info', $title, 0, 'user'); dol_fiche_head($head, 'info', $title, 0, 'user');
print '<table width="100%"><tr><td>'; $linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<br>';
dol_print_object_info($object); dol_print_object_info($object);
print '</td></tr></table>';
print '</div>'; print '</div>';
$db->close();
dol_fiche_end();
llxFooter(); llxFooter();
$db->close();