Skip to content

Commit

Permalink
Order by most recent events on checkin (#7159)
Browse files Browse the repository at this point in the history
# Description & Issue number it closes 

Closes #4870

## Type of change

- [x] New feature (non-breaking change which adds functionality)
  • Loading branch information
DAcodedBEAT authored Sep 21, 2024
2 parents 1a1607e + f3cc84d commit c983d88
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/CartToGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
RedirectUtils::redirect('GroupView.php?GroupID=' . $iGroupID . '&Action=EmptyCart');
}

$ormGroups = GroupQuery::Create()->orderByName()->find();
$ormGroups = GroupQuery::create()->orderByName()->find();

$sPageTitle = gettext('Add Cart to Group');
require 'Include/Header.php';
Expand Down
5 changes: 3 additions & 2 deletions src/Checkin.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@
$iAdultID = InputUtils::legacyFilterInput($_POST['adult-id'], 'int');
}

$activeEvents = EventQuery::Create()
$activeEvents = EventQuery::create()
->filterByInActive(1, Criteria::NOT_EQUAL)
->orderByStart(Criteria::DESC)
->find();

if ($EventID > 0) {
//get Event Details
$event = EventQuery::Create()
$event = EventQuery::create()
->findOneById($EventID);
}
?>
Expand Down
4 changes: 2 additions & 2 deletions src/ChurchCRM/Config/Menu/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private static function getGroupMenu(): MenuItem
$groupMenu = new MenuItem(gettext('Groups'), '', true, 'fa-users');
$groupMenu->addSubMenu(new MenuItem(gettext('List Groups'), 'GroupList.php'));

$listOptions = ListOptionQuery::Create()->filterById(3)->orderByOptionSequence()->find();
$listOptions = ListOptionQuery::create()->filterById(3)->orderByOptionSequence()->find();

foreach ($listOptions as $listOption) {
if ($listOption->getOptionId() !== 4) {// we avoid the sundaySchool, it's done under
Expand Down Expand Up @@ -182,7 +182,7 @@ private static function getReportsMenu(): MenuItem

private static function addGroupSubMenus($menuName, $groupId, string $viewURl): ?MenuItem
{
$groups = GroupQuery::Create()->filterByType($groupId)->orderByName()->find();
$groups = GroupQuery::create()->filterByType($groupId)->orderByName()->find();
if (!$groups->isEmpty()) {
$unassignedGroups = new MenuItem($menuName, '', true, 'fa-tag');
foreach ($groups as $group) {
Expand Down
2 changes: 1 addition & 1 deletion src/ChurchCRM/Service/DashboardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DashboardService
{
public function getFamilyCount(): array
{
$familyCount = FamilyQuery::Create()
$familyCount = FamilyQuery::create()
->filterByDateDeactivated()
->count();

Expand Down
2 changes: 1 addition & 1 deletion src/ChurchCRM/Slim/Middleware/EventsMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __invoke(Request $request, RequestHandler $handler): Response
return SlimUtils::renderJSON($response, ['message' => gettext('Missing event id')], 400);
}

$event = EventQuery::Create()->findPk($eventId);
$event = EventQuery::create()->findPk($eventId);

if (empty($event)) {
$response = new Response();
Expand Down
2 changes: 1 addition & 1 deletion src/Reports/ClassAttendance.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
$pdf->addPage();
}
//Get the data on this group
$group = GroupQuery::Create()->findOneById($iGroupID);
$group = GroupQuery::create()->findOneById($iGroupID);

$FYString = MakeFYString($iFYID);

Expand Down
2 changes: 1 addition & 1 deletion src/Reports/ClassList.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct()
$pdf->addPage();
}

$group = GroupQuery::Create()->findOneById($iGroupID);
$group = GroupQuery::create()->findOneById($iGroupID);

$nameX = 20;
$birthdayX = 70;
Expand Down
2 changes: 1 addition & 1 deletion src/Reports/EnvelopeReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function addRecord($text, int $numlines): void
// Instantiate the directory class and build the report.
$pdf = new PdfEnvelopeReport();

$families = FamilyQuery::Create()->orderByEnvelope()->filterByEnvelope(0, 'Criteria::GREATER_THAN')->find();
$families = FamilyQuery::create()->orderByEnvelope()->filterByEnvelope(0, 'Criteria::GREATER_THAN')->find();

foreach ($families as $family) {
$OutStr = $pdf->sGetFamilyString($family);
Expand Down
2 changes: 1 addition & 1 deletion src/Reports/PhotoBook.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct($iFYID)

public function drawGroup($iGroupID): void
{
$this->group = GroupQuery::Create()->findOneById($iGroupID);
$this->group = GroupQuery::create()->findOneById($iGroupID);
// Use our own margin logic.
$this->SetMargins(0, 0);
$this->SetFont('Times', '', 14);
Expand Down
10 changes: 5 additions & 5 deletions src/api/routes/calendar/events.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function getAllEvents(Request $request, Response $response, array $args): Respon

function getEventTypes(Request $request, Response $response, array $args): Response
{
$EventTypes = EventTypeQuery::Create()
$EventTypes = EventTypeQuery::create()
->orderByName()
->find();
if (empty($EventTypes)) {
Expand Down Expand Up @@ -121,7 +121,7 @@ function newEvent(Request $request, Response $response, array $args): Response
$input = $request->getParsedBody();

//fetch all related event objects before committing this event.
$type = EventTypeQuery::Create()
$type = EventTypeQuery::create()
->findOneById($input['Type']);
if (empty($type)) {
throw new HttpBadRequestException($request, gettext('invalid event type id'));
Expand Down Expand Up @@ -156,7 +156,7 @@ function updateEvent(Request $request, Response $response, array $args): Respons
$id = $Event->getId();
$Event->fromArray($input);
$Event->setId($id);
$PinnedCalendars = CalendarQuery::Create()
$PinnedCalendars = CalendarQuery::create()
->filterById($input['PinnedCalendars'], Criteria::IN)
->find();
$Event->setCalendars($PinnedCalendars);
Expand All @@ -170,7 +170,7 @@ function setEventTime(Request $request, Response $response, array $args): Respon
{
$input = $request->getParsedBody();

$event = EventQuery::Create()
$event = EventQuery::create()
->findOneById($args['id']);
if (!$event) {
throw new HttpNotFoundException($request);
Expand Down Expand Up @@ -213,7 +213,7 @@ function unusedSetEventAttendance(): void

function deleteEvent(Request $request, Response $response, array $args): Response
{
$event = EventQuery::Create()->findOneById($args['id']);
$event = EventQuery::create()->findOneById($args['id']);
if (!$event) {
throw new HttpNotFoundException($request);
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/routes/people/people-groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

// get the group for the calendar, it's planned to only have the personan calendar and the calendar groups the user belongs to
$group->get('/calendars', function (Request $request, Response $response, array $args): Response {
$groups = GroupQuery::Create()
$groups = GroupQuery::create()
->orderByName()
->find();

Expand Down
2 changes: 1 addition & 1 deletion src/mysql/upgrade/3.0.0.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

if (count($Events) > 0) {
foreach ($Events as $Event) {
$w = EventQuery::Create()->findOneById($Event['event_id']);
$w = EventQuery::create()->findOneById($Event['event_id']);
if ($Event['event_publicly_visible']) {
$w->addCalendar($PublicCalendar);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/v2/routes/root.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function viewDashboard(Request $request, Response $response, array $args): Respo

$dashboardCounts = [];

$dashboardCounts['families'] = FamilyQuery::Create()
$dashboardCounts['families'] = FamilyQuery::create()
->filterByDateDeactivated()
->count();

Expand Down

0 comments on commit c983d88

Please sign in to comment.