Plugin Directory

Changeset 3205510


Ignore:
Timestamp:
12/10/2024 10:39:51 AM (15 months ago)
Author:
wpconnectco
Message:

Update to version 2.4.0 from GitHub

Location:
add-on-cf7-for-airtable
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • add-on-cf7-for-airtable/tags/2.4.0/add-on-cf7-for-airtable.php

    r3132783 r3205510  
    77 * Text Domain: add-on-cf7-for-airtable
    88 * Domain Path: /languages/
    9  * Version: 2.3.0
     9 * Version: 2.4.0
    1010 * Requires at least: 5.7
    1111 * Requires PHP: 7.0
     
    2121 * Define plugin constants
    2222 */
    23 define( 'WPCONNECT_WPCF7_AT_VERSION', '2.3.0' );
     23define( 'WPCONNECT_WPCF7_AT_VERSION', '2.4.0' );
    2424define( 'WPCONNECT_WPCF7_AT_URL', plugin_dir_url( __FILE__ ) );
    2525define( 'WPCONNECT_WPCF7_AT_DIR', plugin_dir_path( __FILE__ ) );
  • add-on-cf7-for-airtable/tags/2.4.0/assets/js/admin.js

    r3087651 r3205510  
    9494            var selectedTableId = $('#wpc-wpcf7-airtable-table-id-selected').val();
    9595
    96             if (selectedAppId !== "" && selectedTableId !== "" && selectedTableId !== "-1") {
     96            if (selectedAppId !== "" && selectedTableId !== "" && selectedTableId !== "-1" && (selectedAppId != MyScriptData.app_id_selected || selectedTableId != MyScriptData.table_selected)) {
    9797                $('.notice-error').show();
    9898            } else {
  • add-on-cf7-for-airtable/tags/2.4.0/assets/js/admin.min.js

    r3087651 r3205510  
    1 jQuery(document).ready((function($){window.fetchAirtableTables=function(appId){var MyAjax={ajaxurl:MyScriptData.ajaxurl,nonce:MyScriptData.nonce};jQuery.ajax({url:MyAjax.ajaxurl,type:"POST",data:{action:"fetch_airtable_tables",app_id:appId,security:MyAjax.nonce},success:function(response){var tables;if(typeof response==="string"){tables=JSON.parse(response)}else{tables=response}var tableSelect=jQuery("#wpc-wpcf7-airtable-table-id-selected");tableSelect.children("option:not(:first)").remove();jQuery.each(tables,(function(index,value){tableSelect.append(jQuery("<option>",{value:index,text:value.name}))}));var prevSelectedTable=MyScriptData.table_selected;if(prevSelectedTable&&tableSelect.find('option[value="'+prevSelectedTable+'"]').length){tableSelect.val(prevSelectedTable)}else{tableSelect.val("-1")}}})};var lookUpField=$("#wpc-wpcf7-airtable-table-lookup");var showError=function(message){lookUpField.next(".error,.notice-success").remove();lookUpField.after($('<div class="error"></div>').text(message))};lookUpField.change((function(){var url=$(this).val();var base="https://airtable.com/";if(url.indexOf(base)!==0){showError(wp.i18n.__("Invalid Airtable URL","add-on-cf7-for-airtable"));return}url=url.replace(base,"");var urlParts=url.split("/");if(urlParts.length===0||urlParts.length<2){showError(wp.i18n.__("Invalid Airtable URL","add-on-cf7-for-airtable"));return}lookUpField.next(".error,.notice-success").remove();lookUpField.after($('<div class="notice notice-success"></div>').text(wp.i18n.__("Table found.","add-on-cf7-for-airtable")));$("#wpc-wpcf7-airtable-app-id-selected").val(urlParts[0]);$("#wpc-wpcf7-airtable-table-selected").val(urlParts[1])}));$("#wpc-wpcf7-airtable-enabled").change((function(){if($(this).prop("checked")){$("#wpc-wpcf7-airtable-setup-table, #wpc-wpcf7-airtable-fields-table").removeClass("is-disabled")}else{$("#wpc-wpcf7-airtable-setup-table, #wpc-wpcf7-airtable-fields-table").addClass("is-disabled")}}));$("#wpc-wpcf7-airtable-app-id-selected").each((function(){fetchAirtableTables($(this).val())}));function checkAndToggleErrorMessage(){if($("#wpc-wpcf7-airtable-app-id-selected, #wpc-wpcf7-airtable-table-id-selected").length){var selectedAppId=$("#wpc-wpcf7-airtable-app-id-selected").val();var selectedTableId=$("#wpc-wpcf7-airtable-table-id-selected").val();if(selectedAppId!==""&&selectedTableId!==""&&selectedTableId!=="-1"){$(".notice-error").show()}else{$(".notice-error").hide()}}}$("#wpc-wpcf7-airtable-app-id-selected, #wpc-wpcf7-airtable-table-id-selected").change(checkAndToggleErrorMessage);checkAndToggleErrorMessage();$(".airtable-field-select").change((function(){var selectedValue=$(this).val();updateSelectOptions(selectedValue)}));function updateSelectOptions(selectedValue){$(".airtable-field-select option").prop("disabled",false);$(".airtable-field-select").each((function(){var currentValue=$(this).val();if(currentValue){$(".airtable-field-select").not(this).find("option[value="+currentValue+"]").prop("disabled",true)}}))}updateSelectOptions()}));
     1jQuery(document).ready((function($){window.fetchAirtableTables=function(appId){var MyAjax={ajaxurl:MyScriptData.ajaxurl,nonce:MyScriptData.nonce};jQuery.ajax({url:MyAjax.ajaxurl,type:"POST",data:{action:"fetch_airtable_tables",app_id:appId,security:MyAjax.nonce},success:function(response){var tables;if(typeof response==="string"){tables=JSON.parse(response)}else{tables=response}var tableSelect=jQuery("#wpc-wpcf7-airtable-table-id-selected");tableSelect.children("option:not(:first)").remove();jQuery.each(tables,(function(index,value){tableSelect.append(jQuery("<option>",{value:index,text:value.name}))}));var prevSelectedTable=MyScriptData.table_selected;if(prevSelectedTable&&tableSelect.find('option[value="'+prevSelectedTable+'"]').length){tableSelect.val(prevSelectedTable)}else{tableSelect.val("-1")}}})};var lookUpField=$("#wpc-wpcf7-airtable-table-lookup");var showError=function(message){lookUpField.next(".error,.notice-success").remove();lookUpField.after($('<div class="error"></div>').text(message))};lookUpField.change((function(){var url=$(this).val();var base="https://airtable.com/";if(url.indexOf(base)!==0){showError(wp.i18n.__("Invalid Airtable URL","add-on-cf7-for-airtable"));return}url=url.replace(base,"");var urlParts=url.split("/");if(urlParts.length===0||urlParts.length<2){showError(wp.i18n.__("Invalid Airtable URL","add-on-cf7-for-airtable"));return}lookUpField.next(".error,.notice-success").remove();lookUpField.after($('<div class="notice notice-success"></div>').text(wp.i18n.__("Table found.","add-on-cf7-for-airtable")));$("#wpc-wpcf7-airtable-app-id-selected").val(urlParts[0]);$("#wpc-wpcf7-airtable-table-selected").val(urlParts[1])}));$("#wpc-wpcf7-airtable-enabled").change((function(){if($(this).prop("checked")){$("#wpc-wpcf7-airtable-setup-table, #wpc-wpcf7-airtable-fields-table").removeClass("is-disabled")}else{$("#wpc-wpcf7-airtable-setup-table, #wpc-wpcf7-airtable-fields-table").addClass("is-disabled")}}));function checkAndToggleErrorMessage(){if($("#wpc-wpcf7-airtable-app-id-selected, #wpc-wpcf7-airtable-table-id-selected").length){var selectedAppId=$("#wpc-wpcf7-airtable-app-id-selected").val();var selectedTableId=$("#wpc-wpcf7-airtable-table-id-selected").val();if(selectedAppId!==""&&selectedTableId!==""&&selectedTableId!=="-1"&&(selectedAppId!=MyScriptData.app_id_selected||selectedTableId!=MyScriptData.table_selected)){$(".notice-error").show()}else{$(".notice-error").hide()}}}$("#wpc-wpcf7-airtable-app-id-selected, #wpc-wpcf7-airtable-table-id-selected").change(checkAndToggleErrorMessage);checkAndToggleErrorMessage();$(".airtable-field-select").change((function(){var selectedValue=$(this).val();updateSelectOptions(selectedValue)}));function updateSelectOptions(selectedValue){$(".airtable-field-select option").prop("disabled",false);$(".airtable-field-select").each((function(){var currentValue=$(this).val();if(currentValue){$(".airtable-field-select").not(this).find("option[value="+currentValue+"]").prop("disabled",true)}}))}updateSelectOptions()}));
  • add-on-cf7-for-airtable/tags/2.4.0/includes/contact-form-properties.php

    r3087651 r3205510  
    115115            'nonce'          => wp_create_nonce( 'my-ajax-nonce' ),
    116116            'table_selected' => esc_js( $table_selected ),
     117            'app_id_selected' => esc_js( $app_id_selected ),           
    117118        );
    118119
     
    202203                                ?>
    203204                                <select name="wpc-wpcf7-airtable[app_id_selected]" id="wpc-wpcf7-airtable-app-id-selected" onchange="fetchAirtableTables(this.value)">
    204                                     <option value="" selected><?php echo esc_html__( 'Choose a base', 'add-on-cf7-for-airtable' ); ?></option>
     205                                    <option value="-1" <?= $app_id_selected == '-1' || empty($app_id_selected) ? 'selected' : '' ; ?>><?php echo esc_html__( 'Choose a base', 'add-on-cf7-for-airtable' ); ?></option>
    205206                                    <?php foreach ( $bases as $base_id => $base_name ) : ?>
    206                                         <option value="<?php echo esc_attr( $base_id ); ?>" <?php selected( $base_id, $app_id_selected ); ?>>
     207                                        <option value="<?php echo esc_attr( $base_id ); ?>"
     208                                            <?php selected( $base_id, $app_id_selected ); ?>>
    207209                                            <?php echo esc_html( $base_name['name'] ); ?>
    208210                                        </option>
     
    248250
    249251                            <td>
     252                                <?php $tables = Helpers\get_airtable_tables_token( $app_id_selected ); ?>
    250253                                <select name="wpc-wpcf7-airtable[table_selected]" id="wpc-wpcf7-airtable-table-id-selected">
    251                                     <option value="-1" selected><?php echo esc_html__( 'Choose a table', 'add-on-cf7-for-airtable' ); ?></option>
     254                                    <option value="-1" <?= $table_selected == '-1' || empty($app_id_selected) ? 'selected' : '' ; ?>><?php echo esc_html__( 'Choose a table', 'add-on-cf7-for-airtable' ); ?></option>
     255                                    <?php foreach( $tables as $table_id => $table_name ): ?>
     256                                        <option value="<?php echo esc_attr( $table_id ); ?>"
     257                                            <?php selected( $table_id, $table_selected ); ?>>
     258                                            <?php echo esc_html( $table_name['name'] ); ?>
     259                                        </option>
     260                                    <?php endforeach; ?>
    252261                                </select>
    253262                            </td>
     
    422431                                    <td>
    423432                                        <?php
     433
    424434                                        if ( $has_available_mapping ) {
    425435                                            printf( '<select class="wpc-wpf-at-field-mapper-type" name="wpc-wpcf7-airtable[map_types][%s]">', esc_attr( $tag_name ) );
     436                                            $i = 0;
    426437                                            foreach ( $options as $option_value => $option_text ) {
    427                                                 printf( '<option value="%s" %s>%s</option>', esc_attr( $option_value ), ( $selected_column_type === $option_value ? 'selected="selected"' : '' ), esc_html( $option_text ) );
     438                                                printf( '<option value="%s" %s>%s</option>', esc_attr( $option_value ), (!empty($selected_column_type) ? ($selected_column_type === $option_value ? 'selected="selected"' : '') : (!$i ? 'selected="selected"' : '' )), esc_html( $option_text ) );
     439                                                ++$i;
    428440                                            }
    429441                                            printf( '</select>' );
  • add-on-cf7-for-airtable/tags/2.4.0/languages/add-on-cf7-for-airtable.pot

    r3132783 r3205510  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: CF7 to Airtable 2.3.0\n"
     5"Project-Id-Version: CF7 to Airtable 2.4.0\n"
    66"Report-Msgid-Bugs-To: https://support.wpconnect.co/\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-08-08T07:26:39+00:00\n"
     12"POT-Creation-Date: 2024-12-06T10:02:49+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.10.0\n"
     14"X-Generator: WP-CLI 2.9.0\n"
    1515"X-Domain: add-on-cf7-for-airtable\n"
    1616
    1717#. Plugin Name of the plugin
    18 #: add-on-cf7-for-airtable.php
    1918msgid "CF7 to Airtable"
    2019msgstr ""
    2120
    2221#. Description of the plugin
    23 #: add-on-cf7-for-airtable.php
    2422msgid "Send the entries of your Contact Form 7 forms to your Airtable databases."
    2523msgstr ""
    2624
    2725#. Author of the plugin
    28 #: add-on-cf7-for-airtable.php
    2926msgid "WP connect"
    3027msgstr ""
    3128
    3229#. Author URI of the plugin
    33 #: add-on-cf7-for-airtable.php
    3430msgid "https://wpconnect.co/"
    3531msgstr ""
     
    4844
    4945#: includes/classes/class-wpcf7-airtable-service.php:71
    50 #: includes/contact-form-properties.php:132
    51 #: includes/contact-form-properties.php:467
     46#: includes/contact-form-properties.php:133
     47#: includes/contact-form-properties.php:479
    5248msgid "Airtable"
    5349msgstr ""
     
    179175msgstr ""
    180176
    181 #: includes/contact-form-properties.php:142
     177#: includes/contact-form-properties.php:143
    182178msgid "Add form submissions to your table"
    183179msgstr ""
    184180
    185 #: includes/contact-form-properties.php:157
     181#: includes/contact-form-properties.php:158
    186182msgid "Table lookup"
    187183msgstr ""
    188184
    189 #: includes/contact-form-properties.php:158
     185#: includes/contact-form-properties.php:159
    190186msgid "Paste full Airtable table URL, it will populate the Base ID and Table ID fields."
    191187msgstr ""
    192188
    193 #: includes/contact-form-properties.php:174
     189#: includes/contact-form-properties.php:175
    194190msgid "Base ID"
    195191msgstr ""
    196192
    197 #: includes/contact-form-properties.php:176
     193#: includes/contact-form-properties.php:177
    198194msgid "Use the Table lookup field above or visit the link below to find your Base ID"
    199195msgstr ""
    200196
    201 #: includes/contact-form-properties.php:192
     197#: includes/contact-form-properties.php:193
    202198msgid "Base name"
    203199msgstr ""
    204200
    205 #: includes/contact-form-properties.php:194
     201#: includes/contact-form-properties.php:195
    206202msgid "Select the target database from the options below"
    207203msgstr ""
    208204
    209 #: includes/contact-form-properties.php:204
     205#: includes/contact-form-properties.php:205
    210206msgid "Choose a base"
    211207msgstr ""
    212208
    213 #: includes/contact-form-properties.php:222
     209#: includes/contact-form-properties.php:224
    214210msgid "Table ID"
    215211msgstr ""
    216212
    217 #: includes/contact-form-properties.php:224
     213#: includes/contact-form-properties.php:226
    218214msgid "Use the Table lookup field above or visit the link below to find your Table ID"
    219215msgstr ""
    220216
    221 #: includes/contact-form-properties.php:241
     217#: includes/contact-form-properties.php:243
    222218msgid "Table name"
    223219msgstr ""
    224220
    225 #: includes/contact-form-properties.php:243
     221#: includes/contact-form-properties.php:245
    226222msgid "Select the target table from the options below."
    227223msgstr ""
    228224
    229 #: includes/contact-form-properties.php:251
     225#: includes/contact-form-properties.php:254
    230226msgid "Choose a table"
    231227msgstr ""
    232228
    233 #: includes/contact-form-properties.php:262
     229#: includes/contact-form-properties.php:271
    234230msgid "Please save your settings before mapping your fields."
    235231msgstr ""
    236232
    237 #: includes/contact-form-properties.php:287
     233#: includes/contact-form-properties.php:296
    238234msgid "Table fields"
    239235msgstr ""
    240236
    241 #: includes/contact-form-properties.php:293
     237#: includes/contact-form-properties.php:302
    242238msgid "Enter an Airtable field name for each Contact Form 7 field to map them."
    243239msgstr ""
    244240
    245 #: includes/contact-form-properties.php:297
     241#: includes/contact-form-properties.php:306
    246242msgid "Be careful, field names should be exactly the same (case sensitive) or the form won't be saved."
    247243msgstr ""
    248244
    249 #: includes/contact-form-properties.php:308
     245#: includes/contact-form-properties.php:317
    250246msgid "Starting from the 1.1.0 version, you can now specify the Airtable field type in the mapping below, please double check all types are fine."
    251247msgstr ""
    252248
    253 #: includes/contact-form-properties.php:320
     249#: includes/contact-form-properties.php:329
    254250msgid "Contact Form 7 field"
    255251msgstr ""
    256252
    257 #: includes/contact-form-properties.php:325
     253#: includes/contact-form-properties.php:334
    258254msgid "Airtable field name"
    259255msgstr ""
    260256
    261 #: includes/contact-form-properties.php:330
     257#: includes/contact-form-properties.php:339
    262258msgid "Airtable field type"
    263259msgstr ""
    264260
    265261#. translators: %s: tag name
    266 #: includes/contact-form-properties.php:366
     262#: includes/contact-form-properties.php:375
    267263msgid "%s: mapped"
    268264msgstr ""
    269265
    270 #: includes/contact-form-properties.php:450
     266#: includes/contact-form-properties.php:462
    271267msgid "The Airtable's field name below is not mapped yet:"
    272268msgid_plural "The Airtable's fields name below are not mapped yet:"
  • add-on-cf7-for-airtable/tags/2.4.0/readme.txt

    r3132783 r3205510  
    33Author URI: https://wpconnect.co/
    44Contributors: wpconnectco, staurand
    5 Tags: wpconnect, airtable, contactform7, api, forms, nocode, no-code
     5Tags: wpconnect, airtable, contactform7, api, forms
    66Requires at least: 5.7
    7 Tested up to: 6.5
     7Tested up to: 6.7
    88Requires PHP: 7.0
    9 Stable tag: 2.3.0
     9Stable tag: 2.4.0
    1010License: GPLv2 or later
    1111
     12Connect Contact Form 7 to Airtable. Automatically sync form entries with Airtable, including custom fields, for seamless data management.
     13
     14== Description ==
     15
    1216Connect the WordPress plugin Contact Form 7 to Airtable. This reliable add-on enables you to integrate your Contact Form 7 forms so that when users submit a form entry, the entries get directly added to Airtable. You can link any field type, including custom fields and add information to your Airtable table. Once the form is validated, the information entered will be added to the columns you have selected.
    13 
    1417
    1518== Features ==
     
    9699== Changelog ==
    97100
     101= 2.4.0 =
     102* Compatibility with WordPress 6.7
     103* Fix: Form edit confirmation message appearing when the form has not been modified
     104
    98105= 2.3.0 =
    99 * WordPress 6.6.1 compatibility
     106* Compatibility with WordPress 6.6
    100107* Fix: Fixed issues with field formatting.
    101108* Feature : Added the ability to define hidden fields and custom form tags for Airtable
    102109
    103110= 2.2.0 =
    104 * WordPress 6.5.0 compatibility
     111* Compatibility with WordPress 6.5
    105112* Fix: JavaScript code that is executed on all pages
    106113* Feature: Checks for CF7 form file field mapping and enhance server environment validation
    107114
    108115= 2.1.0 =
    109 * WordPress 6.4.0 compatibility
     116* Compatibility with WordPress 6.4
    110117* Feature: Sending an email to the administrator upon an API error
    111118
    112119= 2.0.0 =
    113 * WordPress 6.3.1 compatibility
     120* Compatibility with WordPress 6.3.1
    114121* Improvement: Use Airtable access tokens instead of API key
    115122* Fix: Error when using the checkbox field type
    116123
    117124= 1.1.2 =
    118 * WordPress 6.2 compatibility
     125* Compatibility with WordPress 6.2
    119126
    120127= 1.1.1 =
     
    122129
    123130= 1.1.0 =
    124 * Feature:
    125   * Selection of the Airtable field’s type
    126   * New tags
    127 * Improvement:
    128   * Links in the interface
     131* Feature: Selection of the Airtable field’s type
     132* Feature: New tags
     133* Improvement: Links in the interface
    129134
    130135= 1.0.2 =
    131136* Feature:
    132   * Activation switch
    133   * New tooltip (API key)
    134   * Setup page shortcut in plugin list
    135   * Admin notices
    136   * WP connect branding
     137  - Activation switch
     138  - New tooltip (API key)
     139  - Setup page shortcut in plugin list
     140  - Admin notices
     141  - WP connect branding
    137142* Improvement:
    138   * Help links
    139   * Tooltips style
    140   * Warning messages color
    141   * Plugin name
     143  - Help links
     144  - Tooltips style
     145  - Warning messages color
     146  - Plugin name
    142147
    143148= 1.0.1 =
    144 * Feature: compatibility with new v5.6 of Contact Form 7
     149* Feature: Compatibility with new v5.6 of Contact Form 7
    145150* Improvement: Airtable integration help link
    146151
    147 = 1.0 =
     152= 1.0.0 =
    148153* Initial release
    149154
     
    151156
    152157== Support ==
     158
    153159If you need support, open a ticket on the [Support](https://wordpress.org/support/plugin/add-on-cf7-for-airtable/).
    154160
     
    157163Make sure you have created your database and columns in Airtable before linking them to your form fields.
    158164**Supported Fields : Single line text, Email, URL, Phone number, Number, Date, Multiple select, Checkbox et Attachment**
     165
  • add-on-cf7-for-airtable/trunk/add-on-cf7-for-airtable.php

    r3132783 r3205510  
    77 * Text Domain: add-on-cf7-for-airtable
    88 * Domain Path: /languages/
    9  * Version: 2.3.0
     9 * Version: 2.4.0
    1010 * Requires at least: 5.7
    1111 * Requires PHP: 7.0
     
    2121 * Define plugin constants
    2222 */
    23 define( 'WPCONNECT_WPCF7_AT_VERSION', '2.3.0' );
     23define( 'WPCONNECT_WPCF7_AT_VERSION', '2.4.0' );
    2424define( 'WPCONNECT_WPCF7_AT_URL', plugin_dir_url( __FILE__ ) );
    2525define( 'WPCONNECT_WPCF7_AT_DIR', plugin_dir_path( __FILE__ ) );
  • add-on-cf7-for-airtable/trunk/assets/js/admin.js

    r3087651 r3205510  
    9494            var selectedTableId = $('#wpc-wpcf7-airtable-table-id-selected').val();
    9595
    96             if (selectedAppId !== "" && selectedTableId !== "" && selectedTableId !== "-1") {
     96            if (selectedAppId !== "" && selectedTableId !== "" && selectedTableId !== "-1" && (selectedAppId != MyScriptData.app_id_selected || selectedTableId != MyScriptData.table_selected)) {
    9797                $('.notice-error').show();
    9898            } else {
  • add-on-cf7-for-airtable/trunk/assets/js/admin.min.js

    r3087651 r3205510  
    1 jQuery(document).ready((function($){window.fetchAirtableTables=function(appId){var MyAjax={ajaxurl:MyScriptData.ajaxurl,nonce:MyScriptData.nonce};jQuery.ajax({url:MyAjax.ajaxurl,type:"POST",data:{action:"fetch_airtable_tables",app_id:appId,security:MyAjax.nonce},success:function(response){var tables;if(typeof response==="string"){tables=JSON.parse(response)}else{tables=response}var tableSelect=jQuery("#wpc-wpcf7-airtable-table-id-selected");tableSelect.children("option:not(:first)").remove();jQuery.each(tables,(function(index,value){tableSelect.append(jQuery("<option>",{value:index,text:value.name}))}));var prevSelectedTable=MyScriptData.table_selected;if(prevSelectedTable&&tableSelect.find('option[value="'+prevSelectedTable+'"]').length){tableSelect.val(prevSelectedTable)}else{tableSelect.val("-1")}}})};var lookUpField=$("#wpc-wpcf7-airtable-table-lookup");var showError=function(message){lookUpField.next(".error,.notice-success").remove();lookUpField.after($('<div class="error"></div>').text(message))};lookUpField.change((function(){var url=$(this).val();var base="https://airtable.com/";if(url.indexOf(base)!==0){showError(wp.i18n.__("Invalid Airtable URL","add-on-cf7-for-airtable"));return}url=url.replace(base,"");var urlParts=url.split("/");if(urlParts.length===0||urlParts.length<2){showError(wp.i18n.__("Invalid Airtable URL","add-on-cf7-for-airtable"));return}lookUpField.next(".error,.notice-success").remove();lookUpField.after($('<div class="notice notice-success"></div>').text(wp.i18n.__("Table found.","add-on-cf7-for-airtable")));$("#wpc-wpcf7-airtable-app-id-selected").val(urlParts[0]);$("#wpc-wpcf7-airtable-table-selected").val(urlParts[1])}));$("#wpc-wpcf7-airtable-enabled").change((function(){if($(this).prop("checked")){$("#wpc-wpcf7-airtable-setup-table, #wpc-wpcf7-airtable-fields-table").removeClass("is-disabled")}else{$("#wpc-wpcf7-airtable-setup-table, #wpc-wpcf7-airtable-fields-table").addClass("is-disabled")}}));$("#wpc-wpcf7-airtable-app-id-selected").each((function(){fetchAirtableTables($(this).val())}));function checkAndToggleErrorMessage(){if($("#wpc-wpcf7-airtable-app-id-selected, #wpc-wpcf7-airtable-table-id-selected").length){var selectedAppId=$("#wpc-wpcf7-airtable-app-id-selected").val();var selectedTableId=$("#wpc-wpcf7-airtable-table-id-selected").val();if(selectedAppId!==""&&selectedTableId!==""&&selectedTableId!=="-1"){$(".notice-error").show()}else{$(".notice-error").hide()}}}$("#wpc-wpcf7-airtable-app-id-selected, #wpc-wpcf7-airtable-table-id-selected").change(checkAndToggleErrorMessage);checkAndToggleErrorMessage();$(".airtable-field-select").change((function(){var selectedValue=$(this).val();updateSelectOptions(selectedValue)}));function updateSelectOptions(selectedValue){$(".airtable-field-select option").prop("disabled",false);$(".airtable-field-select").each((function(){var currentValue=$(this).val();if(currentValue){$(".airtable-field-select").not(this).find("option[value="+currentValue+"]").prop("disabled",true)}}))}updateSelectOptions()}));
     1jQuery(document).ready((function($){window.fetchAirtableTables=function(appId){var MyAjax={ajaxurl:MyScriptData.ajaxurl,nonce:MyScriptData.nonce};jQuery.ajax({url:MyAjax.ajaxurl,type:"POST",data:{action:"fetch_airtable_tables",app_id:appId,security:MyAjax.nonce},success:function(response){var tables;if(typeof response==="string"){tables=JSON.parse(response)}else{tables=response}var tableSelect=jQuery("#wpc-wpcf7-airtable-table-id-selected");tableSelect.children("option:not(:first)").remove();jQuery.each(tables,(function(index,value){tableSelect.append(jQuery("<option>",{value:index,text:value.name}))}));var prevSelectedTable=MyScriptData.table_selected;if(prevSelectedTable&&tableSelect.find('option[value="'+prevSelectedTable+'"]').length){tableSelect.val(prevSelectedTable)}else{tableSelect.val("-1")}}})};var lookUpField=$("#wpc-wpcf7-airtable-table-lookup");var showError=function(message){lookUpField.next(".error,.notice-success").remove();lookUpField.after($('<div class="error"></div>').text(message))};lookUpField.change((function(){var url=$(this).val();var base="https://airtable.com/";if(url.indexOf(base)!==0){showError(wp.i18n.__("Invalid Airtable URL","add-on-cf7-for-airtable"));return}url=url.replace(base,"");var urlParts=url.split("/");if(urlParts.length===0||urlParts.length<2){showError(wp.i18n.__("Invalid Airtable URL","add-on-cf7-for-airtable"));return}lookUpField.next(".error,.notice-success").remove();lookUpField.after($('<div class="notice notice-success"></div>').text(wp.i18n.__("Table found.","add-on-cf7-for-airtable")));$("#wpc-wpcf7-airtable-app-id-selected").val(urlParts[0]);$("#wpc-wpcf7-airtable-table-selected").val(urlParts[1])}));$("#wpc-wpcf7-airtable-enabled").change((function(){if($(this).prop("checked")){$("#wpc-wpcf7-airtable-setup-table, #wpc-wpcf7-airtable-fields-table").removeClass("is-disabled")}else{$("#wpc-wpcf7-airtable-setup-table, #wpc-wpcf7-airtable-fields-table").addClass("is-disabled")}}));function checkAndToggleErrorMessage(){if($("#wpc-wpcf7-airtable-app-id-selected, #wpc-wpcf7-airtable-table-id-selected").length){var selectedAppId=$("#wpc-wpcf7-airtable-app-id-selected").val();var selectedTableId=$("#wpc-wpcf7-airtable-table-id-selected").val();if(selectedAppId!==""&&selectedTableId!==""&&selectedTableId!=="-1"&&(selectedAppId!=MyScriptData.app_id_selected||selectedTableId!=MyScriptData.table_selected)){$(".notice-error").show()}else{$(".notice-error").hide()}}}$("#wpc-wpcf7-airtable-app-id-selected, #wpc-wpcf7-airtable-table-id-selected").change(checkAndToggleErrorMessage);checkAndToggleErrorMessage();$(".airtable-field-select").change((function(){var selectedValue=$(this).val();updateSelectOptions(selectedValue)}));function updateSelectOptions(selectedValue){$(".airtable-field-select option").prop("disabled",false);$(".airtable-field-select").each((function(){var currentValue=$(this).val();if(currentValue){$(".airtable-field-select").not(this).find("option[value="+currentValue+"]").prop("disabled",true)}}))}updateSelectOptions()}));
  • add-on-cf7-for-airtable/trunk/includes/contact-form-properties.php

    r3087651 r3205510  
    115115            'nonce'          => wp_create_nonce( 'my-ajax-nonce' ),
    116116            'table_selected' => esc_js( $table_selected ),
     117            'app_id_selected' => esc_js( $app_id_selected ),           
    117118        );
    118119
     
    202203                                ?>
    203204                                <select name="wpc-wpcf7-airtable[app_id_selected]" id="wpc-wpcf7-airtable-app-id-selected" onchange="fetchAirtableTables(this.value)">
    204                                     <option value="" selected><?php echo esc_html__( 'Choose a base', 'add-on-cf7-for-airtable' ); ?></option>
     205                                    <option value="-1" <?= $app_id_selected == '-1' || empty($app_id_selected) ? 'selected' : '' ; ?>><?php echo esc_html__( 'Choose a base', 'add-on-cf7-for-airtable' ); ?></option>
    205206                                    <?php foreach ( $bases as $base_id => $base_name ) : ?>
    206                                         <option value="<?php echo esc_attr( $base_id ); ?>" <?php selected( $base_id, $app_id_selected ); ?>>
     207                                        <option value="<?php echo esc_attr( $base_id ); ?>"
     208                                            <?php selected( $base_id, $app_id_selected ); ?>>
    207209                                            <?php echo esc_html( $base_name['name'] ); ?>
    208210                                        </option>
     
    248250
    249251                            <td>
     252                                <?php $tables = Helpers\get_airtable_tables_token( $app_id_selected ); ?>
    250253                                <select name="wpc-wpcf7-airtable[table_selected]" id="wpc-wpcf7-airtable-table-id-selected">
    251                                     <option value="-1" selected><?php echo esc_html__( 'Choose a table', 'add-on-cf7-for-airtable' ); ?></option>
     254                                    <option value="-1" <?= $table_selected == '-1' || empty($app_id_selected) ? 'selected' : '' ; ?>><?php echo esc_html__( 'Choose a table', 'add-on-cf7-for-airtable' ); ?></option>
     255                                    <?php foreach( $tables as $table_id => $table_name ): ?>
     256                                        <option value="<?php echo esc_attr( $table_id ); ?>"
     257                                            <?php selected( $table_id, $table_selected ); ?>>
     258                                            <?php echo esc_html( $table_name['name'] ); ?>
     259                                        </option>
     260                                    <?php endforeach; ?>
    252261                                </select>
    253262                            </td>
     
    422431                                    <td>
    423432                                        <?php
     433
    424434                                        if ( $has_available_mapping ) {
    425435                                            printf( '<select class="wpc-wpf-at-field-mapper-type" name="wpc-wpcf7-airtable[map_types][%s]">', esc_attr( $tag_name ) );
     436                                            $i = 0;
    426437                                            foreach ( $options as $option_value => $option_text ) {
    427                                                 printf( '<option value="%s" %s>%s</option>', esc_attr( $option_value ), ( $selected_column_type === $option_value ? 'selected="selected"' : '' ), esc_html( $option_text ) );
     438                                                printf( '<option value="%s" %s>%s</option>', esc_attr( $option_value ), (!empty($selected_column_type) ? ($selected_column_type === $option_value ? 'selected="selected"' : '') : (!$i ? 'selected="selected"' : '' )), esc_html( $option_text ) );
     439                                                ++$i;
    428440                                            }
    429441                                            printf( '</select>' );
  • add-on-cf7-for-airtable/trunk/languages/add-on-cf7-for-airtable.pot

    r3132783 r3205510  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: CF7 to Airtable 2.3.0\n"
     5"Project-Id-Version: CF7 to Airtable 2.4.0\n"
    66"Report-Msgid-Bugs-To: https://support.wpconnect.co/\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-08-08T07:26:39+00:00\n"
     12"POT-Creation-Date: 2024-12-06T10:02:49+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.10.0\n"
     14"X-Generator: WP-CLI 2.9.0\n"
    1515"X-Domain: add-on-cf7-for-airtable\n"
    1616
    1717#. Plugin Name of the plugin
    18 #: add-on-cf7-for-airtable.php
    1918msgid "CF7 to Airtable"
    2019msgstr ""
    2120
    2221#. Description of the plugin
    23 #: add-on-cf7-for-airtable.php
    2422msgid "Send the entries of your Contact Form 7 forms to your Airtable databases."
    2523msgstr ""
    2624
    2725#. Author of the plugin
    28 #: add-on-cf7-for-airtable.php
    2926msgid "WP connect"
    3027msgstr ""
    3128
    3229#. Author URI of the plugin
    33 #: add-on-cf7-for-airtable.php
    3430msgid "https://wpconnect.co/"
    3531msgstr ""
     
    4844
    4945#: includes/classes/class-wpcf7-airtable-service.php:71
    50 #: includes/contact-form-properties.php:132
    51 #: includes/contact-form-properties.php:467
     46#: includes/contact-form-properties.php:133
     47#: includes/contact-form-properties.php:479
    5248msgid "Airtable"
    5349msgstr ""
     
    179175msgstr ""
    180176
    181 #: includes/contact-form-properties.php:142
     177#: includes/contact-form-properties.php:143
    182178msgid "Add form submissions to your table"
    183179msgstr ""
    184180
    185 #: includes/contact-form-properties.php:157
     181#: includes/contact-form-properties.php:158
    186182msgid "Table lookup"
    187183msgstr ""
    188184
    189 #: includes/contact-form-properties.php:158
     185#: includes/contact-form-properties.php:159
    190186msgid "Paste full Airtable table URL, it will populate the Base ID and Table ID fields."
    191187msgstr ""
    192188
    193 #: includes/contact-form-properties.php:174
     189#: includes/contact-form-properties.php:175
    194190msgid "Base ID"
    195191msgstr ""
    196192
    197 #: includes/contact-form-properties.php:176
     193#: includes/contact-form-properties.php:177
    198194msgid "Use the Table lookup field above or visit the link below to find your Base ID"
    199195msgstr ""
    200196
    201 #: includes/contact-form-properties.php:192
     197#: includes/contact-form-properties.php:193
    202198msgid "Base name"
    203199msgstr ""
    204200
    205 #: includes/contact-form-properties.php:194
     201#: includes/contact-form-properties.php:195
    206202msgid "Select the target database from the options below"
    207203msgstr ""
    208204
    209 #: includes/contact-form-properties.php:204
     205#: includes/contact-form-properties.php:205
    210206msgid "Choose a base"
    211207msgstr ""
    212208
    213 #: includes/contact-form-properties.php:222
     209#: includes/contact-form-properties.php:224
    214210msgid "Table ID"
    215211msgstr ""
    216212
    217 #: includes/contact-form-properties.php:224
     213#: includes/contact-form-properties.php:226
    218214msgid "Use the Table lookup field above or visit the link below to find your Table ID"
    219215msgstr ""
    220216
    221 #: includes/contact-form-properties.php:241
     217#: includes/contact-form-properties.php:243
    222218msgid "Table name"
    223219msgstr ""
    224220
    225 #: includes/contact-form-properties.php:243
     221#: includes/contact-form-properties.php:245
    226222msgid "Select the target table from the options below."
    227223msgstr ""
    228224
    229 #: includes/contact-form-properties.php:251
     225#: includes/contact-form-properties.php:254
    230226msgid "Choose a table"
    231227msgstr ""
    232228
    233 #: includes/contact-form-properties.php:262
     229#: includes/contact-form-properties.php:271
    234230msgid "Please save your settings before mapping your fields."
    235231msgstr ""
    236232
    237 #: includes/contact-form-properties.php:287
     233#: includes/contact-form-properties.php:296
    238234msgid "Table fields"
    239235msgstr ""
    240236
    241 #: includes/contact-form-properties.php:293
     237#: includes/contact-form-properties.php:302
    242238msgid "Enter an Airtable field name for each Contact Form 7 field to map them."
    243239msgstr ""
    244240
    245 #: includes/contact-form-properties.php:297
     241#: includes/contact-form-properties.php:306
    246242msgid "Be careful, field names should be exactly the same (case sensitive) or the form won't be saved."
    247243msgstr ""
    248244
    249 #: includes/contact-form-properties.php:308
     245#: includes/contact-form-properties.php:317
    250246msgid "Starting from the 1.1.0 version, you can now specify the Airtable field type in the mapping below, please double check all types are fine."
    251247msgstr ""
    252248
    253 #: includes/contact-form-properties.php:320
     249#: includes/contact-form-properties.php:329
    254250msgid "Contact Form 7 field"
    255251msgstr ""
    256252
    257 #: includes/contact-form-properties.php:325
     253#: includes/contact-form-properties.php:334
    258254msgid "Airtable field name"
    259255msgstr ""
    260256
    261 #: includes/contact-form-properties.php:330
     257#: includes/contact-form-properties.php:339
    262258msgid "Airtable field type"
    263259msgstr ""
    264260
    265261#. translators: %s: tag name
    266 #: includes/contact-form-properties.php:366
     262#: includes/contact-form-properties.php:375
    267263msgid "%s: mapped"
    268264msgstr ""
    269265
    270 #: includes/contact-form-properties.php:450
     266#: includes/contact-form-properties.php:462
    271267msgid "The Airtable's field name below is not mapped yet:"
    272268msgid_plural "The Airtable's fields name below are not mapped yet:"
  • add-on-cf7-for-airtable/trunk/readme.txt

    r3132783 r3205510  
    33Author URI: https://wpconnect.co/
    44Contributors: wpconnectco, staurand
    5 Tags: wpconnect, airtable, contactform7, api, forms, nocode, no-code
     5Tags: wpconnect, airtable, contactform7, api, forms
    66Requires at least: 5.7
    7 Tested up to: 6.5
     7Tested up to: 6.7
    88Requires PHP: 7.0
    9 Stable tag: 2.3.0
     9Stable tag: 2.4.0
    1010License: GPLv2 or later
    1111
     12Connect Contact Form 7 to Airtable. Automatically sync form entries with Airtable, including custom fields, for seamless data management.
     13
     14== Description ==
     15
    1216Connect the WordPress plugin Contact Form 7 to Airtable. This reliable add-on enables you to integrate your Contact Form 7 forms so that when users submit a form entry, the entries get directly added to Airtable. You can link any field type, including custom fields and add information to your Airtable table. Once the form is validated, the information entered will be added to the columns you have selected.
    13 
    1417
    1518== Features ==
     
    9699== Changelog ==
    97100
     101= 2.4.0 =
     102* Compatibility with WordPress 6.7
     103* Fix: Form edit confirmation message appearing when the form has not been modified
     104
    98105= 2.3.0 =
    99 * WordPress 6.6.1 compatibility
     106* Compatibility with WordPress 6.6
    100107* Fix: Fixed issues with field formatting.
    101108* Feature : Added the ability to define hidden fields and custom form tags for Airtable
    102109
    103110= 2.2.0 =
    104 * WordPress 6.5.0 compatibility
     111* Compatibility with WordPress 6.5
    105112* Fix: JavaScript code that is executed on all pages
    106113* Feature: Checks for CF7 form file field mapping and enhance server environment validation
    107114
    108115= 2.1.0 =
    109 * WordPress 6.4.0 compatibility
     116* Compatibility with WordPress 6.4
    110117* Feature: Sending an email to the administrator upon an API error
    111118
    112119= 2.0.0 =
    113 * WordPress 6.3.1 compatibility
     120* Compatibility with WordPress 6.3.1
    114121* Improvement: Use Airtable access tokens instead of API key
    115122* Fix: Error when using the checkbox field type
    116123
    117124= 1.1.2 =
    118 * WordPress 6.2 compatibility
     125* Compatibility with WordPress 6.2
    119126
    120127= 1.1.1 =
     
    122129
    123130= 1.1.0 =
    124 * Feature:
    125   * Selection of the Airtable field’s type
    126   * New tags
    127 * Improvement:
    128   * Links in the interface
     131* Feature: Selection of the Airtable field’s type
     132* Feature: New tags
     133* Improvement: Links in the interface
    129134
    130135= 1.0.2 =
    131136* Feature:
    132   * Activation switch
    133   * New tooltip (API key)
    134   * Setup page shortcut in plugin list
    135   * Admin notices
    136   * WP connect branding
     137  - Activation switch
     138  - New tooltip (API key)
     139  - Setup page shortcut in plugin list
     140  - Admin notices
     141  - WP connect branding
    137142* Improvement:
    138   * Help links
    139   * Tooltips style
    140   * Warning messages color
    141   * Plugin name
     143  - Help links
     144  - Tooltips style
     145  - Warning messages color
     146  - Plugin name
    142147
    143148= 1.0.1 =
    144 * Feature: compatibility with new v5.6 of Contact Form 7
     149* Feature: Compatibility with new v5.6 of Contact Form 7
    145150* Improvement: Airtable integration help link
    146151
    147 = 1.0 =
     152= 1.0.0 =
    148153* Initial release
    149154
     
    151156
    152157== Support ==
     158
    153159If you need support, open a ticket on the [Support](https://wordpress.org/support/plugin/add-on-cf7-for-airtable/).
    154160
     
    157163Make sure you have created your database and columns in Airtable before linking them to your form fields.
    158164**Supported Fields : Single line text, Email, URL, Phone number, Number, Date, Multiple select, Checkbox et Attachment**
     165
Note: See TracChangeset for help on using the changeset viewer.