autofixes

This commit is contained in:
Dennis Eichhorn 2020-08-30 20:13:11 +02:00
parent 35b0bccd94
commit 0a76ed3678
7 changed files with 29 additions and 26 deletions

View File

@ -27,5 +27,6 @@ use phpOMS\Stdlib\Base\Enum;
abstract class PermissionState extends Enum abstract class PermissionState extends Enum
{ {
public const PROFILE = 1; public const PROFILE = 1;
public const PROFILE_SETTINGS = 2; public const PROFILE_SETTINGS = 2;
} }

View File

@ -1,17 +1,17 @@
<template id="acc-grp-tpl"> <template id="acc-grp-tpl">
<section id="acc-grp" class="box w-50" style="z-index: 9; position: absolute; margin: 0 auto; left: 50%; top: 50%; transform: translate(-50%, -50%);"> <section id="acc-grp" class="box w-50" style="z-index: 9; position: absolute; margin: 0 auto; left: 50%; top: 50%; transform: translate(-50%, -50%);">
<header><h1><?= $this->getHtml('Account/Group', 'Admin') ?></h1></header> <header><h1><?= $this->getHtml('Account/Group', 'Admin'); ?></h1></header>
<div class="inner"> <div class="inner">
<div class="tabview tab-2"> <div class="tabview tab-2">
<div class="box wf-100"> <div class="box wf-100">
<ul class="tab-links"> <ul class="tab-links">
<li><label for="c-tab-1"><?= $this->getHtml('Account', 'Admin') ?></label> <li><label for="c-tab-1"><?= $this->getHtml('Account', 'Admin'); ?></label>
<li><label for="c-tab-2"><?= $this->getHtml('Group', 'Admin') ?></label> <li><label for="c-tab-2"><?= $this->getHtml('Group', 'Admin'); ?></label>
</ul> </ul>
</div> </div>
<div class="tab-content"> <div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : '' ?>> <input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<label for="iSearchAcc">Search</label> <label for="iSearchAcc">Search</label>
<input type="text" id="iSearchAcc" name="receiver-search" data-action='[ <input type="text" id="iSearchAcc" name="receiver-search" data-action='[
@ -52,9 +52,9 @@
{"key": 1, "type": "dom.remove", "selector": "#acc-grp", "aniOut": "fadeOut"} {"key": 1, "type": "dom.remove", "selector": "#acc-grp", "aniOut": "fadeOut"}
] ]
} }
]'><?= $this->getHtml('Close', 'Admin') ?></button> ]'><?= $this->getHtml('Close', 'Admin'); ?></button>
</div> </div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : '' ?>> <input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<label for="iSearchGrp">Search</label> <label for="iSearchGrp">Search</label>
<input type="text" id="iSearchGrp" name="receiver-search" data-action='[ <input type="text" id="iSearchGrp" name="receiver-search" data-action='[
@ -82,7 +82,7 @@
{"key": 1, "type": "dom.remove", "selector": "#acc-grp", "aniOut": "fadeOut"} {"key": 1, "type": "dom.remove", "selector": "#acc-grp", "aniOut": "fadeOut"}
] ]
} }
]'><?= $this->getHtml('Close', 'Admin') ?></button> ]'><?= $this->getHtml('Close', 'Admin'); ?></button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -12,7 +12,7 @@ echo $this->getData('nav')->render();
<form id="fProfileCreate" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}profile?{?}&csrf={$CSRF}'); ?>"> <form id="fProfileCreate" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}profile?{?}&csrf={$CSRF}'); ?>">
<table class="layout wf-100" style="table-layout: fixed"> <table class="layout wf-100" style="table-layout: fixed">
<tbody> <tbody>
<tr><td><label for="iAccount"><?= $this->getHtml('Account') ?></label> <tr><td><label for="iAccount"><?= $this->getHtml('Account'); ?></label>
<tr><td><?= $this->getData('accGrpSelector')->render('iAccount', true); ?> <tr><td><?= $this->getData('accGrpSelector')->render('iAccount', true); ?>
<tr><td><input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>"> <tr><td><input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
</table> </table>

View File

@ -27,13 +27,13 @@ $next = empty($accounts) ? '{/prefix}profile/list' : '{/prefix}profile/list?
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="portlet"> <div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Profiles') ?><i class="fa fa-download floatRight download btn"></i></div> <div class="portlet-head"><?= $this->getHtml('Profiles'); ?><i class="fa fa-download floatRight download btn"></i></div>
<table id="profileList" class="default"> <table id="profileList" class="default">
<thead> <thead>
<tr> <tr>
<td> <td>
<td class="wf-100"><?= $this->getHtml('Name') ?> <td class="wf-100"><?= $this->getHtml('Name'); ?>
<td><?= $this->getHtml('Activity') ?> <td><?= $this->getHtml('Activity'); ?>
<tbody> <tbody>
<?php $count = 0; foreach ($accounts as $key => $account) : ++$count; <?php $count = 0; foreach ($accounts as $key => $account) : ++$count;
$url = UriFactory::build('{/prefix}profile/single?{?}&id=' . $account->getId()); ?> $url = UriFactory::build('{/prefix}profile/single?{?}&id=' . $account->getId()); ?>
@ -43,8 +43,8 @@ $next = empty($accounts) ? '{/prefix}profile/list' : '{/prefix}profile/list?
$account->getImage() instanceof NullMedia ? $account->getImage() instanceof NullMedia ?
UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) .'.png') : UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) .'.png') :
UriFactory::build('{/prefix}' . $account->getImage()->getPath()); ?>"></a> UriFactory::build('{/prefix}' . $account->getImage()->getPath()); ?>"></a>
<td data-label="<?= $this->getHtml('Name') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($account->getAccount()->getName3() . ' ' . $account->getAccount()->getName2() . ' ' . $account->getAccount()->getName1()); ?></a> <td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($account->getAccount()->getName3() . ' ' . $account->getAccount()->getName2() . ' ' . $account->getAccount()->getName1()); ?></a>
<td data-label="<?= $this->getHtml('Activity') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($account->getAccount()->getLastActive()->format('Y-m-d')); ?></a> <td data-label="<?= $this->getHtml('Activity'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($account->getAccount()->getLastActive()->format('Y-m-d')); ?></a>
<?php endforeach; ?> <?php endforeach; ?>
<?php if ($count === 0) : ?> <?php if ($count === 0) : ?>
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?> <tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>

View File

@ -50,7 +50,7 @@ echo $this->getData('nav')->render();
</ul> </ul>
</div> </div>
<div class="tab-content"> <div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : '' ?>> <input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-6">
@ -80,7 +80,7 @@ echo $this->getData('nav')->render();
{"key": 1, "type": "event.prevent"}, {"key": 1, "type": "event.prevent"},
{"key": 2, "type": "dom.click", "selector": "#iProfileUpload"} {"key": 2, "type": "dom.click", "selector": "#iProfileUpload"}
] ]
}]'><?= $this->getHtml('Change') ?></a> }]'><?= $this->getHtml('Change'); ?></a>
<form id="iProfileUploadForm" action="<?= UriFactory::build('{/api}profile/settings/image'); ?>" method="post"><input class="preview" data-action='[ <form id="iProfileUploadForm" action="<?= UriFactory::build('{/api}profile/settings/image'); ?>" method="post"><input class="preview" data-action='[
{"listener": "change", "key": 1, "action": [ {"listener": "change", "key": 1, "action": [
{"key": 1, "type": "form.submit", "selector": "#iProfileUploadForm"} {"key": 1, "type": "form.submit", "selector": "#iProfileUploadForm"}
@ -90,13 +90,13 @@ echo $this->getData('nav')->render();
</span> </span>
<table class="list" style="table-layout: fixed"> <table class="list" style="table-layout: fixed">
<tr> <tr>
<th><?= $this->getHtml('Birthday') ?> <th><?= $this->getHtml('Birthday'); ?>
<td itemprop="birthDate" itemprop="foundingDate"><?= $this->getDateTime($profile->getBirthday()); ?> <td itemprop="birthDate" itemprop="foundingDate"><?= $this->getDateTime($profile->getBirthday()); ?>
<tr> <tr>
<th><?= $this->getHtml('Email') ?> <th><?= $this->getHtml('Email'); ?>
<td itemprop="email"><a href="mailto:>donald.duck@email.com<"><?= $this->printHtml($account->getEmail()); ?></a> <td itemprop="email"><a href="mailto:>donald.duck@email.com<"><?= $this->printHtml($account->getEmail()); ?></a>
<tr> <tr>
<th><?= $this->getHtml('Address') ?> <th><?= $this->getHtml('Address'); ?>
<td> <td>
<?php <?php
$locations = $profile->getLocation(); $locations = $profile->getLocation();
@ -112,7 +112,7 @@ echo $this->getData('nav')->render();
<td itemprop="address">SMALLSYS INC<br>795 E DRAGRAM<br>TUCSON AZ 85705<br>USA <td itemprop="address">SMALLSYS INC<br>795 E DRAGRAM<br>TUCSON AZ 85705<br>USA
<?php endforeach; ?> <?php endforeach; ?>
<tr> <tr>
<th><?= $this->getHtml('Contact') ?> <th><?= $this->getHtml('Contact'); ?>
<td> <td>
<?php <?php
$contacts = $profile->getContactElements(); $contacts = $profile->getContactElements();
@ -128,25 +128,25 @@ echo $this->getData('nav')->render();
<td itemprop="telephone">+01 12345-4567 <td itemprop="telephone">+01 12345-4567
<?php endforeach; ?> <?php endforeach; ?>
<tr> <tr>
<th><?= $this->getHtml('Registered') ?> <th><?= $this->getHtml('Registered'); ?>
<td><?= $this->printHtml($account->getCreatedAt()->format('Y-m-d')); ?> <td><?= $this->printHtml($account->getCreatedAt()->format('Y-m-d')); ?>
<tr> <tr>
<th><?= $this->getHtml('LastLogin') ?> <th><?= $this->getHtml('LastLogin'); ?>
<td><?= $this->printHtml($account->getLastActive()->format('Y-m-d')); ?> <td><?= $this->printHtml($account->getLastActive()->format('Y-m-d')); ?>
<tr> <tr>
<th><?= $this->getHtml('Status') ?> <th><?= $this->getHtml('Status'); ?>
<td><span class="tag green"><?= $this->getHtml(':s' . $account->getStatus(), 'Admin'); ?></span> <td><span class="tag green"><?= $this->getHtml(':s' . $account->getStatus(), 'Admin'); ?></span>
</table> </table>
</div> </div>
<?php if ($this->request->getHeader()->getAccount() === $account->getId()) : ?> <?php if ($this->request->getHeader()->getAccount() === $account->getId()) : ?>
<div class="portlet-foot"><button class="update"><?= $this->getHtml('Edit', '0', '0') ?></button></div> <div class="portlet-foot"><button class="update"><?= $this->getHtml('Edit', '0', '0'); ?></button></div>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-6">
<div class="portlet"> <div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Visibility') ?></div> <div class="portlet-head"><?= $this->getHtml('Visibility'); ?></div>
<div class="portlet-body"> <div class="portlet-body">
<p>Define which users and user groups can see your profile</p> <p>Define which users and user groups can see your profile</p>
<?= $this->getData('accGrpSelector')->render('iVisibility', 'visibility', true); ?> <?= $this->getData('accGrpSelector')->render('iVisibility', 'visibility', true); ?>
@ -166,7 +166,7 @@ echo $this->getData('nav')->render();
</div> </div>
</div> </div>
<?php if ($this->request->getHeader()->getAccount() === $account->getId()) : ?> <?php if ($this->request->getHeader()->getAccount() === $account->getId()) : ?>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : '' ?>> <input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-4"> <div class="col-xs-12 col-md-4">
@ -186,7 +186,7 @@ echo $this->getData('nav')->render();
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</div> </div>
<div class="ipt-second"><input type="submit" name="loadDefaultLocalization" formaction="<?= UriFactory::build('{/api}profile/settings/localization?load=1'); ?>" value="<?= $this->getHtml('Load') ?>"></div> <div class="ipt-second"><input type="submit" name="loadDefaultLocalization" formaction="<?= UriFactory::build('{/api}profile/settings/localization?load=1'); ?>" value="<?= $this->getHtml('Load'); ?>"></div>
</div> </div>
<tr><td colspan="2"><label for="iCountries"><?= $this->getHtml('Country'); ?></label> <tr><td colspan="2"><label for="iCountries"><?= $this->getHtml('Country'); ?></label>
<tr><td colspan="2"> <tr><td colspan="2">

View File

@ -20,6 +20,7 @@ namespace Modules\Profile\tests\Admin;
class AdminTest extends \PHPUnit\Framework\TestCase class AdminTest extends \PHPUnit\Framework\TestCase
{ {
protected const MODULE_NAME = 'Profile'; protected const MODULE_NAME = 'Profile';
protected const URI_LOAD = 'http://127.0.0.1/en/backend/profile'; protected const URI_LOAD = 'http://127.0.0.1/en/backend/profile';
use \Modules\tests\ModuleTestTrait; use \Modules\tests\ModuleTestTrait;

View File

@ -35,6 +35,7 @@ use phpOMS\Utils\TestUtils;
class ControllerTest extends \PHPUnit\Framework\TestCase class ControllerTest extends \PHPUnit\Framework\TestCase
{ {
protected $app = null; protected $app = null;
protected $module = null; protected $module = null;
protected function setUp() : void protected function setUp() : void