Subversion Repositories eFlore/Applications.cel

Rev

Rev 3166 | Rev 3195 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3166 Rev 3194
Line 48... Line 48...
48
                        $mode = self::SERVICE_DEFAUT;
48
                        $mode = self::SERVICE_DEFAUT;
49
                }
49
                }
Line 50... Line 50...
50
 
50
 
Line 51... Line 51...
51
                $this->cel_url_tpl = $this->config['manager']['celUrlTpl'];
51
                $this->cel_url_tpl = $this->config['manager']['celUrlTpl'];
52
 
52
 
53
                if ($_POST != array()) {
53
                if ($_POST != array()) { //print_r($_POST);
54
                        $this->parametres['projet'] = $_POST['projet'];
54
                        $this->parametres['projet'] = $_POST['projet'];
55
                        $this->parametres['langue'] = $_POST['langue'];
55
                        $this->parametres['langue'] = $_POST['langue'];
56
                        if ($mode == 'modification') {
56
                        if ($mode == 'modification') {
Line 69... Line 69...
69
                if (method_exists($this, $methode)) {
69
                if (method_exists($this, $methode)) {
70
                        $retour = $this->$methode();
70
                        $retour = $this->$methode();
71
                } else {
71
                } else {
72
                        $this->messages[] = "Ce type de service '$methode' n'est pas disponible.";
72
                        $this->messages[] = "Ce type de service '$methode' n'est pas disponible.";
73
                }
73
                }
74
 
74
                
75
                $contenu = '';
75
                $contenu = '';
76
                if (is_null($retour)) {
76
                if (is_null($retour)) {
77
                        $this->messages[] = 'La ressource demandée a retourné une valeur nulle.';
77
                        $this->messages[] = 'La ressource demandée a retourné une valeur nulle.';
78
                } else {
78
                } else {
79
                        if (isset($retour['donnees'])) {
79
                        if (isset($retour['donnees'])) {
Line 100... Line 100...
100
                }
100
                }
101
                $param = implode($params, '&');
101
                $param = implode($params, '&');
102
                $url = $this->cel_url_tpl;
102
                $url = $this->cel_url_tpl;
103
                if ($param != "") $url .= '?'.$param;
103
                if ($param != "") $url .= '?'.$param;
104
                $json = $this->getDao()->consulter($url);
104
                $json = $this->getDao()->consulter($url);
105
                $retour['donnees']['widget'] = (array) json_decode($json, true);
105
                $retour['donnees']['widget'] = (array) json_decode($json, true); 
106
                $retour['donnees']['widgetUrlTpl'] = $this->config['manager']['widgetUrlTpl'];
106
                $retour['donnees']['widgetUrlTpl'] = $this->config['manager']['widgetUrlTpl'];
107
                return $retour;
107
                return $retour;
108
        }
108
        }
Line 109... Line 109...
109
 
109
 
Line 126... Line 126...
126
                $tableautype= (array) json_decode($jsontype, true);
126
                $tableautype= (array) json_decode($jsontype, true);
127
                $retour['donnees']['type'] = $tableautype;
127
                $retour['donnees']['type'] = $tableautype;
128
                return $retour;
128
                return $retour;
129
        }
129
        }
Line 130... Line -...
130
 
-
 
131
        private function executerSaisie() {
-
 
132
                $retour = '';
-
 
133
                if (isset($this->parametres['projet'])) {
-
 
134
                        $retour['squelette'] = 'saisie';
-
 
135
                        $url = $this->cel_url_tpl.'?projet='.$this->parametres['projet'];
-
 
136
                        $json = $this->getDao()->consulter($url);
-
 
137
                        $tableau = (array) json_decode($json, true);
-
 
138
                        $retour['donnees']['widget'] = $tableau[0];
-
 
139
                }
-
 
140
                return $retour;
130
 
Line 141... Line 131...
141
        }
131
 
142
 
132
 
143
        private function executerModification() {
133
        private function executerModification() {
144
                $retour = '';
134
                $retour = '';
Line 150... Line 140...
150
                        $retour['donnees']['widget'] = $tableau[0];
140
                        $retour['donnees']['widget'] = $tableau[0];
151
                        $urltype = $this->cel_url_tpl.'?esttype=1';
141
                        $urltype = $this->cel_url_tpl.'?esttype=1';
152
                        $jsontype = $this->getDao()->consulter($urltype);
142
                        $jsontype = $this->getDao()->consulter($urltype);
153
                        $tableautype= (array) json_decode($jsontype, true);
143
                        $tableautype= (array) json_decode($jsontype, true);
154
                        $retour['donnees']['type'] = $tableautype;
144
                        $retour['donnees']['type'] = $tableautype;
155
                }
145
                }//print_r($retour['donnees']);
156
                return $retour;
146
                return $retour;
157
        }
147
        }
158
        private function traiterParametres() {
148
        private function traiterParametres() {
159
                $parametres_flux = '?';
149
                $parametres_flux = '?';
160
                $criteres = array('utilisateur', 'commune', 'dept', 'taxon', 'commentaire', 'date', 'tag', 'motcle', 'projet', 'num_taxon', 'num_nom', 'referentiel', 'groupe_zones_geo');
150
                $criteres = array('utilisateur', 'commune', 'dept', 'taxon', 'commentaire', 'date', 'tag', 'motcle', 'projet', 'num_taxon', 'num_nom', 'referentiel', 'groupe_zones_geo');
Line 172... Line 162...
172
                }
162
                }
173
                return $parametres_flux;
163
                return $parametres_flux;
174
        }
164
        }
Line 175... Line 165...
175
 
165
 
176
        private function traiterParametresModif() {
166
        private function traiterParametresModif() {
177
                $parametres_modif = array();
167
                $parametres_modif = array(); 
178
                foreach ($_POST as $id => $parametres) {
168
                foreach ($_POST as $id => $parametres) {
179
                        if ($parametres != "") {
169
                        if ($parametres != "") {
180
                                $parametres_modif[$id] = $parametres;
170
                                $parametres_modif[$id] = $parametres;
181
                        }
171
                        }