make id public, organigram impl. media password/encryption, settings bug fix, Money->FloatInt change, ...

This commit is contained in:
Dennis Eichhorn 2023-05-06 11:42:06 +00:00
parent 759c447931
commit 555b7cbf89
11 changed files with 36 additions and 34 deletions

View File

@ -134,7 +134,7 @@ final class BackendController extends Controller
/** @var \phpOMS\Localization\BaseStringL11n[] $l11n */
$l11n = TagL11nMapper::getAll()
->where('ref', $tag->getId())
->where('ref', $tag->id)
->execute();
$view->addData('l11n', $l11n);

View File

@ -34,7 +34,7 @@ class Tag implements \JsonSerializable
* @var int
* @since 1.0.0
*/
protected int $id = 0;
public int $id = 0;
/**
* Title.
@ -74,7 +74,7 @@ class Tag implements \JsonSerializable
* @var int
* @since 1.0.0
*/
protected int $type = TagType::SINGLE;
public int $type = TagType::SINGLE;
/**
* Get type.

View File

@ -44,7 +44,7 @@ class BaseView extends View
* @var bool
* @since 1.0.0
*/
private bool $isRequired = false;
public bool $isRequired = false;
/**
* Dom form

View File

@ -1,10 +1,10 @@
<div class="ipt-wrap wf-100">
<div class="ipt-first">
<span class="input">
<button type="button" id="<?= $this->getId(); ?>-book-button" data-action='[
<button type="button" id="<?= $this->id; ?>-book-button" data-action='[
{
"key": 1, "listener": "click", "action": [
{"key": 1, "type": "dom.popup", "selector": "#acc-grp-tpl", "aniIn": "fadeIn", "id": "<?= $this->getId(); ?>"},
{"key": 1, "type": "dom.popup", "selector": "#acc-grp-tpl", "aniIn": "fadeIn", "id": "<?= $this->id; ?>"},
{"key": 2, "type": "message.request", "uri": "<?= \phpOMS\Uri\UriFactory::build('tag?filter=some&limit=10'); ?>", "method": "GET", "request_type": "json"},
{"key": 3, "type": "dom.table.append", "id": "acc-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "title"}, "position": -1},
{"key": 4, "type": "message.request", "uri": "<?= \phpOMS\Uri\UriFactory::build('tag?filter=some&limit=10'); ?>", "method": "GET", "request_type": "json"},
@ -12,20 +12,20 @@
]
}
]' formaction=""><i class="fa fa-book"></i></button>
<div class="advancedInput wf-100" id="<?= $this->getId(); ?>">
<input autocomplete="off" class="input" type="text" id="i<?= $this->getId(); ?>"
<div class="advancedInput wf-100" id="<?= $this->id; ?>">
<input autocomplete="off" class="input" type="text" id="i<?= $this->id; ?>"
placeholder="&#xf007; Guest"
data-emptyAfter="true"
data-autocomplete="off"
data-src="api/tag/find?search={!#i<?= $this->getId(); ?>}">
<div id="<?= $this->getId(); ?>-popup" class="popup" data-active="true">
data-src="api/tag/find?search={!#i<?= $this->id; ?>}">
<div id="<?= $this->id; ?>-popup" class="popup" data-active="true">
<table class="default">
<thead>
<tr>
<td>ID<i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<td>Title<i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
<tbody>
<template id="<?= $this->getId(); ?>-rowElement" class="rowTemplate">
<template id="<?= $this->id; ?>-rowElement" class="rowTemplate">
<tr tabindex="-1">
<td data-tpl-text="/id" data-tpl-value="/id" data-value=""></td>
<td data-tpl-text="/title" data-tpl-value="/title" data-value=""></td>
@ -39,8 +39,8 @@
</div>
<div class="ipt-second"><button><?= $this->getHtml('Select', '0', '0'); ?></button></div>
</div>
<div class="box" data-form="<?= $this->printHtml($this->getForm()); ?>" id="<?= $this->getId(); ?>-tags" data-limit="0" data-active="true">
<template id="<?= $this->getId(); ?>-tagTemplate">
<div class="box" data-form="<?= $this->printHtml($this->getForm()); ?>" id="<?= $this->id; ?>-tags" data-limit="0" data-active="true">
<template id="<?= $this->id; ?>-tagTemplate">
<span class="tag" data-tpl-value="/id" data-value="" data-uuid="" data-name="<?= $this->printHtml($this->name); ?>" style="background: {/color};">
<i class="fa fa-times"></i>
<span data-tpl-text="/id" data-name="id" data-tpl-value="/id" data-value=""></span>

View File

@ -20,8 +20,8 @@ use phpOMS\Uri\UriFactory;
*/
$tags = $this->getData('tags');
$previous = empty($tags) ? '{/base}/tag/list' : '{/base}/tag/list?{?}&id=' . \reset($tags)->getId() . '&ptype=p';
$next = empty($tags) ? '{/base}/tag/list' : '{/base}/tag/list?{?}&id=' . \end($tags)->getId() . '&ptype=n';
$previous = empty($tags) ? '{/base}/tag/list' : '{/base}/tag/list?{?}&id=' . \reset($tags)->id . '&ptype=p';
$next = empty($tags) ? '{/base}/tag/list' : '{/base}/tag/list?{?}&id=' . \end($tags)->id . '&ptype=n';
echo $this->getData('nav')->render(); ?>
<div class="row">
@ -36,7 +36,7 @@ echo $this->getData('nav')->render(); ?>
<td class="wf-100"><?= $this->getHtml('Title'); ?>
<tbody>
<?php $count = 0; foreach ($tags as $key => $value) : ++$count;
$url = UriFactory::build('{/base}/tag/single?{?}&id=' . $value->getId()); ?>
$url = UriFactory::build('{/base}/tag/single?{?}&id=' . $value->id); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Title'); ?>"><a href="<?= $url; ?>"><span class="tag" style="background: <?= $this->printHtml(\substr($value->color, 0, 7)); ?>">&nbsp;&nbsp;&nbsp;<?= $value->icon !== null ? '<i class="' . $this->printHtml($value->icon ?? '') . '"></i>' : '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; ?>&nbsp;</span></a>
<td data-label="<?= $this->getHtml('Title'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n()); ?></a>

View File

@ -36,8 +36,9 @@ echo $this->getData('nav')->render(); ?>
<tr><td><input type="text" name="icon" id="iIcon" placeholder="&#xf040; oms" value="<?= $this->printHtml($tag->icon); ?>">
</table>
</div>
<div class="portlet-foot">
<input type="hidden" name="id" value="<?= $tag->getId(); ?>">
<input type="hidden" name="id" value="<?= $tag->id; ?>">
<input id="iSubmit" name="submit" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
@ -67,4 +68,5 @@ echo $this->getData('nav')->render(); ?>
<?php endif; ?>
</table>
</div>
</div>
</div>

View File

@ -110,9 +110,9 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
$this->module->apiTagCreate($request, $response);
self::assertEquals('ApiTagEN', $response->get('')['response']->getL11n());
self::assertGreaterThan(0, $response->get('')['response']->getId());
self::assertGreaterThan(0, $response->get('')['response']->id);
self::$tagId = $response->get('')['response']->getId();
self::$tagId = $response->get('')['response']->id;
}
/**
@ -146,7 +146,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
$this->module->apiTagL11nCreate($request, $response);
self::assertEquals('ApiTagDE', $response->get('')['response']->content);
self::assertGreaterThan(0, $response->get('')['response']->getId());
self::assertGreaterThan(0, $response->get('')['response']->id);
}
/**
@ -177,7 +177,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
$this->module->apiTagGet($request, $response);
self::assertEquals(self::$tagId, $response->get('')['response']->getId());
self::assertEquals(self::$tagId, $response->get('')['response']->id);
}
/**
@ -196,7 +196,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
$this->module->apiTagUpdate($request, $response);
self::assertEquals('#00ff00ff', $response->get('')['response']->color);
self::assertEquals(self::$tagId, $response->get('')['response']->getId());
self::assertEquals(self::$tagId, $response->get('')['response']->id);
}
/**
@ -214,6 +214,6 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
$this->module->apiTagFind($request, $response);
self::assertEquals('ApiTagEN', $response->get('')[0]->getL11n());
self::assertEquals(self::$tagId, $response->get('')[0]->getId());
self::assertEquals(self::$tagId, $response->get('')[0]->id);
}
}

View File

@ -37,6 +37,6 @@ final class NullTagTest extends \PHPUnit\Framework\TestCase
public function testId() : void
{
$null = new NullTag(2);
self::assertEquals(2, $null->getId());
self::assertEquals(2, $null->id);
}
}

View File

@ -37,8 +37,8 @@ final class TagL11nMapperTest extends \PHPUnit\Framework\TestCase
$tag->setType(TagType::SINGLE);
$id = TagMapper::create()->execute($tag);
self::assertGreaterThan(0, $tag->getId());
self::assertEquals($id, $tag->getId());
self::assertGreaterThan(0, $tag->id);
self::assertEquals($id, $tag->id);
$l11n = new BaseStringL11n();
$l11n->content = 'TestTitle';
@ -46,10 +46,10 @@ final class TagL11nMapperTest extends \PHPUnit\Framework\TestCase
$l11n->ref = $id;
$id = TagL11nMapper::create()->execute($l11n);
self::assertGreaterThan(0, $l11n->getId());
self::assertEquals($id, $l11n->getId());
self::assertGreaterThan(0, $l11n->id);
self::assertEquals($id, $l11n->id);
$l11nR = TagL11nMapper::get()->where('id', $l11n->getId())->execute();
$l11nR = TagL11nMapper::get()->where('id', $l11n->id)->execute();
self::assertEquals($l11n->content, $l11nR->content);
self::assertEquals($l11n->getLanguage(), $l11nR->getLanguage());
}

View File

@ -36,10 +36,10 @@ final class TagMapperTest extends \PHPUnit\Framework\TestCase
$tag->setType(TagType::SINGLE);
$id = TagMapper::create()->execute($tag);
self::assertGreaterThan(0, $tag->getId());
self::assertEquals($id, $tag->getId());
self::assertGreaterThan(0, $tag->id);
self::assertEquals($id, $tag->id);
$tagR = TagMapper::get()->with('title')->where('id', $tag->getId())->where('title/language', ISO639x1Enum::_EN)->execute();
$tagR = TagMapper::get()->with('title')->where('id', $tag->id)->where('title/language', ISO639x1Enum::_EN)->execute();
self::assertEquals($tag->getL11n(), $tagR->getL11n());
self::assertEquals($tag->color, $tagR->color);
self::assertEquals($tag->getType(), $tagR->getType());

View File

@ -40,7 +40,7 @@ final class TagTest extends \PHPUnit\Framework\TestCase
*/
public function testDefault() : void
{
self::assertEquals(0, $this->tag->getId());
self::assertEquals(0, $this->tag->id);
self::assertNull($this->tag->owner);
self::assertEquals(TagType::SINGLE, $this->tag->getType());
self::assertEquals('00000000', $this->tag->color);
@ -70,7 +70,7 @@ final class TagTest extends \PHPUnit\Framework\TestCase
public function testOwnerInputOutput() : void
{
$this->tag->owner = new NullAccount(2);
self::assertEquals(2, $this->tag->owner->getId());
self::assertEquals(2, $this->tag->owner->id);
}
/**