noalyss Version-9
user_menu.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, Inshowc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19/*!\file
20 * \brief Nearly all the menu are here, some of them returns a HTML string, others echo
21 * directly the result.
22 */
23
24// Copyright Author Dany De Bontridder danydb@aevalys.eu
25
26
27/*! MenuAdmin
28 * \brief show the menu for user/database management
29 * \return HTML code with the menu
30 */
31
32function MenuAdmin()
33{
34 $def=-1;
35 $http=new HttpInput();
36
37 if (isset($_REQUEST['UID']))
38 $def=0;
39 if ( isset ($_REQUEST['action']))
40 {
41 $action=$http->request('action');
42 switch ($action)
43 {
44 case 'user_mgt':
45 $def=0;
46 break;
47 case 'dossier_mgt':
48 $def=1;
49 break;
50 case 'modele_mgt':
51 $def=2;
52 break;
53 case 'audit_log':
54 $def=4;
55 break;
56 case 'restore':
57 $def=3;
58 break;
59 case 'upgrade':
60 $def = 5;
61 break;
62 case 'info':
63 $def=6;
64 break;
65 }
66 }
67 if (!defined("MULTI")||(defined("MULTI")&&MULTI==1))
68 {
69 $tmp_item=array (
70 array("admin-noalyss.php?action=user_mgt",_("Utilisateurs"),_('Gestion des utilisateurs'),0),
71 array("admin-noalyss.php?action=dossier_mgt",_("Dossiers"),_('Gestion des dossiers'),1),
72 array("admin-noalyss.php?action=modele_mgt",_("Modèles"),_('Gestion des modèles'),2),
73 array("admin-noalyss.php?action=restore",_("Restaure"),_("Restaure une base de données"),3),
74 array("admin-noalyss.php?action=upgrade",_("Installation"),
75 _("Installation Mise à jour du système et des bases de données"),5),
76 array("admin-noalyss.php?action=audit_log",_("Audit"),_("Utilisateurs qui se sont connectés"),4),
77 array("admin-noalyss.php?action=info",
78 _("Information système"),('Information à propos de votre installation'),6),
79 array("login.php",_("Accueil"),"",7),
80 array("logout.php",_("Sortie"),"",8)
81 );
82 if ( SYSINFO_DISPLAY == false ) {
83 $nb_item = count($tmp_item);
84 for ($i=0;$i<$nb_item;$i++) {
85 if ($tmp_item[$i][3] <> 6 ) {
86 $item[]=$tmp_item[$i];
87 }
88 }
89 } else {
90 $item = $tmp_item;
91 }
92 }
93 else
94 {
95 $item=array (array("admin-noalyss.php?action=user_mgt",_("Utilisateurs"),_('Gestion des utilisateurs'),0),
96 array("admin-noalyss.php?action=audit_log",_("Audit"),_("Utilisateurs qui se sont connectés"),4),
97 array("admin-noalyss.php?action=info",
98 _("Information système"),('Information à propos de votre installation'),6),
99 array("login.php",_("Accueil")),
100 array("logout.php",_("Sortie"))
101 );
102
103 }
104 $menu=ShowItem($item,'H',"nav-item","nav-link",$def,'nav nav-pills nav-fill ');
105 return $menu;
106}
107
108/*!
109 * \brief Show the menu from the pcmn page
110 *
111 * \param $p_start class start default=1
112 *
113 *
114 *
115 * \return nothing
116 *
117 *
118 */
119
121{
122 $http=new HttpInput();
123 $base="?ac=".$http->request('ac');
124 $str_dossier="&".dossier::get();
125 for ($i=0;$i<10;$i++) { $class[$i]="tabs";}
126 $class[$p_start]="tabs_selected";
127 $idx=0;
128 ?>
129 <ul class="tabs">
130 <li class="<?php echo $class[$idx];$idx++; ?>"><A HREF="<?php echo $base.'&p_start=0'.$str_dossier; ?>">0 <?php echo _(' Hors Bilan')?></A></li>
131 <li class="<?php echo $class[$idx];$idx++; ?>"><A HREF="<?php echo $base.'&p_start=1'.$str_dossier; ?>">1 <?php echo _(' Immobilisé')?></A></li>
132 <li class="<?php echo $class[$idx];$idx++; ?>"><A HREF="<?php echo $base.'&p_start=2'.$str_dossier; ?>">2 <?php echo _('Actif a un an au plus')?></A></li>
133 <li class="<?php echo $class[$idx];$idx++; ?>"><A HREF="<?php echo $base.'&p_start=3'.$str_dossier; ?>">3 <?php echo _('Stock et commande')?></A></li>
134 <li class="<?php echo $class[$idx];$idx++; ?>"><A HREF="<?php echo $base.'&p_start=4'.$str_dossier; ?>">4 <?php echo _('Compte tiers')?></A></li>
135 <li class="<?php echo $class[$idx];$idx++; ?>"><A HREF="<?php echo $base.'&p_start=5'.$str_dossier; ?>">5 <?php echo _('Financier')?></A></li>
136 <li class="<?php echo $class[$idx];$idx++; ?>"><A HREF="<?php echo $base.'&p_start=6'.$str_dossier; ?>">6 <?php echo _('Charges')?></A></li>
137 <li class="<?php echo $class[$idx];$idx++; ?>"><A HREF="<?php echo $base.'&p_start=7'.$str_dossier; ?>">7 <?php echo _('Produits')?></A></li>
138 <li class="<?php echo $class[$idx];$idx++; ?>"><A HREF="<?php echo $base.'&p_start=8'.$str_dossier; ?>">8 <?php echo _('Hors Comptabilité')?></A></li>
139 <li class="<?php echo $class[$idx];$idx++; ?>"><A HREF="<?php echo $base.'&p_start=9'.$str_dossier; ?>">9 <?php echo _('Hors Comptabilité')?></A></li>
140 </ul>
141<div style="clear: both"></div>
142<?php
143}
144?>
ShowItem($p_array, $p_dir='V', $class="nav-item", $class_ref="nav-link", $default="", $p_extra="nav nav-pills nav-fill")
store the string which print the content of p_array in a table used to display the menu
Definition: ac_common.php:535
$base
Definition: action.inc.php:56
$action
$idx
$opd_description style
$_REQUEST['ac']
$str_dossier
Definition: anc_od.inc.php:33
$class
manage the http input (get , post, request) and extract from an array
$def
show a form for quick_writing
$p_start
menu_acc_plan($p_start=1)
Show the menu from the pcmn page.
Definition: user_menu.php:120
MenuAdmin()
show the menu for user/database management
Definition: user_menu.php:32