mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Anrechnungen
- Neuer Job zum Setzen der Anrechnungsnote hinzugefügt - Direktes setzen der Zeugnisnote bei Anrechnung entfernt
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2021, fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link http://fhcomplete.org
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class AnrechnungJob extends JOB_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Grades in FAS to angerechnet if the request was successfull
|
||||
* @return void
|
||||
*/
|
||||
public function setAnrechnungGrades()
|
||||
{
|
||||
$this->logInfo('Start Anrechnung Grades Job');
|
||||
// get all accepted requests that are not in the grades table yet
|
||||
|
||||
// get all placement tests with incorrect studyplan
|
||||
$qry = "
|
||||
SELECT
|
||||
student_uid, lehrveranstaltung_id, studiensemester_kurzbz, genehmigt_von
|
||||
FROM
|
||||
lehre.tbl_anrechnung
|
||||
JOIN public.tbl_student USING(prestudent_id)
|
||||
WHERE
|
||||
genehmigt_von is not null
|
||||
AND EXISTS(
|
||||
SELECT 1 FROM lehre.tbl_anrechnung_anrechnungstatus
|
||||
WHERE anrechnung_id = tbl_anrechnung.anrechnung_id
|
||||
AND status_kurzbz='approved'
|
||||
AND datum>=now()-'5 days'::interval
|
||||
)
|
||||
AND NOT EXISTS(
|
||||
SELECT 1 FROM lehre.tbl_zeugnisnote
|
||||
WHERE
|
||||
lehrveranstaltung_id = tbl_anrechnung.lehrveranstaltung_id
|
||||
AND studiensemester_kurzbz = tbl_anrechnung.studiensemester_kurzbz
|
||||
AND student_uid = tbl_student.student_uid
|
||||
)
|
||||
";
|
||||
|
||||
$db = new DB_Model();
|
||||
$result_grades = $db->execReadOnlyQuery($qry);
|
||||
|
||||
$cnt = 0;
|
||||
if (hasData($result_grades))
|
||||
{
|
||||
$grades = getData($result_grades);
|
||||
foreach ($grades as $anrechnung)
|
||||
{
|
||||
$cnt++;
|
||||
// Set zeugnisnote to angerechnet (= note 6)
|
||||
$ret = $this->ZeugnisnoteModel->insert(array(
|
||||
'lehrveranstaltung_id' => $anrechnung->lehrveranstaltung_id,
|
||||
'student_uid' => $anrechnung->student_uid,
|
||||
'studiensemester_kurzbz' => $anrechnung->studiensemester_kurzbz,
|
||||
'uebernahmedatum' => (new DateTime())->format('Y-m-d H:m:i'),
|
||||
'benotungsdatum' => (new DateTime())->format('Y-m-d H:m:i'),
|
||||
'note' => 6,
|
||||
'insertvon' => $anrechnung->genehmigt_von,
|
||||
'bemerkung' => 'Digitale Anrechnung'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
$this->logInfo('End Anrechnung Grades Job', array('Number of Grades added'=>$cnt));
|
||||
}
|
||||
}
|
||||
@@ -9,23 +9,22 @@ class AnrechnungLib
|
||||
const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor';
|
||||
const ANRECHNUNGSTATUS_APPROVED = 'approved';
|
||||
const ANRECHNUNGSTATUS_REJECTED = 'rejected';
|
||||
|
||||
|
||||
const ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_LEKTOR = 'AnrechnungNotizLektor';
|
||||
const ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_STGL = 'AnrechnungNotizSTGL';
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci =& get_instance();
|
||||
|
||||
|
||||
$this->ci->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->ci->load->model('person/Person_model', 'PersonModel');
|
||||
$this->ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->ci->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->ci->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->ci->load->model('content/DmsVersion_model', 'DmsVersionModel');
|
||||
$this->ci->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Antrag data
|
||||
* @param $uid
|
||||
@@ -42,19 +41,19 @@ class AnrechnungLib
|
||||
{
|
||||
show_error('You are not assigned to this course yet.');
|
||||
}
|
||||
|
||||
|
||||
// Get the students personal data
|
||||
if (!$person = getData($this->ci->PersonModel->getByUid($uid))[0])
|
||||
{
|
||||
show_error('Failed loading person data.');
|
||||
}
|
||||
|
||||
|
||||
// Get the internal personenkennzeichen
|
||||
if (!$student = getData($this->ci->StudentModel->load(array('student_uid' => $uid)))[0])
|
||||
{
|
||||
show_error(getError($student));
|
||||
}
|
||||
|
||||
|
||||
// Get studiengang bezeichnung
|
||||
if (!$studiengang = getData($this->ci->StudiengangModel->load($lv->studiengang_kz))[0])
|
||||
{
|
||||
@@ -67,7 +66,7 @@ class AnrechnungLib
|
||||
{
|
||||
show_error('Failed loading course lectors.');
|
||||
}
|
||||
|
||||
|
||||
// Set the given studiensemester
|
||||
$antrag_data->lv_id = $lv_id;
|
||||
$antrag_data->lv_bezeichnung = $lv->bezeichnung;
|
||||
@@ -78,10 +77,10 @@ class AnrechnungLib
|
||||
$antrag_data->matrikelnr = $student->matrikelnr;
|
||||
$antrag_data->stg_bezeichnung = $studiengang->bezeichnung;
|
||||
$antrag_data->lektoren = $lv_lektoren;
|
||||
|
||||
|
||||
return $antrag_data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Anrechnung data, last status and Nachweisdokument dms data.
|
||||
* @param $anrechnung_id
|
||||
@@ -94,25 +93,25 @@ class AnrechnungLib
|
||||
{
|
||||
show_error('Incorrect parameter');
|
||||
}
|
||||
|
||||
|
||||
$anrechnung_data = new StdClass();
|
||||
|
||||
|
||||
$result = $this->ci->AnrechnungModel->load($anrechnung_id);
|
||||
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
show_error(getError($result));
|
||||
}
|
||||
|
||||
|
||||
if ($anrechnung = getData($result)[0])
|
||||
{
|
||||
$anrechnung_data = $this->_setAnrechnungDataObject($anrechnung);
|
||||
}
|
||||
|
||||
|
||||
return success($anrechnung_data);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Anrechnung data by Lehrveranstaltung. Also retrieves last status and Nachweisdokument dms data.
|
||||
* @param $lehrveranstaltung_id
|
||||
@@ -135,22 +134,22 @@ class AnrechnungLib
|
||||
$anrechnung_data->status_kurzbz = '';
|
||||
$anrechnung_data->status = getUserLanguage() == 'German' ? 'neu' : 'new';
|
||||
$anrechnung_data->dokumentname = '';
|
||||
|
||||
|
||||
$result = $this->ci->AnrechnungModel->loadWhere(array('lehrveranstaltung_id' => $lehrveranstaltung_id));
|
||||
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
show_error(getError($result));
|
||||
}
|
||||
|
||||
|
||||
if ($anrechnung = getData($result)[0])
|
||||
{
|
||||
$anrechnung_data = $this->_setAnrechnungDataObject($anrechnung);
|
||||
}
|
||||
|
||||
|
||||
return success($anrechnung_data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get students data by Anrechnung
|
||||
* @param $anrechnung_id
|
||||
@@ -162,28 +161,28 @@ class AnrechnungLib
|
||||
{
|
||||
show_error('Incorrect parameter');
|
||||
}
|
||||
|
||||
|
||||
$this->ci->AnrechnungModel->addSelect('tbl_benutzer.uid, tbl_prestudent.prestudent_id, tbl_person.person_id, tbl_anrechnung.studiensemester_kurzbz, vorname, nachname, geschlecht, tbl_lehrveranstaltung.bezeichnung AS "lv_bezeichnung"');
|
||||
$this->ci->AnrechnungModel->addJoin('public.tbl_prestudent', 'prestudent_id');
|
||||
$this->ci->AnrechnungModel->addJoin('public.tbl_person', 'person_id');
|
||||
$this->ci->AnrechnungModel->addJoin('public.tbl_benutzer', 'person_id');
|
||||
$this->ci->AnrechnungModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
|
||||
|
||||
|
||||
$result = $this->ci->AnrechnungModel->load($anrechnung_id);
|
||||
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
show_error(getError($result));
|
||||
}
|
||||
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
show_error('Failed retrieving students data');
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Empfehlung data object.
|
||||
* @param $anrechnung_id
|
||||
@@ -196,20 +195,20 @@ class AnrechnungLib
|
||||
{
|
||||
show_error('Incorrect parameter');
|
||||
}
|
||||
|
||||
|
||||
$empfehlung_data = new stdClass();
|
||||
$empfehlung_data->empfehlung = null;
|
||||
$empfehlung_data->empfehlung_von = '-';
|
||||
$empfehlung_data->empfehlung_am = '-';
|
||||
$empfehlung_data->empfehlung_angefordert_am = '-';
|
||||
$empfehlung_data->notiz = ''; // Begruendung, if not recommended
|
||||
|
||||
|
||||
|
||||
|
||||
if(!$anrechnung = getData($this->ci->AnrechnungModel->load($anrechnung_id))[0])
|
||||
{
|
||||
show_error('Failed loading Anrechnung');
|
||||
}
|
||||
|
||||
|
||||
// Get date, where recommendation was last requested
|
||||
$result = $this->ci->AnrechnungModel->getLastAnrechnungstatus(
|
||||
$anrechnung_id,
|
||||
@@ -219,12 +218,12 @@ class AnrechnungLib
|
||||
{
|
||||
$empfehlung_data->empfehlung_angefordert_am = (new DateTime($result->insertamum))->format('d.m.Y');
|
||||
}
|
||||
|
||||
|
||||
if (is_null($anrechnung->empfehlung_anrechnung))
|
||||
{
|
||||
return success($empfehlung_data);
|
||||
}
|
||||
|
||||
|
||||
// If Empfehlung is true or false
|
||||
if (!is_null($anrechnung->empfehlung_anrechnung))
|
||||
{
|
||||
@@ -237,19 +236,19 @@ class AnrechnungLib
|
||||
{
|
||||
$empfehlung_datum = (new DateTime($result->insertamum))->format('d.m.Y');
|
||||
}
|
||||
|
||||
|
||||
// Get full name of lector
|
||||
$result = $this->ci->PersonModel->getByUID($result->insertvon);
|
||||
if ($result = getData($result)[0])
|
||||
{
|
||||
$empfehlung_von = $result->vorname. ' '. $result->nachname;
|
||||
}
|
||||
|
||||
|
||||
$empfehlung_data->empfehlung = $anrechnung->empfehlung_anrechnung;
|
||||
$empfehlung_data->empfehlung_von = $empfehlung_von;
|
||||
$empfehlung_data->empfehlung_am = $empfehlung_datum;
|
||||
}
|
||||
|
||||
|
||||
// If Empfehlung is false, retrieve also Notiz with Begruendung
|
||||
if (!$anrechnung->empfehlung_anrechnung)
|
||||
{
|
||||
@@ -261,11 +260,11 @@ class AnrechnungLib
|
||||
$empfehlung_data->notiz = $notiz->text;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return success($empfehlung_data);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Genehmigung data object.
|
||||
* @param $anrechnung_id
|
||||
@@ -278,41 +277,41 @@ class AnrechnungLib
|
||||
{
|
||||
show_error('Incorrect parameter');
|
||||
}
|
||||
|
||||
|
||||
$genehmigung_data = new stdClass();
|
||||
$genehmigung_data->genehmigung = null;
|
||||
$genehmigung_data->abgeschlossen_von = '-';
|
||||
$genehmigung_data->abgeschlossen_am = '-';
|
||||
$genehmigung_data->notiz = ''; // Begruendung, if rejected
|
||||
|
||||
|
||||
|
||||
|
||||
if(!$anrechnung = getData($this->ci->AnrechnungModel->load($anrechnung_id))[0])
|
||||
{
|
||||
show_error('Failed loading Anrechnung');
|
||||
}
|
||||
|
||||
|
||||
// Get date of approvement or rejection
|
||||
$result = $this->ci->AnrechnungModel->getApprovedOrRejected($anrechnung_id);
|
||||
|
||||
|
||||
if (!$result = getData($result)[0])
|
||||
{
|
||||
return success($genehmigung_data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$genehmigung_data->genehmigung = $result->status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED
|
||||
? true
|
||||
: false;
|
||||
$genehmigung_data->abgeschlossen_am = (new DateTime($result->insertamum))->format('d.m.Y');
|
||||
|
||||
|
||||
// Get full name of lector
|
||||
$result = $this->ci->PersonModel->getByUID($result->insertvon);
|
||||
if ($result = getData($result)[0])
|
||||
{
|
||||
$genehmigung_data->abgeschlossen_von = $result->vorname. ' '. $result->nachname;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// If Anrechnung was rejected, retrieve also Notiz with Begruendung
|
||||
if (!$genehmigung_data->genehmigung)
|
||||
{
|
||||
@@ -324,11 +323,11 @@ class AnrechnungLib
|
||||
$genehmigung_data->notiz = $notiz->text;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return success($genehmigung_data);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get last Anrechnungstatusbezeichnung in users language.
|
||||
* @param $anrechnung_id
|
||||
@@ -337,13 +336,13 @@ class AnrechnungLib
|
||||
public function getLastAnrechnungstatus($anrechnung_id)
|
||||
{
|
||||
$result = $this->ci->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id);
|
||||
|
||||
|
||||
$status_mehrsprachig = getData($result)[0]->bezeichnung_mehrsprachig;
|
||||
$status = getUserLanguage() == 'German' ? $status_mehrsprachig[0] : $status_mehrsprachig[1];
|
||||
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Approve Anrechnung.
|
||||
* Checks last status of Anrechnung and will only approve if last status is not approved or rejected.
|
||||
@@ -358,20 +357,20 @@ class AnrechnungLib
|
||||
{
|
||||
show_error(getError($result));
|
||||
}
|
||||
|
||||
|
||||
$status_kurzbz = $result->status_kurzbz;
|
||||
|
||||
|
||||
// Exit if already approved or rejected
|
||||
if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED) // TODO: in js: bereits genehmigte nicht clickable!
|
||||
if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED)
|
||||
{
|
||||
return success(false); // dont approve
|
||||
}
|
||||
|
||||
|
||||
// Start DB transaction
|
||||
$this->ci->db->trans_start(false);
|
||||
|
||||
$stgl_uid = getAuthUID();
|
||||
|
||||
|
||||
// Insert new status approved
|
||||
$this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_APPROVED);
|
||||
|
||||
@@ -383,54 +382,6 @@ class AnrechnungLib
|
||||
)
|
||||
);
|
||||
|
||||
// Set zeugnisnote to angerechnet (= note 6)
|
||||
$this->ci->AnrechnungModel->addSelect('lehrveranstaltung_id, student_uid, studiensemester_kurzbz');
|
||||
$this->ci->AnrechnungModel->addJoin('public.tbl_student', 'prestudent_id');
|
||||
$anrechnung = getData($this->ci->AnrechnungModel->load($anrechnung_id))[0];
|
||||
|
||||
// Check if zeugnisnote exists
|
||||
$result = $this->ci->ZeugnisnoteModel->loadWhere(array(
|
||||
'lehrveranstaltung_id' => $anrechnung->lehrveranstaltung_id,
|
||||
'student_uid' => $anrechnung->student_uid,
|
||||
'studiensemester_kurzbz' => $anrechnung->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
|
||||
// If zeugnisnote exists, update...
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->ci->ZeugnisnoteModel->update(
|
||||
array(
|
||||
'lehrveranstaltung_id' => $anrechnung->lehrveranstaltung_id,
|
||||
'student_uid' => $anrechnung->student_uid,
|
||||
'studiensemester_kurzbz' => $anrechnung->studiensemester_kurzbz
|
||||
),
|
||||
array(
|
||||
'uebernahmedatum' => (new DateTime())->format('Y-m-d H:m:i'),
|
||||
'benotungsdatum' => (new DateTime())->format('Y-m-d H:m:i'),
|
||||
'note' => 6,
|
||||
'insertvon' => $stgl_uid,
|
||||
'bemerkung' => 'Digitale Anrechnung'
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
// ...otherwise insert
|
||||
else
|
||||
{
|
||||
$this->ci->ZeugnisnoteModel->insert(array(
|
||||
'lehrveranstaltung_id' => $anrechnung->lehrveranstaltung_id,
|
||||
'student_uid' => $anrechnung->student_uid,
|
||||
'studiensemester_kurzbz' => $anrechnung->studiensemester_kurzbz,
|
||||
'uebernahmedatum' => (new DateTime())->format('Y-m-d H:m:i'),
|
||||
'benotungsdatum' => (new DateTime())->format('Y-m-d H:m:i'),
|
||||
'note' => 6,
|
||||
'insertvon' => $stgl_uid,
|
||||
'bemerkung' => 'Digitale Anrechnung'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Transaction complete
|
||||
$this->ci->db->trans_complete();
|
||||
|
||||
@@ -439,10 +390,10 @@ class AnrechnungLib
|
||||
$this->ci->db->trans_rollback();
|
||||
return error($result->msg, EXIT_ERROR);
|
||||
}
|
||||
|
||||
|
||||
return success(true); // approved
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reject Anrechnung.
|
||||
* @param $anrechnung_id
|
||||
@@ -455,23 +406,23 @@ class AnrechnungLib
|
||||
{
|
||||
show_error(getError($result));
|
||||
}
|
||||
|
||||
|
||||
$status_kurzbz = $result->status_kurzbz;
|
||||
|
||||
|
||||
// Exit if already approved or rejected
|
||||
if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED)
|
||||
{
|
||||
return success(false); // dont reject
|
||||
}
|
||||
|
||||
|
||||
// Insert new status rejected
|
||||
$result = $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_REJECTED);
|
||||
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
show_error(getError($result));
|
||||
}
|
||||
|
||||
|
||||
// Add begruendung as notiz
|
||||
$this->ci->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->ci->NotizModel->addNotizForAnrechnung(
|
||||
@@ -480,10 +431,10 @@ class AnrechnungLib
|
||||
$begruendung,
|
||||
getAuthUID()
|
||||
);
|
||||
|
||||
|
||||
return success(true); // rejected
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Request recommendation.
|
||||
* @param $anrechnung_id
|
||||
@@ -496,9 +447,9 @@ class AnrechnungLib
|
||||
{
|
||||
show_error(getError($result));
|
||||
}
|
||||
|
||||
|
||||
$status_kurzbz = $result->status_kurzbz;
|
||||
|
||||
|
||||
// Exit if already approved or rejected or processed by lector
|
||||
if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED
|
||||
|| $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED
|
||||
@@ -506,13 +457,13 @@ class AnrechnungLib
|
||||
{
|
||||
return success(false); // dont ask for recommendation
|
||||
}
|
||||
|
||||
|
||||
// Start DB transaction
|
||||
$this->ci->db->trans_start(false);
|
||||
|
||||
|
||||
// Insert new status inProgressLektor
|
||||
$result = $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR);
|
||||
|
||||
|
||||
/**
|
||||
* Anyway update empfehlung_anrechnung to be null
|
||||
* Regardless of what empfehlung_anrechnung was already set (true/false/null), it should be (reset to ) null by
|
||||
@@ -524,19 +475,19 @@ class AnrechnungLib
|
||||
'empfehlung_anrechnung' => null
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
// Transaction complete
|
||||
$this->ci->db->trans_complete();
|
||||
|
||||
|
||||
if ($this->ci->db->trans_status() === false)
|
||||
{
|
||||
$this->ci->db->trans_rollback();
|
||||
return error($result->msg, EXIT_ERROR);
|
||||
}
|
||||
|
||||
|
||||
return success(true); // recommended
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Recommend Anrechnung.
|
||||
* @param $anrechnung_id
|
||||
@@ -550,21 +501,21 @@ class AnrechnungLib
|
||||
{
|
||||
show_error(getError($result));
|
||||
}
|
||||
|
||||
|
||||
$status_kurzbz = $result->status_kurzbz;
|
||||
|
||||
|
||||
// Exit if already approved or rejected
|
||||
if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED)
|
||||
{
|
||||
return success(false); // dont approve
|
||||
}
|
||||
|
||||
|
||||
// Start DB transaction
|
||||
$this->ci->db->trans_start(false);
|
||||
|
||||
|
||||
// Insert new status progessed by stgl
|
||||
$this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL);
|
||||
|
||||
|
||||
// Update empfehlung_anrechnung
|
||||
$this->ci->AnrechnungModel->update(
|
||||
$anrechnung_id,
|
||||
@@ -572,19 +523,19 @@ class AnrechnungLib
|
||||
'empfehlung_anrechnung' => true
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
// Transaction complete
|
||||
$this->ci->db->trans_complete();
|
||||
|
||||
|
||||
if ($this->ci->db->trans_status() === false)
|
||||
{
|
||||
$this->ci->db->trans_rollback();
|
||||
return error($result->msg, EXIT_ERROR);
|
||||
}
|
||||
|
||||
|
||||
return success(true); // recommended
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Do not recommend Anrechnung.
|
||||
* @param $anrechnung_id
|
||||
@@ -598,21 +549,21 @@ class AnrechnungLib
|
||||
{
|
||||
show_error(getError($result));
|
||||
}
|
||||
|
||||
|
||||
$status_kurzbz = $result->status_kurzbz;
|
||||
|
||||
|
||||
// Exit if already approved or rejected
|
||||
if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED)
|
||||
{
|
||||
return success(false); // dont approve
|
||||
}
|
||||
|
||||
|
||||
// Start DB transaction
|
||||
$this->ci->db->trans_start(false);
|
||||
|
||||
|
||||
// Insert new status progessed by stgl
|
||||
$this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL);
|
||||
|
||||
|
||||
// Update empfehlung_anrechnung
|
||||
$this->ci->AnrechnungModel->update(
|
||||
$anrechnung_id,
|
||||
@@ -620,9 +571,9 @@ class AnrechnungLib
|
||||
'empfehlung_anrechnung' => false
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$lektor_uid = getAuthUID();
|
||||
|
||||
|
||||
// Add begruendung as notiz
|
||||
$this->ci->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->ci->NotizModel->addNotizForAnrechnung(
|
||||
@@ -631,24 +582,24 @@ class AnrechnungLib
|
||||
$begruendung,
|
||||
$lektor_uid
|
||||
);
|
||||
|
||||
|
||||
// Transaction complete
|
||||
$this->ci->db->trans_complete();
|
||||
|
||||
|
||||
if ($this->ci->db->trans_status() === false)
|
||||
{
|
||||
$this->ci->db->trans_rollback();
|
||||
return error($result->msg, EXIT_ERROR);
|
||||
}
|
||||
|
||||
|
||||
return success(true); // recommended
|
||||
}
|
||||
|
||||
|
||||
// Return an object with Anrechnungdata
|
||||
private function _setAnrechnungDataObject($anrechnung)
|
||||
{
|
||||
$anrechnung_data = new StdClass();
|
||||
|
||||
|
||||
// Get Anrechnung data
|
||||
$anrechnung_data->anrechnung_id = $anrechnung->anrechnung_id;
|
||||
$anrechnung_data->prestudent_id = $anrechnung->prestudent_id;
|
||||
@@ -660,26 +611,26 @@ class AnrechnungLib
|
||||
$anrechnung_data->insertvon= $anrechnung->insertvon;
|
||||
$anrechnung_data->studiensemester_kurzbz= $anrechnung->studiensemester_kurzbz;
|
||||
$anrechnung_data->empfehlung= $anrechnung->empfehlung_anrechnung;
|
||||
|
||||
|
||||
// Get last status_kurzbz
|
||||
$result = $this->ci->AnrechnungModel->getLastAnrechnungstatus($anrechnung->anrechnung_id);
|
||||
$anrechnung_data->status_kurzbz = $result->retval[0]->status_kurzbz;
|
||||
|
||||
|
||||
// Get last status bezeichnung in the users language
|
||||
$anrechnung_data->status = $this->getLastAnrechnungstatus($anrechnung->anrechnung_id);
|
||||
|
||||
|
||||
|
||||
|
||||
// Get document name
|
||||
$this->ci->DmsVersionModel->addSelect('name');
|
||||
$result = $this->ci->DmsVersionModel->loadWhere(array('dms_id' => $anrechnung->dms_id));
|
||||
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
show_error(getError($result));
|
||||
}
|
||||
|
||||
|
||||
$anrechnung_data->dokumentname = $result->retval[0]->name;
|
||||
|
||||
|
||||
return $anrechnung_data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,5 +10,6 @@ class Zeugnisnote_model extends DB_Model
|
||||
parent::__construct();
|
||||
$this->dbTable = 'lehre.tbl_zeugnisnote';
|
||||
$this->pk = array('studiensemester_kurzbz', 'student_uid', 'lehrveranstaltung_id');
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ $this->load->view(
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/anrechnung/approveAnrechnungDetail.js'
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -126,7 +126,7 @@ $this->load->view(
|
||||
<td><?php echo $this->p->t('anrechnung', 'nachweisdokumente'); ?></td>
|
||||
<td>
|
||||
<a href="<?php echo current_url() . '/download?dms_id=' . $anrechnungData->dms_id; ?>"
|
||||
target="_blank"><?php echo $anrechnungData->dokumentname ?></a>
|
||||
target="_blank"><?php echo htmlentities($anrechnungData->dokumentname) ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -188,7 +188,7 @@ $this->load->view(
|
||||
</div>
|
||||
<div class="well"><b><?php echo $this->p->t('global', 'begruendung'); ?>
|
||||
: </b>
|
||||
<span id="approveAnrechnungDetail-empfehlungDetail-begruendung"><?php echo $empfehlungData->notiz ?></span>
|
||||
<span id="approveAnrechnungDetail-empfehlungDetail-begruendung"><?php echo htmlentities($empfehlungData->notiz) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -245,7 +245,7 @@ $this->load->view(
|
||||
</div>
|
||||
<div class="well"><b><?php echo $this->p->t('global', 'begruendung'); ?>
|
||||
: </b>
|
||||
<span id="approveAnrechnungDetail-genehmigungDetail-begruendung"><?php echo $genehmigungData->notiz ?></span>
|
||||
<span id="approveAnrechnungDetail-genehmigungDetail-begruendung"><?php echo htmlentities($genehmigungData->notiz) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -32,7 +32,7 @@ $this->load->view(
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/anrechnung/requestAnrechnung.js'
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -56,7 +56,7 @@ $this->load->view(
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php echo form_open_multipart(current_url() . '/apply',
|
||||
['id' => 'requestAnrechnung-form'],
|
||||
['lv_id' => $antragData->lv_id, 'studiensemester' => $antragData->studiensemester_kurzbz]
|
||||
@@ -178,7 +178,7 @@ $this->load->view(
|
||||
<?php if (!empty($anrechnungData->dms_id)): ?>
|
||||
<a class="pull-right"
|
||||
href="<?php echo current_url() . '/download?dms_id=' . $anrechnungData->dms_id; ?>"
|
||||
target="_blank"><?php echo $anrechnungData->dokumentname ?></a>
|
||||
target="_blank"><?php echo htmlentities($anrechnungData->dokumentname) ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -42,7 +42,7 @@ $this->load->view(
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/anrechnung/reviewAnrechnungDetail.js'
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -125,7 +125,7 @@ $this->load->view(
|
||||
<td><?php echo $this->p->t('anrechnung', 'nachweisdokumente'); ?></td>
|
||||
<td>
|
||||
<a href="<?php echo current_url() . '/download?dms_id=' . $anrechnungData->dms_id; ?>"
|
||||
target="_blank"><?php echo $anrechnungData->dokumentname ?></a>
|
||||
target="_blank"><?php echo htmlentities($anrechnungData->dokumentname) ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -167,7 +167,7 @@ $this->load->view(
|
||||
</div>
|
||||
<div class="well"><b><?php echo $this->p->t('global', 'begruendung'); ?>
|
||||
: </b>
|
||||
<span id="reviewAnrechnungDetail-empfehlungDetail-begruendung"><?php echo $empfehlungData->notiz ?></span>
|
||||
<span id="reviewAnrechnungDetail-empfehlungDetail-begruendung"><?php echo htmlentities($empfehlungData->notiz) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user