Changeset 2882562
- Timestamp:
- 03/18/2023 01:05:13 PM (3 years ago)
- Location:
- simple-wp-events/trunk
- Files:
-
- 26 edited
-
README.md (modified) (3 diffs)
-
README.txt (modified) (3 diffs)
-
admin/class-wp-events-admin.php (modified) (5 diffs)
-
admin/class-wp-events-shortcodes.php (modified) (3 diffs)
-
admin/css/wp-events-admin.css (modified) (3 diffs)
-
admin/includes/class-wp-events-admin-requests.php (modified) (1 diff)
-
admin/includes/class-wp-events-admin-settings.php (modified) (8 diffs)
-
admin/includes/wp-events-export-events.php (modified) (2 diffs)
-
admin/includes/wp-events-view-edit-entry.php (modified) (3 diffs)
-
admin/js/wp-events-admin.js (modified) (3 diffs)
-
admin/templates/wp-events-admin-settings-display.php (modified) (2 diffs)
-
assets/css/wp-events.css (modified) (5 diffs)
-
changelog.txt (modified) (1 diff)
-
includes/class-wp-events-activator.php (modified) (1 diff)
-
includes/class-wp-events-db-actions.php (modified) (1 diff)
-
includes/class-wp-events.php (modified) (1 diff)
-
includes/wp-events-global-functions.php (modified) (2 diffs)
-
public/class-wp-events-public.php (modified) (5 diffs)
-
public/css/wp-events-public.css (modified) (5 diffs)
-
public/includes/class-wp-events-form-request.php (modified) (2 diffs)
-
public/includes/wp-events-public-helpers.php (modified) (2 diffs)
-
public/includes/wp-events-registeration-form.php (modified) (7 diffs)
-
public/includes/wp-events-subscribe-form.php (modified) (2 diffs)
-
public/js/wp-events-public.js (modified) (6 diffs)
-
public/templates/single-wp_events.php (modified) (4 diffs)
-
wp-events.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-wp-events/trunk/README.md
r2807927 r2882562 4 4 Donate link: https://wpminds.com/ 5 5 Requires at least: 5.0 6 Stable tag: 1. 5.46 Stable tag: 1.6.2 7 7 Tested up to: 6.0 8 8 Requires PHP: 7.0 … … 73 73 4. Display Settings 74 74 5. Forms Settings 75 6. Mail Settings 75 76 7. Event Archive Page 76 77 8. Event Single Page … … 78 79 79 80 == Changelog == 81 Version-1.6.2 82 Update: Made phone number field on add event page as optional. 83 Added: Input mask for phone number field on add event page. 84 85 Version-1.6.1 86 Fixed: Subscribe form layout for archive shortcode. 87 Added: Attribute to change single-button text in shortcode widget. 88 89 Version-1.6.0 90 Added: Form validation errors. 91 Added: Option to send the texting permission info to email. 92 Added: Dark mode in display settings. 93 Added: User notification checkbox for edit entry. 94 Added: Filters to format date on archive page. 95 Fixed: CSS for texting permission checkbox. 96 Update: enqueue select2 file locally. 97 Added: Option to make the form fields required or optional. 98 Added: Option to bulk update existing email confirmation. 99 Update: Add registerant address to the export registrations csv. 100 Added: jQuery input mask for the phone number formatting. 101 80 102 Version-1.5.3 81 103 Update: Past events are changed to draft so that they are not indexed. -
simple-wp-events/trunk/README.txt
r2807927 r2882562 4 4 Donate link: https://wpminds.com/ 5 5 Requires at least: 5.0 6 Stable tag: 1. 5.46 Stable tag: 1.6.2 7 7 Tested up to: 6.0 8 8 Requires PHP: 7.0 … … 73 73 4. Display Settings 74 74 5. Forms Settings 75 6. Mail Settings 75 76 7. Event Archive Page 76 77 8. Event Single Page … … 78 79 79 80 == Changelog == 81 Version-1.6.2 82 Update: Made phone number field on add event page as optional. 83 Added: Input mask for phone number field on add event page. 84 85 Version-1.6.1 86 Fixed: Subscribe form layout for archive shortcode. 87 Added: Attribute to change single-button text in shortcode widget. 88 89 Version-1.6.0 90 Added: Form validation errors. 91 Added: Option to send the texting permission info to email. 92 Added: Dark mode in display settings. 93 Added: User notification checkbox for edit entry. 94 Added: Filters to format date on archive page. 95 Fixed: CSS for texting permission checkbox. 96 Update: enqueue select2 file locally. 97 Added: Option to make the form fields required or optional. 98 Added: Option to bulk update existing email confirmation. 99 Update: Add registerant address to the export registrations csv. 100 Added: jQuery input mask for the phone number formatting. 101 80 102 Version-1.5.3 81 103 Update: Past events are changed to draft so that they are not indexed. -
simple-wp-events/trunk/admin/class-wp-events-admin.php
r2780675 r2882562 86 86 wp_enqueue_style( $this->plugin_name.'-admin', plugin_dir_url( __FILE__ ) . 'css/wp-events-admin.css', array(), $this->version, 'all' ); 87 87 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __DIR__ ) . 'assets/css/wp-events.css', array(), $this->version, 'all' ); 88 89 wp_enqueue_style( $this->plugin_name.'-jquery-ui', plugin_dir_url( __FILE__ ) .'css/jquery-ui.min.css', array(), $this->version, 'all' ); 88 //check if current post type is wp_event then add this css file 89 if( 'wp_events' == wpe_get_current_post_type() ) { 90 wp_enqueue_style( $this->plugin_name.'-jquery-ui', plugin_dir_url( __FILE__ ) .'css/jquery-ui.min.css', array(), $this->version, 'all' ); 91 } 90 92 wp_enqueue_style( $this->plugin_name.'-select2', plugin_dir_url( __FILE__ ) .'css/select2.min.css', array(), $this->version, 'all' ); 91 93 } … … 115 117 wp_enqueue_media(); 116 118 } 119 wp_enqueue_script( 'jquery-inputmask', plugin_dir_url( __DIR__ ) . 'assets/js/jquery.inputmask.min.js', array( 'jquery' ), $this->version, false ); 120 117 121 wp_enqueue_script( 'date-validation', plugin_dir_url( __FILE__ ) . 'js/wp-events-date-validation.js', array( 'jquery' ), $this->version, false ); 118 122 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wp-events-admin.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker', 'date-validation' ), $this->version, false ); … … 419 423 <div class="phone event-control wpe-left" id="event-control"> 420 424 <label for="wpevent-phone"><?php _e( 'Phone*', 'simple-wp-events' ); ?></label> 421 <input id="wpevent-phone" title="(123) 111-1234" class="wp-event-field" type="tel" pattern="^(\([0-9]{3}\) |[0-9]{3}-)[0-9]{3}-[0-9]{4}$" name="wpevent-phone" value="<?php echo get_post_meta( $post->ID, 'wpevent-phone', true );?>"/> 422 <p><?php _e( 'format: (123) 123-1234', 'simple-wp-events' ); ?></p> 425 <input id="wpevent-phone" title="(123) 111-1234" class="wp-event-field" type="tel" name="wpevent-phone" value="<?php echo get_post_meta( $post->ID, 'wpevent-phone', true );?>"/> 423 426 <small><?php _e( 'Error Message', 'simple-wp-events' ); ?></small> 424 427 </div> … … 426 429 <label for="wpevent-external-url"><?php _e( 'External URL', 'simple-wp-events' ); ?></label> 427 430 <input id="wpevent-external-url" class="wp-event-field" type="url" name="wpevent-external-url" value="<?php echo get_post_meta( $post->ID, 'wpevent-external-url', true );?>"/> 428 <p><br></p>429 431 <small><?php _e( 'Error Message', 'simple-wp-events' ); ?></small> 430 432 </div> … … 1299 1301 * Changes past events status to draft. 1300 1302 * 1301 * @since 1. 5.21303 * @since 1.6.0 1302 1304 */ 1303 1305 public function wpe_past_events_draft() { -
simple-wp-events/trunk/admin/class-wp-events-shortcodes.php
r2780675 r2882562 204 204 $fax = isset( $form_options['form_fax'] ); 205 205 $hearAbout = isset( $form_options['form_hear_about'] ); 206 $mail_options = get_option( 'wpe_mail_settings' ); 207 $permission = isset( $mail_options['enable_texting_email'] ); 206 208 207 209 $post_id = self::$form_data['post'] ?? self::$form_data['post_id']; … … 216 218 $wpe_zip = sanitize_text_field( self::$form_data['wpe_zip'] ?? self::$form_data['zip'] ); 217 219 $wpe_source = sanitize_text_field( self::$form_data['hear_about_us'] ); 220 $wpe_texting = self::$form_data['wpe_texting_permission'] == 1 ? 'Yes' : 'No'; 218 221 219 222 $registration_details = "<p style='margin: 5px 0'><strong>First name</strong>: $wpe_first_name</p>"; … … 237 240 endif; 238 241 $registration_details .= "<p style='margin: 5px 0'><strong>Seats</strong>: $wpe_seats</p>"; 242 if( $permission ): 243 $registration_details .= "<p style='margin: 5px 0'><strong>Texting Permission</strong>: $wpe_texting</p>"; 244 endif; 239 245 240 246 if( isset( self::$form_data['wpe_guest_first_name'] ) && isset( self::$form_data['wpe_guest_last_name'] ) ) { -
simple-wp-events/trunk/admin/css/wp-events-admin.css
r2780675 r2882562 540 540 } 541 541 542 .wpe-header-title { 543 padding-left: 10px; 544 margin: 5px 0; 545 letter-spacing: -1px; 546 } 547 542 548 .wp_events_page_wpe_view_entry #wpcontent, 543 549 .wp_events_page_wp_forms_entries #wpcontent, … … 548 554 .wp_events_page_wp_events_settings form { 549 555 padding-left: 20px; 550 }551 552 .wp_events_page_wp_forms_entries .wrapper {553 padding: 0 20px 0 40px;554 556 } 555 557 … … 745 747 padding: 0 10px 10px 10px; 746 748 } 749 750 .wpe-display-none { 751 display: none; 752 } -
simple-wp-events/trunk/admin/includes/class-wp-events-admin-requests.php
r2780675 r2882562 241 241 wpe_send_ajax_response( $post_id ); 242 242 } 243 244 /** 245 * Ajax request for updating all seminars confirmation when message 246 * is updated in settings. 247 * 248 * @since 1.6.0 249 */ 250 public function wpe_update_confirmation() { 251 $type = wpe_sanitize( $_POST['type'] ); 252 $message = wpe_sanitize( $_POST['message'] ); 253 $args = [ 254 'post_type' => 'wp_events', 255 'posts_per_page' => -1, 256 'post_status' => 'publish', 257 'meta_query' => [ 258 [ 259 'key' => 'wpevent-type', 260 'value' => $type, 261 'compare' => 'LIKE', 262 ], 263 ], 264 ]; 265 266 $events = get_posts( $args ); 267 if( $events ) { 268 foreach ( $events as $event ) { 269 // Run a loop and update every meta data 270 update_post_meta( $event->ID, 'wpevent-confirmation-message', $message ); 271 wpe_send_ajax_response( 1 ); 272 } 273 } 274 wpe_send_ajax_response( 0 ); 275 } 243 276 } -
simple-wp-events/trunk/admin/includes/class-wp-events-admin-settings.php
r2780675 r2882562 575 575 'Enable Webinar Confirmation email', 576 576 [$this,'wpe_settings_enable_webinar_conformation_callback'], 577 'wp_events_settings&tab=mail', 578 'wpe_settings_mail_section' 579 ); 580 581 add_settings_field( 582 'wpe_settings_enable_texting_email', 583 'Send Texting Permission in email', 584 [$this,'wpe_settings_enable_texting_email_callback'], 577 585 'wp_events_settings&tab=mail', 578 586 'wpe_settings_mail_section' … … 786 794 </tr> 787 795 <tr> 796 <th scope="row"><?php _e( 'Update Message for Existing Seminars?', 'simple-wp-events' ); ?></th> 797 <td> 798 <label class="wpe-checkbox"> 799 <input name="wpe_mail_settings[update_all_seminars]" id="wpe_update_all_seminars" value="l_true" type="checkbox" <?php echo isset( $wpe_mail_settings['update_all_seminars'] ) ? 'checked' : ''; ?> /> 800 <span class="slider round"></span> 801 </label> 802 <small><?php _e( 'Check this box to update email confirmation for all existing seminars.', 'simple-wp-events' ); ?></small> 803 </td> 804 </tr> 805 <tr> 788 806 <th scope="row"><?php _e( 'Webinar Email Message', 'simple-wp-events' ); ?></th> 789 807 <td> 790 808 <?php 791 $webinar_success_Message = isset( $wpe_mail_settings['webinar_success_messages'] ) ? $wpe_mail_settings['webinar_success_message'] : '';809 $webinar_success_Message = isset( $wpe_mail_settings['webinar_success_message'] ) ? $wpe_mail_settings['webinar_success_message'] : ''; 792 810 $disable_editor = isset( $wpe_mail_settings['enable_webinar_conformation'] ) ? '' : 'disable-editor'; 793 811 echo wpe_editor( $webinar_success_Message, 'webinar_success_message-'. $disable_editor, 'wpe_mail_settings[webinar_success_message]' ); … … 797 815 <?php echo $this->shortcode_helper_tooltip(); ?> 798 816 </small> 817 </td> 818 </tr> 819 <tr> 820 <th scope="row"><?php _e( 'Update Message for Existing Webinars?', 'simple-wp-events' ); ?></th> 821 <td> 822 <label class="wpe-checkbox"> 823 <input name="wpe_mail_settings[update_all_webinars]" id="wpe_update_all_webinars" value="l_true" type="checkbox" <?php echo isset( $wpe_mail_settings['update_all_webinars'] ) ? 'checked' : ''; ?> /> 824 <span class="slider round"></span> 825 </label> 826 <small><?php _e( 'Check this box to update email confirmation for all existing webinars.', 'simple-wp-events' ); ?></small> 799 827 </td> 800 828 </tr> … … 981 1009 <th scope="row"><?php _e( 'Export Registrations', 'simple-wp-events' ); ?></th> 982 1010 <td> 983 <input type="submit" id="export-event-entries" class="button button-primary" value="Export Entries">984 <small class="wpe-fields-description"><?php _e( 'Export Registrations to CSV (Leave the filters empty if you want to export all entries .)', 'simple-wp-events' ); ?></small>1011 <input type="submit" id="export-event-entries" class="button button-primary" value="Export Registrations"> 1012 <small class="wpe-fields-description"><?php _e( 'Export Registrations to CSV (Leave the filters empty if you want to export all entries).', 'simple-wp-events' ); ?></small> 985 1013 </td> 986 1014 </tr> … … 1357 1385 ?> 1358 1386 <div id="subscriber-form-settings"> 1387 <div class="wpe-subscriber-form"> 1388 <h2><?php _e( 'Required/Optional Subscriber Form Fields', 'simple-wp-events' ); ?></h2> 1389 <p><?php _e( 'Check To make the fields required on the form', 'simple-wp-events' ); ?></p> 1390 <table class="wpe-settings-table"> 1391 <tr> 1392 <td> 1393 <span class="label"><?php _e( 'Phone', 'simple-wp-events' ); ?></span> 1394 </td> 1395 <td> 1396 <label class="wpe-checkbox"> 1397 <input name="wpe_forms_settings[req_subform_phone]" id="wpe_req_subform_phone" value="l_true" type="checkbox" <?php echo isset( $this->wpe_form_settings['req_subform_phone'] ) ? 'checked' : ''; ?> /> 1398 <span class="slider round"></span> 1399 </label> 1400 </td> 1401 <td> 1402 <span class="label"><?php _e( 'Email', 'simple-wp-events' ); ?></span> 1403 </td> 1404 <td> 1405 <label class="wpe-checkbox"> 1406 <input name="wpe_forms_settings[req_subform_email]" id="wpe_req_subform_email" value="l_true" type="checkbox" <?php echo isset( $this->wpe_form_settings['req_subform_email'] ) ? 'checked' : ''; ?> /> 1407 <span class="slider round"></span> 1408 </label> 1409 </td> 1410 </tr> 1411 </table> 1412 </div> 1359 1413 <h2><?php _e( 'Subscriber Form Settings', 'simple-wp-events' ); ?></h2> 1360 1414 <p><?php _e( 'All the Subscriber form settings are available here.', 'simple-wp-events' ); ?></p> … … 1451 1505 <label class="wpe-checkbox"> 1452 1506 <input name="wpe_forms_settings[form_hear_about]" id="wpe_form_hear_about" value="l_true" type="checkbox" <?php echo isset( $this->wpe_form_settings['form_hear_about'] ) ? 'checked' : ''; ?> /> 1507 <span class="slider round"></span> 1508 </label> 1509 </td> 1510 </tr> 1511 </table> 1512 <h2><?php _e( 'Required/Optional Registration Form Fields', 'simple-wp-events' ); ?></h2> 1513 <p><?php _e( 'Check To make the fields required on the form', 'simple-wp-events' ); ?></p> 1514 <table class="wpe-settings-table"> 1515 <tr> 1516 <td> 1517 <span class="label"><?php _e( 'Address 1', 'simple-wp-events' ); ?></span> 1518 </td> 1519 <td> 1520 <label class="wpe-checkbox"> 1521 <input name="wpe_forms_settings[req_form_address1]" id="wpe_req_form_address1" value="l_true" type="checkbox" <?php echo isset( $this->wpe_form_settings['req_form_address1'] ) ? 'checked' : ''; ?> /> 1522 <span class="slider round"></span> 1523 </label> 1524 </td> 1525 <td> 1526 <span class="label"><?php _e( 'Address 2', 'simple-wp-events' ); ?></span> 1527 </td> 1528 <td> 1529 <label class="wpe-checkbox"> 1530 <input name="wpe_forms_settings[req_form_address2]" id="wpe_req_form_address2" value="l_true" type="checkbox" <?php echo isset( $this->wpe_form_settings['req_form_address2'] ) ? 'checked' : ''; ?> /> 1531 <span class="slider round"></span> 1532 </label> 1533 </td> 1534 </tr> 1535 <tr> 1536 <td> 1537 <span class="label"><?php _e( 'City', 'simple-wp-events' ); ?></span> 1538 </td> 1539 <td> 1540 <label class="wpe-checkbox"> 1541 <input name="wpe_forms_settings[req_form_city]" id="wpe_req_form_city" value="l_true" type="checkbox" <?php echo isset( $this->wpe_form_settings['req_form_city'] ) ? 'checked' : ''; ?> /> 1542 <span class="slider round"></span> 1543 </label> 1544 </td> 1545 <td> 1546 <span class="label"><?php _e( 'State', 'simple-wp-events' ); ?></span> 1547 </td> 1548 <td> 1549 <label class="wpe-checkbox"> 1550 <input name="wpe_forms_settings[req_form_state]" id="wpe_req_form_state" value="l_true" type="checkbox" <?php echo isset( $this->wpe_form_settings['req_form_state'] ) ? 'checked' : ''; ?> /> 1551 <span class="slider round"></span> 1552 </label> 1553 </td> 1554 </tr> 1555 <tr> 1556 <td> 1557 <span class="label"><?php _e( 'Phone', 'simple-wp-events' ); ?></span> 1558 </td> 1559 <td> 1560 <label class="wpe-checkbox"> 1561 <input name="wpe_forms_settings[req_form_phone]" id="wpe_req_form_phone" value="l_true" type="checkbox" <?php echo isset( $this->wpe_form_settings['req_form_phone'] ) ? 'checked' : ''; ?> /> 1562 <span class="slider round"></span> 1563 </label> 1564 </td> 1565 <td> 1566 <span class="label"><?php _e( 'Email', 'simple-wp-events' ); ?></span> 1567 </td> 1568 <td> 1569 <label class="wpe-checkbox"> 1570 <input name="wpe_forms_settings[req_form_email]" id="wpe_req_form_email" value="l_true" type="checkbox" <?php echo isset( $this->wpe_form_settings['req_form_email'] ) ? 'checked' : ''; ?> /> 1571 <span class="slider round"></span> 1572 </label> 1573 </td> 1574 </tr> 1575 <tr> 1576 <td> 1577 <span class="label"><?php _e( 'Zip', 'simple-wp-events' ); ?></span> 1578 </td> 1579 <td> 1580 <label class="wpe-checkbox"> 1581 <input name="wpe_forms_settings[req_form_zip]" id="wpe_req_form_zip" value="l_true" type="checkbox" <?php echo isset( $this->wpe_form_settings['req_form_zip'] ) ? 'checked' : ''; ?> /> 1582 <span class="slider round"></span> 1583 </label> 1584 </td> 1585 <td> 1586 <span class="label"><?php _e( 'Fax', 'simple-wp-events' ); ?></span> 1587 </td> 1588 <td> 1589 <label class="wpe-checkbox"> 1590 <input name="wpe_forms_settings[req_form_fax]" id="wpe_req_form_fax" value="l_true" type="checkbox" <?php echo isset( $this->wpe_form_settings['req_form_fax'] ) ? 'checked' : ''; ?> /> 1591 <span class="slider round"></span> 1592 </label> 1593 </td> 1594 </tr> 1595 <tr> 1596 <td> 1597 <span class="label"><?php _e( 'Business Name', 'simple-wp-events' ); ?></span> 1598 </td> 1599 <td> 1600 <label class="wpe-checkbox"> 1601 <input name="wpe_forms_settings[req_form_businessName]" id="wpe_req_form_businessName" value="l_true" type="checkbox" <?php echo isset( $this->wpe_form_settings['req_form_businessName'] ) ? 'checked' : ''; ?> /> 1453 1602 <span class="slider round"></span> 1454 1603 </label> … … 1689 1838 <?php 1690 1839 } 1840 1691 1841 /** 1692 1842 * Disable Webinar confirmation … … 1701 1851 </label> 1702 1852 <small><?php _e( 'Check this box to enable the webinar confirmation email for registrants.', 'simple-wp-events' ); ?></small> 1853 <?php 1854 } 1855 1856 /** 1857 * Send Texting Permission in email 1858 */ 1859 public function wpe_settings_enable_texting_email_callback() { 1860 $option = get_option('wpe_mail_settings'); 1861 ?> 1862 <label class="wpe-checkbox"> 1863 <input name="wpe_mail_settings[enable_texting_email]" id="wpe_enable_texting_email" value="l_true" 1864 type="checkbox" <?php echo isset( $option['enable_texting_email'] ) ? 'checked' : ''; ?> /> 1865 <span class="slider round"></span> 1866 </label> 1867 <small><?php _e( 'Check this box to send texting permission status in email (for registration form).', 'simple-wp-events' ); ?></small> 1703 1868 <?php 1704 1869 } -
simple-wp-events/trunk/admin/includes/wp-events-export-events.php
r2780675 r2882562 298 298 $entry_status = 'Active'; 299 299 } 300 301 $address1 = $result->addres_one; 302 $address2 = $result->addres_two != '' ? ', ' . $result->addres_two . ', ' : ', '; 303 $city = $result->city; 304 $state = $result->state; 305 $zip = $result->zip; 306 $complete_address = $address1 . $address2 . $city . ', ' . $state; 300 307 301 308 $data[] = array( … … 304 311 'First Name' => esc_attr( $result->first_name ), 305 312 'Last Name' => esc_attr( $result->last_name ), 313 'Address' => esc_attr( $complete_address ), 306 314 'Email' => esc_attr( $result->email ), 307 315 'Phone' => esc_attr( $result->phone ), -
simple-wp-events/trunk/admin/includes/wp-events-view-edit-entry.php
r2780675 r2882562 39 39 'value' => $results[0]->first_name, 40 40 'required' => true, 41 'class' => ['wpe-no-special'],42 41 ), 43 42 'wpe_last_name' => array( … … 45 44 'value' => $results[0]->last_name, 46 45 'required' => true, 47 'class' => ['wpe-no-special'],48 46 ), 49 47 'wpe_address' => array( 50 48 'label' => 'Address', 51 49 'value' => $results[0]->addres_one, 52 'class' => ['wpe-no-special'],53 50 ), 54 51 'wpe_address_2' => array( 55 52 'label' => 'Address2', 56 53 'value' => $results[0]->addres_two, 57 'class' => ['wpe-no-special'],58 54 ), 59 55 'wpe_city' => array( 60 56 'label' => 'City', 61 57 'value' => $results[0]->city, 62 'class' => ['wpe-no-special'],63 58 ), 64 59 'wpe_state' => array( 65 60 'label' => 'State', 66 61 'value' => $results[0]->state, 67 'class' => ['wpe-no-special'],68 62 ), 69 63 'wpe_zip' => array( … … 106 100 'value' => $results[0]->guests, 107 101 'guest-class' => $guest_class, 108 'class' => ['wpe-no-special'],109 102 ), 110 103 'wpe_texting' => array( -
simple-wp-events/trunk/admin/js/wp-events-admin.js
r2780675 r2882562 6 6 jQuery(document).ready( function($) { 7 7 8 $('.wpe-form-control .wpe-no-special').on( 'input', function() { 9 var c = this.selectionStart, 10 r = /[^a-z0-9 ]/gi, 11 v = $(this).val(); 12 if( r.test( v ) ) { 13 $( this ).val( v.replace( r, '' ) ); 14 c--; 15 } 16 this.setSelectionRange(c, c); 17 }); 8 $("#wpevent-phone").inputmask({"mask": "(999) 999-9999"}); 18 9 19 10 const startDate = document.getElementById('wpevent-start-date'); … … 203 194 }); 204 195 } 205 206 207 /** 196 197 /** 208 198 * if the pattern not matches with (123) 123-1224 the publish and update button will be disabled 209 199 * */ 210 if ( $( 'body' ).hasClass( 'post-type-wp_events' ) ) { 211 212 function checkPhoneNumber( input ) { 213 let regex = /\(\d\d\d+\)\s\d\d\d-\d\d\d\d+/i; 214 return regex.test( input ); 215 } 216 $( document ).ready( function() { 217 if ( ! checkPhoneNumber( $( '#wpevent-phone' ).val() ) ) { 218 $( '.editor-post-publish-button__button' ).prop( "disabled", true ); 219 } 220 }); 221 222 /** 223 * if the date fields are empty disable the publish button 224 * */ 225 $( '#wpevent-start-date' ).on( "change paste keyup", function() { 226 if ( $( '#wpevent-start-date' ) == '' ) { 227 $( '.editor-post-publish-button__button' ).prop("disabled", true ); 228 } 229 else if ( checkPhoneNumber( $( '#wpevent-phone' ).val() ) && $( '#wpevent-start-date' ) != '' && $( '#wpevent-end-date' ) != '' ) { 230 $( '.editor-post-publish-button__button' ).prop( "disabled", false ); 231 } 232 }); 233 $( '#wpevent-end-date' ).on( "change paste keyup", function() { 234 if ( $( '#wpevent-end-date' ) == '' ) { 235 $( '.editor-post-publish-button__button' ).prop( "disabled", true ); 236 } 237 else if ( checkPhoneNumber($( '#wpevent-phone' ).val()) && $( '#wpevent-start-date' ) != '' && $( '#wpevent-end-date' ) != '' ) { 238 $( '.editor-post-publish-button__button' ).prop( "disabled", false ); 239 } 240 }); 241 $( '#wpevent-phone' ).on( "change paste keyup", function( input ) { 242 var startDate = $( '#wpevent-start-date' ).val(); 243 var endDate = $( '#wpevent-end-date' ).val(); 244 if ( ! checkPhoneNumber( $( '#wpevent-phone' ).val() ) ) { 245 $( '.editor-post-publish-button__button' ).prop( "disabled", true ); 246 }else if ( checkPhoneNumber ($( '#wpevent-phone' ).val() ) && startDate != '' && endDate != '' ) { 247 $( '.editor-post-publish-button__button' ).prop( "disabled", false ); 248 } 249 }); 250 } 251 252 //on event single page 253 if ( $('body').hasClass('post-type-wp_events') ) { 200 if ( $( 'body' ).hasClass( 'post-type-wp_events' ) ) { 201 202 $( document ).ready( function() { 203 if ( $( '#wpevent-start-date' ).val() == '' || $( '#wpevent-end-date' ).val() == '' ) { 204 $( '.editor-post-publish-button__button' ).prop( "disabled", true ); 205 } 206 }); 207 208 /** 209 * if the date fields are empty disable the publish button 210 * */ 211 $( '#wpevent-start-date' ).on( "change paste keyup", function() { 212 if ( $( '#wpevent-start-date' ).val() == '' ) { 213 $( '.editor-post-publish-button__button' ).prop("disabled", true ); 214 } 215 else if ( $( '#wpevent-start-date' ).val() != '' && $( '#wpevent-end-date' ).val() != '' ) { 216 $( '.editor-post-publish-button__button' ).prop( "disabled", false ); 217 } 218 }); 219 $( '#wpevent-end-date' ).on( "change paste keyup", function() { 220 if ( $( '#wpevent-end-date' ).val() == '' ) { 221 $( '.editor-post-publish-button__button' ).prop( "disabled", true ); 222 } 223 else if ( $( '#wpevent-start-date' ).val() != '' && $( '#wpevent-end-date' ).val() != '' ) { 224 $( '.editor-post-publish-button__button' ).prop( "disabled", false ); 225 } 226 }); 227 254 228 // on publish button click 255 $(document).on( 'click', '.editor-post-publish-button', function(e){ 256 229 $(document).on( 'click', '.editor-post-publish-button', function( e ){ 257 230 metaboxValidation( [startDate, endDate, seats, phone], e ); 258 231 … … 696 669 } 697 670 671 if( window.location.href.includes('tab=mail') ) { 672 var updateMessage = $('#wpe_update_all_seminars').prop("checked"); 673 var message = ''; 674 $('#wpe_update_all_seminars').change( function(e) { 675 // checked will equal true if checked or false otherwise 676 const checked = $(this).is(':checked'); 677 updateMessage = checked; 678 }); 679 $("#mail_success_message").on('change keyup paste', function( event ) { 680 message = event.target.value; 681 }); 682 $('#wpe-save-settings').click( function( e ) { 683 if( updateMessage == true && message != '' ) { 684 e.preventDefault(); 685 $.ajax( { 686 type: 'POST', 687 url: wpe_ajaxobject.ajaxurl, 688 dataType: "text", 689 data: { action : 'wpe_update_confirmation', 690 message : message, 691 type : 'seminar' }, 692 success: function( response ) { 693 if( response == 1 ) { 694 console.log( 'All seminars updated.' ); 695 } else { 696 console.log( 'No posts to update.' ); 697 } 698 }, 699 complete: function( response ) { 700 $( "#wpe-settings-form" )[0].submit(); 701 } 702 }); 703 } 704 }); 705 var updateWebinar = $('#wpe_update_all_webinars').prop("checked"); 706 var webMessage = ''; 707 $('#wpe_update_all_webinars').change( function(e) { 708 // checked will equal true if checked or false otherwise 709 const checkedWeb = $(this).is(':checked'); 710 updateWebinar = checkedWeb; 711 }); 712 $("#webinar_success_message").on('change keyup paste', function( event ) { 713 webMessage = event.target.value; 714 }); 715 $('#wpe-save-settings').click( function( e ) { 716 if( updateWebinar == true && webMessage != '' ) { 717 e.preventDefault(); 718 $.ajax( { 719 type: 'POST', 720 url: wpe_ajaxobject.ajaxurl, 721 dataType: "text", 722 data: { action : 'wpe_update_confirmation', 723 message : webMessage, 724 type : 'webinar' }, 725 success: function( response ) { 726 if( response == 1 ) { 727 console.log( 'All webinars updated.' ); 728 } else { 729 console.log( 'No posts to update.' ); 730 } 731 }, 732 complete: function( response ) { 733 $( "#wpe-settings-form" )[0].submit(); 734 } 735 }); 736 } 737 }); 738 } 739 698 740 //function calls 699 741 wpe_datepicker(); -
simple-wp-events/trunk/admin/templates/wp-events-admin-settings-display.php
r2780675 r2882562 25 25 </div> 26 26 </div> 27 <form method="post" action="options.php" >27 <form method="post" action="options.php" id="wpe-settings-form"> 28 28 <h2 class="nav-tab-wrapper"> 29 29 <?php … … 36 36 ?> 37 37 </div> 38 <?php submit_button();?> 38 <?php 39 $other_attributes = array( 'id' => 'wpe-save-settings' ); 40 submit_button( __( 'Save Settings', 'simple-wp-events' ), 'primary', 'wpe-save-settings', true, $other_attributes ); ?> 39 41 </form> -
simple-wp-events/trunk/assets/css/wp-events.css
r2780675 r2882562 42 42 } */ 43 43 44 .wpe-form-control small { 44 .wpe-form-control small, .wpe-above-error-field, .wpe-form-control .wpe-email-error-class, 45 .wpe-form-control .wpe-phone-error-class { 45 46 color: var(--error-color); 46 47 /*position: absolute;*/ … … 48 49 /*left: 0;*/ 49 50 visibility: hidden; 51 display: none; 52 width: 100%; 53 padding: 2px; 54 background: #f9eeee; 55 color: #9b0b0b; 56 font-weight: bold 57 58 } 59 60 .wpe-email-error-class, .wpe-phone-error-class { 61 font-size: smaller; 62 } 63 64 .wpe-above-error-field { 65 text-align: center; 66 border: 1px solid #9b0b0b; 67 width: 100%; 68 border-radius: 5px; 69 background: none; 70 margin-bottom: 20px; 71 } 72 73 .wpe-error-exclamation { 74 color: white; 75 border-radius: 50%; 76 background:#9b0b0b ; 77 padding: 1px 8px; 50 78 } 51 79 … … 58 86 } 59 87 60 .wpe-form-control.error small { 88 .wpe-form-control.error small, .wpe-above-error-field.error, 89 .wpe-form-control.correct-email .wpe-email-error-class, 90 .wpe-form-control.correct-phone .wpe-phone-error-class { 61 91 visibility: visible; 92 display: block; 62 93 } 63 94 … … 73 104 } 74 105 75 .wpe-subscribe-form-container input ,106 .wpe-subscribe-form-container input:not([type='checkbox']), 76 107 .wpe-subscribe-form-container select { 77 108 border: 1px solid #ddd; … … 79 110 padding: 0 15px; 80 111 box-sizing: border-box; 112 } 113 114 .wpe-subscribe-form-container input[type="checkbox"], 115 .wpe-subscribe-form-container input[type="radio"] { 116 min-width: 16px; 117 min-height: 16px; 118 top: 0; 119 max-height: 16px; 81 120 } 82 121 -
simple-wp-events/trunk/changelog.txt
r2780675 r2882562 1 Version-1.6.2 2 Update: Made phone number field on add event page as optional. 3 Added: Input mask for phone number field on add event page. 4 5 Version-1.6.1 6 Fixed: Subscribe form layout for archive shortcode. 7 Added: Attribute to change single-button text in shortcode widget. 8 9 Version-1.6.0 10 Added: Form validation errors. 11 Added: Option to send the texting permission info to email. 12 Added: Dark mode in display settings. 13 Added: User notification checkbox for edit entry. 14 Added: Filters to format date on archive page. 15 Fixed: CSS for texting permission checkbox. 16 Update: enqueue select2 file locally. 17 Added: Option to make the form fields required or optional. 18 Added: Option to bulk update existing email confirmation. 19 Update: Add registerant address to the export registrations csv. 20 Added: jQuery input mask for the phone number formatting. 21 1 22 Version-1.5.3 2 23 Update: Past events are changed to draft so that they are not indexed. -
simple-wp-events/trunk/includes/class-wp-events-activator.php
r2780675 r2882562 89 89 'hearaboutus_options' => 'An Email I Received, Blog / Facebook, Internet / Search Engine, Landing Pages, Radio and TV, Link from another website, Mailing / Postcard, Newsletter, Newspaper, Other, Referral', 90 90 'subscriber_form_texting_permission' => 'I agree to receive texts at the number provided from [wpe_firm_name]. Frequency may vary and include information on appointments, events, and other marketing messages. Message/data rates may apply. To opt-out, text STOP at any time.', 91 'reg_enable_texting_permission' => 'yes', 92 'req_form_address1' => 'l_true', 93 'req_form_city' => 'l_true', 94 'req_form_state' => 'l_true', 95 'req_form_zip' => 'l_true', 96 'req_form_phone' => 'l_true', 97 'req_form_email' => 'l_true', 98 'req_subform_email' => 'l_true', 91 99 ]; 92 100 -
simple-wp-events/trunk/includes/class-wp-events-db-actions.php
r2780675 r2882562 58 58 $charset_collate = $wpdb->get_charset_collate(); 59 59 $table_name = $wpdb->prefix . 'events_registration'; 60 $post_table_name = $wpdb->prefix .'posts (ID)';61 60 $sql = "CREATE TABLE IF NOT EXISTS " . $table_name. " ( 62 61 ID BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL, -
simple-wp-events/trunk/includes/class-wp-events.php
r2780675 r2882562 220 220 $this->loader->add_action( 'wp_ajax_wpe_update_location', $adminRequests, 'wpe_update_location' ); 221 221 $this->loader->add_action( 'wp_ajax_wpe_create_location', $adminRequests, 'wpe_create_location' ); 222 222 $this->loader->add_action( 'wp_ajax_wpe_update_confirmation', $adminRequests, 'wpe_update_confirmation' ); 223 223 } 224 224 -
simple-wp-events/trunk/includes/wp-events-global-functions.php
r2780675 r2882562 567 567 */ 568 568 function wpe_get_past_events() { 569 $past_events = array(); 569 570 $args = [ 570 571 'post_type' => 'wp_events', … … 720 721 } 721 722 } 723 724 if( ! function_exists( 'wpe_get_user_timezone' ) ) { 725 /** 726 * Returns name of user's local timezone 727 * 728 * @since 1.6.0 729 * @return string 730 */ 731 function wpe_get_user_timezone() { 732 $timezone_offset_minutes = isset( $_COOKIE['wpeTimezone'] ) ? $_COOKIE['wpeTimezone'] : '0'; 733 $timezone_name = timezone_name_from_abbr( "", (int) $timezone_offset_minutes * 60, false ); 734 return $timezone_name; 735 } 736 } 737 738 if( ! function_exists( 'wpe_get_current_post_type' ) ) { 739 /** 740 * Gets the current post type for admin area 741 * 742 * @since 1.8.0 743 * @return string|null 744 */ 745 function wpe_get_current_post_type() { 746 747 global $post, $typenow, $current_screen; 748 749 if ( $post && $post->post_type ) return $post->post_type; 750 751 else if( $typenow ) return $typenow; 752 753 else if ( $current_screen && $current_screen->post_type ) return $current_screen->post_type; 754 755 else if( isset($_REQUEST['post_type'] ) ) return sanitize_key( $_REQUEST['post_type'] ); 756 757 return null; 758 } 759 } -
simple-wp-events/trunk/public/class-wp-events-public.php
r2780675 r2882562 101 101 */ 102 102 103 wp_enqueue_script( 'jquery-inputmask', plugin_dir_url( __DIR__ ) . 'assets/js/jquery.inputmask.min.js', array( 'jquery' ), $this->version, false ); 103 104 wp_enqueue_script( 'jquery-serialize', plugin_dir_url( __DIR__ ) . 'assets/js/jquery.serializejson.js', array( 'jquery' ), $this->version, false ); 104 105 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wp-events-public.js', array( 'jquery', 'jquery-serialize' ), $this->version, false ); … … 118 119 'posts' => json_encode( $wpe_query->query_vars ), // everything about your loop is here 119 120 'current_page' => get_query_var( 'paged' ) ? get_query_var('paged') : 1, 120 'max_page' => $wpe_query->max_num_pages 121 'max_page' => $wpe_query->max_num_pages, 122 'wpePluginBase' => WPE_PLUGIN_BASE, 121 123 ) 122 124 ); … … 313 315 $wpevent_atts = shortcode_atts( 314 316 [ 315 'title' => $title, 316 'number' => 3, 317 'location' => 'true', 318 'archive' => 'true', 319 'date' => 'true', 320 'class' => '', 321 'category' => '', 322 'button_text' => __( 'See all ', 'simple-wp-events' ) . $title, 323 'type' => '', 324 'single-button' => 'false', 317 'title' => $title, 318 'number' => 3, 319 'location' => 'true', 320 'archive' => 'true', 321 'date' => 'true', 322 'class' => '', 323 'category' => '', 324 'button_text' => __( 'See all ' . $title, 'simple-wp-events' ), 325 'type' => '', 326 'single-button' => 'false', 327 'single-button-text' => 'Register', 325 328 ], $atts 326 329 ); … … 393 396 $html .= '<div class="wpe-single-registration"> 394 397 <a class="button wpe-reg-button wpe-single-reg" href="' . $event_permalink . '" 395 t itle="Click to Register">Register</a>398 target="_blank" title="Click to Register">'. esc_html( $wpevent_atts['single-button-text'] ) .'</a> 396 399 </div>'; 397 400 } … … 404 407 } 405 408 do_action( 'wp_events_subscribe_form' ); 406 $html = ob_get_clean(); 407 $html = '<div class="wpevents-shortcode-section wpevents-section">' . $html . '</div>'; 409 $html = ob_get_clean(); 410 if ( $wpevent_atts['class'] !== '' ) { 411 $html = '<div class="wpevents-shortcode-section '. esc_html( $wpevent_atts['class'] ) .' wpevents-section">' . wp_kses( $html, wpe_get_allowed_html() ) . '</div>'; 412 } else { 413 $html = '<div class="wpevents-shortcode-section wpevents-section">' . wp_kses( $html, wpe_get_allowed_html() ) . '</div>'; 414 } 408 415 } else { 409 416 if ( $wpevent_atts['archive'] === 'true' ) { -
simple-wp-events/trunk/public/css/wp-events-public.css
r2780675 r2882562 75 75 #wpe-button { 76 76 font-size: 18px; 77 display: inherit; 78 margin: 0 auto; 77 79 } 78 80 … … 415 417 .wpevents-section { 416 418 text-align: center; 417 padding: 20px 0;418 419 } 419 420 … … 586 587 -webkit-appearance: none; 587 588 margin: 0; 588 }589 590 /* Firefox */591 input.wpe-field[type=number] {592 -moz-appearance: textfield;593 589 } 594 590 … … 659 655 } 660 656 657 .wpe-display-block .wpe-subscribe-form .wpe-col-2 { 658 display: block; 659 } 660 661 661 .wpe-register-form-container .wpe-col-2 div , .wpe-subscribe-form .wpe-col-2 div{ 662 662 flex: 50%; … … 809 809 background-color: #121016; 810 810 border: 1px solid #fff; 811 } 812 813 .wpe-dark-mode span.dashicons { 814 color: #fff; 815 } 816 817 .wpe-dark-mode .wpe-grid .wpe-row { 818 border: 1px solid #fff; 819 } 820 821 .wpe-dark-mode .fc-icon { 822 color: #000; 823 } 824 825 .wpe-dark-mode .fc-button:hover .fc-icon { 826 color: #fff; 827 } 828 829 .wpe-dark-mode .fc-unthemed td.fc-today { 830 background: #333; 831 } 832 833 .wpe-dark-mode button:not(:hover):not(:active):not(.has-text-color) { 834 color: #000; 811 835 } 812 836 -
simple-wp-events/trunk/public/includes/class-wp-events-form-request.php
r2780675 r2882562 314 314 $mail_options = get_option('wpe_mail_settings'); 315 315 $firm_info = get_option('wpe_firm_settings'); 316 wpe_request_log( $firm_info );317 316 $event_option = get_option('wpe_events_settings'); 318 317 $from_name = $firm_info['mail_from_name']; … … 360 359 if( $notified_user !=='' && $notified_user !== $firm_info['admin_mail'] ) { // if not empty and not identical to the one in mail options send to notified user 361 360 wp_mail( $notified_user, $admin_subject, $admin_message, $headers ); 362 // wpe_request_log( $notified_user );363 361 } else { 364 362 wp_mail( $firm_info['admin_mail'], $admin_subject, $admin_message, $headers ); 365 wpe_request_log( $firm_info['admin_mail'] );366 363 } 367 364 } -
simple-wp-events/trunk/public/includes/wp-events-public-helpers.php
r2780675 r2882562 280 280 $event_date_time = wpevent_start_date_time( $post_id ); 281 281 $start_date = isset( $event_date_time['start_date'] ) ? strtotime( $event_date_time['start_date'] ) : 0; 282 $day_format = apply_filters( 'wpevents_archive_day_format', 'D' ); 283 $date_format = apply_filters( 'wpevents_archive_date_format', 'j' ); 282 284 ?> 283 285 <div class="wpe-day-date"> … … 285 287 <span class="wpe-col-day"> 286 288 <?php 287 echo date( "D", $start_date ); //event start day ?>289 echo date( $day_format, $start_date ); //event start day ?> 288 290 </span> 289 291 <span class="wpe-col-date"> 290 292 <?php 291 echo date( 'j', $start_date ); //event start date ?>293 echo date( $date_format, $start_date ); //event start date ?> 292 294 </span> 293 295 </div> -
simple-wp-events/trunk/public/includes/wp-events-registeration-form.php
r2780675 r2882562 38 38 $businessName = isset( $form_options['form_businessName'] ); 39 39 $hearAbout = isset( $form_options['form_hear_about'] ); 40 $req_addrees1 = isset( $form_options['req_form_address1'] ); 41 $req_addrees2 = isset( $form_options['req_form_address2'] ); 42 $req_city = isset( $form_options['req_form_city'] ); 43 $req_state = isset( $form_options['req_form_state'] ); 44 $req_zip = isset( $form_options['req_form_zip'] ); 45 $req_fax = isset( $form_options['req_form_fax'] ); 46 $req_phone = isset( $form_options['req_form_phone'] ); 47 $req_email = isset( $form_options['req_form_email'] ); 48 $req_businessName = isset( $form_options['req_form_businessName'] ); 40 49 $form_textin_permission = isset( $form_options['reg_form_texting_permission'] ) ? $form_options['reg_form_texting_permission'] : 'I agree to receive texts at the number provided from [wpe_firm_name]. Frequency may vary and include information on appointments, events, and other marketing messages. Message/data rates may apply. To opt-out, text STOP at any time.'; 41 50 $hide_texting_permission = isset( $form_options['reg_enable_texting_permission'] ); … … 43 52 <div class="wpe-main-form-holder"> 44 53 <div class="wpe-register-form-container"> 45 <form method="post" action="<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>" class="wpe-register-form" id="wpe-register-form" autocomplete="off"> 46 <div class="wpe-col-2 wpe-field"> 47 <div class="wpe-form-control wpe-field-container wpe-left-half"> 54 <form method="post" action="<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>" class="wpe-register-form" id="wpe-register-form" novalidate autocomplete="off"> 55 <div class="wpe-col-full wpe-field"> 56 <div class="wpe-above-error-field" id="wpe-error-div"><span class="wpe-error-exclamation">! </span><?php _e( 'There was some problem with your submission. Please review the fields below', 'simple-wp-events' ); ?></div> 57 </div> 58 <div class="wpe-col-2 wpe-field"> 59 <div class="wpe-form-control wpe-field-container wpe-left-half"> 48 60 <?php if( $labels) { echo'<label for="wpe_first_name">' . __( 'First Name *', 'simple-wp-events' ) . '</label>';}?> 49 <input class="wpe- no-special wpe-field" type="text" name="wpe_first_name" id="wpe_first_name" <?php if( !$labels ) {?>placeholder="<?php _e( 'First Name *', 'simple-wp-events' ); ?>" <?php } ?> required>50 <small><?php _e( ' Error Message', 'simple-wp-events' ); ?></small>61 <input class="wpe-field" type="text" name="wpe_first_name" id="wpe_first_name" <?php if( !$labels ) {?>placeholder="<?php _e( 'First Name *', 'simple-wp-events' ); ?>" <?php } ?> required> 62 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 51 63 </div> 52 64 <div class="wpe-form-control wpe-field-container wpe-right-half"> 53 65 <?php if( $labels) { echo'<label for="wpe_last_name">' . __( 'Last Name *', 'simple-wp-events' ) . '</label>';}?> 54 <input class="wpe- no-special wpe-field" type="text" name="wpe_last_name" id="wpe_last_name" <?php if( !$labels ) {?>placeholder="<?php _e( 'Last Name *', 'simple-wp-events' ); ?>" <?php } ?>required>55 <small><?php _e( ' Error Message', 'simple-wp-events' ); ?></small>66 <input class="wpe-field" type="text" name="wpe_last_name" id="wpe_last_name" <?php if( !$labels ) {?>placeholder="<?php _e( 'Last Name *', 'simple-wp-events' ); ?>" <?php } ?>required> 67 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 56 68 </div> 57 69 </div> 58 70 <div class="wpe-col-2 wpe-field"> 59 <?php if ( ! $addrees1 ) { ?> 71 <?php if ( ! $addrees1 ) { 72 $star = $req_addrees1 ? ' *' : ''; 73 ?> 60 74 <div class="wpe-form-control wpe-field-container wpe-left-half"> 61 <?php if( $labels) { echo'<label for="wpe_address">' . __( 'Address *', 'simple-wp-events' ) . '</label>';}?> 62 <input class="wpe-no-special wpe-field" type="text" name="wpe_address" id="wpe_address" <?php if( !$labels ) {?>placeholder="<?php _e( 'Address *', 'simple-wp-events' ); ?>" <?php } ?>required> 63 <small><?php _e( 'Error Message', 'simple-wp-events' ); ?></small> 64 </div> 65 <?php } if ( ! $addrees2 ) {?> 75 <?php if( $labels) { echo'<label for="wpe_address">' . __( 'Address', 'simple-wp-events' ) . $star .'</label>';}?> 76 <input class="wpe-field" type="text" name="wpe_address" id="wpe_address" <?php if( !$labels ) {?>placeholder="<?php _e( 'Address', 'simple-wp-events' ); echo $star; ?>" <?php } echo $req_addrees1 ? 'required' : ''; ?>> 77 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 78 </div> 79 <?php } if ( ! $addrees2 ) { 80 $star = $req_addrees2 ? ' *' : ''; 81 ?> 66 82 <div class="wpe-form-control wpe-field-container wpe-right-half"> 67 <?php if( $labels) { echo'<label for="wpe_address_2">' . __( 'Address 2', 'simple-wp-events' ) . '</label>';}?>68 <input class="wpe- no-special wpe-field" type="text" name="wpe_address_2" id="wpe_address_2" <?php if( !$labels ) {?>placeholder="<?php _e( 'Address 2', 'simple-wp-events' ); ?>" <?php }?>>69 <small><?php _e( ' Error Message', 'simple-wp-events' ); ?></small>83 <?php if( $labels) { echo'<label for="wpe_address_2">' . __( 'Address 2', 'simple-wp-events' ) . $star . '</label>';}?> 84 <input class="wpe-field" type="text" name="wpe_address_2" id="wpe_address_2" <?php if( !$labels ) {?>placeholder="<?php _e( 'Address 2', 'simple-wp-events' ); echo $star; ?>" <?php } echo $req_addrees2 ? 'required' : ''; ?>> 85 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 70 86 </div> 71 87 <?php } ?> 72 88 </div> 73 89 <div class="wpe-col-3 wpe-field"> 74 <?php if ( ! $city ) { ?> 90 <?php if ( ! $city ) { 91 $star = $req_city ? ' *' : ''; 92 ?> 75 93 <div class="wpe-form-control wpe-field-container wpe-left-third"> 76 <?php if( $labels) { echo'<label for="wpe_city">' . __( 'City *', 'simple-wp-events' ) . '</label>';}?> 77 <input class="wpe-no-special wpe-field" type="text" name="wpe_city" id="wpe_city" <?php if( !$labels ) {?>placeholder="<?php _e( 'City *', 'simple-wp-events' ); ?>" <?php } ?>required> 78 <small><?php _e( 'Error Message', 'simple-wp-events' ); ?></small> 79 </div> 80 <?php } if ( ! $state ) { ?> 94 <?php if( $labels) { echo'<label for="wpe_city">' . __( 'City *', 'simple-wp-events' ) . $star . '</label>';}?> 95 <input class="wpe-field" type="text" name="wpe_city" id="wpe_city" <?php if( !$labels ) {?>placeholder="<?php _e( 'City', 'simple-wp-events' ); echo $star; ?>" <?php } echo $req_city ? 'required' : ''; ?>> 96 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 97 </div> 98 <?php } if ( ! $state ) { 99 $star = $req_state ? ' *' : ''; 100 ?> 81 101 <div class="wpe-form-control wpe-field-container wpe-middle-third"> 82 <?php if( $labels) { echo'<label for="wpe_state">' . __( 'State *', 'simple-wp-events' ) . '</label>';}?> 83 <input class="wpe-no-special wpe-field" type="text" name="wpe_state" id="wpe_state" <?php if( !$labels ) {?>placeholder="<?php _e( 'State *', 'simple-wp-events' ); ?>" <?php } ?>required> 84 <small><?php _e( 'Error Message', 'simple-wp-events' ); ?></small> 85 </div> 86 <?php } if ( ! $zip ) { ?> 102 <?php if( $labels) { echo'<label for="wpe_state">' . __( 'State *', 'simple-wp-events' ) . $star . '</label>';}?> 103 <input class="wpe-field" type="text" name="wpe_state" id="wpe_state" <?php if( !$labels ) {?>placeholder="<?php _e( 'State', 'simple-wp-events' ); echo $star; ?>" <?php } echo $req_state ? 'required' : ''; ?>> 104 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 105 </div> 106 <?php } if ( ! $zip ) { 107 $star = $req_zip ? ' *' : ''; 108 ?> 87 109 <div class="wpe-form-control wpe-field-container wpe-right-third"> 88 <?php if( $labels) { echo'<label for="wpe_zip">' . __( 'Zip', 'simple-wp-events' ) . '</label>';}?>89 <input class="wpe-field" type="number" minlength="5" name="wpe_zip" id="wpe_zip" <?php if( !$labels ) {?>placeholder="<?php _e( 'Zip *', 'simple-wp-events' ); ?>" <?php } ?>required>90 <small><?php _e( ' Error Message', 'simple-wp-events' ); ?></small>110 <?php if( $labels) { echo'<label for="wpe_zip">' . __( 'Zip', 'simple-wp-events' ) . $star . '</label>';}?> 111 <input class="wpe-field" type="number" name="wpe_zip" id="wpe_zip" <?php if( !$labels ) {?>placeholder="<?php _e( 'Zip', 'simple-wp-events' ); echo $star; ?>" <?php } echo $req_zip ? 'required' : ''; ?>> 112 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 91 113 </div> 92 114 <?php }?> 93 115 </div> 94 116 <div class="wpe-col-3 wpe-field"> 117 <?php $star = $req_phone ? ' *' : ''; ?> 95 118 <div class="wpe-form-control wpe-field-container wpe-left-third"> 96 <?php if ( $labels) { echo'<label for="wpe_phone">' . __( 'Phone/Cell Phone', 'simple-wp-events' ) . '</label>';}?> 97 <input class="wpe-field" type="text" pattern="^(\([0-9]{3}\) |[0-9]{3}-)[0-9]{3}-[0-9]{4}$" title="(123) 111-1234" name="wpe_phone" id="wpe_phone" <?php if( !$labels ) {?>placeholder="<?php _e( 'Phone/Cell Phone: (XXX) XXX-XXXX', 'simple-wp-events' ); ?>" <?php } ?>required> 98 <small><?php _e( 'Error Message', 'simple-wp-events' ); ?></small> 99 </div> 119 <?php if ( $labels) { echo'<label for="wpe_phone">' . __( 'Phone/Cell Phone', 'simple-wp-events' ) . $star . '</label>';}?> 120 <input class="wpe-field" type="text" title="(123) 111-1234" name="wpe_phone" id="wpe_phone" <?php if( !$labels ) {?>placeholder="<?php _e( 'Phone/Cell Phone', 'simple-wp-events' ); echo $star; ?>" <?php } echo $req_phone ? 'required' : ''; ?>> 121 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 122 <span class="wpe-phone-error-class"><?php _e( 'Please enter phone in correct format - (123) 111-1234', 'simple-wp-events' ); ?></span> 123 </div> 124 <?php $star = $req_email ? ' *' : ''; ?> 100 125 <div class="wpe-form-control wpe-field-container wpe-middle-third"> 101 <?php if( $labels) { echo'<label for="wpe_email">' . __( 'Email *', 'simple-wp-events' ) . '</label>';}?> 102 <input class="wpe-field" type="email" name="wpe_email" id="wpe_email" <?php if( !$labels ) {?>placeholder="<?php __( 'Email *', 'simple-wp-events' ); ?>" <?php } ?> required> 103 <small><?php _e( 'Error Message', 'simple-wp-events' ); ?></small> 104 </div> 105 <?php if ( ! $fax ) { ?> 126 <?php if( $labels) { echo'<label for="wpe_email">' . __( 'Email', 'simple-wp-events' ) . $star . '</label>';}?> 127 <input class="wpe-field" type="email" name="wpe_email" id="wpe_email" <?php if( !$labels ) {?>placeholder="<?php _e( 'Email', 'simple-wp-events' ); echo $star; ?>" <?php } echo $req_email ? 'required' : ''; ?>> 128 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 129 <span class="wpe-email-error-class"><?php _e( 'Please enter a valid email address.', 'simple-wp-events' ); ?></span> 130 </div> 131 <?php if ( ! $fax ) { 132 $star = $req_fax ? ' *' : ''; 133 ?> 106 134 <div class="wpe-form-control wpe-field-container wpe-right-third"> 107 <?php if( $labels) { echo'<label for="wpe_fax">' . __( 'Fax', 'simple-wp-events' ) . '</label>';}?>108 <input class="wpe-field" type="number" name="wpe_fax" id="wpe_fax" <?php if( !$labels ) {?>placeholder="<?php _ _( 'Fax', 'simple-wp-events' ); ?>"<?php }?>>109 <small><?php _e( ' Error Message', 'simple-wp-events' ); ?></small>135 <?php if( $labels) { echo'<label for="wpe_fax">' . __( 'Fax', 'simple-wp-events' ) . $star . '</label>';}?> 136 <input class="wpe-field" type="number" name="wpe_fax" id="wpe_fax" <?php if( !$labels ) {?>placeholder="<?php _e( 'Fax', 'simple-wp-events' ); echo $star; ?>"<?php } echo $req_fax ? 'required' : ''; ?>> 137 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 110 138 </div> 111 139 <?php } ?> 112 140 </div> 113 <?php if ( ! $businessName ) { ?> 114 <div class="wpe-col-full wpe-field"> 115 <div class="wpe-form-control wpe-field-container wpe-full-width"> 116 <?php if( $labels) { echo'<label for="wpe_business_name">' . __( 'Business Name', 'simple-wp-events' ) . '</label>';}?> 117 <input class="wpe-field" type="text" name="wpe_business_name" id="wpe_business_name" <?php if( !$labels ) {?>placeholder="<?php _e( 'Business Name', 'simple-wp-events' ); ?>" <?php } ?>> 118 <small><?php _e( 'Error Message', 'simple-wp-events' ); ?></small> 141 <?php if ( ! $businessName ) { 142 $star = $req_businessName ? ' *' : ''; 143 ?> 144 <div class="wpe-col-full wpe-field"> 145 <div class="wpe-form-control wpe-field-container wpe-full-width"> 146 <?php if( $labels) { echo'<label for="wpe_business_name">' . __( 'Business Name', 'simple-wp-events' ) . $star . '</label>';}?> 147 <input class="wpe-field" type="text" name="wpe_business_name" id="wpe_business_name" <?php if( !$labels ) {?>placeholder="<?php _e( 'Business Name', 'simple-wp-events' ); echo $star; ?>" <?php } echo $req_businessName ? 'required' : ''; ?>> 148 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 119 149 </div> 120 150 </div> … … 132 162 <textarea class="wpe-field" name="wpe_settings[privacy_policy]" id="wpe_privacy_policy" readonly><?php 133 163 echo trim( esc_html( $option['privacy_policy'] ) ); ?></textarea> 134 <small><?php _e( ' Error Message', 'simple-wp-events' ); ?></small>164 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 135 165 </div> 136 166 <?php } ?> … … 144 174 <input type="checkbox" name="wpe_consent_box" id="wpe_consent_box" value="I have read & consent to the above." required> 145 175 <label for="wpe_consent_box"><?php echo esc_html( $consent_box ); ?></label> 146 <small><?php _e( ' Error Message', 'simple-wp-events' ); ?></small>176 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 147 177 </div> 148 178 <div class="wpe-form-control wpe-field-container wpe-full-width"> 149 179 <input type="checkbox" name="wpe_disclaimer_box" id="wpe_disclaimer_box" value="I have read & understand your website Disclaimer." required> 150 180 <label for="wpe_disclaimer_box"> <?php echo esc_html( $disclaimer_box ); ?></label> 151 <small><?php _e( ' Error Message', 'simple-wp-events' ); ?></small>181 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 152 182 </div> 153 183 <?php … … 157 187 <input type="checkbox" name="wpe_texting_permission" id="wpe_texting_permission" value="1"> 158 188 <label for="wpe_texting_permission"><?php echo esc_html( do_shortcode( $form_textin_permission ) ); ?></label> 159 <small><?php _e( ' Error Message', 'simple-wp-events' ); ?></small>189 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 160 190 </div> 161 191 <?php … … 173 203 wpe_get_seats_dropdown(); 174 204 ?> 175 <small><?php _e( ' Error Message', 'simple-wp-events' ); ?></small>205 <small><?php _e( 'This field is required.', 'simple-wp-events' ); ?></small> 176 206 </div> 177 207 </div> … … 180 210 <div class="wpe-form-control wpe-field-container wpe-left-half"> 181 211 <?php if( $labels) { echo'<label>' . __( 'Guest First Name*', 'simple-wp-events' ) . '</label>';}?> 182 <input class="wpe- no-special wpe-field wpe-guest-field" type="text" name="wpe_guest_first_name[]" <?php if( !$labels ) {?>placeholder="<?php _e( 'Guest First Name*', 'simple-wp-events' ); ?>" <?php } ?>>212 <input class="wpe-field wpe-guest-field" type="text" name="wpe_guest_first_name[]" <?php if( !$labels ) {?>placeholder="<?php _e( 'Guest First Name*', 'simple-wp-events' ); ?>" <?php } ?>> 183 213 <small><?php _e( 'Error Message', 'simple-wp-events' ); ?></small> 184 214 </div> 185 215 <div class="wpe-form-control wpe-field-container wpe-right-half"> 186 216 <?php if( $labels) { echo'<label>' . __( 'Guest Last name*', 'simple-wp-events' ) . '</label>';}?> 187 <input class="wpe- no-special wpe-field wpe-guest-field" type="text" name="wpe_guest_last_name[]" <?php if( !$labels ) {?>placeholder="<?php _e( 'Guest Last name*', 'simple-wp-events' ); ?>" <?php } ?>>217 <input class="wpe-field wpe-guest-field" type="text" name="wpe_guest_last_name[]" <?php if( !$labels ) {?>placeholder="<?php _e( 'Guest Last name*', 'simple-wp-events' ); ?>" <?php } ?>> 188 218 <small><?php _e( 'Error Message', 'simple-wp-events' ); ?></small> 189 219 </div> -
simple-wp-events/trunk/public/includes/wp-events-subscribe-form.php
r2780675 r2882562 31 31 $form_textin_permission = isset( $form_options['subscriber_form_texting_permission'] ) ? sanitize_text_field( $form_options['subscriber_form_texting_permission'] ) : __( 'I agree to receive texts at the number provided from [wpe_firm_name]. Frequency may vary and include information on appointments, events, and other marketing messages. Message/data rates may apply. To opt-out, text STOP at any time.', 'simple-wp-events' ); 32 32 $hide_phone_number = isset( $form_options['subscriber_enable_phone_number'] ); 33 $req_phone = isset( $form_options['req_subform_phone'] ); 34 $req_email = isset( $form_options['req_subform_email'] ); 33 35 $hide_texting_permission = isset( $form_options['subscriber_enable_texting_permission'] ); 34 36 ?> 35 37 <div class="wpe-form-holder"> 36 38 <div class="wpe-subscribe-form-container"> 37 <form method="post" action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" class="wpe-subscribe-form" id="wpe-subscribe-form" autocomplete="off"> 39 <form method="post" action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" novalidate class="wpe-subscribe-form" id="wpe-subscribe-form" autocomplete="off"> 40 <div class="wpe-col-full wpe-field"> 41 <div class="wpe-above-error-field"> 42 <span class="wpe-error-exclamation">! </span><?php _e( 'There was some problem with your submission. Please review the fields below', 'simple-wp-events' ); ?> 43 </div> 44 </div> 38 45 <?php wp_nonce_field('wp_events_subscribe_form','wpe_subscribe_form'); 39 46 if( $form_title != '' ) { … … 50 57 <div class="wpe-form-control"> 51 58 <?php if( $labels ) { echo'<label for="wpe_username">' . __( 'First Name *', 'simple-wp-events' ) . '</label>';}?> 52 <input class="wpe-no-special"type="text" name="wpe_first_name" id="wpe_firstname" <?php if( !$labels ) {?>placeholder="<?php _e( 'First Name*', 'simple-wp-events' ); ?>"<?php }?> required>53 <small><?php _e( ' Error Message', 'simple-wp-events' ); ?></small>59 <input type="text" name="wpe_first_name" id="wpe_firstname" <?php if( !$labels ) {?>placeholder="<?php _e( 'First Name*', 'simple-wp-events' ); ?>"<?php }?> required> 60 <small><?php _e( 'This field is required', 'simple-wp-events' ); ?></small> 54 61 </div> 55 62 <div class="wpe-form-control"> 56 63 <?php if( $labels ) { echo'<label for="wpe_username">' . __( 'Last Name*', 'simple-wp-events' ) . '</label>';}?> 57 <input class="wpe-no-special"type="text" name="wpe_last_name" id="wpe_lastname" <?php if( !$labels ) {?>placeholder="<?php _e( 'Last Name*', 'simple-wp-events' ); ?>"<?php }?> required>58 <small><?php _e( ' Error Message', 'simple-wp-events' ); ?></small>64 <input type="text" name="wpe_last_name" id="wpe_lastname" <?php if( !$labels ) {?>placeholder="<?php _e( 'Last Name*', 'simple-wp-events' ); ?>"<?php }?> required> 65 <small><?php _e( 'This field is required', 'simple-wp-events' ); ?></small> 59 66 </div> 60 67 </div> 61 68 <div class="wpe-col-2"> 69 <?php $star = $req_email ? ' *' : ''; ?> 62 70 <div class="wpe-form-control"> 63 <?php if( $labels ) { echo'<label for="wpe_email">' . __( 'Email*', 'simple-wp-events' ) . '</label>';}?> 64 <input type="email" name="wpe_email" id="wpe_email" <?php if( !$labels ) {?>placeholder="<?php _e( 'Email*', 'simple-wp-events' ); ?>"<?php }?> required> 65 <small><?php _e( 'Error Message', 'simple-wp-events' ); ?></small> 71 <?php if( $labels ) { echo'<label for="wpe_email">' . __( 'Email', 'simple-wp-events' ) . $star .'</label>';}?> 72 <input type="email" name="wpe_email" id="wpe_email" <?php if( !$labels ) {?>placeholder="<?php _e( 'Email', 'simple-wp-events' ); echo $star; ?>"<?php } echo $req_email ? 'required' : ''; ?>> 73 <small><?php _e( 'This field is required', 'simple-wp-events' ); ?></small> 74 <span class="wpe-email-error-class"><?php _e( 'Please enter a valid email address.', 'simple-wp-events' ); ?></span> 66 75 </div> 67 76 <?php 68 77 if( $hide_phone_number ) { 69 78 ?> 79 <?php $star = $req_phone ? ' *' : ''; ?> 70 80 <div class="wpe-form-control"> 71 <?php if( $labels ) { echo'<label for="wpe_phone">' . __( 'Cell Phone Number*', 'simple-wp-events' ) . '</label>';}?> 72 <input type="text" title="(123) 111-1234" name="wpe_phone" id="wpe_phone" <?php if( !$labels ) {?>placeholder="<?php _e( 'Cell Phone Number', 'simple-wp-events' ); ?>"<?php }?>> 73 <small><?php _e( 'Error Message', 'simple-wp-events' ); ?></small> 81 <?php if( $labels ) { echo'<label for="wpe_phone">Cell Phone Number'. $star .'</label>';}?> 82 <input type="text" title="(123) 111-1234" name="wpe_phone" id="wpe_phone" <?php if( !$labels ) {?>placeholder="Cell Phone Number<?php echo $star; ?>"<?php } echo $req_phone ? 'required' : ''; ?>> 83 <small><?php _e( 'This field is required', 'simple-wp-events' ); ?></small> 84 <span class="wpe-phone-error-class"><?php _e( 'Please enter phone in correct format - (123) 111-1234', 'simple-wp-events' ); ?></span> 74 85 </div> 75 86 <?php } ?> -
simple-wp-events/trunk/public/js/wp-events-public.js
r2780675 r2882562 1 1 jQuery(document).ready(function ($) { 2 2 'use strict'; 3 4 $('.wpe-form-control .wpe-no-special').on( 'input', function() { 5 var c = this.selectionStart, 6 r = /[^a-z0-9 ]/gi, 7 v = $(this).val(); 8 if( r.test( v ) ) { 9 $( this ).val( v.replace( r, '' ) ); 10 c--; 11 } 12 this.setSelectionRange(c, c); 13 }); 14 15 // $('input#wpe_phone').attr("onkeydown", "phoneNumberFormatter()"); 3 4 $("#wpe_phone").inputmask({"mask": "(999) 999-9999"}); 16 5 17 6 /** … … 65 54 66 55 /** 67 * Registration Form Validation56 * email validate function 68 57 * */ 69 //variables 70 var siteKey = wpe_ajaxobject.captchaSiteKey; 71 var secretKey = wpe_ajaxobject.captchaSecretKey; 72 const form = $('form').hasClass('wpe-register-form') ? $('#wpe-register-form') : $('#wpe-subscribe-form'); 73 74 form.submit(function (e) { 75 e.preventDefault(); 76 if( $('span.g-recaptcha').text() === 'Captcha not found.' ) { 77 submitForm( form ); 78 } else { 79 if( wpe_ajaxobject.captchaType === 'checkbox' && siteKey !== '' && secretKey !== '' ) { 80 if ( wpeValidRecaptcha() ) { 81 wpeVerifyCaptcha( form ); 82 } 83 } else 84 if( wpe_ajaxobject.captchaType === 'invisible' && siteKey !== '' && secretKey !== '' ) { 85 grecaptcha.execute(); 86 setTimeout( function() { 87 wpeVerifyCaptcha( form ); 88 }, 1000); 89 } 90 } 91 }); 92 58 function validateEmail( $email ) { 59 var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; 60 return emailReg.test( $email ); 61 } 62 63 /** 64 * email validate function 65 * */ 66 function validatePhone( $phone ) { 67 var phoneReg = /^(\([0-9]{3}\) |[0-9]{3}-)[0-9]{3}-[0-9]{4}$/; 68 return phoneReg.test( $phone ); 69 } 70 71 if ( $('body').hasClass('single-wp_events') || $('form').hasClass('wpe-subscribe-form') ) { 72 /** 73 *Form Validation 74 * */ 75 //variables 76 var siteKey = wpe_ajaxobject.captchaSiteKey; 77 var secretKey = wpe_ajaxobject.captchaSecretKey; 78 var form = ''; 79 var updatedClass = ''; 80 var allForms = $("form"); 81 allForms.each( function() { 82 var form = $( this ); 83 var formClass = form.attr( 'class' ); 84 if( formClass === 'wpe-register-form' || formClass === 'wpe-subscribe-form' || formClass === 'wpe-waitlist-form' ) { 85 updatedClass = formClass; 86 } 87 }); 88 switch( updatedClass ) { 89 case 'wpe-register-form': 90 var form = $( '#wpe-register-form' ); 91 break; 92 case'wpe-subscribe-form': 93 var form = $( '#wpe-subscribe-form' ); 94 break; 95 case'wpe-waitlist-form': 96 var form = $( '#wpe-waitlist-form' ); 97 break; 98 } 99 var formInput = ''; 100 switch( updatedClass ) { 101 case 'wpe-register-form': 102 formInput = $( 'form#wpe-register-form :input' ); 103 break; 104 case'wpe-subscribe-form': 105 formInput = $( 'form#wpe-subscribe-form :input' ); 106 break; 107 case'wpe-waitlist-form': 108 formInput = $( 'form#wpe-waitlist-form :input' ); 109 break; 110 } 111 112 form.submit( function (e) { 113 e.preventDefault(); 114 115 /** 116 * check if any of the field is empty 117 * */ 118 //variables 119 var valueFalse = ''; 120 formInput.each( function() { 121 var input = $( this ); // 122 if ( input.prop( 'required' ) ) { 123 $( ".wpe-above-error-field" ).removeClass( 'error' ); 124 input.parent().removeClass( 'error' ); 125 $('.wpe-form-control small').css('display', 'none'); 126 if ( ! input.val() || ( input.is( ':checkbox' ) && ! input.is( ":checked" ) ) ) { 127 input.parent().addClass( 'error' ); 128 $('.wpe-form-control small').css('display', 'block'); 129 valueFalse = 'dont Reload'; 130 } 131 } 132 input.parent().removeClass( 'correct-email' ); 133 input.parent().removeClass( 'correct-phone' ); 134 if ( input.attr( "id" ) == 'wpe_email' && ! ( input.parent().hasClass( 'error' ) ) ) { 135 if ( ! validateEmail( input.val() ) ) { 136 input.parent().addClass( 'correct-email' ); 137 $('.wpe-form-control small').css('display', 'block'); 138 valueFalse = 'dont Reload'; 139 } 140 } 141 if ( input.val() != '' && input.attr( "id" ) == 'wpe_phone' && ! ( input.parent().hasClass( 'error' ) ) ) { 142 if ( ! validatePhone( input.val() ) ) { 143 input.parent().addClass( 'correct-phone' ); 144 $('.wpe-form-control small').css('display', 'block'); 145 valueFalse = 'dont Reload'; 146 } 147 } 148 }); 149 150 /** 151 * if any required field is empty stop the execution and show error 152 * */ 153 if ( valueFalse == 'dont Reload' ) { 154 $( ".wpe-above-error-field" ).addClass( 'error' ); 155 document.getElementById("wpe-error-div").scrollIntoView({ behavior: "smooth" }); 156 return false; 157 } 158 if( $( 'span.g-recaptcha' ).text() === 'Captcha not found.' ) { 159 submitForm( form ); 160 } else { 161 if( wpe_ajaxobject.captchaType === 'checkbox' && siteKey !== '' && secretKey !== '' ) { 162 if ( wpeValidRecaptcha() ) { 163 wpeVerifyCaptcha( form ); 164 } 165 } else if ( wpe_ajaxobject.captchaType === 'invisible' && siteKey !== '' && secretKey !== '' ) { 166 grecaptcha.execute(); 167 setTimeout( function() { 168 wpeVerifyCaptcha( form ); 169 }, 1000); 170 } 171 } 172 }); 173 } 93 174 function submitForm( submittedForm ) { 94 175 // Serialize the data in the form 95 176 const serializedData = submittedForm.serializeJSON(); 96 const action = $('form').hasClass('wpe-register-form') ? 'wpe_registration_form' : 'wpe_subscribe_form'; 97 wpe_save_form_data(serializedData, action); 98 } 99 177 var action = ""; 178 switch( updatedClass ) { 179 case 'wpe-register-form': 180 var action = 'wpe_registration_form'; 181 break; 182 case 'wpe-subscribe-form': 183 var action = 'wpe_subscribe_form'; 184 break; 185 case 'wpe-waitlist-form': 186 var action = 'wpe_waitlist_form'; 187 break; 188 } 189 wpe_save_form_data( serializedData, action ); 190 } 191 100 192 /** 101 193 * ajax request for handling saving of form data … … 117 209 // pre-request callback function. 118 210 beforeSend: function () { 119 $( '#wpe-button').attr('disabled', true);120 $( '.wpe-button-loader').fadeIn();211 $( '#wpe-button' ).attr( 'disabled', true); 212 $( '.wpe-button-loader' ).fadeIn(); 121 213 }, 122 214 123 215 // function to be called if the request succeeds. 124 216 success: function (response) { 125 $( '#wpe-button').attr('disabled', false);217 $( '#wpe-button' ).attr( 'disabled', false); 126 218 window.location.href = decodeURIComponent(response.url); 127 $( '.wpe-button-loader').fadeOut();219 $( '.wpe-button-loader' ).fadeOut(); 128 220 } 129 221 }) … … 132 224 //on event single page 133 225 if ( $('body').hasClass('single-wp_events') || $('body').hasClass('post-type-archive-wp_events') ) { 226 checkCookie(); 134 227 if (window.location.href.includes('thankyou')) { 135 228 $('.thankyou-popup').css('display', 'block'); … … 234 327 } ); 235 328 329 function setCookie( cname, cvalue, exdays ) { 330 const d = new Date(); 331 d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); 332 let expires = "expires="+d.toUTCString(); 333 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 334 } 335 336 function getCookie( cname ) { 337 let name = cname + "="; 338 let ca = document.cookie.split(';'); 339 for(let i = 0; i < ca.length; i++) { 340 let c = ca[i]; 341 while (c.charAt(0) == ' ') { 342 c = c.substring(1); 343 } 344 if (c.indexOf(name) == 0) { 345 return c.substring(name.length, c.length); 346 } 347 } 348 return ""; 349 } 350 351 function checkCookie() { 352 let timezone = getCookie("wpeTimezone"); 353 if ( timezone == "" ) { 354 var timezone_offset_minutes = new Date().getTimezoneOffset(); 355 timezone = timezone_offset_minutes == 0 ? 0 : -timezone_offset_minutes; 356 if ( timezone != "" && timezone != null ) { 357 setCookie( "wpeTimezone", timezone, 1); 358 } 359 } 360 } 361 362 236 363 }); 237 364 … … 294 421 } 295 422 } 296 297 298 function phoneNumberFormatter() {299 // grab the value of what the user is typing into the input300 const inputField = document.getElementById( 'wpe_phone' );301 302 // next, we're going to format this input with the `formatPhoneNumber` function, which we'll write next.303 const formattedInputValue = formatPhoneNumber( inputField.value );304 305 // Then we'll set the value of the inputField to the formattedValue we generated with the formatPhoneNumber306 inputField.value = formattedInputValue;307 }308 309 function formatPhoneNumber( value ) {310 // if input value is false eg if the user deletes the input, then just return311 if ( !value ) return value;312 313 // clean the input for any non-digit values.314 const phoneNumber = value.replace(/[^\d]/g, '');315 316 // phoneNumberLength is used to know when to apply our formatting for the phone number317 const phoneNumberLength = phoneNumber.length;318 319 // we need to return the value with no formatting if its less than four digits320 // this is to avoid weird behavior that occurs if you format the area code too early321 if ( phoneNumberLength < 4 ) return phoneNumber;322 323 // if phoneNumberLength is greater than 4 and less the 7 we start to return324 // the formatted number325 if ( phoneNumberLength < 7 ) {326 return `(${phoneNumber.slice(0, 3)}) ${phoneNumber.slice(3)}`;327 }328 329 // finally, if the phoneNumberLength is greater then seven, we add the last330 // bit of formatting and return it.331 return `(${phoneNumber.slice(0, 3)}) ${phoneNumber.slice(332 3,333 6334 )}-${phoneNumber.slice(6, 9)}`;335 } -
simple-wp-events/trunk/public/templates/single-wp_events.php
r2780675 r2882562 46 46 $wpe_type = get_post_meta( $post_id, 'wpevent-type', TRUE ); 47 47 $wpe_phone = get_post_meta( $post_id, 'wpevent-phone', true ); 48 date_default_timezone_set( wpe_get_user_timezone() ); 49 $set_timezone = new DateTimeZone( wpe_get_user_timezone() ); 50 $start_tz_date = new DateTime( date('Y-m-d H:i:s', get_post_meta( $post_id , 'wpevent-start-date-time', TRUE ) ), $set_timezone ); 51 $end_tz_date = new DateTime( date('Y-m-d H:i:s', get_post_meta( $post_id , 'wpevent-end-date-time', TRUE ) ), $set_timezone ); 52 date_default_timezone_set( 'UTC' ); 48 53 ?> 49 54 <?php … … 141 146 } 142 147 ?> 143 <div class="ics-text" id="get-ics-text">BEGIN:VCALENDAR<?php echo "\n" ?>VERSION:2.0<?php echo "\n" ?>PRODID:-//WPMINDS//NONSGML v1.0//EN<?php echo "\n" ?>CALSCALE:GREGORIAN<?php echo "\n" ?>BEGIN:VEVENT<?php echo "\n" ?>VENUE:<?php echo esc_html( $wpe_venue ); ?><?php echo "\n" ?>DESCRIPTION:<?php echo strip_tags( get_the_excerpt()); ?><?php echo "\n" ?>ADDRESS:<?php echo esc_html( $wpe_addr ); ?><?php echo "\n" ?>DTSTART:<?php echo date('Ymd\THis', get_post_meta( $post_id , 'wpevent-start-date-time', TRUE )); ?><?php echo "\n" ?>DTEND:<?php echo date('Ymd\THis', get_post_meta( $post_id , 'wpevent-end-date-time', TRUE )); ?><?php echo "\n" ?>URL;VALUE=URI:<?php echo get_the_permalink( $post_id ); ?><?php echo "\n" ?>SUMMARY:<?php echo strip_tags( get_the_title()); ?><?php echo "\n" ?>LOCATION:<?php echo wp_kses( $venue_html, wpe_get_allowed_html() ); ?><?php echo "\n" ?>PHONE:<?php echo get_post_meta( $post_id, 'wpevent-phone', true ); ?><?php echo "\n" ?>DTSTAMP:<?php echo date('Ymd\THis'); ?><?php echo "\n" ?>UID:<?php echo uniqid(); ?><?php echo "\n" ?>END:VEVENT<?php echo "\n" ?>END:VCALENDAR</div>148 <div class="ics-text" id="get-ics-text">BEGIN:VCALENDAR<?php echo "\n" ?>VERSION:2.0<?php echo "\n" ?>PRODID:-//WPMINDS//NONSGML v1.0//EN<?php echo "\n" ?>CALSCALE:GREGORIAN<?php echo "\n" ?>BEGIN:VEVENT<?php echo "\n" ?>VENUE:<?php echo $wpe_venue; ?><?php echo "\n" ?>DESCRIPTION:<?php echo strip_tags( get_the_excerpt()); ?><?php echo "\n" ?>ADDRESS:<?php echo $wpe_addr; ?><?php echo "\n" ?>DTSTART:<?php echo $start_tz_date->format( 'Ymd\THis' ); ?><?php echo "\n" ?>DTEND:<?php echo $end_tz_date->format( 'Ymd\THis' ); ?><?php echo "\n" ?>URL;VALUE=URI:<?php echo get_the_permalink( $post_id ); ?><?php echo "\n" ?>SUMMARY:<?php echo strip_tags( get_the_title()); ?><?php echo "\n" ?>LOCATION:<?php echo $venue_html; ?><?php echo "\n" ?>PHONE:<?php echo get_post_meta( $post_id, 'wpevent-phone', true ); ?><?php echo "\n" ?>DTSTAMP:<?php echo date('Ymd\THis'); ?><?php echo "\n" ?>UID:<?php echo uniqid(); ?><?php echo "\n" ?>END:VEVENT<?php echo "\n" ?>END:VCALENDAR</div> 144 149 <div class="filename"><?php echo strip_tags( get_the_title()) .'.ics' ?></div> 145 150 </ul> … … 171 176 if( empty( $post->post_password ) || !post_password_required() ){ 172 177 // do some stuff 173 do_action( 'wp_events_registration_form' ); // Displays Events Registration Form 178 do_action ( 'wp_events_registration_form' ); // Displays Events Registration Form 179 $text = __( 'ThankYou For Registering.', 'simple-wp-events' ); 180 wpe_get_thankyou_popup( $text ); 174 181 } 175 182 } 176 } else { 177 wpe_get_closed_reg_text(); 183 } 184 else { 185 $option = get_option( 'wpe_display_settings' ); // Displays Text when Waitlisting Form is hide 186 $text = $option['closed_reg']; 187 echo esc_html( $text ); 178 188 } 179 189 endwhile; … … 181 191 ?> 182 192 </div> 183 <?php184 $text = __( 'ThankYou For Registering.', 'simple-wp-events' );185 wpe_get_thankyou_popup( $text );186 ?>187 193 </div> 188 194 </div> -
simple-wp-events/trunk/wp-events.php
r2807927 r2882562 13 13 * Plugin URI: https://simplewpevents.com/ 14 14 * Description: The only WordPress plugin to create, manage and update hassle free events 15 * Version: 1. 5.415 * Version: 1.6.2 16 16 * Requires at least: 5.0 17 17 * Requires PHP: 7.0 … … 20 20 * License: GPL-2.0+ 21 21 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt 22 * Text Domain: wp-events22 * Text Domain: simple-wp-events 23 23 */ 24 24 … … 31 31 * Currently plugin version. 32 32 */ 33 define( 'WP_EVENTS_VERSION', '1. 5.4' );33 define( 'WP_EVENTS_VERSION', '1.6.2' ); 34 34 35 35 /**
Note: See TracChangeset
for help on using the changeset viewer.