diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 245903101cf..ff6fe4e109c 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2010-2018 Juanjo Menent * * 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 @@ -101,7 +101,7 @@ if ($socid) $sql.= " AND s.rowid = ".$socid; if ($search_line) $sql.= " AND pl.rowid = '".$db->escape($search_line)."'"; if ($search_bon) $sql.= natural_search("p.ref", $search_bon); if ($search_code) $sql.= natural_search("s.code_client", $search_code); -if ($search_company) natural_search("s.nom", $search_company); +if ($search_company) $sql.= natural_search("s.nom", $search_company); $sql.= $db->order($sortfield,$sortorder); @@ -123,13 +123,14 @@ if ($result) $urladd = "&statut=".$statut; $urladd .= "&search_bon=".$search_bon; - - print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit); + if ($limit > 0 && $limit != $conf->liste_limit) $urladd.='&limit='.urlencode($limit); print"\n\n"; print '
'; - $moreforfilter=''; + print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit); + + $moreforfilter=''; print '
'; print ''."\n"; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index e858eaf9a6e..0d8f256e15e 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -647,14 +647,17 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); $error++; } + // Prevent thirdparty's emptying if a user hasn't rights $user->rights->categorie->lire (in such a case, post of 'custcats' is not defined) + if (!empty($user->rights->categorie->lire)) + { + // Customer categories association + $categories = GETPOST( 'custcats', 'array' ); + $object->setCategories($categories, 'customer'); - // Customer categories association - $categories = GETPOST('custcats', 'array'); - $object->setCategories($categories, 'customer'); - - // Supplier categories association - $categories = GETPOST('suppcats', 'array'); - $object->setCategories($categories, 'supplier'); + // Supplier categories association + $categories = GETPOST('suppcats', 'array'); + $object->setCategories($categories, 'supplier'); + } // Logo/Photo save $dir = $conf->societe->multidir_output[$object->entity]."/".$object->id."/logos";