mirror of
https://github.com/Karaka-Management/oms-QA.git
synced 2026-02-09 12:38:41 +00:00
QA badges lists
This commit is contained in:
parent
bd2351dc28
commit
b68aa42f1d
|
|
@ -42,6 +42,21 @@
|
|||
"permission": null,
|
||||
"parent": 1006001001,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"id": 1006004001,
|
||||
"pid": "c3ebc146eec492fbcf5ed5d9d43ca6d0cc253583",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Badges",
|
||||
"uri": "{/base}/{/lang}/backend/qa/badge/list?{?}",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 10,
|
||||
"from": "QA",
|
||||
"permission": null,
|
||||
"parent": 1006001001,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,9 +15,15 @@ return [
|
|||
'verb' => RouteVerb::GET,
|
||||
],
|
||||
],
|
||||
'^.*/backend/qa/category.*$' => [
|
||||
'^.*/backend/qa/badge/list.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\QA\Controller:viewQACategory',
|
||||
'dest' => '\Modules\QA\Controller:viewQABadgeList',
|
||||
'verb' => RouteVerb::GET,
|
||||
],
|
||||
],
|
||||
'^.*/backend/qa/badge/single.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\QA\Controller:viewQABadgeEdit',
|
||||
'verb' => RouteVerb::GET,
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ use phpOMS\Views\View;
|
|||
use phpOMS\Asset\AssetType;
|
||||
|
||||
use Modules\QA\Models\QAQuestionMapper;
|
||||
use Modules\QA\Models\QABadgeMapper;
|
||||
|
||||
/**
|
||||
* Task class.
|
||||
|
|
@ -108,6 +109,50 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return \Serializable
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function viewQABadgeList(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/QA/Theme/Backend/qa-tag-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006001001, $request, $response));
|
||||
|
||||
$list = QABadgeMapper::getAll();
|
||||
$view->setData('tags', $list);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return \Serializable
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function viewQABadgeEdit(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/QA/Theme/Backend/qa-tag-edit');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006001001, $request, $response));
|
||||
|
||||
$tag = QABadgeMapper::get((int) $request->getData('id'));
|
||||
$view->setData('tag', $tag);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
public function viewQADoc(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
|
|
|
|||
|
|
@ -15,4 +15,5 @@
|
|||
*/
|
||||
return ['Navigation' => [
|
||||
'QA' => 'QA',
|
||||
'Badges' => 'Badges',
|
||||
]];
|
||||
|
|
|
|||
29
Theme/Backend/qa-tag-edit.tpl.php
Normal file
29
Theme/Backend/qa-tag-edit.tpl.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
|
||||
$tag = $this->getData('tag');
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
echo $this->getData('nav')->render();
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
49
Theme/Backend/qa-tag-list.tpl.php
Normal file
49
Theme/Backend/qa-tag-list.tpl.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
|
||||
$tags = $this->getData('tags');
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
echo $this->getData('nav')->render();
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box wf-100">
|
||||
<table class="table red">
|
||||
<caption><?= $this->getText('Groups'); ?></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getText('ID', 0, 0); ?>
|
||||
<td class="wf-100"><?= $this->getText('Name'); ?>
|
||||
<tfoot>
|
||||
<tr><td colspan="2">
|
||||
<tbody>
|
||||
<?php $c = 0; foreach ($this->getData('tags') as $key => $value) : $c++;
|
||||
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/admin/account/settings?{?}&id=' . $value->getId()); ?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if($c === 0) : ?>
|
||||
<tr><td colspan="2" class="empty"><?= $this->getText('Empty', 0, 0); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user