xref: /webtrees/resources/views/admin/changes-log.phtml (revision ad7270802ba57a28d195fc58fcc55f26458a779a)
1<?php use Fisharebest\Webtrees\Bootstrap4; ?>
2<?php use Fisharebest\Webtrees\I18N; ?>
3
4<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-trees') => I18N::translate('Manage family trees'), $title]]) ?>
5
6<h1><?= $title ?></h1>
7
8<form class="form" name="logs">
9    <input type="hidden" name="action" value="show">
10    <input type="hidden" name="route" value="admin-changes-log">
11    <input type="hidden" name="ged" value="<?= e($ged) ?>">
12
13    <div class="row">
14        <div class="form-group col-xs-6 col-md-3">
15            <label for="from">
16                <?= /* I18N: From date1 (To date2) */ I18N::translate('From') ?>
17            </label>
18            <input type="date" class="form-control" id="from" max="<?= e($latest) ?>" min="<?= e($earliest) ?>" name="from" value="<?= e($from) ?>" required>
19        </div>
20
21        <div class="form-group col-xs-6 col-md-3">
22            <label for="to">
23                <?= /* I18N: (From date1) To date2 */ I18N::translate('To') ?>
24            </label>
25            <input type="date" class="form-control" id="to" max="<?= e($latest) ?>" min="<?= e($earliest) ?>"  name="to" value="<?= e($to) ?>" required>
26        </div>
27
28        <div class="form-group col-xs-6 col-md-3">
29            <label for="type">
30                <?= I18N::translate('Status') ?>
31            </label>
32            <?= Bootstrap4::select($statuses, $type, ['id' => 'type', 'name' => 'type']) ?>
33        </div>
34
35        <div class="form-group col-xs-6 col-md-3">
36            <label for="xref">
37                <?= I18N::translate('Record') ?>
38            </label>
39            <input class="form-control" type="text" id="xref" name="xref" value="<?= e($xref) ?>">
40        </div>
41    </div>
42
43    <div class="row">
44        <div class="form-group col-xs-6 col-md-3">
45            <label for="oldged">
46                <?= I18N::translate('Old data') ?>
47            </label>
48            <input class="form-control" type="text" id="oldged" name="oldged" value="<?= e($oldged) ?>">
49        </div>
50
51        <div class="form-group col-xs-6 col-md-3">
52            <label for="newged">
53                <?= I18N::translate('New data') ?>
54            </label>
55            <input class="form-control" type="text" id="newged" name="newged" value="<?= e($newged) ?>">
56        </div>
57
58        <div class="form-group col-xs-6 col-md-3">
59            <label for="username">
60                <?= I18N::translate('User') ?>
61            </label>
62            <?= Bootstrap4::select($user_list, $username, ['id' => 'username', 'name' => 'username']) ?>
63        </div>
64
65        <div class="form-group col-xs-6 col-md-3">
66            <label for="ged">
67                <?= I18N::translate('Family tree') ?>
68            </label>
69            <?= Bootstrap4::select($tree_list, $ged, ['id' => 'ged', 'name' => 'ged']) ?>
70        </div>
71    </div>
72
73    <div class="text-center">
74        <button type="submit" class="btn btn-primary">
75            <?= view('icons/search') ?>
76            <?= I18N::translate('search') ?>
77        </button>
78
79        <button type="submit" class="btn btn-secondary" onclick="document.logs.action.value='export';return true;" <?= $action === 'show' ? '' : 'disabled' ?>>
80            <?= view('icons/download') ?>
81            <?= /* I18N: A button label. */ I18N::translate('download') ?>
82        </button>
83
84        <button type="submit" class="btn btn-danger" data-confirm="<?= I18N::translate('Permanently delete these records?') ?>" onclick="if (confirm(this.dataset.confirm)) {document.logs.action.value='delete'; return true;} else {return false;}" <?= $action === 'show' ? '' : 'disabled' ?>>
85        <?= view('icons/delete') ?>
86            <?= I18N::translate('delete') ?>
87        </button>
88    </div>
89</form>
90
91<?php if ($action === 'show') : ?>
92    <table
93        class="table table-bordered table-sm table-hover table-site-changes datatables"
94        data-ajax="<?= route('admin-changes-log-data', ['from' => $from, 'to' => $to, 'type' => $type, 'xref' => $xref, 'oldged' => $oldged, 'newged' => $newged, 'ged' => $ged, 'username' => $username]) ?>"
95        data-server-side="true"
96        data-sorting="<?= e('[[ 0, "desc" ]]') ?>"
97    >
98        <caption class="sr-only">
99            <?= $title ?>
100        </caption>
101        <thead>
102            <tr>
103                <th data-visible="false"></th>
104                <th><?= I18N::translate('Timestamp') ?></th>
105                <th><?= I18N::translate('Status') ?></th>
106                <th><?= I18N::translate('Record') ?></th>
107                <th data-sortable="false"><?= I18N::translate('Data') ?></th>
108                <th><?= I18N::translate('User') ?></th>
109                <th><?= I18N::translate('Family tree') ?></th>
110            </tr>
111        </thead>
112    </table>
113<?php endif ?>
114