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

Add fill options for Phone and E-mail details #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jaapjansma
Copy link
Contributor

@jaapjansma jaapjansma commented Jul 16, 2021

With the fill details options I would expect that a phone number is added when no phone number with the location type and phone type exists.

When a phone number with that location type and phone type already exists I would expect that nothing changes. However the new phone number gets added and I end up with two phones of the same location type and phone type.

This PR enhances the settings for fill details for phone numbers. The same issue also exists with e-mail addresses and this PR also fixes it for the e-mail addresses.

Before

Below a screenshot of the settings screen:

Screenshot_20210716_111251

After

Below a screenshot with the changes applied to the settings screen:

Screenshot_20210716_111917

And for e-mail

Screenshot_20210726_154510

The changes are backwards compatible. Meaning that if someone had selected phone at the Fill details, the Fill Phone is set to If contact has not this phone number.

Comment

This PR also removes the phone_numeric field from the diff activity.

@jaapjansma
Copy link
Contributor Author

I have also added a fix for #85 which deals with the same issue but then for email. It was not really possible to create two PRs because the code would interfere with this PR.

Copy link
Contributor

@artfulrobot artfulrobot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read through the code but have not tested it. Adding a unit test or two would help document the various cases and ensure they were handled as designed.

@@ -254,7 +254,18 @@ public function setLabel($label) {
* @throws Exception
*/
public function getOptions() {
return $this->getConfigGroup('options');
$options = $this->getConfigGroup('options');
// Backwards compatibility change fill details email to fill email.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be better as an Upgradrer step?

$location_type_id = $data['location_type_id'];
}

// Check whether a phone with this location type and phone type already exists.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Phone -> email

if ($phone_type_id) {
$api_query['phone_type_id'] = $phone_type_id;
if ($fillOption == 3) {
$api_query['phone'] = $data[$attribute];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should use phone numeric so that different ‘spellings’ of the number match, e.g. 123 456 should be the same as 12 34 56.

@jensschuppe jensschuppe requested a review from bjendres July 3, 2023 12:26
@jensschuppe jensschuppe linked an issue Jul 3, 2023 that may be closed by this pull request
@jensschuppe jensschuppe added enhancement status:needs review Code needs review and testing labels Jul 3, 2023
@jensschuppe jensschuppe added this to the 1.11 milestone Jul 3, 2023
@jensschuppe jensschuppe changed the title Fix for #82 Add fill options for Phone details Jul 3, 2023
@jensschuppe jensschuppe modified the milestones: 1.11, 1.12 Jul 3, 2023
@jensschuppe jensschuppe linked an issue Sep 14, 2023 that may be closed by this pull request
@bjendres bjendres modified the milestones: 1.12, 1.13 Oct 11, 2023
@jensschuppe jensschuppe modified the milestones: 1.13, 1.14 Jun 25, 2024
@jensschuppe jensschuppe added status:needs work There is code, but it needs additional work before it should be reviewed and removed status:needs review Code needs review and testing labels Jun 27, 2024
@jensschuppe jensschuppe changed the title Add fill options for Phone details Add fill options for Phone and E-mail details Jun 27, 2024
@bjendres
Copy link
Member

Hi @jaapjansma and @artfulrobot, we're currently compiling a 1.14-alpha what's the status of this PR? Does it need further work/clarification or would you both give a thumbs-up for the current state?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature status:needs work There is code, but it needs additional work before it should be reviewed
Projects
None yet
4 participants