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
{
public const PROFILE = 1;
public const PROFILE_SETTINGS = 2;
}

View File

@ -1,17 +1,17 @@
<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%);">
<header><h1><?= $this->getHtml('Account/Group', 'Admin') ?></h1></header>
<header><h1><?= $this->getHtml('Account/Group', 'Admin'); ?></h1></header>
<div class="inner">
<div class="tabview tab-2">
<div class="box wf-100">
<ul class="tab-links">
<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-1"><?= $this->getHtml('Account', 'Admin'); ?></label>
<li><label for="c-tab-2"><?= $this->getHtml('Group', 'Admin'); ?></label>
</ul>
</div>
<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">
<label for="iSearchAcc">Search</label>
<input type="text" id="iSearchAcc" name="receiver-search" data-action='[
@ -52,9 +52,9 @@
{"key": 1, "type": "dom.remove", "selector": "#acc-grp", "aniOut": "fadeOut"}
]
}
]'><?= $this->getHtml('Close', 'Admin') ?></button>
]'><?= $this->getHtml('Close', 'Admin'); ?></button>
</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">
<label for="iSearchGrp">Search</label>
<input type="text" id="iSearchGrp" name="receiver-search" data-action='[
@ -82,7 +82,7 @@
{"key": 1, "type": "dom.remove", "selector": "#acc-grp", "aniOut": "fadeOut"}
]
}
]'><?= $this->getHtml('Close', 'Admin') ?></button>
]'><?= $this->getHtml('Close', 'Admin'); ?></button>
</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}'); ?>">
<table class="layout wf-100" style="table-layout: fixed">
<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><input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
</table>

View File

@ -27,13 +27,13 @@ $next = empty($accounts) ? '{/prefix}profile/list' : '{/prefix}profile/list?
<div class="row">
<div class="col-xs-12">
<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">
<thead>
<tr>
<td>
<td class="wf-100"><?= $this->getHtml('Name') ?>
<td><?= $this->getHtml('Activity') ?>
<td class="wf-100"><?= $this->getHtml('Name'); ?>
<td><?= $this->getHtml('Activity'); ?>
<tbody>
<?php $count = 0; foreach ($accounts as $key => $account) : ++$count;
$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 ?
UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) .'.png') :
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('Activity') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($account->getAccount()->getLastActive()->format('Y-m-d')); ?></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>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>

View File

@ -50,7 +50,7 @@ echo $this->getData('nav')->render();
</ul>
</div>
<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="row">
<div class="col-xs-12 col-md-6">
@ -80,7 +80,7 @@ echo $this->getData('nav')->render();
{"key": 1, "type": "event.prevent"},
{"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='[
{"listener": "change", "key": 1, "action": [
{"key": 1, "type": "form.submit", "selector": "#iProfileUploadForm"}
@ -90,13 +90,13 @@ echo $this->getData('nav')->render();
</span>
<table class="list" style="table-layout: fixed">
<tr>
<th><?= $this->getHtml('Birthday') ?>
<th><?= $this->getHtml('Birthday'); ?>
<td itemprop="birthDate" itemprop="foundingDate"><?= $this->getDateTime($profile->getBirthday()); ?>
<tr>
<th><?= $this->getHtml('Email') ?>
<th><?= $this->getHtml('Email'); ?>
<td itemprop="email"><a href="mailto:>donald.duck@email.com<"><?= $this->printHtml($account->getEmail()); ?></a>
<tr>
<th><?= $this->getHtml('Address') ?>
<th><?= $this->getHtml('Address'); ?>
<td>
<?php
$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
<?php endforeach; ?>
<tr>
<th><?= $this->getHtml('Contact') ?>
<th><?= $this->getHtml('Contact'); ?>
<td>
<?php
$contacts = $profile->getContactElements();
@ -128,25 +128,25 @@ echo $this->getData('nav')->render();
<td itemprop="telephone">+01 12345-4567
<?php endforeach; ?>
<tr>
<th><?= $this->getHtml('Registered') ?>
<th><?= $this->getHtml('Registered'); ?>
<td><?= $this->printHtml($account->getCreatedAt()->format('Y-m-d')); ?>
<tr>
<th><?= $this->getHtml('LastLogin') ?>
<th><?= $this->getHtml('LastLogin'); ?>
<td><?= $this->printHtml($account->getLastActive()->format('Y-m-d')); ?>
<tr>
<th><?= $this->getHtml('Status') ?>
<th><?= $this->getHtml('Status'); ?>
<td><span class="tag green"><?= $this->getHtml(':s' . $account->getStatus(), 'Admin'); ?></span>
</table>
</div>
<?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; ?>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Visibility') ?></div>
<div class="portlet-head"><?= $this->getHtml('Visibility'); ?></div>
<div class="portlet-body">
<p>Define which users and user groups can see your profile</p>
<?= $this->getData('accGrpSelector')->render('iVisibility', 'visibility', true); ?>
@ -166,7 +166,7 @@ echo $this->getData('nav')->render();
</div>
</div>
<?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="row">
<div class="col-xs-12 col-md-4">
@ -186,7 +186,7 @@ echo $this->getData('nav')->render();
<?php endforeach; ?>
</select>
</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>
<tr><td colspan="2"><label for="iCountries"><?= $this->getHtml('Country'); ?></label>
<tr><td colspan="2">

View File

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

View File

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