mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 08:52:21 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 61982b1199 | |||
| d50590aefb | |||
| c40ee917df | |||
| 8126665acd | |||
| 5826bf5b70 | |||
| fc5ba954fb | |||
| 4e9bf3676d | |||
| 31410f0bb9 | |||
| 1136d9dca1 | |||
| 967f53d73c | |||
| 8c24292195 | |||
| aba680cd52 |
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Configs for the Long Run Tasks
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// Maximum LRTs for a single user in parallel
|
||||
$config['lrt_max_number_single_user'] = 10;
|
||||
|
||||
// Maximum LRTs for the whole system in parallel
|
||||
$config['lrt_max_number_system'] = 100;
|
||||
|
||||
// Maximum running time in hours for a single LRT before killing it
|
||||
$config['lrt_max_run_timeout'] = 24;
|
||||
|
||||
// List of existing LRT types
|
||||
$config['lrt_types'] = array('LRTDummy');
|
||||
|
||||
@@ -170,13 +170,6 @@ $config['navigation_header'] = array(
|
||||
'expand' => true,
|
||||
'sort' => 51,
|
||||
'requiredPermissions' => 'vertrag/mitarbeiter:r'
|
||||
),
|
||||
'studierendenverwaltung' => array(
|
||||
'link' => site_url('studentenverwaltung'),
|
||||
'description' => 'Studierendenverwaltung',
|
||||
'expand' => true,
|
||||
'sort' => 52,
|
||||
'requiredPermissions' => ['admin:r', 'assistenz:r']
|
||||
)
|
||||
)
|
||||
),
|
||||
@@ -385,7 +378,7 @@ $config['navigation_menu']['apps'] = [
|
||||
],
|
||||
'lav' => [
|
||||
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'),
|
||||
'description' => 'Lehrauftragsverwaltung',
|
||||
'description' => 'Lehraufträge',
|
||||
#'icon' => 'person-chalkboard',
|
||||
'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r', 'lehre/lehrauftrag_erteilen:r')
|
||||
]
|
||||
|
||||
@@ -133,21 +133,13 @@ $config['students_tab_order'] = [
|
||||
|
||||
$config['stv_prestudent_tags'] = [
|
||||
'prioone' => ['readonly' => false],
|
||||
'priotwo' => ['readonly' => false],
|
||||
'priotwo' => ['readonly' => true],
|
||||
'hinweis' => ['readonly' => false],
|
||||
'hinweis_assistenz' => ['readonly' => false],
|
||||
'hinweis_kf' => ['readonly' => false],
|
||||
'hinweis_assistenz' => ['readonly' => true],
|
||||
'hinweis_kf' => ['readonly' => true],
|
||||
'hinweis_lehrende' => ['readonly' => false],
|
||||
'hinweis_stg_kf' => ['readonly' => false],
|
||||
'finished_stg' => ['readonly' => false],
|
||||
'finished_kf' => ['readonly' => false],
|
||||
'inwork_kf' => ['readonly' => false],
|
||||
'dd_auto' => ['readonly' => true],
|
||||
'wh_auto' => ['readonly' => true],
|
||||
'prewh_auto' => ['readonly' => true],
|
||||
'out_auto' => ['readonly' => true],
|
||||
'zgv_auto' => ['readonly' => true],
|
||||
'unterbrecher_auto' => ['readonly' => true],
|
||||
'stbtr_erh_auto' => ['readonly' => true],
|
||||
'jgv_auto' => ['readonly' => true],
|
||||
'hinweis_stg_kf' => ['readonly' => true],
|
||||
'finished_stg' => ['readonly' => true],
|
||||
'finished_kf' => ['readonly' => true],
|
||||
'inwork_kf' => ['readonly' => true],
|
||||
];
|
||||
|
||||
@@ -9,10 +9,9 @@ class Detailheader extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getHeader' => self::PERM_LOGGED,
|
||||
'getPersonAbteilung' => self::PERM_LOGGED,
|
||||
'getLeitungOrg' => self::PERM_LOGGED,
|
||||
'getSemesterStati' => self::PERM_LOGGED,
|
||||
'getHeader' => ['vertrag/mitarbeiter:r'],
|
||||
'getPersonAbteilung' => ['vertrag/mitarbeiter:r'],
|
||||
'getLeitungOrg' => ['vertrag/mitarbeiter:r'],
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -49,17 +48,6 @@ class Detailheader extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess(current($data));
|
||||
}
|
||||
|
||||
public function getSemesterStati($prestudent_id)
|
||||
{
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
|
||||
$result = $this->PrestudentstatusModel->getAllPrestudentstatiWithStudiensemester($prestudent_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -246,12 +246,12 @@ class Abschlusspruefung extends FHCAPI_Controller
|
||||
{
|
||||
$searchString = $this->input->get('searchString') ?? '';
|
||||
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$result = $this->PersonModel->searchPerson($searchString, 'mitMaUid');
|
||||
$result = $this->MitarbeiterModel->searchMitarbeiter($searchString, 'ohneMaUid');
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($result ?: []);
|
||||
|
||||
@@ -193,7 +193,7 @@ class Prestudent extends FHCAPI_Controller
|
||||
}
|
||||
elseif (
|
||||
$val === ''
|
||||
&& in_array($prop, ['zgvnation', 'zgvmanation', 'zgvdoktornation', 'berufstaetigkeit_code', 'ausbildungcode', 'zgvdatum', 'zgvmadatum'])
|
||||
&& in_array($prop, ['zgvnation', 'zgvmanation', 'zgvdoktornation', 'berufstaetigkeit_code', 'ausbildungcode'])
|
||||
)
|
||||
{
|
||||
$val = null;
|
||||
|
||||
@@ -144,7 +144,6 @@ class Student extends FHCAPI_Controller
|
||||
. $this->PrestudentModel->escape($studiensemester_kurzbz)
|
||||
. ") AS statusofsemester"
|
||||
);
|
||||
$this->PrestudentModel->addSelect($this->PrestudentModel->escape($studiensemester_kurzbz) . ' as query_studiensemester_kurzbz');
|
||||
|
||||
$this->PrestudentModel->addJoin('public.tbl_student s', 'prestudent_id', 'LEFT');
|
||||
$this->PrestudentModel->addJoin('public.tbl_benutzer b', 'student_uid = uid', 'LEFT');
|
||||
|
||||
@@ -138,7 +138,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -439,15 +439,13 @@ class Students extends FHCAPI_Controller
|
||||
$this->studentlistlib->addSelect("'' AS verband");
|
||||
$this->studentlistlib->addSelect("'' AS gruppe");
|
||||
|
||||
$query_studiensemester_kurzbz = $studiensemester_kurzbz ? $this->PrestudentModel->escape($studiensemester_kurzbz) : '\'NULL\'';
|
||||
$this->studentlistlib->addSelect($query_studiensemester_kurzbz . ' as query_studiensemester_kurzbz');
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -558,7 +556,6 @@ class Students extends FHCAPI_Controller
|
||||
$this->studentlistlib->addJoin("public.tbl_student s", "prestudent_id");
|
||||
|
||||
$this->studentlistlib->addSelect("'' AS priorisierung_relativ");
|
||||
$this->studentlistlib->addSelect($this->PrestudentModel->escape($studiensemester_kurzbz) . ' as query_studiensemester_kurzbz');
|
||||
|
||||
if ($gruppe_kurzbz !== null) {
|
||||
$this->studentlistlib->addJoin('public.tbl_benutzergruppe g', 'uid', '', 'after_b');
|
||||
@@ -597,20 +594,8 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
protected function decodeTagsJsonInResult(&$data)
|
||||
{
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED) {
|
||||
array_walk($data, function($item, $key) {
|
||||
if(isset($item->tags))
|
||||
{
|
||||
$item->tags = json_decode($item->tags);
|
||||
}
|
||||
});
|
||||
}
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -653,7 +638,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -686,7 +671,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -720,7 +705,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -770,7 +755,6 @@ class Students extends FHCAPI_Controller
|
||||
END
|
||||
) AS semester", false);
|
||||
|
||||
$this->studentlistlib->addSelect($this->PrestudentModel->escape($studiensemester_kurzbz) . ' as query_studiensemester_kurzbz');
|
||||
|
||||
if ($prestudent_ids && $student_uids) {
|
||||
$this->studentlistlib->addWhere('tbl_prestudent.prestudent_id', $prestudent_ids);
|
||||
@@ -789,7 +773,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,7 @@ class Tags extends Tag_Controller
|
||||
'addTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'updateTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'doneTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'deleteTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'getAllTags' => self::BERECHTIGUNG_KURZBZ,
|
||||
'rebuildTagsForTypeId' => self::BERECHTIGUNG_KURZBZ,
|
||||
'deleteTag' => self::BERECHTIGUNG_KURZBZ
|
||||
]);
|
||||
|
||||
$this->config->load('stv');
|
||||
@@ -47,5 +45,4 @@ class Tags extends Tag_Controller
|
||||
{
|
||||
parent::doneTag($this->config->item('stv_prestudent_tags'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
/**
|
||||
* - This controller acts as interface of the LongRunTaskLib that contains
|
||||
* all the needed functionalities to operate with the Long Run Task system
|
||||
* that is built on top of the Jobs Queue System
|
||||
* - This is a Job Queue Worker that gets scheduled LRTs from the queue and executes them
|
||||
* - Once all the LRTs have been started checks if there are LRTs that are running for too long and kills them
|
||||
*/
|
||||
class LongRunTaskExecJob extends JOB_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Changes the needed configs for LogLib
|
||||
$this->LogLibJob->setConfigs(
|
||||
array(
|
||||
'dbExecuteUser' => get_class($this),
|
||||
'requestId' => 'LRT'
|
||||
)
|
||||
);
|
||||
|
||||
// Loads LongRunTaskLib library
|
||||
$this->load->library('LongRunTaskLib');
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes all the new LRTs
|
||||
*/
|
||||
public function execEmAll()
|
||||
{
|
||||
$this->logInfo('Execute long run tasks started');
|
||||
|
||||
// Get all the LRTs that is possible to execute now
|
||||
$lrtsResult = $this->longruntasklib->getNewLRTs();
|
||||
// If an error occurred then return it
|
||||
if (isError($lrtsResult)) return $lrtsResult;
|
||||
|
||||
if (hasData($lrtsResult))
|
||||
{
|
||||
// For each LRT
|
||||
foreach (getData($lrtsResult) as $lrt)
|
||||
{
|
||||
// Execute the task
|
||||
$executeLrtResult = $this->longruntasklib->executeLrt($lrt);
|
||||
if (isError($executeLrtResult)) $this->logError($executeLrtResult);
|
||||
}
|
||||
}
|
||||
|
||||
$this->logInfo('Execute long run tasks ended');
|
||||
}
|
||||
|
||||
/**
|
||||
* Kills all the hanging LRTs
|
||||
*/
|
||||
public function killHangingLRTs()
|
||||
{
|
||||
$this->logInfo('Kill hanging LRTs started');
|
||||
|
||||
// Get all the LRTs that is possible to execute now
|
||||
$lrtsResult = $this->longruntasklib->getHangingLRTs();
|
||||
// If an error occurred then return it
|
||||
if (isError($lrtsResult)) return $lrtsResult;
|
||||
|
||||
if (hasData($lrtsResult))
|
||||
{
|
||||
// For each LRT
|
||||
foreach (getData($lrtsResult) as $lrt)
|
||||
{
|
||||
// Kill the task
|
||||
$killLrtResult = $this->longruntasklib->killLrt($lrt);
|
||||
if (isError($killLrtResult)) $this->logError($killLrtResult);
|
||||
}
|
||||
}
|
||||
|
||||
$this->logInfo('Kill hanging LRTs ended');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function checkExecution()
|
||||
{
|
||||
$this->logInfo('Check execution long run tasks started');
|
||||
|
||||
// Get the related LRT data from the queue
|
||||
$lrtsResult = $this->longruntasklib->getRunningLRTs();
|
||||
// If an error occurred then return it
|
||||
if (isError($lrtsResult)) return $lrtsResult;
|
||||
|
||||
// If there are running LRTs
|
||||
if (hasData($lrtsResult))
|
||||
{
|
||||
// For each LRT
|
||||
foreach (getData($lrtsResult) as $lrt)
|
||||
{
|
||||
// Check the LRT execution
|
||||
$checkExecutionResult = $this->longruntasklib->checkExecution($lrt);
|
||||
if (isError($checkExecutionResult)) $this->logError($checkExecutionResult);
|
||||
}
|
||||
}
|
||||
|
||||
$this->logInfo('Check execution long run tasks ended');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class TagJob extends JOB_Controller
|
||||
{
|
||||
|
||||
const BATCHUSER = 'sftest';
|
||||
|
||||
/**
|
||||
* API constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Configs
|
||||
$this->load->config('stv');
|
||||
|
||||
// Library
|
||||
$this->load->library('TagLib');
|
||||
|
||||
// Load Models
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('system/Notiztyp_model', 'NotiztypModel');
|
||||
|
||||
$this->loadPhrases([
|
||||
'lehre'
|
||||
]);
|
||||
}
|
||||
|
||||
public function rebuildAutomatedTags()
|
||||
{
|
||||
|
||||
|
||||
$automatedTagsRes = $this->NotiztypModel->loadWhere(array('automatisiert' => true, 'taglib IS NOT NULL' => null));
|
||||
$automatedTags = hasData($automatedTagsRes) ? getData($automatedTagsRes) : [];
|
||||
|
||||
|
||||
$result = $this->StudiensemesterModel->getAktOrNextSemester();
|
||||
if (isError($result))
|
||||
{
|
||||
$this->logInfo('Start Job rebuild Automated Tags');
|
||||
$this->logError('Error occurred during retrieving studiensemester');
|
||||
return $this->logInfo('End Job rebuild Automated Tags');
|
||||
}
|
||||
|
||||
if (empty($result->retval) || !isset($result->retval[0])) {
|
||||
$this->logInfo('Start Job rebuild Automated Tags');
|
||||
$this->logError('No Studiensemester found');
|
||||
return $this->logInfo('End Job rebuild Automated Tags');
|
||||
}
|
||||
$studiensemester_kurzbz = $result->retval[0]->studiensemester_kurzbz ?? null;
|
||||
$params = array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
);
|
||||
|
||||
$this->logInfo('Start Job rebuild Automated Tags ' . $studiensemester_kurzbz);
|
||||
foreach($automatedTags as $autoTag)
|
||||
{
|
||||
// getPath: must not be lost
|
||||
$filePath = APPPATH . 'libraries/' . $autoTag->taglib . '.php'; // APPPATH = application/
|
||||
|
||||
if(file_exists($filePath)) {
|
||||
require_once($filePath);
|
||||
} else {
|
||||
$this->logInfo("File not found: " . $filePath);
|
||||
continue;
|
||||
}
|
||||
|
||||
$kurz_bz = $autoTag->typ_kurzbz;
|
||||
// className without PATH (basename)
|
||||
$className = basename($autoTag->taglib);
|
||||
|
||||
$obj = new $className();
|
||||
|
||||
$outputArray = $obj->getZuordnungIds($params);
|
||||
$typeId = $outputArray->typeId;
|
||||
|
||||
$paramsTag = array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'kurzbz' => $kurz_bz,
|
||||
'data' => $outputArray->data,
|
||||
'typeId' => $typeId
|
||||
);
|
||||
|
||||
$result = $this->taglib->updateAutomatedTags($paramsTag);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->logError('Error occurred during updateAutomatedTags ' . $kurz_bz);
|
||||
continue;
|
||||
}
|
||||
|
||||
$data = is_array($result) ? $result['retval'] : $result->retval;
|
||||
|
||||
//SUMMARY
|
||||
$this->logInfo("Tag " . $result->retval['input']['tag'] . " | type_id " . $typeId . " --"
|
||||
. " Count Recycled: " . $result->retval['summary']['recycled']
|
||||
. " Count Added: ". $result->retval['summary']['added']
|
||||
. " Count Deleted: ". $result->retval['summary']['deleted']);
|
||||
|
||||
//DETAILS
|
||||
if($result->retval['results']['newTags'])
|
||||
$this->logInfo("Tag " . $result->retval['input']['tag'] . "New tag(s): " . implode(', ', $result->retval['results']['newTags']));
|
||||
if($result->retval['results']['deletedTagsIds'])
|
||||
$this->logInfo("Tag " . $result->retval['input']['tag'] . "Deleted tags(s: " . implode(', ', $result->retval['results']['deletedTagsIds']));
|
||||
if ($result->retval['results']['retaggedIds'])
|
||||
$this->logInfo("Tag " . $result->retval['input']['tag'] . "Recycled tag(s): " . implode(', ', $result->retval['results']['retaggedIds']));
|
||||
|
||||
}
|
||||
$this->logInfo( "End Job rebuild Automated Tags");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
/**
|
||||
* Testing LRT to check if the LRT system is working properly
|
||||
* This will be called by the LongRunTaskExecJob
|
||||
*/
|
||||
class LRTDummy extends LRT_Controller
|
||||
{
|
||||
/**
|
||||
* This method must be implemented!
|
||||
*/
|
||||
public function run($jobid)
|
||||
{
|
||||
$this->logInfo('Long run tasks '.get_class($this).' started');
|
||||
|
||||
$this->_doIt($jobid);
|
||||
|
||||
$this->logInfo('Long run tasks '.get_class($this).' ended');
|
||||
}
|
||||
|
||||
/**
|
||||
* Loops on the number of seconds provided by the LRT input
|
||||
* Sleeps every time 1 sec
|
||||
* Writes the progress
|
||||
* Writes the output
|
||||
*/
|
||||
private function _doIt($jobid)
|
||||
{
|
||||
// Get the LRT record related to the provided jobid
|
||||
$lrtResult = $this->getLrt($jobid);
|
||||
|
||||
// If an error occurred or the record has not been found
|
||||
if (isError($lrtResult))
|
||||
{
|
||||
$this->logError($lrtResult);
|
||||
return;
|
||||
}
|
||||
if (!hasData($lrtResult))
|
||||
{
|
||||
$this->logError('LRT not found in database');
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the record
|
||||
$lrt = getData($lrtResult)[0];
|
||||
|
||||
// Get and check the input
|
||||
$input = json_decode($lrt->{LongRunTaskLib::PROPERTY_INPUT});
|
||||
if ($input == null)
|
||||
{
|
||||
$this->logError('LRT input is not a valid json');
|
||||
return;
|
||||
}
|
||||
|
||||
// Operation
|
||||
for ($i = 0; $i < (int)$input->sleep; $i++)
|
||||
{
|
||||
sleep(1);
|
||||
// Set the progress
|
||||
$setProgressResult = $this->setProgress($jobid, (($i + 1) / (int)$input->sleep) * 100);
|
||||
if (isError($setProgressResult))
|
||||
{
|
||||
$this->logError($setProgressResult);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$sleepMsg = 'The user '.$lrt->{LongRunTaskLib::PROPERTY_UID}.' slept for '.$input->sleep.' seconds';
|
||||
|
||||
$this->logInfo($sleepMsg);
|
||||
|
||||
// Set the output
|
||||
$setOutputResult = $this->setOutput($jobid, $sleepMsg);
|
||||
if (isError($setOutputResult))
|
||||
{
|
||||
$this->logError($setOutputResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,19 +198,7 @@ class Gradelist extends Auth_Controller
|
||||
if (!isset($row_noten->found))
|
||||
{
|
||||
$result_lv = $this->LehrveranstaltungModel->load($row_noten->lehrveranstaltung_id);
|
||||
|
||||
$studiengang_kz = null;
|
||||
|
||||
if (!empty($result_lv->retval) && isset($result_lv->retval[0]) && isset($result_lv->retval[0]->studiengang_kz))
|
||||
{
|
||||
$result_stg = $this->StudiengangModel->load($result_lv->retval[0]->studiengang_kz);
|
||||
|
||||
if (!empty($result_stg->retval) && isset($result_stg->retval[0]) && is_object($result_stg->retval[0]) && isset($result_stg->retval[0]->kurzbzlang))
|
||||
{
|
||||
$studiengang_kz = $result_stg->retval[0]->kurzbzlang;
|
||||
}
|
||||
}
|
||||
|
||||
$result_stg = $this->StudiengangModel->load($result_lv->retval[0]->studiengang_kz);
|
||||
$courses['semester'][$row_noten->studiensemester_kurzbz]['lvs_nonstpl'][] = array(
|
||||
'lehrveranstaltung_id' => $row_noten->lehrveranstaltung_id,
|
||||
'lehrtyp_kurzbz' => $result_lv->retval[0]->lehrtyp_kurzbz,
|
||||
@@ -224,8 +212,8 @@ class Gradelist extends Auth_Controller
|
||||
'semester' => $result_lv->retval[0]->semester,
|
||||
'note' => $row_noten->note,
|
||||
'datum' => $row_noten->benotungsdatum,
|
||||
'studiengang_kurzbz' => $studiengang_kz,
|
||||
'zugeordnet' => true
|
||||
'zugeordnet' => true,
|
||||
'studiengang_kurzbz' => $result_stg->retval[0]->kurzbzlang
|
||||
);
|
||||
if(!isset($courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl']))
|
||||
$courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl'] = 0;
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \stdClass as stdClass;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class LRTTest extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'system/developer:r',
|
||||
'lrt1min' => 'system/developer:r',
|
||||
)
|
||||
);
|
||||
|
||||
// Loads LongRunTaskLib library
|
||||
$this->load->library('LongRunTaskLib');
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Everything has a beginning
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('system/lrtTest.php');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function lrt1min()
|
||||
{
|
||||
$lrtInput = new stdClass();
|
||||
$lrtInput->sleep = 1; // Sleep for 1 min
|
||||
|
||||
$this->outputJsonSuccess(
|
||||
$this->longruntasklib->addNewLrtToQueue(
|
||||
'LRTDummy', // LRT type
|
||||
getAuthUID(), // UID executer
|
||||
$lrtInput // LRT input
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
/**
|
||||
* Long Run Task
|
||||
*
|
||||
* - This controller acts as interface of the LongRunTaskLib that contains
|
||||
* all the needed functionalities to operate with the Long Run Task system
|
||||
* that is built on top of the Jobs Queue System
|
||||
* - This is an abstract class that provide basic functionalities,
|
||||
* it has to be extended to broaden its logic
|
||||
* - Any implementation of a Long Run Task should extends this class to
|
||||
* properly operate with the LRT system
|
||||
*/
|
||||
abstract class LRT_Controller extends JOB_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Changes the needed configs for LogLib
|
||||
$this->LogLibJob->setConfigs(
|
||||
array(
|
||||
'dbExecuteUser' => get_class($this),
|
||||
'requestId' => 'LRT'
|
||||
)
|
||||
);
|
||||
|
||||
// Loads LongRunTaskLib library
|
||||
$this->load->library('LongRunTaskLib');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
abstract public function run($jobid);
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Protected methods
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected function getLrt($jobid)
|
||||
{
|
||||
return $this->longruntasklib->getLrt($jobid);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected function setProgress($jobid, $progress)
|
||||
{
|
||||
return $this->longruntasklib->setProgress($jobid, $progress);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected function setOutput($jobid, $output)
|
||||
{
|
||||
return $this->longruntasklib->setOutuput($jobid, $output);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
{
|
||||
private $_uid;
|
||||
|
||||
const BERECHTIGUNG_KURZBZ = ['admin:rw'];
|
||||
const BERECHTIGUNG_KURZBZ = 'admin:rw';
|
||||
|
||||
public function __construct($permissions)
|
||||
{
|
||||
@@ -15,11 +15,10 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
'getTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'getTags' => self::BERECHTIGUNG_KURZBZ,
|
||||
'addTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
|
||||
'updateTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'doneTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'deleteTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'getAllTags' => self::BERECHTIGUNG_KURZBZ,
|
||||
'rebuildTagsForTypeId' => self::BERECHTIGUNG_KURZBZ,
|
||||
];
|
||||
|
||||
$merged_permissions = array_merge($default_permissions, $permissions);
|
||||
@@ -27,10 +26,6 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
parent::__construct($merged_permissions);
|
||||
|
||||
$this->_setAuthUID();
|
||||
|
||||
// Library
|
||||
$this->load->library('TagLib');
|
||||
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->load->model('system/Notiztyp_model', 'NotiztypModel');
|
||||
$this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel');
|
||||
@@ -42,6 +37,7 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
|
||||
public function getTag($readonly_tags = null)
|
||||
{
|
||||
$language = $this->_getLanguageIndex();
|
||||
$id = $this->input->get('id');
|
||||
|
||||
if (is_array($readonly_tags) && !isEmptyArray($readonly_tags))
|
||||
@@ -66,17 +62,14 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
$this->NotizModel->addSelect(
|
||||
"tbl_notiz.titel,
|
||||
tbl_notiz.text,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>". $language. " as bezeichnung,
|
||||
tbl_notiz.notiz_id,
|
||||
tbl_notiz_typ.style,
|
||||
tbl_notiz_typ.automatisiert,
|
||||
tbl_notiz.erledigt as done,
|
||||
tbl_notiz.insertamum,
|
||||
tbl_notiz.updateamum,
|
||||
(verfasserperson.vorname || ' ' || verfasserperson.nachname || ' ' || '(' || verfasserbenutzer.uid || ')') as verfasser,
|
||||
(bearbeiterperson.vorname || ' ' || bearbeiterperson.nachname || ' ' || '(' || bearbeiterbenutzer.uid || ')') as bearbeiter,
|
||||
tbl_notiz.start,
|
||||
tbl_notiz.ende
|
||||
(bearbeiterperson.vorname || ' ' || bearbeiterperson.nachname || ' ' || '(' || bearbeiterbenutzer.uid || ')') as bearbeiter
|
||||
"
|
||||
);
|
||||
$this->NotizModel->addJoin('public.tbl_notiz_typ', 'public.tbl_notiz.typ = public.tbl_notiz_typ.typ_kurzbz');
|
||||
@@ -89,22 +82,18 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
|
||||
$notiz = $this->NotizModel->loadWhere(array('notiz_id' => $id));
|
||||
|
||||
|
||||
$this->terminateWithSuccess(hasData($notiz) ? getData($notiz)[0] : array());
|
||||
}
|
||||
|
||||
public function getTags($tags = null)
|
||||
{
|
||||
$language = $this->_getLanguageIndex();
|
||||
|
||||
$this->NotiztypModel->addSelect(
|
||||
"typ_kurzbz as tag_typ_kurzbz,
|
||||
'typ_kurzbz as tag_typ_kurzbz,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung,
|
||||
style,
|
||||
beschreibung,
|
||||
tag,
|
||||
automatisiert
|
||||
"
|
||||
tag
|
||||
'
|
||||
);
|
||||
$this->NotiztypModel->addOrder('prioritaet');
|
||||
|
||||
@@ -282,74 +271,6 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($deleteNotiz);
|
||||
}
|
||||
|
||||
public function getAllTags($readonly_tags = false){
|
||||
$prestudent_id = $this->input->get('prestudent_id');
|
||||
|
||||
//TODO check for readonly: necessary?
|
||||
if (is_array($readonly_tags) && !isEmptyArray($readonly_tags))
|
||||
{
|
||||
$readonly_tags = $this->_filterTag($readonly_tags, true);
|
||||
|
||||
foreach ($readonly_tags as $key => $tag)
|
||||
{
|
||||
$readonly_tags[$key] = $this->NotizModel->db->escape($tag);
|
||||
}
|
||||
$tags = '(' . implode(',', $readonly_tags) . ')';
|
||||
|
||||
$this->NotizModel->addSelect("
|
||||
CASE
|
||||
WHEN tbl_notiz_typ.typ_kurzbz IN $tags
|
||||
THEN TRUE
|
||||
ELSE FALSE
|
||||
END as readonly
|
||||
");
|
||||
}
|
||||
$this->NotizModel->addSelect(
|
||||
"tbl_notiz.titel,
|
||||
tbl_notiz.text,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung,
|
||||
tbl_notiz.notiz_id,
|
||||
tbl_notiz_typ.style,
|
||||
tbl_notiz_typ.automatisiert,
|
||||
tbl_notiz.erledigt as done,
|
||||
tbl_notiz.insertamum,
|
||||
tbl_notiz.updateamum,
|
||||
(verfasserperson.vorname || ' ' || verfasserperson.nachname || ' ' || '(' || verfasserbenutzer.uid || ')') as verfasser,
|
||||
(bearbeiterperson.vorname || ' ' || bearbeiterperson.nachname || ' ' || '(' || bearbeiterbenutzer.uid || ')') as bearbeiter,
|
||||
tbl_notiz.start,
|
||||
tbl_notiz.ende
|
||||
"
|
||||
);
|
||||
$this->NotizModel->addJoin('public.tbl_notiz_typ', 'public.tbl_notiz.typ = public.tbl_notiz_typ.typ_kurzbz');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_benutzer verfasserbenutzer', 'tbl_notiz.verfasser_uid = verfasserbenutzer.uid', 'LEFT');
|
||||
$this->NotizModel->addJoin('public.tbl_person verfasserperson', 'verfasserbenutzer.person_id = verfasserperson.person_id', 'LEFT');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_benutzer bearbeiterbenutzer', 'tbl_notiz.bearbeiter_uid = bearbeiterbenutzer.uid', 'LEFT');
|
||||
$this->NotizModel->addJoin('public.tbl_person bearbeiterperson', 'bearbeiterbenutzer.person_id = bearbeiterperson.person_id', 'LEFT');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_notizzuordnung notizzuordnung', 'tbl_notiz.notiz_id = notizzuordnung.notiz_id');
|
||||
|
||||
$notiz = $this->NotizModel->loadWhere(array('prestudent_id' => $prestudent_id));
|
||||
|
||||
|
||||
$this->terminateWithSuccess(hasData($notiz) ? getData($notiz) : array());
|
||||
}
|
||||
|
||||
public function rebuildTagsForTypeId()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$typeId = $this->input->post('typeId');
|
||||
$semester = $this->input->post('sem');
|
||||
|
||||
$result = $this->taglib->rebuildTagsForTypeId($typeId, $id, $semester);
|
||||
|
||||
if (isError($result))
|
||||
return error ('Error occurred during updateAutomatedTags');
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
@@ -270,28 +270,6 @@ function absoluteJsImportUrl($relurl)
|
||||
return $url;
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate Css File Include if Extension contains file
|
||||
*
|
||||
* @param $relativeFilePath path relative to Extension public/css dir
|
||||
*/
|
||||
function generateCSSsIncludeIfExtensionCssExists($relativeFilePath)
|
||||
{
|
||||
$fsiterator = new FilesystemIterator(FHCPATH . 'application/extensions');
|
||||
foreach ($fsiterator as $fsitem)
|
||||
{
|
||||
if(preg_match('/^FHC-Core-/', $fsitem->getBasename()))
|
||||
{
|
||||
$extensionfile = 'public/extensions/' . $fsitem->getBasename()
|
||||
. '/css/' . $relativeFilePath;
|
||||
if(is_readable(FHCPATH . $extensionfile))
|
||||
{
|
||||
generateCSSsInclude($extensionfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Manipulate CI views includes Array to load
|
||||
* - public/js/FhcApps.js via customJSs and
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \stdClass as stdClass;
|
||||
|
||||
/**
|
||||
* Library that contains all the needed functionalities to operate with the Jobs Queue System
|
||||
*/
|
||||
@@ -24,12 +26,12 @@ class JobsQueueLib
|
||||
const PROPERTY_END_TIME = 'endtime';
|
||||
const PROPERTY_ERROR = 'error';
|
||||
|
||||
private $_ci; // CI instance
|
||||
protected $_ci; // CI instance
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct($authenticate = true)
|
||||
public function __construct()
|
||||
{
|
||||
// Gets CI instance
|
||||
$this->_ci =& get_instance();
|
||||
@@ -62,14 +64,29 @@ class JobsQueueLib
|
||||
*/
|
||||
public function getOldestJobs($type, $maxAmount = null)
|
||||
{
|
||||
$this->_ci->JobsQueueModel->resetQuery();
|
||||
|
||||
$this->_ci->JobsQueueModel->addOrder('creationtime', 'ASC');
|
||||
$types = $type; // default is array
|
||||
$limit = 0; // default query limit
|
||||
|
||||
// If the maximum amount of jobs to retrieve have been specified
|
||||
if (is_numeric($maxAmount)) $this->_ci->JobsQueueModel->addLimit($maxAmount);
|
||||
if (is_numeric($maxAmount)) $limit = $maxAmount;
|
||||
|
||||
return $this->_ci->JobsQueueModel->loadWhere(array('status' => self::STATUS_NEW, 'type' => $type));
|
||||
// If it is a string then include it into an array
|
||||
if (!isEmptyString($type) && is_string($type)) $types = array($type);
|
||||
|
||||
// Return the result of the query
|
||||
return $this->_ci->JobsQueueModel->execReadOnlyQuery('
|
||||
SELECT jq.*
|
||||
FROM system.tbl_jobsqueue jq
|
||||
WHERE jq.type IN ?
|
||||
AND jq.status = ?
|
||||
ORDER BY jq.creationtime DESC
|
||||
LIMIT ?',
|
||||
array(
|
||||
$types,
|
||||
self::STATUS_NEW,
|
||||
$limit
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,11 +94,23 @@ class JobsQueueLib
|
||||
*/
|
||||
public function getJobsByTypeStatus($type, $status)
|
||||
{
|
||||
$this->_ci->JobsQueueModel->resetQuery();
|
||||
$types = $type; // default is array
|
||||
|
||||
$this->_ci->JobsQueueModel->addOrder('creationtime', 'DESC');
|
||||
// If it is a string then include it into an array
|
||||
if (!isEmptyString($type) && is_string($type)) $types = array($type);
|
||||
|
||||
return $this->_ci->JobsQueueModel->loadWhere(array('status' => $status, 'type' => $type));
|
||||
// Return the result of the query
|
||||
return $this->_ci->JobsQueueModel->execReadOnlyQuery('
|
||||
SELECT jq.*
|
||||
FROM system.tbl_jobsqueue jq
|
||||
WHERE jq.type IN ?
|
||||
AND jq.status = ?
|
||||
ORDER BY jq.creationtime DESC',
|
||||
array(
|
||||
$types,
|
||||
$status
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -253,8 +282,30 @@ class JobsQueueLib
|
||||
return array($job);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Protected methods
|
||||
|
||||
/**
|
||||
* Checks if the given job contains a valid type
|
||||
*/
|
||||
protected function _checkJobType($type, $types)
|
||||
{
|
||||
return $this->_inArray($type, $types, self::PROPERTY_TYPE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Drop not allowed properties from the given job
|
||||
*/
|
||||
private function _dropNotAllowedPropertiesNewJob(&$job)
|
||||
{
|
||||
unset($job->{self::PROPERTY_JOBID});
|
||||
unset($job->{self::PROPERTY_CREATIONTIME});
|
||||
unset($job->{self::PROPERTY_TYPE});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks the job object structure when needed for insert
|
||||
@@ -281,34 +332,6 @@ class JobsQueueLib
|
||||
return false; // better sorry than wrong
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the job object structure when needed for update
|
||||
*/
|
||||
private function _checkUpdateJobStructure(&$job)
|
||||
{
|
||||
// If job is a valid object
|
||||
if (is_object($job) && property_exists($job, self::PROPERTY_JOBID)) return true; // it is valid!
|
||||
|
||||
// If not object then object it!
|
||||
if (!is_object($job)) $job = new stdClass();
|
||||
|
||||
// If an error property was not already previously stored then store an error message in job object
|
||||
if (!property_exists($job, self::PROPERTY_ERROR))
|
||||
{
|
||||
$job->{self::PROPERTY_ERROR} = 'The structure of the provided job is not valid';
|
||||
}
|
||||
|
||||
return false; // better sorry than wrong
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given job contains a valid type
|
||||
*/
|
||||
private function _checkJobType($type, $types)
|
||||
{
|
||||
return $this->_inArray($type, $types, self::PROPERTY_TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given job contains a valid status
|
||||
*/
|
||||
@@ -333,6 +356,26 @@ class JobsQueueLib
|
||||
return $found;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the job object structure when needed for update
|
||||
*/
|
||||
private function _checkUpdateJobStructure(&$job)
|
||||
{
|
||||
// If job is a valid object
|
||||
if (is_object($job) && property_exists($job, self::PROPERTY_JOBID)) return true; // it is valid!
|
||||
|
||||
// If not object then object it!
|
||||
if (!is_object($job)) $job = new stdClass();
|
||||
|
||||
// If an error property was not already previously stored then store an error message in job object
|
||||
if (!property_exists($job, self::PROPERTY_ERROR))
|
||||
{
|
||||
$job->{self::PROPERTY_ERROR} = 'The structure of the provided job is not valid';
|
||||
}
|
||||
|
||||
return false; // better sorry than wrong
|
||||
}
|
||||
|
||||
/**
|
||||
* Search in an array the given value
|
||||
* The elements of the given array are objects
|
||||
@@ -354,16 +397,6 @@ class JobsQueueLib
|
||||
return $found;
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop not allowed properties from the given job
|
||||
*/
|
||||
private function _dropNotAllowedPropertiesNewJob(&$job)
|
||||
{
|
||||
unset($job->{self::PROPERTY_JOBID});
|
||||
unset($job->{self::PROPERTY_CREATIONTIME});
|
||||
unset($job->{self::PROPERTY_TYPE});
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop not allowed properties from the given job
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,333 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once 'JobsQueueLib.php';
|
||||
|
||||
/**
|
||||
* Library that contains all the needed functionalities to operate with the Long Run Tasks
|
||||
*/
|
||||
class LongRunTaskLib extends JobsQueueLib
|
||||
{
|
||||
// Config names
|
||||
const CFG_LRT_MAX_NUMBER_SYSTEM = 'lrt_max_number_system';
|
||||
const CFG_LRT_TYPES = 'lrt_types';
|
||||
const CFG_LRT_MAX_RUN = 'lrt_max_run_timeout';
|
||||
const CFG_LRT_MAX_NUMBER_USER = 'lrt_max_number_single_user';
|
||||
|
||||
// LRT object properties
|
||||
const PROPERTY_UID = 'uid';
|
||||
const PROPERTY_PID = 'pid';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loads the Long Run Tasks configs
|
||||
$this->_ci->config->load('lrt');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods used by the LongRunTaskExecJob
|
||||
|
||||
/**
|
||||
* Get the oldest added LRTs to the queue having status = new
|
||||
* The maximum number of returned queued LRTs is limited by:
|
||||
* number of currently running LRTs - maximum allowed number of LRTs for the system
|
||||
*/
|
||||
public function getNewLRTs()
|
||||
{
|
||||
// Get all the running LRTs
|
||||
$runningLrtsResult = $this->getJobsByTypeStatus($this->_ci->config->item(self::CFG_LRT_TYPES), JobsQueueLib::STATUS_RUNNING);
|
||||
|
||||
if (isError($runningLrtsResult)) return $runningLrtsResult;
|
||||
|
||||
// The number of the currently running LRTs - the maximum LRTs for the system
|
||||
$max_number_of_lrts = $this->_ci->config->item(self::CFG_LRT_MAX_NUMBER_SYSTEM) - count(getData($runningLrtsResult));
|
||||
|
||||
// Get the oldest LRTs added to the queue
|
||||
return $this->getOldestJobs($this->_ci->config->item(self::CFG_LRT_TYPES), $max_number_of_lrts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the LRT that are running more then CFG_LRT_MAX_RUN hours
|
||||
*/
|
||||
public function getHangingLRTs()
|
||||
{
|
||||
// Return the result of the query
|
||||
return $this->_ci->JobsQueueModel->execReadOnlyQuery('
|
||||
SELECT jq.*
|
||||
FROM system.tbl_jobsqueue jq
|
||||
WHERE jq.type IN ?
|
||||
AND jq.status = ?
|
||||
AND jq.starttime < NOW() - INTERVAL \''.$this->_ci->config->item(self::CFG_LRT_MAX_RUN).' hours\'
|
||||
ORDER BY jq.creationtime DESC',
|
||||
array(
|
||||
$this->_ci->config->item(self::CFG_LRT_TYPES),
|
||||
JobsQueueLib::STATUS_RUNNING
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the LRT that are currently running
|
||||
*/
|
||||
public function getRunningLRTs()
|
||||
{
|
||||
// Return the result of the query
|
||||
return $this->_ci->JobsQueueModel->execReadOnlyQuery('
|
||||
SELECT jq.*
|
||||
FROM system.tbl_jobsqueue jq
|
||||
WHERE jq.type IN ?
|
||||
AND jq.status = ?
|
||||
ORDER BY jq.creationtime DESC',
|
||||
array(
|
||||
$this->_ci->config->item(self::CFG_LRT_TYPES),
|
||||
JobsQueueLib::STATUS_RUNNING
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a LRT in background
|
||||
* - Checks if the wanted LRT exists in the applcation/controllers/lrts directory
|
||||
* - Then executes it in background via CI CLI
|
||||
* - Stores the LRT pid into the database
|
||||
*/
|
||||
public function executeLrt($lrt)
|
||||
{
|
||||
$output = array();
|
||||
|
||||
// If does _not_ exist a LRT implementation for this LRT type, then return an error
|
||||
if (!file_exists(APPPATH.'controllers/lrts/'.$lrt->{self::PROPERTY_TYPE}.'.php'))
|
||||
{
|
||||
return error('The required LRT implementation has not been found');
|
||||
}
|
||||
|
||||
// Execute the LRT implementation (a CI controller from CLI) providing as parameter the jobid
|
||||
exec(
|
||||
// Command
|
||||
sprintf(
|
||||
'/usr/bin/php %s/../index.ci.php lrts/%s/run %s > /dev/null 2>&1 & echo $!',
|
||||
APPPATH,
|
||||
$lrt->{self::PROPERTY_TYPE},
|
||||
$lrt->{self::PROPERTY_JOBID}
|
||||
),
|
||||
$output // Here goes the output from the standard output and error
|
||||
);
|
||||
|
||||
// If a pid has not been returned
|
||||
if (isEmptyArray($output) || !is_numeric($output[0])) return error('Not a valid pid has been returned');
|
||||
|
||||
// Set the pid, status and starttime of this LRT into the database
|
||||
$updateLrtResult = $this->_ci->JobsQueueModel->update(
|
||||
$lrt->{self::PROPERTY_JOBID},
|
||||
array(
|
||||
'pid' => $output[0],
|
||||
'starttime' => 'NOW()',
|
||||
'status' => self::STATUS_RUNNING
|
||||
)
|
||||
);
|
||||
if (isError($updateLrtResult)) return $updateLrtResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Kill the provided LRT
|
||||
* To avoid to kill a process that is not this LRT,
|
||||
* since the same PID can be assigned to another process once this ended
|
||||
*/
|
||||
public function killLrt($lrt)
|
||||
{
|
||||
// Try to get the pid of this LRT from the system
|
||||
$pid = exec(
|
||||
sprintf(
|
||||
'ps -eo pid,cmd | grep "index.ci.php lrts/%s/run %s" | grep -v grep | awk \'{print $1}\'',
|
||||
$lrt->{self::PROPERTY_TYPE},
|
||||
$lrt->{self::PROPERTY_JOBID}
|
||||
)
|
||||
);
|
||||
|
||||
// If the pid is the same then kill the process with a SIGKILL
|
||||
if ($pid == $lrt->{self::PROPERTY_PID}) exec('kill -9 '.$lrt->{self::PROPERTY_PID}.' > /dev/null 2>&1');
|
||||
|
||||
// Set the LRT as failed in any case
|
||||
$lrtExecFailedResult = $this->_ci->JobsQueueModel->update(
|
||||
$lrt->{self::PROPERTY_JOBID},
|
||||
array(
|
||||
'endtime' => 'NOW()',
|
||||
'status' => self::STATUS_FAILED
|
||||
)
|
||||
);
|
||||
// If an error occurred then return it
|
||||
if (isError($lrtExecFailedResult)) return $lrtExecFailedResult;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function checkExecution($lrt)
|
||||
{
|
||||
// If the LRT stopped running
|
||||
if (!$this->_isRunning($lrt))
|
||||
{
|
||||
// Loads MessageLib library
|
||||
$this->_ci->load->library('MessageLib');
|
||||
// Load the BenutzerModel
|
||||
$this->_ci->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
|
||||
// Get the benutzer for this uid
|
||||
$benutzerResult = $this->_ci->BenutzerModel->loadWhere(array('uid' => $lrt->{LongRunTaskLib::PROPERTY_UID}));
|
||||
// If an error occurred then return it
|
||||
if (isError($benutzerResult)) return $benutzerResult;
|
||||
// If no benutzer has been found
|
||||
if (!hasData($benutzerResult)) return error('No benutzer found, uid: '.$lrt->{LongRunTaskLib::PROPERTY_UID});
|
||||
|
||||
$benutzer = getData($benutzerResult)[0];
|
||||
|
||||
// Sends a message to the user
|
||||
$messageResult = $this->_ci->messagelib->sendMessageUser(
|
||||
$benutzer->person_id,
|
||||
'Long run task ended',
|
||||
'The long run task '.$lrt->{self::PROPERTY_TYPE}.' ended, output: '.$lrt->{self::PROPERTY_OUTPUT}
|
||||
);
|
||||
// If an error occurred then return it
|
||||
if (isError($messageResult)) return $messageResult;
|
||||
|
||||
// Set the LRT as done
|
||||
$lrtExecOverResult = $this->_ci->JobsQueueModel->update(
|
||||
$lrt->{self::PROPERTY_JOBID},
|
||||
array(
|
||||
'endtime' => 'NOW()',
|
||||
'status' => self::STATUS_DONE
|
||||
)
|
||||
);
|
||||
// If an error occurred then return it
|
||||
if (isError($lrtExecOverResult)) return $lrtExecOverResult;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods used by the front end applications (standard controllers/end points, ex. controllers/system/LRTTest.php)
|
||||
|
||||
/**
|
||||
* Add a single LRT to the queue
|
||||
*/
|
||||
public function addNewLrtToQueue($type, $uid, $lrtInput)
|
||||
{
|
||||
// Checks parameters
|
||||
if (isEmptyString($type)) return error('The provided type parameter is not a valid string');
|
||||
if (isEmptyString($uid)) return error('The provided uid parameter is not a valid string');
|
||||
|
||||
// Get all the running task for this uid
|
||||
// Return the result of the query
|
||||
$runningLRTbyUIDResult = $this->_ci->JobsQueueModel->execReadOnlyQuery('
|
||||
SELECT jq.*
|
||||
FROM system.tbl_jobsqueue jq
|
||||
WHERE jq.status IN ?
|
||||
AND jq.uid = ?
|
||||
',
|
||||
array(
|
||||
array(
|
||||
self::STATUS_NEW,
|
||||
self::STATUS_RUNNING
|
||||
),
|
||||
$uid
|
||||
)
|
||||
);
|
||||
|
||||
// If an error occurred then return it
|
||||
if (isError($runningLRTbyUIDResult)) return $runningLRTbyUIDResult;
|
||||
|
||||
// If the running tasks for this user are too many
|
||||
if (count(getData($runningLRTbyUIDResult)) >= $this->_ci->config->item(self::CFG_LRT_MAX_NUMBER_USER))
|
||||
{
|
||||
return error('Too many running tasks for this user');
|
||||
}
|
||||
|
||||
// Convert input to JSON and check it
|
||||
$jsonLrtInput = json_encode($lrtInput);
|
||||
if ($jsonLrtInput == null) return error('The provided LRT input is not valid');
|
||||
|
||||
// Get all the job types
|
||||
$dbResult = $this->_ci->JobTypesModel->load();
|
||||
if (isError($dbResult)) return $dbResult;
|
||||
$types = getData($dbResult);
|
||||
|
||||
// If the given type is not present in database
|
||||
if (!$this->_checkJobType($type, $types)) return error('The provided type parameter is not valid');
|
||||
|
||||
// Get all the job statuses
|
||||
$dbResult = $this->_ci->JobStatusesModel->load();
|
||||
if (isError($dbResult)) return $dbResult;
|
||||
$statuses = getData($dbResult);
|
||||
|
||||
// Create an object that represent the new tbl_jobsqueue record with the provided input
|
||||
$lrt = $this->generateJobs(self::STATUS_NEW, $jsonLrtInput)[0];
|
||||
|
||||
// What you asked is what you get!
|
||||
$lrt->{self::PROPERTY_TYPE} = $type;
|
||||
$lrt->{self::PROPERTY_UID} = $uid;
|
||||
|
||||
// Try to insert the single lrt into database
|
||||
$dbNewLrtResult = $this->_ci->JobsQueueModel->insert($lrt);
|
||||
|
||||
// If an error occurred during while inserting in database
|
||||
if (isError($dbNewLrtResult)) return $dbNewLrtResult;
|
||||
|
||||
return success('LRT added to the queue');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods used by the LRT implementation (controllers/ltrs/*, ex. controllers/ltrs/LRTDummy)
|
||||
|
||||
/**
|
||||
* Return a single record from the
|
||||
*/
|
||||
public function getLrt($jobid)
|
||||
{
|
||||
$this->_ci->JobsQueueModel->resetQuery();
|
||||
|
||||
return $this->_ci->JobsQueueModel->loadWhere(array('jobid' => $jobid));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setProgress($jobid, $progress)
|
||||
{
|
||||
return $this->_ci->JobsQueueModel->update($jobid, array('progress' => $progress));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setOutuput($jobid, $output)
|
||||
{
|
||||
return $this->_ci->JobsQueueModel->update($jobid, array('output' => json_encode($output)));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Return true if the LRT is still running
|
||||
*/
|
||||
private function _isRunning($lrt)
|
||||
{
|
||||
// Try to get the pid of this LRT from the system
|
||||
$pid = exec(
|
||||
sprintf(
|
||||
'ps -eo pid,cmd | grep "index.ci.php lrts/%s/run %s" | grep -v grep | awk \'{print $1}\'',
|
||||
$lrt->{self::PROPERTY_TYPE},
|
||||
$lrt->{self::PROPERTY_JOBID}
|
||||
)
|
||||
);
|
||||
|
||||
// If the pid is the same then the LRT is still running
|
||||
return $pid == $lrt->{self::PROPERTY_PID};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,392 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-Helper
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2026 fhcomplete.net
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
use \stdClass as stdClass;
|
||||
|
||||
class TagLib
|
||||
{
|
||||
const BATCHUSER = 'sftest';
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
// Configs
|
||||
$this->_ci->load->config('stv');
|
||||
|
||||
// Models
|
||||
$this->_ci->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->_ci->load->model('system/Notiztyp_model', 'NotiztypModel');
|
||||
$this->_ci->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel');
|
||||
$this->_ci->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
// Libraries
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
$this->_ci->load->library('PrestudentLib');
|
||||
}
|
||||
|
||||
public function updateAutomatedTags($paramsTag)
|
||||
{
|
||||
// ---------------------------------
|
||||
// check params
|
||||
// ---------------------------------
|
||||
$required = ['kurzbz', 'data', 'typeId'];
|
||||
|
||||
foreach ($required as $key) {
|
||||
if (!isset($paramsTag[$key])) {
|
||||
return error('Missing Parameter: ' . $key);
|
||||
}
|
||||
}
|
||||
|
||||
$studiensemester_kurzbz = (isset ($paramsTag['studiensemester_kurzbz']) ? $paramsTag['studiensemester_kurzbz'] : null);
|
||||
$tag = $paramsTag['kurzbz'];
|
||||
$inputData = $paramsTag['data'];
|
||||
$typeId = $paramsTag['typeId'];
|
||||
|
||||
// ---------------------------------
|
||||
// prepare input
|
||||
// ---------------------------------
|
||||
$zeitraum = [];
|
||||
$arrayIds = [];
|
||||
|
||||
foreach ($inputData as $item) {
|
||||
$id = $item['id'];
|
||||
$arrayIds[] = $id;
|
||||
|
||||
$zeitraum[$id] = [
|
||||
'von' => $item['von'] ?? null,
|
||||
'bis' => $item['bis'] ?? null
|
||||
];
|
||||
}
|
||||
$arrayIds = array_unique($arrayIds);
|
||||
|
||||
$result = $this->_ci->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
if (isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
$data = $result->retval[0] ?? null;
|
||||
|
||||
$von = $data->start ?? null;
|
||||
$bis = $data->ende ?? null;
|
||||
|
||||
// ---------------------------------
|
||||
// load existing tags
|
||||
// ---------------------------------
|
||||
$allTags = [];
|
||||
$resultAllTags = $this->_ci->NotizModel->getAllTags($tag, $von, $bis);
|
||||
if (isError($resultAllTags)) {
|
||||
return $resultAllTags;
|
||||
}
|
||||
$allTagsData = getData($resultAllTags);
|
||||
|
||||
if (!empty($allTagsData)) {
|
||||
foreach ($allTagsData as $item) {
|
||||
$allTags[$item->$typeId] = $item->notiz_id;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// map the data
|
||||
// ---------------------------------
|
||||
$toRecycle = [];
|
||||
$toAdd = [];
|
||||
$toDelete = [];
|
||||
|
||||
foreach ($arrayIds as $id) {
|
||||
if (isset($allTags[$id])) {
|
||||
$toRecycle[$id] = $allTags[$id];
|
||||
} else {
|
||||
$toAdd[] = $id;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($allTags as $id => $notizId) {
|
||||
if (!in_array($id, $arrayIds)) {
|
||||
$toDelete[$id] = $notizId;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// recycle (update existing)
|
||||
// ---------------------------------
|
||||
$countRecycled = 0;
|
||||
$retagged = [];
|
||||
|
||||
foreach ($toRecycle as $id => $notizId)
|
||||
{
|
||||
$this->_updateTag($notizId, $zeitraum[$id]['von'], $zeitraum[$id]['bis']);
|
||||
|
||||
$countRecycled++;
|
||||
$retagged[] = $id;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// ADD
|
||||
// ---------------------------------
|
||||
$countAdded = 0;
|
||||
$tagged = [];
|
||||
|
||||
foreach ($toAdd as $id)
|
||||
{
|
||||
$this->_insertTag($typeId, $id, $tag, $zeitraum[$id]['von'], $zeitraum[$id]['bis']);
|
||||
$countAdded++;
|
||||
|
||||
$tagged[] = $id;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// delete
|
||||
// ---------------------------------
|
||||
$countDeleted = 0;
|
||||
$deleted = [];
|
||||
|
||||
foreach ($toDelete as $id => $notizId)
|
||||
{
|
||||
$result = $this->_deleteTag($notizId);
|
||||
|
||||
if (isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
$countDeleted++;
|
||||
$deleted[] = $id;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
// return
|
||||
// ---------------------------------
|
||||
return success([
|
||||
'input' => [
|
||||
'tag' => $tag,
|
||||
'arrayIds' => $arrayIds
|
||||
],
|
||||
'summary' => [
|
||||
'recycled' => $countRecycled,
|
||||
'added' => $countAdded,
|
||||
'deleted' => $countDeleted
|
||||
],
|
||||
'details' => [
|
||||
'existingTags' => $allTags,
|
||||
'toAdd' => $toAdd,
|
||||
'toRecycle' => $toRecycle,
|
||||
'toDelete' => $toDelete
|
||||
],
|
||||
'results' => [
|
||||
'retaggedIds' => $retagged,
|
||||
'newTags' => $tagged,
|
||||
'deletedTagsIds' => $deleted
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
public function updateAutomatedTagsForTypeId(array $params)
|
||||
{
|
||||
$return = null;
|
||||
$notiz_id = null;
|
||||
|
||||
$von = $params['von'];
|
||||
$bis = $params['bis'];
|
||||
$tag = $params['kurzbz'];
|
||||
$id = $params['id'];
|
||||
$typeId = $params['typeId'];
|
||||
|
||||
$this->_ci->NotizModel->addSelect('nz.notiz_id');
|
||||
$this->_ci->NotizModel->addSelect($typeId);
|
||||
$this->_ci->NotizModel->addJoin('public.tbl_notizzuordnung nz', 'notiz_id');
|
||||
$resultAllTags = $this->_ci->NotizModel->loadWhere([
|
||||
'typ' => $tag,
|
||||
$typeId => $id
|
||||
]);
|
||||
if(hasData($resultAllTags))
|
||||
{
|
||||
$notiz_id = $resultAllTags->retval[0]->notiz_id;
|
||||
}
|
||||
|
||||
//RECYCLE
|
||||
if ($notiz_id !== null)
|
||||
{
|
||||
$resultUpdateNotiz = $this->_updateTag($notiz_id, $von, $bis);
|
||||
$return = ['recycled' => $resultUpdateNotiz];
|
||||
}
|
||||
else
|
||||
//ADD
|
||||
{
|
||||
$resultInsertNotiz = $this->_insertTag($typeId, $id, $tag, $von, $bis);
|
||||
$return = ['added' => $resultInsertNotiz];
|
||||
}
|
||||
return success($return);
|
||||
}
|
||||
|
||||
/*
|
||||
* main function for rebuild Tags for typeId
|
||||
* */
|
||||
public function rebuildTagsForTypeId($typeId, $id, $studiensemester_kurzbz)
|
||||
{
|
||||
$automatedTagsRes = $this->_ci->NotiztypModel->loadWhere(array('automatisiert' => true, 'taglib IS NOT NULL' => null));
|
||||
$automatedTags = hasData($automatedTagsRes) ? getData($automatedTagsRes) : [];
|
||||
|
||||
$result = $this->_ci->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
if (isError($result))
|
||||
return error('Error occurred during retrieving studiensemester');
|
||||
if (empty($result->retval) || !isset($result->retval[0])) {
|
||||
return error('No studiensemester found');
|
||||
}
|
||||
|
||||
$startSem = $result->retval[0]->start ?? null;
|
||||
$endeSem = $result->retval[0]->ende ?? null;
|
||||
$return = [];
|
||||
|
||||
foreach ($automatedTags as $autoTag)
|
||||
{
|
||||
// getPath: must not be lost
|
||||
$filePath = APPPATH . 'libraries/' . $autoTag->taglib . '.php'; // APPPATH = application/
|
||||
|
||||
if (file_exists($filePath)) {
|
||||
require_once($filePath);
|
||||
} else {
|
||||
echo "File not found: " . $filePath;
|
||||
continue;
|
||||
}
|
||||
|
||||
$className = basename($autoTag->taglib);
|
||||
$kurz_bz = $autoTag->typ_kurzbz;
|
||||
|
||||
$obj = new $className();
|
||||
|
||||
$criteriaIsSet = $obj->isCriteriaSetFor([
|
||||
'typeId' => $typeId,
|
||||
'id' => $id,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]);
|
||||
|
||||
if (hasData($criteriaIsSet))
|
||||
{
|
||||
$von = isset($criteriaIsSet->retval[0]->von) ? $criteriaIsSet->retval[0]->von : '';
|
||||
$bis = isset($criteriaIsSet->retval[0]->bis) ? $criteriaIsSet->retval[0]->bis : '';
|
||||
|
||||
$params = [
|
||||
'von' => $von,
|
||||
'bis' => $bis,
|
||||
'kurzbz' => $autoTag->typ_kurzbz,
|
||||
'typeId' => $typeId,
|
||||
'id' => $id,
|
||||
];
|
||||
|
||||
$result = $this->updateAutomatedTagsForTypeId($params);
|
||||
if (isError($result))
|
||||
return error('Error occurred during updateAutomatedTags' . $kurz_bz);
|
||||
|
||||
$return[$kurz_bz] = $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
//CHECK FOR DELETE
|
||||
$params = [
|
||||
'von' => $startSem,
|
||||
'bis' => $endeSem,
|
||||
'kurzbz' => $autoTag->typ_kurzbz,
|
||||
'typeId' => $typeId,
|
||||
'id' => $id,
|
||||
];
|
||||
$result = $this->_ci->NotizModel->checkIfExistingTag($kurz_bz, $typeId, $id, $startSem, $endeSem);
|
||||
if (hasData($result))
|
||||
{
|
||||
$notizId = $result->retval[0]->notiz_id;
|
||||
$this->_deleteTag($notizId);
|
||||
$return[$kurz_bz] = ['deleted' => $notizId];
|
||||
}
|
||||
}
|
||||
}
|
||||
return success($return);
|
||||
}
|
||||
|
||||
private function _insertTag($typeId, $id, $tag, $von, $bis)
|
||||
{
|
||||
$resultInsert = $this->_ci->NotizModel->insert([
|
||||
'titel' => 'TAG',
|
||||
'text' => 'AUTOMATED TAG',
|
||||
'verfasser_uid' => self::BATCHUSER,
|
||||
'erledigt' => false,
|
||||
'insertamum' => date('Y-m-d H:i:s'),
|
||||
'insertvon' => 'BatchJobTagAdd',
|
||||
'typ' => $tag,
|
||||
'start' => $von,
|
||||
'ende' => $bis
|
||||
]);
|
||||
|
||||
if (isError($resultInsert)) {
|
||||
return error('Error inserting tag for ' . $typeId . ': ' . $id);
|
||||
}
|
||||
|
||||
$notizId = $resultInsert->retval;
|
||||
|
||||
$resultZuordnung = $this->_ci->NotizzuordnungModel->insert([
|
||||
'notiz_id' => $notizId,
|
||||
$typeId => $id
|
||||
]);
|
||||
|
||||
if (isError($resultZuordnung)) {
|
||||
return error('Error inserting relation for ' . $typeId . ': ' . $id);
|
||||
}
|
||||
|
||||
return $notizId;
|
||||
}
|
||||
|
||||
private function _updateTag($notiz_id, $von, $bis)
|
||||
{
|
||||
$resultUpdateNotiz = $this->_ci->NotizModel->update(
|
||||
[
|
||||
'notiz_id' => $notiz_id
|
||||
],
|
||||
array(
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => 'BatchJobTagUpdate',
|
||||
'start' => $von,
|
||||
'ende' => $bis
|
||||
));
|
||||
|
||||
|
||||
if (isError($resultUpdateNotiz))
|
||||
return error ('Error occurred during Update ' . $notiz_id);
|
||||
|
||||
return $notiz_id;
|
||||
}
|
||||
|
||||
private function _deleteTag($notiz_id)
|
||||
{
|
||||
$result = $this->_ci->NotizzuordnungModel->delete([
|
||||
'notiz_id' => $notiz_id
|
||||
]);
|
||||
if (isError($result)) {
|
||||
return error('Error occurred during delete Notizzuordnung ' . $notiz_id);
|
||||
}
|
||||
|
||||
$result = $this->_ci->NotizModel->delete([
|
||||
'notiz_id' => $notiz_id
|
||||
]);
|
||||
if (isError($result)) {
|
||||
return error('Error occurred during delete Notiz ' . $notiz_id);
|
||||
}
|
||||
|
||||
return success([
|
||||
'deleted' => $notiz_id
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -47,6 +47,8 @@ class StudentListLib
|
||||
|
||||
// Add default SELECTs
|
||||
$this->addSelect("b.uid");
|
||||
if (defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
$this->addSelect('tag_data_agg.tags');
|
||||
$this->addSelect('titelpre');
|
||||
$this->addSelect('nachname');
|
||||
$this->addSelect('vorname');
|
||||
@@ -70,13 +72,6 @@ class StudentListLib
|
||||
$this->addSelect('pls.status_kurzbz AS status');
|
||||
$this->addSelect('pls.datum AS status_datum');
|
||||
$this->addSelect('pls.bestaetigtam AS status_bestaetigung');
|
||||
$this->addSelect("
|
||||
CASE
|
||||
WHEN pls.status_kurzbz IN ('Interessent','Aufgenommener','Bewerber','Wartender')
|
||||
THEN pls.ausbildungssemester
|
||||
ELSE s.semester
|
||||
END AS semester_berechnet
|
||||
");
|
||||
$this->addSelect(
|
||||
"(SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp='email' AND person_id=p.person_id AND zustellung LIMIT 1) AS mail_privat",
|
||||
false
|
||||
@@ -134,6 +129,41 @@ class StudentListLib
|
||||
$this->addJoin('public.tbl_benutzer b', 's.student_uid=b.uid', 'LEFT');
|
||||
$this->addJoin("v", "", ""); // Will be replaced later
|
||||
$this->addJoin("ps", "", ""); // Will be replaced later
|
||||
if (defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED) {
|
||||
$this->_ci->load->config('stv');
|
||||
$tags = $this->_ci->config->item('stv_prestudent_tags');
|
||||
|
||||
$whereTags = '';
|
||||
if (is_array($tags) && !isEmptyArray($tags)) {
|
||||
$tags = array_keys($tags);
|
||||
|
||||
foreach ($tags as $key => $tag) {
|
||||
$tags[$key] = $this->_ci->PrestudentModel->escape($tag);
|
||||
}
|
||||
$whereTags = " AND nt.typ_kurzbz IN (" . implode(",", $tags) . ")";
|
||||
}
|
||||
$subQueryTag = "(
|
||||
SELECT
|
||||
tag.prestudent_id,
|
||||
COALESCE(json_agg(tag ORDER BY tag.done), '[]'::json) AS tags
|
||||
FROM (
|
||||
SELECT DISTINCT ON (n.notiz_id)
|
||||
n.notiz_id AS id,
|
||||
nt.typ_kurzbz,
|
||||
array_to_json(nt.bezeichnung_mehrsprachig)->>0 AS beschreibung,
|
||||
n.text AS notiz,
|
||||
nt.style,
|
||||
n.erledigt AS done,
|
||||
nz.prestudent_id
|
||||
FROM public.tbl_notizzuordnung AS nz
|
||||
JOIN public.tbl_notiz AS n ON nz.notiz_id = n.notiz_id
|
||||
JOIN public.tbl_notiz_typ AS nt ON n.typ = nt.typ_kurzbz " . $whereTags . "
|
||||
) AS tag
|
||||
GROUP BY tag.prestudent_id
|
||||
) AS tag_data_agg";
|
||||
|
||||
$this->addJoin($subQueryTag, 'tag_data_agg.prestudent_id = tbl_prestudent.prestudent_id', 'LEFT');
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -253,10 +283,9 @@ class StudentListLib
|
||||
*/
|
||||
public function execute($studiensemester_kurzbz)
|
||||
{
|
||||
$this->addSelectAndJoinForTagsIfConfigured($studiensemester_kurzbz);
|
||||
|
||||
$stdsemEsc = $studiensemester_kurzbz ? $this->_ci->PrestudentModel->escape($studiensemester_kurzbz) : 'NULL';
|
||||
|
||||
|
||||
$this->addSelect(
|
||||
"public.get_rolle_prestudent(
|
||||
public.tbl_prestudent.prestudent_id,
|
||||
@@ -296,72 +325,6 @@ class StudentListLib
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Protected methods
|
||||
|
||||
/**
|
||||
* Add Select and Join for Tags if configured
|
||||
*
|
||||
* @param string studiensemester_kurzbz
|
||||
*
|
||||
*/
|
||||
protected function addSelectAndJoinForTagsIfConfigured($studiensemester_kurzbz)
|
||||
{
|
||||
if (defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED) {
|
||||
$this->_ci->load->config('stv');
|
||||
$tags = $this->_ci->config->item('stv_prestudent_tags');
|
||||
|
||||
$whereTags = '';
|
||||
if (is_array($tags) && !isEmptyArray($tags)) {
|
||||
$tags = array_keys($tags);
|
||||
|
||||
foreach ($tags as $key => $tag) {
|
||||
$tags[$key] = $this->_ci->PrestudentModel->escape($tag);
|
||||
}
|
||||
$whereTags = " AND nt.typ_kurzbz IN (" . implode(",", $tags) . ")";
|
||||
}
|
||||
$studiensemester_kurzbz_escaped = $this->_ci->PrestudentModel->escape($studiensemester_kurzbz);
|
||||
$subQueryTag = "(
|
||||
SELECT
|
||||
tag.prestudent_id,
|
||||
COALESCE(json_agg(tag ORDER BY tag.done), '[]'::json) AS tags
|
||||
FROM (
|
||||
SELECT DISTINCT ON (n.notiz_id)
|
||||
n.notiz_id AS id,
|
||||
nt.typ_kurzbz,
|
||||
array_to_json(nt.bezeichnung_mehrsprachig)->>0 AS beschreibung,
|
||||
n.text AS notiz,
|
||||
nt.style,
|
||||
n.erledigt AS done,
|
||||
nz.prestudent_id,
|
||||
n.start,
|
||||
n.ende
|
||||
FROM public.tbl_notizzuordnung AS nz
|
||||
JOIN public.tbl_notiz AS n ON nz.notiz_id = n.notiz_id AND nz.prestudent_id IS NOT NULL
|
||||
JOIN public.tbl_notiz_typ AS nt ON n.typ = nt.typ_kurzbz " . $whereTags . "
|
||||
WHERE
|
||||
COALESCE(n.start, '1970-01-01') <= (
|
||||
SELECT
|
||||
ende
|
||||
FROM
|
||||
public.tbl_studiensemester
|
||||
WHERE
|
||||
studiensemester_kurzbz = " . $studiensemester_kurzbz_escaped . "
|
||||
)
|
||||
AND COALESCE(n.ende, '2170-12-31') >= (
|
||||
SELECT
|
||||
start
|
||||
FROM
|
||||
public.tbl_studiensemester
|
||||
WHERE
|
||||
studiensemester_kurzbz = " . $studiensemester_kurzbz_escaped . "
|
||||
)
|
||||
) AS tag
|
||||
GROUP BY tag.prestudent_id
|
||||
) AS tag_data_agg";
|
||||
|
||||
$this->addSelect('tag_data_agg.tags');
|
||||
$this->addJoin($subQueryTag, 'tag_data_agg.prestudent_id = tbl_prestudent.prestudent_id', 'LEFT');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get alias of a table or select statement
|
||||
*
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of dd_auto
|
||||
*
|
||||
* @author ma0068
|
||||
*/
|
||||
class CoreDoubleDegreeTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('codex/Mobilitaet_model', 'MobilitaetModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'idArray' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$this->ci->MobilitaetModel->addJoin('bis.tbl_gsprogramm', 'gsprogramm_id');
|
||||
$this->ci->MobilitaetModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
|
||||
$result = $this->ci->MobilitaetModel-> loadWhere(array(
|
||||
'gsprogrammtyp_kurzbz' => 'Double',
|
||||
'studiensemester_kurzbz' => $semester
|
||||
));
|
||||
$data = $result->retval;
|
||||
|
||||
$doubledegree_data = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->prestudent_id,
|
||||
'von' => $item->start,
|
||||
'bis' => $item->ende
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'data' => $doubledegree_data,
|
||||
'typeId' => 'prestudent_id'
|
||||
);
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'prestudent_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$prestudent_id = $params['id'];
|
||||
|
||||
$this->ci->MobilitaetModel->addSelect('prestudent_id');
|
||||
$this->ci->MobilitaetModel->addSelect('start as von');
|
||||
$this->ci->MobilitaetModel->addSelect('ende as bis');
|
||||
|
||||
$this->ci->MobilitaetModel->addJoin('bis.tbl_gsprogramm', 'gsprogramm_id');
|
||||
$this->ci->MobilitaetModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
|
||||
$result = $this->ci->MobilitaetModel->loadWhere(array(
|
||||
'gsprogrammtyp_kurzbz' => 'Double',
|
||||
'studiensemester_kurzbz' => $semester,
|
||||
'prestudent_id' => $prestudent_id
|
||||
));
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
//array mit prestudent_id, von und bis
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Description unruly
|
||||
* Test for different typeId
|
||||
*
|
||||
* @author ma0068
|
||||
*/
|
||||
class CoreFiftyFiveTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('person/Person_model', 'PersonModel');
|
||||
$this->ci-> load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'person_id' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$result = $this->ci->StudiensemesterModel->loadWhere(array(
|
||||
'studiensemester_kurzbz' => $semester
|
||||
));
|
||||
$data = $result->retval[0];
|
||||
|
||||
$semVon = $data->start;
|
||||
$semBis = $data->ende;
|
||||
$result = $this->ci->PersonModel->getFiftyFivers($semVon, $semBis);
|
||||
|
||||
$data = $result->retval;
|
||||
$fiftyFiveData = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->person_id
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'data' => $fiftyFiveData,
|
||||
'typeId' => 'person_id'
|
||||
);
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'person_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$person_id = $params['id'];
|
||||
$typeId = $params['typeId'];
|
||||
|
||||
|
||||
$result = $this->ci->StudiensemesterModel->loadWhere(array(
|
||||
'studiensemester_kurzbz' => $semester
|
||||
));
|
||||
$data = $result->retval[0];
|
||||
|
||||
$semVon = $data->start;
|
||||
$semBis = $data->ende;
|
||||
$result = $this->ci->PersonModel->isFiftyFive($semVon, $semBis, $person_id);
|
||||
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of jgv_auto (Jahrgangsvertretung)
|
||||
*
|
||||
* @author ma0068
|
||||
*/
|
||||
class CoreJgvTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'idArray' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$result = $this->ci->BenutzerfunktionModel->getPrestudentsOfJgv($semester);
|
||||
|
||||
$data = $result->retval;
|
||||
|
||||
$jgv_data = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->prestudent_id,
|
||||
'von' => $item->datum_von,
|
||||
'bis' => $item->datum_bis
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'data' => $jgv_data,
|
||||
'typeId' => 'prestudent_id'
|
||||
);
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'prestudent_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$prestudent_id = $params['id'];
|
||||
|
||||
$result = $this->ci->BenutzerfunktionModel->isJgv($semester, $prestudent_id);
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of zgv_auto
|
||||
*
|
||||
* @author ma0068
|
||||
*/
|
||||
class CoreMissingZgvTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'idArray' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$this->ci->PrestudentModel->addJoin('public.tbl_prestudentstatus', 'prestudent_id');
|
||||
$this->ci->PrestudentModel->addJoin('public.tbl_benutzer bn', 'person_id');
|
||||
$this->ci->PrestudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
$result = $this->ci->PrestudentModel-> loadWhere(array(
|
||||
'bn.aktiv' => true, //check if necessary
|
||||
'zgvdatum' => null,
|
||||
'typ' => 'b',
|
||||
'studiensemester_kurzbz' => $semester
|
||||
));
|
||||
|
||||
$data = $result->retval;
|
||||
|
||||
$zgvmissing_data = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->prestudent_id,
|
||||
'von' => null,
|
||||
'bis' => null
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'typeId' => 'prestudent_id',
|
||||
'data' => $zgvmissing_data
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'prestudent_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$prestudent_id = $params['id'];
|
||||
|
||||
$this->ci->PrestudentModel->addJoin('public.tbl_prestudentstatus', 'prestudent_id');
|
||||
$this->ci->PrestudentModel->addJoin('public.tbl_benutzer bn', 'person_id');
|
||||
$this->ci->PrestudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
$result = $this->ci->PrestudentModel->loadWhere(array(
|
||||
'bn.aktiv' => true, //check if necessary
|
||||
'zgvdatum' => null,
|
||||
'typ' => 'b',
|
||||
'studiensemester_kurzbz' => $semester,
|
||||
'prestudent_id' => $prestudent_id
|
||||
));
|
||||
if(hasData($result))
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of out_auto
|
||||
*
|
||||
* @author ma0068
|
||||
*/
|
||||
class CoreOutgoingTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('codex/Bisio_model', 'BisioModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'idArray' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$result = $this->ci->BisioModel->getOutgoingsOfSemester($semester);
|
||||
|
||||
$data = $result->retval;
|
||||
|
||||
$outgoing_data = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->prestudent_id,
|
||||
'von' => $item->von,
|
||||
'bis' => $item->bis
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'data' => $outgoing_data,
|
||||
'typeId' => 'prestudent_id',
|
||||
);
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'prestudent_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$prestudent_id = $params['id'];
|
||||
|
||||
$result = $this->ci->BisioModel->isPrestudentOutgoing($semester, $prestudent_id);
|
||||
|
||||
if (hasData($result)) {
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of prewh_auto
|
||||
*
|
||||
* @author bambi
|
||||
*/
|
||||
class CorePrewiederholerTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'idArray' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$this->ci->PrestudentstatusModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
$result = $this->ci->PrestudentstatusModel-> loadWhere(array(
|
||||
'statusgrund_id' => 15,
|
||||
'studiensemester_kurzbz' => $semester
|
||||
));
|
||||
$data = $result->retval;
|
||||
|
||||
$prewiederholer_data = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->prestudent_id,
|
||||
'von' => $item->start,
|
||||
'bis' => $item->ende
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'data' => $prewiederholer_data,
|
||||
'typeId' => 'prestudent_id',
|
||||
);
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'prestudent_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$prestudent_id = $params['id'];
|
||||
|
||||
$this->ci->PrestudentstatusModel->addSelect('prestudent_id');
|
||||
$this->ci->PrestudentstatusModel->addSelect('start as von');
|
||||
$this->ci->PrestudentstatusModel->addSelect('ende as bis');
|
||||
|
||||
$this->ci->PrestudentstatusModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
|
||||
$result = $this->ci->PrestudentstatusModel->loadWhere(array(
|
||||
'statusgrund_id' => 15,
|
||||
'studiensemester_kurzbz' => $semester,
|
||||
'prestudent_id' => $prestudent_id
|
||||
));
|
||||
if(hasData($result))
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of dd_auto
|
||||
*
|
||||
* @author ma0068
|
||||
*/
|
||||
class CoreStbErhoehtTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('crm/Konto_model', 'KontoModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'idArray' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$this->ci->KontoModel->addJoin('public.tbl_prestudent', 'person_id');
|
||||
$this->ci->KontoModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
|
||||
$result = $this->ci->KontoModel-> loadWhere(array(
|
||||
'buchungstyp_kurzbz' => 'StudiengebuehrErhoeht',
|
||||
'studiensemester_kurzbz' => $semester
|
||||
));
|
||||
$data = $result->retval;
|
||||
|
||||
$konto_data = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->prestudent_id,
|
||||
'von' => $item->start,
|
||||
'bis' => $item->ende
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'data' => $konto_data,
|
||||
'typeId' => 'prestudent_id'
|
||||
);
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'prestudent_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$prestudent_id = $params['id'];
|
||||
|
||||
$this->ci->KontoModel->addSelect('prestudent_id');
|
||||
$this->ci->KontoModel->addSelect('start as von');
|
||||
$this->ci->KontoModel->addSelect('ende as bis');
|
||||
$this->ci->KontoModel->addJoin('public.tbl_prestudent', 'person_id');
|
||||
$this->ci->KontoModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
|
||||
$result = $this->ci->KontoModel-> loadWhere(array(
|
||||
'buchungstyp_kurzbz' => 'StudiengebuehrErhoeht',
|
||||
'studiensemester_kurzbz' => $semester,
|
||||
'prestudent_id' => $prestudent_id
|
||||
));
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of wiedereinstieg_auto
|
||||
*
|
||||
* @author ma0068
|
||||
*/
|
||||
class CoreUnterbrecherTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'idArray' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$this->ci->PrestudentstatusModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
|
||||
$result = $this->ci->PrestudentstatusModel-> loadWhere(array(
|
||||
'status_kurzbz' => 'Unterbrecher',
|
||||
'studiensemester_kurzbz' => $semester
|
||||
));
|
||||
$data = $result->retval;
|
||||
|
||||
$unterbrecher_data = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->prestudent_id,
|
||||
'von' => $item->start,
|
||||
'bis' => $item->ende
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'data' => $unterbrecher_data,
|
||||
'typeId' => 'prestudent_id'
|
||||
);
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'prestudent_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$prestudent_id = $params['id'];
|
||||
|
||||
$this->ci->PrestudentstatusModel->addSelect('prestudent_id');
|
||||
$this->ci->PrestudentstatusModel->addSelect('start as von');
|
||||
$this->ci->PrestudentstatusModel->addSelect('ende as bis');
|
||||
|
||||
$this->ci->PrestudentstatusModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
$result = $this->ci->PrestudentstatusModel-> loadWhere(array(
|
||||
'status_kurzbz' => 'Unterbrecher',
|
||||
'studiensemester_kurzbz' => $semester,
|
||||
'prestudent_id' => $prestudent_id
|
||||
));
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of wh_auto
|
||||
*
|
||||
* @author bambi
|
||||
*/
|
||||
class CoreWiederholerTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'idArray' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
|
||||
$this->ci->PrestudentstatusModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
$result = $this->ci->PrestudentstatusModel-> loadWhere(array(
|
||||
'statusgrund_id' => 16,
|
||||
'studiensemester_kurzbz' => $semester
|
||||
));
|
||||
$data = $result->retval;
|
||||
|
||||
$wiederholer_data = array_map(function($item) {
|
||||
return [
|
||||
'id' => $item->prestudent_id,
|
||||
'von' => $item->start,
|
||||
'bis' => $item->ende
|
||||
];
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'typeId' => 'prestudent_id',
|
||||
'data' => $wiederholer_data
|
||||
);
|
||||
}
|
||||
|
||||
public function isCriteriaSetFor(array $params)
|
||||
{
|
||||
if ( !isset($params['id'], $params['studiensemester_kurzbz'], $params['typeId']) || $params['typeId'] !== 'prestudent_id')
|
||||
return false;
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$prestudent_id = $params['id'];
|
||||
|
||||
$this->ci->PrestudentstatusModel->addSelect('prestudent_id');
|
||||
$this->ci->PrestudentstatusModel->addSelect('start as von');
|
||||
$this->ci->PrestudentstatusModel->addSelect('ende as bis');
|
||||
|
||||
$this->ci->PrestudentstatusModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz');
|
||||
|
||||
$result = $this->ci->PrestudentstatusModel->loadWhere(array(
|
||||
'statusgrund_id' => 16,
|
||||
'studiensemester_kurzbz' => $semester,
|
||||
'prestudent_id' => $prestudent_id,
|
||||
));
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -44,57 +44,4 @@ class Bisio_model extends DB_Model
|
||||
else
|
||||
return success("Bisio not found");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets outgoing students of certain Semester
|
||||
* @param String studiensemester_kurzbz
|
||||
* @return array of prestudent_ids
|
||||
*/
|
||||
public function getOutgoingsOfSemester($studiensemester_kurzbz)
|
||||
{
|
||||
$query = "
|
||||
SELECT DISTINCT ps.prestudent_id, tbl_bisio.von, tbl_bisio.bis
|
||||
FROM bis.tbl_bisio
|
||||
JOIN public.tbl_student USING (student_uid)
|
||||
JOIN public.tbl_prestudent ps USING (prestudent_id)
|
||||
JOIN public.tbl_prestudentstatus pss ON (ps.prestudent_id = pss.prestudent_id)
|
||||
JOIN public.tbl_studiensemester ss ON (pss.studiensemester_kurzbz = ss.studiensemester_kurzbz)
|
||||
WHERE ss.studiensemester_kurzbz = ?
|
||||
AND nation_code <> 'A'
|
||||
AND (
|
||||
tbl_bisio.von <= ss.ende
|
||||
AND (
|
||||
tbl_bisio.bis >= ss.start
|
||||
OR tbl_bisio.bis IS NULL
|
||||
)
|
||||
)
|
||||
";
|
||||
|
||||
return $this->execQuery($query, array($studiensemester_kurzbz));
|
||||
}
|
||||
|
||||
public function isPrestudentOutgoing($studiensemester_kurzbz, $prestudent_id)
|
||||
{
|
||||
$query = "
|
||||
SELECT
|
||||
ps.prestudent_id, tbl_bisio.von, tbl_bisio.bis
|
||||
FROM bis.tbl_bisio
|
||||
JOIN public.tbl_student USING (student_uid)
|
||||
JOIN public.tbl_prestudent ps USING (prestudent_id)
|
||||
JOIN public.tbl_prestudentstatus pss ON (ps.prestudent_id = pss.prestudent_id)
|
||||
JOIN public.tbl_studiensemester ss ON (pss.studiensemester_kurzbz = ss.studiensemester_kurzbz)
|
||||
WHERE ss.studiensemester_kurzbz = ?
|
||||
AND nation_code <> 'A'
|
||||
AND (
|
||||
tbl_bisio.von <= ss.ende
|
||||
AND (
|
||||
tbl_bisio.bis >= ss.start
|
||||
OR tbl_bisio.bis IS NULL
|
||||
)
|
||||
)
|
||||
AND ps.prestudent_id = ?
|
||||
";
|
||||
|
||||
return $this->execQuery($query, array($studiensemester_kurzbz, $prestudent_id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,47 +122,6 @@ class Studiensemester_model extends DB_Model
|
||||
return $this->execQuery($query, array($studiensemester_kurzbz, $limit));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the current study semester and the previous semesters of the same type (SS/WS).
|
||||
*
|
||||
* Example:
|
||||
* - SS2026, limit 3: SS2026, SS2025, SS2024
|
||||
* - WS2025, limit 2: WS2025, WS2024
|
||||
*
|
||||
* @param $studiensemester_kurzbz
|
||||
* @param $limit
|
||||
*/
|
||||
public function getPreviousSameSemesterFrom($studiensemester_kurzbz, $limit = 1)
|
||||
{
|
||||
$qry = '
|
||||
SELECT
|
||||
studiensemester_kurzbz,
|
||||
start,
|
||||
ende
|
||||
FROM
|
||||
public.tbl_studiensemester
|
||||
WHERE
|
||||
SUBSTRING(studiensemester_kurzbz FROM 1 FOR 2) = SUBSTRING(? FROM 1 FOR 2)
|
||||
AND start <= (
|
||||
SELECT start
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE studiensemester_kurzbz = ?
|
||||
)
|
||||
ORDER BY
|
||||
start DESC
|
||||
LIMIT ?
|
||||
';
|
||||
|
||||
return $this->execQuery($qry,
|
||||
[
|
||||
$studiensemester_kurzbz,
|
||||
$studiensemester_kurzbz,
|
||||
$limit
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* getNearest
|
||||
*/
|
||||
|
||||
@@ -260,6 +260,7 @@ class Benutzerfunktion_model extends DB_Model
|
||||
return $this->execQuery($query, $parameters_array);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get active Kompetenzfeldleitung bei UID.
|
||||
*
|
||||
@@ -295,6 +296,7 @@ class Benutzerfunktion_model extends DB_Model
|
||||
return $this->execQuery($query, $parameters_array);
|
||||
}
|
||||
|
||||
|
||||
public function insertBenutzerfunktion($Json)
|
||||
{
|
||||
unset($Json['benutzerfunktion_id']);
|
||||
@@ -348,64 +350,5 @@ class Benutzerfunktion_model extends DB_Model
|
||||
return success($funktionJson);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all Prestudents with details for a given Benutzerfunktion and optionally semester
|
||||
*
|
||||
* @param String $studiensemester_kurzbz
|
||||
* @return object |null
|
||||
*/
|
||||
public function getPrestudentsOfJgv($semester)
|
||||
{
|
||||
$query = "
|
||||
SELECT DISTINCT ps.prestudent_id, bf.datum_von, bf.datum_bis
|
||||
FROM public.tbl_benutzerfunktion bf
|
||||
JOIN public.tbl_benutzer bn USING (uid)
|
||||
JOIN public.tbl_prestudent ps USING (person_id)
|
||||
JOIN public.tbl_prestudentstatus pss ON (ps.prestudent_id = pss.prestudent_id)
|
||||
JOIN public.tbl_studiensemester ss ON (pss.studiensemester_kurzbz = ss.studiensemester_kurzbz)
|
||||
WHERE ss.studiensemester_kurzbz = ?
|
||||
AND bf.funktion_kurzbz = 'jgv'
|
||||
AND (
|
||||
bf.datum_von <= ss.ende
|
||||
AND (
|
||||
bf.datum_bis >= ss.start
|
||||
OR bf.datum_bis IS NULL
|
||||
)
|
||||
)
|
||||
";
|
||||
|
||||
return $this->execQuery($query, array($semester));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a certain prestudent has the Benutzerfunktion jgv for a certain semester
|
||||
*
|
||||
* @param String $studiensemester_kurzbz
|
||||
* @param $prestudent_id
|
||||
* @return object |null
|
||||
*/
|
||||
public function isJgv($semester, $prestudent_id)
|
||||
{
|
||||
$query = "
|
||||
SELECT ps.prestudent_id, ss.start as von, ss.ende as bis
|
||||
FROM public.tbl_benutzerfunktion bf
|
||||
JOIN public.tbl_benutzer bn USING (uid)
|
||||
JOIN public.tbl_prestudent ps USING (person_id)
|
||||
JOIN public.tbl_prestudentstatus pss ON (ps.prestudent_id = pss.prestudent_id)
|
||||
JOIN public.tbl_studiensemester ss ON (pss.studiensemester_kurzbz = ss.studiensemester_kurzbz)
|
||||
WHERE ss.studiensemester_kurzbz = ?
|
||||
AND bf.funktion_kurzbz = 'jgv'
|
||||
AND (
|
||||
bf.datum_von <= ss.ende
|
||||
AND (
|
||||
bf.datum_bis >= ss.start
|
||||
OR bf.datum_bis IS NULL
|
||||
)
|
||||
)
|
||||
AND ps.prestudent_id = ?
|
||||
";
|
||||
|
||||
return $this->execQuery($query, array($semester, $prestudent_id));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -296,59 +296,4 @@ class Notiz_model extends DB_Model
|
||||
|
||||
return $this->loadWhere(array('anrechnung_id' => $anrechnung_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* check if a given Tag for a certain notizzuordnung id is valid
|
||||
*
|
||||
* @param $tag typ_kurzbz to check
|
||||
* @param $typeId typeId to check
|
||||
* @param $id id to check
|
||||
* @param $von start of time period or NULL
|
||||
* @param $bis end of time period or NULL
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function checkIfExistingTag($tag, $typeId, $id, $von=null, $bis=null)
|
||||
{
|
||||
$query = "
|
||||
SELECT *
|
||||
FROM public.tbl_notiz
|
||||
JOIN public.tbl_notizzuordnung nz USING (notiz_id)
|
||||
WHERE typ = ?
|
||||
AND {$typeId} = ?
|
||||
AND (
|
||||
start IS NULL
|
||||
OR ende IS NULL
|
||||
OR (start <= ? AND ende >= ?)
|
||||
)
|
||||
";
|
||||
|
||||
return $this->execQuery($query, [$tag, $id, $bis, $von]);
|
||||
}
|
||||
|
||||
/**
|
||||
* returns all existing tags of a certain tag within a time period
|
||||
*
|
||||
* @param $tag typ_kurzbz of tag
|
||||
* @param $von start of time period or NULL
|
||||
* @param $bis end of time period or NULL
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAllTags($tag, $von=null, $bis=null)
|
||||
{
|
||||
$query = "
|
||||
SELECT *
|
||||
FROM public.tbl_notiz
|
||||
JOIN public.tbl_notizzuordnung nz USING (notiz_id)
|
||||
WHERE typ = ?
|
||||
AND (
|
||||
start IS NULL
|
||||
OR ende IS NULL
|
||||
OR (start <= ? AND ende >= ?)
|
||||
);
|
||||
";
|
||||
|
||||
return $this->execQuery($query, array($tag, $bis, $von));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ class Person_model extends DB_Model
|
||||
* @param $filter Term to search for.
|
||||
* @return DB-result
|
||||
*/
|
||||
public function searchPerson($filter, $mode=null)
|
||||
public function searchPerson($filter)
|
||||
{
|
||||
$this->addSelect('vorname, nachname, gebdatum, person_id, titelpre, titelpost');
|
||||
$this->addSelect("CASE
|
||||
@@ -161,26 +161,6 @@ class Person_model extends DB_Model
|
||||
THEN 'Student'
|
||||
ELSE 'Person'
|
||||
END AS status");
|
||||
|
||||
if($mode == 'mitMaUid')
|
||||
{
|
||||
$this->addSelect("(
|
||||
SELECT m.mitarbeiter_uid
|
||||
FROM public.tbl_benutzer b
|
||||
JOIN public.tbl_mitarbeiter m
|
||||
ON b.uid = m.mitarbeiter_uid
|
||||
WHERE b.person_id = tbl_person.person_id
|
||||
LIMIT 1
|
||||
)
|
||||
AS uid");
|
||||
$this->addOrder('uid, lower(nachname), lower(vorname)');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->addOrder('lower(nachname), lower(vorname)');
|
||||
}
|
||||
|
||||
|
||||
$result = $this->loadWhere(
|
||||
'lower(nachname) like '.$this->db->escape('%'.mb_strtolower($filter).'%')."
|
||||
OR lower(vorname) like ".$this->db->escape('%'.$filter.'%')."
|
||||
@@ -453,33 +433,4 @@ class Person_model extends DB_Model
|
||||
|
||||
return $this->execReadOnlyQuery($qry, [$person_id]);
|
||||
}
|
||||
|
||||
//just a test function for a person_id tag
|
||||
//alle personen die innerhalb dieses Zeitraumens 55 werden
|
||||
public function getFiftyFivers($von, $bis)
|
||||
{
|
||||
$qry = "
|
||||
SELECT
|
||||
p.person_id
|
||||
FROM public.tbl_person p
|
||||
WHERE p.gebdatum >= DATE ? - INTERVAL '55 years'
|
||||
AND p.gebdatum <= DATE ? - INTERVAL '55 years';
|
||||
";
|
||||
return $this->execReadOnlyQuery($qry, [$von, $bis]);
|
||||
}
|
||||
|
||||
//just a test function for a person_id tag
|
||||
//check if Person gets 55 in this time
|
||||
public function isFiftyFive($von, $bis, $person_id)
|
||||
{
|
||||
$qry = "
|
||||
SELECT
|
||||
p.person_id
|
||||
FROM public.tbl_person p
|
||||
WHERE p.gebdatum >= DATE ? - INTERVAL '55 years'
|
||||
AND p.gebdatum <= DATE ? - INTERVAL '55 years'
|
||||
AND p.persond_id = ?;
|
||||
";
|
||||
return $this->execReadOnlyQuery($qry, [$von, $bis, $person_id]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
$includesArray = array(
|
||||
'title' => 'LRT Test Page',
|
||||
'axios027' => true,
|
||||
'bootstrap5' => true,
|
||||
'fontawesome6' => true,
|
||||
'vue3' => true,
|
||||
'navigationcomponent' => true,
|
||||
'phrases' => array(
|
||||
'global',
|
||||
'ui'
|
||||
),
|
||||
'customJSModules' => array('public/js/apps/LRTTest.js'),
|
||||
);
|
||||
|
||||
$this->load->view('templates/FHC-Header', $includesArray);
|
||||
?>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<!-- Navigation component -->
|
||||
<core-navigation-cmpt></core-navigation-cmpt>
|
||||
|
||||
<div id="content"></div>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer', $includesArray); ?>
|
||||
|
||||
@@ -132,11 +132,7 @@
|
||||
if ($cis === true) generateCSSsInclude(defined('CIS4') ? 'public/css/cis4.css' : 'public/css/cis_bs5.css');
|
||||
|
||||
//Tags
|
||||
if ($tags === true)
|
||||
{
|
||||
generateCSSsInclude('public/css/tags.css');
|
||||
generateCSSsIncludeIfExtensionCssExists('tags.css');
|
||||
}
|
||||
if ($tags === true) generateCSSsInclude('public/css/tags.css');
|
||||
|
||||
$extapphelper = ExtendableAppsHelper::getInstance();
|
||||
$extapphelper->init($customCSSs, $customJSs, $customJSModules);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
@import './SvgIcons.css';
|
||||
@import './components/searchbar/searchbar.css';
|
||||
@import './components/verticalsplit.css';
|
||||
@import './components/horizontalsplit.css';
|
||||
@import './components/FilterComponent.css';
|
||||
@import './components/Tabs.css';
|
||||
@import './components/Notiz.css';
|
||||
@@ -96,13 +95,6 @@ html.fs_huge {
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
/* to enable scrolling for many student entries*/
|
||||
.stv-details-abschlusspruefung-student-names {
|
||||
max-height: 80px;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.p-dropdown-item{
|
||||
z-index: 1201 !important;
|
||||
}
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
:root {
|
||||
--fhc-horizontalsplit-hsplitter-bg-color: var(--fhc-background, #eee);
|
||||
--fhc-horizontalsplit-hsplitter-border-color: var(--fhc-border, #eee);
|
||||
--fhc-horizontalsplit-hsplitter-splitactions-color: var(--fhc-dark, #000);
|
||||
}
|
||||
|
||||
.horizontalsplit-container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
overflow: hidden;
|
||||
max-height: 100%;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.horizontalsplitted {
|
||||
overflow: auto;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.horizontalsplitter {
|
||||
flex-shrink: 0;
|
||||
width: 16px;
|
||||
cursor: col-resize;
|
||||
user-select: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.horizontalsplitter.left {
|
||||
border-left: solid 3px var(--fhc-horizontalsplit-hsplitter-border-color);
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.horizontalsplitter.right {
|
||||
border-right: solid 3px var(--fhc-horizontalsplit-hsplitter-border-color);
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.splitactions.horizontal {
|
||||
background-color: var(--fhc-horizontalsplit-hsplitter-bg-color);
|
||||
color: var(--fhc-horizontalsplit-hsplitter-splitactions-color);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 5px 0 5px 0;
|
||||
}
|
||||
|
||||
.splitactions.horizontal.left {
|
||||
border-radius: 0 40% 40% 0;
|
||||
}
|
||||
|
||||
.splitactions.horizontal.right {
|
||||
border-radius: 40% 0 0 40%;
|
||||
}
|
||||
|
||||
.splitactions.horizontal .splitaction {
|
||||
width: 14px;
|
||||
height: 28px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.splitactions.horizontal .splitaction.resize {
|
||||
cursor: col-resize;
|
||||
}
|
||||
|
||||
#content {
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
#content > div:first-child {
|
||||
margin-top: 30px;
|
||||
}
|
||||
+2
-26
@@ -46,6 +46,7 @@
|
||||
background-color: #ffA500ff;
|
||||
}
|
||||
|
||||
|
||||
.tag_braun {
|
||||
background-color: #6d4c41;
|
||||
}
|
||||
@@ -68,37 +69,12 @@
|
||||
|
||||
.tag_limette {
|
||||
background-color: #D3FFCE;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.tag_turquoise {
|
||||
background-color: #89cccf;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.tag_bordeaux {
|
||||
background-color: #7B1B38;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.tag_olive {
|
||||
background-color: #868d07;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.tag_beige {
|
||||
background-color: #E4D5B4;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.tag_done {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.tag_auto {
|
||||
border: 1px dashed white;
|
||||
}
|
||||
|
||||
.display_all {
|
||||
background-color: darkgrey !important;
|
||||
border: none;
|
||||
@@ -135,4 +111,4 @@
|
||||
.copy-btn {
|
||||
float: right;
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export default {
|
||||
addNew1MinLrt()
|
||||
{
|
||||
return {
|
||||
method: 'post',
|
||||
url: '/system/LRTTest/lrt1min'
|
||||
};
|
||||
},
|
||||
}
|
||||
@@ -34,10 +34,4 @@ export default {
|
||||
url: 'api/frontend/v1/detailheader/detailheader/getLeitungOrg/' + oekurzbz,
|
||||
};
|
||||
},
|
||||
getSemesterStati(prestudent_id){
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/detailheader/detailheader/getSemesterStati/' + prestudent_id,
|
||||
};
|
||||
},
|
||||
}
|
||||
@@ -51,20 +51,4 @@ export default {
|
||||
params: data
|
||||
};
|
||||
},
|
||||
|
||||
getAllTagsPrestudent(prestudent_id){
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/stv/Tags/getAllTags',
|
||||
params: prestudent_id
|
||||
};
|
||||
},
|
||||
|
||||
rebuildTagsforTypeId(data){
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/stv/Tags/rebuildTagsForTypeId/',
|
||||
params: data
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -35,6 +35,9 @@ export default {
|
||||
getMitarbeiter(searchString){
|
||||
return this.$fhcApi.get('api/frontend/v1/stv/abschlusspruefung/getMitarbeiter/' + searchString);
|
||||
},
|
||||
getPruefer(searchString){
|
||||
return this.$fhcApi.get('api/frontend/v1/stv/abschlusspruefung/getPruefer/' + searchString);
|
||||
},
|
||||
getNoten(){
|
||||
return this.$fhcApi.get('api/frontend/v1/stv/abschlusspruefung/getNoten/');
|
||||
},
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Copyright (C) 2022 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import PluginsPhrasen from '../plugins/Phrasen.js';
|
||||
import {CoreNavigationCmpt} from '../components/navigation/Navigation.js'
|
||||
|
||||
import ApiLrt from "../api/LRTTEst.js";
|
||||
|
||||
const lrtTestApp = Vue.createApp({
|
||||
data: function() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
components: {
|
||||
CoreNavigationCmpt,
|
||||
},
|
||||
methods: {
|
||||
addNew1MinLrt() {
|
||||
this.$api.call(ApiLrt.addNew1MinLrt())
|
||||
.then(result => {
|
||||
this.dropdowns.studiensemester_array = result.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<button type="button" class="btn btn-primary" @click="addNew1MinLrt()">Add a 1 min LRT</button>
|
||||
`
|
||||
});
|
||||
|
||||
FhcApps.makeExtendable(lrtTestApp);
|
||||
|
||||
lrtTestApp.use(PluginsPhrasen).mount('#main');
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
import ApiDetailHeader from "../../api/factory/detailHeader.js";
|
||||
import ApiHandleFoto from "../../api/factory/fotoHandling.js";
|
||||
import ModalUploadFoto from "./Modal/UploadFoto.js";
|
||||
import PvSkeleton from "../../../../index.ci.php/public/js/components/primevue/skeleton/skeleton.esm.min.js";
|
||||
import CoreTag from "../Tag/Tag.js";
|
||||
import ApiTag from "../../api/factory/stv/tag.js";
|
||||
import { idTagFormatter } from "../Tag/tagFormatter.js";
|
||||
|
||||
export default {
|
||||
name: 'DetailHeader',
|
||||
components: {
|
||||
ModalUploadFoto,
|
||||
PvSkeleton,
|
||||
CoreTag
|
||||
ModalUploadFoto
|
||||
},
|
||||
props: {
|
||||
headerData: {
|
||||
@@ -44,26 +38,8 @@ export default {
|
||||
'mitarbeiter',
|
||||
].includes(value)
|
||||
}
|
||||
},
|
||||
currentSemester: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
isLoading: { //if true, then parent isLoading
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
inject: {
|
||||
tagsEnabled: {
|
||||
from: 'configStvTagsEnabled',
|
||||
default: false
|
||||
},
|
||||
lists: {
|
||||
from: 'lists',
|
||||
required: true
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
appRoot() {
|
||||
return FHC_JS_DATA_STORAGE_OBJECT.app_root;
|
||||
@@ -85,30 +61,17 @@ export default {
|
||||
hasTileUIDSlot() {
|
||||
return !!this.$slots.uid
|
||||
},
|
||||
prestudentIds() {
|
||||
if (this.headerData[0].prestudent_id)
|
||||
{
|
||||
return [this.headerData[0].prestudent_id];
|
||||
}
|
||||
},
|
||||
semesterDates(){
|
||||
return this.lists.studiensemester?.find(item => item.studiensemester_kurzbz === this.currentSemester) || {};
|
||||
}
|
||||
|
||||
},
|
||||
created(){
|
||||
if (this.typeHeader === 'student') {
|
||||
if (!this.headerData) {
|
||||
throw new Error('[DetailHeader] "headerData" is required.')
|
||||
}
|
||||
|
||||
if(this.tagsEnabled) {
|
||||
this.loadTagsAndRender(this.headerData[0].prestudent_id);
|
||||
}
|
||||
|
||||
} else if (this.typeHeader === 'mitarbeiter') {
|
||||
if (!this.person_id || !this.mitarbeiter_uid || !this.domain) {
|
||||
throw new Error(
|
||||
'[DetailHeader] "person_id", "mitarbeiter_uid", and "domain" are required.'
|
||||
'[DetailHeader] "person_id", "mitarbeiter_uid", and "domain" are requried.'
|
||||
)
|
||||
}
|
||||
this.loadHeaderData(this.person_id, this.mitarbeiter_uid);
|
||||
@@ -123,34 +86,13 @@ export default {
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
headerData: {
|
||||
handler(newVal) {
|
||||
if (this.typeHeader === 'student' && newVal?.length) {
|
||||
this.getSemesterStati(newVal[0].prestudent_id);
|
||||
}
|
||||
|
||||
if(this.tagsEnabled) {
|
||||
this.loadTagsAndRender(this.headerData[0].prestudent_id);
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
},
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
headerDataMa: {},
|
||||
departmentData: {},
|
||||
leitungData: {},
|
||||
isFetchingIssues: false,
|
||||
noCurrentStatus: false,
|
||||
semesterStatiLoading: false,
|
||||
leitungOrgLoading: false,
|
||||
departmentDataLoading: false,
|
||||
headerDataMaLoading: false,
|
||||
tagEndpoint: ApiTag,
|
||||
tagData: null,
|
||||
rebuildData: null,
|
||||
isFetchingIssues: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -166,40 +108,29 @@ export default {
|
||||
});
|
||||
},
|
||||
getHeader(person_id) {
|
||||
this.headerDataMaLoading = true;
|
||||
return this.$api
|
||||
.call(ApiDetailHeader.getHeader(person_id))
|
||||
.then(result => {
|
||||
this.headerDataMa = result.data;
|
||||
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
this.headerDataMaLoading = false;
|
||||
});
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
loadDepartmentData(mitarbeiter_uid) {
|
||||
this.departmentDataLoading = true;
|
||||
return this.$api
|
||||
.call(ApiDetailHeader.getPersonAbteilung(mitarbeiter_uid))
|
||||
.then(result => {
|
||||
this.departmentData = result.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
this.departmentDataLoading = false;
|
||||
});
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
getLeitungOrg(oekurzbz){
|
||||
this.leitungOrgLoading = true;
|
||||
return this.$api
|
||||
.call(ApiDetailHeader.getLeitungOrg(oekurzbz))
|
||||
.then(result => {
|
||||
this.leitungData = result.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
this.leitungOrgLoading = false;
|
||||
});
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
async goToLeitung() {
|
||||
this.loadHeaderData(this.leitungData.person_id, this.leitungData.uid);
|
||||
@@ -248,88 +179,7 @@ export default {
|
||||
} else {
|
||||
return 'data:image/jpeg;base64,' + foto;
|
||||
}
|
||||
},
|
||||
getSemesterStati(prestudent_id){
|
||||
this.semesterStatiLoading = true;
|
||||
this.$api
|
||||
.call(ApiDetailHeader.getSemesterStati(prestudent_id))
|
||||
.then(result => {
|
||||
this.semesterStati = result.data;
|
||||
this.setNoCurrentStatus();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
this.semesterStatiLoading = false;
|
||||
});
|
||||
},
|
||||
setNoCurrentStatus() {
|
||||
if(!Array.isArray(this.semesterStati))
|
||||
{
|
||||
this.noCurrentStatus = false;
|
||||
}
|
||||
|
||||
if(!this.semesterStati.some(item => item.studiensemester_kurzbz === this.currentSemester)) {
|
||||
this.noCurrentStatus = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.noCurrentStatus = false;
|
||||
}
|
||||
},
|
||||
//methods tags
|
||||
async loadTagsAndRender(prestudent_id) {
|
||||
await this.getAllTags(prestudent_id);
|
||||
|
||||
const container = idTagFormatter(
|
||||
prestudent_id,
|
||||
this.tagData,
|
||||
this.$refs.tagComponent,
|
||||
'prestudent_id',
|
||||
this.semesterDates.start,
|
||||
this.semesterDates.ende
|
||||
);
|
||||
|
||||
if(this.headerData.length == 1) {
|
||||
this.$refs.tagWrapper.innerHTML = '';
|
||||
this.$refs.tagWrapper.appendChild(container);
|
||||
}
|
||||
},
|
||||
getAllTags(prestudent_id){
|
||||
return this.$api
|
||||
.call(ApiTag.getAllTagsPrestudent({prestudent_id}))
|
||||
.then(result => {
|
||||
this.tagData = result.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
addedTag(addedTag)
|
||||
{
|
||||
this.reload();
|
||||
},
|
||||
deletedTag(id)
|
||||
{
|
||||
this.reload();
|
||||
},
|
||||
updatedTag(updatedTag)
|
||||
{
|
||||
this.reload();
|
||||
},
|
||||
rebuildPrestudentTags(){
|
||||
const params = {
|
||||
id : this.headerData[0].prestudent_id,
|
||||
typeId: 'prestudent_id',
|
||||
sem: this.currentSemester
|
||||
};
|
||||
|
||||
return this.$api
|
||||
.call(ApiTag.rebuildTagsforTypeId(params))
|
||||
.then(result => {
|
||||
this.rebuildData = result.data;
|
||||
console.log("Rebuild manually triggered");
|
||||
this.reload();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div class="core-header d-flex justify-content-start align-items-center w-100 overflow-auto pb-2 gap-3" style="max-height:9rem; min-width: 37.5rem;">
|
||||
@@ -350,6 +200,7 @@ export default {
|
||||
</modal-upload-foto>
|
||||
|
||||
<template v-if="typeHeader==='student'">
|
||||
|
||||
<div
|
||||
v-for="person in headerData"
|
||||
:key="person.person_id"
|
||||
@@ -385,133 +236,62 @@ export default {
|
||||
<small class="text-muted">{{person.uid}}</small>
|
||||
</div>
|
||||
|
||||
<div v-if="headerData.length == 1">
|
||||
<div v-if="!isLoading" class="d-flex align-items-center gap-3">
|
||||
<h2 class="h4">
|
||||
{{headerData[0].titelpre}}
|
||||
{{headerData[0].vorname}}
|
||||
{{headerData[0].nachname}}
|
||||
<span v-if="headerData[0].titelpost">, </span>
|
||||
{{headerData[0].titelpost}}
|
||||
</h2>
|
||||
<core-tag ref="tagComponent"
|
||||
v-if="tagsEnabled"
|
||||
:endpoint="tagEndpoint"
|
||||
:values="prestudentIds"
|
||||
@added="addedTag"
|
||||
@deleted="deletedTag"
|
||||
@updated="updatedTag"
|
||||
zuordnung_typ="prestudent_id"
|
||||
></core-tag>
|
||||
<div
|
||||
role="button"
|
||||
v-if="tagsEnabled"
|
||||
@click="rebuildPrestudentTags"
|
||||
class="btn btn-outline btn-light mb-1"
|
||||
:title="'Automatische Tags fuer ' + currentSemester + ' neu laden'"
|
||||
>
|
||||
<i class="fa-solid fa-refresh pe-1"></i>
|
||||
<span>{{currentSemester}}</span>
|
||||
<div v-if="headerData.length == 1">
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<h2 class="h4">
|
||||
{{headerData[0].titelpre}}
|
||||
{{headerData[0].vorname}}
|
||||
{{headerData[0].nachname}}
|
||||
<span v-if="headerData[0].titelpost">, </span>
|
||||
{{headerData[0].titelpost}}
|
||||
</h2>
|
||||
<h6 v-if="headerData[0].unruly" class="badge" :class="'bg-unruly rounded-0'"><strong>unruly</strong></h6>
|
||||
</div>
|
||||
<h6 v-if="headerData[0].unruly" class="badge" :class="'bg-unruly rounded-0'"><strong>unruly</strong></h6>
|
||||
</div>
|
||||
<div v-else class="d-flex align-items-center gap-3">
|
||||
<pv-skeleton width="15rem" height="2rem" borderRadius="16px"></pv-skeleton>
|
||||
<h6 v-if="headerData[0].unruly" class="badge" :class="'bg-unruly rounded-0'"><strong>unruly</strong></h6>
|
||||
</div>
|
||||
|
||||
<h5 class="h6 d-flex align-items-center flex-wrap gap-1">
|
||||
<strong class="text-muted">{{$p.t('lehre', 'studiengang')}} </strong>
|
||||
<span v-if="!isLoading">
|
||||
{{headerData[0].stg_bezeichnung}} ({{headerData[0].studiengang}})
|
||||
</span>
|
||||
<span v-else>
|
||||
<pv-skeleton width="10rem"></pv-skeleton>
|
||||
</span>
|
||||
<template v-if="!semesterStatiLoading">
|
||||
<strong v-if="headerData[0].semester != null" class="text-muted"> | {{$p.t('lehre', 'semester')}} </strong>
|
||||
{{headerData[0].semester}}
|
||||
<strong v-if="headerData[0].gruppe !== null && headerData[0].verband != ' '" class="text-muted"> | {{$p.t('lehre', 'verband')}}</strong>
|
||||
{{headerData[0].verband}}
|
||||
<strong v-if="headerData[0].gruppe !== null && headerData[0].gruppe != ' '" class="text-muted"> | {{$p.t('lehre', 'gruppe')}} </strong>
|
||||
{{headerData[0].gruppe}}
|
||||
<strong v-if="headerData[0].status=='Interessent'
|
||||
|| headerData[0].status=='Aufgenommener'
|
||||
|| headerData[0].status=='Bewerber'
|
||||
|| headerData[0].status=='Wartender'"
|
||||
class="text-muted"> | Einstiegssemester {{headerData[0].semester_berechnet}}
|
||||
</strong>
|
||||
</template>
|
||||
<template v-else>
|
||||
<strong class="text-muted"> | {{$p.t('lehre', 'semester')}} </strong>
|
||||
<pv-skeleton size="1rem" class="mr-2"></pv-skeleton>
|
||||
<strong class="text-muted"> | {{$p.t('lehre', 'verband')}}</strong>
|
||||
<pv-skeleton size="1rem" class="mr-2"></pv-skeleton>
|
||||
<strong class="text-muted"> | {{$p.t('lehre', 'gruppe')}} </strong>
|
||||
<pv-skeleton size="1rem" class="mr-2"></pv-skeleton>
|
||||
</template>
|
||||
</h5>
|
||||
<h5 class="h6">
|
||||
<strong class="text-muted">{{$p.t('lehre', 'studiengang')}} </strong>
|
||||
{{headerData[0].stg_bezeichnung}} ({{headerData[0].studiengang}})
|
||||
<strong v-if="headerData[0].semester" class="text-muted"> | {{$p.t('lehre', 'semester')}} </strong>
|
||||
{{headerData[0].semester}}
|
||||
<strong v-if="headerData[0].verband" class="text-muted"> | {{$p.t('lehre', 'verband')}}</strong>
|
||||
{{headerData[0].verband}}
|
||||
<strong v-if="headerData[0].gruppe" class="text-muted"> | {{$p.t('lehre', 'gruppe')}} </strong>
|
||||
{{headerData[0].gruppe}}
|
||||
</h5>
|
||||
|
||||
<h5 class="h6 d-flex align-items-center flex-wrap gap-1">
|
||||
<strong class="text-muted">Email </strong>
|
||||
<span v-if="!isLoading">
|
||||
<a :href="'mailto:'+headerData[0]?.mail_intern">{{headerData[0].mail_intern}}</a>
|
||||
</span>
|
||||
<span v-else>
|
||||
<pv-skeleton width="10rem"></pv-skeleton>
|
||||
</span>
|
||||
<strong class="text-muted"> | {{$p.t('ui', 'private')}} </strong>
|
||||
<span v-if="!isLoading">
|
||||
<a :href="'mailto:'+headerData[0]?.mail_privat">{{headerData[0].mail_privat}}</a>
|
||||
</span>
|
||||
<span v-else>
|
||||
<pv-skeleton width="10rem"></pv-skeleton>
|
||||
</span>
|
||||
<strong class="text-muted"> | Status </strong>
|
||||
<span v-if="noCurrentStatus">
|
||||
<strong class="text-danger">{{$p.t('lehre', 'textNoStatusInSem', { sem: currentSemester}) }}</strong>
|
||||
</span>
|
||||
<span v-else>
|
||||
{{headerData[0].statusofsemester}}
|
||||
</span>
|
||||
</h5>
|
||||
<div ref="tagWrapper"></div>
|
||||
</div>
|
||||
<div v-if="headerData.length == 1" class="col-md-1 d-flex flex-column align-items-end justify-content-start ms-auto">
|
||||
<div class="d-flex py-1">
|
||||
<div class="px-2" style="min-width: 100px;">
|
||||
<slot name="issues"></slot>
|
||||
</div>
|
||||
<div v-if="hasTileGammaSlot" class="px-2" style="border-left: 1px solid #EEE">
|
||||
<h4 class="mb-1 text-center"><slot name="titleGammaTile"></slot></h4>
|
||||
<h6 class="text-muted d-flex align-items-center justify-content-center flex-wrap gap-1">
|
||||
<pv-skeleton v-if="isLoading" width="4rem"></pv-skeleton>
|
||||
<slot v-else name="valueGammaTile"></slot>
|
||||
</h6>
|
||||
</div>
|
||||
<div v-if="hasTileBetaSlot" class="px-2" style="border-left: 1px solid #EEE">
|
||||
<h4 class="mb-1 text-center"><slot name="titleBetaTile"></slot></h4>
|
||||
<h6 class="text-muted d-flex align-items-center justify-content-center flex-wrap gap-1">
|
||||
<pv-skeleton v-if="isLoading" width="4rem"></pv-skeleton>
|
||||
<slot v-else name="valueBetaTile"></slot>
|
||||
</h6>
|
||||
</div>
|
||||
<div v-if="hasTileAlphaSlot" class="px-2" style="border-left: 1px solid #EEE">
|
||||
<h4 class="mb-1 text-center"><slot name="titleAlphaTile"></slot></h4>
|
||||
<h6 class="text-muted d-flex align-items-center justify-content-center flex-wrap gap-1">
|
||||
<pv-skeleton v-if="isLoading" width="4rem"></pv-skeleton>
|
||||
<slot v-else name="valueAlphaTile"></slot>
|
||||
</h6>
|
||||
</div>
|
||||
<div v-if="hasTileUIDSlot" class="px-2" style="border-left: 1px solid #EEE">
|
||||
<h4 class="mb-1 text-center">UID</h4>
|
||||
<h6 class="text-muted d-flex align-items-center justify-content-center flex-wrap gap-1">
|
||||
<pv-skeleton v-if="isLoading" width="4rem"></pv-skeleton>
|
||||
<slot v-else name="uid"></slot>
|
||||
</h6>
|
||||
<h5 class="h6">
|
||||
<strong class="text-muted">Email </strong>
|
||||
<span>
|
||||
<a :href="'mailto:'+headerData[0]?.mail_intern">{{headerData[0].mail_intern}}</a>
|
||||
</span>
|
||||
<strong v-if="headerData[0].statusofsemester" class="text-muted"> | Status </strong>
|
||||
{{headerData[0].statusofsemester}}
|
||||
</h5>
|
||||
|
||||
</div>
|
||||
<div v-if="headerData.length == 1" class="col-md-1 d-flex flex-column align-items-end justify-content-start ms-auto">
|
||||
<div class="d-flex py-1">
|
||||
<div class="px-2" style="min-width: 100px;">
|
||||
<slot name="issues"></slot>
|
||||
</div>
|
||||
<div v-if="hasTileGammaSlot" class="px-2" style="border-left: 1px solid #EEE">
|
||||
<h4 class="mb-1 text-center"><slot name="titleGammaTile"></slot></h4>
|
||||
<h6 class="text-muted text-center"><slot name="valueGammaTile"></slot></h6>
|
||||
</div>
|
||||
<div v-if="hasTileBetaSlot" class="px-2" style="border-left: 1px solid #EEE">
|
||||
<h4 class="mb-1 text-center"><slot name="titleBetaTile"></slot></h4>
|
||||
<h6 class="text-muted text-center"><slot name="valueBetaTile"></slot></h6>
|
||||
</div>
|
||||
<div v-if="hasTileAlphaSlot" class="px-2" style="border-left: 1px solid #EEE">
|
||||
<h4 class="mb-1 text-center"><slot name="titleAlphaTile"></slot></h4>
|
||||
<h6 class="text-muted text-center"><slot name="valueAlphaTile"></slot></h6>
|
||||
</div>
|
||||
<div v-if="hasTileUIDSlot" class="px-2" style="border-left: 1px solid #EEE">
|
||||
<h4 class="mb-1 text-center">UID</h4>
|
||||
<h6 class="text-muted text-center"><slot name="uid"></slot></h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
@@ -550,51 +330,27 @@ export default {
|
||||
|
||||
<!--show Ma-Details-->
|
||||
<div class="col-md-9 text-nowrap mt-2">
|
||||
<h4 v-if="!headerDataMaLoading">{{headerDataMa.titelpre}} {{headerDataMa.vorname}} {{headerDataMa.nachname}}<span v-if="headerDataMa?.titelpost">, </span> {{headerDataMa.titelpost}}</h4>
|
||||
<h4 v-else><pv-skeleton width="15rem" height="2rem" borderRadius="16px"></pv-skeleton></h4>
|
||||
<div class="d-flex align-items-center flex-wrap gap-1">
|
||||
<strong class="text-muted">{{departmentData.organisationseinheittyp_kurzbz}}</strong>
|
||||
<span v-if="!departmentDataLoading">
|
||||
{{departmentData.bezeichnung}}
|
||||
</span>
|
||||
<span v-else>
|
||||
<pv-skeleton width="12rem"></pv-skeleton>
|
||||
</span>
|
||||
<span v-if="leitungData.uid"> | </span>
|
||||
<strong v-if="leitungData.uid" class="text-muted">Vorgesetzte*r </strong>
|
||||
<span v-if="!leitungOrgLoading">
|
||||
<a href="#" @click.prevent="goToLeitung">
|
||||
{{leitungData.titelpre}} {{leitungData.vorname}} {{leitungData.nachname}}
|
||||
<h4>{{headerDataMa.titelpre}} {{headerDataMa.vorname}} {{headerDataMa.nachname}}<span v-if="headerDataMa?.titelpost">, </span> {{headerDataMa.titelpost}}</h4>
|
||||
<strong class="text-muted">{{departmentData.organisationseinheittyp_kurzbz}}</strong>
|
||||
{{departmentData.bezeichnung}}
|
||||
<span v-if="leitungData.uid"> | </span>
|
||||
<strong v-if="leitungData.uid" class="text-muted">Vorgesetzte*r </strong>
|
||||
<a href="#" @click.prevent="goToLeitung">
|
||||
{{leitungData.titelpre}} {{leitungData.vorname}} {{leitungData.nachname}}
|
||||
</a>
|
||||
<p>
|
||||
<strong class="text-muted">Email </strong>
|
||||
<span v-if="headerDataMa && (headerDataMa.alias === undefined || headerDataMa.alias === null || headerDataMa.alias === '')">
|
||||
<a :href="'mailto:' + mitarbeiter_uid + '@' + domain">
|
||||
{{ mitarbeiter_uid }}@{{ domain }}
|
||||
</a>
|
||||
</span>
|
||||
<span v-else>
|
||||
<pv-skeleton width="5rem"></pv-skeleton>
|
||||
<a :href="'mailto:'+headerDataMa?.alias+'@'+domain">{{headerDataMa.alias}}@{{domain}}</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center gap-2 flex-nowrap">
|
||||
<div class="d-flex align-items-center gap-1">
|
||||
<strong class="text-muted">Email</strong>
|
||||
<template v-if="!headerDataMaLoading">
|
||||
<a :href="'mailto:' + (headerDataMa?.alias || mitarbeiter_uid) + '@' + domain">
|
||||
{{ (headerDataMa?.alias || mitarbeiter_uid) + '@' + domain }}
|
||||
</a>
|
||||
</template>
|
||||
<pv-skeleton v-else width="10rem"></pv-skeleton>
|
||||
</div>
|
||||
|
||||
<div v-if="headerDataMa?.telefonklappe" class="d-flex align-items-center gap-1">
|
||||
<span>|</span>
|
||||
<strong class="text-muted">DW</strong>
|
||||
<template v-if="!headerDataMaLoading">
|
||||
{{ headerDataMa.telefonklappe }}
|
||||
</template>
|
||||
<pv-skeleton v-else width="4rem"></pv-skeleton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span v-if="headerDataMa?.telefonklappe" class="mb-2"> | <strong class="text-muted">DW </strong>{{headerDataMa?.telefonklappe}}</span>
|
||||
</p>
|
||||
<slot name="tag"></slot>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 d-flex flex-column align-items-end justify-content-start ms-auto">
|
||||
@@ -604,33 +360,20 @@ export default {
|
||||
</div>
|
||||
<div v-if="hasTileGammaSlot" class="px-2" style="border-left: 1px solid #EEE">
|
||||
<h4 class="mb-1 text-center"><slot name="titleGammaTile"></slot></h4>
|
||||
<h6 class="text-muted d-flex align-items-center justify-content-center flex-wrap gap-1">
|
||||
<pv-skeleton v-if="isLoading" width="4rem"></pv-skeleton>
|
||||
<slot v-else name="valueGammaTile"></slot>
|
||||
</h6>
|
||||
<h6 class="text-muted text-center"><slot name="valueGammaTile"></slot></h6>
|
||||
</div>
|
||||
<div v-if="hasTileBetaSlot" class="px-2" style="border-left: 1px solid #EEE">
|
||||
<h4 class="mb-1 text-center"><slot name="titleBetaTile"></slot></h4>
|
||||
<h6 class="text-muted d-flex align-items-center justify-content-center flex-wrap gap-1">
|
||||
<pv-skeleton v-if="isLoading" width="4rem"></pv-skeleton>
|
||||
<slot v-else name="valueBetaTile"></slot>
|
||||
</h6>
|
||||
<h6 class="text-muted text-center"><slot name="valueBetaTile" :valueBetaTile="valueBetaTile"></slot></h6>
|
||||
</div>
|
||||
<div v-if="hasTileAlphaSlot" class="px-2" style="border-left: 1px solid #EEE">
|
||||
<h4 class="mb-1 text-center"><slot name="titleAlphaTile"></slot></h4>
|
||||
<h6 class="text-muted d-flex align-items-center justify-content-center flex-wrap gap-1">
|
||||
<pv-skeleton v-if="isLoading" width="4rem"></pv-skeleton>
|
||||
<slot v-else name="valueAlphaTile"></slot>
|
||||
</h6>
|
||||
<h6 class="text-muted text-center"><slot name="valueAlphaTile"></slot></h6>
|
||||
</div>
|
||||
<div v-if="hasTileUIDSlot" class="px-2" style="border-left: 1px solid #EEE">
|
||||
<h4 class="mb-1 text-center">UID</h4>
|
||||
<h6 class="text-muted d-flex align-items-center justify-content-center flex-wrap gap-1">
|
||||
<pv-skeleton v-if="isLoading" width="4rem"></pv-skeleton>
|
||||
<slot v-else name="uid"></slot>
|
||||
</h6>
|
||||
<h6 class="text-muted text-center"><slot name="uid"></slot></h6>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -29,8 +29,7 @@ export default {
|
||||
label: String,
|
||||
// NOTE(chris): remove these from $attrs array to prevent doubled event listeners
|
||||
onInput: [Array, Function],
|
||||
'onUpdate:modelValue': [Array, Function],
|
||||
titleActionButton: String
|
||||
'onUpdate:modelValue': [Array, Function]
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -318,7 +317,6 @@ export default {
|
||||
:id="idCmp"
|
||||
:name="name"
|
||||
:class="validationClass"
|
||||
:titleActionButton="titleActionButton"
|
||||
@update:model-value="clearValidationForThisName"
|
||||
>
|
||||
<slot></slot>
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
export default {
|
||||
emits: [
|
||||
'update:modelValue',
|
||||
'actionbutton-clicked'
|
||||
'update:modelValue'
|
||||
],
|
||||
props: {
|
||||
modelValue: String,
|
||||
titleActionButton: {
|
||||
type: String,
|
||||
default: ""
|
||||
}
|
||||
modelValue: String
|
||||
},
|
||||
computed: {
|
||||
valueAsBase64DataString() {
|
||||
@@ -33,9 +28,6 @@ export default {
|
||||
},
|
||||
deleteImage() {
|
||||
this.$emit('update:modelValue', '');
|
||||
},
|
||||
emitAction(){
|
||||
this.$emit('actionbutton-clicked', this.modelValue);
|
||||
}
|
||||
},
|
||||
template: `
|
||||
@@ -50,7 +42,6 @@ export default {
|
||||
<button type="button" class="btn btn-outline-dark btn-sm" @click="openUploadDialog">
|
||||
<i class="fa fa-pen"></i>
|
||||
</button>
|
||||
<button v-if="titleActionButton" class="btn btn-outline-dark btn-sm" @click="emitAction">{{titleActionButton}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import CoreSearchbar from "../searchbar/searchbar.js";
|
||||
import NavLanguage from "../navigation/Language.js";
|
||||
import VerticalSplit from "../verticalsplit/verticalsplit.js";
|
||||
import HorizontalSplit from "../horizontalsplit/horizontalsplit.js";
|
||||
import AppMenu from "../AppMenu.js";
|
||||
import AppConfig from "../AppConfig.js";
|
||||
import StvVerband from "./Studentenverwaltung/Verband.js";
|
||||
@@ -38,7 +37,6 @@ export default {
|
||||
CoreSearchbar,
|
||||
NavLanguage,
|
||||
VerticalSplit,
|
||||
HorizontalSplit,
|
||||
AppMenu,
|
||||
AppConfig,
|
||||
StvVerband,
|
||||
@@ -194,44 +192,7 @@ export default {
|
||||
}
|
||||
|
||||
return extraItems;
|
||||
},
|
||||
appMenuLvPlanungItems() {
|
||||
const extraItems = [];
|
||||
|
||||
if (this.studiengangKz !== undefined && this.selected_semester !== undefined) {
|
||||
const studiengang_kz = String(this.studiengangKz);
|
||||
const semester = String(this.selected_semester);
|
||||
const orgform = this.selected_orgform || '';
|
||||
|
||||
extraItems.push({
|
||||
link: FHC_JS_DATA_STORAGE_OBJECT.app_root
|
||||
+ 'content/statistik/lvplanung.xls.php?'
|
||||
+ '&studiengang_kz=' + studiengang_kz
|
||||
+ '&semester=' + semester
|
||||
+ '&studiensemester_kurzbz=' + this.studiensemesterKurzbz
|
||||
+ '&orgform_kurzbz=' + orgform,
|
||||
description: 'stv/lvplanung_xls'
|
||||
});
|
||||
extraItems.push({
|
||||
link: FHC_JS_DATA_STORAGE_OBJECT.app_root
|
||||
+ 'content/statistik/lvplanung.php?'
|
||||
+ '&studiengang_kz=' + studiengang_kz
|
||||
+ '&semester=' + semester,
|
||||
description: 'stv/lvplanung_html'
|
||||
});
|
||||
}
|
||||
|
||||
return extraItems;
|
||||
},
|
||||
linkRt(){
|
||||
return FHC_JS_DATA_STORAGE_OBJECT.app_root + '/vilesci/stammdaten/reihungstestverwaltung.php'
|
||||
},
|
||||
selected_uid(){
|
||||
return this.selected?.[this.selected.length - 1]?.uid ?? null;
|
||||
},
|
||||
linkGradeList(){
|
||||
return FHC_JS_DATA_STORAGE_OBJECT.app_root + 'index.ci.php/person/gradelist/index/' + this.selected_uid
|
||||
},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'url_studiensemester_kurzbz': function (newVal, oldVal) {
|
||||
@@ -251,7 +212,6 @@ export default {
|
||||
'url_studiengang': function (newVal, oldVal) {
|
||||
if (newVal !== oldVal) {
|
||||
this.checkUrlStudiengang();
|
||||
this.$refs.stvList.clearSelection();
|
||||
}
|
||||
},
|
||||
'url_mode': function () {
|
||||
@@ -275,10 +235,6 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
sidebarCollapsed(newVal) {
|
||||
if(newVal) this.$refs.hSplit.collapseLeft()
|
||||
else this.$refs.hSplit.showBoth()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -475,9 +431,6 @@ export default {
|
||||
},
|
||||
deleteCustomFilter(){
|
||||
this.$refs.stvList.resetFilter();
|
||||
},
|
||||
showAlertNoSelectedStudent(){
|
||||
this.$fhcAlert.alertError(this.$p.t('ui', 'alert_chooseStudent'));
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -676,69 +629,26 @@ export default {
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropend">
|
||||
<a
|
||||
class="dropdown-toggle"
|
||||
href="#"
|
||||
role="button"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
:class="{ disabled: !appMenuExtraItems.length }"
|
||||
data-bs-popper-config='{"strategy":"fixed"}'
|
||||
>
|
||||
{{ $p.t('stv/lvplanung') }}
|
||||
</a>
|
||||
<ul class="dropdown-menu p-0">
|
||||
<li
|
||||
v-for="(item, key) in appMenuLvPlanungItems"
|
||||
:key="key"
|
||||
>
|
||||
<a class="dropdown-item" :href="item.link" target="_blank">
|
||||
{{ $p.t(item.description) }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a :href="linkRt" target="_blank">
|
||||
{{ $p.t('stv/RTVerwaltung') }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a v-if="selected_uid" :href="linkGradeList" target="_blank">
|
||||
{{ $p.t('stv/studienverlauf') }}
|
||||
</a>
|
||||
<a v-else href="#" @click.prevent="showAlertNoSelectedStudent">
|
||||
{{ $p.t('stv/studienverlauf') }}
|
||||
</a>
|
||||
</li>
|
||||
</app-menu>
|
||||
</div>
|
||||
</aside>
|
||||
<horizontal-split ref="hSplit" :defaultRatio="[15, 85]">
|
||||
<template #left>
|
||||
<nav id="sidebarMenu" class="bg-light offcanvas offcanvas-start col-md p-md-0 h-100 w-100">
|
||||
<div class="offcanvas-header justify-content-end px-1 d-md-none">
|
||||
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" :aria-label="$p.t('ui/schliessen')"></button>
|
||||
</div>
|
||||
<stv-verband :preselectedKey="studiengangKz ? '' + studiengangKz : null" :endpoint="verbandEndpoint" @select-verband="onSelectVerband" class="col" style="height:0%"></stv-verband>
|
||||
<stv-studiensemester v-model:studiensemester-kurzbz="studiensemesterKurzbz" @update:studiensemester-kurzbz="studiensemesterChanged"></stv-studiensemester>
|
||||
</nav>
|
||||
</template>
|
||||
<template #right>
|
||||
<main>
|
||||
<vertical-split :defaultRatio="[50, 50]">
|
||||
<template #top>
|
||||
<stv-list ref="stvList" v-model:selected="selected" :studiengang-kz="studiengangKz" :studiensemester-kurzbz="studiensemesterKurzbz" @filterActive="handleCustomFilter"></stv-list>
|
||||
</template>
|
||||
<template #bottom>
|
||||
<stv-details ref="details" :students="selected" @reload="reloadList"></stv-details>
|
||||
</template>
|
||||
</vertical-split>
|
||||
</main>
|
||||
</template>
|
||||
</horizontal-split>
|
||||
|
||||
<nav id="sidebarMenu" class="bg-light offcanvas offcanvas-start col-md p-md-0 h-100">
|
||||
<div class="offcanvas-header justify-content-end px-1 d-md-none">
|
||||
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" :aria-label="$p.t('ui/schliessen')"></button>
|
||||
</div>
|
||||
<stv-verband :preselectedKey="studiengangKz ? '' + studiengangKz : null" :endpoint="verbandEndpoint" @select-verband="onSelectVerband" class="col" style="height:0%"></stv-verband>
|
||||
<stv-studiensemester v-model:studiensemester-kurzbz="studiensemesterKurzbz" @update:studiensemester-kurzbz="studiensemesterChanged"></stv-studiensemester>
|
||||
</nav>
|
||||
<main class="col-md-8 ms-sm-auto col-lg-9 col-xl-10">
|
||||
<vertical-split>
|
||||
<template #top>
|
||||
<stv-list ref="stvList" v-model:selected="selected" :studiengang-kz="studiengangKz" :studiensemester-kurzbz="studiensemesterKurzbz" @filterActive="handleCustomFilter"></stv-list>
|
||||
</template>
|
||||
<template #bottom>
|
||||
<stv-details ref="details" :students="selected" @reload="reloadList"></stv-details>
|
||||
</template>
|
||||
</vertical-split>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
<app-config ref="config" v-model="appconfig" :endpoints="configEndpoints"></app-config>
|
||||
|
||||
@@ -2,18 +2,12 @@ import FhcTabs from "../../Tabs.js";
|
||||
import FhcHeader from "../../DetailHeader/DetailHeader.js";
|
||||
|
||||
import ApiStvApp from '../../../api/factory/stv/app.js';
|
||||
import ApiStudent from '../../../api/factory/stv/students.js';
|
||||
|
||||
// TODO(chris): alt & title
|
||||
// TODO(chris): phrasen
|
||||
|
||||
export default {
|
||||
name: "DetailsPrestudent",
|
||||
inject: {
|
||||
currentSemester: {
|
||||
from: 'currentSemester',
|
||||
},
|
||||
},
|
||||
components: {
|
||||
FhcTabs,
|
||||
FhcHeader
|
||||
@@ -21,9 +15,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
configStudent: {},
|
||||
configStudents: {},
|
||||
activeTab: null,
|
||||
localStudent: null
|
||||
configStudents: {}
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -48,9 +40,6 @@ export default {
|
||||
}
|
||||
return Object.fromEntries(Object.entries(this.configStudents).filter(([ , value ]) => !value.showOnlyWithUid && !value.showOnlyWithUid));
|
||||
},
|
||||
isLoading() {
|
||||
return this.students === null; //null-> loading, [] -> empty, [...] -> data, necessary for skeleton in child
|
||||
},
|
||||
tile_PersId(){
|
||||
let tile = this.students[0].person_id != null ? this.students[0].person_id : '-';
|
||||
return tile;
|
||||
@@ -68,21 +57,6 @@ export default {
|
||||
'$p.user_language.value'(n, o) {
|
||||
if (n !== o && o !== undefined)
|
||||
this.loadConfig();
|
||||
},
|
||||
currentSemester(newVal) {
|
||||
if (
|
||||
Array.isArray(this.students) &&
|
||||
this.students.length === 1 &&
|
||||
newVal !== this.students[0].query_studiensemester_kurzbz
|
||||
) {
|
||||
this.reloadDataStudent();
|
||||
}
|
||||
else {
|
||||
this.localStudent = null;
|
||||
}
|
||||
},
|
||||
students() {
|
||||
this.localStudent = null;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -100,28 +74,10 @@ export default {
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
handleTabChanged(key) {
|
||||
this.activeTab = key
|
||||
this.reload()
|
||||
},
|
||||
reload() {
|
||||
if (this.$refs.tabs?.$refs?.current?.reload)
|
||||
this.$refs.tabs.$refs.current.reload();
|
||||
},
|
||||
reloadDataStudent(){
|
||||
this.localStudent = null;
|
||||
const studentArr = this.students;
|
||||
|
||||
if (!studentArr || !studentArr.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.$api
|
||||
.call(ApiStudent.uid(studentArr[0].uid, this.currentSemester))
|
||||
.then(result => {
|
||||
this.localStudent = result.data;
|
||||
});
|
||||
},
|
||||
reloadList() {
|
||||
this.$emit('reload');
|
||||
},
|
||||
@@ -136,12 +92,10 @@ export default {
|
||||
</div>
|
||||
<div v-else-if="configStudent && configStudents" class="d-flex flex-column h-100">
|
||||
<fhc-header
|
||||
:headerData="localStudent || students"
|
||||
:currentSemester="currentSemester"
|
||||
:headerData="students"
|
||||
typeHeader="student"
|
||||
@reload="reloadList"
|
||||
fotoEditable
|
||||
:isLoading="isLoading"
|
||||
>
|
||||
<template #uid>{{students[0].uid}}</template>
|
||||
<template #titleAlphaTile>PersID</template>
|
||||
@@ -153,16 +107,16 @@ export default {
|
||||
</fhc-header>
|
||||
<fhc-tabs
|
||||
v-if="students.length == 1"
|
||||
ref="tabs"
|
||||
ref="tabs"
|
||||
:useprimevue="true"
|
||||
:modelValue="(Array.isArray(localStudent) && localStudent[0]) || students[0]"
|
||||
:modelValue="students[0]"
|
||||
:config="config"
|
||||
:default="activeTab ?? $route.params.tab"
|
||||
:default="$route.params.tab"
|
||||
style="flex: 1 1 0%; height: 0%"
|
||||
@changed="handleTabChanged"
|
||||
@changed="reload"
|
||||
>
|
||||
</fhc-tabs>
|
||||
<fhc-tabs v-else ref="tabs" :useprimevue="true" :modelValue="students" :config="config" :default="activeTab ?? $route.params.tab" style="flex: 1 1 0%; height: 0%" @changed="handleTabChanged"></fhc-tabs>
|
||||
<fhc-tabs v-else ref="tabs" :useprimevue="true" :modelValue="students" :config="config" :default="$route.params.tab" style="flex: 1 1 0%; height: 0%" @changed="reload"></fhc-tabs>
|
||||
</div>
|
||||
<div v-else>
|
||||
Loading...
|
||||
|
||||
+37
-185
@@ -78,7 +78,7 @@ export default {
|
||||
layout: 'fitDataStretchFrozen',
|
||||
layoutColumnsOnNewData: false,
|
||||
height: 'auto',
|
||||
minHeight: '200'
|
||||
minHeight: '200',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -238,16 +238,6 @@ export default {
|
||||
}
|
||||
return this.student.map(e => e.uid);
|
||||
},
|
||||
studentNames() {
|
||||
if (this.student.uid)
|
||||
{
|
||||
return [this.student.vorname + ' ' + this.student.nachname];
|
||||
}
|
||||
|
||||
const array = this.student.map(e => ' ' + e.vorname + ' ' + e.nachname + '(' + e.uid +')');
|
||||
|
||||
return array.toString();
|
||||
},
|
||||
studentKzs(){
|
||||
if (this.student.uid)
|
||||
{
|
||||
@@ -297,51 +287,10 @@ export default {
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
actionNewAbschlusspruefung() {
|
||||
this.setDefaultFormData();
|
||||
this.resetForm();
|
||||
this.statusNew = true;
|
||||
|
||||
//prepare local Storage
|
||||
let STORAGE_KEY = 'finalExamDefaultData';
|
||||
const id = '20260625_01';
|
||||
const stored = JSON.parse(localStorage.getItem(STORAGE_KEY)) || {};
|
||||
|
||||
if (stored[id]) {
|
||||
const data = stored[id];
|
||||
|
||||
this.formData.pruefungstyp_kurzbz = data.pruefungstyp_kurzbz;
|
||||
this.formData.datum = data.datum;
|
||||
this.formData.sponsion = data.sponsion;
|
||||
this.formData.akadgrad_id = data.akadgrad_id;
|
||||
this.formData.pruefungsantritt_kurzbz = data.pruefungsantritt_kurzbz;
|
||||
|
||||
if (data.vorsitz_uid) {
|
||||
this.selectedVorsitz = {
|
||||
mitarbeiter_uid: data.vorsitz_uid,
|
||||
person_id: data.vorsitz_person_id,
|
||||
label: data.vorsitz_label
|
||||
};
|
||||
}
|
||||
|
||||
if (data.pruefer1_person_id) {
|
||||
this.selectedPruefer1 = {
|
||||
person_id: data.pruefer1_person_id,
|
||||
label: data.pruefer1_label
|
||||
};
|
||||
}
|
||||
if (data.pruefer2_person_id) {
|
||||
this.selectedPruefer2 = {
|
||||
person_id: data.pruefer2_person_id,
|
||||
label: data.pruefer2_label
|
||||
};
|
||||
}
|
||||
if (data.pruefer3_person_id) {
|
||||
this.selectedPruefer3 = {
|
||||
person_id: data.pruefer3_person_id,
|
||||
label: data.pruefer3_label
|
||||
};
|
||||
}
|
||||
}
|
||||
this.$refs.finalexamModal.show();
|
||||
this.setDefaultFormData();
|
||||
},
|
||||
actionEditAbschlusspruefung(abschlusspruefung_id) {
|
||||
this.resetForm();
|
||||
@@ -356,23 +305,20 @@ export default {
|
||||
};
|
||||
if (data.p1_person_id) {
|
||||
this.selectedPruefer1 = {
|
||||
label: this.getPersonLabel(data.p1_titelpre, data.p1_nachname, data.p1_vorname, data.p1_titelpost, data.p1_uid),
|
||||
person_id: data.p1_person_id,
|
||||
mitarbeiter_uid: data.p1_uid
|
||||
label: this.getPersonLabel(data.p1_titelpre, data.p1_nachname, data.p1_vorname, data.p1_titelpost),
|
||||
person_id: data.p1_person_id
|
||||
};
|
||||
}
|
||||
if (data.p2_person_id) {
|
||||
this.selectedPruefer2 = {
|
||||
label: this.getPersonLabel(data.p2_titelpre, data.p2_nachname, data.p2_vorname, data.p2_titelpost, data.p2_uid),
|
||||
person_id: data.p2_person_id,
|
||||
mitarbeiter_uid: data.p2_uid
|
||||
label: this.getPersonLabel(data.p2_titelpre, data.p2_nachname, data.p2_vorname, data.p2_titelpost),
|
||||
person_id: data.p2_person_id
|
||||
}
|
||||
};
|
||||
if (data.p3_person_id) {
|
||||
this.selectedPruefer3= {
|
||||
label: this.getPersonLabel(data.p3_titelpre, data.p3_nachname, data.p3_vorname, data.p3_titelpost, data.p3_uid),
|
||||
person_id: data.p3_person_id,
|
||||
mitarbeiter_uid: data.p3_uid
|
||||
label: this.getPersonLabel(data.p3_titelpre, data.p3_nachname, data.p3_vorname, data.p3_titelpost),
|
||||
person_id: data.p3_person_id
|
||||
};
|
||||
}
|
||||
});
|
||||
@@ -391,30 +337,6 @@ export default {
|
||||
.then(this.deleteAbschlusspruefung)
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
saveOrUpdateLocalStorage(){
|
||||
let STORAGE_KEY = 'finalExamDefaultData';
|
||||
|
||||
const id = '20260625_01';
|
||||
const stored = JSON.parse(localStorage.getItem(STORAGE_KEY)) || {};
|
||||
|
||||
stored[id] = {
|
||||
pruefungstyp_kurzbz: this.formData.pruefungstyp_kurzbz,
|
||||
pruefungsantritt_kurzbz: this.formData.pruefungsantritt_kurzbz,
|
||||
vorsitz_uid: this.selectedVorsitz?.mitarbeiter_uid || null,
|
||||
vorsitz_person_id: this.selectedVorsitz?.person_id || null,
|
||||
vorsitz_label: this.selectedVorsitz?.label || null,
|
||||
pruefer1_person_id: this.selectedPruefer1?.person_id || null,
|
||||
pruefer1_label: this.selectedPruefer1?.label || null,
|
||||
pruefer2_person_id: this.selectedPruefer2?.person_id || null,
|
||||
pruefer2_label: this.selectedPruefer2?.label || null,
|
||||
pruefer3_person_id: this.selectedPruefer3?.person_id || null,
|
||||
pruefer3_label: this.selectedPruefer3?.label || null,
|
||||
akadgrad_id: this.formData.akadgrad_id,
|
||||
datum: this.formData.datum,
|
||||
sponsion: this.formData.sponsion
|
||||
};
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify(stored));
|
||||
},
|
||||
addNewAbschlusspruefung() {
|
||||
const dataToSend = {
|
||||
uid: this.student.uid,
|
||||
@@ -425,8 +347,6 @@ export default {
|
||||
.call(ApiStvAbschlusspruefung.addNewAbschlusspruefung(dataToSend))
|
||||
.then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
//save formData fields in LocalStorage
|
||||
this.saveOrUpdateLocalStorage();
|
||||
this.hideModal('finalexamModal');
|
||||
this.resetForm();
|
||||
})
|
||||
@@ -435,43 +355,6 @@ export default {
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
async addNewAbschlusspruefungMulti(){
|
||||
try {
|
||||
const arraySuccessfullySent = [];
|
||||
const arrayError = [];
|
||||
|
||||
for (const student of this.studentUids) {
|
||||
try {
|
||||
await this.$refs.formFinalExam.call(
|
||||
ApiStvAbschlusspruefung.addNewAbschlusspruefung({
|
||||
uid: student,
|
||||
formData: this.formData
|
||||
})
|
||||
);
|
||||
arraySuccessfullySent.push(student);
|
||||
} catch (error) {
|
||||
arrayError.push(student);
|
||||
}
|
||||
}
|
||||
if (arraySuccessfullySent.length) {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
//TODO(Manu) check if really needed in case of success
|
||||
//this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave') + ': Uids: ' + arraySuccessfullySent.join(", "));
|
||||
}
|
||||
|
||||
if (arrayError.length) {
|
||||
this.$fhcAlert.alertError(this.$p.t('ui', 'errorSavingData') + ': Uids: ' + arrayError.join(", "));
|
||||
}
|
||||
|
||||
if (arraySuccessfullySent.length) {
|
||||
this.saveOrUpdateLocalStorage();
|
||||
this.hideModal("finalexamModal");
|
||||
this.resetForm();
|
||||
}
|
||||
} catch (error) {
|
||||
this.$fhcAlert.handleSystemError(error);
|
||||
}
|
||||
},
|
||||
hideModal(modalRef){
|
||||
this.$refs[modalRef].hide();
|
||||
},
|
||||
@@ -493,9 +376,6 @@ export default {
|
||||
id: abschlusspruefung_id,
|
||||
formData: this.formData
|
||||
};
|
||||
//uncomment if also save data in local storage for update
|
||||
//this.saveOrUpdateLocalStorage();
|
||||
|
||||
return this.$refs.formFinalExam
|
||||
.call(ApiStvAbschlusspruefung.updateAbschlusspruefung(dataToSend))
|
||||
.then(response => {
|
||||
@@ -537,6 +417,7 @@ export default {
|
||||
this.selectedPruefer1 = null;
|
||||
this.selectedPruefer2 = null;
|
||||
this.selectedPruefer3 = null;
|
||||
|
||||
},
|
||||
setDefaultFormData() {
|
||||
|
||||
@@ -590,29 +471,29 @@ export default {
|
||||
searchPerson(event) {
|
||||
if (this.abortController.persons) {
|
||||
this.abortController.persons.abort();
|
||||
}
|
||||
}
|
||||
|
||||
this.abortController.persons = new AbortController();
|
||||
|
||||
return this.$api
|
||||
.call(ApiStvAbschlusspruefung.getPruefer(event.query))
|
||||
.then(result => {
|
||||
this.filteredPersons = [];
|
||||
for (let person of result.data.retval) {
|
||||
this.filteredPersons.push(
|
||||
{
|
||||
label: this.getPersonLabel(
|
||||
person.titelpre,
|
||||
person.nachname,
|
||||
person.vorname,
|
||||
person.titelpost,
|
||||
person.uid
|
||||
),
|
||||
person_id: person.person_id,
|
||||
mitarbeiter_uid: person.uid
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
this.filteredPersons = [];
|
||||
for (let person of result.data.retval) {
|
||||
this.filteredPersons.push(
|
||||
{
|
||||
label: this.getPersonLabel(
|
||||
person.titelpre,
|
||||
person.nachname,
|
||||
person.vorname,
|
||||
person.titelpost,
|
||||
person.person_uid
|
||||
),
|
||||
person_id: person.person_id
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
created() {
|
||||
@@ -645,7 +526,7 @@ export default {
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
this.$api
|
||||
.call(ApiStvAbschlusspruefung.getAkadGrade(this.stg_kz))
|
||||
.call(ApiStvAbschlusspruefung.getAkadGrade(this.student.studiengang_kz))
|
||||
.then(result => {
|
||||
this.arrAkadGrad = result.data;
|
||||
})
|
||||
@@ -666,8 +547,7 @@ export default {
|
||||
<div class="stv-details-abschlusspruefung h-100 pb-3">
|
||||
<h4>{{this.$p.t('stv','tab_finalexam')}}</h4>
|
||||
|
||||
<div v-if="this.student.length" class="d-flex gap-2">
|
||||
<button class="btn btn-primary" @click="actionNewAbschlusspruefung()"> + {{$p.t('stv', 'tab_finalexam')}}</button>
|
||||
<div v-if="this.student.length">
|
||||
<abschlusspruefung-dropdown
|
||||
:showAllFormats="showAllFormats"
|
||||
:studentUids="studentUids"
|
||||
@@ -699,19 +579,12 @@ export default {
|
||||
<template #title>
|
||||
<p v-if="statusNew" class="fw-bold mt-3">{{$p.t('abschlusspruefung', 'abschluessPruefungAnlegen')}}</p>
|
||||
<p v-else class="fw-bold mt-3">{{$p.t('abschlusspruefung', 'abschluessPruefungBearbeiten')}}</p>
|
||||
<div
|
||||
v-if="this.student.length"
|
||||
class="stv-details-abschlusspruefung-student-names"
|
||||
>
|
||||
<small class="text-muted">{{studentNames}}</small>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<form-form ref="formFinalExam" @submit.prevent>
|
||||
<form-form v-if="!this.student.length" ref="formFinalExam" @submit.prevent>
|
||||
|
||||
<legend>{{this.$p.t('global','details')}}</legend>
|
||||
<p v-if="statusNew">[{{$p.t('ui', 'neu')}}]</p>
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
container-class="col-6 stv-details-abschlusspruefung-typ"
|
||||
@@ -729,7 +602,6 @@ export default {
|
||||
</option>
|
||||
</form-input>
|
||||
<form-input
|
||||
v-if="!this.student.length"
|
||||
container-class="col-6 stv-details-abschlusspruefung-note"
|
||||
:label="$p.t('abschlusspruefung', 'notekommpruefung')"
|
||||
type="select"
|
||||
@@ -798,10 +670,9 @@ export default {
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
v-if="!this.student.length"
|
||||
container-class="col-6 stv-details-abschlusspruefung-abschlussbeurteilung_kurzbz"
|
||||
:label="$p.t('abschlusspruefung', 'abschlussbeurteilung')"
|
||||
type="select"
|
||||
@@ -827,23 +698,7 @@ export default {
|
||||
optionValue="person_id"
|
||||
dropdown
|
||||
forceSelection
|
||||
:suggestions="filteredPersons"
|
||||
@complete="searchPerson"
|
||||
:min-length="3"
|
||||
>
|
||||
</form-input>
|
||||
<form-input
|
||||
v-if="this.student.length"
|
||||
type="autocomplete"
|
||||
container-class="col-6 stv-details-abschlusspruefung-pruefer3"
|
||||
:label="$p.t('abschlusspruefung', 'pruefer3')"
|
||||
name="pruefer3"
|
||||
v-model="selectedPruefer3"
|
||||
optionLabel="label"
|
||||
optionValue="person_id"
|
||||
dropdown
|
||||
forceSelection
|
||||
:suggestions="filteredPersons"
|
||||
:suggestions="filteredPersons"
|
||||
@complete="searchPerson"
|
||||
:min-length="3"
|
||||
>
|
||||
@@ -867,7 +722,6 @@ export default {
|
||||
</option>
|
||||
</form-input>
|
||||
<form-input
|
||||
v-if="!this.student.length"
|
||||
type="autocomplete"
|
||||
container-class="col-6 stv-details-abschlusspruefung-pruefer3"
|
||||
:label="$p.t('abschlusspruefung', 'pruefer3')"
|
||||
@@ -877,7 +731,7 @@ export default {
|
||||
optionValue="person_id"
|
||||
dropdown
|
||||
forceSelection
|
||||
:suggestions="filteredPersons"
|
||||
:suggestions="filteredPersons"
|
||||
@complete="searchPerson"
|
||||
:min-length="3"
|
||||
>
|
||||
@@ -925,7 +779,6 @@ export default {
|
||||
>
|
||||
</form-input>
|
||||
<form-input
|
||||
v-if="!this.student.length"
|
||||
container-class="col-6 stv-details-abschlusspruefung-protokoll"
|
||||
:label="$p.t('abschlusspruefung', 'protokoll')"
|
||||
type="textarea"
|
||||
@@ -937,7 +790,7 @@ export default {
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div v-if="!this.student.length" class="row mb-3 col-6">
|
||||
<div class="row mb-3 col-6">
|
||||
<div class="col">
|
||||
<p >{{$p.t('abschlusspruefung', 'zurBeurteilung')}}</p>
|
||||
</div>
|
||||
@@ -954,9 +807,8 @@ export default {
|
||||
|
||||
<template #footer>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{$p.t('ui', 'abbrechen')}}</button>
|
||||
<button v-if="statusNew && !this.student.length" class="btn btn-primary" @click="addNewAbschlusspruefung()"> {{$p.t('ui', 'speichern')}}</button>
|
||||
<button v-else-if="statusNew && this.student.length" class="btn btn-primary" @click="addNewAbschlusspruefungMulti(studentUids)"> {{$p.t('ui', 'speichern')}}</button>
|
||||
<button v-else class="btn btn-primary" @click="updateAbschlusspruefung(formData.abschlusspruefung_id)"> {{$p.t('ui', 'speichern')}}</button>
|
||||
<button v-if="statusNew" class="btn btn-primary" @click="addNewAbschlusspruefung()"> {{$p.t('ui', 'speichern')}}</button>
|
||||
<button v-else class="btn btn-primary" @click="updateAbschlusspruefung(formData.abschlusspruefung_id)"> {{$p.t('ui', 'speichern')}}</button>
|
||||
</template>
|
||||
|
||||
</bs-modal>
|
||||
|
||||
@@ -158,16 +158,6 @@ export default {
|
||||
},
|
||||
reload(){
|
||||
this.updateStudent(this.modelValue);
|
||||
},
|
||||
sendInfomail(){
|
||||
const subject = this.$p.t('person', 'betreffProfilfoto');
|
||||
const subjectEncoded = encodeURIComponent(subject);
|
||||
|
||||
const body = this.$p.t('person', 'mailText_profilfoto');
|
||||
const bodyWithNewLines = body.replace(/\\n/g, '\n');
|
||||
const bodyEncoded = encodeURIComponent(bodyWithNewLines);
|
||||
|
||||
window.location.href = "mailto:" + this.modelValue.mail_intern + "?subject=" + subjectEncoded + "&body=" + bodyEncoded;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -396,10 +386,8 @@ export default {
|
||||
container-class="col stv-details-details-foto"
|
||||
:label="$p.t('person', 'foto')"
|
||||
type="UploadImage"
|
||||
titleActionButton="Infomail"
|
||||
v-model="data.foto"
|
||||
name="foto"
|
||||
@actionbutton-clicked="sendInfomail"
|
||||
>
|
||||
<img alt="No Image" :src="noImageSrc" class="w-100">
|
||||
</form-input>
|
||||
|
||||
@@ -93,7 +93,7 @@ export default {
|
||||
}
|
||||
},
|
||||
{title:"Geschlecht", field:"geschlecht", headerFilter: "list", headerFilterParams: {values:{'m':'männlich','w':'weiblich','x':'divers','u':'unbekannt'}, listOnEmpty:true, autocomplete:true}},
|
||||
{title: "Sem.", field:"semester_berechnet", headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title:"Sem.", field:"semester", headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title:"Verb.", field:"verband", headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title:"Grp.", field:"gruppe", headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title:"Studiengang", field:"studiengang", headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
@@ -171,7 +171,7 @@ export default {
|
||||
selectableRows: true,
|
||||
selectableRowsRangeMode: 'click',
|
||||
index: 'prestudent_id',
|
||||
persistenceID: 'stv-list-20260223_01'
|
||||
persistenceID: 'stv-list',
|
||||
},
|
||||
tabulatorEvents: [
|
||||
{
|
||||
@@ -195,15 +195,7 @@ export default {
|
||||
},
|
||||
{
|
||||
event: 'dataLoaded',
|
||||
handler: data => {
|
||||
if (Array.isArray(data)) {
|
||||
this.count = data.length;
|
||||
this.allPrestudents = data.map(item => item.prestudent_id);
|
||||
} else {
|
||||
this.count = 0;
|
||||
this.allPrestudents = [];
|
||||
}
|
||||
}
|
||||
handler: data => this.count = data.length
|
||||
},
|
||||
{
|
||||
event: 'dataFiltered',
|
||||
@@ -245,8 +237,7 @@ export default {
|
||||
dragSource: [],
|
||||
oldScrollUrl: '',
|
||||
oldScrollLeft: 0,
|
||||
oldScrollTop: 0,
|
||||
allPrestudents: []
|
||||
oldScrollTop: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -291,9 +282,8 @@ export default {
|
||||
options: {
|
||||
delimiter: ';',
|
||||
bom: true,
|
||||
},
|
||||
rowRange: this.selectedcount > 0 ? "selected" : "all",
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
fileString() {
|
||||
@@ -301,24 +291,8 @@ export default {
|
||||
.replace(/\//g, '_');
|
||||
return "StudentList_" + today + ".csv";
|
||||
},
|
||||
selectedPrestudents() {
|
||||
if (this.selected && this.selected.length > 0) {
|
||||
return this.selected.map(item => item.prestudent_id);
|
||||
} else {
|
||||
// fallback whole list of prestudents
|
||||
return this.allPrestudents || [];
|
||||
}
|
||||
},
|
||||
|
||||
linkXLS(){
|
||||
return FHC_JS_DATA_STORAGE_OBJECT.app_root
|
||||
+ 'content/statistik/studentenexportextended.xls.php?'
|
||||
+ '&studiensemester_kurzbz=' + this.currentSemester
|
||||
+ '&data=' + this.selectedPrestudents.join(";");
|
||||
},
|
||||
},
|
||||
created: function() {
|
||||
|
||||
if(this.tagsEnabled) {
|
||||
const coltags = {
|
||||
title: 'Tags',
|
||||
@@ -338,7 +312,7 @@ export default {
|
||||
if (n !== o && o !== undefined && this.$refs.table.tableBuilt) {
|
||||
this.translateTabulator();
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
translateTabulator() {
|
||||
@@ -356,7 +330,7 @@ export default {
|
||||
ersatzkennzeichen: capitalize(this.$p.t('person/ersatzkennzeichen')),
|
||||
gebdatum: capitalize(this.$p.t('person/geburtsdatum')),
|
||||
geschlecht: capitalize(this.$p.t('person/geschlecht')),
|
||||
semester_berechnet: capitalize(this.$p.t('lehre/sem')),
|
||||
semester: capitalize(this.$p.t('lehre/sem')),
|
||||
verband: capitalize(this.$p.t('lehre/verb')),
|
||||
gruppe: capitalize(this.$p.t('lehre/grp')),
|
||||
studiengang: capitalize(this.$p.t('lehre/studiengang')),
|
||||
@@ -417,27 +391,15 @@ export default {
|
||||
actionNewPrestudent() {
|
||||
this.$refs.new.open();
|
||||
},
|
||||
rowSelectionChanged(data, rows, selected, deselected) {
|
||||
rowSelectionChanged(data, rows) {
|
||||
this.selectedcount = data.length;
|
||||
this.lastSelected = this.selected;
|
||||
|
||||
//in case of empty selection (eg. in future or past semester of selected student without sem)
|
||||
if(selected.length == 0 ) {
|
||||
this.lastSelected = this.selected;
|
||||
}
|
||||
//for tags
|
||||
this.selectedRows = this.$refs.table.tabulator.getSelectedRows();
|
||||
this.selectedColumnValues = this.selectedRows.filter(row => row.getData().prestudent_id !== undefined && row.getData().prestudent_id).map(row => row.getData().prestudent_id);
|
||||
|
||||
if(selected.length > 0 || deselected.length > 0){
|
||||
|
||||
//for tags
|
||||
this.selectedRows = this.$refs.table.tabulator.getSelectedRows();
|
||||
this.selectedColumnValues = this.selectedRows.filter(
|
||||
row => row.getData().prestudent_id !== undefined
|
||||
&& row.getData().prestudent_id
|
||||
).map(
|
||||
row => row.getData().prestudent_id
|
||||
);
|
||||
|
||||
this.$emit('update:selected', data);
|
||||
}
|
||||
this.$emit('update:selected', data);
|
||||
},
|
||||
autoSelectRows(data) {
|
||||
if (Array.isArray(this.lastSelected) && this.lastSelected.length){
|
||||
@@ -514,14 +476,6 @@ export default {
|
||||
this.$reloadList();
|
||||
},
|
||||
onKeydown(e) { // TODO(chris): this should be in the filter component
|
||||
|
||||
if ((e.ctrlKey || e.metaKey) && e.code === "KeyA") {
|
||||
e.preventDefault();
|
||||
|
||||
this.$refs.table.tabulator.deselectRow();
|
||||
this.$refs.table.tabulator.selectRow();
|
||||
}
|
||||
|
||||
if (!this.focusObj)
|
||||
return;
|
||||
|
||||
@@ -592,10 +546,6 @@ export default {
|
||||
this.changeFocus(this.focusObj, el);
|
||||
}
|
||||
},
|
||||
clearSelection(){
|
||||
this.lastSelected = [];
|
||||
this.$emit('update:selected',[]);
|
||||
},
|
||||
//methods tags
|
||||
addedTag(addedTag)
|
||||
{
|
||||
@@ -677,27 +627,6 @@ export default {
|
||||
@headerFilterOn="handleHeaderFilter"
|
||||
>
|
||||
|
||||
<!--
|
||||
<template #actions>
|
||||
<div>
|
||||
<button
|
||||
class="btn btn-outline-success sm mb-1"
|
||||
:title="'Export ' + selectedPrestudents.length + ' prestudent(s) to Excel'"
|
||||
>
|
||||
<i class="fas fa-file-excel fa-xl"></i>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
-->
|
||||
|
||||
<template #additional>
|
||||
<div class="pe-2">
|
||||
<a :href="linkXLS" target="_blank">
|
||||
<i class="fas fa-file-excel fa-xl text-success" :title="$p.t('stv', 'text_exportXLS', { count: selectedPrestudents.length })"></i>
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #actions>
|
||||
<core-tag ref="tagComponent"
|
||||
v-if="tagsEnabled"
|
||||
@@ -708,23 +637,22 @@ export default {
|
||||
@updated="updatedTag"
|
||||
zuordnung_typ="prestudent_id"
|
||||
></core-tag>
|
||||
</template>
|
||||
|
||||
<template v-if="filter.length || headerFilterActive">
|
||||
<div class="d-flex justify-content-center align-items-center gap-2 ps-4 position-absolute start-50 translate-middle-x">
|
||||
<p class="text-danger mb-0">
|
||||
<strong>{{$p.t('filter','filterActive')}}</strong>
|
||||
</p>
|
||||
|
||||
<button
|
||||
class="btn btn-outline-danger sm"
|
||||
:title="$p.t('filter/filterDelete')"
|
||||
@click="resetFilter"
|
||||
>
|
||||
<span class="fa-solid fa-filter-circle-xmark"></span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
<template #actions v-if="filter.length || headerFilterActive">
|
||||
<div class="d-flex justify-content-center align-items-center gap-2 ps-4 position-absolute start-50 translate-middle-x">
|
||||
<p class="text-danger mb-0">
|
||||
<strong>{{$p.t('filter','filterActive')}}</strong>
|
||||
</p>
|
||||
|
||||
<button
|
||||
class="btn btn-outline-danger sm"
|
||||
:title="$p.t('filter/filterDelete')"
|
||||
@click="resetFilter"
|
||||
>
|
||||
<span class="fa-solid fa-filter-circle-xmark"></span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #filter>
|
||||
|
||||
@@ -3,7 +3,6 @@ import FormInput from "../Form/Input.js";
|
||||
import BsModal from '../Bootstrap/Modal.js';
|
||||
|
||||
export default {
|
||||
name: 'TagComponent',
|
||||
components: {
|
||||
CoreForm,
|
||||
FormInput,
|
||||
@@ -45,9 +44,7 @@ export default {
|
||||
insertvon: "",
|
||||
updateamum: "",
|
||||
updatevon: "",
|
||||
response: "",
|
||||
start: "",
|
||||
ende: ""
|
||||
response: ""
|
||||
},
|
||||
mode: "create"
|
||||
};
|
||||
@@ -90,10 +87,6 @@ export default {
|
||||
this.tagData.bearbeiter = item.bearbeiter;
|
||||
this.tagData.verfasser = item.verfasser;
|
||||
this.tagData.readonly = item.readonly;
|
||||
//add for automated tags
|
||||
this.tagData.automatisiert = item.automatisiert;
|
||||
this.tagData.start = this.formatDateTimeDay(item.start);
|
||||
this.tagData.ende = this.formatDateTimeDay(item.ende);
|
||||
|
||||
if (item && item.notiz_id)
|
||||
{
|
||||
@@ -208,14 +201,6 @@ export default {
|
||||
second: "2-digit"
|
||||
});
|
||||
},
|
||||
formatDateTimeDay: (dateString) => {
|
||||
if (!dateString) return null;
|
||||
return new Date(dateString).toLocaleString('de-AT', {
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
});
|
||||
},
|
||||
async copy (){
|
||||
await navigator.clipboard.writeText(this.tagData.notiz);
|
||||
}
|
||||
@@ -273,15 +258,6 @@ export default {
|
||||
<span v-if="tagData.bearbeiter && tagData.insertamum !== tagData.updateamum">
|
||||
{{ $p.t('notiz', 'tag_bearbeiter', { 0: tagData.bearbeiter, 1: tagData.updateamum }) }}
|
||||
</span>
|
||||
<span v-if="tagData.start || tagData.ende" >
|
||||
gültig
|
||||
</span>
|
||||
<span v-if="tagData.start">
|
||||
von {{tagData.start}}
|
||||
</span>
|
||||
<span v-if="tagData.ende">
|
||||
bis {{tagData.ende}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
export function idTagFormatter (id, tagData, tagComponent, typeId, semesterStart=null, semesterEnd=null)
|
||||
{
|
||||
if (!id) return;
|
||||
|
||||
const hasSemesterFilter = !!(semesterStart && semesterEnd);
|
||||
|
||||
const semStart = hasSemesterFilter ? new Date(semesterStart) : null;
|
||||
const semEnd = hasSemesterFilter ? new Date(semesterEnd) : null;
|
||||
|
||||
const parsedTags = tagData.map(tag => ({
|
||||
id: tag.notiz_id,
|
||||
typ_kurzbz: tag.titel?.toLowerCase(),
|
||||
beschreibung: tag.bezeichnung,
|
||||
notiz: tag.text || "",
|
||||
style: tag.style,
|
||||
done: tag.done,
|
||||
automatisiert: tag.automatisiert,
|
||||
typeId: id,
|
||||
validFrom: tag.start ? new Date(tag.start) : null,
|
||||
validTo: tag.ende ? new Date(tag.ende) : null
|
||||
}));
|
||||
|
||||
const isInSemester = (tag) => {
|
||||
if (!hasSemesterFilter) return true;
|
||||
|
||||
if (!tag.validFrom && !tag.validTo) return true;
|
||||
|
||||
if (!tag.validFrom && !tag.validTo) return true;
|
||||
|
||||
if (tag.validFrom && tag.validTo) {
|
||||
return tag.validFrom <= semEnd && tag.validTo >= semStart;
|
||||
}
|
||||
|
||||
if (tag.validFrom && !tag.validTo) {
|
||||
return tag.validFrom <= semEnd;
|
||||
}
|
||||
|
||||
if (!tag.validFrom && tag.validTo) {
|
||||
return tag.validTo >= semStart;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
let container = document.createElement('div');
|
||||
container.className = "d-flex gap-1";
|
||||
|
||||
let maxVisibleTags = 5;
|
||||
let expanded = false;
|
||||
const renderTags = () => {
|
||||
container.innerHTML = '';
|
||||
|
||||
let filtered = parsedTags
|
||||
.filter(t => t != null)
|
||||
.filter(isInSemester);
|
||||
|
||||
filtered.sort((a, b) => {
|
||||
let adone = a.done ? 1 : 0;
|
||||
let bdone = b.done ? 1 : 0;
|
||||
|
||||
if (adone !== bdone) return adone - bdone;
|
||||
return b.id - a.id;
|
||||
});
|
||||
|
||||
const tagsToShow = expanded
|
||||
? filtered
|
||||
: filtered.slice(0, maxVisibleTags);
|
||||
|
||||
tagsToShow.forEach(tag => {
|
||||
let tagElement = document.createElement('span');
|
||||
|
||||
if(tag.automatisiert)
|
||||
tagElement.innerHTML = "<i class='fa-solid fa-lock'></i> " + tag.beschreibung;
|
||||
else
|
||||
tagElement.innerText = tag.beschreibung;
|
||||
tagElement.title = tag.notiz;
|
||||
tagElement.className = "tag " + tag.style;
|
||||
|
||||
if (tag.done) {
|
||||
tagElement.className += " tag_done";
|
||||
}
|
||||
if (tag.automatisiert)
|
||||
tagElement.className += " tag_auto";
|
||||
|
||||
tagElement.addEventListener('click', (event) => {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
tagComponent.editTag(tag.id);
|
||||
});
|
||||
|
||||
container.appendChild(tagElement);
|
||||
});
|
||||
|
||||
if (filtered.length > maxVisibleTags) {
|
||||
let toggle = document.createElement('button');
|
||||
toggle.innerText = (expanded ? '- ' : '+ ') + (filtered.length - maxVisibleTags);
|
||||
toggle.className = "display_all";
|
||||
|
||||
toggle.addEventListener('click', () => {
|
||||
expanded = !expanded;
|
||||
renderTags();
|
||||
});
|
||||
|
||||
container.appendChild(toggle);
|
||||
}
|
||||
};
|
||||
|
||||
renderTags();
|
||||
|
||||
return container;
|
||||
}
|
||||
@@ -218,23 +218,15 @@ export const CoreFilterCmpt = {
|
||||
},
|
||||
columnsForFilter() {
|
||||
if (!this.filteredColumns || !this.datasetMetadata) return [];
|
||||
|
||||
const localizedColumnTitles = this.tabulator.getLang().columns;
|
||||
const isTabulatorLocalized = !!this.$props.tabulatorOptions.locale;
|
||||
|
||||
let filterTitles;
|
||||
if (isTabulatorLocalized) {
|
||||
const localizedColumnTitles = this.tabulator.getLang().columns;
|
||||
filterTitles = this.filteredColumns.reduce((a, c) => {
|
||||
a[c.field] = localizedColumnTitles[c.field];
|
||||
return a;
|
||||
}, {});
|
||||
} else {
|
||||
filterTitles = this.filteredColumns.reduce((a, c) => {
|
||||
a[c.field] = c.title;
|
||||
return a;
|
||||
}, {});
|
||||
}
|
||||
|
||||
const filterTitles = this.filteredColumns.reduce((a, c) => {
|
||||
a[c.field] =
|
||||
isTabulatorLocalized && localizedColumnTitles[c.field]
|
||||
? localizedColumnTitles[c.field]
|
||||
: c.title;
|
||||
return a;
|
||||
}, {});
|
||||
return this.datasetMetadata.map((el) => ({
|
||||
...el,
|
||||
...{ title: filterTitles[el.name] },
|
||||
@@ -902,7 +894,6 @@ export const CoreFilterCmpt = {
|
||||
<span class="fa-solid fa-xl fa-table-columns"></span>
|
||||
</a>
|
||||
<table-download class="btn btn-link px-0 fhc-text" :tabulator="tabulator" :config="download"></table-download>
|
||||
<slot name="additional"></slot>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ export default {
|
||||
return true;
|
||||
},
|
||||
download(config) {
|
||||
this.tabulator.download(config.formatter, config.file, config.options, config.rowRange)
|
||||
this.tabulator.download(config.formatter, config.file, config.options)
|
||||
}
|
||||
},
|
||||
template: `
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
export default {
|
||||
name: 'HorizontalSplit',
|
||||
props: {
|
||||
defaultRatio: {
|
||||
type: Array,
|
||||
default: () => [50, 50]
|
||||
}
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
availWidth: 0,
|
||||
leftwidth: 0,
|
||||
rightwidth: 0,
|
||||
mousePosX: 0,
|
||||
resize: false,
|
||||
hsplitterOffset: 0,
|
||||
selfOffsetLeft: 0
|
||||
};
|
||||
},
|
||||
template: `
|
||||
<div ref="horizontalsplit" class="horizontalsplit-container">
|
||||
<div ref="leftpanel" class="horizontalsplitted"
|
||||
:style="{ width: this.leftwidthcss }">
|
||||
<slot name="left">
|
||||
<p>Left Panel</p>
|
||||
</slot>
|
||||
</div>
|
||||
<div ref="hsplitter" class="horizontalsplitter"
|
||||
:class="this.leftOrRightClass" @mousedown="this.dragStart">
|
||||
<div class="splitactions horizontal" :class="this.leftOrRightClass">
|
||||
<span @click="this.collapseRight" class="splitaction">
|
||||
<i class="fas fa-angle-right text-muted"></i>
|
||||
</span>
|
||||
<span @dblclick="this.showBoth" class="splitaction resize">
|
||||
<i class="fas fa-grip-lines-vertical text-muted"></i>
|
||||
</span>
|
||||
<span @click="this.collapseLeft" class="splitaction">
|
||||
<i class="fas fa-angle-left text-muted"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div ref="rightpanel" class="horizontalsplitted"
|
||||
:style="{ width: this.rightwidthcss }">
|
||||
<slot name="right">
|
||||
<p/>
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
mounted: function () {
|
||||
this.calcWidths();
|
||||
this.trackHorizontalSplitterOffsetLeft();
|
||||
window.addEventListener('resize', this.calcWidths);
|
||||
},
|
||||
updated: function () {
|
||||
this.trackHorizontalSplitterOffsetLeft();
|
||||
},
|
||||
beforeDestroy: function () {
|
||||
window.removeEventListener('resize', this.calcWidths);
|
||||
},
|
||||
methods: {
|
||||
calcWidths: function () {
|
||||
var oldavailWidth = this.availWidth;
|
||||
this.selfOffsetLeft = this.$refs.horizontalsplit.offsetLeft;
|
||||
this.availWidth = this.$refs.horizontalsplit.offsetWidth - this.$refs.hsplitter.offsetWidth;
|
||||
|
||||
if ((this.leftwidth === 0 && this.rightwidth === 0) || oldavailWidth === 0) {
|
||||
this.leftwidth = Math.floor(this.availWidth * (this.defaultRatio[0] / 100));
|
||||
} else {
|
||||
this.leftwidth = Math.floor(((this.leftwidth * 100) / oldavailWidth) / 100 * this.availWidth);
|
||||
}
|
||||
this.rightwidth = this.availWidth - this.leftwidth;
|
||||
},
|
||||
collapseLeft: function () {
|
||||
this.calcWidths();
|
||||
this.leftwidth = 0;
|
||||
this.rightwidth = this.availWidth;
|
||||
},
|
||||
collapseRight: function () {
|
||||
this.calcWidths();
|
||||
this.leftwidth = this.availWidth;
|
||||
this.rightwidth = 0;
|
||||
},
|
||||
showBoth: function () {
|
||||
this.leftwidth = Math.floor(this.availWidth * (this.defaultRatio[0] / 100));
|
||||
this.rightwidth = this.availWidth - this.leftwidth;
|
||||
},
|
||||
isCollapsed: function () {
|
||||
if (this.leftwidth === 0) {
|
||||
return 'left';
|
||||
} else if (this.rightwidth === 0) {
|
||||
return 'right';
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
dragStart: function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
window.addEventListener('mouseup', this.dragEnd);
|
||||
window.addEventListener('mousemove', this.drag);
|
||||
this.resize = true;
|
||||
this.mousePosX = e.clientX;
|
||||
},
|
||||
drag: function (e) {
|
||||
if (!this.resize) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
var offsetX = e.clientX - this.mousePosX;
|
||||
this.leftwidth = this.leftwidth + offsetX;
|
||||
if (this.leftwidth < 0) {
|
||||
this.leftwidth = 0;
|
||||
}
|
||||
if (this.leftwidth > this.availWidth) {
|
||||
this.leftwidth = this.availWidth;
|
||||
}
|
||||
this.rightwidth = this.availWidth - this.leftwidth;
|
||||
this.mousePosX = e.clientX;
|
||||
},
|
||||
dragEnd: function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
window.removeEventListener('mousemove', this.drag);
|
||||
window.removeEventListener('mouseup', this.dragEnd);
|
||||
this.resize = false;
|
||||
this.mousePosX = e.clientX;
|
||||
},
|
||||
trackHorizontalSplitterOffsetLeft: function () {
|
||||
this.hsplitterOffset = this.$refs.hsplitter.offsetLeft;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
leftOrRightClass: function () {
|
||||
return ((this.hsplitterOffset - this.selfOffsetLeft) <= Math.floor(this.availWidth / 2))
|
||||
? 'left'
|
||||
: 'right';
|
||||
},
|
||||
leftwidthcss: function () {
|
||||
return this.leftwidth + 'px';
|
||||
},
|
||||
rightwidthcss: function () {
|
||||
return this.rightwidth + 'px';
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,11 +1,5 @@
|
||||
export default {
|
||||
name: 'VerticalSplit',
|
||||
props: {
|
||||
defaultRatio: {
|
||||
type: Array,
|
||||
default: () => [50, 50]
|
||||
}
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
availHeight: 0,
|
||||
@@ -56,22 +50,17 @@ export default {
|
||||
updated: function() {
|
||||
this.trackVerticalSplitterOffsetTop();
|
||||
},
|
||||
beforeDestroy: function () {
|
||||
window.removeEventListener('resize', this.calcHeights);
|
||||
},
|
||||
methods: {
|
||||
calcHeights: function() {
|
||||
var windowheight = window.innerHeight;
|
||||
var oldavailHeight = this.availHeight;
|
||||
this.selfOffsetTop = this.$refs.verticalsplit.offsetTop;
|
||||
this.availHeight = windowheight - this.selfOffsetTop - this.$refs.vsplitter.offsetHeight;
|
||||
|
||||
if( (this.topheight === 0 && this.bottomheight === 0) || oldavailHeight === 0 ) {
|
||||
this.topheight = Math.floor(this.availHeight * (this.defaultRatio[0] / 100));
|
||||
this.topheight = Math.floor(this.availHeight/2);
|
||||
} else {
|
||||
this.topheight = Math.floor( ((((this.topheight * 100) / oldavailHeight) / 100) * this.availHeight) );
|
||||
}
|
||||
|
||||
this.bottomheight = this.availHeight - this.topheight;
|
||||
},
|
||||
collapseTop: function() {
|
||||
@@ -85,8 +74,8 @@ export default {
|
||||
this.bottomheight = 0;
|
||||
},
|
||||
showBoth: function() {
|
||||
this.topheight = Math.floor(this.availHeight * (this.defaultRatio[0] / 100));
|
||||
this.bottomheight = this.availHeight - this.topheight
|
||||
this.topheight = Math.floor(this.availHeight/2);
|
||||
this.bottomheight = Math.floor(this.availHeight/2);
|
||||
},
|
||||
isCollapsed: function() {
|
||||
if( this.topheight === 0 ) {
|
||||
|
||||
@@ -1,24 +1,12 @@
|
||||
export function tagFormatter(cell, tagComponent)
|
||||
{
|
||||
const mappedData = tagComponent.tags.map(tag => ({
|
||||
typ_kurzbz: tag.tag_typ_kurzbz,
|
||||
automatisiert: tag.automatisiert
|
||||
}));
|
||||
|
||||
|
||||
let tags = cell.getValue();
|
||||
if (!tags) return;
|
||||
|
||||
let container = document.createElement('div');
|
||||
container.className = "d-flex gap-1";
|
||||
|
||||
let parsedTags = [];
|
||||
if (typeof tags === 'string') {
|
||||
parsedTags = JSON.parse(tags);
|
||||
} else if (Array.isArray(tags)) {
|
||||
parsedTags = tags;
|
||||
}
|
||||
|
||||
let parsedTags = JSON.parse(tags);
|
||||
let maxVisibleTags = 2;
|
||||
|
||||
const rowData = cell.getRow().getData();
|
||||
@@ -50,17 +38,10 @@ export function tagFormatter(cell, tagComponent)
|
||||
tagElement.className = "tag " + tag.style;
|
||||
if (tag.done) tagElement.className += " tag_done";
|
||||
|
||||
const tagDef = mappedData.find(t => t.typ_kurzbz === tag.typ_kurzbz);
|
||||
|
||||
if (!tagDef && tag.typ_kurzbz?.includes("_auto") || tagDef?.automatisiert) {
|
||||
tagElement.className += " tag_auto";
|
||||
tagElement.innerHTML = "<i class='fa-solid fa-lock'></i> " + tag.beschreibung;
|
||||
}
|
||||
|
||||
tagElement.addEventListener('click', (event) => {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
tagComponent.editTag(tag.id)
|
||||
tagComponent.editTag(tag.id);
|
||||
});
|
||||
|
||||
container.appendChild(tagElement);
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 48 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 79 KiB |
@@ -94,11 +94,11 @@ require_once('dbupdate_3.4/71399_dashboard_update_widget_paths.php');
|
||||
require_once('dbupdate_3.4/71645_studvw_messagetab_ladezeit.php');
|
||||
require_once('dbupdate_3.4/71566_studienordnungsdokument_neuer_organisationseinheitstyp_programm.php');
|
||||
require_once('dbupdate_3.4/70376_lohnguide.php');
|
||||
require_once('dbupdate_3.4/76203_Asynchrone_Tasks.php');
|
||||
require_once('dbupdate_3.4/75888_reihungstest_mehrfachdurchfuehrung.php');
|
||||
require_once('dbupdate_3.4/76150_perm_other_lv_plan.php');
|
||||
require_once('dbupdate_3.4/68957_dashboard_bookmark_neue_Spalte_sort.php');
|
||||
require_once('dbupdate_3.4/68530_Dashboard_Cleanup.php');
|
||||
require_once('dbupdate_3.4/75959_StudVw_Automatische_Tags.php');
|
||||
|
||||
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
||||
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
|
||||
@@ -434,7 +434,7 @@ $tabellen=array(
|
||||
"system.tbl_log" => array("log_id","person_id","zeitpunkt","app","oe_kurzbz","logtype_kurzbz","logdata","insertvon","taetigkeit_kurzbz"),
|
||||
"system.tbl_logtype" => array("logtype_kurzbz", "data_schema"),
|
||||
"system.tbl_filters" => array("filter_id","app","dataset_name","filter_kurzbz","person_id","description","sort","default_filter","filter","oe_kurzbz","statistik_kurzbz"),
|
||||
"system.tbl_jobsqueue" => array("jobid", "type", "creationtime", "status", "input", "output", "starttime", "endtime", "insertvon", "insertamum"),
|
||||
"system.tbl_jobsqueue" => array("jobid", "type", "creationtime", "status", "input", "output", "starttime", "endtime", "insertvon", "insertamum", "pid", "uid", "progress"),
|
||||
"system.tbl_jobstatuses" => array("status"),
|
||||
"system.tbl_jobtriggers" => array("type", "status", "following_type"),
|
||||
"system.tbl_jobtypes" => array("type", "description"),
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
<?php
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
//Add column entwicklungs_id to bis.tbl_entwicklungsteam
|
||||
if(!@$db->db_query("SELECT taglib FROM public.tbl_notiz_typ LIMIT 1"))
|
||||
{
|
||||
$qry = 'ALTER TABLE public.tbl_notiz_typ ADD COLUMN taglib character varying(32);';
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong> public.tbl_notiz_typ '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>public.tbl_notiz_typ: Neue Spalte taglib hinzugefügt';
|
||||
}
|
||||
|
||||
//automatic tags anlegen
|
||||
$tags = [
|
||||
[
|
||||
'typ_kurzbz' => 'wh_auto',
|
||||
'bezeichnung' => '{WH, R}',
|
||||
'style' => 'tag_dark_grey',
|
||||
'prioritaet' => 11,
|
||||
'taglib' => 'tags/CoreWiederholerTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'dd_auto',
|
||||
'bezeichnung' => '{DD, DD}',
|
||||
'style' => 'tag_braun',
|
||||
'prioritaet' => 10,
|
||||
'taglib' => 'tags/CoreDoubleDegreeTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'out_auto',
|
||||
'bezeichnung' => '{Out, Out}',
|
||||
'style' => 'tag_limette',
|
||||
'prioritaet' => 12,
|
||||
'taglib' => 'tags/CoreOutgoingTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'prewh_auto',
|
||||
'bezeichnung' => '{Pre-WH, pre-R}',
|
||||
'style' => 'tag_light_grey',
|
||||
'prioritaet' => 13,
|
||||
'taglib' => 'tags/CorePrewiederholerTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'zgv_auto',
|
||||
'bezeichnung' => '{ZGV offen, ZGV missing}',
|
||||
'style' => 'tag_beige',
|
||||
'prioritaet' => 14,
|
||||
'taglib' => 'tags/CoreMissingZgvTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'unterbrecher_auto',
|
||||
'bezeichnung' => '{UB, I}',
|
||||
'style' => 'tag_turquoise',
|
||||
'prioritaet' => 15,
|
||||
'taglib' => 'tags/CoreUnterbrecherTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'stbtr_erh_auto',
|
||||
'bezeichnung' => '{erh.Studienbeitrag, Incr. Tuition Fees}',
|
||||
'style' => 'tag_bordeaux',
|
||||
'prioritaet' => 16,
|
||||
'taglib' => 'tags/CoreStbErhoehtTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'jgv_auto',
|
||||
'bezeichnung' => '{JGV, YGR}',
|
||||
'style' => 'tag_olive',
|
||||
'prioritaet' => 17,
|
||||
'taglib' => 'tags/CoreJgvTagLib'
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
foreach ($tags as $tag) {
|
||||
|
||||
$checkQry = "
|
||||
SELECT 1
|
||||
FROM public.tbl_notiz_typ
|
||||
WHERE typ_kurzbz = '".$tag['typ_kurzbz']."'
|
||||
";
|
||||
|
||||
if ($result = $db->db_query($checkQry)) {
|
||||
|
||||
if ($db->db_num_rows($result) == 0) {
|
||||
|
||||
$qry = "
|
||||
INSERT INTO public.tbl_notiz_typ
|
||||
(
|
||||
typ_kurzbz,
|
||||
bezeichnung_mehrsprachig,
|
||||
automatisiert,
|
||||
aktiv,
|
||||
tag,
|
||||
style,
|
||||
vorrueckung,
|
||||
prioritaet,
|
||||
taglib
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'".$tag['typ_kurzbz']."',
|
||||
'".$tag['bezeichnung']."',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'".$tag['style']."',
|
||||
false,
|
||||
'".$tag['prioritaet']."',
|
||||
'".$tag['taglib']."'
|
||||
)
|
||||
";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
{
|
||||
echo '<strong>public.tbl_notiz_typ: '. $tag['typ_kurzbz']. ' '. $db->db_last_error().'</strong><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<br>public.tbl_notiz_typ: Automatic Tag '.$tag['typ_kurzbz'].' hinzugefuegt';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
// Add column pid to system.tbl_jobsqueue
|
||||
if (!$result = @$db->db_query('SELECT "pid" FROM "system"."tbl_jobsqueue" LIMIT 1'))
|
||||
{
|
||||
$qry = 'ALTER TABLE "system"."tbl_jobsqueue" ADD "pid" INT NULL DEFAULT NULL;';
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>system.tbl_jobsqueue: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Added column pid to table system.tbl_jobsqueue';
|
||||
}
|
||||
|
||||
// Add column uid to system.tbl_jobsqueue
|
||||
if (!$result = @$db->db_query('SELECT "uid" FROM "system"."tbl_jobsqueue" LIMIT 1'))
|
||||
{
|
||||
$qry = 'ALTER TABLE "system"."tbl_jobsqueue" ADD "uid" VARCHAR(32) NULL DEFAULT NULL;';
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>system.tbl_jobsqueue: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Added column uid to table system.tbl_jobsqueue';
|
||||
}
|
||||
|
||||
// Add column progress to system.tbl_jobsqueue
|
||||
if (!$result = @$db->db_query('SELECT "progress" FROM "system"."tbl_jobsqueue" LIMIT 1'))
|
||||
{
|
||||
$qry = 'ALTER TABLE "system"."tbl_jobsqueue" ADD "progress" NUMERIC(2,1) NULL DEFAULT 0;';
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>system.tbl_jobsqueue: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Added column progress to table system.tbl_jobsqueue';
|
||||
}
|
||||
|
||||
// Add foreign key fk_jobsqueue_benutzer_uid on system.tbl_jobsqueue.uid with public.tbl_benutzer.uid
|
||||
if ($result = $db->db_query("SELECT conname FROM pg_constraint WHERE conname = 'fk_jobsqueue_benutzer_uid'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = 'ALTER TABLE "system"."tbl_jobsqueue" ADD CONSTRAINT "fk_jobsqueue_benutzer_uid" FOREIGN KEY ("uid") REFERENCES "public"."tbl_benutzer" ("uid") ON DELETE RESTRICT ON UPDATE CASCADE;';
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>system.tbl_jobsqueue: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Created foreign key fk_jobsqueue_benutzer_uid';
|
||||
}
|
||||
}
|
||||
|
||||
// Add new webservice type in system.tbl_webservicetyp
|
||||
if ($result = @$db->db_query("SELECT 1 FROM system.tbl_webservicetyp WHERE webservicetyp_kurzbz = 'lrt';"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "INSERT INTO system.tbl_webservicetyp(webservicetyp_kurzbz, beschreibung) VALUES('lrt', 'Long Run Task');";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>system.tbl_webservicetyp '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo ' system.tbl_webservicetyp: Added webservice type "lrt"<br>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1638,6 +1638,84 @@ $filters = array(
|
||||
}',
|
||||
'oe_kurzbz' => null,
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'dataset_name' => 'logs',
|
||||
'filter_kurzbz' => 'lrts24hours',
|
||||
'description' => '{Last 24 hours LRTs logs}',
|
||||
'sort' => 2,
|
||||
'default_filter' => false,
|
||||
'filter' => '
|
||||
{
|
||||
"name": "All Long Run Tasks logs from the last 24 hours",
|
||||
"columns": [
|
||||
{"name": "RequestId"},
|
||||
{"name": "ExecutionTime"},
|
||||
{"name": "ExecutedBy"},
|
||||
{"name": "Description"},
|
||||
{"name": "Data"}
|
||||
],
|
||||
"filters": [
|
||||
{
|
||||
"name": "WebserviceType",
|
||||
"operation": "contains",
|
||||
"condition": "job"
|
||||
},
|
||||
{
|
||||
"name": "RequestId",
|
||||
"operation": "contains",
|
||||
"condition": "LRT"
|
||||
},
|
||||
{
|
||||
"name": "ExecutionTime",
|
||||
"operation": "lt",
|
||||
"condition": "24",
|
||||
"option": "hours"
|
||||
}
|
||||
]
|
||||
}
|
||||
',
|
||||
'oe_kurzbz' => null,
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'dataset_name' => 'logs',
|
||||
'filter_kurzbz' => 'lrts48hours',
|
||||
'description' => '{Last 48 hours LRTs logs}',
|
||||
'sort' => 2,
|
||||
'default_filter' => false,
|
||||
'filter' => '
|
||||
{
|
||||
"name": "All Long Run Tasks logs from the last 48 hours",
|
||||
"columns": [
|
||||
{"name": "RequestId"},
|
||||
{"name": "ExecutionTime"},
|
||||
{"name": "ExecutedBy"},
|
||||
{"name": "Description"},
|
||||
{"name": "Data"}
|
||||
],
|
||||
"filters": [
|
||||
{
|
||||
"name": "WebserviceType",
|
||||
"operation": "contains",
|
||||
"condition": "job"
|
||||
},
|
||||
{
|
||||
"name": "RequestId",
|
||||
"operation": "contains",
|
||||
"condition": "LRT"
|
||||
},
|
||||
{
|
||||
"name": "ExecutionTime",
|
||||
"operation": "lt",
|
||||
"condition": "48",
|
||||
"option": "hours"
|
||||
}
|
||||
]
|
||||
}
|
||||
',
|
||||
'oe_kurzbz' => null,
|
||||
),
|
||||
);
|
||||
|
||||
// Loop through the filters array
|
||||
|
||||
+71
-649
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user