mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b170478abc |
@@ -19,12 +19,12 @@ class Config extends FHCAPI_Controller
|
||||
$this->_setAuthUID();
|
||||
|
||||
$this->loadPhrases([
|
||||
'lehre'
|
||||
'lehre',
|
||||
'stv'
|
||||
]);
|
||||
|
||||
$this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -55,15 +55,47 @@ class Config extends FHCAPI_Controller
|
||||
"value" => $ignore_reservierung,
|
||||
];
|
||||
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), ['font_size']);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$config['font_size'] = [
|
||||
"type" => "select",
|
||||
"label" => $this->p->t('stv', 'settings_fontsize'),
|
||||
"value" => $data['font_size'] ?? "fs_normal",
|
||||
"options" => [
|
||||
"fs_xx-small" => $this->p->t('stv', 'settings_fontsize_xx-small'),
|
||||
"fs_x-small" => $this->p->t('stv', 'settings_fontsize_x-small'),
|
||||
"fs_small" => $this->p->t('stv', 'settings_fontsize_small'),
|
||||
"fs_normal" => $this->p->t('stv', 'settings_fontsize_normal'),
|
||||
"fs_big" => $this->p->t('stv', 'settings_fontsize_big'),
|
||||
"fs_huge" => $this->p->t('stv', 'settings_fontsize_huge')
|
||||
]
|
||||
];
|
||||
|
||||
$this->terminateWithSuccess($config);
|
||||
}
|
||||
public function set()
|
||||
{
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'font_size',
|
||||
$this->p->t('stv', 'settings_fontsize'),
|
||||
'required|in_list[fs_xx-small,fs_x-small,fs_small,fs_normal,fs_big,fs_huge]'
|
||||
);
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$this->VariableModel->setVariable(
|
||||
getAuthUID(),
|
||||
'font_size',
|
||||
$this->input->post('font_size')
|
||||
);
|
||||
|
||||
if (!($this->permissionlib->isBerechtigt('basis/tempus')) && !($this->permissionlib->isBerechtigt('lv-plan')))
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
|
||||
foreach (['ignore_kollision','ignore_zeitsperre','ignore_reservierung'] as $variable)
|
||||
{
|
||||
if ($this->_ci->input->post($variable) !== null)
|
||||
|
||||
@@ -80,12 +80,12 @@ class Config extends FHCAPI_Controller
|
||||
];
|
||||
|
||||
#font_size
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), ['stv_font_size']);
|
||||
$result = $this->VariableModel->getVariables(getAuthUID(), ['font_size']);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$config['font_size'] = [
|
||||
"type" => "select",
|
||||
"label" => $this->p->t('stv', 'settings_fontsize'),
|
||||
"value" => $data['stv_font_size'] ?? "fs_normal",
|
||||
"value" => $data['font_size'] ?? "fs_normal",
|
||||
"options" => [
|
||||
"fs_xx-small" => $this->p->t('stv', 'settings_fontsize_xx-small'),
|
||||
"fs_x-small" => $this->p->t('stv', 'settings_fontsize_x-small'),
|
||||
@@ -136,7 +136,7 @@ class Config extends FHCAPI_Controller
|
||||
);
|
||||
$this->VariableModel->setVariable(
|
||||
getAuthUID(),
|
||||
'stv_font_size',
|
||||
'font_size',
|
||||
$this->input->post('font_size')
|
||||
);
|
||||
|
||||
|
||||
@@ -66,10 +66,28 @@ export default {
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemErrors);
|
||||
}
|
||||
}
|
||||
},
|
||||
'modelValue.font_size'(fontSize) {
|
||||
this.applyFontSize(fontSize);
|
||||
},
|
||||
|
||||
},
|
||||
methods: {
|
||||
applyFontSize(fontSize) {
|
||||
const options = this.setup.font_size?.options;
|
||||
|
||||
if (!fontSize || !options)
|
||||
return;
|
||||
|
||||
Object.keys(options).forEach(cn => document.documentElement.classList.remove(cn));
|
||||
document.documentElement.classList.add(fontSize);
|
||||
|
||||
document.querySelectorAll('.tabulator').forEach(el => {
|
||||
const tabulators = Tabulator.findTable(el);
|
||||
if (tabulators)
|
||||
tabulators[0].searchRows().forEach(row => row.normalizeHeight());
|
||||
});
|
||||
},
|
||||
update() {
|
||||
this.$refs.form
|
||||
.call(this.endpoints.set(this.tempValues))
|
||||
|
||||
@@ -295,22 +295,6 @@ export default {
|
||||
this.$refs.stvList.updateUrl(n || []);
|
||||
}
|
||||
},
|
||||
'appconfig.font_size'() {
|
||||
// add to html class
|
||||
const classList = Object.keys(this.$refs.config.setup.font_size.options);
|
||||
classList.forEach(cn => document.documentElement.classList.remove(cn));
|
||||
document.documentElement.classList.add(this.appconfig.font_size);
|
||||
// recalc Tabulator heights
|
||||
if (this.$el) {
|
||||
const tabulatorEls = this.$el.querySelectorAll('.tabulator');
|
||||
for (const el of tabulatorEls) {
|
||||
const tabulators = Tabulator.findTable(el);
|
||||
if (tabulators) {
|
||||
tabulators[0].searchRows().forEach(row => row.normalizeHeight());
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
sidebarCollapsed(newVal) {
|
||||
if(newVal) this.$refs.hSplit.collapseLeft()
|
||||
else this.$refs.hSplit.showBoth()
|
||||
|
||||
@@ -87,7 +87,6 @@ require_once('dbupdate_3.4/62063_lv_evaluierung.php');
|
||||
require_once('dbupdate_3.4/67490_studstatus_suche_abort_controller_haengt.php');
|
||||
require_once('dbupdate_3.4/61164_abgabetool_quality_gates.php');
|
||||
require_once('dbupdate_3.4/69065_Projektarbeiten_Firmen_verwalten.php');
|
||||
require_once('dbupdate_3.4/68744_StV_settings.php');
|
||||
require_once('dbupdate_3.4/62889_reihungstest_ueberwachung_mit_constructor.php');
|
||||
require_once('dbupdate_3.4/71399_dashboard_update_widget_paths.php');
|
||||
require_once('dbupdate_3.4/71645_studvw_messagetab_ladezeit.php');
|
||||
@@ -103,6 +102,7 @@ require_once('dbupdate_3.4/76160_lvv_favorites.php');
|
||||
require_once('dbupdate_3.4/77080_tabulator_presets_table.php');
|
||||
require_once('dbupdate_3.4/78292_gehaltsanpassungtyp.php');
|
||||
require_once('dbupdate_3.4/54225_reihungstest_ablauf_fuer_quereinsteiger.php');
|
||||
require_once('dbupdate_3.4/83591_lvverwaltung_zoom_faktor.php');
|
||||
|
||||
|
||||
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
if (!defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
// Add new name type in public.tbl_variablenname
|
||||
if ($result = @$db->db_query("SELECT 1 FROM public.tbl_variablenname WHERE name = 'stv_font_size';"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "INSERT INTO public.tbl_variablenname(name, defaultwert) VALUES('stv_font_size', null);";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_variablenname '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo 'public.tbl_variablenname: Added name "stv_font_size"<br>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
if (!defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
// Add new name type in public.tbl_variablenname
|
||||
if ($result = @$db->db_query("SELECT 1 FROM public.tbl_variablenname WHERE name = 'font_size';"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "INSERT INTO public.tbl_variablenname(name, defaultwert) VALUES('font_size', null);
|
||||
UPDATE public.tbl_variable SET name = 'font_size' WHERE name = 'stv_font_size';
|
||||
DELETE FROM public.tbl_variablenname WHERE name = 'stv_font_size';
|
||||
";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_variablenname '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo 'public.tbl_variablenname: Added name "font_size"<br>';
|
||||
echo 'public.tbl_variable: Updated name "stv_font_size" to "font_size"<br>';
|
||||
echo 'public.tbl_variablenname: Deleted name "stv_font_size"<br>';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user