Bonjour,

j'ai plusieurs soucis-questions pour customisé mon scheduler, notamment au niveau des lightbox :

- tout d'abord, j'ai customisé ma lightbox et j'arrive à l'afficher mais une fois créer dans l’affichage sur le scheduler l'événement met bien le nom souhaité mais par contre il met systématiquement à l'heure 00:00, je pense que j'ai oublié de faire un truc pour que ça fonctionne, pouvez vous m'aider ?

- ensuite, je souhaiterais pouvoir créer un événement avec une lightbox et consulter l'événement créer auparavant avec une lightbox différente (les mêmes infos mais pas la même disposition), est-ce possible ?

- pour terminer, je veux à partir d'un bouton à l'extérieur du scheduler appeler la création d'un événement, pour le moment ça m'affiche la bonne lightbox mais je ne peux pas sauvegarder, des idées ?


je vous mets mon code (désolée pour le pavé mais je vous ai tout mis dans la même feuille pour plus de simplicité).

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
 
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 
		<title>Test</title>
 
		<script type="text/javascript" src="../Librairies/dhtmlxSuite/codebase/dhtmlx.js"></script>
		<script type="text/javascript" src="../Librairies/dhtmlxScheduler/codebase/sources/dhtmlxscheduler.js"></script>
		<script type="text/javascript" src="../Librairies/dhtmlxScheduler/codebase/sources/ext/dhtmlxscheduler_agenda_view.js"></script>
		<script type="text/javascript" src="../Librairies/dhtmlxScheduler/codebase/sources/locale/locale_fr.js"></script>
		<script type="text/javascript" src="../Librairies/dhtmlxScheduler/codebase/sources/locale/recurring/locale_recurring_fr.js"></script>
		<script src="../Librairies/dhtmlxScheduler/codebase/sources/ext/dhtmlxscheduler_active_links.js"></script>
 
 
		<script type="text/javascript">
			function init() {
				scheduler.init('scheduler_here',new Date(),"month");
				scheduler.locale.labels.agenda_tab="My Agenda";
			}
 
			// Gère la lightbox customisée
			var html = function(id) { return document.getElementById(id); }; //just a helper
 
			scheduler.showLightbox = function(id) {
				var ev = scheduler.getEvent(id);
				scheduler.startLightbox(id, html("my_form"));
 
				html("description").focus();
				html("description").value = ev.text;
			};
 
			// Gère le btn save de la lightbox customisée
			function save_form() {
				var ev = scheduler.getEvent(scheduler.getState().lightbox_id);
				ev.text = html("description").value;
				scheduler.endLightbox(true, html("my_form"));
			}
 
			// Gère le btn close de la lightbox customisée
			function close_form() {
				scheduler.endLightbox(false, html("my_form"));
			}
 
			// Gère le bouton AJOUTER dans la bande "Aujourd'hui" à droite
			function appel_event(){
				scheduler.showLightbox();
			}
		</script>
 
 
		<link rel="stylesheet" href="../Librairies/dhtmlxScheduler/codebase/sources/skins/dhtmlxscheduler.css" type="text/css">
		<link rel="stylesheet" href="../Librairies/dhtmlxScheduler/codebase/sources/skins/dhtmlxscheduler_flat.css" type="text/css">
 
		<style type="text/css" media="screen">
			html, body{	margin:0px;
						padding:0px;
						height:100%;
						overflow:hidden;
						}   
 
				#my_form {	position: absolute;
							z-index: 10001;
							display: none;
							background-color: white;
							border: 2px outset gray;
							padding: 20px;
							font-family: Tahoma;
							font-size: 10pt;
							}
 
				#my_form label {	width: 200px;	}
 
				.my_block{	display:none;	}
 
				/* Case scheduler */
				#TOUT{	width:100%;
						height:100%;
						float:left;
						}
 
				#scheduler_here{	width:79%;
									height:100%;
									float:left;
									}
 
				#auj{	width:20%;
						height:inherit;
						float:left;
						margin-top:59px;
						margin-left:0.5%;
						border:solid 1px blue;
						}
 
					.brique{	height:6%;
								text-align:center;
								}
 
					#auj_rdv{	height:52%;
								text-align:justify;
								}
 
 
 
			/* *** CSS Arrangements scheduler *** */
				.dhx_cal_prev_button {	border: solid 1px gray;	}
 
 
 
			/* *** CSS bouton spécial *** */
				.onoffswitch {
					    position: relative; width: 90px;
					    -webkit-user-select:none; -moz-user-select:none; -ms-user-select: none;
					}
					.onoffswitch-checkbox {
					    display: none;
					}
					.onoffswitch-label {
					    display: block; overflow: hidden; cursor: pointer;
					    border: 2px solid #999999; border-radius: 20px;
					}
					.onoffswitch-inner {
					    display: block; width: 200%; margin-left: -100%;
					    transition: margin 0.3s ease-in 0s;
					}
					.onoffswitch-inner:before, .onoffswitch-inner:after {
					    display: block; float: left; width: 50%; height: 30px; padding: 0; line-height: 30px;
					    font-size: 14px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold;
					    box-sizing: border-box;
					}
					.onoffswitch-inner:before {
					    content: "ON";
					    padding-left: 10px;
					    background-color: #34A7C1; color: #FFFFFF;
					}
					.onoffswitch-inner:after {
					    content: "OFF";
					    padding-right: 10px;
					    background-color: #EEEEEE; color: #999999;
					    text-align: right;
					}
					.onoffswitch-switch {
					    display: block; width: 18px; margin: 6px;
					    background: #FFFFFF;
					    position: absolute; top: 0; bottom: 0;
					    right: 56px;
					    border: 2px solid #999999; border-radius: 20px;
					    transition: all 0.3s ease-in 0s; 
					}
					.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner {
					    margin-left: 0;
					}
					.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
					    right: 0px; 
					}
		</style>
	</head>
 
 
	<body onload = "init();">
		<!-- INITIALISATION des lightbox customisée -->
		<div id="my_form" class="my_block"><!--style="display: none; top: 100px; left: 100px;"-->
			<div id="ajt_act">
				<div class="title"><h2>AJOUTER UNE ACTIVITE</h2></div>
 
				<div id="act">
					<div>ACTIVITE</div>
 
					<div>
						<table>
							<tr>
								<td><label for="description">Nature</label></td>
								<td>
									<input type="text" id="description" name="description" value="Visite"/>
								</td>
							</tr>
							<tr>
								<td>
									<label>Type</label>
								</td>
								<td>
									<input name="typ" type="text" value="Visite commerciale"/>
								</td>
							</tr>
						</table>
					</div>
				</div><!-- FIN de div "act" -->
 
				<div id="pdv">
					<div>POINT DE VENTE</div>
 
					<div>
						<table>
							<tr>
								<td>PDV</td>
								<td>
									<input id="inp_pdv_1" type="text" value=""/>
									<br/>
									<input id="inp_pdv_2" type="text" value=""/>
								</td>
								<td>
									<input id="btnpdv" name="btnpdv" type="button" value="+" onclick="showPDV();"/>
								</td>
							</tr>
						</table>
					</div>
				</div><!-- FIN de div "pdv" -->
 
				<div id="dat">
					<div>DATE</div>
 
					<div>
						<table>
							<tr><label for="Time">
								<td>Commence le</td>
								<td><input name="c_le" type="date" data-format="dd-mm-yyyy"/></td>
								<td> à</td>
								<td><input name="c_a"  type="time" data-format="hh:mm" value="07:00" /></td>
							</label></tr>
 
							<tr>
								<td>Termine le</td>
								<td><input name="t_le" type="date" data-format="dd-mm-yyyy"/></td>
								<td> à</td>
								<td><input name="t_a"  type="time" data-format="hh:mm" value="07:00" /></td>
							</tr>
						</table>
					</div>
				</div><!-- FIN de div "dat" -->
 
				<div id="eta">
					<div>ETAT</div>
 
					<div>
						<table>
							<tr>
								<td>Rendez-vous confirmé</td>
								<td>
									<!--<input id="btnconf" name="btnconf" class="" type="button" value="+" onclick="showPopup(this);"/>-->
									<div class="onoffswitch">
									    <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" checked>
 
									    <label class="onoffswitch-label" for="myonoffswitch">
									        <span class="onoffswitch-inner"></span>
									        <span class="onoffswitch-switch"></span>
									    </label>
									</div>
								</td>
							</tr>
						</table>
					</div>
				</div><!-- FIN de div "eta" -->
 
				<div id="btn">
					<input type="button" style="width:100px;" name="save"   value="Valider"   id="save"   onclick="save_form()"/>
					<input type="button" style="width:100px;" name="close"  value="Annuler"  id="close"  onclick="close_form()"/>
				</div><!-- FIN de div "btn" -->
			</div><!-- FIN de div "ajt_act" -->
		</div><!-- FIN div "my_form" -->
 
 
		<!-- INITIALISATION du calendrier -->
		<div id="TOUT">
			<div id="scheduler_here" class="dhx_cal_container">
				<div class="dhx_cal_navline">
					<div class="dhx_cal_prev_button">&nbsp;</div>
					<div class="dhx_cal_next_button">&nbsp;</div>
					<div class="dhx_cal_today_button"></div>
					<div class="dhx_cal_date"></div>
					<div class="dhx_cal_tab" name="week_tab"  style="right:140px;"></div>
					<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
				</div>
 
				<div class="dhx_cal_header" style='width:100%; height:100%;'></div>
				<div class="dhx_cal_data" style='width:100%; height:100%;'></div>
			</div><!-- FIN div "scheduler_here" -->
 
			<div id="auj">
				<div class="brique" id="auj_titre">AUJOURD'HUI</div>
				<div class="brique" id="auj_jour"></div>
				<div class="brique" id="auj_date"></div>
				<div class="brique" id="auj_nbRDV"></div>
				<div class="brique" id="auj_text">RENDEZ-VOUS</div>
				<div class="brique" id="auj_rdv"></div>
				<div class="brique" id="auj_nbRDV">
					<input type="button" style="width:100px;" name="save" value="Ajouter" onclick="appel_event();">
				</div>
			</div><!-- FIN div "jour" -->
		</div>
	</body>
</html>