/** * Reload this CommunicationList from the database. * @return void */ public function Reload() { // Make sure we are actually Restored from the database if (!$this->__blnRestored) { throw new QCallerException('Cannot call Reload() on a new, unsaved CommunicationList object.'); } // Reload the Object $objReloaded = CommunicationList::Load($this->intId); // Update $this's local variables to match $this->EmailBroadcastTypeId = $objReloaded->EmailBroadcastTypeId; $this->MinistryId = $objReloaded->MinistryId; $this->strName = $objReloaded->strName; $this->strToken = $objReloaded->strToken; $this->strDescription = $objReloaded->strDescription; $this->blnSubscribable = $objReloaded->blnSubscribable; }
public function btnSave_Click($strFormId, $strControlId, $strParameter) { $objList = CommunicationList::Load($this->lstCommunicationLists->SelectedValue); $this->objPerson->AssociateCommunicationList($objList); QApplication::ExecuteJavaScript('document.location = "#groups";'); }
/** * 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 'EmailMessageId': // Gets the value for intEmailMessageId (Not Null) // @return integer return $this->intEmailMessageId; case 'GroupId': // Gets the value for intGroupId // @return integer return $this->intGroupId; case 'CommunicationListId': // Gets the value for intCommunicationListId // @return integer return $this->intCommunicationListId; case 'LoginId': // Gets the value for intLoginId // @return integer return $this->intLoginId; case 'CommunicationListEntryId': // Gets the value for intCommunicationListEntryId // @return integer return $this->intCommunicationListEntryId; case 'PersonId': // Gets the value for intPersonId // @return integer return $this->intPersonId; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'EmailMessage': // Gets the value for the EmailMessage object referenced by intEmailMessageId (Not Null) // @return EmailMessage try { if (!$this->objEmailMessage && !is_null($this->intEmailMessageId)) { $this->objEmailMessage = EmailMessage::Load($this->intEmailMessageId); } return $this->objEmailMessage; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'Group': // Gets the value for the Group object referenced by intGroupId // @return Group try { if (!$this->objGroup && !is_null($this->intGroupId)) { $this->objGroup = Group::Load($this->intGroupId); } return $this->objGroup; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'CommunicationList': // Gets the value for the CommunicationList object referenced by intCommunicationListId // @return CommunicationList try { if (!$this->objCommunicationList && !is_null($this->intCommunicationListId)) { $this->objCommunicationList = CommunicationList::Load($this->intCommunicationListId); } return $this->objCommunicationList; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'Login': // Gets the value for the Login object referenced by intLoginId // @return Login try { if (!$this->objLogin && !is_null($this->intLoginId)) { $this->objLogin = Login::Load($this->intLoginId); } return $this->objLogin; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'CommunicationListEntry': // Gets the value for the CommunicationListEntry object referenced by intCommunicationListEntryId // @return CommunicationListEntry try { if (!$this->objCommunicationListEntry && !is_null($this->intCommunicationListEntryId)) { $this->objCommunicationListEntry = CommunicationListEntry::Load($this->intCommunicationListEntryId); } return $this->objCommunicationListEntry; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'Person': // Gets the value for the Person object referenced by intPersonId // @return Person try { if (!$this->objPerson && !is_null($this->intPersonId)) { $this->objPerson = Person::Load($this->intPersonId); } return $this->objPerson; } 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 '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
public function pxyUnsubscribe_Click($strFormId, $strControlId, $strParameter) { $objCommunicationList = CommunicationList::Load($strParameter); if ($objCommunicationList->IsPersonAssociated($this->objPerson)) { $objCommunicationList->UnassociatePerson($this->objPerson); } $this->dtgCommunicationLists->Refresh(); }
protected function lstCommunicationLists_Update() { if ($this->lstCommunicationLists) { $this->objCommunicationListEntry->UnassociateAllCommunicationLists(); $objSelectedListItems = $this->lstCommunicationLists->SelectedItems; if ($objSelectedListItems) { foreach ($objSelectedListItems as $objListItem) { $this->objCommunicationListEntry->AssociateCommunicationList(CommunicationList::Load($objListItem->Value)); } } } }
/** * 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 CommunicationListMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing CommunicationList object creation - defaults to CreateOrEdit * @return CommunicationListMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objCommunicationList = CommunicationList::Load($intId); // CommunicationList was found -- return it! if ($objCommunicationList) { return new CommunicationListMetaControl($objParentObject, $objCommunicationList); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a CommunicationList 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 CommunicationListMetaControl($objParentObject, new CommunicationList()); }
<?php require dirname(__FILE__) . '/../../includes/prepend.inc.php'; QApplication::Authenticate(); $objList = CommunicationList::Load(QApplication::PathInfo(0)); if (!$objList) { QApplication::Redirect('/communications/'); } if (!$objList->Ministry->IsLoginCanAdminMinistry(QApplication::$Login)) { QApplication::Redirect('/communications/'); } // 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=' . $objList->CsvFilename); print "First Name, Middle Name, Last Name,E-mail, Gender, Phone, Address,City, State, Zipcode\r\n"; // iterate through the Communications List. sort by Last Name, then First Name $objMembersListArray = $objList->GetMemberAsArray('2,0'); //asort($objMembersListArray); foreach ($objMembersListArray as $objMember) { print EscapeCsv($objMember[0]); // First Name print ","; print EscapeCsv($objMember[1]); // Middle Name print ","; print EscapeCsv($objMember[2]); // Last Name