mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
Merge branch 'master' into feature-63445/Studierendenverwaltung_Filter
This commit is contained in:
@@ -60,17 +60,6 @@ class Favorites extends FHCAPI_Controller
|
||||
|
||||
$favorites = $this->input->post('favorites');
|
||||
|
||||
$removed = [];
|
||||
while (strlen($favorites) > 64) {
|
||||
$favObj = json_decode($favorites);
|
||||
if (!$favObj->list)
|
||||
break;
|
||||
$removed[] = array_shift($favObj->list);
|
||||
$favorites = json_encode($favObj);
|
||||
}
|
||||
if ($removed)
|
||||
$this->addMeta('removed', $removed);
|
||||
|
||||
$result = $this->VariableModel->setVariable(getAuthUID(), 'stv_favorites', $favorites);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -138,13 +138,24 @@ class Prestudent extends FHCAPI_Controller
|
||||
{
|
||||
$val = $this->input->post($prop, true);
|
||||
|
||||
if ($val !== null || $prop === 'foerderrelevant') {
|
||||
if ($val !== null) {
|
||||
if(in_array($prop, ['dual', 'bismelden', 'foerderrelevant']))
|
||||
{
|
||||
$val = boolval($val);
|
||||
}
|
||||
elseif (
|
||||
$val === ''
|
||||
&& in_array($prop, ['zgvnation', 'zgvmanation', 'zgvdoktornation', 'berufstaetigkeit_code', 'ausbildungcode'])
|
||||
)
|
||||
{
|
||||
$val = null;
|
||||
}
|
||||
$update_prestudent[$prop] = $val;
|
||||
}
|
||||
|
||||
// allowed to be null, but has to be in postparameter
|
||||
if (
|
||||
in_array($prop, ['zgvdatum', 'zgvmadatum', 'zgvdoktordatum', 'zgv_code', 'zgvmas_code', 'zgvdoktor_code'])
|
||||
in_array($prop, ['foerderrelevant', 'zgvdatum', 'zgvmadatum', 'zgvdoktordatum', 'zgv_code', 'zgvmas_code', 'zgvdoktor_code'])
|
||||
&& !isset($update_prestudent[$prop])
|
||||
&& array_key_exists($prop, $_POST)
|
||||
)
|
||||
|
||||
@@ -286,11 +286,11 @@ class Status extends FHCAPI_Controller
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('_default', '', [
|
||||
['meldestichtag_not_exceeded', function () use ($datum, $isBerechtigtNoStudstatusCheck) {
|
||||
['meldestichtag_not_exceeded', function () use ($datum_string, $isBerechtigtNoStudstatusCheck) {
|
||||
if ($isBerechtigtNoStudstatusCheck)
|
||||
return true; // Skip if access right says so
|
||||
|
||||
$result = $this->prestudentstatuschecklib->checkIfMeldestichtagErreicht($datum);
|
||||
$result = $this->prestudentstatuschecklib->checkIfMeldestichtagErreicht($datum_string);
|
||||
|
||||
return !$this->getDataOrTerminateWithError($result);
|
||||
}],
|
||||
@@ -733,8 +733,9 @@ class Status extends FHCAPI_Controller
|
||||
);
|
||||
|
||||
$result = $this->prestudentstatuschecklib->checkIfMeldestichtagErreicht($oldstatus->datum);
|
||||
$isMeldestichtagErreicht = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$this->getDataOrTerminateWithError($result))
|
||||
if ($isMeldestichtagErreicht)
|
||||
$this->terminateWithError(
|
||||
$this->p->t('lehre', 'error_dataVorMeldestichtag'),
|
||||
self::ERROR_TYPE_GENERAL,
|
||||
|
||||
@@ -229,9 +229,10 @@ class StundenplanLib
|
||||
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
|
||||
$is_mitarbeiter = getData($this->_ci->MitarbeiterModel->isMitarbeiter(getAuthUID()));
|
||||
|
||||
if ($is_mitarbeiter) {
|
||||
$reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date, $ort_kurzbz);
|
||||
|
||||
if ($is_mitarbeiter && empty($ort_kurzbz)) {
|
||||
// request for personal lvplan show only reservations of logged in user
|
||||
$reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date);
|
||||
} else {
|
||||
// querying the reservierungen
|
||||
$reservierungen = $this->_ci->ReservierungModel->getReservierungen($start_date, $end_date, $ort_kurzbz);
|
||||
|
||||
@@ -76,7 +76,7 @@ class Reservierung_model extends DB_Model
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getReservierungenMitarbeiter($start_date, $end_date, $ort_kurzbz = null)
|
||||
public function getReservierungenMitarbeiter($start_date, $end_date)
|
||||
{
|
||||
|
||||
$raum_reservierungen_query = "SELECT res.*, beginn, ende,
|
||||
@@ -89,7 +89,6 @@ class Reservierung_model extends DB_Model
|
||||
JOIN lehre.tbl_stunde ON lehre.tbl_stunde.stunde = res.stunde
|
||||
WHERE res.uid = ? AND datum >= ? AND datum <= ?";
|
||||
|
||||
// $subquery = is_null($ort_kurzbz)? $lvplan_reservierungen_query:$raum_reservierungen_query;
|
||||
$subquery = $raum_reservierungen_query;
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ const app = Vue.createApp({
|
||||
defaultaction: {
|
||||
type: "link",
|
||||
renderif: function(data) {
|
||||
if(data.content_id === "N/A"){
|
||||
if(data.content_id === null){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -79,7 +79,7 @@ const app = Vue.createApp({
|
||||
icon: "fas fa-info-circle",
|
||||
type: "link",
|
||||
renderif: function(data) {
|
||||
if(data.content_id === "N/A"){
|
||||
if(data.content_id === null){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -318,6 +318,7 @@ export default {
|
||||
name="zgvnation"
|
||||
>
|
||||
<!-- TODO(chris): gesperrte nationen können nicht ausgewählt werden! Um das zu realisieren müsste man ein pseudo select machen -->
|
||||
<option value=""> </option>
|
||||
<option v-for="nation in lists.nations" :key="nation.nation_code" :value="nation.nation_code" :disabled="nation.sperre">{{nation.kurztext}}</option>
|
||||
</form-input>
|
||||
</div>
|
||||
@@ -380,6 +381,7 @@ export default {
|
||||
name="zgvmanation"
|
||||
>
|
||||
<!-- TODO(chris): gesperrte nationen können nicht ausgewählt werden! Um das zu realisieren müsste man ein pseudo select machen -->
|
||||
<option value=""> </option>
|
||||
<option v-for="nation in lists.nations" :key="nation.nation_code" :value="nation.nation_code" :disabled="nation.sperre">{{nation.kurztext}}</option>
|
||||
</form-input>
|
||||
</div>
|
||||
@@ -443,6 +445,7 @@ export default {
|
||||
name="zgvdoktornation"
|
||||
>
|
||||
<!-- TODO(chris): gesperrte nationen können nicht ausgewählt werden! Um das zu realisieren müsste man ein pseudo select machen -->
|
||||
<option value=""> </option>
|
||||
<option v-for="nation in lists.nations" :key="nation.nation_code" :value="nation.nation_code" :disabled="nation.sperre">{{nation.kurztext}}</option>
|
||||
</form-input>
|
||||
</div>
|
||||
@@ -504,6 +507,7 @@ export default {
|
||||
v-model="data.berufstaetigkeit_code"
|
||||
name="berufstaetigkeit_code"
|
||||
>
|
||||
<option value=""> </option>
|
||||
<option v-for="beruf in listBerufe" :key="beruf.berufstaetigkeit_code" :value="beruf.berufstaetigkeit_code">{{beruf.berufstaetigkeit_bez}} </option>
|
||||
</form-input>
|
||||
<form-input
|
||||
@@ -514,6 +518,7 @@ export default {
|
||||
v-model="data.ausbildungcode"
|
||||
name="ausbildungcode"
|
||||
>
|
||||
<option value=""> </option>
|
||||
<option v-for="ausbld in listAusbildung" :key="ausbld.ausbildungcode" :value="ausbld.ausbildungcode">{{ausbld.ausbildungbez}} </option>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
@@ -205,7 +205,7 @@ export default{
|
||||
];*/
|
||||
},
|
||||
template: `
|
||||
<bs-modal class="stv-status-modal" ref="modal">
|
||||
<bs-modal class="stv-status-modal" ref="modal" dialog-class="modal-dialog-scrollable">
|
||||
<template #title>
|
||||
{{ $p.t('lehre', statusNew ? 'status_new' : 'status_edit', prestudent) }}
|
||||
</template>
|
||||
|
||||
@@ -112,26 +112,14 @@ export default {
|
||||
|
||||
return cp;
|
||||
},
|
||||
async filterFav() {
|
||||
filterFav() {
|
||||
this.favorites.on = !this.favorites.on;
|
||||
this.$api
|
||||
.call(this.endpoint.favorites.set(
|
||||
JSON.stringify(this.favorites)
|
||||
))
|
||||
.then(result => {
|
||||
if (result.meta?.removed) {
|
||||
this.favorites.list = this.favorites.list
|
||||
.filter(fav => !result.meta.removed.includes(fav));
|
||||
const items = result.meta.removed.map(
|
||||
rem => this.nodes.find(
|
||||
node => node.data.link == rem
|
||||
).label
|
||||
).join(',\n');
|
||||
this.$fhcAlert.alertWarning(this.$p.t('stv/warn_removed_favs', { items }));
|
||||
}
|
||||
});
|
||||
));
|
||||
},
|
||||
async markFav(key) {
|
||||
markFav(key) {
|
||||
let index = this.favorites.list.indexOf(key.data.link + '');
|
||||
|
||||
if (index != -1) {
|
||||
@@ -143,19 +131,7 @@ export default {
|
||||
this.$api
|
||||
.call(this.endpoint.favorites.set(
|
||||
JSON.stringify(this.favorites)
|
||||
))
|
||||
.then(result => {
|
||||
if (result.meta?.removed) {
|
||||
this.favorites.list = this.favorites.list
|
||||
.filter(fav => !result.meta.removed.includes(fav));
|
||||
const items = "\n" + result.meta.removed.map(
|
||||
rem => this.nodes.find(
|
||||
node => node.data.link == rem
|
||||
).label
|
||||
).join(",\n");
|
||||
this.$fhcAlert.alertWarning(this.$p.t('stv/warn_removed_favs', { items }));
|
||||
}
|
||||
});
|
||||
));
|
||||
},
|
||||
unsetFavFocus(e) {
|
||||
if (e.target.dataset?.linkFavAdd !== undefined) {
|
||||
|
||||
@@ -19,10 +19,24 @@ export default {
|
||||
if (this.action.type === 'function')
|
||||
this.action.action(this.res);
|
||||
this.$emit('actionexecuted');
|
||||
},
|
||||
renderif: function() {
|
||||
if(this.action?.renderif === undefined) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return this.action.renderif(this.res);
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<template v-if="this.renderif()">
|
||||
<a class="searchbar-result-template-action" :href="actionHref" @click="actionFunc">
|
||||
<slot>{{ $p.t('search/action_default_label') }}</slot>
|
||||
</a>`
|
||||
</a>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="searchbar-result-template-action">
|
||||
<slot>{{ $p.t('search/action_default_label') }}</slot>
|
||||
</div>
|
||||
</template>`
|
||||
};
|
||||
@@ -10,11 +10,20 @@ export default {
|
||||
res: Object,
|
||||
actions: Array
|
||||
},
|
||||
methods: {
|
||||
renderif: function(action) {
|
||||
if(action?.renderif === undefined) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return action.renderif(this.res);
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div v-if="actions.length" class="searchbar-result-template-actions">
|
||||
<template v-for="(action, index) in actions" :key="action.label">
|
||||
<result-action
|
||||
v-for="(action, index) in actions"
|
||||
:key="action.label"
|
||||
v-if="this.renderif(action)"
|
||||
:res="res"
|
||||
:action="action"
|
||||
class="btn btn-primary btn-sm"
|
||||
@@ -23,5 +32,6 @@ export default {
|
||||
<i v-if="action.icon" :class="action.icon"></i>
|
||||
<span class="p-2">{{ action.label }}</span>
|
||||
</result-action>
|
||||
</template>
|
||||
</div>`
|
||||
};
|
||||
@@ -9755,7 +9755,7 @@ COMMENT ON TABLE public.tbl_tag IS 'Orders and Company Tags';
|
||||
CREATE TABLE public.tbl_variable (
|
||||
name character varying(64) NOT NULL,
|
||||
uid character varying(32) NOT NULL,
|
||||
wert character varying(64)
|
||||
wert text
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ require_once('dbupdate_3.4/55614_perm_verwaltetoe.php');
|
||||
require_once('dbupdate_3.4/25999_C4_dashboard.php');
|
||||
require_once('dbupdate_3.4/61730_Dashboard_Anpassungen.php');
|
||||
require_once('dbupdate_3.4/40128_search.php');
|
||||
require_once('dbupdate_3.4/63394_Variablenbeschraenkung.php');
|
||||
require_once('dbupdate_3.4/63436_cis4_iframe_component.php');
|
||||
require_once('dbupdate_3.4/60882_lehrfaecherverteilung_favorites.php');
|
||||
require_once('dbupdate_3.4/66982_berufsschule.php');
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
if (!defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
// Change type of wert in public.tbl_variable
|
||||
if ($result = @$db->db_query("
|
||||
SELECT data_type
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'public'
|
||||
AND table_name = 'tbl_variable'
|
||||
AND column_name = 'wert';
|
||||
")) {
|
||||
if ($db->db_num_rows($result) == 1)
|
||||
{
|
||||
$data_type = $db->db_fetch_row($result)[0];
|
||||
|
||||
if (strtolower($data_type) != 'text')
|
||||
{
|
||||
$qry = "ALTER TABLE public.tbl_variable
|
||||
ALTER COLUMN wert
|
||||
TYPE TEXT;";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_variable '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo 'public.tbl_variable: Change type of "wert" to TEXT<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38460,26 +38460,6 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'stv',
|
||||
'phrase' => 'warn_removed_favs',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Zu viele Favoriten! Die folgenden Einträge wurden entfernt: {items}',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Too many favorites! The following entries were removed: {items}',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'stv',
|
||||
|
||||
Reference in New Issue
Block a user