absage fuer alle und rueckstellung ueber infocenter uebersicht

This commit is contained in:
ma0048
2025-05-12 12:53:16 +02:00
parent 7030d5b822
commit 419341f496
10 changed files with 158 additions and 13 deletions
@@ -2375,16 +2375,39 @@ class InfoCenter extends Auth_Controller
if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen))
$this->terminateWithJsonError("Bitte füllen Sie alle Felder aus");
foreach($personen as $person)
if ($studiengang === 'all' && $abgeschickt !== 'all' ||
$abgeschickt === 'all' && $studiengang !== 'all')
$this->terminateWithJsonError("Absage für alle Studiengänge ist nur in Kombination mit abgeschickt 'Beide' möglich!");
if ($studiengang === 'all' && $abgeschickt === 'all')
{
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt);
foreach($personen as $person)
{
$prestudenten = $this->PrestudentModel->getByPersonWithoutLehrgang($person, $studienSemester);
if (!hasData($prestudent))
continue;
if (!hasData($prestudenten))
continue;
$prestudentData = getData($prestudent);
$prestudentenData = getData($prestudenten);
$this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund);
foreach ($prestudentenData as $prestudent)
{
$this->saveAbsage($prestudent->prestudent_id, $statusgrund);
}
}
}
else
{
foreach($personen as $person)
{
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt);
if (!hasData($prestudent))
continue;
$prestudentData = getData($prestudent);
$this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund);
}
}
$this->outputJsonSuccess("Success");
@@ -14,7 +14,8 @@ class Rueckstellung extends Auth_Controller
'get' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'set' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'delete' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'getStatus' => array('infocenter:rw', 'lehre/zgvpruefung:rw')
'getStatus' => array('infocenter:rw', 'lehre/zgvpruefung:rw'),
'setForPersonen' => array('infocenter:rw', 'lehre/zgvpruefung:rw'),
)
);
@@ -79,7 +80,34 @@ class Rueckstellung extends Auth_Controller
$this->outputJson($result);
}
public function setForPersonen()
{
$personen = $this->input->post('personen');
$datum_bis = $this->input->post('datum_bis');
$status_kurzbz = $this->input->post('status_kurzbz');
foreach ($personen as $person)
{
$rueckstellung = $this->_ci->RueckstellungModel->loadWhere(array('person_id' => $person));
if (hasData($rueckstellung))
continue;
$result = $this->_ci->RueckstellungModel->insert(
array('person_id' => $person,
'status_kurzbz' => $status_kurzbz,
'datum_bis' => date_format(date_create($datum_bis), 'Y-m-d'),
'insertvon' => $this->_uid
)
);
if (isError($result))
$this->terminateWithJsonError(getError($result));
$this->_log($person, $status_kurzbz);
}
$this->outputJsonSuccess("Erfolgreich gespeichert!");
}
public function delete()
{
$person_id = $this->input->post('person_id');
@@ -703,6 +703,22 @@ class Prestudent_model extends DB_Model
return $this->execQuery($query, array($person, $studiengang, $studienSemester));
}
public function getByPersonWithoutLehrgang($person, $studienSemester)
{
$query = "SELECT DISTINCT(ps.prestudent_id)
FROM public.tbl_prestudentstatus pss
JOIN public.tbl_prestudent ps USING(prestudent_id)
JOIN public.tbl_studiengang sg USING(studiengang_kz)
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
WHERE ps.person_id = ?
AND (sg.typ = 'b' OR sg.typ = 'm')
AND pss.studiensemester_kurzbz = ?";
return $this->execQuery($query, array($person, $studienSemester));
}
/**
* Gets förderrelevant flag for a prestudent, from prestudent, or, if not set on prestudent level, from studiengang
* @param int $prestudent_id
@@ -14,12 +14,13 @@
'navigationwidget' => true,
'dialoglib' => true,
'phrases' => array(
'infocenter' => array('statusAuswahl'),
'person' => array('vorname', 'nachname'),
'global' => array('mailAnXversandt'),
'ui' => array('bitteEintragWaehlen')
),
'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'),
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js')
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/rueckstellung.js', 'public/js/infocenter/infocenterPersonDataset.js')
);
$this->load->view('templates/FHC-Header', $includesArray);
@@ -20,7 +20,7 @@
'ui' => array('bitteEintragWaehlen')
),
'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'),
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js')
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/rueckstellung.js', 'public/js/infocenter/infocenterPersonDataset.js')
)
);
?>
@@ -20,7 +20,7 @@
'ui' => array('bitteEintragWaehlen')
),
'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'),
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js')
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/rueckstellung.js', 'public/js/infocenter/infocenterPersonDataset.js')
)
);
?>
@@ -20,7 +20,7 @@
'ui' => array('bitteEintragWaehlen')
),
'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'),
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js')
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/rueckstellung.js', 'public/js/infocenter/infocenterPersonDataset.js')
)
);
?>
@@ -20,7 +20,7 @@
'ui' => array('bitteEintragWaehlen')
),
'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'),
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js')
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/rueckstellung.js', 'public/js/infocenter/infocenterPersonDataset.js')
)
);
?>
@@ -50,12 +50,21 @@ var InfocenterPersonDataset = {
'</select>' +
'<select class="form-control auswahlAbsageAbgeschickt" style="width:auto; float:left;">' +
'<option value="null" selected="selected"> Bewerbung abgeschickt? </option>' +
'<option value="all"> Beide </option>' +
'<option value="true"> Ja </option>' +
'<option value="false"> Nein </option>' +
'</select>' +
'<button class="btn btn-default auswahlAbsageBtn" style="float:left"> Absage </button>';
let rueckstellung = '<br />' +
'<select id="rueckstellungtype" class="form-control" style="width:auto; float:left;">' +
'<option disabled value="null" selected>' + FHC_PhrasesLib.t('infocenter', 'statusAuswahl') + '</option>' +
'</select>' +
'<input id="rueckstellungdate" type="text" class="form-control" style="width:auto; float:left;" placeholder="Parkdatum">' +
'<button class="form-control btn btn-default rueckstellBtn" style="width:auto; float:left"> Zurückstellen </button>';
InfocenterPersonDataset.getAbsageData();
Rueckstellung.getStatus()
var studienSemesterHtml = '<button class="btn btn-default btn-xs decStudiensemester">' +
'<i class="fa fa-chevron-left"></i>' +
@@ -98,10 +107,22 @@ var InfocenterPersonDataset = {
"<div class='row'>"+
"<div class='col-xs-12'>"+auswahlAbsageToggle+"</div>"+
"<div class='col-xs-12' id='absagePunkte' style='display:none'>"+auswahlAbsage+"</div>"+
"<div class='col-xs-12' id='rueckstellung' style='display:none'>"+rueckstellung+"</div>"+
"</div>" +
"<div class='h-divider'></div>" +
"<hr class='studiensemesterline'>"
)
let rueckstelldate = new Date();
rueckstelldate.setDate(rueckstelldate.getDate() + 14);
$('#rueckstellungdate').attr("value", $.datepicker.formatDate("dd.mm.yy", rueckstelldate));
$("#rueckstellungdate").datepicker({
"dateFormat": "dd.mm.yy",
"minDate": 1
});
$("button.incStudiensemester").click(function() {
InfocenterPersonDataset.changeStudiensemesterUservar(1);
});
@@ -123,6 +144,29 @@ var InfocenterPersonDataset = {
$(".absageModalForAll").modal("show");
});
$('button.rueckstellBtn').click(function()
{
let idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]");
if(idsel.length <= 0)
return FHC_DialogLib.alertInfo("Bitte wählen Sie die Personen aus.");
let type = $('#rueckstellungtype').val()
if (type === null)
return FHC_DialogLib.alertInfo("Bitte ein Rückstellgrund auswählen.");
let personen = [];
for (let i = 0; i < idsel.length; i++)
{
personen.push($(idsel[i]).val());
}
let date = $("#rueckstellungdate").val();
Rueckstellung.setForPersons(personen, type, date)
});
$('#saveAbsageForAll').click(function()
{
InfocenterPersonDataset.saveAbsageForAll();
@@ -131,6 +175,7 @@ var InfocenterPersonDataset = {
$('a.absageToggle').click(function()
{
$('#absagePunkte').toggle();
$('#rueckstellung').toggle();
})
var personcount = 0;
@@ -356,6 +401,11 @@ var InfocenterPersonDataset = {
text: value.bezeichnung_mehrsprachig[0]
}))
})
$('.auswahlAbsageStg').append($("<option/>", {
value: 'all',
text: 'Alle'
}))
$.each(data.studiengaenge, function(key, value){
$('.auswahlAbsageStg').append($("<option/>", {
value: value.studiengang,
+27
View File
@@ -87,6 +87,33 @@ var Rueckstellung = {
}
);
},
setForPersons: function(personen, type, date)
{
if (type === null)
return false;
FHC_AjaxClient.ajaxCallPost(
CONTROLLER_RUECKSTELLUNG_URL + '/setForPersonen',
{
"personen": personen,
"datum_bis": date,
"status_kurzbz": type,
},
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.isError(data))
FHC_DialogLib.alertError(FHC_AjaxClient.getError(data));
if (FHC_AjaxClient.hasData(data))
FHC_DialogLib.alertSuccess("Erfolgreich gespeichert.")
},
errorCallback: function(jqXHR, textStatus, errorThrown) {
FHC_DialogLib.alertError(textStatus);
},
veilTimeout: 0
}
);
},
delete: function(personid, status = null)
{
FHC_AjaxClient.ajaxCallPost(