Plugin Directory

Changeset 3309829


Ignore:
Timestamp:
06/11/2025 01:35:04 PM (7 months ago)
Author:
plugcrux
Message:

Release 1.0.7 - updated JavaScript, PHP files, and readme.txt

Location:
crm-integration-freshworks-any-form
Files:
81 added
8 edited

Legend:

Unmodified
Added
Removed
  • crm-integration-freshworks-any-form/trunk/assets/js/options.js

    r3256911 r3309829  
    33    var selectedValue = jQuery(this).val().trim(); // Get selected value
    44    var numberList = '<div class="number-list">';
    5     console.log(selectedValue);
    65    var optionStatus=false;
    76     // Remove existing info-icon and popup-message if they exist
  • crm-integration-freshworks-any-form/trunk/assets/js/setup-fm.js

    r3256911 r3309829  
    159159               // Assuming response.data contains the JSON with field details
    160160                const crm_fields = response.data.crm_fields.fields;
    161                 console.log(crm_fields);
    162161                fwFields = crm_fields
    163162                    .map(field => [
  • crm-integration-freshworks-any-form/trunk/crm-integration-freshworks-any-form.php

    r3288838 r3309829  
    55 * Plugin URI: https://integrazo.com/products/freshworks-crm-integration-with-any-form
    66 * Description: Automatically send contact form submissions from popular WordPress forms to Freshsales (Freshworks CRM) and grow your business.
    7  * Version: 1.0.6
     7 * Version: 1.0.7
    88 * Author: Integrazo
    99 * Author URI: https://integrazo.com/
  • crm-integration-freshworks-any-form/trunk/readme.txt

    r3288838 r3309829  
    55Tested up to: 6.8
    66Requires PHP: 7.0
    7 Stable tag: 1.0.6
     7Stable tag: 1.0.7
    88License: GPLv2 or later 
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    432432== Changelog ==
    433433
     434= 1.0.7 = 
     435**Fixed:** Elementor Forms field-loading issue
     436
    434437= 1.0.6 = 
    435438**Added:** Improved validation and sanitization 
  • crm-integration-freshworks-any-form/trunk/src/forms/form-fields.php

    r3213111 r3309829  
    313313         * @return array Array of form fields, each containing the field ID, label, and type.
    314314         */
    315         public function getElementorFormFields($form_id)
     315        /*  public function getElementorFormFieldsNew($form_id)
    316316        {
    317317            global $wpdb;
     
    373373                }
    374374            }
    375 
    376             return $form_fields;
    377         }
    378 
     375            return $form_fields;
     376        }*/
     377
     378        public function getElementorFormFields($form_id)
     379        {
     380            $form_fields = [];
     381
     382            // ✅ Check if Elementor Pro class exists
     383            if (! class_exists('\ElementorPro\Modules\Forms\Submissions\Database\Repositories\Form_Snapshot_Repository')) {
     384                return $form_fields;
     385            }
     386
     387            try {
     388                $formsnaps = \ElementorPro\Modules\Forms\Submissions\Database\Repositories\Form_Snapshot_Repository::instance()->all();
     389
     390                foreach ($formsnaps as $form) {
     391                    if ($form->id === $form_id) {
     392                        // ✅ Found matching form ID → now get fields
     393                        if (!empty($form->fields) && is_array($form->fields)) {
     394                            foreach ($form->fields as $field) {
     395                                $form_fields[] = [
     396                                    'key'    => $field['id'] ?? '',
     397                                    'label'  => $field['label'] ?? '',
     398                                    'type'   => $field['type'] ?? 'text',
     399                                    'source' => 'form'
     400                                ];
     401                            }
     402                        }
     403                        break; // ✅ Form found → no need to check others
     404                    }
     405                }
     406                return $form_fields;
     407            } catch (Throwable $e) {
     408                return $form_fields;
     409            }
     410        }
    379411
    380412
  • crm-integration-freshworks-any-form/trunk/src/forms/form-group-ids.php

    r3213111 r3309829  
    271271         * @return array Array of forms with their IDs, names, and fields.
    272272         */
    273         public function getElementorForms()
     273        /* public function getElementorForms()
    274274        {
    275275            global $wpdb;
     
    327327                return $form_list;
    328328            }
     329        }*/
     330        public function getElementorForms()
     331        {
     332            $form_list = [];
     333
     334            if (! class_exists('\ElementorPro\Modules\Forms\Submissions\Database\Repositories\Form_Snapshot_Repository')) {
     335                return $form_list; // Return empty if class not found
     336            }
     337
     338            try {
     339                $formsnaps = \ElementorPro\Modules\Forms\Submissions\Database\Repositories\Form_Snapshot_Repository::instance()->all();
     340
     341                foreach ($formsnaps as $form) {
     342                    $page_title = get_the_title($form->post_id);
     343
     344                    $form_list[] = [
     345                        'id'   => $form->id,
     346                        'name' => $form->name . ' - ' . $page_title,
     347                    ];
     348                }
     349
     350                return $form_list;
     351            } catch (Throwable $e) {
     352                return $form_list;
     353            }
    329354        }
    330355    }
  • crm-integration-freshworks-any-form/trunk/src/forms/form-name.php

    r3213111 r3309829  
    9999         * Retrieves the name of an Elementor Form by form ID.
    100100         */
    101         public function getElementorFormName($form_id)
     101        /* public function getElementorFormName($form_id)
    102102        {
    103103            global $wpdb;
     
    135135
    136136            return __('Unknown Form', 'crm-integration-freshworks-any-form');
     137        }*/
     138
     139        public function getElementorFormName($form_id)
     140        {
     141            // Return empty string by default
     142            $form_name = '';
     143
     144            // ✅ Check if Elementor Pro class exists
     145            if (! class_exists('\ElementorPro\Modules\Forms\Submissions\Database\Repositories\Form_Snapshot_Repository')) {
     146                return $form_name;
     147            }
     148
     149            try {
     150                $formsnaps = \ElementorPro\Modules\Forms\Submissions\Database\Repositories\Form_Snapshot_Repository::instance()->all();
     151
     152                foreach ($formsnaps as $form) {
     153                    if ($form->id === $form_id) {
     154                        $page_title = get_the_title($form->post_id);
     155                        $form_name = $form->name . ' - ' . $page_title;
     156                        break; // Found → exit loop
     157                    }
     158                }
     159
     160                return $form_name;
     161            } catch (Throwable $e) {
     162                return $form_name; // return empty string if error
     163            }
    137164        }
    138 
    139165
    140166
  • crm-integration-freshworks-any-form/trunk/src/forms/submit-action.php

    r3208186 r3309829  
    2727
    2828            // Add Everest Forms submission hook
    29             // add_action('everest_forms_process_complete', [$this, 'process_everestforms_submission'], 10, 4);
    30 
    31             // Hook for Elementor Pro form submissions
     29
    3230            add_action('elementor_pro/forms/new_record', [$this, 'process_elementor_form_submission'], 10, 2);
    3331        }
     
    439437            $integrazo_fwcrm_form_fieldMappingDBInstance = new integrazo_fwcrm_form_FieldMapping();
    440438            try {
     439                $form_details = $handler->get_current_form();
     440                $form_id = $form_details['id'];
    441441                // Retrieve form ID and group ID
    442                 $form_settings = $record->get('form_settings'); // Get form settings
    443                 $form_id = $form_settings['id'] ?? 'unknown_form_id'; // Retrieve the correct form ID
     442                // $form_settings = $record->get('form_settings'); // Get form settings
     443                // $form_id = $form_settings['id'] ?? 'unknown_form_id'; // Retrieve the correct form ID
    444444                $form_group_id = 7; // Set form group ID for Elementor Forms
    445445
Note: See TracChangeset for help on using the changeset viewer.