コード例 #1
0
 /**
  * Refresh this MetaControl with Data from the local GroupParticipation object.
  * @param boolean $blnReload reload GroupParticipation from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objGroupParticipation->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objGroupParticipation->Id;
         }
     }
     if ($this->lstPerson) {
         $this->lstPerson->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstPerson->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objPersonArray = Person::LoadAll();
         if ($objPersonArray) {
             foreach ($objPersonArray as $objPerson) {
                 $objListItem = new QListItem($objPerson->__toString(), $objPerson->Id);
                 if ($this->objGroupParticipation->Person && $this->objGroupParticipation->Person->Id == $objPerson->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstPerson->AddItem($objListItem);
             }
         }
     }
     if ($this->lblPersonId) {
         $this->lblPersonId->Text = $this->objGroupParticipation->Person ? $this->objGroupParticipation->Person->__toString() : null;
     }
     if ($this->lstGroup) {
         $this->lstGroup->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstGroup->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objGroupArray = Group::LoadAll();
         if ($objGroupArray) {
             foreach ($objGroupArray as $objGroup) {
                 $objListItem = new QListItem($objGroup->__toString(), $objGroup->Id);
                 if ($this->objGroupParticipation->Group && $this->objGroupParticipation->Group->Id == $objGroup->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstGroup->AddItem($objListItem);
             }
         }
     }
     if ($this->lblGroupId) {
         $this->lblGroupId->Text = $this->objGroupParticipation->Group ? $this->objGroupParticipation->Group->__toString() : null;
     }
     if ($this->lstGroupRole) {
         $this->lstGroupRole->RemoveAllItems();
         $this->lstGroupRole->AddItem(QApplication::Translate('- Select One -'), null);
         $objGroupRoleArray = GroupRole::LoadAll();
         if ($objGroupRoleArray) {
             foreach ($objGroupRoleArray as $objGroupRole) {
                 $objListItem = new QListItem($objGroupRole->__toString(), $objGroupRole->Id);
                 if ($this->objGroupParticipation->GroupRole && $this->objGroupParticipation->GroupRole->Id == $objGroupRole->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstGroupRole->AddItem($objListItem);
             }
         }
     }
     if ($this->lblGroupRoleId) {
         $this->lblGroupRoleId->Text = $this->objGroupParticipation->GroupRole ? $this->objGroupParticipation->GroupRole->__toString() : null;
     }
     if ($this->calDateStart) {
         $this->calDateStart->DateTime = $this->objGroupParticipation->DateStart;
     }
     if ($this->lblDateStart) {
         $this->lblDateStart->Text = sprintf($this->objGroupParticipation->DateStart) ? $this->objGroupParticipation->__toString($this->strDateStartDateTimeFormat) : null;
     }
     if ($this->calDateEnd) {
         $this->calDateEnd->DateTime = $this->objGroupParticipation->DateEnd;
     }
     if ($this->lblDateEnd) {
         $this->lblDateEnd->Text = sprintf($this->objGroupParticipation->DateEnd) ? $this->objGroupParticipation->__toString($this->strDateEndDateTimeFormat) : null;
     }
     if ($this->txtStatus) {
         $this->txtStatus->Text = $this->objGroupParticipation->Status;
     }
     if ($this->lblStatus) {
         $this->lblStatus->Text = $this->objGroupParticipation->Status;
     }
     if ($this->calDateFollowup) {
         $this->calDateFollowup->DateTime = $this->objGroupParticipation->DateFollowup;
     }
     if ($this->lblDateFollowup) {
         $this->lblDateFollowup->Text = sprintf($this->objGroupParticipation->DateFollowup) ? $this->objGroupParticipation->__toString($this->strDateFollowupDateTimeFormat) : null;
     }
 }
コード例 #2
0
 /**
  * Refresh this MetaControl with Data from the local GroupRegistrations object.
  * @param boolean $blnReload reload GroupRegistrations from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objGroupRegistrations->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objGroupRegistrations->Id;
         }
     }
     if ($this->lstSourceList) {
         $this->lstSourceList->RemoveAllItems();
         if (!$this->blnEditMode) {
             $this->lstSourceList->AddItem(QApplication::Translate('- Select One -'), null);
         }
         $objSourceListArray = SourceList::LoadAll();
         if ($objSourceListArray) {
             foreach ($objSourceListArray as $objSourceList) {
                 $objListItem = new QListItem($objSourceList->__toString(), $objSourceList->Id);
                 if ($this->objGroupRegistrations->SourceList && $this->objGroupRegistrations->SourceList->Id == $objSourceList->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstSourceList->AddItem($objListItem);
             }
         }
     }
     if ($this->lblSourceListId) {
         $this->lblSourceListId->Text = $this->objGroupRegistrations->SourceList ? $this->objGroupRegistrations->SourceList->__toString() : null;
     }
     if ($this->calDateReceived) {
         $this->calDateReceived->DateTime = $this->objGroupRegistrations->DateReceived;
     }
     if ($this->lblDateReceived) {
         $this->lblDateReceived->Text = sprintf($this->objGroupRegistrations->DateReceived) ? $this->objGroupRegistrations->__toString($this->strDateReceivedDateTimeFormat) : null;
     }
     if ($this->txtFirstName) {
         $this->txtFirstName->Text = $this->objGroupRegistrations->FirstName;
     }
     if ($this->lblFirstName) {
         $this->lblFirstName->Text = $this->objGroupRegistrations->FirstName;
     }
     if ($this->txtLastName) {
         $this->txtLastName->Text = $this->objGroupRegistrations->LastName;
     }
     if ($this->lblLastName) {
         $this->lblLastName->Text = $this->objGroupRegistrations->LastName;
     }
     if ($this->txtGender) {
         $this->txtGender->Text = $this->objGroupRegistrations->Gender;
     }
     if ($this->lblGender) {
         $this->lblGender->Text = $this->objGroupRegistrations->Gender;
     }
     if ($this->txtAddress) {
         $this->txtAddress->Text = $this->objGroupRegistrations->Address;
     }
     if ($this->lblAddress) {
         $this->lblAddress->Text = $this->objGroupRegistrations->Address;
     }
     if ($this->txtPhone) {
         $this->txtPhone->Text = $this->objGroupRegistrations->Phone;
     }
     if ($this->lblPhone) {
         $this->lblPhone->Text = $this->objGroupRegistrations->Phone;
     }
     if ($this->txtEmail) {
         $this->txtEmail->Text = $this->objGroupRegistrations->Email;
     }
     if ($this->lblEmail) {
         $this->lblEmail->Text = $this->objGroupRegistrations->Email;
     }
     if ($this->txtComments) {
         $this->txtComments->Text = $this->objGroupRegistrations->Comments;
     }
     if ($this->lblComments) {
         $this->lblComments->Text = $this->objGroupRegistrations->Comments;
     }
     if ($this->lstGroupRole) {
         $this->lstGroupRole->RemoveAllItems();
         $this->lstGroupRole->AddItem(QApplication::Translate('- Select One -'), null);
         $objGroupRoleArray = GroupRole::LoadAll();
         if ($objGroupRoleArray) {
             foreach ($objGroupRoleArray as $objGroupRole) {
                 $objListItem = new QListItem($objGroupRole->__toString(), $objGroupRole->Id);
                 if ($this->objGroupRegistrations->GroupRole && $this->objGroupRegistrations->GroupRole->Id == $objGroupRole->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstGroupRole->AddItem($objListItem);
             }
         }
     }
     if ($this->lblGroupRoleId) {
         $this->lblGroupRoleId->Text = $this->objGroupRegistrations->GroupRole ? $this->objGroupRegistrations->GroupRole->__toString() : null;
     }
     if ($this->txtPreferredLocation1) {
         $this->txtPreferredLocation1->Text = $this->objGroupRegistrations->PreferredLocation1;
     }
     if ($this->lblPreferredLocation1) {
         $this->lblPreferredLocation1->Text = $this->objGroupRegistrations->PreferredLocation1;
     }
     if ($this->txtPreferredLocation2) {
         $this->txtPreferredLocation2->Text = $this->objGroupRegistrations->PreferredLocation2;
     }
     if ($this->lblPreferredLocation2) {
         $this->lblPreferredLocation2->Text = $this->objGroupRegistrations->PreferredLocation2;
     }
     if ($this->txtCity) {
         $this->txtCity->Text = $this->objGroupRegistrations->City;
     }
     if ($this->lblCity) {
         $this->lblCity->Text = $this->objGroupRegistrations->City;
     }
     if ($this->txtZipcode) {
         $this->txtZipcode->Text = $this->objGroupRegistrations->Zipcode;
     }
     if ($this->lblZipcode) {
         $this->lblZipcode->Text = $this->objGroupRegistrations->Zipcode;
     }
     if ($this->txtGroupDay) {
         $this->txtGroupDay->Text = $this->objGroupRegistrations->GroupDay;
     }
     if ($this->lblGroupDay) {
         $this->lblGroupDay->Text = $this->objGroupRegistrations->GroupDay;
     }
     if ($this->txtGroupsPlaced) {
         $this->txtGroupsPlaced->Text = $this->objGroupRegistrations->GroupsPlaced;
     }
     if ($this->lblGroupsPlaced) {
         $this->lblGroupsPlaced->Text = $this->objGroupRegistrations->GroupsPlaced;
     }
     if ($this->calDateProcessed) {
         $this->calDateProcessed->DateTime = $this->objGroupRegistrations->DateProcessed;
     }
     if ($this->lblDateProcessed) {
         $this->lblDateProcessed->Text = sprintf($this->objGroupRegistrations->DateProcessed) ? $this->objGroupRegistrations->__toString($this->strDateProcessedDateTimeFormat) : null;
     }
     if ($this->chkProcessedFlag) {
         $this->chkProcessedFlag->Checked = $this->objGroupRegistrations->ProcessedFlag;
     }
     if ($this->lblProcessedFlag) {
         $this->lblProcessedFlag->Text = $this->objGroupRegistrations->ProcessedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->lstGrowthGroupStructuresAsGroupstructure) {
         $this->lstGrowthGroupStructuresAsGroupstructure->RemoveAllItems();
         $objAssociatedArray = $this->objGroupRegistrations->GetGrowthGroupStructureAsGroupstructureArray();
         $objGrowthGroupStructureArray = GrowthGroupStructure::LoadAll();
         if ($objGrowthGroupStructureArray) {
             foreach ($objGrowthGroupStructureArray as $objGrowthGroupStructure) {
                 $objListItem = new QListItem($objGrowthGroupStructure->__toString(), $objGrowthGroupStructure->Id);
                 foreach ($objAssociatedArray as $objAssociated) {
                     if ($objAssociated->Id == $objGrowthGroupStructure->Id) {
                         $objListItem->Selected = true;
                     }
                 }
                 $this->lstGrowthGroupStructuresAsGroupstructure->AddItem($objListItem);
             }
         }
     }
     if ($this->lblGrowthGroupStructuresAsGroupstructure) {
         $objAssociatedArray = $this->objGroupRegistrations->GetGrowthGroupStructureAsGroupstructureArray();
         $strItems = array();
         foreach ($objAssociatedArray as $objAssociated) {
             $strItems[] = $objAssociated->__toString();
         }
         $this->lblGrowthGroupStructuresAsGroupstructure->Text = implode($strGlue, $strItems);
     }
 }
コード例 #3
0
 public function __construct($objParentObject, $objRegistrant, $intPersonId, $strMethodCallBack, $strControlId = null)
 {
     // First, let's call the Parent's __constructor
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     $this->strTemplate = dirname(__FILE__) . '/' . get_class($this) . '.tpl.php';
     // Next, we set the local registrant object
     $this->objRegistrant = $objRegistrant;
     $this->intPersonId = $intPersonId;
     $this->strMethodCallBack = $strMethodCallBack;
     $strGroupTypes = '';
     foreach (GrowthGroupStructure::LoadAll() as $objGroupStructure) {
         if ($this->objRegistrant->IsGrowthGroupStructureAsGroupstructureAssociated($objGroupStructure)) {
             $strGroupTypes .= $objGroupStructure->Name . ', ';
         }
     }
     $strGroupTypes = substr($strGroupTypes, 0, strlen($strGroupTypes) - 1);
     $this->lblRegistrantInfo = new QLabel($this);
     $this->lblRegistrantInfo->HtmlEntities = false;
     $this->lblRegistrantInfo->HtmlBefore = 'For: ';
     $this->lblRegistrantInfo->Text = sprintf('%s %s<br>Requested Group Types: %s<br>Requested Days: %s<br>Preferred Locations: %s, %s', $this->objRegistrant->FirstName, $this->objRegistrant->LastName, $strGroupTypes, $this->objRegistrant->GroupDay, $this->objRegistrant->PreferredLocation1, $this->objRegistrant->PreferredLocation2);
     $this->chkLocation = new QCheckBox($this);
     $this->chkLocation->Text = 'Location';
     $this->chkLocation->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'dtgGroups_Refresh'));
     $this->chkGroupType = new QCheckBox($this);
     $this->chkGroupType->Text = 'Group Type';
     $this->chkGroupType->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'dtgGroups_Refresh'));
     $this->chkDayOfWeek = new QCheckBox($this);
     $this->chkDayOfWeek->Text = 'Day Of Week';
     $this->chkDayOfWeek->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'dtgGroups_Refresh'));
     $this->chkAvailability = new QCheckBox($this);
     $this->chkAvailability->Text = 'Availability';
     $this->chkAvailability->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'dtgGroups_Refresh'));
     $this->rbtnSelectArray = array();
     // Now initialize the controls
     $this->dtgGroups = new GrowthGroupDataGrid($this);
     $this->dtgGroups->Paginator = new QPaginator($this->dtgGroups);
     $this->dtgGroups->AddColumn(new QDataGridColumn('', '<?= $_CONTROL->ParentControl->RenderSelectGroup($_ITEM); ?>', 'HtmlEntities=false'));
     $this->dtgGroups->AddColumn(new QDataGridColumn('Name', '<?= $_CONTROL->ParentControl->RenderName($_ITEM); ?>', 'HtmlEntities=false'));
     $this->dtgGroups->AddColumn(new QDataGridColumn('Description', '<?= $_CONTROL->ParentControl->RenderDescription($_ITEM); ?>', 'HtmlEntities=false'));
     $this->dtgGroups->AddColumn(new QDataGridColumn('Group Type', '<?= $_CONTROL->ParentControl->RenderGroupStructure($_ITEM); ?>', 'HtmlEntities=false'));
     $this->dtgGroups->MetaAddTypeColumn('GrowthGroupDayTypeId', 'GrowthGroupDayType');
     $this->dtgGroups->AddColumn(new QDataGridColumn('Location Region', '<?= $_CONTROL->ParentControl->RenderLocationRegion($_ITEM); ?>', 'HtmlEntities=false'));
     $this->dtgGroups->AddColumn(new QDataGridColumn('Group Facilitator', '<?= $_CONTROL->ParentControl->RenderFacilitator($_ITEM); ?>', 'HtmlEntities=false'));
     $this->dtgGroups->NoDataHtml = 'No results found.  Please use a less-restrictive filter.';
     $this->dtgGroups->SetDataBinder('dtgGroups_Bind', $this);
     $this->btnAssign = new QButton($this);
     $this->btnAssign->Text = 'Assign ' . $this->objRegistrant->FirstName . ' ' . $this->objRegistrant->LastName . ' to the selected groups';
     $this->btnAssign->CssClass = 'primary';
     $this->btnAssign->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnAssign_Click'));
     $this->intFacilitatorRoleId = 0;
     $this->intGroupContactRoleId = 0;
     foreach (GroupRole::LoadAll() as $objGroupRole) {
         if ($objGroupRole->Name == 'Facilitator' && $objGroupRole->MinistryId == Ministry::LoadByToken('growth')->Id) {
             $this->intFacilitatorRoleId = $objGroupRole->Id;
         }
         if ($objGroupRole->Name == 'Group Contact' && $objGroupRole->MinistryId == Ministry::LoadByToken('growth')->Id) {
             $this->intGroupContactRoleId = $objGroupRole->Id;
         }
     }
 }