浏览代码

Debug v18 - drag drop bank

Laurent Destailleur 2 年之前
父节点
当前提交
0a8e7e3208

+ 4 - 3
htdocs/compta/bank/card.php

@@ -389,7 +389,7 @@ if ($action == 'create') {
 
 	// Ref
 	print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
-	print '<td><input size="8" type="text" class="flat" name="ref" value="'.dol_escape_htmltag(GETPOSTISSET('ref') ? GETPOST("ref", 'alpha') : $object->ref).'" maxlength="12" autofocus></td></tr>';
+	print '<td><input type="text" class="flat width100" name="ref" value="'.dol_escape_htmltag(GETPOSTISSET('ref') ? GETPOST("ref", 'alpha') : $object->ref).'" maxlength="12" autofocus></td></tr>';
 
 	// Label
 	print '<tr><td class="fieldrequired">'.$langs->trans("LabelBankCashAccount").'</td>';
@@ -643,7 +643,8 @@ if ($action == 'create') {
 	if ((GETPOST("id", 'int') || GETPOST("ref")) && $action != 'edit') {
 		// Show tabs
 		$head = bank_prepare_head($object);
-		print dol_get_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"), -1, 'account');
+
+		print dol_get_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"), -1, 'account', 0, '', '', 0, '', 1);
 
 		$formconfirm = '';
 
@@ -665,7 +666,7 @@ if ($action == 'create') {
 		print '<div class="fichehalfleft">';
 		print '<div class="underbanner clearboth"></div>';
 
-		print '<table class="border tableforfield" width="100%">';
+		print '<table class="border centpercent tableforfield">';
 
 		// Type
 		print '<tr><td class="titlefield">'.$langs->trans("AccountType").'</td>';

+ 3 - 3
htdocs/compta/sociales/card.php

@@ -348,7 +348,7 @@ if ($action == 'create') {
 
 	print dol_get_fiche_head();
 
-	print '<table class="border centpercent">';
+	print '<table class="border centpercent tableforfieldcreate">';
 
 	// Label
 	print "<tr>";
@@ -573,7 +573,7 @@ if ($id > 0) {
 		print '<div class="fichehalfleft">';
 		print '<div class="underbanner clearboth"></div>';
 
-		print '<table class="border centpercent">';
+		print '<table class="border centpercent tableforfield">';
 
 		// Type
 		print '<tr><td class="titlefield">';
@@ -628,7 +628,7 @@ if ($id > 0) {
 		// Bank account
 		if (isModEnabled("banque")) {
 			print '<tr><td class="nowrap">';
-			print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
+			print '<table class="centpercent nobordernopadding"><tr><td class="nowrap">';
 			print $langs->trans('DefaultBankAccount');
 			print '<td>';
 			if ($action != 'editbankaccount' && $user->rights->tax->charges->creer) {

+ 1 - 0
htdocs/core/ajax/fileupload.php

@@ -48,6 +48,7 @@ $object = fetchObjectByElement($id, $element);
 
 $module = $object->module;
 $element = $object->element;
+
 $usesublevelpermission = ($module != $element ? $element : '');
 if ($usesublevelpermission && !isset($user->rights->$module->$element)) {	// There is no permission on object defined, we will check permission on module directly
 	$usesublevelpermission = '';

+ 1 - 1
htdocs/core/class/fileupload.class.php

@@ -59,7 +59,7 @@ class FileUpload
 		$filename = $element_prop['classfile'];
 		$dir_output = $element_prop['dir_output'];
 
-		//print 'fileupload.class.php: element='.$element.' pathname='.$pathname.' filename='.$filename.' dir_output='.$dir_output;
+		//print 'fileupload.class.php: element='.$element.' pathname='.$pathname.' filename='.$filename.' dir_output='.$dir_output."\n";
 
 		if (empty($dir_output)) {
 			setEventMessage('The element '.$element.' is not supported for uploading file. dir_output is unknow.', 'errors');

+ 3 - 3
htdocs/core/lib/functions.lib.php

@@ -211,7 +211,8 @@ function isModEnabled($module)
 	// Fix special cases
 	$arrayconv = array(
 		'project' => 'projet',
-		'contract' => 'contrat'
+		'contract' => 'contrat',
+		'bank' => 'banque'
 	);
 	if (empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) {
 		$arrayconv['supplier_order'] = 'fournisseur';
@@ -11386,7 +11387,7 @@ function getElementProperties($element_type)
 		$classname = 'AdherentType';
 	} elseif ($element_type == 'bank_account') {
 		$classpath = 'compta/bank/class';
-		$module = 'banque';
+		$module = 'bank';	// We need $conf->bank->dir_output and not $conf->banque->dir_output
 		$classfile = 'account';
 		$classname = 'Account';
 	} elseif ($element_type == 'category') {
@@ -11586,7 +11587,6 @@ function fetchObjectByElement($element_id, $element_type, $element_ref = '')
 	$ret = 0;
 
 	$element_prop = getElementProperties($element_type);
-	//var_dump($element_prop);
 
 	if (is_array($element_prop) && isModEnabled($element_prop['module'])) {
 		dol_include_once('/'.$element_prop['classpath'].'/'.$element_prop['classfile'].'.class.php');

+ 3 - 0
htdocs/core/lib/security.lib.php

@@ -377,6 +377,9 @@ function restrictedArea(User $user, $features, $object = 0, $tableandshare = '',
 		$feature2 = 'myactions|allactions';
 		$dbt_select = 'id';
 	}
+	if ($features == 'bank') {
+		$features = 'banque';
+	}
 	if ($features == 'facturerec') {
 		$features = 'facture';
 	}