The Higher Education and Research forge

Home My Page Projects Code Snippets Project Openings MonLabo
Summary Activity Tracker Tasks Docs SCM Files Dokuwiki Continious Integration Listes Sympa

SCM Repository

authorHerve Suaudeau <herve.suaudeau@parisdescartes.fr>
Fri, 2 Oct 2020 16:51:17 +0000 (18:51 +0200)
committerHerve Suaudeau <herve.suaudeau@parisdescartes.fr>
Fri, 2 Oct 2020 16:51:17 +0000 (18:51 +0200)
admin/MonLabo-admin.php
changelog.txt
includes/MonLabo-db.php
includes/constants.php
mon-laboratoire.php

index 23f35a8..ba38980 100644 (file)
@@ -605,7 +605,6 @@ function MonLabo_get_title( $soustitre='' ) {
                        <h3>Paramètres obsolètes</h3>
                        <p>Le plugin a changé de paramètres et va se mettre à jour.<br />Merci de recharger la page.</p>
                        <br/>
-                       <p><strong>Si le message persiste, merci de désactiver et réactiver le plugin.</strong></p>
                        <p>(Ce plugin à été mis à jour à la version %s depuis  la version %s)</p>
                        </div>', 'mon-laboratoire' ), $MonLabo_menu_info['Version'], $options0['MonLabo_activated_version'] ) );
        }
index cd57228..ab7dda5 100644 (file)
@@ -89,7 +89,7 @@ Remember, check_admin_referer alone is not bulletproof security. Do not rely on
 * BUG : Correct bad redirection of buttons for modifying teams, thematics or units in the admin tab "table view"
 * BUG: Bad alphabetic order of [members_list] with people that have accents in names. Order shoud be : E < É < F
 * DESIGN : Add logo U-Paris. Suppress UPEC (non contributive since V2.0)
-* NEW FUNC: Much better configuration form for members WordPress address
+* EVOL : Much better configuration form for members WordPress address
 * CODE : Suppress warnings if database is empty
 * CODE : Detect obsolete database
 * CODE : Correct few warnings with HTML standards
@@ -102,7 +102,6 @@ Remember, check_admin_referer alone is not bulletproof security. Do not rely on
 * BUG : Correction of poor display of radio buttons in config interface.
 * DESIGN : Always display customize text config tab. Lighten functionalites config tab.
 
-
 = 3.0.5 =
 (GIT tag v3.0.5)
 * BUG : PHP error when activate multiple units mode and define no unit
@@ -280,7 +279,13 @@ Evolutions mineures ou peu visibles :
     * BUG: Signaler quand on ne peut pas rajouter une image à une personne car elle n'a pas de page WordPress
     * EVOL/BUG: Trie l'ordre des pages WordPress et les membres.
     * NLLE FONC : Ajout d'un onglet "outils avancés" : Bouton pour créer les pages manquantes des utilisateurs
-    *
+    *          $this->MonLabo_DB->delete_options();
+               $this->MonLabo_DB->delete_tables();
+               var_dump( get_option( "MonLabo_settings_group5" ));
+               $this->MonLabo_DB->fill_tables_with_default_values_if_empty();
+               $this->MonLabo_DB->fill_options_with_default_values_if_empty();
+               $options5 = get_option( "MonLabo_settings_group5" );
+               var_dump($options5);
 Evolutions mineures ou peu visibles :
 
 * CODE: Rend le code plus robuste en utilisant des comparaisons plus strictes ("===" au lieu de "==")
index 1262a6e..ecf5f27 100644 (file)
@@ -54,7 +54,7 @@ class MonLabo_db {
                global $wpdb;
                $result = $wpdb->get_results( "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}MonLabo_persons (
                          id int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
-                         wp_post_id varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+                         wp_post_id varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
                          title varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
                          first_name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
                          last_name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
@@ -355,6 +355,8 @@ class MonLabo_db {
        }
 
        public function migrate_to_version_3_1() {
+               global $wpdb;
+
                /* Transfer options ;
                MonLabo_settings_group0:MonLabo_teamGroupName_fr    --> MonLabo_settings_group5:MonLabo_custom_text_Thematic_fr
                MonLabo_settings_group0:MonLabo_teamGroupName_fr_pl --> MonLabo_settings_group5:MonLabo_custom_text_Thematics_fr
@@ -382,6 +384,9 @@ class MonLabo_db {
                delete_option( 'MonLabo_settings_group0' );
                update_option( 'MonLabo_settings_group0', $options0 );
                update_option( 'MonLabo_settings_group5', $options5 );
+
+               $row = $wpdb->get_results( "ALTER TABLE `{$wpdb->prefix}MonLabo_persons` CHANGE `wp_post_id` `wp_post_id` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL;" );
+
        }
 
        public function delete_options() {
@@ -391,6 +396,7 @@ class MonLabo_db {
                delete_option( 'MonLabo_settings_group2' );
                delete_option( 'MonLabo_settings_group3' );
                delete_option( 'MonLabo_settings_group4' );
+               delete_option( 'MonLabo_settings_group5' );
                return $this;
        }
 
index bbe6197..8d05b43 100644 (file)
@@ -7,90 +7,90 @@ defined( 'ABSPATH' ) or die( 'No direct script access allowed' );
 function get_options_DEFAULT() {
        return array(
                'MonLabo_settings_group0' => array(
-                                                                                       'MonLabo_activated_version'                             => '0',
-                                                                                       'MonLabo_publication_server_type'               => 'hal',
-                                                                                       'MonLabo_uses_members_and_groups'               => '1',
-                                                                                       'MonLabo_uses_custom_fields_for_staff'  => '0',
-                                                                                       'MonLabo_uses_unites'                                   => '0',
-                                                                                       'MonLabo_uses_thematiques'                              => '0',
+                       'MonLabo_activated_version'                             => '0',
+                       'MonLabo_publication_server_type'               => 'hal',
+                       'MonLabo_uses_members_and_groups'               => '1',
+                       'MonLabo_uses_custom_fields_for_staff'  => '0',
+                       'MonLabo_uses_unites'                                   => '0',
+                       'MonLabo_uses_thematiques'                              => '0',
                ),
                'MonLabo_settings_group1' => array(
-                                                                                       'MonLabo_nom'           => 'Centre de Neurophysique, Physiologie et Pathologie',
-                                                                                       'MonLabo_code'          => 'CNRS UMR 8119',
-                                                                                       'MonLabo_adresse'   => 'Université Paris Descartes
+                       'MonLabo_nom'           => 'Centre de Neurophysique, Physiologie et Pathologie',
+                       'MonLabo_code'          => 'CNRS UMR 8119',
+                       'MonLabo_adresse'   => 'Université Paris Descartes
 45 Rue des Saints Pères
 75270 Paris Cedex 06
 France',
-                                                                                       'MonLabo_prefixe_tel'              => '+33 1 42 86',
-                                                                                       'MonLabo_contact'                          => 'Fax : +33 (0) 1 42 86 20 80',
-                                                                                       'MonLabo_hal_publi_struct_id'   => '44477,9310',
-                                                                                       /*'MonLabo_accept_survey'                => '1',
-                                                                                       'MonLabo_plugin_info_email'      => '',*/
+                       'MonLabo_prefixe_tel'                   => '+33 1 42 86',
+                       'MonLabo_contact'                               => 'Fax : +33 (0) 1 42 86 20 80',
+                       'MonLabo_hal_publi_struct_id'   => '44477,9310',
+                       /*'MonLabo_accept_survey'               => '1',
+                       'MonLabo_plugin_info_email'      => '',*/
                ),
                'MonLabo_settings_group2' => array(
-                                                                                       'MonLabo_perso_page_parent'      => '',
-                                                                                       'MonLabo_foreground_color'        => '#00a4db',
-                                                                                       'MonLabo_address_color'          => '#aaaaaa',
-                                                                                       'MonLabo_address_size'            => '10px',
-                                                                                       'MonLabo_address_block_width'   => '180px',
-                                                                                       'MonLabo_perso_panel_width'      => '667px',
-                                                                                       'MonLabo_name_size'                      => '26px',
-                                                                                       'MonLabo_img_arrondi'              => '50%',
-                                                                                       'MonLabo_img_par_defaut'                => MonLaboLib::get_file_url( "images/photo_par_defaut.png" ),
-                                                                                       'MonLabo_custom_css'               => '',
+                       'MonLabo_perso_page_parent'             => '',
+                       'MonLabo_foreground_color'              => '#00a4db',
+                       'MonLabo_address_color'                 => '#aaaaaa',
+                       'MonLabo_address_size'                  => '10px',
+                       'MonLabo_address_block_width'   => '180px',
+                       'MonLabo_perso_panel_width'             => '667px',
+                       'MonLabo_name_size'                             => '26px',
+                       'MonLabo_img_arrondi'                   => '50%',
+                       'MonLabo_img_par_defaut'                => MonLaboLib::get_file_url( "images/photo_par_defaut.png" ),
+                       'MonLabo_custom_css'                    => '',
                ),
 
                'MonLabo_settings_group3' => array(
-                                                                                       'MonLabo_custom_fields_number'  => '1',
-                                                                                       'MonLabo_custom_field1_title'    => '',
-                                                                                       'MonLabo_custom_field2_title'    => '',
-                                                                                       'MonLabo_custom_field3_title'    => '',
-                                                                                       'MonLabo_custom_field4_title'    => '',
-                                                                                       'MonLabo_custom_field5_title'    => '',
-                                                                                       'MonLabo_custom_field6_title'    => '',
-                                                                                       'MonLabo_custom_field7_title'    => '',
-                                                                                       'MonLabo_custom_field8_title'    => '',
-                                                                                       'MonLabo_custom_field9_title'    => '',
-                                                                                       'MonLabo_custom_field10_title'  => '',
+                       'MonLabo_custom_fields_number'  => '1',
+                       'MonLabo_custom_field1_title'   => '',
+                       'MonLabo_custom_field2_title'   => '',
+                       'MonLabo_custom_field3_title'   => '',
+                       'MonLabo_custom_field4_title'   => '',
+                       'MonLabo_custom_field5_title'   => '',
+                       'MonLabo_custom_field6_title'   => '',
+                       'MonLabo_custom_field7_title'   => '',
+                       'MonLabo_custom_field8_title'   => '',
+                       'MonLabo_custom_field9_title'   => '',
+                       'MonLabo_custom_field10_title'  => '',
                ),
 
                'MonLabo_settings_group4' => array(
-                                                                                       'MonLabo_hal_publi_style'       => 'hal',
-                                                                                       'MonLabo_DescartesPubmed_api_url' => 'https://www.biomedicale.univ-paris5.fr/ufr/publications/API_publique.php',
-                                                                                       'MonLabo_DescartesPubmed_format'  => 'html_default',
+                       'MonLabo_hal_publi_style'                       => 'hal',
+                       'MonLabo_DescartesPubmed_api_url'       => 'https://www.biomedicale.univ-paris5.fr/ufr/publications/API_publique.php',
+                       'MonLabo_DescartesPubmed_format'        => 'html_default',
                ),
 
                'MonLabo_settings_group5' => array(
-                                                                                       'MonLabo_custom_text_Room_en'                                   => 'Room',
-                                                                                       'MonLabo_custom_text_Room_fr'                                   => 'Bureau',
-                                                                                       'MonLabo_custom_text_Personal_website_en'          => 'Personal website',
-                                                                                       'MonLabo_custom_text_Personal_website_fr'          => 'Site personnel',
-                                                                                       'MonLabo_custom_text_Recent_Publications_en'    => 'Recent Publications',
-                                                                                       'MonLabo_custom_text_Recent_Publications_fr'    => 'Dernières Publications',
-                                                                                       'MonLabo_custom_text_Team_leader_en'                    => 'Team leader',
-                                                                                       'MonLabo_custom_text_Team_leader_fr'                    => 'Chef d’équipe',
-                                                                                       'MonLabo_custom_text_Team_leaders_en'              => 'Team leaders',
-                                                                                       'MonLabo_custom_text_Team_leaders_fr'              => 'Chefs d’équipe',
-                                                                                       'MonLabo_custom_text_Faculty_en'                                => 'Faculty',
-                                                                                       'MonLabo_custom_text_Faculty_fr'                                => 'Chercheurs permanents',
-                                                                                       'MonLabo_custom_text_Staff_en'                            => 'Support staff',
-                                                                                       'MonLabo_custom_text_Staff_fr'                            => 'Ingénieurs et techniciens',
-                                                                                       'MonLabo_custom_text_Postdocs_en'                          => 'Postdocs',
-                                                                                       'MonLabo_custom_text_Postdocs_fr'                          => 'Postdocs',
-                                                                                       'MonLabo_custom_text_Students_en'                          => 'Students',
-                                                                                       'MonLabo_custom_text_Students_fr'                          => 'Étudiants',
-                                                                                       'MonLabo_custom_text_Visitors_en'                          => 'Visitors',
-                                                                                       'MonLabo_custom_text_Visitors_fr'                          => 'Visiteurs',
-                                                                                       'MonLabo_custom_text_Direction_en'                        => 'Direction',
-                                                                                       'MonLabo_custom_text_Direction_fr'                        => 'Direction',
-                                                                                       'MonLabo_custom_text_Member_en'                          => 'Member',
-                                                                                       'MonLabo_custom_text_Member_fr'                          => 'Membre',
-                                                                                       'MonLabo_custom_text_Members_en'                                => 'Members',
-                                                                                       'MonLabo_custom_text_Members_fr'                                => 'Membres',
-                                                                                       'MonLabo_custom_text_Thematic_en'                               => 'Thematic',
-                                                                                       'MonLabo_custom_text_Thematic_fr'                               => 'Thématique',
-                                                                                       'MonLabo_custom_text_Thematics_en'                              => 'Thematics',
-                                                                                       'MonLabo_custom_text_Thematics_fr'                              => 'Thématiques',
+                       'MonLabo_custom_text_Room_en'                           => 'Room',
+                       'MonLabo_custom_text_Room_fr'                           => 'Bureau',
+                       'MonLabo_custom_text_Personal_website_en'       => 'Personal website',
+                       'MonLabo_custom_text_Personal_website_fr'       => 'Site personnel',
+                       'MonLabo_custom_text_Recent_Publications_en'=> 'Recent Publications',
+                       'MonLabo_custom_text_Recent_Publications_fr'=> 'Dernières Publications',
+                       'MonLabo_custom_text_Team_leader_en'            => 'Team leader',
+                       'MonLabo_custom_text_Team_leader_fr'            => 'Chef d’équipe',
+                       'MonLabo_custom_text_Team_leaders_en'           => 'Team leaders',
+                       'MonLabo_custom_text_Team_leaders_fr'           => 'Chefs d’équipe',
+                       'MonLabo_custom_text_Faculty_en'                        => 'Faculty',
+                       'MonLabo_custom_text_Faculty_fr'                        => 'Chercheurs permanents',
+                       'MonLabo_custom_text_Staff_en'                          => 'Support staff',
+                       'MonLabo_custom_text_Staff_fr'                          => 'Ingénieurs et techniciens',
+                       'MonLabo_custom_text_Postdocs_en'                       => 'Postdocs',
+                       'MonLabo_custom_text_Postdocs_fr'                       => 'Postdocs',
+                       'MonLabo_custom_text_Students_en'                       => 'Students',
+                       'MonLabo_custom_text_Students_fr'                       => 'Étudiants',
+                       'MonLabo_custom_text_Visitors_en'                       => 'Visitors',
+                       'MonLabo_custom_text_Visitors_fr'                       => 'Visiteurs',
+                       'MonLabo_custom_text_Direction_en'                      => 'Direction',
+                       'MonLabo_custom_text_Direction_fr'                      => 'Direction',
+                       'MonLabo_custom_text_Member_en'                         => 'Member',
+                       'MonLabo_custom_text_Member_fr'                         => 'Membre',
+                       'MonLabo_custom_text_Members_en'                        => 'Members',
+                       'MonLabo_custom_text_Members_fr'                        => 'Membres',
+                       'MonLabo_custom_text_Thematic_en'                       => 'Thematic',
+                       'MonLabo_custom_text_Thematic_fr'                       => 'Thématique',
+                       'MonLabo_custom_text_Thematics_en'                      => 'Thematics',
+                       'MonLabo_custom_text_Thematics_fr'                      => 'Thématiques',
                ),
 
        );
index a9f1eb8..fd76232 100644 (file)
@@ -8,7 +8,7 @@ defined( 'ABSPATH' ) or die( 'No direct script access allowed' );
 * Plugin Name:       Mon Laboratoire
 * Plugin URI:        http://www.monlabo.org
 * Description:       Simplify the management of a research unit's website
-* Version:           3.0.9986
+* Version:           3.1
 * Requires at least: 4.8
 * Requires PHP:      5.4
 * License:           GPLv2 or later
@@ -21,7 +21,7 @@ defined( 'ABSPATH' ) or die( 'No direct script access allowed' );
 /* Delphine RIDER was co-author before versions v2.0 */
 
 //Currently plugin version, use SemVer - https://semver.org
-function get_version() { return '3.0.9986'; }
+function get_version() { return '3.1'; }
 
 ///////////////////////////////////////////////////////////////////////////////////////////
 //                                        PLUGIN CLASS DEFINITIONS