Plugin Directory

Changeset 3407088


Ignore:
Timestamp:
12/01/2025 05:19:15 PM (4 months ago)
Author:
formdev
Message:

1.2.5 fix objectifs & txtWeb

Location:
formdev/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • formdev/trunk/api/Formdev.php

    r3369443 r3407088  
    332332        if($sessions->maxCount > 24){
    333333            $pages = $sessions->maxCount/24;
     334            $pages = ceil($pages);
    334335            $i = 1;
    335336            while ($i <= $pages) {
     
    352353        ];
    353354        $where = ['meta_key' => 'sessions'];
    354         $updated = $wpdb->update($table_name, $meta, $where);
     355        $existing_meta = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->prefix}formdev_metas WHERE meta_key = %s LIMIT 1", 'sessions'));
     356        if(isset($existing_meta->meta_key)){
     357            $updated = $wpdb->update($table_name, $meta, $where);
     358        }else{
     359            $meta['meta_key'] = 'sessions';
     360            $meta['created_at'] = gmdate('Y-m-d H:i:s');
     361            $wpdb->insert($table_name, $meta);
     362        }
    355363
    356364        $societes = $this->call('societe/liste');
     
    629637        ));
    630638
     639        $post_content = !empty($data->txtWeb) ? $data->txtWeb : '';
     640        if(empty($post_content)){
     641            $post_content = !empty($data->programme) ? $data->programme : 'Aucune description disponible';
     642        }
     643       
    631644        if (!$product_id) {
    632645            // Créer le produit
    633646            $product_id = wp_insert_post([
    634647                'post_title'   => $data->nomFormation,
    635                 'post_content' => !empty($data->objectifs) ? $data->objectifs : 'Aucune description disponible',
     648                'post_content' => $post_content,
    636649                'post_status'  => 'publish',
    637650                'post_type'    => 'product',
     
    663676            'ID'           => $product_id,
    664677            'post_title'   => $data->nomFormation,
    665             'post_content' => !empty($data->objectifs) ? $data->objectifs : 'Aucune description disponible',
     678            'post_content' => $post_content,
    666679            'post_status'  => $post_status,
    667680        ];
  • formdev/trunk/formdev.php

    r3388965 r3407088  
    55 * Plugin URI: https://www.form-dev.fr
    66 * Description: Synchroniser automatiquement les formations présentes dans votre CRM Formdev
    7  * Version: 1.2.4
     7 * Version: 1.2.5
    88 * Author: Formdev
    99 * Author URI: https://app.form-dev.fr
     
    1616// Définition de la version du plugin
    1717if (!defined('FORMEDEV_VERSION')) {
    18     define('FORMEDEV_VERSION', '1.2.3');
     18    define('FORMEDEV_VERSION', '1.2.5');
    1919}
    2020
  • formdev/trunk/readme.txt

    r3388965 r3407088  
    55Tested up to: 6.8 
    66Requires PHP: 7.4 
    7 Stable tag: 1.2.4
     7Stable tag: 1.2.5
    88License: GPLv2 or later 
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html 
     
    6868
    6969== Changelog ==
     70= 1.2.5 =
     71* fix objectifs & txtWeb
     72
    7073= 1.2.4 =
    7174* add qualifIntervenant & remove HT
Note: See TracChangeset for help on using the changeset viewer.