Beispiel #1
0
 public function btnSave_Click($strFormId, $strControlId, $strParameter)
 {
     //Create New Group from information stored in mctGroup
     $objCloneGroup = new Group();
     // Update any fields for controls that have been created
     if ($this->mctGroup->GroupTypeIdControl) {
         $objCloneGroup->GroupTypeId = $this->mctGroup->GroupTypeIdControl->SelectedValue;
     }
     if ($this->mctGroup->MinistryIdControl) {
         $objCloneGroup->MinistryId = $this->mctGroup->MinistryIdControl->SelectedValue;
     }
     if ($this->mctGroup->NameControl) {
         $objCloneGroup->Name = $this->mctGroup->NameControl->Text;
     }
     if ($this->mctGroup->DescriptionControl) {
         $objCloneGroup->Description = $this->mctGroup->DescriptionControl->Text;
     }
     if ($this->mctGroup->ParentGroupIdControl) {
         $objCloneGroup->ParentGroupId = $this->mctGroup->ParentGroupIdControl->SelectedValue;
     }
     if ($this->mctGroup->HierarchyLevelControl) {
         $objCloneGroup->HierarchyLevel = $this->mctGroup->HierarchyLevelControl->Text;
     }
     if ($this->mctGroup->HierarchyOrderNumberControl) {
         $objCloneGroup->HierarchyOrderNumber = $this->mctGroup->HierarchyOrderNumberControl->Text;
     }
     if ($this->mctGroup->ConfidentialFlagControl) {
         $objCloneGroup->ConfidentialFlag = $this->mctGroup->ConfidentialFlagControl->Checked;
     }
     if ($this->mctGroup->EmailBroadcastTypeIdControl) {
         $objCloneGroup->EmailBroadcastTypeId = $this->mctGroup->EmailBroadcastTypeIdControl->SelectedValue;
     }
     if ($this->mctGroup->TokenControl) {
         $objCloneGroup->Token = $this->mctGroup->TokenControl->Text;
     }
     if ($this->mctGroup->ActiveFlagControl) {
         $objCloneGroup->ActiveFlag = $this->mctGroup->ActiveFlagControl->Checked;
     }
     // Update any UniqueReverseReferences (if any) for controls that have been created for it
     if ($this->mctGroup->GroupCategoryControl) {
         $objCloneGroup->GroupCategory = GroupCategory::Load($this->mctGroup->GroupCategoryControl->SelectedValue);
     }
     if ($this->mctGroup->GrowthGroupControl) {
         $objCloneGroup->GrowthGroup = GrowthGroup::Load($this->mctGroup->GrowthGroupControl->SelectedValue);
     }
     if ($this->mctGroup->SmartGroupControl) {
         $objCloneGroup->SmartGroup = SmartGroup::Load($this->mctGroup->SmartGroupControl->SelectedValue);
     }
     // Save the Cloned Group object
     $objCloneGroup->Save();
     // Get Participation List and propogate it
     $objGroupParticipationArray = $this->mctGroup->Group->GetActiveGroupParticipationArray();
     foreach ($objGroupParticipationArray as $objGroupParticipation) {
         $objCloneGroup->AddPerson(Person::Load($objGroupParticipation->PersonId), $objGroupParticipation->GroupRoleId);
     }
     Group::RefreshHierarchyDataForMinistry($objCloneGroup->MinistryId);
     $this->objForm->pnlGroups_Refresh();
     // Go to new Group.
     $this->ReturnTo('#' . $objCloneGroup->Id);
 }
Beispiel #2
0
 public function dtrGrowthGroups_Bind()
 {
     $objCondition = QQ::Equal(QQN::GrowthGroup()->GrowthGroupLocationId, $this->objLocation->Id);
     if ($this->lstDays->SelectedValue) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::GrowthGroup()->GrowthGroupDayTypeId, $this->lstDays->SelectedValue));
     }
     if ($this->lstTypes->SelectedValue) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::GrowthGroup()->GrowthGroupStructure->GrowthGroupStructureId, $this->lstTypes->SelectedValue));
     }
     // Filter Out "inactive" groups
     $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::GrowthGroup()->Group->ActiveFlag, true));
     $this->dtrGrowthGroups->DataSource = GrowthGroup::QueryArray($objCondition, QQ::OrderBy(QQN::GrowthGroup()->Group->Name));
     // Results?
     $this->pnlNone->Visible = !count($this->dtrGrowthGroups->DataSource);
     // Markers
     QApplication::ExecuteJavaScript('hideAllMarkers();');
     foreach ($this->dtrGrowthGroups->DataSource as $objGroup) {
         QApplication::ExecuteJavaScript('showMarker(' . ($this->intMarkerArray[$objGroup->GroupId] - 1) . ');');
     }
 }
 /**
  * Counts all many-to-many associated GrowthGroups
  * @return int
  */
 public function CountGrowthGroups()
 {
     if (is_null($this->intId)) {
         return 0;
     }
     return GrowthGroup::CountByGrowthGroupStructure($this->intId);
 }
    /**
     * Deletes all associated GrowthGroups
     * @return void
     */
    public function DeleteAllGrowthGroups()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateGrowthGroup on this unsaved GrowthGroupLocation.');
        }
        // Get the Database Object for this Class
        $objDatabase = GrowthGroupLocation::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (GrowthGroup::LoadArrayByGrowthGroupLocationId($this->intId) as $objGrowthGroup) {
                $objGrowthGroup->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`growth_group`
				WHERE
					`growth_group_location_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }
Beispiel #5
0
 public static function GenerateGroup(Ministry $objMinistry, Group $objParentGroup = null)
 {
     $strName = QDataGen::GenerateTitle(1, 4);
     $strToken = strtolower(str_replace(' ', '_', $strName));
     while (Group::LoadByToken($strToken)) {
         $strName = QDataGen::GenerateTitle(1, 4);
         $strToken = strtolower(str_replace(' ', '_', $strName));
     }
     $strDescription = QDataGen::GenerateContent(rand(0, 1), 5, 20);
     $intGroupTypeId = QDataGen::GenerateFromArray(array_keys(GroupType::$NameArray));
     $objGroup = Group::CreateGroupForMinistry($objMinistry, $intGroupTypeId, $strName, $strDescription, $objParentGroup);
     // Set folder options
     $objGroup->ConfidentialFlag = !rand(0, 8);
     // Email
     if (!rand(0, 3)) {
         $objGroup->EmailBroadcastTypeId = QDataGen::GenerateFromArray(array_keys(EmailBroadcastType::$NameArray));
         $objGroup->Token = $strToken;
     }
     $objGroup->Save();
     switch ($objGroup->GroupTypeId) {
         case GroupType::GrowthGroup:
             $objGrowthGroup = new GrowthGroup();
             $objGrowthGroup->Group = $objGroup;
             $objGrowthGroup->GrowthGroupLocationId = rand(1, GrowthGroupLocation::CountAll());
             $objGrowthGroup->Save();
             break;
         case GroupType::SmartGroup:
             $objSmartGroup = new SmartGroup();
             $objSmartGroup->Group = $objGroup;
             $objSmartGroup->Save();
             break;
         case GroupType::GroupCategory:
             $objGroupCategory = new GroupCategory();
             $objGroupCategory->Group = $objGroup;
             $objGroupCategory->Save();
             // Create Subgroups
             $intSubFolderCount = rand(0, 5);
             for ($intCount = 0; $intCount < $intSubFolderCount; $intCount++) {
                 self::GenerateGroup($objMinistry, $objGroup);
             }
             break;
     }
     // Create Participants
     $objGroupRoleArray = GroupRole::LoadArrayByMinistryId($objMinistry->Id);
     switch ($objGroup->GroupTypeId) {
         case GroupType::GrowthGroup:
         case GroupType::RegularGroup:
             $intParticipantCount = rand(1, 8);
             for ($intIndex = 0; $intIndex < $intParticipantCount; $intIndex++) {
                 $dttStartDate = QDataGen::GenerateDateTime(self::$SystemStartDate, QDateTime::Now());
                 $dttEndDate = rand(0, 4) ? null : QDataGen::GenerateDateTime($dttStartDate, QDateTime::Now());
                 $objGroup->AddPerson(Person::Load(rand(1, self::$MaxPersonId)), QDataGen::GenerateFromArray($objGroupRoleArray)->Id, $dttStartDate, $dttEndDate);
             }
             break;
     }
 }
Beispiel #6
0
 public static function GetSoapArrayFromArray($objArray)
 {
     if (!$objArray) {
         return null;
     }
     $objArrayToReturn = array();
     foreach ($objArray as $objObject) {
         array_push($objArrayToReturn, GrowthGroup::GetSoapObjectFromObject($objObject, true));
     }
     return unserialize(serialize($objArrayToReturn));
 }
Beispiel #7
0
while ($objRow = $objResult->fetch_array()) {
    $objGrowthGroupLocation = new GrowthGroupLocation();
    $objGrowthGroupLocation->Location = $objRow['location'];
    $objGrowthGroupLocation->Longitude = $objRow['longitude'];
    $objGrowthGroupLocation->Latitude = $objRow['latitude'];
    $objGrowthGroupLocation->Zoom = $objRow['zoom'];
    $objGrowthGroupLocation->Save();
    $strTokens = explode('(', $objGrowthGroupLocation->Location);
    $objParentGroup = Group::CreateGroupForMinistry($objMinistry, GroupType::GroupCategory, trim($strTokens[0]), 'Growth Groups in ' . $objGrowthGroupLocation->Location);
    $objGroupCategory = new GroupCategory();
    $objGroupCategory->Group = $objParentGroup;
    $objGroupCategory->Save();
    $objGgResult = $objMySqli->Query('SELECT * FROM growth_group WHERE growth_group_location_id=' . $objRow['id'] . ' ORDER BY id');
    while ($objGgRow = $objGgResult->fetch_array()) {
        $objGroup = Group::CreateGroupForMinistry($objMinistry, GroupType::GrowthGroup, $objGgRow['name'], 'Growth Group for ' . $objGgRow['name'], $objParentGroup);
        $objGrowthGroup = new GrowthGroup();
        $objGrowthGroup->Group = $objGroup;
        $objGrowthGroup->GrowthGroupLocationId = $objGgRow['growth_group_location_id'];
        $objGrowthGroup->GrowthGroupDayTypeId = $objGgRow['growth_group_day_type_id'];
        $objGrowthGroup->MeetingBitmap = $objGgRow['meeting_bitmap'];
        $objGrowthGroup->StartTime = $objGgRow['start_time'];
        $objGrowthGroup->EndTime = $objGgRow['end_time'];
        $objGrowthGroup->Address1 = $objGgRow['address_1'];
        $objGrowthGroup->Address2 = $objGgRow['address_2'];
        $objGrowthGroup->CrossStreet1 = $objGgRow['cross_street_1'];
        $objGrowthGroup->CrossStreet2 = $objGgRow['cross_street_2'];
        $objGrowthGroup->ZipCode = $objGgRow['zip_code'];
        $objGrowthGroup->Longitude = $objGgRow['longitude'];
        $objGrowthGroup->Latitude = $objGgRow['latitude'];
        $objGrowthGroup->Accuracy = $objGgRow['accuracy'];
        $objGrowthGroup->Save();
 /**
  * Main utility method to aid with data binding.  It is used by the default BindAllRows() databinder but
  * could and should be used by any custom databind methods that would be used for instances of this
  * MetaDataGrid, by simply passing in a custom QQCondition and/or QQClause. 
  *
  * If a paginator is set on this DataBinder, it will use it.  If not, then no pagination will be used.
  * It will also perform any sorting (if applicable).
  *
  * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself
  * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query		 
  * @return void
  */
 public function MetaDataBinder(QQCondition $objCondition = null, $objOptionalClauses = null)
 {
     // Setup input parameters to default values if none passed in
     if (!$objCondition) {
         $objCondition = QQ::All();
     }
     $objClauses = $objOptionalClauses ? $objOptionalClauses : array();
     // We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
     if ($this->Paginator) {
         $this->TotalItemCount = GrowthGroup::QueryCount($objCondition, $objClauses);
     }
     // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
     // the OrderByClause to the $objClauses array
     if ($objClause = $this->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be a Query result from GrowthGroup, given the clauses above
     $this->DataSource = GrowthGroup::QueryArray($objCondition, $objClauses);
 }
 public function dtgGroups_Bind()
 {
     $objConditions = QQ::All();
     $objClauses = array();
     $objConditions = QQ::AndCondition($objConditions, QQ::Equal(QQN::GrowthGroup()->Group->ActiveFlag, true));
     if ($this->chkDayOfWeek->Checked) {
         // Map to Days of Week
         $dayArray = array();
         foreach (GrowthGroupDayType::$NameArray as $key => $value) {
             if (strpos(strtolower($this->objRegistrant->GroupDay), strtolower($value)) !== false) {
                 $dayArray[] = $key;
             }
         }
         $objConditions = QQ::AndCondition($objConditions, QQ::In(QQN::GrowthGroup()->GrowthGroupDayTypeId, $dayArray));
     }
     $growthGroupArray = GrowthGroup::QueryArray($objConditions);
     if ($this->chkGroupType->Checked) {
         $requestedGroupStructureArray = array();
         foreach (GrowthGroupStructure::LoadAll() as $objGroupStructure) {
             if ($this->objRegistrant->IsGrowthGroupStructureAsGroupstructureAssociated($objGroupStructure)) {
                 $requestedGroupStructureArray[] = $objGroupStructure;
             }
         }
         $newGrowthGroupArray = array();
         foreach ($growthGroupArray as $objGroup) {
             foreach ($requestedGroupStructureArray as $objGroupStructure) {
                 if ($objGroup->IsGrowthGroupStructureAssociated($objGroupStructure)) {
                     $newGrowthGroupArray[] = $objGroup;
                     break;
                 }
             }
         }
         $growthGroupArray = $newGrowthGroupArray;
     }
     if ($this->chkAvailability->Checked) {
         $newGrowthGroupArray = array();
         $intClosed = 0;
         foreach (AvailabilityStatus::LoadAll() as $objStatus) {
             if ($objStatus->Name == 'Closed') {
                 $intClosed = $objStatus->Id;
             }
         }
         foreach ($growthGroupArray as $objGroup) {
             $intStatus = Group::Load($objGroup->GroupId)->Status;
             if ($intStatus != $intClosed) {
                 $newGrowthGroupArray[] = $objGroup;
             }
         }
         $growthGroupArray = $newGrowthGroupArray;
     }
     if ($this->chkLocation->Checked) {
         // Map to our existing Growth Group Locations
         $locationIdArray = array();
         $strLocationArray = array($this->objRegistrant->PreferredLocation1, $this->objRegistrant->PreferredLocation2);
         for ($i = 0; $i < 2; $i++) {
             if (null != $strLocationArray[$i]) {
                 switch ($strLocationArray[$i]) {
                     case 'Foster City':
                     case 'San Bruno':
                     case 'San Carlos':
                     case 'San Mateo':
                     case 'San Francisco':
                     case 'South San Francisco':
                         $locationIdArray[] = 1;
                         break;
                     case 'East Palo Alto':
                     case 'Mountain View':
                     case 'Menlo Park':
                     case 'Palo Alto':
                     case 'Redwood City':
                         $locationIdArray[] = 2;
                         break;
                     case 'Campbell':
                     case 'Cupertino':
                     case 'Los Altos':
                     case 'Sunnyvale':
                         $locationIdArray[] = 3;
                         break;
                     case 'San Jose':
                     case 'South San Jose':
                     case 'Santa Clara':
                         $locationIdArray[] = 4;
                         break;
                     case 'Fremont':
                     case 'Milpitas':
                     case 'Newark ':
                     case 'Pleasanton':
                     case 'Tracy':
                         $locationIdArray[] = 5;
                         break;
                     case 'Oakland':
                     case 'Clayton':
                         $locationIdArray[] = 6;
                         break;
                 }
             }
         }
         $newGrowthGroupArray = array();
         foreach ($growthGroupArray as $objGroup) {
             if (in_array($objGroup->GrowthGroupLocationId, $locationIdArray)) {
                 $newGrowthGroupArray[] = $objGroup;
             }
         }
         $growthGroupArray = $newGrowthGroupArray;
     }
     $this->dtgGroups->DataSource = $growthGroupArray;
 }
 protected function lstGrowthGroups_Update()
 {
     if ($this->lstGrowthGroups) {
         $this->objGrowthGroupStructure->UnassociateAllGrowthGroups();
         $objSelectedListItems = $this->lstGrowthGroups->SelectedItems;
         if ($objSelectedListItems) {
             foreach ($objSelectedListItems as $objListItem) {
                 $this->objGrowthGroupStructure->AssociateGrowthGroup(GrowthGroup::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 GrowthGroupMetaControl
  * @param integer $intGroupId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing GrowthGroup object creation - defaults to CreateOrEdit
  * @return GrowthGroupMetaControl
  */
 public static function Create($objParentObject, $intGroupId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intGroupId)) {
         $objGrowthGroup = GrowthGroup::Load($intGroupId);
         // GrowthGroup was found -- return it!
         if ($objGrowthGroup) {
             return new GrowthGroupMetaControl($objParentObject, $objGrowthGroup);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a GrowthGroup object with PK arguments: ' . $intGroupId);
             }
         }
         // 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 GrowthGroupMetaControl($objParentObject, new GrowthGroup());
 }
Beispiel #12
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;
             }
     }
 }
Beispiel #13
0
 /**
  * This will save this object's Group instance,
  * updating only the fields which have had a control created for it.
  */
 public function SaveGroup()
 {
     try {
         // Update any fields for controls that have been created
         if ($this->lstGroupType) {
             $this->objGroup->GroupTypeId = $this->lstGroupType->SelectedValue;
         }
         if ($this->lstMinistry) {
             $this->objGroup->MinistryId = $this->lstMinistry->SelectedValue;
         }
         if ($this->txtName) {
             $this->objGroup->Name = $this->txtName->Text;
         }
         if ($this->txtDescription) {
             $this->objGroup->Description = $this->txtDescription->Text;
         }
         if ($this->lstParentGroup) {
             $this->objGroup->ParentGroupId = $this->lstParentGroup->SelectedValue;
         }
         if ($this->txtHierarchyLevel) {
             $this->objGroup->HierarchyLevel = $this->txtHierarchyLevel->Text;
         }
         if ($this->txtHierarchyOrderNumber) {
             $this->objGroup->HierarchyOrderNumber = $this->txtHierarchyOrderNumber->Text;
         }
         if ($this->chkConfidentialFlag) {
             $this->objGroup->ConfidentialFlag = $this->chkConfidentialFlag->Checked;
         }
         if ($this->lstEmailBroadcastType) {
             $this->objGroup->EmailBroadcastTypeId = $this->lstEmailBroadcastType->SelectedValue;
         }
         if ($this->txtToken) {
             $this->objGroup->Token = $this->txtToken->Text;
         }
         if ($this->chkActiveFlag) {
             $this->objGroup->ActiveFlag = $this->chkActiveFlag->Checked;
         }
         if ($this->lstStatusObject) {
             $this->objGroup->Status = $this->lstStatusObject->SelectedValue;
         }
         // Update any UniqueReverseReferences (if any) for controls that have been created for it
         if ($this->lstGroupCategory) {
             $this->objGroup->GroupCategory = GroupCategory::Load($this->lstGroupCategory->SelectedValue);
         }
         if ($this->lstGrowthGroup) {
             $this->objGroup->GrowthGroup = GrowthGroup::Load($this->lstGrowthGroup->SelectedValue);
         }
         if ($this->lstSmartGroup) {
             $this->objGroup->SmartGroup = SmartGroup::Load($this->lstSmartGroup->SelectedValue);
         }
         // Save the Group object
         $this->objGroup->Save();
         // Finally, update any ManyToManyReferences (if any)
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
 }