From 1ae27b097750c7e7701df791a5bd0de5494954ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Oct 2013 16:34:31 +0200 Subject: [PATCH] Qual: Remove a useless action button to save one click. --- htdocs/product/composition/fiche.php | 80 +++++++++++++++------------- 1 file changed, 42 insertions(+), 38 deletions(-) diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php index 0cca7dee679..f8a17f501b4 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani @@ -168,15 +168,13 @@ $picto=($product->type==1?'service':'product'); dol_fiche_head($head, 'subproduct', $titre, 0, $picto); -if ($id || $ref) +if ($id > 0 || ! empty($ref)) { - if ($result) +/* if ($result) { if ($action <> 'edit' && $action <> 'search' && $action <> 're-edit') { - /* - * En mode visu - */ + // mode visu print ''; @@ -262,11 +260,11 @@ if ($id || $ref) dol_fiche_end(); } } - +*/ /* * Fiche en mode edition */ - if (($action == 'edit' || $action == 'search' || $action == 're-edit') && ($user->rights->produit->creer || $user->rights->service->creer)) + if ($user->rights->produit->lire || $user->rights->service->lire) { print '
'; @@ -350,37 +348,44 @@ if ($id || $ref) dol_fiche_end(); - print '
'; - $rowspan=1; - if (! empty($conf->categorie->enabled)) $rowspan++; - - print_fiche_titre($langs->trans("ProductToAddSearch"),'',''); - print ''; - print '
'; - print ''; - - print ''; - print ''; - print ''; - if (! empty($conf->categorie->enabled)) + // Form with product to add + if ((empty($action) || $action == 'view' || $action == 'edit' || $action == 'search' || $action == 're-edit') && ($user->rights->produit->creer || $user->rights->service->creer)) { - print ''; - print ''; + print '
'; + + $rowspan=1; + if (! empty($conf->categorie->enabled)) $rowspan++; + + print_fiche_titre($langs->trans("ProductToAddSearch"),'',''); + print ''; + print '
'; - print ''; - print $langs->trans("KeywordFilter").'   '; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'.$langs->trans("CategoryFilter").'   '.$form->select_all_categories(0, $parent).'
'; + print ''; + + print ''; + print ''; + print ''; + if (! empty($conf->categorie->enabled)) + { + print ''; + print ''; + } + + print '
'; + print ''; + print $langs->trans("KeywordFilter").'   '; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'.$langs->trans("CategoryFilter").'   '.$form->select_all_categories(0, $parent).'
'; + print '
'; + print ''; } - print '
'; - print ''; - print ''; + // List of products if ($action == 'search') { print '
'; @@ -491,7 +496,7 @@ if ($id || $ref) /* Barre d'action */ /* */ /* ************************************************************************** */ - +/* print "\n
\n"; if ($action == '') @@ -503,10 +508,9 @@ if ($action == '') } print "\n
\n"; - +*/ llxFooter(); $db->close(); - -?> +?> \ No newline at end of file