noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
mobile.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * PhpCompta is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * PhpCompta is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with PhpCompta; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20// Copyright (2002-2021) Author Dany De Bontridder <danydb@noalyss.eu>
21
22/**
23 * @file
24 * @brief only for mobile device
25 */
26
27if ( !defined ("ALLOWED") ) { define ('ALLOWED',true); }
28
29require_once '../include/constant.php';
30require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
31MaintenanceMode("block.html");
32
33global $g_user;
34
36$g_user=new \Noalyss_User($cn);
37$g_user->check();
38
39//-----------------------------------------------------------------
40/// if $_REQUEST['gDossier'] is not set then select the folder
41//-----------------------------------------------------------------
43
44$dossier_id=$http->request("gDossier","number",-1);
45if ($dossier_id === -1) {
46 // count the available folder
47 $cnt_folder=$g_user->get_available_folder();
48
49 // if there is no available folder , then exit
50 if ($cnt_folder==0) {
51 echo _("Aucun dossier disponible");
52 redirect(NOALYSS_URL."/index.php", 3);
53 return;
54 }
55 if (count($cnt_folder ) == 1) {
56 // if only one folder available , connect to it
57 $dossier_id=$cnt_folder[0]['dos_id'];
58 put_global(array(['key'=>'gDossier',"value"=>$dossier_id]));
59 } else {
60 $mobile=new \Noalyss\Mobile();
61 //-----------------------------------------------------------------
62 // --- load the javascript and start a page ----------------------
63 //-----------------------------------------------------------------
64 $mobile->page_start();
65 // propose to select the available folder
66 echo '<ul class="nav bg-light flex-column">';
67 foreach ($cnt_folder as $folder)
68 {
69 echo '<li>';
70 echo '<a class="nav-item nav-link " href="mobile.php?gDossier='.$folder['dos_id'].'">';
71 echo $folder['dos_id']." ".$folder['dos_name']." ".$folder["dos_description"];
72 echo '</a>';
73 echo '</li>';
74 }
75 echo '</ul>';
76 return;
77 }
78
79}
80// we are connected to a folder
81global $g_user,$cn;
83$g_user->setDb($cn);
84
87$mobile=new \Noalyss\Mobile();
88
89$ac=trim($http->request("ac","string",""));
90
91//-----------------------------------------------------------------
92/// If a module is selected the execute it
93//-----------------------------------------------------------------
94if ( $ac !== "" && $g_user->check_module($ac) == 1) {
95
96 // if $ac is in the mobile profile then execute it
97 $mobile->execute_menu($ac);
98} else {
99//-----------------------------------------------------------------
100/// inside a folder , propose a menu
101//-----------------------------------------------------------------
102 $mobile->page_start();
103 $mobile->display_menu();
104}
MaintenanceMode($p_file)
When you want to prevent users to connect, create a file in noalyss/ (NOALYSS_BASE) with the message ...
put_global($array)
Put in superglobal (get,post,request) the value contained in the parameter field (me_parameter)
global $g_parameter
global $g_user
if no group available , then stop
$dossier_id
if(isset( $_REQUEST[ 'show'])) if(isset($_REQUEST['del'])) $ac
_("actif, passif,charge,...")
contains the class for connecting to Noalyss
static connect()
manage the http input (get , post, request) and extract from an array
Class to manage the company parameter (address, name...)
$mobile
Definition mobile.php:87
$folder
Definition test.php:76
redirect( $p_string, $p_time=0)
redirect with javascript