forked from martykan/odorik
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
2055 lines (1903 loc) · 81 KB
/
index.html
File metadata and controls
2055 lines (1903 loc) · 81 KB
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
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html5>
<html>
<head>
<script>
// NASTAVENÍ //
// API uživatelské jméno a heslo :: automatické přihlášení //
var APIuser = "";
var APIpass = "";
// Povolit rychlé kontakty :: true = povolit, false = zakázat //
// př. var enableSpeedDials = false; // zakáže sekci rychlých kontaktů
var enableContacts = true;
// Povolit historii volání :: true = povolit, false = zakázat //
// př. var enableCallHisory = false; // zakáže sekci historie volání
var enableCallHisory = true;
// Povolit statistiky volání :: true = povolit, false = zakázat //
// př. var enableStatistics = false; // zakáže sekci statistiky volání
var enableStatistics = true;
// Musí být povolena alespoň jedna kategorie
// Zamknutá čísla :: čárkou oddělený seznam zkratek (klapek), které nejde editovat //
// př. var lockedNumbers = "1,7" // zakáže čísla 1 a 7
var lockedNumbers = "";
// Skrytí zamknutých čísel :: true = nezobrazovat vůbec, false = zobrazit, ale zakázat úpravy //
// př. var hideLockedNumbers = true // nezobrazí vůbec
var hideLockedNumbers = true;
// Povolené linky :: čárkou oddělený seznam linek, které jsou uživateli dostupné //
// Pokud je pole prázdné, tak jsou všechny linky povolené
// př. var allowedLines = "300100,300200"; // Povolí jen linku 300100 a 300200
var allowedLines = "";
// Povolit přidávání nových čísel :: true = povolit, false = zakázat //
// př. var enableAdding = false // zakáže přidávání
var enableAdding = true;
// Povolit upravování nových čísel :: true = povolit, false = zakázat //
// př. var enableEditing = true // povolí úpravy
var enableEditing = true;
// Povolit mazání nových čísel :: true = povolit, false = zakázat //
// př. var enableRemoving = false // zakáže mazání
var enableRemoving = true;
// Povolit callback :: true = povolit, false = zakázat //
// př. var enableCallback = false // zakáže callback
var enableCallback = true;
// Povolit políčko rychlého callbacku :: true = povolit, false = zakázat //
// př. var enableQuickCallback = false // zakáže políčko callbacku
var enableQuickCallback = true;
// Povolit odhlašovaní uživatele :: true = povolit, false = zakázat //
// př. var enableLogout = false // zakáže odhlašování
var enableLogout = true;
// Povolit import/export :: true = povolit, false = zakázat //
// př. var enableLogout = false // zakáže import/export
var enableImportExport = true;
// Povolit úpravu přímo v tabulce :: true = povolit, false = zakázat //
// Klepněte dvakrát na políčko textu v tabulce a můžete ho přímo upravit //
// př. var enableInlineEditing = false // zakáže úpravy přímo v tabulce
var enableInlineEditing = true;
// Povolit pokročilé filrování :: true = povolit, false = zakázat //
// př. var enableFilters = false; // zakáže filtry
var enableFilters = true;
// Povolit animace :: true = povolit, false = zakázat //
// př. var enableAnimations = false; // zakáže animace
var enableAnimations = true;
// Přednastavené číslo pro callback //
// př. var defaultCallbackNumber = "0085023815827"; // nastaví výchozí číslo pro callback na 0085023815827
var defaultCallbackNumber = "";
// Přednastavená linka pro callback //
// př. var defaultCallbackLine = "623400"; // nastaví výchozí linku pro callback na 623400
var defaultCallbackLine = "";
// Počet položek na stránku //
// př. var pageLength = 24; // nastaví počet položek na stránku na 24
var pageLength = 24;
// Povolit tmavé téma :: true = povolit, false = zakázat //
// Vhodné pro osoby se zrakovými problémy //
// př. var darkTheme = true // povolí tmavé téma
var darkTheme = false;
// KONEC NASTAVENÍ //
// Pokud chcete upravit nějaké názvy, můžete v HTML kódu níže.
</script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Odorik: Webová aplikace</title>
<link href="data:image/x-icon;base64,R0lGODlhIwAeAKEBAOM7O////////////yH5BAEKAAIALAAAAAAjAB4AAAJMjI+pywoPQZssWknp3Tg7vnkfGIoGCZonWppsK76XGsAcbS1wPO20Pvs1bsKKr1gjIhHKZfL4QzlZU2mVdE1lobjmFuJMBMPiB1lUAAA7" rel="icon" type="image/x-icon" />
<!-- Import of CSS libraries (Semantic UI) -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/button.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/card.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/container.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/dimmer.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/dropdown.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/form.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/grid.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/header.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/icon.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/input.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/label.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/loader.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/message.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/menu.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/modal.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/popup.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/reset.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/segment.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/site.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/statistic.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/table.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/transition.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
<link href='https://fonts.googleapis.com/css?family=Lato&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<style>
/* Some small improvements */
.daterangepicker td, .daterangepicker th {
font-size: 10pt;
}
.popup {
-webkit-filter: none !important;
filter: none !important;
}
@media only screen and (max-width: 767px) {
.ui.menu .fitted.item {
padding: 0.8em 1.2em;
}
}
</style>
</head>
<body>
<!-- IE WARNING -->
<!--[if IE]>
<div id="warningIE" style="padding-top: 10%; background: white; width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 10; padding: 15px; text-align: center">
<p>Používáte zastaralý prohlížeč. Nainstalujte si Google Chrome nebo Mozillu Firefox.<br>Pokud používáte jeden z těchto prohlížečů, zkuste znovu načíst stránku klávesou F5.</p>
</div>
<!--<![endif]-->
<!-- CONTAINER -->
<div class="ui container" style="display: none;">
<!-- TITLE -->
<h1 class="ui header">
<br>Odorik.cz<div class="ui grey label">v1.9</div>
<span style="float: right; color: #333" class="sub header" id="credit"></span>
</h1>
<!-- MENU -->
<div class="ui secondary stackable menu">
<!-- CATEGORY SELECTOR DROPDOWN -->
<div class="item fitted">
<div class="ui blue floating button dropdown" id="categorySelector">
<div class="text"></div><i class="dropdown icon"></i>
<div class="menu">
<script>
if(enableContacts){
document.write('<div class="item" data-value="speedDials"><i class="user icon"></i> Rychlé kontakty</div>');
}
if(enableCallHisory){
document.write('<div class="item" data-value="callHistory"><i class="history icon"></i> Výpis volání</div>');
}
if(enableStatistics){
document.write('<div class="item" data-value="statistics"><i class="bar chart icon"></i> Statistiky volání</div>');
}
</script>
</div>
</div>
</div>
<!-- REST OF THE ITEMS (DYNAMICALLY LOADED) -->
<script>
if (enableAdding) {
document.write('<div class="item fitted speedDialsContent"><button class="ui green button" onclick="addContact();"><i class="plus icon"></i> Přidat</button></div>');
}
if(enableFilters) {
document.write('<div class="item fitted callHistoryContent"><button class="ui green button" onclick="filterModal();"><i class="filter icon"></i> Filtrovat</button></div>');
}
document.write('<div class="item fitted statisticsContent callHistoryContent"><div id="reportrange" class="ui button"><i class="calendar icon"></i><span></span> <i class="dropdown icon" style="margin:0"></i></div></div>')
document.write('<div class="item fitted statisticsContent"><div class="ui floating button dropdown" id="statistics-line"><i class="phone icon"></i><div class="text">Všechny</div><i class="dropdown icon"></i><div class="menu"><div class="item" data-value="all">Všechny</div></div></div></div>')
if (enableImportExport) {
document.write('<div class="item fitted speedDialsContent"><button class="ui button" onclick="importExportModal();"><i class="file archive outline icon"></i> Import/Export</button></div>');
}
if (enableLogout) {
document.write('<div class="item fitted"><button class="ui button" onclick="logoutModal();"><i class="sign out icon"></i> Odhlásit</button></div>');
}
if (enableQuickCallback) {
document.write('<div class="right item fitted"><div class="ui action input"><input type="text" name="quick-input" placeholder="Volané číslo"><button id="quick-button" class="ui icon button"><i class="call icon"></i></button></div></div>');
}
</script>
</div>
<!-- SPEED DIALS CONTENT -->
<div class="speedDialsContent">
<!-- TABLE -->
<table class="ui celled compact table">
<thead>
<tr>
<th>Zkratka</th>
<th>Název</th>
<th>Číslo</th>
<th class="one wide"></th>
</tr>
</thead>
<tbody id="tableContacts">
</tbody>
</table>
</div>
<!-- CALL HISTORY CONTENT -->
<div class="callHistoryContent">
<!-- TABLE -->
<table class="ui celled table">
<thead>
<tr>
<th>Druh</th>
<th>Datum</th>
<th>Odkud</th>
<th>Kam</th>
<th>Délka</th>
<th>Cena</th>
<th>Linka</th>
</tr>
</thead>
<tbody id="tableCalls">
</tbody>
<tfoot>
<tr><th colspan="7">
<div class="ui right floated pagination menu">
<a class="icon disabled item" id="prevPage" onclick="if(!$(this).hasClass('disabled')){page-=1;reloadCalls();}">
<i class="left chevron icon"></i>
</a>
<a class="item" id="pageNumber"></a>
<a class="icon disabled item" id="nextPage" onclick="if(!$(this).hasClass('disabled')){page+=1;reloadCalls();}">
<i class="right chevron icon"></i>
</a>
</div>
</th>
</tr>
</tfoot>
</table>
</div>
<!-- STATISTICS CONTENT -->
<div class="statisticsContent">
<div class="ui three column stackable grid">
<div class="row">
<div class="column">
<div class="ui fluid card">
<div class="content">
<div class="header"><i class="right arrow icon"></i> Příchozí hovory</div>
</div>
<div class="content">
<div class="ui horizontal statistics">
<div class="statistic">
<div class="value" id="incomingCount">
0
</div>
<div class="label">
Hovorů
</div>
</div>
<div class="statistic">
<div class="value" id="incomingLength">
0
</div>
<div class="label">
Minut
</div>
</div>
<div class="statistic">
<div class="value" id="incomingPrice">
0
</div>
<div class="label">
Kč
</div>
</div>
</div>
</div>
</div>
</div>
<div class="column">
<div class="ui fluid card">
<div class="content">
<div class="header"><i class="left arrow icon"></i> Odchozí hovory</div>
</div>
<div class="content">
<div class="ui horizontal statistics">
<div class="statistic">
<div class="value" id="outgoingCount">
0
</div>
<div class="label">
Hovorů
</div>
</div>
<div class="statistic">
<div class="value" id="outgoingLength">
0
</div>
<div class="label">
Minut
</div>
</div>
<div class="statistic">
<div class="value" id="outgoingPrice">
0
</div>
<div class="label">
Kč
</div>
</div>
</div>
</div>
</div>
</div>
<div class="column">
<div class="ui fluid card">
<div class="content">
<div class="header"><i class="forward mail arrow icon"></i> Přesměrované hovory</div>
</div>
<div class="content">
<div class="ui horizontal statistics">
<div class="statistic">
<div class="value" id="redirectedCount">
0
</div>
<div class="label">
Hovorů
</div>
</div>
<div class="statistic">
<div class="value" id="redirectedLength">
0
</div>
<div class="label">
Minut
</div>
</div>
<div class="statistic">
<div class="value" id="redirectedPrice">
0
</div>
<div class="label">
Kč
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="ui stackable grid">
<div class="row">
<div class="eleven wide column">
<h3>Podle destinace</h3>
<table class="ui black celled table">
<thead>
<tr>
<th>Destinace</th>
<th>Počet</th>
<th>Délka</th>
<th>Cena</th>
<th>Za minutu</th>
<th>Směr</th>
</tr>
</thead>
<tbody id="destinationStatistics">
</tbody>
</table>
</div>
<div class="five wide column">
<h3>Zmeškané</h3>
<table class="ui red celled table">
<thead>
<tr>
<th>Číslo</th>
<th>Počet</th>
</tr>
</thead>
<tbody id="missedStatistics">
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- DELETE MODAL -->
<div class="ui modal" id="deleteModal">
<i class="close icon"></i>
<div class="header">
Smazat kontakt
</div>
<div class="content">
<div class="description">
<p>Opravdu chcete smazat tento rychlý kontakt?</p>
</div>
</div>
<div class="actions">
<div class="ui black deny button">
Ne
</div>
<div class="ui positive right labeled icon button">
Smazat
<i class="trash icon"></i>
</div>
</div>
</div>
<!-- EDIT MODAL -->
<div class="ui modal" id="editModal">
<i class="close icon"></i>
<div class="header">
Upravit kontakt
</div>
<div class="content">
<form class="ui form">
<div class="field">
<label>Zkratka</label>
<input type="text" name="edit-shortcut">
</div>
<div class="field">
<label>Název</label>
<input type="text" name="edit-name">
</div>
<div class="field">
<label>Číslo</label>
<input type="text" name="edit-number">
</div>
</form>
<p><b>TIP: </b>Lze editovat i dvojklikem na hlavní stránce.</p>
</div>
<div class="actions">
<div class="ui black deny button">
Zrušit
</div>
<div class="ui positive right labeled icon button">
Upravit
<i class="checkmark icon"></i>
</div>
</div>
</div>
<!-- ADD MODAL -->
<div class="ui modal" id="addModal">
<i class="close icon"></i>
<div class="header">
Přidat kontakt
</div>
<div class="content">
<form class="ui form">
<div class="field">
<label>Zkratka</label>
<input type="text" name="add-shortcut" placeholder="Zkratka">
</div>
<div class="field">
<label>Název</label>
<input type="text" name="add-name" placeholder="Název">
</div>
<div class="field">
<label>Číslo</label>
<input type="text" name="add-number" placeholder="Číslo">
</div>
</form>
</div>
<div class="actions">
<div class="ui black deny button">
Zrušit
</div>
<div class="ui positive right labeled icon button">
Přidat
<i class="checkmark icon"></i>
</div>
</div>
</div>
<!-- LOGOUT MODAL -->
<div class="ui modal" id="logoutModal">
<i class="close icon"></i>
<div class="header">
Odhlášení
</div>
<div class="content">
<div class="description">
<p>Opravdu se chcete odhlásit? Budete muset znovu zadat API jméno a heslo.</p>
</div>
</div>
<div class="actions">
<div class="ui black deny button">
Zrušit
</div>
<div class="ui positive right labeled icon button">
Odhlásit
<i class="sign out icon"></i>
</div>
</div>
</div>
<!-- LOGIN MODAL -->
<div class="ui small modal" id="loginModal">
<div class="header">
Odorik.cz - webová aplikace
</div>
<div class="content">
<p>API jméno a heslo pro celý účet najdete po přihlášení v menu <a href="https://www.odorik.cz/ucet/nastaveni_uctu.html?ucet_podmenu=api_heslo" target="_blank">Nastavení účtu <i class="ui angle right icon"></i>API heslo.</a></p>
<p>Případně je možné zadat SIP jméno (šestimístné číslo linky) a SIP heslo, pak lze zobrazovat jen hovory na oné lince. </p>
<form class="ui form">
<div class="field">
<label>API jméno</label>
<input type="text" name="login-name">
</div>
<div class="field">
<label>API heslo</label>
<input type="password" name="login-pass">
</div>
</form>
<div class="ui negative message" id="badLogin" style="display: none;">
<div class="header">Nesprávné uživatelské jméno nebo heslo.</div>
</div>
<a href="https://github.com/phavel/odorik/blob/master/index.html">Zdrojový kód</a> této "single page" aplikace je k dispozici <a href="https://github.com/phavel/odorik/">včetně dokumentace</a>. Můžete si jej sami nechat upravit a integrovat např. do vlastních webových stránek.
</div>
<div class="actions">
<div class="ui positive right labeled icon button">
Přihlásit se
<i class="sign in icon"></i>
</div>
</div>
</div>
<!-- CALL MODAL -->
<div class="ui modal" id="callModal">
<i class="close icon"></i>
<div class="header">
Objednat callback
</div>
<div class="content">
<form class="ui form">
<div class="field">
<label>Volané číslo</label>
<input type="text" name="call-target" disabled>
</div>
<div class="field required">
<label>Vaše číslo</label>
<div class="ui input">
<input type="text" name="call-number" placeholder="Číslo, na kterém chcete přijmout callback: číslo vaší linky (s hvězdičkou), rychlá volba, veřejné tel. číslo">
<!--<div class="ui button" onclick=""><i class="user icon"></i>Kontakty</div>-->
</div>
</div>
<div class="field">
<label>Linka, kterou bude callback realizován</label>
<select class="ui dropdown" name="call-line">
<option value="none">Výchozí</option>
</select>
</div>
</form>
</div>
<div class="actions">
<div class="ui black deny button">
Zrušit
</div>
<div class="ui positive right labeled icon button submit">
Volat
<i class="checkmark icon"></i>
</div>
</div>
</div>
<!-- IMPORT/EXPORT MODAL -->
<div class="ui modal" id="importExportModal">
<i class="close icon"></i>
<div class="header">
Import/Export
</div>
<div class="content">
<div class="description">
<p>Tato aplikace umožňuje import a export kontaktů ve formátu <b>vCard</b>.</p>
<p>Pokud chcete importovat data z Google kontaktů:</p>
<ol>
<li>Na stránce <a href="https://www.google.com/contacts/u/0/?cplus=0#contacts" target="_blank">google.com/contacts</a> vyberte kontakty.
<li>Klikněte na <b>Další</b>, a pak <b>Exportovat...</b>. </li>
<li>V následujicím okně vyberte formát exportu <b>vCard</b> a stáhněte a uložte soubor s kontakty kliknutím na tlačítko <b>Exportovat</b>.</li>
<li>Níže v tomto okně klikněte na tlačítko <b>Importovat</b> a vyberte připravený soubor s kontakty.</li>
<li>Jako čísla zkratek budou navrženy následující volné pozice, případně budou použita čísla uložená v poli <b>poznámka</b> u jednotlivých kontaktů.
Před uložením dostanete možnost si vše prohlédnout a ručně upravit, případně import zrušit.
</li>
</ol>
<input id="fileinput" type="file" name="fileinput" style="display: none;" />
</div>
</div>
<div class="actions">
<div class="ui black deny button">
Zrušit
</div>
<a class="ui blue right labeled icon button" download="Kontakty.vcf" href="#" id="exportButton">
Exportovat
<i class="download icon"></i>
</a>
<div class="ui green right labeled icon button" id="importButton">
Importovat
<i class="wizard icon"></i>
</div>
</div>
</div>
<!-- IMPORT WIZARD MODAL -->
<div class="ui modal" id="importWizardModal">
<i class="close icon"></i>
<div class="header">
Import
</div>
<div class="content">
<p>Čísla zkratek i texty k číslům si můžete libovolně upravit. Pokud chcete kontakt vynechat, nastavte jeho zkratku na nulu.</p>
<p><b>Pozor:</b> Pokud navržená čísla zkratek změníte, může se stát, že si následným uložením přepíšete existující záznamy pod stejným číslem.
Budete na to upozorněni zčervenáním čísla zkratky po opuštění editačního pole.</p>
<table class="ui celled compact table">
<thead>
<tr>
<th class="two wide">Zkratka</th>
<th>Název</th>
<th>Číslo</th>
</tr>
</thead>
<tbody id="tableImport">
</tbody>
</table>
</div>
<div class="actions">
<div class="ui black deny button">
Zrušit
</div>
<div class="ui positive right labeled icon button">
Dokončit
<i class="checkmark icon"></i>
</div>
</div>
</div>
<!-- FILTER MODAL -->
<div class="ui modal" id="filterModal">
<i class="close icon"></i>
<div class="header">
Filtrovat
</div>
<div class="content">
<form class="ui form">
<div class="field">
<label>Řazení</label>
<select class="ui fluid dropdown" name="call-order">
<option value="newest" selected>Od nejnovějšího</option>
<option value="oldest">Od nejstaršího</option>
</select>
</div>
<div class="two fields">
<div class="field">
<label>Linka</label>
<select class="ui fluid dropdown" name="line-filter">
<option value="all">Vše</option>
</select>
</div>
<div class="field">
<label>Stav</label>
<select class="ui fluid dropdown" name="state-filter">
<option value="all">Vše</option>
<option value="missed">Zmeškané</option>
<option value="answered">Spojené</option>
</select>
</div>
</div>
<div class="two fields">
<div class="field">
<label>Směr</label>
<select class="ui fluid dropdown" name="direction-filter">
<option value="all">Vše</option>
<option value="out">Odchozí</option>
<option value="in">Příchozí</option>
<option value="redirected">Přesměrované</option>
</select>
</div>
<div class="field">
<label>Cena</label>
<select class="ui fluid dropdown" name="price-filter">
<option value="all">Vše</option>
<option value="free">Jen zdarma</option>
<option value="paid">Jen placené</option>
</select>
</div>
</div>
</form>
</div>
<div class="actions">
<div class="ui black deny button">
Zrušit
</div>
<div class="ui positive right labeled icon button" id="importButton">
Hotovo
<i class="checkmark icon"></i>
</div>
</div>
</div>
<!-- REDIRECTIONS MODAL -->
<div class="ui modal" id="redirectionsModal">
<i class="close icon"></i>
<div class="header">
Seznam přesměrování během hovoru
</div>
<div class="content">
<div>
<!-- TABLE -->
<table class="ui celled table">
<thead>
<tr>
<th>Datum</th>
<th>Odkud</th>
<th>Kam</th>
<th>Délka</th>
<th>Cena</th>
<th>Linka</th>
</tr>
</thead>
<tbody id="tableRedirects">
</tbody>
</table>
</div>
</div>
<div class="actions">
<div class="ui black deny button">
Zavřít
</div>
</div>
</div>
<!-- DIMMERS -->
<div class="ui page dimmer" id="dimmer">
<div class="content">
<div class="center">
<h1 class="ui inverted icon header">
<i class="checkmark icon"></i>
<small></small>
</h1>
</div>
</div>
</div>
<div class="ui page dimmer" id="loadingDimmer">
<div class="ui loader"></div>
</div>
<!-- SCRIPTS -->
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/semantic.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<script>
// Disable caching of AJAX responses (so the data is properly updated)
$.ajaxSetup({
cache: false
});
// Incompatible browser warning
if (window.navigator.userAgent.indexOf("MSIE") == -1) {
document.write("<style type='text/css'>#warningIE {display:none;}</style>");
$("#warningIE").hide();
}
// Initialize helper variables
var number;
var array;
if(darkTheme){
$("body").css("background", "#333");
$(".header").css("color", "#fff");
}
if (enableAnimations) {
var setDuration = 300;
} else {
var setDuration = 0;
}
var allNumbers = [];
var allNames = [];
var allShortcuts = [];
var page = 1;
var totalPages = 1;
var totalCalls = 1;
var fromDate;
var toDate;
var callHistory = [];
var redirectedCalls = [];
var statsLine = -10;
var preload = false;
// Detect if user is logged in
function loggedIn() {
// Is the data in localStorage?
if (localStorage.getItem('username') !== null && localStorage.getItem('password') !== null || (APIuser != "" && APIpass != "")) {
if (localStorage.getItem('username') !== null && localStorage.getItem('password') !== null) {
APIuser = localStorage.getItem('username');
APIpass = localStorage.getItem('password');
}
// Is the data valid?
$.ajax({
url: 'https://www.odorik.cz/api/v1/lines',
type: 'GET',
data: {
user: APIuser,
password: APIpass
},
success: function(result) {
// Check if there are any errors
if (result.indexOf("error") == -1) {
// No errors
} else {
// Logout and try again
logout();
}
}
});
return true;
} else {
return false;
}
}
// Show login dialog
function logInDialog() {
// Initialitze helper variable
badlogin = false;
// Show the dialog
$('#loginModal').modal({
closable: false,
duration: setDuration,
blurring: true,
onApprove: function() {
// Animate button
$("#loginModal .button").addClass("loading");
// Get values from fields
APIuser = $('input[name="login-name"]').val();
APIpass = $('input[name="login-pass"]').val();
// Connect to API
$.ajax({
url: 'https://www.odorik.cz/api/v1/lines',
type: 'GET',
data: {
user: APIuser,
password: APIpass
},
success: function(result) {
// Stop button animation
$("#loginModal .button").removeClass("loading");
// Check if there are any errors
if (result.indexOf("error") == 0) {
// Show error animations
$("#loginModal").transition('shake', setDuration + "ms");
if (badlogin)
$('#badLogin').transition("pulse", setDuration + "ms");
else {
$('#badLogin').transition("fade", setDuration + "ms");
badlogin = true;
}
} else {
// Hide and log in
$('#loginModal').modal('hide');
init();
localStorage.setItem('username', APIuser);
localStorage.setItem('password', APIpass);
}
}
});
return false;
}
}).modal('show');
}
// Show logout confirmation modal
function logoutModal() {
$('#logoutModal').modal({
blurring: true,
duration: setDuration,
onApprove: function() {
logout();
}
}).modal('show');
}
// Log out the user
function logout() {
localStorage.removeItem('username');
localStorage.removeItem('password');
location.reload();
}
// Initialize date
function initDate(){
if(typeof localStorage.lastDate == "undefined"){
$('#reportrange span').html(moment().subtract(29, 'days').format('DD.MM.YYYY') + ' - ' + moment().format('DD.MM.YYYY'));
}
else {
if(localStorage.lastDate == "today"){
$('#reportrange span').html(moment().format('DD.MM.YYYY') + ' - ' + moment().format('DD.MM.YYYY'));
}
else{
$('#reportrange span').html(localStorage.lastDate);
}
}
fromDate = moment($('#reportrange span').text().split(" - ")[0], 'DD.MM.YYYY').toISOString();
toDate = moment($('#reportrange span').text().split(" - ")[1], 'DD.MM.YYYY').add(1, "days").toISOString();
}
initDate();
// Initialize dropdown with section selection
function initDropdown(){
var firstRun = true;
$('.ui.dropdown').dropdown();
$("#statistics-line").dropdown({
onChange: function(value, text, $selectedItem) {
if(value != "all") {
statsLine = value;
}
else {
statsLine = -10;
}
loadStatistics();
}
});
$('#categorySelector').dropdown({
onChange: function(value, text, $selectedItem) {
if(!firstRun){
localStorage.setItem("prevCategory", value);
$('#categorySelector').addClass("loading");
if(value == "speedDials"){
reloadContacts();
}
if(value == "callHistory"){
loadCalls();
}
if(value == "statistics"){
loadStatistics();
}
}
else {
firstRun = false;
}
}
});
}
initDropdown();
if(typeof localStorage.order == "undefined"){
$("select[name=call-order]").val("newest");
localStorage.order = "newest"
}
if(localStorage.order == "newest"){
$("select[name=call-order]").val("newest");
}
else {
$("select[name=call-order]").val("oldest");
}
// Is user logged in?
if (loggedIn()) {
init(); // Load page
} else {
logInDialog(); // Show login dialog
}
// Initialization
function init() {
$("#loadingDimmer").dimmer("show");
$.ajax({
url: 'https://www.odorik.cz/api/v1/balance',
type: 'GET',
data: {
user: APIuser,
password: APIpass
}
}).done(function (data, textStatus, xhr) {
$("#credit").html("<b>Kredit: </b>"+ data +" Kč");
});
updateLines();
$("input[name=call-number]").val(defaultCallbackNumber);
if(typeof localStorage.prevCategory == "undefined"){
localStorage.setItem("prevCategory", "speedDials");
}