5 Commits

Author SHA1 Message Date
b9307c2f5a Basic steps for registration of participants 2024-07-22 21:27:53 +02:00
c7b3072e59 Version update 2024-06-03 23:51:58 +02:00
b0c576bad3 Version update 2024-06-01 11:27:32 +02:00
30375476cc Version update 2024-06-01 11:26:43 +02:00
943e8dc273 Merge pull request 'epic-anmeldungen' (#2) from epic-anmeldungen into main
Reviewed-on: #2
2024-06-01 11:23:32 +02:00
7 changed files with 84 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<?php <?php
if (!isset($argv[1])) { if (!isset($argv[1])) {
die('No version set, please use ' . PHP_EOL .'make setup version=' . PHP_EOL); die('No version set, please use ' . PHP_EOL .'make deploy version=' . PHP_EOL);
} }
$file = file_get_contents(dirname(__FILE__) . '/info.json.tpl'); $file = file_get_contents(dirname(__FILE__) . '/info.json.tpl');
$file = str_replace('%version%', $argv[1], $file); $file = str_replace('%version%', $argv[1], $file);

View File

@ -2,7 +2,7 @@
/** /**
* Plugin Name: BdP Kompass * Plugin Name: BdP Kompass
* Description: Wordpress-Plugin zur Unterstützung von Stämmen im Bund der Pfadfinderinnen und Pfadfinder e.V. zur optimalen Verwaltung eurer Webseite * Description: Wordpress-Plugin zur Unterstützung von Stämmen im Bund der Pfadfinderinnen und Pfadfinder e.V. zur optimalen Verwaltung eurer Webseite
* Version: 4.6.1 * Version: 4.6.2
* Tags: bdp, utility, helper * Tags: bdp, utility, helper
* Requires at least: 6.0 * Requires at least: 6.0
* Requires PHP: 8.2 * Requires PHP: 8.2

View File

@ -1,3 +1,14 @@
<h4>Version 4.6.2</h4>
<ul>
<li>Bugfixes</li>
</ul>
<h4>Version 4.6.1</h4>
<ul>
<li>Veranstaltungsanmeldungen</li>
</ul>
<h4>Version 4.3.9</h4> <h4>Version 4.3.9</h4>
<ul> <ul>
<li>Fehlerbehebung</li> <li>Fehlerbehebung</li>

View File

@ -4,7 +4,7 @@ SET time_zone = "+00:00";
CREATE TABLE `%tablename%` ( CREATE TABLE `%tablename%` (
`id` int NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
`EVENTiD` int NOT NULL, `eventID` int NOT NULL,
`teilnahme` ENUM('participant','volunteer','other','') NOT NULL, `teilnahme` ENUM('participant','volunteer','other','') NOT NULL,
`vorname` varchar(128) NOT NULL, `vorname` varchar(128) NOT NULL,
`nachname` varchar(128) NOT NULL, `nachname` varchar(128) NOT NULL,

View File

@ -38,6 +38,10 @@ class AjaxRouterController {
new PrintParticipantListPhotoPdfController(); new PrintParticipantListPhotoPdfController();
break; break;
case 'print_invoice_data':
new PrintParticipantListInvoicePdfController();
die();
default: default:
echo 'No "method" specified.'; echo 'No "method" specified.';
} }

View File

@ -0,0 +1,65 @@
<?php
namespace Bdp\Modules\EventParticipants\Controllers;
use Bdp\Modules\EventParticipants\Models\Event;
use Bdp\Modules\EventParticipants\Reqeust\AnwesenheitRequest;
class PrintParticipantListInvoicePdfController {
private function get_table_header(string $event_name) : string {
return '<h1>Teili-Liste für ' . $event_name . '</h1><br /><br /><br /><br /><table style="border-spacing: 0; width: 100%;page-break-after: always">' .
'<tr>' .
'<td>Vorname</td>' .
'<td>Nachname</td>' .
'<td>Teili-Gruppe</td>' .
'<td>Stamm</td>' .
'<td>Geburtsdatum</td>' .
'<td>Beitrag</td>' .
'<td>Tage</td>' .
'<td>Notizen</td>';
}
public function __construct() {
global $_POST, $_REQUEST, $dbHandler;
$group_name = ['participant' => 'Teili', 'volunteer' => 'Teami', 'other' => 'Sonstige'];
$event = Event::loadById( $_REQUEST['event-id'] );
$output = '';
$i = 0;
foreach ( $event->tribes as $tribe => $participants ) {
if ( count( $participants ) == 0 ) {
continue;
}
foreach ( $participants as $participant ) {
if ($participant->beitrag == 0) {
continue;
}
if ( $i == 0 ) {
$output .= $this->get_table_header( $event->event_name );
}
$i ++;
$output .= '<tr style="min-height: 80px; height: 80px; border-style: solid; border-width: 1px;">' .
'<td style="min-height: 40px; height: 40px; width: 150px; border-style: solid; border-width: 1px;">' . $participant->vorname .
('' != $participant->pfadiname ? '<br /> (' . $participant->pfadiname . ')' : '') . '</td>' .
'<td style="width: 150px; border-style: solid; border-width: 1px;">' . $participant->nachname . '</td>' .
'<td style="padding-right: 100px; border-style: solid; border-width: 1px;">' . $group_name[$participant->teilnahme] . '</td>' .
'<td style="padding-right: 100px; border-style: solid; border-width: 1px;">' . $tribe . '</td>' .
'<td style="padding-right: 50px; border-style: solid; border-width: 1px;">' . \DateTime::createFromFormat( 'Y-m-d', $participant->geburtsdatum )->format( 'd.m.Y' ) . '</td>' .
'<td style="padding-right: 50px; border-style: solid; border-width: 1px;">' . str_replace('.', ',', $participant->beitrag) . ' Euro</td>' .
'<td style="border-style: solid; border-width: 1px;">' . AnwesenheitRequest::send($participant) . '</td>' .
'<td style="padding-right: 150px; border-style: solid; border-width: 1px;"></td></tr>';
if ( $i == 12 ) {
$output .= '</table>';
$i = 0;
}
}
}
$output .= '</table></body></html>';
kompass_create_pdf($output,$event->event_name . ' Beitragsliste.pdf', 'landscape');
}
}

View File

@ -72,6 +72,7 @@
<a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_kitchen_data', 'event-id=<?= $event->id; ?>');" class="button">Küchenliste</a> <a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_kitchen_data', 'event-id=<?= $event->id; ?>');" class="button">Küchenliste</a>
<a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_kitchen_allergies_data', 'event-id=<?= $event->id; ?>');" class="button">Küchenliste (Allergien)</a> <a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_kitchen_allergies_data', 'event-id=<?= $event->id; ?>');" class="button">Küchenliste (Allergien)</a>
<a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_medical_data', 'event-id=<?= $event->id; ?>');" class="button">Sani-Liste</a> <a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_medical_data', 'event-id=<?= $event->id; ?>');" class="button">Sani-Liste</a>
<a href="#" onclick="kompass_load_ajax_nw('EventParticipants', 'print_invoice_data', 'event-id=<?= $event->id; ?>');" class="button">Beitrags-Liste</a>
<a href="<?= $admin_link . 'send-mail-to-all&event-id=' . $event->id ?>" class="button">Rundmail an alle</a> <a href="<?= $admin_link . 'send-mail-to-all&event-id=' . $event->id ?>" class="button">Rundmail an alle</a>
</div> </div>