noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
ajax_get_profile.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  *   This file is part of NOALYSS.
00005  *
00006  *   NOALYSS is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License as published by
00008  *   the Free Software Foundation; either version 2 of the License, or
00009  *   (at your option) any later version.
00010  *
00011  *   NOALYSS is distributed in the hope that it will be useful,
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *   GNU General Public License for more details.
00015  *
00016  *   You should have received a copy of the GNU General Public License
00017  *   along with NOALYSS; if not, write to the Free Software
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00022 
00023 /**
00024  * @file
00025  * @brief show the profile detail, included from ajax_misc.php
00026  * @see ajax_misc.php scripts.js profile.inc.php
00027  *
00028  */
00029 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00030 require_once 'class_profile_sql.php';
00031 require_once 'class_profile_menu.php';
00032 $profile=new Profile_sql($cn,$p_id);
00033 $gDossier=Dossier::id();
00034 $add_menu=HtmlInput::button("add", "Ajout Menu","onclick=\"add_menu({dossier:$gDossier,p_id:$p_id,type:'me'})\"");
00035 $add_impression=HtmlInput::button("add", "Ajout Menu","onclick=\"add_menu({dossier:$gDossier,p_id:$p_id,type:'pr'})\"");
00036 $call_tab=HtmlInput::default_value_post('tab', 'none');
00037 $a_tab=array('profile_gen_div'=>'tabs','profile_menu_div'=>'tabs','profile_print_div'=>'tabs','profile_gestion_div'=>'tabs','profile_repo_div'=>'tabs');
00038 $a_tab[$call_tab]='tabs_selected';
00039 ?>
00040 <hr>
00041 <h1>Profil <?php echo $profile->p_name?></h1>
00042 <?php if ($p_id > 0 ) : ?>
00043 <ul class="tabs">
00044     
00045     <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>
00046     <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>
00047     <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>
00048     <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 _('Action Gestion')?> </a></li>
00049     <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;
00050 </ul>
00051 <?php endif; ?>
00052 
00053 <?php 
00054 $id=HtmlInput::hidden('p_id',$profile->p_id);
00055 $name=new IText("p_name",$profile->p_name);
00056 $desc=new IText("p_desc",$profile->p_desc);
00057 $with_calc=new ICheckBox("with_calc","t");
00058 $with_calc->set_check($profile->with_calc);
00059 
00060 $with_direct_form=new ICheckBox("with_direct_form","t");
00061 $with_direct_form->set_check($profile->with_direct_form);
00062 
00063 // If $p_id == -1 it is a new profile
00064 if ( $p_id > 0 )
00065 {
00066         echo '<div style="display:none" id="profile_gen_div">';
00067 }
00068 else
00069 {
00070         echo '<div  class="myfieldset" id="profile_gen_div">';
00071 }
00072 echo '<form method="POST" onsubmit="return confirm (\'vous confirmez\')">';
00073 echo HtmlInput::hidden('tab','profile_gen_div');
00074 echo HtmlInput::hidden('p_id',$profile->p_id);
00075 require_once("template/profile.php");
00076 echo HtmlInput::submit("save_name",_("Modifier"));
00077 echo '</form>';
00078 if ($profile->p_id > 0)
00079 {
00080         echo '<form method="POST" onsubmit="return confirm (\''._("vous confirmez").'\')">';
00081 
00082         echo 'Vous pouvez aussi copier ce profil et puis le corriger';
00083 
00084         echo HtmlInput::hidden('p_id', $profile->p_id);
00085         echo HtmlInput::submit("clone", "Copier");
00086         echo '</form>';
00087 
00088         echo '<form method="POST" onsubmit="return confirm (\''._("vous confirmez").'\')">';
00089 
00090         echo _('Effacer ce profil');
00091 
00092         echo HtmlInput::hidden('p_id', $profile->p_id);
00093         echo HtmlInput::submit("delete_profil", _("Effacer ce profil"));
00094         echo '</form>';
00095         echo '</div>';
00096         echo '<div class="myfieldset"  style="display:none" id="profile_menu_div">';
00097         //Menu / Module /plugin in this profile
00098         echo "<h1 class=\"legend\">"."Menu"."</h2>";
00099         echo $add_menu;
00100         $profile_menu = new Profile_Menu($cn);
00101         $profile_menu->listing_profile($p_id);
00102         echo '</div>';
00103         echo '<div class="myfieldset"  style="display:none" id="profile_print_div">';
00104         echo "<h1 class=\"legend\">"._("Impression")."</h1>";
00105         $profile_menu->printing($p_id);
00106         echo $add_impression;
00107         echo '</div>';
00108         echo '<div class="myfieldset"  style="display:none" id="profile_gestion_div">';
00109         echo "<h1 class=\"legend\">Action gestion accessible</h1>";
00110         $profile_menu->available_profile($p_id);
00111         echo '</div>';
00112         echo '<div class="myfieldset"  style="display:none" id="profile_repo_div">';
00113         echo "<h1 class=\"legend\">"."Dépôt de stock accessible"."</h1>";
00114         $profile_menu->available_repository($p_id);
00115         echo '</div>';
00116         if ( isset ($_POST['tab']))
00117         {
00118             echo create_script("profile_show('".$_POST['tab']."');");
00119         }
00120 }
00121 else
00122 {
00123         echo '</div>';
00124 }
00125 ?>
00126 
00127 
 All Data Structures Namespaces Files Functions Variables Enumerations