Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1447 delphine 1
<html lang="fr">
2
	<head>
3
		<title>Chorodep</title>
4
		<meta charset="utf-8">
5
 
6
		<meta name="revisit-after" content="15 days" />
7
		<meta name="robots" content="index,follow" />
8
		<meta name="keywords" content="Tela Botanica, eFlore, chorodep" />
9
		<meta name="description" content="eFlore - Widget de saisie pour Chorologie départementale" />
10
		<style></style>
11
		<script src="http://www.tela-botanica.org/commun/jquery/1.9.1/jquery-1.9.1.min.js"></script>
12
 
13
		<script type="text/javascript">
14
		$(document).ready(function() {
15
			chargerStatutSSO("https://www.tela-botanica.org/service:annuaire:auth");
16
		});
17
		/**
18
		 * Interroge le SSO pour connaître le statut de l'utilisateur, et change le menu
19
		 * Ã  droite de la barre en fonction
20
		 */
21
		function chargerStatutSSO(urlBaseAuth) {
22
			var urlAuth = urlBaseAuth + '/identite';
23
			$.ajax({
24
			    url: urlAuth,
25
			    type: "GET",
26
			    dataType: 'json',
27
			    xhrFields: {
28
			         withCredentials: true
29
			    }
30
			}).done(function(data) {
31
				// connecté
32
				definirUtilisateur(data.token);
33
			});
34
		}
35
 
36
		function definirUtilisateur(jeton) {
37
			var nomComplet = '';
38
			if (jeton != undefined) {
39
				// décodage jeton
40
				var jetonDecode = decoderJeton(jeton);
41
				nomComplet = jetonDecode.intitule;
42
			}
43
			// affichage
44
			$('#bouton-connexion').hide();
45
			$('#utilisateur-connecte').show();
46
			$('#nom-complet').html(nomComplet);
47
		}
48
 
49
		/**
50
		 * Décodage à l'arrache d'un jeton JWT, ATTENTION CONSIDERE QUE LE
51
		 * JETON EST VALIDE, ne pas décoder n'importe quoi - pas trouvé de lib simple
52
		 * Si pb de cross-browser, tenter ceci : https://code.google.com/p/javascriptbase64/
53
		 * ou ceci : https://code.google.com/p/crypto-js
54
		 */
55
		function decoderJeton(jeton) {
56
		    parts = jeton.split('.');
57
		    payload = parts[1];
58
		    payload = atob(payload);
59
		    payload = JSON.parse(payload, true);
60
 
61
		    return payload;
62
		}</script>
63
		<!-- CSS -->
64
		<link rel="stylesheet" href="http://resources.tela-botanica.org/bootstrap/3.2.0/css/bootstrap.min.css" />
65
		<link rel="stylesheet" href="http://resources.tela-botanica.org/bootstrap/3.2.0/css/bootstrap-theme.min.css" />
66
 
67
	</head>
68
	<body>
69
		<ul class="nav navbar-nav navbar-right">
70
				<li id="bouton-connexion" class="dropdown">
71
					<a href="http://www.tela-botanica.org/widget:reseau:auth?origine=http://localhost/eflore-consultation/widget/chorodep/">Connexion</a>
72
				</li>
73
				<li class="dropdown" id="utilisateur-connecte" style="display: none;">
74
					<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span id="nom-complet"></span> <b class="caret"></b></a>
75
					<ul class="dropdown-menu">
76
						<li id="profil-utilisateur"><a href="http://www.tela-botanica.org/inscription">Mon profil</a></li>
77
						<li id="deconnexion"><a href="http://www.tela-botanica.org/widget:reseau:auth?action=deconnexion&origine=http://localhost/eflore-consultation/widget/chorodep/">Déconnexion</a></li>
78
					</ul>
79
				</li>
80
			</ul>
81
 
82
 
83
		<form class="" id="valid" name="valid" action="../Chorodep/validation" method="get">
84
		<div class="panel panel-default">
85
		<!-- Default panel contents -->
86
			<div class="panel-heading">Propositions à valider</div>
87
			<div class="panel-body">
88
				Propositions de présence d'une espèce dans un département à valider pour intégration à la base Chorodep.
89
			</div>
90
			<!-- Table -->
91
			<table class="table">
92
				<thead>
93
					<tr>
94
						<th>#</th>
95
						<th>Auteur</th>
96
						<th>Espece</th>
97
						<th>Département</th>
98
						<th>Statut</th>
99
						<th>Sources</th>
100
						<th>Notes</th>
101
						<th>Provenance</th>
102
						<th>Date proposition</th>
103
						<th>Accepter</th>
104
						<th>Supprimer</th>
105
					</tr>
106
				</thead>
107
				<tbody>
108
					<?php foreach ($liste_prop as $prop) { ?>
109
						<tr>
110
							<th scope="row"><?=$prop['id'];?></th>
111
							<td><?=$prop['auteur_courriel'];?></td>
112
							<td><?=$prop['nom_sci'];?></td>
113
							<td><?=$prop['dept'];?></td>
114
							<td><?=$prop['statut'];?></td>
115
							<td><?=$prop['source'];?></td>
116
							<td><?=$prop['notes'];?></td>
117
							<td><?=$prop['provenance'];?></td>
118
							<td><?=$prop['date_creation'];?></td>
119
							<td><input type="radio" name="<?=$prop['id'];?>" value="1" id="accepter" <?= isset($prop['validation']) && $prop['validation'] == 1 ? "checked='checked'": "";?> /></td>
120
							<td><input type="radio" name="<?=$prop['id'];?>" value="0" id="refuser"  <?= isset($prop['validation']) && $prop['validation'] == 0 ? "checked='checked'": "";?> /></td>
121
						</tr>
122
					<?php } ?>
123
				</tbody>
124
			</table>
125
		</div>
126
		<input type="submit" name="envoyer" id="valider" value="Valider" style="position:relative;left:87%;"/>
127
		</form>
128
 
129
	</body>
130
</html>
131