Example #1
0
        // on retire tout ce qui n'est pas du texte
        if (ctype_alpha($value)) {
            $tabMotsCleNettoye[] = $value;
        }
    }
    if (count($tabMotsCleNettoye) > 0) {
        $motsCle = ", " . implode(", ", $tabMotsCleNettoye);
    }
    // description
    if ($titreFirstEvenement == '') {
        $description = $titre;
    } else {
        $aRemplacer = array("\n\r", "\r\n", "\n", "\r", "\"");
        $remplacerPar = array("", "", "", "", "'");
        // s'il y a un titre au premier evenement, on affiche le titre et les 100 premiers mot de la description
        $description = $titreFirstEvenement . " " . $string->coupureTexte(strip_tags($string->sansBalises(str_replace($aRemplacer, $remplacerPar, stripslashes($descriptionFirstEvenement)))), 100);
    }
}
// referencement - description - titre de la page dans le cas de l'affichage de la page detail d'une image
if (isset($_GET['archiAffichage']) && $_GET['archiAffichage'] == 'imageDetail' && isset($_GET['archiIdImage']) && $_GET['archiIdImage'] != '' && $_GET['archiIdImage'] != '0') {
    $e = new archiEvenement();
    if (!archiPersonne::isPerson($e->getIdEvenementGroupeAdresseFromIdEvenement($_GET['archiRetourIdValue']))) {
        $resAdresses = $image->getIdAdressesFromIdImage($_GET['archiIdImage']);
        if ($fetchAdresses = mysql_fetch_assoc($resAdresses)) {
            $resGroupeAdresses = $adresse->getIdEvenementsFromAdresse($fetchAdresses['idAdresse']);
            $fetchGroupeAdresses = mysql_fetch_assoc($resGroupeAdresses);
            $titreFirstEvenement = $evenement->getTitreFromFirstChildEvenement($fetchGroupeAdresses['idEvenement']);
            $titre = "Photo : " . $titreFirstEvenement;
            $resAdresse = $adresse->getAdressesFromEvenementGroupeAdresses($fetchGroupeAdresses['idEvenement']);
            $fetchAdresse = mysql_fetch_assoc($resAdresse);
            $idAdresse = $fetchAdresse['idAdresse'];
 public function getParcoursListe($params = array())
 {
     $html = "";
     $page = new archiPage(9, LANG);
     // liste des parcours
     $html .= '<h2>' . $page->title . '</h2>';
     $resParcours = $this->getMysqlParcours(array('sqlOrderBy' => 'ORDER BY dateAjoutParcours DESC, idParcours DESC'));
     $t = new tableau();
     if (mysql_num_rows($resParcours) == 0) {
         $html .= "Aucun parcours n'est disponible pour le moment.";
     }
     $s = new stringObject();
     $html .= stripcslashes($page->content);
     $i = 0;
     while ($fetchParcours = mysql_fetch_assoc($resParcours)) {
         $photoTrouvee = false;
         $photo = "&nbsp;";
         $urlParcours = $this->creerUrl('', 'detailParcours', array('archiIdParcours' => $fetchParcours['idParcours']));
         //if($i==0)
         //{
         // recuperation des etapes pour afficher la premiere photo rencontree
         $reqEtapes = "SELECT idEtape, commentaireEtape FROM etapesParcoursArt WHERE idParcours='" . $fetchParcours['idParcours'] . "'";
         $resEtapes = $this->connexionBdd->requete($reqEtapes);
         $commentaire = "";
         $isCommentaire = false;
         if (mysql_num_rows($resEtapes) > 0) {
             while (!$photoTrouvee && ($fetchEtapes = mysql_fetch_assoc($resEtapes))) {
                 $arrayPhoto = $this->getPhotoFromEtape(array('idEtape' => $fetchEtapes['idEtape']));
                 if ($arrayPhoto['trouve'] == true) {
                     $photoTrouvee = true;
                     $photo = "<a href='" . $urlParcours . "'><img src='" . $arrayPhoto['url'] . "' border=0></a>";
                 }
                 if (!$isCommentaire) {
                     if ($fetchEtapes['commentaireEtape'] != '') {
                         $commentaire = $fetchEtapes['commentaireEtape'];
                         $isCommentaire = true;
                     }
                 }
             }
         }
         //}
         $t->addValue($photo);
         $t->addValue("<a href='" . $urlParcours . "'>" . stripslashes($fetchParcours['libelleParcours']) . "</a><br>" . $s->coupureTexte($s->sansBalisesHtml(stripslashes($commentaire)), 10) . "<br>" . mysql_num_rows($resEtapes) . " étapes");
         $i++;
     }
     $html .= $t->createHtmlTableFromArray(2);
     return $html;
 }
 /**
  * Get the last news
  * @param unknown $params
  * @return string html of the last news encarts
  */
 public function getActualites($params = array())
 {
     $tActualites = new Template($this->getCheminPhysique() . $this->cheminTemplates);
     $tActualites->set_filenames(array('encartActualites' => 'encartAccueil.tpl'));
     $tActualites->assign_vars(array('titre' => _("Actualités"), "type" => "actualites"));
     $i = 0;
     if (count($params['actualites']) > 0) {
         $tActualites->assign_vars(array('lienVersTout' => "<a href='" . $this->creerUrl('', 'toutesLesActualites', array()) . "'>" . _("Toutes les actualités") . "</a>"));
     }
     // s'il y a un parcours plus récent que la derniere actu ,  on affiche le parcours comme une actualité ( ...je sais mais bon ,  va comprendre....)
     $reqDateDerniereActualite = "SELECT max(date) as maxDate FROM actualites WHERE desactive<>'1'";
     $resDateDerniereActualite = $this->connexionBdd->requete($reqDateDerniereActualite);
     $indiceGlobalNbActu = 0;
     $isParcoursToDisplay = false;
     // est ce que l'on va afficher un parcours plutot qu'une actu en place principale sur l'encars des actus
     if (mysql_num_rows($resDateDerniereActualite) > 0) {
         $fetchDateDerniereActualite = mysql_fetch_assoc($resDateDerniereActualite);
         $dateActu = $fetchDateDerniereActualite['maxDate'];
         // voyons maintenant s'il y a un parcours ajouté actif plus recent
         $reqParcoursActif = "SELECT idParcours,  dateAjoutParcours, libelleParcours, commentaireParcours FROM parcoursArt WHERE dateAjoutParcours>'" . $dateActu . "' AND isActif='1' ORDER BY dateAjoutParcours DESC,  idParcours DESC LIMIT 1";
         $resParcoursActif = $this->connexionBdd->requete($reqParcoursActif);
         if (mysql_num_rows($resParcoursActif) > 0) {
             $isParcoursToDisplay = true;
             $fetchParcoursActif = mysql_fetch_assoc($resParcoursActif);
             // recuperation d'une photo appartenant a une adresse du parcours (en principe dans le meilleur des cas la premiere photo de la premiere etape)
             $reqEtapes = "SELECT idEtape, commentaireEtape FROM etapesParcoursArt WHERE idParcours = '" . $fetchParcoursActif['idParcours'] . "'";
             $resEtapes = $this->connexionBdd->requete($reqEtapes);
             if (mysql_num_rows($resEtapes) > 0) {
                 $trouvePhoto = false;
                 while (!$trouvePhoto && ($fetchEtape = mysql_fetch_assoc($resEtapes))) {
                     $arrayPhoto = $adresse->getPhotoFromEtape(array('idEtape' => $fetchEtape['idEtape'], 'format' => 'moyen'));
                     $trouvePhoto = $arrayPhoto['trouve'];
                 }
                 mysql_data_seek($resEtapes, 0);
                 $commentaire = "";
                 if ($fetchParcoursActif['commentaireParcours'] != '') {
                     $bbCode = new bbCodeObject();
                     $trouveCommentaire = true;
                     $commentaire = $bbCode->convertToDisplay(array('text' => $fetchParcoursActif['commentaireParcours']));
                 } else {
                     $trouveCommentaire = false;
                 }
                 while (!$trouveCommentaire && ($fetchEtape = mysql_fetch_assoc($resEtapes))) {
                     if ($fetchEtape['commentaireEtape'] != '') {
                         $trouveCommentaire = true;
                         $commentaire = $fetchEtape['commentaireEtape'];
                     }
                 }
                 if ($trouvePhoto) {
                     $s = new stringObject();
                     // si une photo pour le dernier parcours a ete trouvee ,  alors on affiche le parcours en actu principale
                     $i = 1;
                     // pour que la boucle des actus commence a 1 et ne remplace pas l'actu principale
                     $indiceGlobalNbActu = 1;
                     // pour que l'on affiche pas la derniere actu ramenee par la fonction sinon il y en aurait une de plus que dans les autres encars
                     $urlImage = $arrayPhoto['url'];
                     $url = $this->creerUrl('', 'detailParcours', array('archiIdParcours' => $fetchParcoursActif['idParcours']));
                     $dimensionImage = "";
                     $tActualites->assign_block_vars("premiereAdresseAvecPhoto", array());
                     $tActualites->assign_vars(array("photoAdresse1" => "<a href='" . $url . "'><img alt='' style='border:1px #000000 solid;margin-right:2px;float:left;'  src='" . $urlImage . "' {$dimensionImage} ></a>", "descriptionAdresse1" => "<a href='" . $url . "'>" . $d->toFrenchAffichage($fetchParcoursActif['dateAjoutParcours']) . " " . stripslashes($fetchParcoursActif['libelleParcours']) . "</a><br>" . $s->coupureTexte($s->sansBalisesHtml(stripslashes($commentaire)), 10) . "<br>" . mysql_num_rows($resEtapes) . " étapes... <a href='" . $url . "' style='font-size:11px;'>lire la suite</a>"));
                 }
             }
         }
     }
     foreach ($params['actualites'] as $indice => $value) {
         if ($indiceGlobalNbActu < 5) {
             if ($i == 0) {
                 // premiere actualite
                 @(list($w, $h) = getimagesize($this->getCheminPhysique() . "images/actualites/" . $value['idActualite'] . "/" . $value['photoIllustration']));
                 if ($w > $h) {
                     $dimensionImage = "width=130";
                     // modif par fabien pour que l'image soit au même format que les autres rubriques (01/02/2013)
                 } else {
                     $dimensionImage = "height=130";
                 }
                 $urlImage = $this->getUrlRacine() . "images/actualites/" . $value['idActualite'] . "/" . $value['photoIllustration'];
                 if ($value['urlFichier'] != '') {
                     $url = $value['urlFichier'];
                 } else {
                     $url = $this->creerUrl('', 'afficherActualite', array('archiIdActualite' => $value['idActualite']));
                 }
                 $tActualites->assign_block_vars("premiereAdresseAvecPhoto", array());
                 $tActualites->assign_vars(array("photoAdresse1" => "<a href='" . $url . "'><img alt='' style='border:1px #000000 solid;margin-right:2px;float:left;' src='" . $urlImage . "' {$dimensionImage}></a>", "descriptionAdresse1" => "<a href='" . $url . "'>" . $d->toFrenchAffichage($value['date']) . " " . stripslashes($value['titre']) . "</a><br>" . stripslashes($string->coupureTexte($string->sansBalisesHtml($value['texte']), 20)) . " <a href='" . $url . "' style='font-size:11px;'>lire la suite</a>"));
             } else {
                 if ($value['urlFichier'] != '') {
                     $url = $value['urlFichier'];
                 } else {
                     $url = $this->creerUrl('', 'afficherActualite', array('archiIdActualite' => $value['idActualite']));
                 }
                 // by fabien le 23/03/2012 : ajout de stripslashes pour virer les \ sur la page d'acceuil
                 $tActualites->assign_block_vars('listeAdressesSuivantes', array('lien' => "<a style='font-size:12px;' href='" . $url . "'><span class='date'>" . $d->toFrenchAffichage($value['date']) . "</span> " . stripslashes($value['titre']) . "</a>"));
             }
             $i++;
         }
         $indiceGlobalNbActu++;
     }
     ob_start();
     $tActualites->pparse('encartActualites');
     $htmlActualites = ob_get_contents();
     ob_end_clean();
     return $htmlActualites;
 }
 /**
  * Affiche la liste des sources avec des miniatures
  * 
  * @param array $params Paramètres
  * 
  * @return string HTML
  * */
 public function afficherListeSourcesAvecLogos($params = array())
 {
     $s = new stringObject();
     $bbCode = new bbCodeObject();
     $html = "<h1>" . _("Nos sources") . "</h1><br>";
     $html .= "<br>" . _("Pour assurer la crédibilité des informations renseignées par chaque internaute, nous vous livrons ici, de façon exhaustive et en toute transparence l'ensemble des sources qui sont consultées pour enrichir le site :") . "<br><br>";
     $reqCount = "SELECT 0 FROM source";
     $resCount = $this->connexionBdd->requete($reqCount);
     $nbSourcesTotal = mysql_num_rows($resCount);
     $nbEnregistrementsParPage = 15;
     $pagination = new paginationObject();
     $arrayPagination = $pagination->pagination(array('nomParamPageCourante' => 'archiPageNosSources', 'nbEnregistrementsParPage' => $nbEnregistrementsParPage, 'nbEnregistrementsTotaux' => $nbSourcesTotal, 'typeLiens' => 'noformulaire'));
     $reqArchivesMunicipalesSansIdSourceEvenement = "\n                SELECT distinct he.idEvenement FROM historiqueEvenement he, historiqueEvenement he2 WHERE he2.idEvenement=he.idEvenement AND he.numeroArchive<>'' AND (he.idSource = '0' OR he.idSource = '')\n                GROUP BY he.idEvenement,  he.idHistoriqueEvenement\n                HAVING he.idHistoriqueEvenement = max(he2.idHistoriqueEvenement)\n                ";
     $resArchivesMunicipalesSansIdSourceEvenement = $this->connexionBdd->requete($reqArchivesMunicipalesSansIdSourceEvenement);
     $nbEvenementsSansIdSourceANDArchivesMunicipales = mysql_num_rows($resArchivesMunicipalesSansIdSourceEvenement);
     $reqArchivesMunicipalesSansIdSourceImage = "\n                SELECT distinct hi.idImage FROM historiqueImage hi,  historiqueImage hi2 WHERE hi2.idImage = hi.idImage AND hi.numeroArchive<>'' AND (hi.idSource='0' OR hi.idSource='')\n                GROUP BY hi.idImage ,  hi.idHistoriqueImage\n                HAVING hi.idHistoriqueImage = max(hi2.idHistoriqueImage)\n                ";
     $resArchivesMunicipalesSansIdSourceImage = $this->connexionBdd->requete($reqArchivesMunicipalesSansIdSourceImage);
     $nbImagesSansIdSourceANDArchivesMunicipales = mysql_num_rows($resArchivesMunicipalesSansIdSourceImage);
     $nbArchivesMunicipalesSansIdSource = $nbEvenementsSansIdSourceANDArchivesMunicipales + $nbImagesSansIdSourceANDArchivesMunicipales;
     $req = "\n            SELECT idSource ,  \n            (\n                (SELECT count(distinct he.idEvenement)  FROM historiqueEvenement he WHERE he.idSource = s.idSource )\n            + \n                (SELECT count(distinct hi.idImage) FROM historiqueImage hi WHERE hi.idSource = s.idSource)\n            + if (idSource=24, {$nbArchivesMunicipalesSansIdSource}, 0)\n            ) \n            as sumnb\n            FROM source s\n            ORDER BY sumnb DESC\n        ";
     $req = $pagination->addLimitToQuery($req);
     $res = $this->connexionBdd->requete($req);
     $t = new tableau();
     $t->addValue("");
     $t->addValue("<b>" . _("Sources") . "</b>");
     $t->addValue("<b><span style='font-size:12px;'>" . _("Nombre de liaisons (articles ou photos)") . "</span></b>");
     while ($fetch = mysql_fetch_assoc($res)) {
         $reqSource = "\n                    SELECT s.idSource as idSource,  s.nom as nomSource ,  ts.nom as nomTypeSource,  s.description as description\n                    FROM source s\n                    LEFT JOIN typeSource ts ON ts.idTypeSource = s.idTypeSource\n                    WHERE idSource = '" . $fetch['idSource'] . "'\n                    ";
         $resSource = $this->connexionBdd->requete($reqSource);
         $fetchSource = mysql_fetch_assoc($resSource);
         $image = "&nbsp;";
         $url = $this->creerUrl('', 'listeAdressesFromSource', array('source' => $fetch['idSource'], 'submit' => 'Rechercher'));
         if (file_exists($this->getCheminPhysique() . "images/logosSources/" . $fetch['idSource'] . ".jpg")) {
             $image = "<a href='" . $url . "'><img src='" . $this->getUrlImage() . "logosSources/" . $fetch['idSource'] . ".jpg' border=0></a>";
         }
         $nomTypeSource = "";
         if (isset($fetchSource['nomTypeSource']) && $fetchSource['nomTypeSource'] != '') {
             $nomTypeSource = " (" . $fetchSource['nomTypeSource'] . ")";
         }
         $description = $s->coupureTexte(strip_tags($bbCode->convertToDisplay(array('text' => stripslashes($fetchSource['description'])))), 10);
         $t->addValue($image, "style='width:200px;'");
         $t->addValue("<a href='" . $url . "'>" . stripslashes($fetchSource['nomSource']) . $nomTypeSource . "</a><br>" . $description);
         $t->addValue($fetch['sumnb']);
     }
     $html .= $arrayPagination['html'];
     $html .= $t->createHtmlTableFromArray(3);
     $html .= $arrayPagination['html'];
     return $html;
 }
 /**
  * Renvoi l'affichage de toutes les vues avec pagination pour le lien sur la page d'accueil
  *
  * @return string
  * */
 public function getHtmlToutesLesVues()
 {
     $html = "<h1>Vues</h1><br>";
     $pagination = new paginationObject();
     $d = new dateObject();
     $adresse = new archiAdresse();
     $string = new stringObject();
     $bbCode = new bbCodeObject();
     $nbEnregistrementTotaux = $this->getDernieresVues(array("getNbVuesTotal" => true));
     $nbEnregistrementsParPage = 15;
     $arrayPagination = $pagination->pagination(array('nomParamPageCourante' => 'page', 'nbEnregistrementsParPage' => $nbEnregistrementsParPage, 'nbEnregistrementsTotaux' => $nbEnregistrementTotaux, 'typeLiens' => 'noformulaire'));
     $arrayVues = $this->getDernieresVues(array("sqlLimit" => "LIMIT " . $arrayPagination['limitSqlDebut'] . ",  " . $nbEnregistrementsParPage));
     $tab = new tableau();
     $i = 0;
     foreach ($arrayVues as $indice => $value) {
         $arrayIntituleAdressesVuesSur = array();
         foreach ($value['listeVueSur'] as $indice => $valueVuesSur) {
             $arrayIntituleAdressesVuesSur[] = $adresse->getIntituleAdresseFrom($valueVuesSur['idEvenementGroupeAdresse'], 'idEvenementGroupeAdresse', array('ifTitreAfficheTitreSeulement' => true, 'noVille' => true, 'noQuartier' => true, 'noSousQuartier' => true));
         }
         $arrayIntituleAdressesPrisDepuis = array();
         foreach ($value['listePrisDepuis'] as $indice => $valuePrisDepuis) {
             $arrayIntituleAdressesPrisDepuis[] = "<a href='" . $this->creerUrl('', '', array('archiAffichage' => 'adresseDetail', 'archiIdAdresse' => $valuePrisDepuis['idAdresse'], 'archiIdEvenementGroupeAdresse' => $valuePrisDepuis['idEvenementGroupeAdresse'])) . "'>" . $adresse->getIntituleAdresseFrom($valuePrisDepuis['idEvenementGroupeAdresse'], 'idEvenementGroupeAdresse', array('ifTitreAfficheTitreSeulement' => true, 'noVille' => true, 'noQuartier' => true, 'noSousQuartier' => true)) . "</a>";
         }
         $intituleAdresse1Adresse = $adresse->getIntituleAdresseFrom($value['idEvenementGroupeAdresse'], 'idEvenementGroupeAdresse', array('ifTitreAfficheTitreSeulement' => true, 'noVille' => true, 'noQuartier' => true, 'noSousQuartier' => true));
         $intituleAdresseAlt = strip_tags(str_replace("\"", "'", $intituleAdresse1Adresse));
         $intituleAdresseVueSur = implode("/", $arrayIntituleAdressesVuesSur);
         $intituleAdressePrisDepuis = implode("", $arrayIntituleAdressesPrisDepuis);
         $urlImage = 'photos-' . $string->convertStringToUrlRewrite($intituleAdresse1Adresse) . '-' . $value['dateUpload'] . '-' . $value['idHistoriqueImage'] . '-mini.jpg';
         $tab->addValue("<a href='" . $this->creerUrl('', 'imageDetail', array("archiIdImage" => $value['idImage'], "archiRetourAffichage" => 'evenement', "archiRetourIdName" => 'idEvenement', "archiRetourIdValue" => $value['idEvenementGroupeAdresse'])) . "'>" . date('d/m/Y', strtotime($value['dateUpload'])) . " " . $intituleAdresseVueSur . "</a><br><span style='font-weight:bold;font-size:14px;'>Pris depuis</span> <span style='font-size:14px;'>" . $intituleAdressePrisDepuis . "</span><br><span style='font-size:12px;'>" . $string->coupureTexte($bbCode->convertToDisplay(array('text' => $this->getDescriptionFromIdImage(array("idImage" => $value['idImage'])))), 15) . "</span>");
         $tab->addValue("<img style='margin-right:2px;float:left;' align='middle' src='" . $urlImage . "' alt='' title=\"" . $intituleAdresseAlt . "\" alt=\"" . $intituleAdresseAlt . "\">");
         $i++;
     }
     $html .= $arrayPagination['html'];
     $html .= $tab->createHtmlTableFromArray(2, 'margin:0;padding:0;', '', '');
     return $html;
 }
 /**
  * Afficher la gestion des étapes d'un parcours
  * 
  * @param array $params Paramètres
  * 
  * @return string HTML
  * */
 public function getHtmlGestionEtapesParcours($params = array())
 {
     $html = "<h1>Gestion des étapes du parcours</h1>";
     $idParcours = 0;
     if (isset($this->variablesGet['archiIdParcours']) && $this->variablesGet['archiIdParcours'] != '') {
         $f = new formGenerator();
         $a = new archiAdresse();
         $bbCode = new bbCodeObject();
         $s = new stringObject();
         $formName = 'formGestionEtapes';
         $popupChoixAdresses = new calqueObject(array('idPopup' => 'popupChoixAdresses'));
         $popupVisualisationGoogleMap = new calqueObject(array('idPopup' => 'popupVisualisationGoogleMap'));
         $idParcours = $this->variablesGet['archiIdParcours'];
         $reqNbEtapes = "SELECT idEtape FROM etapesParcoursArt WHERE idParcours = '" . $idParcours . "'";
         $resNbEtapes = $this->connexionBdd->requete($reqNbEtapes);
         $html .= "<br>nombre d'étapes : " . mysql_num_rows($resNbEtapes) . "<br>";
         $reqListeEtapes = "SELECT idEtape,idEvenementGroupeAdresse,position,commentaireEtape FROM etapesParcoursArt WHERE idParcours = '" . $idParcours . "' ORDER BY position ASC,idEtape ASC";
         $resListeEtapes = $this->connexionBdd->requete($reqListeEtapes);
         $listeTriableObject = new imageObject();
         // dans l'objet image , il y a une fonction qui permet de creer des listes triables par drag and drop
         $html .= "<script>" . $listeTriableObject->getJSFunctionsDragAndDrop() . "</script>";
         $i = 0;
         $arrayListeEtapes = array();
         while ($fetchListeEtapes = mysql_fetch_assoc($resListeEtapes)) {
             $arrayListeEtapes[$i]['idEtape'] = array('value' => $fetchListeEtapes['idEtape'], 'type' => 'identifiant');
             $arrayListeEtapes[$i]['#'] = array('value' => $i + 1, 'type' => 'free');
             $arrayListeEtapes[$i]['&nbsp;'] = array('value' => "<a href='" . $this->creerUrl('', 'etapesParcoursFormulaire', array('archiIdEtape' => $fetchListeEtapes['idEtape'], 'archiIdParcours' => $idParcours)) . "'>" . $fetchListeEtapes['idEtape'] . "</a>", 'type' => 'free', 'widthColonne' => 50);
             $arrayListeEtapes[$i]['adresse'] = array('value' => $a->getIntituleAdresseFrom($fetchListeEtapes['idEvenementGroupeAdresse'], 'idEvenementGroupeAdresse', array('setSeparatorAfterTitle' => '<br>', 'displayFirstTitreAdresse' => true, 'noVille' => true, 'noQuartier' => true, 'noSousQuartier' => true)), 'type' => 'free', 'widthColonne' => 250);
             $arrayListeEtapes[$i]['commentaire'] = array('type' => 'free', 'widthColonne' => 400, 'value' => $s->coupureTexte($s->sansBalisesHtml(stripslashes($fetchListeEtapes['commentaireEtape'])), 10));
             $coords = $a->getCoordonneesFrom($fetchListeEtapes['idEvenementGroupeAdresse'], 'idEvenementGroupeAdresse');
             $i++;
         }
         $boutonValidationOrdreEtapes = "<input type='button' name='validationOrdreAffichage' value='Validation ordre des étapes' onclick=\"document.getElementById('" . $formName . "').action='" . $this->creerUrl('enregistrerOrdreEtapesParcours', 'etapesParcoursFormulaire', array('archiIdParcours' => $idParcours)) . "';" . $listeTriableObject->getJSSubmitDragAndDrop() . "document.getElementById('" . $formName . "').submit();\">";
         $html .= $listeTriableObject->createSortableFormListeFromArray($arrayListeEtapes, array('styleEntete' => 'font-weight:bold;background-color:#007799;color:#FFFFFF;')) . $boutonValidationOrdreEtapes;
         $sousTitre = "Ajout d'une étape";
         $idEtape = 0;
         $libelleAdresse = '';
         $commentaireEtape = '';
         $idAdresse = '';
         $idEvenementGroupeAdresse = 0;
         $boutonNouveau = "";
         $boutonVisualisation = "<input type='button' name='visualisation' value='Visualiser' onclick=\"" . $popupVisualisationGoogleMap->getJSOpenPopup() . "document.getElementById('" . $popupVisualisationGoogleMap->getJSIFrameId() . "').src='" . $this->creerUrl('', 'carteGoogleMapParcoursArt', array('noHeaderNoFooter' => 1, 'archiIdParcours' => $idParcours)) . "'\">";
         $boutonRetour = "<input type='button' name='retour' value='Retour' onclick=\"location.href='" . $this->creerUrl('', 'adminListeParcours', array()) . "';\">";
         $boutonSupprimer = "";
         // ajout d'une nouvelle etape
         $formAction = $this->creerUrl('ajouterEtapeParcours', 'etapesParcoursFormulaire', array('archiIdParcours' => $idParcours));
         if (mysql_num_rows($resNbEtapes) == 0) {
             // si pas d'etapes encore , on peut definir un message
         } else {
             // il y a une ou plusieurs etapes dans le parcours
             if (isset($this->variablesGet['archiIdEtape']) && $this->variablesGet['archiIdEtape'] != '') {
                 $idEtape = $this->variablesGet['archiIdEtape'];
                 $reqEtape = "SELECT idEvenementGroupeAdresse,commentaireEtape FROM etapesParcoursArt WHERE idEtape='" . $idEtape . "'";
                 $resEtape = $this->connexionBdd->requete($reqEtape);
                 $fetchEtape = mysql_fetch_assoc($resEtape);
                 $sousTitre = _("Modification d'une étape");
                 $formAction = $this->creerUrl('modifierEtapeParcours', 'etapesParcoursFormulaire', array('archiIdParcours' => $idParcours, 'archiIdEtape' => $this->variablesGet['archiIdEtape']));
                 $commentaireEtape = $fetchEtape['commentaireEtape'];
                 $libelleAdresse = $a->getIntituleAdresseFrom($fetchEtape['idEvenementGroupeAdresse'], 'idEvenementGroupeAdresse');
                 $idAdresse = '';
                 $idEvenementGroupeAdresse = $fetchEtape['idEvenementGroupeAdresse'];
                 $boutonNouveau = "<input type='button' name='boutonNouveau' value='Nouveau' onclick=\"location.href='" . $this->creerUrl('', 'etapesParcoursFormulaire', array('archiIdParcours' => $idParcours)) . "';\">";
                 $boutonSupprimer = "<input type='button' name='boutonSupprimer' value='Supprimer' onclick=\"location.href='" . $this->creerUrl('supprimerEtapeParcours', 'etapesParcoursFormulaire', array('archiIdParcours' => $idParcours, 'archiIdEtapeSupprimer' => $idEtape)) . "';\">";
                 $coord = $a->getCoordonneesFrom($fetchEtape['idEvenementGroupeAdresse'], 'idEvenementGroupeAdresse');
             } else {
                 $coord = array("latitude" => "", "longitude" => "");
             }
         }
         $bbCodeElementsArray = $bbCode->getBoutonsMiseEnFormeTextArea(array('formName' => $formName, 'fieldName' => 'commentaireEtape'));
         $html .= "<hr/>";
         // formulaire ajout-modif etape
         $html .= "<h2>{$sousTitre}</h2>";
         $configFields = array('idParcours' => array('libelle' => 'idParcours', 'type' => 'hidden', 'error' => '', 'value' => '', 'forceValueTo' => $idParcours, 'htmlCode' => ''), 'idEtape' => array('libelle' => 'idEtape', 'type' => 'hidden', 'error' => '', 'value' => '', 'forceValueTo' => $idEtape, 'htmlCode' => ''), 'libelleEvenementGroupeAdresse' => array('libelle' => _('Adresse'), 'type' => 'text', 'error' => '', 'value' => '', 'forceValueTo' => $libelleAdresse, 'htmlCode' => "style='width:300px;' disabled", 'htmlCode2' => "<input type='button' name='choixAdresse' value='Choisir' onclick=\"document.getElementById('" . $popupChoixAdresses->getJSDivId() . "').style.top=(getScrollHeight()+70)+'px';" . $popupChoixAdresses->getJSOpenPopup() . "document.getElementById('" . $popupChoixAdresses->getJSIFrameId() . "').src='" . $this->creerUrl('', 'recherche', array('noHeaderNoFooter' => 1, 'modeAffichage' => 'popupRechercheAdresseAdminParcours')) . "';\">"), 'latitude' => array('libelle' => _('Latitude'), 'type' => 'text', 'error' => '', 'value' => '', 'forceValueTo' => $coord["latitude"], 'htmlCode' => "style='width:300px;' readonly onclick='this.select();'"), 'longitude' => array('libelle' => _('Longitude'), 'type' => 'text', 'error' => '', 'value' => '', 'forceValueTo' => $coord["longitude"], 'htmlCode' => "style='width:300px;' readonly onclick='this.select();'"), 'idEvenementGroupeAdresse' => array('libelle' => 'idEvenementGroupeAdresse', 'type' => 'hidden', 'error' => '', 'value' => '', 'forceValueTo' => $idEvenementGroupeAdresse, 'htmlCode' => "style='width:300px;'"), 'commentaireEtape' => array('libelle' => 'commentaire', 'type' => 'bigText', 'error' => '', 'value' => '', 'forceValueTo' => $commentaireEtape, 'default' => '', 'htmlCode' => "style='width:500px;height:200px;'", 'htmlCodeBeforeField' => $bbCodeElementsArray['boutonsHTML'], 'htmlCode2' => $bbCodeElementsArray['divAndJsAfterForm']));
         $configForm = array('fields' => $configFields, 'formAction' => $formAction, 'formName' => $formName, 'onClickSubmitButton' => $listeTriableObject->getJSSubmitDragAndDrop(), 'codeHtmlAfterSubmitButton' => $boutonSupprimer . $boutonNouveau . $boutonVisualisation . $boutonRetour, 'codeHtmlInFormAfterFields' => $listeTriableObject->getJSInitAfterListDragAndDrop());
         $html .= $f->afficherFromArray($configForm);
         $html .= $popupChoixAdresses->getDiv(array('lienSrcIFrame' => $this->creerUrl('', 'recherche', array('noHeaderNoFooter' => 1, 'modeAffichage' => 'popupRechercheAdresseAdminParcours')), 'width' => 750, 'height' => 500, 'left' => 10, 'top' => 70, 'titre' => 'archi-strasbourg.org : Parcours'));
         $html .= $popupVisualisationGoogleMap->getDiv(array('lienSrcIFrame' => ''));
         // on ne precharge pas la carte google map sinon il y a un bug au niveau de la carte , le centre se placerai en haut a gauche
         $html .= "<script  >" . $popupChoixAdresses->getJsToDragADiv() . "</script>";
         // on rend le div deplacable
         $html .= "<script  >" . $popupVisualisationGoogleMap->getJsToDragADiv() . "</script>";
         // on rend le div deplacable
     }
     return $html;
 }