Added enhanced patch of sladame
This commit is contained in:
parent
d081d3a976
commit
0891275893
@ -78,7 +78,7 @@ if (! $sortfield) $sortfield="s.nom";
|
|||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = 0;
|
$nbtotalofrecords = 0;
|
||||||
if (empty($conf->global->DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
$nbtotalofrecords = $db->num_rows($result);
|
$nbtotalofrecords = $db->num_rows($result);
|
||||||
|
|||||||
@ -104,7 +104,7 @@ if ($socname)
|
|||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = 0;
|
$nbtotalofrecords = 0;
|
||||||
if (empty($conf->global->DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
$nbtotalofrecords = $db->num_rows($result);
|
$nbtotalofrecords = $db->num_rows($result);
|
||||||
|
|||||||
@ -93,7 +93,7 @@ if ($search_ville)
|
|||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = 0;
|
$nbtotalofrecords = 0;
|
||||||
if (empty($conf->global->DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
$nbtotalofrecords = $db->num_rows($result);
|
$nbtotalofrecords = $db->num_rows($result);
|
||||||
|
|||||||
@ -1734,24 +1734,35 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
|||||||
print '<div class="titre">'.$titre.'</div>';
|
print '<div class="titre">'.$titre.'</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
$maxnbofpage=10;
|
||||||
|
|
||||||
$nbpages=ceil($totalnboflines/$conf->liste_limit);
|
$nbpages=ceil($totalnboflines/$conf->liste_limit);
|
||||||
$cpt=($page-10);
|
$cpt=($page-$maxnbofpage);
|
||||||
if ($cpt<0) { $cpt=0; }
|
if ($cpt < 0) { $cpt=0; }
|
||||||
$pagelist.=$langs->trans('Page');
|
$pagelist.=$langs->trans('Page');
|
||||||
if ($cpt>=1) { $pagelist.=' <a href="'.$file.'?page=0'.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">1 ... </a>';}
|
if ($cpt>=1)
|
||||||
|
{
|
||||||
|
$pagelist.=' <a href="'.$file.'?page=0'.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">1</a>';
|
||||||
|
if ($cpt >= 2) $pagelist.=' ...';
|
||||||
|
}
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if($cpt==$page)
|
if($cpt==$page)
|
||||||
{
|
{
|
||||||
$pagelist.= " <u>".($page+1).'</u>';
|
$pagelist.= ' <u>'.($page+1).'</u>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$pagelist.= ' <a href="'.$file.'?page='.$cpt.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.($cpt+1).'</a>';
|
$pagelist.= ' <a href="'.$file.'?page='.$cpt.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.($cpt+1).'</a>';
|
||||||
}
|
}
|
||||||
$cpt++;
|
$cpt++;
|
||||||
} while ($cpt < $nbpages && $cpt<=$page+10);
|
}
|
||||||
if ($cpt<$nbpages) { $pagelist.= ' <a href="'.$file.'?page='.($nbpages-1).$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'"> ... '.$nbpages.'</a>'; }
|
while ($cpt < $nbpages && $cpt<=$page+$maxnbofpage);
|
||||||
|
if ($cpt<$nbpages)
|
||||||
|
{
|
||||||
|
if ($cpt<$nbpages-1) $pagelist.= ' ...';
|
||||||
|
$pagelist.= ' <a href="'.$file.'?page='.($nbpages-1).$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.$nbpages.'</a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -179,6 +179,14 @@ if ($_POST["search_siren"])
|
|||||||
$sql .= " AND s.siren LIKE '%".$_POST["search_siren"]."%'";
|
$sql .= " AND s.siren LIKE '%".$_POST["search_siren"]."%'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Count total nb of records
|
||||||
|
$nbtotalofrecords = 0;
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
|
{
|
||||||
|
$result = $db->query($sql);
|
||||||
|
$nbtotalofrecords = $db->num_rows($result);
|
||||||
|
}
|
||||||
|
|
||||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
|
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -189,7 +197,7 @@ if ($result)
|
|||||||
|
|
||||||
$params = "&socname=$socname";
|
$params = "&socname=$socname";
|
||||||
|
|
||||||
print_barre_liste($title, $page, "societe.php",$params,$sortfield,$sortorder,'',$num);
|
print_barre_liste($title, $page, "societe.php",$params,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||||
|
|
||||||
// Lignes des titres
|
// Lignes des titres
|
||||||
print '<table class="liste" width="100%">';
|
print '<table class="liste" width="100%">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user