2011-02-21 08:45:13 +00:00
|
|
|
<?php
|
|
|
|
class DirigeantController extends Zend_Controller_Action
|
|
|
|
{
|
2011-04-19 06:23:20 +00:00
|
|
|
protected $siret;
|
|
|
|
protected $id;
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 06:23:20 +00:00
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$this->siret = $request->getParam('siret');
|
|
|
|
$this->id = $request->getParam('id', 0);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-20 09:33:40 +00:00
|
|
|
require_once 'Scores/WsScores.php';
|
2011-04-19 06:23:20 +00:00
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-07 09:54:28 +00:00
|
|
|
/**
|
|
|
|
* Affichage de la liste des dirigeants
|
|
|
|
*/
|
2011-04-19 06:23:20 +00:00
|
|
|
public function listeAction()
|
|
|
|
{
|
2014-01-16 09:33:31 +00:00
|
|
|
$request = $this->getRequest();
|
|
|
|
$autrePage = $this->getRequest()->getParam('apage');
|
|
|
|
|
2011-04-19 06:23:20 +00:00
|
|
|
$siren = substr($this->siret, 0, 9);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2014-01-16 09:33:31 +00:00
|
|
|
if (empty($autrePage)) {
|
|
|
|
$this->view->headTitle()->prepend('Liste des dirigeants');
|
|
|
|
$this->view->headTitle()->prepend('Siret '.$this->siret);
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 06:23:20 +00:00
|
|
|
$ws = new WsScores();
|
|
|
|
$infos = $ws->getDirigeants($siren);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-08-19 12:31:51 +00:00
|
|
|
if ($infos === false){
|
2014-01-16 09:33:31 +00:00
|
|
|
$this->forward('soap', 'error');
|
2011-08-19 12:31:51 +00:00
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-20 07:36:55 +00:00
|
|
|
$dirigeants = $infos->result->item;
|
2013-10-04 12:41:24 +00:00
|
|
|
|
2012-05-20 16:31:28 +00:00
|
|
|
$user = new Scores_Utilisateur();
|
2013-11-21 16:31:49 +00:00
|
|
|
$session = new Scores_Session_Entreprise($this->siret, $this->id);
|
2013-10-04 12:41:24 +00:00
|
|
|
|
2012-05-20 16:31:28 +00:00
|
|
|
if ($user->checkPerm('dirigeantsop')){
|
2012-02-07 16:27:41 +00:00
|
|
|
$href = $this->view->url(array('controller'=>'dirigeant', 'action'=>'op', 'siret'=>$this->siret));
|
2011-12-05 13:03:55 +00:00
|
|
|
$this->view->assign('dirigeantsop', $href);
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2013-07-26 15:05:18 +00:00
|
|
|
$this->view->assign('edition', $user->checkModeEdition());
|
2013-10-04 12:41:24 +00:00
|
|
|
$this->view->assign('accessWorldCheck', $user->checkPerm('WORLDCHECK'));
|
2013-07-26 15:05:18 +00:00
|
|
|
|
2011-04-20 09:33:40 +00:00
|
|
|
$this->view->assign('siren', $siren);
|
2011-04-20 13:41:43 +00:00
|
|
|
$this->view->assign('siret', $this->siret);
|
2011-04-20 09:33:40 +00:00
|
|
|
$this->view->assign('raisonSociale', $session->getRaisonSociale());
|
2011-04-20 07:36:55 +00:00
|
|
|
$this->view->assign('dirigeants', $dirigeants);
|
2011-08-23 07:26:58 +00:00
|
|
|
$this->view->assign('exportObjet', $dirigeants);
|
2012-03-01 13:10:25 +00:00
|
|
|
|
2012-05-20 16:31:28 +00:00
|
|
|
$this->view->assign('AutrePage', $this->getRequest()->getParam('apage'));
|
|
|
|
$this->view->assign('surveillance', $user->checkPerm('survdirigeants'));
|
2011-04-19 06:23:20 +00:00
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-07 09:54:28 +00:00
|
|
|
/**
|
|
|
|
* Affichage de l'historiques des dirigeants
|
|
|
|
*/
|
2011-04-19 06:23:20 +00:00
|
|
|
public function histoAction()
|
|
|
|
{
|
|
|
|
$siren = substr($this->siret, 0, 9);
|
2011-04-20 09:33:40 +00:00
|
|
|
|
2013-12-26 14:42:44 +00:00
|
|
|
$this->view->headTitle()->prepend('Historique des dirigeants');
|
|
|
|
$this->view->headTitle()->prepend('Siret '.$this->siret);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 06:23:20 +00:00
|
|
|
$ws = new WsScores();
|
|
|
|
$infos = $ws->getDirigeants($siren, true);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-08-19 12:31:51 +00:00
|
|
|
if ($infos === false){
|
|
|
|
$this->_forward('soap', 'error');
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-20 07:36:55 +00:00
|
|
|
$dirigeants = $infos->result->item;
|
2011-04-20 09:33:40 +00:00
|
|
|
|
2013-11-21 16:31:49 +00:00
|
|
|
$session = new Scores_Session_Entreprise($this->siret, $this->id);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-20 09:33:40 +00:00
|
|
|
$this->view->assign('dirigeants', $dirigeants);
|
2011-08-23 07:26:58 +00:00
|
|
|
$this->view->assign('exportObjet', $dirigeants);
|
2011-04-20 09:33:40 +00:00
|
|
|
$this->view->assign('siren', $siren);
|
2011-04-20 13:41:43 +00:00
|
|
|
$this->view->assign('siret', $this->siret);
|
2011-04-20 09:33:40 +00:00
|
|
|
$this->view->assign('raisonSociale', $session->getRaisonSociale());
|
2011-04-19 06:23:20 +00:00
|
|
|
$this->view->assign('infos', $infos);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
|
|
|
$user = new Scores_Utilisateur();
|
2012-03-01 13:10:25 +00:00
|
|
|
$this->view->assign('surveillance', $user->checkPerm('survdirigeants'));
|
2011-04-19 06:23:20 +00:00
|
|
|
}
|
2011-04-11 14:19:14 +00:00
|
|
|
|
2011-12-05 13:03:55 +00:00
|
|
|
public function opAction()
|
|
|
|
{
|
|
|
|
$siren = substr($this->siret, 0, 9);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2013-12-26 14:42:44 +00:00
|
|
|
$this->view->headTitle()->prepend('Liste des dirigeants opérationnels');
|
|
|
|
$this->view->headTitle()->prepend('Siret '.$this->siret);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-12-05 13:03:55 +00:00
|
|
|
$ws = new WsScores();
|
|
|
|
$infos = $ws->getDirigeantsOp($siren);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-12-05 13:03:55 +00:00
|
|
|
if ($infos === false){
|
|
|
|
$this->_forward('soap', 'error');
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2012-02-27 16:53:16 +00:00
|
|
|
$dirigeants = $infos->item;
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2013-11-21 16:31:49 +00:00
|
|
|
$session = new Scores_Session_Entreprise($this->siret, $this->id);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-12-05 13:03:55 +00:00
|
|
|
$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);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2012-03-01 13:10:25 +00:00
|
|
|
$this->view->assign('AutrePage', $this->getRequest()->getParam('apage'));
|
|
|
|
|
2012-05-20 16:31:28 +00:00
|
|
|
$user = new Scores_Utilisateur();
|
2014-04-24 10:46:36 +00:00
|
|
|
$this->view->assign('accessWorldCheck', $user->checkPerm('WORLDCHECK'));
|
2012-03-01 13:10:25 +00:00
|
|
|
$this->view->assign('surveillance', $user->checkPerm('survdirigeants'));
|
2014-04-24 10:46:36 +00:00
|
|
|
$this->view->assign('edition', $user->checkModeEdition());
|
2012-05-20 16:31:28 +00:00
|
|
|
}
|
2011-02-21 08:45:13 +00:00
|
|
|
}
|