Changeset 107575 in spip-zone
- Timestamp:
- Nov 15, 2017, 3:16:34 PM (3 years ago)
- Location:
- _plugins_/polyhierarchie/branches/v2.0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/polyhierarchie/branches/v2.0/paquet.xml
r107572 r107575 2 2 prefix="polyhier" 3 3 categorie="navigation" 4 version="2.3. 7"4 version="2.3.8" 5 5 etat="stable" 6 6 compatibilite="[3.0.0;3.2.*]" -
_plugins_/polyhierarchie/branches/v2.0/polyhier_fonctions.php
r107572 r107575 206 206 } 207 207 } 208 // si le champ id_rubrique est recuperer par jointure, c'est le type et la primary de la table jointe 209 // qu'il faut chercher dans la table spip_rubriques_liens (ie cas des evenements) 210 if ($cle AND $desc) { 211 $type_jointure = objet_type($boucle->from[$cle]); 212 $primary_jointure = $cle . "." . id_table_objet($boucle->from[$cle]); 213 } 208 214 } 209 215 else $cle = $boucle->id_table; … … 216 222 if ($tous!=='directs' 217 223 AND in_array(table_objet_sql($boucle->type_requete),array_keys(lister_tables_objets_sql()))){ 218 $sous = "sql_get_select('rl.id_objet','spip_rubriques_liens as rl',sql_in('rl.id_parent',\$b" . ($not ? ", 'NOT'" : '') . ").' AND rl.objet=\'$type\'')"; 219 $where[] = "array('IN', '$primary', '(SELECT * FROM('.$sous.') AS subquery)')"; 224 // S'il y a une jointure, on cherche toujours les liaisons avec celle-ci 225 if (isset($type_jointure)) { 226 $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\'')"; 227 $where_jointure = "array('IN', '$primary_jointure', '(SELECT * FROM('.$sous_jointure.') AS subquery)')"; 228 } 229 230 // S'il n'y a pas de jointure (cas par défaut) ou que l'objet est explicitement configuré pour être classé avec polyhier 231 // on cherche les liaisons sur l'objet 232 if ( 233 !isset($type_jointure) 234 or (include_spip('inc/config') and in_array(table_objet_sql($type), lire_config('polyhier/lier_objets', array()))) 235 ) { 236 $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\'')"; 237 $where_objet = "array('IN', '$primary', '(SELECT * FROM('.$sous_objet.') AS subquery)')"; 238 } 239 240 // S'il y a les deux, on fait un OR 241 if (isset($where_jointure) and isset($where_objet)) { 242 $where[] = "array('OR', $where_jointure, $where_objet)"; 243 } 244 // Sinon s'il n'y a que jointure 245 elseif (isset($where_jointure)) { 246 $where[] = $where_jointure; 247 } 248 // Sinon que sur l'objet 249 else { 250 $where[] = $where_objet; 251 } 220 252 } 221 253
Note: See TracChangeset
for help on using the changeset viewer.