public function dtgFunds_Unposted_Bind() { $fltArray = $this->objBatch->GetUnpostedBalanceByStewardshipFundId(); if (count($fltArray)) { $strArrayArray = array(); foreach ($fltArray as $intStewardshipFundId => $fltAmount) { $strArray = array(StewardshipFund::Load($intStewardshipFundId)->Name, QApplication::DisplayCurrencyHtml($fltAmount)); $strArrayArray[] = $strArray; } $this->dtgFunds->DataSource = $strArrayArray; } }
protected function Form_Create() { $this->lstYear = new QListBox($this); for ($intYear = 2002; $intYear <= date('Y'); $intYear++) { $this->lstYear->AddItem($intYear, $intYear, QApplication::PathInfo(0) ? QApplication::PathInfo(0) == $intYear : $intYear == QDateTime::Now()->Year); } $this->lstMonth = new QListBox($this); for ($intMonth = 1; $intMonth <= 12; $intMonth++) { $dttDate = new QDateTime('2000-' . $intMonth . '-01'); $this->lstMonth->AddItem($dttDate->ToString('MMMM'), $intMonth, QApplication::PathInfo(1) ? QApplication::PathInfo(1) == $intMonth : $intMonth == QDateTime::Now()->Month); } $this->lstYear->AddAction(new QChangeEvent(), new QAjaxAction('lstDate_Change')); $this->lstMonth->AddAction(new QChangeEvent(), new QAjaxAction('lstDate_Change')); $this->dtgReport = new QDataGrid($this); $this->dtgReport->AddColumn(new QDataGridColumn('Fund', '<?= $_FORM->RenderRow($_ITEM); ?><?= StewardshipFund::Load($_ITEM[0])->Name; ?>', 'Width=400px')); $this->dtgReport->AddColumn(new QDataGridColumn('Monthly Total', '<?= QApplication::DisplayCurrency($_ITEM[1]); ?>', 'Width=400px')); $this->dtgReport->AddColumn(new QDataGridColumn('YTD', '<?= QApplication::DisplayCurrency($_ITEM[2]); ?>', 'Width=400px')); $this->dttDate = new QDateTime($this->lstYear->SelectedValue . '-' . $this->lstMonth->SelectedValue . '-01'); $this->dttDate->SetTime(null, null, null); // Get the Data $objReportArray = StewardshipPost::GetReportByFundAndMonth($this->dttDate); $objReportYtdArray = StewardshipPost::GetReportYtdByFundForMonth($this->dttDate); // Setup the data holders $this->fltTotal = 0; $this->fltTotalYtd = 0; $objArray = array(); foreach ($objReportArray as $objLineItem) { $objFund = StewardshipFund::Load($objLineItem[0]); if ($objFund->AccountNumber == '7011.010' || substr($objFund->AccountNumber, 0, 1) == '4') { $this->fltTotal += $objLineItem[1]; $objArray[$objLineItem[0]] = array($objLineItem[0], $objLineItem[1], null); } } foreach ($objReportYtdArray as $objLineItem) { $objFund = StewardshipFund::Load($objLineItem[0]); if ($objFund->AccountNumber == '7011.010' || substr($objFund->AccountNumber, 0, 1) == '4') { $this->fltTotalYtd += $objLineItem[1]; if (array_key_exists($objLineItem[0], $objArray)) { $objArray[$objLineItem[0]][2] = $objLineItem[1]; } else { $objArray[$objLineItem[0]] = array($objLineItem[0], null, $objLineItem[1]); } } } // Bind the data $this->dtgReport->DataSource = $objArray; }
protected function Form_Create() { $this->dtgPledges = new StewardshipPledgeDataGrid($this); $this->dtgPledges->Paginator = new QPaginator($this->dtgPledges); $objCol = $this->dtgPledges->MetaAddColumn(QQN::StewardshipPledge()->Person->LastName, 'Name=Person', 'Html=<?= $_ITEM->Person->LinkHtml; ?>', 'Width=200px', 'HtmlEntities=false'); $objCol->OrderByClause = QQ::OrderBy(QQN::StewardshipPledge()->Person->LastName, QQN::StewardshipPledge()->Person->FirstName, QQN::StewardshipPledge()->Id); $this->dtgPledges->MetaAddColumn(QQN::StewardshipPledge()->StewardshipFund->Name, 'Name=Fund', 'Width=170px', 'FontSize=10px'); $this->dtgPledges->MetaAddColumn('PledgeAmount', 'Html=<?= $_FORM->RenderAmount($_ITEM, $_ITEM->PledgeAmount); ?>', 'HtmlEntities=false', 'Width=90px', 'Name=Pledged'); $this->dtgPledges->MetaAddColumn('RemainingAmount', 'Html=<?= $_FORM->RenderAmount($_ITEM, $_ITEM->RemainingAmount); ?>', 'HtmlEntities=false', 'Width=90px', 'Name=Remaining'); $this->dtgPledges->MetaAddColumn('DateStarted', 'Width=85px', 'FontSize=10px'); $this->dtgPledges->MetaAddColumn('DateEnded', 'Width=85px', 'FontSize=10px'); $this->dtgPledges->MetaAddColumn(QQN::StewardshipPledge()->FulfilledFlag, 'Html=<?= ($_ITEM->FulfilledFlag ? "Y" : ""); ?>', 'Name=Fulfilled?', 'Width=70px'); $this->dtgPledges->MetaAddColumn(QQN::StewardshipPledge()->ActiveFlag, 'Html=<?= $_FORM->RenderActiveFlag($_ITEM); ?>', 'Name=Active?', 'Width=70px', 'HtmlEntities=false'); $this->dtgPledges->SetDataBinder('dtgPledges_Bind'); $this->dtgPledges->NoDataHtml = '<strong>No results.</strong><br/>Please specify search parameters above.'; $this->dtgPledges->SortColumnIndex = 0; $this->dtgPledges->SortDirection = 0; $this->pxyActiveFlagToggle = new QControlProxy($this); $this->pxyActiveFlagToggle->AddAction(new QClickEvent(), new QAjaxAction('pxyActiveFlagToggle_Click')); $this->pxyActiveFlagToggle->AddAction(new QClickEvent(), new QTerminateAction()); $this->pxyActiveFlagToggleAll = new QControlProxy($this); $this->pxyActiveFlagToggleAll->AddAction(new QClickEvent(), new QAjaxAction('pxyActiveFlagToggleAll_Click')); $this->pxyActiveFlagToggleAll->AddAction(new QClickEvent(), new QTerminateAction()); $this->lstFund = new QListBox($this); $this->lstFund->AddItem('- View All -'); foreach (StewardshipFund::QueryArray(QQ::Equal(QQN::StewardshipFund()->ActiveFlag, true), QQ::OrderBy(QQN::StewardshipFund()->Name)) as $objFund) { if ($objFund->FundNumber) { $this->lstFund->AddItem($objFund->Name . ' (' . $objFund->FundNumber . ')', $objFund->Id); } else { $this->lstFund->AddItem($objFund->Name, $objFund->Id); } } $this->lstFund->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); $this->lstActiveFlag = new QListBox($this); $this->lstActiveFlag->AddItem('- View All -', null); $this->lstActiveFlag->AddItem('Active Only', true); $this->lstActiveFlag->AddItem('Inactive Only', false); $this->lstActiveFlag->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); $this->lstFulfilledFlag = new QListBox($this); $this->lstFulfilledFlag->AddItem('- View All -', null); $this->lstFulfilledFlag->AddItem('Fulfilled Only', true); $this->lstFulfilledFlag->AddItem('Not Yet Fulfilled Only', false, true); $this->lstFulfilledFlag->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); }
/** * Refresh this MetaControl with Data from the local SignupForm object. * @param boolean $blnReload reload SignupForm from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objSignupForm->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objSignupForm->Id; } } if ($this->lstSignupFormType) { $this->lstSignupFormType->SelectedValue = $this->objSignupForm->SignupFormTypeId; } if ($this->lblSignupFormTypeId) { $this->lblSignupFormTypeId->Text = $this->objSignupForm->SignupFormTypeId ? SignupFormType::$NameArray[$this->objSignupForm->SignupFormTypeId] : null; } if ($this->lstMinistry) { $this->lstMinistry->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstMinistry->AddItem(QApplication::Translate('- Select One -'), null); } $objMinistryArray = Ministry::LoadAll(); if ($objMinistryArray) { foreach ($objMinistryArray as $objMinistry) { $objListItem = new QListItem($objMinistry->__toString(), $objMinistry->Id); if ($this->objSignupForm->Ministry && $this->objSignupForm->Ministry->Id == $objMinistry->Id) { $objListItem->Selected = true; } $this->lstMinistry->AddItem($objListItem); } } } if ($this->lblMinistryId) { $this->lblMinistryId->Text = $this->objSignupForm->Ministry ? $this->objSignupForm->Ministry->__toString() : null; } if ($this->txtName) { $this->txtName->Text = $this->objSignupForm->Name; } if ($this->lblName) { $this->lblName->Text = $this->objSignupForm->Name; } if ($this->txtToken) { $this->txtToken->Text = $this->objSignupForm->Token; } if ($this->lblToken) { $this->lblToken->Text = $this->objSignupForm->Token; } if ($this->chkActiveFlag) { $this->chkActiveFlag->Checked = $this->objSignupForm->ActiveFlag; } if ($this->lblActiveFlag) { $this->lblActiveFlag->Text = $this->objSignupForm->ActiveFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkConfidentialFlag) { $this->chkConfidentialFlag->Checked = $this->objSignupForm->ConfidentialFlag; } if ($this->lblConfidentialFlag) { $this->lblConfidentialFlag->Text = $this->objSignupForm->ConfidentialFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->txtDescription) { $this->txtDescription->Text = $this->objSignupForm->Description; } if ($this->lblDescription) { $this->lblDescription->Text = $this->objSignupForm->Description; } if ($this->txtInformationUrl) { $this->txtInformationUrl->Text = $this->objSignupForm->InformationUrl; } if ($this->lblInformationUrl) { $this->lblInformationUrl->Text = $this->objSignupForm->InformationUrl; } if ($this->txtSupportEmail) { $this->txtSupportEmail->Text = $this->objSignupForm->SupportEmail; } if ($this->lblSupportEmail) { $this->lblSupportEmail->Text = $this->objSignupForm->SupportEmail; } if ($this->txtEmailNotification) { $this->txtEmailNotification->Text = $this->objSignupForm->EmailNotification; } if ($this->lblEmailNotification) { $this->lblEmailNotification->Text = $this->objSignupForm->EmailNotification; } if ($this->chkAllowOtherFlag) { $this->chkAllowOtherFlag->Checked = $this->objSignupForm->AllowOtherFlag; } if ($this->lblAllowOtherFlag) { $this->lblAllowOtherFlag->Text = $this->objSignupForm->AllowOtherFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkAllowMultipleFlag) { $this->chkAllowMultipleFlag->Checked = $this->objSignupForm->AllowMultipleFlag; } if ($this->lblAllowMultipleFlag) { $this->lblAllowMultipleFlag->Text = $this->objSignupForm->AllowMultipleFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->txtSignupLimit) { $this->txtSignupLimit->Text = $this->objSignupForm->SignupLimit; } if ($this->lblSignupLimit) { $this->lblSignupLimit->Text = $this->objSignupForm->SignupLimit; } if ($this->txtSignupMaleLimit) { $this->txtSignupMaleLimit->Text = $this->objSignupForm->SignupMaleLimit; } if ($this->lblSignupMaleLimit) { $this->lblSignupMaleLimit->Text = $this->objSignupForm->SignupMaleLimit; } if ($this->txtSignupFemaleLimit) { $this->txtSignupFemaleLimit->Text = $this->objSignupForm->SignupFemaleLimit; } if ($this->lblSignupFemaleLimit) { $this->lblSignupFemaleLimit->Text = $this->objSignupForm->SignupFemaleLimit; } if ($this->txtFundingAccount) { $this->txtFundingAccount->Text = $this->objSignupForm->FundingAccount; } if ($this->lblFundingAccount) { $this->lblFundingAccount->Text = $this->objSignupForm->FundingAccount; } if ($this->lstDonationStewardshipFund) { $this->lstDonationStewardshipFund->RemoveAllItems(); $this->lstDonationStewardshipFund->AddItem(QApplication::Translate('- Select One -'), null); $objDonationStewardshipFundArray = StewardshipFund::LoadAll(); if ($objDonationStewardshipFundArray) { foreach ($objDonationStewardshipFundArray as $objDonationStewardshipFund) { $objListItem = new QListItem($objDonationStewardshipFund->__toString(), $objDonationStewardshipFund->Id); if ($this->objSignupForm->DonationStewardshipFund && $this->objSignupForm->DonationStewardshipFund->Id == $objDonationStewardshipFund->Id) { $objListItem->Selected = true; } $this->lstDonationStewardshipFund->AddItem($objListItem); } } } if ($this->lblDonationStewardshipFundId) { $this->lblDonationStewardshipFundId->Text = $this->objSignupForm->DonationStewardshipFund ? $this->objSignupForm->DonationStewardshipFund->__toString() : null; } if ($this->calDateCreated) { $this->calDateCreated->DateTime = $this->objSignupForm->DateCreated; } if ($this->lblDateCreated) { $this->lblDateCreated->Text = sprintf($this->objSignupForm->DateCreated) ? $this->objSignupForm->__toString($this->strDateCreatedDateTimeFormat) : null; } if ($this->chkLoginNotRequiredFlag) { $this->chkLoginNotRequiredFlag->Checked = $this->objSignupForm->LoginNotRequiredFlag; } if ($this->lblLoginNotRequiredFlag) { $this->lblLoginNotRequiredFlag->Text = $this->objSignupForm->LoginNotRequiredFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->lstClassMeeting) { $this->lstClassMeeting->RemoveAllItems(); $this->lstClassMeeting->AddItem(QApplication::Translate('- Select One -'), null); $objClassMeetingArray = ClassMeeting::LoadAll(); if ($objClassMeetingArray) { foreach ($objClassMeetingArray as $objClassMeeting) { $objListItem = new QListItem($objClassMeeting->__toString(), $objClassMeeting->SignupFormId); if ($objClassMeeting->SignupFormId == $this->objSignupForm->Id) { $objListItem->Selected = true; } $this->lstClassMeeting->AddItem($objListItem); } } // Because ClassMeeting's ClassMeeting is not null, if a value is already selected, it cannot be changed. if ($this->lstClassMeeting->SelectedValue) { $this->lstClassMeeting->Enabled = false; } else { $this->lstClassMeeting->Enabled = true; } } if ($this->lblClassMeeting) { $this->lblClassMeeting->Text = $this->objSignupForm->ClassMeeting ? $this->objSignupForm->ClassMeeting->__toString() : null; } if ($this->lstEventSignupForm) { $this->lstEventSignupForm->RemoveAllItems(); $this->lstEventSignupForm->AddItem(QApplication::Translate('- Select One -'), null); $objEventSignupFormArray = EventSignupForm::LoadAll(); if ($objEventSignupFormArray) { foreach ($objEventSignupFormArray as $objEventSignupForm) { $objListItem = new QListItem($objEventSignupForm->__toString(), $objEventSignupForm->SignupFormId); if ($objEventSignupForm->SignupFormId == $this->objSignupForm->Id) { $objListItem->Selected = true; } $this->lstEventSignupForm->AddItem($objListItem); } } // Because EventSignupForm's EventSignupForm is not null, if a value is already selected, it cannot be changed. if ($this->lstEventSignupForm->SelectedValue) { $this->lstEventSignupForm->Enabled = false; } else { $this->lstEventSignupForm->Enabled = true; } } if ($this->lblEventSignupForm) { $this->lblEventSignupForm->Text = $this->objSignupForm->EventSignupForm ? $this->objSignupForm->EventSignupForm->__toString() : null; } }
/** * Refresh this MetaControl with Data from the local StewardshipPostAmount object. * @param boolean $blnReload reload StewardshipPostAmount from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objStewardshipPostAmount->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objStewardshipPostAmount->Id; } } if ($this->lstStewardshipPost) { $this->lstStewardshipPost->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstStewardshipPost->AddItem(QApplication::Translate('- Select One -'), null); } $objStewardshipPostArray = StewardshipPost::LoadAll(); if ($objStewardshipPostArray) { foreach ($objStewardshipPostArray as $objStewardshipPost) { $objListItem = new QListItem($objStewardshipPost->__toString(), $objStewardshipPost->Id); if ($this->objStewardshipPostAmount->StewardshipPost && $this->objStewardshipPostAmount->StewardshipPost->Id == $objStewardshipPost->Id) { $objListItem->Selected = true; } $this->lstStewardshipPost->AddItem($objListItem); } } } if ($this->lblStewardshipPostId) { $this->lblStewardshipPostId->Text = $this->objStewardshipPostAmount->StewardshipPost ? $this->objStewardshipPostAmount->StewardshipPost->__toString() : null; } if ($this->lstStewardshipFund) { $this->lstStewardshipFund->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstStewardshipFund->AddItem(QApplication::Translate('- Select One -'), null); } $objStewardshipFundArray = StewardshipFund::LoadAll(); if ($objStewardshipFundArray) { foreach ($objStewardshipFundArray as $objStewardshipFund) { $objListItem = new QListItem($objStewardshipFund->__toString(), $objStewardshipFund->Id); if ($this->objStewardshipPostAmount->StewardshipFund && $this->objStewardshipPostAmount->StewardshipFund->Id == $objStewardshipFund->Id) { $objListItem->Selected = true; } $this->lstStewardshipFund->AddItem($objListItem); } } } if ($this->lblStewardshipFundId) { $this->lblStewardshipFundId->Text = $this->objStewardshipPostAmount->StewardshipFund ? $this->objStewardshipPostAmount->StewardshipFund->__toString() : null; } if ($this->txtAmount) { $this->txtAmount->Text = $this->objStewardshipPostAmount->Amount; } if ($this->lblAmount) { $this->lblAmount->Text = $this->objStewardshipPostAmount->Amount; } }
public static function GenerateMinistries() { QDataGen::DisplayForEachTaskStart('Generating Minsitries', count(self::$MinistryArray)); foreach (self::$MinistryArray as $strToken => $strMinistry) { QDataGen::DisplayForEachTaskNext('Generating Minsitries'); $objMinistry = new Ministry(); $objMinistry->Token = $strToken; $objMinistry->Name = $strMinistry; $objMinistry->ActiveFlag = true; $objMinistry->Save(); $objFund = new StewardshipFund(); $objFund->Ministry = $objMinistry; $objFund->Name = 'Ministry - ' . $objMinistry->Name; $objFund->AccountNumber = rand(100, 999); $objFund->Save(); $strArray = array('Member' => GroupRoleType::Participant, 'Participant' => GroupRoleType::Participant, 'Volunteer' => GroupRoleType::Volunteer, 'Leader' => GroupRoleType::Volunteer); foreach ($strArray as $strName => $intGroupRoleTypeId) { $objGroupRole = new GroupRole(); $objGroupRole->Ministry = $objMinistry; $objGroupRole->Name = $strName; $objGroupRole->GroupRoleTypeId = $intGroupRoleTypeId; $objGroupRole->Save(); } } self::$MinistryArray = Ministry::LoadAll(); QDataGen::DisplayForEachTaskEnd('Generating Minsitries'); }
public static function GetSoapArrayFromArray($objArray) { if (!$objArray) { return null; } $objArrayToReturn = array(); foreach ($objArray as $objObject) { array_push($objArrayToReturn, StewardshipFund::GetSoapObjectFromObject($objObject, true)); } return unserialize(serialize($objArrayToReturn)); }
$fltTotalGiftsOver10000 = 0; $fltTotalAverageGiftSize = 0; $fltTotalGiftAmount = 0; $fltTotalGivers = 0; $objDataGridArray = array(); $objMonthlyTotal = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); $objMonthlyCount = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); $objOver1000 = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); $objOver10000 = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); $objUniqueGiver = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); $objGiverCount = array(array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array(), array()); $objGiverList = array(); while ($objContribution = StewardshipContribution::InstantiateCursor($objContributionCursor)) { $objContributionAmtArray = StewardshipContributionAmount::LoadArrayByStewardshipContributionId($objContribution->Id); foreach ($objContributionAmtArray as $objContributionAmt) { $strAccountNumber = StewardshipFund::Load($objContributionAmt->StewardshipFundId)->AccountNumber; if ($strAccountNumber == '7011.010' || substr($strAccountNumber, 0, 1) == '4') { $iMonth = 0; $fltTotalGiftAmount += $objContributionAmt->Amount; $fltTotalGifts++; if ($objContribution->DateCredited->IsLaterOrEqualTo(new QDateTime("1/1/" . $intYear)) && $objContribution->DateCredited->IsEarlierThan(new QDateTime("2/1/" . $intYear))) { $iMonth = 0; } else { if ($objContribution->DateCredited->IsLaterOrEqualTo(new QDateTime("2/1/" . $intYear)) && $objContribution->DateCredited->IsEarlierThan(new QDateTime("3/1/" . $intYear))) { $iMonth = 1; } else { if ($objContribution->DateCredited->IsLaterOrEqualTo(new QDateTime("3/1/" . $intYear)) && $objContribution->DateCredited->IsEarlierThan(new QDateTime("4/1/" . $intYear))) { $iMonth = 2; } else { if ($objContribution->DateCredited->IsLaterOrEqualTo(new QDateTime("4/1/" . $intYear)) && $objContribution->DateCredited->IsEarlierThan(new QDateTime("5/1/" . $intYear))) { $iMonth = 3;
public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) { if ($objObject->objPerson) { $objObject->objPerson = Person::GetSoapObjectFromObject($objObject->objPerson, false); } else { if (!$blnBindRelatedObjects) { $objObject->intPersonId = null; } } if ($objObject->objStewardshipFund) { $objObject->objStewardshipFund = StewardshipFund::GetSoapObjectFromObject($objObject->objStewardshipFund, false); } else { if (!$blnBindRelatedObjects) { $objObject->intStewardshipFundId = null; } } if ($objObject->dttDateStarted) { $objObject->dttDateStarted = $objObject->dttDateStarted->__toString(QDateTime::FormatSoap); } if ($objObject->dttDateEnded) { $objObject->dttDateEnded = $objObject->dttDateEnded->__toString(QDateTime::FormatSoap); } return $objObject; }
/** * Deletes all associated StewardshipFunds * @return void */ public function DeleteAllStewardshipFunds() { if (is_null($this->intId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateStewardshipFund on this unsaved Ministry.'); } // Get the Database Object for this Class $objDatabase = Ministry::GetDatabase(); // Journaling if ($objDatabase->JournalingDatabase) { foreach (StewardshipFund::LoadArrayByMinistryId($this->intId) as $objStewardshipFund) { $objStewardshipFund->Journal('DELETE'); } } // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `stewardship_fund` WHERE `ministry_id` = ' . $objDatabase->SqlVariable($this->intId) . ' '); }
/** * Static Helper Method to Create using PK arguments * You must pass in the PK arguments on an object to load, or leave it blank to create a new one. * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo * static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to * edit, or if we are also allowed to create a new one, etc. * * @param mixed $objParentObject QForm or QPanel which will be using this StewardshipFundMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing StewardshipFund object creation - defaults to CreateOrEdit * @return StewardshipFundMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objStewardshipFund = StewardshipFund::Load($intId); // StewardshipFund was found -- return it! if ($objStewardshipFund) { return new StewardshipFundMetaControl($objParentObject, $objStewardshipFund); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a StewardshipFund object with PK arguments: ' . $intId); } } // If EditOnly is specified, throw an exception } else { if ($intCreateType == QMetaControlCreateType::EditOnly) { throw new QCallerException('No PK arguments specified'); } } // If we are here, then we need to create a new record return new StewardshipFundMetaControl($objParentObject, new StewardshipFund()); }
protected function SetupPanel() { $this->dtgStewardshipContributionAmount = new StewardshipContributionAmountDataGrid($this); $this->dtgStewardshipContributionAmount->MetaAddColumn(QQN::StewardshipContributionAmount()->StewardshipContribution->DateCredited, 'Html=<?= $_CONTROL->ParentControl->RenderDate($_ITEM); ?>', 'Name=Date', 'Width=100px', 'HtmlEntities=false'); $this->dtgStewardshipContributionAmount->MetaAddColumn(QQN::StewardshipContributionAmount()->StewardshipContribution->Person->LastName, 'Html=<?= $_CONTROL->ParentControl->RenderPerson($_ITEM); ?>', 'Name=Person', 'Width=180px'); $this->dtgStewardshipContributionAmount->MetaAddColumn(QQN::StewardshipContributionAmount()->StewardshipFund->Name, 'Name=Fund', 'Width=180px'); $this->dtgStewardshipContributionAmount->MetaAddColumn(QQN::StewardshipContributionAmount()->StewardshipContribution->StewardshipContributionTypeId, 'Html=<?= $_CONTROL->ParentControl->RenderTransaction($_ITEM); ?>', 'Name=Transaction', 'Width=170px'); $this->dtgStewardshipContributionAmount->MetaAddColumn(QQN::StewardshipContributionAmount()->Amount, 'Html=<?= $_CONTROL->ParentControl->RenderAmount($_ITEM); ?>', 'HtmlEntities=false', 'FontNames=Lucida Console,Courier New,Courier,monospaced', 'Width=90px'); $this->dtgStewardshipContributionAmount->SetDataBinder('dtgStewardshipContributionAmount_Bind', $this); $this->dtgStewardshipContributionAmount->SortColumnIndex = 0; $this->dtgStewardshipContributionAmount->NoDataHtml = 'No contribution records given your filtering criteria above.'; if ($this->objForm->objHousehold) { $this->chkCombined = new QCheckBox($this); $this->chkCombined->Text = 'View contributions by all household members'; $this->chkCombined->Checked = $this->objForm->objHousehold->CombinedStewardshipFlag; } $this->lstYear = new QListBox($this); $this->lstYear->AddItem('- View All -', null); $intYearNow = QDateTime::Now()->Year; if (array_key_exists('stewardship_view_year', $_SESSION)) { $intYearToView = $_SESSION['stewardship_view_year']; } else { $intYearToView = $intYearNow; } for ($intYear = 2000; $intYear <= $intYearNow + 1; $intYear++) { $this->lstYear->AddItem($intYear, $intYear, $intYear == $intYearToView); } $this->lstFund = new QListBox($this); $this->lstFund->AddItem('- View All -', null, true); foreach (StewardshipFund::LoadAll(QQ::OrderBy(QQN::StewardshipFund()->Name)) as $objFund) { $this->lstFund->AddItem($objFund->Name, $objFund->Id); } $this->lstYear->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'lstYear_Change')); $this->lstYear->AddAction(new QEnterKeyEvent(), new QAjaxControlAction($this, 'lstYear_Change')); $this->lstYear->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->lstFund->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'Filter')); $this->lstFund->AddAction(new QEnterKeyEvent(), new QAjaxControlAction($this, 'Filter')); $this->lstFund->AddAction(new QEnterKeyEvent(), new QTerminateAction()); if ($this->objForm->objHousehold) { $this->chkCombined->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'Filter')); } $this->pxyPrint = new QControlProxy($this); $this->pxyPrint->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyPrint_Click')); $this->pxyPrint->AddAction(new QClickEvent(), new QTerminateAction()); $this->dtgPledges = new StewardshipPledgeDataGrid($this); $this->dtgPledges->FontSize = '11px'; $this->dtgPledges->MetaAddColumn(QQN::StewardshipPledge()->Person->LastName, 'Name=Pledged By', 'HtmlEntities=false', 'Html=<?= $_CONTROL->ParentControl->RenderPledgePerson($_ITEM); ?>', 'Width=180px'); $this->dtgPledges->MetaAddColumn(QQN::StewardshipPledge()->StewardshipFund->Name, 'Name=Fund', 'Width=150px'); $this->dtgPledges->MetaAddColumn(QQN::StewardshipPledge()->DateStarted, 'Name=Start Date', 'Width=75px'); $this->dtgPledges->MetaAddColumn(QQN::StewardshipPledge()->DateEnded, 'Name=End Date', 'Width=75px'); $this->dtgPledges->MetaAddColumn(QQN::StewardshipPledge()->PledgeAmount, 'Name=Pledged', 'Html=<?= QApplication::DisplayCurrency($_ITEM->PledgeAmount); ?>', 'Width=70px'); $this->dtgPledges->MetaAddColumn(QQN::StewardshipPledge()->ContributedAmount, 'Name=Contributed', 'Html=<?= QApplication::DisplayCurrency($_ITEM->ContributedAmount); ?>', 'Width=70px'); $this->dtgPledges->MetaAddColumn(QQN::StewardshipPledge()->RemainingAmount, 'Name=Remaining', 'FontBold=true', 'Html=<?= QApplication::DisplayCurrency($_ITEM->RemainingAmount); ?>', 'Width=75px'); $this->dtgPledges->SetDataBinder('dtgPledges_Bind', $this); $this->dtgPledges->NoDataHtml = '<span style="font-size: 14px;">No pledge records given your filtering criteria above.</span>'; if ($this->objPerson->DeceasedFlag && $this->objForm->objHousehold && $this->objForm->objHousehold->CountHouseholdParticipations() > 1) { $this->btnMoveTransactions = new QButton($this); $this->btnMoveTransactions->CssClass = 'alternate'; $this->btnMoveTransactions->Text = 'Deceased / Move Transactions'; $this->btnMoveTransactions->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnMoveTransactions_Click')); $this->dlgMove = new QDialogBox($this); $this->dlgMove->Template = dirname(__FILE__) . '/dlgMove.tpl.php'; $this->dlgMove->MatteClickable = false; $this->dlgMove->HideDialogBox(); $this->lstMoveTo = new QListBox($this->dlgMove); $this->lstMoveTo->AddItem('- Select One -', null); $this->lstMoveTo->Name = 'Reassign To'; $this->lstMoveTo->Required = true; foreach ($this->objForm->objHousehold->GetHouseholdParticipationArray() as $objHouseholdParticipation) { if ($objHouseholdParticipation->PersonId != $this->objPerson->Id) { $this->lstMoveTo->AddItem($objHouseholdParticipation->Person->Name, $objHouseholdParticipation->Person->Id); } } $this->btnMoveSave = new QButton($this->dlgMove); $this->btnMoveSave->Text = 'Move Transactions'; $this->btnMoveSave->CssClass = 'primary'; $this->btnMoveSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnMoveSave_Click')); $this->btnMoveSave->CausesValidation = QCausesValidation::SiblingsAndChildren; $this->btnMoveCancel = new QLinkButton($this->dlgMove); $this->btnMoveCancel->Text = 'Cancel'; $this->btnMoveCancel->CssClass = 'cancel'; $this->btnMoveCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnMoveCancel_Click')); $this->btnMoveCancel->AddAction(new QClickEvent(), new QTerminateAction()); } }
public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) { if ($objObject->objMinistry) { $objObject->objMinistry = Ministry::GetSoapObjectFromObject($objObject->objMinistry, false); } else { if (!$blnBindRelatedObjects) { $objObject->intMinistryId = null; } } if ($objObject->objDonationStewardshipFund) { $objObject->objDonationStewardshipFund = StewardshipFund::GetSoapObjectFromObject($objObject->objDonationStewardshipFund, false); } else { if (!$blnBindRelatedObjects) { $objObject->intDonationStewardshipFundId = null; } } if ($objObject->dttDateCreated) { $objObject->dttDateCreated = $objObject->dttDateCreated->__toString(QDateTime::FormatSoap); } return $objObject; }
// Failed! } else { // Report Message if (!$mixReturn) { print "Cannot connect to payment gateway.\n"; $status = null; $strPaymentItems = ''; } else { $objPaymentObject->Status = false; $objPaymentObject->Save(); $status = $mixReturn; print sprintf("Credit Card Processing Failed: %s\n", $mixReturn); $strPaymentItems = ''; $objDonationItems = RecurringDonationItems::LoadArrayByRecurringDonationId($objRecurringPayment->RecurringDonationAsRecurringPayment->Id); foreach ($objDonationItems as $objDonationItem) { $objFund = StewardshipFund::LoadById($objDonationItem->StewardshipFundId); $strPaymentItems .= sprintf("%s - \$%01.2f ,", $objFund->Name, $objDonationItem->Amount); } } sendFailureEmail($objPaymentObject->Person->Id, $objPaymentObject->Id, $objCrypto->Decrypt($objRecurringPayment->CardHolderName), $objRecurringPayment->CreditCardTypeId, $objCrypto->Decrypt($objRecurringPayment->AccountNumber), $strPaymentItems, $objRecurringPayment->Amount, $status); } /********************/ } else { print sprintf("Checked. And today was not : %s\n", date('Y-m-d', $checkTime)); } $checkTime += $timePeriod; } print "\n"; // create a payment entry for each one scheduled for today } function sendSuccessEmail($intPersonId, $intDonationId, $strCardholderName, $strAccountNumber, $intCreditCardTypeId, $strPaymentItems, $intAmount)
/** * Refresh this MetaControl with Data from the local StewardshipPledge object. * @param boolean $blnReload reload StewardshipPledge from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objStewardshipPledge->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objStewardshipPledge->Id; } } if ($this->lstPerson) { $this->lstPerson->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstPerson->AddItem(QApplication::Translate('- Select One -'), null); } $objPersonArray = Person::LoadAll(); if ($objPersonArray) { foreach ($objPersonArray as $objPerson) { $objListItem = new QListItem($objPerson->__toString(), $objPerson->Id); if ($this->objStewardshipPledge->Person && $this->objStewardshipPledge->Person->Id == $objPerson->Id) { $objListItem->Selected = true; } $this->lstPerson->AddItem($objListItem); } } } if ($this->lblPersonId) { $this->lblPersonId->Text = $this->objStewardshipPledge->Person ? $this->objStewardshipPledge->Person->__toString() : null; } if ($this->lstStewardshipFund) { $this->lstStewardshipFund->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstStewardshipFund->AddItem(QApplication::Translate('- Select One -'), null); } $objStewardshipFundArray = StewardshipFund::LoadAll(); if ($objStewardshipFundArray) { foreach ($objStewardshipFundArray as $objStewardshipFund) { $objListItem = new QListItem($objStewardshipFund->__toString(), $objStewardshipFund->Id); if ($this->objStewardshipPledge->StewardshipFund && $this->objStewardshipPledge->StewardshipFund->Id == $objStewardshipFund->Id) { $objListItem->Selected = true; } $this->lstStewardshipFund->AddItem($objListItem); } } } if ($this->lblStewardshipFundId) { $this->lblStewardshipFundId->Text = $this->objStewardshipPledge->StewardshipFund ? $this->objStewardshipPledge->StewardshipFund->__toString() : null; } if ($this->calDateStarted) { $this->calDateStarted->DateTime = $this->objStewardshipPledge->DateStarted; } if ($this->lblDateStarted) { $this->lblDateStarted->Text = sprintf($this->objStewardshipPledge->DateStarted) ? $this->objStewardshipPledge->__toString($this->strDateStartedDateTimeFormat) : null; } if ($this->calDateEnded) { $this->calDateEnded->DateTime = $this->objStewardshipPledge->DateEnded; } if ($this->lblDateEnded) { $this->lblDateEnded->Text = sprintf($this->objStewardshipPledge->DateEnded) ? $this->objStewardshipPledge->__toString($this->strDateEndedDateTimeFormat) : null; } if ($this->txtPledgeAmount) { $this->txtPledgeAmount->Text = $this->objStewardshipPledge->PledgeAmount; } if ($this->lblPledgeAmount) { $this->lblPledgeAmount->Text = $this->objStewardshipPledge->PledgeAmount; } if ($this->txtContributedAmount) { $this->txtContributedAmount->Text = $this->objStewardshipPledge->ContributedAmount; } if ($this->lblContributedAmount) { $this->lblContributedAmount->Text = $this->objStewardshipPledge->ContributedAmount; } if ($this->txtRemainingAmount) { $this->txtRemainingAmount->Text = $this->objStewardshipPledge->RemainingAmount; } if ($this->lblRemainingAmount) { $this->lblRemainingAmount->Text = $this->objStewardshipPledge->RemainingAmount; } if ($this->chkFulfilledFlag) { $this->chkFulfilledFlag->Checked = $this->objStewardshipPledge->FulfilledFlag; } if ($this->lblFulfilledFlag) { $this->lblFulfilledFlag->Text = $this->objStewardshipPledge->FulfilledFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->chkActiveFlag) { $this->chkActiveFlag->Checked = $this->objStewardshipPledge->ActiveFlag; } if ($this->lblActiveFlag) { $this->lblActiveFlag->Text = $this->objStewardshipPledge->ActiveFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } }
/** * Main utility method to aid with data binding. It is used by the default BindAllRows() databinder but * could and should be used by any custom databind methods that would be used for instances of this * MetaDataGrid, by simply passing in a custom QQCondition and/or QQClause. * * If a paginator is set on this DataBinder, it will use it. If not, then no pagination will be used. * It will also perform any sorting (if applicable). * * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query * @return void */ public function MetaDataBinder(QQCondition $objCondition = null, $objOptionalClauses = null) { // Setup input parameters to default values if none passed in if (!$objCondition) { $objCondition = QQ::All(); } $objClauses = $objOptionalClauses ? $objOptionalClauses : array(); // We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below if ($this->Paginator) { $this->TotalItemCount = StewardshipFund::QueryCount($objCondition, $objClauses); } // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add // the OrderByClause to the $objClauses array if ($objClause = $this->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be a Query result from StewardshipFund, given the clauses above $this->DataSource = StewardshipFund::QueryArray($objCondition, $objClauses); }
protected function Form_Create() { $this->dtgContributions = new StewardshipContributionDataGrid($this); $this->dtgContributions->Paginator = new QPaginator($this->dtgContributions); $this->dtgContributions->MetaAddColumn(QQN::StewardshipContribution()->Person->LastName, 'Name=Person', 'Html=<?= $_ITEM->Id ? $_ITEM->Person->Name : "TOTAL"; ?>', 'Width=280px'); $this->dtgContributions->MetaAddColumn('TotalAmount', 'Html=<?= $_FORM->RenderAmount($_ITEM); ?>', 'HtmlEntities=false', 'Width=150px'); $this->dtgContributions->MetaAddColumn('CheckNumber', 'Width=120px'); $this->dtgContributions->MetaAddColumn('AuthorizationNumber', 'Width=140px'); $this->dtgContributions->MetaAddColumn(QQN::StewardshipContribution()->StewardshipBatch->DateEntered, 'Width=100px'); $this->dtgContributions->MetaAddColumn('DateCredited', 'Width=100px'); $this->dtgContributions->SetDataBinder('dtgContributions_Bind'); $this->dtgContributions->NoDataHtml = '<strong>No results.</strong><br/>Please specify search parameters above.'; $this->dtgContributions->SortColumnIndex = 0; $this->dtgContributions->SortDirection = 0; $this->btnCalculateTotal = new QButton($this); $this->btnCalculateTotal->CssClass = 'primary'; $this->btnCalculateTotal->Text = 'Calculate Total Amount'; $this->btnCalculateLabel = new QLabel($this); $this->btnCalculateLabel->Text = 'Calculating... <img src="/assets/images/spinner_14.gif"/>'; $this->btnCalculateLabel->Display = false; $this->btnCalculateLabel->HtmlEntities = false; $this->btnCalculateTotal->AddAction(new QClickEvent(), new QToggleDisplayAction($this->btnCalculateTotal)); $this->btnCalculateTotal->AddAction(new QClickEvent(), new QToggleDisplayAction($this->btnCalculateLabel)); $this->btnCalculateTotal->AddAction(new QClickEvent(), new QAjaxAction('btnCalculateTotal_Click')); $this->btnPrint = new QButton($this); $this->btnPrint->CssClass = 'alternate'; $this->btnPrint->Text = 'Print Results'; $this->btnPrintLabel = new QLabel($this); $this->btnPrintLabel->Text = 'Preparing to Print... <img src="/assets/images/spinner_14.gif"/>'; $this->btnPrintLabel->Display = false; $this->btnPrintLabel->HtmlEntities = false; $this->btnPrint->AddAction(new QClickEvent(), new QToggleDisplayAction($this->btnPrint)); $this->btnPrint->AddAction(new QClickEvent(), new QToggleDisplayAction($this->btnPrintLabel)); $this->btnPrint->AddAction(new QClickEvent(), new QAjaxAction('btnPrint_Click')); $this->txtName = new QTextBox($this); $this->txtDateEnteredStart = new QDateTimeTextBox($this); $this->txtDateEnteredEnd = new QDateTimeTextBox($this); $this->txtDateCreditedStart = new QDateTimeTextBox($this); $this->txtDateCreditedEnd = new QDateTimeTextBox($this); $this->txtAmount = new QFloatTextBox($this); $this->txtCheckNumber = new QTextBox($this); $this->txtAuthorizationNumber = new QTextBox($this); $this->lstFund = new QListBox($this); $this->txtDateCreditedStart->Text = 'Jan 1 ' . date('Y'); $this->txtDateCreditedEnd->Text = 'Dec 31 ' . date('Y'); $this->lstFund->AddItem('- View All -'); foreach (StewardshipFund::QueryArray(QQ::Equal(QQN::StewardshipFund()->ActiveFlag, true), QQ::OrderBy(QQN::StewardshipFund()->Name)) as $objFund) { if ($objFund->FundNumber) { $this->lstFund->AddItem($objFund->Name . ' (' . $objFund->FundNumber . ')', $objFund->Id); } else { $this->lstFund->AddItem($objFund->Name, $objFund->Id); } } $this->lstFund->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); $this->txtName->AddAction(new QEnterKeyEvent(), new QAjaxAction('ResetFilter')); $this->txtName->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtName->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); $this->txtDateEnteredStart->AddAction(new QEnterKeyEvent(), new QAjaxAction('ResetFilter')); $this->txtDateEnteredStart->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtDateEnteredStart->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); $this->txtDateEnteredEnd->AddAction(new QEnterKeyEvent(), new QAjaxAction('ResetFilter')); $this->txtDateEnteredEnd->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtDateEnteredEnd->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); $this->txtDateCreditedStart->AddAction(new QEnterKeyEvent(), new QAjaxAction('ResetFilter')); $this->txtDateCreditedStart->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtDateCreditedStart->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); $this->txtDateCreditedEnd->AddAction(new QEnterKeyEvent(), new QAjaxAction('ResetFilter')); $this->txtDateCreditedEnd->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtDateCreditedEnd->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); $this->txtAmount->AddAction(new QEnterKeyEvent(), new QAjaxAction('ResetFilter')); $this->txtAmount->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtAmount->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); $this->txtCheckNumber->AddAction(new QEnterKeyEvent(), new QAjaxAction('ResetFilter')); $this->txtCheckNumber->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtCheckNumber->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); $this->txtAuthorizationNumber->AddAction(new QEnterKeyEvent(), new QAjaxAction('ResetFilter')); $this->txtAuthorizationNumber->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtAuthorizationNumber->AddAction(new QChangeEvent(), new QAjaxAction('ResetFilter')); }
public function RenderFund(RecurringDonationItems $objItem = null) { if (!$objItem) { return '<strong>TOTAL SUBMISSION</strong>'; } $lstFunds = $this->GetControl('lstFunds' . $this->dtgDonationItems->CurrentRowIndex); $txtFund = $this->GetControl('txtFund' . $this->dtgDonationItems->CurrentRowIndex); if (!$lstFunds) { $lstFunds = new QListBox($this->dtgDonationItems, 'lstFunds' . $this->dtgDonationItems->CurrentRowIndex); $lstFunds->ActionParameter = $this->dtgDonationItems->CurrentRowIndex; $lstFunds->AddAction(new QChangeEvent(), new QAjaxAction('lstFunds_Change')); $txtFund = new QTextBox($this->dtgDonationItems, 'txtFund' . $this->dtgDonationItems->CurrentRowIndex); $txtFund->Visible = false; if (!$objItem->StewardshipFundId) { $lstFunds->AddItem('- Select One -', null); } foreach (StewardshipFund::LoadArrayByExternalFlag(true, QQ::OrderBy(QQN::StewardshipFund()->ExternalName)) as $objFund) { $lstFunds->AddItem($objFund->ExternalName, $objFund->Id, $objFund->Id == $objItem->StewardshipFundId); } $lstFunds->AddItem('- Other... -', false); } return $lstFunds->RenderWithError(false) . ' ' . $txtFund->RenderWithError(false); }
/** * Refresh this MetaControl with Data from the local OnlineDonationLineItem object. * @param boolean $blnReload reload OnlineDonationLineItem from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objOnlineDonationLineItem->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objOnlineDonationLineItem->Id; } } if ($this->lstOnlineDonation) { $this->lstOnlineDonation->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstOnlineDonation->AddItem(QApplication::Translate('- Select One -'), null); } $objOnlineDonationArray = OnlineDonation::LoadAll(); if ($objOnlineDonationArray) { foreach ($objOnlineDonationArray as $objOnlineDonation) { $objListItem = new QListItem($objOnlineDonation->__toString(), $objOnlineDonation->Id); if ($this->objOnlineDonationLineItem->OnlineDonation && $this->objOnlineDonationLineItem->OnlineDonation->Id == $objOnlineDonation->Id) { $objListItem->Selected = true; } $this->lstOnlineDonation->AddItem($objListItem); } } } if ($this->lblOnlineDonationId) { $this->lblOnlineDonationId->Text = $this->objOnlineDonationLineItem->OnlineDonation ? $this->objOnlineDonationLineItem->OnlineDonation->__toString() : null; } if ($this->txtAmount) { $this->txtAmount->Text = $this->objOnlineDonationLineItem->Amount; } if ($this->lblAmount) { $this->lblAmount->Text = $this->objOnlineDonationLineItem->Amount; } if ($this->chkDonationFlag) { $this->chkDonationFlag->Checked = $this->objOnlineDonationLineItem->DonationFlag; } if ($this->lblDonationFlag) { $this->lblDonationFlag->Text = $this->objOnlineDonationLineItem->DonationFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->lstStewardshipFund) { $this->lstStewardshipFund->RemoveAllItems(); $this->lstStewardshipFund->AddItem(QApplication::Translate('- Select One -'), null); $objStewardshipFundArray = StewardshipFund::LoadAll(); if ($objStewardshipFundArray) { foreach ($objStewardshipFundArray as $objStewardshipFund) { $objListItem = new QListItem($objStewardshipFund->__toString(), $objStewardshipFund->Id); if ($this->objOnlineDonationLineItem->StewardshipFund && $this->objOnlineDonationLineItem->StewardshipFund->Id == $objStewardshipFund->Id) { $objListItem->Selected = true; } $this->lstStewardshipFund->AddItem($objListItem); } } } if ($this->lblStewardshipFundId) { $this->lblStewardshipFundId->Text = $this->objOnlineDonationLineItem->StewardshipFund ? $this->objOnlineDonationLineItem->StewardshipFund->__toString() : null; } if ($this->txtOther) { $this->txtOther->Text = $this->objOnlineDonationLineItem->Other; } if ($this->lblOther) { $this->lblOther->Text = $this->objOnlineDonationLineItem->Other; } }
public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) { if ($objObject->objStewardshipContribution) { $objObject->objStewardshipContribution = StewardshipContribution::GetSoapObjectFromObject($objObject->objStewardshipContribution, false); } else { if (!$blnBindRelatedObjects) { $objObject->intStewardshipContributionId = null; } } if ($objObject->objStewardshipFund) { $objObject->objStewardshipFund = StewardshipFund::GetSoapObjectFromObject($objObject->objStewardshipFund, false); } else { if (!$blnBindRelatedObjects) { $objObject->intStewardshipFundId = null; } } return $objObject; }
protected function Form_Create() { $this->objBatch = PaypalBatch::Load(QApplication::PathInfo(0)); if (!$this->objBatch) { QApplication::Redirect('/stewardship/paypal'); } $this->strPageTitle .= $this->objBatch->Number; $this->dtgTransactions = new QDataGrid($this); $this->dtgTransactions->SetDataBinder('dtgTransactions_Bind'); $this->dtgTransactions->AddColumn(new QDataGridColumn('Date Captured', '<?= $_ITEM[0]; ?>', 'Width=150px', 'HtmlEntities=false', 'VerticalAlign=top')); $this->dtgTransactions->AddColumn(new QDataGridColumn('Total Amount Charged', '<?= $_ITEM[1]; ?>', 'Width=150px', 'VerticalAlign=top')); $this->dtgTransactions->AddColumn(new QDataGridColumn('Transaction Code', '<?= $_ITEM[2]; ?>', 'Width=120px', 'VerticalAlign=top')); $this->dtgTransactions->AddColumn(new QDataGridColumn('Account Funding', '<?= $_ITEM[3]; ?>', 'Width=330px', 'HtmlEntities=false', 'VerticalAlign=top', 'FontSize=10px')); $this->dtgTransactions->AddColumn(new QDataGridColumn('Funding Amount', '<?= $_ITEM[4]; ?>', 'Width=150px', 'HtmlEntities=false', 'VerticalAlign=top', 'FontSize=10px')); $this->dtgFunding = new QDataGrid($this); $this->dtgFunding->SetDataBinder('dtgFunding_Bind'); $this->dtgFunding->AddColumn(new QDataGridColumn('Fund', '<?= $_ITEM[0]; ?>', 'Width=340px', 'HtmlEntities=false')); $this->dtgFunding->AddColumn(new QDataGridColumn('Account Number', '<?= $_ITEM[1]; ?>', 'Width=200px')); $this->dtgFunding->AddColumn(new QDataGridColumn('Amount', '<?= $_ITEM[2]; ?>', 'HtmlEntities=false', 'Width=380px', 'HtmlEntities=false')); $this->dtgUnaccounted = new CreditCardPaymentDataGrid($this); $this->dtgUnaccounted->MetaAddColumn('DateCaptured', 'Width=200px'); $this->dtgUnaccounted->MetaAddColumn('AmountCharged', 'Html=<?= QApplication::DisplayCurrency($_ITEM->AmountCharged); ?>', 'Width=150px'); $this->dtgUnaccounted->MetaAddColumn('TransactionCode', 'Width=500px'); $this->dtgUnaccounted->SortColumnIndex = 0; $this->dtgUnaccounted->SetDataBinder('dtgUnaccounted_Bind'); $this->dtgUnaccounted->NoDataHtml = 'Good! There are no unaccounted-for credit card transaction entries in this PayPal batch.'; $this->pxyEditFundDonationLineItem = new QControlProxy($this); $this->pxyEditFundDonationLineItem->AddAction(new QClickEvent(), new QAjaxAction('pxyEditFundDonationLineItem_Click')); $this->pxyEditFundDonationLineItem->AddAction(new QClickEvent(), new QTerminateAction()); $this->pxyEditFundSignupPayment = new QControlProxy($this); $this->pxyEditFundSignupPayment->AddAction(new QClickEvent(), new QAjaxAction('pxyEditFundSignupPayment_Click')); $this->pxyEditFundSignupPayment->AddAction(new QClickEvent(), new QTerminateAction()); $this->lblInstructionHtml = new QLabel($this); $this->lblInstructionHtml->TagName = 'p'; $this->lblInstructionHtml->HtmlEntities = false; $this->dtxDateCredited = new QDateTimeTextBox($this); $this->dtxDateCredited->Name = 'Date to Credit Stewardship Contributions'; $this->dtxDateCredited->Text = QDateTime::NowToString('MMMM D YYYY'); $this->dtxDateCredited->Required = true; $this->btnPost = new QButton($this); $this->btnPost->Text = 'Post to NOAH'; $this->btnPost->CssClass = 'primary'; $this->btnPost->CausesValidation = $this->dtxDateCredited; $this->btnSplit = new QButton($this); $this->btnSplit->Text = 'Split This Batch'; $this->btnSplit->CssClass = 'alternate'; $this->btnSplit->SetCustomStyle('float', 'right'); $this->btnSplit->AddAction(new QClickEvent(), new QAjaxAction('btnSplit_Click')); $this->dlgEditFund = new QDialogBox($this); $this->dlgEditFund->MatteClickable = false; $this->dlgEditFund->HideDialogBox(); $this->dlgEditFund->Template = dirname(__FILE__) . '/dlgEditFund.tpl.php'; $this->lblDialogFund = new QLabel($this->dlgEditFund); $this->lblDialogFund->Text = 'Please specify the appropriate Stewardship Funding Account for this line item.'; $this->lblDialogFund->Visible = false; $this->lstDialogFund = new QListBox($this->dlgEditFund); $this->lstDialogFund->Name = 'Stewardship Fund'; $this->lstDialogFund->AddItem('- Select One -', null); $this->lstDialogFund->Required = true; foreach (StewardshipFund::LoadArrayByActiveFlag(true, QQ::OrderBy(QQN::StewardshipFund()->Name)) as $objFund) { $this->lstDialogFund->AddItem($objFund->Name, $objFund->Id); } $this->lstDialogFund->AddItem('- Other (Non-Donation)... -', -1); $this->lstDialogFund->AddAction(new QChangeEvent(), new QAjaxAction('lstDialogFund_Change')); $this->lstDialogFund->Visible = false; $this->txtDialogOther = new QTextBox($this->dlgEditFund); $this->txtDialogOther->Name = 'Non-Donation Funding Account'; $this->txtDialogOther->Visible = false; $this->lblDialogSplitFund = new QLabel($this->dlgEditFund); $this->lblDialogSplitFund->Visible = false; $this->lstDialogSplitFund = array(); $this->txtDialogSplitOther = array(); $this->txtDialogSplitAmount = array(); $this->lblDialogSplitFundTitle = array(); for ($i = 0; $i < 2; $i++) { $this->lblDialogSplitFundTitle[$i] = new QLabel($this->dlgEditFund); $this->lblDialogSplitFundTitle[$i]->HtmlEntities = false; $this->lblDialogSplitFundTitle[$i]->Text = '<h4>Line Item ' . ($i + 1) . '</h4>'; $this->lblDialogSplitFundTitle[$i]->Visible = false; $this->lstDialogSplitFund[$i] = new QListBox($this->dlgEditFund); $this->lstDialogSplitFund[$i]->Name = 'Stewardship Fund'; $this->lstDialogSplitFund[$i]->AddItem('- Select One -', null); $this->lstDialogSplitFund[$i]->Required = true; foreach (StewardshipFund::LoadArrayByActiveFlag(true, QQ::OrderBy(QQN::StewardshipFund()->Name)) as $objFund) { $this->lstDialogSplitFund[$i]->AddItem($objFund->Name, $objFund->Id); } $this->lstDialogSplitFund[$i]->AddItem('- Other (Non-Donation)... -', -1); $this->lstDialogSplitFund[$i]->ActionParameter = $i; $this->lstDialogSplitFund[$i]->AddAction(new QChangeEvent(), new QAjaxAction('lstDialogSplitFund_Change')); $this->lstDialogSplitFund[$i]->Visible = false; $this->txtDialogSplitOther[$i] = new QTextBox($this->dlgEditFund); $this->txtDialogSplitOther[$i]->Name = 'Non-Donation Funding Account'; $this->txtDialogSplitOther[$i]->Visible = false; $this->txtDialogSplitAmount[$i] = new QFloatTextBox($this->dlgEditFund); $this->txtDialogSplitAmount[$i]->Name = 'Funding Amount'; $this->txtDialogSplitAmount[$i]->Visible = false; } $this->rbtnUpdateFundSelection = new QRadioButtonList($this->dlgEditFund); $this->rbtnUpdateFundSelection->AddItem('Change Stewardship Funding Account of the Line Item', 1); $this->rbtnUpdateFundSelection->AddItem('Split this Line Item into two separate Funding Accounts', 2); $this->rbtnUpdateFundSelection->HtmlBefore = 'Select how you would like to update this Stewardship Fund'; $this->rbtnUpdateFundSelection->AddAction(new QChangeEvent(), new QAjaxAction('rbtnUpdateFundSelection_Change')); $this->btnDialogSave = new QButton($this->dlgEditFund); $this->btnDialogSave->CssClass = 'primary'; $this->btnDialogSave->Text = 'Update'; $this->btnDialogSave->CausesValidation = QCausesValidation::SiblingsAndChildren; $this->btnDialogSave->AddAction(new QClickEvent(), new QAjaxAction('btnDialogSave_Click')); $this->btnDialogCancel = new QLinkButton($this->dlgEditFund); $this->btnDialogCancel->CssClass = 'cancel'; $this->btnDialogCancel->Text = 'Cancel'; $this->btnDialogCancel->AddAction(new QClickEvent(), new QAjaxAction('btnDialogCancel_Click')); $this->btnDialogCancel->AddAction(new QClickEvent(), new QTerminateAction()); $this->dlgSplit = new QDialogBox($this); $this->dlgSplit->MatteClickable = false; $this->dlgSplit->HideDialogBox(); $this->dlgSplit->Template = dirname(__FILE__) . '/dlgSplit.tpl.php'; $this->lstSplitItem = new QListBox($this->dlgSplit); $this->lstSplitItem->Name = 'Transaction Split Point'; $this->lstSplitItem->AddItem('- Select One -', null); $this->lstSplitItem->Required = true; foreach ($this->objBatch->GetCreditCardPaymentArray(QQ::OrderBy(QQN::CreditCardPayment()->DateCaptured)) as $objPayment) { $this->lstSplitItem->AddItem('After ' . $objPayment->DateCaptured->ToString('MMM D YYYY h:mm z'), $objPayment->Id); } $this->txtSplitNameCurrent = new QTextBox($this->dlgSplit); $this->txtSplitNameCurrent->Name = 'Batch Number/Title for Original Batch'; $this->txtSplitNameCurrent->Text = $this->objBatch->Number . ' (1)'; $this->txtSplitNameNew = new QTextBox($this->dlgSplit); $this->txtSplitNameNew->Name = 'Batch Number/Title for New Batch'; $this->txtSplitNameNew->Text = $this->objBatch->Number . ' (2)'; $this->btnSplitSave = new QButton($this->dlgSplit); $this->btnSplitSave->CssClass = 'primary'; $this->btnSplitSave->Text = 'Split'; $this->btnSplitSave->CausesValidation = QCausesValidation::SiblingsAndChildren; $this->btnSplitSave->AddAction(new QClickEvent(), new QAjaxAction('btnSplitSave_Click')); $this->btnSplitCancel = new QLinkButton($this->dlgSplit); $this->btnSplitCancel->CssClass = 'cancel'; $this->btnSplitCancel->Text = 'Cancel'; $this->btnSplitCancel->AddAction(new QClickEvent(), new QAjaxAction('btnSplitCancel_Click')); $this->btnSplitCancel->AddAction(new QClickEvent(), new QTerminateAction()); $this->Transactions_Refresh(); }
public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) { if ($objObject->objSignupEntry) { $objObject->objSignupEntry = SignupEntry::GetSoapObjectFromObject($objObject->objSignupEntry, false); } else { if (!$blnBindRelatedObjects) { $objObject->intSignupEntryId = null; } } if ($objObject->dttTransactionDate) { $objObject->dttTransactionDate = $objObject->dttTransactionDate->__toString(QDateTime::FormatSoap); } if ($objObject->objDonationStewardshipFund) { $objObject->objDonationStewardshipFund = StewardshipFund::GetSoapObjectFromObject($objObject->objDonationStewardshipFund, false); } else { if (!$blnBindRelatedObjects) { $objObject->intDonationStewardshipFundId = null; } } if ($objObject->objCreditCardPayment) { $objObject->objCreditCardPayment = CreditCardPayment::GetSoapObjectFromObject($objObject->objCreditCardPayment, false); } else { if (!$blnBindRelatedObjects) { $objObject->intCreditCardPaymentId = null; } } return $objObject; }
/** * Refresh this MetaControl with Data from the local SignupPayment object. * @param boolean $blnReload reload SignupPayment from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objSignupPayment->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objSignupPayment->Id; } } if ($this->lstSignupEntry) { $this->lstSignupEntry->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstSignupEntry->AddItem(QApplication::Translate('- Select One -'), null); } $objSignupEntryArray = SignupEntry::LoadAll(); if ($objSignupEntryArray) { foreach ($objSignupEntryArray as $objSignupEntry) { $objListItem = new QListItem($objSignupEntry->__toString(), $objSignupEntry->Id); if ($this->objSignupPayment->SignupEntry && $this->objSignupPayment->SignupEntry->Id == $objSignupEntry->Id) { $objListItem->Selected = true; } $this->lstSignupEntry->AddItem($objListItem); } } } if ($this->lblSignupEntryId) { $this->lblSignupEntryId->Text = $this->objSignupPayment->SignupEntry ? $this->objSignupPayment->SignupEntry->__toString() : null; } if ($this->lstSignupPaymentType) { $this->lstSignupPaymentType->SelectedValue = $this->objSignupPayment->SignupPaymentTypeId; } if ($this->lblSignupPaymentTypeId) { $this->lblSignupPaymentTypeId->Text = $this->objSignupPayment->SignupPaymentTypeId ? SignupPaymentType::$NameArray[$this->objSignupPayment->SignupPaymentTypeId] : null; } if ($this->calTransactionDate) { $this->calTransactionDate->DateTime = $this->objSignupPayment->TransactionDate; } if ($this->lblTransactionDate) { $this->lblTransactionDate->Text = sprintf($this->objSignupPayment->TransactionDate) ? $this->objSignupPayment->__toString($this->strTransactionDateDateTimeFormat) : null; } if ($this->txtTransactionDescription) { $this->txtTransactionDescription->Text = $this->objSignupPayment->TransactionDescription; } if ($this->lblTransactionDescription) { $this->lblTransactionDescription->Text = $this->objSignupPayment->TransactionDescription; } if ($this->txtAmount) { $this->txtAmount->Text = $this->objSignupPayment->Amount; } if ($this->lblAmount) { $this->lblAmount->Text = $this->objSignupPayment->Amount; } if ($this->txtFundingAccount) { $this->txtFundingAccount->Text = $this->objSignupPayment->FundingAccount; } if ($this->lblFundingAccount) { $this->lblFundingAccount->Text = $this->objSignupPayment->FundingAccount; } if ($this->lstDonationStewardshipFund) { $this->lstDonationStewardshipFund->RemoveAllItems(); $this->lstDonationStewardshipFund->AddItem(QApplication::Translate('- Select One -'), null); $objDonationStewardshipFundArray = StewardshipFund::LoadAll(); if ($objDonationStewardshipFundArray) { foreach ($objDonationStewardshipFundArray as $objDonationStewardshipFund) { $objListItem = new QListItem($objDonationStewardshipFund->__toString(), $objDonationStewardshipFund->Id); if ($this->objSignupPayment->DonationStewardshipFund && $this->objSignupPayment->DonationStewardshipFund->Id == $objDonationStewardshipFund->Id) { $objListItem->Selected = true; } $this->lstDonationStewardshipFund->AddItem($objListItem); } } } if ($this->lblDonationStewardshipFundId) { $this->lblDonationStewardshipFundId->Text = $this->objSignupPayment->DonationStewardshipFund ? $this->objSignupPayment->DonationStewardshipFund->__toString() : null; } if ($this->txtAmountDonation) { $this->txtAmountDonation->Text = $this->objSignupPayment->AmountDonation; } if ($this->lblAmountDonation) { $this->lblAmountDonation->Text = $this->objSignupPayment->AmountDonation; } if ($this->txtAmountNonDonation) { $this->txtAmountNonDonation->Text = $this->objSignupPayment->AmountNonDonation; } if ($this->lblAmountNonDonation) { $this->lblAmountNonDonation->Text = $this->objSignupPayment->AmountNonDonation; } if ($this->lstCreditCardPayment) { $this->lstCreditCardPayment->RemoveAllItems(); $this->lstCreditCardPayment->AddItem(QApplication::Translate('- Select One -'), null); $objCreditCardPaymentArray = CreditCardPayment::LoadAll(); if ($objCreditCardPaymentArray) { foreach ($objCreditCardPaymentArray as $objCreditCardPayment) { $objListItem = new QListItem($objCreditCardPayment->__toString(), $objCreditCardPayment->Id); if ($this->objSignupPayment->CreditCardPayment && $this->objSignupPayment->CreditCardPayment->Id == $objCreditCardPayment->Id) { $objListItem->Selected = true; } $this->lstCreditCardPayment->AddItem($objListItem); } } } if ($this->lblCreditCardPaymentId) { $this->lblCreditCardPaymentId->Text = $this->objSignupPayment->CreditCardPayment ? $this->objSignupPayment->CreditCardPayment->__toString() : null; } }