Skip to content

Commit 53f91db

Browse files
author
Chris Gårdenberg
committed
Small bump in functions
1 parent b2c247b commit 53f91db

7 files changed

Lines changed: 30 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
## [Unreleased]
44
### Added
55

6+
## [0.9.17]
7+
### Added
8+
- Option to hide invoice information when events are free
9+
- If the above option is used, hides invoice information from free events
10+
611
## [0.9.16]
712
### Added
813
- `edu.apiclient.AfterUpdate` can be used as a function in javascript to run after the page has loaded all EduAdmin-related things.
@@ -119,7 +124,8 @@
119124
- Added inquiry support in course
120125

121126

122-
[Unreleased]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.9.16...HEAD
127+
[Unreleased]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.9.17...HEAD
128+
[0.9.16]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.9.16...v0.9.17
123129
[0.9.16]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.9.15...v0.9.16
124130
[0.9.15]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.9.14...v0.9.15
125131
[0.9.14]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v0.9.13...v0.9.14

content/template/bookingTemplate/customerView.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
<input type="text" required name="customerName" placeholder="<?php edu_e("Customer name"); ?>" value="<?php echo @esc_attr($customer->CustomerName); ?>" />
99
</div>
1010
</label>
11+
<?php
12+
$noInvoiceFreeEvents = get_option('eduadmin-noInvoiceFreeEvents', false);
13+
if($noInvoiceFreeEvents && $firstPrice->Price > 0) {
14+
?>
1115
<label>
1216
<div class="inputLabel">
1317
<?php edu_e("Org.No."); ?>
@@ -124,7 +128,7 @@
124128
</div>
125129
</label>
126130
<?php
127-
131+
}
128132
$so = new XSorting();
129133
$s = new XSort('SortIndex', 'ASC');
130134
$so->AddItem($s);
@@ -169,7 +173,7 @@
169173
}
170174
renderAttribute($attr, false, "", $data);
171175
}
172-
176+
if($noInvoiceFreeEvents && $firstPrice->Price > 0) {
173177
?>
174178
<label>
175179
<div class="inputHolder alsoInvoiceCustomer">
@@ -178,4 +182,5 @@
178182
<?php edu_e("Use other information for invoicing"); ?>
179183
</div>
180184
</label>
185+
<?php } ?>
181186
</div>

content/template/bookingTemplate/singlePersonBooking.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@
5858
<?php edu_e("You cannot add any more participants."); ?>
5959
</div>
6060
</div>
61-
61+
<?php
62+
$noInvoiceFreeEvents = get_option('eduadmin-noInvoiceFreeEvents', false);
63+
if($noInvoiceFreeEvents && $firstPrice->Price > 0) {
64+
?>
6265
<div class="customerView">
6366
<label>
6467
<div class="inputLabel">
@@ -155,7 +158,7 @@
155158
</label>
156159
</div>
157160
</div>
158-
161+
<?php } ?>
159162
<div class="attributeView">
160163
<?php
161164
$so = new XSorting();

content/template/bookingTemplate/template_A.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@
212212
<?php edu_e("Select the event you want to book"); ?>
213213
</div>
214214

215-
<select name="eid" class="dateInfo" onchange="eduBookingView.SelectEvent(this);">
216-
<option value="-1"><?php edu_e("Select event"); ?></option>
215+
<select name="eid" required class="dateInfo" onchange="eduBookingView.SelectEvent(this);">
216+
<option value=""><?php edu_e("Select event"); ?></option>
217217
<?php foreach($events as $ev): ?>
218218
<option value="<?php echo $ev->EventID; ?>">
219219
<?php

eduadmin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Plugin URI: http://www.eduadmin.se
1313
* Description: EduAdmin plugin to allow visitors to book courses at your website
1414
* Tags: booking, participants, courses, events, eduadmin, lega online
15-
* Version: 0.9.16
15+
* Version: 0.9.17
1616
* Requires at least: 3.0
1717
* Tested up to: 4.7.1
1818
* Author: Chris Gårdenberg, MultiNet Interactive AB
@@ -79,7 +79,7 @@ function edu_call_home()
7979
'wpVersion' => $wp_version,
8080
'token' => get_option('eduadmin-api-key'),
8181
'officialVersion' => file_exists(dirname(__FILE__) . "/.official.plugin.php"),
82-
'pluginVersion' => '0.9.16'
82+
'pluginVersion' => '0.9.17'
8383
);
8484

8585
$callHomeUrl = 'http://ws10.multinet.se/edu-plugin/wp_phone_home.php';

includes/_options.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ function eduadmin_settings_init()
4141
register_setting('eduadmin-booking', 'eduadmin-allowInterestRegEvent');
4242
register_setting('eduadmin-booking', 'eduadmin-hideSubEventDateTime');
4343
register_setting('eduadmin-booking', 'eduadmin-allowDiscountCode');
44+
register_setting('eduadmin-booking', 'eduadmin-noInvoiceFreeEvents');
4445

4546
/* Phrase settings */
4647
register_setting('eduadmin-phrases', 'eduadmin-phrases');

includes/bookingSettings.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ function edu_writeOptions($g, $array, $depth, $selectedOption)
147147
<h4><?php _e("Form settings", "eduadmin"); ?></h4>
148148
<button class="button" disabled onclick="showFormWindow(); return false;"><?php _e("Show settings", "eduadmin"); ?></button>
149149
<br />
150+
<br />
151+
<?php $noInvoiceFreeEvents = get_option('eduadmin-noInvoiceFreeEvents', false); ?>
152+
<label>
153+
<input type="checkbox" name="eduadmin-noInvoiceFreeEvents"<?php echo ($noInvoiceFreeEvents === "true" ? " checked=\"checked\"" : ""); ?> value="true" />
154+
<?php _e("Hide invoice information if the event is free", "eduadmin"); ?>
155+
</label>
150156
<h3><?php _e("Price name settings", "eduadmin"); ?></h3>
151157
<?php
152158
$priceNameSetting = get_option('eduadmin-selectPricename', 'firstPublic');

0 commit comments

Comments
 (0)