From dfe9001c84d4c67f3fed7ac9987ba01c169dc5f7 Mon Sep 17 00:00:00 2001 From: BigTigerKU Date: Tue, 17 Sep 2024 10:09:13 -0700 Subject: [PATCH 1/3] Make Family List Columns Configurable --- src/ChurchCRM/dto/SystemConfig.php | 16 +++++++++- src/v2/templates/people/family-list.php | 39 +++++++++++++------------ 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/src/ChurchCRM/dto/SystemConfig.php b/src/ChurchCRM/dto/SystemConfig.php index 58ae4eea52..7926bb2586 100644 --- a/src/ChurchCRM/dto/SystemConfig.php +++ b/src/ChurchCRM/dto/SystemConfig.php @@ -113,6 +113,19 @@ public static function getPersonListColumns(): array ]; } + public static function getFamilyListColumns(): array + { + return [ + 'Name' => new ListColumn('Name', 'getName', 'false', 'true'), + 'Address' => new ListColumn('Address', 'getAddress', 'false', 'true'), + 'Home Phone' => new ListColumn('Home Phone', 'getHomePhone', 'false', 'true'), + 'Cell Phone' => new ListColumn('Cell Phone', 'getCellPhone', 'false', 'true'), + 'Email' => new ListColumn('Email', 'getEmail', 'false', 'true'), + 'Created' => new ListColumn('Created', 'getDateEntered', 'false', 'true'), + 'Edited' => new ListColumn('Edited', 'getDateLastEdited', 'false', 'true'), + ]; + } + private static function buildConfigs(): array { return [ @@ -302,6 +315,7 @@ private static function buildConfigs(): array 'sInactiveClassification' => new ConfigItem(2073, 'sInactiveClassification', 'text', '', gettext('Comma separated list of classifications that should appear as inactive')), 'sDefaultZip' => new ConfigItem(2074, 'sDefaultZip', 'text', '', gettext('Default Zip')), 'sPersonListColumns' => new ConfigItem(2075, 'sPersonListColumns', 'json', json_encode(SystemConfig::getPersonListColumns()), gettext('Person List Columns')), + 'sFamilyListColumns' => new ConfigItem(2076, 'sFamilyListColumns', 'json', json_encode(SystemConfig::getFamilyListColumns()), gettext('Family List Columns')), ]; } @@ -311,7 +325,7 @@ private static function buildCategories(): array gettext('Church Information') => ['sChurchName', 'sChurchAddress', 'sChurchCity', 'sChurchState', 'sChurchZip', 'sChurchCountry', 'sChurchPhone', 'sChurchEmail', 'sHomeAreaCode', 'sTimeZone', 'iChurchLatitude', 'iChurchLongitude', 'sChurchWebSite', 'sChurchFB', 'sChurchTwitter'], gettext('User Setup') => ['iMinPasswordLength', 'iMinPasswordChange', 'iMaxFailedLogins', 'iSessionTimeout', 'aDisallowedPasswords', 'bEnableLostPassword', 'bEnable2FA', 'bRequire2FA', 's2FAApplicationName', 'bSendUserDeletedEmail'], gettext('Email Setup') => ['sSMTPHost', 'bSMTPAuth', 'sSMTPUser', 'sSMTPPass', 'iSMTPTimeout', 'sToEmailAddress', 'bPHPMailerAutoTLS', 'sPHPMailerSMTPSecure'], - gettext('People Setup') => ['sDirClassifications', 'sDirRoleHead', 'sDirRoleSpouse', 'sDirRoleChild', 'sDefaultCity', 'sDefaultState', 'sDefaultZip', 'sDefaultCountry', 'bShowFamilyData', 'bHidePersonAddress', 'bHideFriendDate', 'bHideFamilyNewsletter', 'bHideWeddingDate', 'bHideLatLon', 'bForceUppercaseZip', 'bEnableSelfRegistration', 'bAllowEmptyLastName', 'iPersonNameStyle', 'iPersonInitialStyle', 'iProfilePictureListSize', 'sNewPersonNotificationRecipientIDs', 'IncludeDataInNewPersonNotifications', 'sGreeterCustomMsg1', 'sGreeterCustomMsg2', 'sInactiveClassification', 'sPersonListColumns'], + gettext('People Setup') => ['sDirClassifications', 'sDirRoleHead', 'sDirRoleSpouse', 'sDirRoleChild', 'sDefaultCity', 'sDefaultState', 'sDefaultZip', 'sDefaultCountry', 'bShowFamilyData', 'bHidePersonAddress', 'bHideFriendDate', 'bHideFamilyNewsletter', 'bHideWeddingDate', 'bHideLatLon', 'bForceUppercaseZip', 'bEnableSelfRegistration', 'bAllowEmptyLastName', 'iPersonNameStyle', 'iPersonInitialStyle', 'iProfilePictureListSize', 'sNewPersonNotificationRecipientIDs', 'IncludeDataInNewPersonNotifications', 'sGreeterCustomMsg1', 'sGreeterCustomMsg2', 'sInactiveClassification', 'sPersonListColumns', 'sFamilyListColumns'], gettext('Enabled Features') => ['bEnabledFinance', 'bEnabledSundaySchool', 'bEnabledEvents', 'bEnabledCalendar', 'bEnabledFundraiser', 'bEnabledEmail', 'bEnabledMenuLinks'], gettext('Map Settings') => ['sGeoCoderProvider', 'sGoogleMapsGeocodeKey', 'sGoogleMapsRenderKey', 'sBingMapKey', 'sGMapIcons', 'iMapZoom'], 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'], diff --git a/src/v2/templates/people/family-list.php b/src/v2/templates/people/family-list.php index f4b910f902..60d74a7678 100644 --- a/src/v2/templates/people/family-list.php +++ b/src/v2/templates/people/family-list.php @@ -21,13 +21,14 @@ - - - - - - - + visible === 'true') { + echo '' . gettext($column->name) . ''; + } + } + ?> @@ -43,17 +44,19 @@ - getName() ?> - getAddress() ?> - getHomePhone() ?> - getCellPhone() ?> - getEmail() ?> - getDateEntered(), SystemConfig::getValue('sDateFormatLong')) ?> - - getDateLastEdited()) { - echo date_format($family->getDateLastEdited(), SystemConfig::getValue('sDateFormatLong')); - } ?> - + + visible === 'true') { + if (str_starts_with($column->displayFunction, 'getDate')) { + $columnData = [$family, $column->displayFunction](SystemConfig::getValue('sDateFormatLong')); + } else { + $columnData = [$family, $column->displayFunction](); + } + echo '' . $columnData . ''; + } + } + ?> From b9062093b7cfcc12d4ee02f84e365f3779376e0d Mon Sep 17 00:00:00 2001 From: BigTigerKU Date: Wed, 18 Sep 2024 22:13:35 -0700 Subject: [PATCH 2/3] Fix a bug: Cannot update Country --- src/FamilyEditor.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/FamilyEditor.php b/src/FamilyEditor.php index 41e69e57a4..2d2534e7e7 100644 --- a/src/FamilyEditor.php +++ b/src/FamilyEditor.php @@ -256,6 +256,7 @@ ->setCity($sCity) ->setState($sState) ->setZip($sZip) + ->setCountry($sCountry) ->setHomePhone($sHomePhone) ->setWorkPhone($sWorkPhone) ->setCellPhone($sCellPhone) From 1789bbdde35a368309404f0a0707f581eabd5e7c Mon Sep 17 00:00:00 2001 From: BigTigerKU Date: Wed, 18 Sep 2024 22:22:33 -0700 Subject: [PATCH 3/3] Revert "Make Family List Columns Configurable" This reverts commit dfe9001c84d4c67f3fed7ac9987ba01c169dc5f7. --- src/ChurchCRM/dto/SystemConfig.php | 16 +--------- src/v2/templates/people/family-list.php | 39 ++++++++++++------------- 2 files changed, 19 insertions(+), 36 deletions(-) diff --git a/src/ChurchCRM/dto/SystemConfig.php b/src/ChurchCRM/dto/SystemConfig.php index 7926bb2586..58ae4eea52 100644 --- a/src/ChurchCRM/dto/SystemConfig.php +++ b/src/ChurchCRM/dto/SystemConfig.php @@ -113,19 +113,6 @@ public static function getPersonListColumns(): array ]; } - public static function getFamilyListColumns(): array - { - return [ - 'Name' => new ListColumn('Name', 'getName', 'false', 'true'), - 'Address' => new ListColumn('Address', 'getAddress', 'false', 'true'), - 'Home Phone' => new ListColumn('Home Phone', 'getHomePhone', 'false', 'true'), - 'Cell Phone' => new ListColumn('Cell Phone', 'getCellPhone', 'false', 'true'), - 'Email' => new ListColumn('Email', 'getEmail', 'false', 'true'), - 'Created' => new ListColumn('Created', 'getDateEntered', 'false', 'true'), - 'Edited' => new ListColumn('Edited', 'getDateLastEdited', 'false', 'true'), - ]; - } - private static function buildConfigs(): array { return [ @@ -315,7 +302,6 @@ private static function buildConfigs(): array 'sInactiveClassification' => new ConfigItem(2073, 'sInactiveClassification', 'text', '', gettext('Comma separated list of classifications that should appear as inactive')), 'sDefaultZip' => new ConfigItem(2074, 'sDefaultZip', 'text', '', gettext('Default Zip')), 'sPersonListColumns' => new ConfigItem(2075, 'sPersonListColumns', 'json', json_encode(SystemConfig::getPersonListColumns()), gettext('Person List Columns')), - 'sFamilyListColumns' => new ConfigItem(2076, 'sFamilyListColumns', 'json', json_encode(SystemConfig::getFamilyListColumns()), gettext('Family List Columns')), ]; } @@ -325,7 +311,7 @@ private static function buildCategories(): array gettext('Church Information') => ['sChurchName', 'sChurchAddress', 'sChurchCity', 'sChurchState', 'sChurchZip', 'sChurchCountry', 'sChurchPhone', 'sChurchEmail', 'sHomeAreaCode', 'sTimeZone', 'iChurchLatitude', 'iChurchLongitude', 'sChurchWebSite', 'sChurchFB', 'sChurchTwitter'], gettext('User Setup') => ['iMinPasswordLength', 'iMinPasswordChange', 'iMaxFailedLogins', 'iSessionTimeout', 'aDisallowedPasswords', 'bEnableLostPassword', 'bEnable2FA', 'bRequire2FA', 's2FAApplicationName', 'bSendUserDeletedEmail'], gettext('Email Setup') => ['sSMTPHost', 'bSMTPAuth', 'sSMTPUser', 'sSMTPPass', 'iSMTPTimeout', 'sToEmailAddress', 'bPHPMailerAutoTLS', 'sPHPMailerSMTPSecure'], - gettext('People Setup') => ['sDirClassifications', 'sDirRoleHead', 'sDirRoleSpouse', 'sDirRoleChild', 'sDefaultCity', 'sDefaultState', 'sDefaultZip', 'sDefaultCountry', 'bShowFamilyData', 'bHidePersonAddress', 'bHideFriendDate', 'bHideFamilyNewsletter', 'bHideWeddingDate', 'bHideLatLon', 'bForceUppercaseZip', 'bEnableSelfRegistration', 'bAllowEmptyLastName', 'iPersonNameStyle', 'iPersonInitialStyle', 'iProfilePictureListSize', 'sNewPersonNotificationRecipientIDs', 'IncludeDataInNewPersonNotifications', 'sGreeterCustomMsg1', 'sGreeterCustomMsg2', 'sInactiveClassification', 'sPersonListColumns', 'sFamilyListColumns'], + gettext('People Setup') => ['sDirClassifications', 'sDirRoleHead', 'sDirRoleSpouse', 'sDirRoleChild', 'sDefaultCity', 'sDefaultState', 'sDefaultZip', 'sDefaultCountry', 'bShowFamilyData', 'bHidePersonAddress', 'bHideFriendDate', 'bHideFamilyNewsletter', 'bHideWeddingDate', 'bHideLatLon', 'bForceUppercaseZip', 'bEnableSelfRegistration', 'bAllowEmptyLastName', 'iPersonNameStyle', 'iPersonInitialStyle', 'iProfilePictureListSize', 'sNewPersonNotificationRecipientIDs', 'IncludeDataInNewPersonNotifications', 'sGreeterCustomMsg1', 'sGreeterCustomMsg2', 'sInactiveClassification', 'sPersonListColumns'], gettext('Enabled Features') => ['bEnabledFinance', 'bEnabledSundaySchool', 'bEnabledEvents', 'bEnabledCalendar', 'bEnabledFundraiser', 'bEnabledEmail', 'bEnabledMenuLinks'], gettext('Map Settings') => ['sGeoCoderProvider', 'sGoogleMapsGeocodeKey', 'sGoogleMapsRenderKey', 'sBingMapKey', 'sGMapIcons', 'iMapZoom'], 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'], diff --git a/src/v2/templates/people/family-list.php b/src/v2/templates/people/family-list.php index 60d74a7678..f4b910f902 100644 --- a/src/v2/templates/people/family-list.php +++ b/src/v2/templates/people/family-list.php @@ -21,14 +21,13 @@ - visible === 'true') { - echo '' . gettext($column->name) . ''; - } - } - ?> + + + + + + + @@ -44,19 +43,17 @@ - - visible === 'true') { - if (str_starts_with($column->displayFunction, 'getDate')) { - $columnData = [$family, $column->displayFunction](SystemConfig::getValue('sDateFormatLong')); - } else { - $columnData = [$family, $column->displayFunction](); - } - echo '' . $columnData . ''; - } - } - ?> + getName() ?> + getAddress() ?> + getHomePhone() ?> + getCellPhone() ?> + getEmail() ?> + getDateEntered(), SystemConfig::getValue('sDateFormatLong')) ?> + + getDateLastEdited()) { + echo date_format($family->getDateLastEdited(), SystemConfig::getValue('sDateFormatLong')); + } ?> +