Subversion Repositories eFlore/Applications.del

Compare Revisions

Ignore whitespace Rev 2030 → Rev 2031

/trunk/services/bibliotheque/Sql.php
282,9 → 282,7
$this->addWhere('masque.date', $dateWhere);
}
 
if ($this->etreAppliImg()) {
$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
}
$this->ajouterJoinObsSiNecessaire();
}
}
 
294,9 → 292,7
$deptMotif = $this->bdd->proteger("INSEE-C:$dept");
$this->addWhere('masque.departement', "do.ce_zone_geo LIKE $deptMotif");
 
if ($this->etreAppliImg()) {
$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
}
$this->ajouterJoinObsSiNecessaire();
}
}
312,9 → 308,7
$pays = implode(',', $this->bdd->proteger($pays));
$this->addWhere('masque.pays', "do.pays IN ($pays)");
if ($this->etreAppliImg()) {
$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
}
$this->ajouterJoinObsSiNecessaire();
}
}
 
322,9 → 316,8
if (isset($this->parametres['masque.id_zone_geo'])) {
$idZgMotif = $this->bdd->proteger($this->parametres['masque.id_zone_geo']);
$this->addWhere('masque.id_zone_geo', "do.ce_zone_geo = $idZgMotif");
if ($this->etreAppliImg()) {
$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
}
$this->ajouterJoinObsSiNecessaire();
}
}
 
334,9 → 327,7
$genreMotif = $this->bdd->proteger("$genre%");
$this->addWhere('masque.genre', "do.nom_sel LIKE $genreMotif");
 
if ($this->etreAppliImg()) {
$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
}
$this->ajouterJoinObsSiNecessaire();
}
}
 
345,9 → 336,7
$familleMotif = $this->bdd->proteger($this->parametres['masque.famille']);
$this->addWhere('masque.famille', "do.famille = $familleMotif");
 
if ($this->etreAppliImg()) {
$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
}
$this->ajouterJoinObsSiNecessaire();
}
}
 
356,10 → 345,8
$ns = $this->parametres['masque.ns'];
$nsMotif = $this->bdd->proteger("$ns%");
$this->addWhere('masque.ns', "do.nom_sel LIKE $nsMotif");
 
if ($this->etreAppliImg()) {
$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
}
$this->ajouterJoinObsSiNecessaire();
}
}
 
369,9 → 356,7
$nnWhere = sprintf($sqlTpl, $this->parametres['masque.nn']);
$this->addWhere('masque.nn', $nnWhere);
 
if ($this->etreAppliImg()) {
$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
}
$this->ajouterJoinObsSiNecessaire();
}
}
 
381,9 → 366,7
$refMotif = $this->bdd->proteger("$ref%");
$this->addWhere('masque.referentiel', "do.nom_referentiel LIKE $refMotif");
 
if ($this->etreAppliImg()) {
$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
}
$this->ajouterJoinObsSiNecessaire();
}
}
 
393,10 → 376,14
$communeMotif = $this->bdd->proteger("$commune%");
$this->addWhere('masque.commune', "do.zone_geo LIKE $communeMotif");
 
$this->ajouterJoinObsSiNecessaire();
}
}
private function ajouterJoinObsSiNecessaire() {
if ($this->etreAppliImg()) {
$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
$this->addJoin('INNER JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
}
}
}
 
public function ajouterConstrainteAppliObs() {