noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
ajax_activate_plugin.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19// Copyright Author Dany De Bontridder danydb@aevalys.eu 9/08/24
20/*!
21 * \file
22 * \brief activate a javascript for a PROFILE , receive mecode (menu_ref.me_code) , prid , (profile.p_id)
23 * and activate(true/false)
24 */
25
26if (!defined('ALLOWED'))
27 die('Appel direct ne sont pas permis');
28
29global $g_user;
30
31if ($g_user->check_module('C0PLG') == 0) die();
32
33try {
34 $me_code = $http->get("mecode");
35 $pr_id = $http->get("prid", "number");
36 $activate = $http->get("activate");
37 $depend = $http->get("dep",'string','EXT');
38 $order = $http->get("ord",'number',0);
39} catch (\Exception $e) {
40 echo $e->getMessage();
41}
42
43$extension=new \Extension($cn,$me_code);
44if ( $activate=='true') {
45 // if depend does not exist then message error
46 try {
47 $extension->depend=$depend;
48 $extension->order=$order;
49 $extension->insert_profile_menu($pr_id);
50 echo 'OK';
51
52 } catch (\Exception $e) {
53 echo $e->getMessage();
54 }
55} elseif ($activate=='false') {
56 $extension->remove_from_profile_menu($pr_id);
57 echo 'OK';
58}
global $g_user
if no group available , then stop
catch(\Exception $e) $extension
if( $delta< 0) elseif( $delta==0)