extranet/application/controllers/PiecesController.php

81 lines
2.1 KiB
PHP
Raw Normal View History

2011-04-19 07:37:39 +00:00
<?php
class PiecesController extends Zend_Controller_Action
{
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/Utilisateur.php';
require_once 'Scores/SessionEntreprise.php';
require_once 'common/dates.php';
2011-04-19 07:37:39 +00:00
}
public function indexAction()
{
2011-04-19 07:37:39 +00:00
}
public function commandeAction()
{
$this->view->headLink()
->appendStylesheet('/themes/default/styles/pieces.css', 'all');
$this->view->headScript()
->appendFile('/themes/default/scripts/pieces.js', 'text/javascript');
$siren = substr($this->siret, 0, 9);
$session = new SessionEntreprise($this->siret, $this->id);
$user = new Utilisateur();
$permKbis = false;
if ($user->checkPerm('kbis')){
$permKbis = true;
}
$permPriv = false;
if ($user->checkPerm('privileges')){
$permPriv = true;
}
$permSurvPriv = false;
if ($user->checkPerm('survpriv')){
$permSurvPriv = true;
}
$this->view->assign('permKbis', $permKbis);
$this->view->assign('permPriv', $permPriv);
$this->view->assign('permSurvPriv', $permSurvPriv);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
}
public function privilegesAction()
{
$request = $this->getRequest();
$type = $request->getParam('type', null);
$siren = substr($this->siret, 0, 9);
$detail = false;
if (!empty($type)){
$detail = true;
}
$session = new SessionEntreprise($this->siret, $this->id);
$ws = new WsScores();
if ($detail){
$infos = $ws->getPrivilegesDetail($siren, array($type));
} else {
$infos = $ws->getPrivilegesCumul($siren);
}
$privileges = $infos->result->item;
$this->view->assign('privileges', $privileges);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
}
2011-04-19 07:37:39 +00:00
}