mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
bismeldestichtage gui: removed filters, now just simple tabulator
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
$filterCmptArray = array(
|
||||
'app' => 'core',
|
||||
'datasetName' => 'bismeldestichtag',
|
||||
'query' => '
|
||||
SELECT
|
||||
bmt.meldestichtag_id AS "Id",
|
||||
bmt.meldestichtag AS "Meldestichtag",
|
||||
bmt.studiensemester_kurzbz AS "Studiensemester"
|
||||
FROM
|
||||
bis.tbl_bismeldestichtag bmt
|
||||
ORDER BY
|
||||
meldestichtag DESC, meldestichtag_id DESC
|
||||
',
|
||||
'requiredPermissions' => 'admin'
|
||||
);
|
||||
|
||||
@@ -16,6 +16,7 @@ class Bismeldestichtag extends Auth_Controller
|
||||
array(
|
||||
'index' => 'admin:r',
|
||||
'getStudiensemester' => 'admin:r',
|
||||
'getBismeldestichtage' => 'admin:r',
|
||||
'addBismeldestichtag' => 'admin:rw',
|
||||
'deleteBismeldestichtag' => 'admin:rw'
|
||||
)
|
||||
@@ -75,6 +76,19 @@ class Bismeldestichtag extends Auth_Controller
|
||||
);
|
||||
}
|
||||
|
||||
public function getBismeldestichtage()
|
||||
{
|
||||
$this->BismeldestichtagModel->addSelect('meldestichtag, studiensemester_kurzbz');
|
||||
$this->BismeldestichtagModel->addOrder('meldestichtag', 'DESC');
|
||||
$this->BismeldestichtagModel->addOrder('meldestichtag_id', 'DESC');
|
||||
$this->outputJson($this->BismeldestichtagModel->load());
|
||||
|
||||
//~ if (hasData($bismeldestichtagRes))
|
||||
//~ $this->outputJsonSuccess(getData($bismeldestichtagRes));
|
||||
//~ else
|
||||
//~ $this->outputJsonSuccess(array());
|
||||
}
|
||||
|
||||
public function addBismeldestichtag()
|
||||
{
|
||||
// get request data
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<div id="main">
|
||||
|
||||
<!-- Navigation component -->
|
||||
<core-navigation-cmpt v-bind:add-side-menu-entries="appSideMenuEntries"></core-navigation-cmpt>
|
||||
<core-navigation-cmpt></core-navigation-cmpt>
|
||||
|
||||
<!-- fetch component -->
|
||||
<!-- Fetch component -->
|
||||
<core-fetch-cmpt
|
||||
v-bind:api-function="fetchCmptApiFunction"
|
||||
v-bind:api-function-parameters="fetchCmptApiFunctionParams"
|
||||
@@ -57,10 +57,11 @@
|
||||
<div class="col-12">
|
||||
<core-filter-cmpt
|
||||
title="<?php echo $this->p->t('bismeldestichtag', 'stichtageVerwalten') ?>"
|
||||
filter-type="Bismeldestichtag"
|
||||
ref="bismeldestichtageTable"
|
||||
:side-menu="false"
|
||||
:tabulator-options="bismeldestichtagTabulatorOptions"
|
||||
:tabulator-events="bismeldestichtagTabulatorEventHandlers"
|
||||
@nw-new-entry="newSideMenuEntryHandler">
|
||||
:table-only="true">
|
||||
</core-filter-cmpt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -36,6 +36,15 @@ export const BismeldestichtagAPIs = {
|
||||
}
|
||||
);
|
||||
},
|
||||
getBismeldestichtage: function() {
|
||||
return CoreRESTClient.get(
|
||||
'codex/Bismeldestichtag/getBismeldestichtage',
|
||||
null,
|
||||
{
|
||||
timeout: CORE_BISMELDESTICHTAG_CMPT_TIMEOUT
|
||||
}
|
||||
);
|
||||
},
|
||||
addBismeldestichtag: function(wsParams) {
|
||||
return CoreRESTClient.post(
|
||||
'codex/Bismeldestichtag/addBismeldestichtag',
|
||||
|
||||
@@ -27,7 +27,6 @@ import {BismeldestichtagAPIs} from './API.js';
|
||||
const bismeldestichtagApp = Vue.createApp({
|
||||
data: function() {
|
||||
return {
|
||||
appSideMenuEntries: {},
|
||||
bismeldestichtagTabulatorOptions: BismeldestichtagTabulatorOptions,
|
||||
bismeldestichtagTabulatorEventHandlers: BismeldestichtagTabulatorEventHandlers,
|
||||
meldestichtag: null, // date of Meldestichtag
|
||||
@@ -49,9 +48,6 @@ const bismeldestichtagApp = Vue.createApp({
|
||||
this.handlerStudiensemester();
|
||||
},
|
||||
methods: {
|
||||
newSideMenuEntryHandler: function(payload) {
|
||||
this.appSideMenuEntries = payload;
|
||||
},
|
||||
/**
|
||||
* Define Studiensemester call and method to be executed after the call
|
||||
*/
|
||||
@@ -62,6 +58,16 @@ const bismeldestichtagApp = Vue.createApp({
|
||||
this.fetchCmptDataFetchedStudiensemester
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Define Studiensemester call and method to be executed after the call
|
||||
*/
|
||||
handlerBismeldestichtage: function() {
|
||||
this.startFetchCmpt(
|
||||
BismeldestichtagAPIs.getBismeldestichtage,
|
||||
null,
|
||||
this.fetchCmptDataFetchedBismeldestichtage
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Define add Bismeldestichtag call and method to be executed after the call
|
||||
*/
|
||||
@@ -98,6 +104,21 @@ const bismeldestichtagApp = Vue.createApp({
|
||||
let semRes = CoreRESTClient.getData(data);
|
||||
this.semList = semRes.semList;
|
||||
this.currSem = semRes.currSem;
|
||||
this.handlerBismeldestichtage();
|
||||
}
|
||||
else
|
||||
alert("No response data");
|
||||
},
|
||||
/**
|
||||
* Called after Bismeldestichtage response is received
|
||||
*/
|
||||
fetchCmptDataFetchedBismeldestichtage: function(data) {
|
||||
console.log(data);
|
||||
if (CoreRESTClient.isError(data)) alert(CoreRESTClient.getError(data));
|
||||
if (CoreRESTClient.hasData(data))
|
||||
{
|
||||
let meldestichtage = CoreRESTClient.getData(data);
|
||||
this.$refs.bismeldestichtageTable.tabulator.setData(meldestichtage);
|
||||
}
|
||||
else
|
||||
alert("No response data");
|
||||
@@ -110,8 +131,7 @@ const bismeldestichtagApp = Vue.createApp({
|
||||
alert(CoreRESTClient.getError(data));
|
||||
else if (CoreRESTClient.hasData(data))
|
||||
{
|
||||
window.location.reload();
|
||||
alert("Successfully added Bismeldestichtag");
|
||||
this.handlerBismeldestichtage();
|
||||
}
|
||||
else
|
||||
alert("No response data");
|
||||
@@ -124,8 +144,7 @@ const bismeldestichtagApp = Vue.createApp({
|
||||
alert(CoreRESTClient.getError(data));
|
||||
else if (CoreRESTClient.hasData(data))
|
||||
{
|
||||
window.location.reload();
|
||||
alert("Successfully deletted Bismeldestichtag");
|
||||
this.handlerBismeldestichtage();
|
||||
}
|
||||
else
|
||||
alert("No response data");
|
||||
|
||||
@@ -23,12 +23,11 @@ export const BismeldestichtagTabulatorOptions = {
|
||||
minHeight: 50,
|
||||
layout: 'fitColumns',
|
||||
columns: [
|
||||
{title: 'ID', field: 'Id', headerFilter: true},
|
||||
{title: 'Meldestichtag',field: 'Meldestichtag', headerFilter: true, formatter: function(cell){
|
||||
{title: 'Meldestichtag',field: 'meldestichtag', headerFilter: true, formatter: function(cell){
|
||||
return cell.getValue().replace(/(.*)-(.*)-(.*)/, '$3.$2.$1');
|
||||
}
|
||||
},
|
||||
{title: 'Studiensemester', field: 'Studiensemester', headerFilter: true}
|
||||
{title: 'Studiensemester', field: 'studiensemester_kurzbz', headerFilter: true}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
@@ -1256,25 +1256,6 @@ $filters = array(
|
||||
}
|
||||
',
|
||||
'oe_kurzbz' => null,
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'dataset_name' => 'bismeldestichtag',
|
||||
'filter_kurzbz' => 'bismeldestichtag',
|
||||
'description' => '{Bismeldestichtage verwalten}',
|
||||
'sort' => 1,
|
||||
'default_filter' => true,
|
||||
'filter' => '
|
||||
{
|
||||
"name": "bismeldestichtag",
|
||||
"columns": [
|
||||
{"name": "Meldestichtag"},
|
||||
{"name": "Studiensemester"}
|
||||
],
|
||||
"filters": []
|
||||
}
|
||||
',
|
||||
'oe_kurzbz' => null,
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user