CFGMENU : bug cannot update menu
This commit is contained in:
parent
3577939251
commit
ab67c4bcb5
2 changed files with 4 additions and 1 deletions
|
|
@ -45,8 +45,10 @@ class Menu_Ref extends Menu_Ref_SQL
|
|||
{
|
||||
throw new Exception(_("le code ne peut être vide"));
|
||||
}
|
||||
|
||||
$this->format_code();
|
||||
if ( $this->cn->get_value("select count(*) from menu_ref where me_code=$1",array($this->me_code)) > 0)
|
||||
if (isset ($_POST['create_menu'])
|
||||
&& $this->cn->get_value("select count(*) from menu_ref where me_code=$1",array($this->me_code)) > 0)
|
||||
throw new Exception ('Doublon');
|
||||
if (trim($this->me_code)=='')
|
||||
throw new Exception ('Ce menu existe déjà');
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ if ( isset($_POST['create_menu'])|| isset($_POST['modify_menu']))
|
|||
{
|
||||
if (isset($_POST['create_menu']))
|
||||
{
|
||||
if ($menu_ref->verify() == 0)
|
||||
$menu_ref->insert();
|
||||
}
|
||||
elseif (isset($_POST['modify_menu']))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue