auswahl fuer bewerbung abgeschickt ja/nein hinzugefuegt

This commit is contained in:
ma0048
2021-10-04 12:37:50 +02:00
parent 4c156f7f39
commit 4a4c95aa08
3 changed files with 26 additions and 8 deletions
@@ -734,7 +734,7 @@ class InfoCenter extends Auth_Controller
if (hasData($lastStatus) && hasData($statusgrresult))
{
//check if still Interessent
//check if still Interessent, Bewerber or Wartender
if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS
|| $lastStatus->retval[0]->status_kurzbz === self::BEWERBERSTATUS
|| $lastStatus->retval[0]->status_kurzbz === self::WARTENDER)
@@ -2134,17 +2134,18 @@ class InfoCenter extends Auth_Controller
{
$statusgrund = $this->input->post('statusgrund');
$studiengang = $this->input->post('studiengang');
$abgeschickt = $this->input->post('abgeschickt');
$personen = $this->input->post('personen');
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
if ($statusgrund === 'null' || $studiengang === 'null' || empty($personen))
$this->terminateWithJsonError("Bitte Statusgrund, Studiengang und Personen auswählen.");
if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen))
$this->terminateWithJsonError("Bitte füllen Sie alle Felder aus");
foreach($personen as $person)
{
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester);
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt);
if(!hasData($prestudent))
if (!hasData($prestudent))
continue;
$prestudentData = getData($prestudent);
+12 -2
View File
@@ -611,7 +611,7 @@ class Prestudent_model extends DB_Model
));
}
public function getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester)
public function getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt)
{
$query = "SELECT ps.prestudent_id
FROM public.tbl_prestudentstatus pss
@@ -621,7 +621,17 @@ class Prestudent_model extends DB_Model
WHERE ps.person_id = ?
AND UPPER((sg.typ || sg.kurzbz) || ':' || sp.orgform_kurzbz) = ?
AND pss.studiensemester_kurzbz = ?
";
AND";
if ($abgeschickt === 'true')
$query .= " EXISTS";
else
$query .= " NOT EXISTS";
$query .= " (SELECT 1 FROM public.tbl_prestudentstatus spss
JOIN public.tbl_prestudent sps USING(prestudent_id)
WHERE sps.prestudent_id = ps.prestudent_id
AND spss.bewerbung_abgeschicktamum IS NOT NULL)";
return $this->execQuery($query, array($person, $studiengang, $studienSemester));
}
@@ -49,6 +49,11 @@ var InfocenterPersonDataset = {
'<select class="form-control auswahlAbsageStg" style="width:auto; float:left;">' +
'<option value="null" selected="selected"> Studiengang </option>' +
'</select>' +
'<select class="form-control auswahlAbsageAbgeschickt" style="width:auto; float:left;">' +
'<option value="null" selected="selected"> Bewerbung abgeschickt? </option>' +
'<option value="true"> Ja </option>' +
'<option value="false"> Nein </option>' +
'</select>' +
'<button class="btn btn-default auswahlAbsageBtn" style="float:left"> Absage </button>';
InfocenterPersonDataset.getAbsageData();
@@ -327,6 +332,7 @@ var InfocenterPersonDataset = {
var statusgrund = $('.absgstatusgrund').val();
var studiengang = $('.auswahlAbsageStg').val();
var abgeschickt = $('.auswahlAbsageAbgeschickt').val();
var personen = [];
@@ -340,7 +346,8 @@ var InfocenterPersonDataset = {
{
'statusgrund': statusgrund,
'studiengang': studiengang,
'personen' : personen
'personen' : personen,
'abgeschickt' : abgeschickt
},
{
successCallback: function(data, textStatus, jqXHR) {