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

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