Skip to content

Commit a2f6bf7

Browse files
authored
Merge pull request #103 from MultinetInteractive/feature-newAPI
Pushing 1.0.8
2 parents a6783c2 + 6aca558 commit a2f6bf7

9 files changed

Lines changed: 55 additions & 23 deletions

File tree

class/class-eduadmin-loginhandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function process_login() {
5454
}
5555
}
5656

57-
if ( $user ) {
57+
if ( isset( $user ) ) {
5858
if ( $regularLogin ) {
5959
if ( isset( $_REQUEST['eduReturnUrl'] ) && ! empty( $_REQUEST['eduReturnUrl'] ) ) {
6060
wp_redirect( esc_url_raw( $_REQUEST['eduReturnUrl'] ) );

content/template/bookingTemplate/__checkEmail.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,29 @@
33
<?php
44
$selectedLoginField = get_option( 'eduadmin-loginField', 'Email' );
55
$loginLabel = edu__( "E-mail address" );
6+
$fieldType = "text";
67
switch ( $selectedLoginField ) {
78
case "Email":
89
$loginLabel = edu__( "E-mail address" );
10+
$fieldType = "email";
911
break;
1012
case "CivicRegistrationNumber":
1113
$loginLabel = edu__( "Civic Registration Number" );
14+
$fieldType = "text";
1215
break;
1316
case "CustomerNumber":
1417
$loginLabel = edu__( "Customer number" );
18+
$fieldType = "text";
1519
break;
1620
}
1721
?>
1822
<h3><?php echo sprintf( edu__( "Please enter your %s to continue." ), $loginLabel ); ?></h3>
1923
<label>
2024
<div class="inputLabel"><?php echo $loginLabel; ?></div>
2125
<div class="inputHolder">
22-
<input type="text"
26+
<input type="<?php echo $fieldType; ?>"
2327
name="eduadminloginEmail"<?php echo( $selectedLoginField == "CivicRegistrationNumber" ? " class=\"eduadmin-civicRegNo\" onblur=\"eduBookingView.ValidateCivicRegNo();\"" : "" ); ?>
24-
required
28+
required autocomplete="off"
2529
title="<?php echo esc_attr( sprintf( edu__( "Please enter your %s here" ), $loginLabel ) ); ?>"
2630
placeholder="<?php echo esc_attr( $loginLabel ); ?>"
2731
value="<?php echo @esc_attr( sanitize_text_field( $_REQUEST["eduadminloginEmail"] ) ); ?>"/>

content/template/bookingTemplate/__loginForm.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,28 @@
44
<?php
55
$selectedLoginField = get_option( 'eduadmin-loginField', 'Email' );
66
$loginLabel = edu__( "E-mail address" );
7+
$fieldType = "text";
78
switch ( $selectedLoginField ) {
89
case "Email":
910
$loginLabel = edu__( "E-mail address" );
11+
$fieldType = "email";
1012
break;
1113
case "CivicRegistrationNumber":
1214
$loginLabel = edu__( "Civic Registration Number" );
15+
$fieldType = "text";
1316
break;
1417
case "CustomerNumber":
1518
$loginLabel = edu__( "Customer number" );
19+
$fieldType = "text";
1620
break;
1721
}
1822
?>
1923
<label>
2024
<div class="loginLabel"><?php echo $loginLabel; ?></div>
2125
<div class="loginInput">
22-
<input type="text"
26+
<input type="<?php echo $fieldType; ?>"
2327
name="eduadminloginEmail"<?php echo( $selectedLoginField == "CivicRegistrationNumber" ? " class=\"eduadmin-civicRegNo\" onblur=\"eduBookingView.ValidateCivicRegNo();\"" : "" ); ?>
24-
required
28+
required autocomplete="off"
2529
title="<?php echo esc_attr( sprintf( edu__( "Please enter your %s here" ), $loginLabel ) ); ?>"
2630
placeholder="<?php echo esc_attr( $loginLabel ); ?>"
2731
value="<?php echo @esc_attr( sanitize_text_field( $_REQUEST["eduadminloginEmail"] ) ); ?>"/>
@@ -30,7 +34,7 @@
3034
<label>
3135
<div class="loginLabel"><?php edu_e( "Password" ); ?></div>
3236
<div class="loginInput">
33-
<input type="password" name="eduadminpassword" required
37+
<input type="password" autocomplete="off" name="eduadminpassword" required
3438
title="<?php echo esc_attr( edu__( "Please enter your password here" ) ); ?>"
3539
placeholder="<?php echo esc_attr( edu__( "Password" ) ); ?>"/>
3640
</div>

content/template/detailTemplate/template_A.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@
138138
$incVat = $eduapi->GetAccountSetting( $edutoken, 'PriceIncVat' ) == "yes";
139139

140140
$showHeaders = get_option( 'eduadmin-showDetailHeaders', true );
141+
142+
$hideSections = array();
143+
if ( isset( $attributes['hide'] ) ) {
144+
$hideSections = explode( ',', $attributes['hide'] );
145+
}
146+
141147
?>
142148
<div class="eduadmin">
143149
<a href="../" class="backLink"><?php edu_e( "« Go back" ); ?></a>
@@ -149,7 +155,7 @@
149155
</div>
150156
<hr/>
151157
<div class="textblock">
152-
<?php if ( ! empty( $selectedCourse->CourseDescription ) ) { ?>
158+
<?php if ( ! in_array( 'description' ) && ! empty( $selectedCourse->CourseDescription ) ) { ?>
153159
<?php if ( $showHeaders ) { ?>
154160
<h3><?php edu_e( "Course description" ); ?></h3>
155161
<?php } ?>
@@ -159,7 +165,7 @@
159165
?>
160166
</div>
161167
<?php } ?>
162-
<?php if ( ! empty( $selectedCourse->CourseGoal ) ) { ?>
168+
<?php if ( ! in_array( 'goal' ) && ! empty( $selectedCourse->CourseGoal ) ) { ?>
163169
<?php if ( $showHeaders ) { ?>
164170
<h3><?php edu_e( "Course goal" ); ?></h3>
165171
<?php } ?>
@@ -169,7 +175,7 @@
169175
?>
170176
</div>
171177
<?php } ?>
172-
<?php if ( ! empty( $selectedCourse->TargetGroup ) ) { ?>
178+
<?php if ( ! in_array( 'target' ) && ! empty( $selectedCourse->TargetGroup ) ) { ?>
173179
<?php if ( $showHeaders ) { ?>
174180
<h3><?php edu_e( "Target group" ); ?></h3>
175181
<?php } ?>
@@ -179,7 +185,7 @@
179185
?>
180186
</div>
181187
<?php } ?>
182-
<?php if ( ! empty( $selectedCourse->Prerequisites ) ) { ?>
188+
<?php if ( ! in_array( 'prerequisites' ) && ! empty( $selectedCourse->Prerequisites ) ) { ?>
183189
<?php if ( $showHeaders ) { ?>
184190
<h3><?php edu_e( "Prerequisites" ); ?></h3>
185191
<?php } ?>
@@ -189,7 +195,7 @@
189195
?>
190196
</div>
191197
<?php } ?>
192-
<?php if ( ! empty( $selectedCourse->CourseAfter ) ) { ?>
198+
<?php if ( ! in_array( 'after' ) && ! empty( $selectedCourse->CourseAfter ) ) { ?>
193199
<?php if ( $showHeaders ) { ?>
194200
<h3><?php edu_e( "After the course" ); ?></h3>
195201
<?php } ?>
@@ -199,7 +205,7 @@
199205
?>
200206
</div>
201207
<?php } ?>
202-
<?php if ( ! empty( $selectedCourse->Quote ) ) { ?>
208+
<?php if ( ! in_array( 'quote' ) && ! empty( $selectedCourse->Quote ) ) { ?>
203209
<?php if ( $showHeaders ) { ?>
204210
<h3><?php edu_e( "Quotes" ); ?></h3>
205211
<?php } ?>

content/template/detailTemplate/template_B.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@
7676

7777
$incVat = $eduapi->GetAccountSetting( $edutoken, 'PriceIncVat' ) == "yes";
7878
$showHeaders = get_option( 'eduadmin-showDetailHeaders', true );
79+
80+
$hideSections = array();
81+
if ( isset( $attributes['hide'] ) ) {
82+
$hideSections = explode( ',', $attributes['hide'] );
83+
}
84+
7985
?>
8086
<div class="eduadmin">
8187
<a href="../" class="backLink"><?php edu_e( "« Go back" ); ?></a>
@@ -85,7 +91,7 @@
8591
</div>
8692
<hr/>
8793
<div class="textblock leftBlock">
88-
<?php if ( ! empty( $selectedCourse->CourseDescription ) ) { ?>
94+
<?php if ( ! in_array( 'description' ) && ! empty( $selectedCourse->CourseDescription ) ) { ?>
8995
<?php if ( $showHeaders ) { ?>
9096
<h3><?php edu_e( "Course description" ); ?></h3>
9197
<?php } ?>
@@ -95,7 +101,7 @@
95101
?>
96102
</div>
97103
<?php } ?>
98-
<?php if ( ! empty( $selectedCourse->CourseGoal ) ) { ?>
104+
<?php if ( ! in_array( 'goal' ) && ! empty( $selectedCourse->CourseGoal ) ) { ?>
99105
<?php if ( $showHeaders ) { ?>
100106
<h3><?php edu_e( "Course goal" ); ?></h3>
101107
<?php } ?>
@@ -105,7 +111,7 @@
105111
?>
106112
</div>
107113
<?php } ?>
108-
<?php if ( ! empty( $selectedCourse->TargetGroup ) ) { ?>
114+
<?php if ( ! in_array( 'target' ) && ! empty( $selectedCourse->TargetGroup ) ) { ?>
109115
<?php if ( $showHeaders ) { ?>
110116
<h3><?php edu_e( "Target group" ); ?></h3>
111117
<?php } ?>
@@ -115,7 +121,7 @@
115121
?>
116122
</div>
117123
<?php } ?>
118-
<?php if ( ! empty( $selectedCourse->Prerequisites ) ) { ?>
124+
<?php if ( ! in_array( 'prerequisites' ) && ! empty( $selectedCourse->Prerequisites ) ) { ?>
119125
<?php if ( $showHeaders ) { ?>
120126
<h3><?php edu_e( "Prerequisites" ); ?></h3>
121127
<?php } ?>
@@ -127,7 +133,7 @@
127133
</div>
128134
<div class="textblock rightBlock">
129135
<?php } ?>
130-
<?php if ( ! empty( $selectedCourse->CourseAfter ) ) { ?>
136+
<?php if ( ! in_array( 'after' ) && ! empty( $selectedCourse->CourseAfter ) ) { ?>
131137
<?php if ( $showHeaders ) { ?>
132138
<h3><?php edu_e( "After the course" ); ?></h3>
133139
<?php } ?>
@@ -137,7 +143,7 @@
137143
?>
138144
</div>
139145
<?php } ?>
140-
<?php if ( ! empty( $selectedCourse->Quote ) ) { ?>
146+
<?php if ( ! in_array( 'quote' ) && ! empty( $selectedCourse->Quote ) ) { ?>
141147
<?php if ( $showHeaders ) { ?>
142148
<h3><?php edu_e( "Quotes" ); ?></h3>
143149
<?php } ?>

content/template/myPagesTemplate/loginPage.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,28 @@
77
<?php
88
$selectedLoginField = get_option( 'eduadmin-loginField', 'Email' );
99
$loginLabel = edu__( "E-mail address" );
10+
$fieldType = "text";
1011
switch ( $selectedLoginField ) {
1112
case "Email":
1213
$loginLabel = edu__( "E-mail address" );
14+
$fieldType = "email";
1315
break;
1416
case "CivicRegistrationNumber":
1517
$loginLabel = edu__( "Civic Registration Number" );
18+
$fieldType = "text";
1619
break;
1720
case "CustomerNumber":
1821
$loginLabel = edu__( "Customer number" );
22+
$fieldType = "text";
1923
break;
2024
}
2125
?>
2226
<label>
2327
<div class="loginLabel"><?php echo $loginLabel; ?></div>
2428
<div class="loginInput">
25-
<input type="text"
29+
<input type="<?php echo $fieldType; ?>"
2630
name="eduadminloginEmail"<?php echo( $selectedLoginField == "CivicRegistrationNumber" ? " class=\"eduadmin-civicRegNo\" onblur=\"eduBookingView.ValidateCivicRegNo();\"" : "" ); ?>
27-
required
31+
required autocomplete="off"
2832
title="<?php echo esc_attr( sprintf( edu__( "Please enter your %s here" ), $loginLabel ) ); ?>"
2933
placeholder="<?php echo esc_attr( $loginLabel ); ?>"
3034
value="<?php echo @esc_attr( sanitize_text_field( $_REQUEST["eduadminloginEmail"] ) ); ?>"/>
@@ -33,7 +37,7 @@
3337
<label>
3438
<div class="loginLabel"><?php edu_e( "Password" ); ?></div>
3539
<div class="loginInput">
36-
<input type="password" name="eduadminpassword" required
40+
<input type="password" autocomplete="off" name="eduadminpassword" required
3741
title="<?php echo esc_attr( edu__( "Please enter your password here" ) ); ?>"
3842
placeholder="<?php echo esc_attr( edu__( "Password" ) ); ?>"/>
3943
</div>

eduadmin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Plugin URI: http://www.eduadmin.se
99
* Description: EduAdmin plugin to allow visitors to book courses at your website
1010
* Tags: booking, participants, courses, events, eduadmin, lega online
11-
* Version: 1.0.7
11+
* Version: 1.0.8
1212
* GitHub Plugin URI: multinetinteractive/eduadmin-wordpress
1313
* GitHub Plugin URI: https://github.com/multinetinteractive/eduadmin-wordpress
1414
* Requires at least: 3.0

includes/_shortcodes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ function eduadmin_get_detail_view( $attributes ) {
7676
'template' => $selectedTemplate,
7777
'courseid' => null,
7878
'customtemplate' => null,
79+
'hide' => null,
7980
),
8081
normalize_empty_atts( $attributes ),
8182
'eduadmin-detailview'

readme.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ Requires at least PHP 5.0.1 (with [SoapClient](http://php.net/manual/en/book.soa
3535

3636
== Changelog ==
3737

38+
### [1.0.8]
39+
- Code fixes to remove notices (if warnings are shown)
40+
- Login field is now correctly typed if email is selected.
41+
- Making it possible to hide fields on the default detail templates by using the attribute `hide`
42+
- Fields that can be hidden: `description,goal,target,prerequisites,after,quote`
43+
3844
### [1.0.7]
3945
- Fixed text domain on three phrases I missed earlier.
4046
- Fixing validation error for civic reg numbers.
@@ -440,7 +446,8 @@ Requires at least PHP 5.0.1 (with [SoapClient](http://php.net/manual/en/book.soa
440446
#### Added
441447
- Added inquiry support in course
442448

443-
[Unreleased]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.7...HEAD
449+
[Unreleased]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.8...HEAD
450+
[1.0.7]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.7...v1.0.8
444451
[1.0.7]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.6...v1.0.7
445452
[1.0.6]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.5...v1.0.6
446453
[1.0.5]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.4...v1.0.5

0 commit comments

Comments
 (0)