source: branches/2.2.0.1/calendar/templates/default/new_month.tpl @ 4125

Revision 4125, 6.2 KB checked in by rafaelraymundo, 13 years ago (diff)

Ticket #1745 - Padronizar a impressão diária, semanal e mensal da agenda.

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