Esempio n. 1
0
File: roles.php Progetto: alcf/chms
 protected function pxyEditRole_Click($strFormId, $strControlId, $strParameter)
 {
     $objGroupRole = GroupRole::Load($strParameter);
     if (!$objGroupRole || $objGroupRole->MinistryId != $this->objMinistry->Id) {
         $this->objGroupRole = new GroupRole();
         $this->objGroupRole->Ministry = $this->objMinistry;
         $this->btnSave->Text = 'Create New Role';
         $this->txtName->Text = null;
         $this->lstType->SelectedValue = null;
     } else {
         $this->objGroupRole = $objGroupRole;
         $this->btnSave->Text = 'Update Role';
         $this->txtName->Text = $objGroupRole->Name;
         $this->lstType->SelectedValue = $objGroupRole->GroupRoleTypeId;
     }
     $this->txtName->Focus();
     $this->pnlEditRole->Visible = true;
 }
 /**
  * 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 GroupRoleMetaControl
  * @param integer $intId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing GroupRole object creation - defaults to CreateOrEdit
  * @return GroupRoleMetaControl
  */
 public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intId)) {
         $objGroupRole = GroupRole::Load($intId);
         // GroupRole was found -- return it!
         if ($objGroupRole) {
             return new GroupRoleMetaControl($objParentObject, $objGroupRole);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a GroupRole 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 GroupRoleMetaControl($objParentObject, new GroupRole());
 }
Esempio n. 3
0
 /**
  * Reload this GroupRole 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 GroupRole object.');
     }
     // Reload the Object
     $objReloaded = GroupRole::Load($this->intId);
     // Update $this's local variables to match
     $this->MinistryId = $objReloaded->MinistryId;
     $this->strName = $objReloaded->strName;
     $this->GroupRoleTypeId = $objReloaded->GroupRoleTypeId;
 }
Esempio n. 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 'PersonId':
             // Gets the value for intPersonId (Not Null)
             // @return integer
             return $this->intPersonId;
         case 'GroupId':
             // Gets the value for intGroupId (Not Null)
             // @return integer
             return $this->intGroupId;
         case 'GroupRoleId':
             // Gets the value for intGroupRoleId
             // @return integer
             return $this->intGroupRoleId;
         case 'DateStart':
             // Gets the value for dttDateStart (Not Null)
             // @return QDateTime
             return $this->dttDateStart;
         case 'DateEnd':
             // Gets the value for dttDateEnd
             // @return QDateTime
             return $this->dttDateEnd;
         case 'Status':
             // Gets the value for intStatus
             // @return integer
             return $this->intStatus;
         case 'DateFollowup':
             // Gets the value for dttDateFollowup
             // @return QDateTime
             return $this->dttDateFollowup;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'Person':
             // Gets the value for the Person object referenced by intPersonId (Not Null)
             // @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;
             }
         case 'Group':
             // Gets the value for the Group object referenced by intGroupId (Not Null)
             // @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 'GroupRole':
             // Gets the value for the GroupRole object referenced by intGroupRoleId
             // @return GroupRole
             try {
                 if (!$this->objGroupRole && !is_null($this->intGroupRoleId)) {
                     $this->objGroupRole = GroupRole::Load($this->intGroupRoleId);
                 }
                 return $this->objGroupRole;
             } 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;
             }
     }
 }
Esempio n. 5
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 'SourceListId':
             // Gets the value for intSourceListId (Not Null)
             // @return integer
             return $this->intSourceListId;
         case 'DateReceived':
             // Gets the value for dttDateReceived
             // @return QDateTime
             return $this->dttDateReceived;
         case 'FirstName':
             // Gets the value for strFirstName
             // @return string
             return $this->strFirstName;
         case 'LastName':
             // Gets the value for strLastName
             // @return string
             return $this->strLastName;
         case 'Gender':
             // Gets the value for strGender
             // @return string
             return $this->strGender;
         case 'Address':
             // Gets the value for strAddress
             // @return string
             return $this->strAddress;
         case 'Phone':
             // Gets the value for strPhone
             // @return string
             return $this->strPhone;
         case 'Email':
             // Gets the value for strEmail
             // @return string
             return $this->strEmail;
         case 'Comments':
             // Gets the value for strComments
             // @return string
             return $this->strComments;
         case 'GroupRoleId':
             // Gets the value for intGroupRoleId
             // @return integer
             return $this->intGroupRoleId;
         case 'PreferredLocation1':
             // Gets the value for strPreferredLocation1
             // @return string
             return $this->strPreferredLocation1;
         case 'PreferredLocation2':
             // Gets the value for strPreferredLocation2
             // @return string
             return $this->strPreferredLocation2;
         case 'City':
             // Gets the value for strCity
             // @return string
             return $this->strCity;
         case 'Zipcode':
             // Gets the value for strZipcode
             // @return string
             return $this->strZipcode;
         case 'GroupDay':
             // Gets the value for strGroupDay
             // @return string
             return $this->strGroupDay;
         case 'GroupsPlaced':
             // Gets the value for strGroupsPlaced
             // @return string
             return $this->strGroupsPlaced;
         case 'DateProcessed':
             // Gets the value for dttDateProcessed
             // @return QDateTime
             return $this->dttDateProcessed;
         case 'ProcessedFlag':
             // Gets the value for blnProcessedFlag
             // @return boolean
             return $this->blnProcessedFlag;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'SourceList':
             // Gets the value for the SourceList object referenced by intSourceListId (Not Null)
             // @return SourceList
             try {
                 if (!$this->objSourceList && !is_null($this->intSourceListId)) {
                     $this->objSourceList = SourceList::Load($this->intSourceListId);
                 }
                 return $this->objSourceList;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'GroupRole':
             // Gets the value for the GroupRole object referenced by intGroupRoleId
             // @return GroupRole
             try {
                 if (!$this->objGroupRole && !is_null($this->intGroupRoleId)) {
                     $this->objGroupRole = GroupRole::Load($this->intGroupRoleId);
                 }
                 return $this->objGroupRole;
             } 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 '_GrowthGroupStructureAsGroupstructure':
             // Gets the value for the private _objGrowthGroupStructureAsGroupstructure (Read-Only)
             // if set due to an expansion on the groupregistrations_groupstructure_assn association table
             // @return GrowthGroupStructure
             return $this->_objGrowthGroupStructureAsGroupstructure;
         case '_GrowthGroupStructureAsGroupstructureArray':
             // Gets the value for the private _objGrowthGroupStructureAsGroupstructureArray (Read-Only)
             // if set due to an ExpandAsArray on the groupregistrations_groupstructure_assn association table
             // @return GrowthGroupStructure[]
             return (array) $this->_objGrowthGroupStructureAsGroupstructureArray;
         case '__Restored':
             return $this->__blnRestored;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Esempio n. 6
0
 public function RenderGroupRole(GroupRegistrations $objGroupRegistration)
 {
     if ($objGroupRegistration->GroupRoleId) {
         return GroupRole::Load($objGroupRegistration->GroupRoleId)->Name;
     } else {
         return 'Not Selected';
     }
 }