Commit 90fdabe0 authored by Florian Azizian's avatar Florian Azizian

Merge branch 'develop' into 'master'

Develop

See merge request !23
parents 4c24fbf7 131cc46d
======================================
VERSION FRANÇAISE
======================================
ajout des WS REST
ajout de modèles de paramétrage
ajout des tests fonctionnels pour l'intégration continue
This diff is collapsed.
# Version
`1.4`
# Prerequisit
`PHP 7 or greater`
## PHP Modules:
- fileinfo (php_finfo)
- pdf (php_pdf)
- imap (php_imap)
- PDFLib for PDFSplitter (php_pdflib)
- PDFLib TET for PDFExtractor (php_tet)
## Maarch modules:
- Maarch CLI_Tools
# Install
```
git clone -b 1.4 https://labs.maarch.org/maarch/MaarchCapture
```
# PDFLib
- Download at www.pdflib.com
- Extract
- Copy binds/php_pdflib.dll in php/ext
- add extension in php.ini
> Windows :
> [HKEY_LOCAL_MACHINE\SOFTWARE\PDFlib\PDFlib9]
> [HKEY_LOCAL_MACHINE\SOFTWARE\PDFlib\PDFlib9\9.0.0]
> "license"="W000000-000000-000000-000000-000000"
# PDFLib TET
- Download at www.pdflib.com
- Extract
- Copy binds/php_tet.dll in php/ext
- add extension in php.ini
***********************
Version
***********************
1.3
- developpment of a webservice client REST.
- Can choose custom Capture.xml in script
Ex: php MaarchCapture.php init -ConfigName Capture_custom -BatchName CAPTURE_MAIL
- Can choose custom MaarchWSClient.xml in Capture.xml
Ex: <step function="processBatch" module="MaarchWSClient" name="SendToMaarch">
<input name="WSDL">maarchcourrier</input>
<input name="Process">IMPORT_MAIL_1</input>
<input name="CatchError">false</input>
<input name="configFile">MaarchWSClient.xml</input>
</step>
- Fix warnings :
PHP Warning: Declaration of Workflow::load($id, $directory) should be compatible with DOMDocument::load($source, $options = NULL)
PHP Warning: Declaration of Batch::load($BatchId, $envDirectory) should be compatible with DOMDocument::load($source, $options = NULL)
***********************
Prerequisit
***********************
PHP 5.3 or greater
PHP Modules:
* fileinfo (php_finfo)
* pdf (php_pdf)
* imap (php_imap)
* PDFLib for PDFSplitter (php_pdflib)
* PDFLib TET for PDFExtractor (php_tet)
Maarch modules:
* Maarch CLI_Tools
***********************
Install
***********************
git clone -b 1.2 https://labs.maarch.org/maarch/MaarchCapture
***********************
PDFLib
***********************
Download at www.pdflib.com
Extract
Copy binds/php_pdflib.dll in php/ext
add extension in php.ini
Windows :
[HKEY_LOCAL_MACHINE\SOFTWARE\PDFlib\PDFlib9]
[HKEY_LOCAL_MACHINE\SOFTWARE\PDFlib\PDFlib9\9.0.0]
"license"="W000000-000000-000000-000000-000000"
PDFLib TET
***********************
Download at www.pdflib.com
Extract
Copy binds/php_tet.dll in php/ext
add extension in php.ini
This diff is collapsed.
This diff is collapsed.
......@@ -12,6 +12,7 @@
<workflow name="SCAN_MASS" debug="false" logMode="Maarch" maarchLogParam="/var/www/html/MaarchCourrier/apps/maarch_entreprise/xml/log4php.xml" maarchLoggerName="loggerTechnique">
<step function="separatePDF" module="QRSeparator" name="separatePDF">
<input name="ScanSource">/opt/maarch/MaarchCapture/files/TEST_IMPORT/</input>
<input name="qrcodePrefix">false</input>
</step>
<step function="processBatch" module="MaarchWSClient" name="SendToMaarch">
<input name="WSDL">MaarchRestWS</input>
......
......@@ -1861,7 +1861,7 @@ class MailCapture
<head>
<meta name="AUTHOR" content="Maarch"/>
<meta name="CHANGEDBY" content="Maarch"/>
</hea>
</head>
<body>
</body>
......
......@@ -2,19 +2,28 @@
class QRSeparator
{
public $qrcodePrefix = "false";
public function __construct()
{
$this->Batch = $_SESSION['capture']->Batch;
require __DIR__ . "/../../vendor/autoload.php";
}
public function separatePDF($ScanSource, $ResultDirectory = false)
public function separatePDF($ScanSource, $qrcodePrefix, $ResultDirectory = false)
{
echo "Init process ...\n";
$_SESSION['capture']->logEvent(
"Init process ... "
);
$this->qrcodePrefix = $qrcodePrefix;
if ($qrcodePrefix == "true") {
echo "Prefix MAARCH_ is enabled !\n";
}
if (!is_readable($ScanSource)) {
echo "Source directory is not valid !\n";
$_SESSION['capture']->logEvent(
......@@ -56,7 +65,6 @@ class QRSeparator
//Ignore all files except pdf
if (strtolower($array_files[1]) == 'pdf') {
//call split function to sepearate pages
try {
$this->split_pdf($ScanSource.$files[$key], sys_get_temp_dir().'/'.$key);
......@@ -138,6 +146,7 @@ class QRSeparator
public function construct_pdf($split_directory, $end_directory = false)
{
print_r($this->qrcodePrefix);
$end_directory = $end_directory ? $end_directory : sys_get_temp_dir().'/';
//$new_pdf = new FPDI();
......@@ -159,6 +168,16 @@ class QRSeparator
$pdfdata = file_get_contents($split_directory.$file);
$text = $qrcode->text();
if ($this->qrcodePrefix == "true" && !empty($text)) {
if (preg_match("/^MAARCH_/i", $text)) {
$text = preg_replace("/^MAARCH_/i", '', $text);
echo "Un résultat a été trouvé.";
} else {
$text = '';
echo "Aucun résultat n'a été trouvé.";
}
}
if (!empty($text)) {
$isCourrier = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment