/[openfoncier]/trunk/obj/synchronisationContrainte.class.php
ViewVC logotype

Diff of /trunk/obj/synchronisationContrainte.class.php

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

revision 14063 by softime, Thu Oct 14 12:43:35 2021 UTC revision 14064 by softime, Thu Feb 16 22:52:47 2023 UTC
# Line 204  class SynchronisationContrainte { Line 204  class SynchronisationContrainte {
204      private function collectivite_constraint_sync($collectivite) {      private function collectivite_constraint_sync($collectivite) {
205    
206          $message = "";          $message = "";
207            $correct = true;
208          // Instance geoads          // Instance geoads
209          $extra_params = array(          $extra_params = array(
210              "inst_framework" => $this->f,              "inst_framework" => $this->f,
211          );          );
212          $geoads = new geoads($collectivite, $extra_params);          $geoads = new geoads($collectivite, $extra_params);
213          // Intérogation du web service du SIG          // Intérogation du web service du SIG
214          $this->listContraintesSIG = $geoads->recup_toutes_contraintes($collectivite['insee']);          try {
215                $this->listContraintesSIG = $geoads->recup_toutes_contraintes($collectivite['insee']);
216            }
217            catch(Exception $e) {
218                $correct = false;
219                $message .= 'Caught exception: '.$e->getMessage()."<br />";
220            }
221          
222          //          //
223          // Met à jour toutes les listes des contraintes          // Met à jour toutes les listes des contraintes
224          $this->setAllListContraintes($collectivite["om_collectivite_idx"]);          $this->setAllListContraintes($collectivite["om_collectivite_idx"]);
225          // Initilisation des variables          // Initilisation des variables
         $correct = true;  
226    
227    
228          // Nombre de contrainte "à ajouter"          // Nombre de contrainte "à ajouter"
# Line 647  class SynchronisationContrainte { Line 654  class SynchronisationContrainte {
654       * @return  integer                     clé primaire contrainte       * @return  integer                     clé primaire contrainte
655       */       */
656      private function getContrainte($numero, $collectivite_idx) {      private function getContrainte($numero, $collectivite_idx) {
657            $qres = $this->f->get_one_result_from_db_query(
658          // Initialisation résultat              sprintf(
659          $contrainte = "";                  'SELECT
660                        contrainte
661          // Requête SQL                  FROM
662          $sql = "SELECT contrainte                      %1$scontrainte
663                  FROM ".DB_PREFIXE."contrainte                  WHERE
664                  WHERE numero = '".$numero."'                      numero = \'%2$s\'
665                  AND om_collectivite = ".$collectivite_idx."                      AND om_collectivite = %3$d
666                  AND (om_validite_fin > now() OR om_validite_fin IS NULL)                      AND (
667                  ORDER BY contrainte ASC";                          om_validite_fin > now()
668          $this->f->addToLog("getContrainte() : db->getOne(\"".$sql."\")", VERBOSE_MODE);                          OR om_validite_fin IS NULL
669          $contrainte = $this->f->db->getOne($sql);                      )
670          $this->f->isDatabaseError($contrainte);                  ORDER BY
671                        contrainte ASC',
672          // Retourne résultat                  DB_PREFIXE,
673          return $contrainte;                  intval($numero),
674                    intval($collectivite_idx)
675                ),
676                array(
677                    "origin" => __METHOD__,
678                )
679            );
680            return $qres["result"];
681      }      }
682    
683      /**      /**

Legend:
Removed from v.14063  
changed lines
  Added in v.14064

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26