protected function SetupPanel()
 {
     $this->mctPledge = StewardshipPledgeMetaControl::Create($this, $this->strUrlHashArgument, QMetaControlCreateType::CreateOnRecordNotFound);
     if (!$this->mctPledge->EditMode) {
         // Trying to create a NEW comment
         $this->mctPledge->StewardshipPledge->DateStarted = QDateTime::Now();
         $this->mctPledge->StewardshipPledge->Person = $this->objPerson;
         $this->mctPledge->StewardshipPledge->FulfilledFlag = false;
         $this->mctPledge->StewardshipPledge->ActiveFlag = true;
         $this->btnSave->Text = 'Create';
     } else {
         $this->btnSave->Text = 'Update';
         $this->btnDelete = new QLinkButton($this);
         $this->btnDelete->Text = 'Delete';
         $this->btnDelete->CssClass = 'delete';
         $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to DELETE this pledge?'));
         $this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
         $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
     }
     // Create Controls
     $this->lstStewardshipFund = $this->mctPledge->lstStewardshipFund_Create(null, QQ::All(), array(QQ::OrderBy(QQN::StewardshipFund()->Name)));
     $this->calDateStarted = $this->mctPledge->calDateStarted_Create();
     $this->calDateEnded = $this->mctPledge->calDateEnded_Create();
     $this->txtPledgeAmount = $this->mctPledge->txtPledgeAmount_Create();
     $this->chkActiveFlag = $this->mctPledge->chkActiveFlag_Create();
     $this->chkActiveFlag->Text = 'Note: All fulfilled pledges automatically considred "inactive".';
     $this->calDateStarted->MinimumYear = 2000;
     $this->calDateStarted->MaximumYear = date('Y') + 10;
     $this->calDateEnded->MinimumYear = 2000;
     $this->calDateEnded->MaximumYear = date('Y') + 10;
 }
Exemplo n.º 2
0
 public static function GenerateStewardship()
 {
     $dttDate = new QDateTime('2004-01-05');
     print 'Generating Stewardship... ';
     $objFundArray = StewardshipFund::QueryArray(QQ::NotEqual(QQN::StewardshipFund()->Id, 1));
     while ($dttDate->IsEarlierThan(QDateTime::Now())) {
         print $strDate = '[' . $dttDate->ToString('YYYY-MMM-DD') . ']';
         $intCheckCount = rand(10, 55);
         $arrStack = array();
         for ($i = 0; $i < floor(($intCheckCount - 1) / 25) + 1; $i++) {
             $arrStack[] = null;
         }
         $objBatch = StewardshipBatch::Create(self::GenerateFromArray(self::$StewardshipUserArray), $arrStack, self::GenerateFromArray(array('Weekend T/O', 'Weekend Giving', 'Tithes and Offerings', 'Tithes & Offerings', null)), $dttDate, $dttDate);
         $intStackCount = $objBatch->CountStewardshipStacks();
         $dttStart = new QDateTime($dttDate);
         $dttStart->SetTime(8, 0, 0);
         $dttEnd = new QDateTime($dttDate);
         $dttEnd->SetTime(16, 0, 0);
         for ($i = 0; $i < $intStackCount; $i++) {
             if ($i == $intStackCount - 1) {
                 if ($intCheckCount % 25 == 0) {
                     $intChecksInStackCount = 25;
                 } else {
                     $intChecksInStackCount = $intCheckCount % 25;
                 }
             } else {
                 $intChecksInStackCount = 25;
             }
             $objStack = StewardshipStack::LoadByStewardshipBatchIdStackNumber($objBatch->Id, $i + 1);
             for ($j = 0; $j < $intChecksInStackCount; $j++) {
                 $objHousehold = self::GenerateFromArray(self::$HouseholdArray);
                 $objHouseholdParticipant = self::GenerateFromArray($objHousehold->GetHouseholdParticipationArray());
                 $mixAmountArray = array();
                 if (rand(0, 50)) {
                     $mixAmountArray[] = array(1, rand(1000, 150000) / 100);
                 } else {
                     $mixAmountArray[] = array(self::GenerateFromArray($objFundArray)->Id, rand(1000, 150000) / 100);
                 }
                 if (!rand(0, 20)) {
                     $mixAmountArray[] = array(self::GenerateFromArray($objFundArray)->Id, rand(1000, 150000) / 100);
                 }
                 $objContribution = StewardshipContribution::Create($objBatch->CreatedByLogin, $objHouseholdParticipant->Person, $objStack, StewardshipContributionType::Check, rand(1000, 9999), $mixAmountArray, self::GenerateDateTime($dttStart, $dttEnd), null, null, null, false);
                 if (rand(0, 5)) {
                     $objContribution->SaveImageFile(__DEVTOOLS_CLI__ . '/datagen_file_assets/check.tif');
                 }
             }
             $objStack->RefreshActualTotalAmount();
         }
         if ($intCheckCount != $objBatch->CountStewardshipContributions()) {
             print "\r\n" . 'MISCOUNT: ' . $objBatch->Id . "\r\n";
         }
         $objBatch->RefreshActualTotalAmount();
         $dttDate->Day += 7;
         print str_repeat(chr(8) . ' ' . chr(8), strlen($strDate));
     }
     print "Done.\r\n";
 }
Exemplo n.º 3
0
Arquivo: index.php Projeto: alcf/chms
 public function dtgFunds_Bind()
 {
     $objCondition = QQ::All();
     if (!is_null($blnOption = $this->lstActiveFlag->SelectedValue)) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::StewardshipFund()->ActiveFlag, $blnOption));
     }
     if (!is_null($blnOption = $this->lstExternalFlag->SelectedValue)) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::StewardshipFund()->ExternalFlag, $blnOption));
     }
     $this->dtgFunds->MetaDataBinder($objCondition);
 }
Exemplo n.º 4
0
Arquivo: index.php Projeto: alcf/chms
 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'));
 }
Exemplo n.º 5
0
 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);
 }
 protected function SetupPanel()
 {
     // /stewardship/batch.php/950#1/edit_contribution/UrlHash/UrlHash2/UrlHash3
     // 950 = BatchId
     // #1 = StackNumber
     // UrlHash can be "New" for new manual entry, an Id # for a ContributionId, or 0 for "Check" entyr
     // UrlHash2 must be the check hash (if applicable)
     // Urlhash3 is a PersonId to automagically select
     $this->blnScanFlag = false;
     // Creating New?
     if ($this->strUrlHashArgument == 'new') {
         // Creating New... Again?
         if ($this->strUrlHashArgument2 == 'again') {
             return $this->ReturnTo(sprintf('#%s/edit_contribution/new', $this->objStack->StackNumber));
         }
         $objContribution = new StewardshipContribution();
         $objContribution->StewardshipBatch = $this->objBatch;
         $objContribution->StewardshipStack = $this->objStack;
         $objContribution->DateEntered = QDateTime::Now();
         $objContribution->CreatedByLogin = QApplication::$Login;
         $objContribution->UnpostedFlag = true;
         $objContribution->DateCredited = new QDateTime($this->objBatch->DateCredited);
         $objContribution->StewardshipContributionTypeId = StewardshipContributionType::Cash;
         // Editing an existing
     } else {
         if ($this->strUrlHashArgument) {
             $objContribution = StewardshipContribution::Load($this->strUrlHashArgument);
             if (!$objContribution || $objContribution->StewardshipStackId != $this->objStack->Id || $objContribution->StewardshipBatchId != $this->objBatch->Id) {
                 $this->ReturnTo('#' . $this->objStack->StackNumber);
             }
             // Scanning?
         } else {
             if ($this->strUrlHashArgument2) {
                 $objContribution = StewardshipContribution::CreateFromCheckImage(QApplication::$Login, $this->objStack, $this->strUrlHashArgument2);
                 $this->blnScanFlag = true;
                 $this->imgCheckImage = new TiffImageControl($this);
                 $this->imgCheckImage->ImagePath = $objContribution->TempPath;
                 $this->imgCheckImage->Width = '390';
                 // Error -- go back
             } else {
                 $this->ReturnTo('#' . $this->objStack->StackNumber);
             }
         }
     }
     // Auto-set a new person (if specified)
     if ($objPerson = Person::Load($this->strUrlHashArgument3)) {
         $objContribution->Person = $objPerson;
     }
     // Setup Fields
     $this->mctContribution = new StewardshipContributionMetaControl($this, $objContribution);
     $this->chkNonDeductibleFlag = $this->mctContribution->chkNonDeductibleFlag_Create();
     $this->chkNonDeductibleFlag->Name = 'Non-Deductibile?';
     $this->chkNonDeductibleFlag->Text = 'Check if contribution is <strong>NOT</strong> deductible';
     $this->chkNonDeductibleFlag->HtmlEntities = false;
     if (!$this->blnScanFlag) {
         $this->lstStewardshipContributionType = $this->mctContribution->lstStewardshipContributionType_Create();
         $this->lstStewardshipContributionType->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'lstStewardshipContributionType_Change'));
         $this->txtAuthorization = $this->mctContribution->txtAuthorizationNumber_Create();
         $this->txtCheckNumber = $this->mctContribution->txtCheckNumber_Create();
         $this->txtCheckNumber->AddAction(new QEnterKeyEvent(), new QTerminateAction());
         $this->txtAlternateSource = $this->mctContribution->txtAlternateSource_Create();
         $this->lstStewardshipContributionType_Change();
     } else {
         // If we're scanning, then make sure we allow selecti onof Check or ReturnedCheck
         $this->lstStewardshipContributionType = $this->mctContribution->lstStewardshipContributionType_Create();
         $intIndex = 0;
         while ($intIndex < count($this->lstStewardshipContributionType->GetAllItems())) {
             $objListItem = $this->lstStewardshipContributionType->GetItem($intIndex);
             if ($objListItem->Value == StewardshipContributionType::Check || $objListItem->Value == StewardshipContributionType::ReturnedCheck) {
                 $intIndex++;
             } else {
                 $this->lstStewardshipContributionType->RemoveItem($intIndex);
             }
         }
         $this->txtCheckNumber = $this->mctContribution->txtCheckNumber_Create();
         $this->txtCheckNumber->AddAction(new QEnterKeyEvent(), new QTerminateAction());
         $this->txtCheckNumber->Select();
     }
     // Setup Total Amount
     $this->lblTotalAmount = new QLabel($this);
     $this->lblTotalAmount->HtmlEntities = false;
     // Setup Error Panels
     $this->pnlFundingError = new QPanel($this);
     $this->pnlFundingError->Visible = false;
     $this->pnlFundingError->CssClass = 'errorMessage';
     $this->pnlPersonError = new QPanel($this);
     $this->pnlPersonError->Visible = false;
     $this->pnlPersonError->CssClass = 'errorMessage';
     // Setup AmountArray
     $this->mctAmountArray = array();
     $objAmountArray = $this->mctContribution->StewardshipContribution->GetStewardshipContributionAmountArray(QQ::OrderBy(QQN::StewardshipContributionAmount()->Id));
     for ($i = 0; $i < 5; $i++) {
         if (array_key_exists($i, $objAmountArray)) {
             $objAmount = $objAmountArray[$i];
         } else {
             $objAmount = new StewardshipContributionAmount();
         }
         $mctAmount = new StewardshipContributionAmountMetaControl($this, $objAmount);
         $this->mctAmountArray[] = $mctAmount;
         if ($mctAmount->EditMode) {
             $lstFund = $mctAmount->lstStewardshipFund_Create(null, QQ::All(), QQ::OrderBy(QQN::StewardshipFund()->Name));
         } else {
             $lstFund = $mctAmount->lstStewardshipFund_Create(null, QQ::Equal(QQN::StewardshipFund()->ActiveFlag, true), QQ::OrderBy(QQN::StewardshipFund()->Name));
         }
         $lstFund->Required = false;
         $lstFund->ActionParameter = $i;
         $txtAmount = $mctAmount->txtAmount_Create();
         $txtAmount->ActionParameter = $i;
         $txtAmount->Text = sprintf('%.2f', $txtAmount->Text, 2);
         $lstFund->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'lstFund_Change'));
         $this->lstFund_Change(null, null, $i);
         $txtAmount->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'lblTotalAmount_Refresh'));
         $txtAmount->AddAction(new QEnterKeyEvent(), new QAjaxControlAction($this, 'txtAmount_Enter'));
         $txtAmount->AddAction(new QEnterKeyEvent(), new QTerminateAction());
         $this->lblTotalAmount_Refresh(null, null, null);
     }
     // Setup ChangePerson Dialog stuff
     $this->dlgChangePerson = new StewardshipSelectPersonDialogBox($this, null, $objContribution, $this, 'dlgChangePerson_Select');
     $this->btnChangePerson = new QButton($this);
     $this->btnChangePerson->Text = 'Change';
     $this->btnChangePerson->CssClass = 'primary';
     $this->btnChangePerson->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnChangePerson_Click'));
     if ($this->blnScanFlag) {
         $this->ProcessNewCheck();
         $this->btnSaveAndScanAgain = new QButton($this);
         $this->btnSaveAndScanAgain->CausesValidation = true;
         $this->btnSaveAndScanAgain->Text = 'Save and Scan Next Check';
         $this->btnSaveAndScanAgain->CssClass = 'primary';
         $this->btnSaveAndScanAgain->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
     } else {
         if (!$this->mctContribution->EditMode) {
             if (!$this->mctContribution->StewardshipContribution->Person) {
                 $this->btnChangePerson_Click(null, null, null);
                 $this->dlgChangePerson->dtgPeople->NoDataHtml = '<div class="section sectionBatchInfo"><strong>Search For Individual</strong><br/><br/>' . 'Use above fields to find the individual for this new entry.</div>';
             } else {
                 $this->mctAmountArray[0]->StewardshipFundIdControl->Focus();
             }
             $this->btnSaveAndScanAgain = new QButton($this);
             $this->btnSaveAndScanAgain->CausesValidation = true;
             $this->btnSaveAndScanAgain->Text = 'Save and Enter Next Entry';
             $this->btnSaveAndScanAgain->ActionParameter = 'new';
             $this->btnSaveAndScanAgain->CssClass = 'primary';
             $this->btnSaveAndScanAgain->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
         }
     }
     if (!$this->mctContribution->EditMode) {
         $this->LoadSelectedFundsFromSession();
     } else {
         $this->btnSave->Text = 'Update';
     }
 }
Exemplo n.º 7
0
Arquivo: edit.php Projeto: alcf/chms
 protected function Form_Create()
 {
     $this->lblHeading = new QLabel($this);
     if (QApplication::PathInfo(0)) {
         $objSignupForm = SignupForm::Load(QApplication::PathInfo(0));
         if (!$objSignupForm) {
             QApplication::Redirect('/events/');
         }
         if (!$objSignupForm->Ministry->IsLoginCanAdminMinistry(QApplication::$Login)) {
             QApplication::Redirect('/events/');
         }
         $this->strPageTitle .= 'Edit Form';
         $this->lblHeading->Text = 'Edit ' . $objSignupForm->Type . ' Form';
         switch ($objSignupForm->SignupFormTypeId) {
             case SignupFormType::Event:
                 $objChild = $objSignupForm->EventSignupForm;
                 break;
             case SignupFormType::Course:
                 $objChild = $objSignupForm->ClassMeeting;
                 break;
             default:
                 throw new Exception('Invalid SignupFormTypeId: ' . $objSignupForm->SignupFormTypeId);
         }
     } else {
         if (!QApplication::PathInfo(1)) {
             QApplication::Redirect('/events/');
         }
         $objSignupForm = new SignupForm();
         $objSignupForm->SignupFormTypeId = QApplication::PathInfo(1);
         $objSignupForm->DateCreated = QDateTime::Now();
         $objSignupForm->ActiveFlag = true;
         $this->strPageTitle .= 'Create New Form';
         $this->lblHeading->Text = 'Create New ' . $objSignupForm->Type . ' Form';
         switch ($objSignupForm->SignupFormTypeId) {
             case SignupFormType::Event:
                 $objChild = new EventSignupForm();
                 break;
             case SignupFormType::Course:
                 $objChild = new ClassMeeting();
                 break;
             default:
                 throw new Exception('Invalid SignupFormTypeId: ' . $objSignupForm->SignupFormTypeId);
         }
     }
     // Setup MCTs for Signup and Child
     $this->mctSignupForm = new SignupFormMetaControl($this, $objSignupForm);
     switch ($objSignupForm->SignupFormTypeId) {
         case SignupFormType::Event:
             $this->mctSignupChild = new EventSignupFormMetaControl($this, $objChild);
             break;
         case SignupFormType::Course:
             $this->mctSignupChild = new ClassMeetingMetaControl($this, $objChild);
             break;
         default:
             throw new Exception('Invalid SignupFormTypeId: ' . $objSignupForm->SignupFormTypeId);
     }
     $this->txtName = $this->mctSignupForm->txtName_Create();
     $this->txtName->Select();
     $this->txtName->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->txtName->Required = true;
     $this->txtDescription = $this->mctSignupForm->txtDescription_Create();
     $this->txtInformationUrl = $this->mctSignupForm->txtInformationUrl_Create();
     $this->chkAllowMultipleFlag = $this->mctSignupForm->chkAllowMultipleFlag_Create();
     $this->chkAllowMultipleFlag->Name = 'Allow Multiple Registrations?';
     $this->chkAllowMultipleFlag->Text = 'Check if people are allowed to be registered multiple times.';
     $this->chkAllowOtherFlag = $this->mctSignupForm->chkAllowOtherFlag_Create();
     $this->chkAllowOtherFlag->Name = 'Allow Registering for Others?';
     $this->chkAllowOtherFlag->Text = 'Check if people are allowed to register on behalf of someone else.';
     $this->chkAllowOtherFlag->Visible = false;
     $this->chkActiveFlag = $this->mctSignupForm->chkActiveFlag_Create();
     $this->chkActiveFlag->Name = 'Active?';
     $this->chkActiveFlag->Text = 'Check if this is an "Active" form.';
     $this->txtToken = $this->mctSignupForm->txtToken_Create();
     $this->txtToken->Name = 'Custom Signup Web Address';
     $this->txtToken->HtmlBefore = '<span>https://my.alcf.net/signup/event.php / </span>';
     $this->chkConfidentialFlag = $this->mctSignupForm->chkConfidentialFlag_Create();
     $this->chkConfidentialFlag->Name = 'Confidential?';
     $this->chkConfidentialFlag->Text = 'Check if this form is considered a "Confidential" form.';
     $this->chkNoLoginSupportFlag = $this->mctSignupForm->chkLoginNotRequiredFlag_Create();
     $this->chkNoLoginSupportFlag->Name = 'Support No Login?';
     $this->chkNoLoginSupportFlag->Text = 'Check if you would like to allow users to signup without having to log in.';
     $this->txtFundingAccount = $this->mctSignupForm->txtFundingAccount_Create();
     if ($this->mctSignupForm->SignupForm->CountFormProducts()) {
         $this->txtFundingAccount->Required = true;
     }
     $this->lstDonationStewardshipFund = $this->mctSignupForm->lstDonationStewardshipFund_Create(null, QQ::Equal(QQN::StewardshipFund()->ActiveFlag, true), QQ::OrderBy(QQN::StewardshipFund()->Name));
     $this->lstDonationStewardshipFund->Name = 'Funding Account for Donations';
     if ($this->mctSignupForm->SignupForm->IsDonationAccepted()) {
         $this->lstDonationStewardshipFund->Required = true;
     }
     // Setup Ministry with Rules
     if (QApplication::$Login->RoleTypeId == RoleType::ChMSAdministrator) {
         $this->lstMinistry = $this->mctSignupForm->lstMinistry_Create(null, null, QQ::OrderBy(QQN::Ministry()->Name));
     } else {
         $intMinistryIdArray = array();
         foreach (QApplication::$Login->GetMinistryArray() as $objMinistry) {
             $intMinistryIdArray[] = $objMinistry->Id;
         }
         $this->lstMinistry = $this->mctSignupForm->lstMinistry_Create(null, QQ::In(QQN::Ministry()->Id, $intMinistryIdArray), QQ::OrderBy(QQN::Ministry()->Name));
     }
     if ($this->mctSignupForm->EditMode) {
         $this->lstMinistry->Enabled = false;
     }
     // Communciation
     $this->txtSupportEmail = $this->mctSignupForm->txtSupportEmail_Create();
     $this->txtEmailNotification = $this->mctSignupForm->txtEmailNotification_Create();
     // Setup Limit
     $this->txtSignupLimit = $this->mctSignupForm->txtSignupLimit_Create();
     $this->txtSignupLimit->Minimum = 0;
     // TODO: Implement Gender-Specific Limits
     $this->txtSignupMaleLimit = $this->mctSignupForm->txtSignupMaleLimit_Create();
     $this->txtSignupMaleLimit->Visible = false;
     $this->txtSignupMaleLimit->Minimum = 0;
     $this->txtSignupFemaleLimit = $this->mctSignupForm->txtSignupFemaleLimit_Create();
     $this->txtSignupFemaleLimit->Minimum = 0;
     $this->txtSignupFemaleLimit->Visible = false;
     // Setup Controls for Child
     switch ($objSignupForm->SignupFormTypeId) {
         case SignupFormType::Event:
             $this->dtxDateStart = $this->mctSignupChild->dtxDateStart_Create();
             $this->calDateStart = $this->mctSignupChild->calDateStart_Create();
             $this->dtxDateEnd = $this->mctSignupChild->dtxDateEnd_Create();
             $this->calDateEnd = $this->mctSignupChild->calDateEnd_Create();
             $this->txtLocation = $this->mctSignupChild->txtLocation_Create();
             break;
         case SignupFormType::Course:
             $this->lstClassTerm = $this->mctSignupChild->lstClassTerm_Create(null, QQ::OrCondition(QQ::Equal(QQN::ClassTerm()->ActiveFlag, true), QQ::Equal(QQN::ClassTerm()->Id, $this->mctSignupChild->ClassMeeting->ClassTermId)));
             $this->lstClassCourse = $this->mctSignupChild->lstClassCourse_Create(null, null, QQ::OrderBy(QQN::ClassCourse()->Code));
             $this->lstClassInstructor = $this->mctSignupChild->lstClassInstructor_Create(null, null, QQ::OrderBy(QQN::ClassInstructor()->DisplayName));
             $this->calDateStart = $this->mctSignupChild->calDateStart_Create();
             $this->calDateEnd = $this->mctSignupChild->calDateEnd_Create();
             $this->txtLocation = $this->mctSignupChild->txtLocation_Create();
             $this->lstMeetingDay = $this->mctSignupChild->lstMeetingDay_Create();
             $this->lstMeetingStartTime = $this->mctSignupChild->lstMeetingStartTime_Create();
             $this->lstMeetingEndTime = $this->mctSignupChild->lstMeetingEndTime_Create();
             // Make some upates to the default fields
             $this->txtName->Enabled = false;
             $this->lstClassCourse->AddAction(new QChangeEvent(), new QAjaxAction('lstClassCourse_Change'));
             break;
         default:
             throw new Exception('Invalid SignupFormTypeId: ' . $objSignupForm->SignupFormTypeId);
     }
     // Buttons
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = 'Save';
     $this->btnSave->CssClass = 'primary';
     $this->btnSave->CausesValidation = true;
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->CssClass = 'cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     // Delete?
     if ($this->mctSignupForm->EditMode) {
         $this->btnDelete = new QLinkButton($this);
         $this->btnDelete->Text = 'Delete';
         $this->btnDelete->CssClass = 'delete';
         if ($this->mctSignupForm->SignupForm->CountSignupEntries()) {
             $this->btnDelete->AddAction(new QClickEvent(), new QAlertAction('This signup form already has signup entries and therefore cannot be deleted.  An alternative option would be to simply mark this form as "Inactive".'));
             $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
         } else {
             $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to DELETE this Signup Form?  This cannot be undone.'));
             $this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click'));
             $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
         }
     }
 }
Exemplo n.º 8
0
 /**
  * Count StewardshipFunds
  * by ExternalFlag Index(es)
  * @param boolean $blnExternalFlag
  * @return int
  */
 public static function CountByExternalFlag($blnExternalFlag, $objOptionalClauses = null)
 {
     // Call StewardshipFund::QueryCount to perform the CountByExternalFlag query
     return StewardshipFund::QueryCount(QQ::Equal(QQN::StewardshipFund()->ExternalFlag, $blnExternalFlag), $objOptionalClauses);
 }
 /**
  * Used internally by the Meta-based Add Column tools.
  *
  * Given a QQNode or a Text String, this will return a StewardshipFund-based QQNode.
  * It will also verify that it is a proper StewardshipFund-based QQNode, and will throw an exception otherwise.
  *
  * @param mixed $mixContent
  * @return QQNode
  */
 protected function ResolveContentItem($mixContent)
 {
     if ($mixContent instanceof QQNode) {
         if (!$mixContent->_ParentNode) {
             throw new QCallerException('Content QQNode cannot be a Top Level Node');
         }
         if ($mixContent->_RootTableName == 'stewardship_fund') {
             if ($mixContent instanceof QQReverseReferenceNode && !$mixContent->_PropertyName) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             }
             $objCurrentNode = $mixContent;
             while ($objCurrentNode = $objCurrentNode->_ParentNode) {
                 if (!$objCurrentNode instanceof QQNode) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
                 if ($objCurrentNode instanceof QQReverseReferenceNode && !$objCurrentNode->_PropertyName) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
             }
             return $mixContent;
         } else {
             throw new QCallerException('Content QQNode has a root table of "' . $mixContent->_RootTableName . '". Must be a root of "stewardship_fund".');
         }
     } else {
         if (is_string($mixContent)) {
             switch ($mixContent) {
                 case 'Id':
                     return QQN::StewardshipFund()->Id;
                 case 'MinistryId':
                     return QQN::StewardshipFund()->MinistryId;
                 case 'Ministry':
                     return QQN::StewardshipFund()->Ministry;
                 case 'Name':
                     return QQN::StewardshipFund()->Name;
                 case 'ExternalName':
                     return QQN::StewardshipFund()->ExternalName;
                 case 'AccountNumber':
                     return QQN::StewardshipFund()->AccountNumber;
                 case 'FundNumber':
                     return QQN::StewardshipFund()->FundNumber;
                 case 'ActiveFlag':
                     return QQN::StewardshipFund()->ActiveFlag;
                 case 'ExternalFlag':
                     return QQN::StewardshipFund()->ExternalFlag;
                 default:
                     throw new QCallerException('Simple Property not found in StewardshipFundDataGrid content: ' . $mixContent);
             }
         } else {
             if ($mixContent instanceof QQAssociationNode) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             } else {
                 throw new QCallerException('Invalid Content type');
             }
         }
     }
 }
Exemplo n.º 10
0
Arquivo: index.php Projeto: alcf/chms
 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'));
 }
Exemplo n.º 11
0
Arquivo: batch.php Projeto: alcf/chms
 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();
 }
Exemplo n.º 12
0
 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());
     }
 }