Skip to content
Snippets Groups Projects
Commit 1ed6b8f5 authored by VESSILLER's avatar VESSILLER
Browse files

FIX agent display name if no user found (agent list)

parent aedbd12b
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,8 @@
$exportDirUserPath = (isset($_['exportDirUserPath']) ? $_['exportDirUserPath'] : '');
$msgList = (isset($_['msgList']) ? $_['msgList'] : array());
$urlGenerator = OC::$server->getURLGenerator();
// alert messages
$htmlAlert = '';
if (!empty($msgList)) {
......@@ -46,10 +48,10 @@
<?php if (!empty($htmlAlert)) { ?>
<div id="dematpayslip_alert"><?php print $htmlAlert; ?></div>
<?php } ?>
<h2><?php p($l->t('Liste des agents')); ?>&nbsp;&nbsp;<a href="<?php echo \OC\URLGenerator::linkToRoute('dematpayslip.page.agent_csv'); ?>" class="button" title="<?php p($l->t('Export CSV')); ?>"><?php p($l->t('CSV')); ?></a></h2>
<h2><?php p($l->t('Liste des agents')); ?>&nbsp;&nbsp;<a href="<?php echo $urlGenerator->linkToRoute('dematpayslip.page.agent_csv'); ?>" class="button" title="<?php p($l->t('Export CSV')); ?>"><?php p($l->t('CSV')); ?></a></h2>
<div>
<a href="<?php echo \OC\URLGenerator::linkToRoute('files.view.index', ['dir' => $exportDirUserPath]); ?>" class="button" target="_blank" title="<?php p($l->t('Accéder aux exports CSV')); ?>"><?php p($l->t('Accéder aux exports CSV')); ?></a>
<a href="<?php echo $urlGenerator->linkToRoute('files.view.index', ['dir' => $exportDirUserPath]); ?>" class="button" target="_blank" title="<?php p($l->t('Accéder aux exports CSV')); ?>"><?php p($l->t('Accéder aux exports CSV')); ?></a>
</div>
<br />
......@@ -74,10 +76,16 @@
<tbody>
<?php
foreach ($dematpayslipUserList as $dematpayslipUser) {
$dematpayslipUserId = $dematpayslipUser->getUserId();
$dematpayslipUserDisplayName = $dematpayslipUserId;
$user = OC::$server->getUserManager()->get($dematpayslipUserId);
if ($user) {
$dematpayslipUserDisplayName = $user->getDisplayName();
}
?>
<tr>
<!-- <th>--><?php //print $dematpayslipUser->getUserId(); ?><!--</th>-->
<th scope="row"><?php print \OC::$server->getUserManager()->get($dematpayslipUser->getUserId())->getDisplayName(); ?></th>
<th scope="row"><?php print $dematpayslipUserDisplayName; ?></th>
<td><?php print $dematpayslipUser->getSiret(); ?></td>
<td><?php print $dematpayslipUser->getMatricule(); ?></td>
<td><?php print $dematpayslipUser->getEmail(); ?></td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment