work on user
This commit is contained in:
parent
230c14e189
commit
1cd59cc16a
@ -487,7 +487,7 @@ if (empty($reshook))
|
|||||||
$object->socialnetworks = array();
|
$object->socialnetworks = array();
|
||||||
if (! empty($conf->socialnetworks->enabled)) {
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
foreach ($socialnetworks as $key => $value) {
|
foreach ($socialnetworks as $key => $value) {
|
||||||
if (!$value['active']) continue;
|
if (!$value['active']) break;
|
||||||
$object->socialnetworks[$key] = GETPOST("member_".$key, 'alpha');
|
$object->socialnetworks[$key] = GETPOST("member_".$key, 'alpha');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1030,7 +1030,7 @@ else
|
|||||||
|
|
||||||
if (! empty($conf->socialnetworks->enabled)) {
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
foreach ($socialnetworks as $key => $value) {
|
foreach ($socialnetworks as $key => $value) {
|
||||||
if (!$value['active']) continue;
|
if (!$value['active']) break;
|
||||||
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>';
|
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>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1282,7 +1282,7 @@ else
|
|||||||
|
|
||||||
if (! empty($conf->socialnetworks->enabled)) {
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
foreach ($socialnetworks as $key => $value) {
|
foreach ($socialnetworks as $key => $value) {
|
||||||
if (!$value['active']) continue;
|
if (!$value['active']) break;
|
||||||
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>';
|
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>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,6 +62,8 @@ $extrafields = new ExtraFields($db);
|
|||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$extralabels=$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,16 +188,23 @@ 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 (!$value['active']) break;
|
||||||
|
$object->socialnetworks[$key] = GETPOST($key, 'alphanohtml');
|
||||||
|
}
|
||||||
|
}
|
||||||
$object->email = GETPOST("email", 'alpha');
|
$object->email = GETPOST("email", 'alpha');
|
||||||
$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');
|
||||||
@ -359,15 +368,21 @@ if (empty($reshook))
|
|||||||
$object->country_id = GETPOST("country_id", 'int');
|
$object->country_id = GETPOST("country_id", 'int');
|
||||||
|
|
||||||
$object->email = GETPOST("email", 'alpha');
|
$object->email = GETPOST("email", 'alpha');
|
||||||
$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 (!$value['active']) break;
|
||||||
|
$object->socialnetworks[$key] = GETPOST($key, 'alpha');
|
||||||
|
}
|
||||||
|
}
|
||||||
$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');
|
||||||
@ -676,39 +691,50 @@ else
|
|||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
{
|
foreach ($socialnetworks as $key => $value) {
|
||||||
// Jabber
|
if (!$value['active']) break;
|
||||||
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))
|
|
||||||
{
|
|
||||||
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">';
|
||||||
@ -968,39 +994,50 @@ 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']) break;
|
||||||
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))
|
|
||||||
{
|
|
||||||
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">';
|
||||||
|
|||||||
@ -110,8 +110,36 @@ class Contact extends CommonObject
|
|||||||
* @deprecated
|
* @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;
|
||||||
@ -357,10 +385,12 @@ 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 .= ", jabberid = ".(isset($this->jabberid)?"'".$this->db->escape($this->jabberid)."'":"null");
|
||||||
$sql .= ", facebook='".$this->db->escape($this->facebook)."'";
|
//$sql .= ", skype='".$this->db->escape($this->skype)."'";
|
||||||
$sql .= ", linkedin='".$this->db->escape($this->linkedin)."'";
|
//$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");
|
||||||
@ -368,7 +398,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");
|
||||||
@ -442,29 +471,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++;
|
$usermustbemodified++;
|
||||||
}
|
}
|
||||||
if ($tmpobj->twitter != $this->twitter)
|
// if ($tmpobj->skype != $this->skype)
|
||||||
{
|
// {
|
||||||
$tmpobj->twitter = $this->twitter;
|
// $tmpobj->skype = $this->skype;
|
||||||
$usermustbemodified++;
|
// $usermustbemodified++;
|
||||||
}
|
// }
|
||||||
if ($tmpobj->facebook != $this->facebook)
|
// if ($tmpobj->twitter != $this->twitter)
|
||||||
{
|
// {
|
||||||
$tmpobj->facebook = $this->facebook;
|
// $tmpobj->twitter = $this->twitter;
|
||||||
$usermustbemodified++;
|
// $usermustbemodified++;
|
||||||
}
|
// }
|
||||||
if ($tmpobj->linkedin != $this->linkedin)
|
// if ($tmpobj->facebook != $this->facebook)
|
||||||
{
|
// {
|
||||||
$tmpobj->linkedin = $this->linkedin;
|
// $tmpobj->facebook = $this->facebook;
|
||||||
$usermustbemodified++;
|
// $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++; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -716,7 +750,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, c.jabberid,";
|
||||||
|
$sql.= " c.socialnetworks, c.skype, c.twitter, c.facebook, c.linkedin,";
|
||||||
$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,";
|
||||||
@ -785,11 +820,45 @@ 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;
|
$arraysocialnetworks = array();
|
||||||
$this->skype = $obj->skype;
|
$updatesocial = false;
|
||||||
$this->twitter = $obj->twitter;
|
if (!empty($obj->jabberid)) {
|
||||||
$this->facebook = $obj->facebook;
|
$arraysocialnetworks['jabber'] = $obj->jabberid;
|
||||||
$this->linkedin = $obj->linkedin;
|
$updatesocial = true;
|
||||||
|
}
|
||||||
|
if (!empty($obj->skype)) {
|
||||||
|
$arraysocialnetworks['skype'] = $obj->skype;
|
||||||
|
$updatesocial = true;
|
||||||
|
}
|
||||||
|
if (!empty($obj->twitter)) {
|
||||||
|
$arraysocialnetworks['twitter'] = $obj->twitter;
|
||||||
|
$updatesocial = true;
|
||||||
|
}
|
||||||
|
if (!empty($obj->facebook)) {
|
||||||
|
$arraysocialnetworks['facebook'] = $obj->facebook;
|
||||||
|
$updatesocial = true;
|
||||||
|
}
|
||||||
|
if (!empty($obj->linkedin)) {
|
||||||
|
$arraysocialnetworks['linkedin'] = $obj->linkedin;
|
||||||
|
$updatesocial = true;
|
||||||
|
}
|
||||||
|
$socialarray = ($obj->socialnetworks==''?array():json_decode($obj->socialnetworks, true));
|
||||||
|
$this->socialnetworks = array_merge($arraysocialnetworks, $socialarray);
|
||||||
|
if ($updatesocial) {
|
||||||
|
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX.'socpeople SET skype=null';
|
||||||
|
$sqlupd .= ', twitter=null';
|
||||||
|
$sqlupd .= ', facebook=null';
|
||||||
|
$sqlupd .= ', linkedin=null';
|
||||||
|
$sqlupd .= ', jabberid=null';
|
||||||
|
$sqlupd .= ', socialnetworks="'.$this->db->escape(json_encode($this->socialnetworks)).'"';
|
||||||
|
$sqlupd .= ' WHERE rowid='.$this->id;
|
||||||
|
$this->db->query($sqlupd);
|
||||||
|
}
|
||||||
|
$this->jabberid = $this->socialnetworks['jabber'];
|
||||||
|
$this->skype = $this->socialnetworks['skype'];
|
||||||
|
$this->twitter = $this->socialnetworks['twitter'];
|
||||||
|
$this->facebook = $this->socialnetworks['facebook'];
|
||||||
|
$this->linkedin = $this->socialnetworks['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;
|
||||||
@ -1332,7 +1401,6 @@ class Contact extends CommonObject
|
|||||||
$this->socialnetworks = array(
|
$this->socialnetworks = array(
|
||||||
'skype' => 'tom.hanson',
|
'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';
|
||||||
|
|||||||
@ -221,7 +221,7 @@ if (empty($reshook)) {
|
|||||||
$object->socialnetworks = array();
|
$object->socialnetworks = array();
|
||||||
if (! empty($conf->socialnetworks->enabled)) {
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
foreach ($socialnetworks as $key => $value) {
|
foreach ($socialnetworks as $key => $value) {
|
||||||
if (!$value['active']) continue;
|
if (!$value['active']) break;
|
||||||
$object->socialnetworks[$key] = GETPOST($key, 'alphanohtml');
|
$object->socialnetworks[$key] = GETPOST($key, 'alphanohtml');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -380,7 +380,7 @@ if (empty($reshook)) {
|
|||||||
$object->socialnetworks = array();
|
$object->socialnetworks = array();
|
||||||
if (! empty($conf->socialnetworks->enabled)) {
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
foreach ($socialnetworks as $key => $value) {
|
foreach ($socialnetworks as $key => $value) {
|
||||||
if (!$value['active']) continue;
|
if (!$value['active']) break;
|
||||||
$object->socialnetworks[$key] = GETPOST($key, 'alpha');
|
$object->socialnetworks[$key] = GETPOST($key, 'alpha');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1057,7 +1057,7 @@ if ($action == 'create' || $action == 'adduserldap')
|
|||||||
|
|
||||||
if (! empty($conf->socialnetworks->enabled)) {
|
if (! empty($conf->socialnetworks->enabled)) {
|
||||||
foreach ($socialnetworks as $key => $value) {
|
foreach ($socialnetworks as $key => $value) {
|
||||||
if (!$value['active']) continue;
|
if (!$value['active']) break;
|
||||||
print '<tr><td>'.$langs->trans($value['label']).'</td>';
|
print '<tr><td>'.$langs->trans($value['label']).'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (! empty($ldap_social[$key])) {
|
if (! empty($ldap_social[$key])) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user