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