New: Ajout gestionnaire d'arbre HTML
Look: Mise au norme affiche fiche categorie
This commit is contained in:
parent
72f24f51c1
commit
14840849d3
@ -874,23 +874,29 @@ class Categorie
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourne les catégories dont le nom correspond à $nom
|
* \brief Retourne les catégories dont l'id ou le nom correspond
|
||||||
* ajoute des wildcards sauf si $exact = true
|
* ajoute des wildcards au nom sauf si $exact = true
|
||||||
*/
|
*/
|
||||||
function rechercher_par_nom ($nom, $exact = false)
|
function rechercher($id, $nom, $exact = false)
|
||||||
{
|
{
|
||||||
$cats = array ();
|
$cats = array ();
|
||||||
|
|
||||||
if (!$exact)
|
// Generation requete recherche
|
||||||
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie ";
|
||||||
|
if ($nom)
|
||||||
{
|
{
|
||||||
$nom = '%'.str_replace ('*', '%', $nom).'%';
|
if (! $exact)
|
||||||
|
{
|
||||||
|
$nom = '%'.str_replace ('*', '%', $nom).'%';
|
||||||
|
}
|
||||||
|
$sql.= "WHERE label LIKE '".$nom."'";
|
||||||
|
}
|
||||||
|
if ($id)
|
||||||
|
{
|
||||||
|
$sql.="WHERE rowid = '".$id."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie ";
|
|
||||||
$sql .= "WHERE label LIKE '".$nom."'";
|
|
||||||
|
|
||||||
$res = $this->db->query ($sql);
|
$res = $this->db->query ($sql);
|
||||||
|
|
||||||
if ($res)
|
if ($res)
|
||||||
{
|
{
|
||||||
while ($id = $this->db->fetch_array ($res))
|
while ($id = $this->db->fetch_array ($res))
|
||||||
@ -902,7 +908,10 @@ class Categorie
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return 0;
|
$this->error=$this->db->error().' sql='.$sql;
|
||||||
|
//dolibarr_syslog($this->error);
|
||||||
|
dolibarr_print_error('',$this->error);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,26 +31,11 @@ $user->getrights();
|
|||||||
if (!$user->rights->categorie->lire)
|
if (!$user->rights->categorie->lire)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Affichage fiche
|
|
||||||
*/
|
|
||||||
|
|
||||||
llxHeader("","",$langs->trans("Categories"));
|
|
||||||
|
|
||||||
print_titre($langs->trans("ModifCat"));
|
|
||||||
|
|
||||||
print '<table border="0" width="100%">';
|
|
||||||
|
|
||||||
print '<tr><td valign="top" width="30%">';
|
|
||||||
|
|
||||||
$categorie = new Categorie ($db, $_REQUEST['id']);
|
|
||||||
$html = new Form($db);
|
|
||||||
|
|
||||||
|
|
||||||
// Action mise à jour d'une catégorie
|
// Action mise à jour d'une catégorie
|
||||||
if ($_POST["action"] == 'update' && $user->rights->categorie->creer)
|
if ($_POST["action"] == 'update' && $user->rights->categorie->creer)
|
||||||
{
|
{
|
||||||
|
$categorie = new Categorie ($db, $_REQUEST['id']);
|
||||||
|
|
||||||
$categorie->label = $_POST["nom"];
|
$categorie->label = $_POST["nom"];
|
||||||
$categorie->description = $_POST["description"];
|
$categorie->description = $_POST["description"];
|
||||||
$categorie->visible = $_POST["visible"];
|
$categorie->visible = $_POST["visible"];
|
||||||
@ -69,22 +54,43 @@ if ($_POST["action"] == 'update' && $user->rights->categorie->creer)
|
|||||||
{
|
{
|
||||||
if ($categorie->update() > 0)
|
if ($categorie->update() > 0)
|
||||||
{
|
{
|
||||||
$_GET["action"] = 'confirmed';
|
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$categorie->id);
|
||||||
$_POST["addcat"] = '';
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Affichage fiche
|
||||||
|
*/
|
||||||
|
|
||||||
|
llxHeader("","",$langs->trans("Categories"));
|
||||||
|
|
||||||
|
print_titre($langs->trans("ModifCat"));
|
||||||
|
print "<br>";
|
||||||
|
|
||||||
if ($categorie->error)
|
if ($categorie->error)
|
||||||
{
|
{
|
||||||
print '<div class="error">';
|
print '<div class="error">';
|
||||||
print $categorie->error;
|
print $categorie->error;
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
print '<tr><td valign="top" width="30%">';
|
|
||||||
|
$categorie = new Categorie ($db, $_REQUEST['id']);
|
||||||
|
$html = new Form($db);
|
||||||
|
|
||||||
|
print '<table class="notopnoleft" border="0" width="100%">';
|
||||||
|
|
||||||
|
print '<tr><td class="notopnoleft" valign="top" width="30%">';
|
||||||
|
|
||||||
|
print "\n";
|
||||||
|
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'">';
|
||||||
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
print '<input type="hidden" name="id" value="'.$categorie->id.'">';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<form method="post" action="<?php print $_SERVER['REQUEST_URI']; ?>">
|
|
||||||
<input type="hidden" name="action" value="update">
|
|
||||||
<table class="border" width="100%">
|
<table class="border" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php print $langs->trans("Label"); ?> :</td>
|
<td><?php print $langs->trans("Label"); ?> :</td>
|
||||||
@ -101,7 +107,7 @@ print '<tr><td valign="top" width="30%">';
|
|||||||
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,240,'dolibarr_notes');
|
$doleditor=new DolEditor('description',$categorie->description,200,'dolibarr_notes');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -67,7 +67,7 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
|
|||||||
if (!$categorie->label || !$categorie->description)
|
if (!$categorie->label || !$categorie->description)
|
||||||
{
|
{
|
||||||
$_GET["action"] = 'create';
|
$_GET["action"] = 'create';
|
||||||
$categorie->error = $langs->trans(ErrForgotField);
|
$categorie->error = $langs->trans("ErrForgotField");
|
||||||
}
|
}
|
||||||
if ($categorie->error =="")
|
if ($categorie->error =="")
|
||||||
{
|
{
|
||||||
@ -84,11 +84,13 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
|
|||||||
|
|
||||||
if ($_GET["action"] == 'confirmed')
|
if ($_GET["action"] == 'confirmed')
|
||||||
{
|
{
|
||||||
print_titre($langs->trans("CatCreated"));
|
print_titre($langs->trans("NewCategory"));
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
print '<table border="0" width="100%">';
|
print '<table class="notopnoleft" width="100%">';
|
||||||
print '<tr><td valign="top" width="30%">';
|
print '<tr><td valign="top" class="notopnoleft" width="30%">';
|
||||||
print $langs->trans("TheCategorie").' '.$categorie->label.' '.$langs->trans("WasAddedSuccessfully");
|
|
||||||
|
print '<div class="ok">'.$langs->trans("CategorySuccessfullyCreated",$categorie->label).'</div>';
|
||||||
|
|
||||||
if ($_REQUEST['idprodorigin'])
|
if ($_REQUEST['idprodorigin'])
|
||||||
{
|
{
|
||||||
@ -134,7 +136,7 @@ if ($user->rights->categorie->creer)
|
|||||||
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,240,'dolibarr_notes');
|
$doleditor=new DolEditor('description',$categorie->description,200,'dolibarr_notes');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -36,15 +36,16 @@ if (!$user->rights->categorie->lire) accessforbidden();
|
|||||||
* Affichage page accueil
|
* Affichage page accueil
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader("","",$langs->trans("ProductsCategoriesArea"));
|
$c = new Categorie($db);
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
|
|
||||||
|
llxHeader("","",$langs->trans("ProductsCategoriesArea"));
|
||||||
print_fiche_titre($langs->trans("ProductsCategoriesArea"));
|
print_fiche_titre($langs->trans("ProductsCategoriesArea"));
|
||||||
|
|
||||||
print '<table border="0" width="100%" class="notopnoleftnoright">';
|
print '<table border="0" width="100%" class="notopnoleftnoright">';
|
||||||
|
|
||||||
print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
||||||
|
|
||||||
$c = new Categorie ($db);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Zone recherche produit/service
|
* Zone recherche produit/service
|
||||||
@ -74,10 +75,10 @@ print '</td><td valign="top" width="70%">';
|
|||||||
/*
|
/*
|
||||||
* Catégories trouvées
|
* Catégories trouvées
|
||||||
*/
|
*/
|
||||||
|
if($_POST['catname'] || $_REQUEST['id'])
|
||||||
if($_POST['catname'])
|
|
||||||
{
|
{
|
||||||
$cats = $c->rechercher_par_nom ($_POST['catname']);
|
$cats = $c->rechercher($_REQUEST['id'],$_POST['catname']);
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("FoundCats").'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("FoundCats").'</td></tr>';
|
||||||
|
|
||||||
@ -107,91 +108,97 @@ $cate_arbo = $c->get_full_arbo();
|
|||||||
* Catégories en javascript
|
* Catégories en javascript
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
if ($conf->use_javascript)
|
if ($conf->use_javascript)
|
||||||
{
|
{
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("AllCats").'</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("CategoriesTree").'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/includes/treemenu/TreeMenu.php');
|
if (sizeof($cate_arbo))
|
||||||
|
|
||||||
$menu = new HTML_TreeMenu();
|
|
||||||
$icon = 'folder.gif';
|
|
||||||
$expandedIcon = 'folder-expanded.gif';
|
|
||||||
|
|
||||||
// Création noeud racine
|
|
||||||
$node=array();
|
|
||||||
$currentnode=-1;
|
|
||||||
$node[$currentnode] = new HTML_TreeNode(
|
|
||||||
array('text' => $langs->trans("AllCats"), 'link' => '', 'icon' => $icon, 'expandedIcon' => $expandedIcon, 'expanded' => true)
|
|
||||||
//,array('onclick' => "alert('foo'); return false", 'onexpand' => "alert('Expanded')")
|
|
||||||
);
|
|
||||||
$node1 = new HTML_TreeNode(
|
|
||||||
array('text' => $langs->trans("AllCats"), 'link' => '', 'icon' => $icon, 'expandedIcon' => $expandedIcon, 'expanded' => true)
|
|
||||||
//,array('onclick' => "alert('foo'); return false", 'onexpand' => "alert('Expanded')")
|
|
||||||
);
|
|
||||||
|
|
||||||
// Ajoute id_mere sur tableau cate_arbo
|
|
||||||
foreach ($cate_arbo as $key => $val)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
print 'x '.$cate_arbo[$key]['id'].' '.$cate_arbo[$key]['level'].' '.$cate_arbo[$key]['id_mere'].'<br>';
|
require_once(DOL_DOCUMENT_ROOT.'/includes/treemenu/TreeMenu.php');
|
||||||
|
|
||||||
|
$menu = new HTML_TreeMenu();
|
||||||
|
$icon = 'folder.gif';
|
||||||
|
$expandedIcon = 'folder-expanded.gif';
|
||||||
|
|
||||||
|
// Création noeud racine
|
||||||
|
$node=array();
|
||||||
|
$rootnode='-1';
|
||||||
|
$node[$rootnode] = new HTML_TreeNode(
|
||||||
|
array('text' => $langs->trans("AllCats"), 'link' => '', 'icon' => $icon, 'expandedIcon' => $expandedIcon, 'expanded' => true)
|
||||||
|
//,array('onclick' => "alert('foo'); return false", 'onexpand' => "alert('Expanded')")
|
||||||
|
);
|
||||||
|
|
||||||
|
// Ajoute id_mere sur tableau cate_arbo
|
||||||
|
$i=0;
|
||||||
|
foreach ($cate_arbo as $key => $val)
|
||||||
|
{
|
||||||
|
$i++;
|
||||||
|
$nodeparent=ereg_replace('_[0-9]+$','',$cate_arbo[$key]['fullpath']);
|
||||||
|
if (! $nodeparent) $nodeparent=$rootnode;
|
||||||
|
//print "Ajout noeud sur noeud ".$nodeparent.' pour categorie '.$cate_arbo[$key]['fulllabel']."<br>\n";
|
||||||
|
$node[$cate_arbo[$key]['fullpath']]=$node[$nodeparent]->addItem(new HTML_TreeNode(array(
|
||||||
|
'text' => $cate_arbo[$key]['label'],
|
||||||
|
//'link' => $_SERVER["PHP_SELF"].'?id='.$cate_arbo[$key]['id'],
|
||||||
|
'link' => DOL_URL_ROOT.'/categories/viewcat.php?id='.$cate_arbo[$key]['id'],
|
||||||
|
'icon' => $icon, 'expandedIcon' => $expandedIcon)));
|
||||||
|
//print 'Resultat: noeud '.$cate_arbo[$key]['fullpath']." créé<br>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$menu->addItem($node[$rootnode]);
|
||||||
|
|
||||||
|
// Affiche arbre
|
||||||
|
print '<script src="'.DOL_URL_ROOT.'/includes/treemenu/TreeMenu.js" language="JavaScript" type="text/javascript"></script>';
|
||||||
|
|
||||||
|
$treeMenu = new HTML_TreeMenu_DHTML($menu, array('images' => DOL_URL_ROOT.'/includes/treemenu/images', 'defaultClass' => 'treeMenuDefault', false));
|
||||||
|
$treeMenu->printMenu();
|
||||||
|
|
||||||
|
//$listBox = new HTML_TreeMenu_Listbox($menu, array('linkTarget' => '_self'));
|
||||||
|
//$listBox->printMenu();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
$node1->addItem(new HTML_TreeNode(array('text' => "Second level, item y", 'link' => $_SERVER["PHP_SELF"], 'icon' => $icon, 'expandedIcon' => $expandedIcon)));
|
{
|
||||||
$node1_1 = $node1->addItem(new HTML_TreeNode(array('text' => "Second level", 'link' => $_SERVER["PHP_SELF"], 'icon' => $icon, 'expandedIcon' => $expandedIcon)));
|
print $langs->trans("NoneCategory");
|
||||||
$node1_1_1 = $node1_1->addItem(new HTML_TreeNode(array('text' => "Third level", 'link' => $_SERVER["PHP_SELF"], 'icon' => $icon, 'expandedIcon' => $expandedIcon)));
|
}
|
||||||
$node1_1_1_1 = $node1_1_1->addItem(new HTML_TreeNode(array('text' => "Fourth level", 'link' => $_SERVER["PHP_SELF"], 'icon' => $icon, 'expandedIcon' => $expandedIcon)));
|
|
||||||
$node1_1_1_1->addItem(new HTML_TreeNode(array('text' => "Fifth level", 'link' => $_SERVER["PHP_SELF"], 'icon' => $icon, 'expandedIcon' => $expandedIcon, 'cssClass' => 'treeMenuBold')));
|
|
||||||
$node1_1->addItem(new HTML_TreeNode(array('text' => "Third Level, item 2", 'link' => $_SERVER["PHP_SELF"], 'icon' => $icon, 'expandedIcon' => $expandedIcon)));
|
|
||||||
$node1->addItem(new HTML_TreeNode(array('text' => "Second level, item 3", 'link' => $_SERVER["PHP_SELF"], 'icon' => $icon, 'expandedIcon' => $expandedIcon)));
|
|
||||||
$menu->addItem($node1);
|
|
||||||
|
|
||||||
// Affiche arbre
|
|
||||||
print '<script src="'.DOL_URL_ROOT.'/includes/treemenu/TreeMenu.js" language="JavaScript" type="text/javascript"></script>';
|
|
||||||
|
|
||||||
$treeMenu = new HTML_TreeMenu_DHTML($menu, array('images' => DOL_URL_ROOT.'/includes/treemenu/images', 'defaultClass' => 'treeMenuDefault', false));
|
|
||||||
$treeMenu->printMenu();
|
|
||||||
|
|
||||||
//$listBox = new HTML_TreeMenu_Listbox($menu, array('linkTarget' => '_self'));
|
|
||||||
//$listBox->printMenu();
|
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
*/
|
else
|
||||||
|
|
||||||
/*
|
|
||||||
* Catégories principales en HTML pure
|
|
||||||
*/
|
|
||||||
if (1 == 1)
|
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Catégories principales en HTML pure
|
||||||
|
*/
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("AllCats").'</td><td>'.$langs->trans("Desc").'</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("AllCats").'</td><td>'.$langs->trans("Description").'</td></tr>';
|
||||||
|
|
||||||
if (is_array($cate_arbo))
|
if (sizeof($cate_arbo))
|
||||||
{
|
{
|
||||||
$var=true;
|
if (is_array($cate_arbo))
|
||||||
foreach($cate_arbo as $key => $value)
|
|
||||||
{
|
{
|
||||||
$var = ! $var;
|
$var=true;
|
||||||
print "\t<tr ".$bc[$var].">\n";
|
foreach($cate_arbo as $key => $value)
|
||||||
print '<td><a href="viewcat.php?id='.$cate_arbo[$key]['id'].'">'.$cate_arbo[$key]['fulllabel'].'</a></td>';
|
{
|
||||||
print '<td>'.$c->get_desc($cate_arbo[$key]['id']).'</td>';
|
$var = ! $var;
|
||||||
print "\t</td>\n";
|
print "\t<tr ".$bc[$var].">\n";
|
||||||
print "\t</tr>\n";
|
print '<td><a href="viewcat.php?id='.$cate_arbo[$key]['id'].'">'.$cate_arbo[$key]['fulllabel'].'</a></td>';
|
||||||
|
print '<td>'.$c->get_desc($cate_arbo[$key]['id']).'</td>';
|
||||||
|
print "\t</tr>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date$ - $Revision$');
|
||||||
|
|||||||
@ -17,6 +17,13 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\file htdocs/categories/edit.php
|
||||||
|
\ingroup categories
|
||||||
|
\brief Page de visualisation de categorie produit
|
||||||
|
\version $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
require "./pre.inc.php";
|
require "./pre.inc.php";
|
||||||
|
|
||||||
$user->getrights('categorie');
|
$user->getrights('categorie');
|
||||||
@ -28,35 +35,74 @@ if (! $user->rights->categorie->lire)
|
|||||||
|
|
||||||
if ($_REQUEST['id'] == "")
|
if ($_REQUEST['id'] == "")
|
||||||
{
|
{
|
||||||
dolibarr_print_error ();
|
dolibarr_print_error('','Missing parameter id');
|
||||||
exit ();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$c = new Categorie ($db, $_REQUEST['id']);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Affichage fiche categorie
|
* Affichage fiche categorie
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader ("","",$langs->trans("Categories"));
|
llxHeader ("","",$langs->trans("Categories"));
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("Category"));
|
$c = new Categorie ($db, $_REQUEST['id']);
|
||||||
|
|
||||||
print '<table border="0" width="100%" class="notopnoleftnoright">';
|
$h = 0;
|
||||||
print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
$head = array();
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/categories/viewcat.php?id='.$c->id;
|
||||||
|
$head[$h][1] = $langs->trans("Card");
|
||||||
|
$head[$h][2] = 'card';
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
dolibarr_fiche_head($head, 'card', $langs->trans("Category"));
|
||||||
|
|
||||||
|
|
||||||
|
print '<table border="0" width="100%" class="border">';
|
||||||
|
|
||||||
|
print '<tr><td width="20%" class="notopnoleft">';
|
||||||
$ways = $c->print_all_ways ();
|
$ways = $c->print_all_ways ();
|
||||||
print "<div id='ways'>";
|
print $langs->trans("Ref").'</td><td>';
|
||||||
print $langs->trans("Ref").': ';
|
|
||||||
foreach ($ways as $way)
|
foreach ($ways as $way)
|
||||||
{
|
{
|
||||||
print $way."<br />\n";
|
print $way."<br />\n";
|
||||||
}
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
|
print '<tr><td width="20%" class="notopnoleft">';
|
||||||
|
print $langs->trans("Description").'</td><td>';
|
||||||
|
print nl2br($c->description);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Boutons actions
|
||||||
|
*/
|
||||||
|
print "<div class='tabsAction'>\n";
|
||||||
|
|
||||||
|
if ($user->rights->categorie->creer)
|
||||||
|
{
|
||||||
|
print "<a class='butAction' href='edit.php?id=".$c->id."'>".$langs->trans("Edit")."</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user->rights->categorie->supprimer)
|
||||||
|
{
|
||||||
|
print "<a class='butActionDelete' href='delete.php?id=".$c->id."'>".$langs->trans("Delete")."</a>";
|
||||||
|
}
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|
||||||
$cats = $c->get_filles ();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$cats = $c->get_filles ();
|
||||||
if ($cats < 0)
|
if ($cats < 0)
|
||||||
{
|
{
|
||||||
dolibarr_print_error();
|
dolibarr_print_error();
|
||||||
@ -96,10 +142,8 @@ else
|
|||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
$prods = $c->get_products ();
|
$prods = $c->get_products ();
|
||||||
|
|
||||||
if ($prods < 0)
|
if ($prods < 0)
|
||||||
{
|
{
|
||||||
dolibarr_print_error();
|
dolibarr_print_error();
|
||||||
@ -112,6 +156,7 @@ else
|
|||||||
|
|
||||||
if (sizeof ($prods) > 0)
|
if (sizeof ($prods) > 0)
|
||||||
{
|
{
|
||||||
|
$i = 0;
|
||||||
$var=true;
|
$var=true;
|
||||||
foreach ($prods as $prod)
|
foreach ($prods as $prod)
|
||||||
{
|
{
|
||||||
@ -134,25 +179,6 @@ else
|
|||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Boutons actions
|
|
||||||
*/
|
|
||||||
print "<div class='tabsAction'>\n";
|
|
||||||
|
|
||||||
if ($user->rights->categorie->creer)
|
|
||||||
{
|
|
||||||
print "<a class='butAction' href='edit.php?id=".$c->id."'>".$langs->trans("Edit")."</a>";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($user->rights->categorie->supprimer)
|
|
||||||
{
|
|
||||||
print "<a class='butActionDelete' href='delete.php?id=".$c->id."'>".$langs->trans("Delete")."</a>";
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</div>";
|
|
||||||
|
|
||||||
|
|
||||||
print '</td></tr></table>';
|
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ In=In
|
|||||||
AddIn=Add in
|
AddIn=Add in
|
||||||
modify=modify
|
modify=modify
|
||||||
CategoriesArea=Categories area
|
CategoriesArea=Categories area
|
||||||
|
ProductsCategoriesArea=Products/Services' categories Area
|
||||||
MainCats=Main categories
|
MainCats=Main categories
|
||||||
SubCats=Subcategories
|
SubCats=Subcategories
|
||||||
CatStatistics=Statistics
|
CatStatistics=Statistics
|
||||||
@ -14,6 +15,7 @@ CatList=List of cat
|
|||||||
AllCats=All categories
|
AllCats=All categories
|
||||||
ViewCat=View category
|
ViewCat=View category
|
||||||
NewCat=Add category
|
NewCat=Add category
|
||||||
|
NewCategory=New product/services category
|
||||||
ModifCat=Modify category
|
ModifCat=Modify category
|
||||||
CatCreated=Category added
|
CatCreated=Category added
|
||||||
CreateCat=Create category
|
CreateCat=Create category
|
||||||
@ -33,10 +35,14 @@ AddProductToCat=Add this product to a category?
|
|||||||
ImpossibleAddCat=Impossible to add the category
|
ImpossibleAddCat=Impossible to add the category
|
||||||
ImpossibleAssociateCategory=Impossible to associate the category to
|
ImpossibleAssociateCategory=Impossible to associate the category to
|
||||||
WasAddedSuccessfully=was added successfully.
|
WasAddedSuccessfully=was added successfully.
|
||||||
|
CategorySuccessfullyCreated=La catégorie %s a été ajouté avec succčs.
|
||||||
ProductIsInCategories=Product/service owns to categories
|
ProductIsInCategories=Product/service owns to categories
|
||||||
ProductHasNoCategory=This product/service is not in any categories
|
ProductHasNoCategory=This product/service is not in any categories
|
||||||
ClassifyInCategory=Classify in category
|
ClassifyInCategory=Classify in category
|
||||||
|
NoneCategory=None
|
||||||
|
CategoryExistsAtSameLevel=This category already exists at same place
|
||||||
ReturnInProduct=Back to product/service card
|
ReturnInProduct=Back to product/service card
|
||||||
ContentsVisibleByAll=The contents will be visible by all
|
ContentsVisibleByAll=The contents will be visible by all
|
||||||
ContentsVisibleByAllShort=Contents visible by all
|
ContentsVisibleByAllShort=Contents visible by all
|
||||||
ContentsNotVisibleByAllShort=Contents not visible by all
|
ContentsNotVisibleByAllShort=Contents not visible by all
|
||||||
|
CategoriesTree=Categories tree
|
||||||
@ -15,6 +15,7 @@ CatList=Liste des cat
|
|||||||
AllCats=Toutes les catégories
|
AllCats=Toutes les catégories
|
||||||
ViewCat=Visualisation de la catégorie
|
ViewCat=Visualisation de la catégorie
|
||||||
NewCat=Nouvelle catégorie
|
NewCat=Nouvelle catégorie
|
||||||
|
NewCategory=Nouvelle catégorie de produits/services
|
||||||
ModifCat=Modifier une catégorie
|
ModifCat=Modifier une catégorie
|
||||||
CatCreated=Catégorie ajoutée
|
CatCreated=Catégorie ajoutée
|
||||||
CreateCat=Ajouter une catégorie
|
CreateCat=Ajouter une catégorie
|
||||||
@ -34,6 +35,7 @@ AddProductToCat=Ajouter ce produit
|
|||||||
ImpossibleAddCat=Impossible d'ajouter la catégorie
|
ImpossibleAddCat=Impossible d'ajouter la catégorie
|
||||||
ImpossibleAssociateCategory=Impossible d'associer la catégorie
|
ImpossibleAssociateCategory=Impossible d'associer la catégorie
|
||||||
WasAddedSuccessfully=a été ajoutée avec succès.
|
WasAddedSuccessfully=a été ajoutée avec succès.
|
||||||
|
CategorySuccessfullyCreated=La catégorie %s a été ajouté avec succčs.
|
||||||
ProductIsInCategories=Ce produit/service est dans les catégorie suivantes
|
ProductIsInCategories=Ce produit/service est dans les catégorie suivantes
|
||||||
ProductHasNoCategory=Ce produit/service n'est dans aucune catégorie en particulier
|
ProductHasNoCategory=Ce produit/service n'est dans aucune catégorie en particulier
|
||||||
ClassifyInCategory=Classer dans la catégorie
|
ClassifyInCategory=Classer dans la catégorie
|
||||||
@ -43,5 +45,4 @@ ReturnInProduct=Retour sur la fiche produit/service
|
|||||||
ContentsVisibleByAll=Le contenu sera visible par tous
|
ContentsVisibleByAll=Le contenu sera visible par tous
|
||||||
ContentsVisibleByAllShort=Contenu visible par tous
|
ContentsVisibleByAllShort=Contenu visible par tous
|
||||||
ContentsNotVisibleByAllShort=Contenu non visible par tous
|
ContentsNotVisibleByAllShort=Contenu non visible par tous
|
||||||
Desc=Description
|
CategoriesTree=Arbre des catégories
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user