Skip to content

Commit 4f98a4d

Browse files
authored
Merge pull request #98 from MultinetInteractive/master
v1.0.6
2 parents 6223a8e + 3d89368 commit 4f98a4d

8 files changed

Lines changed: 40 additions & 38 deletions

File tree

content/script/adminjs.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ var EduAdmin = {
1010
var me = jQuery( item );
1111
me.find( '.eduadmin-attributelist' ).slideToggle( 'fast' );
1212
},
13+
ToggleVisibility: function (visible, selector) {
14+
if (visible) jQuery(selector).show();
15+
else jQuery(selector).hide();
16+
},
1317
SpotExampleText: function () {
1418
/** global: availText */
1519
var selVal = jQuery( '.eduadmin-spotsLeft :selected' ).val();

content/style/adminstyle.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,8 @@
6262

6363
.eduadmin .eduWindow table tr:nth-child(even) {
6464
background-color: #f0f0f0;
65+
}
66+
67+
.eduadmin .eduadmin-forceLogin {
68+
display: none;
6569
}

content/template/bookingTemplate/__loginHandler.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?php
22
if ( isset( $_REQUEST['bookingLoginAction'] ) && ! empty( $_REQUEST['bookingLoginAction'] ) ) {
33
if ( $_REQUEST['bookingLoginAction'] === "checkEmail" && ! empty( $_REQUEST['eduadminloginEmail'] ) ) {
4-
$ft = new XFiltering();
5-
$selectedLoginField = get_option( 'eduadmin-loginField', 'Email' );
4+
$ft = new XFiltering();
5+
$selectedLoginField = get_option( 'eduadmin-loginField', 'Email' );
6+
$allowCustomerRegistration = get_option( "eduadmin-allowCustomerRegistration", true );
67

78
$f = new XFilter( $selectedLoginField, '=', trim( sanitize_text_field( $_REQUEST['eduadminloginEmail'] ) ) );
89
$ft->AddItem( $f );
@@ -49,7 +50,7 @@
4950
}
5051
}
5152

52-
if ( empty( $matchingContacts ) ) {
53+
if ( $allowCustomerRegistration && empty( $matchingContacts ) ) {
5354
$contact = new CustomerContact;
5455
$selectedLoginField = get_option( 'eduadmin-loginField', 'Email' );
5556
switch ( $selectedLoginField ) {
@@ -70,6 +71,10 @@
7071
$c2 = json_encode( $customer );
7172
$user->Customer = json_decode( $c2 );
7273
EDU()->session['eduadmin-loginUser'] = $user;
74+
} else {
75+
EDU()->session['needsLogin'] = true;
76+
EDU()->session['checkEmail'] = true;
77+
EDU()->session['eduadminLoginError'] = edu__( "Could not find any users with that info." );
7378
}
7479
die( "<script type=\"text/javascript\">location.href = location.href;</script>" );
7580
} else if ( $_REQUEST['bookingLoginAction'] == "forgot" ) {

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.5
11+
* Version: 1.0.6
1212
* GitHub Plugin URI: multinetinteractive/eduadmin-wordpress
1313
* GitHub Plugin URI: https://github.com/multinetinteractive/eduadmin-wordpress
1414
* Requires at least: 3.0

includes/_options.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ function eduadmin_settings_init() {
112112

113113
/* Booking settings */
114114
register_setting( 'eduadmin-booking', 'eduadmin-useLogin' );
115+
register_setting( 'eduadmin-booking', 'eduadmin-allowCustomerRegistration' );
115116
register_setting( 'eduadmin-booking', 'eduadmin-loginField' );
117+
116118
register_setting( 'eduadmin-booking', 'eduadmin-singlePersonBooking' );
117119
register_setting( 'eduadmin-booking', 'eduadmin-customerGroupId' );
118120
register_setting( 'eduadmin-booking', 'eduadmin-currency' );

includes/bookingSettings.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,22 @@ function edu_writeOptions( $g, $array, $depth, $selectedOption ) {
7171
<br/>
7272
<label>
7373
<input type="checkbox"
74-
name="eduadmin-useLogin" <?php echo( get_option( "eduadmin-useLogin", false ) ? " checked=\"checked\"" : "" ); ?> />
74+
name="eduadmin-useLogin"
75+
<?php echo( get_option( "eduadmin-useLogin", false ) ? " checked=\"checked\"" : "" ); ?>
76+
onchange="EduAdmin.ToggleVisibility(this.checked, '.eduadmin-forceLogin');"
77+
/>
7578
<?php _e( "Use login", "eduadmin-booking" ); ?>
7679
</label>
7780
<br/>
81+
<div class="eduadmin-forceLogin"<?php echo( get_option( "eduadmin-useLogin", false ) ? " style=\"display: block;\"" : " style=\"display: none;\"" ); ?>>
82+
<label>
83+
<input type="checkbox"
84+
name="eduadmin-allowCustomerRegistration"
85+
<?php echo get_option( "eduadmin-allowCustomerRegistration", true ) ? " checked=\"checked\"" : ""; ?>
86+
/>
87+
<?php _e( "Allow customer registration", "eduadmin-booking" ); ?>
88+
</label>
89+
</div>
7890
<br/>
7991
<label>
8092
<?php _e( "Login field", "eduadmin-booking" ); ?>

readme.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Contributors: mnchga
44
Tags: booking, participants, courses, events, eduadmin, lega online
55
Requires at least: 3.0
66
Tested up to: 4.9
7-
Stable tag: 1.0.5
7+
Stable tag: 1.0.6
88
Requires PHP: 5.0.1 (with SoapClient)
99
License: GPL3
1010
License-URI: https://www.gnu.org/licenses/gpl-3.0.en.html
@@ -35,6 +35,9 @@ Requires at least PHP 5.0.1 (with [SoapClient](http://php.net/manual/en/book.soa
3535

3636
== Changelog ==
3737

38+
### [1.0.6]
39+
- Adding setting to force customers to be registered before being able to book
40+
3841
### [1.0.5]
3942
- Defining `WP_SESSION_COOKIE` so that we won't get warnings/notices.
4043
- Adding script to autodeploy to WordPress when we make new releases (Commits to production-branch)
@@ -433,7 +436,8 @@ Requires at least PHP 5.0.1 (with [SoapClient](http://php.net/manual/en/book.soa
433436
#### Added
434437
- Added inquiry support in course
435438

436-
[Unreleased]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.5...HEAD
439+
[Unreleased]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.6...HEAD
440+
[1.0.6]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.5...v1.0.6
437441
[1.0.5]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.4...v1.0.5
438442
[1.0.4]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.3...v1.0.4
439443
[1.0.3]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.2...v1.0.3

scripts/deploy.sh

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -64,41 +64,12 @@ rm -fR svn
6464
# Checkout the SVN repo
6565
svn co -q "http://svn.wp-plugins.org/$PLUGIN" svn
6666

67-
# Move out the trunk directory to a temp location
68-
mv svn/trunk ./svn-trunk
69-
# Create trunk directory
70-
mkdir svn/trunk
7167
# Copy our new version of the plugin into trunk
72-
rsync -r -p $PROJECT_ROOT/* svn/trunk
73-
74-
# Copy all the .svn folders from the checked out copy of trunk to the new trunk.
75-
# This is necessary as the Travis container runs Subversion 1.6 which has .svn dirs in every sub dir
76-
cd svn/trunk/
77-
TARGET=$(pwd)
78-
cd ../../svn-trunk/
79-
80-
# Find all .svn dirs in sub dirs
81-
SVN_DIRS=`find . -type d -iname .svn`
82-
83-
for SVN_DIR in $SVN_DIRS; do
84-
SOURCE_DIR=${SVN_DIR/.}
85-
TARGET_DIR=$TARGET${SOURCE_DIR/.svn}
86-
TARGET_SVN_DIR=$TARGET${SVN_DIR/.}
87-
if [ -d "$TARGET_DIR" ]; then
88-
# Copy the .svn directory to trunk dir
89-
cp -r $SVN_DIR $TARGET_SVN_DIR
90-
fi
91-
done
92-
93-
# Back to builds dir
94-
cd ../
95-
96-
# Remove checked out dir
97-
rm -fR svn-trunk
68+
rsync -r -p -v --delete-before $PROJECT_ROOT/* svn/trunk
9869

9970
# Add new version tag
10071
mkdir svn/tags/$VERSION
101-
rsync -r -p $PROJECT_ROOT/* svn/tags/$VERSION
72+
rsync -r -p -v --delete-before $PROJECT_ROOT/* svn/tags/$VERSION
10273

10374
# Add new files to SVN
10475
svn stat svn | grep '^?' | awk '{print $2}' | xargs -I x svn add x@

0 commit comments

Comments
 (0)