/[openfoncier]/branches/3.14.x-lettrerar/app/geolocalisation.view.php
ViewVC logotype

Diff of /branches/3.14.x-lettrerar/app/geolocalisation.view.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2367 by softime, Thu Oct 3 10:18:04 2013 UTC revision 2897 by nhaye, Mon Mar 31 15:35:45 2014 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /**  /**
3   *   * Affichage des boutons d'actions et des données liés à la géolocalisation
4   *   *
5   * @package openfoncier   * @package openfoncier
6   * @version SVN : $Id$   * @version SVN : $Id$
# Line 30  if (!is_null($idx)){ Line 30  if (!is_null($idx)){
30      $sqlDonneesDI = "SELECT dossier, geom, dossier_libelle,      $sqlDonneesDI = "SELECT dossier, geom, dossier_libelle,
31              terrain_references_cadastrales, terrain_adresse_voie_numero,              terrain_references_cadastrales, terrain_adresse_voie_numero,
32              terrain_adresse_voie, terrain_adresse_lieu_dit, terrain_adresse_localite,              terrain_adresse_voie, terrain_adresse_lieu_dit, terrain_adresse_localite,
33              terrain_adresse_code_postal, terrain_adresse_bp, terrain_adresse_cedex,              terrain_adresse_code_postal, terrain_adresse_bp, terrain_adresse_cedex
             servitude  
34              FROM ".DB_PREFIXE."dossier              FROM ".DB_PREFIXE."dossier
35              WHERE dossier = '$idx'";              WHERE dossier = '$idx'";
36      $resDonneesDI = $f->db->query($sqlDonneesDI);      $resDonneesDI = $f->db->query($sqlDonneesDI);
# Line 39  if (!is_null($idx)){ Line 38  if (!is_null($idx)){
38      $f->isDatabaseError($resDonneesDI);      $f->isDatabaseError($resDonneesDI);
39      $rowDonneesDI = &$resDonneesDI->fetchRow(DB_FETCHMODE_ASSOC);      $rowDonneesDI = &$resDonneesDI->fetchRow(DB_FETCHMODE_ASSOC);
40    
41        // Récupération des contraintes liées au DI
42        $sqlDossierContrainte = "SELECT dossier_contrainte, reference
43                FROM ".DB_PREFIXE." dossier_contrainte
44                WHERE dossier = '".$idx."'";
45        $resDossierContrainte = $f->db->query($sqlDossierContrainte);
46        $f->addToLog("app/geolocalisation.view.php : db->query(\"".$sqlDossierContrainte."\")", VERBOSE_MODE);
47        $f->isDatabaseError($resDossierContrainte);
48    
49      //      //
50      $geom = "";      $geom = "";
51      //      //
# Line 49  if (!is_null($idx)){ Line 56  if (!is_null($idx)){
56          $f->addToLog("app/geolocalisation.view.php : db->getOne(\"".$sqlGEOM."\")", VERBOSE_MODE);          $f->addToLog("app/geolocalisation.view.php : db->getOne(\"".$sqlGEOM."\")", VERBOSE_MODE);
57      }      }
58    
59        // Compteurs de contrainte manuelle et automatique
60        $nb_conrainte_man = 0;
61        $nb_conrainte_sig = 0;
62        // Nombre de contrainte du DI
63        while ($rowDossierContrainte = &$resDossierContrainte->fetchRow(DB_FETCHMODE_ASSOC)) {
64            //
65            if ($rowDossierContrainte['reference'] == 'f') {
66                $nb_conrainte_man++;
67            } else {
68                $nb_conrainte_sig++;
69            }
70        }
71        // Modifie les messages en fonction du nombre de contrainte
72        if ($nb_conrainte_man == 0) {
73            $msg_contrainte_man = _("Aucune contraintes ajoutees depuis l'application");
74        } else {
75            $msg_contrainte_man = $nb_conrainte_man." "._("contrainte(s) ajoutee(s) depuis l'application");
76        }
77        if ($nb_conrainte_sig == 0) {
78            $msg_contrainte_sig = _("Aucune contraintes ajoutees depuis le SIG");
79        } else {
80            $msg_contrainte_sig = $nb_conrainte_sig." "._("contrainte(s) ajoutee(s) depuis le SIG");
81        }
82        $contrainte_val = "<span id='msg_contrainte_man'>".$msg_contrainte_man."</span>"."<br />".
83            "<span id='msg_contrainte_sig'>".$msg_contrainte_sig."</span>";
84    
85      // Affichage du fil d'Ariane      // Affichage du fil d'Ariane
86      $f->displaySubTitle(_("Geolocalisation") . "->" . $rowDonneesDI["dossier_libelle"]);      $f->displaySubTitle(_("Geolocalisation") . "->" . $rowDonneesDI["dossier_libelle"]);
87      $f->display();      $f->display();
# Line 79  if (!is_null($idx)){ Line 112  if (!is_null($idx)){
112    
113      // Bouton retour      // Bouton retour
114      $button_return = '<div class="formControls">      $button_return = '<div class="formControls">
115          <a id="retour-button" onclick="redirectPortletAction(1,\'main\');" href="#" class="retour">Retour</a>          <a id="retour-button" onclick="redirectPortletAction(1,\'main\'); refresh_page_return();" href="#" class="retour">Retour</a>
116      </div>';      </div>';
117    
118      // Affiche le bouton de retour      // Affiche le bouton de retour
# Line 186  if (!is_null($idx)){ Line 219  if (!is_null($idx)){
219      $maj = 3;      $maj = 3;
220    
221      // Champs du formulaire      // Champs du formulaire
222      $champs = array("references_cadastrales", "adresse", "centroide", "servitude");      $champs = array("centroide", "contrainte", "adresse", "references_cadastrales");
223            
224      // Création d'un nouvel objet de type formulaire      // Création d'un nouvel objet de type formulaire
225      $form = new formulaire(NULL, $validation, $maj, $champs);      $form = new formulaire(NULL, $validation, $maj, $champs);
# Line 201  if (!is_null($idx)){ Line 234  if (!is_null($idx)){
234      $form->setLib("references_cadastrales", _("terrain_references_cadastrales"));      $form->setLib("references_cadastrales", _("terrain_references_cadastrales"));
235      $form->setLib("adresse", _("adresse"));      $form->setLib("adresse", _("adresse"));
236      $form->setLib("centroide", _("centroide"));      $form->setLib("centroide", _("centroide"));
237      $form->setLib("servitude", _("contraintes"));      $form->setLib("contrainte", _("contrainte"));
238    
239      // Configuration des données      // Configuration des données
240      $form->setVal("references_cadastrales", $rowDonneesDI["terrain_references_cadastrales"]);      $form->setVal("references_cadastrales", $rowDonneesDI["terrain_references_cadastrales"]);
241      $form->setVal("adresse", $rowDonneesDI["terrain_adresse_voie_numero"]." ".$rowDonneesDI["terrain_adresse_voie"]." ".$rowDonneesDI["terrain_adresse_lieu_dit"]." ".$rowDonneesDI["terrain_adresse_localite"]." ".$rowDonneesDI["terrain_adresse_code_postal"]." ".$rowDonneesDI["terrain_adresse_bp"]." ".$rowDonneesDI["terrain_adresse_cedex"]);      $form->setVal("adresse", $rowDonneesDI["terrain_adresse_voie_numero"]." ".$rowDonneesDI["terrain_adresse_voie"]." ".$rowDonneesDI["terrain_adresse_lieu_dit"]." ".$rowDonneesDI["terrain_adresse_code_postal"]." ".$rowDonneesDI["terrain_adresse_localite"]." ".$rowDonneesDI["terrain_adresse_bp"]." ".$rowDonneesDI["terrain_adresse_cedex"]);
242      if($geom != "") {      if($geom != "") {
243          $form->setVal('centroide',          $form->setVal('centroide',
244              "<a id='action-form-localiser'".              "<a id='action-form-localiser'".
# Line 216  if (!is_null($idx)){ Line 249  if (!is_null($idx)){
249      } else {      } else {
250          $form->setVal('centroide', $geom);          $form->setVal('centroide', $geom);
251      }      }
252      $form->setVal("servitude", $rowDonneesDI["servitude"]);      $form->setVal("contrainte", $contrainte_val);
   
     //  
     printf("<div class='list-data-geolocalisation'>");  
253    
254      // Affichage des champs      // Affichage des champs
255      $form->setBloc("centroide", "D", _("Donnees du dossier d'instruction"), "alignForm col_12");      $form->setBloc("centroide", "D", _("Donnees du dossier d'instruction"), "alignForm col_12");
256          $form->setBloc("centroide", "DF", "", "alignForm col_12");          $form->setBloc("centroide", "DF", "", "geoloc_form alignForm col_12");
257          $form->afficher(array("centroide",), $validation, false, false);          $form->setBloc("contrainte", "DF", "", "geoloc_form alignForm col_12");
258          $form->setBloc("servitude", "DF", "", "alignForm col_12");          $form->setBloc("adresse", "DF", "", "geoloc_form alignForm col_12");
259          $form->afficher(array("servitude",), $validation, false, false);          $form->setBloc("references_cadastrales", "DF", "", "geoloc_form alignForm col_12");
260          $form->setBloc("references_cadastrales", "DF", "", "alignForm col_12");      $form->setBloc("references_cadastrales", "F");
         $form->afficher(array("references_cadastrales",), $validation, false, false);  
         $form->setBloc("adresse", "DF", "", "alignForm col_12");  
         $form->afficher(array("adresse",), $validation, false, false);  
     $form->setBloc("adresse", "F");  
261    
262        $form->afficher($champs, $validation, false, false);
263      // Ferme le tableau pour l'affichage sur deux colonnes      // Ferme le tableau pour l'affichage sur deux colonnes
264      printf("</div></div>");      printf("</div></div>");
265    

Legend:
Removed from v.2367  
changed lines
  Added in v.2897

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26