Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
MaarchCapture
Commits
81de276a
Verified
Commit
81de276a
authored
May 10, 2019
by
Alex ORLUC
Browse files
FEAT #10160 TIME 2:30 add prefix param for qrseparator
parent
b83f2705
Changes
2
Hide whitespace changes
Inline
Side-by-side
config/samples/Capture_qrseparator_sample.xml.default
View file @
81de276a
...
...
@@ -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>
...
...
modules/QRSeparator/MaarchQRSeparator.php
View file @
81de276a
...
...
@@ -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();
...
...
@@ -160,6 +169,18 @@ class QRSeparator
$text
=
$qrcode
->
text
();
var_dump
(
$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
;
echo
"This is a separator ! Extract name ..."
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment