예제 #1
0
 public function newAction($r_controller = null, $r_action = null, $r_id = null)
 {
     if ($this->session->has("couche_id")) {
         $this->tag->setDefault("couche_id", $this->session->get("couche_id"));
     }
     parent::newAction($r_controller, $r_action, $r_id);
 }
예제 #2
0
 public function newAction($r_controller = null, $r_action = null, $r_id = null)
 {
     if ($this->session->has("classe_entite_id")) {
         $this->tag->setDefault("classe_entite_id", $this->session->get("classe_entite_id"));
     }
     $this->tag->setDefault("acces", "L");
     parent::newAction($r_controller, $r_action, $r_id);
 }
 public function newAction($r_controller = null, $r_action = null, $r_id = null)
 {
     $this->persistent->parameters = null;
     $phql = "SELECT c.id, CONCAT(c.nom,\" , \",c.prenom) as  nom FROM  IgoContact c  order by nom";
     $contact_desc = $this->modelsManager->executeQuery($phql);
     $this->view->setVar("contact_desc", $contact_desc);
     parent::newAction($r_controller, $r_action, $r_id);
 }
예제 #4
0
 public function newAction($r_controller = null, $r_action = null, $r_id = null)
 {
     //    $this->definirGroupesPourSelecteur();
     //    $this->definirCouchesPourSelecteur();
     parent::newAction($r_controller, $r_action, $r_id);
 }
 public function newAction($r_controller = null, $r_action = null, $r_id = null)
 {
     $this->tag->setDefault("geometrie_type", "V");
     parent::newAction($r_controller, $r_action, $r_id);
 }
예제 #6
0
 /**
  * Displayes the creation form
  */
 public function newAction($r_controller = null, $r_action = null, $r_id = null)
 {
     parent::newAction($r_controller, $r_action, $r_id);
     /*
            $igo_couche = IgoCouche::findFirstByid($id);
                 if (!$igo_couche) {
                     $this->flash->error("Couche $id non-trouvée");
                 } else {
                     $this->tag->setDefault("acces", $igo_couche->IgoGeometrie->acces);
                 }*/
     $this->setGeometrieDesc();
     if ($this->session->has("geometrie_id")) {
         $geometrie_id = $this->session->get("geometrie_id");
         $this->tag->setDefault("geometrie_id", $geometrie_id);
         $igo_geometrie = IgoGeometrie::findFirstByid($geometrie_id);
         $this->tag->setDefault("acces", $igo_geometrie->acces);
     }
 }
예제 #7
0
 public function traiteMapfileAction($r_controller = null, $r_action = null, $r_id = null)
 {
     parent::newAction($r_controller, $r_action, $r_id);
     if (!$this->request->isPost()) {
         return $this->dispatcher->forward(array("controller" => $this->ctlName, "action" => "index"));
     }
     $this->view->pick("gestion_couche/creation");
     $code = $this->request->getPost("code");
     $code = $this->traiteClass($code);
     $lignes = explode("\n", $code);
     $mf_layer_meta_def = "";
     $mf_layer_def = "";
     $meta = false;
     $projection = false;
     foreach ($lignes as $ligne) {
         if ($projection) {
             $this->tag->setDefault('mf_layer_projection', trim($ligne, " '\"\t\n\r"));
             $projection = false;
             continue;
         }
         if (trim($ligne) == "" || trim($ligne) == "LAYER") {
             continue;
         }
         preg_match("/[\\s]?(?P<element>[^\\s]+)\\s+(?P<contenu>[^#\n]*)/i", $ligne, $matches);
         if (!isset($matches['contenu'])) {
             //echo "Pas de match pour $ligne <br>";
             continue;
         } else {
             //printf ("Élément: %s  Contenu: %s <br>",$matches['element'],$matches['contenu']);
         }
         switch ($matches['element']) {
             case 'NAME':
                 $this->tag->setDefault('mf_layer_name', trim($matches['contenu'], "'\"\n\r"));
                 $this->tag->setDefault('fiche_csw_id', trim($matches['contenu'], "'\"\n\r"));
                 $catalogue = IgoCatalogueCsw::findFirst();
                 $this->tag->setDefault('catalogue_csw_id', $catalogue->id);
                 $igoClasseEntite = IgoClasseEntite::findFirst("nom='" . trim($matches['contenu'], "'\"\n\r") . "'");
                 if ($igoClasseEntite) {
                     $this->tag->setDefault('classe_entite_id', $igoClasseEntite->id);
                 }
                 break;
             case 'TYPE':
                 $igoGeometrieType = IgoGeometrieType::findFirst("layer_type='" . trim($matches['contenu'], "\n\r") . "'");
                 if ($igoGeometrieType) {
                     $this->tag->setDefault('geometrie_type_id', $igoGeometrieType->id);
                 }
                 break;
             case 'GROUP':
                 $this->tag->setDefault('mf_layer_group', trim($matches['contenu'], "'\"\n\r"));
                 break;
             case 'CONNECTIONTYPE':
                 //TODO aller chercher la connection
                 $igoConnexionType = IgoConnexionType::findFirst("nom='" . trim($matches['contenu'], "\n\r") . "'");
                 if ($igoConnexionType) {
                     $this->tag->setDefault('connexion_type_id', $igoConnexionType->id);
                 }
                 break;
             case 'CONNECTION':
                 $this->tag->setDefault('connexion', trim($matches['contenu'], "'\"\n\r"));
                 // TODO bypasser l'erreur de phql
                 $where = "connexion like '" . trim(str_replace("'", "_", trim($matches['contenu'], "'\"\n\r"))) . "'";
                 $igoConnexion = IgoConnexion::findFirst($where);
                 //var_dump($where);
                 if ($igoConnexion) {
                     $this->tag->setDefault('connexion_id', $igoConnexion->id);
                 }
                 break;
             case 'DATA':
                 $this->tag->setDefault('mf_layer_data', trim($matches['contenu'], "'\"\n\r"));
                 break;
             case 'MINSCALE':
                 $this->tag->setDefault('mf_layer_minscale_denom', trim($matches['contenu'], "'\"\n\r"));
                 break;
             case 'MAXSCALE':
                 $this->tag->setDefault('mf_layer_maxscale_denom', trim($matches['contenu'], "'\"\n\r"));
                 break;
             case 'LABELMINSCALE':
                 $this->tag->setDefault('mf_layer_labelminscale_denom', trim($matches['contenu'], "'\"\n\r"));
                 break;
             case 'LABELMAXSCALE':
                 $this->tag->setDefault('mf_layer_labelmaxscale_denom', trim($matches['contenu'], "'\"\n\r"));
                 break;
             case 'OPACITY':
                 $this->tag->setDefault('mf_layer_opacity', trim($matches['contenu'], "'\"\n\r"));
                 break;
             case 'FILTER':
                 $this->tag->setDefault('mf_layer_filter', trim($matches['contenu'], "'\"\n\r"));
                 break;
             case '"wms_group_title"':
                 $this->tag->setDefault('wms_group_title', trim($matches['contenu'], "'\"\n\r"));
                 break;
             case '"wms_name"':
                 $this->tag->setDefault('wms_name', trim($matches['contenu'], "'\"\n\r"));
                 break;
             case '"wms_title"':
                 $this->tag->setDefault('wms_title', trim($matches['contenu'], "'\"\n\r"));
                 break;
             case '"z_order"':
                 $this->tag->setDefault('z_order', trim($matches['contenu'], "'\"\n\r"));
                 break;
             case '"msp_classe_meta"':
                 $this->tag->setDefault('fiche_csw_id', trim($matches['contenu'], "'\"\n\r"));
                 break;
             case 'PROJECTION':
                 $projection = true;
                 break;
             case 'METADATA':
                 $meta = true;
                 break;
             case 'END':
                 $meta = false;
                 break;
             case 'PROCESSING':
                 break;
             default:
                 if ($meta) {
                     $mf_layer_meta_def = $mf_layer_meta_def . "\n" . $ligne;
                 } else {
                     $mf_layer_def = $mf_layer_def . "\n" . $ligne;
                 }
         }
         $this->tag->setDefault('mf_layer_meta_def', trim($mf_layer_meta_def, "'\"\n\r"));
         $this->tag->setDefault('mf_layer_def', trim($mf_layer_def, "'\"\n\r"));
     }
 }