Fix: Error in creating categories
This commit is contained in:
parent
3852527ee4
commit
ded13125c8
@ -71,6 +71,7 @@ $urlfrom=isset($_REQUEST["urlfrom"])?$_REQUEST["urlfrom"]:'';
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Add action
|
||||||
if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
|
if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
|
||||||
{
|
{
|
||||||
// Action ajout d'une categorie
|
// Action ajout d'une categorie
|
||||||
@ -129,11 +130,6 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
|
|||||||
$categorie->error = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref"));
|
$categorie->error = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref"));
|
||||||
$_GET["action"] = 'create';
|
$_GET["action"] = 'create';
|
||||||
}
|
}
|
||||||
else if (! $categorie->description)
|
|
||||||
{
|
|
||||||
$categorie->error = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Description"));
|
|
||||||
$_GET["action"] = 'create';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create category in database
|
// Create category in database
|
||||||
if (! $categorie->error)
|
if (! $categorie->error)
|
||||||
@ -147,6 +143,7 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Confirm action
|
||||||
if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
|
if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
|
||||||
{
|
{
|
||||||
// Action confirmation de creation categorie
|
// Action confirmation de creation categorie
|
||||||
|
|||||||
@ -31,7 +31,7 @@ require("../main.inc.php");
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/treeview.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/treeview.lib.php");
|
||||||
|
|
||||||
$type=isset($_GET['type'])?$_GET['type']:$_POST['type'];
|
$type=isset($_GET['type'])?$_GET['type']:isset($_POST['type'])?$_POST['type']:0;
|
||||||
|
|
||||||
if (!$user->rights->categorie->lire) accessforbidden();
|
if (!$user->rights->categorie->lire) accessforbidden();
|
||||||
|
|
||||||
@ -122,7 +122,10 @@ print '<br>';
|
|||||||
|
|
||||||
|
|
||||||
// Charge tableau des categories
|
// Charge tableau des categories
|
||||||
$cate_arbo = $categstatic->get_full_arbo($_GET['type']);
|
$cate_arbo = $categstatic->get_full_arbo($type);
|
||||||
|
|
||||||
|
// Define fulltree array
|
||||||
|
$fulltree=$cate_arbo;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -133,8 +136,6 @@ print '<tr class="liste_titre"><td>'.$langs->trans("Categories").'</td><td colsp
|
|||||||
$section=isset($_GET["section"])?$_GET["section"]:$_POST['section'];
|
$section=isset($_GET["section"])?$_GET["section"]:$_POST['section'];
|
||||||
if (! $section) $section=0;
|
if (! $section) $section=0;
|
||||||
|
|
||||||
// Define fulltree array
|
|
||||||
$fulltree=$cate_arbo;
|
|
||||||
|
|
||||||
|
|
||||||
// ----- This section will show a tree from a fulltree array -----
|
// ----- This section will show a tree from a fulltree array -----
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user