Skip to content

Commit a6783c2

Browse files
authored
Merge pull request #99 from MultinetInteractive/feature-newAPI
Bugfixes
2 parents 3d89368 + 0de20d8 commit a6783c2

9 files changed

Lines changed: 100 additions & 17 deletions

File tree

.travis.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
sudo: false
22
language: php
33

4-
notifications:
5-
on_success: never
6-
on_failure: change
7-
84
php:
95
- 5.6
106

@@ -19,9 +15,15 @@ script:
1915
- cd wp-tests/spec && bundle exec rspec test.rb && cd .. && cd .. && phpunit
2016

2117
deploy:
22-
provider: script
23-
skip_cleanup: true
24-
script: chmod +x $TRAVIS_BUILD_DIR/scripts/deploy.sh && $TRAVIS_BUILD_DIR/scripts/deploy.sh
25-
on:
26-
branch: production
27-
php: 5.6
18+
- provider: script
19+
skip_cleanup: true
20+
script: chmod +x $TRAVIS_BUILD_DIR/scripts/trunk.sh && $TRAVIS_BUILD_DIR/scripts/trunk.sh
21+
on:
22+
branch: master
23+
php: 5.6
24+
- provider: script
25+
skip_cleanup: true
26+
script: chmod +x $TRAVIS_BUILD_DIR/scripts/deploy.sh && $TRAVIS_BUILD_DIR/scripts/deploy.sh
27+
on:
28+
branch: production
29+
php: 5.6

content/script/frontendjs.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ var eduBookingView = {
1616
var cloned = tmpl.cloneNode( true );
1717
cloned.style.display = 'block';
1818
cloned.className = cloned.className.replace( ' template', '' );
19+
20+
var requiredFields = cloned.querySelectorAll('[data-required]');
21+
for (var index = 0; index < requiredFields.length; index++) {
22+
requiredFields[index].setAttribute('required', '');
23+
requiredFields[index].required = true;
24+
}
1925
holder.appendChild( cloned );
2026
}
2127
else {

content/template/bookingTemplate/participantView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class="participantFirstName" name="participantFirstName[]"
195195
<?php edu_e( "Civic Registration Number" ); ?>
196196
</div>
197197
<div class="inputHolder">
198-
<input type="text" required name="participantCivReg[]"
198+
<input type="text" data-required="true" name="participantCivReg[]"
199199
pattern="(\d{2,4})-?(\d{2,2})-?(\d{2,2})-?(\d{4,4})" class="eduadmin-civicRegNo"
200200
placeholder="<?php edu_e( "Civic Registration Number" ); ?>"/>
201201
</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.6
11+
* Version: 1.0.7
1212
* GitHub Plugin URI: multinetinteractive/eduadmin-wordpress
1313
* GitHub Plugin URI: https://github.com/multinetinteractive/eduadmin-wordpress
1414
* Requires at least: 3.0

includes/bookingSettings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ function edu_writeOptions( $g, $array, $depth, $selectedOption ) {
915915
} ?> /> <?php _e( "Use booking terms", "eduadmin-booking" ); ?>
916916
</label>
917917
<h3><?php _e( "Javascript to run when a booking is completed", "eduadmin-booking" ); ?></h3>
918-
<i><?php htmlentities( _e( "You do not need to include &lt;script&gt;-tags", "eduadmin" ) ); ?></i>
918+
<i><?php _e( "You do not need to include &lt;script&gt;-tags", "eduadmin-booking" ); ?></i>
919919
<br/>
920920
<table>
921921
<tr>

includes/listSettings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function edu_render_list_settings_page() {
129129
<select name="eduadmin-layout-descriptionfield">
130130
<optgroup
131131
label="<?php _e( "Course fields", "eduadmin-booking" ); ?>">
132-
<option value="CourseDescriptionShort"<?php echo( $selectedDescriptionField === "CourseDescriptionShort" ? " selected=\"selected\"" : "" ); ?>><?php _e( "Short course description", "eduadmin" ); ?></option>
132+
<option value="CourseDescriptionShort"<?php echo( $selectedDescriptionField === "CourseDescriptionShort" ? " selected=\"selected\"" : "" ); ?>><?php _e( "Short course description", "eduadmin-booking" ); ?></option>
133133
<option value="CourseDescription"<?php if ( $selectedDescriptionField === "CourseDescription" ) {
134134
echo " selected=\"selected\"";
135135
} ?>><?php _e( "Course description", "eduadmin-booking" ); ?></option>

includes/settingsPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function edu_render_settings_page() {
2727
<?php echo __( "Enter the provided Api Key to connect to EduAdmin", "eduadmin-booking" ); ?>
2828
</p>
2929
<p>
30-
<?php echo sprintf( __( "You can get these details by contacting %s", "eduadmin-booking" ), sprintf( "<a href=\"http://support.multinet.se\" target=\"_blank\">%s</a>", __( "our support", "eduadmin" ) ) ); ?>
30+
<?php echo sprintf( __( "You can get these details by contacting %s", "eduadmin-booking" ), sprintf( "<a href=\"http://support.multinet.se\" target=\"_blank\">%s</a>", __( "our support", "eduadmin-booking" ) ) ); ?>
3131
</p>
3232
<input type="text" readonly class="form-control api_hash" name="eduadmin-api-key"
3333
id="eduadmin-api-key"

readme.txt

Lines changed: 7 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.6
7+
Stable tag: 1.0.7
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,10 @@ Requires at least PHP 5.0.1 (with [SoapClient](http://php.net/manual/en/book.soa
3535

3636
== Changelog ==
3737

38+
### [1.0.7]
39+
- Fixed text domain on three phrases I missed earlier.
40+
- Fixing validation error for civic reg numbers.
41+
3842
### [1.0.6]
3943
- Adding setting to force customers to be registered before being able to book
4044

@@ -436,7 +440,8 @@ Requires at least PHP 5.0.1 (with [SoapClient](http://php.net/manual/en/book.soa
436440
#### Added
437441
- Added inquiry support in course
438442

439-
[Unreleased]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.6...HEAD
443+
[Unreleased]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.7...HEAD
444+
[1.0.7]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.6...v1.0.7
440445
[1.0.6]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.5...v1.0.6
441446
[1.0.5]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.4...v1.0.5
442447
[1.0.4]: https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v1.0.3...v1.0.4

scripts/trunk.sh

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env bash
2+
3+
if [[ -z "$TRAVIS" ]]; then
4+
echo "Script is only to be run by Travis CI" 1>&2
5+
exit 1
6+
fi
7+
8+
if [[ -z "$WP_PASSWORD" ]]; then
9+
echo "WordPress.org password not set" 1>&2
10+
exit 1
11+
fi
12+
13+
if [[ -z "$TRAVIS_BRANCH" || "$TRAVIS_BRANCH" == "production" ]]; then
14+
echo "Build branch is required and must not be a production" 1>&2
15+
exit 0
16+
fi
17+
18+
19+
PLUGIN="eduadmin-booking"
20+
PROJECT_ROOT=$TRAVIS_BUILD_DIR
21+
VERSION="$(cat $PROJECT_ROOT/eduadmin.php | grep Version: | head -1 | cut -d: -f2 | tr -d '[[:space:]]')"
22+
23+
echo "Version: $VERSION of $PLUGIN"
24+
25+
# Remove files not needed in plugin for deployment
26+
rm -f $PROJECT_ROOT/composer.json
27+
rm -f $PROJECT_ROOT/.scrutinizer.yml
28+
rm -f $PROJECT_ROOT/.travis.yml
29+
rm -f $PROJECT_ROOT/CONTRIBUTING.md
30+
rm -f $PROJECT_ROOT/LICENSE.md
31+
rm -f $PROJECT_ROOT/phpunit.xml
32+
rm -f $PROJECT_ROOT/README.md
33+
rm -f $PROJECT_ROOT/.gitignore
34+
rm -fR $PROJECT_ROOT/scripts
35+
rm -fR $PROJECT_ROOT/tests
36+
rm -fR $PROJECT_ROOT/.git
37+
rm -fR $PROJECT_ROOT/wp-tests
38+
39+
# Make sure we are in the project root
40+
cd $PROJECT_ROOT
41+
42+
# Go up one folder
43+
cd ..
44+
45+
# Delete and recreate the deployFolder
46+
rm -fR deployFolder
47+
mkdir deployFolder
48+
49+
# Go into the deployFolder
50+
cd deployFolder
51+
52+
# Clean up any previous svn dir
53+
rm -fR svn
54+
55+
# Checkout the SVN repo
56+
svn co -q "http://svn.wp-plugins.org/$PLUGIN" svn
57+
58+
# Copy our new version of the plugin into trunk
59+
rsync -r -p -v --delete-before $PROJECT_ROOT/* svn/trunk
60+
61+
svn stat svn | grep '^?' | awk '{print $2}' | xargs -I x svn add x@
62+
# Remove deleted files from SVN
63+
svn stat svn | grep '^!' | awk '{print $2}' | xargs -I x svn rm --force x@
64+
svn stat svn
65+
66+
# Commit to SVN
67+
svn ci --no-auth-cache --username $WP_USERNAME --password $WP_PASSWORD svn -m "Committing changes for $VERSION"
68+
69+
# Remove SVN temp dir
70+
rm -fR svn

0 commit comments

Comments
 (0)