Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
MaarchCapture
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maarch Labs
MaarchCapture
Commits
81de276a
Verified
Commit
81de276a
authored
May 10, 2019
by
Alex ORLUC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FEAT #10160 TIME 2:30 add prefix param for qrseparator
parent
b83f2705
Pipeline
#3778
failed with stage
in 3 minutes and 57 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
Capture_qrseparator_sample.xml.default
config/samples/Capture_qrseparator_sample.xml.default
+1
-0
MaarchQRSeparator.php
modules/QRSeparator/MaarchQRSeparator.php
+23
-2
No files found.
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
Markdown
is supported
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