protected function SetupPanel() { if (!$this->objGroup->IsLoginCanEdit(QApplication::$Login)) { $this->ReturnTo('/groups/'); } // See if Group can have Explicitly Defined Participants if (!$this->objGroup->IsGroupCanHaveExplicitlyDefinedParticipants()) { return $this->ReturnTo('#' . $this->objGroup->Id); } $this->pnlPerson = new SelectPersonPanel($this); $this->pnlPerson->Name = 'Participant'; $this->pnlPerson->AllowCreate = true; $this->pnlPerson->Required = true; $this->lstRole = new QListBox($this); $this->lstRole->Name = 'Role'; $this->lstRole->Required = true; $this->lstRole->AddItem('- Select One -'); foreach ($this->objGroup->Ministry->GetGroupRoleArray(QQ::OrderBy(QQN::GroupRole()->Name)) as $objGroupRole) { $this->lstRole->AddItem($objGroupRole->Name, $objGroupRole->Id); } $this->dtxDateStart = new QDateTimeTextBox($this); $this->dtxDateStart->Name = 'Participation Started'; $this->dtxDateStart->Required = true; $this->calDateStart = new QCalendar($this, $this->dtxDateStart); $this->dtxDateEnd = new QDateTimeTextBox($this); $this->dtxDateEnd->Name = 'Participation Ended'; $this->calDateEnd = new QCalendar($this, $this->dtxDateEnd); $this->dtxDateStart->RemoveAllActions(QClickEvent::EventName); $this->dtxDateEnd->RemoveAllActions(QClickEvent::EventName); $this->pnlPerson->txtName->Focus(); }
public function RefreshParticipationList() { $fltStartTime = microtime(true); $objGroupRole = GroupRole::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::GroupRole()->MinistryId, $this->Group->MinistryId), QQ::Equal(QQN::GroupRole()->GroupRoleTypeId, GroupRoleType::Participant)), QQ::OrderBy(QQN::GroupRole()->Id)); if (!$objGroupRole) { $objGroupRole = new GroupRole(); $objGroupRole->MinistryId = $this->Group->MinistryId; $objGroupRole->Name = 'Participant'; $objGroupRole->GroupRoleTypeId = GroupRoleType::Participant; $objGroupRole->Save(); } $this->Group->DeleteAllGroupParticipations(); $objPersonCursor = $this->SearchQuery->Execute(); while ($objPerson = Person::InstantiateCursor($objPersonCursor)) { $this->Group->AddPerson($objPerson, $objGroupRole->Id); } $fltEndTime = microtime(true); $this->dttDateRefreshed = QDateTime::Now(); $this->ProcessTimeMs = round(($fltEndTime - $fltStartTime) * 1000); $this->Save(); }
public function dlgEdit_Setup() { $this->dlgEdit = new QDialogBox($this->pnlContent); $this->dlgEdit->Template = dirname(__FILE__) . '/EditGroupParticipationDialog.tpl.php'; $this->dlgEdit->CssClass = 'dialogbox'; $this->dlgEdit->MatteClickable = false; $this->dlgEdit->HideDialogBox(); $this->lstEditRole = new QListBox($this->dlgEdit); $this->lstEditRole->Name = 'Role'; $this->lstEditRole->Required = true; $this->lstEditRole->Enabled = true; $this->lstEditRole->AddItem('- Select One -'); foreach ($this->pnlContent->objGroup->Ministry->GetGroupRoleArray(QQ::OrderBy(QQN::GroupRole()->Name)) as $objGroupRole) { $this->lstEditRole->AddItem($objGroupRole->Name, $objGroupRole->Id); } $this->dtxEditStart = new QDateTimeTextBox($this->dlgEdit); $this->dtxEditStart->Name = 'Started'; $this->dtxEditStart->Required = true; $this->calEditStart = new QCalendar($this->dlgEdit, $this->dtxEditStart); $this->dtxEditEnd = new QDateTimeTextBox($this->dlgEdit); $this->dtxEditEnd->Name = 'Ended'; $this->calEditEnd = new QCalendar($this->dlgEdit, $this->dtxEditEnd); $this->dtxEditStart->RemoveAllActions(QClickEvent::EventName); $this->dtxEditEnd->RemoveAllActions(QClickEvent::EventName); $this->btnEditOkay = new QButton($this->dlgEdit); $this->btnEditOkay->Text = 'Ok'; $this->btnEditOkay->CausesValidation = QCausesValidation::SiblingsAndChildren; $this->btnEditOkay->AddAction(new QClickEvent(), new QAjaxControlAction($this->pnlContent, 'btnEditOkay_Click')); $this->btnEditOkay->AddAction(new QClickEvent(), new QTerminateAction()); $this->btnEditCancel = new QLinkButton($this->dlgEdit); $this->btnEditCancel->Text = 'Cancel'; $this->btnEditCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this->pnlContent, 'btnEditCancel_Click')); $this->btnEditCancel->AddAction(new QClickEvent(), new QTerminateAction()); $this->btnEditDelete = new QLinkButton($this->dlgEdit); $this->btnEditDelete->Text = 'Delete'; $this->btnEditDelete->SetCustomStyle('margin-left', '0'); $this->btnEditDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this->pnlContent, 'btnEditDelete_Click')); $this->btnEditDelete->AddAction(new QClickEvent(), new QTerminateAction()); }
/** * Used internally by the Meta-based Add Column tools. * * Given a QQNode or a Text String, this will return a GroupRole-based QQNode. * It will also verify that it is a proper GroupRole-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 == 'group_role') { 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 "group_role".'); } } else { if (is_string($mixContent)) { switch ($mixContent) { case 'Id': return QQN::GroupRole()->Id; case 'MinistryId': return QQN::GroupRole()->MinistryId; case 'Ministry': return QQN::GroupRole()->Ministry; case 'Name': return QQN::GroupRole()->Name; case 'GroupRoleTypeId': return QQN::GroupRole()->GroupRoleTypeId; default: throw new QCallerException('Simple Property not found in GroupRoleDataGrid 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'); } } } }
protected function Form_Create() { $this->objGroupRegistration = new GroupRegistrations(); $this->mcGroupRegistration = new GroupRegistrationsMetaControl($this, $this->objGroupRegistration); $this->txtFirstName = $this->mcGroupRegistration->txtFirstName_Create(); $this->txtFirstName->Select(); $this->txtFirstName->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtFirstName->Required = true; $this->txtLastName = $this->mcGroupRegistration->txtLastName_Create(); $this->txtLastName->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtLastName->Required = true; $this->lstGender = new QListBox($this); $this->lstGender->Name = 'Gender'; $this->lstGender->AddItem('- Select One -'); $this->lstGender->AddItem('Female', 'F'); $this->lstGender->AddItem('Male', 'M'); $this->txtAddress = $this->mcGroupRegistration->txtAddress_Create(); $this->txtAddress->Name = 'Address'; $this->txtAddress->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtAddress->Required = true; $this->txtCity = $this->mcGroupRegistration->txtCity_Create(); $this->txtCity->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtCity->Required = true; $this->txtZipCode = $this->mcGroupRegistration->txtZipcode_Create(); $this->txtZipCode->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtZipCode->Required = true; $this->txtPhoneNumber = $this->mcGroupRegistration->txtPhone_Create(); $this->txtPhoneNumber->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtPhoneNumber->Required = true; $this->txtEmail = $this->mcGroupRegistration->txtEmail_Create(); $this->txtEmail->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->txtEmail->Required = true; $this->txtComments = $this->mcGroupRegistration->txtComments_Create(); $this->txtComments->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->lstSource = new QListBox($this); $this->lstSource->Name = 'How did you hear about us? '; $this->lstSource->Width = 250; $this->lstSource->AddItem('Choose...', 0); foreach (SourceList::LoadAll() as $objSourceList) { $this->lstSource->AddItem($objSourceList->Name, $objSourceList->Id); } $this->lstParticipationType = new QListBox($this); $this->lstParticipationType->Name = 'What would you like to be?'; $objRoleArray = Ministry::Load(17)->GetGroupRoleArray(QQ::OrderBy(QQN::GroupRole()->Name)); $this->lstParticipationType->AddItem('-Select One-'); foreach ($objRoleArray as $objRole) { $this->lstParticipationType->AddItem($objRole->Name, $objRole->Id); } $this->lstParticipationType->AddAction(new QChangeEvent(), new QAjaxAction('lstParticipationType_Change')); $this->lblMessage = new QLabel($this); $this->lblMessage->Text = ''; $this->lblMessage->ForeColor = 'red'; $this->lblMessage->HtmlEntities = false; $this->chkDaysAvailable = array(); foreach (GrowthGroupDayType::$NameArray as $key => $value) { $objChkDay = new QCheckBox($this); $objChkDay->Text = $value; $objChkDay->Name = $key; $this->chkDaysAvailable[] = $objChkDay; } $this->chkGroupType = array(); $objCondition = QQ::All(); $objGrowthGroupStructureCursor = GrowthGroupStructure::QueryCursor($objCondition); while ($objGrowthGroupStructure = GrowthGroupStructure::InstantiateCursor($objGrowthGroupStructureCursor)) { $objListItem = new QCheckBox($this); $objListItem->Text = $objGrowthGroupStructure->__toString(); $objListItem->Name = $objGrowthGroupStructure->Id; $this->chkGroupType[] = $objListItem; } $this->lstLocationFirst = new QListBox($this); $this->lstLocationFirst->Name = 'First Preference'; $this->lstLocationFirst->AddItem('Belmont'); $this->lstLocationFirst->AddItem('East Palo Alto'); $this->lstLocationFirst->AddItem('Fremont'); $this->lstLocationFirst->AddItem('Los Altos'); $this->lstLocationFirst->AddItem('Milpitas'); $this->lstLocationFirst->AddItem('Mountain View'); $this->lstLocationFirst->AddItem('Newark '); $this->lstLocationFirst->AddItem('Oakland'); $this->lstLocationFirst->AddItem('Palo Alto'); $this->lstLocationFirst->AddItem('San Francisco'); $this->lstLocationFirst->AddItem('San Jose'); $this->lstLocationFirst->AddItem('Santa Clara'); $this->lstLocationFirst->AddItem('South San Jose'); $this->lstLocationFirst->AddItem('Sunnyvale'); $this->lstLocationSecond = new QListBox($this); $this->lstLocationSecond->Name = 'Second Preference'; $this->lstLocationSecond->AddItem('Belmont'); $this->lstLocationSecond->AddItem('East Palo Alto'); $this->lstLocationSecond->AddItem('Fremont'); $this->lstLocationSecond->AddItem('Los Altos'); $this->lstLocationSecond->AddItem('Milpitas'); $this->lstLocationSecond->AddItem('Mountain View'); $this->lstLocationSecond->AddItem('Newark '); $this->lstLocationSecond->AddItem('Oakland'); $this->lstLocationSecond->AddItem('Palo Alto'); $this->lstLocationSecond->AddItem('San Francisco'); $this->lstLocationSecond->AddItem('San Jose'); $this->lstLocationSecond->AddItem('Santa Clara'); $this->lstLocationSecond->AddItem('South San Jose'); $this->lstLocationSecond->AddItem('Sunnyvale'); $this->btnSubmit = new QButton($this); $this->btnSubmit->Name = 'Submit'; $this->btnSubmit->Text = 'Submit'; $this->btnSubmit->CssClass = 'primary'; $this->btnSubmit->AddAction(new QClickEvent(), new QAjaxAction('btnSubmit_Click')); $this->btnSubmit->CausesValidation = true; $this->btnCancel = new QButton($this); $this->btnCancel->Name = 'Cancel'; $this->btnCancel->Text = 'Cancel'; $this->btnCancel->CssClass = 'primary'; }
/** * Count GroupRoles * by GroupRoleTypeId Index(es) * @param integer $intGroupRoleTypeId * @return int */ public static function CountByGroupRoleTypeId($intGroupRoleTypeId, $objOptionalClauses = null) { // Call GroupRole::QueryCount to perform the CountByGroupRoleTypeId query return GroupRole::QueryCount(QQ::Equal(QQN::GroupRole()->GroupRoleTypeId, $intGroupRoleTypeId), $objOptionalClauses); }
public function dtgRoles_Bind() { $this->dtgRoles->DataSource = $this->objMinistry->GetGroupRoleArray(QQ::OrderBy(QQN::GroupRole()->Name)); }