[5399] | 1 | $(document).ready(function() { |
---|
[5863] | 2 | //Remove o icone de configuraçõe padrão antigo do expresso |
---|
| 3 | $('#sideboxdragarea').addClass('hidden'); |
---|
| 4 | |
---|
[5399] | 5 | refresh_calendars(); |
---|
| 6 | $tabs = $('#tabs').tabs({ |
---|
| 7 | add: function( event, ui ) { |
---|
[5409] | 8 | Calendar.lastView = $tabs.tabs('option' ,'selected'); |
---|
| 9 | $('#tabs .events-list-win.active').removeClass('active'); |
---|
[5399] | 10 | $tabs.tabs('select', '#' + ui.panel.id); |
---|
| 11 | }, |
---|
| 12 | remove: function( event, ui ) { |
---|
[5409] | 13 | $tabs.tabs('select', Calendar.lastView); |
---|
[5399] | 14 | }, |
---|
| 15 | show: function( event, ui ){ |
---|
| 16 | delete Calendar.currentViewKey; |
---|
| 17 | $('#calendar').fullCalendar('refetchEvents'); |
---|
| 18 | } |
---|
| 19 | }) |
---|
| 20 | .tabs('option', 'tabTemplate', "<li><a href='#{href}'>#{label}</a><span class='ui-icon ui-icon-close'>Remove Tab</span></li>" ); |
---|
| 21 | |
---|
| 22 | /** |
---|
| 23 | * Make a button to close the tab |
---|
| 24 | */ |
---|
| 25 | $tabs.find( "span.ui-icon-close" ).live( "click", function() { |
---|
| 26 | var index = $( "li", $tabs ).index( $( this ).parent() ); |
---|
| 27 | if($tabs.tabs('option' ,'selected') == index){ |
---|
[5409] | 28 | if($tabs.tabs("length") == 2 && Calendar.lastView != 1) |
---|
[5399] | 29 | $tabs.tabs( "select", 0); |
---|
[5409] | 30 | $tabs.tabs( "select", Calendar.lastView); |
---|
[5399] | 31 | } |
---|
| 32 | if($tabs.tabs('option' ,'selected') == 0 || $tabs.tabs('option' ,'selected') == 1) |
---|
[5409] | 33 | Calendar.lastView = $tabs.tabs('option' ,'selected'); |
---|
[5399] | 34 | if(index != -1) |
---|
| 35 | $tabs.tabs( "remove", index ); |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | }); |
---|
| 39 | $('.button.config-menu').button({ |
---|
| 40 | icons: { |
---|
| 41 | primary: "ui-icon-gear", |
---|
| 42 | secondary: "ui-icon-triangle-1-s" |
---|
| 43 | }, |
---|
| 44 | text: false |
---|
| 45 | }); |
---|
| 46 | $('.button.add').button({ |
---|
| 47 | icons: { |
---|
| 48 | secondary: "ui-icon-plus" |
---|
| 49 | } |
---|
| 50 | }) |
---|
| 51 | |
---|
| 52 | var miniCalendar = $('.block-vertical-toolbox .mini-calendar').datepicker({ |
---|
| 53 | dateFormat: 'yy-m-d', |
---|
| 54 | //dateFormat: 'DD, d MM, yy', |
---|
| 55 | //inline: true, |
---|
[5409] | 56 | firstDay: dateCalendar.dayOfWeek[User.preferences.weekStart], |
---|
[5399] | 57 | onSelect: function(dateText, inst) |
---|
| 58 | { |
---|
| 59 | $tabs.tabs("select", "#calendar"); |
---|
[5442] | 60 | var toDate = $('.block-vertical-toolbox .mini-calendar').datepicker("getDate").toString('yyyy-MM-dd').split('-'); |
---|
| 61 | $('#calendar').fullCalendar('gotoDate', toDate[0], parseInt(toDate[1]-1), toDate[2] ); |
---|
[5399] | 62 | $('#calendar').fullCalendar( 'changeView', 'agendaDay' ); |
---|
| 63 | } |
---|
| 64 | }) |
---|
| 65 | .find('.ui-icon-circle-triangle-e').removeClass('ui-icon-circle-triangle-e').addClass('ui-icon-triangle-1-e').end() |
---|
| 66 | .find('.ui-icon-circle-triangle-w').removeClass('ui-icon-circle-triangle-w').addClass('ui-icon-triangle-1-w'); |
---|
| 67 | |
---|
| 68 | //Onclick do mês |
---|
| 69 | $('.ui-datepicker-title .ui-datepicker-month').live('click',function(){ |
---|
| 70 | $tabs.tabs("select", "#calendar"); |
---|
[5442] | 71 | $('#calendar').fullCalendar('gotoDate',$(this).siblings('span').html(), Date.getMonthNumberFromName($(this).html() == 'Março' ? 'Mar' : $(this).html()),'01'); |
---|
[5399] | 72 | $('#calendar').fullCalendar( 'changeView', 'month'); |
---|
| 73 | }); |
---|
| 74 | //Onclick do ano |
---|
| 75 | $('.ui-datepicker-title .ui-datepicker-year').live('click',function(){ |
---|
| 76 | $tabs.tabs("select", "#calendar"); |
---|
[5442] | 77 | $('#calendar').fullCalendar('gotoDate',$(this).html(), '0', '01'); |
---|
[5399] | 78 | $('.fc-button-year').click(); |
---|
| 79 | }); |
---|
| 80 | |
---|
| 81 | //Onclick em um dia do calendário anual |
---|
| 82 | $( ".fc-day-number" ).live( "click", function() { |
---|
| 83 | |
---|
| 84 | var date = $(this).parents('[class*="fc-day-"]').attr('class').match(/fc-day-(\d{4})-(\d{2})-(\d{2})/); |
---|
| 85 | |
---|
| 86 | if (date) date.shift(); |
---|
| 87 | else return false; |
---|
| 88 | |
---|
| 89 | $('#calendar').fullCalendar('gotoDate',date[0],date[1]-1,date[2]); |
---|
| 90 | $('#calendar').fullCalendar( 'changeView', 'agendaDay' ); |
---|
| 91 | }); |
---|
| 92 | |
---|
| 93 | $('.main-search input.search').keydown(function(event){ |
---|
| 94 | if(event.keyCode == 13) { |
---|
| 95 | Encoder.EncodeType = "entity"; |
---|
| 96 | //$(this).val($(this).val()); |
---|
| 97 | |
---|
| 98 | add_events_list($(this).val()); |
---|
| 99 | $(this).val(''); |
---|
| 100 | } |
---|
| 101 | }); |
---|
[5592] | 102 | |
---|
| 103 | //efetua pesquisas pelo click na lupa de pesquisa |
---|
| 104 | $('.main-search span.ui-icon-search').click(function(event){ |
---|
| 105 | add_events_list($(this).parent().find('input.search').val()); |
---|
| 106 | $(this).parent().find('input.search').val(); |
---|
| 107 | }); |
---|
| 108 | |
---|
[5399] | 109 | $('.block-horizontal-toolbox .main-config-menu').menu({ |
---|
| 110 | content: $('.main-config-menu-content').html(), |
---|
| 111 | positionOpts: { |
---|
| 112 | posX: 'left', |
---|
| 113 | posY: 'bottom', |
---|
| 114 | offsetX: -140, |
---|
| 115 | offsetY: 0, |
---|
| 116 | directionH: 'right', |
---|
| 117 | directionV: 'down', |
---|
| 118 | detectH: true, // do horizontal collision detection |
---|
| 119 | detectV: true, // do vertical collision detection |
---|
| 120 | linkToFront: false |
---|
| 121 | }, |
---|
| 122 | flyOut: true, |
---|
| 123 | showSpeed: 100, |
---|
| 124 | crumbDefaultText: '>' |
---|
| 125 | }); |
---|
| 126 | |
---|
| 127 | $('#trash').droppable({ |
---|
| 128 | drop: function(event, ui){ |
---|
| 129 | // calendar.fullCalendar( 'removeEvents', ui.draggable.attr('event-id') ); |
---|
| 130 | DataLayer.remove( "event", ui.draggable.attr('event-id') ); |
---|
| 131 | $(this).switchClass('empty','full'); |
---|
| 132 | }, |
---|
| 133 | tolerance: "touch" |
---|
| 134 | }); |
---|
| 135 | |
---|
| 136 | /* initialize the calendar |
---|
| 137 | -----------------------------------------------------------------*/ |
---|
| 138 | $(".button.add.add-event").click(function(event){ |
---|
[6444] | 139 | var startEvent = new Date(); |
---|
| 140 | var configData = (startEvent.toString('mm') < 30) ? {minutes: (30 - parseInt(startEvent.toString('mm')))} : {hours: 1, minutes: '-'+startEvent.toString('mm')}; |
---|
| 141 | startEvent.add(configData); |
---|
| 142 | |
---|
[5399] | 143 | eventDetails({ |
---|
[5409] | 144 | startTime: startEvent.getTime(), |
---|
[6444] | 145 | endTime: dateCalendar.decodeRange(startEvent, (!!User.preferences.defaultCalendar ? ( !!Calendar.signatureOf[User.preferences.defaultCalendar].calendar.defaultDuration ? |
---|
| 146 | (Calendar.signatureOf[User.preferences.defaultCalendar].calendar.defaultDuration) : (User.preferences.defaultDuration)) : (User.preferences.defaultDuration))) |
---|
[5399] | 147 | }, true ); |
---|
| 148 | }); |
---|
[6797] | 149 | /* Quick add task |
---|
| 150 | -----------------------------------------------------------------*/ |
---|
| 151 | $(".button.add.add-task").click(function(event){ |
---|
| 152 | var componente = $(this); |
---|
[5399] | 153 | |
---|
[6820] | 154 | if(!$('div.qtip.qtip-blue.new-task').length){ |
---|
[6797] | 155 | |
---|
[6820] | 156 | $('div.qtip.qtip-blue').remove(); |
---|
| 157 | |
---|
| 158 | $(componente).qtip({ |
---|
| 159 | show: { |
---|
| 160 | ready: true, |
---|
| 161 | solo: true, |
---|
| 162 | when: { |
---|
| 163 | event: 'click' |
---|
| 164 | } |
---|
| 165 | }, |
---|
| 166 | hide: false, |
---|
| 167 | content: { |
---|
| 168 | text: $('<div></div>').html( DataLayer.render( 'templates/task_quick_add.ejs', {} ) ), |
---|
| 169 | title: { |
---|
| 170 | text:'Nova tarefa', |
---|
| 171 | button: '<a class="button close" href="#">close</a>' |
---|
| 172 | } |
---|
| 173 | }, |
---|
| 174 | style: { |
---|
| 175 | name: 'blue', |
---|
| 176 | tip: { |
---|
| 177 | corner: 'leftMiddle' |
---|
| 178 | }, |
---|
| 179 | border: { |
---|
| 180 | width: 4, |
---|
| 181 | radius: 8 |
---|
| 182 | }, |
---|
| 183 | width: { |
---|
| 184 | min: 225, |
---|
| 185 | max:225 |
---|
| 186 | } |
---|
| 187 | }, |
---|
| 188 | position: { |
---|
| 189 | corner: { |
---|
| 190 | target: 'rightMiddle', |
---|
| 191 | tooltip: 'leftMiddle' |
---|
| 192 | }, |
---|
| 193 | adjust: { |
---|
| 194 | x:0, |
---|
| 195 | y:0 |
---|
| 196 | } |
---|
| 197 | } |
---|
| 198 | }) |
---|
| 199 | .qtip("api").onShow = function(arg0) { |
---|
| 200 | |
---|
[6797] | 201 | /*------------------------------------------------------------------------*/ |
---|
| 202 | /* Seta os valores padrões nos inputs do qtip */ |
---|
[6820] | 203 | $('div.qtip div.add-simple-task input.task').Watermark("Tarefa sem título"); |
---|
| 204 | $('div.qtip div.add-simple-task textarea').Watermark("Descrição"); |
---|
| 205 | /*------------------------------------------------------------------------*/ |
---|
[6797] | 206 | |
---|
[6820] | 207 | $('.qtip-active .button.close').button({ |
---|
| 208 | icons: { |
---|
| 209 | primary: "ui-icon-close" |
---|
| 210 | }, |
---|
| 211 | text: false |
---|
| 212 | }) |
---|
| 213 | .click(function(){ |
---|
| 214 | $(componente).qtip('destroy'); |
---|
| 215 | }); |
---|
| 216 | |
---|
| 217 | $('.qtip-active .button.save').button().click(function(){ |
---|
| 218 | |
---|
| 219 | var title = $('div.qtip div.add-simple-task input.task').val(); |
---|
| 220 | var description = $('div.qtip div.add-simple-task textarea').val(); |
---|
[6797] | 221 | |
---|
[6820] | 222 | var calendar, timezone = ''; |
---|
[6797] | 223 | |
---|
[6820] | 224 | for (var i = 0; i < Calendar.signatures.length; i++){ |
---|
| 225 | if(Calendar.signatures[i].type == 1 && Calendar.signatures[i].calendar.type == 1){ |
---|
| 226 | calendar = Calendar.signatures[i].calendar.id; |
---|
| 227 | timezone = Calendar.signatures[i].calendar.timezone; |
---|
| 228 | break; |
---|
| 229 | } |
---|
| 230 | } |
---|
[6797] | 231 | |
---|
[6820] | 232 | DataLayer.put('schedulable', |
---|
| 233 | { |
---|
| 234 | summary: title, |
---|
| 235 | description: description, |
---|
| 236 | type: '2', |
---|
| 237 | calendar: calendar, |
---|
| 238 | timezone: timezone, |
---|
| 239 | startTime: new Date().toString('yyyy-MM-dd 00:00:00'), |
---|
| 240 | endTime: new Date().toString('yyyy-MM-dd 00:00:00'), |
---|
| 241 | allDay: '1' |
---|
| 242 | }); |
---|
[6832] | 243 | |
---|
| 244 | $(componente).qtip('destroy'); |
---|
[6797] | 245 | |
---|
[6820] | 246 | }); |
---|
[6797] | 247 | |
---|
[6820] | 248 | $('.qtip-active .button.advanced').button().click(function(){ |
---|
| 249 | |
---|
| 250 | $(componente).qtip('destroy'); |
---|
| 251 | |
---|
| 252 | var startEvent = new Date(); |
---|
| 253 | var configData = (startEvent.toString('mm') < 30) ? {minutes: (30 - parseInt(startEvent.toString('mm')))} : {hours: 1, minutes: '-'+startEvent.toString('mm')}; |
---|
| 254 | startEvent.add(configData); |
---|
| 255 | |
---|
| 256 | var componente = $(this); |
---|
[6797] | 257 | |
---|
[6820] | 258 | taskDetails({ |
---|
| 259 | startTime: startEvent.getTime(), |
---|
| 260 | endTime: dateCalendar.decodeRange(startEvent, (!!User.preferences.defaultCalendar ? ( !!Calendar.signatureOf[User.preferences.defaultCalendar].calendar.defaultDuration ? |
---|
| 261 | (Calendar.signatureOf[User.preferences.defaultCalendar].calendar.defaultDuration) : (User.preferences.defaultDuration)) : (User.preferences.defaultDuration))) |
---|
| 262 | }, true ); |
---|
| 263 | |
---|
| 264 | }); |
---|
| 265 | |
---|
| 266 | $('.qtip-active .button.cancel').button().click(function(){ |
---|
| 267 | $(componente).qtip('destroy'); |
---|
| 268 | }); |
---|
| 269 | |
---|
[6832] | 270 | $('.qtip-active .button').button(); |
---|
[6820] | 271 | |
---|
| 272 | $('div.qtip.qtip-blue.qtip-active').addClass('new-task'); |
---|
| 273 | } |
---|
| 274 | } |
---|
[6797] | 275 | }); |
---|
| 276 | |
---|
[5409] | 277 | var calendar = $('#calendar').fullCalendar(DataLayer.merge({ |
---|
[5399] | 278 | |
---|
| 279 | defaultView: User.preferences.defaultCalView, |
---|
| 280 | timeFormat: User.preferences.hourFormat, |
---|
| 281 | axisFormat: User.preferences.hourFormat, |
---|
| 282 | eventSources: Calendar.sources, |
---|
| 283 | |
---|
| 284 | header: { |
---|
| 285 | left: 'prev,next today,basicWeek,basicDay', |
---|
| 286 | center: 'title', |
---|
| 287 | right: 'agendaDay,agendaWeek,month,year' |
---|
| 288 | }, |
---|
[5510] | 289 | firstHour: dateCalendar.getShortestTime(User.preferences.defaultStartHour ? User.preferences.defaultStartHour : '6'), |
---|
[5409] | 290 | firstDay: dateCalendar.dayOfWeek[User.preferences.weekStart], |
---|
[5399] | 291 | editable: true, |
---|
| 292 | selectable: true, |
---|
| 293 | selectHelper: true, |
---|
| 294 | droppable: true, // this allows things to be dropped onto the calendar !!! |
---|
| 295 | timeFormat: { |
---|
| 296 | agenda: 'HH:mm{ - HH:mm}', |
---|
| 297 | '': 'HH:mm{ - HH:mm} }' |
---|
| 298 | }, |
---|
| 299 | titleFormat: { |
---|
| 300 | month: 'MMMM yyyy', |
---|
| 301 | week: "dd[ yyyy] { 'a'[ MMM] dd 'de' MMMM '-' yyyy}", |
---|
| 302 | day: 'dddd, dd MMM , yyyy' |
---|
| 303 | }, |
---|
| 304 | columnFormat:{ |
---|
| 305 | month: 'ddd', |
---|
| 306 | week: 'ddd dd/MM', |
---|
| 307 | day: 'dddd dd/MM' |
---|
| 308 | }, |
---|
[5409] | 309 | |
---|
[5399] | 310 | allDayText: 'Dia todo', |
---|
| 311 | buttonText: { |
---|
| 312 | today: 'hoje', |
---|
| 313 | month: 'mês', |
---|
| 314 | week: 'semana', |
---|
| 315 | day: 'dia', |
---|
| 316 | year: 'ano' |
---|
| 317 | }, |
---|
[6797] | 318 | |
---|
| 319 | eventRender: function( event, element, view ){ |
---|
[5409] | 320 | /* |
---|
[6797] | 321 | * TODO - Encontrar icones mais filé |
---|
| 322 | */ |
---|
[6857] | 323 | var img_icon = ""; |
---|
| 324 | if(event.type == 1) |
---|
| 325 | img_icon = "event.png"; |
---|
| 326 | if(event.type == 2) |
---|
| 327 | img_icon = "task.png"; |
---|
| 328 | if(event.type == 3) |
---|
| 329 | img_icon = "activity_icon.jpg"; |
---|
| 330 | element.find(".fc-event-inner.fc-event-skin").prepend($('<img class="" src="../prototype/modules/calendar/img/' + img_icon + '"></img>')); |
---|
[5399] | 331 | }, |
---|
[6797] | 332 | |
---|
[5399] | 333 | select: function( start, end, allDay, event, view ){ |
---|
[5510] | 334 | if (view.name == "month") { |
---|
| 335 | if (User.preferences.defaultStartHour) { |
---|
| 336 | _start = User.preferences.defaultStartHour; |
---|
| 337 | |
---|
| 338 | if (_start.length > 4) |
---|
| 339 | _start = _start.trim().substring(0,5); // remove o am/pm |
---|
| 340 | |
---|
| 341 | _start = _start.split(":"); |
---|
| 342 | start.setHours(_start[0]); |
---|
| 343 | start.setMinutes(_start[1]); |
---|
| 344 | } |
---|
| 345 | |
---|
| 346 | if (User.preferences.defaultEndHour) { |
---|
| 347 | _end = User.preferences.defaultEndHour; |
---|
| 348 | if (_end.length > 4) |
---|
| 349 | _end = _end.trim().substring(0,5); // remove o am/pm |
---|
| 350 | |
---|
| 351 | _end = _end.split(":"); |
---|
| 352 | end.setHours(_end[0]); |
---|
| 353 | end.setMinutes(_end[1]); |
---|
| 354 | } |
---|
| 355 | } // END if (view.name == "month") |
---|
| 356 | |
---|
[5399] | 357 | eventDetails( { 'start': start, |
---|
| 358 | 'end': end, |
---|
| 359 | 'allDay': allDay } ); |
---|
| 360 | }, |
---|
| 361 | |
---|
[5746] | 362 | eventDrop: function( evt, event, view ){ |
---|
| 363 | evt.id = evt.id.split('-')[0]; |
---|
| 364 | if(!evt.disableDragging){ |
---|
| 365 | |
---|
| 366 | if(evt.isRepeat){ |
---|
| 367 | var schedulable = copyAndMoveTo(false , evt.id , false, "3", evt); |
---|
| 368 | |
---|
| 369 | var repeat = mount_exception(evt.id, evt.occurrence); |
---|
| 370 | DataLayer.remove('repeat', false); |
---|
| 371 | DataLayer.put('repeat', repeat); |
---|
| 372 | DataLayer.commit('repeat', false, function(data){ |
---|
[5752] | 373 | |
---|
| 374 | DataLayer.remove('schedulable', repeat.schedulable, false); |
---|
[5746] | 375 | DataLayer.put('schedulable', schedulable); |
---|
| 376 | |
---|
| 377 | }); |
---|
[5427] | 378 | |
---|
[5746] | 379 | }else{ |
---|
| 380 | DataLayer.put( "schedulable:calendar", evt ); |
---|
| 381 | |
---|
[5592] | 382 | event.editable = false; |
---|
| 383 | event.className = "blocked-event"; |
---|
[5746] | 384 | calendar.fullCalendar( 'updateEvent', evt ); |
---|
| 385 | } |
---|
| 386 | |
---|
[5592] | 387 | }else |
---|
[5746] | 388 | Calendar.rerenderView(true); |
---|
[5399] | 389 | }, |
---|
| 390 | |
---|
[5746] | 391 | eventResize: function( evt, event, view ){ |
---|
| 392 | evt.id = evt.id.split('-')[0]; |
---|
| 393 | if(!evt.disableDragging){ |
---|
| 394 | if(evt.isRepeat){ |
---|
| 395 | var schedulable = copyAndMoveTo(false , evt.id , false, "3", evt); |
---|
| 396 | |
---|
| 397 | //Normaliza a data para o backend |
---|
| 398 | schedulable.startTime = new Date(parseInt(schedulable.startTime)).toString('yyyy-MM-dd hh:mm:00'); |
---|
| 399 | schedulable.endTime = new Date(parseInt(schedulable.endTime)).toString('yyyy-MM-dd hh:mm:00'); |
---|
| 400 | |
---|
| 401 | var repeat = mount_exception(evt.id, evt.occurrence); |
---|
| 402 | |
---|
| 403 | DataLayer.remove('repeat', false); |
---|
| 404 | DataLayer.put('repeat', repeat); |
---|
| 405 | DataLayer.commit('repeat', false, function(data){ |
---|
| 406 | |
---|
[5752] | 407 | DataLayer.remove('schedulable', repeat.schedulable, false); |
---|
[5746] | 408 | DataLayer.put('schedulable', schedulable); |
---|
| 409 | |
---|
| 410 | }); |
---|
| 411 | }else{ |
---|
| 412 | DataLayer.put( "schedulable:calendar", evt ); |
---|
| 413 | evt.editable = false; |
---|
| 414 | evt.className = "blocked-event"; |
---|
| 415 | calendar.fullCalendar( 'updateEvent', evt ); |
---|
| 416 | } |
---|
| 417 | |
---|
[5592] | 418 | }else |
---|
| 419 | Calendar.rerenderView(true); |
---|
[5399] | 420 | }, |
---|
| 421 | |
---|
| 422 | eventClick: function( evt, event, view ){ |
---|
[5746] | 423 | evt.id = evt.id.split('-')[0]; |
---|
[6797] | 424 | |
---|
| 425 | if(evt.type == 1){ |
---|
| 426 | |
---|
[5746] | 427 | if(evt.selectable){ |
---|
| 428 | if(evt.isRepeat){ |
---|
| 429 | $.Zebra_Dialog(evt.title + ' é um evento com repetição.', { |
---|
| 430 | 'type': 'question', |
---|
| 431 | 'overlay_opacity': '0.5', |
---|
| 432 | 'buttons': ['Editar todas ocorrências', 'Editar essa ocorrência'], |
---|
| 433 | 'onClose': function(clicked) { |
---|
| 434 | if(clicked == 'Editar todas ocorrências') { |
---|
| 435 | eventDetails( DataLayer.get( "schedulable", evt.id), true); |
---|
| 436 | }else{ |
---|
| 437 | /* |
---|
| 438 | * TODO - repeat foi adicionado pois melhorias devem ser feitas no rollback do |
---|
| 439 | *DataLayer, repeat somente é usado quando se trata da criação de um evento |
---|
| 440 | *pela edição de uma ocorrência. |
---|
| 441 | */ |
---|
| 442 | var repeat = mount_exception(evt.id, evt.occurrence); |
---|
| 443 | |
---|
| 444 | $('.calendar-copy-move input[name="typeEvent"]').val("3"); |
---|
| 445 | |
---|
| 446 | eventDetails(copyAndMoveTo(false , evt.id , false, "3", evt), true, '', false, repeat); |
---|
| 447 | } |
---|
| 448 | } |
---|
| 449 | }); |
---|
[5947] | 450 | }else{ |
---|
| 451 | var schedulable = DataLayer.get( "schedulable", evt.id); |
---|
| 452 | schedulable.calendar = evt.calendar; |
---|
| 453 | eventDetails( schedulable, true); |
---|
| 454 | } |
---|
[5746] | 455 | } |
---|
[6797] | 456 | }else |
---|
| 457 | alert('Editar Tarefa'); |
---|
[5943] | 458 | }, |
---|
| 459 | |
---|
| 460 | eventAfterRender: function(event, element, view){ |
---|
| 461 | contentMenu(); |
---|
[5399] | 462 | } |
---|
[5409] | 463 | }, dateCalendar)); |
---|
[5592] | 464 | |
---|
| 465 | contentMenu(); |
---|
| 466 | |
---|
| 467 | $('body').click(function(){ |
---|
| 468 | $('#context-menu-event').html(''); |
---|
| 469 | }); |
---|
| 470 | |
---|
[5399] | 471 | if($(window).height() < $('body').height()){ |
---|
| 472 | var hei = $('body').height() - $(window).height(); |
---|
| 473 | hei = $('#divAppbox').height() - hei; |
---|
| 474 | $('#divAppbox').css('max-height', hei); |
---|
| 475 | $('#divAppbox').css('min-height', hei); |
---|
| 476 | $('body').css('overflow-y','hidden'); |
---|
| 477 | delete hei; |
---|
| 478 | } |
---|
| 479 | |
---|
| 480 | $(window).resize(function(){ |
---|
| 481 | $('#divAppbox').css('max-height', $(window).height() - 104); |
---|
| 482 | $('#divAppbox').css('min-height', $(window).height() - 104); |
---|
| 483 | $('#divAppbox').css('overflow-x', 'auto'); |
---|
| 484 | $('#divAppbox').css('overflow-y', 'scroll'); |
---|
| 485 | }); |
---|
| 486 | //Todo chamada do metodo que adiciona ao full calendar o botao de listagem de eventos |
---|
| 487 | //listEvents(); |
---|
[6444] | 488 | }); |
---|
[6768] | 489 | |
---|
| 490 | |
---|
| 491 | function useDesktopNotification(){ |
---|
| 492 | return !!parseInt(User.preferences.useDesktopNotification); |
---|
| 493 | } |
---|