Fix categorie navigation

This commit is contained in:
fappels 2017-07-10 12:47:21 +02:00
parent e3943155f3
commit f85fcbd216
2 changed files with 6 additions and 6 deletions

View File

@ -133,7 +133,7 @@ class Categorie extends CommonObject
); );
public $element='category'; public $element='category';
public $table_element='categories'; public $table_element='categorie';
public $fk_parent; public $fk_parent;
public $label; public $label;

View File

@ -35,14 +35,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$langs->load("categories"); $langs->load("categories");
$id=GETPOST('id','int'); $id=GETPOST('id','int');
$ref=GETPOST('ref'); $label=GETPOST('label');
$type=GETPOST('type'); $type=GETPOST('type');
$action=GETPOST('action','aZ09'); $action=GETPOST('action','aZ09');
$confirm=GETPOST('confirm'); $confirm=GETPOST('confirm');
$removeelem = GETPOST('removeelem','int'); $removeelem = GETPOST('removeelem','int');
$elemid=GETPOST('elemid'); $elemid=GETPOST('elemid');
if ($id == "") if ($id == "" && $label == "")
{ {
dol_print_error('','Missing parameter id'); dol_print_error('','Missing parameter id');
exit(); exit();
@ -52,7 +52,7 @@ if ($id == "")
$result = restrictedArea($user, 'categorie', $id, '&category'); $result = restrictedArea($user, 'categorie', $id, '&category');
$object = new Categorie($db); $object = new Categorie($db);
$result=$object->fetch($id); $result=$object->fetch($id, $label);
$object->fetch_optionals($id,$extralabels); $object->fetch_optionals($id,$extralabels);
if ($result <= 0) if ($result <= 0)
{ {
@ -195,7 +195,7 @@ $head = categories_prepare_head($object,$type);
dol_fiche_head($head, 'card', $title, -1, 'category'); dol_fiche_head($head, 'card', $title, -1, 'category');
$linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("BackToList").'</a>';
$object->next_prev_filter=" type = ".$object->type;
$object->ref = $object->label; $object->ref = $object->label;
$morehtmlref='<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> '; $morehtmlref='<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
$ways = $object->print_all_ways(" &gt;&gt; ", '', 1); $ways = $object->print_all_ways(" &gt;&gt; ", '', 1);
@ -205,7 +205,7 @@ foreach ($ways as $way)
} }
$morehtmlref.='</div>'; $morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); dol_banner_tab($object, 'label', $linkback, ($user->societe_id?0:1), 'label', 'label', $morehtmlref, '', 0, '', '', 1);
/* /*