Fix MapView/AddressesView for UserSet.
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 29 Nov 2013 20:01:40 +0000 (21:01 +0100)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 29 Nov 2013 20:01:51 +0000 (21:01 +0100)
include/userset.inc.php

index 724c376..c3ff5ac 100644 (file)
@@ -383,12 +383,12 @@ class MapView implements PlView
         Platal::load('geoloc');
 
         if (Get::b('ajax')) {
-            $pids = $this->set->getIds(new PlLimit());
+            $uids = $this->set->getIds(new PlLimit());
+            $pids = Profile::getPIDsFromUIDs($uids);
             GeolocModule::assign_json_to_map($page, $pids);
             $page->runJSON();
             exit;
         } else {
-            $this->set->getIds(new PlLimit());
             GeolocModule::prepare_map($page);
             return 'geoloc/index.tpl';
         }
@@ -459,7 +459,12 @@ class AddressesView implements PlView
 
     public function apply(PlPage $page)
     {
-        $pids = $this->set->getIds(new PlLimit());
+        if ($this->set instanceof UserSet) {
+            $uids = $this->set->getIds(new PlLimit());
+            $pids = Profile::getPIDsFromUIDs($uids);
+        } else {
+            $pids = $this->set->getIds(new PlLimit());
+        }
         $visibility = Visibility::defaultForRead(Visibility::VIEW_AX);
         pl_cached_content_headers('text/x-csv', 'iso-8859-1', 1, 'adresses.csv');