Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 994 → Rev 995

/trunk/jrest/lib/RechercheImage.php
299,7 → 299,7
$date_formatee = '';
$date = split("-",$date_sql) ;
$date = explode("-",$date_sql) ;
if(count($date) > 2)
{
$image['date_prise_de_vue'] = $date[2].'/'.$date[1].'/'.$date[0] ;
/trunk/jrest/lib/NameParser.php
97,43 → 97,39
//normalise "et", "and" to ampersand (et al. is a special case)
// if ( $temp like '% et al%' ) {
if ( ereg(' et al', $temp) ) {
if ( preg_match('/ et al/', $temp) ) {
$temp = str_replace(' et al','zzzzz', $temp);
$this->debug['parse_auth'][] = "4a (temp:$temp)";
}
// $temp = str_replace(temp,' et ',' '||'&'||' ');
// $temp = replace(temp,' and ',' '||'&'||' ');
$temp = str_replace(' et ',' & ', $temp );
$temp = str_replace(' and ',' & ', $temp );
// if ( $temp like '%zzzzz%' ) {
// if ( ereg('zzzzz', $temp) ) {
 
$temp = str_replace('zzzzz',' et al', $temp);
// }
 
$this->debug['parse_auth'][] = "5 (temp:$temp)";
//remove commas before dates (only)
// like '%, 17%'
if ( ereg(', 17', $temp) ) {
if ( preg_match('/, 17/', $temp) ) {
$temp = str_replace(', 17',' 17', $temp);
$this->debug['parse_auth'][] = "5a (temp:$temp)";
}
// like '%, 18%'
if ( ereg(', 18', $temp) ) {
if ( preg_match('/, 18/', $temp) ) {
$temp = str_replace(', 18',' 18', $temp);
$this->debug['parse_auth'][] = "5b (temp:$temp)";
}
// like '%, 19%'
if ( ereg(', 19', $temp) ) {
if ( preg_match('/, 19/', $temp) ) {
$temp = str_replace(', 19',' 19', $temp);
$this->debug['parse_auth'][] = "5c (temp:$temp)";
}
// like '%, 20%'
if ( ereg(', 20', $temp) ) {
if ( preg_match('/, 20/', $temp) ) {
$temp = str_replace(', 20',' 20', $temp);
$this->debug['parse_auth'][] = "5d (temp:$temp)";
}
151,7 → 147,7
$this->debug['parse_auth'][] = "7 (this_word:$this_word)";
// like '(%'
if ( ereg('^\(', $this_word) ) {
if ( preg_match('/^\(/', $this_word) ) {
$elapsed_chars .= '(';
$this_word = substr( $this_word, 1 );
$this->debug['parse_auth'][] = "7a (this_word:$this_word) (elapsed_chars:$elapsed_chars)";
/trunk/jrest/lib/RechercheInfosTaxon.php
35,7 → 35,7
// Genre et Espece
if ($espece != null && $genre != null) {
if (strlen($espece) > 0 ) {
$espece=ereg_replace('\*+','%',$espece);
$espece=preg_replace('/\*+/','%',$espece);
$requete_recherche = "SELECT DISTINCT en_nom_genre, en_epithete_espece, en_nom_supra_generique, en_epithete_infra_generique,".
" auteur_bex.enaia_intitule_abrege AS abreviation_auteur_basio_ex ".
" , auteur_b.enaia_intitule_abrege AS abreviation_auteur_basio ".
62,7 → 62,7
}
else {
if ($genre != null) {
$genre=ereg_replace('\*+','%',$genre);
$genre=preg_replace('/\*+/','%',$genre);
//TODO: comprendre pourquoi à l'origine il y avait : (strlen($genre) >= 1) /*&& ($genre != '%')
// voir avec david
if ((strlen($genre) >= 1)) {
257,18 → 257,18
// Constitution du nom:
$nom = '';
 
if ($rawnom['en_nom_supra_generique'] != '') {
if (isset($rawnom['en_nom_supra_generique']) && $rawnom['en_nom_supra_generique'] != '') {
$nom .= $rawnom['en_nom_supra_generique'];
} else if ($rawnom['en_epithete_infra_generique'] != '') {
} else if (isset($rawnom['en_epithete_infra_generique']) && $rawnom['en_epithete_infra_generique'] != '') {
$nom .= $rawnom['en_epithete_infra_generique'];
} else {
if ($rawnom['en_nom_genre'] != '') {
if (isset($rawnom['en_nom_genre']) && $rawnom['en_nom_genre'] != '') {
$nom .= $rawnom['en_nom_genre'];
}
if ($rawnom['en_epithete_espece']!= '') {
if (isset($rawnom['en_epithete_espece']) && $rawnom['en_epithete_espece']!= '') {
$nom .= ' '.$rawnom['en_epithete_espece'];
}
if ($rawnom['en_epithete_infra_specifique'] != '') {
if (isset($rawnom['en_epithete_infra_specifique']) && $rawnom['en_epithete_infra_specifique'] != '') {
if (!empty($rawnom['enrg_abreviation_rang'])) {
$nom .= ' '.$rawnom['enrg_abreviation_rang'].'';
}
/trunk/jrest/lib/JrestService.php
25,7 → 25,7
 
public function isAdmin($id) {
$admins = $this->config['jrest_admin']['admin'];
$admin_tab = split(',',$admins);
$admin_tab = explode(',',$admins);
 
if (in_array($id,$admin_tab)) {
return true;
/trunk/jrest/lib/GestionObservation.php
259,7 → 259,7
 
// TODO : voir si l'on peut utiliser un des fonctions de la classe cel
if (isset($parametres['date_observation']) && $parametres['date_observation']!="null") {
list($jour,$mois,$annee)=split("/",$parametres['date_observation']);
list($jour,$mois,$annee)=explode("/",$parametres['date_observation']);
$parametres['date_observation']=$annee."-".$mois."-".$jour." 0:0:0";
}
/trunk/jrest/lib/RechercheObservation.php
135,6 → 135,8
private function fabriquerSousRequeteRecherche($id_utilisateur, $criteres) {
$sous_requete = '';
foreach ($criteres as $nom => $valeur)
{
if($valeur == null || trim($nom) == "" || trim($valeur) == "") {
/trunk/jrest/lib/GestionImage.php
195,7 → 195,7
if (!in_array($champ,$champs_a_ignorer)) {
if ($champ == 'date_prise_de_vue') {
$date_tab = split('/',$valeur) ;
$date_tab = explode('/',$valeur) ;
$date = $date_tab[2].'-'.$date_tab[1].'-'.$date_tab[0] ;
$requete_maj_champs .= $champ.' = '.$this->proteger($date).' , ' ;
258,7 → 258,7
 
$manipulateur_image = new ImageRecreation($this->config);
$tableau_ids_image = split(',',$ids_images);
$tableau_ids_image = explode(',',$ids_images);
foreach($tableau_ids_image as $id_image_a_detruire) {
$destruction_fichier_image = $manipulateur_image->detruireImageSurDisque($id_image_a_detruire);