From 5abe12742fd4aecb68335dfcc33298c15a90e776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Borbo=C3=ABn?= Date: Wed, 15 Mar 2023 19:10:01 +0100 Subject: [PATCH] [fix] EPFL Conference Form Template and bump to 1.7.3 --- CHANGELOG.md | 3 + class-epfl-conference-form-template.php | 158 ++++++++++++++---------- wpforms-epfl-payonline.php | 6 +- 3 files changed, 102 insertions(+), 65 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25b38f9..08f02b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. +## v1.7.3 +* Renew the EPFL Conference Form Template + ## v1.7.2 * Hide all forms payment methods but EPFL Payonline diff --git a/class-epfl-conference-form-template.php b/class-epfl-conference-form-template.php index 2f057fc..8a4d351 100644 --- a/class-epfl-conference-form-template.php +++ b/class-epfl-conference-form-template.php @@ -21,36 +21,27 @@ * @copyright Copyright (c) 2019, EPFL */ -// Exit if accessed directly. -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - if ( class_exists( 'WPForms_Template', false ) ) : /** - * Conference Form (EPFL Payonline) + * EPFL Conference Form Template * Template for WPForms. */ class EPFL_Conference_Form_Template extends WPForms_Template { - /** * Primary class constructor. * * @since 1.0.0 */ public function init() { - // Allow to add this template in the top part of the template page. - $this->core = true; - // Template name. - $this->name = 'Conference Form (EPFL Payonline)'; + $this->name = 'EPFL Conference Form Template'; // Template slug. - $this->slug = 'conference_form_epfl_payonline'; + $this->slug = 'conference_form_new_template'; // Template description. - $this->description = 'Collect Payments via EPFL Payonline for conferences payments with this ready-made form template. You can add and remove fields as needed.'; + $this->description = 'Template for EPFL conferences with payments (via EPFL Payonline).'; // Template field and settings. $this->data = array( @@ -64,9 +55,18 @@ public function init() { 'size' => 'large', ), 1 => array( - 'id' => '1', - 'type' => 'email', - 'label' => 'Email', + 'id' => '1', + 'type' => 'email', + 'label' => 'Email', + 'required' => '1', + 'size' => 'large', + 'default_value' => false, + ), + 2 => array( + 'id' => '2', + 'type' => 'phone', + 'label' => 'Phone', + 'format' => 'international', 'required' => '1', 'size' => 'large', ), @@ -79,38 +79,38 @@ public function init() { 'size' => 'large', 'country_default' => 'CH', ), - 2 => array( - 'id' => '2', - 'type' => 'phone', - 'label' => 'Phone', - 'format' => 'smart', - 'required' => '1', - 'size' => 'large', - ), 8 => array( 'id' => '8', 'type' => 'checkbox', 'label' => 'Diets', 'choices' => array( 1 => array( - 'label' => 'Gluten-Free', + 'label' => 'Gluten-Free', + 'icon' => 'face-smile', + 'icon_style' => 'regular', ), 2 => array( - 'label' => 'Lactose-Free', - ), - 3 => array( - 'label' => 'Semi-vegetarian', + 'label' => 'Lactose-Free', + 'icon' => 'face-smile', + 'icon_style' => 'regular', ), 4 => array( - 'label' => 'Vegetarian', + 'label' => 'Vegetarian', + 'icon' => 'face-smile', + 'icon_style' => 'regular', ), 5 => array( - 'label' => 'Veganism', + 'label' => 'Veganism', + 'icon' => 'face-smile', + 'icon_style' => 'regular', ), ), - 'description' => 'Please indicate your food preferences and we will do our best to offer adapted meals at the conference.', 'choices_images_style' => 'modern', - 'input_columns' => 'inline', + 'choices_icons_color' => '#0399ed', + 'choices_icons_size' => 'large', + 'choices_icons_style' => 'default', + 'description' => 'Please indicate your food preferences and we will do our best to offer adapted meals at the conference.', + 'input_columns' => '2', ), 4 => array( 'id' => '4', @@ -118,22 +118,31 @@ public function init() { 'label' => 'Conference fees', 'choices' => array( 1 => array( - 'label' => 'Student', - 'value' => '100.00', + 'label' => 'Students', + 'value' => '100.00', + 'icon' => 'face-smile', + 'icon_style' => 'regular', ), 2 => array( - 'label' => 'Speakers', - 'value' => '200.00', + 'label' => 'Speakers', + 'value' => '200.00', + 'icon' => 'face-smile', + 'icon_style' => 'regular', ), 3 => array( - 'label' => 'Other attendees', - 'value' => '250.00', + 'label' => 'Other attendees', + 'value' => '250.00', + 'icon' => 'face-smile', + 'icon_style' => 'regular', ), ), 'show_price_after_labels' => '1', + 'choices_images_style' => 'modern', + 'choices_icons_color' => '#0399ed', + 'choices_icons_size' => 'large', + 'choices_icons_style' => 'default', 'description' => 'Students will be asked to show their card at the conference check-in.', 'required' => '1', - 'choices_images_style' => 'modern', ), 7 => array( 'id' => '7', @@ -141,16 +150,23 @@ public function init() { 'label' => 'Evenning events', 'choices' => array( 1 => array( - 'label' => 'Conference dinner (Wednesday evenning)', - 'value' => '100.00', + 'label' => 'Conference dinner (Wednesday evenning)', + 'value' => '100.00', + 'icon' => 'face-smile', + 'icon_style' => 'regular', ), 2 => array( - 'label' => 'Conference event (Thursday evenning)', - 'value' => '100.00', + 'label' => 'Conference event (Thursday evenning)', + 'value' => '100.00', + 'icon' => 'face-smile', + 'icon_style' => 'regular', ), ), 'show_price_after_labels' => '1', 'choices_images_style' => 'modern', + 'choices_icons_color' => '#0399ed', + 'choices_icons_size' => 'large', + 'choices_icons_style' => 'default', ), 5 => array( 'id' => '5', @@ -161,39 +177,44 @@ public function init() { 'id' => '6', 'type' => 'textarea', 'label' => 'Comment or Message', - 'required' => '1', 'size' => 'small', 'limit_count' => '1', 'limit_mode' => 'characters', ), 9 => array( - 'id' => '9', - 'type' => 'gdpr-checkbox', - 'required' => '1', - 'label' => 'GDPR Agreement', - 'choices' => array( + 'id' => '9', + 'type' => 'gdpr-checkbox', + 'required' => '1', + 'label' => 'GDPR Agreement', + 'choices' => array( 1 => array( - 'label' => 'I consent to having this website store my submitted information so they can respond to my inquiry. Head to EPFL Privacy Policy (https://www.epfl.ch/about/presidency/presidents-team/legal-affairs/epfl-privacy-policy/) for details.', + 'label' => 'By checking this box, I consent to the use of my personal data by EPFL for the purpose of processing my application for this conference (https://go.epfl.ch/lpd)', + 'icon' => 'face-smile', + 'icon_style' => 'regular', ), ), + 'description' => 'EPFL is required to respect the principles of data protection (https://go.epfl.ch/privacy-policy).', ), ), 'field_id' => 10, 'settings' => array( - 'form_title' => 'Conference Form (EPFL Payonline)', - 'form_desc' => 'Collect Payments via EPFL Payonline for conferences payments with this ready-made form template. You can add and remove fields as needed.', + 'form_title' => 'EPFL Conference Form Template', 'submit_text' => 'Submit', 'submit_text_processing' => 'Sending...', - 'honeypot' => '1', 'notification_enable' => '1', 'notifications' => array( 1 => array( 'notification_name' => 'Default Notification', - 'email' => '{admin_email}', - 'subject' => 'New Entry: Billing / Order Form with Payonline', - 'sender_name' => 'EPFL ISAS FSD', - 'sender_address' => '{admin_email}', + 'email' => 'your.email@epfl.ch', + 'carboncopy' => 'another.email@epfl.ch', + 'subject' => 'Someone just submitted your form...', + 'sender_name' => 'Demo conference', + 'sender_address' => 'demo.conference@epfl.ch', + 'replyto' => 'demo.conference@epfl.ch', 'message' => '{all_fields}', + 'file_upload_attachment_fields' => array(), + 'entry_csv_attachment_entry_information' => array(), + 'entry_csv_attachment_file_name' => 'entry-details', ), ), 'confirmations' => array( @@ -202,23 +223,36 @@ public function init() { 'type' => 'message', 'message' => '

Thanks for contacting us! We will be in touch with you shortly.

', 'message_scroll' => '1', - 'page' => '2', + 'page' => '10', 'message_entry_preview_style' => 'basic', ), ), + 'honeypot' => '1', + 'anti_spam' => array( + 'country_filter' => array( + 'action' => 'allow', + 'country_codes' => array(), + 'message' => 'Sorry, this form does not accept submissions from your country.', + ), + 'keyword_filter' => array( + 'message' => 'Sorry, your message can\'t be submitted because it contains prohibited words.', + ), + ), + 'form_tags' => array(), ), 'payments' => array( 'epfl_payonline' => array( 'enable' => '1', - 'id_inst' => '1234567890', - 'email' => '', + 'id_inst' => '0123456789', + 'email' => 'conference.admin@groupes.epfl.ch', ), ), 'meta' => array( - 'template' => 'conference_form_epfl_payonline', + 'template' => 'conference_form_new_template', ), ); } } + new EPFL_Conference_Form_Template(); endif; diff --git a/wpforms-epfl-payonline.php b/wpforms-epfl-payonline.php index 2356a49..9318c49 100644 --- a/wpforms-epfl-payonline.php +++ b/wpforms-epfl-payonline.php @@ -6,7 +6,7 @@ * Author: EPFL ISAS-FSD * Author URI: https://go.epfl.ch/idev-fsd * Contributor: Nicolas Borboën - * Version: 1.7.2 + * Version: 1.7.3 * Text Domain: wpforms-epfl-payonline * Domain Path: languages * License: GPL-2.0+ @@ -37,11 +37,11 @@ } // Plugin version. -define( 'WPFORMS_EPFL_PAYONLINE_VERSION', '1.7.2' ); +define( 'WPFORMS_EPFL_PAYONLINE_VERSION', '1.7.3' ); // Plugin name. define( 'WPFORMS_EPFL_PAYONLINE_NAME', 'WPForms EPFL Payonline' ); // Latest WP version tested with this plugin. -define( 'WP_LATEST_VERSION_WPFORMS_EPFL_PAYONLINE', '5.5.9' ); +define( 'WP_LATEST_VERSION_WPFORMS_EPFL_PAYONLINE', '6.1.1' ); // Minimal WP version required for this plugin. define( 'WP_MIN_VERSION_WPFORMS_EPFL_PAYONLINE', '5.0' );