Compare commits
52
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75f0ae7668
|
||
|
|
b43ed72040
|
||
|
|
5dc4350b20
|
||
|
|
829588150a
|
||
|
|
54d901e45e
|
||
|
|
5e1692efdb
|
||
|
|
32733668ff
|
||
|
|
3034217ff8
|
||
|
|
c664b0a4bf
|
||
|
|
f397354c1e
|
||
|
|
e3992d9d55
|
||
|
|
0f7c9aa02f
|
||
|
|
b531589c52
|
||
|
|
dc824a0f70
|
||
|
|
1a06326589
|
||
|
|
9780aa62cb
|
||
|
|
cc3cfc15c8
|
||
|
|
a877484d56
|
||
|
|
da5c2121ba
|
||
|
|
73c7d8434e
|
||
|
|
3f7817fd1f
|
||
|
|
361671a362
|
||
|
|
b2babcf30f
|
||
|
|
ea579614b3
|
||
|
|
d8786e74d5
|
||
|
|
9e448e62c6
|
||
|
|
7f1177cc55
|
||
|
|
a941f5a1cd
|
||
|
|
ba5dfdbe4d
|
||
|
|
5557f00e57
|
||
|
|
baddc17b33
|
||
|
|
8d495c9f37
|
||
|
|
cc8f1e1ace
|
||
|
|
97e04d785c
|
||
|
|
0c102da1d7
|
||
|
|
7f882f2e71
|
||
|
|
cb76cbb9b1
|
||
|
|
1f32387f63
|
||
|
|
be93c75fe7
|
||
|
|
38d18873b8
|
||
|
|
5053d37388
|
||
|
|
c00be9a49d
|
||
|
|
881280fa3e
|
||
|
|
40eb8b5335
|
||
|
|
789e9e199f
|
||
|
|
be521a42ee
|
||
|
|
65424c2944
|
||
|
|
490e48a87a
|
||
|
|
b958a2f5b3
|
||
|
|
2da0ccb09b
|
||
|
|
584fcaba39
|
||
|
|
b5dc96f98b
|
No files matched your search
+1
-1
@@ -10,7 +10,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"esoko/soko-web": "0.8",
|
||||
"esoko/soko-web": "0.11",
|
||||
"firebase/php-jwt": "^6.4"
|
||||
},
|
||||
"require-dev": {
|
||||
|
||||
Generated
+79
-4
@@ -4,17 +4,92 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "a89a42e04596ab159fc41abbd9390068",
|
||||
"content-hash": "c17dd5eb82ff8f509a17404bd4c471b8",
|
||||
"packages": [
|
||||
{
|
||||
"name": "cocur/slugify",
|
||||
"version": "v4.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/cocur/slugify.git",
|
||||
"reference": "652234ef5f1be844a2ae1c36ad1b4c88b05160f9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/cocur/slugify/zipball/652234ef5f1be844a2ae1c36ad1b4c88b05160f9",
|
||||
"reference": "652234ef5f1be844a2ae1c36ad1b4c88b05160f9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-mbstring": "*",
|
||||
"php": "^7.1 || ~8.0.0 || ~8.1.0 || ~8.2.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/config": "<3.4 || >=4,<4.3",
|
||||
"symfony/dependency-injection": "<3.4 || >=4,<4.3",
|
||||
"symfony/http-kernel": "<3.4 || >=4,<4.3",
|
||||
"twig/twig": "<2.12.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"laravel/framework": "^5.0|^6.0|^7.0|^8.0",
|
||||
"latte/latte": "~2.2",
|
||||
"league/container": "^2.2.0",
|
||||
"mikey179/vfsstream": "~1.6.8",
|
||||
"mockery/mockery": "^1.3",
|
||||
"nette/di": "~2.4",
|
||||
"pimple/pimple": "~1.1",
|
||||
"plumphp/plum": "~0.1",
|
||||
"symfony/config": "^3.4 || ^4.3 || ^5.0 || ^6.0",
|
||||
"symfony/dependency-injection": "^3.4 || ^4.3 || ^5.0 || ^6.0",
|
||||
"symfony/http-kernel": "^3.4 || ^4.3 || ^5.0 || ^6.0",
|
||||
"symfony/phpunit-bridge": "^5.4 || ^6.0",
|
||||
"twig/twig": "^2.12.1 || ~3.0",
|
||||
"zendframework/zend-modulemanager": "~2.2",
|
||||
"zendframework/zend-servicemanager": "~2.2",
|
||||
"zendframework/zend-view": "~2.2"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Cocur\\Slugify\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Florian Eckerstorfer",
|
||||
"email": "florian@eckerstorfer.co",
|
||||
"homepage": "https://florian.ec"
|
||||
},
|
||||
{
|
||||
"name": "Ivo Bathke",
|
||||
"email": "ivo.bathke@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Converts a string into a slug.",
|
||||
"keywords": [
|
||||
"slug",
|
||||
"slugify"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/cocur/slugify/issues",
|
||||
"source": "https://github.com/cocur/slugify/tree/v4.3.0"
|
||||
},
|
||||
"time": "2022-12-07T19:48:48+00:00"
|
||||
},
|
||||
{
|
||||
"name": "esoko/soko-web",
|
||||
"version": "v0.8",
|
||||
"version": "v0.11",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://git.esoko.eu/esoko/soko-web.git",
|
||||
"reference": "219b42f995b8e34432da4dde77e53e24b75d78dd"
|
||||
"reference": "78f891fbff0dc8e5de5607529f4c8282f1dff40f"
|
||||
},
|
||||
"require": {
|
||||
"cocur/slugify": "^4.3",
|
||||
"phpmailer/phpmailer": "^6.8",
|
||||
"symfony/console": "^5.4",
|
||||
"vlucas/phpdotenv": "^5.5"
|
||||
@@ -33,7 +108,7 @@
|
||||
"GNU GPL 3.0"
|
||||
],
|
||||
"description": "Lightweight web framework",
|
||||
"time": "2023-05-01T17:08:22+00:00"
|
||||
"time": "2023-05-06T23:52:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "firebase/php-jwt",
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
use RVR\PersistentData\Model\Community;
|
||||
use SokoWeb\Database\Query\Select;
|
||||
|
||||
$select = new Select(Container::$dbConnection);
|
||||
$communities = Container::$persistentDataManager->selectMultipleFromDb($select, Community::class);
|
||||
|
||||
foreach ($communities as $community) {
|
||||
$community->generateSlug();
|
||||
Container::$persistentDataManager->saveToDb($community);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
ALTER TABLE `communities`
|
||||
ADD `slug` varchar(255) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL AFTER `id`,
|
||||
ADD UNIQUE `slug` (`slug`);
|
||||
@@ -1,9 +0,0 @@
|
||||
Hi,
|
||||
<br><br>
|
||||
You recently signed up on {{APP_NAME}} with this Google account ({{EMAIL}}).
|
||||
<br><br>
|
||||
Have fun on {{APP_NAME}}!
|
||||
<br><br>
|
||||
Regards,<br>
|
||||
{{APP_NAME}}<br>
|
||||
<a href="{{BASE_URL}}" title="{{APP_NAME}}">{{BASE_URL}}</a>
|
||||
@@ -1,18 +0,0 @@
|
||||
Hi,
|
||||
<br><br>
|
||||
You recently signed up on {{APP_NAME}} with this email address ({{EMAIL}}).
|
||||
To activate your account, please click on the following link:<br>
|
||||
<a href="{{ACTIVATE_LINK}}" title="Account activation">{{ACTIVATE_LINK}}</a>
|
||||
<br><br>
|
||||
You can activate your account until {{ACTIVATABLE_UNTIL}}.
|
||||
If you don't activate your account, your email address will be permanently deleted after this point of time.
|
||||
<br><br>
|
||||
If you did not sign up on {{APP_NAME}} or changed your mind, no further action is required.
|
||||
However if you want to immediately delete your email address, please click on the following link:<br>
|
||||
<a href="{{CANCEL_LINK}}" title="Sign up cancellation">{{CANCEL_LINK}}</a>
|
||||
<br><br>
|
||||
Have fun on {{APP_NAME}}!
|
||||
<br><br>
|
||||
Regards,<br>
|
||||
{{APP_NAME}}<br>
|
||||
<a href="{{BASE_URL}}" title="{{APP_NAME}}">{{BASE_URL}}</a>
|
||||
@@ -238,6 +238,7 @@ button.noRightRadius, a.button.noRightRadius {
|
||||
|
||||
button.gray, a.button.gray {
|
||||
background-color: #808080;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
button.gray:enabled:hover, button.gray:enabled:focus, a.button.gray:hover, a.button.gray:focus {
|
||||
@@ -246,6 +247,7 @@ button.gray:enabled:hover, button.gray:enabled:focus, a.button.gray:hover, a.but
|
||||
|
||||
button.red, a.button.red {
|
||||
background-color: #aa5e5e;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
button.red:enabled:hover, button.red:enabled:focus, a.button.red:hover, a.button.red:focus {
|
||||
@@ -402,6 +404,10 @@ header>p>span>a:link, header>p>span>a:visited {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
header>p>span>a:hover, header>p>span>a:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
header>p>span:not(:last-child) {
|
||||
border-right: solid white 1px;
|
||||
padding-right: 6px;
|
||||
@@ -526,8 +532,9 @@ p.paginateContainer > *:not(:last-child) {
|
||||
border-right: solid #869ab9 1px;
|
||||
}
|
||||
|
||||
.choices__inner {
|
||||
box-sizing: border-box;
|
||||
p.formLabel {
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 424px) {
|
||||
|
||||
@@ -59,11 +59,10 @@ var Account = {
|
||||
};
|
||||
|
||||
(function () {
|
||||
document.getElementById('authenticateWithGoogleButton').onclick = function () {
|
||||
var authenticateWithGoogleButton = document.getElementById('authenticateWithGoogleButton');
|
||||
if (authenticateWithGoogleButton) {
|
||||
authenticateWithGoogleButton.onclick = function () {
|
||||
Account.openGoogleAuthenticate();
|
||||
};
|
||||
|
||||
document.getElementsByTagName('form')[0].onreset = function () {
|
||||
Account.resetGoogleAuthentication();
|
||||
};
|
||||
}
|
||||
})();
|
||||
@@ -1,17 +1,30 @@
|
||||
(function () {
|
||||
const element = document.getElementById('newMember').elements['user_id'];
|
||||
const choices = new Choices(element, {
|
||||
noResultsText: 'No users found',
|
||||
noChoicesText: 'Start typing to search users'
|
||||
const select = new TomSelect(element, {
|
||||
valueField: 'value',
|
||||
labelField: 'label',
|
||||
searchField: 'label',
|
||||
loadThrottle: 300,
|
||||
load: function (query, callback) {
|
||||
var self = this;
|
||||
RVR.httpRequest('GET', searchUserUrl.replace('QUERY', encodeURIComponent(query)), function () {
|
||||
self.clearOptions();
|
||||
callback(this.response.results);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
element.addEventListener('search', RVR.debounce(async function (e) {
|
||||
RVR.httpRequest('GET', searchUserUrl.replace('QUERY', encodeURIComponent(e.detail.value)), function () {
|
||||
choices.setChoices(this.response.results, 'value', 'label', true);
|
||||
select.on('change', function (value) {
|
||||
this.clearOptions();
|
||||
});
|
||||
}));
|
||||
|
||||
element.addEventListener('choice', function () {
|
||||
choices.setChoices([], 'value', 'label', true);
|
||||
select.on('blur', function (value) {
|
||||
this.clearOptions();
|
||||
});
|
||||
|
||||
select.on('type', function (value) {
|
||||
if (value === '') {
|
||||
this.clearOptions();
|
||||
}
|
||||
});
|
||||
})();
|
||||
+32
-2
@@ -88,6 +88,28 @@ var RVR = {
|
||||
}
|
||||
},
|
||||
|
||||
setOnclickForFormConfirmation: function (button) {
|
||||
button.onclick = function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var self = this;
|
||||
|
||||
RVR.showModalWithContent('Confirmation', this.dataset.confirmation, [
|
||||
{
|
||||
type: 'button',
|
||||
html: this.dataset.confirmationButton ? this.dataset.confirmationButton : this.innerHTML,
|
||||
classNames: ['red'],
|
||||
onclick: function() {
|
||||
var event = new Event('submit', {'bubbles': true, 'cancelable': true});
|
||||
self.form.dispatchEvent(event);
|
||||
|
||||
RVR.hideModal();
|
||||
}
|
||||
}
|
||||
]);
|
||||
};
|
||||
},
|
||||
|
||||
showModal: function (id) {
|
||||
document.getElementById(id).style.visibility = 'visible';
|
||||
document.getElementById('cover').style.visibility = 'visible';
|
||||
@@ -125,7 +147,11 @@ var RVR = {
|
||||
|
||||
button.classList.add('marginTop');
|
||||
button.classList.add('marginRight');
|
||||
if (typeof extraButton.html !== 'undefined') {
|
||||
button.innerHTML = extraButton.html;
|
||||
} else {
|
||||
button.textContent = extraButton.text;
|
||||
}
|
||||
|
||||
if (extraButton.type === 'a') {
|
||||
button.href = extraButton.href;
|
||||
@@ -174,7 +200,7 @@ var RVR = {
|
||||
}
|
||||
}
|
||||
|
||||
form.elements.submit.disabled = !anyChanged;
|
||||
form.elements['submit_button'].disabled = !anyChanged;
|
||||
},
|
||||
|
||||
observeInputsInForm: function (form, observedInputs) {
|
||||
@@ -197,7 +223,7 @@ var RVR = {
|
||||
}
|
||||
|
||||
form.onreset = function () {
|
||||
form.elements.submit.disabled = true;
|
||||
form.elements['submit_button'].disabled = true;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -234,6 +260,10 @@ var RVR = {
|
||||
if (form.dataset.observeInputs) {
|
||||
RVR.observeInputsInForm(form, form.dataset.observeInputs.split(','));
|
||||
}
|
||||
|
||||
if (form.elements['submit_button'] && form.elements['submit_button'].dataset.confirmation) {
|
||||
RVR.setOnclickForFormConfirmation(form.elements['submit_button']);
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('cover').onclick = function () {
|
||||
|
||||
Generated
+20
-34
@@ -2,33 +2,23 @@
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"@babel/runtime": {
|
||||
"version": "7.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.0.tgz",
|
||||
"integrity": "sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==",
|
||||
"@fortawesome/fontawesome-free": {
|
||||
"version": "6.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.4.0.tgz",
|
||||
"integrity": "sha512-0NyytTlPJwB/BF5LtRV8rrABDbe3TdTXqNB3PdZ+UUUZAEIrdOJdmABqKjt4AXwIoJNaRVVZEXxpNrqvE1GAYQ=="
|
||||
},
|
||||
"@orchidjs/sifter": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@orchidjs/sifter/-/sifter-1.0.3.tgz",
|
||||
"integrity": "sha512-zCZbwKegHytfsPm8Amcfh7v/4vHqTAaOu6xFswBYcn8nznBOuseu6COB2ON7ez0tFV0mKL0nRNnCiZZA+lU9/g==",
|
||||
"requires": {
|
||||
"regenerator-runtime": "^0.13.11"
|
||||
"@orchidjs/unicode-variants": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"choices.js": {
|
||||
"version": "10.2.0",
|
||||
"resolved": "https://registry.npmjs.org/choices.js/-/choices.js-10.2.0.tgz",
|
||||
"integrity": "sha512-8PKy6wq7BMjNwDTZwr3+Zry6G2+opJaAJDDA/j3yxvqSCnvkKe7ZIFfIyOhoc7htIWFhsfzF9tJpGUATcpUtPg==",
|
||||
"requires": {
|
||||
"deepmerge": "^4.2.2",
|
||||
"fuse.js": "^6.6.2",
|
||||
"redux": "^4.2.0"
|
||||
}
|
||||
},
|
||||
"deepmerge": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
||||
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="
|
||||
},
|
||||
"fuse.js": {
|
||||
"version": "6.6.2",
|
||||
"resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-6.6.2.tgz",
|
||||
"integrity": "sha512-cJaJkxCCxC8qIIcPBF9yGxY0W/tVZS3uEISDxhYIdtk8OL93pe+6Zj7LjCqVV4dzbqcriOZ+kQ/NE4RXZHsIGA=="
|
||||
"@orchidjs/unicode-variants": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@orchidjs/unicode-variants/-/unicode-variants-1.0.4.tgz",
|
||||
"integrity": "sha512-NvVBRnZNE+dugiXERFsET1JlKZfM5lJDEpSMilKW4bToYJ7pxf0Zne78xyXB2ny2c2aHfJ6WLnz1AaTNHAmQeQ=="
|
||||
},
|
||||
"leaflet": {
|
||||
"version": "1.9.3",
|
||||
@@ -40,18 +30,14 @@
|
||||
"resolved": "https://registry.npmjs.org/leaflet.markercluster/-/leaflet.markercluster-1.5.3.tgz",
|
||||
"integrity": "sha512-vPTw/Bndq7eQHjLBVlWpnGeLa3t+3zGiuM7fJwCkiMFq+nmRuG3RI3f7f4N4TDX7T4NpbAXpR2+NTRSEGfCSeA=="
|
||||
},
|
||||
"redux": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz",
|
||||
"integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==",
|
||||
"tom-select": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/tom-select/-/tom-select-2.2.2.tgz",
|
||||
"integrity": "sha512-igGah1yY6yhrnN2h/Ky8I5muw/nE/YQxIsEZoYu5qaA4bsRibvKto3s8QZZosKpOd0uO8fNYhRfAwgHB4IAYew==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.9.2"
|
||||
"@orchidjs/sifter": "^1.0.3",
|
||||
"@orchidjs/unicode-variants": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"regenerator-runtime": {
|
||||
"version": "0.13.11",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
|
||||
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-free": "^6.4.0",
|
||||
"leaflet": "^1.6.0",
|
||||
"leaflet.markercluster": "^1.4.1",
|
||||
"choices.js": "^10.2.0"
|
||||
"tom-select": "^2.2.2"
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ use RVR\Repository\CommunityRepository;
|
||||
use RVR\Repository\CommunityMemberRepository;
|
||||
use RVR\Repository\CurrencyExchangeRateRepository;
|
||||
use RVR\Repository\CurrencyRepository;
|
||||
use RVR\Repository\TransactionRepository;
|
||||
use RVR\Repository\UserRepository;
|
||||
use SokoWeb\Interfaces\Authentication\IAuthenticationRequired;
|
||||
use SokoWeb\Interfaces\Response\IContent;
|
||||
@@ -29,6 +30,8 @@ class CommunityController implements IAuthenticationRequired
|
||||
|
||||
private CurrencyExchangeRateRepository $currencyExchangeRatesRepository;
|
||||
|
||||
private TransactionRepository $transactionRepository;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->userRepository = new UserRepository();
|
||||
@@ -36,6 +39,7 @@ class CommunityController implements IAuthenticationRequired
|
||||
$this->communityMemberRepository = new CommunityMemberRepository();
|
||||
$this->currencyRepository = new CurrencyRepository();
|
||||
$this->currencyExchangeRatesRepository = new CurrencyExchangeRateRepository();
|
||||
$this->transactionRepository = new TransactionRepository();
|
||||
}
|
||||
|
||||
public function isAuthenticationRequired(): bool
|
||||
@@ -45,7 +49,7 @@ class CommunityController implements IAuthenticationRequired
|
||||
|
||||
public function getCommunityHome(): ?IContent
|
||||
{
|
||||
if (!$this->checkPermission(\Container::$request->query('communityId'), false, $community, $ownCommunityMember)) {
|
||||
if (!$this->checkPermission(\Container::$request->query('communitySlug'), false, $community, $ownCommunityMember)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -53,36 +57,48 @@ class CommunityController implements IAuthenticationRequired
|
||||
|
||||
$balanceCalculator = new BalanceCalculator($community);
|
||||
$debts = $balanceCalculator->calculate();
|
||||
$debtUsers = [];
|
||||
$debtItems = [];
|
||||
$debtBalance = 0.0;
|
||||
$outstandingUsers = [];
|
||||
$outstandingItems = [];
|
||||
$outstandingBalance = 0.0;
|
||||
foreach ($debts as $debt) {
|
||||
if ($debt['payer']->getId() === \Container::$request->user()->getUniqueId()) {
|
||||
$debtBalance += $debt['amount'];
|
||||
$debtUsers[] = $debt;
|
||||
$debtItems[] = $debt;
|
||||
}
|
||||
if ($debt['payee']->getId() === \Container::$request->user()->getUniqueId()) {
|
||||
$outstandingBalance += $debt['amount'];
|
||||
$outstandingUsers[] = $debt;
|
||||
$outstandingItems[] = $debt;
|
||||
}
|
||||
}
|
||||
$balance = $outstandingBalance - $debtBalance;
|
||||
|
||||
return new HtmlContent('communities/community', [
|
||||
'community' => $community,
|
||||
'members' => $this->getMembers($community),
|
||||
'currencies' => $this->getCurrencies($community),
|
||||
'upcomingEvents' => [],
|
||||
'debtUsers' => $debtUsers,
|
||||
'debtItems' => $debtItems,
|
||||
'debtBalance' => $debtBalance,
|
||||
'outstandingUsers' => $outstandingUsers,
|
||||
'outstandingItems' => $outstandingItems,
|
||||
'outstandingBalance' => $outstandingBalance,
|
||||
'balance' => $balance,
|
||||
'editPermission' => $ownCommunityMember->getOwner()
|
||||
]);
|
||||
}
|
||||
|
||||
public function getCommunitySettings(): ?IContent
|
||||
{
|
||||
if (!$this->checkPermission(\Container::$request->query('communitySlug'), false, $community, $ownCommunityMember)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new HtmlContent('communities/community_settings', [
|
||||
'community' => $community,
|
||||
'members' => $this->getMembers($community),
|
||||
'currencies' => $this->getCurrencies($community),
|
||||
'editPermission' => $ownCommunityMember->getOwner()
|
||||
]);
|
||||
}
|
||||
|
||||
public function getCommunityNew(): IContent
|
||||
{
|
||||
return new HtmlContent('communities/community_edit');
|
||||
@@ -90,7 +106,7 @@ class CommunityController implements IAuthenticationRequired
|
||||
|
||||
public function getCommunityEdit(): ?IContent
|
||||
{
|
||||
if (!$this->checkPermission(\Container::$request->query('communityId'), true, $community, $ownCommunityMember)) {
|
||||
if (!$this->checkPermission(\Container::$request->query('communitySlug'), true, $community, $ownCommunityMember)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -108,9 +124,9 @@ class CommunityController implements IAuthenticationRequired
|
||||
]);
|
||||
}
|
||||
|
||||
$communityId = \Container::$request->query('communityId');
|
||||
if ($communityId){
|
||||
if (!$this->checkPermission($communityId, true, $community, $ownCommunityMember)) {
|
||||
$communitySlug = \Container::$request->query('communitySlug');
|
||||
if ($communitySlug){
|
||||
if (!$this->checkPermission($communitySlug, true, $community, $ownCommunityMember)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
@@ -129,7 +145,7 @@ class CommunityController implements IAuthenticationRequired
|
||||
$community->setName($name);
|
||||
\Container::$persistentDataManager->saveToDb($community);
|
||||
|
||||
if (!$communityId) {
|
||||
if (!$communitySlug) {
|
||||
/**
|
||||
* @var User $user
|
||||
*/
|
||||
@@ -152,13 +168,13 @@ class CommunityController implements IAuthenticationRequired
|
||||
}
|
||||
|
||||
return new JsonContent([
|
||||
'redirect' => ['target' => \Container::$routeCollection->getRoute('community')->generateLink(['communityId' => $community->getId()])]
|
||||
'redirect' => ['target' => \Container::$routeCollection->getRoute('community')->generateLink(['communitySlug' => $community->getSlug()])]
|
||||
]);
|
||||
}
|
||||
|
||||
public function getMembersEdit(): ?IContent
|
||||
{
|
||||
if (!$this->checkPermission(\Container::$request->query('communityId'), true, $community, $ownCommunityMember)) {
|
||||
if (!$this->checkPermission(\Container::$request->query('communitySlug'), true, $community, $ownCommunityMember)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -170,7 +186,7 @@ class CommunityController implements IAuthenticationRequired
|
||||
|
||||
public function saveMember(): ?IContent
|
||||
{
|
||||
if (!$this->checkPermission(\Container::$request->query('communityId'), true, $community, $ownCommunityMember)) {
|
||||
if (!$this->checkPermission(\Container::$request->query('communitySlug'), true, $community, $ownCommunityMember)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -183,7 +199,19 @@ class CommunityController implements IAuthenticationRequired
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
if ($this->transactionRepository->isAnyCommon()) {
|
||||
return new JsonContent([
|
||||
'error' => ['errorText' => 'There are transactions with common payee!']
|
||||
]);
|
||||
}
|
||||
|
||||
$user = $this->userRepository->getById(\Container::$request->post('user_id'));
|
||||
if ($this->communityMemberRepository->getByCommunityAndUser($community, $user) !== null) {
|
||||
return new JsonContent([
|
||||
'error' => ['errorText' => 'This user is already a member of this community.']
|
||||
]);
|
||||
}
|
||||
|
||||
$communityMember = new CommunityMember();
|
||||
$communityMember->setCommunity($community);
|
||||
$communityMember->setUser($user);
|
||||
@@ -197,7 +225,7 @@ class CommunityController implements IAuthenticationRequired
|
||||
|
||||
public function deleteMember(): ?IContent
|
||||
{
|
||||
if (!$this->checkPermission(\Container::$request->query('communityId'), true, $community, $ownCommunityMember)) {
|
||||
if (!$this->checkPermission(\Container::$request->query('communitySlug'), true, $community, $ownCommunityMember)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -208,6 +236,13 @@ class CommunityController implements IAuthenticationRequired
|
||||
]);
|
||||
}
|
||||
|
||||
\Container::$persistentDataManager->loadRelationsFromDb($communityMember, false, ['user']);
|
||||
if ($this->transactionRepository->isAnyForUser($communityMember->getUser())) {
|
||||
return new JsonContent([
|
||||
'error' => ['errorText' => 'There are transactions where the member is payer or payee!']
|
||||
]);
|
||||
}
|
||||
|
||||
\Container::$persistentDataManager->deleteFromDb($communityMember);
|
||||
|
||||
return new JsonContent(['success' => true]);
|
||||
@@ -215,7 +250,7 @@ class CommunityController implements IAuthenticationRequired
|
||||
|
||||
public function getCurrenciesEdit(): ?IContent
|
||||
{
|
||||
if (!$this->checkPermission(\Container::$request->query('communityId'), true, $community, $ownCommunityMember)) {
|
||||
if (!$this->checkPermission(\Container::$request->query('communitySlug'), true, $community, $ownCommunityMember)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -227,7 +262,7 @@ class CommunityController implements IAuthenticationRequired
|
||||
|
||||
public function saveCurrency(): ?IContent
|
||||
{
|
||||
if (!$this->checkPermission(\Container::$request->query('communityId'), true, $community, $ownCommunityMember)) {
|
||||
if (!$this->checkPermission(\Container::$request->query('communitySlug'), true, $community, $ownCommunityMember)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -263,7 +298,7 @@ class CommunityController implements IAuthenticationRequired
|
||||
|
||||
public function deleteCurrency(): ?IContent
|
||||
{
|
||||
if (!$this->checkPermission(\Container::$request->query('communityId'), true, $community, $ownCommunityMember)) {
|
||||
if (!$this->checkPermission(\Container::$request->query('communitySlug'), true, $community, $ownCommunityMember)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -272,6 +307,16 @@ class CommunityController implements IAuthenticationRequired
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($this->transactionRepository->isAnyForCurrency($currency)) {
|
||||
return new JsonContent([
|
||||
'error' => ['errorText' => 'There are transactions with this currency!']
|
||||
]);
|
||||
}
|
||||
|
||||
foreach ($this->currencyExchangeRatesRepository->getAllByCurrency($currency) as $currencyExchangeRate) {
|
||||
\Container::$persistentDataManager->deleteFromDb($currencyExchangeRate);
|
||||
}
|
||||
|
||||
\Container::$persistentDataManager->deleteFromDb($currency);
|
||||
|
||||
return new JsonContent(['success' => true]);
|
||||
@@ -279,7 +324,7 @@ class CommunityController implements IAuthenticationRequired
|
||||
|
||||
public function getCurrencyExchangeRates(): ?IContent
|
||||
{
|
||||
if (!$this->checkPermission(\Container::$request->query('communityId'), true, $community, $ownCommunityMember)) {
|
||||
if (!$this->checkPermission(\Container::$request->query('communitySlug'), true, $community, $ownCommunityMember)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -300,7 +345,7 @@ class CommunityController implements IAuthenticationRequired
|
||||
|
||||
public function saveCurrencyExchangeRate(): ?IContent
|
||||
{
|
||||
if (!$this->checkPermission(\Container::$request->query('communityId'), true, $community, $ownCommunityMember)) {
|
||||
if (!$this->checkPermission(\Container::$request->query('communitySlug'), true, $community, $ownCommunityMember)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -333,7 +378,7 @@ class CommunityController implements IAuthenticationRequired
|
||||
|
||||
public function deleteCurrencyExchangeRate(): ?IContent
|
||||
{
|
||||
if (!$this->checkPermission(\Container::$request->query('communityId'), true, $community, $ownCommunityMember)) {
|
||||
if (!$this->checkPermission(\Container::$request->query('communitySlug'), true, $community, $ownCommunityMember)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -370,12 +415,12 @@ class CommunityController implements IAuthenticationRequired
|
||||
}
|
||||
|
||||
private function checkPermission(
|
||||
int $communityId,
|
||||
string $communitySlug,
|
||||
bool $needToBeOwner,
|
||||
?Community &$community,
|
||||
?CommunityMember &$ownCommunityMember): bool
|
||||
{
|
||||
$community = $this->communityRepository->getById($communityId);
|
||||
$community = $this->communityRepository->getBySlug($communitySlug);
|
||||
if ($community === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class LoginController
|
||||
$oAuth = new GoogleOAuth(new Request());
|
||||
$url = $oAuth->getDialogUrl(
|
||||
$state,
|
||||
\Container::$request->getBase() . \Container::$routeCollection->getRoute('login-google-action')->generateLink(),
|
||||
\Container::$request->getBase() . \Container::$routeCollection->getRoute('login.google-action')->generateLink(),
|
||||
$nonce
|
||||
);
|
||||
|
||||
@@ -106,7 +106,7 @@ class LoginController
|
||||
return new JsonContent([
|
||||
'error' => [
|
||||
'errorText' => 'No user found with the given email address / username or the given password is wrong. You can <a href="' .
|
||||
\Container::$routeCollection->getRoute('password-requestReset')->generateLink(['email' => \Container::$request->post('email')]) . '" title="Request password reset">request password reset</a>!'
|
||||
\Container::$routeCollection->getRoute('password.requestReset')->generateLink(['email' => \Container::$request->post('email')]) . '" title="Request password reset">request password reset</a>!'
|
||||
]
|
||||
]);
|
||||
}
|
||||
@@ -119,7 +119,7 @@ class LoginController
|
||||
|
||||
public function loginWithGoogle()
|
||||
{
|
||||
$defaultError = 'Authentication with Google failed. Please <a href="' . \Container::$routeCollection->getRoute('login-google')->generateLink() . '" title="Login with Google">try again</a>!';
|
||||
$defaultError = 'Authentication with Google failed. Please <a href="' . \Container::$routeCollection->getRoute('login.google')->generateLink() . '" title="Login with Google">try again</a>!';
|
||||
|
||||
if (\Container::$request->user() !== null) {
|
||||
$this->deleteRedirectUrl();
|
||||
@@ -133,7 +133,7 @@ class LoginController
|
||||
$oAuth = new GoogleOAuth(new Request());
|
||||
$tokenData = $oAuth->getToken(
|
||||
\Container::$request->query('code'),
|
||||
\Container::$request->getBase() . \Container::$routeCollection->getRoute('login-google-action')->generateLink()
|
||||
\Container::$request->getBase() . \Container::$routeCollection->getRoute('login.google-action')->generateLink()
|
||||
);
|
||||
|
||||
if (!isset($tokenData['id_token'])) {
|
||||
@@ -246,7 +246,7 @@ class LoginController
|
||||
if ($resetter === null || $resetter->getExpiresDate() < new DateTime()) {
|
||||
return new JsonContent([
|
||||
'redirect' => [
|
||||
'target' => \Container::$routeCollection->getRoute('password-reset')->generateLink(['token' => $token])
|
||||
'target' => \Container::$routeCollection->getRoute('password.reset')->generateLink(['token' => $token])
|
||||
]
|
||||
]);
|
||||
}
|
||||
@@ -284,7 +284,7 @@ class LoginController
|
||||
$mail->setBodyFromTemplate('password-reset', [
|
||||
'EMAIL' => $email,
|
||||
'RESET_LINK' => \Container::$request->getBase() .
|
||||
\Container::$routeCollection->getRoute('password-reset')->generateLink(['token' => $token]),
|
||||
\Container::$routeCollection->getRoute('password.reset')->generateLink(['token' => $token]),
|
||||
'EXPIRES' => $expires->format('Y-m-d H:i T')
|
||||
]);
|
||||
$mail->send();
|
||||
|
||||
@@ -104,10 +104,10 @@ class OAuthController
|
||||
{
|
||||
return new JsonContent([
|
||||
'issuer' => $_ENV['APP_URL'],
|
||||
'authorization_endpoint' => \Container::$request->getBase() . \Container::$routeCollection->getRoute('oauth-auth')->generateLink(),
|
||||
'token_endpoint' => \Container::$request->getBase() . \Container::$routeCollection->getRoute('oauth-token')->generateLink(),
|
||||
'userinfo_endpoint' => \Container::$request->getBase() . \Container::$routeCollection->getRoute('oauth-userinfo')->generateLink(),
|
||||
'jwks_uri' => \Container::$request->getBase() . \Container::$routeCollection->getRoute('oauth-certs')->generateLink(),
|
||||
'authorization_endpoint' => \Container::$request->getBase() . \Container::$routeCollection->getRoute('oauth.auth')->generateLink(),
|
||||
'token_endpoint' => \Container::$request->getBase() . \Container::$routeCollection->getRoute('oauth.token')->generateLink(),
|
||||
'userinfo_endpoint' => \Container::$request->getBase() . \Container::$routeCollection->getRoute('oauth.userinfo')->generateLink(),
|
||||
'jwks_uri' => \Container::$request->getBase() . \Container::$routeCollection->getRoute('oauth.certs')->generateLink(),
|
||||
'response_types_supported' =>
|
||||
[
|
||||
'code',
|
||||
|
||||
@@ -46,8 +46,8 @@ class TransactionController implements IAuthenticationRequired, ISecured
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
$communityId = \Container::$request->query('communityId');
|
||||
$this->community = $this->communityRepository->getById($communityId);
|
||||
$communitySlug = \Container::$request->query('communitySlug');
|
||||
$this->community = $this->communityRepository->getBySlug($communitySlug);
|
||||
if ($this->community === null) {
|
||||
return false;
|
||||
}
|
||||
@@ -86,6 +86,7 @@ class TransactionController implements IAuthenticationRequired, ISecured
|
||||
'exchangeRateCalculator' => $exchangeRateCalculator,
|
||||
'pages' => $pages,
|
||||
'currentPage' => $currentPage,
|
||||
'numberOfTransactions' => $numberOfTransactions,
|
||||
'transactions' => $transactions
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,130 @@ class UserController implements IAuthenticationRequired
|
||||
return new HtmlContent('account/account', ['user' => $user->toArray()]);
|
||||
}
|
||||
|
||||
public function getGoogleConnectRedirect(): IRedirect
|
||||
{
|
||||
/**
|
||||
* @var User $user
|
||||
*/
|
||||
$user = \Container::$request->user();
|
||||
|
||||
$state = bin2hex(random_bytes(16));
|
||||
$nonce = bin2hex(random_bytes(16));
|
||||
|
||||
\Container::$request->session()->set('oauth_state', $state);
|
||||
\Container::$request->session()->set('oauth_nonce', $nonce);
|
||||
|
||||
$oAuth = new GoogleOAuth(new Request());
|
||||
|
||||
$url = $oAuth->getDialogUrl(
|
||||
$state,
|
||||
\Container::$request->getBase() . \Container::$routeCollection->getRoute('account.googleConnect-confirm')->generateLink(),
|
||||
$nonce,
|
||||
$user->getEmail()
|
||||
);
|
||||
|
||||
return new Redirect($url, IRedirect::TEMPORARY);
|
||||
}
|
||||
|
||||
public function getGoogleConnectConfirm(): IContent
|
||||
{
|
||||
$defaultError = 'Authentication with Google failed. Please <a href="' . \Container::$routeCollection->getRoute('account.googleConnect')->generateLink() . '" title="Connect with Google">try again</a>!';
|
||||
|
||||
if (\Container::$request->query('state') !== \Container::$request->session()->get('oauth_state')) {
|
||||
return new HtmlContent('account/google_connect', ['success' => false, 'error' => $defaultError]);
|
||||
}
|
||||
|
||||
$oAuth = new GoogleOAuth(new Request());
|
||||
$tokenData = $oAuth->getToken(
|
||||
\Container::$request->query('code'),
|
||||
\Container::$request->getBase() . \Container::$routeCollection->getRoute('account.googleConnect-confirm')->generateLink()
|
||||
);
|
||||
if (!isset($tokenData['id_token'])) {
|
||||
return new HtmlContent('account/google_connect', ['success' => false, 'error' => $defaultError]);
|
||||
}
|
||||
|
||||
$jwtParser = new JwtParser($tokenData['id_token']);
|
||||
$idToken = $jwtParser->getPayload();
|
||||
if ($idToken['nonce'] !== \Container::$request->session()->get('oauth_nonce')) {
|
||||
return new HtmlContent('account/google_connect', ['success' => false, 'error' => $defaultError]);
|
||||
}
|
||||
|
||||
$anotherUser = $this->userRepository->getByGoogleSub($idToken['sub']);
|
||||
if ($anotherUser !== null) {
|
||||
return new HtmlContent('account/google_connect', [
|
||||
'success' => false,
|
||||
'error' => 'This Google account is linked to another account.'
|
||||
]);
|
||||
}
|
||||
|
||||
\Container::$request->session()->set('google_user_data', $idToken);
|
||||
|
||||
/**
|
||||
* @var User $user
|
||||
*/
|
||||
$user = \Container::$request->user();
|
||||
|
||||
return new HtmlContent('account/google_connect', [
|
||||
'success' => true,
|
||||
'googleAccount' => $idToken['email'],
|
||||
'userEmail' => $user->getEmail()
|
||||
]);
|
||||
}
|
||||
|
||||
public function connectGoogle(): IContent
|
||||
{
|
||||
/**
|
||||
* @var User $user
|
||||
*/
|
||||
$user = \Container::$request->user();
|
||||
if (!$user->checkPassword(\Container::$request->post('password'))) {
|
||||
return new JsonContent([
|
||||
'error' => [
|
||||
'errorText' => 'The given password is wrong.'
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
$googleUserData = \Container::$request->session()->get('google_user_data');
|
||||
$user->setGoogleSub($googleUserData['sub']);
|
||||
\Container::$persistentDataManager->saveToDb($user);
|
||||
|
||||
return new JsonContent(['success' => true]);
|
||||
}
|
||||
|
||||
public function getGoogleDisconnectConfirm(): IContent
|
||||
{
|
||||
/**
|
||||
* @var User $user
|
||||
*/
|
||||
$user = \Container::$request->user();
|
||||
|
||||
return new HtmlContent('account/google_disconnect', [
|
||||
'success' => true,
|
||||
'userEmail' => $user->getEmail()
|
||||
]);
|
||||
}
|
||||
|
||||
public function disconnectGoogle(): IContent
|
||||
{
|
||||
/**
|
||||
* @var User $user
|
||||
*/
|
||||
$user = \Container::$request->user();
|
||||
if (!$user->checkPassword(\Container::$request->post('password'))) {
|
||||
return new JsonContent([
|
||||
'error' => [
|
||||
'errorText' => 'The given password is wrong.'
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
$user->setGoogleSub(null);
|
||||
\Container::$persistentDataManager->saveToDb($user);
|
||||
|
||||
return new JsonContent(['success' => true]);
|
||||
}
|
||||
|
||||
public function getGoogleAuthenticateRedirect(): IRedirect
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -41,7 +41,7 @@ class ExchangeRateCalculator
|
||||
|
||||
$currentExchangeRate = null;
|
||||
foreach ($this->exchangeRates[$currency->getId()] as $exchangeRate) {
|
||||
if ($exchangeRate->getValidFrom() > $time) {
|
||||
if ($exchangeRate->getValidFromDate() > $time) {
|
||||
break;
|
||||
}
|
||||
$currentExchangeRate = $exchangeRate;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php namespace RVR\PersistentData\Model;
|
||||
|
||||
use DateTime;
|
||||
use SokoWeb\PersistentData\Model\Model;
|
||||
use SokoWeb\PersistentData\Model\ModelWithSlug;
|
||||
|
||||
class Community extends Model
|
||||
class Community extends ModelWithSlug
|
||||
{
|
||||
protected static string $table = 'communities';
|
||||
|
||||
@@ -11,6 +11,8 @@ class Community extends Model
|
||||
|
||||
protected static array $relations = ['main_currency' => Currency::class];
|
||||
|
||||
protected static string $slugSource = 'name';
|
||||
|
||||
private string $name = '';
|
||||
|
||||
private string $currency = '';
|
||||
|
||||
@@ -8,4 +8,9 @@ class CommunityRepository
|
||||
{
|
||||
return \Container::$persistentDataManager->selectFromDbById($id, Community::class);
|
||||
}
|
||||
|
||||
public function getBySlug(string $slug): ?Community
|
||||
{
|
||||
return \Container::$persistentDataManager->selectFromDbBySlug($slug, Community::class);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,9 @@
|
||||
use Container;
|
||||
use Generator;
|
||||
use RVR\PersistentData\Model\Community;
|
||||
use RVR\PersistentData\Model\Currency;
|
||||
use RVR\PersistentData\Model\Transaction;
|
||||
use RVR\PersistentData\Model\User;
|
||||
use SokoWeb\Database\Query\Select;
|
||||
|
||||
class TransactionRepository
|
||||
@@ -25,6 +27,32 @@ class TransactionRepository
|
||||
return $this->selectAllByCommunity($community)->count();
|
||||
}
|
||||
|
||||
public function isAnyForUser(User $user): bool
|
||||
{
|
||||
$select = new Select(Container::$dbConnection, Transaction::getTable());
|
||||
$select->where('payer_user_id', '=', $user->getId());
|
||||
$select->orWhere('payee_user_id', '=', $user->getId());
|
||||
$select->orWhere('payee_user_id', '=', null);
|
||||
|
||||
return $select->count() > 0;
|
||||
}
|
||||
|
||||
public function isAnyCommon(): bool
|
||||
{
|
||||
$select = new Select(Container::$dbConnection, Transaction::getTable());
|
||||
$select->where('payee_user_id', '=', null);
|
||||
|
||||
return $select->count() > 0;
|
||||
}
|
||||
|
||||
public function isAnyForCurrency(Currency $currency): bool
|
||||
{
|
||||
$select = new Select(Container::$dbConnection, Transaction::getTable());
|
||||
$select->where('currency_id', '=', $currency->getId());
|
||||
|
||||
return $select->count() > 0;
|
||||
}
|
||||
|
||||
public function getPagedByCommunity(Community $community, int $start, int $limit, bool $useRelations = false, array $withRelations = []): Generator
|
||||
{
|
||||
$select = new Select(Container::$dbConnection);
|
||||
|
||||
+33
-13
@@ -9,32 +9,52 @@
|
||||
<?php if ($user['password'] !== null && $user['google_sub'] !== null): ?>
|
||||
<p class="justify small">Please confirm your identity with your password or with Google to modify your account.</p>
|
||||
<div class="inputWithButton">
|
||||
<input type="password" class="text" name="password" placeholder="Current password" required minlength="6" autofocus><!--
|
||||
--><button id="authenticateWithGoogleButton" class="yellow" type="button">Google</button>
|
||||
<input type="password" class="text" name="password" autocomplete="current-password" required minlength="6" autofocus><!--
|
||||
--><button id="authenticateWithGoogleButton" class="yellow" type="button"><i class="fa-brands fa-google"></i></button>
|
||||
</div>
|
||||
<?php elseif ($user['password'] !== null): ?>
|
||||
<p class="justify small">Please confirm your identity with your password to modify your account.</p>
|
||||
<input type="password" class="text big fullWidth" name="password" placeholder="Current password" required minlength="6" autofocus>
|
||||
<input type="password" class="text big fullWidth" name="password" autocomplete="current-password" required minlength="6" autofocus>
|
||||
<?php elseif ($user['google_sub'] !== null): ?>
|
||||
<p class="justify small">Please confirm your identity with Google to modify your account.</p>
|
||||
<div class="inputWithButton">
|
||||
<input type="text" class="text" name="password" placeholder="Authenticate with Google..." disabled><!--
|
||||
--><button id="authenticateWithGoogleButton" class="yellow" type="button">Google</button>
|
||||
--><button id="authenticateWithGoogleButton" class="yellow" type="button"><i class="fa-brands fa-google"></i></button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<hr>
|
||||
<input type="email" class="text big fullWidth" name="email" placeholder="Email address" value="<?= $user['email'] ?>">
|
||||
<input type="text" class="text big fullWidth marginTop" name="username" placeholder="Username" value="<?= $user['username'] ?>">
|
||||
<input type="password" class="text big fullWidth marginTop" name="password_new" placeholder="New password" minlength="6">
|
||||
<input type="password" class="text big fullWidth marginTop" name="password_new_confirm" placeholder="New password confirmation" minlength="6">
|
||||
<p class="formLabel">Email address</p>
|
||||
<input type="email" class="text big fullWidth" name="email" autocomplete="username" value="<?= $user['email'] ?>">
|
||||
<p class="formLabel marginTop">Username</p>
|
||||
<input type="text" class="text big fullWidth" name="username" value="<?= $user['username'] ?>">
|
||||
<p class="formLabel marginTop">New password</p>
|
||||
<input type="password" class="text big fullWidth" name="password_new" autocomplete="new-password" minlength="6">
|
||||
<p class="formLabel marginTop">New password confirmation</p>
|
||||
<input type="password" class="text big fullWidth" name="password_new_confirm" autocomplete="new-password" minlength="6">
|
||||
<hr>
|
||||
<input type="text" class="text big fullWidth marginTop" name="full_name" placeholder="Full name" value="<?= $user['full_name'] ?>" disabled>
|
||||
<input type="text" class="text big fullWidth marginTop" name="nickname" placeholder="Nickname" value="<?= $user['nickname'] ?>">
|
||||
<input type="text" class="text big fullWidth marginTop" name="phone" placeholder="Phone" value="<?= $user['phone'] ?>">
|
||||
<input type="text" class="text big fullWidth marginTop" name="id_number" placeholder="ID number" value="<?= $user['id_number'] ?>">
|
||||
<p class="formLabel marginTop">Full name</p>
|
||||
<input type="text" class="text big fullWidth" name="full_name" value="<?= $user['full_name'] ?>" disabled>
|
||||
<p class="formLabel marginTop marginTop">Nickname</p>
|
||||
<input type="text" class="text big fullWidth" name="nickname" value="<?= $user['nickname'] ?>">
|
||||
<p class="formLabel marginTop marginTop">Phone</p>
|
||||
<input type="text" class="text big fullWidth" name="phone" value="<?= $user['phone'] ?>">
|
||||
<p class="formLabel marginTop marginTop">ID number</p>
|
||||
<input type="text" class="text big fullWidth" name="id_number" value="<?= $user['id_number'] ?>">
|
||||
<p id="accountFormError" class="formError justify marginTop"></p>
|
||||
<div class="right marginTop">
|
||||
<button type="submit" name="submit" disabled>Save</button>
|
||||
<button type="submit" name="submit_button" disabled><i class="fa-regular fa-floppy-disk"></i> Save</button>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="center">
|
||||
<?php if ($user['google_sub'] === null): ?>
|
||||
<a class="button yellow" href="<?= Container::$routeCollection->getRoute('account.googleConnect')->generateLink() ?>" title="Connect with Google"><i class="fa-solid fa-link"></i> Connect with Google</a>
|
||||
<?php else: ?>
|
||||
<?php if ($user['password'] !== null): ?>
|
||||
<a class="button yellow" href="<?= Container::$routeCollection->getRoute('account.googleDisconnect')->generateLink() ?>" title="Disconnect from Google"><i class="fa-solid fa-link-slash"></i> Disconnect from Google</a>
|
||||
<?php else: ?>
|
||||
<p class="bold small">Your account does not have a password. Please set a password if you want to disconnect your account from Google.</p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
@extends(templates/layout_normal)
|
||||
|
||||
@section(main)
|
||||
<h2>Connect with Google</h2>
|
||||
<div class="box compactBox">
|
||||
<?php if (!$success): ?>
|
||||
<p class="error justify"><?= $error ?></p>
|
||||
<?php else: ?>
|
||||
<form id="connectGoogleForm" action="<?= Container::$routeCollection->getRoute('account.googleConnect-action')->generateLink() ?>" method="post" data-redirect-on-success="<?= Container::$routeCollection->getRoute('account')->generateLink() ?>">
|
||||
<p class="justify marginBottom">Your account will be connected with the following Google account: <b><?= $googleAccount ?></b></p>
|
||||
<input type="email" style="display: none;" name="email" autocomplete="username" value="<?= $userEmail ?>">
|
||||
<p class="formLabel marginTop">Password</p>
|
||||
<input type="password" class="text big fullWidth" name="password" autocomplete="current-password" required minlength="6" autofocus>
|
||||
<p class="formError justify marginTop"></p>
|
||||
<div class="right marginTop">
|
||||
<button class="marginRight" type="submit" name="submit"><i class="fa-solid fa-link"></i> Connect</button><!--
|
||||
--><a class="button gray" href="<?= Container::$routeCollection->getRoute('account')->generateLink() ?>" title="Back to account">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,18 @@
|
||||
@extends(templates/layout_normal)
|
||||
|
||||
@section(main)
|
||||
<h2>Disconnect from Google</h2>
|
||||
<div class="box compactBox">
|
||||
<form id="connectGoogleForm" action="<?= Container::$routeCollection->getRoute('account.googleDisconnect-action')->generateLink() ?>" method="post" data-redirect-on-success="<?= Container::$routeCollection->getRoute('account')->generateLink() ?>">
|
||||
<p class="justify marginBottom">Your account will be disconnected from the currently set Google account.</p>
|
||||
<input type="email" style="display: none;" name="email" autocomplete="username" value="<?= $userEmail ?>">
|
||||
<p class="formLabel marginTop">Password</p>
|
||||
<input type="password" class="text big fullWidth" name="password" autocomplete="current-password" required minlength="6" autofocus>
|
||||
<p class="formError justify marginTop"></p>
|
||||
<div class="right marginTop">
|
||||
<button class="red marginRight" type="submit" name="submit"><i class="fa-solid fa-link-slash"></i> Disconnect</button><!--
|
||||
--><a class="button gray" href="<?= Container::$routeCollection->getRoute('account')->generateLink() ?>" title="Back to account">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -1,35 +1,16 @@
|
||||
@extends(templates/layout_normal)
|
||||
|
||||
@section(main)
|
||||
<h2><?= $community->getName() ?> <span class="small">[<a href="<?= Container::$routeCollection->getRoute('community-edit')->generateLink(['communityId' => $community->getId()]) ?>">edit</a>]</span></h2>
|
||||
<h2>
|
||||
<?= $community->getName() ?>
|
||||
<?php if ($editPermission): ?>
|
||||
<span class="small">[<a href="<?= Container::$routeCollection->getRoute('community.edit')->generateLink(['communitySlug' => $community->getSlug()]) ?>">edit</a>]</span>
|
||||
<?php endif; ?>
|
||||
</h2>
|
||||
|
||||
<p class="marginTop"><a href="<?= Container::$routeCollection->getRoute('community.settings')->generateLink(['communitySlug' => $community->getSlug()]) ?>">Settings</a></p>
|
||||
|
||||
<div class="gridContainer marginTop">
|
||||
<div>
|
||||
<h3 class="marginBottom">Members</h3>
|
||||
<?php foreach ($members as $member): ?>
|
||||
<p><?= $member->getUser()->getDisplayName() ?></p>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($editPermission): ?>
|
||||
<hr>
|
||||
<p><a href="<?= Container::$routeCollection->getRoute('community-members')->generateLink(['communityId' => $community->getId()]) ?>">Edit members</a></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="marginBottom">Currencies</h3>
|
||||
<?php foreach ($currencies as $currency): ?>
|
||||
<p>
|
||||
<?php if ($currency->getId() === $community->getMainCurrencyId()): ?>
|
||||
<b><?= $currency->getCode() ?></b>
|
||||
<?php else: ?>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community-currency-exchange-rates')->generateLink(['communityId' => $community->getId(), 'code' => $currency->getCode()]) ?>"><?= $currency->getCode() ?></a>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($editPermission): ?>
|
||||
<hr>
|
||||
<p><a href="<?= Container::$routeCollection->getRoute('community-currencies')->generateLink(['communityId' => $community->getId()]) ?>">Edit currencies</a></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="marginBottom">Upcoming events</h3>
|
||||
<?php if (count($upcomingEvents) > 0): ?>
|
||||
@@ -46,26 +27,26 @@
|
||||
$mainCurrencyRoundDigits = $community->getMainCurrency()->getRoundDigits();
|
||||
?>
|
||||
<h3 class="marginBottom">Finances</h3>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communityId' => $community->getId()]) ?>">Transactions</a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug()]) ?>">Transactions</a>
|
||||
<table class="fullWidth marginTop">
|
||||
<tr>
|
||||
<td class="bold">You owe</td>
|
||||
<td class="mono red" style="text-align: right;"><?= number_format($debtBalance, $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
|
||||
</tr>
|
||||
<?php foreach ($debtUsers as $owe): ?>
|
||||
<?php foreach ($debtItems as $item): ?>
|
||||
<tr>
|
||||
<td class="small"><?= $owe['payee']->getUser()->getDisplayName() ?></td>
|
||||
<td class="small mono red" style="text-align: right;"><?= number_format($owe['amount'], $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
|
||||
<td class="small"><?= $item['payee']->getUser()->getDisplayName() ?></td>
|
||||
<td class="small mono red" style="text-align: right;"><?= number_format($item['amount'], $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<tr>
|
||||
<td class="bold">You're owed</td>
|
||||
<td class="mono green" style="text-align: right;"><?= number_format($outstandingBalance, $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
|
||||
</tr>
|
||||
<?php foreach ($outstandingUsers as $owe): ?>
|
||||
<?php foreach ($outstandingItems as $item): ?>
|
||||
<tr>
|
||||
<td class="small"><?= $owe['payer']->getUser()->getDisplayName() ?></td>
|
||||
<td class="small mono green" style="text-align: right;"><?= number_format($owe['amount'], $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
|
||||
<td class="small"><?= $item['payer']->getUser()->getDisplayName() ?></td>
|
||||
<td class="small mono green" style="text-align: right;"><?= number_format($item['amount'], $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<tr>
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
|
||||
@section(main)
|
||||
<h2>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communityId' => $community->getId()]) ?>"><?= $community->getName() ?></a> »
|
||||
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communitySlug' => $community->getSlug()]) ?>"><?= $community->getName() ?></a> »
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.settings')->generateLink(['communitySlug' => $community->getSlug()]) ?>">Settings</a> »
|
||||
Edit currencies
|
||||
</h2>
|
||||
<div class="box compactBox">
|
||||
<table class="fullWidth">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: calc(100% / 3); text-align: left;">Currency</th>
|
||||
<th style="width: calc(100% / 3); text-align: left;">Code</th>
|
||||
<th style="width: calc(100% / 3); text-align: left;">Round digits</th>
|
||||
<th style="width: calc(100% / 3);"></th>
|
||||
</tr>
|
||||
@@ -17,31 +18,31 @@
|
||||
<?php foreach ($currencies as $currency): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="editCurrency_<?= $currency->getId() ?>" action="<?= Container::$routeCollection->getRoute('community-currencies-edit')->generateLink(['communityId' => $community->getId(), 'currency_id' => $currency->getId()]) ?>" method="post" data-reload-on-success="true" data-observe-inputs="code,round_digits"></form>
|
||||
<form id="deleteCurrency_<?= $currency->getId() ?>" action="<?= Container::$routeCollection->getRoute('community-currencies-delete')->generateLink(['communityId' => $community->getId(), 'currency_id' => $currency->getId()]) ?>" method="post" data-reload-on-success="true"></form>
|
||||
<form id="editCurrency_<?= $currency->getId() ?>" action="<?= Container::$routeCollection->getRoute('community.currencies.edit-action')->generateLink(['communitySlug' => $community->getSlug(), 'currency_id' => $currency->getId()]) ?>" method="post" data-reload-on-success="true" data-observe-inputs="code,round_digits"></form>
|
||||
<form id="deleteCurrency_<?= $currency->getId() ?>" action="<?= Container::$routeCollection->getRoute('community.currencies.delete-action')->generateLink(['communitySlug' => $community->getSlug(), 'currency_id' => $currency->getId()]) ?>" method="post" data-reload-on-success="true"></form>
|
||||
<input type="text" form="editCurrency_<?= $currency->getId() ?>" class="text fullWidth" name="code" value="<?= $currency->getCode() ?>" maxlength="3" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" form="editCurrency_<?= $currency->getId() ?>" class="text fullWidth" name="round_digits" value="<?= $currency->getRoundDigits() ?>" min="0" max="9" required>
|
||||
</td>
|
||||
<td style="text-align: right; font-size: 0;">
|
||||
<button type="submit" form="editCurrency_<?= $currency->getId() ?>" name="submit" class="small" disabled>Save</button>
|
||||
<button type="submit" form="editCurrency_<?= $currency->getId() ?>" name="submit_button" class="small" disabled><i class="fa-regular fa-floppy-disk"></i></button>
|
||||
<?php if ($currency->getId() !== $community->getMainCurrencyId()): ?>
|
||||
<button type="submit" form="deleteCurrency_<?= $currency->getId() ?>" class="small red marginLeft">Delete</button>
|
||||
<button type="submit" form="deleteCurrency_<?= $currency->getId() ?>" name="submit_button" data-confirmation="Are you sure you want to delete this currency?" data-confirmation-button='<i class="fa-regular fa-trash-can"></i> Delete' class="small red marginLeft"><i class="fa-regular fa-trash-can"></i></button>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="newCurrency" action="<?= Container::$routeCollection->getRoute('community-currencies-new')->generateLink(['communityId' => $community->getId()]) ?>" method="post" data-reload-on-success="true" data-observe-inputs="code,round_digits"></form>
|
||||
<input type="text" form="newCurrency" class="text fullWidth" name="code" placeholder="Currency" maxlength="3" required>
|
||||
<form id="newCurrency" action="<?= Container::$routeCollection->getRoute('community.currencies.new-action')->generateLink(['communitySlug' => $community->getSlug()]) ?>" method="post" data-reload-on-success="true" data-observe-inputs="code,round_digits"></form>
|
||||
<input type="text" form="newCurrency" class="text fullWidth" name="code" maxlength="3" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" form="newCurrency" class="text fullWidth" name="round_digits" placeholder="Round digits" min="0" max="9" required>
|
||||
<input type="number" form="newCurrency" class="text fullWidth" name="round_digits" min="0" max="9" required>
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
<button type="submit" form="newCurrency" name="submit" class="small" disabled>Add</button>
|
||||
<button type="submit" form="newCurrency" name="submit_button" class="small" disabled><i class="fa-regular fa-plus"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@section(main)
|
||||
<h2>
|
||||
<?php if (isset($community)): ?>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communityId' => $community->getId()]) ?>"><?= $community->getName() ?></a> »
|
||||
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communitySlug' => $community->getSlug()]) ?>"><?= $community->getName() ?></a> »
|
||||
Edit
|
||||
<?php else: ?>
|
||||
New community
|
||||
@@ -12,18 +12,21 @@
|
||||
<div class="box compactBox">
|
||||
<?php
|
||||
$formAction = isset($community) ?
|
||||
Container::$routeCollection->getRoute('community-edit-action')->generateLink(['communityId' => $community->getId()]) :
|
||||
Container::$routeCollection->getRoute('community-new-action')->generateLink();
|
||||
Container::$routeCollection->getRoute('community.edit-action')->generateLink(['communitySlug' => $community->getSlug()]) :
|
||||
Container::$routeCollection->getRoute('community.new-action')->generateLink();
|
||||
?>
|
||||
<form id="communityForm" action="<?= $formAction ?>" method="post" data-redirect-on-success="true">
|
||||
<input type="text" class="text big fullWidth" name="name" placeholder="Name" value="<?= isset($community) ? $community->getName() : '' ?>" required>
|
||||
<p class="formLabel">Name</p>
|
||||
<input type="text" class="text big fullWidth" name="name" value="<?= isset($community) ? $community->getName() : '' ?>" required>
|
||||
<?php if (!isset($community)): ?>
|
||||
<input type="text" class="text big fullWidth marginTop" name="main_currency_code" placeholder="Main currency" maxlength="3" required>
|
||||
<input type="number" class="text big fullWidth marginTop" name="main_currency_round_digits" placeholder="Main currency round digits" min="0" max="9" required>
|
||||
<p class="formLabel marginTop">Main currency code</p>
|
||||
<input type="text" class="text big fullWidth" name="main_currency_code" maxlength="3" required>
|
||||
<p class="formLabel marginTop">Main currency round digits</p>
|
||||
<input type="number" class="text big fullWidth" name="main_currency_round_digits" min="0" max="9" required>
|
||||
<?php endif; ?>
|
||||
<p id="communityFormError" class="formError justify marginTop"></p>
|
||||
<div class="right marginTop">
|
||||
<button type="submit" name="submit"><?= isset($community) ? 'Save' : 'Create' ?></button>
|
||||
<button type="submit" name="submit_button"><?= isset($community) ? '<i class="fa-regular fa-floppy-disk"></i> Save' : '<i class="fa-regular fa-plus"></i> Create' ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
@css(node_modules/choices.js/public/assets/styles/choices.min.css)
|
||||
@js(node_modules/choices.js/public/assets/scripts/choices.js)
|
||||
@css(/static/node_modules/tom-select/dist/css/tom-select.min.css)
|
||||
@js(/static/node_modules/tom-select/dist/js/tom-select.base.min.js)
|
||||
@js(js/communities/community_members.js)
|
||||
|
||||
@extends(templates/layout_normal)
|
||||
|
||||
@section(main)
|
||||
<h2>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communityId' => $community->getId()]) ?>"><?= $community->getName() ?></a> »
|
||||
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communitySlug' => $community->getSlug()]) ?>"><?= $community->getName() ?></a> »
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.settings')->generateLink(['communitySlug' => $community->getSlug()]) ?>">Settings</a> »
|
||||
Edit members
|
||||
</h2>
|
||||
<div class="box compactBox">
|
||||
<table class="fullWidth">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 50%;"></th>
|
||||
<th style="width: 50%;">User</th>
|
||||
<th style="width: 25%; text-align: center;">Owner</th>
|
||||
<th style="width: 25%;"></th>
|
||||
</tr>
|
||||
@@ -22,8 +23,8 @@
|
||||
<?php $editable = $member->getUserId() !== Container::$request->user()->getUniqueId(); ?>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="editMember_<?= $member->getId() ?>" action="<?= Container::$routeCollection->getRoute('community-members-edit')->generateLink(['communityId' => $community->getId(), 'community_member_id' => $member->getId()]) ?>" method="post" data-reload-on-success="true" data-observe-inputs="owner"></form>
|
||||
<form id="deleteMember_<?= $member->getId() ?>" action="<?= Container::$routeCollection->getRoute('community-members-delete')->generateLink(['communityId' => $community->getId(), 'community_member_id' => $member->getId()]) ?>" method="post" data-reload-on-success="true"></form>
|
||||
<form id="editMember_<?= $member->getId() ?>" action="<?= Container::$routeCollection->getRoute('community.members.edit-action')->generateLink(['communitySlug' => $community->getSlug(), 'community_member_id' => $member->getId()]) ?>" method="post" data-reload-on-success="true" data-observe-inputs="owner"></form>
|
||||
<form id="deleteMember_<?= $member->getId() ?>" action="<?= Container::$routeCollection->getRoute('community.members.delete-action')->generateLink(['communitySlug' => $community->getSlug(), 'community_member_id' => $member->getId()]) ?>" method="post" data-reload-on-success="true"></form>
|
||||
<?= $member->getUser()->getDisplayName() ?>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
@@ -31,22 +32,22 @@
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
<?php if ($editable): ?>
|
||||
<button type="submit" form="editMember_<?= $member->getId() ?>" name="submit" class="small marginRight" disabled>Save</button><!--
|
||||
--><button type="submit" form="deleteMember_<?= $member->getId() ?>" class="small red">Delete</button>
|
||||
<button type="submit" form="editMember_<?= $member->getId() ?>" name="submit_button" class="small marginRight" disabled><i class="fa-regular fa-floppy-disk"></i></button><!--
|
||||
--><button type="submit" form="deleteMember_<?= $member->getId() ?>" name="submit_button" data-confirmation="Are you sure you want to delete this member?" data-confirmation-button='<i class="fa-regular fa-trash-can"></i> Delete' class="small red"><i class="fa-regular fa-trash-can"></i></button>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="newMember" action="<?= Container::$routeCollection->getRoute('community-members-new')->generateLink(['communityId' => $community->getId()]) ?>" method="post" data-reload-on-success="true" data-observe-inputs="user_id"></form>
|
||||
<form id="newMember" action="<?= Container::$routeCollection->getRoute('community.members.new-action')->generateLink(['communitySlug' => $community->getSlug()]) ?>" method="post" data-reload-on-success="true" data-observe-inputs="user_id"></form>
|
||||
<select type="text" form="newMember" name="user_id">
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<input type="checkbox" form="newMember" name="owner" />
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
<button type="submit" form="newMember" name="submit" class="small" disabled>Add</button>
|
||||
<button type="submit" form="newMember" name="submit_button" class="small" disabled><i class="fa-regular fa-plus"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
@extends(templates/layout_normal)
|
||||
|
||||
@section(main)
|
||||
<h2>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communitySlug' => $community->getSlug()]) ?>"><?= $community->getName() ?></a> »
|
||||
Settings
|
||||
</h2>
|
||||
|
||||
<div class="gridContainer marginTop">
|
||||
<div>
|
||||
<h3 class="marginBottom">
|
||||
Members
|
||||
<?php if ($editPermission): ?>
|
||||
<span class="small">[<a href="<?= Container::$routeCollection->getRoute('community.members')->generateLink(['communitySlug' => $community->getSlug()]) ?>">edit</a>]</span>
|
||||
<?php endif; ?>
|
||||
</h3>
|
||||
<?php foreach ($members as $member): ?>
|
||||
<p><?= $member->getUser()->getDisplayName() ?></p>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="marginBottom">
|
||||
Currencies
|
||||
<?php if ($editPermission): ?>
|
||||
<span class="small">[<a href="<?= Container::$routeCollection->getRoute('community.currencies')->generateLink(['communitySlug' => $community->getSlug()]) ?>">edit</a>]</span>
|
||||
<?php endif; ?>
|
||||
</h3>
|
||||
<?php foreach ($currencies as $currency): ?>
|
||||
<p>
|
||||
<?php if ($currency->getId() === $community->getMainCurrencyId()): ?>
|
||||
<b><?= $currency->getCode() ?></b>
|
||||
<?php else: ?>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.currencyExchangeRates')->generateLink(['communitySlug' => $community->getSlug(), 'code' => $currency->getCode()]) ?>"><?= $currency->getCode() ?></a>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
@section(main)
|
||||
<h2>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communityId' => $community->getId()]) ?>"><?= $community->getName() ?></a> »
|
||||
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communitySlug' => $community->getSlug()]) ?>"><?= $community->getName() ?></a> »
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.settings')->generateLink(['communitySlug' => $community->getSlug()]) ?>">Settings</a> »
|
||||
Exchange rates for <?= $currency->getCode() ?>
|
||||
</h2>
|
||||
<div class="box compactBox">
|
||||
@@ -23,16 +24,16 @@
|
||||
<tr>
|
||||
<?php if ($editPermission): ?>
|
||||
<td>
|
||||
<form id="editExchangeRate_<?= $currencyExchangeRate->getId() ?>" action="<?= Container::$routeCollection->getRoute('community-currency-exchange-rates-edit')->generateLink(['communityId' => $community->getId(), 'code' => $currency->getCode(), 'currency_exchange_rate_id' => $currencyExchangeRate->getId()]) ?>" method="post" data-reload-on-success="true" data-observe-inputs="exchange_rate,valid_from"></form>
|
||||
<form id="deleteCurrency_<?= $currencyExchangeRate->getId() ?>" action="<?= Container::$routeCollection->getRoute('community-currency-exchange-rates-delete')->generateLink(['communityId' => $community->getId(), 'code' => $currency->getCode(), 'currency_exchange_rate_id' => $currencyExchangeRate->getId()]) ?>" method="post" data-reload-on-success="true"></form>
|
||||
<form id="editExchangeRate_<?= $currencyExchangeRate->getId() ?>" action="<?= Container::$routeCollection->getRoute('community.currencyExchangeRates.edit-action')->generateLink(['communitySlug' => $community->getSlug(), 'code' => $currency->getCode(), 'currency_exchange_rate_id' => $currencyExchangeRate->getId()]) ?>" method="post" data-reload-on-success="true" data-observe-inputs="exchange_rate,valid_from"></form>
|
||||
<form id="deleteCurrency_<?= $currencyExchangeRate->getId() ?>" action="<?= Container::$routeCollection->getRoute('community.currencyExchangeRates.delete-action')->generateLink(['communitySlug' => $community->getSlug(), 'code' => $currency->getCode(), 'currency_exchange_rate_id' => $currencyExchangeRate->getId()]) ?>" method="post" data-reload-on-success="true"></form>
|
||||
<input type="number" form="editExchangeRate_<?= $currencyExchangeRate->getId() ?>" class="text fullWidth" name="exchange_rate" value="<?= $currencyExchangeRate->getExchangeRate() ?>" min="0" step="0.000000001" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="datetime-local" form="editExchangeRate_<?= $currencyExchangeRate->getId() ?>" class="text fullWidth" name="valid_from" value="<?= $currencyExchangeRate->getValidFromDate()->format('Y-m-d\TH:i') ?>" required>
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
<button type="submit" form="editExchangeRate_<?= $currencyExchangeRate->getId() ?>" name="submit" class="small marginRight" disabled>Save</button><!--
|
||||
--><button type="submit" form="deleteCurrency_<?= $currencyExchangeRate->getId() ?>" class="small red">Delete</button>
|
||||
<button type="submit" form="editExchangeRate_<?= $currencyExchangeRate->getId() ?>" name="submit_button" class="small marginRight" disabled><i class="fa-regular fa-floppy-disk"></i></button><!--
|
||||
--><button type="submit" form="deleteCurrency_<?= $currencyExchangeRate->getId() ?>" name="submit_button" data-confirmation="Are you sure you want to delete this exchange rate?" data-confirmation-button='<i class="fa-regular fa-trash-can"></i> Delete' class="small red"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</td>
|
||||
<?php else: ?>
|
||||
<td><?= $currencyExchangeRate->getExchangeRate() ?></td>
|
||||
@@ -43,14 +44,14 @@
|
||||
<?php if ($editPermission): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="newExchangeRate" action="<?= Container::$routeCollection->getRoute('community-currency-exchange-rates-new')->generateLink(['communityId' => $community->getId(), 'code' => $currency->getCode()]) ?>" method="post" data-reload-on-success="true" data-observe-inputs="exchange_rate,valid_from"></form>
|
||||
<input type="number" form="newExchangeRate" class="text fullWidth" name="exchange_rate" placeholder="Exchange rate" min="0" step="0.000000001" required>
|
||||
<form id="newExchangeRate" action="<?= Container::$routeCollection->getRoute('community.currencyExchangeRates.new-action')->generateLink(['communitySlug' => $community->getSlug(), 'code' => $currency->getCode()]) ?>" method="post" data-reload-on-success="true" data-observe-inputs="exchange_rate,valid_from"></form>
|
||||
<input type="number" form="newExchangeRate" class="text fullWidth" name="exchange_rate" min="0" step="0.000000001" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="datetime-local" form="newExchangeRate" class="text fullWidth" name="valid_from" placeholder="Valid from" required>
|
||||
<input type="datetime-local" form="newExchangeRate" class="text fullWidth" name="valid_from" required>
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
<button type="submit" form="newExchangeRate" name="submit" class="small" disabled>Add</button>
|
||||
<button type="submit" form="newExchangeRate" name="submit_button" class="small" disabled><i class="fa-regular fa-plus"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
@section(main)
|
||||
<h2>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communityId' => $community->getId()]) ?>"><?= $community->getName() ?></a> »
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communityId' => $community->getId()]) ?>">Transactions</a> »
|
||||
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communitySlug' => $community->getSlug()]) ?>"><?= $community->getName() ?></a> »
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug()]) ?>">Transactions</a> »
|
||||
<?php if (isset($transaction)): ?>
|
||||
Edit transaction
|
||||
<?php else: ?>
|
||||
@@ -13,41 +13,47 @@
|
||||
<div class="box compactBox">
|
||||
<?php
|
||||
$formAction = isset($transaction) ?
|
||||
Container::$routeCollection->getRoute('community.transactions.edit-action')->generateLink(['communityId' => $community->getId(), 'transactionId' => $transaction->getId()]) :
|
||||
Container::$routeCollection->getRoute('community.transactions.new-action')->generateLink(['communityId' => $community->getId()]);
|
||||
Container::$routeCollection->getRoute('community.transactions.edit-action')->generateLink(['communitySlug' => $community->getSlug(), 'transactionId' => $transaction->getId()]) :
|
||||
Container::$routeCollection->getRoute('community.transactions.new-action')->generateLink(['communitySlug' => $community->getSlug()]);
|
||||
?>
|
||||
<form id="transactionForm" action="<?= $formAction ?>" method="post" data-redirect-on-success="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communityId' => $community->getId()]) ?>">
|
||||
<form id="transactionForm" action="<?= $formAction ?>" method="post" data-redirect-on-success="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug()]) ?>">
|
||||
<p class="formLabel">Payer</p>
|
||||
<select class="big fullWidth" name="payer_user_id" required>
|
||||
<option value="" hidden>[Payer]</option>
|
||||
<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>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<select class="big fullWidth marginTop" name="payee_user_id">
|
||||
<option value="">[Payee]</option>
|
||||
<p class="formLabel marginTop">Payee</p>
|
||||
<select class="big fullWidth" name="payee_user_id">
|
||||
<option value="">[common]</option>
|
||||
<?php foreach ($members as $member): ?>
|
||||
<option value="<?= $member->getUser()->getId() ?>" <?= isset($transaction) && $transaction->getPayeeUserId() === $member->getUser()->getId() ? 'selected' : '' ?>><?= $member->getUser()->getDisplayName() ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<input type="text" class="text big fullWidth marginTop" name="description" placeholder="Description" value="<?= isset($transaction) ? $transaction->getDescription() : '' ?>" required>
|
||||
<input type="number" class="text big fullWidth marginTop" name="sum" placeholder="Sum" value="<?= isset($transaction) ? $transaction->getSum() : '' ?>" min="0" step="0.000000001" required>
|
||||
<select class="big fullWidth marginTop" name="currency_id" required>
|
||||
<option value="" hidden>[Currency]</option>
|
||||
<p class="formLabel marginTop">Description</p>
|
||||
<input type="text" class="text big fullWidth" name="description" value="<?= isset($transaction) ? $transaction->getDescription() : '' ?>" required>
|
||||
<p class="formLabel marginTop">Sum</p>
|
||||
<input type="number" class="text big fullWidth" name="sum" value="<?= isset($transaction) ? $transaction->getSum() : '' ?>" min="0" step="0.000000001" required>
|
||||
<p class="formLabel marginTop">Currency</p>
|
||||
<select class="big fullWidth" name="currency_id" required>
|
||||
<option value="" hidden></option>
|
||||
<?php foreach ($currencies as $currency): ?>
|
||||
<option value="<?= $currency->getId() ?>" <?= isset($transaction) && $transaction->getCurrencyId() === $currency->getId() ? 'selected' : '' ?>><?= $currency->getCode() ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<input type="datetime-local" class="text big fullWidth marginTop" name="time" placeholder="Time" value="<?= isset($transaction) ? $transaction->getTimeDate()->format('Y-m-d\TH:i') : (new DateTime())->format('Y-m-d\TH:i') ?>" required>
|
||||
<p class="formLabel marginTop">Time</p>
|
||||
<input type="datetime-local" class="text big fullWidth" name="time" value="<?= isset($transaction) ? $transaction->getTimeDate()->format('Y-m-d\TH:i') : (new DateTime())->format('Y-m-d\TH:i') ?>" required>
|
||||
<p class="formError justify marginTop"></p>
|
||||
<div class="right marginTop" style="font-size: 0;">
|
||||
<button type="submit" name="submit_button"><?= isset($transaction) ? '<i class="fa-regular fa-floppy-disk"></i> Save' : '<i class="fa-regular fa-plus"></i> Create' ?></button>
|
||||
<?php if (isset($transaction)): ?>
|
||||
<button type="submit" form="deleteTransaction" class="red marginRight">Delete</button>
|
||||
<button type="submit" form="deleteTransaction" name="submit_button" data-confirmation="Are you sure you want to delete this transaction?" class="red marginLeft"><i class="fa-regular fa-trash-can"></i> Delete</button>
|
||||
<?php endif; ?>
|
||||
<button type="submit" name="submit"><?= isset($transaction) ? 'Save' : 'Create' ?></button>
|
||||
</div>
|
||||
</form>
|
||||
<?php if (isset($transaction)): ?>
|
||||
<form id="deleteTransaction" action="<?= Container::$routeCollection->getRoute('community.transactions.delete')->generateLink(['communityId' => $community->getId(), 'transactionId' => $transaction->getId()]) ?>" method="post" data-redirect-on-success="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communityId' => $community->getId()]) ?>"></form>
|
||||
<form id="deleteTransaction" action="<?= Container::$routeCollection->getRoute('community.transactions.delete-action')->generateLink(['communitySlug' => $community->getSlug(), 'transactionId' => $transaction->getId()]) ?>" method="post" data-redirect-on-success="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug()]) ?>"></form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -2,34 +2,35 @@
|
||||
|
||||
@section(main)
|
||||
<h2>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communityId' => $community->getId()]) ?>"><?= $community->getName() ?></a> »
|
||||
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communitySlug' => $community->getSlug()]) ?>"><?= $community->getName() ?></a> »
|
||||
Transactions
|
||||
</h2>
|
||||
|
||||
<p class="marginTop"><a href="<?= Container::$routeCollection->getRoute('community.transactions.new')->generateLink(['communityId' => $community->getId()]) ?>">New transaction</a></p>
|
||||
<p class="marginTop"><a href="<?= Container::$routeCollection->getRoute('community.transactions.new')->generateLink(['communitySlug' => $community->getSlug()]) ?>">New transaction</a></p>
|
||||
|
||||
<?php if ($numberOfTransactions > 0): ?>
|
||||
<?php if ($pages > 1): ?>
|
||||
<p class="paginateContainer marginTop">
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communityId' => $community->getId(), 'page' => 0]) ?>">«</a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communityId' => $community->getId(), 'page' => max(0, $currentPage - 1)]) ?>">‹</a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug(), 'page' => 0]) ?>">«</a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug(), 'page' => max(0, $currentPage - 1)]) ?>">‹</a>
|
||||
<?php for ($i = 0; $i < $pages; $i++): ?>
|
||||
<?php if ($currentPage == $i): ?>
|
||||
<span class="selected"><?= $i + 1 ?></span>
|
||||
<?php else: ?>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communityId' => $community->getId(), 'page' => $i]) ?>"><?= $i + 1 ?></a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug(), 'page' => $i]) ?>"><?= $i + 1 ?></a>
|
||||
<?php endif; ?>
|
||||
<?php endfor; ?>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communityId' => $community->getId(), 'page' => min($pages - 1, $currentPage + 1)]) ?>">›</a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communityId' => $community->getId(), 'page' => $pages - 1]) ?>">»</a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug(), 'page' => min($pages - 1, $currentPage + 1)]) ?>">›</a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug(), 'page' => $pages - 1]) ?>">»</a>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ($transactions as $transaction): ?>
|
||||
<a class="block" href="<?= Container::$routeCollection->getRoute('community.transactions.edit')->generateLink(['communityId' => $community->getId(), 'transactionId' => $transaction->getId()]) ?>">
|
||||
<a class="block" href="<?= Container::$routeCollection->getRoute('community.transactions.edit')->generateLink(['communitySlug' => $community->getSlug(), 'transactionId' => $transaction->getId()]) ?>">
|
||||
<div class="box transaction">
|
||||
<div>
|
||||
<p style="font-weight: bold;"><?= $transaction->getDescription() ?></p>
|
||||
<p class="small"><?= $transaction->getPayerUser()->getDisplayName() ?> ► <?= $transaction->getPayeeUser() ? $transaction->getPayeeUser()->getDisplayName() : '[common]' ?></p>
|
||||
<p class="small"><?= $transaction->getPayerUser()->getDisplayName() ?> <i class="fa-solid fa-caret-right"></i> <?= $transaction->getPayeeUser() ? $transaction->getPayeeUser()->getDisplayName() : '[common]' ?></p>
|
||||
<p class="small"><?= $transaction->getTimeDate()->format('Y-m-d H:i') ?></p>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
@@ -44,19 +45,24 @@
|
||||
|
||||
<?php if ($pages > 1): ?>
|
||||
<p class="paginateContainer marginTop">
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communityId' => $community->getId(), 'page' => 0]) ?>">«</a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communityId' => $community->getId(), 'page' => max(0, $currentPage - 1)]) ?>">‹</a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug(), 'page' => 0]) ?>">«</a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug(), 'page' => max(0, $currentPage - 1)]) ?>">‹</a>
|
||||
<?php for ($i = 0; $i < $pages; $i++): ?>
|
||||
<?php if ($currentPage == $i): ?>
|
||||
<span class="selected"><?= $i + 1 ?></span>
|
||||
<?php else: ?>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communityId' => $community->getId(), 'page' => $i]) ?>"><?= $i + 1 ?></a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug(), 'page' => $i]) ?>"><?= $i + 1 ?></a>
|
||||
<?php endif; ?>
|
||||
<?php endfor; ?>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communityId' => $community->getId(), 'page' => min($pages - 1, $currentPage + 1)]) ?>">›</a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communityId' => $community->getId(), 'page' => $pages - 1]) ?>">»</a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug(), 'page' => min($pages - 1, $currentPage + 1)]) ?>">›</a>
|
||||
<a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug(), 'page' => $pages - 1]) ?>">»</a>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<p class="marginTop"><a href="<?= Container::$routeCollection->getRoute('community.transactions.new')->generateLink(['communityId' => $community->getId()]) ?>">New transaction</a></p>
|
||||
<p class="marginTop"><a href="<?= Container::$routeCollection->getRoute('community.transactions.new')->generateLink(['communitySlug' => $community->getSlug()]) ?>">New transaction</a></p>
|
||||
<?php else: ?>
|
||||
<div class="box">
|
||||
<p>There are no transactions yet.</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@endsection
|
||||
+5
-4
@@ -3,16 +3,17 @@
|
||||
@section(main)
|
||||
<div class="gridContainer">
|
||||
<div>
|
||||
<h3 class="marginBottom">Communities</h3>
|
||||
<h3 class="marginBottom">
|
||||
Communities
|
||||
<span class="small">[<a href="<?= Container::$routeCollection->getRoute('community.new')->generateLink() ?>">new</a>]</span>
|
||||
</h3>
|
||||
<?php if (count($communities) > 0): ?>
|
||||
<?php foreach ($communities as $community): ?>
|
||||
<p><a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communityId' => $community->getId()]) ?>"><?= $community->getName() ?></a></p>
|
||||
<p><a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communitySlug' => $community->getSlug()]) ?>"><?= $community->getName() ?></a></p>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<p>You have no community.</p>
|
||||
<?php endif; ?>
|
||||
<hr>
|
||||
<p><a href="<?= Container::$routeCollection->getRoute('community-new')->generateLink() ?>">New community</a></p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="marginBottom">Upcoming events</h3>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@extends(templates/layout_normal)
|
||||
|
||||
@section(main)
|
||||
<h2>Login up with Google</h2>
|
||||
<h2>Login with Google</h2>
|
||||
<div class="box compactBox">
|
||||
<p class="error justify"><?= $error ?></p>
|
||||
</div>
|
||||
|
||||
@@ -4,16 +4,18 @@
|
||||
<h2>Login</h2>
|
||||
<div class="box compactBox">
|
||||
<form id="loginForm" action="<?= Container::$routeCollection->getRoute('login-action')->generateLink() ?>" method="post" data-redirect-on-success="<?= $redirectUrl ?>">
|
||||
<input type="text" class="text big fullWidth" name="email" placeholder="Email address / Username" required autofocus>
|
||||
<input type="password" class="text big fullWidth marginTop" name="password" placeholder="Password" required minlength="6">
|
||||
<p class="formLabel">Email address / Username</p>
|
||||
<input type="text" class="text big fullWidth" name="email" autocomplete="username" required autofocus>
|
||||
<p class="formLabel marginTop">Password</p>
|
||||
<input type="password" class="text big fullWidth" name="password" autocomplete="current-password" required minlength="6">
|
||||
<p id="loginFormError" class="formError justify marginTop"></p>
|
||||
<div class="right marginTop">
|
||||
<button type="submit">Login</button>
|
||||
<button type="submit"><i class="fa-solid fa-arrow-right-to-bracket"></i> Login</button>
|
||||
</div>
|
||||
<p class="center marginTop"><a href="<?= Container::$routeCollection->getRoute('password-requestReset')->generateLink() ?>" title="Request password reset">Forgot your password?</a></p>
|
||||
<p class="center marginTop"><a href="<?= Container::$routeCollection->getRoute('password.requestReset')->generateLink() ?>" title="Request password reset">Forgot your password?</a></p>
|
||||
<hr>
|
||||
<div class="center">
|
||||
<a class="button yellow" href="<?= Container::$routeCollection->getRoute('login-google')->generateLink() ?>" title="Login with Google">Login with Google</a>
|
||||
<a class="button yellow" href="<?= Container::$routeCollection->getRoute('login.google')->generateLink() ?>" title="Login with Google"><i class="fa-brands fa-google"></i> Login with Google</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
@section(main)
|
||||
<h2>Request password reset</h2>
|
||||
<div class="box compactBox">
|
||||
<form id="passwordResetForm" action="<?= Container::$routeCollection->getRoute('password-requestReset-action')->generateLink() ?>" method="post" data-redirect-on-success="<?= Container::$routeCollection->getRoute('password-requestReset.success')->generateLink() ?>">
|
||||
<input type="email" class="text big fullWidth" name="email" placeholder="Email address" value="<?= isset($email) ? $email : '' ?>" required autofocus>
|
||||
<form id="passwordResetForm" action="<?= Container::$routeCollection->getRoute('password.requestReset-action')->generateLink() ?>" method="post" data-redirect-on-success="<?= Container::$routeCollection->getRoute('password.requestReset.success')->generateLink() ?>">
|
||||
<p class="formLabel">Email address</p>
|
||||
<input type="email" class="text big fullWidth" name="email" value="<?= isset($email) ? $email : '' ?>" required autofocus>
|
||||
<?php if (!empty($_ENV['RECAPTCHA_SITEKEY'])): ?>
|
||||
<div class="marginTop">
|
||||
<div class="g-recaptcha" data-sitekey="<?= $_ENV['RECAPTCHA_SITEKEY'] ?>"></div>
|
||||
@@ -14,7 +15,7 @@
|
||||
<?php endif; ?>
|
||||
<p id="passwordResetFormError" class="formError justify marginTop"></p>
|
||||
<div class="right marginTop">
|
||||
<button type="submit">Continue</button>
|
||||
<button type="submit"><i class="fa-solid fa-key"></i> Reset password</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -4,17 +4,20 @@
|
||||
<h2>Reset password</h2>
|
||||
<div class="box compactBox">
|
||||
<?php if ($success) : ?>
|
||||
<form id="resetPasswordForm" action="<?= Container::$routeCollection->getRoute('password-reset.action')->generateLink(['token' => $token]) ?>"" method="post" data-redirect-on-success="<?= $redirectUrl ?>">
|
||||
<input type="email" class="text big fullWidth" name="email" placeholder="Email address" value="<?= $email ?>" disabled>
|
||||
<input type="password" class="text big fullWidth marginTop" name="password" placeholder="Password" required minlength="6" autofocus>
|
||||
<input type="password" class="text big fullWidth marginTop" name="password_confirm" placeholder="Password confirmation" required minlength="6">
|
||||
<form id="resetPasswordForm" action="<?= Container::$routeCollection->getRoute('password.reset-action')->generateLink(['token' => $token]) ?>"" method="post" data-redirect-on-success="<?= $redirectUrl ?>">
|
||||
<p class="formLabel">Email address</p>
|
||||
<input type="text" class="text big fullWidth" name="email" autocomplete="username" value="<?= $email ?>" disabled>
|
||||
<p class="formLabel marginTop">Password</p>
|
||||
<input type="password" class="text big fullWidth" name="password" autocomplete="new-password" required minlength="6" autofocus>
|
||||
<p class="formLabel marginTop">Password confirmation</p>
|
||||
<input type="password" class="text big fullWidth" name="password_confirm" autocomplete="new-password" required minlength="6">
|
||||
<p id="resetPasswordFormError" class="formError justify marginTop"></p>
|
||||
<div class="right">
|
||||
<button class="marginTop" type="submit">Reset password</button>
|
||||
<button class="marginTop" type="submit"><i class="fa-solid fa-key"></i> Reset password</button>
|
||||
</div>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<p class="error justify">Confirming your identity failed. Please check the link you entered, or retry <a href="<?= Container::$routeCollection->getRoute('password-requestReset')->generateLink() ?>" title="Request password reset">requesting password reset</a>!</p>
|
||||
<p class="error justify">Confirming your identity failed. Please check the link you entered, or retry <a href="<?= Container::$routeCollection->getRoute('password.requestReset')->generateLink() ?>" title="Request password reset">requesting password reset</a>!</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -10,14 +10,12 @@
|
||||
</h1>
|
||||
<p>
|
||||
<?php if (Container::$request->user()) : ?>
|
||||
<span><a href="<?= Container::$routeCollection->getRoute('account')->generateLink() ?>" title="Account">
|
||||
<?php /* Copyright (c) 2019 The Bootstrap Authors. License can be found in 'USED_SOFTWARE' in section 'Bootstrap Icons'. */ ?>
|
||||
<svg class="inline" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>
|
||||
</svg><!--
|
||||
--><?= Container::$request->user()->getDisplayName() ?><!--
|
||||
<span><a href="<?= Container::$routeCollection->getRoute('account')->generateLink() ?>" title="Account"><!--
|
||||
--><i class="fa-regular fa-user"></i> <?= Container::$request->user()->getDisplayName() ?><!--
|
||||
--></a></span><!--
|
||||
--><span><a href="<?= Container::$routeCollection->getRoute('logout')->generateLink() ?>" title="Logout">Logout</a></span>
|
||||
--><span><a href="<?= Container::$routeCollection->getRoute('logout')->generateLink() ?>" title="Logout"><!--
|
||||
--><i class="fa-solid fa-arrow-right-from-bracket"></i> Logout</a><!--
|
||||
--></span>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
</header>
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
<link href="https://fonts.googleapis.com/css2?family=Oxygen:wght@400;700&display=block" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Oxygen+Mono:wght@400&display=block" rel="stylesheet">
|
||||
<link href="<?= $_ENV['STATIC_ROOT'] ?>/css/rvr.css?rev=<?= REVISION ?>" rel="stylesheet">
|
||||
<link href="<?= $_ENV['STATIC_ROOT'] ?>/node_modules/@fortawesome/fontawesome-free/css/fontawesome.min.css?rev=<?= REVISION ?>" rel="stylesheet">
|
||||
<link href="<?= $_ENV['STATIC_ROOT'] ?>/node_modules/@fortawesome/fontawesome-free/css/solid.min.css?rev=<?= REVISION ?>" rel="stylesheet">
|
||||
<link href="<?= $_ENV['STATIC_ROOT'] ?>/node_modules/@fortawesome/fontawesome-free/css/regular.min.css?rev=<?= REVISION ?>" rel="stylesheet">
|
||||
<link href="<?= $_ENV['STATIC_ROOT'] ?>/node_modules/@fortawesome/fontawesome-free/css/brands.min.css?rev=<?= REVISION ?>" rel="stylesheet">
|
||||
@yields('externalCss')
|
||||
@yields('inlineCss')
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="<?= $_ENV['STATIC_ROOT'] ?>/img/favicon/192x192.png?rev=<?= REVISION ?>">
|
||||
|
||||
@@ -4,6 +4,7 @@ use SokoWeb\Response\HttpResponse;
|
||||
use SokoWeb\Routing\RouteCollection;
|
||||
use SokoWeb\Session\DatabaseSessionHandler;
|
||||
use SokoWeb\Request\Request;
|
||||
use SokoWeb\Request\Session;
|
||||
use RVR\Controller\HomeController;
|
||||
use RVR\Controller\LoginController;
|
||||
use RVR\Controller\OAuthAuthController;
|
||||
@@ -27,55 +28,60 @@ if (!empty($_ENV['DEV'])) {
|
||||
Container::$routeCollection = new RouteCollection();
|
||||
|
||||
Container::$routeCollection->get('home', '', [HomeController::class, 'getHome']);
|
||||
Container::$routeCollection->get('startSession', 'startSession.json', [HomeController::class, 'startSession']);
|
||||
Container::$routeCollection->group('login', function (RouteCollection $routeCollection) {
|
||||
$routeCollection->get('login', '', [LoginController::class, 'getLoginForm']);
|
||||
$routeCollection->post('login-action', '', [LoginController::class, 'login']);
|
||||
$routeCollection->get('login-google', 'google', [LoginController::class, 'getGoogleLoginRedirect']);
|
||||
$routeCollection->get('login-google-action', 'google/code', [LoginController::class, 'loginWithGoogle']);
|
||||
$routeCollection->get('login.google', 'google', [LoginController::class, 'getGoogleLoginRedirect']);
|
||||
$routeCollection->get('login.google-action', 'google/code', [LoginController::class, 'loginWithGoogle']);
|
||||
});
|
||||
Container::$routeCollection->group('oauth', function (RouteCollection $routeCollection) {
|
||||
$routeCollection->get('oauth-auth', 'auth', [OAuthAuthController::class, 'auth']);
|
||||
$routeCollection->post('oauth-token', 'token', [OAuthController::class, 'getToken']);
|
||||
$routeCollection->get('oauth-userinfo', 'userinfo', [OAuthController::class, 'getUserInfo']);
|
||||
$routeCollection->get('oauth-config', '.well-known/openid-configuration', [OAuthController::class, 'getConfig']);
|
||||
$routeCollection->get('oauth-certs', 'certs', [OAuthController::class, 'getCerts']);
|
||||
$routeCollection->get('oauth.auth', 'auth', [OAuthAuthController::class, 'auth']);
|
||||
$routeCollection->post('oauth.token', 'token', [OAuthController::class, 'getToken']);
|
||||
$routeCollection->get('oauth.userinfo', 'userinfo', [OAuthController::class, 'getUserInfo']);
|
||||
$routeCollection->get('oauth.config', '.well-known/openid-configuration', [OAuthController::class, 'getConfig']);
|
||||
$routeCollection->get('oauth.certs', 'certs', [OAuthController::class, 'getCerts']);
|
||||
});
|
||||
Container::$routeCollection->group('password', function (RouteCollection $routeCollection) {
|
||||
$routeCollection->get('password-requestReset', 'requestReset', [LoginController::class, 'getRequestPasswordResetForm']);
|
||||
$routeCollection->post('password-requestReset-action', 'requestReset', [LoginController::class, 'requestPasswordReset']);
|
||||
$routeCollection->get('password-requestReset.success', 'requestReset/success', [LoginController::class, 'getRequestPasswordResetSuccess']);
|
||||
$routeCollection->get('password-reset', 'reset/{token}', [LoginController::class, 'getResetPasswordForm']);
|
||||
$routeCollection->post('password-reset.action', 'reset/{token}', [LoginController::class, 'resetPassword']);
|
||||
$routeCollection->get('password.requestReset', 'requestReset', [LoginController::class, 'getRequestPasswordResetForm']);
|
||||
$routeCollection->post('password.requestReset-action', 'requestReset', [LoginController::class, 'requestPasswordReset']);
|
||||
$routeCollection->get('password.requestReset.success', 'requestReset/success', [LoginController::class, 'getRequestPasswordResetSuccess']);
|
||||
$routeCollection->get('password.reset', 'reset/{token}', [LoginController::class, 'getResetPasswordForm']);
|
||||
$routeCollection->post('password.reset-action', 'reset/{token}', [LoginController::class, 'resetPassword']);
|
||||
});
|
||||
Container::$routeCollection->get('logout', 'logout', [LoginController::class, 'logout']);
|
||||
Container::$routeCollection->group('account', function (RouteCollection $routeCollection) {
|
||||
$routeCollection->get('account', '', [UserController::class, 'getAccount']);
|
||||
$routeCollection->post('account-action', '', [UserController::class, 'saveAccount']);
|
||||
$routeCollection->get('account.googleConnect', 'googleConnect', [UserController::class, 'getGoogleConnectRedirect']);
|
||||
$routeCollection->get('account.googleConnect-confirm', 'googleConnect/code', [UserController::class, 'getGoogleConnectConfirm']);
|
||||
$routeCollection->post('account.googleConnect-action', 'googleConnect', [UserController::class, 'connectGoogle']);
|
||||
$routeCollection->get('account.googleDisconnect', 'googleDisconnect', [UserController::class, 'getGoogleDisconnectConfirm']);
|
||||
$routeCollection->post('account.googleDisconnect-action', 'googleDisconnect', [UserController::class, 'disconnectGoogle']);
|
||||
$routeCollection->get('account.googleAuthenticate', 'googleAuthenticate', [UserController::class, 'getGoogleAuthenticateRedirect']);
|
||||
$routeCollection->get('account.googleAuthenticate-action', 'googleAuthenticate/code', [UserController::class, 'authenticateWithGoogle']);
|
||||
});
|
||||
Container::$routeCollection->get('searchUser', 'searchUser', [UserSearchController::class, 'searchUser']);
|
||||
Container::$routeCollection->group('communities', function (RouteCollection $routeCollection) {
|
||||
$routeCollection->get('community-new', 'new', [CommunityController::class, 'getCommunityNew']);
|
||||
$routeCollection->post('community-new-action', 'new', [CommunityController::class, 'saveCommunity']);
|
||||
$routeCollection->group('{communityId}', function (RouteCollection $routeCollection) {
|
||||
$routeCollection->get('community.new', 'new', [CommunityController::class, 'getCommunityNew']);
|
||||
$routeCollection->post('community.new-action', 'new', [CommunityController::class, 'saveCommunity']);
|
||||
$routeCollection->group('{communitySlug}', function (RouteCollection $routeCollection) {
|
||||
$routeCollection->get('community', '', [CommunityController::class, 'getCommunityHome']);
|
||||
$routeCollection->get('community-edit', 'edit', [CommunityController::class, 'getCommunityEdit']);
|
||||
$routeCollection->post('community-edit-action', 'edit', [CommunityController::class, 'saveCommunity']);
|
||||
$routeCollection->get('community-members', 'members', [CommunityController::class, 'getMembersEdit']);
|
||||
$routeCollection->post('community-members-new', 'newMember', [CommunityController::class, 'saveMember']);
|
||||
$routeCollection->post('community-members-edit', 'editMember', [CommunityController::class, 'saveMember']);
|
||||
$routeCollection->post('community-members-delete', 'deleteMember', [CommunityController::class, 'deleteMember']);
|
||||
$routeCollection->get('community-currencies', 'currencies', [CommunityController::class, 'getCurrenciesEdit']);
|
||||
$routeCollection->post('community-currencies-new', 'newCurrency', [CommunityController::class, 'saveCurrency']);
|
||||
$routeCollection->post('community-currencies-edit', 'editCurrency', [CommunityController::class, 'saveCurrency']);
|
||||
$routeCollection->post('community-currencies-delete', 'deleteCurrency', [CommunityController::class, 'deleteCurrency']);
|
||||
$routeCollection->get('community.settings', 'settings', [CommunityController::class, 'getCommunitySettings']);
|
||||
$routeCollection->get('community.edit', 'edit', [CommunityController::class, 'getCommunityEdit']);
|
||||
$routeCollection->post('community.edit-action', 'edit', [CommunityController::class, 'saveCommunity']);
|
||||
$routeCollection->get('community.members', 'members', [CommunityController::class, 'getMembersEdit']);
|
||||
$routeCollection->post('community.members.new-action', 'members/new', [CommunityController::class, 'saveMember']);
|
||||
$routeCollection->post('community.members.edit-action', 'members/edit', [CommunityController::class, 'saveMember']);
|
||||
$routeCollection->post('community.members.delete-action', 'members/delete', [CommunityController::class, 'deleteMember']);
|
||||
$routeCollection->get('community.currencies', 'currencies', [CommunityController::class, 'getCurrenciesEdit']);
|
||||
$routeCollection->post('community.currencies.new-action', 'currencies/new', [CommunityController::class, 'saveCurrency']);
|
||||
$routeCollection->post('community.currencies.edit-action', 'currencies/edit', [CommunityController::class, 'saveCurrency']);
|
||||
$routeCollection->post('community.currencies.delete-action', 'currencies/delete', [CommunityController::class, 'deleteCurrency']);
|
||||
$routeCollection->group('currencyExchangeRates', function (RouteCollection $routeCollection) {
|
||||
$routeCollection->get('community-currency-exchange-rates', '{code}', [CommunityController::class, 'getCurrencyExchangeRates']);
|
||||
$routeCollection->post('community-currency-exchange-rates-new', '{code}/new', [CommunityController::class, 'saveCurrencyExchangeRate']);
|
||||
$routeCollection->post('community-currency-exchange-rates-edit', '{code}/edit', [CommunityController::class, 'saveCurrencyExchangeRate']);
|
||||
$routeCollection->post('community-currency-exchange-rates-delete', '{code}/delete', [CommunityController::class, 'deleteCurrencyExchangeRate']);
|
||||
$routeCollection->get('community.currencyExchangeRates', '{code}', [CommunityController::class, 'getCurrencyExchangeRates']);
|
||||
$routeCollection->post('community.currencyExchangeRates.new-action', '{code}/new', [CommunityController::class, 'saveCurrencyExchangeRate']);
|
||||
$routeCollection->post('community.currencyExchangeRates.edit-action', '{code}/edit', [CommunityController::class, 'saveCurrencyExchangeRate']);
|
||||
$routeCollection->post('community.currencyExchangeRates.delete-action', '{code}/delete', [CommunityController::class, 'deleteCurrencyExchangeRate']);
|
||||
});
|
||||
$routeCollection->group('transactions', function (RouteCollection $routeCollection) {
|
||||
$routeCollection->get('community.transactions', '', [TransactionController::class, 'getTransactions']);
|
||||
@@ -83,38 +89,32 @@ Container::$routeCollection->group('communities', function (RouteCollection $rou
|
||||
$routeCollection->post('community.transactions.new-action', 'new', [TransactionController::class, 'saveTransaction']);
|
||||
$routeCollection->get('community.transactions.edit', '{transactionId}', [TransactionController::class, 'getTransactionEdit']);
|
||||
$routeCollection->post('community.transactions.edit-action', '{transactionId}', [TransactionController::class, 'saveTransaction']);
|
||||
$routeCollection->post('community.transactions.delete', '{transactionId}/delete', [TransactionController::class, 'deleteTransaction']);
|
||||
$routeCollection->post('community.transactions.delete-action', '{transactionId}/delete', [TransactionController::class, 'deleteTransaction']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Container::$sessionHandler = new DatabaseSessionHandler(Container::$dbConnection);
|
||||
Container::$sessionHandler = new DatabaseSessionHandler(
|
||||
Container::$dbConnection,
|
||||
'sessions',
|
||||
new DateTime('-7 days')
|
||||
);
|
||||
|
||||
session_set_save_handler(Container::$sessionHandler, true);
|
||||
session_start([
|
||||
'gc_probability' => 0, // old sessions are deleted by MaintainDatabaseCommand
|
||||
'cookie_lifetime' => 604800,
|
||||
'cookie_lifetime' => 0,
|
||||
'cookie_path' => '/',
|
||||
'cookie_httponly' => true,
|
||||
'cookie_samesite' => 'Lax'
|
||||
]);
|
||||
|
||||
if (isset($_COOKIE[session_name()])) {
|
||||
// extend session cookie lifetime is cookie already exists
|
||||
setcookie(session_name(), session_id(), [
|
||||
'expires' => time() + 604800,
|
||||
'path' => '/',
|
||||
'httponly' => true,
|
||||
'samesite' => 'Lax'
|
||||
]);
|
||||
}
|
||||
|
||||
Container::$request = new Request(
|
||||
$_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'],
|
||||
$_GET,
|
||||
$_POST,
|
||||
getallheaders(),
|
||||
$_SESSION,
|
||||
new Session($_SESSION),
|
||||
new UserRepository()
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user