mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 07:52:16 +00:00
first preselection for the aliquote reduction
This commit is contained in:
@@ -1724,7 +1724,7 @@ class prestudent extends person
|
||||
* @param $studiengang_kz
|
||||
* @return array mit allen Prestudenten, welche sich für den angegebenen Studienplan im angegebenen Semester beworben haben
|
||||
*/
|
||||
public function getAllBewerberFromStudienplanStudsem($studienplan_id, $studiensemester_kurzbz, $studiengang_kz)
|
||||
public function getAllStudentenFromStudienplanAndStudsem($studienplan_id, $studiensemester_kurzbz, $studiengang_kz)
|
||||
{
|
||||
if(!is_numeric($studienplan_id))
|
||||
{
|
||||
@@ -1746,7 +1746,6 @@ class prestudent extends person
|
||||
LEFT JOIN bis.tbl_zgvgruppe USING(gruppe_kurzbz)
|
||||
WHERE
|
||||
tbl_prestudent.studiengang_kz=". $this->db_add_param($studiengang_kz)."
|
||||
AND (get_rolle_prestudent(prestudent_id, null)='Bewerber' OR get_rolle_prestudent(prestudent_id, null)='Wartender')
|
||||
AND EXISTS(
|
||||
SELECT
|
||||
1
|
||||
|
||||
@@ -61,7 +61,7 @@ switch($action)
|
||||
$studiensemester_kurzbz = $_REQUEST["studiensemester_kurzbz"];
|
||||
|
||||
$prestudent = new prestudent();
|
||||
$return = $prestudent->getAllBewerberFromStudienplanStudsem($studienplan_id, $studiensemester_kurzbz, $studiengang_kz);
|
||||
$return = $prestudent->getAllStudentenFromStudienplanAndStudsem($studienplan_id, $studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
returnAJAX(true,json_encode($return));
|
||||
break;
|
||||
|
||||
@@ -29,6 +29,15 @@
|
||||
<?php require_once(dirname(__FILE__)."/../../include/meta/angular.php"); ?>
|
||||
<?php require_once(dirname(__FILE__)."/../../include/meta/angular-tablesorter.php"); ?>
|
||||
<?php require_once(dirname(__FILE__)."/../../include/meta/js_utils.php"); ?>
|
||||
<style>
|
||||
.applicant
|
||||
{
|
||||
}
|
||||
.no_applicant
|
||||
{
|
||||
color:#999;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function sortStudiengaenge(a,b)
|
||||
@@ -40,6 +49,15 @@
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
function sortStudentenRTP(a,b)
|
||||
{
|
||||
if (a.rt_gesamtpunkte < b.rt_gesamtpunkte)
|
||||
return -1;
|
||||
else if (a.rt_gesamtpunkte > b.rt_gesamtpunkte)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
var aliquoteReduktion = angular.module('aliqRed',['tableSort']).controller('aliqRedController',function($scope)
|
||||
@@ -81,7 +99,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
aqr.submit = function()
|
||||
{
|
||||
if(aqr.choosenStuds < aqr.selectedStudienplan.apz)
|
||||
@@ -165,15 +182,78 @@
|
||||
AJAXCall({action:"getStudenten",studiengang_kz:aqr.selectedStudiengang.studiengang_kz,studienplan_id:aqr.selectedStudienplan.studienplan_id,studiensemester_kurzbz:aqr.selectedStudiensemester.studiensemester_kurzbz},function(res)
|
||||
{
|
||||
aqr.studenten=res;
|
||||
aqr.studenten.forEach(function(i)
|
||||
{
|
||||
if(i.laststatus=='Wartender'||i.laststatus=='Bewerber')
|
||||
i.applicant = true;
|
||||
else if(i.laststatus=='Student'||i.laststatus=='Aufgenommener')
|
||||
i.selected=true;
|
||||
});
|
||||
aqr.doPreselection();
|
||||
aqr.countChoosen();
|
||||
$scope.$apply();
|
||||
});
|
||||
}
|
||||
|
||||
aqr.getZGVArray = function()
|
||||
{
|
||||
var ret = [];
|
||||
aqr.studenten.forEach(function(i)
|
||||
{
|
||||
if(i.bezeichnung != null && ret.indexOf(i.bezeichnung) < 0)
|
||||
ret.push(i.bezeichnung);
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
|
||||
aqr.getAcceptedCount = function()
|
||||
{
|
||||
var ret = 0;
|
||||
aqr.studenten.forEach(function(i)
|
||||
{
|
||||
if(i.laststatus=='Student'||i.laststatus=='Aufgenommener')
|
||||
ret++;
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
|
||||
aqr.doPreselection = function()
|
||||
{
|
||||
if(parseInt(aqr.selectedStudienplan.apz) >= 0)
|
||||
{
|
||||
aqr.studenten.sort(sortStudentenRTP);
|
||||
var zgvs = aqr.getZGVArray();
|
||||
var neededStudentsCount = aqr.selectedStudienplan.apz - aqr.getAcceptedCount();
|
||||
var perZGV = parseInt(neededStudentsCount / zgvs.length);
|
||||
var zgvElems = [];
|
||||
|
||||
zgvs.forEach(function(i)
|
||||
{
|
||||
zgvElems.push({name:i,needed:perZGV});
|
||||
});
|
||||
|
||||
aqr.studenten.forEach(function(i)
|
||||
{
|
||||
if(i.laststatus=='Wartender'||i.laststatus=='Bewerber')
|
||||
{
|
||||
zgvElems.forEach(function(j)
|
||||
{
|
||||
if(j.needed > 0 && !i.selected && i.bezeichnung == j.name)
|
||||
{
|
||||
i.selected = true;
|
||||
j.needed --;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="Background_main">
|
||||
<div ng-controller="aliqRedController as aqr" ng-app="aliqRed">
|
||||
<h2>{{aqr.name}} {{aqr.selectedStudiengang.studiengang_kz}} {{aqr.selectedStudienplan.studienplatz_id}} </h2>
|
||||
<h2>{{aqr.name}} {{aqr.selectedStudiengang.studiengang_kz}}</h2>
|
||||
|
||||
<select data-ng-options="stg.kurzbzlang for stg in aqr.studiengaenge" data-ng-model="aqr.selectedStudiengang"></select>
|
||||
<select data-ng-options="stsem.studiensemester_kurzbz for stsem in aqr.studiensemester" data-ng-model="aqr.selectedStudiensemester"></select>
|
||||
@@ -182,6 +262,7 @@
|
||||
<span ng-if="aqr.studenten.length > 1">{{aqr.studenten.length}} Studenten</span>
|
||||
<span ng-if="aqr.studenten.length < 1">keine Student</span>
|
||||
|
||||
<h3>Auswahl</h3>
|
||||
<table ts-wrapper>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -192,11 +273,11 @@
|
||||
<th ts-criteria="rt_gesamtpunkte|parseFloat" ts-default="descending">RT Gesamt</th>
|
||||
<th ts-criteria="laststatus">Status</th>
|
||||
<th ng-if="aqr.selectedStudienplan.apz">{{aqr.choosenStuds}}/{{aqr.selectedStudienplan.apz}}</th>
|
||||
<th ng-if="!aqr.selectedStudienplan.apz">Keine APZ</th>
|
||||
<th ng-if="!aqr.selectedStudienplan.apz">{{aqr.choosenStuds}}/Keine APZ</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="stud in aqr.studenten track by stud.prestudent_id" ng-click="aqr.countChoosen()" ts-repeat ts-hide-no-data>
|
||||
<tr ng-repeat="stud in aqr.studenten track by stud.prestudent_id" ng-if="stud.applicant" ng-click="aqr.countChoosen()" ts-repeat ts-hide-no-data ng-class="{true:'applicant', false:'no_applicant', undefined:'no_applicant'}[stud.applicant]"><!-- "{applicant, no_applicant : stud.applicant}">-->
|
||||
<td>{{stud.prestudent_id}}</td>
|
||||
<td>{{stud.vorname}}</td>
|
||||
<td>{{stud.nachname}}</td>
|
||||
@@ -204,12 +285,46 @@
|
||||
<td ng-if="!stud.bezeichnung" style="font-weight: bold;">Keine Angabe</td>
|
||||
<td>{{stud.rt_gesamtpunkte}}</td>
|
||||
<td>{{stud.laststatus}}</td>
|
||||
<td><input ng-if="aqr.selectedStudienplan.apz" type="checkbox" ng-model="stud.selected"/></td>
|
||||
<td>
|
||||
<input ng-if="stud.applicant" type="checkbox" ng-model="stud.selected"/>
|
||||
<input ng-if="!stud.applicant" type="checkbox" ng-model="stud.selected" disabled="disabled"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<input style="float:right;" type="button" value="Annehmen" ng-click="aqr.submit()"/>
|
||||
|
||||
<h3>Bereits aufgenommene</h3>
|
||||
<table ts-wrapper>
|
||||
<thead>
|
||||
<tr>
|
||||
<th ts-criteria="prestudent_id">ID</th>
|
||||
<th ts-criteria="vorname">Vorname</th>
|
||||
<th ts-criteria="nachname">Nachname</th>
|
||||
<th ts-criteria="bezeichnung" ts-default="descending">ZGV Gruppe</th>
|
||||
<th ts-criteria="rt_gesamtpunkte|parseFloat" ts-default="descending">RT Gesamt</th>
|
||||
<th ts-criteria="laststatus">Status</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="stud in aqr.studenten track by stud.prestudent_id" ng-if="!stud.applicant" ng-click="aqr.countChoosen()" ts-repeat ts-hide-no-data ng-class="{true:'applicant', false:'no_applicant', undefined:'no_applicant'}[stud.applicant]"><!-- "{applicant, no_applicant : stud.applicant}">-->
|
||||
<td>{{stud.prestudent_id}}</td>
|
||||
<td>{{stud.vorname}}</td>
|
||||
<td>{{stud.nachname}}</td>
|
||||
<td ng-if="stud.bezeichnung">{{stud.bezeichnung}}</td>
|
||||
<td ng-if="!stud.bezeichnung" style="font-weight: bold;">Keine Angabe</td>
|
||||
<td>{{stud.rt_gesamtpunkte}}</td>
|
||||
<td>{{stud.laststatus}}</td>
|
||||
<td>
|
||||
<input ng-if="stud.applicant" type="checkbox" ng-model="stud.selected"/>
|
||||
<input ng-if="!stud.applicant" type="checkbox" ng-model="stud.selected" disabled="disabled"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user