diff --git a/application/config/anrechnung.php b/application/config/anrechnung.php index d1f4f0958..c2e38385c 100644 --- a/application/config/anrechnung.php +++ b/application/config/anrechnung.php @@ -7,8 +7,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); $config['interval_blocking_application'] = 'P1M'; // Application submission period given by start- and enddate. -$config['submit_application_start'] = '01.02.2021'; -$config['submit_application_end'] = '22.02.2021'; +$config['submit_application_start'] = '05.09.2022'; +$config['submit_application_end'] = '22.09.2022'; // Lehrveranstaltungen with these grades will be blocked for application $config['grades_blocking_application'] = array( diff --git a/application/controllers/api/v1/codex/Zgv.php b/application/controllers/api/v1/codex/Zgv.php index 670ffc190..3d1b64029 100644 --- a/application/controllers/api/v1/codex/Zgv.php +++ b/application/controllers/api/v1/codex/Zgv.php @@ -45,6 +45,14 @@ class Zgv extends API_Controller } } + /** + * @return zgv + */ + public function getAllZgv() + { + $this->response($this->Zgv_model->getAllZgv(), REST_Controller::HTTP_OK); + } + /** * @return void */ diff --git a/application/controllers/api/v1/codex/Zgvmaster.php b/application/controllers/api/v1/codex/Zgvmaster.php index ff737dd7f..7775724c2 100644 --- a/application/controllers/api/v1/codex/Zgvmaster.php +++ b/application/controllers/api/v1/codex/Zgvmaster.php @@ -45,6 +45,14 @@ class Zgvmaster extends API_Controller } } + /** + * @return zgvmaster + */ + public function getAllZgvmaster() + { + $this->response($this->Zgvmaster_model->getAllZgvmaster(), REST_Controller::HTTP_OK); + } + /** * @return void */ diff --git a/application/controllers/jobs/AnrechnungJob.php b/application/controllers/jobs/AnrechnungJob.php index f32a8268a..7aae80d54 100644 --- a/application/controllers/jobs/AnrechnungJob.php +++ b/application/controllers/jobs/AnrechnungJob.php @@ -16,9 +16,11 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); class AnrechnungJob extends JOB_Controller { const APPROVE_ANRECHNUNG_URI = '/lehre/anrechnung/ApproveAnrechnungUebersicht'; + const REVIEW_ANRECHNUNG_URI = '/lehre/anrechnung/ReviewAnrechnungUebersicht'; const ANRECHNUNGSTATUS_APPROVED = 'approved'; const ANRECHNUNGSTATUS_REJECTED = 'rejected'; + const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; const ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_STGL = 'AnrechnungNotizSTGL'; /** @@ -33,6 +35,8 @@ class AnrechnungJob extends JOB_Controller $this->load->helper('url'); $this->load->helper('hlp_sancho_helper'); + + $this->load->library('AnrechnungLib'); } /** @@ -342,6 +346,79 @@ html; } + /** + * Send Sancho mail to remind lecturers to provide their recommendation if not done until one week after request. + */ + public function sendMailRemindRecommendation(){ + + $this->logInfo('Start AnrechnungJob sendMailRemindRecommendation to remind lecturers to provide their recommendation.'); + + // Get Anrechnungen with pending recommendations, that were requested 1 week before today. + // Restrict query for Anrechnungen of actual semester. + $this->AnrechnungModel->addSelect('astat.anrechnung_id, astat.datum, astat.insertamum'); + $this->AnrechnungModel->addDistinct('astat.anrechnung_id'); + $this->AnrechnungModel->addJoin('lehre.tbl_anrechnung_anrechnungstatus astat', 'anrechnung_id'); + + $result = $this->AnrechnungModel->loadWhere(' + studiensemester_kurzbz = ( + SELECT studiensemester_kurzbz FROM tbl_studiensemester WHERE now()::date BETWEEN start AND ende) + ) + AND genehmigt_von IS NULL + AND empfehlung_anrechnung IS NULL + AND status_kurzbz = '. $this->db->escape(self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR) .' -- in Bearbeitung durch Lektor + AND NOW()::date = (astat.datum + interval \'1 week\') -- eine Woche nach Empfehlungsanfrage + ORDER BY astat.anrechnung_id, astat.datum DESC, astat.insertamum DESC -- nur letzten status dabei prüfen + '); + + // Exit if there are no pending recommendations + if (!hasData($result)) + { + $this->logInfo('End AnrechnungJob sendMailRemindRecommendation, because no recommendations to be done.'); + exit; + } + + $anrechnung_id_arr = array_column(getData($result), 'anrechnung_id'); + + $arr_lvLector_arr = array(); + foreach ($anrechnung_id_arr as $anrechnung_id) + { + $arr_lvLector_arr[]= $this->anrechnunglib->getLectors($anrechnung_id); // Returns LV Leitung. If not present, then all lectors of LV. + } + + // Unique lector array to send only one mail per lector + $arr_lvLector_arr = array_unique($arr_lvLector_arr, SORT_REGULAR); + + // Link to 'Anrechnungen prüfen' dashboard + $url = + CIS_ROOT. 'cis/index.php?menu='. + CIS_ROOT. 'cis/menu.php?content_id=&content='. + CIS_ROOT. index_page(). self::REVIEW_ANRECHNUNG_URI; + + foreach ($arr_lvLector_arr as $lvLector_arr) + { + foreach ($lvLector_arr as $lector) + { + // Prepare mail content + $fields = array( + 'vorname' => $lector->vorname, + 'stgl_name' => 'Die Studiengangsleitung', + 'link' => anchor($url, 'Anrechnungsanträge Übersicht') + ); + + // Send mail + sendSanchoMail( + 'AnrechnungEmpfehlungAnfordern', + $fields, + $lector->uid. '@'. DOMAIN, + 'Erinnerung: Deine Empfehlung wird benötigt zur Anerkennung nachgewiesener Kenntnisse' + ); + } + } + + $this->logInfo('SUCCEDED AnrechnungJob sendMailRemindRecommendation'); + + } + // Get STGL mail address private function _getSTGLMailAddress($studiengang_kz) { diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 20368398a..9eb0c9734 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -108,21 +108,29 @@ class approveAnrechnungUebersicht extends Auth_Controller return $this->outputJsonError('Fehler beim Übertragen der Daten.'); } + $json = array( + 'status_kurzbz' => self::ANRECHNUNGSTATUS_APPROVED, + 'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_APPROVED), + 'prestudenten' => [] + ); + // Approve Anrechnung foreach ($data as $item) { - if ($this->anrechnunglib->approveAnrechnung($item['anrechnung_id'])) + // Get Prestudent + $this->AnrechnungModel->addSelect('prestudent_id'); + $result = $this->AnrechnungModel->load($item['anrechnung_id']); + $prestudent_id = getData($result)[0]->prestudent_id; + + // Approve + if ($this->anrechnunglib->approveAnrechnung($item['anrechnung_id'])) { - $json[]= array( - 'anrechnung_id' => $item['anrechnung_id'], - 'status_kurzbz' => self::ANRECHNUNGSTATUS_APPROVED, - 'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_APPROVED) - ); + $json['prestudenten'][$prestudent_id][] = $item['anrechnung_id']; } } // Output json to ajax - if (isset($json) && !isEmptyArray($json)) + if (isset($json) && !isEmptyArray($json['prestudenten'])) { return $this->outputJsonSuccess($json); } diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index bc8ab562e..fbaac9b3e 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -6,13 +6,13 @@ class requestAnrechnung extends Auth_Controller { const REQUEST_ANRECHNUNG_URI = '/lehre/anrechnung/RequestAnrechnung'; const APPROVE_ANRECHNUNG_URI = '/lehre/anrechnung/ApproveAnrechnungUebersicht'; - + const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; const ANRECHNUNGSTATUS_APPROVED = 'approved'; const ANRECHNUNGSTATUS_REJECTED = 'rejected'; - + public function __construct() { // Set required permissions @@ -23,22 +23,22 @@ class requestAnrechnung extends Auth_Controller 'download' => 'student/anrechnung_beantragen:rw', ) ); - + // Load models $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); $this->load->model('content/DmsVersion_model', 'DmsVersionModel'); - + // Load libraries $this->load->library('WidgetLib'); $this->load->library('PermissionLib'); $this->load->library('AnrechnungLib'); $this->load->library('DmsLib'); - + // Load helpers $this->load->helper('form'); $this->load->helper('url'); $this->load->helper('hlp_sancho_helper'); - + // Load configs $this->load->config('anrechnung'); @@ -208,11 +208,11 @@ class requestAnrechnung extends Auth_Controller $this->_checkIfEntitledToReadDMSDoc($dms_id); // Get file to be downloaded from DMS - $download = $this->dmslib->download($dms_id, $filename); - if (isError($download)) return $download; + $download = $this->dmslib->download($dms_id); + if (isError($download)) return $download; - // Download file - $this->outputFile(getData($download)); + // Download file + $this->outputFile(getData($download)); } /** @@ -221,10 +221,10 @@ class requestAnrechnung extends Auth_Controller private function _setAuthUID() { $this->_uid = getAuthUID(); - + if (!$this->_uid) show_error('User authentification failed'); } - + /** * Check if application deadline is expired. * @@ -237,7 +237,7 @@ class requestAnrechnung extends Auth_Controller private function _isExpired($start, $ende, $studiensemester_kurzbz) { $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); - + // If start is not given, set to Semesterstart. if (!isset($start) || isEmptyString($start)) { @@ -245,7 +245,7 @@ class requestAnrechnung extends Auth_Controller $result = $this->StudiensemesterModel->load($studiensemester_kurzbz); $start = getData($result)[0]->start; } - + // If ende is not given, set to Semesterende. if (!isset($ende) || isEmptyString($ende)) { @@ -253,15 +253,15 @@ class requestAnrechnung extends Auth_Controller $result = $this->StudiensemesterModel->load($studiensemester_kurzbz); $ende = getData($result)[0]->ende; } - + $today = new DateTime('today midnight'); $start = new DateTime($start); $ende = new DateTime($ende); - + // True if expired return ($today < $start || $today > $ende); } - + /** * Check if user is entitled to read dms doc. * @@ -273,9 +273,9 @@ class requestAnrechnung extends Auth_Controller { show_error('Failed loading Student'); } - + $result = $this->AnrechnungModel->loadWhere(array('dms_id' => $dms_id)); - + if($result = getData($result)[0]) { if ($result->prestudent_id == $student->prestudent_id) @@ -283,10 +283,10 @@ class requestAnrechnung extends Auth_Controller return; } } - + show_error('You are not entitled to read this document'); } - + /** * Check if application already exists. * @@ -302,15 +302,15 @@ class requestAnrechnung extends Auth_Controller 'studiensemester_kurzbz' => $studiensemester_kurzbz, 'prestudent_id' => $prestudent_id )); - + if (isError($result)) { show_error(getError($result)); } - + return hasData($result); } - + /** * Check if applications' study semester is actual study semester. * @@ -322,10 +322,10 @@ class requestAnrechnung extends Auth_Controller $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); $result = $this->StudiensemesterModel->getNearest(); $actual_ss = getData($result)[0]->studiensemester_kurzbz; - + return $studiensemester_kurzbz == $actual_ss; } - + private function _LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id) { // Get Note of Lehrveranstaltung @@ -336,12 +336,12 @@ class requestAnrechnung extends Auth_Controller 'lehrveranstaltung_id' => $lehrveranstaltung_id ) ); - + // If Lehrveranstaltung has Note if (hasData($result)) { $note = getData($result)[0]->note; - + // Check if Note is a blocking grade if (in_array($note, $this->config->item('grades_blocking_application'))) { @@ -350,7 +350,7 @@ class requestAnrechnung extends Auth_Controller } return false; } - + /** * Upload file via DMS library. * @@ -367,7 +367,7 @@ class requestAnrechnung extends Auth_Controller 'insertamum' => (new DateTime())->format('Y-m-d H:i:s'), 'insertvon' => $this->_uid ); - + // Upload document return $this->dmslib->upload($dms, 'uploadfile', array('pdf')); } diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 76011dc04..42b9c3cfa 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -88,6 +88,12 @@ class InfoCenter extends Auth_Controller 'message' => 'Type of Document %s was updated, set to %s', 'success' => null ), + 'deletedoc' => array( + 'logtype' => 'Action', + 'name' => 'Document deleted', + 'message' => 'Document %s deleted', + 'success' => null + ), ); // Name of Interessentenstatus @@ -131,6 +137,7 @@ class InfoCenter extends Auth_Controller 'reloadZgvPruefungen' => 'infocenter:r', 'reloadMessages' => 'infocenter:r', 'reloadDoks' => 'infocenter:r', + 'reloadUebersichtDoks' => 'infocenter:r', 'reloadNotizen' => array('infocenter:r', 'lehre/zgvpruefung:r'), 'reloadLogs' => 'infocenter:r', 'outputAkteContent' => array('infocenter:r', 'lehre/zgvpruefung:r'), @@ -142,7 +149,9 @@ class InfoCenter extends Auth_Controller 'getStudienjahrEnd' => array('infocenter:r', 'lehre/zgvpruefung:r'), 'setNavigationMenuArrayJson' => 'infocenter:r', 'getAbsageData' => 'infocenter:r', - 'saveAbsageForAll' => 'infocenter:rw' + 'saveAbsageForAll' => 'infocenter:rw', + 'deleteDoc' => 'infocenter:rw', + 'getStudienartData' => 'infocenter:rw' ) ); @@ -159,6 +168,10 @@ class InfoCenter extends Auth_Controller $this->load->model('system/Message_model', 'MessageModel'); $this->load->model('system/Filters_model', 'FiltersModel'); $this->load->model('system/PersonLock_model', 'PersonLockModel'); + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $this->load->model('codex/Zgv_model', 'ZgvModel'); + $this->load->model('codex/Zgvmaster_model', 'ZgvmasterModel'); + $this->load->model('codex/Nation_model', 'NationModel'); // Loads libraries $this->load->library('PersonLogLib'); @@ -398,6 +411,35 @@ class InfoCenter extends Auth_Controller $this->outputJsonSuccess(array($json)); } + public function deleteDoc($person_id) + { + $akte_id = $this->input->post('akteid'); + + if (isset($akte_id) && isset($person_id)) + { + $this->load->library('AkteLib'); + $akte = $this->aktelib->get($akte_id); + + if (hasData($akte)) + { + $akte = getData($akte); + if ($akte->person_id === $person_id) + { + $result = $this->aktelib->remove($akte_id); + + if (isError($result)) + { + $this->terminateWithJsonError('Error deleting document'); + } + + $this->_log($person_id, 'deletedoc', array($akte->bezeichnung)); + + $this->outputJsonSuccess('success'); + } + } + } + } + /** * Gets prestudent data for a person in json format * @param $person_id @@ -1074,6 +1116,17 @@ class InfoCenter extends Auth_Controller $this->load->view('system/infocenter/dokNachzureichend.php', array('dokumente_nachgereicht' => $dokumente_nachgereicht->retval)); } + public function reloadUebersichtDoks($person_id) + { + $dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false); + + $this->DokumentModel->addOrder('bezeichnung'); + $dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load()))); + $data = array_merge($dokumentdata, ['dokumente' => $dokumente->retval]); + + $this->load->view('system/infocenter/dokpruefung.php', $data); + } + /** * Outputs content of an Akte, sends appropriate headers (so the document can be downloaded) * @param $akte_id @@ -1932,10 +1985,13 @@ class InfoCenter extends Auth_Controller $abwstatusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; $intstatusgruende = $this->StatusgrundModel->getStatus(self::INTERESSENTSTATUS)->retval; + $studienArtBerechtigung = array_column($this->getStudienArtBerechtigung(), 'typ'); + $data = array ( 'zgvpruefungen' => $zgvpruefungen, 'abwstatusgruende' => $abwstatusgruende, - 'intstatusgruende' => $intstatusgruende + 'intstatusgruende' => $intstatusgruende, + 'studienArtBerechtigung' => $studienArtBerechtigung ); return $data; @@ -2194,18 +2250,36 @@ class InfoCenter extends Auth_Controller public function getAbsageData() { - $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter'); + $stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, ['b', 'm']); - $statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; - $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); - $studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(['b', 'm'], $studienSemester); + if (hasData($stg_typ)) + { + $stg_typ = getData($stg_typ); + $statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; + $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); + $studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(array_column($stg_typ, 'typ'), $studienSemester); - $data = array ( - 'statusgruende' => $statusgruende, - 'studiengaenge' => $studiengaenge->retval - ); + $data = array ( + 'statusgruende' => $statusgruende, + 'studiengaenge' => $studiengaenge->retval + ); - $this->outputJsonSuccess($data); + $this->outputJsonSuccess($data); + } + else + $this->outputJsonSuccess(null); + } + + public function getStudienArtBerechtigung() + { + $studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter'); + $stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, ['b', 'm', 'l']); + return getData($stg_typ); + } + public function getStudienartData() + { + $this->outputJsonSuccess($this->getStudienArtBerechtigung()); } public function saveAbsageForAll() diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index 4e555be6c..bdd5316e7 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -22,11 +22,16 @@ class DB_Model extends CI_Model const PGSQL_BOOLEAN_FALSE = 'f'; const PGSQL_BOOLEAN_TYPE = 'bool'; const PGSQL_BOOLEAN_ARRAY_TYPE = '_bool'; + const PGSQL_INT2_TYPE = 'int2'; + const PGSQL_INT4_TYPE = 'int4'; + const PGSQL_INT8_TYPE = 'int8'; + const PGSQL_FLOAT4_TYPE = 'float4'; + const PGSQL_FLOAT8_TYPE = 'float8'; protected $dbTable; // Name of the DB-Table for CI-Insert, -Update, ... - protected $pk; // Name of the PrimaryKey for DB-Update, Load, ... + protected $pk; // Name of the PrimaryKey for DB-Update, Load, ... protected $hasSequence; // False if this table has a composite primary key that is not using a sequence - // True if this table has a primary key that uses a sequence + // True if this table has a primary key that uses a sequence private $executedQueryMetaData; private $executedQueryListFields; @@ -271,11 +276,6 @@ class DB_Model extends CI_Model /** * Load data and convert a record into a list of data from the main table, * and linked to every element, the data from the side tables - * - * TODO: - * - Adding support for composed primary key - * - Adding support for cascading side tables (useful?) - * * NOTE: sub queries are not supported in the from clause * * @return array @@ -598,6 +598,28 @@ class DB_Model extends CI_Model return $val; } + /** + * Convert PG-Int* to PHP-Integer + */ + public function pgIntPhp($val) + { + // If it is null, let it be null + if ($val == null) return $val; + + return intval($val); + } + + /** + * Convert PG-Float* to PHP-Float + */ + public function pgFloatPhp($val) + { + // If it is null, let it be null + if ($val == null) return $val; + + return floatval($val); + } + /** * Converts from PostgreSQL array to php array * It also takes care about array of booleans @@ -892,6 +914,11 @@ class DB_Model extends CI_Model // If array type, boolean type OR a UDF if (strpos($eqmd->type, DB_Model::PGSQL_ARRAY_TYPE) !== false || $eqmd->type == DB_Model::PGSQL_BOOLEAN_TYPE + || $eqmd->type == DB_Model::PGSQL_INT2_TYPE + || $eqmd->type == DB_Model::PGSQL_INT4_TYPE + || $eqmd->type == DB_Model::PGSQL_INT8_TYPE + || $eqmd->type == DB_Model::PGSQL_FLOAT4_TYPE + || $eqmd->type == DB_Model::PGSQL_FLOAT8_TYPE || $this->udflib->isUDFColumn($eqmd->name, $eqmd->type)) { // If UDFs are inside this result set @@ -941,6 +968,19 @@ class DB_Model extends CI_Model { $resultElement->{$toBeConverted->name} = $this->pgBoolPhp($resultElement->{$toBeConverted->name}); } + // Integer type + elseif ($toBeConverted->type == DB_Model::PGSQL_INT2_TYPE + || $toBeConverted->type == DB_Model::PGSQL_INT4_TYPE + || $toBeConverted->type == DB_Model::PGSQL_INT8_TYPE) + { + $resultElement->{$toBeConverted->name} = $this->pgIntPhp($resultElement->{$toBeConverted->name}); + } + // Float type + elseif ($toBeConverted->type == DB_Model::PGSQL_FLOAT4_TYPE + || $toBeConverted->type == DB_Model::PGSQL_FLOAT8_TYPE) + { + $resultElement->{$toBeConverted->name} = $this->pgFloatPhp($resultElement->{$toBeConverted->name}); + } } } } diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index ee197ab05..86a81fb55 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -80,14 +80,24 @@ class AnrechnungLib // Get latest ZGV $result = $this->ci->PrestudentModel->getLatestZGVBezeichnung($prestudent_id); $latest_zgv_bezeichnung = hasData($result) ? getData($result)[0]->bezeichnung : ''; - + + // Get Sum of berufliche and schulische ECTS + $result = $this->ci->LehrveranstaltungModel->getEctsSumSchulisch($uid, $prestudent_id, $lv->studiengang_kz); + $sumEctsSchulisch = getData($result)[0]->ectssumschulisch; + + $result = $this->ci->LehrveranstaltungModel->getEctsSumBeruflich($uid); + $sumEctsBeruflich = getData($result)[0]->ectssumberuflich; + // Set the given studiensemester $antrag_data->lv_id = $lv_id; $antrag_data->lv_bezeichnung = $lv->bezeichnung; $antrag_data->ects = $lv->ects; + $antrag_data->sumEctsSchulisch = $sumEctsSchulisch; + $antrag_data->sumEctsBeruflich = $sumEctsBeruflich; $antrag_data->studiensemester_kurzbz = $studiensemester_kurzbz; $antrag_data->vorname = $person->vorname; $antrag_data->nachname = $person->nachname; + $antrag_data->student_uid = $uid; $antrag_data->matrikelnr = $student->matrikelnr; $antrag_data->studiengang_kz = $studiengang->studiengang_kz; $antrag_data->stg_bezeichnung = $studiengang->bezeichnung; @@ -112,6 +122,7 @@ class AnrechnungLib $anrechnung_data = new StdClass(); + $this->ci->AnrechnungModel->addJoin('lehre.tbl_anrechnung_begruendung', 'begruendung_id'); $result = $this->ci->AnrechnungModel->load($anrechnung_id); if (isError($result)) @@ -145,6 +156,7 @@ class AnrechnungLib $anrechnung_data->prestudent_id = ''; $anrechnung_data->lehrveranstaltung = ''; $anrechnung_data->begruendung_id = ''; + $anrechnung_data->begruendung = ''; $anrechnung_data->anmerkung = ''; $anrechnung_data->dms_id = ''; $anrechnung_data->insertamum = ''; @@ -155,6 +167,7 @@ class AnrechnungLib $anrechnung_data->status = getUserLanguage() == 'German' ? 'neu' : 'new'; $anrechnung_data->dokumentname = ''; + $this->ci->AnrechnungModel->addJoin('lehre.tbl_anrechnung_begruendung', 'begruendung_id'); $result = $this->ci->AnrechnungModel->loadWhere( array( 'lehrveranstaltung_id' => $lehrveranstaltung_id, @@ -800,6 +813,7 @@ class AnrechnungLib $anrechnung_data->prestudent_id = $anrechnung->prestudent_id; $anrechnung_data->lehrveranstaltung_id = $anrechnung->lehrveranstaltung_id; $anrechnung_data->begruendung_id = $anrechnung->begruendung_id; + $anrechnung_data->begruendung = $anrechnung->bezeichnung; $anrechnung_data->anmerkung = $anrechnung->anmerkung_student; $anrechnung_data->dms_id = $anrechnung->dms_id; $anrechnung_data->insertamum = (new DateTime($anrechnung->insertamum))->format('d.m.Y'); @@ -823,4 +837,110 @@ class AnrechnungLib return $anrechnung_data; } + + /** + * If Student is a Quereinsteiger, get ECTS Summe of all angerechnete Studiensemester. + * + * @param $prestudent_id + * @param $studiengang_kz Studiengang_kz der LV + * @return int|mixed + */ + public function getQuereinsteigerEctsSumme($prestudent_id, $studiengang_kz) + { + $sumEctsQuereinsteiger = 0; + + // Check, if student is Quereinsteiger + $this->ci->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel'); + $result = $this->ci->PrestudentstatusModel->getFirstStatus($prestudent_id, 'Student'); + + $prestudentFirstStudentStatus = getData($result)[0]; + + // If Prestudent is not a Quereinsteiger + if ($prestudentFirstStudentStatus->ausbildungssemester == 1) + { + return $sumEctsQuereinsteiger; // return 0 + } + + $anzahlAngerechneteStudiensemester = $prestudentFirstStudentStatus->ausbildungssemester - 1; + + // If Prestudent is a Quereinsteiger + if ($prestudentFirstStudentStatus->ausbildungssemester > 1) + { + // Get the 'angerechnete Studiensemester' + $this->ci->load->model('organisations/Studiensemester_model', 'StudiensemesterModel'); + $result = $this->ci->StudiensemesterModel->getPreviousFrom( + $prestudentFirstStudentStatus->studiensemester_kurzbz, + $anzahlAngerechneteStudiensemester + ); + + // Get ECTS Summe of each 'angerechnetes Studiensemester' + foreach (getData($result) as $studiensemester) + { + $result = $this->ci->LehrveranstaltungModel->getSumQuereinstiegsECTSProSemester( + $studiengang_kz, + $studiensemester->studiensemester_kurzbz, + $anzahlAngerechneteStudiensemester--, + $prestudentFirstStudentStatus->orgform_kurzbz + ); + + if (hasData($result)) + { + $sumEctsQuereinsteiger = $sumEctsQuereinsteiger + getData($result)[0]->sum_ects; + } + } + } + return $sumEctsQuereinsteiger; // return sum of ects of all 'angerechnete Studiensemester' + } + + /** + * Get ECTS Summe of all Anrechnungen based on schulische Kenntnisse. + * + * @param $student_uid + * @return int|mixed + */ + public function getSchulischeAnrechnungenEctsSumme($student_uid) + { + $sumEctsSchule = 0; + + $result = $this->ci->LehrveranstaltungModel->getSumAngerechneteECTSByBegruendung($student_uid); + + if (hasData($result)) + { + foreach (getData($result) as $ects) + { + if ($ects->begruendung_id != 4) + { + $sumEctsSchule = $sumEctsSchule + $ects->sum; + } + } + } + + return $sumEctsSchule; + } + + /** + * Get ECTS Summe of all Anrechnungen based on berufliche Kenntnisse. + * + * @param $student_uid + * @return int + */ + public function getBeruflicheAnrechnungenEctsSumme($student_uid) + { + $sumEctsBeruflich = 0; + + $result = $this->ci->LehrveranstaltungModel->getSumAngerechneteECTSByBegruendung($student_uid); + + if (hasData($result)) + { + foreach (getData($result) as $ects) + { + if ($ects->begruendung_id == 4) + { + $sumEctsBeruflich = $ects->sum; + } + } + } + + return $sumEctsBeruflich; + } } diff --git a/application/libraries/DmsLib.php b/application/libraries/DmsLib.php index b2c53a7d9..fccfe503b 100644 --- a/application/libraries/DmsLib.php +++ b/application/libraries/DmsLib.php @@ -50,62 +50,57 @@ class DmsLib $kategorie_kurzbz = null, $dokument_kurzbz = null, $beschreibung = null, $cis_suche = false, $schlagworte = null ) { - // write file with content of fileHandle - $writeFileResult = $this->_writeNewFile($name, $fileHandle); + // create unique filename, using original document name to detect file extension + $filename = $this->_getUniqueFilename($name); - if (isError($writeFileResult)) return $writeFileResult; + // copy file from fileHandle to dms folder + $copyFileResult = $this->_copyFile($fileHandle, $filename); - if (hasData($writeFileResult)) + if (isError($copyFileResult)) return $copyFileResult; + + // if file written successful, insert dms + $dmsResult = $this->_ci->DmsModel->insert( + array( + 'kategorie_kurzbz' => $kategorie_kurzbz, + 'dokument_kurzbz' => $dokument_kurzbz + ) + ); + + if (isError($dmsResult)) return $dmsResult; + + if (hasData($dmsResult)) { - $writeFileData = getData($writeFileResult); - $filename = $writeFileData->filename; + $dms_id = getData($dmsResult); + $version = 0; - // if file written successful, insert dms - $dmsResult = $this->_ci->DmsModel->insert( - array( - 'kategorie_kurzbz' => $kategorie_kurzbz, - 'dokument_kurzbz' => $dokument_kurzbz - ) + // insert dms version + $dmsVersion = array( + 'dms_id' => $dms_id, + 'version' => $version, + 'filename' => $filename, + 'mimetype' => $mimetype, + 'name' => $name, + 'beschreibung' => $beschreibung, + 'cis_suche' => $cis_suche, + 'schlagworte' => $schlagworte, + 'insertvon' => $this->_who, + 'insertamum' => date('Y-m-d H:i:s') ); - if (isError($dmsResult)) return $dmsResult; + $dmsVersionResult = $this->_ci->DmsVersionModel->insert($dmsVersion); - if (hasData($dmsResult)) - { - $dms_id = getData($dmsResult); - $version = 0; + if (isError($dmsVersionResult)) return $dmsVersionResult; - // insert dms version - $dmsVersion = array( - 'dms_id' => $dms_id, - 'version' => $version, - 'filename' => $filename, - 'mimetype' => $mimetype, - 'name' => $name, - 'beschreibung' => $beschreibung, - 'cis_suche' => $cis_suche, - 'schlagworte' => $schlagworte, - 'insertvon' => $this->_who, - 'insertamum' => date('Y-m-d H:i:s') - ); + // return dms info + $resObj = new stdClass(); + $resObj->dms_id = $dms_id; + $resObj->version = $version; + $resObj->filename = $filename; - $dmsVersionResult = $this->_ci->DmsVersionModel->insert($dmsVersion); - - if (isError($dmsVersionResult)) return $dmsVersionResult; - - // return dms info - $resObj = new stdClass(); - $resObj->dms_id = $dms_id; - $resObj->version = $version; - $resObj->filename = $filename; - - return success($resObj); - } - else - return error("error when inserting DMS"); + return success($resObj); } else - return error("file could not be written"); + return error("error when inserting DMS"); } /** @@ -125,46 +120,41 @@ class DmsLib $originalName = isset($name) ? $name : $lastVersion->name; - // write new file with content of fileHandle - $writeFileResult = $this->_writeNewFile($originalName, $fileHandle); + // create unique filename, using original document name to detect file extension + $filename = $this->_getUniqueFilename($originalName); - if (isError($writeFileResult)) return $writeFileResult; + // copy file from fileHandle to dms folder + $copyFileResult = $this->_copyFile($fileHandle, $filename); - if (hasData($writeFileResult)) - { - $writeFileData = getData($writeFileResult); - $filename = $writeFileData->filename; + if (isError($copyFileResult)) return $copyFileResult; - // insert new version - $newVersionNumber = $lastVersion->version + 1; + // insert new version + $newVersionNumber = $lastVersion->version + 1; - // if new parameters given, use them, otherwise use parameters from last version - $newVersion = array( - 'dms_id' => $dms_id, - 'name' => $originalName, - 'filename' => $filename, - 'version' => $newVersionNumber, - 'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype, - 'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung, - 'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche, - 'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte, - 'insertvon' => $this->_who, - 'insertamum' => date('Y-m-d H:i:s') - ); + // if new parameters given, use them, otherwise use parameters from last version + $newVersion = array( + 'dms_id' => $dms_id, + 'name' => $originalName, + 'filename' => $filename, + 'version' => $newVersionNumber, + 'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype, + 'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung, + 'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche, + 'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte, + 'insertvon' => $this->_who, + 'insertamum' => date('Y-m-d H:i:s') + ); - $addVersionResult = $this->_ci->DmsVersionModel->insert($newVersion); + $addVersionResult = $this->_ci->DmsVersionModel->insert($newVersion); - if (isError($addVersionResult)) return $addVersionResult; + if (isError($addVersionResult)) return $addVersionResult; - // return dms info - $resObj = new stdClass(); - $resObj->version = $newVersionNumber; - $resObj->filename = $filename; + // return dms info + $resObj = new stdClass(); + $resObj->version = $newVersionNumber; + $resObj->filename = $filename; - return success($resObj); - } - else - return error("file could not be written"); + return success($resObj); } else return error("last version not found"); @@ -185,44 +175,37 @@ class DmsLib if (hasData($lastVersionResult)) { $lastVersion = getData($lastVersionResult); + $filename = $lastVersion->filename; // update file in filesystem - $writeFileResult = $this->_writeFile($lastVersion->filename, $fileHandle); + $copyFileResult = $this->_copyFile($fileHandle, $filename); - if (isError($writeFileResult)) return $writeFileResult; + if (isError($copyFileResult)) return $copyFileResult; - if (hasData($writeFileResult)) - { - $writeFileData = getData($writeFileResult); - $filename = $writeFileData->filename; + // if new parameters given, use them, otherwise use parameters from last version + $newVersion = array( + 'name' => isset($name) ? $name : $lastVersion->name, + 'filename' => $filename, + 'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype, + 'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung, + 'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche, + 'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte, + ); - // if new parameters given, use them, otherwise use parameters from last version - $newVersion = array( - 'name' => isset($name) ? $name : $lastVersion->name, - 'filename' => $filename, - 'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype, - 'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung, - 'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche, - 'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte, - ); + // update last dms version + $addVersionResult = $this->_ci->DmsVersionModel->update( + array($dms_id, $lastVersion->version), + $newVersion + ); - // update last dms version - $addVersionResult = $this->_ci->DmsVersionModel->update( - array($dms_id, $lastVersion->version), - $newVersion - ); + if (isError($addVersionResult)) return $addVersionResult; - if (isError($addVersionResult)) return $addVersionResult; + // return dms info + $resObj = new stdClass(); + $resObj->version = $lastVersion->version; + $resObj->filename = $filename; - // return dms info - $resObj = new stdClass(); - $resObj->version = $lastVersion->version; - $resObj->filename = $filename; - - return success($resObj); - } - else - return error("file could not be written"); + return success($resObj); } else return error("last version not found"); @@ -441,68 +424,35 @@ class DmsLib // Private methods /** - * Writes file with content of fileHandle using original document name for file extension + * Copies file from sourceFileHandle to destinationFilename in DMS folder + * Returns success or error on fail */ - private function _writeNewFile($originalName, $fileHandle) + private function _copyFile($sourceFileHandle, $destinationFilename) { - // create unique filename, using original document name to detect file extension - $filename = $this->_getUniqueFilename($originalName); + // get file location from file handle + $metaData = stream_get_meta_data($sourceFileHandle); - // write the file - return $this->_writeFile($filename, $fileHandle); - } - - /** - * Writes file with content of fileHandle - * Returns number of bytes written and filename - */ - private function _writeFile($filename, $fileHandle) - { - // file content provided by fileHandle - $fileContent = ''; - - $readBlockResult = success(); - - // While the end of the file is not reached and the read does not fail - while (!feof($fileHandle) && isSuccess($readBlockResult = $this->_ci->DmsFSModel->readBlock($fileHandle))) + if (isset($metaData['uri']) && !isEmptyString($metaData['uri'])) { - // Concatenate the content of the file - $fileContent .= getData($readBlockResult); + // if file location determined, copy file + $source = $metaData['uri']; + + if (copy($source, DMS_PATH.$destinationFilename)) + { + return success(); + } + else + { + // error if copy returned false + return error('error occured while copying file'); + } } - - // If an error occurred while reading then return it - if (isError($readBlockResult)) return $readBlockResult; - - // open file for writing - $openFileResult = $this->_ci->DmsFSModel->openReadWrite($filename); - - if (isError($openFileResult)) return $openFileResult; - - if (!hasData($openFileResult)) return error("File could not be opened"); - - $newFileHandle = getData($openFileResult); - - // write file - $writeFileResult = $this->_ci->DmsFSModel->write($newFileHandle, $fileContent); - - if (isError($writeFileResult)) return $writeFileResult; - - // return number of bytes written and filename - $resObj = new stdClass(); - $resObj->bytesWritten = 0; - $resObj->filename = ''; - - if (hasData($writeFileResult)) + else { - $resObj->bytesWritten = getData($writeFileResult); - $resObj->filename = $filename; + // error when source location could not be determined + return error('error occured while getting source file name'); } - // close handle - $closeResult = $this->_ci->DmsFSModel->close($newFileHandle, $fileContent); - - if (isError($closeResult)) return $closeResult; - return success($resObj); } @@ -527,7 +477,7 @@ class DmsLib // ----------------------------------------------------------------------------------------------------------- // Deprecated methods, not to be used - + /** * Load a DMS Document. * If no version is particularly given, the latest version is loaded. @@ -543,7 +493,7 @@ class DmsLib $this->_ci->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id'); $this->_ci->DmsModel->addOrder('version', 'DESC'); $this->_ci->DmsModel->addLimit(1); - + if (!is_numeric($version)) { return $this->_ci->DmsModel->load($dms_id); @@ -620,7 +570,7 @@ class DmsLib return $result; } - + /** * Uploads a document and saves it to DMS * @param $dms DMS assoc array @@ -659,7 +609,7 @@ class DmsLib // Return result of uploaded data return success($upload_data); } - + /** * Download a document. * @@ -678,7 +628,7 @@ class DmsLib if (hasData($fileInfoResult)) { $fileObj = getData($fileInfoResult); - + // Change filename, if filename is provided if (!isEmptyString($filename)) $fileObj->name = $filename; @@ -694,7 +644,7 @@ class DmsLib // If no data have been found then return an empty success return success(); } - + /** * Get file information. * @@ -706,7 +656,7 @@ class DmsLib { // Checks the dms_id parameter if (!is_numeric($dms_id)) return error('Wrong parameter'); - + // Load DMS from database $result = $this->load($dms_id, $version); if (isError($result)) return error(getError($result)); @@ -951,4 +901,3 @@ class DmsLib $this->_ci->upload->initialize($config); } } - diff --git a/application/models/codex/Nation_model.php b/application/models/codex/Nation_model.php index 239639795..a66b77edb 100644 --- a/application/models/codex/Nation_model.php +++ b/application/models/codex/Nation_model.php @@ -3,7 +3,7 @@ class Nation_model extends DB_Model { /** - * + * */ public function __construct() { @@ -11,4 +11,14 @@ class Nation_model extends DB_Model $this->dbTable = 'bis.tbl_nation'; $this->pk = 'nation_code'; } -} \ No newline at end of file + + /** + * getAllForStyled Dropdown + */ + public function getAll() + { + $allNations = 'SELECT * FROM bis.tbl_nation ORDER BY bis.tbl_nation.langtext ASC;'; + + return $this->execQuery($allNations); + } +} diff --git a/application/models/codex/Zgv_model.php b/application/models/codex/Zgv_model.php index 1e1ba99ad..0206d1292 100644 --- a/application/models/codex/Zgv_model.php +++ b/application/models/codex/Zgv_model.php @@ -11,4 +11,16 @@ class Zgv_model extends DB_Model $this->dbTable = 'bis.tbl_zgv'; $this->pk = 'zgv_code'; } + + /** + * getAllForStyled Dropdown + */ + public function getAllZgv() + { + $allZgv = 'SELECT * FROM bis.tbl_zgv ORDER BY zgv_bez ASC;'; + + return $this->execQuery($allZgv); + } + + } diff --git a/application/models/codex/Zgvmaster_model.php b/application/models/codex/Zgvmaster_model.php index 38f8a0dcb..0f6305532 100644 --- a/application/models/codex/Zgvmaster_model.php +++ b/application/models/codex/Zgvmaster_model.php @@ -11,4 +11,14 @@ class Zgvmaster_model extends DB_Model $this->dbTable = 'bis.tbl_zgvmaster'; $this->pk = 'zgvmas_code'; } + + /** + * getAllForStyled Dropdown + */ + public function getAllZgvmaster() + { + $allZgvMaster = 'SELECT * FROM bis.tbl_zgvmaster ORDER BY zgvmas_bez ASC;'; + + return $this->execQuery($allZgvMaster); + } } diff --git a/application/models/crm/Dokumentprestudent_model.php b/application/models/crm/Dokumentprestudent_model.php index ab4764479..0a6669359 100644 --- a/application/models/crm/Dokumentprestudent_model.php +++ b/application/models/crm/Dokumentprestudent_model.php @@ -10,6 +10,7 @@ class Dokumentprestudent_model extends DB_Model parent::__construct(); $this->dbTable = 'public.tbl_dokumentprestudent'; $this->pk = array('prestudent_id', 'dokument_kurzbz'); + $this->hasSequence = false; } /** diff --git a/application/models/crm/Konto_model.php b/application/models/crm/Konto_model.php index 32fdd97c9..4b2a259c9 100644 --- a/application/models/crm/Konto_model.php +++ b/application/models/crm/Konto_model.php @@ -74,10 +74,11 @@ class Konto_model extends DB_Model } } - public function getLastStudienbeitrag($uid, $buchungstypen) + public function getStudienbeitraege($uid, $buchungstypen) { $query = 'SELECT konto.studiensemester_kurzbz - FROM public.tbl_konto konto, + FROM public.tbl_konto konto + JOIN public.tbl_studiensemester studiensemester ON konto.studiensemester_kurzbz = studiensemester.studiensemester_kurzbz, public.tbl_benutzer, public.tbl_student WHERE tbl_benutzer.uid = \'' . $uid . '\' @@ -91,7 +92,7 @@ class Konto_model extends DB_Model WHERE skonto.buchungsnr = konto.buchungsnr_verweis OR skonto.buchungsnr_verweis = konto.buchungsnr_verweis ) - ORDER BY buchungsnr DESC LIMIT 1; + ORDER BY studiensemester.start DESC; '; return $this->execQuery($query); diff --git a/application/models/crm/Prestudentstatus_model.php b/application/models/crm/Prestudentstatus_model.php index 3335de021..f39a41fda 100644 --- a/application/models/crm/Prestudentstatus_model.php +++ b/application/models/crm/Prestudentstatus_model.php @@ -52,6 +52,24 @@ class Prestudentstatus_model extends DB_Model return $this->execQuery($query, $parametersArray); } + /** + * Liefert den Ersten Status eines Prestudenten mit der übergebenen Statuskurzbezeichnung. + * + * @param $prestudent_id + * @param $status_kurzbz + * @return array + */ + public function getFirstStatus($prestudent_id, $status_kurzbz) + { + $this->addOrder('datum, insertamum, ext_id'); + $this->addLimit(1); + + return $this->loadWhere(array( + 'prestudent_id' => $prestudent_id, + 'status_kurzbz' => $status_kurzbz + )); + } + /** * updateStufe */ diff --git a/application/models/crm/Student_model.php b/application/models/crm/Student_model.php index 4d1c84521..4404beb54 100644 --- a/application/models/crm/Student_model.php +++ b/application/models/crm/Student_model.php @@ -66,4 +66,20 @@ class Student_model extends DB_Model return $result->retval[0]->student_uid; } + + public function searchStudent($filter) + { + $this->addSelect('vorname, nachname, gebdatum, person.person_id, student_uid'); + $this->addJoin('public.tbl_prestudent ps', 'prestudent_id'); + $this->addJoin('public.tbl_person person', 'person_id'); + + $result = $this->loadWhere( + "lower(student_uid) like ".$this->db->escape('%'.$filter.'%')." + OR lower(person.nachname) like ".$this->db->escape('%'.$filter.'%')." + OR lower(person.vorname) like ".$this->db->escape('%'.$filter.'%')." + OR lower(person.nachname || ' ' || person.vorname) like ".$this->db->escape('%'.$filter.'%')." + OR lower(person.vorname || ' ' || person.nachname) like ".$this->db->escape('%'.$filter.'%')); + + return $result; + } } diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 0390613f7..f54443955 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -313,7 +313,7 @@ class Lehrveranstaltung_model extends DB_Model /** * Sucht nach LV Templates und gibt Id und Label ("bezeichnung [kurzbz]") aus * Diese funktion ist für autocomplete gedacht - * + * * @param string $filter Suchfilter * @return \stdClass A return object */ @@ -337,7 +337,7 @@ class Lehrveranstaltung_model extends DB_Model /** * Lädt Template und gibt Id und Label ("bezeichnung [kurzbz]") zurück * Diese funktion ist für autocomplete gedacht - * + * * @param string $name * @return \stdClass A return object */ @@ -355,4 +355,120 @@ class Lehrveranstaltung_model extends DB_Model return $this->execQuery($qry); } + + /** + * Get ECTS Summe pro angerechnetes Quereinstiegssemester. + * + * @param $studiengang_kz + * @param $studiensemester_kurzbz + * @param $ausbildungssemester + * @param $orgform_kurzbz + * @return array|stdClass|null + */ + public function getSumQuereinstiegsECTSProSemester($studiengang_kz, $studiensemester_kurzbz, $ausbildungssemester, $orgform_kurzbz) + { + $qry = ' + SELECT + sum(tbl_lehrveranstaltung.ects) as "sum_ects" + FROM + lehre.tbl_studienplan + JOIN lehre.tbl_studienplan_lehrveranstaltung USING (studienplan_id) + JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id) + WHERE + tbl_studienplan.studienplan_id = ( + SELECT + studienplan_id + FROM + lehre.tbl_studienordnung + JOIN lehre.tbl_studienplan USING (studienordnung_id) + JOIN lehre.tbl_studienplan_semester USING (studienplan_id) + WHERE tbl_studienordnung.studiengang_kz = ? + AND tbl_studienplan_semester.semester = ? + AND tbl_studienplan_semester.studiensemester_kurzbz = ? + AND tbl_studienplan.orgform_kurzbz = ? + + LIMIT 1 + ) + AND tbl_studienplan_lehrveranstaltung.semester = ? + AND studienplan_lehrveranstaltung_id_parent IS NULL -- auf Modulebene + AND tbl_studienplan_lehrveranstaltung.export = TRUE + '; + + return $this->execQuery($qry, array( + $studiengang_kz, $ausbildungssemester, $studiensemester_kurzbz, $orgform_kurzbz, $ausbildungssemester) + ); + } + + /** + * Get ECTS Summe aller bisher angerechneten LVs. + * Wenn keine explizite Begruendung angegeben ist, wird eine schulische Begruendung angenommen. + * + * @param $student_uid + * @return array|stdClass|null + */ + public function getSumAngerechneteECTSByBegruendung($student_uid) + { + $qry = ' + SELECT sum(ects), begruendung_id FROM ( + SELECT + lehrveranstaltung_id, studiensemester_kurzbz, ects, COALESCE(begruendung_id, 1) as begruendung_id -- fallback auf externes Zeugnis + FROM + lehre.tbl_zeugnisnote + LEFT JOIN lehre.tbl_anrechnung USING(lehrveranstaltung_id, studiensemester_kurzbz) + JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id) + JOIN public.tbl_student USING(student_uid) + WHERE + tbl_zeugnisnote.note = 6 + AND student_uid = ? + AND (lehre.tbl_anrechnung.prestudent_id = tbl_student.prestudent_id + OR lehre.tbl_anrechnung.prestudent_id is null) + + UNION + + SELECT + lehrveranstaltung_id, studiensemester_kurzbz, ects, begruendung_id -- fallback auf externes Zeugnis + FROM + lehre.tbl_anrechnung + JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id) + JOIN public.tbl_student USING(prestudent_id) + WHERE + genehmigt_von is not null + AND student_uid = ? + ) lvsangerechnet + GROUP BY begruendung_id + '; + + return $this->execQuery($qry, array($student_uid, $student_uid)); + } + + /** + * Get ECTS Summe aller bisher schulisch begruendeten angerechneten LVs. + * Derzeit wird auch jede Anrechnung, die nicht beruflich ist, als schulisch angenommen. + * + * @param $student_uid + * @return array|stdClass|null + */ + public function getEctsSumSchulisch($student_uid, $prestudent_id, $studiengang_kz) + { + $qry = ' + SELECT get_ects_summe_schulisch(?, ?, ?) AS ectsSumSchulisch + '; + + return $this->execQuery($qry, array($student_uid, $prestudent_id, $studiengang_kz)); + } + + /** + * Get ECTS Summe aller bisher beruflich angerechneten LVs. + * + * @param $student_uid + * @return array|stdClass|null + */ + public function getEctsSumBeruflich($student_uid) + { + $qry = ' + SELECT get_ects_summe_beruflich(?) AS ectsSumBeruflich + '; + + return $this->execQuery($qry, array($student_uid)); + } } diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 0d0c248a6..e848cb4c2 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -507,4 +507,14 @@ class Studiengang_model extends DB_Model return $this->execQuery($query, array($typ, $semester)); } + + public function getStudiengangTyp($studiengang_kz, $typ) + { + $query = "SELECT DISTINCT(sgt.*) + FROM tbl_studiengangstyp sgt JOIN tbl_studiengang sg on sgt.typ = sg.typ + WHERE studiengang_kz IN ? and sgt.typ IN ?"; + + return $this->execQuery($query, array($studiengang_kz, $typ)); + + } } diff --git a/application/models/organisation/Studiensemester_model.php b/application/models/organisation/Studiensemester_model.php index e7a3d77b1..bb9b94c92 100644 --- a/application/models/organisation/Studiensemester_model.php +++ b/application/models/organisation/Studiensemester_model.php @@ -105,7 +105,7 @@ class Studiensemester_model extends DB_Model /** * getPreviousFrom */ - public function getPreviousFrom($studiensemester_kurzbz) + public function getPreviousFrom($studiensemester_kurzbz, $limit = 1) { $query = 'SELECT studiensemester_kurzbz, start, @@ -117,9 +117,9 @@ class Studiensemester_model extends DB_Model WHERE studiensemester_kurzbz = ? ) ORDER BY start DESC - LIMIT 1'; + LIMIT ?'; - return $this->execQuery($query, array($studiensemester_kurzbz)); + return $this->execQuery($query, array($studiensemester_kurzbz, $limit)); } /** diff --git a/application/models/ressource/Betriebsmittelperson_model.php b/application/models/ressource/Betriebsmittelperson_model.php index 7d9689753..04878a9ad 100644 --- a/application/models/ressource/Betriebsmittelperson_model.php +++ b/application/models/ressource/Betriebsmittelperson_model.php @@ -72,4 +72,28 @@ class Betriebsmittelperson_model extends DB_Model return $this->loadWhere($where); } + + public function getBetriebsmittelByUid($uid, $betriebsmitteltyp = null, $isRetourniert = false) + { + $this->addJoin('wawi.tbl_betriebsmittel', 'betriebsmittel_id'); + + $condition = ' wawi.tbl_betriebsmittelperson.uid = '. $this->escape($uid); + + if (is_string($betriebsmitteltyp)) + { + $condition .= ' AND betriebsmitteltyp = ' . $this->escape($betriebsmitteltyp); + } + + if ($isRetourniert === true) { + $condition .= ' AND retouram IS NOT NULL'; + } + elseif ($isRetourniert === false) + { + $condition .= ' AND retouram IS NULL'; + } + + $this->addOrder('ausgegebenam', 'DESC'); + + return $this->loadWhere($condition); + } } diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php index cd38fd9ac..248dd33ca 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -44,7 +44,8 @@ $this->load->view( 'empfehlungsanforderungWirklichZuruecknehmen', 'erfolgreichZurueckgenommen', 'empfehlungPositivConfirmed', - 'empfehlungNegativConfirmed' + 'empfehlungNegativConfirmed', + 'anrechnungEctsTooltipTextBeiUeberschreitung' ) ), 'customCSSs' => array( @@ -59,7 +60,6 @@ $this->load->view( ); ?> -
@@ -124,11 +124,27 @@ $this->load->view( p->t('lehre', 'ects'); ?> - ects ?> + ects ?> + + + p->t('anrechnung', 'bisherAngerechneteEcts'); ?> + + + + + + Total: sumEctsSchulisch + $antragData->sumEctsBeruflich, 1) ?> + [Schulisch: sumEctsSchulisch ?> / + Beruflich: sumEctsBeruflich ?> ] + + + p->t('lehre', 'lektorInnen'); ?> - + lektoren) - 1 ?> lektoren as $key => $lektor): ?> vorname . ' ' . $lektor->nachname; @@ -138,19 +154,23 @@ $this->load->view( p->t('global', 'zgv')); ?> - zgv ?> + zgv ?> p->t('anrechnung', 'herkunftDerKenntnisse'); ?> - anmerkung ?> + anmerkung ?> p->t('anrechnung', 'nachweisdokumente'); ?> - + dokumentname) ?> + + p->t('global', 'begruendung'); ?> + begruendung ?> +
@@ -178,8 +198,10 @@ $this->load->view(
- + + + + @@ -291,38 +313,44 @@ $this->load->view( -load->view('templates/FHC-Footer'); ?> diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index 308f702a3..e2452fb13 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -87,7 +87,6 @@ $this->load->view( ); ?> -
@@ -134,28 +133,34 @@ $this->load->view( id="approveAnrechnungUebersicht-begruendung-panel">

p->t('anrechnung', 'genehmigungenNegativQuestion'); ?>

-  p->t('anrechnung', 'bitteBegruendungAngeben'); ?>

-
    -
  1. p->t('anrechnung', 'genehmigungNegativPruefungNichtMoeglich'); ?> - - - -
  2. -
  3. p->t('anrechnung', 'genehmigungNegativKenntnisseNichtGleichwertig'); ?> - - - -
  4. -
  5. p->t('anrechnung', 'andereBegruendung'); ?>
  6. -
-
+  p->t('anrechnung', 'bitteBegruendungAngeben'); ?> p->t('anrechnung', 'begruendungWirdFuerAlleUebernommen'); ?> -

+
+

+
    +
  1. p->t('anrechnung', 'genehmigungNegativPruefungNichtMoeglich'); ?> + + + +
  2. +
  3. p->t('anrechnung', 'genehmigungNegativKenntnisseNichtGleichwertig'); ?> + + + +
  4. +
  5. p->t('anrechnung', 'genehmigungNegativEctsHoechstgrenzeUeberschritten'); ?> + + + +
  6. +
+ rows="2" + placeholder="p->t('anrechnung', 'textUebernehmenOderEigenenBegruendungstext'); ?>" required>

@@ -249,6 +254,5 @@ $this->load->view(
-load->view('templates/FHC-Footer'); ?> diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php index 368af8b12..83370769f 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php @@ -16,7 +16,7 @@ $query = ' anrechnung.dms_id, anrechnung.studiensemester_kurzbz, stg.studiengang_kz, - stg.bezeichnung AS "stg_bezeichnung", + stg.bezeichnung AS stg_bezeichnung, lv.orgform_kurzbz, (SELECT ausbildungssemester FROM public.tbl_prestudentstatus press @@ -26,8 +26,10 @@ $query = ' ORDER BY press.datum DESC LIMIT 1 ), - lv.bezeichnung AS "lv_bezeichnung", - lv.ects, + lv.bezeichnung AS lv_bezeichnung, + lv.ects::numeric(4,1), + get_ects_summe_schulisch(student.student_uid, anrechnung.prestudent_id, stg.studiengang_kz) AS ectsSumSchulisch, + get_ects_summe_beruflich(student.student_uid) AS ectsSumBeruflich, (person.nachname || \' \' || person.vorname) AS "student", begruendung.bezeichnung AS "begruendung", dmsversion.name AS "dokument_bezeichnung", @@ -49,7 +51,9 @@ $query = ' WHERE anrechnung_id = anrechnung.anrechnung_id ORDER BY insertamum DESC LIMIT 1 - ) AS status_kurzbz + ) AS status_kurzbz, + student.student_uid, + anrechnung.prestudent_id FROM lehre.tbl_anrechnung AS anrechnung JOIN public.tbl_prestudent USING (prestudent_id) JOIN public.tbl_person AS person USING (person_id) @@ -58,44 +62,69 @@ $query = ' LEFT JOIN campus.tbl_dms_version AS dmsversion USING (dms_id) JOIN lehre.tbl_anrechnung_anrechnungstatus USING (anrechnung_id) JOIN lehre.tbl_anrechnung_begruendung AS begruendung USING (begruendung_id) + JOIN public.tbl_student student USING (prestudent_id) + WHERE anrechnung.studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\' + AND stg.studiengang_kz IN (' . $STUDIENGAENGE_ENTITLED . ') ) - SELECT anrechnungen.*, - array_to_json(anrechnungstatus.bezeichnung_mehrsprachig::varchar[])->>' . $LANGUAGE_INDEX . ' AS "status_bezeichnung", - CASE - WHEN (anrechnungen.empfehlung_anrechnung IS NULL AND anrechnungen.status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_STGL . '\') THEN NULL - ELSE - (SELECT insertamum::date - FROM lehre.tbl_anrechnungstatus - JOIN lehre.tbl_anrechnung_anrechnungstatus USING (status_kurzbz) - WHERE anrechnung_id = anrechnungen.anrechnung_id - AND status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR . '\' - ORDER BY insertamum DESC - LIMIT 1) - END "empfehlungsanfrageAm", - CASE - WHEN (anrechnungen.empfehlung_anrechnung IS NULL AND anrechnungen.status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_STGL . '\') THEN NULL - ELSE - (SELECT COALESCE( - STRING_AGG(CONCAT_WS(\' \', vorname, nachname), \', \') FILTER (WHERE lvleiter = TRUE), - STRING_AGG(CONCAT_WS(\' \', vorname, nachname), \', \') FILTER (WHERE lvleiter = FALSE) - ) empfehlungsanfrageAn - FROM ( - SELECT DISTINCT ON (benutzer.uid) uid, vorname, nachname, - CASE WHEN lehrfunktion_kurzbz = \'LV-Leitung\' THEN TRUE ELSE FALSE END AS lvleiter - FROM lehre.tbl_lehreinheit - JOIN lehre.tbl_lehreinheitmitarbeiter lema USING (lehreinheit_id) - JOIN public.tbl_benutzer benutzer ON lema.mitarbeiter_uid = benutzer.uid - JOIN public.tbl_person USING (person_id) - WHERE studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\' - AND lehrveranstaltung_id = anrechnungen.lehrveranstaltung_id - AND lema.mitarbeiter_uid NOT like \'_Dummy%\' - AND benutzer.aktiv = TRUE - AND tbl_person.aktiv = TRUE - ORDER BY benutzer.uid, lvleiter DESC, nachname, vorname - ) as tmp_lvlektoren - ) - END "empfehlungsanfrageAn" + SELECT anrechnungen.anrechnung_id, + anrechnungen.lehrveranstaltung_id, + anrechnungen.begruendung_id, + anrechnungen.dms_id, + anrechnungen.studiensemester_kurzbz, + anrechnungen.studiengang_kz, + anrechnungen.stg_bezeichnung, + anrechnungen.orgform_kurzbz, + anrechnungen.ausbildungssemester, + anrechnungen.lv_bezeichnung, + anrechnungen.ects::float4 AS ects, + NULL AS "ectsSumBisherUndNeu", + anrechnungen.ectsSumSchulisch::float4 AS "ectsSumSchulisch", + anrechnungen.ectsSumBeruflich::float4 AS "ectsSumBeruflich", + anrechnungen.begruendung, + anrechnungen.student, + anrechnungen.dokument_bezeichnung, + anrechnungen.anmerkung_student, + anrechnungen.zgv, + anrechnungen.antragsdatum, + anrechnungen.empfehlung_anrechnung, + anrechnungen.status_kurzbz, + array_to_json(anrechnungstatus.bezeichnung_mehrsprachig::varchar[])->>' . $LANGUAGE_INDEX . ' AS "status_bezeichnung", + anrechnungen.prestudent_id, + CASE + WHEN (anrechnungen.empfehlung_anrechnung IS NULL AND anrechnungen.status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_STGL . '\') THEN NULL + ELSE + (SELECT insertamum::date + FROM lehre.tbl_anrechnungstatus + JOIN lehre.tbl_anrechnung_anrechnungstatus USING (status_kurzbz) + WHERE anrechnung_id = anrechnungen.anrechnung_id + AND status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR . '\' + ORDER BY insertamum DESC + LIMIT 1) + END "empfehlungsanfrageAm", + CASE + WHEN (anrechnungen.empfehlung_anrechnung IS NULL AND anrechnungen.status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_STGL . '\') THEN NULL + ELSE + (SELECT COALESCE( + STRING_AGG(CONCAT_WS(\' \', vorname, nachname), \', \') FILTER (WHERE lvleiter = TRUE), + STRING_AGG(CONCAT_WS(\' \', vorname, nachname), \', \') FILTER (WHERE lvleiter = FALSE) + ) empfehlungsanfrageAn + FROM ( + SELECT DISTINCT ON (benutzer.uid) uid, vorname, nachname, + CASE WHEN lehrfunktion_kurzbz = \'LV-Leitung\' THEN TRUE ELSE FALSE END AS lvleiter + FROM lehre.tbl_lehreinheit + JOIN lehre.tbl_lehreinheitmitarbeiter lema USING (lehreinheit_id) + JOIN public.tbl_benutzer benutzer ON lema.mitarbeiter_uid = benutzer.uid + JOIN public.tbl_person USING (person_id) + WHERE studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\' + AND lehrveranstaltung_id = anrechnungen.lehrveranstaltung_id + AND lema.mitarbeiter_uid NOT like \'_Dummy%\' + AND benutzer.aktiv = TRUE + AND tbl_person.aktiv = TRUE + ORDER BY benutzer.uid, lvleiter DESC, nachname, vorname + ) as tmp_lvlektoren + ) + END "empfehlungsanfrageAn" FROM anrechnungen JOIN lehre.tbl_anrechnungstatus as anrechnungstatus ON (anrechnungstatus.status_kurzbz = anrechnungen.status_kurzbz) WHERE studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\' @@ -118,9 +147,12 @@ $filterWidgetArray = array( ucfirst($this->p->t('lehre', 'organisationsform')), 'Semester', ucfirst($this->p->t('lehre', 'lehrveranstaltung')), - 'ECTS', - ucfirst($this->p->t('person', 'studentIn')), + 'ECTS (LV)', + 'ECTS (LV + Bisher)', + 'ECTS (Bisher schulisch)', + 'ECTS (Bisher beruflich', ucfirst($this->p->t('global', 'begruendung')), + ucfirst($this->p->t('person', 'studentIn')), ucfirst($this->p->t('anrechnung', 'nachweisdokumente')), ucfirst($this->p->t('anrechnung', 'herkunft')), ucfirst($this->p->t('global', 'zgv')), @@ -128,6 +160,7 @@ $filterWidgetArray = array( ucfirst($this->p->t('anrechnung', 'empfehlung')), 'status_kurzbz', 'Status', + 'PrestudentID', ucfirst($this->p->t('anrechnung', 'empfehlungsanfrageAm')), ucfirst($this->p->t('anrechnung', 'empfehlungsanfrageAn')) ), @@ -155,8 +188,8 @@ $filterWidgetArray = array( rowFormatter:function(row){ func_rowFormatter(row); }, - rowUpdated:function(row){ - func_rowUpdated(row); + rowSelectionChanged:function(data, rows){ + func_rowSelectionChanged(data, rows); }, tooltips: function(cell){ return func_tooltips(cell); @@ -174,8 +207,11 @@ $filterWidgetArray = array( ausbildungssemester: {headerFilter:"input"}, lv_bezeichnung: {headerFilter:"input"}, ects: {headerFilter:"input", align:"center"}, + ectsSumBisherUndNeu: {formatter: format_ectsSumBisherUndNeu}, + ectsSumSchulisch: {visible: false, headerFilter:"input", align:"right"}, + ectsSumBeruflich: {visible: false, headerFilter:"input", align:"right"}, + begruendung: {headerFilter:"input", visible: true}, student: {headerFilter:"input"}, - begruendung: {headerFilter:"input"}, zgv: {visible: false, headerFilter:"input"}, dokument_bezeichnung: {headerFilter:"input", formatter:"link", formatterParams:{ labelField:"dokument_bezeichnung", @@ -187,6 +223,7 @@ $filterWidgetArray = array( empfehlung_anrechnung: {headerFilter:"input", align:"center", formatter: format_empfehlung_anrechnung, headerFilterFunc: hf_filterTrueFalse}, status_kurzbz: {visible: false, headerFilter:"input"}, status_bezeichnung: {headerFilter:"input"}, + prestudent_id: {visible: false, headerFilter:"input"}, empfehlungsanfrageAm: {visible: false, align:"center", headerFilter:"input", mutator: mut_formatStringDate}, empfehlungsanfrageAn: {visible: false, headerFilter:"input"} }', // col properties diff --git a/application/views/lehre/anrechnung/createAnrechnung.php b/application/views/lehre/anrechnung/createAnrechnung.php index 58b0757b9..2d2193b80 100644 --- a/application/views/lehre/anrechnung/createAnrechnung.php +++ b/application/views/lehre/anrechnung/createAnrechnung.php @@ -38,7 +38,6 @@ $this->load->view( ); ?> -
@@ -170,4 +169,5 @@ $this->load->view(
- + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index 978dd5606..8931546f6 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -31,7 +31,9 @@ $this->load->view( ), 'anrechnung' => array( 'deadlineUeberschritten', - 'benotungDerLV' + 'benotungDerLV', + 'anrechnungEctsTextBeiUeberschreitung', + 'anrechnungEctsTooltipTextBeiUeberschreitung' ), 'person' => array( 'student', @@ -60,7 +62,6 @@ $this->load->view( } -
@@ -80,9 +81,13 @@ $this->load->view(
+ - + + + +
@@ -119,8 +124,23 @@ $this->load->view(
- + + + + +
p->t('lehre', 'ects'); ?>ects ?>ects, 1) ?> ECTS
+ p->t('anrechnung', 'bisherAngerechneteEcts'); ?> + + + + + Total ECTS: sumEctsSchulisch + $antragData->sumEctsBeruflich, 1) ?> + [ Schulisch: sumEctsSchulisch ?> | + Beruflich: sumEctsBeruflich ?> ] + +
p->t('lehre', 'lektorInnen')); ?> @@ -152,6 +172,17 @@ $this->load->view( +
+ +
- load->view('templates/FHC-Footer'); ?> diff --git a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php index 18c70e5af..13b830731 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php @@ -52,7 +52,6 @@ $this->load->view( ); ?> -
@@ -225,31 +224,29 @@ $this->load->view(
- load->view('templates/FHC-Footer'); ?> diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php index 54d0b49d1..a7b0e02b9 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php @@ -80,7 +80,6 @@ $this->load->view( ); ?> -
@@ -127,30 +126,31 @@ $this->load->view( id="reviewAnrechnungUebersicht-begruendung-panel">

p->t('anrechnung', 'empfehlungenNegativQuestion'); ?>

- p->t('anrechnung', 'bitteBegruendungAngeben'); ?>

-
    -
  • - p->t('anrechnung', 'empfehlungNegativPruefungNichtMoeglich'); ?> - - - -
  • -
  • - p->t('anrechnung', 'empfehlungNegativKenntnisseNichtGleichwertig'); ?> - - - -
  • -
  • p->t('anrechnung', 'andereBegruendung'); ?>
  • -
-
- + p->t('anrechnung', 'bitteBegruendungAngeben'); ?> + p->t('anrechnung', 'begruendungWirdFuerAlleUebernommen'); ?> -

+
+

+
    +
  • + p->t('anrechnung', 'empfehlungNegativPruefungNichtMoeglich'); ?> + + + +
  • +
  • + p->t('anrechnung', 'empfehlungNegativKenntnisseNichtGleichwertig'); ?> + + + +
  • +
+ rows="2" + placeholder="p->t('anrechnung', 'textUebernehmenOderEigenenBegruendungstext'); ?>" + required>

@@ -235,7 +235,6 @@ $this->load->view(
- load->view('templates/FHC-Footer'); ?> diff --git a/application/views/system/infocenter/dokpruefung.php b/application/views/system/infocenter/dokpruefung.php index b184b9a0b..633f3ec02 100644 --- a/application/views/system/infocenter/dokpruefung.php +++ b/application/views/system/infocenter/dokpruefung.php @@ -1,10 +1,11 @@ -
- +
+
+ akte_id ?>">titel) ? $dokument->bezeichnung : $dokument->titel ?> + variablelib->getVar('infocenter_studiensemester').'\''; $ORG_NAME = '\'InfoCenter\''; + $ONLINE = '\'online\''; $query = ' SELECT @@ -55,10 +56,13 @@ a.dokument_kurzbz in ('.$AKTE_TYP.') ) AS "AnzahlAkte", ( - SELECT CASE WHEN sp.nachname IS NULL THEN l.insertvon ELSE sp.nachname END + SELECT CASE WHEN student.student_uid IS NULL THEN + (CASE WHEN sp.nachname IS NULL THEN l.insertvon ELSE sp.nachname END) + ELSE '. $ONLINE .' END FROM system.tbl_log l LEFT JOIN public.tbl_benutzer on l.insertvon = tbl_benutzer.uid LEFT JOIN public.tbl_person sp on tbl_benutzer.person_id = sp.person_id + LEFT JOIN public.tbl_student student ON tbl_benutzer.uid = student.student_uid WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 75d60a179..13e1d5549 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -12,6 +12,7 @@ $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; $ORG_NAME = '\'InfoCenter\''; $IDENTITY = '\'identity\''; + $ONLINE = '\'online\''; $query = ' SELECT @@ -42,10 +43,13 @@ $query = ' LIMIT 1 ) AS "LastActionType", ( - SELECT CASE WHEN sp.nachname IS NULL THEN l.insertvon ELSE sp.nachname END + SELECT CASE WHEN student.student_uid IS NULL THEN + (CASE WHEN sp.nachname IS NULL THEN l.insertvon ELSE sp.nachname END) + ELSE '. $ONLINE .' END FROM system.tbl_log l LEFT JOIN public.tbl_benutzer on l.insertvon = tbl_benutzer.uid LEFT JOIN public.tbl_person sp on tbl_benutzer.person_id = sp.person_id + LEFT JOIN public.tbl_student student ON tbl_benutzer.uid = student.student_uid WHERE l.taetigkeit_kurzbz IN('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id @@ -178,7 +182,7 @@ $query = ' WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND ps.person_id = p.person_id AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' - ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC + ORDER BY rtp.teilgenommen NULLS FIRST, pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 ) AS "ReihungstestAngetreten", ( @@ -199,7 +203,7 @@ $query = ' LIMIT 1 ) AS "ReihungstestApplied", ( - SELECT CONCAT(rtp.datum, rtp.uhrzeit) + SELECT (ARRAY_TO_STRING(array_agg(DISTINCT(CONCAT(rtp.datum, \' \', to_char(rtp.uhrzeit, \'HH24:MI\'), \' \', studiengang.kurzbzlang))), \', \')) FROM public.tbl_prestudentstatus pss JOIN public.tbl_prestudent ps USING(prestudent_id) LEFT JOIN ( @@ -207,14 +211,17 @@ $query = ' rt.studiensemester_kurzbz, rtp.teilgenommen, rt.datum, - rt.uhrzeit + rt.uhrzeit, + rt.studiengang_kz FROM public.tbl_rt_person rtp JOIN tbl_reihungstest rt ON(rtp.rt_id = rt.reihungstest_id) WHERE rt.stufe = 1 ) rtp ON(rtp.person_id = ps.person_id AND rtp.studiensemester_kurzbz = pss.studiensemester_kurzbz) + JOIN tbl_studiengang studiengang ON rtp.studiengang_kz = studiengang.studiengang_kz WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND ps.person_id = p.person_id AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' + GROUP BY pss.datum, pss.insertamum, pss.ext_id ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 ) AS "ReihungstestDate", @@ -414,10 +421,6 @@ $query = ' { $datasetRaw->{'ReihungstestDate'} = '-'; } - else - { - $datasetRaw->{'ReihungstestDate'} = date_format(date_create($datasetRaw->{'ReihungstestDate'}),'Y-m-d H:i'); - } if ($datasetRaw->{'ZGVNation'} == null) { diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 253145557..f6e8a845b 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -124,6 +124,32 @@
+ prestudentstatus->bewerbung_abgeschicktamum)) + { + $disabled = $disabledStg = 'disabled'; + $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt'); + } + + if ($studiengangtyp !== 'b' && $studiengangtyp !== 'm') + { + $disabled = 'disabled'; + $disabledTxt = $this->p->t('infocenter', 'nurBachelorMasterFreigeben'); + + // FIT-Lehrgänge: exceptions, can be freigegeben in Infocenter + if (!in_array($studiengang_kz, $fit_programme_studiengaenge)) + { + $disabledStg = 'disabled'; + $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorMasterFreigeben'); + } + } + + if (!in_array($studiengangtyp, $studienArtBerechtigung)) + $disabledPer = 'disabled'; + else + $disabledPer = ''; + ?>
@@ -318,17 +344,17 @@
- - statusZGV))) ?: print_r('data-info="need"')?>>
-
@@ -336,7 +362,7 @@
prestudentUdfs)) + if (isset($zgvpruefung->prestudentUdfs) && $studiengangtyp !== 'l') { echo $this->udflib->UDFWidget( array( @@ -362,6 +388,8 @@
+ required>
- @@ -489,6 +499,8 @@
' + - '' + - '' + - '' + ''; + InfocenterPersonDataset.getStudienartData(infocenter_studiengangstyp); + var auswahlAbsageToggle = 'Erweiterte Einstellungen'; @@ -90,11 +89,9 @@ var InfocenterPersonDataset = { "

" ); - InfocenterPersonDataset.selectStudiengangTyp(infocenter_studiengangstyp) - $('.auswahlStudienArt').change(function() { - InfocenterPersonDataset.changeStudengangsTyp($(this).find('option:selected').attr('data-id')); + InfocenterPersonDataset.changeStudengangsTyp($(this).find('option:selected').val()); }); $("#datasetActionsBottom").append( @@ -183,22 +180,6 @@ var InfocenterPersonDataset = { ); }, - selectStudiengangTyp: function(typ) - { - switch (typ) - { - case 'b, m' : - $('.auswahlStudienArt [data-id="all"]').attr('selected', 'selected'); - break; - case 'b' : - $('.auswahlStudienArt [data-id="bachelor"]').attr('selected', 'selected'); - break; - case 'm' : - $('.auswahlStudienArt [data-id="master"]').attr('selected', 'selected'); - break; - } - }, - /** * sets functionality for the actions above and beneath the person table */ @@ -257,20 +238,12 @@ var InfocenterPersonDataset = { }); }, - changeStudengangsTyp: function($typ) + changeStudengangsTyp: function(typ) { - switch ($typ) - { - case 'all' : - var change = 'b\', \'m'; - break; - case 'bachelor' : - var change = 'b'; - break; - case 'master' : - var change = 'm'; - break; - } + let change = typ; + + if (typ === 'all') + change = change = 'b\', \'m\', \'l'; FHC_AjaxClient.showVeil(); @@ -372,7 +345,8 @@ var InfocenterPersonDataset = { 'system/infocenter/InfoCenter/getAbsageData', {}, { - successCallback: function(data, textStatus, jqXHR) { + successCallback: function(data, textStatus, jqXHR) + { if (FHC_AjaxClient.hasData(data)) { data = FHC_AjaxClient.getData(data); @@ -397,6 +371,42 @@ var InfocenterPersonDataset = { } ); }, + getStudienartData: function(infocenter_studiengangstyp) + { + FHC_AjaxClient.ajaxCallGet( + 'system/infocenter/InfoCenter/getStudienartData', + {}, + { + successCallback: function(data, textStatus, jqXHR) + { + if (FHC_AjaxClient.hasData(data)) + { + data = FHC_AjaxClient.getData(data); + + let all = data.map(item => item.typ).join('\',\''); + $('.auswahlStudienArt').append($("
p->t('global','name')) ?> p->t('global','typ')) ?> p->t('global','uploaddatum')) ?>p->t('ui','loeschen')) ?> p->t('infocenter','ausstellungsnation')) ?> - autocomplete="off"> bezeichnung === $dokument->dokument_bezeichnung ? 'selected' : '') . " value = " . $dokumenttyp->dokument_kurzbz . ">" . $dokumenttyp->bezeichnung . "" @@ -30,7 +31,7 @@
- +
erstelltam), 'd.m.Y') ?>> langtext ?>