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

Revision 4114, 6.8 KB checked in by rafaelraymundo, 9 years ago (diff)

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

  • Property svn:eol-style set to native
  • Property svn:executable set to *
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/codebase/ext/dhtmlxscheduler_pdf.js"></script>
6<script src="calendar/js/dhtmlx/sources/locale_pt.js"></script>
7<script src="calendar/js/dhtmlx/sources/ext/ext_new_week.js"></script>
8<link rel="stylesheet" href="calendar/js/dhtmlx/codebase/dhtmlxscheduler.css" type="text/css" charset="utf-8">
9
10<div class="th" style='width:1000px; height:470px;'>
11
12    <div  id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
13        <div class="dhx_cal_navline" style="display: none;">
14            <div class="dhx_cal_prev_button" style="display: none;">&nbsp;</div>
15            <div class="dhx_cal_next_button" style="display: none;">&nbsp;</div>
16            <div class="dhx_cal_today_button" style="display: none;" ></div>
17            <div class="dhx_cal_date" style="display:none;"></div>
18            <div class="dhx_cal_tab" name="day_tab" style="right:204px; display: none;"></div>
19            <div class="dhx_cal_tab" name="week_tab" style="right:140px; display: none;"></div>
20            <div class="dhx_cal_tab" name="month_tab" style="right:76px; display: none;"></div>
21 </div>
22        <div class="dhx_cal_header" style="visibility: hidden;">
23        </div>
24        <div class="dhx_cal_data">
25        </div>
26    </div>
27</div>
28
29<div style='clear:left;margin-left:50px;margin-right:50px;text-align:center'>
30<br />
31    {iprint}
32    <input type="radio" name="group1" id="list" value="list" onclick="muda(this.value);" checked> Lista
33    <input type="radio" name="group1" id="grid" value="grid" onclick="muda(this.value);" > Grade
34
35</div>
36
37<body onload="loadScheduler()"></body>
38
39<script>
40
41    function muda(printType)
42    {
43        if(printType == "grid")
44        {
45            //document.getElementById("listPrint").style.visibility = 'hidden';
46            document.getElementById("printFriendly").onclick = function(){
47                                                                            scheduler.toPDF('calendar/js/dhtmlx/server/generate.php');
48                                                                         };
49        }
50        else if(printType =="list")
51        {
52            //document.getElementById("listPrint").style.visibility = '';
53            document.getElementById("printFriendly").onclick = function(){
54                                                                            window.open("index.php?menuaction=calendar.uicalendar.month"+"{param}","","width=600,height=600,toolbar=no,scrollbars=yes,resizable=no");
55                                                                         };
56        }
57    }
58
59    function loadScheduler()
60    {
61
62        document.getElementById("listPrint").style.visibility = 'hidden';
63
64        //inicializa o calendário
65        scheduler.showLightbox = function(id)
66        {
67
68            var ev = scheduler.getEvent(id);
69
70            var bgYea = ev.start_date.getFullYear().toString();
71            var bgMon = (ev.start_date.getMonth() + 1).toString();
72
73            if (bgMon.length < 2)
74            {
75                bgMon = '0' + bgMon;
76            }
77
78            var bgDay = ev.start_date.getDate().toString();
79
80            if (bgDay.length < 2)
81            {
82                bgDay = '0' + bgDay;
83            }
84
85            var bgHou = ev.start_date.getHours();
86            var bgMin = ev.start_date.getMinutes();
87
88            window.location="index.php?menuaction=calendar.uicalendar.add&date=" + bgYea + bgMon + bgDay + "&hour=" + bgHou + "&minute=" + bgMin;
89
90        }
91
92        scheduler.templates.event_class=function(start,end,event){
93                  if (event.rejected)
94                    return "rejected";
95                  if (event.intersection)
96                     return "intersection";
97
98        }
99
100        scheduler.templates.event_header=function(start,end,event){
101
102            var imgs = '';
103            if(event.recur && event.recur != false)
104            {
105                imgs += '<img width="10px" height="10px" border="0" title="Evento recorrente" src="/calendar/templates/default/images/recur.png"/>';
106            }
107
108            if(event.participants == 1)
109            {
110                imgs += " " + '<img width="11px" height="10px" border="0" title="'+event.participants_title+'" src="/calendar/templates/default/images/multi_3.png"/>';
111            }
112            else
113            {
114                imgs += " " + '<img width="11px" height="10px" border="0" title="'+event.participants_title+'" src="/calendar/templates/default/images/single.png"/>';
115            }
116
117            if(event.attachments == 1)
118            {
119                imgs += " " + '<img width="10px" height="10px" border="0" title="Foram enviadas notificações com anexos" src="/calendar/templates/default/images/clip.png"/>';
120            }
121
122            if(event.isPublic == 0)
123            {
124                imgs += " " + '<img width="11px" height="10px" border="0" title="'+event.isPublicTitle+'" src="/calendar/templates/default/images/private.png"/>';
125            }
126
127            if(event.alarm == 1)
128            {
129                imgs += " " + '<img width="11px" height="10px" border="0" title="Alarme" src="/calendar/templates/default/images/alarm.png"/>';
130            }
131
132            if(event.title)
133            {
134                var eventTitle = (" - ") + event.title;
135            }
136            else
137            {
138                var eventTitle = "";
139            }
140
141            if(event.descOnTitle == 1)
142            {
143                var eventDescOnTitle = (" - ") + event.text;
144            }
145            else
146            {
147                var eventDescOnTitle = '';
148            }
149
150            return imgs + " " + scheduler.templates.hour_scale(start) + " " + scheduler.templates.hour_scale(end) + eventTitle + eventDescOnTitle;
151        }
152
153        scheduler.xy.scale_height=0;
154        scheduler.xy.nav_height=0;
155        scheduler.config.hour_size_px = {hour_size_px} ;
156        scheduler.config.scroll_hour = 8;
157        scheduler.config.time_step = 30; //- {numeric} minimal date size step in minutes;
158        scheduler.config.start_on_monday = true; //{boolean} if true week starts from Monday ( if false, week start from Sunday);
159        scheduler.config.first_hour = {hora_inicial};
160        scheduler.config.last_hour = {hora_final};
161        scheduler.config.drag_resize = false;//- {boolean} allows resizing events by dnd;
162        scheduler.config.drag_move = false;//- {boolean} allows moving events by dnd;
163        scheduler.config.drag_create = false;// - {boolean} allows creating new events by dnd;
164        scheduler.config.dblclick_create = true;//- {boolean} allows creating new events by double click;
165        scheduler.config.edit_on_create = true;//- {boolean} shows form on new event creation;
166        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);
167        scheduler.config.details_on_dblclick = true;// - {boolean} uses extended form on event double-click (double-click on existing event).
168        scheduler.attachEvent("onClick",function(){ return false;});
169        scheduler.attachEvent("onDblClick",function(id){
170                                var ev = scheduler.getEvent(id);
171                                var id_mod = ev.id;
172                                if(ev.recur!=false) id_mod = ev.id.split('rc',1)[0]+"&date="+ev.recur;
173                                window.location="index.php?menuaction=calendar.uicalendar.view&cal_id="+id_mod;});
174
175        scheduler.config.xml_date="%Y-%m-%d %H:%i";
176        scheduler.init('scheduler_here',new {date},"day");
177        scheduler.parse({events_json},"json");
178
179    }
180
181    function callViewEvent(id) //double click on events title bar
182    {
183        var ev = scheduler.getEvent(id);
184        var id_mod = ev.id;
185        if(ev.recur!=false) id_mod = ev.id.split('rc',1)[0]+"&date="+ev.recur;
186        window.location="index.php?menuaction=calendar.uicalendar.view&cal_id="+id_mod;
187    }
188
189</script>
190
191<!-- END day -->
Note: See TracBrowser for help on using the repository browser.