xref: /webtrees/resources/views/calendar-page.phtml (revision dd6b2bfcc550270bb6d6778e11576148f71e4330)
1*dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Auth; ?>
2*dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Date; ?>
3*dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Date\JewishDate; ?>
4*dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\Functions\FunctionsPrint; ?>
5*dd6b2bfcSGreg Roach<?php use Fisharebest\Webtrees\I18N; ?>
6*dd6b2bfcSGreg Roach
7*dd6b2bfcSGreg Roach<h2 class="wt-page-title">
8*dd6b2bfcSGreg Roach    <?= $title ?>
9*dd6b2bfcSGreg Roach</h2>
10*dd6b2bfcSGreg Roach
11*dd6b2bfcSGreg Roach<form name="dateform">
12*dd6b2bfcSGreg Roach    <input type="hidden" name="route" value="calendar">
13*dd6b2bfcSGreg Roach    <input type="hidden" name="cal" value="<?= e($cal) ?>">
14*dd6b2bfcSGreg Roach    <input type="hidden" name="day" value="<?= e($cal_date->day()) ?>">
15*dd6b2bfcSGreg Roach    <input type="hidden" name="month" value="<?= e($cal_month) ?>">
16*dd6b2bfcSGreg Roach    <input type="hidden" name="year" value="<?= e($cal_date->year()) ?>">
17*dd6b2bfcSGreg Roach    <input type="hidden" name="view" value="<?= e($view) ?>">
18*dd6b2bfcSGreg Roach    <input type="hidden" name="filterev" value="<?= e($filterev) ?>">
19*dd6b2bfcSGreg Roach    <input type="hidden" name="filtersx" value="<?= e($filtersx) ?>">
20*dd6b2bfcSGreg Roach    <input type="hidden" name="filterof" value="<?= e($filterof) ?>">
21*dd6b2bfcSGreg Roach
22*dd6b2bfcSGreg Roach    <table class="table-sm wt-page-options w-100" role="presentation">
23*dd6b2bfcSGreg Roach        <tr>
24*dd6b2bfcSGreg Roach            <th class="wt-page-options-label">
25*dd6b2bfcSGreg Roach                <?= I18N::translate('Day') ?>
26*dd6b2bfcSGreg Roach            </th>
27*dd6b2bfcSGreg Roach            <td class="wt-page-options-value" colspan="3">
28*dd6b2bfcSGreg Roach                <?php for ($d = 1; $d <= $days_in_month; $d++) : ?>
29*dd6b2bfcSGreg Roach                    <a <?= $d === $cal_date->day() ? 'class="error"' : '' ?> href="<?= e(route('calendar', ['cal' => $cal, 'day' => $d, 'month' => $cal_month, 'year' => $cal_date->year(), 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx, 'view' => 'day', 'ged' => $tree->getName()])) ?>" rel="nofollow">
30*dd6b2bfcSGreg Roach                        <?= (new Date($cal_date->format("%@ {$d} %O %E")))->minimumDate()->format('%j') ?>
31*dd6b2bfcSGreg Roach                    </a>
32*dd6b2bfcSGreg Roach                    |
33*dd6b2bfcSGreg Roach                <?php endfor ?>
34*dd6b2bfcSGreg Roach                <a href="<?= e(route('calendar', ['cal' => $cal, 'day' => $today->day(), 'month' => $today_month, 'year' => $today->year(), 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx, 'view' => 'day', 'ged' => $tree->getName()])) ?>" rel="nofollow">
35*dd6b2bfcSGreg Roach                    <b><?php $tmp = new Date($today->format('%@ %A %O %E')); echo $tmp->display() ?></b>
36*dd6b2bfcSGreg Roach                </a>
37*dd6b2bfcSGreg Roach            </td>
38*dd6b2bfcSGreg Roach        </tr>
39*dd6b2bfcSGreg Roach        <tr>
40*dd6b2bfcSGreg Roach            <th class="wt-page-options-label">
41*dd6b2bfcSGreg Roach                <?= I18N::translate('Month') ?>
42*dd6b2bfcSGreg Roach            </th>
43*dd6b2bfcSGreg Roach            <td class="wt-page-options-value" colspan="3">
44*dd6b2bfcSGreg Roach                <?php foreach ($months as $m => $month_name) : ?>
45*dd6b2bfcSGreg Roach                    <a href="<?= e(route('calendar', ['cal' => $cal, 'day' => $cal_date->day(), 'month' => $m, 'year' => $cal_date->year(), 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx, 'view' => 'month', 'ged' => $tree->getName()])) ?>" rel="nofollow">
46*dd6b2bfcSGreg Roach                        <?php if ($m === $cal_month) : ?>
47*dd6b2bfcSGreg Roach                            <span class="error"><?= e($month_name) ?></span>
48*dd6b2bfcSGreg Roach                        <?php else : ?>
49*dd6b2bfcSGreg Roach                            <?= e($month_name) ?>
50*dd6b2bfcSGreg Roach                        <?php endif ?>
51*dd6b2bfcSGreg Roach                    </a> |
52*dd6b2bfcSGreg Roach                <?php endforeach ?>
53*dd6b2bfcSGreg Roach                <a href="<?= e(route('calendar', ['cal' => $cal, 'day' => min($cal_date->day(), $today->daysInMonth()), 'month' => $today_month, 'year' => $today->year(), 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx, 'view' => 'month', 'ged' => $tree->getName()])) ?>" rel="nofollow">
54*dd6b2bfcSGreg Roach                    <b><?= $today->format('%F %Y') ?></b>
55*dd6b2bfcSGreg Roach                </a>
56*dd6b2bfcSGreg Roach            </td>
57*dd6b2bfcSGreg Roach        </tr>
58*dd6b2bfcSGreg Roach        <tr>
59*dd6b2bfcSGreg Roach            <th class="wt-page-options-label">
60*dd6b2bfcSGreg Roach                <label for="year"><?= I18N::translate('Year') ?></label>
61*dd6b2bfcSGreg Roach            </th>
62*dd6b2bfcSGreg Roach            <td class="wt-page-options-value">
63*dd6b2bfcSGreg Roach                <a href="<?= e(route('calendar', ['cal' => $cal, 'day' => $cal_date->day(), 'month' => $cal_month, 'year' => $cal_date->year() === 1 ? -1 : $cal_date->year() - 1, 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx, 'view' => $view, 'ged' => $tree->getName()])) ?>" rel="nofollow">
64*dd6b2bfcSGreg Roach                    -1
65*dd6b2bfcSGreg Roach                </a>
66*dd6b2bfcSGreg Roach                <input type="text" id="year" name="year" value="<?= $year ?>" size="4">
67*dd6b2bfcSGreg Roach                <a href="<?= e(route('calendar', ['cal' => $cal, 'day' => $cal_date->day(), 'month' => $cal_month, 'year' => $cal_date->year() === -1 ? 1 : $cal_date->year() + 1, 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx, 'view' => $view, 'ged' => $tree->getName()])) ?>" rel="nofollow">
68*dd6b2bfcSGreg Roach                    +1
69*dd6b2bfcSGreg Roach                </a>
70*dd6b2bfcSGreg Roach                |
71*dd6b2bfcSGreg Roach                <a href="<?= e(route('calendar', ['cal' => $cal, 'day' => $cal_date->day(), 'month' => $cal_month, 'year' => $today->year(), 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx, 'view' => $view, 'ged' => $tree->getName()])) ?>" rel="nofollow">
72*dd6b2bfcSGreg Roach                    <?= $today->format('%Y') ?>
73*dd6b2bfcSGreg Roach                </a>
74*dd6b2bfcSGreg Roach                <?= FunctionsPrint::helpLink('annivers_year_select') ?>
75*dd6b2bfcSGreg Roach            </td>
76*dd6b2bfcSGreg Roach
77*dd6b2bfcSGreg Roach            <th class="wt-page-options-label">
78*dd6b2bfcSGreg Roach                <?= I18N::translate('Show') ?>
79*dd6b2bfcSGreg Roach            </th>
80*dd6b2bfcSGreg Roach
81*dd6b2bfcSGreg Roach            <td class="wt-page-options-value">
82*dd6b2bfcSGreg Roach                <?php if (!$tree->getPreference('HIDE_LIVE_PEOPLE') || Auth::check()) : ?>
83*dd6b2bfcSGreg Roach                    <select class="list_value" name="filterof" onchange="document.dateform.submit();">
84*dd6b2bfcSGreg Roach                        <option value="all" <?= $filterof === 'all' ? 'selected' : '' ?>>
85*dd6b2bfcSGreg Roach                            <?= I18N::translate('All individuals') ?>
86*dd6b2bfcSGreg Roach                        </option>
87*dd6b2bfcSGreg Roach                        <option value="living" <?= $filterof === 'living' ? 'selected' : '' ?>>
88*dd6b2bfcSGreg Roach                            <?= I18N::translate('Living individuals') ?>
89*dd6b2bfcSGreg Roach                        </option>
90*dd6b2bfcSGreg Roach                        <option value="recent" <?= $filterof === 'recent' ? 'selected' : '' ?>>
91*dd6b2bfcSGreg Roach                            <?= I18N::translate('Recent years (&lt; 100 yrs)') ?>
92*dd6b2bfcSGreg Roach                        </option>
93*dd6b2bfcSGreg Roach                    </select>
94*dd6b2bfcSGreg Roach                <?php endif ?>
95*dd6b2bfcSGreg Roach
96*dd6b2bfcSGreg Roach                <a title="<?= I18N::translate('All individuals') ?>" href="<?= e(route('calendar', ['cal' => $cal, 'day' => $cal_date->day(), 'month' => $cal_month, 'year' => $cal_date->year(), 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => '', 'view' => $view, 'ged' => $tree->getName()])) ?>" rel="nofollow">
97*dd6b2bfcSGreg Roach                    <i class="<?= $filtersx === '' ? 'icon-sex_m_15x15' : 'icon-sex_m_9x9' ?>"></i>
98*dd6b2bfcSGreg Roach                    <i class="<?= $filtersx === '' ? 'icon-sex_f_15x15' : 'icon-sex_f_9x9' ?>"></i>
99*dd6b2bfcSGreg Roach                </a>
100*dd6b2bfcSGreg Roach                |
101*dd6b2bfcSGreg Roach                <a title="<?= I18N::translate('Males') ?>" href="<?= e(route('calendar', ['cal' => $cal, 'day' => $cal_date->day(), 'month' => $cal_month, 'year' => $cal_date->year(), 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => 'M', 'view' => $view, 'ged' => $tree->getName()])) ?>" rel="nofollow">
102*dd6b2bfcSGreg Roach                    <i class="<?= $filtersx === 'M' ? 'icon-sex_m_15x15' : 'icon-sex_m_9x9' ?>"></i>
103*dd6b2bfcSGreg Roach                </a>
104*dd6b2bfcSGreg Roach                |
105*dd6b2bfcSGreg Roach                <a title="<?= I18N::translate('Females') ?>" href="<?= e(route('calendar', ['cal' => $cal, 'day' => $cal_date->day(), 'month' => $cal_month, 'year' => $cal_date->year(), 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => 'F', 'view' => $view, 'ged' => $tree->getName()])) ?>" rel="nofollow">
106*dd6b2bfcSGreg Roach                    <i class="<?= $filtersx === 'F' ? 'icon-sex_f_15x15' : 'icon-sex_f_9x9' ?>"></i>
107*dd6b2bfcSGreg Roach                </a>
108*dd6b2bfcSGreg Roach
109*dd6b2bfcSGreg Roach                <select class="list_value" name="filterev" onchange="document.dateform.submit();">
110*dd6b2bfcSGreg Roach                    <option value="BIRT-MARR-DEAT" <?= $filterev === 'BIRT-MARR-DEAT' ? 'selected' : '' ?>>
111*dd6b2bfcSGreg Roach                        <?= I18N::translate('Vital records') ?>
112*dd6b2bfcSGreg Roach                    </option>
113*dd6b2bfcSGreg Roach                    <option value="" <?= $filterev === '' ? 'selected' : '' ?>>
114*dd6b2bfcSGreg Roach                        <?= I18N::translate('All') ?>
115*dd6b2bfcSGreg Roach                    </option>
116*dd6b2bfcSGreg Roach                    <option value="BIRT" <?= $filterev === 'BIRT' ? 'selected' : '' ?>>
117*dd6b2bfcSGreg Roach                        <?= I18N::translate('Birth') ?>
118*dd6b2bfcSGreg Roach                    </option>
119*dd6b2bfcSGreg Roach                    <option value="BAPM-CHR-CHRA" <?= $filterev === 'BAPM-CHR-CHRA' ? 'selected' : '' ?>>
120*dd6b2bfcSGreg Roach                        <?= I18N::translate('Baptism') ?>
121*dd6b2bfcSGreg Roach                    </option>
122*dd6b2bfcSGreg Roach                    <option value="MARR-_COML-_NMR" <?= $filterev === 'MARR-_COML-_NMR' ? 'selected' : '' ?>>
123*dd6b2bfcSGreg Roach                        <?= I18N::translate('Marriage') ?>
124*dd6b2bfcSGreg Roach                    </option>
125*dd6b2bfcSGreg Roach                    <option value="DIV-_SEPR" <?= $filterev === 'DIV-_SEPR' ? 'selected' : '' ?>>
126*dd6b2bfcSGreg Roach                        <?= I18N::translate('Divorce') ?>
127*dd6b2bfcSGreg Roach                    </option>
128*dd6b2bfcSGreg Roach                    <option value="DEAT" <?= $filterev === 'DEAT' ? 'selected' : '' ?>>
129*dd6b2bfcSGreg Roach                        <?= I18N::translate('Death') ?>
130*dd6b2bfcSGreg Roach                    </option>
131*dd6b2bfcSGreg Roach                    <option value="BURI" <?= $filterev === 'BURI' ? 'selected' : '' ?>>
132*dd6b2bfcSGreg Roach                        <?= I18N::translate('Burial') ?>
133*dd6b2bfcSGreg Roach                    </option>
134*dd6b2bfcSGreg Roach                    <option value="IMMI,EMIG" <?= $filterev === 'IMMI,EMIG' ? 'selected' : '' ?>>
135*dd6b2bfcSGreg Roach                        <?= I18N::translate('Emigration') ?>
136*dd6b2bfcSGreg Roach                    </option>
137*dd6b2bfcSGreg Roach                    <option value="EVEN" <?= $filterev === 'EVEN' ? 'selected' : '' ?>>
138*dd6b2bfcSGreg Roach                        <?= I18N::translate('Custom event') ?>
139*dd6b2bfcSGreg Roach                    </option>
140*dd6b2bfcSGreg Roach                </select>
141*dd6b2bfcSGreg Roach            </td>
142*dd6b2bfcSGreg Roach        </tr>
143*dd6b2bfcSGreg Roach    </table>
144*dd6b2bfcSGreg Roach
145*dd6b2bfcSGreg Roach    <table class="width100">
146*dd6b2bfcSGreg Roach        <tr>
147*dd6b2bfcSGreg Roach            <td class="topbottombar width50">
148*dd6b2bfcSGreg Roach                <a class="<?= $view === 'day' ? 'error' : '' ?>" href="<?= e(route('calendar', ['cal' => $cal, 'day' => $cal_date->day(), 'month' => $cal_month, 'year' => $cal_date->year(), 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx, 'view' => 'day', 'ged' => $tree->getName()])) ?>" rel="nofollow">
149*dd6b2bfcSGreg Roach                    <?= I18N::translate('View this day') ?>
150*dd6b2bfcSGreg Roach                </a>
151*dd6b2bfcSGreg Roach                |
152*dd6b2bfcSGreg Roach                <a class="<?= $view === 'month' ? 'error' : '' ?>" href="<?= e(route('calendar', ['cal' => $cal, 'day' => $cal_date->day(), 'month' => $cal_month, 'year' => $cal_date->year(), 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx, 'view' => 'month', 'ged' => $tree->getName()])) ?>" rel="nofollow">
153*dd6b2bfcSGreg Roach                    <?= I18N::translate('View this month') ?>
154*dd6b2bfcSGreg Roach                </a>
155*dd6b2bfcSGreg Roach                |
156*dd6b2bfcSGreg Roach                <a class="<?= $view === 'year' ? 'error' : '' ?>" href="<?= e(route('calendar', ['cal' => $cal, 'day' => $cal_date->day(), 'month' => $cal_month, 'year' => $cal_date->year(), 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx, 'view' => 'year', 'ged' => $tree->getName()])) ?>" rel="nofollow">
157*dd6b2bfcSGreg Roach                    <?= I18N::translate('View this year') ?>
158*dd6b2bfcSGreg Roach                </a>
159*dd6b2bfcSGreg Roach            </td>
160*dd6b2bfcSGreg Roach            <td class="topbottombar width50">
161*dd6b2bfcSGreg Roach                <?php
162*dd6b2bfcSGreg Roach                    $n = 0;
163*dd6b2bfcSGreg Roach                foreach (Date::calendarNames() as $newcal => $cal_name) {
164*dd6b2bfcSGreg Roach                    $tmp = $cal_date->convertToCalendar($newcal);
165*dd6b2bfcSGreg Roach                    if ($tmp->inValidRange()) {
166*dd6b2bfcSGreg Roach                        if ($n++) {
167*dd6b2bfcSGreg Roach                            echo ' | ';
168*dd6b2bfcSGreg Roach                        }
169*dd6b2bfcSGreg Roach                        echo '<a ' . (get_class($tmp) === get_class($cal_date) ? 'class="error"' : '') . 'href="' . e(route('calendar', ['cal' => $tmp->format('%@'), 'day' => $tmp->day(), 'month' => $tmp->format('%O'), 'year' => $tmp->year(), 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx, 'view' => $view, 'ged' => $tree->getName()])) . '" rel="nofollow">', $cal_name, '</a>';
170*dd6b2bfcSGreg Roach                    }
171*dd6b2bfcSGreg Roach                } ?>
172*dd6b2bfcSGreg Roach            </td>
173*dd6b2bfcSGreg Roach        </tr>
174*dd6b2bfcSGreg Roach    </table>
175*dd6b2bfcSGreg Roach</form>
176*dd6b2bfcSGreg Roach
177*dd6b2bfcSGreg Roach<div class="wt-ajax-load wt-page-content" data-ajax-url="<?= e(route('calendar-events', ['ged' => $tree->getName(), 'cal' => $cal, 'day' => $day, 'month' => $month, 'year' => $year, 'view' => $view, 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx])) ?>"></div>
178*dd6b2bfcSGreg Roach
179*dd6b2bfcSGreg Roach<?= view('modals/ajax') ?>
180