Browse Source

Prise en compte lors des affichages des tags a modérer.

bastien 13 years ago
parent
commit
8509d23020

+ 6 - 1
src/Muzich/CoreBundle/Controller/SearchController.php View File

400
           }
400
           }
401
         }
401
         }
402
 
402
 
403
+        $params['uid'] = '%"'.$this->getUserId().'"%';
403
         $tags = $this->getDoctrine()->getEntityManager()->createQuery("
404
         $tags = $this->getDoctrine()->getEntityManager()->createQuery("
404
           SELECT t.name, t.slug, t.id FROM MuzichCoreBundle:Tag t
405
           SELECT t.name, t.slug, t.id FROM MuzichCoreBundle:Tag t
405
           $where
406
           $where
407
+          
408
+          AND (t.tomoderate = '0'
409
+          OR t.privateids LIKE :uid)
410
+          
406
           ORDER BY t.name ASC"
411
           ORDER BY t.name ASC"
407
         )->setParameters($params)
412
         )->setParameters($params)
408
         ->getScalarResult()
413
         ->getScalarResult()
409
         ;
414
         ;
410
-
415
+        
411
         $tags_response = array();
416
         $tags_response = array();
412
         foreach ($tags as $tag)
417
         foreach ($tags as $tag)
413
         {
418
         {

+ 3 - 1
src/Muzich/CoreBundle/Repository/ElementRepository.php View File

182
       $query_select = "SELECT e, t, o, g, fav
182
       $query_select = "SELECT e, t, o, g, fav
183
         FROM MuzichCoreBundle:Element e 
183
         FROM MuzichCoreBundle:Element e 
184
         LEFT JOIN e.group g 
184
         LEFT JOIN e.group g 
185
-        LEFT JOIN e.tags t 
185
+        LEFT JOIN e.tags t WITH (t.tomoderate = '0'
186
+          OR t.privateids LIKE :uidt)
186
         LEFT JOIN e.elements_favorites fav WITH fav.user = :uid
187
         LEFT JOIN e.elements_favorites fav WITH fav.user = :uid
187
         JOIN e.owner o
188
         JOIN e.owner o
188
         WHERE e.id IN (:ids)
189
         WHERE e.id IN (:ids)
190
       ;
191
       ;
191
 
192
 
192
       $params_select['ids'] = $ids;
193
       $params_select['ids'] = $ids;
194
+      $params_select['uidt'] = '%"'.$user_id.'"%';
193
       $query = $this->getEntityManager()
195
       $query = $this->getEntityManager()
194
         ->createQuery($query_select)
196
         ->createQuery($query_select)
195
         ->setParameters($params_select)
197
         ->setParameters($params_select)