当前位置: 首页>>代码示例>>PHP>>正文


PHP QQN::HouseholdParticipation方法代码示例

本文整理汇总了PHP中QQN::HouseholdParticipation方法的典型用法代码示例。如果您正苦于以下问题:PHP QQN::HouseholdParticipation方法的具体用法?PHP QQN::HouseholdParticipation怎么用?PHP QQN::HouseholdParticipation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QQN的用法示例。


在下文中一共展示了QQN::HouseholdParticipation方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Form_Create

 protected function Form_Create()
 {
     // Setup Household Object
     $this->objHousehold = Household::Load(QApplication::PathInfo(0));
     if (!$this->objHousehold) {
         QApplication::Redirect('/households/');
     }
     $this->strPageTitle .= $this->objHousehold->Name;
     // Setup DataGrids
     $this->dtgMembers = new HouseholdParticipationDataGrid($this);
     $this->dtgMembers->AddColumn(new QDataGridColumn('Remove', '<?= $_FORM->RenderRadio($_ITEM); ?>', 'Width=80px', 'HtmlEntities=false'));
     $this->dtgMembers->MetaAddColumn('Role', 'Width=80px');
     $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->FirstName, 'Name=Name', 'Html=<?= $_ITEM->Person->LinkHtml; ?>', 'HtmlEntities=false', 'Width=300px');
     $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryEmail->Address, 'Name=Email', 'Width=250px');
     $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryPhone->Number, 'Name=Phone', 'Width=200px');
     $this->dtgMembers->GetColumn(0)->OrderByClause = null;
     $this->dtgMembers->GetColumn(1)->OrderByClause = null;
     $this->dtgMembers->GetColumn(2)->OrderByClause = null;
     $this->dtgMembers->GetColumn(3)->OrderByClause = null;
     $this->dtgMembers->GetColumn(4)->OrderByClause = null;
     $this->dtgMembers->DataSource = $this->objHousehold->GetOrderedParticipantArray();
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = 'Remove';
     $this->btnSave->CssClass = 'primary';
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnSave->CausesValidation = true;
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->CssClass = 'cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
     $this->dlgMessage = new MessageDialog($this);
 }
开发者ID:alcf,项目名称:chms,代码行数:33,代码来源:remove.php

示例2: Form_Create

 protected function Form_Create()
 {
     // Setup Household Object
     $this->objHousehold = Household::Load(QApplication::PathInfo(0));
     if (!$this->objHousehold) {
         QApplication::Redirect('/households/');
     }
     $this->strPageTitle .= $this->objHousehold->Name;
     $this->lblHeadline = new QLabel($this);
     $this->lblHeadline->TagName = 'h3';
     $this->lblHeadline->Text = 'Select Individual(s) to Split Off';
     // Setup DataGrids
     $this->dtgMembers = new HouseholdParticipationDataGrid($this);
     $this->dtgMembers->AddColumn(new QDataGridColumn('Select', '<?= $_FORM->RenderRadio($_ITEM); ?>', 'Width=80px', 'HtmlEntities=false'));
     $this->dtgMembers->MetaAddColumn('Role', 'Width=80px');
     $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->FirstName, 'Name=Name', 'Html=<?= $_ITEM->Person->LinkHtml; ?>', 'HtmlEntities=false', 'Width=300px');
     $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryEmail->Address, 'Name=Email', 'Width=250px');
     $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryPhoneText, 'Name=Phone', 'Width=200px');
     $this->dtgMembers->GetColumn(0)->OrderByClause = null;
     $this->dtgMembers->GetColumn(1)->OrderByClause = null;
     $this->dtgMembers->GetColumn(2)->OrderByClause = null;
     $this->dtgMembers->GetColumn(3)->OrderByClause = null;
     $this->dtgMembers->GetColumn(4)->OrderByClause = null;
     $this->dtgMembers->SetDataBinder('dtgMembers_Bind');
     $this->lstHead = new QListBox($this);
     $this->lstHead->Name = 'Head of New Household';
     $this->lstHead->Visible = false;
     $this->pnlAddress = new EditHouseholdHomeAddressPanel($this);
     $this->pnlAddress->Visible = false;
     $this->lstHead->Name = 'Head of New Household';
     $this->lstHead->Visible = false;
     $this->btnNext = new QButton($this);
     $this->btnNext->Text = 'Next';
     $this->btnNext->CssClass = 'primary';
     $this->btnNext->AddAction(new QClickEvent(), new QAjaxAction('btnNext_Click'));
     $this->btnNext->CausesValidation = true;
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = 'Save Changes';
     $this->btnSave->CssClass = 'primary';
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnSave->CausesValidation = true;
     $this->btnSave->Visible = false;
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->CssClass = 'cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
     $this->dlgMessage = new MessageDialog($this);
 }
开发者ID:alcf,项目名称:chms,代码行数:49,代码来源:split.php

示例3: Form_Create

 protected function Form_Create()
 {
     // Setup Household Object
     $this->objHousehold = Household::Load(QApplication::PathInfo(0));
     if (!$this->objHousehold) {
         QApplication::Redirect('/households/');
     }
     $this->strPageTitle .= $this->objHousehold->Name;
     // Setup DataGrids
     $this->dtgMembers = new HouseholdParticipationDataGrid($this);
     $this->dtgMembers->MetaAddColumn('Role', 'Width=80px', 'Html=<?= $_ITEM->RoleToDisplay; ?>');
     $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->FirstName, 'Name=Name', 'Html=<?= $_ITEM->Person->LinkHtml; ?>', 'HtmlEntities=false', 'Width=300px');
     $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryEmail->Address, 'Name=Email', 'Width=250px');
     $this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryPhone->Number, 'Name=Phone', 'Width=290px');
     $this->dtgMembers->GetColumn(0)->OrderByClause = null;
     $this->dtgMembers->GetColumn(1)->OrderByClause = null;
     $this->dtgMembers->GetColumn(2)->OrderByClause = null;
     $this->dtgMembers->GetColumn(3)->OrderByClause = null;
     $this->dtgMembers->SetDataBinder('dtgMembers_Bind');
     $this->dtgHomeAddresses = new QDataGrid($this);
     $this->dtgHomeAddresses->AddColumn(new QDataGridColumn('', '<?= $_FORM->RenderHomeAddressType($_ITEM); ?>', 'HtmlEntities=false', 'Width=60px'));
     $this->dtgHomeAddresses->AddColumn(new QDataGridColumn('Address', '<?= $_FORM->RenderHomeAddress($_ITEM); ?>', 'HtmlEntities=false', 'Width=235px'));
     $this->dtgHomeAddresses->AddColumn(new QDataGridColumn('City, State', '<?= $_ITEM->City . ", " . $_ITEM->State; ?>', 'Width=160px'));
     $this->dtgHomeAddresses->AddColumn(new QDataGridColumn('Zip', '<?= $_ITEM->ZipCode; ?>', 'Width=90px'));
     $this->dtgHomeAddresses->AddColumn(new QDataGridColumn('Phone', '<?= $_FORM->RenderHomePhone($_ITEM); ?>', 'Width=105px'));
     $this->dtgHomeAddresses->AddColumn(new QDataGridColumn('', '<?= $_ITEM->InvalidFlag ? "<img src=\\"/assets/images/marker_invalid.png\\" title=\\"Invalid Address\\"/>" : null; ?>', 'Width=54px', 'HtmlEntities=false'));
     $this->dtgHomeAddresses->SetDataBinder('dtgHomeAddresses_Bind', $this);
     $this->pxySetCurrentHomeAddress = new QControlProxy($this);
     $this->pxySetCurrentHomeAddress->AddAction(new QClickEvent(), new QAjaxAction('pxySetCurrentHomeAddress_Click'));
     $this->pxySetCurrentHomeAddress->AddAction(new QClickEvent(), new QTerminateAction());
     // Display Stewardship Preferences?
     if (QApplication::IsLoginHasPermission(PermissionType::AccessStewardship)) {
         $this->lblStewardship = new QLabel($this);
         $this->lblStewardship->HtmlEntities = false;
         $this->lblStewardship_Refresh();
         $this->pxyStewardship = new QControlProxy($this);
         $this->pxyStewardship->AddAction(new QClickEvent(), new QAjaxAction('pxyStewardship_Click'));
         $this->pxyStewardship->AddAction(new QClickEvent(), new QTerminateAction());
     }
 }
开发者ID:alcf,项目名称:chms,代码行数:40,代码来源:view.php

示例4: SetAsCurrentAddress

 /**
  * Sets the address record as the "Current" address, and all others as "Previous"
  * Address MUST be associated with the household or this will throw an exception
  * @param Address $objCurrentAddress
  * @return void
  */
 public function SetAsCurrentAddress(Address $objCurrentAddress)
 {
     if ($objCurrentAddress->HouseholdId != $this->intId) {
         throw new QCallerException('Address does not belong to this Household');
     }
     // Get any home address and home phone records for this household (and any from-split households)
     $intAddressIdArray = array();
     $intPhoneIdArray = array();
     foreach ($this->GetAddressArray() as $objAddress) {
         if ($objAddress->Id != $objCurrentAddress->Id && $objAddress->CurrentFlag) {
             $objAddress->CurrentFlag = false;
             $objAddress->Save();
         }
         $intAddressIdArray[$objAddress->Id] = true;
         foreach ($objAddress->GetPhoneArray() as $objPhone) {
             $intPhoneIdArray[$objPhone->Id] = true;
         }
     }
     // Add any old HomeAddresses from previous households
     foreach ($this->GetHouseholdSplitAsSplitArray() as $objHouseholdSplit) {
         foreach ($objHouseholdSplit->Household->GetAddressArray() as $objAddress) {
             $intAddressIdArray[$objAddress->Id] = true;
             foreach ($objAddress->GetPhoneArray() as $objPhone) {
                 $intPhoneIdArray[$objPhone->Id] = true;
             }
         }
     }
     if (!$objCurrentAddress->CurrentFlag) {
         $objCurrentAddress->CurrentFlag = true;
         $objCurrentAddress->Save();
     }
     // Update "MailingAddress" and "StewardshipAddress" info for HouseholdParticipants
     // Update "PrimaryAddressText" info for HouseholdParticipants
     foreach ($this->GetHouseholdParticipationArray(QQ::Expand(QQN::HouseholdParticipation()->Person->Id)) as $objHouseholdParticipation) {
         $objPerson = $objHouseholdParticipation->Person;
         if (array_key_exists($objPerson->MailingAddressId, $intAddressIdArray)) {
             $objPerson->MailingAddress = $objCurrentAddress;
         }
         if (array_key_exists($objPerson->StewardshipAddressId, $intAddressIdArray)) {
             $objPerson->StewardshipAddress = $objCurrentAddress;
         }
         if (array_key_exists($objPerson->PrimaryPhoneId, $intPhoneIdArray)) {
             $objPerson->PrimaryPhone = $objCurrentAddress->PrimaryPhone;
         }
         $objPerson->RefreshPrimaryContactInfo();
     }
 }
开发者ID:alcf,项目名称:chms,代码行数:53,代码来源:Household.class.php

示例5: CountByHouseholdId

 /**
  * Count HouseholdParticipations
  * by HouseholdId Index(es)
  * @param integer $intHouseholdId
  * @return int
  */
 public static function CountByHouseholdId($intHouseholdId, $objOptionalClauses = null)
 {
     // Call HouseholdParticipation::QueryCount to perform the CountByHouseholdId query
     return HouseholdParticipation::QueryCount(QQ::Equal(QQN::HouseholdParticipation()->HouseholdId, $intHouseholdId), $objOptionalClauses);
 }
开发者ID:alcf,项目名称:chms,代码行数:11,代码来源:HouseholdParticipationGen.class.php

示例6: ResolveContentItem

 /**
  * Used internally by the Meta-based Add Column tools.
  *
  * Given a QQNode or a Text String, this will return a HouseholdParticipation-based QQNode.
  * It will also verify that it is a proper HouseholdParticipation-based QQNode, and will throw an exception otherwise.
  *
  * @param mixed $mixContent
  * @return QQNode
  */
 protected function ResolveContentItem($mixContent)
 {
     if ($mixContent instanceof QQNode) {
         if (!$mixContent->_ParentNode) {
             throw new QCallerException('Content QQNode cannot be a Top Level Node');
         }
         if ($mixContent->_RootTableName == 'household_participation') {
             if ($mixContent instanceof QQReverseReferenceNode && !$mixContent->_PropertyName) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             }
             $objCurrentNode = $mixContent;
             while ($objCurrentNode = $objCurrentNode->_ParentNode) {
                 if (!$objCurrentNode instanceof QQNode) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
                 if ($objCurrentNode instanceof QQReverseReferenceNode && !$objCurrentNode->_PropertyName) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
             }
             return $mixContent;
         } else {
             throw new QCallerException('Content QQNode has a root table of "' . $mixContent->_RootTableName . '". Must be a root of "household_participation".');
         }
     } else {
         if (is_string($mixContent)) {
             switch ($mixContent) {
                 case 'Id':
                     return QQN::HouseholdParticipation()->Id;
                 case 'PersonId':
                     return QQN::HouseholdParticipation()->PersonId;
                 case 'Person':
                     return QQN::HouseholdParticipation()->Person;
                 case 'HouseholdId':
                     return QQN::HouseholdParticipation()->HouseholdId;
                 case 'Household':
                     return QQN::HouseholdParticipation()->Household;
                 case 'Role':
                     return QQN::HouseholdParticipation()->Role;
                 case 'RoleOverride':
                     return QQN::HouseholdParticipation()->RoleOverride;
                 default:
                     throw new QCallerException('Simple Property not found in HouseholdParticipationDataGrid content: ' . $mixContent);
             }
         } else {
             if ($mixContent instanceof QQAssociationNode) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             } else {
                 throw new QCallerException('Invalid Content type');
             }
         }
     }
 }
开发者ID:alcf,项目名称:chms,代码行数:61,代码来源:HouseholdParticipationDataGridGen.class.php


注:本文中的QQN::HouseholdParticipation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。