Index: /trunk/phpgwapi/inc/class.vfs_sql.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.vfs_sql.inc.php	(revision 1726)
+++ /trunk/phpgwapi/inc/class.vfs_sql.inc.php	(revision 1741)
@@ -1139,8 +1139,12 @@
 				$data = array ();
 			}
-			$path = explode('/',$data['to']);
-			$quota = $this->get_quota(array('string' => '/'.$path[1].'/'.$path[2]));
-			$size = $this->get_size(array('string' => '/'.$path[1].'/'.$path[2], 'relatives' => $data['relatives'][1]));
-			if ($quota > 0 && $size >= $quota * 1024 * 1024)
+			if ($data['relatives'][1] == RELATIVE_NONE)
+				$path = explode(SEP,$data['to']);
+			else
+				$path = explode(SEP,$this->my_home);
+			$quota = $this->get_quota(array('string' => SEP.$path[1].SEP.$path[2]));
+			$size = $this->get_size(array('string' => SEP.$path[1].SEP.$path[2], 'relatives' => $data['relatives'][1]));
+
+			if ($quota > 0 && ($quota * 1024 * 1024) < $size)
 				return false;
 
Index: /sandbox/filemanager/setup/phpgw_pt-br.lang
===================================================================
--- /sandbox/filemanager/setup/phpgw_pt-br.lang	(revision 1737)
+++ /sandbox/filemanager/setup/phpgw_pt-br.lang	(revision 1741)
@@ -32,5 +32,5 @@
 Note: Uploaded is limited to %1MB	filemanager	pt-br	Nota: O tamanho máximo de envio é limitado a %1MB
 This property will change the visibility of all users that have access to this file, continue?	filemanager	pt-br	Esta propriedade altera visibilidade dos usuários que estão compartilhados, deseja continuar?
-no comments	filemanager	pt-br	sem comentários
+Click to change comments	filemanager	pt-br	Clique para alterar comentários
 created %1,%2	filemanager	pt-br	Criado %1, %2
 created by	filemanager	pt-br	Criado por
@@ -150,4 +150,5 @@
 Resume	filemanager	pt-br	Currículo
 Impossible to edit this file	filemanager	pt-br	Impossível editar o arquivo selecionado
+Your quota has exceeded the limit	filemanager	pt-br	Sua cota excedeu o limite
 Enter with the name of new file/directory	filemanager	pt-br	Insira o nome do novo arquivo/diretório
 File extension forbidden or invalid file	filemanager	pt-br	Formato de arquivo inválido
Index: /sandbox/filemanager/inc/upload.php
===================================================================
--- /sandbox/filemanager/inc/upload.php	(revision 1694)
+++ /sandbox/filemanager/inc/upload.php	(revision 1741)
@@ -95,20 +95,23 @@
 			{
 
-				$bo->vfs->cp(array(
+				if ($bo->vfs->cp(array(
 					'from'=> $_FILES['upload_file']['tmp_name'][$i],
 					'to'=> $_FILES['upload_file']['name'][$i],
 					'relatives'	=> array(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL)
-				));
-
-				$bo->vfs->set_attributes(array(
-					'string'=> $_FILES['upload_file']['name'][$i],
-					'relatives'	=> array(RELATIVE_ALL),
-					'attributes'=> array(
+				)))
+					$bo->vfs->set_attributes(array(
+						'string'=> $_FILES['upload_file']['name'][$i],
+						'relatives'	=> array(RELATIVE_ALL),
+						'attributes'=> array(
 						'mime_type' => $_FILES['upload_file']['type'][$i],
 						'comment' => stripslashes($_POST['upload_comment'][$i])
 					)
 				));
+				else{
+					$_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('Your quota has exceeded the limit');
+					return false;
+				}
 
-				 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $_FILES['upload_file']['size'][$i])."\n";
+				 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $bo->borkb($_FILES['upload_file']['size'][$i]))."\n";
 			}
 		}
@@ -129,5 +132,5 @@
 			));
 
-			 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $file_size[$i])."\n";
+			 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $bo->borkb($file_size[$i]))."\n";
 
 		}
Index: /sandbox/filemanager/js/draw_api.js
===================================================================
--- /sandbox/filemanager/js/draw_api.js	(revision 1737)
+++ /sandbox/filemanager/js/draw_api.js	(revision 1741)
@@ -307,7 +307,5 @@
 		if (preferences.createdby_id =='1') newpage += fl.td+files[i].creatdby+'</td>';
 		if (preferences.modifiedby_id =='1') newpage += fl.td+files[i].modifdby+'</td>';
-		if (files[i].comm == null || files[i].comm.length == 0)
-			files[i].comm = "&lt;"+get_lang("no comments")+"&gt;";
-		if (preferences.comment =='1') newpage += fl.td+'<span id="'+files[i].name+'" onclick="setComments(this)">'+files[i].comm+'</span></td>';
+		if (preferences.comment =='1') newpage += fl.td+'<input id="'+files[i].name+'" class="inputComment" onblur="setComments(this)" value="'+files[i].comm+'" alt="'+get_lang('Click to change comments')+'" title="'+get_lang('Click to change comments')+'"></input></td>';
 		if (preferences.version =='1') newpage += fl.td+'<span onclick="loadHistory(\''+files[i].name+'\')">'+files[i].vers+'</span></td></tr>';
 	}
Index: /sandbox/filemanager/js/common_functions.js
===================================================================
--- /sandbox/filemanager/js/common_functions.js	(revision 1731)
+++ /sandbox/filemanager/js/common_functions.js	(revision 1741)
@@ -147,20 +147,6 @@
 
 function setComments(el){
-	if (el.innerHTML == "&lt;"+get_lang('no comments')+"&gt;")
-		var comment = "";
-	else
-		var comment = el.innerHTML;
 	var filename = base64_encode(el.id);
-	input_el = document.createElement('INPUT');
-	input_el.id = "inputTemp"+el.id;
-	if (comment.length > 0)
-		input_el.size = comment.length;
-	input_el.maxlength = "255";
-	input_el.value = comment;
-	el.parentNode.appendChild(input_el);
-        el.parentNode.removeChild(el);
-	input_el.focus();
-	input_el.onblur = function () { cExecute('/index.php?menuaction=filemanager.vfs_functions.editComment&file='+
-			filename+'&comment='+base64_encode(this.value),updateComment); };
+	cExecute('/index.php?menuaction=filemanager.vfs_functions.editComment&file='+filename+'&comment='+base64_encode(el.value),updateComment);
 }
 
@@ -168,11 +154,4 @@
 	var returnVal = data.split(':');
 	if (data.indexOf("True") == 0){
-		var input_el = document.getElementById("inputTemp"+returnVal[1]);
-		span_comment = document.createElement('span');
-		span_comment.innerHTML = input_el.value;
-		span_comment.id=returnVal[1];
-		span_comment.onclick=function () { setComments(span_comment) };
-		input_el.parentNode.appendChild(span_comment);
-		input_el.parentNode.removeChild(input_el);
 		write_msg(get_lang('Updated comment for %1',returnVal[1]));
 	}
Index: /sandbox/filemanager/templates/default/main.css
===================================================================
--- /sandbox/filemanager/templates/default/main.css	(revision 1733)
+++ /sandbox/filemanager/templates/default/main.css	(revision 1741)
@@ -118,2 +118,7 @@
 }
 
+.inputComment {
+	border: 0px !important;
+	color: #3f3f3f !important;
+	background: transparent !important;
+}
