2
0
forked from Wavyzz/dolibarr

New banner card on contact card.

This commit is contained in:
Laurent Destailleur
2015-10-11 12:27:04 +02:00
parent 0032ad695c
commit 6ec77e2ca0
9 changed files with 152 additions and 74 deletions

View File

@@ -773,10 +773,13 @@ else
print '<table class="border" width="100%">';
// Ref
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="3">';
// Ref/ID
if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID))
{
print '<tr><td>'.$langs->trans("ID").'</td><td colspan="3">';
print $object->ref;
print '</td></tr>';
}
// Lastname
print '<tr><td width="20%" class="fieldrequired"><label for="lastname">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</label></td>';
@@ -1040,23 +1043,34 @@ else
}
print '<table class="border" width="100%">';
$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', '');
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">';
// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
/*print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'id', $linkback);
print '</td></tr>';
// Name
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%">'.$object->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td>';
*/
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="2">';
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
if ($object->socid > 0)
{
$objsoc->fetch($object->socid);
@@ -1070,6 +1084,7 @@ else
}
// Photo
/*
if ($object->photo)
{
print '<td rowspan="6" style="text-align: center;" width="25%">';
@@ -1080,18 +1095,20 @@ else
print '&nbsp;';
print '</td>';
}
*/
print '</tr>';
// Civility
print '<tr><td width="15%">'.$langs->trans("UserTitle").'</td><td colspan="2">';
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
print $object->getCivilityLabel();
print '</td></tr>';
// Role
print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="2">'.$object->poste.'</td>';
print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td>'.$object->poste.'</td></tr>';
// Address
/*
print '<tr><td>'.$langs->trans("Address").'</td><td colspan="2">';
dol_print_address($object->address,'gmap','contact',$object->id);
print '</td></tr>';
@@ -1112,67 +1129,71 @@ else
// State
if (empty($conf->global->SOCIETE_DISABLE_STATE))
{
print '<tr><td>'.$langs->trans('State').'</td><td colspan="2">'.$object->state.'</td>';
}
print '<tr><td>'.$langs->trans('State').'</td><td>'.$object->state.'</td></tr>';
}*/
// Phone
/*
print '<tr><td>'.$langs->trans("PhonePro").'</td><td>'.dol_print_phone($object->phone_pro,$object->country_code,$object->id,$object->socid,'AC_TEL').'</td>';
print '<td>'.$langs->trans("PhonePerso").'</td><td>'.dol_print_phone($object->phone_perso,$object->country_code,$object->id,$object->socid,'AC_TEL').'</td></tr>';
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td>'.dol_print_phone($object->phone_mobile,$object->country_code,$object->id,$object->socid,'AC_TEL').'</td>';
print '<td>'.$langs->trans("Fax").'</td><td>'.dol_print_phone($object->fax,$object->country_code,$object->id,$object->socid,'AC_FAX').'</td></tr>';
*/
// Email
print '<tr><td>'.$langs->trans("EMail").'</td><td>'.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').'</td>';
//print '<tr><td>'.$langs->trans("EMail").'</td><td>'.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').'</td></tr>';
if (! empty($conf->mailing->enabled))
{
$langs->load("mails");
print '<td class="nowrap">'.$langs->trans("NbOfEMailingsSend").'</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/mailing/list.php?filteremail='.urlencode($object->email).'">'.$object->getNbOfEMailings().'</a></td>';
print '<tr><td class="nowrap">'.$langs->trans("NbOfEMailingsSend").'</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/mailing/list.php?filteremail='.urlencode($object->email).'">'.$object->getNbOfEMailings().'</a></td></tr>';
}
else
{
print '<td colspan="2">&nbsp;</td>';
}
print '</tr>';
// Instant message and no email
print '<tr><td>'.$langs->trans("IM").'</td><td>'.$object->jabberid.'</td>';
print '<tr><td>'.$langs->trans("IM").'</td><td>'.$object->jabberid.'</td></tr>';
if (!empty($conf->mailing->enabled))
{
print '<td>'.$langs->trans("No_Email").'</td><td>'.yn($object->no_email).'</td>';
print '<tr><td>'.$langs->trans("No_Email").'</td><td>'.yn($object->no_email).'</td></tr>';
}
else
{
print '<td colspan="2">&nbsp;</td>';
}
print '</tr>';
// Skype
if (! empty($conf->skype->enabled))
{
print '<tr><td>'.$langs->trans("Skype").'</td><td colspan="3">'.dol_print_skype($object->skype,0,$object->fk_soc,1).'</td></tr>';
print '<tr><td>'.$langs->trans("Skype").'</td><td>'.dol_print_skype($object->skype,0,$object->fk_soc,1).'</td></tr>';
}
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td colspan="3">';
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td>';
print $object->LibPubPriv($object->priv);
print '</td></tr>';
// Note Public
print '<tr><td class="tdtop">'.$langs->trans("NotePublic").'</td><td colspan="3">';
/*
print '<tr><td class="tdtop">'.$langs->trans("NotePublic").'</td><td>';
print nl2br($object->note_public);
print '</td></tr>';
// Note Private
print '<tr><td class="tdtop">'.$langs->trans("NotePrivate").'</td><td colspan="3">';
print '<tr><td class="tdtop">'.$langs->trans("NotePrivate").'</td><td>';
print nl2br($object->note_private);
print '</td></tr>';
*/
print '</table>';
print '</div>';
print '<div class="fichehalfright"><div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">';
// Statut
print '<tr><td>'.$langs->trans("Status").'</td>';
/*print '<tr><td>'.$langs->trans("Status").'</td>';
print '<td>';
print $object->getLibStatut(4);
print '</td>';
print '</tr>'."\n";
*/
// Categories
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) {
@@ -1241,6 +1262,9 @@ else
print "</table>";
print '</div></div></div>';
print '<div style="clear:both"></div>';
print dol_fiche_end();
// Barre d'actions

View File

@@ -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.='<!-- BEGIN PHP TEMPLATE address_view.tpl.php -->';
$out='<!-- BEGIN part to show address block -->';
$outdone=0;
$coords = $this->getFullAddress(1,', ');
@@ -473,17 +483,20 @@ abstract class CommonObject
}
if ($this->phone_pro || $this->phone_mobile || $this->phone_perso || $this->fax) $out.=($outdone?'<br>':'');
if ($this->phone_pro) {
$out.=dol_print_phone($this->phone_pro,$country_code['code'],$this->rowid,$object->id,'AC_TEL','&nbsp;','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','&nbsp;','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','&nbsp;','phone'); $outdone++;
if (! empty($this->phone_pro)) {
$out.=dol_print_phone($this->phone_pro,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL','&nbsp;','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','&nbsp;','phone'); $outdone++;
if (! empty($this->phone_mobile)) {
$out.=dol_print_phone($this->phone_mobile,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhoneMobile")); $outdone++;
}
if ($this->fax) {
$out.=dol_print_phone($this->fax,$country_code['code'],$this->rowid,$object->id,'AC_FAX','&nbsp;','fax'); $outdone++;
if (! empty($this->phone_perso)) {
$out.=dol_print_phone($this->phone_perso,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhonePerso")); $outdone++;
}
if (! empty($this->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>';
@@ -503,7 +516,7 @@ abstract class CommonObject
if ($this->skype) $out.=($outdone?'<br>':'').dol_print_skype($this->skype,$this->id,$object->id,'AC_SKYPE');
}
$out.='<!-- END PHP TEMPLATE address_view.tpl.php -->';
$out.='<!-- END Part to show address block -->';
return $out;
}

View File

@@ -5152,7 +5152,16 @@ class Form
$ret.='<div class="inline-block floatleft valignmiddle refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">';
$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;

View File

@@ -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 "<tr ".$bc[$var].">";

View File

@@ -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 '<div class="arearef heightref valignmiddle" width="100%">';
//$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('societe',$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 ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>';
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.='<div class="refidno">'.$object->name_alias.'</div>';
$morehtmlref.='<div class="refidno">';
$morehtmlref.=$object->getBannerAddress('refaddress',$object);
$morehtmlref.='</div>';
if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && in_array($object->element, array('societe', 'contact', 'member')))
{
$morehtmlref.='<div style="clear: both;"></div><div class="refidno">';
$morehtmlref.=$langs->trans("TechnicalID").': '.$object->id;
$morehtmlref.='</div>';
}
print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlright);
print '</div>';
print '<div class="underrefbanner clearboth"></div>';
@@ -1487,9 +1500,10 @@ function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64)
* @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="&nbsp;",$withpicto='')
function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ="&nbsp;",$withpicto='',$titlealt='')
{
global $conf,$user,$langs,$mysoc;
@@ -1569,7 +1583,11 @@ function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ="
}
}
return '<div class="nospan float" style="margin-right: 10px">'.($withpicto?img_picto(($withpicto=='fax'?$langs->trans("Fax"):$langs->trans("Phone")), 'object_'.($withpicto=='fax'?'phoning_fax':'phoning').'.png').' ':'').$newphone.'</div>';
if (empty($titlealt))
{
$titlealt=($withpicto=='fax'?$langs->trans("Fax"):$langs->trans("Phone"));
}
return '<div class="nospan float" style="margin-right: 10px">'.($withpicto?img_picto($titlealt, 'object_'.($withpicto=='fax'?'phoning_fax':'phoning').'.png').' ':'').$newphone.'</div>';
}
/**

View File

@@ -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 <b>%s</b> decimals.

View File

@@ -1447,6 +1447,14 @@ else
print '<table class="border" width="100%">';
// Ref/ID
if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID))
{
print '<tr><td>'.$langs->trans("ID").'</td><td colspan="3">';
print $object->ref;
print '</td></tr>';
}
// Name
print '<tr><td>'.fieldLabel('ThirdPartyName','name',1).'</td>';
print '<td colspan="3"><input type="text" size="60" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus"></td></tr>';
@@ -2140,7 +2148,7 @@ else
}
elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
{
print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).'</td><td colspan="3">';
print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).'</td><td>';
print yn($object->localtax1_assuj);
print '</td><tr>';
if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1)))
@@ -2162,7 +2170,7 @@ else
}
elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
{
print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td colspan="3">';
print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
print yn($object->localtax2_assuj);
print '</td><tr>';
if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2)))
@@ -2325,7 +2333,7 @@ else
if (! empty($conf->adherent->enabled))
{
$langs->load("members");
print '<tr><td width="25%" class="tdtop">'.$langs->trans("LinkedToDolibarrMember").'</td>';
print '<tr><td class="tdtop">'.$langs->trans("LinkedToDolibarrMember").'</td>';
print '<td colspan="3">';
$adh=new Adherent($db);
$result=$adh->fetch('','',$object->id);
@@ -2349,8 +2357,9 @@ else
}
print '</table>';
print '</div>';
print '</div></div></div>';
print '</div></div>';
print '<div style="clear:both"></div>';
dol_fiche_end();

View File

@@ -623,7 +623,7 @@ div.divphotoref {
div.statusref {
float: right;
padding-right: 12px;
margin-top: 9px;
margin-top: 7px;
margin-bottom: 10px;
}
img.photoref {
@@ -2137,6 +2137,10 @@ border: none;
padding-left: 4px;
font-weight: bold;
}
div.pagination li.litext a:hover {
background-color: transparent;
background-image: none;
}
<?php if (! empty($conf->dol_use_jmobile)) { ?>
div.pagination li.litext {
padding-top: 13px;

View File

@@ -673,7 +673,7 @@ div.divphotoref {
div.statusref {
float: right;
padding-right: 12px;
margin-top: 9px;
margin-top: 7px;
margin-bottom: 10px;
}
img.photoref {