Merge pull request 'select current user as payer by default for new transaction' (!63) from feature/default-payer-is-current-user into master
All checks were successful
rvr-nextgen/pipeline/head This commit looks good

Reviewed-on: #63
This commit is contained in:
Bence Pőcze 2023-07-24 01:31:22 +02:00 committed by Gitea
commit 22b849a1c8
Signed by: Gitea
GPG Key ID: 7B89B83EED9AD2C6

View File

@ -36,7 +36,12 @@
<select class="big fullWidth" name="payer_user_id" required>
<option value="" hidden></option>
<?php foreach ($members as $member): ?>
<option value="<?= $member->getUser()->getId() ?>" <?= isset($transaction) && $transaction->getPayerUserId() === $member->getUser()->getId() ? 'selected' : '' ?>><?= $member->getUser()->getDisplayName() ?></option>
<option value="<?= $member->getUser()->getId() ?>"
<?= isset($transaction) ?
($transaction->getPayerUserId() === $member->getUser()->getId() ? 'selected' : '') :
(Container::$request->user()->getUniqueId() == $member->getUser()->getId() ? 'selected' : '') ?>>
<?= $member->getUser()->getDisplayName() ?>
</option>
<?php endforeach; ?>
</select>
<p class="formLabel marginTop">Payee(s)</p>