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'; ?>
- - - - - - - - +
:
- - - - + +
: - -
: - +
+ +
@@ -85,157 +61,26 @@
- setSearchLimit(InputUtils::legacyFilterInput($_GET['Number'], 'int')); - $currentUser->save(); - } - - // Select the proper sort SQL - switch ($sSort) { - case 'number': - $sOrderSQL = 'ORDER BY fr_ID DESC'; - break; - default: - $sOrderSQL = ' ORDER BY fr_Date DESC, fr_ID DESC'; - break; - } - - // Append a LIMIT clause to the SQL statement - $tableSizeSetting = AuthenticationManager::getCurrentUser() - ->getSetting("ui.table.size"); - if (empty($tableSizeSetting)) { - $iPerPage = 10; - } else { - $iPerPage = $tableSizeSetting->getValue(); - } - if (empty($_GET['Result_Set'])) { - $Result_Set = 0; - } else { - $Result_Set = InputUtils::legacyFilterInput($_GET['Result_Set'], 'int'); - } - $sLimitSQL = " LIMIT $Result_Set, $iPerPage"; - - // Build SQL query - $sSQL = "SELECT fr_ID, fr_Date, fr_Title FROM fundraiser_fr $sCriteria $sOrderSQL $sLimitSQL"; - $sSQLTotal = "SELECT COUNT(fr_ID) FROM fundraiser_fr $sCriteria"; - - // Execute SQL statement and get total result - $rsDep = RunQuery($sSQL); - $rsTotal = RunQuery($sSQLTotal); - list($Total) = mysqli_fetch_row($rsTotal); - - echo '
'; - echo ''; - // Show previous-page link unless we're at the first page - if ($Result_Set < $Total && $Result_Set > 0) { - $thisLinkResult = $Result_Set - $iPerPage; - if ($thisLinkResult < 0) { - $thisLinkResult = 0; - } - echo '' . gettext('Previous Page') . '  '; - } - - // Calculate starting and ending Page-Number Links - $Pages = ceil($Total / $iPerPage); - $startpage = (ceil($Result_Set / $iPerPage)) - 6; - if ($startpage <= 2) { - $startpage = 1; - } - $endpage = (ceil($Result_Set / $iPerPage)) + 9; - if ($endpage >= ($Pages - 1)) { - $endpage = $Pages; - } - - // Show Link "1 ..." if startpage does not start at 1 - if ($startpage != 1) { - echo "1 ... "; - } - - // Display page links - if ($Pages > 1) { - for ($c = $startpage; $c <= $endpage; $c++) { - $b = $c - 1; - $thisLinkResult = $iPerPage * $b; - if ($thisLinkResult != $Result_Set) { - echo "$c "; - } else { - echo '  [ ' . $c . ' ]  '; - } - } - } - - // Show Link "... xx" if endpage is not the maximum number of pages - if ($endpage != $Pages) { - $thisLinkResult = ($Pages - 1) * $iPerPage; - echo " $Pages"; - } - - // Show next-page link unless we're at the last page - if ($Result_Set >= 0 && $Result_Set < $Total) { - $thisLinkResult = $Result_Set + $iPerPage; - if ($thisLinkResult < $Total) { - echo "  " . gettext('Next Page') . '  '; - } - } - - // Display Record Limit - echo ''; - if (isset($sSort)) { - echo ''; - } - - $sLimit5 = ''; - $sLimit10 = ''; - $sLimit20 = ''; - $sLimit25 = ''; - $sLimit50 = ''; - - if ($iPerPage === 5) { - $sLimit5 = 'selected'; - } elseif ($iPerPage === 10) { - $sLimit10 = 'selected'; - } elseif ($iPerPage === 20) { - $sLimit20 = 'selected'; - } elseif ($iPerPage === 25) { - $sLimit25 = 'selected'; - } elseif ($iPerPage === 50) { - $sLimit50 = 'selected'; - } - - echo '     ' . gettext('Display:') . "  -   - -

'; - - // Column Headings - echo "\n - \n - \n - \n - \n - \n - "; - - // Display Deposits - while (list($fr_ID, $fr_Date, $fr_Title) = mysqli_fetch_row($rsDep)) { - echo "'; - echo ""; - echo ""; - // Get deposit total - echo ""; - } - echo '
" . gettext('Edit') . "" . gettext('Number') . "" . gettext('Date') . "" . gettext('Title') . "
" . gettext('Edit') . '$fr_ID$fr_Date$fr_Title
'; - ?> + +
+ + + + + + + + + + + + + + + +
getTitle() ?> getDate()->format($sDateFormat) ?>
+
0) { // Get the current fundraiser record $fundraiser = FundRaiserQuery::create()->findOneById($iFundRaiserID); + $sPageTitle = gettext('Fundraiser') . ' #' . $iFundRaiserID . ' ' . $fundraiser->getTitle(); // Set current fundraiser $_SESSION['iCurrentFundraiser'] = $iFundRaiserID; } -if ($fundraiser) { - $sPageTitle = gettext('Fundraiser') . ' #' . $iFundRaiserID . ' ' . $fundraiser->getTitle(); -} else { - $sPageTitle = gettext('Create New Fund Raiser'); -} - $sDateError = ''; // Is this the second pass? @@ -94,85 +91,80 @@ $dDate = $fundraiser->getDate(); $sTitle = $fundraiser->getTitle(); $sDescription = $fundraiser->getDescription(); + + + $sSQL = "SELECT di_ID, di_Item, di_multibuy, + a.per_FirstName as donorFirstName, a.per_LastName as donorLastName, + b.per_FirstName as buyerFirstName, b.per_LastName as buyerLastName, + di_title, di_sellprice, di_estprice, di_materialvalue, di_minimum + FROM donateditem_di + LEFT JOIN person_per a ON di_donor_ID=a.per_ID + LEFT JOIN person_per b ON di_buyer_ID=b.per_ID + WHERE di_FR_ID = '" . $iFundRaiserID . "' ORDER BY di_multibuy,SUBSTR(di_item,1,1),cast(SUBSTR(di_item,2) as unsigned integer),SUBSTR(di_item,4)"; + $rsDonatedItems = RunQuery($sSQL); + $_SESSION['iCurrentFundraiser'] = $iFundRaiserID; // Probably redundant + } else { - $dDate = ''; + $dDate = date_create('now'); // Set default date to today $sTitle = ''; $sDescription = ''; + $rsDonatedItems = 0; } } -if ($iFundRaiserID > 0) { - //Get the items for this fundraiser - $sSQL = "SELECT di_ID, di_Item, di_multibuy, - a.per_FirstName as donorFirstName, a.per_LastName as donorLastName, - b.per_FirstName as buyerFirstName, b.per_LastName as buyerLastName, - di_title, di_sellprice, di_estprice, di_materialvalue, di_minimum - FROM donateditem_di - LEFT JOIN person_per a ON di_donor_ID=a.per_ID - LEFT JOIN person_per b ON di_buyer_ID=b.per_ID - WHERE di_FR_ID = '" . $iFundRaiserID . "' ORDER BY di_multibuy,SUBSTR(di_item,1,1),cast(SUBSTR(di_item,2) as unsigned integer),SUBSTR(di_item,4)"; - $rsDonatedItems = RunQuery($sSQL); -} else { - $rsDonatedItems = 0; - $dDate = date('Y-m-d'); // Set default date to today -} - -// Set Current Deposit setting for user -if ($iFundRaiserID > 0) { - $_SESSION['iCurrentFundraiser'] = $iFundRaiserID; // Probably redundant -} - require_once 'Include/Header.php'; ?>
- - - - - - +
- - - 0) { - echo '\n"; - echo '\n"; - echo '\n"; - echo '\n"; - echo '\n"; - } - ?> -
+ + + + +
- + - + - +
:" maxlength="10" id="Date" size="11" class="date-picker">
:
:
+ + +
-
+
+
+ + + + +
+ 0) { + echo '\n"; + echo '\n"; + echo '\n"; + echo '\n"; + echo '\n"; + } + ?>
: diff --git a/src/Reports/FRCatalog.php b/src/Reports/FRCatalog.php index dae223e6e0..cbd65da09f 100644 --- a/src/Reports/FRCatalog.php +++ b/src/Reports/FRCatalog.php @@ -9,6 +9,8 @@ use ChurchCRM\model\ChurchCRM\Base\FundRaiser; use ChurchCRM\model\ChurchCRM\FundRaiserQuery; use ChurchCRM\Utils\InputUtils; +use ChurchCRM\Utils\LoggerUtils; +use Monolog\Logger; if (!isset($_GET['CurrentFundraiser'])) { throw new \InvalidArgumentException('Missing required CurrentFundraiser parameter'); @@ -24,14 +26,13 @@ class PdfFRCatalogReport extends ChurchInfoReport public function __construct(FundRaiser $fundraiser) { parent::__construct('P', 'mm', $this->paperFormat); + $this->fundraiser = $fundraiser; $this->SetFont('Times', '', 10); $this->SetMargins(10, 20); $this->addPage(); $this->SetAutoPageBreak(true, 25); - - $this->fundraiser = $fundraiser; } public function addPage($orientation = '', $size = '', $rotation = 0): void