use nicer chagne printing

This commit is contained in:
Dennis Eichhorn 2019-04-22 16:34:20 +02:00
parent d170b5b8fe
commit 7440a2d57a
2 changed files with 10 additions and 8 deletions

View File

@ -59,7 +59,7 @@ final class ApiController extends Controller
string $content = null string $content = null
) : void ) : void
{ {
$newString = StringUtils::stringify($new); $newString = StringUtils::stringify($new, \JSON_PRETTY_PRINT);
$audit = new Audit($account, null, $newString, $type, $subtype, $module, $ref, $content); $audit = new Audit($account, null, $newString, $type, $subtype, $module, $ref, $content);
AuditMapper::create($audit); AuditMapper::create($audit);
@ -94,8 +94,8 @@ final class ApiController extends Controller
string $content = null string $content = null
) : void ) : void
{ {
$oldString = StringUtils::stringify($old); $oldString = StringUtils::stringify($old, \JSON_PRETTY_PRINT);
$newString = StringUtils::stringify($new); $newString = StringUtils::stringify($new, \JSON_PRETTY_PRINT);
$audit = new Audit($account, $oldString, $newString, $type, $subtype, $module, $ref, $content); $audit = new Audit($account, $oldString, $newString, $type, $subtype, $module, $ref, $content);
AuditMapper::create($audit); AuditMapper::create($audit);
@ -130,7 +130,7 @@ final class ApiController extends Controller
string $content = null string $content = null
) : void ) : void
{ {
$oldString = StringUtils::stringify($old); $oldString = StringUtils::stringify($old, \JSON_PRETTY_PRINT);
$audit = new Audit($account, $oldString, null, $type, $subtype, $module, $ref, $content); $audit = new Audit($account, $oldString, null, $type, $subtype, $module, $ref, $content);
AuditMapper::create($audit); AuditMapper::create($audit);

View File

@ -21,10 +21,12 @@ echo $this->getData('nav')->render();
<div class="col-xs-12"> <div class="col-xs-12">
<section class="box wf-100"> <section class="box wf-100">
<article> <article>
<?= \phpOMS\Utils\StringUtils::createDiffMarkup( <pre><?= \phpOMS\Utils\StringUtils::createDiffMarkup(
\phpOMS\Views\ViewAbstract::html($this->getData('audit')->getOld() ?? ''), \phpOMS\Views\ViewAbstract::html($this->getData('audit')->getOld() ?? ''),
\phpOMS\Views\ViewAbstract::html($this->getData('audit')->getNew() ?? '') \phpOMS\Views\ViewAbstract::html($this->getData('audit')->getNew() ?? ''),
); ?> "\n"
); ?>
</pre>
</article> </article>
</section> </section>
</div> </div>