diff --git a/htdocs/categories/categorie.class.php b/htdocs/categories/categorie.class.php index 3cabe51b73739ef7a29ddb9ce05a9223e937dee4..aa3bfc2e921f5794aa11b333da412484409daa2d 100644 --- a/htdocs/categories/categorie.class.php +++ b/htdocs/categories/categorie.class.php @@ -182,7 +182,7 @@ class Categorie // Clean parameters $this->label=trim($this->label); $this->description=trim($this->description); - + if ($this->socid == -1) $this->socid = 0; $this->db->begin(); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 63b78778dd736127326db6b2e38476eac7802d50..7c984c685bb14c6e644299f3243e80df651d278e 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org> * Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> - * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> + * Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr> * * 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 @@ -121,10 +121,23 @@ print $langs->trans("Description").'</td><td>'; print nl2br($c->description); print '</td></tr>'; -print '<tr><td width="20%" class="notopnoleft">'; -print $langs->trans("Status").'</td><td>'; -print ($c->visible ? $langs->trans("Visible") : $langs->trans("Invisible")); -print '</td></tr>'; +if ($type == 0 && $conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER) +{ + $soc = new Societe($db); + $soc->fetch($c->socid); + + print '<tr><td width="20%" class="notopnoleft">'; + print $langs->trans("AssignedToTheCustomer").'</td><td>'; + print $soc->getNomUrl(1); + print '</td></tr>'; +} +else +{ + print '<tr><td width="20%" class="notopnoleft">'; + print $langs->trans("Status").'</td><td>'; + print ($c->visible ? $langs->trans("Visible") : $langs->trans("Invisible")); + print '</td></tr>'; +} print '</table>'; diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index 0c506513b6796671ef6af285d7760c7b414f40b2..52ba35906db7ba10f4de674ed71c2249660bc9a9 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -71,4 +71,5 @@ ProductsCategoriesShort=Products categories ThisCategoryHasNoProduct=This category does not contain any product. ThisCategoryHasNoSupplier=This category does not contain any supplier. ThisCategoryHasNoCustomer=This category does not contain any customer. -AssignedToCustomer=Assigned to a customer \ No newline at end of file +AssignedToCustomer=Assigned to a customer +AssignedToTheCustomer=Assigned to the customer \ No newline at end of file diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 55c280c73672bd46abf09a120a0385fbdabdc413..63962e05d0f2cc8a68aab43bfe013b50172e9e61 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -71,4 +71,5 @@ ProductsCategoriesShort=Cat ThisCategoryHasNoProduct=Cette cat�gorie ne contient aucun produit. ThisCategoryHasNoSupplier=Cette cat�gorie ne contient aucun fournisseur. ThisCategoryHasNoCustomer=Cette cat�gorie ne contient aucun client. -AssignedToCustomer=Attribuer � un client \ No newline at end of file +AssignedToCustomer=Attribuer � un client +AssignedToTheCustomer=Attribu� au client \ No newline at end of file