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
0b4cde74
Commit
0b4cde74
authored
5 years ago
by
Guillaume Heurtier
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #12428 TIME 2:30 summary sheet generation with contacts
parent
d41e6c91
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/resource/controllers/SummarySheetController.php
+75
-28
75 additions, 28 deletions
src/app/resource/controllers/SummarySheetController.php
with
75 additions
and
28 deletions
src/app/resource/controllers/SummarySheetController.php
+
75
−
28
View file @
0b4cde74
...
@@ -481,18 +481,35 @@ class SummarySheetController
...
@@ -481,18 +481,35 @@ class SummarySheetController
}
}
}
elseif
(
$unit
[
'unit'
]
==
'senderRecipientInformations'
)
{
}
elseif
(
$unit
[
'unit'
]
==
'senderRecipientInformations'
)
{
$senders
=
ContactController
::
getFormattedContacts
([
'resId'
=>
$resource
[
'res_id'
],
'mode'
=>
'sender'
]);
$senders
=
null
;
$recipients
=
ContactController
::
getFormattedContacts
([
'resId'
=>
$resource
[
'res_id'
],
'mode'
=>
'recipient'
]);
if
(
in_array
(
'senders'
,
$fieldsIdentifier
))
{
$senders
=
ContactController
::
getFormattedContacts
([
'resId'
=>
$resource
[
'res_id'
],
'mode'
=>
'sender'
]);
if
(
!
empty
(
$senders
)
&&
count
(
$senders
)
>
2
)
{
$nbSenders
=
count
(
$senders
);
$senders
=
[];
$senders
[
0
]
=
$nbSenders
.
' '
.
_CONTACTS
;
}
}
if
(
!
empty
(
$senders
)
&&
count
(
$senders
)
>
2
)
{
$recipients
=
null
;
$nbSenders
=
count
(
$senders
);
if
(
in_array
(
'recipients'
,
$fieldsIdentifier
))
{
$senders
=
[];
$recipients
=
ContactController
::
getFormattedContacts
([
$senders
[
0
]
=
$nbSenders
.
' '
.
_CONTACTS
;
'resId'
=>
$resource
[
'res_id'
],
'mode'
=>
'recipient'
]);
if
(
!
empty
(
$recipients
)
&&
count
(
$recipients
)
>
2
)
{
$nbRecipients
=
count
(
$recipients
);
$recipients
=
[];
$recipients
[
0
]
=
$nbRecipients
.
' '
.
_CONTACTS
;
}
}
}
if
(
!
empty
(
$recipients
)
&&
count
(
$recipients
)
>
2
)
{
$nbRecipients
=
count
(
$recipients
);
// If senders and recipients are both null, they are not part of the model so we continue to the next unit
$recipients
=
[];
if
(
$senders
===
null
&&
$recipients
=
==
null
)
{
$recipients
[
0
]
=
$nbRecipients
.
' '
.
_CONTACTS
;
continue
;
}
}
$pdf
->
SetY
(
$pdf
->
GetY
()
+
40
);
$pdf
->
SetY
(
$pdf
->
GetY
()
+
40
);
...
@@ -504,30 +521,60 @@ class SummarySheetController
...
@@ -504,30 +521,60 @@ class SummarySheetController
$pdf
->
SetY
(
$pdf
->
GetY
()
+
2
);
$pdf
->
SetY
(
$pdf
->
GetY
()
+
2
);
$pdf
->
SetFont
(
''
,
''
,
10
);
$pdf
->
SetFont
(
''
,
''
,
10
);
$pdf
->
Cell
(
$widthMultiCell
,
15
,
_SENDERS
,
1
,
0
,
'C'
,
false
);
$pdf
->
Cell
(
$widthCell
,
15
,
''
,
0
,
0
,
'C'
,
false
);
$correspondents
=
[];
$pdf
->
Cell
(
$widthMultiCell
,
15
,
_RECIPIENTS
,
1
,
1
,
'C'
,
false
);
if
(
$senders
!==
null
&&
$recipients
!==
null
)
{
if
(
empty
(
$senders
)
&&
empty
(
$recipients
))
{
if
(
empty
(
$senders
[
0
])
&&
empty
(
$recipients
[
0
]))
{
$pdf
->
MultiCell
(
$widthMultiCell
,
40
,
_UNDEFINED
,
1
,
'L'
,
false
,
0
,
''
,
''
,
true
,
0
,
true
);
$correspondents
=
[
null
,
null
];
$pdf
->
MultiCell
(
$widthCell
,
40
,
''
,
0
,
'L'
,
false
,
0
,
''
,
''
,
true
,
0
,
true
);
}
else
{
$pdf
->
MultiCell
(
$widthMultiCell
,
40
,
_UNDEFINED
,
1
,
'L'
,
false
,
1
,
''
,
''
,
true
,
0
,
true
);
for
(
$i
=
0
;
!
empty
(
$senders
[
$i
])
||
!
empty
(
$recipients
[
$i
]);
$i
++
)
{
}
else
{
$correspondents
[]
=
$senders
[
$i
]
??
null
;
for
(
$i
=
0
;
!
empty
(
$senders
[
$i
])
||
!
empty
(
$recipients
[
$i
]);
$i
++
)
{
$correspondents
[]
=
$recipients
[
$i
]
??
null
;
if
(
$i
==
0
&&
empty
(
$senders
[
$i
]))
{
$pdf
->
MultiCell
(
$widthMultiCell
,
40
,
_UNDEFINED
,
1
,
'L'
,
false
,
0
,
''
,
''
,
true
,
0
,
true
);
}
else
{
$pdf
->
MultiCell
(
$widthMultiCell
,
40
,
empty
(
$senders
[
$i
])
?
''
:
$senders
[
$i
],
empty
(
$senders
[
$i
])
?
0
:
1
,
'L'
,
false
,
0
,
''
,
''
,
true
,
0
,
true
);
}
}
}
$pdf
->
MultiCell
(
$widthCell
,
40
,
''
,
0
,
'L'
,
false
,
0
,
''
,
''
,
true
,
0
,
true
);
$pdf
->
Cell
(
$widthMultiCell
,
15
,
_SENDERS
,
1
,
0
,
'C'
,
false
);
$pdf
->
Cell
(
$widthCell
,
15
,
''
,
0
,
0
,
'C'
,
false
);
$pdf
->
Cell
(
$widthMultiCell
,
15
,
_RECIPIENTS
,
1
,
1
,
'C'
,
false
);
}
else
if
(
$senders
!==
null
&&
$recipients
===
null
)
{
$correspondents
=
$senders
;
if
(
$i
==
0
&&
empty
(
$recipients
[
$i
]))
{
$pdf
->
Cell
(
$widthMultiCell
,
15
,
_SENDERS
,
1
,
1
,
'C'
,
false
);
$pdf
->
MultiCell
(
$widthMultiCell
,
40
,
_UNDEFINED
,
1
,
'L'
,
false
,
1
,
''
,
''
,
true
,
0
,
true
);
}
else
if
(
$senders
===
null
&&
$recipients
!==
null
)
{
}
else
{
$correspondents
=
$recipients
;
$pdf
->
MultiCell
(
$widthMultiCell
,
40
,
empty
(
$recipients
[
$i
])
?
''
:
$recipients
[
$i
],
empty
(
$recipients
[
$i
])
?
0
:
1
,
'L'
,
false
,
1
,
''
,
''
,
true
,
0
,
true
);
$pdf
->
Cell
(
$widthMultiCell
,
15
,
_RECIPIENTS
,
1
,
1
,
'C'
,
false
);
}
// allow to skip an element in the senders or recipients column if we already printed UNDEFINED once
$columnUndefined
=
[
false
,
false
];
$nextLine
=
1
;
foreach
(
$correspondents
as
$correspondent
)
{
// if senders and recipients are not null, nextLine alternate between 0 and 1, otherwise its always 1
if
(
$senders
!==
null
&&
$recipients
!==
null
)
{
$nextLine
=
(
$nextLine
+
1
)
%
2
;
if
(
$columnUndefined
[
$nextLine
])
{
$pdf
->
MultiCell
(
$widthMultiCell
,
40
,
''
,
0
,
'L'
,
false
,
0
,
''
,
''
,
true
,
0
,
true
);
$pdf
->
MultiCell
(
$widthCell
,
40
,
''
,
0
,
'L'
,
false
,
$nextLine
,
''
,
''
,
true
,
0
,
true
);
continue
;
}
}
}
else
{
$nextLine
=
1
;
}
if
(
empty
(
$correspondent
))
{
$columnUndefined
[
$nextLine
]
=
true
;
$pdf
->
MultiCell
(
$widthMultiCell
,
40
,
_UNDEFINED
,
1
,
'L'
,
false
,
$nextLine
,
''
,
''
,
true
,
0
,
true
);
}
else
{
$pdf
->
MultiCell
(
$widthMultiCell
,
40
,
empty
(
$correspondent
)
?
''
:
$correspondent
,
empty
(
$correspondent
)
?
0
:
1
,
'L'
,
false
,
$nextLine
,
''
,
''
,
true
,
0
,
true
);
}
if
(
$nextLine
==
0
)
{
$pdf
->
MultiCell
(
$widthCell
,
40
,
''
,
0
,
'L'
,
false
,
0
,
''
,
''
,
true
,
0
,
true
);
}
}
}
}
}
elseif
(
$unit
[
'unit'
]
==
'diffusionList'
)
{
}
elseif
(
$unit
[
'unit'
]
==
'diffusionList'
)
{
$assignee
=
''
;
$assignee
=
''
;
$destination
=
''
;
$destination
=
''
;
...
...
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