All() public static method

public static All ( )
Example #1
0
File: index.php Project: alcf/chms
 public function dtgStaff_Bind()
 {
     $objConditions = QQ::All();
     if ($this->lstMinistry->SelectedValue) {
         $objConditions = QQ::AndCondition($objConditions, QQ::Equal(QQN::Login()->Ministry->MinistryId, $this->lstMinistry->SelectedValue));
     }
     if ($this->lstActiveFlag->SelectedValue) {
         $objConditions = QQ::AndCondition($objConditions, QQ::Equal(QQN::Login()->DomainActiveFlag, true), QQ::Equal(QQN::Login()->LoginActiveFlag, true));
     } else {
         $objConditions = QQ::AndCondition($objConditions, QQ::OrCondition(QQ::Equal(QQN::Login()->DomainActiveFlag, false), QQ::Equal(QQN::Login()->LoginActiveFlag, false)));
     }
     $this->dtgStaff->TotalItemCount = Login::QueryCount($objConditions);
     // Setup the $objClauses Array
     $objClauses = array();
     // 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->dtgStaff->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->dtgStaff->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be a Query result from Login, given the clauses above
     $this->dtgStaff->DataSource = Login::QueryArray($objConditions, $objClauses);
 }
Example #2
0
 /**
  * Create and setup QListBox lstParentGroup
  * Overrides code-generated version by providing full hierarchy and NOT allowing for "looped families"
  * @param string $strControlId optional ControlId to use
  * @param QQCondition $objConditions not used
  * @param QQClause[] $objOptionalClauses not used
  * @return QListBox
  */
 public function lstParentGroup_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null)
 {
     $this->lstParentGroup = new QListBox($this->objParentObject, $strControlId);
     $this->lstParentGroup->Name = QApplication::Translate('Parent Group');
     $this->lstParentGroup->AddItem(QApplication::Translate('- None -'), null);
     $this->lstParentGroup->HtmlEntities = false;
     // Setup and perform the Query
     if (is_null($objCondition)) {
         $objCondition = QQ::All();
     }
     $objParentGroupCursor = Group::QueryCursor($objCondition, $objOptionalClauses);
     $intLevelToSkipUntil = null;
     foreach (Group::LoadOrderedArrayByMinistryIdAndConfidentiality($this->objGroup->MinistryId, false) as $objGroup) {
         if ($objGroup->Id == $this->objGroup->Id) {
             $intLevelToSkipUntil = $objGroup->HierarchyLevel;
         } else {
             if (!is_null($intLevelToSkipUntil) && $objGroup->HierarchyLevel <= $intLevelToSkipUntil) {
                 $intLevelToSkipUntil = null;
             }
         }
         if (is_null($intLevelToSkipUntil) && $objGroup->GroupTypeId == GroupType::GroupCategory) {
             $strName = $objGroup->Name;
             if ($objGroup->HierarchyLevel) {
                 $strName = str_repeat('&nbsp;', $objGroup->HierarchyLevel * 3) . '&gt; ' . QApplication::HtmlEntities($strName);
             }
             $objListItem = new QListItem($strName, $objGroup->Id);
             if ($this->objGroup->ParentGroup && $this->objGroup->ParentGroup->Id == $objGroup->Id) {
                 $objListItem->Selected = true;
             }
             $this->lstParentGroup->AddItem($objListItem);
         }
     }
     // Return the QListBox
     return $this->lstParentGroup;
 }
 protected function SetupPanel()
 {
     $this->mctPledge = StewardshipPledgeMetaControl::Create($this, $this->strUrlHashArgument, QMetaControlCreateType::CreateOnRecordNotFound);
     if (!$this->mctPledge->EditMode) {
         // Trying to create a NEW comment
         $this->mctPledge->StewardshipPledge->DateStarted = QDateTime::Now();
         $this->mctPledge->StewardshipPledge->Person = $this->objPerson;
         $this->mctPledge->StewardshipPledge->FulfilledFlag = false;
         $this->mctPledge->StewardshipPledge->ActiveFlag = true;
         $this->btnSave->Text = 'Create';
     } else {
         $this->btnSave->Text = 'Update';
         $this->btnDelete = new QLinkButton($this);
         $this->btnDelete->Text = 'Delete';
         $this->btnDelete->CssClass = 'delete';
         $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to DELETE this pledge?'));
         $this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
         $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
     }
     // Create Controls
     $this->lstStewardshipFund = $this->mctPledge->lstStewardshipFund_Create(null, QQ::All(), array(QQ::OrderBy(QQN::StewardshipFund()->Name)));
     $this->calDateStarted = $this->mctPledge->calDateStarted_Create();
     $this->calDateEnded = $this->mctPledge->calDateEnded_Create();
     $this->txtPledgeAmount = $this->mctPledge->txtPledgeAmount_Create();
     $this->chkActiveFlag = $this->mctPledge->chkActiveFlag_Create();
     $this->chkActiveFlag->Text = 'Note: All fulfilled pledges automatically considred "inactive".';
     $this->calDateStarted->MinimumYear = 2000;
     $this->calDateStarted->MaximumYear = date('Y') + 10;
     $this->calDateEnded->MinimumYear = 2000;
     $this->calDateEnded->MaximumYear = date('Y') + 10;
 }
Example #4
0
 public function dtgWikiItems_Bind()
 {
     $objCondition = QQ::All();
     if (trim($this->txtTitle->Text)) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Like(QQN::WikiItem()->CurrentName, '%' . trim($this->txtTitle->Text) . '%'));
     }
     if ($strPath = trim($this->txtPath->Text)) {
         $strPath = WikiItem::SanitizeForPath($strPath, $intWikiItemTypeId);
         $objCondition = QQ::AndCondition($objCondition, QQ::Like(QQN::WikiItem()->Path, $strPath . '%'));
     }
     if ($intValue = $this->lstWikiItemType->SelectedValue) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::WikiItem()->WikiItemTypeId, $intValue));
     }
     if (trim($this->txtPostedBy->Text)) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Like(QQN::WikiItem()->CurrentPostedByPerson->DisplayName, trim($this->txtPostedBy->Text) . '%'));
     }
     $this->dtgWikiItems->TotalItemCount = WikiItem::QueryCount($objCondition);
     $objClauses = array();
     if ($objClause = $this->dtgWikiItems->LimitClause) {
         $objClauses[] = $objClause;
     }
     if ($objClause = $this->dtgWikiItems->OrderByClause) {
         $objClauses[] = $objClause;
     }
     $this->dtgWikiItems->DataSource = WikiItem::QueryArray($objCondition, $objClauses);
 }
Example #5
0
File: index.php Project: alcf/chms
 public function dtgParentPagerIndividual_Bind()
 {
     $objCondition = QQ::All();
     if (strlen($strText = trim($this->txtServerIdentifier->Text))) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::ParentPagerIndividual()->ServerIdentifier, $strText));
     }
     if (strlen($strText = trim($this->txtFirstName->Text))) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Like(QQN::ParentPagerIndividual()->FirstName, $strText . '%'));
     }
     if (strlen($strText = trim($this->txtLastName->Text))) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Like(QQN::ParentPagerIndividual()->LastName, $strText . '%'));
     }
     if ($intId = $this->lstParentPagerSyncStatusTypeId->SelectedValue) {
         if ($intId == -1) {
             $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::ParentPagerIndividual()->HiddenFlag, true));
         } else {
             $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::ParentPagerIndividual()->ParentPagerSyncStatusTypeId, $intId), QQ::OrCondition(QQ::Equal(QQN::ParentPagerIndividual()->HiddenFlag, false), QQ::IsNull(QQN::ParentPagerIndividual()->HiddenFlag)));
         }
     }
     if ($strValue = $this->lstGender->SelectedValue) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::ParentPagerIndividual()->Gender, $strValue));
     }
     if (strlen($strText = trim($this->txtGraduationYear->Text))) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::ParentPagerIndividual()->GraduationYear, $strText));
     }
     $this->dtgParentPagerIndividuals->MetaDataBinder($objCondition);
 }
Example #6
0
 /**
  * This constructor will only be executed once - afterwards,
  * the state of the control will be stored into the $_SESSION
  * and, on future loads, populated from the session state.
  */
 public function __construct($objParentObject)
 {
     parent::__construct($objParentObject);
     $projects = Project::QueryArray(QQ::All(), QQ::OrderBy(QQN::Project()->Name));
     foreach ($projects as $project) {
         $this->AddItem($project->Name, $project->Id);
     }
 }
Example #7
0
 protected function dtgGroupRegistration_Bind()
 {
     $objConditions = QQ::All();
     $objClauses = QQ::Clause($this->dtgGroupRegistrations->OrderByClause);
     if (!$this->chkShowInactive->Checked) {
         $objConditions = QQ::AndCondition($objConditions, QQ::OrCondition(QQ::Equal(QQN::GroupRegistrations()->ProcessedFlag, false), QQ::IsNull(QQN::GroupRegistrations()->ProcessedFlag)));
     }
     $this->dtgGroupRegistrations->DataSource = GroupRegistrations::QueryArray($objConditions, $objClauses);
 }
Example #8
0
File: index.php Project: alcf/chms
 public function dtgFunds_Bind()
 {
     $objCondition = QQ::All();
     if (!is_null($blnOption = $this->lstActiveFlag->SelectedValue)) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::StewardshipFund()->ActiveFlag, $blnOption));
     }
     if (!is_null($blnOption = $this->lstExternalFlag->SelectedValue)) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::StewardshipFund()->ExternalFlag, $blnOption));
     }
     $this->dtgFunds->MetaDataBinder($objCondition);
 }
Example #9
0
 public function testGroupBy()
 {
     $objItems = Project::QueryArray(QQ::All(), QQ::Clause(QQ::GroupBy(QQN::Project()->Id), QQ::Count(QQN::Project()->PersonAsTeamMember->PersonId, 'team_member_count')));
     $this->assertEqual(sizeof($objItems), 4, "4 projects found");
     $this->assertEqual($objItems[0]->Name, "ACME Website Redesign", "Project " . $objItems[0]->Name . " found");
     $this->assertEqual($objItems[0]->GetVirtualAttribute('team_member_count'), 5, "5 team members found for project " . $objItems[0]->Name);
     $this->assertEqual($objItems[1]->Name, "State College HR System", "Project " . $objItems[1]->Name . " found");
     $this->assertEqual($objItems[1]->GetVirtualAttribute('team_member_count'), 6, "6 team members found for project " . $objItems[1]->Name);
     $this->assertEqual($objItems[2]->Name, "Blueman Industrial Site Architecture", "Project " . $objItems[2]->Name . " found");
     $this->assertEqual($objItems[2]->GetVirtualAttribute('team_member_count'), 5, "5 team members found for project " . $objItems[2]->Name);
 }
Example #10
0
 /**
  * This constructor will only be executed once - afterwards,
  * the state of the control will be stored into the $_SESSION
  * and, on future loads, populated from the session state.
  */
 public function __construct($objParentObject, $strControlId)
 {
     parent::__construct($objParentObject, $strControlId);
     $projects = Project::QueryArray(QQ::All(), QQ::OrderBy(QQN::Project()->Name));
     foreach ($projects as $project) {
         $this->AddItem($project->Name, $project->Id);
     }
     // Reset the status of the parent form's label to indicate
     // that the query was actually run
     $objParentObject->lblStatus->Text = "The query was executed";
 }
Example #11
0
 protected function BindData()
 {
     if ($strFilter = $this->dtgTable->Search["search"]) {
         $objCondition = QQ::OrCondition(QQ::Like(QQN::Person()->FirstName, '%' . $strFilter . '%'), QQ::Like(QQN::Person()->LastName, '%' . $strFilter . '%'));
     } else {
         $objCondition = QQ::All();
     }
     $this->dtgTable->TotalItemCount = Person::QueryCount($objCondition);
     $objClauses[] = $this->dtgTable->OrderByClause;
     $objClauses[] = $this->dtgTable->LimitClause;
     $this->dtgTable->DataSource = Person::QueryArray($objCondition, $objClauses);
 }
Example #12
0
 protected function dtgBatches_Bind()
 {
     $objCondition = QQ::All();
     if (strlen($strText = trim($this->txtDescription->Text))) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Like(QQN::StewardshipBatch()->Description, $strText . '%'));
     }
     if ($this->lstCreatedBy->SelectedValue) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::StewardshipBatch()->CreatedByLoginId, $this->lstCreatedBy->SelectedValue));
     }
     if ($this->lstStatus->SelectedValue) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::StewardshipBatch()->StewardshipBatchStatusTypeId, $this->lstStatus->SelectedValue));
     }
     $this->dtgBatches->MetaDataBinder($objCondition);
 }
 protected function dtgProjects_Bind()
 {
     $this->dtgProjects->TotalItemCount = Project::QueryCount(QQ::All());
     // 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->dtgProjects->OrderByClause) {
         $objClauses[] = $objClause;
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->dtgProjects->LimitClause) {
         $objClauses[] = $objClause;
     }
     $this->dtgProjects->DataSource = Project::LoadAll($objClauses);
 }
Example #14
0
 public function dtgShowcaseItems_Bind()
 {
     $objCondition = QQ::All();
     if (!is_null($blnValue = $this->lstLiveFlag->SelectedValue)) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::ShowcaseItem()->LiveFlag, $blnValue));
     }
     $this->dtgShowcaseItems->TotalItemCount = ShowcaseItem::QueryCount($objCondition);
     $objClauses = array();
     if ($objClause = $this->dtgShowcaseItems->LimitClause) {
         $objClauses[] = $objClause;
     }
     if ($objClause = $this->dtgShowcaseItems->OrderByClause) {
         $objClauses[] = $objClause;
     }
     $this->dtgShowcaseItems->DataSource = ShowcaseItem::QueryArray($objCondition, $objClauses);
 }
Example #15
0
 /**
  * Add the items to the project list.
  */
 public function lstProjects_Bind()
 {
     $clauses[] = QQ::ExpandAsArray(QQN::Project()->PersonAsTeamMember);
     $objProjects = Project::QueryArray(QQ::All(), $clauses);
     foreach ($objProjects as $objProject) {
         $item = new QHListItem($objProject->Name);
         $item->Tag = 'ol';
         $item->GetSubTagStyler()->OrderedListType = QOrderedListType::LowercaseRoman;
         foreach ($objProject->_PersonAsTeamMemberArray as $objPerson) {
             /****
              * Here we add a sub-item to each item before adding the item to the main list.
              */
             $item->AddItem($objPerson->FirstName . ' ' . $objPerson->LastName);
         }
         $this->lstProjects->AddItem($item);
     }
 }
Example #16
0
File: index.php Project: alcf/chms
 public function dtgMinistries_Bind()
 {
     $objConditions = QQ::All();
     // Setup the $objClauses Array
     $objClauses = array();
     // 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->dtgMinistries->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->dtgMinistries->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be a Query result from Login, given the clauses above
     $this->dtgMinistries->DataSource = Ministry::QueryArray($objConditions, $objClauses);
 }
 /**
  * Create and setup QListBox lstCountry
  * @param string $strControlId optional ControlId to use
  * @return QListBox
  */
 public function lstCountry_Create($strControlId = null)
 {
     $this->lstCountry = new QListBox($this->objParentObject, $strControlId);
     $this->lstCountry->Name = QApplication::Translate('Country');
     $this->lstCountry->AddItem(QApplication::Translate('- Select One -'), null);
     $objCountryArray = Country::QueryArray(QQ::All(), QQ::OrderBy(QQN::Country()->Name));
     if ($objCountryArray) {
         foreach ($objCountryArray as $objCountry) {
             $objListItem = new QListItem($objCountry->__toString(), $objCountry->Id);
             if ($this->objPerson->Country && $this->objPerson->Country->Id == $objCountry->Id) {
                 $objListItem->Selected = true;
             }
             $this->lstCountry->AddItem($objListItem);
         }
     }
     return $this->lstCountry;
 }
Example #18
0
 /**
  * Main DataGen Runner
  * @return void
  */
 public static function Run()
 {
     self::$SystemStartDate = new QDateTime('2004-01-01');
     self::$MaximumPersonId = Person::QuerySingle(QQ::All(), QQ::OrderBy(QQN::Person()->Id, false))->Id;
     self::DisplayForEachTaskStart($strDescription = 'Generating Signup Forms for Ministry', Ministry::CountByActiveFlag(true));
     foreach (Ministry::LoadArrayByActiveFlag(true) as $objMinistry) {
         self::DisplayForEachTaskNext($strDescription);
         $intCount = rand(self::FormsPerMinistryMinimum, self::FormsPerMinistryMaximum);
         self::DisplayForEachTaskStart($strDescriptionInside = '   Generating Signup Forms', $intCount);
         for ($i = 0; $i < $intCount; $i++) {
             self::DisplayForEachTaskNext($strDescriptionInside);
             self::GenerateFormInMinistry($objMinistry);
         }
         self::DisplayForEachTaskEnd($strDescriptionInside, true);
     }
     self::DisplayForEachTaskEnd($strDescription);
 }
 protected function getList($strTerm = null, $blnHtml = false)
 {
     if ($strTerm) {
         $cond = QQ::OrCondition(QQ::Like(QQN::Person()->FirstName, '%' . $strTerm . '%'), QQ::Like(QQN::Person()->LastName, '%' . $strTerm . '%'));
     } else {
         $cond = QQ::All();
     }
     $clauses[] = QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName);
     $lst = Person::QueryArray($cond, $clauses);
     $a = array();
     foreach ($lst as $objPerson) {
         $item = new QListItem($objPerson->FirstName . ' ' . $objPerson->LastName, $objPerson->Id);
         if ($blnHtml) {
             $item->Label = '<em>' . $objPerson->FirstName . ' ' . $objPerson->LastName . '</em>';
         }
         $a[] = $item;
     }
     return $a;
 }
Example #20
0
File: index.php Project: alcf/chms
 public function dtgPosts_Bind()
 {
     $objCondition = QQ::All();
     if ($intId = $this->lstCategory->SelectedValue) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::ClassifiedPost()->ClassifiedCategoryId, $intId));
     }
     if (!is_null($blnValue = $this->lstApproval->SelectedValue)) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::ClassifiedPost()->ApprovalFlag, $blnValue));
     }
     if (!is_null($blnValue = $this->lstExpiration->SelectedValue)) {
         $objCondition = QQ::AndCondition($objCondition, $blnValue ? QQ::LessThan(QQN::ClassifiedPost()->DateExpired, QDateTime::Now()) : QQ::GreaterOrEqual(QQN::ClassifiedPost()->DateExpired, QDateTime::Now()));
     }
     if (strlen($strText = trim($this->txtTitle->Text))) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Like(QQN::ClassifiedPost()->Title, '%' . $strText . '%'));
     }
     if (strlen($strText = trim($this->txtName->Text))) {
         $objCondition = QQ::AndCondition($objCondition, QQ::Like(QQN::ClassifiedPost()->Name, '%' . $strText . '%'));
     }
     $this->dtgPosts->MetaDataBinder($objCondition);
 }
Example #21
0
File: tools.php Project: alcf/chms
 protected function btnCheck_Click($strFormId, $strControlId, $strParameter)
 {
     $this->lblResult->Text = '';
     $objEmailArray = Email::LoadArrayByAddress($this->txtEmail->Text);
     if (count($objEmailArray) > 0) {
         $this->lblResult->Text .= "Found email objects<br><br>";
         $intPersonIdArray = array();
         foreach ($objEmailArray as $objEmail) {
             $objPerson = Person::LoadByPrimaryEmailId($objEmail->Id);
             if ($objPerson) {
                 $intPersonIdArray[] = $objPerson->Id;
             }
         }
         $this->lblResult->Text .= "<h3>GROUPS</h3>";
         $objGroupCursor = Group::QueryCursor(QQ::All());
         while ($objGroup = Group::InstantiateCursor($objGroupCursor)) {
             $objGroupParticipationArr = $objGroup->GetGroupParticipationArray();
             foreach ($objGroupParticipationArr as $objGroupParticipant) {
                 if (in_array($objGroupParticipant->PersonId, $intPersonIdArray)) {
                     $this->lblResult->Text .= sprintf("%s is in %s: %s<br>", $this->txtEmail->Text, $objGroup->Ministry->Name, $objGroup->Name);
                     break;
                 }
             }
         }
         $this->lblResult->Text .= "<br><h3>COMMUNICATION LISTS</h3>";
         $objCommuncationsCursor = CommunicationList::QueryCursor(QQ::All());
         while ($objCommunicationList = CommunicationList::InstantiateCursor($objCommuncationsCursor)) {
             $objCommListArray = $objCommunicationList->GetMemberAsArray();
             foreach ($objCommListArray as $objComListEntry) {
                 if ($objComListEntry[3] == $this->txtEmail->Text) {
                     $this->lblResult->Text .= sprintf("%s is in %s: %s<br>", $this->txtEmail->Text, $objCommunicationList->Ministry->Name, $objCommunicationList->Name);
                     break;
                 }
             }
         }
     } else {
         $this->lblResult->Text .= "No email object found<br>";
     }
 }
 /**
  * Count all Librarydetailses
  * @return int
  */
 public static function CountAll()
 {
     // Call Librarydetails::QueryCount to perform the CountAll query
     return Librarydetails::QueryCount(QQ::All());
 }
 /**
  * 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 = Country::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 Country, given the clauses above
     $this->DataSource = Country::QueryArray($objCondition, $objClauses);
 }
Example #24
0
 /**
  * Count all SignupPayments
  * @return int
  */
 public static function CountAll()
 {
     // Call SignupPayment::QueryCount to perform the CountAll query
     return SignupPayment::QueryCount(QQ::All());
 }
 /**
  * Create and setup QListBox lstAttributeValuesAsMultiple
  * @param string $strControlId optional ControlId to use
  * @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 QListBox
  */
 public function lstAttributeValuesAsMultiple_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null)
 {
     $this->lstAttributeValuesAsMultiple = new QListBox($this->objParentObject, $strControlId);
     $this->lstAttributeValuesAsMultiple->Name = QApplication::Translate('Attribute Values As Multiple');
     $this->lstAttributeValuesAsMultiple->SelectionMode = QSelectionMode::Multiple;
     // We need to know which items to "Pre-Select"
     $objAssociatedArray = $this->objAttributeOption->GetAttributeValueAsMultipleArray();
     // Setup and perform the Query
     if (is_null($objCondition)) {
         $objCondition = QQ::All();
     }
     $objAttributeValueCursor = AttributeValue::QueryCursor($objCondition, $objOptionalClauses);
     // Iterate through the Cursor
     while ($objAttributeValue = AttributeValue::InstantiateCursor($objAttributeValueCursor)) {
         $objListItem = new QListItem($objAttributeValue->__toString(), $objAttributeValue->Id);
         foreach ($objAssociatedArray as $objAssociated) {
             if ($objAssociated->Id == $objAttributeValue->Id) {
                 $objListItem->Selected = true;
             }
         }
         $this->lstAttributeValuesAsMultiple->AddItem($objListItem);
     }
     // Return the QListControl
     return $this->lstAttributeValuesAsMultiple;
 }
 /**
  * Create and setup QListBox lstUser
  * @param string $strControlId optional ControlId to use
  * @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 QListBox
  */
 public function lstUser_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null)
 {
     $this->lstUser = new QListBox($this->objParentObject, $strControlId);
     $this->lstUser->Name = QApplication::Translate('User');
     $this->lstUser->AddItem(QApplication::Translate('- Select One -'), null);
     // Setup and perform the Query
     if (is_null($objCondition)) {
         $objCondition = QQ::All();
     }
     $objUserCursor = NarroUser::QueryCursor($objCondition, $objOptionalClauses);
     // Iterate through the Cursor
     while ($objUser = NarroUser::InstantiateCursor($objUserCursor)) {
         $objListItem = new QListItem($objUser->__toString(), $objUser->UserId);
         if ($this->objNarroLog->User && $this->objNarroLog->User->UserId == $objUser->UserId) {
             $objListItem->Selected = true;
         }
         $this->lstUser->AddItem($objListItem);
     }
     // Return the QListBox
     return $this->lstUser;
 }
 /**
  * Count all AssetCustomFieldHelpers
  * @return int
  */
 public static function CountAll()
 {
     // Call AssetCustomFieldHelper::QueryCount to perform the CountAll query
     return AssetCustomFieldHelper::QueryCount(QQ::All());
 }
 /**
  * Count all RoleEntityQtypeBuiltInAuthorizations
  * @return int
  */
 public static function CountAll()
 {
     // Call RoleEntityQtypeBuiltInAuthorization::QueryCount to perform the CountAll query
     return RoleEntityQtypeBuiltInAuthorization::QueryCount(QQ::All());
 }
 /**
  * Count all InventoryModels
  * @return int
  */
 public static function CountAll()
 {
     // Call InventoryModel::QueryCount to perform the CountAll query
     return InventoryModel::QueryCount(QQ::All());
 }
 /**
  * Count all IssueFieldOptions
  * @return int
  */
 public static function CountAll()
 {
     // Call IssueFieldOption::QueryCount to perform the CountAll query
     return IssueFieldOption::QueryCount(QQ::All());
 }