Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 507 Rev 528
Line 11... Line 11...
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
12
 * @version		$Id$
12
 * @version		$Id$
13
 */
13
 */
Line 14... Line 14...
14
 
14
 
-
 
15
class PopupContact extends aControleur {
15
class PopupContact extends aControleur {
16
 
16
	private $conteneur = null;
17
	private $conteneur = null;
-
 
18
	private $imagesApi = null;
-
 
19
	private $utilisateur = null;
17
	private $imagesApi = null;
20
	private $appUrls = null;
18
	private $id_destinataire = '';
21
	private $id_destinataire = '';
Line 19... Line -...
19
	private $id_image = '';
-
 
20
 
22
	private $id_image = '';
21
 
23
 
22
	public function initialiser() {
-
 
23
		$this->capturerParametres();
-
 
24
		$this->setSortie(self::RENDU_SCRIPT, $this->getVue('contact_scripts'));
-
 
25
		$style = '<link href="modules/popup_contact/presentations/styles/contact.css" rel="stylesheet" type="text/css" />';
24
	public function initialiser() {
26
		$this->setSortie(self::RENDU_STYLE, $style);
25
		$this->capturerParametres();
-
 
26
		$this->conteneur = new Conteneur();
-
 
27
		$this->imagesApi = $this->conteneur->getApiImages();
27
		$this->conteneur = new Conteneur();
28
		$this->utilisateur = $this->conteneur->getUtilisateur();
Line 28... Line 29...
28
		$this->imagesApi = $this->conteneur->getApiImages();
29
		$this->appUrls = $this->conteneur->getAppUrls();
29
	}
30
	}
30
 
31
 
Line 39... Line 40...
39
 
40
 
40
	public function executerActionParDefaut() {
41
	public function executerActionParDefaut() {
41
		$this->executerForm();
42
		$this->executerForm();
Line 42... Line 43...
42
	}
43
	}
43
 
44
 
44
	public function executerForm(){
45
	public function executerForm() {
-
 
46
		if ($this->utilisateur->etreIdentifie()) {
45
		$infos = array();
47
			$this->afficherFormContact();
-
 
48
		} else {
-
 
49
			$this->afficherFormIdentification();
Line 46... Line 50...
46
		$infos['idDestinataire'] = $this->id_destinataire;
50
		}
47
		$infos['idImage'] = $this->id_image;
-
 
48
 
51
	}
49
		$this->imagesApi->setProjet('cel');
52
 
50
		$imageInfos = $this->imagesApi->getInfosImageParIdImage($this->id_image);
53
	private function afficherFormContact() {
Line -... Line 54...
-
 
54
		$entete = array();
-
 
55
		$entete['formType'] = 'contact';
-
 
56
		$this->setSortie(self::ENTETE, $this->getVue('contact_entete', $entete));
-
 
57
 
-
 
58
		$infos = array();
-
 
59
		$infos['idDestinataire'] = $this->id_destinataire;
-
 
60
		$infos['idImage'] = $this->id_image;
-
 
61
		$infos['utilisateurCourriel'] = $this->utilisateur->getCourriel();
-
 
62
		$infos['urlPopUp'] = $this->appUrls->obtenirUrlPopUpContact($this->id_destinataire, $this->id_image);
-
 
63
 
-
 
64
		$this->imagesApi->setProjet('cel');
-
 
65
		$imageInfos = $this->imagesApi->getInfosImageParIdImage($this->id_image);
-
 
66
		$idObs = $imageInfos['observation.id'];
-
 
67
		$nomSci = $imageInfos['determination.nom_sci'];
-
 
68
		$date = $imageInfos['date'];
-
 
69
		$lieu = $imageInfos['station.libelle'];
51
		Debug::printr($imageInfos);
70
 
52
		//$infos['sujet'] = "Observation #"+idObs+" de "+nomSci;
71
		$infos['sujet'] = "Observation #$idObs de $nomSci";
Line -... Line 72...
-
 
72
		$infos['message'] = "\n\n\n\n\n\n\n\n--\nConcerne l'observation de $nomSci du $date au lieu $lieu";
-
 
73
 
-
 
74
		$this->setSortie(self::RENDU_CORPS, $this->getVue('form_contact', $infos));
-
 
75
	}
-
 
76
 
-
 
77
	private function afficherFormIdentification() {
-
 
78
		$entete = array();
-
 
79
		$entete['formType'] = 'identification';
-
 
80
		$this->setSortie(self::ENTETE, $this->getVue('contact_entete', $entete));
53
		//$infos['message'] = "\n\n\n\n\n\n\n\n--\nConcerne l'observation de \""+nomSci+'" du "'+date+'" au lieu "'+lieu+'".';
81
 
54
 
82
		$infos = array();
55
		$this->setSortie(self::RENDU_CORPS, $this->getVue('popup_contact', $infos));
83
		$infos['urlPopUp'] = $this->appUrls->obtenirUrlPopUpContact($this->id_destinataire, $this->id_image);