mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
refactor backend
css file for showing inactive items in dropdown fix missing view for vertretung zeitsperren sticky top for header
This commit is contained in:
@@ -34,7 +34,6 @@ class MaZeitsperren extends FHCAPI_Controller
|
||||
//only user with zeitsperren
|
||||
public function getAllActiveZeitsperren($days)
|
||||
{
|
||||
|
||||
$result = $this->ZeitsperreModel->getZeitsperrenForNextDays($days);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -45,7 +44,9 @@ class MaZeitsperren extends FHCAPI_Controller
|
||||
//all fixe Ma
|
||||
public function getAllZeitsperrenFixeMa($days)
|
||||
{
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, true, false, null, false);
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, true, false, null, false);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
@@ -53,7 +54,9 @@ class MaZeitsperren extends FHCAPI_Controller
|
||||
|
||||
public function getAllZeitsperrenLector($days)
|
||||
{
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, false, true, null, false);
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, true, null, false);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -62,7 +65,9 @@ class MaZeitsperren extends FHCAPI_Controller
|
||||
|
||||
public function getZeitsperrenAss($days)
|
||||
{
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, false, false, null, true);
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, false, null, true);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -71,7 +76,9 @@ class MaZeitsperren extends FHCAPI_Controller
|
||||
|
||||
public function getAllZeitsperrenOes($days, $oe)
|
||||
{
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, false, false, $oe, false);
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, false, $oe, false);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -80,7 +87,9 @@ class MaZeitsperren extends FHCAPI_Controller
|
||||
|
||||
public function loadZeitsperrenLectorStg($days, $stg)
|
||||
{
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, false, true, false, false, $stg);
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, true, false, false, $stg);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -96,7 +105,8 @@ class MaZeitsperren extends FHCAPI_Controller
|
||||
kurzbzlang,
|
||||
typ,
|
||||
bezeichnung,
|
||||
kurzbzlang || ' (' || bezeichnung || ')' AS label
|
||||
kurzbzlang || ' (' || bezeichnung || ')' AS label,
|
||||
aktiv
|
||||
from
|
||||
public.tbl_studiengang
|
||||
where
|
||||
|
||||
@@ -67,13 +67,11 @@ class Zeitsperre_model extends DB_Model
|
||||
* @ days: count of the intervall of the next days
|
||||
* @return array
|
||||
*/
|
||||
public function getZeitsperrenForNextDays($days, $type=null)
|
||||
public function getZeitsperrenForNextDays($days)
|
||||
{
|
||||
//TODO(Manu) von und bis im controller berechnen und hier übergeben
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
|
||||
//version with campus.vw_mitarbeiter
|
||||
$paramsArray = [$von, $bis, $bis, $von];
|
||||
$qry = "select
|
||||
nachname,
|
||||
@@ -82,85 +80,28 @@ class Zeitsperre_model extends DB_Model
|
||||
vondatum,
|
||||
bisdatum,
|
||||
vertretung_uid,
|
||||
erreichbarkeit_kurzbz
|
||||
--lektor,
|
||||
-- fixangestellt
|
||||
erreichbarkeit_kurzbz,
|
||||
mv.kurzbz
|
||||
from
|
||||
campus.vw_mitarbeiter
|
||||
join campus.tbl_zeitsperre on
|
||||
(uid = mitarbeiter_uid)
|
||||
left join public.tbl_mitarbeiter mv on campus.tbl_zeitsperre.vertretung_uid = mv.mitarbeiter_uid
|
||||
where
|
||||
((? <= bisdatum
|
||||
and ? >= bisdatum)
|
||||
or (?>= vondatum
|
||||
and ? <= vondatum))
|
||||
order by nachname
|
||||
";
|
||||
|
||||
//fix, lektor etc just with all ma
|
||||
if($type=="fix") {
|
||||
$qry.= "AND fixangestellt = true";
|
||||
}
|
||||
if($type=="lector") {
|
||||
$qry.= "AND lektor = true";
|
||||
}
|
||||
|
||||
//wenn lektor= WAHR und fixangestellt = Falsch: --> externer Lektor
|
||||
|
||||
$qry .= " order by nachname";
|
||||
|
||||
|
||||
|
||||
//version with hr.dienstverhaeltnis
|
||||
/* $paramsArray = [$bis, $von];
|
||||
$qry = "
|
||||
SELECT
|
||||
ps.nachname,
|
||||
ps.vorname,
|
||||
zs.mitarbeiter_uid,
|
||||
zs.vondatum,
|
||||
zs.bisdatum,
|
||||
zs.vertretung_uid,
|
||||
zs.erreichbarkeit_kurzbz
|
||||
FROM campus.tbl_zeitsperre zs
|
||||
JOIN public.tbl_benutzer bn
|
||||
ON bn.uid = zs.mitarbeiter_uid
|
||||
JOIN public.tbl_person ps
|
||||
ON ps.person_id = bn.person_id ";
|
||||
|
||||
if ($type != null) {
|
||||
$qry.= " JOIN hr.tbl_dienstverhaeltnis dv on bn.uid = dv.mitarbeiter_uid ";
|
||||
}
|
||||
|
||||
$qry.="
|
||||
WHERE
|
||||
zs.vondatum <= ?
|
||||
AND zs.bisdatum >= ?";
|
||||
|
||||
if($type=="fix") {
|
||||
$qry.= " and dv.vertragsart_kurzbz = 'echterdv'";
|
||||
}
|
||||
if($type=="lector") {
|
||||
$qry.= " and dv.vertragsart_kurzbz in ('externerlehrender', 'gastlektor')";
|
||||
}
|
||||
|
||||
$qry .= "
|
||||
ORDER BY
|
||||
ps.nachname,
|
||||
ps.vorname,
|
||||
zs.vondatum;";*/
|
||||
|
||||
$result = $this->execQuery($qry, $paramsArray);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getMitarbeiterWithZeitsperren($days, $fix=false, $lector=false, $oe=null, $ass=false, $stg=false)
|
||||
public function getMitarbeiterWithZeitsperren($von, $bis, $fix=false, $lector=false, $oe=null, $ass=false, $stg=false)
|
||||
{
|
||||
//TODO(Manu) von und bis im controller berechnen und hier übergeben
|
||||
$von = date('Y-m-d');
|
||||
$bis = date('Y-m-d', strtotime("+{$days} days"));
|
||||
|
||||
//version with campus.vw_mitarbeiter
|
||||
$paramsArray = [$von, $bis, $bis, $von];
|
||||
|
||||
if($oe)
|
||||
|
||||
@@ -12,13 +12,14 @@ $includesArray = array(
|
||||
'tinymce5' => true,
|
||||
'phrases' => array(
|
||||
'global',
|
||||
'ui',
|
||||
'ui'
|
||||
),
|
||||
'customCSSs' => [
|
||||
'public/css/components/vue-datepicker.css',
|
||||
'public/css/components/primevue.css',
|
||||
'public/css/Vertragsverwaltung.css',
|
||||
'public/css/components/Detailheader.css'
|
||||
'public/css/components/Detailheader.css',
|
||||
'public/css/components/Zeitsperren.css'
|
||||
],
|
||||
'customJSs' => [
|
||||
#'vendor/npm-asset/primevue/tree/tree.min.js',
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
.item-inactive {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
@@ -311,80 +311,81 @@ export default {
|
||||
},
|
||||
template: `
|
||||
<div class="w-100 h-100">
|
||||
<h4 class="mt-3"><span v-if="type=='all'">{{$p.t('zeitsperren/title_allMa')}}</span>
|
||||
<span v-if="type=='fix'">{{$p.t('zeitsperren/title_fix')}}</span>
|
||||
<span v-if="type=='lector'">{{$p.t('zeitsperren/title_fixLecturers')}}</span>
|
||||
<span v-if="type=='oe'">{{$p.t('zeitsperren/title_byOe')}}</span>
|
||||
<span v-if="type=='lecStg'">{{$p.t('zeitsperren/title_lectStg')}}</span>
|
||||
<span v-if="type=='ass'">{{$p.t('zeitsperren/title_ass')}}</span>
|
||||
{{ mondayBeforeToday.toLocaleDateString('de-AT') }} - {{endInterval}}
|
||||
</h4>
|
||||
<div class="d-flex align-items-center gap-2 mb-3">
|
||||
<label for="days">Anzahl Tage:</label>
|
||||
<input
|
||||
id="days"
|
||||
v-model.number="interval"
|
||||
type="number"
|
||||
class="form-control"
|
||||
style="width: 90px"
|
||||
min="1"
|
||||
max="99"
|
||||
@input="limitDays"
|
||||
>
|
||||
<label v-if="type=='oe'">{{$p.t('lehre/organisationseinheit')}}</label>
|
||||
<div v-if="type=='oe'" class="flex-grow-1">
|
||||
<form-form class="g-3" ref="oeSelectForm">
|
||||
<form-input
|
||||
container-class="w-50"
|
||||
type="autocomplete"
|
||||
name="oe_kurzbz"
|
||||
v-model="selectedOe"
|
||||
forceSelection
|
||||
optionLabel="label"
|
||||
optionValue="oe_kurzbz"
|
||||
:suggestions="filteredOes"
|
||||
dropdown
|
||||
@complete="filterOes"
|
||||
>
|
||||
<template #option="slotProps">
|
||||
<div
|
||||
:class="!slotProps.option.aktiv
|
||||
? 'item-inactive'
|
||||
: ''"
|
||||
>
|
||||
{{slotProps.option.label}}
|
||||
</div>
|
||||
</template>
|
||||
</form-input>
|
||||
</form-form>
|
||||
</div>
|
||||
|
||||
<label v-if="type=='lecStg'">{{$p.t('zeitsperren/lektor_innen')}}</label>
|
||||
<div v-if="type=='lecStg'" class="flex-grow-1">
|
||||
<form-form class="g-3" ref="oeSelectForm">
|
||||
<form-input
|
||||
container-class="w-50"
|
||||
type="autocomplete"
|
||||
name="studiengang_kz"
|
||||
v-model="selectedStg"
|
||||
forceSelection
|
||||
optionLabel="label"
|
||||
optionValue="studiengang_kz"
|
||||
:suggestions="filteredStg"
|
||||
dropdown
|
||||
@complete="filterStg"
|
||||
>
|
||||
<template #option="slotProps">
|
||||
<div
|
||||
:class="!slotProps.option.aktiv
|
||||
? 'item-inactive'
|
||||
: ''"
|
||||
>
|
||||
{{slotProps.option.label}}
|
||||
</div>
|
||||
</template>
|
||||
</form-input>
|
||||
</form-form>
|
||||
<div class="sticky-top bg-white p-3 border-bottom">
|
||||
<h4 class="mt-3"><span v-if="type=='all'">{{$p.t('zeitsperren/title_allMa')}}</span>
|
||||
<span v-if="type=='fix'">{{$p.t('zeitsperren/title_fix')}}</span>
|
||||
<span v-if="type=='lector'">{{$p.t('zeitsperren/title_fixLecturers')}}</span>
|
||||
<span v-if="type=='oe'">{{$p.t('zeitsperren/title_byOe')}}</span>
|
||||
<span v-if="type=='lecStg'">{{$p.t('zeitsperren/title_lectStg')}}</span>
|
||||
<span v-if="type=='ass'">{{$p.t('zeitsperren/title_ass')}}</span>
|
||||
{{ mondayBeforeToday.toLocaleDateString('de-AT') }} - {{endInterval}}
|
||||
</h4>
|
||||
<div class="d-flex align-items-center gap-2 mb-3">
|
||||
<label for="days">Anzahl Tage:</label>
|
||||
<input
|
||||
id="days"
|
||||
v-model.number="interval"
|
||||
type="number"
|
||||
class="form-control"
|
||||
style="width: 90px"
|
||||
min="1"
|
||||
max="99"
|
||||
@input="limitDays"
|
||||
>
|
||||
<label v-if="type=='oe'">{{$p.t('lehre/organisationseinheit')}}</label>
|
||||
<div v-if="type=='oe'" class="flex-grow-1">
|
||||
<form-form class="g-3" ref="oeSelectForm">
|
||||
<form-input
|
||||
container-class="w-50"
|
||||
type="autocomplete"
|
||||
name="oe_kurzbz"
|
||||
v-model="selectedOe"
|
||||
forceSelection
|
||||
optionLabel="label"
|
||||
optionValue="oe_kurzbz"
|
||||
:suggestions="filteredOes"
|
||||
dropdown
|
||||
@complete="filterOes"
|
||||
>
|
||||
<template #option="slotProps">
|
||||
<div
|
||||
:class="!slotProps.option.aktiv
|
||||
? 'item-inactive'
|
||||
: ''"
|
||||
>
|
||||
{{slotProps.option.label}}
|
||||
</div>
|
||||
</template>
|
||||
</form-input>
|
||||
</form-form>
|
||||
</div>
|
||||
<label v-if="type=='lecStg'">{{$p.t('zeitsperren/lektor_innen')}}</label>
|
||||
<div v-if="type=='lecStg'" class="flex-grow-1">
|
||||
<form-form class="g-3" ref="oeSelectForm">
|
||||
<form-input
|
||||
container-class="w-50"
|
||||
type="autocomplete"
|
||||
name="studiengang_kz"
|
||||
v-model="selectedStg"
|
||||
forceSelection
|
||||
optionLabel="label"
|
||||
optionValue="studiengang_kz"
|
||||
:suggestions="filteredStg"
|
||||
dropdown
|
||||
@complete="filterStg"
|
||||
>
|
||||
<template #option="slotProps">
|
||||
<div
|
||||
:class="!slotProps.option.aktiv
|
||||
? 'item-inactive'
|
||||
: ''"
|
||||
>
|
||||
{{slotProps.option.label}}
|
||||
</div>
|
||||
</template>
|
||||
</form-input>
|
||||
</form-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -404,14 +405,13 @@ export default {
|
||||
:key="m.uid"
|
||||
>
|
||||
<td>{{m.sperren[0].nachname}} {{m.sperren[0].vorname}}</td>
|
||||
|
||||
<td
|
||||
v-for="day in days"
|
||||
:key="day.date"
|
||||
:class="{ 'table-warning': day.weekday === 'Sa' || day.weekday === 'So' }"
|
||||
>
|
||||
<template v-if="sperre = getSperre(m, day.date)">
|
||||
abwesend
|
||||
{{$p.t('zeitsperren/abwesend')}}
|
||||
<div v-if="sperre.kurzbz">
|
||||
V: {{ sperre.kurzbz }}
|
||||
</div>
|
||||
@@ -426,7 +426,7 @@ export default {
|
||||
</table>
|
||||
|
||||
<div v-if="!arrayMaTimelocks.length">
|
||||
<p> Keine Einträge vorhanden </p>
|
||||
<p>{{$p.t('ui/keineEintraegeGefunden')}}</p>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
|
||||
@@ -60621,7 +60621,46 @@ I have been informed that I am under no obligation to consent to the transmissio
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'zeitsperren',
|
||||
'phrase' => 'abwesend',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'abwesend',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'absent',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'zeitsperren',
|
||||
'phrase' => 'anzahlTage',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Anzahl Tage',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Number of days',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
// PHRASES ZEITSPERREN END
|
||||
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user