162 lines
4.8 KiB
PHTML
162 lines
4.8 KiB
PHTML
<script>
|
|
$(document).ready(function(){
|
|
|
|
$('a.delete').on('click', function(e){
|
|
e.preventDefault();
|
|
var href = $(this).attr('href');
|
|
var title = $(this).attr('title');
|
|
if (confirm(title)) {
|
|
document.location.href=href;
|
|
}
|
|
});
|
|
|
|
$('a.enable').on('click', function(e){
|
|
e.preventDefault();
|
|
var href = $(this).attr('href');
|
|
var title = $(this).attr('title');
|
|
if (confirm(title)) {
|
|
document.location.href=href;
|
|
}
|
|
});
|
|
|
|
$('a.disable').on('click', function(e){
|
|
e.preventDefault();
|
|
var href = $(this).attr('href');
|
|
var title = $(this).attr('title');
|
|
if (confirm(title)) {
|
|
document.location.href=href;
|
|
}
|
|
});
|
|
|
|
$('input[name=searchLogin]').autocomplete({
|
|
minLength:3,
|
|
source: function(request, response) {
|
|
$.getJSON('<?=$this->url(array('controller'=>'dashboard','action'=>'usersearch','idClient'=>$this->idClient))?>', { q: request.term },
|
|
function(data) { response(data); }
|
|
);
|
|
},
|
|
select: function (event, ui) {
|
|
var href = '<?=$this->url(array('controller'=>'dashboard','action'=>'user','op'=>'edit','idClient'=>$this->idClient))?>/login/'+ui.item.value;
|
|
document.location.href=href;
|
|
}
|
|
});
|
|
|
|
$('select[name=service]').change(function(e){
|
|
e.preventDefault();
|
|
document.location.href='<?=$this->url(array('controller'=>'dashboard','action'=>'users','idClient'=>$this->idClient),null,true)?>/service/'+$(this).val();
|
|
});
|
|
|
|
});
|
|
</script>
|
|
<div id="center">
|
|
<h1>GESTION DES CLIENTS</h1>
|
|
<div class="paragraph">
|
|
Recherche de login <input type="text" name="searchLogin"/>
|
|
<a href="<?=$this->url(array('controller'=>'dashboard','action'=>'user','op' =>'new'))?>">
|
|
Créer un profil utilisateur</a>
|
|
</div>
|
|
<h2>Services</h2>
|
|
<div class="paragraph">
|
|
<select name="service">
|
|
<option value="">Afficher tout</option>
|
|
<option value="DEFAULT"<?php if ('DEFAULT'==$this->service) echo ' selected';?>>Default</option>
|
|
<?php foreach($this->services as $service) {?>
|
|
<?php $select = ''; if ($service->code==$this->service) $select = ' selected';?>
|
|
<option value="<?=$service->code?>"<?=$select?>><?=$service->label?> (<?=$service->code?>)</option>
|
|
<?php }?>
|
|
</select>
|
|
<a href="<?=$this->url(array('controller'=>'dashboard','action'=>'service','idClient'=>$this->idClient),null,true)?>">
|
|
Editer le service</a>
|
|
| <a href="<?=$this->url(array('controller'=>'dashboard','action'=>'service','idClient'=>$this->idClient),null,true)?>">
|
|
Créer un service</a>
|
|
</div>
|
|
|
|
<h2>Liste des profils utilisateurs</h2>
|
|
<div class="paragraph">
|
|
<table id="utilisateur">
|
|
<?php if (isset($message) && $message != '') {?>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td colspan="5" class="StyleInfoData" align="center">
|
|
<h3><?=$message?></h3>
|
|
</td>
|
|
</tr>
|
|
<?php } ?>
|
|
<tr class="border titre">
|
|
<td class="StyleInfoLib">Login</td>
|
|
<td class="StyleInfoLib">Actions</td>
|
|
<td class="StyleInfoLib">Actif</td>
|
|
<td class="StyleInfoLib">Informations</td>
|
|
<td class="StyleInfoLib">Référence</td>
|
|
</tr>
|
|
<?php
|
|
if (count($this->utilisateurs)>0) {
|
|
foreach ($this->utilisateurs as $uti) {
|
|
$lienParams = ' login="'.$uti->login.'"';
|
|
?>
|
|
<tr class="border">
|
|
<td class="StyleInfoData"><?=$uti->login;?></td>
|
|
<td align="center" valign="middle">
|
|
<a href="<?=$this->url(array(
|
|
'controller' => 'dashboard',
|
|
'action' => 'user',
|
|
'op' => 'edit',
|
|
'login' => $uti->login,
|
|
))?>" class="edit">
|
|
<img src="/themes/default/images/interfaces/edit0.gif" title="Editer le profil utilisateur" width="16" height="16"/>
|
|
</a>
|
|
<a href="<?=$this->url(array(
|
|
'controller' => 'dashboard',
|
|
'action' => 'user',
|
|
'op' => 'delete',
|
|
'login' => $uti->login,
|
|
'idUti' => $uti->idUti,
|
|
))?>" class="delete" title="Supprimer l'utilisateur <?=$uti->login?>">
|
|
<img src="/themes/default/images/interfaces/delete.gif" title="Supprimer le profil utilisateur" width="11" height="11"/>
|
|
</a>
|
|
</td>
|
|
<td class="StyleInfoData">
|
|
<?php
|
|
if ($uti->actif == 1) {
|
|
?>
|
|
<a href="<?=$this->url(array(
|
|
'controller' => 'dashboard',
|
|
'action' => 'user',
|
|
'op' => 'disable',
|
|
'login' => $uti->login,
|
|
'idUti' => $uti->idUti,
|
|
))?>" class="disable" title="Désactiver le profil utilisateur <?=$uti->login?>">
|
|
<u><font color="green">Oui</font></u>
|
|
</a>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<a href="<?=$this->url(array(
|
|
'controller' => 'dashboard',
|
|
'action' => 'user',
|
|
'op' => 'enable',
|
|
'login' => $uti->login,
|
|
'idUti' => $uti->idUti,
|
|
))?>" class="enable" title="Activer le profil utilisateur <?=$uti->login?>">
|
|
<u><font color="red">Non</font></u>
|
|
</a>
|
|
<?php
|
|
}
|
|
?>
|
|
</td>
|
|
<td class="StyleInfoData">
|
|
<?=$uti->nom.' '.$uti->prenom?><br/>
|
|
<a href="mailto:<?=$uti->email?>">
|
|
<?=str_replace(array(';',','), array('<br/>', '<br/>'), $uti->email);?>
|
|
</a>
|
|
</td>
|
|
<td class="StyleInfoData"><?=$uti->reference?></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|