diff --git a/cypress/e2e/ui/fundraiser/standard.fundraiser.spec.js b/cypress/e2e/ui/fundraiser/standard.fundraiser.spec.js
new file mode 100644
index 0000000000..9066aa1dbd
--- /dev/null
+++ b/cypress/e2e/ui/fundraiser/standard.fundraiser.spec.js
@@ -0,0 +1,41 @@
+///
+
+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");
+ });
+});
diff --git a/demo/ChurchCRM-Database.sql b/demo/ChurchCRM-Database.sql
index 4550fa2fe8..333831b6ca 100644
--- a/demo/ChurchCRM-Database.sql
+++ b/demo/ChurchCRM-Database.sql
@@ -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 */;
@@ -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)
--
--
@@ -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;
@@ -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 */;
@@ -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
diff --git a/src/BatchWinnerEntry.php b/src/BatchWinnerEntry.php
index 88bb9c8278..f43a9e6a9b 100644
--- a/src/BatchWinnerEntry.php
+++ b/src/BatchWinnerEntry.php
@@ -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');
diff --git a/src/DonatedItemEditor.php b/src/DonatedItemEditor.php
index 125d5c642d..fd8a5ecb81 100644
--- a/src/DonatedItemEditor.php
+++ b/src/DonatedItemEditor.php
@@ -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'";
@@ -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');
@@ -58,7 +54,7 @@
$iBuyer = 0;
}
// New DonatedItem or deposit
- if (strlen($iDonatedItemID) < 1) {
+ if ($iDonatedItemID < 1) {
$donatedItem = new DonatedItem();
$donatedItem
->setFrId($iCurrentFundraiser)
@@ -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
diff --git a/src/FindFundRaiser.php b/src/FindFundRaiser.php
index 5e3e84d39c..a972c580da 100644
--- a/src/FindFundRaiser.php
+++ b/src/FindFundRaiser.php
@@ -4,79 +4,55 @@
require_once 'Include/Functions.php';
use ChurchCRM\Authentication\AuthenticationManager;
+use ChurchCRM\dto\SystemConfig;
+use ChurchCRM\model\ChurchCRM\FundRaiserQuery;
use ChurchCRM\Utils\InputUtils;
+use ChurchCRM\Utils\LoggerUtils;
+use Propel\Runtime\ActiveQuery\Criteria;
$sPageTitle = gettext('Fundraiser Listing');
-$dDateStart = '';
-$dDateEnd = '';
-$iID = '';
-$sSort = '';
+$sDateFormat = SystemConfig::getValue('sDatePickerFormat');
+
+$fundraisersQuery = FundraiserQuery::Create()
+ ->orderByDate('desc');
if (array_key_exists('DateStart', $_GET)) {
$dDateStart = InputUtils::legacyFilterInput($_GET['DateStart']);
+ if ($dDateStart !== "") {
+ $dDateStartObj = DateTime::createFromFormat($sDateFormat, $dDateStart);
+ $fundraisersQuery->filterByDate($dDateStartObj, Criteria::GREATER_EQUAL);
+ }
}
if (array_key_exists('DateEnd', $_GET)) {
$dDateEnd = InputUtils::legacyFilterInput($_GET['DateEnd']);
-}
-if (array_key_exists('ID', $_GET)) {
- $iID = InputUtils::legacyFilterInput($_GET['ID']);
-}
-if (array_key_exists('Sort', $_GET)) {
- $sSort = InputUtils::legacyFilterInput($_GET['Sort']);
-}
-
-// Build SQL Criteria
-$sCriteria = '';
-if ($dDateStart || $dDateEnd) {
- if (!$dDateStart && $dDateEnd) {
- $dDateStart = $dDateEnd;
- }
- if (!$dDateEnd && $dDateStart) {
- $dDateEnd = $dDateStart;
+ if ($dDateEnd !== "") {
+ $dDateEndObj = DateTime::createFromFormat($sDateFormat, $dDateEnd);
+ $fundraisersQuery->filterByDate($dDateEndObj, Criteria::LESS_EQUAL);
}
- $sCriteria .= " WHERE fr_Date BETWEEN '$dDateStart' AND '$dDateEnd' ";
-}
-if ($iID) {
- if ($sCriteria) {
- $sCrieria .= "OR fr_ID = '$iID' ";
- } else {
- $sCriteria = " WHERE fr_ID = '$iID' ";
- }
-}
-if (array_key_exists('FilterClear', $_GET) && $_GET['FilterClear']) {
- $sCriteria = '';
- $dDateStart = '';
- $dDateEnd = '';
- $iID = '';
}
+
+
+$fundraisers = $fundraisersQuery->find();
+
require_once 'Include/Header.php';
?>