Changeset 112438 in spip-zone for _plugins_/mailsubscribers


Ignore:
Timestamp:
Nov 15, 2018, 12:34:25 PM (5 weeks ago)
Author:
cedric@…
Message:

quand un subscriber est desinscrit d'une liste, il doit etre aussi enleve des segments de cette liste, qu'ils soient en mise a jour auto ou non

Location:
_plugins_/mailsubscribers/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/mailsubscribers/trunk/inc/mailsubscribinglists.php

    r112420 r112438  
    3131 * Mettre a jour tous les segments de toutes les listes d'un subscriber
    3232 * @param $id_mailsubscriber
    33  * @param bool $force
     33 * @param bool|array $force
     34 *   true ou liste de $id_mailsubscribinglist sur lesquels on veut forcer la mise a jour
    3435 */
    3536function mailsubscribers_actualise_segments($id_mailsubscriber, $force = false){
     
    4041        sql_delete('spip_mailsubscriptions', 'id_mailsubscriber='.intval($id_mailsubscriber).' AND id_segment>0 AND '.sql_in('id_mailsubscribinglist',$ids,'NOT'));
    4142        foreach ($ids as $id_mailsubscribinglist){
    42                 mailsubscribers_actualise_mailsubscribinglist_segments($id_mailsubscriber, $id_mailsubscribinglist, $force);
     43                $force_this = (is_array($force) ? in_array($id_mailsubscribinglist, $force) : $force);
     44                mailsubscribers_actualise_mailsubscribinglist_segments($id_mailsubscriber, $id_mailsubscribinglist, $force_this);
    4345        }
    4446       
  • _plugins_/mailsubscribers/trunk/newsletter/unsubscribe.php

    r112420 r112438  
    125125                        // actualiser les segments en auto_update
    126126                        include_spip('inc/mailsubscribinglists');
    127                         mailsubscribers_actualise_segments($row['id_mailsubscriber']);
     127                        $unsubscribed_lists = array();
     128                        if ($notify) {
     129                                $unsubscribed_lists = array_column($notify, 'id_mailsubscribinglist');
     130                        }
     131                        mailsubscribers_actualise_segments($row['id_mailsubscriber'], $unsubscribed_lists);
    128132                }
    129133
  • _plugins_/mailsubscribers/trunk/paquet.xml

    r112420 r112438  
    22        prefix="mailsubscribers"
    33        categorie="communication"
    4         version="2.9.6"
     4        version="2.9.7"
    55        etat="stable"
    66        compatibilite="[3.0.0;3.2.*]"
Note: See TracChangeset for help on using the changeset viewer.