Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/css/layout.css
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/css/layout.css	(revision 6946)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/css/layout.css	(revision 6981)
@@ -786,4 +786,5 @@
 
 .button.add.button-add-attachment{margin: -9px 0 0 8px;}
+.button.btn-success.fileinput-button{width: 85px;}
 .button.btn-danger.delete{margin: 0 0 0 0; min-width: 143px;}
 
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/js/activity.helpers.js
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/js/activity.helpers.js	(revision 6977)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/js/activity.helpers.js	(revision 6981)
@@ -363,6 +363,7 @@
                         });
                 });
-                $('.attachment-list input').remove();
-                $('.row.fileupload-buttonbar-activity .attachments-list p').remove();
+                $('div.new-activity-win .attachment-list input').remove();
+                $('div.new-activity-win .row.fileupload-buttonbar-activity .attachments-list p').remove();
+		$('div.new-activity-win .btn-danger.delete').addClass('hidden');
             }
         }});
@@ -383,130 +384,6 @@
     text: false
 });
-var maxSizeFile = 2000000;
-$('#fileuploadactivity').fileupload({
-    sequentialUploads: true,
-    add: function (e, data) {
-	if(data.files[0].size < maxSizeFile)
-	    data.submit();
-    },
-    change: function (e, data) {
-	$.each(data.files, function (index, file) {
-	    var attach = {};
-	    attach.fileName = file.name;
-	    var ext = file.name.split('.');
-	    if(file.name.length > 10)
-		attach.fileName = ext.length == 1 ? file.name.substr(0, 10) :  file.name.substr(0, 6) + '.' + ext[ext.length -1];
-	    attach.fileSize = formatBytes(file.size);
-	    if(file.size > maxSizeFile)
-		attach.error = 'Tamanho de arquivo nao permitido!!'
-				
-	    $('div.new-activity-win .attachments-list').append(DataLayer.render(path+'templates/attachment_add_itemlist.ejs', {
-		file : attach
-	    }));
-				
-	    if(file.size < maxSizeFile){
-		$('div.new-activity-win .fileinput-button.new').append(data.fileInput[0]).removeClass('new');
-		$('div.new-activity-win .attachments-list').find('[type=file]').addClass('hidden');
-					
-	    }else
-		$('div.new-activity-win .fileinput-button.new').removeClass('new');
-				
-				
-	    $('div.new-activity-win .attachments-list').find('.button.close').button({
-		icons: {
-		    primary: "ui-icon-close"
-		},
-		text: false
-	    }).click(function(){
-		var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
-		$('.attachment-list').find('input[value="'+idAttach+'"]')
-		$(this).parent().remove();
-	    });	
-				
-	})
-	},
-    done: function(e, data){
-    	var currentUpload = $('div.new-activity-win .progress.after-upload:first').removeClass('after-upload').addClass('on-complete').hide();
-
-    	if(!!data.result && data.result != "[]"){
-    	    var newAttach = (attch = jQuery.parseJSON(data.result)) ? attch : jQuery.parseJSON(data.result[0].activeElement.childNodes[0].data);
-    	    $('div.new-activity-win .attachment-list').append('<input tyepe="hidden" name="attachment[]" value="'+newAttach['attachment'][0][0].id+'"/>');
-    	    currentUpload.removeClass('on-complete').parents('p')
-    	    .append('<input type="hidden" name="fileId[]" value="'+newAttach['attachment'][0][0].id+'"/>')
-    	    .find('.status-upload').addClass('ui-icon ui-icon-check');
-    	}else
-    	    currentUpload.removeClass('on-complete').parents('p').find('.status-upload').addClass('ui-icon ui-icon-cancel');
-        }
-});
-$('.attachments-list .button').button();
-
-if(!!window.FormData)			
-$('#fileuploadactivity').bind('fileuploadstart', function () {
-    var widget = $(this),
-    progressElement = $('#fileupload-progress-activity').fadeIn(),
-    interval = 500,
-    total = 0,
-    loaded = 0,
-    loadedBefore = 0,
-    progressTimer,
-    progressHandler = function (e, data) {
-	loaded = data.loaded;
-	total = data.total;
-    },
-    stopHandler = function () {
-	widget
-	.unbind('fileuploadprogressall', progressHandler)
-	.unbind('fileuploadstop', stopHandler);
-	window.clearInterval(progressTimer);
-	progressElement.fadeOut(function () {
-	    progressElement.html('');
-	});
-    },
-    formatTime = function (seconds) {
-	var date = new Date(seconds * 1000);
-	return ('0' + date.getUTCHours()).slice(-2) + ':' +
-	('0' + date.getUTCMinutes()).slice(-2) + ':' +
-	('0' + date.getUTCSeconds()).slice(-2);
-    },
-    /* formatBytes = function (bytes) {
-            if (bytes >= 1000000000) {
-                return (bytes / 1000000000).toFixed(2) + ' GB';
-            }
-            if (bytes >= 1000000) {
-                return (bytes / 1000000).toFixed(2) + ' MB';
-            }
-            if (bytes >= 1000) {
-                return (bytes / 1000).toFixed(2) + ' KB';
-            }
-            return bytes + ' B';
-        },*/
-    formatPercentage = function (floatValue) {
-	return (floatValue * 100).toFixed(2) + ' %';
-    },
-    updateProgressElement = function (loaded, total, bps) {
-	progressElement.html(
-	    formatBytes(bps) + 'ps | ' +
-	    formatTime((total - loaded) / bps) + ' | ' +
-	    formatPercentage(loaded / total) + ' | ' +
-	    formatBytes(loaded) + ' / ' + formatBytes(total)
-	    );
-    },
-    intervalHandler = function () {
-	var diff = loaded - loadedBefore;
-	if (!diff) {
-	    return;
-	}
-	loadedBefore = loaded;
-	updateProgressElement(
-	    loaded,
-	    total,
-	    diff * (1000 / interval)
-	    );
-    };
-    widget
-    .bind('fileuploadprogressall', progressHandler)
-    .bind('fileuploadstop', stopHandler);
-    progressTimer = window.setInterval(intervalHandler, interval);
-});
+
+extendsFileupload('activity', path);
 
 UI.dialogs.addActivity.find(':input').change(function(event){
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/js/helpers.js
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/js/helpers.js	(revision 6976)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/js/helpers.js	(revision 6981)
@@ -164,6 +164,6 @@
 	$('.fc-header-right').append(print);
 	$('.fc-button-print').click(function(){
-		alert('A tela de impressão será melhor visualizada com a preferência "Paisagem" do seu browser selecionada.');
-		printNow();
+	    alert('A tela de impressão será melhor visualizada com a preferência "Paisagem" do seu browser selecionada.');
+	    printNow();
 	});
 }
@@ -1453,6 +1453,7 @@
                         });
                 });
-                $('.attachment-list input').remove();
-                $('.row.fileupload-buttonbar .attachments-list p').remove();
+                $('div.new-event-win .attachment-list input').remove();
+                $('div.new-event-win .row.fileupload-buttonbar .attachments-list p').remove();
+		$('div.new-event-win .btn-danger.delete').addClass('hidden');
             }
         }});
@@ -1473,130 +1474,6 @@
     text: false
 });
-var maxSizeFile = 2000000;
-$('#fileuploadevent').fileupload({
-    sequentialUploads: true,
-    add: function (e, data) {
-	if(data.files[0].size < maxSizeFile)
-	    data.submit();
-    },
-    change: function (e, data) {
-	$.each(data.files, function (index, file) {
-	    var attach = {};
-	    attach.fileName = file.name;
-	    var ext = file.name.split('.');
-	    if(file.name.length > 10)
-		attach.fileName = ext.length == 1 ? file.name.substr(0, 10) :  file.name.substr(0, 6) + '.' + ext[ext.length -1];
-	    attach.fileSize = formatBytes(file.size);
-	    if(file.size > maxSizeFile)
-		attach.error = 'Tamanho de arquivo nao permitido!!'
-				
-	    $('div.new-event-win .attachments-list').append(DataLayer.render(path+'templates/attachment_add_itemlist.ejs', {
-		file : attach
-	    }));
-				
-	    if(file.size < maxSizeFile){
-		$('div.new-event-win .fileinput-button.new').append(data.fileInput[0]).removeClass('new');
-		$('div.new-event-win .attachments-list').find('[type=file]').addClass('hidden');
-					
-	    }else
-		$('div.new-event-win .fileinput-button.new').removeClass('new');
-				
-				
-	    $('div.new-event-win .attachments-list').find('.button.close').button({
-		icons: {
-		    primary: "ui-icon-close"
-		},
-		text: false
-	    }).click(function(){
-		var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
-		$('div.new-event-win .attachment-list').find('input[value="'+idAttach+'"]')
-		$(this).parent().remove();
-	    });	
-				
-	})
-	},
-    done: function(e, data){
-	var currentUpload = $('div.new-event-win .progress.after-upload:first').removeClass('after-upload').addClass('on-complete').hide();
-
-	if(!!data.result && data.result != "[]"){
-	    var newAttach = (attch = jQuery.parseJSON(data.result)) ? attch : jQuery.parseJSON(data.result[0].activeElement.childNodes[0].data);
-	    $('div.new-event-win .attachment-list').append('<input tyepe="hidden" name="attachment[]" value="'+newAttach['attachment'][0][0].id+'"/>');
-	    currentUpload.removeClass('on-complete').parents('p')
-	    .append('<input type="hidden" name="fileId[]" value="'+newAttach['attachment'][0][0].id+'"/>')
-	    .find('.status-upload').addClass('ui-icon ui-icon-check');
-	}else
-	    currentUpload.removeClass('on-complete').parents('p').find('.status-upload').addClass('ui-icon ui-icon-cancel');
-    }
-});
-$('.attachments-list .button').button();
-
-if(!!window.FormData)			
-$('#fileuploadevent').bind('fileuploadstart', function () {
-    var widget = $(this),
-    progressElement = $('#fileupload-progress-event').fadeIn(),
-    interval = 500,
-    total = 0,
-    loaded = 0,
-    loadedBefore = 0,
-    progressTimer,
-    progressHandler = function (e, data) {
-	loaded = data.loaded;
-	total = data.total;
-    },
-    stopHandler = function () {
-	widget
-	.unbind('fileuploadprogressall', progressHandler)
-	.unbind('fileuploadstop', stopHandler);
-	window.clearInterval(progressTimer);
-	progressElement.fadeOut(function () {
-	    progressElement.html('');
-	});
-    },
-    formatTime = function (seconds) {
-	var date = new Date(seconds * 1000);
-	return ('0' + date.getUTCHours()).slice(-2) + ':' +
-	('0' + date.getUTCMinutes()).slice(-2) + ':' +
-	('0' + date.getUTCSeconds()).slice(-2);
-    },
-    /* formatBytes = function (bytes) {
-            if (bytes >= 1000000000) {
-                return (bytes / 1000000000).toFixed(2) + ' GB';
-            }
-            if (bytes >= 1000000) {
-                return (bytes / 1000000).toFixed(2) + ' MB';
-            }
-            if (bytes >= 1000) {
-                return (bytes / 1000).toFixed(2) + ' KB';
-            }
-            return bytes + ' B';
-        },*/
-    formatPercentage = function (floatValue) {
-	return (floatValue * 100).toFixed(2) + ' %';
-    },
-    updateProgressElement = function (loaded, total, bps) {
-	progressElement.html(
-	    formatBytes(bps) + 'ps | ' +
-	    formatTime((total - loaded) / bps) + ' | ' +
-	    formatPercentage(loaded / total) + ' | ' +
-	    formatBytes(loaded) + ' / ' + formatBytes(total)
-	    );
-    },
-    intervalHandler = function () {
-	var diff = loaded - loadedBefore;
-	if (!diff) {
-	    return;
-	}
-	loadedBefore = loaded;
-	updateProgressElement(
-	    loaded,
-	    total,
-	    diff * (1000 / interval)
-	    );
-    };
-    widget
-    .bind('fileuploadprogressall', progressHandler)
-    .bind('fileuploadstop', stopHandler);
-    progressTimer = window.setInterval(intervalHandler, interval);
-});
+
+extendsFileupload('event', path);
 	
 if(objEvent.isShared){
@@ -2573,8 +2450,8 @@
 	case 'basicDay':
 	case 'agendaDay':
-	    rangeStart = new Date().add({
+	    rangeStart = new Date.today().add({
 		days: page_index
 	    }).getTime();
-	    rangeEnd = rangeStart;
+	    rangeEnd = rangeStart + 86400000;
 	    break;
 	case 'agendaWeek':
@@ -2982,2 +2859,141 @@
     }
 }
+
+function extendsFileupload(view, path){
+    var viewName = 'div.new-'+view+'-win';
+    
+    path = !!path ? path : '';
+    
+    var maxSizeFile = 2000000;
+    $('#fileupload'+view).fileupload({
+	sequentialUploads: true,
+	add: function (e, data) {
+	    if(data.files[0].size < maxSizeFile)
+		data.submit();
+	},
+	change: function (e, data) {
+	    $.each(data.files, function (index, file) {
+		var attach = {};
+		attach.fileName = file.name;
+		var ext = file.name.split('.');
+		if(file.name.length > 10)
+		    attach.fileName = ext.length == 1 ? file.name.substr(0, 10) :  file.name.substr(0, 6) + '.' + ext[ext.length -1];
+		attach.fileSize = formatBytes(file.size);
+		if(file.size > maxSizeFile)
+		    attach.error = 'Tamanho de arquivo nao permitido!!'
+				
+		$(viewName+' .attachments-list').append(DataLayer.render(path+'templates/attachment_add_itemlist.ejs', {
+		    file : attach
+		}));
+				
+		if(file.size < maxSizeFile){
+		    $(viewName+' .fileinput-button.new').append(data.fileInput[0]).removeClass('new');
+		    $(viewName+' .attachments-list').find('[type=file]').addClass('hidden');
+					
+		}else
+		    $(viewName+' .fileinput-button.new').removeClass('new');
+				
+				
+		$(viewName+' .attachments-list').find('.button.close').button({
+		    icons: {
+			primary: "ui-icon-close"
+		    },
+		    text: false
+		}).click(function(){
+		    var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
+		    $(viewName+' .attachment-list').find('input[value="'+idAttach+'"]').remove();
+		    $(this).parent().remove();
+		
+		    if(!$(viewName+' .attachment-list input').length)
+			$(viewName+' .btn-danger.delete').addClass('hidden');
+		
+		});	
+				
+	    })
+	},
+	done: function(e, data){
+	    var currentUpload = $(viewName+' .progress.after-upload:first').removeClass('after-upload').addClass('on-complete').hide();
+
+	    if(!!data.result && data.result != "[]"){
+		$(viewName+' .btn-danger.delete').removeClass('hidden');
+		var newAttach = (attch = jQuery.parseJSON(data.result)) ? attch : jQuery.parseJSON(data.result[0].activeElement.childNodes[0].data);
+		$(viewName+' .attachment-list').append('<input tyepe="hidden" name="attachment[]" value="'+newAttach['attachment'][0][0].id+'"/>');
+		currentUpload.removeClass('on-complete').parents('p')
+		.append('<input type="hidden" name="fileId[]" value="'+newAttach['attachment'][0][0].id+'"/>')
+		.find('.status-upload').addClass('ui-icon ui-icon-check');
+	    }else
+		currentUpload.removeClass('on-complete').parents('p').find('.status-upload').addClass('ui-icon ui-icon-cancel');
+	}
+    });
+    $('.attachments-list .button').button();    
+
+    if(!!window.FormData)			
+	$('#fileupload'+view).bind('fileuploadstart', function () {
+	    var widget = $(this),
+	    progressElement = $('#fileupload-progress-'+view).fadeIn(),
+	    interval = 500,
+	    total = 0,
+	    loaded = 0,
+	    loadedBefore = 0,
+	    progressTimer,
+	    progressHandler = function (e, data) {
+		loaded = data.loaded;
+		total = data.total;
+	    },
+	    stopHandler = function () {
+		widget
+		.unbind('fileuploadprogressall', progressHandler)
+		.unbind('fileuploadstop', stopHandler);
+		window.clearInterval(progressTimer);
+		progressElement.fadeOut(function () {
+		    progressElement.html('');
+		});
+	    },
+	    formatTime = function (seconds) {
+		var date = new Date(seconds * 1000);
+		return ('0' + date.getUTCHours()).slice(-2) + ':' +
+		('0' + date.getUTCMinutes()).slice(-2) + ':' +
+		('0' + date.getUTCSeconds()).slice(-2);
+	    },
+	    /* formatBytes = function (bytes) {
+            if (bytes >= 1000000000) {
+                return (bytes / 1000000000).toFixed(2) + ' GB';
+            }
+            if (bytes >= 1000000) {
+                return (bytes / 1000000).toFixed(2) + ' MB';
+            }
+            if (bytes >= 1000) {
+                return (bytes / 1000).toFixed(2) + ' KB';
+            }
+            return bytes + ' B';
+        },*/
+	    formatPercentage = function (floatValue) {
+		return (floatValue * 100).toFixed(2) + ' %';
+	    },
+	    updateProgressElement = function (loaded, total, bps) {
+		progressElement.html(
+		    formatBytes(bps) + 'ps | ' +
+		    formatTime((total - loaded) / bps) + ' | ' +
+		    formatPercentage(loaded / total) + ' | ' +
+		    formatBytes(loaded) + ' / ' + formatBytes(total)
+		    );
+	    },
+	    intervalHandler = function () {
+		var diff = loaded - loadedBefore;
+		if (!diff) {
+		    return;
+		}
+		loadedBefore = loaded;
+		updateProgressElement(
+		    loaded,
+		    total,
+		    diff * (1000 / interval)
+		    );
+	    };
+	    widget
+	    .bind('fileuploadprogressall', progressHandler)
+	    .bind('fileuploadstop', stopHandler);
+	    progressTimer = window.setInterval(intervalHandler, interval);
+	});
+    
+}
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/js/task.helpers.js
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/js/task.helpers.js	(revision 6977)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/js/task.helpers.js	(revision 6981)
@@ -666,6 +666,7 @@
                         });
                     });
-                    $('.attachment-list input').remove();
-                    $('.row.fileupload-buttonbar .attachments-list p').remove();
+                    $('div.new-task-win .attachment-list input').remove();
+                    $('div.new-task-win .row.fileupload-buttonbar .attachments-list p').remove();
+		    $('div.new-task-win .btn-danger.delete').addClass('hidden');
                 }
             }
@@ -685,97 +686,6 @@
         text: false
     });
-    var maxSizeFile = 2000000;
-    $('#fileuploadtask').fileupload({
-        sequentialUploads: true,
-        add: function (e, data) {
-            if (data.files[0].size < maxSizeFile) data.submit();
-        },
-        change: function (e, data) {
-            $.each(data.files, function (index, file) {
-                var attach = {};
-                attach.fileName = file.name;
-                var ext = file.name.split('.');
-                if (file.name.length > 10) attach.fileName = ext.length == 1 ? file.name.substr(0, 10) : file.name.substr(0, 6) + '.' + ext[ext.length - 1];
-                attach.fileSize = formatBytes(file.size);
-                if (file.size > maxSizeFile) attach.error = 'Tamanho de arquivo nao permitido!!'
-
-                $('div.new-task-win .attachments-list').append(DataLayer.render(path + 'templates/attachment_add_itemlist.ejs', {
-                    file: attach
-                }));
-
-                if (file.size < maxSizeFile) {
-                    $('div.new-task-win .fileinput-button.new').append(data.fileInput[0]).removeClass('new');
-                    $('div.new-task-win .attachments-list').find('[type=file]').addClass('hidden');
-
-                } else $('div.new-task-win .fileinput-button.new').removeClass('new');
-
-
-                $('div.new-task-win .attachments-list').find('.button.close').button({
-                    icons: {
-                        primary: "ui-icon-close"
-                    },
-                    text: false
-                }).click(function () {
-                    var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
-                    $('div.new-task-win .attachment-list').find('input[value="' + idAttach + '"]')
-                    $(this).parent().remove();
-                });
-
-            })
-        },
-        done: function (e, data) {
-            var currentUpload = $('div.new-task-win .progress.after-upload:first').removeClass('after-upload').addClass('on-complete').hide();
-
-            if ( !! data.result && data.result != "[]") {
-                var newAttach = (attch = jQuery.parseJSON(data.result)) ? attch : jQuery.parseJSON(data.result[0].activeElement.childNodes[0].data);
-                $('div.new-task-win .attachment-list').append('<input tyepe="hidden" name="attachment[]" value="' + newAttach['attachment'][0][0].id + '"/>');
-                currentUpload.removeClass('on-complete').parents('p').append('<input type="hidden" name="fileId[]" value="' + newAttach['attachment'][0][0].id + '"/>').find('.status-upload').addClass('ui-icon ui-icon-check');
-            } else currentUpload.removeClass('on-complete').parents('p').find('.status-upload').addClass('ui-icon ui-icon-cancel');
-        }
-    });
-    $('div.new-task-win .attachments-list .button').button();
-
-    if ( !! window.FormData) $('#fileuploadtask').bind('fileuploadstart', function () {
-        var widget = $(this),
-            progressElement = $('#fileupload-progress-task').fadeIn(),
-            interval = 500,
-            total = 0,
-            loaded = 0,
-            loadedBefore = 0,
-            progressTimer, progressHandler = function (e, data) {
-                loaded = data.loaded;
-                total = data.total;
-            },
-            stopHandler = function () {
-                widget.unbind('fileuploadprogressall', progressHandler).unbind('fileuploadstop', stopHandler);
-                window.clearInterval(progressTimer);
-                progressElement.fadeOut(function () {
-                    progressElement.html('');
-                });
-            },
-            formatTime = function (seconds) {
-                var date = new Date(seconds * 1000);
-                return ('0' + date.getUTCHours()).slice(-2) + ':' + ('0' + date.getUTCMinutes()).slice(-2) + ':' + ('0' + date.getUTCSeconds()).slice(-2);
-            },
-
-            formatPercentage = function (floatValue) {
-                return (floatValue * 100).toFixed(2) + ' %';
-            },
-            updateProgressElement = function (loaded, total, bps) {
-                progressElement.html(
-                formatBytes(bps) + 'ps | ' + formatTime((total - loaded) / bps) + ' | ' + formatPercentage(loaded / total) + ' | ' + formatBytes(loaded) + ' / ' + formatBytes(total));
-            },
-            intervalHandler = function () {
-                var diff = loaded - loadedBefore;
-                if (!diff) {
-                    return;
-                }
-                loadedBefore = loaded;
-                updateProgressElement(
-                loaded, total, diff * (1000 / interval));
-            };
-        widget.bind('fileuploadprogressall', progressHandler).bind('fileuploadstop', stopHandler);
-        progressTimer = window.setInterval(intervalHandler, interval);
-    });
+
+    extendsFileupload('task', path);
 
     disponibily(objTask, path, attendees, 'task');
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/activity_add.ejs
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/activity_add.ejs	(revision 6974)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/activity_add.ejs	(revision 6981)
@@ -197,5 +197,5 @@
 				<%if(data.activity && data.activity.attachments){
 				for (var i=0; i< data.activity.attachments.length; i++) {%>
-				<input type="hidden" name="fileId[]" value="<%=data.activity.attachments[i].id%>"/>
+				    <input type="hidden" name="fileId[]" value="<%=data.activity.attachments[i].id%>"/>
 				<%}
 				}%>
@@ -216,5 +216,5 @@
 						</span>
 
-						<button type="button" class="button btn-danger delete">
+						<button type="button" class="button btn-danger delete <%= data.activity && data.activity.attachments && data.activity.attachments.length ? '' : 'hidden' %>">
 						    <i class="icon-trash icon-white"></i> Remover Todos
 						</button>
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/task_add.ejs
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/task_add.ejs	(revision 6974)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/task_add.ejs	(revision 6981)
@@ -212,7 +212,7 @@
                     <input type="file" name="files[]" multiple>
                 </span>
-				<button type="button" class="button btn-danger delete">
-					<i class="icon-trash icon-white"></i> Remover Todos
-				</button>
+		<button type="button" class="button btn-danger delete <%= data.task && data.task.attachments && data.task.attachments.length ? '' : 'hidden' %>">
+			<i class="icon-trash icon-white"></i> Remover Todos
+		</button>
             </div>
             <div id="fileupload-progress-task"></div>
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/event_add.ejs
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/event_add.ejs	(revision 6974)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/event_add.ejs	(revision 6981)
@@ -183,5 +183,5 @@
 				<%}%>
 				<%if(data.event.acl.organization || data.event.acl.write){%>
-					<button type="button" class="button btn-danger delete">
+					<button type="button" class="button btn-danger delete <%= data.event && data.event.attachments && data.event.attachments.length ? '' : 'hidden' %>">
 						<i class="icon-trash icon-white"></i> Remover Todos
 					</button>
