From c0e8e07d84aebd83bbdc005b6fb677a34c725971 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jul 2006 00:37:31 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Debug=20divers=20sur=20gestion=20des=20c?= =?UTF-8?q?at=E9gories?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/categories/edit.php | 34 +++++++++++----- htdocs/categories/fiche.php | 70 ++++++++++++++++++++------------- htdocs/categories/index.php | 76 +++++++++++++++++++----------------- htdocs/html.form.class.php | 3 +- htdocs/product/categorie.php | 6 +-- 5 files changed, 111 insertions(+), 78 deletions(-) diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index c614c61a871..802f9e78334 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -85,7 +85,7 @@ print ''; ?>
- +
@@ -93,15 +93,27 @@ print ' - - - - - - - +'; + print ''; + print ''; + print ''; +?>
trans("Label"); ?> :
'; print $categorie->label; ?>" />
trans("Description"); ?> :
'.$langs->trans("Description").':'; + + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) + { + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('description',$categorie->description,240,'dolibarr_notes'); + $doleditor->Create(); + } + else + { + print ''; + } + + print '
trans ("AddIn"); ?> select_all_categories($categorie->id_mere);?> @@ -124,4 +136,6 @@ print '
'; print '
'; $db->close(); + +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index 9a8df008a97..d49d3bb3042 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -46,11 +46,12 @@ if ($_REQUEST['origin']) $idprodorigin = $_REQUEST['origin']; } + + + llxHeader("","",$langs->trans("Categories")); $html = new Form($db); - - // Action ajout d'une catégorie if ($_POST["action"] == 'add' && $user->rights->categorie->creer) { @@ -60,8 +61,8 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer) $categorie->description = $_POST["description"]; $categorie->visible = $_POST["visible"]; if($_POST['catMere'] != "-1") - $categorie->id_mere = $_POST['catMere']; - + $categorie->id_mere = $_POST['catMere']; + if (!$categorie->label || !$categorie->description) { @@ -74,37 +75,37 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer) { $_GET["action"] = 'confirmed'; $_POST["addcat"] = ''; - + } } /* - * Action confirmation de création de la catégorie - */ + * Action confirmation de création de la catégorie + */ - if ($_GET["action"] == 'confirmed') - { - print_titre($langs->trans("CatCreated")); + if ($_GET["action"] == 'confirmed') + { + print_titre($langs->trans("CatCreated")); - print ''; - print '
'; - print '

'.$langs->trans("TheCategorie").' '.$categorie->label.' '.$langs->trans("WasAddedSuccessfully").'

'; - - if ($_REQUEST['idprodorigin']) - { - $idprodorigin = $_REQUEST['idprodorigin']; - print '

'.$langs->trans("ReturnInProduct").'

'; - } - - print '
'; - } + print ''; + print '
'; + print $langs->trans("TheCategorie").' '.$categorie->label.' '.$langs->trans("WasAddedSuccessfully"); + + if ($_REQUEST['idprodorigin']) + { + $idprodorigin = $_REQUEST['idprodorigin']; + print ''.$langs->trans("ReturnInProduct").''; + } + + print '
'; + } } -if ($user->rights->produit->creer) +if ($user->rights->categorie->creer) { /* - * Fiche en mode création - */ + * Fiche en mode création + */ if ($_GET["action"] == 'create' || $_POST["addcat"] == 'addcat') { if($categorie->error != "") @@ -126,11 +127,24 @@ if ($user->rights->produit->creer) print ''; print ''; - print ''; print ''; + + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) + { + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('description',$categorie->description,240,'dolibarr_notes'); + $doleditor->Create(); + } + else + { + print ''; + } + + print ''; print ''; diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index c2e838670ff..455892fe348 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -75,50 +75,54 @@ print ''; + +$c->get_categories_arbo(); +$cate_arbo = $c->get_arbo_each_cate(); + +if (is_array($cate_arbo)) +{ + $var=true; + foreach($cate_arbo as $key => $value) + { + $var = ! $var; + print "\t\n"; + print ''; + print "\t\n"; + print ''; + print "\t\n"; + print "\t\n"; + } +} + +print "
'.$langs->trans("Label").''; + print ''.$langs->trans("Label").''; print'
'.$langs->trans("Description").''; - print '
'.$langs->trans ("AddIn").''; print $html->select_all_categories(); print '
'; * Catégories trouvées */ -if($_POST['catname']) { - $cats = $c->rechercher_par_nom ($_POST['catname']); - print ''; - print ''; - - foreach ($cats as $cat) - { - $i = !$i; - print "\t\n"; - print "\t\t\n"; - print "\t\t\n"; - print "\t\n"; - } - print "
'.$langs->trans("FoundCats").'
".$cat->label."".$cat->description."
"; - +if($_POST['catname']) +{ + $cats = $c->rechercher_par_nom ($_POST['catname']); + print ''; + print ''; + + $var=true; + foreach ($cats as $cat) + { + $var = ! $var; + print "\t\n"; + print "\t\t\n"; + print "\t\t\n"; + print "\t\n"; + } + print "
'.$langs->trans("FoundCats").'
".$cat->label."".$cat->description."
"; } /* - * Catégories principales - */ +* Catégories principales +*/ print ''; - print ''; - - $c->get_categories_arbo(); - $cate_arbo = $c->get_arbo_each_cate(); - - foreach($cate_arbo as $key => $value) - { - $i = !$i; - print "\t\n"; - print ''; - print "\t\n"; - print ''; - print "\t\n"; - print "\t\n"; - } - - - print "
'.$langs->trans("AllCats").''.$langs->trans("Desc").'
'.$value[0].''.$c->get_desc($value[1]).'
"; +print '
'.$langs->trans("AllCats").''.$langs->trans("Desc").'
'.$value[0].''.$c->get_desc($value[1]).'
"; print ''; $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 13fa1ad0951..6ea32dfc059 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -1200,7 +1200,7 @@ class Form $cat->get_categories_arbo(); $cate_arbo = $cat->get_arbo_each_cate(); $output = ''; + $output.= "\n"; return $output; } diff --git a/htdocs/product/categorie.php b/htdocs/product/categorie.php index a486439200e..4cbb2df13cf 100644 --- a/htdocs/product/categorie.php +++ b/htdocs/product/categorie.php @@ -243,14 +243,14 @@ if ($_GET["id"] || $_GET["ref"]) print ''; print ''; + $var = true; foreach ($cats as $cat) { - $ways = $cat->print_all_ways (); foreach ($ways as $way) { - $i = !$i; - print ""; + $var = ! $var; + print ""; print '\n"; }
'.$langs->trans("Categories").'
".$way."
".$way."'.img_delete($langs->trans("DeleteFromCat"))." ".$langs->trans("DeleteFromCat")."