Laurent Destailleur 2 سال پیش
والد
کامیت
0a2ae8e8d5
2فایلهای تغییر یافته به همراه4 افزوده شده و 6 حذف شده
  1. 2 4
      htdocs/compta/tva/card.php
  2. 2 2
      htdocs/core/lib/files.lib.php

+ 2 - 4
htdocs/compta/tva/card.php

@@ -80,9 +80,7 @@ if (empty($action) && empty($id) && empty($ref)) {
 }
 
 // Load object
-if ($id > 0 || $ref) {
-	$object->fetch($id, $ref);
-}
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
 
 $permissiontoread = $user->rights->tax->charges->lire;
 $permissiontoadd = $user->rights->tax->charges->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
@@ -93,7 +91,7 @@ $upload_dir = $conf->tax->multidir_output[isset($object->entity) ? $object->enti
 
 // Security check
 $socid = GETPOST('socid', 'int');
-if ($user->socid) {
+if (!empty($user->socid)) {
 	$socid = $user->socid;
 }
 $result = restrictedArea($user, 'tax', $object->id, 'tva', 'charges');

+ 2 - 2
htdocs/core/lib/files.lib.php

@@ -3434,7 +3434,7 @@ function dragAndDropFileUpload($htmlname)
 			$("#'.$htmlname.'").addClass("cssDragDropArea");
 			$(".cssDragDropArea").on("dragenter", function(ev) {
 				// Entering drop area. Highlight area
-				console.log("We add class highlightDragDropArea")
+				console.log("dragAndDropFileUpload: We add class highlightDragDropArea")
 				enterTargetDragDrop = ev.target;
 				$(this).addClass("highlightDragDropArea");
 				$("#'.$htmlname.'Message").removeClass("hidden");
@@ -3444,7 +3444,7 @@ function dragAndDropFileUpload($htmlname)
 			$(".cssDragDropArea").on("dragleave", function(ev) {
 				// Going out of drop area. Remove Highlight
 				if (enterTargetDragDrop == ev.target){
-					console.log("We remove class highlightDragDropArea")
+					console.log("dragAndDropFileUpload: We remove class highlightDragDropArea")
 					$("#'.$htmlname.'Message").addClass("hidden");
 					$(this).removeClass("highlightDragDropArea");
 				}