Follow version 2.9

This commit is contained in:
Michael RICOIS 2016-02-18 13:33:54 +00:00
commit f778e95e8b
6 changed files with 59 additions and 46 deletions

View File

@ -41,7 +41,7 @@ class FichierController extends Zend_Controller_Action
$content_type = 'application/pdf';
// --- Envoi du fichier sur la sortie standard
$modules = apache_get_modules();
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header('X-Sendfile: ' . $file);
header('Content-Type: ' . $content_type);
@ -75,7 +75,7 @@ class FichierController extends Zend_Controller_Action
$file = $c->profil->path->shared . '/files/'.$file;
// --- Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = apache_get_modules();
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header('X-Sendfile: ' . $file);
header('Content-Type: ' . $content_type);
@ -106,7 +106,7 @@ class FichierController extends Zend_Controller_Action
$file = $c->profil->path->shared . '/files/'. $filename;
// --- Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = apache_get_modules();
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header('X-Sendfile: ' . $file);
header('Content-Type: ' . $content_type);
@ -137,7 +137,7 @@ class FichierController extends Zend_Controller_Action
$file = realpath($c->profil->path->shared).'/datafile/kbis/'.$filename;
// --- Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = apache_get_modules();
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header('X-Sendfile: ' . $file);
header('Content-Type: ' . $content_type);
@ -168,7 +168,7 @@ class FichierController extends Zend_Controller_Action
$file = $c->profil->path->shared . '/files/' . $filename;
// --- Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = apache_get_modules();
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header('X-Sendfile: ' . $file);
header('Content-Type: ' . $content_type);
@ -199,7 +199,7 @@ class FichierController extends Zend_Controller_Action
$file = $c->profil->path->shared . '/files/' .$filename;
// --- Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = apache_get_modules();
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header('X-Sendfile: ' . $file);
header('Content-Type: ' . $content_type);
@ -231,7 +231,7 @@ class FichierController extends Zend_Controller_Action
// --- Envoi du fichier sur la sortie standard
if ( file_exists($file) ) {
$modules = apache_get_modules();
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header('X-Sendfile: ' . $file);
header('Content-Type: ' . $content_type);

View File

@ -201,13 +201,18 @@ class SdMetier_Infogreffe_DocAC extends SdMetier_Infogreffe_Service
$num = $row->num_acte;
$options = $row->numGreffe . '-' . substr($row->numRC,0,2) . '-' . substr($row->numRC,2,1) . '-' . substr($row->numRC,3) . '-' . $row->num_depot;
$dir = $this->getFilePath($date);
if ( ! file_exists($this->config->storage->path . '/' . $dir) ) {
mkdir($this->config->storage->path . '/' . $dir, 0777, true);
}
//Set filename
$filename = $this->getFilePath($date) . '/' . $this->getFileName($date, $num, $type, $options);
$filename = $dir . '/' . $this->getFileName($date, $num, $type, $options);
if ( $row->pdfLink != '' ) {
//Set the filename
$filename = $this->getFilePath($date) . '/' . $row->pdfLink;
$filename = $dir . '/' . $row->pdfLink;
//Check if filename exist
if ( !file_exists($this->config->storage->path . '/' . $filename) ) {
@ -355,11 +360,7 @@ class SdMetier_Infogreffe_DocAC extends SdMetier_Infogreffe_Service
*/
public function getFilePath($date)
{
$dir = 'actes/' . substr($date,0,4) . '/' . substr($date,5,2);
if ( !file_exists( $this->config->storage->path . '/' . $dir ) ) {
mkdir($this->config->storage->path . '/' . $dir, 0777, true);
}
return $dir;
return 'actes/' . substr($date,0,4) . '/' . substr($date,5,2);
}
/**

View File

@ -220,13 +220,18 @@ class SdMetier_Infogreffe_DocBI extends SdMetier_Infogreffe_Service
$this->date_cloture = $row->date_cloture;
$this->type_comptes = $row->type_comptes;
$dir = $this->getFilePath($type, $dateCloture);
if ( ! file_exists($this->config->storage->path . '/' . $dir) ) {
mkdir($this->config->storage->path . '/' . $dir, 0777, true);
}
//Set the filename
$filename = $this->getFilePath($type, $dateCloture) . '/' . $this->getFileName($type, $dateCloture);
$filename = $dir . '/' . $this->getFileName($type, $dateCloture);
if ($row->pdfLink != '') {
//Check if filename exist
if ( !file_exists($this->config->storage->path . '/' . $filename) ) {
if ( ! file_exists($this->config->storage->path . '/' . $filename) ) {
throw new Exception('File not found', self::INT);
}
@ -370,11 +375,7 @@ class SdMetier_Infogreffe_DocBI extends SdMetier_Infogreffe_Service
if ($type=='') {
$type = 'sociaux';
}
$dir = 'bilans' . '/' . $type . '/' . substr($dateCloture,0,4);
if ( !file_exists( $this->config->storage->path . '/' . $dir ) ) {
mkdir($this->config->storage->path . '/' . $dir, 0777, true);
}
return $dir;
return 'bilans' . '/' . $type . '/' . substr($dateCloture,0,4);
}
/**

View File

@ -46,8 +46,13 @@ class SdMetier_Infogreffe_DocST extends SdMetier_Infogreffe_Service
$this->mode_diffusion = 'T';
$this->reference_client = 'T'.date('YmdHis');
$dir = $this->getFilePath($type, $dateCloture);
if ( ! file_exists( $this->config->storage->path . '/' . $dir ) ) {
mkdir($this->config->storage->path . '/' . $dir, 0777, true);
}
//Set the filename
$filename = $this->getFilePath($type, $dateCloture) . '/' . $this->getFileName($type, $dateCloture);
$filename = $dir . '/' . $this->getFileName($type, $dateCloture);
try {
$xml = $this->callRequest();
@ -115,11 +120,7 @@ class SdMetier_Infogreffe_DocST extends SdMetier_Infogreffe_Service
if ($type=='') {
$type = 'sociaux';
}
$dir = 'bilans' . '/' . $type . '/' . substr($dateCloture,0,4);
if ( !file_exists( $this->config->storage->path . '/' . $dir ) ) {
mkdir($this->config->storage->path . '/' . $dir, 0777, true);
}
return $dir;
return 'bilans' . '/' . $type . '/' . substr($dateCloture,0,4);
}
/**

View File

@ -450,10 +450,15 @@ class Pieces extends Scores_Ws_Server
if ( !empty($pdf) ) {
$c = Zend_Registry::get('config');
$file = null;
if ( file_exists($c->profil->infogreffe->storage->path . '/OCR/' . $pdf) ) {
$file = $c->profil->infogreffe->storage->path . '/OCR/' . $pdf;
} elseif ( file_exists($c->profil->infogreffe->storage->path . '/' . $pdf) ) {
$file = $c->profil->infogreffe->storage->path . '/' . $pdf;
}
$dest = $c->profil->path->shared . '/files/' . basename($file);
if ( file_exists($file) && copy($file, $dest)) {
if ( $file !== null && copy($file, $dest) ) {
$hostname = 'http://'.$_SERVER['SERVER_NAME'];
if ( $_SERVER['SERVER_PORT'] != '80' ) {
$hostname.= ':'.$_SERVER['SERVER_PORT'];
@ -625,10 +630,15 @@ class Pieces extends Scores_Ws_Server
if ( !empty($pdf) ) {
$c = Zend_Registry::get('config');
$file = null;
if ( file_exists($c->profil->infogreffe->storage->path . '/OCR/' . $pdf) ) {
$file = $c->profil->infogreffe->storage->path . '/OCR/' . $pdf;
} elseif ( file_exists($c->profil->infogreffe->storage->path . '/' . $pdf) ) {
$file = $c->profil->infogreffe->storage->path . '/' . $pdf;
}
$dest = $c->profil->path->shared . '/files/' . basename($file);
if ( file_exists($file) && copy($file, $dest)) {
if ( $file !== null && copy($file, $dest)) {
$hostname = 'http://'.$_SERVER['SERVER_NAME'];
if ( $_SERVER['SERVER_PORT'] != '80' ) {