source: branches/2.2.0.1/calendar/templates/default/new_week.tpl @ 4115

Revision 4115, 6.0 KB checked in by brunocosta, 13 years ago (diff)

Ticket #1745 - Ajustes na interface das novas visões 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 src="calendar/js/dhtmlx/sources/ext/ext_new_week.js"></script>
8<script>
9
10    resize = function(){
11
12        var clientWidth = ((window.innerWidth ? window.innerWidth : document.body.offsetWidth));
13        var conteiner = document.getElementById('conteiner');
14        conteiner.style.width=clientWidth-374+'px'
15    }
16
17
18     function resize(){
19
20        var clientWidth = ((window.innerWidth ? window.innerWidth : document.body.offsetWidth));
21       var conteiner = document.getElementById('conteiner');
22        conteiner.style.width=clientWidth-374+'px'
23    }
24
25
26
27    window.onresize = resize;
28
29</script>
30
31<link rel="stylesheet" href="calendar/js/dhtmlx/codebase/dhtmlxscheduler.css" type="text/css" charset="utf-8">
32
33
34
35<div id='conteiner' class="th" style='height:700px;margin-left:50px;margin-right:50px;float:left;'>
36<div class='calendar_user_identifier' style='background-color:white;padding-bottom:2px;text-align:center'>:&nbsp;{user}&nbsp;:</div>
37<div class='calendar_month_identifier' style='background-color:white;padding-bottom:2px;text-align:center'>{title}</div>
38
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="muda(this.value);" checked> Lista
63    <input type="radio" name="group1" id="grid" value="grid" onclick="muda(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
73    function muda(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}","","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}","","width=600,height=600,toolbar=no,scrollbars=yes,resizable=no");
102                                                                        }
103                                                                     };
104
105        scheduler.showLightbox = function(id)
106        {
107
108            var ev = scheduler.getEvent(id);
109            var bgYea = ev.start_date.getFullYear().toString();
110            var bgMon = (ev.start_date.getMonth() + 1).toString();
111
112            if (bgMon.length < 2)
113            {
114                bgMon = '0' + bgMon;
115            }
116
117            var bgDay = ev.start_date.getDate().toString();
118
119            if (bgDay.length < 2)
120            {
121                bgDay = '0' + bgDay;
122            }
123
124            var bgHou = ev.start_date.getHours();
125            var bgMin = ev.start_date.getMinutes();
126
127            window.location="index.php?menuaction=calendar.uicalendar.add&date=" + bgYea + bgMon + bgDay + "&hour=" + bgHou + "&minute=" + bgMin;
128
129        }
130        //inicializa o calendário
131        scheduler.xy.scale_height=0;
132        scheduler.xy.nav_height=0;
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        scheduler.config.multi_day = true;
148        scheduler.config.xml_date="%Y-%m-%d %H:%i";
149        scheduler.init('scheduler_here',new {date},"week");
150        scheduler.parse({events_json},"json");
151        resize();
152
153    }
154
155    function callViewEvent(id) //double click on events title bar
156    {
157        var ev = scheduler.getEvent(id);
158        var id_mod = ev.id;
159        if(ev.recur!=false) id_mod = ev.id.split('rc',1)[0]+"&date="+ev.recur;
160        window.location="index.php?menuaction=calendar.uicalendar.view&cal_id="+id_mod;
161    }
162
163</script>
164
165
166<!-- END day -->
Note: See TracBrowser for help on using the repository browser.