Merge pull request #11867 from frederic34/socialnetworks
NEW add socialnetworks dictionary
This commit is contained in:
commit
1aef1c60dd
@ -70,6 +70,8 @@ $extrafields = new ExtraFields($db);
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
$socialnetworks = getArrayOfSocialNetworks();
|
||||||
|
|
||||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||||
$object->getCanvas($id);
|
$object->getCanvas($id);
|
||||||
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
|
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
|
||||||
@ -302,10 +304,16 @@ if (empty($reshook))
|
|||||||
$object->phone_perso = trim(GETPOST("phone_perso", 'alpha'));
|
$object->phone_perso = trim(GETPOST("phone_perso", 'alpha'));
|
||||||
$object->phone_mobile= trim(GETPOST("phone_mobile", 'alpha'));
|
$object->phone_mobile= trim(GETPOST("phone_mobile", 'alpha'));
|
||||||
$object->email = preg_replace('/\s+/', '', GETPOST("member_email", 'alpha'));
|
$object->email = preg_replace('/\s+/', '', GETPOST("member_email", 'alpha'));
|
||||||
$object->skype = trim(GETPOST("skype", 'alpha'));
|
$object->socialnetworks = array();
|
||||||
$object->twitter = trim(GETPOST("twitter", 'alpha'));
|
foreach ($socialnetworks as $key => $value) {
|
||||||
$object->facebook = trim(GETPOST("facebook", 'alpha'));
|
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml')!='') {
|
||||||
$object->linkedin = trim(GETPOST("linkedin", 'alpha'));
|
$object->socialnetworks[$key] = trim(GETPOST($key, 'alphanohtml'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//$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->birth = $birthdate;
|
||||||
|
|
||||||
$object->typeid = GETPOST("typeid", 'int');
|
$object->typeid = GETPOST("typeid", 'int');
|
||||||
@ -448,10 +456,10 @@ if (empty($reshook))
|
|||||||
$phone=GETPOST("phone", 'alpha');
|
$phone=GETPOST("phone", 'alpha');
|
||||||
$phone_perso=GETPOST("phone_perso", 'alpha');
|
$phone_perso=GETPOST("phone_perso", 'alpha');
|
||||||
$phone_mobile=GETPOST("phone_mobile", 'alpha');
|
$phone_mobile=GETPOST("phone_mobile", 'alpha');
|
||||||
$skype=GETPOST("member_skype", 'alpha');
|
// $skype=GETPOST("member_skype", 'alpha');
|
||||||
$twitter=GETPOST("member_twitter", 'alpha');
|
// $twitter=GETPOST("member_twitter", 'alpha');
|
||||||
$facebook=GETPOST("member_facebook", 'alpha');
|
// $facebook=GETPOST("member_facebook", 'alpha');
|
||||||
$linkedin=GETPOST("member_linkedin", 'alpha');
|
// $linkedin=GETPOST("member_linkedin", 'alpha');
|
||||||
$email=preg_replace('/\s+/', '', GETPOST("member_email", 'alpha'));
|
$email=preg_replace('/\s+/', '', GETPOST("member_email", 'alpha'));
|
||||||
$login=GETPOST("member_login", 'alpha');
|
$login=GETPOST("member_login", 'alpha');
|
||||||
$pass=GETPOST("password", 'alpha');
|
$pass=GETPOST("password", 'alpha');
|
||||||
@ -478,11 +486,19 @@ if (empty($reshook))
|
|||||||
$object->phone = $phone;
|
$object->phone = $phone;
|
||||||
$object->phone_perso = $phone_perso;
|
$object->phone_perso = $phone_perso;
|
||||||
$object->phone_mobile= $phone_mobile;
|
$object->phone_mobile= $phone_mobile;
|
||||||
|
$object->socialnetworks = array();
|
||||||
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
|
foreach ($socialnetworks as $key => $value) {
|
||||||
|
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml')!='') {
|
||||||
|
$object->socialnetworks[$key] = GETPOST("member_".$key, 'alphanohtml');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$object->skype = $skype;
|
// $object->skype = $skype;
|
||||||
$object->twitter = $twitter;
|
// $object->twitter = $twitter;
|
||||||
$object->facebook = $facebook;
|
// $object->facebook = $facebook;
|
||||||
$object->linkedin = $linkedin;
|
// $object->linkedin = $linkedin;
|
||||||
|
|
||||||
$object->email = $email;
|
$object->email = $email;
|
||||||
$object->login = $login;
|
$object->login = $login;
|
||||||
@ -1028,28 +1044,11 @@ else
|
|||||||
// Mobile phone
|
// Mobile phone
|
||||||
print '<tr><td>'.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOST('phone_mobile', 'alpha')?GETPOST('phone_mobile', 'alpha'):$object->phone_mobile).'"></td></tr>';
|
print '<tr><td>'.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(GETPOST('phone_mobile', 'alpha')?GETPOST('phone_mobile', 'alpha'):$object->phone_mobile).'"></td></tr>';
|
||||||
|
|
||||||
// Skype
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
foreach ($socialnetworks as $key => $value) {
|
||||||
{
|
if (!$value['active']) break;
|
||||||
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="member_skype" size="40" value="'.(GETPOST('member_skype', 'alpha')?GETPOST('member_skype', 'alpha'):$object->skype).'"></td></tr>';
|
print '<tr><td>'.$langs->trans($value['label']).'</td><td><input type="text" name="member_'.$key.'" size="40" value="'.(GETPOST('member_'.$key, 'alpha')?GETPOST('member_'.$key, 'alpha'):$object->socialnetworks[$key]).'"></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Twitter
|
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
|
||||||
{
|
|
||||||
print '<tr><td>'.$langs->trans("Twitter").'</td><td><input type="text" name="member_twitter" size="40" value="'.(GETPOST('member_twitter', 'alpha')?GETPOST('member_twitter', 'alpha'):$object->twitter).'"></td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Facebook
|
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
|
||||||
{
|
|
||||||
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>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Birth Date
|
// Birth Date
|
||||||
@ -1297,28 +1296,11 @@ else
|
|||||||
// Mobile phone
|
// Mobile phone
|
||||||
print '<tr><td>'.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?GETPOST("phone_mobile"):$object->phone_mobile).'"></td></tr>';
|
print '<tr><td>'.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?GETPOST("phone_mobile"):$object->phone_mobile).'"></td></tr>';
|
||||||
|
|
||||||
// Skype
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
foreach ($socialnetworks as $key => $value) {
|
||||||
{
|
if (!$value['active']) break;
|
||||||
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="skype" class="minwidth100" value="'.(isset($_POST["skype"])?GETPOST("skype"):$object->skype).'"></td></tr>';
|
print '<tr><td>'.$langs->trans($value['label']).'</td><td><input type="text" name="'.$key.'" class="minwidth100" value="'.(isset($_POST[$key])?GETPOST($key):$object->socialnetworks[$key]).'"></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Twitter
|
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
|
||||||
{
|
|
||||||
print '<tr><td>'.$langs->trans("Twitter").'</td><td><input type="text" name="twitter" class="minwidth100" value="'.(isset($_POST["twitter"])?GETPOST("twitter"):$object->twitter).'"></td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Birth Date
|
// Birth Date
|
||||||
|
|||||||
@ -124,23 +124,32 @@ class Adherent extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $email;
|
public $email;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array array of socialnetworks
|
||||||
|
*/
|
||||||
|
public $socialnetworks;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string skype account
|
* @var string skype account
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public $skype;
|
public $skype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string twitter account
|
* @var string twitter account
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public $twitter;
|
public $twitter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string facebook account
|
* @var string facebook account
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public $facebook;
|
public $facebook;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string linkedin account
|
* @var string linkedin account
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public $linkedin;
|
public $linkedin;
|
||||||
|
|
||||||
@ -566,10 +575,7 @@ class Adherent extends CommonObject
|
|||||||
$sql.= ", country = ".($this->country_id>0?$this->db->escape($this->country_id):"null");
|
$sql.= ", country = ".($this->country_id>0?$this->db->escape($this->country_id):"null");
|
||||||
$sql.= ", state_id = ".($this->state_id>0?$this->db->escape($this->state_id):"null");
|
$sql.= ", state_id = ".($this->state_id>0?$this->db->escape($this->state_id):"null");
|
||||||
$sql.= ", email = '".$this->db->escape($this->email)."'";
|
$sql.= ", email = '".$this->db->escape($this->email)."'";
|
||||||
$sql.= ", skype = '".$this->db->escape($this->skype)."'";
|
$sql.= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'";
|
||||||
$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 = ".($this->phone?"'".$this->db->escape($this->phone)."'":"null");
|
||||||
$sql.= ", phone_perso = ".($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"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");
|
$sql.= ", phone_mobile = ".($this->phone_mobile?"'".$this->db->escape($this->phone_mobile)."'":"null");
|
||||||
@ -694,10 +700,7 @@ class Adherent extends CommonObject
|
|||||||
$luser->state_id=$this->state_id;
|
$luser->state_id=$this->state_id;
|
||||||
|
|
||||||
$luser->email=$this->email;
|
$luser->email=$this->email;
|
||||||
$luser->skype=$this->skype;
|
$luser->socialnetworks=$this->socialnetworks;
|
||||||
$luser->twitter=$this->twitter;
|
|
||||||
$luser->facebook=$this->facebook;
|
|
||||||
$luser->linkedin=$this->linkedin;
|
|
||||||
$luser->office_phone=$this->phone;
|
$luser->office_phone=$this->phone;
|
||||||
$luser->user_mobile=$this->phone_mobile;
|
$luser->user_mobile=$this->phone_mobile;
|
||||||
|
|
||||||
@ -736,10 +739,7 @@ class Adherent extends CommonObject
|
|||||||
$lthirdparty->zip=$this->zip;
|
$lthirdparty->zip=$this->zip;
|
||||||
$lthirdparty->town=$this->town;
|
$lthirdparty->town=$this->town;
|
||||||
$lthirdparty->email=$this->email;
|
$lthirdparty->email=$this->email;
|
||||||
$lthirdparty->skype=$this->skype;
|
$lthirdparty->socialnetworks=$this->socialnetworks;
|
||||||
$lthirdparty->twitter=$this->twitter;
|
|
||||||
$lthirdparty->facebook=$this->facebook;
|
|
||||||
$lthirdparty->linkedin=$this->linkedin;
|
|
||||||
$lthirdparty->phone=$this->phone;
|
$lthirdparty->phone=$this->phone;
|
||||||
$lthirdparty->state_id=$this->state_id;
|
$lthirdparty->state_id=$this->state_id;
|
||||||
$lthirdparty->country_id=$this->country_id;
|
$lthirdparty->country_id=$this->country_id;
|
||||||
@ -1228,7 +1228,7 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
$sql = "SELECT d.rowid, d.ref_ext, d.civility as civility_code, 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 = "SELECT d.rowid, d.ref_ext, d.civility as civility_code, 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.note_public,";
|
||||||
$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.email, d.socialnetworks, 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.photo, d.fk_adherent_type, d.morphy, d.entity,";
|
||||||
$sql.= " d.datec as datec,";
|
$sql.= " d.datec as datec,";
|
||||||
$sql.= " d.tms as datem,";
|
$sql.= " d.tms as datem,";
|
||||||
@ -1307,10 +1307,7 @@ class Adherent extends CommonObject
|
|||||||
$this->phone_mobile = $obj->phone_mobile;
|
$this->phone_mobile = $obj->phone_mobile;
|
||||||
$this->email = $obj->email;
|
$this->email = $obj->email;
|
||||||
|
|
||||||
$this->skype = $obj->skype;
|
$this->socialnetworks = (array) json_decode($obj->socialnetworks, true);
|
||||||
$this->twitter = $obj->twitter;
|
|
||||||
$this->facebook = $obj->facebook;
|
|
||||||
$this->linkedin = $obj->linkedin;
|
|
||||||
|
|
||||||
$this->photo = $obj->photo;
|
$this->photo = $obj->photo;
|
||||||
$this->statut = $obj->statut;
|
$this->statut = $obj->statut;
|
||||||
@ -2385,10 +2382,12 @@ class Adherent extends CommonObject
|
|||||||
$this->country = 'France';
|
$this->country = 'France';
|
||||||
$this->morphy = 'mor';
|
$this->morphy = 'mor';
|
||||||
$this->email = 'specimen@specimen.com';
|
$this->email = 'specimen@specimen.com';
|
||||||
$this->skype = 'skypepseudo';
|
$this->socialnetworks = array(
|
||||||
$this->twitter = 'twitterpseudo';
|
'skype' => 'skypepseudo',
|
||||||
$this->facebook = 'facebookpseudo';
|
'twitter' => 'twitterpseudo',
|
||||||
$this->linkedin = 'linkedinpseudo';
|
'facebook' => 'facebookpseudo',
|
||||||
|
'linkedin' => 'linkedinpseudo',
|
||||||
|
);
|
||||||
$this->phone = '0999999999';
|
$this->phone = '0999999999';
|
||||||
$this->phone_perso = '0999999998';
|
$this->phone_perso = '0999999998';
|
||||||
$this->phone_mobile = '0999999997';
|
$this->phone_mobile = '0999999997';
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -88,7 +89,7 @@ $hookmanager->initHooks(array('admin'));
|
|||||||
// Put here declaration of dictionaries properties
|
// Put here declaration of dictionaries properties
|
||||||
|
|
||||||
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
||||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,32,33,34,0,6,0,29,0,7,24,28,17,35,36,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,37,0,25,0);
|
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,38,0,5,11,0,32,33,34,0,6,0,29,0,7,24,28,17,35,36,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,37,0,25,0);
|
||||||
|
|
||||||
// Name of SQL tables of dictionaries
|
// Name of SQL tables of dictionaries
|
||||||
$tabname=array();
|
$tabname=array();
|
||||||
@ -130,6 +131,7 @@ $tabname[34]= MAIN_DB_PREFIX."c_hrm_function";
|
|||||||
$tabname[35]= MAIN_DB_PREFIX."c_exp_tax_cat";
|
$tabname[35]= MAIN_DB_PREFIX."c_exp_tax_cat";
|
||||||
$tabname[36]= MAIN_DB_PREFIX."c_exp_tax_range";
|
$tabname[36]= MAIN_DB_PREFIX."c_exp_tax_range";
|
||||||
$tabname[37]= MAIN_DB_PREFIX."c_units";
|
$tabname[37]= MAIN_DB_PREFIX."c_units";
|
||||||
|
$tabname[38]= MAIN_DB_PREFIX."c_socialnetworks";
|
||||||
|
|
||||||
// Dictionary labels
|
// Dictionary labels
|
||||||
$tablib=array();
|
$tablib=array();
|
||||||
@ -170,6 +172,7 @@ $tablib[34]= "DictionaryFunction";
|
|||||||
$tablib[35]= "DictionaryExpenseTaxCat";
|
$tablib[35]= "DictionaryExpenseTaxCat";
|
||||||
$tablib[36]= "DictionaryExpenseTaxRange";
|
$tablib[36]= "DictionaryExpenseTaxRange";
|
||||||
$tablib[37]= "DictionaryMeasuringUnits";
|
$tablib[37]= "DictionaryMeasuringUnits";
|
||||||
|
$tablib[38]= "DictionarySocialNetworks";
|
||||||
|
|
||||||
// Requests to extract data
|
// Requests to extract data
|
||||||
$tabsql=array();
|
$tabsql=array();
|
||||||
@ -210,6 +213,7 @@ $tabsql[34]= "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PRE
|
|||||||
$tabsql[35]= "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c";
|
$tabsql[35]= "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c";
|
||||||
$tabsql[36]= "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_range r";
|
$tabsql[36]= "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_range r";
|
||||||
$tabsql[37]= "SELECT r.rowid, r.code, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX."c_units r";
|
$tabsql[37]= "SELECT r.rowid, r.code, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX."c_units r";
|
||||||
|
$tabsql[38]= "SELECT rowid, entity, code, label, url, icon, active FROM ".MAIN_DB_PREFIX."c_socialnetworks";
|
||||||
|
|
||||||
// Criteria to sort dictionaries
|
// Criteria to sort dictionaries
|
||||||
$tabsqlsort=array();
|
$tabsqlsort=array();
|
||||||
@ -250,6 +254,7 @@ $tabsqlsort[34]="code ASC";
|
|||||||
$tabsqlsort[35]="c.label ASC";
|
$tabsqlsort[35]="c.label ASC";
|
||||||
$tabsqlsort[36]="r.fk_c_exp_tax_cat ASC, r.range_ik ASC";
|
$tabsqlsort[36]="r.fk_c_exp_tax_cat ASC, r.range_ik ASC";
|
||||||
$tabsqlsort[37]="r.unit_type ASC, r.scale ASC, r.code ASC";
|
$tabsqlsort[37]="r.unit_type ASC, r.scale ASC, r.code ASC";
|
||||||
|
$tabsqlsort[38]="rowid, code ASC";
|
||||||
|
|
||||||
// Field names in select result for dictionary display
|
// Field names in select result for dictionary display
|
||||||
$tabfield=array();
|
$tabfield=array();
|
||||||
@ -290,6 +295,7 @@ $tabfield[34]= "code,label";
|
|||||||
$tabfield[35]= "label";
|
$tabfield[35]= "label";
|
||||||
$tabfield[36]= "range_ik,fk_c_exp_tax_cat";
|
$tabfield[36]= "range_ik,fk_c_exp_tax_cat";
|
||||||
$tabfield[37]= "code,label,short_label,unit_type,scale";
|
$tabfield[37]= "code,label,short_label,unit_type,scale";
|
||||||
|
$tabfield[38]= "code,label,url,icon,entity";
|
||||||
|
|
||||||
// Edit field names for editing a record
|
// Edit field names for editing a record
|
||||||
$tabfieldvalue=array();
|
$tabfieldvalue=array();
|
||||||
@ -330,6 +336,7 @@ $tabfieldvalue[34]= "code,label";
|
|||||||
$tabfieldvalue[35]= "label";
|
$tabfieldvalue[35]= "label";
|
||||||
$tabfieldvalue[36]= "range_ik,fk_c_exp_tax_cat";
|
$tabfieldvalue[36]= "range_ik,fk_c_exp_tax_cat";
|
||||||
$tabfieldvalue[37]= "code,label,short_label,unit_type,scale";
|
$tabfieldvalue[37]= "code,label,short_label,unit_type,scale";
|
||||||
|
$tabfieldvalue[38]= "code,label,url,icon";
|
||||||
|
|
||||||
// Field names in the table for inserting a record
|
// Field names in the table for inserting a record
|
||||||
$tabfieldinsert=array();
|
$tabfieldinsert=array();
|
||||||
@ -371,6 +378,7 @@ $tabfieldinsert[34]= "code,label";
|
|||||||
$tabfieldinsert[35]= "label";
|
$tabfieldinsert[35]= "label";
|
||||||
$tabfieldinsert[36]= "range_ik,fk_c_exp_tax_cat";
|
$tabfieldinsert[36]= "range_ik,fk_c_exp_tax_cat";
|
||||||
$tabfieldinsert[37]= "code,label,short_label,unit_type,scale";
|
$tabfieldinsert[37]= "code,label,short_label,unit_type,scale";
|
||||||
|
$tabfieldinsert[38]= "entity,code,label,url,icon";
|
||||||
|
|
||||||
// Rowid name of field depending if field is autoincrement on or off..
|
// Rowid name of field depending if field is autoincrement on or off..
|
||||||
// Use "" if id field is "rowid" and has autoincrement on
|
// Use "" if id field is "rowid" and has autoincrement on
|
||||||
@ -413,6 +421,7 @@ $tabrowid[34]= "rowid";
|
|||||||
$tabrowid[35]= "";
|
$tabrowid[35]= "";
|
||||||
$tabrowid[36]= "";
|
$tabrowid[36]= "";
|
||||||
$tabrowid[37]= "";
|
$tabrowid[37]= "";
|
||||||
|
$tabrowid[38]= "";
|
||||||
|
|
||||||
// Condition to show dictionary in setup page
|
// Condition to show dictionary in setup page
|
||||||
$tabcond=array();
|
$tabcond=array();
|
||||||
@ -453,6 +462,7 @@ $tabcond[34]= ! empty($conf->hrm->enabled);
|
|||||||
$tabcond[35]= ! empty($conf->expensereport->enabled);
|
$tabcond[35]= ! empty($conf->expensereport->enabled);
|
||||||
$tabcond[36]= ! empty($conf->expensereport->enabled);
|
$tabcond[36]= ! empty($conf->expensereport->enabled);
|
||||||
$tabcond[37]= ! empty($conf->product->enabled);
|
$tabcond[37]= ! empty($conf->product->enabled);
|
||||||
|
$tabcond[38]= ! empty($conf->socialnetworks->enabled);
|
||||||
|
|
||||||
// List of help for fields
|
// List of help for fields
|
||||||
$tabhelp=array();
|
$tabhelp=array();
|
||||||
@ -493,6 +503,7 @@ $tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode"));
|
|||||||
$tabhelp[35] = array();
|
$tabhelp[35] = array();
|
||||||
$tabhelp[36] = array('range_ik'=>$langs->trans('PrevRangeToThisRange'));
|
$tabhelp[36] = array('range_ik'=>$langs->trans('PrevRangeToThisRange'));
|
||||||
$tabhelp[37] = array('code'=>$langs->trans("EnterAnyCode"));
|
$tabhelp[37] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||||
|
$tabhelp[38] = array('code'=>$langs->trans("EnterAnyCode"), 'url' => $langs->trans('UrlSocialNetworksDesc'), 'icon' => $langs->trans('FafaIconSocialNetworksDesc'));
|
||||||
|
|
||||||
// List of check for fields (NOT USED YET)
|
// List of check for fields (NOT USED YET)
|
||||||
$tabfieldcheck=array();
|
$tabfieldcheck=array();
|
||||||
@ -533,6 +544,7 @@ $tabfieldcheck[34] = array();
|
|||||||
$tabfieldcheck[35] = array();
|
$tabfieldcheck[35] = array();
|
||||||
$tabfieldcheck[36] = array();
|
$tabfieldcheck[36] = array();
|
||||||
$tabfieldcheck[37] = array();
|
$tabfieldcheck[37] = array();
|
||||||
|
$tabfieldcheck[38] = array();
|
||||||
|
|
||||||
// Complete all arrays with entries found into modules
|
// Complete all arrays with entries found into modules
|
||||||
complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabfieldcheck);
|
complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabfieldcheck);
|
||||||
|
|||||||
@ -62,6 +62,8 @@ $extrafields = new ExtraFields($db);
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
$socialnetworks = getArrayOfSocialNetworks();
|
||||||
|
|
||||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||||
$object->getCanvas($id);
|
$object->getCanvas($id);
|
||||||
$objcanvas=null;
|
$objcanvas=null;
|
||||||
@ -186,17 +188,25 @@ if (empty($reshook))
|
|||||||
$object->town = GETPOST("town", 'alpha');
|
$object->town = GETPOST("town", 'alpha');
|
||||||
$object->country_id = GETPOST("country_id", 'int');
|
$object->country_id = GETPOST("country_id", 'int');
|
||||||
$object->state_id = GETPOST("state_id", 'int');
|
$object->state_id = GETPOST("state_id", 'int');
|
||||||
$object->skype = GETPOST("skype", 'alpha');
|
//$object->jabberid = GETPOST("jabberid", 'alpha');
|
||||||
$object->twitter = GETPOST("twitter", 'alpha');
|
//$object->skype = GETPOST("skype", 'alpha');
|
||||||
$object->facebook = GETPOST("facebook", 'alpha');
|
//$object->twitter = GETPOST("twitter", 'alpha');
|
||||||
$object->linkedin = GETPOST("linkedin", 'alpha');
|
//$object->facebook = GETPOST("facebook", 'alpha');
|
||||||
|
//$object->linkedin = GETPOST("linkedin", 'alpha');
|
||||||
|
$object->socialnetworks = array();
|
||||||
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
|
foreach ($socialnetworks as $key => $value) {
|
||||||
|
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml')!='') {
|
||||||
|
$object->socialnetworks[$key] = GETPOST($key, 'alphanohtml');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$object->email = GETPOST("email", 'alpha');
|
$object->email = GETPOST("email", 'alpha');
|
||||||
$object->no_email = GETPOST("no_email", "int");
|
$object->no_email = GETPOST("no_email", "int");
|
||||||
$object->phone_pro = GETPOST("phone_pro", 'alpha');
|
$object->phone_pro = GETPOST("phone_pro", 'alpha');
|
||||||
$object->phone_perso = GETPOST("phone_perso", 'alpha');
|
$object->phone_perso = GETPOST("phone_perso", 'alpha');
|
||||||
$object->phone_mobile = GETPOST("phone_mobile", 'alpha');
|
$object->phone_mobile = GETPOST("phone_mobile", 'alpha');
|
||||||
$object->fax = GETPOST("fax", 'alpha');
|
$object->fax = GETPOST("fax", 'alpha');
|
||||||
$object->jabberid = GETPOST("jabberid", 'alpha');
|
|
||||||
$object->priv = GETPOST("priv", 'int');
|
$object->priv = GETPOST("priv", 'int');
|
||||||
$object->note_public = GETPOST("note_public", 'none');
|
$object->note_public = GETPOST("note_public", 'none');
|
||||||
$object->note_private = GETPOST("note_private", 'none');
|
$object->note_private = GETPOST("note_private", 'none');
|
||||||
@ -378,15 +388,22 @@ if (empty($reshook))
|
|||||||
|
|
||||||
$object->email = GETPOST("email", 'alpha');
|
$object->email = GETPOST("email", 'alpha');
|
||||||
$object->no_email = GETPOST("no_email", "int");
|
$object->no_email = GETPOST("no_email", "int");
|
||||||
$object->skype = GETPOST("skype", 'alpha');
|
//$object->jabberid = GETPOST("jabberid", 'alpha');
|
||||||
$object->twitter = GETPOST("twitter", 'alpha');
|
//$object->skype = GETPOST("skype", 'alpha');
|
||||||
$object->facebook = GETPOST("facebook", 'alpha');
|
//$object->twitter = GETPOST("twitter", 'alpha');
|
||||||
$object->linkedin = GETPOST("linkedin", 'alpha');
|
//$object->facebook = GETPOST("facebook", 'alpha');
|
||||||
|
//$object->linkedin = GETPOST("linkedin", 'alpha');
|
||||||
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
|
foreach ($socialnetworks as $key => $value) {
|
||||||
|
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml')!='') {
|
||||||
|
$object->socialnetworks[$key] = GETPOST($key, 'alphanohtml');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$object->phone_pro = GETPOST("phone_pro", 'alpha');
|
$object->phone_pro = GETPOST("phone_pro", 'alpha');
|
||||||
$object->phone_perso = GETPOST("phone_perso", 'alpha');
|
$object->phone_perso = GETPOST("phone_perso", 'alpha');
|
||||||
$object->phone_mobile = GETPOST("phone_mobile", 'alpha');
|
$object->phone_mobile = GETPOST("phone_mobile", 'alpha');
|
||||||
$object->fax = GETPOST("fax", 'alpha');
|
$object->fax = GETPOST("fax", 'alpha');
|
||||||
$object->jabberid = GETPOST("jabberid", 'alpha');
|
|
||||||
$object->priv = GETPOST("priv", 'int');
|
$object->priv = GETPOST("priv", 'int');
|
||||||
$object->note_public = GETPOST("note_public", 'none');
|
$object->note_public = GETPOST("note_public", 'none');
|
||||||
$object->note_private = GETPOST("note_private", 'none');
|
$object->note_private = GETPOST("note_private", 'none');
|
||||||
@ -727,39 +744,53 @@ else
|
|||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
{
|
foreach ($socialnetworks as $key => $value) {
|
||||||
// Jabber
|
if ($value['active']) {
|
||||||
if (! empty($conf->global->SOCIALNETWORKS_JABBER))
|
print '<tr>';
|
||||||
{
|
print '<td><label for="'.$value['label'].'">'.$form->editfieldkey($value['label'], $key, '', $object, 0).'</label></td>';
|
||||||
print '<tr><td><label for="skype">'.$form->editfieldkey('Jabber', 'jabberid', '', $object, 0).'</label></td>';
|
print '<td colspan="3">';
|
||||||
print '<td colspan="3"><input type="text" name="jabberid" id="jabberid" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("jabberid")?GETPOST("jabberid", 'alpha'):$object->jabberid).'"></td></tr>';
|
print '<input type="text" name="'.$key.'" id="'.$key.'" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET($key)?GETPOST($key, 'alphanohtml'):$object->socialnetworks[$key]).'">';
|
||||||
}
|
print '</td>';
|
||||||
// Skype
|
print '</tr>';
|
||||||
if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
|
} elseif (!empty($object->socialnetworks[$key])) {
|
||||||
{
|
print '<input type="hidden" name="'.$key.'" value="'.$object->socialnetworks[$key].'">';
|
||||||
print '<tr><td><label for="skype">'.$form->editfieldkey('Skype', 'skype', '', $object, 0).'</label></td>';
|
|
||||||
print '<td colspan="3"><input type="text" name="skype" id="skype" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("skype")?GETPOST("skype", 'alpha'):$object->skype).'"></td></tr>';
|
|
||||||
}
|
|
||||||
// Twitter
|
|
||||||
if (! empty($conf->global->SOCIALNETWORKS_TWITTER))
|
|
||||||
{
|
|
||||||
print '<tr><td><label for="twitter">'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).'</label></td>';
|
|
||||||
print '<td colspan="3"><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 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>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// if (! empty($conf->socialnetworks->enabled))
|
||||||
|
// {
|
||||||
|
// // Jabber
|
||||||
|
// if (! empty($conf->global->SOCIALNETWORKS_JABBER))
|
||||||
|
// {
|
||||||
|
// print '<tr><td><label for="skype">'.$form->editfieldkey('Jabber', 'jabberid', '', $object, 0).'</label></td>';
|
||||||
|
// print '<td colspan="3"><input type="text" name="jabberid" id="jabberid" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("jabberid")?GETPOST("jabberid", 'alpha'):$object->jabberid).'"></td></tr>';
|
||||||
|
// }
|
||||||
|
// // Skype
|
||||||
|
// if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
|
||||||
|
// {
|
||||||
|
// print '<tr><td><label for="skype">'.$form->editfieldkey('Skype', 'skype', '', $object, 0).'</label></td>';
|
||||||
|
// print '<td colspan="3"><input type="text" name="skype" id="skype" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("skype")?GETPOST("skype", 'alpha'):$object->skype).'"></td></tr>';
|
||||||
|
// }
|
||||||
|
// // Twitter
|
||||||
|
// if (! empty($conf->global->SOCIALNETWORKS_TWITTER))
|
||||||
|
// {
|
||||||
|
// print '<tr><td><label for="twitter">'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).'</label></td>';
|
||||||
|
// print '<td colspan="3"><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 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
|
// Visibility
|
||||||
print '<tr><td><label for="priv">'.$langs->trans("ContactVisibility").'</label></td><td colspan="3">';
|
print '<tr><td><label for="priv">'.$langs->trans("ContactVisibility").'</label></td><td colspan="3">';
|
||||||
@ -1028,39 +1059,53 @@ else
|
|||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
{
|
foreach ($socialnetworks as $key => $value) {
|
||||||
// Jabber ID
|
if ($value['active']) {
|
||||||
if (! empty($conf->global->SOCIALNETWORKS_JABBER))
|
print '<tr>';
|
||||||
{
|
print '<td><label for="'.$value['label'].'">'.$form->editfieldkey($value['label'], $key, '', $object, 0).'</label></td>';
|
||||||
print '<tr><td><label for="jabberid">'.$form->editfieldkey('Jabber', 'jabberid', '', $object, 0).'</label></td>';
|
print '<td colspan="3">';
|
||||||
print '<td><input type="text" name="jabberid" id="jabberid" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("jabberid")?GETPOST("jabberid", 'alpha'):$object->jabberid).'"></td></tr>';
|
print '<input type="text" name="'.$key.'" id="'.$key.'" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET($key)?GETPOST($key, 'alphanohtml'):$object->socialnetworks[$key]).'">';
|
||||||
}
|
print '</td>';
|
||||||
// Skype
|
print '</tr>';
|
||||||
if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
|
} elseif (!empty($object->socialnetworks[$key])) {
|
||||||
{
|
print '<input type="hidden" name="'.$key.'" value="'.$object->socialnetworks[$key].'">';
|
||||||
print '<tr><td><label for="skype">'.$form->editfieldkey('Skype', 'skype', '', $object, 0).'</label></td>';
|
|
||||||
print '<td><input type="text" name="skype" id="skype" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("skype")?GETPOST("skype", 'alpha'):$object->skype).'"></td></tr>';
|
|
||||||
}
|
|
||||||
// Twitter
|
|
||||||
if (! empty($conf->global->SOCIALNETWORKS_TWITTER))
|
|
||||||
{
|
|
||||||
print '<tr><td><label for="twitter">'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).'</label></td>';
|
|
||||||
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>';
|
|
||||||
}
|
|
||||||
// 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>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// if (! empty($conf->socialnetworks->enabled))
|
||||||
|
// {
|
||||||
|
// // Jabber ID
|
||||||
|
// if (! empty($conf->global->SOCIALNETWORKS_JABBER))
|
||||||
|
// {
|
||||||
|
// print '<tr><td><label for="jabberid">'.$form->editfieldkey('Jabber', 'jabberid', '', $object, 0).'</label></td>';
|
||||||
|
// print '<td><input type="text" name="jabberid" id="jabberid" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("jabberid")?GETPOST("jabberid", 'alpha'):$object->jabberid).'"></td></tr>';
|
||||||
|
// }
|
||||||
|
// // Skype
|
||||||
|
// if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
|
||||||
|
// {
|
||||||
|
// print '<tr><td><label for="skype">'.$form->editfieldkey('Skype', 'skype', '', $object, 0).'</label></td>';
|
||||||
|
// print '<td><input type="text" name="skype" id="skype" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("skype")?GETPOST("skype", 'alpha'):$object->skype).'"></td></tr>';
|
||||||
|
// }
|
||||||
|
// // Twitter
|
||||||
|
// if (! empty($conf->global->SOCIALNETWORKS_TWITTER))
|
||||||
|
// {
|
||||||
|
// print '<tr><td><label for="twitter">'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).'</label></td>';
|
||||||
|
// 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>';
|
||||||
|
// }
|
||||||
|
// // 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
|
// Visibility
|
||||||
print '<tr><td><label for="priv">'.$langs->trans("ContactVisibility").'</label></td><td colspan="3">';
|
print '<tr><td><label for="priv">'.$langs->trans("ContactVisibility").'</label></td><td colspan="3">';
|
||||||
|
|||||||
@ -83,6 +83,11 @@ class Contact extends CommonObject
|
|||||||
public $civility_id; // In fact we store civility_code
|
public $civility_id; // In fact we store civility_code
|
||||||
public $civility_code;
|
public $civility_code;
|
||||||
public $civility;
|
public $civility;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
public $address;
|
public $address;
|
||||||
public $zip;
|
public $zip;
|
||||||
public $town;
|
public $town;
|
||||||
@ -97,11 +102,60 @@ class Contact extends CommonObject
|
|||||||
public $statut; // 0=inactif, 1=actif
|
public $statut; // 0=inactif, 1=actif
|
||||||
|
|
||||||
public $code;
|
public $code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Email
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
public $email;
|
public $email;
|
||||||
public $no_email; // 1 = contact has globaly unsubscribe of all mass emailings
|
|
||||||
|
/**
|
||||||
|
* Unsuscribe all : 1 = contact has globaly unsubscribe of all mass emailings
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $no_email;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array array of socialnetworks
|
||||||
|
*/
|
||||||
|
public $socialnetworks;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skype username
|
||||||
|
* @var string
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
public $skype;
|
public $skype;
|
||||||
public $photo;
|
|
||||||
|
/**
|
||||||
|
* Twitter username
|
||||||
|
* @var string
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
public $twitter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Facebook username
|
||||||
|
* @var string
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
public $facebook;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Linkedin username
|
||||||
|
* @var string
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
public $linkedin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jabber username
|
||||||
|
* @var string
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
public $jabberid;
|
public $jabberid;
|
||||||
|
|
||||||
|
public $photo;
|
||||||
public $phone_pro;
|
public $phone_pro;
|
||||||
public $phone_perso;
|
public $phone_perso;
|
||||||
public $phone_mobile;
|
public $phone_mobile;
|
||||||
@ -123,6 +177,10 @@ class Contact extends CommonObject
|
|||||||
// END MODULEBUILDER PROPERTIES
|
// END MODULEBUILDER PROPERTIES
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Old copy
|
||||||
|
* @var Contact
|
||||||
|
*/
|
||||||
public $oldcopy; // To contains a clone of this when we need to save old properties of object
|
public $oldcopy; // To contains a clone of this when we need to save old properties of object
|
||||||
|
|
||||||
public $roles=array();
|
public $roles=array();
|
||||||
@ -345,10 +403,7 @@ class Contact extends CommonObject
|
|||||||
$sql .= ", poste='".$this->db->escape($this->poste)."'";
|
$sql .= ", poste='".$this->db->escape($this->poste)."'";
|
||||||
$sql .= ", fax='".$this->db->escape($this->fax)."'";
|
$sql .= ", fax='".$this->db->escape($this->fax)."'";
|
||||||
$sql .= ", email='".$this->db->escape($this->email)."'";
|
$sql .= ", email='".$this->db->escape($this->email)."'";
|
||||||
$sql .= ", skype='".$this->db->escape($this->skype)."'";
|
$sql .= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'";
|
||||||
$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 .= ", photo='".$this->db->escape($this->photo)."'";
|
||||||
$sql .= ", birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : "null");
|
$sql .= ", birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : "null");
|
||||||
$sql .= ", note_private = ".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null");
|
$sql .= ", note_private = ".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null");
|
||||||
@ -356,7 +411,6 @@ class Contact extends CommonObject
|
|||||||
$sql .= ", phone = ".(isset($this->phone_pro)?"'".$this->db->escape($this->phone_pro)."'":"null");
|
$sql .= ", phone = ".(isset($this->phone_pro)?"'".$this->db->escape($this->phone_pro)."'":"null");
|
||||||
$sql .= ", phone_perso = ".(isset($this->phone_perso)?"'".$this->db->escape($this->phone_perso)."'":"null");
|
$sql .= ", phone_perso = ".(isset($this->phone_perso)?"'".$this->db->escape($this->phone_perso)."'":"null");
|
||||||
$sql .= ", phone_mobile = ".(isset($this->phone_mobile)?"'".$this->db->escape($this->phone_mobile)."'":"null");
|
$sql .= ", phone_mobile = ".(isset($this->phone_mobile)?"'".$this->db->escape($this->phone_mobile)."'":"null");
|
||||||
$sql .= ", jabberid = ".(isset($this->jabberid)?"'".$this->db->escape($this->jabberid)."'":"null");
|
|
||||||
$sql .= ", priv = '".$this->db->escape($this->priv)."'";
|
$sql .= ", priv = '".$this->db->escape($this->priv)."'";
|
||||||
$sql .= ", statut = ".$this->db->escape($this->statut);
|
$sql .= ", statut = ".$this->db->escape($this->statut);
|
||||||
$sql .= ", fk_user_modif=".($user->id > 0 ? "'".$this->db->escape($user->id)."'":"NULL");
|
$sql .= ", fk_user_modif=".($user->id > 0 ? "'".$this->db->escape($user->id)."'":"NULL");
|
||||||
@ -439,29 +493,34 @@ class Contact extends CommonObject
|
|||||||
$tmpobj->email = $this->email;
|
$tmpobj->email = $this->email;
|
||||||
$usermustbemodified++;
|
$usermustbemodified++;
|
||||||
}
|
}
|
||||||
if ($tmpobj->skype != $this->skype)
|
if (!empty(array_diff($tmpobj->socialnetworks, $this->socialnetworks)))
|
||||||
{
|
{
|
||||||
$tmpobj->skype = $this->skype;
|
$tmpobj->socialnetworks = $this->socialnetworks;
|
||||||
$usermustbemodified++;
|
|
||||||
}
|
|
||||||
if ($tmpobj->twitter != $this->twitter)
|
|
||||||
{
|
|
||||||
$tmpobj->twitter = $this->twitter;
|
|
||||||
$usermustbemodified++;
|
|
||||||
}
|
|
||||||
if ($tmpobj->facebook != $this->facebook)
|
|
||||||
{
|
|
||||||
$tmpobj->facebook = $this->facebook;
|
|
||||||
$usermustbemodified++;
|
|
||||||
}
|
|
||||||
if ($tmpobj->linkedin != $this->linkedin)
|
|
||||||
{
|
|
||||||
$tmpobj->linkedin = $this->linkedin;
|
|
||||||
$usermustbemodified++;
|
$usermustbemodified++;
|
||||||
}
|
}
|
||||||
|
// if ($tmpobj->skype != $this->skype)
|
||||||
|
// {
|
||||||
|
// $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 ($tmpobj->linkedin != $this->linkedin)
|
||||||
|
// {
|
||||||
|
// $tmpobj->linkedin = $this->linkedin;
|
||||||
|
// $usermustbemodified++;
|
||||||
|
// }
|
||||||
if ($usermustbemodified)
|
if ($usermustbemodified)
|
||||||
{
|
{
|
||||||
$result=$tmpobj->update($user, 0, 1, 1, 1);
|
$result = $tmpobj->update($user, 0, 1, 1, 1);
|
||||||
if ($result < 0) { $error++; }
|
if ($result < 0) { $error++; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -713,7 +772,8 @@ class Contact extends CommonObject
|
|||||||
$sql.= " c.fk_pays as country_id,";
|
$sql.= " c.fk_pays as country_id,";
|
||||||
$sql.= " c.fk_departement as state_id,";
|
$sql.= " c.fk_departement as state_id,";
|
||||||
$sql.= " c.birthday,";
|
$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, c.linkedin,";
|
$sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email,";
|
||||||
|
$sql.= " c.socialnetworks,";
|
||||||
$sql.= " c.photo,";
|
$sql.= " c.photo,";
|
||||||
$sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.canvas,";
|
$sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.canvas,";
|
||||||
$sql.= " c.import_key,";
|
$sql.= " c.import_key,";
|
||||||
@ -782,11 +842,7 @@ class Contact extends CommonObject
|
|||||||
$this->phone_mobile = trim($obj->phone_mobile);
|
$this->phone_mobile = trim($obj->phone_mobile);
|
||||||
|
|
||||||
$this->email = $obj->email;
|
$this->email = $obj->email;
|
||||||
$this->jabberid = $obj->jabberid;
|
$this->socialnetworks = (array) json_decode($obj->socialnetworks, true);
|
||||||
$this->skype = $obj->skype;
|
|
||||||
$this->twitter = $obj->twitter;
|
|
||||||
$this->facebook = $obj->facebook;
|
|
||||||
$this->linkedin = $obj->linkedin;
|
|
||||||
$this->photo = $obj->photo;
|
$this->photo = $obj->photo;
|
||||||
$this->priv = $obj->priv;
|
$this->priv = $obj->priv;
|
||||||
$this->mail = $obj->email;
|
$this->mail = $obj->email;
|
||||||
@ -1334,7 +1390,9 @@ class Contact extends CommonObject
|
|||||||
$this->country = 'France';
|
$this->country = 'France';
|
||||||
$this->email = 'specimen@specimen.com';
|
$this->email = 'specimen@specimen.com';
|
||||||
$this->skype = 'tom.hanson';
|
$this->skype = 'tom.hanson';
|
||||||
|
$this->socialnetworks = array(
|
||||||
|
'skype' => 'tom.hanson',
|
||||||
|
);
|
||||||
$this->phone_pro = '0909090901';
|
$this->phone_pro = '0909090901';
|
||||||
$this->phone_perso = '0909090902';
|
$this->phone_perso = '0909090902';
|
||||||
$this->phone_mobile = '0909090903';
|
$this->phone_mobile = '0909090903';
|
||||||
|
|||||||
@ -41,6 +41,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("companies", "suppliers", "categories"));
|
$langs->loadLangs(array("companies", "suppliers", "categories"));
|
||||||
|
|
||||||
|
$socialnetworks = getArrayOfSocialNetworks();
|
||||||
|
|
||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
$massaction=GETPOST('massaction', 'alpha');
|
$massaction=GETPOST('massaction', 'alpha');
|
||||||
$show_files=GETPOST('show_files', 'int');
|
$show_files=GETPOST('show_files', 'int');
|
||||||
@ -71,10 +73,13 @@ $search_phone_mobile=GETPOST("search_phone_mobile", 'alpha');
|
|||||||
$search_fax=GETPOST("search_fax", 'alpha');
|
$search_fax=GETPOST("search_fax", 'alpha');
|
||||||
$search_email=GETPOST("search_email", 'alpha');
|
$search_email=GETPOST("search_email", 'alpha');
|
||||||
$search_no_email=GETPOST("search_no_email", 'int');
|
$search_no_email=GETPOST("search_no_email", 'int');
|
||||||
$search_skype=GETPOST("search_skype", 'alpha');
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
$search_twitter=GETPOST("search_twitter", 'alpha');
|
foreach ($socialnetworks as $key => $value) {
|
||||||
$search_facebook=GETPOST("search_facebook", 'alpha');
|
if ($value['active']) {
|
||||||
$search_linkedin=GETPOST("search_linkedin", 'alpha');
|
$search_{$key} = GETPOST("search_".$key, 'alpha');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$search_priv=GETPOST("search_priv", 'alpha');
|
$search_priv=GETPOST("search_priv", 'alpha');
|
||||||
$search_categ=GETPOST("search_categ", 'int');
|
$search_categ=GETPOST("search_categ", 'int');
|
||||||
$search_categ_thirdparty=GETPOST("search_categ_thirdparty", 'int');
|
$search_categ_thirdparty=GETPOST("search_categ_thirdparty", 'int');
|
||||||
@ -168,11 +173,6 @@ $arrayfields=array(
|
|||||||
'p.fax'=>array('label'=>"Fax", 'checked'=>0),
|
'p.fax'=>array('label'=>"Fax", 'checked'=>0),
|
||||||
'p.email'=>array('label'=>"EMail", 'checked'=>1),
|
'p.email'=>array('label'=>"EMail", 'checked'=>1),
|
||||||
'p.no_email'=>array('label'=>"No_Email", 'checked'=>0, 'enabled'=>(! empty($conf->mailing->enabled))),
|
'p.no_email'=>array('label'=>"No_Email", 'checked'=>0, 'enabled'=>(! empty($conf->mailing->enabled))),
|
||||||
'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
|
||||||
'p.jabberid'=>array('label'=>"Jabber", '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.thirdparty'=>array('label'=>"ThirdParty", 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
|
||||||
'p.priv'=>array('label'=>"ContactVisibility", 'checked'=>1, 'position'=>200),
|
'p.priv'=>array('label'=>"ContactVisibility", 'checked'=>1, 'position'=>200),
|
||||||
'p.datec'=>array('label'=>"DateCreationShort", 'checked'=>0, 'position'=>500),
|
'p.datec'=>array('label'=>"DateCreationShort", 'checked'=>0, 'position'=>500),
|
||||||
@ -180,6 +180,16 @@ $arrayfields=array(
|
|||||||
'p.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
'p.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||||
'p.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100),
|
'p.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100),
|
||||||
);
|
);
|
||||||
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
|
foreach ($socialnetworks as $key => $value) {
|
||||||
|
if ($value['active']) {
|
||||||
|
$arrayfields['p.'.$key] = array(
|
||||||
|
'label' => $value['label'],
|
||||||
|
'checked' => 0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
|
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
|
||||||
{
|
{
|
||||||
@ -236,10 +246,13 @@ if (empty($reshook))
|
|||||||
$search_fax="";
|
$search_fax="";
|
||||||
$search_email="";
|
$search_email="";
|
||||||
$search_no_email=-1;
|
$search_no_email=-1;
|
||||||
$search_skype="";
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
$search_twitter="";
|
foreach ($socialnetworks as $key => $value) {
|
||||||
$search_facebook="";
|
if ($value['active']) {
|
||||||
$search_linkedin="";
|
$search_{$key} = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$search_priv="";
|
$search_priv="";
|
||||||
$search_status=-1;
|
$search_status=-1;
|
||||||
$search_categ='';
|
$search_categ='';
|
||||||
@ -275,7 +288,8 @@ $contactstatic=new Contact($db);
|
|||||||
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
||||||
|
|
||||||
$sql = "SELECT s.rowid as socid, s.nom as name,";
|
$sql = "SELECT s.rowid as socid, s.nom as name,";
|
||||||
$sql.= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email, p.no_email, p.skype,";
|
$sql.= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email, p.no_email,";
|
||||||
|
$sql.= " p.socialnetworks,";
|
||||||
$sql.= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,";
|
$sql.= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,";
|
||||||
$sql.= " co.label as country, co.code as country_code";
|
$sql.= " co.label as country, co.code as country_code";
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
@ -337,10 +351,14 @@ if (strlen($search_phone_perso)) $sql.= natural_search('p.phone_perso', $sear
|
|||||||
if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone_pro);
|
if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone_pro);
|
||||||
if (strlen($search_phone_mobile)) $sql.= natural_search('p.phone_mobile', $search_phone_mobile);
|
if (strlen($search_phone_mobile)) $sql.= natural_search('p.phone_mobile', $search_phone_mobile);
|
||||||
if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax);
|
if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax);
|
||||||
if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype);
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
if (strlen($search_twitter)) $sql.= natural_search('p.twitter', $search_twitter);
|
foreach ($socialnetworks as $key => $value) {
|
||||||
if (strlen($search_facebook)) $sql.= natural_search('p.facebook', $search_facebook);
|
if ($value['active'] && strlen($search_{$key})) {
|
||||||
if (strlen($search_linkedin)) $sql.= natural_search('p.linkedin', $search_linkedin);
|
//$sql.= natural_search("p.socialnetworks->'$.".$key."'", $search_{$key});
|
||||||
|
$sql.= ' AND p.socialnetworks LIKE \'%"'.$key.'":"'.$search_{$key}.'%\'';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (strlen($search_email)) $sql.= natural_search('p.email', $search_email);
|
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_zip)) $sql.= natural_search("p.zip", $search_zip);
|
||||||
if (strlen($search_town)) $sql.= natural_search("p.town", $search_town);
|
if (strlen($search_town)) $sql.= natural_search("p.town", $search_town);
|
||||||
@ -641,35 +659,17 @@ if (! empty($arrayfields['p.no_email']['checked']))
|
|||||||
print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email);
|
print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['p.skype']['checked']))
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
{
|
foreach ($socialnetworks as $key => $value) {
|
||||||
|
if ($value['active']) {
|
||||||
|
if (! empty($arrayfields['p.'.$key]['checked']))
|
||||||
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input class="flat" type="text" name="search_skype" size="6" value="'.dol_escape_htmltag($search_skype).'">';
|
print '<input class="flat" type="text" name="search_'.$key.'" size="6" value="'.dol_escape_htmltag($search_{$key}).'">';
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
if (! empty($arrayfields['p.jabberid']['checked']))
|
|
||||||
{
|
|
||||||
print '<td class="liste_titre">';
|
|
||||||
print '<input class="flat" type="text" name="search_jabberid" size="6" value="'.dol_escape_htmltag($search_jabberid).'">';
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
if (! empty($arrayfields['p.twitter']['checked']))
|
|
||||||
{
|
|
||||||
print '<td class="liste_titre">';
|
|
||||||
print '<input class="flat" type="text" name="search_twitter" size="6" value="'.dol_escape_htmltag($search_twitter).'">';
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
if (! empty($arrayfields['p.facebook']['checked']))
|
|
||||||
{
|
|
||||||
print '<td class="liste_titre">';
|
|
||||||
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>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['p.thirdparty']['checked']))
|
if (! empty($arrayfields['p.thirdparty']['checked']))
|
||||||
{
|
{
|
||||||
@ -743,11 +743,13 @@ if (! empty($arrayfields['p.phone_mobile']['checked'])) print_liste_field
|
|||||||
if (! empty($arrayfields['p.fax']['checked'])) print_liste_field_titre($arrayfields['p.fax']['label'], $_SERVER["PHP_SELF"], "p.fax", $begin, $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['p.fax']['checked'])) print_liste_field_titre($arrayfields['p.fax']['label'], $_SERVER["PHP_SELF"], "p.fax", $begin, $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['p.email']['checked'])) print_liste_field_titre($arrayfields['p.email']['label'], $_SERVER["PHP_SELF"], "p.email", $begin, $param, '', $sortfield, $sortorder);
|
if (! empty($arrayfields['p.email']['checked'])) print_liste_field_titre($arrayfields['p.email']['label'], $_SERVER["PHP_SELF"], "p.email", $begin, $param, '', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['p.no_email']['checked'])) print_liste_field_titre($arrayfields['p.no_email']['label'], $_SERVER["PHP_SELF"], "p.no_email", $begin, $param, '', $sortfield, $sortorder, 'center ');
|
if (! empty($arrayfields['p.no_email']['checked'])) print_liste_field_titre($arrayfields['p.no_email']['label'], $_SERVER["PHP_SELF"], "p.no_email", $begin, $param, '', $sortfield, $sortorder, 'center ');
|
||||||
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($conf->socialnetworks->enabled)) {
|
||||||
if (! empty($arrayfields['p.jabberid']['checked'])) print_liste_field_titre($arrayfields['p.jabberid']['label'], $_SERVER["PHP_SELF"], "p.jabberid", $begin, $param, '', $sortfield, $sortorder);
|
foreach ($socialnetworks as $key => $value) {
|
||||||
if (! empty($arrayfields['p.twitter']['checked'])) print_liste_field_titre($arrayfields['p.twitter']['label'], $_SERVER["PHP_SELF"], "p.twitter", $begin, $param, '', $sortfield, $sortorder);
|
if ($value['active'] && ! empty($arrayfields['p.'.$key]['checked'])) {
|
||||||
if (! empty($arrayfields['p.facebook']['checked'])) print_liste_field_titre($arrayfields['p.facebook']['label'], $_SERVER["PHP_SELF"], "p.facebook", $begin, $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['p.'.$key]['label'], $_SERVER["PHP_SELF"], "p.".$key, $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.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, '', $sortfield, $sortorder, 'center ');
|
if (! empty($arrayfields['p.priv']['checked'])) print_liste_field_titre($arrayfields['p.priv']['label'], $_SERVER["PHP_SELF"], "p.priv", $begin, $param, '', $sortfield, $sortorder, 'center ');
|
||||||
// Extra fields
|
// Extra fields
|
||||||
@ -784,7 +786,7 @@ while ($i < min($num, $limit))
|
|||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
$arraysocialnetworks = (array) json_decode($obj->socialnetworks, true);
|
||||||
$contactstatic->lastname=$obj->lastname;
|
$contactstatic->lastname=$obj->lastname;
|
||||||
$contactstatic->firstname='';
|
$contactstatic->firstname='';
|
||||||
$contactstatic->id=$obj->rowid;
|
$contactstatic->id=$obj->rowid;
|
||||||
@ -796,6 +798,7 @@ while ($i < min($num, $limit))
|
|||||||
$contactstatic->phone_mobile=$obj->phone_mobile;
|
$contactstatic->phone_mobile=$obj->phone_mobile;
|
||||||
$contactstatic->zip=$obj->zip;
|
$contactstatic->zip=$obj->zip;
|
||||||
$contactstatic->town=$obj->town;
|
$contactstatic->town=$obj->town;
|
||||||
|
$contactstatic->socialnetworks = $arraysocialnetworks;
|
||||||
$contactstatic->country = $obj->country;
|
$contactstatic->country = $obj->country;
|
||||||
$contactstatic->country_code = $obj->country_code;
|
$contactstatic->country_code = $obj->country_code;
|
||||||
|
|
||||||
@ -896,35 +899,13 @@ while ($i < min($num, $limit))
|
|||||||
print '<td align="center">'.yn($obj->no_email).'</td>';
|
print '<td align="center">'.yn($obj->no_email).'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Skype
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
if (! empty($arrayfields['p.skype']['checked']))
|
foreach ($socialnetworks as $key => $value) {
|
||||||
{
|
if ($value['active'] && ! empty($arrayfields['p.'.$key]['checked'])) {
|
||||||
if (! empty($conf->socialnetworks->enabled)) { print '<td>'.dol_print_socialnetworks($obj->skype, $obj->rowid, $obj->socid, 'skype').'</td>'; }
|
print '<td>'.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key).'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Jabber
|
|
||||||
if (! empty($arrayfields['p.jabberid']['checked']))
|
|
||||||
{
|
|
||||||
if (! empty($conf->socialnetworks->enabled)) { print '<td>'.dol_print_socialnetworks($obj->jabberid, $obj->rowid, $obj->socid, 'jabberid').'</td>'; }
|
|
||||||
if (! $i) $totalarray['nbfield']++;
|
|
||||||
}
|
}
|
||||||
// Twitter
|
|
||||||
if (! empty($arrayfields['p.twitter']['checked']))
|
|
||||||
{
|
|
||||||
if (! empty($conf->socialnetworks->enabled)) { print '<td>'.dol_print_socialnetworks($obj->twitter, $obj->rowid, $obj->socid, 'twitter').'</td>'; }
|
|
||||||
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']++;
|
|
||||||
}
|
|
||||||
// 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
|
// Company
|
||||||
if (! empty($arrayfields['p.thirdparty']['checked']))
|
if (! empty($arrayfields['p.thirdparty']['checked']))
|
||||||
|
|||||||
@ -692,6 +692,12 @@ abstract class CommonObject
|
|||||||
$out.='<div style="clear: both;">';
|
$out.='<div style="clear: both;">';
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
if (! empty($conf->socialnetworks->enabled))
|
||||||
{
|
{
|
||||||
|
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);
|
||||||
|
$outdone++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if ($this->skype) $out.=dol_print_socialnetworks($this->skype, $this->id, $object->id, 'skype');
|
if ($this->skype) $out.=dol_print_socialnetworks($this->skype, $this->id, $object->id, 'skype');
|
||||||
$outdone++;
|
$outdone++;
|
||||||
if ($this->jabberid) $out.=dol_print_socialnetworks($this->jabberid, $this->id, $object->id, 'jabber');
|
if ($this->jabberid) $out.=dol_print_socialnetworks($this->jabberid, $this->id, $object->id, 'jabber');
|
||||||
@ -703,6 +709,7 @@ abstract class CommonObject
|
|||||||
if ($this->linkedin) $out.=dol_print_socialnetworks($this->linkedin, $this->id, $object->id, 'linkedin');
|
if ($this->linkedin) $out.=dol_print_socialnetworks($this->linkedin, $this->id, $object->id, 'linkedin');
|
||||||
$outdone++;
|
$outdone++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$out.='</div>';
|
$out.='</div>';
|
||||||
|
|
||||||
$out.='<!-- END Part to show address block -->';
|
$out.='<!-- END Part to show address block -->';
|
||||||
|
|||||||
@ -876,6 +876,8 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
|||||||
$search_poste = GETPOST("search_poste", 'alpha');
|
$search_poste = GETPOST("search_poste", 'alpha');
|
||||||
$search_roles = GETPOST("search_roles", 'array');
|
$search_roles = GETPOST("search_roles", 'array');
|
||||||
|
|
||||||
|
$socialnetworks = getArrayOfSocialNetworks();
|
||||||
|
|
||||||
$searchAddressPhoneDBFields = array(
|
$searchAddressPhoneDBFields = array(
|
||||||
//Address
|
//Address
|
||||||
't.address',
|
't.address',
|
||||||
@ -892,18 +894,13 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
|||||||
|
|
||||||
//E-mail
|
//E-mail
|
||||||
't.email',
|
't.email',
|
||||||
|
|
||||||
//Social media
|
|
||||||
"t.skype",
|
|
||||||
"t.jabberid",
|
|
||||||
"t.twitter",
|
|
||||||
"t.facebook",
|
|
||||||
"t.linkedin",
|
|
||||||
"t.whatsapp",
|
|
||||||
"t.youtube",
|
|
||||||
"t.snapchat",
|
|
||||||
"t.instagram"
|
|
||||||
);
|
);
|
||||||
|
//Social media
|
||||||
|
foreach ($socialnetworks as $key => $value) {
|
||||||
|
if ($value['active']) {
|
||||||
|
$searchAddressPhoneDBFields['t.'.$key] = "t.socialnetworks->'$.".$key."'";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
if (! $sortfield) $sortfield="t.lastname";
|
if (! $sortfield) $sortfield="t.lastname";
|
||||||
@ -1020,7 +1017,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
|||||||
$extrafieldsobjectkey=$contactstatic->table_element;
|
$extrafieldsobjectkey=$contactstatic->table_element;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
|
||||||
$sql = "SELECT t.rowid, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste, t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.skype, t.statut, t.photo,";
|
$sql = "SELECT t.rowid, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste, t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.socialnetworks, t.statut, t.photo,";
|
||||||
$sql .= " t.civility as civility_id, t.address, t.zip, t.town";
|
$sql .= " t.civility as civility_id, t.address, t.zip, t.town";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||||
@ -1028,7 +1025,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
|||||||
if ($search_status!='' && $search_status != '-1') $sql .= " AND t.statut = ".$db->escape($search_status);
|
if ($search_status!='' && $search_status != '-1') $sql .= " AND t.statut = ".$db->escape($search_status);
|
||||||
if ($search_name) $sql .= natural_search(array('t.lastname', 't.firstname'), $search_name);
|
if ($search_name) $sql .= natural_search(array('t.lastname', 't.firstname'), $search_name);
|
||||||
if ($search_poste) $sql .= natural_search('t.poste', $search_poste);
|
if ($search_poste) $sql .= natural_search('t.poste', $search_poste);
|
||||||
if ($search_address) $sql .= natural_search($searchAddressPhoneDBFields, $search_address);
|
if ($search_address) {
|
||||||
|
$sql .= natural_search($searchAddressPhoneDBFields, $search_address);
|
||||||
|
}
|
||||||
if (count($search_roles)>0) {
|
if (count($search_roles)>0) {
|
||||||
$sql .= " AND t.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".implode(',', $search_roles)."))";
|
$sql .= " AND t.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".implode(',', $search_roles)."))";
|
||||||
}
|
}
|
||||||
@ -1132,7 +1131,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
|||||||
$contactstatic->phone_perso = $obj->phone_perso;
|
$contactstatic->phone_perso = $obj->phone_perso;
|
||||||
$contactstatic->email = $obj->email;
|
$contactstatic->email = $obj->email;
|
||||||
$contactstatic->web = $obj->web;
|
$contactstatic->web = $obj->web;
|
||||||
$contactstatic->skype = $obj->skype;
|
$contactstatic->socialnetworks = $obj->socialnetworks;
|
||||||
$contactstatic->photo = $obj->photo;
|
$contactstatic->photo = $obj->photo;
|
||||||
|
|
||||||
$country_code = getCountry($obj->country_id, 2);
|
$country_code = getCountry($obj->country_id, 2);
|
||||||
|
|||||||
@ -2198,6 +2198,32 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64,
|
|||||||
return $rep;
|
return $rep;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get array of social network dictionary
|
||||||
|
*
|
||||||
|
* @return array Array of Social Networks Dictionary
|
||||||
|
*/
|
||||||
|
function getArrayOfSocialNetworks()
|
||||||
|
{
|
||||||
|
global $conf, $db;
|
||||||
|
$sql = "SELECT rowid, code, label, url, icon, active FROM ".MAIN_DB_PREFIX."c_socialnetworks";
|
||||||
|
$sql.= " WHERE entity=".$conf->entity;
|
||||||
|
$socialnetworks = array();
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
|
$socialnetworks[$obj->code] = array(
|
||||||
|
'rowid' => $obj->rowid,
|
||||||
|
'label' => $obj->label,
|
||||||
|
'url' => $obj->url,
|
||||||
|
'icon' => $obj->icon,
|
||||||
|
'active' => $obj->active,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $socialnetworks;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show social network link
|
* Show social network link
|
||||||
*
|
*
|
||||||
@ -2211,42 +2237,43 @@ function dol_print_socialnetworks($value, $cid, $socid, $type)
|
|||||||
{
|
{
|
||||||
global $conf,$user,$langs;
|
global $conf,$user,$langs;
|
||||||
|
|
||||||
$newskype=$value;
|
$htmllink=$value;
|
||||||
|
|
||||||
if (empty($value)) return ' ';
|
if (empty($value)) return ' ';
|
||||||
|
|
||||||
if (! empty($type))
|
if (! empty($type))
|
||||||
{
|
{
|
||||||
$newskype ='<div class="divsocialnetwork inline-block valignmiddle">';
|
$htmllink = '<div class="divsocialnetwork inline-block valignmiddle">';
|
||||||
$newskype.=img_picto($langs->trans(strtoupper($type)), $type.'.png', '', false, 0, 0, '', 'paddingright', 0);
|
$htmllink .= img_picto($langs->trans(strtoupper($type)), $type.'.png', '', false, 0, 0, '', 'paddingright', 0);
|
||||||
$newskype.=$value;
|
$htmllink .= $value;
|
||||||
if ($type == 'skype')
|
if ($type == 'skype')
|
||||||
{
|
{
|
||||||
$newskype.= ' ';
|
$htmllink.= ' ';
|
||||||
$newskype.='<a href="skype:';
|
$htmllink.='<a href="skype:';
|
||||||
$newskype.=$value;
|
$htmllink.=$value;
|
||||||
$newskype.='?call" alt="'.$langs->trans("Call").' '.$value.'" title="'.$langs->trans("Call").' '.$value.'">';
|
$htmllink.='?call" alt="'.$langs->trans("Call").' '.$value.'" title="'.$langs->trans("Call").' '.$value.'">';
|
||||||
$newskype.='<img src="'.DOL_URL_ROOT.'/theme/common/skype_callbutton.png" border="0">';
|
$htmllink.='<img src="'.DOL_URL_ROOT.'/theme/common/skype_callbutton.png" border="0">';
|
||||||
$newskype.='</a><a href="skype:';
|
$htmllink.='</a><a href="skype:';
|
||||||
$newskype.=$value;
|
$htmllink.=$value;
|
||||||
$newskype.='?chat" alt="'.$langs->trans("Chat").' '.$value.'" title="'.$langs->trans("Chat").' '.$value.'">';
|
$htmllink.='?chat" alt="'.$langs->trans("Chat").' '.$value.'" title="'.$langs->trans("Chat").' '.$value.'">';
|
||||||
$newskype.='<img class="paddingleft" src="'.DOL_URL_ROOT.'/theme/common/skype_chatbutton.png" border="0">';
|
$htmllink.='<img class="paddingleft" src="'.DOL_URL_ROOT.'/theme/common/skype_chatbutton.png" border="0">';
|
||||||
$newskype.='</a>';
|
$htmllink.='</a>';
|
||||||
}
|
}
|
||||||
if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create && $type=='skype')
|
if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create && $type=='skype')
|
||||||
{
|
{
|
||||||
$addlink='AC_SKYPE'; $link='';
|
$addlink='AC_SKYPE';
|
||||||
|
$link='';
|
||||||
if (! empty($conf->global->AGENDA_ADDACTIONFORSKYPE)) $link='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&actioncode='.$addlink.'&contactid='.$cid.'&socid='.$socid.'">'.img_object($langs->trans("AddAction"), "calendar").'</a>';
|
if (! empty($conf->global->AGENDA_ADDACTIONFORSKYPE)) $link='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&actioncode='.$addlink.'&contactid='.$cid.'&socid='.$socid.'">'.img_object($langs->trans("AddAction"), "calendar").'</a>';
|
||||||
$newskype.=($link?' '.$link:'');
|
$htmllink.=($link?' '.$link:'');
|
||||||
}
|
}
|
||||||
$newskype.='</div>';
|
$htmllink.='</div>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$newskype.=img_warning($langs->trans("ErrorBadSocialNetworkValue", $value));
|
$htmllink.=img_warning($langs->trans("ErrorBadSocialNetworkValue", $value));
|
||||||
}
|
}
|
||||||
return $newskype;
|
return $htmllink;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3033,6 +3060,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats',
|
'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats',
|
||||||
'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe',
|
'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe',
|
||||||
'jabber','skype','twitter','facebook','linkedin',
|
'jabber','skype','twitter','facebook','linkedin',
|
||||||
|
'instagram', 'snapchat', 'youtube', 'google-plus-g','whatsapp',
|
||||||
'chevron-left','chevron-right','chevron-down','chevron-top',
|
'chevron-left','chevron-right','chevron-down','chevron-top',
|
||||||
'home', 'companies', 'products', 'commercial', 'invoicing', 'accountancy', 'project', 'hrm', 'members', 'ticket', 'generic',
|
'home', 'companies', 'products', 'commercial', 'invoicing', 'accountancy', 'project', 'hrm', 'members', 'ticket', 'generic',
|
||||||
'error','warning',
|
'error','warning',
|
||||||
@ -3146,7 +3174,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
elseif ($pictowithouttext == 'jabber') {
|
elseif ($pictowithouttext == 'jabber') {
|
||||||
$fakey = 'fa-comment-o';
|
$fakey = 'fa-comment-o';
|
||||||
}
|
}
|
||||||
elseif (in_array($pictowithouttext, array('skype', 'twitter', 'facebook', 'linkedin'))) {
|
elseif (in_array($pictowithouttext, array('skype', 'twitter', 'facebook', 'linkedin', 'instagram','snapchat','youtube','google-plus-g','whatsapp'))) {
|
||||||
$fakey = 'fa-'.$pictowithouttext;
|
$fakey = 'fa-'.$pictowithouttext;
|
||||||
$fa = 'fab';
|
$fa = 'fab';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,7 +62,7 @@ class modSocialNetworks extends DolibarrModules
|
|||||||
$this->dirs = array();
|
$this->dirs = array();
|
||||||
|
|
||||||
// Config pages
|
// Config pages
|
||||||
$this->config_page_url = array("socialnetworks.php");
|
$this->config_page_url = array(/*"socialnetworks.php"*/);
|
||||||
|
|
||||||
// Dependencies
|
// Dependencies
|
||||||
$this->hidden = ! empty($conf->global->MODULE_SOCIALNETWORKS_DISABLED); // A condition to hide module
|
$this->hidden = ! empty($conf->global->MODULE_SOCIALNETWORKS_DISABLED); // A condition to hide module
|
||||||
|
|||||||
@ -2209,7 +2209,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$response->label=$langs->trans("SupplierBillsToPay");
|
$response->label=$langs->trans("SupplierBillsToPay");
|
||||||
$response->labelShort=$langs->trans("StatusToPay");
|
$response->labelShort=$langs->trans("StatusToPay");
|
||||||
|
|
||||||
$response->url=DOL_URL_ROOT.'/fourn/facture/list.php?search_status=1&mainmenu=billing&leftmenu=suppliers_bills';
|
$response->url=DOL_URL_ROOT.'/fourn/facture/list.php?search_status=1&mainmenu=billing&leftmenu=suppliers_bills';
|
||||||
$response->img=img_object($langs->trans("Bills"), "bill");
|
$response->img=img_object($langs->trans("Bills"), "bill");
|
||||||
|
|
||||||
$facturestatic = new FactureFournisseur($this->db);
|
$facturestatic = new FactureFournisseur($this->db);
|
||||||
|
|||||||
@ -2194,7 +2194,7 @@ class Holiday extends CommonObject
|
|||||||
$response->warning_delay=$conf->holiday->approve->warning_delay/60/60/24;
|
$response->warning_delay=$conf->holiday->approve->warning_delay/60/60/24;
|
||||||
$response->label=$langs->trans("HolidaysToApprove");
|
$response->label=$langs->trans("HolidaysToApprove");
|
||||||
$response->labelShort=$langs->trans("ToApprove");
|
$response->labelShort=$langs->trans("ToApprove");
|
||||||
$response->url=DOL_URL_ROOT.'/holiday/list.php?search_statut=2&mainmenu=hrm&leftmenu=holiday';
|
$response->url=DOL_URL_ROOT.'/holiday/list.php?search_statut=2&mainmenu=hrm&leftmenu=holiday';
|
||||||
$response->img=img_object('', "holiday");
|
$response->img=img_object('', "holiday");
|
||||||
|
|
||||||
while ($obj=$this->db->fetch_object($resql))
|
while ($obj=$this->db->fetch_object($resql))
|
||||||
|
|||||||
55
htdocs/install/mysql/data/llx_c_socialnetworks.sql
Normal file
55
htdocs/install/mysql/data/llx_c_socialnetworks.sql
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
--
|
||||||
|
-- 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
|
||||||
|
-- the Free Software Foundation; either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
--
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
--
|
||||||
|
--
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors
|
||||||
|
-- de l'install et tous les sigles '--' sont supprimés.
|
||||||
|
--
|
||||||
|
|
||||||
|
-- socialnetworks
|
||||||
|
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'facebook', 'Facebook', 'https://www.facebook.com/{socialid}', 'fa-facebook', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'skype', 'Skype', 'https://www.skype.com/{socialid}', 'fa-skype', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'twitter', 'Twitter', 'https://www.twitter.com/{socialid}', 'fa-twitter', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'linkedin', 'LinkedIn', 'https://www.linkedin.com/{socialid}', 'fa-linkedin', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'instagram', 'Instagram', 'https://www.instagram.com/{socialid}', 'fa-instagram', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'snapchat', 'Snapchat', '{socialid}', 'fa-snapchat', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'googleplus', 'GooglePlus', 'https://www.googleplus.com/{socialid}', 'fa-google-plus-g', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'youtube', 'Youtube', 'https://www.youtube.com/{socialid}', 'fa-youtube', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'whatsapp', 'Whatsapp', '{socialid}', 'fa-whatsapp', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'tumblr', 'Tumblr', 'https://www.tumblr.com/{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'vero', 'Vero', 'https://vero.co/{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'viadeo', 'Viadeo', 'https://fr.viadeo.com/fr/{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'slack', 'Slack', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'xing', 'Xing', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'meetup', 'Meetup', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'pinterest', 'Pinterest', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'flickr', 'Flickr', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, '500px', '500px', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'giphy', 'Giphy', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'gifycat', 'Gificat', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'dailymotion', 'Dailymotion', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'vimeo', 'Vimeo', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'periscope', 'Periscope', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'twitch', 'Twitch', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'discord', 'Discord', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'wikipedia', 'Wikipedia', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'reddit', 'Reddit', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'quora', 'Quora', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'tripadvisor', 'Tripadvisor', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'mastodon', 'Mastodon', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'diaspora', 'Diaspora', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'viber', 'Viber', '{socialid}', '', 0);
|
||||||
@ -149,7 +149,6 @@ ALTER TABLE llx_oauth_token ADD COLUMN fk_soc integer DEFAULT NULL after token;
|
|||||||
|
|
||||||
ALTER TABLE llx_adherent_type ADD COLUMN duration varchar(6) DEFAULT NULL after morphy;
|
ALTER TABLE llx_adherent_type ADD COLUMN duration varchar(6) DEFAULT NULL after morphy;
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE llx_mailing ADD COLUMN tms timestamp;
|
ALTER TABLE llx_mailing ADD COLUMN tms timestamp;
|
||||||
ALTER TABLE llx_mailing_cibles ADD COLUMN tms timestamp;
|
ALTER TABLE llx_mailing_cibles ADD COLUMN tms timestamp;
|
||||||
|
|
||||||
@ -252,6 +251,57 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, m
|
|||||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-GANDI', 0, 117, '', 0, 10, 2, 1);
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-GANDI', 0, 117, '', 0, 10, 2, 1);
|
||||||
|
|
||||||
|
|
||||||
|
create table llx_c_socialnetworks
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
entity integer DEFAULT 1 NOT NULL,
|
||||||
|
code varchar(100),
|
||||||
|
label varchar(150),
|
||||||
|
url text,
|
||||||
|
icon varchar(20),
|
||||||
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
ALTER TABLE llx_c_socialnetworks ADD UNIQUE INDEX idx_c_socialnetworks_code (code);
|
||||||
|
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'facebook', 'Facebook', 'https://www.facebook.com/{socialid}', 'fa-facebook', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'skype', 'Skype', 'https://www.skype.com/{socialid}', 'fa-skype', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'twitter', 'Twitter', 'https://www.twitter.com/{socialid}', 'fa-twitter', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'linkedin', 'LinkedIn', 'https://www.linkedin.com/{socialid}', 'fa-linkedin', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'instagram', 'Instagram', 'https://www.instagram.com/{socialid}', 'fa-instagram', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'snapchat', 'Snapchat', '{socialid}', 'fa-snapchat', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'googleplus', 'GooglePlus', 'https://www.googleplus.com/{socialid}', 'fa-google-plus-g', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'youtube', 'Youtube', 'https://www.youtube.com/{socialid}', 'fa-youtube', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'whatsapp', 'Whatsapp', '{socialid}', 'fa-whatsapp', 1);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'tumblr', 'Tumblr', 'https://www.tumblr.com/{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'vero', 'Vero', 'https://vero.co/{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'viadeo', 'Viadeo', 'https://fr.viadeo.com/fr/{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'slack', 'Slack', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'xing', 'Xing', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'meetup', 'Meetup', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'pinterest', 'Pinterest', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'flickr', 'Flickr', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, '500px', '500px', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'giphy', 'Giphy', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'gifycat', 'Gificat', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'dailymotion', 'Dailymotion', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'vimeo', 'Vimeo', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'periscope', 'Periscope', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'twitch', 'Twitch', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'discord', 'Discord', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'wikipedia', 'Wikipedia', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'reddit', 'Reddit', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'quora', 'Quora', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'tripadvisor', 'Tripadvisor', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'mastodon', 'Mastodon', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'diaspora', 'Diaspora', '{socialid}', '', 0);
|
||||||
|
INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES(1, 'viber', 'Viber', '{socialid}', '', 0);
|
||||||
|
|
||||||
|
ALTER TABLE llx_adherent ADD COLUMN socialnetworks text DEFAULT NULL AFTER email;
|
||||||
|
ALTER TABLE llx_societe ADD COLUMN socialnetworks text DEFAULT NULL AFTER email;
|
||||||
|
ALTER TABLE llx_socpeople ADD COLUMN socialnetworks text DEFAULT NULL AFTER email;
|
||||||
|
ALTER TABLE llx_user ADD COLUMN socialnetworks text DEFAULT NULL AFTER personal_email;
|
||||||
|
|
||||||
ALTER TABLE llx_product ADD COLUMN net_measure float;
|
ALTER TABLE llx_product ADD COLUMN net_measure float;
|
||||||
ALTER TABLE llx_product ADD COLUMN net_measure_units tinyint;
|
ALTER TABLE llx_product ADD COLUMN net_measure_units tinyint;
|
||||||
|
|
||||||
|
|||||||
@ -48,6 +48,7 @@ create table llx_adherent
|
|||||||
country integer,
|
country integer,
|
||||||
email varchar(255),
|
email varchar(255),
|
||||||
|
|
||||||
|
socialnetworks text DEFAULT NULL, -- json with socialnetworks
|
||||||
skype varchar(255),
|
skype varchar(255),
|
||||||
twitter varchar(255), --
|
twitter varchar(255), --
|
||||||
facebook varchar(255), --
|
facebook varchar(255), --
|
||||||
|
|||||||
19
htdocs/install/mysql/tables/llx_c_socialnetworks.key.sql
Normal file
19
htdocs/install/mysql/tables/llx_c_socialnetworks.key.sql
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
-- ========================================================================
|
||||||
|
--
|
||||||
|
-- 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
|
||||||
|
-- the Free Software Foundation; either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
--
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
--
|
||||||
|
-- ========================================================================
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE llx_c_socialnetworks ADD UNIQUE INDEX idx_c_socialnetworks_code (code);
|
||||||
27
htdocs/install/mysql/tables/llx_c_socialnetworks.sql
Normal file
27
htdocs/install/mysql/tables/llx_c_socialnetworks.sql
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
-- ========================================================================
|
||||||
|
--
|
||||||
|
-- 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
|
||||||
|
-- the Free Software Foundation; either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
--
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
--
|
||||||
|
-- ========================================================================
|
||||||
|
|
||||||
|
create table llx_c_socialnetworks
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
entity integer DEFAULT 1 NOT NULL,
|
||||||
|
code varchar(100),
|
||||||
|
label varchar(150),
|
||||||
|
url text,
|
||||||
|
icon varchar(20),
|
||||||
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
|
)ENGINE=innodb;
|
||||||
@ -51,6 +51,7 @@ create table llx_societe
|
|||||||
url varchar(255), --
|
url varchar(255), --
|
||||||
email varchar(128), --
|
email varchar(128), --
|
||||||
|
|
||||||
|
socialnetworks text DEFAULT NULL, -- json with socialnetworks
|
||||||
skype varchar(255), --
|
skype varchar(255), --
|
||||||
twitter varchar(255), --
|
twitter varchar(255), --
|
||||||
facebook varchar(255), --
|
facebook varchar(255), --
|
||||||
|
|||||||
@ -42,6 +42,7 @@ create table llx_socpeople
|
|||||||
fax varchar(30),
|
fax varchar(30),
|
||||||
email varchar(255),
|
email varchar(255),
|
||||||
|
|
||||||
|
socialnetworks text DEFAULT NULL, -- json with socialnetworks
|
||||||
jabberid varchar(255),
|
jabberid varchar(255),
|
||||||
skype varchar(255),
|
skype varchar(255),
|
||||||
twitter varchar(255), --
|
twitter varchar(255), --
|
||||||
|
|||||||
@ -56,6 +56,7 @@ create table llx_user
|
|||||||
email varchar(255),
|
email varchar(255),
|
||||||
personal_email varchar(255),
|
personal_email varchar(255),
|
||||||
|
|
||||||
|
socialnetworks text DEFAULT NULL, -- json with socialnetworks
|
||||||
jabberid varchar(255),
|
jabberid varchar(255),
|
||||||
skype varchar(255),
|
skype varchar(255),
|
||||||
twitter varchar(255), --
|
twitter varchar(255), --
|
||||||
|
|||||||
@ -451,6 +451,16 @@ if (! GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'a
|
|||||||
{
|
{
|
||||||
migrate_user_photospath();
|
migrate_user_photospath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Scripts for 11.0
|
||||||
|
$afterversionarray=explode('.', '10.0.9');
|
||||||
|
$beforeversionarray=explode('.', '11.0.9');
|
||||||
|
if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
|
||||||
|
migrate_users_socialnetworks();
|
||||||
|
migrate_members_socialnetworks();
|
||||||
|
migrate_contacts_socialnetworks();
|
||||||
|
migrate_thirdparties_socialnetworks();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Code executed only if migration is LAST ONE. Must always be done.
|
// Code executed only if migration is LAST ONE. Must always be done.
|
||||||
@ -4926,3 +4936,369 @@ On les corrige:
|
|||||||
update llx_facture set paye=1, fk_statut=2 where close_code is null
|
update llx_facture set paye=1, fk_statut=2 where close_code is null
|
||||||
and rowid in (...)
|
and rowid in (...)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Migrate users fields facebook and co to socialnetworks
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function migrate_users_socialnetworks()
|
||||||
|
{
|
||||||
|
global $db, $langs;
|
||||||
|
// skype,twitter,facebook,linkedin,instagram,snapchat,googleplus,youtube,whatsapp
|
||||||
|
$error = 0;
|
||||||
|
$db->begin();
|
||||||
|
print '<tr><td colspan="4">';
|
||||||
|
$sql = 'SELECT rowid, socialnetworks';
|
||||||
|
$sql .= ', skype, twitter, facebook, linkedin, instagram, snapchat, googleplus, youtube, whatsapp FROM '.MAIN_DB_PREFIX.'user WHERE ';
|
||||||
|
$sql .= ' skype IS NOT NULL OR skype !=""';
|
||||||
|
$sql .= ' OR twitter IS NOT NULL OR twitter !=""';
|
||||||
|
$sql .= ' OR facebook IS NOT NULL OR facebook!=""';
|
||||||
|
$sql .= ' OR linkedin IS NOT NULL OR linkedin!=""';
|
||||||
|
$sql .= ' OR instagram IS NOT NULL OR instagram!=""';
|
||||||
|
$sql .= ' OR snapchat IS NOT NULL OR snapchat!=""';
|
||||||
|
$sql .= ' OR googleplus IS NOT NULL OR googleplus!=""';
|
||||||
|
$sql .= ' OR youtube IS NOT NULL OR youtube!=""';
|
||||||
|
$sql .= ' OR whatsapp IS NOT NULL OR whatsapp!=""';
|
||||||
|
//print $sql;
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
|
$arraysocialnetworks = array();
|
||||||
|
if (!empty($obj->skype)) {
|
||||||
|
$arraysocialnetworks['skype'] = $obj->skype;
|
||||||
|
}
|
||||||
|
if (!empty($obj->twitter)) {
|
||||||
|
$arraysocialnetworks['twitter'] = $obj->twitter;
|
||||||
|
}
|
||||||
|
if (!empty($obj->facebook)) {
|
||||||
|
$arraysocialnetworks['facebook'] = $obj->facebook;
|
||||||
|
}
|
||||||
|
if (!empty($obj->linkedin)) {
|
||||||
|
$arraysocialnetworks['linkedin'] = $obj->linkedin;
|
||||||
|
}
|
||||||
|
if (!empty($obj->instagram)) {
|
||||||
|
$arraysocialnetworks['instagram'] = $obj->instagram;
|
||||||
|
}
|
||||||
|
if (!empty($obj->snapchat)) {
|
||||||
|
$arraysocialnetworks['snapchat'] = $obj->snapchat;
|
||||||
|
}
|
||||||
|
if (!empty($obj->googleplus)) {
|
||||||
|
$arraysocialnetworks['googleplus'] = $obj->googleplus;
|
||||||
|
}
|
||||||
|
if (!empty($obj->youtube)) {
|
||||||
|
$arraysocialnetworks['youtube'] = $obj->youtube;
|
||||||
|
}
|
||||||
|
if (!empty($obj->whatsapp)) {
|
||||||
|
$arraysocialnetworks['whatsapp'] = $obj->whatsapp;
|
||||||
|
}
|
||||||
|
if ($obj->socialnetworks == '' || is_null($obj->socialnetworks)) {
|
||||||
|
$obj->socialnetworks = '[]';
|
||||||
|
}
|
||||||
|
$socialnetworks = array_merge($arraysocialnetworks, json_decode($obj->socialnetworks, true));
|
||||||
|
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX.'user SET socialnetworks="'.$db->escape(json_encode($socialnetworks, true)).'"';
|
||||||
|
$sqlupd.= ', skype=null';
|
||||||
|
$sqlupd.= ', twitter=null';
|
||||||
|
$sqlupd.= ', facebook=null';
|
||||||
|
$sqlupd.= ', linkedin=null';
|
||||||
|
$sqlupd.= ', instagram=null';
|
||||||
|
$sqlupd.= ', snapchat=null';
|
||||||
|
$sqlupd.= ', googleplus=null';
|
||||||
|
$sqlupd.= ', youtube=null';
|
||||||
|
$sqlupd.= ', whatsapp=null';
|
||||||
|
$sqlupd.= ' WHERE rowid='.$obj->rowid;
|
||||||
|
//print $sqlupd."<br>";
|
||||||
|
$resqlupd = $db->query($sqlupd);
|
||||||
|
if (! $resqlupd) {
|
||||||
|
dol_print_error($db);
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
if (! $error) {
|
||||||
|
$db->commit();
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
print '<b>'.$langs->trans('MigrationUsersSocialNetworks')."</b><br>\n";
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Migrate members fields facebook and co to socialnetworks
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function migrate_members_socialnetworks()
|
||||||
|
{
|
||||||
|
global $db, $langs;
|
||||||
|
|
||||||
|
print '<tr><td colspan="4">';
|
||||||
|
$error = 0;
|
||||||
|
$db->begin();
|
||||||
|
print '<tr><td colspan="4">';
|
||||||
|
$sql = 'SELECT rowid, socialnetworks';
|
||||||
|
$sql .= ', skype, twitter, facebook, linkedin, instagram, snapchat, googleplus, youtube, whatsapp FROM '.MAIN_DB_PREFIX.'adherent WHERE ';
|
||||||
|
$sql .= ' skype IS NOT NULL OR skype!=""';
|
||||||
|
$sql .= ' OR twitter IS NOT NULL OR twitter!=""';
|
||||||
|
$sql .= ' OR facebook IS NOT NULL OR facebook!=""';
|
||||||
|
$sql .= ' OR linkedin IS NOT NULL OR linkedin!=""';
|
||||||
|
$sql .= ' OR instagram IS NOT NULL OR instagram!=""';
|
||||||
|
$sql .= ' OR snapchat IS NOT NULL OR snapchat!=""';
|
||||||
|
$sql .= ' OR googleplus IS NOT NULL OR googleplus!=""';
|
||||||
|
$sql .= ' OR youtube IS NOT NULL OR youtube!=""';
|
||||||
|
$sql .= ' OR whatsapp IS NOT NULL OR whatsapp!=""';
|
||||||
|
//print $sql;
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
|
$arraysocialnetworks = array();
|
||||||
|
if (!empty($obj->skype)) {
|
||||||
|
$arraysocialnetworks['skype'] = $obj->skype;
|
||||||
|
}
|
||||||
|
if (!empty($obj->twitter)) {
|
||||||
|
$arraysocialnetworks['twitter'] = $obj->twitter;
|
||||||
|
}
|
||||||
|
if (!empty($obj->facebook)) {
|
||||||
|
$arraysocialnetworks['facebook'] = $obj->facebook;
|
||||||
|
}
|
||||||
|
if (!empty($obj->linkedin)) {
|
||||||
|
$arraysocialnetworks['linkedin'] = $obj->linkedin;
|
||||||
|
}
|
||||||
|
if (!empty($obj->instagram)) {
|
||||||
|
$arraysocialnetworks['instagram'] = $obj->instagram;
|
||||||
|
}
|
||||||
|
if (!empty($obj->snapchat)) {
|
||||||
|
$arraysocialnetworks['snapchat'] = $obj->snapchat;
|
||||||
|
}
|
||||||
|
if (!empty($obj->googleplus)) {
|
||||||
|
$arraysocialnetworks['googleplus'] = $obj->googleplus;
|
||||||
|
}
|
||||||
|
if (!empty($obj->youtube)) {
|
||||||
|
$arraysocialnetworks['youtube'] = $obj->youtube;
|
||||||
|
}
|
||||||
|
if (!empty($obj->whatsapp)) {
|
||||||
|
$arraysocialnetworks['whatsapp'] = $obj->whatsapp;
|
||||||
|
}
|
||||||
|
if ($obj->socialnetworks == '' || is_null($obj->socialnetworks)) {
|
||||||
|
$obj->socialnetworks = '[]';
|
||||||
|
}
|
||||||
|
$socialnetworks = array_merge($arraysocialnetworks, json_decode($obj->socialnetworks, true));
|
||||||
|
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX.'adherent SET socialnetworks="'.$db->escape(json_encode($socialnetworks, true)).'"';
|
||||||
|
$sqlupd.= ', skype=null';
|
||||||
|
$sqlupd.= ', twitter=null';
|
||||||
|
$sqlupd.= ', facebook=null';
|
||||||
|
$sqlupd.= ', linkedin=null';
|
||||||
|
$sqlupd.= ', instagram=null';
|
||||||
|
$sqlupd.= ', snapchat=null';
|
||||||
|
$sqlupd.= ', googleplus=null';
|
||||||
|
$sqlupd.= ', youtube=null';
|
||||||
|
$sqlupd.= ', whatsapp=null';
|
||||||
|
$sqlupd.= ' WHERE rowid='.$obj->rowid;
|
||||||
|
//print $sqlupd."<br>";
|
||||||
|
$resqlupd = $db->query($sqlupd);
|
||||||
|
if (! $resqlupd) {
|
||||||
|
dol_print_error($db);
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
if (! $error) {
|
||||||
|
$db->commit();
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
print '<b>'.$langs->trans('MigrationMembersSocialNetworks')."</b><br>\n";
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Migrate contacts fields facebook and co to socialnetworks
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function migrate_contacts_socialnetworks()
|
||||||
|
{
|
||||||
|
global $db, $langs;
|
||||||
|
// jabberid,skype,twitter,facebook,linkedin,instagram,snapchat,googleplus,youtube,whatsapp
|
||||||
|
$error = 0;
|
||||||
|
$db->begin();
|
||||||
|
print '<tr><td colspan="4">';
|
||||||
|
$sql = 'SELECT rowid, socialnetworks';
|
||||||
|
$sql .= ', jabberid, skype, twitter, facebook, linkedin, instagram, snapchat, googleplus, youtube, whatsapp FROM '.MAIN_DB_PREFIX.'socpeople WHERE ';
|
||||||
|
$sql .= ' jabberid IS NOT NULL OR jabberid!=""';
|
||||||
|
$sql .= ' OR skype IS NOT NULL OR skype!=""';
|
||||||
|
$sql .= ' OR twitter IS NOT NULL OR twitter!=""';
|
||||||
|
$sql .= ' OR facebook IS NOT NULL OR facebook!=""';
|
||||||
|
$sql .= ' OR linkedin IS NOT NULL OR linkedin!=""';
|
||||||
|
$sql .= ' OR instagram IS NOT NULL OR instagram!=""';
|
||||||
|
$sql .= ' OR snapchat IS NOT NULL OR snapchat!=""';
|
||||||
|
$sql .= ' OR googleplus IS NOT NULL OR googleplus!=""';
|
||||||
|
$sql .= ' OR youtube IS NOT NULL OR youtube!=""';
|
||||||
|
$sql .= ' OR whatsapp IS NOT NULL OR whatsapp!=""';
|
||||||
|
//print $sql;
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
|
$arraysocialnetworks = array();
|
||||||
|
if (!empty($obj->jabberid)) {
|
||||||
|
$arraysocialnetworks['jabber'] = $obj->jabberid;
|
||||||
|
}
|
||||||
|
if (!empty($obj->skype)) {
|
||||||
|
$arraysocialnetworks['skype'] = $obj->skype;
|
||||||
|
}
|
||||||
|
if (!empty($obj->twitter)) {
|
||||||
|
$arraysocialnetworks['twitter'] = $obj->twitter;
|
||||||
|
}
|
||||||
|
if (!empty($obj->facebook)) {
|
||||||
|
$arraysocialnetworks['facebook'] = $obj->facebook;
|
||||||
|
}
|
||||||
|
if (!empty($obj->linkedin)) {
|
||||||
|
$arraysocialnetworks['linkedin'] = $obj->linkedin;
|
||||||
|
}
|
||||||
|
if (!empty($obj->instagram)) {
|
||||||
|
$arraysocialnetworks['instagram'] = $obj->instagram;
|
||||||
|
}
|
||||||
|
if (!empty($obj->snapchat)) {
|
||||||
|
$arraysocialnetworks['snapchat'] = $obj->snapchat;
|
||||||
|
}
|
||||||
|
if (!empty($obj->googleplus)) {
|
||||||
|
$arraysocialnetworks['googleplus'] = $obj->googleplus;
|
||||||
|
}
|
||||||
|
if (!empty($obj->youtube)) {
|
||||||
|
$arraysocialnetworks['youtube'] = $obj->youtube;
|
||||||
|
}
|
||||||
|
if (!empty($obj->whatsapp)) {
|
||||||
|
$arraysocialnetworks['whatsapp'] = $obj->whatsapp;
|
||||||
|
}
|
||||||
|
if ($obj->socialnetworks == '' || is_null($obj->socialnetworks)) {
|
||||||
|
$obj->socialnetworks = '[]';
|
||||||
|
}
|
||||||
|
$socialnetworks = array_merge($arraysocialnetworks, json_decode($obj->socialnetworks, true));
|
||||||
|
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX.'socpeople SET socialnetworks="'.$db->escape(json_encode($socialnetworks, true)).'"';
|
||||||
|
$sqlupd.= ', jabberid=null';
|
||||||
|
$sqlupd.= ', skype=null';
|
||||||
|
$sqlupd.= ', twitter=null';
|
||||||
|
$sqlupd.= ', facebook=null';
|
||||||
|
$sqlupd.= ', linkedin=null';
|
||||||
|
$sqlupd.= ', instagram=null';
|
||||||
|
$sqlupd.= ', snapchat=null';
|
||||||
|
$sqlupd.= ', googleplus=null';
|
||||||
|
$sqlupd.= ', youtube=null';
|
||||||
|
$sqlupd.= ', whatsapp=null';
|
||||||
|
$sqlupd.= ' WHERE rowid='.$obj->rowid;
|
||||||
|
//print $sqlupd."<br>";
|
||||||
|
$resqlupd = $db->query($sqlupd);
|
||||||
|
if (! $resqlupd) {
|
||||||
|
dol_print_error($db);
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
if (! $error) {
|
||||||
|
$db->commit();
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
print '<b>'.$langs->trans('MigrationContactsSocialNetworks')."</b><br>\n";
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Migrate thirdparties fields facebook and co to socialnetworks
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function migrate_thirdparties_socialnetworks()
|
||||||
|
{
|
||||||
|
global $db, $langs;
|
||||||
|
// skype,twitter,facebook,linkedin,instagram,snapchat,googleplus,youtube,whatsapp
|
||||||
|
$error = 0;
|
||||||
|
$db->begin();
|
||||||
|
print '<tr><td colspan="4">';
|
||||||
|
$sql = 'SELECT rowid, socialnetworks';
|
||||||
|
$sql .= ', skype, twitter, facebook, linkedin, instagram, snapchat, googleplus, youtube, whatsapp FROM '.MAIN_DB_PREFIX.'societe WHERE ';
|
||||||
|
$sql .= ' skype IS NOT NULL OR skype!=""';
|
||||||
|
$sql .= ' OR twitter IS NOT NULL OR twitter!=""';
|
||||||
|
$sql .= ' OR facebook IS NOT NULL OR facebook!=""';
|
||||||
|
$sql .= ' OR linkedin IS NOT NULL OR linkedin!=""';
|
||||||
|
$sql .= ' OR instagram IS NOT NULL OR instagram!=""';
|
||||||
|
$sql .= ' OR snapchat IS NOT NULL OR snapchat!=""';
|
||||||
|
$sql .= ' OR googleplus IS NOT NULL OR googleplus!=""';
|
||||||
|
$sql .= ' OR youtube IS NOT NULL OR youtube!=""';
|
||||||
|
$sql .= ' OR whatsapp IS NOT NULL OR whatsapp!=""';
|
||||||
|
//print $sql;
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
|
$arraysocialnetworks = array();
|
||||||
|
if (!empty($obj->skype)) {
|
||||||
|
$arraysocialnetworks['skype'] = $obj->skype;
|
||||||
|
}
|
||||||
|
if (!empty($obj->twitter)) {
|
||||||
|
$arraysocialnetworks['twitter'] = $obj->twitter;
|
||||||
|
}
|
||||||
|
if (!empty($obj->facebook)) {
|
||||||
|
$arraysocialnetworks['facebook'] = $obj->facebook;
|
||||||
|
}
|
||||||
|
if (!empty($obj->linkedin)) {
|
||||||
|
$arraysocialnetworks['linkedin'] = $obj->linkedin;
|
||||||
|
}
|
||||||
|
if (!empty($obj->instagram)) {
|
||||||
|
$arraysocialnetworks['instagram'] = $obj->instagram;
|
||||||
|
}
|
||||||
|
if (!empty($obj->snapchat)) {
|
||||||
|
$arraysocialnetworks['snapchat'] = $obj->snapchat;
|
||||||
|
}
|
||||||
|
if (!empty($obj->googleplus)) {
|
||||||
|
$arraysocialnetworks['googleplus'] = $obj->googleplus;
|
||||||
|
}
|
||||||
|
if (!empty($obj->youtube)) {
|
||||||
|
$arraysocialnetworks['youtube'] = $obj->youtube;
|
||||||
|
}
|
||||||
|
if (!empty($obj->whatsapp)) {
|
||||||
|
$arraysocialnetworks['whatsapp'] = $obj->whatsapp;
|
||||||
|
}
|
||||||
|
if ($obj->socialnetworks == '' || is_null($obj->socialnetworks)) {
|
||||||
|
$obj->socialnetworks = '[]';
|
||||||
|
}
|
||||||
|
$socialnetworks = array_merge($arraysocialnetworks, json_decode($obj->socialnetworks, true));
|
||||||
|
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX.'societe SET socialnetworks="'.$db->escape(json_encode($socialnetworks, true)).'"';
|
||||||
|
$sqlupd.= ', skype=null';
|
||||||
|
$sqlupd.= ', twitter=null';
|
||||||
|
$sqlupd.= ', facebook=null';
|
||||||
|
$sqlupd.= ', linkedin=null';
|
||||||
|
$sqlupd.= ', instagram=null';
|
||||||
|
$sqlupd.= ', snapchat=null';
|
||||||
|
$sqlupd.= ', googleplus=null';
|
||||||
|
$sqlupd.= ', youtube=null';
|
||||||
|
$sqlupd.= ', whatsapp=null';
|
||||||
|
$sqlupd.= ' WHERE rowid='.$obj->rowid;
|
||||||
|
//print $sqlupd."<br>";
|
||||||
|
$resqlupd = $db->query($sqlupd);
|
||||||
|
if (! $resqlupd) {
|
||||||
|
dol_print_error($db);
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
if (! $error) {
|
||||||
|
$db->commit();
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
print '<b>'.$langs->trans('MigrationThirdpartiesSocialNetworks')."</b><br>\n";
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|||||||
@ -964,6 +964,7 @@ DictionaryAccountancyJournal=Accounting journals
|
|||||||
DictionaryEMailTemplates=Email Templates
|
DictionaryEMailTemplates=Email Templates
|
||||||
DictionaryUnits=Units
|
DictionaryUnits=Units
|
||||||
DictionaryMeasuringUnits=Measuring Units
|
DictionaryMeasuringUnits=Measuring Units
|
||||||
|
DictionarySocialNetworks=Social Networks
|
||||||
DictionaryProspectStatus=Prospect status
|
DictionaryProspectStatus=Prospect status
|
||||||
DictionaryHolidayTypes=Types of leave
|
DictionaryHolidayTypes=Types of leave
|
||||||
DictionaryOpportunityStatus=Lead status for project/lead
|
DictionaryOpportunityStatus=Lead status for project/lead
|
||||||
|
|||||||
@ -205,6 +205,10 @@ MigrationRemiseExceptEntity=Update entity field value of llx_societe_remise_exce
|
|||||||
MigrationUserRightsEntity=Update entity field value of llx_user_rights
|
MigrationUserRightsEntity=Update entity field value of llx_user_rights
|
||||||
MigrationUserGroupRightsEntity=Update entity field value of llx_usergroup_rights
|
MigrationUserGroupRightsEntity=Update entity field value of llx_usergroup_rights
|
||||||
MigrationUserPhotoPath=Migration of photo paths for users
|
MigrationUserPhotoPath=Migration of photo paths for users
|
||||||
|
MigrationUsersSocialNetworks=Migration of users fields social networks
|
||||||
|
MigrationMembersSocialNetworks=Migration of members fields social networks
|
||||||
|
MigrationContactsSocialNetworks=Migration of contacts fields social networks
|
||||||
|
MigrationThirdpartiesSocialNetworks=Migration of thirdparties fields social networks
|
||||||
MigrationReloadModule=Reload module %s
|
MigrationReloadModule=Reload module %s
|
||||||
MigrationResetBlockedLog=Reset module BlockedLog for v7 algorithm
|
MigrationResetBlockedLog=Reset module BlockedLog for v7 algorithm
|
||||||
ShowNotAvailableOptions=Show unavailable options
|
ShowNotAvailableOptions=Show unavailable options
|
||||||
|
|||||||
@ -70,6 +70,8 @@ $extrafields = new ExtraFields($db);
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
$socialnetworks = getArrayOfSocialNetworks();
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('thirdpartycard','globalcard'));
|
$hookmanager->initHooks(array('thirdpartycard','globalcard'));
|
||||||
|
|
||||||
@ -147,7 +149,7 @@ if (empty($reshook))
|
|||||||
$object->client = $object->client | $soc_origin->client;
|
$object->client = $object->client | $soc_origin->client;
|
||||||
$object->fournisseur = $object->fournisseur | $soc_origin->fournisseur;
|
$object->fournisseur = $object->fournisseur | $soc_origin->fournisseur;
|
||||||
$listofproperties=array(
|
$listofproperties=array(
|
||||||
'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_pro', 'fax', 'email', 'skype', 'twitter', 'facebook', 'linkedin', 'url', 'barcode',
|
'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_pro', 'fax', 'email', 'skype', 'twitter', 'facebook', 'linkedin', 'socialnetworks', 'url', 'barcode',
|
||||||
'idprof1', 'idprof2', 'idprof3', 'idprof4', 'idprof5', 'idprof6',
|
'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',
|
'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',
|
'stcomm_id', 'outstanding_limit', 'price_level', 'parent', 'default_lang', 'ref', 'ref_ext', 'import_key', 'fk_incoterms', 'fk_multicurrency',
|
||||||
@ -407,10 +409,18 @@ if (empty($reshook))
|
|||||||
$object->town = GETPOST('town', 'alpha');
|
$object->town = GETPOST('town', 'alpha');
|
||||||
$object->country_id = GETPOST('country_id', 'int');
|
$object->country_id = GETPOST('country_id', 'int');
|
||||||
$object->state_id = GETPOST('state_id', 'int');
|
$object->state_id = GETPOST('state_id', 'int');
|
||||||
$object->skype = GETPOST('skype', 'alpha');
|
//$object->skype = GETPOST('skype', 'alpha');
|
||||||
$object->twitter = GETPOST('twitter', 'alpha');
|
//$object->twitter = GETPOST('twitter', 'alpha');
|
||||||
$object->facebook = GETPOST('facebook', 'alpha');
|
//$object->facebook = GETPOST('facebook', 'alpha');
|
||||||
$object->linkedin = GETPOST('linkedin', 'alpha');
|
//$object->linkedin = GETPOST('linkedin', 'alpha');
|
||||||
|
$object->socialnetworks = array();
|
||||||
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
|
foreach ($socialnetworks as $key => $value) {
|
||||||
|
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml')!='') {
|
||||||
|
$object->socialnetworks[$key] = GETPOST($key, 'alphanohtml');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$object->phone = GETPOST('phone', 'alpha');
|
$object->phone = GETPOST('phone', 'alpha');
|
||||||
$object->fax = GETPOST('fax', 'alpha');
|
$object->fax = GETPOST('fax', 'alpha');
|
||||||
$object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL));
|
$object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL));
|
||||||
@ -974,10 +984,18 @@ else
|
|||||||
$object->zip = GETPOST('zipcode', 'alpha');
|
$object->zip = GETPOST('zipcode', 'alpha');
|
||||||
$object->town = GETPOST('town', 'alpha');
|
$object->town = GETPOST('town', 'alpha');
|
||||||
$object->state_id = GETPOST('state_id', 'int');
|
$object->state_id = GETPOST('state_id', 'int');
|
||||||
$object->skype = GETPOST('skype', 'alpha');
|
//$object->skype = GETPOST('skype', 'alpha');
|
||||||
$object->twitter = GETPOST('twitter', 'alpha');
|
//$object->twitter = GETPOST('twitter', 'alpha');
|
||||||
$object->facebook = GETPOST('facebook', 'alpha');
|
//$object->facebook = GETPOST('facebook', 'alpha');
|
||||||
$object->linkedin = GETPOST('linkedin', 'alpha');
|
//$object->linkedin = GETPOST('linkedin', 'alpha');
|
||||||
|
$object->socialnetworks = array();
|
||||||
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
|
foreach ($socialnetworks as $key => $value) {
|
||||||
|
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml')!='') {
|
||||||
|
$object->socialnetworks[$key] = GETPOST($key, 'alphanohtml');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$object->phone = GETPOST('phone', 'alpha');
|
$object->phone = GETPOST('phone', 'alpha');
|
||||||
$object->fax = GETPOST('fax', 'alpha');
|
$object->fax = GETPOST('fax', 'alpha');
|
||||||
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
|
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
|
||||||
@ -1304,41 +1322,56 @@ else
|
|||||||
print '<tr><td>'.img_picto('', 'globe').' '.$form->editfieldkey('Web', 'url', '', $object, 0).'</td>';
|
print '<tr><td>'.img_picto('', 'globe').' '.$form->editfieldkey('Web', 'url', '', $object, 0).'</td>';
|
||||||
print '<td colspan="3"><input type="text" name="url" id="url" value="'.$object->url.'"></td></tr>';
|
print '<td colspan="3"><input type="text" name="url" id="url" value="'.$object->url.'"></td></tr>';
|
||||||
|
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
{
|
foreach ($socialnetworks as $key => $value) {
|
||||||
// Skype
|
if ($value['active']) {
|
||||||
if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
|
print '<tr>';
|
||||||
{
|
print '<td><label for="'.$value['label'].'">'.$form->editfieldkey($value['label'], $key, '', $object, 0).'</label></td>';
|
||||||
print '<tr><td>'.$form->editfieldkey('Skype', 'skype', '', $object, 0).'</td>';
|
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print '<input type="text" name="skype" class="minwidth100" maxlength="80" id="skype" value="'.dol_escape_htmltag(GETPOSTISSET("skype")?GETPOST("skype", 'alpha'):$object->skype).'">';
|
print '<input type="text" name="'.$key.'" id="'.$key.'" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET($key)?GETPOST($key, 'alphanohtml'):$object->socialnetworks[$key]).'">';
|
||||||
print '</td></tr>';
|
print '</td>';
|
||||||
}
|
print '</tr>';
|
||||||
// Twitter
|
} elseif (!empty($object->socialnetworks[$key])) {
|
||||||
if (! empty($conf->global->SOCIALNETWORKS_TWITTER))
|
print '<input type="hidden" name="'.$key.'" value="'.$object->socialnetworks[$key].'">';
|
||||||
{
|
|
||||||
print '<tr><td>'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).'</td>';
|
|
||||||
print '<td colspan="3">';
|
|
||||||
print '<input type="text" name="twitter" class="minwidth100" maxlength="80" id="twitter" value="'.dol_escape_htmltag(GETPOSTISSET("twitter")?GETPOST("twitter", 'alpha'):$object->twitter).'">';
|
|
||||||
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>';
|
|
||||||
}
|
|
||||||
// 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>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (! empty($conf->socialnetworks->enabled))
|
||||||
|
// {
|
||||||
|
// // Skype
|
||||||
|
// if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
|
||||||
|
// {
|
||||||
|
// print '<tr><td>'.$form->editfieldkey('Skype', 'skype', '', $object, 0).'</td>';
|
||||||
|
// print '<td colspan="3">';
|
||||||
|
// print '<input type="text" name="skype" class="minwidth100" maxlength="80" id="skype" value="'.dol_escape_htmltag(GETPOSTISSET("skype")?GETPOST("skype", 'alpha'):$object->skype).'">';
|
||||||
|
// print '</td></tr>';
|
||||||
|
// }
|
||||||
|
// // Twitter
|
||||||
|
// if (! empty($conf->global->SOCIALNETWORKS_TWITTER))
|
||||||
|
// {
|
||||||
|
// print '<tr><td>'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).'</td>';
|
||||||
|
// print '<td colspan="3">';
|
||||||
|
// print '<input type="text" name="twitter" class="minwidth100" maxlength="80" id="twitter" value="'.dol_escape_htmltag(GETPOSTISSET("twitter")?GETPOST("twitter", 'alpha'):$object->twitter).'">';
|
||||||
|
// 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>';
|
||||||
|
// }
|
||||||
|
// // 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>';
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
// Prof ids
|
// Prof ids
|
||||||
$i=1; $j=0;
|
$i=1; $j=0;
|
||||||
@ -1612,10 +1645,18 @@ else
|
|||||||
$object->town = GETPOST('town', 'alpha');
|
$object->town = GETPOST('town', 'alpha');
|
||||||
$object->country_id = GETPOST('country_id')?GETPOST('country_id', 'int'):$mysoc->country_id;
|
$object->country_id = GETPOST('country_id')?GETPOST('country_id', 'int'):$mysoc->country_id;
|
||||||
$object->state_id = GETPOST('state_id', 'int');
|
$object->state_id = GETPOST('state_id', 'int');
|
||||||
$object->skype = GETPOST('skype', 'alpha');
|
//$object->skype = GETPOST('skype', 'alpha');
|
||||||
$object->twitter = GETPOST('twitter', 'alpha');
|
//$object->twitter = GETPOST('twitter', 'alpha');
|
||||||
$object->facebook = GETPOST('facebook', 'alpha');
|
//$object->facebook = GETPOST('facebook', 'alpha');
|
||||||
$object->linkedin = GETPOST('linkedin', 'alpha');
|
//$object->linkedin = GETPOST('linkedin', 'alpha');
|
||||||
|
$object->socialnetworks = array();
|
||||||
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
|
foreach ($socialnetworks as $key => $value) {
|
||||||
|
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml')!='') {
|
||||||
|
$object->socialnetworks[$key] = GETPOST($key, 'alphanohtml');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$object->phone = GETPOST('phone', 'alpha');
|
$object->phone = GETPOST('phone', 'alpha');
|
||||||
$object->fax = GETPOST('fax', 'alpha');
|
$object->fax = GETPOST('fax', 'alpha');
|
||||||
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
|
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
|
||||||
@ -1927,33 +1968,47 @@ else
|
|||||||
print '<tr><td>'.img_picto('', 'globe').' '.$form->editfieldkey('Web', 'url', GETPOST('url', 'alpha'), $object, 0).'</td>';
|
print '<tr><td>'.img_picto('', 'globe').' '.$form->editfieldkey('Web', 'url', GETPOST('url', 'alpha'), $object, 0).'</td>';
|
||||||
print '<td colspan="3"><input type="text" name="url" id="url" class="maxwidth100onsmartphone quatrevingtpercent" value="'.(GETPOSTISSET('url')?GETPOST('url', 'alpha'):$object->irl).'"></td></tr>';
|
print '<td colspan="3"><input type="text" name="url" id="url" class="maxwidth100onsmartphone quatrevingtpercent" value="'.(GETPOSTISSET('url')?GETPOST('url', 'alpha'):$object->irl).'"></td></tr>';
|
||||||
|
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
{
|
foreach ($socialnetworks as $key => $value) {
|
||||||
// Skype
|
if ($value['active']) {
|
||||||
if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
|
print '<tr>';
|
||||||
{
|
print '<td><label for="'.$value['label'].'">'.$form->editfieldkey($value['label'], $key, '', $object, 0).'</label></td>';
|
||||||
print '<tr><td>'.$form->editfieldkey('Skype', 'skype', '', $object, 0).'</td>';
|
print '<td colspan="3">';
|
||||||
print '<td colspan="3"><input type="text" name="skype" id="skype" value="'.$object->skype.'"></td></tr>';
|
print '<input type="text" name="'.$key.'" id="'.$key.'" class="minwidth100" maxlength="80" value="'.$object->socialnetworks[$key].'">';
|
||||||
}
|
print '</td>';
|
||||||
// Twitter
|
print '</tr>';
|
||||||
if (! empty($conf->global->SOCIALNETWORKS_TWITTER))
|
} elseif (!empty($object->socialnetworks[$key])) {
|
||||||
{
|
print '<input type="hidden" name="'.$key.'" value="'.$object->socialnetworks[$key].'">';
|
||||||
print '<tr><td>'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).'</td>';
|
|
||||||
print '<td colspan="3"><input type="text" name="twitter" id="twitter" value="'.$object->twitter.'"></td></tr>';
|
|
||||||
}
|
|
||||||
// Facebook
|
|
||||||
if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
|
|
||||||
{
|
|
||||||
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>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// if (! empty($conf->socialnetworks->enabled))
|
||||||
|
// {
|
||||||
|
// // Skype
|
||||||
|
// if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
|
||||||
|
// {
|
||||||
|
// print '<tr><td>'.$form->editfieldkey('Skype', 'skype', '', $object, 0).'</td>';
|
||||||
|
// print '<td colspan="3"><input type="text" name="skype" id="skype" value="'.$object->skype.'"></td></tr>';
|
||||||
|
// }
|
||||||
|
// // Twitter
|
||||||
|
// if (! empty($conf->global->SOCIALNETWORKS_TWITTER))
|
||||||
|
// {
|
||||||
|
// print '<tr><td>'.$form->editfieldkey('Twitter', 'twitter', '', $object, 0).'</td>';
|
||||||
|
// print '<td colspan="3"><input type="text" name="twitter" id="twitter" value="'.$object->twitter.'"></td></tr>';
|
||||||
|
// }
|
||||||
|
// // Facebook
|
||||||
|
// if (! empty($conf->global->SOCIALNETWORKS_FACEBOOK))
|
||||||
|
// {
|
||||||
|
// 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>';
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
// Prof ids
|
// Prof ids
|
||||||
$i=1; $j=0;
|
$i=1; $j=0;
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
|
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
|
||||||
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2019 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
* Copyright (C) 2019 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||||
|
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -200,24 +201,35 @@ class Societe extends CommonObject
|
|||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $email;
|
public $email;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array array of socialnetworks
|
||||||
|
*/
|
||||||
|
public $socialnetworks;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Skype username
|
* Skype username
|
||||||
* @var string
|
* @var string
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public $skype;
|
public $skype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Twitter username
|
* Twitter username
|
||||||
* @var string
|
* @var string
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public $twitter;
|
public $twitter;
|
||||||
/**
|
/**
|
||||||
* Facebook username
|
* Facebook username
|
||||||
* @var string
|
* @var string
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public $facebook;
|
public $facebook;
|
||||||
/**
|
/**
|
||||||
* LinkedIn username
|
* LinkedIn username
|
||||||
* @var string
|
* @var string
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public $linkedin;
|
public $linkedin;
|
||||||
/**
|
/**
|
||||||
@ -873,10 +885,6 @@ class Societe extends CommonObject
|
|||||||
$this->fax = preg_replace("/\s/", "", $this->fax);
|
$this->fax = preg_replace("/\s/", "", $this->fax);
|
||||||
$this->fax = preg_replace("/\./", "", $this->fax);
|
$this->fax = preg_replace("/\./", "", $this->fax);
|
||||||
$this->email = trim($this->email);
|
$this->email = trim($this->email);
|
||||||
$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->url = $this->url?clean_url($this->url, 0):'';
|
||||||
$this->note_private = trim($this->note_private);
|
$this->note_private = trim($this->note_private);
|
||||||
$this->note_public = trim($this->note_public);
|
$this->note_public = trim($this->note_public);
|
||||||
@ -1017,10 +1025,7 @@ class Societe extends CommonObject
|
|||||||
$sql .= ",phone = ".(! empty($this->phone)?"'".$this->db->escape($this->phone)."'":"null");
|
$sql .= ",phone = ".(! empty($this->phone)?"'".$this->db->escape($this->phone)."'":"null");
|
||||||
$sql .= ",fax = ".(! empty($this->fax)?"'".$this->db->escape($this->fax)."'":"null");
|
$sql .= ",fax = ".(! empty($this->fax)?"'".$this->db->escape($this->fax)."'":"null");
|
||||||
$sql .= ",email = ".(! empty($this->email)?"'".$this->db->escape($this->email)."'":"null");
|
$sql .= ",email = ".(! empty($this->email)?"'".$this->db->escape($this->email)."'":"null");
|
||||||
$sql .= ",skype = ".(! empty($this->skype)?"'".$this->db->escape($this->skype)."'":"null");
|
$sql .= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'";
|
||||||
$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 .= ",url = ".(! empty($this->url)?"'".$this->db->escape($this->url)."'":"null");
|
||||||
|
|
||||||
$sql .= ",parent = " . ($this->parent > 0 ? $this->parent : "null");
|
$sql .= ",parent = " . ($this->parent > 0 ? $this->parent : "null");
|
||||||
@ -1162,10 +1167,7 @@ class Societe extends CommonObject
|
|||||||
$lmember->zip=$this->zip;
|
$lmember->zip=$this->zip;
|
||||||
$lmember->town=$this->town;
|
$lmember->town=$this->town;
|
||||||
$lmember->email=$this->email;
|
$lmember->email=$this->email;
|
||||||
$lmember->skype=$this->skype;
|
$lmember->socialnetworks=$this->socialnetworks;
|
||||||
$lmember->twitter=$this->twitter;
|
|
||||||
$lmember->facebook=$this->facebook;
|
|
||||||
$lmember->linkedin=$this->linkedin;
|
|
||||||
$lmember->phone=$this->phone;
|
$lmember->phone=$this->phone;
|
||||||
$lmember->state_id=$this->state_id;
|
$lmember->state_id=$this->state_id;
|
||||||
$lmember->country_id=$this->country_id;
|
$lmember->country_id=$this->country_id;
|
||||||
@ -1272,7 +1274,9 @@ class Societe extends CommonObject
|
|||||||
$sql .= ', s.status';
|
$sql .= ', s.status';
|
||||||
$sql .= ', s.price_level';
|
$sql .= ', s.price_level';
|
||||||
$sql .= ', s.tms as date_modification, s.fk_user_creat, s.fk_user_modif';
|
$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.linkedin, 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';
|
||||||
|
$sql .= ', s.socialnetworks';
|
||||||
|
$sql .= ', 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.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.capital, s.tva_intra';
|
||||||
$sql .= ', s.fk_typent as typent_id';
|
$sql .= ', s.fk_typent as typent_id';
|
||||||
@ -1324,7 +1328,7 @@ class Societe extends CommonObject
|
|||||||
$num=$this->db->num_rows($resql);
|
$num=$this->db->num_rows($resql);
|
||||||
if ($num > 1)
|
if ($num > 1)
|
||||||
{
|
{
|
||||||
$this->error='Fetch found several records. Rename one of tirdparties to avoid duplicate.';
|
$this->error='Fetch found several records. Rename one of thirdparties to avoid duplicate.';
|
||||||
dol_syslog($this->error, LOG_ERR);
|
dol_syslog($this->error, LOG_ERR);
|
||||||
$result = -2;
|
$result = -2;
|
||||||
}
|
}
|
||||||
@ -1366,10 +1370,8 @@ class Societe extends CommonObject
|
|||||||
$this->status_prospect_label = $label; // label status prospect
|
$this->status_prospect_label = $label; // label status prospect
|
||||||
|
|
||||||
$this->email = $obj->email;
|
$this->email = $obj->email;
|
||||||
$this->skype = $obj->skype;
|
$this->socialnetworks = (array) json_decode($obj->socialnetworks, true);
|
||||||
$this->twitter = $obj->twitter;
|
|
||||||
$this->facebook = $obj->facebook;
|
|
||||||
$this->linkedin = $obj->linkedin;
|
|
||||||
$this->url = $obj->url;
|
$this->url = $obj->url;
|
||||||
$this->phone = $obj->phone;
|
$this->phone = $obj->phone;
|
||||||
$this->fax = $obj->fax;
|
$this->fax = $obj->fax;
|
||||||
@ -3391,10 +3393,7 @@ class Societe extends CommonObject
|
|||||||
$this->country_id=$member->country_id;
|
$this->country_id=$member->country_id;
|
||||||
$this->phone=$member->phone; // Prof phone
|
$this->phone=$member->phone; // Prof phone
|
||||||
$this->email=$member->email;
|
$this->email=$member->email;
|
||||||
$this->skype=$member->skype;
|
$this->socialnetworks = $member->socialnetworks;
|
||||||
$this->twitter=$member->twitter;
|
|
||||||
$this->facebook=$member->facebook;
|
|
||||||
$this->linkedin=$member->linkedin;
|
|
||||||
|
|
||||||
$this->client = 1; // A member is a customer by default
|
$this->client = 1; // A member is a customer by default
|
||||||
$this->code_client = ($customercode?$customercode:-1);
|
$this->code_client = ($customercode?$customercode:-1);
|
||||||
@ -3562,10 +3561,12 @@ class Societe extends CommonObject
|
|||||||
$this->country_id=1;
|
$this->country_id=1;
|
||||||
$this->country_code='FR';
|
$this->country_code='FR';
|
||||||
$this->email='specimen@specimen.com';
|
$this->email='specimen@specimen.com';
|
||||||
$this->skype='tom.hanson';
|
$this->socialnetworks = array(
|
||||||
$this->twitter='tomhanson';
|
'skype' => 'tom.hanson',
|
||||||
$this->facebook='tomhanson';
|
'twitter' => 'tomhanson',
|
||||||
$this->linkedin='tomhanson';
|
'facebook' => 'tomhanson',
|
||||||
|
'linkedin' => 'tomhanson',
|
||||||
|
);
|
||||||
$this->url='http://www.specimen.com';
|
$this->url='http://www.specimen.com';
|
||||||
|
|
||||||
$this->phone='0909090901';
|
$this->phone='0909090901';
|
||||||
|
|||||||
@ -99,6 +99,8 @@ $extrafields = new ExtraFields($db);
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
$socialnetworks = getArrayOfSocialNetworks();
|
||||||
|
|
||||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||||
$hookmanager->initHooks(array('usercard', 'globalcard'));
|
$hookmanager->initHooks(array('usercard', 'globalcard'));
|
||||||
|
|
||||||
@ -107,7 +109,6 @@ $hookmanager->initHooks(array('usercard', 'globalcard'));
|
|||||||
/**
|
/**
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$parameters=array('id' => $id, 'socid' => $socid, 'group' => $group, 'caneditgroup' => $caneditgroup);
|
$parameters=array('id' => $id, 'socid' => $socid, 'group' => $group, 'caneditgroup' => $caneditgroup);
|
||||||
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
@ -211,10 +212,16 @@ if (empty($reshook)) {
|
|||||||
$object->office_fax = GETPOST("office_fax", 'alphanohtml');
|
$object->office_fax = GETPOST("office_fax", 'alphanohtml');
|
||||||
$object->user_mobile = GETPOST("user_mobile", 'alphanohtml');
|
$object->user_mobile = GETPOST("user_mobile", 'alphanohtml');
|
||||||
|
|
||||||
$object->skype = GETPOST("skype", 'alphanohtml');
|
//$object->skype = GETPOST("skype", 'alphanohtml');
|
||||||
$object->twitter = GETPOST("twitter", 'alphanohtml');
|
//$object->twitter = GETPOST("twitter", 'alphanohtml');
|
||||||
$object->facebook = GETPOST("facebook", 'alphanohtml');
|
//$object->facebook = GETPOST("facebook", 'alphanohtml');
|
||||||
$object->linkedin = GETPOST("linkedin", 'alphanohtml');
|
//$object->linkedin = GETPOST("linkedin", 'alphanohtml');
|
||||||
|
$object->socialnetworks = array();
|
||||||
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
|
foreach ($socialnetworks as $key => $value) {
|
||||||
|
$object->socialnetworks[$key] = GETPOST($key, 'alphanohtml');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$object->email = preg_replace('/\s+/', '', GETPOST("email", 'alphanohtml'));
|
$object->email = preg_replace('/\s+/', '', GETPOST("email", 'alphanohtml'));
|
||||||
$object->job = GETPOST("job", 'nohtml');
|
$object->job = GETPOST("job", 'nohtml');
|
||||||
@ -366,12 +373,16 @@ if (empty($reshook)) {
|
|||||||
$object->office_phone = GETPOST("office_phone", 'alphanohtml');
|
$object->office_phone = GETPOST("office_phone", 'alphanohtml');
|
||||||
$object->office_fax = GETPOST("office_fax", 'alphanohtml');
|
$object->office_fax = GETPOST("office_fax", 'alphanohtml');
|
||||||
$object->user_mobile = GETPOST("user_mobile", 'alphanohtml');
|
$object->user_mobile = GETPOST("user_mobile", 'alphanohtml');
|
||||||
|
//$object->skype = GETPOST("skype", 'alphanohtml');
|
||||||
$object->skype = GETPOST("skype", 'alphanohtml');
|
//$object->twitter = GETPOST("twitter", 'alphanohtml');
|
||||||
$object->twitter = GETPOST("twitter", 'alphanohtml');
|
//$object->facebook = GETPOST("facebook", 'alphanohtml');
|
||||||
$object->facebook = GETPOST("facebook", 'alphanohtml');
|
//$object->linkedin = GETPOST("linkedin", 'alphanohtml');
|
||||||
$object->linkedin = GETPOST("linkedin", 'alphanohtml');
|
$object->socialnetworks = array();
|
||||||
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
|
foreach ($socialnetworks as $key => $value) {
|
||||||
|
$object->socialnetworks[$key] = GETPOST($key, 'alphanohtml');
|
||||||
|
}
|
||||||
|
}
|
||||||
$object->email = preg_replace('/\s+/', '', GETPOST("email", 'alphanohtml'));
|
$object->email = preg_replace('/\s+/', '', GETPOST("email", 'alphanohtml'));
|
||||||
$object->job = GETPOST("job", 'nohtml');
|
$object->job = GETPOST("job", 'nohtml');
|
||||||
$object->signature = GETPOST("signature", 'none');
|
$object->signature = GETPOST("signature", 'none');
|
||||||
@ -630,10 +641,10 @@ if (empty($reshook)) {
|
|||||||
$ldap_phone = $attribute[$conf->global->LDAP_FIELD_PHONE];
|
$ldap_phone = $attribute[$conf->global->LDAP_FIELD_PHONE];
|
||||||
$ldap_fax = $attribute[$conf->global->LDAP_FIELD_FAX];
|
$ldap_fax = $attribute[$conf->global->LDAP_FIELD_FAX];
|
||||||
$ldap_mobile = $attribute[$conf->global->LDAP_FIELD_MOBILE];
|
$ldap_mobile = $attribute[$conf->global->LDAP_FIELD_MOBILE];
|
||||||
$ldap_skype = $attribute[$conf->global->LDAP_FIELD_SKYPE];
|
$ldap_social['skype'] = $attribute[$conf->global->LDAP_FIELD_SKYPE];
|
||||||
$ldap_twitter = $attribute[$conf->global->LDAP_FIELD_TWITTER];
|
$ldap_social['twitter'] = $attribute[$conf->global->LDAP_FIELD_TWITTER];
|
||||||
$ldap_facebook = $attribute[$conf->global->LDAP_FIELD_FACEBOOK];
|
$ldap_social['facebook'] = $attribute[$conf->global->LDAP_FIELD_FACEBOOK];
|
||||||
$ldap_linkedin = $attribute[$conf->global->LDAP_FIELD_LINKEDIN];
|
$ldap_social['linkedin'] = $attribute[$conf->global->LDAP_FIELD_LINKEDIN];
|
||||||
$ldap_mail = $attribute[$conf->global->LDAP_FIELD_MAIL];
|
$ldap_mail = $attribute[$conf->global->LDAP_FIELD_MAIL];
|
||||||
$ldap_sid = $attribute[$conf->global->LDAP_FIELD_SID];
|
$ldap_sid = $attribute[$conf->global->LDAP_FIELD_SID];
|
||||||
}
|
}
|
||||||
@ -1085,73 +1096,95 @@ if ($action == 'create' || $action == 'adduserldap')
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Skype
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
foreach ($socialnetworks as $key => $value) {
|
||||||
{
|
if ($value['active']) {
|
||||||
print '<tr><td>'.$langs->trans("Skype").'</td>';
|
print '<tr><td>'.$langs->trans($value['label']).'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (! empty($ldap_skype))
|
if (! empty($ldap_social[$key])) {
|
||||||
{
|
print '<input type="hidden" name="'.$key.'" value="'.$ldap_social[$key].'">';
|
||||||
print '<input type="hidden" name="skype" value="'.$ldap_skype.'">';
|
print $ldap_social[$key];
|
||||||
print $ldap_skype;
|
} else {
|
||||||
}
|
print '<input class="maxwidth200" type="text" name="'.$key.'" value="'.GETPOST($key, 'alphanohtml').'">';
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<input class="maxwidth200" type="text" name="skype" value="'.GETPOST('skype', 'alpha').'">';
|
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
} else {
|
||||||
|
// if social network is not active but value exist we do not want to loose it
|
||||||
|
if (! empty($ldap_social[$key])) {
|
||||||
|
print '<input type="hidden" name="'.$key.'" value="'.$ldap_social[$key].'">';
|
||||||
|
} else {
|
||||||
|
print '<input type="hidden" name="'.$key.'" value="'.GETPOST($key, 'alphanohtml').'">';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// // Skype
|
||||||
|
// if (! empty($conf->socialnetworks->enabled))
|
||||||
|
// {
|
||||||
|
// print '<tr><td>'.$langs->trans("Skype").'</td>';
|
||||||
|
// print '<td>';
|
||||||
|
// if (! empty($ldap_skype))
|
||||||
|
// {
|
||||||
|
// print '<input type="hidden" name="skype" value="'.$ldap_skype.'">';
|
||||||
|
// print $ldap_skype;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// print '<input class="maxwidth200" type="text" name="skype" value="'.GETPOST('skype', 'alpha').'">';
|
||||||
|
// }
|
||||||
|
// print '</td></tr>';
|
||||||
|
// }
|
||||||
|
|
||||||
// Twitter
|
// // Twitter
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
// if (! empty($conf->socialnetworks->enabled))
|
||||||
{
|
// {
|
||||||
print '<tr><td>'.$langs->trans("Twitter").'</td>';
|
// print '<tr><td>'.$langs->trans("Twitter").'</td>';
|
||||||
print '<td>';
|
// print '<td>';
|
||||||
if (! empty($ldap_twitter))
|
// if (! empty($ldap_twitter))
|
||||||
{
|
// {
|
||||||
print '<input type="hidden" name="twitter" value="'.$ldap_twitter.'">';
|
// print '<input type="hidden" name="twitter" value="'.$ldap_twitter.'">';
|
||||||
print $ldap_twitter;
|
// print $ldap_twitter;
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
print '<input class="maxwidth200" type="text" name="twitter" value="'.GETPOST('twitter', 'alpha').'">';
|
// print '<input class="maxwidth200" type="text" name="twitter" value="'.GETPOST('twitter', 'alpha').'">';
|
||||||
}
|
// }
|
||||||
print '</td></tr>';
|
// print '</td></tr>';
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Facebook
|
// // Facebook
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
// if (! empty($conf->socialnetworks->enabled))
|
||||||
{
|
// {
|
||||||
print '<tr><td>'.$langs->trans("Facebook").'</td>';
|
// print '<tr><td>'.$langs->trans("Facebook").'</td>';
|
||||||
print '<td>';
|
// print '<td>';
|
||||||
if (! empty($ldap_facebook))
|
// if (! empty($ldap_facebook))
|
||||||
{
|
// {
|
||||||
print '<input type="hidden" name="facebook" value="'.$ldap_facebook.'">';
|
// print '<input type="hidden" name="facebook" value="'.$ldap_facebook.'">';
|
||||||
print $ldap_facebook;
|
// print $ldap_facebook;
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
print '<input class="maxwidth200" type="text" name="facebook" value="'.GETPOST('facebook', 'alpha').'">';
|
// print '<input class="maxwidth200" type="text" name="facebook" value="'.GETPOST('facebook', 'alpha').'">';
|
||||||
}
|
// }
|
||||||
print '</td></tr>';
|
// print '</td></tr>';
|
||||||
}
|
// }
|
||||||
|
|
||||||
// LinkedIn
|
// // LinkedIn
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
// if (! empty($conf->socialnetworks->enabled))
|
||||||
{
|
// {
|
||||||
print '<tr><td>'.$langs->trans("LinkedIn").'</td>';
|
// print '<tr><td>'.$langs->trans("LinkedIn").'</td>';
|
||||||
print '<td>';
|
// print '<td>';
|
||||||
if (! empty($ldap_linkedin))
|
// if (! empty($ldap_linkedin))
|
||||||
{
|
// {
|
||||||
print '<input type="hidden" name="linkedin" value="'.$ldap_linkedin.'">';
|
// print '<input type="hidden" name="linkedin" value="'.$ldap_linkedin.'">';
|
||||||
print $ldap_linkedin;
|
// print $ldap_linkedin;
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
print '<input class="maxwidth200" type="text" name="linkedin" value="'.GETPOST('linkedin', 'alpha').'">';
|
// print '<input class="maxwidth200" type="text" name="linkedin" value="'.GETPOST('linkedin', 'alpha').'">';
|
||||||
}
|
// }
|
||||||
print '</td></tr>';
|
// print '</td></tr>';
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Accountancy code
|
// Accountancy code
|
||||||
if ($conf->accounting->enabled)
|
if ($conf->accounting->enabled)
|
||||||
@ -2431,73 +2464,92 @@ else
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Skype
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
foreach ($socialnetworks as $key => $value) {
|
||||||
{
|
if ($value['active']) {
|
||||||
print '<tr><td>'.$langs->trans("Skype").'</td>';
|
print '<tr><td>'.$langs->trans($value['label']).'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($caneditfield && empty($object->ldap_sid))
|
if ($caneditfield && empty($object->ldap_sid)) {
|
||||||
{
|
print '<input size="40" type="text" name="'.$key.'" class="flat" value="'.$object->socialnetworks[$key].'">';
|
||||||
print '<input size="40" type="text" name="skype" class="flat" value="'.$object->skype.'">';
|
} else {
|
||||||
}
|
print '<input type="hidden" name="'.$key.'" value="'.$object->socialnetworks[$key].'">';
|
||||||
else
|
print $object->socialnetworks[$key];
|
||||||
{
|
|
||||||
print '<input type="hidden" name="skype" value="'.$object->skype.'">';
|
|
||||||
print $object->skype;
|
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
} else {
|
||||||
|
// if social network is not active but value exist we do not want to loose it
|
||||||
|
print '<input type="hidden" name="'.$key.'" value="'.$object->socialnetworks[$key].'">';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Twitter
|
// // Skype
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
// if (! empty($conf->socialnetworks->enabled))
|
||||||
{
|
// {
|
||||||
print '<tr><td>'.$langs->trans("Twitter").'</td>';
|
// print '<tr><td>'.$langs->trans("Skype").'</td>';
|
||||||
print '<td>';
|
// print '<td>';
|
||||||
if ($caneditfield && empty($object->ldap_sid))
|
// if ($caneditfield && empty($object->ldap_sid))
|
||||||
{
|
// {
|
||||||
print '<input size="40" type="text" name="twitter" class="flat" value="'.$object->twitter.'">';
|
// print '<input size="40" type="text" name="skype" class="flat" value="'.$object->skype.'">';
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
print '<input type="hidden" name="twitter" value="'.$object->twitter.'">';
|
// print '<input type="hidden" name="skype" value="'.$object->skype.'">';
|
||||||
print $object->twitter;
|
// print $object->skype;
|
||||||
}
|
// }
|
||||||
print '</td></tr>';
|
// print '</td></tr>';
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Facebook
|
// // Twitter
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
// if (! empty($conf->socialnetworks->enabled))
|
||||||
{
|
// {
|
||||||
print '<tr><td>'.$langs->trans("Facebook").'</td>';
|
// print '<tr><td>'.$langs->trans("Twitter").'</td>';
|
||||||
print '<td>';
|
// print '<td>';
|
||||||
if ($caneditfield && empty($object->ldap_sid))
|
// if ($caneditfield && empty($object->ldap_sid))
|
||||||
{
|
// {
|
||||||
print '<input size="40" type="text" name="facebook" class="flat" value="'.$object->facebook.'">';
|
// print '<input size="40" type="text" name="twitter" class="flat" value="'.$object->twitter.'">';
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
print '<input type="hidden" name="facebook" value="'.$object->facebook.'">';
|
// print '<input type="hidden" name="twitter" value="'.$object->twitter.'">';
|
||||||
print $object->facebook;
|
// print $object->twitter;
|
||||||
}
|
// }
|
||||||
print '</td></tr>';
|
// print '</td></tr>';
|
||||||
}
|
// }
|
||||||
|
|
||||||
// LinkedIn
|
// // Facebook
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
// if (! empty($conf->socialnetworks->enabled))
|
||||||
{
|
// {
|
||||||
print '<tr><td>'.$langs->trans("LinkedIn").'</td>';
|
// print '<tr><td>'.$langs->trans("Facebook").'</td>';
|
||||||
print '<td>';
|
// print '<td>';
|
||||||
if ($caneditfield && empty($object->ldap_sid))
|
// if ($caneditfield && empty($object->ldap_sid))
|
||||||
{
|
// {
|
||||||
print '<input size="40" type="text" name="linkedin" class="flat" value="'.$object->linkedin.'">';
|
// print '<input size="40" type="text" name="facebook" class="flat" value="'.$object->facebook.'">';
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
print '<input type="hidden" name="linkedin" value="'.$object->linkedin.'">';
|
// print '<input type="hidden" name="facebook" value="'.$object->facebook.'">';
|
||||||
print $object->linkedin;
|
// print $object->facebook;
|
||||||
}
|
// }
|
||||||
print '</td></tr>';
|
// 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>';
|
||||||
|
// }
|
||||||
|
|
||||||
// OpenID url
|
// OpenID url
|
||||||
if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER))
|
if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER))
|
||||||
|
|||||||
@ -74,9 +74,35 @@ class User extends CommonObject
|
|||||||
public $email;
|
public $email;
|
||||||
public $personal_email;
|
public $personal_email;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array array of socialnetworks
|
||||||
|
*/
|
||||||
|
public $socialnetworks;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skype username
|
||||||
|
* @var string
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
public $skype;
|
public $skype;
|
||||||
|
/**
|
||||||
|
* Twitter username
|
||||||
|
* @var string
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
public $twitter;
|
public $twitter;
|
||||||
|
/**
|
||||||
|
* Facebook username
|
||||||
|
* @var string
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
public $facebook;
|
public $facebook;
|
||||||
|
/**
|
||||||
|
* Linkedin username
|
||||||
|
* @var string
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
public $linkedin;
|
public $linkedin;
|
||||||
|
|
||||||
public $job; // job position
|
public $job; // job position
|
||||||
@ -255,7 +281,8 @@ class User extends CommonObject
|
|||||||
$login=trim($login);
|
$login=trim($login);
|
||||||
|
|
||||||
// Get user
|
// Get user
|
||||||
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.personal_email, u.job, u.skype, u.twitter, u.facebook, u.linkedin,";
|
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.personal_email, u.job,";
|
||||||
|
$sql.= " u.socialnetworks,";
|
||||||
$sql.= " u.signature, u.office_phone, u.office_fax, u.user_mobile, u.personal_mobile,";
|
$sql.= " u.signature, u.office_phone, u.office_fax, u.user_mobile, u.personal_mobile,";
|
||||||
$sql.= " u.address, u.zip, u.town, u.fk_state as state_id, u.fk_country as country_id,";
|
$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 as note_private, u.note_public,";
|
$sql.= " u.admin, u.login, u.note as note_private, u.note_public,";
|
||||||
@ -367,10 +394,7 @@ class User extends CommonObject
|
|||||||
$this->personal_mobile = $obj->personal_mobile;
|
$this->personal_mobile = $obj->personal_mobile;
|
||||||
$this->email = $obj->email;
|
$this->email = $obj->email;
|
||||||
$this->personal_email = $obj->personal_email;
|
$this->personal_email = $obj->personal_email;
|
||||||
$this->skype = $obj->skype;
|
$this->socialnetworks = (array) json_decode($obj->socialnetworks, true);
|
||||||
$this->twitter = $obj->twitter;
|
|
||||||
$this->facebook = $obj->facebook;
|
|
||||||
$this->linkedin = $obj->linkedin;
|
|
||||||
$this->job = $obj->job;
|
$this->job = $obj->job;
|
||||||
$this->signature = $obj->signature;
|
$this->signature = $obj->signature;
|
||||||
$this->admin = $obj->admin;
|
$this->admin = $obj->admin;
|
||||||
@ -1292,10 +1316,7 @@ class User extends CommonObject
|
|||||||
$this->firstname = $contact->firstname;
|
$this->firstname = $contact->firstname;
|
||||||
$this->gender = $contact->gender;
|
$this->gender = $contact->gender;
|
||||||
$this->email = $contact->email;
|
$this->email = $contact->email;
|
||||||
$this->skype = $contact->skype;
|
$this->socialnetworks = $contact->socialnetworks;
|
||||||
$this->twitter = $contact->twitter;
|
|
||||||
$this->facebook = $contact->facebook;
|
|
||||||
$this->linkedin = $contact->linkedin;
|
|
||||||
$this->office_phone = $contact->phone_pro;
|
$this->office_phone = $contact->phone_pro;
|
||||||
$this->office_fax = $contact->fax;
|
$this->office_fax = $contact->fax;
|
||||||
$this->user_mobile = $contact->phone_mobile;
|
$this->user_mobile = $contact->phone_mobile;
|
||||||
@ -1511,11 +1532,6 @@ class User extends CommonObject
|
|||||||
$this->email = trim($this->email);
|
$this->email = trim($this->email);
|
||||||
$this->personal_email = trim($this->personal_email);
|
$this->personal_email = trim($this->personal_email);
|
||||||
|
|
||||||
$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->job = trim($this->job);
|
||||||
$this->signature = trim($this->signature);
|
$this->signature = trim($this->signature);
|
||||||
$this->note_public = trim($this->note_public);
|
$this->note_public = trim($this->note_public);
|
||||||
@ -1568,10 +1584,7 @@ class User extends CommonObject
|
|||||||
$sql.= ", personal_mobile = '".$this->db->escape($this->personal_mobile)."'";
|
$sql.= ", personal_mobile = '".$this->db->escape($this->personal_mobile)."'";
|
||||||
$sql.= ", email = '".$this->db->escape($this->email)."'";
|
$sql.= ", email = '".$this->db->escape($this->email)."'";
|
||||||
$sql.= ", personal_email = '".$this->db->escape($this->personal_email)."'";
|
$sql.= ", personal_email = '".$this->db->escape($this->personal_email)."'";
|
||||||
$sql.= ", skype = '".$this->db->escape($this->skype)."'";
|
$sql.= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'";
|
||||||
$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.= ", job = '".$this->db->escape($this->job)."'";
|
||||||
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
|
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
|
||||||
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
|
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
|
||||||
@ -1661,10 +1674,7 @@ class User extends CommonObject
|
|||||||
|
|
||||||
$adh->email=$this->email;
|
$adh->email=$this->email;
|
||||||
|
|
||||||
$adh->skype=$this->skype;
|
$adh->socialnetworks=$this->socialnetworks;
|
||||||
$adh->twitter=$this->twitter;
|
|
||||||
$adh->facebook=$this->facebook;
|
|
||||||
$adh->linkedin=$this->linkedin;
|
|
||||||
|
|
||||||
$adh->phone=$this->office_phone;
|
$adh->phone=$this->office_phone;
|
||||||
$adh->phone_mobile=$this->user_mobile;
|
$adh->phone_mobile=$this->user_mobile;
|
||||||
@ -1714,10 +1724,7 @@ class User extends CommonObject
|
|||||||
|
|
||||||
$tmpobj->email=$this->email;
|
$tmpobj->email=$this->email;
|
||||||
|
|
||||||
$tmpobj->skype=$this->skype;
|
$tmpobj->socialnetworks=$this->socialnetworks;
|
||||||
$tmpobj->twitter=$this->twitter;
|
|
||||||
$tmpobj->facebook=$this->facebook;
|
|
||||||
$tmpobj->linkedin=$this->linkedin;
|
|
||||||
|
|
||||||
$tmpobj->phone_pro=$this->office_phone;
|
$tmpobj->phone_pro=$this->office_phone;
|
||||||
$tmpobj->phone_mobile=$this->user_mobile;
|
$tmpobj->phone_mobile=$this->user_mobile;
|
||||||
@ -2701,10 +2708,12 @@ class User extends CommonObject
|
|||||||
$this->note_private='This is a note private';
|
$this->note_private='This is a note private';
|
||||||
$this->email='email@specimen.com';
|
$this->email='email@specimen.com';
|
||||||
$this->personal_email='personalemail@specimen.com';
|
$this->personal_email='personalemail@specimen.com';
|
||||||
$this->skype='skypepseudo';
|
$this->socialnetworks = array(
|
||||||
$this->twitter='twitterpseudo';
|
'skype' => 'skypepseudo',
|
||||||
$this->facebook='facebookpseudo';
|
'twitter' => 'twitterpseudo',
|
||||||
$this->linkedin='linkedinpseudo';
|
'facebook' => 'facebookpseudo',
|
||||||
|
'linkedin' => 'linkedinpseudo',
|
||||||
|
);
|
||||||
$this->office_phone='0999999999';
|
$this->office_phone='0999999999';
|
||||||
$this->office_fax='0999999998';
|
$this->office_fax='0999999998';
|
||||||
$this->user_mobile='0999999997';
|
$this->user_mobile='0999999997';
|
||||||
|
|||||||
@ -207,7 +207,7 @@ class ContactTest extends PHPUnit\Framework\TestCase
|
|||||||
$localobject->phone_mobile='New tel mobile';
|
$localobject->phone_mobile='New tel mobile';
|
||||||
$localobject->fax='New fax';
|
$localobject->fax='New fax';
|
||||||
$localobject->email='newemail@newemail.com';
|
$localobject->email='newemail@newemail.com';
|
||||||
$localobject->jabberid='New im id';
|
$localobject->socialnetworks['jabber']='New im id';
|
||||||
$localobject->default_lang='es_ES';
|
$localobject->default_lang='es_ES';
|
||||||
|
|
||||||
$result=$localobject->update($localobject->id, $user);
|
$result=$localobject->update($localobject->id, $user);
|
||||||
@ -257,8 +257,8 @@ class ContactTest extends PHPUnit\Framework\TestCase
|
|||||||
$this->assertEquals($localobject->fax, $newobject->fax);
|
$this->assertEquals($localobject->fax, $newobject->fax);
|
||||||
print __METHOD__." old=".$localobject->email." new=".$newobject->email."\n";
|
print __METHOD__." old=".$localobject->email." new=".$newobject->email."\n";
|
||||||
$this->assertEquals($localobject->email, $newobject->email);
|
$this->assertEquals($localobject->email, $newobject->email);
|
||||||
print __METHOD__." old=".$localobject->jabberid." new=".$newobject->jabberid."\n";
|
print __METHOD__." old=".$localobject->socialnetworks['jabber']." new=".$newobject->socialnetworks['jabber']."\n";
|
||||||
$this->assertEquals($localobject->jabberid, $newobject->jabberid);
|
$this->assertEquals($localobject->socialnetworks['jabber'], $newobject->socialnetworks['jabber']);
|
||||||
print __METHOD__." old=".$localobject->default_lang." new=".$newobject->default_lang."\n";
|
print __METHOD__." old=".$localobject->default_lang." new=".$newobject->default_lang."\n";
|
||||||
$this->assertEquals($localobject->default_lang, $newobject->default_lang);
|
$this->assertEquals($localobject->default_lang, $newobject->default_lang);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user