[4005] | 1 | <!-- BEGIN new_component --> |
---|
| 2 | <script src="calendar/js/dhtmlx/codebase/dhtmlxscheduler_debug.js" type="text/javascript" charset="utf-8"></script> |
---|
| 3 | <script src="calendar/js/dhtmlx/codebase/ext/dhtmlxscheduler_pdf.js"></script> |
---|
| 4 | <script src="calendar/js/dhtmlx/sources/locale_pt.js"></script> |
---|
| 5 | <link rel="stylesheet" href="calendar/js/dhtmlx/codebase/dhtmlxscheduler.css" type="text/css" charset="utf-8"> |
---|
| 6 | <div class="th" style='width:1000px; height:1px;visibility:hidden'> |
---|
| 7 | <div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%'> |
---|
| 8 | <div class="dhx_cal_navline"> |
---|
| 9 | <div class="dhx_cal_prev_button" > </div> |
---|
| 10 | <div class="dhx_cal_next_button" > </div> |
---|
| 11 | <div class="dhx_cal_today_button" ></div> |
---|
| 12 | <div class="dhx_cal_date"></div> |
---|
| 13 | <div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div> |
---|
| 14 | <div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div> |
---|
| 15 | <div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div> |
---|
| 16 | </div> |
---|
| 17 | <div class="dhx_cal_header" > |
---|
| 18 | </div> |
---|
| 19 | <div class="dhx_cal_data"> |
---|
| 20 | </div> |
---|
| 21 | </div> |
---|
| 22 | </div> |
---|
| 23 | <body onload="loadScheduler()"></body> |
---|
| 24 | <script> |
---|
| 25 | |
---|
| 26 | function loadScheduler() |
---|
| 27 | { |
---|
| 28 | |
---|
| 29 | //inicializa o calendário |
---|
| 30 | scheduler.showLightbox = function(id) |
---|
| 31 | { |
---|
| 32 | |
---|
| 33 | var ev = scheduler.getEvent(id); |
---|
| 34 | |
---|
| 35 | var bgYea = ev.start_date.getFullYear().toString(); |
---|
| 36 | var bgMon = (ev.start_date.getMonth() + 1).toString(); |
---|
| 37 | |
---|
| 38 | if (bgMon.length < 2) |
---|
| 39 | { |
---|
| 40 | bgMon = '0' + bgMon; |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | var bgDay = ev.start_date.getDate().toString(); |
---|
| 44 | |
---|
| 45 | if (bgDay.length < 2) |
---|
| 46 | { |
---|
| 47 | bgDay = '0' + bgDay; |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | var bgHou = ev.start_date.getHours(); |
---|
| 51 | var bgMin = ev.start_date.getMinutes(); |
---|
| 52 | |
---|
| 53 | window.location="index.php?menuaction=calendar.uicalendar.add&date=" + bgYea + bgMon + bgDay + "&hour=" + bgHou + "&minute=" + bgMin; |
---|
| 54 | |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | scheduler.templates.event_header=function(start,end,event){ |
---|
| 58 | |
---|
| 59 | var imgs = ''; |
---|
| 60 | var aux = "{typeview_aux}"; |
---|
| 61 | if(aux == 'day'); |
---|
| 62 | { |
---|
| 63 | if(event.recur && event.recur != false) |
---|
| 64 | { |
---|
| 65 | imgs += '<img width="10px" height="10px" border="0" title="evento recorrente" src="/calendar/templates/serpro/images/recur.png"/>'; |
---|
| 66 | } |
---|
| 67 | |
---|
| 68 | if(event.participants == 1) |
---|
| 69 | { |
---|
| 70 | imgs += " " + '<img width="12px" height="12px" border="0" title="'+event.participants_title+'" src="/calendar/templates/serpro/images/multi_3.png"/>'; |
---|
| 71 | } |
---|
| 72 | else |
---|
| 73 | { |
---|
| 74 | imgs += " " + '<img width="12px" height="12px" border="0" title="'+event.participants_title+'" src="/calendar/templates/serpro/images/single.png"/>'; |
---|
| 75 | } |
---|
| 76 | |
---|
| 77 | if(event.attachments == 1) |
---|
| 78 | { |
---|
| 79 | imgs += " " + '<img width="10px" height="10px" border="0" title="Foram enviadas notificações com anexos." src="/calendar/templates/serpro/images/clip.png"/>'; |
---|
| 80 | } |
---|
| 81 | |
---|
| 82 | if(event.isPublic == 0) |
---|
| 83 | { |
---|
| 84 | imgs += " " + '<img width="12px" height="12px" border="0" title="Foram enviadas notificações com anexos." src="/calendar/templates/serpro/images/private.png"/>'; |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | if(event.alarm == 1) |
---|
| 88 | { |
---|
| 89 | imgs += " " + '<img width="12px" height="12px" border="0" title="Foram enviadas notificações com anexos." src="/calendar/templates/serpro/images/alarm.png"/>'; |
---|
| 90 | } |
---|
| 91 | } |
---|
| 92 | return imgs + " " + scheduler.templates.hour_scale(start)+" "+scheduler.templates.hour_scale(end)+(" - ")+event.title; |
---|
| 93 | } |
---|
| 94 | |
---|
| 95 | scheduler.xy.scale_height=0; |
---|
| 96 | scheduler.xy.nav_height=0; |
---|
| 97 | //scheduler.config.hour_size_px = 84; |
---|
| 98 | scheduler.config.scroll_hour = 8; |
---|
| 99 | scheduler.config.time_step = 30; //- {numeric} minimal date size step in minutes; |
---|
| 100 | scheduler.config.start_on_monday = true; //{boolean} if true week starts from Monday ( if false, week start from Sunday); |
---|
| 101 | scheduler.config.first_hour = {hora_inicial}; |
---|
| 102 | scheduler.config.last_hour = {hora_final}; |
---|
| 103 | scheduler.config.drag_resize = false;//- {boolean} allows resizing events by dnd; |
---|
| 104 | scheduler.config.drag_move = false;//- {boolean} allows moving events by dnd; |
---|
| 105 | scheduler.config.drag_create = false;// - {boolean} allows creating new events by dnd; |
---|
| 106 | scheduler.config.dblclick_create = true;//- {boolean} allows creating new events by double click; |
---|
| 107 | scheduler.config.edit_on_create = true;//- {boolean} shows form on new event creation; |
---|
| 108 | 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); |
---|
| 109 | scheduler.config.details_on_dblclick = true;// - {boolean} uses extended form on event double-click (double-click on existing event). |
---|
| 110 | scheduler.attachEvent("onClick",function(){ return false;}); |
---|
| 111 | scheduler.attachEvent("onDblClick",function(id){ |
---|
| 112 | var ev = scheduler.getEvent(id); |
---|
| 113 | var id_mod = ev.id; |
---|
| 114 | if(ev.recur!=false) id_mod = ev.id.split('rc',1)[0]+"&date="+ev.recur; |
---|
| 115 | window.location="index.php?menuaction=calendar.uicalendar.view&cal_id="+id_mod;}); |
---|
| 116 | |
---|
| 117 | scheduler.config.xml_date="%Y-%m-%d %H:%i"; |
---|
| 118 | scheduler.init('scheduler_here',new {date},"{typeview}"); |
---|
| 119 | scheduler.parse({events_json},"json"); |
---|
| 120 | |
---|
| 121 | } |
---|
| 122 | |
---|
| 123 | |
---|
| 124 | function callViewEvent(id) //double click on events title bar |
---|
| 125 | { |
---|
| 126 | var ev = scheduler.getEvent(id); |
---|
| 127 | var id_mod = ev.id; |
---|
| 128 | if(ev.recur!=false) id_mod = ev.id.split('rc',1)[0]+"&date="+ev.recur; |
---|
| 129 | window.location="index.php?menuaction=calendar.uicalendar.view&cal_id="+id_mod; |
---|
| 130 | } |
---|
| 131 | |
---|
| 132 | </script> |
---|
| 133 | <!-- END new_component --> |
---|