Skip to content
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

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

lamrani002
Copy link
Contributor

@lamrani002 lamrani002 commented Oct 17, 2024

NEW|New update in virtual card for user by changing select yes/no to button on/off

ff

$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);
Copy link
Member

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).

Copy link
Contributor Author

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

@eldy eldy added the PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do) label Oct 18, 2024
/**
* Get socal network for user or societe
* @param int $userId user Id
* @return int|array -1 if KO, array if OK
Copy link
Contributor

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.

Copy link
Contributor

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

@@ -14850,3 +14850,42 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show
}
exit(0);
}

/**
* Get socal network for user or societe
Copy link
Contributor

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)) {
Copy link
Member

@eldy eldy Oct 24, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants