Task #1153 - Boite de dialogue modale
#1153 Dialog box : implement alert + confirm_form
This commit is contained in:
parent
8888381f6f
commit
404aeebdb6
32 changed files with 284 additions and 249 deletions
|
|
@ -105,7 +105,7 @@ class Extension extends Menu_Ref_sql
|
|||
* @global type $cn
|
||||
* @param type $p_id profile.p_id
|
||||
* @param type $p_module menu_ref.me_code
|
||||
* @throws Exception 10 : profile absent 20 module absent
|
||||
* @throws Exception 10 : profile absent , 20 module absent , 30 No parent menu
|
||||
*/
|
||||
function insert_profile_menu($p_id=1,$p_module='EXT')
|
||||
{
|
||||
|
|
@ -120,12 +120,23 @@ class Extension extends Menu_Ref_sql
|
|||
if ($module->me_code==null) {
|
||||
throw new Exception(_('Module inexistant'),20);
|
||||
}
|
||||
// Dependency
|
||||
$dep_id=$cn->get_value('select pm_id from profile_menu
|
||||
where
|
||||
p_id=$1
|
||||
and me_code = $2 ',array($p_id,$p_module));
|
||||
// throw an exception if there is no dependency
|
||||
if ($dep_id=="") {
|
||||
throw new Exception(_('Pas de menu ').$p_module,30);
|
||||
}
|
||||
|
||||
$profil_menu=new Profile_Menu($cn);
|
||||
$profil_menu->me_code=$this->me_code;
|
||||
$profil_menu->me_code_dep=$p_module;
|
||||
$profil_menu->p_type_display='S';
|
||||
$profil_menu->p_id=$p_id;
|
||||
$profil_menu->pm_id_dep=$dep_id;
|
||||
|
||||
$cnt=$profil_menu->count(' where p_id=$1 and me_code = $2',array($p_id,$this->me_code));
|
||||
if ( $cnt==0) {
|
||||
$profil_menu->insert();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue