-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update change select to button on/off #31443
base: develop
Are you sure you want to change the base?
Conversation
htdocs/user/virtualcard.php
Outdated
$tmparray['USER_PUBLIC_HIDE_SOCIALNETWORKS_BUSINESS'] = (GETPOST('USER_PUBLIC_HIDE_SOCIALNETWORKS_BUSINESS') ? 1 : 0); | ||
$tmparray['USER_PUBLIC_MORE'] = (GETPOST('USER_PUBLIC_MORE') ? GETPOST('USER_PUBLIC_MORE') : ''); | ||
|
||
$tmparray['USER_PUBLIC_HIDE_PHOTO'] = (getDolGlobalString('USER_PUBLIC_HIDE_PHOTO') ? 1 : 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because all option ate now set by ajax, we don't need any more this part of cor. Except for the "note". For it, we can keep old code to have the note saved from the user choice (so using GETPOST).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i fix it and i complete the process
htdocs/core/lib/functions.lib.php
Outdated
/** | ||
* Get socal network for user or societe | ||
* @param int $userId user Id | ||
* @return int|array -1 if KO, array if OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
array<array{name:string,url:string}>|int<-1,-1> is better/needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the type of the User class also needs an update
User::$socialnetworks
htdocs/core/lib/functions.lib.php
Outdated
@@ -14850,3 +14850,42 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show | |||
} | |||
exit(0); | |||
} | |||
|
|||
/** | |||
* Get socal network for user or societe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo to fix: 'social'
@@ -341,11 +341,15 @@ | |||
} | |||
|
|||
// Social networks | |||
if (empty($object->socialnetworks)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the array $object->socialnetworks is empty then getSocialNetworks($object->id) will return empty too. Because $object->socialnetworks is loaded by the fetch of user the same way the getSocialNetworks do it. So i on't understand the need of line 345.
If there is at least one social network in $object->socialnetwork then we can show the option to each of them to on or off
NEW|New update in virtual card for user by changing select yes/no to button on/off