diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index aba487ab4a0..544063bc4c8 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -621,7 +621,7 @@ abstract class CommonObject
$thirdpartyid = $object->fk_soc;
}
- $out = '';
+ $out = '';
$outdone = 0;
$coords = $this->getFullAddress(1, ', ', $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT);
@@ -682,7 +682,7 @@ abstract class CommonObject
$out .= dol_print_phone($this->office_fax, $this->country_code, $contactid, $thirdpartyid, 'AC_FAX', ' ', 'fax', $langs->trans("Fax")); $outdone++;
}
- $out .= '
';
+ if ($out) $out .= '';
$outdone = 0;
if (!empty($this->email))
{
@@ -695,32 +695,36 @@ abstract class CommonObject
$out .= dol_print_url($this->url, '_blank', 0, 1);
$outdone++;
}
- $out .= '';
+
if (!empty($conf->socialnetworks->enabled))
{
+ $outsocialnetwork = '';
+
if (is_array($this->socialnetworks) && count($this->socialnetworks) > 0) {
foreach ($this->socialnetworks as $key => $value) {
- $out .= dol_print_socialnetworks($value, $this->id, $object->id, $key);
+ $outsocialnetwork .= dol_print_socialnetworks($value, $this->id, $object->id, $key);
$outdone++;
}
} else {
- if ($this->skype) $out .= dol_print_socialnetworks($this->skype, $this->id, $object->id, 'skype');
+ if ($this->skype) $outsocialnetwork .= dol_print_socialnetworks($this->skype, $this->id, $object->id, 'skype');
$outdone++;
- if ($this->jabberid) $out .= dol_print_socialnetworks($this->jabberid, $this->id, $object->id, 'jabber');
+ if ($this->jabberid) $outsocialnetwork .= dol_print_socialnetworks($this->jabberid, $this->id, $object->id, 'jabber');
$outdone++;
- if ($this->twitter) $out .= dol_print_socialnetworks($this->twitter, $this->id, $object->id, 'twitter');
+ if ($this->twitter) $outsocialnetwork .= dol_print_socialnetworks($this->twitter, $this->id, $object->id, 'twitter');
$outdone++;
- if ($this->facebook) $out .= dol_print_socialnetworks($this->facebook, $this->id, $object->id, 'facebook');
+ if ($this->facebook) $outsocialnetwork .= dol_print_socialnetworks($this->facebook, $this->id, $object->id, 'facebook');
$outdone++;
- if ($this->linkedin) $out .= dol_print_socialnetworks($this->linkedin, $this->id, $object->id, 'linkedin');
+ if ($this->linkedin) $outsocialnetwork .= dol_print_socialnetworks($this->linkedin, $this->id, $object->id, 'linkedin');
$outdone++;
}
+
+ if ($outsocialnetwork) {
+ $out .= '
'.$outsocialnetwork.'
';
+ }
}
- $out .= '
';
- $out .= '';
-
- return $out;
+ if ($out) return ''."\n".$out.''."\n";
+ else return '';
}
/**
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 6306162af34..1d275e0f512 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1582,9 +1582,12 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
if (method_exists($object, 'getBannerAddress') && $object->element != 'product' && $object->element != 'bookmark' && $object->element != 'ecm_directories' && $object->element != 'ecm_files')
{
- $morehtmlref .= '';
- $morehtmlref .= $object->getBannerAddress('refaddress', $object);
- $morehtmlref .= '
';
+ $moreaddress = $object->getBannerAddress('refaddress', $object);
+ if ($moreaddress) {
+ $morehtmlref .= '';
+ $morehtmlref .= $moreaddress;
+ $morehtmlref .= '
';
+ }
}
if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && in_array($object->element, array('societe', 'contact', 'member', 'product')))
{
diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php
index 1dced508aec..0536ee41b8d 100644
--- a/htdocs/mrp/class/mo.class.php
+++ b/htdocs/mrp/class/mo.class.php
@@ -172,7 +172,7 @@ class Mo extends CommonObject
/**
* @var array List of child tables. To test if we can delete object.
*/
- protected $childtables=array('mrp_production');
+ protected $childtables=array();
/**
* @var array List of child tables. To know object to delete on cascade.
diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php
index 5822ce0d170..669102487d5 100644
--- a/htdocs/mrp/mo_agenda.php
+++ b/htdocs/mrp/mo_agenda.php
@@ -136,8 +136,9 @@ if ($object->id > 0)
// ------------------------------------------------------------
$linkback = ''.$langs->trans("BackToList").'';
- $morehtmlref = '';
+ $morehtmlref = '';
/*
+ $morehtmlref = '
';
// Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
@@ -175,9 +176,9 @@ if ($object->id > 0)
$morehtmlref.='';
}
}
- }*/
+ }
$morehtmlref .= '
';
-
+ */
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php
index 1a9fbe278a9..c177012a201 100644
--- a/htdocs/mrp/mo_note.php
+++ b/htdocs/mrp/mo_note.php
@@ -89,8 +89,9 @@ if ($id > 0 || ! empty($ref))
// ------------------------------------------------------------
$linkback = '
' . $langs->trans("BackToList") . '';
- $morehtmlref='
';
+ $morehtmlref = '';
/*
+ $morehtmlref='
';
// Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
@@ -128,9 +129,9 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='';
}
}
- }*/
+ }
$morehtmlref.='
';
-
+ */
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);