Prepare for release

This commit is contained in:
Michael RICOIS 2014-02-07 16:14:36 +00:00
parent c848c6a9a0
commit ce6a84fc00
54 changed files with 4603 additions and 713 deletions

View File

@ -0,0 +1,2 @@
<?php
return array();

View File

@ -61,7 +61,7 @@ class FichierController extends Zend_Controller_Action
$file = $this->getRequest()->getParam('fichier');
$content_type = 'application/csv-tab-delimited-table';
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->files).'/';
$path = APPLICATION_PATH . '/../data/files/';
//Envoi du fichier sur la sortie standard
if ( file_exists($path.$file) ) {
header('Content-Transfer-Encoding: none');
@ -81,7 +81,7 @@ class FichierController extends Zend_Controller_Action
$file = $this->getRequest()->getParam('fichier');
$content_type = 'application/csv-tab-delimited-table';
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->files).'/';
$path = APPLICATION_PATH . '/../data/files/';
//Envoi du fichier sur la sortie standard
if ( file_exists($path.$file) ) {
header('Content-Transfer-Encoding: none');
@ -121,7 +121,27 @@ class FichierController extends Zend_Controller_Action
$file = $this->getRequest()->getParam('fichier');
$content_type = 'application/pdf';
$c = Zend_Registry::get('config');
$path = realpath($c->profil->path->files).'/associations/';
$path = APPLICATION_PATH . '/../data/files/associations/';
//Envoi du fichier sur la sortie standard
if ( file_exists($path.$file) ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
header('Content-Length: ' . filesize($path.$file));
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
header('Content-Disposition: filename="' . basename($path.$file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($path.$file);
}
}
public function greffesAction()
{
$file = $this->getRequest()->getParam('fichier');
$content_type = 'application/pdf';
$c = Zend_Registry::get('config');
$path = APPLICATION_PATH . '/../data/files/greffes/';
//Envoi du fichier sur la sortie standard
if ( file_exists($path.$file) ) {
header('Content-Transfer-Encoding: none');

161
bin/classmap_generator.php Normal file
View File

@ -0,0 +1,161 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Loader
* @subpackage Exception
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* Generate class maps for use with autoloading.
*
* Usage:
* --help|-h Get usage message
* --library|-l [ <string> ] Library to parse; if none provided, assumes
* current directory
* --output|-o [ <string> ] Where to write autoload file; if not provided,
* assumes "autoload_classmap.php" in library directory
* --overwrite|-w Whether or not to overwrite existing autoload
* file
*/
$libPath = dirname(__FILE__) . '/../library';
if (!is_dir($libPath)) {
// Try to load StandardAutoloader from include_path
if (false === include('Zend/Loader/StandardAutoloader.php')) {
echo "Unable to locate autoloader via include_path; aborting" . PHP_EOL;
exit(2);
}
} else {
// Try to load StandardAutoloader from library
if (false === include(dirname(__FILE__) . '/../library/Zend/Loader/StandardAutoloader.php')) {
echo "Unable to locate autoloader via library; aborting" . PHP_EOL;
exit(2);
}
}
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath($libPath),
get_include_path(),
)));
// Setup autoloading
$loader = new Zend_Loader_StandardAutoloader();
$loader->setFallbackAutoloader(true);
$loader->register();
$rules = array(
'help|h' => 'Get usage message',
'library|l-s' => 'Library to parse; if none provided, assumes current directory',
'output|o-s' => 'Where to write autoload file; if not provided, assumes "autoload_classmap.php" in library directory',
'overwrite|w' => 'Whether or not to overwrite existing autoload file',
);
try {
$opts = new Zend_Console_Getopt($rules);
$opts->parse();
} catch (Zend_Console_Getopt_Exception $e) {
echo $e->getUsageMessage();
exit(2);
}
if ($opts->getOption('h')) {
echo $opts->getUsageMessage();
exit();
}
$path = $libPath;
if (array_key_exists('PWD', $_SERVER)) {
$path = $_SERVER['PWD'];
}
if (isset($opts->l)) {
$path = $opts->l;
if (!is_dir($path)) {
echo "Invalid library directory provided" . PHP_EOL . PHP_EOL;
echo $opts->getUsageMessage();
exit(2);
}
$path = realpath($path);
}
$usingStdout = false;
$output = $path . DIRECTORY_SEPARATOR . 'autoload_classmap.php';
if (isset($opts->o)) {
$output = $opts->o;
if ('-' == $output) {
$output = STDOUT;
$usingStdout = true;
} elseif (!is_writeable(dirname($output))) {
echo "Cannot write to '$output'; aborting." . PHP_EOL
. PHP_EOL
. $opts->getUsageMessage();
exit(2);
} elseif (file_exists($output)) {
if (!$opts->getOption('w')) {
echo "Autoload file already exists at '$output'," . PHP_EOL
. "but 'overwrite' flag was not specified; aborting." . PHP_EOL
. PHP_EOL
. $opts->getUsageMessage();
exit(2);
}
}
}
$strip = $path;
if (!$usingStdout) {
echo "Creating class file map for library in '$path'..." . PHP_EOL;
}
// Get the ClassFileLocator, and pass it the library path
$l = new Zend_File_ClassFileLocator($path);
// Iterate over each element in the path, and create a map of
// classname => filename, where the filename is relative to the library path
$map = new stdClass;
$strip .= DIRECTORY_SEPARATOR;
function createMap(Iterator $i, $map, $strip) {
$file = $i->current();
$namespace = empty($file->namespace) ? '' : $file->namespace . '\\';
$filename = str_replace($strip, '', $file->getRealpath());
// Windows portability
$filename = str_replace(array('/', '\\'), "' . DIRECTORY_SEPARATOR . '", $filename);
$map->{$namespace . $file->classname} = $filename;
return true;
}
iterator_apply($l, 'createMap', array($l, $map, $strip));
// Create a file with the class/file map.
// Stupid syntax highlighters make separating < from PHP declaration necessary
$dirStore = 'dirname_' . uniqid();
$content = '<' . "?php\n"
. '$' . $dirStore . " = dirname(__FILE__);\n"
. 'return ' . var_export((array) $map, true) . ';';
// Prefix with dirname(__FILE__); modify the generated content
$content = preg_replace('#(=> )#', '$1$' . $dirStore . ' . DIRECTORY_SEPARATOR . ', $content);
$content = str_replace("\\'", "'", $content);
// Write the contents to disk
file_put_contents($output, $content);
if (!$usingStdout) {
echo "Wrote classmap file to '" . realpath($output) . "'" . PHP_EOL;
}

44
bin/zf.bat Normal file
View File

@ -0,0 +1,44 @@
@ECHO off
REM Zend Framework
REM
REM LICENSE
REM
REM This source file is subject to the new BSD license that is bundled
REM with this package in the file LICENSE.txt.
REM It is also available through the world-wide-web at this URL:
REM http://framework.zend.com/license/new-bsd
REM If you did not receive a copy of the license and are unable to
REM obtain it through the world-wide-web, please send an email
REM to license@zend.com so we can send you a copy immediately.
REM
REM Zend
REM Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
REM http://framework.zend.com/license/new-bsd New BSD License
REM Test to see if this was installed via pear
SET ZTMPZTMPZTMPZ=@ph
SET TMPZTMPZTMP=%ZTMPZTMPZTMPZ%p_bin@
REM below @php_bin@
FOR %%x IN ("@php_bin@") DO (if %%x=="%TMPZTMPZTMP%" GOTO :NON_PEAR_INSTALLED)
GOTO PEAR_INSTALLED
:NON_PEAR_INSTALLED
REM Assume php.exe is executable, and that zf.php will reside in the
REM same file as this one
SET PHP_BIN=php.exe
SET PHP_DIR=%~dp0
GOTO RUN
:PEAR_INSTALLED
REM Assume this was installed via PEAR and use replacements php_bin & php_dir
SET PHP_BIN=@php_bin@
SET PHP_DIR=@php_dir@
GOTO RUN
:RUN
SET ZF_SCRIPT=%PHP_DIR%\zf.php
"%PHP_BIN%" -d safe_mode=Off -f "%ZF_SCRIPT%" -- %*

624
bin/zf.php Normal file
View File

@ -0,0 +1,624 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Tool
* @subpackage Framework
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/
/**
* ZF
*
* @category Zend
* @package Zend_Tool
* @subpackage Framework
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class ZF
{
/**
* @var bool
*/
protected $_clientLoaded = false;
/**
* @var string
*/
protected $_mode = 'runTool';
/**
* @var array of messages
*/
protected $_messages = array();
/**
* @var string
*/
protected $_homeDirectory = null;
/**
* @var string
*/
protected $_storageDirectory = null;
/**
* @var string
*/
protected $_configFile = null;
/**
* main()
*
* @return void
*/
public static function main()
{
$zf = new self();
$zf->bootstrap();
$zf->run();
}
/**
* bootstrap()
*
* @return ZF
*/
public function bootstrap()
{
// detect settings
$this->_mode = $this->_detectMode();
$this->_homeDirectory = $this->_detectHomeDirectory();
$this->_storageDirectory = $this->_detectStorageDirectory();
$this->_configFile = $this->_detectConfigFile();
// setup
$this->_setupPHPRuntime();
$this->_setupToolRuntime();
}
/**
* run()
*
* @return ZF
*/
public function run()
{
switch ($this->_mode) {
case 'runError':
$this->_runError();
$this->_runInfo();
break;
case 'runSetup':
if ($this->_runSetup() === false) {
$this->_runInfo();
}
break;
case 'runInfo':
$this->_runInfo();
break;
case 'runTool':
default:
$this->_runTool();
break;
}
return $this;
}
/**
* _detectMode()
*
* @return ZF
*/
protected function _detectMode()
{
$arguments = $_SERVER['argv'];
$mode = 'runTool';
if (!isset($arguments[0])) {
return $mode;
}
if ($arguments[0] == $_SERVER['PHP_SELF']) {
$this->_executable = array_shift($arguments);
}
if (!isset($arguments[0])) {
return $mode;
}
if ($arguments[0] == '--setup') {
$mode = 'runSetup';
} elseif ($arguments[0] == '--info') {
$mode = 'runInfo';
}
return $mode;
}
/**
* _detectHomeDirectory() - detect the home directory in a variety of different places
*
* @param bool $mustExist Should the returned value already exist in the file system
* @param bool $returnMessages Should it log messages for output later
* @return string
*/
protected function _detectHomeDirectory($mustExist = true, $returnMessages = true)
{
$homeDirectory = null;
$homeDirectory = getenv('ZF_HOME'); // check env var ZF_HOME
if ($homeDirectory) {
$this->_logMessage('Home directory found in environment variable ZF_HOME with value ' . $homeDirectory, $returnMessages);
if (!$mustExist || ($mustExist && file_exists($homeDirectory))) {
return $homeDirectory;
} else {
$this->_logMessage('Home directory does not exist at ' . $homeDirectory, $returnMessages);
}
}
$homeDirectory = getenv('HOME'); // HOME environment variable
if ($homeDirectory) {
$this->_logMessage('Home directory found in environment variable HOME with value ' . $homeDirectory, $returnMessages);
if (!$mustExist || ($mustExist && file_exists($homeDirectory))) {
return $homeDirectory;
} else {
$this->_logMessage('Home directory does not exist at ' . $homeDirectory, $returnMessages);
}
}
$homeDirectory = getenv('HOMEPATH');
if ($homeDirectory) {
$this->_logMessage('Home directory found in environment variable HOMEPATH with value ' . $homeDirectory, $returnMessages);
if (!$mustExist || ($mustExist && file_exists($homeDirectory))) {
return $homeDirectory;
} else {
$this->_logMessage('Home directory does not exist at ' . $homeDirectory, $returnMessages);
}
}
$homeDirectory = getenv('USERPROFILE');
if ($homeDirectory) {
$this->_logMessage('Home directory found in environment variable USERPROFILE with value ' . $homeDirectory, $returnMessages);
if (!$mustExist || ($mustExist && file_exists($homeDirectory))) {
return $homeDirectory;
} else {
$this->_logMessage('Home directory does not exist at ' . $homeDirectory, $returnMessages);
}
}
return false;
}
/**
* _detectStorageDirectory() - Detect where the storage directory is from a variaty of possiblities
*
* @param bool $mustExist Should the returned value already exist in the file system
* @param bool $returnMessages Should it log messages for output later
* @return string
*/
protected function _detectStorageDirectory($mustExist = true, $returnMessages = true)
{
$storageDirectory = false;
$storageDirectory = getenv('ZF_STORAGE_DIR');
if ($storageDirectory) {
$this->_logMessage('Storage directory path found in environment variable ZF_STORAGE_DIR with value ' . $storageDirectory, $returnMessages);
if (!$mustExist || ($mustExist && file_exists($storageDirectory))) {
return $storageDirectory;
} else {
$this->_logMessage('Storage directory does not exist at ' . $storageDirectory, $returnMessages);
}
}
$homeDirectory = ($this->_homeDirectory) ? $this->_homeDirectory : $this->_detectHomeDirectory(true, false);
if ($homeDirectory) {
$storageDirectory = $homeDirectory . '/.zf/';
$this->_logMessage('Storage directory assumed in home directory at location ' . $storageDirectory, $returnMessages);
if (!$mustExist || ($mustExist && file_exists($storageDirectory))) {
return $storageDirectory;
} else {
$this->_logMessage('Storage directory does not exist at ' . $storageDirectory, $returnMessages);
}
}
return false;
}
/**
* _detectConfigFile() - Detect config file location from a variety of possibilities
*
* @param bool $mustExist Should the returned value already exist in the file system
* @param bool $returnMessages Should it log messages for output later
* @return string
*/
protected function _detectConfigFile($mustExist = true, $returnMessages = true)
{
$configFile = null;
$configFile = getenv('ZF_CONFIG_FILE');
if ($configFile) {
$this->_logMessage('Config file found environment variable ZF_CONFIG_FILE at ' . $configFile, $returnMessages);
if (!$mustExist || ($mustExist && file_exists($configFile))) {
return $configFile;
} else {
$this->_logMessage('Config file does not exist at ' . $configFile, $returnMessages);
}
}
$homeDirectory = ($this->_homeDirectory) ? $this->_homeDirectory : $this->_detectHomeDirectory(true, false);
if ($homeDirectory) {
$configFile = $homeDirectory . '/.zf.ini';
$this->_logMessage('Config file assumed in home directory at location ' . $configFile, $returnMessages);
if (!$mustExist || ($mustExist && file_exists($configFile))) {
return $configFile;
} else {
$this->_logMessage('Config file does not exist at ' . $configFile, $returnMessages);
}
}
$storageDirectory = ($this->_storageDirectory) ? $this->_storageDirectory : $this->_detectStorageDirectory(true, false);
if ($storageDirectory) {
$configFile = $storageDirectory . '/zf.ini';
$this->_logMessage('Config file assumed in storage directory at location ' . $configFile, $returnMessages);
if (!$mustExist || ($mustExist && file_exists($configFile))) {
return $configFile;
} else {
$this->_logMessage('Config file does not exist at ' . $configFile, $returnMessages);
}
}
return false;
}
/**
* _setupPHPRuntime() - parse the config file if it exists for php ini values to set
*
* @return void
*/
protected function _setupPHPRuntime()
{
// set php runtime settings
ini_set('display_errors', true);
// support the changing of the current working directory, necessary for some providers
$cwd = getenv('ZEND_TOOL_CURRENT_WORKING_DIRECTORY');
if ($cwd != '' && realpath($cwd)) {
chdir($cwd);
}
if (!$this->_configFile) {
return;
}
$zfINISettings = parse_ini_file($this->_configFile);
$phpINISettings = ini_get_all();
foreach ($zfINISettings as $zfINIKey => $zfINIValue) {
if (substr($zfINIKey, 0, 4) === 'php.') {
$phpINIKey = substr($zfINIKey, 4);
if (array_key_exists($phpINIKey, $phpINISettings)) {
ini_set($phpINIKey, $zfINIValue);
}
}
}
}
/**
* _setupToolRuntime() - setup the tools include_path and load the proper framwork parts that
* enable Zend_Tool to work.
*
* @return void
*/
protected function _setupToolRuntime()
{
$includePathPrepend = getenv('ZEND_TOOL_INCLUDE_PATH_PREPEND');
$includePathFull = getenv('ZEND_TOOL_INCLUDE_PATH');
// check if the user has not provided anything
if (!($includePathPrepend || $includePathFull)) {
if ($this->_tryClientLoad()) {
return;
}
}
// if ZF is not in the include_path, but relative to this file, put it in the include_path
if ($includePathPrepend || $includePathFull) {
if (isset($includePathPrepend) && ($includePathPrepend !== false)) {
set_include_path($includePathPrepend . PATH_SEPARATOR . get_include_path());
} elseif (isset($includePathFull) && ($includePathFull !== false)) {
set_include_path($includePathFull);
}
}
if ($this->_tryClientLoad()) {
return;
}
$zfIncludePath['relativePath'] = dirname(__FILE__) . '/../library/';
if (file_exists($zfIncludePath['relativePath'] . 'Zend/Tool/Framework/Client/Console.php')) {
set_include_path(realpath($zfIncludePath['relativePath']) . PATH_SEPARATOR . get_include_path());
}
if (!$this->_tryClientLoad()) {
$this->_mode = 'runError';
return;
}
}
/**
* _tryClientLoad() - Attempt to load the Zend_Tool_Framework_Client_Console to enable the tool to run.
*
* This method will return false if its not loaded to allow the consumer to alter the environment in such
* a way that it can be called again to try loading the proper file/class.
*
* @return bool if the client is actuall loaded or not
*/
protected function _tryClientLoad()
{
$this->_clientLoaded = false;
$fh = @fopen('Zend/Tool/Framework/Client/Console.php', 'r', true);
if (!$fh) {
return $this->_clientLoaded; // false
} else {
fclose($fh);
unset($fh);
include 'Zend/Tool/Framework/Client/Console.php';
$this->_clientLoaded = class_exists('Zend_Tool_Framework_Client_Console');
}
return $this->_clientLoaded;
}
/**
* _runError() - Output the error screen that tells the user that the tool was not setup
* in a sane way
*
* @return void
*/
protected function _runError()
{
echo <<<EOS
***************************** ZF ERROR ********************************
In order to run the zf command, you need to ensure that Zend Framework
is inside your include_path. There are a variety of ways that you can
ensure that this zf command line tool knows where the Zend Framework
library is on your system, but not all of them can be described here.
The easiest way to get the zf command running is to give it the include
path via an environment variable ZEND_TOOL_INCLUDE_PATH or
ZEND_TOOL_INCLUDE_PATH_PREPEND with the proper include path to use,
then run the command "zf --setup". This command is designed to create
a storage location for your user, as well as create the zf.ini file
that the zf command will consult in order to run properly on your
system.
Example you would run:
$ ZEND_TOOL_INCLUDE_PATH=/path/to/library zf --setup
Your are encourged to read more in the link that follows.
EOS;
}
/**
* _runInfo() - this command will produce information about the setup of this script and
* Zend_Tool
*
* @return void
*/
protected function _runInfo()
{
echo 'Zend_Tool & CLI Setup Information' . PHP_EOL
. '(available via the command line "zf --info")'
. PHP_EOL;
echo ' * ' . implode(PHP_EOL . ' * ', $this->_messages) . PHP_EOL;
echo PHP_EOL;
echo 'To change the setup of this tool, run: "zf --setup"';
echo PHP_EOL;
}
/**
* _runSetup() - parse the request to see which setup command to run
*
* @return void
*/
protected function _runSetup()
{
$setupCommand = (isset($_SERVER['argv'][2])) ? $_SERVER['argv'][2] : null;
switch ($setupCommand) {
case 'storage-directory':
$this->_runSetupStorageDirectory();
break;
case 'config-file':
$this->_runSetupConfigFile();
break;
default:
$this->_runSetupMoreInfo();
break;
}
}
/**
* _runSetupStorageDirectory() - if the storage directory does not exist, create it
*
* @return void
*/
protected function _runSetupStorageDirectory()
{
$storageDirectory = $this->_detectStorageDirectory(false, false);
if (file_exists($storageDirectory)) {
echo 'Directory already exists at ' . $storageDirectory . PHP_EOL
. 'Cannot create storage directory.';
return;
}
mkdir($storageDirectory);
echo 'Storage directory created at ' . $storageDirectory . PHP_EOL;
}
/**
* _runSetupConfigFile()
*
* @return void
*/
protected function _runSetupConfigFile()
{
$configFile = $this->_detectConfigFile(false, false);
if (file_exists($configFile)) {
echo 'File already exists at ' . $configFile . PHP_EOL
. 'Cannot write new config file.';
return;
}
$includePath = get_include_path();
$contents = 'php.include_path = "' . $includePath . '"';
file_put_contents($configFile, $contents);
$iniValues = ini_get_all();
if ($iniValues['include_path']['global_value'] != $iniValues['include_path']['local_value']) {
echo 'NOTE: the php include_path to be used with the tool has been written' . PHP_EOL
. 'to the config file, using ZEND_TOOL_INCLUDE_PATH (or other include_path setters)' . PHP_EOL
. 'is no longer necessary.' . PHP_EOL . PHP_EOL;
}
echo 'Config file written to ' . $configFile . PHP_EOL;
}
/**
* _runSetupMoreInfo() - return more information about what can be setup, and what is setup
*
* @return void
*/
protected function _runSetupMoreInfo()
{
$homeDirectory = $this->_detectHomeDirectory(false, false);
$storageDirectory = $this->_detectStorageDirectory(false, false);
$configFile = $this->_detectConfigFile(false, false);
echo <<<EOS
ZF Command Line Tool - Setup
----------------------------
Current Paths (Existing or not):
Home Directory: {$homeDirectory}
Storage Directory: {$storageDirectory}
Config File: {$configFile}
Important Environment Variables:
ZF_HOME
- the directory this tool will look for a home directory
- directory must exist
ZF_STORAGE_DIR
- where this tool will look for a storage directory
- directory must exist
ZF_CONFIG_FILE
- where this tool will look for a configuration file
ZF_TOOL_INCLUDE_PATH
- set the include_path for this tool to use this value
ZF_TOOL_INCLUDE_PATH_PREPEND
- prepend the current php.ini include_path with this value
Search Order:
Home Directory:
- ZF_HOME, then HOME (*nix), then HOMEPATH (windows)
Storage Directory:
- ZF_STORAGE_DIR, then {home}/.zf/
Config File:
- ZF_CONFIG_FILE, then {home}/.zf.ini, then {home}/zf.ini,
then {storage}/zf.ini
Commands:
zf --setup storage-directory
- setup the storage directory, directory will be created
zf --setup config-file
- create the config file with some default values
EOS;
}
/**
* _runTool() - This is where the magic happens, dispatch Zend_Tool
*
* @return void
*/
protected function _runTool()
{
$configOptions = array();
if (isset($this->_configFile) && $this->_configFile) {
$configOptions['configOptions']['configFilepath'] = $this->_configFile;
}
if (isset($this->_storageDirectory) && $this->_storageDirectory) {
$configOptions['storageOptions']['directory'] = $this->_storageDirectory;
}
// ensure that zf.php loads the Zend_Tool_Project features
$configOptions['classesToLoad'] = 'Zend_Tool_Project_Provider_Manifest';
$console = new Zend_Tool_Framework_Client_Console($configOptions);
$console->dispatch();
}
/**
* _logMessage() - Internal method used to log setup and information messages.
*
* @param string $message
* @param bool $storeMessage
* @return void
*/
protected function _logMessage($message, $storeMessage = true)
{
if (!$storeMessage) {
return;
}
$this->_messages[] = $message;
}
}
if (!getenv('ZF_NO_MAIN')) {
ZF::main();
}

45
bin/zf.sh Normal file
View File

@ -0,0 +1,45 @@
#!/bin/sh
#############################################################################
# Zend Framework
#
# LICENSE
#
# This source file is subject to the new BSD license that is bundled
# with this package in the file LICENSE.txt.
# It is also available through the world-wide-web at this URL:
# http://framework.zend.com/license/new-bsd
# If you did not receive a copy of the license and are unable to
# obtain it through the world-wide-web, please send an email
# to license@zend.com so we can send you a copy immediately.
#
# Zend
# Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
# http://framework.zend.com/license/new-bsd New BSD License
#############################################################################
# find php: pear first, command -v second, straight up php lastly
if test "@php_bin@" != '@'php_bin'@'; then
PHP_BIN="@php_bin@"
elif command -v php 1>/dev/null 2>/dev/null; then
PHP_BIN=`command -v php`
else
PHP_BIN=php
fi
# find zf.php: pear first, same directory 2nd,
if test "@php_dir@" != '@'php_dir'@'; then
PHP_DIR="@php_dir@"
else
SELF_LINK="$0"
SELF_LINK_TMP="$(readlink "$SELF_LINK")"
while test -n "$SELF_LINK_TMP"; do
SELF_LINK="$SELF_LINK_TMP"
SELF_LINK_TMP="$(readlink "$SELF_LINK")"
done
PHP_DIR="$(dirname "$SELF_LINK")"
fi
"$PHP_BIN" -d safe_mode=Off -f "$PHP_DIR/zf.php" -- "$@"

View File

@ -0,0 +1,7 @@
<?php
$dirname_52e8e680d03e7 = dirname(__FILE__);
return array (
'Application_Controller_Plugin_Auth' => $dirname_52e8e680d03e7 . DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . 'Plugin' . DIRECTORY_SEPARATOR . 'Auth.php',
'Application_Controller_Plugin_Services' => $dirname_52e8e680d03e7 . DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . 'Plugin' . DIRECTORY_SEPARATOR . 'Services.php',
'Application_Form_Login' => $dirname_52e8e680d03e7 . DIRECTORY_SEPARATOR . 'Form' . DIRECTORY_SEPARATOR . 'Login.php',
);

View File

@ -209,23 +209,20 @@ class Metier_Infogreffe
*/
protected function error($xml)
{
if (!empty($xml))
{
if ( !empty($xml) ) {
$doc = new DOMDocument();
$load = $doc->loadXML($xml, LIBXML_NOERROR | LIBXML_NOWARNING);
if (!$load) {
if ( !$load ) {
$tmp = explode('-', $xml);
$errNum = intval($tmp[0]);
$errMsg = $tmp[1];
if( $errNum == '5' ){
$errMsg = 'Service partenaire indisponible.';
}
throw new Exception($errNum . '-' . $errMsg);
throw new Exception($errMsg, $errNum);
}
}
else
{
throw new Exception('Fichier vide');
else {
throw new Exception('XML content is empty.');
}
}
@ -238,7 +235,7 @@ class Metier_Infogreffe
*/
protected function download($url, $filename)
{
$file = $file = $this->config->storage->path . DIRECTORY_SEPARATOR . $filename;
$file = $this->config->storage->path . '/' . $filename;
$fp = fopen($file, 'w');
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FILE, $fp);
@ -293,8 +290,6 @@ class Metier_Infogreffe
$emetteur->addChild('code_abonne', $this->config->user);
$emetteur->addChild('mot_passe', $this->config->password);
//Set Command ID
$emetteur->addChild('reference_client', $this->reference_client);
$code_requete = $emetteur->addChild('code_requete');
$code_requete->addChild('type_profil', 'A');
$code_requete->addChild('origine_emetteur', 'IC');
@ -325,10 +320,11 @@ class Metier_Infogreffe
// Commande de documents : bilan saisie ou bilan complet
if ( ($this->type_document=='BS' || $this->type_document=='BI') )
{
$commande->addChild('greffe',$this->greffe);
$commande->addChild('dossier_millesime',$this->dossier_millesime);
$commande->addChild('dossier_statut',$this->dossier_statut);
$commande->addChild('dossier_chrono',$this->dossier_chrono);
$num_gest = $commande->addChild('num_gest');
$num_gest->addChild('greffe',$this->greffe);
$num_gest->addChild('dossier_millesime',$this->dossier_millesime);
$num_gest->addChild('dossier_statut',$this->dossier_statut);
$num_gest->addChild('dossier_chrono',$this->dossier_chrono);
$commande->addChild('num_depot',$this->num_depot);
//Date de cloture au format dd/MM/yyyy
$commande->addChild('date_cloture', $this->date_cloture);
@ -336,16 +332,20 @@ class Metier_Infogreffe
// Commande de documents : actes
elseif ( $this->type_document=='AC' )
{
$commande->addChild('greffe',$this->greffe);
$commande->addChild('dossier_millesime',$this->dossier_millesime);
$commande->addChild('dossier_statut',$this->dossier_statut);
$commande->addChild('dossier_chrono',$this->dossier_chrono);
$num_gest = $commande->addChild('num_gest');
$num_gest->addChild('greffe',$this->greffe);
$num_gest->addChild('dossier_millesime',$this->dossier_millesime);
$num_gest->addChild('dossier_statut',$this->dossier_statut);
$num_gest->addChild('dossier_chrono',$this->dossier_chrono);
$commande->addChild('num_depot',$this->num_depot);
$liste_actes = $commande->addChild('liste_actes');
$liste_actes->addChild('acte')->addAttribute('num', $this->num);
}
}
//Set Command ID
$commande->addChild('reference_client', $this->reference_client);
$xml = str_replace('<?xml version="1.0"?>', '', $xml->asXML());
$this->xml = $xml;
@ -361,8 +361,7 @@ class Metier_Infogreffe
{
$this->setXML();
//Be sure it's in UTF-8
$req = utf8_encode($this->xml);
$req = $this->xml;
if ($this->debug) {
file_put_contents($this->type_document.'-'.$this->siren.'-'.$this->mode_diffusion.'.query', $this->xml);
@ -400,6 +399,10 @@ class Metier_Infogreffe
$response = str_replace("<?xml version='1.0' encoding='UTF-8'?><SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'><SOAP-ENV:Body><ns0:getProduitsWebServicesXMLResponse xmlns:ns0='urn:local' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'><return xsi:type='xsd:string'>", '', $response);
$response = str_replace('</return></ns0:getProduitsWebServicesXMLResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>','', $response);
if ($this->debug) {
file_put_contents($this->type_document.'-'.$this->siren.'-'.$this->mode_diffusion.'.response', $response);
}
return $response;
}
}

View File

@ -47,13 +47,13 @@ class Metier_Infogreffe_Ac extends Metier_Infogreffe
//Requete WebService
$actesXML = null;
if ( $onlyDb === false ) {
$this->debug = true;
//Infogreffe webservice
try {
$xml = $this->callRequest();
} catch( Exception $e ) {
//file_put_contents('debug.log', $e->getMessage());
//@todo : get error message
return array();
//return array();
}
$actesXML = $this->formatList($xml);
}
@ -62,6 +62,9 @@ class Metier_Infogreffe_Ac extends Metier_Infogreffe
$actesM = new Application_Model_JoGreffesActes($this->db);
$sql = $actesM->select()
->where('siren=?', $this->siren)
->order('date_depot DESC')
->order('num_depot DESC')
->order('num_acte ASC')
->order('date_acte DESC');
$rows = $actesM->fetchAll($sql);
@ -74,7 +77,7 @@ class Metier_Infogreffe_Ac extends Metier_Infogreffe
$item->FileNumberOfPages = $row->pdfPage;
$item->DepotNum = $row->num_depot;
$item->DepotDate = $row->date_depot;
$item->ActeNum = $row->num_acte;
$item->ActeNum = str_pad($row->num_acte, 2, '0', STR_PAD_LEFT);
$item->ActeDate = $row->date_acte;
$item->ActeNumberOfPages = $row->nbpages_acte;
$item->ActeType = $row->type_acte;
@ -111,11 +114,12 @@ class Metier_Infogreffe_Ac extends Metier_Infogreffe
* @param string $acteType
* @param string $acteDate
* @param int $acteNum
* @param int $orderId
* @throws Exception
* @return string
* Return the full path of the file
*/
public function getCommandeT($depotDate, $depotNum, $acteType, $acteDate, $acteNum)
public function getCommandeT($depotDate, $depotNum, $acteType, $acteDate, $acteNum, $orderId = null)
{
$this->mode_diffusion = 'T';
$this->reference_client = 'T'.date('YmdHis');
@ -164,12 +168,19 @@ class Metier_Infogreffe_Ac extends Metier_Infogreffe
$xml = $this->callRequest();
$acte = $this->formatItem($xml);
$url = $acte['url_acces'];
if (empty($url)) {
throw new Exception('File url not given');
}
if ( $orderId !== null ) {
$commandeM = new Application_Model_Sdv1GreffeCommandesAc();
$commandeM->update(array(
'cmdUrl'=> $url,
'dateCommande' => date('YmdHis'),
), 'id='.$orderId);
}
//Set the filename
$filename = $this->getFilePath($date) . DIRECTORY_SEPARATOR . $this->getFileName($date, $num, $type, $options);
@ -215,6 +226,7 @@ class Metier_Infogreffe_Ac extends Metier_Infogreffe
throw new Exception('Not exist');
}
$this->mode_diffusion = 'C';
$this->reference_client = $reference;
//Générer les paramètres de commande depuis la base de données
@ -225,14 +237,16 @@ class Metier_Infogreffe_Ac extends Metier_Infogreffe
$this->num_depot = $row->num_depot;
$this->type_acte = $row->type_acte;
$this->date_acte = $row->date_acte;
$this->num = $row->num_acte;
$this->num = str_pad($row->num_acte, 2, '0', STR_PAD_LEFT);
//Faire la requete
try {
$xml = $this->callRequest();
} catch(Exception $e) {
//@todo : Gestion des erreurs
return false;
//La prise en charge du courrier est effective
if ( $e->getCode() != 17 ) {
throw new Exception($e->getMessage());
}
}
return true;
@ -263,7 +277,11 @@ class Metier_Infogreffe_Ac extends Metier_Infogreffe
*/
public function getFilePath($date)
{
return 'actes' . DIRECTORY_SEPARATOR . substr($date,0,4) . DIRECTORY_SEPARATOR . substr($date,5,2);
$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;
}
/**
@ -300,6 +318,9 @@ class Metier_Infogreffe_Ac extends Metier_Infogreffe
{
$actenum = array();
$actenum['date_acte'] = $infoActe->getElementsByTagName('date_acte')->item(0)->nodeValue;
if ($infoActe->getElementsByTagName('date_acte')->item(0)->nodeValue == '') {
$actenum['date_acte'] = '0000-00-00';
}
$actenum['num_acte'] = $infoActe->getElementsByTagName('num_acte')->item(0)->nodeValue;
$actenum['type_acte'] = $infoActe->getElementsByTagName('type_acte')->item(0)->nodeValue;
$actenum['type_acte_libelle'] = $infoActe->getElementsByTagName('type_acte_libelle')->item(0)->nodeValue;
@ -406,60 +427,72 @@ class Metier_Infogreffe_Ac extends Metier_Infogreffe
*/
protected function dbUpdateItem($list)
{
//siren
//numRC
//numGreffe
//num_depot
//date_depot
//date_acte
//num_acte
//type_acte => Attention garder la version 1 et 2
//type_acte_libelle
//nbpages_acte
//decision_nature
//decision_libelle
//mode_diffusion
foreach ($list['depot'] as $depot) {
$data = array(
'siren' => $list['num_siren'],
'numRC' => $list['num_gest']['dossier_millesime'].
$list['num_gest']['dossier_statut'].$list['num_gest']['dossier_chrono'],
'numGreffe' => $list['num_gest']['greffe'],
'num_depot' => $list['num_depot'],
'date_depot' => $list['date_depot'],
'date_acte' => $depot['date_acte'],
'num_acte' => $depot['num_acte'],
'type_acte' => $depot['type_acte'],
'type_acte_libelle' => $depot['type_acte_libelle'],
'nbpages_acte' => $depot['nbpages_acte'],
'decision_nature' => empty($depot['decision']['nature']) ? '' : $depot['decision']['nature'] ,
'decision_libelle' => empty($depot['decision']['libelle']) ? '' : $depot['decision']['libelle'] ,
'mode_diffusion' => join(',',$depot['mode_diffusion']),
);
$data = array(
'siren' => $list['siren'],
'numRC' => $list['num_gest']['dossier_millesime'].
$list['num_gest']['dossier_statut'].$list['num_gest']['dossier_chrono'],
'numGreffe' => $list['num_gest']['greffe'],
'num_depot' => $list['num_depot'],
'date_depot' => $list['date_depot'],
'date_acte' => $list['date_acte'],
'num_acte' => $list['num_acte'],
'type_acte' => $list['type_acte'], //@todo : Attention type acte différent
'type_acte_libelle' => $list['type_acte_libelle'],
'nbpages_acte' => $list['nbpages_acte'],
'decision_nature' => $list['decision']['nature'],
'decision_libelle' => $list['decision']['libelle'],
'mode_diffusion' => join(',',$list['mode_diffusion']),
);
//Only new element are inserted
try {
$acteM = new Application_Model_JoGreffesActes($this->db);
$acteM->select()
->where('siren=?', $list['siren'])
->where('num_depot=?', $list['num_depot'])
->where('date_depot=?', $list['date_depot'])
->where('date_acte=?', $list['date_acte'])
->where('num_acte=?', $list['num_acte']);
if ( null === $acteM->fetchRow($sql) ) {
$result = $acteM->insert($data);
//Only new element are inserted
try {
$acteM = new Application_Model_JoGreffesActes($this->db);
$sql = $acteM->select()
->where('siren=?', $list['num_siren'])
->where('num_depot=?', $list['num_depot'])
//->where('date_depot=?', $list['date_depot'])
//->where('date_acte=?', $depot['date_acte'])
->where('num_acte=?', intval($depot['num_acte']))
->order('dateInsert DESC');
$rows = $acteM->fetchAll($sql);
} catch(Zend_Db_Adapter_Exception $e) {
throw new Exception('ERR', $e->getMessage());
}
} catch(Zend_Db_Adapter_Exception $e) {
throw new Exception($e->getMessage());
} catch(Zend_Db_Exception $e) {
throw new Exception($e->getMessage());
//Insert new element
if ( count($rows)==0 ) {
try {
$result = $acteM->insert($data);
} catch(Zend_Exception $e) {
throw new Exception($e->getMessage());
}
}
//Update information
else {
//Correct multiple item
$item = $rows[0];
if ( count($rows) > 1 ) {
try {
$result = $acteM->delete('id='.$item->id);
} catch(Zend_Exception $e) {
throw new Exception($e->getMessage());
}
$item = $rows[1];
}
//Correct type
if ( $depot['type_acte'] != $item->type_acte ) {
try {
$result = $acteM->update($data, 'id='.$item->id);
} catch(Zend_Exception $e) {
throw new Exception($e->getMessage());
}
}
}
}
if ($result) {
return true;
}
return false;
return true;
}
/**

View File

@ -54,7 +54,6 @@ class Metier_Infogreffe_Bi extends Metier_Infogreffe
//Requete WebService
$bilansXML = null;
if ( $onlyDb === false ) {
$this->debug = true;
//Infogreffe webservice
try {
$xml = $this->callRequest();
@ -82,14 +81,14 @@ class Metier_Infogreffe_Bi extends Metier_Infogreffe
$item->Millesime = $row->millesime;
$item->NumDepot = $row->num_depot;
$item->DateCloture = $row->date_cloture;
if ( empty($type_comptes) ) {
if ( empty($rows->type_comptes) ) {
$item->Type = 'sociaux';
} else {
$item->Type = $row->type_comptes;
}
$mode_diffusion = explode(',', $row->mode_diffusion);
if (in_array('T',$mode_diffusion) || !empty($item->File)) {
if (in_array('T', $mode_diffusion) || !empty($item->File)) {
$item->ModeDiffusion = 'T';
} elseif (in_array('C',$mode_diffusion)) {
$item->ModeDiffusion = 'C';
@ -97,6 +96,33 @@ class Metier_Infogreffe_Bi extends Metier_Infogreffe
$item->ModeDiffusion = '';
}
$item->DureeExercice = $row->duree_exercice;
$item->SaisieDate = $row->saisie_date;
$item->SaisieCode = $row->saisie_code;
switch ( $row->saisie_code ) {
case '00': $item->SaisieLabel = "Bilan saisi sans anomalie"; break;
case '01': $item->SaisieLabel = "Bilan saisi avec des incohérences comptables à la source du document (issues du remettant)"; break;
case '02': $item->SaisieLabel = "Bilan avec Actif, Passif ou Compte de Résultat nul"; break;
case '03': $item->SaisieLabel = "Bilan incomplet (des pages manquent)"; break;
case '04': $item->SaisieLabel = "Bilan complet non détaillé (seuls les totaux et sous totaux sont renseignés)"; break;
case '05': $item->SaisieLabel = "Bilan reçu en double exemplaire"; break;
case '06': $item->SaisieLabel = "Bilan intermédiaire - Situation provisoire"; break;
case '07': $item->SaisieLabel = "Bilan illisible"; break;
case 'A7': $item->SaisieLabel = "Bilan illisible, présentant un cadre gris très foncés (dans lesquels sont inscrits en général les totaux)"; break;
case 'B7': $item->SaisieLabel = "Bilan manuscrits"; break;
case 'C7': $item->SaisieLabel = "Bilan illisible, présentant des caractères trop gras"; break;
case 'D7': $item->SaisieLabel = "Bilan scanné en biais ou qui présentent des pages rognées"; break;
case 'E7': $item->SaisieLabel = "Bilan numérisés trop clairement (comme une imprimante dont la cartouche est presque vide)"; break;
case 'F7': $item->SaisieLabel = "Bilan illisible"; break;
case '08': $item->SaisieLabel = "Bilan consolidé"; break;
case '09': $item->SaisieLabel = "Déclaration d'impôts"; break;
case '10': $item->SaisieLabel = "Document autre que bilan"; break;
case '11': $item->SaisieLabel = "Bilan de clôture de liquidation"; break;
case '12': $item->SaisieLabel = "Bilan de Société financière"; break;
case '13': $item->SaisieLabel = "Bilan de Société d'assurance"; break;
case '14': $item->SaisieLabel = "Bilan de Société immobilière"; break;
case '15': $item->SaisieLabel = "Bilan de Société étrangère"; break;
default: $item->SaisieLabel = ""; break;
}
$bilans[] = $item;
}
}
@ -111,44 +137,44 @@ class Metier_Infogreffe_Bi extends Metier_Infogreffe
* Format AAAA-MM-DD
* @param string $type
* sociaux ou consolides
* @params int $orderId
* Id de commande pour l'enregistrement dans la table de gestion
* @throws Exception
* @return string
* Return path (not complete) and filename
*/
public function getCommandeT($dateCloture = null, $type = 'sociaux')
public function getCommandeT($dateCloture = null, $type = 'sociaux', $orderId = null)
{
$this->mode_diffusion = 'T';
$this->reference_client = 'T'.date('YmdHis');
//Lire dans la base de données
$bilansM = new Application_Model_JoGreffesBilans();
$sql = $bilansM->select()
->where('siren=?', $this->siren)
->where('date_cloture=?', $dateCloture);
if ( $type == 'sociaux' || $type == '' ) {
$sql->where("(type='sociaux' OR type='')");
$sql->where("(type_comptes='sociaux' OR type_comptes='')");
} else {
$sql->where('type=?',$type);
$sql->where('type_comptes=?',$type);
}
$row = $bilansM->fetchRow($sql);
if ( null === $row ) {
throw new Exception('Not exist');
throw new Exception("Element doesn't exist");
}
if ($row->pdfLink != '') {
//Set filename
$filename = $this->getFilePath($type, $dateCloture) .
DIRECTORY_SEPARATOR .
$this->getFileName($type, $dateCloture);
$filename = $this->getFilePath($type, $dateCloture) . '/' . $this->getFileName($type, $dateCloture);
//Check if filename exist
if ( !file_exists($this->config->storage->path . DIRECTORY_SEPARATOR . $filename) ) {
if ( !file_exists($this->config->storage->path . '/' . $filename) ) {
throw new Exception('File not found');
}
} else {
$this->mode_diffusion = 'T';
$this->reference_client = 'T'.date('YmdHis');
$this->greffe = $row->numGreffe;
$this->dossier_millesime = substr($row->numRC,0,2);
$this->dossier_statut = substr($row->numRC,2,1);
@ -159,22 +185,25 @@ class Metier_Infogreffe_Bi extends Metier_Infogreffe
try {
$xml = $this->callRequest();
} catch(Exception $e) {
//@todo : Error
//Erreur commande webservice
throw new Exception($e->getMessage(), $e->getCode());
}
$bilan = $this->formatItem($xml);
$url = $bilan['url_acces'];
if (empty($url)) {
if ( empty($url) ) {
throw new Exception('File url not given');
}
if ( $orderId !== null ) {
$commandeM = new Application_Model_Sdv1GreffeCommandesBi();
$commandeM->update(array(
'cmdUrl'=> $url,
'dateCommande' => date('YmdHis'),
), 'id='.$orderId);
}
//Set the filename
$filename = $this->getFilePath($type, $dateCloture) .
DIRECTORY_SEPARATOR .
$this->getFileName($type, $dateCloture);
$filename = $this->getFilePath($type, $dateCloture) . '/' . $this->getFileName($type, $dateCloture);
//Récupérer le fichier
$getfile = $this->download($url, $filename);
@ -209,9 +238,9 @@ class Metier_Infogreffe_Bi extends Metier_Infogreffe
->where('siren=?', $this->siren)
->where('date_cloture=?', $dateCloture);
if ($type=='sociaux') {
$sql->where("(type='sociaux' OR type='')");
$sql->where("(type_comptes='sociaux' OR type_comptes='')");
} else {
$sql->where('type=?',$type);
$sql->where('type_comptes=?',$type);
}
$row = $bilansM->fetchRow($sql);
if ( null === $row ) {
@ -232,8 +261,10 @@ class Metier_Infogreffe_Bi extends Metier_Infogreffe
try {
$xml = $this->callRequest();
} catch(Exception $e) {
//@todo : Gestion des erreurs
return false;
//La prise en charge du courrier est effective
if ( $e->getCode() != 17 ) {
throw new Exception($e->getMessage());
}
}
return true;
@ -251,7 +282,9 @@ class Metier_Infogreffe_Bi extends Metier_Infogreffe
if ($type=='') {
$type = 'sociaux';
}
return 'bilan-' . $this->siren . '-' . $type . '-' . $dateCloture . '.pdf';
$date = substr($dateCloture,0,4).substr($dateCloture,5,2).substr($dateCloture,8,2);
return 'bilan-' . $this->siren . '-' . $type . '-' . $date . '.pdf';
}
/**
@ -266,10 +299,13 @@ class Metier_Infogreffe_Bi extends Metier_Infogreffe
if ($type=='') {
$type = 'sociaux';
}
return 'bilans' . DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR . substr($dateCloture,0,4);
$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;
}
/**
* Format XML to Array for a list of items
* @param string $xml

View File

@ -0,0 +1,80 @@
<definitions
targetNamespace="java:com.experian.webserv.infogreffe"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="java:com.experian.webserv.infogreffe"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<types>
<schema targetNamespace='java:com.experian.webserv.infogreffe'
xmlns='http://www.w3.org/2001/XMLSchema'>
</schema>
</types>
<message name="getProduitsWebServicesXMLRequest">
<part name="arg0" type="xsd:string" />
</message>
<message name="getProduitsWebServicesXMLResponse">
<part name="return" type="xsd:string" />
</message>
<message name="getProduitsWebServicesRequest">
<part name="arg0" type="xsd:string" />
<part name="arg1" type="xsd:string" />
<part name="arg2" type="xsd:string" />
<part name="arg3" type="xsd:string" />
<part name="arg4" type="xsd:string" />
<part name="arg5" type="xsd:string" />
<part name="arg6" type="xsd:string" />
<part name="arg7" type="xsd:string" />
<part name="arg8" type="xsd:string" />
<part name="arg9" type="xsd:string" />
<part name="arg10" type="xsd:string" />
</message>
<message name="getProduitsWebServicesResponse">
<part name="return" type="xsd:string" />
</message>
<message name="getVersionRequest">
</message>
<message name="getVersionResponse">
<part name="return" type="xsd:string" />
</message>
<portType name="WebServicesProduitsPortType">
<operation name="getProduitsWebServicesXML">
<input message="tns:getProduitsWebServicesXMLRequest"/>
<output message="tns:getProduitsWebServicesXMLResponse"/>
</operation>
<operation name="getProduitsWebServices">
<input message="tns:getProduitsWebServicesRequest"/>
<output message="tns:getProduitsWebServicesResponse"/>
</operation>
<operation name="getVersion">
<input message="tns:getVersionRequest"/>
<output message="tns:getVersionResponse"/>
</operation>
</portType>
<binding name="WebServicesProduitsBinding" type="tns:WebServicesProduitsPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getProduitsWebServicesXML">
<soap:operation soapAction="urn:getProduitsWebServicesXML"/>
<input><soap:body use="encoded" namespace='urn:WebServicesProduits' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace='urn:WebServicesProduits' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
<operation name="getProduitsWebServices">
<soap:operation soapAction="urn:getProduitsWebServices"/>
<input><soap:body use="encoded" namespace='urn:WebServicesProduits' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace='urn:WebServicesProduits' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
<operation name="getVersion">
<soap:operation soapAction="urn:getVersion"/>
<input><soap:body use="encoded" namespace='urn:Version' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace='urn:Version' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
</binding>
<service name="WebServicesProduits">
<documentation>Service Soap Experian, Service Produit</documentation>
<port name="WebServicesProduitsPort" binding="tns:WebServicesProduitsBinding">
<soap:address location="https://wsrcte.extelia.fr:80/WSContextInfogreffe/INFOGREFFE"/>
</port>
</service>
</definitions>

View File

@ -1,117 +1,5 @@
<?php
global $tabEvenInsee;
global $timer;
$tabEvenInsee = array(
// Anciens évènements de la quotidienne Insee
'i00'=>'Modification de l\'établissement',
'iOA'=>'Activation économique de l\'établissement par adjonction de moyens de production',
'i0C'=>'Création de l\'établissement',
'iOD'=>'Désactivation économique de l\'établissement par suppression de moyens de production',
'i0F'=>'Fermeture de l\'établissement',
'iOR'=>'Modification simple ou modification de moyen de production de l\'établissement',
'iCC'=>'Création de l\' entreprise par création du premier établissement',
'iRC'=>'Réactivation de l\'entreprise par création de l\'établissement',
'iRR'=>'Réactivation de l\'entreprise par réactivation de l\'établissement',
'iFF'=>'Fermeture de l\'établissement entraînant la fermeture de l\'entreprise',
'iTC'=>'Création de l\'établissement dans le cadre d\'un transfert',
'iTR'=>'Réactivation de l\'établissement dans le cadre d\'un transfert',
'iT0'=>'Modification simple ou de moyens de production sur l\'établissement dans le cadre d\'un transfert',
'iTA'=>'Activation économique de l\'établissement par adjonction de moyens de production dans le cadre d\'un transfert',
'iTD'=>'Désactivation économique de l\'établissement par suppression de moyens de production dans le cadre d\'un transfert',
'iTF'=>'Fermeture de l\'établissement dans le cadre d\'un transfert',
'iER'=>'Modification ERR de l\'établissement',
// Evènements Crées par différentiel de la Mensuelle Insee par S&D
'iM0C'=>'Création de l\'établissement',
'iM0F'=>'Fermeture de l\'établissement',
'iM0R'=>'Réactivation de l\'établissement',
'iM00'=>'Modification de l\'établissement',
'iMAS'=>'Modification de la nature d\'activité et de la saisonalité',
'iMAC'=>'Modification de la nature d\'activité de l\'établissement',
'iMSA'=>'Modification de la saisonalité de l\'établissement',
// Evènements Crées par diff3+4
'iMPF'=>'Etablissement présumé fermé (formalités de création faites par le repreneur)',
'iMNP'=>'Etablissement présumé fermé (retour de courrier en NPAI)',
// Décret n°2010-1042 du 01/09/2010 relatif à l'inscription au registre du commerce et des sociétés et au répertoire national mentionné à l'article R. 123-220 du code de commerce
// Codification provisoire à changer dans l'attente de l'INSEE
'i810'=>'Suppression du SIREN suite au refus d\'inscription au Registre du Commerce et des Sociétés', // Anciennement iRCS
// Nouveaux évènements Sirene3 de la quotidienne Insee
'i110'=>'Création de l\'entreprise',
'i120'=>'Réactivation de l\'entreprise',
'i125'=>'Réactivation de l\'entreprise suite à une mise à jour du répertoire SIRENE',
'i130'=>'Création de l\'établissement',
'i145'=>'Reprise d\'activité de l\'établissement suite à une mise à jour du répertoire SIRENE',
'i400'=>'Suppression du doublon',
'i410'=>'Cessation juridique de l\'entreprise',
'i420'=>'Absence d\'activité de l\'entreprise (cessation économique de l\'entreprise)',
'i425'=>'Absence d\'activité d\'une entreprise suite à une mise à jour au répertoire SIRENE',
'i430'=>'Fermeture de l\'établissement',
'i435'=>'Fermeture de l\'établissement suite à une mise à jour au répertoire SIRENE',
'i510'=>'Création de l\'établissement d\'arrivée et cessation de l\'établissement de départ dans le cadre d\'un transfert',
'i520'=>'Création de l\'établissement d\'arrivée et modification de l\'établissement de départ dans le cadre d\'un transfert',
'i530'=>'Modification de l\'établissement d\'arrivée et cessation de l\'établissement de départ dans le cadre d\'un transfert',
'i540'=>'Modification de l\'établissement d\'arrivée et modification de l\'établissement de départ dans le cadre d\'un transfert',
'i610'=>'Modification d\'activité au niveau du SIREN associé à une activation économique par adjonction de moyens de production',
'i620'=>'Modification d\'activité au niveau du SIREN associé à une désactivation économique par suppression de moyens de production',
'i621'=>'Modification d\'activité du SIREN associé à une désactivation économique par suppression de moyens de production suite à une correction d\'erreur',
'i631'=>'Modification d\'activité du SIREN associé',
'i640'=>'Modification d\'activité au niveau de l\'établissement associée à une activation économique par adjonction de moyens de production',
'i650'=>'Modification d\'activité au niveau de l\'établissement associée à une désactivation économique par suppression de moyens de production',
'i661'=>'Modification d\'activité de l\'établissement',
'i710'=>'Modification de l\'identification du SIREN',
'i711'=>'Modification de l\'identification du SIREN suite à correction d\'erreur',
'i720'=>'Modification de l\'adresse ou de l\'identification de l\'établissement',
'i780'=>'Modification de l\'établissement',
'i781'=>'Modification de l\'établissement suite à correction d\'erreur',
'i795'=>'Personne radiée à sa demande de de la base SIRENE diffusion',
);
global $tabDestinat;
$tabDestinat=array(
'i3'=>'Etablissement vendu',
'i7'=>'Maintien d\'activité, l\'établissement devient siège',
'i8'=>'Maintien d\'activité, l\'établissement devient principal',
'iA'=>'Maintien d\'activité, l\'établissement devient secondaire',
'iB'=>'Etablissement fermé',
'iC'=>'Etablissement supprimé',
'iD'=>'Mise en location-gérance de la totalité du fonds',
'iE'=>'Mise en location-gérance d\'une partie du fonds',
'iF'=>'Cessation d\'activité (pour les liasses agricoles)',
'iG'=>'Mise en location-gérance de la totalité des terres et des bâtiments agricoles (pour les liasses agricoles)',
'iH'=>'Mise en location-gérance d\'une partie des terres et des bâtiments agricoles (pour les liasses agricoles)',
'iI'=>'Transmission au conjoint (pour les liasses agricoles)',
'iJ'=>'Cession (pour les liasses agricoles)',
'iVP'=>'Suppression partielle d\'activité par vente',
'iDP'=>'Suppression partielle d\'activité par disparition',
'iRP'=>'Suppression partielle d\'activité par reprise par le propriétaire',
);
global $tabTypEtab;
$tabTypEtab=array(
'i00'=>'Rappel des données de l\'établissement du siège en cas de modification exclusive de l\'entreprise',
'i08'=>'Siège avant transfert non fermé',
'i09'=>'Siège après transfert non créé',
'i10'=>'Siège avant transfert fermé',
'i11'=>'Siège après transfert créé',
'i12'=>'Siège créé (hors transfert)',
'i13'=>'Siège fermé (hors transfert)',
'i14'=>'Siège modifié (hors transfert) : modification de l\'activité principale avec activation économique',
'i15'=>'Siège modifié (hors transfert) : modification de l\'activité principale avec désactivation économique',
'i16'=>'Siège modifié (hors transfert) : modification de l\'activité principale de l\'établissement',
'i17'=>'Siège modifié (hors transfert) : modification de l\'identification de l\'établissement',
'i19'=>'Siège modifié (hors transfert) : autre modification de l\'établissement',
'i20'=>'Établissement avant transfert fermé',
'i21'=>'Établissement après transfert créé',
'i22'=>'Établissement créé (hors transfert)',
'i23'=>'Établissement fermé (hors transfert)',
'i24'=>'Établissement modifié (hors transfert) : modification de l\'activité principale avec activation économique',
'i25'=>'Établissement modifié (hors transfert) : modification de l\'activité principale avec désactivation économique',
'i26'=>'Établissement modifié (hors transfert) : autre modification de l\'activité principale de l\'établissement',
'i27'=>'Établissement modifié (hors transfert) : modification de l\'identification de l\'établissement',
'i29'=>'Établissement modifié (hors transfert) : modification d\'une autre variable de l\'établissement',
'i30'=>'Établissement avant transfert non fermé',
'i31'=>'Établissement après transfert non créé',
'i32'=>'Établissement supprimé',
);
require_once 'Metier/bodacc/classMBodacc.php';
require_once 'Metier/bodacc/classMBalo.php';
@ -574,6 +462,116 @@ class MInsee
'i781'=>'Autre modification entraînant la mise à jour d\'au moins une variable du répertoire suite à correction d\'erreur',
);
private static $tabEvenInsee = array(
// Anciens évènements de la quotidienne Insee
'i00'=>'Modification de l\'établissement',
'iOA'=>'Activation économique de l\'établissement par adjonction de moyens de production',
'i0C'=>'Création de l\'établissement',
'iOD'=>'Désactivation économique de l\'établissement par suppression de moyens de production',
'i0F'=>'Fermeture de l\'établissement',
'iOR'=>'Modification simple ou modification de moyen de production de l\'établissement',
'iCC'=>'Création de l\' entreprise par création du premier établissement',
'iRC'=>'Réactivation de l\'entreprise par création de l\'établissement',
'iRR'=>'Réactivation de l\'entreprise par réactivation de l\'établissement',
'iFF'=>'Fermeture de l\'établissement entraînant la fermeture de l\'entreprise',
'iTC'=>'Création de l\'établissement dans le cadre d\'un transfert',
'iTR'=>'Réactivation de l\'établissement dans le cadre d\'un transfert',
'iT0'=>'Modification simple ou de moyens de production sur l\'établissement dans le cadre d\'un transfert',
'iTA'=>'Activation économique de l\'établissement par adjonction de moyens de production dans le cadre d\'un transfert',
'iTD'=>'Désactivation économique de l\'établissement par suppression de moyens de production dans le cadre d\'un transfert',
'iTF'=>'Fermeture de l\'établissement dans le cadre d\'un transfert',
'iER'=>'Modification ERR de l\'établissement',
// Evènements Crées par différentiel de la Mensuelle Insee par S&D
'iM0C'=>'Création de l\'établissement',
'iM0F'=>'Fermeture de l\'établissement',
'iM0R'=>'Réactivation de l\'établissement',
'iM00'=>'Modification de l\'établissement',
'iMAS'=>'Modification de la nature d\'activité et de la saisonalité',
'iMAC'=>'Modification de la nature d\'activité de l\'établissement',
'iMSA'=>'Modification de la saisonalité de l\'établissement',
// Evènements Crées par diff3+4
'iMPF'=>'Etablissement présumé fermé (formalités de création faites par le repreneur)',
'iMNP'=>'Etablissement présumé fermé (retour de courrier en NPAI)',
// Décret n°2010-1042 du 01/09/2010 relatif à l'inscription au registre du commerce et des sociétés et au répertoire national mentionné à l'article R. 123-220 du code de commerce
// Codification provisoire à changer dans l'attente de l'INSEE
'i810'=>'Suppression du SIREN suite au refus d\'inscription au Registre du Commerce et des Sociétés', // Anciennement iRCS
// Nouveaux évènements Sirene3 de la quotidienne Insee
'i110'=>'Création de l\'entreprise',
'i120'=>'Réactivation de l\'entreprise',
'i125'=>'Réactivation de l\'entreprise suite à une mise à jour du répertoire SIRENE',
'i130'=>'Création de l\'établissement',
'i145'=>'Reprise d\'activité de l\'établissement suite à une mise à jour du répertoire SIRENE',
'i400'=>'Suppression du doublon',
'i410'=>'Cessation juridique de l\'entreprise',
'i420'=>'Absence d\'activité de l\'entreprise (cessation économique de l\'entreprise)',
'i425'=>'Absence d\'activité d\'une entreprise suite à une mise à jour au répertoire SIRENE',
'i430'=>'Fermeture de l\'établissement',
'i435'=>'Fermeture de l\'établissement suite à une mise à jour au répertoire SIRENE',
'i510'=>'Création de l\'établissement d\'arrivée et cessation de l\'établissement de départ dans le cadre d\'un transfert',
'i520'=>'Création de l\'établissement d\'arrivée et modification de l\'établissement de départ dans le cadre d\'un transfert',
'i530'=>'Modification de l\'établissement d\'arrivée et cessation de l\'établissement de départ dans le cadre d\'un transfert',
'i540'=>'Modification de l\'établissement d\'arrivée et modification de l\'établissement de départ dans le cadre d\'un transfert',
'i610'=>'Modification d\'activité au niveau du SIREN associé à une activation économique par adjonction de moyens de production',
'i620'=>'Modification d\'activité au niveau du SIREN associé à une désactivation économique par suppression de moyens de production',
'i621'=>'Modification d\'activité du SIREN associé à une désactivation économique par suppression de moyens de production suite à une correction d\'erreur',
'i631'=>'Modification d\'activité du SIREN associé',
'i640'=>'Modification d\'activité au niveau de l\'établissement associée à une activation économique par adjonction de moyens de production',
'i650'=>'Modification d\'activité au niveau de l\'établissement associée à une désactivation économique par suppression de moyens de production',
'i661'=>'Modification d\'activité de l\'établissement',
'i710'=>'Modification de l\'identification du SIREN',
'i711'=>'Modification de l\'identification du SIREN suite à correction d\'erreur',
'i720'=>'Modification de l\'adresse ou de l\'identification de l\'établissement',
'i780'=>'Modification de l\'établissement',
'i781'=>'Modification de l\'établissement suite à correction d\'erreur',
'i795'=>'Personne radiée à sa demande de de la base SIRENE diffusion',
);
private static $tabTypEtab=array(
'i00'=>'Rappel des données de l\'établissement du siège en cas de modification exclusive de l\'entreprise',
'i08'=>'Siège avant transfert non fermé',
'i09'=>'Siège après transfert non créé',
'i10'=>'Siège avant transfert fermé',
'i11'=>'Siège après transfert créé',
'i12'=>'Siège créé (hors transfert)',
'i13'=>'Siège fermé (hors transfert)',
'i14'=>'Siège modifié (hors transfert) : modification de l\'activité principale avec activation économique',
'i15'=>'Siège modifié (hors transfert) : modification de l\'activité principale avec désactivation économique',
'i16'=>'Siège modifié (hors transfert) : modification de l\'activité principale de l\'établissement',
'i17'=>'Siège modifié (hors transfert) : modification de l\'identification de l\'établissement',
'i19'=>'Siège modifié (hors transfert) : autre modification de l\'établissement',
'i20'=>'Établissement avant transfert fermé',
'i21'=>'Établissement après transfert créé',
'i22'=>'Établissement créé (hors transfert)',
'i23'=>'Établissement fermé (hors transfert)',
'i24'=>'Établissement modifié (hors transfert) : modification de l\'activité principale avec activation économique',
'i25'=>'Établissement modifié (hors transfert) : modification de l\'activité principale avec désactivation économique',
'i26'=>'Établissement modifié (hors transfert) : autre modification de l\'activité principale de l\'établissement',
'i27'=>'Établissement modifié (hors transfert) : modification de l\'identification de l\'établissement',
'i29'=>'Établissement modifié (hors transfert) : modification d\'une autre variable de l\'établissement',
'i30'=>'Établissement avant transfert non fermé',
'i31'=>'Établissement après transfert non créé',
'i32'=>'Établissement supprimé',
);
private static $tabDestinat=array(
'i3'=>'Etablissement vendu',
'i7'=>'Maintien d\'activité, l\'établissement devient siège',
'i8'=>'Maintien d\'activité, l\'établissement devient principal',
'iA'=>'Maintien d\'activité, l\'établissement devient secondaire',
'iB'=>'Etablissement fermé',
'iC'=>'Etablissement supprimé',
'iD'=>'Mise en location-gérance de la totalité du fonds',
'iE'=>'Mise en location-gérance d\'une partie du fonds',
'iF'=>'Cessation d\'activité (pour les liasses agricoles)',
'iG'=>'Mise en location-gérance de la totalité des terres et des bâtiments agricoles (pour les liasses agricoles)',
'iH'=>'Mise en location-gérance d\'une partie des terres et des bâtiments agricoles (pour les liasses agricoles)',
'iI'=>'Transmission au conjoint (pour les liasses agricoles)',
'iJ'=>'Cession (pour les liasses agricoles)',
'iVP'=>'Suppression partielle d\'activité par vente',
'iDP'=>'Suppression partielle d\'activité par disparition',
'iRP'=>'Suppression partielle d\'activité par reprise par le propriétaire',
);
private $tabCodeVoie = array();
private $tabCodesNaf=array();
private $tabCodesNafa=array();
@ -1193,138 +1191,144 @@ class MInsee
return $this->tabCodesNafa[$code_nafa];
}
/**
* Liste des événements
* @param unknown $siren
* @param number $nic
* @param number $iDeb
* @param number $iMax
* @return Ambigous <multitype:, multitype:string unknown Ambigous <multitype:> >
*/
public function getEvenements($siren, $nic=0, $iDeb=0, $iMax=1000)
{
global $tabEvenInsee;
global $tabDestinat;
global $tabTypEtab;
$tabRet=$tabId=array();
$strNic='';
if ($nic*1>0) $strNic=" AND insNIC=$nic ";
$insee=$this->iDbInsee->select('insee_even', 'id, insSIREN, siretValide, insNIC, insLIBCOM, insSIEGE, insAUXILT, insORIGINE, insTEFET, insAPET700, insAPRM, insMODET, insMARCHET, insSAISONAT, insACTIVNAT, insENSEIGNE, insL1_NOMEN, insL2_COMP, insL4_VOIE, insL3_CADR, insNUMVOIE, insINDREP, insTYPVOIE, insLIBVOIE, insL5_DISP, insL6_POST, insCODPOS, insL7_ETRG, insRPET, insDEPCOM, insCODEVOIE, insDREACTET, insEXPLET, insDAPET, insLIEUACT, insACTISURF, insDEFET, insTEL, insCJ, insCIVILITE, insTEFEN, insAPEN700, insMODEN, insMARCHEN, insNOMEN, insTYPCREH, insEVE, insDATEVE, insTRAN, insNICTRAN, insMNICSIEGE, insMNOMEN, insMCJ, insMAPEN, insFiller1, insFiller2, insMMARCHEN, insMORDIN, insEFENCENT, insSIGLE, insNBETEXPL, insNICSIEGE, insDEPCOMEN, insFiller3, insMENSEIGNE, insMAPET, insMNATURE, insMADRESSE, insMEFET, insMSINGT, insMTELT, insMMARCHET, insMAUXILT, insSINGT, insEFETCENT, insSIRETPS, insDESTINAT, insDATEMAJ, idFlux, dirNom, dirNomUsage, dirPrenom, insDCRET, insDCREN, insPRODPART, insSIRETASS, insDREACTEN, insEXPLEN, insFiller4, insDEFEN, insMONOREG, insREGIMP, insMONOACT, insMSIGLE, insMEXPLEN, insRPEN, insMEXPLET, insTYPETAB, insDAPEN', "insSIREN=$siren $strNic ORDER BY insDATEMAJ DESC LIMIT $iDeb, $iMax",false, MYSQL_ASSOC);
if (count($insee)>0){
if (count($insee)>0) {
foreach ($insee as $i=>$even) {
$tabSiren[$even['insDATEVE']] = array(
'rs'=>$even['insNOMEN'],
'sigle'=>$even['insSIGLE'],
'ape'=>$even['insAPEN700'],
'nic'=>$even['insNICSIEGE'],
'cj'=>$even['insCJ'],
'rs'=>$even['insNOMEN'],
'sigle'=>$even['insSIGLE'],
'ape'=>$even['insAPEN700'],
'nic'=>$even['insNICSIEGE'],
'cj'=>$even['insCJ'],
);
$tabSiret[$even['insNIC']][$even['insDATEVE']] = array(
'ens'=>$even['insENSEIGNE'],
'ape'=>$even['insAPET700'],
'adresse'=>$even['insL2_COMP'].' '.$even['insL3_CADR'].' '.$even['insL4_VOIE'].' '.$even['insL5_DISP'].' '.$even['insL6_POST'].' '.$even['insL7_ETRG'],
'effectif'=>$even['insEFENCENT'].' (Tranche '.$even['insTEFET'].')',
'ens'=>$even['insENSEIGNE'],
'ape'=>$even['insAPET700'],
'adresse'=>$even['insL2_COMP'].' '.$even['insL3_CADR'].' '.$even['insL4_VOIE'].' '.$even['insL5_DISP'].' '.$even['insL6_POST'].' '.$even['insL7_ETRG'],
'effectif'=>$even['insEFENCENT'].' (Tranche '.$even['insTEFET'].')',
);
}
}
if (count($insee)>0){
foreach ($insee as $i=>$even) {
$tabId[]=$even['id'];
$libDet='';
if ($even['insMNOMEN']==1) {
$libDet.='Modification de la raison sociale : '.$even['insNOMEN'];
$strPre=getInfoPrecedente($tabSiren, $even['insDATEVE'], 'rs');
if ($strPre<>'' && $strPre<>$even['insNOMEN']) $libDet.=" (Précédent : $strPre)";
$libDet.=', ';
}
if ($even['insMENSEIGNE']==1) {
$libDet.='Modification de l\'enseigne : '.$even['insENSEIGNE'];
$strPre=getInfoPrecedente($tabSiret[$even['insNIC']], $even['insDATEVE'], 'ens');
if ($strPre<>'' && $strPre<>$even['insENSEIGNE']) $libDet.=" (Précédent : $strPre)";
$libDet.=', ';
}
if ($even['insMSIGLE']==1) {
$libDet.='Modification du sigle : '.$even['insSIGLE'];
$strPre=getInfoPrecedente($tabSiren, $even['insDATEVE'], 'sigle');
if ($strPre<>'' && $strPre<>$even['insSIGLE']) $libDet.=" (Précédent : $strPre)";
$libDet.=', ';
}
if ($even['insMAPEN']==1) {
$libDet.='Modification de l\'activité de l\'entreprise : '.$even['insAPEN700'].' - '.$this->getLibelleNaf($even['insAPEN700']);
$strPre=getInfoPrecedente($tabSiren, $even['insDATEVE'], 'ape');
if ($strPre<>'' && $strPre<>$even['insAPEN700']) $libDet.=" (Précédent : $strPre - ".$this->getLibelleNaf($strPre).')';
$libDet.=', ';
}
if ($even['insMAPET']==1) {
$libDet.='Modification de l\'activité de l\'établissement : '.$even['insAPET700'].' - '.$this->getLibelleNaf($even['insAPET700']);
$strPre=getInfoPrecedente($tabSiret[$even['insNIC']], $even['insDATEVE'], 'ape');
if ($strPre<>'' && $strPre<>$even['insAPET700']) $libDet.=" (Précédent : $strPre - ".$this->getLibelleNaf($strPre).')';
$libDet.=', ';
}
if ($even['insMNICSIEGE']==1) {
$libDet.='Modification du nic du siège : '.$even['insNICSIEGE'];
$strPre=getInfoPrecedente($tabSiren, $even['insDATEVE'], 'nic');
if ($strPre<>'' && $strPre<>$even['insNICSIEGE']) $libDet.=" (Précédent : $strPre)";
$libDet.=', ';
}
if ($even['insMADRESSE']==1) {
$libDet.='Modification de l\'adresse : '.$even['insL2_COMP'].' '.$even['insL3_CADR'].' '.$even['insL4_VOIE'].' '.$even['insL5_DISP'].' '.$even['insL6_POST'].' '.$even['insL7_ETRG'];
$strPre=getInfoPrecedente($tabSiret[$even['insNIC']], $even['insDATEVE'], 'adresse');
if ($strPre<>'' && $strPre<>$even['insL2_COMP'].' '.$even['insL3_CADR'].' '.$even['insL4_VOIE'].' '.$even['insL5_DISP'].' '.$even['insL6_POST'].' '.$even['insL7_ETRG']) $libDet.=" (Précédent : $strPre)";
$libDet.=', ';
}
if ($even['insMEFET']==1) $libDet.='Modification de l\'effectif : '.$even['insEFENCENT'].' (Tranche '.$even['insTEFET'].'), ';
if ($even['insEXPLET']=='O') $strTmp='Exploitant';
elseif ($even['insEXPLET']=='N')$strTmp='Non exploitant participant au système productif';
elseif ($even['insEXPLET']=='X')$strTmp='Non exploitant ne participant pas au système productif';
if ($even['insMEXPLET']==1) $libDet.='Modification du caractère exploitant de l\'établissement : '.$strTmp.', ';
if ($even['insEXPLEN']=='O') $strTmp='Exploitant';
elseif ($even['insEXPLEN']=='N')$strTmp='Non exploitant participant au système productif';
elseif ($even['insEXPLEN']=='X')$strTmp='Non exploitant ne participant pas au système productif';
if ($even['insMEXPLEN']==1) $libDet.='Modification du caractère exploitant de l\'entreprise : '.$strTmp.', ';
if ($even['insMCJ']==1) {
$libDet.='Modification de la forme juridique : '.$even['insCJ'].' - '.$this->getLibelleFJ($even['insCJ']);
$strPre=getInfoPrecedente($tabSiret[$even['insNIC']], $even['insDATEVE'], 'cj');
if ($strPre<>'' && $strPre<>$even['insCJ']) $libDet.=" (Précédent : $strPre - ".$this->getLibelleFJ($even['insCJ']).')';
$libDet.=', ';
}
if ($even['insAUXILT']==1) $strTmp='Auxiliaire';
else $strTmp='Non auxiliaire';
if ($even['insMAUXILT']==1) $libDet.='Modification du caractère auxiliaire de l\'établissement : '.$strTmp.', ';
if (count($insee)>0) {
foreach ($insee as $i=>$even) {
$tabId[]=$even['id'];
$libDet='';
if ($even['insMNOMEN']==1) {
$libDet.='Modification de la raison sociale : '.$even['insNOMEN'];
$strPre=$this->getInfoPrecedente($tabSiren, $even['insDATEVE'], 'rs');
if ($strPre<>'' && $strPre<>$even['insNOMEN']) $libDet.=" (Précédent : $strPre)";
$libDet.=', ';
}
if ($even['insMENSEIGNE']==1) {
$libDet.='Modification de l\'enseigne : '.$even['insENSEIGNE'];
$strPre=$this->getInfoPrecedente($tabSiret[$even['insNIC']], $even['insDATEVE'], 'ens');
if ($strPre<>'' && $strPre<>$even['insENSEIGNE']) $libDet.=" (Précédent : $strPre)";
$libDet.=', ';
}
if ($even['insMSIGLE']==1) {
$libDet.='Modification du sigle : '.$even['insSIGLE'];
$strPre=$this->getInfoPrecedente($tabSiren, $even['insDATEVE'], 'sigle');
if ($strPre<>'' && $strPre<>$even['insSIGLE']) $libDet.=" (Précédent : $strPre)";
$libDet.=', ';
}
if ($even['insMAPEN']==1) {
$libDet.='Modification de l\'activité de l\'entreprise : '.$even['insAPEN700'].' - '.$this->getLibelleNaf($even['insAPEN700']);
$strPre=$this->getInfoPrecedente($tabSiren, $even['insDATEVE'], 'ape');
if ($strPre<>'' && $strPre<>$even['insAPEN700']) $libDet.=" (Précédent : $strPre - ".$this->getLibelleNaf($strPre).')';
$libDet.=', ';
}
if ($even['insMAPET']==1) {
$libDet.='Modification de l\'activité de l\'établissement : '.$even['insAPET700'].' - '.$this->getLibelleNaf($even['insAPET700']);
$strPre=$this->getInfoPrecedente($tabSiret[$even['insNIC']], $even['insDATEVE'], 'ape');
if ($strPre<>'' && $strPre<>$even['insAPET700']) $libDet.=" (Précédent : $strPre - ".$this->getLibelleNaf($strPre).')';
$libDet.=', ';
}
if ($even['insMNICSIEGE']==1) {
$libDet.='Modification du nic du siège : '.$even['insNICSIEGE'];
$strPre=$this->getInfoPrecedente($tabSiren, $even['insDATEVE'], 'nic');
if ($strPre<>'' && $strPre<>$even['insNICSIEGE']) $libDet.=" (Précédent : $strPre)";
$libDet.=', ';
}
if ($even['insMADRESSE']==1) {
$libDet.='Modification de l\'adresse : '.$even['insL2_COMP'].' '.$even['insL3_CADR'].' '.$even['insL4_VOIE'].' '.$even['insL5_DISP'].' '.$even['insL6_POST'].' '.$even['insL7_ETRG'];
$strPre=$this->getInfoPrecedente($tabSiret[$even['insNIC']], $even['insDATEVE'], 'adresse');
if ($strPre<>'' && $strPre<>$even['insL2_COMP'].' '.$even['insL3_CADR'].' '.$even['insL4_VOIE'].' '.$even['insL5_DISP'].' '.$even['insL6_POST'].' '.$even['insL7_ETRG']) $libDet.=" (Précédent : $strPre)";
$libDet.=', ';
}
if ($even['insMEFET']==1) $libDet.='Modification de l\'effectif : '.$even['insEFENCENT'].' (Tranche '.$even['insTEFET'].'), ';
if ($even['insEXPLET']=='O') $strTmp='Exploitant';
elseif ($even['insEXPLET']=='N')$strTmp='Non exploitant participant au système productif';
elseif ($even['insEXPLET']=='X')$strTmp='Non exploitant ne participant pas au système productif';
if ($even['insMEXPLET']==1) $libDet.='Modification du caractère exploitant de l\'établissement : '.$strTmp.', ';
if ($even['insEXPLEN']=='O') $strTmp='Exploitant';
elseif ($even['insEXPLEN']=='N')$strTmp='Non exploitant participant au système productif';
elseif ($even['insEXPLEN']=='X')$strTmp='Non exploitant ne participant pas au système productif';
if ($even['insMEXPLEN']==1) $libDet.='Modification du caractère exploitant de l\'entreprise : '.$strTmp.', ';
if ($even['insMCJ']==1) {
$libDet.='Modification de la forme juridique : '.$even['insCJ'].' - '.$this->getLibelleFJ($even['insCJ']);
$strPre=$this->getInfoPrecedente($tabSiret[$even['insNIC']], $even['insDATEVE'], 'cj');
if ($strPre<>'' && $strPre<>$even['insCJ']) $libDet.=" (Précédent : $strPre - ".$this->getLibelleFJ($even['insCJ']).')';
$libDet.=', ';
}
if ($even['insAUXILT']==1) $strTmp='Auxiliaire';
else $strTmp='Non auxiliaire';
if ($even['insMAUXILT']==1) $libDet.='Modification du caractère auxiliaire de l\'établissement : '.$strTmp.', ';
if (trim($even['insDESTINAT'])<>'' && $even['insDESTINAT']<>'NR' && $even['insDESTINAT']*1<>9)
$libDet.=$tabDestinat['i'.trim($even['insDESTINAT'])].', ';
if (trim($even['insDESTINAT'])<>'' && $even['insDESTINAT']<>'NR' && $even['insDESTINAT']*1<>9)
$libDet.=$this->tabDestinat['i'.trim($even['insDESTINAT'])].', ';
$libDet.=$tabTypEtab['i'.trim($even['insTYPETAB'])].', ';
$libDet.=$this->tabTypEtab['i'.trim($even['insTYPETAB'])].', ';
$typeSiretAss='';
$siretAss=$even['insSIRETASS'];
switch ($even['insPRODPART']*1) {
case 1: $typeSiretAss='Loueur de fond'; break;
case 2: $typeSiretAss='Locataire du fond'; break;
case 3: $typeSiretAss='Prestataire de personnel'; break;
}
if ($siretAss*1==0) {
$tabPS=array();
$siretAss=$even['insSIRETPS'];
if ($siretAss*1>0)
$tabPS=$this->getIdentiteLight(substr($siretAss,0,9));
$tabEt=$this->getIdentiteLight($siren);
// 'Nom'=>$etab['raisonSociale'],
if ($tabPS['actif']==1 && $tabEt['actif']==0) $typeSiretAss='Successeur';
elseif ($tabPS['actif']==0 && $tabEt['actif']==1) $typeSiretAss='Prédécesseur';
else $typeSiretAss='Prédécesseur ou Successeur';
}
$typeSiretAss='';
$siretAss=$even['insSIRETASS'];
switch ($even['insPRODPART']*1) {
case 1: $typeSiretAss='Loueur de fond'; break;
case 2: $typeSiretAss='Locataire du fond'; break;
case 3: $typeSiretAss='Prestataire de personnel'; break;
}
if ($siretAss*1==0) {
$tabPS=array();
$siretAss=$even['insSIRETPS'];
if ($siretAss*1>0)
$tabPS=$this->getIdentiteLight(substr($siretAss,0,9));
$tabEt=$this->getIdentiteLight($siren);
// 'Nom'=>$etab['raisonSociale'],
if ($tabPS['actif']==1 && $tabEt['actif']==0) $typeSiretAss='Successeur';
elseif ($tabPS['actif']==0 && $tabEt['actif']==1) $typeSiretAss='Prédécesseur';
else $typeSiretAss='Prédécesseur ou Successeur';
}
$dateEve=$even['insDATEVE'];
$dateMaj=$even['insDATEMAJ'];
if (str_replace('-','',$dateEve*1)==0) $dateEve=$dateMaj;
$dateEve=$even['insDATEVE'];
$dateMaj=$even['insDATEMAJ'];
if (str_replace('-','',$dateEve*1)==0) $dateEve=$dateMaj;
$tabRet[]=array('codeEven' => 'I'.$even['insEVE'],
'nic' => $even['insNIC'],
'siretAssocie'=>$siretAss,
'typeSiretAss'=>$typeSiretAss,
'siege' => $even['insSIEGE'],
'libEven' => $tabEvenInsee['i'.trim($even['insEVE'])],
'libEvenDet'=> substr($libDet,0,-2),
'dateMAJ' => $dateMaj,
'dateEven' => $dateEve,
);
}
$tabRet[]=array(
'codeEven' => 'I'.$even['insEVE'],
'nic' => $even['insNIC'],
'siretAssocie'=>$siretAss,
'typeSiretAss'=>$typeSiretAss,
'siege' => $even['insSIEGE'],
'libEven' => $this->tabEvenInsee['i'.trim($even['insEVE'])],
'libEvenDet'=> substr($libDet,0,-2),
'dateMAJ' => $dateMaj,
'dateEven' => $dateEve,
);
}
}
/** Recherche d'évènement pour lesquels le SIREN est ASSOCIE **/
@ -1371,16 +1375,17 @@ class MInsee
$dateMaj=$even['insDATEMAJ'];
if (str_replace('-','',$dateEve*1)==0) $dateEve=$dateMaj;
$tabRet[]=array('codeEven' => 'I'.$even['insEVE'],
'nic' => substr($even['insSIRETASS'],9,5),
'siretAssocie'=>''.$even['insSIREN'].$even['insNIC'],
'typeSiretAss'=>$typeSiretAss,
'siege' => $even['insSIEGE'],
'libEven' => "Modification d'une entreprise/établissement lié",//$tabEvenInsee['i'.trim($even['insEVE'])],
'libEvenDet'=> '',//substr($libDet,0,-3),
'dateMAJ' => $dateMaj,
'dateEven' => $dateEve,
);
$tabRet[]=array(
'codeEven' => 'I'.$even['insEVE'],
'nic' => substr($even['insSIRETASS'],9,5),
'siretAssocie'=>''.$even['insSIREN'].$even['insNIC'],
'typeSiretAss'=>$typeSiretAss,
'siege' => $even['insSIEGE'],
'libEven' => "Modification d'une entreprise/établissement lié",//$tabEvenInsee['i'.trim($even['insEVE'])],
'libEvenDet'=> '',//substr($libDet,0,-3),
'dateMAJ' => $dateMaj,
'dateEven' => $dateEve,
);
}
/** Recherche d'évènement pour lesquels le SIREN est Prédécesseur ou Successeur **/
@ -1399,17 +1404,19 @@ class MInsee
$dateMaj=$even['insDATEMAJ'];
if (str_replace('-','',$dateEve*1)==0) $dateEve=$dateMaj;
$tabRet[]=array('codeEven' => 'I'.$even['insEVE'],
'nic' => substr($even['insSIRETPS'],9,5),
'siretAssocie'=>''.$even['insSIREN'].$even['insNIC'],
'typeSiretAss'=>$typeSiretAss,
'siege' => $even['insSIEGE'],
'libEven' => "Modification d'une entreprise/établissement lié",//$tabEvenInsee['i'.trim($even['insEVE'])],
'libEvenDet'=> '',//substr($libDet,0,-3),
'dateMAJ' => $dateMaj,
'dateEven' => $dateEve,
);
$tabRet[]=array(
'codeEven' => 'I'.$even['insEVE'],
'nic' => substr($even['insSIRETPS'],9,5),
'siretAssocie'=>''.$even['insSIREN'].$even['insNIC'],
'typeSiretAss'=>$typeSiretAss,
'siege' => $even['insSIEGE'],
'libEven' => "Modification d'une entreprise/établissement lié",//$tabEvenInsee['i'.trim($even['insEVE'])],
'libEvenDet'=> '',//substr($libDet,0,-3),
'dateMAJ' => $dateMaj,
'dateEven' => $dateEve,
);
}
return $tabRet;
}
@ -6284,21 +6291,21 @@ ORDER BY a.dateJugement DESC".EOL.EOL.print_r($collecte,true));*/
} else
return 0;
}
}
/**
*
* @param unknown $tabSir
* @param unknown $dateEven
* @param unknown $even
* @return unknown|string
*/
function getInfoPrecedente($tabSir, $dateEven, $even)
{
foreach ($tabSir as $date=>$tabInfo) {
if ($date>$dateEven) continue;
return $tabInfo[$even];
/**
*
* @param unknown $tabSir
* @param unknown $dateEven
* @param unknown $even
* @return unknown|string
*/
protected function getInfoPrecedente($tabSir, $dateEven, $even)
{
foreach ($tabSir as $date=>$tabInfo) {
if ($date>$dateEven) continue;
return $tabInfo[$even];
}
return '';
}
return '';
}
}

View File

@ -2981,7 +2981,7 @@ function calculIndiScore($siren, $nic=0, $accesDist=false, $cycleClient=2, $mail
|| $tabIdentite['SituationJuridique'] == 'P'
|| $tabIdentite['SituationJuridique'] == 'PL')
$classeRisque=9;
elseif ($ENCOURS=='N/A') $classeRisque=8;
elseif ($ENCOURS==='N/A') $classeRisque=8;
/** Fin note **/
$NOTE100=$noteSolvabilite; // Note finale sur 100

View File

@ -1643,7 +1643,7 @@ function rechercheEnt(&$formR, $deb, $nbRep, $max, $sirenValide = false)
ape_entrep,
(siren>200) AS sirenValide
FROM etablissements
LEFT OUTER JOIN tabPays ON codePaysInsee = IF(adr_dep=99,adr_com,null) AND tabPays.codPays3!=null
LEFT OUTER JOIN tabPays ON codePaysInsee = IF(adr_dep=99,adr_com,null)
WHERE id IN('.
$i = 0;
foreach ($resSphinx['matches'] as $id => $element) {

View File

@ -0,0 +1,9 @@
<?php
$dirname_52e8e703f23a4 = dirname(__FILE__);
return array (
'Scores_Auth_Adapter_Db' => $dirname_52e8e703f23a4 . DIRECTORY_SEPARATOR . 'Auth' . DIRECTORY_SEPARATOR . 'Adapter' . DIRECTORY_SEPARATOR . 'Db.php',
'Scores_Auth_Adapter_Ws' => $dirname_52e8e703f23a4 . DIRECTORY_SEPARATOR . 'Auth' . DIRECTORY_SEPARATOR . 'Adapter' . DIRECTORY_SEPARATOR . 'Ws.php',
'Scores_Wkhtml_Pdf' => $dirname_52e8e703f23a4 . DIRECTORY_SEPARATOR . 'Wkhtml' . DIRECTORY_SEPARATOR . 'Pdf.php',
'Scores_Ws_Doc' => $dirname_52e8e703f23a4 . DIRECTORY_SEPARATOR . 'Ws' . DIRECTORY_SEPARATOR . 'Doc.php',
'Scores_Ws_Form_GetIdentite' => $dirname_52e8e703f23a4 . DIRECTORY_SEPARATOR . 'Ws' . DIRECTORY_SEPARATOR . 'Form' . DIRECTORY_SEPARATOR . 'GetIdentite.php',
);

View File

@ -200,7 +200,44 @@ class Pieces extends WsScore
$list = $infogreffe->getList();
$nbBilans = count($list);
//@todo : Marquer les éléments en commande courrier si déjà commandé ModeDiffusion = O
//Ajout d'informations supplémentaires
if ( count($list)>0 ) {
foreach ( $list as $i => $item ) {
//Surcharge des codes de saisie
$date = new Zend_Date($item->DateCloture, 'yyyy-MM-dd');
try {
$liasseM = new Application_Model_JoBilans();
$sql = $liasseM->select()
->where('siren=?', $identifiant)
->where('dateExercice=?', $date->toString('yyyyMMdd'));
$row = $liasseM->fetchRow($sql);
} catch (Zend_Exception $e) {
//file_put_contents('debug.log', $e->getMessage()."\n", FILE_APPEND);
}
if ( $row !== null ) {
$item->DureeExercice = $row->dureeExercice;
$item->SaisieDate = substr($row->dateProvPartenaire,0,4).'-'.substr($row->dateProvPartenaire,4,2).'-'.substr($row->dateProvPartenaire,6,2);
$item->SaisieCode = '00';
//@todo : Améliorer le label de retour - partenaire de saisie
//$item->SaisieLabel = '';
$list[$i] = $item;
}
if ( $item->ModeDiffusion == 'C' ) {
$cmdM = new Application_Model_Sdv1GreffeCommandesBi();
$sql = $cmdM->select()
->where('siren=?', $identifiant)
->where('bilanCloture=?', $item->DateCloture);
$row = $cmdM->fetchRow($sql);
if ( $row !== null ) {
$item->ModeDiffusion = 'O';
$list[$i] = $item;
}
}
}
}
}
@ -236,6 +273,10 @@ class Pieces extends WsScore
if ( strlen($identifiant)!=9 ) {
$this->sendError('1010');
}
if ( empty($reference) ) {
$reference = '';
}
$output = '';
@ -253,8 +294,8 @@ class Pieces extends WsScore
$filename = substr($reference,4);
$c = Zend_Registry::get('config');
$file = $c->profil->path->secure . DIRECTORY_SEPARATOR . 'association/bilans/' . $filename;
$dest = $c->profil->path->files . DIRECTORY_SEPARATOR . 'associations/' . $reference;
$file = $c->profil->path->secure . '/association/bilans/' . $filename;
$dest = APPLICATION_PATH . '/../data/files/associations/' . $reference;
if ( file_exists($file) && copy($file, $dest)) {
$hostname = 'http://'.$_SERVER['SERVER_NAME'];
@ -270,31 +311,63 @@ class Pieces extends WsScore
}
break;
}
return $output;
}
/**
* Entreprise
*/
else {
//Génération identifiant de commande unique
$refCommande = uniqid();
$iInsee = new MInsee();
$identite = $iInsee->getIdentiteLight($identifiant);
//Sauvegarde dans la base
$commandeM = new Application_Model_Sdv1GreffeCommandesBi();
$id = $commandeM->insert(array(
'refCommande' => $refCommande,
'login' => $this->tabInfoUser['login'],
'email' => $this->tabInfoUser['email'],
'refClient' => $reference,
'mode' => $diffusion,
'siren' => $identifiant,
'raisonSociale' => $identite['Nom'],
'bilanCloture' => $dateCloture,
'bilanType' => $type,
'dateInsert' => date('YmdHis'),
));
switch ( $diffusion ) {
case 'T':
//Passer la commande chez infogreffe
require_once 'Metier/Infogreffe/InfogreffeBi.php';
$infogreffe = new Metier_Infogreffe_Bi($identifiant);
$pdf = $infogreffe->getCommandeT($dateCloture, $type);
try {
$pdf = $infogreffe->getCommandeT($dateCloture, $type, $id);
$commandeM->update(array('dateEnvoi'=> date('YmdHis')), 'id='.$id);
} catch (Exception $e) {
$commandeM->update(array('cmdError'=> $e->getMessage()), 'id='.$id);
}
//Distribuer le fichier
if ( !empty($pdf) ) {
$c = Zend_Registry::get('config');
$file = $c->profil->path->secure . DIRECTORY_SEPARATOR . $pdf;
$dest = $c->profil->path->files . DIRECTORY_SEPARATOR . 'greffes' . DIRECTORY_SEPARATOR . $pdf;
$file = $c->profil->infogreffe->storage->path . '/' . $pdf;
$dest = APPLICATION_PATH . '/../data/files/greffes/' . basename($file);
if ( file_exists($file) && copy($file, $dest)) {
$hostname = 'http://'.$_SERVER['SERVER_NAME'];
if ( $_SERVER['SERVER_PORT'] != '80' ) {
$hostname.= ':'.$_SERVER['SERVER_PORT'];
}
$output = $hostname . '/data/greffes/' . basename($dest); // @todo : Chemin du fichier
$output = $hostname . '/fichier/greffes/' . basename($dest); // @todo : Chemin du fichier
$this->wsLog('greffe_bilans', $identifiant, basename($dest));
} else {
throw new SoapFault('ERR', 'Fichier introuvable');
@ -306,43 +379,24 @@ class Pieces extends WsScore
case 'C':
case 'F':
//Génération identifiant de commande unique
$refCommande = uniqid();
$iInsee = new MInsee();
$raisonSociale = $iInsee->getIdentiteLight($identifiant);
//Sauvegarde dans la base
$commandeM = new Application_Model_Sdv1GreffeCommandesBi();
$id = $commandeM->insert(array(
'refCommande' => $refCommande,
'login' => $this->tabInfoUser['login'],
'email' => $this->tabInfoUser['email'],
'refClient' => $reference,
'mode' => 'C',
'siren' => $identifiant,
'raisonSociale' => $raisonSociale,
'bilanCloture' => $dateCloture,
'bilanType' => $type,
'dateInsert' => date('YmdHis'),
));
//Commande chez Infogreffe
if ( $diffusion == 'C' ) {
require_once 'Metier/Infogreffe/InfogreffeBi.php';
$infogreffe = new Metier_Infogreffe_Bi($identifiant);
if ( $infogreffe->getCommandeC($dateCloture, $type, 'G-BI-'.$id) ) {
$commandeM->update( array('dateCommande' => date('YmdHis') ), 'id='.$id);
$this->wsLog('greffe_bilans', $identifiant, $refCommande);
try {
$infogreffe->getCommandeC($dateCloture, $type, 'G-BI-'.$id);
$this->wsLog('greffe_bilans', $identifiant, $refCommande);
} catch(Exception $e) {
$commandeM->update(array('cmdError'=> $e->getMessage()), 'id='.$id);
}
}
return $refCommande;
$output = $refCommande;
break;
}
}
return $output;
return $output;
}
}
/**
@ -379,7 +433,7 @@ class Pieces extends WsScore
require_once 'Metier/Infogreffe/InfogreffeAc.php';
$infogreffe = new Metier_Infogreffe_Ac($identifiant);
$list = $infogreffe->getList(true);
$list = $infogreffe->getList();
$nbActes = count($list);
if ($nbActes>0) {
@ -440,31 +494,63 @@ class Pieces extends WsScore
$output = '';
//Génération identifiant de commande unique
$refCommande = uniqid();
$iInsee = new MInsee();
$identite = $iInsee->getIdentiteLight($identifiant);
//Sauvegarde dans la base
$commandeM = new Application_Model_Sdv1GreffeCommandesAc();
$id = $commandeM->insert(array(
'refCommande' => $refCommande,
'login' => $this->tabInfoUser['login'],
'email' => $this->tabInfoUser['email'],
'refClient' => $reference,
'siren' => $identifiant,
'mode' => $diffusion,
'raisonSociale' => $identite['Nom'],
'depotNum' => $depotNum,
'depotDate' => $depotDate,
'acteType' => $acteType,
'acteDate' => $acteDate,
'acteNum' => $acteNum,
'dateInsert' => date('YmdHis'),
));
switch ( $diffusion ) {
case 'T':
//Passer la commande chez Infogreffe
require_once 'Metier/Infogreffe/InfogreffeAc.php';
$infogreffe = new Metier_Infogreffe_Ac($identifiant);
$pdf = $infogreffe->getCommandeT($depotDate, $depotNum, $acteType, $acteDate, $acteNum);
try {
$pdf = $infogreffe->getCommandeT($depotDate, $depotNum, $acteType, $acteDate, $acteNum, $id);
$commandeM->update(array('dateEnvoi'=> date('YmdHis')), 'id='.$id);
} catch (Exception $e) {
$commandeM->update(array('cmdError'=> $e->getMessage()), 'id='.$id);
}
//Distribuer le fichier
if ( !empty($pdf) ) {
$c = Zend_Registry::get('config');
$file = $c->profil->path->secure . DIRECTORY_SEPARATOR . $pdf;
$dest = $c->profil->path->files . DIRECTORY_SEPARATOR . 'greffes' . DIRECTORY_SEPARATOR . $pdf;
$file = $c->profil->infogreffe->storage->path . '/' . $pdf;
$dest = APPLICATION_PATH . '/../data/files/greffes/' . basename($file);
if ( file_exists($file) && copy($file, $dest)) {
$hostname = 'http://'.$_SERVER['SERVER_NAME'];
if ( $_SERVER['SERVER_PORT'] != '80' ) {
$hostname.= ':'.$_SERVER['SERVER_PORT'];
}
$output = $hostname . '/data/greffes/' . basename($dest);
$output = $hostname . '/fichier/greffes/' . basename($dest);
//@todo : Surcharger la référence avec le nom du fichier
$this->wsLog('greffe_actes', $siren, $reference);
} else {
throw new SoapFault('ERR', 'Fichier introuvable');
}
}
break;
@ -472,36 +558,15 @@ class Pieces extends WsScore
case 'C':
case 'F':
//Génération identifiant de commande unique
$refCommande = uniqid();
$iInsee = new MInsee();
$raisonSociale = $iInsee->getIdentiteLight($identifiant);
//Sauvegarde dans la base
$commandeM = new Application_Model_Sdv1GreffeCommandesAc();
$id = $commandeM->insert(array(
'refCommande' => $refCommande,
'login' => $this->tabInfoUser['login'],
'email' => $this->tabInfoUser['email'],
'refClient' => $reference,
'siren' => $identifiant,
'mode' => 'C',
'raisonSociale' => $raisonSociale,
'depotNum' => $depotNum,
'depotDate' => $depotDate,
'acteType' => $acteType,
'acteDate' => $acteDate,
'acteNum' => $acteNum,
'dateInsert' => date('YmdHis'),
));
if ( $diffusion == 'C') {
if ( $diffusion == 'C' ) {
//Commande chez Infogreffe
require_once 'Metier/Infogreffe/InfogreffeAc.php';
$infogreffe = new Metier_Infogreffe_Ac($identifiant);
if ( $infogreffe->getCommandeC($depotDate, $depotNum, $acteType, $acteDate, $acteNum, 'G-AC-'.$id) ) {
$commandeM->update( array('dateCommande' => date('YmdHis') ), 'id='.$id);
try {
$infogreffe->getCommandeC($depotDate, $depotNum, $acteType, $acteDate, $acteNum, 'G-AC-'.$id);
$this->wsLog('greffe_actes', $identifiant, $refCommande);
} catch(Exception $e) {
$commandeM->update(array('cmdError'=> $e->getMessage()), 'id='.$id);
}
}

View File

@ -41,7 +41,7 @@ class Bilan
/**
* Mode de diffusion
* T = Téléchargement, C = Commande pour numérisation, L = Commande pour nuémrisation (archive), O = En commande
* T = Téléchargement, C = Commande pour numérisation, L = Commande pour numérisation (archive), O = En commande
* @var string
*/
public $ModeDiffusion;
@ -62,16 +62,22 @@ class Bilan
public $NumberOfPages = 0;
/**
*
* Date de saisie du bilan au format (AAAA-MM-JJ)
* @var string
*/
public $SaisieDate;
/**
* Code de saisie
* @var string
*/
public $SaisieCode;
/**
* AAAA-MM-JJ
* Libellé associé au code de saisie
* @var string
*/
public $SaisieDate;
public $SaisieLabel = '';
/** @var string[] */
public $infos;
@ -130,7 +136,7 @@ class Acte
/**
* Mode de diffusion
* T = Téléchargement, C = Commande pour numérisation, L = Commande pour nuémrisation (archive), O = En commande
* T = Téléchargement, C = Commande pour numérisation, L = Commande pour numérisation (archive), O = En commande
* @var string
*/
public $ModeDiffusion;

View File

@ -1334,6 +1334,9 @@ class Saisie extends WsScore
$tabPostes = array();
//Control des valeurs
if ( !in_array($data->unite, array('', 'U', 'K', 'M')) ) {
throw new SoapFault('MSG', "Erreur Unite");
}
if (!preg_match('/[0-9]{8}/', $data->dateCloture)) {
throw new SoapFault('MSG', "Erreur Date de cloture");
}

View File

@ -381,28 +381,6 @@ class WsScore
$test=0;
}
//Get login service
$sql = "SELECT * FROM utilisateurs_service WHERE login='".$this->tabInfoUser['login']."'";
$result = $iDbCrm->query($sql);
if ( mysql_num_rows($result) == 0 ) {
$loginService = 'default';
} else {
$row = mysql_fetch_assoc($result);
$loginService = $row['serviceCode'];
}
//Update count access to a service
$sql = "UPDATE logsCount SET conso=conso+1 WHERE jour=CURDATE() AND idClient=".$this->tabInfoUser['idClient'].
" AND service='".$loginService."' AND log='".$service."'";
$iDbCrm->query($sql);
$updateOk = $iDbCrm->getAffectedRows();
//If not insert
if ($updateOk==0) {
$sql = "INSERT INTO logsCount (jour, idClient, service, log, conso) ".
"VALUES (NOW(), ".$this->tabInfoUser['idClient'].", '".$loginService."', '".$service."', 1) ";
$iDbCrm->query($sql);
}
if (strlen($siret)==14) {
$siren = substr($siret,0,9);
$nic = substr($siret,9,5);

File diff suppressed because it is too large Load Diff

View File

@ -17,8 +17,29 @@ if (APPLICATION_ENV != 'production'){
ini_set("soap.wsdl_cache_enabled", "0");
}
/** Zend_Application */
require_once 'Zend/Application.php';
//Use classmap autoloader - useful with opcode and realpath cache
require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../library/Zend/autoload_classmap.php',
__DIR__ . '/../library/Application/autoload_classmap.php',
__DIR__ . '/../library/Scores/autoload_classmap.php',
__DIR__ . '/../application/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => __DIR__ . '/../library/Zend',
'Application' => __DIR__ . '/../library/Application',
'Scores' => __DIR__ . '/../library/Scores',
'Metier' => __DIR__ . '/../library/Metier',
),
'fallback_autoloader' => true
)
));
// Zend_Application - Use it if you don't have autoloaders
//require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(

View File

@ -13,9 +13,6 @@ resources.frontController.params.displayExceptions = 0
resources.layout.layout = "layout"
resources.layout.layoutPath = APPLICATION_PATH "/views"
resources.view.basePath = APPLICATION_PATH "/views"
autoloaderNamespaces[] = "Application_"
autoloaderNamespaces[] = "Scores_"
autoloaderNamespaces[] = "Metier_"
; Scores configuration
profil.server.name = development

View File

@ -13,9 +13,6 @@ resources.frontController.params.displayExceptions = 0
resources.layout.layout = "layout"
resources.layout.layoutPath = APPLICATION_PATH "/views"
resources.view.basePath = APPLICATION_PATH "/views"
autoloaderNamespaces[] = "Application_"
autoloaderNamespaces[] = "Scores_"
autoloaderNamespaces[] = "Metier_"
; Scores configuration
profil.server.name = WebRecette
@ -34,6 +31,17 @@ profil.path.log = APPLICATION_PATH "/../data/log"
profil.path.data = "/home/vhosts/dataws"
profil.path.secure = "/mnt/datafile" ; SECURE_STORAGE
; Metier - Infogreffe
profil.infogreffe.wsdl = "infogreffe.wsdl"
profil.infogreffe.url = "https://webservices.infogreffe.fr/WSContextInfogreffe/INFOGREFFE"
profil.infogreffe.uri = "https://webservices.infogreffe.fr/"
profil.infogreffe.user = 85000109
profil.infogreffe.password = 166
profil.infogreffe.cache.path = APPLICATION_PATH "/../data/cache"
profil.infogreffe.cache.time = 8
profil.infogreffe.storage.path = "/mnt/datafile/greffes"
; Sphinx configuration
profil.sphinx.ent.host = "192.168.3.32"
profil.sphinx.ent.port = 9312
profil.sphinx.ent.version = 1
@ -55,16 +63,6 @@ profil.db.metier.params.password=wspass2012
profil.db.metier.params.dbname=sdv1
profil.db.metier.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8"
; Metier - Infogreffe
profil.infogreffe.wsdl = "infogreffe.wsdl"
profil.infogreffe.url = "https://webservices.infogreffe.fr/WSContextInfogreffe/INFOGREFFE"
profil.infogreffe.uri = "https://webservices.infogreffe.fr/"
profil.infogreffe.user = 85000109
profil.infogreffe.password = 166
profil.infogreffe.cache.path = APPLICATION_PATH "/../data/cache"
profil.infogreffe.cache.time = 8
profil.infogreffe.storage.path = "/mnt/datafile/greffes"
[staging : production]
resources.frontController.params.displayExceptions = 1

View File

@ -13,9 +13,6 @@ resources.frontController.params.displayExceptions = 0
resources.layout.layout = "layout"
resources.layout.layoutPath = APPLICATION_PATH "/views"
resources.view.basePath = APPLICATION_PATH "/views"
autoloaderNamespaces[] = "Application_"
autoloaderNamespaces[] = "Scores_"
autoloaderNamespaces[] = "Metier_"
; Scores configuration
profil.server.name = WebService
@ -34,6 +31,17 @@ profil.path.log = APPLICATION_PATH "/../data/log"
profil.path.data = "/home/vhosts/data"
profil.path.secure = "/mnt/datafile" ; SECURE_STORAGE
; Metier - Infogreffe
profil.infogreffe.wsdl = "infogreffe.wsdl"
profil.infogreffe.url = "https://webservices.infogreffe.fr/WSContextInfogreffe/INFOGREFFE"
profil.infogreffe.uri = "https://webservices.infogreffe.fr/"
profil.infogreffe.user = 85000109
profil.infogreffe.password = 166
profil.infogreffe.cache.path = APPLICATION_PATH "/../data/cache"
profil.infogreffe.cache.time = 8
profil.infogreffe.storage.path = "/mnt/datafile/greffes"
; Sphinx configuration
profil.sphinx.ent.host = "192.168.3.32"
profil.sphinx.ent.port = 9312
profil.sphinx.ent.version = 1
@ -55,16 +63,6 @@ profil.db.metier.params.password=wspass2012
profil.db.metier.params.dbname=sdv1
profil.db.metier.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8"
; Metier - Infogreffe
profil.infogreffe.wsdl = "infogreffe.wsdl"
profil.infogreffe.url = "https://webservices.infogreffe.fr/WSContextInfogreffe/INFOGREFFE"
profil.infogreffe.uri = "https://webservices.infogreffe.fr/"
profil.infogreffe.user = 85000109
profil.infogreffe.password = 166
profil.infogreffe.cache.path = APPLICATION_PATH "/../data/cache"
profil.infogreffe.cache.time = 8
profil.infogreffe.storage.path = "/mnt/datafile/greffes"
[staging : production]
resources.frontController.params.displayExceptions = 1

View File

@ -1,14 +0,0 @@
--
-- Structure de la table `logsCount`
--
CREATE TABLE IF NOT EXISTS `logsCount` (
`jour` date NOT NULL COMMENT 'Jour de la consommation',
`idClient` int(11) NOT NULL,
`service` char(20) NOT NULL,
`login` char(20) NOT NULL,
`log` char(20) NOT NULL COMMENT 'Nom de l''élément consommé',
`conso` int(11) NOT NULL COMMENT 'Nombre de consommation',
`batchUpdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Date de mise à jour par Batch',
UNIQUE KEY `jour` (`jour`,`idClient`,`service`,`login`,`log`)
) ENGINE=MyISAM COMMENT='Calcul des consommations';

View File

@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS `clients_commercial` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idClient` int(11) NOT NULL COMMENT 'ID du client',
`idCommercial` int(11) NOT NULL COMMENT 'ID du commercial',
`DateDebut` date NOT NULL COMMENT 'Date de debut de la relation',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Lien commercial-client' ;

View File

@ -0,0 +1,8 @@
CREATE TABLE IF NOT EXISTS `clients_commercial_mvt` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idClient` int(11) NOT NULL COMMENT 'ID du client',
`idCommercial` int(11) NOT NULL COMMENT 'ID du commercial',
`DateDebut` int(11) NOT NULL COMMENT 'Date de debut de la relation',
`DateFin` date NOT NULL COMMENT 'Date de fin de la relation',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Lien commercial-client historique' ;

View File

@ -0,0 +1,10 @@
CREATE TABLE IF NOT EXISTS `clients_contrat` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`IdClient` int(11) NOT NULL COMMENT 'Id client',
`Service` varchar(20) NOT NULL COMMENT 'Code du service',
`Ref` varchar(255) NOT NULL COMMENT 'Référence contrat',
`Label` varchar(255) NOT NULL COMMENT 'Libellé contrat',
`DateBegin` date NOT NULL DEFAULT '0000-00-00' COMMENT 'Date de début du contrat',
`DateEnd` date NOT NULL DEFAULT '0000-00-00' COMMENT 'Date de fin du contrat',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Liste des tarifs par période suivant contrat' ;

View File

@ -0,0 +1,10 @@
CREATE TABLE IF NOT EXISTS `clients_contrat_tarifs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`IdContrat` int(11) NOT NULL COMMENT 'Id du contrat',
`Item` varchar(255) NOT NULL COMMENT 'Nom de l''élément',
`Type` enum('Unitaire','ForfaitLimit','ForfaitNoLimit') NOT NULL COMMENT 'Type de comptabilisation',
`PriceUnit` float NOT NULL COMMENT 'Prix unitaire',
`MaxUnit` int(11) NOT NULL COMMENT 'Nombre maximum pour traitement',
`Doublon` enum('Jour','Mois','Periode') NOT NULL COMMENT 'Dédoublonnage',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

View File

@ -1,7 +1,18 @@
CREATE TABLE IF NOT EXISTS `clients_services` (
`code` varchar(20) NOT NULL COMMENT 'Code du service (elements texte sans espace ni caractères spéciaux)',
`label` varchar(100) NOT NULL COMMENT 'Libellé du service',
`droits` text NOT NULL COMMENT 'Droits (si différents des droits client)',
`idClient` int(11) NOT NULL,
PRIMARY KEY (`code`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
`id` int(11) NOT NULL AUTO_INCREMENT,
`IdClient` int(11) NOT NULL COMMENT 'Identifiant du client',
`Code` varchar(20) NOT NULL COMMENT 'Code du service',
`Label` varchar(255) NOT NULL COMMENT 'Libellé du service',
`TypeCompte` enum('TEST','PROD') NOT NULL COMMENT 'Type du compte',
`TypeAcces` enum('userPassword','userPasswordIP','IP') NOT NULL COMMENT 'Méthode d''authentification',
`TypeScore` enum('20','100') NOT NULL COMMENT 'Type de score',
`Timeout` int(4) NOT NULL DEFAULT '1800' COMMENT 'Délai avant déconnexion',
`AppWebservice` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Accès application WebService',
`AppOdea` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Accès application ODEA',
`Editable` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Autoriser l''edition (aussi pour les utilisateurs)',
`Active` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Activation, Désactivation du service',
`Deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Suppression logique',
`DateInsert` timestamp NULL DEFAULT NULL COMMENT 'Date d''insertion',
`DateUpdate` timestamp NULL DEFAULT NULL COMMENT 'Date de mise à jour',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

View File

@ -0,0 +1,8 @@
CREATE TABLE IF NOT EXISTS `clients_services_droits` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`IdClient` int(11) NOT NULL COMMENT 'Identifiant Client',
`Service` varchar(20) NOT NULL COMMENT 'Code du service',
`Acces` varchar(255) NOT NULL COMMENT 'Code du droits d''acces',
`DateAdded` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP COMMENT 'Date d''ajout',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

View File

@ -0,0 +1,8 @@
CREATE TABLE IF NOT EXISTS `clients_services_ip` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`IdClient` int(11) NOT NULL COMMENT 'Identifiant du client',
`Service` varchar(20) NOT NULL COMMENT 'Code du service',
`IP` varchar(255) NOT NULL,
`DateAdded` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

View File

@ -5,9 +5,9 @@ CREATE TABLE IF NOT EXISTS `clients_tarifs` (
`log` char(20) NOT NULL COMMENT 'Element à facturer',
`type` enum('Unitaire','ForfaitLimit','ForfaitNolimit') NOT NULL,
`priceUnit` float NOT NULL DEFAULT '0' COMMENT 'Prix unitaire d''un élément',
`limit` int(11) NOT NULL DEFAULT '0' COMMENT 'Nombre limite de consommation',
`Max` int(11) NOT NULL DEFAULT '0' COMMENT 'Nombre limite de consommation',
`dateDebut` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Date de debut du contrat',
`duree` int(11) NOT NULL COMMENT 'Durée du contrat',
`doublon` enum('jour','mois','period','') NOT NULL COMMENT 'Période de dédoublonnage',
PRIMARY KEY (`id`)
) ENGINE=MyISAM COMMENT='Définition des tarifs pour les clients et services';
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Définition des tarifs pour les clients et services' ;

View File

@ -0,0 +1,22 @@
CREATE TABLE IF NOT EXISTS `greffe_commandes_ac` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`refCommande` varchar(13) NOT NULL COMMENT 'Identifiant unique de commande',
`login` varchar(50) NOT NULL COMMENT 'Identifiant de l''utilisateur',
`email` varchar(255) NOT NULL COMMENT 'Email de l''utilisateur',
`refClient` varchar(255) NOT NULL COMMENT 'Référence de l''utilisateur',
`mode` enum('C','L','F','T') NOT NULL COMMENT 'Mode de traitement (C:Courrier infogreffe, L: Lettre S&D)',
`siren` varchar(9) NOT NULL COMMENT 'SIREN',
`raisonSociale` varchar(255) NOT NULL COMMENT 'Nom de l''entité',
`depotNum` int(11) NOT NULL COMMENT 'Numéro de dépot',
`depotDate` varchar(10) NOT NULL COMMENT 'Date du dépot',
`acteType` varchar(10) NOT NULL COMMENT 'Code infogreffe type de l''acte',
`acteDate` varchar(10) NOT NULL COMMENT 'Date de l''acte',
`acteNum` int(2) NOT NULL COMMENT 'Numéro de l''acte dans le dépot',
`cmdError` varchar(255) NOT NULL DEFAULT '',
`cmdUrl` varchar(255) NOT NULL DEFAULT '',
`cmdFile` varchar(255) NOT NULL DEFAULT '',
`dateInsert` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Date d''insertion',
`dateCommande` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Date de commande chez infogreffe (0 si commande non passé)',
`dateEnvoi` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Date d''envoi de la commande (email client)',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

View File

@ -0,0 +1,19 @@
CREATE TABLE IF NOT EXISTS `greffe_commandes_bi` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`refCommande` varchar(13) NOT NULL COMMENT 'Identifiant unique de commande',
`login` varchar(50) NOT NULL COMMENT 'Identifiant de l''utilisateur',
`email` varchar(255) NOT NULL COMMENT 'Email de l''utilisateur',
`refClient` varchar(255) NOT NULL COMMENT 'Référence de l''utilisateur',
`mode` enum('C','L','F','T') NOT NULL COMMENT 'Mode de traitement (C:Courrier infogreffe, L: Lettre S&D)',
`siren` varchar(9) NOT NULL COMMENT 'SIREN',
`raisonSociale` varchar(255) NOT NULL COMMENT 'Nom de l''entité',
`bilanCloture` varchar(10) NOT NULL COMMENT 'Date de cloture du bilan',
`bilanType` varchar(50) NOT NULL COMMENT 'Type du bilan (sociaux, consolidé)',
`cmdError` varchar(255) NOT NULL DEFAULT '',
`cmdUrl` varchar(255) NOT NULL DEFAULT '',
`cmdFile` varchar(255) NOT NULL DEFAULT '',
`dateInsert` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Date d''insertion',
`dateCommande` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Date de commande chez infogreffe (0 si commande non passé)',
`dateEnvoi` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Date d''envoi de la commande (email client)',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

View File

@ -0,0 +1,11 @@
CREATE TABLE IF NOT EXISTS `logs_count_consultation` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idClient` int(11) NOT NULL COMMENT 'ID du client',
`Service` varchar(50) NOT NULL COMMENT 'Code du service',
`Code` varchar(50) NOT NULL COMMENT 'Code de l''élément',
`Qte` int(11) NOT NULL COMMENT 'Quantité consommé',
`Annee` int(4) NOT NULL,
`Mois` int(2) NOT NULL,
`BatchUpdate` datetime NOT NULL COMMENT 'Date de mise à jour',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Table des consommations mensuel de consultation' ;

View File

@ -0,0 +1,8 @@
CREATE TABLE IF NOT EXISTS `logs_item` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`Code` varchar(50) NOT NULL COMMENT 'Code de l''élément',
`Label` varchar(255) NOT NULL COMMENT 'Libellé de l''élément',
`Description` varchar(255) NOT NULL,
`Category` enum('consultation','surveillance','flux') NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Référencement des éléments à comptabiliser' ;

View File

@ -1,5 +1,6 @@
CREATE TABLE IF NOT EXISTS `utilisateurs_service` (
`login` varchar(20) NOT NULL,
`serviceCode` varchar(20) NOT NULL COMMENT 'Code du service',
`IdClient` int(11) NOT NULL COMMENT 'Identifiant du client',
`Service` varchar(20) NOT NULL COMMENT 'Code du service',
PRIMARY KEY (`login`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

View File

@ -5,7 +5,17 @@ phpSettings.display_errors = 0
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.session.save_path = APPLICATION_PATH "/../data/sessions"
;resources.session.saveHandler.class = "Zend_Session_SaveHandler_DbTable"
;resources.session.saveHandler.options.schema = "webservice"
;resources.session.saveHandler.options.name = "session"
;resources.session.saveHandler.options.primary = "id"
;resources.session.saveHandler.options.modifiedColumn = "modified"
;resources.session.saveHandler.options.dataColumn = "data"
;resources.session.saveHandler.options.lifetimeColumn = "lifetime"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.plugins.Auth = "Application_Controller_Plugin_Auth"
resources.frontController.plugins.Services = "Application_Controller_Plugin_Services"
@ -13,9 +23,6 @@ resources.frontController.params.displayExceptions = 0
resources.layout.layout = "layout"
resources.layout.layoutPath = APPLICATION_PATH "/views"
resources.view.basePath = APPLICATION_PATH "/views"
autoloaderNamespaces[] = "Application_"
autoloaderNamespaces[] = "Scores_"
autoloaderNamespaces[] = "Metier_"
; Scores configuration
profil.server.name = development
@ -25,14 +32,25 @@ profil.mail.email.support = supportdev@scores-decisions.com
profil.mail.email.supportdev = supportdev@scores-decisions.com
profil.mail.email.contact = supportdev@scores-decisions.com
profil.mail.email.production = supportdev@scores-decisions.com
profil.wkhtmltopdf.path = "c:\Users\mricois\www\data\wkhtml\windows\wkhtmltopdf.exe"
profil.wkhtmltopdf.path = "C:\Users\mricois\www\data\extranet\wkhtml\windows\wkhtmltopdf.exe"
profil.path.batch = APPLICATION_PATH "/../scripts/jobs"
profil.path.cache = APPLICATION_PATH "/../data/cache"
profil.path.files = APPLICATION_PATH "/../data/files"
profil.path.log = APPLICATION_PATH "/../data/log"
profil.path.data = "c:\Users\mricois\www\dataws"
profil.path.secure = "c:\Users\mricois\www\dataws"
profil.path.data = "c:\Users\mricois\www\data\ws"
profil.path.secure = "c:\Users\mricois\www\data\ws"
; Metier - Infogreffe
profil.infogreffe.wsdl = "infogreffe.wsdl"
profil.infogreffe.url = "https://webservices.infogreffe.fr/WSContextInfogreffe/INFOGREFFE"
profil.infogreffe.uri = "https://webservices.infogreffe.fr/"
profil.infogreffe.user = 85000109
profil.infogreffe.password = 166
profil.infogreffe.cache.path = APPLICATION_PATH "/../data/cache"
profil.infogreffe.cache.time = 8
profil.infogreffe.storage.path = "c:\Users\mricois\www\data\ws\greffes"
; Sphinx configuration
profil.sphinx.ent.host = "192.168.78.242"
profil.sphinx.ent.port = 3312
profil.sphinx.ent.version = 2
@ -46,11 +64,11 @@ profil.sphinx.histo.host = "192.168.78.242"
profil.sphinx.histo.port = 3312
profil.sphinx.histo.version = 2
; For old configuration - see WsScores/Configure.php
; Database configuration - For old configuration - see Configure.php
profil.db.metier.adapter=mysqli
profil.db.metier.params.host=192.168.78.230
profil.db.metier.params.username=user
profil.db.metier.params.password=password
profil.db.metier.params.username=wsuser
profil.db.metier.params.password=scores
profil.db.metier.params.dbname=sdv1
profil.db.metier.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8"

View File

@ -22,8 +22,29 @@ $hostname = exec('echo $(hostname)');
passthru('cp -fv '. $configDir.'/'.$hostname.'/application.ini' . ' ' .$appconfigDir.'/application.ini');
/** Zend_Application */
require_once 'Zend/Application.php';
//Use classmap autoloader - useful with opcode and realpath cache
require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => __DIR__ . '/../../library/Zend',
'Application' => __DIR__ . '/../../library/Application',
'Scores' => __DIR__ . '/../../library/Scores',
'Metier' => __DIR__ . '/../../library/Metier',
),
'fallback_autoloader' => true
)
));
// Zend_Application - Use it if you don't have autoloaders
//require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
@ -66,6 +87,7 @@ elseif(isset($opts->install))
mkdir(APPLICATION_PATH.'/../data/cache');
mkdir(APPLICATION_PATH.'/../data/files');
mkdir(APPLICATION_PATH.'/../data/files/associations');
mkdir(APPLICATION_PATH.'/../data/files/greffes');
mkdir(APPLICATION_PATH.'/../data/log');
mkdir(APPLICATION_PATH.'/../data/sessions');

View File

@ -1,25 +1,46 @@
<?php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application'));
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
//Use classmap autoloader - useful with opcode and realpath cache
require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => __DIR__ . '/../../library/Zend',
'Application' => __DIR__ . '/../../library/Application',
'Scores' => __DIR__ . '/../../library/Scores',
'Metier' => __DIR__ . '/../../library/Metier',
),
'fallback_autoloader' => true
)
));
// Zend_Application - Use it if you don't have autoloaders
//require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
try {

View File

@ -13,8 +13,29 @@ set_include_path(implode(PATH_SEPARATOR, array(
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
//Use classmap autoloader - useful with opcode and realpath cache
require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => __DIR__ . '/../../library/Zend',
'Application' => __DIR__ . '/../../library/Application',
'Scores' => __DIR__ . '/../../library/Scores',
'Metier' => __DIR__ . '/../../library/Metier',
),
'fallback_autoloader' => true
)
));
// Zend_Application - Use it if you don't have autoloaders
//require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(

View File

@ -13,13 +13,34 @@ set_include_path(implode(PATH_SEPARATOR, array(
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
//Use classmap autoloader - useful with opcode and realpath cache
require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => __DIR__ . '/../../library/Zend',
'Application' => __DIR__ . '/../../library/Application',
'Scores' => __DIR__ . '/../../library/Scores',
'Metier' => __DIR__ . '/../../library/Metier',
),
'fallback_autoloader' => true
)
));
// Zend_Application - Use it if you don't have autoloaders
//require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
try {
@ -101,15 +122,15 @@ function genereCacheRatios()
$tabMoy=array();
$iDb = new WDB("jo");
$file = APPLICATION_PATH.'/../library/Metier/scores/classMRatios.tmp.php';
$file = APPLICATION_PATH.'/../library/SdMetier/Scoring/Ratios.php';
$fp=fopen($file, 'w');
fwrite($fp, "<?php\n");
fwrite($fp, "/** Auto generated class ".date('Y-m-d H:i:s')."*/\n");
fwrite($fp, "\n");
fwrite($fp, "require_once 'Metier/scores/classMvars.php';\n");
fwrite($fp, "require_once 'SdMetier/Scoring/Vars.php';\n");
fwrite($fp, "\n");
fwrite($fp, "class MRatios extends MVars\n");
fwrite($fp, "class SdMetier_Scoring_Ratios extends SdMetier_Scoring_Vars\n");
fwrite($fp, "{\n");
fwrite($fp, "\tpublic \$tva=19.6;\n");

View File

@ -13,8 +13,29 @@ set_include_path(implode(PATH_SEPARATOR, array(
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
//Use classmap autoloader - useful with opcode and realpath cache
require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => __DIR__ . '/../../library/Zend',
'Application' => __DIR__ . '/../../library/Application',
'Scores' => __DIR__ . '/../../library/Scores',
'Metier' => __DIR__ . '/../../library/Metier',
),
'fallback_autoloader' => true
)
));
// Zend_Application - Use it if you don't have autoloaders
//require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
@ -55,13 +76,13 @@ if ( $otps->compile!='' && in_array($opts->compile, $types) ) {
}
if ( count($types) > 0 ) {
foreach ( $types as $type ) {
$ruleSfrM = new Metier_Sfr_Compile();
$ruleSfrM->setVersion($opts->version);
$ruleSfrM->construct($type);
}
}

View File

@ -12,6 +12,36 @@ set_include_path(implode(PATH_SEPARATOR, array(
get_include_path(),
)));
//Use classmap autoloader - useful with opcode and realpath cache
require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => __DIR__ . '/../../library/Zend',
'Application' => __DIR__ . '/../../library/Application',
'Scores' => __DIR__ . '/../../library/Scores',
'Metier' => __DIR__ . '/../../library/Metier',
),
'fallback_autoloader' => true
)
));
// Zend_Application - Use it if you don't have autoloaders
//require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$c = new Zend_Config($application->getOptions());
Zend_Registry::set('config', $c);

View File

@ -13,8 +13,29 @@ set_include_path(implode(PATH_SEPARATOR, array(
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
//Use classmap autoloader - useful with opcode and realpath cache
require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => __DIR__ . '/../../library/Zend',
'Application' => __DIR__ . '/../../library/Application',
'Scores' => __DIR__ . '/../../library/Scores',
'Metier' => __DIR__ . '/../../library/Metier',
),
'fallback_autoloader' => true
)
));
// Zend_Application - Use it if you don't have autoloaders
//require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(

View File

@ -1,80 +0,0 @@
<?php
//error_reporting(E_ALL & ~E_NOTICE);
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
try {
$opts = new Zend_Console_Getopt(
//Options
array(
'help|?' => "Displays usage information.",
'all' => "Créer les WSDL à l'installation.",
'version=s' => "Re-Créer le WSDL associé à la version X.X.X",
'host=s' => "Le nom de domaine à requéter pour générer les WSDL correctement (sans http://)."
)
);
$opts->parse();
} catch (Zend_Console_Getopt_Exception $e) {
echo $e->getUsageMessage();
exit;
}
//Usage
if(isset($opts->help))
{
echo $opts->getUsageMessage();
exit;
}
//Génération des WSDL
if (isset($opts->all) && isset($opts->host))
{
$configServiceVersions = new Zend_Config_Ini('WsScore/Entreprise/Versions.ini');
foreach( $configServiceVersions->toArray() as $section => $params ){
$version = $section;
echo "Version $version";
if ($params['actif']==1){
echo " Traitement...\n";
echo genereWSDL($opts->host, $version);
}
echo "\n";
}
}
if (isset($opts->version) && isset($opts->host)){
echo genereWSDL($opts->host, $opts->version);
echo "\n";
}
function genereWSDL($host, $version){
$uri = 'http://'.$host.'/entreprise/v'.$version.'?wsdl-generate';
$client = new Zend_Http_Client($uri, array(
'adapter' => 'Zend_Http_Client_Adapter_Curl',
));
$response = $client->request('GET');
return $response->getBody();
}

View File

@ -13,21 +13,42 @@ set_include_path(implode(PATH_SEPARATOR, array(
get_include_path(),
)));
//Use classmap autoloader - useful with opcode and realpath cache
require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => __DIR__ . '/../../library/Zend',
'Application' => __DIR__ . '/../../library/Application',
'Scores' => __DIR__ . '/../../library/Scores',
'Metier' => __DIR__ . '/../../library/Metier',
),
'fallback_autoloader' => true
)
));
// Zend_Application - Use it if you don't have autoloaders
//require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$c = new Zend_Config($application->getOptions());
Zend_Registry::set('config', $c);
require_once 'WsScore/Configure.php';
$oldconfig = new Configure();
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
try {
$opts = new Zend_Console_Getopt(
//Options
@ -102,7 +123,7 @@ if ($acteList->count()>0) {
$pdfInfos = array();
$pdfInfos['pdfLink'] = $file;
$pdfInfos['pdfSize'] = filesize($path.$file);
//Get PDF version
$handle = fopen($path.$file, 'r');
if ($handle) {
@ -115,21 +136,21 @@ if ($acteList->count()>0) {
}
fclose($handle);
}
$pdfInfos['pdfVer'] = $version;
//Get PDF number of pages
$pdf = new Zend_Pdf($path.$file, null, true);
$pdfInfos['pdfPage'] = count($pdf->pages);
//Modifier la ligne dans la base de données
$acteM->update($pdfInfos, 'id='.$item['id']);
}
}
}
$reportMsg = "\nGénéré par getActesAsso.";
$reportMsg = "\n-= CLI getActesAsso.";
//Envoyer un mail de rapport
$mail = new Zend_Mail();

View File

@ -13,8 +13,29 @@ set_include_path(implode(PATH_SEPARATOR, array(
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
//Use classmap autoloader - useful with opcode and realpath cache
require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => __DIR__ . '/../../library/Zend',
'Application' => __DIR__ . '/../../library/Application',
'Scores' => __DIR__ . '/../../library/Scores',
'Metier' => __DIR__ . '/../../library/Metier',
),
'fallback_autoloader' => true
)
));
// Zend_Application - Use it if you don't have autoloaders
//require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(

View File

@ -13,8 +13,29 @@ set_include_path(implode(PATH_SEPARATOR, array(
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
//Use classmap autoloader - useful with opcode and realpath cache
require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => __DIR__ . '/../../library/Zend',
'Application' => __DIR__ . '/../../library/Application',
'Scores' => __DIR__ . '/../../library/Scores',
'Metier' => __DIR__ . '/../../library/Metier',
),
'fallback_autoloader' => true
)
));
// Zend_Application - Use it if you don't have autoloaders
//require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(

View File

@ -15,8 +15,29 @@ set_include_path(implode(PATH_SEPARATOR, array(
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
//Use classmap autoloader - useful with opcode and realpath cache
require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => __DIR__ . '/../../library/Zend',
'Application' => __DIR__ . '/../../library/Application',
'Scores' => __DIR__ . '/../../library/Scores',
'Metier' => __DIR__ . '/../../library/Metier',
),
'fallback_autoloader' => true
)
));
// Zend_Application - Use it if you don't have autoloaders
//require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(

View File

@ -1,48 +0,0 @@
<?php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
try {
$opts = new Zend_Console_Getopt(
//Options
array(
'help|?' => "Aide.",
'yesterday|y' => "Traitement logs du jour précédent",
'jour' => "Date au format AAAA-MM-JJ",
)
);
$opts->parse();
} catch (Zend_Console_Getopt_Exception $e) {
echo $e->getUsageMessage();
exit;
}
//Usage
if(isset($opts->help) || !isset($opts->file))
{
echo $opts->getUsageMessage();
exit;
}

View File

@ -23,8 +23,29 @@ set_include_path(implode(PATH_SEPARATOR, array(
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
//Use classmap autoloader - useful with opcode and realpath cache
require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => __DIR__ . '/../../library/Zend',
'Application' => __DIR__ . '/../../library/Application',
'Scores' => __DIR__ . '/../../library/Scores',
'Metier' => __DIR__ . '/../../library/Metier',
),
'fallback_autoloader' => true
)
));
// Zend_Application - Use it if you don't have autoloaders
//require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
@ -87,8 +108,3 @@ elseif (count($opts)==1 && $argc==4)
} else {
echo "Erreur !\n";
}