Loading src/UnicaenDbImport/Controller/SynchroController.php +8 −6 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ class SynchroController extends AbstractActionController $synchros = $this->synchroService->getSynchros(); } $importLogs = $diffFounds = []; $importLogs = $diffFounds = $diffFoundsErrors = []; foreach ($synchros as $synchro) { $importLog = $this->importLogService->findLastLogForSynchro($synchro); $importLogs[$synchro->getName()] = $importLog; Loading @@ -49,11 +49,12 @@ class SynchroController extends AbstractActionController $diffFounds[$synchro->getName()] = $this->synchroService->fetchSynchroDiffFound($synchro); } catch (Exception $e) { $this->flashMessenger()->addErrorMessage(sprintf( "Erreur rencontrée lors du calcul des différences pour la syncho %s : %s", $synchro, $e->getMessage() )); $error = "Erreur rencontrée lors du calcul des différences pour la syncho $synchro :"; do { $error .= ' ' . $e->getMessage(); $e = $e->getPrevious(); } while ($e); $diffFoundsErrors[$synchro->getName()] = $error; } } Loading @@ -61,6 +62,7 @@ class SynchroController extends AbstractActionController 'synchros' => $synchros, 'importLogs' => $importLogs, 'diffFounds' => $diffFounds, 'diffFoundsErrors' => $diffFoundsErrors, 'text' => $text, ]; } Loading view/unicaen-db-import/synchro/index.phtml +19 −6 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ * @var \UnicaenDbImport\Domain\Synchro[] $synchros * @var \UnicaenDbImport\Entity\Db\ImportLog[] $importLogs * @var int[] $diffFounds * @var string[] $diffFoundsErrors * @var string $text * @var \Application\View\Renderer\PhpRenderer $this * Loading Loading @@ -65,6 +66,9 @@ $lancable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPrivilege::L <th rowspan="2"> <?php echo $this->translate("Diff"); ?> ? </th> <th rowspan="2"> <?php echo $this->translate("Actions"); ?> </th> </tr> <tr> <th> Loading Loading @@ -92,6 +96,7 @@ $lancable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPrivilege::L $destination = $synchro->getDestination(); $importLog = $importLogs[$synchro->getName()] ?? null; $diffFound = $diffFounds[$synchro->getName()] ?? 0; $diffFoundError = $diffFoundsErrors[$synchro->getName()] ?? null; ?> <tr class="synchro"> <td> Loading Loading @@ -134,6 +139,20 @@ $lancable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPrivilege::L <?php endif ?> </td> <td class="diff"> <?php if ($diffFoundError): ?> <span class="icon icon-warning text-danger" title="<?php echo $diffFoundError ?>"></span> <?php else: ?> <?php if ($diffFound): ?> <a href="<?php echo $this->url('unicaen-db-import/synchro/diff', ['name' => $synchro->getName()]) ?>" title="Voir le différentiel"> Oui </a> <?php else: ?> Non <?php endif ?> <?php endif ?> </td> <td class="action"> <?php if ($diffFound): ?> <?php if ($lancable): ?> <a class="btn btn-warning btn-sm" Loading @@ -144,12 +163,6 @@ $lancable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPrivilege::L ['query' => ['redirect' => $this->url('unicaen-db-import/synchro/voir', ['name' => $synchro->getName()])]], ) ?>"><span class="fas fa-play"></span></a> <?php endif ?> <a href="<?php echo $this->url('unicaen-db-import/synchro/diff', ['name' => $synchro->getName()]) ?>" title="Voir le différentiel"> Oui </a> <?php else: ?> Non <?php endif ?> </td> </tr> Loading Loading
src/UnicaenDbImport/Controller/SynchroController.php +8 −6 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ class SynchroController extends AbstractActionController $synchros = $this->synchroService->getSynchros(); } $importLogs = $diffFounds = []; $importLogs = $diffFounds = $diffFoundsErrors = []; foreach ($synchros as $synchro) { $importLog = $this->importLogService->findLastLogForSynchro($synchro); $importLogs[$synchro->getName()] = $importLog; Loading @@ -49,11 +49,12 @@ class SynchroController extends AbstractActionController $diffFounds[$synchro->getName()] = $this->synchroService->fetchSynchroDiffFound($synchro); } catch (Exception $e) { $this->flashMessenger()->addErrorMessage(sprintf( "Erreur rencontrée lors du calcul des différences pour la syncho %s : %s", $synchro, $e->getMessage() )); $error = "Erreur rencontrée lors du calcul des différences pour la syncho $synchro :"; do { $error .= ' ' . $e->getMessage(); $e = $e->getPrevious(); } while ($e); $diffFoundsErrors[$synchro->getName()] = $error; } } Loading @@ -61,6 +62,7 @@ class SynchroController extends AbstractActionController 'synchros' => $synchros, 'importLogs' => $importLogs, 'diffFounds' => $diffFounds, 'diffFoundsErrors' => $diffFoundsErrors, 'text' => $text, ]; } Loading
view/unicaen-db-import/synchro/index.phtml +19 −6 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ * @var \UnicaenDbImport\Domain\Synchro[] $synchros * @var \UnicaenDbImport\Entity\Db\ImportLog[] $importLogs * @var int[] $diffFounds * @var string[] $diffFoundsErrors * @var string $text * @var \Application\View\Renderer\PhpRenderer $this * Loading Loading @@ -65,6 +66,9 @@ $lancable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPrivilege::L <th rowspan="2"> <?php echo $this->translate("Diff"); ?> ? </th> <th rowspan="2"> <?php echo $this->translate("Actions"); ?> </th> </tr> <tr> <th> Loading Loading @@ -92,6 +96,7 @@ $lancable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPrivilege::L $destination = $synchro->getDestination(); $importLog = $importLogs[$synchro->getName()] ?? null; $diffFound = $diffFounds[$synchro->getName()] ?? 0; $diffFoundError = $diffFoundsErrors[$synchro->getName()] ?? null; ?> <tr class="synchro"> <td> Loading Loading @@ -134,6 +139,20 @@ $lancable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPrivilege::L <?php endif ?> </td> <td class="diff"> <?php if ($diffFoundError): ?> <span class="icon icon-warning text-danger" title="<?php echo $diffFoundError ?>"></span> <?php else: ?> <?php if ($diffFound): ?> <a href="<?php echo $this->url('unicaen-db-import/synchro/diff', ['name' => $synchro->getName()]) ?>" title="Voir le différentiel"> Oui </a> <?php else: ?> Non <?php endif ?> <?php endif ?> </td> <td class="action"> <?php if ($diffFound): ?> <?php if ($lancable): ?> <a class="btn btn-warning btn-sm" Loading @@ -144,12 +163,6 @@ $lancable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPrivilege::L ['query' => ['redirect' => $this->url('unicaen-db-import/synchro/voir', ['name' => $synchro->getName()])]], ) ?>"><span class="fas fa-play"></span></a> <?php endif ?> <a href="<?php echo $this->url('unicaen-db-import/synchro/diff', ['name' => $synchro->getName()]) ?>" title="Voir le différentiel"> Oui </a> <?php else: ?> Non <?php endif ?> </td> </tr> Loading