![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/html/webtrees/resources/views/ |
Upload File : |
<?php declare(strict_types=1); use Fisharebest\Webtrees\Http\RequestHandlers\MessagePage; use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesAcceptChange; use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesAcceptTree; use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesRejectChange; use Fisharebest\Webtrees\Http\RequestHandlers\PendingChangesRejectTree; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Tree; /** * @var array<array<object>> $changes * @var int $count * @var string $title * @var Tree $tree * @var string $url */ ?> <h2 class="wt-page-title"> <?= $title ?> <?php if ($count > count($changes)) : ?> — <?= I18N::translate('Showing %1$s to %2$s of %3$s', I18N::number(1), I18N::number(count($changes)), I18N::number($count)) ?> <?php endif ?> </h2> <?php if ($changes === []) : ?> <p> <?= I18N::translate('There are no pending changes.') ?> </p> <p> <a class="btn btn-primary" href="<?= e($url) ?>"> <?= I18N::translate('continue') ?> </a> </p> <?php endif ?> <?php foreach ($changes as $change) : ?> <h3 class="pt-2"> <a href="<?= e($change[0]->record->url()) ?>"><?= $change[0]->record->fullName() ?></a> </h3> <table class="table table-bordered table-sm"> <thead class="thead-default"> <tr> <th><?= I18N::translate('Accept') ?></th> <th><?= I18N::translate('Changes') ?></th> <th><?= I18N::translate('Editor') ?></th> <th><?= I18N::translate('Date') ?></th> <th><?= I18N::translate('Reject') ?></th> </tr> </thead> <tbody> <?php foreach ($change as $record_change) : ?> <tr> <td> <button type="button" class="btn btn-primary" data-wt-post-url="<?= e(route(PendingChangesAcceptChange::class, ['tree' => $tree->name(), 'xref' => $record_change->xref, 'change' => $record_change->change_id])) ?>"> <?= I18N::translate('Accept') ?> </button> </td> <td> <?php foreach ($record_change->record->facts() as $fact) : ?> <?php if (!str_ends_with($fact->tag(), ':CHAN') && $fact->isPendingAddition()) : ?> <div class="wt-new"> <?= strip_tags($fact->summary()) ?> </div> <?php elseif (!str_ends_with($fact->tag(), ':CHAN') && $fact->isPendingDeletion()) : ?> <div class="wt-old"> <?= strip_tags($fact->summary()) ?> </div> <?php endif ?> <?php endforeach ?> </td> <td> <a href="<?= e(route(MessagePage::class, ['to' => $record_change->user_name, 'subject' => I18N::translate('Pending changes') . ' - ' . strip_tags($record_change->record->fullName()), 'body' => $record_change->record->url(), 'tree' => $tree->name()])) ?>" title="<?= I18N::translate('Send a message') ?>"> <?= e($record_change->real_name) ?> - <?= e($record_change->user_name) ?> </a> </td> <td> <?= view('components/datetime', ['timestamp' => $record_change->change_time]) ?> </td> <td> <button type="button" class="btn btn-secondary" data-wt-post-url="<?= e(route(PendingChangesRejectChange::class, ['tree' => $tree->name(), 'xref' => $record_change->xref, 'change' => $record_change->change_id])) ?>"> <?= I18N::translate('Reject') ?> </button> </td> </tr> <?php endforeach ?> </tbody> </table> <?php endforeach ?> <?php if ($changes !== []) : ?> <div class="d-flex justify-content-between"> <button type="button" class="btn btn-primary" data-wt-post-url="<?= e(route(PendingChangesAcceptTree::class, ['tree' => $tree->name(), 'n' => count($changes)])) ?>"> <?= I18N::translate('Accept all changes') ?> </button> <button type="button" class="btn btn-secondary" data-wt-post-url="<?= e(route(PendingChangesRejectTree::class, ['tree' => $tree->name()])) ?>" data-wt-confirm="<?= I18N::translate('Are you sure you want to reject all the changes to this family tree?') ?>"> <?= I18N::translate('Reject all changes') ?> </button> </div> <?php endif ?>