mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
funktion hinzugefuegt um mehrere bewerber abzuweisen und status wird nur angezeigt wenn aktiv
This commit is contained in:
@@ -108,7 +108,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 +435,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);
|
||||
|
||||
@@ -1427,8 +1432,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 +1692,43 @@ 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;
|
||||
$studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(['b', 'm']);
|
||||
|
||||
$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');
|
||||
|
||||
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);
|
||||
|
||||
if(!hasData($prestudent))
|
||||
continue;
|
||||
|
||||
$prestudentData = getData($prestudent);
|
||||
|
||||
$this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund);
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess("Success");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -581,4 +581,17 @@ class Prestudent_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query, array($person_id));
|
||||
}
|
||||
|
||||
public function getPrestudentByStudiengangAndPerson($studiengang, $person)
|
||||
{
|
||||
$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) = ?";
|
||||
|
||||
return $this->execQuery($query, array($person, $studiengang));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,4 +11,17 @@ class Statusgrund_model extends DB_Model
|
||||
$this->dbTable = "public.tbl_status_grund";
|
||||
$this->pk = "statusgrund_id";
|
||||
}
|
||||
|
||||
public function getStatus($status_kurzbz = null, $aktiv = null)
|
||||
{
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,4 +481,17 @@ class Studiengang_model extends DB_Model
|
||||
|
||||
return $this->loadWhere($condition);
|
||||
}
|
||||
|
||||
public function getStudiengaengeWithOrgForm($typ)
|
||||
{
|
||||
$query = "SELECT DISTINCT (UPPER(sg.typ || sg.kurzbz || ':' || sp.orgform_kurzbz)) AS Studiengang
|
||||
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 sg.typ IN ?
|
||||
ORDER BY Studiengang;";
|
||||
|
||||
return $this->execQuery($query, array($typ));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
'ajaxlib' => true,
|
||||
'filterwidget' => true,
|
||||
'navigationwidget' => true,
|
||||
'dialoglib' => true,
|
||||
'phrases' => array(
|
||||
'person' => array('vorname', 'nachname'),
|
||||
'global' => array('mailAnXversandt'),
|
||||
|
||||
@@ -31,6 +31,20 @@ var InfocenterPersonDataset = {
|
||||
var formHtml = '<form id="sendMsgsForm" method="post" action="'+ url +'" target="_blank"></form>';
|
||||
$("#datasetActionsTop").before(formHtml);
|
||||
|
||||
var auswahlAbsageToggle =
|
||||
'<a class="absageToggle">Erweiterte Einstellungen</a>';
|
||||
|
||||
var auswahlAbsage =
|
||||
'<select class="form-control absgstatusgrund" style="width:auto; float:left;">' +
|
||||
'<option value="null" selected="selected"> Absagegrund </option>' +
|
||||
'</select>' +
|
||||
'<select class="form-control auswahlAbsageStg" style="width:auto; float:left;">' +
|
||||
'<option value="null" selected="selected"> Studiengang </option>' +
|
||||
'</select>' +
|
||||
'<button class="btn btn-default auswahlAbsageBtn" style="float:left"> Absage </button>';
|
||||
|
||||
InfocenterPersonDataset.getAbsageData();
|
||||
|
||||
var studienSemesterHtml = '<button class="btn btn-default btn-xs decStudiensemester">' +
|
||||
'<i class="fa fa-chevron-left"></i>' +
|
||||
'</button> ' +
|
||||
@@ -60,6 +74,14 @@ var InfocenterPersonDataset = {
|
||||
"<div class='col-xs-12 text-center'>"+studienSemesterHtml+"</div>"+
|
||||
"</div><div class='h-divider'></div><hr class='studiensemesterline'>");
|
||||
|
||||
$("#datasetActionsBottom").append(
|
||||
"<div class='row'>"+
|
||||
"<div class='col-xs-12'>"+auswahlAbsageToggle+"</div>"+
|
||||
"<div class='col-xs-12' id='absagePunkte' style='display:none'>"+auswahlAbsage+"</div>"+
|
||||
"</div>" +
|
||||
"<div class='h-divider'></div>" +
|
||||
"<hr class='studiensemesterline'>"
|
||||
)
|
||||
$("button.incStudiensemester").click(function() {
|
||||
InfocenterPersonDataset.changeStudiensemesterUservar(1);
|
||||
});
|
||||
@@ -68,6 +90,16 @@ var InfocenterPersonDataset = {
|
||||
InfocenterPersonDataset.changeStudiensemesterUservar(-1);
|
||||
});
|
||||
|
||||
$('button.auswahlAbsageBtn').click(function()
|
||||
{
|
||||
InfocenterPersonDataset.saveAbsageForAll();
|
||||
});
|
||||
|
||||
$('a.absageToggle').click(function()
|
||||
{
|
||||
$('#absagePunkte').toggle();
|
||||
})
|
||||
|
||||
var personcount = 0;
|
||||
|
||||
FHC_AjaxClient.ajaxCallGet(
|
||||
@@ -203,6 +235,81 @@ var InfocenterPersonDataset = {
|
||||
);
|
||||
},
|
||||
|
||||
saveAbsageForAll: function()
|
||||
{
|
||||
var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]");
|
||||
|
||||
if(idsel.length <= 0)
|
||||
return FHC_DialogLib.alertInfo("Bitte wählen Sie die Personen aus.");
|
||||
|
||||
var statusgrund = $('.absgstatusgrund').val();
|
||||
var studiengang = $('.auswahlAbsageStg').val();
|
||||
|
||||
if(statusgrund === 'null' || studiengang === 'null')
|
||||
return FHC_DialogLib.alertInfo("Bitte den Absagegrund und Studiengang auswählen.");
|
||||
|
||||
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_FilterWidget.reloadDataset();
|
||||
|
||||
},
|
||||
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($("<option/>", {
|
||||
value: value.statusgrund_id,
|
||||
text: value.bezeichnung_mehrsprachig[0]
|
||||
}))
|
||||
})
|
||||
$.each(data.studiengaenge, function(key, value){
|
||||
$('.auswahlAbsageStg').append($("<option/>", {
|
||||
value: value.studiengang,
|
||||
text: value.studiengang
|
||||
}))
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
errorCallback: function(jqXHR, textStatus, errorThrown) {
|
||||
console.log(FHC_AjaxClient.getError(jqXHR));
|
||||
FHC_DialogLib.alertError(textStatus);
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
/**
|
||||
* initializes call to get the Studiensemester user variable
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user