mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
hinzugefuegt:
- alle anzeigen option - jetzt starten knopf - oe rekursiv
This commit is contained in:
@@ -34,10 +34,18 @@ class Tempus extends Auth_Controller
|
||||
$this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
$this->load->model('ressource/Kalenderstatus_model', 'KalenderStatusModel');
|
||||
|
||||
$this->StudiengangModel->addOrder('typ');
|
||||
$this->StudiengangModel->addOrder('kurzbz');
|
||||
$this->StudiengangModel->addJoin('tbl_organisationseinheit', 'oe_kurzbz', 'LEFT');
|
||||
$organisationen = getData($this->StudiengangModel->loadWhere(array('tbl_studiengang.aktiv' => 'true')));
|
||||
$this->OrganisationseinheitModel->addJoin('tbl_studiengang', 'oe_kurzbz', 'LEFT');
|
||||
|
||||
$this->OrganisationseinheitModel->addSelect('public.tbl_organisationseinheit.organisationseinheittyp_kurzbz,
|
||||
public.tbl_organisationseinheit.bezeichnung,
|
||||
public.tbl_studiengang.studiengang_kz,
|
||||
public.tbl_organisationseinheit.oe_kurzbz,
|
||||
tbl_studiengang.typ,
|
||||
COALESCE(public.tbl_studiengang.bezeichnung, \'\') as stgbezeichnung');
|
||||
$this->OrganisationseinheitModel->addOrder('tbl_organisationseinheit.aktiv', 'DESC');
|
||||
$this->OrganisationseinheitModel->addOrder('tbl_organisationseinheit.organisationseinheittyp_kurzbz');
|
||||
$organisationen = getData($this->OrganisationseinheitModel->loadWhere(array("tbl_organisationseinheit.aktiv" => true)));
|
||||
|
||||
|
||||
$this->StudiensemesterModel->addOrder('start', 'DESC');
|
||||
$studiensemestern = getData($this->StudiensemesterModel->load());
|
||||
|
||||
@@ -46,12 +46,18 @@ class KalenderSync extends FHCAPI_Controller
|
||||
|
||||
$language = getUserLanguage() == 'German' ? 0 : 1;
|
||||
|
||||
$this->_ci->KalenderStatusModel->addSelect('tbl_kalender_syncstatus.*, array_to_json(bezeichnung_mehrsprachig::varchar[])->>' . $language .' AS sync_status_kurzbz, tbl_organisationseinheit.bezeichnung as oebezeichnung, tbl_studienplan.bezeichnung as studienplanbezeichnung');
|
||||
$this->_ci->KalenderStatusModel->addSelect('tbl_kalender_syncstatus.*, array_to_json(bezeichnung_mehrsprachig::varchar[])->>' . $language .' AS sync_status, tbl_organisationseinheit.bezeichnung as oebezeichnung, tbl_studienplan.bezeichnung as studienplanbezeichnung');
|
||||
$this->_ci->KalenderStatusModel->addJoin('lehre.tbl_kalender_status', 'tbl_kalender_syncstatus.sync_status_kurzbz = tbl_kalender_status.status_kurzbz');
|
||||
$this->_ci->KalenderStatusModel->addJoin('public.tbl_organisationseinheit', 'tbl_kalender_syncstatus.oe_kurzbz = tbl_organisationseinheit.oe_kurzbz');
|
||||
$this->_ci->KalenderStatusModel->addJoin('lehre.tbl_studienplan', 'tbl_kalender_syncstatus.studienplan_id = tbl_studienplan.studienplan_id', 'LEFT');
|
||||
$this->_ci->KalenderStatusModel->addJoin('public.tbl_studiensemester', 'tbl_kalender_syncstatus.studiensemester_kurzbz = tbl_studiensemester.studiensemester_kurzbz');
|
||||
$this->_ci->KalenderStatusModel->addOrder('public.tbl_studiensemester.start', 'DESC');
|
||||
|
||||
$data = $this->_ci->KalendersyncstatusModel->loadWhere(array('studiensemester_kurzbz' => $studiensemester_kurzbz));
|
||||
|
||||
if ($studiensemester_kurzbz === 'all')
|
||||
$data = $this->_ci->KalendersyncstatusModel->load();
|
||||
else
|
||||
$data = $this->_ci->KalendersyncstatusModel->loadWhere(array('tbl_kalender_syncstatus.studiensemester_kurzbz' => $studiensemester_kurzbz));
|
||||
|
||||
if (isError($data))
|
||||
$this->terminateWithError(getError($data));
|
||||
|
||||
@@ -18,6 +18,7 @@ class KalenderSyncLib
|
||||
$this->_ci->load->model('ressource/Kalender_model', 'KalenderModel');
|
||||
$this->_ci->load->model('ressource/Kalendersyncstatus_model', 'KalendersyncstatusModel');
|
||||
$this->_ci->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->_ci->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
}
|
||||
|
||||
public function run($studiensemester_kurzbz)
|
||||
@@ -181,17 +182,26 @@ class KalenderSyncLib
|
||||
|
||||
$studiengang_kz = getData($studiengang_result);
|
||||
|
||||
if (!hasData($studiengang_result))
|
||||
{
|
||||
$organisationseinheiten = $this->_ci->OrganisationseinheitModel->getChilds($oe_kurzbz);
|
||||
$oe_kurzbz = hasData($organisationseinheiten) ? array_column(getData($organisationseinheiten), 'oe_kurzbz') : [];
|
||||
}
|
||||
|
||||
$this->_ci->KalenderModel->addDistinct('tbl_kalender.kalender_id');
|
||||
$this->_ci->KalenderModel->addSelect('tbl_kalender.kalender_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_lehreinheit', 'tbl_kalender.kalender_id = tbl_kalender_lehreinheit.kalender_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_lehreinheit', 'tbl_kalender_lehreinheit.lehreinheit_id = tbl_lehreinheit.lehreinheit_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_lehrveranstaltung', 'tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id');
|
||||
|
||||
//TODO (david) oe_kurzbz rekursiv?
|
||||
if (!is_null($studiengang_kz))
|
||||
{
|
||||
$this->_ci->KalenderModel->db->where('tbl_lehrveranstaltung.studiengang_kz', $studiengang_kz);
|
||||
}
|
||||
else
|
||||
$this->_ci->KalenderModel->db->where('tbl_lehrveranstaltung.oe_kurzbz', $oe_kurzbz);
|
||||
{
|
||||
$this->_ci->KalenderModel->db->where_in('tbl_lehrveranstaltung.oe_kurzbz', $oe_kurzbz);
|
||||
}
|
||||
|
||||
$this->_ci->KalenderModel->db->where('tbl_lehreinheit.studiensemester_kurzbz', $studiensemester_kurzbz);
|
||||
$this->_ci->KalenderModel->db->where_in('tbl_kalender.status_kurzbz', $status_kurzbz_list);
|
||||
|
||||
@@ -23,7 +23,6 @@ class RaumvorschlagLib
|
||||
$this->_ci->load->model('organisation/gruppe_model', 'GruppeModel');
|
||||
$this->_ci->load->model('organisation/Lehrverband_model', 'LehrverbandModel');
|
||||
|
||||
$this->_ci->load->model('education/Lehreinheitgruppe_model', 'LehreinheitgruppeModel');
|
||||
$this->_ci->load->model('education/Lehreinheitgruppe_model', 'LehreinheitgruppeModel');
|
||||
|
||||
$this->_ci->load->library('CollisionChecker');
|
||||
|
||||
@@ -34,29 +34,32 @@ export default {
|
||||
return [];
|
||||
|
||||
return Array.from({length: this.max_semester}, (_, index) => index);
|
||||
},
|
||||
studienplanTrigger() {
|
||||
return [
|
||||
this.formData.oe_kurzbz,
|
||||
this.formData.studiensemester_kurzbz,
|
||||
this.formData.ausbildungssemester
|
||||
].join('|');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'formData.oe_kurzbz'(newOrganisation) {
|
||||
'formData.oe_kurzbz'(newOrganisation)
|
||||
{
|
||||
if (!newOrganisation) {
|
||||
this.max_semester = null;
|
||||
this.studienplaene = [];
|
||||
return;
|
||||
}
|
||||
|
||||
let filtered_org = this.config.organisationen.filter(org => org.oe_kurzbz === newOrganisation)[0];
|
||||
let filtered_org = (this.config.organisationen ?? []).filter(org => org.oe_kurzbz === newOrganisation)[0];
|
||||
|
||||
if (filtered_org && filtered_org.studiengang_kz)
|
||||
this.getSemester(filtered_org.studiengang_kz);
|
||||
else
|
||||
this.max_semester = null;
|
||||
|
||||
this.getStudienplan();
|
||||
},
|
||||
'formData.studiensemester_kurzbz'() {
|
||||
this.getStudienplan();
|
||||
},
|
||||
'formData.ausbildungssemester'() {
|
||||
studienplanTrigger() {
|
||||
this.getStudienplan();
|
||||
}
|
||||
},
|
||||
@@ -123,7 +126,7 @@ export default {
|
||||
this.$api.call(ApiTempusSync.getMaxSemester([stg_kz]))
|
||||
.then(response => response.data)
|
||||
.then(response => {
|
||||
this.max_semester = response;
|
||||
this.max_semester = response ?? null;
|
||||
|
||||
let found = this.semester.filter(semester => semester === this.formData.ausbildungssemester);
|
||||
if (found.length === 0)
|
||||
@@ -146,7 +149,7 @@ export default {
|
||||
))
|
||||
.then(response => response.data)
|
||||
.then(response => {
|
||||
this.studienplaene = response;
|
||||
this.studienplaene = response ?? [];
|
||||
let found = this.studienplaene.filter(plan => plan.studienplan_id === this.formData.studienplan_id);
|
||||
if (found.length === 0)
|
||||
this.formData.studienplan_id = null;
|
||||
@@ -168,7 +171,8 @@ export default {
|
||||
.call(ApiTempusSync.add(this.formData))
|
||||
.then(() => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.$emit('saved');
|
||||
if (this.stsem_kurzbz !== this.formData.studiensemester_kurzbz)
|
||||
this.$emit('saved', this.formData.studiensemester_kurzbz);
|
||||
this.$refs.modal.hide();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
@@ -178,31 +182,35 @@ export default {
|
||||
.call(ApiTempusSync.updateSync(this.formData))
|
||||
.then(() => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.$emit('saved');
|
||||
if (this.stsem_kurzbz !== this.formData.studiensemester_kurzbz)
|
||||
this.$emit('saved', this.formData.studiensemester_kurzbz);
|
||||
this.$refs.modal.hide();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
start() {
|
||||
start(data) {
|
||||
this.$refs.form
|
||||
.call(ApiTempusSync.start(this.formData))
|
||||
.call(ApiTempusSync.start(data ?? this.formData))
|
||||
.then(() => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.$emit('saved');
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successStart'));
|
||||
this.$refs.modal.hide();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
hideModal()
|
||||
{
|
||||
this.formData = {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log(this.config)
|
||||
|
||||
this.$api
|
||||
.call(ApiTempusSync.getSyncStatus())
|
||||
.then(result => this.syncStati = result.data)
|
||||
.then(result => this.syncStati = result.data ?? [])
|
||||
.catch(error => this.$fhcAlert.handleSystemError(error));
|
||||
},
|
||||
template: `
|
||||
<bs-modal ref="modal" >
|
||||
<bs-modal ref="modal" @hideBsModal="hideModal">
|
||||
<template #title>
|
||||
<template v-if="mode === 'new'">{{ $p.t('lehre', 'tempus_sync_new') }}</template>
|
||||
<template v-else-if="mode === 'edit'">{{ $p.t('lehre', 'tempus_sync_edit') }}</template>
|
||||
@@ -225,7 +233,7 @@ export default {
|
||||
:key="organisation.oe_kurzbz"
|
||||
:value="organisation.oe_kurzbz"
|
||||
>
|
||||
{{ organisation.typ.toUpperCase() }}{{ organisation.kurzbz.toUpperCase() }} ({{ organisation.kurzbzlang }})
|
||||
[{{ organisation.organisationseinheittyp_kurzbz }}] {{ organisation.bezeichnung }} {{ ['b', 'm'].includes(organisation.typ) ? organisation.stgbezeichnung : '' }}
|
||||
</option>
|
||||
</form-input>
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ export default {
|
||||
},
|
||||
{titlePhrase: 'lehre/studienplan', field: 'studienplanbezeichnung', minWidth: 200},
|
||||
{titlePhrase: 'lehre/ausbildungssemester', field: 'ausbildungssemester'},
|
||||
{titlePhrase: 'global/status', field: 'sync_status_kurzbz'},
|
||||
{titlePhrase: 'global/status', field: 'sync_status'},
|
||||
{titlePhrase: 'lehre/mail_benachrichtigung', field: 'mail', formatter: 'tickCross', hozAlign: 'center', minWidth: 80},
|
||||
{titlePhrase:'global/insertamum', field: 'insertamum',
|
||||
formatter: (cell) => {
|
||||
@@ -92,7 +92,7 @@ export default {
|
||||
width: 120,
|
||||
formatter: (cell) => {
|
||||
let container = document.createElement('div');
|
||||
container.className = "d-flex gap-2";
|
||||
container.className = "d-flex gap-3";
|
||||
let button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary';
|
||||
button.innerHTML = '<i class="fa fa-edit"></i>';
|
||||
@@ -102,6 +102,15 @@ export default {
|
||||
|
||||
container.append(button);
|
||||
|
||||
button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary';
|
||||
button.innerHTML = '<i class="fa fa-play"></i>';
|
||||
button.addEventListener('click', () =>
|
||||
|
||||
this.$refs.syncModal.start(cell.getRow().getData())
|
||||
);
|
||||
container.append(button);
|
||||
|
||||
button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary';
|
||||
button.innerHTML = '<i class="fa fa-trash"></i>';
|
||||
@@ -138,6 +147,17 @@ export default {
|
||||
openStartModal()
|
||||
{
|
||||
this.$refs.syncModal.openStart();
|
||||
},
|
||||
onSaved(studiensemester_kurzbz)
|
||||
{
|
||||
if (studiensemester_kurzbz && studiensemester_kurzbz !== this.studiensemester_kurzbz)
|
||||
{
|
||||
this.studiensemester_kurzbz = studiensemester_kurzbz;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.reloadTable();
|
||||
}
|
||||
}
|
||||
},
|
||||
template: `
|
||||
@@ -163,6 +183,7 @@ export default {
|
||||
name="studiensemester_kurzbz"
|
||||
>
|
||||
<option :value="null" disabled>-- {{ $p.t('lehre', 'studiensemester') }} --</option>
|
||||
<option value="all">{{ $p.t('ui', 'alleAnzeigen') }}</option>
|
||||
<option
|
||||
v-for="studiensemester in config.studiensemestern"
|
||||
:key="studiensemester.studiensemester_kurzbz"
|
||||
@@ -186,7 +207,7 @@ export default {
|
||||
ref="syncModal"
|
||||
:config="config"
|
||||
:stsem_kurzbz="studiensemester_kurzbz"
|
||||
@saved="reloadTable"
|
||||
@saved="onSaved"
|
||||
>
|
||||
</tempus-sync-modal>
|
||||
</template>
|
||||
|
||||
@@ -39126,6 +39126,26 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'successStart',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => '"Erfolgreich gestartet',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Started successfully',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
|
||||
Reference in New Issue
Block a user