示例#1
0
 /**
  * Reload this AvailabilityStatus 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 AvailabilityStatus object.');
     }
     // Reload the Object
     $objReloaded = AvailabilityStatus::Load($this->intId);
     // Update $this's local variables to match
     $this->strName = $objReloaded->strName;
 }
 protected function SetupPanel()
 {
     if (!$this->objGroup->IsLoginCanView(QApplication::$Login)) {
         $this->ReturnTo('/groups/');
     }
     $this->SetupViewControls(true, false);
     // Set up additional column specifically for Growth Groups
     $this->dtgMembers->AddColumn(new QDataGridColumn('Current Group Member', '<?= $_CONTROL->ParentControl->RenderCurrentMember($_ITEM); ?>', 'HtmlEntities=true', 'Width=80px', array('OrderByClause' => QQ::OrderBy(QQN::Person()->GroupParticipation->DateEnd), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->GroupParticipation->DateEnd, false))));
     $this->dtgMembers->AddColumn(new QDataGridColumn('Group Role', '<?= $_CONTROL->ParentControl->RenderRole($_ITEM); ?>', 'HtmlEntities=true', 'Width=80px', array('OrderByClause' => QQ::OrderBy(QQN::Person()->GroupParticipation->GroupRole), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->GroupParticipation->GroupRole, false))));
     $this->dtgMembers->SetDataBinder('dtgMembers_Bind', $this);
     $strFacilitatorArray = array();
     $strHostArray = array();
     foreach ($this->objGroup->GetActiveGroupParticipationArray() as $objParticipant) {
         if ($objParticipant->GroupRole->Name == 'Facilitator') {
             $strFacilitatorArray[] = $objParticipant->Person->Name;
         } else {
             if ($objParticipant->GroupRole->Name == 'Host') {
                 $strHostArray[] = $objParticipant->Person->Name;
             }
         }
     }
     $this->lblFacilitator = new QLabel($this);
     $this->lblFacilitator->Name = 'Facilitator';
     if (count($strFacilitatorArray)) {
         $this->lblFacilitator->Text = implode(', ', $strFacilitatorArray);
     } else {
         $this->lblFacilitator->CssClass = 'na';
         $this->lblFacilitator->Text = 'Not Specified';
     }
     $this->lblHost = new QLabel($this);
     $this->lblHost->Name = 'Host';
     if (count($strHostArray)) {
         $this->lblHost->Text = implode(', ', $strHostArray);
     } else {
         $this->lblHost->CssClass = 'na';
         $this->lblHost->Text = 'Not Specified';
     }
     $this->lblRegion = new QLabel($this);
     $this->lblRegion->Name = 'Growth Group Region';
     $this->lblRegion->Text = $this->objGroup->GrowthGroup->GrowthGroupLocation->Location;
     $this->lblMeeting = new QLabel($this);
     $this->lblMeeting->Name = 'Meeting Information';
     $this->lblMeeting->Text = $this->objGroup->GrowthGroup->MeetingInfo;
     $this->lblAddress = new QLabel($this);
     $this->lblAddress->Name = 'Address';
     $this->lblAddress->Text = $this->objGroup->GrowthGroup->AddressInfo;
     $this->lblStructure = new QLabel($this);
     $this->lblStructure->Name = 'Structure';
     $this->lblStructure->Text = $this->objGroup->GrowthGroup->StructuresHtml;
     $this->lblStructure->HtmlEntities = false;
     $this->lblStatus = new QLabel($this);
     $this->lblStatus->Name = 'Availability Status';
     $this->lblStatus->Text = AvailabilityStatus::Load($this->objGroup->Status) ? AvailabilityStatus::Load($this->objGroup->Status)->Name : 'None';
     $this->lblStatus->HtmlEntities = false;
     $this->lblDescription = new QLabel($this);
     $this->lblDescription->Name = 'Description';
     $this->lblDescription->Text = $this->objGroup->GrowthGroup->Description;
     $this->lblDescription->HtmlEntities = false;
     if ($this->objGroup->CountEmailMessageRoutes()) {
         $this->SetupEmailMessageControls();
     }
     $this->SetupSmsControls();
     $this->chkViewAll = new QCheckBox($this);
     $this->chkViewAll->Text = 'View "Inactive/Past" Members as well';
     $this->chkViewAll->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'chkViewAll_Click'));
 }
 /**
  * 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 AvailabilityStatusMetaControl
  * @param integer $intId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing AvailabilityStatus object creation - defaults to CreateOrEdit
  * @return AvailabilityStatusMetaControl
  */
 public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intId)) {
         $objAvailabilityStatus = AvailabilityStatus::Load($intId);
         // AvailabilityStatus was found -- return it!
         if ($objAvailabilityStatus) {
             return new AvailabilityStatusMetaControl($objParentObject, $objAvailabilityStatus);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a AvailabilityStatus 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 AvailabilityStatusMetaControl($objParentObject, new AvailabilityStatus());
 }
示例#4
0
 /**
  * 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;
             }
     }
 }