extranet/application/controllers/DirigeantController.php

124 lines
3.3 KiB
PHP
Raw Normal View History

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
require_once 'Scores/WsScores.php';
require_once 'Scores/SessionEntreprise.php';
require_once 'common/dates.php';
2011-04-19 06:23:20 +00:00
}
2012-05-20 16:31:28 +00:00
/**
* Forward
*/
2011-08-19 15:35:32 +00:00
public function indexAction()
{
$this->_forward('index', 'index');
}
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()
{
$siren = substr($this->siret, 0, 9);
2012-05-20 16:31:28 +00:00
2011-11-21 08:47:16 +00:00
$this->view->headTitle()->append('Liste des dirigeants');
$this->view->headTitle()->append('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){
2012-05-20 16:31:28 +00:00
$this->_forward('soap', 'error');
2011-08-19 12:31:51 +00:00
}
2012-05-20 16:31:28 +00:00
$dirigeants = $infos->result->item;
2012-05-20 16:31:28 +00:00
$session = new SessionEntreprise($this->siret, $this->id);
2012-05-20 16:31:28 +00:00
$user = new Scores_Utilisateur();
if ($user->checkPerm('dirigeantsop')){
$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
$this->view->assign('siren', $siren);
2011-04-20 13:41:43 +00:00
$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
$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-11-21 08:47:16 +00:00
$this->view->headTitle()->append('Historique des dirigeants');
$this->view->headTitle()->append('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
$dirigeants = $infos->result->item;
$session = new SessionEntreprise($this->siret, $this->id);
2012-05-20 16:31:28 +00:00
$this->view->assign('dirigeants', $dirigeants);
$this->view->assign('exportObjet', $dirigeants);
$this->view->assign('siren', $siren);
2011-04-20 13:41:43 +00:00
$this->view->assign('siret', $this->siret);
$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();
$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
2011-12-05 13:03:55 +00:00
$this->view->headTitle()->append('Liste des dirigeants opérationnels');
$this->view->headTitle()->append('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
2011-12-05 13:03:55 +00:00
$session = new SessionEntreprise($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
$this->view->assign('AutrePage', $this->getRequest()->getParam('apage'));
2012-05-20 16:31:28 +00:00
$user = new Scores_Utilisateur();
$this->view->assign('surveillance', $user->checkPerm('survdirigeants'));
2012-05-20 16:31:28 +00:00
}
2011-02-21 08:45:13 +00:00
}