diff --git a/src/ChurchCRM/dto/ListColumn.php b/src/ChurchCRM/dto/ListColumn.php new file mode 100644 index 0000000000..0259d5a4c0 --- /dev/null +++ b/src/ChurchCRM/dto/ListColumn.php @@ -0,0 +1,19 @@ +name = $name; + $this->displayFunction = $displayFunction; + $this->emptyOrUnassigned = $emptyOrUnassigned; + $this->visible = $visible; + } +} diff --git a/src/ChurchCRM/dto/SystemConfig.php b/src/ChurchCRM/dto/SystemConfig.php index b7a2dfb1b6..58ae4eea52 100644 --- a/src/ChurchCRM/dto/SystemConfig.php +++ b/src/ChurchCRM/dto/SystemConfig.php @@ -91,6 +91,28 @@ public static function getInitialStyleChoices(): array ]; } + public static function getPersonListColumns(): array + { + return [ + 'Id' => new ListColumn('Id', 'getId', 'false', 'false'), + 'Family Name' => new ListColumn('Family Name', 'getFamilyName', 'false', 'false'), + 'Name' => new ListColumn('Name', 'getFullName', 'false', 'false'), + 'Last Name' => new ListColumn('Last Name', 'getLastName', 'false', 'true'), + 'First Name' => new ListColumn('First Name', 'getFirstName', 'false', 'true'), + 'Birth Date' => new ListColumn('Birth Date', 'getFormattedBirthDate', 'false', 'false'), + 'Address' => new ListColumn('Address', 'getAddress', 'false', 'false'), + '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'), + 'Gender' => new ListColumn('Gender', 'getGenderName', 'true', 'true'), + 'Classification' => new ListColumn('Classification', 'getClassificationName', 'true', 'true'), + 'Role' => new ListColumn('Role', 'getFamilyRoleName', 'true', 'true'), + 'Properties' => new ListColumn('Properties', 'getPropertiesString', 'true', 'false'), + 'Custom' => new ListColumn('Custom', 'getCustomFields', 'true', 'false'), + 'Group' => new ListColumn('Group', 'getGroups', 'true', 'false'), + ]; + } + private static function buildConfigs(): array { return [ @@ -279,6 +301,7 @@ private static function buildConfigs(): array 'sGoogleMapsRenderKey' => new ConfigItem(2072, 'sGoogleMapsRenderKey', 'text', '', gettext('Google Maps API Key used for rendering maps in browser'), 'https://developers.google.com/maps/documentation/javascript/get-api-key'), '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')), ]; } @@ -288,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'], + 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/person-list.php b/src/v2/templates/people/person-list.php index 9ff520b337..aef3d933f3 100644 --- a/src/v2/templates/people/person-list.php +++ b/src/v2/templates/people/person-list.php @@ -158,20 +158,27 @@ function emptyOrUnassignedJSON($stuff): string -