mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-02-11 18:38:41 +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);
|
||||
$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);
|
||||
$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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,11 +59,14 @@ class Group extends \phpOMS\Account\Group
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $name Group name
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct(string $name = '')
|
||||
{
|
||||
$this->createdAt = new \DateTime();
|
||||
$this->setName($name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://website.orange-management.de
|
||||
*/
|
||||
use Modules\Organization\Models\UnitMapper;
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
|
|
@ -50,7 +51,11 @@ $temperatures = \phpOMS\Utils\Converter\TemperatureType::getConstants();
|
|||
<table class="layout wf-100">
|
||||
<tbody>
|
||||
<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'); ?>">
|
||||
</table>
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user