diff --git a/src/ChurchCRM/dto/Photo.php b/src/ChurchCRM/dto/Photo.php index aa4e1c1c5c..afd63aeca9 100644 --- a/src/ChurchCRM/dto/Photo.php +++ b/src/ChurchCRM/dto/Photo.php @@ -304,9 +304,14 @@ private function getInitialsString(): string { $retstr = ''; if ($this->photoType == 'Person') { - $fullNameArr = PersonQuery::create()->select(['FirstName', 'LastName'])->findOneById($this->id); - foreach ($fullNameArr as $name) { - $retstr .= mb_strtoupper(mb_substr($name, 0, 1)); + if (SystemConfig::getValue('sInitialFormat') === 'FI') { + $fullNameArr = PersonQuery::create()->findOneById($this->id)->getFirstName(); + $retstr .= mb_strtoupper(mb_substr($fullNameArr, 0, 2)); + } else { + $fullNameArr = PersonQuery::create()->select(['FirstName', 'LastName'])->findOneById($this->id); + foreach ($fullNameArr as $name) { + $retstr .= mb_strtoupper(mb_substr($name, 0, 1)); + } } } elseif ($this->photoType == 'Family') { $fullNameArr = FamilyQuery::create()->findOneById($this->id)->getName(); diff --git a/src/ChurchCRM/dto/SystemConfig.php b/src/ChurchCRM/dto/SystemConfig.php index 5143b03c57..4b2a6387bb 100644 --- a/src/ChurchCRM/dto/SystemConfig.php +++ b/src/ChurchCRM/dto/SystemConfig.php @@ -143,6 +143,7 @@ private static function buildConfigs(): array 'sDatePickerPlaceHolder' => new ConfigItem(109, 'sDatePickerPlaceHolder', 'text', 'yyyy-mm-dd', gettext('For defining the date in Date-Picker, per default : yyyy-mm-dd, In French : dd/mm/yyyy for example.')), 'sDatePickerFormat' => new ConfigItem(110, 'sDatePickerFormat', 'text', 'Y-m-d', gettext('For defining the date in Date-Picker, per default : Y-m-d, In French : d/m/Y for example.')), 'sFont' => new ConfigItem(112, 'sFont', 'text', 'Roboto-Regular.ttf', gettext('Set font to render initials. Upload custom font to fonts directory')), + 'sInitialFormat' => new ConfigItem(113, 'sInitialFormat', 'choice', 'FL', gettext('When name is First Middle Last, select option to generates initial of FL(One character from Fist and Last) or FI(Two characters from First)'), '', '{"Choices":["' . gettext('FL') . '","' . gettext('FI') . '"]}'), 'bRegistered' => new ConfigItem(999, 'bRegistered', 'boolean', '0', gettext('ChurchCRM has been registered. The ChurchCRM team uses registration information to track usage. This information is kept confidential and never released or sold. If this field is true the registration option in the admin menu changes to update registration.')), 'leftX' => new ConfigItem(1001, 'leftX', 'number', '20', gettext('Left Margin (1 = 1/100th inch)')), 'incrementY' => new ConfigItem(1002, 'incrementY', 'number', '4', gettext('Line Thickness (1 = 1/100th inch')), @@ -283,7 +284,7 @@ private static function buildCategories(): array gettext('Report Settings') => ['sQBDTSettings', 'leftX', 'incrementY', 'sTaxReport1', 'sTaxReport2', 'sTaxReport3', 'sTaxSigner', 'sReminder1', 'sReminderSigner', 'sReminderNoPledge', 'sReminderNoPayments', 'sConfirm1', 'sConfirm2', 'sConfirm3', 'sConfirm4', 'sConfirm5', 'sConfirm6', 'sDear', 'sConfirmSincerely', 'sConfirmSigner', 'sPledgeSummary1', 'sPledgeSummary2', 'sDirectoryDisclaimer1', 'sDirectoryDisclaimer2', 'bDirLetterHead', 'sZeroGivers', 'sZeroGivers2', 'sZeroGivers3', 'iPDFOutputType'], gettext('Financial Settings') => ['sDepositSlipType', 'iChecksPerDepositForm', 'bDisplayBillCounts', 'bUseScannedChecks', 'bEnableNonDeductible', 'iFYMonth', 'bUseDonationEnvelopes', 'aFinanceQueries'], gettext('Quick Search') => ['bSearchIncludePersons', 'bSearchIncludePersonsMax', 'bSearchIncludeAddresses', 'bSearchIncludeAddressesMax', 'bSearchIncludeFamilies', 'bSearchIncludeFamiliesMax', 'bSearchIncludeFamilyHOH', 'bSearchIncludeFamilyHOHMax', 'bSearchIncludeGroups', 'bSearchIncludeGroupsMax', 'bSearchIncludeDeposits', 'bSearchIncludeDepositsMax', 'bSearchIncludePayments', 'bSearchIncludePaymentsMax', 'bSearchIncludeFamilyCustomProperties', 'bSearchIncludeCalendarEvents', 'bSearchIncludeCalendarEventsMax'], - gettext('Localization') => ['sLanguage', 'sDistanceUnit', 'sPhoneFormat', 'sPhoneFormatWithExt', 'sPhoneFormatCell', 'sDateFormatLong', 'sDateFormatNoYear', 'sDateFormatShort', 'sDateTimeFormat', 'sDateFilenameFormat', 'sCSVExportDelimiter', 'sCSVExportCharset', 'sDatePickerFormat', 'sDatePickerPlaceHolder', 'sFont'], + gettext('Localization') => ['sLanguage', 'sDistanceUnit', 'sPhoneFormat', 'sPhoneFormatWithExt', 'sPhoneFormatCell', 'sDateFormatLong', 'sDateFormatNoYear', 'sDateFormatShort', 'sDateTimeFormat', 'sDateFilenameFormat', 'sCSVExportDelimiter', 'sCSVExportCharset', 'sDatePickerFormat', 'sDatePickerPlaceHolder', 'sFont', 'sInitialFormat'], gettext('Integration') => ['sMailChimpApiKey', 'sGoogleTrackingID', 'bEnableGravatarPhotos', 'bEnableGooglePhotos', 'iRemotePhotoCacheDuration', 'sNexmoAPIKey', 'sNexmoAPISecret', 'sNexmoFromNumber', 'sOLPURL', 'sOLPUserName', 'sOLPPassword'], gettext('Church Services') => ['iPersonConfessionFatherCustomField', 'iPersonConfessionDateCustomField'], gettext('Events') => ['bEnableExternalCalendarAPI', 'bEventsOnDashboardPresence', 'iEventsOnDashboardPresenceTimeOut'],