public function pxyToggle_Click($strFormId, $strControlId, $strParameter) { $objMinistry = Ministry::Load($strParameter); $objMinistry->ActiveFlag = !$objMinistry->ActiveFlag; $objMinistry->Save(); $this->dtgMinistries->Refresh(); }
protected function Form_Create() { $this->btnReturnToGroup = new QButton($this); $this->btnReturnToGroup->CssClass = 'primary'; $this->btnReturnToGroup->AddAction(new QClickEvent(), new QAjaxAction('btnReturnToGroup_Click')); $this->btnReturnToGroup->Name = "Return to Growth Groups"; $this->btnReturnToGroup->Text = "Return to Growth Groups"; $this->btnReturnToGroup->Visible = true; $this->dtgGroups = new QDataGrid($this); $this->dtgGroups->AddColumn(new QDataGridColumn('Name', '<?= $_FORM->RenderName($_ITEM); ?>', 'HtmlEntities=false', 'Width=270px')); $this->dtgGroups->AddColumn(new QDataGridColumn('Group Type', '<?= $_ITEM->Type; ?>', 'Width=270px')); $this->dtgGroups->AddColumn(new QDataGridColumn('Count', '<?= $_FORM->RenderCount($_ITEM); ?>', 'HtmlEntities=false', 'Width=270px')); $groupArray = Group::LoadOrderedArrayByMinistryIdAndConfidentiality(17, Ministry::Load(17)->IsLoginCanAdminMinistry(QApplication::$Login), true); $this->dtgGroups->DataSource = $groupArray; }
protected function Form_Create() { $this->objMinistry = Ministry::Load(QApplication::PathInfo(0)); if (!$this->objMinistry) { QApplication::Redirect('/groups/'); } if (!$this->objMinistry->IsLoginCanAdminMinistry(QApplication::$Login)) { QApplication::Redirect('/groups/'); } $this->dtgRoles = new QDataGrid($this); $this->dtgRoles->SetDataBinder('dtgRoles_Bind'); $this->dtgRoles->AddColumn(new QDataGridColumn('Edit', '<?= $_FORM->RenderEdit($_ITEM); ?>', 'HtmlEntities=false', 'Width=50px')); $this->dtgRoles->AddColumn(new QDataGridColumn('Name', '<?= $_ITEM->Name; ?>', 'Width=200px')); $this->dtgRoles->AddColumn(new QDataGridColumn('Type', '<?= GroupRoleType::$NameArray[$_ITEM->GroupRoleTypeId]; ?>', 'Width=500px')); $this->pxyEditRole = new QControlProxy($this); $this->pxyEditRole->AddAction(new QClickEvent(), new QAjaxAction('pxyEditRole_Click')); $this->pxyEditRole->AddAction(new QClickEvent(), new QTerminateAction()); $this->pnlEditRole = new QPanel($this); $this->pnlEditRole->Template = dirname(__FILE__) . '/pnlEditRole.tpl.php'; $this->pnlEditRole->Visible = false; $this->txtName = new QTextBox($this->pnlEditRole); $this->txtName->Name = 'Role Name'; $this->txtName->Required = true; $this->txtName->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->lstType = new QListBox($this->pnlEditRole); $this->lstType->Name = 'Role Type'; $this->lstType->Required = true; foreach (GroupRoleType::$NameArray as $intId => $strName) { $this->lstType->AddItem($strName, $intId); } $this->btnSave = new QButton($this->pnlEditRole); $this->btnSave->CausesValidation = true; $this->btnSave->Text = 'Save'; $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click')); $this->btnCancel = new QLinkButton($this->pnlEditRole); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction()); }
protected function Form_Create() { $this->objGroupRegistration = new GroupRegistrations(); $this->mcGroupRegistration = new GroupRegistrationsMetaControl($this, $this->objGroupRegistration); $this->txtFirstName = $this->mcGroupRegistration->txtFirstName_Create(); $this->txtFirstName->Select(); $this->txtFirstName->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtFirstName->Required = true; $this->txtLastName = $this->mcGroupRegistration->txtLastName_Create(); $this->txtLastName->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtLastName->Required = true; $this->lstGender = new QListBox($this); $this->lstGender->Name = 'Gender'; $this->lstGender->AddItem('- Select One -'); $this->lstGender->AddItem('Female', 'F'); $this->lstGender->AddItem('Male', 'M'); $this->txtAddress = $this->mcGroupRegistration->txtAddress_Create(); $this->txtAddress->Name = 'Address'; $this->txtAddress->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtAddress->Required = true; $this->txtCity = $this->mcGroupRegistration->txtCity_Create(); $this->txtCity->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtCity->Required = true; $this->txtZipCode = $this->mcGroupRegistration->txtZipcode_Create(); $this->txtZipCode->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtZipCode->Required = true; $this->txtPhoneNumber = $this->mcGroupRegistration->txtPhone_Create(); $this->txtPhoneNumber->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtPhoneNumber->Required = true; $this->txtEmail = $this->mcGroupRegistration->txtEmail_Create(); $this->txtEmail->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtEmail->Required = true; $this->txtComments = $this->mcGroupRegistration->txtComments_Create(); $this->txtComments->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->lstSource = new QListBox($this); $this->lstSource->Name = 'How did you hear about us? '; $this->lstSource->Width = 250; $this->lstSource->AddItem('Choose...', 0); foreach (SourceList::LoadAll() as $objSourceList) { $this->lstSource->AddItem($objSourceList->Name, $objSourceList->Id); } $this->lstParticipationType = new QListBox($this); $this->lstParticipationType->Name = 'What would you like to be?'; $objRoleArray = Ministry::Load(17)->GetGroupRoleArray(QQ::OrderBy(QQN::GroupRole()->Name)); $this->lstParticipationType->AddItem('-Select One-'); foreach ($objRoleArray as $objRole) { $this->lstParticipationType->AddItem($objRole->Name, $objRole->Id); } $this->lstParticipationType->AddAction(new QChangeEvent(), new QAjaxAction('lstParticipationType_Change')); $this->lblMessage = new QLabel($this); $this->lblMessage->Text = ''; $this->lblMessage->ForeColor = 'red'; $this->lblMessage->HtmlEntities = false; $this->chkDaysAvailable = array(); foreach (GrowthGroupDayType::$NameArray as $key => $value) { $objChkDay = new QCheckBox($this); $objChkDay->Text = $value; $objChkDay->Name = $key; $this->chkDaysAvailable[] = $objChkDay; } $this->chkGroupType = array(); $objCondition = QQ::All(); $objGrowthGroupStructureCursor = GrowthGroupStructure::QueryCursor($objCondition); while ($objGrowthGroupStructure = GrowthGroupStructure::InstantiateCursor($objGrowthGroupStructureCursor)) { $objListItem = new QCheckBox($this); $objListItem->Text = $objGrowthGroupStructure->__toString(); $objListItem->Name = $objGrowthGroupStructure->Id; $this->chkGroupType[] = $objListItem; } $this->lstLocationFirst = new QListBox($this); $this->lstLocationFirst->Name = 'First Preference'; $this->lstLocationFirst->AddItem('Belmont'); $this->lstLocationFirst->AddItem('East Palo Alto'); $this->lstLocationFirst->AddItem('Fremont'); $this->lstLocationFirst->AddItem('Los Altos'); $this->lstLocationFirst->AddItem('Milpitas'); $this->lstLocationFirst->AddItem('Mountain View'); $this->lstLocationFirst->AddItem('Newark '); $this->lstLocationFirst->AddItem('Oakland'); $this->lstLocationFirst->AddItem('Palo Alto'); $this->lstLocationFirst->AddItem('San Francisco'); $this->lstLocationFirst->AddItem('San Jose'); $this->lstLocationFirst->AddItem('Santa Clara'); $this->lstLocationFirst->AddItem('South San Jose'); $this->lstLocationFirst->AddItem('Sunnyvale'); $this->lstLocationSecond = new QListBox($this); $this->lstLocationSecond->Name = 'Second Preference'; $this->lstLocationSecond->AddItem('Belmont'); $this->lstLocationSecond->AddItem('East Palo Alto'); $this->lstLocationSecond->AddItem('Fremont'); $this->lstLocationSecond->AddItem('Los Altos'); $this->lstLocationSecond->AddItem('Milpitas'); $this->lstLocationSecond->AddItem('Mountain View'); $this->lstLocationSecond->AddItem('Newark '); $this->lstLocationSecond->AddItem('Oakland'); $this->lstLocationSecond->AddItem('Palo Alto'); $this->lstLocationSecond->AddItem('San Francisco'); $this->lstLocationSecond->AddItem('San Jose'); $this->lstLocationSecond->AddItem('Santa Clara'); $this->lstLocationSecond->AddItem('South San Jose'); $this->lstLocationSecond->AddItem('Sunnyvale'); $this->btnSubmit = new QButton($this); $this->btnSubmit->Name = 'Submit'; $this->btnSubmit->Text = 'Submit'; $this->btnSubmit->CssClass = 'primary'; $this->btnSubmit->AddAction(new QClickEvent(), new QAjaxAction('btnSubmit_Click')); $this->btnSubmit->CausesValidation = true; $this->btnCancel = new QButton($this); $this->btnCancel->Name = 'Cancel'; $this->btnCancel->Text = 'Cancel'; $this->btnCancel->CssClass = 'primary'; }
protected function Form_ProcessHash() { $strParameter = $this->strUrlHash; if ($strParameter != $this->intMinistryId) { $intOldMinistryId = $this->intMinistryId; $this->intMinistryId = $strParameter; $this->pnlMinistry_Refresh($intOldMinistryId); $this->pnlMinistry_Refresh($this->intMinistryId); $this->lblMinistry_Refresh(); $this->dtgSignupForms->Refresh(); $objMinistry = Ministry::Load($this->intMinistryId); if ($objMinistry && $objMinistry->IsLoginCanAdminMinistry(QApplication::$Login)) { $this->chkViewAll->Visible = true; $this->lstSignupFormType->Visible = true; $this->lstSignupFormType->RemoveAllItems(); $this->lstSignupFormType->AddItem('- Create New... -'); foreach (SignupFormType::$NameArray as $intId => $strName) { if ($objMinistry->SignupFormTypeBitmap & $intId) { $this->lstSignupFormType->AddItem($strName, $intId); } } } else { $this->lstSignupFormType->Visible = false; } } }
/** * Override method to perform a property "Get" * This will get the value of $strName * * @param string $strName Name of the property to get * @return mixed */ public function __get($strName) { switch ($strName) { /////////////////// // Member Variables /////////////////// case 'Id': // Gets the value for intId (Read-Only PK) // @return integer return $this->intId; case 'MinistryId': // Gets the value for intMinistryId (Not Null) // @return integer return $this->intMinistryId; case 'Name': // Gets the value for strName // @return string return $this->strName; case 'GroupRoleTypeId': // Gets the value for intGroupRoleTypeId (Not Null) // @return integer return $this->intGroupRoleTypeId; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Ministry': // Gets the value for the Ministry object referenced by intMinistryId (Not Null) // @return Ministry try { if (!$this->objMinistry && !is_null($this->intMinistryId)) { $this->objMinistry = Ministry::Load($this->intMinistryId); } return $this->objMinistry; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// case '_GroupParticipation': // Gets the value for the private _objGroupParticipation (Read-Only) // if set due to an expansion on the group_participation.group_role_id reverse relationship // @return GroupParticipation return $this->_objGroupParticipation; case '_GroupParticipationArray': // Gets the value for the private _objGroupParticipationArray (Read-Only) // if set due to an ExpandAsArray on the group_participation.group_role_id reverse relationship // @return GroupParticipation[] return (array) $this->_objGroupParticipationArray; case '_GroupRegistrations': // Gets the value for the private _objGroupRegistrations (Read-Only) // if set due to an expansion on the group_registrations.group_role_id reverse relationship // @return GroupRegistrations return $this->_objGroupRegistrations; case '_GroupRegistrationsArray': // Gets the value for the private _objGroupRegistrationsArray (Read-Only) // if set due to an ExpandAsArray on the group_registrations.group_role_id reverse relationship // @return GroupRegistrations[] return (array) $this->_objGroupRegistrationsArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
/** * Override method to perform a property "Get" * This will get the value of $strName * * @param string $strName Name of the property to get * @return mixed */ public function __get($strName) { switch ($strName) { /////////////////// // Member Variables /////////////////// case 'Id': // Gets the value for intId (Read-Only PK) // @return integer return $this->intId; case 'MinistryId': // Gets the value for intMinistryId // @return integer return $this->intMinistryId; case 'Name': // Gets the value for strName // @return string return $this->strName; case 'ExternalName': // Gets the value for strExternalName // @return string return $this->strExternalName; case 'AccountNumber': // Gets the value for strAccountNumber // @return string return $this->strAccountNumber; case 'FundNumber': // Gets the value for strFundNumber // @return string return $this->strFundNumber; case 'ActiveFlag': // Gets the value for blnActiveFlag // @return boolean return $this->blnActiveFlag; case 'ExternalFlag': // Gets the value for blnExternalFlag // @return boolean return $this->blnExternalFlag; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Ministry': // Gets the value for the Ministry object referenced by intMinistryId // @return Ministry try { if (!$this->objMinistry && !is_null($this->intMinistryId)) { $this->objMinistry = Ministry::Load($this->intMinistryId); } return $this->objMinistry; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// case '_OnlineDonationLineItem': // Gets the value for the private _objOnlineDonationLineItem (Read-Only) // if set due to an expansion on the online_donation_line_item.stewardship_fund_id reverse relationship // @return OnlineDonationLineItem return $this->_objOnlineDonationLineItem; case '_OnlineDonationLineItemArray': // Gets the value for the private _objOnlineDonationLineItemArray (Read-Only) // if set due to an ExpandAsArray on the online_donation_line_item.stewardship_fund_id reverse relationship // @return OnlineDonationLineItem[] return (array) $this->_objOnlineDonationLineItemArray; case '_RecurringDonationItems': // Gets the value for the private _objRecurringDonationItems (Read-Only) // if set due to an expansion on the recurring_donation_items.stewardship_fund_id reverse relationship // @return RecurringDonationItems return $this->_objRecurringDonationItems; case '_RecurringDonationItemsArray': // Gets the value for the private _objRecurringDonationItemsArray (Read-Only) // if set due to an ExpandAsArray on the recurring_donation_items.stewardship_fund_id reverse relationship // @return RecurringDonationItems[] return (array) $this->_objRecurringDonationItemsArray; case '_SignupFormAsDonation': // Gets the value for the private _objSignupFormAsDonation (Read-Only) // if set due to an expansion on the signup_form.donation_stewardship_fund_id reverse relationship // @return SignupForm return $this->_objSignupFormAsDonation; case '_SignupFormAsDonationArray': // Gets the value for the private _objSignupFormAsDonationArray (Read-Only) // if set due to an ExpandAsArray on the signup_form.donation_stewardship_fund_id reverse relationship // @return SignupForm[] return (array) $this->_objSignupFormAsDonationArray; case '_SignupPaymentAsDonation': // Gets the value for the private _objSignupPaymentAsDonation (Read-Only) // if set due to an expansion on the signup_payment.donation_stewardship_fund_id reverse relationship // @return SignupPayment return $this->_objSignupPaymentAsDonation; case '_SignupPaymentAsDonationArray': // Gets the value for the private _objSignupPaymentAsDonationArray (Read-Only) // if set due to an ExpandAsArray on the signup_payment.donation_stewardship_fund_id reverse relationship // @return SignupPayment[] return (array) $this->_objSignupPaymentAsDonationArray; case '_StewardshipContributionAmount': // Gets the value for the private _objStewardshipContributionAmount (Read-Only) // if set due to an expansion on the stewardship_contribution_amount.stewardship_fund_id reverse relationship // @return StewardshipContributionAmount return $this->_objStewardshipContributionAmount; case '_StewardshipContributionAmountArray': // Gets the value for the private _objStewardshipContributionAmountArray (Read-Only) // if set due to an ExpandAsArray on the stewardship_contribution_amount.stewardship_fund_id reverse relationship // @return StewardshipContributionAmount[] return (array) $this->_objStewardshipContributionAmountArray; case '_StewardshipPledge': // Gets the value for the private _objStewardshipPledge (Read-Only) // if set due to an expansion on the stewardship_pledge.stewardship_fund_id reverse relationship // @return StewardshipPledge return $this->_objStewardshipPledge; case '_StewardshipPledgeArray': // Gets the value for the private _objStewardshipPledgeArray (Read-Only) // if set due to an ExpandAsArray on the stewardship_pledge.stewardship_fund_id reverse relationship // @return StewardshipPledge[] return (array) $this->_objStewardshipPledgeArray; case '_StewardshipPostAmount': // Gets the value for the private _objStewardshipPostAmount (Read-Only) // if set due to an expansion on the stewardship_post_amount.stewardship_fund_id reverse relationship // @return StewardshipPostAmount return $this->_objStewardshipPostAmount; case '_StewardshipPostAmountArray': // Gets the value for the private _objStewardshipPostAmountArray (Read-Only) // if set due to an ExpandAsArray on the stewardship_post_amount.stewardship_fund_id reverse relationship // @return StewardshipPostAmount[] return (array) $this->_objStewardshipPostAmountArray; case '_StewardshipPostLineItem': // Gets the value for the private _objStewardshipPostLineItem (Read-Only) // if set due to an expansion on the stewardship_post_line_item.stewardship_fund_id reverse relationship // @return StewardshipPostLineItem return $this->_objStewardshipPostLineItem; case '_StewardshipPostLineItemArray': // Gets the value for the private _objStewardshipPostLineItemArray (Read-Only) // if set due to an ExpandAsArray on the stewardship_post_line_item.stewardship_fund_id reverse relationship // @return StewardshipPostLineItem[] return (array) $this->_objStewardshipPostLineItemArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
/** * Override method to perform a property "Get" * This will get the value of $strName * * @param string $strName Name of the property to get * @return mixed */ public function __get($strName) { switch ($strName) { /////////////////// // Member Variables /////////////////// case 'Id': // Gets the value for intId (Read-Only PK) // @return integer return $this->intId; case 'Token': // Gets the value for strToken (Unique) // @return string return $this->strToken; case 'Name': // Gets the value for strName // @return string return $this->strName; case 'ParentMinistryId': // Gets the value for intParentMinistryId // @return integer return $this->intParentMinistryId; case 'GroupTypeBitmap': // Gets the value for intGroupTypeBitmap // @return integer return $this->intGroupTypeBitmap; case 'SignupFormTypeBitmap': // Gets the value for intSignupFormTypeBitmap // @return integer return $this->intSignupFormTypeBitmap; case 'ActiveFlag': // Gets the value for blnActiveFlag (Not Null) // @return boolean return $this->blnActiveFlag; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'ParentMinistry': // Gets the value for the Ministry object referenced by intParentMinistryId // @return Ministry try { if (!$this->objParentMinistry && !is_null($this->intParentMinistryId)) { $this->objParentMinistry = Ministry::Load($this->intParentMinistryId); } return $this->objParentMinistry; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// case '_Login': // Gets the value for the private _objLogin (Read-Only) // if set due to an expansion on the ministry_login_assn association table // @return Login return $this->_objLogin; case '_LoginArray': // Gets the value for the private _objLoginArray (Read-Only) // if set due to an ExpandAsArray on the ministry_login_assn association table // @return Login[] return (array) $this->_objLoginArray; case '_CommunicationList': // Gets the value for the private _objCommunicationList (Read-Only) // if set due to an expansion on the communication_list.ministry_id reverse relationship // @return CommunicationList return $this->_objCommunicationList; case '_CommunicationListArray': // Gets the value for the private _objCommunicationListArray (Read-Only) // if set due to an ExpandAsArray on the communication_list.ministry_id reverse relationship // @return CommunicationList[] return (array) $this->_objCommunicationListArray; case '_Group': // Gets the value for the private _objGroup (Read-Only) // if set due to an expansion on the group.ministry_id reverse relationship // @return Group return $this->_objGroup; case '_GroupArray': // Gets the value for the private _objGroupArray (Read-Only) // if set due to an ExpandAsArray on the group.ministry_id reverse relationship // @return Group[] return (array) $this->_objGroupArray; case '_GroupRole': // Gets the value for the private _objGroupRole (Read-Only) // if set due to an expansion on the group_role.ministry_id reverse relationship // @return GroupRole return $this->_objGroupRole; case '_GroupRoleArray': // Gets the value for the private _objGroupRoleArray (Read-Only) // if set due to an ExpandAsArray on the group_role.ministry_id reverse relationship // @return GroupRole[] return (array) $this->_objGroupRoleArray; case '_ChildMinistry': // Gets the value for the private _objChildMinistry (Read-Only) // if set due to an expansion on the ministry.parent_ministry_id reverse relationship // @return Ministry return $this->_objChildMinistry; case '_ChildMinistryArray': // Gets the value for the private _objChildMinistryArray (Read-Only) // if set due to an ExpandAsArray on the ministry.parent_ministry_id reverse relationship // @return Ministry[] return (array) $this->_objChildMinistryArray; case '_SignupForm': // Gets the value for the private _objSignupForm (Read-Only) // if set due to an expansion on the signup_form.ministry_id reverse relationship // @return SignupForm return $this->_objSignupForm; case '_SignupFormArray': // Gets the value for the private _objSignupFormArray (Read-Only) // if set due to an ExpandAsArray on the signup_form.ministry_id reverse relationship // @return SignupForm[] return (array) $this->_objSignupFormArray; case '_StewardshipFund': // Gets the value for the private _objStewardshipFund (Read-Only) // if set due to an expansion on the stewardship_fund.ministry_id reverse relationship // @return StewardshipFund return $this->_objStewardshipFund; case '_StewardshipFundArray': // Gets the value for the private _objStewardshipFundArray (Read-Only) // if set due to an ExpandAsArray on the stewardship_fund.ministry_id reverse relationship // @return StewardshipFund[] return (array) $this->_objStewardshipFundArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
/** * Override method to perform a property "Get" * This will get the value of $strName * * @param string $strName Name of the property to get * @return mixed */ public function __get($strName) { switch ($strName) { /////////////////// // Member Variables /////////////////// case 'Id': // Gets the value for intId (Read-Only PK) // @return integer return $this->intId; case 'GroupTypeId': // Gets the value for intGroupTypeId (Not Null) // @return integer return $this->intGroupTypeId; case 'MinistryId': // Gets the value for intMinistryId (Not Null) // @return integer return $this->intMinistryId; case 'Name': // Gets the value for strName // @return string return $this->strName; case 'Description': // Gets the value for strDescription // @return string return $this->strDescription; case 'ParentGroupId': // Gets the value for intParentGroupId // @return integer return $this->intParentGroupId; case 'HierarchyLevel': // Gets the value for intHierarchyLevel // @return integer return $this->intHierarchyLevel; case 'HierarchyOrderNumber': // Gets the value for intHierarchyOrderNumber // @return integer return $this->intHierarchyOrderNumber; case 'ConfidentialFlag': // Gets the value for blnConfidentialFlag // @return boolean return $this->blnConfidentialFlag; case 'EmailBroadcastTypeId': // Gets the value for intEmailBroadcastTypeId // @return integer return $this->intEmailBroadcastTypeId; case 'Token': // Gets the value for strToken (Unique) // @return string return $this->strToken; case 'ActiveFlag': // Gets the value for blnActiveFlag // @return boolean return $this->blnActiveFlag; case 'Status': // Gets the value for intStatus // @return integer return $this->intStatus; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Ministry': // Gets the value for the Ministry object referenced by intMinistryId (Not Null) // @return Ministry try { if (!$this->objMinistry && !is_null($this->intMinistryId)) { $this->objMinistry = Ministry::Load($this->intMinistryId); } return $this->objMinistry; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'ParentGroup': // Gets the value for the Group object referenced by intParentGroupId // @return Group try { if (!$this->objParentGroup && !is_null($this->intParentGroupId)) { $this->objParentGroup = Group::Load($this->intParentGroupId); } return $this->objParentGroup; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'StatusObject': // Gets the value for the AvailabilityStatus object referenced by intStatus // @return AvailabilityStatus try { if (!$this->objStatusObject && !is_null($this->intStatus)) { $this->objStatusObject = AvailabilityStatus::Load($this->intStatus); } return $this->objStatusObject; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'GroupCategory': // Gets the value for the GroupCategory object that uniquely references this Group // by objGroupCategory (Unique) // @return GroupCategory try { if ($this->objGroupCategory === false) { // We've attempted early binding -- and the reverse reference object does not exist return null; } if (!$this->objGroupCategory) { $this->objGroupCategory = GroupCategory::LoadByGroupId($this->intId); } return $this->objGroupCategory; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'GrowthGroup': // Gets the value for the GrowthGroup object that uniquely references this Group // by objGrowthGroup (Unique) // @return GrowthGroup try { if ($this->objGrowthGroup === false) { // We've attempted early binding -- and the reverse reference object does not exist return null; } if (!$this->objGrowthGroup) { $this->objGrowthGroup = GrowthGroup::LoadByGroupId($this->intId); } return $this->objGrowthGroup; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'SmartGroup': // Gets the value for the SmartGroup object that uniquely references this Group // by objSmartGroup (Unique) // @return SmartGroup try { if ($this->objSmartGroup === false) { // We've attempted early binding -- and the reverse reference object does not exist return null; } if (!$this->objSmartGroup) { $this->objSmartGroup = SmartGroup::LoadByGroupId($this->intId); } return $this->objSmartGroup; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// case '_EmailMessageRoute': // Gets the value for the private _objEmailMessageRoute (Read-Only) // if set due to an expansion on the email_message_route.group_id reverse relationship // @return EmailMessageRoute return $this->_objEmailMessageRoute; case '_EmailMessageRouteArray': // Gets the value for the private _objEmailMessageRouteArray (Read-Only) // if set due to an ExpandAsArray on the email_message_route.group_id reverse relationship // @return EmailMessageRoute[] return (array) $this->_objEmailMessageRouteArray; case '_ChildGroup': // Gets the value for the private _objChildGroup (Read-Only) // if set due to an expansion on the group.parent_group_id reverse relationship // @return Group return $this->_objChildGroup; case '_ChildGroupArray': // Gets the value for the private _objChildGroupArray (Read-Only) // if set due to an ExpandAsArray on the group.parent_group_id reverse relationship // @return Group[] return (array) $this->_objChildGroupArray; case '_GroupAuthorizedSender': // Gets the value for the private _objGroupAuthorizedSender (Read-Only) // if set due to an expansion on the group_authorized_sender.group_id reverse relationship // @return GroupAuthorizedSender return $this->_objGroupAuthorizedSender; case '_GroupAuthorizedSenderArray': // Gets the value for the private _objGroupAuthorizedSenderArray (Read-Only) // if set due to an ExpandAsArray on the group_authorized_sender.group_id reverse relationship // @return GroupAuthorizedSender[] return (array) $this->_objGroupAuthorizedSenderArray; case '_GroupParticipation': // Gets the value for the private _objGroupParticipation (Read-Only) // if set due to an expansion on the group_participation.group_id reverse relationship // @return GroupParticipation return $this->_objGroupParticipation; case '_GroupParticipationArray': // Gets the value for the private _objGroupParticipationArray (Read-Only) // if set due to an ExpandAsArray on the group_participation.group_id reverse relationship // @return GroupParticipation[] return (array) $this->_objGroupParticipationArray; case '_SmsMessage': // Gets the value for the private _objSmsMessage (Read-Only) // if set due to an expansion on the sms_message.group_id reverse relationship // @return SmsMessage return $this->_objSmsMessage; case '_SmsMessageArray': // Gets the value for the private _objSmsMessageArray (Read-Only) // if set due to an ExpandAsArray on the sms_message.group_id reverse relationship // @return SmsMessage[] return (array) $this->_objSmsMessageArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
<?php require dirname(__FILE__) . '/../../includes/prepend.inc.php'; QApplication::Authenticate(); // Get the array of all growth groups $groupArray = Group::LoadOrderedArrayByMinistryIdAndConfidentiality(17, Ministry::Load(17)->IsLoginCanAdminMinistry(QApplication::$Login), true); $intTotalCount = 0; $intGroupCount = 0; // Disable strict no-cache for IE due to IE issues with downloading no-cache items if (QApplication::IsBrowser(QBrowserType::InternetExplorer)) { header("Pragma:"); header("Expires:"); } header('Content-Type: text/csv'); header('Content-Disposition: attachment; filename=growthgroupreport.csv'); function EscapeCsv($strString) { return '"' . str_replace('"', '""', $strString) . '"'; } print "Growth Group,First Name,Last Name,E-mail,Phone,Address,City,State,Zip Code\r\n"; foreach ($groupArray as $objGroup) { // If it's a growth group then display the details if ($objGroup->Type != GroupType::$NameArray[GroupType::GroupCategory]) { $objPersonCursor = Person::QueryCursor(QQ::AndCondition(QQ::Equal(QQN::Person()->GroupParticipation->GroupId, $objGroup->Id), QQ::IsNull(QQN::Person()->GroupParticipation->DateEnd)), QQ::Clause(QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName), QQ::Distinct())); $intGroupCount++; while ($objPerson = Person::InstantiateCursor($objPersonCursor)) { print EscapeCsv($objGroup->Name); print ","; print EscapeCsv($objPerson->FirstName); print ","; print EscapeCsv($objPerson->LastName);
protected function lblMinistry_Refresh() { $objMinistry = Ministry::Load($this->intMinistryId); if ($objMinistry) { $this->lblMinistry->Visible = true; $this->lblMinistry->Text = 'Email Lists in ' . $objMinistry->Name; } else { $this->lblMinistry->Visible = false; } }
/** * Override method to perform a property "Get" * This will get the value of $strName * * @param string $strName Name of the property to get * @return mixed */ public function __get($strName) { switch ($strName) { /////////////////// // Member Variables /////////////////// case 'Id': // Gets the value for intId (Read-Only PK) // @return integer return $this->intId; case 'SignupFormTypeId': // Gets the value for intSignupFormTypeId (Not Null) // @return integer return $this->intSignupFormTypeId; case 'MinistryId': // Gets the value for intMinistryId (Not Null) // @return integer return $this->intMinistryId; case 'Name': // Gets the value for strName // @return string return $this->strName; case 'Token': // Gets the value for strToken (Unique) // @return string return $this->strToken; case 'ActiveFlag': // Gets the value for blnActiveFlag // @return boolean return $this->blnActiveFlag; case 'ConfidentialFlag': // Gets the value for blnConfidentialFlag // @return boolean return $this->blnConfidentialFlag; case 'Description': // Gets the value for strDescription // @return string return $this->strDescription; case 'InformationUrl': // Gets the value for strInformationUrl // @return string return $this->strInformationUrl; case 'SupportEmail': // Gets the value for strSupportEmail (Not Null) // @return string return $this->strSupportEmail; case 'EmailNotification': // Gets the value for strEmailNotification // @return string return $this->strEmailNotification; case 'AllowOtherFlag': // Gets the value for blnAllowOtherFlag // @return boolean return $this->blnAllowOtherFlag; case 'AllowMultipleFlag': // Gets the value for blnAllowMultipleFlag // @return boolean return $this->blnAllowMultipleFlag; case 'SignupLimit': // Gets the value for intSignupLimit // @return integer return $this->intSignupLimit; case 'SignupMaleLimit': // Gets the value for intSignupMaleLimit // @return integer return $this->intSignupMaleLimit; case 'SignupFemaleLimit': // Gets the value for intSignupFemaleLimit // @return integer return $this->intSignupFemaleLimit; case 'FundingAccount': // Gets the value for strFundingAccount // @return string return $this->strFundingAccount; case 'DonationStewardshipFundId': // Gets the value for intDonationStewardshipFundId // @return integer return $this->intDonationStewardshipFundId; case 'DateCreated': // Gets the value for dttDateCreated (Not Null) // @return QDateTime return $this->dttDateCreated; case 'LoginNotRequiredFlag': // Gets the value for blnLoginNotRequiredFlag // @return boolean return $this->blnLoginNotRequiredFlag; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Ministry': // Gets the value for the Ministry object referenced by intMinistryId (Not Null) // @return Ministry try { if (!$this->objMinistry && !is_null($this->intMinistryId)) { $this->objMinistry = Ministry::Load($this->intMinistryId); } return $this->objMinistry; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'DonationStewardshipFund': // Gets the value for the StewardshipFund object referenced by intDonationStewardshipFundId // @return StewardshipFund try { if (!$this->objDonationStewardshipFund && !is_null($this->intDonationStewardshipFundId)) { $this->objDonationStewardshipFund = StewardshipFund::Load($this->intDonationStewardshipFundId); } return $this->objDonationStewardshipFund; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'ClassMeeting': // Gets the value for the ClassMeeting object that uniquely references this SignupForm // by objClassMeeting (Unique) // @return ClassMeeting try { if ($this->objClassMeeting === false) { // We've attempted early binding -- and the reverse reference object does not exist return null; } if (!$this->objClassMeeting) { $this->objClassMeeting = ClassMeeting::LoadBySignupFormId($this->intId); } return $this->objClassMeeting; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'EventSignupForm': // Gets the value for the EventSignupForm object that uniquely references this SignupForm // by objEventSignupForm (Unique) // @return EventSignupForm try { if ($this->objEventSignupForm === false) { // We've attempted early binding -- and the reverse reference object does not exist return null; } if (!$this->objEventSignupForm) { $this->objEventSignupForm = EventSignupForm::LoadBySignupFormId($this->intId); } return $this->objEventSignupForm; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// case '_FormProduct': // Gets the value for the private _objFormProduct (Read-Only) // if set due to an expansion on the form_product.signup_form_id reverse relationship // @return FormProduct return $this->_objFormProduct; case '_FormProductArray': // Gets the value for the private _objFormProductArray (Read-Only) // if set due to an ExpandAsArray on the form_product.signup_form_id reverse relationship // @return FormProduct[] return (array) $this->_objFormProductArray; case '_FormQuestion': // Gets the value for the private _objFormQuestion (Read-Only) // if set due to an expansion on the form_question.signup_form_id reverse relationship // @return FormQuestion return $this->_objFormQuestion; case '_FormQuestionArray': // Gets the value for the private _objFormQuestionArray (Read-Only) // if set due to an ExpandAsArray on the form_question.signup_form_id reverse relationship // @return FormQuestion[] return (array) $this->_objFormQuestionArray; case '_SignupEntry': // Gets the value for the private _objSignupEntry (Read-Only) // if set due to an expansion on the signup_entry.signup_form_id reverse relationship // @return SignupEntry return $this->_objSignupEntry; case '_SignupEntryArray': // Gets the value for the private _objSignupEntryArray (Read-Only) // if set due to an ExpandAsArray on the signup_entry.signup_form_id reverse relationship // @return SignupEntry[] return (array) $this->_objSignupEntryArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
<?php $objAcsDatabase = new mysqli('localhost', 'root', '', 'alcf_acs'); // The following is indexed by Noah Ministry ID and then ACS GroupId // The array value [0] is the Name of the Group (if the Group is to be migrated over wholesale) // The array value [1] is a boolean on whether or not the group's ELEMENT1 that should be made into an individual group, // true means use ALL reserveids // or an array of awgrresf.reserveid's to use just the specified subset within that group // (thus ignoring the ACS Group for the groupid) $objGroupArray = array(21 => array(63 => array('Alter Prayer Ministry', false), 26 => array('Prayer Ministry', array(104, 105, 106, 272, 314, 364, 374, 375, 383, 401)), 36 => array('PrayerWorks', false), 35 => array('Worship Warriors', false)), 23 => array(53 => array('Information Center', false), 28 => array('Worship Services', array(123, 115, 116, 278, 121, 254, 124)), 19 => array('Hospitality', false))); foreach ($objGroupArray as $intMinistryId => $objAcsGroupArray) { $objMinistry = Ministry::Load($intMinistryId); $objRoleArray = $objMinistry->GetGroupRoleArray(); $objRole = $objRoleArray[0]; foreach ($objAcsGroupArray as $intAcsGroupId => $objDescriptionArray) { if (!$objDescriptionArray[1]) { $objGroup = Group::CreateGroupForMinistry($objMinistry, GroupType::RegularGroup, $objDescriptionArray[0], null); CreateGroupParticipations($objAcsDatabase, $objGroup, $objRole, $intAcsGroupId, null); } else { $objGroupCategory = Group::CreateGroupForMinistry($objMinistry, GroupType::GroupCategory, $objDescriptionArray[0], null); $objGroupCategoryDetail = new GroupCategory(); $objGroupCategoryDetail->GroupId = $objGroupCategory->Id; $objGroupCategoryDetail->Save(); foreach ($objDescriptionArray[1] as $intAcsReserveId) { $objResult = $objAcsDatabase->query(sprintf('select * from awgrresf where groupid=%s AND reserveid=%s;', $intAcsGroupId, $intAcsReserveId)); while ($objRow = $objResult->fetch_array()) { $objGroup = Group::CreateGroupForMinistry($objMinistry, GroupType::RegularGroup, $objRow['value'], null, $objGroupCategory); CreateGroupParticipations($objAcsDatabase, $objGroup, $objRole, $intAcsGroupId, $intAcsReserveId); } } }
/** * Static Helper Method to Create using PK arguments * You must pass in the PK arguments on an object to load, or leave it blank to create a new one. * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo * static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to * edit, or if we are also allowed to create a new one, etc. * * @param mixed $objParentObject QForm or QPanel which will be using this MinistryMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing Ministry object creation - defaults to CreateOrEdit * @return MinistryMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objMinistry = Ministry::Load($intId); // Ministry was found -- return it! if ($objMinistry) { return new MinistryMetaControl($objParentObject, $objMinistry); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a Ministry object with PK arguments: ' . $intId); } } // If EditOnly is specified, throw an exception } else { if ($intCreateType == QMetaControlCreateType::EditOnly) { throw new QCallerException('No PK arguments specified'); } } // If we are here, then we need to create a new record return new MinistryMetaControl($objParentObject, new Ministry()); }
protected function Form_ProcessHash() { if ($this->IsPollingActive()) { $this->ClearPollingProcessor(); } // Cleanup and Tokenize UrlHash Contents $strUrlHash = trim(strtolower($this->strUrlHash)); $strUrlHashTokens = explode('/', $strUrlHash); // Create a New Group? if ($strUrlHashTokens[0] == 'new') { if (count($strUrlHashTokens) != 3) { QApplication::Redirect('/groups/'); } // Validate the GroupType $strConstantName = QString::ConvertToCamelCase($strUrlHashTokens[1]); if (!defined('GroupType::' . $strConstantName)) { QApplication::Redirect('/groups/'); } // Validate the Ministry $objMinistry = Ministry::Load($strUrlHashTokens[2]); if (!$objMinistry) { QApplication::Redirect('/groups/'); } if (!$objMinistry->IsLoginCanAdminMinistry(QApplication::$Login)) { QApplication::Redirect('/groups/'); } // Create the Group Object $objGroup = new Group(); $objGroup->GroupTypeId = constant('GroupType::' . $strConstantName); $objGroup->Ministry = $objMinistry; $objGroup->ActiveFlag = true; } else { // Get the Group from the Hash and Refresh the Label $objGroup = Group::Load($strUrlHashTokens[0]); if (!$objGroup) { QApplication::Redirect('/groups/'); } } $intOldGroupId = $this->objGroup ? $this->objGroup->Id : null; $blnRefreshGroupsPanel = !$this->objGroup || $this->objGroup->MinistryId != $objGroup->MinistryId ? true : false; $this->objGroup = $objGroup; $this->pnlGroup_Refresh($this->objGroup); if ($intOldGroupId) { $this->pnlGroup_Refresh($intOldGroupId); } if ($blnRefreshGroupsPanel) { $this->pnlGroups_Refresh(); $this->pnlAdminOptions_Refresh(); } $this->lblMinistry_Refresh(); $this->pnlContent_Refresh($strUrlHashTokens); }
/** * Override method to perform a property "Get" * This will get the value of $strName * * @param string $strName Name of the property to get * @return mixed */ public function __get($strName) { switch ($strName) { /////////////////// // Member Variables /////////////////// case 'Id': // Gets the value for intId (Read-Only PK) // @return integer return $this->intId; case 'EmailBroadcastTypeId': // Gets the value for intEmailBroadcastTypeId (Not Null) // @return integer return $this->intEmailBroadcastTypeId; case 'MinistryId': // Gets the value for intMinistryId (Not Null) // @return integer return $this->intMinistryId; case 'Name': // Gets the value for strName // @return string return $this->strName; case 'Token': // Gets the value for strToken (Unique) // @return string return $this->strToken; case 'Description': // Gets the value for strDescription // @return string return $this->strDescription; case 'Subscribable': // Gets the value for blnSubscribable // @return boolean return $this->blnSubscribable; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Ministry': // Gets the value for the Ministry object referenced by intMinistryId (Not Null) // @return Ministry try { if (!$this->objMinistry && !is_null($this->intMinistryId)) { $this->objMinistry = Ministry::Load($this->intMinistryId); } return $this->objMinistry; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// case '_CommunicationListEntry': // Gets the value for the private _objCommunicationListEntry (Read-Only) // if set due to an expansion on the communicationlist_communicationlistentry_assn association table // @return CommunicationListEntry return $this->_objCommunicationListEntry; case '_CommunicationListEntryArray': // Gets the value for the private _objCommunicationListEntryArray (Read-Only) // if set due to an ExpandAsArray on the communicationlist_communicationlistentry_assn association table // @return CommunicationListEntry[] return (array) $this->_objCommunicationListEntryArray; case '_Person': // Gets the value for the private _objPerson (Read-Only) // if set due to an expansion on the communicationlist_person_assn association table // @return Person return $this->_objPerson; case '_PersonArray': // Gets the value for the private _objPersonArray (Read-Only) // if set due to an ExpandAsArray on the communicationlist_person_assn association table // @return Person[] return (array) $this->_objPersonArray; case '_EmailMessageRoute': // Gets the value for the private _objEmailMessageRoute (Read-Only) // if set due to an expansion on the email_message_route.communication_list_id reverse relationship // @return EmailMessageRoute return $this->_objEmailMessageRoute; case '_EmailMessageRouteArray': // Gets the value for the private _objEmailMessageRouteArray (Read-Only) // if set due to an ExpandAsArray on the email_message_route.communication_list_id reverse relationship // @return EmailMessageRoute[] return (array) $this->_objEmailMessageRouteArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
protected function lstMinistries_Update() { if ($this->lstMinistries) { $this->objLogin->UnassociateAllMinistries(); $objSelectedListItems = $this->lstMinistries->SelectedItems; if ($objSelectedListItems) { foreach ($objSelectedListItems as $objListItem) { $this->objLogin->AssociateMinistry(Ministry::Load($objListItem->Value)); } } } }