Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchParapheur
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
MaarchParapheur
Commits
ffeef58a
Verified
Commit
ffeef58a
authored
4 years ago
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
FIX #10994 TIME 0:00 WIP history
parent
e51a8519
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/history/controllers/HistoryController.php
+32
-2
32 additions, 2 deletions
src/app/history/controllers/HistoryController.php
with
32 additions
and
2 deletions
src/app/history/controllers/HistoryController.php
+
32
−
2
View file @
ffeef58a
...
@@ -57,6 +57,38 @@ class HistoryController
...
@@ -57,6 +57,38 @@ class HistoryController
return
true
;
return
true
;
}
}
public
function
get
(
Request
$request
,
Response
$response
,
array
$args
)
{
//TODO privilege
// $history = HistoryModel::get([
// 'select' => ['code', 'type', '"user"', 'date', 'message', 'data', 'user_id', 'ip'],
// 'where' => ["(object_type = ? AND object_id = ?) OR (data->>'mainDocumentId' = ?)"],
// 'data' => ['main_documents', $args['id'], $args['id']],
// 'orderBy' => ['date']
// ]);
//
//
// HistoryController::add([
// 'code' => 'OK',
// 'objectType' => 'history',
// 'objectId' => $args['id'],
// 'type' => 'VIEW',
// 'message' => '{documentHistoryViewed}',
// 'data' => ['objectType' => 'main_documents']
// ]);
//
// $queryParams = $request->getQueryParams();
// if (!isset($queryParams['mode']) || $queryParams['mode'] == 'json') {
// return $response->withJson(['history' => $formattedHistory['formattedHistory']]);
// } else {
// $historyXml = HistoryController::arrayToXml(['data' => $formattedHistory['formattedHistory'], 'xml' => false]);
// $response->write($historyXml);
// $response = $response->withAddedHeader('Content-Disposition', "inline; filename=maarch_history.xml");
// return $response->withHeader('Content-Type', 'application/xml');
// }
}
public
function
getByDocumentId
(
Request
$request
,
Response
$response
,
array
$args
)
public
function
getByDocumentId
(
Request
$request
,
Response
$response
,
array
$args
)
{
{
if
(
!
Validator
::
intVal
()
->
notEmpty
()
->
validate
(
$args
[
'id'
]))
{
if
(
!
Validator
::
intVal
()
->
notEmpty
()
->
validate
(
$args
[
'id'
]))
{
...
@@ -95,8 +127,6 @@ class HistoryController
...
@@ -95,8 +127,6 @@ class HistoryController
$response
=
$response
->
withAddedHeader
(
'Content-Disposition'
,
"inline; filename=maarch_history.xml"
);
$response
=
$response
->
withAddedHeader
(
'Content-Disposition'
,
"inline; filename=maarch_history.xml"
);
return
$response
->
withHeader
(
'Content-Type'
,
'application/xml'
);
return
$response
->
withHeader
(
'Content-Type'
,
'application/xml'
);
}
}
return
$response
->
withJson
([
'history'
=>
$formattedHistory
[
'formattedHistory'
]]);
}
}
public
static
function
getFormattedHistory
(
$args
=
[])
public
static
function
getFormattedHistory
(
$args
=
[])
...
...
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