Changeset 5636 for trunk/prototype/modules/calendar/js/helpers.js
- Timestamp:
- 03/05/12 19:01:39 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/modules/calendar/js/helpers.js
r5615 r5636 61 61 function eventDetails( objEvent, decoded, path, isMail) 62 62 { 63 attendees = {}; 64 63 65 if(path == undefined) 64 66 path = ""; … … 93 95 'p': 'acl-participation-required' 94 96 }; 95 /** 96 * callback de participantes generico 97 */ 97 98 98 var callbackAttendee = function(){ 99 99 //Cria qtip de permissões pelo click do checkbox … … 298 298 if ($('dd.attendee-list li:last').data('qtip')) 299 299 $('dd.attendee-list li:last').qtip('destroy'); 300 301 attendees = {}; 300 302 301 303 }, … … 418 420 UI.dialogs.addEvent.find('.start-time, .end-time').addClass('hidden') : 419 421 UI.dialogs.addEvent.find('.start-time, .end-time').removeClass('hidden'); 422 updateMap(true); 420 423 }); 421 424 … … 430 433 UI.dialogs.addEvent.find(".input-group .h1").Watermark("Evento sem título"); 431 434 if(User.preferences.hourFormat.length == 5) { 432 UI.dialogs.addEvent.find(".end-time, .start-time").mask("99:99"); 435 UI.dialogs.addEvent.find(".end-time, .start-time").mask("99:99", { 436 completed: function(){ 437 updateMap(); 438 } 439 }); 433 440 } else { 434 441 $.mask.definitions['{']='[ap]'; … … 439 446 $(this).timepicker("refresh"); 440 447 $(this).val($(this).val().replace(/[\.]/gi, "")); 448 updateMap(); 441 449 } 442 450 }); … … 444 452 UI.dialogs.addEvent.find(".number").numeric(); 445 453 User.preferences.dateFormat.indexOf('-') > 0 ? 446 UI.dialogs.addEvent.find(".date").mask("99-99-9999") : 447 UI.dialogs.addEvent.find(".date").mask("99/99/9999"); 454 UI.dialogs.addEvent.find(".date").mask("99-99-9999", { 455 completed:function(){ 456 updateMap(); 457 } 458 }) : 459 UI.dialogs.addEvent.find(".date").mask("99/99/9999", { 460 completed:function(){ 461 updateMap(); 462 } 463 }); 448 464 449 465 UI.dialogs.addEvent.find(".menu-addevent") … … 485 501 }); 486 502 487 UI.dialogs.addEvent.find('input.date').datepicker({dateFormat: 'dd/mm/yy'}); 488 if(path == ""){ 489 UI.dialogs.addEvent.find('input.time').timepicker({ 490 closeText: 'Ok', 491 hourGrid: 4, 492 minuteGrid: 10, 493 ampm : ((User.preferences.hourFormat.length > 5) ? true: false), 494 timeFormat: "hh:mm tt", 495 onSelect: function (selectedDateTime){ 496 if(!(User.preferences.hourFormat.length == 5)) 497 $(this).val(selectedDateTime.replace(/[\.]/gi, "")); 498 }, 499 onClose : function (selectedDateTime){ 500 if(!(User.preferences.hourFormat.length == 5)) 501 $(this).val(selectedDateTime.replace(/[\.]/gi, "")); 502 } 503 }); 504 } 503 var dates = UI.dialogs.addEvent.find('input.date').datepicker({ 504 dateFormat: 'dd/mm/yy', 505 onSelect : function( selectedDate ){ 506 updateMap(); 507 } 508 }); 509 //if(path == ""){ 510 UI.dialogs.addEvent.find('input.time').timepicker({ 511 closeText: 'Ok', 512 hourGrid: 4, 513 minuteGrid: 10, 514 ampm : ((User.preferences.hourFormat.length > 5) ? true: false), 515 timeFormat: "hh:mm tt", 516 onSelect: function (selectedDateTime){ 517 if(!(User.preferences.hourFormat.length == 5)) 518 $(this).val(selectedDateTime.replace(/[\.]/gi, "")); 519 updateMap(); 520 }, 521 onClose : function (selectedDateTime){ 522 if(!(User.preferences.hourFormat.length == 5)) 523 $(this).val(selectedDateTime.replace(/[\.]/gi, "")); 524 } 525 }); 526 //} 505 527 506 528 UI.dialogs.addEvent.find('.button-add-alarms').click(function(){ … … 598 620 */ 599 621 600 var user = DataLayer.get('user', ["=", "mail", $(this).val()], true); 601 622 var user = DataLayer.get('user', ["=", "mail", $(this).val()]); 623 if(user[0].id) 624 attendees[user[0].id].name = user[0].name; 602 625 603 626 /** … … 824 847 old_item = $(event.target).parents('li'); 825 848 newAttendeeId = DataLayer.put('participant', {user: old_item.find('.id').html(), isExternal: 0}); 849 850 attendees[old_item.find('.id').html()] = old_item.find('.name').html(); 851 826 852 blkAddAtendee.find('dd.attendee-list ul.attendee-list') 827 853 .append(DataLayer.render(path+'templates/participants_add_itemlist.ejs', [{id: newAttendeeId, name: old_item.find('.name').html(), mail: old_item.find('.mail').html(), isExternal: 0, acl: objEvent.acl}])) … … 1034 1060 progressTimer = window.setInterval(intervalHandler, interval); 1035 1061 }); 1036 1062 1063 if(objEvent.isShared){ 1064 1065 var acls = Calendar.signatureOf[objEvent.calendar].permission.acl; 1066 1067 if(!acls.write){ 1068 UI.dialogs.addEvent.find(':input').attr('disabled', 'disabled'); 1069 UI.dialogs.addEvent.find('.button').hide(); 1070 } 1071 1072 if(acls.remove) 1073 UI.dialogs.addEvent.find('.button.remove').show(); 1074 1075 UI.dialogs.addEvent.find('.button.cancel').show(); 1076 1077 1078 } 1079 1080 disponibily(objEvent, path, attendees); 1081 1037 1082 UI.dialogs.addEvent.find(':input').change(function(event){ 1038 1083 if (event.keyCode != '27' && event.keyCode != '13') … … 1042 1087 canDiscardEventDialog = false; 1043 1088 }); 1044 1045 if(objEvent.isShared){ 1046 1047 var acls = Calendar.signatureOf[objEvent.calendar].permission.acl; 1048 1049 if(!acls.write){ 1050 UI.dialogs.addEvent.find(':input').attr('disabled', 'disabled'); 1051 UI.dialogs.addEvent.find('.button').hide(); 1052 } 1053 1054 if(acls.remove) 1055 UI.dialogs.addEvent.find('.button.remove').show(); 1056 1057 UI.dialogs.addEvent.find('.button.cancel').show(); 1058 1059 1060 } 1061 1062 1089 1063 1090 UI.dialogs.addEvent.dialog('open'); 1091 //$('[href="#calendar_addevent_details7"]').trigger('click'); 1092 //$('[href="#calendar_addevent_details2"]').trigger('click'); 1064 1093 } 1065 1094 … … 1332 1361 refresh_calendars(); 1333 1362 }); 1334 1335 1363 }).end().filter('.cancel').click(function(evt){ 1336 1364 $tabs.tabs( "remove", "#configure_tab"); … … 1428 1456 if(idCalendar == User.preferences.defaultCalendar) 1429 1457 DataLayer.remove( 'modulePreference', User.preferenceIds['defaultCalendar']); 1430 1431 1458 1432 1459 DataLayer.commit( false, false, function( received ){ 1433 1460 delete Calendar.currentViewKey; … … 1540 1567 borderColor: colorsSuggestions[selected]['border'].substring(1) 1541 1568 }); 1542 1543 1569 DataLayer.commit( false, false, function( received ){ 1544 1570 delete Calendar.currentViewKey; … … 1546 1572 refresh_calendars(); 1547 1573 }); 1548 1549 1574 meu_container.find(".button.new").qtip('destroy'); 1550 1575 }); … … 1979 2004 delete schedulable.repeat; 1980 2005 2006 1981 2007 schedulable.calendar = DataLayer.copy(calendar); 1982 2008 … … 1985 2011 1986 2012 var participants = DataLayer.copy(schedulable.participants); 1987 1988 2013 delete schedulable.participants; 1989 2014 … … 1996 2021 1997 2022 delete participant.id; 1998 delete participant.schedulable;1999 delete participant.delegatedFrom;2000 2023 2001 2024 return participant ; 2002 2025 }); 2003 2026 2004 DataLayer.put('schedulable', newSchedulable); 2027 2028 2029 DataLayer.put('schedulable', newSchedulable); 2030 2005 2031 } 2006 2032
Note: See TracChangeset
for help on using the changeset viewer.