Changeset 6996 for trunk/expressoMail1_2/js/main.js
- Timestamp:
- 08/10/12 19:11:37 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/main.js
r6980 r6996 1 1 // Tempo do auto refresh (em milisegundos) 2 2 var time_refresh = 300000; 3 3 4 // tempo do auto save (em milisegundos) 4 5 // 20000 = 20 segundos … … 6 7 var results_search_messages = ""; 7 8 var cabecalho = '<h4>ExpressoLivre - ExpressoMail</h4>'; 8 // Variavel para controle de atualização das mensagens listadas na modal de alerta de filtro por remetente 9 var checkAlarmsFilter = false; 9 10 var auxNotificationCriteriaVetor = []; 11 var auxNotification; 12 13 var countNewMessage = 0; 14 var notifyNewMessageFilter = []; 10 15 11 16 var dynamicPersonalContacts = new Array(); … … 20 25 } 21 26 } 22 27 23 28 function mount_url_folder(folders){ 24 29 return folders.join(cyrus_delimiter); … … 75 80 76 81 if(preferences.show_name_print_messages == "1") { 77 82 var getUserName = document.getElementById("user_info"); 78 83 var userName = getUserName.innerHTML; 79 84 var position = userName.indexOf("-"); … … 572 577 573 578 function auto_refresh(){ 574 refresh(preferences.alert_new_msg );579 refresh(preferences.alert_new_msg, preferences.notifications); 575 580 setTimeout('auto_refresh()', time_refresh); 576 581 } … … 581 586 } 582 587 583 function refresh(alert_new_msg){ 588 function notificationFilter(data, notifyCriteria){ 589 590 if(parseInt(notifyCriteria) && data.length > 0 && !activePage ){ 591 592 var howManyCriteria = $('div.gray.filtersDeadline .message-list li').length; 593 var differenceOfNewCriteria = data.length - howManyCriteria; 594 595 if(differenceOfNewCriteria > 0){ 596 for(var i=data.length - differenceOfNewCriteria; i < data.length; i++){ 597 598 desktopNotification.sentNotification("",get_lang("Filter criteria"), truncate(new Date(data[i].udate).toString('dd/MM HH:mm') + ' - ' + data[i].from+' - '+data[i].subject, 75)); 599 desktopNotification.showNotification(false, function(){ 600 window.focus(); 601 this.cancel(); 602 }); 603 } 604 } 605 } 606 } 607 608 function refresh(alert_new_msg, notifyPermission){ 609 584 610 getFromAlertRules(); 585 611 var handler_refresh = function(data){ 586 if(checkAlarmsFilter){ 587 handlerMessageFilter = function (data) { 588 alarmFollowupflagged('filtersAlarms', data); 589 } 590 /* Busca nas pastas indexadas para ver se há novas mensagens com a flag $FilteredMessage */ 591 cExecute ("$this.imap_functions.getFlaggedAlertMessages&folders="+fromRules, handlerMessageFilter); 592 } 593 checkAlarmsFilter = true; 612 handlerMessageFilter = function (data) { 613 alarmFollowupflagged('filtersAlarms', data); 614 notificationFilter(data, notifyPermission); 615 } 616 /* Busca nas pastas indexadas para ver se há novas mensagens com a flag $FilteredMessage */ 617 cExecute ("$this.imap_functions.getFlaggedAlertMessages&folders="+fromRules, handlerMessageFilter); 618 594 619 if(data['msg_range_end']) 595 620 if(data['msg_range_end'] > 0) … … 603 628 showEmptyBoxMsg(box); 604 629 605 if (data.length > 0 ){630 if (data.length > 0 || countNewMessage > 0){ 606 631 for(var i=0;i< data.length;i++){ 607 632 if (!onceOpenedHeadersMessages[current_folder]) … … 742 767 if(parseInt(preferences.use_shortcuts)) 743 768 select_msg("null","reload_msg","null"); 744 745 if(parseInt(alert_new_msg) && data.new_msgs > 0 )769 770 if(parseInt(alert_new_msg) && data.new_msgs > 0 && activePage) 746 771 alert(data['new_msgs'] > 1 ? get_lang("You have %1 new messages", data['new_msgs']) + "!" : get_lang("You have 1 new message") +"!"); 772 773 774 if(parseInt(notifyPermission) && (data.new_msgs > 0 || !!countNewMessage) && !activePage ){ 775 776 countNewMessage += data.length; 777 778 desktopNotificationAux = desktopNotification.sentNotification("",get_lang("Notification"), countNewMessage > 1 ? get_lang("You have %1 new messages", countNewMessage) + "!" : get_lang("You have 1 new message") + "!"); 779 780 if(auxNotification !== 'undefined') 781 desktopNotification.cancelByReference(auxNotification); 782 783 desktopNotification.showNotification(function(){ 784 countNewMessage = 0; 785 }, function(){ 786 window.focus(); 787 this.cancel(); 788 countNewMessage = 0; 789 }); 790 791 auxNotification = desktopNotificationAux; 792 } 747 793 build_quota(data['quota']); 748 794 } … … 4018 4064 } 4019 4065 4066 //Normalização dos dados evita ter que reemplementar toda as funcionalidades do calendar 4067 function decodeCreateSchedulable(type, ID){ 4068 var startEvent = new Date(); 4069 if(startEvent.toString('mm') < 30) 4070 startEvent.add({minutes: (30 - parseInt(startEvent.toString('mm')))}); 4071 else 4072 startEvent.add({hours: 1, minutes: '-'+startEvent.toString('mm')}); 4073 var endEvent = function(date){ 4074 if(!!User.preferences.defaultCalendar){ 4075 return new Date(parseInt(date.getTime()) + 4076 (!!Calendar.signatureOf[User.preferences.defaultCalendar].calendar.defaultDuration ? 4077 (Calendar.signatureOf[User.preferences.defaultCalendar].calendar.defaultDuration * 60000) : 4078 (User.preferences.defaultDuration * 60000) 4079 )); 4080 }else 4081 return new Date(parseInt(date.getTime()) + (User.preferences.defaultDuration * 60000)); 4082 }; 4083 4084 var emails = $("#to_values_"+ID).val().split(','); 4085 4086 var schedulable = {}; 4087 4088 schedulable = { 4089 acl: {inviteGuests: true, organization: true ,participationRequired: false, read: true, write: true}, 4090 alarms: [], 4091 allDay: false, 4092 attachments: [], 4093 isAttendee: true, 4094 attendee: '',//TODOOOOOO, 4095 category: '', 4096 'class': '1', 4097 delegatedFrom: {}, 4098 endDate: startEvent.toString(User.preferences.dateFormat), 4099 startDate: endEvent(startEvent).toString(User.preferences.dateFormat), 4100 startHour: startEvent.toString(User.preferences.hourFormat), 4101 endHour: endEvent(startEvent).toString(User.preferences.hourFormat), 4102 timezone: User.preferences.defaultCalendar ? Calendar.signatureOf[User.preferences.defaultCalendar].calendar.timezone : User.preferences.timezone, 4103 summary : $("#subject_"+ID).text(), 4104 description : $("#body_" + ID).text(), 4105 startTime: startEvent.getTime(), 4106 endTime: endEvent(startEvent), 4107 timezones: Timezone.timezones, 4108 me: {name: User.me.name, mail: User.me.mail, acl: 'rowi', status: '1', delegatedFrom: '0', id: User.me.id}, 4109 organizer: {name: User.me.name, mail: User.me.mail, acl: 'rowi', status: '1', delegatedFrom: '0' , id: User.me.id}, 4110 statusParticipants: {accepted: 0, cancelled: 0, tentative: 0, unanswered:emails.length}, 4111 location: '', 4112 attendee: $.map(emails, function( mail ){ 4113 var contact = false; 4114 var decoded = Encoder.htmlDecode(mail); 4115 var newAttendeeName = ""; 4116 4117 var name = decoded.match(/"([^"]*)"/) ? decoded.match(/"([^"]*)"/)[1] : ''; 4118 var mail = decoded.match(/<([^<]*)>[\s]*$/) ? decoded.match(/<([^<]*)>[\s]*$/)[1].toLowerCase() : decoded; 4119 4120 4121 var user = DataLayer.get('user', ["=", "mail", mail], true); 4122 4123 if( $.type(user) == "array" ) 4124 user = user[0]; 4125 4126 if(user != ''){ 4127 //user = {name : name , mail : mail}; 4128 if(User.me.mail == user.mail) 4129 return(null); 4130 user.isExternal = (!!user && !(!!user.isExternal)) ? 0 : 1; 4131 4132 return DataLayer.merge({ 4133 name: user.name, 4134 mail: user.mail, 4135 acl: 'r', 4136 delegatedFrom: '0', 4137 status: '4', 4138 isExternal: user.isExternal 4139 }, !!user.id ? {id : DataLayer.put('participant', {user: user.id, isExternal: user.isExternal})} : {id: DataLayer.put('participant', {user: user})}); 4140 }else if(mail.match(/[\w-]+(\.[\w-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])/)){ 4141 4142 var userId = DataLayer.put('user', { 4143 name: name, 4144 mail: mail, 4145 isExternal: '1' 4146 }); 4147 var newAttendeeId = DataLayer.put('participant', { 4148 user: userId, 4149 isExternal: '1' 4150 }); 4151 4152 return { 4153 id: newAttendeeId, 4154 name: name, 4155 mail: mail, 4156 acl: 'r', 4157 delegatedFrom: '0', 4158 status: '4', 4159 isExternal: '1' 4160 }; 4161 4162 }else 4163 return (null); 4164 }) 4165 }; 4166 4167 schedulable = DataLayer.merge(schedulable, 4168 type == 'event' ? 4169 {calendar: User.preferences.defaultCalendar ? User.preferences.defaultCalendar : Calendar.calendars[0], calendars: Calendar.calendars} 4170 : {group: Calendar.groups[0].id, groups: Calendar.groups, percentage: 0} 4171 ); 4172 4173 return schedulable; 4174 4175 4176 } 4177 4020 4178 function import_implements_calendar(){ 4021 4179 … … 4031 4189 $.ajax({url: "../prototype/modules/calendar/js/map.disponibility.js", async: false, beforeSend: function( xhr ) {xhr.overrideMimeType('text/javascript; charset=ISO-8859-1')}}); 4032 4190 $.ajax({url: "../prototype/modules/calendar/js/helpers.js", async: false, beforeSend: function( xhr ) {xhr.overrideMimeType('text/javascript; charset=ISO-8859-1')}}); 4191 $.ajax({url: "../prototype/modules/calendar/js/task.helpers.js", async: false, beforeSend: function( xhr ) {xhr.overrideMimeType('text/javascript; charset=ISO-8859-1')}}); 4033 4192 //$.ajax({ url: "../prototype/modules/calendar/js/timezone.js", async: false}); 4034 4193 //$.ajax({ url: "../prototype/modules/calendar/js/calendar.codecs.js", async: false}); 4035 4194 $.ajax({url: "../prototype/plugins/encoder/encoder.js", async: false, beforeSend: function( xhr ) {xhr.overrideMimeType('text/javascript; charset=ISO-8859-1')}}); 4195 $.ajax({url: "../prototype/plugins/jquery.spinner/jquery.spinner.min.js", async: false, beforeSend: function( xhr ) {xhr.overrideMimeType('text/javascript; charset=ISO-8859-1')}}); 4036 4196 //$.ajax({url: "../prototype/plugins/dateFormat/dateFormat.js", async: false, beforeSend: function( xhr ) { xhr.overrideMimeType('text/javascript; charset=ISO-8859-1')}}); 4037 4197 … … 4073 4233 wfolders.makeWindow('null','import'); 4074 4234 } 4075 4076 function decodeOwner(){4235 //Verifica o contexto de importação 4236 function decodeOwner(){ 4077 4237 owner = User.me.id; 4078 4238 var imapBox = openTab.imapBox[currentTab].split(cyrus_delimiter); … … 4082 4242 } 4083 4243 return owner; 4084 } 4085 function import_calendar(data){ 4086 var import_url = '$this.db_functions.import_vcard&msg_folder='+data; 4087 var logUser; 4088 var up; 4089 var owner; 4090 function handler_import_calendar(data){ 4091 if(data === true){ 4092 write_msg(get_lang("The event was imported successfully.")); 4093 } 4094 else if( data['url'] ) 4095 { 4096 var form = document.createElement( "form" ); 4097 4098 form.setAttribute( "action", DEFAULT_URL + data['url'] + '&isPost=true' ); 4099 form.setAttribute( "method", "POST" ); 4100 4101 document.body.appendChild( form ); 4102 4103 form.submit(); 4104 } 4105 else 4106 write_msg(get_lang(data)); 4107 } 4244 } 4245 4246 function import_calendar(data){ 4247 var import_url = '$this.db_functions.import_vcard&msg_folder='+data; 4248 var logUser; 4249 var up; 4250 var owner; 4251 4252 function handler_import_calendar(data){ 4253 if(data === true){ 4254 write_msg(get_lang("The event was imported successfully.")); 4255 } 4256 else if( data['url'] ) 4257 { 4258 var form = document.createElement( "form" ); 4259 4260 form.setAttribute( "action", DEFAULT_URL + data['url'] + '&isPost=true' ); 4261 form.setAttribute( "method", "POST" ); 4262 4263 document.body.appendChild( form ); 4264 4265 form.submit(); 4266 } 4267 else 4268 write_msg(get_lang(data)); 4269 } 4108 4270 if(defaultCalendar == "expressoCalendar" && $("#expressoCalendarid")[0]){ 4109 4271 import_implements_calendar(); 4110 4272 $( "#import-dialog" ).dialog({ 4111 autoOpen: false, 4112 height: 220, 4113 modal: true, 4114 resizable : false, 4115 open: function(event, ui) 4116 { 4117 if(typeof(shortcut) != 'undefined') shortcut.disabled = true; 4118 }, 4119 close: function(event, ui) 4120 { 4121 event.stopPropagation(); 4122 if(typeof(shortcut) != 'undefined') shortcut.disabled = false; 4123 }, 4124 closeOnEscape: true 4273 autoOpen: false, 4274 height: 220, 4275 modal: true, 4276 resizable : false, 4277 open: function(event, ui) { 4278 if(typeof(shortcut) != 'undefined') shortcut.disabled = true; 4279 }, 4280 close: function(event, ui){ 4281 event.stopPropagation(); 4282 if(typeof(shortcut) != 'undefined') shortcut.disabled = false; 4283 }, 4284 closeOnEscape: true 4125 4285 }); 4126 4286 4127 4287 $.ajax({ 4128 url: "controller.php?action="+import_url+'&from_ajax=true&id_user='+User.me.id+'&readable=true&cirus_delimiter='+cyrus_delimiter+'&analize=true&uidAccount='+decodeOwner(), 4129 async: false, 4130 success: function(data){ 4131 data = connector.unserialize(data); 4132 4133 4134 var createDialog = function(typeImport, propaget){ 4135 4136 if(typeof(typeImport) == "object"){ 4137 var calendarPermission = typeImport.calendar; 4138 typeImport = typeImport.action; 4288 url: "controller.php?action="+import_url+'&from_ajax=true&id_user='+User.me.id+'&readable=true&cirus_delimiter='+cyrus_delimiter+'&analize=true&uidAccount='+decodeOwner(), 4289 async: false, 4290 success: function(data){ 4291 data = connector.unserialize(data); 4292 var createDialog = function(typeImport, propaget){ 4293 4294 if(typeof(typeImport) == "object"){ 4295 var calendarIds = !!typeImport.calendar ? typeImport.calendar : Calendar[typeImport.type]; 4296 typeImport = typeImport.action; 4297 } 4298 4299 switch(parseInt(typeImport)){ 4300 case 1: 4301 case 7: 4302 case 10: 4303 $("#select-agenda").html(''); 4304 4305 var options = ''; 4306 4307 if(calendarIds){ 4308 for(var i = 0; i < calendarIds.length; i++) 4309 options += '<option value="'+calendarIds[i]+'">'+Calendar.signatureOf[calendarIds[i]].calendar.name+'</option>' 4310 } 4311 4312 $("#select-agenda").append(options); 4313 $("#select-agenda").css("display", "block"); 4314 4315 $("#import-dialog" ).dialog({ 4316 buttons: { 4317 Cancel: function() { 4318 $( this ).dialog( "close" ); 4319 }, 4320 "Importar" : function(){ 4321 $.ajax({ 4322 url: "controller.php?action="+import_url+'&from_ajax=true&selected='+$("#select-agenda option:selected").val()+'&status='+$("#select-status option:selected").val()+'&uidAccount='+decodeOwner(), 4323 success: function(msg){ 4324 var alt = ( (msg = connector.unserialize(msg)) == "ok") ? "Importado com sucesso para " : "Ocorreu um erro ao importar o evento/tarefa para a agenda "; 4325 alert( alt + $("#select-agenda option:selected").text() ); 4326 } 4327 }); 4328 $( this ).dialog( "close" ); 4329 } 4330 } 4331 }); 4332 4333 if(typeImport == 7){ 4334 $("#import-dialog").find('#select-status option[value=1]').attr('selected','selected').trigger('change'); 4335 $("#import-dialog").find('#select-status').attr('disabled','disabled'); 4336 } 4337 break; 4338 case 3: 4339 $.ajax({ 4340 url: "controller.php?action="+import_url+'&from_ajax=true&selected=true', 4341 success: function(msg){ 4342 alert( ( ( connector.unserialize(msg)) == "ok") ? "Seu evento/tarefa foi removido " : "Ocorreu um erro ao remover o evento/tarefa" ); 4343 } 4344 }); 4345 return; 4346 break; 4347 case 5: 4348 $.ajax({ 4349 url: "controller.php?action="+import_url+'&from_ajax=true&selected=true', 4350 success: function(msg){ 4351 alert( ( ( connector.unserialize(msg)) == "ok") ? "Seu evento/tarefa foi Atualizado com sucesso" : "Ocorreu um erro ao atualizar evento/tarefa" ); 4352 } 4353 }); 4354 return; 4355 break; 4356 case 6: 4357 var acceptedSuggestion = confirm("Deseja atualizar o evento/tarefa de acordo com a sugestão ?"); 4358 $.ajax({ 4359 url: "controller.php?action="+import_url+'&from_ajax=true&id_user='+User.me.id+'&selected=true&cirus_delimiter='+cyrus_delimiter+'&acceptedSuggestion='+acceptedSuggestion+"&from="+document.getElementById('from_values_'+currentTab).value+'&uidAccount='+decodeOwner(), 4360 success: function(msg){ 4361 if(acceptedSuggestion) 4362 alert( ( ( connector.unserialize(msg)) == "ok") ? "Evento/tarefa atualizado com sucesso " : "Ocorreu um erro ao atualizar o evento" ); 4139 4363 } 4140 4141 switch(parseInt(typeImport)){ 4142 case 1: 4143 case 7: 4144 case 10: 4145 $("#select-agenda").html(''); 4146 4147 var options = ''; 4148 4149 if(typeImport == 10){ 4150 for(var i = 0; i < calendarPermission.length; i++) 4151 options += '<option value="'+calendarPermission[i]+'">'+Calendar.signatureOf[calendarPermission[i]].calendar.name+'</option>' 4152 }else{ 4153 for(var id in Calendar.signatures) 4154 options += parseInt(Calendar.signatures[id].isOwner) ? '<option value="'+Calendar.signatures[id].calendar.id+'">'+Calendar.signatures[id].calendar.name+'</option>' : ''; 4364 }); 4365 return; 4366 break; 4367 case 9: 4368 alert('Seu evento/tarefa não possui alterações!'); 4369 return; 4370 break; 4371 case 11: 4372 alert('Este evento/tarefa já fora importando por algum dos particpantes e já se encontra disponível em sua agenda compartilhada!'); 4373 return; 4374 break; 4375 default: 4376 up = true; 4377 $("#select-agenda").css("display", "none"); 4378 $("#import-dialog" ).children("p:first-child").css("display", "none"); 4379 $("#import-dialog" ).dialog({ 4380 height: 160, 4381 title: 'Atualizar Evento/Tarefa', 4382 buttons: { 4383 Cancel: function() { 4384 $( this ).dialog( "close" ); 4385 }, 4386 "Atualizar": function() { 4387 $.ajax({ 4388 url: "controller.php?action="+import_url+'&from_ajax=true&cirus_delimiter='+cyrus_delimiter+'&selected='+ (parseInt(typeImport) == 2 || parseInt(typeImport) == 4 ? 'true' : $("#select-agenda option:selected").val()) +'&status='+$("#select-status option:selected").val()+'&uidAccount='+decodeOwner(), 4389 success: function(msg){ 4390 alert( ( (msg = connector.unserialize(msg)) == "ok") ? "Atualizado com sucesso" : "Ocorreu um erro ao atualizar o evento" ); 4391 } 4392 }); 4393 $( this ).dialog( "close" ); 4155 4394 } 4156 4157 $("#select-agenda").append(options); 4158 $("#select-agenda").css("display", "block"); 4159 4160 $("#import-dialog" ).dialog({ 4161 buttons: { 4162 Cancel: function() { 4163 $( this ).dialog( "close" ); 4164 }, 4165 "Importar" : function(){ 4166 $.ajax({ 4167 url: "controller.php?action="+import_url+'&from_ajax=true&selected='+$("#select-agenda option:selected").val()+'&status='+$("#select-status option:selected").val()+'&uidAccount='+decodeOwner(), 4168 success: function(msg){ 4169 var alt = ( (msg = connector.unserialize(msg)) == "ok") ? "Importado com sucesso para " : "Ocorreu um erro ao importar o evento para a agenda "; 4170 alert( alt + $("#select-agenda option:selected").text() ); 4171 } 4172 }); 4173 $( this ).dialog( "close" ); 4174 } 4175 } 4176 }); 4177 4178 if(typeImport == 7){ 4179 $("#import-dialog").find('#select-status option[value=1]').attr('selected','selected').trigger('change'); 4180 $("#import-dialog").find('#select-status').attr('disabled','disabled'); 4181 } 4182 break; 4183 case 3: 4184 $.ajax({ 4185 url: "controller.php?action="+import_url+'&from_ajax=true&selected=true', 4186 success: function(msg){ 4187 alert( ( ( connector.unserialize(msg)) == "ok") ? "Seu evento foi removido " : "Ocorreu um erro ao remover o evento" ); 4188 } 4189 }); 4190 return; 4191 break; 4192 case 5: 4193 $.ajax({ 4194 url: "controller.php?action="+import_url+'&from_ajax=true&selected=true', 4195 success: function(msg){ 4196 alert( ( ( connector.unserialize(msg)) == "ok") ? "Seu evento foi Atualizado com sucesso" : "Ocorreu um erro ao atualizar evento" ); 4197 } 4198 }); 4199 return; 4200 break; 4201 case 6: 4202 var acceptedSuggestion = confirm("Deseja atualizar o evento de acordo com a sugestão ?"); 4203 $.ajax({ 4204 url: "controller.php?action="+import_url+'&from_ajax=true&id_user='+User.me.id+'&selected=true&cirus_delimiter='+cyrus_delimiter+'&acceptedSuggestion='+acceptedSuggestion+"&from="+document.getElementById('from_values_'+currentTab).value+'&uidAccount='+decodeOwner(), 4205 success: function(msg){ 4206 if(acceptedSuggestion) 4207 alert( ( ( connector.unserialize(msg)) == "ok") ? "Evento atualizado com sucesso " : "Ocorreu um erro ao atualizar o evento" ); 4208 } 4209 }); 4210 return; 4211 break; 4212 case 9: 4213 alert('Seu evento não possui alterações!'); 4214 return; 4215 break; 4216 case 11: 4217 alert('Este evento já fora importando por algum dos particpantes e já se encontra disponível em sua agenda compartilhada!'); 4218 return; 4219 break; 4220 default: 4221 up = true; 4222 $("#select-agenda").css("display", "none"); 4223 $("#import-dialog" ).children("p:first-child").css("display", "none"); 4224 $("#import-dialog" ).dialog({ 4225 height: 160, 4226 title: 'Atualizar Evento', 4227 buttons: { 4228 Cancel: function() { 4229 $( this ).dialog( "close" ); 4230 }, 4231 "Atualizar": function() { 4232 4233 $.ajax({ 4234 url: "controller.php?action="+import_url+'&from_ajax=true&cirus_delimiter='+cyrus_delimiter+'&selected='+ (parseInt(typeImport) == 2 || parseInt(typeImport) == 4 ? 'true' : $("#select-agenda option:selected").val()) +'&status='+$("#select-status option:selected").val()+'&uidAccount='+decodeOwner(), 4235 success: function(msg){ 4236 alert( ( (msg = connector.unserialize(msg)) == "ok") ? "Atualizado com sucesso" : "Ocorreu um erro ao atualizar o evento" ); 4237 } 4238 }); 4239 $( this ).dialog( "close" ); 4240 } 4241 }, 4242 close:function(event, ui) 4243 { 4244 if(typeof(shortcut) != 'undefined') shortcut.disabled = false; 4245 }, 4246 open: function(event, ui) 4247 { 4248 if(typeof(shortcut) != 'undefined') shortcut.disabled = true; 4249 } 4250 }); 4251 $(".ui-dialog-buttonpane").find(".ui-button:last").children().html("Atualizar"); 4395 }, 4396 close:function(event, ui) 4397 { 4398 if(typeof(shortcut) != 'undefined') shortcut.disabled = false; 4399 }, 4400 open: function(event, ui) 4401 { 4402 if(typeof(shortcut) != 'undefined') shortcut.disabled = true; 4252 4403 } 4253 $( "#import-dialog" ).dialog( "open" ); 4254 4255 }; 4256 createDialog(data, true); 4257 4258 }, 4259 beforeSend: function( jqXHR, settings ){ 4260 connector.showProgressBar(); 4261 }, 4262 complete: function( jqXHR, settings ){ 4263 connector.hideProgressBar(); 4264 } 4265 }); 4266 4267 } 4268 else 4269 { 4270 if(confirm(get_lang("Do you confirm this import to your Calendar?"))){ 4271 cExecute( import_url + "&from_ajax=true", handler_import_calendar); 4272 } 4273 } 4274 } 4404 }); 4405 $(".ui-dialog-buttonpane").find(".ui-button:last").children().html("Atualizar"); 4406 } 4407 $( "#import-dialog" ).dialog( "open" ); 4408 4409 }; 4410 createDialog(data, true); 4411 4412 }, 4413 beforeSend: function( jqXHR, settings ){ 4414 connector.showProgressBar(); 4415 }, 4416 complete: function( jqXHR, settings ){ 4417 connector.hideProgressBar(); 4418 } 4419 }); 4420 } 4421 else 4422 { 4423 if(confirm(get_lang("Do you confirm this import to your Calendar?"))){ 4424 cExecute( import_url + "&from_ajax=true", handler_import_calendar); 4425 } 4426 } 4427 } 4428 4275 4429 function open_msg_part(data){ 4276 4430 var handler_open_msg_part = function (data)
Note: See TracChangeset
for help on using the changeset viewer.