extranet/application/controllers/DashboardController.php

106 lines
2.2 KiB
PHP
Raw Normal View History

2011-02-21 08:45:13 +00:00
<?php
class DashboardController extends Zend_Controller_Action
{
public function init()
{
require_once 'Scores/WsScores.php';
require_once 'Scores/Utilisateur.php';
}
public function preDispatch()
{
$user = new Utilisateur();
if (!$user->checkModeEdition() && $user->getIdClient()!=1 ){
$this->_forward('perms', 'error');
}
}
/**
* Affichage des différents liens d'administration
*/
2011-05-18 06:36:14 +00:00
public function indexAction()
{
$liens = array(
0 => array(
'libelle' => 'Gestion des clients',
'url' => $this->view->url(array('action'=>'clients')),
),
);
$this->view->assign('Liens', $liens);
}
/**
* Gestion des commandes de l'extranet
* Type : greffes | kbis | graydon | giant
*/
public function commandesAction()
{
}
/**
* Génération automatique du courrier PDF / ODT
*/
public function courrierAction()
{
}
/**
* Liste les clients
*/
public function clientsAction()
{
$this->view->headScript()->appendFile('/themes/default/scripts/dashboard.js', 'text/javascript');
$idClient = 0; // On veut tous les clients
$ws = new WsScores();
$reponse = $ws->getListeClients($idClient);
$listeClients = $reponse->result->item;
$reponse = $ws->getListeDroits();
$wsdroits = $reponse->item;
$this->view->assign('ListeClients', $listeClients);
$this->view->assign('wsdroits', $wsdroits);
}
/**
* Edition ou création d'un nouveau client
*/
public function clientAction()
{
$request = $this->getRequest();
$idClient = $request->getParam('idClient', 0);
$titre = 'CREATION NOUVEAU CLIENT';
$submitValue = 'Créer le client';
if ($idClient!=0){
$ws = new WsScores();
$reponse = $ws->getListeClients($idClient);
$InfosClient = $reponse->result->item;
$titre = 'EDITION CLIENT';
$submitValue = 'Modifier le client';
}
$reponse = $ws->getListeDroits();
$wsdroits = $reponse->item;
$this->view->assign('idClient', $idClient);
$this->view->assign('InfosClient', $InfosClient);
$this->view->assign('titre', $titre);
$this->view->assign('submitValue', $submitValue);
$this->view->assign('wsdroits', $wsdroits);
}
/**
* Enregistre les informations sur le client
*/
public function clientsaveAction()
{
}
2011-02-21 08:45:13 +00:00
}