Compare commits

..

2 Commits

Author SHA1 Message Date
Michael RICOIS
2383aacc4c Formattage 2015-10-06 09:22:28 +00:00
Michael RICOIS
cf5bbc94aa Config : Remove duplicate create of directory 2015-10-06 09:11:24 +00:00
1408 changed files with 1926846 additions and 50654 deletions

4
.gitignore vendored
View File

@ -1,4 +0,0 @@
/.settings/
/.buildpath
/.project
/vendor/

View File

@ -1,40 +1,14 @@
<?php
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Monolog\Processor\IntrospectionProcessor;
use Monolog\Handler\ChromePHPHandler;
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
/**
* Set config available in all apps
*/
protected function _initConfig()
protected function _initConfig()
{
$config = new Zend_Config($this->getOptions());
Zend_Registry::set('config', $config);
return $config;
}
/**
* Init controller with modules
*/
protected function _initController()
{
$this->bootstrap('frontController');
$front = $this->getResource('frontController');
$front->setControllerDirectory(array(
'default' => __DIR__ . '/modules/default/controllers',
'admin' => __DIR__ . '/modules/admin/controllers',
'file' => __DIR__ . '/modules/file/controllers',
));
return $front;
}
/**
* Initialisation global des paramètres de vue
*/
//Initialisation global des paramètres de vue
protected function _initViewSettings()
{
$this->bootstrap('view');
@ -44,10 +18,6 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view->headTitle('Extranet Scores & Décisions');
}
/**
* Some specific route
* @return unknown
*/
protected function _initRouter()
{
$this->bootstrap('frontController');
@ -55,21 +25,24 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$router = $front->getRouter();
$localauthRoute = new Zend_Controller_Router_Route('localauth/', array(
'module' => 'default',
'controller' => 'user',
'action' => 'login'
'action' => 'login'
));
$router->addRoute('localauth', $localauthRoute);
$fichierRoute = new Zend_Controller_Router_Route('fichier/:action/:fichier', array(
'controller' => 'fichier',
'fichier' => '',
));
$router->addRoute('fichier', $fichierRoute);
$printRoute = new Zend_Controller_Router_Route('editer/:action/:fichier', array(
'module' => 'default',
'controller' => 'print',
'fichier' => '',
));
$router->addRoute('print', $printRoute);
$ssoRoute = new Zend_Controller_Router_Route('sso/:partner/', array(
'module' => 'default',
'controller' => 'auth',
'action' => 'index',
));
@ -88,6 +61,9 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$logger = new Zend_Log($writer);
Zend_Registry::set('firebug', $logger);
//ChromePHP - a voir comment désactiver
require_once 'Vendors/ChromePHP/ChromePhp.php';
//Application Logger en Production
$AppLogger = new Zend_Log();
if (APPLICATION_ENV == 'production')
@ -100,42 +76,16 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$AppMailWriter->addFilter(Zend_Log::ERR);
$AppLogger->addWriter($AppMailWriter);
}
/* Remove as it's not use
$c = Zend_Registry::get('config');
$path = $c->profil->path->data.'/log';
$AppFileWriter = new Zend_Log_Writer_Stream($path.'/application.log');
$AppFileWriter->addFilter(Zend_Log::ERR);
$AppLogger->addWriter($AppFileWriter);
*/
Zend_Registry::set('log', $AppLogger);
}
/**
* Logs and Debug
*/
protected function _initLogger()
{
$config = new Zend_Config($this->getOptions());
$logFile = $config->profil->path->shared.'/log/application.log';
$log = new Logger('APP');
// Console Handler
if (in_array(APPLICATION_ENV, array('development', 'staging'))) {
//$log->pushHandler(new BrowserConsoleHandler());
//$log->pushHandler(new ChromePHPHandler());
}
// File Handler
if (APPLICATION_ENV == 'development') {
$level = Logger::DEBUG;
} else {
$level = Logger::INFO;
}
$log->pushHandler(new StreamHandler($logFile), $level);
// Processor
$log->pushProcessor(new IntrospectionProcessor());
Zend_Registry::set('logger', $log);
}
/**
* Init database
*/
protected function _initDb()
{
$c = Zend_Registry::get('config');
@ -166,15 +116,13 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
}
}
/**
* Init cache
*/
protected function _initCache()
{
// @todo : Remove for PHP7 Compatibility
//MetadataCache pour la base de données
$cache = Zend_Cache::factory('Core', 'Apc',
array('lifetime' => 28800, 'automatic_serialization' => true),
$cache = Zend_Cache::factory(
'Core',
'Apc',
array('lifetime' => 28800,'automatic_serialization' => true),
array()
);
Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);

View File

@ -1 +0,0 @@
/application.ini

View File

@ -3,18 +3,8 @@ class AideController extends Zend_Controller_Action
{
protected $theme;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
}
@ -80,7 +70,7 @@ class AideController extends Zend_Controller_Action
require_once 'Scores/WsScores.php';
$ws = new WsScores();
$accept = $ws->setCGU();
$this->logger->info($accept);
Zend_Registry::get('firebug')->info($accept);
if ($accept) {
//Put in session
$auth = Zend_Auth::getInstance();

View File

@ -14,18 +14,8 @@ class AuthController extends Zend_Controller_Action
)
);
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
}
@ -36,12 +26,10 @@ class AuthController extends Zend_Controller_Action
*/
public function indexAction()
{
// --- Désactiver le layout
//Désactiver le layout
$this->_helper->layout()->disableLayout();
$this->view->headLink()
->appendStylesheet($this->theme->pathStyle.'/inexweb.css', 'all')
->appendStylesheet($this->theme->pathStyle.'/user.css', 'all');
$this->view->headLink()->appendStylesheet($this->theme->pathStyle.'/user.css', 'all');
$request = $this->getRequest();
@ -71,19 +59,23 @@ class AuthController extends Zend_Controller_Action
$token = $params[$config['token']];
try {
$ws = new Scores_Ws_Client('gestion', '0.4');
$parameters = new stdClass();
$parameters->client = $config['clientId'];
$parameters->login = $login;
$parameters->token = $token;
$parameters->params = $objectParams;
$ws = new Scores_Ws_Client('account', '0.1');
$hash = $ws->ssoAuthenticate($parameters);
// --- Utilisateur inexistant
if ( $hash === 'false' || $hash === false ) {
$this->view->NoUser = true;
$urlParams = array('controller'=>'auth', 'action'=>'userssoform');
$urlParams = array_merge($params, $urlParams);
$this->view->FormUrlParams = $urlParams;
// --- Set form value
$this->view->FormPartner = $partner;
$this->view->FormIdentifiant = $login;
$this->view->FormCourriel = $request->getParam('mail');
$this->view->FormSiret = $request->getParam('siret');
$this->view->FormNom = $request->getParam('lastname');
$this->view->FormPrenom = $request->getParam('name');
}
// --- Redirection
else {
@ -106,14 +98,14 @@ class AuthController extends Zend_Controller_Action
try {
$ws = new Scores_Ws_Client('gestion', '0.3');
$InfosLogin = $ws->getInfosLogin($parameters);
$this->logger->info(print_r($InfosLogin,1));
Zend_Registry::get('firebug')->info($InfosLogin);
if ( is_string($InfosLogin) || $InfosLogin->error->errnum != 0 ) {
$this->view->Error = true;
} else {
$user = new Scores_Utilisateur();
$identity = $user->updateProfil($InfosLogin);
$auth->getStorage()->write($identity);
// --- Redirect
//Redirect
$this->redirect('/');
}
} catch ( Exception $e ) {
@ -143,55 +135,6 @@ class AuthController extends Zend_Controller_Action
}
}
/**
* Affichage du formulaire pour l'inscription des utilisateurs
*/
public function userssoformAction()
{
// --- Désactiver le layout
$this->_helper->layout()->disableLayout();
$this->view->headLink()->appendStylesheet($this->theme->pathStyle.'/user.css', 'all');
$request = $this->getRequest();
/**
* Get partner name - see route in bootstrap
*/
$partner = $request->getParam('partner');
if ( array_key_exists($partner, $this->partnerConfig) ) {
$config = $this->partnerConfig[$partner];
$this->view->logo = $config['logo'];
$params = $request->getParams();
$objectParams = array();
foreach ($params as $label => $value) {
if (in_array($label, array('controller', 'action'))) continue;
$object = new stdClass();
$object->label = $label;
$object->value = $value;
$objectParams[] = $object;
}
$this->view->Params = $objectParams;
$login = $params[$config['login']];
$part = strstr($login, '@', true);
if ($part !== false) {
$login = $part;
}
$token = $params[$config['token']];
$this->view->NoUser = true;
// --- Set form value
$this->view->FormPartner = $partner;
$this->view->FormIdentifiant = $login;
$this->view->FormCourriel = $request->getParam('mail');
$this->view->FormSiret = $request->getParam('siret');
$this->view->FormNom = $request->getParam('lastname');
$this->view->FormPrenom = $request->getParam('name');
}
else {
$this->view->Message = "Erreur dans les paramètres.";
}
}
/**
* Creation d'un utilisateur en SSO
*/
@ -218,7 +161,7 @@ class AuthController extends Zend_Controller_Action
);
try {
$ws = new Scores_Ws_Client('account', '0.1');
$ws = new Scores_Ws_Client('gestion', '0.4');
$parameters = new stdClass();
$parameters->data = json_encode($data);
$created = $ws->setUserSSO($parameters);

View File

@ -3,18 +3,8 @@ class BdfController extends Zend_Controller_Action
{
protected $theme;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
}
@ -93,7 +83,7 @@ class BdfController extends Zend_Controller_Action
$req = substr($siret, 0, 9);
}
$this->logger->info($module);
Zend_Registry::get('firebug')->info($module);
$content = array();

View File

@ -101,12 +101,6 @@ class DashboardController extends Zend_Controller_Action
'aUA' => 'ATTESTATION DU CONJOINT COMMUN EN BIENS',
);
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
/**
* Return a ramdom password
* @param int $length
@ -134,10 +128,6 @@ class DashboardController extends Zend_Controller_Action
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
@ -187,7 +177,7 @@ class DashboardController extends Zend_Controller_Action
*/
protected function statChart($data, $labels, $name)
{
require_once 'ChartDirector/phpchartdir.php';
require_once("Vendors/ChartDirector/phpchartdir.php");
$hChart = 210;
@ -456,7 +446,7 @@ class DashboardController extends Zend_Controller_Action
}
$c = Zend_Registry::get('config');
$refFile = $c->profil->path->shared.'/pdf/acte-'.
$refFile = realpath($c->profil->path->data).'/pdf/acte-'.
$listCommandes[$i]->siren.'-'.
trim($listCommandes[$i]->refDocument).'.pdf';
@ -792,7 +782,7 @@ class DashboardController extends Zend_Controller_Action
$user = $ws->getUser($login);
$options = json_decode($user, true);
$this->logger->info(print_r($user,1));
Zend_Registry::get('firebug')->info($user);
$this->view->assign('droits', explode(' ',$options['droits']));
$this->view->assign('prefs', explode(' ',$options['pref']));
@ -878,7 +868,7 @@ class DashboardController extends Zend_Controller_Action
}
}
$this->logger->info(print_r($output,1));
Zend_Registry::get('firebug')->info($output);
$this->view->assign('output', $output);
}
@ -901,7 +891,7 @@ class DashboardController extends Zend_Controller_Action
if ( isset($_FILES) && count($_FILES)==1 ) {
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared.'/persist/nouveautes';
$path = realpath($c->profil->path->data).'/nouveautes';
if(!file_exists($path)) mkdir($path);
$tmp_name = $_FILES['fichier']['tmp_name'];
@ -993,7 +983,7 @@ class DashboardController extends Zend_Controller_Action
//Liste des periodes de facturation
$contrats = $ws->getClientTarifs($idClient);
$this->logger->info(print_r($contrats,1));
Zend_Registry::get('firebug')->info($contrats);
$this->view->assign('contrats', $contrats->item);
//Liste des services

View File

@ -5,18 +5,8 @@ class DirigeantController extends Zend_Controller_Action
protected $siret;
protected $id;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');

View File

@ -3,18 +3,8 @@ class ErrorController extends Zend_Controller_Action
{
protected $theme;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
}
@ -70,7 +60,7 @@ class ErrorController extends Zend_Controller_Action
$mail = new Scores_Mail_Method();
$mail->setSubject('[ERREUR APPLICATIVE] - '.$c->profil->server->name.' -'.date('Ymd'));
$mail->setBodyText($message);
$mail->setFromKey('support');
$mail->setFromKey('supportdev');
$mail->addToKey('supportdev');
$mail->execute();
}

View File

@ -5,18 +5,8 @@ class EvaluationController extends Zend_Controller_Action
protected $siret = null;
protected $id = 0;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
@ -129,10 +119,10 @@ class EvaluationController extends Zend_Controller_Action
}
//Make the graph - Ready to create a class for this char
require_once 'ChartDirector/phpchartdir.php';
require_once 'Vendors/ChartDirector/phpchartdir.php';
require_once 'Scores/Cache.php';
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared . '/pages/imgcache/';
$path = $c->profil->path->pages . '/imgcache/';
$file = 'indiscorehisto-'.$this->siret.'-'.$this->id.'-'.$type.'.png';
$cache = new Cache();
$return = null;
@ -211,19 +201,6 @@ class EvaluationController extends Zend_Controller_Action
*/
public function indiscoreAction()
{
$bornes = array(
'indiScore' => array('min' => 0, 'max' => 20, 'rouge' => 7, 'orange' => 10),
'scoreDir' => array('min' => 0, 'max' => 100, 'rouge' => 45, 'orange' => 56),
'scoreConf' => array('min' => 0, 'max' => 100, 'rouge' => 45, 'orange' => 56),
'scoreZ' => array('min' => -3, 'max' => 3, 'rouge' => -0.25, 'orange' => 0.125),
'scoreCH' => array('min' => -4.5, 'max' => 16, 'rouge' => 3.75, 'orange' => 10),
'scoreAfdcc1' => array('min' => -7, 'max' => 7, 'rouge' => 0, 'orange' => 1),
'scoreAfdcc2' => array('min' => -3, 'max' => 2, 'rouge' => -1, 'orange' => 0.5),
'scoreAltman' => array('min' => -2, 'max' => 8, 'rouge' => 0, 'orange' => 2.7),
'scoreCCF' => array('min' => 500, 'max' => 5000, 'rouge' => 2160, 'orange' => 3450 ),
);
$this->view->assign('bornes', $bornes);
$user = new Scores_Utilisateur();
if(!$user->checkPerm('INDISCORE') && !$user->checkPerm('INDISCOREP'))
$this->forward('perms', 'error');
@ -271,19 +248,16 @@ class EvaluationController extends Zend_Controller_Action
$this->view->headTitle()->prepend("Siret ".$this->siret);
$user = new Scores_Utilisateur();
if(!$user->checkPerm('INDISCORE2') && !$user->checkPerm('INDISCORE2P')) {
if(!$user->checkPerm('INDISCORE2') && !$user->checkPerm('INDISCORE2P'))
$this->forward('perms', 'error');
}
$siren = substr($this->siret,0,9);
$entreprise = new Scores_Session_Entreprise($this->siret, $this->id);
//@todo : transformer le webservice pour ne faire qu'une seule requete
$ws = new WsScores();
$indiscore = $ws->getIndiScore($siren, 0, 1);
if ($indiscore === false) {
$this->forward('soap', 'error');
}
$identite = $ws->getIdentite($siren);
$entreprise = new Scores_Session_Entreprise($this->siret, $this->id);
$identite = $ws->getIdentite($siren);
$indiscore = $ws->getIndiScore($siren);
$infos = $ws->getRatios($siren, 'indiscore2');
$score = array();
@ -323,11 +297,13 @@ class EvaluationController extends Zend_Controller_Action
$annees = array_slice($annees, 0, $nbMaxBilan);
sort($annees);
$tabResult = array();
foreach($annees as $annee) {
foreach($annees as $annee)
{
$data = array();
$dataEvol = array();
//Formatter les données
foreach($tabRatio as $idRatio => $valRatio) {
foreach($tabRatio as $idRatio => $valRatio)
{
$data[$idRatio] = $ratiosData->dRatio($typeBilan, $annee, $idRatio);
$dataTotal[$idRatio] = $ratiosData->dTotal($typeBilan, $annee, $idRatio, $valRatio['total']);
$dInfo[$idRatio] = $valRatio['total_info'];
@ -465,7 +441,7 @@ class EvaluationController extends Zend_Controller_Action
$email = $request->getParam('email', '');
$infos = $ws->getRapport($siren, 3, 0, $plus, $ref, $encours, $email);
$this->logger->info(print_r($infos,1));
Zend_Registry::get('firebug')->info($infos);
if ($infos === false) {
$this->forward('soap', 'error');
}
@ -557,7 +533,7 @@ class EvaluationController extends Zend_Controller_Action
$file = 'evaluation-indiscore3-'.$this->siret.'.html';
}
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared.'/pages';
$path = $c->profil->path->pages;
if (file_exists($path.'/'.$file))
{
$doc = new DOMDocument();
@ -630,7 +606,7 @@ class EvaluationController extends Zend_Controller_Action
$xml = $doc->saveXML();
$c = Zend_Registry::get('config');
$outfile = $c->profil->path->shared.'/pages/p'.$user->getIdClient().'-'.$file;
$outfile = $c->profil->path->pages.'/p'.$user->getIdClient().'-'.$file;
file_put_contents($outfile, $xml);
//Génération du pdf
@ -643,8 +619,10 @@ class EvaluationController extends Zend_Controller_Action
if (file_exists($pdfFile)){
echo '<center>Votre fichier est prêt pour être téléchargé !<br />' .
'<a target="_blank" href="'.$this->view->url(array('module'=>'file', 'controller'=>'index',
'action'=>'customrapport', 'q'=>basename($pdfFile)), 'default', true).'">Télécharger</a></center>';
'<a target="_blank" href="'.$this->view->url(
array('controller'=>'fichier',
'action'=>'customrapport',
'fichier'=>basename($pdfFile)), 'default', true).'">Télécharger</a></center>';
} else {
echo "Erreur lors de la génération du PDF.";
}
@ -839,7 +817,7 @@ class EvaluationController extends Zend_Controller_Action
"<pre>".print_r($InfoEnq, 1)."</pre>";
$mail = new Scores_Mail_Method();
$mail->setFromKey('supportdev');
$mail->setFromKey('production');
$mail->addToKey('support');
$mail->setSubject($sujet);
$mail->setBodyHtml($texte);
@ -910,10 +888,9 @@ class EvaluationController extends Zend_Controller_Action
'</body>'.
'</xmlrequest>';
$date = date('Ymd');
$url = 'https://www.creditsafe.fr/getdata/service/CSFRServices.asmx/GetData?RequestXmlStr='.$req;
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/creditsafe/'.$this->siret.'.xml';
$date = date('Ymd');
$url = 'https://www.creditsafe.fr/getdata/service/CSFRServices.asmx/GetData?RequestXmlStr='.$req;
$file = APPLICATION_PATH.'/../../data/creditsafe/'.$this->siret.'.xml';
try {
$client = new Zend_Http_Client($url);
@ -1008,12 +985,12 @@ class EvaluationController extends Zend_Controller_Action
'Utilisateur='.$login;
$mail->setBodyText($texte);
$mail->setFromKey('supportdev');
$mail->setFromKey('contact');
$mail->addToKey('contact');
$mail->execute();
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared.'/persist/log';
$path = $c->profil->path->data.'/log';
$fp=fopen($path.'/surveillance_scf.csv', 'a');
fwrite($fp, date('Y/m/d H:i:s').";$siren;".$email.';'.$login.';'.$user->getEmail().';'.$user->getIpAddress()."\n");
@ -1048,11 +1025,11 @@ class EvaluationController extends Zend_Controller_Action
require_once 'Scores/RapportComment.php';
$rapportComment = new RapportComment($siren, $this->id,
$infos->Indiscore->tabCommentaires->item,
$infos->RatiosInfos,
$infos->RatiosBilansInfos,
$infos->RatiosSecteur,
$infos->Indiscore->tabVariables
$infos->Indiscore->tabCommentaires->item,
$infos->RatiosInfos,
$infos->RatiosBilansInfos,
$infos->RatiosSecteur,
$infos->Indiscore->tabVariables
);
$this->view->assign('comment',$rapportComment->out());
@ -1062,35 +1039,4 @@ class EvaluationController extends Zend_Controller_Action
$this->view->assign('raisonSociale', $sessionEntreprise->getRaisonSociale());
$this->view->assign('exportObjet', $infos);
}
public function cadastreAction()
{
$this->view->headTitle()->prepend("Cadastre");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$request = $this->getRequest();
$sessionEntreprise = new Scores_Session_Entreprise($this->siret, $this->id);
$siren = substr($this->siret,0,9);
$ws = new Scores_Ws_Client('entreprise', '0.9');
$params = new stdClass();
$params->companyId = $siren;
try {
$response = $ws->getCadastrePatrimoine($params);
if ($response === false) {
$this->forward('soap', 'error');
}
$this->view->List = $response->item;
} catch (Exception $e) {
$this->view->MsgTxt = $e->getMessage();
}
$this->view->assign('siret', $this->siret);
$this->view->assign('id', $this->id);
$this->view->assign('siren', $siren);
$this->view->assign('raisonSociale', $sessionEntreprise->getRaisonSociale());
}
}

View File

@ -0,0 +1,487 @@
<?php
class FichierController extends Zend_Controller_Action
{
public function init()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}
public function indexAction(){}
/**
* Gestion du chargement des logos
*/
public function logoAction()
{
$file = $this->getRequest()->getParam('fichier');
$explode = explode('.', $file);
switch ($explode[1]) {
case 'png' : $content_type = 'image/png'; break;
case 'gif' : $content_type = 'image/gif'; break;
case 'jpeg':
case 'jpg' : $content_type = 'image/jpeg'; break;
}
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->data).'/logos/';
if ( file_exists($path.$file) ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo 'Impossible de charger le logo.';
}
}
/**
* Gestion du chargement des images du cache
*/
public function imgcacheAction()
{
$content_type = 'image/png';
$c = Zend_Registry::get('config');
$path = $c->profil->path->pages.'/imgcache/';
$file = $this->getRequest()->getParam('fichier');
if ( file_exists($path.$file) ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo 'Impossible de charger le fichier.';
}
}
/**
* Gestion du chargement des fichiers des marques
*/
public function marqueAction()
{
$content_type = 'application/pdf';
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->data).'/marques/';
$file = $this->getRequest()->getParam('fichier');
if(file_exists($path.$file) && filesize($path.$file)>0) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo "Erreur lors de l'affichage du fichier.";
}
}
/**
* Gestion des fichiers Actes et Bilans
*/
public function pdfAction()
{
$file = $this->getRequest()->getParam('fichier');
$content_type = 'application/pdf';
$c = Zend_Registry::get('config');
//bilan
if (preg_match('/^bilan-[0-9]{9}-(consolides|sociaux)-([0-9]{8})/', $file, $matches)) {
$path = realpath($c->profil->path->data).
'/greffes/bilans/'.$matches[1].'/'.substr($matches[2],0,4).'/';
}
//acte
else if (preg_match('/^acte-[0-9]{9}-(.*)-([0-9]{8})-.*-.*-.*-.*-.*-.*$/', $file, $matches)) {
$type = $matches[1];
$date = $matches[2];
$annee = substr($date,0,4);
$mois = substr($date,4,2);
$path = realpath($c->profil->path->data).'/greffes/actes/'.$annee.'/'.$mois.'/';
}
Zend_Registry::get('firebug')->info($path);
if(file_exists($path.$file) && filesize($path.$file)>0) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo "Erreur lors de l'affichage du fichier.";
}
}
/**
* Gestion des fichiers Actes et Bilans
*/
public function pdfassociationAction()
{
$content_type = 'application/pdf';
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->data).'/association/';
$file = $this->getRequest()->getParam('fichier');
$type = $this->getRequest()->getParam('type');
$file = $type.'/'.$file;
if(file_exists($path.$file) && filesize($path.$file)>0) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo "Erreur lors de l'affichage du fichier.";
}
}
/**
* Gestion des liasses au format excel
*/
public function liasseAction()
{
$content_type = 'application/vnd.ms-excel';
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->files).'/';
$file = $this->getRequest()->getParam('fichier');
//Envoi du fichier sur la sortie standard
if ( file_exists($path.$file) ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo 'Impossible de charger le fichier.';
}
}
/**
* Gestion des log de consommation
*/
public function consommationAction()
{
$file = $this->getRequest()->getParam('fichier');
$content_type = 'application/csv-tab-delimited-table';
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->files).'/';
//Envoi du fichier sur la sortie standard
if ( file_exists($path.$file) ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo 'Impossible de charger le fichier.';
}
}
/**
* Export du portefeuille au format CSV
*/
public function portefeuilleAction()
{
$file = $this->getRequest()->getParam('fichier');
$content_type = 'application/csv-tab-delimited-table';
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->files).'/';
//Envoi du fichier sur la sortie standard
if ( file_exists($path.$file) ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo 'Impossible de charger le fichier.';
}
}
/**
* Export de la liste des surveillances au format CSV
*/
public function surveillanceAction()
{
$file = $this->getRequest()->getParam('fichier');
$content_type = 'application/csv-tab-delimited-table';
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->files).'/';
//Envoi du fichier sur la sortie standard
if ( file_exists($path.$file) ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo 'Impossible de charger le fichier.';
}
}
/**
* Gestion des fichiers bilan saisie par les clients
*/
public function bilanclientAction()
{
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->data).'/bilanclient/';
$file = $this->getRequest()->getParam('fichier');
$explode = explode('.', $file);
switch ($explode[1]) {
case 'pdf' : $content_type = 'application/pdf'; break;
case 'tiff' : $content_type = 'image/tiff'; break;
}
if ( file_exists($path.$file) && filesize($path.$file)>0 ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo "Erreur lors de l'affichage du fichier.";
}
}
/**
* Gestion des kbis
*/
public function kbisAction()
{
$content_type = 'application/pdf';
$file = $this->getRequest()->getParam('fichier');
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->files).'/';
if ( file_exists($path.$file) && filesize($path.$file)>0 ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo "Erreur lors de l'affichage du fichier.";
}
}
/**
* Gestion des rapports personnalisés
*/
public function customrapportAction()
{
$content_type = 'application/pdf';
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->pages).'/';
$file = $this->getRequest()->getParam('fichier');
$output_file = $directory.'/'.$file;
if ( file_exists($path.$file) && filesize($path.$file)>0 ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo "Impossible de charger le fichier.";
}
}
/**
* Gestion bodacc au format PDF
*/
public function bodaccAction()
{
$content_type = 'application/pdf';
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->data).'/bodacc/';
$file = $this->getRequest()->getParam('fichier');
//Construire le chemin du dossier
preg_match('/BODACC_(A|B|C)_([0-9]{4})_(.*)\.pdf/', $file, $matches);
$path.= $matches[1].'/'.$matches[2].'/';
if ( file_exists($path.$file) && filesize($path.$file)>0 ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo "Impossible de charger le fichier.";
}
}
/**
* Gestion des fichiers PDF des nouveautés
*/
public function newAction()
{
$content_type = 'application/pdf';
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->data).'/nouveautes/';
$file = $this->getRequest()->getParam('fichier');
if ( file_exists($path.$file) && filesize($path.$file)>0 ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo "Impossible de charger le fichier.";
}
}
/**
* Bodacc history file
*/
public function histopdfAction()
{
$content_type = 'application/pdf';
$file = $this->getRequest()->getParam('fichier');
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->files).'/';
if ( file_exists($path.$file) && filesize($path.$file)>0 ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo "Impossible de charger le fichier.";
}
}
/**
* Internal files for groupes
*/
public function groupesAction()
{
$content_type = 'application/pdf';
$file = $this->getRequest()->getParam('fichier');
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->data).'/groupes/';
if ( file_exists($path.$file) && filesize($path.$file)>0 ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo "Impossible de charger le fichier.";
}
}
/**
* Bilan : Association
*/
public function greffeAction()
{
$content_type = 'application/pdf';
$file = $this->getRequest()->getParam('fichier');
$c = Zend_Registry::get('config');
$path = $c->profil->path->files.'/';
Zend_Registry::get('firebug')->info($path.$file);
if ( file_exists($path.$file) && filesize($path.$file)>0 ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo "Impossible de charger le fichier.";
}
}
/**
* Façade d'immeuble
*/
public function streetviewAction()
{
$file = $this->getRequest()->getParam('fichier');
$explode = explode('.', $file);
switch ($explode[1]) {
case 'png' : $content_type = 'image/png'; break;
case 'gif' : $content_type = 'image/gif'; break;
case 'jpeg':
case 'jpg' : $content_type = 'image/jpeg'; break;
}
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->data).'/google/streetview/';
if ( file_exists($path.$file) ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
} else {
echo file_get_contents(APPLICATION_PATH.'/../public/themes/default/images/1x1.png');
}
}
}

View File

@ -5,18 +5,8 @@ class FinanceController extends Zend_Controller_Action
protected $siret = null;
protected $id = 0;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
@ -182,10 +172,10 @@ class FinanceController extends Zend_Controller_Action
$request = $this->getRequest();
$ratio = $request->getParam('ratio');
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared . '/pages/imgcache/';
$path = $c->profil->path->pages . '/imgcache/';
$file = 'syntheseEvol-'.$this->siret.'-'.$this->id.'-'.$ratio.'.png';
if (file_exists($path.$file)) {
echo '<img src="/file/image/cache/q/'.$file.'" />';
echo '<img src="/fichier/imgcache/'.$file.'" />';
} else {
echo "Erreur de génération du graphique";
}
@ -201,10 +191,10 @@ class FinanceController extends Zend_Controller_Action
$request = $this->getRequest();
$typeBilan = $request->getParam('typeBilan');
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared . '/pages/imgcache/';
$path = $c->profil->path->pages . '/imgcache/';
$file = 'synthese-linecompare-'.$this->siret.'-'.$this->id.'-'.$typeBilan.'.png';
if (file_exists($path.$file)) {
echo '<img src="/file/image/cache/q/'.$file.'" />';
echo '<img src="/fichier/imgcache/'.$file.'" />';
} else {
echo "Erreur de génération du graphique";
}
@ -444,7 +434,7 @@ class FinanceController extends Zend_Controller_Action
$dateCloture = $request->getParam('dateCloture');
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared . '/pages/imgcache/';
$path = $c->profil->path->pages . '/imgcache/';
switch($type){
case 'actif':
$file = 'bilansgraphactif-'.$this->siret.'-'.$this->id.'-'.$typeBilan.$dateCloture.'.png';
@ -457,7 +447,7 @@ class FinanceController extends Zend_Controller_Action
break;
}
if (file_exists($path.$file)) {
echo '<img src="/file/image/cache/q/'.$file.'" />';
echo '<img src="/fichier/imgcache/'.$file.'" />';
} else {
echo "Erreur de génération du graphique";
}
@ -640,10 +630,10 @@ class FinanceController extends Zend_Controller_Action
$request = $this->getRequest();
$ratio = $request->getParam('ratio');
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared . '/pages/imgcache/';
$path = $c->profil->path->pages . '/imgcache/';
$file = 'ratiosgraph-'.$this->siret.'-'.$this->id.'-'.$ratio.'.png';
if (file_exists($path.$file)) {
echo '<img src="/file/image/cache/q/'.$file.'" />';
echo '<img src="/fichier/imgcache/'.$file.'" />';
} else {
echo "Erreur de génération du graphique";
}
@ -687,7 +677,7 @@ class FinanceController extends Zend_Controller_Action
$data[$element->id] = $element->val;
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared . '/files/';
$path = $c->profil->path->files . '/';
$file = 'liasse-'.substr($this->siret, 0, 9).'-'.$this->id.'-'.$type.$date.'.xls';
$liasse = new Scores_Finance_Liasse_XLS($model);
@ -746,7 +736,7 @@ class FinanceController extends Zend_Controller_Action
if ($result === false) {
$this->view->msg = "Erreur lors de l'enregistrement des informations";
} else {
$this->logger->info(print_r($result,1));
Zend_Registry::get('firebug')->info($result);
$this->view->ref = strtoupper($result);
$this->view->fileref = $params['siren'] . '_' . $params['format'] . '_' .
substr($params['dateCloture'],6,4) . substr($params['dateCloture'],3,2) .
@ -793,7 +783,7 @@ class FinanceController extends Zend_Controller_Action
if ( in_array($extension, $extValide) ) {
$name = $fileref.'.'.$extension;
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/persist/bilanclient/'.$name;
$file = realpath($c->profil->path->data).'/bilanclient/'.$name;
if ( move_uploaded_file($tmp_name, $file) ) {
$ws = new Scores_Ws_Client('order', '0.1');
$parameters = new stdClass();
@ -850,9 +840,8 @@ class FinanceController extends Zend_Controller_Action
$entreprise = new Scores_Session_Entreprise($this->siret, $this->id);
$this->view->assign('raisonSociale', $entreprise->getRaisonSociale());
$this->view->assign('siren', substr($this->siret, 0, 9));
$this->view->assign('siren', substr($this->siret, 0, 9));
$this->view->assign('siret', $this->siret);
$this->view->assign('idClient', $user->identity->idClient);
$this->view->haveLiasse = ($bilanList->nbReponses > 0) ? true : false;
@ -942,6 +931,8 @@ class FinanceController extends Zend_Controller_Action
$request = $this->getRequest();
$unite = $request->getParam('unit','K');
$entreprise = new Scores_Session_Entreprise($this->siret, $this->id);
$ws = new WsScores();
// Récupération de la date
$dateAndType = $request->getParam('date', $defaultTypeBilan.$defaultDateExercice);
@ -952,51 +943,38 @@ class FinanceController extends Zend_Controller_Action
$date = substr($dateAndType, 1);
// Récupération des postes du bilan
try {
$ws = new Scores_Ws_Client('entreprise', '0.8');
$params = new stdClass();
$params->siren = substr($this->siret, 0, 9);
$params->millesime = $date;
$params->typeBilan = $type;
$params->ref = '';
$infos = $ws->getBilan($params);
$infos = $ws->getBilan(substr($this->siret, 0, 9), $date, $type, true);
if ($infos === false) $this->forward('soap', 'error');
// Error
if ($infos === false) {
$this->forward('soap', 'error');
}
// Formatage de la liasse
$infoLiasse = new Scores_Finance_Liasse($infos, $unite);
$this->view->assign('dateCloture', $infoLiasse->getInfo('dateCloture'));
$this->view->assign('dateCloturePre', $infoLiasse->getInfo('dateCloturePre'));
// Formatage de la liasse
$infoLiasse = new Scores_Finance_Liasse($infos, $unite);
$this->view->assign('dateCloture', $infoLiasse->getInfo('dateCloture'));
$this->view->assign('dateCloturePre', $infoLiasse->getInfo('dateCloturePre'));
$date = new Zend_Date($infoLiasse->getInfo('dateCloture'), 'yyyyMMdd');
$this->view->assign('dateClotureD', $date->toString('dd/MM/yyyy'));
$date = new Zend_Date($infoLiasse->getInfo('dateCloture'), 'yyyyMMdd');
$this->view->assign('dateClotureD', $date->toString('dd/MM/yyyy'));
$dateCloturePre = $infoLiasse->getInfo('dateCloturePre');
if ($dateCloturePre == '') {
$this->view->assign('dateCloturePreD', '-');
} else {
$date = new Zend_Date($dateCloturePre, 'yyyyMMdd');
$this->view->assign('dateCloturePreD', $date->toString('dd/MM/yyyy'));
}
$this->view->assign('dureesMois', $infoLiasse->getInfo('dureeMois'));
$this->view->assign('dureesMoisPre', $infoLiasse->getInfo('dureeMoisPre'));
$this->view->assign('date', $date);
$this->view->assign('champType', $type);
$this->view->assign('liasse', $infoLiasse->getPostes());
$this->view->assign('ancres', $ancres[$type]);
} catch (Exception $e) {
$this->view->msg = $e->getMessage();
$dateCloturePre = $infoLiasse->getInfo('dateCloturePre');
if ( $dateCloturePre == '' ) {
$this->view->assign('dateCloturePreD', '-');
} else {
$date = new Zend_Date($dateCloturePre, 'yyyyMMdd');
$this->view->assign('dateCloturePreD', $date->toString('dd/MM/yyyy'));
}
$this->view->assign('dureesMois', $infoLiasse->getInfo('dureeMois'));
$this->view->assign('dureesMoisPre', $infoLiasse->getInfo('dureeMoisPre'));
$this->view->assign('date', $date);
$this->view->assign('champType', $type);
$this->view->assign('liasse', $infoLiasse->getPostes());
$this->view->assign('ancres', $ancres[$type]);
//Gestion export de la liasse au format XLS
if ( $user->checkPerm('liassexls') && in_array($type,array('C', 'N', 'S')) ) {
if ( $user->checkPerm('liassexls') & in_array($type,array('C', 'N', 'S')) ) {
$this->view->assign('exportxls', true);
}
}
$this->view->assign('id', $id);
@ -1065,16 +1043,11 @@ class FinanceController extends Zend_Controller_Action
$infos = $this->getRequest()->getParam('infos');
}
$user = new Scores_Utilisateur();
$this->view->assign('edition', $user->checkModeEdition());
$entreprise = new Scores_Session_Entreprise($this->siret, $this->id);
$this->view->assign('banques', isset($infos->result->item)?$infos->result->item:array());
$this->view->assign('banques', $infos->result->item);
$this->view->assign('raisonSociale', $entreprise->getRaisonSociale());
$this->view->assign('siren', substr($this->siret, 0, 9));
$this->view->assign('exportObjet', $infos);
$this->view->assign('siret', $this->siret);
}
/**

View File

@ -40,18 +40,9 @@ class GiantController extends Zend_Controller_Action
'NL' => 'The Netherlands',
);
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
@ -418,7 +409,7 @@ class GiantController extends Zend_Controller_Action
{
$this->_helper->layout()->disableLayout();
$this->view->headScript()->appendFile($this->theme->pathScript.'/giant_monitoring.js', 'text/javascript');
$this->view->headScript()->appendFile($this->theme->pathScript.'/giant.js', 'text/javascript');
$this->view->headScript()->appendFile$this->theme->pathScript.'/giant.js', 'text/javascript');
$auth = Zend_Auth::getInstance();
$identity = $auth->getIdentity();
$result = $auth->getStorage()->read($identity);

View File

@ -5,18 +5,8 @@ class IdentiteController extends Zend_Controller_Action
protected $siret = null;
protected $id = 0;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
@ -157,7 +147,6 @@ class IdentiteController extends Zend_Controller_Action
'Isin',
'Capitalisation',
'NumRC',
'NumRM',
'AutreId',
'Actif',
'SituationJuridique',
@ -181,7 +170,6 @@ class IdentiteController extends Zend_Controller_Action
'Groupe',
'ActiviteEn',
'ActiviteEt',
'ActiviteArtisanale',
'Naf4',
'Nace',
'NatureActivite',
@ -407,8 +395,6 @@ class IdentiteController extends Zend_Controller_Action
}
} else {
$pageTotal = $pageCurrent = 1;
$pagePrev = 1;
$pageNext = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', $pagePrev);
@ -443,7 +429,7 @@ class IdentiteController extends Zend_Controller_Action
$this->view->AuthorizeGeocode = $userAccessEdition;
// --- Gestion source
$mapSource = 'openstreetmap';
$mapSource = 'google';
if ($mapSource == 'google') {
$this->view->headScript()->appendFile('http://maps.google.com/maps/api/js?sensor=false', 'text/javascript');
}
@ -467,7 +453,7 @@ class IdentiteController extends Zend_Controller_Action
$ws = new WsScores();
$infos = $ws->getEtablissementsGeo($siren, $actif, $position, $nbAffichage);
$this->logger->info(print_r($infos,1));
Zend_Registry::get('firebug')->info($infos);
if ($infos === false) $this->forward('soap', 'error');
$etabs = $infos->result->item;
@ -511,20 +497,20 @@ class IdentiteController extends Zend_Controller_Action
$iconeMarqueur = $this->iconeDuMarqueur($etab->NafEtab, $etab->Siege, $etab->Actif);
$icone = 'etab1.png';
$icone = '';
if ( !empty($iconeMarqueur) ) {
$icone = $iconeMarqueur;
$icone = 'http://'.$_SERVER['SERVER_NAME'].'/themes/default/images/maps/'.$iconeMarqueur;
}
$gps = array();
if ( floatval($etab->GeoLatitude) != 0 && floatval($etab->GeoLongitude) != 0 ) {
$gps = array(
'lat' => $etab->GeoLatitude*1,
'lon' => $etab->GeoLongitude*1,
'lat' => $etab->GeoLatitude,
'lon' => $etab->GeoLongitude,
);
}
$marks[] = array(
'siret' => $siren.' '.$etab->Nic,
'siret' => $siren.$etab->Nic,
'address' => $adresse,
'title' => $titre,
'text' => $texte,
@ -533,7 +519,7 @@ class IdentiteController extends Zend_Controller_Action
'gps' => $gps,
);
}
$this->logger->info(print_r($marks,1));
Zend_Registry::get('firebug')->info($marks);
}
$this->view->assign('marks', json_encode($marks));
}
@ -1083,7 +1069,7 @@ class IdentiteController extends Zend_Controller_Action
$ws = new WsScores();
$result = $ws->getLienRef($id);
$this->logger->info(print_r($result,1));
Zend_Registry::get('firebug')->info($result);
$this->view->assign('result', $result);
$this->view->assign('idFiche', $id);
@ -1173,8 +1159,6 @@ class IdentiteController extends Zend_Controller_Action
}
} else {
$pageTotal = $pageCurrent = 1;
$pagePrev = 1;
$pageNext = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', $pagePrev);
@ -1236,55 +1220,34 @@ class IdentiteController extends Zend_Controller_Action
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
// ==> Start
$avis = new Scores_Insee_AvisSituation($this->siret);
// --- En environement de preprod, on envoi sur le site
if (APPLICATION_ENV == 'staging') {
$this->redirect('http://avis-situation-sirene.insee.fr/');
}
// --- Téléchargement du fichier et distribution
else {
$avis = new Scores_Insee_AvisSituation($this->siret);
if ( !$avis->erreur() ) {
$avis->erreurcpt('raz');
$file = $avis->get();
if ($file === false) {
$avis->erreurcpt('plus');
echo $avis->erreurmsg();
} else {
// --- Envoi du fichier sur la sortie standard
$content_type = 'application/pdf';
if ( file_exists($file) ) {
$ws = new WsScores();
$ws->setLog('avis_situation', $this->siret, 0, '');
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
} else {
if ($avis->nberreur()==5){
$avis->mailerreur();
}
$avis->erreurcpt('plus');
echo $avis->erreurmsg();
}
if (!$avis->erreur()){
$avis->erreurcpt('raz');
$body = $avis->get('pdf', 1);
if($body !== false) {
header("Pragma: public");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: must-revalidate");
header("Content-type: application/pdf");
header("Content-Length: ".strlen($body));
header('Content-disposition: inline; filename="avis-'.$this->siret.'.pdf"');
header("Accept-Ranges: ".strlen($body));
echo $body;
$ws = new WsScores();
$ws->setLog('avis_situation', $this->siret, 0, '');
} else {
$avis->erreurcpt('plus');
echo $avis->erreurmsg();
}
} else {
if ($avis->nberreur()==5){
$avis->mailerreur();
}
$avis->erreurcpt('plus');
echo $avis->erreurmsg();
}
}
@ -1352,9 +1315,9 @@ class IdentiteController extends Zend_Controller_Action
//Corriger la voie pour Mappy
$adresse.= ' '.strtr($infos->AdresseVoie, array(
'R' => 'RUE',
'AV' => 'AVENUE',
'RLE' => 'RUELLE',
'R' => 'RUE',
'AV' => 'AVENUE',
'RLE' => 'RUELLE',
));
$adresse.= ' '.$infos->AdresseRue;
@ -1382,10 +1345,8 @@ class IdentiteController extends Zend_Controller_Action
public function streetviewAction()
{
$request = $this->getRequest();
$num = $request->getParam('heading', 0);
// --- Prepare information
if ($request->isXmlHttpRequest()) {
if ( $request->isXmlHttpRequest() ) {
$this->_helper->layout()->disableLayout();
$siret = $request->getParam('siret');
$lat = $request->getParam('lat', '');
@ -1404,9 +1365,9 @@ class IdentiteController extends Zend_Controller_Action
//Corriger la voie
$adresse.= strtr($infos->AdresseVoie, array(
'R' => 'RUE',
'AV' => 'AVENUE',
'RLE' => 'RUELLE',
'R' => 'RUE',
'AV' => 'AVENUE',
'RLE' => 'RUELLE',
));
$adresse.= ' '.$infos->AdresseRue;
@ -1420,57 +1381,48 @@ class IdentiteController extends Zend_Controller_Action
}
}
$user = new Scores_Utilisateur();
$this->view->AuthorizeUpdate = $user->checkModeEdition();
$num = $request->getParam('heading', 0);
$this->view->assign('siret', $siret);
$this->view->assign('lat', $lat);
$this->view->assign('lon', $lon);
$file = false;
$mode = 'address';
$this->view->assign('streetviewMode', $mode);
if (intval($siret) < 1000) {
$this->view->assign('url', false);
} else {
$streetview = new Scores_Google_Streetview($siret);
if ( $mode == 'address' && $adresse !== null ) {
$streetview = new Scores_Google_Streetview($siret);
$streetview->setLocationTxt($adresse);
$url = $streetview->serveUrl();
$this->view->assign('url', $url);
}
// --- Affichage GPS
if ($lat != '' && $lon != '') {
$this->view->assign('streetviewMode', 'GPS');
$deg = $streetview->getNumDeg();
$nbImg = count($deg);
$pagePrec = $num-1;
if ($pagePrec<=0) {
$pagePrec = $nbImg-1;
}
$pageSuiv = $num+1;
if($pageSuiv>=$nbImg) {
$pageSuiv = 0;
}
$this->view->assign('pagePrec', $pagePrec);
$this->view->assign('pageSuiv', $pageSuiv);
if ( $mode == 'GPS' && intval($siret)>100 && $lat != '' && $lon != '' ) {
$streetview = new Scores_Google_Streetview($siret);
$deg = $streetview->getNumDeg();
$nbImg = count($deg);
$pagePrec = $num-1;
if ($pagePrec<=0) {
$pagePrec = $nbImg-1;
}
$pageSuiv = $num+1;
if($pageSuiv>=$nbImg) {
$pageSuiv = 0;
}
$this->view->assign('pagePrec', $pagePrec);
$this->view->assign('pageSuiv', $pageSuiv);
$streetview->setLocationGeo($lat, $lon);
$heading = $deg[$num];
$streetview->setHeading($heading);
}
// --- Fallback adresse
elseif (!empty($adresse)) {
$this->view->assign('streetviewMode', 'ADDRESS');
$streetview->setLocationTxt($adresse);
}
$streetview->setLocationGeo( $lat, $lon );
$heading = $deg[$num];
$streetview->setHeading($heading);
$img = $streetview->serveImg();
if ( $img!==false ) {
$url = '/fichier/streetview/'.$img;
$this->view->assign('url', $url);
}
}
$file = $streetview->pathImg();
if ($file !== false) {
$this->view->assign('url', '/file/streetview/img/q/'.$streetview->fileImg());
$this->view->assign('cache', 1);
$this->view->assign('saveas', '');
} else {
$this->view->assign('url', $streetview->urlImg());
$this->view->assign('cache', 0);
$this->view->assign('saveas', $streetview->fileImg());
}
}
}
/**
@ -1499,9 +1451,10 @@ class IdentiteController extends Zend_Controller_Action
$ws = new WsScores();
$result = $ws->getGroupesArbo($siren, $pctMin, 10, $stopAtIsin);
if ( $result!==false ) {
$infos = json_decode($result, true);
$this->logger->info(print_r($infos,1));
Zend_Registry::get('firebug')->info($infos);
if (count($infos)>0) {
$name = $infos['name'];
@ -1511,8 +1464,8 @@ class IdentiteController extends Zend_Controller_Action
$structure = array();
$structure[] = array(
'text' => $name,
'state' => array('opened'=>true),
'data' => $name,
'state' => 'open',
'children' => $this->groupesArboChildren($infos['children'], $siren),
);
$this->view->assign('data', json_encode($structure));
@ -1549,7 +1502,7 @@ class IdentiteController extends Zend_Controller_Action
if ( $result!==false ) {
$infos = json_decode($result, true);
$this->logger->info(print_r($infos,1));
Zend_Registry::get('firebug')->info($infos);
if (count($infos)>0) {
$sirenTxt = substr($infos['siren'],0,3).' '.substr($infos['siren'],3,3).' '.substr($infos['siren'],6,3);
@ -1563,8 +1516,8 @@ class IdentiteController extends Zend_Controller_Action
$structure = array();
$structure[] = array(
'text' => $name,
'state' => array('opened'=>true),
'data' => $name,
'state' => 'open',
'children' => $this->groupesArboChildren($infos['children'], $siren),
);
$this->view->assign('data', json_encode($structure));
@ -1598,8 +1551,8 @@ class IdentiteController extends Zend_Controller_Action
$name.= ' - '.$item['pmin'].'%';
$structure = array(
'text' => $name,
'state' => array('opened'=>true),
'data' => $name,
'state' => 'open',
);
if ($item['siren']==$detectSiren) {
@ -1666,7 +1619,7 @@ class IdentiteController extends Zend_Controller_Action
$ws = new WsScores();
$result = $ws->getContactEt($companyId, $filter);
$this->logger->info(print_r($result,1));
Zend_Registry::get('firebug')->info($result);
if ($result->nbReponses>0) {
$this->view->assign('contacts', $result->result->item);
@ -1730,7 +1683,7 @@ class IdentiteController extends Zend_Controller_Action
$ws = new WsScores();
$result = $ws->getEntrepriseAvisRncs($siren);
$this->logger->info(print_r($result,1));
Zend_Registry::get('firebug')->info($result);
if ( $result === false ) {
$this->view->assign('error', true);
@ -1909,7 +1862,7 @@ class IdentiteController extends Zend_Controller_Action
$ws = new WsScores();
$result = $ws->getEntrepriseAvisRncs($siren);
$this->logger->info(print_r($result,1));
Zend_Registry::get('firebug')->info($result);
if ( $result === false ) {
$this->view->assign('error', true);
@ -2068,7 +2021,7 @@ class IdentiteController extends Zend_Controller_Action
// --- Création du PDF
$c = Zend_Registry::get('config');
$filepdf = $c->profil->path->shared.'/files/avisrncs-'.$siren.'.pdf';
$filepdf = $c->profil->path->files.'/avisrncs-'.$siren.'.pdf';
try {
$pdf = new Scores_Pdf_Tcpdf();
$pdf->SetBackgroundImage('libs/modeles/avisrncs.jpg');
@ -2326,11 +2279,10 @@ class IdentiteController extends Zend_Controller_Action
$this->view->assign('adresse', $session->getAdresse());
if ($this->view->hasRight) {
$source = str_pad($session->getSource(), 3, '0', STR_PAD_LEFT);
$sourceId = str_pad($session->getSourceId(), 17, '0', STR_PAD_LEFT);
$ws = new Scores_Ws_Client('entreprise', '0.9');
$ws = new Scores_Ws_Client('entreprise', '0.9');
$params = new stdClass();
$params->companyId = $source . $sourceId;
$params->companyId = $this->siret;
$params->type = 'siren';
$response = $ws->getRNVP($params);
if ($response === false) {
$this->view->Error = true;

View File

@ -3,19 +3,6 @@ class IndexController extends Zend_Controller_Action
{
protected $theme;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
}
/**
* Page d'accueil et de redirection
*/
@ -58,7 +45,7 @@ class IndexController extends Zend_Controller_Action
if (intval($version) == 2) {
$log = Zend_Registry::get('config')->profil->path->shared.'/log/altisys.log';
$log = Zend_Registry::get('config')->profil->path->data.'/log/altisys.log';
$user = new Scores_Utilisateur();
$login = $user->getLogin();
@ -68,7 +55,7 @@ class IndexController extends Zend_Controller_Action
$content_type = 'application/csv-tab-delimited-table';
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared.'/files/';
$path = realpath($c->profil->path->files).'/';
//Envoi du fichier sur la sortie standard
if ( file_exists($path.$file) ) {
header('Content-Transfer-Encoding: none');
@ -97,7 +84,7 @@ class IndexController extends Zend_Controller_Action
$ws = new WsScores();
$reponse = $ws->getPortefeuilleCsv($login, $idClient);
$log = Zend_Registry::get('config')->profil->path->shared.'/log/altisys.log';
$log = Zend_Registry::get('config')->profil->path->data.'/log/altisys.log';
if ($reponse === false){
file_put_contents($log, date('Y-m-d H:i:s')." - URL = ERREUR\n", FILE_APPEND);

View File

@ -0,0 +1,473 @@
<?php
class JuridiqueController extends Zend_Controller_Action
{
protected $theme;
protected $siret = null;
protected $id = 0;
public function init()
{
// --- Theme
$this->theme = Zend_Registry::get('theme');
$request = $this->getRequest();
$this->siret = $request->getParam('siret');
$this->id = $request->getParam('id', 0);
require_once 'Scores/WsScores.php';
}
/**
* Affichage de la liste des annonces ou d'une annonce
*/
public function annoncesAction()
{
$request = $this->getRequest();
$autrePage = $request->getParam('apage');
$vue = $request->getParam('vue', 'bodacc');
$idAnn = $request->getParam('idAnn', null);
$siren = substr($this->siret, 0,9);
$source = $request->getParam('source');
if (!empty($source)) {
switch ($source){
case 1: $vue='bodacc'; break;
case 2: $vue='balo'; break;
case 3: $vue='asso'; break;
}
}
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$fj = $session->getFormeJuridique();
if ( $fj>9000 && $fj<9999 && intval($siren)==0 ) {
$vue = 'asso';
}
$this->view->assign('id', $session->getId());
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$this->view->assign('AutrePage', $autrePage);
if ($session->getSource()=='006' || $session->getSourceId()=='007') {
$this->view->assign('AutreSource', true);
} else {
$this->view->assign('vue', $vue);
//Pagination
$page = $request->getParam('page', 1);
if ( $page <= 0 ) $page = 1;
$nbAffichage = 20;
$position = ($page - 1 ) * $nbAffichage;
$ws = new WsScores();
switch ( $vue ) {
case 'bodacc':
case 'abod':
default:
if(intval($siren)==0) {
$idAnn = $session->getSourceId();
}
$infos = $ws->getAnnoncesLegales($siren, $idAnn, null, $position, $nbAffichage);
break;
case 'balo':
$infos = $ws->getAnnoncesBalo($siren, $idAnn, null, $position, $nbAffichage);
break;
case 'asso':
if ( intval($siren)==0 && substr($session->getAutreId(),0,1)=='W' ) {
$infos = $ws->getAnnoncesAsso($session->getAutreId(), $idAnn, null, $position, $nbAffichage);
} elseif (intval($siren)!=0) {
$infos = $ws->getAnnoncesAsso($siren, $idAnn, null, $position, $nbAffichage);
} else {
$idAnn = $session->getSourceId();
$infos = $ws->getAnnoncesAsso($siren, $idAnn, null, $position, $nbAffichage);
}
break;
case 'bomp':
$filtre = $request->getParam('filtre', null);
$this->view->assign('filtre', $filtre);
$infos = $ws->getAnnoncesBoamp($siren, $idAnn, $filtre, $position, $nbAffichage);
break;
}
if ($infos === false) $this->_forward('soap', 'error');
Zend_Registry::get('firebug')->info($infos);
require_once 'Scores/Annonces.php';
$objAnnonces = new Annonces($infos->result->item);
$typeAnnonces = array(
'Bodacc',
'Balo',
'Bomp',
'Asso',
);
$user = new Scores_Utilisateur();
$this->view->assign('hasModeEdition', $user->checkModeEdition());
$this->view->assign('exportObjet', $infos);
$this->view->assign('surveillance', $user->checkPerm('survannonce'));
//Affichage pour une annonce
if (!empty($idAnn) && in_array($vue, array('bodacc', 'abod', 'balo', 'asso', 'bomp')) ) {
if ( $user->checkModeEdition() ){
$this->view->headScript()->appendFile($this->theme->pathScript.'/saisieannonces.js', 'text/javascript');
}
$classType = 'annonces'.ucfirst($vue);
foreach($objAnnonces->$classType as $ann) {
if($ann->id==$idAnn) break;
}
Zend_Registry::get('firebug')->info($ann);
$annonce = array(
'Desc' => $objAnnonces->getAnnonceDesc($ann),
'Entree' => $objAnnonces->getAnnonceEntree($ann),
'EntreeSD' => $objAnnonces->getAnnonceEntreeSD($ann),
'Even' => $objAnnonces->getAnnonceEven($ann),
'Texte' => $objAnnonces->getAnnonceTexte($ann),
'Type' => $objAnnonces->getType($ann),
'Code' => $objAnnonces->getCode($ann),
'Annee' => $objAnnonces->getAnnee($ann),
'Num' => $objAnnonces->getNum($ann),
'Deleted' => $objAnnonces->isDeleted($ann),
'Entites' => $objAnnonces->getAnnonceEntite($ann)
);
$this->view->assign('source', $session->getSource());
if ( intval($this->siret)==0 ){
$this->view->assign('sourceId', $session->getSourceId());
} else {
$this->view->assign('sourceId', null);
}
$this->view->assign('idAnn', $idAnn);
$this->view->assign('annonce', $annonce);
if ($request->getParam('q')=='ajax')
{
$this->_helper->layout()->disableLayout();
//$this->_helper->viewRenderer->setNoRender(true);
$this->renderScript('juridique/annonce-ajax.phtml');
} else {
$this->view->assign('PageCurrent', $page);
//Définir url pour téléchargement pdf
if ( in_array($annonce['Code'], array('BODA', 'BODB', 'BODC')) && intval($annonce['Annee'])>=2008) {
$lienBodacc = $this->view->url(array(
'controller' => 'juridique',
'action' => 'bodaccpdf',
'type' => substr($annonce['Code'],3,1),
'annee' => $annonce['Annee'],
'num' => $annonce['Num'],
), 'default', true);
$this->view->assign('lienBodacc', $lienBodacc);
}
$this->renderScript('juridique/annonce.phtml');
}
// --- Affichage pour la liste des annonces
} else {
// --- Titre de la page
if ( empty($autrePage) ) {
if( empty($siren) ){
$titre = 'Identifiant '.$this->id;
} else {
$titre = 'Siret '.$siren;
}
$this->view->headTitle()->prepend('Annonces Légales - '.$titre);
}
// ---- Calcul pagination
$nbReponses = count($infos->result->item);
$nbReponsesTotal = $infos->nbReponses;
if ($nbReponses < $nbReponsesTotal) {
$pageTotal = ceil( $nbReponsesTotal / $nbAffichage );
$pageCurrent = $page;
$pagePrev = $page - 1;
if ($pagePrev < 1) {
$pagePrev = 1;
}
$pageNext = $page + 1;
if( $pageNext > $pageTotal ) {
$pageNext = $pageTotal;
}
} else {
$pageTotal = $pageCurrent = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', $pagePrev);
$this->view->assign('PageNext', $pageNext);
$this->view->assign('PageCurrent', $pageCurrent);
$this->view->assign('nbReponses', empty($nbReponses) ? 0 : $nbReponses);
$this->view->assign('nbReponsesTotal', empty($nbReponsesTotal) ? 0 : $nbReponsesTotal);
foreach ( $typeAnnonces as $type ) {
$classType = 'annonces'.$type;
$annonces = array();
if ( count( $objAnnonces->$classType ) > 0 ) {
foreach( $objAnnonces->$classType as $ann ) {
$annonces[] = $objAnnonces->getAnnonceResume($ann);
}
$this->view->assign($classType, $annonces);
}
}
$this->view->headScript()->appendFile($this->theme->pathScript.'/annonces.js', 'text/javascript');
}
}
}
/**
* Affichage infos réglementées
*/
public function infosregAction()
{
$this->view->headTitle()->prepend("Informations Réglementées");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$request = $this->getRequest();
$idAnn = $request->getParam('idann', false);
$siren = substr($this->siret, 0,9);
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$ws = new WsScores();
if ($idAnn!=false) {
$this->view->assign('idAnn', $idAnn);
$infos = $ws->getInfosReg($siren,$idAnn);
} else {
$infos = $ws->getInfosReg($siren);
}
if ($infos === false) $this->forward('soap', 'error');
if (is_string($infos)){
$this->view->assign('message', $infos);
}
$objAnnonces = $infos->result->item;
$annonces = array();
if (count($objAnnonces)>0) {
foreach ( $objAnnonces as $item ) {
$dateParution = new Zend_Date($item->DateParution, 'yyyy-MM-dd');
$dateInsertion = new Zend_Date($item->dateInsertionSD, 'yyyy-MM-dd');
$annonces[] = array(
'id' => $item->id,
'titre' => $item->titre,
'communique' => $item->communique,
'source' => $item->source,
'DateParution' => $dateParution->toString('dd/MM/yyyy'),
'dateInsertionSD' => $dateInsertion->toString('dd/MM/yyyy'),
);
}
}
$this->view->assign('annonces', $annonces);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$this->view->assign('exportObjet', $infos);
}
/**
* Affichage listes des compétences
*/
public function competencesAction()
{
$this->view->headTitle()->prepend("Compétences Territoriales");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$request = $this->getRequest();
$type = $request->getParam('type', '');
$siren = substr($this->siret,0,9);
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$abbrev = array(
' TGI ' => 'TRIBUNAL DE GRANDE INSTANCE DE ',
' TI ' => 'TRIBUNAL D\'INSTANCE DE ',
' TC ' => 'TRIBUNAL DE COMMERCE DE ',
' TGICC ' => 'TRIBUNAL DE GRANDE INSTANCE A COMPETENCE COMMERCIALE ',
' TICC ' => 'TRIBUNAL D\'INSTANCE A COMPETENCE COMMERCIALE '
);
if (!empty($type)){
$ws = new WsScores();
$infos = $ws->getListeCompetences($this->siret, $type, $session->getCodeCommune());
if ($infos === false) $this->_forward('soap', 'error');
$competences = $infos->result->item;
Zend_Registry::get('firebug')->info($infos);
if( $type=='tri' || $type=='cfe' ) {
$i=0;
foreach($competences as $comp){
$competences[$i]->Nom = strtr(' '.strtoupper($comp->Nom), $abbrev);
$i++;
}
}
$this->view->assign('competences', $competences);
$this->view->assign('type', $type);
$this->view->assign('exportObjet', $infos);
}
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
}
/**
* Affichage des la listes des conventions collectives
* Enter description here ...
*/
public function conventionsAction()
{
$this->view->headTitle()->prepend("Conventions Collectives");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$siren = substr($this->siret, 0,9);
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$ws = new WsScores();
$infos = $ws->getListeConventions($siren);
$conventions = $infos->result->item;
Zend_Registry::get('firebug')->info($conventions);
$this->view->assign('conventions', $conventions);
$this->view->assign('exportObjet', $infos);
}
/**
* Affichage des marques déposées
*/
public function marquesAction()
{
$this->view->headTitle()->prepend("Marques Déposées");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$this->view->headScript()->appendFile($this->theme->pathScript.'/marques.js', 'text/javascript');
$request = $this->getRequest();
$idObject = $request->getParam('idObject', 0);
$siren = substr($this->siret, 0,9);
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$ws = new WsScores();
$infos = $ws->getMarques($siren, $idObject);
if ($infos === false) $this->_forward('soap', 'error');
$marques = $infos->result->item;
$this->view->assign('marques', $marques);
$this->view->assign('idObject', $idObject);
$this->view->assign('exportObjet', $marques);
Zend_Registry::get('firebug')->info($infos);
}
/**
* Affiche le lien pour télécharger le fichier concernant le dépot
*/
public function getmarqueAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$numdepot = $request->getParam('numdepot', '');
if (empty($numdepot)){
echo 'Paramètres incorrects';
exit;
}
$c = Zend_Registry::get('config');
$directory = realpath($c->profil->path->data).'/marques';
$file = $numdepot.'.pdf';
//Le fichier n'existe pas alors on le télécharger
if(!file_exists($directory.'/'.$file)
|| filesize($directory.'/'.$file)==0 ) {
$cmd = 'php ' . APPLICATION_PATH . '/../scripts/jobs/getMarque.php ' . $numdepot;
Zend_Registry::get('firebug')->info($cmd);
$result = exec($cmd);
Zend_Registry::get('firebug')->info($result);
}
//On vérfie que le fichier existe après le téléchargement
if(file_exists($directory.'/'.$file) && filesize($directory.'/'.$file)>0) {
$href = $this->view->baseUrl().'/fichier/marque/'.$file;
echo '<a href="'.$href.'" target="_blank">Télécharger le PDF de l\'insciption au BOPI.</a>';
} else {
echo 'Document introuvable.';
}
}
public function bodaccpdfAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$type = $request->getParam('type');
$annee = $request->getParam('annee');
$num = $request->getParam('num');
//$num doit être retraité pour être sur 4 position
$c = strlen($num);
for($i=0;$i<4-$c;$i++){
$num = '0'.$num;
}
$c = Zend_Registry::get('config');
$file = realpath($c->profil->path->data)
.'/bodacc/'.$type.'/'.$annee.'/'.
'BODACC_'.$type.'_'.$annee.'_'.$num.'.pdf';
if ( !file_exists($file) ) {
exec('php ' . APPLICATION_PATH . "/../scripts/jobs/getBodaccPdf.php $type $annee $num >> getBodaccPdf.log");
}
if (file_exists($file)) {
$href = $this->view->url(array(
'controller' => 'fichier',
'action' => 'bodacc',
'fichier' => basename($file),
), 'default', true);
echo "<a target=\"_blank\" href=\"".$href."\">Cliquer ici pour télécharger le fichier.</a>";
} else {
echo "Erreur lors du chargement du fichier.";
}
}
public function annoncenumAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$siren = $request->getParam('siren');
$ws = new WsScores();
$result = $ws->getAnnoncesNum($siren);
Zend_Registry::get('firebug')->info($result);
$numWS = array();
if (count($result->item)>0) {
foreach ($result->item as $item) {
$numWS[$item->type] = $item->num;
}
}
$types = array('bodacc', 'balo', 'boamp', 'asso');
$num = array();
foreach($types as $type) {
if ( array_key_exists($type, $numWS) ) {
$num['Type'.ucfirst($type)] = $numWS[$type];
}
}
$this->view->assign('num', $num);
}
}

View File

@ -4,23 +4,13 @@ class LogoController extends Zend_Controller_Action
protected $theme;
protected $pathLogo = '';
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
$c = Zend_Registry::get('config');
$this->pathLogo = $c->profil->path->shared.'/persist/logos';
$this->pathLogo = $c->profil->path->data.'/logos';
}
public function indexAction()

View File

@ -54,18 +54,8 @@ class MandataireController extends Zend_Controller_Action
array( "triId"=>"1798", "triCode"=>"AGENL", "triNom"=>"Cour d'Appel d'Agen", "triCP"=>"47916" ),
);
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
@ -86,13 +76,13 @@ class MandataireController extends Zend_Controller_Action
$ws = new WsScores();
$this->logger->info('idMandataire : '.$idMandataire);
Zend_Registry::get('firebug')->info('idMandataire : '.$idMandataire);
//Mode edition
if ($idMandataire != '') {
$idMandataire = (int)substr($idMandataire,1);
$reponse = $ws->getMandataire($idMandataire);
$this->logger->info(print_r($reponse,1));
Zend_Registry::get('firebug')->info($reponse);
if ($reponse!==false) {
$tabMandataires = json_decode($reponse, true);
} else {

View File

@ -3,18 +3,8 @@ class OrderController extends Zend_Controller_Action
{
protected $theme;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
}

View File

@ -18,18 +18,8 @@ class PiecesController extends Zend_Controller_Action
protected $siret;
protected $id;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
@ -100,7 +90,7 @@ class PiecesController extends Zend_Controller_Action
} else {
$this->view->ref = strtoupper($result);
}
} catch (Exception $e) {
} catch (Zend_Db_Exception $e) {
$this->view->msg = $e->getMessage();
}
@ -141,7 +131,7 @@ class PiecesController extends Zend_Controller_Action
//Affichage des actes disponible
$ws = new WsScores();
$responses = $ws->getPiecesActes($siren);
$this->logger->info(print_r($responses,1));
Zend_Registry::get('firebug')->info($responses);
/*
* Construire la réponse pour affichage
@ -290,7 +280,7 @@ class PiecesController extends Zend_Controller_Action
//Catégorie Juridique
$cj = $session->getFormeJuridique();
if( in_array($cj, $this->association_cj) ) {
$this->forward('associationbilans');
$this->_forward('associationbilans');
} else {
$request = $this->getRequest();
$siren = substr($this->siret,0,9);
@ -499,9 +489,11 @@ class PiecesController extends Zend_Controller_Action
if ( $stream->isSuccessful() && substr($stream->getBody(),0,4)=='%PDF' ) {
$c = Zend_Registry::get('config');
$file = 'bilan-'.$siren.'-'.$type.'-'.$dateCloture.'.pdf';
if (copy($stream->getStreamName(), $c->profil->path->shared . '/files/' . $file)) {
$this->view->assign('url', $this->view->url(array('module'=>'file',
'controller'=>'greffe', 'action'=>'bilan', 'q'=>$file), 'default', true));
if (copy($stream->getStreamName(), $c->profil->path->files . '/' . $file)) {
$this->view->assign('url', $this->view->url(array(
'controller' => 'fichier',
'action' => 'greffe',
), 'default', true).'/'.$file);
} else {
$this->view->assign('msg', "Impossible de distribuer le fichier.");
}
@ -509,7 +501,7 @@ class PiecesController extends Zend_Controller_Action
$this->view->assign('msg', "Erreur lors du téléchargement du fichier.");
}
} catch (Zend_Http_Client_Exception $e) {
$this->logger->info('HTTP Exception : '.$e->getMessage());
Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage());
$this->view->assign('msg', "Erreur lors du téléchargement du fichier.");
}
}
@ -627,9 +619,11 @@ class PiecesController extends Zend_Controller_Action
if ( $stream->isSuccessful() && substr($stream->getBody(),0,4)=='%PDF' ) {
$c = Zend_Registry::get('config');
$file = 'acte-'.$siren.'-'.$depotNum.'-'.$acteNum.'.pdf';
if (copy($stream->getStreamName(), $c->profil->path->shared . '/files/' . $file)) {
$this->view->assign('url', $this->view->url(array('module'=>'file',
'controller'=>'greffe', 'action'=>'acte', 'q'=>$file), 'default', true));
if (copy($stream->getStreamName(), $c->profil->path->files . '/' . $file)) {
$this->view->assign('url', $this->view->url(array(
'controller' => 'fichier',
'action' => 'greffe',
), 'default', true).'/'.$file);
} else {
$this->view->assign('msg', "Impossible de distribuer le fichier.");
}
@ -637,7 +631,7 @@ class PiecesController extends Zend_Controller_Action
$this->view->assign('msg', "Erreur lors du téléchargement du fichier.");
}
} catch (Zend_Http_Client_Exception $e) {
$this->logger->info('HTTP Exception : '.$e->getMessage());
Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage());
$this->view->assign('msg', "Erreur lors du téléchargement du fichier.");
}
}
@ -836,10 +830,10 @@ class PiecesController extends Zend_Controller_Action
$params->companyId = $siren;
$result = $ws->getAssoActes($params);
$actes = array();
$this->logger->info(print_r($result,1));
Zend_Registry::get('firebug')->info($result);
if (count($result->item) > 0) {
foreach ($result->item as $item) {
$this->logger->info(print_r($item,1));
Zend_Registry::get('firebug')->info($item);
if ( $user->checkPerm('actes') ) {
$href = $this->view->url(array('controller'=>'pieces', 'action'=>'associationacte',
'siren'=>$siren, 'date'=> $item->Date), 'default', true);
@ -860,6 +854,7 @@ class PiecesController extends Zend_Controller_Action
}
$this->view->assign('actes', $actes);
$this->view->assign('ModeEdition', $user->checkModeEdition());
$this->view->assign('email', $user->getEmail());
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
@ -898,9 +893,9 @@ class PiecesController extends Zend_Controller_Action
if ( $stream->isSuccessful() && substr($stream->getBody(),0,4)=='%PDF' ) {
$c = Zend_Registry::get('config');
$file = 'ST-'.$siren.'-'.$date.'.pdf';
if (copy($stream->getStreamName(), $c->profil->path->shared . '/files/' . $file)) {
$this->view->assign('url', $this->view->url(array('module'=>'file', 'controller'=>'greffe',
'action'=>'association', 'q'=>$file), 'default', true));
if (copy($stream->getStreamName(), $c->profil->path->files . '/' . $file)) {
$this->view->assign('url', $this->view->url(array('controller' => 'fichier',
'action' => 'greffe'), 'default', true).'/'.$file);
} else {
$this->view->assign('msg', "Impossible de distribuer le fichier.");
}
@ -908,7 +903,7 @@ class PiecesController extends Zend_Controller_Action
$this->view->assign('msg', "Erreur lors du téléchargement du fichier.");
}
} catch (Zend_Http_Client_Exception $e) {
$this->logger->info('HTTP Exception : '.$e->getMessage());
Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage());
$this->view->assign('msg', "Erreur lors du téléchargement du fichier.");
}
@ -936,7 +931,7 @@ class PiecesController extends Zend_Controller_Action
$ws = new WsScores();
$reponse = $ws->getPiecesBilans($siren);
$listBilans = $reponse->result->item;
$this->logger->info(print_r($listBilans,1));
Zend_Registry::get('firebug')->info($listBilans);
$decision = '';
foreach ( $listBilans as $item) {
@ -1007,9 +1002,11 @@ class PiecesController extends Zend_Controller_Action
if ( $stream->isSuccessful() && substr($stream->getBody(),0,4)=='%PDF' ) {
$c = Zend_Registry::get('config');
$file = 'bilan-'.$siren.'-'.$type.'-'.$dateCloture.'.pdf';
if (copy($stream->getStreamName(), $c->profil->path->shared . '/files/' . $file)) {
$this->view->assign('url', $this->view->url(array('module'=>'file', 'controller'=>'greffe',
'action' => 'association', 'q'=>$file), 'default', true));
if (copy($stream->getStreamName(), $c->profil->path->files . '/' . $file)) {
$this->view->assign('url', $this->view->url(array(
'controller' => 'fichier',
'action' => 'greffe',
), 'default', true).'/'.$file);
} else {
$this->view->assign('msg', "Impossible de distribuer le fichier.");
}
@ -1017,7 +1014,7 @@ class PiecesController extends Zend_Controller_Action
$this->view->assign('msg', "Erreur lors du téléchargement du fichier.");
}
} catch (Zend_Http_Client_Exception $e) {
$this->logger->info('HTTP Exception : '.$e->getMessage());
Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage());
$this->view->assign('msg', "Erreur lors du téléchargement du fichier.");
}
@ -1054,13 +1051,13 @@ class PiecesController extends Zend_Controller_Action
case 'T':
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared. '/files/';
$path = $c->profil->path->files. '/';
//Le fichier est déjà présent sur le serveur
if ( file_exists($path.'kbis-'.$siren.'.pdf')
&& date('Ymd', filemtime($path.'kbis-'.$siren.'.pdf'))==date('Ymd')
&& filesize($path.'kbis-'.$siren.'.pdf')>2000 ) {
$msg = '<u><a title="Cliquez ici pour visualiser le kbis" target="_blank" href="/file/greffe/kbis/q/kbis-'.$siren.'.pdf">Visualiser le Kbis <img src="/themes/default/images/interfaces/icone_pdf.gif"></a></u>';
$msg = '<u><a title="Cliquez ici pour visualiser le kbis" target="_blank" href="/fichier/kbis/kbis-'.$siren.'.pdf">Visualiser le Kbis <img src="/themes/default/images/interfaces/icone_pdf.gif"></a></u>';
$this->view->assign('message', $msg);
$this->view->assign('mode', $mode);
$ws->setLog('kbis', $siren, 0, 'direct');
@ -1081,7 +1078,7 @@ class PiecesController extends Zend_Controller_Action
$response = $client->request('GET');
//Ecriture du fichier sur le serveur en local
if ( $response->isSuccessful() && copy($response->getStreamName(), $path.'kbis-'.$siren.'.pdf') ) {
$msg = '<u><a title="Cliquez ici pour visualiser le kbis" target="_blank" href="/file/greffe/kbis/q/kbis-'.$siren.'.pdf">Visualiser le Kbis <img src="/themes/default/images/interfaces/icone_pdf.gif"></a></u>';
$msg = '<u><a title="Cliquez ici pour visualiser le kbis" target="_blank" href="/fichier/kbis/kbis-'.$siren.'.pdf">Visualiser le Kbis <img src="/themes/default/images/interfaces/icone_pdf.gif"></a></u>';
$this->view->assign('message', $msg);
$this->view->assign('mode', $mode);
}
@ -1214,53 +1211,32 @@ class PiecesController extends Zend_Controller_Action
}
/**
* Affiche les privilèges
* Affiche les privilèges en surveillance
*/
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 Scores_Session_Entreprise($this->siret, $this->id);
$ws = new WsScores();
if ($detail){
$infos = $ws->getPrivilegesDetail($siren, array($type));
$this->view->assign('detail', $detail);
} else {
$infos = $ws->getPrivilegesCumul($siren);
}
Zend_Registry::get('firebug')->info($infos);
$this->view->assign('privileges', $infos->result->item);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$ws = new Scores_Ws_Client('entreprise', '0.9');
$parameters = new stdClass();
$parameters->companyId = $siren;
$result = $ws->getPrivilegeList($parameters);
$this->view->assign('PrivilegesNb', $result->NbTotal);
$this->view->assign('PrivilegesMt', $result->MtTotal);
$this->view->assign('PrivilegesCumul', $result->Cumul->item);
$this->view->assign('Privileges', $result->List->item);
$user = new Scores_Utilisateur();
$this->view->assign('surveillance', $user->checkPerm('survpriv'));
}
/**
* Détail d'un privilege
*/
public function privilegedetailAction()
{
$request = $this->getRequest();
$id = $request->getParam('viewId');
$siren = substr($this->siret, 0, 9);
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$ws = new Scores_Ws_Client('entreprise', '0.9');
$parameters = new stdClass();
$parameters->companyId = $siren;
$parameters->id = $id;
$result = $ws->getPrivilegeDetail($parameters);
$this->view->assign('Privilege', $result);
}
}

View File

@ -3,18 +3,8 @@ class PrintController extends Zend_Controller_Action
{
protected $theme;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
}
@ -140,7 +130,7 @@ class PrintController extends Zend_Controller_Action
$fichier = str_replace('.pdf', '', $fichier);
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/pages/'.$fichier.'.html';
$file = $c->profil->path->pages.'/'.$fichier.'.html';
if (!file_exists($file))
{
echo 'Fichier introuvable';
@ -219,7 +209,7 @@ class PrintController extends Zend_Controller_Action
}
$this->view->assign('controller', $elements['controller']);
$this->view->assign('action', $elements['action']);
$this->logger->info(print_r($elements['params'],1));
Zend_Registry::get('firebug')->info($elements['params']);
$this->view->assign('params', $elements['params']);
}
@ -239,7 +229,7 @@ class PrintController extends Zend_Controller_Action
}
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/files/'.$fichier;
$file = $c->profil->path->files.'/'.$fichier;
if (!file_exists($file)){
echo "Erreur lors de la génération du fichier.";
exit;

View File

@ -3,18 +3,8 @@ class RechercheController extends Zend_Controller_Action
{
protected $theme;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
@ -223,8 +213,11 @@ class RechercheController extends Zend_Controller_Action
'annee' => $annonce->Annee,
'code' => $code,
'text' => $texte,
'file' => $this->view->url(array('controller'=>'telechargement', 'action'=>'histopdf',
'q' => $fichier, 'host' => base64_encode($host)), 'default', true
'file' => $this->view->url(array(
'controller'=>'telechargement',
'action'=>'histopdf',
'q' => $fichier,
'host' => base64_encode($host)), 'default', true
),
);
}
@ -296,10 +289,10 @@ class RechercheController extends Zend_Controller_Action
$request = $this->getRequest();
if ($request->isPost() && $form->isValid($request->getParams())) {
$this->logger->info(print_r($form->getValues(),1));
Zend_Registry::get('firebug')->info($form->getValues());
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared.'/persist/log';
$path = realpath($c->profil->path->data).'/log';
$fp = fopen($path.'/enquetes.csv', 'a');
fwrite($fp, date('Y/m/d H:i:s').' - '.print_r($form->getValues(),true)."\n");
fclose($fp);
@ -409,7 +402,7 @@ class RechercheController extends Zend_Controller_Action
//Giant
if( !empty($params['pays']) && $type == 'ent' ){
$this->logger->info('RECHERCHE GIANT');
Zend_Registry::get('firebug')->info('RECHERCHE GIANT');
$this->_forward('search', 'giant', null, $params);
//Worldcheck
} elseif ($type == 'wcheck' ) {
@ -806,8 +799,6 @@ class RechercheController extends Zend_Controller_Action
//Calcul pagination
$nbReponses = $reponse->nbReponses;
$nbReponsesTotal = $reponse->nbReponsesTotal;
$pagePrev=1;
$pageNext=1;
if ($nbReponses < $nbReponsesTotal) {
$pageTotal = ceil( $nbReponsesTotal / $nbAffichage );
$pageCurrent = $page;
@ -929,7 +920,7 @@ class RechercheController extends Zend_Controller_Action
$sql->where("LOWER(libelle) ".$where);
}
}
$this->logger->info($where);
Zend_Registry::get('firebug')->info($where);
$rows = $table->fetchAll($sql);
if ( count($rows)>0 ) {
@ -1208,7 +1199,7 @@ class RechercheController extends Zend_Controller_Action
//echo "<pre>"; print_r($etabs); echo "</pre>"; exit;
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared . '/files/'.$user->getIdClient().'-'.$user->getLogin().'-'.date('YmdHis').'.csv';
$file = $c->profil->path->files . '/'.$user->getIdClient().'-'.$user->getLogin().'-'.date('YmdHis').'.csv';
$export = new Scores_Export_ArrayCsv($etabs, 'rechercheEntreprise');
$export->writeFile($file);

View File

@ -35,18 +35,8 @@ class SurveillanceController extends Zend_Controller_Action
'liens' => 'survliens',
);
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
@ -118,7 +108,6 @@ class SurveillanceController extends Zend_Controller_Action
$page = $request->getParam('page');
$from = $request->getParam('from');
$q = $request->getParam('q');
$siret = $request->getParam('siret', '');
$email = $request->getParam('email', '');
@ -137,8 +126,6 @@ class SurveillanceController extends Zend_Controller_Action
}
} elseif (isset($page)) {
$this->redirect('surveillance/liste/page/'.$page);
} elseif (isset($q)) {
$this->redirect('surveillance/liste/q/'.$q);
} else {
$this->redirect('surveillance/liste');
}
@ -176,8 +163,8 @@ class SurveillanceController extends Zend_Controller_Action
// --- Vérification des emails
$emails = explode(';', $email);
$emailsValid = true;
foreach ( $emails as $e ) {
if ( !$validateur->isValid($e) ) {
foreach ( $emails as $email ) {
if ( !$validateur->isValid($email) ) {
$emailsValid = false;
break;
}
@ -252,7 +239,7 @@ class SurveillanceController extends Zend_Controller_Action
$filtre->detail = false;
$infos = $ws->getSurveillances($filtre);
$this->logger->info(print_r($infos,1));
Zend_Registry::get('firebug')->info($infos);
if (property_exists($infos->result, 'item') && count($infos->result->item)>0) {
$titre = 'Ajouter une surveillance';
@ -383,7 +370,7 @@ class SurveillanceController extends Zend_Controller_Action
$ws = new WsScores();
$infos = $ws->getSurveillances($filtre, $position, $nbAffichage);
$surveillances = isset($infos->result->item)?$infos->result->item:null;
$surveillances = $infos->result->item;
$listTrier = array();
if ( count($surveillances)>0 ) {
@ -425,12 +412,10 @@ class SurveillanceController extends Zend_Controller_Action
}
} else {
$pageTotal = $pageCurrent = 1;
$pagePrev = 1;
$pageNext = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', isset($pagePrev)?$pagePrev:1);
$this->view->assign('PageNext', isset($pageNext)?$pageNext:1);
$this->view->assign('PagePrev', $pagePrev);
$this->view->assign('PageNext', $pageNext);
$this->view->assign('PageCurrent', $pageCurrent);
$this->view->assign('nbReponses', empty($nbReponses) ? 0 : $nbReponses);
@ -646,8 +631,6 @@ class SurveillanceController extends Zend_Controller_Action
}
} else {
$pageTotal = $pageCurrent = 1;
$pagePrev = 1;
$pageNext = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', $pagePrev);
@ -716,7 +699,7 @@ class SurveillanceController extends Zend_Controller_Action
$getCSV = $request->getParam('get', '');
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared.'/files';
$path = $c->profil->path->files;
// --- Lister les fichiers
if (empty($nomFic)) {
@ -988,7 +971,7 @@ class SurveillanceController extends Zend_Controller_Action
}
}
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared.'/files';
$path = $c->profil->path->files;
//Récupération du fichier
$file = $path.'/'.$nomFic;
@ -1155,60 +1138,9 @@ class SurveillanceController extends Zend_Controller_Action
$output = '</page>';
}
// conversion HTML => PDF
require_once 'Vendors/html2pdf/html2pdf.class.php';
$html2pdf = new HTML2PDF('P','A4','fr');
$html2pdf->WriteHTML(utf8_decode($output));
$html2pdf->Output(str_replace('.csv', '.pdf', $nomFic), 'D');
}
/**
* Import surveillance en fichier csv
*/
public function surveillanceserieAction(){
//echo 'coucou';die;
$request = $this->getRequest();
if($request->getParam('ref')>""){
$cs=new Scores_Import_FileCsv();
$verif=$cs->verifandupload($_FILES,$request);
if($verif['success']){
$this->view->assign('msg', 'Nous avons enregistré votre fichier de '.$verif['message'].' lignes.<br><br>Les surveillances seront enregistrées durant la nuit.');
$this->view->assign('step', 2);
}else{
$this->view->assign('msg', $verif['message']);
$this->view->assign('step', 2);
}
return;
}
//Affichage formulaire demande ref et email
$this->_helper->layout->disableLayout();
$source = $request->getParam('source', '');
$encours = $request->getParam('encours', 0);
$this->view->pathScript=$this->theme->pathScript;
$this->view->pathStyle=$this->theme->pathStyle;
$user = new Scores_Utilisateur();
$request = $this->getRequest();
$source = $request->getParam('source');
$tabSource = array();
$user = new Scores_Utilisateur();
// Main email
$email = $user->getEmail();
$ref=$user->identity->id . 'surv'.Date('YmdHis');
foreach ($this->sourceDroit as $s => $perm) {
if ($user->checkPerm($perm)) {
$tabSource[] = array(
'value' => $s,
'name' => $this->sourceTxt[$s],
'select' => (!empty($source) && $source==$s) ? ' selected' : '',
);
}
}
$this->view->assign('tabSource', $tabSource);
$this->view->assign('email', $email);
$this->view->assign('ref', $ref);
$this->view->assign('encours', $encours);
$this->view->msg="Sélectionnez votre fichier";
}
}

View File

@ -13,27 +13,17 @@ class TelechargementController extends Zend_Controller_Action
*/
protected $path = '';
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
$this->_helper->layout()->disableLayout();
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$c = Zend_Registry::get('config');
$this->path = $c->profil->path->shared.'/files';
$this->path = $c->profil->path->files;
require_once 'Scores/WsScores.php';
}
/**
* Vérifie ou télécharge le fichier sur une url
* @param string $url
@ -67,12 +57,12 @@ class TelechargementController extends Zend_Controller_Action
unlink($this->path.'/'.$file);
}
}
// --- Lock file exist
if ( file_exists($this->path.'/'.$file.'.lock') ) {
return null;
}
// --- Recuperation du fichier sur le serveur
if ( file_exists($this->path.'/'.$file) ) {
return $file;
@ -147,10 +137,9 @@ class TelechargementController extends Zend_Controller_Action
}
// --- Fichier disponible
elseif ( file_exists($this->path.'/'.$file) ) {
echo '<u><a title="Télécharger le fichier"'.
' target="_blank" href="'.$this->view->url(array('module'=>'file', 'controller'=>'index',
'action'=>'consommation', 'q'=>$file), 'default', true).
'">Cliquez-ici pour télécharger le fichier.</a></u>';
echo '<u><a title="T&eacute;l&eacute;charger le fichier"'.
' target="_blank" href="/fichier/consommation/'.$file.
'">Cliquez-ici pour t&eacute;l&eacute;charger le fichier.</a></u>';
}
}
}
@ -168,11 +157,11 @@ class TelechargementController extends Zend_Controller_Action
// --- Get File Url
if ( $start == 1) {
$source = $request->getParam('source', '');
$user = new Scores_Utilisateur();
$login = $user->getLogin();
$idClient = $user->getIdClient();
$ws = new WsScores();
$reponse = $ws->getListeSurveillancesCsv($source, $login, $idClient);
if ( !empty($reponse->result->Url) ) {
@ -185,7 +174,7 @@ class TelechargementController extends Zend_Controller_Action
else {
$url = $request->getParam('url', '');
$file = $this->getFile($url);
// --- En attente
if ( $file === null ) {
echo '';
@ -196,12 +185,11 @@ class TelechargementController extends Zend_Controller_Action
}
// --- Fichier disponible
elseif ( file_exists($this->path.'/'.$file) ) {
echo '<u><a title="Télécharger le fichier"'.
' target="_blank" href="'.$this->view->url(array('module'=>'file', 'controller'=>'index',
'action'=>'surveillance', 'q'=>$file), 'default', true).
'">Cliquez-ici pour télécharger le fichier.</a></u>';
echo '<u><a title="T&eacute;l&eacute;charger le fichier"'.
' target="_blank" href="/fichier/surveillance/'.$file.
'">Cliquez-ici pour t&eacute;l&eacute;charger le fichier.</a></u>';
}
}
}
@ -223,7 +211,7 @@ class TelechargementController extends Zend_Controller_Action
$ws = new WsScores();
$reponse = $ws->getPortefeuilleCsv($login, $idClient);
if ( !empty($reponse->result->Url) ) {
echo $reponse->result->Url;
} else {
@ -233,7 +221,7 @@ class TelechargementController extends Zend_Controller_Action
} else {
$url = $request->getParam('url', '');
$file = $this->getFile($url);
// --- En attente
if ( $file === null ) {
echo '';
@ -244,10 +232,9 @@ class TelechargementController extends Zend_Controller_Action
}
// --- Fichier disponible
elseif ( file_exists($this->path.'/'.$file) ) {
echo '<u><a title="Télécharger le fichier"'.
' target="_blank" href="'.$this->view->url(array('module'=>'file', 'controller'=>'index',
'action'=>'portefeuille', 'q'=>$file), 'default', true).
'">Cliquez-ici pour télécharger le fichier.</a></u>';
echo '<u><a title="T&eacute;l&eacute;charger le fichier"'.
' target="_blank" href="/fichier/portefeuille/'.$file.
'">Cliquez-ici pour t&eacute;l&eacute;charger le fichier.</a></u>';
}
}
}
@ -268,7 +255,7 @@ class TelechargementController extends Zend_Controller_Action
$authinfo = '/login/'.$identity->username.'/hach/'.$identity->password;
$url = $host.$authinfo.'/q/'.$q;
$this->logger->info($url);
Zend_Registry::get('firebug')->info($url);
$file = $this->getFile($url, uniqid('histo-').'.pdf');
@ -283,9 +270,9 @@ class TelechargementController extends Zend_Controller_Action
// --- Fichier disponible
elseif ( file_exists($this->path.'/'.$file) ) {
if (filesize($this->path.'/'.$file) > 0) {
echo '<u><a title="Télécharger le fichier" target="_blank" href="'.$this->view->url(array('module'=>'file',
'controller'=>'bodacc', 'action'=>'histo', 'q'=>$file), 'default', true).
'">Cliquez-ici pour télécharger le fichier.</a></u>';
echo '<u><a title="T&eacute;l&eacute;charger le fichier"'.
' target="_blank" href="/fichier/histopdf/'.$file.
'">Cliquez-ici pour t&eacute;l&eacute;charger le fichier.</a></u>';
} else {
echo "Erreur lors du téléchargement du fichier.";
}
@ -311,9 +298,9 @@ class TelechargementController extends Zend_Controller_Action
//Téléchargement
if( $url !== false) {
$this->logger->info($url);
Zend_Registry::get('firebug')->info($url);
$file = $this->getFile($url);
$this->logger->info('File:'.$this->path.'/'.$file);
Zend_Registry::get('firebug')->info('File:'.$this->path.'/'.$file);
// --- En attente
if ( $file === null ) {
echo '';
@ -325,9 +312,9 @@ class TelechargementController extends Zend_Controller_Action
// --- Fichier disponible
elseif ( file_exists($this->path.'/'.$file) ) {
if (filesize($this->path.'/'.$file) > 0) {
echo '<br/><u><a title="Télécharger le fichier" target="_blank" href="'.$this->view->url(array(
'module'=>'file', 'controller'=>'greffe', 'action'=>'bilan', 'q'=>$file), 'default', true).
'">Cliquez-ici pour télécharger le fichier.</a></u>';
echo '<br/><u><a title="T&eacute;l&eacute;charger le fichier"'.
' target="_blank" href="/fichier/bilan/'.$file.
'">Cliquez-ici pour t&eacute;l&eacute;charger le fichier.</a></u>';
} else {
echo "<br/>Erreur lors du téléchargement du fichier.";
}

View File

@ -28,18 +28,8 @@ class UserController extends Zend_Controller_Action
return $new_password;
}
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
@ -56,7 +46,7 @@ class UserController extends Zend_Controller_Action
$user = new Scores_Utilisateur();
if (!$user->checkPerm('MONPROFIL')){
$this->forward('perms', 'error');
$this->_forward('perms', 'error');
}
$this->view->assign('device_type', $user->getBrowserInfo()->mobile);
@ -101,10 +91,7 @@ class UserController extends Zend_Controller_Action
$options['profil'] = 'Utilisateur';
}
$ws = new WsScores();
$this->logger->info('setInfosLogin');
$this->logger->info(print_r($options,1));
$reponse = $ws->setInfosLogin($login, $action, $options);
$this->logger->info(print_r($response,1));
$isProfilUpdated = true;
$message = 'Erreur lors de la mise à jour du compte !';
@ -192,19 +179,11 @@ class UserController extends Zend_Controller_Action
$parameters->login = $login;
$parameters->ipUtilisateur = $adressIp;
$parameters->from = null;
try {
$reponse = $ws->getInfosLogin($parameters);
if ($reponse === false) {
$this->view->message = "Impossible d'afficher l'utilisateur.";
} else {
$this->view->assign('options', $reponse->result);
$this->view->assign('loginVu', $reponse->result->login);
$this->view->assign('droits', explode(' ', strtolower($reponse->result->droits)));
$this->view->assign('droitsClients', explode(' ', strtolower($reponse->result->droitsClients)));
}
} catch (Exception $e) {
$this->view->message = $e->getMessage();
}
$reponse = $ws->getInfosLogin($parameters);
$this->view->assign('options', $reponse->result);
$this->view->assign('loginVu', $reponse->result->login);
$this->view->assign('droits', explode(' ', strtolower($reponse->result->droits)));
$this->view->assign('droitsClients', explode(' ', strtolower($reponse->result->droitsClients)));
} else {
$this->view->assign('options', $identity);
$this->view->assign('loginVu', $identity->username);
@ -480,24 +459,20 @@ class UserController extends Zend_Controller_Action
}
}
if (!empty($url) && $url!='/user/login' && $url!='/user/logout' && $url!='/localauth'){
$this->redirect($url);
$this->_redirect($url);
}
$this->redirect('/');
$this->_redirect('/');
}
//Auth error
else {
$this->view->message = '';
$this->logger->info(print_r($result));
Zend_Registry::get('firebug')->info($result);
foreach ($result->getMessages() as $message) {
$this->view->message.= $message."<br/>";
}
}
}
}
// Pas de validation du formulaire
else {
$this->logger->info('DISPLAY');
}
}
/**
@ -532,17 +507,6 @@ class UserController extends Zend_Controller_Action
}
}
/**
* Erreur pour les connexions en ipOnly
*/
public function iponlyAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$message = $request->getParam('message');
$this->view->assign('message', $message);
}
/**
* Mettre à jour le mode edition en session sans refresh de la page
*/
@ -741,7 +705,7 @@ class UserController extends Zend_Controller_Action
$mail = new Scores_Mail_Method();
$mail->setSubject("Demande d'envoi des identifiants");
$mail->setBodyHtmlC($mailbody);
$mail->setFromKey('supportdev');
$mail->setFromKey('support');
$mail->addToKey('support');
$mail->setReplyTo($params['email']);
try {

View File

@ -4,18 +4,8 @@ class WorldcheckController extends Zend_Controller_Action
protected $theme;
protected $wcConfig;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');

View File

@ -1,7 +0,0 @@
<p>&copy; 2006-<?php echo date('Y')?> Scores &amp; D&eacute;cisions SAS -
<?=$this->translate("Tous droits r&eacute;serv&eacute;s")?> -
<a href="http://www.scores-decisions.com/mentions.php" target="_blank">
<?=$this->translate("Mentions l&eacute;gales")?></a> -
<img class='flag' id="fr" src="/themes/default/images/drapeaux/fr.png"/>
<img class='flag' id="en" src="/themes/default/images/drapeaux/en.png"/>
</p>

View File

@ -1,701 +0,0 @@
<?php
class JuridiqueController extends Zend_Controller_Action
{
protected $theme;
protected $siret = null;
protected $id = 0;
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
public function init()
{
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
// --- Theme
$this->theme = Zend_Registry::get('theme');
$request = $this->getRequest();
$this->siret = $request->getParam('siret');
$this->id = $request->getParam('id', 0);
require_once 'Scores/WsScores.php';
}
/**
* Affichage de la liste des annonces ou d'une annonce
*/
public function annoncesAction()
{
$request = $this->getRequest();
$autrePage = $request->getParam('apage');
$idAnn = $request->getParam('idAnn', null);
$siren = substr($this->siret, 0,9);
$vue = $request->getParam('vue', 'bodacc');
$source = $request->getParam('source');
if (!empty($source)) {
switch ($source){
case 1: $vue = 'bodacc'; break;
case 2: $vue = 'balo'; break;
case 3: $vue = 'asso'; break;
}
}
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$fj = $session->getFormeJuridique();
if ($fj > 9000 && $fj < 9999 && intval($siren) == 0) {
$vue = 'asso';
}
$this->view->assign('id', $session->getId());
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$this->view->assign('AutrePage', $autrePage);
if ($session->getSource() == '006' || $session->getSourceId() == '007') {
$this->view->assign('AutreSource', true);
} else {
$this->view->assign('vue', $vue);
// Pagination
$page = $request->getParam('page', 1);
if ($page <= 0) {
$page = 1;
}
$nbAffichage = 20;
$position = ($page - 1) * $nbAffichage;
$ws = new WsScores();
switch ($vue) {
case 'balo':
$infos = $ws->getAnnoncesBalo($siren, $idAnn, null, $position, $nbAffichage);
break;
case 'asso':
if (intval($siren) == 0 && substr($session->getAutreId(),0,1) == 'W') {
$infos = $ws->getAnnoncesAsso($session->getAutreId(), $idAnn, null, $position, $nbAffichage);
} elseif (intval($siren) != 0) {
$infos = $ws->getAnnoncesAsso($siren, $idAnn, null, $position, $nbAffichage);
} else {
$idAnn = $session->getSourceId();
$this->redirect($this->view->url(array('controller'=>'juridique',
'action'=>'annonce', 'siret'=>$this->siret, 'id'=>$this->id,
'idAnn'=>$idAnn, 'vue'=>$vue), 'default', true));
}
break;
case 'bomp':
$filtre = $request->getParam('filtre', 'A');
$this->view->assign('filtre', $filtre);
$this->logger->info("getAnnoncesBoamp");
$infos = $ws->getAnnoncesBoamp($siren, $idAnn, $filtre, $position, $nbAffichage);
break;
case 'bodacc':
case 'abod':
default:
if(intval($siren) == 0) {
$idAnn = $session->getSourceId();
$this->redirect($this->view->url(array('controller'=>'juridique',
'action'=>'annonce', 'siret'=>$this->siret, 'id'=>$this->id,
'idAnn'=>$idAnn, 'vue'=>$vue), 'default', true));
}
$infos = $ws->getAnnoncesLegales($siren, $idAnn, null, $position, $nbAffichage);
break;
}
$this->logger->info(print_r($infos,1));
if ($infos === false) {
$this->forward('soap', 'error');
}
require_once 'Scores/Annonces.php';
$objAnnonces = new Annonces($infos->result->item);
$typeAnnonces = array(
'Bodacc',
'Balo',
'Bomp',
'Asso',
);
$user = new Scores_Utilisateur();
$this->view->assign('hasModeEdition', $user->checkModeEdition());
$this->view->assign('exportObjet', $infos);
$this->view->assign('surveillance', $user->checkPerm('survannonce'));
// --- Titre de la page
if ( empty($autrePage) ) {
if( empty($siren) ){
$titre = 'Identifiant '.$this->id;
} else {
$titre = 'Siret '.$siren;
}
$this->view->headTitle()->prepend('Annonces Légales - '.$titre);
}
// ---- Calcul pagination
$nbReponses = count($infos->result->item);
$nbReponsesTotal = $infos->nbReponses;
if ($nbReponses < $nbReponsesTotal) {
$pageTotal = ceil( $nbReponsesTotal / $nbAffichage );
$pageCurrent = $page;
$pagePrev = $page - 1;
if ($pagePrev < 1) {
$pagePrev = 1;
}
$pageNext = $page + 1;
if( $pageNext > $pageTotal ) {
$pageNext = $pageTotal;
}
} else {
$pageTotal = $pageCurrent = 1;
$pagePrev = 1;
$pageNext = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', $pagePrev);
$this->view->assign('PageNext', $pageNext);
$this->view->assign('PageCurrent', $pageCurrent);
$this->view->assign('nbReponses', empty($nbReponses) ? 0 : $nbReponses);
$this->view->assign('nbReponsesTotal', empty($nbReponsesTotal) ? 0 : $nbReponsesTotal);
$classType = 'annonces'.ucfirst($vue);;
$annonces = array();
if (count($objAnnonces->$classType) > 0) {
foreach($objAnnonces->$classType as $ann) {
$annonces[] = $objAnnonces->getAnnonceResume($ann);
}
$this->logger->info(print_r($annonces,1));
$this->view->assign('annonces', $annonces);
}
$this->view->headScript()->appendFile($this->theme->pathScript.'/annonces.js', 'text/javascript');
}
}
/**
* Affichage d'une annonce
*/
public function annonceAction()
{
$request = $this->getRequest();
$autrePage = $request->getParam('apage');
$idAnn = $request->getParam('idAnn', null);
$siren = substr($this->siret, 0,9);
$vue = $request->getParam('vue', 'bodacc');
$source = $request->getParam('source');
if (!empty($source)) {
switch ($source){
case 1: $vue = 'bodacc'; break;
case 2: $vue = 'balo'; break;
case 3: $vue = 'asso'; break;
}
}
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$fj = $session->getFormeJuridique();
if ($fj > 9000 && $fj < 9999 && intval($siren) == 0) {
$vue = 'asso';
}
$page = $request->getParam('page');
$this->view->assign('page', $page);
$this->view->assign('id', $session->getId());
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$this->view->assign('AutrePage', $autrePage);
if ($session->getSource() == '006' || $session->getSourceId() == '007') {
$this->view->assign('AutreSource', true);
} else {
$this->view->assign('vue', $vue);
$ws = new WsScores();
switch ($vue) {
case 'balo':
$infos = $ws->getAnnoncesBalo($siren, $idAnn, null, $position, $nbAffichage);
break;
case 'asso':
if ( intval($siren)==0 && substr($session->getAutreId(),0,1)=='W' ) {
$infos = $ws->getAnnoncesAsso($session->getAutreId(), $idAnn, null, $position, $nbAffichage);
} elseif (intval($siren)!=0) {
$infos = $ws->getAnnoncesAsso($siren, $idAnn, null, $position, $nbAffichage);
} else {
$idAnn = $session->getSourceId();
$infos = $ws->getAnnoncesAsso($siren, $idAnn, null, $position, $nbAffichage);
}
break;
case 'bomp':
$filtre = $request->getParam('filtre', 'A');
$this->view->assign('filtre', $filtre);
$infos = $ws->getAnnoncesBoamp($siren, $idAnn, $filtre, $position, $nbAffichage);
break;
case 'bodacc':
case 'abod':
default:
if(intval($siren)==0) {
$idAnn = $session->getSourceId();
}
$infos = $ws->getAnnoncesLegales($siren, $idAnn, null, $position, $nbAffichage);
break;
}
$this->logger->info(print_r($infos,1));
if ($infos === false) {
$this->forward('soap', 'error');
}
require_once 'Scores/Annonces.php';
$objAnnonces = new Annonces($infos->result->item);
$typeAnnonces = array(
'Bodacc',
'Balo',
'Bomp',
'Asso',
);
$user = new Scores_Utilisateur();
$this->view->assign('hasModeEdition', $user->checkModeEdition());
$this->view->assign('exportObjet', $infos);
$this->view->assign('surveillance', $user->checkPerm('survannonce'));
if ( $user->checkModeEdition() ){
$this->view->headScript()
->appendFile($this->theme->pathScript.'/saisieannonces.js', 'text/javascript');
}
$classType = 'annonces'.ucfirst($vue);
foreach($objAnnonces->$classType as $ann) {
if($ann->id==$idAnn) break;
}
$this->logger->info(print_r($ann,1));
$annonce = array(
'Desc' => $objAnnonces->getAnnonceDesc($ann),
'Entree' => $objAnnonces->getAnnonceEntree($ann),
'EntreeSD' => $objAnnonces->getAnnonceEntreeSD($ann),
'Even' => $objAnnonces->getAnnonceEven($ann),
'Texte' => $objAnnonces->getAnnonceTexte($ann),
'Type' => $objAnnonces->getType($ann),
'Code' => $objAnnonces->getCode($ann),
'Annee' => $objAnnonces->getAnnee($ann),
'Num' => $objAnnonces->getNum($ann),
'Deleted' => $objAnnonces->isDeleted($ann),
'Entites' => $objAnnonces->getAnnonceEntite($ann)
);
$this->view->assign('source', $session->getSource());
if (intval($this->siret) == 0){
$this->view->assign('sourceId', $session->getSourceId());
} else {
$this->view->assign('sourceId', null);
}
$this->view->assign('idAnn', $idAnn);
$this->view->assign('annonce', $annonce);
if ($request->getParam('q') == 'ajax') {
$this->_helper->layout()->disableLayout();
$this->view->assign('ajax', 1);
} else {
// Définir url pour téléchargement pdf
if (in_array($annonce['Code'], array('BODA', 'BODB', 'BODC'))) {
$datePublication = DateTime::createFromFormat('Y-m-d', $ann->DateParution);
$dateBodacc = DateTime::createFromFormat('Ymd', '20080101');
$dateTemoinA = DateTime::createFromFormat('Ymd', '20161115');
$dateTemoinB = DateTime::createFromFormat('Ymd', '20161011');
$dateTemoinC = DateTime::createFromFormat('Ymd', '20160223');
$params = null;
if ($annonce['Code'] == 'BODA' && $datePublication >= $dateTemoinA) {
$params = array('unit'=>1);
$this->view->assign('bodaccLinkLabel', 'Télécharger le témoin de publication');
} elseif ($annonce['Code'] == 'BODB' && $datePublication >= $dateTemoinB) {
$params = array('unit'=>1);
$this->view->assign('bodaccLinkLabel', 'Télécharger le témoin de publication');
} elseif ($annonce['Code'] == 'BODC' && $datePublication >= $dateTemoinC) {
$params = array('unit'=>1);
$this->view->assign('bodaccLinkLabel', 'Télécharger le témoin de publication');
} elseif ($datePublication >= $dateBodacc) {
$params = array();
$this->view->assign('bodaccLinkLabel', 'Télécharger le bulletin officiel');
}
if ($params !== null) {
$params = array_merge($params, array('controller'=>'juridique',
'action'=>'bodaccpdf', 'siren'=>$siren, 'type'=>substr($annonce['Code'],3,1),
'parution'=>$annonce['Annee'].str_pad($ann->BodaccNum, 4, '0', STR_PAD_LEFT),
'annonce'=>$ann->NumAnnonce
));
$lienBodacc = $this->view->url($params, 'default', true);
$this->view->assign('bodaccLink', $lienBodacc);
}
}
}
}
}
/**
* Liste des contentieux
*/
public function ctxAction()
{
$request = $this->getRequest();
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$this->view->headTitle()->prepend("Contentieux");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$siren = substr($this->siret, 0,9);
$type = $request->getParam('type', 'DF');
$this->view->Type = $type;
$typeList = array(
'DE' => 'demandeur',
'DF' => 'défendeur',
);
$this->view->TypeLabel = '';
if (array_key_exists($type, $typeList)) {
$this->view->TypeLabel = $typeList[$type];
}
$this->view->TypeList = $typeList;
$nbReponses = 20;
$page = $request->getParam('page', 1);
if ( $page <= 0 ) $page = 1;
$position = ($page - 1 ) * $nbReponses;
$params = new stdClass();
$params->companyId = $siren;
$params->tiers = $type;
$params->p = $position;
$params->limit = $nbReponses;
try {
$ws = new Scores_Ws_Client('entreprise', '0.9');
$response = $ws->getGreffeAffaireList($params);
if ($response === false) {
$this->view->msg = "Erreur";
} else {
$this->view->List = isset($response->List->item)?$response->List->item:null;
// --- Pagination
$nbReponsesTotal = $response->Nb;
if ($nbReponses < $nbReponsesTotal) {
$pageTotal = ceil( $nbReponsesTotal / $nbReponses );
$pageCurrent = $page;
$pagePrev = $page - 1;
if ($pagePrev < 1) {
$pagePrev = 1;
}
$pageNext = $page + 1;
if( $pageNext > $pageTotal ) {
$pageNext = $pageTotal;
}
} else {
$pageTotal = $pageCurrent = 1;
$pagePrev = 1;
$pageNext = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', $pagePrev);
$this->view->assign('PageNext', $pageNext);
$this->view->assign('PageCurrent', $pageCurrent);
$this->view->assign('nbReponses', empty($nbReponses) ? 0 : $nbReponses);
$this->view->assign('nbReponsesTotal', empty($nbReponsesTotal) ? 0 : $nbReponsesTotal);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
}
} catch (Exception $e) {
$this->view->msg = $e->getMessage();
}
}
public function ctxdetailAction()
{
$request = $this->getRequest();
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$siren = substr($this->siret, 0,9);
$this->view->headTitle()->prepend("Contentieux");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$id = $request->getParam('affaireId');
$params = new stdClass();
$params->id = $id;
try {
$ws = new Scores_Ws_Client('entreprise', '0.9');
$response = $ws->getGreffeAffaireDetail($params);
if ($response === false) {
$this->view->msg = "Erreur";
} else {
$this->view->Affaire = $response;
}
} catch (Exception $e) {
$this->view->msg = $e->getMessage();
}
}
/**
* Affichage infos réglementées
*/
public function infosregAction()
{
$this->view->headTitle()->prepend("Informations Réglementées");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$request = $this->getRequest();
$idAnn = $request->getParam('idann', false);
$siren = substr($this->siret, 0,9);
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$ws = new WsScores();
if ($idAnn!=false) {
$this->view->assign('idAnn', $idAnn);
$infos = $ws->getInfosReg($siren,$idAnn);
} else {
$infos = $ws->getInfosReg($siren);
}
if ($infos === false) $this->forward('soap', 'error');
if (is_string($infos)){
$this->view->assign('message', $infos);
}
$objAnnonces = $infos->result->item;
$annonces = array();
if (count($objAnnonces)>0) {
foreach ( $objAnnonces as $item ) {
$dateParution = new Zend_Date($item->DateParution, 'yyyy-MM-dd');
$dateInsertion = new Zend_Date($item->dateInsertionSD, 'yyyy-MM-dd');
$annonces[] = array(
'id' => $item->id,
'titre' => $item->titre,
'communique' => $item->communique,
'source' => $item->source,
'DateParution' => $dateParution->toString('dd/MM/yyyy'),
'dateInsertionSD' => $dateInsertion->toString('dd/MM/yyyy'),
);
}
}
$this->view->assign('annonces', $annonces);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$this->view->assign('exportObjet', $infos);
}
/**
* Affichage listes des compétences
*/
public function competencesAction()
{
$this->view->headTitle()->prepend("Compétences Territoriales");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$request = $this->getRequest();
$type = $request->getParam('type', '');
$siren = substr($this->siret,0,9);
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$abbrev = array(
' TGI ' => 'TRIBUNAL DE GRANDE INSTANCE DE ',
' TI ' => 'TRIBUNAL D\'INSTANCE DE ',
' TC ' => 'TRIBUNAL DE COMMERCE DE ',
' TGICC ' => 'TRIBUNAL DE GRANDE INSTANCE A COMPETENCE COMMERCIALE ',
' TICC ' => 'TRIBUNAL D\'INSTANCE A COMPETENCE COMMERCIALE '
);
if (!empty($type)){
$ws = new WsScores();
$infos = $ws->getListeCompetences($this->siret, $type, $session->getCodeCommune());
if ($infos === false) $this->_forward('soap', 'error');
$competences = $infos->result->item;
$this->logger->info(print_r($infos,1));
if( $type=='tri' || $type=='cfe' ) {
$i=0;
foreach($competences as $comp){
$competences[$i]->Nom = strtr(' '.strtoupper($comp->Nom), $abbrev);
$i++;
}
}
$this->view->assign('competences', $competences);
$this->view->assign('type', $type);
$this->view->assign('exportObjet', $infos);
}
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
}
/**
* Affichage des la listes des conventions collectives
* Enter description here ...
*/
public function conventionsAction()
{
$this->view->headTitle()->prepend("Conventions Collectives");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$siren = substr($this->siret, 0,9);
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$ws = new WsScores();
$infos = $ws->getListeConventions($siren);
$conventions = $infos->result->item;
$this->logger->info(print_r($conventions,1));
$this->view->assign('conventions', $conventions);
$this->view->assign('exportObjet', $infos);
}
/**
* Affichage des marques déposées
*/
public function marquesAction()
{
$this->view->headTitle()->prepend("Marques Déposées");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$this->view->headScript()->appendFile($this->theme->pathScript.'/marques.js', 'text/javascript');
$request = $this->getRequest();
$idObject = $request->getParam('idObject', 0);
$siren = substr($this->siret, 0,9);
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$ws = new WsScores();
$infos = $ws->getMarques($siren, $idObject);
if ($infos === false) $this->_forward('soap', 'error');
$marques = $infos->result->item;
$this->view->assign('marques', $marques);
$this->view->assign('idObject', $idObject);
$this->view->assign('exportObjet', $marques);
$this->logger->info(print_r($infos,1));
}
/**
* Affiche le lien pour télécharger le fichier concernant le dépot
*/
public function getmarqueAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$numdepot = $request->getParam('numdepot', '');
if (empty($numdepot)){
echo 'Paramètres incorrects';
exit;
}
$c = Zend_Registry::get('config');
$directory = $c->profil->path->shared.'/persist/marques';
$file = $numdepot.'.pdf';
//Le fichier n'existe pas alors on le télécharger
if(!file_exists($directory.'/'.$file)
|| filesize($directory.'/'.$file)==0 ) {
$cmd = 'php ' . APPLICATION_PATH . '/../scripts/jobs/getMarque.php ' . $numdepot;
$this->logger->info($cmd);
$result = exec($cmd);
$this->logger->info($result);
}
//On vérfie que le fichier existe après le téléchargement
if(file_exists($directory.'/'.$file) && filesize($directory.'/'.$file)>0) {
$href = $this->view->url(array('module'=>'file', 'controller'=>'index', 'action'=>'marque', 'q'=>$file), 'default', true);
echo '<a href="'.$href.'" target="_blank">Télécharger le PDF de l\'insciption au BOPI.</a>';
} else {
echo 'Document introuvable.';
}
}
/**
* Gestion téléchargement du Bodacc au format pdf
*/
public function bodaccpdfAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$siren = $request->getParam('siren');
$type = $request->getParam('type');
$parution = $request->getParam('parution');
$annonce = $request->getParam('annonce');
$unit = $request->getParam('unit');
$annee = substr($parution,0,4);
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared.'/persist/bodacc/'.$type.'/'.$annee;
if ($unit == 1) {
$file = $path."/BODACC_".$type."_".$annee."_".substr($parution,4)."_".$annonce.".pdf";
} else {
$file = $path."/BODACC_".$type."_".$annee."_".substr($parution,4).".pdf";
}
if (!file_exists($file)) {
$cli = "/../scripts/jobs/getBodaccPdf.php";
$params = "--siren ".$siren."--type ".$type." --parution ".$parution." --annonce ".$annonce;
exec('php ' . APPLICATION_PATH . "$cli $params >> getBodaccPdf.log");
}
if (file_exists($file)) {
$href = $this->view->url(array('module'=>'file', 'controller'=>'bodacc',
'action'=>'actual', 'q' => basename($file)), 'default', true);
echo "<a target=\"_blank\" href=\"".$href."\">Cliquer ici pour télécharger le fichier.</a>";
} else {
echo "Erreur lors du chargement du fichier.";
}
}
public function annoncenumAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$siren = $request->getParam('siren');
$ws = new WsScores();
$result = $ws->getAnnoncesNum($siren);
$this->logger->info(print_r($result,1));
$numWS = array();
if (count($result->item)>0) {
foreach ($result->item as $item) {
$numWS[$item->type] = $item->num;
}
}
$types = array('bodacc', 'balo', 'boamp', 'asso');
$num = array();
foreach($types as $type) {
if ( array_key_exists($type, $numWS) ) {
$num['Type'.ucfirst($type)] = $numWS[$type];
}
}
$this->view->assign('num', $num);
}
}

View File

@ -1,96 +0,0 @@
<?php echo $this->doctype(); ?>
<html>
<head>
<?php echo $this->headMeta(); ?>
<?php echo $this->headTitle(); ?>
<?php echo $this->headStyle(); ?>
<?php echo $this->headLink(); ?>
<?php echo $this->headScript(); ?>
</head>
<body>
<div id="wrap">
<div class="container">
<div class="row">
<div class="col-md-6">
<h1 class="text-center">Scores & Decisions</h1>
<br/>
<p>
Scores & Decisions est l'éditeur d'une base de données de référence sur toutes les entreprises de France.
Scores & Decisions est licencié officiel depuis 2008 pour la rediffusion du répertoire Sirène (INSEE), du RNCS
Registre National du Commerce et des Sociétés (INPI) et des Journaux Officiels (DILA). Scores & Decisions est
un service privé distinct des services publics cités.
</p>
<br/>
<div class="panel panel-default">
<div class="panel-body">
<p class="text-primary">Spécialiste de l'information légales et financières sur les entreprises, Scores & Décisions vous permet par
confirmation des éléments ci-contre d'accéder à toute sa base de données.</p>
<ul class="list-group">
<li class="list-group-item">
Télécharger nos Conditions Générales de Services
<a href="<?=$this->baseUrl()?>/documents/inextenso_cgs.pdf" target="_blank">
<span class="glyphicon glyphicon-file pull-right" aria-hidden="true"></span></a>
</li>
<li class="list-group-item">
Télécharger nos Conditions Tarifaires
<a href="#" target="_blank">
<span class="glyphicon glyphicon-file pull-right" aria-hidden="true"></span></a>
</li>
<li class="list-group-item">
Télécharger les coordonnées de vos contacts
<a href="<?=$this->baseUrl()?>/documents/inextenso_contacts.pdf" target="_blank">
<span class="glyphicon glyphicon-file pull-right" aria-hidden="true"></span></a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-md-6">
<h2>Trouvez les réponses à vos questions !</h2>
<ul class="arguments">
<li><strong>Disposez de certitudes sur l'identité de vos interlocuteurs, les liens financiers et les liens
dirigeants... ></strong> Mon client a t il une existence légale ? Quels sont les derniers événements qui ont touché l'entreprise ?</li>
<li><strong>Évitez les mauvais payeurs ></strong>
Ce prospect paye t'il rapidement, est-il en procédure collective ? Quel est sa rentabilité, son niveau de
trésorerie ?</li>
<li><strong>Surveillez la solvabilité de vos partenaires, clients et fournisseurs ou concurrents ></strong>
Mes clients sont ils viables dans la durée, puis je continuer et développer les ventes ?</li>
<li><strong>Découvrez la valeur de votre entreprises ou celles de vos concurrents ></strong> Mon entreprise a t elle de la
valeur ? combien me coûterait le rachat d'un concurrent ?</li>
<li><strong>Trouvez vos futurs clients ></strong> Où sont et qui sont mes prospects ?</li>
</ul>
<p>Les données agrégées sont officielles, exhaustives, fraîches et opposables aux tiers. Elles sont utilisées
par des grands groupes et institutionnels dans des cadres contentieux, de conformité, de fraude...</p>
<?php if ($this->FormUrlParams) {?>
<a type="button" class="btn btn-success btn-lg" href="<?=$this->url($this->FormUrlParams, 'default', true)?>">Accédez au site</a>
<?php }?>
</div>
</div>
</div>
</div>
<?php echo $this->inlineScript(); ?>
</body>
</html>

View File

@ -1,146 +0,0 @@
<div id="center">
<h1>PATRIMOINE FONCIER</h1>
<div class="paragraph">
<table class="identite">
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro identifiant Siren</td>
<td width="350" class="StyleInfoData"><?=$this->SirenTexte($this->siren)?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Dénomination Sociale</td>
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
</table>
</div>
<?php if ($this->MsgTxt) {?>
<div class="paragraph"><?=$this->MsgTxt?></div>
<?php } else {?>
<?php if (count($this->List) > 0) {?>
<h2>Propriétés baties</h2>
<div class="paragraph">
<table class="data">
<thead>
<tr>
<th>Rôle</th>
<th>Dépt.</th>
<th>Commune</th>
<th>Section</th>
<th>N° Plan</th>
<th>Fantoir</th>
<th>Adresse</th>
<th>Bât.</th>
<th>Ent.</th>
<th>Niv.</th>
<th>Surface</th>
<th>Nature</th>
</tr>
</thead>
<tbody>
<?php if (count($this->List) > 0) {?>
<?php foreach($this->List as $p) {?>
<?php if ($p->Type == 'local') {?>
<tr>
<td title="<?=$p->RoleLib?>"><?=$p->Role?></td>
<td><?=$p->Departement?></td>
<td><?=$p->CommuneLib?></td>
<td><?=$p->Section?></td>
<td><?=$p->PlanNum?></td>
<td><?=$p->Fantoir?></td>
<td>
<?=empty($p->AdresseNum) ? '' : $p->AdresseNum.' ' ; ?>
<?=empty($p->AdresseInd) ? '' : $p->AdresseInd.' ' ; ?>
<?=empty($p->AdresseType) ? '' : $p->AdresseType.' ' ; ?>
<?=empty($p->AdresseLib) ? '' : $p->AdresseLib.' ' ; ?>
</td>
<td><?=$p->Batiment?></td>
<td><?=$p->Ent?></td>
<td><?=$p->Niveau?></td>
<td><?=number_format($p->SurfaceTotal, 0, ",", " ")?></td>
<td></td>
</tr>
<?php if (count($p->SurfaceDetail->item) > 0) {?>
<?php foreach($p->SurfaceDetail->item as $s) {?>
<tr>
<td colspan="10" align="right"><i>Detail</i></td>
<td><?=number_format($s->Surface, 0, ",", " ")?></td>
<td><?=$s->Label?></td>
</tr>
<?php }?>
<?php }?>
<?php }?>
<?php }?>
<?php }?>
</tbody>
</table>
</div>
<h2>Propriétés non baties</h2>
<div class="paragraph">
<table class="data">
<thead>
<tr>
<th>Rôle</th>
<th>Dépt.</th>
<th>Commune</th>
<th>Section</th>
<th>N° Plan</th>
<th>Fantoir</th>
<th>Adresse</th>
<th>Surface</th>
<th>Nature</th>
</tr>
</thead>
<tbody>
<?php if (count($this->List) > 0) {?>
<?php foreach($this->List as $p) {?>
<?php if ($p->Type == 'parcelle') {?>
<tr>
<td title="<?=$p->RoleLib?>"><?=$p->Role?></td>
<td><?=$p->Departement?></td>
<td><?=$p->CommuneLib?></td>
<td><?=$p->Section?></td>
<td><?=$p->PlanNum?></td>
<td><?=$p->Fantoir?></td>
<td>
<?=empty($p->AdresseNum) ? '' : $p->AdresseNum.' ' ; ?>
<?=empty($p->AdresseInd) ? '' : $p->AdresseInd.' ' ; ?>
<?=empty($p->AdresseType) ? '' : $p->AdresseType.' ' ; ?>
<?=empty($p->AdresseLib) ? '' : $p->AdresseLib.' ' ; ?>
</td>
<td><?=number_format($p->SurfaceTotal, 0, ",", " ")?></td>
<td></td>
</tr>
<?php if (count($p->SurfaceDetail->item) > 0) {?>
<?php foreach($p->SurfaceDetail->item as $s) {?>
<tr>
<td colspan="7" align="right"><i>Detail</i></td>
<td><?=number_format($s->Surface, 0, ",", " ")?></td>
<td><?=$s->Label?></td>
</tr>
<?php }?>
<?php }?>
<?php }?>
<?php }?>
<?php }?>
</tbody>
</table>
</div>
<?php } else {?>
Aucune information sur le patrimoine.
<?php }?>
<?php }?>
</div>

View File

@ -1,96 +0,0 @@
<div id="center">
<h1 class="titre">RELATIONS BANCAIRES</h1>
<div class="paragraph">
<table class="identite">
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro identifiant Siren</td>
<td width="350" class="StyleInfoData"><?=$this->SirenTexte($this->siren)?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Dénomination Sociale</td>
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
</table>
</div>
<h2>Liste des relations bancaires</h2>
<div class="paragraph">
<?php if (empty($this->AutrePage) && $this->edition) {?>
<div style="line-height:16px;">
<a class="dialog" title="Ajouter RIB/IBAN" href="<?=$this->url(array('controller'=>'saisie','action'=>'ribiban','mode'=>'add','siren'=>$this->siren), null, true)?>">
<img style="vertical-align:middle;" src="/themes/default/images/interfaces/ajouter.png" /> Ajouter une autre relation bancaire</a>
</div>
<?php }?>
<?php if(count($this->banques)>0) { ?>
<table class="data">
<thead>
<tr>
<th>Nom de la Banque</th>
<th>Adresse</th>
<th>Code Banque</th>
<th>Code Guichet</th>
</tr>
</thead>
<tbody>
<?php foreach($this->banques as $relation) { ?>
<tr>
<td valign="top" ><p style="text-decoration:underline;"><?=$relation->libBanque?></p>
<?php if (empty($this->AutrePage) && $this->edition) {?>
<a class="dialog" title="Edition RIB/IBAN" href="<?=$this->url(array('controller'=>'saisie','action'=>'ribiban','mode'=>'edit','siren'=>$this->siren, 'guichetMod'=>$relation->codeGuichet, 'banqueMod'=>$relation->codeBanque), null, true)?>"><img src="/themes/default/images/interfaces/editer.png" /></a>
<a class="dialog" title="Supprimer RIB/IBAN" href="<?=$this->url(array('controller'=>'saisie','action'=>'ribiban','mode'=>'delete','siren'=>$this->siren, 'guichetMod'=>$relation->codeGuichet, 'banqueMod'=>$relation->codeBanque), null, true)?>"><img src="/themes/default/images/interfaces/supprimer.png" /></a>
<?php }?>
</td>
<td>
<?php if($relation->adresse1!='') {?>
<?=$relation->adresse1?><br />
<?php } ?>
<?php if($relation->adresse2!='') {?>
<?=$relation->adresse2?><br />
<?php } ?> <?=$relation->cp?> <?=$relation->ville?>
</td>
<td align="center"><?php if( $relation->codeBanque*1!=0 ){ echo $relation->codeBanque; } ?></td>
<td align="center"><?php if( $relation->codeGuichet*1!=0 ){ echo $relation->codeGuichet; }?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php } else { ?>
<p>Aucune information.</p>
<?php } ?>
</div>
<?php echo $this->render('cgu.phtml', $this->cgu);?>
</div>
<script>
$('a.dialog').on('click', function(){
var href = $(this).attr('href');
if (href!='#') {
var title = $(this).attr('title');
var dialogOpts = {
bgiframe: true,
title: title,
width: 650,
height: 600,
modal: true,
open: function(event, ui) {
$(this).html('Chargement...');
$(this).load(href);
},
buttons: {
Quitter: function() { $(this).dialog('close'); }
},
close: function() { $('#dialog').remove(); }
};
$('<div id="dialog"></div>').dialog(dialogOpts);
return false;
}
});
</script>

View File

@ -1,6 +0,0 @@
<?php if (!empty($this->file)) { ?>
<a href="<?=$this->url(array('module'=>'file', 'controller'=>'index', 'action'=>'liasse', 'q'=>$this->file),
'default', true)?>" target="_blank">Télécharger le fichier excel.</a>
<?php } else { ?>
Erreur lors de la construction du fichier.
<?php }?>

View File

@ -1,7 +0,0 @@
<p>&copy; 2006-<?php echo date('Y')?> Scores &amp; D&eacute;cisions SAS -
<?=$this->translate("Tous droits r&eacute;serv&eacute;s")?> -
<a href="http://www.scores-decisions.com/mentions.php" target="_blank">
<?=$this->translate("Mentions l&eacute;gales")?></a> -
<img class='flag' id="fr" src="/themes/default/images/drapeaux/fr.png"/>
<img class='flag' id="en" src="/themes/default/images/drapeaux/en.png"/>
</p>

View File

@ -1,69 +0,0 @@
<h2>Localisation géographique</h2>
<div class="paragraph">
<div id="infogeo" class="clearfix">
<div id="infogeo_txt">
<?php if ( $this->infos->GeoLat && $this->infos->GeoLon ) {?>
<span id=geolocalisation>
<b>Information géographique :</b><br/>
Latitude : <?=$this->decLat?> (<?=$this->infos->GeoLat?>)<br />
Longitude : <?=$this->decLon?> (<?=$this->infos->GeoLon?>)<br />
</span>
<a id="lien-google" href="<?=$this->mapsHref?>" target="_blank">
Afficher l'adresse sur Google Map &copy;</a><br/>
<br/>
<?php }?>
<b>Code commune / Rivoli :</b><br/>
<?=$this->infos->Dept.' '.$this->infos->codeCommune.' / '.$this->infos->Rivoli; ?>
<?php
if (count($this->infos->InfosIris)>0){
$InfosIris = $this->infos->InfosIris;
$codComIris = str_replace($InfosIris->codIris, '', $InfosIris->codComIris);
?>
<br/><br/><b>Iris :</b>
<?php if (intval($InfosIris->codIris) == 0){ ?>
<br/>Commune non découpée en Iris
<?php } else {?>
<br/>Code : <?=$codComIris?> <?=$InfosIris->codIris?>
<br/>Libellé : <a title="Consulter le plan d'assemblage de la commune" href="<?=$this->url(array('controller'=>'identite', 'action'=>'iris', 'code'=>$codComIris), 'default', true)?>" target="_blank"><?=$InfosIris->libIris?></a>
<img title="<?=$InfosIris->typIris?>" style="vertical-align:middle;" src="/themes/default/images/info.gif">
<?php }?>
<?php }?>
</div>
<?php if ($this->facade) {?>
<?php if ($this->source == 'google') {?>
<div id="infogeo_photo">
<?=$this->action('streetview', 'identite', null, array('infos' => $this->infos,));?>
</div>
<?php } elseif ($this->source == 'mappy') {?>
<div><img id="streetview" width="300px" /></div>
<script src="<?=$this->lienJs?>"></script>
<script type="text/javascript">
$(function() {
var serviceHandler = function(result) {
if (result instanceof Mappy.api.visiocity.Frontage) {
var current = result.getCurrent();
var img = $('<img src="' + current.getURL(320, null) +
'" alt="' + current.getDescription() +
'" width="300px" />');
$('#streetview').replaceWith(img);
}
};
var address = "<?=$this->adresse?>";
var geo = new Mappy.api.geolocation.Geocoder();
var photoService = new Mappy.api.visiocity.PhotoService();
geo.geocode(address, function(result) {
photoService.search(result[0], 'f', serviceHandler);
}, function(error) {});
});
</script>
<?php }?>
<?php }?>
</div>
</div>

View File

@ -1 +0,0 @@
<img src="/file/image/cache/q/<?php echo $this->name;?>" />

View File

@ -1,37 +0,0 @@
<style>
div#menu {display:none;}
</style>
<div id="center">
<div class="paragraph">
<div id="groups" class="jstree jstree-default"></div>
<div>Tête de groupe
<?php if($this->isin==1) { ?> coté, détention minimum à 50%.<?php }?>
<?php if($this->isin==0) { ?> détention minimum à 50%.<?php }?>
</div>
<div>Filiales, détention minimum à
<?php if($this->pctMin==0) {?> Tout<?php }?>
<?php if($this->pctMin==33) {?> 33%<?php }?>
<?php if($this->pctMin==40) {?> 40%<?php }?>
<?php if($this->pctMin==50) {?> 50%<?php }?>
</div>
</div>
</div>
<script src="/libs/jstree-3.3.3/jstree.min.js"></script>
<script>
$("#groups").jstree({
'core' : {
'data' : <?=$this->data?>,
'themes' : {
"theme" : "default",
"url" : "/libs/jstree-3.3.3/themes/default/style.min.css",
"dots" : true,
"icons" : false
}
},
}).on('loaded.jstree',function(){
window.print(); window.close();
});
</script>

View File

@ -1,46 +0,0 @@
<?php if ($this->url) {?>
<div id="legende-photo">Cliché à l'approche de l'adresse postale.</div>
<img id="streetview" data-cache="<?=$this->cache?>" data-saveas="<?=$this->saveas?>" src="<?=$this->url?>"
width="320" height="320" />
<script>
$('img#streetview').on('load', function() {
var cache = $(this).data('cache');
var saveas = $(this).data('saveas');
if (cache == 0) {
var img = document.getElementById("streetview");
img.crossOrigin = "Anonymous";
var canvas = document.createElement("canvas");
canvas.width = img.width; canvas.height = img.height;
ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0, img.width, img.height);
var dataURL = canvas.toDataURL('image/jpeg');
$.post('<?=$this->url(array('module'=>'file', 'controller'=>'streetview', 'action'=>'save'),'default', true)?>',
{ name: saveas, base64: dataURL });
}
});
</script>
<?php if ($this->AuthorizeUpdate) {?>
<div>
<a class="street-heading" href="<?=$this->url(array('controller'=>'identite','action'=>'streetview',
'siret'=> $this->siret, 'lat'=>$this->lat, 'lon'=>$this->lon, 'heading'=>$this->pagePrec),
'default', true)?>">&lt;</a> - <a class="street-heading" href="<?=$this->url(array('controller'=>'identite',
'action'=>'streetview', 'siret'=> $this->siret, 'lat'=>$this->lat, 'lon'=>$this->lon,
'heading'=>$this->pageSuiv), 'default', true)?>">&gt;</a>
</div>
<script>
$('a.street-heading').click(function(e){
e.preventDefault();
$('#infogeo_photo').load($(this).attr('href'));
});
</script>
<?php }?>
<?php if ($this->AuthorizeUpdate) {?>
<div>
<a class="street-original" href="#">Original</a> - <a class="street-upload" href="#">Upload</a>
</div>
<?php }?>
<?php }?>

View File

@ -1,98 +0,0 @@
<div id="center">
<h1 class="titre">Contentieux Judiciaires</h1>
<?php if ($this->msg) {?>
<div class="paragraph">
<div style="padding: 0 .7em;" class="ui-state-error ui-corner-all">
<p><span style="float: left; margin-right: .3em;" class="ui-icon ui-icon-alert"></span>
<strong>Alerte :</strong> <?=$this->msg?></p>
</div>
</div>
<?php } else {?>
<div class="paragraph">
<table class="identite">
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro identifiant Siren</td>
<td width="350" class="StyleInfoData"><?=$this->SirenTexte($this->siren)?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Dénomination Sociale</td>
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Affaire(s) en tant que</td>
<td width="350" class="StyleInfoData">
<form action="<?=$this->url(array('module'=>'default','controller'=>'juridique',
'action'=>'ctx', 'siret'=>$this->siret, 'id'=>$this->id), 'default', true)?>" method="post">
<select name="type">
<?php foreach($this->TypeList as $k => $v) {?>
<option value="<?=$k?>" <?php if ($k==$this->Type){?> selected<?php }?>><?=$v?></option>
<?php }?>
</select>
<input type="submit" name="submit" value="OK">
</form>
</td>
</tr>
</table>
</div>
<h2>Liste des affaires en tant que <?=$this->TypeLabel?></h2>
<div class="paragraph">
<?php if (count($this->List) > 0) {?>
<table class="data">
<thead>
<tr>
<th>Date</th>
<th>Catégorie</th>
<th>Libellé</th>
<th>Tiers demandeur</th>
<th>Etat</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->List as $k => $item) {?>
<tr>
<td>
<?php
$dateString = '-';
try {
$date = new Zend_Date($item->Date, 'y-MM-dd');
$dateString = $date->toString('dd/MM/y');
} catch(Zend_Date_Exception $e){}
?><a href="<?=$this->url(array('action'=>'ctxdetail', 'affaireId'=>$item->Id))?>"><?=$dateString?></a></td>
<td><?=$item->CategoryLabel?></td>
<td><?=$item->Label?></td>
<td>
<?php foreach($item->TierName->item as $t) {?>
<?=$t?>
<?php }?>
</td>
<td><?=$item->StatusLabel?></td>
</tr>
<?php }?>
</tbody>
</table>
<?php if ($this->PageTotal>1) {?>
<div class="paragraph">
<div class="pagination clearfix">
<a class="first" href="<?=$this->url(array('page'=>1, 'type'=>$this->Type))?>">&laquo;</a>
<a class="previous" href="<?=$this->url(array('page'=>$this->PagePrev, 'type'=>$this->Type))?>">&lsaquo;</a>
<span>Page <?=$this->PageCurrent?>/<?=$this->PageTotal?></span>
<a class="next" href="<?=$this->url(array('page'=>$this->PageNext, 'type'=>$this->Type))?>">&rsaquo;</a>
<a class="last" href="<?=$this->url(array('page'=>$this->PageTotal, 'type'=>$this->Type))?>">&raquo;</a>
</div>
</div>
<?php }?>
<?php }?>
</div>
<?php }?>
<?=$this->render('cgu.phtml', $this->cgu)?>
</div>

View File

@ -1,112 +0,0 @@
<div id="center">
<h1 class="titre">Contentieux Judiciaires</h1>
<?php if ($this->msg) {?>
<div class="paragraph">
<div style="padding: 0 .7em;" class="ui-state-error ui-corner-all">
<p><span style="float: left; margin-right: .3em;" class="ui-icon ui-icon-alert"></span>
<strong>Alerte :</strong> <?=$this->msg?></p>
</div>
</div>
<?php } else {?>
<div class="paragraph">
<table class="identite">
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro identifiant Siren</td>
<td width="350" class="StyleInfoData"><?=$this->SirenTexte($this->siren)?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Dénomination Sociale</td>
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
</table>
</div>
<h2>Détail de l'affaire</h2>
<div class="paragraph">
<table class="data">
<tbody>
<tr><td>Tribunal</td><td><?=$this->Affaire->GreffeLabel?></td></tr>
<tr>
<td>Date de l'affaire</td>
<td>
<?php
$dateString = '-';
try {
$date = new Zend_Date($this->Affaire->Date, 'y-MM-dd');
$dateString = $date->toString('dd/MM/y');
} catch(Zend_Date_Exception $e){}
?>
<?=$dateString?></td>
</tr>
<tr><td>Etat de l'affaire</td><td><?=$this->Affaire->StatusLabel?></td></tr>
<tr><td>Type de contentieux</td><td><?=$this->Affaire->CategoryLabel?></td></tr>
<tr><td>Nature de l'affaire</td><td><?=$this->Affaire->Label?></td></tr>
<tr>
<td>Demandeurs</td>
<td>
<?php if (count($this->Affaire->Tiers->item) > 0) {?>
<?php foreach ($this->Affaire->Tiers->item as $t) {?>
<?php if ($t->TypeCode == 'DE') {?>
<div>
<strong><?=$t->companyNom?></strong><?php if (!empty($t->companyId)) {?> (<?=$this->SirenTexte($t->companyId)?>) <?php }?>
<?php if (!empty($t->Acteur)) {?>
<?php foreach($t->Acteur->item as $acteur) {?>
<br/> - <?=$acteur->Nom?>
<?php }?>
<?php }?>
</div>
<?php }?>
<?php }?>
<?php }?>
</td>
</tr>
<tr>
<td>Défendeurs</td>
<td>
<?php if (count($this->Affaire->Tiers->item) > 0) {?>
<?php foreach ($this->Affaire->Tiers->item as $t) {?>
<?php if ($t->TypeCode == 'DF') {?>
<div>
<strong><?=$t->companyNom?></strong><?php if (!empty($t->companyId)) {?> (<?=$this->SirenTexte($t->companyId)?>) <?php }?>
<?php if (!empty($t->Acteur)) {?>
<?php foreach($t->Acteur->item as $acteur) {?>
<br/> - <?=$acteur->Nom?>
<?php }?>
<?php }?>
</div>
<?php }?>
<?php }?>
<?php }?>
</td>
</tr>
<tr><td colspan="2">Historique</td></tr>
<?php if (property_exists($this->Affaire->Histo, 'item') && count($this->Affaire->Histo->item) > 0) {?>
<?php foreach ($this->Affaire->Histo->item as $h){?>
<tr>
<td>
<?php
$dateString = '-';
try {
$date = new Zend_Date($h->Date, 'y-MM-dd');
$dateString = $date->toString('dd/MM/y');
} catch(Zend_Date_Exception $e){}
?>
<?=$dateString?>
</td>
<td><?=$h->Label?></td>
</tr>
<?php }?>
<?php } else {?>
<tr><td colspan="2">- Aucune information -</td></tr>
<?php }?>
</tbody>
</table>
</div>
<?php }?>
</div>

View File

@ -1,106 +0,0 @@
<div id="center">
<?php if ($this->Privilege->Type == '03') { ?>
<h1>Privilège de la sécurité sociale et des régimes complémentaires</h1>
<?php }elseif ($this->Privilege->Type == '04') { ?>
<h1>Privilège du trésor public</h1>
<?php } ?>
<div class="paragraph">
<table class="identite">
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro identifiant Siren</td>
<td width="350" class="StyleInfoData"><?=$this->SirenTexte($this->siren)?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Dénomination Sociale</td>
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
</table>
</div>
<h2>Détail</h2>
<div class="paragraph">
<table class="identite">
<tr>
<?php $date = new Zend_Date($this->Privilege->Date,'yyyy-MM-dd');?>
<td colspan="2"><i>Inscription n° <?=$this->Privilege->Num?> du <?=$date->toString('dd/MM/yyyy')?>, au <?=$this->Privilege->GreffeLabel?></i></td>
</tr>
<tr>
<td class="StyleInfoLib">Montant de la créance</td>
<td><?=number_format($this->Privilege->Mt, 2, ',', ' ')?> <?=$this->Privilege->Devise?></td>
</tr>
<tr>
<td class="StyleInfoLib">Organisme créancier</td>
<td>
<?=$this->Privilege->CreancierNom?><br/>
<?=$this->Privilege->CreancierAdresse1?>&nbsp;
<?=$this->Privilege->CreancierAdresse2?>&nbsp;
<?=$this->Privilege->CreancierAdresse3?>&nbsp;
<?=$this->Privilege->CreancierCP?>&nbsp;
<?=$this->Privilege->CreancierVille?><br/>
<?=$this->Privilege->CreancierPays?>
<?=$this->Privilege->CreancierAutres?>
</td>
</tr>
<tr>
<td class="StyleInfoLib">Date de fraicheur</td>
<?php $date = new Zend_Date($this->Privilege->DateFresh, 'yyyy-MM-dd')?>
<td><?=$date->toString('dd/MM/yyyy')?></td>
</tr>
<?php if ($this->Privilege->RadiationDate == '0000-00-00' && empty($this->Privilege->RadiationPartiel)) {?>
<tr>
<td class="StyleInfoLib">Date de fin</td>
<td>
<?php $date = new Zend_Date($this->Privilege->Date, 'yyyy-MM-dd'); ?>
<?php
switch ($this->Privilege->Type) {
case '03':
echo $date->addDay(900)->toString('dd/MM/yyyy');
break;
case '04':
echo $date->addDay(1460)->toString('dd/MM/yyyy');
break;
}
?>
</td>
</tr>
<?php }?>
<tr>
<td class="StyleInfoLib" style="vertical-align:top;">Compléments</td>
<?php if (!empty($this->Privilege->RadiationDate) && $this->Privilege->RadiationDate!='0000-00-00'
|| !empty($this->Privilege->RadiationPartiel)) { ?>
<td>
<?php
if (!empty($this->Privilege->RadiationDate) && $this->Privilege->RadiationDate!='0000-00-00') {
$date = new Zend_Date($this->Privilege->RadiationDate,'yyyy-MM-dd');
echo 'Radié le '.$date->toString('dd/MM/yyyy');
} elseif (!empty($this->Privilege->RadiationPartiel)) {
if ($this->Privilege->RadiationMention!='0000-00-00'){
$date = new Zend_Date($this->Privilege->RadiationMention,'yyyy-MM-dd');
echo 'Partiellement radié le '.$date->toString('dd/MM/yyyy');
}
if (!empty($this->Privilege->RadiationMt)){
echo ' pour un montant de '.
number_format($priv->RadiationMt, 2, ',', ' ') .
' ' . $this->Privilege->RadiationDevise;
}
?>
<br/>
<?=$this->Privilege->RadiationPartiel?>
<?php } ?>
</td>
<?php } else { ?>
<td>-</td>
<?php }?>
</tr>
<tr>
<td class="StyleInfoLib">Date Insertion</td>
<?php $date = new Zend_Date($this->Privilege->DateInsert,'yyyy-MM-dd')?>
<td><?=$date->toString('dd/MM/yyyy')?></td>
</tr>
</table>
</div>
</div>

View File

@ -1,84 +0,0 @@
<div id="center">
<h1>Synthèse des inscriptions d'endettement</h1>
<div class="paragraph">
<table class="identite">
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro identifiant Siren</td>
<td width="350" class="StyleInfoData"><?=$this->SirenTexte($this->siren)?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Dénomination Sociale</td>
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
</table>
</div>
<h2>Synthèse</h2>
<div class="paragraph">
<table>
<tbody>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Nombre total d'inscription(s)</td>
<td width="350" class="StyleInfoData"><?=$this->PrivilegesNb?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Montant total des inscriptions</td>
<td width="350" class="StyleInfoData"><?=number_format($this->PrivilegesMt, 2, ',', ' ')?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Cumul par type d'inscription</td>
<td width="350" class="StyleInfoData">
<?php if (count($this->PrivilegesCumul) > 0) {?>
<?php foreach ($this->PrivilegesCumul as $c) {?>
<?php if ($c->Type == '04') {?>
<?=$c->Nb?> privilège<?php if ($c->Nb>1) {?>s<?php }?> du trésor public,
pour un montant de <?=number_format($c->Mt, 2, ',', ' ')?><br/>
<?php } elseif ($c->Type == '03') {?>
<?=$c->Nb?> privilège<?php if ($c->Nb>1) {?>s<?php }?> de la sécurité sociale et des régimes complémentaires,
pour un montant de <?=number_format($c->Mt, 2, ',', ' ')?><br/>
<?php }?>
<?php }?>
<?php }?>
</td>
</tr>
</tbody>
</table>
</div>
<h2>Liste des privilèges</h2>
<div class="paragraph">
<?php if (count($this->Privileges) > 0) {?>
<table class="greffe">
<thead>
<tr>
<th>Date</th>
<th>Type</th>
<th>Créancier</th>
<th>Montant</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->Privileges as $p) {?>
<tr>
<td><?=substr($p->Date,8,2).'/'.substr($p->Date,5,2).'/'.substr($p->Date,0,4)?></td>
<td><?=$p->TypeLabel?></td>
<td><?=$p->CreancierNom?></td>
<td nowrap>
<a href="<?=$this->url(array('controller'=>'pieces', 'action'=>'privilegedetail', 'siret'=>$this->siret,
'viewId'=>$p->Id), 'default', true)?>"><?=number_format($p->Mt, 2, ',', ' ')?></a>
</td>
</tr>
<?php }?>
</tbody>
</table>
<?php }?>
</div>
</div>

View File

@ -1,172 +0,0 @@
<style>
div#dialog form em {color:#FF0000;}
div#dialog fieldset {border:1px solid; padding:1px; }
div#dialog fieldset legend {padding:5px; font-weight:bold; }
</style>
<?php
$bq=new Scores_Finance_Banques();
$banques=$bq->getBDF_Etabs('php');
$list_bq=json_encode($banques);
$list_guichets=$bq->getBDF_Guichets();
$lbanque = (array)json_decode($this->banques);
//var_dump($lbanque);
?>
<form name="saveRiban" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'ribansave'),null, true)?>" method="post">
<input type="hidden" name="mode" value="<?=$this->mode?>" />
<input type="hidden" name="siren" value="<?=$this->siren?>" />
<?php if($this->mode == 'add' || $this->mode == 'edit'){?>
<div class="fieldgrp">
<label>Siren</label>
<div class="field">
<div style="float:left;"><?=$this->siren?></div>
</div>
</div>
<div class="fieldgrp">
<label>Situation RIB</label>
<div class="field">
<?php
if ($this->actif==1 || (isset($lbanque['dateSuppr']) && $lbanque['dateSuppr']=='0000-00-00 00:00:00') ){
$checkActive = 'checked';
$checkInactive = '';
} else {
$checkInactive = 'checked';
$checkActive = '';
}
?>
<div style="float:left;">Active<input type="radio" name="actif" value="1" <?=$checkActive;?>/></div>
<div style="float:left;">Inactive<input type="radio" name="actif" value="0" <?=$checkInactive;?>/></div>
</div>
</div>
<div class="fieldgrp">
<fieldset>
<legend>Saisie RIB</legend>
<div class="fieldgrp">
<label>Banque</label>
<div class="field" >
<select name="Banque" type="text" value="<?=$this->banqueMod?>" >
<option value="<?=$this->banqueMod?>"><?=isset($banques[$this->banqueMod])?$banques[$this->banqueMod]:$this->banqueMod?></option>
<?php foreach($banques as $num => $name):?>
<option value="<?=$num?>"><?=substr($name,0,40)?></option>
<?php endforeach;?>
</select>
<span id="denombque"></span>
</div>
</div>
<div class="fieldgrp">
<label>Guichet</label>
<div class="field" >
<select name="Guichet" style="width:160px;" >
<option value=""><?=$this->banqueMod?></option>
<?php foreach( $this->banques as $val ) {?>
<option value="<?=$val->codeBanque?>"><?=$val->codeBanque?></option>
<?php }?>
</select>
<span id="denomgcht"></span>
</div>
</div>
<div class="fieldgrp">
<label>RIB</label>
<div class="field">
<input type="text" name="code_banque" size="4" value="<?=(isset($lbanque['codeBanque'])?$lbanque['codeBanque']:'') ?>"/>
<input type="text" name="code_guichet" size="4" value="<?=(isset($lbanque['codeGuichet'])?$lbanque['codeGuichet']:'') ?>"/>
<input type="text" name="num_compte" size="32" value="<?=(isset($lbanque['numCompte'])?$lbanque['numCompte']:'') ?>"/>
</div>
</div>
</fieldset>
</div>
<div class="fieldgrp">
<fieldset>
<legend>Saisie BIC/IBAN</legend>
<div class="fieldgrp">
<label>BIC/SWIFT</label>
<div class="field">
<input type="text" name="bic_swift" value="<?=(isset($lbanque['bic'])?$lbanque['bic']:'') ?>" size="20"/>
</div>
</div>
<div class="fieldgrp">
<label>IBAN</label>
<div class="field">
<input type="text" name="iban" value="<?=(isset($lbanque['iban'])?$lbanque['iban']:'') ?>" size="47"/>
</div>
</div>
</fieldset>
<?php }else {?>
<input type="hidden" name="code_banque" value="<?=(isset($lbanque['codeBanque'])?$lbanque['codeBanque']:'') ?>" />
<input type="hidden" name="code_guichet" value="<?=(isset($lbanque['codeGuichet'])?$lbanque['codeGuichet']:'') ?>" />
<input type="hidden" name="num_compte" value="<?=(isset($lbanque['numCompte'])?$lbanque['numCompte']:'') ?>" />
<input type="hidden" name="bic_swift" value="<?=(isset($lbanque['bic'])?$lbanque['bic']:'') ?>" />
<input type="hidden" name="iban" value="<?=(isset($lbanque['iban'])?$lbanque['iban']:'') ?>" />
<p>Voulez vous supprimer ce RIB ?</p>
<?php }?>
</form>
<script>
var tab_bqu=<?=$list_bq?>;
var tab_guichet=<?=$list_guichets?>;
var selecthtml1='<option value="<?=$this->banqueMod?>"><?=$this->banqueMod?></option>';
$('select[name=Banque]').change(function(e){
var num=$('select[name=Banque]').val();
$('select[name=code_banque]').val(num);
var selecthtml2=selecthtml1;
for(var numg in tab_guichet[num]){
selecthtml2+='<option value="'+numg+'">'+numg+'</option>';
}
$('select[name=Guichet]').html(selecthtml2);
if($('input[name=code_banque]').val()==""){
$('input[name=code_banque]').val(num);
}
});
$('select[name=Guichet]').change(function(){
var num=$('select[name=Banque]').val();
var numg=$('select[name=Guichet]').val();
$('#denomgcht').html(tab_guichet[num][numg]);
if($('input[name=code_guichet]').val()==""){
$('input[name=code_guichet]').val(numg);
}
});
$('input[name=code_banque]').change(function(e){
var num=$('input[name=code_banque]').val();
$('select[name=Banque]').val(num);
$('select[name=Banque]').change();
});
$('input[name=iban]').change(function(e){
var regex = new RegExp(' ', "igm");
var iban=$('input[name=iban]').val().replace(regex,"");
$('input[name=iban]').val(iban);
var num=iban.substr(4,5);
$('select[name=Banque]').val(num);
$('select[name=Banque]').change();
var numg=iban.substr(9,5);
$('select[name=Guichet]').val(num);
$('select[name=Guichet]').change();
});
$('#dialog').dialog({ buttons: [
{ text: "Valider", click: function() {
var form = $('form[name=saveRiban]');
$.post(form.attr('action'), form.serialize(), function(data){
form.replaceWith(data);
}).done(function(data){ alert(data);
}).fail(function(){ alert('Unknow error'); });
} },
{ text: "Annuler", click: function() { $(this).dialog("close"); } }
] });
</script>

View File

@ -1,70 +0,0 @@
<div id="survForm">
<link href="<?=$this->pathStyle?>/bsmain.css" media="all" rel="stylesheet" type="text/css">
<?php if(intval($this->step==0)):?>
<?php
$cs=new Scores_Import_FileCsv();
$msg=$cs->standardhelptext;
?>
<div id="msgintro" class="alert-sm alert-success"><?=$msg?>
<br><br><center>
<button id="btnstart" class="btn btn-sm btn-info">Le fichier est pret</button>
</center><br><br>
</div>
<?php endif;?>
<?php if(intval($this->step==2)):?>
<div id="center">
<h1 class="titre">SURVEILLANCE</h1>
<div class="paragraph">
<div id="msgintro" class="alert-sm alert-warning"><?=$this->msg?>
<br><br>
<br><br><center>
<a href="<?=$this->url(array('controller' => 'surveillance', 'action' => 'liste'))?>" class="submit">Retour</a>
</center><br><br>
</div>
<?php endif;?>
<div id="msg" class="alert-sm alert-danger"></div>
<form enctype="multipart/form-data" id="fileform" action="<?=$this->url(array('controller' => 'surveillance', 'action' => 'surveillanceserie'))?>" method="POST">
<input class="required" type="file" name="fichier" size="50000" >
<div class="form-group">
<?php foreach($this->tabSource as $s) : ?>
<input type="checkbox" name="source[]" value="<?=$s['value']?>"<?=$s['select']?>/>&nbsp;<?=$s['name']?><br/>
<?php endforeach; ?>
</div>
<div class="form-group">
<label for="email">Adresse email du destinataire</label>
<input class="required" name="email" type="text" value="<?=$this->email?>"/>
</div>
<input class="btn btn-sm btn-info" name="loadfile" value="Charger le fichier" type="submit">
<input name="ref" type="hidden" value="<?=$this->ref?>"/></div>
</form>
</div>
<script>
$( "#fileform" ).hide();
$('#btnstart').click(function( event ) {
$( "#fileform" ).show();
$( "#msgintro" ).hide();
});
$( "#fileform" ).submit(function( event ) {
var ok=false;
if($('input[name="source[]"]:checked').length > 0){
ok=true;
}
if ( $( ".required" ).val().length === 0 ) {
ok=false;
}
if(!ok){
$('#msg').html('Merci de remplir tous les champs');
}
if ( $( "input[name=fichier]" ).val().substr(-4,4) != '.csv' ) {
$('#msg').html('Format de fichier incorrect');
ok=false;
}
if(!ok){
event.preventDefault();
}
});</script>

View File

@ -1 +0,0 @@
Scores & Decisions : <?=$this->message?>

View File

@ -1 +0,0 @@
<img src="/file/image/cache/q/<?php echo $this->name;?>" />

View File

@ -1,72 +0,0 @@
<?php
class File_BodaccController extends Zend_Controller_Action
{
public function init()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}
public function actualAction()
{
$filename = $this->getRequest()->getParam('q');
preg_match('/BODACC_(A|B|C)_([0-9]{4})_(.*)\.pdf/', $filename, $matches);
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/persist/bodacc/'.$matches[1].'/'.$matches[2].'/'.$filename;
$content_type = 'application/pdf';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
public function histoAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/files/'.$filename;
$content_type = 'application/pdf';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
}

View File

@ -1,136 +0,0 @@
<?php
class File_GreffeController extends Zend_Controller_Action
{
public function init()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}
public function associationAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/files/'.$filename;
$content_type = 'application/pdf';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
public function bilanAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/files/'.$filename;
$content_type = 'application/pdf';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
public function acteAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/files/'.$filename;
$content_type = 'application/pdf';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
/**
* Distribution des kbis
*/
public function kbisAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/files/'.$filename;
$content_type = 'application/pdf';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
}

View File

@ -1,83 +0,0 @@
<?php
class File_ImageController extends Zend_Controller_Action
{
public function init()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}
/**
*
*/
public function logoAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/persist/logos/'.$filename;
$explode = explode('.', $file);
switch ($explode[1]) {
case 'png' : $content_type = 'image/png'; break;
case 'gif' : $content_type = 'image/gif'; break;
case 'jpeg':
case 'jpg' : $content_type = 'image/jpeg'; break;
}
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
/**
*
*/
public function cacheAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/pages/imgcache/'.$filename;
$content_type = 'image/png';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
}

View File

@ -1,287 +0,0 @@
<?php
class File_IndexController extends Zend_Controller_Action
{
public function init()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}
public function indexAction(){}
/**
* Gestion du chargement des fichiers des marques
*/
public function marqueAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/persist/marques/'.$filename;
$content_type = 'application/pdf';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
/**
* Gestion des liasses au format excel
*/
public function liasseAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/files/'.$filename;
$content_type = 'application/vnd.ms-excel';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
/**
* Gestion des log de consommation
*/
public function consommationAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/files/'.$filename;
$content_type = 'application/csv-tab-delimited-table';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
/**
* Export du portefeuille au format CSV
*/
public function portefeuilleAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/files/'.$filename;
$content_type = 'application/csv-tab-delimited-table';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
/**
* Export de la liste des surveillances au format CSV
*/
public function surveillanceAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/files/'.$filename;
$content_type = 'application/csv-tab-delimited-table';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
/**
* Gestion des fichiers bilan saisie par les clients
*/
public function bilanclientAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/persist/bilanclient/'.$filename;
$explode = explode('.', $file);
switch ($explode[1]) {
case 'pdf' : $content_type = 'application/pdf'; break;
case 'tiff' : $content_type = 'image/tiff'; break;
}
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
/**
* Gestion des rapports personnalisés
*/
public function customrapportAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/pages/'.$filename;
$content_type = 'application/pdf';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
/**
* Gestion des fichiers PDF des nouveautés
*/
public function newAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/persist/nouveautes/'.$filename;
$content_type = 'application/pdf';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
}

View File

@ -1,43 +0,0 @@
<?php
class File_LienController extends Zend_Controller_Action
{
public function init()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}
/**
* Internal files for groupes
*/
public function groupeAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/persist/groupes/'.$filename;
$content_type = 'application/pdf';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
}
}

View File

@ -1,57 +0,0 @@
<?php
class File_StreetviewController extends Zend_Controller_Action
{
public function init()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}
public function imgAction()
{
$filename = $this->getRequest()->getParam('q');
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/persist/streetview/'.$filename;
$content_type = 'application/csv-tab-delimited-table';
//Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
}
}
public function saveAction()
{
$request = $this->getRequest();
$name = $request->getParam('name');
$base64 = $request->getParam('base64');
$removePart = 'data:image/jpg;base64,';
$pos = strpos($base64, $removePart);
$data = substr($base64, $pos + strlen($removePart));
$c = Zend_Registry::get('config');
$file = $c->profil->path->shared.'/persist/streetview/'.$name;
$result = file_put_contents($file, base64_decode($data));
if ($result === false) {
echo "Error";
} else {
echo "";
}
}
}

View File

@ -0,0 +1,15 @@
<?php
class Zend_View_Helper_CssHelper extends Zend_View_Helper_Abstract
{
function cssHelper() {
$request = Zend_Controller_Front::getInstance()->getRequest();
$file_uri = 'media/css/' . $request->getControllerName() . '/' . $request->getActionName() . '.css';
if (file_exists($file_uri)) {
$this->view->headLink()->appendStylesheet('/' . $file_uri);
}
return $this->view->headLink();
}
}

View File

@ -0,0 +1,28 @@
<?php
class Zend_View_Helper_JavascriptHelper extends Zend_View_Helper_Abstract
{
function javascriptHelper()
{
$request = Zend_Controller_Front::getInstance()->getRequest();
$controller = $request->getControllerName();
$action = $request->getActionName();
$paramsTheme = Zend_Registry::get('theme');
$fileController = APPLICATION_PATH . '/../public/' .
$paramsTheme->pathScript . '/' . $controller . '.js';
if ( file_exists($fileController) ) {
$contentScript = file_get_contents($fileController);
$view->inlineScript()->appendScript($contentScript);
}
$fileControllerAction = APPLICATION_PATH . '/../public/' .
$paramsTheme->pathScript . '/' . $controller . '-' . $action . '.js';
if ( file_exists($fileControllerAction) ) {
$contentScript = file_get_contents($fileControllerAction);
$view->inlineScript()->appendScript($contentScript);
}
}
}

View File

@ -0,0 +1,29 @@
<?php
Class Zend_View_Helper_TrueLabel extends Zend_View_Helper_Abstract
{
public function __construct()
{
}
public function TrueLabel($list, $name)
{
try {
return (self::GetTrueLabel($list, $name));
} catch (Exception $e) {
echo 'Aucun label : ' . $e;
}
}
private function GetTrueLabel($list, $name)
{
if(isset($list)) {
foreach ($list as $nameLabel => $label)
{
if ($nameLabel == $name)
return ($label);
}
}
return ($name);
}
}

View File

@ -11,7 +11,7 @@ p { margin:10px 0;}
div#content { float:none; width:auto;}
</style>
<script>
$(function(){
$(document).ready(function(){
$('input[type=checkbox][name=accept]').click(function(e){
$('form[name=cgu]').css('display', 'none');
$('#msgsave').css('display', 'block');

View File

@ -2,17 +2,16 @@
<div style="position:absolute;width:680px;top:5px;" class="ui-state-highlight ui-corner-all">
<p>
<span style="float:left;margin-right:0.3em;" class="ui-icon ui-icon-info"></span>
<strong>Nouveau !</strong>
<strong>Nouveau !</strong>
<?php $cpt = 0;?>
<?php foreach ( $this->nouveautes as $nouveaute) {?>
<a href="<?=$this->url(array('module'=>'file','controller'=>'index', 'action'=>'new',
'q'=>$nouveaute->fichier))?>" target="_blank">
<a href="<?=$this->url(array('controller'=>'fichier', 'action'=>'new', 'fichier'=>$nouveaute->fichier))?>" target="_blank">
<?=$nouveaute->intitule?></a>
<?php $cpt++;?>
<?php if ( $cpt < count($this->nouveautes) ) {?>,<?php }?>
<?php }?>
<br/>
<span style="font-size:10px;">Cliquez sur les intitulés pour consulter le document,
<span style="font-size:10px;">Cliquez sur les intitulés pour consulter le document,
ou <a href="<?=$this->url(array('controller'=>'aide', 'action'=>'newliste'))?>">ici</a> pour retrouver la liste des modifications</span>
</p>
</div>

View File

@ -17,8 +17,8 @@ table td { border:1px solid; padding:5px; }
<thead>
<tr>
<th>Date</th>
<th>Intitulé</th>
<th>Catégorie</th>
<th>Intitulé</th>
<th>Catégorie</th>
</tr>
</thead>
<tbody>
@ -27,11 +27,11 @@ table td { border:1px solid; padding:5px; }
<tr>
<td><?=substr($nouveau->date,8,2).'/'.substr($nouveau->date,5,2).'/'.substr($nouveau->date,0,4)?></td>
<td>
<a href="<?=$this->url(array('module'=>'file', 'controller'=>'index', 'action'=>'new',
'q'=>$nouveau->fichier))?>" target="_blank">
<a href="<?=$this->url(array('controller'=>'fichier',
'action'=>'new', 'fichier'=>$nouveau->fichier))?>" target="_blank">
<?=$nouveau->intitule?></a>
</td>
<td><?=$nouveau->categorie?></td>
</td>
<td><?=$nouveau->categorie?></td>
</tr>
<?php }?>
<?php }?>

View File

@ -20,7 +20,7 @@
<div class="panel-body">
<p class="text-primary">Spécialiste de l'information légales et financières sur les entreprises, Scores & Décisions vous permet par
confirmation des éléments ci-contre d'accéder à toute sa base de données.</p>
<ul class="list-group">
<li class="list-group-item">
Télécharger nos Conditions Générales de Services
@ -38,9 +38,10 @@
<span class="glyphicon glyphicon-file pull-right" aria-hidden="true"></span></a>
</li>
</ul>
<p class="text-danger">Ce service est actuellement en beta. La consultation vous est offerte durant cette période.</p>
</div>
</div>
</div>
<div class="col-md-6">
@ -67,7 +68,7 @@
<?php foreach ($this->Params as $item) {?>
<input type="hidden" name="P-<?=$item->label?>" value="<?=$item->value?>"/>
<?php }?>
<input type="hidden" name="partner" value="<?=$this->FormPartner?>"/>
<div class="form-group">
@ -101,7 +102,7 @@
<label for="tel">Téléphone</label>
<input type="text" class="form-control" name="tel" value="<?=$this->FormTel?>">
</div>
<button class="btn btn-lg btn-primary btn-block clearfix" type="submit">Valider</button>
<?php }?>

View File

@ -163,7 +163,7 @@ foreach ($this->listModulesFcc as $id => $module) {
</div>
<script>
$(function(){
$(document).ready(function(){
$('#listeModulesD').click(function(){
var position = $(this).position();
$('#listeModules').css('top', position.top);

View File

@ -7,7 +7,7 @@ fieldset legend { font-weight:bold; font-size: 108%; padding:0; }
div.submit { clear: both; text-align: center; }
</style>
<script type="text/javascript">
$(function(){
$(document).ready(function(){
$('.menu-close').click(function(){
$('div.blockh2').css('display','none');

View File

@ -27,7 +27,7 @@ function checkProgress() {
});
}
$(function() {
$(document).ready(function() {
$('#uploadForm').ajaxForm({
beforeSubmit: function() {
$('#uploadOutput').html('Envoi en cours...');

View File

@ -1,5 +1,5 @@
<script>
$(function(){
$(document).ready(function(){
$('a.user-service').click(function(e){
e.preventDefault();

Some files were not shown because too many files have changed in this diff Show More