mirror of
https://github.com/Karaka-Management/oms-Organization.git
synced 2026-01-25 06:18:41 +00:00
l11n, unit/app and simplification fixes
This commit is contained in:
parent
ce530f6d9b
commit
67424ec6cf
|
|
@ -19,9 +19,7 @@
|
|||
"name": "organization_unit_image",
|
||||
"type": "INT",
|
||||
"default": null,
|
||||
"null": true,
|
||||
"foreignTable": "media",
|
||||
"foreignKey": "media_id"
|
||||
"null": true
|
||||
},
|
||||
"organization_unit_description": {
|
||||
"name": "organization_unit_description",
|
||||
|
|
|
|||
|
|
@ -56,7 +56,10 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/Organization/Theme/Backend/unit-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004703001, $request, $response));
|
||||
|
||||
$mapper = UnitMapper::getAll()->with('parent')->with('image')->limit(25);
|
||||
$mapper = UnitMapper::getAll()
|
||||
->with('parent')
|
||||
->with('image')
|
||||
->limit(25);
|
||||
|
||||
if ($request->getData('ptype') === 'p') {
|
||||
$view->setData('units', $mapper->where('id', (int) ($request->getData('id') ?? 0), '<')->execute());
|
||||
|
|
@ -90,7 +93,14 @@ final class BackendController extends Controller
|
|||
|
||||
$selectorView = new \Modules\Organization\Theme\Backend\Components\UnitTagSelector\UnitTagSelectorView($this->app->l11nManager, $request, $response);
|
||||
$view->addData('unit-selector', $selectorView);
|
||||
$view->addData('unit', UnitMapper::get()->with('parent')->with('image')->where('id', (int) $request->getData('id'))->execute());
|
||||
|
||||
$unit = UnitMapper::get()
|
||||
->with('parent')
|
||||
->with('image')
|
||||
->where('id', (int) $request->getData('id'))
|
||||
->execute();
|
||||
|
||||
$view->addData('unit', $unit);
|
||||
|
||||
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->addData('editor', $editor);
|
||||
|
|
|
|||
BIN
Theme/Backend/img/org_default.png
Normal file
BIN
Theme/Backend/img/org_default.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
|
|
@ -28,7 +28,8 @@ echo $this->getData('nav')->render(); ?>
|
|||
<tr><td><label for="iName"><?= $this->getHtml('Name'); ?></label>
|
||||
<tr><td><input type="text" name="name" id="iName" placeholder=" Karaka" required>
|
||||
<tr><td><label for="iParent"><?= $this->getHtml('UnitLogo'); ?></label>
|
||||
<tr><td><img id="preview-logo" class="preview" src="#" accept="image/*" alt="<?= $this->getHtml('UnitLogo'); ?>">
|
||||
<tr><td><img id="preview-logo" alt="<?= $this->getHtml('Logo'); ?>"
|
||||
itemprop="logo" loading="lazy" width="40x" class="preview" src="<?= UriFactory::build('Modules/Organization/Theme/Backend/img/org_default.png'); ?>" accept="image/*">
|
||||
<tr><td><?= $this->getData('media-preview-upload')->render('fUnitCreate', 'logo', '/Modules/Organization'); ?>
|
||||
<tr><td><label for="iParent"><?= $this->getHtml('Parent'); ?></label>
|
||||
<tr><td><?= $this->getData('unit-selector')->render('iParent', 'parent', false); ?>
|
||||
|
|
|
|||
|
|
@ -88,8 +88,8 @@ echo $this->getData('nav')->render(); ?>
|
|||
<tr tabindex="0" data-href="<?= $url; ?>">
|
||||
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><img alt="<?= $this->getHtml('IMG_alt_profile'); ?>" class="profile-image" src="<?= $value->image instanceof NullMedia ?
|
||||
UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) .'.png') :
|
||||
UriFactory::build('{/lang}/{/app}/' . $value->image->getPath()); ?>"></a>
|
||||
UriFactory::build('Modules/Organization/Theme/Backend/img/org_default.png') :
|
||||
UriFactory::build($value->image->getPath()); ?>"></a>
|
||||
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
|
||||
<td data-label="<?= $this->getHtml('Parent'); ?>"><a class="content" href="<?= UriFactory::build('{/lang}/{/app}/organization/unit/profile?{?}&id=' . $value->parent->getId()); ?>"><?= $this->printHtml($value->parent->name); ?></a>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ echo $this->getData('nav')->render(); ?>
|
|||
itemprop="logo" loading="lazy"
|
||||
src="<?=
|
||||
$unit->image instanceof NullMedia ?
|
||||
UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) .'.png') :
|
||||
UriFactory::build('{/lang}/{/app}/' . $unit->image->getPath()); ?>"
|
||||
UriFactory::build('Modules/Organization/Theme/Backend/img/org_default.png') :
|
||||
UriFactory::build($unit->image->getPath()); ?>"
|
||||
width="40x">
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user