Exemplo n.º 1
0
 public function pxyUnassociate_Click($strFormId, $strControlId, $strParameter)
 {
     $objIndividual = ParentPagerIndividual::Load($strParameter);
     $objIndividual->Person = null;
     $objIndividual->Save();
     $objIndividual->RefreshParentPagerSyncStatusType();
     $this->Refresh();
 }
 /**
  * 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 ParentPagerIndividualMetaControl
  * @param integer $intId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing ParentPagerIndividual object creation - defaults to CreateOrEdit
  * @return ParentPagerIndividualMetaControl
  */
 public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intId)) {
         $objParentPagerIndividual = ParentPagerIndividual::Load($intId);
         // ParentPagerIndividual was found -- return it!
         if ($objParentPagerIndividual) {
             return new ParentPagerIndividualMetaControl($objParentObject, $objParentPagerIndividual);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a ParentPagerIndividual 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 ParentPagerIndividualMetaControl($objParentObject, new ParentPagerIndividual());
 }
Exemplo n.º 3
0
 /**
  * Reload this ParentPagerIndividual 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 ParentPagerIndividual object.');
     }
     // Reload the Object
     $objReloaded = ParentPagerIndividual::Load($this->intId);
     // Update $this's local variables to match
     $this->intServerIdentifier = $objReloaded->intServerIdentifier;
     $this->PersonId = $objReloaded->PersonId;
     $this->blnHiddenFlag = $objReloaded->blnHiddenFlag;
     $this->ParentPagerSyncStatusTypeId = $objReloaded->ParentPagerSyncStatusTypeId;
     $this->ParentPagerHouseholdId = $objReloaded->ParentPagerHouseholdId;
     $this->strFirstName = $objReloaded->strFirstName;
     $this->strMiddleName = $objReloaded->strMiddleName;
     $this->strLastName = $objReloaded->strLastName;
     $this->strPrefix = $objReloaded->strPrefix;
     $this->strSuffix = $objReloaded->strSuffix;
     $this->strNickname = $objReloaded->strNickname;
     $this->intGraduationYear = $objReloaded->intGraduationYear;
     $this->strGender = $objReloaded->strGender;
     $this->dttDateOfBirth = $objReloaded->dttDateOfBirth;
 }
Exemplo n.º 4
0
Arquivo: link.php Projeto: alcf/chms
 protected function Form_Create()
 {
     $this->objParentPagerIndividual = ParentPagerIndividual::Load(QApplication::PathInfo(0));
     if (!$this->objParentPagerIndividual) {
         QApplication::Redirect('/sk/');
     }
     $this->pnlSelectPerson = new SelectPersonPanel($this);
     $this->pnlSelectPerson->Required = true;
     $this->pnlSelectPerson->Name = 'Search NOAH';
     $this->pnlSelectPerson->txtName->Text = $this->objParentPagerIndividual->FirstName . ' ' . $this->objParentPagerIndividual->LastName;
     $this->pnlSelectPerson->txtName_Change();
     $this->pnlSelectPerson->AllowCreate = true;
     switch (strtoupper($this->objParentPagerIndividual->Gender)) {
         case 'M':
             $this->pnlSelectPerson->lstGender->SelectedValue = 'M';
             break;
         case 'F':
             $this->pnlSelectPerson->lstGender->SelectedValue = 'F';
             break;
     }
     if ($this->objParentPagerIndividual->DateOfBirth) {
         $this->pnlSelectPerson->dtxDateOfBirth->Text = $this->objParentPagerIndividual->DateOfBirth->ToString('MMM D YYYY');
     }
     // Report DataGrids
     if ($this->objParentPagerIndividual->CountParentPagerAttendantHistories()) {
         $this->dtgAttendantHistory = new ParentPagerAttendantHistoryDataGrid($this);
         $this->dtgAttendantHistory->MetaAddColumn('DateIn', 'Width=125px', 'FontSize=10px');
         $this->dtgAttendantHistory->MetaAddColumn('DateOut', 'Width=125px', 'FontSize=10px');
         $this->dtgAttendantHistory->MetaAddColumn(QQN::ParentPagerAttendantHistory()->ParentPagerStation->Name, 'Name=Station', 'Width=160px');
         $this->dtgAttendantHistory->MetaAddColumn(QQN::ParentPagerAttendantHistory()->ParentPagerPeriod->Name, 'Name=Period', 'Width=150px');
         $this->dtgAttendantHistory->MetaAddColumn(QQN::ParentPagerAttendantHistory()->ParentPagerProgram->Name, 'Name=Program', 'Width=150px');
         $this->dtgAttendantHistory->SetDataBinder('dtgAttendantHistory_Bind');
         $this->dtgAttendantHistory->Paginator = new QPaginator($this->dtgAttendantHistory);
         $this->dtgAttendantHistory->SortColumnIndex = 0;
         $this->dtgAttendantHistory->SortDirection = 1;
         $this->dtgAttendantHistory->FontSize = '11px';
     }
     if ($this->objParentPagerIndividual->CountParentPagerChildHistories() || $this->objParentPagerIndividual->CountParentPagerChildHistoriesAsPickupBy() || $this->objParentPagerIndividual->CountParentPagerChildHistoriesAsDropoffBy()) {
         $this->dtgChildHistory = new ParentPagerChildHistoryDataGrid($this);
         $this->dtgChildHistory->MetaAddColumn('DateIn', 'Width=125px', 'FontSize=10px');
         $this->dtgChildHistory->MetaAddColumn('DateOut', 'Width=125px', 'FontSize=10px');
         $this->dtgChildHistory->MetaAddColumn(QQN::ParentPagerChildHistory()->ParentPagerIndividual->FirstName, 'Name=Child', 'Width=80px');
         $this->dtgChildHistory->MetaAddColumn(QQN::ParentPagerChildHistory()->PickupByParentPagerIndividual->FirstName, 'Name=Pick Up', 'Width=70px');
         $this->dtgChildHistory->MetaAddColumn(QQN::ParentPagerChildHistory()->DropoffByParentPagerIndividual->FirstName, 'Name=Drop Off', 'Width=70px');
         $this->dtgChildHistory->MetaAddColumn(QQN::ParentPagerChildHistory()->ParentPagerStation->Name, 'Name=Station', 'Width=150px');
         $this->dtgChildHistory->MetaAddColumn(QQN::ParentPagerChildHistory()->ParentPagerPeriod->Name, 'Name=Period', 'Width=70px');
         $this->dtgChildHistory->SetDataBinder('dtgChildHistory_Bind');
         $this->dtgChildHistory->Paginator = new QPaginator($this->dtgChildHistory);
         $this->dtgChildHistory->SortColumnIndex = 0;
         $this->dtgChildHistory->SortDirection = 1;
         $this->dtgChildHistory->FontSize = '11px';
     }
     // Buttons
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = 'Link to NOAH';
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnSave->CausesValidation = true;
     $this->btnSave->CssClass = 'primary';
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
     $this->btnCancel->CssClass = 'cancel';
     $this->btnHideToggle = new QLinkButton($this);
     $this->btnHideToggle->Text = $this->objParentPagerIndividual->HiddenFlag ? 'Unhide This Unlinked Record' : 'Hide This Unlinked Record';
     $this->btnHideToggle->AddAction(new QClickEvent(), new QAjaxAction('btnHideToggle_Click'));
     $this->btnHideToggle->AddAction(new QClickEvent(), new QTerminateAction());
     $this->btnHideToggle->CssClass = 'delete';
     $this->btnHideToggle->SetCustomStyle('margin-left', 0);
     if ($this->objParentPagerIndividual->ParentPagerSyncStatusTypeId != ParentPagerSyncStatusType::NotYetSynced) {
         $this->btnHideToggle->Visible = false;
     }
 }
Exemplo 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 'ServerIdentifier':
             // Gets the value for intServerIdentifier (Unique)
             // @return integer
             return $this->intServerIdentifier;
         case 'ParentPagerIndividualId':
             // Gets the value for intParentPagerIndividualId
             // @return integer
             return $this->intParentPagerIndividualId;
         case 'ParentPagerHouseholdId':
             // Gets the value for intParentPagerHouseholdId
             // @return integer
             return $this->intParentPagerHouseholdId;
         case 'Address1':
             // Gets the value for strAddress1
             // @return string
             return $this->strAddress1;
         case 'Address2':
             // Gets the value for strAddress2
             // @return string
             return $this->strAddress2;
         case 'Address3':
             // Gets the value for strAddress3
             // @return string
             return $this->strAddress3;
         case 'City':
             // Gets the value for strCity
             // @return string
             return $this->strCity;
         case 'State':
             // Gets the value for strState
             // @return string
             return $this->strState;
         case 'ZipCode':
             // Gets the value for strZipCode
             // @return string
             return $this->strZipCode;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'ParentPagerIndividual':
             // Gets the value for the ParentPagerIndividual object referenced by intParentPagerIndividualId
             // @return ParentPagerIndividual
             try {
                 if (!$this->objParentPagerIndividual && !is_null($this->intParentPagerIndividualId)) {
                     $this->objParentPagerIndividual = ParentPagerIndividual::Load($this->intParentPagerIndividualId);
                 }
                 return $this->objParentPagerIndividual;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ParentPagerHousehold':
             // Gets the value for the ParentPagerHousehold object referenced by intParentPagerHouseholdId
             // @return ParentPagerHousehold
             try {
                 if (!$this->objParentPagerHousehold && !is_null($this->intParentPagerHouseholdId)) {
                     $this->objParentPagerHousehold = ParentPagerHousehold::Load($this->intParentPagerHouseholdId);
                 }
                 return $this->objParentPagerHousehold;
             } 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;
             }
     }
 }
 /**
  * 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 'ServerIdentifier':
             // Gets the value for intServerIdentifier (Unique)
             // @return integer
             return $this->intServerIdentifier;
         case 'ParentPagerIndividualId':
             // Gets the value for intParentPagerIndividualId (Not Null)
             // @return integer
             return $this->intParentPagerIndividualId;
         case 'ParentPagerStationId':
             // Gets the value for intParentPagerStationId
             // @return integer
             return $this->intParentPagerStationId;
         case 'ParentPagerPeriodId':
             // Gets the value for intParentPagerPeriodId
             // @return integer
             return $this->intParentPagerPeriodId;
         case 'DropoffByParentPagerIndividualId':
             // Gets the value for intDropoffByParentPagerIndividualId
             // @return integer
             return $this->intDropoffByParentPagerIndividualId;
         case 'PickupByParentPagerIndividualId':
             // Gets the value for intPickupByParentPagerIndividualId
             // @return integer
             return $this->intPickupByParentPagerIndividualId;
         case 'DateIn':
             // Gets the value for dttDateIn (Not Null)
             // @return QDateTime
             return $this->dttDateIn;
         case 'DateOut':
             // Gets the value for dttDateOut (Not Null)
             // @return QDateTime
             return $this->dttDateOut;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'ParentPagerIndividual':
             // Gets the value for the ParentPagerIndividual object referenced by intParentPagerIndividualId (Not Null)
             // @return ParentPagerIndividual
             try {
                 if (!$this->objParentPagerIndividual && !is_null($this->intParentPagerIndividualId)) {
                     $this->objParentPagerIndividual = ParentPagerIndividual::Load($this->intParentPagerIndividualId);
                 }
                 return $this->objParentPagerIndividual;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ParentPagerStation':
             // Gets the value for the ParentPagerStation object referenced by intParentPagerStationId
             // @return ParentPagerStation
             try {
                 if (!$this->objParentPagerStation && !is_null($this->intParentPagerStationId)) {
                     $this->objParentPagerStation = ParentPagerStation::Load($this->intParentPagerStationId);
                 }
                 return $this->objParentPagerStation;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ParentPagerPeriod':
             // Gets the value for the ParentPagerPeriod object referenced by intParentPagerPeriodId
             // @return ParentPagerPeriod
             try {
                 if (!$this->objParentPagerPeriod && !is_null($this->intParentPagerPeriodId)) {
                     $this->objParentPagerPeriod = ParentPagerPeriod::Load($this->intParentPagerPeriodId);
                 }
                 return $this->objParentPagerPeriod;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'DropoffByParentPagerIndividual':
             // Gets the value for the ParentPagerIndividual object referenced by intDropoffByParentPagerIndividualId
             // @return ParentPagerIndividual
             try {
                 if (!$this->objDropoffByParentPagerIndividual && !is_null($this->intDropoffByParentPagerIndividualId)) {
                     $this->objDropoffByParentPagerIndividual = ParentPagerIndividual::Load($this->intDropoffByParentPagerIndividualId);
                 }
                 return $this->objDropoffByParentPagerIndividual;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'PickupByParentPagerIndividual':
             // Gets the value for the ParentPagerIndividual object referenced by intPickupByParentPagerIndividualId
             // @return ParentPagerIndividual
             try {
                 if (!$this->objPickupByParentPagerIndividual && !is_null($this->intPickupByParentPagerIndividualId)) {
                     $this->objPickupByParentPagerIndividual = ParentPagerIndividual::Load($this->intPickupByParentPagerIndividualId);
                 }
                 return $this->objPickupByParentPagerIndividual;
             } 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;
             }
     }
 }
Exemplo n.º 7
0
 public function pxyLinkIndividual_Click($strFormid, $strControlId, $strParameter)
 {
     $objIndividual = ParentPagerIndividual::Load($strParameter);
     $objIndividual->Person = $this->objPerson;
     $objIndividual->Save();
     $objIndividual->RefreshParentPagerSyncStatusType();
     $this->ReturnTo('#sk');
 }