fix: possibilit de crer des sous catgories ayant le mme nom
This commit is contained in:
parent
2ef242bb35
commit
411c3c6d91
@ -457,10 +457,11 @@ class Categorie
|
||||
/**
|
||||
* Vérifie si une catégorie porte le label $label
|
||||
*/
|
||||
function already_exists ($label)
|
||||
function already_exists($label)
|
||||
{
|
||||
$sql = "SELECT count(rowid) FROM ".MAIN_DB_PREFIX."categorie ";
|
||||
$sql .= "WHERE label = '".$label."'";
|
||||
$sql = "SELECT count(c.rowid)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_association as ca";
|
||||
$sql.= " WHERE c.label = '".$label."' AND c.rowid = ca.fk_categorie_fille";
|
||||
|
||||
$res = $this->db->query ($sql);
|
||||
$res = $this->db->fetch_array ($res);
|
||||
|
||||
@ -139,14 +139,14 @@ print '<tr><td valign="top" width="30%">';
|
||||
echo "<p>".$langs->trans ("ErrForgotField")." \"".$langs->trans ("Label")."\"</p>";
|
||||
$OK = false;
|
||||
}
|
||||
/* else if ($c->already_exists ($_POST["nom"]))
|
||||
else if ($c->already_exists($_POST["nom"])
|
||||
{
|
||||
// on regarde si le champ nom n'est pas déjà dans la table catégorie (rappel: un nom est unique dans la table catégorie
|
||||
// nb a déjà été renseigné, il contient le nombre de catégories
|
||||
echo "<p>".$langs->trans ("ErrCatAlreadyExists")."</p>";
|
||||
$OK = false;
|
||||
}
|
||||
*/
|
||||
|
||||
if ($_POST["description"] == '')
|
||||
{
|
||||
echo "<p>".$langs->trans ("ErrForgotField")." \"".$langs->trans ("Description")."\"</p>";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user