noalyss Version-9
ajax_get_profile.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS 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 * NOALYSS 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 NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21// Copyright Author Dany De Bontridder danydb@aevalys.eu
22
23/**
24 * @file
25 * @brief show the profile detail, included from ajax_misc.php
26 * @see ajax_misc.php scripts.js profile.inc.php
27 *
28 */
29if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
30
31// Security
32if ( $g_user->check_module('CFGPRO') == 0 ) die();
33
34require_once NOALYSS_INCLUDE.'/database/profile_sql.class.php';
36
37$p_id=$http->request('p_id',"string", -1);
40$add_impression=HtmlInput::button("add", _("Ajout Menu"),"onclick=\"add_menu({dossier:$gDossier,p_id:$p_id,type:'pr'})\"");
41$call_tab=$http->post('tab', "string",'profile_gen_div');
42$a_tab=array('profile_gen_div'=>'tabs','profile_menu_div'=>'tabs','profile_print_div'=>'tabs','profile_gestion_div'=>'tabs','profile_repo_div'=>'tabs',"profile_menu_mobile_div"=>"tabs");
43$a_tab[$call_tab]='tabs_selected';
44?>
45<h1>Profil <?php echo $profile->p_name?></h1>
46<?php
47 echo HtmlInput::anchor("&#10094;"._('Retour'), "", " onclick = \" $('detail_profile').hide();$('list_profile').show(); \" ", 'class="line"');
48?>
49<?php if ($p_id > 0 ) : ?>
50<ul class="tabs">
51
52 <li class="<?php echo $a_tab['profile_gen_div']?>"><a href="javascript:void(0)" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';profile_show('profile_gen_div')"><?php echo _('Nom')?></a></li>
53 <li class="<?php echo $a_tab['profile_menu_div']?>"><a href="javascript:void(0)" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';profile_show('profile_menu_div')"><?php echo _('Détail Menus')?></a></li>
54 <li class="<?php echo $a_tab['profile_menu_mobile_div']?>"><a href="javascript:void(0)" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';profile_show('profile_menu_mobile_div')"><?php echo _('Menu SmartPhone')?></a></li>
55 <li class="<?php echo $a_tab['profile_print_div']?>"><a href="javascript:void(0)" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';profile_show('profile_print_div')"><?php echo _('Détail Impressions')?></a></li>
56 <li class="<?php echo $a_tab['profile_gestion_div']?>"><a href="javascript:void(0)" style="" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';profile_show('profile_gestion_div')"><?php echo _('Groupe Gestion')?> </a></li>
57 <li class="<?php echo $a_tab['profile_repo_div']?>"><a href="javascript:void(0)" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';profile_show('profile_repo_div')"><?php echo _('Dépôts')?></a>&nbsp;
58</ul>
59
60<div style="clear: both"></div>
61
62<?php endif; ?>
63
64<?php
66$name=new IText("p_name",$profile->p_name);
67$desc=new IText("p_desc",$profile->p_desc);
68$with_calc=new ICheckBox("with_calc","t");
69$with_calc->set_check($profile->with_calc);
70
71$with_direct_form=new ICheckBox("with_direct_form","t");
72$with_direct_form->set_check($profile->with_direct_form);
73
74$with_search_card=new ICheckBox("with_search_card",1);
75$with_search_card->set_check($profile->with_search_card);
76
77// If $p_id == -1 it is a new profile
78if ( $p_id > 0 )
79{
80 echo '<div style="display:none" id="profile_gen_div">';
81}
82else
83{
84 echo '<div class="myfieldset" id="profile_gen_div">';
85}
86echo '<form method="POST" id="profile_save_name_frm" onsubmit="return confirm_box(this,\'vous confirmez\')">';
87echo HtmlInput::hidden('tab','profile_gen_div');
88echo HtmlInput::hidden('p_id',$profile->p_id);
89echo HtmlInput::hidden('save_name',1);
90require_once NOALYSS_TEMPLATE."/profile.php";
91echo HtmlInput::submit("save_namebt",_("Modifier"));
92echo '</form>';
93if ($profile->p_id > 0)
94{
95 echo '<form method="POST" id="profile_clone_frm" onsubmit="return confirm_box(this,\''._("vous confirmez").'\')">';
96
97 echo _('Vous pouvez aussi copier ce profil et puis le corriger');
98
99 echo HtmlInput::hidden('p_id', $profile->p_id);
100 echo HtmlInput::hidden('clone', 1);
101 echo HtmlInput::submit("clonebt", "Copier");
102 echo '</form>';
103
104 echo '<form method="POST" id="delete_profile_frm" onsubmit="return confirm_box(this,\''._("vous confirmez").'\')">';
105
106 echo _('Effacer ce profil');
107
108 echo HtmlInput::hidden('p_id', $profile->p_id);
109 echo HtmlInput::hidden('delete_profil', 1);
110 echo HtmlInput::submit("delete_profil", _("Effacer ce profil"));
111 echo '</form>';
112 echo '</div>';
113 echo '<div class="myfieldset" style="display:none" id="profile_menu_div">';
114 //Menu / Module /plugin in this profile
115 $profile_menu = new Profile_Menu($cn);
116 $profile_menu->p_id=$p_id;
117 $profile_menu->display_profile_menu_detail();
118 echo '</div>';
119
120
121 echo '<div class="myfieldset" style="display:none" id="profile_menu_mobile_div">';
122 $profile_menu->mobile_device();
123 echo '</div>';
124
125 echo '<div class="myfieldset" style="display:none" id="profile_print_div">';
126 echo "<h1 class=\"legend\">"._("Impression")."</h1>";
127 $profile_menu->printing();
128 echo $add_impression;
129 echo '</div>';
130 echo '<div class="myfieldset" style="display:none" id="profile_gestion_div">';
131
132 $profile_menu->available_profile();
133 echo '</div>';
134 echo '<div class="myfieldset" style="display:none" id="profile_repo_div">';
135 echo "<h1 class=\"legend\">"._("Dépôt de stock accessible")."</h1>";
136 $profile_menu->available_repository();
137 echo '</div>';
138 echo create_script("profile_show('".$call_tab."');");
139}
140else
141{
142 echo '</div>';
143}
144?>
145
146
h1($p_string, $p_class="")
Definition: ac_common.php:72
for display
global $g_user
if no group available , then stop
$add_impression
$with_search_card
</ul >< div style="clear: both"></div > endif
$with_direct_form
$with_calc
$opd_description style
static id()
return the 'gDossier' value after a check
static button($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
static anchor($p_text, $p_url="", $p_js="", $p_style=' class="line" ', $p_title="click", array $p_attribute=[])
Return a simple anchor with a url or a javascript if $p_js is not null then p_url will be javascript:...
static hidden($p_name, $p_value, $p_id="")
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
manage the http input (get , post, request) and extract from an array
Html Input.
Html Input.
Definition: itext.class.php:30
Manage the table public.profile.
create_script($p_string)
create the HTML for adding the script tags around of the script