Commit 477999b0 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Module STepStar : affichage du tag et possibilité de filtrer les logs par tag

parent 8b24a8aa
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -131,11 +131,12 @@ class Log
    }

    /**
     * @param int $length
     * @return string
     */
    public function getTruncatedLog(): string
    public function getTruncatedLog(int $length = 120): string
    {
        return mb_substr($this->log, 0, 120);
        return mb_substr($this->log, 0, $length);
    }

    /**
+6 −1
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@

namespace StepStar\Service\Log\Recherche;

use These\Entity\Db\These;
use Application\Search\Filter\SelectSearchFilter;
use Application\Search\Filter\TextSearchFilter;
use Application\Search\SearchService;
@@ -13,6 +12,7 @@ use StepStar\Service\Log\LogServiceAwareTrait;
use Structure\Entity\Db\Etablissement;
use Structure\Search\Etablissement\EtablissementSearchFilter;
use Structure\Service\Etablissement\EtablissementServiceAwareTrait;
use These\Entity\Db\These;

class LogSearchService extends SearchService
{
@@ -56,6 +56,11 @@ class LogSearchService extends SearchService
                    0 => 'Non',
                ])
        );
        $this->addFilter(
            (new TextSearchFilter("Tag", 'tag'))
                ->setUseLikeOperator()
                ->setWhereField('log.tag')
        );
    }

    /**
+8 −1
Original line number Diff line number Diff line
@@ -68,6 +68,9 @@ $this->headTitle("Logs");
            <th>
                Log
            </th>
            <th>
                Tag
            </th>
            <th class="action">
                Action
            </th>
@@ -124,7 +127,11 @@ $this->headTitle("Logs");
                        </td>

                        <td class="<?php echo $log->isSuccess() ? '' : 'text-danger' ?>">
                            <?php echo $log->getTruncatedLog() ?>
                            <?php echo $log->getTruncatedLog(80) ?>
                        </td>

                        <td>
                            <?php echo $log->getTag() ?>
                        </td>

                        <td class="action">