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

@@ -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 (! 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.='<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>';
@@ -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="&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>';
}
/**