Source for file add_u.php
Documentation is available at add_u.php
* @package linea21.modules
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
<script type="text/javascript">
$(document).ready( function()
$("#user_login").val('');
var type = $("input[name='user_statut']:checked").val(); // we get current Type O || U
$.ajax({url: '../workshop/_ajax_user_autocomplete.php?type=' + type, dataType: 'json',
t.plugins['autocomplete'].setValues(r);
$("input[name='user_statut']").click(function(){
// Autocomplete initialization
var t = new $.TextboxList('#user_login', {unique: true, plugins: {autocomplete: {onlyFromValues: true}}});
$.ajax({url: '../workshop/_ajax_user_autocomplete.php?type=U', dataType: 'json', success: function(r){
t.plugins['autocomplete'].setValues(r);
if(isset ($_POST['id'])) $id= $_POST['id'];
if(isset ($_GET['id'])) $id= $_GET['id'];
//////////// Check Inclusion de pages ////////////
include_once("../lib/lib_common.php");
//////////// Check Droits utilisateur ////////////
$mask_statut_U= "checked=\"checked\"";
$result_workshop= $sql_object->DBSelect($req_det_workshop);
$workshop_denomination= formatText($result_workshop[0]['workshop_denomination'], '2HTML');
$link_cancel= $rub_link. "&todo=det&id=". $id;
if(isset ($_POST['enregistrer'])) {
$data_login= $_POST['data_login'];
$data_statut= $_POST['data_statut'];
//faire l'ajout de user avec AddUserWorkshop
$result= $workshop_object->AddUserWorkshop($id, $data_login, $data_statut , $sql_object);
$link_confirm= "confirm.php?rub=". $rub. "&todo=". $todo. "&id=". $id;
if(isset ($_POST['valider'])) {
$data_login= $_POST['user_login'];
$data_statut= $_POST['user_statut'];
$integrity= $workshop_object->CheckUsersIntegrity($data_login, $id, $sql_object, $data_statut);
if($_POST['user_statut']== 'U') $mask_statut_U= "checked=\"checked\""; else $mask_statut_U= '';
if($_POST['user_statut']== 'O') $mask_statut_O= "checked=\"checked\""; else $mask_statut_O= '';
include_once(THEME_ADMIN_PATH. "quickicons.php");
$navtitle= _t('workshop','add_new_user'). " : ". $workshop_denomination;
<li><a href="index.php" class="chemin_home"> <?php echo _t('way','home') ?></a></li>
<li><a href=" <?php echo $rub_link; ?>" id="chemin_ <?php echo $rub; ?>" class="chemin_rub"> <?php echo _t('menu','workshop')?></a></li>
<li><span> <?php echo formatnavTitle($navtitle); ?></span></li>
if(!isset ($integrity) || is_string($integrity)) {
<div class="contentcontainer"> <?php
include_once($dir. "/menurub.php");
<h2> <?php echo formatTitleh2(_t('workshop','name'). " : ". $workshop_denomination); ?></h2>
<form id="adduserworkshop" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<label for="user_login"> <?php echo _t('workshop','add_new_user_login'); ?> * : </label>
<input name="user_login" type="text" class="textfield" id="user_login" maxlength="150" value=" <?php echo $form_user_login; ?>" />
<div class="label"> <?php echo _t('workshop','add_new_user_right'); ?> * : </div>
<input name="user_statut" type="radio" id="statut_U" value="U" <?php echo $mask_statut_U; ?> />
<label for="statut_U"> <?php echo _t('statut','U'); ?></label>
<input name="user_statut" type="radio" id="statut_O" value="O" <?php echo $mask_statut_O; ?> />
<label for="statut_O"> <?php echo _t('statut','O'); ?></label>
<input name="user_statut" type="hidden" value="U" id="todo" />
<input name="id" type="hidden" value=" <?php echo $id; ?>" id="id" />
<input name="rub" type="hidden" value=" <?php echo $rub; ?>" id="rub" />
<input name="todo" type="hidden" value=" <?php echo $todo; ?>" id="todo" />
<input name="valider" type="submit" value=" <?php echo _t('btn','valid') ?>" class="button" id="valider" />
<?php include_once($dir. "/help.php"); ?></div>
<div class="contentcontainer"> <?php
include_once($dir. "/menurub.php");
<div id="content"> <?php afflinkbar($todo,$id, $lang); ?>
<h2> <?php echo _t('recap','title') ?></h2>
echo "<dl class=\"dl3\">\n";
echo "<dt>". _t('workshop','add_new_user_login'). " :</dt>\n";
echo "<dd>". $form_user_login. "</dd>\n";
echo "<dt>". _t('workshop','add_new_user_right') . "</dt>\n";
<form id="addworkshop" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<input name="id" type="hidden" value=" <?php echo $id; ?>" id="id" />
<input name="rub" type="hidden" value=" <?php echo $rub; ?>" id="rub" />
<input name="todo" type="hidden" value=" <?php echo $todo; ?>" id="todo" />
<input name="data_login" type="hidden" value=" <?php echo $data_login; ?>" id="data_login" />
<input name="data_statut" type="hidden" value=" <?php echo $data_statut; ?>" id="data_statut" />
<input name="retour" type="button" value=" <?php echo _t('btn','preview') ?>" class="button" id="retour" onclick="history.go(-1);" />
<input name="enregistrer" type="submit" value=" <?php echo _t('btn','save') ?>" class="button" id="valider" />
<?php include_once($dir. "/help.php"); ?>
|