bugfix: la catégorie mère n'était pas récupérée lors de l'édition d'une catégorie fille

This commit is contained in:
Regis Houssin 2006-12-19 20:33:32 +00:00
parent 840a3d24da
commit 706914c4e9
3 changed files with 37 additions and 49 deletions

View File

@ -90,7 +90,6 @@ class Categorie
{ {
$res = $this->db->fetch_array($resql); $res = $this->db->fetch_array($resql);
$this->id_mere = $res['fk_categorie_mere']; $this->id_mere = $res['fk_categorie_mere'];
} }
else else
{ {

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org> /* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -90,54 +91,42 @@ print '<form method="post" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$categorie->id.'">'; print '<input type="hidden" name="id" value="'.$categorie->id.'">';
?> print '<table class="border" width="100%">';
<table class="border" width="100%"> print '<tr><td>';
<tr> print $langs->trans("Label").' :</td>';
<td><?php print $langs->trans("Label"); ?>&nbsp;:</td> print '<td><input type="text" size="25" id="nom" name ="nom" value="'.$categorie->label.'" />';
print '</tr>';
<td><input type='text' size='25' id='nom' name ='nom' value="<?php print '<tr>';
print $categorie->label; print '<td width="25%">'.$langs->trans("Description").':</td>';
?>" /> print '<td>';
</tr>
<?php
print '<tr>';
print '<td width="25%">'.$langs->trans("Description").':</td>';
print '<td>';
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC)
{ {
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('description',$categorie->description,200,'dolibarr_notes'); $doleditor=new DolEditor('description',$categorie->description,200,'dolibarr_notes');
$doleditor->Create(); $doleditor->Create();
} }
else else
{ {
print '<textarea name="description" rows="'.ROWS_6.'" cols="50">'; print '<textarea name="description" rows="'.ROWS_6.'" cols="50">';
print $categorie->description; print $categorie->description;
print '</textarea>'; print '</textarea>';
} }
print '</td>'; print '</td></tr>';
print '</tr>';
?> print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
print $html->select_all_categories($categorie->id_mere);
<tr><td><?php print $langs->trans ("AddIn"); ?></td><td> print '</td></tr>';
<?php print $html->select_all_categories($categorie->id_mere);?>
</td></tr> print '<tr><td>'.$langs->trans("ContentsVisibleByAll").'</td><td>';
print $html->selectyesnonum("visible",$categorie->visible);
<tr><td><?php print $langs->trans ("ContentsVisibleByAll"); ?></td><td> print '</td></tr>';
<?php print $html->selectyesnonum("visible",$categorie->visible);?>
</td></tr>
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'">';
<tr> print '</td></tr>';
<td colspan="2" align="center"><input type="submit" class="button" value='<?php print $langs->trans ("Modify"); ?>'></td> print '</table></form>';
</tr>
</table>
</form>
<?php
print '</td></tr></table>'; print '</td></tr></table>';

View File

@ -1243,7 +1243,7 @@ class Form
if ($select_name=="") $select_name="catMere"; if ($select_name=="") $select_name="catMere";
$cat = new Categorie ($this -> db); $cat = new Categorie ($this -> db);
$cate_arbo = $cat->get_full_arbo(); $cate_arbo = $cat->get_full_arbo();
$output = '<select name="'.$select_name.'">'; $output = '<select name="'.$select_name.'">';
@ -1253,7 +1253,7 @@ class Form
{ {
foreach($cate_arbo as $key => $value) foreach($cate_arbo as $key => $value)
{ {
if ($cate_arbo[$key]['fulllabel'] == $selected) if ($cate_arbo[$key]['id'] == $selected)
{ {
$add = "selected='true' "; $add = "selected='true' ";
} }