124 lines
3.3 KiB
PHP
124 lines
3.3 KiB
PHP
<?php
|
|
class DirigeantController extends Zend_Controller_Action
|
|
{
|
|
protected $siret;
|
|
protected $id;
|
|
|
|
public function init()
|
|
{
|
|
$request = $this->getRequest();
|
|
$this->siret = $request->getParam('siret');
|
|
$this->id = $request->getParam('id', 0);
|
|
|
|
require_once 'Scores/WsScores.php';
|
|
require_once 'Scores/SessionEntreprise.php';
|
|
require_once 'common/dates.php';
|
|
}
|
|
|
|
/**
|
|
* Forward
|
|
*/
|
|
public function indexAction()
|
|
{
|
|
$this->_forward('index', 'index');
|
|
}
|
|
|
|
/**
|
|
* Affichage de la liste des dirigeants
|
|
*/
|
|
public function listeAction()
|
|
{
|
|
$siren = substr($this->siret, 0, 9);
|
|
|
|
$this->view->headTitle()->append('Liste des dirigeants');
|
|
$this->view->headTitle()->append('Siret '.$this->siret);
|
|
|
|
$ws = new WsScores();
|
|
$infos = $ws->getDirigeants($siren);
|
|
|
|
if ($infos === false){
|
|
$this->_forward('soap', 'error');
|
|
}
|
|
|
|
$dirigeants = $infos->result->item;
|
|
|
|
$session = new SessionEntreprise($this->siret, $this->id);
|
|
|
|
$user = new Scores_Utilisateur();
|
|
if ($user->checkPerm('dirigeantsop')){
|
|
$href = $this->view->url(array('controller'=>'dirigeant', 'action'=>'op', 'siret'=>$this->siret));
|
|
$this->view->assign('dirigeantsop', $href);
|
|
}
|
|
|
|
$this->view->assign('siren', $siren);
|
|
$this->view->assign('siret', $this->siret);
|
|
$this->view->assign('raisonSociale', $session->getRaisonSociale());
|
|
$this->view->assign('dirigeants', $dirigeants);
|
|
$this->view->assign('exportObjet', $dirigeants);
|
|
|
|
$this->view->assign('AutrePage', $this->getRequest()->getParam('apage'));
|
|
$this->view->assign('surveillance', $user->checkPerm('survdirigeants'));
|
|
}
|
|
|
|
/**
|
|
* Affichage de l'historiques des dirigeants
|
|
*/
|
|
public function histoAction()
|
|
{
|
|
$siren = substr($this->siret, 0, 9);
|
|
|
|
$this->view->headTitle()->append('Historique des dirigeants');
|
|
$this->view->headTitle()->append('Siret '.$this->siret);
|
|
|
|
$ws = new WsScores();
|
|
$infos = $ws->getDirigeants($siren, true);
|
|
|
|
if ($infos === false){
|
|
$this->_forward('soap', 'error');
|
|
}
|
|
|
|
$dirigeants = $infos->result->item;
|
|
|
|
$session = new SessionEntreprise($this->siret, $this->id);
|
|
|
|
$this->view->assign('dirigeants', $dirigeants);
|
|
$this->view->assign('exportObjet', $dirigeants);
|
|
$this->view->assign('siren', $siren);
|
|
$this->view->assign('siret', $this->siret);
|
|
$this->view->assign('raisonSociale', $session->getRaisonSociale());
|
|
$this->view->assign('infos', $infos);
|
|
|
|
$user = new Scores_Utilisateur();
|
|
$this->view->assign('surveillance', $user->checkPerm('survdirigeants'));
|
|
}
|
|
|
|
public function opAction()
|
|
{
|
|
$siren = substr($this->siret, 0, 9);
|
|
|
|
$this->view->headTitle()->append('Liste des dirigeants opérationnels');
|
|
$this->view->headTitle()->append('Siret '.$this->siret);
|
|
|
|
$ws = new WsScores();
|
|
$infos = $ws->getDirigeantsOp($siren);
|
|
|
|
if ($infos === false){
|
|
$this->_forward('soap', 'error');
|
|
}
|
|
|
|
$dirigeants = $infos->item;
|
|
|
|
$session = new SessionEntreprise($this->siret, $this->id);
|
|
|
|
$this->view->assign('siren', $siren);
|
|
$this->view->assign('siret', $this->siret);
|
|
$this->view->assign('raisonSociale', $session->getRaisonSociale());
|
|
$this->view->assign('dirigeants', $dirigeants);
|
|
$this->view->assign('exportObjet', $dirigeants);
|
|
|
|
$this->view->assign('AutrePage', $this->getRequest()->getParam('apage'));
|
|
|
|
$user = new Scores_Utilisateur();
|
|
$this->view->assign('surveillance', $user->checkPerm('survdirigeants'));
|
|
}
|
|
} |