Subversion Repositories eFlore/Applications.del

Rev

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

Rev 803 Rev 1174
Line 48... Line 48...
48
		$reponseHttp->emettreLesEntetes();
48
		$reponseHttp->emettreLesEntetes();
49
		$corps = $reponseHttp->getCorps();
49
		$corps = $reponseHttp->getCorps();
50
		return $corps;
50
		return $corps;
51
	}
51
	}
Line -... Line 52...
-
 
52
	
-
 
53
	public function modifier($ressources, $parametres) {
-
 
54
		$this->methode = 'modifier';
-
 
55
		$resultat = '';
-
 
56
		$reponseHttp = new ReponseHttp();
-
 
57
		try {
-
 
58
			$this->initialiserRessourcesEtParametres($ressources, $parametres);
-
 
59
			$this->conteneur = new Conteneur($this->parametres);
-
 
60
			$resultat = $this->traiterRessources();
-
 
61
			$reponseHttp->setResultatService($resultat);
-
 
62
		} catch (Exception $e) {
-
 
63
			$reponseHttp->ajouterErreur($e);
-
 
64
		}
-
 
65
		$reponseHttp->emettreLesEntetes();
-
 
66
		$corps = $reponseHttp->getCorps();
-
 
67
		return $corps;
-
 
68
	}
52
	
69
	
53
	private function initialiserRessourcesEtParametres($ressources, $parametres) {
70
	private function initialiserRessourcesEtParametres($ressources, $parametres) {
54
		$this->ressources = $ressources;
71
		$this->ressources = $ressources;
55
		$this->parametres = $parametres;
72
		$this->parametres = $parametres;
Line 98... Line 115...
98
				$service = new $classe($this->conteneur);
115
				$service = new $classe($this->conteneur);
99
				if ($this->methode == 'consulter') {
116
				if ($this->methode == 'consulter') {
100
					$retour = $service->consulter($this->ressources, $this->parametres);
117
					$retour = $service->consulter($this->ressources, $this->parametres);
101
				} elseif ($this->methode == 'ajouter') {
118
				} elseif ($this->methode == 'ajouter') {
102
					$retour = $service->ajouter($this->ressources, $this->parametres);				
119
					$retour = $service->ajouter($this->ressources, $this->parametres);				
-
 
120
				} elseif ($this->methode == 'modifier') {
-
 
121
					$retour = $service->modifier($this->ressources, $this->parametres);				
103
				}
122
				}
104
			}
123
			}
105
		}
124
		}
Line 106... Line 125...
106
		
125
		
Line 118... Line 137...
118
			$this->serviceNom = 'identification-anonyme';
137
			$this->serviceNom = 'identification-anonyme';
119
		} else {
138
		} else {
120
			//S'il y a 1 ressource et que celle ci est 'deconnecter', envoyer vers deconnecter
139
			//S'il y a 1 ressource et que celle ci est 'deconnecter', envoyer vers deconnecter
121
			if (sizeof($this->ressources) == 1 && ($this->ressources[0] == 'deconnecter')) {
140
			if (sizeof($this->ressources) == 1 && ($this->ressources[0] == 'deconnecter')) {
122
				$this->serviceNom = 'deconnecter';
141
				$this->serviceNom = 'deconnecter';
-
 
142
			} else if(sizeof($this->ressources) == 2 && $this->ressources[1] == 'preferences') {
-
 
143
				$this->serviceNom = 'preferences';
123
			} else if (sizeof($this->ressources) == 2) {
144
			} else if (sizeof($this->ressources) == 2) {
124
				$this->serviceNom = 'connecter';
145
				$this->serviceNom = 'connecter';
125
			} else {
146
			} else {
126
				$this->serviceNom = 'identification-anonyme';
147
				$this->serviceNom = 'identification-anonyme';
127
			}
148
			}