Compare commits
72 Commits
wip-2.9-de
...
SD-32
Author | SHA1 | Date | |
---|---|---|---|
|
fe0fb41d04 | ||
|
220aa8e27c | ||
|
9a8a008d03 | ||
|
65831d3194 | ||
|
b63addf2a4 | ||
|
d1d3448e2d | ||
|
0e2ad852b2 | ||
|
442ded2379 | ||
|
71d9e899f9 | ||
|
2b9e237d31 | ||
|
bdc8be3670 | ||
|
a0ebfe4d14 | ||
|
5313c9265b | ||
|
3510df43e2 | ||
|
9eec98395b | ||
|
4a384d6f79 | ||
|
c12ac41b8a | ||
|
1fd1e78603 | ||
|
e8ad4db136 | ||
|
ed53d33b7e | ||
|
23bd68129c | ||
|
693675583e | ||
|
f74eef8399 | ||
|
b9b5c774e5 | ||
|
2346302684 | ||
|
98378fa6df | ||
|
d1936057f9 | ||
|
511dfa92d7 | ||
|
4a1ea34d41 | ||
|
7f43461f7d | ||
|
8a95034deb | ||
|
f59827e869 | ||
|
b8cd36c2a2 | ||
|
cc4592eddd | ||
|
f55fa25915 | ||
|
a880dea68d | ||
|
0c6e07b12c | ||
|
3f814645e5 | ||
|
af0d432680 | ||
|
f19057dcca | ||
|
5f27da2646 | ||
|
4b2e22ba21 | ||
|
2c2d31afe6 | ||
|
9069fd32e3 | ||
|
cb9ff5f7b1 | ||
|
7dd700c160 | ||
|
47b413ee21 | ||
|
781441ff56 | ||
|
d491b35fcd | ||
|
dd75075e2c | ||
|
a408af31b6 | ||
|
612b8176df | ||
|
fe436afb8e | ||
|
25b8870f16 | ||
|
cae5250e25 | ||
|
c0960cfa21 | ||
|
aab33cf83b | ||
|
0205411e8c | ||
|
38cc757542 | ||
|
4363454eb1 | ||
|
2367e4ca0f | ||
|
db1fb57858 | ||
|
e8d13e6044 | ||
|
7b441166ec | ||
|
e5d5446299 | ||
|
5c96452849 | ||
|
de8413e567 | ||
|
1d004772b2 | ||
|
178909c96d | ||
|
60657ac327 | ||
|
0692653f61 | ||
|
38402789f7 |
@ -1,4 +1,9 @@
|
||||
<?php
|
||||
use Monolog\Logger;
|
||||
use Monolog\Handler\StreamHandler;
|
||||
use Monolog\Processor\IntrospectionProcessor;
|
||||
use Monolog\Handler\ChromePHPHandler;
|
||||
|
||||
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
{
|
||||
/**
|
||||
@ -98,6 +103,36 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
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
|
||||
*/
|
||||
@ -136,6 +171,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
*/
|
||||
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),
|
||||
|
@ -3,8 +3,18 @@ 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');
|
||||
}
|
||||
@ -70,7 +80,7 @@ class AideController extends Zend_Controller_Action
|
||||
require_once 'Scores/WsScores.php';
|
||||
$ws = new WsScores();
|
||||
$accept = $ws->setCGU();
|
||||
Zend_Registry::get('firebug')->info($accept);
|
||||
$this->logger->info($accept);
|
||||
if ($accept) {
|
||||
//Put in session
|
||||
$auth = Zend_Auth::getInstance();
|
||||
|
@ -14,8 +14,18 @@ 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');
|
||||
}
|
||||
@ -96,7 +106,7 @@ class AuthController extends Zend_Controller_Action
|
||||
try {
|
||||
$ws = new Scores_Ws_Client('gestion', '0.3');
|
||||
$InfosLogin = $ws->getInfosLogin($parameters);
|
||||
Zend_Registry::get('firebug')->info($InfosLogin);
|
||||
$this->logger->info(print_r($InfosLogin,1));
|
||||
if ( is_string($InfosLogin) || $InfosLogin->error->errnum != 0 ) {
|
||||
$this->view->Error = true;
|
||||
} else {
|
||||
|
@ -3,8 +3,18 @@ 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');
|
||||
}
|
||||
@ -83,7 +93,7 @@ class BdfController extends Zend_Controller_Action
|
||||
$req = substr($siret, 0, 9);
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info($module);
|
||||
$this->logger->info($module);
|
||||
|
||||
$content = array();
|
||||
|
||||
|
@ -101,6 +101,12 @@ 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
|
||||
@ -128,6 +134,10 @@ 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');
|
||||
|
||||
@ -177,7 +187,7 @@ class DashboardController extends Zend_Controller_Action
|
||||
*/
|
||||
protected function statChart($data, $labels, $name)
|
||||
{
|
||||
require_once("Vendors/ChartDirector/phpchartdir.php");
|
||||
require_once 'ChartDirector/phpchartdir.php';
|
||||
|
||||
$hChart = 210;
|
||||
|
||||
@ -782,7 +792,7 @@ class DashboardController extends Zend_Controller_Action
|
||||
$user = $ws->getUser($login);
|
||||
$options = json_decode($user, true);
|
||||
|
||||
Zend_Registry::get('firebug')->info($user);
|
||||
$this->logger->info(print_r($user,1));
|
||||
|
||||
$this->view->assign('droits', explode(' ',$options['droits']));
|
||||
$this->view->assign('prefs', explode(' ',$options['pref']));
|
||||
@ -868,7 +878,7 @@ class DashboardController extends Zend_Controller_Action
|
||||
}
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info($output);
|
||||
$this->logger->info(print_r($output,1));
|
||||
|
||||
$this->view->assign('output', $output);
|
||||
}
|
||||
@ -983,7 +993,7 @@ class DashboardController extends Zend_Controller_Action
|
||||
|
||||
//Liste des periodes de facturation
|
||||
$contrats = $ws->getClientTarifs($idClient);
|
||||
Zend_Registry::get('firebug')->info($contrats);
|
||||
$this->logger->info(print_r($contrats,1));
|
||||
$this->view->assign('contrats', $contrats->item);
|
||||
|
||||
//Liste des services
|
||||
|
@ -5,8 +5,18 @@ 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');
|
||||
|
||||
|
@ -3,8 +3,18 @@ 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');
|
||||
}
|
||||
@ -60,7 +70,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('supportdev');
|
||||
$mail->setFromKey('support');
|
||||
$mail->addToKey('supportdev');
|
||||
$mail->execute();
|
||||
}
|
||||
|
@ -5,8 +5,18 @@ 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');
|
||||
|
||||
@ -119,10 +129,10 @@ class EvaluationController extends Zend_Controller_Action
|
||||
}
|
||||
|
||||
//Make the graph - Ready to create a class for this char
|
||||
require_once 'Vendors/ChartDirector/phpchartdir.php';
|
||||
require_once 'ChartDirector/phpchartdir.php';
|
||||
require_once 'Scores/Cache.php';
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared . '/temp/pages/imgcache/';
|
||||
$path = $c->profil->path->shared . '/pages/imgcache/';
|
||||
$file = 'indiscorehisto-'.$this->siret.'-'.$this->id.'-'.$type.'.png';
|
||||
$cache = new Cache();
|
||||
$return = null;
|
||||
@ -455,7 +465,7 @@ class EvaluationController extends Zend_Controller_Action
|
||||
$email = $request->getParam('email', '');
|
||||
|
||||
$infos = $ws->getRapport($siren, 3, 0, $plus, $ref, $encours, $email);
|
||||
Zend_Registry::get('firebug')->info($infos);
|
||||
$this->logger->info(print_r($infos,1));
|
||||
if ($infos === false) {
|
||||
$this->forward('soap', 'error');
|
||||
}
|
||||
@ -547,7 +557,7 @@ class EvaluationController extends Zend_Controller_Action
|
||||
$file = 'evaluation-indiscore3-'.$this->siret.'.html';
|
||||
}
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared.'/temp/pages';
|
||||
$path = $c->profil->path->shared.'/pages';
|
||||
if (file_exists($path.'/'.$file))
|
||||
{
|
||||
$doc = new DOMDocument();
|
||||
@ -620,7 +630,7 @@ class EvaluationController extends Zend_Controller_Action
|
||||
$xml = $doc->saveXML();
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$outfile = $c->profil->path->shared.'/temp/pages/p'.$user->getIdClient().'-'.$file;
|
||||
$outfile = $c->profil->path->shared.'/pages/p'.$user->getIdClient().'-'.$file;
|
||||
file_put_contents($outfile, $xml);
|
||||
|
||||
//Génération du pdf
|
||||
@ -829,7 +839,7 @@ class EvaluationController extends Zend_Controller_Action
|
||||
"<pre>".print_r($InfoEnq, 1)."</pre>";
|
||||
|
||||
$mail = new Scores_Mail_Method();
|
||||
$mail->setFromKey('production');
|
||||
$mail->setFromKey('supportdev');
|
||||
$mail->addToKey('support');
|
||||
$mail->setSubject($sujet);
|
||||
$mail->setBodyHtml($texte);
|
||||
@ -903,7 +913,7 @@ class EvaluationController extends Zend_Controller_Action
|
||||
$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.'/temp/creditsafe/'.$this->siret.'.xml';
|
||||
$file = $c->profil->path->shared.'/creditsafe/'.$this->siret.'.xml';
|
||||
|
||||
try {
|
||||
$client = new Zend_Http_Client($url);
|
||||
@ -998,7 +1008,7 @@ class EvaluationController extends Zend_Controller_Action
|
||||
'Utilisateur='.$login;
|
||||
|
||||
$mail->setBodyText($texte);
|
||||
$mail->setFromKey('contact');
|
||||
$mail->setFromKey('supportdev');
|
||||
$mail->addToKey('contact');
|
||||
$mail->execute();
|
||||
|
||||
|
@ -5,8 +5,18 @@ 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');
|
||||
|
||||
@ -172,7 +182,7 @@ class FinanceController extends Zend_Controller_Action
|
||||
$request = $this->getRequest();
|
||||
$ratio = $request->getParam('ratio');
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared . '/temp/pages/imgcache/';
|
||||
$path = $c->profil->path->shared . '/pages/imgcache/';
|
||||
$file = 'syntheseEvol-'.$this->siret.'-'.$this->id.'-'.$ratio.'.png';
|
||||
if (file_exists($path.$file)) {
|
||||
echo '<img src="/file/image/cache/q/'.$file.'" />';
|
||||
@ -191,7 +201,7 @@ class FinanceController extends Zend_Controller_Action
|
||||
$request = $this->getRequest();
|
||||
$typeBilan = $request->getParam('typeBilan');
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared . '/temp/pages/imgcache/';
|
||||
$path = $c->profil->path->shared . '/pages/imgcache/';
|
||||
$file = 'synthese-linecompare-'.$this->siret.'-'.$this->id.'-'.$typeBilan.'.png';
|
||||
if (file_exists($path.$file)) {
|
||||
echo '<img src="/file/image/cache/q/'.$file.'" />';
|
||||
@ -434,7 +444,7 @@ class FinanceController extends Zend_Controller_Action
|
||||
$dateCloture = $request->getParam('dateCloture');
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared . '/temp/pages/imgcache/';
|
||||
$path = $c->profil->path->shared . '/pages/imgcache/';
|
||||
switch($type){
|
||||
case 'actif':
|
||||
$file = 'bilansgraphactif-'.$this->siret.'-'.$this->id.'-'.$typeBilan.$dateCloture.'.png';
|
||||
@ -630,7 +640,7 @@ class FinanceController extends Zend_Controller_Action
|
||||
$request = $this->getRequest();
|
||||
$ratio = $request->getParam('ratio');
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared . '/temp/pages/imgcache/';
|
||||
$path = $c->profil->path->shared . '/pages/imgcache/';
|
||||
$file = 'ratiosgraph-'.$this->siret.'-'.$this->id.'-'.$ratio.'.png';
|
||||
if (file_exists($path.$file)) {
|
||||
echo '<img src="/file/image/cache/q/'.$file.'" />';
|
||||
@ -677,7 +687,7 @@ class FinanceController extends Zend_Controller_Action
|
||||
$data[$element->id] = $element->val;
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared . '/temp/files/';
|
||||
$path = $c->profil->path->shared . '/files/';
|
||||
$file = 'liasse-'.substr($this->siret, 0, 9).'-'.$this->id.'-'.$type.$date.'.xls';
|
||||
|
||||
$liasse = new Scores_Finance_Liasse_XLS($model);
|
||||
@ -736,7 +746,7 @@ class FinanceController extends Zend_Controller_Action
|
||||
if ($result === false) {
|
||||
$this->view->msg = "Erreur lors de l'enregistrement des informations";
|
||||
} else {
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
$this->logger->info(print_r($result,1));
|
||||
$this->view->ref = strtoupper($result);
|
||||
$this->view->fileref = $params['siren'] . '_' . $params['format'] . '_' .
|
||||
substr($params['dateCloture'],6,4) . substr($params['dateCloture'],3,2) .
|
||||
@ -842,6 +852,7 @@ class FinanceController extends Zend_Controller_Action
|
||||
$this->view->assign('raisonSociale', $entreprise->getRaisonSociale());
|
||||
$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;
|
||||
|
||||
@ -931,8 +942,6 @@ 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);
|
||||
@ -943,8 +952,19 @@ class FinanceController extends Zend_Controller_Action
|
||||
$date = substr($dateAndType, 1);
|
||||
|
||||
// Récupération des postes du bilan
|
||||
$infos = $ws->getBilan(substr($this->siret, 0, 9), $date, $type, true);
|
||||
if ($infos === false) $this->forward('soap', 'error');
|
||||
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);
|
||||
|
||||
// Error
|
||||
if ($infos === false) {
|
||||
$this->forward('soap', 'error');
|
||||
}
|
||||
|
||||
// Formatage de la liasse
|
||||
$infoLiasse = new Scores_Finance_Liasse($infos, $unite);
|
||||
@ -969,12 +989,14 @@ class FinanceController extends Zend_Controller_Action
|
||||
$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')) ) {
|
||||
$this->view->assign('exportxls', true);
|
||||
} catch (Exception $e) {
|
||||
$this->view->msg = $e->getMessage();
|
||||
}
|
||||
|
||||
//Gestion export de la liasse au format XLS
|
||||
if ( $user->checkPerm('liassexls') && in_array($type,array('C', 'N', 'S')) ) {
|
||||
$this->view->assign('exportxls', true);
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->assign('id', $id);
|
||||
@ -1048,7 +1070,7 @@ class FinanceController extends Zend_Controller_Action
|
||||
|
||||
|
||||
$entreprise = new Scores_Session_Entreprise($this->siret, $this->id);
|
||||
$this->view->assign('banques', $infos->result->item);
|
||||
$this->view->assign('banques', isset($infos->result->item)?$infos->result->item:array());
|
||||
$this->view->assign('raisonSociale', $entreprise->getRaisonSociale());
|
||||
$this->view->assign('siren', substr($this->siret, 0, 9));
|
||||
$this->view->assign('exportObjet', $infos);
|
||||
|
@ -40,9 +40,18 @@ 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');
|
||||
|
||||
@ -409,7 +418,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);
|
||||
|
@ -5,8 +5,18 @@ 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');
|
||||
|
||||
@ -397,6 +407,8 @@ class IdentiteController extends Zend_Controller_Action
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
@ -455,7 +467,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
|
||||
$ws = new WsScores();
|
||||
$infos = $ws->getEtablissementsGeo($siren, $actif, $position, $nbAffichage);
|
||||
Zend_Registry::get('firebug')->info($infos);
|
||||
$this->logger->info(print_r($infos,1));
|
||||
if ($infos === false) $this->forward('soap', 'error');
|
||||
|
||||
$etabs = $infos->result->item;
|
||||
@ -521,7 +533,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
'gps' => $gps,
|
||||
);
|
||||
}
|
||||
Zend_Registry::get('firebug')->info($marks);
|
||||
$this->logger->info(print_r($marks,1));
|
||||
}
|
||||
$this->view->assign('marks', json_encode($marks));
|
||||
}
|
||||
@ -1071,7 +1083,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
|
||||
$ws = new WsScores();
|
||||
$result = $ws->getLienRef($id);
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
$this->logger->info(print_r($result,1));
|
||||
$this->view->assign('result', $result);
|
||||
|
||||
$this->view->assign('idFiche', $id);
|
||||
@ -1161,6 +1173,8 @@ class IdentiteController extends Zend_Controller_Action
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
@ -1485,10 +1499,9 @@ class IdentiteController extends Zend_Controller_Action
|
||||
|
||||
$ws = new WsScores();
|
||||
$result = $ws->getGroupesArbo($siren, $pctMin, 10, $stopAtIsin);
|
||||
|
||||
if ( $result!==false ) {
|
||||
$infos = json_decode($result, true);
|
||||
Zend_Registry::get('firebug')->info($infos);
|
||||
$this->logger->info(print_r($infos,1));
|
||||
if (count($infos)>0) {
|
||||
|
||||
$name = $infos['name'];
|
||||
@ -1498,8 +1511,8 @@ class IdentiteController extends Zend_Controller_Action
|
||||
|
||||
$structure = array();
|
||||
$structure[] = array(
|
||||
'data' => $name,
|
||||
'state' => 'open',
|
||||
'text' => $name,
|
||||
'state' => array('opened'=>true),
|
||||
'children' => $this->groupesArboChildren($infos['children'], $siren),
|
||||
);
|
||||
$this->view->assign('data', json_encode($structure));
|
||||
@ -1536,7 +1549,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
|
||||
if ( $result!==false ) {
|
||||
$infos = json_decode($result, true);
|
||||
Zend_Registry::get('firebug')->info($infos);
|
||||
$this->logger->info(print_r($infos,1));
|
||||
if (count($infos)>0) {
|
||||
|
||||
$sirenTxt = substr($infos['siren'],0,3).' '.substr($infos['siren'],3,3).' '.substr($infos['siren'],6,3);
|
||||
@ -1550,8 +1563,8 @@ class IdentiteController extends Zend_Controller_Action
|
||||
|
||||
$structure = array();
|
||||
$structure[] = array(
|
||||
'data' => $name,
|
||||
'state' => 'open',
|
||||
'text' => $name,
|
||||
'state' => array('opened'=>true),
|
||||
'children' => $this->groupesArboChildren($infos['children'], $siren),
|
||||
);
|
||||
$this->view->assign('data', json_encode($structure));
|
||||
@ -1585,8 +1598,8 @@ class IdentiteController extends Zend_Controller_Action
|
||||
$name.= ' - '.$item['pmin'].'%';
|
||||
|
||||
$structure = array(
|
||||
'data' => $name,
|
||||
'state' => 'open',
|
||||
'text' => $name,
|
||||
'state' => array('opened'=>true),
|
||||
);
|
||||
|
||||
if ($item['siren']==$detectSiren) {
|
||||
@ -1653,7 +1666,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
$ws = new WsScores();
|
||||
$result = $ws->getContactEt($companyId, $filter);
|
||||
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
$this->logger->info(print_r($result,1));
|
||||
|
||||
if ($result->nbReponses>0) {
|
||||
$this->view->assign('contacts', $result->result->item);
|
||||
@ -1717,7 +1730,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
|
||||
$ws = new WsScores();
|
||||
$result = $ws->getEntrepriseAvisRncs($siren);
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
$this->logger->info(print_r($result,1));
|
||||
|
||||
if ( $result === false ) {
|
||||
$this->view->assign('error', true);
|
||||
@ -1896,7 +1909,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
|
||||
$ws = new WsScores();
|
||||
$result = $ws->getEntrepriseAvisRncs($siren);
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
$this->logger->info(print_r($result,1));
|
||||
|
||||
if ( $result === false ) {
|
||||
$this->view->assign('error', true);
|
||||
@ -2055,7 +2068,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
|
||||
// --- Création du PDF
|
||||
$c = Zend_Registry::get('config');
|
||||
$filepdf = $c->profil->path->shared.'/temp/files/avisrncs-'.$siren.'.pdf';
|
||||
$filepdf = $c->profil->path->shared.'/files/avisrncs-'.$siren.'.pdf';
|
||||
try {
|
||||
$pdf = new Scores_Pdf_Tcpdf();
|
||||
$pdf->SetBackgroundImage('libs/modeles/avisrncs.jpg');
|
||||
|
@ -3,6 +3,19 @@ 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
|
||||
*/
|
||||
@ -45,7 +58,7 @@ class IndexController extends Zend_Controller_Action
|
||||
|
||||
if (intval($version) == 2) {
|
||||
|
||||
$log = Zend_Registry::get('config')->profil->path->data.'/log/altisys.log';
|
||||
$log = Zend_Registry::get('config')->profil->path->shared.'/log/altisys.log';
|
||||
|
||||
$user = new Scores_Utilisateur();
|
||||
$login = $user->getLogin();
|
||||
@ -55,7 +68,7 @@ class IndexController extends Zend_Controller_Action
|
||||
|
||||
$content_type = 'application/csv-tab-delimited-table';
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared.'/temp/files/';
|
||||
$path = $c->profil->path->shared.'/files/';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($path.$file) ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
@ -84,7 +97,7 @@ class IndexController extends Zend_Controller_Action
|
||||
$ws = new WsScores();
|
||||
$reponse = $ws->getPortefeuilleCsv($login, $idClient);
|
||||
|
||||
$log = Zend_Registry::get('config')->profil->path->data.'/log/altisys.log';
|
||||
$log = Zend_Registry::get('config')->profil->path->shared.'/log/altisys.log';
|
||||
|
||||
if ($reponse === false){
|
||||
file_put_contents($log, date('Y-m-d H:i:s')." - URL = ERREUR\n", FILE_APPEND);
|
||||
|
@ -5,8 +5,18 @@ class JuridiqueController 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');
|
||||
|
||||
@ -25,11 +35,11 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
$request = $this->getRequest();
|
||||
|
||||
$autrePage = $request->getParam('apage');
|
||||
$vue = $request->getParam('vue', 'bodacc');
|
||||
|
||||
$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){
|
||||
@ -38,7 +48,6 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
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) {
|
||||
@ -76,13 +85,15 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
$infos = $ws->getAnnoncesAsso($siren, $idAnn, null, $position, $nbAffichage);
|
||||
} else {
|
||||
$idAnn = $session->getSourceId();
|
||||
$infos = $ws->getAnnoncesAsso($siren, $idAnn, null, $position, $nbAffichage);
|
||||
$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);
|
||||
Zend_Registry::get('firebug')->info("getAnnoncesBoamp");
|
||||
$this->logger->info("getAnnoncesBoamp");
|
||||
$infos = $ws->getAnnoncesBoamp($siren, $idAnn, $filtre, $position, $nbAffichage);
|
||||
break;
|
||||
case 'bodacc':
|
||||
@ -90,11 +101,14 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
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;
|
||||
}
|
||||
Zend_Registry::get('firebug')->info($infos);
|
||||
$this->logger->info(print_r($infos,1));
|
||||
if ($infos === false) {
|
||||
$this->forward('soap', 'error');
|
||||
}
|
||||
@ -114,65 +128,6 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
$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) ){
|
||||
@ -199,6 +154,8 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
@ -214,12 +171,174 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
foreach($objAnnonces->$classType as $ann) {
|
||||
$annonces[] = $objAnnonces->getAnnonceResume($ann);
|
||||
}
|
||||
Zend_Registry::get('firebug')->info($annonces);
|
||||
$this->view->assign($classType, $annonces);
|
||||
$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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -264,12 +383,9 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
$this->view->msg = "Erreur";
|
||||
} else {
|
||||
|
||||
$this->view->List = $response->List->item;
|
||||
$this->view->List = isset($response->List->item)?$response->List->item:null;
|
||||
// --- Pagination
|
||||
$nbReponsesTotal = $response->Nb;
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = null;
|
||||
$pageNext = null;
|
||||
if ($nbReponses < $nbReponsesTotal) {
|
||||
$pageTotal = ceil( $nbReponsesTotal / $nbReponses );
|
||||
$pageCurrent = $page;
|
||||
@ -281,6 +397,10 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
if( $pageNext > $pageTotal ) {
|
||||
$pageNext = $pageTotal;
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
@ -408,7 +528,7 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
if ($infos === false) $this->_forward('soap', 'error');
|
||||
|
||||
$competences = $infos->result->item;
|
||||
Zend_Registry::get('firebug')->info($infos);
|
||||
$this->logger->info(print_r($infos,1));
|
||||
if( $type=='tri' || $type=='cfe' ) {
|
||||
$i=0;
|
||||
foreach($competences as $comp){
|
||||
@ -443,7 +563,7 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
$ws = new WsScores();
|
||||
$infos = $ws->getListeConventions($siren);
|
||||
$conventions = $infos->result->item;
|
||||
Zend_Registry::get('firebug')->info($conventions);
|
||||
$this->logger->info(print_r($conventions,1));
|
||||
$this->view->assign('conventions', $conventions);
|
||||
$this->view->assign('exportObjet', $infos);
|
||||
}
|
||||
@ -473,7 +593,7 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
$this->view->assign('marques', $marques);
|
||||
$this->view->assign('idObject', $idObject);
|
||||
$this->view->assign('exportObjet', $marques);
|
||||
Zend_Registry::get('firebug')->info($infos);
|
||||
$this->logger->info(print_r($infos,1));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -497,9 +617,9 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
if(!file_exists($directory.'/'.$file)
|
||||
|| filesize($directory.'/'.$file)==0 ) {
|
||||
$cmd = 'php ' . APPLICATION_PATH . '/../scripts/jobs/getMarque.php ' . $numdepot;
|
||||
Zend_Registry::get('firebug')->info($cmd);
|
||||
$this->logger->info($cmd);
|
||||
$result = exec($cmd);
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
$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) {
|
||||
@ -511,40 +631,45 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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');
|
||||
$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;
|
||||
}
|
||||
$parution = $request->getParam('parution');
|
||||
$annonce = $request->getParam('annonce');
|
||||
$unit = $request->getParam('unit');
|
||||
$annee = substr($parution,0,4);
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/persist/bodacc/'.$type.'/'.$annee.'/'.
|
||||
'BODACC_'.$type.'_'.$annee.'_'.$num.'.pdf';
|
||||
$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)) {
|
||||
exec('php ' . APPLICATION_PATH . "/../scripts/jobs/getBodaccPdf.php $type $annee $num >> getBodaccPdf.log");
|
||||
$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);
|
||||
$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();
|
||||
@ -554,7 +679,7 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
|
||||
$ws = new WsScores();
|
||||
$result = $ws->getAnnoncesNum($siren);
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
$this->logger->info(print_r($result,1));
|
||||
$numWS = array();
|
||||
if (count($result->item)>0) {
|
||||
foreach ($result->item as $item) {
|
||||
|
@ -4,8 +4,18 @@ 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');
|
||||
|
||||
|
@ -54,8 +54,18 @@ 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');
|
||||
|
||||
@ -76,13 +86,13 @@ class MandataireController extends Zend_Controller_Action
|
||||
|
||||
$ws = new WsScores();
|
||||
|
||||
Zend_Registry::get('firebug')->info('idMandataire : '.$idMandataire);
|
||||
$this->logger->info('idMandataire : '.$idMandataire);
|
||||
|
||||
//Mode edition
|
||||
if ($idMandataire != '') {
|
||||
$idMandataire = (int)substr($idMandataire,1);
|
||||
$reponse = $ws->getMandataire($idMandataire);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
if ($reponse!==false) {
|
||||
$tabMandataires = json_decode($reponse, true);
|
||||
} else {
|
||||
|
@ -3,8 +3,18 @@ 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');
|
||||
}
|
||||
|
@ -18,8 +18,18 @@ 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');
|
||||
|
||||
@ -131,7 +141,7 @@ class PiecesController extends Zend_Controller_Action
|
||||
//Affichage des actes disponible
|
||||
$ws = new WsScores();
|
||||
$responses = $ws->getPiecesActes($siren);
|
||||
Zend_Registry::get('firebug')->info($responses);
|
||||
$this->logger->info(print_r($responses,1));
|
||||
|
||||
/*
|
||||
* Construire la réponse pour affichage
|
||||
@ -489,7 +499,7 @@ 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 . '/temp/files/' . $file)) {
|
||||
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));
|
||||
} else {
|
||||
@ -499,7 +509,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) {
|
||||
Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage());
|
||||
$this->logger->info('HTTP Exception : '.$e->getMessage());
|
||||
$this->view->assign('msg', "Erreur lors du téléchargement du fichier.");
|
||||
}
|
||||
}
|
||||
@ -617,7 +627,7 @@ 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 . '/temp/files/' . $file)) {
|
||||
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));
|
||||
} else {
|
||||
@ -627,7 +637,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) {
|
||||
Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage());
|
||||
$this->logger->info('HTTP Exception : '.$e->getMessage());
|
||||
$this->view->assign('msg', "Erreur lors du téléchargement du fichier.");
|
||||
}
|
||||
}
|
||||
@ -826,10 +836,10 @@ class PiecesController extends Zend_Controller_Action
|
||||
$params->companyId = $siren;
|
||||
$result = $ws->getAssoActes($params);
|
||||
$actes = array();
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
$this->logger->info(print_r($result,1));
|
||||
if (count($result->item) > 0) {
|
||||
foreach ($result->item as $item) {
|
||||
Zend_Registry::get('firebug')->info($item);
|
||||
$this->logger->info(print_r($item,1));
|
||||
if ( $user->checkPerm('actes') ) {
|
||||
$href = $this->view->url(array('controller'=>'pieces', 'action'=>'associationacte',
|
||||
'siren'=>$siren, 'date'=> $item->Date), 'default', true);
|
||||
@ -888,7 +898,7 @@ 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 . '/temp/files/' . $file)) {
|
||||
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));
|
||||
} else {
|
||||
@ -898,7 +908,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) {
|
||||
Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage());
|
||||
$this->logger->info('HTTP Exception : '.$e->getMessage());
|
||||
$this->view->assign('msg', "Erreur lors du téléchargement du fichier.");
|
||||
}
|
||||
|
||||
@ -926,7 +936,7 @@ class PiecesController extends Zend_Controller_Action
|
||||
$ws = new WsScores();
|
||||
$reponse = $ws->getPiecesBilans($siren);
|
||||
$listBilans = $reponse->result->item;
|
||||
Zend_Registry::get('firebug')->info($listBilans);
|
||||
$this->logger->info(print_r($listBilans,1));
|
||||
|
||||
$decision = '';
|
||||
foreach ( $listBilans as $item) {
|
||||
@ -997,7 +1007,7 @@ 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 . '/temp/files/' . $file)) {
|
||||
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));
|
||||
} else {
|
||||
@ -1007,7 +1017,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) {
|
||||
Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage());
|
||||
$this->logger->info('HTTP Exception : '.$e->getMessage());
|
||||
$this->view->assign('msg', "Erreur lors du téléchargement du fichier.");
|
||||
}
|
||||
|
||||
@ -1044,7 +1054,7 @@ class PiecesController extends Zend_Controller_Action
|
||||
case 'T':
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared. '/temp/files/';
|
||||
$path = $c->profil->path->shared. '/files/';
|
||||
|
||||
//Le fichier est déjà présent sur le serveur
|
||||
if ( file_exists($path.'kbis-'.$siren.'.pdf')
|
||||
|
@ -3,8 +3,18 @@ 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');
|
||||
}
|
||||
@ -130,7 +140,7 @@ class PrintController extends Zend_Controller_Action
|
||||
$fichier = str_replace('.pdf', '', $fichier);
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/temp/pages/'.$fichier.'.html';
|
||||
$file = $c->profil->path->shared.'/pages/'.$fichier.'.html';
|
||||
if (!file_exists($file))
|
||||
{
|
||||
echo 'Fichier introuvable';
|
||||
@ -209,7 +219,7 @@ class PrintController extends Zend_Controller_Action
|
||||
}
|
||||
$this->view->assign('controller', $elements['controller']);
|
||||
$this->view->assign('action', $elements['action']);
|
||||
Zend_Registry::get('firebug')->info($elements['params']);
|
||||
$this->logger->info(print_r($elements['params'],1));
|
||||
$this->view->assign('params', $elements['params']);
|
||||
}
|
||||
|
||||
@ -229,7 +239,7 @@ class PrintController extends Zend_Controller_Action
|
||||
}
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/temp/files/'.$fichier;
|
||||
$file = $c->profil->path->shared.'/files/'.$fichier;
|
||||
if (!file_exists($file)){
|
||||
echo "Erreur lors de la génération du fichier.";
|
||||
exit;
|
||||
|
@ -3,8 +3,18 @@ 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');
|
||||
|
||||
@ -286,7 +296,7 @@ class RechercheController extends Zend_Controller_Action
|
||||
$request = $this->getRequest();
|
||||
if ($request->isPost() && $form->isValid($request->getParams())) {
|
||||
|
||||
Zend_Registry::get('firebug')->info($form->getValues());
|
||||
$this->logger->info(print_r($form->getValues(),1));
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared.'/persist/log';
|
||||
@ -399,7 +409,7 @@ class RechercheController extends Zend_Controller_Action
|
||||
|
||||
//Giant
|
||||
if( !empty($params['pays']) && $type == 'ent' ){
|
||||
Zend_Registry::get('firebug')->info('RECHERCHE GIANT');
|
||||
$this->logger->info('RECHERCHE GIANT');
|
||||
$this->_forward('search', 'giant', null, $params);
|
||||
//Worldcheck
|
||||
} elseif ($type == 'wcheck' ) {
|
||||
@ -796,6 +806,8 @@ 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;
|
||||
@ -917,7 +929,7 @@ class RechercheController extends Zend_Controller_Action
|
||||
$sql->where("LOWER(libelle) ".$where);
|
||||
}
|
||||
}
|
||||
Zend_Registry::get('firebug')->info($where);
|
||||
$this->logger->info($where);
|
||||
|
||||
$rows = $table->fetchAll($sql);
|
||||
if ( count($rows)>0 ) {
|
||||
@ -1196,7 +1208,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 . '/temp/files/'.$user->getIdClient().'-'.$user->getLogin().'-'.date('YmdHis').'.csv';
|
||||
$file = $c->profil->path->shared . '/files/'.$user->getIdClient().'-'.$user->getLogin().'-'.date('YmdHis').'.csv';
|
||||
|
||||
$export = new Scores_Export_ArrayCsv($etabs, 'rechercheEntreprise');
|
||||
$export->writeFile($file);
|
||||
|
@ -230,10 +230,6 @@ class SaisieController extends Zend_Controller_Action
|
||||
* Genre
|
||||
* @var array
|
||||
*/
|
||||
/**
|
||||
* civilité en dur
|
||||
* @todo verifier si liste à jour civilité
|
||||
*/
|
||||
protected $selectGenre = array(
|
||||
'' => '-',
|
||||
'M.' => 'M',
|
||||
@ -242,8 +238,18 @@ class SaisieController extends Zend_Controller_Action
|
||||
'Societe' => 'STE'
|
||||
);
|
||||
|
||||
/**
|
||||
* 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');
|
||||
|
||||
@ -550,7 +556,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
$ws = new WsScores();
|
||||
$reponse = $ws->getListeEtablissements($siren, -1, 0, 100);
|
||||
$listeEtablissements = $reponse->result->item;
|
||||
//Zend_Registry::get('firebug')->info(count($listeEtablissements));
|
||||
//$this->logger->info(count($listeEtablissements));
|
||||
$this->view->assign('ListeEtablissements', $listeEtablissements);
|
||||
//Assign constantes
|
||||
$this->view->assign('selectDir', $selectDir);
|
||||
@ -728,37 +734,33 @@ class SaisieController extends Zend_Controller_Action
|
||||
if ($sourceNum === false) {
|
||||
echo "Source inconnu"; exit;
|
||||
}
|
||||
$ws = new WsScores();
|
||||
$reponse = $ws->dupliqueAnnonce($sourceNum, $idan, $siretIn, $siretOut);
|
||||
$error = $reponse->error;
|
||||
if ( isset($error) && $error->errnum == 0 ){
|
||||
$output = 'Annonce '.$idan.' dupliqué sur '.$siretOut.'!';
|
||||
} elseif ( isset($error) && $error->errnum != 0 ) {
|
||||
$output = 'Erreur lors de la duplication.';
|
||||
} else {
|
||||
$output = "Une erreur est survenue...";
|
||||
|
||||
$ws = new Scores_Ws_Client('saisie', '0.2');
|
||||
$params = new stdClass();
|
||||
$params->source = $sourceNum;
|
||||
$params->idAnn = $idan;
|
||||
$params->siretIn = $siretIn;
|
||||
$params->siretOut = $siretOut;
|
||||
try {
|
||||
$infos = $ws->dupliqueAnnonce($params);
|
||||
} catch(SoapFault $e) {
|
||||
echo $e->getMessage;
|
||||
}
|
||||
if ($infos === false) {
|
||||
echo "Erreur.";
|
||||
} else {
|
||||
echo "Annonce dupliqué.";
|
||||
}
|
||||
echo $output;
|
||||
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
|
||||
//@todo : sauvegarder
|
||||
|
||||
$siret = $request->getParam('siret');
|
||||
$idan = $request->getParam('idan');
|
||||
|
||||
print_r($request->getParams());
|
||||
|
||||
|
||||
|
||||
/*
|
||||
echo saisie_save($siret, '', $tabInfo);
|
||||
echo '<br/>';
|
||||
|
||||
*/
|
||||
|
||||
break;
|
||||
|
||||
case 'even':
|
||||
@ -923,6 +925,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
|
||||
if ( !empty($selection) ) {
|
||||
list($date, $type) = explode(':', $selection);
|
||||
|
||||
// --- Correction d'un bilan
|
||||
if ($date!='NEW') {
|
||||
$milDate = $milDatePre = null;
|
||||
@ -943,7 +946,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
|
||||
// --- Selection des valeurs du bilan en cours
|
||||
if ( null !== $milDate ) {
|
||||
Zend_Registry::get('firebug')->info('milDate');
|
||||
$this->logger->info('milDate');
|
||||
$response = $ws->getBilan($siren, $milDate, $type, true);
|
||||
$infos = new stdClass();
|
||||
$infos->siren = $response->siren;
|
||||
@ -952,6 +955,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
$infos->dureeMois = $response->DUREE_MOIS;
|
||||
$infos->dureeMoisPre = $response->DUREE_MOIS_PRE;
|
||||
$infos->unite = empty($response->MONNAIE_LIV_UNITE) ? 'U' : $response->MONNAIE_LIV_UNITE;
|
||||
|
||||
$postes = array();
|
||||
foreach ($response->POSTES->item as $item) {
|
||||
$postes[$item->id] = $item->val;
|
||||
@ -959,14 +963,15 @@ class SaisieController extends Zend_Controller_Action
|
||||
}
|
||||
// --- Selection des valeurs du bilan précédent pour remplir la colonne N-1
|
||||
elseif ( null === $milDate && null !== $milDatePre ) {
|
||||
Zend_Registry::get('firebug')->info('milDatePre');
|
||||
$this->logger->info('milDatePre');
|
||||
$response = $ws->getBilan($siren, $milDatePre, $type, true);
|
||||
Zend_Registry::get('firebug')->info($response);
|
||||
$this->logger->info($response);
|
||||
$infos = new stdClass();
|
||||
$infos->siren = $response->siren;
|
||||
$infos->dateCloturePre = $response->DATE_CLOTURE;
|
||||
$infos->dureeMoisPre = $response->DUREE_MOIS;
|
||||
$infos->unite = empty($response->MONNAIE_LIV_UNITE) ? 'U' : $response->MONNAIE_LIV_UNITE;
|
||||
|
||||
$postesN1 = array();
|
||||
foreach ($response->POSTES->item as $item) {
|
||||
$postesN1[$item->id] = $item->val;
|
||||
@ -1356,13 +1361,13 @@ class SaisieController extends Zend_Controller_Action
|
||||
$params['step']
|
||||
);
|
||||
|
||||
Zend_Registry::get('firebug')->info($response);
|
||||
$this->logger->info(print_r($response,1));
|
||||
|
||||
if (is_int($response)) {
|
||||
$this->view->assign('result', array('status'=>'OK'));
|
||||
} else {
|
||||
if ( preg_match_all('/([A-Z0-9]{2,});?/', $response, $postes) ) {
|
||||
Zend_Registry::get('firebug')->info($postes[1]);
|
||||
$this->logger->info($postes[1]);
|
||||
$this->view->assign('result', array(
|
||||
'status'=>'ERR',
|
||||
'message'=>'Erreur valeur',
|
||||
@ -1394,7 +1399,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
|
||||
$ws = new WsScores();
|
||||
|
||||
Zend_Registry::get('firebug')->info('createfiche:'.$createFiche);
|
||||
$this->logger->info('createfiche:'.$createFiche);
|
||||
|
||||
$id2 = null;
|
||||
|
||||
@ -1436,16 +1441,16 @@ class SaisieController extends Zend_Controller_Action
|
||||
);
|
||||
$id2 = $ws->setLienRef(json_encode($infos));
|
||||
if (is_int($id2)) {
|
||||
Zend_Registry::get('firebug')->info('id2:'.$id2);
|
||||
$this->logger->info('id2:'.$id2);
|
||||
$this->view->assign('id2', $id2);
|
||||
$this->view->assign('id2Nom', $result->Nom);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $lienRef !== null ) {
|
||||
Zend_Registry::get('firebug')->info('lienRef:'.$lienRef);
|
||||
$this->logger->info('lienRef:'.$lienRef);
|
||||
$result = $ws->getLienRef($lienRef);
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
$this->logger->info(print_r($result,1));
|
||||
$rs = $result->raisonSociale;
|
||||
//Override session session
|
||||
if ( intval($result->siren) != 0 ) {
|
||||
@ -1482,7 +1487,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
$result = $ws->getSaisieLien($idLien);
|
||||
$infos = json_decode($result, true);
|
||||
|
||||
Zend_Registry::get('firebug')->info($infos);
|
||||
$this->logger->info(print_r($infos,1));
|
||||
|
||||
if ($type=='actionnaire') {
|
||||
$this->view->assign('id1', $infos['idPar']);
|
||||
@ -1523,7 +1528,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
$result = $ws->getSaisieLien($idLien);
|
||||
$infos = json_decode($result, true);
|
||||
|
||||
Zend_Registry::get('firebug')->info($infos);
|
||||
$this->logger->info(print_r($infos,1));
|
||||
|
||||
if ($type=='actionnaire') {
|
||||
$this->view->assign('id1', $infos['idPar']);
|
||||
@ -1594,7 +1599,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
'idLoc3Num' => '',
|
||||
);
|
||||
$idNewLien = $ws->setLienRef(json_encode($infos));
|
||||
Zend_Registry::get('firebug')->info('idNewLien:'.$idNewLien);
|
||||
$this->logger->info('idNewLien:'.$idNewLien);
|
||||
if ( is_int($idNewLien) ) {
|
||||
$this->view->assign('id1', $idNewLien);
|
||||
}
|
||||
@ -1625,7 +1630,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
|
||||
$ws = new WsScores();
|
||||
$result = $ws->searchLienRef($query, $type);
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
$this->logger->info(print_r($result,1));
|
||||
$output = array();
|
||||
if (count($result->item)>0) {
|
||||
foreach ($result->item as $item) {
|
||||
@ -1648,7 +1653,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
$mode = $request->getParam('mode', null);
|
||||
$this->view->assign('mode', $mode);
|
||||
|
||||
Zend_Registry::get('firebug')->info($mode);
|
||||
$this->logger->info($mode);
|
||||
|
||||
if ($mode === null) {
|
||||
$this->_helper->layout()->disableLayout();
|
||||
@ -1803,7 +1808,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
'bilEE' => $params['bilEE'],
|
||||
);
|
||||
|
||||
Zend_Registry::get('firebug')->info($params);
|
||||
$this->logger->info(print_r($params,1));
|
||||
|
||||
$ws = new WsScores();
|
||||
$idNewLien = $ws->setLienRef(json_encode($infos), $params['idLien']);
|
||||
@ -1878,7 +1883,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
}
|
||||
}
|
||||
}
|
||||
Zend_Registry::get('firebug')->info($infos);
|
||||
$this->logger->info(print_r($infos,1));
|
||||
|
||||
$idNewLien = $ws->setLien(json_encode($infos), $params['idLien']);
|
||||
|
||||
@ -2141,7 +2146,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
$ws = new WsScores();
|
||||
$result = $ws->getIdentite($siren);
|
||||
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
$this->logger->info(print_r($result,1));
|
||||
|
||||
$this->view->assign('nom',$result->Nom);
|
||||
$this->view->assign('sigle',$result->sigle);
|
||||
@ -2212,8 +2217,8 @@ class SaisieController extends Zend_Controller_Action
|
||||
|
||||
$items = json_decode($result, true);
|
||||
if ( $items!==null ) {
|
||||
Zend_Registry::get('firebug')->info('getSaisieLienRef id='.$id);
|
||||
Zend_Registry::get('firebug')->info($items);
|
||||
$this->logger->info('getSaisieLienRef id='.$id);
|
||||
$this->logger->info(print_r($items,1));
|
||||
|
||||
//Get country code
|
||||
if ($items->adresse_pays!='FRA') {
|
||||
@ -2221,8 +2226,6 @@ class SaisieController extends Zend_Controller_Action
|
||||
$this->view->assign('identifiant', $result->item);
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info($items);
|
||||
|
||||
if (count($items)>0) {
|
||||
foreach( $items as $key => $val ) {
|
||||
switch ($key) {
|
||||
@ -2346,7 +2349,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
$result = $ws->setLienRef(json_encode($infos), $id);
|
||||
$message = ($result == 1)?'Fiche supprimée':'Erreur de suppression';
|
||||
}
|
||||
Zend_Registry::get('firebug')->info($checkLiens->participations->item);
|
||||
$this->logger->info($checkLiens->participations->item);
|
||||
$this->view->assign('message', $message);
|
||||
}
|
||||
} else {
|
||||
@ -2713,7 +2716,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
$ws = new WsScores();
|
||||
$result = $ws->getSaisieContactEt($id);
|
||||
$data = json_decode($result, true);
|
||||
Zend_Registry::get('firebug')->info($data);
|
||||
$this->logger->info(print_r($data,1));
|
||||
$this->view->assign('id', $data['id']);
|
||||
$this->view->assign('siret', str_pad($data['siren'],9,'0',STR_PAD_LEFT).str_pad($data['nic'],5,'0',STR_PAD_LEFT));
|
||||
$this->view->assign('type', $data['typeTel']);
|
||||
@ -2870,7 +2873,7 @@ class SaisieController extends Zend_Controller_Action
|
||||
if ( $request->isXmlHttpRequest() ) {
|
||||
$this->_helper->layout()->disableLayout();
|
||||
}
|
||||
Zend_Registry::get('firebug')->info($request->getParams());
|
||||
$this->logger->info(print_r($request->getParams(),1));
|
||||
$mode = $request->getParam('mode');
|
||||
|
||||
// --- Diplay form to re-validate geocode
|
||||
@ -2907,15 +2910,21 @@ class SaisieController extends Zend_Controller_Action
|
||||
$mode = $request->getParam('mode');
|
||||
$guichetMod = $request->getParam('guichetMod');
|
||||
$banqueMod = $request->getParam('banqueMod');
|
||||
|
||||
$ws = new WsScores();
|
||||
$result = $ws->getIdentite($siren);
|
||||
$infos = $ws->getBanques($siren);
|
||||
|
||||
$this->view->assign('actif',$result->Actif);
|
||||
$result='';
|
||||
if($mode!='add'){
|
||||
$params= new stdClass();
|
||||
$values=array(
|
||||
'siren' => str_replace(' ', '',$request->getParam('siren')),
|
||||
'codeBanque' => $banqueMod,
|
||||
'codeGuichet' => $guichetMod,
|
||||
);
|
||||
$params->infos=json_encode($values);
|
||||
$ws = new Scores_Ws_Client('saisie', '0.2');
|
||||
$result = $ws->getRib($params);
|
||||
}
|
||||
$this->view->assign('siren', $siren);
|
||||
$this->view->assign('mode', $mode);
|
||||
$this->view->assign('banques', $infos->result->item);
|
||||
$this->view->assign('banques', $result);
|
||||
|
||||
$this->view->assign('guichetMod', $guichetMod);
|
||||
$this->view->assign('banqueMod', $banqueMod);
|
||||
@ -2926,20 +2935,56 @@ class SaisieController extends Zend_Controller_Action
|
||||
public function ribansaveAction(){
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$request = $this->getRequest();
|
||||
$codeBanque = str_replace(' ', '',$request->getParam('code_banque'));
|
||||
$codeGuichet = str_replace(' ', '',$request->getParam('code_guichet'));
|
||||
$numCompte = str_replace(' ', '',$request->getParam('num_compte'));
|
||||
$bicSwift = str_replace(' ', '',$request->getParam('bic_swift'));
|
||||
$iban = str_replace(' ', '',$request->getParam('iban'));
|
||||
$mode = $request->getParam('mode');
|
||||
$params= new stdClass();
|
||||
$values=array(
|
||||
'siren' => str_replace(' ', '',$request->getParam('siren')),
|
||||
'codeBanque' => str_replace(' ', '',$request->getParam('code_banque')),
|
||||
'codeGuichet' => str_replace(' ', '',$request->getParam('code_guichet')),
|
||||
'numCompte' => str_replace(' ', '',$request->getParam('num_compte')),
|
||||
'bic' => str_replace(' ', '',$request->getParam('bic_swift')),
|
||||
'iban' => str_replace(' ', '',$request->getParam('iban')),
|
||||
'mode' => $request->getParam('mode'),
|
||||
);
|
||||
$params->infos=json_encode($values);
|
||||
|
||||
$ws = new Scores_Ws_Client('saisie', '0.2');
|
||||
$result = $ws->setRib($params);
|
||||
if($result){
|
||||
echo 'Opération enregistrée';
|
||||
}else {
|
||||
echo 'Opération échouée ';
|
||||
}
|
||||
die;
|
||||
}
|
||||
|
||||
$this->view->assign('code_banque', $guichetMod);
|
||||
$this->view->assign('code_guichet', $codeGuichet);
|
||||
$this->view->assign('num_compte', $numCompte);
|
||||
$this->view->assign('bic_swift', $bicSwift);
|
||||
$this->view->assign('iban', $iban);
|
||||
public function testwsAction(){
|
||||
$c = Zend_Registry::get('config');
|
||||
$wsdl = 'http://webservice.sd.dev/saisie/v0.2?wsdl-auto';
|
||||
$options = array( '0.2' => array(
|
||||
'setRib' => array(
|
||||
'debug' => true,
|
||||
'log' => 'mail',
|
||||
),
|
||||
),
|
||||
);
|
||||
$options['features'] = SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS;
|
||||
$options['compression'] = SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE;
|
||||
$options['login'] = 'cdelbos';
|
||||
$options['password'] = 'coucou';
|
||||
if (APPLICATION_ENV == 'development'){
|
||||
$options['cache_wsdl'] = WSDL_CACHE_NONE;
|
||||
}
|
||||
$options['trace'] = true;
|
||||
$options['encoding'] = 'utf-8';
|
||||
$client = false;
|
||||
$client = new SoapClient($wsdl, $options);
|
||||
$params = new stdClass();
|
||||
$params->infos=json_encode(array('siren' => '809613144','mode' => 'add', 'codeBanque' => '20041'));
|
||||
$reponse = $client->setRib($params);
|
||||
var_dump($reponse);die;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -35,8 +35,18 @@ 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');
|
||||
|
||||
@ -108,6 +118,7 @@ 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', '');
|
||||
@ -126,6 +137,8 @@ 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');
|
||||
}
|
||||
@ -239,7 +252,7 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
$filtre->detail = false;
|
||||
|
||||
$infos = $ws->getSurveillances($filtre);
|
||||
Zend_Registry::get('firebug')->info($infos);
|
||||
$this->logger->info(print_r($infos,1));
|
||||
|
||||
if (property_exists($infos->result, 'item') && count($infos->result->item)>0) {
|
||||
$titre = 'Ajouter une surveillance';
|
||||
@ -370,7 +383,7 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
$ws = new WsScores();
|
||||
$infos = $ws->getSurveillances($filtre, $position, $nbAffichage);
|
||||
|
||||
$surveillances = $infos->result->item;
|
||||
$surveillances = isset($infos->result->item)?$infos->result->item:null;
|
||||
|
||||
$listTrier = array();
|
||||
if ( count($surveillances)>0 ) {
|
||||
@ -412,10 +425,12 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
}
|
||||
} 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('PagePrev', isset($pagePrev)?$pagePrev:1);
|
||||
$this->view->assign('PageNext', isset($pageNext)?$pageNext:1);
|
||||
$this->view->assign('PageCurrent', $pageCurrent);
|
||||
|
||||
$this->view->assign('nbReponses', empty($nbReponses) ? 0 : $nbReponses);
|
||||
@ -631,6 +646,8 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
@ -699,7 +716,7 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
$getCSV = $request->getParam('get', '');
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared.'/temp/files';
|
||||
$path = $c->profil->path->shared.'/files';
|
||||
|
||||
// --- Lister les fichiers
|
||||
if (empty($nomFic)) {
|
||||
@ -971,7 +988,7 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
}
|
||||
}
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared.'/temp/files';
|
||||
$path = $c->profil->path->shared.'/files';
|
||||
|
||||
//Récupération du fichier
|
||||
$file = $path.'/'.$nomFic;
|
||||
@ -1138,9 +1155,60 @@ 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";
|
||||
}
|
||||
}
|
@ -13,13 +13,23 @@ 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->viewRenderer->setNoRender(true);
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$this->path = $c->profil->path->shared.'/temp/files';
|
||||
$this->path = $c->profil->path->shared.'/files';
|
||||
|
||||
require_once 'Scores/WsScores.php';
|
||||
}
|
||||
@ -258,7 +268,7 @@ class TelechargementController extends Zend_Controller_Action
|
||||
$authinfo = '/login/'.$identity->username.'/hach/'.$identity->password;
|
||||
$url = $host.$authinfo.'/q/'.$q;
|
||||
|
||||
Zend_Registry::get('firebug')->info($url);
|
||||
$this->logger->info($url);
|
||||
|
||||
$file = $this->getFile($url, uniqid('histo-').'.pdf');
|
||||
|
||||
@ -301,9 +311,9 @@ class TelechargementController extends Zend_Controller_Action
|
||||
|
||||
//Téléchargement
|
||||
if( $url !== false) {
|
||||
Zend_Registry::get('firebug')->info($url);
|
||||
$this->logger->info($url);
|
||||
$file = $this->getFile($url);
|
||||
Zend_Registry::get('firebug')->info('File:'.$this->path.'/'.$file);
|
||||
$this->logger->info('File:'.$this->path.'/'.$file);
|
||||
// --- En attente
|
||||
if ( $file === null ) {
|
||||
echo '';
|
||||
|
@ -28,8 +28,18 @@ 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');
|
||||
|
||||
@ -91,10 +101,10 @@ class UserController extends Zend_Controller_Action
|
||||
$options['profil'] = 'Utilisateur';
|
||||
}
|
||||
$ws = new WsScores();
|
||||
Zend_Registry::get('firebug')->info('setInfosLogin');
|
||||
Zend_Registry::get('firebug')->info($options);
|
||||
$this->logger->info('setInfosLogin');
|
||||
$this->logger->info(print_r($options,1));
|
||||
$reponse = $ws->setInfosLogin($login, $action, $options);
|
||||
Zend_Registry::get('firebug')->info($response);
|
||||
$this->logger->info(print_r($response,1));
|
||||
|
||||
$isProfilUpdated = true;
|
||||
$message = 'Erreur lors de la mise à jour du compte !';
|
||||
@ -477,7 +487,7 @@ class UserController extends Zend_Controller_Action
|
||||
//Auth error
|
||||
else {
|
||||
$this->view->message = '';
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
$this->logger->info(print_r($result));
|
||||
foreach ($result->getMessages() as $message) {
|
||||
$this->view->message.= $message."<br/>";
|
||||
}
|
||||
@ -486,7 +496,7 @@ class UserController extends Zend_Controller_Action
|
||||
}
|
||||
// Pas de validation du formulaire
|
||||
else {
|
||||
Zend_Registry::get('firebug')->info('DISPLAY');
|
||||
$this->logger->info('DISPLAY');
|
||||
}
|
||||
}
|
||||
|
||||
@ -731,7 +741,7 @@ class UserController extends Zend_Controller_Action
|
||||
$mail = new Scores_Mail_Method();
|
||||
$mail->setSubject("Demande d'envoi des identifiants");
|
||||
$mail->setBodyHtmlC($mailbody);
|
||||
$mail->setFromKey('support');
|
||||
$mail->setFromKey('supportdev');
|
||||
$mail->addToKey('support');
|
||||
$mail->setReplyTo($params['email']);
|
||||
try {
|
||||
|
@ -4,8 +4,18 @@ 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');
|
||||
|
||||
|
@ -33,51 +33,49 @@ $('select[name=type]').change(function(e){
|
||||
|
||||
<div class="paragraph">
|
||||
<p>
|
||||
<?php switch ( $this->typeTxt ) {?>
|
||||
<?php case 'indiScore20':?>
|
||||
<?php if ($this->typeTxt == 'indiScore20') {?>
|
||||
L'indiscore évalue le risque de faillite d'entreprise à 12 mois à partir de trois axes: le respect,
|
||||
l'analyse historique des représentants légaux et l'analyse du bilan. Les informations sur l’environnement économique
|
||||
des entreprises (secteurs d'activité, groupe, paiements) complètent l'analyse de l'indiscore. Un indiscore entre 0 et
|
||||
6/20 indiquera un risque élevé, entre 7 et 10/20 un risque moyen et un indiscore compris entre 11 et 20/20
|
||||
un risque faible. Un avis de crédit fournisseur/client est donné, jusqu'à concurrence de 500 K€.
|
||||
<?php break; ?>
|
||||
<?php case 'indiScore':?>
|
||||
<?php } ?>
|
||||
<?php if ($this->typeTxt == 'indiScore') {?>
|
||||
L'indiscore évalue le risque de faillite d'entreprise à 12 mois à partir de trois axes: le respect,
|
||||
l'analyse historique des représentants légaux et l'analyse du bilan. Les informations sur l’environnement économique
|
||||
des entreprises (secteurs d'activité, groupe, paiements) complètent l'analyse de l'indiscore. Un indiscore entre 0 et
|
||||
40/100 indiquera un risque élevé, entre 41 et 50/100 un risque moyen et un indiscore compris entre 51 et 100/100
|
||||
un risque faible. Un avis de crédit fournisseur/client est donné, jusqu'à concurrence de 500 K€.
|
||||
<?php break; ?>
|
||||
<?php case 'scoreDir':?>
|
||||
<?php } ?>
|
||||
<?php if ($this->typeTxt == 'scoreDir') {?>
|
||||
Évaluation de l'équipe dirigeante en place. Système S&D
|
||||
<?php break; ?>
|
||||
<?php case 'scoreConf':?>
|
||||
<?php } ?>
|
||||
<?php if ($this->typeTxt == 'scoreConf') {?>
|
||||
Évaluation de l'adéquation entre les déclarations et l'information disponible auprès des sources officielles françaises. Système S&D
|
||||
<?php break; ?>
|
||||
<?php case 'scoreZ':?>
|
||||
<?php } ?>
|
||||
<?php if ($this->typeTxt == 'scoreZ') {?>
|
||||
Le score Z de la Banque de France permet de déceler les défaillances d’entreprises. Ces dernières sont caractérisées
|
||||
par 19 ratios retraçant quatre aspects de leur comportement : structure financière, dynamisme, rentabilité, gestion courante.
|
||||
<?php break; ?>
|
||||
<?php case 'scoreCH':?>
|
||||
<?php } ?>
|
||||
<?php if ($this->typeTxt == 'scoreCH') {?>
|
||||
Le score CONAN et HOLDER (1979) est une méthode conseillée pour les entreprises industrielles réalisant un chiffre
|
||||
d'affaires de 1,5 à 75 millions d’euros. Il permet un classement des sociétés des plus risquées (score inférieur à
|
||||
6,8) aux plus saines (score supérieur à 16,4).
|
||||
<?php break; ?>
|
||||
<?php case 'scoreAfdcc1':?>
|
||||
<?php } ?>
|
||||
<?php if ($this->typeTxt == 'scoreAfdcc1') {?>
|
||||
1er indicateur synthétique de vulnérabilité établi par l'Association Françaises des Crédits managers et Conseils.
|
||||
<?php break; ?>
|
||||
<?php case 'scoreAfdcc2':?>
|
||||
<?php } ?>
|
||||
<?php if ($this->typeTxt == 'scoreAfdcc2') {?>
|
||||
Le score sectoriel AFDCC2 (1999) s’applique aux sociétés réalisant un chiffre d’affaires de 150.000 à 75 millions
|
||||
d'euros. Il comprend 11 fonctions pour 7 secteurs d'activité en différenciant les TPE des PME. Il s'adresse plus
|
||||
spécialement au Credit Manager, étant axé sur la solvabilité de l'entreprise à court terme.
|
||||
<?php break; ?>
|
||||
<?php case 'scoreAltman':?>
|
||||
<?php } ?>
|
||||
<?php if ($this->typeTxt == 'scoreAltman') {?>
|
||||
Évaluation synthétique permettant la prévision de défaillance d'une entreprise à partir de ratios, liquidité,
|
||||
solvablilité, rentabilité, activité, croissance. Appelé aussi Z Score d'Altman.
|
||||
<?php break; ?>
|
||||
<?php case 'scoreCCF':?>
|
||||
<?php } ?>
|
||||
<?php if ($this->typeTxt == 'scoreCCF') {?>
|
||||
Évaluation à 3 ans de la probabilité de défaillance d'une entreprise.
|
||||
<?php break; ?>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</div>
|
||||
|
@ -22,8 +22,7 @@
|
||||
<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 }?>
|
||||
|
||||
|
||||
|
||||
@ -43,7 +42,7 @@
|
||||
<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,'siret'=>$this->siret), null, true)?>"><img src="/themes/default/images/interfaces/supprimer.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>
|
||||
|
@ -40,6 +40,15 @@
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
<?php if (0 < $this->exportObjet->TOP_CONFIDENTIEL) : ?>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td colspan="2">
|
||||
<span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
|
||||
Ce bilan est confidentiel.
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
<?php if ( $this->champType == 'S' ) {?>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
@ -51,6 +60,19 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php if ($this->msg) {?>
|
||||
|
||||
<div class="paragraph">
|
||||
|
||||
<div style="padding:0.7em;" class="ui-state-highlight ui-corner-all">
|
||||
<p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-info"></span>
|
||||
<?=$this->msg?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php } else {?>
|
||||
<?php
|
||||
switch ($this->champType) {
|
||||
case 'N' : $name = 'Réel Normal'; break;
|
||||
@ -132,5 +154,7 @@ Valeurs exprimées en
|
||||
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php echo $this->render('cgu.phtml', $this->cgu);?>
|
||||
</div>
|
@ -92,9 +92,14 @@ switch ($type) {
|
||||
$date = new Zend_Date($element->dateExercicePre, 'yyyyMMdd');
|
||||
echo $date->toString('dd/MM/yyyy');
|
||||
} ?> - <?php if ($element->dureeExercicePre > 0) {?><?=$element->dureeExercicePre?> Mois<?php } ?></td>
|
||||
<td><a href="<?=$this->url(array('controller'=>'finance','action'=>'liasse',
|
||||
<td><?php if (in_array($this->idClient, [1, 147]) || ($element->confidentielClient == $this->idClient || 0 == $element->confidentiel)) : ?>
|
||||
<a href="<?=$this->url(array('controller'=>'finance', 'action'=>'liasse',
|
||||
'siret'=>$this->siret, 'id'=>$this->id, 'date'=> $type.$element->dateExercice), 'default', true)?>">
|
||||
Visualiser</a>
|
||||
Visualiser
|
||||
</a>
|
||||
<?php else :?>
|
||||
Confidentiel
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php break;?>
|
||||
@ -150,9 +155,13 @@ switch ($type) {
|
||||
?>
|
||||
- <?php if ($element->dureeExercicePre > 0) {?><?=$element->dureeExercicePre?> Mois<?php } ?>
|
||||
</td>
|
||||
<td><a href="<?=$this->url(array('controller'=>'finance', 'action'=>'liasse', 'siret'=>$this->siret,
|
||||
<td><?php if (in_array($this->idClient, [1, 147]) || ($element->confidentielClient == $this->idClient || 0 == $element->confidentiel)) : ?>
|
||||
<a href="<?=$this->url(array('controller'=>'finance', 'action'=>'liasse', 'siret'=>$this->siret,
|
||||
'id'=>$this->id, 'date'=> $type.$element->dateExercice), 'default', true)?>">
|
||||
Visualiser</a>
|
||||
<?php else :?>
|
||||
Confidentiel
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
|
@ -1,5 +1,4 @@
|
||||
<style>.jstree-default a.jstree-search { color: red; }</style>
|
||||
|
||||
<div>Tête de groupe
|
||||
<select name="isin">
|
||||
<option value="1" <?php if($this->isin==1) { echo ' selected'; }?>>coté, détention minimum à 50%</option>
|
||||
@ -25,9 +24,8 @@ Filiales, détention minimum
|
||||
<input id="search" type="button" value="Rechercher">
|
||||
<input id="clear_search" type="button" value="Initialiser">
|
||||
</div>
|
||||
|
||||
<div id="groups" class="jstree jstree-default" style="overflow:auto;"></div>
|
||||
<script src="/libs/jstree/jstree.min.js"></script>
|
||||
<script src="/libs/jstree-3.3.3/jstree.min.js"></script>
|
||||
<script>
|
||||
$('#dialogarbo').dialog({ buttons: [
|
||||
{ text: "Imprimer", click: function() {
|
||||
@ -54,16 +52,18 @@ $('#filter').on('click', function(e){
|
||||
});
|
||||
|
||||
$("#groups").jstree({
|
||||
"core" : { "html_titles" : true },
|
||||
"plugins" : ["themes", "json_data", "search"],
|
||||
"json_data" : { "data" : [<?=$this->data?>] },
|
||||
"search" : { "show_only_matches" : true },
|
||||
"themes" : {
|
||||
"plugins" : ["search"],
|
||||
'core' : {
|
||||
'html_titles' : true ,
|
||||
'data' : <?=$this->data?>,
|
||||
'themes' : {
|
||||
"theme" : "default",
|
||||
"url" : "/libs/jstree/themes/default/style.css",
|
||||
"url" : "/libs/jstree-3.3.3/themes/default/style.min.css",
|
||||
"dots" : true,
|
||||
"icons" : false
|
||||
}
|
||||
},
|
||||
'search' : { "show_only_matches" : true },
|
||||
});
|
||||
|
||||
$('#clear_search').on('click', function() {
|
||||
|
@ -1,42 +1,5 @@
|
||||
<style>
|
||||
div#menu {display:none;}
|
||||
.jstree-default li,
|
||||
.jstree-default ins { background-image:url("/libs/jstree/themes/default/d.png"); background-repeat:no-repeat; background-color:transparent; }
|
||||
.jstree-default li { background-position:-90px 0; background-repeat:repeat-y; }
|
||||
.jstree-default li.jstree-last { background:transparent; }
|
||||
.jstree-default .jstree-open > ins { background-position:-72px 0; }
|
||||
.jstree-default .jstree-closed > ins { background-position:-54px 0; }
|
||||
.jstree-default .jstree-leaf > ins { background-position:-36px 0; }
|
||||
|
||||
.jstree-default .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; }
|
||||
.jstree-default .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; }
|
||||
.jstree-default a .jstree-icon { background-position:-56px -19px; }
|
||||
.jstree-default a.jstree-loading .jstree-icon { background:url("/libs/jstree/themes/default/throbber.gif") center center no-repeat !important; }
|
||||
|
||||
.jstree-default.jstree-focused { background:#ffffee; }
|
||||
|
||||
.jstree-default .jstree-no-dots li,
|
||||
.jstree-default .jstree-no-dots .jstree-leaf > ins { background:transparent; }
|
||||
.jstree-default .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
|
||||
.jstree-default .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
|
||||
|
||||
.jstree-default .jstree-no-icons a .jstree-icon { display:none; }
|
||||
|
||||
.jstree-default .jstree-search { font-style:italic; }
|
||||
|
||||
.jstree-default .jstree-no-icons .jstree-checkbox { display:inline-block; }
|
||||
.jstree-default .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
|
||||
.jstree-default .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
|
||||
.jstree-default .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
|
||||
.jstree-default .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
|
||||
.jstree-default .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
|
||||
.jstree-default .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
|
||||
.jstree-default .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
|
||||
|
||||
#jstree-marker.jstree-default { background:url("/libs/jstree/themes/default/d.png") -41px -57px no-repeat !important; text-indent:-100px; }
|
||||
|
||||
.jstree-default a.jstree-search { color:aqua; }
|
||||
.jstree-default .jstree-locked a { color:silver; cursor:default; }
|
||||
</style>
|
||||
<div id="center">
|
||||
<div class="paragraph">
|
||||
@ -53,34 +16,21 @@ div#menu {display:none;}
|
||||
<?php if($this->pctMin==40) {?> 40%<?php }?>
|
||||
<?php if($this->pctMin==50) {?> 50%<?php }?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/libs/jstree/jstree.min.js"></script>
|
||||
<script src="/libs/html2canvas.js"></script>
|
||||
<script src="/libs/jstree-3.3.3/jstree.min.js"></script>
|
||||
<script>
|
||||
$("#groups").jstree({
|
||||
"core" : { "html_titles" : true },
|
||||
"plugins" : ["themes", "json_data", "search"],
|
||||
"json_data" : { "data" : [<?=$this->data?>] },
|
||||
"search" : { "show_only_matches" : true },
|
||||
"themes" : {
|
||||
'core' : {
|
||||
'data' : <?=$this->data?>,
|
||||
'themes' : {
|
||||
"theme" : "default",
|
||||
"url" : "/libs/jstree/themes/default/style.css",
|
||||
"url" : "/libs/jstree-3.3.3/themes/default/style.min.css",
|
||||
"dots" : true,
|
||||
"icons" : false
|
||||
}
|
||||
});
|
||||
|
||||
$(function(){
|
||||
var target = $('#groups');
|
||||
html2canvas(target, {
|
||||
onrendered: function(canvas) {
|
||||
target.html(canvas);
|
||||
},
|
||||
});
|
||||
|
||||
}).on('loaded.jstree',function(){
|
||||
window.print(); window.close();
|
||||
});
|
||||
</script>
|
||||
|
@ -1 +0,0 @@
|
||||
<?=$this->RemplaceSiren(substr($this->annonce['Texte'],0,1000))?>
|
@ -1,3 +1,6 @@
|
||||
<?php if ($this->ajax) {?>
|
||||
<?=$this->RemplaceSiren(substr($this->annonce['Texte'],0,1000))?>
|
||||
<?php } else {?>
|
||||
<div id="center">
|
||||
<h1 class="titre">ANNONCES LÉGALES</h1>
|
||||
<div class="paragraph">
|
||||
@ -89,12 +92,9 @@ if ($this->hasModeEdition){
|
||||
foreach ( $liensEdit as $lienId => $lienItem ){
|
||||
?>
|
||||
<a class="<?=$lienItem['class']?>" title="<?=$lienItem['title']?>" href="<?=$this->url(array(
|
||||
'controller' => 'saisie',
|
||||
'action' => 'annoncedialog',
|
||||
'siret' => $this->siret,
|
||||
'op' => $lienId,
|
||||
'code' => $this->annonce['Code'],
|
||||
'idAnn' => $this->idAnn,), 'default', true)?>"><?=$lienItem['img']?></a>
|
||||
'controller'=>'saisie', 'action'=>'annoncedialog', 'siret'=>$this->siret, 'op'=>$lienId,
|
||||
'code'=>$this->annonce['Code'], 'idAnn'=>$this->idAnn,), 'default', true)?>">
|
||||
<?=$lienItem['img']?></a>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@ -105,15 +105,15 @@ if ($this->hasModeEdition){
|
||||
<p><code><?=$this->RemplaceSiren($this->annonce['Texte'])?></code></p>
|
||||
</div>
|
||||
|
||||
<?php if ($this->bodaccLink) { ?>
|
||||
<div class="paragraph" style="text-align:center;">
|
||||
<?php if ( $this->lienBodacc ) { ?>
|
||||
<span id="bodacc" style="padding-bottom:10px;border-bottom:1px solid #cccccc;">
|
||||
<a href="<?=$this->lienBodacc?>">
|
||||
<a href="<?=$this->bodaccLink?>">
|
||||
<img src="/themes/default/images/interfaces/pdf.png" alt="Bodacc au format PDF">
|
||||
Télécharger le bulletin officiel</a>
|
||||
<?=$this->bodaccLinkLabel?></a>
|
||||
</span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="paragraph">
|
||||
<?php if (count($this->annonce['Entites'])>0) {?>
|
||||
@ -137,14 +137,13 @@ Télécharger le bulletin officiel</a>
|
||||
|
||||
<div class="paragraph" style="text-align:center;">
|
||||
<?php if (intval($this->siret)!=0) {?>
|
||||
<?php
|
||||
$href = $this->url(array('controller' => 'juridique', 'action' => 'annonces',
|
||||
'siret' => $this->siret, 'id' => $this->id, 'vue' => $this->vue, 'page' => $this->PageCurrent,
|
||||
), 'default', true);
|
||||
?>
|
||||
<a href="<?=$href?>">Revenir à la liste des annonces</a>
|
||||
<a href="<?=$this->url(array('controller'=>'juridique', 'action'=>'annonces', 'siret'=>$this->siret,
|
||||
'id'=>$this->id, 'vue'=>$this->vue, 'page'=>$this->page), 'default', true)?>">
|
||||
Revenir à la liste des annonces</a>
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
<?=$this->render('cgu.phtml', $this->cgu)?>
|
||||
</div>
|
||||
|
||||
<?php }?>
|
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
$class = '';
|
||||
if ($this->deleted!='') {
|
||||
$class = ' class="deleted"';
|
||||
}
|
||||
?>
|
||||
<tr<?=$class?>>
|
||||
<td width="140" class="StyleInfoLib">
|
||||
<span id="annoncesDate">Le <?=$this->date?></span>
|
||||
</td>
|
||||
<td>
|
||||
<span id="annoncesImg">
|
||||
<?php if (!empty($this->logo)) {?>
|
||||
<img src="/themes/default/images/annonces/<?=$this->logo?>" title="<?=$this->title?>" />
|
||||
<?php }?>
|
||||
</span>
|
||||
</td>
|
||||
<td width="450" colspan="2" class="StyleInfoData">
|
||||
<a class="tiptxt" href="<?=$this->partialLoop()->view->url(array(
|
||||
'controller' => 'juridique',
|
||||
'action' => 'annonces',
|
||||
'siret' => $this->partialLoop()->view->siret,
|
||||
'id' => $this->partialLoop()->view->id,
|
||||
'idAnn' => $this->idAnn,
|
||||
'vue' => $this->type,
|
||||
))?>">
|
||||
<?=$this->lib?>
|
||||
</a>
|
||||
<span style="display:none;"><?=$this->RemplaceSiren($this->texte)?></span>
|
||||
</td>
|
||||
</tr>
|
@ -131,36 +131,10 @@ a.lienType {
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php if ($this->vue=='bodacc') {?>
|
||||
<h2>EVÉNEMENTS LÉGAUX</h2>
|
||||
<div class="paragraph">
|
||||
<?php if (count($this->annoncesBodacc) == 0) { ?>
|
||||
Néant
|
||||
<?php } else {?>
|
||||
<table class="data">
|
||||
<?=$this->partialLoop('juridique/annonces-resume.phtml', $this->annoncesBodacc)?>
|
||||
</table>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php if ($this->vue=='balo') {?>
|
||||
<h2>BALO</h2>
|
||||
<div class="paragraph">
|
||||
<?php if(count($this->annoncesBalo) == 0){ ?>
|
||||
Néant
|
||||
<?php } else {?>
|
||||
<table class="data">
|
||||
<?=$this->partialLoop('juridique/annonces-resume.phtml', $this->annoncesBalo)?>
|
||||
</table>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php if ($this->vue == 'bomp') {?>
|
||||
<div class="paragraph" style="margin:0 0 0 40px;">
|
||||
<form name="filtreBoamp" method="post" action="<?=$this->url(array('controller'=>'juridique', 'action'=>'annonces', 'vue'=>'bomp',
|
||||
'siret'=>$this->siret, 'id'=>$this->id), 'default', true)?>">
|
||||
<form name="filtreBoamp" method="post" action="<?=$this->url(array('controller'=>'juridique',
|
||||
'action'=>'annonces', 'vue'=>'bomp', 'siret'=>$this->siret, 'id'=>$this->id), 'default', true)?>">
|
||||
<label>Type d'annonce</label>
|
||||
<select name="filtre">
|
||||
<option value="A"<?=($this->filtre=='A')?' selected':'';?>>Avis d'attribution</option>
|
||||
@ -174,31 +148,50 @@ $('select[name=filtre]').on('change', function(e){
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php if ($this->vue=='bodacc') {?>
|
||||
<h2>EVÉNEMENTS LÉGAUX</h2>
|
||||
<?php } elseif ($this->vue=='balo') {?>
|
||||
<h2>BALO</h2>
|
||||
<?php } elseif ($this->vue == 'bomp') {?>
|
||||
<h2>Marchés publics</h2>
|
||||
<div class="paragraph">
|
||||
<?php if (count($this->annoncesBomp) == 0) {?>
|
||||
Néant
|
||||
<?php } else {?>
|
||||
<table class="data">
|
||||
<?=$this->partialLoop('juridique/annonces-resume.phtml', $this->annoncesBomp)?>
|
||||
</table>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php if ($this->vue=='asso') { ?>
|
||||
<?php } elseif ($this->vue=='asso') { ?>
|
||||
<h2>Associations</h2>
|
||||
<?php }?>
|
||||
<div class="paragraph">
|
||||
<?php if (count($this->annoncesAsso) == 0){ ?>
|
||||
<?php if (count($this->annonces) == 0) { ?>
|
||||
Néant
|
||||
<?php } else {?>
|
||||
<table class="data">
|
||||
<?=$this->partialLoop('juridique/annonces-resume.phtml', $this->annoncesAsso)?>
|
||||
<?php foreach ($this->annonces as $ann) {?>
|
||||
<?php
|
||||
$class = '';
|
||||
if ($ann['deleted'] != '') {
|
||||
$class = ' class="deleted"';
|
||||
}
|
||||
?>
|
||||
<tr<?=$class?>>
|
||||
<td width="140" class="StyleInfoLib"><span id="annoncesDate">Le <?=$ann['date']?></span></td>
|
||||
<td>
|
||||
<span id="annoncesImg">
|
||||
<?php if (!empty($ann['logo'])) {?>
|
||||
<img src="/themes/default/images/annonces/<?=$ann['logo']?>" title="<?=$ann['title']?>" />
|
||||
<?php }?>
|
||||
</span>
|
||||
</td>
|
||||
<td width="450" colspan="2" class="StyleInfoData">
|
||||
<a class="tiptxt" href="<?=$this->url(array('controller'=>'juridique', 'action'=>'annonce',
|
||||
'siret'=>$this->siret, 'id'=>$this->id, 'idAnn'=>$ann['idAnn'], 'vue'=>$ann['type'],
|
||||
'page'=>$this->PageCurrent), 'default', true)?>"><?=$ann['lib']?>
|
||||
</a>
|
||||
<span style="display:none;"><?=$this->RemplaceSiren($ann['texte'])?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
</table>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php if (empty($this->AutrePage)) {?>
|
||||
|
||||
|
@ -80,7 +80,8 @@
|
||||
}
|
||||
?>
|
||||
<?php if( $this->permSurvPriv ) { ?>
|
||||
<p><a href="<?=$this->url(array('controller'=>'surveillance', 'action'=>'ajouter', 'source'=>'privileges',
|
||||
<p><a class="dialogcmd" title="Mise en suivi des privilèges"
|
||||
href="<?=$this->url(array('controller'=>'surveillance', 'action'=>'ajouter', 'source'=>'privileges',
|
||||
'siret'=>$this->siret), 'default', true)?>">Commander la mise en suivi des privilèges</a>
|
||||
(surveillance des privilèges auprès du greffe, retour sous 48 à 72h)</p>
|
||||
<?php } ?>
|
||||
|
@ -20,18 +20,14 @@
|
||||
<i class="fa fa-circle fa-circle-blue fa-stack-2x"></i>
|
||||
<i class="fa fa-info fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
<a href="#" id="goidentite">
|
||||
<span class="fa-stack fa-lg" title="Accès direct à la fiche identité (Racourci clavier : Maintenir CTRL puis ENTREE)">
|
||||
<span id="goidentite" class="fa-stack fa-lg" title="Accès direct à la fiche identité (Racourci clavier : Maintenir CTRL puis ENTREE)">
|
||||
<i class="fa fa-circle fa-circle-blue fa-stack-2x"></i>
|
||||
<i class="fa fa-arrow-right fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
<a href="#" id="goindiscore">
|
||||
<span class="fa-stack fa-lg" title="Accès direct à l'IndiScore">
|
||||
<span id="goindiscore" class="fa-stack fa-lg" title="Accès direct à l'IndiScore">
|
||||
<i class="fa fa-circle fa-circle-blue fa-stack-2x"></i>
|
||||
<i class="fa fa-thermometer-full fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<?php if ($this->SEARCHENT) {?>
|
||||
<div class="row">
|
||||
|
@ -53,9 +53,9 @@ Attention à bien vérifier ce qui est fait !
|
||||
<label>Type d'événement</label><br/>
|
||||
<select name="even[]" multiple="multiple" size="10" style="width:600px;">
|
||||
<option value="">-</option>
|
||||
<?php foreach ($this->evens as $code => $lib):?>
|
||||
<?php foreach ($this->evens as $code => $lib) {?>
|
||||
<option value="<?=$code?>"><?=$lib?></option>
|
||||
<?php endforeach;?>
|
||||
<?php }?>
|
||||
</select>
|
||||
</form>
|
||||
<br/>
|
||||
@ -87,13 +87,14 @@ $('select[name="even[]"]').change(function(){
|
||||
|
||||
<script type="text/javascript" src="/libs/form/jquery.form.min.js"></script>
|
||||
<script>
|
||||
$('form#saisie').bind('submit', function(){
|
||||
var options = {
|
||||
target: '#result',
|
||||
beforeSubmit: function(data){},
|
||||
success: function(data){ $('#result').html(data); }
|
||||
};
|
||||
$(this).ajaxSubmit(options);
|
||||
$('form#saisie').submit(function(e){
|
||||
e.preventDefault();
|
||||
var form = $(this);
|
||||
$.post(form.attr('action'), form.serialize(), function(data){
|
||||
$('#result').html(data);
|
||||
}).fail(function(data) {
|
||||
$('#result').html('Une erreur est survenue !');
|
||||
});
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
|
@ -4,13 +4,19 @@ 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">
|
||||
<?php if($this->mode == add || $this->mode == edit){?>
|
||||
<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">
|
||||
@ -23,10 +29,12 @@ div#dialog fieldset legend {padding:5px; font-weight:bold; }
|
||||
<label>Situation RIB</label>
|
||||
<div class="field">
|
||||
<?php
|
||||
if ($this->actif==1){
|
||||
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>
|
||||
@ -41,12 +49,13 @@ if ($this->actif==1){
|
||||
<div class="fieldgrp">
|
||||
<label>Banque</label>
|
||||
<div class="field" >
|
||||
<select name="Banque" style="width:160px;" >
|
||||
<option value=""><?=$this->banqueMod?></option>
|
||||
<?php foreach( $this->banques as $val ) {?>
|
||||
<option value="<?=$val->codeBanque?>"><?=$val->codeBanque?></option>
|
||||
<?php }?>
|
||||
<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>
|
||||
|
||||
@ -54,20 +63,21 @@ if ($this->actif==1){
|
||||
<label>Guichet</label>
|
||||
<div class="field" >
|
||||
<select name="Guichet" style="width:160px;" >
|
||||
<option value=""><?=$this->guichetMod?></option>
|
||||
<option value=""><?=$this->banqueMod?></option>
|
||||
<?php foreach( $this->banques as $val ) {?>
|
||||
<option value="<?=$val->codeGuichet?>"><?=$val->codeGuichet?></option>
|
||||
<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=""/>
|
||||
<input type="text" name="code_guichet" size="4" value=""/>
|
||||
<input type="text" name="num_compte" size="32" value=""/>
|
||||
<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>
|
||||
@ -80,20 +90,25 @@ if ($this->actif==1){
|
||||
<div class="fieldgrp">
|
||||
<label>BIC/SWIFT</label>
|
||||
<div class="field">
|
||||
<input type="text" name="bic_swift" value="" size="20"/>
|
||||
<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="" size="47"/>
|
||||
<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 }?>
|
||||
|
||||
@ -103,11 +118,52 @@ if ($this->actif==1){
|
||||
|
||||
<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"); } }
|
||||
|
@ -28,9 +28,14 @@ if ( empty($this->source) ){
|
||||
?>
|
||||
</div>
|
||||
|
||||
<h2>Extraction des surveillances</h2>
|
||||
<h2>Traitements de masse</h2>
|
||||
<div class="paragraph">
|
||||
<?=$this->action('surveillancecsv', 'surveillance')?>
|
||||
<p class="options">Demande de surveillance en série :
|
||||
<a class="dialogsurv" href="/surveillance/surveillanceserie" title="Demande de surveillance en série ">
|
||||
OK</a></p>
|
||||
|
||||
</div>
|
||||
<h2>Options de recherche</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
@ -152,7 +157,8 @@ par
|
||||
'siret' => $item['siren'].$item['nic'],
|
||||
'ref' => urlencode($surveillance['ref']),
|
||||
'email' => $surveillance['email'],
|
||||
'source' => $surveillance['source']
|
||||
'source' => $surveillance['source'],
|
||||
'q' => $this->q,
|
||||
))?>" title="Supprimer la surveillance <?=$surveillance['source']?>">
|
||||
<img src="/themes/default/images/interfaces/supprimer.png"/>
|
||||
</a>
|
||||
@ -295,4 +301,3 @@ $(function() {
|
||||
?>
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -0,0 +1,70 @@
|
||||
<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']?>/> <?=$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>
|
@ -43,7 +43,7 @@ class File_BodaccController extends Zend_Controller_Action
|
||||
{
|
||||
$filename = $this->getRequest()->getParam('q');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/temp/files/'.$filename;
|
||||
$file = $c->profil->path->shared.'/files/'.$filename;
|
||||
$content_type = 'application/pdf';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
|
@ -11,7 +11,7 @@ class File_GreffeController extends Zend_Controller_Action
|
||||
{
|
||||
$filename = $this->getRequest()->getParam('q');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/temp/files/'.$filename;
|
||||
$file = $c->profil->path->shared.'/files/'.$filename;
|
||||
$content_type = 'application/pdf';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
@ -42,7 +42,7 @@ class File_GreffeController extends Zend_Controller_Action
|
||||
{
|
||||
$filename = $this->getRequest()->getParam('q');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/temp/files/'.$filename;
|
||||
$file = $c->profil->path->shared.'/files/'.$filename;
|
||||
$content_type = 'application/pdf';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
@ -73,7 +73,7 @@ class File_GreffeController extends Zend_Controller_Action
|
||||
{
|
||||
$filename = $this->getRequest()->getParam('q');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/temp/files/'.$filename;
|
||||
$file = $c->profil->path->shared.'/files/'.$filename;
|
||||
$content_type = 'application/pdf';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
@ -107,7 +107,7 @@ class File_GreffeController extends Zend_Controller_Action
|
||||
{
|
||||
$filename = $this->getRequest()->getParam('q');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/temp/files/'.$filename;
|
||||
$file = $c->profil->path->shared.'/files/'.$filename;
|
||||
$content_type = 'application/pdf';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
|
@ -54,7 +54,7 @@ class File_ImageController extends Zend_Controller_Action
|
||||
{
|
||||
$filename = $this->getRequest()->getParam('q');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/temp/pages/imgcache/'.$filename;
|
||||
$file = $c->profil->path->shared.'/pages/imgcache/'.$filename;
|
||||
$content_type = 'image/png';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
|
@ -50,7 +50,7 @@ class File_IndexController extends Zend_Controller_Action
|
||||
{
|
||||
$filename = $this->getRequest()->getParam('q');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/temp/files/'.$filename;
|
||||
$file = $c->profil->path->shared.'/files/'.$filename;
|
||||
$content_type = 'application/vnd.ms-excel';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
@ -84,7 +84,7 @@ class File_IndexController extends Zend_Controller_Action
|
||||
{
|
||||
$filename = $this->getRequest()->getParam('q');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/temp/files/'.$filename;
|
||||
$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) ) {
|
||||
@ -118,7 +118,7 @@ class File_IndexController extends Zend_Controller_Action
|
||||
{
|
||||
$filename = $this->getRequest()->getParam('q');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/temp/files/'.$filename;
|
||||
$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) ) {
|
||||
@ -152,7 +152,7 @@ class File_IndexController extends Zend_Controller_Action
|
||||
{
|
||||
$filename = $this->getRequest()->getParam('q');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/temp/files/'.$filename;
|
||||
$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) ) {
|
||||
@ -224,7 +224,7 @@ class File_IndexController extends Zend_Controller_Action
|
||||
{
|
||||
$filename = $this->getRequest()->getParam('q');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/temp/pages/'.$filename;
|
||||
$file = $c->profil->path->shared.'/pages/'.$filename;
|
||||
$content_type = 'application/pdf';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
|
@ -3,7 +3,12 @@
|
||||
"description": "Extranet",
|
||||
"require": {
|
||||
"zendframework/zendframework1": "^1.12",
|
||||
"phpoffice/phpexcel": "1.8.0"
|
||||
"phpoffice/phpexcel": "1.8.0",
|
||||
"spipu/html2pdf": "^4.6",
|
||||
"setasign/fpdi": "^1.6",
|
||||
"cybermonde/odtphp": "^1.7",
|
||||
"fabpot/goutte": "^3.2",
|
||||
"monolog/monolog": "^1.22"
|
||||
},
|
||||
"require-dev": {
|
||||
"ccampbell/chromephp": "^4.1"
|
||||
|
836
composer.lock
generated
836
composer.lock
generated
@ -4,9 +4,348 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "d097f8f75b1007326fd59ba9a41fac85",
|
||||
"content-hash": "ba361b8c068963e491b92815d000388b",
|
||||
"content-hash": "6c57b3ee229a68f4d482e680536a8f55",
|
||||
"packages": [
|
||||
{
|
||||
"name": "cybermonde/odtphp",
|
||||
"version": "v1.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/cybermonde/odtphp.git",
|
||||
"reference": "23aba70923ca3c07af15a5600f4072751c1b4a36"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/cybermonde/odtphp/zipball/23aba70923ca3c07af15a5600f4072751c1b4a36",
|
||||
"reference": "23aba70923ca3c07af15a5600f4072751c1b4a36",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.2.4"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"library"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"GPL"
|
||||
],
|
||||
"description": "ODT document generator",
|
||||
"homepage": "https://github.com/cybermonde/odtphp",
|
||||
"keywords": [
|
||||
"odt",
|
||||
"php"
|
||||
],
|
||||
"time": "2015-06-02T07:28:25+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fabpot/goutte",
|
||||
"version": "v3.2.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/FriendsOfPHP/Goutte.git",
|
||||
"reference": "db5c28f4a010b4161d507d5304e28a7ebf211638"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/db5c28f4a010b4161d507d5304e28a7ebf211638",
|
||||
"reference": "db5c28f4a010b4161d507d5304e28a7ebf211638",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"guzzlehttp/guzzle": "^6.0",
|
||||
"php": ">=5.5.0",
|
||||
"symfony/browser-kit": "~2.1|~3.0",
|
||||
"symfony/css-selector": "~2.1|~3.0",
|
||||
"symfony/dom-crawler": "~2.1|~3.0"
|
||||
},
|
||||
"type": "application",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Goutte\\": "Goutte"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "A simple PHP Web Scraper",
|
||||
"homepage": "https://github.com/FriendsOfPHP/Goutte",
|
||||
"keywords": [
|
||||
"scraper"
|
||||
],
|
||||
"time": "2017-01-03T13:21:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
"version": "6.2.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/guzzle.git",
|
||||
"reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006",
|
||||
"reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"guzzlehttp/promises": "^1.0",
|
||||
"guzzlehttp/psr7": "^1.4",
|
||||
"php": ">=5.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-curl": "*",
|
||||
"phpunit/phpunit": "^4.0",
|
||||
"psr/log": "^1.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "6.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/functions_include.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"GuzzleHttp\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Michael Dowling",
|
||||
"email": "mtdowling@gmail.com",
|
||||
"homepage": "https://github.com/mtdowling"
|
||||
}
|
||||
],
|
||||
"description": "Guzzle is a PHP HTTP client library",
|
||||
"homepage": "http://guzzlephp.org/",
|
||||
"keywords": [
|
||||
"client",
|
||||
"curl",
|
||||
"framework",
|
||||
"http",
|
||||
"http client",
|
||||
"rest",
|
||||
"web service"
|
||||
],
|
||||
"time": "2017-02-28T22:50:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/promises",
|
||||
"version": "v1.3.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/promises.git",
|
||||
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
|
||||
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.4-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"GuzzleHttp\\Promise\\": "src/"
|
||||
},
|
||||
"files": [
|
||||
"src/functions_include.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Michael Dowling",
|
||||
"email": "mtdowling@gmail.com",
|
||||
"homepage": "https://github.com/mtdowling"
|
||||
}
|
||||
],
|
||||
"description": "Guzzle promises library",
|
||||
"keywords": [
|
||||
"promise"
|
||||
],
|
||||
"time": "2016-12-20T10:07:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/psr7",
|
||||
"version": "1.4.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/psr7.git",
|
||||
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
|
||||
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4.0",
|
||||
"psr/http-message": "~1.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/http-message-implementation": "1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.4-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"GuzzleHttp\\Psr7\\": "src/"
|
||||
},
|
||||
"files": [
|
||||
"src/functions_include.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Michael Dowling",
|
||||
"email": "mtdowling@gmail.com",
|
||||
"homepage": "https://github.com/mtdowling"
|
||||
},
|
||||
{
|
||||
"name": "Tobias Schultze",
|
||||
"homepage": "https://github.com/Tobion"
|
||||
}
|
||||
],
|
||||
"description": "PSR-7 message implementation that also provides common utility methods",
|
||||
"keywords": [
|
||||
"http",
|
||||
"message",
|
||||
"request",
|
||||
"response",
|
||||
"stream",
|
||||
"uri",
|
||||
"url"
|
||||
],
|
||||
"time": "2017-03-20T17:10:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "1.22.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Seldaek/monolog.git",
|
||||
"reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/1e044bc4b34e91743943479f1be7a1d5eb93add0",
|
||||
"reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/log-implementation": "1.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
|
||||
"doctrine/couchdb": "~1.0@dev",
|
||||
"graylog2/gelf-php": "~1.0",
|
||||
"jakub-onderka/php-parallel-lint": "0.9",
|
||||
"php-amqplib/php-amqplib": "~2.4",
|
||||
"php-console/php-console": "^3.1.3",
|
||||
"phpunit/phpunit": "~4.5",
|
||||
"phpunit/phpunit-mock-objects": "2.3.0",
|
||||
"ruflin/elastica": ">=0.90 <3.0",
|
||||
"sentry/sentry": "^0.13",
|
||||
"swiftmailer/swiftmailer": "~5.3"
|
||||
},
|
||||
"suggest": {
|
||||
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
|
||||
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
|
||||
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
|
||||
"ext-mongo": "Allow sending log messages to a MongoDB server",
|
||||
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
|
||||
"mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
|
||||
"php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
|
||||
"php-console/php-console": "Allow sending log messages to Google Chrome",
|
||||
"rollbar/rollbar": "Allow sending log messages to Rollbar",
|
||||
"ruflin/elastica": "Allow sending log messages to an Elastic Search server",
|
||||
"sentry/sentry": "Allow sending log messages to a Sentry server"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Monolog\\": "src/Monolog"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jordi Boggiano",
|
||||
"email": "j.boggiano@seld.be",
|
||||
"homepage": "http://seld.be"
|
||||
}
|
||||
],
|
||||
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
|
||||
"homepage": "http://github.com/Seldaek/monolog",
|
||||
"keywords": [
|
||||
"log",
|
||||
"logging",
|
||||
"psr-3"
|
||||
],
|
||||
"time": "2017-03-13T07:08:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpoffice/phpexcel",
|
||||
"version": "1.8.0",
|
||||
@ -62,7 +401,494 @@
|
||||
"xls",
|
||||
"xlsx"
|
||||
],
|
||||
"time": "2014-03-02 15:22:49"
|
||||
"time": "2014-03-02T15:22:49+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-message",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-message.git",
|
||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
|
||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Http\\Message\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for HTTP messages",
|
||||
"homepage": "https://github.com/php-fig/http-message",
|
||||
"keywords": [
|
||||
"http",
|
||||
"http-message",
|
||||
"psr",
|
||||
"psr-7",
|
||||
"request",
|
||||
"response"
|
||||
],
|
||||
"time": "2016-08-06T14:39:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
|
||||
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Log\\": "Psr/Log/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for logging libraries",
|
||||
"homepage": "https://github.com/php-fig/log",
|
||||
"keywords": [
|
||||
"log",
|
||||
"psr",
|
||||
"psr-3"
|
||||
],
|
||||
"time": "2016-10-10T12:19:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "setasign/fpdi",
|
||||
"version": "1.6.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Setasign/FPDI.git",
|
||||
"reference": "5b899b2b41463bf261aa69840fd30b50950a500c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Setasign/FPDI/zipball/5b899b2b41463bf261aa69840fd30b50950a500c",
|
||||
"reference": "5b899b2b41463bf261aa69840fd30b50950a500c",
|
||||
"shasum": ""
|
||||
},
|
||||
"suggest": {
|
||||
"setasign/fpdf": "FPDI will extend this class but as it is also possible to use \"tecnickcom/tcpdf\" as an alternative there's no fixed dependency configured.",
|
||||
"setasign/fpdi-fpdf": "Use this package to automatically evaluate dependencies to FPDF.",
|
||||
"setasign/fpdi-tcpdf": "Use this package to automatically evaluate dependencies to TCPDF."
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"filters/",
|
||||
"fpdi.php",
|
||||
"fpdf_tpl.php",
|
||||
"fpdi_pdf_parser.php",
|
||||
"pdf_context.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jan Slabon",
|
||||
"email": "jan.slabon@setasign.com",
|
||||
"homepage": "https://www.setasign.com"
|
||||
}
|
||||
],
|
||||
"description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.",
|
||||
"homepage": "https://www.setasign.com/fpdi",
|
||||
"keywords": [
|
||||
"fpdf",
|
||||
"fpdi",
|
||||
"pdf"
|
||||
],
|
||||
"time": "2015-11-30T10:53:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "spipu/html2pdf",
|
||||
"version": "v4.6.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/spipu/html2pdf.git",
|
||||
"reference": "4898439e170ebf032513b8d3a83f0f5ffe85fece"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/spipu/html2pdf/zipball/4898439e170ebf032513b8d3a83f0f5ffe85fece",
|
||||
"reference": "4898439e170ebf032513b8d3a83f0f5ffe85fece",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.2",
|
||||
"tecnickcom/tcpdf": "~6.2.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-gd": "Allows to embed images into the PDF",
|
||||
"fagundes/zff-html2pdf": "zff-html2pdf module ~0.1.1, if you need to integrate HTML2PDF with Zend Framework 2 (zf2)"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"html2pdf.class.php",
|
||||
"_class/exception.class.php",
|
||||
"_class/locale.class.php",
|
||||
"_class/myPdf.class.php",
|
||||
"_class/parsingHtml.class.php",
|
||||
"_class/parsingCss.class.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Spipu",
|
||||
"homepage": "https://github.com/spipu",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "HTML2PDF is a HTML to PDF converter written in PHP5 (it uses TCPDF). OFFICIAL PACKAGE",
|
||||
"homepage": "http://html2pdf.fr/",
|
||||
"keywords": [
|
||||
"html",
|
||||
"html2pdf",
|
||||
"pdf"
|
||||
],
|
||||
"time": "2016-04-05T12:25:17+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/browser-kit",
|
||||
"version": "v3.2.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/browser-kit.git",
|
||||
"reference": "2fe0caa60c1a1dfeefd0425741182687a9b382b8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/2fe0caa60c1a1dfeefd0425741182687a9b382b8",
|
||||
"reference": "2fe0caa60c1a1dfeefd0425741182687a9b382b8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5.9",
|
||||
"symfony/dom-crawler": "~2.8|~3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/css-selector": "~2.8|~3.0",
|
||||
"symfony/process": "~2.8|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/process": ""
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\BrowserKit\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony BrowserKit Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2017-02-21T09:12:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/css-selector",
|
||||
"version": "v3.2.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/css-selector.git",
|
||||
"reference": "a48f13dc83c168f1253a5d2a5a4fb46c36244c4c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/css-selector/zipball/a48f13dc83c168f1253a5d2a5a4fb46c36244c4c",
|
||||
"reference": "a48f13dc83c168f1253a5d2a5a4fb46c36244c4c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\CssSelector\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jean-François Simon",
|
||||
"email": "jeanfrancois.simon@sensiolabs.com"
|
||||
},
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony CssSelector Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2017-02-21T09:12:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/dom-crawler",
|
||||
"version": "v3.2.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/dom-crawler.git",
|
||||
"reference": "403944e294cf4ceb3b8447f54cbad88ea7b99cee"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/403944e294cf4ceb3b8447f54cbad88ea7b99cee",
|
||||
"reference": "403944e294cf4ceb3b8447f54cbad88ea7b99cee",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5.9",
|
||||
"symfony/polyfill-mbstring": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/css-selector": "~2.8|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/css-selector": ""
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\DomCrawler\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony DomCrawler Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2017-02-21T09:12:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "e79d363049d1c2128f133a2667e4f4190904f7f4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4",
|
||||
"reference": "e79d363049d1c2128f133a2667e4f4190904f7f4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.3-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Mbstring\\": ""
|
||||
},
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for the Mbstring extension",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"mbstring",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"time": "2016-11-14T01:06:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "tecnickcom/tcpdf",
|
||||
"version": "6.2.12",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/tecnickcom/TCPDF.git",
|
||||
"reference": "2f732eaa91b5665274689b1d40b285a7bacdc37f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/2f732eaa91b5665274689b1d40b285a7bacdc37f",
|
||||
"reference": "2f732eaa91b5665274689b1d40b285a7bacdc37f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"fonts",
|
||||
"config",
|
||||
"include",
|
||||
"tcpdf.php",
|
||||
"tcpdf_parser.php",
|
||||
"tcpdf_import.php",
|
||||
"tcpdf_barcodes_1d.php",
|
||||
"tcpdf_barcodes_2d.php",
|
||||
"include/tcpdf_colors.php",
|
||||
"include/tcpdf_filters.php",
|
||||
"include/tcpdf_font_data.php",
|
||||
"include/tcpdf_fonts.php",
|
||||
"include/tcpdf_images.php",
|
||||
"include/tcpdf_static.php",
|
||||
"include/barcodes/datamatrix.php",
|
||||
"include/barcodes/pdf417.php",
|
||||
"include/barcodes/qrcode.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPLv3"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicola Asuni",
|
||||
"email": "info@tecnick.com",
|
||||
"homepage": "http://nicolaasuni.tecnick.com"
|
||||
}
|
||||
],
|
||||
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
|
||||
"homepage": "http://www.tcpdf.org/",
|
||||
"keywords": [
|
||||
"PDFD32000-2008",
|
||||
"TCPDF",
|
||||
"barcodes",
|
||||
"datamatrix",
|
||||
"pdf",
|
||||
"pdf417",
|
||||
"qrcode"
|
||||
],
|
||||
"time": "2015-09-12T10:08:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "zendframework/zendframework1",
|
||||
@ -109,7 +935,7 @@
|
||||
"ZF1",
|
||||
"framework"
|
||||
],
|
||||
"time": "2016-09-08 14:50:34"
|
||||
"time": "2016-09-08T14:50:34+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
@ -154,7 +980,7 @@
|
||||
"log",
|
||||
"logging"
|
||||
],
|
||||
"time": "2013-06-26 03:44:33"
|
||||
"time": "2013-06-26T03:44:33+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
|
11
docs/CRONTAB
11
docs/CRONTAB
@ -1,11 +0,0 @@
|
||||
# AltiScore
|
||||
00 4 * * 1-5 www-data php /home/vhosts/extranet/current/scripts/jobs/getAltiScore.php --cron >> /home/vhosts/data/log/altiscore.log
|
||||
|
||||
# Envoi commande bilan
|
||||
0 * * * * root php /home/vhosts/extranet/current/scripts/jobs/bilaninput.php --send >> /home/vhosts/data/log/bilaninput.log 2>&1
|
||||
|
||||
# Suppression fichier
|
||||
#0 10 01 * * root php /home/vhosts/extranet/current/scripts/jobs/bilaninput.php --delete >> /home/vhosts/data/log/bilaninput.log 2>&1
|
||||
|
||||
# Suppression fichier temporaire
|
||||
01 15 06 * * root php /home/vhosts/extranet/current/scripts/jobs/removeTempFile.php --options all
|
56
docs/README
56
docs/README
@ -29,15 +29,6 @@ SYSTEM REQUIREMENTS
|
||||
INSTALLATION
|
||||
============
|
||||
|
||||
See the file scripts/build/configure.php
|
||||
|
||||
On server this script is automatically called with the install option.
|
||||
configure.php --install
|
||||
|
||||
Each servers are reference with a directory, name as the hostname, in config dir and all configure
|
||||
file is list here
|
||||
|
||||
|
||||
Environment configuration
|
||||
-------------------------
|
||||
|
||||
@ -49,6 +40,21 @@ Environment configuration
|
||||
SetEnv APPLICATION_ENV "staging" => Recette
|
||||
SetEnv APPLICATION_ENV "development" => Developpement
|
||||
|
||||
Set in apache vhost config file (mod_php) or in .user.ini (php-fpm)
|
||||
|
||||
. mod_php
|
||||
|
||||
Add in <VirtualHost/>
|
||||
SetEnv APPLICATION_ENV "development"
|
||||
|
||||
. php-fpm
|
||||
|
||||
Add a file in document root path (public/) a file .user.ini
|
||||
env[APPLICATION_ENV] = "development"
|
||||
|
||||
See the .user.ini file
|
||||
|
||||
|
||||
- Persistent Storage
|
||||
|
||||
[profil.path.shared]/persit/
|
||||
@ -69,7 +75,7 @@ Environment configuration
|
||||
|
||||
- Temporary storage
|
||||
|
||||
[profil.path.shared]/temp/
|
||||
[profil.path.shared]/
|
||||
cache
|
||||
files
|
||||
sessions
|
||||
@ -81,10 +87,10 @@ Environment configuration
|
||||
|
||||
- Printing symbolic links
|
||||
|
||||
ln -vsf [profil.path.shared]/temp/pages/imgcache [profil.path.shared]/temp/pages/file/image/cache/q;
|
||||
ln -vsf [profil.path.shared]/persist/streetview [profil.path.shared]/temp/pages/file/streetview/img/q;
|
||||
ln -vsf [profil.path.shared]/persist/logos [profil.path.shared]/temp/pages/file/image/logo/q;
|
||||
ln -vsf [VHOST]/publis/themes [profil.path.shared]/temp/pages/themes;
|
||||
ln -vsf [profil.path.shared]/pages/imgcache [profil.path.shared]/pages/file/image/cache/q;
|
||||
ln -vsf [profil.path.shared]/persist/streetview [profil.path.shared]/pages/file/streetview/img/q;
|
||||
ln -vsf [profil.path.shared]/persist/logos [profil.path.shared]/pages/file/image/logo/q;
|
||||
ln -vsf [VHOST]/public/themes [profil.path.shared]/pages/themes;
|
||||
|
||||
|
||||
Apache configuration
|
||||
@ -94,16 +100,17 @@ Apache configuration
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerName extranet.sd.dev
|
||||
AddDefaultCharset utf-8
|
||||
DocumentRoot "WORKSPACE/extranet/public"
|
||||
SetEnv APPLICATION_ENV "development"
|
||||
<Directory "WORKSPACE/extranet/public/">
|
||||
AllowOverride All
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
AddDefaultCharset utf-8
|
||||
DirectoryIndex index.php
|
||||
DocumentRoot /home/vhosts/extranet/public
|
||||
<Directory /home/vhosts/extranet/public/>
|
||||
EnableSendfile Off
|
||||
AllowOverride none
|
||||
Require all granted
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
|
||||
#RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
@ -113,13 +120,13 @@ Apache configuration
|
||||
</Directory>
|
||||
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
|
||||
LogLevel debug
|
||||
ErrorLog "logs/extranet-error.log"
|
||||
CustomLog "logs/extranet-access.log" common
|
||||
ErrorLog ${APACHE_LOG_DIR}/extranet-error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/extranet-access.log combined
|
||||
</VirtualHost>
|
||||
|
||||
=> Production configuration
|
||||
|
||||
See VHOST file
|
||||
See in ansible project
|
||||
|
||||
|
||||
PHP Configuration
|
||||
@ -271,4 +278,3 @@ Dans le vhosts d'apache :
|
||||
php_flag apc.cache_by_default On
|
||||
|
||||
|
||||
|
||||
|
29
docs/VHOST
29
docs/VHOST
@ -1,29 +0,0 @@
|
||||
APACHE 2.4
|
||||
==========
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerName extranet.sd.dev
|
||||
AddDefaultCharset utf-8
|
||||
SetEnv APPLICATION_ENV "development"
|
||||
DirectoryIndex index.php
|
||||
DocumentRoot /home/vhosts/extranet/public
|
||||
<Directory /home/vhosts/extranet/public/>
|
||||
EnableSendfile Off
|
||||
AllowOverride none
|
||||
Require all granted
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
#RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^.*$ - [NC,L]
|
||||
RewriteRule ^.*$ index.php [NC,L]
|
||||
</IfModule>
|
||||
</Directory>
|
||||
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
|
||||
LogLevel debug
|
||||
ErrorLog /home/vhosts/apachelog/extranet-error.log
|
||||
CustomLog /home/vhosts/apachelog/extranet-access.log combined
|
||||
</VirtualHost>
|
||||
|
8
docs/config/.user.ini
Executable file
8
docs/config/.user.ini
Executable file
@ -0,0 +1,8 @@
|
||||
upload_max_filesize=513M
|
||||
post_max_size=513M
|
||||
memory_limit=512M
|
||||
mbstring.func_overload=0
|
||||
always_populate_raw_post_data=-1
|
||||
default_charset='UTF-8'
|
||||
date.timezone='Europe/Paris'
|
||||
env[APPLICATION_ENV] = "development"
|
@ -2,11 +2,11 @@
|
||||
phpSettings.date.timezone = "Europe/Paris"
|
||||
phpSettings.display_startup_errors = 0
|
||||
phpSettings.display_errors = 0
|
||||
phpSettings.soap.wsdl_cache_dir = "/home/vhosts/data/extranet/temp/wsdl"
|
||||
phpSettings.soap.wsdl_cache_dir = "/home/vhosts/data/extranet/wsdl"
|
||||
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
|
||||
bootstrap.class = "Bootstrap"
|
||||
appnamespace = "Application"
|
||||
resources.session.save_path = "/home/vhosts/data/extranet/temp/sessions"
|
||||
resources.session.save_path = "/home/vhosts/data/extranet/sessions"
|
||||
resources.useragent.mobile.features.path = APPLICATION_PATH "/../library/Zend/Http/UserAgent/Features/Adapter/Browscap.php"
|
||||
resources.useragent.mobile.features.classname = "Zend_Http_UserAgent_Features_Adapter_Browscap"
|
||||
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
|
@ -1,9 +1,19 @@
|
||||
<?php
|
||||
class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
{
|
||||
/**
|
||||
* Logger
|
||||
* @var \Monolog\Logger
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
public function preDispatch(Zend_Controller_Request_Abstract $request)
|
||||
{
|
||||
Zend_Registry::get('firebug')->info('PLUGIN AUTH - START');
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$logger = Zend_Registry::get('logger');
|
||||
}
|
||||
|
||||
$logger->info('PLUGIN AUTH - START');
|
||||
|
||||
$module = $request->getModuleName();
|
||||
$controller = $request->getControllerName();
|
||||
@ -49,7 +59,7 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
// --- On vérifie le tout lors d'une connexion par url
|
||||
if ( !empty($login) && !empty($hach) ) {
|
||||
|
||||
Zend_Registry::get('firebug')->info('AUTH : IPONLY');
|
||||
$logger->info('AUTH : IPONLY');
|
||||
|
||||
// --- Mode hach
|
||||
if ($mode === null) {
|
||||
@ -169,6 +179,6 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
}
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info('PLUGIN AUTH - END');
|
||||
$logger->info('PLUGIN AUTH - END');
|
||||
}
|
||||
}
|
@ -9,7 +9,11 @@ class Application_Controller_Plugin_Cgu extends Zend_Controller_Plugin_Abstract
|
||||
*/
|
||||
public function preDispatch(Zend_Controller_Request_Abstract $request)
|
||||
{
|
||||
Zend_Registry::get('firebug')->info('PLUGIN CGU - START');
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$logger = Zend_Registry::get('logger');
|
||||
}
|
||||
|
||||
$logger->info('PLUGIN CGU - START');
|
||||
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
if ($layout->isEnabled()) {
|
||||
@ -57,6 +61,6 @@ class Application_Controller_Plugin_Cgu extends Zend_Controller_Plugin_Abstract
|
||||
break;
|
||||
}
|
||||
}
|
||||
Zend_Registry::get('firebug')->info('PLUGIN CGU - END');
|
||||
$logger->info('PLUGIN CGU - END');
|
||||
}
|
||||
}
|
@ -9,7 +9,11 @@ class Application_Controller_Plugin_Lang extends Zend_Controller_Plugin_Abstract
|
||||
*/
|
||||
public function preDispatch(Zend_Controller_Request_Abstract $request)
|
||||
{
|
||||
Zend_Registry::get('firebug')->info('PLUGIN LANG - START');
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$logger = Zend_Registry::get('logger');
|
||||
}
|
||||
|
||||
$logger->info('PLUGIN LANG - START');
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ( $auth->hasIdentity() ) {
|
||||
@ -28,6 +32,7 @@ class Application_Controller_Plugin_Lang extends Zend_Controller_Plugin_Abstract
|
||||
$locale = new Zend_Locale('fr');
|
||||
}
|
||||
|
||||
// @todo : Remove for PHP7 Compatibility
|
||||
$cache = Zend_Cache::factory(
|
||||
'Core',
|
||||
'Apc',
|
||||
@ -55,6 +60,6 @@ class Application_Controller_Plugin_Lang extends Zend_Controller_Plugin_Abstract
|
||||
$registry->set('Zend_Locale', $locale);
|
||||
$registry->set('Zend_Translate', $translate);
|
||||
|
||||
Zend_Registry::get('firebug')->info('PLUGIN LANG - END');
|
||||
$logger->info('PLUGIN LANG - END');
|
||||
}
|
||||
}
|
@ -7,7 +7,11 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
|
||||
*/
|
||||
public function preDispatch(Zend_Controller_Request_Abstract $request)
|
||||
{
|
||||
Zend_Registry::get('firebug')->info('PLUGIN MENU - START');
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$logger = Zend_Registry::get('logger');
|
||||
}
|
||||
|
||||
$logger->info('PLUGIN MENU - START');
|
||||
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
$user = new Scores_Utilisateur();
|
||||
@ -80,6 +84,6 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
|
||||
//$view->aide = true;
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info('PLUGIN MENU - END');
|
||||
$logger->info('PLUGIN MENU - END');
|
||||
}
|
||||
}
|
@ -3,7 +3,11 @@ class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract
|
||||
{
|
||||
public function dispatchLoopShutdown()
|
||||
{
|
||||
Zend_Registry::get('firebug')->info('PLUGIN PDF - START');
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$logger = Zend_Registry::get('logger');
|
||||
}
|
||||
|
||||
$logger->info('PLUGIN PDF - START');
|
||||
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
if ($layout->isEnabled()) {
|
||||
@ -17,10 +21,10 @@ class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract
|
||||
$content = preg_replace('@<link href="/@si','<link href="./',$layout);
|
||||
$content = preg_replace('@src="/@si','src="./',$content);
|
||||
$c = Zend_Registry::get('config');
|
||||
file_put_contents($c->profil->path->shared.'/temp/pages/'.$filename.'.html', $content);
|
||||
file_put_contents($c->profil->path->shared.'/pages/'.$filename.'.html', $content);
|
||||
}
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info('PLUGIN PDF - END');
|
||||
$logger->info('PLUGIN PDF - END');
|
||||
}
|
||||
}
|
@ -3,7 +3,11 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
|
||||
{
|
||||
public function preDispatch(Zend_Controller_Request_Abstract $request)
|
||||
{
|
||||
Zend_Registry::get('firebug')->info('PLUGIN THEME - START');
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$logger = Zend_Registry::get('logger');
|
||||
}
|
||||
|
||||
$logger->info('PLUGIN THEME - START');
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$theme = 'default'; //$theme = 'mobile';
|
||||
@ -129,6 +133,6 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
|
||||
break;
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info('PLUGIN THEME - STOP');
|
||||
$logger->info('PLUGIN THEME - STOP');
|
||||
}
|
||||
}
|
@ -3,7 +3,11 @@ class Application_Controller_Plugin_Xml extends Zend_Controller_Plugin_Abstract
|
||||
{
|
||||
public function dispatchLoopShutdown()
|
||||
{
|
||||
Zend_Registry::get('firebug')->info('PLUGIN XML - START');
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$logger = Zend_Registry::get('logger');
|
||||
}
|
||||
|
||||
$logger->info('PLUGIN XML - START');
|
||||
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
if ($layout->isEnabled()) {
|
||||
@ -20,6 +24,6 @@ class Application_Controller_Plugin_Xml extends Zend_Controller_Plugin_Abstract
|
||||
}
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info('PLUGIN XML - END');
|
||||
$logger->info('PLUGIN XML - END');
|
||||
}
|
||||
}
|
8
library/Application/Model/CommandesSurveillance.php
Normal file
8
library/Application/Model/CommandesSurveillance.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
class Application_Model_CommandesSurveillance extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_surveillance';
|
||||
|
||||
|
||||
|
||||
}
|
@ -164,7 +164,6 @@ class GenCourrier
|
||||
'ZIP_PROXY' => 'PhpZipProxy',
|
||||
);
|
||||
|
||||
require_once 'Vendors/odtphp/library/odf.php';
|
||||
$odf = new odf(realpath(dirname(__FILE__).'/modeleLettreGreffe.odt'), $config);
|
||||
|
||||
$this->setInfosCommande();
|
||||
|
@ -1,8 +1,4 @@
|
||||
<?php
|
||||
require_once 'Vendors/tcpdf/tcpdf.php';
|
||||
|
||||
require_once 'Vendors/fpdi/fpdi.php';
|
||||
|
||||
class PDF extends FPDI {
|
||||
/**
|
||||
* "Remembers" the template id of the imported page
|
||||
|
@ -3,7 +3,7 @@
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
require_once 'Vendors/ChartDirector/phpchartdir.php';
|
||||
require_once 'ChartDirector/phpchartdir.php';
|
||||
require_once ('Giant/WSgiant.php');
|
||||
require_once ('Scores/WsScores.php');
|
||||
require_once ('Scores/Cache.php');
|
||||
@ -19,7 +19,7 @@ Class GiantControllerLib
|
||||
{
|
||||
$this->configVal = new Zend_Config_Ini( realpath(dirname(__FILE__)).'/giant.ini' );
|
||||
$c = Zend_Registry::get('config');
|
||||
$this->pathImg = $c->profil->path->shared.'/temp/pages/imgcache/'.$companyId;
|
||||
$this->pathImg = $c->profil->path->shared.'/pages/imgcache/'.$companyId;
|
||||
}
|
||||
|
||||
public function getCache($pays){
|
||||
|
@ -547,7 +547,7 @@ class Infogreffe
|
||||
$bilan['mode_diffusion'][] = $mode->getAttribute('type');
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info('Bilan : '.$bilan['date_cloture'].' '.$bilan['type_comptes']);
|
||||
$this->logger->info('Bilan : '.$bilan['date_cloture'].' '.$bilan['type_comptes']);
|
||||
|
||||
//Génération de l'index pour le tri
|
||||
$date = $bilan['date_cloture_iso'];
|
||||
@ -628,17 +628,17 @@ class Infogreffe
|
||||
->where('date=?', $date)
|
||||
->where('num=?', $acte['num_acte'])
|
||||
->where('file LIKE "acte-'.$siren.'-%-'.$date.'-%-'.$depot['num_depot'].'-'.$acte['num_acte'].'.pdf"');
|
||||
Zend_Registry::get('firebug')->info('Detect fichier : '.$sql->__toString());
|
||||
$this->logger->info('Detect fichier : '.$sql->__toString());
|
||||
$result = $actesM->fetchRow($sql);
|
||||
if ( null !== $result ) {
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
$this->logger->info(print_r($result,1));
|
||||
$fichier = $this->pathData.$this->actePath($ref).$result->file;
|
||||
Zend_Registry::get('firebug')->info($fichier);
|
||||
$this->logger->info($fichier);
|
||||
if ( file_exists($fichier) )
|
||||
{
|
||||
Zend_Registry::get('firebug')->info($acte);
|
||||
$this->logger->info(print_r($acte,1));
|
||||
if ($result->type != $acte['type_acte'] && $result->type2 == '') {
|
||||
Zend_Registry::get('firebug')->info('Update Database');
|
||||
$this->logger->info('Update Database');
|
||||
//Add to the database
|
||||
try {
|
||||
$actesM->update(array(
|
||||
@ -648,7 +648,7 @@ class Infogreffe
|
||||
'date_depot' => $dateDepot->toString('yyyyMMdd')
|
||||
), 'id='.$result->id);
|
||||
} catch (Zend_Exception $e) {
|
||||
Zend_Registry::get('firebug')->info($e->getMessage());
|
||||
$this->logger->info($e->getMessage());
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
@ -658,7 +658,7 @@ class Infogreffe
|
||||
'date_depot' => $dateDepot->toString('yyyyMMdd')
|
||||
), 'id='.$result->id);
|
||||
} catch (Zend_Exception $e) {
|
||||
Zend_Registry::get('firebug')->info($e->getMessage());
|
||||
$this->logger->info($e->getMessage());
|
||||
}
|
||||
}
|
||||
$ref = str_replace('.pdf', '',substr($result->file,15));
|
||||
@ -770,7 +770,7 @@ class Infogreffe
|
||||
|
||||
//Cas de fichier correspondant à la référence
|
||||
$fichier = $this->pathData.$this->bilanPath($ref).$this->bilanFilename($siren,$ref);
|
||||
Zend_Registry::get('firebug')->info('Fichier : '.$fichier);
|
||||
$this->logger->info('Fichier : '.$fichier);
|
||||
if( file_exists($fichier) && filesize($fichier)>0 )
|
||||
{
|
||||
$mode = 'fichier';
|
||||
|
@ -39,6 +39,12 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
|
||||
'62.210.222.34',
|
||||
);
|
||||
|
||||
/**
|
||||
* Logger
|
||||
* @var \Monolog\Logger
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
/**
|
||||
* Authentification par WS
|
||||
* @param string $username
|
||||
@ -62,6 +68,10 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
|
||||
$this->_password = 'iponly:'.$ip;
|
||||
$this->_checkIp = true;
|
||||
}
|
||||
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$this->logger = Zend_Registry::get('logger');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,23 +95,27 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
|
||||
$parameters->from = 'auth';
|
||||
$InfosLogin = $ws->getInfosLogin($parameters);
|
||||
|
||||
Zend_Registry::get('firebug')->info(__CLASS__ . ' : '.__METHOD__);
|
||||
Zend_Registry::get('firebug')->info($InfosLogin);
|
||||
$this->logger->info(__CLASS__ . ' : '.__METHOD__);
|
||||
$this->logger->info(print_r($InfosLogin,1));
|
||||
|
||||
$identity = new stdClass();
|
||||
|
||||
// --- Erreur technique
|
||||
if ($InfosLogin === false) {
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity, array("Identification impossible"));
|
||||
}
|
||||
// --- Renvoi
|
||||
if ( is_string($InfosLogin) || $InfosLogin->error->errnum != 0 ) {
|
||||
elseif (is_string($InfosLogin) || $InfosLogin->error->errnum != 0) {
|
||||
$message = $InfosLogin;
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $identity, array($message));
|
||||
}
|
||||
// --- Assignation identity
|
||||
elseif ( $InfosLogin !== false && !empty($InfosLogin->result->login)) {
|
||||
$identity = new stdClass();
|
||||
elseif ($InfosLogin->result->login == $this->_username) {
|
||||
if ($this->_checkIp || $this->_checkHach) {
|
||||
Zend_Registry::get('firebug')->info("IN");
|
||||
$identity->password = $this->_password;
|
||||
} else {
|
||||
$identity->password = md5($InfosLogin->result->login.'|'.$this->_password);
|
||||
}
|
||||
Zend_Registry::get('firebug')->info($identity->password);
|
||||
$identity->username = $InfosLogin->result->login;
|
||||
$identity->email = $InfosLogin->result->email;
|
||||
$identity->profil = $InfosLogin->result->profil;
|
||||
@ -128,10 +142,12 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
|
||||
$identity->version = $InfosLogin->result->version;
|
||||
$identity->modeEdition = false;
|
||||
|
||||
$timeout = (!empty($InfosLogin->result->timeout)) ? $InfosLogin->result->timeout : $this->_timeout;
|
||||
$timeout = (!empty($InfosLogin->result->timeout)) ?
|
||||
$InfosLogin->result->timeout : $this->_timeout;
|
||||
$identity->timeout = $timeout;
|
||||
$identity->time = time() + $timeout;
|
||||
$lang = in_array($InfosLogin->result->lang, array('fr','en')) ? $InfosLogin->result->lang : 'fr';
|
||||
$lang = in_array($InfosLogin->result->lang, array('fr','en')) ?
|
||||
$InfosLogin->result->lang : 'fr';
|
||||
$identity->lang = $lang;
|
||||
$identity->langtmp = $lang;
|
||||
|
||||
@ -160,6 +176,7 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
|
||||
$this->_password = $identity->password;
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $identity);
|
||||
}
|
||||
// --- Fallback
|
||||
else {
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity, array("Identification impossible"));
|
||||
}
|
||||
|
@ -672,7 +672,7 @@ class BDF
|
||||
$filename = false;
|
||||
} else {
|
||||
$c = Zend_Registry::get('config');
|
||||
$filename = $c->profil->path->shared.'/temp/cache/bdf_'.$service.'_'.$req.'_'.$module.'.html';
|
||||
$filename = $c->profil->path->shared.'/cache/bdf_'.$service.'_'.$req.'_'.$module.'.html';
|
||||
}
|
||||
|
||||
//@todo : Ajouter timeover
|
||||
|
@ -14,7 +14,7 @@ class Cache
|
||||
*/
|
||||
public function __construct($name = null)
|
||||
{
|
||||
$this->filename = Zend_Registry::get('config')->profil->path->shared.'/temp/cache/'.$name.$this->extension;
|
||||
$this->filename = Zend_Registry::get('config')->profil->path->shared.'/cache/'.$name.$this->extension;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -21,6 +21,7 @@ class Scores_Export_Print
|
||||
'finance-bourse' => 'siret,id',
|
||||
'finance-banque' => 'siret,id',
|
||||
'juridique-annonces' => 'siret,id,idAnn,vue,p',
|
||||
'juridique-annonce' => 'siret,id,idAnn,vue',
|
||||
'juridique-infosreg' => 'siret,id',
|
||||
'juridique-competences' => 'siret,id,type',
|
||||
'juridique-marques' => 'siret,id,idObject',
|
||||
@ -57,6 +58,7 @@ class Scores_Export_Print
|
||||
'finance-bourse' => 'siret,id',
|
||||
'finance-banque' => 'siret,id',
|
||||
'juridique-annonces' => 'siret,id,idAnn,vue,p',
|
||||
'juridique-annonce' => 'siret,id,idAnn,vue',
|
||||
'juridique-infosreg' => 'siret,id',
|
||||
'juridique-competences' => 'siret,id,type',
|
||||
'juridique-marques' => 'siret,id,idObject',
|
||||
@ -91,6 +93,7 @@ class Scores_Export_Print
|
||||
'finance-bourse' => 'siret,id',
|
||||
'finance-banque' => 'siret,id',
|
||||
'juridique-annonces' => 'siret,id,idAnn,vue,p',
|
||||
'juridique-annonce' => 'siret,id,idAnn,vue',
|
||||
'juridique-infosreg' => 'siret,id',
|
||||
'juridique-competences' => 'siret,id,type',
|
||||
'juridique-marques' => 'siret,id,idObject',
|
||||
@ -159,7 +162,7 @@ class Scores_Export_Print
|
||||
$content = $serializer->serialize($object);
|
||||
$filename = $this->filename('xml', $params);
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared.'/temp/files/';
|
||||
$path = $c->profil->path->shared.'/files/';
|
||||
file_put_contents($path.$filename.'.xml', $content);
|
||||
} catch (Zend_Serializer_Exception $e) {
|
||||
//Error
|
||||
|
26375
library/Scores/Finance/Banques.php
Normal file
26375
library/Scores/Finance/Banques.php
Normal file
File diff suppressed because one or more lines are too long
@ -22,7 +22,7 @@ class Scores_Finance_Liasse_XLS
|
||||
public function __construct($modele = '', $mode = 'Excel5')
|
||||
{
|
||||
$c = Zend_Registry::get('config');
|
||||
$this->path = $c->profil->path->shared . '/temp/files/';
|
||||
$this->path = $c->profil->path->shared . '/files/';
|
||||
if (!is_dir($this->path)){
|
||||
mkdir($this->path);
|
||||
}
|
||||
|
@ -8,10 +8,10 @@ class Scores_Finance_Ratios_Graph
|
||||
|
||||
public function __construct($siret, $id = 0)
|
||||
{
|
||||
require_once 'Vendors/ChartDirector/phpchartdir.php';
|
||||
require_once 'ChartDirector/phpchartdir.php';
|
||||
require_once 'Scores/Cache.php';
|
||||
$c = Zend_Registry::get('config');
|
||||
$this->path = $c->profil->path->shared . '/temp/pages/imgcache/';
|
||||
$this->path = $c->profil->path->shared . '/pages/imgcache/';
|
||||
$this->siret = $siret;
|
||||
$this->id = $id;
|
||||
}
|
||||
|
@ -211,12 +211,12 @@ class Scores_Google_Streetview
|
||||
$response = $client->request('GET');
|
||||
if ( $response->isSuccessful() ) {
|
||||
if (!copy($response->getStreamName(), $this->pathImg())) {
|
||||
Zend_Registry::get('firebug')->info('Erreur copie image !');
|
||||
$this->logger->info('Erreur copie image !');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} catch (Zend_Http_Client_Exception $e) {
|
||||
Zend_Registry::get('firebug')->info('HTTP Exception : '.$e->getMessage());
|
||||
$this->logger->info('HTTP Exception : '.$e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -113,11 +113,15 @@ class IdentiteEntreprise
|
||||
}
|
||||
public function getCapitalisationTexte()
|
||||
{
|
||||
$capitalisation = $this->identite->Bourse->capitalisation;
|
||||
if ($this->identite->Isin == '' || intval($capitalisation) == 0)
|
||||
if (!isset($this->identite->Bourse)) {
|
||||
return false;
|
||||
}
|
||||
if ($this->identite->Isin == '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$date = new Zend_Date($this->identite->Bourse->derCoursDate, 'yyyy-MM-dd');
|
||||
$capitalisation = $this->identite->Bourse->capitalisation;
|
||||
|
||||
return number_format($capitalisation, 0, '', ' ').' € au '.$date->toString('dd/MM/yyyy');
|
||||
}
|
||||
@ -1364,6 +1368,7 @@ class IdentiteEntreprise
|
||||
if($i==2) break;
|
||||
}
|
||||
switch($i){
|
||||
case 0: $unite = ' '; break;
|
||||
case 1: $unite = ' K'; break;
|
||||
case 2: $unite = ' M'; break;
|
||||
}
|
||||
|
@ -5,6 +5,12 @@ class IdentiteProcol
|
||||
protected $annonces = array();
|
||||
protected $procol;
|
||||
|
||||
/**
|
||||
* Logger
|
||||
* @var \Monolog\Logger
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
/**
|
||||
* Construit l'identite entreprise afin de retourner les éléments formatter
|
||||
* pour l'affichage
|
||||
@ -13,6 +19,10 @@ class IdentiteProcol
|
||||
*/
|
||||
public function __construct($infos)
|
||||
{
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$this->logger = Zend_Registry::get('logger');
|
||||
}
|
||||
|
||||
$this->identite = $infos->Identite;
|
||||
$this->procol = new stdClass();
|
||||
$this->procol->LibTypeEtab = $infos->LibTypeEtab;
|
||||
@ -39,7 +49,7 @@ class IdentiteProcol
|
||||
}
|
||||
}
|
||||
}
|
||||
Zend_Registry::get('firebug')->info($this->annonces);
|
||||
$this->logger->info(print_r($this->annonces,1));
|
||||
$this->view = new Zend_View();
|
||||
}
|
||||
|
||||
|
186
library/Scores/Import/FileCsv.php
Normal file
186
library/Scores/Import/FileCsv.php
Normal file
@ -0,0 +1,186 @@
|
||||
<?php
|
||||
class Scores_Import_FileCsv
|
||||
{
|
||||
private $filepath='';
|
||||
private $standardcolumns=array(
|
||||
'siren','nic','ref'
|
||||
);
|
||||
private $standarddelimiter=',';
|
||||
private $standardencoding='utf-8';
|
||||
public $standardhelptext='Le fichier attendu est un csv standard : fichier texte extension .csv contenant 3 colonnes (siren nic ref) séparées par des virgules';
|
||||
public function __construct()
|
||||
{
|
||||
$c = new Zend_Config_Ini(realpath(APPLICATION_PATH) . '/configs/application.ini');
|
||||
$ct = $c->toArray();
|
||||
$this->config=$ct[APPLICATION_ENV];
|
||||
//home/vhosts/data/extranet
|
||||
$this->filepath=$this->config['profil']['path']['shared'].'/persist/surveillance/';
|
||||
if(!is_dir($this->filepath)){
|
||||
mkdir($this->filepath);
|
||||
}
|
||||
}
|
||||
public function verifandupload($file,$request){
|
||||
$ref=$request->getParam('ref');
|
||||
$user = new Scores_Utilisateur();
|
||||
$this->login = $user->identity->username;
|
||||
//var_dump($user->identity);die;
|
||||
$this->email=$request->getParam('email');
|
||||
$this->sources=$request->getParam('source');
|
||||
|
||||
$fileinname=$file["fichier"]["name"];
|
||||
$fileType = pathinfo($fileinname,PATHINFO_EXTENSION);
|
||||
if($fileType!='csv'){
|
||||
return array('success' => false, 'message' => 'Extension incorrecte');
|
||||
}
|
||||
$fileoutname=$ref.'.csv';
|
||||
$target=$this->filepath.$fileinname;
|
||||
if (!move_uploaded_file($file["fichier"]["tmp_name"], $target)) {
|
||||
return array('success' => false, 'message' => 'Le fichier '
|
||||
. basename( $file["fichier"]["name"]). ' ne peut pas être chargé.');
|
||||
}
|
||||
$result=$this->verifyformat($fileinname,$fileoutname);
|
||||
if($result['success']){
|
||||
$row=$result['message'];
|
||||
}else{
|
||||
return $result;
|
||||
}
|
||||
$result=$this->sendtoftp($fileoutname);
|
||||
if(!$result['success']){
|
||||
return $result;
|
||||
}
|
||||
|
||||
$cmd=new Application_Model_CommandesSurveillance();
|
||||
foreach($sources as $source){
|
||||
$data= array(
|
||||
'ref' => $ref,
|
||||
'login' =>$this->login,
|
||||
'email' => $this->email,
|
||||
'filename' => $fileinname,
|
||||
'surv_source' => $source,
|
||||
'date_created' => Date('Y-m-d')
|
||||
);
|
||||
$cmd->insert($data);
|
||||
}
|
||||
$mail = new Zend_Mail('UTF-8');
|
||||
// --- Configuration du transport SMTP
|
||||
if ( $this->config['profil']['mail']['method'] == 'smtp' ) {
|
||||
$config = array();
|
||||
if ( isset($this->config['profil']['mail']['username']) ) {
|
||||
$config['username'] = $this->config['profil']['mail']['username'];
|
||||
}
|
||||
if ( isset($this->config['profil']['mail']['password']) ) {
|
||||
$config['password'] = $this->config['profil']['mail']['password'];
|
||||
}
|
||||
|
||||
if ( isset($this->config['profil']['mail']['port']) ) {
|
||||
$config['port'] = $c->profil->mail->port;
|
||||
}
|
||||
$tr = new Zend_Mail_Transport_Smtp($this->config['profil']['mail']['host'], $config);
|
||||
}
|
||||
// --- Configuration transport Sendmail
|
||||
if ( $this->config['profil']['mail']['method']== 'sendmail' ) {
|
||||
$tr = new Zend_Mail_Transport_Sendmail();
|
||||
}
|
||||
$mail->setDefaultTransport($tr);
|
||||
$mail->setBodyText(implode('###',$data));
|
||||
$mail->setFrom('support@scores-decisions.com', 'Extranet');
|
||||
$mail->addTo('supportdev@scores-decisions.com', 'Support');
|
||||
$mail->setSubject('Commande de surveillance '.$ref);
|
||||
try{
|
||||
$mail->send(); // Ne fonctionne pas en dev....
|
||||
}catch(Exception $e){
|
||||
// Ne fonctionne pas en dev.... voir en prod
|
||||
}
|
||||
|
||||
return array('success' => true, 'message' => $row);
|
||||
}
|
||||
private function verifyformat($fileinname,$fileoutname){
|
||||
$handle=fopen($this->filepath.$fileinname,'r');
|
||||
$h2=fopen($this->filepath.$fileoutname,'w');
|
||||
if(!$handle){
|
||||
return array('success' => false, 'message' => 'Fichier illisible.');
|
||||
}
|
||||
if(!$h2){
|
||||
return array('success' => false, 'message' => 'Un probleme technique est survenu merci de nous contacter avec le code erreur '.__LINE__);
|
||||
}
|
||||
ini_set("auto_detect_line_endings", true);
|
||||
$row=1;
|
||||
while (($data = fgetcsv($handle)) !== FALSE) {
|
||||
$num = count($data);
|
||||
if($num!=3){
|
||||
return array('success' => false, 'message' => 'Nombre de colonnes erronné à la ligne '.$row.'.');
|
||||
}
|
||||
if($data[0]=='siren' & $row==1){
|
||||
continue;
|
||||
}
|
||||
$data[0]=trim($data[0]);
|
||||
if(strlen($data[0])>9){
|
||||
return array('success' => false, 'message' => 'Siren mal formaté à la ligne '.$row.'.');
|
||||
}
|
||||
if(!is_numeric($data[0])){
|
||||
return array('success' => false, 'message' => 'Siren non numérique '.$data[0].' à la ligne '.$row.'.');
|
||||
}
|
||||
$siren=substr('000000000'.$data[0],-9,9);
|
||||
if(!$this->estValide($siren)){
|
||||
return array('success' => false, 'message' => 'Siren invalide '.$data[0].' à la ligne '.$row.'.');
|
||||
}
|
||||
$row++;
|
||||
$data[3]='';
|
||||
$data[4]=$this->login;
|
||||
$data[5]=$this->email;
|
||||
foreach($this->sources as $source){
|
||||
$data[3]=$source;
|
||||
fputcsv($h2,$data);
|
||||
}
|
||||
}
|
||||
fclose($handle);
|
||||
fclose($h2);
|
||||
|
||||
return array('success' => true, 'message' => $row);
|
||||
|
||||
}
|
||||
private function sendtoftp($filename){
|
||||
$connection = ftp_connect('ftp.scores-decisions.com',21);
|
||||
|
||||
$login = ftp_login($connection, 'internesd', 'internesd2017');
|
||||
|
||||
$dest='/send/'.$filename;
|
||||
|
||||
$source=$this->filepath.$filename;
|
||||
|
||||
if (!$connection || !$login) {
|
||||
return array('success' => false, 'message' => 'Un probleme technique est survenu merci de nous contacter avec le code erreur '.__LINE__);
|
||||
}
|
||||
|
||||
if(!ftp_pasv($connection, true)){
|
||||
return array('success' => false, 'message' => 'Un probleme technique est survenu merci de nous contacter avec le code erreur '.__LINE__);
|
||||
}
|
||||
$upload = ftp_put($connection, $dest, $source, FTP_BINARY);
|
||||
|
||||
if (!$upload) {
|
||||
return array('success' => false, 'message' => 'Un probleme technique est survenu merci de nous contacter avec le code erreur '.__LINE__);
|
||||
}
|
||||
|
||||
ftp_close($connection);
|
||||
return array('success' => true, 'message' => '');
|
||||
}
|
||||
private function estValide($siren){
|
||||
// Donc le SIREN est un numérique à 9 chiffres
|
||||
$somme = 0;
|
||||
for ($cpt = 0; $cpt<strlen($siren); $cpt++) {
|
||||
if (($cpt % 2) == 1) { // Les positions paires : 2ème, 4ème, 6ème et 8ème chiffre
|
||||
$tmp = substr($siren,$cpt,1) * 2; // On le multiplie par 2
|
||||
if ($tmp > 9)
|
||||
$tmp -= 9; // Si le résultat est supérieur à 9, on lui soustrait 9
|
||||
}
|
||||
else
|
||||
$tmp = substr($siren,$cpt,1);
|
||||
$somme += (int)$tmp;
|
||||
}
|
||||
if (($somme % 10) == 0)
|
||||
return true; // Si la somme est un multiple de 10 alors le SIREN est valide
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
@ -13,7 +13,7 @@ class Scores_Insee_AvisSituation
|
||||
$this->siret = $siret;
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$this->pathPdf = $c->profil->path->shared.'/temp/files';
|
||||
$this->pathPdf = $c->profil->path->shared.'/files';
|
||||
$this->pathLog = $c->profil->path->shared.'/persist/log';
|
||||
$this->lock = $this->pathLog.'/aviserreur.lock';
|
||||
}
|
||||
@ -96,7 +96,7 @@ class Scores_Insee_AvisSituation
|
||||
|
||||
$mail = new Scores_Mail_Method();
|
||||
$mail->setFromKey('contact');
|
||||
$mail->addToKey('support');
|
||||
$mail->addToKey('suivi');
|
||||
$mail->setSubject($objet);
|
||||
$mail->setBodyText($texte);
|
||||
$mail->execute();
|
||||
@ -104,7 +104,9 @@ class Scores_Insee_AvisSituation
|
||||
|
||||
public function erreurmsg()
|
||||
{
|
||||
return "<h3>Le site partenaire n'a pas répondu correctement ou est indisponible. Merci d'essayer à nouveau ultérieurement.</h3>";
|
||||
return "<h3>Le site partenaire n'a pas répondu correctement ou est indisponible.
|
||||
Merci d'essayer à nouveau ultérieurement ou consulter le
|
||||
<a target=\"_blank\" href=\"http://avis-situation-sirene.insee.fr/\">site officiel</a></h3>";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -255,6 +255,7 @@ class Scores_Menu
|
||||
'label' => 'ELEMENTS JURIDIQUES',
|
||||
'activateMenu' => array(
|
||||
array('controller'=>'juridique', 'action'=>'ctxdetail'),
|
||||
array('controller'=>'juridique', 'action'=>'annonce'),
|
||||
),
|
||||
'pages' => array(
|
||||
array(
|
||||
|
@ -1,8 +1,4 @@
|
||||
<?php
|
||||
require_once 'Vendors/tcpdf/tcpdf.php';
|
||||
|
||||
require_once 'Vendors/fpdi/fpdi.php';
|
||||
|
||||
class Scores_Pdf_Fpdi extends FPDI
|
||||
{
|
||||
/**
|
||||
|
@ -1,6 +1,4 @@
|
||||
<?php
|
||||
require_once 'Vendors/tcpdf/tcpdf.php';
|
||||
|
||||
class Scores_Pdf_Tcpdf extends TCPDF
|
||||
{
|
||||
protected $bgimage = null;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
require_once 'Vendors/ChartDirector/phpchartdir.php';
|
||||
require_once 'ChartDirector/phpchartdir.php';
|
||||
|
||||
class RapportComment
|
||||
{
|
||||
@ -18,12 +18,22 @@ class RapportComment
|
||||
protected $graphCouleurs = array();
|
||||
protected $pathImage = '';
|
||||
|
||||
/**
|
||||
* Logger
|
||||
* @var \Monolog\Logger
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
public function __construct($siret, $id, $tabCommentaires = array(), $RatiosInfos = null, $BilansInfos = null, $RatiosSecteur = null, $tabProjection = array())
|
||||
{
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$this->logger = Zend_Registry::get('logger');
|
||||
}
|
||||
|
||||
//Assignation
|
||||
$this->commentaires = $tabCommentaires;
|
||||
$c = Zend_Registry::get('config');
|
||||
$this->pathImage = $c->profil->path->shared.'/temp/pages/imgcache/';
|
||||
$this->pathImage = $c->profil->path->shared.'/pages/imgcache/';
|
||||
|
||||
$this->idEntreprise = $id;
|
||||
$this->siret = $siret;
|
||||
@ -307,12 +317,12 @@ class RapportComment
|
||||
$pattern = '/COULEUR\((.*)\)/i';
|
||||
///Detection couleur
|
||||
if ( preg_match($pattern, $content, $matches) ) {
|
||||
Zend_Registry::get('firebug')->info('DETECTION Couleurs');
|
||||
$this->logger->info('DETECTION Couleurs');
|
||||
$listeCouleurs = $matches[1];
|
||||
//Récupération des couleurs
|
||||
$pattern = '/([a-z0-9]{3,4})/i';
|
||||
if ( preg_match_all($pattern, $listeCouleurs, $matches) ) {
|
||||
Zend_Registry::get('firebug')->info($matches);
|
||||
$this->logger->info(print_r($matches,1));
|
||||
$nbCouleurs = count($matches[1]);
|
||||
for($i=0;$i<$nbCouleurs;$i++){
|
||||
$this->graphCouleurs[] = $assocNomCouleurs[$matches[1][$i]];
|
||||
@ -327,7 +337,7 @@ class RapportComment
|
||||
{
|
||||
$pattern = '/\[GRAPHIQUE id=(.*?) titre=\'(.*?)\',(.*)\]/';
|
||||
if( preg_match($pattern, $content, $matches) ){
|
||||
Zend_Registry::get('firebug')->info($content);
|
||||
$this->logger->info($content);
|
||||
$image_id = $matches[1];
|
||||
$titre = $matches[2];
|
||||
//Génération id/nom fichier graphique
|
||||
@ -352,7 +362,7 @@ class RapportComment
|
||||
}
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info('Graphique : '.$type);
|
||||
$this->logger->info('Graphique : '.$type);
|
||||
|
||||
switch($detectType){
|
||||
case 'histo':
|
||||
@ -494,10 +504,10 @@ class RapportComment
|
||||
if( $this->cache_graph($this->pathImage.$file) ){
|
||||
$output = $file;
|
||||
} else {
|
||||
Zend_Registry::get('firebug')->info('Histo - id : '.$id);
|
||||
Zend_Registry::get('firebug')->info('Histo - titre : '.$titre);
|
||||
Zend_Registry::get('firebug')->info('Histo - strRatios : '.$strRatios);
|
||||
Zend_Registry::get('firebug')->info($this->ratiosEntrep);
|
||||
$this->logger->info('Histo - id : '.$id);
|
||||
$this->logger->info('Histo - titre : '.$titre);
|
||||
$this->logger->info('Histo - strRatios : '.$strRatios);
|
||||
$this->logger->info(print_r($this->ratiosEntrep,1));
|
||||
// --- Gestion des couleurs
|
||||
if(count($this->graphCouleurs)>0){
|
||||
$couleurs = $this->graphCouleurs;
|
||||
@ -574,7 +584,7 @@ class RapportComment
|
||||
}
|
||||
}
|
||||
if ( !isset($unite) ) { $unite = 'EUR'; }
|
||||
Zend_Registry::get('firebug')->info($data);
|
||||
$this->logger->info($data);
|
||||
// --- Graphique
|
||||
if ( count($data)<=1 ){
|
||||
$output = false;
|
||||
|
@ -3,6 +3,12 @@ class Scores_Session_Entreprise
|
||||
{
|
||||
protected $index = 'entrep';
|
||||
|
||||
/**
|
||||
* Logger
|
||||
* @var \Monolog\Logger
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
/**
|
||||
* @param string $siret
|
||||
* @param int $id
|
||||
@ -10,6 +16,10 @@ class Scores_Session_Entreprise
|
||||
*/
|
||||
public function __construct($siret, $id = 0, $set = false)
|
||||
{
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$this->logger = Zend_Registry::get('logger');
|
||||
}
|
||||
|
||||
if ( !empty($siret) && !$set ) {
|
||||
if (!$this->checkSession($siret, $id) ){
|
||||
$this->getInfoEntrep($siret, $id);
|
||||
@ -113,7 +123,7 @@ class Scores_Session_Entreprise
|
||||
|
||||
protected function getInfoEntrep($siret, $id = 0)
|
||||
{
|
||||
Zend_Registry::get('firebug')->info('getInfoEntrep');
|
||||
$this->logger->info('getInfoEntrep');
|
||||
require_once 'Scores/WsScores.php';
|
||||
$ws = new WsScores();
|
||||
$etab = $ws->getIdentiteLight($siret, $id);
|
||||
|
@ -7,8 +7,18 @@ class Scores_Utilisateur
|
||||
*/
|
||||
public $identity = null;
|
||||
|
||||
/**
|
||||
* Logger
|
||||
* @var \Monolog\Logger
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$this->logger = Zend_Registry::get('logger');
|
||||
}
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ( $auth->hasIdentity() ) {
|
||||
$this->identity = $auth->getIdentity();
|
||||
@ -333,7 +343,7 @@ class Scores_Utilisateur
|
||||
);
|
||||
$clientstatM = new Application_Model_ClientStat();
|
||||
$id = $clientstatM->insert($data);
|
||||
Zend_Registry::get('firebug')->info('Insertion : '.$id);
|
||||
$this->logger->info('Insertion : '.$id);
|
||||
}
|
||||
|
||||
}
|
@ -59,6 +59,12 @@ class Scores_Ws_Client extends Zend_Soap_Client
|
||||
*/
|
||||
protected $cache;
|
||||
|
||||
/**
|
||||
* Logger
|
||||
* @var \Monolog\Logger
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
/**
|
||||
* Créer l'environnement nécessaire pour le chargement du webservice
|
||||
* @param string $name
|
||||
@ -70,6 +76,10 @@ class Scores_Ws_Client extends Zend_Soap_Client
|
||||
*/
|
||||
public function __construct($name, $version, $user = null)
|
||||
{
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$this->logger = Zend_Registry::get('logger');
|
||||
}
|
||||
|
||||
// --- Configuration de l'application
|
||||
if (Zend_Registry::isRegistered('config')) {
|
||||
$c = Zend_Registry::get('config');
|
||||
@ -103,7 +113,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
|
||||
|
||||
if (PHP_SAPI != 'cli' && $user === null) {
|
||||
$user = new Scores_Utilisateur();
|
||||
Zend_Registry::get('firebug')->info($user->getPassword());
|
||||
$this->logger->info($user->getPassword());
|
||||
}
|
||||
|
||||
if ($user !== null) {
|
||||
@ -122,7 +132,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
|
||||
|
||||
// --- Create Cache
|
||||
$frontend = array( 'lifetime' => 14400, 'automatic_seralization' => true );
|
||||
$backend = array( 'cache_dir' => $c->profil->path->shared . '/temp/cache' );
|
||||
$backend = array( 'cache_dir' => $c->profil->path->shared . '/cache' );
|
||||
$this->cache = Zend_Cache::factory('Core', 'File', $frontend, $backend);
|
||||
}
|
||||
|
||||
@ -137,7 +147,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
|
||||
}
|
||||
|
||||
$methodConfig = $this->config[$name];
|
||||
Zend_Registry::get('firebug')->info($methodConfig);
|
||||
$this->logger->info(print_r($methodConfig,1));
|
||||
// --- Cache
|
||||
$cacheEnable = false;
|
||||
if ( array_key_exists('cache', $methodConfig) ) {
|
||||
@ -162,8 +172,8 @@ class Scores_Ws_Client extends Zend_Soap_Client
|
||||
|
||||
// --- Debug
|
||||
if ( array_key_exists('debug', $methodConfig) ) {
|
||||
Zend_Registry::get('firebug')->info(__CLASS__.'->'.$name);
|
||||
Zend_Registry::get('firebug')->info($arguments);
|
||||
$this->logger->info(__CLASS__.'->'.$name);
|
||||
$this->logger->info(print_r($arguments,1));
|
||||
}
|
||||
|
||||
try {
|
||||
@ -172,7 +182,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
|
||||
|
||||
// --- Debug
|
||||
if ( array_key_exists('debug', $methodConfig) ) {
|
||||
Zend_Registry::get('firebug')->info($response);
|
||||
$this->logger->info(print_r($response,1));
|
||||
}
|
||||
|
||||
// --- Cache
|
||||
@ -186,13 +196,13 @@ class Scores_Ws_Client extends Zend_Soap_Client
|
||||
|
||||
// --- Debug
|
||||
if ( array_key_exists('debug', $methodConfig) ) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.' - '.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.' - '.$fault->faultstring);
|
||||
}
|
||||
|
||||
// --- Gestion des SOAP fault
|
||||
if ( array_key_exists('errorMsg', $methodConfig) ) {
|
||||
if ( in_array($fault->faultcode, $methodConfig['errorMsg']) ) {
|
||||
Zend_Registry::get('firebug')->info("Exception as error message : ".$fault->faultcode);
|
||||
$this->logger->info("Exception as error message : ".$fault->faultcode);
|
||||
throw new Exception($fault->faultstring);
|
||||
}
|
||||
}
|
||||
@ -221,7 +231,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
|
||||
$mail = new Scores_Mail_Method();
|
||||
$mail->setSubject('[ERREUR SOAP] - '.$c->profil->server->name.' -'.date('Ymd'));
|
||||
$mail->setBodyTextC($message);
|
||||
$mail->setFromKey('supportdev');
|
||||
$mail->setFromKey('contact');
|
||||
$mail->addToKey('supportdev');
|
||||
$mail->execute();
|
||||
}
|
||||
|
@ -1,5 +1,12 @@
|
||||
<?php
|
||||
return array(
|
||||
'0.8' => array(
|
||||
'getBilan' => array(
|
||||
'errorMsg' => array('MSG'),
|
||||
'debug' => true,
|
||||
'log' => 'mail',
|
||||
),
|
||||
),
|
||||
'0.9' => array(
|
||||
'getGreffeAffaireList' => array(
|
||||
'debug' => true,
|
||||
|
@ -5,5 +5,20 @@ return array(
|
||||
'debug' => true,
|
||||
'log' => 'mail',
|
||||
),
|
||||
'dupliqueAnnonce' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
'log' => 'mail',
|
||||
),
|
||||
'setRib' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
'log' => 'mail',
|
||||
),
|
||||
'getRib' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
'log' => 'mail',
|
||||
),
|
||||
)
|
||||
);
|
@ -39,6 +39,12 @@ class WsScores
|
||||
*/
|
||||
protected $cacheWrite = true;
|
||||
|
||||
/**
|
||||
* Logger
|
||||
* @var \Monolog\Logger
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
/**
|
||||
* Load WebService config
|
||||
* @param string $login
|
||||
@ -46,6 +52,10 @@ class WsScores
|
||||
*/
|
||||
public function __construct($login = '', $password = '')
|
||||
{
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$this->logger = Zend_Registry::get('logger');
|
||||
}
|
||||
|
||||
$c = new Zend_Config_Ini(realpath(dirname(__FILE__)) . '/webservices.ini');
|
||||
$config = $c->toArray();
|
||||
$this->webservices = $config['webservices'];
|
||||
@ -93,7 +103,7 @@ class WsScores
|
||||
try {
|
||||
$client = new SoapClient($wsdl, $options);
|
||||
} catch (Exception $e) {
|
||||
Zend_Registry::get('firebug')->info($e->getMessage());
|
||||
$this->logger->info($e->getMessage());
|
||||
throw new Exception('Application Error');
|
||||
}
|
||||
return $client;
|
||||
@ -112,7 +122,7 @@ class WsScores
|
||||
$reponse = $client->setBilanEnterCmd($params);
|
||||
return $reponse->setBilanEnterCmdResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
@ -127,7 +137,7 @@ class WsScores
|
||||
$reponse = $client->getLiasseInfos($params);
|
||||
return $reponse->getLiasseInfosResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -151,7 +161,7 @@ class WsScores
|
||||
$reponse = $client->setContactEt($params);
|
||||
return $reponse->setContactEtResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
}
|
||||
}
|
||||
@ -165,7 +175,7 @@ class WsScores
|
||||
$reponse = $client->getContactEt($params);
|
||||
return $reponse->getContactEtResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
}
|
||||
}
|
||||
@ -198,7 +208,7 @@ class WsScores
|
||||
}
|
||||
return $reponse->getContactEtResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -305,7 +315,7 @@ class WsScores
|
||||
$reponse = $client->setSurveillancesMail($params);
|
||||
return $reponse->setSurveillancesMailResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -325,7 +335,7 @@ class WsScores
|
||||
$reponse = $client->setUserService($params);
|
||||
return $reponse->setUserServiceResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -446,7 +456,7 @@ class WsScores
|
||||
$reponse = $client->setLienChange($params);
|
||||
return $reponse->setLienChangeResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -486,7 +496,7 @@ class WsScores
|
||||
$reponse = $client->setScoreCutoff($params);
|
||||
return $reponse->setScoreCutoffResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
}
|
||||
}
|
||||
@ -505,7 +515,7 @@ class WsScores
|
||||
$reponse = $client->getScoreCutoff($params);
|
||||
return $reponse->getScoreCutoffResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
}
|
||||
}
|
||||
@ -524,7 +534,7 @@ class WsScores
|
||||
$reponse = $client->delScoreCutoff($params); //change name when webservice is ready
|
||||
return $reponse->delScoreCutoffResult; //change name when webservice is ready
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
}
|
||||
}
|
||||
@ -539,7 +549,7 @@ class WsScores
|
||||
$reponse = $client->searchLogin($params);
|
||||
return $reponse->searchLoginResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
@ -562,7 +572,7 @@ class WsScores
|
||||
$cache->setBlock($reponse->getCurrencyResult);
|
||||
return $reponse->getCurrencyResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
@ -591,7 +601,7 @@ class WsScores
|
||||
$cache->setBlock($reponse->getCountryResult);
|
||||
return $reponse->getCountryResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
@ -607,7 +617,7 @@ class WsScores
|
||||
$reponse = $client->setBourse($params);
|
||||
return $reponse->setBourseResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -626,7 +636,7 @@ class WsScores
|
||||
$reponse = $client->getBourse($params);
|
||||
return $reponse->getBourseResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -647,7 +657,7 @@ class WsScores
|
||||
$reponse = $client->setService($params);
|
||||
return $reponse->setServiceResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -665,10 +675,10 @@ class WsScores
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getServiceUsers($params);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
return $reponse->getServiceUsersResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -687,7 +697,7 @@ class WsScores
|
||||
$reponse = $client->getServices($params);
|
||||
return $reponse->getServicesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -706,7 +716,7 @@ class WsScores
|
||||
$reponse = $client->getCountryId($params);
|
||||
return $reponse->getCountryIdResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -725,7 +735,7 @@ class WsScores
|
||||
$reponse = $client->getLien($params);
|
||||
return $reponse->getLienResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -746,7 +756,7 @@ class WsScores
|
||||
$reponse = $client->getLienDoc($params);
|
||||
return $reponse->getLienDocResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
@ -762,7 +772,7 @@ class WsScores
|
||||
$reponse = $client->setLienDoc($params);
|
||||
return $reponse->setLienDocResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
@ -778,7 +788,7 @@ class WsScores
|
||||
$reponse = $client->setLien($params);
|
||||
return $reponse->setLienResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -797,7 +807,7 @@ class WsScores
|
||||
$reponse = $client->getLienRef($params);
|
||||
return $reponse->getLienRefResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -816,7 +826,7 @@ class WsScores
|
||||
$reponse = $client->getLienRef($params);
|
||||
return $reponse->getLienRefResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -836,7 +846,7 @@ class WsScores
|
||||
$reponse = $client->setLienRef($params);
|
||||
return $reponse->setLienRefResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -856,7 +866,7 @@ class WsScores
|
||||
$reponse = $client->searchLienRef($params);
|
||||
return $reponse->searchLienRefResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -879,7 +889,7 @@ class WsScores
|
||||
$reponse = $client->setActeAsso($params);
|
||||
return $reponse->setActeAssoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -908,7 +918,7 @@ class WsScores
|
||||
$reponse = $client->setBilan($params);
|
||||
return $reponse->setBilanResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -938,7 +948,7 @@ class WsScores
|
||||
$reponse = $client->getBilans($params);
|
||||
return $reponse->getBilansResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
@ -963,10 +973,10 @@ class WsScores
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$reponse = $client->getBilan($params);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
return $reponse->getBilanResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
@ -986,10 +996,10 @@ class WsScores
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$reponse = $client->getActe($params);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
return $reponse->getActeResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
@ -1006,7 +1016,7 @@ class WsScores
|
||||
$reponse = $client->getActes($params);
|
||||
return $reponse->getActesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
@ -1025,7 +1035,7 @@ class WsScores
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
@ -1045,7 +1055,7 @@ class WsScores
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
@ -1065,7 +1075,7 @@ class WsScores
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
@ -1079,7 +1089,7 @@ class WsScores
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->setCGU($params);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
return $reponse->setCGUResult;
|
||||
} catch(SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
@ -1119,7 +1129,7 @@ class WsScores
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getEmail($params);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
return $reponse->getEmailResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
@ -1229,7 +1239,7 @@ class WsScores
|
||||
return $reponse->getKbisResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('0000', 'MSG')) ){
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
@ -1678,7 +1688,7 @@ class WsScores
|
||||
$reponse = $client->setMandataire($params);
|
||||
return $reponse->setMandataireResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -2329,7 +2339,7 @@ class WsScores
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesLegales($params);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getAnnoncesLegalesResult);
|
||||
@ -2447,24 +2457,11 @@ class WsScores
|
||||
*/
|
||||
public function getListeBilans($siren)
|
||||
{
|
||||
$filename = 'listebilans-'.$siren;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new StdClass;
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getListeBilans($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getListeBilansResult);
|
||||
}
|
||||
return $reponse->getListeBilansResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
@ -2582,25 +2579,12 @@ class WsScores
|
||||
*/
|
||||
public function getRatios($siren, $page = 'ratios')
|
||||
{
|
||||
$filename = 'ratios-'.$siren.'-'.$page;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new StdClass();
|
||||
$params->siren = $siren;
|
||||
$params->page = $page;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getRatios($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getRatiosResult);
|
||||
}
|
||||
return $reponse->getRatiosResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
@ -2689,7 +2673,7 @@ class WsScores
|
||||
$reponse = $client->setDirigeantsOp($params);
|
||||
return $reponse->setDirigeantsOpResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -2726,7 +2710,7 @@ class WsScores
|
||||
}
|
||||
return $reponse->getAvisRncsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
@ -3118,7 +3102,7 @@ class WsScores
|
||||
return $reponse->setCmdAssoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
Zend_Registry::get('firebug')->info($fault);
|
||||
$this->logger->info(print_r($fault,1));
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
@ -3171,7 +3155,7 @@ class WsScores
|
||||
return $fault->getMessage();
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
Zend_Registry::get('firebug')->info($fault);
|
||||
$this->logger->info(print_r($fault,1));
|
||||
//Placer exception pour affichage message
|
||||
|
||||
return false;
|
||||
@ -3235,11 +3219,11 @@ class WsScores
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->getNextLogin($params);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
return $reponse->getNextLoginResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
Zend_Registry::get('firebug')->info($fault);
|
||||
$this->logger->info(print_r($fault,1));
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
@ -3372,13 +3356,13 @@ class WsScores
|
||||
$message.= "Reponse :\n ".$reponse."\n";
|
||||
|
||||
if (APPLICATION_ENV == 'development' ) {
|
||||
Zend_Registry::get('firebug')->info('Erreur SOAP - Code : '.$fault->faultcode.' - Message : '.$fault->faultstring);
|
||||
$this->logger->info('Erreur SOAP - Code : '.$fault->faultcode.' - Message : '.$fault->faultstring);
|
||||
} else {
|
||||
$c = Zend_Registry::get('config');
|
||||
$mail = new Scores_Mail_Method();
|
||||
$mail->setSubject('[ERREUR SOAP] - '.$c->profil->server->name.' -'.date('Ymd'));
|
||||
$mail->setBodyTextC($message);
|
||||
$mail->setFromKey('supportdev');
|
||||
$mail->setFromKey('support');
|
||||
$mail->addToKey('supportdev');
|
||||
$mail->execute();
|
||||
}
|
||||
|
@ -1,114 +0,0 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.5.2
|
||||
//
|
||||
// Copyright 2004-2014 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
/**
|
||||
* Class FilterASCII85
|
||||
*/
|
||||
class FilterASCII85
|
||||
{
|
||||
/**
|
||||
* Decode ASCII85 encoded string
|
||||
*
|
||||
* @param string $in
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*/
|
||||
public function decode($in)
|
||||
{
|
||||
$ord = array(
|
||||
'~' => ord('~'),
|
||||
'z' => ord('z'),
|
||||
'u' => ord('u'),
|
||||
'z' => ord('z'),
|
||||
'!' => ord('!')
|
||||
);
|
||||
|
||||
$out = '';
|
||||
$state = 0;
|
||||
$chn = null;
|
||||
|
||||
$l = strlen($in);
|
||||
|
||||
for ($k = 0; $k < $l; ++$k) {
|
||||
$ch = ord($in[$k]) & 0xff;
|
||||
|
||||
if ($ch == $ord['~']) {
|
||||
break;
|
||||
}
|
||||
if (preg_match('/^\s$/',chr($ch))) {
|
||||
continue;
|
||||
}
|
||||
if ($ch == $ord['z'] && $state == 0) {
|
||||
$out .= chr(0) . chr(0) . chr(0) . chr(0);
|
||||
continue;
|
||||
}
|
||||
if ($ch < $ord['!'] || $ch > $ord['u']) {
|
||||
throw new Exception('Illegal character in ASCII85Decode.');
|
||||
}
|
||||
|
||||
$chn[$state++] = $ch - $ord['!'];
|
||||
|
||||
if ($state == 5) {
|
||||
$state = 0;
|
||||
$r = 0;
|
||||
for ($j = 0; $j < 5; ++$j)
|
||||
$r = $r * 85 + $chn[$j];
|
||||
$out .= chr($r >> 24);
|
||||
$out .= chr($r >> 16);
|
||||
$out .= chr($r >> 8);
|
||||
$out .= chr($r);
|
||||
}
|
||||
}
|
||||
$r = 0;
|
||||
|
||||
if ($state == 1) {
|
||||
throw new Exception('Illegal length in ASCII85Decode.');
|
||||
}
|
||||
|
||||
if ($state == 2) {
|
||||
$r = $chn[0] * 85 * 85 * 85 * 85 + ($chn[1]+1) * 85 * 85 * 85;
|
||||
$out .= chr($r >> 24);
|
||||
|
||||
} else if ($state == 3) {
|
||||
$r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + ($chn[2]+1) * 85 * 85;
|
||||
$out .= chr($r >> 24);
|
||||
$out .= chr($r >> 16);
|
||||
|
||||
} else if ($state == 4) {
|
||||
$r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + $chn[2] * 85 * 85 + ($chn[3]+1) * 85 ;
|
||||
$out .= chr($r >> 24);
|
||||
$out .= chr($r >> 16);
|
||||
$out .= chr($r >> 8);
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* NOT IMPLEMENTED
|
||||
*
|
||||
* @param string $in
|
||||
* @return string
|
||||
* @throws LogicException
|
||||
*/
|
||||
public function encode($in)
|
||||
{
|
||||
throw new LogicException("ASCII85 encoding not implemented.");
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.5.2
|
||||
//
|
||||
// Copyright 2004-2014 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
/**
|
||||
* Class FilterASCIIHexDecode
|
||||
*/
|
||||
class FilterASCIIHexDecode
|
||||
{
|
||||
/**
|
||||
* Converts an ASCII hexadecimal encoded string into it's binary representation.
|
||||
*
|
||||
* @param string $data The input string
|
||||
* @return string
|
||||
*/
|
||||
public function decode($data)
|
||||
{
|
||||
$data = preg_replace('/[^0-9A-Fa-f]/', '', rtrim($data, '>'));
|
||||
if ((strlen($data) % 2) == 1) {
|
||||
$data .= '0';
|
||||
}
|
||||
|
||||
return pack('H*', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a string into ASCII hexadecimal representation.
|
||||
*
|
||||
* @param string $data The input string
|
||||
* @param boolean $leaveEOD
|
||||
* @return string
|
||||
*/
|
||||
public function encode($data, $leaveEOD = false)
|
||||
{
|
||||
return current(unpack('H*', $data)) . ($leaveEOD ? '' : '>');
|
||||
}
|
||||
}
|
@ -1,173 +0,0 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.5.2
|
||||
//
|
||||
// Copyright 2004-2014 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
/**
|
||||
* Class FilterLZW
|
||||
*/
|
||||
class FilterLZW
|
||||
{
|
||||
protected $_sTable = array();
|
||||
protected $_data = null;
|
||||
protected $_dataLength = 0;
|
||||
protected $_tIdx;
|
||||
protected $_bitsToGet = 9;
|
||||
protected $_bytePointer;
|
||||
protected $_bitPointer;
|
||||
protected $_nextData = 0;
|
||||
protected $_nextBits = 0;
|
||||
protected $_andTable = array(511, 1023, 2047, 4095);
|
||||
|
||||
/**
|
||||
* Decodes LZW compressed data.
|
||||
*
|
||||
* @param string $data The compressed data.
|
||||
* @throws Exception
|
||||
* @return string
|
||||
*/
|
||||
public function decode($data)
|
||||
{
|
||||
if ($data[0] == 0x00 && $data[1] == 0x01) {
|
||||
throw new Exception('LZW flavour not supported.');
|
||||
}
|
||||
|
||||
$this->_initsTable();
|
||||
|
||||
$this->_data = $data;
|
||||
$this->_dataLength = strlen($data);
|
||||
|
||||
// Initialize pointers
|
||||
$this->_bytePointer = 0;
|
||||
$this->_bitPointer = 0;
|
||||
|
||||
$this->_nextData = 0;
|
||||
$this->_nextBits = 0;
|
||||
|
||||
$oldCode = 0;
|
||||
|
||||
$unCompData = '';
|
||||
|
||||
while (($code = $this->_getNextCode()) != 257) {
|
||||
if ($code == 256) {
|
||||
$this->_initsTable();
|
||||
$code = $this->_getNextCode();
|
||||
|
||||
if ($code == 257) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!isset($this->_sTable[$code])) {
|
||||
throw new Exception('Error while decompression LZW compressed data.');
|
||||
}
|
||||
|
||||
$unCompData .= $this->_sTable[$code];
|
||||
$oldCode = $code;
|
||||
|
||||
} else {
|
||||
|
||||
if ($code < $this->_tIdx) {
|
||||
$string = $this->_sTable[$code];
|
||||
$unCompData .= $string;
|
||||
|
||||
$this->_addStringToTable($this->_sTable[$oldCode], $string[0]);
|
||||
$oldCode = $code;
|
||||
} else {
|
||||
$string = $this->_sTable[$oldCode];
|
||||
$string = $string . $string[0];
|
||||
$unCompData .= $string;
|
||||
|
||||
$this->_addStringToTable($string);
|
||||
$oldCode = $code;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $unCompData;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the string table.
|
||||
*/
|
||||
protected function _initsTable()
|
||||
{
|
||||
$this->_sTable = array();
|
||||
|
||||
for ($i = 0; $i < 256; $i++)
|
||||
$this->_sTable[$i] = chr($i);
|
||||
|
||||
$this->_tIdx = 258;
|
||||
$this->_bitsToGet = 9;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new string to the string table.
|
||||
*/
|
||||
protected function _addStringToTable($oldString, $newString = '')
|
||||
{
|
||||
$string = $oldString . $newString;
|
||||
|
||||
// Add this new String to the table
|
||||
$this->_sTable[$this->_tIdx++] = $string;
|
||||
|
||||
if ($this->_tIdx == 511) {
|
||||
$this->_bitsToGet = 10;
|
||||
} else if ($this->_tIdx == 1023) {
|
||||
$this->_bitsToGet = 11;
|
||||
} else if ($this->_tIdx == 2047) {
|
||||
$this->_bitsToGet = 12;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the next 9, 10, 11 or 12 bits
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected function _getNextCode()
|
||||
{
|
||||
if ($this->_bytePointer == $this->_dataLength) {
|
||||
return 257;
|
||||
}
|
||||
|
||||
$this->_nextData = ($this->_nextData << 8) | (ord($this->_data[$this->_bytePointer++]) & 0xff);
|
||||
$this->_nextBits += 8;
|
||||
|
||||
if ($this->_nextBits < $this->_bitsToGet) {
|
||||
$this->_nextData = ($this->_nextData << 8) | (ord($this->_data[$this->_bytePointer++]) & 0xff);
|
||||
$this->_nextBits += 8;
|
||||
}
|
||||
|
||||
$code = ($this->_nextData >> ($this->_nextBits - $this->_bitsToGet)) & $this->_andTable[$this->_bitsToGet-9];
|
||||
$this->_nextBits -= $this->_bitsToGet;
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
/**
|
||||
* NOT IMPLEMENTED
|
||||
*
|
||||
* @param string $in
|
||||
* @return string
|
||||
* @throws LogicException
|
||||
*/
|
||||
public function encode($in)
|
||||
{
|
||||
throw new LogicException("LZW encoding not implemented.");
|
||||
}
|
||||
}
|
@ -1,555 +0,0 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.5.2
|
||||
//
|
||||
// Copyright 2004-2014 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
require_once('fpdi_bridge.php');
|
||||
|
||||
/**
|
||||
* Class FPDF_TPL
|
||||
*/
|
||||
class FPDF_TPL extends fpdi_bridge
|
||||
{
|
||||
/**
|
||||
* Array of template data
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_tpls = array();
|
||||
|
||||
/**
|
||||
* Current Template-Id
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $tpl = 0;
|
||||
|
||||
/**
|
||||
* "In Template"-Flag
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_inTpl = false;
|
||||
|
||||
/**
|
||||
* Name prefix of templates used in Resources dictionary
|
||||
*
|
||||
* @var string A String defining the Prefix used as Template-Object-Names. Have to begin with an /
|
||||
*/
|
||||
public $tplPrefix = "/TPL";
|
||||
|
||||
/**
|
||||
* Resources used by templates and pages
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_res = array();
|
||||
|
||||
/**
|
||||
* Last used template data
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $lastUsedTemplateData = array();
|
||||
|
||||
/**
|
||||
* Start a template.
|
||||
*
|
||||
* This method starts a template. You can give own coordinates to build an own sized
|
||||
* template. Pay attention, that the margins are adapted to the new template size.
|
||||
* If you want to write outside the template, for example to build a clipped template,
|
||||
* you have to set the margins and "cursor"-position manual after beginTemplate()-call.
|
||||
*
|
||||
* If no parameter is given, the template uses the current page-size.
|
||||
* The method returns an id of the current template. This id is used later for using this template.
|
||||
* Warning: A created template is saved in the resulting PDF at all events. Also if you don't use it after creation!
|
||||
*
|
||||
* @param int $x The x-coordinate given in user-unit
|
||||
* @param int $y The y-coordinate given in user-unit
|
||||
* @param int $w The width given in user-unit
|
||||
* @param int $h The height given in user-unit
|
||||
* @return int The id of new created template
|
||||
* @throws LogicException
|
||||
*/
|
||||
public function beginTemplate($x = null, $y = null, $w = null, $h = null)
|
||||
{
|
||||
if (is_subclass_of($this, 'TCPDF')) {
|
||||
throw new LogicException('This method is only usable with FPDF. Use TCPDF methods startTemplate() instead.');
|
||||
}
|
||||
|
||||
if ($this->page <= 0) {
|
||||
throw new LogicException("You have to add at least a page first!");
|
||||
}
|
||||
|
||||
if ($x == null)
|
||||
$x = 0;
|
||||
if ($y == null)
|
||||
$y = 0;
|
||||
if ($w == null)
|
||||
$w = $this->w;
|
||||
if ($h == null)
|
||||
$h = $this->h;
|
||||
|
||||
// Save settings
|
||||
$this->tpl++;
|
||||
$tpl =& $this->_tpls[$this->tpl];
|
||||
$tpl = array(
|
||||
'o_x' => $this->x,
|
||||
'o_y' => $this->y,
|
||||
'o_AutoPageBreak' => $this->AutoPageBreak,
|
||||
'o_bMargin' => $this->bMargin,
|
||||
'o_tMargin' => $this->tMargin,
|
||||
'o_lMargin' => $this->lMargin,
|
||||
'o_rMargin' => $this->rMargin,
|
||||
'o_h' => $this->h,
|
||||
'o_w' => $this->w,
|
||||
'o_FontFamily' => $this->FontFamily,
|
||||
'o_FontStyle' => $this->FontStyle,
|
||||
'o_FontSizePt' => $this->FontSizePt,
|
||||
'o_FontSize' => $this->FontSize,
|
||||
'buffer' => '',
|
||||
'x' => $x,
|
||||
'y' => $y,
|
||||
'w' => $w,
|
||||
'h' => $h
|
||||
);
|
||||
|
||||
$this->SetAutoPageBreak(false);
|
||||
|
||||
// Define own high and width to calculate correct positions
|
||||
$this->h = $h;
|
||||
$this->w = $w;
|
||||
|
||||
$this->_inTpl = true;
|
||||
$this->SetXY($x + $this->lMargin, $y + $this->tMargin);
|
||||
$this->SetRightMargin($this->w - $w + $this->rMargin);
|
||||
|
||||
if ($this->CurrentFont) {
|
||||
$fontKey = $this->FontFamily . $this->FontStyle;
|
||||
if ($fontKey) {
|
||||
$this->_res['tpl'][$this->tpl]['fonts'][$fontKey] =& $this->fonts[$fontKey];
|
||||
$this->_out(sprintf('BT /F%d %.2F Tf ET', $this->CurrentFont['i'], $this->FontSizePt));
|
||||
}
|
||||
}
|
||||
|
||||
return $this->tpl;
|
||||
}
|
||||
|
||||
/**
|
||||
* End template.
|
||||
*
|
||||
* This method ends a template and reset initiated variables collected in {@link beginTemplate()}.
|
||||
*
|
||||
* @return int|boolean If a template is opened, the id is returned. If not a false is returned.
|
||||
*/
|
||||
public function endTemplate()
|
||||
{
|
||||
if (is_subclass_of($this, 'TCPDF')) {
|
||||
$args = func_get_args();
|
||||
return call_user_func_array(array($this, 'TCPDF::endTemplate'), $args);
|
||||
}
|
||||
|
||||
if ($this->_inTpl) {
|
||||
$this->_inTpl = false;
|
||||
$tpl = $this->_tpls[$this->tpl];
|
||||
$this->SetXY($tpl['o_x'], $tpl['o_y']);
|
||||
$this->tMargin = $tpl['o_tMargin'];
|
||||
$this->lMargin = $tpl['o_lMargin'];
|
||||
$this->rMargin = $tpl['o_rMargin'];
|
||||
$this->h = $tpl['o_h'];
|
||||
$this->w = $tpl['o_w'];
|
||||
$this->SetAutoPageBreak($tpl['o_AutoPageBreak'], $tpl['o_bMargin']);
|
||||
|
||||
$this->FontFamily = $tpl['o_FontFamily'];
|
||||
$this->FontStyle = $tpl['o_FontStyle'];
|
||||
$this->FontSizePt = $tpl['o_FontSizePt'];
|
||||
$this->FontSize = $tpl['o_FontSize'];
|
||||
|
||||
$fontKey = $this->FontFamily . $this->FontStyle;
|
||||
if ($fontKey)
|
||||
$this->CurrentFont =& $this->fonts[$fontKey];
|
||||
|
||||
return $this->tpl;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Use a template in current page or other template.
|
||||
*
|
||||
* You can use a template in a page or in another template.
|
||||
* You can give the used template a new size.
|
||||
* All parameters are optional. The width or height is calculated automatically
|
||||
* if one is given. If no parameter is given the origin size as defined in
|
||||
* {@link beginTemplate()} method is used.
|
||||
*
|
||||
* The calculated or used width and height are returned as an array.
|
||||
*
|
||||
* @param int $tplIdx A valid template-id
|
||||
* @param int $x The x-position
|
||||
* @param int $y The y-position
|
||||
* @param int $w The new width of the template
|
||||
* @param int $h The new height of the template
|
||||
* @return array The height and width of the template (array('w' => ..., 'h' => ...))
|
||||
* @throws LogicException|InvalidArgumentException
|
||||
*/
|
||||
public function useTemplate($tplIdx, $x = null, $y = null, $w = 0, $h = 0)
|
||||
{
|
||||
if ($this->page <= 0) {
|
||||
throw new LogicException('You have to add at least a page first!');
|
||||
}
|
||||
|
||||
if (!isset($this->_tpls[$tplIdx])) {
|
||||
throw new InvalidArgumentException('Template does not exist!');
|
||||
}
|
||||
|
||||
if ($this->_inTpl) {
|
||||
$this->_res['tpl'][$this->tpl]['tpls'][$tplIdx] =& $this->_tpls[$tplIdx];
|
||||
}
|
||||
|
||||
$tpl = $this->_tpls[$tplIdx];
|
||||
$_w = $tpl['w'];
|
||||
$_h = $tpl['h'];
|
||||
|
||||
if ($x == null) {
|
||||
$x = 0;
|
||||
}
|
||||
|
||||
if ($y == null) {
|
||||
$y = 0;
|
||||
}
|
||||
|
||||
$x += $tpl['x'];
|
||||
$y += $tpl['y'];
|
||||
|
||||
$wh = $this->getTemplateSize($tplIdx, $w, $h);
|
||||
$w = $wh['w'];
|
||||
$h = $wh['h'];
|
||||
|
||||
$tplData = array(
|
||||
'x' => $this->x,
|
||||
'y' => $this->y,
|
||||
'w' => $w,
|
||||
'h' => $h,
|
||||
'scaleX' => ($w / $_w),
|
||||
'scaleY' => ($h / $_h),
|
||||
'tx' => $x,
|
||||
'ty' => ($this->h - $y - $h),
|
||||
'lty' => ($this->h - $y - $h) - ($this->h - $_h) * ($h / $_h)
|
||||
);
|
||||
|
||||
$this->_out(sprintf('q %.4F 0 0 %.4F %.4F %.4F cm',
|
||||
$tplData['scaleX'], $tplData['scaleY'], $tplData['tx'] * $this->k, $tplData['ty'] * $this->k)
|
||||
); // Translate
|
||||
$this->_out(sprintf('%s%d Do Q', $this->tplPrefix, $tplIdx));
|
||||
|
||||
$this->lastUsedTemplateData = $tplData;
|
||||
|
||||
return array('w' => $w, 'h' => $h);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the calculated size of a template.
|
||||
*
|
||||
* If one size is given, this method calculates the other one.
|
||||
*
|
||||
* @param int $tplIdx A valid template-id
|
||||
* @param int $w The width of the template
|
||||
* @param int $h The height of the template
|
||||
* @return array The height and width of the template (array('w' => ..., 'h' => ...))
|
||||
*/
|
||||
public function getTemplateSize($tplIdx, $w = 0, $h = 0)
|
||||
{
|
||||
if (!isset($this->_tpls[$tplIdx]))
|
||||
return false;
|
||||
|
||||
$tpl = $this->_tpls[$tplIdx];
|
||||
$_w = $tpl['w'];
|
||||
$_h = $tpl['h'];
|
||||
|
||||
if ($w == 0 && $h == 0) {
|
||||
$w = $_w;
|
||||
$h = $_h;
|
||||
}
|
||||
|
||||
if ($w == 0)
|
||||
$w = $h * $_w / $_h;
|
||||
if($h == 0)
|
||||
$h = $w * $_h / $_w;
|
||||
|
||||
return array("w" => $w, "h" => $h);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the font used to print character strings.
|
||||
*
|
||||
* See FPDF/TCPDF documentation.
|
||||
*
|
||||
* @see http://fpdf.org/en/doc/setfont.htm
|
||||
* @see http://www.tcpdf.org/doc/code/classTCPDF.html#afd56e360c43553830d543323e81bc045
|
||||
*/
|
||||
public function SetFont($family, $style = '', $size = null, $fontfile = '', $subset = 'default', $out = true)
|
||||
{
|
||||
if (is_subclass_of($this, 'TCPDF')) {
|
||||
$args = func_get_args();
|
||||
return call_user_func_array(array($this, 'TCPDF::SetFont'), $args);
|
||||
}
|
||||
|
||||
parent::SetFont($family, $style, $size);
|
||||
|
||||
$fontkey = $this->FontFamily . $this->FontStyle;
|
||||
|
||||
if ($this->_inTpl) {
|
||||
$this->_res['tpl'][$this->tpl]['fonts'][$fontkey] =& $this->fonts[$fontkey];
|
||||
} else {
|
||||
$this->_res['page'][$this->page]['fonts'][$fontkey] =& $this->fonts[$fontkey];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Puts an image.
|
||||
*
|
||||
* See FPDF/TCPDF documentation.
|
||||
*
|
||||
* @see http://fpdf.org/en/doc/image.htm
|
||||
* @see http://www.tcpdf.org/doc/code/classTCPDF.html#a714c2bee7d6b39d4d6d304540c761352
|
||||
*/
|
||||
public function Image(
|
||||
$file, $x = '', $y = '', $w = 0, $h = 0, $type = '', $link = '', $align = '', $resize = false,
|
||||
$dpi = 300, $palign = '', $ismask = false, $imgmask = false, $border = 0, $fitbox = false,
|
||||
$hidden = false, $fitonpage = false, $alt = false, $altimgs = array()
|
||||
)
|
||||
{
|
||||
if (is_subclass_of($this, 'TCPDF')) {
|
||||
$args = func_get_args();
|
||||
return call_user_func_array(array($this, 'TCPDF::Image'), $args);
|
||||
}
|
||||
|
||||
$ret = parent::Image($file, $x, $y, $w, $h, $type, $link);
|
||||
if ($this->_inTpl) {
|
||||
$this->_res['tpl'][$this->tpl]['images'][$file] =& $this->images[$file];
|
||||
} else {
|
||||
$this->_res['page'][$this->page]['images'][$file] =& $this->images[$file];
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new page to the document.
|
||||
*
|
||||
* See FPDF/TCPDF documentation.
|
||||
*
|
||||
* This method cannot be used if you'd started a template.
|
||||
*
|
||||
* @see http://fpdf.org/en/doc/addpage.htm
|
||||
* @see http://www.tcpdf.org/doc/code/classTCPDF.html#a5171e20b366b74523709d84c349c1ced
|
||||
*/
|
||||
public function AddPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false)
|
||||
{
|
||||
if (is_subclass_of($this, 'TCPDF')) {
|
||||
$args = func_get_args();
|
||||
return call_user_func_array(array($this, 'TCPDF::AddPage'), $args);
|
||||
}
|
||||
|
||||
if ($this->_inTpl) {
|
||||
throw new LogicException('Adding pages in templates is not possible!');
|
||||
}
|
||||
|
||||
parent::AddPage($orientation, $format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Puts a link on a rectangular area of the page.
|
||||
*
|
||||
* Overwritten because adding links in a template will not work.
|
||||
*
|
||||
* @see http://fpdf.org/en/doc/link.htm
|
||||
* @see http://www.tcpdf.org/doc/code/classTCPDF.html#ab87bf1826384fbfe30eb499d42f1d994
|
||||
*/
|
||||
public function Link($x, $y, $w, $h, $link, $spaces = 0)
|
||||
{
|
||||
if (is_subclass_of($this, 'TCPDF')) {
|
||||
$args = func_get_args();
|
||||
return call_user_func_array(array($this, 'TCPDF::Link'), $args);
|
||||
}
|
||||
|
||||
if ($this->_inTpl) {
|
||||
throw new LogicException('Using links in templates is not posible!');
|
||||
}
|
||||
|
||||
parent::Link($x, $y, $w, $h, $link);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new internal link and returns its identifier.
|
||||
*
|
||||
* Overwritten because adding links in a template will not work.
|
||||
*
|
||||
* @see http://fpdf.org/en/doc/addlink.htm
|
||||
* @see http://www.tcpdf.org/doc/code/classTCPDF.html#a749522038ed7786c3e1701435dcb891e
|
||||
*/
|
||||
public function AddLink()
|
||||
{
|
||||
if (is_subclass_of($this, 'TCPDF')) {
|
||||
$args = func_get_args();
|
||||
return call_user_func_array(array($this, 'TCPDF::AddLink'), $args);
|
||||
}
|
||||
|
||||
if ($this->_inTpl) {
|
||||
throw new LogicException('Adding links in templates is not possible!');
|
||||
}
|
||||
|
||||
return parent::AddLink();
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the page and position a link points to.
|
||||
*
|
||||
* Overwritten because adding links in a template will not work.
|
||||
*
|
||||
* @see http://fpdf.org/en/doc/setlink.htm
|
||||
* @see http://www.tcpdf.org/doc/code/classTCPDF.html#ace5be60e7857953ea5e2b89cb90df0ae
|
||||
*/
|
||||
public function SetLink($link, $y = 0, $page = -1)
|
||||
{
|
||||
if (is_subclass_of($this, 'TCPDF')) {
|
||||
$args = func_get_args();
|
||||
return call_user_func_array(array($this, 'TCPDF::SetLink'), $args);
|
||||
}
|
||||
|
||||
if ($this->_inTpl) {
|
||||
throw new LogicException('Setting links in templates is not possible!');
|
||||
}
|
||||
|
||||
parent::SetLink($link, $y, $page);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the form XObjects to the PDF document.
|
||||
*/
|
||||
protected function _putformxobjects()
|
||||
{
|
||||
$filter=($this->compress) ? '/Filter /FlateDecode ' : '';
|
||||
reset($this->_tpls);
|
||||
|
||||
foreach($this->_tpls AS $tplIdx => $tpl) {
|
||||
$this->_newobj();
|
||||
$this->_tpls[$tplIdx]['n'] = $this->n;
|
||||
$this->_out('<<'.$filter.'/Type /XObject');
|
||||
$this->_out('/Subtype /Form');
|
||||
$this->_out('/FormType 1');
|
||||
$this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]',
|
||||
// llx
|
||||
$tpl['x'] * $this->k,
|
||||
// lly
|
||||
-$tpl['y'] * $this->k,
|
||||
// urx
|
||||
($tpl['w'] + $tpl['x']) * $this->k,
|
||||
// ury
|
||||
($tpl['h'] - $tpl['y']) * $this->k
|
||||
));
|
||||
|
||||
if ($tpl['x'] != 0 || $tpl['y'] != 0) {
|
||||
$this->_out(sprintf('/Matrix [1 0 0 1 %.5F %.5F]',
|
||||
-$tpl['x'] * $this->k * 2, $tpl['y'] * $this->k * 2
|
||||
));
|
||||
}
|
||||
|
||||
$this->_out('/Resources ');
|
||||
$this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
|
||||
|
||||
if (isset($this->_res['tpl'][$tplIdx])) {
|
||||
$res = $this->_res['tpl'][$tplIdx];
|
||||
if (isset($res['fonts']) && count($res['fonts'])) {
|
||||
$this->_out('/Font <<');
|
||||
|
||||
foreach($res['fonts'] as $font) {
|
||||
$this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R');
|
||||
}
|
||||
|
||||
$this->_out('>>');
|
||||
}
|
||||
|
||||
if(isset($res['images']) || isset($res['tpls'])) {
|
||||
$this->_out('/XObject <<');
|
||||
|
||||
if (isset($res['images'])) {
|
||||
foreach($res['images'] as $image)
|
||||
$this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R');
|
||||
}
|
||||
|
||||
if (isset($res['tpls'])) {
|
||||
foreach($res['tpls'] as $i => $_tpl)
|
||||
$this->_out($this->tplPrefix . $i . ' ' . $_tpl['n'] . ' 0 R');
|
||||
}
|
||||
|
||||
$this->_out('>>');
|
||||
}
|
||||
}
|
||||
|
||||
$this->_out('>>');
|
||||
|
||||
$buffer = ($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];
|
||||
$this->_out('/Length ' . strlen($buffer) . ' >>');
|
||||
$this->_putstream($buffer);
|
||||
$this->_out('endobj');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Output images.
|
||||
*
|
||||
* Overwritten to add {@link _putformxobjects()} after _putimages().
|
||||
*/
|
||||
public function _putimages()
|
||||
{
|
||||
parent::_putimages();
|
||||
$this->_putformxobjects();
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the references of XObject resources to the document.
|
||||
*
|
||||
* Overwritten to add the the templates to the XObject resource dictionary.
|
||||
*/
|
||||
public function _putxobjectdict()
|
||||
{
|
||||
parent::_putxobjectdict();
|
||||
|
||||
foreach($this->_tpls as $tplIdx => $tpl) {
|
||||
$this->_out(sprintf('%s%d %d 0 R', $this->tplPrefix, $tplIdx, $tpl['n']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes bytes to the resulting document.
|
||||
*
|
||||
* Overwritten to delegate the data to the template buffer.
|
||||
*
|
||||
* @param string $s
|
||||
*/
|
||||
public function _out($s)
|
||||
{
|
||||
if ($this->state == 2 && $this->_inTpl) {
|
||||
$this->_tpls[$this->tpl]['buffer'] .= $s . "\n";
|
||||
} else {
|
||||
parent::_out($s);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,695 +0,0 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.5.2
|
||||
//
|
||||
// Copyright 2004-2014 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
require_once('fpdf_tpl.php');
|
||||
|
||||
/**
|
||||
* Class FPDI
|
||||
*/
|
||||
class FPDI extends FPDF_TPL
|
||||
{
|
||||
/**
|
||||
* FPDI version
|
||||
*
|
||||
* @string
|
||||
*/
|
||||
const VERSION = '1.5.2';
|
||||
|
||||
/**
|
||||
* Actual filename
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $currentFilename;
|
||||
|
||||
/**
|
||||
* Parser-Objects
|
||||
*
|
||||
* @var fpdi_pdf_parser[]
|
||||
*/
|
||||
public $parsers = array();
|
||||
|
||||
/**
|
||||
* Current parser
|
||||
*
|
||||
* @var fpdi_pdf_parser
|
||||
*/
|
||||
public $currentParser;
|
||||
|
||||
/**
|
||||
* The name of the last imported page box
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $lastUsedPageBox;
|
||||
|
||||
/**
|
||||
* Object stack
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_objStack;
|
||||
|
||||
/**
|
||||
* Done object stack
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_doneObjStack;
|
||||
|
||||
/**
|
||||
* Current Object Id.
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_currentObjId;
|
||||
|
||||
/**
|
||||
* Cache for imported pages/template ids
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_importedPages = array();
|
||||
|
||||
/**
|
||||
* Set a source-file.
|
||||
*
|
||||
* Depending on the PDF version of the used document the PDF version of the resulting document will
|
||||
* be adjusted to the higher version.
|
||||
*
|
||||
* @param string $filename A valid path to the PDF document from which pages should be imported from
|
||||
* @return int The number of pages in the document
|
||||
*/
|
||||
public function setSourceFile($filename)
|
||||
{
|
||||
$_filename = realpath($filename);
|
||||
if (false !== $_filename)
|
||||
$filename = $_filename;
|
||||
|
||||
$this->currentFilename = $filename;
|
||||
|
||||
if (!isset($this->parsers[$filename])) {
|
||||
$this->parsers[$filename] = $this->_getPdfParser($filename);
|
||||
$this->setPdfVersion(
|
||||
max($this->getPdfVersion(), $this->parsers[$filename]->getPdfVersion())
|
||||
);
|
||||
}
|
||||
|
||||
$this->currentParser =& $this->parsers[$filename];
|
||||
|
||||
return $this->parsers[$filename]->getPageCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a PDF parser object
|
||||
*
|
||||
* @param string $filename
|
||||
* @return fpdi_pdf_parser
|
||||
*/
|
||||
protected function _getPdfParser($filename)
|
||||
{
|
||||
require_once('fpdi_pdf_parser.php');
|
||||
return new fpdi_pdf_parser($filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current PDF version.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPdfVersion()
|
||||
{
|
||||
return $this->PDFVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the PDF version.
|
||||
*
|
||||
* @param string $version
|
||||
*/
|
||||
public function setPdfVersion($version = '1.3')
|
||||
{
|
||||
$this->PDFVersion = sprintf('%.1F', $version);
|
||||
}
|
||||
|
||||
/**
|
||||
* Import a page.
|
||||
*
|
||||
* The second parameter defines the bounding box that should be used to transform the page into a
|
||||
* form XObject.
|
||||
*
|
||||
* Following values are available: MediaBox, CropBox, BleedBox, TrimBox, ArtBox.
|
||||
* If a box is not especially defined its default box will be used:
|
||||
*
|
||||
* <ul>
|
||||
* <li>CropBox: Default -> MediaBox</li>
|
||||
* <li>BleedBox: Default -> CropBox</li>
|
||||
* <li>TrimBox: Default -> CropBox</li>
|
||||
* <li>ArtBox: Default -> CropBox</li>
|
||||
* </ul>
|
||||
*
|
||||
* It is possible to get the used page box by the {@link getLastUsedPageBox()} method.
|
||||
*
|
||||
* @param int $pageNo The page number
|
||||
* @param string $boxName The boundary box to use when transforming the page into a form XObject
|
||||
* @param boolean $groupXObject Define the form XObject as a group XObject to support transparency (if used)
|
||||
* @return int An id of the imported page/template to use with e.g. fpdf_tpl::useTemplate()
|
||||
* @throws LogicException|InvalidArgumentException
|
||||
* @see getLastUsedPageBox()
|
||||
*/
|
||||
public function importPage($pageNo, $boxName = 'CropBox', $groupXObject = true)
|
||||
{
|
||||
if ($this->_inTpl) {
|
||||
throw new LogicException('Please import the desired pages before creating a new template.');
|
||||
}
|
||||
|
||||
$fn = $this->currentFilename;
|
||||
$boxName = '/' . ltrim($boxName, '/');
|
||||
|
||||
// check if page already imported
|
||||
$pageKey = $fn . '-' . ((int)$pageNo) . $boxName;
|
||||
if (isset($this->_importedPages[$pageKey])) {
|
||||
return $this->_importedPages[$pageKey];
|
||||
}
|
||||
|
||||
$parser = $this->parsers[$fn];
|
||||
$parser->setPageNo($pageNo);
|
||||
|
||||
if (!in_array($boxName, $parser->availableBoxes)) {
|
||||
throw new InvalidArgumentException(sprintf('Unknown box: %s', $boxName));
|
||||
}
|
||||
|
||||
$pageBoxes = $parser->getPageBoxes($pageNo, $this->k);
|
||||
|
||||
/**
|
||||
* MediaBox
|
||||
* CropBox: Default -> MediaBox
|
||||
* BleedBox: Default -> CropBox
|
||||
* TrimBox: Default -> CropBox
|
||||
* ArtBox: Default -> CropBox
|
||||
*/
|
||||
if (!isset($pageBoxes[$boxName]) && ($boxName == '/BleedBox' || $boxName == '/TrimBox' || $boxName == '/ArtBox'))
|
||||
$boxName = '/CropBox';
|
||||
if (!isset($pageBoxes[$boxName]) && $boxName == '/CropBox')
|
||||
$boxName = '/MediaBox';
|
||||
|
||||
if (!isset($pageBoxes[$boxName]))
|
||||
return false;
|
||||
|
||||
$this->lastUsedPageBox = $boxName;
|
||||
|
||||
$box = $pageBoxes[$boxName];
|
||||
|
||||
$this->tpl++;
|
||||
$this->_tpls[$this->tpl] = array();
|
||||
$tpl =& $this->_tpls[$this->tpl];
|
||||
$tpl['parser'] = $parser;
|
||||
$tpl['resources'] = $parser->getPageResources();
|
||||
$tpl['buffer'] = $parser->getContent();
|
||||
$tpl['box'] = $box;
|
||||
$tpl['groupXObject'] = $groupXObject;
|
||||
if ($groupXObject) {
|
||||
$this->setPdfVersion(max($this->getPdfVersion(), 1.4));
|
||||
}
|
||||
|
||||
// To build an array that can be used by PDF_TPL::useTemplate()
|
||||
$this->_tpls[$this->tpl] = array_merge($this->_tpls[$this->tpl], $box);
|
||||
|
||||
// An imported page will start at 0,0 all the time. Translation will be set in _putformxobjects()
|
||||
$tpl['x'] = 0;
|
||||
$tpl['y'] = 0;
|
||||
|
||||
// handle rotated pages
|
||||
$rotation = $parser->getPageRotation($pageNo);
|
||||
$tpl['_rotationAngle'] = 0;
|
||||
if (isset($rotation[1]) && ($angle = $rotation[1] % 360) != 0) {
|
||||
$steps = $angle / 90;
|
||||
|
||||
$_w = $tpl['w'];
|
||||
$_h = $tpl['h'];
|
||||
$tpl['w'] = $steps % 2 == 0 ? $_w : $_h;
|
||||
$tpl['h'] = $steps % 2 == 0 ? $_h : $_w;
|
||||
|
||||
if ($angle < 0)
|
||||
$angle += 360;
|
||||
|
||||
$tpl['_rotationAngle'] = $angle * -1;
|
||||
}
|
||||
|
||||
$this->_importedPages[$pageKey] = $this->tpl;
|
||||
|
||||
return $this->tpl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the last used page boundary box.
|
||||
*
|
||||
* @return string The used boundary box: MediaBox, CropBox, BleedBox, TrimBox or ArtBox
|
||||
*/
|
||||
public function getLastUsedPageBox()
|
||||
{
|
||||
return $this->lastUsedPageBox;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use a template or imported page in current page or other template.
|
||||
*
|
||||
* You can use a template in a page or in another template.
|
||||
* You can give the used template a new size. All parameters are optional.
|
||||
* The width or height is calculated automatically if one is given. If no
|
||||
* parameter is given the origin size as defined in beginTemplate() or of
|
||||
* the imported page is used.
|
||||
*
|
||||
* The calculated or used width and height are returned as an array.
|
||||
*
|
||||
* @param int $tplIdx A valid template-id
|
||||
* @param int $x The x-position
|
||||
* @param int $y The y-position
|
||||
* @param int $w The new width of the template
|
||||
* @param int $h The new height of the template
|
||||
* @param boolean $adjustPageSize If set to true the current page will be resized to fit the dimensions
|
||||
* of the template
|
||||
*
|
||||
* @return array The height and width of the template (array('w' => ..., 'h' => ...))
|
||||
* @throws LogicException|InvalidArgumentException
|
||||
*/
|
||||
public function useTemplate($tplIdx, $x = null, $y = null, $w = 0, $h = 0, $adjustPageSize = false)
|
||||
{
|
||||
if ($adjustPageSize == true && is_null($x) && is_null($y)) {
|
||||
$size = $this->getTemplateSize($tplIdx, $w, $h);
|
||||
$orientation = $size['w'] > $size['h'] ? 'L' : 'P';
|
||||
$size = array($size['w'], $size['h']);
|
||||
|
||||
if (is_subclass_of($this, 'TCPDF')) {
|
||||
$this->setPageFormat($size, $orientation);
|
||||
} else {
|
||||
$size = $this->_getpagesize($size);
|
||||
|
||||
if($orientation != $this->CurOrientation ||
|
||||
$size[0] != $this->CurPageSize[0] ||
|
||||
$size[1] != $this->CurPageSize[1]
|
||||
) {
|
||||
// New size or orientation
|
||||
if ($orientation=='P') {
|
||||
$this->w = $size[0];
|
||||
$this->h = $size[1];
|
||||
} else {
|
||||
$this->w = $size[1];
|
||||
$this->h = $size[0];
|
||||
}
|
||||
$this->wPt = $this->w * $this->k;
|
||||
$this->hPt = $this->h * $this->k;
|
||||
$this->PageBreakTrigger = $this->h - $this->bMargin;
|
||||
$this->CurOrientation = $orientation;
|
||||
$this->CurPageSize = $size;
|
||||
$this->PageSizes[$this->page] = array($this->wPt, $this->hPt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->_out('q 0 J 1 w 0 j 0 G 0 g'); // reset standard values
|
||||
$size = parent::useTemplate($tplIdx, $x, $y, $w, $h);
|
||||
$this->_out('Q');
|
||||
|
||||
return $size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy all imported objects to the resulting document.
|
||||
*/
|
||||
protected function _putimportedobjects()
|
||||
{
|
||||
foreach($this->parsers AS $filename => $p) {
|
||||
$this->currentParser =& $p;
|
||||
if (!isset($this->_objStack[$filename]) || !is_array($this->_objStack[$filename])) {
|
||||
continue;
|
||||
}
|
||||
while(($n = key($this->_objStack[$filename])) !== null) {
|
||||
try {
|
||||
$nObj = $this->currentParser->resolveObject($this->_objStack[$filename][$n][1]);
|
||||
} catch (Exception $e) {
|
||||
$nObj = array(pdf_parser::TYPE_OBJECT, pdf_parser::TYPE_NULL);
|
||||
}
|
||||
|
||||
$this->_newobj($this->_objStack[$filename][$n][0]);
|
||||
|
||||
if ($nObj[0] == pdf_parser::TYPE_STREAM) {
|
||||
$this->_writeValue($nObj);
|
||||
} else {
|
||||
$this->_writeValue($nObj[1]);
|
||||
}
|
||||
|
||||
$this->_out("\nendobj");
|
||||
$this->_objStack[$filename][$n] = null; // free memory
|
||||
unset($this->_objStack[$filename][$n]);
|
||||
reset($this->_objStack[$filename]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the form XObjects to the PDF document.
|
||||
*/
|
||||
protected function _putformxobjects()
|
||||
{
|
||||
$filter = ($this->compress) ? '/Filter /FlateDecode ' : '';
|
||||
reset($this->_tpls);
|
||||
foreach($this->_tpls AS $tplIdx => $tpl) {
|
||||
$this->_newobj();
|
||||
$currentN = $this->n; // TCPDF/Protection: rem current "n"
|
||||
|
||||
$this->_tpls[$tplIdx]['n'] = $this->n;
|
||||
$this->_out('<<' . $filter . '/Type /XObject');
|
||||
$this->_out('/Subtype /Form');
|
||||
$this->_out('/FormType 1');
|
||||
|
||||
$this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]',
|
||||
(isset($tpl['box']['llx']) ? $tpl['box']['llx'] : $tpl['x']) * $this->k,
|
||||
(isset($tpl['box']['lly']) ? $tpl['box']['lly'] : -$tpl['y']) * $this->k,
|
||||
(isset($tpl['box']['urx']) ? $tpl['box']['urx'] : $tpl['w'] + $tpl['x']) * $this->k,
|
||||
(isset($tpl['box']['ury']) ? $tpl['box']['ury'] : $tpl['h'] - $tpl['y']) * $this->k
|
||||
));
|
||||
|
||||
$c = 1;
|
||||
$s = 0;
|
||||
$tx = 0;
|
||||
$ty = 0;
|
||||
|
||||
if (isset($tpl['box'])) {
|
||||
$tx = -$tpl['box']['llx'];
|
||||
$ty = -$tpl['box']['lly'];
|
||||
|
||||
if ($tpl['_rotationAngle'] <> 0) {
|
||||
$angle = $tpl['_rotationAngle'] * M_PI/180;
|
||||
$c = cos($angle);
|
||||
$s = sin($angle);
|
||||
|
||||
switch($tpl['_rotationAngle']) {
|
||||
case -90:
|
||||
$tx = -$tpl['box']['lly'];
|
||||
$ty = $tpl['box']['urx'];
|
||||
break;
|
||||
case -180:
|
||||
$tx = $tpl['box']['urx'];
|
||||
$ty = $tpl['box']['ury'];
|
||||
break;
|
||||
case -270:
|
||||
$tx = $tpl['box']['ury'];
|
||||
$ty = -$tpl['box']['llx'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ($tpl['x'] != 0 || $tpl['y'] != 0) {
|
||||
$tx = -$tpl['x'] * 2;
|
||||
$ty = $tpl['y'] * 2;
|
||||
}
|
||||
|
||||
$tx *= $this->k;
|
||||
$ty *= $this->k;
|
||||
|
||||
if ($c != 1 || $s != 0 || $tx != 0 || $ty != 0) {
|
||||
$this->_out(sprintf('/Matrix [%.5F %.5F %.5F %.5F %.5F %.5F]',
|
||||
$c, $s, -$s, $c, $tx, $ty
|
||||
));
|
||||
}
|
||||
|
||||
$this->_out('/Resources ');
|
||||
|
||||
if (isset($tpl['resources'])) {
|
||||
$this->currentParser = $tpl['parser'];
|
||||
$this->_writeValue($tpl['resources']); // "n" will be changed
|
||||
} else {
|
||||
|
||||
$this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
|
||||
if (isset($this->_res['tpl'][$tplIdx])) {
|
||||
$res = $this->_res['tpl'][$tplIdx];
|
||||
|
||||
if (isset($res['fonts']) && count($res['fonts'])) {
|
||||
$this->_out('/Font <<');
|
||||
foreach ($res['fonts'] as $font)
|
||||
$this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R');
|
||||
$this->_out('>>');
|
||||
}
|
||||
if (isset($res['images']) && count($res['images']) ||
|
||||
isset($res['tpls']) && count($res['tpls']))
|
||||
{
|
||||
$this->_out('/XObject <<');
|
||||
if (isset($res['images'])) {
|
||||
foreach ($res['images'] as $image)
|
||||
$this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R');
|
||||
}
|
||||
if (isset($res['tpls'])) {
|
||||
foreach ($res['tpls'] as $i => $_tpl)
|
||||
$this->_out($this->tplPrefix . $i . ' ' . $_tpl['n'] . ' 0 R');
|
||||
}
|
||||
$this->_out('>>');
|
||||
}
|
||||
$this->_out('>>');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($tpl['groupXObject']) && $tpl['groupXObject']) {
|
||||
$this->_out('/Group <</Type/Group/S/Transparency>>');
|
||||
}
|
||||
|
||||
$newN = $this->n; // TCPDF: rem new "n"
|
||||
$this->n = $currentN; // TCPDF: reset to current "n"
|
||||
|
||||
$buffer = ($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];
|
||||
|
||||
if (is_subclass_of($this, 'TCPDF')) {
|
||||
$buffer = $this->_getrawstream($buffer);
|
||||
$this->_out('/Length ' . strlen($buffer) . ' >>');
|
||||
$this->_out("stream\n" . $buffer . "\nendstream");
|
||||
} else {
|
||||
$this->_out('/Length ' . strlen($buffer) . ' >>');
|
||||
$this->_putstream($buffer);
|
||||
}
|
||||
$this->_out('endobj');
|
||||
$this->n = $newN; // TCPDF: reset to new "n"
|
||||
}
|
||||
|
||||
$this->_putimportedobjects();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and optionally write the object definition to the document.
|
||||
*
|
||||
* Rewritten to handle existing own defined objects
|
||||
*
|
||||
* @param bool $objId
|
||||
* @param bool $onlyNewObj
|
||||
* @return bool|int
|
||||
*/
|
||||
public function _newobj($objId = false, $onlyNewObj = false)
|
||||
{
|
||||
if (!$objId) {
|
||||
$objId = ++$this->n;
|
||||
}
|
||||
|
||||
//Begin a new object
|
||||
if (!$onlyNewObj) {
|
||||
$this->offsets[$objId] = is_subclass_of($this, 'TCPDF') ? $this->bufferlen : strlen($this->buffer);
|
||||
$this->_out($objId . ' 0 obj');
|
||||
$this->_currentObjId = $objId; // for later use with encryption
|
||||
}
|
||||
|
||||
return $objId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a PDF value to the resulting document.
|
||||
*
|
||||
* Needed to rebuild the source document
|
||||
*
|
||||
* @param mixed $value A PDF-Value. Structure of values see cases in this method
|
||||
*/
|
||||
protected function _writeValue(&$value)
|
||||
{
|
||||
if (is_subclass_of($this, 'TCPDF')) {
|
||||
parent::_prepareValue($value);
|
||||
}
|
||||
|
||||
switch ($value[0]) {
|
||||
|
||||
case pdf_parser::TYPE_TOKEN:
|
||||
$this->_straightOut($value[1] . ' ');
|
||||
break;
|
||||
case pdf_parser::TYPE_NUMERIC:
|
||||
case pdf_parser::TYPE_REAL:
|
||||
if (is_float($value[1]) && $value[1] != 0) {
|
||||
$this->_straightOut(rtrim(rtrim(sprintf('%F', $value[1]), '0'), '.') . ' ');
|
||||
} else {
|
||||
$this->_straightOut($value[1] . ' ');
|
||||
}
|
||||
break;
|
||||
|
||||
case pdf_parser::TYPE_ARRAY:
|
||||
|
||||
// An array. Output the proper
|
||||
// structure and move on.
|
||||
|
||||
$this->_straightOut('[');
|
||||
for ($i = 0; $i < count($value[1]); $i++) {
|
||||
$this->_writeValue($value[1][$i]);
|
||||
}
|
||||
|
||||
$this->_out(']');
|
||||
break;
|
||||
|
||||
case pdf_parser::TYPE_DICTIONARY:
|
||||
|
||||
// A dictionary.
|
||||
$this->_straightOut('<<');
|
||||
|
||||
reset ($value[1]);
|
||||
|
||||
while (list($k, $v) = each($value[1])) {
|
||||
$this->_straightOut($k . ' ');
|
||||
$this->_writeValue($v);
|
||||
}
|
||||
|
||||
$this->_straightOut('>>');
|
||||
break;
|
||||
|
||||
case pdf_parser::TYPE_OBJREF:
|
||||
|
||||
// An indirect object reference
|
||||
// Fill the object stack if needed
|
||||
$cpfn =& $this->currentParser->filename;
|
||||
if (!isset($this->_doneObjStack[$cpfn][$value[1]])) {
|
||||
$this->_newobj(false, true);
|
||||
$this->_objStack[$cpfn][$value[1]] = array($this->n, $value);
|
||||
$this->_doneObjStack[$cpfn][$value[1]] = array($this->n, $value);
|
||||
}
|
||||
$objId = $this->_doneObjStack[$cpfn][$value[1]][0];
|
||||
|
||||
$this->_out($objId . ' 0 R');
|
||||
break;
|
||||
|
||||
case pdf_parser::TYPE_STRING:
|
||||
|
||||
// A string.
|
||||
$this->_straightOut('(' . $value[1] . ')');
|
||||
|
||||
break;
|
||||
|
||||
case pdf_parser::TYPE_STREAM:
|
||||
|
||||
// A stream. First, output the
|
||||
// stream dictionary, then the
|
||||
// stream data itself.
|
||||
$this->_writeValue($value[1]);
|
||||
$this->_out('stream');
|
||||
$this->_out($value[2][1]);
|
||||
$this->_straightOut("endstream");
|
||||
break;
|
||||
|
||||
case pdf_parser::TYPE_HEX:
|
||||
$this->_straightOut('<' . $value[1] . '>');
|
||||
break;
|
||||
|
||||
case pdf_parser::TYPE_BOOLEAN:
|
||||
$this->_straightOut($value[1] ? 'true ' : 'false ');
|
||||
break;
|
||||
|
||||
case pdf_parser::TYPE_NULL:
|
||||
// The null object.
|
||||
|
||||
$this->_straightOut('null ');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Modified _out() method so not each call will add a newline to the output.
|
||||
*/
|
||||
protected function _straightOut($s)
|
||||
{
|
||||
if (!is_subclass_of($this, 'TCPDF')) {
|
||||
if ($this->state == 2) {
|
||||
$this->pages[$this->page] .= $s;
|
||||
} else {
|
||||
$this->buffer .= $s;
|
||||
}
|
||||
|
||||
} else {
|
||||
if ($this->state == 2) {
|
||||
if ($this->inxobj) {
|
||||
// we are inside an XObject template
|
||||
$this->xobjects[$this->xobjid]['outdata'] .= $s;
|
||||
} else if ((!$this->InFooter) AND isset($this->footerlen[$this->page]) AND ($this->footerlen[$this->page] > 0)) {
|
||||
// puts data before page footer
|
||||
$pagebuff = $this->getPageBuffer($this->page);
|
||||
$page = substr($pagebuff, 0, -$this->footerlen[$this->page]);
|
||||
$footer = substr($pagebuff, -$this->footerlen[$this->page]);
|
||||
$this->setPageBuffer($this->page, $page . $s . $footer);
|
||||
// update footer position
|
||||
$this->footerpos[$this->page] += strlen($s);
|
||||
} else {
|
||||
// set page data
|
||||
$this->setPageBuffer($this->page, $s, true);
|
||||
}
|
||||
} else if ($this->state > 0) {
|
||||
// set general data
|
||||
$this->setBuffer($s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ends the document
|
||||
*
|
||||
* Overwritten to close opened parsers
|
||||
*/
|
||||
public function _enddoc()
|
||||
{
|
||||
parent::_enddoc();
|
||||
$this->_closeParsers();
|
||||
}
|
||||
|
||||
/**
|
||||
* Close all files opened by parsers.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
protected function _closeParsers()
|
||||
{
|
||||
if ($this->state > 2) {
|
||||
$this->cleanUp();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes cycled references and closes the file handles of the parser objects.
|
||||
*/
|
||||
public function cleanUp()
|
||||
{
|
||||
while (($parser = array_pop($this->parsers)) !== null) {
|
||||
/**
|
||||
* @var fpdi_pdf_parser $parser
|
||||
*/
|
||||
$parser->closeFile();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,215 +0,0 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.5.2
|
||||
//
|
||||
// Copyright 2004-2014 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
/**
|
||||
* This file is used as a bridge between TCPDF or FPDF
|
||||
* It will dynamically create the class extending the available
|
||||
* class FPDF or TCPDF.
|
||||
*
|
||||
* This way it is possible to use FPDI for both FPDF and TCPDF with one FPDI version.
|
||||
*/
|
||||
|
||||
if (!class_exists('TCPDF', false)) {
|
||||
/**
|
||||
* Class fpdi_bridge
|
||||
*/
|
||||
class fpdi_bridge extends FPDF
|
||||
{
|
||||
// empty body
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
/**
|
||||
* Class fpdi_bridge
|
||||
*/
|
||||
class fpdi_bridge extends TCPDF
|
||||
{
|
||||
/**
|
||||
* Array of Tpl-Data
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_tpls = array();
|
||||
|
||||
/**
|
||||
* Name-prefix of Templates used in Resources-Dictionary
|
||||
*
|
||||
* @var string A String defining the Prefix used as Template-Object-Names. Have to begin with an /
|
||||
*/
|
||||
public $tplPrefix = "/TPL";
|
||||
|
||||
/**
|
||||
* Current Object Id.
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_currentObjId;
|
||||
|
||||
/**
|
||||
* Return XObjects Dictionary.
|
||||
*
|
||||
* Overwritten to add additional XObjects to the resources dictionary of TCPDF
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _getxobjectdict()
|
||||
{
|
||||
$out = parent::_getxobjectdict();
|
||||
foreach ($this->_tpls as $tplIdx => $tpl) {
|
||||
$out .= sprintf('%s%d %d 0 R', $this->tplPrefix, $tplIdx, $tpl['n']);
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a PDF value to the resulting document.
|
||||
*
|
||||
* Prepares the value for encryption of imported data by FPDI
|
||||
*
|
||||
* @param array $value
|
||||
*/
|
||||
protected function _prepareValue(&$value)
|
||||
{
|
||||
switch ($value[0]) {
|
||||
case pdf_parser::TYPE_STRING:
|
||||
if ($this->encrypted) {
|
||||
$value[1] = $this->_unescape($value[1]);
|
||||
$value[1] = $this->_encrypt_data($this->_currentObjId, $value[1]);
|
||||
$value[1] = TCPDF_STATIC::_escape($value[1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case pdf_parser::TYPE_STREAM:
|
||||
if ($this->encrypted) {
|
||||
$value[2][1] = $this->_encrypt_data($this->_currentObjId, $value[2][1]);
|
||||
$value[1][1]['/Length'] = array(
|
||||
pdf_parser::TYPE_NUMERIC,
|
||||
strlen($value[2][1])
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case pdf_parser::TYPE_HEX:
|
||||
if ($this->encrypted) {
|
||||
$value[1] = $this->hex2str($value[1]);
|
||||
$value[1] = $this->_encrypt_data($this->_currentObjId, $value[1]);
|
||||
|
||||
// remake hexstring of encrypted string
|
||||
$value[1] = $this->str2hex($value[1]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Un-escapes a PDF string
|
||||
*
|
||||
* @param string $s
|
||||
* @return string
|
||||
*/
|
||||
protected function _unescape($s)
|
||||
{
|
||||
$out = '';
|
||||
for ($count = 0, $n = strlen($s); $count < $n; $count++) {
|
||||
if ($s[$count] != '\\' || $count == $n-1) {
|
||||
$out .= $s[$count];
|
||||
} else {
|
||||
switch ($s[++$count]) {
|
||||
case ')':
|
||||
case '(':
|
||||
case '\\':
|
||||
$out .= $s[$count];
|
||||
break;
|
||||
case 'f':
|
||||
$out .= chr(0x0C);
|
||||
break;
|
||||
case 'b':
|
||||
$out .= chr(0x08);
|
||||
break;
|
||||
case 't':
|
||||
$out .= chr(0x09);
|
||||
break;
|
||||
case 'r':
|
||||
$out .= chr(0x0D);
|
||||
break;
|
||||
case 'n':
|
||||
$out .= chr(0x0A);
|
||||
break;
|
||||
case "\r":
|
||||
if ($count != $n-1 && $s[$count+1] == "\n")
|
||||
$count++;
|
||||
break;
|
||||
case "\n":
|
||||
break;
|
||||
default:
|
||||
// Octal-Values
|
||||
if (ord($s[$count]) >= ord('0') &&
|
||||
ord($s[$count]) <= ord('9')) {
|
||||
$oct = ''. $s[$count];
|
||||
|
||||
if (ord($s[$count+1]) >= ord('0') &&
|
||||
ord($s[$count+1]) <= ord('9')) {
|
||||
$oct .= $s[++$count];
|
||||
|
||||
if (ord($s[$count+1]) >= ord('0') &&
|
||||
ord($s[$count+1]) <= ord('9')) {
|
||||
$oct .= $s[++$count];
|
||||
}
|
||||
}
|
||||
|
||||
$out .= chr(octdec($oct));
|
||||
} else {
|
||||
$out .= $s[$count];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hexadecimal to string
|
||||
*
|
||||
* @param string $data
|
||||
* @return string
|
||||
*/
|
||||
public function hex2str($data)
|
||||
{
|
||||
$data = preg_replace('/[^0-9A-Fa-f]/', '', rtrim($data, '>'));
|
||||
if ((strlen($data) % 2) == 1) {
|
||||
$data .= '0';
|
||||
}
|
||||
|
||||
return pack('H*', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* String to hexadecimal
|
||||
*
|
||||
* @param string $str
|
||||
* @return string
|
||||
*/
|
||||
public function str2hex($str)
|
||||
{
|
||||
return current(unpack('H*', $str));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,354 +0,0 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.5.2
|
||||
//
|
||||
// Copyright 2004-2014 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
require_once('pdf_parser.php');
|
||||
|
||||
/**
|
||||
* Class fpdi_pdf_parser
|
||||
*/
|
||||
class fpdi_pdf_parser extends pdf_parser
|
||||
{
|
||||
/**
|
||||
* Pages
|
||||
*
|
||||
* Index begins at 0
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_pages;
|
||||
|
||||
/**
|
||||
* Page count
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $_pageCount;
|
||||
|
||||
/**
|
||||
* Current page number
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $pageNo;
|
||||
|
||||
/**
|
||||
* PDF version of imported document
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $_pdfVersion;
|
||||
|
||||
/**
|
||||
* Available BoxTypes
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $availableBoxes = array('/MediaBox', '/CropBox', '/BleedBox', '/TrimBox', '/ArtBox');
|
||||
|
||||
/**
|
||||
* The constructor.
|
||||
*
|
||||
* @param string $filename The source filename
|
||||
*/
|
||||
public function __construct($filename)
|
||||
{
|
||||
parent::__construct($filename);
|
||||
|
||||
// resolve Pages-Dictonary
|
||||
$pages = $this->resolveObject($this->_root[1][1]['/Pages']);
|
||||
|
||||
// Read pages
|
||||
$this->_readPages($pages, $this->_pages);
|
||||
|
||||
// count pages;
|
||||
$this->_pageCount = count($this->_pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get page count from source file.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPageCount()
|
||||
{
|
||||
return $this->_pageCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the page number.
|
||||
*
|
||||
* @param int $pageNo Page number to use
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function setPageNo($pageNo)
|
||||
{
|
||||
$pageNo = ((int) $pageNo) - 1;
|
||||
|
||||
if ($pageNo < 0 || $pageNo >= $this->getPageCount()) {
|
||||
throw new InvalidArgumentException('Invalid page number!');
|
||||
}
|
||||
|
||||
$this->pageNo = $pageNo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get page-resources from current page
|
||||
*
|
||||
* @return array|boolean
|
||||
*/
|
||||
public function getPageResources()
|
||||
{
|
||||
return $this->_getPageResources($this->_pages[$this->pageNo]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get page-resources from a /Page dictionary.
|
||||
*
|
||||
* @param array $obj Array of pdf-data
|
||||
* @return array|boolean
|
||||
*/
|
||||
protected function _getPageResources($obj)
|
||||
{
|
||||
$obj = $this->resolveObject($obj);
|
||||
|
||||
// If the current object has a resources
|
||||
// dictionary associated with it, we use
|
||||
// it. Otherwise, we move back to its
|
||||
// parent object.
|
||||
if (isset($obj[1][1]['/Resources'])) {
|
||||
$res = $this->resolveObject($obj[1][1]['/Resources']);
|
||||
if ($res[0] == pdf_parser::TYPE_OBJECT)
|
||||
return $res[1];
|
||||
return $res;
|
||||
}
|
||||
|
||||
if (!isset($obj[1][1]['/Parent'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$res = $this->_getPageResources($obj[1][1]['/Parent']);
|
||||
if ($res[0] == pdf_parser::TYPE_OBJECT)
|
||||
return $res[1];
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get content of current page.
|
||||
*
|
||||
* If /Contents is an array, the streams are concatenated
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getContent()
|
||||
{
|
||||
$buffer = '';
|
||||
|
||||
if (isset($this->_pages[$this->pageNo][1][1]['/Contents'])) {
|
||||
$contents = $this->_getPageContent($this->_pages[$this->pageNo][1][1]['/Contents']);
|
||||
foreach ($contents AS $tmpContent) {
|
||||
$buffer .= $this->_unFilterStream($tmpContent) . ' ';
|
||||
}
|
||||
}
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve all content objects.
|
||||
*
|
||||
* @param array $contentRef
|
||||
* @return array
|
||||
*/
|
||||
protected function _getPageContent($contentRef)
|
||||
{
|
||||
$contents = array();
|
||||
|
||||
if ($contentRef[0] == pdf_parser::TYPE_OBJREF) {
|
||||
$content = $this->resolveObject($contentRef);
|
||||
if ($content[1][0] == pdf_parser::TYPE_ARRAY) {
|
||||
$contents = $this->_getPageContent($content[1]);
|
||||
} else {
|
||||
$contents[] = $content;
|
||||
}
|
||||
} else if ($contentRef[0] == pdf_parser::TYPE_ARRAY) {
|
||||
foreach ($contentRef[1] AS $tmp_content_ref) {
|
||||
$contents = array_merge($contents, $this->_getPageContent($tmp_content_ref));
|
||||
}
|
||||
}
|
||||
|
||||
return $contents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a boundary box from a page
|
||||
*
|
||||
* Array format is same as used by FPDF_TPL.
|
||||
*
|
||||
* @param array $page a /Page dictionary
|
||||
* @param string $boxIndex Type of box {see {@link $availableBoxes})
|
||||
* @param float Scale factor from user space units to points
|
||||
*
|
||||
* @return array|boolean
|
||||
*/
|
||||
protected function _getPageBox($page, $boxIndex, $k)
|
||||
{
|
||||
$page = $this->resolveObject($page);
|
||||
$box = null;
|
||||
if (isset($page[1][1][$boxIndex])) {
|
||||
$box = $page[1][1][$boxIndex];
|
||||
}
|
||||
|
||||
if (!is_null($box) && $box[0] == pdf_parser::TYPE_OBJREF) {
|
||||
$tmp_box = $this->resolveObject($box);
|
||||
$box = $tmp_box[1];
|
||||
}
|
||||
|
||||
if (!is_null($box) && $box[0] == pdf_parser::TYPE_ARRAY) {
|
||||
$b = $box[1];
|
||||
return array(
|
||||
'x' => $b[0][1] / $k,
|
||||
'y' => $b[1][1] / $k,
|
||||
'w' => abs($b[0][1] - $b[2][1]) / $k,
|
||||
'h' => abs($b[1][1] - $b[3][1]) / $k,
|
||||
'llx' => min($b[0][1], $b[2][1]) / $k,
|
||||
'lly' => min($b[1][1], $b[3][1]) / $k,
|
||||
'urx' => max($b[0][1], $b[2][1]) / $k,
|
||||
'ury' => max($b[1][1], $b[3][1]) / $k,
|
||||
);
|
||||
} else if (!isset($page[1][1]['/Parent'])) {
|
||||
return false;
|
||||
} else {
|
||||
return $this->_getPageBox($this->resolveObject($page[1][1]['/Parent']), $boxIndex, $k);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all page boundary boxes by page number
|
||||
*
|
||||
* @param int $pageNo The page number
|
||||
* @param float $k Scale factor from user space units to points
|
||||
* @return array
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function getPageBoxes($pageNo, $k)
|
||||
{
|
||||
if (!isset($this->_pages[$pageNo - 1])) {
|
||||
throw new InvalidArgumentException('Page ' . $pageNo . ' does not exists.');
|
||||
}
|
||||
|
||||
return $this->_getPageBoxes($this->_pages[$pageNo - 1], $k);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all boxes from /Page dictionary
|
||||
*
|
||||
* @param array $page A /Page dictionary
|
||||
* @param float $k Scale factor from user space units to points
|
||||
* @return array
|
||||
*/
|
||||
protected function _getPageBoxes($page, $k)
|
||||
{
|
||||
$boxes = array();
|
||||
|
||||
foreach($this->availableBoxes AS $box) {
|
||||
if ($_box = $this->_getPageBox($page, $box, $k)) {
|
||||
$boxes[$box] = $_box;
|
||||
}
|
||||
}
|
||||
|
||||
return $boxes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the page rotation by page number
|
||||
*
|
||||
* @param integer $pageNo
|
||||
* @throws InvalidArgumentException
|
||||
* @return array
|
||||
*/
|
||||
public function getPageRotation($pageNo)
|
||||
{
|
||||
if (!isset($this->_pages[$pageNo - 1])) {
|
||||
throw new InvalidArgumentException('Page ' . $pageNo . ' does not exists.');
|
||||
}
|
||||
|
||||
return $this->_getPageRotation($this->_pages[$pageNo - 1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the rotation value of a page
|
||||
*
|
||||
* @param array $obj A /Page dictionary
|
||||
* @return array|bool
|
||||
*/
|
||||
protected function _getPageRotation($obj)
|
||||
{
|
||||
$obj = $this->resolveObject($obj);
|
||||
if (isset($obj[1][1]['/Rotate'])) {
|
||||
$res = $this->resolveObject($obj[1][1]['/Rotate']);
|
||||
if ($res[0] == pdf_parser::TYPE_OBJECT)
|
||||
return $res[1];
|
||||
return $res;
|
||||
}
|
||||
|
||||
if (!isset($obj[1][1]['/Parent'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$res = $this->_getPageRotation($obj[1][1]['/Parent']);
|
||||
if ($res[0] == pdf_parser::TYPE_OBJECT)
|
||||
return $res[1];
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read all pages
|
||||
*
|
||||
* @param array $pages /Pages dictionary
|
||||
* @param array $result The result array
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function _readPages(&$pages, &$result)
|
||||
{
|
||||
// Get the kids dictionary
|
||||
$_kids = $this->resolveObject($pages[1][1]['/Kids']);
|
||||
|
||||
if (!is_array($_kids)) {
|
||||
throw new Exception('Cannot find /Kids in current /Page-Dictionary');
|
||||
}
|
||||
|
||||
if ($_kids[0] === self::TYPE_OBJECT) {
|
||||
$_kids = $_kids[1];
|
||||
}
|
||||
|
||||
$kids = $_kids[1];
|
||||
|
||||
foreach ($kids as $v) {
|
||||
$pg = $this->resolveObject($v);
|
||||
if ($pg[1][1]['/Type'][1] === '/Pages') {
|
||||
// If one of the kids is an embedded
|
||||
// /Pages array, resolve it as well.
|
||||
$this->_readPages($pg, $result);
|
||||
} else {
|
||||
$result[] = $pg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,153 +0,0 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.5.2
|
||||
//
|
||||
// Copyright 2004-2014 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
/**
|
||||
* Class pdf_context
|
||||
*/
|
||||
class pdf_context
|
||||
{
|
||||
/**
|
||||
* Mode
|
||||
*
|
||||
* @var integer 0 = file | 1 = string
|
||||
*/
|
||||
protected $_mode = 0;
|
||||
|
||||
/**
|
||||
* @var resource|string
|
||||
*/
|
||||
public $file;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $buffer;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
public $offset;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
public $length;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $stack;
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*
|
||||
* @param resource $f
|
||||
*/
|
||||
public function __construct(&$f)
|
||||
{
|
||||
$this->file =& $f;
|
||||
if (is_string($this->file))
|
||||
$this->_mode = 1;
|
||||
|
||||
$this->reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the position in the file stream
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPos()
|
||||
{
|
||||
if ($this->_mode == 0) {
|
||||
return ftell($this->file);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the position in the file stream.
|
||||
*
|
||||
* Optionally move the file pointer to a new location and reset the buffered data.
|
||||
*
|
||||
* @param null $pos
|
||||
* @param int $l
|
||||
*/
|
||||
public function reset($pos = null, $l = 100)
|
||||
{
|
||||
if ($this->_mode == 0) {
|
||||
if (!is_null($pos)) {
|
||||
fseek ($this->file, $pos);
|
||||
}
|
||||
|
||||
$this->buffer = $l > 0 ? fread($this->file, $l) : '';
|
||||
$this->length = strlen($this->buffer);
|
||||
if ($this->length < $l)
|
||||
$this->increaseLength($l - $this->length);
|
||||
} else {
|
||||
$this->buffer = $this->file;
|
||||
$this->length = strlen($this->buffer);
|
||||
}
|
||||
$this->offset = 0;
|
||||
$this->stack = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sure that there is at least one character beyond the current offset in the buffer.
|
||||
*
|
||||
* To prevent the tokenizer from attempting to access data that does not exist.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function ensureContent()
|
||||
{
|
||||
if ($this->offset >= $this->length - 1) {
|
||||
return $this->increaseLength();
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Forcefully read more data into the buffer
|
||||
*
|
||||
* @param int $l
|
||||
* @return bool
|
||||
*/
|
||||
public function increaseLength($l = 100)
|
||||
{
|
||||
if ($this->_mode == 0 && feof($this->file)) {
|
||||
return false;
|
||||
} else if ($this->_mode == 0) {
|
||||
$totalLength = $this->length + $l;
|
||||
do {
|
||||
$toRead = $totalLength - $this->length;
|
||||
if ($toRead < 1)
|
||||
break;
|
||||
|
||||
$this->buffer .= fread($this->file, $toRead);
|
||||
} while ((($this->length = strlen($this->buffer)) != $totalLength) && !feof($this->file));
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,913 +0,0 @@
|
||||
<?php
|
||||
//
|
||||
// FPDI - Version 1.5.2
|
||||
//
|
||||
// Copyright 2004-2014 Setasign - Jan Slabon
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
/**
|
||||
* Class pdf_parser
|
||||
*/
|
||||
class pdf_parser
|
||||
{
|
||||
/**
|
||||
* Type constant
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const TYPE_NULL = 0;
|
||||
|
||||
/**
|
||||
* Type constant
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const TYPE_NUMERIC = 1;
|
||||
|
||||
/**
|
||||
* Type constant
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const TYPE_TOKEN = 2;
|
||||
|
||||
/**
|
||||
* Type constant
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const TYPE_HEX = 3;
|
||||
|
||||
/**
|
||||
* Type constant
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const TYPE_STRING = 4;
|
||||
|
||||
/**
|
||||
* Type constant
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const TYPE_DICTIONARY = 5;
|
||||
|
||||
/**
|
||||
* Type constant
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const TYPE_ARRAY = 6;
|
||||
|
||||
/**
|
||||
* Type constant
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const TYPE_OBJDEC = 7;
|
||||
|
||||
/**
|
||||
* Type constant
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const TYPE_OBJREF = 8;
|
||||
|
||||
/**
|
||||
* Type constant
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const TYPE_OBJECT = 9;
|
||||
|
||||
/**
|
||||
* Type constant
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const TYPE_STREAM = 10;
|
||||
|
||||
/**
|
||||
* Type constant
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const TYPE_BOOLEAN = 11;
|
||||
|
||||
/**
|
||||
* Type constant
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
const TYPE_REAL = 12;
|
||||
|
||||
/**
|
||||
* Define the amount of byte in which the initial keyword of a PDF document should be searched.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
static public $searchForStartxrefLength = 5500;
|
||||
|
||||
/**
|
||||
* Filename
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $filename;
|
||||
|
||||
/**
|
||||
* File resource
|
||||
*
|
||||
* @var resource
|
||||
*/
|
||||
protected $_f;
|
||||
|
||||
/**
|
||||
* PDF Context
|
||||
*
|
||||
* @var pdf_context
|
||||
*/
|
||||
protected $_c;
|
||||
|
||||
/**
|
||||
* xref-Data
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_xref;
|
||||
|
||||
/**
|
||||
* Data of the Root object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_root;
|
||||
|
||||
/**
|
||||
* PDF version of the loaded document
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_pdfVersion;
|
||||
|
||||
/**
|
||||
* For reading encrypted documents and xref/object streams are in use
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_readPlain = true;
|
||||
|
||||
/**
|
||||
* The current read object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_currentObj;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $filename Source filename
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function __construct($filename)
|
||||
{
|
||||
$this->filename = $filename;
|
||||
|
||||
$this->_f = @fopen($this->filename, 'rb');
|
||||
|
||||
if (!$this->_f) {
|
||||
throw new InvalidArgumentException(sprintf('Cannot open %s !', $filename));
|
||||
}
|
||||
|
||||
$this->getPdfVersion();
|
||||
|
||||
require_once('pdf_context.php');
|
||||
$this->_c = new pdf_context($this->_f);
|
||||
|
||||
// Read xref-Data
|
||||
$this->_xref = array();
|
||||
$this->_readXref($this->_xref, $this->_findXref());
|
||||
|
||||
// Check for Encryption
|
||||
$this->getEncryption();
|
||||
|
||||
// Read root
|
||||
$this->_readRoot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
$this->closeFile();
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the opened file
|
||||
*/
|
||||
public function closeFile()
|
||||
{
|
||||
if (isset($this->_f) && is_resource($this->_f)) {
|
||||
fclose($this->_f);
|
||||
unset($this->_f);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Trailer for Encryption
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getEncryption()
|
||||
{
|
||||
if (isset($this->_xref['trailer'][1]['/Encrypt'])) {
|
||||
throw new Exception('File is encrypted!');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get PDF-Version
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPdfVersion()
|
||||
{
|
||||
if ($this->_pdfVersion === null) {
|
||||
fseek($this->_f, 0);
|
||||
preg_match('/\d\.\d/', fread($this->_f, 16), $m);
|
||||
if (isset($m[0]))
|
||||
$this->_pdfVersion = $m[0];
|
||||
}
|
||||
|
||||
return $this->_pdfVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the /Root dictionary
|
||||
*/
|
||||
protected function _readRoot()
|
||||
{
|
||||
if ($this->_xref['trailer'][1]['/Root'][0] != self::TYPE_OBJREF) {
|
||||
throw new Exception('Wrong Type of Root-Element! Must be an indirect reference');
|
||||
}
|
||||
|
||||
$this->_root = $this->resolveObject($this->_xref['trailer'][1]['/Root']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the xref table
|
||||
*
|
||||
* @return integer
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function _findXref()
|
||||
{
|
||||
$toRead = self::$searchForStartxrefLength;
|
||||
|
||||
$stat = fseek($this->_f, -$toRead, SEEK_END);
|
||||
if ($stat === -1) {
|
||||
fseek($this->_f, 0);
|
||||
}
|
||||
|
||||
$data = fread($this->_f, $toRead);
|
||||
|
||||
$keywordPos = strpos(strrev($data), strrev('startxref'));
|
||||
if (false === $keywordPos) {
|
||||
$keywordPos = strpos(strrev($data), strrev('startref'));
|
||||
}
|
||||
|
||||
if (false === $keywordPos) {
|
||||
throw new Exception('Unable to find "startxref" keyword.');
|
||||
}
|
||||
|
||||
$pos = strlen($data) - $keywordPos;
|
||||
$data = substr($data, $pos);
|
||||
|
||||
if (!preg_match('/\s*(\d+).*$/s', $data, $matches)) {
|
||||
throw new Exception('Unable to find pointer to xref table.');
|
||||
}
|
||||
|
||||
return (int) $matches[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the xref table
|
||||
*
|
||||
* @param array $result Array of xref table entries
|
||||
* @param integer $offset of xref table
|
||||
* @return boolean
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function _readXref(&$result, $offset)
|
||||
{
|
||||
$tempPos = $offset - min(20, $offset);
|
||||
fseek($this->_f, $tempPos); // set some bytes backwards to fetch corrupted docs
|
||||
|
||||
$data = fread($this->_f, 100);
|
||||
|
||||
$xrefPos = strrpos($data, 'xref');
|
||||
|
||||
if ($xrefPos === false) {
|
||||
$this->_c->reset($offset);
|
||||
$xrefStreamObjDec = $this->_readValue($this->_c);
|
||||
|
||||
if (is_array($xrefStreamObjDec) && isset($xrefStreamObjDec[0]) && $xrefStreamObjDec[0] == self::TYPE_OBJDEC) {
|
||||
throw new Exception(
|
||||
sprintf(
|
||||
'This document (%s) probably uses a compression technique which is not supported by the ' .
|
||||
'free parser shipped with FPDI. (See https://www.setasign.com/fpdi-pdf-parser for more details)',
|
||||
$this->filename
|
||||
)
|
||||
);
|
||||
} else {
|
||||
throw new Exception('Unable to find xref table.');
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($result['xrefLocation'])) {
|
||||
$result['xrefLocation'] = $tempPos + $xrefPos;
|
||||
$result['maxObject'] = 0;
|
||||
}
|
||||
|
||||
$cycles = -1;
|
||||
$bytesPerCycle = 100;
|
||||
|
||||
fseek($this->_f, $tempPos = $tempPos + $xrefPos + 4); // set the handle directly after the "xref"-keyword
|
||||
$data = fread($this->_f, $bytesPerCycle);
|
||||
|
||||
while (($trailerPos = strpos($data, 'trailer', max($bytesPerCycle * $cycles++, 0))) === false && !feof($this->_f)) {
|
||||
$data .= fread($this->_f, $bytesPerCycle);
|
||||
}
|
||||
|
||||
if ($trailerPos === false) {
|
||||
throw new Exception('Trailer keyword not found after xref table');
|
||||
}
|
||||
|
||||
$data = ltrim(substr($data, 0, $trailerPos));
|
||||
|
||||
// get Line-Ending
|
||||
preg_match_all("/(\r\n|\n|\r)/", substr($data, 0, 100), $m); // check the first 100 bytes for line breaks
|
||||
|
||||
$differentLineEndings = count(array_unique($m[0]));
|
||||
if ($differentLineEndings > 1) {
|
||||
$lines = preg_split("/(\r\n|\n|\r)/", $data, -1, PREG_SPLIT_NO_EMPTY);
|
||||
} else {
|
||||
$lines = explode($m[0][0], $data);
|
||||
}
|
||||
|
||||
$data = $differentLineEndings = $m = null;
|
||||
unset($data, $differentLineEndings, $m);
|
||||
|
||||
$linesCount = count($lines);
|
||||
|
||||
$start = 1;
|
||||
|
||||
for ($i = 0; $i < $linesCount; $i++) {
|
||||
$line = trim($lines[$i]);
|
||||
if ($line) {
|
||||
$pieces = explode(' ', $line);
|
||||
$c = count($pieces);
|
||||
switch($c) {
|
||||
case 2:
|
||||
$start = (int)$pieces[0];
|
||||
$end = $start + (int)$pieces[1];
|
||||
if ($end > $result['maxObject'])
|
||||
$result['maxObject'] = $end;
|
||||
break;
|
||||
case 3:
|
||||
if (!isset($result['xref'][$start]))
|
||||
$result['xref'][$start] = array();
|
||||
|
||||
if (!array_key_exists($gen = (int) $pieces[1], $result['xref'][$start])) {
|
||||
$result['xref'][$start][$gen] = $pieces[2] == 'n' ? (int) $pieces[0] : null;
|
||||
}
|
||||
$start++;
|
||||
break;
|
||||
default:
|
||||
throw new Exception('Unexpected data in xref table');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$lines = $pieces = $line = $start = $end = $gen = null;
|
||||
unset($lines, $pieces, $line, $start, $end, $gen);
|
||||
|
||||
$this->_c->reset($tempPos + $trailerPos + 7);
|
||||
$trailer = $this->_readValue($this->_c);
|
||||
|
||||
if (!isset($result['trailer'])) {
|
||||
$result['trailer'] = $trailer;
|
||||
}
|
||||
|
||||
if (isset($trailer[1]['/Prev'])) {
|
||||
$this->_readXref($result, $trailer[1]['/Prev'][1]);
|
||||
}
|
||||
|
||||
$trailer = null;
|
||||
unset($trailer);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a PDF value
|
||||
*
|
||||
* @param pdf_context $c
|
||||
* @param string $token A token
|
||||
* @return mixed
|
||||
*/
|
||||
protected function _readValue(&$c, $token = null)
|
||||
{
|
||||
if (is_null($token)) {
|
||||
$token = $this->_readToken($c);
|
||||
}
|
||||
|
||||
if ($token === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch ($token) {
|
||||
case '<':
|
||||
// This is a hex string.
|
||||
// Read the value, then the terminator
|
||||
|
||||
$pos = $c->offset;
|
||||
|
||||
while(1) {
|
||||
|
||||
$match = strpos ($c->buffer, '>', $pos);
|
||||
|
||||
// If you can't find it, try
|
||||
// reading more data from the stream
|
||||
|
||||
if ($match === false) {
|
||||
if (!$c->increaseLength()) {
|
||||
return false;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$result = substr ($c->buffer, $c->offset, $match - $c->offset);
|
||||
$c->offset = $match + 1;
|
||||
|
||||
return array (self::TYPE_HEX, $result);
|
||||
}
|
||||
break;
|
||||
|
||||
case '<<':
|
||||
// This is a dictionary.
|
||||
|
||||
$result = array();
|
||||
|
||||
// Recurse into this function until we reach
|
||||
// the end of the dictionary.
|
||||
while (($key = $this->_readToken($c)) !== '>>') {
|
||||
if ($key === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (($value = $this->_readValue($c)) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Catch missing value
|
||||
if ($value[0] == self::TYPE_TOKEN && $value[1] == '>>') {
|
||||
$result[$key] = array(self::TYPE_NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
$result[$key] = $value;
|
||||
}
|
||||
|
||||
return array (self::TYPE_DICTIONARY, $result);
|
||||
|
||||
case '[':
|
||||
// This is an array.
|
||||
|
||||
$result = array();
|
||||
|
||||
// Recurse into this function until we reach
|
||||
// the end of the array.
|
||||
while (($token = $this->_readToken($c)) !== ']') {
|
||||
if ($token === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (($value = $this->_readValue($c, $token)) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$result[] = $value;
|
||||
}
|
||||
|
||||
return array (self::TYPE_ARRAY, $result);
|
||||
|
||||
case '(':
|
||||
// This is a string
|
||||
$pos = $c->offset;
|
||||
|
||||
$openBrackets = 1;
|
||||
do {
|
||||
for (; $openBrackets != 0 && $pos < $c->length; $pos++) {
|
||||
switch (ord($c->buffer[$pos])) {
|
||||
case 0x28: // '('
|
||||
$openBrackets++;
|
||||
break;
|
||||
case 0x29: // ')'
|
||||
$openBrackets--;
|
||||
break;
|
||||
case 0x5C: // backslash
|
||||
$pos++;
|
||||
}
|
||||
}
|
||||
} while($openBrackets != 0 && $c->increaseLength());
|
||||
|
||||
$result = substr($c->buffer, $c->offset, $pos - $c->offset - 1);
|
||||
$c->offset = $pos;
|
||||
|
||||
return array (self::TYPE_STRING, $result);
|
||||
|
||||
case 'stream':
|
||||
$tempPos = $c->getPos() - strlen($c->buffer);
|
||||
$tempOffset = $c->offset;
|
||||
|
||||
$c->reset($startPos = $tempPos + $tempOffset);
|
||||
|
||||
$e = 0; // ensure line breaks in front of the stream
|
||||
if ($c->buffer[0] == chr(10) || $c->buffer[0] == chr(13))
|
||||
$e++;
|
||||
if ($c->buffer[1] == chr(10) && $c->buffer[0] != chr(10))
|
||||
$e++;
|
||||
|
||||
if ($this->_currentObj[1][1]['/Length'][0] == self::TYPE_OBJREF) {
|
||||
$tmpLength = $this->resolveObject($this->_currentObj[1][1]['/Length']);
|
||||
$length = $tmpLength[1][1];
|
||||
} else {
|
||||
$length = $this->_currentObj[1][1]['/Length'][1];
|
||||
}
|
||||
|
||||
if ($length > 0) {
|
||||
$c->reset($startPos + $e, $length);
|
||||
$v = $c->buffer;
|
||||
} else {
|
||||
$v = '';
|
||||
}
|
||||
|
||||
$c->reset($startPos + $e + $length);
|
||||
$endstream = $this->_readToken($c);
|
||||
|
||||
if ($endstream != 'endstream') {
|
||||
$c->reset($startPos + $e + $length + 9); // 9 = strlen("endstream")
|
||||
// We don't throw an error here because the next
|
||||
// round trip will start at a new offset
|
||||
}
|
||||
|
||||
return array(self::TYPE_STREAM, $v);
|
||||
|
||||
default :
|
||||
if (is_numeric($token)) {
|
||||
// A numeric token. Make sure that
|
||||
// it is not part of something else.
|
||||
if (($tok2 = $this->_readToken($c)) !== false) {
|
||||
if (is_numeric($tok2)) {
|
||||
|
||||
// Two numeric tokens in a row.
|
||||
// In this case, we're probably in
|
||||
// front of either an object reference
|
||||
// or an object specification.
|
||||
// Determine the case and return the data
|
||||
if (($tok3 = $this->_readToken($c)) !== false) {
|
||||
switch ($tok3) {
|
||||
case 'obj':
|
||||
return array(self::TYPE_OBJDEC, (int)$token, (int)$tok2);
|
||||
case 'R':
|
||||
return array(self::TYPE_OBJREF, (int)$token, (int)$tok2);
|
||||
}
|
||||
// If we get to this point, that numeric value up
|
||||
// there was just a numeric value. Push the extra
|
||||
// tokens back into the stack and return the value.
|
||||
array_push($c->stack, $tok3);
|
||||
}
|
||||
}
|
||||
|
||||
array_push($c->stack, $tok2);
|
||||
}
|
||||
|
||||
if ($token === (string)((int)$token))
|
||||
return array(self::TYPE_NUMERIC, (int)$token);
|
||||
else
|
||||
return array(self::TYPE_REAL, (float)$token);
|
||||
} else if ($token == 'true' || $token == 'false') {
|
||||
return array(self::TYPE_BOOLEAN, $token == 'true');
|
||||
} else if ($token == 'null') {
|
||||
return array(self::TYPE_NULL);
|
||||
} else {
|
||||
// Just a token. Return it.
|
||||
return array(self::TYPE_TOKEN, $token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve an object
|
||||
*
|
||||
* @param array $objSpec The object-data
|
||||
* @return array|boolean
|
||||
* @throws Exception
|
||||
*/
|
||||
public function resolveObject($objSpec)
|
||||
{
|
||||
$c = $this->_c;
|
||||
|
||||
// Exit if we get invalid data
|
||||
if (!is_array($objSpec)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($objSpec[0] == self::TYPE_OBJREF) {
|
||||
|
||||
// This is a reference, resolve it
|
||||
if (isset($this->_xref['xref'][$objSpec[1]][$objSpec[2]])) {
|
||||
|
||||
// Save current file position
|
||||
// This is needed if you want to resolve
|
||||
// references while you're reading another object
|
||||
// (e.g.: if you need to determine the length
|
||||
// of a stream)
|
||||
|
||||
$oldPos = $c->getPos();
|
||||
|
||||
// Reposition the file pointer and
|
||||
// load the object header.
|
||||
|
||||
$c->reset($this->_xref['xref'][$objSpec[1]][$objSpec[2]]);
|
||||
|
||||
$header = $this->_readValue($c);
|
||||
|
||||
if ($header[0] != self::TYPE_OBJDEC || $header[1] != $objSpec[1] || $header[2] != $objSpec[2]) {
|
||||
$toSearchFor = $objSpec[1] . ' ' . $objSpec[2] . ' obj';
|
||||
if (preg_match('/' . $toSearchFor . '/', $c->buffer)) {
|
||||
$c->offset = strpos($c->buffer, $toSearchFor) + strlen($toSearchFor);
|
||||
// reset stack
|
||||
$c->stack = array();
|
||||
} else {
|
||||
throw new Exception(
|
||||
sprintf("Unable to find object (%s, %s) at expected location.", $objSpec[1], $objSpec[2])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// If we're being asked to store all the information
|
||||
// about the object, we add the object ID and generation
|
||||
// number for later use
|
||||
$result = array (
|
||||
self::TYPE_OBJECT,
|
||||
'obj' => $objSpec[1],
|
||||
'gen' => $objSpec[2]
|
||||
);
|
||||
|
||||
$this->_currentObj =& $result;
|
||||
|
||||
// Now simply read the object data until
|
||||
// we encounter an end-of-object marker
|
||||
while (true) {
|
||||
$value = $this->_readValue($c);
|
||||
if ($value === false || count($result) > 4) {
|
||||
// in this case the parser couldn't find an "endobj" so we break here
|
||||
break;
|
||||
}
|
||||
|
||||
if ($value[0] == self::TYPE_TOKEN && $value[1] === 'endobj') {
|
||||
break;
|
||||
}
|
||||
|
||||
$result[] = $value;
|
||||
}
|
||||
|
||||
$c->reset($oldPos);
|
||||
|
||||
if (isset($result[2][0]) && $result[2][0] == self::TYPE_STREAM) {
|
||||
$result[0] = self::TYPE_STREAM;
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new Exception(
|
||||
sprintf("Unable to find object (%s, %s) at expected location.", $objSpec[1], $objSpec[2])
|
||||
);
|
||||
}
|
||||
|
||||
return $result;
|
||||
} else {
|
||||
return $objSpec;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a token from the context
|
||||
*
|
||||
* @param pdf_context $c
|
||||
* @return mixed
|
||||
*/
|
||||
protected function _readToken($c)
|
||||
{
|
||||
// If there is a token available
|
||||
// on the stack, pop it out and
|
||||
// return it.
|
||||
|
||||
if (count($c->stack)) {
|
||||
return array_pop($c->stack);
|
||||
}
|
||||
|
||||
// Strip away any whitespace
|
||||
|
||||
do {
|
||||
if (!$c->ensureContent()) {
|
||||
return false;
|
||||
}
|
||||
$c->offset += strspn($c->buffer, "\x20\x0A\x0C\x0D\x09\x00", $c->offset);
|
||||
} while ($c->offset >= $c->length - 1);
|
||||
|
||||
// Get the first character in the stream
|
||||
|
||||
$char = $c->buffer[$c->offset++];
|
||||
|
||||
switch ($char) {
|
||||
|
||||
case '[':
|
||||
case ']':
|
||||
case '(':
|
||||
case ')':
|
||||
|
||||
// This is either an array or literal string
|
||||
// delimiter, Return it
|
||||
|
||||
return $char;
|
||||
|
||||
case '<':
|
||||
case '>':
|
||||
|
||||
// This could either be a hex string or
|
||||
// dictionary delimiter. Determine the
|
||||
// appropriate case and return the token
|
||||
|
||||
if ($c->buffer[$c->offset] == $char) {
|
||||
if (!$c->ensureContent()) {
|
||||
return false;
|
||||
}
|
||||
$c->offset++;
|
||||
return $char . $char;
|
||||
} else {
|
||||
return $char;
|
||||
}
|
||||
|
||||
case '%':
|
||||
|
||||
// This is a comment - jump over it!
|
||||
|
||||
$pos = $c->offset;
|
||||
while(1) {
|
||||
$match = preg_match("/(\r\n|\r|\n)/", $c->buffer, $m, PREG_OFFSET_CAPTURE, $pos);
|
||||
if ($match === 0) {
|
||||
if (!$c->increaseLength()) {
|
||||
return false;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$c->offset = $m[0][1] + strlen($m[0][0]);
|
||||
|
||||
return $this->_readToken($c);
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
// This is "another" type of token (probably
|
||||
// a dictionary entry or a numeric value)
|
||||
// Find the end and return it.
|
||||
|
||||
if (!$c->ensureContent()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
while(1) {
|
||||
|
||||
// Determine the length of the token
|
||||
|
||||
$pos = strcspn($c->buffer, "\x20%[]<>()/\x0A\x0C\x0D\x09\x00", $c->offset);
|
||||
|
||||
if ($c->offset + $pos <= $c->length - 1) {
|
||||
break;
|
||||
} else {
|
||||
// If the script reaches this point,
|
||||
// the token may span beyond the end
|
||||
// of the current buffer. Therefore,
|
||||
// we increase the size of the buffer
|
||||
// and try again--just to be safe.
|
||||
|
||||
$c->increaseLength();
|
||||
}
|
||||
}
|
||||
|
||||
$result = substr($c->buffer, $c->offset - 1, $pos + 1);
|
||||
|
||||
$c->offset += $pos;
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Un-filter a stream object
|
||||
*
|
||||
* @param array $obj
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function _unFilterStream($obj)
|
||||
{
|
||||
$filters = array();
|
||||
|
||||
if (isset($obj[1][1]['/Filter'])) {
|
||||
$filter = $obj[1][1]['/Filter'];
|
||||
|
||||
if ($filter[0] == pdf_parser::TYPE_OBJREF) {
|
||||
$tmpFilter = $this->resolveObject($filter);
|
||||
$filter = $tmpFilter[1];
|
||||
}
|
||||
|
||||
if ($filter[0] == pdf_parser::TYPE_TOKEN) {
|
||||
$filters[] = $filter;
|
||||
} else if ($filter[0] == pdf_parser::TYPE_ARRAY) {
|
||||
$filters = $filter[1];
|
||||
}
|
||||
}
|
||||
|
||||
$stream = $obj[2][1];
|
||||
|
||||
foreach ($filters AS $filter) {
|
||||
switch ($filter[1]) {
|
||||
case '/FlateDecode':
|
||||
case '/Fl':
|
||||
if (function_exists('gzuncompress')) {
|
||||
$oStream = $stream;
|
||||
$stream = (strlen($stream) > 0) ? @gzuncompress($stream) : '';
|
||||
} else {
|
||||
throw new Exception(
|
||||
sprintf('To handle %s filter, please compile php with zlib support.', $filter[1])
|
||||
);
|
||||
}
|
||||
|
||||
if ($stream === false) {
|
||||
$tries = 0;
|
||||
while ($tries < 8 && ($stream === false || strlen($stream) < strlen($oStream))) {
|
||||
$oStream = substr($oStream, 1);
|
||||
$stream = @gzinflate($oStream);
|
||||
$tries++;
|
||||
}
|
||||
|
||||
if ($stream === false) {
|
||||
throw new Exception('Error while decompressing stream.');
|
||||
}
|
||||
}
|
||||
break;
|
||||
case '/LZWDecode':
|
||||
require_once('filters/FilterLZW.php');
|
||||
$decoder = new FilterLZW();
|
||||
$stream = $decoder->decode($stream);
|
||||
break;
|
||||
case '/ASCII85Decode':
|
||||
require_once('filters/FilterASCII85.php');
|
||||
$decoder = new FilterASCII85();
|
||||
$stream = $decoder->decode($stream);
|
||||
break;
|
||||
case '/ASCIIHexDecode':
|
||||
require_once('filters/FilterASCIIHexDecode.php');
|
||||
$decoder = new FilterASCIIHexDecode();
|
||||
$stream = $decoder->decode($stream);
|
||||
break;
|
||||
case null:
|
||||
break;
|
||||
default:
|
||||
throw new Exception(sprintf('Unsupported Filter: %s', $filter[1]));
|
||||
}
|
||||
}
|
||||
|
||||
return $stream;
|
||||
}
|
||||
}
|
@ -1,165 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
@ -1,314 +0,0 @@
|
||||
4.03 (2011-05-27)
|
||||
correction de l'exemple "form.php" : vulnérabilité cross-site scripting corrigée
|
||||
correction sur la gestion des retours à la ligne automatique
|
||||
correction sur le calcul de la hauteur des balises H1->H6
|
||||
amélioration de la gestion des exceptions
|
||||
|
||||
4.02 (2011-04-29)
|
||||
ATTENTION : beaucoup de changements dans la structure du projet. version 3.xx abandonnée
|
||||
uniformisation des fichiers du projet (standard Zend)
|
||||
conversion des fichiers de langue en CSV, déplacement dans le répertoire "locale". création d'une classe spécifique à la gestion des locales
|
||||
amélioration de la gestion de certaines erreurs
|
||||
modification du nom de toutes les sous classes
|
||||
déplacement de toutes les sous classes
|
||||
modification du nom de toutes les méthodes protected
|
||||
correction sur la gestion des tables
|
||||
correction sur la lecture des path des SVG
|
||||
premiere version de text-align:justify
|
||||
correction sur la gestion de la balise BLOCKQUOTE
|
||||
correction sur la gestion de la balise P
|
||||
gestion des styles CSS pour les balises TEXTAREA, SELECT, INPUT
|
||||
ajout de la propriété pagegroup="new" sur la balise PAGE
|
||||
correction pour la balise INPUT de type radio : checked au lieu de selected
|
||||
|
||||
3.30 / 4.01 (2010-05-07)
|
||||
correction sur la gestion des textes
|
||||
correction sur le parseur HTML
|
||||
correction sur la gestion de border-collapse
|
||||
correction sur la gestion des TDs, H1->H6
|
||||
ajout des balises fieldset et legend (cf exemple 4)
|
||||
ajout de la langue CS
|
||||
nombreuses améliorations
|
||||
v4.01 uniquement : Utilisation de TCPDF 5.0.002
|
||||
v4.01 uniquement : Utilisation des QR-code de TCPDF, il n'y a plus besoin d'une librairie externe
|
||||
v4.01 uniquement : Utilisation des exceptions PHP pour les erreurs. Tous les exemples ont été mis à jour en consequence
|
||||
(merci à Pavel Kochman pour ses sugestions et ses ajouts)
|
||||
|
||||
3.29 / 4.00 (2010-03-17)
|
||||
modification des barcodes. ATTENTION : bar_w et bar_h n'existent plus !
|
||||
correction sur la gestion de page_footer
|
||||
correction sur la gestion des html entities
|
||||
correction sur le positionnement des textes
|
||||
correction sur le positionnement des tableaux
|
||||
nombreuses corrections sur les positionnements, les couleurs, ...
|
||||
amélioration de la partie SVG (balise G, ...)
|
||||
amélioration sur createIndex
|
||||
harmonisation des noms des méthodes
|
||||
correction sur la gestion des textes
|
||||
v4.00 uniquement : HTML2PDF est maintenant écrit en PHP5 et basé sur TCPDF (=> unicode, utf8, ...)
|
||||
v4.00 uniquement : utilisation de TCPDF pour les formulaires et les barcodes
|
||||
v4.00 uniquement : amélioration de la partie SVG (alpha)
|
||||
|
||||
3.28 (2010-01-18)
|
||||
ajout de la gestion de la balise label
|
||||
correction pour compatibilité PHP4
|
||||
|
||||
3.27 (2010-01-11)
|
||||
correction sur page_header et page_footer
|
||||
ajout de la possibilité de pouvoir mettre l'index automatique dans la page que l'on veut
|
||||
correction sur la gestion du canal alpha pour les PNGs
|
||||
correction sur la gestion des border-radius (cf exemple radius) conforme au CSS3
|
||||
correction sur la gestion du background-color
|
||||
correction sur la gestion de thead, tfoot, et tbody
|
||||
ajout du dessin verctoriel (cf exemples draw, tigre, sapin)
|
||||
ajout de la propriété label="none/label" pour la balise <barcode>
|
||||
nombreux petits correctifs
|
||||
|
||||
3.26 (2009-11-16)
|
||||
correction pour support des images générés en CGI
|
||||
ajout de la gestion du canal alpha pour les PNGs (nécessite GD2)
|
||||
ajout de la méthode setDefaultFont permettant de spécifier une fonte par défaut
|
||||
ajout de la propriété format pour la balise <page> (cf exemple 4)
|
||||
amélioration de la gestion des couleurs css RGB (cf exemple 2)
|
||||
ajout de la gestion des couleurs css CMYK (cf exemple 2)
|
||||
ajout de la propriété css overflow:hidden pour la balise <div> (cf exemple 2)
|
||||
correction sur page_header et page_footer
|
||||
ajout de la possibilité de pouvoir directement convertir le résultat d'une vraie page HTML
|
||||
nombreux petits correctifs sur les styles
|
||||
|
||||
3.25 (2009-10-07)
|
||||
correctif sur le calcul des tableaux dans le page_footer
|
||||
correctif sur l'interprétation des espaces entre certaines balises
|
||||
correction sur la gestion des balises H1, H2, H3, H4, H5, H6
|
||||
correction sur la gestion de la balise table
|
||||
support des balises xhtml du type <span />
|
||||
ajout des balises COL (cf exemple 5), DEL, INS, et QRCODE (cf exemple 13)
|
||||
ajout de la propriété css text-transform
|
||||
ajout de la propriété css rotate (uniquement sur les DIV, cf exemple 8)
|
||||
ne plus rendre obligatoire l'existence d'une image (nouvelle méthode setTestIsImage)
|
||||
ajout d'un mode DEBUG - les anciennes fonction d'analyse des ressources ont été supprimées
|
||||
ajout de la méthode setEncoding
|
||||
ajout de la langue danoise DA (merci à Daniel K.)
|
||||
|
||||
3.24 (2009-08-05)
|
||||
correction sur le calcul de la largeur des divs
|
||||
modification pour compatibilité avec la localisation PHP
|
||||
modification pour compatibilité avec PHP 5.3.0
|
||||
|
||||
3.23 (2009-07-30)
|
||||
correction sur le calcul des DIVs
|
||||
correction sur l'interpretation de certains styles CSS
|
||||
correction de la fonction de creation d'index automatique CreateIndex
|
||||
ATTENTION : la methode d'appel de CreateIndex a changé. Regardez l'exemple About !!!!
|
||||
|
||||
3.22a (2009-06-16)
|
||||
redistribution de HTML2PDF sous la licence LGPL !!! (au lieu de GPL)
|
||||
|
||||
3.22 (2009-06-08)
|
||||
correction sur le background-color
|
||||
refonte totale de la gestion de text-align. les valeurs center et right marchent maintenant meme en cas de contenu riche
|
||||
|
||||
3.21 (2009-05-05)
|
||||
ajout de la propriété css FLOAT pour la balise IMG
|
||||
correction sur la gestion des TFOOT
|
||||
correction sur le positionnement des images
|
||||
|
||||
3.20 (2009-04-06)
|
||||
ajout de la gestion des margins pour la balise DIV
|
||||
ajout de la gestion de la propriete css LINE-HEIGHT
|
||||
correction sur l'interpretation de la valeur de certains styles CSS (background-image, background-position, ...)
|
||||
correction sur la reconnaissance des balises thead et tfoot
|
||||
correction sur la balise select
|
||||
correction sur les fichiers de langue (merci à Sinan)
|
||||
|
||||
3.19 (2009-03-11)
|
||||
optimisation du parseur HTML - merci à Jezelinside
|
||||
ajout de la balise TFOOT
|
||||
amélioration de la gestion des tableaux : les contenus des balises THEAD et TFOOT sont maintenant répétés sur chaque page.
|
||||
ajout de la balise spécifique BOOKMARK afin de créer des "marques-page"
|
||||
possibilité de rajouter un index automatique en fin de fichier
|
||||
ajout de la langue turque TR (merci à Hidayet)
|
||||
amélioration de la méthode Output. Elle est maintenant également utilisable comme celle de FPDF
|
||||
|
||||
3.18 (2009-02-22)
|
||||
correction sur les sauts de page automatique pour les balises TABLE, UL, OL
|
||||
correction sur l'interpretation des styles pour la balise HR
|
||||
correction sur l'interpretation du style border-collapse pour la balise TABLE
|
||||
prise en compte de margin:auto pour les tables et les divs
|
||||
les commentaires dans les CSS sont acceptés
|
||||
|
||||
3.17 (2008-12-30)
|
||||
ajout de la gestion des balises INPUT (text, radio, checkbox, button, hidden, ...), SELECT, OPTION, TEXTAREA (cf exemple 14)
|
||||
ajout de la possibilité de mettre des scripts dans le pdf, via $html2pdf->pdf->IncludeJS(...); (cf exemples JS)
|
||||
correction sur le saut de page automatique pour les images
|
||||
correction sur les sauts de lignes automatiques pour certaines balises (UL, P, ...)
|
||||
ajout de la langue NL (merci à Roland)
|
||||
|
||||
3.16 (2008-12-09)
|
||||
ajout de la gestion de list-style: none (cf exemple 13)
|
||||
correction dans la gestion des fontes ajoutées à fpdf (via la méthode AddFont)
|
||||
nombreuses corrections sur le calcul des largeurs des éléments table, div, hr, td, th
|
||||
ajout de l'exemple about.php
|
||||
(pour info, les PDF générés à partir des exemples sont maintenant dans le répertoire /exemples/pdf/, et sont supprimables)
|
||||
|
||||
3.15 (2008-12-01)
|
||||
correction sur l'identification des styles en cas de valeurs multiples dans la propriete class
|
||||
prise en compte de border-radius pour la limite des backgrounds (color et image)
|
||||
ajout des proprietes CSS border-top-*, border-right-*, border-bottom-*, border-left-*
|
||||
ajout de la propriété CSS list-style-image (cf exemple 12)
|
||||
pour la balise table, ajout de l'interprétation de align="center" et align="right" (cf exemple 1)
|
||||
correction dans le positionnement des images
|
||||
correction de quelques bugs
|
||||
ajout d'une fonction d'analyse des ressources HTML2PDFgetTimerDebug (cf début du fichier html2pdf.class.php)
|
||||
|
||||
3.14 (2008-11-17)
|
||||
ajout d'une langue (pt : Brazilian Portuguese language) et amelioration de la methode vueHTML (merci à Rodrigo)
|
||||
correction du positionnement du contenu des DIVs. gestion des proprietes valign et align
|
||||
ajout de la propriete CSS border-collapse (cf exemple 0)
|
||||
ajout de la propriete CSS border-radius (cf exemple 1)
|
||||
correction de quelques bugs
|
||||
|
||||
3.13 (2008-09-24)
|
||||
reecriture de la balise hr, avec prise en compte des styles (cf exemple 0)
|
||||
ajout de la propriete backcolor pour la balise page (cf exemple 9)
|
||||
ajout des proprietes backleft et backright pour la balise page afin de pouvoir changer les marges des pages (cf exemple 8)
|
||||
nombreuses corrections sur les balises et les styles
|
||||
|
||||
3.12 (2008-09-16)
|
||||
ajout des balises ol, ul, li (cf exemple 12)
|
||||
correction sur le calcul de la taille des td en cas de colspan et rowspan
|
||||
ajout de la méthode setTestTdInOnePage afin de pouvoir desactiver le test sur la taille des TD (cf exemple 11)
|
||||
correction de quelques bugs
|
||||
|
||||
3.11 (2008-08-29)
|
||||
ajout des balises div, p, pre, s
|
||||
gestion des styles CSS position (relative, absolute), left, top, right, bottom (cf exemple 10)
|
||||
meilleur gestion des border : border-style, border-color, border-width (cf exemple 10)
|
||||
possibilité d'indiquer les marges par défault, via le constructeur (cf exemple 2)
|
||||
|
||||
3.10a (2008-08-26)
|
||||
correction pour compatibilité php4 / php5
|
||||
|
||||
3.10 (2008-08-25)
|
||||
ajout des liens internes (cf exemple 7)
|
||||
gestion complete des background : image, repeat, position, color (cf exemple 1)
|
||||
gestion de underline, overline, linethrough (cf exemple 2)
|
||||
correction de quelques bugs
|
||||
|
||||
3.09
|
||||
mise à jour vers fpdf version 1.6, ajout de barcode, correction de l'affichage de certains caractères spéciaux
|
||||
correction du calcul de la hauteur de ligne de la balise br
|
||||
detection en cas de contenu trop grand dans un TD
|
||||
amélioration de la balise page (ajout de l'attribue pageset, avec les valeurs new et old)
|
||||
ajout de FPDF_PROTECTION, accesible via $pdf->pdf->SetProtection(...)
|
||||
|
||||
3.08
|
||||
version opérationnelle de page_header
|
||||
ajout de page_footer
|
||||
correction des borders des tableaux
|
||||
|
||||
3.07
|
||||
correction de l'interpretation de cellspacing,
|
||||
amélioration de la balise page_header
|
||||
|
||||
3.06
|
||||
première gestion de la balise page_header
|
||||
correction des dimensions des tableaux
|
||||
|
||||
3.05
|
||||
ajout de la propriété vertical-align
|
||||
ajout de la gestion des fichiers de langue
|
||||
|
||||
3.04
|
||||
correction du saut de page automatique pour les tableaux
|
||||
Ajout de propriétés à la balise PAGE
|
||||
|
||||
3.03
|
||||
correction de bugs au niveau de la gestion des images PHP par FPDF
|
||||
meilleure gestion des erreurs
|
||||
|
||||
3.02
|
||||
ajout de la gestion des noms des couleurs
|
||||
correction de la gestion des images générées par php
|
||||
correction de quelques bugs
|
||||
|
||||
3.01
|
||||
correction de quelques bugs
|
||||
ajout d'une protection pour les balises non existantes
|
||||
|
||||
3.00
|
||||
refonte totale du calcul des tableaux
|
||||
Prise en compte des colspan et rowspan
|
||||
|
||||
2.85
|
||||
ajout de la propriété cellspacing
|
||||
nouvelle gestion des padding des tableaux
|
||||
|
||||
2.80
|
||||
ajout des types de border dotted et dasheds
|
||||
|
||||
2.75
|
||||
ajout des top, left, right, bottom pour padding et border
|
||||
|
||||
2.70
|
||||
correction de la balise HR, ajout de la propriété padding pour les table, th, td
|
||||
correction des dimensions, les unités px, mm, in, pt sont enfin réellement reproduites, correction de font-size, border, ...
|
||||
ajout d'une propriété à la balise page : footer
|
||||
correction dans l'affichage et le calcul des tables
|
||||
|
||||
2.55
|
||||
vérification de la validité du code (ouverture / fermeture)
|
||||
ajout des unités mm, in, pt
|
||||
|
||||
2.50
|
||||
correction de nobreak
|
||||
correction des marges
|
||||
ajout de nombreuses balises
|
||||
|
||||
2.40
|
||||
refonte totale de l'identification des styles CSS (Les héritages marchent)
|
||||
|
||||
2.39
|
||||
corrections diverses
|
||||
ajout de certaines propriétés (bgcolor, ...)
|
||||
|
||||
2.38
|
||||
meilleur identification des propriétés border et color
|
||||
|
||||
2.37
|
||||
nombreuses corrections :
|
||||
balise A
|
||||
couleur de fond
|
||||
retour à la ligne
|
||||
gestion des images dans un texte
|
||||
|
||||
2.36
|
||||
ajout de la balises STRONG
|
||||
ajout de la balise EM
|
||||
|
||||
2.35
|
||||
amélioration de la gestion des feuilles de style
|
||||
|
||||
2.31
|
||||
correction de quelques bugs
|
||||
|
||||
2.30
|
||||
première version opérationnel des feuilles de style
|
||||
|
||||
2.25
|
||||
ajout de la balise LINK pour le type text/css
|
||||
|
||||
2.20
|
||||
premier jet de la gestion des feuilles de style, ajout de la balise STYLE
|
||||
|
||||
2.15
|
||||
n'interpréte plus l'HTML en commentaire <!-- -->
|
||||
|
||||
2.10
|
||||
ajout des balises H1 -> H6
|
||||
|
||||
2.01
|
||||
correction de quelques bugs
|
||||
|
||||
2.00
|
||||
première version diffusée
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user