diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 9e1757fdc5a..babc7e1453a 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -186,6 +186,8 @@ if (empty($reshook))
$object->country_id = GETPOST("country_id",'int');
$object->state_id = GETPOST("state_id",'int');
$object->skype = GETPOST("skype",'alpha');
+ $object->twitter = GETPOST("twitter",'alpha');
+ $object->facebook = GETPOST("facebook",'alpha');
$object->email = GETPOST("email",'alpha');
$object->phone_pro = GETPOST("phone_pro",'alpha');
$object->phone_perso = GETPOST("phone_perso",'alpha');
@@ -358,6 +360,8 @@ if (empty($reshook))
$object->email = GETPOST("email",'alpha');
$object->skype = GETPOST("skype",'alpha');
+ $object->twitter = GETPOST("twitter",'alpha');
+ $object->facebook = GETPOST("facebook",'alpha');
$object->phone_pro = GETPOST("phone_pro",'alpha');
$object->phone_perso = GETPOST("phone_perso",'alpha');
$object->phone_mobile = GETPOST("phone_mobile",'alpha');
@@ -658,13 +662,28 @@ else
// Instant message and no email
print '
| ';
- print 'jabberid).'"> |
';
+ print 'jabberid).'"> | ';
- // Skype
- if (! empty($conf->skype->enabled))
+ if (! empty($conf->socialnetworks->enabled))
{
- print ' | ';
- print 'skype).'"> |
';
+ // Skype
+ if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
+ {
+ print ' | ';
+ print 'skype).'"> |
';
+ }
+ // Twitter
+ if (! empty($conf->global->SOCIALNETWORKS_TWITTER))
+ {
+ print ' | ';
+ print 'twitter).'"> |
';
+ }
+ // Facebook
+ if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
+ {
+ print ' | ';
+ print 'facebook).'"> |
';
+ }
}
// Visibility
@@ -914,11 +933,26 @@ else
}
print '';
- // Skype
- if (! empty($conf->skype->enabled))
+ if (! empty($conf->socialnetworks->enabled))
{
- print ' | ';
- print 'skype).'"> |
';
+ // Skype
+ if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
+ {
+ print ' | ';
+ print 'skype).'"> |
';
+ }
+ // Twitter
+ if (! empty($conf->global->SOCIALNETWORKS_TWITTER))
+ {
+ print ' | ';
+ print 'twitter).'"> |
';
+ }
+ // Facebook
+ if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
+ {
+ print ' | ';
+ print 'facebook).'"> |
';
+ }
}
// Visibility
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index 4dc50a3d623..b8cadaa4632 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -354,6 +354,8 @@ class Contact extends CommonObject
$sql .= ", fax='".$this->db->escape($this->fax)."'";
$sql .= ", email='".$this->db->escape($this->email)."'";
$sql .= ", skype='".$this->db->escape($this->skype)."'";
+ $sql .= ", twitter='".$this->db->escape($this->twitter)."'";
+ $sql .= ", facebook='".$this->db->escape($this->facebook)."'";
$sql .= ", photo='".$this->db->escape($this->photo)."'";
$sql .= ", birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : "null");
$sql .= ", note_private = ".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null");
@@ -441,6 +443,16 @@ class Contact extends CommonObject
$tmpobj->skype = $this->skype;
$usermustbemodified++;
}
+ if ($tmpobj->twitter != $this->twitter)
+ {
+ $tmpobj->twitter = $this->twitter;
+ $usermustbemodified++;
+ }
+ if ($tmpobj->facebook != $this->facebook)
+ {
+ $tmpobj->facebook = $this->facebook;
+ $usermustbemodified++;
+ }
if ($usermustbemodified)
{
$result=$tmpobj->update($user, 0, 1, 1, 1);
@@ -690,7 +702,7 @@ class Contact extends CommonObject
$sql.= " c.fk_pays as country_id,";
$sql.= " c.fk_departement,";
$sql.= " c.birthday,";
- $sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype,";
+ $sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype, c.twitter, c.facebook,";
$sql.= " c.photo,";
$sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.no_email, c.canvas,";
$sql.= " c.import_key,";
@@ -756,6 +768,8 @@ class Contact extends CommonObject
$this->email = $obj->email;
$this->jabberid = $obj->jabberid;
$this->skype = $obj->skype;
+ $this->twitter = $obj->twitter;
+ $this->facebook = $obj->facebook;
$this->photo = $obj->photo;
$this->priv = $obj->priv;
$this->mail = $obj->email;
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index c6dc1f97760..ee4d05231ee 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -1244,7 +1244,7 @@ else
print '';
}
- // Email web
+ // Email / Web
print '| '.fieldLabel('EMail','email',$conf->global->SOCIETE_EMAIL_MANDATORY).' | ';
print ' |
';
print '| '.fieldLabel('Web','url').' | ';
@@ -1256,19 +1256,19 @@ else
if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
{
print '
| '.fieldLabel('Skype','skype').' | ';
- print ' |
';
+ print 'skype).'"> | ';
}
// Twitter
if (! empty($conf->global->SOCIALNETWORKS_TWITTER))
{
print '| '.fieldLabel('Twitter','twitter').' | ';
- print ' |
';
+ print 'twitter).'"> | ';
}
// Facebook
if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
{
print '| '.fieldLabel('Facebook','facebook').' | ';
- print ' |
';
+ print 'facebook).'"> | ';
}
}
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 9b7ee772cb6..7ee22384b39 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -186,6 +186,16 @@ class Societe extends CommonObject
* @var string
*/
public $skype;
+ /**
+ * Twitter username
+ * @var string
+ */
+ public $twitter;
+ /**
+ * Facebook username
+ * @var string
+ */
+ public $facebook;
/**
* Webpage
* @var string
@@ -811,6 +821,8 @@ class Societe extends CommonObject
$this->fax = preg_replace("/\./","",$this->fax);
$this->email = trim($this->email);
$this->skype = trim($this->skype);
+ $this->twitter = trim($this->twitter);
+ $this->facebook = trim($this->facebook);
$this->url = $this->url?clean_url($this->url,0):'';
$this->note_private = trim($this->note_private);
$this->note_public = trim($this->note_public);
@@ -934,6 +946,8 @@ class Societe extends CommonObject
$sql .= ",fax = ".(! empty($this->fax)?"'".$this->db->escape($this->fax)."'":"null");
$sql .= ",email = ".(! empty($this->email)?"'".$this->db->escape($this->email)."'":"null");
$sql .= ",skype = ".(! empty($this->skype)?"'".$this->db->escape($this->skype)."'":"null");
+ $sql .= ",twitter = ".(! empty($this->twitter)?"'".$this->db->escape($this->twitter)."'":"null");
+ $sql .= ",facebook = ".(! empty($this->facebook)?"'".$this->db->escape($this->facebook)."'":"null");
$sql .= ",url = ".(! empty($this->url)?"'".$this->db->escape($this->url)."'":"null");
$sql .= ",parent = " . ($this->parent > 0 ? $this->parent : "null");
@@ -1059,6 +1073,8 @@ class Societe extends CommonObject
$lmember->address=$this->address;
$lmember->email=$this->email;
$lmember->skype=$this->skype;
+ $lmember->twitter=$this->twitter;
+ $lmember->facebook=$this->facebook;
$lmember->phone=$this->phone;
$result=$lmember->update($user,0,1,1,1); // Use nosync to 1 to avoid cyclic updates
@@ -1162,7 +1178,7 @@ class Societe extends CommonObject
$sql .= ', s.status';
$sql .= ', s.price_level';
$sql .= ', s.tms as date_modification, s.fk_user_creat, s.fk_user_modif';
- $sql .= ', s.phone, s.fax, s.email, s.skype, s.url, s.zip, s.town, s.note_private, s.note_public, s.model_pdf, s.client, s.fournisseur';
+ $sql .= ', s.phone, s.fax, s.email, s.skype, s.twitter, s.facebook, s.url, s.zip, s.town, s.note_private, s.note_public, s.model_pdf, s.client, s.fournisseur';
$sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6';
$sql .= ', s.capital, s.tva_intra';
$sql .= ', s.fk_typent as typent_id';
@@ -1255,6 +1271,8 @@ class Societe extends CommonObject
$this->email = $obj->email;
$this->skype = $obj->skype;
+ $this->twitter = $obj->twitter;
+ $this->facebook = $obj->facebook;
$this->url = $obj->url;
$this->phone = $obj->phone;
$this->fax = $obj->fax;
@@ -3221,6 +3239,8 @@ class Societe extends CommonObject
$this->phone=$member->phone; // Prof phone
$this->email=$member->email;
$this->skype=$member->skype;
+ $this->twitter=$member->twitter;
+ $this->facebook=$member->facebook;
$this->client = 1; // A member is a customer by default
$this->code_client = -1;
@@ -3360,6 +3380,8 @@ class Societe extends CommonObject
$this->country_code='FR';
$this->email='specimen@specimen.com';
$this->skype='tom.hanson';
+ $this->twitter='tomhanson';
+ $this->facebook='tomhanson';
$this->url='http://www.specimen.com';
$this->phone='0909090901';