diff --git a/README.md b/README.md index 38445a31..824b757a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ **Tags:** Event, Events, Calendar, Booking, Schedule, Organizer, Venue \ **Requires at least:** 4.0.0 \ **Tested up to:** 5.6 \ -**Stable tag:** 5.15.0 \ +**Stable tag:** 5.15.5 \ **Requires PHP:** 5.6 \ **License:** GPLv2 or later \ **License URI:** https://www.gnu.org/licenses/gpl-2.0.html @@ -235,6 +235,7 @@ You can see [plugin documentation](https://webnus.net/dox/modern-events-calendar ## Key Features +- Calendar method to show available occurrences to book (*pro*) - Shortcode to display users events - Resend booking verification and confirmation email (*pro*) - Countdown method per event @@ -586,6 +587,31 @@ You can see [plugin documentation](https://webnus.net/dox/modern-events-calendar ## Changelog +### v 5.15.5 – 30 December 2020 + +- Added: An advanced calendar method to show available occurrences to book (pro) +- Added: the feature to create segmetns in MailChimp integration (pro) +- Added: Ability to edit booking fields in “Booking Edit” page in WordPress backend (pro) +- Added: “Fallback Image“ feature to set an image for categories and display it as the event featured image if no image was set for the events +- Added: Link attribute “rel + +### noopener” for events display method to be able to set them to open in a new window + +- Improved: MailChimp integration by adding some relevant tags to the subscribers (pro) +- Improved: The booking CSV import (pro) +- Improved: The booking reminder email (pro) +- Improved: Backend speed and optimization +- Improved: MEC capabilities (pro) +- Fixed: An issue in the “Next/Previous Events” Module +- Fixed: A date display issue on carousel skins +- Fixed: Importing modified series of Google events in addition to their main event +- Fixed: Carousel and slider issue in Divi page builder environment +- Fixed: MEC Shortcodes assets in Elementor page builder environment +- Fixed: Some issues on WP Multisite +- Fixed: Label of booking button (pro) +- Fixed: Arabic character in the event link +- Fixed: Some PHP notices + ### v 5.15.0 – 16 December 2020 - Added: A shortcode to display current users' events in a preferred skin e.g. monthly, list, grid, etc. diff --git a/app/addons/beaver.php b/app/addons/beaver.php index eaa920c0..bd164f09 100644 --- a/app/addons/beaver.php +++ b/app/addons/beaver.php @@ -38,7 +38,7 @@ public function __construct() public function init() { // Beaver Builder is not installed - if( !class_exists( 'FLBuilder' ) ) return false; + if(!class_exists( 'FLBuilder' ) ) return false; define( 'MEC_BEAVER_DIR', plugin_dir_path( __FILE__ ) ); define( 'MEC_BEAVER_URL', plugins_url( '/', __FILE__ ) ); add_action( 'init', array($this,'mec_beaver_builder_shortcode') ); diff --git a/app/addons/divi/includes/MECShortcodesForDivi.php b/app/addons/divi/includes/MECShortcodesForDivi.php index 1e2dc470..c01aaa38 100644 --- a/app/addons/divi/includes/MECShortcodesForDivi.php +++ b/app/addons/divi/includes/MECShortcodesForDivi.php @@ -1,5 +1,5 @@ location = parent::getValue($props, "location"); $event->meta_data_tags = parent::getValue($props, "meta_data_tags"); $event->name = parent::getValue($props, "name"); - if( parent::getValue( $props, "notification_options" ) ) { + if(parent::getValue( $props, "notification_options" ) ) { $event->notification_options = NotificationOption::create( parent::getValue( $props, "notification_options" ) ); } $event->online_meeting = parent::getValue($props, "online_meeting"); $event->payable_to = parent::getValue($props, "payable_to"); $event->payable_to = parent::getValue($props, "payable_to"); - if( parent::getValue( $props, "payment_address" ) ) { + if(parent::getValue( $props, "payment_address" ) ) { $event->payment_address = Address::create( parent::getValue( $props, "payment_address" ) ); } $event->payment_options = parent::getValue($props, "payment_options"); @@ -349,7 +349,7 @@ public static function create(array $props) $event->time_zone_id = parent::getValue($props, "time_zone_id"); $event->title = parent::getValue($props, "title"); $event->total_registered_count = parent::getValue($props, "total_registered_count"); - if( parent::getValue( $props, "track_information" ) ) { + if(parent::getValue( $props, "track_information" ) ) { $event->track_information = TrackInformation::create( parent::getValue( $props, "track_information" ) ); } $event->twitter_hash_tag = parent::getValue($props, "twitter_hash_tag"); diff --git a/app/api/Ctct/Components/EventSpot/PaymentSummary.php b/app/api/Ctct/Components/EventSpot/PaymentSummary.php index e8889b6a..074c4851 100644 --- a/app/api/Ctct/Components/EventSpot/PaymentSummary.php +++ b/app/api/Ctct/Components/EventSpot/PaymentSummary.php @@ -55,7 +55,7 @@ public static function create(array $props) $payment_summary->payment_status = parent::getValue($props, "payment_status"); $payment_summary->payment_type = parent::getValue($props, "payment_type"); - if( isset($props["order"])) { + if(isset($props["order"])) { $payment_summary->order = RegistrantOrder::create( parent::getValue( $props, "order" ) ); } diff --git a/app/api/Ctct/Components/EventSpot/Registrant/Registrant.php b/app/api/Ctct/Components/EventSpot/Registrant/Registrant.php index 5e8fad7b..182a13db 100644 --- a/app/api/Ctct/Components/EventSpot/Registrant/Registrant.php +++ b/app/api/Ctct/Components/EventSpot/Registrant/Registrant.php @@ -172,7 +172,7 @@ public function getFieldValue( $fieldName ) { /** @var RegistrantSectionField $field */ foreach ( $section->fields as $field ) { - if( $fieldName === $field->name ) { + if($fieldName === $field->name ) { return is_null( $field->values ) ? $field->value : $field->values; } } diff --git a/app/api/Ctct/Components/EventSpot/Registrant/RegistrantOrder.php b/app/api/Ctct/Components/EventSpot/Registrant/RegistrantOrder.php index 9c42e88e..abe4c1b4 100644 --- a/app/api/Ctct/Components/EventSpot/Registrant/RegistrantOrder.php +++ b/app/api/Ctct/Components/EventSpot/Registrant/RegistrantOrder.php @@ -56,7 +56,7 @@ public static function create(array $props) $registrant_order->currency_type = parent::getValue($props, "currency_type"); $registrant_order->total = parent::getValue($props, "total"); - if( isset($props['fees']) ) { + if(isset($props['fees']) ) { foreach ( $props['fees'] as $fee ) { $registrant_order->fees[] = RegistrantFee::create($fee); } diff --git a/app/api/Ctct/Services/EventSpotService.php b/app/api/Ctct/Services/EventSpotService.php index 3f023598..9deb4dfd 100644 --- a/app/api/Ctct/Services/EventSpotService.php +++ b/app/api/Ctct/Services/EventSpotService.php @@ -46,7 +46,7 @@ public function getEvents($accessToken, Array $params = array()) $body = json_decode($response->getBody(), true); $events = array(); - if( ! empty( $body['results'] ) ) { + if(! empty( $body['results'] ) ) { foreach ( $body['results'] as $event ) { $events[] = EventSpot::create( $event ); } diff --git a/app/features/booking/calendar_novel.php b/app/features/booking/calendar_novel.php new file mode 100644 index 00000000..f7fc59be --- /dev/null +++ b/app/features/booking/calendar_novel.php @@ -0,0 +1,180 @@ +dates) ? $event->dates : array($event->date); + +// Multiple Day Event +$multiple_date = (isset($dates) && $dates[0]['start']['date'] != $dates[0]['end']['date']) ? 'mec-multiple-event' : ''; + +$first_date = (isset($start) ? $start : (isset($dates[0]) ? $dates[0]['start']['date'] : NULL)); +if(!$first_date) return; + +// Settings +$settings = $this->main->get_settings(); + +// Options +$event_color = isset($event->data->meta['mec_color']) ? '#'.$event->data->meta['mec_color'] : ''; +$date_format = (isset($settings['booking_date_format1']) and trim($settings['booking_date_format1'])) ? $settings['booking_date_format1'] : 'Y-m-d'; +$date_format = trim(str_replace(['H', 'h', 'i', 's', 'A', 'a', 'G', 'g', 'B', 'u', 'v', ':'], '', $date_format), ': '); +$time_format = get_option('time_format'); + +// before/after Month +$_1month_before = strtotime('first day of -1 month', strtotime($first_date)); +$_1month_after = strtotime('first day of +1 month', strtotime($first_date)); +$current_month_time = strtotime($first_date); + +$year = date('Y', strtotime($first_date)); +$month = date('m', strtotime($first_date)); +$active_day = date('d', strtotime($first_date)); + +// Start day of week +$week_start = $this->main->get_first_day_of_week(); + +// days and weeks vars +$running_day = date('w', mktime(0, 0, 0, $month, 1, $year)); +$days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year)); +$days_in_previous_month = date('t', strtotime('-1 month', strtotime($active_day))); + +$days_in_this_week = 1; +$day_counter = 0; + +if($week_start == 0) $running_day = $running_day; // Sunday +elseif($week_start == 1) // Monday +{ + if($running_day != 0) $running_day = $running_day - 1; + else $running_day = 6; +} +elseif($week_start == 6) // Saturday +{ + if($running_day != 6) $running_day = $running_day + 1; + else $running_day = 0; +} +elseif($week_start == 5) // Friday +{ + if($running_day < 4) $running_day = $running_day + 2; + elseif($running_day == 5) $running_day = 0; + elseif($running_day == 6) $running_day = 1; +} + +$navigator_html = ''; + +// Show previous navigation +if(strtotime(date('Y-m-t', $_1month_before)) >= time()) +{ + $navigator_html .= '