-
Notifications
You must be signed in to change notification settings - Fork 0
/
input-ore.aspx
691 lines (581 loc) · 43.3 KB
/
input-ore.aspx
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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="input-ore.aspx.cs" Inherits="input_ore" EnableEventValidation="False" %>
<!DOCTYPE html>
<!-- Javascript -->
<script src="/timereport/include/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="/timereport/include/BTmenu/menukit.js"></script>
<script src="/timereport/include/javascript/timereport.js"></script>
<!-- Jquery + parsley + datepicker -->
<script src="/timereport/include/jquery/jquery-1.9.0.min.js"></script>
<script src="/timereport/include/parsley/parsley.min.js"></script>
<script src="/timereport/include/parsley/it.js"></script>
<script src="/timereport/include/jquery/jquery-ui.min.js"></script>
<script type="text/javascript" src="/timereport/include/jquery/jquery.ui.datepicker-it.js"></script>
<!--SUMO select-->
<script src="/timereport/include/jquery/sumoselect/jquery.sumoselect.js"></script>
<!-- CSS-->
<link href="/timereport/include/jquery/jquery-ui.min.css" rel="stylesheet" />
<link href="/timereport/include/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<link href="/timereport/include/BTmenu/menukit.css" rel="stylesheet" />
<link href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" rel="stylesheet">
<!--SUMO select-->
<link href="/timereport/include/jquery/sumoselect/sumoselect.css" rel="stylesheet" />
<link href="/timereport/include/newstyle20.css" rel="stylesheet" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="shortcut icon" type="image/x-icon" href="/timereport/apple-touch-icon.png" />
<title>
<asp:Literal runat="server" Text="<%$ Resources:titolo%>" />
</title>
</head>
<body>
<!-- *** APPLICTION MENU *** -->
<div include-html="/timereport/include/BTmenu/BTmenuInclude<%= CurrentSession.UserLevel %>-<%= CurrentSession.Language %>.html"></div>
<!-- *** MAINWINDOW *** -->
<div class="container MainWindowBackground">
<form id="FormOre" runat="server" data-parsley-validate>
<div class="row justify-content-center">
<div id="FormWrap" class="col-5 StandardForm">
<asp:FormView ID="FVore" runat="server" DataKeyNames="Hours_Id"
DataSourceID="DSore" align="center" DefaultMode="Edit"
OnItemInserted="FVore_ItemInserted" OnItemUpdated="FVore_ItemUpdated"
OnDataBound="FVore_DataBound"
OnModeChanging="FVore_modechanging" CellPadding="0">
<%-- EDIT --%>
<EditItemTemplate>
<div class="formtitle">
<asp:Literal runat="server" Text="<%$ Resources:Titolo%>" />
<a href="./m_utilita/AuditLog.aspx?RecordId=<%=Request.QueryString["hours_id"]%>&TableName=Hours&TYPE=U&key=<Hours_Id=<%=Request.QueryString["hours_id"] %>>">
<asp:Image ID="Image1" runat="server" ImageUrl="/timereport/images/icons/16x16/cog.png" ToolTip="Vedi log modifiche" meta:resourcekey="Image1Resource1" /></a>
</div>
<!-- *** LB Data *** -->
<div class="input">
<asp:Label CssClass="inputtext" ID="Label11" runat="server" Text="Data" meta:resourcekey="Label11Resource1"></asp:Label>
<asp:Label class="input2col" ID="LBdate" runat="server" Text='<%# Bind("Date","{0:d}") %>' meta:resourcekey="LBdateResource1"></asp:Label>
<asp:Label ID="Label13" runat="server" Text='<%# Bind("name") %>' meta:resourcekey="Label13Resource1"></asp:Label>
</div>
<!-- *** DDL Progetto *** -->
<!-- messaggio parsley di errore disabilitato dropdown-->
<div class="input nobottomborder">
<asp:Label CssClass="inputtext" ID="Label7" runat="server" Text="Progetto" meta:resourcekey="Label7Resource1"></asp:Label>
<!-- per stile CSS -->
<asp:DropDownList ID="DDLprogetto" runat="server" AppendDataBoundItems="True"
meta:resourcekey="DDLprogettoResource1"
data-parsley-errors-container="#valMsg" data-parsley-required="true">
</asp:DropDownList>
</div>
<!-- *** DDL Attività *** -->
<div class="input nobottomborder" id="lbDDLAttivita">
<asp:Label CssClass="inputtext" ID="Label6" runat="server" Text="Attività" meta:resourcekey="Label6Resource1"></asp:Label>
<!-- per stile CSS -->
<asp:DropDownList ID="DDLAttivita" runat="server" AppendDataBoundItems="True"
meta:resourcekey="DDLAttivitaResource1"
data-parsley-errors-container="#valMsg" data-parsley-required="true">
<asp:ListItem meta:resourcekey="ListItemResource1">--seleziona attività--</asp:ListItem>
</asp:DropDownList>
</div>
<!-- *** DDL Opportunità *** -->
<div class="input nobottomborder" id="lbOpportunityId">
<div style="position: absolute">
<asp:Label CssClass="inputtext" runat="server" Text="Opportunità" ></asp:Label>
<!-- per stile CSS -->
<asp:DropDownList ID="DDLOpportunity" runat="server" AppendDataBoundItems="True"
data-parsley-required="true" data-parsley-errors-container="#valMsg">
</asp:DropDownList>
</div>
<br />
</div>
<!-- *** DDL Location *** -->
<div class="input" id="lbDDLLocation">
<div style="position: absolute">
<asp:Label CssClass="inputtext" ID="Label2" runat="server" Text="Luogo" meta:resourcekey="Label2" ></asp:Label>
<!-- per stile CSS -->
<asp:DropDownList ID="DDLLocation" runat="server" AppendDataBoundItems="True"
data-parsley-required="true" data-parsley-errors-container="#valMsg">
<asp:ListItem>-- seleziona valore --</asp:ListItem>
</asp:DropDownList>
<asp:TextBox CssClass="ASPInputcontent" ID="TBLocation" runat="server" Width="270px" Text='<%# Bind("LocationDescription") %>'
data-parsley-errors-container="#valMsg" data-parsley-required="true" />
</div>
<br />
</div>
<!-- *** usato per portare i valori della select sul cliente per poi filtrarli con jquery *** -->
<asp:DropDownList ID="DDLhidden" runat="server" AppendDataBoundItems="True" Enabled="True"></asp:DropDownList>
<asp:DropDownList ID="DDLHiddenLocation" runat="server" AppendDataBoundItems="True" Enabled="True"></asp:DropDownList>
<!-- *** TB Ore *** -->
<div class="input nobottomborder">
<asp:Label CssClass="inputtext" ID="Label4" runat="server" Text="Ore" meta:resourcekey="Label4Resource1"></asp:Label>
<span class="input2col">
<asp:TextBox CssClass="ASPInputcontent" ID="HoursTextBox" runat="server" Text='<%# Bind("Hours") %>' Columns="5" meta:resourcekey="HoursTextBoxResource1"
data-parsley-errors-container="#valMsg" data-parsley-pattern="^(?=.*[1-9])(\d*\,)?\d+$" data-parsley-required="true" />
</span>
<!-- *** Checkboc Remote *** -->
<%-- <asp:CheckBox ID="CBWorkedInRemote" runat="server" Checked='<%# Bind("WorkedInRemote") %>' />
<asp:Label AssociatedControlID="CBWorkedInRemote" style="padding-right:20px" runat="server" Text="Remoto" meta:resourcekey="CBWorkedInRemote"></asp:Label>--%>
<!-- *** Checkboc Storno *** -->
<asp:CheckBox ID="CancelFlagCheckBox" runat="server" Checked='<%# Bind("CancelFlag") %>' meta:resourcekey="CancelFlagCheckBoxResource1" />
<asp:Label AssociatedControlID="CancelFlagCheckBox" runat="server" Text="Storno" meta:resourcekey="Label5Resource1"></asp:Label>
</div>
<!-- *** DDL Task Name *** -->
<div class="input nobottomborder">
<asp:Label CssClass="inputtext" ID="lblTaskName" runat="server" Text="Task Name"></asp:Label>
<!-- per stile CSS -->
<asp:DropDownList ID="DDLTaskName" runat="server" AppendDataBoundItems="True" Width="376" AutoPostBack="false"
meta:resourcekey="DDLTaskName1" data-parsley-required="true" data-parsley-errors-container="#valMsg">
</asp:DropDownList>
<asp:Button Text="Refresh" CssClass="greybutton" runat="server" ID="btnRefresh" OnClick="btnRefresh_Click"/>
</div>
<!-- *** TB Comment *** -->
<div class="input nobottomborder">
<asp:Label CssClass="inputtext" ID="Label1" runat="server" Text="Nota" meta:resourcekey="Label1Resource1"></asp:Label>
<asp:TextBox ID="TBComment" runat="server" Rows="5" CssClass="textarea"
Text='<%# Bind("Comment") %>' TextMode="MultiLine" Columns="30" meta:resourcekey="TBCommentResource1"
data-parsley-errors-container="#valMsg" data-parsley-validate-if-empty="" data-parsley-testo-obbligatorio="true" />
</div>
<!-- *** TB Competenza *** -->
<div class="input nobottomborder">
<asp:Label CssClass="inputtext" ID="LBAccountingDate" runat="server" Text="Competenza" meta:resourcekey="LBAccountingDateResource1"></asp:Label>
<asp:TextBox CssClass="ASPInputcontent" ID="TBAccountingDate" runat="server" Text='<%# Bind("AccountingDate","{0:d}") %>' Columns="8" meta:resourcekey="TBAccountingDateResource1" autocomplete="off"
data-parsley-errors-container="#valMsg" data-parsley-pattern="/^([12]\d|0[1-9]|3[01])\D?(0[1-9]|1[0-2])\D?(\d{4})$/" />
</div>
<!-- *** BOTTONI *** -->
<div class="buttons">
<div id="valMsg" class="parsely-single-error"></div>
<asp:Button ID="UpdateButton" runat="server" CommandName="Update" CssClass="orangebutton" Text="<%$ Resources:timereport,SAVE_TXT %>" />
<asp:Button ID="UpdateCancelButton" runat="server" CssClass="greybutton" CommandName="Cancel" Text="<%$ Resources:timereport,CANCEL_TXT %>" formnovalidate />
</div>
</EditItemTemplate>
<%-- INSERT --%>
<InsertItemTemplate>
<div class="formtitle">
<asp:Literal runat="server" Text="<%$ Resources:Titolo%>" />
</div>
<!-- *** LB Data *** -->
<div class="input">
<asp:Label CssClass="inputtext" ID="Label11" runat="server" Text="Data" meta:resourcekey="Label11Resource2"></asp:Label>
<asp:Label class="input2col" ID="LBdate" runat="server" Text='<%# Bind("Date") %>' meta:resourcekey="LBdateResource2"></asp:Label>
<asp:Label ID="LBperson" runat="server" Text='<%# Bind("persons_id") %>' meta:resourcekey="LBpersonResource1"></asp:Label>
</div>
<!-- *** DDL Progetto *** -->
<div class="input nobottomborder">
<asp:Label CssClass="inputtext" ID="Label7" runat="server" Text="Progetto" meta:resourcekey="Label7Resource2"></asp:Label>
<!-- per stile CSS -->
<asp:DropDownList ID="DDLprogetto" runat="server" AppendDataBoundItems="True"
meta:resourcekey="DDLprogettoResource2" data-parsley-required="true" data-parsley-errors-container="#valMsg">
</asp:DropDownList>
</div>
<!-- *** DDL Attività *** -->
<div class="input nobottomborder" id="lbDDLAttivita">
<asp:Label CssClass="inputtext" ID="Label6" runat="server" Text="Attività" meta:resourcekey="Label6Resource2"></asp:Label>
<!-- per stile CSS -->
<asp:DropDownList ID="DDLAttivita" runat="server" AppendDataBoundItems="True"
meta:resourcekey="DDLAttivitaResource2" data-parsley-required="true"
data-parsley-errors-container="#valMsg">
</asp:DropDownList>
</div>
<!-- *** DDL Opportunity *** -->
<div class="input nobottomborder" id="lbOpportunityId">
<div style="position:absolute">
<asp:Label CssClass="inputtext" runat="server" Text="Opportunità" ></asp:Label>
<!-- per stile CSS -->
<asp:DropDownList ID="DDLOpportunity" runat="server" AppendDataBoundItems="True"
data-parsley-required="true" data-parsley-errors-container="#valMsg">
</asp:DropDownList>
</div>
<br />
</div>
<!-- *** DDL Location *** -->
<div class="input" id="lbDDLLocation">
<asp:Label CssClass="inputtext" ID="Label2" runat="server" Text="Luogo" meta:resourcekey="Label2"></asp:Label>
<!-- per stile CSS -->
<asp:DropDownList ID="DDLLocation" runat="server" AppendDataBoundItems="True"
data-parsley-required="true" data-parsley-errors-container="#valMsg">
</asp:DropDownList>
<asp:TextBox CssClass="ASPInputcontent" ID="TBLocation" runat="server" Width="270px"
data-parsley-errors-container="#valMsg" data-parsley-required="true" />
</div>
<!-- *** usato per portare i valori della select sul cliente per poi filtrarli con jquery *** -->
<asp:DropDownList ID="DDLhidden" runat="server" AppendDataBoundItems="True" Enabled="True"></asp:DropDownList>
<asp:DropDownList ID="DDLHiddenLocation" runat="server" AppendDataBoundItems="True" Enabled="True"></asp:DropDownList>
<!-- *** TB Ore *** -->
<div class="input nobottomborder">
<asp:Label CssClass="inputtext" ID="Label4" runat="server" Text="Ore" meta:resourcekey="Label4Resource2"></asp:Label>
<span class="input2col">
<asp:TextBox CssClass="ASPInputcontent" ID="HoursTextBox" runat="server" Text='<%# Bind("Hours") %>' Columns="5" meta:resourcekey="HoursTextBoxResource2"
data-parsley-errors-container="#valMsg" data-parsley-pattern="^(?=.*[1-9])(\d*\,)?\d+$" data-parsley-required="true" />
</span>
<!-- *** Checkboc Remote *** -->
<%-- <asp:CheckBox ID="CBWorkedInRemote" runat="server" Checked='<%# Bind("WorkedInRemote") %>' />
<asp:Label AssociatedControlID="CBWorkedInRemote" style="padding-right:20px" runat="server" Text="Remoto" meta:resourcekey="CBWorkedInRemote"></asp:Label>--%>
<!-- *** Checkboc Storno *** -->
<asp:CheckBox ID="CancelFlagCheckBox" runat="server" Checked='<%# Bind("CancelFlag") %>' meta:resourcekey="CancelFlagCheckBoxResource2" />
<asp:Label AssociatedControlID="CancelFlagCheckBox" runat="server" Text="Storno" meta:resourcekey="Label5Resource1"></asp:Label>
</div>
<!-- *** DDL Task Name *** -->
<div class="input nobottomborder">
<asp:Label CssClass="inputtext" ID="lblTaskName" runat="server" Text="Task Name"></asp:Label>
<!-- per stile CSS -->
<asp:DropDownList ID="DDLTaskName" runat="server" AppendDataBoundItems="True" Width="376px" AutoPostBack="false"
meta:resourcekey="DDLTaskName2" data-parsley-required="true" data-parsley-errors-container="#valMsg">
</asp:DropDownList>
<asp:Button Text="Refresh" CssClass="greybutton" runat="server" ID="btnRefresh" OnClick="btnRefresh_Click"/>
</div>
<!-- *** TB Comment *** -->
<div class="input nobottomborder">
<asp:Label CssClass="inputtext" ID="Label1" runat="server" Text="Nota" meta:resourcekey="Label1Resource2"></asp:Label>
<asp:TextBox ID="TBComment" runat="server" Rows="5" CssClass="textarea"
Text='<%# Bind("Comment") %>' TextMode="MultiLine" Columns="30" meta:resourcekey="TBCommentResource2"
data-parsley-validate-if-empty="" data-parsley-errors-container="#valMsg" data-parsley-testo-obbligatorio="true" />
</div>
<!-- *** TB Competenza *** -->
<div class="input nobottomborder">
<asp:Label CssClass="inputtext" ID="LBAccountingDate" runat="server" Text="Competenza" meta:resourcekey="LBAccountingDateResource2"></asp:Label>
<asp:TextBox CssClass="ASPInputcontent" ID="TBAccountingDate" runat="server" Text='<%# Bind("AccountingDate") %>' Columns="8" meta:resourcekey="TBAccountingDateResource2" autocomplete="off"
data-parsley-errors-container="#valMsg" data-parsley-pattern="/^([12]\d|0[1-9]|3[01])\D?(0[1-9]|1[0-2])\D?(\d{4})$/" />
</div>
<!-- *** BOTTONI *** -->
<div class="buttons">
<div id="valMsg" class="parsely-single-error"></div>
<asp:Button ID="InsertButton" runat="server" CommandName="Insert" CssClass="orangebutton" Text="<%$ Resources:timereport,SAVE_TXT %>" />
<asp:Button ID="UpdateCancelButton" runat="server" CssClass="greybutton" CommandName="Cancel" Text="<%$ Resources:timereport,CANCEL_TXT %>" formnovalidate />
</div>
</InsertItemTemplate>
<%-- DISPLAY --%>
<ItemTemplate>
<div class="formtitle">
<asp:Literal runat="server" Text="<%$ Resources:Titolo%>" />
<a href="./m_utilita/AuditLog.aspx?RecordId=<%=Request.QueryString["hours_id"]%>&TableName=Hours&TYPE=U&key=<Hours_Id=<%=Request.QueryString["hours_id"] %>>">
<asp:Image runat="server" ImageUrl="/timereport/images/icons/16x16/cog.png" ToolTip="Vedi log modifiche" meta:resourcekey="ImageResource1" /></a>
</div>
<!-- *** LB Data *** -->
<div class="input">
<asp:Label CssClass="inputtext" ID="Label11" runat="server" Text="Data" meta:resourcekey="Label11Resource3"></asp:Label>
<asp:Label class="input2col" ID="LBdate" runat="server" Text='<%# Bind("Date","{0:d}") %>' meta:resourcekey="LBdateResource3"></asp:Label>
<asp:Label ID="LBperson" runat="server" Text='<%# Bind("name") %>' meta:resourcekey="LBpersonResource2"></asp:Label>
</div>
<!-- *** DDL Progetto *** -->
<div class="input nobottomborder">
<asp:Label CssClass="inputtext" ID="Label7" runat="server" Text="Progetto" meta:resourcekey="Label7Resource3"></asp:Label>
<asp:DropDownList ID="DDLprogetto" runat="server" AppendDataBoundItems="True"
Enabled="False"
meta:resourcekey="DDLprogettoResource3">
</asp:DropDownList>
</div>
<!-- *** DDL Attività *** -->
<div class="input nobottomborder" id="lbDDLAttivita">
<asp:Label CssClass="inputtext" ID="Label8" runat="server" Text="Attività" meta:resourcekey="Label8Resource1"></asp:Label>
<asp:DropDownList ID="DDLAttivita" runat="server" AppendDataBoundItems="True"
Enabled="False" meta:resourcekey="DDLAttivitaResource3">
</asp:DropDownList>
</div>
<!-- *** DDL Opportunità *** -->
<div class="input nobottomborder" id="lbOpportunityId">
<div style="position: absolute">
<asp:Label CssClass="inputtext" runat="server" Text="Opportunità" ></asp:Label>
<!-- per stile CSS -->
<asp:DropDownList ID="DDLOpportunity" runat="server" AppendDataBoundItems="True"
Enabled="False">
</asp:DropDownList>
</div>
<br />
</div>
<!-- *** DDL Location *** -->
<div class="input" id="lbDDLLocation">
<asp:Label CssClass="inputtext" ID="Label2" runat="server" Text="Luogo" meta:resourcekey="Label2"></asp:Label>
<!-- per stile CSS -->
<asp:DropDownList ID="DDLLocation" runat="server" AppendDataBoundItems="True" Enabled="False">
</asp:DropDownList>
<asp:TextBox CssClass="ASPInputcontent" Enabled="False" ID="TBLocation" runat="server" Width="270px" Text='<%# Bind("LocationDescription") %>' />
</div>
<!-- *** usato per portare i valori della select sul cliente per poi filtrarli con jquery *** -->
<asp:DropDownList ID="DDLhidden" runat="server" AppendDataBoundItems="True" Enabled="True"></asp:DropDownList>
<asp:DropDownList ID="DDLHiddenLocation" runat="server" AppendDataBoundItems="True" Enabled="True"></asp:DropDownList>
<!-- *** TB Ore *** -->
<div class="input nobottomborder">
<asp:Label CssClass="inputtext" ID="Label4" runat="server" Text="Ore" meta:resourcekey="Label4Resource3"></asp:Label>
<span class="input2col">
<asp:TextBox CssClass="ASPInputcontent" ID="HoursTextBox" runat="server" Text='<%# Bind("Hours") %>' Columns="5" Enabled="False" meta:resourcekey="HoursTextBoxResource3" />
</span>
<!-- *** Checkboc Remote *** -->
<%-- <asp:CheckBox ID="CBWorkedInRemote" runat="server" Checked='<%# Bind("WorkedInRemote") %>' />
<asp:Label AssociatedControlID="CBWorkedInRemote" style="padding-right:20px" runat="server" Text="Remoto" meta:resourcekey="CBWorkedInRemote"></asp:Label>--%>
<!-- *** Checkboc Storno *** -->
<asp:CheckBox ID="disCancelFlagCheckBox" runat="server" Checked='<%# Bind("CancelFlag") %>' meta:resourcekey="CancelFlagCheckBoxResource1" />
<asp:Label runat="server" AssociatedControlID="disCancelFlagCheckBox" Text="Storno" meta:resourcekey="Label5Resource1"></asp:Label>
</div>
<!-- *** DDL Task Name *** -->
<div class="input nobottomborder">
<asp:Label CssClass="inputtext" ID="lblTaskName" runat="server" Text="Task Name"></asp:Label>
<!-- per stile CSS -->
<asp:DropDownList ID="DDLTaskName" runat="server" AppendDataBoundItems="True" Width="376" AutoPostBack="false"
meta:resourcekey="DDLTaskName3" data-parsley-required="true" data-parsley-errors-container="#valMsg">
</asp:DropDownList>
<asp:Button Text="Refresh" CssClass="greybutton" runat="server" ID="btnRefresh"/>
</div>
<div class="input nobottomborder">
<asp:Label CssClass="inputtext" ID="CommentTextBox" runat="server" Text="Nota" meta:resourcekey="CommentTextBoxResource1"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Rows="5" CssClass="textarea" Text='<%# Bind("Comment") %>' TextMode="MultiLine" Columns="30" Enabled="False" meta:resourcekey="TextBox2Resource1" />
</div>
<!-- *** TB Comment *** -->
<div class="input nobottomborder">
<asp:Label ID="LBAccountingDate" runat="server" Text="Competenza" CssClass="inputtext" meta:resourcekey="LBAccountingDateResource3"></asp:Label>
<asp:TextBox ID="TBAccountingDate" Enabled="false" runat="server" Text='<%# Bind("AccountingDate","{0:d}") %>' CssClass="ASPInputcontent" Columns="8" Width="100px" meta:resourcekey="LBAccountingDateDisplayResource1"></asp:TextBox>
</div>
<!-- *** BOTTONI *** -->
<div class="buttons">
<asp:Button ID="UpdateCancelButton" runat="server" CssClass="greybutton" CommandName="Cancel" Text="<%$ Resources:timereport,CANCEL_TXT %>" formnovalidate />
</div>
</ItemTemplate>
</asp:FormView>
</div>
<!-- FormWrap -->
</div>
<!-- LastRow -->
</form>
<!-- Form -->
</div>
<!-- container -->
<!-- *** FOOTER *** -->
<div class="container bg-light">
<footer class="footer mt-auto py-3 bg-light">
<div class="row">
<div class="col-md-4" id="WindowFooter-L">Aeonvis Spa <%= DateTime.Now.Year %></div>
<div class="col-md-4" id="WindowFooter-C">cutoff: <%= CurrentSession.sCutoffDate %></div>
<div class="col-md-4" id="WindowFooter-R"><%= CurrentSession.UserName %></div>
</div>
</footer>
</div>
<!-- *** DATASOURCE *** -->
<asp:SqlDataSource ID="DSore" runat="server"
ConnectionString="<%$ ConnectionStrings:MSSql12155ConnectionString %>"
SelectCommand="SELECT Hours.Hours_Id, Hours.Projects_Id, Hours.Persons_id, Hours.Date, Hours.Hours, Hours.HourType_Id, Hours.CancelFlag, Hours.Comment, Hours.TransferFlag, Hours.Activity_id, Persons.Name, Hours.CreatedBy, Hours.CreationDate, Hours.LastModifiedBy, Hours.LastModificationDate,AccountingDate, WorkedInRemote, LocationKey, LocationDescription, LocationType, hours.ClientManager_id, hours.AccountManager_id, hours.Company_id,hours.OpportunityId,hours.SalesforceTaskID FROM Hours INNER JOIN Persons ON Hours.Persons_id = Persons.Persons_id WHERE (Hours.Hours_Id = @hours_id)"
InsertCommand="INSERT INTO Hours(Projects_Id, Persons_id, Date, HourType_Id, Hours, CancelFlag, Comment, TransferFlag, Activity_id, CreatedBy, CreationDate, AccountingDate, WorkedInRemote, LocationKey, LocationDescription, LocationType, ClientManager_id, AccountManager_id, Company_id,OpportunityId,SalesforceTaskID) VALUES (@Projects_id, @Persons_id, @Date, @HourType_id, @Hours, @CancelFlag, @Comment, @TransferFlag, @Activity_id, @CreatedBy, @CreationDate, @AccountingDate, @WorkedInRemote, @LocationKey, @LocationDescription, @LocationType, @ClientManager_id, @AccountManager_id, @Company_id, @OpportunityId, @SalesforceTaskID)"
UpdateCommand="UPDATE Hours SET Hours = @Hours, HourType_Id = @HourType_Id, CancelFlag = @CancelFlag, Comment = @Comment, TransferFlag = @TransferFlag, Activity_id = @Activity_id, Projects_Id = @Projects_Id, LastModifiedBy= @LastModifiedBy, LastModificationDate = @LastModificationDate, AccountingDate = @AccountingDate, WorkedInRemote=@WorkedInRemote, LocationKey = @LocationKey, LocationDescription=@LocationDescription, LocationType=@LocationType,OpportunityId=@OpportunityId,SalesforceTaskID=@SalesforceTaskID, AccountManager_id = @AccountManager_id, ClientManager_id=@ClientManager_id WHERE (Hours_Id = @Hours_id)"
OnInserting="DSore_Insert_Update" OnUpdating="DSore_Insert_Update">
<InsertParameters>
<asp:Parameter Name="Projects_id" />
<asp:Parameter Name="Persons_id" />
<asp:Parameter Name="Date" />
<asp:Parameter Name="HourType_id" DefaultValue="1" />
<asp:Parameter Name="Hours" />
<asp:Parameter Name="CancelFlag" />
<asp:Parameter Name="Comment" />
<asp:Parameter Name="LocationKey" />
<asp:Parameter Name="LocationType" />
<asp:Parameter Name="LocationDescription" />
<asp:Parameter Name="ClientManager_id" />
<asp:Parameter Name="AccountManager_id" />
<asp:Parameter Name="Company_id" />
<asp:Parameter Name="TransferFlag" />
<asp:Parameter Name="Activity_id" />
<asp:Parameter Name="CreatedBy" />
<asp:Parameter Name="CreationDate" />
<asp:Parameter Name="AccountingDate" Type="DateTime" />
<asp:Parameter Name="WorkedInRemote" />
<asp:Parameter Name="OpportunityId" />
<asp:Parameter Name="SalesforceTaskID" />
</InsertParameters>
<SelectParameters>
<asp:QueryStringParameter Name="hours_id" QueryStringField="hours_id" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Hours" />
<asp:Parameter Name="HourType_Id" DefaultValue="1" />
<asp:Parameter Name="CancelFlag" />
<asp:Parameter Name="Comment" />
<asp:Parameter Name="TransferFlag" />
<asp:Parameter Name="AccountManager_id" />
<asp:Parameter Name="ClientManager_id" />
<asp:Parameter Name="Activity_id" />
<asp:Parameter Name="Projects_Id" />
<asp:Parameter Name="LocationKey" />
<asp:Parameter Name="LocationType" />
<asp:Parameter Name="LocationDescription" />
<asp:Parameter Name="Hours_id" />
<asp:Parameter Name="CreatedBy" />
<asp:Parameter Name="CreationDate" />
<asp:Parameter Name="LastModifiedBy" />
<asp:Parameter Name="LastModificationDate" />
<asp:Parameter Name="AccountingDate" Type="DateTime" />
<asp:Parameter Name="WorkedInRemote" />
<asp:Parameter Name="OpportunityId" />
<asp:Parameter Name="SalesforceTaskID" />
</UpdateParameters>
</asp:SqlDataSource>
<!-- *** JAVASCRIPT *** -->
<script type="text/javascript">
// include di snippet html per menu and background color mgt
includeHTML();
InitPage("<%=CurrentSession.BackgroundColor%>", "<%=CurrentSession.BackgroundImage%>");
// *** Page Load ***
$(function () {
$("#FVore_TBAccountingDate").datepicker($.datepicker.regional['it']);
$("#FVore_disCancelFlagCheckBox").attr("disabled", true);
$(":checkbox").addClass("css-checkbox"); // post rendering dei checkbox in ASP.NET
// nasconde la select con i valori delle attività per bind sul client
$("#FVore_DDLhidden").hide();
$("#FVore_DDLHiddenLocation").hide();
$('#lbDDLAttivita').hide();
$('#FVore_DDLLocation').hide();
$('#FVore_TBLocation').hide(); // nasconde il box di testo della Location
$('#FVore_DDLTaskName').hide();
$('#FVore_lblTaskName').hide();
$('#FVore_btnRefresh').hide();
//controllo se ci sono task attive cosi da riattivare il componente
$('#FVore_DDLTaskName option').each(function () {
if (this.value != "") {
$('#FVore_DDLTaskName').show();
$('#FVore_lblTaskName').show();
$('#FVore_btnRefresh').show();
return false;
}
});
BindActivity();
BindLocation();
BindOpportunity();
// Sumo Select
$('#FVore_DDLOpportunity').SumoSelect({ search: true, searchText: '' });
$('.SumoSelect').css('width', '270px');
$('.SumoSelect > .optWrapper').css('width', '550px');
});
// *** Esclude i controlli nascosti ***
$('#FormOre').parsley({
excluded: "input[type=button], input[type=submit], input[type=reset], input[type=hidden], [disabled], :hidden"
});
// *** Controllo che esista un commento se il progetto lo richiede ***
window.Parsley.addValidator('testoObbligatorio', {
validateString: function (value) {FVore_DDLLocation
var flagObbligatorio = $("#FVore_DDLprogetto option:selected").attr("data-desc-obbligatorio");
var messaggio = $("#FVore_DDLprogetto option:selected").attr("data-desc-message");
// progetto richiede commento ed il commento è vuoto
if (flagObbligatorio == "True" && $("#FVore_TBComment").val().length == 0)
return $.Deferred().reject(messaggio);
else
return true;
},
messages: {
en: "insert a comment",
it: "inserire un commento"
}
});
$("#FVore_DDLprogetto").on("change", function () {
BindActivity();
BindLocation();
BindOpportunity();
});
// *** popola controllo delle attività ***
function BindActivity() {
var ActivityOn = $("#FVore_DDLprogetto").find("option:selected").attr("data-ActivityOn");
$("#FVore_DDLAttivita").children().remove(); // pulisce tutti gli item della DropDown attività
if (ActivityOn != "True") { // progetto non richiede le attività
$("#FVore_DDLAttivita").append($('<option>', { value: '', text: 'nessun valore' })); // pulisce il campo
$('#lbDDLAttivita').hide();
}
else {
// aggiunge selezione vuota
$("#FVore_DDLAttivita").append($('<option>', { value: '', text: '--- seleziona un elemento ---' }));
// loop su tutti gli item della select nascosta e li linka per il progetto selezionato
$("#FVore_DDLhidden > option").each(function () {
if ($(this).attr("data-projects_id") === $("#FVore_DDLprogetto").find("option:selected").val())
$("#FVore_DDLAttivita").append($('<option>', {
value: $(this).val(),
text: $(this).text(),
selected: $(this)[0].selected
}));
});
$('#lbDDLAttivita').show(); // visualizza DropDown
}
}
function BindOpportunity() {
// gestione Opportunity Id
var OpportunityIsRequired = $("#FVore_DDLprogetto").find("option:selected").attr("data-OpportunityIsRequired");
if (OpportunityIsRequired == "True")
$('#lbOpportunityId').show(); // visualizza DropDown
else
$('#lbOpportunityId').hide(); // visualizza DropDown
}
// *** popola controllo delle Location ***
function BindLocation() {
// se DDL valorizzato a 99999 attiva il testo libero
if ($("#FVore_DDLLocation").val() == 'T:99999') {
$('#FVore_TBLocation').show();
return;
}
var LocationOn = $("#FVore_DDLprogetto").find("option:selected").attr("data-filterlocation");
$("#FVore_DDLLocation").children().remove(); // pulisce tutti gli item della DropDown
if (typeof LocationOn == 'undefined') { // non esiste l'attributo
$("#FVore_DDLLocation").append($('<option>', { value: '', text: 'nessun valore' })); // pulisce il campo
$('#FVore_DDLLocation').hide();
}
else {
// aggiunge selezione vuota
$("#FVore_DDLLocation").append($('<option>', { value: '', text: '-- selezionare un valore --' }));
// loop su tutti gli item della select nascosta e li linka per il progetto selezionato
$("#FVore_DDLHiddenLocation > option").each(function () {
if ($(this).attr("data-filterlocation") === $("#FVore_DDLprogetto").find("option:selected").attr("data-filterlocation"))
$("#FVore_DDLLocation").append($('<option>', {
value: $(this).val(),
text: $(this).text(),
selected: $(this)[0].selected
}));
});
$("#FVore_DDLLocation").append($('<option>', { value: 'T:99999', text: '-- Testo Libero --' }));
$('#FVore_DDLLocation').show(); // visualizza DropDown
$('#FVore_TBLocation').val(""); // reset e spegnimento campo
$('#FVore_TBLocation').hide();
}
}
// Mostra box testo in caso della corrispondente selezione della DDL Location
$("#FVore_DDLLocation").change(function () {
if ($("#FVore_DDLLocation").val() == 'T:99999') // mostra Box Testo
{
/* $('#FVore_DDLLocation').SumoSelect().sumo.unload();*/
$('#FVore_DDLLocation').hide();
$('#FVore_TBLocation').show();
}
});
// Se campo vien sblancato riattiva il DDL
$("#FVore_TBLocation").change(function () {
if ($("#FVore_TBLocation").val() == '') // mostra Box Testo
{
$('#FVore_DDLLocation').val('');
BindLocation(); // ricarica la DDL
}
});
// Alla selezione di una task imposta automaticamente il valore del progetto
$("#FVore_DDLTaskName").change(function () {
console.log($(this).find("option:selected").attr("data-Projects_Id"));
if ($(this).find("option:selected").attr("data-Projects_Id") != '') // mostra Box Testo
{
var projID = $(this).find("option:selected").attr("data-Projects_Id");
var Projects_Name = $(this).find("option:selected").attr("data-Projects_Name");
//controllo per vedere se è un valore in DDL
var IsExists = false;
$('#FVore_DDLprogetto option').each(function () {
if (this.value == projID) {
IsExists = true;
}
});
//controllo se esiste progetto reset
//NON esiste resetto le selezioni
if (IsExists == false) {
$("#FVore_DDLTaskName").val(0);
if (Projects_Name == null) {
alert("Il progetto della task selezionata non \u00E8 stato inviato al Timereport");
} else {
alert("Non si \u00E8 autorizzati alla commessa " + Projects_Name + " rivolgersi al proprio responsabile per l'autorizzazione");
}
}
//imposto il valore e accendo event change
$("#FVore_DDLprogetto").val($(this).find("option:selected").attr("data-Projects_Id")).change();
}
});
$("#FVore_btnRefresh").on("click", function () {
//alert("Handler for `click` called.");
$('#FormOre').off('submit.Parsley');
//$('#FormOre').off('form:validate');
});
</script>
</body>
</html>