2021-12-08 11:11:46 +01:00
|
|
|
<?php
|
|
|
|
use Cake\Utility\Inflector;
|
|
|
|
use Cake\Routing\Router;
|
|
|
|
?>
|
|
|
|
|
2021-12-01 11:01:31 +01:00
|
|
|
<table class="table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th scope="col"><?= __('Field name') ?></th>
|
|
|
|
<th scope="col"><?= __('Conflict') ?></th>
|
2021-12-08 11:11:46 +01:00
|
|
|
<th scope="col"><?= __('Conflicting entities') ?></th>
|
2021-12-01 11:01:31 +01:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2021-12-14 15:09:40 +01:00
|
|
|
<?php foreach ($templateStatus['conflicts'] as $fieldName => $fieldConflict) : ?>
|
2021-12-01 11:01:31 +01:00
|
|
|
<?php foreach ($fieldConflict['conflicts'] as $conflict) : ?>
|
|
|
|
<tr>
|
|
|
|
<th scope="row"><?= h($fieldName) ?></th>
|
|
|
|
<td>
|
|
|
|
<?= h($conflict) ?>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<?php
|
2021-12-08 11:11:46 +01:00
|
|
|
foreach ($fieldConflict['conflictingEntities'] as $i => $id) {
|
|
|
|
if ($i > 0) {
|
|
|
|
echo ', ';
|
|
|
|
}
|
|
|
|
if ($i > 10) {
|
|
|
|
echo sprintf('<span class="fw-light fs-7">%s</span>', __('{0} more', count($fieldConflict['conflictingEntities'])-$i));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
$url = Router::url([
|
2021-12-14 15:09:40 +01:00
|
|
|
'controller' => Inflector::pluralize($templateStatus['existing_template']->scope),
|
2021-12-08 11:11:46 +01:00
|
|
|
'action' => 'view',
|
|
|
|
$id
|
|
|
|
]);
|
2021-12-14 15:09:40 +01:00
|
|
|
echo sprintf('<a href="%s" target="_blank">%s</a>', $url, __('{0} #{1}', h(Inflector::humanize($templateStatus['existing_template']->scope)), h($id)));
|
2021-12-08 11:11:46 +01:00
|
|
|
}
|
2021-12-01 11:01:31 +01:00
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|