Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.6
2.2.7
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM bfren/nginx-php:php8.4-7.4.3
FROM bfren/nginx-php:php8.4-7.4.4

LABEL org.opencontainers.image.source="https://github.com/bfren/obadiah"

Expand Down
3 changes: 2 additions & 1 deletion src/classes/rota/filters/series-filter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Obadiah\Rota\Filters;

use Obadiah\App;
use Obadiah\Helpers\Log;
use Obadiah\Lectionary\Lectionary;
use Obadiah\Rota\Service;

Expand Down Expand Up @@ -32,6 +33,6 @@ public function apply(Lectionary $lectionary, Service $service, string $value):
}

// compare the series title with the value
return $l_service->series == $value;
return $l_service->series == html_entity_decode($value);
}
}
13 changes: 11 additions & 2 deletions src/classes/rota/rota.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,17 @@ public function apply_filters(array $filters, Lectionary $lectionary): array
$include = $person_filter->apply($lectionary, $service, Arr::get($filters, "person", ""));

// apply date filters
$include = $include && $after_filter->apply($lectionary, $service, Arr::get($filters, "start", ""));
$include = $include && $before_filter->apply($lectionary, $service, Arr::get($filters, "end", ""));
$days = Arr::get_integer($filters, "days", 0);
if($days !== 0) {
$start = new DateTimeImmutable()->format("c");
$end = new DateTimeImmutable()->modify(sprintf("+%s day", $days))->format("c");
} else {
$start = Arr::get($filters, "start", "");
$end = Arr::get($filters, "end", "");
}

$include = $include && $after_filter->apply($lectionary, $service, $start);
$include = $include && $before_filter->apply($lectionary, $service, $end);

// apply start time filter
$include = $include && $start_filter->apply($lectionary, $service, Arr::get($filters, "time", ""));
Expand Down
35 changes: 24 additions & 11 deletions src/pages/rota/index-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@
<div class="row mb-2">
<div class="col-6">
<div class="input-group">
<span class="input-group-text" for="start">From</span>
<span class="input-group-text" for="start">From (Date)</span>
<input type="date" class="form-control" name="start" id="start" placeholder="From" value="<?php _e(Arr::get($model->filters, "start")); ?>" />
</div>
</div>
<div class="col-6">
<div class="input-group">
<span class="input-group-text" for="end">To</span>
<span class="input-group-text" for="end">To (Date)</span>
<input type="date" class="form-control" name="end" id="end" placeholder="To" value="<?php _e(Arr::get($model->filters, "end")); ?>" />
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-6">
<div class="input-group">
<span class="input-group-text" for="day">Day</span>
<span class="input-group-text" for="day">Day of Week</span>
<select class="form-control" name="day">
<option value="">Choose...</option>
<?php foreach (Builder::$days_of_the_week as $num => $txt) : $selected = $num == Arr::get($model->filters, "day") ? "selected" : ""; ?>
Expand All @@ -82,19 +82,19 @@
</div>
<div class="col-6">
<div class="input-group">
<span class="input-group-text" for="time">Time</span>
<span class="input-group-text" for="time">Start Time</span>
<input type="time" class="form-control" name="time" placeholder="Start" value="<?php _e(Arr::get($model->filters, "time")); ?>" />
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-6">
<div class="input-group">
<span class="input-group-text" for="max">Limit</span>
<select class="form-control" name="max">
<span class="input-group-text" for="max">Limit (Days)</span>
<select class="form-control" name="days">
<option value="">Show All</option>
<?php for ($i = 1; $i <= 20; $i++) : $selected = $i == Arr::get($model->filters, "max") ? "selected" : ""; ?>
<option value="<?php _e("%s", $i); ?>" <?php _e($selected); ?>><?php _e("%s", $i); ?> service<?php _e($i > 1 ? "s" : ""); ?></option>
<?php for ($i = 1; $i <= 28; $i++) : $selected = $i == Arr::get($model->filters, "days") ? "selected" : ""; ?>
<option value="<?php _e("%s", $i); ?>" <?php _e($selected); ?>><?php _e("+%s", $i); ?> day<?php _e($i > 1 ? "s" : ""); ?></option>
<?php endfor; ?>
</select>
</div>
Expand All @@ -104,15 +104,26 @@
<span class="input-group-text" for="series">Series</span>
<select class="form-control" name="series">
<option value="">Choose...</option>
<?php foreach ($model->series as $series) : $selected = $series == Arr::get($model->filters, "series") ? "selected" : ""; ?>
<?php foreach ($model->series as $series) : $selected = $series == html_entity_decode(Arr::get($model->filters, "series")) ? "selected" : ""; ?>
<option value="<?php _e(htmlentities($series)); ?>" <?php _e($selected); ?>><?php _e($series); ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-6 mb-2 d-flex align-items-center">
<div class="col-6">
<div class="input-group">
<span class="input-group-text" for="max">Limit (Services)</span>
<select class="form-control" name="max">
<option value="">Show All</option>
<?php for ($i = 1; $i <= 20; $i++) : $selected = $i == Arr::get($model->filters, "max") ? "selected" : ""; ?>
<option value="<?php _e("%s", $i); ?>" <?php _e($selected); ?>><?php _e("%s", $i); ?> service<?php _e($i > 1 ? "s" : ""); ?></option>
<?php endfor; ?>
</select>
</div>
</div>
<div class="col-6">
<div class="input-group">
<span class="input-group-text" for="collect">Collects</span>
<select class="form-control" name="collect">
Expand All @@ -122,7 +133,9 @@
</select>
</div>
</div>
<div class="col-12 col-lg-6 d-flex justify-content-end align-items-center">
</div>
<div class="row">
<div class="col-12 mt-2 d-flex justify-content-end align-items-center">
<?php if (Request::$session->is_admin) : ?>
<div class="form-check d-none d-sm-block me-4">
<?php $checked = Request::$debug ? "checked" : ""; ?>
Expand Down