select current user as payer by default for new transaction #63

Merged
bence merged 1 commits from feature/default-payer-is-current-user into master 2023-07-24 01:31:22 +02:00
Showing only changes of commit 492aa9fcef - Show all commits

View File

@ -36,7 +36,12 @@
<select class="big fullWidth" name="payer_user_id" required> <select class="big fullWidth" name="payer_user_id" required>
<option value="" hidden></option> <option value="" hidden></option>
<?php foreach ($members as $member): ?> <?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; ?> <?php endforeach; ?>
</select> </select>
<p class="formLabel marginTop">Payee(s)</p> <p class="formLabel marginTop">Payee(s)</p>