Line 451... |
Line 451... |
451 |
|
451 |
|
452 |
static function getImages_preload($cel, $obsids) {
|
452 |
static function getImages_preload($cel, $obsids) {
|
453 |
if(!$obsids) return;
|
453 |
if(!$obsids) return;
|
454 |
$rec = Cel::db()->requeter(
|
454 |
$rec = Cel::db()->requeter(
|
455 |
sprintf("SELECT o.id_observation, GROUP_CONCAT(nom_original ORDER BY nom_original ASC SEPARATOR '%s') AS i " .
|
455 |
sprintf("SELECT o.id_observation, GROUP_CONCAT(nom_original ORDER BY nom_original ASC SEPARATOR '%s') AS i " .
|
456 |
"FROM cel_images i LEFT JOIN cel_obs_images oi ON (i.id_image = oi.id_image) LEFT JOIN cel_obs o ON (oi.id_observation = o.id_observation) " .
|
456 |
"FROM cel_images i LEFT JOIN cel_obs o ON (i.ce_observation = o.id_observation) " .
|
457 |
"WHERE o.ce_utilisateur = %d AND o.id_observation IN (%s) " .
|
457 |
"WHERE o.ce_utilisateur = %d AND o.id_observation IN (%s) " .
|
458 |
"GROUP BY id_observation",
|
458 |
"GROUP BY id_observation",
|
459 |
SEPARATEUR_IMAGES,
|
459 |
SEPARATEUR_IMAGES,
|
460 |
$cel->id_utilisateur,
|
460 |
$cel->id_utilisateur,
|
Line 469... |
Line 469... |
469 |
if(! $id_utilisateur) return NULL;
|
469 |
if(! $id_utilisateur) return NULL;
|
470 |
if(isset(self::$cache['getImages'][$obs['id_observation']]))
|
470 |
if(isset(self::$cache['getImages'][$obs['id_observation']]))
|
471 |
return self::$cache['getImages'][$obs['id_observation']];
|
471 |
return self::$cache['getImages'][$obs['id_observation']];
|
Line 472... |
Line 472... |
472 |
|
472 |
|
473 |
$rec = Cel::db()->requeter(
|
473 |
$rec = Cel::db()->requeter(
|
474 |
sprintf("SELECT GROUP_CONCAT(nom_original ORDER BY nom_original ASC SEPARATOR '%s') AS i FROM cel_images i"
|
474 |
sprintf("SELECT GROUP_CONCAT(nom_original ORDER BY nom_original ASC SEPARATOR '%s') AS i ".
|
475 |
." LEFT JOIN cel_obs_images oi ON (i.id_image = oi.id_image)"
|
475 |
"FROM cel_images i ".
|
476 |
." LEFT JOIN cel_obs o ON (oi.id_observation = o.id_observation)"
|
476 |
" LEFT JOIN cel_obs o ON (i.ce_observation = o.id_observation) ".
|
- |
|
477 |
"WHERE o.ce_utilisateur = %d ".
|
- |
|
478 |
" AND o.id_observation = %d ".
|
477 |
." WHERE o.ce_utilisateur = %d AND o.id_observation = %d LIMIT 1",
|
479 |
'LIMIT 1',
|
478 |
SEPARATEUR_IMAGES,
|
480 |
SEPARATEUR_IMAGES,
|
479 |
$id_utilisateur,
|
481 |
$id_utilisateur,
|
480 |
$obs['id_observation']));
|
482 |
$obs['id_observation']));
|
481 |
return $rec ? $rec[0]['i'] : NULL;
|
483 |
return $rec ? $rec[0]['i'] : NULL;
|