diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 5a112e60861..ce6df0524c4 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -64,10 +64,10 @@ $id = (GETPOST('orderid')?GETPOST('orderid'):GETPOST('id','int')); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'commande', $id,''); +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; if ($page == -1) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; @@ -90,6 +90,19 @@ $fieldstosearchall = array( ); if (empty($user->socid)) $fieldstosearchall["c.note_private"]="NotePrivate"; +$arrayfields=array( +); +// Extra fields +/* + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + } + } + */ + /* * Actions @@ -257,6 +270,7 @@ if ($resql) $title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); $param=''; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($socid > 0) $param.='&socid='.$socid; if ($viewstatut != '') $param.='&viewstatut='.$viewstatut; if ($ordermonth) $param.='&ordermonth='.$ordermonth; @@ -272,7 +286,6 @@ if ($resql) if ($optioncss != '') $param.='&optioncss='.$optioncss; $num = $db->num_rows($resql); - print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_commercial.png'); // Lignes des champs de filtre print '
'; - - if ($num > $limit) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, ''); - + $db->free($result); } else diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index efa80e70554..d5f7345d7a7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2955,28 +2955,29 @@ function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictois /** * Print a title with navigation controls for pagination * - * @param string $titre Title to show (required) - * @param string $page Numero of page to show in navigation links (required) - * @param string $file Url of page (required) - * @param string $options parametres complementaires lien ('' par defaut) - * @param string $sortfield champ de tri ('' par defaut) - * @param string $sortorder ordre de tri ('' par defaut) - * @param string $center chaine du centre ('' par defaut). We often find here string $massaction comming from $form->selectMassAction() - * @param int $num number of records found by select with limit+1 - * @param int $totalnboflines Total number of records/lines for all pages (if known) - * @param string $picto Icon to use before title (should be a 32x32 transparent png file) - * @param int $pictoisfullpath 1=Icon name is a full absolute url of image - * @param string $morehtml More html to show - * @param string $morecss More css to the table - * @param int $limit Max number of lines (-1 = use default, 0 = no limit, > 0 = limit) + * @param string $titre Title to show (required) + * @param string $page Numero of page to show in navigation links (required) + * @param string $file Url of page (required) + * @param string $options parametres complementaires lien ('' par defaut) + * @param string $sortfield champ de tri ('' par defaut) + * @param string $sortorder ordre de tri ('' par defaut) + * @param string $center chaine du centre ('' par defaut). We often find here string $massaction comming from $form->selectMassAction() + * @param int $num number of records found by select with limit+1 + * @param int $totalnboflines Total number of records/lines for all pages (if known) + * @param string $picto Icon to use before title (should be a 32x32 transparent png file) + * @param int $pictoisfullpath 1=Icon name is a full absolute url of image + * @param string $morehtml More html to show + * @param string $morecss More css to the table + * @param int|string $limit Max number of lines (-1 = use default, 0 = no limit, > 0 = limit). + * @param int $hideselectlimit Force to hide select limit * @return void */ -function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1) +function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0) { global $conf,$langs; $savlimit = $limit; - + if ($picto == 'setup') $picto='title_setup.png'; if (($conf->browser->name == 'ie') && $picto=='title_generic.png') $picto='title.gif'; if ($limit < 0) $limit = $conf->liste_limit; @@ -3057,7 +3058,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so $pagelist.= '