xref: /webtrees/resources/views/admin/changes-log.phtml (revision ac71572d8462e396ed5a307f05b29381e49f9e6e)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
6use Fisharebest\Webtrees\Http\RequestHandlers\ManageTrees;
7use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesLogData;
8use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesLogDelete;
9use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesLogDownload;
10use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesLogPage;
11use Fisharebest\Webtrees\I18N;
12use Fisharebest\Webtrees\Tree;
13
14/**
15 * @var string               $earliest
16 * @var string               $from
17 * @var string               $latest
18 * @var array<string,string> $statuses
19 * @var string               $newged
20 * @var string               $oldged
21 * @var string               $title
22 * @var string               $to
23 * @var Tree                 $tree
24 * @var array<string,string> $trees
25 * @var string               $type
26 * @var string               $username
27 * @var array<string,string> $users
28 * @var string               $xref
29 */
30
31?>
32
33<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ManageTrees::class, ['tree' => $tree->name()]) => I18N::translate('Manage family trees'), $title]]) ?>
34
35<h1><?= $title ?></h1>
36
37<form method="post" class="form" name="logs">
38    <div class="row">
39        <div class="col-sm-6 col-md-3">
40            <label for="from">
41                <?= I18N::translateContext('Start of date range', 'From') ?>
42            </label>
43            <input type="date" class="form-control" id="from" max="<?= e($latest) ?>" min="<?= e($earliest) ?>" name="from" value="<?= e($from) ?>" required="required">
44        </div>
45
46        <div class="col-sm-6 col-md-3">
47            <label for="to">
48                <?= I18N::translateContext('End of date range', 'To') ?>
49            </label>
50            <input type="date" class="form-control" id="to" max="<?= e($latest) ?>" min="<?= e($earliest) ?>"  name="to" value="<?= e($to) ?>" required="required">
51        </div>
52
53        <div class="col-sm-6 col-md-3">
54            <label for="type">
55                <?= I18N::translate('Status') ?>
56            </label>
57            <?= view('components/select', ['name' => 'type', 'selected' => $type, 'options' => $statuses]) ?>
58        </div>
59
60        <div class="col-sm-6 col-md-3">
61            <label for="xref">
62                <?= I18N::translate('Record') ?>
63            </label>
64            <input class="form-control" type="text" id="xref" name="xref" value="<?= e($xref) ?>">
65        </div>
66    </div>
67
68    <div class="row">
69        <div class="col-sm-6 col-md-3">
70            <label for="oldged">
71                <?= I18N::translate('Old data') ?>
72            </label>
73            <input class="form-control" type="text" id="oldged" name="oldged" value="<?= e($oldged) ?>">
74        </div>
75
76        <div class="col-sm-6 col-md-3">
77            <label for="newged">
78                <?= I18N::translate('New data') ?>
79            </label>
80            <input class="form-control" type="text" id="newged" name="newged" value="<?= e($newged) ?>">
81        </div>
82
83        <div class="col-sm-6 col-md-3">
84            <label for="username">
85                <?= I18N::translate('User') ?>
86            </label>
87            <?= view('components/select', ['name' => 'username', 'selected' => $username, 'options' => $users]) ?>
88        </div>
89
90        <div class="col-sm-6 col-md-3">
91            <label for="tree">
92                <?= I18N::translate('Family tree') ?>
93            </label>
94            <?= view('components/select', ['name' => 'tree', 'selected' => $tree->name(), 'options' => $trees]) ?>
95        </div>
96    </div>
97
98    <div class="text-center">
99        <button type="submit" class="btn btn-primary">
100            <?= view('icons/search') ?>
101            <?= I18N::translate('search') ?>
102        </button>
103
104        <a href="<?= e(route(PendingChangesLogPage::class, ['tree' => $tree->name()])) ?>" type="submit" class="btn btn-secondary">
105            <?= view('icons/cancel') ?>
106            <?= /* I18N: A button label. */ I18N::translate('reset') ?>
107        </a>
108        <a class="btn btn-secondary" href="<?= route(PendingChangesLogDownload::class, ['from' => $from, 'to' => $to, 'type' => $type, 'xref' => $xref, 'oldged' => $oldged, 'newged' => $newged, 'tree' => $tree->name(), 'username' => $username]) ?>">
109            <?= view('icons/download') ?>
110            <?= /* I18N: A button label. */ I18N::translate('download') ?>
111        </a>
112
113        <a href="#" class="btn btn-danger" data-wt-confirm="<?= I18N::translate('Permanently delete these records?') ?>" data-wt-post-url="<?= route(PendingChangesLogDelete::class, ['from' => $from, 'to' => $to, 'type' => $type, 'xref' => $xref, 'oldged' => $oldged, 'newged' => $newged, 'tree' => $tree->name(), 'username' => $username]) ?>">
114        <?= view('icons/delete') ?>
115            <?= I18N::translate('delete') ?>
116        </a>
117    </div>
118
119    <?= csrf_field() ?>
120</form>
121
122<table
123    class="table table-bordered table-sm table-hover table-site-changes datatables d-none"
124    <?= view('lists/datatables-attributes') ?>
125    data-ajax="<?= route(PendingChangesLogData::class, ['from' => $from, 'to' => $to, 'type' => $type, 'xref' => $xref, 'oldged' => $oldged, 'newged' => $newged, 'tree' => $tree->name(), 'username' => $username]) ?>"
126    data-server-side="true"
127    data-sorting="<?= e('[[ 0, "desc" ]]') ?>"
128>
129    <caption class="visually-hidden">
130        <?= $title ?>
131    </caption>
132
133    <thead>
134        <tr>
135            <th data-visible="false"></th>
136            <th><?= I18N::translate('Timestamp') ?></th>
137            <th><?= I18N::translate('Status') ?></th>
138            <th><?= I18N::translate('Record') ?></th>
139            <th data-sortable="false"><?= I18N::translate('Data') ?></th>
140            <th><?= I18N::translate('User') ?></th>
141            <th><?= I18N::translate('Family tree') ?></th>
142        </tr>
143    </thead>
144</table>
145