Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.3.0 #523

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

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.3.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v4.2.3...v4.3.0) (2024-04-08)


### Features

* Support for EduAdmin Form Reserve/Waiting Lists when the event is fully booked. ([3680b47](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/3680b4703298c57210f5d025a70fbbf1f6565a3d)), closes [#455](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/455)


### Bug Fixes

* Only check description if it actually contains anything ([33234df](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/33234dff3445e6642281cb5aa53ef674485a7fe0))

### [4.2.3](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v4.2.2...v4.2.3) (2024-02-09)


Expand Down
2 changes: 1 addition & 1 deletion PLUGIN-CHECKSUM
Original file line number Diff line number Diff line change
@@ -1 +1 @@
aba35655ceb67555bb5c2580fbcd8cb6
4b79f235f167470df9ef7175f035f5bd
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.3",
"php": ">=8.1",
"composer/installers": "~2"
},
"version": "2.22.0"
"version": "5.0.0"
}
12 changes: 9 additions & 3 deletions content/template/data/ogp.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,19 @@
$selected_course = json_decode( EDUAPIHelper()->GetOnDemandCourseDetailInfo( $course_id, $group_by_city ), true );
}

$description = ! empty( $selected_course['CourseDescriptionShort'] ) ?
$selected_course['CourseDescriptionShort'] :
$selected_course['CourseDescription'];

if ( $description == null || strlen( $description ) == 0 ) {
return;
}

$description = wp_strip_all_tags(
str_replace(
[ "<br />", "<br>", "</p>" ],
[ "&#xA;", "&#xA;", "</p>&#xA;&#xA;" ],
! empty( $selected_course['CourseDescriptionShort'] ) ?
$selected_course['CourseDescriptionShort'] :
$selected_course['CourseDescription']
$description
)
);

Expand Down
25 changes: 19 additions & 6 deletions content/template/detailTemplate/blocks/event-item.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,28 @@ class="eventItem<?php echo( $show_more > 0 && $i >= $show_more ? ' showMoreHidde
<?php
}
} else {
if ( $allow_interest_reg_event && false !== $event_interest_page ) {
if ( $use_eduadmin_form ) {
if ( $ev['UseWaitingList'] ) {
?>
<a class="bookButton book-link cta-btn" href="javascript://"
onclick="edu_OpenEduBookingFormModal('<?php echo esc_js( $ev['BookingFormUrl'] ); ?>');"><?php echo esc_html_x( 'Reserve list', 'frontend', 'eduadmin-booking' ); ?></a>
<?php
} else {
?>
<i class="fullBooked"><?php echo esc_html_x( 'Full', 'frontend', 'eduadmin-booking' ); ?></i>
<?php
}
} else {
if ( $allow_interest_reg_event && false !== $event_interest_page ) {
?>
<a class="inquiry-link"
href="<?php echo esc_url( $base_url . '/' . make_slugs( $name ) . '__' . $selected_course['CourseTemplateId'] . '/book/interest/?eid=' . $ev['EventId'] . edu_get_query_string( '&', array( 'eid' ) ) . '&_=' . time() ); ?>"><?php echo esc_html_x( 'Inquiry', 'frontend', 'eduadmin-booking' ); ?></a>
<?php
}
?>
<a class="inquiry-link"
href="<?php echo esc_url( $base_url . '/' . make_slugs( $name ) . '__' . $selected_course['CourseTemplateId'] . '/book/interest/?eid=' . $ev['EventId'] . edu_get_query_string( '&', array( 'eid' ) ) . '&_=' . time() ); ?>"><?php echo esc_html_x( 'Inquiry', 'frontend', 'eduadmin-booking' ); ?></a>
<i class="fullBooked"><?php echo esc_html_x( 'Full', 'frontend', 'eduadmin-booking' ); ?></i>
<?php
}
?>
<i class="fullBooked"><?php echo esc_html_x( 'Full', 'frontend', 'eduadmin-booking' ); ?></i>
<?php
}
} else {
?>
Expand Down
19 changes: 16 additions & 3 deletions content/template/listTemplate/blocks/event-block-a.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,22 @@ class="objectItem <?php echo edu_get_percent_from_values( $spots_left, intval( $
<?php
}
} else {
?>
<i class="fullBooked"><?php _ex( 'Full', 'frontend', 'eduadmin-booking' ); ?></i>
<?php
if ( $use_eduadmin_form ) {
if ( $event['UseWaitingList'] ) {
?>
<a class="bookButton book-link cta-btn" href="javascript://"
onclick="edu_OpenEduBookingFormModal('<?php echo esc_js( $event['BookingFormUrl'] ); ?>');"><?php echo esc_html_x( 'Reserve list', 'frontend', 'eduadmin-booking' ); ?></a>
<?php
} else {
?>
<i class="fullBooked"><?php echo esc_html_x( 'Full', 'frontend', 'eduadmin-booking' ); ?></i>
<?php
}
} else {
?>
<i class="fullBooked"><?php _ex( 'Full', 'frontend', 'eduadmin-booking' ); ?></i>
<?php
}
}
} else {
?>
Expand Down
19 changes: 16 additions & 3 deletions content/template/listTemplate/blocks/event-block-b.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,22 @@ class="objectBlock brick <?php echo edu_get_percent_from_values( $spots_left, $e
<?php
}
} else {
?>
<i class="fullBooked"><?php _ex( 'Full', 'frontend', 'eduadmin-booking' ); ?></i>
<?php
if ( $use_eduadmin_form ) {
if ( $event['UseWaitingList'] ) {
?>
<a class="bookButton book-link cta-btn" href="javascript://"
onclick="edu_OpenEduBookingFormModal('<?php echo esc_js( $event['BookingFormUrl'] ); ?>');"><?php echo esc_html_x( 'Reserve list', 'frontend', 'eduadmin-booking' ); ?></a>
<?php
} else {
?>
<i class="fullBooked"><?php echo esc_html_x( 'Full', 'frontend', 'eduadmin-booking' ); ?></i>
<?php
}
} else {
?>
<i class="fullBooked"><?php _ex( 'Full', 'frontend', 'eduadmin-booking' ); ?></i>
<?php
}
}
} else {
?>
Expand Down
8 changes: 4 additions & 4 deletions eduadmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
* 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: 4.2.3
* Version: 4.3.0
* GitHub Plugin URI: multinetinteractive/eduadmin-wordpress
* GitHub Plugin URI: https://github.com/multinetinteractive/eduadmin-wordpress
* Requires at least: 5.8
* Tested up to: 6.4
* Requires PHP: 7.0
* Requires at least: 6.0
* Tested up to: 6.5
* Requires PHP: 8.1
* Author: Chris Gårdenberg, MultiNet Interactive AB
* Author URI: https://www.multinet.com
* License: GPL3
Expand Down
18 changes: 11 additions & 7 deletions includes/edu-text-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ function edu_get_price( $price, $vatPercent, $settings_override = '' ) {
}

function edu_get_percent_from_values( $current_value, $max_value ) {
if ( null === $current_value || null === $max_value ) {
return 'percentUnknown';
}

if ( 0 === $current_value || 0 === $max_value ) {
return 'percentUnknown';
}
Expand Down Expand Up @@ -813,7 +817,7 @@ function get_spots_left( $free_spots, $max_spots, $spot_option = 'exactNumbers',
} else {
$lines = explode( "\n", $interval );
foreach ( $lines as $line ) {
if ( stripos( $line, '-' ) > -1 ) {
if ( stripos( $line, '-' ) > - 1 ) {
$range = explode( '-', $line );
$min = intval( $range[0] );
$max = intval( $range[1] );
Expand All @@ -822,7 +826,7 @@ function get_spots_left( $free_spots, $max_spots, $spot_option = 'exactNumbers',

return sprintf( _x( '%1$s spots left', 'frontend', 'eduadmin-booking' ), $line );
}
} elseif ( stripos( $line, '+' ) > -1 ) {
} elseif ( stripos( $line, '+' ) > - 1 ) {
/* translators: 1: Number of spots (range) */

return sprintf( _x( '%1$s spots left', 'frontend', 'eduadmin-booking' ), $line );
Expand Down Expand Up @@ -965,7 +969,7 @@ function edu_get_date_range( $days, $short, $event, $show_days, $always_show_sch

$total_days = count( $days );

for ( $x = 0; $x < $total_days; $x++ ) {
for ( $x = 0; $x < $total_days; $x ++ ) {
$day = $days[ $x ];

$added_dates[ edu_get_timezoned_date( 'H:i', $day['StartDate'] ) . '-' . edu_get_timezoned_date( 'H:i', $day['EndDate'] ) ][] = $day;
Expand Down Expand Up @@ -1177,7 +1181,7 @@ function DateComparer( $a, $b ) {
return 0;
}

return ( $a_date < $b_date ? -1 : 1 );
return ( $a_date < $b_date ? - 1 : 1 );
}

function KeySort( $key ) {
Expand Down Expand Up @@ -1378,7 +1382,7 @@ function edu_event_listitem_applicationopendate( $application_open_date ) {
function my_str_split( $string ) {
$s_array = array();
$slen = strlen( $string );
for ( $i = 0; $i < $slen; $i++ ) {
for ( $i = 0; $i < $slen; $i ++ ) {
$s_array[ (string) $i ] = $string[ $i ];
}

Expand Down Expand Up @@ -1932,7 +1936,7 @@ function remove_duplicates( $s_search, $s_replace, $s_subject ) {
$s_subject = str_replace( $s_search, $s_replace, $s_subject );
$pos = strpos( $s_subject, $s_search );

$i++;
$i ++;
if ( $i > 100 ) {
die( 'removeDuplicates() loop error' );
}
Expand All @@ -1950,6 +1954,6 @@ function edu_starts_with( $haystack, $needle ) {

if ( ! function_exists( 'edu_ends_with' ) ) {
function edu_ends_with( $haystack, $needle ) {
return substr( $haystack, -strlen( $needle ) ) === $needle;
return substr( $haystack, - strlen( $needle ) ) === $needle;
}
}
16 changes: 8 additions & 8 deletions includes/eduapi-helper-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function GetCourseDetailInfo( $course_id, $fetch_months, $group_by_city )
';' .
'$orderby=StartDate asc' . ( $group_by_city ? ', City asc' : '' ) .
';' .
'$select=EventId,City,ParticipantNumberLeft,MaxParticipantNumber,StartDate,EndDate,AddressName,LocationId,ParticipantVat,BookingFormUrl,OnDemand,OnDemandPublished,OnDemandAccessDays,ApplicationOpenDate,LastApplicationDate';
'$select=EventId,City,ParticipantNumberLeft,MaxParticipantNumber,StartDate,EndDate,AddressName,LocationId,ParticipantVat,BookingFormUrl,OnDemand,OnDemandPublished,OnDemandAccessDays,ApplicationOpenDate,LastApplicationDate,UseWaitingList';

$expands['CustomFields'] = '$filter=ShowOnWeb;$select=CustomFieldId,CustomFieldName,CustomFieldType,CustomFieldValue,CustomFieldChecked,CustomFieldDate,CustomFieldAlternativeId,CustomFieldAlternativeValue;';

Expand Down Expand Up @@ -116,7 +116,7 @@ public function GetOnDemandCourseDetailInfo( $course_id, $group_by_city ) {
';' .
'$orderby=StartDate asc' . ( $group_by_city ? ', City asc' : '' ) .
';' .
'$select=EventId,City,ParticipantNumberLeft,MaxParticipantNumber,StartDate,EndDate,AddressName,LocationId,ParticipantVat,BookingFormUrl,OnDemand,OnDemandPublished,OnDemandAccessDays,ApplicationOpenDate';
'$select=EventId,City,ParticipantNumberLeft,MaxParticipantNumber,StartDate,EndDate,AddressName,LocationId,ParticipantVat,BookingFormUrl,OnDemand,OnDemandPublished,OnDemandAccessDays,ApplicationOpenDate,UseWaitingList';

$expands['CustomFields'] = '$filter=ShowOnWeb;$select=CustomFieldId,CustomFieldName,CustomFieldType,CustomFieldValue,CustomFieldChecked,CustomFieldDate,CustomFieldAlternativeId,CustomFieldAlternativeValue;';

Expand Down Expand Up @@ -188,7 +188,7 @@ public function GetCourseList( $attributes, $category_id, $city, $subjectid, $co
';' .
'$orderby=StartDate asc' .
';' .
'$select=EventId,City,ParticipantNumberLeft,MaxParticipantNumber,StartDate,EndDate,AddressName,EventName,ParticipantVat,BookingFormUrl,OnDemand,OnDemandPublished,OnDemandAccessDays,LocationId,ApplicationOpenDate,LastApplicationDate';
'$select=EventId,City,ParticipantNumberLeft,MaxParticipantNumber,StartDate,EndDate,AddressName,EventName,ParticipantVat,BookingFormUrl,OnDemand,OnDemandPublished,OnDemandAccessDays,LocationId,ApplicationOpenDate,LastApplicationDate,UseWaitingList';

$expands['CustomFields'] = '$filter=ShowOnWeb;$select=CustomFieldId,CustomFieldName,CustomFieldType,CustomFieldValue,CustomFieldChecked,CustomFieldDate,CustomFieldAlternativeId,CustomFieldAlternativeValue;';

Expand Down Expand Up @@ -303,7 +303,7 @@ public function GetOnDemandCourseList( $attributes, $category_id, $city, $subjec
';' .
'$orderby=StartDate asc' .
';' .
'$select=EventId,City,ParticipantNumberLeft,MaxParticipantNumber,StartDate,EndDate,AddressName,EventName,ParticipantVat,BookingFormUrl,OnDemand,OnDemandPublished,OnDemandAccessDays,LocationId,ApplicationOpenDate';
'$select=EventId,City,ParticipantNumberLeft,MaxParticipantNumber,StartDate,EndDate,AddressName,EventName,ParticipantVat,BookingFormUrl,OnDemand,OnDemandPublished,OnDemandAccessDays,LocationId,ApplicationOpenDate,UseWaitingList';

$expands['CustomFields'] = '$filter=ShowOnWeb;$select=CustomFieldId,CustomFieldName,CustomFieldType,CustomFieldValue,CustomFieldChecked,CustomFieldDate,CustomFieldAlternativeId,CustomFieldAlternativeValue;';

Expand Down Expand Up @@ -417,7 +417,7 @@ public function GetEventList( $attributes, $category_id, $city, $subjectid, $cou
';' .
'$orderby=StartDate asc' .
';' .
'$select=EventId,City,ParticipantNumberLeft,MaxParticipantNumber,StartDate,EndDate,AddressName,EventName,ParticipantVat,BookingFormUrl,OnDemand,OnDemandPublished,OnDemandAccessDays,LocationId,ApplicationOpenDate,LastApplicationDate';
'$select=EventId,City,ParticipantNumberLeft,MaxParticipantNumber,StartDate,EndDate,AddressName,EventName,ParticipantVat,BookingFormUrl,OnDemand,OnDemandPublished,OnDemandAccessDays,LocationId,ApplicationOpenDate,LastApplicationDate,UseWaitingList';

$expands['CustomFields'] = '$filter=ShowOnWeb;$select=CustomFieldId,CustomFieldName,CustomFieldType,CustomFieldValue,CustomFieldChecked,CustomFieldDate,CustomFieldAlternativeId,CustomFieldAlternativeValue;';

Expand Down Expand Up @@ -456,7 +456,7 @@ public function GetEventList( $attributes, $category_id, $city, $subjectid, $cou
$order = array();
$custom_order = explode( ' ', $custom_order_by_order );
foreach ( $custom_order as $coVal ) {
! isset( $coVal ) || $coVal === "asc" ? array_push( $order, 1 ) : array_push( $order, -1 );
! isset( $coVal ) || $coVal === "asc" ? array_push( $order, 1 ) : array_push( $order, - 1 );
}
}
} else {
Expand Down Expand Up @@ -531,7 +531,7 @@ public function GetOnDemandEventList( $attributes, $category_id, $city, $subject
';' .
'$orderby=StartDate asc' .
';' .
'$select=EventId,City,ParticipantNumberLeft,MaxParticipantNumber,StartDate,EndDate,AddressName,EventName,ParticipantVat,BookingFormUrl,OnDemand,OnDemandPublished,OnDemandAccessDays,LocationId,ApplicationOpenDate';
'$select=EventId,City,ParticipantNumberLeft,MaxParticipantNumber,StartDate,EndDate,AddressName,EventName,ParticipantVat,BookingFormUrl,OnDemand,OnDemandPublished,OnDemandAccessDays,LocationId,ApplicationOpenDate,UseWaitingList';

$expands['CustomFields'] = '$filter=ShowOnWeb;$select=CustomFieldId,CustomFieldName,CustomFieldType,CustomFieldValue,CustomFieldChecked,CustomFieldDate,CustomFieldAlternativeId,CustomFieldAlternativeValue;';

Expand Down Expand Up @@ -571,7 +571,7 @@ public function GetOnDemandEventList( $attributes, $category_id, $city, $subject
$order = array();
$custom_order = explode( ' ', $custom_order_by_order );
foreach ( $custom_order as $coVal ) {
! isset( $coVal ) || $coVal === "asc" ? array_push( $order, 1 ) : array_push( $order, -1 );
! isset( $coVal ) || $coVal === "asc" ? array_push( $order, 1 ) : array_push( $order, - 1 );
}
}
} else {
Expand Down
16 changes: 5 additions & 11 deletions libraries/class-recursive-arrayaccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* @package WordPress
* @since 3.6.0
*/

class Recursive_ArrayAccess implements ArrayAccess {
/**
* Internal data collection.
Expand Down Expand Up @@ -62,8 +61,7 @@ public function __clone() {
*
* @return array
*/
#[\ReturnTypeWillChange]
public function toArray() {
public function toArray() : array {
$data = $this->container;
foreach ( $data as $key => $value ) {
if ( $value instanceof self ) {
Expand All @@ -85,8 +83,7 @@ public function toArray() {
*
* @return boolean true on success or false on failure.
*/
#[\ReturnTypeWillChange]
public function offsetExists( $offset ) {
public function offsetExists( $offset ) : bool {
return isset( $this->container[ $offset ] );
}

Expand All @@ -99,8 +96,7 @@ public function offsetExists( $offset ) {
*
* @return mixed Can return all value types.
*/
#[\ReturnTypeWillChange]
public function offsetGet( $offset ) {
public function offsetGet( $offset ) : mixed {
return isset( $this->container[ $offset ] ) ? $this->container[ $offset ] : null;
}

Expand All @@ -114,8 +110,7 @@ public function offsetGet( $offset ) {
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet( $offset, $data ) {
public function offsetSet( $offset, $data ) : void {
if ( is_array( $data ) ) {
$data = new self( $data );
}
Expand All @@ -136,8 +131,7 @@ public function offsetSet( $offset, $data ) {
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset( $offset ) {
public function offsetUnset( $offset ) : void {
unset( $this->container[ $offset ] );
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eduadmin-wordpress-plugin",
"private": true,
"version": "4.2.3",
"version": "4.3.0",
"repository": "https://github.com/MultinetInteractive/EduAdmin-WordPress.git",
"author": "Chris Gårdenberg <[email protected]>",
"license": "MIT",
Expand Down Expand Up @@ -30,9 +30,9 @@
"path": "./node_modules/cz-conventional-changelog"
},
"eduadmin": {
"testedUpTo": "6.4",
"requiresAtLeast": "5.8",
"minimumPhpVersion": "7.0"
"testedUpTo": "6.5",
"requiresAtLeast": "6.0",
"minimumPhpVersion": "8.1"
}
}
}
Loading
Loading