mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-02-18 13:18:43 +00:00
Fix bugs during demo app set up
This commit is contained in:
parent
6ef5eb3a3e
commit
52305da056
|
|
@ -107,10 +107,24 @@ final class AccountMapper extends DataMapperAbstract
|
||||||
{
|
{
|
||||||
$account = self::get($id);
|
$account = self::get($id);
|
||||||
$groupPermissions = GroupPermissionMapper::getFor(\array_keys($account->getGroups()), 'group', RelationType::ALL, null, 2);
|
$groupPermissions = GroupPermissionMapper::getFor(\array_keys($account->getGroups()), 'group', RelationType::ALL, null, 2);
|
||||||
$account->addPermissions(\is_array($groupPermissions) ? $groupPermissions : [$groupPermissions]);
|
|
||||||
|
if (\is_array($groupPermissions)) {
|
||||||
|
foreach ($groupPermissions as $permission) {
|
||||||
|
$account->addPermissions(\is_array($permission) ? $permission : [$permission]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$account->addPermissions([$groupPermissions]);
|
||||||
|
}
|
||||||
|
|
||||||
$accountPermissions = AccountPermissionMapper::getFor($id, 'account', RelationType::ALL, null, 2);
|
$accountPermissions = AccountPermissionMapper::getFor($id, 'account', RelationType::ALL, null, 2);
|
||||||
$account->addPermissions(\is_array($accountPermissions) ? $accountPermissions : [$accountPermissions]);
|
|
||||||
|
if (\is_array($accountPermissions)) {
|
||||||
|
foreach ($accountPermissions as $permission) {
|
||||||
|
$account->addPermissions(\is_array($permission) ? $permission : [$permission]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$account->addPermissions([$accountPermissions]);
|
||||||
|
}
|
||||||
|
|
||||||
return $account;
|
return $account;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,11 +59,14 @@ class Group extends \phpOMS\Account\Group
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
|
* @param string $name Group name
|
||||||
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct(string $name = '')
|
||||||
{
|
{
|
||||||
$this->createdAt = new \DateTime();
|
$this->createdAt = new \DateTime();
|
||||||
|
$this->setName($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @link http://website.orange-management.de
|
* @link http://website.orange-management.de
|
||||||
*/
|
*/
|
||||||
|
use Modules\Organization\Models\UnitMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \phpOMS\Views\View $this
|
* @var \phpOMS\Views\View $this
|
||||||
|
|
@ -50,7 +51,11 @@ $temperatures = \phpOMS\Utils\Converter\TemperatureType::getConstants();
|
||||||
<table class="layout wf-100">
|
<table class="layout wf-100">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td><label for="iOname"><?= $this->getHtml('OrganizationName'); ?></label>
|
<tr><td><label for="iOname"><?= $this->getHtml('OrganizationName'); ?></label>
|
||||||
<tr><td><input id="iOname" name="settings_1000000009" type="text" value="<?= $this->printHtml($settings[1000000009]); ?>" placeholder=" Money Bin" required>
|
<tr><td>
|
||||||
|
<select id="iOname" name="settings_1000000009">
|
||||||
|
<?php $unit = UnitMapper::get((int) $settings[1000000009]); ?>
|
||||||
|
<option value="<?= $this->printHtml($unit->getId()); ?>"><?= $this->printHtml($unit->getName()); ?>
|
||||||
|
</select>
|
||||||
<tr><td><input id="iSubmitGeneral" name="submitGeneral" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
|
<tr><td><input id="iSubmitGeneral" name="submitGeneral" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user