diff --git a/htdocs/user/card.php b/htdocs/user/card.php index fa297df75eb..6de4271ec83 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -110,7 +110,6 @@ $hookmanager->initHooks(array('usercard','globalcard')); /** * Actions */ - $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 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -221,7 +220,6 @@ if (empty($reshook)) { $object->socialnetworks = array(); if (! empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { - if (!$value['active']) break; $object->socialnetworks[$key] = GETPOST($key, 'alphanohtml'); } } @@ -380,7 +378,6 @@ if (empty($reshook)) { $object->socialnetworks = array(); if (! empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { - if (!$value['active']) break; $object->socialnetworks[$key] = GETPOST($key, 'alpha'); } } @@ -1057,16 +1054,24 @@ if ($action == 'create' || $action == 'adduserldap') if (! empty($conf->socialnetworks->enabled)) { foreach ($socialnetworks as $key => $value) { - if (!$value['active']) break; - print ''.$langs->trans($value['label']).''; - print ''; - if (! empty($ldap_social[$key])) { - print ''; - print $ldap_social[$key]; + if ($value['active']) { + print ''.$langs->trans($value['label']).''; + print ''; + if (! empty($ldap_social[$key])) { + print ''; + print $ldap_social[$key]; + } else { + print ''; + } + print ''; } else { - print ''; + // if social network is not active but value exist we do not want to loose it + if (! empty($ldap_social[$key])) { + print ''; + } else { + print ''; + } } - print ''; } } // // Skype @@ -2347,73 +2352,92 @@ else } print ''; - // Skype - if (! empty($conf->socialnetworks->enabled)) - { - print ''.$langs->trans("Skype").''; - print ''; - if ($caneditfield && empty($object->ldap_sid)) - { - print ''; + if (! empty($conf->socialnetworks->enabled)) { + foreach ($socialnetworks as $key => $value) { + if ($value['active']) { + print ''.$langs->trans($value['label']).''; + print ''; + if ($caneditfield && empty($object->ldap_sid)) { + print ''; + } else { + print ''; + print $object->socialnetworks[$key]; + } + print ''; + } else { + // if social network is not active but value exist we do not want to loose it + print ''; + } } - else - { - print ''; - print $object->skype; - } - print ''; } - // Twitter - if (! empty($conf->socialnetworks->enabled)) - { - print ''.$langs->trans("Twitter").''; - print ''; - if ($caneditfield && empty($object->ldap_sid)) - { - print ''; - } - else - { - print ''; - print $object->twitter; - } - print ''; - } + // // Skype + // if (! empty($conf->socialnetworks->enabled)) + // { + // print ''.$langs->trans("Skype").''; + // print ''; + // if ($caneditfield && empty($object->ldap_sid)) + // { + // print ''; + // } + // else + // { + // print ''; + // print $object->skype; + // } + // print ''; + // } - // Facebook - if (! empty($conf->socialnetworks->enabled)) - { - print ''.$langs->trans("Facebook").''; - print ''; - if ($caneditfield && empty($object->ldap_sid)) - { - print ''; - } - else - { - print ''; - print $object->facebook; - } - print ''; - } + // // Twitter + // if (! empty($conf->socialnetworks->enabled)) + // { + // print ''.$langs->trans("Twitter").''; + // print ''; + // if ($caneditfield && empty($object->ldap_sid)) + // { + // print ''; + // } + // else + // { + // print ''; + // print $object->twitter; + // } + // print ''; + // } - // LinkedIn - if (! empty($conf->socialnetworks->enabled)) - { - print ''.$langs->trans("LinkedIn").''; - print ''; - if ($caneditfield && empty($object->ldap_sid)) - { - print ''; - } - else - { - print ''; - print $object->linkedin; - } - print ''; - } + // // Facebook + // if (! empty($conf->socialnetworks->enabled)) + // { + // print ''.$langs->trans("Facebook").''; + // print ''; + // if ($caneditfield && empty($object->ldap_sid)) + // { + // print ''; + // } + // else + // { + // print ''; + // print $object->facebook; + // } + // print ''; + // } + + // // LinkedIn + // if (! empty($conf->socialnetworks->enabled)) + // { + // print ''.$langs->trans("LinkedIn").''; + // print ''; + // if ($caneditfield && empty($object->ldap_sid)) + // { + // print ''; + // } + // else + // { + // print ''; + // print $object->linkedin; + // } + // print ''; + // } // EMail print "".'global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").'';