From b49a1168e3f9738cdcbfc0c57ceaadb0c3482070 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Jun 2013 18:33:03 +0200 Subject: [PATCH] Fix: Use div for tables when there is a different form on each line. --- htdocs/compta/bank/account.php | 50 ++++++----- htdocs/core/class/html.form.class.php | 10 ++- htdocs/core/tpl/contacts.tpl.php | 122 +++++++++++++------------- 3 files changed, 92 insertions(+), 90 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 97ed49f5f36..80b71d1d919 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -64,8 +64,8 @@ $page=GETPOST('page','int'); $negpage=GETPOST('negpage','int'); if ($negpage) { - $page=$_GET["nbpage"] - $negpage; - if ($page > $_GET["nbpage"]) $page = $_GET["nbpage"]; + $page=GETPOST("nbpage") - $negpage; + if ($page > GETPOST("nbpage")) $page = GETPOST("nbpage"); } $mesg=''; @@ -269,6 +269,7 @@ if ($id > 0 || ! empty($ref)) $head=bank_prepare_head($object); dol_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0,'account'); + print ''; $linkback = ''.$langs->trans("BackToList").''; @@ -292,28 +293,32 @@ if ($id > 0 || ! empty($ref)) /** * Search form */ - $param.='&account='.$object->id; + $param.='&account='.$object->id.'&vline='.$vline; // Define transaction list navigation string - $navig = '
'; - //print 'nbpage='.$totalPages.' viewline='.$viewline.' limitsql='.$limitsql; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + $navig ='
'; if ($limitsql > $viewline) $navig.=''.img_previous().''; $navig.= ' "; // ' Page '; $navig.=''; - $navig.=''; - $navig.=''; - $navig.=''; - $navig.=''; - $navig.=''; - $navig.=''; - $navig.=''; - $navig.=''; $navig.='/'.$totalPages.' '; if ($total_lines > $limitsql ) { $navig.= ''.img_next().''; } - $navig.='
'; + $navig.='
'; //var_dump($navig); // Confirmation delete @@ -335,12 +340,6 @@ if ($id > 0 || ! empty($ref)) // Form to add a transaction with no invoice if ($user->rights->banque->modifier && $action == 'addline') { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; print ''; print ''; @@ -423,7 +422,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print "\n"; - print "\n"; + /* * Another solution @@ -763,7 +762,10 @@ if ($id > 0 || ! empty($ref)) print "
'.$langs->trans("AddBankRecordLong").'
 
"; - print "\n\n"; + print "\n"; + + dol_fiche_end(); + /* * Boutons actions @@ -777,7 +779,7 @@ if ($id > 0 || ! empty($ref)) { if ($user->rights->banque->consolidate) { - print ''.$langs->trans("Conciliate").''; + print ''.$langs->trans("Conciliate").''; } else { @@ -789,7 +791,7 @@ if ($id > 0 || ! empty($ref)) { if ($user->rights->banque->modifier) { - print 'id.'&page='.$page.'">'.$langs->trans("AddBankRecord").''; + print 'id.'&page='.$page.($vline?'&vline='.$vline:'').'">'.$langs->trans("AddBankRecord").''; } else { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4e1ca4e3bbb..0d0a1857427 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1076,11 +1076,12 @@ class Form * @param array $exclude Array list of users id to exclude * @param int $disabled If select list must be disabled * @param array $include Array list of users id to include - * @param int $enableonly Array list of users id to be enabled. All other must be disabled + * @param array $enableonly Array list of users id to be enabled. All other must be disabled * @param int $force_entity 0 or Id of environment to force + * @param int $maxlength Maximum length of string into list (0=no limit) * @return string HTML select string */ - function select_dolusers($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=0) + function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0) { global $conf,$user,$langs; @@ -1161,7 +1162,8 @@ class Form if ($disableline) $out.= ' disabled="disabled"'; $out.= '>'; } - $out.= $userstatic->getFullName($langs); + + $out.= $userstatic->getFullName($langs, 0, 0, $maxlength); if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) { @@ -2685,7 +2687,7 @@ class Form require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; - + $formproject=new FormProjets($this->db); $langs->load("project"); diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 33a488f5807..bbef5b5169e 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -13,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ if (! class_exists('Contact')) { @@ -40,83 +40,81 @@ $userstatic=new User($db); ?> - +
-
- - - - - - + +
trans("Source"); ?>
+
trans("Company"); ?>
+
trans("Contacts"); ?>
+
trans("ContactType"); ?>
+
 
+
 
+ - " /> - - > - - - - - - +
trans("Users"); ?>
+
global->MAIN_INFO_SOCIETE_NOM; ?>
+
select_dolusers($user->id, 'userid', 0, (! empty($userAlreadySelected)?$userAlreadySelected:null), 0, null, null, 0, 56); ?>
+
selectTypeContact($object, '', 'type','internal'); ?>
+
 
+
">
- " /> - - - - - > - + action="id; ?>" method="POST"> + + + + +
trans("ThirdPartyContacts"); ?>
use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { ?> - - + - - + - - - + - - - - - - - - + +
trans("Source"); ?>
+
trans("Company"); ?>
+
trans("Contacts"); ?>
+
trans("ContactType"); ?>
+
trans("Status"); ?>
+
 
+ @@ -130,12 +128,12 @@ $userstatic=new User($db); $var = !$var; ?> - valign="top"> - - - - - - - + + -
trans("Source"); ?>trans("Company"); ?>trans("Contacts"); ?>trans("ContactType"); ?> 
trans("Users"); ?>global->MAIN_INFO_SOCIETE_NOM; ?>select_users($user->id,'userid',0,(! empty($userAlreadySelected)?$userAlreadySelected:'')); ?>selectTypeContact($object, '', 'type','internal'); ?>">
trans("ThirdPartyContacts"); ?> +
'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); print $form->select_company($object->socid,'socid','',1,0,0,$events); ?> -
+ +
select_contacts($object->socid, '', 'contactid'); ?> -
+
socid; ?> selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany'); ?> -
+ +
select_contacts($selectedCompany, '', 'contactid'); ?> -
+
selectTypeContact($object, '', 'type','external'); ?> -
+ +
 
+
"> -
trans("Source"); ?>trans("Company"); ?>trans("Contacts"); ?>trans("ContactType"); ?>trans("Status"); ?> 
+
> +
trans("User"); ?> trans("ThirdPartyContact"); ?> -
+ +
0) { @@ -151,8 +149,8 @@ $userstatic=new User($db); echo ' '; } ?> -
+ +
getNomUrl(1); } ?> -
+ +
+
+ +
 "> -
+ \ No newline at end of file