2
0
forked from Wavyzz/dolibarr

NEW: Add LinkedIn field

This commit is contained in:
Alexandre SPANGARO
2019-02-25 09:07:58 +01:00
parent 26168f0de5
commit acb9cfe07a
17 changed files with 185 additions and 34 deletions

View File

@@ -305,6 +305,7 @@ if (empty($reshook))
$object->skype = trim(GETPOST("skype", 'alpha'));
$object->twitter = trim(GETPOST("twitter", 'alpha'));
$object->facebook = trim(GETPOST("facebook", 'alpha'));
$object->linkedin = trim(GETPOST("linkedin", 'alpha'));
$object->birth = $birthdate;
$object->typeid = GETPOST("typeid", 'int');
@@ -450,6 +451,7 @@ if (empty($reshook))
$skype=GETPOST("member_skype", 'alpha');
$twitter=GETPOST("member_twitter", 'alpha');
$facebook=GETPOST("member_facebook", 'alpha');
$linkedin=GETPOST("member_linkedin", 'alpha');
$email=preg_replace('/\s+/', '', GETPOST("member_email", 'alpha'));
$login=GETPOST("member_login", 'alpha');
$pass=GETPOST("password", 'alpha');
@@ -479,6 +481,7 @@ if (empty($reshook))
$object->skype = $skype;
$object->twitter = $twitter;
$object->facebook = $facebook;
$object->linkedin = $linkedin;
$object->email = $email;
$object->login = $login;
@@ -1029,6 +1032,12 @@ else
print '<tr><td>'.$langs->trans("Facebook").'</td><td><input type="text" name="member_facebook" size="40" value="'.(GETPOST('member_facebook', 'alpha')?GETPOST('member_facebook', 'alpha'):$object->facebook).'"></td></tr>';
}
// LinkedIn
if (! empty($conf->socialnetworks->enabled))
{
print '<tr><td>'.$langs->trans("LinkedIn").'</td><td><input type="text" name="member_linkedin" size="40" value="'.(GETPOST('member_linkedin', 'alpha')?GETPOST('member_linkedin', 'alpha'):$object->linkedin).'"></td></tr>';
}
// Birthday
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
print $form->selectDate(($object->birth ? $object->birth : -1), 'birth', '', '', 1, 'formsoc');
@@ -1281,10 +1290,16 @@ else
}
// Facebook
if (! empty($conf->socialnetworks->enabled))
{
print '<tr><td>'.$langs->trans("Facebook").'</td><td><input type="text" name="facebook" class="minwidth100" value="'.(isset($_POST["facebook"])?GETPOST("facebook"):$object->facebook).'"></td></tr>';
}
if (! empty($conf->socialnetworks->enabled))
{
print '<tr><td>'.$langs->trans("Facebook").'</td><td><input type="text" name="facebook" class="minwidth100" value="'.(isset($_POST["facebook"])?GETPOST("facebook"):$object->facebook).'"></td></tr>';
}
// LinkedIn
if (! empty($conf->socialnetworks->enabled))
{
print '<tr><td>'.$langs->trans("LinkedIn").'</td><td><input type="text" name="linkedin" class="minwidth100" value="'.(isset($_POST["linkedin"])?GETPOST("linkedin"):$object->linkedin).'"></td></tr>';
}
// Birthday
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";

View File

@@ -137,6 +137,11 @@ class Adherent extends CommonObject
*/
public $facebook;
/**
* @var string linkedin account
*/
public $linkedin;
/**
* @var string Phone number
*/
@@ -550,6 +555,7 @@ class Adherent extends CommonObject
$sql.= ", skype = '".$this->db->escape($this->skype)."'";
$sql.= ", twitter = '".$this->db->escape($this->twitter)."'";
$sql.= ", facebook = '".$this->db->escape($this->facebook)."'";
$sql.= ", linkedin = '".$this->db->escape($this->linkedin)."'";
$sql.= ", phone = ".($this->phone?"'".$this->db->escape($this->phone)."'":"null");
$sql.= ", phone_perso = ".($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null");
$sql.= ", phone_mobile = ".($this->phone_mobile?"'".$this->db->escape($this->phone_mobile)."'":"null");
@@ -660,6 +666,7 @@ class Adherent extends CommonObject
$luser->skype=$this->skype;
$luser->twitter=$this->twitter;
$luser->facebook=$this->facebook;
$luser->linkedin=$this->linkedin;
$luser->office_phone=$this->phone;
$luser->user_mobile=$this->phone_mobile;
@@ -701,6 +708,7 @@ class Adherent extends CommonObject
$lthirdparty->skype=$this->skype;
$lthirdparty->twitter=$this->twitter;
$lthirdparty->facebook=$this->facebook;
$lthirdparty->linkedin=$this->linkedin;
$lthirdparty->phone=$this->phone;
$lthirdparty->state_id=$this->state_id;
$lthirdparty->country_id=$this->country_id;
@@ -1189,7 +1197,7 @@ class Adherent extends CommonObject
$sql = "SELECT d.rowid, d.ref_ext, d.civility as civility_id, d.gender, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note_private,";
$sql.= " d.note_public,";
$sql.= " d.email, d.skype, d.twitter, d.facebook, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass, d.pass_crypted,";
$sql.= " d.email, d.skype, d.twitter, d.facebook, d.linkedin, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass, d.pass_crypted,";
$sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,";
$sql.= " d.datec as datec,";
$sql.= " d.tms as datem,";
@@ -1266,6 +1274,7 @@ class Adherent extends CommonObject
$this->skype = $obj->skype;
$this->twitter = $obj->twitter;
$this->facebook = $obj->facebook;
$this->linkedin = $obj->linkedin;
$this->photo = $obj->photo;
$this->statut = $obj->statut;
@@ -2362,6 +2371,7 @@ class Adherent extends CommonObject
$this->skype = 'skypepseudo';
$this->twitter = 'twitterpseudo';
$this->facebook = 'facebookpseudo';
$this->linkedin = 'linkedinpseudo';
$this->phone = '0999999999';
$this->phone_perso = '0999999998';
$this->phone_mobile = '0999999997';
@@ -2469,8 +2479,9 @@ class Adherent extends CommonObject
if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code;
if ($this->skype && ! empty($conf->global->LDAP_MEMBER_FIELD_SKYPE)) $info[$conf->global->LDAP_MEMBER_FIELD_SKYPE] = $this->skype;
if ($this->twitter && ! empty($conf->global->LDAP_MEMBER_FIELD_TWITTER)) $info[$conf->global->LDAP_MEMBER_FIELD_TWITTER] = $this->twitter;
if ($this->facebook && ! empty($conf->global->LDAP_MEMBER_FIELD_FACEBOOK)) $info[$conf->global->LDAP_MEMBER_FIELD_FACEBOOK] = $this->facebook;
if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone;
if ($this->facebook && ! empty($conf->global->LDAP_MEMBER_FIELD_FACEBOOK)) $info[$conf->global->LDAP_MEMBER_FIELD_FACEBOOK] = $this->facebook;
if ($this->linkedin && ! empty($conf->global->LDAP_MEMBER_FIELD_LINKEDIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LINKEDIN] = $this->linkedin;
if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone;
if ($this->phone_perso && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso;
if ($this->phone_mobile && ! empty($conf->global->LDAP_MEMBER_FIELD_MOBILE)) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile;
if ($this->fax && ! empty($conf->global->LDAP_MEMBER_FIELD_FAX)) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax;

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -96,7 +97,7 @@ dol_fiche_head($head, 'setup', '', 0, 'user');
print '<br>';
$arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook');
$arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook', 'linkedin'=>'LinkedIn');
foreach($arrayofsocialnetworks as $snkey => $snlabel) {
$consttocheck = 'SOCIALNETWORKS_'.strtoupper($snkey);

View File

@@ -189,6 +189,7 @@ if (empty($reshook))
$object->skype = GETPOST("skype", 'alpha');
$object->twitter = GETPOST("twitter", 'alpha');
$object->facebook = GETPOST("facebook", 'alpha');
$object->linkedin = GETPOST("linkedin", 'alpha');
$object->email = GETPOST("email", 'alpha');
$object->phone_pro = GETPOST("phone_pro", 'alpha');
$object->phone_perso = GETPOST("phone_perso", 'alpha');
@@ -362,6 +363,7 @@ if (empty($reshook))
$object->skype = GETPOST("skype", 'alpha');
$object->twitter = GETPOST("twitter", 'alpha');
$object->facebook = GETPOST("facebook", 'alpha');
$object->linkedin = GETPOST("linkedin", 'alpha');
$object->phone_pro = GETPOST("phone_pro", 'alpha');
$object->phone_perso = GETPOST("phone_perso", 'alpha');
$object->phone_mobile = GETPOST("phone_mobile", 'alpha');
@@ -698,6 +700,12 @@ else
print '<tr><td><label for="facebook">'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'</label></td>';
print '<td colspan="3"><input type="text" name="facebook" id="facebook" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("facebook")?GETPOST("facebook", 'alpha'):$object->facebook).'"></td></tr>';
}
// LinkedIn
if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN))
{
print '<tr><td><label for="linkedin">'.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).'</label></td>';
print '<td colspan="3"><input type="text" name="linkedin" id="linkedin" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("linkedin")?GETPOST("linkedin", 'alpha'):$object->linkedin.'"></td></tr>';
}
}
// Visibility
@@ -979,11 +987,17 @@ else
print '<td><input type="text" name="twitter" id="twitter" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("twitter")?GETPOST("twitter", 'alpha'):$object->twitter).'"></td></tr>';
}
// Facebook
if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
{
print '<tr><td><label for="facebook">'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'</label></td>';
print '<td><input type="text" name="facebook" id="facebook" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOST("facebook")?GETPOST("facebook", 'alpha'):$object->facebook).'"></td></tr>';
}
if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
{
print '<tr><td><label for="facebook">'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'</label></td>';
print '<td><input type="text" name="facebook" id="facebook" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOST("facebook")?GETPOST("facebook", 'alpha'):$object->facebook).'"></td></tr>';
}
// LinkedIn
if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN))
{
print '<tr><td><label for="linkedin">'.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).'</label></td>';
print '<td><input type="text" name="linkedin" id="linkedin" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOST("linkedin")?GETPOST("linkedin", 'alpha'):$object->linkedin).'"></td></tr>';
}
}
// Visibility

View File

@@ -359,6 +359,7 @@ class Contact extends CommonObject
$sql .= ", skype='".$this->db->escape($this->skype)."'";
$sql .= ", twitter='".$this->db->escape($this->twitter)."'";
$sql .= ", facebook='".$this->db->escape($this->facebook)."'";
$sql .= ", linkedin='".$this->db->escape($this->linkedin)."'";
$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");
@@ -455,6 +456,11 @@ class Contact extends CommonObject
$tmpobj->facebook = $this->facebook;
$usermustbemodified++;
}
if ($tmpobj->linkedin != $this->linkedin)
{
$tmpobj->linkedin = $this->linkedin;
$usermustbemodified++;
}
if ($usermustbemodified)
{
$result=$tmpobj->update($user, 0, 1, 1, 1);
@@ -705,7 +711,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, c.twitter, c.facebook,";
$sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype, c.twitter, c.facebook, c.linkedin,";
$sql.= " c.photo,";
$sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.canvas,";
$sql.= " c.import_key,";
@@ -779,6 +785,7 @@ class Contact extends CommonObject
$this->skype = $obj->skype;
$this->twitter = $obj->twitter;
$this->facebook = $obj->facebook;
$this->linkedin = $obj->linkedin;
$this->photo = $obj->photo;
$this->priv = $obj->priv;
$this->mail = $obj->email;

View File

@@ -70,6 +70,7 @@ $search_email=GETPOST("search_email", 'alpha');
$search_skype=GETPOST("search_skype", 'alpha');
$search_twitter=GETPOST("search_twitter", 'alpha');
$search_facebook=GETPOST("search_facebook", 'alpha');
$search_linkedin=GETPOST("search_linkedin", 'alpha');
$search_priv=GETPOST("search_priv", 'alpha');
$search_categ=GETPOST("search_categ", 'int');
$search_categ_thirdparty=GETPOST("search_categ_thirdparty", 'int');
@@ -162,6 +163,7 @@ $arrayfields=array(
'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
'p.twitter'=>array('label'=>"Twitter", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
'p.facebook'=>array('label'=>"Facebook", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
'p.linkedin'=>array('label'=>"LinkedIn", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
'p.thirdparty'=>array('label'=>"ThirdParty", 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
'p.priv'=>array('label'=>"ContactVisibility", 'checked'=>1, 'position'=>200),
'p.datec'=>array('label'=>"DateCreationShort", 'checked'=>0, 'position'=>500),
@@ -224,6 +226,7 @@ if (empty($reshook))
$search_skype="";
$search_twitter="";
$search_facebook="";
$search_linkedin="";
$search_priv="";
$search_status=-1;
$search_categ='';
@@ -320,6 +323,7 @@ if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax);
if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype);
if (strlen($search_twitter)) $sql.= natural_search('p.twitter', $search_twitter);
if (strlen($search_facebook)) $sql.= natural_search('p.facebook', $search_facebook);
if (strlen($search_linkedin)) $sql.= natural_search('p.linkedin', $search_linkedin);
if (strlen($search_email)) $sql.= natural_search('p.email', $search_email);
if (strlen($search_zip)) $sql.= natural_search("p.zip", $search_zip);
if (strlen($search_town)) $sql.= natural_search("p.town", $search_town);
@@ -624,6 +628,12 @@ if (! empty($arrayfields['p.facebook']['checked']))
print '<input class="flat" type="text" name="search_facebook" size="6" value="'.dol_escape_htmltag($search_facebook).'">';
print '</td>';
}
if (! empty($arrayfields['p.linkedin']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_linkedin" size="6" value="'.dol_escape_htmltag($search_linkedin).'">';
print '</td>';
}
if (! empty($arrayfields['p.thirdparty']['checked']))
{
print '<td class="liste_titre">';
@@ -696,6 +706,7 @@ if (! empty($arrayfields['p.email']['checked'])) print_liste_field
if (! empty($arrayfields['p.skype']['checked'])) print_liste_field_titre($arrayfields['p.skype']['label'], $_SERVER["PHP_SELF"], "p.skype", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.twitter']['checked'])) print_liste_field_titre($arrayfields['p.twitter']['label'], $_SERVER["PHP_SELF"], "p.twitter", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.facebook']['checked'])) print_liste_field_titre($arrayfields['p.facebook']['label'], $_SERVER["PHP_SELF"], "p.facebook", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.linkedin']['checked'])) print_liste_field_titre($arrayfields['p.linkedin']['label'], $_SERVER["PHP_SELF"], "p.linkedin", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.thirdparty']['checked'])) print_liste_field_titre($arrayfields['p.thirdparty']['label'], $_SERVER["PHP_SELF"], "s.nom", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.priv']['checked'])) print_liste_field_titre($arrayfields['p.priv']['label'], $_SERVER["PHP_SELF"], "p.priv", $begin, $param, 'align="center"', $sortfield, $sortorder);
// Extra fields
@@ -843,12 +854,18 @@ while ($i < min($num, $limit))
if (! $i) $totalarray['nbfield']++;
}
// Facebook
if (! empty($arrayfields['p.facebook']['checked']))
{
if (! empty($conf->socialnetworks->enabled)) { print '<td>'.dol_print_socialnetworks($obj->facebook, $obj->rowid, $obj->socid, 'facebook').'</td>'; }
if (! $i) $totalarray['nbfield']++;
}
// Company
if (! empty($arrayfields['p.facebook']['checked']))
{
if (! empty($conf->socialnetworks->enabled)) { print '<td>'.dol_print_socialnetworks($obj->facebook, $obj->rowid, $obj->socid, 'facebook').'</td>'; }
if (! $i) $totalarray['nbfield']++;
}
// LinkedIn
if (! empty($arrayfields['p.linkedin']['checked']))
{
if (! empty($conf->socialnetworks->enabled)) { print '<td>'.dol_print_socialnetworks($obj->linkedin, $obj->rowid, $obj->socid, 'linkedin').'</td>'; }
if (! $i) $totalarray['nbfield']++;
}
// Company
if (! empty($arrayfields['p.thirdparty']['checked']))
{
print '<td>';

View File

@@ -672,6 +672,8 @@ abstract class CommonObject
$outdone++;
if ($this->facebook) $out.=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');
$outdone++;
}
$out.='</div>';

View File

@@ -2976,7 +2976,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (empty($srconly) && in_array($pictowithoutext, array(
'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
'note', 'sign-out', 'split', 'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow',
'jabber','skype','twitter','facebook'
'jabber','skype','twitter','facebook','linkedin'
)
)) {
$fakey = $pictowithoutext;

View File

@@ -94,4 +94,9 @@ ALTER TABLE llx_actioncomm ADD COLUMN calling_duration integer;
ALTER TABLE llx_don ADD COLUMN fk_soc integer NULL;
ALTER TABLE llx_payment_various ADD COLUMN subledger_account varchar(32);
ALTER TABLE llx_payment_various ADD COLUMN subledger_account varchar(32);
ALTER TABLE llx_societe ADD COLUMN linkedin varchar(255) after whatsapp;
ALTER TABLE llx_socpeople ADD COLUMN linkedin varchar(255) after whatsapp;
ALTER TABLE llx_adherent ADD COLUMN linkedin varchar(255) after whatsapp;
ALTER TABLE llx_user ADD COLUMN linkedin varchar(255) after whatsapp;

View File

@@ -51,6 +51,7 @@ create table llx_adherent
skype varchar(255),
twitter varchar(255), --
facebook varchar(255), --
linkedin varchar(255), --
instagram varchar(255), --
snapchat varchar(255), --
googleplus varchar(255), --

View File

@@ -54,6 +54,7 @@ create table llx_societe
skype varchar(255), --
twitter varchar(255), --
facebook varchar(255), --
linkedin varchar(255), --
instagram varchar(255), --
snapchat varchar(255), --
googleplus varchar(255), --

View File

@@ -46,6 +46,7 @@ create table llx_socpeople
skype varchar(255),
twitter varchar(255), --
facebook varchar(255), --
linkedin varchar(255), --
instagram varchar(255), --
snapchat varchar(255), --
googleplus varchar(255), --

View File

@@ -58,6 +58,7 @@ create table llx_user
skype varchar(255),
twitter varchar(255), --
facebook varchar(255), --
linkedin varchar(255), --
instagram varchar(255), --
snapchat varchar(255), --
googleplus varchar(255), --

View File

@@ -146,7 +146,7 @@ if (empty($reshook))
$object->client = $object->client | $soc_origin->client;
$object->fournisseur = $object->fournisseur | $soc_origin->fournisseur;
$listofproperties=array(
'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_pro', 'fax', 'email', 'skype', 'twitter', 'facebook', 'url', 'barcode',
'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_pro', 'fax', 'email', 'skype', 'twitter', 'facebook', 'linkedin', 'url', 'barcode',
'idprof1', 'idprof2', 'idprof3', 'idprof4', 'idprof5', 'idprof6',
'tva_intra', 'effectif_id', 'forme_juridique', 'remise_percent', 'remise_supplier_percent', 'mode_reglement_supplier_id', 'cond_reglement_supplier_id', 'name_bis',
'stcomm_id', 'outstanding_limit', 'price_level', 'parent', 'default_lang', 'ref', 'ref_ext', 'import_key', 'fk_incoterms', 'fk_multicurrency',
@@ -407,6 +407,7 @@ if (empty($reshook))
$object->skype = GETPOST('skype', 'alpha');
$object->twitter = GETPOST('twitter', 'alpha');
$object->facebook = GETPOST('facebook', 'alpha');
$object->linkedin = GETPOST('linkedin', 'alpha');
$object->phone = GETPOST('phone', 'alpha');
$object->fax = GETPOST('fax', 'alpha');
$object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL));
@@ -970,6 +971,7 @@ else
$object->skype = GETPOST('skype', 'alpha');
$object->twitter = GETPOST('twitter', 'alpha');
$object->facebook = GETPOST('facebook', 'alpha');
$object->linkedin = GETPOST('linkedin', 'alpha');
$object->phone = GETPOST('phone', 'alpha');
$object->fax = GETPOST('fax', 'alpha');
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
@@ -1304,13 +1306,21 @@ else
print '</td></tr>';
}
// Facebook
if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
{
print '<tr><td>'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'</td>';
print '<td colspan="3">';
print '<input type="text" name="facebook" class="minwidth100" maxlength="80" id="facebook" value="'.dol_escape_htmltag(GETPOSTISSET("facebook")?GETPOST("facebook", 'alpha'):$object->facebook).'">';
print '</td></tr>';
}
if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
{
print '<tr><td>'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'</td>';
print '<td colspan="3">';
print '<input type="text" name="facebook" class="minwidth100" maxlength="80" id="facebook" value="'.dol_escape_htmltag(GETPOSTISSET("facebook")?GETPOST("facebook", 'alpha'):$object->facebook).'">';
print '</td></tr>';
}
// LinkedIn
if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN))
{
print '<tr><td>'.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).'</td>';
print '<td colspan="3">';
print '<input type="text" name="linkedin" class="minwidth100" maxlength="80" id="linkedin" value="'.dol_escape_htmltag(GETPOSTISSET("linkedin")?GETPOST("linkedin", 'alpha'):$object->linkedin).'">';
print '</td></tr>';
}
}
// Phone / Fax
@@ -1591,6 +1601,7 @@ else
$object->skype = GETPOST('skype', 'alpha');
$object->twitter = GETPOST('twitter', 'alpha');
$object->facebook = GETPOST('facebook', 'alpha');
$object->linkedin = GETPOST('linkedin', 'alpha');
$object->phone = GETPOST('phone', 'alpha');
$object->fax = GETPOST('fax', 'alpha');
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
@@ -1916,6 +1927,12 @@ else
print '<tr><td>'.$form->editfieldkey('Facebook', 'facebook', '', $object, 0).'</td>';
print '<td colspan="3"><input type="text" name="facebook" id="facebook" value="'.$object->facebook.'"></td></tr>';
}
// LinkedIn
if (! empty($conf->global->SOCIALNETWORKS_LINKEDIN))
{
print '<tr><td>'.$form->editfieldkey('LinkedIn', 'linkedin', '', $object, 0).'</td>';
print '<td colspan="3"><input type="text" name="linkedin" id="linkedin" value="'.$object->linkedin.'"></td></tr>';
}
}
// Phone / Fax

View File

@@ -203,6 +203,11 @@ class Societe extends CommonObject
* @var string
*/
public $facebook;
/**
* LinkedIn username
* @var string
*/
public $linkedin;
/**
* Webpage
* @var string
@@ -848,6 +853,7 @@ class Societe extends CommonObject
$this->skype = trim($this->skype);
$this->twitter = trim($this->twitter);
$this->facebook = trim($this->facebook);
$this->linkedin = trim($this->linkedin);
$this->url = $this->url?clean_url($this->url, 0):'';
$this->note_private = trim($this->note_private);
$this->note_public = trim($this->note_public);
@@ -991,6 +997,7 @@ class Societe extends CommonObject
$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 .= ",linkedin = ".(! empty($this->linkedin)?"'".$this->db->escape($this->linkedin)."'":"null");
$sql .= ",url = ".(! empty($this->url)?"'".$this->db->escape($this->url)."'":"null");
$sql .= ",parent = " . ($this->parent > 0 ? $this->parent : "null");
@@ -1132,6 +1139,7 @@ class Societe extends CommonObject
$lmember->skype=$this->skype;
$lmember->twitter=$this->twitter;
$lmember->facebook=$this->facebook;
$lmember->linkedin=$this->linkedin;
$lmember->phone=$this->phone;
$result=$lmember->update($user, 0, 1, 1, 1); // Use nosync to 1 to avoid cyclic updates
@@ -1235,7 +1243,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.twitter, s.facebook, 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.linkedin, 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';
@@ -1332,6 +1340,7 @@ class Societe extends CommonObject
$this->skype = $obj->skype;
$this->twitter = $obj->twitter;
$this->facebook = $obj->facebook;
$this->linkedin = $obj->linkedin;
$this->url = $obj->url;
$this->phone = $obj->phone;
$this->fax = $obj->fax;
@@ -3337,6 +3346,7 @@ class Societe extends CommonObject
$this->skype=$member->skype;
$this->twitter=$member->twitter;
$this->facebook=$member->facebook;
$this->linkedin=$member->linkedin;
$this->client = 1; // A member is a customer by default
$this->code_client = ($customercode?$customercode:-1);
@@ -3480,6 +3490,7 @@ class Societe extends CommonObject
$this->skype='tom.hanson';
$this->twitter='tomhanson';
$this->facebook='tomhanson';
$this->linkedin='tomhanson';
$this->url='http://www.specimen.com';
$this->phone='0909090901';

View File

@@ -214,6 +214,7 @@ if (empty($reshook)) {
$object->skype = GETPOST("skype", 'alphanohtml');
$object->twitter = GETPOST("twitter", 'alphanohtml');
$object->facebook = GETPOST("facebook", 'alphanohtml');
$object->linkedin = GETPOST("linkedin", 'alphanohtml');
$object->email = preg_replace('/\s+/', '', GETPOST("email", 'alpha'));
$object->job = GETPOST("job", 'alpha');
@@ -364,6 +365,7 @@ if (empty($reshook)) {
$object->skype = GETPOST("skype", 'alpha');
$object->twitter = GETPOST("twitter", 'alpha');
$object->facebook = GETPOST("facebook", 'alpha');
$object->linkedin = GETPOST("linkedin", 'alpha');
$object->email = preg_replace('/\s+/', '', GETPOST("email", 'alpha'));
$object->job = GETPOST("job", 'alpha');
$object->signature = GETPOST("signature", 'none');
@@ -606,6 +608,7 @@ if (empty($reshook)) {
$ldap_skype = $attribute[$conf->global->LDAP_FIELD_SKYPE];
$ldap_twitter = $attribute[$conf->global->LDAP_FIELD_TWITTER];
$ldap_facebook = $attribute[$conf->global->LDAP_FIELD_FACEBOOK];
$ldap_linkedin = $attribute[$conf->global->LDAP_FIELD_LINKEDIN];
$ldap_mail = $attribute[$conf->global->LDAP_FIELD_MAIL];
$ldap_sid = $attribute[$conf->global->LDAP_FIELD_SID];
}
@@ -1067,6 +1070,23 @@ if ($action == 'create' || $action == 'adduserldap')
print '</td></tr>';
}
// LinkedIn
if (! empty($conf->socialnetworks->enabled))
{
print '<tr><td>'.$langs->trans("LinkedIn").'</td>';
print '<td>';
if (! empty($ldap_linkedin))
{
print '<input type="hidden" name="linkedin" value="'.$ldap_linkedin.'">';
print $ldap_linkedin;
}
else
{
print '<input class="maxwidth200" type="text" name="linkedin" value="'.GETPOST('linkedin', 'alpha').'">';
}
print '</td></tr>';
}
// EMail
print '<tr><td'.(! empty($conf->global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").'</td>';
print '<td>';
@@ -2287,7 +2307,7 @@ else
print '</td></tr>';
}
// Skype
// Facebook
if (! empty($conf->socialnetworks->enabled))
{
print '<tr><td>'.$langs->trans("Facebook").'</td>';
@@ -2304,6 +2324,23 @@ else
print '</td></tr>';
}
// LinkedIn
if (! empty($conf->socialnetworks->enabled))
{
print '<tr><td>'.$langs->trans("LinkedIn").'</td>';
print '<td>';
if ($caneditfield && empty($object->ldap_sid))
{
print '<input size="40" type="text" name="linkedin" class="flat" value="'.$object->linkedin.'">';
}
else
{
print '<input type="hidden" name="linkedin" value="'.$object->linkedin.'">';
print $object->linkedin;
}
print '</td></tr>';
}
// EMail
print "<tr>".'<td'.(! empty($conf->global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").'</td>';
print '<td>';

View File

@@ -73,6 +73,7 @@ class User extends CommonObject
public $skype;
public $twitter;
public $facebook;
public $linkedin;
public $job; // job position
public $signature;
@@ -227,7 +228,7 @@ class User extends CommonObject
$login=trim($login);
// Get user
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.job, u.skype, u.twitter, u.facebook,";
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.job, u.skype, u.twitter, u.facebook, u.linkedin,";
$sql.= " u.signature, u.office_phone, u.office_fax, u.user_mobile,";
$sql.= " u.address, u.zip, u.town, u.fk_state as state_id, u.fk_country as country_id,";
$sql.= " u.admin, u.login, u.note,";
@@ -335,6 +336,7 @@ class User extends CommonObject
$this->skype = $obj->skype;
$this->twitter = $obj->twitter;
$this->facebook = $obj->facebook;
$this->linkedin = $obj->linkedin;
$this->job = $obj->job;
$this->signature = $obj->signature;
$this->admin = $obj->admin;
@@ -1252,6 +1254,7 @@ class User extends CommonObject
$this->skype = $contact->skype;
$this->twitter = $contact->twitter;
$this->facebook = $contact->facebook;
$this->linkedin = $contact->linkedin;
$this->office_phone = $contact->phone_pro;
$this->office_fax = $contact->fax;
$this->user_mobile = $contact->phone_mobile;
@@ -1469,6 +1472,7 @@ class User extends CommonObject
$this->skype = trim($this->skype);
$this->twitter = trim($this->twitter);
$this->facebook = trim($this->facebook);
$this->linkedin = trim($this->linkedin);
$this->job = trim($this->job);
$this->signature = trim($this->signature);
@@ -1521,6 +1525,7 @@ class User extends CommonObject
$sql.= ", skype = '".$this->db->escape($this->skype)."'";
$sql.= ", twitter = '".$this->db->escape($this->twitter)."'";
$sql.= ", facebook = '".$this->db->escape($this->facebook)."'";
$sql.= ", linkedin = '".$this->db->escape($this->linkedin)."'";
$sql.= ", job = '".$this->db->escape($this->job)."'";
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
@@ -1609,6 +1614,7 @@ class User extends CommonObject
$adh->skype=$this->skype;
$adh->twitter=$this->twitter;
$adh->facebook=$this->facebook;
$adh->linkedin=$this->linkedin;
$adh->phone=$this->office_phone;
$adh->phone_mobile=$this->user_mobile;
@@ -1661,6 +1667,7 @@ class User extends CommonObject
$tmpobj->skype=$this->skype;
$tmpobj->twitter=$this->twitter;
$tmpobj->facebook=$this->facebook;
$tmpobj->linkedin=$this->linkedin;
$tmpobj->phone_pro=$this->office_phone;
$tmpobj->phone_mobile=$this->user_mobile;
@@ -2528,7 +2535,8 @@ $mailfile = new CMailFile(
'LDAP_FIELD_SID' => 'ldap_sid',
'LDAP_FIELD_SKYPE' => 'skype',
'LDAP_FIELD_TWITTER' => 'twitter',
'LDAP_FIELD_FACEBOOK' => 'facebook'
'LDAP_FIELD_FACEBOOK' => 'facebook',
'LDAP_FIELD_LINKEDIN' => 'linkedin'
);
// Champs
@@ -2642,6 +2650,7 @@ $mailfile = new CMailFile(
$this->skype='skypepseudo';
$this->twitter='twitterpseudo';
$this->facebook='facebookpseudo';
$this->linkedin='linkedinpseudo';
$this->office_phone='0999999999';
$this->office_fax='0999999998';
$this->user_mobile='0999999997';
@@ -2796,6 +2805,7 @@ $mailfile = new CMailFile(
$this->skype=$ldapuser->{$conf->global->LDAP_FIELD_SKYPE};
$this->twitter=$ldapuser->{$conf->global->LDAP_FIELD_TWITTER};
$this->facebook=$ldapuser->{$conf->global->LDAP_FIELD_FACEBOOK};
$this->linkedin=$ldapuser->{$conf->global->LDAP_FIELD_LINKEDIN};
$this->ldap_sid=$ldapuser->{$conf->global->LDAP_FIELD_SID};
$this->job=$ldapuser->{$conf->global->LDAP_FIELD_TITLE};