Skip to content

Commit

Permalink
v5.19.5
Browse files Browse the repository at this point in the history
v5.19.5
  • Loading branch information
webnuswp committed May 26, 2021
1 parent 7b7be76 commit 0f418fa
Show file tree
Hide file tree
Showing 96 changed files with 29,203 additions and 26,773 deletions.
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
**Donate link:** https://webnus.net \
**Tags:** Event, Events, Calendar, Booking, Schedule, Organizer, Venue \
**Requires at least:** 4.0.0 \
**Tested up to:** 5.7.1 \
**Stable tag:** 5.19.1 \
**Tested up to:** 5.7.2 \
**Stable tag:** 5.19.5 \
**Requires PHP:** 5.6 \
**License:** GPLv2 or later \
**License URI:** https://www.gnu.org/licenses/gpl-2.0.html
Expand All @@ -34,7 +34,7 @@ Using [Modern Events Calendar Lite](https://webnus.net/modern-events-calendar/),

https://www.youtube.com/watch?v

### GjRVKIwD5jY
### VIqEXcT56kE

## Best WordPress Event Management Plugin

Expand Down Expand Up @@ -336,6 +336,7 @@ You can see [plugin documentation](https://webnus.net/dox/modern-events-calendar
- Related Events Module
- Custom Booking Form for Single Events (*pro*)
- Payments for Certain Single Events (*pro*)
- Transaction IDs with using an ordered number
- Shortcode Creator
- Add Event in the form of wizard
- Add shortcode in the form of wizard
Expand Down Expand Up @@ -438,7 +439,7 @@ You can see [plugin documentation](https://webnus.net/dox/modern-events-calendar

### 1. WordPress Event Calendar - Full Calendar view

![WordPress Event Calendar - Full Calendar view](https://ps.w.org/modern-events-calendar-lite/assets/screenshot-1.png)
[missing image]

### 2. WordPress Event Calendar - Monthly view

Expand Down Expand Up @@ -603,6 +604,32 @@ You can see [plugin documentation](https://webnus.net/dox/modern-events-calendar

## Changelog

### 5.19.5 – 26 May 2021

- Added: A new ability to show all locations of an event in the event single map (pro)
- Added: A new ability to include a pin for all locations of all events in the map modules (pro)
- Added: Start and End times to the event list in the backend in addition to dates
- Added: A new feature to change the transition time of slider skin
- Added: Some options to redirect the user to the cancellation page after the cancellation of a booking
- Added: A new option to generate transaction IDs using an ordered number with prefix instead of random numbers (pro)
- Added: A new panel to show bookings of the current event in the edit event menu of the backend (pro)
- Added: A new option in “Frontend Event Submission” to include the booking panel
- Added: An option to enable bookings only for certain roles (pro)
- Added: Displaying of custom fields in the shortcodes with an option to enable or disable
- Added: Some new filters to modify the content ical file
- Added: Attendee Counter in the attendee form (pro)
- Improved: The order of terms in the search module
- Improved: The “Using WC as payment system” and fixed some issues (pro)
- Improved: The breadcrumb
- Improved: The role of controlling for main menus
- Fixed: Some issues in MEC notifications
- Fixed: Showing the Expired label when the event is ongoing
- Fixed: A special date format in the export module
- Fixed: A potential SQL injection issue
- Fixed: An autoplay issue in carousel skin
- Fixed: Google Calendar import/export when another plugin is loading the Google SDK
- Fixed: Some minor issues

### 5.19.1 – 12 May 2021

- Added: An option to disable booking multiple seats on “Sell All Occurrences by One Booking” events per email (pro)
Expand Down
236 changes: 225 additions & 11 deletions app/features/events.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/features/ix.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function init()
*/
public function include_google_api()
{
if(class_exists('Google_Client')) return;
if(class_exists('Google_Service_Calendar')) return;

MEC::import('app.api.Google.autoload', false);
}
Expand Down
77 changes: 70 additions & 7 deletions app/features/mec.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ public function init()
$this->factory->action('wp_ajax_close_cmsg_notification', array($this, 'close_cmsg_notification'));
$this->factory->action('wp_ajax_close_cmsg_2_notification', array($this, 'close_cmsg_2_notification'));

// Occurences Dropdown
$this->factory->action('wp_ajax_mec_occurrences_dropdown', array($this, 'dropdown'));

// Close Custom Text Notification
$this->factory->action('wp_ajax_report_event_dates', array($this, 'report_event_dates'));

Expand Down Expand Up @@ -229,7 +232,7 @@ public function activate_license()
public function download_settings()
{
// Current User is not Permitted
if(!current_user_can('mec_settings')) $this->main->response(array('success'=>0, 'code'=>'ADMIN_ONLY'));
if(!current_user_can('mec_settings') and !current_user_can('administrator')) $this->main->response(array('success'=>0, 'code'=>'ADMIN_ONLY'));

if(!wp_verify_nonce($_REQUEST['nonce'], 'mec_settings_download'))
{
Expand All @@ -253,7 +256,7 @@ public function download_settings()
public function close_notification()
{
// Current User is not Permitted
if(!current_user_can('mec_settings')) $this->main->response(array('success'=>0, 'code'=>'ADMIN_ONLY'));
if(!current_user_can('mec_settings') and !current_user_can('administrator')) $this->main->response(array('success'=>0, 'code'=>'ADMIN_ONLY'));
if(!wp_verify_nonce( $_REQUEST['nonce'], 'mec_settings_nonce')) exit();

update_option('mec_addons_notification_option', 'open');
Expand All @@ -264,7 +267,7 @@ public function close_notification()
public function close_cmsg_2_notification()
{
// Current User is not Permitted
if(!current_user_can('mec_settings')) $this->main->response(array('success'=>0, 'code'=>'ADMIN_ONLY'));
if(!current_user_can('mec_settings') and !current_user_can('administrator')) $this->main->response(array('success'=>0, 'code'=>'ADMIN_ONLY'));
if(!wp_verify_nonce( $_REQUEST['nonce'], 'mec_settings_nonce')) exit();

update_option('mec_custom_msg_2_close_option', 'open');
Expand All @@ -275,7 +278,7 @@ public function close_cmsg_2_notification()
public function close_cmsg_notification()
{
// Current User is not Permitted
if(!current_user_can('mec_settings')) $this->main->response(array('success'=>0, 'code'=>'ADMIN_ONLY'));
if(!current_user_can('mec_settings') and !current_user_can('administrator')) $this->main->response(array('success'=>0, 'code'=>'ADMIN_ONLY'));
if(!wp_verify_nonce( $_REQUEST['nonce'], 'mec_settings_nonce')) exit();

update_option('mec_custom_msg_close_option', 'open');
Expand Down Expand Up @@ -345,7 +348,7 @@ public function report_event_dates()
public function import_settings()
{
// Current User is not Permitted
if(!current_user_can('mec_settings')) $this->main->response(array('success'=>0, 'code'=>'ADMIN_ONLY'));
if(!current_user_can('mec_settings') and !current_user_can('administrator')) $this->main->response(array('success'=>0, 'code'=>'ADMIN_ONLY'));
if(!wp_verify_nonce($_REQUEST['nonce'], 'mec_settings_nonce')) exit();

$options = $_REQUEST['content'];
Expand Down Expand Up @@ -492,8 +495,12 @@ public function menus()
add_submenu_page('mec-intro', $this->main->m('taxonomy_speakers', __('Speakers', 'modern-events-calendar-lite')), $this->main->m('taxonomy_speakers', __('Speakers', 'modern-events-calendar-lite')), 'edit_others_posts', 'edit-tags.php?taxonomy=mec_speaker&post_type='.$this->PT);
}

add_submenu_page('mec-intro', __('Shortcodes', 'modern-events-calendar-lite'), __('Shortcodes', 'modern-events-calendar-lite'), 'mec_shortcodes', 'edit.php?post_type=mec_calendars');
add_submenu_page('mec-intro', __('MEC - Settings', 'modern-events-calendar-lite'), __('Settings', 'modern-events-calendar-lite'), 'mec_settings', 'MEC-settings', array($this, 'page'));
$capability = (current_user_can('administrator') ? 'manage_options' : 'mec_shortcodes');
add_submenu_page('mec-intro', __('Shortcodes', 'modern-events-calendar-lite'), __('Shortcodes', 'modern-events-calendar-lite'), $capability, 'edit.php?post_type=mec_calendars');

$capability = (current_user_can('administrator') ? 'manage_options' : 'mec_settings');
add_submenu_page('mec-intro', __('MEC - Settings', 'modern-events-calendar-lite'), __('Settings', 'modern-events-calendar-lite'), $capability, 'MEC-settings', array($this, 'page'));

add_submenu_page('mec-intro', __('MEC - Addons', 'modern-events-calendar-lite'), __('Addons', 'modern-events-calendar-lite'), 'manage_options', 'MEC-addons', array($this, 'addons'));
add_submenu_page('mec-intro', __('MEC - Wizard', 'modern-events-calendar-lite'), __('Wizard', 'modern-events-calendar-lite'), 'manage_options', 'MEC-wizard', array($this, 'setup_wizard'));

Expand Down Expand Up @@ -1094,6 +1101,19 @@ public function display_organizer_field($skin, $value = 0)
</div>';
}

public function display_custom_data_field($skin, $value = 0)
{
return '<div class="mec-form-row mec-display-organizer-wrap mec-switcher">
<div class="mec-col-4">
<label for="mec_skin_'.$skin.'_custom_data">'.__('Display Custom Fields', 'modern-events-calendar-lite').'</label>
</div>
<div class="mec-col-4">
<input type="hidden" name="mec[sk-options]['.$skin.'][custom_data]" value="0" />
<input type="checkbox" name="mec[sk-options]['.$skin.'][custom_data]" id="mec_skin_'.$skin.'_custom_data" value="1" '.($value == '1' ? 'checked="checked"' : '').' /><label for="mec_skin_'.$skin.'_custom_data"></label>
</div>
</div>';
}

/**
* Disable Gutenberg Editor for MEC Post Types
* @param boolean $status
Expand Down Expand Up @@ -1631,4 +1651,47 @@ public function page_title($title)

return $title;
}

public function dropdown()
{
// Check if our nonce is set.
if(!isset($_POST['_wpnonce'])) $this->main->response(array('success'=>0, 'code'=>'NONCE_MISSING'));

// Verify that the nonce is valid.
if(!wp_verify_nonce(sanitize_text_field($_POST['_wpnonce']), 'mec_occurrences_dropdown')) $this->main->response(array('success'=>0, 'code'=>'NONCE_IS_INVALID'));

$date = isset($_POST['date']) ? $_POST['date'] : '';
$id = isset($_POST['id']) ? $_POST['id'] : '';

// Date is invalid!
if(!trim($date) or !trim($id)) $this->main->response(array('success'=>0, 'code'=>'DATE_OR_ID_IS_INVALID'));

$dates = explode(':', $date);

$limit = 100;
$now = $dates[0];
$_6months_ago = strtotime('-6 Months', $now);

$occ = new MEC_feature_occurrences();
$occurrences = $occ->get_dates($id, $now, $limit);

$date_format = get_option('date_format');
$time_format = get_option('time_format');
$datetime_format = $date_format.' '.$time_format;

$success = 0;
$html = '<option class="mec-load-occurrences" value="'.$_6months_ago.':'.$_6months_ago.'">'.__('Previous Occurrences', 'modern-events-calendar-lite').'</option>';

$i = 1;
foreach($occurrences as $occurrence)
{
$success = 1;
$html .= '<option value="'.$occurrence->tstart.':'.$occurrence->tend.'" '.($i === 1 ? 'selected="selected"' : '').'>'.(date_i18n($datetime_format, $occurrence->tstart)).'</option>';
$i++;
}

if(count($occurrences) >= $limit and isset($occurrence)) $html .= '<option class="mec-load-occurrences" value="'.$occurrence->tstart.':'.$occurrence->tend.'">'.__('Next Occurrences', 'modern-events-calendar-lite').'</option>';

$this->main->response(array('success'=>$success, 'html'=>$html));
}
}
Loading

0 comments on commit 0f418fa

Please sign in to comment.