Impression image groupes

This commit is contained in:
Michael RICOIS 2013-11-25 13:10:02 +00:00
parent d065bf4512
commit 73cca115ce
3 changed files with 3004 additions and 2 deletions

View File

@ -1191,13 +1191,13 @@ class IdentiteController extends Zend_Controller_Action
$this->view->assign('lon', $lon);
}
public function groupesarboAction()
public function groupesarboimgAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$siren = substr($this->siret,0,9);
$this->view->assign('siret', $siren);
$request = $this->getRequest();
$pctMin = $request->getParam('pctMin', 33);
$this->view->assign('pctMin', $pctMin);
@ -1236,18 +1236,67 @@ class IdentiteController extends Zend_Controller_Action
}
}
public function groupesarboAction()
{
$this->_helper->layout()->disableLayout();
$siren = substr($this->siret,0,9);
$this->view->assign('siret', $siren);
$request = $this->getRequest();
$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, 10, $stopAtIsin);
if ( $result!==false ) {
$infos = json_decode($result, true);
Zend_Registry::get('firebug')->info($infos);
if (count($infos)>0) {
$sirenTxt = substr($infos['siren'],0,3).' '.substr($infos['siren'],3,3).' '.substr($infos['siren'],6,3);
$name = $infos['name'];
if ( $infos['siren']!='000000000' ) {
$name.= ' ('.$sirenTxt.')';
}
$structure = array();
$structure[] = array(
'data' => $name,
'state' => 'open',
'children' => $this->groupesArboChildren($infos['children'], $siren),
);
$this->view->assign('data', json_encode($structure));
}
}
}
public function groupesArboChildren($items, $detectSiren = '')
{
$output = array();
if ( count($items)>0 ) {
foreach ( $items as $item ) {
$sirenTxt = substr($infos['siren'],0,3).' '.substr($infos['siren'],3,3).' '.substr($infos['siren'],6,3);
$name = $item['name'];
if ( intval($item['siren'])!=0 ) {
$name.= ' (<a href="'.$this->view->url(array(
'controller'=>'identite',
'action'=>'fiche',
'siret' => $item['siren']), null, true).'">'.$item['siren'].'</a>)';
'siret' => $item['siren']), null, true).'">'.$sirenTxt.'</a>)';
} else {
$name.= ' ('.$item['pays'].')';
}

View File

@ -0,0 +1,85 @@
<style>
.jstree-default li,
.jstree-default ins { background-image:url("/libs/jstree/themes/default/d.png"); background-repeat:no-repeat; background-color:transparent; }
.jstree-default li { background-position:-90px 0; background-repeat:repeat-y; }
.jstree-default li.jstree-last { background:transparent; }
.jstree-default .jstree-open > ins { background-position:-72px 0; }
.jstree-default .jstree-closed > ins { background-position:-54px 0; }
.jstree-default .jstree-leaf > ins { background-position:-36px 0; }
.jstree-default .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; }
.jstree-default .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; }
.jstree-default a .jstree-icon { background-position:-56px -19px; }
.jstree-default a.jstree-loading .jstree-icon { background:url("/libs/jstree/themes/default/throbber.gif") center center no-repeat !important; }
.jstree-default.jstree-focused { background:#ffffee; }
.jstree-default .jstree-no-dots li,
.jstree-default .jstree-no-dots .jstree-leaf > ins { background:transparent; }
.jstree-default .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
.jstree-default .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
.jstree-default .jstree-no-icons a .jstree-icon { display:none; }
.jstree-default .jstree-search { font-style:italic; }
.jstree-default .jstree-no-icons .jstree-checkbox { display:inline-block; }
.jstree-default .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
.jstree-default .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
.jstree-default .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
.jstree-default .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
.jstree-default .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
.jstree-default .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
.jstree-default .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
#jstree-marker.jstree-default { background:url("/libs/jstree/themes/default/d.png") -41px -57px no-repeat !important; text-indent:-100px; }
.jstree-default a.jstree-search { color:aqua; }
.jstree-default .jstree-locked a { color:silver; cursor:default; }
</style>
<div id="center">
<div class="paragraph">
<div id="groups" class="jstree jstree-default"></div>
<div>Tête de groupe
<?php if($this->isin==1) { ?> coté, détention minimum à 50%.<?php }?>
<?php if($this->isin==0) { ?> détention minimum à 50%.<?php }?>
</div>
<div>Filiales, détention minimum à
<?php if($this->pctMin==0) {?> Tout<?php }?>
<?php if($this->pctMin==33) {?> 33%<?php }?>
<?php if($this->pctMin==40) {?> 40%<?php }?>
<?php if($this->pctMin==50) {?> 50%<?php }?>
</div>
</div>
</div>
<script src="/libs/jstree/jstree.min.js"></script>
<script src="/libs/html2canvas.js"></script>
<script>
$("#groups").jstree({
"core" : { "html_titles" : true },
"plugins" : ["themes", "json_data", "search"],
"json_data" : { "data" : [<?=$this->data?>] },
"search" : { "show_only_matches" : true },
"themes" : {
"theme" : "default",
"url" : "/libs/jstree/themes/default/style.css",
"dots" : true,
"icons" : false
}
});
$(document).ready(function(){
var target = $('#groups');
html2canvas(target, {
onrendered: function(canvas) {
target.html(canvas);
},
});
//window.print(); window.close();
});
</script>

2868
public/libs/html2canvas.js Normal file

File diff suppressed because it is too large Load Diff