Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fundraiser UI Update and ORM Convertion #7276

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
41 changes: 41 additions & 0 deletions cypress/e2e/ui/fundraiser/standard.fundraiser.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/// <reference types="cypress" />

context("Fund Raiser", () => {

it("View All ", () => {
cy.loginStandard("FundRaiserEditor.php?FundRaiserID=-1");
cy.contains("Create New Fund Raiser");
});

it("View By Filter Date ", () => {
cy.loginStandard("FindFundRaiser.php?DateStart=2015-01-01&DateEnd=2017-01-01");
cy.contains("Fundraiser Listing");
cy.contains("2016 Car Wash");
});


it("New Fund Raiser with url param -1 ", () => {
cy.loginStandard("FundRaiserEditor.php?FundRaiserID=-1");
cy.contains("Create New Fund Raiser");
});

it("Create new FundRaiser ", () => {
cy.loginStandard("FundRaiserEditor.php");
cy.contains("Create New Fund Raiser");

cy.get('#Title').type('Summer Car Wash');
cy.get('#Description').type('This is the youth carwash ');
cy.get('td > .btn-primary').click();

cy.url().should('contains', 'FundRaiserEditor.php');
cy.get('#addItem').click();

cy.url().should('contains', 'DonatedItemEditor.php');
cy.get('#Item').type('Soap for the Car wash');
cy.get('#Title').type('Soap');
cy.get('#EstPrice').type('20');
cy.get('.form-group > .btn:nth-child(1)').click();
cy.url().should('contains', 'FundRaiserEditor.php');
cy.contains("Soap for the Car wash");
});
});
53 changes: 6 additions & 47 deletions demo/ChurchCRM-Database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
--
-- Host: database Database: churchcrm
-- ------------------------------------------------------
-- Server version 11.2.2-MariaDB-1:11.2.2+maria~ubu2204
-- Date: Sat, 13 Jul 2024 17:23:46 -0400
-- Server version 11.6.2-MariaDB-ubu2404
-- Date: Sun, 23 Feb 2025 19:33:40 -0500

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
Expand Down Expand Up @@ -161,12 +161,12 @@ CREATE TABLE `config_cfg` (
LOCK TABLES `config_cfg` WRITE;
/*!40000 ALTER TABLE `config_cfg` DISABLE KEYS */;
SET autocommit=0;
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','demo@churchcrm.io'),(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','');
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','demo@churchcrm.io'),(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','');
/*!40000 ALTER TABLE `config_cfg` ENABLE KEYS */;
UNLOCK TABLES;
COMMIT;

-- Dumped table `config_cfg` with 52 row(s)
-- Dumped table `config_cfg` with 54 row(s)
--

--
Expand Down Expand Up @@ -708,7 +708,7 @@ CREATE TABLE `fundraiser_fr` (
LOCK TABLES `fundraiser_fr` WRITE;
/*!40000 ALTER TABLE `fundraiser_fr` DISABLE KEYS */;
SET autocommit=0;
INSERT INTO `fundraiser_fr` VALUES (1,'2016-11-19','zczxc','zxczxczxc',1,'2016-11-19');
INSERT INTO `fundraiser_fr` VALUES (1,'2016-11-19','2016 Car Wash','Youth Car Wash',1,'2016-11-19');
/*!40000 ALTER TABLE `fundraiser_fr` ENABLE KEYS */;
UNLOCK TABLES;
COMMIT;
Expand Down Expand Up @@ -2313,47 +2313,6 @@ COMMIT;
-- Dumped table `whycame_why` with 0 row(s)
--

--
-- Stand-In structure for view `email_count`
--

DROP TABLE IF EXISTS `email_count`;
/*!50001 DROP VIEW IF EXISTS `email_count`*/;
CREATE TABLE IF NOT EXISTS `email_count` (
`email` varchar(100)
,`total` bigint(21)
);
--
-- Stand-In structure for view `email_list`
--

DROP TABLE IF EXISTS `email_list`;
/*!50001 DROP VIEW IF EXISTS `email_list`*/;
CREATE TABLE IF NOT EXISTS `email_list` (
`email` varchar(100)
,`type` varchar(11)
,`id` mediumint(9) unsigned
);
--
-- View structure for view `email_count`
--

DROP TABLE IF EXISTS `email_count`;
/*!50001 DROP VIEW IF EXISTS `email_count`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`churchcrm`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `email_count` AS select `email_list`.`email` AS `email`,count(0) AS `total` from `email_list` group by `email_list`.`email` */;

--
-- View structure for view `email_list`
--

DROP TABLE IF EXISTS `email_list`;
/*!50001 DROP VIEW IF EXISTS `email_list`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`churchcrm`@`%` SQL SECURITY DEFINER */
/*!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` <> '' */;

/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET AUTOCOMMIT=@OLD_AUTOCOMMIT */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
Expand All @@ -2364,4 +2323,4 @@ DROP TABLE IF EXISTS `email_list`;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on: Sat, 13 Jul 2024 17:23:47 -0400
-- Dump completed on: Sun, 23 Feb 2025 19:33:41 -0500
13 changes: 5 additions & 8 deletions src/BatchWinnerEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@
use ChurchCRM\Utils\RedirectUtils;

$linkBack = InputUtils::legacyFilterInput($_GET['linkBack']);
$iCurrentFundraiser = InputUtils::legacyFilterInput($_GET['CurrentFundraiser']);
$iCurrentFundraiser = InputUtils::filterInt($_GET['CurrentFundraiser']);

if ($iCurrentFundraiser) {
if ($iCurrentFundraiser >0) {
$sSQL = 'SELECT * from fundraiser_fr WHERE fr_ID = ' . $iCurrentFundraiser;
$rsDeposit = RunQuery($sSQL);
extract(mysqli_fetch_array($rsDeposit));
$_SESSION['iCurrentFundraiser'] = $iCurrentFundraiser;
} else {
$iCurrentFundraiser = $_SESSION['iCurrentFundraiser'];
}

// Get the current fundraiser data
if ($iCurrentFundraiser) {
$sSQL = 'SELECT * from fundraiser_fr WHERE fr_ID = ' . $iCurrentFundraiser;
$rsDeposit = RunQuery($sSQL);
extract(mysqli_fetch_array($rsDeposit));
}

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

Expand Down
18 changes: 7 additions & 11 deletions src/DonatedItemEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
use ChurchCRM\Utils\InputUtils;
use ChurchCRM\Utils\RedirectUtils;

$iDonatedItemID = InputUtils::legacyFilterInputArr($_GET, 'DonatedItemID', 'int');
$iDonatedItemID = InputUtils::filterInt(InputUtils::legacyFilterInputArr($_GET, 'DonatedItemID', 'int'));
$linkBack = InputUtils::legacyFilterInputArr($_GET, 'linkBack');
$iCurrentFundraiser = InputUtils::legacyFilterInputArr($_GET, 'CurrentFundraiser');
$iCurrentFundraiser = InputUtils::filterInt(InputUtils::legacyFilterInputArr($_GET, 'CurrentFundraiser'));

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

if ($iCurrentFundraiser) {
$_SESSION['iCurrentFundraiser'] = $iCurrentFundraiser;
} else {
$iCurrentFundraiser = $_SESSION['iCurrentFundraiser'];
}

// Get the current fundraiser data
if ($iCurrentFundraiser) {
$sSQL = 'SELECT * from fundraiser_fr WHERE fr_ID = ' . $iCurrentFundraiser;
$rsDeposit = RunQuery($sSQL);
extract(mysqli_fetch_array($rsDeposit));
$_SESSION['iCurrentFundraiser'] = $iCurrentFundraiser;
} else {
$iCurrentFundraiser = $_SESSION['iCurrentFundraiser'];
}

$sPageTitle = gettext('Donated Item Editor');
Expand All @@ -58,7 +54,7 @@
$iBuyer = 0;
}
// New DonatedItem or deposit
if (strlen($iDonatedItemID) < 1) {
if ($iDonatedItemID < 1) {
$donatedItem = new DonatedItem();
$donatedItem
->setFrId($iCurrentFundraiser)
Expand Down Expand Up @@ -122,7 +118,7 @@
} else {
//FirstPass
//Are we editing or adding?
if (strlen($iDonatedItemID) > 0) {
if ($iDonatedItemID > 0) {
//Editing....
//Get all the data on this record

Expand Down
Loading
Loading