mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4567c3db00 | ||
|
|
c8d49a793f |
@@ -152,6 +152,8 @@ class Unterbrechung extends FHCAPI_Controller
|
||||
$this->terminateWithError($this->p->t('studierendenantrag', 'error_no_student'), self::ERROR_TYPE_GENERAL);
|
||||
elseif ($result == -3)
|
||||
$this->terminateWithError($this->p->t('studierendenantrag', 'error_stg_blacklist'), self::ERROR_TYPE_GENERAL);
|
||||
elseif ($result == -4)
|
||||
$this->terminateWithError($this->p->t('studierendenantrag', 'error_regarding_law'), self::ERROR_TYPE_GENERAL);
|
||||
elseif ($result < 0)
|
||||
$this->terminateWithError($this->p->t('studierendenantrag', 'error_antrag_exists'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ class Studierendenantrag extends FHC_Controller
|
||||
// Load Models
|
||||
$this->load->model('education/Studierendenantrag_model', 'StudierendenantragModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->model('crm/Prestudenstatus_model', 'PrestudentstatusModel');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
@@ -55,7 +56,8 @@ class Studierendenantrag extends FHC_Controller
|
||||
'allowedNewTypes' => array(),
|
||||
'antraege'=> array(),
|
||||
'bezeichnungStg' => $antrag->bezeichnung,
|
||||
'bezeichnungOrgform' => $antrag->orgform
|
||||
'bezeichnungOrgform' => $antrag->orgform,
|
||||
'hasStatusUnterbrecher' => false
|
||||
);
|
||||
|
||||
if ($this->config->item('wiederholung_enabled') === true)
|
||||
@@ -70,6 +72,18 @@ class Studierendenantrag extends FHC_Controller
|
||||
$result = $this->antraglib->getPrestudentUnterbrechungsBerechtigt($antrag->prestudent_id);
|
||||
if (getData($result) == 1)
|
||||
$prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Unterbrechung';
|
||||
|
||||
//enabled for one semester
|
||||
if (getData($result) == 2){
|
||||
$prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Unterbrechung';
|
||||
$prestudentenArr[$antrag->prestudent_id]['enabledForOneSemester'] = true;
|
||||
//TODO(Manu) check: other actions?
|
||||
}
|
||||
//not enabled according to examination regulations, triggers Modal
|
||||
if (getData($result) == -4){
|
||||
$prestudentenArr[$antrag->prestudent_id]['allowedNewTypes'][] = 'Unterbrechung';
|
||||
$prestudentenArr[$antrag->prestudent_id]['hasStatusUnterbrecher'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->config->item('abmeldung_enabled') === true)
|
||||
@@ -213,4 +227,4 @@ class Studierendenantrag extends FHC_Controller
|
||||
|
||||
return $strRequiredPermissions;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1424,12 +1424,22 @@ class AntragLib
|
||||
*
|
||||
* @return \stdClass on success retval 0 means not a student;
|
||||
* retval 1 means Berechtigt;
|
||||
* retval 2 means Berechtigt, but just for another additional semester
|
||||
* retval -1 means has already an Antrag pending;
|
||||
* retval -2 means other Antrag pending;
|
||||
* retval -3 means in blacklist stg
|
||||
* retval -4 means not Berechtigt regarding examination regulations
|
||||
*/
|
||||
public function getPrestudentUnterbrechungsBerechtigt($prestudent_id, $studiensemester_kurzbz = null, $datum_wiedereinstieg = null)
|
||||
{
|
||||
// check if berechtigt according to examination regulations
|
||||
$allowedRegardingLaw = $this->_ci->PrestudentstatusModel->isUnterbrechungsberechtigtRegardingLaw($prestudent_id);
|
||||
|
||||
if($allowedRegardingLaw == 1)
|
||||
return success(2);
|
||||
if($allowedRegardingLaw < 0)
|
||||
return success(-4);
|
||||
|
||||
$result = $this->_ci->PrestudentModel->load($prestudent_id);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
@@ -2199,4 +2209,4 @@ class AntragLib
|
||||
$result = $this->_ci->StudierendenantraglehrveranstaltungModel->getLvsForPrestudent($prestudent_id, $studiensemester_kurzbz);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -661,4 +661,49 @@ class Prestudentstatus_model extends DB_Model
|
||||
'status_kurzbz' => self::STATUS_BEWERBER
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a prestudent is allowed to interrupt regarding examination regulations
|
||||
*
|
||||
* @param integer $prestudent_id
|
||||
*
|
||||
* @return \stdClass on success retval 0 means no Unterbrecher status in history;
|
||||
* retval 1 means one Unterbrecher status, but in the last semester
|
||||
* retval -1 means one Unterbrecher status in the past but not last semester
|
||||
* retval -2 means more than one Unterbrecherstati
|
||||
*/
|
||||
public function isUnterbrechungsberechtigtRegardingLaw($prestudent_id)
|
||||
{
|
||||
$this->addSelect('COUNT(*) AS anzahl', false);
|
||||
|
||||
$result = $this->loadWhere([
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => self::STATUS_UNTERBRECHER
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$count = current(getData($result));
|
||||
|
||||
if($count->anzahl == 1)
|
||||
{
|
||||
$result = $this->getLastStatus($prestudent_id);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
if (!hasData($result))
|
||||
return success(0);
|
||||
$result = current(getData($result));
|
||||
$lastStatus = $result->status_kurzbz;
|
||||
if($lastStatus == self::STATUS_UNTERBRECHER)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
elseif ($count->anzahl == 0)
|
||||
return 0;
|
||||
else
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,9 @@ if(defined('CIS4')){
|
||||
if($type == 'Abmeldung' && $showInfoModalAbmeldung){
|
||||
$href = "#modalinfo" . $prestudent_id;
|
||||
}
|
||||
elseif($type == 'Unterbrechung' && $array['hasStatusUnterbrecher']){
|
||||
$href = "#modalalreadyinterruptor" . $prestudent_id;
|
||||
}
|
||||
else
|
||||
$href = site_url('lehre/Studierendenantrag/' . strtolower($type) . '/' . $prestudent_id);
|
||||
?>
|
||||
@@ -67,10 +70,52 @@ if(defined('CIS4')){
|
||||
<?php if($type == 'Abmeldung' && $showInfoModalAbmeldung): ?>
|
||||
data-bs-toggle="modal"
|
||||
<?php endif; ?>
|
||||
<?php if($type == 'Unterbrechung' && $array['hasStatusUnterbrecher']): ?>
|
||||
data-bs-toggle="modal"
|
||||
<?php endif; ?>
|
||||
>
|
||||
<i class="fa fa-plus"></i> <?= $this->p->t('studierendenantrag', 'antrag_typ_' . $type); ?>
|
||||
</a>
|
||||
|
||||
<!-- Modal interruptor-->
|
||||
|
||||
<div
|
||||
class="modal fade"
|
||||
id="modalalreadyinterruptor<?= $prestudent_id; ?>"
|
||||
tabindex="-1"
|
||||
aria-labelledby="modalalreadyinterruptorLabel<?= $prestudent_id; ?>"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<div class="modal-dialog modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5
|
||||
class="modal-title"
|
||||
id="modalalreadyinterruptorLabel<?= $prestudent_id; ?>"
|
||||
><?= $this->p->t('studierendenantrag', 'info_only_one_interruption'); ?>
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<?php
|
||||
$hrefUnterbrechung = site_url('lehre/Studierendenantrag/unterbrechung/' . $prestudent_id);
|
||||
?>
|
||||
<div class="modal-body">
|
||||
<div
|
||||
class="form-control"
|
||||
style="width: 100%; height: 250px;overflow:auto; white-space: normal;"
|
||||
><?= $this->p->t('studierendenantrag', 'modalHinweistext_UB'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-primary" data-bs-dismiss="modal"><?= $this->p->t('ui', 'cancel'); ?></button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal -->
|
||||
<div
|
||||
class="modal fade"
|
||||
|
||||
@@ -62351,6 +62351,68 @@ I have been informed that I am under no obligation to consent to the transmissio
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'studierendenantrag',
|
||||
'phrase' => 'modalHinweistext_UB',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Du hast bereits einmal zuvor dein Studium unterbrochen.
|
||||
Gemäß § 12 Z 5 Prüfungsordnung darf ein weiterer Unterbrechungsantrag nur für das darauffolgende Semester gestellt werden.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'You have already interrupted your studies once before.
|
||||
According to § 12 Z 5 of the examination regulations, a further application for interruption may only be submitted for the following semester.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'studierendenantrag',
|
||||
'phrase' => 'info_only_one_interruption',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Hinweis Unterbrechung',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Note Interruption',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'studierendenantrag',
|
||||
'phrase' => 'error_regarding_law',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Bekanntgabe nicht zulässig gemäß Prüfungsordnung',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Announcement not permitted according to examination regulations',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user