diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index f72682ce22a..f57bb2e312d 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -313,10 +313,6 @@ if (empty($reshook)) { $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->default_lang = GETPOST('default_lang', 'alpha'); $object->typeid = GETPOST("typeid", 'int'); @@ -488,11 +484,6 @@ if (empty($reshook)) { } } - // $object->skype = $skype; - // $object->twitter = $twitter; - // $object->facebook = $facebook; - // $object->linkedin = $linkedin; - $object->email = $email; $object->url = $url; $object->login = $login; diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index c79a3e63653..17649370ae0 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1762,11 +1762,6 @@ class Setup extends DolibarrApi throw new RestException(403, 'Error API open to admin users only or to the users with logins defined into constant API_LOGINS_ALLOWED_FOR_GET_COMPANY'); } - unset($mysoc->skype); - unset($mysoc->twitter); - unset($mysoc->facebook); - unset($mysoc->linkedin); - unset($mysoc->pays); unset($mysoc->note); unset($mysoc->nom); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 4fde1b75552..cd94f4ebbac 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -213,11 +213,6 @@ if (empty($reshook)) { $object->town = (string) GETPOST("town", 'alpha'); $object->country_id = (int) GETPOST("country_id", 'int'); $object->state_id = (int) GETPOST("state_id", 'int'); - //$object->jabberid = GETPOST("jabberid", 'alpha'); - //$object->skype = GETPOST("skype", 'alpha'); - //$object->twitter = GETPOST("twitter", 'alpha'); - //$object->facebook = GETPOST("facebook", 'alpha'); - //$object->linkedin = GETPOST("linkedin", 'alpha'); $object->socialnetworks = array(); if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { @@ -419,11 +414,6 @@ if (empty($reshook)) { $object->email = (string) GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->no_email = GETPOST("no_email", "int"); - //$object->jabberid = GETPOST("jabberid", 'alpha'); - //$object->skype = GETPOST("skype", 'alpha'); - //$object->twitter = GETPOST("twitter", 'alpha'); - //$object->facebook = GETPOST("facebook", 'alpha'); - //$object->linkedin = GETPOST("linkedin", 'alpha'); $object->socialnetworks = array(); if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index c9d62c410b3..52ea2b69c8d 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -702,22 +702,6 @@ class Contact extends CommonObject $tmpobj->socialnetworks = $this->socialnetworks; $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) { $result = $tmpobj->update($user, 0, 1, 1, 1); if ($result < 0) { @@ -850,9 +834,6 @@ class Contact extends CommonObject if ($this->fax && !empty($conf->global->LDAP_CONTACT_FIELD_FAX)) { $info[$conf->global->LDAP_CONTACT_FIELD_FAX] = $this->fax; } - if ($this->skype && !empty($conf->global->LDAP_CONTACT_FIELD_SKYPE)) { - $info[$conf->global->LDAP_CONTACT_FIELD_SKYPE] = $this->skype; - } if ($this->note_private && !empty($conf->global->LDAP_CONTACT_FIELD_DESCRIPTION)) { $info[$conf->global->LDAP_CONTACT_FIELD_DESCRIPTION] = dol_string_nohtmltag($this->note_private, 2); } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9b8f0dfc6dd..25f16cbbdb4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -961,27 +961,6 @@ abstract class CommonObject } $outdone++; } - } else { // Old code to remove - if (!empty($this->skype)) { - $outsocialnetwork .= dol_print_socialnetworks($this->skype, $this->id, $object->id, 'skype'); - } - $outdone++; - if (!empty($this->jabberid)) { - $outsocialnetwork .= dol_print_socialnetworks($this->jabberid, $this->id, $object->id, 'jabber'); - } - $outdone++; - if (!empty($this->twitter)) { - $outsocialnetwork .= dol_print_socialnetworks($this->twitter, $this->id, $object->id, 'twitter'); - } - $outdone++; - if (!empty($this->facebook)) { - $outsocialnetwork .= dol_print_socialnetworks($this->facebook, $this->id, $object->id, 'facebook'); - } - $outdone++; - if (!empty($this->linkedin)) { - $outsocialnetwork .= dol_print_socialnetworks($this->linkedin, $this->id, $object->id, 'linkedin'); - } - $outdone++; } if ($outsocialnetwork) { diff --git a/htdocs/core/class/commonsocialnetworks.class.php b/htdocs/core/class/commonsocialnetworks.class.php index eeb6583ca65..4ec32194f3d 100644 --- a/htdocs/core/class/commonsocialnetworks.class.php +++ b/htdocs/core/class/commonsocialnetworks.class.php @@ -27,6 +27,12 @@ */ trait CommonSocialNetworks { + /** + * @var array array of socialnetworks + */ + public $socialnetworks; + + /** * Show social network part if the module is enabled with hiding functionality * diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 9ad06ba137c..8b3c9177d3e 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -1291,7 +1291,6 @@ class Ldap $this->firstname = $this->convToOutputCharset($result[0][$this->attr_firstname][0], $this->ldapcharset); $this->login = $this->convToOutputCharset($result[0][$this->attr_login][0], $this->ldapcharset); $this->phone = $this->convToOutputCharset($result[0][$this->attr_phone][0], $this->ldapcharset); - $this->skype = $this->convToOutputCharset($result[0][$this->attr_skype][0], $this->ldapcharset); $this->fax = $this->convToOutputCharset($result[0][$this->attr_fax][0], $this->ldapcharset); $this->mail = $this->convToOutputCharset($result[0][$this->attr_mail][0], $this->ldapcharset); $this->mobile = $this->convToOutputCharset($result[0][$this->attr_mobile][0], $this->ldapcharset); diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php index ac360674c85..768ddd216d7 100644 --- a/htdocs/datapolicy/class/actions_datapolicy.class.php +++ b/htdocs/datapolicy/class/actions_datapolicy.class.php @@ -82,11 +82,11 @@ class ActionsDatapolicy /** * Overloading the doActions function : replacing the parent's function with the one below * - * @param array $parameters Hook metadatas (context, etc...) - * @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) - * @param string $action Current action (if set). Generally create or edit or null - * @param HookManager $hookmanager Hook manager propagated to allow calling another hook - * @return int < 0 on error, 0 on success, 1 to replace standard code + * @param array $parameters Hook metadatas (context, etc...) + * @param Societe|CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) + * @param string $action Current action (if set). Generally create or edit or null + * @param HookManager $hookmanager Hook manager propagated to allow calling another hook + * @return int < 0 on error, 0 on success, 1 to replace standard code */ public function doActions($parameters, &$object, &$action, $hookmanager) { @@ -103,7 +103,6 @@ class ActionsDatapolicy // on verifie si l'objet est utilisé if ($object->isObjectUsed(GETPOST('socid'))) { $object->name = $langs->trans('ANONYME'); - $object->name_bis = ''; $object->name_alias = ''; $object->address = ''; $object->town = ''; @@ -115,7 +114,7 @@ class ActionsDatapolicy $object->state = ''; $object->country = ''; $object->state_id = ''; - $object->skype = ''; + $object->socialnetworks = ''; $object->country_id = ''; $object->note_private = $object->note_private.'
'.$langs->trans('ANONYMISER_AT', dol_print_date(time())); @@ -128,76 +127,6 @@ class ActionsDatapolicy header('Location:'.$_SERVER["PHP_SELF"]."?socid=".$object->id); } } - } elseif ($parameters['currentcontext'] == 'thirdpartycard' && $action == 'datapolicy_portabilite') { - header('Content-Type: application/csv'); - header('Content-Disposition: attachment; filename=datapolicy_portabilite.csv'); - header('Pragma: no-cache'); - $object->fetch(GETPOST('socid')); - echo 'Name;Firstname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; - echo $object->name.';'; - echo ';'; - echo ';'; - echo ';'; - echo ';'; - echo $object->address.';'; - echo $object->zip.';'; - echo $object->town.';'; - echo $object->state.';'; - echo $object->country.';'; - echo $object->email.';'; - echo $object->phone.';'; - echo ';'; - echo ';'; - echo $object->skype.';'; - echo ';'; - exit; - } elseif ($parameters['currentcontext'] == 'membercard' && $action == 'datapolicy_portabilite') { - header('Content-Type: application/csv'); - header('Content-Disposition: attachment; filename=datapolicy_portabilite.csv'); - header('Pragma: no-cache'); - $soc = $object->fetch_thirdparty(); - - echo 'Name;Firstname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; - echo $object->lastname.';'; - echo $object->firstname.';'; - echo $object->getCivilityLabel().';'; - echo ($soc != -1 ? $object->thirdparty->name : '').';'; - echo ';'; - echo $object->address.';'; - echo $object->zip.';'; - echo $object->town.';'; - echo $object->state.';'; - echo $object->country.';'; - echo $object->email.';'; - echo $object->phone.';'; - echo $object->phone_perso.';'; - echo $object->phone_mobile.';'; - echo $object->skype.';'; - echo dol_print_date($object->birth).';'; - exit; - } elseif ($parameters['currentcontext'] == 'contactcard' && $action == 'datapolicy_portabilite') { - $object->fetch(GETPOST('id')); - header('Content-Type: application/csv'); - header('Content-Disposition: attachment; filename=datapolicy_portabilite.csv'); - header('Pragma: no-cache'); - $soc = $object->fetch_thirdparty(); - echo 'Name;Firstname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; - echo $object->lastname.';'; - echo $object->firstname.';'; - echo $object->getCivilityLabel().';'; - echo ($soc != -1 ? $object->thirdparty->name : '').';'; - echo $object->poste.';'; - echo $object->address.';'; - echo $object->zip.';'; - echo $object->town.';'; - echo $object->state.';'; - echo $object->country.';'; - echo $object->email.';'; - echo $object->phone_pro.';'; - echo $object->phone_perso.';'; - echo $object->phone_mobile.';'; - echo dol_print_date($object->birth).';'; - exit; } elseif ($parameters['currentcontext'] == 'contactcard' && $action == 'send_datapolicy') { $object->fetch(GETPOST('id')); @@ -358,13 +287,7 @@ class ActionsDatapolicy } ); '; echo $dialog; - if ($parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) { - echo '
'.$langs->trans("DATAPOLICY_PORTABILITE").'
'; - } elseif ($parameters['currentcontext'] == 'membercard') { - echo '
'.$langs->trans("DATAPOLICY_PORTABILITE").'
'; - } elseif ($parameters['currentcontext'] == 'contactcard') { - echo '
'.$langs->trans("DATAPOLICY_PORTABILITE").'
'; - } + // TODO Replace test of hardcoded values if (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) { echo '
'.$langs->trans("DATAPOLICY_SEND").'
'; } elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'membercard') { diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 10266b6f0ac..9921167d00c 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1826,16 +1826,6 @@ class Thirdparties extends DolibarrApi unset($object->fk_delivery_address); // deprecated feature - unset($object->skype); - unset($object->twitter); - unset($object->facebook); - unset($object->linkedin); - unset($object->instagram); - unset($object->snapchat); - unset($object->googleplus); - unset($object->youtube); - unset($object->whatsapp); - return $object; } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index e8e8d044b74..fa6d77ad485 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -382,11 +382,6 @@ class Societe extends CommonObject */ public $no_email; - /** - * @var array array of socialnetworks - */ - public $socialnetworks; - /** * Skype username * @var string diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 747d4ab3286..2bbadd267cf 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -701,11 +701,6 @@ class Users extends DolibarrApi unset($object->lines); unset($object->model_pdf); - unset($object->skype); - unset($object->twitter); - unset($object->facebook); - unset($object->linkedin); - $canreadsalary = ((!empty($conf->salaries->enabled) && !empty(DolibarrApiAccess::$user->rights->salaries->read)) || (empty($conf->salaries->enabled))); if (!$canreadsalary) {