issue #0001732 : Modification des options d'affichage pour l'arborescence du groupe

This commit is contained in:
Michael RICOIS 2013-11-14 07:20:09 +00:00
parent 47f7fc4611
commit 2f289f76f5
3 changed files with 44 additions and 21 deletions

View File

@ -1205,11 +1205,19 @@ class IdentiteController extends Zend_Controller_Action
$pctMin = $request->getParam('pctMin', 33);
$this->view->assign('pctMin', $pctMin);
$isin = $request->getParam('isin', 1);
$this->view->assign('isin', $isin);
if ($isin==0){
$stopAtIsin = false;
} else {
$stopAtIsin = true;
}
$user = new Scores_Utilisateur();
$this->view->assign('edition', $user->checkModeEdition());
$ws = new WsScores();
$result = $ws->getGroupesArbo($siren, $pctMin);
$result = $ws->getGroupesArbo($siren, $pctMin, 10, $stopAtIsin);
if ( $result!==false ) {
$infos = json_decode($result, true);

View File

@ -1,31 +1,42 @@
<style>
.jstree-default a.jstree-search { color: red; }
</style>
<style>.jstree-default a.jstree-search { color: red; }</style>
<div>Tête de groupe
<select name="isin">
<option value="1" <?php if($this->isin==1) { echo ' selected'; }?>>coté, détention minimum à 50%</option>
<option value="0" <?php if($this->isin==0) { echo ' selected'; }?>>détention minimum à 50%</option>
</select>
</div>
<div>
<?php if ( $this->edition ) {?>
<span style="margin:0 5px;"><input type="radio" name="pctMin" value="0"<?php
if ($this->pctMin == 0) echo ' checked';?>> Tout</span>
Filiales, détention minimum
<select name="pctMin">
<?php if( $this->edition ) {?>
<option value="0" <?php if($this->pctMin==0) { echo ' selected'; }?>>Tout</option>
<?php }?>
<span style="margin:0 5px;"><input type="radio" name="pctMin" value="33"<?php
if ($this->pctMin == 33) echo ' checked';?>> 33%</span>
<span style="margin:0 5px;"><input type="radio" name="pctMin" value="40"<?php
if ($this->pctMin == 40) echo ' checked';?>> 40%</span>
<span style="margin:0 5px;"><input type="radio" name="pctMin" value="50"<?php
if ($this->pctMin == 50) echo ' checked';?>> 50%</span>
<option value="33" <?php if($this->pctMin==33) { echo ' selected'; }?>>33%</option>
<option value="40" <?php if($this->pctMin==40) { echo ' selected'; }?>>40%</option>
<option value="50" <?php if($this->pctMin==50) { echo ' selected'; }?>>50%</option>
</select>
<input id="filter" type="button" value="Filtrer" style="float:right;">
</div>
<div>
<div>
<input id="text" type="text" value="">
<input id="search" type="button" value="Recherche">
<input id="search" type="button" value="Rechercher">
<input id="clear_search" type="button" value="Initialiser">
</div>
<div id="groups" class="jstree jstree-default" style="overflow:auto;"></div>
<script src="/libs/jstree/jstree.min.js"></script>
<script>
$('input[name=pctMin]').on('click', function(e){
$('#filter').on('click', function(e){
e.preventDefault();
var pct = $(this).val();
$('div#dialogarbo').load('<?=$this->url(array('controller'=>'identite','action'=>'groupesarbo','siret'=>$this->siret),null,true)?>/pctMin/'+pct);
var pct = $('select[name=pctMin] option:selected').val();
var isin = $('select[name=isin] option:selected').val();
$('div#dialogarbo').html('Chargement...').load('<?=$this->url(array(
'controller'=>'identite',
'action'=>'groupesarbo',
'siret'=>$this->siret
),null,true)?>/pctMin/'+pct+'/isin/'+isin);
});
$("#groups").jstree({
"core" : { "html_titles" : true },
"plugins" : ["themes", "json_data", "search"],

View File

@ -936,9 +936,13 @@ class WsScores
* @param int pctMin
* @param int $nbNiveaux
*/
public function getGroupesArbo($siren, $pctMin=33, $nbNiveaux=10)
public function getGroupesArbo($siren, $pctMin=33, $nbNiveaux=10, $stopAtIsin = false)
{
$filename = 'groupesarbo-'.$siren.'-'.$pctMin;
$filename = 'groupesarbo-'.$siren.'-'.$pctMin;
$filename.= '-0';
if ($stopAtIsin === true) {
$filename.= '-1';
}
if ($this->cacheWrite) {
$cache = new Cache($filename);
@ -950,7 +954,7 @@ class WsScores
$params = new StdClass;
$params->siren = $siren;
$params->pctMin = $pctMin;
$params->stopAtIsin = false;
$params->stopAtIsin = $stopAtIsin;
$params->nbNiveaux = $nbNiveaux;
$client = $this->loadClient('interne');
try {