From 2122d4d43a71fe33afa9f8d2ce84107330e75173 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 17 Oct 2015 00:52:35 +0200 Subject: [PATCH] NEW Contract module can be used to follow both sold and bought contracts/recurring subscriptions. --- htdocs/comm/propal/list.php | 7 ++- htdocs/commande/list.php | 29 +++++++++++-- htdocs/contrat/card.php | 59 ++++++++++++++++++++++---- htdocs/contrat/class/contrat.class.php | 18 ++++++-- htdocs/contrat/list.php | 44 +++++++++++++++---- htdocs/fichinter/list.php | 32 +++++++++++--- htdocs/fourn/commande/list.php | 26 +++++++++++- htdocs/product/list.php | 4 +- 8 files changed, 184 insertions(+), 35 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 690f788b88d..c623069cd85 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -111,6 +111,7 @@ $hookmanager->initHooks(array('propallist')); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( 'p.ref'=>'Ref', + 'p.ref_client'=>'CustomerRef', 'pd.description'=>'Description', 's.nom'=>"ThirdParty", 'p.note_public'=>'NotePublic', @@ -270,7 +271,11 @@ if ($result) // Lignes des champs de filtre print '
'; - if ($optioncss != '') print ''; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; if ($sall) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 19fd113138a..46ee8687fbb 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -76,7 +76,7 @@ $limit = $conf->liste_limit; $viewstatut=GETPOST('viewstatut'); // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { $search_categ=''; $search_user=''; @@ -95,6 +95,17 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('orderlist')); +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'c.ref'=>'Ref', + 'c.ref_client'=>'RefCustomerOrder', + 'pd.description'=>'Description', + 's.nom'=>"ThirdParty", + 'c.note_public'=>'NotePublic', +); +if (empty($user->socid)) $fieldstosearchall["c.note_private"]="NotePrivate"; + + /* * Actions */ @@ -139,7 +150,7 @@ if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_produc if ($socid > 0) $sql.= ' AND s.rowid = '.$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($search_ref) $sql .= natural_search('c.ref', $search_ref); -if ($sall) $sql .= natural_search(array('c.ref', 'c.note_private'), $sall); +if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); if ($viewstatut <> '') { if ($viewstatut < 4 && $viewstatut > -3) @@ -259,9 +270,19 @@ if ($resql) // Lignes des champs de filtre print ''; - if ($optioncss != '') print ''; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; print ''; + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + $moreforfilter=''; // If the user can view prospects other than his' @@ -305,7 +326,7 @@ if ($resql) print ''; print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'c.ref','',$param,'width="25%"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('RefCustomerOrder'),$_SERVER["PHP_SELF"],'c.ref_client','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="center"',$sortfield,$sortorder); if (empty($conf->global->ORDER_DISABLE_DELIVERY_DATE)) print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index f7363984fb8..69a7aba771c 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -237,6 +237,7 @@ if (empty($reshook)) $object->fk_project = GETPOST('projectid','int'); $object->remise_percent = GETPOST('remise_percent','alpha'); $object->ref = GETPOST('ref','alpha'); + $object->ref_customer = GETPOST('ref_customer','alpha'); $object->ref_supplier = GETPOST('ref_supplier','alpha'); // If creation from another object of another module (Example: origin=propal, originid=1) @@ -747,7 +748,9 @@ if (empty($reshook)) { setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefNewContract")),'errors'); } - } else if ($action == 'update_extras') { + } + else if ($action == 'update_extras') + { // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); @@ -767,9 +770,10 @@ if (empty($reshook)) $action = 'edit_extras'; setEventMessage($object->error,'errors'); } - } elseif ($action=='setref_supplier') { + } + elseif ($action=='setref_supplier') + { $cancelbutton = GETPOST('cancel'); - if (!$cancelbutton) { $result = $object->fetch($id); @@ -790,7 +794,34 @@ if (empty($reshook)) header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); exit; } - } elseif ($action=='setref') { + } + elseif ($action=='setref_customer') + { + $cancelbutton = GETPOST('cancel'); + + if (!$cancelbutton) + { + $result = $object->fetch($id); + if ($result < 0) { + setEventMessage($object->errors, 'errors'); + } + + $result = $object->setValueFrom('ref_customer',GETPOST('ref_customer','alpha')); + if ($result < 0) { + setEventMessage($object->errors, 'errors'); + $action = 'editref_customer'; + } else { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + } + else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); + exit; + } + } + elseif ($action=='setref') + { $cancelbutton = GETPOST('cancel'); if (!$cancelbutton) { @@ -1001,14 +1032,18 @@ if ($action == 'create') } print ''.$langs->trans('Ref').''.$tmpcode.''; + // Ref customer + print ''.$langs->trans('RefCustomer').''; + print ''; + // Ref supplier print ''.$langs->trans('RefSupplier').''; print ''; - // Customer + // Thirdparty print ''; - print ''.$langs->trans('Customer').''; - if($socid>0) + print ''.$langs->trans('Thirdparty').''; + if ($socid>0) { print ''; print $soc->getNomUrl(1); @@ -1018,7 +1053,7 @@ if ($action == 'create') else { print ''; - print $form->select_company('','socid','s.client = 1 OR s.client = 3',1); + print $form->select_company('','socid','',1); print ''; } print ''."\n"; @@ -1206,6 +1241,14 @@ else } print ''; + print ''; + print $form->editfieldkey("RefCustomer",'ref_customer',$object->ref_customer,$object,$user->rights->contrat->creer); + print ''; + print $form->editfieldval("RefCustomer",'ref_customer',$object->ref_customer,$object,$user->rights->contrat->creer); + print ''; + print ''; + + print ''; print ''; print $form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer); print ''; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 3b6b6bdac2e..1d2bd9f4181 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -50,6 +50,12 @@ class Contrat extends CommonObject */ protected $table_ref_field = 'ref'; + /** + * Customer reference of the contract + * @var string + */ + var $ref_customer; + /** * Supplier reference of the contract * @var string @@ -476,13 +482,13 @@ class Contrat extends CommonObject function fetch($id,$ref='') { $sql = "SELECT rowid, statut, ref, fk_soc, mise_en_service as datemise,"; + $sql.= " ref_supplier, ref_customer,"; + $sql.= " ref_ext,"; $sql.= " fk_user_mise_en_service, date_contrat as datecontrat,"; $sql.= " fk_user_author,"; $sql.= " fk_projet,"; $sql.= " fk_commercial_signature, fk_commercial_suivi,"; $sql.= " note_private, note_public, model_pdf, extraparams"; - $sql.= " ,ref_supplier"; - $sql.= " ,ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX."contrat"; if ($ref) { @@ -501,6 +507,7 @@ class Contrat extends CommonObject { $this->id = $result["rowid"]; $this->ref = (!isset($result["ref"]) || !$result["ref"]) ? $result["rowid"] : $result["ref"]; + $this->ref_customer = $result["ref_customer"]; $this->ref_supplier = $result["ref_supplier"]; $this->ref_ext = $result["ref_ext"]; $this->statut = $result["statut"]; @@ -839,7 +846,7 @@ class Contrat extends CommonObject // Insert contract $sql = "INSERT INTO ".MAIN_DB_PREFIX."contrat (datec, fk_soc, fk_user_author, date_contrat,"; $sql.= " fk_commercial_signature, fk_commercial_suivi, fk_projet,"; - $sql.= " ref, entity, note_private, note_public, ref_supplier, ref_ext)"; + $sql.= " ref, entity, note_private, note_public, ref_customer, ref_supplier, ref_ext)"; $sql.= " VALUES ('".$this->db->idate($now)."',".$this->socid.",".$user->id; $sql.= ", '".$this->db->idate($this->date_contrat)."'"; $sql.= ",".($this->commercial_signature_id>0?$this->commercial_signature_id:"NULL"); @@ -849,6 +856,7 @@ class Contrat extends CommonObject $sql.= ", ".$conf->entity; $sql.= ", ".(!empty($this->note_private)?("'".$this->db->escape($this->note_private)."'"):"NULL"); $sql.= ", ".(!empty($this->note_public)?("'".$this->db->escape($this->note_public)."'"):"NULL"); + $sql.= ", ".(!empty($this->ref_customer)?("'".$this->db->escape($this->ref_customer)."'"):"NULL"); $sql.= ", ".(!empty($this->ref_supplier)?("'".$this->db->escape($this->ref_supplier)."'"):"NULL"); $sql.= ", ".(!empty($this->ref_ext)?("'".$this->db->escape($this->ref_ext)."'"):"NULL"); $sql.= ")"; @@ -1101,6 +1109,7 @@ class Contrat extends CommonObject // Clean parameters if (isset($this->ref)) $this->ref=trim($this->ref); + if (isset($this->ref_customer)) $this->ref_customer=trim($this->ref_customer); if (isset($this->ref_supplier)) $this->ref_supplier=trim($this->ref_supplier); if (isset($this->ref_ext)) $this->ref_ext=trim($this->ref_ext); if (isset($this->entity)) $this->entity=trim($this->entity); @@ -1125,6 +1134,7 @@ class Contrat extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET"; $sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").","; + $sql.= " ref_customer=".(isset($this->ref_customer)?"'".$this->db->escape($this->ref_customer)."'":"null").","; $sql.= " ref_supplier=".(isset($this->ref_supplier)?"'".$this->db->escape($this->ref_supplier)."'":"null").","; $sql.= " ref_ext=".(isset($this->ref_ext)?"'".$this->db->escape($this->ref_ext)."'":"null").","; $sql.= " entity=".$conf->entity.","; @@ -2024,6 +2034,8 @@ class Contrat extends CommonObject $this->specimen=1; $this->ref = 'SPECIMEN'; + $this->ref_customer = 'SPECIMENCUST'; + $this->ref_supplier = 'SPECIMENSUPP'; $this->socid = 1; $this->statut= 0; $this->date_contrat = dol_now(); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 9619713859a..07d3aa9e1c5 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -1,11 +1,11 @@ - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Claudio Aschieri - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Claudio Aschieri + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -80,6 +80,17 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both if ($search_status == '') $search_status=1; +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'c.ref'=>'Ref', + 'c.ref_customer'=>'RefCustomer', + 'c.ref_supplier'=>'RefSupplier', + 's.nom'=>"ThirdParty", + 'cd.description'=>'Description', + 'c.note_public'=>'NotePublic', +); +if (empty($user->socid)) $fieldstosearchall["c.note_private"]="NotePrivate"; + /* * View @@ -93,7 +104,7 @@ $socstatic = new Societe($db); llxHeader(); $sql = 'SELECT'; -$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier,"; +$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier,"; $sql.= " s.nom as name, s.rowid as socid,"; $sql.= ' SUM('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')",1,0).') as nb_running,'; @@ -132,7 +143,7 @@ if ($search_sale > 0) } if ($sall) { - $sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall); + $sql .= natural_search(array_keys($fieldstosearchall), $sall); } if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user; $sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier, s.nom, s.rowid"; @@ -149,7 +160,17 @@ if ($resql) print ''; if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + // If the user can view prospects other than his' $moreforfilter=''; if ($user->rights->societe->client->voir || $socid) @@ -199,8 +220,9 @@ if ($resql) if ($optioncss != '') $param.='&optioncss='.$optioncss; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_customer","","$param",'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefSupplier"), $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ThirdParty"), $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("SalesRepresentative"), $_SERVER["PHP_SELF"], "","","$param",'',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("DateCreation"), $_SERVER["PHP_SELF"], "c.datec","","$param",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateContract"), $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder); @@ -218,10 +240,13 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ' '; //print ' '; @@ -240,6 +265,7 @@ if ($resql) print img_object($langs->trans("ShowContract"),"contract").' '.(isset($obj->ref) ? $obj->ref : $obj->cid) .''; if ($obj->nb_late) print img_warning($langs->trans("Late")); print ''; + print ''.$obj->ref_customer.''; print ''.$obj->ref_supplier.''; print ''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.''; //print ''.dol_print_date($obj->datec).''; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 74051b5bc70..896d8c6a4fa 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -64,7 +64,7 @@ $search_status=GETPOST('search_status'); $sall=GETPOST('sall'); $optioncss = GETPOST('optioncss','alpha'); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { $search_ref=""; $search_company=""; @@ -72,6 +72,17 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_status=""; } +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'f.ref'=>'Ref', + 's.nom'=>"ThirdParty", + 'f.description'=>'Description', + 'f.note_public'=>'NotePublic', +); +if (empty($user->socid)) $fieldstosearchall["f.note_private"]="NotePrivate"; +if (! empty($conf->global->FICHINTER_DISABLE_DETAILS)) unset($fieldstosearchall['f.description']); + + /* * View */ @@ -110,9 +121,7 @@ if (! $user->rights->societe->client->voir && empty($socid)) if ($socid) $sql.= " AND s.rowid = " . $socid; if ($sall) { - $arraytosearch=array('f.ref', 'f.description', 's.nom'); - if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $arraytosearch=array('f.ref', 'f.description', 's.nom', 'fd.description'); - $sql .= natural_search($arraytosearch, $sall); + $sql .= natural_search(array_keys($fieldstosearchall), $sall); } $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); @@ -135,11 +144,22 @@ if ($result) print ''."\n"; if ($optioncss != '') print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + + print '
'; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.ref","",$urlparam,'width="15%"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$urlparam,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$urlparam,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Description"),$_SERVER["PHP_SELF"],"f.description","",$urlparam,'',$sortfield,$sortorder); if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 5b37229024c..768854063dd 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -74,6 +74,17 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both if ($search_status == '') $search_status=-1; +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'cf.ref'=>'Ref', + 'cf.ref_supplier'=>'RefSupplier', + //'pd.description'=>'Description', + 's.nom'=>"ThirdParty", + 'cf.note_public'=>'NotePublic', +); +if (empty($user->socid)) $fieldstosearchall["cf.note_private"]="NotePrivate"; + + /* * View @@ -141,7 +152,7 @@ if ($search_ttc != '') } if ($sall) { - $sql .= natural_search(array('cf.ref', 'cf.ref_supplier', 'cf.note_public', 'cf.note_private'), $sall); + $sql .= natural_search(array_keys($fieldstosearchall), $sall); } if ($socid) $sql.= " AND s.rowid = ".$socid; @@ -190,6 +201,19 @@ if ($resql) print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords); print ''; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall)); + } + print '
'; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref","",$param,'',$sortfield,$sortorder); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 3803ff757b5..ac411cce8d5 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -150,8 +150,6 @@ else { $texte = $langs->trans("ProductsAndServices"); } - // Add what we are searching for - if (! empty($sall)) $texte.= " - ".$sall; $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,'; $sql.= ' p.fk_product_type, p.tms as datem,'; @@ -238,7 +236,7 @@ else $param.=isset($type)?"&type=".$type:""; if ($optioncss != '') $param.='&optioncss='.$optioncss; - print_barre_liste($texte, $page, "list.php", $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords,'title_products.png'); + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords,'title_products.png'); if (! empty($catid)) {