public function afficheFormulaireAdresse($tabTravail = array(), $modeAffichage = '', $params = array()) { $t = new Template('modules/archi/templates/'); $t->set_filenames(array('rechercheFormulaire' => 'rechercheAvanceeAdresseFormulaire.tpl')); $adresse = new archiAdresse(); switch ($modeAffichage) { case 'calqueEvenement': case 'calqueImage': case 'calqueImageChampsMultiples': case 'calqueImageChampsMultiplesRetourSimple': $t->assign_block_vars('isCalque', array()); $t->assign_vars(array('modeAffichage' => $modeAffichage)); break; case 'popupRechercheAdressePrisDepuis': // cas de la popup sur le lien prisDepuis sur le formulaire de modif d'une photo $t->assign_block_vars('modeAffichage', array('value' => 'popupRechercheAdressePrisDepuis')); $t->assign_block_vars('archiAffichage', array('value' => 'rechercheAvAdresse')); break; case 'popupRechercheAdresseVueSur': // cas de la popup sur le lien prisDepuis sur le formulaire de modif d'une photo $t->assign_block_vars('modeAffichage', array('value' => 'popupRechercheAdresseVueSur')); $t->assign_block_vars('archiAffichage', array('value' => 'rechercheAvAdresse')); break; case 'popupDeplacerEvenementVersGroupeAdresse': $t->assign_block_vars('modeAffichage', array('value' => 'popupDeplacerEvenementVersGroupeAdresse')); break; case 'rechercheAvancee': //$t->assign_block_vars('archiAffichage',array('value'=>'resultatsRechercheAvancee')); $t->assign_block_vars('archiAffichage', array('value' => 'advancedSearch')); break; case 'ajouterInteret': //$t->assign_block_vars('archiAffichage',array('value'=>'advancedSearch')); break; default: $t->assign_block_vars('noCalque', array()); break; } if (isset($params['titre']) && $params['titre'] != '') { $t->assign_vars(array('titre' => $params['titre'])); } else { $t->assign_vars(array('titre' => "Recherche Adresse")); } if (!isset($params['noRechercheParMotCle']) || $params['noRechercheParMotCle'] == false) { $t->assign_block_vars("afficheRechercheMotCle", array()); } if (isset($this->variablesGet['noHeaderNoFooter'])) { $t->assign_block_vars('noHeaderNoFooter', array()); } if (isset($this->variablesGet['idEvenementADeplacer'])) { echo $this->variablesGet['idEvenementADeplacer']; } if (!isset($params['noFormElement']) || $params['noFormElement'] == false) { $t->assign_block_vars('useFormElements', array()); } if ($modeAffichage == 'ajouterInteret') { $t->assign_vars(array('formulaireChoixAdresse' => $adresse->afficheChoixAdresse())); } else { $t->assign_vars(array('formAction' => $this->creerUrl('', 'rechercheAvAdresse'), 'formulaireChoixAdresse' => $adresse->afficheChoixAdresse())); } foreach ($tabTravail as $name => $value) { $t->assign_vars(array($name => $value["value"])); if ($value["error"] != '') { $t->assign_vars(array($name . "-error" => $value["error"])); } } ob_start(); $t->pparse('rechercheFormulaire'); $html = ob_get_contents(); ob_end_clean(); return $html; }
$parametres['modeAffichageLienDetail'] = 'adminPersonneDetail'; $parametres['afficheMiseEnFormeLongText'] = true; $generateur = new formGenerator(); echo $generateur->afficheFormulaireAjout($parametres, $liensExternes); break; case 'accueil': $derniersEvenements = new archiEvenement(); echo $derniersEvenements->afficherListe(array('ordre' => 'dateCreation', 'tri' => 'desc'), 'derniersEvenements.tpl'); break; case 'afficheChoixAdresse': $criteres = array(); if (isset($_GET['typeNew'])) { $criteres = array('typeNew' => $_GET['typeNew']); } $a = new archiAdresse(); echo $a->afficheChoixAdresse($criteres); break; case 'authentification': /* Le formulaire a-t-il deja ete appelé par * une 'action' requerant une connexion ? * */ if (!$afficheAuthentificationAction) { $auth = new archiAuthentification(); echo $auth->afficheFormulaireAuthentification(); } break; case 'authentificationImage': /* Le formulaire a-t-il deja ete appelé par * une 'action' requerant une connexion ? * */ if (!$afficheAuthentificationAction) {
/** * Displaying user interests * * @return string */ public function displayMyInterest() { $auth = new archiAuthentification(); if ($auth->estConnecte()) { $html = ""; $formulaire = new formGenerator(); $utils = new archiUtils(); $ajax = new ajaxObject(); $html .= $ajax->getAjaxFunctions(); $t = new Template($this->getCheminPhysique() . $this->cheminTemplates . "interest/"); $t->set_filenames(array('myinterests' => 'myinterests.tpl')); $a = new archiAdresse(); //Generate address form $formParam = array('afficheNombreResultat' => 1, 'modeAffichage_rue' => 1, 'modeAffichage_sousQuartier' => 1, 'modeAffichage_quartier' => 1, 'modeAffichage_ville' => 1, 'modeAffichage_pays=' > 1); $formAddressAddInterest = $a->afficheChoixAdresse(array('afficheNombreResultat' => 1, 'affichageInteret' => 1)); $paramsFields = array(); $paramsFields[] = array('table' => 'pays', 'value' => 'idPays', 'title' => 'nom'); $paramsFields[] = array('table' => 'ville', 'value' => 'idVille', 'title' => 'nom'); $paramsFields[] = array('table' => 'quartier', 'value' => 'idQuartier', 'title' => 'nom'); $paramsFields[] = array('table' => 'sousQuartier', 'value' => 'idSousQuartier', 'title' => 'nom'); $paramsFields[] = array('table' => 'rue', 'value' => 'idRue', 'title' => 'nom'); $formActionUrl = $this->creerUrl('', 'saveInterest', array()); foreach ($paramsFields as $params) { $options[] = $this->getAllField($params); } $paramsRequest[] = array('table' => '_interetRue', 'field' => 'idRue', 'associateTable' => 'rue'); $paramsRequest[] = array('table' => '_interetSousQuartier', 'field' => 'idSousQuartier', 'associateTable' => 'sousQuartier'); $paramsRequest[] = array('table' => '_interetQuartier', 'field' => 'idQuartier', 'associateTable' => 'quartier'); $paramsRequest[] = array('table' => '_interetVille', 'field' => 'idVille', 'associateTable' => 'ville'); $paramsRequest[] = array('table' => '_interetPays', 'field' => 'idPays', 'associateTable' => 'pays'); $userInterest = $this->getAllInterest($paramsRequest); /* * Array of EVERY interest by categories : street country address etc.. */ foreach ($userInterest as $interestByCat) { if (!isset($interestByCat[0]['vide'])) { $t->assign_block_vars('interestList', array('title' => 'Liste des ' . $interestByCat[0]['titre'] . ' dans les centres d\'intérêt', 'CSSclass' => 'interestList')); /* * Interest of each category */ foreach ($interestByCat as $interest) { /* * Process fields for delete link */ $table = $interest['table']; $fieldId = $interest['field']; $userId = $interest['idUtilisateur']; $interestId = $interest[$fieldId]; $paramsDelete = array($table, $fieldId, $userId, $interestId); $deleteUrl = $this->creerUrl('', 'deleteInterest', array('params' => $paramsDelete)); switch ($interest['associateTable']) { case 'personne': $t->assign_block_vars('interestList.interests', array('name' => $interest['nom'] . " " . $interest['prenom'], 'deleteUrl' => $deleteUrl)); break; default: $t->assign_block_vars('interestList.interests', array('name' => $interest['nom'], 'deleteUrl' => $deleteUrl)); } } } else { $t->assign_block_vars('interestList', array('vide' => 'Aucun résultat', 'title' => 'Liste des ' . $interestByCat[0]['titre'] . ' dans les centres d\'intérêt', 'CSSclass' => 'interestList')); } } $t->assign_vars(array('formAddInterest' => $formAddressAddInterest, 'formActionUrl' => $formActionUrl, 'nameForm' => 'saveInterest')); ob_start(); $t->pparse('myinterests'); $html .= ob_get_contents(); ob_end_clean(); return $html; } else { $this->messages->addError("Veuillez vous connecter pour personnaliser votre flux"); $this->messages->display(); $auth = new ArchiAuthentification(); return $auth->afficheFormulaireAuthentification(); } }