Dropdown Status Aendern, Phrases

This commit is contained in:
ma0068
2024-05-21 11:47:24 +02:00
parent 1f45ddc17d
commit 9cade51ff4
4 changed files with 317 additions and 54 deletions
@@ -98,7 +98,7 @@ class Status extends FHCAPI_Controller
//Variablen für Statuscheck
$stg = $result->studiengang_kz;
$reihungstest_angetreten = $result->reihungstestangetreten;
//$name = trim($result->vorname . " ". $result->nachname);
$name = trim($result->vorname . " ". $result->nachname);
$zgv_code = $result->zgv_code;
$isStudent = false;
@@ -141,11 +141,15 @@ class Status extends FHCAPI_Controller
$lastStatusData = current(getData($result));
//Different handling depending on newStatus
/* if($status_kurzbz == 'Absolvent' || $status_kurzbz == 'Diplomand')
{
//$studiensemester = $semester_aktuell;
$ausbildungssemester = $lastStatusData->ausbildungssemester;
}*/
if($status_kurzbz == 'Abbrecher' || $status_kurzbz == 'Unterbrecher')
{
$ausbildungssemester = $lastStatusData->ausbildungssemester;
$studiensemester_kurzbz = $lastStatusData->studiensemester_kurzbz;
}
if($status_kurzbz == 'Absolvent' || $status_kurzbz == 'Diplomand')
{
$ausbildungssemester = $lastStatusData->ausbildungssemester;
}
/* if($status_kurzbz != 'Student')
{
@@ -176,7 +180,7 @@ class Status extends FHCAPI_Controller
{
if($status_kurzbz=='Bewerber' && !$reihungstest_angetreten)
{
return $this->terminateWithError($this->p->t('lehre','error_keinReihungstestverfahren', $name), self::ERROR_TYPE_GENERAL);
return $this->terminateWithError($this->p->t('lehre','error_keinReihungstestverfahren', ['name' => $name]), self::ERROR_TYPE_GENERAL);
}
}
@@ -186,7 +190,7 @@ class Status extends FHCAPI_Controller
{
if($status_kurzbz=='Bewerber' && $zgv_code=='')
{
return $this->terminateWithError($this->p->t('lehre','error_ZGVNichtEingetragen', $name), self::ERROR_TYPE_GENERAL);
return $this->terminateWithError($this->p->t('lehre','error_ZGVNichtEingetragen', ['name' => $name]), self::ERROR_TYPE_GENERAL);
}
}
@@ -209,7 +213,7 @@ class Status extends FHCAPI_Controller
{
if($status_kurzbz=='Bewerber' && $zgv_code=='' && $typ=='m')
{
return $this->terminateWithError($this->p->t('lehre','error_ZGVMasterNichtEingetragen', $name), self::ERROR_TYPE_GENERAL);
return $this->terminateWithError($this->p->t('lehre','error_ZGVMasterNichtEingetragen', ['name' => $name]), self::ERROR_TYPE_GENERAL);
}
}
@@ -224,7 +228,7 @@ class Status extends FHCAPI_Controller
}
if($result->retval == "0")
{
return $this->terminateWithError($this->p->t('lehre','error_keinBewerber', $name), self::ERROR_TYPE_GENERAL);
return $this->terminateWithError($this->p->t('lehre','error_keinBewerber', ['name' => $name]), self::ERROR_TYPE_GENERAL);
}
}
@@ -274,6 +278,7 @@ class Status extends FHCAPI_Controller
}
//check if Bismeldestichtag erreicht
//TODO(manu) Test...
$this->load->model('codex/Bismeldestichtag_model', 'BismeldestichtagModel');
$result = $this->BismeldestichtagModel->checkIfMeldestichtagErreicht($new_status_datum);
if (isError($result))
@@ -660,6 +665,7 @@ class Status extends FHCAPI_Controller
'studiensemester_kurzbz' => $studiensemester_kurzbz
)
);
if ($this->db->trans_status() === false || isError($result) || !hasData($result))
{
$this->db->trans_rollback();
@@ -667,11 +673,8 @@ class Status extends FHCAPI_Controller
return $this->terminateWithError($this->p->t('lehre','error_duringDeleteLehrverband'), self::ERROR_TYPE_GENERAL);
}
$this->terminateWithSuccess(true);
}
//Delete Prestudent if no data is left
if($deletePrestudent && $isBerechtigtAdmin)
{
//TODO(manu) check all connected tables, Handling of Deletion
@@ -726,7 +729,7 @@ class Status extends FHCAPI_Controller
);
if (isError($result) || !hasData($result))
{
//TODO(Manu) in these case: löschen stautus erlauben aber rückmeldung, dass Prestudent nicht gelöscht wurde
//TODO(Manu) in this case: löschen stautus erlauben aber rückmeldung, dass Prestudent nicht gelöscht wurde
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
}
@@ -940,9 +943,7 @@ class Status extends FHCAPI_Controller
//check if Bismeldestichtag erreicht
if(!$isBerechtigtNoStudstatusCheck)
{
// only check datum (without semester)
$this->load->model('codex/Bismeldestichtag_model', 'BismeldestichtagModel');
/* $result = $this->BismeldestichtagModel->checkIfMeldestichtagErreicht($datum, $studiensemester_kurzbz);*/
$result = $this->BismeldestichtagModel->checkIfMeldestichtagErreicht($datum);
if (isError($result))
{
@@ -414,7 +414,7 @@ class Prestudentstatus_model extends DB_Model
elseif (!hasData($result))
{
$person = $name ? $name : "Person";
return success("0", $person . " muss zuerst zum Bewerber gemacht werden!");
return success("0", $this->p->t('lehre','error_keinBewerber', ['name' => $person]));
}
else
{
@@ -448,25 +448,23 @@ class Prestudentstatus_model extends DB_Model
{
return error($result);
}
else
$resultObject = current(getData($result));
if (property_exists($resultObject, 'anzahl'))
{
$resultObject = current(getData($result));
if (property_exists($resultObject, 'anzahl'))
$anzahl = (int) $resultObject->anzahl;
if ($anzahl <= 1 )
{
$anzahl = (int) $resultObject->anzahl;
if ($anzahl <= 1 )
{
return success ("1", "Die letzte Rolle kann nur durch den Administrator geloescht werden");
}
else
return success("0", $anzahl . " Rollen vorhanden");
return success("1", $this->p->t('lehre','error_lastRole'));
}
else
{
return error("PrestudentstatusModel: Error During Check if Last Status Entry.");
}
return success("0", $this->p->t('lehre','anzahl_existingRoles', ['anzahl' => $anzahl]));
}
else
{
return error($result);
}
}
@@ -482,7 +480,7 @@ class Prestudentstatus_model extends DB_Model
if($new_status_datum < $today)
{
return error("Datum eines neuen Statuseintrags darf nicht in der Vergangenheit liegen ");
return error($this->p->t('lehre','error_entryInPast'));
}
else
{
@@ -511,14 +509,14 @@ class Prestudentstatus_model extends DB_Model
return $this->outputJson(getError($result));
}
elseif(!hasData($result)) {
return error("Kein Eintrag für Studiensemester vorhanden! :-/" . $new_status_studiensemester_kurzbz);
return error($this->p->t('lehre','error_noStudiensemester') . $new_status_studiensemester_kurzbz);
}
$studiensemester = current($result->retval);
$new_status_semesterstart = $studiensemester->start;
//get all prestudentstati
//TODO(manu) errorlogic
//TODO(manu) check errorlogic
$resultPs = $this->getAllPrestudentstatiWithStudiensemester($prestudent_id);
if (isError($resultPs))
{
@@ -537,14 +535,15 @@ class Prestudentstatus_model extends DB_Model
$new_status_datum_form = new DateTime($new_status_datum);
$new_status_semesterstart_form = new DateTime($new_status_semesterstart);
foreach ($resultArr as $row)
{
$studiensemester_start = new DateTime($row->studiensemester_start);
$status_datum = new DateTime ($row->datum);
if ($new_status_datum_form >= $status_datum && $new_status_semesterstart_form >= $studiensemester_start) {
if ($new_status_datum_form >= $status_datum && $new_status_semesterstart_form >= $studiensemester_start)
{
if (!$newStatusInserted)
{
// neuer Status erstmals größer als Datum eines bestehenden Status -> neuen Status EINMALIG einfügen für spätere Statusprüfung
@@ -558,13 +557,14 @@ class Prestudentstatus_model extends DB_Model
}
$statusArr[] = $row;
}
elseif($new_status_datum_form <= $status_datum && $new_status_semesterstart_form <= $studiensemester_start){
elseif($new_status_datum_form <= $status_datum && $new_status_semesterstart_form <= $studiensemester_start)
{
$statusArr[] = $row;
}
else
{
return error("Datum des Statuseintrags muss nach dem Statusdatum, das Semesterstartdatum nach Semesterstartdatum des vorherigen Statuseintrags sein");
return error($this->p->t('lehre','error_statuseintrag'));
}
}
@@ -579,9 +579,9 @@ class Prestudentstatus_model extends DB_Model
$next_status = isset($statusArr[$next_idx]) ? $statusArr[$next_idx] : null;
// Abbrecher- oder Absolventenstatus muss Endstatus sein
if (isset($next_status) && in_array($curr_status_kurzbz, $endstatusArr)) {
return error($name . "Nach Abbrecher- und Absolventenstatus darf kein anderer Status mehr eingetragen werden");
if (isset($next_status) && in_array($curr_status_kurzbz, $endstatusArr))
{
return error($name . $this->p->t('lehre','error_endstatus'));
}
// wenn Unterbrecher auf Unterbrecher folgt, muss Ausbildungssemester gleich sein
@@ -590,7 +590,7 @@ class Prestudentstatus_model extends DB_Model
&& $curr_status_ausbildungssemester != $next_status->ausbildungssemester
)
{
return error($name . "Aufeinanderfolgende Unterbrecher müssen gleiches Ausbildungssemester haben");
return error($name . $this->p->t('lehre','error_consecutiveUnterbrecher'));
}
// wenn Abbrecher auf Unterbrecher folgt, muss Ausbildungssemester gleich sein
@@ -599,7 +599,7 @@ class Prestudentstatus_model extends DB_Model
&& $next_status->status_kurzbz == 'Abbrecher' && $curr_status_ausbildungssemester != $next_status->ausbildungssemester
)
{
return error($name ."Unterbrecher und folgender Abbrecher müssen gleiches Ausbildungssemester haben");
return error($name . $this->p->t('lehre','error_consecutiveUnterbrecherAbbrecher'));
}
// keine Studenten nach Diplomand Status
@@ -607,14 +607,11 @@ class Prestudentstatus_model extends DB_Model
isset($next_status) && $curr_status_kurzbz == 'Diplomand' && $next_status->status_kurzbz == 'Student'
)
{
return error($name . "Nach Diplomandenstatus darf kein Studentenstatus mehr eingetragen werden");
return error($name . $this->p->t('lehre','error_consecutiveDiplomandStudent'));
}
}
//return $statusArr; //rot
//return $resultPs->retval; //rot
//TODO(Manu) check, warum Fehlermeldung bei anderem returnwert!
return $resultPs;
}
@@ -645,7 +642,7 @@ class Prestudentstatus_model extends DB_Model
return error($result);
}
if (!hasData($result)) {
return success("0",'No Statusdata vorhanden');
return success("0", $this->p->t('lehre','error_noStatusFound'));
}
return $result;
@@ -1067,6 +1067,30 @@ export default{
</template>
</BsModal>
<ul class="dropdown-menu" ref="addMultiStatus3" id="addMultiStatus3">
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'abbrecherStgl', 'Abbrecher')">Abbrecher durch Stgl</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'abbrecherStud','Abbrecher')">Abbrecher durch Student</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'unterbrecher','Unterbrecher')">Unterbrecher</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'student','Student')">Student</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'student','Wiederholer')">Wiederholer</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="changeStatusToDiplomand(prestudentIds)">Diplomand</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="changeStatusToAbsolvent(prestudentIds)">Absolvent</a>
</li>
</ul>
<!--Modal: askForAusbildungssemester-->
<BsModal ref="askForAusbildungssemester">
<template #title>{{$p.t('lehre', 'status_edit')}}</template>
@@ -1117,19 +1141,80 @@ export default{
>
<template #actions="{updateData2}">
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addMultiStatus">
<!-- <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addMultiStatus">
Status Ändern
</button>
</template>
</button>-->
<div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
Status Ändern
</button>
<ul class="dropdown-menu">
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'abbrecherStgl', 'Abbrecher')">Abbrecher durch Stgl</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'abbrecherStud','Abbrecher')">Abbrecher durch Student</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'unterbrecher','Unterbrecher')">Unterbrecher</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'student','Student')">Student</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'student','Wiederholer')">Wiederholer</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="changeStatusToDiplomand(prestudentIds)">Diplomand</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="changeStatusToAbsolvent(prestudentIds)">Absolvent</a>
</li>
</ul>
</div>
</core-filter-cmpt>
<div
v-if="this.modelValue.length"
ref="buttonsStatusMulti"
>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addMultiStatus">
<!-- <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addMultiStatus">
Status Ändern
</button>
</button>-->
<div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
Status Ändern
</button>
<ul class="dropdown-menu">
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'abbrecherStgl', 'Abbrecher')">Abbrecher durch Stgl</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'abbrecherStud','Abbrecher')">Abbrecher durch Student</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'unterbrecher','Unterbrecher')">Unterbrecher</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'student','Student')">Student</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="actionConfirmDialogue(updateData, 'student','Wiederholer')">Wiederholer</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="changeStatusToDiplomand(prestudentIds)">Diplomand</a>
</li>
<li class="dropdown-submenu">
<a class="dropdown-item" @click="changeStatusToAbsolvent(prestudentIds)">Absolvent</a>
</li>
</ul>
</div>
</div>
</div>`
+180
View File
@@ -27882,6 +27882,186 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'error_statuseintrag',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Datum des Statuseintrags muss nach dem Statusdatum, das Semesterstartdatum nach Semesterstartdatum des vorherigen Statuseintrags sein',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error: Date of the status entry must be after the start date, the semester start date after the semester start date of the previous status entry',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'error_endstatus',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Nach Abbrecher- und Absolventenstatus darf kein anderer Status mehr eingetragen werden',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error: No other status may be entered after the dropout and graduate status',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'error_consecutiveUnterbrecher',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Aufeinanderfolgende Unterbrecher müssen gleiches Ausbildungssemester haben',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error: Successive interrupters must have the same education semester',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'error_consecutiveUnterbrecherAbbrecher',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Unterbrecher und folgender Abbrecher müssen gleiches Ausbildungssemester haben',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error: interrupter and following dropout must have the same education semester',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'error_consecutiveDiplomandStudent',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Nach Diplomandenstatus darf kein Studentenstatus mehr eingetragen werden',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error: Student status may not be entered after graduate status',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'error_noStudiensemester',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Kein Eintrag für Studiensemester vorhanden',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error: no entry for study semester',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'anzahl_existingRoles',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => '{anzahl} Rollen vorhanden',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => '{anzahl} existing roles',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'error_entryInPast',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Datum eines neuen Statuseintrags darf nicht in der Vergangenheit liegen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error: The date of a new status entry cannot be in the past',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'error_lastRole',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Die letzte Rolle kann nur durch den Administrator gelöscht werden',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error: The last role can only be deleted by the administrator',
'description' => '',
'insertvon' => 'system'
)
)
),
);