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 ?>
00037 <hr>
00038 <h1>Profil <?php echo $profile->p_name?></h1>
00039 <?php if ($p_id > 0 ) : ?>
00040 <a href="javascript:void(0)" class="line" onclick="profile_show('profile_gen_div')"><?php echo _('Nom')?></a>&nbsp;
00041 <a href="javascript:void(0)" class="line" onclick="profile_show('profile_menu_div')"><?php echo _('Détail Menus')?></a>&nbsp;
00042 <a href="javascript:void(0)" class="line" onclick="profile_show('profile_print_div')"><?php echo _('Détail Impressions')?></a>&nbsp;
00043 <a href="javascript:void(0)" class="line" style="" onclick="profile_show('profile_gestion_div')"><?php echo _('Action Gestion')?> </a>&nbsp;
00044 <a href="javascript:void(0)" class="line" onclick="profile_show('profile_repo_div')"><?php echo _('Dépôts')?></a>&nbsp;
00045 <?php endif; ?>
00046 
00047 <?php 
00048 $id=HtmlInput::hidden('p_id',$profile->p_id);
00049 $name=new IText("p_name",$profile->p_name);
00050 $desc=new IText("p_desc",$profile->p_desc);
00051 $with_calc=new ICheckBox("with_calc","t");
00052 $with_calc->set_check($profile->with_calc);
00053 
00054 $with_direct_form=new ICheckBox("with_direct_form","t");
00055 $with_direct_form->set_check($profile->with_direct_form);
00056 
00057 // If $p_id == -1 it is a new profile
00058 if ( $p_id > 0 )
00059 {
00060         echo '<div style="display:none" id="profile_gen_div">';
00061 }
00062 else
00063 {
00064         echo '<div  id="profile_gen_div">';
00065 }
00066 echo '<form method="POST" onsubmit="return confirm (\'vous confirmez\')">';
00067 echo HtmlInput::hidden('tab','profile_gen_div');
00068 echo HtmlInput::hidden('p_id',$profile->p_id);
00069 require_once("template/profile.php");
00070 echo HtmlInput::submit("save_name",_("Modifier"));
00071 echo '</form>';
00072 if ($profile->p_id > 0)
00073 {
00074         echo '<form method="POST" onsubmit="return confirm (\''._("vous confirmez").'\')">';
00075 
00076         echo 'Vous pouvez aussi copier ce profil et puis le corriger';
00077 
00078         echo HtmlInput::hidden('p_id', $profile->p_id);
00079         echo HtmlInput::submit("clone", "Copier");
00080         echo '</form>';
00081 
00082         echo '<form method="POST" onsubmit="return confirm (\''._("vous confirmez").'\')">';
00083 
00084         echo 'Effacer ce profil';
00085 
00086         echo HtmlInput::hidden('p_id', $profile->p_id);
00087         echo HtmlInput::submit("delete_profil", _("Effacer ce profil"));
00088         echo '</form>';
00089         echo '</div>';
00090         echo '<div style="display:none" id="profile_menu_div">';
00091         //Menu / Module /plugin in this profile
00092         echo "<h2>Menu</h2>";
00093         echo $add_menu;
00094         $profile_menu = new Profile_Menu($cn);
00095         $profile_menu->listing_profile($p_id);
00096         echo '</div>';
00097         echo '<div style="display:none" id="profile_print_div">';
00098         echo "<h2>"._("Impression")."</h2>";
00099         $profile_menu->printing($p_id);
00100         echo $add_impression;
00101         echo '</div>';
00102         echo '<div style="display:none" id="profile_gestion_div">';
00103         echo "<h2>Action gestion accessible</h2>";
00104         $profile_menu->available_profile($p_id);
00105         echo '</div>';
00106         echo '<div style="display:none" id="profile_repo_div">';
00107         echo "<h2>Dépôt de stock accessible</h2>";
00108         $profile_menu->available_repository($p_id);
00109         echo '</div>';
00110         if ( isset ($_POST['tab']))
00111         {
00112             echo create_script("profile_show('".$_POST['tab']."');");
00113         }
00114 }
00115 else
00116 {
00117         echo '</div>';
00118 }
00119 ?>
00120 
00121 
 All Data Structures Namespaces Files Functions Variables Enumerations