début ajout possibilité de déterminer si le contenu d'une catégorie sera visible ou
non dans la liste des produits/services, ceci afin de pouvoir cacher les sous-produits par exemple.
This commit is contained in:
parent
af7beb0544
commit
8090967a7f
@ -110,8 +110,8 @@ class Categorie
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (label, description) ";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (label, description, visible) ";
|
||||||
$sql .= "VALUES ('".str_replace("'","''",$this->label)."', '".str_replace("'","''",$this->description)."')";
|
$sql .= "VALUES ('".str_replace("'","''",$this->label)."', '".str_replace("'","''",$this->description)."', '".$this->visible."')";
|
||||||
|
|
||||||
|
|
||||||
$res = $this->db->query ($sql);
|
$res = $this->db->query ($sql);
|
||||||
@ -176,7 +176,11 @@ class Categorie
|
|||||||
$sql.= " SET label = '".trim(str_replace("'","''",$this->label))."'";
|
$sql.= " SET label = '".trim(str_replace("'","''",$this->label))."'";
|
||||||
|
|
||||||
if (strlen (trim($this->description)) > 0)
|
if (strlen (trim($this->description)) > 0)
|
||||||
|
{
|
||||||
$sql .= ", description = '".trim(str_replace("'","''",$this->description))."'";
|
$sql .= ", description = '".trim(str_replace("'","''",$this->description))."'";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= ", visible = '".$this->visible."'";
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
|
|||||||
@ -40,6 +40,7 @@ if ($_POST["action"] == 'update' && $user->rights->categorie->creer)
|
|||||||
|
|
||||||
$categorie->label = $_POST["nom"];
|
$categorie->label = $_POST["nom"];
|
||||||
$categorie->description = $_POST["description"];
|
$categorie->description = $_POST["description"];
|
||||||
|
$categorie->visible = $_POST["visible"];
|
||||||
if($_POST['catMere'] != "-1")
|
if($_POST['catMere'] != "-1")
|
||||||
$categorie->id_mere = $_POST['catMere'];
|
$categorie->id_mere = $_POST['catMere'];
|
||||||
else
|
else
|
||||||
@ -92,6 +93,10 @@ print '<tr><td valign="top" width="30%">';
|
|||||||
<?php print $html->select_all_categories($categorie->id_mere);?>
|
<?php print $html->select_all_categories($categorie->id_mere);?>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|
||||||
|
<tr><td><?php print $langs->trans ("ContentsVisibleByAll"); ?></td><td>
|
||||||
|
<?php print $html->selectyesnonum("visible",$categorie->visible);?>
|
||||||
|
</td></tr>
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" align="center"><input type='submit' value='<?php print $langs->trans ("Modify"); ?>'></td>
|
<td colspan="2" align="center"><input type='submit' value='<?php print $langs->trans ("Modify"); ?>'></td>
|
||||||
|
|||||||
@ -58,6 +58,7 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
|
|||||||
|
|
||||||
$categorie->label = $_POST["nom"];
|
$categorie->label = $_POST["nom"];
|
||||||
$categorie->description = $_POST["description"];
|
$categorie->description = $_POST["description"];
|
||||||
|
$categorie->visible = $_POST["visible"];
|
||||||
if($_POST['catMere'] != "-1")
|
if($_POST['catMere'] != "-1")
|
||||||
$categorie->id_mere = $_POST['catMere'];
|
$categorie->id_mere = $_POST['catMere'];
|
||||||
|
|
||||||
@ -133,6 +134,9 @@ if ($user->rights->produit->creer)
|
|||||||
print '<tr><td>'.$langs->trans ("AddIn").'</td><td>';
|
print '<tr><td>'.$langs->trans ("AddIn").'</td><td>';
|
||||||
print $html->select_all_categories();
|
print $html->select_all_categories();
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
print '<tr><td>'.$langs->trans ("ContentsVisibleByAll").'</td><td>';
|
||||||
|
print $html->selectyesnonum("visible",$categorie->visible);
|
||||||
|
print '</td></tr>';
|
||||||
print '<tr><td colspan="2" align="center">';
|
print '<tr><td colspan="2" align="center">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("CreateThisCat").'" name="creation" id="creation"/>';
|
print '<input type="submit" class="button" value="'.$langs->trans("CreateThisCat").'" name="creation" id="creation"/>';
|
||||||
print '</td></tr></form>';
|
print '</td></tr></form>';
|
||||||
|
|||||||
@ -35,3 +35,4 @@ WasAddedSuccessfully=was added successfully.
|
|||||||
ProductIsInCategories=Product/Service is in following categories
|
ProductIsInCategories=Product/Service is in following categories
|
||||||
ClassifyInCategory=Classify in category
|
ClassifyInCategory=Classify in category
|
||||||
ReturnInProduct=Return in product/service card
|
ReturnInProduct=Return in product/service card
|
||||||
|
ContentsVisibleByAll=The contents will be visible by all
|
||||||
@ -37,3 +37,4 @@ ClassifyInCategory=Classer dans la cat
|
|||||||
NoneCategory=Aucune
|
NoneCategory=Aucune
|
||||||
CategoryExistsAtSameLevel=Cette catégorie existe déjà au même endroit
|
CategoryExistsAtSameLevel=Cette catégorie existe déjà au même endroit
|
||||||
ReturnInProduct=Retour sur la fiche produit/service
|
ReturnInProduct=Retour sur la fiche produit/service
|
||||||
|
ContentsVisibleByAll=Le contenu sera visible par tous
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user