protected function SetupPanel() { if ($this->objPerson->CountParentPagerIndividuals()) { if (ParentPagerAttendantHistory::QueryCount(QQ::Equal(QQN::ParentPagerAttendantHistory()->ParentPagerIndividual->PersonId, $this->objPerson->Id))) { $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); $this->dtgAttendantHistory->Paginator = new QPaginator($this->dtgAttendantHistory); $this->dtgAttendantHistory->SortColumnIndex = 0; $this->dtgAttendantHistory->SortDirection = 1; $this->dtgAttendantHistory->FontSize = '11px'; } if (QApplication::$Login->IsPermissionAllowed(PermissionType::ManageSafariKids) && (ParentPagerChildHistory::QueryCount(QQ::Equal(QQN::ParentPagerChildHistory()->ParentPagerIndividual->PersonId, $this->objPerson->Id)) || ParentPagerChildHistory::QueryCount(QQ::Equal(QQN::ParentPagerChildHistory()->PickupByParentPagerIndividual->PersonId, $this->objPerson->Id)) || ParentPagerChildHistory::QueryCount(QQ::Equal(QQN::ParentPagerChildHistory()->DropoffByParentPagerIndividual->PersonId, $this->objPerson->Id)))) { $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); $this->dtgChildHistory->Paginator = new QPaginator($this->dtgChildHistory); $this->dtgChildHistory->SortColumnIndex = 0; $this->dtgChildHistory->SortDirection = 1; $this->dtgChildHistory->FontSize = '11px'; } $this->dtgParentPagerIndividuals = new ParentPagerIndividualDataGrid($this); $this->dtgParentPagerIndividuals->MetaAddColumn('ServerIdentifier', 'Name=Parent Pager ID', 'Html=<?= $_CONTROL->ParentControl->RenderIdentifier($_ITEM); ?>', 'Width=120px', 'HtmlEntities=false'); $this->dtgParentPagerIndividuals->MetaAddColumn('FirstName', 'Width=125px', 'FontSize=10px'); $this->dtgParentPagerIndividuals->MetaAddColumn('MiddleName', 'Width=125px', 'FontSize=10px'); $this->dtgParentPagerIndividuals->MetaAddColumn('LastName', 'Width=125px', 'FontSize=10px'); $this->dtgParentPagerIndividuals->AddColumn(new QDataGridColumn('Address(es)', '<?= $_CONTROL->ParentControl->RenderAddresses($_ITEM); ?>', 'Width=200px', 'HtmlEntities=false')); $this->dtgParentPagerIndividuals->SetDataBinder('ParentPagerIndividuals_Bind', $this); $this->dtgParentPagerIndividuals->SortColumnIndex = 0; $this->dtgParentPagerIndividuals->FontSize = '11px'; } $this->pxyUnassociate = new QControlProxy($this); $this->pxyUnassociate->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to UNASSOCIATE this ParentPagerIndividual record from this NOAH Person?')); $this->pxyUnassociate->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyUnassociate_Click')); $this->pxyUnassociate->AddAction(new QClickEvent(), new QTerminateAction()); }
/** * Main utility method to aid with data binding. It is used by the default BindAllRows() databinder but * could and should be used by any custom databind methods that would be used for instances of this * MetaDataGrid, by simply passing in a custom QQCondition and/or QQClause. * * If a paginator is set on this DataBinder, it will use it. If not, then no pagination will be used. * It will also perform any sorting (if applicable). * * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query * @return void */ public function MetaDataBinder(QQCondition $objCondition = null, $objOptionalClauses = null) { // Setup input parameters to default values if none passed in if (!$objCondition) { $objCondition = QQ::All(); } $objClauses = $objOptionalClauses ? $objOptionalClauses : array(); // We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below if ($this->Paginator) { $this->TotalItemCount = ParentPagerChildHistory::QueryCount($objCondition, $objClauses); } // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add // the OrderByClause to the $objClauses array if ($objClause = $this->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be a Query result from ParentPagerChildHistory, given the clauses above $this->DataSource = ParentPagerChildHistory::QueryArray($objCondition, $objClauses); }
/** * Count ParentPagerChildHistories * by PickupByParentPagerIndividualId Index(es) * @param integer $intPickupByParentPagerIndividualId * @return int */ public static function CountByPickupByParentPagerIndividualId($intPickupByParentPagerIndividualId, $objOptionalClauses = null) { // Call ParentPagerChildHistory::QueryCount to perform the CountByPickupByParentPagerIndividualId query return ParentPagerChildHistory::QueryCount(QQ::Equal(QQN::ParentPagerChildHistory()->PickupByParentPagerIndividualId, $intPickupByParentPagerIndividualId), $objOptionalClauses); }