Skip to content

Commit

Permalink
2.58.0 Added Donations Management
Browse files Browse the repository at this point in the history
  • Loading branch information
classaxe committed Aug 26, 2023
1 parent 17ac9e1 commit 0397da5
Show file tree
Hide file tree
Showing 40 changed files with 2,096 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -20,3 +20,5 @@ yarn-error.log
.phpunit
/phpunit.xml
###< symfony/phpunit-bridge ###

/stats
30 changes: 28 additions & 2 deletions public/css/style.css
@@ -1,8 +1,8 @@
/*
* Project: RXX - NDB Logging Database
* Homepage: https://rxx.classaxe.com
* Version: 2.57.4
* Date: 2023-07-31
* Version: 2.58.0
* Date: 2023-08-26
* Licence: LGPL
* Copyright: 2023 Martin Francis
*/
Expand Down Expand Up @@ -3047,6 +3047,32 @@ div.scroll div table.parse.results tbody tr {
margin: 0 0 0.25em 0;
vertical-align: middle;
}
.donor_view #form div label,
.donation_view #form div label {
width: 25%;
}
.donor_view #form div input[type='text'],
.donation_view #form div input[type='text'],
.donor_view #form div textarea,
.donation_view #form div textarea,
.donor_view #form div select,
.donation_view #form div select {
width: 70%;
padding: 0.125em 0.25em;
margin: 0 0 0.25em 0;
}
.donor_view #form div input[type='text']#form_date,
.donation_view #form div input[type='text']#form_date,
.donor_view #form div textarea#form_date,
.donation_view #form div textarea#form_date,
.donor_view #form div select#form_date,
.donation_view #form div select#form_date {
width: 95px;
padding: 0 1.75em 0 0.25em !important;
background: #ffffff url("../../../image/calendar.png") no-repeat;
background-size: auto 100%;
background-position: right;
}
a.add,
a.close,
a.delete,
Expand Down
2 changes: 1 addition & 1 deletion public/css/style.min.css

Large diffs are not rendered by default.

50 changes: 48 additions & 2 deletions public/js/functions.js
@@ -1,8 +1,8 @@
/*
* Project: RXX - NDB Logging Database
* Homepage: https://rxx.classaxe.com
* Version: 2.57.4
* Date: 2023-07-31
* Version: 2.58.0
* Date: 2023-08-26
* Licence: LGPL
* Copyright: 2023 Martin Francis
*/
Expand All @@ -24,6 +24,10 @@ var popWinSpecs = {
'countries_na' : 'width=640,height=220,resizable=1',
'countries_oc' : 'width=680,height=500,resizable=1',
'countries_sa' : 'width=320,height=600,resizable=1',
'donations_[id]' : 'width=420,height=400,status=1,scrollbars=1,resizable=1',
'donations_new' : 'width=420,height=400,status=1,scrollbars=1,resizable=1',
'donors_[id]' : 'width=540,height=380,status=1,scrollbars=1,resizable=1',
'donors_new' : 'width=540,height=380,status=1,scrollbars=1,resizable=1',
'listeners_[id]' : 'width=1120,height=760,status=1,scrollbars=1,resizable=1',
'listeners_[id]_logs' : 'width=1120,height=760,status=1,scrollbars=1,resizable=1',
'listeners_[id]_logsessions' : 'width=1120,height=760,status=1,scrollbars=1,resizable=1',
Expand Down Expand Up @@ -630,6 +634,48 @@ var COMMON_FORM = {

}

function initDonationsForm(pagingMsg, resultsCount) {
$(document).ready( function() {
COMMON_FORM.setPagingControls();

setColumnSortActions();
setColumnSortedClass();
setExternalLinks();

COMMON_FORM.setPagingStatus(pagingMsg, resultsCount);
setDonationActions();
});
}

function setDonationActions() {
$('#btn_new').click(function() {
window.open('./donations/new', 'donation_new', popWinSpecs['donations_[id]']);
return false;
});
}


function initDonorsForm(pagingMsg, resultsCount) {
$(document).ready( function() {
COMMON_FORM.setPagingControls();

setColumnSortActions();
setColumnSortedClass();
setExternalLinks();

COMMON_FORM.setPagingStatus(pagingMsg, resultsCount);
setDonorActions();
});
}

function setDonorActions() {
$('#btn_new').click(function() {
window.open('./donors/new', 'donor_new', popWinSpecs['donors_[id]']);
return false;
});
}


Number.prototype.numberFormat = function(decimals, dec_point, thousands_sep) {
var parts
dec_point = typeof dec_point !== 'undefined' ? dec_point : '.';
Expand Down
6 changes: 3 additions & 3 deletions public/js/functions.min.js

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions src/Columns/Donations.php
@@ -0,0 +1,76 @@
<?php
namespace App\Columns;

class Donations
{
public function getColumns()
{
return [
'id' => [
'admin' => false,
'arg' => '',
'field' => 'id',
'highlight' => 'id',
'label' => 'ID',
'labelSort' => '',
'order' => 'a',
'sort' => 'id',
'td_class' => 'rowspan2',
'th_class' => 'rowspan2',
'tooltip' => 'Donor Name',
],
'name' => [
'admin' => false,
'arg' => '',
'field' => 'name',
'highlight' => 'name',
'label' => 'Name',
'labelSort' => '',
'order' => 'a',
'sort' => 'name',
'td_class' => 'rowspan2',
'th_class' => 'rowspan2',
'tooltip' => 'Donor Name',
],
'date' => [
'admin' => false,
'arg' => '',
'field' => 'date',
'highlight' => 'date',
'label' => 'Date',
'labelSort' => '',
'order' => 'a',
'sort' => 'date',
'td_class' => 'rowspan2',
'th_class' => 'rowspan2',
'tooltip' => 'Donation Date',
],
'amount' => [
'admin' => false,
'arg' => '',
'field' => 'amount',
'highlight' => 'amount',
'label' => 'Amount',
'labelSort' => '',
'order' => 'a',
'sort' => 'amount',
'td_class' => 'rowspan2',
'th_class' => 'rowspan2',
'tooltip' => 'Amount of Donation',
],
'message' => [
'admin' => false,
'arg' => '',
'field' => 'message',
'highlight' => 'message',
'label' => 'Message',
'labelSort' => '',
'order' => '',
'sort' => '',
'td_class' => 'rowspan2',
'th_class' => 'txt_vertical',
'tooltip' => 'Message with Donation',
],
];
}
}
128 changes: 128 additions & 0 deletions src/Columns/Donors.php
@@ -0,0 +1,128 @@
<?php
namespace App\Columns;

class Donors
{
public function getColumns()
{
return [
'name' => [
'admin' => false,
'arg' => '',
'field' => 'name',
'highlight' => 'name',
'label' => 'Name',
'labelSort' => '',
'order' => 'a',
'sort' => 'name',
'td_class' => 'rowspan2',
'th_class' => 'rowspan2',
'tooltip' => 'Name of Donor',
],
'display' => [
'admin' => false,
'arg' => '',
'field' => 'display',
'highlight' => 'display',
'label' => 'Display Name',
'labelSort' => '',
'order' => 'a',
'sort' => 'display',
'td_class' => 'rowspan2',
'th_class' => 'rowspan2',
'tooltip' => 'Display Name for Donor',
],
'callsign' => [
'admin' => false,
'arg' => '',
'field' => 'callsign',
'highlight' => 'callsign',
'label' => 'Callsign',
'labelSort' => '',
'order' => 'a',
'sort' => 'callsign',
'td_class' => 'rowspan2',
'th_class' => 'rowspan2',
'tooltip' => 'Callsign for Donor',
],
'email' => [
'admin' => false,
'arg' => '',
'field' => 'email',
'highlight' => 'email',
'label' => 'Email',
'labelSort' => '',
'order' => 'a',
'sort' => 'email',
'td_class' => 'rowspan2',
'th_class' => 'rowspan2',
'tooltip' => 'Email address for donor (not shown)',
],
'itu' => [
'admin' => false,
'arg' => '',
'field' => 'itu',
'highlight' => 'itu',
'label' => 'ITU',
'labelSort' => '',
'order' => 'a',
'sort' => 'itu',
'td_class' => 'rowspan2',
'th_class' => 'rowspan2',
'tooltip' => 'Donor\'s Country',
],
'sp' => [
'admin' => false,
'arg' => '',
'field' => 'sp',
'highlight' => 'sp',
'label' => 'SP',
'labelSort' => '',
'order' => 'a',
'sort' => 'sp',
'td_class' => 'rowspan2',
'th_class' => 'rowspan2',
'tooltip' => 'Donor\s State or Province',
],
'anonymous' => [
'admin' => false,
'arg' => '',
'field' => 'anonymous',
'highlight' => false,
'label' => 'Anon',
'labelSort' => '',
'order' => 'd',
'sort' => 'anonymous',
'td_class' => 'rowspan2',
'th_class' => 'txt_vertical',
'tooltip' => 'Whether donor requests to be anonymous',
],
'donations' => [
'admin' => false,
'arg' => '',
'field' => 'donations',
'highlight' => 'donations',
'label' => 'Num',
'labelSort' => '',
'order' => '',
'sort' => '',
'td_class' => 'rowspan2',
'th_class' => 'txt_vertical',
'tooltip' => 'Number of Donations',
],
'total' => [
'admin' => false,
'arg' => '',
'field' => 'total',
'highlight' => 'total',
'label' => 'Total',
'labelSort' => '',
'order' => '',
'sort' => '',
'td_class' => 'rowspan2',
'th_class' => 'txt_vertical',
'tooltip' => 'Sum of Donations',
],
];
}
}
13 changes: 11 additions & 2 deletions src/Controller/Web/Base.php
Expand Up @@ -5,6 +5,8 @@
use App\Repository\BackupRepository;
use App\Repository\CleRepository;
use App\Repository\CountryRepository;
use App\Repository\DonorRepository;
use App\Repository\DonationRepository;
use App\Repository\IcaoRepository;
use App\Repository\LanguageRepository;
use App\Repository\ListenerRepository;
Expand Down Expand Up @@ -47,6 +49,8 @@ class Base extends AbstractController
protected $backupRepository;
protected $cleRepository;
protected $countryRepository;
protected $donationRepository;
protected $donorRepository;
protected $icaoRepository;
protected $languageRepository;
protected $listenerRepository;
Expand Down Expand Up @@ -78,7 +82,8 @@ class Base extends AbstractController
* @param BackupRepository $backupRepository
* @param CleRepository $cleRepository;
* @param CountryRepository $countryRepository
* @param IcaoRepository $icaoRepository
* @param DonationRepository $donationRepository
* @param DonorRepository $$donorRepository
* @param LanguageRepository $languageRepository
* @param ListenerRepository $listenerRepository
* @param LoggerInterface $logger
Expand Down Expand Up @@ -110,6 +115,8 @@ public function __construct(
BackupRepository $backupRepository,
CleRepository $cleRepository,
CountryRepository $countryRepository,
DonationRepository $donationRepository,
DonorRepository $donorRepository,
IcaoRepository $icaoRepository,
LanguageRepository $languageRepository,
ListenerRepository $listenerRepository,
Expand Down Expand Up @@ -137,6 +144,8 @@ public function __construct(
$this->backupRepository = $backupRepository;
$this->cleRepository = $cleRepository;
$this->countryRepository = $countryRepository;
$this->donationRepository = $donationRepository;
$this->donorRepository = $donorRepository;
$this->icaoRepository = $icaoRepository;
$this->languageRepository = $languageRepository;
$this->listenerRepository = $listenerRepository;
Expand Down Expand Up @@ -282,7 +291,7 @@ protected function setValueFromRequest(&$args, $request, $field, $options = fals
$value = strtoupper($value);
break;
}
if (false === $options || in_array($value, $options)) {
if (false === $options || (is_array($options) && in_array($value, $options))) {
$args[$field] = addslashes($value);
}
}
Expand Down

0 comments on commit 0397da5

Please sign in to comment.