Changeset 107574 in spip-zone
- Timestamp:
- Nov 15, 2017, 3:10:11 PM (3 years ago)
- Location:
- _plugins_/polyhierarchie/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/polyhierarchie/trunk/paquet.xml
r107571 r107574 2 2 prefix="polyhier" 3 3 categorie="navigation" 4 version="3.6. 8"4 version="3.6.9" 5 5 etat="test" 6 6 compatibilite="[3.0.0;3.2.*]" -
_plugins_/polyhierarchie/trunk/polyhier_fonctions.php
r107571 r107574 218 218 } 219 219 } 220 // si le champ id_rubrique est recuperer par jointure, c'est le type et la primary de la table jointe 221 // qu'il faut chercher dans la table spip_rubriques_liens (ie cas des evenements) 222 if ($cle AND $desc) { 223 $type_jointure = objet_type($boucle->from[$cle]); 224 $primary_jointure = $cle . "." . id_table_objet($boucle->from[$cle]); 225 } 220 226 } 221 227 else { … … 245 251 // Si c'est tout ou que indirects, on ajoute le critère de branche secondaire, avec la table de liens 246 252 if ($tous !== 'directs') { 253 // S'il y a une jointure, on cherche toujours les liaisons avec celle-ci 254 if (isset($type_jointure)) { 255 $sous_jointure = "sql_get_select('rl.id_objet','spip_rubriques_liens as rl',sql_in('rl.id_parent',\$in_rub" . ($not ? ", 'NOT'" : '') . ").' AND rl.objet=\'$type_jointure\'')"; 256 $where_jointure = "array('IN', '$primary_jointure', '(SELECT * FROM('.$sous_jointure.') AS subquery)')"; 257 } 247 258 248 $sous = "sql_get_select('rl.id_objet','spip_rubriques_liens as rl',sql_in('rl.id_parent',\$in_rub" . ($not ? ", 'NOT'" : '') . ").' AND rl.objet=\'$type\'')"; 249 $where[] = "array('IN', '$primary', '(SELECT * FROM('.$sous.') AS subquery)')"; 259 // S'il n'y a pas de jointure (cas par défaut) ou que l'objet est explicitement configuré pour être classé avec polyhier 260 // on cherche les liaisons sur l'objet 261 if ( 262 !isset($type_jointure) 263 or (include_spip('inc/config') and in_array(table_objet_sql($type), lire_config('polyhier/lier_objets', array()))) 264 ) { 265 $sous_objet = "sql_get_select('rl.id_objet','spip_rubriques_liens as rl',sql_in('rl.id_parent',\$in_rub" . ($not ? ", 'NOT'" : '') . ").' AND rl.objet=\'$type\'')"; 266 $where_objet = "array('IN', '$primary', '(SELECT * FROM('.$sous_objet.') AS subquery)')"; 267 } 268 269 // S'il y a les deux, on fait un OR 270 if (isset($where_jointure) and isset($where_objet)) { 271 $where[] = "array('OR', $where_jointure, $where_objet)"; 272 } 273 // Sinon s'il n'y a que jointure 274 elseif (isset($where_jointure)) { 275 $where[] = $where_jointure; 276 } 277 // Sinon que sur l'objet 278 else { 279 $where[] = $where_objet; 280 } 250 281 } 251 282
Note: See TracChangeset
for help on using the changeset viewer.