protected function Form_Create() { // Attempt to load by Token and then by ID $this->objSignupForm = SignupForm::LoadByToken(QApplication::PathInfo(0)); if (!$this->objSignupForm) { $this->objSignupForm = SignupForm::Load(QApplication::PathInfo(0)); } // Ensure it is the correct type and it exists if (!$this->objSignupForm) { $this->strHtmlIncludeFilePath = '_notfound.tpl.php'; return; } $this->strPageTitle = $this->objSignupForm->Name . ' - Confirmation'; // Ensure it is Active if (!$this->objSignupForm->ActiveFlag) { $this->strHtmlIncludeFilePath = '_notactive.tpl.php'; return; } // Get the SignupEntry $this->objSignupEntry = SignupEntry::Load(QApplication::PathInfo(1)); // Ensure it is correct for the form and the signup person if ($this->objSignupEntry->SignupByPersonId) { if (!$this->objSignupEntry || $this->objSignupEntry->SignupFormId != $this->objSignupForm->Id || $this->objSignupEntry->SignupByPersonId != QApplication::$PublicLogin->PersonId || $this->objSignupEntry->SignupEntryStatusTypeId != SignupEntryStatusType::Complete) { $this->strHtmlIncludeFilePath = '_notfound.tpl.php'; return; } } else { if (!$this->objSignupEntry || $this->objSignupEntry->SignupFormId != $this->objSignupForm->Id || !$this->objSignupEntry->CommunicationsEntryId || $this->objSignupEntry->SignupEntryStatusTypeId != SignupEntryStatusType::Complete) { $this->strHtmlIncludeFilePath = '_notfound.tpl.php'; return; } } }
protected function Form_Create() { if (!QApplication::$Login) { QApplication::Redirect('/'); } $this->objQcodoClass = QcodoClass::Load(QApplication::PathInfo(0)); if (!$this->objQcodoClass) { throw new Exception('Invalid QcodoClass Id: ' . QApplication::PathInfo(0)); } $this->lblName = new QLabel($this); $this->lblName->Text = $this->objQcodoClass->Name; $this->lstClassGroup = new QListBox($this); $this->lstClassGroup->Name = 'Class Group/Classification'; foreach (ClassGroup::LoadAll(QQ::Clause(QQ::OrderBy(QQN::ClassGroup()->OrderNumber))) as $objClassGroup) { $this->lstClassGroup->AddItem($objClassGroup->Name, $objClassGroup->Id, $objClassGroup->Id == $this->objQcodoClass->ClassGroupId); } $this->chkEnumerationFlag = new QCheckBox($this); $this->chkEnumerationFlag->Checked = $this->objQcodoClass->EnumerationFlag; $this->chkEnumerationFlag->Name = 'Enumeration Class Flag'; $this->txtShortDescription = new QTextBox($this); $this->txtShortDescription->Name = QApplication::Translate('Short Description'); $this->txtShortDescription->Text = $this->objQcodoClass->ShortDescription; $this->txtShortDescription->TextMode = QTextMode::MultiLine; $this->txtExtendedDescription = new QWriteBox($this); $this->txtExtendedDescription->Name = QApplication::Translate('Extended Description'); $this->txtExtendedDescription->Text = $this->objQcodoClass->ExtendedDescription; $this->btnSave = new QButton($this); $this->btnSave->Text = 'Save'; $this->btnSave->AddAction(new QClickEvent(), new QServerAction('btnSave_Click')); $this->btnSave->CausesValidation = true; $this->btnCancel = new QButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QServerAction('btnCancel_Click')); $this->btnCancel->CausesValidation = false; }
protected function Form_Create() { // Setup Household Object $this->objHousehold = Household::Load(QApplication::PathInfo(0)); if (!$this->objHousehold) { QApplication::Redirect('/households/'); } $this->strPageTitle .= $this->objHousehold->Name; // Setup DataGrids $this->dtgMembers = new HouseholdParticipationDataGrid($this); $this->dtgMembers->AddColumn(new QDataGridColumn('Remove', '<?= $_FORM->RenderRadio($_ITEM); ?>', 'Width=80px', 'HtmlEntities=false')); $this->dtgMembers->MetaAddColumn('Role', 'Width=80px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->FirstName, 'Name=Name', 'Html=<?= $_ITEM->Person->LinkHtml; ?>', 'HtmlEntities=false', 'Width=300px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryEmail->Address, 'Name=Email', 'Width=250px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryPhone->Number, 'Name=Phone', 'Width=200px'); $this->dtgMembers->GetColumn(0)->OrderByClause = null; $this->dtgMembers->GetColumn(1)->OrderByClause = null; $this->dtgMembers->GetColumn(2)->OrderByClause = null; $this->dtgMembers->GetColumn(3)->OrderByClause = null; $this->dtgMembers->GetColumn(4)->OrderByClause = null; $this->dtgMembers->DataSource = $this->objHousehold->GetOrderedParticipantArray(); $this->btnSave = new QButton($this); $this->btnSave->Text = 'Remove'; $this->btnSave->CssClass = 'primary'; $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click')); $this->btnSave->CausesValidation = true; $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->CssClass = 'cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); $this->dlgMessage = new MessageDialog($this); }
protected function Form_Create() { $this->lblLabel = new QLabel($this); $this->lblLabel->Text = "Members who left after "; $this->dtxBeforeValue = new QDateTimeTextBox($this); $this->dtxBeforeValue->Name = "Members who Exited Before:"; $this->dtxBeforeValue->Required = true; $this->beforeCalValue = new QCalendar($this, $this->dtxBeforeValue); $this->dtxBeforeValue->RemoveAllActions(QClickEvent::EventName); $this->dtxBeforeValue->AddAction(new QChangeEvent(), new QAjaxAction('dtxDate_Change')); $this->dtxBeforeValue->Text = QApplication::PathInfo(1); $this->dtxAfterValue = new QDateTimeTextBox($this); $this->dtxAfterValue->Name = "Members who exited After:"; $this->dtxAfterValue->Required = true; $this->afterCalValue = new QCalendar($this, $this->dtxAfterValue); $this->dtxAfterValue->RemoveAllActions(QClickEvent::EventName); $this->dtxAfterValue->AddAction(new QChangeEvent(), new QAjaxAction('dtxDate_Change')); $this->dtxAfterValue->Text = QApplication::PathInfo(0); $this->dtgExitingMembers = new QDataGrid($this); $this->dtgExitingMembers->AddColumn(new QDataGridColumn('Name', '<?= $_ITEM->Person->FullName; ?>', 'Width=270px')); $this->dtgExitingMembers->AddColumn(new QDataGridColumn('Membership End Date', '<?= $_ITEM->DateEnd; ?>', 'Width=270px')); $this->dtgExitingMembers->AddColumn(new QDataGridColumn('Termination Reason', '<?= $_ITEM->TerminationReason; ?>', 'Width=270px')); $dtAfterValue = new QDateTime($this->dtxAfterValue->Text); $dtBeforeValue = new QDateTime($this->dtxBeforeValue->Text); $objMembershipArray = Membership::LoadArrayByEndDateRange($dtAfterValue, $dtBeforeValue); $this->iTotalCount = count($objMembershipArray); $this->dtgExitingMembers->DataSource = $objMembershipArray; }
protected function Form_Create() { $this->dtxBeforeValue = new QDateTimeTextBox($this); $this->dtxBeforeValue->Required = true; $this->beforeCalValue = new QCalendar($this, $this->dtxBeforeValue); $this->dtxBeforeValue->RemoveAllActions(QClickEvent::EventName); $this->dtxBeforeValue->AddAction(new QChangeEvent(), new QAjaxAction('dtxDate_Change')); $this->dtxBeforeValue->Text = QApplication::PathInfo(1); $this->dtxAfterValue = new QDateTimeTextBox($this); $this->dtxAfterValue->Required = true; $this->afterCalValue = new QCalendar($this, $this->dtxAfterValue); $this->dtxAfterValue->RemoveAllActions(QClickEvent::EventName); $this->dtxAfterValue->AddAction(new QChangeEvent(), new QAjaxAction('dtxDate_Change')); $this->dtxAfterValue->Text = QApplication::PathInfo(0); $this->dtgPerson = new PersonDataGrid($this); $objPaginator = new QPaginator($this->dtgPerson); $this->dtgPerson->Paginator = $objPaginator; $this->dtgPerson->ItemsPerPage = 20; $this->dtgPerson->AddColumn(new QDataGridColumn('Name', '<?= $_ITEM->FullName; ?>', 'Width=270px')); $this->dtgPerson->MetaAddTypeColumn('MembershipStatusTypeId', 'MembershipStatusType', 'Name=Membership', 'Width=110px', 'FontSize=11px'); $this->dtgPerson->AddColumn(new QDataGridColumn('Comments', '<?= $_FORM->RenderComments($_ITEM) ?>', 'HtmlEntities=false', 'Width=270px')); $this->dtgPerson->AddColumn(new QDataGridColumn('Date Posted', '<?= $_FORM->RenderDate($_ITEM) ?>', 'HtmlEntities=false', 'Width=270px')); $this->dtgPerson->AddColumn(new QDataGridColumn('Privacy Level', '<?= $_FORM->RenderPrivacy($_ITEM) ?>', 'HtmlEntities=false', 'Width=100px')); $dtAfterValue = new QDateTime($this->dtxAfterValue->Text); $dtBeforeValue = new QDateTime($this->dtxBeforeValue->Text); $this->dtgPerson->SetDataBinder('dtgPerson_Bind'); }
protected function Form_Create() { $this->objLocation = GrowthGroupLocation::Load(QApplication::PathInfo(0)); if (!$this->objLocation) { $this->objLocation = GrowthGroupLocation::Load(2); } $this->dtrGrowthGroups = new QDataRepeater($this, 'dtrgg'); $this->dtrGrowthGroups->Template = dirname(__FILE__) . '/dtrGrowthGroups.tpl.php'; $this->dtrGrowthGroups->SetDataBinder('dtrGrowthGroups_Bind'); $this->pnlNone = new QPanel($this, 'pnlnone'); $this->pnlNone->Text = 'No results found. Please use a less restrictive filter.'; $this->intMarkerArray = array(); $intMarkerNumber = 0; // Filter Out "inactive" groups //foreach ($this->objLocation->GetGrowthGroupArray(QQ::Equal(QQN::GrowthGroup()->Group->ActiveFlag, true), //QQ::Clause(QQ::OrderBy(QQN::GrowthGroup()->Group->Name))) as $objGroup) { foreach ($this->objLocation->GetGrowthGroupArray(QQ::OrderBy(QQN::GrowthGroup()->Group->Name)) as $objGroup) { if ($objGroup->Group->ActiveFlag == true) { $intMarkerNumber++; $this->intMarkerArray[$objGroup->GroupId] = $intMarkerNumber; } } $this->lstDays = new QListBox($this); $this->lstDays->AddItem('- View All Days -', null); $this->lstDays->AddAction(new QChangeEvent(), new QAjaxAction('dtrGrowthGroups_Bind')); foreach (GrowthGroupDayType::$NameArray as $intId => $strName) { $this->lstDays->AddItem($strName, $intId); } $this->lstTypes = new QListBox($this); $this->lstTypes->AddItem('- View All Types -', null); $this->lstTypes->AddAction(new QChangeEvent(), new QAjaxAction('dtrGrowthGroups_Bind')); foreach (GrowthGroupStructure::LoadAll(QQ::OrderBy(QQN::GrowthGroupStructure()->Name)) as $objStructure) { $this->lstTypes->AddItem($objStructure->Name, $objStructure->Id); } }
protected function Form_Create() { switch (QApplication::PathInfo(0)) { case 'funds': $this->dtgReport = new QDataGrid($this); $this->dtgReport->AddColumn(new QDataGridColumn('Fund', '<?= $_ITEM->StewardshipFund->Name; ?>', 'Width=300px')); $this->dtgReport->AddColumn(new QDataGridColumn('Account Number', '<?= $_ITEM->StewardshipFund->AccountNumber; ?>', 'Width=200px')); $this->dtgReport->AddColumn(new QDataGridColumn('Amount', '<?= QApplication::DisplayCurrencyHtml($_ITEM->Amount); ?>', 'HtmlEntities=false', 'Width=245px')); $this->dtgReport->NoDataHtml = 'Changes only to members credited. (No changes to funding accounts or amounts)'; $this->dtgReport->SetDataBinder('dtgReport_Funds_Bind'); break; case 'line_items': $this->dtgReport = new QDataGrid($this); $this->dtgReport->AddColumn(new QDataGridColumn('Person', '<?= $_ITEM->Person->Name; ?>', 'Width=200px')); $this->dtgReport->AddColumn(new QDataGridColumn('Fund', '<?= $_ITEM->StewardshipFund->Name; ?>', 'Width=200px')); $this->dtgReport->AddColumn(new QDataGridColumn('Description', '<?= $_ITEM->Description; ?>', 'Width=200px')); $this->dtgReport->AddColumn(new QDataGridColumn('Amount', '<?= QApplication::DisplayCurrencyHtml($_ITEM->Amount); ?>', 'HtmlEntities=false', 'Width=130px')); $this->dtgReport->SetDataBinder('dtgReport_LineItems_Bind'); break; default: QApplication::Redirect('/stewardship/'); break; } $this->objBatch = StewardshipBatch::Load(QApplication::PathInfo(1)); if (!$this->objBatch) { QApplication::Redirect('/stewardship/'); } $this->objPost = StewardshipPost::LoadByStewardshipBatchIdPostNumber($this->objBatch->Id, QApplication::PathInfo(2)); if (!$this->objPost) { QApplication::Redirect('/stewardship/'); } }
protected function Form_Create() { $this->strInitialToken = QApplication::PathInfo(0); if ($this->strInitialToken) { $this->objList = CommunicationList::LoadByToken($this->strInitialToken); } $this->chkBtnListArray = array(); foreach (CommunicationList::LoadArrayBySubscribable(true, QQ::OrderBy(QQN::CommunicationList()->Token)) as $objEmailList) { $objItemList = new QCheckBox($this); $objItemList->Name = $objEmailList->Token; $objItemList->Text = $objEmailList->Name . ' - ' . $objEmailList->Description . "\n"; if ($objEmailList->Token == $this->strInitialToken) { $objItemList->Checked = true; } $this->chkBtnListArray[] = $objItemList; } $this->txtEmail = new QTextBox($this); $this->txtEmail->Name = 'Email: '; $this->txtEmail->Visible = true; $this->txtFirstName = new QTextBox($this); $this->txtFirstName->Name = 'First Name: '; $this->txtFirstName->Visible = true; $this->txtLastName = new QTextBox($this); $this->txtLastName->Name = 'Last Name'; $this->txtLastName->Visible = true; $this->btnSubscribe = new QButton($this); $this->btnSubscribe->Name = 'Subscribe'; $this->btnSubscribe->Text = 'Subscribe'; $this->btnSubscribe->CssClass = 'primary'; $this->btnSubscribe->Visible = true; $this->btnSubscribe->AddAction(new QClickEvent(), new QAjaxAction('btnSubscribe_Click')); $this->lblMessage = new QLabel($this); $this->lblMessage->FontBold = true; $this->lblMessage->Visible = false; }
public function dtgItems_Bind() { $intYear = QApplication::PathInfo(0); $dttStart = new QDateTime($intYear . '-01-01'); $dttEnd = new QDateTime($dttStart); $dttEnd->Year += 1; $dttStart->SetTime(null, null, null); $dttEnd->SetTime(null, null, null); $objPersonCursor = Person::QueryCursor(QQ::AndCondition(QQ::GreaterOrEqual(QQN::Person()->StewardshipContribution->DateCredited, $dttStart), QQ::LessThan(QQN::Person()->StewardshipContribution->DateCredited, $dttEnd)), QQ::Clause(QQ::Distinct(), QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName))); $strNameArray = array(); $strNameValueArray = array(); while ($objPerson = Person::InstantiateCursor($objPersonCursor)) { $strToken = strtolower($objPerson->FirstName . '|' . $objPerson->LastName); $strToken = str_replace(' ', '', $strToken); $strToken = str_replace('.', '', $strToken); $strToken = str_replace(',', '', $strToken); $strToken = str_replace('-', '', $strToken); $strToken = str_replace('_', '', $strToken); $strToken = str_replace('/', '', $strToken); if (array_key_exists($strToken, $strNameArray)) { $strNameValueArray[$strToken] = $objPerson->FirstName . ' ' . $objPerson->LastName; } $strNameArray[$strToken] = true; } $this->dtgItems->DataSource = $strNameValueArray; }
protected function Form_Create() { $this->objList = CommunicationList::LoadById(QApplication::PathInfo(0)); if (!$this->objList) { QApplication::Redirect('/communications/'); } $this->strPageTitle .= $this->objList->Name; $this->dtgMembers = new QDataGrid($this); $this->dtgMembers->UseAjax = true; $this->dtgMembers->Paginator = new QPaginator($this->dtgMembers); if ($this->objList->Ministry->IsLoginCanAdminMinistry(QApplication::$Login)) { $this->dtgMembers->AddColumn(new QDataGridColumn('Edit', '<?= $_FORM->RenderEdit($_ITEM); ?>', 'HtmlEntities=false', 'Width=140px', 'FontSize=10px')); } $this->dtgMembers->AddColumn(new QDataGridColumn('First Name', '<?= $_ITEM[0]; ?>', 'Width=150px', 'SortByCommand=0,0', 'ReverseSortByCommand=0,1')); $this->dtgMembers->AddColumn(new QDataGridColumn('Middle', '<?= $_ITEM[1]; ?>', 'Width=80px', 'SortByCommand=1,0', 'ReverseSortByCommand=1,1')); $this->dtgMembers->AddColumn(new QDataGridColumn('Last Name', '<?= $_ITEM[2]; ?>', 'Width=150px', 'SortByCommand=2,0', 'ReverseSortByCommand=2,1')); $this->dtgMembers->AddColumn(new QDataGridColumn('Email', '<a href="mailto:<?= QApplication::HtmlEntities($_ITEM[3]); ?>"><?= QApplication::HtmlEntities($_ITEM[3]); ?></a>', 'HtmlEntities=false', 'Width=290px', 'SortByCommand=3,0', 'ReverseSortByCommand=3,1')); $this->dtgMembers->AddColumn(new QDataGridColumn('Member?', '<?= $_ITEM[6]; ?>', 'Width=75px', 'SortByCommand=6,0', 'ReverseSortByCommand=6,1')); if ($this->objList->Ministry->IsLoginCanAdminMinistry(QApplication::$Login)) { $this->dtgMembers->SortColumnIndex = 3; } else { $this->dtgMembers->SortColumnIndex = 2; } $this->pxyUnsubscribeEntry = new QControlProxy($this); $this->pxyUnsubscribeEntry->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to unsubscribe this person from the list?')); $this->pxyUnsubscribeEntry->AddAction(new QClickEvent(), new QAjaxAction('pxyUnsubscribeEntry_Click')); $this->pxyUnsubscribeEntry->AddAction(new QClickEvent(), new QTerminateAction()); $this->pxyUnsubscribePerson = new QControlProxy($this); $this->pxyUnsubscribePerson->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to unsubscribe this person from the list?')); $this->pxyUnsubscribePerson->AddAction(new QClickEvent(), new QAjaxAction('pxyUnsubscribePerson_Click')); $this->pxyUnsubscribePerson->AddAction(new QClickEvent(), new QTerminateAction()); $this->dtgMembers->SetDataBinder('dtgMembers_Bind'); $this->SetupEmailMessageControls(); }
protected function Form_Create() { $this->objProvisionalPublicLogin = ProvisionalPublicLogin::Load(QApplication::PathInfo(0)); if (!$this->objProvisionalPublicLogin || $this->objProvisionalPublicLogin->UrlHash != QApplication::PathInfo(1)) { QApplication::Redirect('/register/'); } }
protected function Form_Create() { $this->txtUsername = new QTextBox($this); $this->txtUsername->Name = 'Username'; $this->txtUsername->Required = true; $this->txtUsername->Text = QApplication::PathInfo(0); $this->txtCode = new QTextBox($this); $this->txtCode->Name = 'Confirmation Code'; $this->txtCode->Required = true; $this->txtCode->CausesValidation = true; $this->txtCode->Text = QApplication::PathInfo(1); $this->btnConfirm = new QButton($this); $this->btnConfirm->Text = 'Confirm My Email'; $this->btnConfirm->CausesValidation = true; $this->txtUsername->AddAction(new QEnterKeyEvent(), new QFocusControlAction($this->txtCode)); $this->txtUsername->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtCode->AddAction(new QEnterKeyEvent(), new QAjaxAction('btnConfirm_Click')); $this->txtCode->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->btnConfirm->AddAction(new QClickEvent(), new QAjaxAction('btnConfirm_Click')); if (!$this->txtUsername->Text) { $this->txtUsername->Focus(); } else { $this->txtCode->Focus(); } }
protected function Form_Create() { // Setup Household Object $this->objHousehold = Household::Load(QApplication::PathInfo(0)); if (!$this->objHousehold) { QApplication::Redirect('/households/'); } $this->strPageTitle .= $this->objHousehold->Name; // Setup DataGrids $this->dtgMembers = new QDataGrid($this); $this->dtgMembers->AlternateRowStyle->CssClass = 'alternate'; $this->dtgMembers->AddColumn(new QDataGridColumn('Head', '<?= $_FORM->RenderHead($_ITEM); ?>', 'HtmlEntities=false', 'Width=50px')); $this->dtgMembers->AddColumn(new QDataGridColumn('Name', '<?= $_ITEM->Person->Name; ?>', 'Width=250px')); $this->dtgMembers->AddColumn(new QDataGridColumn('Role in Household', '<?= $_FORM->RenderRole($_ITEM); ?>', 'HtmlEntities=false', 'Width=630px')); $this->dtgMembers->SetDataBinder('dtgMembers_Bind'); $this->btnSave = new QButton($this); $this->btnSave->Text = 'Update'; $this->btnSave->CssClass = 'primary'; $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')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); }
protected function Redirect() { $objVariable = ClassVariable::Load(QApplication::PathInfo(0)); if ($objVariable) { QApplication::Redirect('/index.php/' . $this->objVariable->QcodoClass->Name . '/Variables'); } else { QApplication::Redirect('/index.php'); } }
protected function Redirect() { $objConstant = QcodoConstant::Load(QApplication::PathInfo(0)); if ($objConstant) { QApplication::Redirect('/index.php/' . $this->objConstant->QcodoClass->Name . '/Constants'); } else { QApplication::Redirect('/index.php'); } }
protected function Form_Create() { $this->lblMessage = new QLabel($this); $this->lblMessage->Text = 'You have successfully unsubscribed from the ' . urldecode(QApplication::PathInfo(0)) . ' Email List/s'; $this->btnReturnToSubscribe = new QButton($this); $this->btnReturnToSubscribe->Text = 'Subscribe to additional Mailing Lists'; $this->btnReturnToSubscribe->CssClass = 'primary'; $this->btnReturnToSubscribe->CausesValidation = false; $this->btnReturnToSubscribe->AddAction(new QClickEvent(), new QAjaxAction('btnReturnToSubscribe_Click', null, true)); }
public function dtgItems_Bind() { $intYear = QApplication::PathInfo(0); $dttStart = new QDateTime($intYear . '-01-01'); $dttEnd = new QDateTime($dttStart); $dttEnd->Year += 1; $dttStart->SetTime(null, null, null); $dttEnd->SetTime(null, null, null); $this->dtgItems->DataSource = Person::QueryArray(QQ::AndCondition(QQ::GreaterOrEqual(QQN::Person()->StewardshipContribution->DateCredited, $dttStart), QQ::LessThan(QQN::Person()->StewardshipContribution->DateCredited, $dttEnd), QQ::IsNull(QQN::Person()->PrimaryAddressText), QQ::IsNull(QQN::Person()->StewardshipAddressId)), QQ::Clause(QQ::Distinct(), QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName))); }
protected function Form_Create() { $this->objOnlineDonation = OnlineDonation::Load(QApplication::PathInfo(0)); if (!$this->objOnlineDonation) { QApplication::Redirect('/give/'); } if ($this->objOnlineDonation->Hash != QApplication::PathInfo(1)) { QApplication::Redirect('/give/'); } // Create the Short-Circuit Registratino form IF: // The person donating does not yet have a record AND // we still have the email-to-send in Session if (array_key_exists('onlineDonationEmailAddress' . $this->objOnlineDonation->Id, $_SESSION) && !$this->objOnlineDonation->Person->PublicLogin) { $this->txtUsername = new QTextBox($this); $this->txtUsername->Name = 'Username'; $this->txtUsername->Required = true; $this->txtUsername->MaxLength = PublicLogin::UsernameMaxLength; $this->txtPassword = new QTextBox($this); $this->txtPassword->Name = 'Select a Password'; $this->txtPassword->Required = true; $this->txtPassword->TextMode = QTextMode::Password; $this->txtPassword->Instructions = 'At least 6 characters long'; $this->txtConfirmPassword = new QTextBox($this); $this->txtConfirmPassword->Name = 'Confirm Password'; $this->txtConfirmPassword->Instructions = 'Must match above'; $this->txtConfirmPassword->Required = true; $this->txtConfirmPassword->TextMode = QTextMode::Password; $this->lstQuestion = new QListBox($this); $this->lstQuestion->Name = '"Forgot Password" Question'; $this->lstQuestion->AddItem('- Select One -', null); $this->lstQuestion->AddItem('What city were you born in?', 'What city were you born in?'); $this->lstQuestion->AddItem('What is the name of your elementary school?', 'What is the name of your elementary school?'); $this->lstQuestion->AddItem('What street did you grow up on?', 'What street did you grow up on?'); $this->lstQuestion->AddItem('What is the name of your pet?', 'What is the name of your pet?'); $this->lstQuestion->AddItem('What was the make and model of your first car?', 'What was the make and model of your first car?'); $this->lstQuestion->AddItem('- Other... -', false); $this->lstQuestion->Required = true; $this->lstQuestion->AddAction(new QChangeEvent(), new QAjaxAction('lstQuestion_Refresh')); $this->txtQuestion = new QTextBox($this); $this->txtAnswer = new QTextBox($this); $this->txtAnswer->Name = 'Your Answer'; $this->txtAnswer->Required = true; $this->lstQuestion_Refresh(); $this->btnRegister = new QButton($this); $this->btnRegister->Text = 'Register'; $this->btnRegister->CssClass = 'primary'; $this->btnRegister->CausesValidation = true; $this->btnRegister->AddAction(new QClickEvent(), new QAjaxAction('btnRegister_Click')); $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'No Thanks'; $this->btnCancel->CssClass = 'cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QJavaScriptAction('myAlcf.toggleShortCircuitReg(false);')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); } }
protected function Form_Create() { $this->mctAttribute = AttributeMetaControl::Create($this, QApplication::PathInfo(0)); $this->strPageTitle = 'Administration - ' . ($this->mctAttribute->EditMode ? 'Edit' : 'Create New') . ' Attribute'; $this->txtName = $this->mctAttribute->txtName_Create(); $this->txtName->Required = true; $this->lstAttributeDataType = $this->mctAttribute->lstAttributeDataType_Create(); if ($this->mctAttribute->EditMode) { $this->lstAttributeDataType->Enabled = false; } $this->btnSave = new QButton($this); $this->btnSave->Text = $this->mctAttribute->EditMode ? 'Update' : 'Create'; $this->btnSave->CssClass = 'primary'; $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click')); $this->btnSave->CausesValidation = true; $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->CssClass = 'cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); switch ($this->mctAttribute->Attribute->AttributeDataTypeId) { case AttributeDataType::ImmutableMultipleDropdown: case AttributeDataType::ImmutableSingleDropdown: case AttributeDataType::MutableMultipleDropdown: case AttributeDataType::MutableSingleDropdown: $this->pnlAttributeOptions = new QPanel($this); $this->pnlAttributeOptions->AutoRenderChildren = true; $this->btnAddMore = new QLinkButton($this); $this->btnAddMore->Name = ' '; $this->btnAddMore->Text = 'Add More Dropbox Values'; $this->btnAddMore->ForeColor = '#999'; $this->btnAddMore->AddAction(new QClickEvent(), new QAjaxAction('btnAddMore_Click')); $this->btnAddMore->AddAction(new QClickEvent(), new QTerminateAction()); break; } if ($this->mctAttribute->EditMode) { $this->btnDelete = new QLinkButton($this); $this->btnDelete->Text = 'Delete'; $this->btnDelete->CssClass = 'delete'; $intCount = $this->mctAttribute->Attribute->CountAttributeValues(); $strConfirmText = sprintf('Are you SURE you want to permanently DELETE this Attribute? There are %s individual%s that have a value for this attribute which would be removed.', $intCount, $intCount == 1 ? '' : 's'); $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction($strConfirmText)); $this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click')); $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction()); if ($this->pnlAttributeOptions) { foreach ($this->mctAttribute->Attribute->GetAttributeOptionArray(QQ::OrderBy(QQN::AttributeOption()->Name)) as $objAttributeOption) { $this->pnlAttributeOptions_AddOption($objAttributeOption); } } } if ($this->pnlAttributeOptions) { $this->pnlAttributeOptions_AddOption(null); $this->pnlAttributeOptions_AddOption(null); } }
protected function Form_Create() { $objContribution = StewardshipContribution::Load(QApplication::PathInfo(0)); if ($objContribution && is_file($objContribution->Path)) { if ($objContribution) { $this->imgCheckImage = new TiffImageControl($this); $this->imgCheckImage->ImagePath = $objContribution->Path; $this->imgCheckImage->Width = '1000'; } } }
protected function Form_Create() { parent::Form_Create(); // "New" is a special keyword if (($strToken = trim(strtolower(QApplication::PathInfo(0)))) == 'new') { $strToken = null; } $objPackage = Package::LoadByToken($strToken); if (!$objPackage) { $objPackage = new Package(); $this->blnEditMode = false; $this->strPageTitle .= 'Create New'; $this->strHeadline = 'Create a New QPM Package'; } else { if (!$objPackage->IsEditableForPerson(QApplication::$Person)) { QApplication::RedirectToLogin(); } $this->blnEditMode = true; $this->strPageTitle .= 'Edit Package ' . $objPackage->Token; $this->strHeadline = 'Edit Package ' . $objPackage->Token; } $this->mctPackage = new PackageMetaControl($this, $objPackage); $this->txtToken = $this->mctPackage->txtToken_Create(); $this->txtToken->Required = true; $this->lstCategory = $this->mctPackage->lstPackageCategory_Create(); $this->lstCategory->Required = true; // Remove "Issue" for ($intIndex = 0; $intIndex < $this->lstCategory->ItemCount; $intIndex++) { $objListItem = $this->lstCategory->GetItem($intIndex); $objCategory = PackageCategory::Load($objListItem->Value); if ($objCategory && $objCategory->Token == 'issues') { $this->lstCategory->RemoveItem($intIndex); break; } } $this->txtName = $this->mctPackage->txtName_Create(); $this->txtName->Required = true; $this->txtDescription = $this->mctPackage->txtDescription_Create(); $this->txtDescription->Required = true; $this->btnOkay = new QButton($this); $this->btnOkay->CausesValidation = true; $this->btnOkay->Text = $this->blnEditMode ? 'Update Package' : 'Save New Package'; $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnOkay->AddAction(new QClickEvent(), new QToggleEnableAction($this->btnOkay)); $this->btnOkay->AddAction(new QClickEvent(), new QAjaxAction('btnOkay_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); if (!$this->blnEditMode) { $this->txtToken->Focus(); } else { $this->txtName->Focus(); } }
protected function Form_Create() { // Load the MetaControl and Ensure Edit Permissions $this->mctList = CommunicationListMetaControl::Create($this, QApplication::PathInfo(0), QMetaControlCreateType::CreateOnRecordNotFound); if ($this->mctList->EditMode) { if (!$this->mctList->CommunicationList->Ministry->IsLoginCanAdminMinistry(QApplication::$Login)) { $this->RedirectToView(); } } $this->txtName = $this->mctList->txtName_Create(); $this->txtName->Required = true; $this->txtDescription = $this->mctList->txtDescription_Create(); $this->txtDescription->Required = false; $this->txtDescription->TextMode = QTextMode::MultiLine; $this->txtDescription->Height = '50px'; $this->txtToken = $this->mctList->txtToken_Create(); $this->txtToken->Name = 'Email Address'; $this->txtToken->HtmlAfter = '<span> @ groups.alcf.net</span>'; $this->lstType = $this->mctList->lstEmailBroadcastType_Create(); $this->lstType->Instructions = '<span class="help" onclick="displayHelp(\'helpEmailBroadcastType\')"><img src="/assets/images/icons/help.png" alt="help"></span>'; $this->chkSubscribable = $this->mctList->chkSubscribable_Create(); if (QApplication::$Login->RoleTypeId == RoleType::ChMSAdministrator) { $this->lstMinistry = $this->mctList->lstMinistry_Create(null, null, QQ::OrderBy(QQN::Ministry()->Name)); } else { $intMinistryIdArray = array(); foreach (QApplication::$Login->GetMinistryArray() as $objMinistry) { $intMinistryIdArray[] = $objMinistry->Id; } $this->lstMinistry = $this->mctList->lstMinistry_Create(null, QQ::In(QQN::Ministry()->Id, $intMinistryIdArray), QQ::OrderBy(QQN::Ministry()->Name)); } if ($this->mctList->EditMode) { $this->lstMinistry->Enabled = false; } $this->strPageTitle = 'Email List - ' . ($this->mctList->EditMode ? 'Edit' : 'Create New'); $this->btnSave = new QButton($this); $this->btnSave->Text = 'Save'; $this->btnSave->CssClass = 'primary'; $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click')); $this->btnSave->CausesValidation = true; $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->CssClass = 'cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); if ($this->mctList->EditMode) { $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 permanently DELETE this Email List? This will also delete ALL the messages as well!')); $this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click')); $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction()); } }
protected function Form_Create() { // Setup Household Object $this->objHousehold = Household::Load(QApplication::PathInfo(0)); if (!$this->objHousehold) { QApplication::Redirect('/households/'); } $this->strPageTitle .= 'Home Address - ' . $this->objHousehold->Name; $this->pnlContent = new EditHouseholdHomeAddressPanel($this); $this->pnlContent->objDelegate = new EditHomeAddressDelegate($this->pnlContent, '/households/view.php/' . $this->objHousehold->Id, QApplication::PathInfo(1)); $this->pnlContent->btnSave->AddAction(new QClickEvent(), new QShowDialogBox($this->pnlContent->objDelegate->dlgMessage)); $this->pnlContent->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this->pnlContent, 'btnSave_Click')); $this->strPageTitle = ($this->pnlContent->objDelegate->mctAddress->EditMode ? 'Edit' : 'Create New') . ' ' . $this->strPageTitle; }
protected function Form_Create() { $status = QApplication::PathInfo(0); $this->lblStatus = new QLabel($this); if ($status != null && $status == 1) { $this->lblStatus->Text = "Your note was successfully sent."; } else { $this->lblStatus->Text = "Unfortunately we encountered an error and your note was not sent."; } $this->btnReturn = new QButton($this); $this->btnReturn->Text = 'Return to Prayer View'; $this->btnReturn->CausesValidation = true; $this->btnReturn->AddAction(new QClickEvent(), new QAjaxAction('btnReturn_Click')); }
protected function Form_Create() { $this->objSignupForm = SignupForm::Load(QApplication::PathInfo(0)); if (!$this->objSignupForm) { QApplication::Redirect('/events/'); } // Check for view *and* admin permissions on this ministry if (!$this->objSignupForm->IsLoginCanView(QApplication::$Login)) { QApplication::Redirect('/events/'); } if (!$this->objSignupForm->Ministry->IsLoginCanAdminMinistry(QApplication::$Login)) { QApplication::Redirect('/events/'); } switch ($this->objSignupForm->SignupFormTypeId) { case SignupFormType::Event: $this->strPageTitle .= $this->objSignupForm->Name; break; case SignupFormType::Course: $this->strPageTitle = 'Class Registration - ' . $this->objSignupForm->Name; break; default: throw new Exception('Invalid SignupFormTypeId for SignupForm: ' . $this->objSignupForm->Id); } $this->dlgEdit_Create(); $this->bIsCourse = false; // Child Object switch ($this->objSignupForm->SignupFormTypeId) { case SignupFormType::Event: break; case SignupFormType::Course: $this->bIsCourse = true; break; default: throw new Exception('Invalid SignupFormTypeId for SignupForm: ' . $this->objSignupForm->Id); } // Specifically for class registrations if ($this->bIsCourse) { $this->dtgClassAttendance = new QDataGrid($this); $this->dtgClassAttendance->AddColumn(new QDataGridColumn('Signups', '<?= $_FORM->RenderSignups($_ITEM); ?>', 'Width=300px', 'HtmlEntities=false')); $ClassMeetingArrayForIndex = $this->objSignupForm->ClassMeeting->GetClassMeetingDays(); foreach ($ClassMeetingArrayForIndex as $dtClassMeeting) { $strClassDate = $dtClassMeeting->ToString("DDDD, MMMM D, YYYY"); $this->dtgClassAttendance->AddColumn(new QDataGridColumn($strClassDate, '<?= $_FORM->RenderAttendance($_ITEM, $_COLUMN->Name); ?>', 'Width=300px', 'HtmlEntities=false')); } $this->dtgClassAttendance->SetDataBinder('dtgMyClassAttendance_Bind'); $this->pxyEditClassAttendance = new QControlProxy($this); $this->pxyEditClassAttendance->AddAction(new QClickEvent(), new QAjaxAction('pxyEditClassAttendance_Click')); $this->pxyEditClassAttendance->AddAction(new QClickEvent(), new QTerminateAction()); } }
protected function Form_Create() { // Setup Household Object $this->objHousehold = Household::Load(QApplication::PathInfo(0)); if (!$this->objHousehold) { QApplication::Redirect('/households/'); } $this->strPageTitle .= $this->objHousehold->Name; $this->lblHeadline = new QLabel($this); $this->lblHeadline->TagName = 'h3'; $this->lblHeadline->Text = 'Select Individual(s) to Split Off'; // Setup DataGrids $this->dtgMembers = new HouseholdParticipationDataGrid($this); $this->dtgMembers->AddColumn(new QDataGridColumn('Select', '<?= $_FORM->RenderRadio($_ITEM); ?>', 'Width=80px', 'HtmlEntities=false')); $this->dtgMembers->MetaAddColumn('Role', 'Width=80px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->FirstName, 'Name=Name', 'Html=<?= $_ITEM->Person->LinkHtml; ?>', 'HtmlEntities=false', 'Width=300px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryEmail->Address, 'Name=Email', 'Width=250px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryPhoneText, 'Name=Phone', 'Width=200px'); $this->dtgMembers->GetColumn(0)->OrderByClause = null; $this->dtgMembers->GetColumn(1)->OrderByClause = null; $this->dtgMembers->GetColumn(2)->OrderByClause = null; $this->dtgMembers->GetColumn(3)->OrderByClause = null; $this->dtgMembers->GetColumn(4)->OrderByClause = null; $this->dtgMembers->SetDataBinder('dtgMembers_Bind'); $this->lstHead = new QListBox($this); $this->lstHead->Name = 'Head of New Household'; $this->lstHead->Visible = false; $this->pnlAddress = new EditHouseholdHomeAddressPanel($this); $this->pnlAddress->Visible = false; $this->lstHead->Name = 'Head of New Household'; $this->lstHead->Visible = false; $this->btnNext = new QButton($this); $this->btnNext->Text = 'Next'; $this->btnNext->CssClass = 'primary'; $this->btnNext->AddAction(new QClickEvent(), new QAjaxAction('btnNext_Click')); $this->btnNext->CausesValidation = true; $this->btnSave = new QButton($this); $this->btnSave->Text = 'Save Changes'; $this->btnSave->CssClass = 'primary'; $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click')); $this->btnSave->CausesValidation = true; $this->btnSave->Visible = false; $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->CssClass = 'cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); $this->dlgMessage = new MessageDialog($this); }
protected function Form_Create() { parent::Form_Create(); $this->objPackage = Package::LoadByToken(QApplication::PathInfo(0)); if (!$this->objPackage) { QApplication::Redirect('/qpm/'); } $this->strPageTitle .= $this->objPackage->Name; $this->dtgContributions = new PackageContributionDataGrid($this); $this->dtgContributions->SetDataBinder('dtgContributions_Bind'); $this->dtgContributions->AlternateRowStyle->CssClass = 'alternate'; $this->dtgContributions->MetaAddColumn(QQN::PackageContribution()->Person->Username, 'Name=QPM Path for Version', 'Html=<?= $_FORM->RenderPath($_ITEM); ?>', 'Width=350px', 'VerticalAlign=top', 'FontNames=Monaco, Courier, Courier New,Monospaced', 'HtmlEntities=false'); $this->dtgContributions->MetaAddColumn(QQN::PackageContribution()->CurrentPackageVersion->Notes, 'Name=Version Notes', 'Html=<?= $_FORM->RenderNotes($_ITEM); ?>', 'Width=400px', 'VerticalAlign=top', 'CssClass=small', 'HtmlEntities=false'); $this->dtgContributions->MetaAddColumn('CurrentPostDate', 'Name=Posted', 'Width=100px', 'VerticalAlign=top'); $this->dtgContributions->MetaAddColumn(QQN::PackageContribution()->Person->DisplayName, 'Name=By', 'Html=<?= $_FORM->RenderPostedBy($_ITEM); ?>', 'HtmlEntities=false', 'Width=100px', 'CssClass=reverseLink', 'VerticalAlign=top'); $this->dtgContributions->SortColumnIndex = 2; $this->dtgContributions->SortDirection = 1; $this->dtgContributions->Paginator = new QPaginator($this->dtgContributions); if ($this->objPackage->IsEditableForPerson(QApplication::$Person)) { $this->btnEdit = new RoundedLinkButton($this); $this->btnEdit->CssClass = 'searchOption'; $this->btnEdit->ToolTip = 'Edit This package'; $this->btnEdit->LinkUrl = '/qpm/edit.php/' . $this->objPackage->Token; } // Setup messages panel if ($this->objPackage->PackageCategory->Token != 'issues') { $this->pnlMessages = new MessagesPanel($this); $this->pnlMessages->SelectTopic($this->objPackage->TopicLink->GetTopic()); $this->pnlMessages->lblTopicInfo_SetTemplate(__INCLUDES__ . '/messages/lblTopicInfoForPackage.tpl.php'); $this->pnlMessages->btnRespond1->Text = 'Post Comment'; $this->pnlMessages->btnRespond2->Text = 'Post Comment'; $this->pnlMessages->strAdditionalCssClass = 'topicForPackage'; if (array_key_exists('lastpage', $_GET)) { $this->pnlMessages->SetPageNumber(QPaginatedControl::LastPage); } } else { $strTokenParts = explode('_', $this->objPackage->Token); if (count($strTokenParts) == 2) { $strIssueNumber = $strTokenParts[1]; } else { $strIssueNumber = null; } $this->pnlMessages = new QPanel($this); $this->pnlMessages->CssClass = 'topic topicForPackage'; $this->pnlMessages->Text = '<h1>Comments</h1>'; $this->pnlMessages->Text .= '<br/>Comments for this issue-related QPM package have been disabled on this screen. To view, post and edit comments, '; $this->pnlMessages->Text .= 'please do so on the <a href="/issues/view.php/' . $strIssueNumber . '">issue page</a>, itself.'; } }
protected function Form_Create() { $this->objCategory = ClassifiedCategory::LoadByToken(QApplication::PathInfo(0)); if (!$this->objCategory) { QApplication::Redirect('/classifieds/'); } $this->strPageTitle .= $this->objCategory->Name; $this->dtgPosts = new ClassifiedPostDataGrid($this); $this->dtgPosts->Paginator = new QPaginator($this->dtgPosts); $this->dtgPosts->MetaAddColumn('DatePosted', 'Html=<?= $_FORM->RenderDatePosted($_ITEM); ?>', 'Width=120px'); $this->dtgPosts->MetaAddColumn('Title', 'Html=<?= $_FORM->RenderTitle($_ITEM); ?>', 'Width=750px', 'HtmlEntities=false'); $this->dtgPosts->SetDataBinder('dtgPosts_Bind'); $this->dtgPosts->SortColumnIndex = 0; $this->dtgPosts->SortDirection = 1; $this->dtgPosts->NoDataHtml = 'There are currently no approved posts that have been posted in the past 90 days.'; }
protected function Form_Create() { // Setup Household Object $this->objHousehold = Household::Load(QApplication::PathInfo(0)); if (!$this->objHousehold) { QApplication::Redirect('/households/'); } $this->strPageTitle .= $this->objHousehold->Name; $this->txtFirstName = new QTextBox($this); $this->txtFirstName->Name = 'First Name'; $this->txtLastName = new QTextBox($this); $this->txtLastName->Name = 'Last Name'; $this->txtFirstName->AddAction(new QChangeEvent(), new QAjaxAction('txtName_Change')); $this->txtLastName->AddAction(new QChangeEvent(), new QAjaxAction('txtName_Change')); $this->dtgHouseholds = new HouseholdDataGrid($this); $this->dtgHouseholds->Name = ' '; $this->dtgHouseholds->AddColumn(new QDataGridColumn('Select', '<?= $_FORM->RenderRadio($_ITEM); ?>', 'Width=80px', 'HtmlEntities=false')); $this->dtgHouseholds->MetaAddColumn('Name', 'Width=220px'); $this->dtgHouseholds->MetaAddColumn('Members', 'Width=400px'); $this->dtgHouseholds->SetDataBinder('dtgHouseholds_Bind'); // Setup DataGrids /* $this->dtgMembers = new HouseholdParticipationDataGrid($this); $this->dtgMembers->MetaAddColumn('Role', 'Width=80px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->FirstName, 'Name=Name', 'Html=<?= $_ITEM->Person->LinkHtml; ?>', 'HtmlEntities=false', 'Width=300px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryEmail->Address, 'Name=Email', 'Width=250px'); $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryPhone->Number, 'Name=Phone', 'Width=200px'); $this->dtgMembers->GetColumn(0)->OrderByClause = null; $this->dtgMembers->GetColumn(1)->OrderByClause = null; $this->dtgMembers->GetColumn(2)->OrderByClause = null; $this->dtgMembers->GetColumn(3)->OrderByClause = null; $this->dtgMembers->GetColumn(4)->OrderByClause = null; $this->dtgMembers->DataSource = $this->objHousehold->GetOrderedParticipantArray();*/ $this->lstHead = new QListBox($this); $this->lstHead->Name = 'Head of Merged Household'; $this->lstHead->Required = true; $this->lstHead_Refresh(); $this->btnSave = new QButton($this); $this->btnSave->Text = 'Merge'; $this->btnSave->CssClass = 'primary'; $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click')); $this->btnSave->CausesValidation = true; $this->btnCancel = new QLinkButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->CssClass = 'cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); }
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; }