diff --git a/htdocs/comm/categorie.php b/htdocs/categories/categorie.php similarity index 96% rename from htdocs/comm/categorie.php rename to htdocs/categories/categorie.php index bd363901e9d..47feaeae927 100644 --- a/htdocs/comm/categorie.php +++ b/htdocs/categories/categorie.php @@ -168,7 +168,7 @@ if ($_GET["socid"] || $_GET["ref"]) if ($user->rights->societe->creer) { print '
'; - print '
'; + print ''; print ''; print '
'; print $langs->trans("ClassifyInCategory").' '; @@ -210,7 +210,7 @@ if ($_GET["socid"] || $_GET["ref"]) print ''; if ($user->rights->societe->creer) { - print ""; + print ""; print img_delete($langs->trans("DeleteFromCat")).' '; print $langs->trans("DeleteFromCat").""; } diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index 17fe80b5b80..e59ccfbde03 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -101,18 +101,15 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer) print '
'; print '
'.$langs->trans("CategorySuccessfullyCreated",$categorie->label).'
'; - + print '
'; + if ($idprodorigin) { print ''.$langs->trans("ReturnInProduct").''; } - if ($idSupplierorigin) + if ($idSupplierorigin || $idCompanyorigin) { - print ''.$langs->trans("ReturnInSupplier").''; - } - if ($idCompanyorigin) - { - print ''.$langs->trans("ReturnInCompany").''; + print ''.$langs->trans("ReturnInCompany").''; } print '
'; diff --git a/htdocs/fourn/categorie.php b/htdocs/fourn/categorie.php deleted file mode 100644 index 83eb2bfffba..00000000000 --- a/htdocs/fourn/categorie.php +++ /dev/null @@ -1,242 +0,0 @@ - - * Copyright (C) 2005 Brice Davoleau - * Copyright (C) 2005-2006 Regis Houssin - * Copyright (C) 2006 Laurent Destailleur - * Copyright (C) 2007 Patrick Raguin - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - */ - -/** - \file htdocs/product/categorie.php - \ingroup product - \brief Page de l'onglet categories de produits - \version $Revision$ -*/ - -require("./pre.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.class.php"); -require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); - -$langs->load("categories"); -$langs->load("companies"); - -if (!$user->rights->societe->lire) accessforbidden(); - -$mesg = ''; - - -/* -* Actions -*/ - -//on veut supprimer une catégorie -if ($_REQUEST["removecat"] && $user->rights->societe->creer) -{ - $soc = new Fournisseur($db); - if ($_REQUEST["socid"]) $result = $soc->fetch($_REQUEST["socid"]); - - $cat = new Categorie($db,$_REQUEST["removecat"]); - $result=$cat->del_type($soc,"societe"); -} - -//on veut ajouter une catégorie -if (isset($_REQUEST["catMere"]) && $_REQUEST["catMere"]>=0 && $user->rights->societe->creer) -{ - $soc = new Fournisseur($db); - if ($_REQUEST["socid"]) $result = $soc->fetch($_REQUEST["socid"]); - - $cat = new Categorie($db,$_REQUEST["catMere"]); - $result=$cat->add_type($soc,"societe"); - if ($result >= 0) - { - $mesg='
'.$langs->trans("Added").'
'; - } - else - { - $mesg='
'.$langs->trans("Error").' '.$cat->error.'
'; - } - -} - - - -/* -* Creation de l'objet fournisseur correspondant à l'id -*/ -if ($_GET["socid"] || $_GET["ref"]) -{ - $soc = new Fournisseur($db); - if ($_GET["socid"]) $result = $soc->fetch($_GET["socid"]); - - llxHeader("","",$langs->trans("CardSupplier".$soc->type)); -} - - -$html = new Form($db); - - -/* - * Fiche produit - */ -if ($_GET["socid"] || $_GET["ref"]) -{ - - - - - /* - * Affichage onglets - */ - $head = societe_prepare_head($soc); - - dolibarr_fiche_head($head, 'category', $soc->nom); - - - print ''; - print '
'; - - print ''; - print ''; - - print ''; - - if ($soc->fournisseur) - { - print ''; - } - - print ''; - - print ''; - print ''; - print ''; - print ''; - print '"; - - // Assujeti à TVA ou pas - print ''; - print ''; - print ''; - - print '
'.$langs->trans("Name").''.$soc->nom.'
'.$langs->trans('Prefix').''.$soc->prefix_comm.'
'; - print $langs->trans('SupplierCode').''; - print $soc->code_fournisseur; - if ($soc->check_codefournisseur() <> 0) print ' '.$langs->trans("WrongSupplierCode"); - print '
'.$langs->trans("Address").''.nl2br($soc->adresse).'
'.$langs->trans("Zip").''.$soc->cp.''.$langs->trans("Town").''.$soc->ville.'
'.$langs->trans("Country").''.$soc->pays.'
'.$langs->trans("Phone").''.dolibarr_print_phone($soc->tel).' '.$langs->trans("Fax").''.dolibarr_print_phone($soc->fax).' 
'.$langs->trans("Web")."url\">$soc->url 
'.$langs->trans('VATIsUsed').''; - print yn($soc->tva_assuj); - print '
'; - - print ''; - - - if ($mesg) print($mesg); - - - /* - * Barre d'actions - * - */ - print '
'; - if ($user->rights->categorie->creer) - { - print ''.$langs->trans("NewCat").''; - } - print '
'; - - - // Formulaire ajout dans une categorie - if ($user->rights->societe->creer) - { - print '
'; - print ''; - print ''; - print ''; - print ''; - print '
'; - print $langs->trans("ClassifyInCategory").' '; - print $html->select_all_categories(1,$categorie->id_mere).'
'; - print ''; - print '
'; - } - - - $c = new Categorie($db); - - if ($_GET["socid"]) - { - $cats = $c->containing($_REQUEST["socid"],"societe"); - } - - - if (sizeof($cats) > 0) - { - print_fiche_titre($langs->trans("SupplierIsInCategories")); - print ''; - print ''; - - $var = true; - foreach ($cats as $cat) - { - $ways = $cat->print_all_ways (); - foreach ($ways as $way) - { - $var = ! $var; - print ""; - - // Categorie - print ""; - - // Lien supprimer - print '"; - - print "\n"; - } - - } - print "
'.$langs->trans("Categories").'
".$way."'; - if ($user->rights->societe->creer) - { - print ""; - print img_delete($langs->trans("DeleteFromCat")).' '; - print $langs->trans("DeleteFromCat").""; - } - else - { - print ' '; - } - print "

\n"; - } - else if($cats < 0) - { - print $langs->trans("ErrorUnknown"); - } - - else - { - print $langs->trans("SupplierHasNoCategory")."
"; - } - -} -$db->close(); - - -llxFooter('$Date$ - $Revision$'); -?> diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php index c7e9751f12d..9aa96e3be58 100644 --- a/htdocs/lib/company.lib.php +++ b/htdocs/lib/company.lib.php @@ -67,7 +67,7 @@ function societe_prepare_head($objsoc) //affichage onglet catégorie if ($conf->categorie->enabled) { - $head[$h][0] = DOL_URL_ROOT.'/comm/categorie.php?socid='.$objsoc->id; + $head[$h][0] = DOL_URL_ROOT.'/categories/categorie.php?socid='.$objsoc->id; $head[$h][1] = $langs->trans('Categories'); $head[$h][2] = 'category'; $h++;