Skip to content

Commit ce393bf

Browse files
authored
Fundraiser UI Update and ORM Convertion (#7276)
2 parents 09af406 + 3d701e2 commit ce393bf

File tree

7 files changed

+153
-322
lines changed

7 files changed

+153
-322
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/// <reference types="cypress" />
2+
3+
context("Fund Raiser", () => {
4+
5+
it("View All ", () => {
6+
cy.loginStandard("FundRaiserEditor.php?FundRaiserID=-1");
7+
cy.contains("Create New Fund Raiser");
8+
});
9+
10+
it("View By Filter Date ", () => {
11+
cy.loginStandard("FindFundRaiser.php?DateStart=2015-01-01&DateEnd=2017-01-01");
12+
cy.contains("Fundraiser Listing");
13+
cy.contains("2016 Car Wash");
14+
});
15+
16+
17+
it("New Fund Raiser with url param -1 ", () => {
18+
cy.loginStandard("FundRaiserEditor.php?FundRaiserID=-1");
19+
cy.contains("Create New Fund Raiser");
20+
});
21+
22+
it("Create new FundRaiser ", () => {
23+
cy.loginStandard("FundRaiserEditor.php");
24+
cy.contains("Create New Fund Raiser");
25+
26+
cy.get('#Title').type('Summer Car Wash');
27+
cy.get('#Description').type('This is the youth carwash ');
28+
cy.get('td > .btn-primary').click();
29+
30+
cy.url().should('contains', 'FundRaiserEditor.php');
31+
cy.get('#addItem').click();
32+
33+
cy.url().should('contains', 'DonatedItemEditor.php');
34+
cy.get('#Item').type('Soap for the Car wash');
35+
cy.get('#Title').type('Soap');
36+
cy.get('#EstPrice').type('20');
37+
cy.get('.form-group > .btn:nth-child(1)').click();
38+
cy.url().should('contains', 'FundRaiserEditor.php');
39+
cy.contains("Soap for the Car wash");
40+
});
41+
});

demo/ChurchCRM-Database.sql

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
--
33
-- Host: database Database: churchcrm
44
-- ------------------------------------------------------
5-
-- Server version 11.2.2-MariaDB-1:11.2.2+maria~ubu2204
6-
-- Date: Sat, 13 Jul 2024 17:23:46 -0400
5+
-- Server version 11.6.2-MariaDB-ubu2404
6+
-- Date: Sun, 23 Feb 2025 19:33:40 -0500
77

88
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
99
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -161,12 +161,12 @@ CREATE TABLE `config_cfg` (
161161
LOCK TABLES `config_cfg` WRITE;
162162
/*!40000 ALTER TABLE `config_cfg` DISABLE KEYS */;
163163
SET autocommit=0;
164-
INSERT INTO `config_cfg` VALUES (10,'aFinanceQueries','28,30,31,32'),(21,'sDefaultCity','Kansas City'),(22,'sDefaultState','MO'),(23,'sDefaultCountry','United States'),(27,'sSMTPHost','crmEmailServer:1025'),(28,'bSMTPAuth','1'),(29,'sSMTPUser','c58d4ec1a5a021'),(30,'sSMTPPass','3cfab2ee59990c'),(45,'iChurchLatitude','39.1111974'),(46,'iChurchLongitude','-94.5838009'),(48,'bHideFriendDate',''),(49,'bHideFamilyNewsletter',''),(50,'bHideWeddingDate',''),(51,'bHideLatLon',''),(52,'bUseDonationEnvelopes',''),(58,'bUseScannedChecks',''),(65,'sTimeZone','America/Detroit'),(67,'bForceUppercaseZip',''),(72,'bEnableNonDeductible',''),(80,'bEnableSelfRegistration','1'),(999,'bRegistered',''),(1003,'sChurchName','Main St. Cathedral'),(1004,'sChurchAddress','123 Main St'),(1005,'sChurchCity','Kansas City'),(1006,'sChurchState','MO'),(1007,'sChurchZip','64106'),(1008,'sChurchPhone','555 123 4234'),(1009,'sChurchEmail','[email protected]'),(1010,'sHomeAreaCode','555'),(1014,'sTaxSigner','Elder Joe Smith'),(1016,'sReminderSigner','Elder Joe Smith'),(1025,'sConfirmSigner','Elder Joe Smith'),(1027,'sPledgeSummary2','as of'),(1028,'sDirectoryDisclaimer1','Every effort was made to insure the accuracy of this directory. If there are any errors or omissions, please contact the church office.This directory is for the use of the people of'),(1034,'sChurchChkAcctNum','111111111'),(1035,'bEnableGravatarPhotos','1'),(1037,'sExternalBackupType','WebDAV'),(1046,'sLastIntegrityCheckTimeStamp','20240713-172311'),(1047,'sChurchCountry','United States'),(2010,'bAllowEmptyLastName',''),(2017,'bEnableExternalCalendarAPI',''),(2045,'bPHPMailerAutoTLS',''),(2046,'sPHPMailerSMTPSecure',''),(2050,'bEnabledMenuLinks',''),(2060,'IncludeDataInNewPersonNotifications',''),(2061,'bSearchIncludeFamilyCustomProperties',''),(2062,'bBackupExtraneousImages',''),(2064,'sLastSoftwareUpdateCheckTimeStamp','20240713-172312'),(2065,'bAllowPrereleaseUpgrade',''),(2069,'bRequire2FA',''),(2071,'bSendUserDeletedEmail',''),(20142,'bHSTSEnable','');
164+
INSERT INTO `config_cfg` VALUES (4,'sLogLevel','100'),(10,'aFinanceQueries','28,30,31,32'),(21,'sDefaultCity','Kansas City'),(22,'sDefaultState','MO'),(23,'sDefaultCountry','United States'),(27,'sSMTPHost','crmEmailServer:1025'),(28,'bSMTPAuth','1'),(29,'sSMTPUser','c58d4ec1a5a021'),(30,'sSMTPPass','3cfab2ee59990c'),(45,'iChurchLatitude','39.1111974'),(46,'iChurchLongitude','-94.5838009'),(48,'bHideFriendDate',''),(49,'bHideFamilyNewsletter',''),(50,'bHideWeddingDate',''),(51,'bHideLatLon',''),(52,'bUseDonationEnvelopes',''),(58,'bUseScannedChecks',''),(65,'sTimeZone','America/Detroit'),(67,'bForceUppercaseZip',''),(72,'bEnableNonDeductible',''),(80,'bEnableSelfRegistration','1'),(999,'bRegistered',''),(1003,'sChurchName','Main St. Cathedral'),(1004,'sChurchAddress','123 Main St'),(1005,'sChurchCity','Kansas City'),(1006,'sChurchState','MO'),(1007,'sChurchZip','64106'),(1008,'sChurchPhone','555 123 4234'),(1009,'sChurchEmail','[email protected]'),(1010,'sHomeAreaCode','555'),(1014,'sTaxSigner','Elder Joe Smith'),(1016,'sReminderSigner','Elder Joe Smith'),(1025,'sConfirmSigner','Elder Joe Smith'),(1027,'sPledgeSummary2','as of'),(1028,'sDirectoryDisclaimer1','Every effort was made to insure the accuracy of this directory. If there are any errors or omissions, please contact the church office.This directory is for the use of the people of'),(1034,'sChurchChkAcctNum','111111111'),(1035,'bEnableGravatarPhotos','1'),(1036,'bEnableExternalBackupTarget',''),(1037,'sExternalBackupType','WebDAV'),(1046,'sLastIntegrityCheckTimeStamp','20250223-193330'),(1047,'sChurchCountry','United States'),(2010,'bAllowEmptyLastName',''),(2017,'bEnableExternalCalendarAPI',''),(2045,'bPHPMailerAutoTLS',''),(2046,'sPHPMailerSMTPSecure',''),(2050,'bEnabledMenuLinks',''),(2060,'IncludeDataInNewPersonNotifications',''),(2061,'bSearchIncludeFamilyCustomProperties',''),(2062,'bBackupExtraneousImages',''),(2064,'sLastSoftwareUpdateCheckTimeStamp','20250223-193332'),(2065,'bAllowPrereleaseUpgrade',''),(2069,'bRequire2FA',''),(2071,'bSendUserDeletedEmail',''),(20142,'bHSTSEnable','');
165165
/*!40000 ALTER TABLE `config_cfg` ENABLE KEYS */;
166166
UNLOCK TABLES;
167167
COMMIT;
168168

169-
-- Dumped table `config_cfg` with 52 row(s)
169+
-- Dumped table `config_cfg` with 54 row(s)
170170
--
171171

172172
--
@@ -708,7 +708,7 @@ CREATE TABLE `fundraiser_fr` (
708708
LOCK TABLES `fundraiser_fr` WRITE;
709709
/*!40000 ALTER TABLE `fundraiser_fr` DISABLE KEYS */;
710710
SET autocommit=0;
711-
INSERT INTO `fundraiser_fr` VALUES (1,'2016-11-19','zczxc','zxczxczxc',1,'2016-11-19');
711+
INSERT INTO `fundraiser_fr` VALUES (1,'2016-11-19','2016 Car Wash','Youth Car Wash',1,'2016-11-19');
712712
/*!40000 ALTER TABLE `fundraiser_fr` ENABLE KEYS */;
713713
UNLOCK TABLES;
714714
COMMIT;
@@ -2313,47 +2313,6 @@ COMMIT;
23132313
-- Dumped table `whycame_why` with 0 row(s)
23142314
--
23152315

2316-
--
2317-
-- Stand-In structure for view `email_count`
2318-
--
2319-
2320-
DROP TABLE IF EXISTS `email_count`;
2321-
/*!50001 DROP VIEW IF EXISTS `email_count`*/;
2322-
CREATE TABLE IF NOT EXISTS `email_count` (
2323-
`email` varchar(100)
2324-
,`total` bigint(21)
2325-
);
2326-
--
2327-
-- Stand-In structure for view `email_list`
2328-
--
2329-
2330-
DROP TABLE IF EXISTS `email_list`;
2331-
/*!50001 DROP VIEW IF EXISTS `email_list`*/;
2332-
CREATE TABLE IF NOT EXISTS `email_list` (
2333-
`email` varchar(100)
2334-
,`type` varchar(11)
2335-
,`id` mediumint(9) unsigned
2336-
);
2337-
--
2338-
-- View structure for view `email_count`
2339-
--
2340-
2341-
DROP TABLE IF EXISTS `email_count`;
2342-
/*!50001 DROP VIEW IF EXISTS `email_count`*/;
2343-
/*!50001 CREATE ALGORITHM=UNDEFINED */
2344-
/*!50013 DEFINER=`churchcrm`@`%` SQL SECURITY DEFINER */
2345-
/*!50001 VIEW `email_count` AS select `email_list`.`email` AS `email`,count(0) AS `total` from `email_list` group by `email_list`.`email` */;
2346-
2347-
--
2348-
-- View structure for view `email_list`
2349-
--
2350-
2351-
DROP TABLE IF EXISTS `email_list`;
2352-
/*!50001 DROP VIEW IF EXISTS `email_list`*/;
2353-
/*!50001 CREATE ALGORITHM=UNDEFINED */
2354-
/*!50013 DEFINER=`churchcrm`@`%` SQL SECURITY DEFINER */
2355-
/*!50001 VIEW `email_list` AS select `family_fam`.`fam_Email` AS `email`,'family' AS `type`,`family_fam`.`fam_ID` AS `id` from `family_fam` where `family_fam`.`fam_Email` is not null and `family_fam`.`fam_Email` <> '' union select `person_per`.`per_Email` AS `email`,'person_home' AS `type`,`person_per`.`per_ID` AS `id` from `person_per` where `person_per`.`per_Email` is not null and `person_per`.`per_Email` <> '' union select `person_per`.`per_WorkEmail` AS `email`,'person_work' AS `type`,`person_per`.`per_ID` AS `id` from `person_per` where `person_per`.`per_WorkEmail` is not null and `person_per`.`per_WorkEmail` <> '' */;
2356-
23572316
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
23582317
/*!40101 SET AUTOCOMMIT=@OLD_AUTOCOMMIT */;
23592318
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -2364,4 +2323,4 @@ DROP TABLE IF EXISTS `email_list`;
23642323
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
23652324
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
23662325

2367-
-- Dump completed on: Sat, 13 Jul 2024 17:23:47 -0400
2326+
-- Dump completed on: Sun, 23 Feb 2025 19:33:41 -0500

src/BatchWinnerEntry.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,17 @@
88
use ChurchCRM\Utils\RedirectUtils;
99

1010
$linkBack = InputUtils::legacyFilterInput($_GET['linkBack']);
11-
$iCurrentFundraiser = InputUtils::legacyFilterInput($_GET['CurrentFundraiser']);
11+
$iCurrentFundraiser = InputUtils::filterInt($_GET['CurrentFundraiser']);
1212

13-
if ($iCurrentFundraiser) {
13+
if ($iCurrentFundraiser >0) {
14+
$sSQL = 'SELECT * from fundraiser_fr WHERE fr_ID = ' . $iCurrentFundraiser;
15+
$rsDeposit = RunQuery($sSQL);
16+
extract(mysqli_fetch_array($rsDeposit));
1417
$_SESSION['iCurrentFundraiser'] = $iCurrentFundraiser;
1518
} else {
1619
$iCurrentFundraiser = $_SESSION['iCurrentFundraiser'];
1720
}
1821

19-
// Get the current fundraiser data
20-
if ($iCurrentFundraiser) {
21-
$sSQL = 'SELECT * from fundraiser_fr WHERE fr_ID = ' . $iCurrentFundraiser;
22-
$rsDeposit = RunQuery($sSQL);
23-
extract(mysqli_fetch_array($rsDeposit));
24-
}
2522

2623
$sPageTitle = gettext('Batch Winner Entry');
2724

src/DonatedItemEditor.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
use ChurchCRM\Utils\InputUtils;
1111
use ChurchCRM\Utils\RedirectUtils;
1212

13-
$iDonatedItemID = InputUtils::legacyFilterInputArr($_GET, 'DonatedItemID', 'int');
13+
$iDonatedItemID = InputUtils::filterInt(InputUtils::legacyFilterInputArr($_GET, 'DonatedItemID', 'int'));
1414
$linkBack = InputUtils::legacyFilterInputArr($_GET, 'linkBack');
15-
$iCurrentFundraiser = InputUtils::legacyFilterInputArr($_GET, 'CurrentFundraiser');
15+
$iCurrentFundraiser = InputUtils::filterInt(InputUtils::legacyFilterInputArr($_GET, 'CurrentFundraiser'));
1616

1717
if ($iDonatedItemID > 0) {
1818
$sSQL = "SELECT * FROM donateditem_di WHERE di_ID = '$iDonatedItemID'";
@@ -21,17 +21,13 @@
2121
$iCurrentFundraiser = $theDonatedItem['di_FR_ID'];
2222
}
2323

24-
if ($iCurrentFundraiser) {
25-
$_SESSION['iCurrentFundraiser'] = $iCurrentFundraiser;
26-
} else {
27-
$iCurrentFundraiser = $_SESSION['iCurrentFundraiser'];
28-
}
29-
30-
// Get the current fundraiser data
3124
if ($iCurrentFundraiser) {
3225
$sSQL = 'SELECT * from fundraiser_fr WHERE fr_ID = ' . $iCurrentFundraiser;
3326
$rsDeposit = RunQuery($sSQL);
3427
extract(mysqli_fetch_array($rsDeposit));
28+
$_SESSION['iCurrentFundraiser'] = $iCurrentFundraiser;
29+
} else {
30+
$iCurrentFundraiser = $_SESSION['iCurrentFundraiser'];
3531
}
3632

3733
$sPageTitle = gettext('Donated Item Editor');
@@ -58,7 +54,7 @@
5854
$iBuyer = 0;
5955
}
6056
// New DonatedItem or deposit
61-
if (strlen($iDonatedItemID) < 1) {
57+
if ($iDonatedItemID < 1) {
6258
$donatedItem = new DonatedItem();
6359
$donatedItem
6460
->setFrId($iCurrentFundraiser)
@@ -122,7 +118,7 @@
122118
} else {
123119
//FirstPass
124120
//Are we editing or adding?
125-
if (strlen($iDonatedItemID) > 0) {
121+
if ($iDonatedItemID > 0) {
126122
//Editing....
127123
//Get all the data on this record
128124

0 commit comments

Comments
 (0)