source: trunk/calendar/templates/default/new_month.tpl @ 4884

Revision 4884, 6.4 KB checked in by roberto.santosjunior, 13 years ago (diff)

Ticket #1820 - Data repetida na agenda ......................r4865

Line 
1<!-- BEGIN day -->
2
3
4<script src="calendar/js/dhtmlx/codebase/dhtmlxscheduler_debug.js" type="text/javascript" charset="utf-8"></script>
5<script src="calendar/js/dhtmlx/sources/ext/ext_pdf.js"></script>
6<script src="calendar/js/dhtmlx/sources/locale_pt.js"></script>
7<script src="calendar/js/dhtmlx/sources/ext/ext_new_month.js"></script>
8<script src="calendar/js/dhtmlx/sources/ext/brazil_patch.js"></script>
9<script>
10
11    resize = function(){
12
13        var clientWidth = ((window.innerWidth ? window.innerWidth : document.body.offsetWidth));
14        var conteiner = document.getElementById('conteiner');
15        conteiner.style.width=clientWidth-374+'px'
16    }
17
18
19     function resize(){
20
21        var clientWidth = ((window.innerWidth ? window.innerWidth : document.body.offsetWidth));
22       var conteiner = document.getElementById('conteiner');
23        conteiner.style.width=clientWidth-374+'px'
24    }
25
26
27
28    window.onresize = resize;
29
30</script>
31
32<link rel="stylesheet" href="calendar/js/dhtmlx/codebase/dhtmlxscheduler.css" type="text/css" charset="utf-8">
33
34
35
36<div  id='conteiner' class="th" style='width:100px; height:650px;margin-left:50px;margin-right:50px;float:left;'>
37<div class='calendar_user_identifier' style='background-color:white;padding-bottom:2px;text-align:center'>:&nbsp;{user}&nbsp;:</div>
38<div class='calendar_month_identifier' style='background-color:white;padding-bottom:2px;text-align:center'>{title}</div>
39
40<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:95%; border-left: 1px dotted #586A7E;'>
41                <div class="dhx_cal_navline" style="display: none;">
42                        <div class="dhx_cal_prev_button">&nbsp;</div>
43                        <div class="dhx_cal_next_button">&nbsp;</div>
44                        <div class="dhx_cal_today_button"></div>
45                        <div class="dhx_cal_date"></div>
46                        <div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
47                        <div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
48                        <div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
49                </div>
50                <div class="dhx_cal_header">
51                </div>
52                <div class="dhx_cal_data">
53                </div>
54        </div>
55</div>
56
57{minical}
58
59<div style='clear:left;margin-left:50px;margin-right:50px;text-align:center'>
60<br />
61    {iprint}
62    <input type="radio" name="group1" id="list" value="list" onclick="printMode(this.value);" checked> Lista
63    <input type="radio" name="group1" id="grid" value="grid" onclick="printMode(this.value);" > Grade<br>
64
65</div>
66
67<div style='clear:left;margin-left:50px;margin-right:50px;text-align:center'>&nbsp;</div>
68
69<body onload="resize();loadScheduler();"></body>
70
71<script>
72    var holidayTab = {holidays_json};
73    function printMode(printType)
74    {
75        if(printType == "grid")
76        {
77            document.getElementById("listPrint").style.visibility = 'hidden';
78            document.getElementById("printFriendly").onclick = function(){
79                                                                            scheduler.toPDF('calendar/js/dhtmlx/server/generate.php');
80                                                                         };
81        }
82        else if(printType =="list")
83        {
84            document.getElementById("listPrint").style.visibility = '';
85            document.getElementById("printFriendly").onclick = function(){
86                                                                            window.open("index.php?menuaction=calendar.uicalendar.month"+"{param}"+"&day_ini="+document.getElementById('dayIni').value+"&num_dias="+document.getElementById('numDays').value,"","width=600,height=600,toolbar=no,scrollbars=yes,resizable=no");
87                                                                         };
88        }
89    }
90
91    function loadScheduler()
92    {
93        document.getElementById("printFriendly").onclick = function(){
94                                                                        if(document.getElementById("grid").checked == true)
95                                                                        {
96                                                                            document.getElementById("listPrint").style.visibility = 'hidden';
97                                                                            scheduler.toPDF('calendar/js/dhtmlx/server/generate.php');
98                                                                        }
99                                                                        else
100                                                                        {
101                                                                            window.open("index.php?menuaction=calendar.uicalendar.month"+"{param}"+"&day_ini="+document.getElementById('dayIni').value+"&num_dias="+document.getElementById('numDays').value,"","width=600,height=600,toolbar=no,scrollbars=yes,resizable=no");
102                                                                        }
103                                                                     };
104        //inicializa o calendário
105        scheduler.showLightbox = function(id)
106        {
107
108            var ev = scheduler.getEvent(id);
109
110            var bgYea = ev.start_date.getFullYear().toString();
111            var bgMon = (ev.start_date.getMonth() + 1).toString();
112
113            if (bgMon.length < 2)
114            {
115                bgMon = '0' + bgMon;
116            }
117
118            var bgDay = ev.start_date.getDate().toString();
119
120            if (bgDay.length < 2)
121            {
122                bgDay = '0' + bgDay;
123            }
124
125            var bgHou = ev.start_date.getHours();
126            var bgMin = ev.start_date.getMinutes();
127
128            window.location="index.php?menuaction=calendar.uicalendar.add&date=" + bgYea + bgMon + bgDay + "&hour=" + bgHou + "&minute=" + bgMin;
129
130        }
131        scheduler.xy.nav_height=0;
132        //scheduler.config.hour_size_px = 84;
133        scheduler.config.scroll_hour = 8;
134        scheduler.config.time_step = 30; //- {numeric} minimal date size step in minutes;
135        scheduler.config.start_on_monday = true; //{boolean} if true week starts from Monday ( if false, week start from Sunday);
136        scheduler.config.drag_resize = false;//- {boolean} allows resizing events by dnd;
137        scheduler.config.drag_move = false;//- {boolean} allows moving events by dnd;
138        scheduler.config.drag_create = false;// - {boolean} allows creating new events by dnd;
139        scheduler.config.dblclick_create = true;//- {boolean} allows creating new events by double click;
140        scheduler.config.edit_on_create = true;//- {boolean} shows form on new event creation;
141        scheduler.config.details_on_create = true;//- {boolean} uses extended form on new event creation by drag or by dbl-click (option doesn't affect monthly view - where details form is the only way to change data);
142        scheduler.config.details_on_dblclick = true;// - {boolean} uses extended form on event double-click (double-click on existing event).
143        scheduler.attachEvent("onClick",function(){ return false;});
144        scheduler.attachEvent("onDblClick",function(id){
145                                var ev = scheduler.getEvent(id);
146                                var id_mod = ev.id;
147                                if(ev.recur!=false) id_mod = ev.id.split('rc',1)[0]+"&date="+ev.recur;
148                                window.location="index.php?menuaction=calendar.uicalendar.view&cal_id="+id_mod;});
149
150        scheduler.config.xml_date="%Y-%m-%d %H:%i";
151        scheduler.init('scheduler_here',new {date},"month");
152        scheduler.parse({events_json},"json");
153
154
155
156    }
157
158    function callViewEvent(id) //double click on events title bar
159    {
160        var ev = scheduler.getEvent(id);
161        var id_mod = ev.id;
162        if(ev.recur!=false) id_mod = ev.id.split('rc',1)[0]+"&date="+ev.recur;
163        window.location="index.php?menuaction=calendar.uicalendar.view&cal_id="+id_mod;
164    }
165
166</script>
167
168
169
170
171<!-- END day -->
Note: See TracBrowser for help on using the repository browser.