Index: trunk/expressoMail1_2/js/main.js
===================================================================
--- trunk/expressoMail1_2/js/main.js	(revision 6288)
+++ trunk/expressoMail1_2/js/main.js	(revision 6295)
@@ -3617,42 +3617,51 @@
 
 					var createDialog = function(typeImport, propaget){
-							
+					    
+						if(typeof(typeImport) == "object"){
+						    var calendarPermission = typeImport.calendar;
+						    typeImport = typeImport.action;
+						}
+						
 						switch(parseInt(typeImport)){
 						case 1:
 						case 7:
-							$("#select-agenda").html('');
-								for(var id in Calendar.calendars){
-										var doc = document .createElement("OPTION");
-										doc.value = Calendar.calendars[id].id;
-										doc.innerHTML = Calendar.calendars[id].name;
-										$("#select-agenda").append(doc);
-									  
-								};
-								$("#import-dialog" ).dialog({
-									buttons: {
-										Cancel: function() {
-												$( this ).dialog( "close" );
-										},
-										"Importar" : function(){
-
-											 $.ajax({
-													 url: "controller.php?action="+import_url+'&from_ajax=true&selected='+$("#select-agenda option:selected").val()+'&status='+$("#select-status option:selected").val(),
-													 success: function(msg){
-
-															var alt = ( (msg = connector.unserialize(msg)) == "ok") ? "Importado com sucesso para " : "Ocorreu um erro ao importar o evento para a agenda ";
-															alert( alt + $("#select-agenda option:selected").text() );
-													}
-												});
-										
-											$( this ).dialog( "close" );
-										}
+						case 10:
+						    $("#select-agenda").html('');
+
+						    var shared = '', options = '';
+
+						    if(typeImport == 10){
+							shared = '&fromPermission='+calendarPermission;
+							
+							options += '<option value="'+calendarPermission+'">'+Calendar.signatureOf[calendarPermission].calendar.name+'</option>'
+						    }else{
+							for(var id in Calendar.calendars)
+							   options += '<option value="'+Calendar.calendars[id].id+'">'+Calendar.calendars[id].name+'</option>';
+
+							$("#select-agenda").append(options);
+						    }
+						    $("#import-dialog" ).dialog({
+							buttons: {
+							    Cancel: function() {
+								$( this ).dialog( "close" );
+							    },
+							    "Importar" : function(){
+								    $.ajax({
+									url: "controller.php?action="+import_url+'&from_ajax=true&selected='+$("#select-agenda option:selected").val()+'&status='+$("#select-status option:selected").val()+shared,
+									success: function(msg){
+									    var alt = ( (msg = connector.unserialize(msg)) == "ok") ? "Importado com sucesso para " : "Ocorreu um erro ao importar o evento para a agenda ";
+									    alert( alt + $("#select-agenda option:selected").text() );
 									}
-								 });
-                                                                 
-                                                                 if(typeImport == 7){
-                                                                     $("#import-dialog").find('#select-status option[value=1]').attr('selected','selected').trigger('change');
-                                                                     $("#import-dialog").find('#select-status').attr('disabled','disabled');
-                                                                 }
-							break;
+								    });
+								    $( this ).dialog( "close" );
+							    }
+							}
+							});
+
+							if(typeImport == 7){
+							    $("#import-dialog").find('#select-status option[value=1]').attr('selected','selected').trigger('change');
+							    $("#import-dialog").find('#select-status').attr('disabled','disabled');
+							}
+						    break;
 						case 3:
 							$.ajax({
@@ -3686,4 +3695,8 @@
 						case 9:
 							alert('Seu evento não possui alterações!');
+							return;
+							break;
+						case 11:
+							alert('Este evento já fora importando por algum dos particpantes e já se encontra disponível em sua agenda compartilhada!');
 							return;
 							break;
