Skip to content

Commit d941e83

Browse files
author
Chris Gårdenberg
committed
Quickfix: Listview, only show date period
1 parent 9fb9ee3 commit d941e83

10 files changed

Lines changed: 1049 additions & 494 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22

33
## [Unreleased]
44
### Added
5-
- Bugfix: Search was not respected by ajax-reloads (Bad, bad JS..)
6-
- Added extra option to show city **AND** venue name
5+
- Added `singlePersonBooking.php` to handle when the participant is customer, contact and participant.
6+
- Added `__bookSingleParticipant.php` and `__bookMultipleParticipants.php` to handle different settings.
7+
- Fixing `frontend.js` to work with single participant-settings.
8+
9+
## [0.9.11]
10+
### Added
11+
- Removed `margin-top: 1.0em; vertical-align: top;` from `.inputLabel` and replaced with `vertical-align: middle;`.
12+
- Bugfix: Search was not respected by ajax-reloads. (Bad, bad JS..)
13+
- Added extra option to show city **AND** venue name.
714
- Fixed all views and endpoints that show city to include venue name if the setting is on.
15+
- Only show date period in the listview event list, instead of all course days.
816

917
## [0.9.10]
1018
### Added
@@ -69,7 +77,8 @@
6977
- Added inquiry support in course
7078

7179

72-
[Unreleased]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.9.10...HEAD
80+
[Unreleased]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.9.11...HEAD
81+
[0.9.11]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.9.10...v0.9.11
7382
[0.9.10]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.9.9.2.40...v0.9.10
7483
[0.9.9.2.40]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.9.9.2.39...v0.9.9.2.40
7584
[0.9.9.2.39]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.9.9.2.38...v0.9.9.2.39

backend/modules/edu.api.listview.eventlist.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ function edu_api_listview_eventlist_template_A($data, $eventDates, $request)
303303
<div class="objectDescription"><?php
304304

305305
$spotsLeft = ($object->MaxParticipantNr - $object->TotalParticipantNr);
306-
echo isset($eventDates[$object->EventID]) ? edu_GetLogicalDateGroups($eventDates[$object->EventID], true, $object, true) : edu_GetOldStartEndDisplayDate($object->PeriodStart, $object->PeriodEnd, true);
306+
echo /*isset($eventDates[$object->EventID]) ? edu_GetLogicalDateGroups($eventDates[$object->EventID], true, $object, true) :*/ edu_GetOldStartEndDisplayDate($object->PeriodStart, $object->PeriodEnd, true);
307307

308308
if(!empty($object->City))
309309
{
@@ -420,7 +420,7 @@ function edu_api_listview_eventlist_template_B($data, $eventDates, $request)
420420
<div class="objectDescription"><?php
421421

422422
$spotsLeft = ($object->MaxParticipantNr - $object->TotalParticipantNr);
423-
echo isset($eventDates[$object->EventID]) ? edu_GetLogicalDateGroups($eventDates[$object->EventID]) : edu_GetOldStartEndDisplayDate($object->PeriodStart, $object->PeriodEnd, true);
423+
echo /*isset($eventDates[$object->EventID]) ? edu_GetLogicalDateGroups($eventDates[$object->EventID]) :*/ edu_GetOldStartEndDisplayDate($object->PeriodStart, $object->PeriodEnd, true);
424424

425425
if(!empty($object->City))
426426
{

content/script/frontendjs.js

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,33 @@ var eduBookingView = {
22
Customer: null,
33
ContactPerson: null,
44
Participants: [],
5+
SingleParticipant: false,
56
MaxParticipants: 0,
67
CurrentParticipants: 0,
78
AddParticipant: function() {
8-
if(eduBookingView.MaxParticipants == -1 || eduBookingView.CurrentParticipants < eduBookingView.MaxParticipants)
9-
{
10-
var holder = document.getElementById('edu-participantHolder');
11-
var tmpl = document.querySelector('.eduadmin .participantItem.template');
12-
var cloned = tmpl.cloneNode(true);
13-
cloned.style.display = 'block';
14-
cloned.className = cloned.className.replace(' template', '');
15-
holder.appendChild(cloned);
16-
}
17-
else
18-
{
19-
var partWarning = document.getElementById('edu-warning-participants');
20-
if(partWarning)
9+
if(!eduBookingView.SingleParticipant) {
10+
if(eduBookingView.MaxParticipants == -1 || eduBookingView.CurrentParticipants < eduBookingView.MaxParticipants)
2111
{
22-
partWarning.style.display = 'block';
23-
setTimeout(function() {
24-
var partWarning = document.getElementById('edu-warning-participants');
25-
partWarning.style.display = '';
26-
}, 5000);
12+
var holder = document.getElementById('edu-participantHolder');
13+
var tmpl = document.querySelector('.eduadmin .participantItem.template');
14+
var cloned = tmpl.cloneNode(true);
15+
cloned.style.display = 'block';
16+
cloned.className = cloned.className.replace(' template', '');
17+
holder.appendChild(cloned);
18+
}
19+
else
20+
{
21+
var partWarning = document.getElementById('edu-warning-participants');
22+
if(partWarning)
23+
{
24+
partWarning.style.display = 'block';
25+
setTimeout(function() {
26+
var partWarning = document.getElementById('edu-warning-participants');
27+
partWarning.style.display = '';
28+
}, 5000);
29+
}
2730
}
2831
}
29-
3032
eduBookingView.UpdatePrice();
3133
},
3234
RemoveParticipant: function(obj) {
@@ -42,7 +44,7 @@ var eduBookingView = {
4244
},
4345
CheckParticipantCount: function()
4446
{
45-
var participants = document.querySelectorAll('.eduadmin .participantItem:not(.template):not(.contactPerson)').length - 1;
47+
var participants = (eduBookingView.SingleParticipant ? 1 : document.querySelectorAll('.eduadmin .participantItem:not(.template):not(.contactPerson)').length - 1);
4648
if(participants >= eduBookingView.MaxParticipants && eduBookingView.MaxParticipants >= 0) {
4749
return false;
4850
}
@@ -59,7 +61,7 @@ var eduBookingView = {
5961
}
6062
}
6163
eduBookingView.ContactAsParticipant();
62-
eduBookingView.CurrentParticipants = document.querySelectorAll('.eduadmin .participantItem:not(.template):not(.contactPerson)').length + contact;
64+
eduBookingView.CurrentParticipants = (eduBookingView.SingleParticipant ? 1 : document.querySelectorAll('.eduadmin .participantItem:not(.template):not(.contactPerson)').length + contact);
6365

6466
var questions = document.querySelectorAll('.questionPanel [data-price]');
6567

@@ -160,7 +162,7 @@ var eduBookingView = {
160162
}
161163
}
162164

163-
if(contactParticipant.checked) {
165+
if(contactParticipant && contactParticipant.checked) {
164166
var subEventPrices = document.querySelectorAll('.eduadmin .participantItem.contactPerson:not(.template) input.subEventCheckBox:checked');
165167
if(subEventPrices.length > 0) {
166168
for(var i = 0; i < subEventPrices.length; i++) {

content/style/frontendstyle.css

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,6 @@
304304
margin: 0;
305305
}
306306

307-
.eduadmin .textblock
308-
{
309-
}
310-
311307
.eduadmin .textblock ul
312308
{
313309
display: block;
@@ -418,8 +414,7 @@
418414
{
419415
margin-right: 1em;
420416
width: 30%;
421-
vertical-align: top;
422-
margin-top: 1.0em;
417+
vertical-align: middle;
423418
}
424419

425420
.eduadmin .inputHolder
@@ -500,11 +495,6 @@
500495
/* Mobil-css för när vi ska fixa till så att den är responsiv */
501496
@media (max-width: 690px)
502497
{
503-
.eduadmin .objectItem .objectDescription,
504-
.eduadmin .objectItem .dayInfo
505-
{
506-
/*display: none;*/
507-
}
508498
.eduadmin .objectItem .objectBook
509499
{
510500
display: none;
@@ -528,7 +518,6 @@
528518
{
529519
display: table-cell;
530520
vertical-align: middle;
531-
/*height: 3.7em;*/
532521
}
533522

534523
.eduadmin .inputLabel,

0 commit comments

Comments
 (0)