/** * Refresh this MetaControl with Data from the local GrowthGroupStructure object. * @param boolean $blnReload reload GrowthGroupStructure from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objGrowthGroupStructure->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objGrowthGroupStructure->Id; } } if ($this->txtName) { $this->txtName->Text = $this->objGrowthGroupStructure->Name; } if ($this->lblName) { $this->lblName->Text = $this->objGrowthGroupStructure->Name; } if ($this->lstGroupRegistrationsesAsGroupstructure) { $this->lstGroupRegistrationsesAsGroupstructure->RemoveAllItems(); $objAssociatedArray = $this->objGrowthGroupStructure->GetGroupRegistrationsAsGroupstructureArray(); $objGroupRegistrationsArray = GroupRegistrations::LoadAll(); if ($objGroupRegistrationsArray) { foreach ($objGroupRegistrationsArray as $objGroupRegistrations) { $objListItem = new QListItem($objGroupRegistrations->__toString(), $objGroupRegistrations->Id); foreach ($objAssociatedArray as $objAssociated) { if ($objAssociated->Id == $objGroupRegistrations->Id) { $objListItem->Selected = true; } } $this->lstGroupRegistrationsesAsGroupstructure->AddItem($objListItem); } } } if ($this->lblGroupRegistrationsesAsGroupstructure) { $objAssociatedArray = $this->objGrowthGroupStructure->GetGroupRegistrationsAsGroupstructureArray(); $strItems = array(); foreach ($objAssociatedArray as $objAssociated) { $strItems[] = $objAssociated->__toString(); } $this->lblGroupRegistrationsesAsGroupstructure->Text = implode($strGlue, $strItems); } if ($this->lstGrowthGroups) { $this->lstGrowthGroups->RemoveAllItems(); $objAssociatedArray = $this->objGrowthGroupStructure->GetGrowthGroupArray(); $objGrowthGroupArray = GrowthGroup::LoadAll(); if ($objGrowthGroupArray) { foreach ($objGrowthGroupArray as $objGrowthGroup) { $objListItem = new QListItem($objGrowthGroup->__toString(), $objGrowthGroup->GroupId); foreach ($objAssociatedArray as $objAssociated) { if ($objAssociated->GroupId == $objGrowthGroup->GroupId) { $objListItem->Selected = true; } } $this->lstGrowthGroups->AddItem($objListItem); } } } if ($this->lblGrowthGroups) { $objAssociatedArray = $this->objGrowthGroupStructure->GetGrowthGroupArray(); $strItems = array(); foreach ($objAssociatedArray as $objAssociated) { $strItems[] = $objAssociated->__toString(); } $this->lblGrowthGroups->Text = implode($strGlue, $strItems); } }