From e72264f058859f4ac9d8f4cf2589c394ed55dc9f Mon Sep 17 00:00:00 2001 From: Sarah Poger Gladstone Date: Mon, 27 May 2019 09:37:25 -0400 Subject: [PATCH] updated behavior for prefixes related to gender When the gender is not 'Male' or 'Female' for a contact without a prefix, no assumptions are made. If the greeting token that needs "Mr. " or "Dr." or "Ms." is used in this case, the unknown prefix will be "UNKNOWN PREFIX" --- utils/GreetingHelper.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/utils/GreetingHelper.php b/utils/GreetingHelper.php index 4a38566..2180bc7 100644 --- a/utils/GreetingHelper.php +++ b/utils/GreetingHelper.php @@ -194,15 +194,19 @@ function process_spouses(&$suffixes, &$prefixes, &$values, &$contactIDs, $greeti $gender_id = $contact_dao->gender_id; if ($gender_id == 1){ $gender_label = "Female"; - }else{ + }else if ($gender_id == 2 ) { $gender_label = "Male"; + }else{ + $gender_label = ""; } $spouse_gender_id = $contact_dao->spouse_gender_id; if ($spouse_gender_id == 1){ $spouse_gender_label = "Female"; - }else{ + }else if ($gender_id == 2 ) $spouse_gender_label = "Male"; + else{ + $gender_label = ""; } @@ -699,8 +703,10 @@ function determine_title($prefix, $gender, $uses_spouses_name){ $prefix = "Mrs."; }else if($gender == 'Female'){ $prefix = "Ms."; + }else if($gender == 'Male'){ + $prefix = "Mr." }else{ - $prefix = "Mr."; + $prefix = "UNKNOWN PREFIX"; } }else if( $prefix == 'Mr' or $prefix == 'Mr.' or $prefix == 'Mrs' or $prefix == 'Mrs.' or $prefix == 'Ms' or $prefix == 'Ms.' or $prefix == 'Miss'){ $prefix_info['real_title'] = false; @@ -1131,4 +1137,4 @@ where og.name = 'individual_suffix' "; } -} \ No newline at end of file +}