2011-02-21 08:45:13 +00:00
|
|
|
<?php
|
|
|
|
class DashboardController extends Zend_Controller_Action
|
|
|
|
{
|
2011-12-07 09:13:40 +00:00
|
|
|
protected $typeActes= array(
|
|
|
|
'a00' => 'MODIFICATION',
|
|
|
|
'a01' => 'MODIFICATION',
|
|
|
|
'a02' => 'DISSOLUTION',
|
|
|
|
'a03' => 'CONSTITUTION',
|
|
|
|
'a04' => 'STATUTS CONSTITUTIFS',
|
|
|
|
'a06' => 'STATUTS A JOUR',
|
|
|
|
'a07' => 'STATUTS A JOUR',
|
|
|
|
'a08' => 'STATUTS A JOUR ET DECLARATION DE CONFORMITE',
|
|
|
|
'a09' => 'STATUTS APRES TRANSFERT DE SIEGE',
|
|
|
|
'a1D' => 'AUGMENTATION ET REDUCTION CAPITAL',
|
|
|
|
'a25' => 'AUGMENTATION DE CAPITAL',
|
|
|
|
'a26' => 'REDUCTION DE CAPITAL',
|
|
|
|
'a31' => 'TRANSFERT SIEGE SOCIAL HORS RESSORT O',
|
|
|
|
'a33' => 'CHANGEMENT DE GERANT',
|
|
|
|
'a39' => 'CHANGEMENT DE COMMISSAIRE AUX COMPTES',
|
|
|
|
'a77' => 'CONTINUATION MALGRE LA PERTE DE LA MOITIE DU CAPITAL',
|
|
|
|
'aA1' => 'STATUTS',
|
|
|
|
'aAA' => 'ACTE',
|
|
|
|
'aAB' => 'ACTE MODIFICATIF',
|
|
|
|
'aAC' => 'ACTE RECTIFICATIF',
|
|
|
|
'aAD' => 'ACTE SOUS SEING PRIVE',
|
|
|
|
'aAE' => 'AMPLIATION',
|
|
|
|
'aAG' => 'AVENANT',
|
|
|
|
'aAH' => 'AVENANT AUX STATUTS',
|
|
|
|
'aAI' => 'ATTESTATION',
|
|
|
|
'aAJ' => 'ANNEXES',
|
|
|
|
'aAK' => 'ATTESTATION BANCAIRE',
|
|
|
|
'aAP' => 'PROJET APPORT PARTIEL D",ACTIF',
|
|
|
|
'aAT' => 'DELIVRANCE DE L",INFORMATION FAITE AU CONJOINT SUR LES CONSEQUENCES DES DETTES',
|
|
|
|
'aCA' => 'CERTIFICAT',
|
|
|
|
'aCB' => 'COMPTES DE CLOTURE DE LIQUIDATION',
|
|
|
|
'aCD' => 'CONTRAT',
|
|
|
|
'aCE' => 'CONVENTION',
|
|
|
|
'aCF' => 'CERTIFICAT DE SOUSCRIPTION D",ACTIONS',
|
|
|
|
'aDA' => 'DECISION DE GERANCE',
|
|
|
|
'aDB' => 'DECISION DE L",ASSOCIE UNIQUE',
|
|
|
|
'aDC' => 'DECISION DES ASSOCIES',
|
|
|
|
'aDE' => 'DECLARATION DE CONFORMITE',
|
|
|
|
'aDF' => 'DECLARATION DE SOUSCRIPTION ET DE VERSEMENT',
|
|
|
|
'aDH' => 'DECLARATION DE CONFORMITE (ART.374 L24/07/1966)',
|
|
|
|
'aDI' => 'DECISION DE L",ACTIONNAIRE UNIQUE',
|
|
|
|
'aDP' => 'DECISION DU PRESIDENT',
|
|
|
|
'aEA' => 'EXPEDITION',
|
|
|
|
'aEB' => 'EXPEDITION NOTARIEE',
|
|
|
|
'aEC' => 'EXTRAIT DU PROCES-VERBAL',
|
|
|
|
'aFU' => 'PROJET DE FUSION',
|
|
|
|
'aIF' => 'PROJET APPORT PARTIEL D",ACTIF',
|
|
|
|
'aJA' => 'JUGEMENT',
|
|
|
|
'aLA' => 'LETTRE',
|
|
|
|
'aLB' => 'LISTE DES SIEGES SOCIAUX ANTERIEURS',
|
|
|
|
'aLC' => 'LETTRE DE DEMISSION',
|
|
|
|
'aLD' => 'LETTRE DE NOMINATION',
|
|
|
|
'aLF' => 'LISTE DES SOUSCRIPTEURS',
|
|
|
|
'aLS' => 'CERTIFICAT DE DEPOT DES FONDS AVEC LISTE DES SOUSCRIPTEURS',
|
|
|
|
'aNA' => 'NOMINATION DE REPRESENTANT',
|
|
|
|
'aO9' => 'NOMINATION DE GERANT(S)',
|
|
|
|
'aOA' => 'ORDONNANCE',
|
|
|
|
'aOB' => 'ORDONNANCE DE REFERE',
|
|
|
|
'aOC' => 'ORDONNANCE DU PRESIDENT',
|
|
|
|
'aOD' => 'ORDONNANCE SUR REQUETE',
|
|
|
|
'aOE' => 'ORDONNANCE',
|
|
|
|
'aPA' => 'PROCES VERBAL',
|
|
|
|
'aPC' => 'PROCES VERBAL D",ASSEMBLEE CONSTITUTIVE',
|
|
|
|
'aPD' => 'PROCES VERBAL D",ASSEMBLEE DU DIRECTOIRE',
|
|
|
|
'aPE' => 'PROCES VERBAL D",ASSEMBLEE GENERALE',
|
|
|
|
'aPF' => 'PROCES VERBAL D",ASSEMBLEE GENERALE EXTRAORDINAIRE',
|
|
|
|
'aPG' => 'PROCES VERBAL D",ASSEMBLEE GENERALE ORDINAIRE',
|
|
|
|
'aPH' => 'PROCES VERBAL D",ASSEMBLEE MIXTE',
|
|
|
|
'aPI' => 'PROCES VERBAL D",ASSEMBLEES ORDINAIRE ET EXTRAORDINAIRE',
|
|
|
|
'aPL' => 'PROCES VERBAL DIRIGEANT SOCIAL',
|
|
|
|
'aPM' => 'PROCES VERBAL DU CONSEIL D",ADMINISTRATION',
|
|
|
|
'aPN' => 'PROCES VERBAL DU CONSEIL DE SURVEILLANCE',
|
|
|
|
'aPO' => 'PROCES VERBAL DE LA GERANCE',
|
|
|
|
'aPT' => 'PROJET DE TRAITE D",APPORT',
|
|
|
|
'aPU' => 'PROJET DE FUSION',
|
|
|
|
'aPV' => 'PV D",ASSEMBLEE',
|
|
|
|
'aQ2' => 'CONSTITUTION DE LA SOCIETE',
|
|
|
|
'aR1' => 'CESSION DE PARTS (OU DONATION)',
|
|
|
|
'aR4' => 'TRAITE DE FUSION',
|
|
|
|
'aRA' => 'RAPPORT',
|
|
|
|
'aRB' => 'RAPPORT COMMISSAIRE AUX COMPTES',
|
|
|
|
'aRC' => 'RAPPORT COMMISSAIRE FUSION',
|
|
|
|
'aRE' => 'RAPPORT CR/CPTES TRANSFORM. STE',
|
|
|
|
'aRG' => 'RAPPORT DU COMMISSAIRE A LA FUSION',
|
|
|
|
'aRH' => 'RAPPORT DU COMMISSAIRE A LA SCISSION',
|
|
|
|
'aRI' => 'RAPPORT DU COMMISSAIRE A LA TRANSFORMATION',
|
|
|
|
'aRK' => 'RAPPORT DU COMMISSAIRE AUX APPORTS',
|
|
|
|
'aRL' => 'RAPPORT DU COMMISSAIRE AUX APPORTS ET A LA FUSION',
|
|
|
|
'aRQ' => 'RAPPORT GERANCE',
|
|
|
|
'aRS' => 'RAPPORT SPECIAL DU CONSEIL D",ADMINISTRATION',
|
|
|
|
'aRU' => 'PROJET',
|
|
|
|
'aTA' => 'TRAITE',
|
|
|
|
'aTB' => 'TRAITE D",APPORT-FUSION',
|
|
|
|
'aTC' => 'TRAITE DE FUSION',
|
|
|
|
'aUA' => 'ATTESTATION DU CONJOINT COMMUN EN BIENS',
|
|
|
|
);
|
|
|
|
|
2011-05-10 09:52:12 +00:00
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
require_once 'Scores/WsScores.php';
|
2011-05-17 12:42:57 +00:00
|
|
|
require_once 'Scores/Utilisateur.php';
|
2011-12-07 09:13:40 +00:00
|
|
|
require_once 'common/dates.php';
|
2011-05-17 12:42:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function preDispatch()
|
|
|
|
{
|
|
|
|
$user = new Utilisateur();
|
|
|
|
if (!$user->checkModeEdition() && $user->getIdClient()!=1 ){
|
|
|
|
$this->_forward('perms', 'error');
|
|
|
|
}
|
2011-05-10 09:52:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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')),
|
|
|
|
),
|
2011-07-11 09:46:40 +00:00
|
|
|
1 => array(
|
2011-08-08 09:24:05 +00:00
|
|
|
'libelle' => 'Créer un client',
|
|
|
|
'url' => $this->view->url(array('action'=>'client')),
|
2011-08-05 10:31:11 +00:00
|
|
|
),
|
|
|
|
2 => array(
|
2011-07-11 09:46:40 +00:00
|
|
|
'libelle' => 'Gestion des commandes',
|
|
|
|
'url' => $this->view->url(array('action'=>'commandes')),
|
|
|
|
),
|
2011-05-18 06:36:14 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
$this->view->assign('Liens', $liens);
|
|
|
|
}
|
2011-05-10 09:52:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gestion des commandes de l'extranet
|
|
|
|
* Type : greffes | kbis | graydon | giant
|
|
|
|
*/
|
|
|
|
public function commandesAction()
|
|
|
|
{
|
2011-06-27 16:08:18 +00:00
|
|
|
$this->view->headScript()->appendFile('/themes/default/scripts/dashboard.js', 'text/javascript');
|
|
|
|
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$type = $request->getParam('type', '');
|
|
|
|
|
|
|
|
$user = new Utilisateur();
|
|
|
|
|
|
|
|
$typesCommande = array('kbis', 'greffes');
|
|
|
|
|
|
|
|
if (in_array($type, $typesCommande)){
|
|
|
|
|
|
|
|
require_once 'Scores/GestionCommandes.php';
|
|
|
|
|
|
|
|
switch($type){
|
|
|
|
case 'kbis':
|
|
|
|
$num = $request->getParam('num');
|
|
|
|
$num = str_replace(' ', '', $num);
|
|
|
|
$etat = $request->getParam('etat');
|
2011-08-04 16:00:20 +00:00
|
|
|
$mode = $request->getParam('mode', '-');
|
2011-06-27 16:08:18 +00:00
|
|
|
$date = $request->getParam('date');
|
|
|
|
|
|
|
|
$modeSelect = array(
|
|
|
|
'-' => array('value'=>'-', 'select'=>'', 'affichage'=>''),
|
|
|
|
'G' => array('value'=>'G', 'select'=> '', 'affichage'=>'courrier infogreffe'),
|
|
|
|
'C' => array('value'=>'C', 'select'=> '', 'affichage'=>'courrier S&D'),
|
|
|
|
'E' => array('value'=>'E', 'select'=> '', 'affichage'=>'e-mail'),
|
|
|
|
);
|
|
|
|
$modeSelect[$mode]['select'] = ' selected';
|
|
|
|
$gestionCommande = new GestionCommande();
|
2011-12-07 10:46:20 +00:00
|
|
|
$status = $gestionCommande->listAllStatus();
|
2011-06-27 16:08:18 +00:00
|
|
|
$etatSelect = array();
|
|
|
|
$etatSelect[] = array('value'=>0, 'select'=>'', 'affichage'=>'');
|
|
|
|
foreach($status as $item){
|
|
|
|
$select = '';
|
|
|
|
if ($item['id']==$etat){
|
|
|
|
$select = ' selected';
|
|
|
|
}
|
|
|
|
$etatSelect[] = array('value'=>$item['id'], 'select'=>$select, 'affichage'=>$item['libStatut']);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Valeur pour la sélection des dates
|
|
|
|
$dateSelect = array();
|
|
|
|
$dateToday = date('m');
|
|
|
|
$dateIntervalle = 12;
|
|
|
|
if ($user->checkModeEdition()){
|
|
|
|
$dateIntervalle = 24;
|
|
|
|
}
|
|
|
|
for($i=$dateToday-$dateIntervalle; $i<=$dateToday; $i++) {
|
|
|
|
$dateTime = mktime(0, 0, 0, $i+1, 0, date('Y'));
|
|
|
|
$selected = '';
|
|
|
|
if ($date=='' && $i==$dateToday ){
|
|
|
|
$selected = 'selected';
|
|
|
|
}
|
|
|
|
if ($date!='' && $dateTime==$date){
|
|
|
|
$selected = 'selected';
|
|
|
|
}
|
|
|
|
$dateSelect[] = array(
|
|
|
|
'value' => $dateTime,
|
|
|
|
'select' => $selected,
|
|
|
|
'affichage' => date('m/Y', $dateTime)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
$this->view->assign('dateSelect', $dateSelect);
|
|
|
|
$this->view->assign('etatSelect', $etatSelect);
|
|
|
|
$this->view->assign('modeSelect', $modeSelect);
|
|
|
|
$this->view->assign('num', $num);
|
|
|
|
|
|
|
|
if (!empty($num)){
|
|
|
|
if (preg_match('/[0-9]{9}/', $num)){
|
|
|
|
$listCommandes = $gestionCommande->listCommandesKbisBySiren($num);
|
|
|
|
} elseif(substr($num,0,1)=='K'){
|
|
|
|
$listCommandes = $gestionCommande->listCommandesKbisByNum($num);
|
|
|
|
}
|
|
|
|
} elseif (!empty($date)) {
|
|
|
|
$listCommandes = $gestionCommande->listCommandesKbis($date, $etat, $mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
break; //Fin Gestion Kbis
|
|
|
|
|
|
|
|
case 'greffes':
|
|
|
|
|
|
|
|
$num = $request->getParam('num');
|
|
|
|
$num = str_replace(' ', '', $num);
|
|
|
|
$etat = $request->getParam('etat');
|
2011-08-04 16:00:20 +00:00
|
|
|
$mode = $request->getParam('mode', '-');
|
2011-06-27 16:08:18 +00:00
|
|
|
$date = $request->getParam('date');
|
|
|
|
$login = $request->getParam('login');
|
|
|
|
|
2011-07-12 07:41:15 +00:00
|
|
|
if (empty($mode) && !empty($num)) $mode = substr($num,0,1);
|
|
|
|
|
2011-06-27 16:08:18 +00:00
|
|
|
$modeSelect = array(
|
|
|
|
'-' => array('value'=>'-', 'select'=>'', 'affichage'=>''),
|
|
|
|
'G' => array('value'=>'G', 'select'=> '', 'affichage'=>'courrier infogreffe'),
|
|
|
|
'C' => array('value'=>'C', 'select'=> '', 'affichage'=>'courrier S&D'),
|
|
|
|
'E' => array('value'=>'E', 'select'=> '', 'affichage'=>'e-mail'),
|
|
|
|
);
|
|
|
|
$modeSelect[$mode]['select'] = ' selected';
|
2011-07-12 07:41:15 +00:00
|
|
|
|
2011-06-27 16:08:18 +00:00
|
|
|
$gestionCommande = new GestionCommande();
|
2011-07-12 07:41:15 +00:00
|
|
|
|
|
|
|
//Liste des états possible pour les commandes
|
|
|
|
$status = $gestionCommande->listAllStatus();
|
2011-06-27 16:08:18 +00:00
|
|
|
$etatSelect = array();
|
|
|
|
$etatSelect[] = array('value'=>0, 'select'=>'', 'affichage'=>'');
|
|
|
|
foreach($status as $item){
|
|
|
|
$select = '';
|
|
|
|
if ($item['id']==$etat){
|
|
|
|
$select = ' selected';
|
|
|
|
}
|
2011-07-12 07:41:15 +00:00
|
|
|
$etatSelect[] = array(
|
2011-12-07 09:44:35 +00:00
|
|
|
'value' => $item['id'],
|
|
|
|
'select' => $select,
|
|
|
|
'affichage' => $item['libStatut']
|
2011-07-12 07:41:15 +00:00
|
|
|
);
|
2011-06-27 16:08:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//Valeur pour la sélection des dates
|
|
|
|
$dateSelect = array();
|
|
|
|
$dateToday = date('m');
|
|
|
|
$dateIntervalle = 12;
|
|
|
|
if ($user->checkModeEdition()){
|
|
|
|
$dateIntervalle = 24;
|
|
|
|
}
|
|
|
|
for($i=$dateToday-$dateIntervalle; $i<=$dateToday; $i++) {
|
|
|
|
$dateTime = mktime(0, 0, 0, $i+1, 0, date('Y'));
|
|
|
|
$selected = '';
|
|
|
|
if ($date=='' && $i==$dateToday ){
|
|
|
|
$selected = 'selected';
|
|
|
|
}
|
|
|
|
if ($date!='' && $dateTime==$date){
|
|
|
|
$selected = 'selected';
|
|
|
|
}
|
|
|
|
$dateSelect[] = array(
|
|
|
|
'value' => $dateTime,
|
|
|
|
'select' => $selected,
|
|
|
|
'affichage' => date('m/Y', $dateTime)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
$this->view->assign('dateSelect', $dateSelect);
|
|
|
|
$this->view->assign('etatSelect', $etatSelect);
|
|
|
|
$this->view->assign('modeSelect', $modeSelect);
|
|
|
|
$this->view->assign('num', $num);
|
|
|
|
$this->view->assign('login', $login);
|
|
|
|
|
|
|
|
if (!empty($num)){
|
|
|
|
if (preg_match('/[0-9]{9}/', $num)){
|
|
|
|
$listCommandes = $gestionCommande->listCommandesGreffeBySiren($num);
|
|
|
|
} elseif(substr($num,0,1)=='G' || substr($num,0,1)=='C'){
|
|
|
|
$listCommandes = $gestionCommande->listCommandesGreffeByNum($num);
|
|
|
|
}
|
|
|
|
} elseif (!empty($login)) {
|
2011-08-22 07:59:00 +00:00
|
|
|
$listCommandes = $gestionCommande->listCommandesGreffeByLogin($login, $date);
|
2011-06-27 16:08:18 +00:00
|
|
|
} elseif (!empty($date)) {
|
|
|
|
$listCommandes = $gestionCommande->listCommandesGreffe($date, $etat, $mode);
|
|
|
|
}
|
2011-12-07 09:13:40 +00:00
|
|
|
|
2011-07-12 07:41:15 +00:00
|
|
|
//Liste des différents états pour les commandes
|
2011-08-04 16:00:20 +00:00
|
|
|
if ($mode!='-'){
|
|
|
|
${'status'.$mode} = $gestionCommande->listStatus($mode);
|
|
|
|
} else {
|
|
|
|
foreach ($modeSelect as $item){
|
|
|
|
if($item['value']!='-'){
|
|
|
|
${'status'.$item['value']} = $gestionCommande->listStatus($item['value']);
|
|
|
|
}
|
|
|
|
}
|
2011-07-12 07:41:15 +00:00
|
|
|
}
|
|
|
|
|
2011-06-27 16:08:18 +00:00
|
|
|
//Parcours de la liste des commandes et vérification document existe
|
|
|
|
if (count($listCommandes)>0) {
|
2011-08-04 16:00:20 +00:00
|
|
|
for($i=0;$i<count($listCommandes);$i++)
|
|
|
|
{
|
|
|
|
//Etat de la commande
|
|
|
|
$cmdEtatSelect = array();
|
|
|
|
$cmdEtatSelect[] = array('value'=>0, 'select'=>'', 'affichage'=>'');
|
2011-12-07 08:26:18 +00:00
|
|
|
$typeCommande = $listCommandes[$i]->typeCommande;
|
2011-08-04 16:00:20 +00:00
|
|
|
if (isset(${'status'.$typeCommande})){
|
|
|
|
foreach(${'status'.$typeCommande} as $item){
|
|
|
|
$select = '';
|
2011-12-07 08:26:18 +00:00
|
|
|
if ($item['id']==$listCommandes[$i]->statutCommande){
|
2011-08-04 16:00:20 +00:00
|
|
|
$select = ' selected';
|
|
|
|
}
|
|
|
|
$cmdEtatSelect[] = array(
|
|
|
|
'value' => $item['id'],
|
|
|
|
'affichage' => $item['libStatut'],
|
|
|
|
'select' => $select,
|
|
|
|
);
|
|
|
|
}
|
2011-06-27 16:08:18 +00:00
|
|
|
}
|
2011-12-07 08:26:18 +00:00
|
|
|
$listCommandes[$i]->cmdEtatSelect = $cmdEtatSelect;
|
2011-06-27 16:08:18 +00:00
|
|
|
|
2011-08-04 16:00:20 +00:00
|
|
|
//Lien vers le fichier
|
2011-06-27 16:08:18 +00:00
|
|
|
$documentLien = '';
|
2011-12-07 09:13:40 +00:00
|
|
|
$document = '';
|
2011-12-07 09:44:35 +00:00
|
|
|
$sirenLien = '';
|
2011-08-04 16:00:20 +00:00
|
|
|
switch($type)
|
|
|
|
{
|
2011-12-07 09:13:40 +00:00
|
|
|
case 'greffes':
|
2011-12-07 08:26:18 +00:00
|
|
|
if (preg_match('/^([0-9a-zA-Z]{2}-).*?$/', $listCommandes[$i]->refDocument, $matches)){
|
2011-12-07 09:44:35 +00:00
|
|
|
|
2011-12-07 09:13:40 +00:00
|
|
|
if (substr($listCommandes[$i]->refDocument,0,3)=='ST-'){
|
|
|
|
$document = 'DERNIER STATUS À JOUR';
|
|
|
|
} else {
|
|
|
|
$explodedRef = explode('-', $listCommandes[$i]->refDocument);
|
|
|
|
$dateref = WDate::dateT('Ymd','d/m/Y',$explodedRef[1]);
|
|
|
|
$depot = ', Dépôt n°'.$explodedRef[6].' au '.$dateref;
|
|
|
|
$document = $this->typeActes['a'.substr($listCommandes[$i]->refDocument,0,2)].$depot;
|
|
|
|
}
|
2011-12-07 09:44:35 +00:00
|
|
|
|
|
|
|
$configuration = Zend_Registry::get('configuration');
|
|
|
|
$refFile = realpath($configuration->path->data).'/'.
|
|
|
|
$configuration->path->pdf.'/acte-'.
|
|
|
|
$listCommandes[$i]->siren.'-'.
|
|
|
|
trim($listCommandes[$i]->refDocument).'.pdf';
|
|
|
|
|
|
|
|
if (file_exists($refFile)) {
|
|
|
|
$document = '<a href="./fichier/pdf/acte-'.
|
|
|
|
$listCommandes[$i]->siren.'-'.
|
|
|
|
trim($listCommandes[$i]->refDocument).'.pdf'.
|
|
|
|
'" target="_blank">'.$document.'</a>';
|
|
|
|
}
|
|
|
|
|
|
|
|
$sirenLien = $this->view->url(array(
|
2011-06-27 16:08:18 +00:00
|
|
|
'controller' => 'pieces',
|
|
|
|
'action' => 'actes',
|
2011-12-07 09:13:40 +00:00
|
|
|
'siret' => $listCommandes[$i]->siren,
|
2011-12-07 09:44:35 +00:00
|
|
|
), null, true);
|
|
|
|
|
2011-12-07 08:26:18 +00:00
|
|
|
} elseif (preg_match('/^([0-9]{4}).*?$/', $listCommandes[$i]->refDocument, $matches)){
|
2011-12-07 09:44:35 +00:00
|
|
|
|
2011-12-07 09:13:40 +00:00
|
|
|
$document = 'Bilan de '.$matches[1];
|
2011-12-07 09:44:35 +00:00
|
|
|
|
|
|
|
$configuration = Zend_Registry::get('configuration');
|
|
|
|
$refFile = realpath($configuration->path->data).'/'.
|
|
|
|
$configuration->path->pdf.'/bilan-'.
|
|
|
|
$listCommandes[$i]->siren.'-'.
|
|
|
|
trim($listCommandes[$i]->refDocument).'.pdf';
|
|
|
|
|
|
|
|
if(file_exists($pathData.'/pdf/bilan-'.$siren.'-'.$ref.'.pdf')){
|
|
|
|
$suffixe = 'bilan';
|
|
|
|
$document = '<a href="./fichier/pdf/bilan-'.
|
|
|
|
$listCommandes[$i]->siren.'-'.
|
|
|
|
trim($listCommandes[$i]->refDocument).'.pdf'.
|
|
|
|
'" target="_blank">'.$document.'</a>';
|
|
|
|
}
|
|
|
|
|
|
|
|
$sirenLien = $this->view->url(array(
|
2011-06-27 16:08:18 +00:00
|
|
|
'controller' => 'pieces',
|
|
|
|
'action' => 'bilans',
|
2011-12-07 09:13:40 +00:00
|
|
|
'siret' => $listCommandes[$i]->siren,
|
2011-12-07 09:44:35 +00:00
|
|
|
), null, true);
|
|
|
|
|
2011-06-27 16:08:18 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2011-12-07 09:13:40 +00:00
|
|
|
$listCommandes[$i]->document = $document;
|
2011-12-07 08:26:18 +00:00
|
|
|
$listCommandes[$i]->documentLien = $documentLien;
|
2011-12-07 09:44:35 +00:00
|
|
|
$listCommandes[$i]->sirenLien = $sirenLien;
|
2011-06-27 16:08:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
break; //Fin Gestion Greffes
|
|
|
|
}
|
|
|
|
$this->view->assign('commandes', $listCommandes);
|
|
|
|
$this->renderScript('dashboard/commandes-'.$type.'.phtml');
|
|
|
|
}
|
|
|
|
|
|
|
|
//Affichage des liens vers les différents types de commande
|
|
|
|
$this->view->assign('typesCommande', $typesCommande);
|
2011-05-10 09:52:12 +00:00
|
|
|
|
|
|
|
}
|
2011-08-19 15:32:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Modification de l'état d'une commande infogreffe
|
|
|
|
*/
|
2011-08-04 16:00:20 +00:00
|
|
|
public function commandesetatchangeAction()
|
|
|
|
{
|
|
|
|
$this->_helper->layout()->disableLayout();
|
|
|
|
$this->_helper->viewRenderer->setNoRender(true);
|
|
|
|
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$etat = $request->getParam('etat');
|
|
|
|
$idCommande = $request->getParam('idCommande');
|
|
|
|
|
|
|
|
require_once 'Scores/GestionCommandes.php';
|
|
|
|
$commande = new GestionCommande();
|
|
|
|
echo $commande->changeEtat($idCommande, $etat);
|
|
|
|
}
|
|
|
|
|
2011-08-19 15:32:48 +00:00
|
|
|
/**
|
|
|
|
* Affichage de la raison sociale à partir du siren
|
|
|
|
*/
|
2011-06-27 16:08:18 +00:00
|
|
|
public function rsAction()
|
|
|
|
{
|
|
|
|
$this->_helper->layout()->disableLayout();
|
|
|
|
$this->_helper->viewRenderer->setNoRender(true);
|
|
|
|
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$siren = $request->getParam('siren');
|
|
|
|
|
|
|
|
$ws = new WsScores();
|
|
|
|
$infos = $ws->getIdentite($siren);
|
|
|
|
if ($infos==false) {
|
|
|
|
echo 'Erreur';
|
|
|
|
} else {
|
|
|
|
echo $infos->Nom;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-10 09:52:12 +00:00
|
|
|
/**
|
|
|
|
* Génération automatique du courrier PDF / ODT
|
|
|
|
*/
|
|
|
|
public function courrierAction()
|
|
|
|
{
|
2011-08-22 07:59:00 +00:00
|
|
|
$this->_helper->layout()->disableLayout();
|
|
|
|
$this->_helper->viewRenderer->setNoRender(true);
|
|
|
|
|
2011-08-22 13:30:32 +00:00
|
|
|
$request = $this->getRequest();
|
|
|
|
$numCommande = $request->getParam('commande');
|
2011-08-22 07:59:00 +00:00
|
|
|
|
2011-08-22 13:30:32 +00:00
|
|
|
require_once 'GenCourrier/GenCourrier.php';
|
|
|
|
$courrier = new GenCourrier($numCommande);
|
2011-08-22 07:59:00 +00:00
|
|
|
|
|
|
|
|
2011-08-22 13:30:32 +00:00
|
|
|
$courrier->computeOdt();
|
2011-05-10 09:52:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Liste les clients
|
|
|
|
*/
|
|
|
|
public function clientsAction()
|
|
|
|
{
|
2011-10-27 10:10:30 +00:00
|
|
|
$user = new Utilisateur();
|
|
|
|
if ( !$user->isSuperAdmin() ){
|
|
|
|
$this->_forward('perms', 'error');
|
|
|
|
}
|
|
|
|
|
2011-05-10 09:52:12 +00:00
|
|
|
$this->view->headScript()->appendFile('/themes/default/scripts/dashboard.js', 'text/javascript');
|
|
|
|
|
|
|
|
$ws = new WsScores();
|
2011-06-08 12:13:31 +00:00
|
|
|
$reponse = $ws->getListeClients();
|
2011-05-10 09:52:12 +00:00
|
|
|
$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()
|
|
|
|
{
|
2011-10-27 10:10:30 +00:00
|
|
|
$user = new Utilisateur();
|
|
|
|
if ( !$user->isSuperAdmin() ){
|
|
|
|
$this->_forward('perms', 'error');
|
|
|
|
}
|
|
|
|
|
2011-10-06 15:05:22 +00:00
|
|
|
$this->view->headScript()->appendFile('/themes/default/scripts/jquery.checkbox.js', 'text/javascript');
|
|
|
|
$this->view->headLink()->appendStylesheet('/themes/default/styles/jquery.checkbox.css', 'all');
|
|
|
|
|
2011-05-10 09:52:12 +00:00
|
|
|
$request = $this->getRequest();
|
2011-06-08 12:13:31 +00:00
|
|
|
$idClient = $request->getParam('idClient', false);
|
2011-05-10 09:52:12 +00:00
|
|
|
$titre = 'CREATION NOUVEAU CLIENT';
|
|
|
|
$submitValue = 'Créer le client';
|
2011-06-08 12:13:31 +00:00
|
|
|
if ($idClient!==false){
|
2011-05-10 09:52:12 +00:00
|
|
|
$ws = new WsScores();
|
|
|
|
$reponse = $ws->getListeClients($idClient);
|
2011-06-08 12:13:31 +00:00
|
|
|
$InfosClient = $reponse->result->item[0];
|
2011-05-10 09:52:12 +00:00
|
|
|
$titre = 'EDITION CLIENT';
|
|
|
|
$submitValue = 'Modifier le client';
|
|
|
|
}
|
2011-06-08 12:13:31 +00:00
|
|
|
$ws = new WsScores();
|
2011-05-10 09:52:12 +00:00
|
|
|
$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-06-29 08:18:24 +00:00
|
|
|
$request = $this->getRequest();
|
2011-10-06 15:05:22 +00:00
|
|
|
$infos = $request->getParams();
|
2011-06-29 08:18:24 +00:00
|
|
|
$ws = new WsScores();
|
2011-10-06 15:05:22 +00:00
|
|
|
$reponse = $ws->setClient($infos);
|
2011-06-29 08:18:24 +00:00
|
|
|
if ($reponse->error->errnum==1) {
|
2011-10-06 15:05:22 +00:00
|
|
|
$this->_forward('client', 'dashboard', null, array('idClient' => $infos['idClient']));
|
|
|
|
}
|
2011-06-29 08:18:24 +00:00
|
|
|
$this->view->assign('infos', $request->getParams());
|
2011-05-10 09:52:12 +00:00
|
|
|
}
|
|
|
|
|
2011-02-21 08:45:13 +00:00
|
|
|
|
|
|
|
}
|