Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCapture
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCapture
Commits
81de276a
Verified
Commit
81de276a
authored
5 years ago
by
Alex ORLUC
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #10160 TIME 2:30 add prefix param for qrseparator
parent
b83f2705
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/samples/Capture_qrseparator_sample.xml.default
+1
-0
1 addition, 0 deletions
config/samples/Capture_qrseparator_sample.xml.default
modules/QRSeparator/MaarchQRSeparator.php
+23
-2
23 additions, 2 deletions
modules/QRSeparator/MaarchQRSeparator.php
with
24 additions
and
2 deletions
config/samples/Capture_qrseparator_sample.xml.default
+
1
−
0
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>
...
...
This diff is collapsed.
Click to expand it.
modules/QRSeparator/MaarchQRSeparator.php
+
23
−
2
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 ..."
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment