Changeset 64800 in spip-zone


Ignore:
Timestamp:
Aug 14, 2012, 3:32:03 PM (7 years ago)
Author:
julienlfy@…
Message:

v1.2.7 : Correction bug : les évènements en statut 'poubelle' étaient comptabilisés au niveau des filtres de la page ?exec=evenement_tous

Location:
_plugins_/simple_calendrier/branches/v1
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/simple_calendrier/branches/v1/changelog.txt

    r61706 r64800  
    11Plugin Simple Calendrier pour SPIP 2.1
    22------------------------------------------
     3
     41.2.7 le 14/08/2012
     5--------------------
     6- Correction : les évènements en statut 'poubelle' étaient comptabilisés au niveau des filtres de la page ?exec=evenement_tous
    37
    481.2.6 le 26/05/2012
  • _plugins_/simple_calendrier/branches/v1/exec/evenement_tous.php

    r61606 r64800  
    321321    $select1 = "distinct DATE_FORMAT(date_debut,'%Y') as annee";
    322322    $select2 = "distinct DATE_FORMAT(date_fin,'%Y') as annee";
    323     $where1 = "date_debut not like '%0000%'";
    324     $where2 = "date_fin not like '%0000%'";
     323    $where0 = "statut != 'poubelle'";
     324    $where1 = " and date_debut not like '%0000%'";
     325    $where2 = " and date_fin not like '%0000%'";
    325326   
    326327    if ($id_rubrique!=0){
     
    336337    // ----------------------
    337338       
    338     $liste_a1 = sql_allfetsel($select1, $from, $where1.$where_rub.$where_rub_exclure, "", $order_by, "");
    339     $liste_a2 = sql_allfetsel($select2, $from, $where2.$where_rub.$where_rub_exclure, "", $order_by, "");
     339    $liste_a1 = sql_allfetsel($select1, $from, $where0.$where1.$where_rub.$where_rub_exclure, "", $order_by, "");
     340    $liste_a2 = sql_allfetsel($select2, $from, $where0.$where2.$where_rub.$where_rub_exclure, "", $order_by, "");
    340341
    341342    $annees = array();
     
    359360    $tab = array();
    360361    foreach ($annees as $annee){
    361         $where = "(date_debut like '%".$annee."%' OR date_fin like '%".$annee."%')";
    362         $nb = sql_countsel($from, $where.$where_rub.$where_rub_exclure);
     362        $where = " and (date_debut like '%".$annee."%' OR date_fin like '%".$annee."%')";
     363        $nb = sql_countsel($from, $where0.$where.$where_rub.$where_rub_exclure);
    363364        $tab[] = array("annee"=>$annee, "nb"=>$nb);
    364365    }
     
    376377    $select1 = "distinct DATE_FORMAT(date_debut,'%m') as mois";
    377378    $select2 = "distinct DATE_FORMAT(date_fin,'%m') as mois";
    378     $where1 = "date_debut like '%".$annee."%'";
    379     $where2 = "date_fin like '%".$annee."%'";
     379    $where0 = "statut != 'poubelle'";
     380    $where1 = " and date_debut like '%".$annee."%'";
     381    $where2 = " and date_fin like '%".$annee."%'";
    380382    if ($id_rubrique!=0){
    381383        $where_rub = " and id_rubrique = ".$id_rubrique;
     
    390392    // ----------------------
    391393   
    392     $liste_m1 = sql_allfetsel($select1, $from, $where1.$where_rub.$where_rub_exclure, "", $order_by, "");
    393     $liste_m2 = sql_allfetsel($select2, $from, $where2.$where_rub.$where_rub_exclure, "", $order_by, "");
     394    $liste_m1 = sql_allfetsel($select1, $from, $where0.$where1.$where_rub.$where_rub_exclure, "", $order_by, "");
     395    $liste_m2 = sql_allfetsel($select2, $from, $where0.$where2.$where_rub.$where_rub_exclure, "", $order_by, "");
    394396
    395397   
     
    414416    $tab = array();
    415417    foreach ($tab_mois as $mois){
    416         $where = "(date_debut like '%".$annee."-".$mois."%' OR date_fin like '%".$annee."-".$mois."%')";
    417         $nb = sql_countsel($from, $where.$where_rub.$where_rub_exclure);
     418        $where = " and (date_debut like '%".$annee."-".$mois."%' OR date_fin like '%".$annee."-".$mois."%')";
     419        $nb = sql_countsel($from, $where0.$where.$where_rub.$where_rub_exclure);
    418420        $tab[] = array("mois"=>$mois, "nb"=>$nb);
    419421    }
     
    425427function simplecal_get_nb_tous($id_rubrique){
    426428    $from = "spip_evenements as e";
    427    
     429    $where = "e.statut != 'poubelle'";
    428430    if ($id_rubrique != 0){
    429         $where = "id_rubrique=$id_rubrique";
    430     } else {
    431         $where = "";
     431        $where .= " and id_rubrique=$id_rubrique";
    432432    }
    433433   
     
    445445function simplecal_get_nb_avenir($id_rubrique){
    446446    $from = "spip_evenements as e";
    447     $where = " (e.date_debut >= DATE_FORMAT(NOW(),'%Y-%m-%d')";
     447    $where = "e.statut != 'poubelle'";
     448    $where .= " AND (e.date_debut >= DATE_FORMAT(NOW(),'%Y-%m-%d')";
    448449    $where .= " OR e.date_fin >= DATE_FORMAT(NOW(),'%Y-%m-%d'))";
    449450   
  • _plugins_/simple_calendrier/branches/v1/plugin.xml

    r61706 r64800  
    55    <auteur>[Julien Lanfrey->http://www.spip-contrib.net/ju3873]</auteur>
    66    <licence>GPL &#169; 2010-2011</licence>
    7     <version>1.2.6</version>
     7    <version>1.2.7</version>
    88    <version_base>1.4</version_base>
    99    <etat>stable</etat>
Note: See TracChangeset for help on using the changeset viewer.