diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php
index 43de8bb60..7d36690e7 100644
--- a/application/controllers/system/infocenter/InfoCenter.php
+++ b/application/controllers/system/infocenter/InfoCenter.php
@@ -70,6 +70,7 @@ class InfoCenter extends Auth_Controller
const INTERESSENTSTATUS = 'Interessent';
const ABGEWIESENERSTATUS = 'Abgewiesener';
const BEWERBERSTATUS = 'Bewerber';
+ const WARTENDER = 'Wartender';
// Statusgruende for which no Studiengangsfreigabemessage should be sent
private $_statusgruendeNoStgFreigabeMessage = array('FIT Programm', 'FIT program', 'FIT programme');
@@ -108,7 +109,9 @@ class InfoCenter extends Auth_Controller
'setOnHold' => 'infocenter:rw',
'removeOnHold' => 'infocenter:rw',
'getStudienjahrEnd' => 'infocenter:r',
- 'setNavigationMenuArrayJson' => 'infocenter:r'
+ 'setNavigationMenuArrayJson' => 'infocenter:r',
+ 'getAbsageData' => 'infocenter:r',
+ 'saveAbsageForAll' => 'infocenter:rw'
)
);
@@ -433,11 +436,14 @@ class InfoCenter extends Auth_Controller
* Saves Absage for Prestudent including the reason for the Absage (statusgrund).
* inserts Studiensemester and Ausbildungssemester for the new Absage of (chronologically) last status.
*/
- public function saveAbsage()
+ public function saveAbsage($prestudent_id = null, $statusgrund = null)
{
$json = null;
- $prestudent_id = $this->input->post('prestudent_id');
- $statusgrund = $this->input->post('statusgrund');
+ if (is_null($prestudent_id))
+ $prestudent_id = $this->input->post('prestudent_id');
+
+ if (is_null($statusgrund))
+ $statusgrund = $this->input->post('statusgrund');
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id);
@@ -446,8 +452,10 @@ class InfoCenter extends Auth_Controller
if (hasData($lastStatus) && hasData($statusgrresult))
{
- //check if still Interessent and not freigegeben yet
- if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS && !isset($lastStatus->retval[0]->bestaetigtam))
+ //check if still Interessent
+ if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS
+ || $lastStatus->retval[0]->status_kurzbz === self::BEWERBERSTATUS
+ || $lastStatus->retval[0]->status_kurzbz === self::WARTENDER)
{
$result = $this->PrestudentstatusModel->insert(
array(
@@ -1358,6 +1366,8 @@ class InfoCenter extends Auth_Controller
|| isset($zgvpruefung->prestudentstatus->bestaetigtam)
|| $zgvpruefung->prestudentstatus->status_kurzbz != self::INTERESSENTSTATUS;
+ $zgvpruefung->abgewiesener = $zgvpruefung->prestudentstatus->status_kurzbz === self::ABGEWIESENERSTATUS;
+
//wether prestudent was freigegeben for RT/Stg
$zgvpruefung->isRtFreigegeben = false;
$zgvpruefung->isStgFreigegeben = false;
@@ -1427,8 +1437,8 @@ class InfoCenter extends Auth_Controller
$this->_sortPrestudents($zgvpruefungen);
- $abwstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => self::ABGEWIESENERSTATUS))->retval;
- $intstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => self::INTERESSENTSTATUS))->retval;
+ $abwstatusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval;
+ $intstatusgruende = $this->StatusgrundModel->getStatus(self::INTERESSENTSTATUS)->retval;
$data = array (
'zgvpruefungen' => $zgvpruefungen,
@@ -1687,4 +1697,45 @@ class InfoCenter extends Auth_Controller
$this->loglib->logError('Studiengang has no mail for sending Freigabe mail');
}
}
+
+ public function getAbsageData()
+ {
+ $this->load->model('organisation/Studiengang_model', 'StudiengangModel');
+
+ $statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval;
+ $studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
+ $studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(['b', 'm'], $studienSemester);
+
+ $data = array (
+ 'statusgruende' => $statusgruende,
+ 'studiengaenge' => $studiengaenge->retval
+ );
+
+ $this->outputJsonSuccess($data);
+ }
+
+ public function saveAbsageForAll()
+ {
+ $statusgrund = $this->input->post('statusgrund');
+ $studiengang = $this->input->post('studiengang');
+ $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.");
+
+ foreach($personen as $person)
+ {
+ $prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester);
+
+ if(!hasData($prestudent))
+ continue;
+
+ $prestudentData = getData($prestudent);
+
+ $this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund);
+ }
+
+ $this->outputJsonSuccess("Success");
+ }
}
diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php
index 2e014800c..52ba4d9f3 100644
--- a/application/models/crm/Prestudent_model.php
+++ b/application/models/crm/Prestudent_model.php
@@ -581,4 +581,19 @@ class Prestudent_model extends DB_Model
return $this->execQuery($query, array($person_id));
}
+
+ public function getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester)
+ {
+ $query = "SELECT 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)
+ WHERE ps.person_id = ?
+ AND UPPER((sg.typ || sg.kurzbz) || ':' || sp.orgform_kurzbz) = ?
+ AND pss.studiensemester_kurzbz = ?
+ ";
+
+ return $this->execQuery($query, array($person, $studiengang, $studienSemester));
+ }
}
diff --git a/application/models/crm/Statusgrund_model.php b/application/models/crm/Statusgrund_model.php
index 4717a7571..7ab17a45b 100644
--- a/application/models/crm/Statusgrund_model.php
+++ b/application/models/crm/Statusgrund_model.php
@@ -11,4 +11,18 @@ class Statusgrund_model extends DB_Model
$this->dbTable = "public.tbl_status_grund";
$this->pk = "statusgrund_id";
}
+
+ public function getStatus($status_kurzbz = null, $aktiv = null)
+ {
+ $this->addOrder('bezeichnung_mehrsprachig');
+ $where = array();
+ if (!is_null($status_kurzbz))
+ $where['status_kurzbz'] = $status_kurzbz;
+ if (!is_null($aktiv))
+ $where['aktiv'] = $aktiv;
+
+ $status = $this->loadWhere($where);
+
+ return success($status->retval);
+ }
}
diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php
index 8b8be0366..41bdabd11 100644
--- a/application/models/organisation/Studiengang_model.php
+++ b/application/models/organisation/Studiengang_model.php
@@ -481,4 +481,18 @@ class Studiengang_model extends DB_Model
return $this->loadWhere($condition);
}
+
+ public function getStudiengaengeWithOrgForm($typ, $semester)
+ {
+ $query = "SELECT DISTINCT (UPPER(sg.typ || sg.kurzbz || ':' || sp.orgform_kurzbz)) AS Studiengang
+ FROM public.tbl_studiengang sg
+ JOIN lehre.tbl_studienordnung USING (studiengang_kz)
+ JOIN lehre.tbl_studienplan sp USING (studienordnung_id)
+ JOIN lehre.tbl_studienplan_semester spsem USING (studienplan_id)
+ WHERE sp.aktiv = TRUE AND sg.aktiv = TRUE AND sg.typ IN ?
+ AND spsem.studiensemester_kurzbz = ?
+ ORDER BY Studiengang";
+
+ return $this->execQuery($query, array($typ, $semester));
+ }
}
diff --git a/application/views/system/infocenter/absageModal.php b/application/views/system/infocenter/absageModal.php
new file mode 100644
index 000000000..00298945e
--- /dev/null
+++ b/application/views/system/infocenter/absageModal.php
@@ -0,0 +1,35 @@
+
+
+
+
+
+ p->t('infocenter', 'absageBestaetigenTxt') ?>
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php
index 4005518a1..38e644846 100644
--- a/application/views/system/infocenter/infocenter.php
+++ b/application/views/system/infocenter/infocenter.php
@@ -13,6 +13,7 @@
'ajaxlib' => true,
'filterwidget' => true,
'navigationwidget' => true,
+ 'dialoglib' => true,
'phrases' => array(
'person' => array('vorname', 'nachname'),
'global' => array('mailAnXversandt'),
@@ -40,6 +41,7 @@
load->view('system/infocenter/infocenterData.php'); ?>
+ load->view('system/infocenter/absageModal.php'); ?>
diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php
index 0c7030059..5c0d7f105 100644
--- a/application/views/system/infocenter/infocenterData.php
+++ b/application/views/system/infocenter/infocenterData.php
@@ -3,7 +3,7 @@
$APP = '\'infocenter\'';
$REJECTED_STATUS = '\'Abgewiesener\'';
$INTERESSENT_STATUS = '\'Interessent\'';
- $STUDIENGANG_TYP = '\'b\'';
+ $STUDIENGANG_TYP = '\'m\'';
$TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\'';
$LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\', \'Interessent rejected\'';
$LOGDATA_NAME_PARKED = '\'Parked\'';
diff --git a/application/views/system/infocenter/infocenterFreigegeben.php b/application/views/system/infocenter/infocenterFreigegeben.php
index 15e73f1b6..4855e5cd6 100644
--- a/application/views/system/infocenter/infocenterFreigegeben.php
+++ b/application/views/system/infocenter/infocenterFreigegeben.php
@@ -13,6 +13,7 @@
'ajaxlib' => true,
'filterwidget' => true,
'navigationwidget' => true,
+ 'dialoglib' => true,
'phrases' => array(
'person' => array('vorname', 'nachname'),
'global' => array('mailAnXversandt'),
@@ -40,6 +41,7 @@
load->view('system/infocenter/infocenterFreigegebenData.php'); ?>
+ load->view('system/infocenter/absageModal.php'); ?>
diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php
index aab69b651..83e8c8916 100644
--- a/application/views/system/infocenter/infocenterFreigegebenData.php
+++ b/application/views/system/infocenter/infocenterFreigegebenData.php
@@ -2,7 +2,7 @@
$APP = '\'infocenter\'';
$INTERESSENT_STATUS = '\'Interessent\'';
- $STUDIENGANG_TYP = '\'b\'';
+ $STUDIENGANG_TYP = '\'m\'';
$TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\'';
$LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\'';
$REJECTED_STATUS = '\'Abgewiesener\'';
@@ -114,6 +114,12 @@
sg.studiengang_kz in('.$ADDITIONAL_STG.')
)
AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.'
+ AND NOT EXISTS (
+ SELECT 1
+ FROM tbl_prestudentstatus spss
+ WHERE spss.prestudent_id = ps.prestudent_id
+ AND spss.status_kurzbz = '.$REJECTED_STATUS.'
+ )
LIMIT 1
) AS "StgAbgeschickt",
(
diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php
index 79f75885b..f2d838fac 100644
--- a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php
+++ b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php
@@ -13,6 +13,7 @@
'ajaxlib' => true,
'filterwidget' => true,
'navigationwidget' => true,
+ 'dialoglib' => true,
'phrases' => array(
'person' => array('vorname', 'nachname'),
'global' => array('mailAnXversandt'),
@@ -40,6 +41,7 @@
load->view('system/infocenter/infocenterReihungstestAbsolviertData.php'); ?>
+ load->view('system/infocenter/absageModal.php'); ?>
diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php
index 22b122bb0..beb4887ae 100644
--- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php
+++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php
@@ -83,10 +83,11 @@
LIMIT 1
) AS "AnzahlAbgeschickt",
(
- SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz || \':\' || sg.orgform_kurzbz)), \', \')
+ SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz || \':\' || sp.orgform_kurzbz)), \', \')
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)
WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.'
AND pss.bewerbung_abgeschicktamum IS NOT NULL
AND ps.person_id = p.person_id
diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php
index 41b549616..2d00a789d 100644
--- a/application/views/system/infocenter/zgvpruefungen.php
+++ b/application/views/system/infocenter/zgvpruefungen.php
@@ -344,7 +344,7 @@
prestudentstatus->status_kurzbz) && in_array($zgvpruefung->prestudentstatus->status_kurzbz, ['Bewerber', 'Wartender']))) :
?>
- prestudentstatus->bewerbung_abgeschicktamum))
- {
- $disabled = $disabledStg = 'disabled';
- $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt');
- }
+ prestudentstatus->bewerbung_abgeschicktamum))
+ {
+ $disabled = $disabledStg = 'disabled';
+ $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt');
+ }
- if ($studiengangtyp !== 'b')
- {
- $disabled = 'disabled';
- $disabledTxt = $this->p->t('infocenter', 'nurBachelorFreigeben');
+ if ($studiengangtyp !== 'b')
+ {
+ $disabled = 'disabled';
+ $disabledTxt = $this->p->t('infocenter', 'nurBachelorFreigeben');
- // FIT-Lehrgänge: exceptions, can be freigegeben in Infocenter
- if (!in_array($studiengang_kz, $fit_programme_studiengaenge))
- {
- $disabledStg = 'disabled';
- $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorFreigeben');
- }
+ // FIT-Lehrgänge: exceptions, can be freigegeben in Infocenter
+ if (!in_array($studiengang_kz, $fit_programme_studiengaenge))
+ {
+ $disabledStg = 'disabled';
+ $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorFreigeben');
}
- ?>
-
prestudentstatus->status_kurzbz) && $zgvpruefung->prestudentstatus->status_kurzbz === 'Interessent'): ?>
@@ -508,9 +475,69 @@
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+ p->t('infocenter', 'absageBestaetigenTxt') ?>
+
+
+
+
+
+
+
';
$("#datasetActionsTop").before(formHtml);
+ var auswahlAbsageToggle =
+ 'Erweiterte Einstellungen';
+
+ var auswahlAbsage =
+ '' +
+ '' +
+ '';
+
+ InfocenterPersonDataset.getAbsageData();
+
var studienSemesterHtml = ' ' +
@@ -60,6 +74,14 @@ var InfocenterPersonDataset = {
""+studienSemesterHtml+"
"+
"
");
+ $("#datasetActionsBottom").append(
+ ""+
+ "
"+auswahlAbsageToggle+"
"+
+ "
"+auswahlAbsage+"
"+
+ "
" +
+ "" +
+ "
"
+ )
$("button.incStudiensemester").click(function() {
InfocenterPersonDataset.changeStudiensemesterUservar(1);
});
@@ -68,6 +90,29 @@ var InfocenterPersonDataset = {
InfocenterPersonDataset.changeStudiensemesterUservar(-1);
});
+ $('button.auswahlAbsageBtn').click(function()
+ {
+ var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]");
+
+ if(idsel.length <= 0)
+ return FHC_DialogLib.alertInfo("Bitte wählen Sie die Personen aus.");
+
+ if($('.absgstatusgrund').val() === 'null' || $('.auswahlAbsageStg').val() === 'null')
+ return FHC_DialogLib.alertInfo("Bitte den Absagegrund und Studiengang auswählen.");
+
+ $(".absageModalForAll").modal("show");
+ });
+
+ $('#saveAbsageForAll').click(function()
+ {
+ InfocenterPersonDataset.saveAbsageForAll();
+ });
+
+ $('a.absageToggle').click(function()
+ {
+ $('#absagePunkte').toggle();
+ })
+
var personcount = 0;
FHC_AjaxClient.ajaxCallGet(
@@ -203,6 +248,75 @@ var InfocenterPersonDataset = {
);
},
+ saveAbsageForAll: function()
+ {
+ var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]");
+
+ var statusgrund = $('.absgstatusgrund').val();
+ var studiengang = $('.auswahlAbsageStg').val();
+
+ var personen = [];
+
+ for (var i = 0; i < idsel.length; i++)
+ {
+ personen.push($(idsel[i]).val());
+ }
+
+ FHC_AjaxClient.ajaxCallPost(
+ 'system/infocenter/InfoCenter/saveAbsageForAll',
+ {
+ 'statusgrund': statusgrund,
+ 'studiengang': studiengang,
+ 'personen' : personen
+ },
+ {
+ 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.")
+
+ $(".absageModalForAll").modal("hide");
+ },
+ errorCallback: function(jqXHR, textStatus, errorThrown) {
+ FHC_DialogLib.alertError(textStatus);
+ }
+ }
+ );
+ },
+
+ getAbsageData: function()
+ {
+ FHC_AjaxClient.ajaxCallGet(
+ 'system/infocenter/InfoCenter/getAbsageData',
+ {},
+ {
+ successCallback: function(data, textStatus, jqXHR) {
+ if (FHC_AjaxClient.hasData(data))
+ {
+ data = FHC_AjaxClient.getData(data);
+ $.each(data.statusgruende, function(key, value){
+ $('.absgstatusgrund').append($("", {
+ value: value.statusgrund_id,
+ text: value.bezeichnung_mehrsprachig[0]
+ }))
+ })
+ $.each(data.studiengaenge, function(key, value){
+ $('.auswahlAbsageStg').append($("", {
+ value: value.studiengang,
+ text: value.studiengang
+ }))
+ })
+
+ }
+ },
+ errorCallback: function(jqXHR, textStatus, errorThrown) {
+ FHC_DialogLib.alertError(textStatus);
+ }
+ }
+ );
+ },
/**
* initializes call to get the Studiensemester user variable
*/