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
ac0d0227
"src/frontend/app/profile.component.css" did not exist on "60aa04285ed8b75c919b788d23f705c86340405d"
Commit
ac0d0227
authored
4 years ago
by
Florian Azizian
Browse files
Options
Downloads
Patches
Plain Diff
FIX #15550 TIME 0:30 Set filename of document in complete folder history
parent
5c27127d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/history/controllers/HistoryController.php
+14
-5
14 additions, 5 deletions
src/app/history/controllers/HistoryController.php
with
14 additions
and
5 deletions
src/app/history/controllers/HistoryController.php
+
14
−
5
View file @
ac0d0227
...
...
@@ -24,14 +24,15 @@ use Document\models\DocumentModel;
use
Group\controllers\PrivilegeController
;
use
History\models\HistoryModel
;
use
Respect\Validation\Validator
;
use
setasign\Fpdi\Tcpdf\Fpdi
;
use
Slim\Http\Request
;
use
Slim\Http\Response
;
use
SrcCore\controllers\LanguageController
;
use
SrcCore\models\CoreConfigModel
;
use
SrcCore\models\TextFormatModel
;
use
SrcCore\models\ValidatorModel
;
use
User\models\UserModel
;
use
Workflow\models\WorkflowModel
;
use
setasign\Fpdi\Tcpdf\Fpdi
;
class
HistoryController
{
...
...
@@ -231,7 +232,13 @@ class HistoryController
if
(
!
empty
(
$mainDocument
[
'errors'
]))
{
return
$response
->
withStatus
(
$mainDocument
[
'code'
])
->
withJson
([
'errors'
=>
$mainDocument
[
'errors'
]]);
}
$documentPathToZip
[]
=
[
'path'
=>
$mainDocument
[
'path'
],
'filename'
=>
'mainDocument.pdf'
];
$document
=
DocumentModel
::
getById
([
'select'
=>
[
'sender'
,
'creation_date'
,
'notes'
,
'title'
],
'id'
=>
$args
[
'id'
]]);
$filename
=
TextFormatModel
::
createFilename
([
'label'
=>
$document
[
'title'
],
'extension'
=>
'pdf'
]);
$documentPathToZip
[]
=
[
'path'
=>
$mainDocument
[
'path'
],
'filename'
=>
'mainDocument_'
.
$filename
];
$attachments
=
AttachmentModel
::
getByDocumentId
([
'select'
=>
[
'id'
,
'title'
],
'documentId'
=>
$args
[
'id'
]]);
foreach
(
$attachments
as
$key
=>
$attachment
)
{
...
...
@@ -258,10 +265,12 @@ class HistoryController
if
(
$adr
[
0
][
'fingerprint'
]
!=
$fingerprint
)
{
return
$response
->
withStatus
(
400
)
->
withJson
([
'errors'
=>
'Fingerprint do not match'
]);
}
$documentPathToZip
[]
=
[
'path'
=>
$pathToDocument
,
'filename'
=>
'attachment_'
.
$key
.
'.pdf'
];
$filename
=
TextFormatModel
::
createFilename
([
'label'
=>
$attachment
[
'title'
],
'extension'
=>
'pdf'
]);
$documentPathToZip
[]
=
[
'path'
=>
$pathToDocument
,
'filename'
=>
'attachment_'
.
$key
.
'_'
.
$filename
];
}
$document
=
DocumentModel
::
getById
([
'select'
=>
[
'sender'
,
'creation_date'
,
'notes'
],
'id'
=>
$args
[
'id'
]]);
$notes
=
[];
$documentNotes
=
json_decode
(
$document
[
'notes'
],
true
);
...
...
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