Plugin Directory

Changeset 3389416


Ignore:
Timestamp:
11/04/2025 08:11:33 AM (5 months ago)
Author:
closemarketing
Message:

Update to version 4.0.5 from GitHub

Location:
formscrm
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • formscrm/tags/4.0.5/formscrm.php

    r3378252 r3389416  
    22/**
    33 * Plugin Name: FormsCRM
    4  * Plugin URI: https://close.technology/wordpress-plugins/formscrm/
     4 * Plugin URI : https://close.technology/wordpress-plugins/formscrm/
    55 * Description: Connects Forms with CRM, ERP and Email Marketing.
    6  * Version:     4.0.4
    7  * Author:      CloseTechnology
    8  * Author URI:  https://close.technology
     6 * Version: 4.0.5
     7 * Author: CloseTechnology
     8 * Author URI: https://close.technology
    99 * Text Domain: formscrm
    1010 * Domain Path: /languages
    11  * License:     GPL-2.0+
     11 * License: GPL-2.0+
    1212 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
    1313 *
     
    2424defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
    2525
    26 define( 'FORMSCRM_VERSION', '4.0.4' );
     26define( 'FORMSCRM_VERSION', '4.0.5' );
    2727define( 'FORMSCRM_PLUGIN', __FILE__ );
    2828define( 'FORMSCRM_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • formscrm/tags/4.0.5/includes/formscrm-library/class-contactform7.php

    r3290078 r3389416  
    177177                        </select>
    178178                    </p>
    179 
     179                    <p>
     180                        <label for="wpcf7-crm-fc_crm_mode_expert"><?php esc_html_e( 'Expert Mode', 'formscrm' ); ?></label><br />
     181                        <input type="checkbox" id="wpcf7-crm-fc_crm_mode_expert" name="wpcf7-crm[fc_crm_mode_expert]" class="medium" value="on" <?php checked( $cf7_crm['fc_crm_mode_expert'], 'on' ); ?> /><?php esc_html_e( 'Enable this option to show all fields of the CRM.', 'formscrm' ); ?>
     182                    </p>
    180183                <?php } ?>
    181184            </div>
     
    288291        // Create contact in CRM.
    289292        $this->include_library( $crm_type );
     293        if ( empty( $this->crmlib ) ) {
     294            return;
     295        }
    290296        $merge_vars      = $this->get_merge_vars( $cf7_crm, $submission->get_posted_data() );
    291297        $response_result = $this->crmlib->create_entry( $cf7_crm, $merge_vars );
     
    306312     * @return array
    307313     */
    308     private function get_merge_vars( $cf7_crm, $submitted_data ) {
     314    public function get_merge_vars( $cf7_crm, $submitted_data ) {
     315        if ( empty( $cf7_crm ) || ! is_array( $cf7_crm ) ) {
     316            return array();
     317        }
    309318        $merge_vars = array();
    310319        foreach ( $cf7_crm as $key => $value ) {
    311             if ( false !== strpos( $key, 'fc_crm_field' ) ) {
    312                 $crm_key = str_replace( 'fc_crm_field-', '', $key );
    313 
    314                 if ( ! empty( $submitted_data[ $value ] ) ) {
    315                     $value = $submitted_data[ $value ];
    316                 }
    317 
    318                 $merge_vars[] = array(
    319                     'name'  => $crm_key,
    320                     'value' => $value,
    321                 );
    322             }
     320            if ( false === strpos( $key, 'fc_crm_field' ) ) {
     321                continue;
     322            }
     323            $crm_key = str_replace( 'fc_crm_field-', '', $key );
     324
     325            if ( ! empty( $submitted_data[ $value ] ) ) {
     326                $value = $submitted_data[ $value ];
     327            }
     328
     329            if ( is_array( $value ) ) {
     330                $value = implode( ',', $value );
     331            }
     332
     333            $merge_vars[] = array(
     334                'name'  => $crm_key,
     335                'value' => $value,
     336            );
    323337        }
    324338
  • formscrm/tags/4.0.5/includes/formscrm-library/class-elementor.php

    r3310866 r3389416  
    203203                    'fc_crm_type' => formscrm_get_dependency_odoodb(),
    204204                ),
     205            )
     206        );
     207
     208        // Expert Mode.
     209        $widget->add_control(
     210            'fc_crm_mode_expert',
     211            array(
     212                'label' => __( 'Expert Mode', 'formscrm' ),
     213                'type'  => \Elementor\Controls_Manager::SWITCHER,
    205214            )
    206215        );
  • formscrm/tags/4.0.5/includes/formscrm-library/class-gravityforms.php

    r3378252 r3389416  
    169169     */
    170170    public function plugin_settings_fields() {
     171        $fields = array();
     172        $fields = $this->get_crm_fields( true, array(), 'settings' );
     173
     174        // Expert Mode.
     175        $fields = array_merge(
     176            $fields,
     177            array(
     178                array(
     179                    'label'   => __( 'Mode', 'formscrm' ),
     180                    'type'    => 'checkbox',
     181                    'name'    => 'fc_crm_mode_expert',
     182                    'tooltip' => __( 'Enable this option to show all fields of the CRM.', 'formscrm' ),
     183                    'choices' => array(
     184                        array(
     185                            'label' => __( 'Enable Expert Mode', 'formscrm' ),
     186                            'name'  => 'fc_crm_mode_expert',
     187                        ),
     188                    ),
     189                ),
     190            ),
     191        );
     192
    171193        return array(
    172194            array(
    173195                'title'       => __( 'CRM Account Information', 'formscrm' ),
    174196                'description' => __( 'Use this connector with CRM software. Use Gravity Forms to collect customer information and automatically add them to your CRM Leads.', 'formscrm' ),
    175                 'fields'      => $this->get_crm_fields( true, array(), 'settings'),
     197                'fields'      => $fields,
    176198            ),
    177199        );
    178200    }
    179201
     202    /**
     203     * Settings API Key
     204     *
     205     * @param array $field Field.
     206     * @param bool  $echo Echo.
     207     * @return string
     208     */
    180209    public function settings_api_key( $field, $echo = true ) {
    181210
    182211        $field['type'] = 'text';
    183 
    184212        $api_key_field = $this->settings_text( $field, false );
    185213
    186         //switch type="text" to type="password" so the key is not visible
    187         $api_key_field = str_replace('type="text"', 'type="password"', $api_key_field);
     214        // Switch type="text" to type="password" so the key is not visible.
     215        $api_key_field = str_replace( 'type="text"', 'type="password"', $api_key_field );
    188216
    189217        $caption = '<small>' . sprintf( esc_html__( 'Find a Password or API key depending of CRM.', 'formscrm' ) ) . '</small>';
  • formscrm/tags/4.0.5/includes/formscrm-library/class-wpforms.php

    r3290078 r3389416  
    600600        );
    601601
     602        printf(
     603            '<input type="checkbox" name="fc_crm_mode_expert" class="fc_crm_mode_expert" value="on" /><label for="fc_crm_mode_expert">%s</label>',
     604            esc_html__( 'Enable Expert Mode', 'formscrm' )
     605        );
     606
    602607        $js_dependency = '';
    603608        foreach ( formscrm_get_choices() as $crm ) {
  • formscrm/tags/4.0.5/readme.txt

    r3378252 r3389416  
    55Requires at least: 5.5
    66Tested up to: 6.8
    7 Stable tag: 4.0.4
    8 Version: 4.0.4
     7Stable tag: 4.0.5
     8Version: 4.0.5
    99License: GPL2
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    4949- [WHMCS](https://close.technology/en/wordpress-plugins/formscrm-whmcs/)
    5050
    51 You can use multiple feed connector in GravityForms, WPForms PRO and ContactForm7, and you can use multiple CRM connectors in the same form.
     51You can use multiple feed connector in GravityForms, WPForms PRO, Elementor Forms and ContactForm7, and you can use multiple CRM connectors in the same form.
    5252
    5353Demo:
     
    5959{label:N} in order to get the label from field N (only in GravityForms)
    6060
     61**Expert Mode**
     62You can enable Expert Mode in the form feed. This mode will show all fields of the CRM in the form mapping. This is useful if you want to connect all fields of the CRM to the form. Now currently works for Odoo.
     63
    6164We recommend to use this in the field mapping in the feed and hidden field that gets the value.
    6265
     
    8689
    8790== Changelog ==
     91= 4.0.5 =
     92*  Fixed: CF7 custom fields with select fields not sending.
     93*  Added: Expert Mode.
     94*  Fixed: Fatal errors in CF7.
    8895
    8996= 4.0.4 =
  • formscrm/trunk/formscrm.php

    r3378252 r3389416  
    22/**
    33 * Plugin Name: FormsCRM
    4  * Plugin URI: https://close.technology/wordpress-plugins/formscrm/
     4 * Plugin URI : https://close.technology/wordpress-plugins/formscrm/
    55 * Description: Connects Forms with CRM, ERP and Email Marketing.
    6  * Version:     4.0.4
    7  * Author:      CloseTechnology
    8  * Author URI:  https://close.technology
     6 * Version: 4.0.5
     7 * Author: CloseTechnology
     8 * Author URI: https://close.technology
    99 * Text Domain: formscrm
    1010 * Domain Path: /languages
    11  * License:     GPL-2.0+
     11 * License: GPL-2.0+
    1212 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
    1313 *
     
    2424defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
    2525
    26 define( 'FORMSCRM_VERSION', '4.0.4' );
     26define( 'FORMSCRM_VERSION', '4.0.5' );
    2727define( 'FORMSCRM_PLUGIN', __FILE__ );
    2828define( 'FORMSCRM_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • formscrm/trunk/includes/formscrm-library/class-contactform7.php

    r3290078 r3389416  
    177177                        </select>
    178178                    </p>
    179 
     179                    <p>
     180                        <label for="wpcf7-crm-fc_crm_mode_expert"><?php esc_html_e( 'Expert Mode', 'formscrm' ); ?></label><br />
     181                        <input type="checkbox" id="wpcf7-crm-fc_crm_mode_expert" name="wpcf7-crm[fc_crm_mode_expert]" class="medium" value="on" <?php checked( $cf7_crm['fc_crm_mode_expert'], 'on' ); ?> /><?php esc_html_e( 'Enable this option to show all fields of the CRM.', 'formscrm' ); ?>
     182                    </p>
    180183                <?php } ?>
    181184            </div>
     
    288291        // Create contact in CRM.
    289292        $this->include_library( $crm_type );
     293        if ( empty( $this->crmlib ) ) {
     294            return;
     295        }
    290296        $merge_vars      = $this->get_merge_vars( $cf7_crm, $submission->get_posted_data() );
    291297        $response_result = $this->crmlib->create_entry( $cf7_crm, $merge_vars );
     
    306312     * @return array
    307313     */
    308     private function get_merge_vars( $cf7_crm, $submitted_data ) {
     314    public function get_merge_vars( $cf7_crm, $submitted_data ) {
     315        if ( empty( $cf7_crm ) || ! is_array( $cf7_crm ) ) {
     316            return array();
     317        }
    309318        $merge_vars = array();
    310319        foreach ( $cf7_crm as $key => $value ) {
    311             if ( false !== strpos( $key, 'fc_crm_field' ) ) {
    312                 $crm_key = str_replace( 'fc_crm_field-', '', $key );
    313 
    314                 if ( ! empty( $submitted_data[ $value ] ) ) {
    315                     $value = $submitted_data[ $value ];
    316                 }
    317 
    318                 $merge_vars[] = array(
    319                     'name'  => $crm_key,
    320                     'value' => $value,
    321                 );
    322             }
     320            if ( false === strpos( $key, 'fc_crm_field' ) ) {
     321                continue;
     322            }
     323            $crm_key = str_replace( 'fc_crm_field-', '', $key );
     324
     325            if ( ! empty( $submitted_data[ $value ] ) ) {
     326                $value = $submitted_data[ $value ];
     327            }
     328
     329            if ( is_array( $value ) ) {
     330                $value = implode( ',', $value );
     331            }
     332
     333            $merge_vars[] = array(
     334                'name'  => $crm_key,
     335                'value' => $value,
     336            );
    323337        }
    324338
  • formscrm/trunk/includes/formscrm-library/class-elementor.php

    r3310866 r3389416  
    203203                    'fc_crm_type' => formscrm_get_dependency_odoodb(),
    204204                ),
     205            )
     206        );
     207
     208        // Expert Mode.
     209        $widget->add_control(
     210            'fc_crm_mode_expert',
     211            array(
     212                'label' => __( 'Expert Mode', 'formscrm' ),
     213                'type'  => \Elementor\Controls_Manager::SWITCHER,
    205214            )
    206215        );
  • formscrm/trunk/includes/formscrm-library/class-gravityforms.php

    r3378252 r3389416  
    169169     */
    170170    public function plugin_settings_fields() {
     171        $fields = array();
     172        $fields = $this->get_crm_fields( true, array(), 'settings' );
     173
     174        // Expert Mode.
     175        $fields = array_merge(
     176            $fields,
     177            array(
     178                array(
     179                    'label'   => __( 'Mode', 'formscrm' ),
     180                    'type'    => 'checkbox',
     181                    'name'    => 'fc_crm_mode_expert',
     182                    'tooltip' => __( 'Enable this option to show all fields of the CRM.', 'formscrm' ),
     183                    'choices' => array(
     184                        array(
     185                            'label' => __( 'Enable Expert Mode', 'formscrm' ),
     186                            'name'  => 'fc_crm_mode_expert',
     187                        ),
     188                    ),
     189                ),
     190            ),
     191        );
     192
    171193        return array(
    172194            array(
    173195                'title'       => __( 'CRM Account Information', 'formscrm' ),
    174196                'description' => __( 'Use this connector with CRM software. Use Gravity Forms to collect customer information and automatically add them to your CRM Leads.', 'formscrm' ),
    175                 'fields'      => $this->get_crm_fields( true, array(), 'settings'),
     197                'fields'      => $fields,
    176198            ),
    177199        );
    178200    }
    179201
     202    /**
     203     * Settings API Key
     204     *
     205     * @param array $field Field.
     206     * @param bool  $echo Echo.
     207     * @return string
     208     */
    180209    public function settings_api_key( $field, $echo = true ) {
    181210
    182211        $field['type'] = 'text';
    183 
    184212        $api_key_field = $this->settings_text( $field, false );
    185213
    186         //switch type="text" to type="password" so the key is not visible
    187         $api_key_field = str_replace('type="text"', 'type="password"', $api_key_field);
     214        // Switch type="text" to type="password" so the key is not visible.
     215        $api_key_field = str_replace( 'type="text"', 'type="password"', $api_key_field );
    188216
    189217        $caption = '<small>' . sprintf( esc_html__( 'Find a Password or API key depending of CRM.', 'formscrm' ) ) . '</small>';
  • formscrm/trunk/includes/formscrm-library/class-wpforms.php

    r3290078 r3389416  
    600600        );
    601601
     602        printf(
     603            '<input type="checkbox" name="fc_crm_mode_expert" class="fc_crm_mode_expert" value="on" /><label for="fc_crm_mode_expert">%s</label>',
     604            esc_html__( 'Enable Expert Mode', 'formscrm' )
     605        );
     606
    602607        $js_dependency = '';
    603608        foreach ( formscrm_get_choices() as $crm ) {
  • formscrm/trunk/readme.txt

    r3378252 r3389416  
    55Requires at least: 5.5
    66Tested up to: 6.8
    7 Stable tag: 4.0.4
    8 Version: 4.0.4
     7Stable tag: 4.0.5
     8Version: 4.0.5
    99License: GPL2
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    4949- [WHMCS](https://close.technology/en/wordpress-plugins/formscrm-whmcs/)
    5050
    51 You can use multiple feed connector in GravityForms, WPForms PRO and ContactForm7, and you can use multiple CRM connectors in the same form.
     51You can use multiple feed connector in GravityForms, WPForms PRO, Elementor Forms and ContactForm7, and you can use multiple CRM connectors in the same form.
    5252
    5353Demo:
     
    5959{label:N} in order to get the label from field N (only in GravityForms)
    6060
     61**Expert Mode**
     62You can enable Expert Mode in the form feed. This mode will show all fields of the CRM in the form mapping. This is useful if you want to connect all fields of the CRM to the form. Now currently works for Odoo.
     63
    6164We recommend to use this in the field mapping in the feed and hidden field that gets the value.
    6265
     
    8689
    8790== Changelog ==
     91= 4.0.5 =
     92*  Fixed: CF7 custom fields with select fields not sending.
     93*  Added: Expert Mode.
     94*  Fixed: Fatal errors in CF7.
    8895
    8996= 4.0.4 =
Note: See TracChangeset for help on using the changeset viewer.