Skip to content

Commit

Permalink
Merge pull request #504 from MultinetInteractive/master
Browse files Browse the repository at this point in the history
v4.0.0
  • Loading branch information
itssimple authored Oct 10, 2023
2 parents c2a0bfb + 6916b78 commit 4ee01c7
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 79 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [4.0.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.11.1...v4.0.0) (2023-10-10)


### ⚠ BREAKING CHANGES

* **Programme/Shortcodes:** Custom code with `do_shortcode` now needs to do
`echo do_shortcode( '[eduadmin-programme-list]' );` after the change.
Which is the intended way to use `do_shortcode` the previous versions
were not working in the correct way.

### Bug Fixes

* **Programme/Shortcodes:** Fixed an issue with Programme pages ([461c3bf](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/461c3bfac424d8614580ac4f7df2fe5d70161499))

### [3.11.1](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.11.0...v3.11.1) (2023-10-09)


Expand Down
2 changes: 1 addition & 1 deletion PLUGIN-CHECKSUM
Original file line number Diff line number Diff line change
@@ -1 +1 @@
081e6567affebd04ee2bd149100373bf
f225964c4ebc0fdc2db8e51049e166ae
6 changes: 1 addition & 5 deletions content/template/myPagesTemplate/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
require_once 'profile.php';
}
} else {
if ( isset( $q['edu-login'] ) ) {
require_once 'login-page.php';
} else {
require_once 'login-page.php';
}
require_once 'login-page.php';
}

$out = ob_get_clean();
Expand Down
4 changes: 4 additions & 0 deletions content/template/programme/book.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
ob_start();
// phpcs:disable WordPress.NamingConventions,Squiz

if ( ! empty( $_POST['edu-valid-form'] ) && wp_verify_nonce( $_POST['edu-valid-form'], 'edu-booking-confirm' ) && isset( $_POST['act'] ) && 'bookProgramme' === sanitize_text_field( $_POST['act'] ) ) {
Expand Down Expand Up @@ -643,3 +644,6 @@ class="last-name" name="contactLastName" maxlength="100"
<?php
do_action( 'eduadmin-programme-bookingform-view', $programme );
}
$out = ob_get_clean();

return $out;
83 changes: 44 additions & 39 deletions content/template/programme/detail.php
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@
<?php
ob_start();
$show_headers = EDU()->is_checked( 'eduadmin-showDetailHeaders', true );
?>
<div class="eduadmin" data-courseid="<?php echo esc_attr( $programme['ProgrammeId'] ); ?>"
data-eventid="<?php echo( isset( $_REQUEST['id'] ) ? esc_attr( sanitize_text_field( $_REQUEST['id'] ) ) : '' ); ?>">
<?php if ( ! empty( $programme['ImageUrl'] ) ) : ?>
<img src="<?php echo esc_url( $programme['ImageUrl'] ); ?>" class="courseImage" />
<?php endif; ?>
<h1 class="courseTitle"><?php echo esc_html( $programme['ProgrammeName'] ); ?></h1>
<?php if ( ! empty( $programme['Description'] ) ) : ?><?php if ( $show_headers ) { ?>
<h2><?php echo esc_html_x( 'Description', 'frontend', 'eduadmin-booking' ); ?></h2>
<?php } ?><?php echo wp_kses_post( $programme['Description'] ); ?><?php endif; ?>
<?php if ( ! empty( $programme['Prerequisites'] ) ) : ?><?php if ( $show_headers ) { ?>
<h2><?php echo esc_html_x( 'Prerequisites', 'frontend', 'eduadmin-booking' ); ?></h2>
<?php } ?><?php echo wp_kses_post( $programme['Prerequisites'] ); ?><?php endif; ?>
<?php if ( ! empty( $programme['TargetGroup'] ) ) : ?><?php if ( $show_headers ) { ?>
<h2><?php echo esc_html_x( 'Target Group', 'frontend', 'eduadmin-booking' ); ?></h2>
<?php } ?><?php echo wp_kses_post( $programme['TargetGroup'] ); ?><?php endif; ?>
<?php if ( ! empty( $programme['Courses'] ) ) : ?><?php if ( $show_headers ) { ?>
<h2><?php echo esc_html_x( 'Modules', 'frontend', 'eduadmin-booking' ); ?></h2>
<?php } ?>
<ul>
<?php
foreach ( $programme['Courses'] as $module ) {
// TODO: Add link to course template page
echo '<li>' . esc_html( $module['CourseName'] ) . '</li>';
}
?>
</ul>
<?php
endif;
?>
<h2><?php echo esc_html_x( 'Programme starts', 'frontend', 'eduadmin-booking' ); ?></h2>
<?php
if ( ! empty( $programme['ProgrammeStarts'] ) ) {
include_once 'template/detail-list.php';
} else {
echo '<i>' . esc_html_x( 'No programme starts available', 'frontend', 'eduadmin-booking' ) . '</i>';
}
<div class="eduadmin" data-courseid="<?php echo esc_attr( $programme['ProgrammeId'] ); ?>"
data-eventid="<?php echo( isset( $_REQUEST['id'] ) ? esc_attr( sanitize_text_field( $_REQUEST['id'] ) ) : '' ); ?>">
<?php if ( ! empty( $programme['ImageUrl'] ) ) : ?>
<img src="<?php echo esc_url( $programme['ImageUrl'] ); ?>" class="courseImage" />
<?php endif; ?>
<h1 class="courseTitle"><?php echo esc_html( $programme['ProgrammeName'] ); ?></h1>
<?php if ( ! empty( $programme['Description'] ) ) : ?><?php if ( $show_headers ) { ?>
<h2><?php echo esc_html_x( 'Description', 'frontend', 'eduadmin-booking' ); ?></h2>
<?php } ?><?php echo wp_kses_post( $programme['Description'] ); ?><?php endif; ?>
<?php if ( ! empty( $programme['Prerequisites'] ) ) : ?><?php if ( $show_headers ) { ?>
<h2><?php echo esc_html_x( 'Prerequisites', 'frontend', 'eduadmin-booking' ); ?></h2>
<?php } ?><?php echo wp_kses_post( $programme['Prerequisites'] ); ?><?php endif; ?>
<?php if ( ! empty( $programme['TargetGroup'] ) ) : ?><?php if ( $show_headers ) { ?>
<h2><?php echo esc_html_x( 'Target Group', 'frontend', 'eduadmin-booking' ); ?></h2>
<?php } ?><?php echo wp_kses_post( $programme['TargetGroup'] ); ?><?php endif; ?>
<?php if ( ! empty( $programme['Courses'] ) ) : ?><?php if ( $show_headers ) { ?>
<h2><?php echo esc_html_x( 'Modules', 'frontend', 'eduadmin-booking' ); ?></h2>
<?php } ?>
<ul>
<?php
foreach ( $programme['Courses'] as $module ) {
// TODO: Add link to course template page
echo '<li>' . esc_html( $module['CourseName'] ) . '</li>';
}
?>
</ul>
<?php
endif;
?>
<h2><?php echo esc_html_x( 'Programme starts', 'frontend', 'eduadmin-booking' ); ?></h2>
<?php
if ( ! empty( $programme['ProgrammeStarts'] ) ) {
include_once 'template/detail-list.php';
} else {
echo '<i>' . esc_html_x( 'No programme starts available', 'frontend', 'eduadmin-booking' ) . '</i>';
}

do_action( 'eduadmin-programme-detail-view', $programme );
?>
</div>
do_action( 'eduadmin-programme-detail-view', $programme );
?>
</div>
<?php
$out = ob_get_clean();

return $out;
4 changes: 4 additions & 0 deletions content/template/programme/list.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
ob_start();
$spot_left_option = EDU()->get_option( 'eduadmin-spotsLeft', 'exactNumbers' );
$always_few_spots = EDU()->get_option( 'eduadmin-alwaysFewSpots', '3' );
$spot_settings = EDU()->get_option( 'eduadmin-spotsSettings', "1-5\n5-10\n10+" );
Expand All @@ -22,3 +23,6 @@
</div>
<?php
}
$out = ob_get_clean();

return $out;
2 changes: 1 addition & 1 deletion eduadmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Plugin URI: https://www.eduadmin.se
* Description: EduAdmin plugin to allow visitors to book courses at your website
* Tags: booking, participants, courses, events, eduadmin, lega online
* Version: 3.11.1
* Version: 4.0.0
* GitHub Plugin URI: multinetinteractive/eduadmin-wordpress
* GitHub Plugin URI: https://github.com/multinetinteractive/eduadmin-wordpress
* Requires at least: 5.8
Expand Down
26 changes: 10 additions & 16 deletions includes/edu-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -658,12 +658,11 @@ function eduadmin_get_login_view( $attributes ) {
normalize_empty_atts( $attributes ),
'eduadmin-loginview'
);
EDU()->stop_timer( $t );

ob_start();
include_once EDUADMIN_PLUGIN_PATH . '/content/template/myPagesTemplate/login.php';
$str = include_once EDUADMIN_PLUGIN_PATH . '/content/template/myPagesTemplate/login.php';
EDU()->stop_timer( $t );

return ob_get_clean();
return $str;
}

function eduadmin_get_programme_list( $attributes ) {
Expand Down Expand Up @@ -699,10 +698,7 @@ function eduadmin_get_programme_list( $attributes ) {
'StartDate),Courses'
);

ob_start();
include_once EDUADMIN_PLUGIN_PATH . '/content/template/programme/list.php';

return ob_get_clean();
return include_once EDUADMIN_PLUGIN_PATH . '/content/template/programme/list.php';
}

function eduadmin_get_programme_details( $attributes ) {
Expand Down Expand Up @@ -753,11 +749,10 @@ function eduadmin_get_programme_details( $attributes ) {
'),PriceNames'
);

ob_start();
include_once EDUADMIN_PLUGIN_PATH . '/content/template/programme/detail.php';

return ob_get_clean();
return include_once EDUADMIN_PLUGIN_PATH . '/content/template/programme/detail.php';
}

return '';
}

function eduadmin_get_programme_booking( $attributes ) {
Expand Down Expand Up @@ -804,11 +799,10 @@ function eduadmin_get_programme_booking( $attributes ) {
'Courses,Events,PaymentMethods,PriceNames'
);

ob_start();
include_once EDUADMIN_PLUGIN_PATH . '/content/template/programme/book.php';

return ob_get_clean();
return include_once EDUADMIN_PLUGIN_PATH . '/content/template/programme/book.php';
}

return '';
}

if ( is_callable( 'add_shortcode' ) ) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eduadmin-wordpress-plugin",
"private": true,
"version": "3.11.1",
"version": "4.0.0",
"repository": "https://github.com/MultinetInteractive/EduAdmin-WordPress.git",
"author": "Chris Gårdenberg <[email protected]>",
"license": "MIT",
Expand Down
23 changes: 15 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# EduAdmin Booking
- Requires at least: 5.8
- Tested up to: 6.4
- Stable tag: 3.11.1
- Stable tag: 4.0.0
- Requires PHP: 7.0
- License: GPL3
- License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
Expand Down Expand Up @@ -40,6 +40,20 @@ If you notice that your API key doesn't work any more, you have to contact us.

The full changelog available on [GitHub](https://github.com/MultinetInteractive/EduAdmin-WordPress/blob/production/CHANGELOG.md)

### [4.0.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.11.1...v4.0.0) (2023-10-10)


#### ⚠ BREAKING CHANGES

* **Programme/Shortcodes:** Custom code with `do_shortcode` now needs to do
`echo do_shortcode( '[eduadmin-programme-list]' );` after the change.
Which is the intended way to use `do_shortcode` the previous versions
were not working in the correct way.

#### Bug Fixes

* **Programme/Shortcodes:** Fixed an issue with Programme pages ([461c3bf](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/461c3bfac424d8614580ac4f7df2fe5d70161499))

### [3.11.1](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.11.0...v3.11.1) (2023-10-09)


Expand All @@ -61,12 +75,5 @@ The full changelog available on [GitHub](https://github.com/MultinetInteractive/

* Programme starts now show number of spots left (according to settings) ([0117df4](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/0117df408a557998bd04d467720e51cef331612a)), closes [#498](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/498)

### [3.9.2](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.9.1...v3.9.2) (2023-09-26)


#### Refactoring

* Made a readme.txt as well, for use in the SVN trunk. ([e6b6d61](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/e6b6d61b8e3f27c2841c25812f46f6d2cde3ead3))



23 changes: 15 additions & 8 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: mnchga
Tags: booking, participants, courses, events, eduadmin, lega online
Requires at least: 5.8
Tested up to: 6.4
Stable tag: 3.11.1
Stable tag: 4.0.0
Requires PHP: 7.0
License: GPL3
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
Expand Down Expand Up @@ -45,6 +45,20 @@ If you notice that your API key doesn't work any more, you have to contact us.

The full changelog available on [GitHub](https://github.com/MultinetInteractive/EduAdmin-WordPress/blob/production/CHANGELOG.md)

### [4.0.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.11.1...v4.0.0) (2023-10-10)


#### ⚠ BREAKING CHANGES

* **Programme/Shortcodes:** Custom code with `do_shortcode` now needs to do
`echo do_shortcode( '[eduadmin-programme-list]' );` after the change.
Which is the intended way to use `do_shortcode` the previous versions
were not working in the correct way.

#### Bug Fixes

* **Programme/Shortcodes:** Fixed an issue with Programme pages ([461c3bf](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/461c3bfac424d8614580ac4f7df2fe5d70161499))

### [3.11.1](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.11.0...v3.11.1) (2023-10-09)


Expand All @@ -66,12 +80,5 @@ The full changelog available on [GitHub](https://github.com/MultinetInteractive/

* Programme starts now show number of spots left (according to settings) ([0117df4](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/0117df408a557998bd04d467720e51cef331612a)), closes [#498](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/498)

### [3.9.2](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.9.1...v3.9.2) (2023-09-26)


#### Refactoring

* Made a readme.txt as well, for use in the SVN trunk. ([e6b6d61](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/e6b6d61b8e3f27c2841c25812f46f6d2cde3ead3))



0 comments on commit 4ee01c7

Please sign in to comment.