diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index c64d8b48e3d..6bb5a1f95a3 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -528,11 +528,11 @@ if ($id > 0 || ! empty($ref)) print ''; $period_filter .= $langs->trans('From').' '.$form->select_date($req_stdt,'req_stdt',0,0,1,null,1,1,1); - $period_filter .= '
'. $langs->trans('to').' '.$form->select_date($req_enddt,'req_enddt',0,0,1,null,1,1,1); + $period_filter .= ' '; + $period_filter .= $langs->trans('to').' '.$form->select_date($req_enddt,'req_enddt',0,0,1,null,1,1,1); print ''; - print ' '; - print ''.$period_filter.''; + print ''.$period_filter.''; print ''; //$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...) $filtertype=''; diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 78a78195d37..5a1f38806bb 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -4,8 +4,9 @@ * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010-2015 Juanjo Menent - * Copyright (C) 2014 Jean Heimburger + * Copyright (C) 2014 Jean Heimburger * Copyright (C) 2015 Marcos García + * Copyright (C) 2015 Raphaël Doursenaud * * 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 @@ -262,6 +263,12 @@ if ($object->id > 0) print ""; print ''; + // Categories + print '' . $langs->trans("Categories") . ''; + print ''; + print $form->showCategories($object->id, 'supplier', 1); + print ""; + // Other attributes $parameters=array('socid'=>$object->id, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 9e8cd7acef3..96e4c955cd6 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -204,7 +204,7 @@ if ($id > 0 || ! empty($ref)) print ''; // Label - print ''.$langs->trans("Label").''.$object->libelle.''; + print ''.$langs->trans("Label").''.$object->label.''; print ''; // Nature diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 6302994181a..b8c66cf8491 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -345,7 +345,7 @@ $langs->load("proposals"); $langs->load("margins"); //print load_fiche_titre($langs->trans("Profit"),'','title_accountancy'); -print '
'.img_picto("", "title_accountancy").' '.$langs->trans("Profit").'

'; +print '
'.img_picto("", "title_accountancy").' '.$langs->trans("Profit").'

'; print ''; print ''; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 864f507494a..b80f0f2c086 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1,14 +1,15 @@ - * Copyright (C) 2003 Brian Fraval - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2008 Patrick Raguin - * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2011-2013 Alexandre Spangaro - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Marcos García +/* Copyright (C) 2001-2007 Rodolphe Quiedeville + * Copyright (C) 2003 Brian Fraval + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005 Eric Seigne + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2008 Patrick Raguin + * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2011-2013 Alexandre Spangaro + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Marcos García + * Copyright (C) 2015 Raphaël Doursenaud * * 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 @@ -411,7 +412,7 @@ if (empty($reshook)) } } - // Categories association + // Customer categories association $custcats = GETPOST( 'custcats', 'array' ); if (!empty( $custcats )) { $cat = new Categorie( $db ); @@ -421,6 +422,16 @@ if (empty($reshook)) } } + // Supplier categories association + $suppcats = GETPOST('suppcats', 'array'); + if (!empty($suppcats)) { + $cat = new Categorie($db); + foreach ($suppcats as $id_category) { + $cat->fetch($id_category); + $cat->add_type($object, 'supplier'); + } + } + // Logo/Photo save $dir = $conf->societe->multidir_output[$conf->entity]."/".$object->id."/logos/"; $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']); @@ -525,7 +536,7 @@ if (empty($reshook)) $error = $object->error; $errors = $object->errors; } - // Categories association + // Customer categories association // First we delete all categories association $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'categorie_societe'; $sql .= ' WHERE fk_soc = ' . $object->id; @@ -541,6 +552,22 @@ if (empty($reshook)) } } + // Supplier categories association + // First we delete all categories association + $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'categorie_fournisseur'; + $sql .= ' WHERE fk_soc = ' . $object->id; + $db->query($sql); + + // Then we add the associated categories + $categories = GETPOST('suppcats', 'array'); + if (!empty($categories)) { + $cat = new Categorie($db); + foreach ($categories as $id_category) { + $cat->fetch($id_category); + $cat->add_type($object, 'supplier'); + } + } + // Logo/Photo save $dir = $conf->societe->multidir_output[$object->entity]."/".$object->id."/logos"; $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']); @@ -1245,13 +1272,26 @@ else } // Categories - if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) - { - print '"; - } + if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) + { + // Customer + if ($object->prospect || $object->client) { + print '"; + } + + // Supplier + if ($object->fournisseur) { + print '"; + } + } // Other attributes $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); @@ -1761,19 +1801,36 @@ else } // Categories - if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) - { - print ''; - print ''; + print '"; } - print $form->multiselectarray( 'custcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%'); - print ""; - } + + // Supplier + if ($object->fournisseur) { + print ''; + print '"; + } + } // Other attributes $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); @@ -2207,13 +2264,24 @@ else } // Tags / categories - if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) - { - print ''; - print '"; - } + if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) + { + // Customer + if ($object->prospect || $object->client) { + print ''; + print '"; + } + + // Supplier + if ($object->fournisseur) { + print ''; + print '"; + } + } // Incoterms if (!empty($conf->incoterm->enabled))
'.fieldLabel('Categories','custcats').''; - $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); - print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); - print "
' . fieldLabel('CustomersCategoriesShort', 'custcats') . ''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); + print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, + null, "90%"); + print "
' . fieldLabel('SuppliersCategoriesShort', 'suppcats') . ''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, 'parent', null, null, 1); + print $form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, null, + null, "90%"); + print "
'.fieldLabel('Categories', 'custcats').''; - $cate_arbo = $form->select_all_categories( Categorie::TYPE_CUSTOMER, null, null, null, null, 1); - $c = new Categorie( $db ); - $cats = $c->containing( $object->id, Categorie::TYPE_CUSTOMER ); - foreach ($cats as $cat) { - $arrayselected[] = $cat->id; + if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) + { + // Customer + if ($object->prospect || $object->client) { + print '
' . fieldLabel('CustomersCategoriesShort', 'custcats') . ''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, null, null, null, 1); + $c = new Categorie($db); + $cats = $c->containing($object->id, Categorie::TYPE_CUSTOMER); + foreach ($cats as $cat) { + $arrayselected[] = $cat->id; + } + print $form->multiselectarray('custcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%'); + print "
' . fieldLabel('SuppliersCategoriesShort', 'suppcats') . ''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, null, null, null, 1); + $c = new Categorie($db); + $cats = $c->containing($object->id, Categorie::TYPE_SUPPLIER); + foreach ($cats as $cat) { + $arrayselected[] = $cat->id; + } + print $form->multiselectarray('suppcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%'); + print "
' . $langs->trans( "Categories" ) . ''; - print $form->showCategories( $object->id, 'customer', 1 ); - print "
' . $langs->trans("CustomersCategoriesShort") . ''; + print $form->showCategories($object->id, 'customer', 1); + print "
' . $langs->trans("SuppliersCategoriesShort") . ''; + print $form->showCategories($object->id, 'supplier', 1); + print "