Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
72b00c63
Commit
72b00c63
authored
8 years ago
by
Alexandre Morin
Committed by
Giovannoni Laurent
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Zip function
parent
b75b07ac
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/export_seda/ArchiveTransfer.php
+69
-0
69 additions, 0 deletions
modules/export_seda/ArchiveTransfer.php
modules/export_seda/export.php
+0
-43
0 additions, 43 deletions
modules/export_seda/export.php
modules/export_seda/export_seda.php
+3
-0
3 additions, 0 deletions
modules/export_seda/export_seda.php
with
72 additions
and
43 deletions
modules/export_seda/ArchiveTransfer.php
+
69
−
0
View file @
72b00c63
...
...
@@ -103,6 +103,22 @@ class ArchiveTransfer {
return
$xml
;
}
public
function
deleteMessage
(
$listResId
)
{
if
(
!
$listResId
)
{
return
false
;
}
foreach
(
$listResId
as
$resId
)
{
$unitIdentifiers
=
$this
->
getUnitIdentifier
(
$resId
);
foreach
(
$unitIdentifiers
as
$unitIdentifier
)
{
$this
->
deleteSeda
(
$unitIdentifier
->
message_id
);
$this
->
deleteUnitIdentifier
(
$unitIdentifier
->
message_id
);
}
}
return
true
;
}
private
function
sendAttachment
(
$messageObject
)
{
$messageId
=
$messageObject
->
messageIdentifier
->
value
;
...
...
@@ -356,6 +372,27 @@ class ArchiveTransfer {
return
$custodialHistoryItem
;
}
///////////////////
/// Requete SQL ///
///////////////////
private
function
getUnitIdentifier
(
$resId
)
{
$queryParams
=
[];
$queryParams
[]
=
$resId
;
$query
=
"SELECT * FROM unit_identifier WHERE res_id = ?"
;
$smtp
=
$this
->
db
->
query
(
$query
,
$queryParams
);
$unitIdentifier
=
[];
while
(
$res
=
$smtp
->
fetchObject
())
{
$unitIdentifier
[]
=
$res
;
}
return
$unitIdentifier
;
}
private
function
getCourrier
(
$resId
)
{
...
...
@@ -557,4 +594,36 @@ class ArchiveTransfer {
return
true
;
}
private
function
deleteSeda
(
$messageId
)
{
$queryParams
=
[];
$queryParams
[]
=
$messageId
;
try
{
$query
=
"DELETE FROM seda WHERE message_id = ?"
;
$smtp
=
$this
->
db
->
query
(
$query
,
$queryParams
);
}
catch
(
Exception
$e
)
{
return
false
;
}
return
true
;
}
private
function
deleteUnitIdentifier
(
$messageId
)
{
$queryParams
=
[];
$queryParams
[]
=
$messageId
;
try
{
$query
=
"DELETE FROM unit_identifier WHERE message_id = ?"
;
$smtp
=
$this
->
db
->
query
(
$query
,
$queryParams
);
}
catch
(
Exception
$e
)
{
return
false
;
}
return
true
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
modules/export_seda/export.php
deleted
100644 → 0
+
0
−
43
View file @
b75b07ac
<?php
/*
* Copyright 2008-2017 Maarch
*
* This file is part of Maarch Framework.
*
* Maarch Framework is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Maarch Framework is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/
require_once
__DIR__
.
'/ArchiveTransferReply.php'
;
require_once
__DIR__
.
'/ArchiveTransfer.php'
;
require_once
__DIR__
.
'/Acknowledgement.php'
;
// Args
//ARCHIVE TRANSFER
//$listResId = ['100','101','102'];
//$archiveTransfer = new ArchiveTransfer();
//$message = $archiveTransfer->receive($listResId);
//$archiveTransfer->sendXml($message);
// ACKNOWLEDGEMENT
//$acknowledgement = new Acknowledgement();
//$acknowledgement->send(__DIR__. DIRECTORY_SEPARATOR ."seda2". DIRECTORY_SEPARATOR . $message->messageIdentifier->value .".xml");
//ARCHIVE TRANSFER REPLY
/*
$archiveTransferReply = new ArchiveTransfertReply();
$archiveTransferReply->receive(__DIR__. DIRECTORY_SEPARATOR ."seda2". DIRECTORY_SEPARATOR . "bblier-20170216-163047_reply.xml");
*/
\ No newline at end of file
This diff is collapsed.
Click to expand it.
modules/export_seda/export_seda.php
+
3
−
0
View file @
72b00c63
...
...
@@ -31,6 +31,9 @@ require_once __DIR__.'/ArchiveTransfer.php';
function
get_form_txt
(
$values
,
$path_manage_action
,
$id_action
,
$table
,
$module
,
$coll_id
,
$mode
)
{
$archiveTransfer
=
new
ArchiveTransfer
();
$result
=
$archiveTransfer
->
deleteMessage
(
$values
);
$result
=
$archiveTransfer
->
receive
(
$values
);
$db
=
new
Database
();
...
...
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