2012-12-13 16:23:53 +00:00
|
|
|
<form name="lienchange" method="post" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'lienchange'),null,true)?>">
|
|
|
|
|
2012-12-13 13:26:36 +00:00
|
|
|
<input type="hidden" name="idLien" value="<?=$this->idLien?>"/>
|
2012-12-13 16:23:53 +00:00
|
|
|
<input type="hidden" name="mode" value="<?=$this->mode?>"/>
|
2012-12-13 13:26:36 +00:00
|
|
|
|
|
|
|
<?php if ($this->mode=='fusion') {?>
|
|
|
|
|
2012-12-13 16:23:53 +00:00
|
|
|
<div>Fusionner la fiche <?=$this->nom?> (id=<?=$this->lienref?>)</div>
|
|
|
|
|
|
|
|
<?php } elseif ($this->mode=='moveact'){?>
|
|
|
|
|
|
|
|
<div>Déplacer l'actionnaire <?=$this->nom?> (id=<?=$this->lienref?>)</div>
|
|
|
|
|
|
|
|
<?php }elseif ($this->mode=='movepar') {?>
|
|
|
|
|
|
|
|
<div>Déplacer la participation <?=$this->nom?> (id=<?=$this->lienref?>)</div>
|
|
|
|
|
|
|
|
<?php }?>
|
2012-12-13 13:26:36 +00:00
|
|
|
|
|
|
|
<div id="searchFiche">
|
|
|
|
|
|
|
|
<div class="fieldgrp">
|
|
|
|
<label>Recherche</label>
|
|
|
|
<div class="field">
|
|
|
|
<select name="searchType">
|
|
|
|
<option value="nom">Nom</option>
|
|
|
|
<option value="siren">Siren</option>
|
|
|
|
<option value="id">Identifiant</option>
|
|
|
|
<option value="special">Spéciaux</option>
|
|
|
|
</select>
|
|
|
|
<select name="searchCountry" style="width:100px;">
|
|
|
|
<option value="">-</option>
|
|
|
|
<?php foreach($this->countries as $code => $item) {?>
|
|
|
|
<option value="<?=$code?>"<?=$select?>><?=$item['libPays']?></option>
|
|
|
|
<?php }?>
|
|
|
|
</select>
|
|
|
|
<input type="text" name="searchTxt" class="autocomplete"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
2012-12-13 16:23:53 +00:00
|
|
|
</form>
|
2012-12-13 13:26:36 +00:00
|
|
|
|
|
|
|
<script>
|
|
|
|
$('input.autocomplete').autocomplete({
|
|
|
|
minLength:4,
|
|
|
|
delay:1000,
|
|
|
|
source: function(request, response) {
|
|
|
|
var query = request.term;
|
|
|
|
var type = $('select[name=searchType]').val();
|
|
|
|
switch( type ) {
|
|
|
|
case 'siren': break;
|
|
|
|
case 'id': break;
|
|
|
|
case 'nom':
|
|
|
|
if ($('select[name=searchCountry]').val()!='') {
|
|
|
|
query = query + ',' + $('select[name=searchCountry]').val();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
$.getJSON('<?=$this->url(array('controller'=>'saisie','action'=>'liensearch'),null,true)?>', { q: query, type: type },
|
|
|
|
function(data) { response(data); }
|
|
|
|
);
|
|
|
|
},
|
|
|
|
select: function(event, ui) {
|
2012-12-13 16:23:53 +00:00
|
|
|
$('form[name=lienchange]').prepend('<input type="hidden" name="id" value="'+ui.item.value+'"/>');
|
2012-12-13 13:26:36 +00:00
|
|
|
$('div#searchFiche').replaceWith('<b>Fiche sélectionnée '+ui.item.label+' (id = '+ui.item.value+')</b>');
|
|
|
|
}
|
|
|
|
});
|
2012-12-13 16:23:53 +00:00
|
|
|
</script>
|