diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php
index ae685f301..f61e9ef8d 100644
--- a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php
+++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php
@@ -15,6 +15,7 @@ class approveAnrechnungDetail extends Auth_Controller
const ANRECHNUNGSTATUS_REJECTED = 'rejected';
const ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_STGL = 'AnrechnungNotizSTGL';
+ const ANRECHNUNG_NOTIZTITEL_EMPFEHLUNGSNOTIZ_BY_STGL = 'AnrechnungEmpfehlungsnotizSTGL';
public function __construct()
{
@@ -27,7 +28,8 @@ class approveAnrechnungDetail extends Auth_Controller
'reject' => 'lehre/anrechnung_genehmigen:rw',
'requestRecommendation' => 'lehre/anrechnung_genehmigen:rw',
'withdraw' => 'lehre/anrechnung_genehmigen:rw',
- 'withdrawRequestRecommendation' => 'lehre/anrechnung_genehmigen:rw'
+ 'withdrawRequestRecommendation' => 'lehre/anrechnung_genehmigen:rw',
+ 'saveEmpfehlungsNotiz' => 'lehre/anrechnung_genehmigen:rw'
)
);
@@ -359,6 +361,30 @@ class approveAnrechnungDetail extends Auth_Controller
'status_bezeichnung' => $this->anrechnunglib->getLastAnrechnungstatus($anrechnung_id))
);
}
+
+ public function saveEmpfehlungsNotiz()
+ {
+ $anrechnung_id = $this->input->post('anrechnung_id');
+ $notiz_id = $this->input->post('notiz_id');
+ $empfehlungstext = $this->input->post('empfehlung_text');
+
+ // Validate data
+ if (isEmptyString($anrechnung_id))
+ {
+ $this->terminateWithJsonError($this->p->t('ui', 'systemFehler'));
+ }
+
+ // Save Empfehlungstext
+ $result = self::_saveEmpfehlungsNotiz($anrechnung_id, $empfehlungstext, $notiz_id);
+
+ if (isError($result))
+ {
+ $this->terminateWithJsonError($this->p->t('ui', 'fehlerBeimSpeichern'));
+ }
+
+ // Output success message
+ $this->outputJsonSuccess($this->p->t('ui', 'gespeichert'));
+ }
/**
* Download and open uploaded document (Nachweisdokument).
@@ -582,5 +608,31 @@ class approveAnrechnungDetail extends Auth_Controller
return $lector_arr;
}
+
+ private function _saveEmpfehlungsNotiz($anrechnung_id, $empfehlungstext, $notiz_id)
+ {
+ $this->load->model('person/Notiz_model', 'NotizModel');
+
+ if (!isEmptyString($notiz_id))
+ {
+ return $this->NotizModel->update(
+ $notiz_id,
+ array(
+ 'text' => $empfehlungstext,
+ 'updateamum' => (new DateTime())->format('Y-m-d H:i:s'),
+ 'updatevon' => $this->_uid
+ )
+ );
+ }
+
+ return $this->NotizModel->addNotizForAnrechnung(
+ $anrechnung_id,
+ self::ANRECHNUNG_NOTIZTITEL_EMPFEHLUNGSNOTIZ_BY_STGL,
+ trim($empfehlungstext),
+ $this->_uid
+ );
+
+
+ }
}
diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php
index edc3d5ea2..7204d1616 100644
--- a/application/libraries/AnrechnungLib.php
+++ b/application/libraries/AnrechnungLib.php
@@ -12,6 +12,7 @@ class AnrechnungLib
const ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_LEKTOR = 'AnrechnungNotizLektor';
const ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_STGL = 'AnrechnungNotizSTGL';
+ const ANRECHNUNG_NOTIZTITEL_EMPFEHLUNGSNOTIZ_BY_STGL = 'AnrechnungEmpfehlungsnotizSTGL';
public function __construct()
{
@@ -24,6 +25,7 @@ class AnrechnungLib
$this->ci->load->model('crm/Student_model', 'StudentModel');
$this->ci->load->model('content/DmsVersion_model', 'DmsVersionModel');
$this->ci->load->model('crm/Prestudent_model', 'PrestudentModel');
+ $this->ci->load->model('person/Notiz_model', 'NotizModel');
$this->ci->load->library('DmsLib');
}
@@ -226,13 +228,27 @@ class AnrechnungLib
$empfehlung_data->empfehlung_am = '-';
$empfehlung_data->empfehlungsanfrageAm = '-';
$empfehlung_data->empfehlungsanfrageAn = '-';
- $empfehlung_data->notiz = '-'; // Begruendung, if not recommended
-
+ $empfehlung_data->begruendung = '-'; // Begruendung, if not recommended
+ $empfehlung_data->notiz_id = ''; // Empfehlungsnotiz from STGL
+ $empfehlung_data->notiz = ''; // Empfehlungsnotiz from STGL
+
if(!$anrechnung = getData($this->ci->AnrechnungModel->load($anrechnung_id))[0])
{
show_error('Failed loading Anrechnung');
}
+
+ // Get Empfehlungsnotiz
+ $result = $this->ci->NotizModel->getNotizByAnrechnung(
+ $anrechnung_id,
+ self::ANRECHNUNG_NOTIZTITEL_EMPFEHLUNGSNOTIZ_BY_STGL
+ );
+
+ if ($notiz = getData($result)[0])
+ {
+ $empfehlung_data->notiz_id = $notiz->notiz_id;
+ $empfehlung_data->notiz = $notiz->text;
+ }
// Get date, where recommendation was last requested
$result = $this->ci->AnrechnungModel->getLastAnrechnungstatus(
@@ -288,11 +304,10 @@ class AnrechnungLib
if (!$anrechnung->empfehlung_anrechnung)
{
// Get Ablehnungsbegruendung (only set, if Anrechnung was not recommended yet)
- $this->ci->load->model('person/Notiz_model', 'NotizModel');
$result = $this->ci->NotizModel->getNotizByAnrechnung($anrechnung_id, self::ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_LEKTOR);
if ($notiz = getData($result)[0])
{
- $empfehlung_data->notiz = $notiz->text;
+ $empfehlung_data->begruendung = $notiz->text;
}
}
diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php
index 0364aa57e..5d0bf636d 100644
--- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php
+++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php
@@ -75,7 +75,6 @@ $this->load->view(
-
@@ -90,7 +89,10 @@ $this->load->view(
p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?>
-
+
+
+
+
| p->t('person', 'studentIn')); ?> |
@@ -143,16 +145,16 @@ $this->load->view(
+
+
+
-
+
-
+
diff --git a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php
index 6d3dd913e..61f8e9b50 100644
--- a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php
+++ b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php
@@ -85,7 +85,8 @@ $this->load->view(
p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?>
-
+
+
| p->t('person', 'studentIn')); ?> |
@@ -138,6 +139,7 @@ $this->load->view(
+
@@ -157,8 +159,8 @@ $this->load->view(
-
-
+
+
@@ -192,11 +194,12 @@ $this->load->view(
| p->t('global', 'begruendung'); ?> |
- notiz) ?>
+ begruendung) ?>
|
+