mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 07:52:16 +00:00
Compare commits
230 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 759aad047b | |||
| db7f46a874 | |||
| fd0262f708 | |||
| a06d7bbfec | |||
| 16689f4d6e | |||
| d1adc160ca | |||
| 0bd75716f2 | |||
| a70ef78ead | |||
| 9782fe5459 | |||
| 5e509f7f19 | |||
| 7ba74143df | |||
| e110e8fa57 | |||
| 76b9c6781d | |||
| 856706bc1c | |||
| d680c3aa2b | |||
| d98bdb9745 | |||
| d54747c4df | |||
| da3b329772 | |||
| 41d40102f3 | |||
| 1496045c40 | |||
| e2dadcd208 | |||
| c7bac03429 | |||
| 07d3b32279 | |||
| 245d0d3369 | |||
| d3d04c5a77 | |||
| 070ac1e878 | |||
| 63ff8dd4c4 | |||
| 366edb7e90 | |||
| ac6aa28680 | |||
| f6f58642f5 | |||
| 9430135592 | |||
| 57eec98604 | |||
| 1561aa55b7 | |||
| 35f4d23308 | |||
| 199b62d13f | |||
| bb366e4117 | |||
| b0fc5a3618 | |||
| 6e599908cd | |||
| c099eec7a7 | |||
| 0962e62e69 | |||
| dcd6cfd74b | |||
| b1be5a4ba4 | |||
| 5caab182b2 | |||
| baaf941f25 | |||
| 2e5e7afb4d | |||
| 71f68da90b | |||
| 2c4626fd1a | |||
| 178638c006 | |||
| 981c97173e | |||
| c11fd03362 | |||
| 49d5c46133 | |||
| 9fb00f6cbd | |||
| ec1422a136 | |||
| 89e98056e6 | |||
| 5cf14aa886 | |||
| 7d3096c2e8 | |||
| ef2f9630a9 | |||
| 4d3c73c78f | |||
| 9ee6a0a01a | |||
| 1e226f4515 | |||
| ca8fe5bd19 | |||
| 6d26ec2ab7 | |||
| d4e170037b | |||
| 7aba7aefb9 | |||
| 0a18fcf732 | |||
| e5ae400686 | |||
| e08b731cb5 | |||
| 1b822fc8f8 | |||
| 368eded1fd | |||
| d1a4cfd5df | |||
| dbcacdddd6 | |||
| 8b2ef4e832 | |||
| 6fedb4b108 | |||
| 905c69c384 | |||
| 6fa0a7c102 | |||
| 7320dc448e | |||
| ede9323224 | |||
| 3dcf72d679 | |||
| 37b70861d1 | |||
| 150d54eeda | |||
| 68b26a1091 | |||
| 5c371a20d2 | |||
| d42157c5f8 | |||
| 502851856b | |||
| 8ce67a4726 | |||
| bcfdf1e05c | |||
| cb744799bd | |||
| 90ebee25fe | |||
| 3e8ed231a6 | |||
| 4c67b9d267 | |||
| c16cf342cb | |||
| d843f05922 | |||
| 44e9b4dff1 | |||
| bda42ab347 | |||
| b5b69878b8 | |||
| 6f17ddbbdf | |||
| ef1347c7d5 | |||
| d1fa5f64c4 | |||
| 21eb95bb23 | |||
| e856c8ad6b | |||
| 2723d6a741 | |||
| e5e22931a9 | |||
| 21ea277aaf | |||
| 2c0badf67c | |||
| 5e72161ab0 | |||
| 903f3b99b3 | |||
| df9edc36e0 | |||
| 39f1716ae2 | |||
| c7b25e6632 | |||
| 695f3455e6 | |||
| 1339077b57 | |||
| 3aebccbb9d | |||
| ee6f28c06d | |||
| fdb037da96 | |||
| 49cbbfc50c | |||
| 4f8e98f5d5 | |||
| e9e614aa52 | |||
| 50af6694d0 | |||
| 5dbddb4beb | |||
| b20613f5d7 | |||
| 0621564be7 | |||
| f1714db09e | |||
| 70b025da30 | |||
| 87dd858358 | |||
| 51f3edcd72 | |||
| e7f626bd72 | |||
| 17f94aabdf | |||
| c49e32c4ac | |||
| df124db84a | |||
| 29a4b4aadc | |||
| 2682ea75ab | |||
| b3a63a60e9 | |||
| a54dfaf0c7 | |||
| 595538d6bb | |||
| a5329e5bba | |||
| 37a79c4589 | |||
| dd760f8210 | |||
| dd87e893ba | |||
| 4b767d4a57 | |||
| 127ce312ea | |||
| 5d461a72f6 | |||
| 2237e9f1b7 | |||
| 9b4fa132dc | |||
| daf332a102 | |||
| 942b4512fe | |||
| 3778b27574 | |||
| 15b340db56 | |||
| c127c0900e | |||
| fc01fa045e | |||
| 05838cc477 | |||
| 96e02c9911 | |||
| 248fceb4b5 | |||
| 92697d9468 | |||
| d1ec9c92eb | |||
| 454cf5ea64 | |||
| 4563533e67 | |||
| 640e719eda | |||
| aece2b1d90 | |||
| cb13655ecd | |||
| 9b3b6cec8f | |||
| 3ca1a1f1c7 | |||
| a7210208d6 | |||
| eaad23ff69 | |||
| c7ddf0a2a9 | |||
| b129ef873b | |||
| d927426d70 | |||
| 9ced137ded | |||
| a89da50e0a | |||
| 9256046b6c | |||
| fd95dd8023 | |||
| cda2b84939 | |||
| d893fe63e7 | |||
| 5aedf85982 | |||
| 55ab79c004 | |||
| 7c7a72600d | |||
| 01357654c0 | |||
| cd5900481b | |||
| ddef97d49f | |||
| 47b0449f22 | |||
| 0193460678 | |||
| e02b3e78d2 | |||
| c91e0a6b74 | |||
| c6852a9514 | |||
| 04b5240615 | |||
| 483547cd9c | |||
| 345413cd1f | |||
| f57dc6785b | |||
| 046a60b89c | |||
| da725e3ab1 | |||
| edd34941cc | |||
| c65686ef42 | |||
| c7729f85df | |||
| 53b187c9b6 | |||
| 7bc18e41b1 | |||
| 8bc17eded5 | |||
| 9adeb1c63a | |||
| 091ed0dacd | |||
| cf0a47cab7 | |||
| bb7b24346a | |||
| a68e2e798b | |||
| bd49f3c420 | |||
| 3c1d67267d | |||
| 61e1933a5b | |||
| 25c443098c | |||
| cf59bcff12 | |||
| 352c6e1d68 | |||
| 0e2444d7ce | |||
| c4390819a2 | |||
| 51104268d8 | |||
| cb5d43ab21 | |||
| 08de5cd377 | |||
| 274fa63658 | |||
| 81b2ed6551 | |||
| d9c6c3947b | |||
| 2d6dbbdb16 | |||
| b60faa1cab | |||
| fd19953864 | |||
| 927bafd93a | |||
| d93b21f0af | |||
| 6a8f6fa05a | |||
| 7f997c9411 | |||
| 2e3f98deb0 | |||
| a5feb656e0 | |||
| 9329955328 | |||
| 5b99dd2685 | |||
| 19288fc8f5 | |||
| 9f97de5952 | |||
| c476f7339c | |||
| 3dc1cf520a | |||
| 616c335a3b |
@@ -29,7 +29,7 @@ $config['ALLOWED_NOTEN_ABGABETOOL'] = [10, 14]; // tbl_note pk
|
||||
// benotete projektarbeiten sperren weitere terminanlage & bearbeitung, diese noten sind ausnahmen dieser Regel
|
||||
// wie zB "Nicht beurteilt" & "Noch nicht eingetragen"
|
||||
$config['NONFINAL_NOTEN_ABGABETOOL'] = [9];
|
||||
$config['beurteilung_link_fallback'] = 'cis/private/lehre/projektbeurteilungDocumentExport.php?projektarbeit_id=?&betreuerart_kurzbz=?&person_id=?';
|
||||
$config['beurteilung_link_fallback'] = 'addons/fhtw/content/projektbeurteilung/projektbeurteilungDocumentExport.php?projektarbeit_id=?&betreuerart_kurzbz=?&person_id=?';
|
||||
|
||||
$config['PROJEKTARBEITSBEURTEILUNG_MAIL_BASELINK_ERSTBEGUTACHTER'] = 'index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/ProjektarbeitsbeurteilungErstbegutachter';
|
||||
$config['PROJEKTARBEITSBEURTEILUNG_MAIL_BASELINK_ZWEITBEGUTACHTER'] = 'index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/ProjektarbeitsbeurteilungErstbegutachter';
|
||||
@@ -38,19 +38,8 @@ $config['SIGNATUR_CHECK_PAABGABETYPEN'] = ['end'];
|
||||
|
||||
// to be used as "https://moodle.technikum-wien.at/course/view.php?idnumber=dl{$stg_kz}" for stg specific moodle routing
|
||||
$config['STG_MOODLE_LINK'] = 'https://moodle.technikum-wien.at/course/view.php?idnumber=dl';
|
||||
// TODO: check if these links change if the file changes and how to better retrieve the link?
|
||||
$config['SIGNATUR_INFO_LINK_GERMAN'] = 'https://cis.technikum-wien.at/cms/dms.php?id=214779';
|
||||
$config['SIGNATUR_INFO_LINK_ENGLISH'] = 'https://cis.technikum-wien.at/cms/dms.php?id=264256';
|
||||
|
||||
$config['ASSISTENZ_SAMMELMAIL_BUTTON_STUDENT'] = true;
|
||||
$config['ASSISTENZ_SAMMELMAIL_BUTTON_BETREUER'] = true;
|
||||
|
||||
$config['BETREUER_SAMMELMAIL_BUTTON_STUDENT'] = true;
|
||||
|
||||
$config['MULTIEDIT_TABLE'] = true;
|
||||
|
||||
$config['STUDENT_EDIT_PROJEKTARBEIT_TITLE'] = true;
|
||||
|
||||
$config['CONFETTI_ON_ENDUPLOAD'] = true;
|
||||
|
||||
|
||||
|
||||
@@ -170,6 +170,13 @@ $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']
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
@@ -133,13 +133,21 @@ $config['students_tab_order'] = [
|
||||
|
||||
$config['stv_prestudent_tags'] = [
|
||||
'prioone' => ['readonly' => false],
|
||||
'priotwo' => ['readonly' => true],
|
||||
'priotwo' => ['readonly' => false],
|
||||
'hinweis' => ['readonly' => false],
|
||||
'hinweis_assistenz' => ['readonly' => true],
|
||||
'hinweis_kf' => ['readonly' => true],
|
||||
'hinweis_assistenz' => ['readonly' => false],
|
||||
'hinweis_kf' => ['readonly' => false],
|
||||
'hinweis_lehrende' => ['readonly' => false],
|
||||
'hinweis_stg_kf' => ['readonly' => true],
|
||||
'finished_stg' => ['readonly' => true],
|
||||
'finished_kf' => ['readonly' => true],
|
||||
'inwork_kf' => ['readonly' => true],
|
||||
'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],
|
||||
];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -418,10 +418,6 @@ class LvPlan extends FHCAPI_Controller
|
||||
*/
|
||||
private function fetchMoodleEvents($start_date, $end_date, $uid = null)
|
||||
{
|
||||
if ($uid && $uid !== getAuthUID()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$this->load->config('calendar');
|
||||
|
||||
$tz = new DateTimeZone($this->config->item('timezone'));
|
||||
|
||||
@@ -32,8 +32,6 @@ class Phrasen extends FHCAPI_Controller
|
||||
'setLanguage' => self::PERM_ANONYMOUS,
|
||||
'getLanguage' => self::PERM_ANONYMOUS,
|
||||
'getAllLanguages' => self::PERM_ANONYMOUS,
|
||||
'getPhrases' => self::PERM_ANONYMOUS,
|
||||
'getTabulatorPhrases' => self::PERM_ANONYMOUS,
|
||||
]);
|
||||
|
||||
$this->load->helper('hlp_language');
|
||||
@@ -94,59 +92,4 @@ class Phrasen extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($langs);
|
||||
}
|
||||
|
||||
public function getPhrases()
|
||||
{
|
||||
$postParams = $this->getPostJSON();
|
||||
|
||||
$languages = $postParams->languages;
|
||||
if (!$languages || !count($languages)) {
|
||||
$this->load->model('system/Sprache_model', 'sprachenModel');
|
||||
$activeLanguages = $this->sprachenModel->loadWhere(array('content' => true));
|
||||
$activeLanguagesData = $this->getDataOrTerminateWithError($activeLanguages);
|
||||
$languages = array_map(
|
||||
function ($languageData) {
|
||||
return $languageData->sprache;
|
||||
},
|
||||
$activeLanguagesData
|
||||
);
|
||||
}
|
||||
|
||||
$this->load->model('system/Phrase_model', 'phraseModel');
|
||||
$phrasesGroupedByCategory = $postParams->phrasesGroupedByCategory;
|
||||
$result = [];
|
||||
foreach ($languages as $language) {
|
||||
$phrases = $this->phraseModel->getPhrasesByCategoryAndPhrasesAndLanguage($phrasesGroupedByCategory, $language);
|
||||
$result[$language] = $this->getDataOrTerminateWithError($phrases);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getTabulatorPhrases()
|
||||
{
|
||||
$languages = json_decode($this->input->get('languages'));
|
||||
if (!$languages || !count($languages)) {
|
||||
$this->load->model('system/Sprache_model', 'sprachenModel');
|
||||
$activeLanguages = $this->sprachenModel->loadWhere(array('content' => true));
|
||||
$activeLanguagesData = $this->getDataOrTerminateWithError($activeLanguages);
|
||||
$languages = array_map(
|
||||
function ($languageData) {
|
||||
return $languageData->sprache;
|
||||
},
|
||||
$activeLanguagesData
|
||||
);
|
||||
}
|
||||
|
||||
$this->load->model('system/Phrase_model', 'phraseModel');
|
||||
$result = [];
|
||||
foreach ($languages as $language) {
|
||||
$tabulatorPhrases = $this->phraseModel->getPhrasesByCategoryAndLanguage(['tabulator'], $language);
|
||||
$result[$language] = $this->getDataOrTerminateWithError($tabulatorPhrases);
|
||||
}
|
||||
|
||||
header('Pragma: private');
|
||||
header('Cache-Control: private, max-age=' . (60 * 60 * 24 * 30));
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,9 +9,10 @@ class Detailheader extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getHeader' => ['vertrag/mitarbeiter:r'],
|
||||
'getPersonAbteilung' => ['vertrag/mitarbeiter:r'],
|
||||
'getLeitungOrg' => ['vertrag/mitarbeiter:r'],
|
||||
'getHeader' => self::PERM_LOGGED,
|
||||
'getPersonAbteilung' => self::PERM_LOGGED,
|
||||
'getLeitungOrg' => self::PERM_LOGGED,
|
||||
'getSemesterStati' => self::PERM_LOGGED,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -48,6 +49,17 @@ 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('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$result = $this->MitarbeiterModel->searchMitarbeiter($searchString, 'ohneMaUid');
|
||||
$result = $this->PersonModel->searchPerson($searchString, 'mitMaUid');
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($result ?: []);
|
||||
|
||||
@@ -287,7 +287,10 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
*/
|
||||
public function getNoten()
|
||||
{
|
||||
$result = $this->NoteModel->getAllActive();
|
||||
$this->NoteModel->addOrder('notenwert', 'ASC');
|
||||
$this->NoteModel->addOrder('bezeichnung', 'ASC');
|
||||
|
||||
$result = $this->NoteModel->load();
|
||||
|
||||
if (isError($result)) return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
@@ -144,6 +144,7 @@ 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,13 +439,15 @@ 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);
|
||||
}
|
||||
|
||||
@@ -556,6 +558,7 @@ 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');
|
||||
@@ -594,10 +597,22 @@ 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $prestudent_id
|
||||
*
|
||||
@@ -638,7 +653,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -671,7 +686,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -705,7 +720,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -755,6 +770,7 @@ 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);
|
||||
@@ -773,7 +789,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,9 @@ class Tags extends Tag_Controller
|
||||
'addTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'updateTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'doneTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'deleteTag' => self::BERECHTIGUNG_KURZBZ
|
||||
'deleteTag' => self::BERECHTIGUNG_KURZBZ,
|
||||
'getAllTags' => self::BERECHTIGUNG_KURZBZ,
|
||||
'rebuildTagsForTypeId' => self::BERECHTIGUNG_KURZBZ,
|
||||
]);
|
||||
|
||||
$this->config->load('stv');
|
||||
@@ -45,4 +47,5 @@ class Tags extends Tag_Controller
|
||||
{
|
||||
parent::doneTag($this->config->item('stv_prestudent_tags'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -358,8 +358,7 @@ class AbgabetoolJob extends JOB_Controller
|
||||
foreach($assistenzMap as $assistenz_person_id => $tupelArr) {
|
||||
|
||||
$abgabenString = '<div style="font-family: Arial, sans-serif; color: #333;">';
|
||||
$hasContent = false;
|
||||
|
||||
|
||||
foreach($tupelArr as $tupel) {
|
||||
$projektarbeit_id = $tupel[0];
|
||||
$assistenzRow = $tupel[1];
|
||||
@@ -378,7 +377,6 @@ class AbgabetoolJob extends JOB_Controller
|
||||
if(count($relevantAbgaben) == 0) {
|
||||
continue;
|
||||
}
|
||||
$hasContent = true;
|
||||
|
||||
// Format the Student Name
|
||||
$s = $relevantAbgaben[0];
|
||||
@@ -449,12 +447,7 @@ class AbgabetoolJob extends JOB_Controller
|
||||
}
|
||||
|
||||
$abgabenString .= '</div>';
|
||||
|
||||
// skip send entirely
|
||||
if (!$hasContent) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// done with building the change list, now send it
|
||||
$assistenzRow = $tupelArr[0][1];
|
||||
$anrede = $assistenzRow->anrede;
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
<?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");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -198,7 +198,19 @@ class Gradelist extends Auth_Controller
|
||||
if (!isset($row_noten->found))
|
||||
{
|
||||
$result_lv = $this->LehrveranstaltungModel->load($row_noten->lehrveranstaltung_id);
|
||||
$result_stg = $this->StudiengangModel->load($result_lv->retval[0]->studiengang_kz);
|
||||
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
$courses['semester'][$row_noten->studiensemester_kurzbz]['lvs_nonstpl'][] = array(
|
||||
'lehrveranstaltung_id' => $row_noten->lehrveranstaltung_id,
|
||||
'lehrtyp_kurzbz' => $result_lv->retval[0]->lehrtyp_kurzbz,
|
||||
@@ -212,8 +224,8 @@ class Gradelist extends Auth_Controller
|
||||
'semester' => $result_lv->retval[0]->semester,
|
||||
'note' => $row_noten->note,
|
||||
'datum' => $row_noten->benotungsdatum,
|
||||
'zugeordnet' => true,
|
||||
'studiengang_kurzbz' => $result_stg->retval[0]->kurzbzlang
|
||||
'studiengang_kurzbz' => $studiengang_kz,
|
||||
'zugeordnet' => true
|
||||
);
|
||||
if(!isset($courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl']))
|
||||
$courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl'] = 0;
|
||||
|
||||
@@ -15,10 +15,11 @@ 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);
|
||||
@@ -26,6 +27,10 @@ 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');
|
||||
@@ -37,7 +42,6 @@ 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))
|
||||
@@ -62,14 +66,17 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
$this->NotizModel->addSelect(
|
||||
"tbl_notiz.titel,
|
||||
tbl_notiz.text,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>". $language. " as bezeichnung,
|
||||
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
|
||||
(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');
|
||||
@@ -82,18 +89,22 @@ 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
|
||||
'
|
||||
tag,
|
||||
automatisiert
|
||||
"
|
||||
);
|
||||
$this->NotiztypModel->addOrder('prioritaet');
|
||||
|
||||
@@ -271,6 +282,74 @@ 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,6 +270,28 @@ 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
|
||||
|
||||
@@ -263,59 +263,6 @@ class ProfilLib{
|
||||
$element->mailto = "mailto:" . $element->gruppe_kurzbz . "@" . DOMAIN;
|
||||
return $element;
|
||||
}, $mailverteiler_res);
|
||||
|
||||
$this->ci->load->model("crm/Student_model", "StudentModel");
|
||||
$this->ci->StudentModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_student.student_uid");
|
||||
$this->ci->StudentModel->addJoin("tbl_person", "tbl_benutzer.person_id = tbl_person.person_id");
|
||||
$this->ci->StudentModel->addJoin("tbl_studiengang", "tbl_student.studiengang_kz = tbl_studiengang.studiengang_kz");
|
||||
$this->ci->StudentModel->addSelect("matr_nr, semester, verband, gruppe, kurzbzlang");
|
||||
|
||||
$studentResult = $this->ci->StudentModel->loadWhere(["student_uid" => $uid]);
|
||||
if (isError($studentResult)) {
|
||||
return error(getData($studentResult));
|
||||
}
|
||||
|
||||
$studentResultData = getData($studentResult);
|
||||
$studentData = null;
|
||||
if (is_array($studentResultData) && count($studentResultData)) {
|
||||
$studentData = $studentResultData[0];
|
||||
}
|
||||
|
||||
if ($studentData && $studentData->matr_nr) {
|
||||
$this->ci->load->library("phrasesLib", ["profil"], "phrases");
|
||||
$standardCourseVerteiler = trim($studentData->kurzbzlang) . "_STD";
|
||||
$mailverteiler_res[] = [
|
||||
"beschreibung" => $this->ci->phrases->t('profil', 'alleStudentenVon') . " " . $standardCourseVerteiler,
|
||||
"gruppe_kurzbz" => $standardCourseVerteiler,
|
||||
"mailto" => "mailto:" . strtolower($standardCourseVerteiler) . "@" . DOMAIN,
|
||||
];
|
||||
|
||||
$semesterVerteiler = trim($studentData->kurzbzlang) . trim($studentData->semester);
|
||||
$mailverteiler_res[] = [
|
||||
"beschreibung" => $this->ci->phrases->t('profil', 'alleStudentenVon') . " " . $semesterVerteiler,
|
||||
"gruppe_kurzbz" => $semesterVerteiler,
|
||||
"mailto" => "mailto:" . strtolower($semesterVerteiler) . "@" . DOMAIN,
|
||||
];
|
||||
|
||||
if ($studentData->verband && strlen(trim($studentData->verband))) {
|
||||
$verbandVerteiler = $semesterVerteiler . trim($studentData->verband);
|
||||
$mailverteiler_res[] = [
|
||||
"beschreibung" => $this->ci->phrases->t('profil', 'alleStudentenVon') . " " . $verbandVerteiler,
|
||||
"gruppe_kurzbz" => $verbandVerteiler,
|
||||
"mailto" => "mailto:" . strtolower($verbandVerteiler) . "@" . DOMAIN,
|
||||
];
|
||||
|
||||
if ($studentData->gruppe && strlen(trim($studentData->gruppe))) {
|
||||
$gruppeVerteiler = $verbandVerteiler . trim($studentData->gruppe);
|
||||
$mailverteiler_res[] = [
|
||||
"beschreibung" => $this->ci->phrases->t('profil', 'alleStudentenVon') . " " . $gruppeVerteiler,
|
||||
"gruppe_kurzbz" => $gruppeVerteiler,
|
||||
"mailto" => "mailto:" . strtolower($gruppeVerteiler) . "@" . DOMAIN,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $mailverteiler_res;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,392 @@
|
||||
<?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,8 +47,6 @@ 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');
|
||||
@@ -72,6 +70,13 @@ 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 = 'Interessent'
|
||||
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
|
||||
@@ -129,41 +134,6 @@ 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');
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -283,8 +253,9 @@ class StudentListLib
|
||||
*/
|
||||
public function execute($studiensemester_kurzbz)
|
||||
{
|
||||
$stdsemEsc = $studiensemester_kurzbz ? $this->_ci->PrestudentModel->escape($studiensemester_kurzbz) : 'NULL';
|
||||
$this->addSelectAndJoinForTagsIfConfigured($studiensemester_kurzbz);
|
||||
|
||||
$stdsemEsc = $studiensemester_kurzbz ? $this->_ci->PrestudentModel->escape($studiensemester_kurzbz) : 'NULL';
|
||||
|
||||
$this->addSelect(
|
||||
"public.get_rolle_prestudent(
|
||||
@@ -325,6 +296,72 @@ 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
|
||||
*
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?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,4 +44,56 @@ 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 (
|
||||
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 pss.status_kurzbz = 'Student'
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,10 +190,7 @@ class Projektarbeit_model extends DB_Model
|
||||
campus.tbl_paabgabetyp.bezeichnung,
|
||||
campus.tbl_paabgabetyp.benotbar,
|
||||
campus.tbl_paabgabe.abgabedatum,
|
||||
campus.tbl_paabgabe.insertvon,
|
||||
campus.tbl_paabgabe.insertamum,
|
||||
campus.tbl_paabgabe.updatevon,
|
||||
campus.tbl_paabgabe.updateamum
|
||||
campus.tbl_paabgabe.insertvon
|
||||
FROM campus.tbl_paabgabe JOIN campus.tbl_paabgabetyp USING(paabgabetyp_kurzbz)
|
||||
WHERE campus.tbl_paabgabe.projektarbeit_id = ?
|
||||
ORDER BY campus.tbl_paabgabe.datum";
|
||||
@@ -213,18 +210,7 @@ class Projektarbeit_model extends DB_Model
|
||||
campus.tbl_paabgabetyp.paabgabetyp_kurzbz,
|
||||
campus.tbl_paabgabetyp.bezeichnung,
|
||||
campus.tbl_paabgabe.abgabedatum,
|
||||
campus.tbl_paabgabe.insertvon,
|
||||
campus.tbl_paabgabe.updatevon,
|
||||
campus.tbl_paabgabe.insertamum,
|
||||
campus.tbl_paabgabe.updateamum,
|
||||
(SELECT p.vorname || ' ' || p.nachname
|
||||
FROM public.tbl_benutzer b
|
||||
JOIN public.tbl_person p USING(person_id)
|
||||
WHERE b.uid = campus.tbl_paabgabe.insertvon) AS insertvon_fullname,
|
||||
(SELECT p.vorname || ' ' || p.nachname
|
||||
FROM public.tbl_benutzer b
|
||||
JOIN public.tbl_person p USING(person_id)
|
||||
WHERE b.uid = campus.tbl_paabgabe.updatevon) AS updatevon_fullname
|
||||
campus.tbl_paabgabe.insertvon
|
||||
FROM campus.tbl_paabgabe JOIN campus.tbl_paabgabetyp USING(paabgabetyp_kurzbz)
|
||||
WHERE campus.tbl_paabgabe.projektarbeit_id IN ?
|
||||
ORDER BY campus.tbl_paabgabe.datum";
|
||||
@@ -257,8 +243,7 @@ class Projektarbeit_model extends DB_Model
|
||||
LEFT JOIN public.tbl_benutzer ben USING (person_id)
|
||||
LEFT JOIN public.tbl_mitarbeiter ma ON ben.uid = ma.mitarbeiter_uid
|
||||
WHERE (ben.aktiv OR ben.aktiv IS NULL)
|
||||
AND projektarbeit_id = ?
|
||||
AND lehre.tbl_projektbetreuer.betreuerart_kurzbz = ANY('{Begutachter, Betreuer, Erstbetreuer,Erstbegutachter,Senatsvorsitz}')";
|
||||
AND projektarbeit_id = ?";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, [$projektarbeit_id]);
|
||||
}
|
||||
@@ -312,142 +297,34 @@ class Projektarbeit_model extends DB_Model
|
||||
* Get a List of Projektarbeiten of a mitarbeiter with zuordnung
|
||||
* used by the mitarbeiter cis4 abgabetool.
|
||||
*/
|
||||
public function getMitarbeiterProjektarbeiten($person_id, $showAll){
|
||||
$qry = "WITH secondary_betreuer AS (
|
||||
SELECT DISTINCT ON (pb.projektarbeit_id)
|
||||
pb.projektarbeit_id,
|
||||
pb.person_id AS zweitbetreuer_person_id,
|
||||
b.uid AS zweitbetreuer_benutzer_uid,
|
||||
pb.betreuerart_kurzbz AS zweitbetreuer_betreuerart_kurzbz,
|
||||
ba.beschreibung AS zweitbetreuer_betreuerart_beschreibung,
|
||||
p.titelpre AS zweitbetreuer_titelpre,
|
||||
p.vorname AS zweitbetreuer_vorname,
|
||||
p.nachname AS zweitbetreuer_nachname,
|
||||
p.titelpost AS zweitbetreuer_titelpost,
|
||||
trim(
|
||||
COALESCE(p.titelpre, '') || ' ' ||
|
||||
COALESCE(p.vorname, '') || ' ' ||
|
||||
COALESCE(p.nachname, '') || ' ' ||
|
||||
COALESCE(p.titelpost, '')
|
||||
) AS zweitbetreuer_full_name
|
||||
FROM lehre.tbl_projektbetreuer pb
|
||||
JOIN public.tbl_person p ON p.person_id = pb.person_id
|
||||
LEFT JOIN public.tbl_benutzer b ON b.person_id = p.person_id
|
||||
LEFT JOIN lehre.tbl_betreuerart ba ON ba.betreuerart_kurzbz = pb.betreuerart_kurzbz
|
||||
WHERE pb.betreuerart_kurzbz = ANY('{Zweitbetreuer,Zweitbegutachter,Senatsmitglied}')
|
||||
ORDER BY pb.projektarbeit_id
|
||||
),
|
||||
primary_betreuer AS (
|
||||
SELECT DISTINCT ON (pb.projektarbeit_id)
|
||||
pb.projektarbeit_id,
|
||||
pb.person_id AS betreuer_person_id,
|
||||
pb.betreuerart_kurzbz AS betreuer_betreuerart_kurzbz,
|
||||
ba.beschreibung AS betreuer_betreuerart_beschreibung,
|
||||
p.titelpre AS betreuer_titelpre,
|
||||
p.vorname AS betreuer_vorname,
|
||||
p.nachname AS betreuer_nachname,
|
||||
p.titelpost AS betreuer_titelpost,
|
||||
trim(
|
||||
COALESCE(p.titelpre, '') || ' ' ||
|
||||
COALESCE(p.vorname, '') || ' ' ||
|
||||
COALESCE(p.nachname, '') || ' ' ||
|
||||
COALESCE(p.titelpost, '')
|
||||
) AS betreuer_full_name
|
||||
FROM lehre.tbl_projektbetreuer pb
|
||||
JOIN public.tbl_person p ON p.person_id = pb.person_id
|
||||
LEFT JOIN public.tbl_benutzer b ON b.person_id = p.person_id
|
||||
LEFT JOIN lehre.tbl_betreuerart ba ON ba.betreuerart_kurzbz = pb.betreuerart_kurzbz
|
||||
WHERE pb.betreuerart_kurzbz = ANY('{Begutachter, Betreuer, Erstbetreuer,Erstbegutachter,Senatsvorsitz}')
|
||||
ORDER BY pb.projektarbeit_id
|
||||
)
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
(SELECT DISTINCT ON (tbl_projektarbeit.projektarbeit_id)
|
||||
student_person.vorname, student_person.nachname,
|
||||
tbl_studiengang.typ, tbl_studiengang.kurzbz,
|
||||
tbl_projektarbeit.projekttyp_kurzbz, tbl_projekttyp.bezeichnung,
|
||||
tbl_projektarbeit.titel, tbl_projektarbeit.projektarbeit_id, tbl_projektarbeit.note,
|
||||
student_benutzer.uid, tbl_student.matrikelnr, tbl_lehreinheit.studiensemester_kurzbz, public.tbl_student.student_uid,
|
||||
|
||||
lehre.tbl_projektarbeit.sprache,
|
||||
lehre.tbl_projektarbeit.seitenanzahl,
|
||||
lehre.tbl_projektarbeit.kontrollschlagwoerter,
|
||||
lehre.tbl_projektarbeit.schlagwoerter,
|
||||
lehre.tbl_projektarbeit.schlagwoerter_en,
|
||||
lehre.tbl_projektarbeit.abstract,
|
||||
lehre.tbl_projektarbeit.abstract_en,
|
||||
lehre.tbl_projektarbeit.insertamum,
|
||||
|
||||
(
|
||||
SELECT orgform_kurzbz
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id = (
|
||||
SELECT prestudent_id FROM public.tbl_student
|
||||
WHERE student_uid = student_benutzer.uid LIMIT 1
|
||||
)
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC
|
||||
LIMIT 1
|
||||
) AS organisationsform,
|
||||
(
|
||||
SELECT COALESCE(tbl_studienplan.orgform_kurzbz,
|
||||
tbl_prestudentstatus.orgform_kurzbz,
|
||||
tbl_studiengang.orgform_kurzbz)
|
||||
FROM public.tbl_prestudent
|
||||
JOIN public.tbl_prestudentstatus USING (prestudent_id)
|
||||
JOIN public.tbl_studiensemester USING (studiensemester_kurzbz)
|
||||
JOIN public.tbl_studiengang USING (studiengang_kz)
|
||||
LEFT JOIN lehre.tbl_studienplan USING (studienplan_id)
|
||||
WHERE prestudent_id = public.tbl_student.prestudent_id
|
||||
ORDER BY tbl_prestudentstatus.datum DESC
|
||||
LIMIT 1
|
||||
) AS orgform,
|
||||
(
|
||||
SELECT status_kurzbz
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id = public.tbl_student.prestudent_id
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC
|
||||
LIMIT 1
|
||||
) AS studienstatus,
|
||||
|
||||
pb.betreuer_person_id,
|
||||
pb.betreuer_betreuerart_kurzbz,
|
||||
pb.betreuer_betreuerart_beschreibung,
|
||||
pb.betreuer_titelpre,
|
||||
pb.betreuer_vorname,
|
||||
pb.betreuer_nachname,
|
||||
pb.betreuer_titelpost,
|
||||
pb.betreuer_full_name,
|
||||
|
||||
sb.zweitbetreuer_person_id,
|
||||
sb.zweitbetreuer_benutzer_uid,
|
||||
sb.zweitbetreuer_betreuerart_kurzbz,
|
||||
sb.zweitbetreuer_betreuerart_beschreibung,
|
||||
sb.zweitbetreuer_titelpre,
|
||||
sb.zweitbetreuer_vorname,
|
||||
sb.zweitbetreuer_nachname,
|
||||
sb.zweitbetreuer_titelpost,
|
||||
sb.zweitbetreuer_full_name
|
||||
FROM lehre.tbl_projektarbeit
|
||||
LEFT JOIN public.tbl_benutzer student_benutzer ON student_benutzer.uid = lehre.tbl_projektarbeit.student_uid
|
||||
LEFT JOIN public.tbl_person student_person ON student_benutzer.person_id = student_person.person_id
|
||||
LEFT JOIN public.tbl_student ON student_benutzer.uid = public.tbl_student.student_uid
|
||||
LEFT JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
|
||||
LEFT JOIN public.tbl_studiengang ON public.tbl_student.studiengang_kz = public.tbl_studiengang.studiengang_kz
|
||||
LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
|
||||
LEFT JOIN lehre.tbl_projektbetreuer USING (projektarbeit_id)
|
||||
LEFT JOIN primary_betreuer pb ON pb.projektarbeit_id = tbl_projektarbeit.projektarbeit_id
|
||||
LEFT JOIN secondary_betreuer sb ON sb.projektarbeit_id = tbl_projektarbeit.projektarbeit_id
|
||||
WHERE (projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom')
|
||||
AND (pb.betreuer_person_id = ? OR sb.zweitbetreuer_person_id = ?)
|
||||
".($showAll?'':' AND student_benutzer.aktiv AND lehre.tbl_projektarbeit.note IS NULL ')."
|
||||
public function getMitarbeiterProjektarbeiten($uid, $showAll){
|
||||
$qry = "SELECT
|
||||
*
|
||||
FROM
|
||||
(SELECT tbl_person.vorname, tbl_person.nachname, tbl_studiengang.typ, tbl_studiengang.kurzbz,
|
||||
tbl_projektarbeit.projekttyp_kurzbz, tbl_projekttyp.bezeichnung, tbl_projektarbeit.titel, tbl_projektarbeit.projektarbeit_id, tbl_projektarbeit.note,
|
||||
tbl_projektbetreuer.person_id as betreuer_person_id, tbl_projektbetreuer.betreuerart_kurzbz, tbl_betreuerart.beschreibung AS betreuerart_beschreibung,
|
||||
tbl_benutzer.uid, tbl_student.matrikelnr, tbl_lehreinheit.studiensemester_kurzbz, public.tbl_student.student_uid
|
||||
FROM lehre.tbl_projektarbeit
|
||||
LEFT JOIN lehre.tbl_projektbetreuer using(projektarbeit_id)
|
||||
LEFT JOIN lehre.tbl_betreuerart using(betreuerart_kurzbz)
|
||||
LEFT JOIN public.tbl_benutzer on(uid=student_uid)
|
||||
LEFT JOIN public.tbl_student on(public.tbl_benutzer.uid=public.tbl_student.student_uid)
|
||||
LEFT JOIN public.tbl_person on(tbl_benutzer.person_id=tbl_person.person_id)
|
||||
LEFT JOIN lehre.tbl_lehreinheit using(lehreinheit_id)
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung using(lehrveranstaltung_id)
|
||||
LEFT JOIN public.tbl_studiengang on(lehre.tbl_lehrveranstaltung.studiengang_kz=public.tbl_studiengang.studiengang_kz)
|
||||
LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
|
||||
WHERE (projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom')
|
||||
AND tbl_projektbetreuer.person_id IN (SELECT person_id FROM public.tbl_benutzer
|
||||
WHERE public.tbl_benutzer.person_id=lehre.tbl_projektbetreuer.person_id
|
||||
AND public.tbl_benutzer.uid= ? )
|
||||
".($showAll?'':' AND public.tbl_benutzer.aktiv AND lehre.tbl_projektarbeit.note IS NULL ')."
|
||||
AND betreuerart_kurzbz IN ('Betreuer', 'Begutachter', 'Erstbegutachter', 'Zweitbegutachter', 'Erstbetreuer', 'Senatsvorsitz', 'Senatsmitglied')
|
||||
ORDER BY tbl_projektarbeit.projektarbeit_id, betreuerart_kurzbz desc) as xy
|
||||
ORDER BY tbl_projektarbeit.projektarbeit_id, betreuerart_kurzbz desc) as xy
|
||||
ORDER BY nachname;";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($person_id, $person_id));
|
||||
return $this->execReadOnlyQuery($qry, array($uid));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -467,257 +344,176 @@ class Projektarbeit_model extends DB_Model
|
||||
|
||||
|
||||
public function getProjektarbeitenForStudiengang($studiengang_kz, $benotet) {
|
||||
$new_qry = "WITH secondary_betreuer AS (
|
||||
SELECT DISTINCT ON (pb.projektarbeit_id)
|
||||
pb.projektarbeit_id,
|
||||
pb.person_id AS zweitbetreuer_person_id,
|
||||
pb.betreuerart_kurzbz AS zweitbetreuer_betreuerart_kurzbz,
|
||||
ba.beschreibung AS zweitbetreuer_betreuerart_beschreibung,
|
||||
p.titelpre AS zweitbetreuer_titelpre,
|
||||
p.vorname AS zweitbetreuer_vorname,
|
||||
p.nachname AS zweitbetreuer_nachname,
|
||||
p.titelpost AS zweitbetreuer_titelpost,
|
||||
trim(
|
||||
COALESCE(p.titelpre, '') || ' ' ||
|
||||
COALESCE(p.vorname, '') || ' ' ||
|
||||
COALESCE(p.nachname, '') || ' ' ||
|
||||
COALESCE(p.titelpost, '')
|
||||
) AS zweitbetreuer_full_name
|
||||
FROM lehre.tbl_projektbetreuer pb
|
||||
JOIN public.tbl_person p ON p.person_id = pb.person_id
|
||||
LEFT JOIN public.tbl_benutzer b ON b.person_id = p.person_id
|
||||
LEFT JOIN lehre.tbl_betreuerart ba ON ba.betreuerart_kurzbz = pb.betreuerart_kurzbz
|
||||
WHERE pb.betreuerart_kurzbz = ANY('{Zweitbetreuer,Zweitbegutachter,Senatsmitglied}')
|
||||
ORDER BY pb.projektarbeit_id -- DISTINCT ON needs this to be deterministic
|
||||
)
|
||||
$new_qry = "SELECT DISTINCT ON(tmp.projektarbeit_id) *, campus.get_betreuer_details(tmp.zweitbetreuer_person_id) as zweitbetreuer_full_name, campus.get_betreuer_details(tmp.betreuer_person_id) as erstbetreuer_full_name
|
||||
FROM(
|
||||
SELECT
|
||||
DISTINCT ON(tbl_projektarbeit.projektarbeit_id)
|
||||
tbl_projektarbeit.projekttyp_kurzbz,
|
||||
tbl_projektarbeit.titel,
|
||||
tbl_projektarbeit.projektarbeit_id,
|
||||
tbl_studiengang.typ, tbl_studiengang.kurzbz,
|
||||
student_benutzer.uid as student_uid,
|
||||
student_person.vorname as student_vorname,
|
||||
student_person.nachname as student_nachname,
|
||||
tbl_student.matrikelnr, tbl_lehreinheit.studiensemester_kurzbz,
|
||||
betreuer_benutzer.uid as betreuer_benutzer_uid,
|
||||
betreuer_person.titelpre as betreuer_titelpre,
|
||||
betreuer_person.vorname as betreuer_vorname,
|
||||
betreuer_person.nachname as betreuer_nachname,
|
||||
betreuer_person.titelpost as betreuer_titelpost,
|
||||
lehre.tbl_projektbetreuer.betreuerart_kurzbz as betreuerart,
|
||||
lehre.tbl_projektbetreuer.person_id as betreuer_person_id,
|
||||
lehre.tbl_projektarbeit.sprache as sprache,
|
||||
lehre.tbl_projektarbeit.seitenanzahl as seitenanzahl,
|
||||
lehre.tbl_projektarbeit.kontrollschlagwoerter as kontrollschlagwoerter,
|
||||
lehre.tbl_projektarbeit.schlagwoerter as schlagwoerter,
|
||||
lehre.tbl_projektarbeit.schlagwoerter_en as schlagwoerter_en,
|
||||
lehre.tbl_projektarbeit.abstract as abstract,
|
||||
lehre.tbl_projektarbeit.abstract_en as abstract_en,
|
||||
lehre.tbl_projektarbeit.insertamum as insertamum,
|
||||
lehre.tbl_projektarbeit.note as note,
|
||||
(
|
||||
SELECT orgform_kurzbz
|
||||
FROM tbl_prestudentstatus
|
||||
WHERE prestudent_id = (SELECT prestudent_id
|
||||
FROM tbl_student
|
||||
WHERE student_uid = student_benutzer.uid
|
||||
LIMIT 1)
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC
|
||||
LIMIT 1
|
||||
)
|
||||
as organisationsform,
|
||||
(
|
||||
SELECT person_id
|
||||
FROM lehre.tbl_projektbetreuer
|
||||
WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id
|
||||
AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter', 'Senatsmitglied')
|
||||
LIMIT 1
|
||||
)
|
||||
AS zweitbetreuer_person_id,
|
||||
(
|
||||
SELECT betreuerart_kurzbz
|
||||
FROM lehre.tbl_projektbetreuer
|
||||
WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id
|
||||
AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter', 'Senatsmitglied')
|
||||
LIMIT 1
|
||||
)
|
||||
AS zweitbetreuer_betreuerart_kurzbz,
|
||||
(
|
||||
SELECT tbl_betreuerart.beschreibung
|
||||
FROM lehre.tbl_projektbetreuer
|
||||
JOIN lehre.tbl_betreuerart USING (betreuerart_kurzbz)
|
||||
WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id
|
||||
AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter', 'Senatsmitglied')
|
||||
LIMIT 1
|
||||
)
|
||||
AS zweitbetreuer_betreuerart_beschreibung,
|
||||
(
|
||||
SELECT trim(COALESCE(titelpre, '') || ' ' || COALESCE(vorname, '') || ' ' || COALESCE(nachname, '') || ' ' ||
|
||||
COALESCE(titelpost, ''))
|
||||
FROM public.tbl_person
|
||||
JOIN lehre.tbl_projektbetreuer ON (lehre.tbl_projektbetreuer.person_id = public.tbl_person.person_id)
|
||||
LEFT JOIN public.tbl_benutzer ON (public.tbl_benutzer.person_id = public.tbl_person.person_id)
|
||||
LEFT JOIN public.tbl_mitarbeiter ON (public.tbl_benutzer.uid = public.tbl_mitarbeiter.mitarbeiter_uid)
|
||||
WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id
|
||||
AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter', 'Senatsmitglied')
|
||||
LIMIT 1
|
||||
)
|
||||
as zweitbetreuer_full_name,
|
||||
(
|
||||
SELECT titelpre
|
||||
FROM public.tbl_person
|
||||
JOIN lehre.tbl_projektbetreuer ON (lehre.tbl_projektbetreuer.person_id = public.tbl_person.person_id)
|
||||
LEFT JOIN public.tbl_benutzer ON (public.tbl_benutzer.person_id = public.tbl_person.person_id)
|
||||
LEFT JOIN public.tbl_mitarbeiter ON (public.tbl_benutzer.uid = public.tbl_mitarbeiter.mitarbeiter_uid)
|
||||
WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id
|
||||
AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter', 'Senatsmitglied')
|
||||
LIMIT 1
|
||||
)
|
||||
as zweitbetreuer_titelpre,
|
||||
(
|
||||
SELECT vorname
|
||||
FROM public.tbl_person
|
||||
JOIN lehre.tbl_projektbetreuer ON (lehre.tbl_projektbetreuer.person_id = public.tbl_person.person_id)
|
||||
LEFT JOIN public.tbl_benutzer ON (public.tbl_benutzer.person_id = public.tbl_person.person_id)
|
||||
LEFT JOIN public.tbl_mitarbeiter ON (public.tbl_benutzer.uid = public.tbl_mitarbeiter.mitarbeiter_uid)
|
||||
WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id
|
||||
AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter', 'Senatsmitglied')
|
||||
LIMIT 1
|
||||
)
|
||||
as zweitbetreuer_vorname,
|
||||
(
|
||||
SELECT nachname
|
||||
FROM public.tbl_person
|
||||
JOIN lehre.tbl_projektbetreuer ON (lehre.tbl_projektbetreuer.person_id = public.tbl_person.person_id)
|
||||
LEFT JOIN public.tbl_benutzer ON (public.tbl_benutzer.person_id = public.tbl_person.person_id)
|
||||
LEFT JOIN public.tbl_mitarbeiter ON (public.tbl_benutzer.uid = public.tbl_mitarbeiter.mitarbeiter_uid)
|
||||
WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id
|
||||
AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter', 'Senatsmitglied')
|
||||
LIMIT 1
|
||||
)
|
||||
as zweitbetreuer_nachname,
|
||||
(
|
||||
SELECT titelpost
|
||||
FROM public.tbl_person
|
||||
JOIN lehre.tbl_projektbetreuer ON (lehre.tbl_projektbetreuer.person_id = public.tbl_person.person_id)
|
||||
LEFT JOIN public.tbl_benutzer ON (public.tbl_benutzer.person_id = public.tbl_person.person_id)
|
||||
LEFT JOIN public.tbl_mitarbeiter ON (public.tbl_benutzer.uid = public.tbl_mitarbeiter.mitarbeiter_uid)
|
||||
WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id
|
||||
AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter', 'Senatsmitglied')
|
||||
LIMIT 1
|
||||
)
|
||||
as zweitbetreuer_titelpost,
|
||||
(
|
||||
SELECT
|
||||
COALESCE(tbl_studienplan.orgform_kurzbz,
|
||||
tbl_prestudentstatus.orgform_kurzbz, tbl_studiengang.orgform_kurzbz) as
|
||||
orgform
|
||||
FROM
|
||||
public.tbl_prestudent
|
||||
JOIN public.tbl_prestudentstatus USING(prestudent_id)
|
||||
JOIN public.tbl_studiensemester USING(studiensemester_kurzbz)
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
LEFT JOIN lehre.tbl_studienplan USING(studienplan_id)
|
||||
WHERE
|
||||
prestudent_id=tbl_student.prestudent_id
|
||||
ORDER BY tbl_prestudentstatus.datum DESC LIMIT 1
|
||||
) as orgform,
|
||||
(SELECT status_kurzbz FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id=tbl_student.prestudent_id
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC LIMIT 1) as studienstatus
|
||||
FROM lehre.tbl_projektarbeit
|
||||
LEFT JOIN public.tbl_benutzer student_benutzer ON (student_benutzer.uid = lehre.tbl_projektarbeit.student_uid)
|
||||
LEFT JOIN public.tbl_person student_person ON (student_benutzer.person_id = student_person.person_id)
|
||||
LEFT JOIN public.tbl_student on(student_benutzer.uid = public.tbl_student.student_uid)
|
||||
LEFT JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
|
||||
LEFT JOIN public.tbl_studiengang ON (public.tbl_student.studiengang_kz = public.tbl_studiengang.studiengang_kz)
|
||||
LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
|
||||
LEFT JOIN lehre.tbl_projektbetreuer USING (projektarbeit_id)
|
||||
LEFT JOIN public.tbl_person betreuer_person ON (betreuer_person.person_id = lehre.tbl_projektbetreuer.person_id)
|
||||
LEFT JOIN public.tbl_benutzer betreuer_benutzer ON (betreuer_person.person_id = betreuer_benutzer.person_id)
|
||||
WHERE (projekttyp_kurzbz = 'Bachelor' OR projekttyp_kurzbz = 'Diplom')
|
||||
AND student_benutzer.aktiv AND (
|
||||
lehre.tbl_projektbetreuer.betreuerart_kurzbz = 'Erstbegutachter'
|
||||
OR lehre.tbl_projektbetreuer.betreuerart_kurzbz = 'Begutachter'
|
||||
OR lehre.tbl_projektbetreuer.betreuerart_kurzbz = 'Betreuer'
|
||||
OR lehre.tbl_projektbetreuer.betreuerart_kurzbz = 'Erstbetreuer'
|
||||
OR lehre.tbl_projektbetreuer.betreuerart_kurzbz = 'Senatsvorsitz'
|
||||
)
|
||||
AND public.tbl_studiengang.studiengang_kz = ?";
|
||||
|
||||
SELECT DISTINCT ON (tmp.projektarbeit_id)
|
||||
*,
|
||||
campus.get_betreuer_details(tmp.zweitbetreuer_person_id) AS zweitbetreuer_full_name,
|
||||
campus.get_betreuer_details(tmp.betreuer_person_id) AS erstbetreuer_full_name
|
||||
FROM (
|
||||
SELECT DISTINCT ON (tbl_projektarbeit.projektarbeit_id)
|
||||
tbl_projektarbeit.projekttyp_kurzbz,
|
||||
tbl_projektarbeit.titel,
|
||||
tbl_projektarbeit.projektarbeit_id,
|
||||
tbl_studiengang.typ,
|
||||
tbl_studiengang.kurzbz,
|
||||
student_benutzer.uid AS student_uid,
|
||||
student_person.vorname AS student_vorname,
|
||||
student_person.nachname AS student_nachname,
|
||||
public.tbl_student.matrikelnr,
|
||||
tbl_lehreinheit.studiensemester_kurzbz,
|
||||
betreuer_benutzer.uid AS betreuer_benutzer_uid,
|
||||
betreuer_person.titelpre AS betreuer_titelpre,
|
||||
betreuer_person.vorname AS betreuer_vorname,
|
||||
betreuer_person.nachname AS betreuer_nachname,
|
||||
betreuer_person.titelpost AS betreuer_titelpost,
|
||||
lehre.tbl_projektbetreuer.betreuerart_kurzbz AS betreuerart,
|
||||
lehre.tbl_projektbetreuer.person_id AS betreuer_person_id,
|
||||
lehre.tbl_projektarbeit.sprache,
|
||||
lehre.tbl_projektarbeit.seitenanzahl,
|
||||
lehre.tbl_projektarbeit.kontrollschlagwoerter,
|
||||
lehre.tbl_projektarbeit.schlagwoerter,
|
||||
lehre.tbl_projektarbeit.schlagwoerter_en,
|
||||
lehre.tbl_projektarbeit.abstract,
|
||||
lehre.tbl_projektarbeit.abstract_en,
|
||||
lehre.tbl_projektarbeit.insertamum,
|
||||
lehre.tbl_projektarbeit.note,
|
||||
|
||||
sb.zweitbetreuer_person_id,
|
||||
sb.zweitbetreuer_betreuerart_kurzbz,
|
||||
sb.zweitbetreuer_betreuerart_beschreibung,
|
||||
sb.zweitbetreuer_full_name,
|
||||
sb.zweitbetreuer_titelpre,
|
||||
sb.zweitbetreuer_vorname,
|
||||
sb.zweitbetreuer_nachname,
|
||||
sb.zweitbetreuer_titelpost,
|
||||
|
||||
(
|
||||
SELECT orgform_kurzbz
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id = (
|
||||
SELECT prestudent_id FROM public.tbl_student
|
||||
WHERE student_uid = student_benutzer.uid LIMIT 1
|
||||
)
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC
|
||||
LIMIT 1
|
||||
) AS organisationsform,
|
||||
(
|
||||
SELECT COALESCE(tbl_studienplan.orgform_kurzbz,
|
||||
tbl_prestudentstatus.orgform_kurzbz,
|
||||
tbl_studiengang.orgform_kurzbz)
|
||||
FROM public.tbl_prestudent
|
||||
JOIN public.tbl_prestudentstatus USING (prestudent_id)
|
||||
JOIN public.tbl_studiensemester USING (studiensemester_kurzbz)
|
||||
JOIN public.tbl_studiengang USING (studiengang_kz)
|
||||
LEFT JOIN lehre.tbl_studienplan USING (studienplan_id)
|
||||
WHERE prestudent_id = public.tbl_student.prestudent_id
|
||||
ORDER BY tbl_prestudentstatus.datum DESC
|
||||
LIMIT 1
|
||||
) AS orgform,
|
||||
(
|
||||
SELECT status_kurzbz
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id = public.tbl_student.prestudent_id
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC
|
||||
LIMIT 1
|
||||
) AS studienstatus
|
||||
|
||||
FROM lehre.tbl_projektarbeit
|
||||
LEFT JOIN public.tbl_benutzer student_benutzer ON student_benutzer.uid = lehre.tbl_projektarbeit.student_uid
|
||||
LEFT JOIN public.tbl_person student_person ON student_benutzer.person_id = student_person.person_id
|
||||
LEFT JOIN public.tbl_student ON student_benutzer.uid = public.tbl_student.student_uid
|
||||
LEFT JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
|
||||
LEFT JOIN public.tbl_studiengang ON public.tbl_student.studiengang_kz = public.tbl_studiengang.studiengang_kz
|
||||
LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
|
||||
LEFT JOIN lehre.tbl_projektbetreuer USING (projektarbeit_id)
|
||||
LEFT JOIN public.tbl_person betreuer_person ON betreuer_person.person_id = lehre.tbl_projektbetreuer.person_id
|
||||
LEFT JOIN public.tbl_benutzer betreuer_benutzer ON betreuer_person.person_id = betreuer_benutzer.person_id
|
||||
LEFT JOIN secondary_betreuer sb ON sb.projektarbeit_id = tbl_projektarbeit.projektarbeit_id
|
||||
|
||||
WHERE (projekttyp_kurzbz = 'Bachelor' OR projekttyp_kurzbz = 'Diplom')
|
||||
AND student_benutzer.aktiv
|
||||
AND lehre.tbl_projektbetreuer.betreuerart_kurzbz IN (
|
||||
'Erstbegutachter', 'Begutachter', 'Betreuer', 'Erstbetreuer', 'Senatsvorsitz'
|
||||
)
|
||||
AND public.tbl_studiengang.studiengang_kz = ?";
|
||||
|
||||
if($benotet == 0) {
|
||||
$new_qry .= " AND lehre.tbl_projektarbeit.note IS NULL ";
|
||||
} else if ($benotet == 1) {
|
||||
$new_qry .= " AND lehre.tbl_projektarbeit.note IS NOT NULL ";
|
||||
}
|
||||
|
||||
$new_qry .= " ORDER BY tbl_projektarbeit.projektarbeit_id DESC, student_person.nachname ASC
|
||||
if($benotet == 0) {
|
||||
$new_qry .= " AND lehre.tbl_projektarbeit.note IS NULL ";
|
||||
} else if ($benotet == 1) {
|
||||
$new_qry .= " AND lehre.tbl_projektarbeit.note IS NOT NULL ";
|
||||
}
|
||||
|
||||
$new_qry .= " ORDER BY tbl_projektarbeit.projektarbeit_id DESC, student_person.nachname ASC
|
||||
) as tmp";
|
||||
|
||||
return $this->execReadOnlyQuery($new_qry, array($studiengang_kz));
|
||||
}
|
||||
|
||||
public function getProjektarbeitenForStudent($student_uid) {
|
||||
$new_qry = "WITH secondary_betreuer AS (
|
||||
SELECT DISTINCT ON (pb.projektarbeit_id)
|
||||
pb.projektarbeit_id,
|
||||
pb.person_id AS zweitbetreuer_person_id,
|
||||
pb.betreuerart_kurzbz AS zweitbetreuer_betreuerart_kurzbz,
|
||||
ba.beschreibung AS zweitbetreuer_betreuerart_beschreibung,
|
||||
p.titelpre AS zweitbetreuer_titelpre,
|
||||
p.vorname AS zweitbetreuer_vorname,
|
||||
p.nachname AS zweitbetreuer_nachname,
|
||||
p.titelpost AS zweitbetreuer_titelpost,
|
||||
trim(
|
||||
COALESCE(p.titelpre, '') || ' ' ||
|
||||
COALESCE(p.vorname, '') || ' ' ||
|
||||
COALESCE(p.nachname, '') || ' ' ||
|
||||
COALESCE(p.titelpost, '')
|
||||
) AS zweitbetreuer_full_name
|
||||
FROM lehre.tbl_projektbetreuer pb
|
||||
JOIN public.tbl_person p ON p.person_id = pb.person_id
|
||||
LEFT JOIN public.tbl_benutzer b ON b.person_id = p.person_id
|
||||
LEFT JOIN lehre.tbl_betreuerart ba ON ba.betreuerart_kurzbz = pb.betreuerart_kurzbz
|
||||
WHERE pb.betreuerart_kurzbz = ANY('{Zweitbetreuer,Zweitbegutachter,Senatsmitglied}')
|
||||
ORDER BY pb.projektarbeit_id -- DISTINCT ON needs this to be deterministic
|
||||
)
|
||||
|
||||
SELECT DISTINCT ON (tmp.projektarbeit_id)
|
||||
*,
|
||||
campus.get_betreuer_details(tmp.zweitbetreuer_person_id) AS zweitbetreuer_full_name,
|
||||
campus.get_betreuer_details(tmp.betreuer_person_id) AS erstbetreuer_full_name
|
||||
FROM (
|
||||
SELECT DISTINCT ON (tbl_projektarbeit.projektarbeit_id)
|
||||
tbl_projektarbeit.projekttyp_kurzbz,
|
||||
tbl_projektarbeit.titel,
|
||||
tbl_projektarbeit.projektarbeit_id,
|
||||
tbl_studiengang.typ,
|
||||
tbl_studiengang.kurzbz,
|
||||
student_benutzer.uid AS student_uid,
|
||||
student_person.vorname AS student_vorname,
|
||||
student_person.nachname AS student_nachname,
|
||||
public.tbl_student.matrikelnr,
|
||||
tbl_lehreinheit.studiensemester_kurzbz,
|
||||
betreuer_benutzer.uid AS betreuer_benutzer_uid,
|
||||
betreuer_person.titelpre AS betreuer_titelpre,
|
||||
betreuer_person.vorname AS betreuer_vorname,
|
||||
betreuer_person.nachname AS betreuer_nachname,
|
||||
betreuer_person.titelpost AS betreuer_titelpost,
|
||||
lehre.tbl_projektbetreuer.betreuerart_kurzbz AS betreuerart,
|
||||
lehre.tbl_projektbetreuer.person_id AS betreuer_person_id,
|
||||
lehre.tbl_projektarbeit.sprache,
|
||||
lehre.tbl_projektarbeit.seitenanzahl,
|
||||
lehre.tbl_projektarbeit.kontrollschlagwoerter,
|
||||
lehre.tbl_projektarbeit.schlagwoerter,
|
||||
lehre.tbl_projektarbeit.schlagwoerter_en,
|
||||
lehre.tbl_projektarbeit.abstract,
|
||||
lehre.tbl_projektarbeit.abstract_en,
|
||||
lehre.tbl_projektarbeit.insertamum,
|
||||
lehre.tbl_projektarbeit.note,
|
||||
|
||||
sb.zweitbetreuer_person_id,
|
||||
sb.zweitbetreuer_betreuerart_kurzbz,
|
||||
sb.zweitbetreuer_betreuerart_beschreibung,
|
||||
sb.zweitbetreuer_full_name,
|
||||
sb.zweitbetreuer_titelpre,
|
||||
sb.zweitbetreuer_vorname,
|
||||
sb.zweitbetreuer_nachname,
|
||||
sb.zweitbetreuer_titelpost,
|
||||
|
||||
(
|
||||
SELECT orgform_kurzbz
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id = (
|
||||
SELECT prestudent_id FROM public.tbl_student
|
||||
WHERE student_uid = student_benutzer.uid LIMIT 1
|
||||
)
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC
|
||||
LIMIT 1
|
||||
) AS organisationsform,
|
||||
(
|
||||
SELECT COALESCE(tbl_studienplan.orgform_kurzbz,
|
||||
tbl_prestudentstatus.orgform_kurzbz,
|
||||
tbl_studiengang.orgform_kurzbz)
|
||||
FROM public.tbl_prestudent
|
||||
JOIN public.tbl_prestudentstatus USING (prestudent_id)
|
||||
JOIN public.tbl_studiensemester USING (studiensemester_kurzbz)
|
||||
JOIN public.tbl_studiengang USING (studiengang_kz)
|
||||
LEFT JOIN lehre.tbl_studienplan USING (studienplan_id)
|
||||
WHERE prestudent_id = public.tbl_student.prestudent_id
|
||||
ORDER BY tbl_prestudentstatus.datum DESC
|
||||
LIMIT 1
|
||||
) AS orgform,
|
||||
(
|
||||
SELECT status_kurzbz
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id = public.tbl_student.prestudent_id
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC
|
||||
LIMIT 1
|
||||
) AS studienstatus
|
||||
|
||||
FROM lehre.tbl_projektarbeit
|
||||
LEFT JOIN public.tbl_benutzer student_benutzer ON student_benutzer.uid = lehre.tbl_projektarbeit.student_uid
|
||||
LEFT JOIN public.tbl_person student_person ON student_benutzer.person_id = student_person.person_id
|
||||
LEFT JOIN public.tbl_student ON student_benutzer.uid = public.tbl_student.student_uid
|
||||
LEFT JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
|
||||
LEFT JOIN public.tbl_studiengang ON public.tbl_student.studiengang_kz = public.tbl_studiengang.studiengang_kz
|
||||
LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
|
||||
LEFT JOIN lehre.tbl_projektbetreuer USING (projektarbeit_id)
|
||||
LEFT JOIN public.tbl_person betreuer_person ON betreuer_person.person_id = lehre.tbl_projektbetreuer.person_id
|
||||
LEFT JOIN public.tbl_benutzer betreuer_benutzer ON betreuer_person.person_id = betreuer_benutzer.person_id
|
||||
LEFT JOIN secondary_betreuer sb ON sb.projektarbeit_id = tbl_projektarbeit.projektarbeit_id
|
||||
|
||||
WHERE (projekttyp_kurzbz = 'Bachelor' OR projekttyp_kurzbz = 'Diplom')
|
||||
AND student_benutzer.aktiv
|
||||
AND lehre.tbl_projektbetreuer.betreuerart_kurzbz IN (
|
||||
'Erstbegutachter', 'Begutachter', 'Betreuer', 'Erstbetreuer', 'Senatsvorsitz'
|
||||
)
|
||||
AND public.tbl_student.student_uid = ?
|
||||
ORDER BY tbl_projektarbeit.projektarbeit_id DESC, student_person.nachname ASC
|
||||
) as tmp";
|
||||
|
||||
return $this->execReadOnlyQuery($new_qry, array($student_uid));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -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,5 +350,64 @@ 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,4 +296,59 @@ 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)
|
||||
public function searchPerson($filter, $mode=null)
|
||||
{
|
||||
$this->addSelect('vorname, nachname, gebdatum, person_id, titelpre, titelpost');
|
||||
$this->addSelect("CASE
|
||||
@@ -161,6 +161,26 @@ 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.'%')."
|
||||
@@ -433,4 +453,33 @@ 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]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ $includesArray = array(
|
||||
|
||||
$this->load->view('templates/FHC-Header', $includesArray);
|
||||
?>
|
||||
<div id="abgabetoolroot" class="h-100" style="max-width: 99%" route=<?php echo json_encode($route) ?>
|
||||
<div id="abgabetoolroot" class="h-100" style="max-width: 95%;" route=<?php echo json_encode($route) ?>
|
||||
uid=<?php echo $uid ?>
|
||||
student_uid_prop="<?php echo $student_uid_prop ?? '' ?>"
|
||||
stg_kz_prop="<?php echo $stg_kz_prop ?? '' ?>"
|
||||
|
||||
@@ -5,6 +5,11 @@ $includesArray = array(
|
||||
'bootstrap5' => true,
|
||||
'fontawesome6' => true,
|
||||
'axios027' => true,
|
||||
'primevue3' => true,
|
||||
'vuedatepicker11' => true,
|
||||
'customJSs' => array_merge([
|
||||
'vendor/moment/luxonjs/luxon.min.js'
|
||||
], $customJSs ?? []),
|
||||
'customJSModules' => array_merge([
|
||||
'public/js/apps/Cis/Menu.js'
|
||||
], $customJSModules ?? []),
|
||||
|
||||
@@ -7,6 +7,10 @@ $includesArray = array(
|
||||
'fontawesome6' => true,
|
||||
'axios027' => true,
|
||||
'primevue3' => true,
|
||||
'vuedatepicker11' => true,
|
||||
'customJSs' => array_merge([
|
||||
'vendor/moment/luxonjs/luxon.min.js'
|
||||
], $customJSs ?? []),
|
||||
'customJSModules' => array_merge([
|
||||
'public/js/apps/Cis/Menu.js'
|
||||
], $customJSModules ?? []),
|
||||
@@ -36,4 +40,4 @@ $this->load->view('templates/FHC-Header', $includesArray);
|
||||
></cis-menu>
|
||||
</header>
|
||||
|
||||
<main id="cis-main" class="flex-grow-1 p-4 pt-2" style="min-width: 0;">
|
||||
<main id="cis-main" class="flex-grow-1 p-4 pt-2" style="min-width: 0;">
|
||||
|
||||
@@ -132,7 +132,11 @@
|
||||
if ($cis === true) generateCSSsInclude(defined('CIS4') ? 'public/css/cis4.css' : 'public/css/cis_bs5.css');
|
||||
|
||||
//Tags
|
||||
if ($tags === true) generateCSSsInclude('public/css/tags.css');
|
||||
if ($tags === true)
|
||||
{
|
||||
generateCSSsInclude('public/css/tags.css');
|
||||
generateCSSsIncludeIfExtensionCssExists('tags.css');
|
||||
}
|
||||
|
||||
$extapphelper = ExtendableAppsHelper::getInstance();
|
||||
$extapphelper->init($customCSSs, $customJSs, $customJSModules);
|
||||
|
||||
@@ -350,7 +350,7 @@ class benutzerberechtigung extends basis_db
|
||||
};
|
||||
$roles = defined('STUDENTS_KEEP_PERMISSIONS_AFTER_USER_INACTIVE_ROLES')
|
||||
? implode(', ', array_map($mapfunc, unserialize(STUDENTS_KEEP_PERMISSIONS_AFTER_USER_INACTIVE_ROLES)))
|
||||
: "'NO_DEFINED_ROLE'";
|
||||
: 'NO_DEFINED_ROLE';
|
||||
|
||||
$sql = <<<EOSQL
|
||||
SELECT
|
||||
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "FHC-Core",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
@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';
|
||||
|
||||
@@ -305,104 +305,4 @@
|
||||
/* If you use hover rows, you need to ensure the sticky cell matches the hover color */
|
||||
#abgabetable .tabulator-row:hover .tabulator-cell.sticky-col {
|
||||
background-color: #ccc; /* Match your existing hover color */
|
||||
}
|
||||
|
||||
.tabulator-cell {
|
||||
container-type: inline-size;
|
||||
}
|
||||
|
||||
.tabulator-col-title {
|
||||
container-type: inline-size;
|
||||
}
|
||||
|
||||
@container (max-width: 100px) {
|
||||
.full-text {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.short-text {
|
||||
display: inline-block !important;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/*conditional tooltips fix*/
|
||||
.p-tooltip.custom-tooltip {
|
||||
z-index: 8001 !important;
|
||||
}
|
||||
|
||||
/* Shrinks font and table rows for desktop users who have zoomed in their browser (150%+).
|
||||
Does not affect mobile/touchscreen devices, which use touch input instead of a mouse. */
|
||||
@media (pointer: fine) and (min-resolution: 1.5dppx) {
|
||||
|
||||
html.abgabetool {
|
||||
font-size: 0.5rem;
|
||||
}
|
||||
|
||||
.abgabetool .tabulator-cell,
|
||||
.abgabetool .tabulator-row {
|
||||
height: 20px;
|
||||
max-height: 20px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*confetti celebration on endupload - impossible to miss*/
|
||||
#confetti-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
pointer-events: none;
|
||||
z-index: 9999;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.confetti-piece {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
will-change: top, transform, opacity;
|
||||
}
|
||||
|
||||
/* Background Rain */
|
||||
@keyframes fallAndSpin {
|
||||
0% {
|
||||
top: var(--start-y);
|
||||
transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg);
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
top: 105vh;
|
||||
transform: translate3d(var(--drift), 0, 0) rotateX(720deg) rotateY(360deg);
|
||||
opacity: 0.3;
|
||||
}
|
||||
}
|
||||
|
||||
/* Corner Cannons*/
|
||||
@keyframes cannonBlast {
|
||||
0% {
|
||||
transform: translate3d(0, 0, 0) scale(0.3) rotate(0deg);
|
||||
opacity: 1;
|
||||
animation-timing-function: cubic-bezier(0.1, 0.8, 0.2, 1);
|
||||
}
|
||||
30% {
|
||||
transform: translate3d(var(--blast-x), var(--blast-y), 0) scale(1.2) rotate(270deg);
|
||||
opacity: 1;
|
||||
animation-timing-function: linear;
|
||||
}
|
||||
100% {
|
||||
transform: translate3d(calc(var(--blast-x) * 1.4), 15vh, 0) scale(0.4) rotate(630deg);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.p-timeline-event-opposite {
|
||||
flex: 0 0 90px;
|
||||
max-width: 90px;
|
||||
}
|
||||
|
||||
.p-timeline-event-content {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
: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;
|
||||
}
|
||||
+6
-1
@@ -69,12 +69,17 @@
|
||||
|
||||
.tag_limette {
|
||||
background-color: #D3FFCE;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.tag_done {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.tag_auto {
|
||||
border: 1px dashed white;
|
||||
}
|
||||
|
||||
.display_all {
|
||||
background-color: darkgrey !important;
|
||||
border: none;
|
||||
@@ -111,4 +116,4 @@
|
||||
.copy-btn {
|
||||
float: right;
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,13 +77,6 @@ export default {
|
||||
}
|
||||
};
|
||||
},
|
||||
patchProjektarbeitAbgabeMultiple(payload) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: '/api/frontend/v1/Abgabe/patchProjektarbeitAbgabeMultiple',
|
||||
params: payload
|
||||
};
|
||||
},
|
||||
deleteProjektarbeitAbgabe(paabgabe_id) {
|
||||
return {
|
||||
method: 'post',
|
||||
@@ -91,13 +84,6 @@ export default {
|
||||
params: { paabgabe_id }
|
||||
};
|
||||
},
|
||||
deleteProjektarbeitAbgabeMultiple(paabgabe_ids) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: '/api/frontend/v1/Abgabe/deleteProjektarbeitAbgabeMultiple',
|
||||
params: { paabgabe_ids }
|
||||
};
|
||||
},
|
||||
postSerientermin(datum, paabgabetyp_kurzbz, bezeichnung, kurzbz, upload_allowed, projektarbeit_ids, fixtermin) {
|
||||
return {
|
||||
method: 'post',
|
||||
@@ -153,30 +139,6 @@ export default {
|
||||
url: '/api/frontend/v1/Abgabe/getSignaturStatusForProjektarbeitAbgaben',
|
||||
params: {paabgabe_ids, student_uid},
|
||||
|
||||
};
|
||||
},
|
||||
postStudentProjektarbeitTitel(projektarbeit_id, titel) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: '/api/frontend/v1/Abgabe/postStudentProjektarbeitTitel',
|
||||
params: {projektarbeit_id, titel},
|
||||
|
||||
};
|
||||
},
|
||||
sendZweitbetreuerTokenMail(projektarbeit_id, betreuer_person_id, student_uid) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: '/api/frontend/v1/Abgabe/sendZweitbetreuerTokenMail',
|
||||
params: {projektarbeit_id, bperson_id: betreuer_person_id, student_uid},
|
||||
|
||||
};
|
||||
},
|
||||
fetchProjektarbeitenHistory(student_uid) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: '/api/frontend/v1/Abgabe/fetchProjektarbeitenHistory',
|
||||
params: {student_uid},
|
||||
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -34,4 +34,10 @@ 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,
|
||||
};
|
||||
},
|
||||
}
|
||||
@@ -41,24 +41,5 @@ export default {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/phrasen/getAllLanguages'
|
||||
};
|
||||
},
|
||||
getPhrases(phrasesGroupedByCategory, languages = []) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: '/api/frontend/v1/phrasen/getPhrases',
|
||||
params: {
|
||||
phrasesGroupedByCategory,
|
||||
languages,
|
||||
},
|
||||
};
|
||||
},
|
||||
getTabulatorPhrases(languages = []) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/phrasen/getTabulatorPhrases',
|
||||
params: {
|
||||
languages: JSON.stringify(languages),
|
||||
},
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
@@ -51,4 +51,20 @@ 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,9 +35,6 @@ 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/');
|
||||
},
|
||||
|
||||
@@ -25,6 +25,9 @@ const app = Vue.createApp({
|
||||
|
||||
},
|
||||
computed: {
|
||||
viewData() {
|
||||
return { uid: this.uid}
|
||||
},
|
||||
student_uid_computed() {
|
||||
return this.student_uid ?? this.uid
|
||||
},
|
||||
@@ -52,10 +55,10 @@ const app = Vue.createApp({
|
||||
},
|
||||
template: `
|
||||
<template v-if="comp && uid">
|
||||
<AbgabetoolStudent v-if="comp == 'AbgabetoolStudent'" :student_uid_prop="student_uid_computed"></AbgabetoolStudent>
|
||||
<AbgabetoolMitarbeiter v-if="comp == 'AbgabetoolMitarbeiter'"></AbgabetoolMitarbeiter>
|
||||
<AbgabetoolAssistenz v-if="comp == 'AbgabetoolAssistenz'" :stg_kz_prop="stg_kz_computed"></AbgabetoolAssistenz>
|
||||
<DeadlineOverview v-if="comp == 'DeadlinesOverview'"></DeadlineOverview>
|
||||
<AbgabetoolStudent v-if="comp == 'AbgabetoolStudent'" :viewData="viewData" :student_uid_prop="student_uid_computed"></AbgabetoolStudent>
|
||||
<AbgabetoolMitarbeiter v-if="comp == 'AbgabetoolMitarbeiter'" :viewData="viewData"></AbgabetoolMitarbeiter>
|
||||
<AbgabetoolAssistenz v-if="comp == 'AbgabetoolAssistenz'" :viewData="viewData" :stg_kz_prop="stg_kz_computed"></AbgabetoolAssistenz>
|
||||
<DeadlineOverview v-if="comp == 'DeadlinesOverview'" :viewData="viewData"></DeadlineOverview>
|
||||
</template>
|
||||
`
|
||||
});
|
||||
|
||||
+3
-282
@@ -1,287 +1,13 @@
|
||||
import FhcDashboard from '../../components/Dashboard/Dashboard.js';
|
||||
import PluginsPhrasen from '../../plugins/Phrasen.js';
|
||||
import Theme from '../../plugins/Theme.js';
|
||||
import contrast from '../../directives/contrast.js';
|
||||
import {setScrollbarWidth} from "../../helpers/CssVarCalcHelpers.js";
|
||||
import LvPlan from "../../components/Cis/LvPlan/Lehrveranstaltung.js";
|
||||
import MyLvPlan from "../../components/Cis/LvPlan/MyLvPlan.js";
|
||||
import Mylv from "../../components/Cis/Mylv/MyLv.js";
|
||||
import Profil from "../../components/Cis/Profil/Profil.js";
|
||||
import Raumsuche from "../../components/Cis/Raumsuche/Raumsuche.js";
|
||||
import CmsNews from "../../components/Cis/Cms/News.js";
|
||||
import CmsContent from "../../components/Cis/Cms/Content.js";
|
||||
import Info from "../../components/Cis/Mylv/Semester/Studiengang/Lv/Info.js";
|
||||
import RoomInformation, {DEFAULT_MODE_RAUMINFO_DESKTOP, DEFAULT_MODE_RAUMINFO_MOBILE} from "../../components/Cis/Mylv/RoomInformation.js";
|
||||
import AbgabetoolStudent from "../../components/Cis/Abgabetool/AbgabetoolStudent.js";
|
||||
import AbgabetoolMitarbeiter from "../../components/Cis/Abgabetool/AbgabetoolMitarbeiter.js";
|
||||
import AbgabetoolAssistenz from "../../components/Cis/Abgabetool/AbgabetoolAssistenz.js";
|
||||
import DeadlineOverview from "../../components/Cis/Abgabetool/DeadlineOverview.js";
|
||||
import Studium from "../../components/Cis/Studium/Studium.js";
|
||||
import StgOrgLvPlan from "../../components/Cis/LvPlan/StgOrg.js";
|
||||
import OtherLvPlan from "../../components/Cis/LvPlan/OtherLvPlan.js";
|
||||
import PaabgabeUebersicht from "../../components/Cis/ProjektabgabeUebersicht/ProjektabgabeUebersicht.js";
|
||||
import Benotungstool from "../../components/Cis/Benotungstool/Benotungstool.js";
|
||||
import Zeitsperren from "../../components/Cis/Zeitsperren/Zeitsperren.js";
|
||||
import Compat from "../../components/Cis/Compat.js";
|
||||
|
||||
import ApiRouteInfo from '../../api/factory/routeinfo.js';
|
||||
import {capitalize} from "../../helpers/StringHelpers.js";
|
||||
import ApiAuthinfo from "../../api/factory/authinfo.js";
|
||||
|
||||
const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
|
||||
const isMobile = window.matchMedia("(max-width: 767px)").matches;
|
||||
|
||||
const router = VueRouter.createRouter({
|
||||
history: VueRouter.createWebHistory(`/${ciPath}`),
|
||||
routes: [
|
||||
{
|
||||
path: `/Cis/Compat/:mode(ci|legacy)/:path(.*)`,
|
||||
name: 'Compat',
|
||||
component: Compat,
|
||||
props: (route) => {
|
||||
return {
|
||||
mode: route.params.mode,
|
||||
path: route.params.path,
|
||||
query_string: VueRouter.stringifyQuery(route.query)
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: `/Cis/Studium`,
|
||||
name: 'Studium',
|
||||
component: Studium,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Profil/View/:uid`,
|
||||
name: 'ProfilView',
|
||||
component: Profil,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Profil`,
|
||||
name: 'Profil',
|
||||
component: Profil,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Abgabetool/Student/:student_uid_prop?`,
|
||||
name: 'AbgabetoolStudent',
|
||||
component: AbgabetoolStudent,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Abgabetool/Mitarbeiter`,
|
||||
name: 'AbgabetoolMitarbeiter',
|
||||
component: AbgabetoolMitarbeiter,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Abgabetool/Assistenz/:stg_kz_prop?`,
|
||||
name: 'AbgabetoolAssistenz',
|
||||
component: AbgabetoolAssistenz,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Abgabetool/Deadlines/:person_uid_prop?`,
|
||||
name: 'DeadlineOverview',
|
||||
component: DeadlineOverview,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Raumsuche`,
|
||||
name: 'Raumsuche',
|
||||
component: Raumsuche,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/ProjektabgabeUebersicht`,
|
||||
name: 'PaabgabeUebersicht',
|
||||
component: PaabgabeUebersicht,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Benotungstool/:lv_id?/:sem_kurzbz?`,
|
||||
name: 'Benotungstool',
|
||||
component: Benotungstool,
|
||||
props: true
|
||||
},
|
||||
// Redirect old links to new format
|
||||
{
|
||||
path: "/CisVue/Cms/getRoomInformation/:ort_kurzbz",
|
||||
name: "RoomInformationOld",
|
||||
component: RoomInformation,
|
||||
redirect: (to) => {
|
||||
return { // redirect to longer Rauminfo url and map params
|
||||
name: "RoomInformation",
|
||||
params: { // in this case always populate other params since they are not optional
|
||||
ort_kurzbz: to.params.ort_kurzbz,
|
||||
mode: isMobile ? DEFAULT_MODE_RAUMINFO_MOBILE : DEFAULT_MODE_RAUMINFO_DESKTOP,
|
||||
focus_date: new Date().toISOString().split("T")[0]
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
path: `/CisVue/Cms/getRoomInformation/:mode/:focus_date/:ort_kurzbz`,
|
||||
name: 'RoomInformation',
|
||||
component: RoomInformation,
|
||||
props: (route) => { // validate and set mode/focus date if for some reason missing
|
||||
const validModes = ["Month", "Week", "Day"];
|
||||
|
||||
// check mode string
|
||||
const mode = route.params.mode &&
|
||||
validModes.includes(route.params.mode.charAt(0).toUpperCase() + route.params.mode.slice(1).toLowerCase())
|
||||
? route.params.mode.charAt(0).toUpperCase() + route.params.mode.slice(1).toLowerCase()
|
||||
: (isMobile ? DEFAULT_MODE_RAUMINFO_MOBILE : DEFAULT_MODE_RAUMINFO_DESKTOP);
|
||||
|
||||
// default to today date if not provided
|
||||
const d = new Date(route.params.focus_date)
|
||||
const focus_date = !isNaN(d) ? route.params.focus_date : new Date().toISOString().split("T")[0];
|
||||
|
||||
// for consistency reasons format the props into one object but actually use a new name to we dont collide with
|
||||
// existing viewData declaration written from codeigniter 3 into routerview tag
|
||||
return {
|
||||
propsViewData: {
|
||||
mode,
|
||||
focus_date,
|
||||
ort_kurzbz: route.params.ort_kurzbz
|
||||
}
|
||||
};
|
||||
},
|
||||
beforeEnter: (to, from, next) => {
|
||||
// missing mode or focus_date -> set defaults
|
||||
if (!to.params.mode || !to.params.focus_date) {
|
||||
next({
|
||||
name: "RoomInformation",
|
||||
params: {
|
||||
mode: to.params.mode || DEFAULT_MODE_RAUMINFO,
|
||||
focus_date: to.params.focus_date || new Date().toISOString().split("T")[0],
|
||||
ort_kurzbz: route.params.ort_kurzbz
|
||||
}
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
path: `/CisVue/Cms/Content/:content_id`,
|
||||
name: 'Content',
|
||||
component: CmsContent,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/CisVue/Cms/News`,
|
||||
name: 'News',
|
||||
component: CmsNews,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/MyLv/:studiensemester?`,
|
||||
name: 'MyLv',
|
||||
component: Mylv,
|
||||
props: true,
|
||||
},
|
||||
{
|
||||
path: `/Cis/MyLv/Info/:studien_semester/:lehrveranstaltung_id`,
|
||||
name: 'LvInfo',
|
||||
component: Info,
|
||||
props: true
|
||||
},
|
||||
// Redirect old links to new format
|
||||
{
|
||||
// only trigger on first param being numeric to avoid paths like "LvPlan/Month" entering here
|
||||
path: "/Cis/LvPlan/:lv_id(\\d+)",
|
||||
name: "LvPlanOld",
|
||||
component: LvPlan,
|
||||
redirect(to) {
|
||||
const route = Vue.unref(router.currentRoute);
|
||||
const { mode, focus_date } = route.params; // keep mode and focus_date if available
|
||||
return { // redirect to longer LvPlan url and map params
|
||||
name: "LvPlan",
|
||||
params: {
|
||||
mode,
|
||||
focus_date,
|
||||
lv_id: to.params.lv_id
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
path: `/Cis/LvPlan/:mode?/:focus_date?/:lv_id?`,
|
||||
name: 'LvPlan',
|
||||
component: LvPlan,
|
||||
props(route) {
|
||||
return {
|
||||
propsViewData: route.params
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: `/Cis/MyLvPlan/:mode?/:focus_date?`,
|
||||
name: 'MyLvPlan',
|
||||
component: MyLvPlan,
|
||||
props(route) {
|
||||
return {
|
||||
propsViewData: route.params
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: `/Cis/StgOrgLvPlan/:mode?/:focus_date?/:stgkz?/:sem?/:verband?/:gruppe?`,
|
||||
name: 'StgOrgLvPlan',
|
||||
component: StgOrgLvPlan,
|
||||
props(route) {
|
||||
return {
|
||||
propsViewData: route.params
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: `/Cis/OtherLvPlan/:otherUid/:mode?/:focus_date?`,
|
||||
name: "OtherLvPlan",
|
||||
component: OtherLvPlan,
|
||||
props(route) {
|
||||
return {
|
||||
propsViewData: route.params
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: `/Cis4`,
|
||||
name: 'Cis4',
|
||||
component: FhcDashboard,
|
||||
props: {dashboard: 'CIS'},
|
||||
},
|
||||
{
|
||||
path: `/`,
|
||||
name: 'FhcDashboard',
|
||||
component: FhcDashboard,
|
||||
props: {dashboard: 'CIS'},
|
||||
},
|
||||
{
|
||||
path: '/:pathMatch(.*)*',
|
||||
name: 'Fallback',
|
||||
component: FhcDashboard,
|
||||
props: {dashboard: 'CIS'},
|
||||
redirect: () => {
|
||||
return {
|
||||
name: "Cis4",
|
||||
params: {
|
||||
dashboard: 'CIS'
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
path: `/Cis/Zeitsperren`,
|
||||
name: 'Zeitsperren',
|
||||
component: Zeitsperren,
|
||||
props: true
|
||||
},
|
||||
]
|
||||
})
|
||||
import {router} from "../../routers/Cis/CisRouter.js";
|
||||
|
||||
const app = Vue.createApp({
|
||||
name: 'CisApp',
|
||||
@@ -294,16 +20,11 @@ const app = Vue.createApp({
|
||||
provide() {
|
||||
return { // provide injectable & watchable language property
|
||||
language: Vue.computed(() => this.$p.user_language),
|
||||
isMobile: Vue.computed(() => this.isMobile),
|
||||
isMobile: Vue.computed(() => this.windowWidth < 767),
|
||||
isStudent: Vue.computed(() => this.isStudent),
|
||||
isMitarbeiter: Vue.computed(() => this.isMitarbeiter)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isMobile: function() {
|
||||
return (this.windowWidth < 767);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isInternalRoute(href) {
|
||||
const internalBase = window.location.origin
|
||||
@@ -316,7 +37,7 @@ const app = Vue.createApp({
|
||||
if (target && this.isInternalRoute(target.href)) {
|
||||
const url = new URL(target.href)
|
||||
|
||||
const path = url.pathname
|
||||
const path = url.pathname + url.search;
|
||||
const base = this.$router.options.history.base
|
||||
const route = path.replace(base, '') || '/'
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import Theme from "../../plugins/Theme.js";
|
||||
import ApiSearchbar from '../../api/factory/searchbar.js';
|
||||
import ApiLvPlan from "../../api/factory/lvPlan.js";
|
||||
|
||||
import {router} from "../../routers/Cis/CisRouter.js";
|
||||
|
||||
const app = Vue.createApp({
|
||||
name: 'CisMenuApp',
|
||||
components: {
|
||||
@@ -193,6 +195,7 @@ const app = Vue.createApp({
|
||||
|
||||
FhcApps.makeExtendable(app);
|
||||
|
||||
app.use(router);
|
||||
app.use(primevue.config.default, {
|
||||
zIndex: {
|
||||
overlay: 9000,
|
||||
|
||||
@@ -4,9 +4,7 @@ export default {
|
||||
name: 'BootstrapModal',
|
||||
data: () => ({
|
||||
modal: null,
|
||||
fullscreen: false,
|
||||
expandBtnHovered: false,
|
||||
expandBtnFocused: false,
|
||||
fullscreen: false
|
||||
}),
|
||||
props: {
|
||||
backdrop: {
|
||||
@@ -72,29 +70,6 @@ export default {
|
||||
this.$emit('toggleFullscreen')
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
getExpandButtonStyles() {
|
||||
const hovered = this.expandBtnHovered;
|
||||
const focused = this.expandBtnFocused;
|
||||
return `display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
font-size: 1em;
|
||||
opacity: 0.5;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
line-height: 1;
|
||||
transition: opacity 0.15s ease;
|
||||
opacity: ${focused ? '1' : hovered ? '0.75' : '0.5'};
|
||||
outline: ${focused ? '1px solid currentColor' : 'none'};
|
||||
outline-offset: 2px;`
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.$refs.modal)
|
||||
this.modal = new bootstrap.Modal(this.$refs.modal, {
|
||||
@@ -165,13 +140,9 @@ export default {
|
||||
<div class="d-flex align-items-center ms-auto gap-2">
|
||||
<button
|
||||
type="button"
|
||||
:style="getExpandButtonStyles"
|
||||
class="btn mb-1"
|
||||
v-if="allowFullscreenExpand"
|
||||
@click="toggleFullscreen"
|
||||
@mouseenter="expandBtnHovered = true"
|
||||
@mouseleave="expandBtnHovered = false"
|
||||
@focusin="expandBtnFocused = true"
|
||||
@focusout="expandBtnFocused = false"
|
||||
:aria-label="fullscreen ? 'Exit Fullscreen' : 'Enter Fullscreen'"
|
||||
>
|
||||
<i v-if="!fullscreen" class="fa-solid fa-expand"></i>
|
||||
|
||||
@@ -2,8 +2,6 @@ import BsModal from '../../Bootstrap/Modal.js';
|
||||
import VueDatePicker from '../../vueDatepicker.js.php';
|
||||
import ApiAbgabe from '../../../api/factory/abgabe.js'
|
||||
import { getDateStyleClass } from "./getDateStyleClass.js";
|
||||
import {compareISODateValues, formatDateTime, formatISODate, getViennaTodayISO} from "./dateUtils.js";
|
||||
|
||||
|
||||
export const AbgabeMitarbeiterDetail = {
|
||||
name: "AbgabeMitarbeiterDetail",
|
||||
@@ -48,7 +46,12 @@ export const AbgabeMitarbeiterDetail = {
|
||||
eidAkzeptiert: false,
|
||||
enduploadTermin: null,
|
||||
allActiveLanguages: FHC_JS_DATA_STORAGE_OBJECT.server_languages,
|
||||
speedDialItems: [
|
||||
speedDialItems: [{
|
||||
label: Vue.computed(() => this.$p.t('abgabetool/c4newAbgabetermin')),
|
||||
icon: "fa fa-plus",
|
||||
command: this.openCreateNewAbgabeModal,
|
||||
disabled: Vue.computed(() => !this.getAllowedToCreateNewTermin)
|
||||
},
|
||||
{
|
||||
label: Vue.computed(() => this.$p.t('abgabetool/c4benoten')),
|
||||
icon: "fa fa-user-check",
|
||||
@@ -78,22 +81,6 @@ export const AbgabeMitarbeiterDetail = {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getSavedTerminInfoString(termin) {
|
||||
const isUpdate = termin.updateamum != null;
|
||||
|
||||
const fullname = isUpdate
|
||||
? termin.updatevon_fullname
|
||||
: termin.insertvon_fullname;
|
||||
|
||||
const datetime = isUpdate
|
||||
? termin.updateamum
|
||||
: termin.insertamum;
|
||||
|
||||
return this.$p.t('ui/savedAtByV3', [formatDateTime(datetime), fullname])
|
||||
},
|
||||
terminIsInvalid(termin) {
|
||||
return termin.note?.positiv == false && !termin.beurteilungsnotiz
|
||||
},
|
||||
getNoteBezeichnung(termin){
|
||||
if(termin.noteBackend?.bezeichnung) {
|
||||
return termin.noteBackend?.positiv ? this.$capitalize(this.$p.t('abgabetool/c4positivBenotet')) + ' ✅' : this.$capitalize(this.$p.t('abgabetool/c4negativBenotet')) + ' ❌'
|
||||
@@ -126,8 +113,6 @@ export const AbgabeMitarbeiterDetail = {
|
||||
if(newTerminRes.note) {
|
||||
newTerminRes.note = noteOpt
|
||||
newTerminRes.noteBackend = noteOpt // certain UI elements should only reflect persisted state
|
||||
termin.allowedToDelete = false
|
||||
newTerminRes.allowedToDelete = false
|
||||
}
|
||||
newTerminRes.invertedFixtermin = !newTerminRes.fixtermin
|
||||
const existingTerminRes = res.data[1]
|
||||
@@ -147,13 +132,13 @@ export const AbgabeMitarbeiterDetail = {
|
||||
} else {
|
||||
const noteOptExisting = this.allowedNotenOptions.find(opt => opt.note == existingTerminRes.note)
|
||||
existingTerminRes.note = noteOptExisting
|
||||
|
||||
|
||||
termin.paabgabetyp_kurzbz = newTerminRes.paabgabetyp_kurzbz
|
||||
termin.noteBackend = noteOpt // do NOT take noteOptExisting -> should reflect the "yes the qgate grade is confirmed in backend ux behaviour"
|
||||
termin.dateStyle = getDateStyleClass(termin, this.notenOptions)
|
||||
}
|
||||
|
||||
this.projektarbeit.abgabetermine.sort((a, b) => compareISODateValues(a.datum, b.datum))
|
||||
this.projektarbeit.abgabetermine.sort((a, b) =>new Date(a.datum) - new Date(b.datum))
|
||||
|
||||
const index = this.projektarbeit.abgabetermine.findIndex(t => termin.paabgabe_id == t.paabgabe_id)
|
||||
|
||||
@@ -174,7 +159,7 @@ export const AbgabeMitarbeiterDetail = {
|
||||
'fixtermin': false,
|
||||
'invertedFixtermin': true,
|
||||
'kurzbz': '', // todo kurzbz textfield value vorschlag für qualgates
|
||||
'datum': getViennaTodayISO(),
|
||||
'datum': new Date().toISOString().split('T')[0],
|
||||
'note': this.allowedNotenOptions.find(opt => opt.note == 9),
|
||||
'beurteilungsnotiz': '',
|
||||
'upload_allowed': false,
|
||||
@@ -352,7 +337,16 @@ export const AbgabeMitarbeiterDetail = {
|
||||
}
|
||||
},
|
||||
formatDate(dateParam) {
|
||||
return formatISODate(dateParam)
|
||||
// unsafe for datepickers, dont use there
|
||||
const date = new Date(dateParam)
|
||||
// handle missing leading 0
|
||||
const padZero = (num) => String(num).padStart(2, '0');
|
||||
|
||||
const month = padZero(date.getMonth() + 1); // Months are zero-based
|
||||
const day = padZero(date.getDate());
|
||||
const year = date.getFullYear();
|
||||
|
||||
return `${day}.${month}.${year}`
|
||||
},
|
||||
openCreateNewAbgabeModal() {
|
||||
if(this.projektarbeit?.betreuerart_kurzbz == 'Zweitbegutachter') {
|
||||
@@ -370,7 +364,7 @@ export const AbgabeMitarbeiterDetail = {
|
||||
'fixtermin': false,
|
||||
'invertedFixtermin': true,
|
||||
'kurzbz': '',
|
||||
'datum': getViennaTodayISO(),
|
||||
'datum': new Date().toISOString().split('T')[0],
|
||||
'note': this.allowedNotenOptions.find(opt => opt.note == 9),
|
||||
'beurteilungsnotiz': '',
|
||||
'upload_allowed': typ.upload_allowed_default,
|
||||
@@ -404,7 +398,7 @@ export const AbgabeMitarbeiterDetail = {
|
||||
'fixtermin': false,
|
||||
'invertedFixtermin': true,
|
||||
'kurzbz': '',
|
||||
'datum': getViennaTodayISO(),
|
||||
'datum': new Date().toISOString().split('T')[0],
|
||||
'note': this.allowedNotenOptions.find(opt => opt.note == 9),
|
||||
'beurteilungsnotiz': '',
|
||||
'upload_allowed': false,
|
||||
@@ -452,7 +446,7 @@ export const AbgabeMitarbeiterDetail = {
|
||||
}
|
||||
},
|
||||
getMessagePtStyle() {
|
||||
// adjust outer spacing and internal padding to appear similar to download button in size
|
||||
// adjust outer spacing and internal padding to appear similar to doenload button in size
|
||||
return {
|
||||
root: {
|
||||
style: {
|
||||
@@ -567,12 +561,6 @@ export const AbgabeMitarbeiterDetail = {
|
||||
class: "custom-tooltip"
|
||||
}
|
||||
},
|
||||
getTooltipBeurteilungsnotiz() {
|
||||
return {
|
||||
value: this.$p.t('abgabetool/c4beurteilungsnotizBeiNegNote'),
|
||||
class: "custom-tooltip"
|
||||
}
|
||||
},
|
||||
getProjektarbeitTitel() {
|
||||
if(this.projektarbeit?.titel) return this.$capitalize(this.$p.t('abgabetool/c4titel')) + ': ' + this.projektarbeit.titel
|
||||
|
||||
@@ -603,7 +591,7 @@ export const AbgabeMitarbeiterDetail = {
|
||||
'fixtermin': false,
|
||||
'invertedFixtermin': true,
|
||||
'kurzbz': '',
|
||||
'datum': getViennaTodayISO(),
|
||||
'datum': new Date().toISOString().split('T')[0],
|
||||
'note': this.allowedNotenOptions.find(opt => opt.note == 9),
|
||||
'beurteilungsnotiz': '',
|
||||
'upload_allowed': typ.upload_allowed_default,
|
||||
@@ -639,7 +627,6 @@ export const AbgabeMitarbeiterDetail = {
|
||||
dialogClass="bordered-modal modal-lg"
|
||||
:backdrop="true"
|
||||
@hideBsModal="showAutomagicModalPhrase=false;"
|
||||
bodyClass="px-4 py-4"
|
||||
>
|
||||
<template v-slot:title>
|
||||
<div>
|
||||
@@ -669,7 +656,6 @@ export const AbgabeMitarbeiterDetail = {
|
||||
:enable-time-picker="false"
|
||||
locale="de"
|
||||
format="dd.MM.yyyy"
|
||||
model-type="yyyy-MM-dd"
|
||||
:text-input="true"
|
||||
auto-apply>
|
||||
</VueDatePicker>
|
||||
@@ -820,7 +806,6 @@ export const AbgabeMitarbeiterDetail = {
|
||||
:enable-time-picker="false"
|
||||
locale="de"
|
||||
format="dd.MM.yyyy"
|
||||
model-type="yyyy-MM-dd"
|
||||
:text-input="true"
|
||||
auto-apply>
|
||||
</VueDatePicker>
|
||||
@@ -831,7 +816,7 @@ export const AbgabeMitarbeiterDetail = {
|
||||
<div class="col-12 col-md-9">
|
||||
<Dropdown
|
||||
:style="{'width': '100%'}"
|
||||
:disabled="!termin.allowedToSave || termin.abgabedatum !== null || termin.noteBackend"
|
||||
:disabled="!termin.allowedToSave"
|
||||
:placeholder="getPlaceholderTermin(termin)"
|
||||
v-model="termin.bezeichnung"
|
||||
@change="handleChangeAbgabetyp(termin)"
|
||||
@@ -866,10 +851,8 @@ export const AbgabeMitarbeiterDetail = {
|
||||
</div>
|
||||
<div class="row mt-2" v-if="termin.bezeichnung?.benotbar">
|
||||
<div class="col-12 col-md-3 fw-bold align-content-center">{{$capitalize( $p.t('abgabetool/c4notizQualGatev2') )}}</div>
|
||||
<div class="col-12 col-md-9" v-tooltip.right="terminIsInvalid(termin) && getTooltipBeurteilungsnotiz">
|
||||
<Textarea style="margin-bottom: 4px;" v-model="termin.beurteilungsnotiz"
|
||||
:class="{ 'p-invalid': terminIsInvalid(termin) }"
|
||||
rows="1" class="w-100" :disabled="!termin.allowedToSave"></Textarea>
|
||||
<div class="col-12 col-md-9">
|
||||
<Textarea style="margin-bottom: 4px;" v-model="termin.beurteilungsnotiz" rows="1" class="w-100" :disabled="!termin.allowedToSave"></Textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -891,7 +874,6 @@ export const AbgabeMitarbeiterDetail = {
|
||||
:disabled="true"
|
||||
locale="de"
|
||||
format="dd.MM.yyyy"
|
||||
model-type="yyyy-MM-dd"
|
||||
>
|
||||
</VueDatePicker>
|
||||
</div>
|
||||
@@ -907,6 +889,9 @@ export const AbgabeMitarbeiterDetail = {
|
||||
<Message v-else-if="termin?.signatur == false" severity="error" :closable="false" :pt="getMessagePtStyle"> {{ $capitalize($p.t('abgabetool/c4keineSignatur')) }} </Message>
|
||||
<Message v-else-if="termin?.signatur == 'error'" severity="warn" :closable="false" :pt="getMessagePtStyle"> {{ $capitalize($p.t('abgabetool/c4signaturServerError')) }} </Message>
|
||||
</div>
|
||||
<!-- <div v-else class="col-auto">-->
|
||||
<!-- <Message severity="info" :closable="false" :pt="getMessagePtStyle"> {{ $p.t('abgabetool/c4noFileFound') }} </Message>-->
|
||||
<!-- </div>-->
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@@ -919,10 +904,10 @@ export const AbgabeMitarbeiterDetail = {
|
||||
<div class="col-12 col-md-3 fw-bold align-content-center">
|
||||
{{ $capitalize( $p.t('abgabetool/c4actions') )}}
|
||||
</div>
|
||||
<div class="col-12 col-md-5">
|
||||
<div class="col-12 col-md-9">
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
<button v-if="termin.allowedToSave && !terminIsInvalid(termin)" style="max-height: 40px;" class="btn btn-primary border-0" @click="saveTermin(termin)">
|
||||
<button v-if="termin.allowedToSave" style="max-height: 40px;" class="btn btn-primary border-0" @click="saveTermin(termin)">
|
||||
{{ $capitalize( $p.t('abgabetool/c4save') )}}
|
||||
<i class="fa-solid fa-floppy-disk"></i>
|
||||
</button>
|
||||
@@ -947,9 +932,6 @@ export const AbgabeMitarbeiterDetail = {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-4 align-content-center text-end text-muted small">
|
||||
{{getSavedTerminInfoString(termin)}}
|
||||
</div>
|
||||
</div>
|
||||
</AccordionTab>
|
||||
</template>
|
||||
@@ -962,8 +944,7 @@ export const AbgabeMitarbeiterDetail = {
|
||||
<bs-modal
|
||||
ref="modalContainerZusatzdaten"
|
||||
class="bootstrap-prompt"
|
||||
dialogClass="bordered-modal modal-lg"
|
||||
bodyClass="px-4 py-4">
|
||||
dialogClass="bordered-modal modal-lg">
|
||||
<template v-slot:title>
|
||||
<div>
|
||||
{{$capitalize( $p.t('abgabetool/c4enduploadZusatzdaten') )}}
|
||||
|
||||
@@ -3,9 +3,6 @@ import BsModal from '../../Bootstrap/Modal.js';
|
||||
import VueDatePicker from '../../vueDatepicker.js.php';
|
||||
import ApiAbgabe from '../../../api/factory/abgabe.js'
|
||||
import FhcOverlay from "../../Overlay/FhcOverlay.js";
|
||||
import { formatISODate, getViennaTodayISO } from "./dateUtils.js";
|
||||
import { validateThesisTitle } from './titleValidation.js'
|
||||
|
||||
|
||||
export const AbgabeStudentDetail = {
|
||||
name: "AbgabeStudentDetail",
|
||||
@@ -23,16 +20,7 @@ export const AbgabeStudentDetail = {
|
||||
VueDatePicker,
|
||||
FhcOverlay
|
||||
},
|
||||
inject: [
|
||||
'notenOptions',
|
||||
'isMobile',
|
||||
'isViewMode',
|
||||
'moodle_link',
|
||||
'confetti_on_endupload',
|
||||
'title_edit_allowed',
|
||||
'siginfolink_german',
|
||||
'siginfolink_english'
|
||||
],
|
||||
inject: ['notenOptions', 'isMobile', 'isViewMode', 'moodle_link'],
|
||||
props: {
|
||||
projektarbeit: {
|
||||
type: Object,
|
||||
@@ -43,14 +31,12 @@ export const AbgabeStudentDetail = {
|
||||
default: false
|
||||
}
|
||||
},
|
||||
emits: ['titel-updated'],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
eidAkzeptiert: false,
|
||||
enduploadTermin: null,
|
||||
allActiveLanguages: FHC_JS_DATA_STORAGE_OBJECT.server_languages,
|
||||
editingTitel: '',
|
||||
form: Vue.reactive({
|
||||
sprache: '',
|
||||
abstract: '',
|
||||
@@ -63,120 +49,9 @@ export const AbgabeStudentDetail = {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
confettiCannons() {
|
||||
const container = document.getElementById('confetti-container');
|
||||
if (!container) return;
|
||||
|
||||
const colors = ['#FFC107', '#FF5722', '#E91E63', '#00BCD4', '#4CAF50', '#9C27B0'];
|
||||
const shapes = ['50%', '0%'];
|
||||
const fragment = document.createDocumentFragment();
|
||||
|
||||
// Corner Cannons - Slowed Down)
|
||||
const cannonCount = 150;
|
||||
|
||||
for (let i = 0; i < cannonCount; i++) {
|
||||
const leftConfetti = document.createElement('div');
|
||||
leftConfetti.classList.add('confetti-piece');
|
||||
leftConfetti.style.left = '0px';
|
||||
leftConfetti.style.top = '100%';
|
||||
|
||||
const rightConfetti = document.createElement('div');
|
||||
rightConfetti.classList.add('confetti-piece');
|
||||
rightConfetti.style.left = '100vw';
|
||||
rightConfetti.style.top = '100%';
|
||||
|
||||
const colorL = colors[Math.floor(Math.random() * colors.length)];
|
||||
const colorR = colors[Math.floor(Math.random() * colors.length)];
|
||||
const shapeL = shapes[Math.floor(Math.random() * shapes.length)];
|
||||
const shapeR = shapes[Math.floor(Math.random() * shapes.length)];
|
||||
|
||||
// Left Styles
|
||||
leftConfetti.style.background = colorL;
|
||||
leftConfetti.style.borderRadius = shapeL;
|
||||
leftConfetti.style.width = `${Math.random() * 10 + 6}px`;
|
||||
leftConfetti.style.height = `${Math.random() * 14 + 6}px`;
|
||||
leftConfetti.style.setProperty('--blast-x', `${Math.random() * 50 + 10}vw`);
|
||||
leftConfetti.style.setProperty('--blast-y', `-${Math.random() * 65 + 30}vh`);
|
||||
|
||||
// Right Styles
|
||||
rightConfetti.style.background = colorR;
|
||||
rightConfetti.style.borderRadius = shapeR;
|
||||
rightConfetti.style.width = `${Math.random() * 10 + 6}px`;
|
||||
rightConfetti.style.height = `${Math.random() * 14 + 6}px`;
|
||||
rightConfetti.style.setProperty('--blast-x', `-${Math.random() * 50 + 10}vw`);
|
||||
rightConfetti.style.setProperty('--blast-y', `-${Math.random() * 65 + 30}vh`);
|
||||
|
||||
// Increased durations to 3s - 5s for a floating gravity effect
|
||||
const durationL = Math.random() * 2 + 3;
|
||||
const durationR = Math.random() * 2 + 3;
|
||||
const delayL = Math.random() * 0.2;
|
||||
const delayR = Math.random() * 0.2;
|
||||
|
||||
leftConfetti.style.animation = `cannonBlast ${durationL}s linear ${delayL}s both`;
|
||||
rightConfetti.style.animation = `cannonBlast ${durationR}s linear ${delayR}s both`;
|
||||
|
||||
fragment.appendChild(leftConfetti);
|
||||
fragment.appendChild(rightConfetti);
|
||||
|
||||
setTimeout(() => leftConfetti.remove(), (delayL + durationL) * 1000);
|
||||
setTimeout(() => rightConfetti.remove(), (delayR + durationR) * 1000);
|
||||
}
|
||||
|
||||
container.appendChild(fragment);
|
||||
},
|
||||
openTitelEdit() {
|
||||
this.editingTitel = this.projektarbeit.titel ?? '';
|
||||
this.$refs.modalTitelEdit.show();
|
||||
},
|
||||
async saveTitel() {
|
||||
|
||||
const validation = validateThesisTitle(this.editingTitel);
|
||||
|
||||
if (!validation.isValid) {
|
||||
if (validation.error === 'empty') {
|
||||
this.$fhcAlert.alertWarning(this.$p.t('abgabetool/c4emptyThesisTitle'))
|
||||
} else if (validation.error === 'invalid_characters') {
|
||||
this.$fhcAlert.alertWarning(this.$p.t('abgabetool/c4invalidCharactersThesisTitle'))
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
const confirmed = await this.$fhcAlert.confirm({
|
||||
message: this.$p.t('abgabetool/c4confirmTitelSpeichern'),
|
||||
acceptLabel: this.$capitalize(this.$p.t('ui/speichern')),
|
||||
acceptClass: 'p-button-primary',
|
||||
rejectLabel: this.$capitalize(this.$p.t('abgabetool/c4Cancel')),
|
||||
rejectClass: 'p-button-secondary'
|
||||
});
|
||||
|
||||
if (confirmed === false) return;
|
||||
|
||||
this.loading = true;
|
||||
this.$api.call(
|
||||
ApiAbgabe.postStudentProjektarbeitTitel(
|
||||
this.projektarbeit.projektarbeit_id,
|
||||
validation.cleanedTitle
|
||||
)
|
||||
).then(res => {
|
||||
if (res.meta.status === 'success') {
|
||||
this.projektarbeit.titel = res.data;
|
||||
this.$emit('titel-updated', {
|
||||
projektarbeit_id: this.projektarbeit.projektarbeit_id,
|
||||
titel: res.data
|
||||
});
|
||||
this.$fhcAlert.alertSuccess(this.$capitalize(this.$p.t('abgabetool/c4titelSavedSuccess')));
|
||||
this.$refs.modalTitelEdit.hide();
|
||||
} else {
|
||||
this.$fhcAlert.alertError(this.$capitalize(this.$p.t('abgabetool/c4titelSaveError')));
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getNoteBezeichnung(termin){
|
||||
const noteOpt = this.notenOptions.find(opt => opt.note == termin.note)
|
||||
|
||||
|
||||
if(noteOpt?.bezeichnung) {
|
||||
return noteOpt?.positiv ? this.$capitalize(this.$p.t('abgabetool/c4positivBenotet')) + ' ✅' : this.$capitalize(this.$p.t('abgabetool/c4negativBenotet')) + ' ❌'
|
||||
} else if(noteOpt?.benotbar === true && !termin.note) {
|
||||
@@ -190,7 +65,7 @@ export const AbgabeStudentDetail = {
|
||||
this.$fhcAlert.alertWarning(this.$capitalize(this.$p.t('global/warningChooseFile')));
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
if(endupload) {
|
||||
if(await this.$fhcAlert.confirm({
|
||||
message: this.$p.t('abgabetool/confirmEnduploadSpeichern'),
|
||||
@@ -202,16 +77,16 @@ export const AbgabeStudentDetail = {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
},
|
||||
async triggerEndupload() {
|
||||
|
||||
|
||||
if (!await this.validate(this.enduploadTermin, true))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// post endabgabe
|
||||
const formData = new FormData();
|
||||
formData.append('paabgabetyp_kurzbz', this.enduploadTermin.paabgabetyp_kurzbz)
|
||||
@@ -219,14 +94,14 @@ export const AbgabeStudentDetail = {
|
||||
formData.append('paabgabe_id', this.enduploadTermin.paabgabe_id)
|
||||
formData.append('student_uid', this.projektarbeit.student_uid)
|
||||
formData.append('bperson_id', this.projektarbeit.bperson_id)
|
||||
|
||||
|
||||
formData.append('sprache', this.form['sprache'].sprache)
|
||||
formData.append('abstract', this.form['abstract'])
|
||||
formData.append('abstract_en', this.form['abstract_en'])
|
||||
formData.append('schlagwoerter', this.form['schlagwoerter'])
|
||||
formData.append('schlagwoerter_en', this.form['schlagwoerter_en'])
|
||||
formData.append('seitenanzahl', this.form['seitenanzahl'])
|
||||
|
||||
|
||||
for (let i = 0; i < this.enduploadTermin.file.length; i++) {
|
||||
formData.append('file', this.enduploadTermin.file[i]);
|
||||
}
|
||||
@@ -234,31 +109,39 @@ export const AbgabeStudentDetail = {
|
||||
this.$api.call(ApiAbgabe.postStudentProjektarbeitEndupload(formData))
|
||||
.then(res => {
|
||||
this.handleUploadRes(res, this.enduploadTermin)
|
||||
if(this.confetti_on_endupload && res.meta.status == "success") {
|
||||
this.confettiCannons()
|
||||
}
|
||||
}).finally(()=> {
|
||||
this.loading = false
|
||||
this.loading = false
|
||||
})
|
||||
|
||||
|
||||
this.$refs.modalContainerEnduploadZusatzdaten.hide()
|
||||
},
|
||||
downloadAbgabe(termin) {
|
||||
const url = `/api/frontend/v1/Abgabe/getStudentProjektarbeitAbgabeFile?paabgabe_id=${termin.paabgabe_id}&student_uid=${this.projektarbeit.student_uid}&projektarbeit_id=${this.projektarbeit.projektarbeit_id}`;
|
||||
|
||||
window.open(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + url)
|
||||
// this.$api.call(ApiAbgabe.getStudentProjektarbeitAbgabeFile(termin.paabgabe_id, this.projektarbeit.student_uid))
|
||||
},
|
||||
formatDate(dateParam) {
|
||||
return formatISODate(dateParam)
|
||||
const date = new Date(dateParam)
|
||||
// handle missing leading 0
|
||||
const padZero = (num) => String(num).padStart(2, '0');
|
||||
|
||||
const month = padZero(date.getMonth() + 1); // Months are zero-based
|
||||
const day = padZero(date.getDate());
|
||||
const year = date.getFullYear();
|
||||
|
||||
return `${day}.${month}.${year}`
|
||||
},
|
||||
async upload(termin) {
|
||||
|
||||
// only do this on endupload
|
||||
if (! await this.validate(termin))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(termin.bezeichnung?.paabgabetyp_kurzbz === 'end') {
|
||||
// open endupload form modal for further inputs
|
||||
this.enduploadTermin = termin
|
||||
this.$refs.modalContainerEnduploadZusatzdaten.show()
|
||||
} else {
|
||||
@@ -268,7 +151,7 @@ export const AbgabeStudentDetail = {
|
||||
formData.append('paabgabe_id', termin.paabgabe_id)
|
||||
formData.append('student_uid', this.projektarbeit.student_uid)
|
||||
formData.append('bperson_id', this.projektarbeit.bperson_id)
|
||||
|
||||
|
||||
for (let i = 0; i < termin.file.length; i++) {
|
||||
formData.append('file', termin.file[i]);
|
||||
}
|
||||
@@ -278,7 +161,7 @@ export const AbgabeStudentDetail = {
|
||||
.then(res => {
|
||||
this.handleUploadRes(res, termin)
|
||||
}).finally(()=> {
|
||||
this.loading = false
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -286,18 +169,21 @@ export const AbgabeStudentDetail = {
|
||||
if(res.meta.status == "success") {
|
||||
this.$fhcAlert.alertSuccess(this.$capitalize(this.$p.t('abgabetool/c4fileUploadSuccessv3')))
|
||||
|
||||
termin.abgabedatum = getViennaTodayISO();
|
||||
// update 'abgabedatum' for successful upload -> shows the pdf icon and date once set
|
||||
termin.abgabedatum = new Date().toISOString().split('T')[0];
|
||||
if(res?.data?.signatur !== undefined) {
|
||||
termin.signatur = res.data.signatur
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
this.$fhcAlert.alertError(this.$capitalize(this.$p.t('abgabetool/c4fileUploadErrorv3')))
|
||||
}
|
||||
|
||||
|
||||
if(res.meta.signaturInfo) {
|
||||
this.$fhcAlert.alertInfo(res.meta.signaturInfo)
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
getOptionLabel(option) {
|
||||
return option.sprache
|
||||
@@ -309,6 +195,7 @@ export const AbgabeStudentDetail = {
|
||||
},
|
||||
watch: {
|
||||
projektarbeit(newVal) {
|
||||
// default select german if projektarbeit sprache was null
|
||||
this.form.sprache = newVal.sprache ? this.allActiveLanguages.find(lang => lang.sprache == newVal.sprache) : this.allActiveLanguages.find(lang => lang.sprache == 'German')
|
||||
this.form.abstract = newVal.abstract ?? ''
|
||||
this.form.abstract_en = newVal.abstract_en ?? ''
|
||||
@@ -316,22 +203,15 @@ export const AbgabeStudentDetail = {
|
||||
this.form.schlagwoerter_en = newVal.schlagwoerter_en ?? ''
|
||||
this.form.kontrollschlagwoerter = newVal.kontrollschlagwoerter ?? ''
|
||||
this.form.seitenanzahl = newVal.seitenanzahl ?? 1
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
getSignaturInfoLink() {
|
||||
if(this.$p.user_language.value == 'German' && this.siginfolink_german) return this.siginfolink_german
|
||||
else if (this.$p.user_language.value == 'English' && this.siginfolink_english) return this.siginfolink_english
|
||||
},
|
||||
getSignaturInfoAvailable() {
|
||||
if(this.$p.user_language.value == 'German' && this.siginfolink_german) return true
|
||||
else if (this.$p.user_language.value == 'English' && this.siginfolink_english) return true
|
||||
else return false
|
||||
},
|
||||
getMoodleLink() {
|
||||
return this.moodle_link + this.projektarbeit.studiengang_kz
|
||||
return this.moodle_link + this.projektarbeit.studiengang_kz
|
||||
},
|
||||
getMessagePtStyle() {
|
||||
// adjust outer spacing and internal padding to appear similar to doenload button in size
|
||||
return {
|
||||
root: {
|
||||
style: {
|
||||
@@ -364,84 +244,102 @@ export const AbgabeStudentDetail = {
|
||||
})
|
||||
return qgatefound
|
||||
},
|
||||
isTitelEditAllowed() {
|
||||
return this.title_edit_allowed && !this.isViewMode && !this.projektarbeit?.note;
|
||||
},
|
||||
getTooltipVerspaetet() {
|
||||
return { value: this.$capitalize(this.$p.t('abgabetool/c4tooltipVerspaetet')), class: "custom-tooltip" }
|
||||
return {
|
||||
value: this.$capitalize(this.$p.t('abgabetool/c4tooltipVerspaetet')),
|
||||
class: "custom-tooltip"
|
||||
}
|
||||
},
|
||||
getTooltipVerpasst() {
|
||||
return { value: this.$capitalize(this.$p.t('abgabetool/c4tooltipVerpasst')), class: "custom-tooltip" }
|
||||
return {
|
||||
value: this.$capitalize(this.$p.t('abgabetool/c4tooltipVerpasst')),
|
||||
class: "custom-tooltip"
|
||||
}
|
||||
},
|
||||
getTooltipAbzugeben() {
|
||||
return { value: this.$capitalize(this.$p.t('abgabetool/c4tooltipAbzugeben')), class: "custom-tooltip" }
|
||||
return {
|
||||
value: this.$capitalize(this.$p.t('abgabetool/c4tooltipAbzugeben')),
|
||||
class: "custom-tooltip"
|
||||
}
|
||||
},
|
||||
getTooltipStandard() {
|
||||
return { value: this.$capitalize(this.$p.t('abgabetool/c4tooltipStandardv2')), class: "custom-tooltip" }
|
||||
return {
|
||||
value: this.$capitalize(this.$p.t('abgabetool/c4tooltipStandardv2')),
|
||||
class: "custom-tooltip"
|
||||
}
|
||||
},
|
||||
getTooltipAbgegeben() {
|
||||
return { value: this.$capitalize(this.$p.t('abgabetool/c4tooltipAbgegeben')), class: "custom-tooltip" }
|
||||
return {
|
||||
value: this.$capitalize(this.$p.t('abgabetool/c4tooltipAbgegeben')),
|
||||
class: "custom-tooltip"
|
||||
}
|
||||
},
|
||||
getTooltipFixtermin() {
|
||||
return { value: this.$capitalize(this.$p.t('abgabetool/c4tooltipFixtermin')), class: "custom-tooltip" }
|
||||
return {
|
||||
value: this.$capitalize(this.$p.t('abgabetool/c4tooltipFixtermin')),
|
||||
class: "custom-tooltip"
|
||||
}
|
||||
},
|
||||
getTooltipAbgabeDetected() {
|
||||
return { value: this.$capitalize(this.$p.t('abgabetool/c4tooltipAbgabeDetected')), class: "custom-tooltip" }
|
||||
return {
|
||||
value: this.$capitalize(this.$p.t('abgabetool/c4tooltipAbgabeDetected')),
|
||||
class: "custom-tooltip"
|
||||
}
|
||||
},
|
||||
getTooltipNotAllowedToUpload() {
|
||||
if(this.isViewMode) {
|
||||
return { value: this.$capitalize(this.$p.t('abgabetool/c4studentAbgabeNotAllowedInViewMode')), class: "custom-tooltip" }
|
||||
return {
|
||||
value: this.$capitalize(this.$p.t('abgabetool/c4studentAbgabeNotAllowedInViewMode')),
|
||||
class: "custom-tooltip"
|
||||
}
|
||||
} else {
|
||||
return { value: this.$capitalize(this.$p.t('abgabetool/c4studentAbgabeNotAllowedRegularv2')), class: "custom-tooltip" }
|
||||
return {
|
||||
value: this.$capitalize(this.$p.t('abgabetool/c4studentAbgabeNotAllowedRegular')),
|
||||
class: "custom-tooltip"
|
||||
}
|
||||
}
|
||||
},
|
||||
getTooltipBeurteilungerforderlich() {
|
||||
return { value: this.$capitalize(this.$p.t('abgabetool/c4tooltipBeurteilungerforderlich')), class: "custom-tooltip" }
|
||||
return {
|
||||
value: this.$capitalize(this.$p.t('abgabetool/c4tooltipBeurteilungerforderlich')),
|
||||
class: "custom-tooltip"
|
||||
}
|
||||
},
|
||||
getTooltipBestanden() {
|
||||
return { value: this.$p.t('abgabetool/c4tooltipBestanden'), class: "custom-tooltip" }
|
||||
return {
|
||||
value: this.$p.t('abgabetool/c4tooltipBestanden'),
|
||||
class: "custom-tooltip"
|
||||
}
|
||||
},
|
||||
getTooltipNichtBestanden() {
|
||||
return { value: this.$p.t('abgabetool/c4tooltipNichtBestanden'), class: "custom-tooltip" }
|
||||
return {
|
||||
value: this.$p.t('abgabetool/c4tooltipNichtBestanden'),
|
||||
class: "custom-tooltip"
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
template: `
|
||||
<FhcOverlay :active="loading"></FhcOverlay>
|
||||
|
||||
<div v-if="projektarbeit">
|
||||
|
||||
<h5>{{$capitalize( $p.t('abgabetool/c4abgabeStudentenbereichv2') )}}</h5>
|
||||
<h5>{{$capitalize( $p.t('abgabetool/c4abgabeStudentenbereich') )}}</h5>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<p>{{$capitalize( $p.t('person/student') ) }}: {{projektarbeit?.student}}</p>
|
||||
|
||||
<p class="d-flex align-items-center gap-2 mb-2" style="min-width: 0;">
|
||||
<span
|
||||
:title="projektarbeit.titel"
|
||||
style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 480px;"
|
||||
>{{$capitalize( $p.t('abgabetool/c4titel') ) }}: {{projektarbeit?.titel}}</span>
|
||||
<button
|
||||
v-if="isTitelEditAllowed"
|
||||
class="btn btn-sm btn-outline-secondary border-0 p-1"
|
||||
v-tooltip.right="{ value: $capitalize($p.t('abgabetool/c4titelBearbeiten')), class: 'custom-tooltip' }"
|
||||
@click="openTitelEdit"
|
||||
>
|
||||
<i class="fa-solid fa-pen"></i>
|
||||
</button>
|
||||
</p>
|
||||
|
||||
<p>{{$capitalize( $p.t('abgabetool/c4betreuerv2') ) }}: {{projektarbeit ? $p.t('abgabetool/c4betrart' + projektarbeit.betreuerart_kurzbz) + ' ' + projektarbeit.betreuer : ''}}</p>
|
||||
<p> {{$capitalize( $p.t('person/student') ) }}: {{projektarbeit?.student}}</p>
|
||||
<p> {{$capitalize( $p.t('abgabetool/c4titel') ) }}: {{projektarbeit?.titel}}</p>
|
||||
<p> {{$capitalize( $p.t('abgabetool/c4betreuerv2') ) }}: {{projektarbeit ? $p.t('abgabetool/c4betrart' + projektarbeit.betreuerart_kurzbz) + ' ' + projektarbeit.betreuer : ''}}</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="row">
|
||||
<p>{{ $p.t('abgabetool/c4checkoutStgMoodleInfos') }}
|
||||
<a :href="getMoodleLink" target="_blank">Moodle</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="row" v-if="getSignaturInfoAvailable">
|
||||
<a :href="getSignaturInfoLink" target="_blank">{{$p.t('abgabetool/c4signaturinfo')}} <i class="fa-solid fa-circle-info"></i></a>
|
||||
</div>
|
||||
<p>{{ $p.t('abgabetool/c4checkoutStgMoodleInfos') }}
|
||||
<a :href="getMoodleLink" target="_blank">Moodle</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -459,6 +357,7 @@ export const AbgabeStudentDetail = {
|
||||
<i v-else-if="termin.dateStyle == 'beurteilungerforderlich'" v-tooltip.right="getTooltipBeurteilungerforderlich" class="fa-solid fa-list-check"></i>
|
||||
<i v-else-if="termin.dateStyle == 'bestanden'" v-tooltip.right="getTooltipBestanden" class="fa-solid fa-check"></i>
|
||||
<i v-else-if="termin.dateStyle == 'nichtbestanden'" v-tooltip.right="getTooltipNichtBestanden" class="fa-solid fa-circle-exclamation"></i>
|
||||
|
||||
</div>
|
||||
<div class="text-start px-2" style="min-width: 150px; max-width: 300px; margin-left: 40px">
|
||||
<span>{{ termin ? $p.t('abgabetool/c4paatyp' + termin.paabgabetyp_kurzbz) : '' }}</span>
|
||||
@@ -509,6 +408,8 @@ export const AbgabeStudentDetail = {
|
||||
</div>
|
||||
</template>
|
||||
</Inplace>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row mt-2">
|
||||
@@ -529,7 +430,7 @@ export const AbgabeStudentDetail = {
|
||||
</VueDatePicker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col-12 col-md-3 fw-bold align-content-center">{{$capitalize( $p.t('abgabetool/c4abgabetyp') )}}</div>
|
||||
<div class="col-12 col-md-9">
|
||||
@@ -565,7 +466,7 @@ export const AbgabeStudentDetail = {
|
||||
<div class="col-12 col-md-9">
|
||||
<template v-if="termin?.abgabedatum">
|
||||
<div class="row">
|
||||
<div style="width:100px; align-content: end;">
|
||||
<div style="width:100px; align-content: center;">
|
||||
<h6>{{ termin.abgabedatum?.split("-").reverse().join(".") }}</h6>
|
||||
</div>
|
||||
|
||||
@@ -580,6 +481,9 @@ export const AbgabeStudentDetail = {
|
||||
<Message v-else-if="termin?.signatur == false" severity="error" :closable="false" :pt="getMessagePtStyle"> {{ $p.t('abgabetool/c4keineSignatur') }} </Message>
|
||||
<Message v-else-if="termin?.signatur == 'error'" severity="warn" :closable="false" :pt="getMessagePtStyle"> {{ $p.t('abgabetool/c4signaturServerError') }} </Message>
|
||||
</div>
|
||||
<!-- <div v-else class="col-auto">-->
|
||||
<!-- <Message severity="info" :closable="false" :pt="getMessagePtStyle"> {{ $p.t('abgabetool/c4noFileFound') }} </Message>-->
|
||||
<!-- </div>-->
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -638,66 +542,25 @@ export const AbgabeStudentDetail = {
|
||||
<h5>{{ $capitalize( $p.t('abgabetool/c4keineAbgabetermineGefunden') )}}</h5>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-if="confetti_on_endupload" id="confetti-container"></div>
|
||||
|
||||
<bs-modal
|
||||
ref="modalTitelEdit"
|
||||
class="bootstrap-prompt"
|
||||
dialogClass="bordered-modal"
|
||||
bodyClass="px-4 py-4"
|
||||
>
|
||||
<template v-slot:title>
|
||||
{{$capitalize( $p.t('abgabetool/c4titelBearbeiten') )}}
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="mb-2">
|
||||
<label class="form-label fw-bold">
|
||||
{{$capitalize( $p.t('abgabetool/c4titel') )}}
|
||||
</label>
|
||||
<Textarea
|
||||
v-model="editingTitel"
|
||||
rows="2"
|
||||
maxlength="1024"
|
||||
class="form-control w-100"
|
||||
@keydown.enter.prevent="saveTitel"
|
||||
/>
|
||||
<div class="form-text text-end">{{ editingTitel.length }} / 1024</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:footer>
|
||||
<button
|
||||
class="btn btn-secondary"
|
||||
@click="$refs.modalTitelEdit.hide()"
|
||||
>
|
||||
{{$capitalize( $p.t('abgabetool/c4Cancel') )}}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
:disabled="!editingTitel.trim()"
|
||||
@click="saveTitel"
|
||||
>
|
||||
<i class="fa-solid fa-floppy-disk me-1"></i>
|
||||
{{$capitalize( $p.t('ui/speichern') )}}
|
||||
</button>
|
||||
</template>
|
||||
</bs-modal>
|
||||
|
||||
</div>
|
||||
|
||||
<bs-modal
|
||||
ref="modalContainerEnduploadZusatzdaten"
|
||||
class="bootstrap-prompt"
|
||||
dialogClass="bordered-modal modal-lg"
|
||||
bodyClass="px-4 py-4">
|
||||
dialogClass="bordered-modal modal-lg">
|
||||
<template v-slot:title>
|
||||
<div>
|
||||
{{$capitalize( $p.t('abgabetool/c4enduploadZusatzdaten') )}}
|
||||
</div>
|
||||
<div class="row mb-3 align-items-start">
|
||||
|
||||
<p class="ml-4 mr-4">Student UID: {{ projektarbeit?.student_uid}}</p>
|
||||
|
||||
</div>
|
||||
<div class="row mb-3 align-items-start">
|
||||
|
||||
<p class="ml-4 mr-4">{{$capitalize( $p.t('abgabetool/c4titel') )}}: {{ projektarbeit?.titel }}</p>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
@@ -713,6 +576,15 @@ export const AbgabeStudentDetail = {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- lektor fills these out-->
|
||||
<!-- <div class="row mb-3 align-items-start">-->
|
||||
<!-- <div class="row">Kontrollierte Schlagwörter</div>-->
|
||||
<!-- <div class="row">-->
|
||||
<!-- <Textarea v-model="form.kontrollschlagwoerter"></Textarea>-->
|
||||
<!-- </div>-->
|
||||
<!-- -->
|
||||
<!-- -->
|
||||
<!-- </div>-->
|
||||
<div class="row mb-3 align-items-start">
|
||||
<div class="row">{{$capitalize( $p.t('abgabetool/c4schlagwoerterGer') )}}</div>
|
||||
<div class="row">
|
||||
@@ -759,6 +631,7 @@ export const AbgabeStudentDetail = {
|
||||
<div class="col-9"></div>
|
||||
<div class="col-2"><p>{{$capitalize( $p.t('abgabetool/c4gelesenUndAkzeptiert') )}}</p></div>
|
||||
<div class="col-1">
|
||||
|
||||
<Checkbox
|
||||
v-model="eidAkzeptiert"
|
||||
:binary="true"
|
||||
@@ -774,8 +647,8 @@ export const AbgabeStudentDetail = {
|
||||
<div v-show="!allowedToSaveZusatzdaten">{{ $p.t('abgabetool/c4zusatzdatenausfuellen') }}</div>
|
||||
<button class="btn btn-primary" :disabled="!getAllowedToSendEndupload" @click="triggerEndupload">{{$capitalize( $p.t('ui/hochladen') )}}</button>
|
||||
</template>
|
||||
|
||||
</bs-modal>
|
||||
|
||||
`,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,251 +0,0 @@
|
||||
import AbgabeterminStatusLegende from "./StatusLegende.js";
|
||||
import {formatDateTime} from "./dateUtils.js";
|
||||
|
||||
export const AbgabeStudentTimeline = {
|
||||
name: "AbgabeStudentTimeline",
|
||||
components: {
|
||||
AbgabeterminStatusLegende,
|
||||
Timeline: primevue.timeline,
|
||||
},
|
||||
props: {
|
||||
projekte: { type: Array, default: () => [] },
|
||||
notenOptions: { type: Array, default: () => [] },
|
||||
formatDateFn: { type: Function, required: true }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
legendExpanded: false,
|
||||
expandedProjects: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
student() {
|
||||
return this.projekte?.[0] ?? null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
projekte: {
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
// open all projects by default whenever the student changes
|
||||
const state = {}
|
||||
val?.forEach(p => { state[p.projektarbeit_id] = true })
|
||||
this.expandedProjects = state
|
||||
this.legendExpanded = false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getNoteBezeichnung(projektarbeit) {
|
||||
if(projektarbeit.note && this.notenOptions) {
|
||||
const noteOpt = this.notenOptions.find(opt => opt.note == projektarbeit.note)
|
||||
return noteOpt?.bezeichnung
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
getSavedTerminInfoString(termin) {
|
||||
const isUpdate = termin.updateamum != null;
|
||||
|
||||
const fullname = isUpdate
|
||||
? termin.updatevon_fullname
|
||||
: termin.insertvon_fullname;
|
||||
|
||||
const datetime = isUpdate
|
||||
? termin.updateamum
|
||||
: termin.insertamum;
|
||||
|
||||
return this.$p.t('ui/savedAtByV3', [formatDateTime(datetime), fullname])
|
||||
},
|
||||
getItemBezeichnung(item) {
|
||||
if (!item?.bezeichnung) return ''
|
||||
return item.bezeichnung?.bezeichnung ?? item.bezeichnung
|
||||
},
|
||||
getItemNote(item) {
|
||||
if (!item?.note) return ''
|
||||
if (item.note?.bezeichnung) return item.note.bezeichnung
|
||||
return this.notenOptions?.find(n => n.note == item.note)?.bezeichnung ?? String(item.note)
|
||||
},
|
||||
getIconClass(dateStyle) {
|
||||
return ({
|
||||
verspaetet: 'fa-solid fa-triangle-exclamation',
|
||||
verpasst: 'fa-solid fa-calendar-xmark',
|
||||
abzugeben: 'fa-solid fa-hourglass-half',
|
||||
standard: 'fa-solid fa-clock',
|
||||
abgegeben: 'fa-solid fa-paperclip',
|
||||
beurteilungerforderlich: 'fa-solid fa-list-check',
|
||||
bestanden: 'fa-solid fa-check',
|
||||
nichtbestanden: 'fa-solid fa-circle-exclamation',
|
||||
})[dateStyle] ?? ''
|
||||
},
|
||||
getBetreuerLabel(projekt) {
|
||||
return projekt.erstbetreuer_full_name
|
||||
|| (projekt.betreuer_vorname ? `${projekt.betreuer_vorname} ${projekt.betreuer_nachname}`.trim() : null)
|
||||
},
|
||||
toggleProject(id) {
|
||||
this.expandedProjects[id] = !this.expandedProjects[id]
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div v-if="student">
|
||||
|
||||
<div class="d-flex align-items-baseline gap-2 mb-3 pb-2 border-bottom">
|
||||
<span class="fw-bold fs-6">{{ student.student_vorname }} {{ student.student_nachname }}</span>
|
||||
<span class="text-muted small">{{ student.student_uid }}</span>
|
||||
<span v-if="student.matrikelnr" class="text-muted small ms-auto">{{ student.matrikelnr }}</span>
|
||||
</div>
|
||||
|
||||
<div v-for="projekt in projekte" :key="projekt.projektarbeit_id" class="mb-2">
|
||||
|
||||
<button
|
||||
class="btn btn-sm w-100 text-start d-flex align-items-center gap-2 rounded bg-light border-0 py-2 px-3"
|
||||
@click="toggleProject(projekt.projektarbeit_id)"
|
||||
>
|
||||
<i
|
||||
:class="expandedProjects[projekt.projektarbeit_id] ? 'fa-solid fa-chevron-down' : 'fa-solid fa-chevron-right'"
|
||||
style="width: 12px; flex-shrink: 0;"
|
||||
></i>
|
||||
<span class="fw-semibold text-truncate flex-grow-1" :title="projekt.titel">
|
||||
{{ projekt.titel || projekt.projekttyp_kurzbz || projekt.projektarbeit_id }}
|
||||
</span>
|
||||
|
||||
<span
|
||||
v-if="projekt.note"
|
||||
class="small fw-semibold mx-2 flex-shrink-0"
|
||||
>
|
||||
{{ getNoteBezeichnung(projekt) }}
|
||||
</span>
|
||||
|
||||
<span class="text-muted small me-1 flex-shrink-0">{{ projekt.studiensemester_kurzbz }}</span>
|
||||
<span class="badge bg-secondary flex-shrink-0">{{ projekt.abgabetermine?.length ?? 0 }}</span>
|
||||
</button>
|
||||
|
||||
<div v-show="expandedProjects[projekt.projektarbeit_id]" class="px-2 pt-1">
|
||||
|
||||
<div v-if="getBetreuerLabel(projekt)" class="text-muted small px-1 mb-2">
|
||||
{{ projekt.betreuerart || $capitalize($p.t('abgabetool/c4erstbetreuerv2')) }}:
|
||||
{{ getBetreuerLabel(projekt) }}
|
||||
</div>
|
||||
|
||||
<Timeline :value="projekt.abgabetermine" align="right">
|
||||
|
||||
<template #marker="slotProps">
|
||||
<!-- padding:0 overrides the 34px accordion left-padding from the -header CSS class -->
|
||||
<div
|
||||
:class="slotProps.item.dateStyle + '-header'"
|
||||
style="height: 26px; width: 26px; padding: 0; border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;"
|
||||
>
|
||||
<i :class="getIconClass(slotProps.item.dateStyle)" style="font-size: 0.75rem;"></i>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #opposite="slotProps">
|
||||
<div class="text-end small text-nowrap text-muted">
|
||||
{{ formatDateFn(slotProps.item.datum) }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #content="slotProps">
|
||||
<div class="small pb-1">
|
||||
|
||||
<div class="d-flex align-items-center gap-1 fw-semibold">
|
||||
|
||||
<div
|
||||
:class="slotProps.item.dateStyle + '-header'"
|
||||
style="height:20px;width:20px;padding:0;border-radius:3px;display:flex;align-items:center;justify-content:center;flex-shrink:0;"
|
||||
>
|
||||
<i :class="getIconClass(slotProps.item.dateStyle)" style="font-size:.65rem;"></i>
|
||||
</div>
|
||||
|
||||
<span>
|
||||
{{ getItemBezeichnung(slotProps.item) }}
|
||||
</span>
|
||||
|
||||
<i
|
||||
v-if="slotProps.item.fixtermin"
|
||||
class="fa-solid fa-lock text-muted"
|
||||
title="Fixtermin"
|
||||
></i>
|
||||
|
||||
<i
|
||||
v-if="slotProps.item.abgabedatum"
|
||||
class="fa-solid fa-file text-muted"
|
||||
:title="$capitalize($p.t('abgabetool/c4abgabedatum'))"
|
||||
></i>
|
||||
|
||||
<div class="flex-grow-1 text-end">
|
||||
<span
|
||||
v-if="slotProps.item.noteBackend?.bezeichnung"
|
||||
class="fw-bold"
|
||||
>
|
||||
{{ slotProps.item.noteBackend?.positiv
|
||||
? $capitalize($p.t('abgabetool/c4positivBenotet'))
|
||||
: $capitalize($p.t('abgabetool/c4negativBenotet'))
|
||||
}}
|
||||
</span>
|
||||
|
||||
<span
|
||||
v-else-if="slotProps.item.bezeichnung?.benotbar"
|
||||
class="fw-bold text-muted"
|
||||
>
|
||||
{{ $capitalize($p.t('abgabetool/c4notYetGraded')) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="slotProps.item.kurzbz"
|
||||
class="text-muted fst-italic ms-4"
|
||||
>
|
||||
{{ slotProps.item.kurzbz }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="slotProps.item.abgabedatum"
|
||||
class="small text-muted ms-4"
|
||||
>
|
||||
{{ $capitalize($p.t('abgabetool/c4abgabedatum')) }}:
|
||||
{{ formatDateFn(slotProps.item.abgabedatum) }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="slotProps.item.beurteilungsnotiz"
|
||||
class="small ms-4 mt-1 text-muted"
|
||||
>
|
||||
{{ slotProps.item.beurteilungsnotiz }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="slotProps.item.insertamum"
|
||||
class="small text-muted ms-4 mt-1"
|
||||
style="font-size: .72rem;"
|
||||
>
|
||||
<i class="fa-solid fa-clock-rotate-left me-1"></i>
|
||||
{{ getSavedTerminInfoString(slotProps.item) }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</Timeline>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3 border-top pt-2">
|
||||
<button
|
||||
class="btn btn-link btn-sm p-0 text-muted text-decoration-none d-flex align-items-center gap-1"
|
||||
@click="legendExpanded = !legendExpanded"
|
||||
>
|
||||
<i :class="legendExpanded ? 'fa-solid fa-chevron-down' : 'fa-solid fa-chevron-right'" style="font-size: 0.7rem;"></i>
|
||||
Legende
|
||||
</button>
|
||||
<div v-show="legendExpanded" class="mt-2">
|
||||
<AbgabeterminStatusLegende />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
`
|
||||
}
|
||||
|
||||
export default AbgabeStudentTimeline;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,9 +5,8 @@ import VueDatePicker from '../../vueDatepicker.js.php';
|
||||
import ApiAbgabe from '../../../api/factory/abgabe.js'
|
||||
import FhcOverlay from "../../Overlay/FhcOverlay.js";
|
||||
import { getDateStyleClass } from "./getDateStyleClass.js";
|
||||
import { dateFilter } from '../../../tabulator/filters/DatesManual.js';
|
||||
import { dateFilter } from '../../../tabulator/filters/Dates.js';
|
||||
import {splitMailsHelper} from "../../../helpers/EmailHelpers.js";
|
||||
import { formatISODate, getViennaTodayISO, toViennaDate } from "./dateUtils.js";
|
||||
|
||||
export const AbgabetoolMitarbeiter = {
|
||||
name: "AbgabetoolMitarbeiter",
|
||||
@@ -34,12 +33,7 @@ export const AbgabetoolMitarbeiter = {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
filteredRows: null,
|
||||
count: 0,
|
||||
filteredcount: 0,
|
||||
selectedcount: 0,
|
||||
qgate1FilterSelected: [],
|
||||
qgate2FilterSelected: [],
|
||||
tableData: null,
|
||||
abgabetypenBetreuer: null,
|
||||
detailIsFullscreen: false,
|
||||
phrasenPromise: null,
|
||||
@@ -54,7 +48,7 @@ export const AbgabetoolMitarbeiter = {
|
||||
allowedNotenOptions: null,
|
||||
notenOptionsNonFinal: null,
|
||||
serienTermin: Vue.reactive({
|
||||
datum: getViennaTodayISO(),
|
||||
datum: new Date(),
|
||||
bezeichnung: {
|
||||
paabgabetyp_kurzbz: 'zwischen',
|
||||
bezeichnung: 'Zwischenabgabe'
|
||||
@@ -76,7 +70,7 @@ export const AbgabetoolMitarbeiter = {
|
||||
abgabeTableOptions: {
|
||||
minHeight: 250,
|
||||
index: 'projektarbeit_id',
|
||||
layout: 'fitData',
|
||||
layout: 'fitDataStretch',
|
||||
placeholder: Vue.computed(() => this.$p.t('global/noDataAvailable')),
|
||||
selectable: true,
|
||||
selectableCheck: this.selectionCheck,
|
||||
@@ -134,82 +128,38 @@ export const AbgabetoolMitarbeiter = {
|
||||
handleClick: this.selectAllHandler
|
||||
},
|
||||
width: 50,
|
||||
cssClass: 'sticky-col',
|
||||
visible: true
|
||||
cssClass: 'sticky-col'
|
||||
},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4details'))), field: 'details', formatter: this.formAction, headerFilter: false, headerSort: false, width: 140, minWidth: 50, visible: true, tooltip: false, cssClass: 'sticky-col'},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4personenkennzeichen'))), headerFilter: true, field: 'pkz', formatter: this.pkzTextFormatter, minWidth: 140, visible: false,tooltip: false},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4vorname'))), field: 'vorname', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100,visible: false},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4nachname'))), field: 'nachname', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100,visible: true},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4studstatus'))), field: 'studienstatus', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 150, visible: false},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4orgformv2'))), field: 'orgform', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 50, visible: false},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4projekttyp'))), field: 'projekttyp_kurzbz', formatter: this.centeredTextFormatter, minWidth: 100,visible: true},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4stg'))), field: 'stg', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 50, visible: true},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4note'))), field: 'note_bez', headerFilter: true, visible: false, sorter: this.notenSorter, minWidth: 200, formatter: this.centeredTextFormatter},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4sem'))), field: 'studiensemester_kurzbz', headerFilter: true, formatter: this.centeredTextFormatter, visible: true, minWidth: 100},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4titel'))), field: 'titel', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, width: 500, visible: true},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4erstbetreuerv2'))), field: 'betreuer_full_name', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, visible: false},
|
||||
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4erstbetreuerTitelPre'))), field: 'betreuer_titelpre', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, visible: false},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4erstbetreuerVorname'))), field: 'betreuer_vorname', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, visible: true},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4erstbetreuerNachname'))), field: 'betreuer_nachname', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, visible: true},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4erstbetreuerTitelPost'))), field: 'betreuer_titelpost', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, visible: false},
|
||||
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4zweitbetreuerv2'))), field: 'zweitbetreuer_full_name', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, visible: false},
|
||||
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4zweitbetreuerTitelPre'))), field: 'zweitbetreuer_titelpre', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, visible: false},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4zweitbetreuerVorname'))), field: 'zweitbetreuer_vorname', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, visible: false},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4zweitbetreuerNachname'))), field: 'zweitbetreuer_nachname', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, visible: false},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4zweitbetreuerTitelPost'))), field: 'zweitbetreuer_titelpost', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, visible: false},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4betreuerartv2'))), field: 'betreuerart_kurzbz', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, visible: false},
|
||||
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4prevAbgabetermin'))),
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4details'))), field: 'details', formatter: this.detailFormatter, headerFilter: false, headerSort: false, widthGrow: 1, tooltip: false, cssClass: 'sticky-col'},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4personenkennzeichen'))), headerFilter: true, field: 'pkz', formatter: this.pkzTextFormatter, widthGrow: 1, tooltip: false},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4vorname'))), field: 'vorname', headerFilter: true, formatter: this.centeredTextFormatter,widthGrow: 1},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4nachname'))), field: 'nachname', headerFilter: true, formatter: this.centeredTextFormatter, widthGrow: 1},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4projekttyp'))), field: 'projekttyp_kurzbz', formatter: this.centeredTextFormatter, widthGrow: 1},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4stg'))), field: 'stg', headerFilter: true, formatter: this.centeredTextFormatter, widthGrow: 1},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4sem'))), field: 'studiensemester_kurzbz', headerFilter: true, formatter: this.centeredTextFormatter, widthGrow: 1},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4titel'))), field: 'titel', headerFilter: true, formatter: this.centeredTextFormatter, maxWidth: 500, widthGrow: 8},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4betreuerartv2'))), field: 'betreuerart_beschreibung',formatter: this.centeredTextFormatter, widthGrow: 1},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4prevAbgabetermin'))), field: 'prevTermin',
|
||||
headerFilter: dateFilter,
|
||||
headerFilterFunc: this.headerFilterTerminCol,
|
||||
sorter: this.sortFuncTerminCol,
|
||||
tooltip: this.toolTipFuncPrevTermin,
|
||||
field: 'prevTermin', formatter: this.abgabeterminFormatter, width: 250, visible: false},
|
||||
formatter: this.abgabterminFormatter, widthGrow: 1, width: 250, tooltip: false},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4nextAbgabetermin'))), field: 'nextTermin',
|
||||
headerFilter: dateFilter,
|
||||
headerFilterFunc: this.headerFilterTerminCol,
|
||||
sorter: this.sortFuncTerminCol,
|
||||
tooltip: this.toolTipFuncNextTermin,
|
||||
formatter: this.abgabeterminFormatter, width: 250, visible: true},
|
||||
formatter: this.abgabterminFormatter, widthGrow: 1, width: 250, tooltip: false},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4qgate1Status'))),
|
||||
headerFilter: this.qgateHeaderFilterEditor,
|
||||
headerFilterFunc: this.qgateHeaderFilterFunc,
|
||||
headerFilterParams: {},
|
||||
field: 'qgate1Status',
|
||||
formatter: this.centeredTextFormatter,
|
||||
titleFormatter: this.shortLongTitleFormatter,
|
||||
titleFormatterParams: {
|
||||
shortForm: 'QG1'
|
||||
},
|
||||
width: 50,
|
||||
tooltip: (e, cell) => {
|
||||
const data = cell.getData();
|
||||
return data.qgate1Status
|
||||
}
|
||||
},
|
||||
headerFilter: 'list',
|
||||
headerFilterParams: { valuesLookup: this.getQGateStatusList },
|
||||
field: 'qgate1Status', formatter: this.centeredTextFormatter, widthGrow: 1, width: 220, tooltip: false},
|
||||
{title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4qgate2Status'))),
|
||||
headerFilter: this.qgateHeaderFilterEditor,
|
||||
headerFilterFunc: this.qgateHeaderFilterFunc,
|
||||
headerFilterParams: {},
|
||||
field: 'qgate2Status',
|
||||
formatter: this.centeredTextFormatter,
|
||||
titleFormatter: this.shortLongTitleFormatter,
|
||||
titleFormatterParams: {
|
||||
shortForm: 'QG2'
|
||||
},
|
||||
width: 50,
|
||||
tooltip: (e, cell) => {
|
||||
const data = cell.getData();
|
||||
return data.qgate2Status
|
||||
}
|
||||
}
|
||||
headerFilter: 'list',
|
||||
headerFilterParams: { valuesLookup: this.getQGateStatusList },
|
||||
field: 'qgate2Status', formatter: this.centeredTextFormatter, widthGrow: 1, width: 220, tooltip: false}
|
||||
],
|
||||
persistence: false,
|
||||
persistenceID: 'abgabeTableBetreuer2026-05-26'
|
||||
persistenceID: 'abgabeTableBetreuer2026-02-26'
|
||||
},
|
||||
abgabeTableEventHandlers: [{
|
||||
event: "tableBuilt",
|
||||
@@ -240,388 +190,11 @@ export const AbgabetoolMitarbeiter = {
|
||||
})
|
||||
|
||||
this.selectedData = data
|
||||
this.selectedcount = data.length;
|
||||
}
|
||||
},
|
||||
{
|
||||
event: 'dataFiltered',
|
||||
handler: (filters, rows) => {
|
||||
this.filteredRows = rows;
|
||||
this.filteredcount = rows.length;
|
||||
|
||||
if (!this.selectedData.length) return;
|
||||
|
||||
const visibleData = new Set(rows.map(r => r.getData()));
|
||||
const filteredOut = this.selectedData.filter(sd => !visibleData.has(sd));
|
||||
|
||||
if (!filteredOut.length) return;
|
||||
|
||||
const filteredOutSet = new Set(filteredOut);
|
||||
this.$refs.abgabeTable.tabulator.getSelectedRows()
|
||||
.filter(r => filteredOutSet.has(r.getData()))
|
||||
.forEach(r => r.deselect());
|
||||
}
|
||||
}
|
||||
]};
|
||||
},
|
||||
methods: {
|
||||
notenSorter(a, b, aRow, bRow, column, dir, sorterParams) {
|
||||
const aData = aRow.getData()
|
||||
const bData = bRow.getData()
|
||||
return aData.note - bData.note
|
||||
},
|
||||
async openBenotung(type, link) {
|
||||
if(type === 'new') {
|
||||
window.open(link, '_blank')
|
||||
} else if(type === 'old') {
|
||||
if(await this.$fhcAlert.confirm({
|
||||
message: this.$p.t('abgabetool/c4aeltereParbeitBenotenv2'),
|
||||
acceptLabel: this.$capitalize(this.$p.t('abgabetool/c4AcceptAndProceed')),
|
||||
acceptClass: 'btn btn-danger',
|
||||
rejectLabel: this.$capitalize(this.$p.t('abgabetool/c4Cancel')),
|
||||
rejectClass: 'btn btn-outline-secondary'
|
||||
}) === false) {
|
||||
return false
|
||||
}
|
||||
|
||||
window.open(link, '_blank')
|
||||
} else {
|
||||
// show info text that no endupload with abgabe has been found
|
||||
if(await this.$fhcAlert.confirm({
|
||||
message: this.$p.t('abgabetool/c4keinEnduploadErfolgt'),
|
||||
acceptLabel: this.$capitalize(this.$p.t('abgabetool/c4AcceptAndProceed')),
|
||||
acceptClass: 'btn btn-danger',
|
||||
rejectLabel: this.$capitalize(this.$p.t('abgabetool/c4Cancel')),
|
||||
rejectClass: 'btn btn-outline-secondary'
|
||||
}) === false) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
formAction(cell) {
|
||||
|
||||
const actionButtons = document.createElement('div');
|
||||
actionButtons.className = "d-flex gap-3";
|
||||
actionButtons.style.display = "flex";
|
||||
actionButtons.style.alignItems = "stretch";
|
||||
actionButtons.style.justifyContent = "start";
|
||||
actionButtons.style.height = "100%";
|
||||
|
||||
const val = cell.getValue();
|
||||
const data = cell.getRow().getData()
|
||||
|
||||
const createButton = (iconClass, titleKey, clickHandler) => {
|
||||
const btn = document.createElement('button');
|
||||
btn.className = 'btn btn-outline-secondary';
|
||||
btn.style.display = "flex";
|
||||
btn.style.alignItems = "center"; // center icon vertically
|
||||
btn.style.justifyContent = "center"; // center icon horizontally
|
||||
btn.style.height = "100%"; // fill parent container height
|
||||
btn.style.aspectRatio = "1 / 1"; // keep square shape (optional)
|
||||
btn.style.padding = "0"; // remove extra padding for compactness
|
||||
if(iconClass == 'fa fa-timeline') btn.style.transform = "rotate(90deg)";
|
||||
btn.innerHTML = `<i class="${iconClass}" style="color:#00649C; font-size:1.1rem;"></i>`;
|
||||
btn.title = this.$capitalize(this.$p.t(titleKey));
|
||||
btn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
clickHandler();
|
||||
});
|
||||
return btn;
|
||||
};
|
||||
|
||||
actionButtons.append(
|
||||
createButton('fa fa-folder-open', 'abgabetool/c4details', () => this.setDetailComponent(val)),
|
||||
);
|
||||
|
||||
if(data.isCurrent && data.abgabetermine?.find(termin => termin.paabgabetyp_kurzbz == 'end' && termin.abgabedatum !== null) && data.beurteilungLinkNew) {
|
||||
actionButtons.append(createButton('fa fa-user-check', 'abgabetool/c4benoten', () => this.openBenotung('new', data.beurteilungLinkNew)))
|
||||
} else if(data.abgabetermine?.find(termin => termin.paabgabetyp_kurzbz == 'end' && termin.abgabedatum !== null) && data.beurteilungLinkOld) {
|
||||
actionButtons.append(createButton('fa fa-user-check', 'abgabetool/c4benoten', () => this.openBenotung('old', data.beurteilungLinkOld)))
|
||||
}
|
||||
|
||||
if(this.checkForZweitbetreuerTokenMailAvailability(data)) {
|
||||
actionButtons.append(createButton('fa fa-envelope-open-text', 'abgabetool/c4zweitBegutachterTokenMailSenden', () => this.sendZweitbetreuerToken(data)))
|
||||
|
||||
}
|
||||
|
||||
return actionButtons;
|
||||
},
|
||||
checkForZweitbetreuerTokenMailAvailability(data) {
|
||||
const hasEndabgabeWithUpload = !!data.abgabetermine.find(termin => termin.abgabedatum !== null && termin.paabgabetyp_kurzbz == 'end')
|
||||
const hasZweitbetreuerWithoutBenutzerUid = data.zweitbetreuer_person_id !== null && data.zweitbetreuer_benutzer_uid === null
|
||||
|
||||
return hasEndabgabeWithUpload && hasZweitbetreuerWithoutBenutzerUid
|
||||
},
|
||||
sendZweitbetreuerToken(data) {
|
||||
|
||||
this.$api.call(ApiAbgabe.sendZweitbetreuerTokenMail(data.projektarbeit_id, data.betreuer_person_id, data.student_uid))
|
||||
.then(res => {
|
||||
if(res.meta.status == 'success') this.$fhcAlert.alertSuccess(this.$p.t('abgabetool/c4zweitBegutachterTokenMailSuccess'))
|
||||
})
|
||||
},
|
||||
getDateStyleHtml(dateStyle) {
|
||||
const iconMap = {
|
||||
'verspaetet': '<i class="fa-solid fa-triangle-exclamation"></i>',
|
||||
'verpasst': '<i class="fa-solid fa-calendar-xmark"></i>',
|
||||
'abzugeben': '<i class="fa-solid fa-hourglass-half"></i>',
|
||||
'standard': '<i class="fa-solid fa-clock"></i>',
|
||||
'abgegeben': '<i class="fa-solid fa-paperclip"></i>',
|
||||
'beurteilungerforderlich': '<i class="fa-solid fa-list-check"></i>',
|
||||
'bestanden': '<i class="fa-solid fa-check"></i>',
|
||||
'nichtbestanden': '<i class="fa-solid fa-circle-exclamation"></i>',
|
||||
};
|
||||
return iconMap[dateStyle] ?? '';
|
||||
},
|
||||
statusHeaderFilterEditor(cell, onRendered, success, cancel, editorParams) {
|
||||
const options = [
|
||||
{ label: this.$p.t('abgabetool/c4positivBenotet'), value: 'bestanden', dateStyle: 'bestanden' },
|
||||
{ label: this.$p.t('abgabetool/c4negativBenotet'), value: 'nichtbestanden', dateStyle: 'nichtbestanden' },
|
||||
{ label: this.$p.t('abgabetool/c4tooltipVerspaetet'), value: 'verspaetet', dateStyle: 'verspaetet' },
|
||||
{ label: this.$p.t('abgabetool/c4tooltipVerpasst'), value: 'verpasst', dateStyle: 'verpasst' },
|
||||
{ label: this.$p.t('abgabetool/c4tooltipAbzugeben'), value: 'abzugeben', dateStyle: 'abzugeben' },
|
||||
{ label: this.$p.t('abgabetool/c4tooltipAbgegeben'), value: 'abgegeben', dateStyle: 'abgegeben' },
|
||||
{ label: this.$p.t('abgabetool/c4tooltipBeurteilungerforderlich'), value: 'beurteilungerforderlich', dateStyle: 'beurteilungerforderlich' },
|
||||
{ label: this.$p.t('abgabetool/c4tooltipStandardv2'), value: 'standard', dateStyle: 'standard' },
|
||||
];
|
||||
|
||||
const field = cell.getField();
|
||||
const stateKey = field + 'FilterSelected'; // e.g. dateStyleFilterSelected
|
||||
let selected = [...(this[stateKey] || [])];
|
||||
|
||||
const wrapper = document.createElement('div');
|
||||
wrapper.style.cssText = 'position: relative; width: 100%;';
|
||||
|
||||
const display = document.createElement('input');
|
||||
display.readOnly = true;
|
||||
display.placeholder = '';
|
||||
display.style.cssText = 'padding: 4px; width: 100%; box-sizing: border-box; cursor: default; border: 1px solid; outline: none; background: #fff; appearance: none; caret-color: transparent;';
|
||||
|
||||
const dropdown = document.createElement('div');
|
||||
dropdown.style.cssText = 'display: none; position: fixed; background: #fff; border: 1px solid; z-index: 9999; min-width: 220px; box-shadow: 0 2px 6px rgba(0,0,0,0.15);';
|
||||
|
||||
const updateDisplay = () => {
|
||||
display.value = options
|
||||
.filter(o => selected.includes(o.value))
|
||||
.map(o => o.label)
|
||||
.join(', ');
|
||||
};
|
||||
|
||||
options.forEach(opt => {
|
||||
const row = document.createElement('label');
|
||||
row.style.cssText = 'display: flex; align-items: center; gap: 0; cursor: pointer; white-space: nowrap; padding-right: 8px;';
|
||||
row.addEventListener('mousedown', e => e.preventDefault());
|
||||
|
||||
const cb = document.createElement('input');
|
||||
cb.type = 'checkbox';
|
||||
cb.value = opt.value;
|
||||
cb.checked = selected.includes(opt.value);
|
||||
cb.style.cssText = 'margin: 0 6px;';
|
||||
cb.addEventListener('change', () => {
|
||||
selected = cb.checked
|
||||
? [...selected, opt.value]
|
||||
: selected.filter(v => v !== opt.value);
|
||||
this[stateKey] = [...selected];
|
||||
updateDisplay();
|
||||
success([...selected]);
|
||||
});
|
||||
|
||||
// icon badge — same look as cell
|
||||
const badge = document.createElement('div');
|
||||
badge.className = opt.dateStyle + '-header';
|
||||
badge.style.cssText = `min-width: 36px; height: 36px; display: flex; align-items: center;
|
||||
justify-content: center; flex-shrink: 0; padding: 0px 17px 0px 17px;`;
|
||||
badge.innerHTML = this.getDateStyleHtml(opt.dateStyle);
|
||||
|
||||
const labelText = document.createElement('span');
|
||||
labelText.textContent = opt.label;
|
||||
labelText.style.cssText = 'margin-left: 6px;';
|
||||
|
||||
row.appendChild(cb);
|
||||
row.appendChild(badge);
|
||||
row.appendChild(labelText);
|
||||
dropdown.appendChild(row);
|
||||
});
|
||||
|
||||
updateDisplay();
|
||||
|
||||
display.addEventListener('click', () => {
|
||||
if (dropdown.style.display === 'none') {
|
||||
const rect = display.getBoundingClientRect();
|
||||
dropdown.style.top = rect.bottom + 'px';
|
||||
dropdown.style.left = rect.left + 'px';
|
||||
dropdown.style.display = 'block';
|
||||
} else {
|
||||
dropdown.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
display.addEventListener('blur', () => {
|
||||
setTimeout(() => { dropdown.style.display = 'none'; }, 150);
|
||||
});
|
||||
|
||||
document.body.appendChild(dropdown);
|
||||
wrapper.appendChild(display);
|
||||
cell.getElement().addEventListener('remove', () => dropdown.remove());
|
||||
onRendered(() => display.focus());
|
||||
|
||||
return wrapper;
|
||||
},
|
||||
statusHeaderFilterFunc(filterVal, rowVal, rowData, filterParams) {
|
||||
if (!filterVal || !filterVal.length) return true;
|
||||
// rowVal is the raw dateStyle string on the flat table
|
||||
return filterVal.some(val => val === rowVal);
|
||||
},
|
||||
qgateHeaderFilterEditor(cell, onRendered, success, cancel, editorParams) {
|
||||
|
||||
const options = [
|
||||
{ label: '[+] ' + this.$p.t('abgabetool/c4positivBenotet'), value: 'positive' },
|
||||
{ label: '[-] ' + this.$p.t('abgabetool/c4negativBenotet'), value: 'negative' },
|
||||
{ label: '[~] ' + this.$p.t('abgabetool/c4notYetGraded'), value: 'not_graded' },
|
||||
{ label: '[?] ' + this.$p.t('abgabetool/c4notSubmitted'), value: 'not_submitted' },
|
||||
{ label: '[o] ' + this.$p.t('abgabetool/c4notHappenedYet'), value: 'not_happened' },
|
||||
{ label: '[--] ' + this.$p.t('abgabetool/c4keinTerminVorhanden'), value: 'no_termin' },
|
||||
];
|
||||
|
||||
const field = cell.getField();
|
||||
const stateKey = field === 'qgate1Status' ? 'qgate1FilterSelected' : 'qgate2FilterSelected';
|
||||
let selected = [...(this[stateKey] || [])]; // restore persistence state
|
||||
|
||||
const wrapper = document.createElement('div');
|
||||
wrapper.style.cssText = 'position: relative; width: 100%;';
|
||||
|
||||
const display = document.createElement('input');
|
||||
display.readOnly = true;
|
||||
display.placeholder = '';
|
||||
display.style.cssText = 'padding: 4px; width: 100%; box-sizing: border-box; cursor: default; border: 1px solid; outline: none; background: #fff; appearance: none; caret-color: transparent;';
|
||||
|
||||
const dropdown = document.createElement('div');
|
||||
dropdown.style.cssText = 'display: none; position: fixed; background: #fff; border: 1px solid; z-index: 9999; min-width: 180px; box-shadow: 0 2px 6px rgba(0,0,0,0.15);';
|
||||
|
||||
options.forEach(opt => {
|
||||
const row = document.createElement('label');
|
||||
row.style.cssText = 'display: flex; align-items: center; gap: 6px; padding: 4px 8px; cursor: pointer; white-space: nowrap;';
|
||||
row.addEventListener('mousedown', e => e.preventDefault());
|
||||
|
||||
const cb = document.createElement('input');
|
||||
cb.type = 'checkbox';
|
||||
cb.value = opt.value;
|
||||
cb.checked = selected.includes(opt.value); // sync with persistence
|
||||
cb.addEventListener('change', () => {
|
||||
if (cb.checked) {
|
||||
selected.push(opt.value);
|
||||
} else {
|
||||
selected = selected.filter(v => v !== opt.value);
|
||||
}
|
||||
this[stateKey] = [...selected]; // sync with persistence
|
||||
display.value = options.filter(o => selected.includes(o.value)).map(o => o.label).join(', ');
|
||||
success([...selected]);
|
||||
});
|
||||
|
||||
row.appendChild(cb);
|
||||
row.appendChild(document.createTextNode(opt.label));
|
||||
dropdown.appendChild(row);
|
||||
});
|
||||
|
||||
display.value = options.filter(o => selected.includes(o.value)).map(o => o.label).join(', ');
|
||||
|
||||
display.addEventListener('click', () => {
|
||||
if (dropdown.style.display === 'none') {
|
||||
const rect = display.getBoundingClientRect();
|
||||
dropdown.style.top = rect.bottom + 'px';
|
||||
dropdown.style.left = rect.left + 'px';
|
||||
dropdown.style.display = 'block';
|
||||
} else {
|
||||
dropdown.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
display.addEventListener('blur', () => {
|
||||
setTimeout(() => { dropdown.style.display = 'none'; }, 150);
|
||||
});
|
||||
|
||||
document.body.appendChild(dropdown);
|
||||
wrapper.appendChild(display);
|
||||
|
||||
cell.getElement().addEventListener('remove', () => dropdown.remove());
|
||||
|
||||
onRendered(() => display.focus());
|
||||
|
||||
return wrapper;
|
||||
},
|
||||
qgateHeaderFilterFunc(filterVal, rowVal, rowData, filterParams) {
|
||||
if (!filterVal || !filterVal.length) return true;
|
||||
|
||||
const matches = (val) => {
|
||||
switch (val) {
|
||||
case 'positive': return rowVal === this.$p.t('abgabetool/c4positivBenotet');
|
||||
case 'negative': return rowVal === this.$p.t('abgabetool/c4negativBenotet');
|
||||
case 'not_graded': return rowVal === this.$p.t('abgabetool/c4notYetGraded');
|
||||
case 'not_submitted':return rowVal === this.$p.t('abgabetool/c4notSubmitted');
|
||||
case 'not_happened': return rowVal === this.$p.t('abgabetool/c4notHappenedYet');
|
||||
case 'no_termin': return rowVal === this.$p.t('abgabetool/c4keinTerminVorhanden');
|
||||
default: return true;
|
||||
}
|
||||
};
|
||||
|
||||
// OR logic — row passes if it matches any selected filter
|
||||
return filterVal.some(val => matches(val));
|
||||
},
|
||||
shortLongTitleFormatter(cell, formatterParams, onRendered) {
|
||||
const longForm = cell.getValue()
|
||||
const shortForm = formatterParams?.shortForm
|
||||
|
||||
if(longForm && shortForm) {
|
||||
return `<span class="full-text" style="max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin: 0px;">
|
||||
${longForm}
|
||||
</span>
|
||||
<span class="short-text" style="font-weight: bold; display: none;">
|
||||
${shortForm}
|
||||
</span>`
|
||||
} else {
|
||||
return `<span class="full-text" style="max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin: 0px;">
|
||||
${longForm}
|
||||
</span>`
|
||||
}
|
||||
|
||||
},
|
||||
toolTipFuncPrevTermin(e, cell, onRendered) {
|
||||
const data = cell.getData();
|
||||
return this.mapDateStyleToTabulatorTooltip(data.prevTermin.dateStyle);
|
||||
},
|
||||
toolTipFuncNextTermin(e, cell, onRendered) {
|
||||
const data = cell.getData();
|
||||
return this.mapDateStyleToTabulatorTooltip(data.nextTermin.dateStyle);
|
||||
},
|
||||
mapDateStyleToTabulatorTooltip(dateStyleString) {
|
||||
switch(dateStyleString) {
|
||||
case 'bestanden':
|
||||
return this.$p.t('abgabetool/c4tooltipBestanden')
|
||||
break;
|
||||
case 'nichtbestanden':
|
||||
return this.$p.t('abgabetool/c4tooltipNichtBestanden')
|
||||
break;
|
||||
case 'beurteilungerforderlich':
|
||||
return this.$p.t('abgabetool/c4tooltipBeurteilungerforderlich')
|
||||
break;
|
||||
case 'verspaetet':
|
||||
return this.$p.t('abgabetool/c4tooltipVerspaetet')
|
||||
break;
|
||||
case 'abgegeben':
|
||||
return this.$p.t('abgabetool/c4tooltipAbgegeben')
|
||||
break;
|
||||
case 'verpasst':
|
||||
return this.$p.t('abgabetool/c4tooltipVerpasst')
|
||||
break;
|
||||
case 'abzugeben':
|
||||
return this.$p.t('abgabetool/c4tooltipAbzugeben')
|
||||
break;
|
||||
case 'standard':
|
||||
return this.$p.t('abgabetool/c4tooltipStandardv2')
|
||||
break;
|
||||
default: return ''
|
||||
}
|
||||
},
|
||||
handlePaUpdated(projektarbeit) {
|
||||
this.checkAbgabetermineProjektarbeit(projektarbeit)
|
||||
this.$refs.abgabeTable.tabulator.redraw(true)
|
||||
@@ -634,7 +207,7 @@ export const AbgabetoolMitarbeiter = {
|
||||
})
|
||||
const uniqueRecipients = [...new Set(recipientList)];
|
||||
const subject = ""; // empty subject line
|
||||
splitMailsHelper(uniqueRecipients, param.originalEvent, subject, null, this.$fhcAlert, this.$p)
|
||||
splitMailsHelper(uniqueRecipients, param.originalEvent, subject, this.$fhcAlert, this.$p)
|
||||
},
|
||||
getQGateStatusList() {
|
||||
return [
|
||||
@@ -674,7 +247,7 @@ export const AbgabetoolMitarbeiter = {
|
||||
if (val instanceof Date) {
|
||||
dt = luxon.DateTime.fromJSDate(val);
|
||||
} else if (typeof val === "string") {
|
||||
dt = toViennaDate(val);
|
||||
dt = luxon.DateTime.fromISO(val);
|
||||
} else { // fallback
|
||||
dt = luxon.DateTime.fromMillis(Number(val));
|
||||
}
|
||||
@@ -803,9 +376,6 @@ export const AbgabetoolMitarbeiter = {
|
||||
}
|
||||
this.stateRestored = true
|
||||
|
||||
// ensure that the filterCollapseables thingy has the correct values
|
||||
this.$refs.abgabeTable.setSelectedFields();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
@@ -871,32 +441,6 @@ export const AbgabetoolMitarbeiter = {
|
||||
projekt.qgate2StatusRank = 1
|
||||
}
|
||||
})
|
||||
|
||||
// set shorthand statuscode once real status has been determined
|
||||
projekt.qgate1StatusShort = this.mapRankToShortStatus(projekt.qgate1StatusRank)
|
||||
projekt.qgate2StatusShort = this.mapRankToShortStatus(projekt.qgate2StatusRank)
|
||||
},
|
||||
mapRankToShortStatus(rank) {
|
||||
switch(rank){
|
||||
case 0: // kein termin vorhanden
|
||||
return '--'
|
||||
break;
|
||||
case 1: // noch nicht stattgefunden
|
||||
return 'o'
|
||||
break;
|
||||
case 2: // noch nicht abgegeben
|
||||
return '?'
|
||||
break;
|
||||
case 3: // noch nicht benotet
|
||||
return '~'
|
||||
break;
|
||||
case 4: // negativ benotet
|
||||
return '-'
|
||||
break;
|
||||
case 5: // positiv benotet
|
||||
return '+'
|
||||
break;
|
||||
}
|
||||
},
|
||||
checkAbgabetermineProjektarbeit(projekt) {
|
||||
const now = luxon.DateTime.now()
|
||||
@@ -906,7 +450,7 @@ export const AbgabetoolMitarbeiter = {
|
||||
// while already looping through each termin, calculate datestyle beforehand
|
||||
termin.dateStyle = getDateStyleClass(termin, this.notenOptions)
|
||||
|
||||
const date = toViennaDate(termin.datum).endOf('day')
|
||||
const date = luxon.DateTime.fromISO(termin.datum).endOf('day')
|
||||
termin.luxonDate = date
|
||||
termin.diffMs = date.toMillis() - now.toMillis(); // positive = future, negative = past
|
||||
|
||||
@@ -928,7 +472,7 @@ export const AbgabetoolMitarbeiter = {
|
||||
// seperate check for quality gates
|
||||
this.checkQualityGateStatus(projekt)
|
||||
},
|
||||
abgabeterminFormatter(cell) {
|
||||
abgabterminFormatter(cell) {
|
||||
const val = cell.getValue()
|
||||
|
||||
if(val) {
|
||||
@@ -960,15 +504,14 @@ export const AbgabetoolMitarbeiter = {
|
||||
break
|
||||
}
|
||||
|
||||
const typKurzbz = val.paabgabetyp_kurzbz ?? val.bezeichnung?.paabgabetyp_kurzbz
|
||||
const bezeichnung = this.$p.t('abgabetool/c4paatyp' + typKurzbz)
|
||||
const bezeichnung = val.bezeichnung?.bezeichnung ?? val.bezeichnung
|
||||
|
||||
return '<div style="display: flex; height: 100%">' +
|
||||
'<div class=' + val.dateStyle + "-header" + ' style="min-width:48px; height: 100%; padding: 0px; display: flex; align-items: center; justify-content: center;">' +
|
||||
icon +
|
||||
'<div class=' + val.dateStyle + "-header" + ' style="width:48px; height: 100%; padding: 0px; display: flex; align-items: center; justify-content: center;">' +
|
||||
icon +
|
||||
'</div>' +
|
||||
'<div style="margin-left: 4px;">' +
|
||||
'<p style="max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;">'+bezeichnung+' - '+ this.formatDate(val.datum)+'</p>' +
|
||||
'<p style="max-width: 100%; word-wrap: break-word; white-space: normal;">'+bezeichnung+' - '+ this.formatDate(val.datum)+'</p>' +
|
||||
'</div>'+
|
||||
'</div>'
|
||||
|
||||
@@ -992,19 +535,16 @@ export const AbgabetoolMitarbeiter = {
|
||||
},
|
||||
selectAllHandler(e, cell) {
|
||||
const table = cell.getTable();
|
||||
const rows = this.filteredRows ?? table.getRows();
|
||||
const rows = table.getRows();
|
||||
|
||||
// custom select all logic
|
||||
const allowed = rows.filter(r => r.getData().selectable);
|
||||
// since betreuerpage acctually has logic behind selectable flag, it is important to go over allowed only here
|
||||
const selected = allowed.every(r => r.isSelected());
|
||||
|
||||
if(selected){
|
||||
if(selected) {
|
||||
allowed.forEach(r => r.deselect());
|
||||
e.target.checked = false;
|
||||
} else {
|
||||
allowed.forEach(r => r.select());
|
||||
e.target.checked = true;
|
||||
}
|
||||
|
||||
// stop built-in handler
|
||||
@@ -1015,10 +555,18 @@ export const AbgabetoolMitarbeiter = {
|
||||
this.detailIsFullscreen = !this.detailIsFullscreen
|
||||
},
|
||||
getOptionLabelAbgabetyp(option){
|
||||
return this.$p.t('abgabetool/c4paatyp' + option.paabgabetyp_kurzbz)
|
||||
return option.bezeichnung
|
||||
},
|
||||
formatDate(dateParam) {
|
||||
return formatISODate(dateParam);
|
||||
const date = new Date(dateParam)
|
||||
// handle missing leading 0
|
||||
const padZero = (num) => String(num).padStart(2, '0');
|
||||
|
||||
const month = padZero(date.getMonth() + 1); // Months are zero-based
|
||||
const day = padZero(date.getDate());
|
||||
const year = date.getFullYear();
|
||||
|
||||
return `${day}.${month}.${year}`;
|
||||
},
|
||||
undoSelection(cell) {
|
||||
// checks if cells row is selected and unselects -> imitates columns which dont trigger row selection
|
||||
@@ -1031,8 +579,6 @@ export const AbgabetoolMitarbeiter = {
|
||||
},
|
||||
selectionCheck(row) {
|
||||
const data = row.getData()
|
||||
|
||||
// zweitbetreuer cant select projektarbeiten for serientermine
|
||||
if(data?.betreuerart_kurzbz == 'Zweitbegutachter') return false
|
||||
return true
|
||||
},
|
||||
@@ -1056,7 +602,7 @@ export const AbgabetoolMitarbeiter = {
|
||||
addSeries() {
|
||||
this.saving = true
|
||||
this.$api.call(ApiAbgabe.postSerientermin(
|
||||
this.serienTermin.datum,
|
||||
this.serienTermin.datum.toISOString(),
|
||||
this.serienTermin.bezeichnung.paabgabetyp_kurzbz,
|
||||
this.serienTermin.bezeichnung.bezeichnung,
|
||||
this.serienTermin.kurzbz,
|
||||
@@ -1154,7 +700,7 @@ export const AbgabetoolMitarbeiter = {
|
||||
termin.allowedToSave = paIsBenotet ? false : true
|
||||
|
||||
// lektoren are not allowed to delete deadlines with existing submissions
|
||||
termin.allowedToDelete = termin.allowedToSave && !termin.abgabedatum && !termin.note
|
||||
termin.allowedToDelete = termin.allowedToSave && !termin.abgabedatum
|
||||
|
||||
termin.bezeichnung = this.abgabeTypeOptions.find(opt => opt.paabgabetyp_kurzbz === termin.paabgabetyp_kurzbz)
|
||||
|
||||
@@ -1171,37 +717,28 @@ export const AbgabetoolMitarbeiter = {
|
||||
|
||||
},
|
||||
centeredTextFormatter(cell) {
|
||||
const longForm = cell.getValue()
|
||||
if(!longForm) return
|
||||
const data = cell.getData()
|
||||
const entry = Object.entries(data).find(entry => entry[1] == longForm)
|
||||
|
||||
// shortFormKey must have same keyname as longForm but with 'Short' appended
|
||||
const shortForm = data[entry[0]+'Short']
|
||||
|
||||
if(shortForm && longForm) {
|
||||
return `<div style="display: flex; justify-content: start; align-items: center; height: 100%; width: 100%;">
|
||||
<span class="full-text" style="max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin: 0px;">
|
||||
${longForm}
|
||||
</span>
|
||||
<span class="short-text" style="font-weight: bold; display: none;">
|
||||
${shortForm}
|
||||
</span>
|
||||
</div>`;
|
||||
} else {
|
||||
return '<div style="display: flex; justify-content: start; align-items: center; height: 100%">' +
|
||||
'<p style="max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin: 0px;">'+longForm+'</p></div>'
|
||||
}
|
||||
const val = cell.getValue()
|
||||
if(!val) return
|
||||
|
||||
return '<div style="display: flex; justify-content: center; align-items: center; height: 100%">' +
|
||||
'<p style="max-width: 100%; width: 100%; overflow-wrap: break-word; word-break: break-word; white-space: normal; margin: 0px; text-align: center">'+val+'</p></div>'
|
||||
},
|
||||
detailFormatter(cell) {
|
||||
return '<div style="display: flex; justify-content: start; align-items: center; height: 100%">' +
|
||||
return '<div style="display: flex; justify-content: center; align-items: center; height: 100%">' +
|
||||
'<a><i class="fa fa-folder-open" style="color:#00649C"></i></a></div>'
|
||||
},
|
||||
beurteilungFormatter(cell) {
|
||||
const val = cell.getValue()
|
||||
if(val) {
|
||||
return '<div style="display: flex; justify-content: center; align-items: center; height: 100%">' +
|
||||
'<a><i class="fa fa-file-pdf" style="color:#00649C"></i></a></div>'
|
||||
} else return '-'
|
||||
},
|
||||
pkzTextFormatter(cell) {
|
||||
const val = cell.getValue()
|
||||
|
||||
return '<div style="display: flex; justify-content: start; align-items: center; height: 100%">' +
|
||||
'<a style="max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;">'+val+'</a></div>'
|
||||
return '<div style="display: flex; justify-content: center; align-items: center; height: 100%">' +
|
||||
'<a style="max-width: 100%; word-wrap: break-word; white-space: normal;">'+val+'</a></div>'
|
||||
},
|
||||
tableResolve(resolve) {
|
||||
this.tableBuiltResolve = resolve
|
||||
@@ -1216,19 +753,15 @@ export const AbgabetoolMitarbeiter = {
|
||||
return (projekt.typ + projekt.kurzbz)?.toUpperCase()
|
||||
},
|
||||
setupData(data){
|
||||
|
||||
|
||||
this.projektarbeiten = data[0]
|
||||
this.domain = data[1]
|
||||
|
||||
this.projektarbeiten = data[0]?.retval?.map(projekt => {
|
||||
this.tableData = data[0]?.retval?.map(projekt => {
|
||||
this.checkAbgabetermineProjektarbeit(projekt)
|
||||
projekt.selectable = projekt.betreuerart_kurzbz !== 'Zweitbegutachter'
|
||||
|
||||
if(this.notenOptions && projekt.note) {
|
||||
const opt = this.notenOptions.find(n => n.note == projekt.note)
|
||||
// TODO: mehrsprachig englisch -> nevermind the english field in
|
||||
// notenoption->bezeichnung_mehrsprachig is ALWAYS german
|
||||
projekt.note_bez = opt?.bezeichnung
|
||||
}
|
||||
|
||||
return {
|
||||
...projekt,
|
||||
details: {
|
||||
@@ -1244,10 +777,9 @@ export const AbgabetoolMitarbeiter = {
|
||||
titel: projekt.titel
|
||||
}
|
||||
})
|
||||
this.count = this.projektarbeiten.length
|
||||
|
||||
this.$refs.abgabeTable.tabulator.setColumns(this.abgabeTableOptions.columns)
|
||||
this.$refs.abgabeTable.tabulator.setData(this.projektarbeiten);
|
||||
this.$refs.abgabeTable.tabulator.setData(this.tableData);
|
||||
},
|
||||
loadProjektarbeiten(all = false, callback) {
|
||||
this.$api.call(ApiAbgabe.getMitarbeiterProjektarbeiten(all))
|
||||
@@ -1296,20 +828,9 @@ export const AbgabetoolMitarbeiter = {
|
||||
}
|
||||
|
||||
this.serienTermin.upload_allowed = newVal.upload_allowed_default
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
countsToHTML() {
|
||||
return this.$p.t('global/ausgewaehlt')
|
||||
+ ': <strong>' + (this.selectedcount || 0) + '</strong>'
|
||||
+ ' | '
|
||||
+ this.$p.t('global/gefiltert')
|
||||
+ ': '
|
||||
+ '<strong>' + (this.filteredcount || 0) + '</strong>'
|
||||
+ ' | '
|
||||
+ this.$p.t('global/gesamt')
|
||||
+ ': <strong>' + (this.count || 0) + '</strong>';
|
||||
},
|
||||
emailItems() {
|
||||
const menu = []
|
||||
|
||||
@@ -1338,8 +859,6 @@ export const AbgabetoolMitarbeiter = {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
document.documentElement.classList.add('abgabetool');
|
||||
|
||||
this.phrasenPromise = this.$p.loadCategory(['abgabetool', 'global'])
|
||||
this.phrasenPromise.then(()=> {this.phrasenResolved = true})
|
||||
// fetch config to avoid hard coded links
|
||||
@@ -1381,16 +900,12 @@ export const AbgabetoolMitarbeiter = {
|
||||
mounted() {
|
||||
this.setupMounted()
|
||||
},
|
||||
beforeUnmount() {
|
||||
document.documentElement.classList.remove('abgabetool');
|
||||
},
|
||||
template: `
|
||||
<template v-if="phrasenResolved">
|
||||
<FhcOverlay :active="loading || saving"></FhcOverlay>
|
||||
|
||||
<bs-modal ref="modalContainerAddSeries" class="bootstrap-prompt"
|
||||
dialogClass="modal-lg"
|
||||
bodyClass="px-4 py-4">
|
||||
dialogClass="modal-lg">
|
||||
<template v-slot:title>
|
||||
<div>
|
||||
{{ $p.t('abgabetool/neueTerminserie') }}
|
||||
@@ -1410,7 +925,6 @@ export const AbgabetoolMitarbeiter = {
|
||||
:enable-time-picker="false"
|
||||
locale="de"
|
||||
format="dd.MM.yyyy"
|
||||
model-type="yyyy-MM-dd"
|
||||
:text-input="true"
|
||||
auto-apply>
|
||||
</VueDatePicker>
|
||||
@@ -1458,8 +972,7 @@ export const AbgabetoolMitarbeiter = {
|
||||
|
||||
<bs-modal ref="modalContainerAbgabeDetail" class="bootstrap-prompt"
|
||||
dialogClass="modal-xl" :allowFullscreenExpand="true"
|
||||
@toggle-fullscreen="handleToggleFullscreenDetail"
|
||||
bodyClass="px-4 py-4">
|
||||
@toggle-fullscreen="handleToggleFullscreenDetail">
|
||||
<template v-slot:title>
|
||||
<div>
|
||||
{{$p.t('abgabetool/c4abgabeMitarbeiterDetailTitle')}}
|
||||
@@ -1478,13 +991,12 @@ export const AbgabetoolMitarbeiter = {
|
||||
<!-- low max height on this vsplit wrapper to avoid padding scrolls, elements have their inherent height anyways -->
|
||||
<div id="abgabetable" style="max-height:40vw;">
|
||||
|
||||
<h2>{{$p.t('abgabetool/abgabetoolTitleBetreuer')}}</h2>
|
||||
<h2>{{$p.t('abgabetool/abgabetoolTitle')}}</h2>
|
||||
<hr>
|
||||
<core-filter-cmpt
|
||||
:title="''"
|
||||
@uuidDefined="handleUuidDefined"
|
||||
ref="abgabeTable"
|
||||
:description="countsToHTML"
|
||||
:newBtnShow="true"
|
||||
:newBtnLabel="$p.t('abgabetool/neueTerminserie')"
|
||||
:newBtnDisabled="!selectedData.length"
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
import AbgabeDetail from "./AbgabeStudentDetail.js";
|
||||
import ApiAbgabe from '../../../api/factory/abgabe.js'
|
||||
import ApiAuthinfo from '../../../api/factory/authinfo.js';
|
||||
import BsModal from "../../Bootstrap/Modal.js";
|
||||
import FhcOverlay from "../../Overlay/FhcOverlay.js";
|
||||
import { getDateStyleClass} from "./getDateStyleClass.js";
|
||||
import { validateThesisTitle } from './titleValidation.js'
|
||||
import ApiAuthinfo from "../../../api/factory/authinfo.js";
|
||||
|
||||
export const AbgabetoolStudent = {
|
||||
name: "AbgabetoolStudent",
|
||||
components: {
|
||||
Accordion: primevue.accordion,
|
||||
AccordionTab: primevue.accordiontab,
|
||||
Textarea: primevue.textarea,
|
||||
BsModal,
|
||||
AbgabeDetail,
|
||||
FhcOverlay
|
||||
@@ -20,11 +18,7 @@ export const AbgabetoolStudent = {
|
||||
return {
|
||||
notenOptions: Vue.computed(() => this.notenOptions),
|
||||
isViewMode: Vue.computed(() => this.isViewMode),
|
||||
moodle_link: Vue.computed(() => this.moodle_link),
|
||||
title_edit_allowed: Vue.computed(() => this.title_edit_allowed),
|
||||
confetti_on_endupload: Vue.computed(() => this.confetti_on_endupload),
|
||||
siginfolink_german: Vue.computed(() => this.siginfolink_german),
|
||||
siginfolink_english: Vue.computed(() => this.siginfolink_english)
|
||||
moodle_link: Vue.computed(() => this.moodle_link)
|
||||
}
|
||||
},
|
||||
props: {
|
||||
@@ -45,12 +39,6 @@ export const AbgabetoolStudent = {
|
||||
selectedProjektarbeit: null,
|
||||
moodle_link: null,
|
||||
uid: null,
|
||||
title_edit_allowed: null,
|
||||
confetti_on_endupload: null,
|
||||
siginfolink_german: null,
|
||||
siginfolink_english: null,
|
||||
editingTitel: '',
|
||||
editingProjektarbeit: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -62,67 +50,10 @@ export const AbgabetoolStudent = {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openTitelEdit(projektarbeit, event) {
|
||||
// stop the click from toggling the accordion tab
|
||||
event.stopPropagation();
|
||||
this.editingProjektarbeit = projektarbeit;
|
||||
this.editingTitel = projektarbeit.titel ?? '';
|
||||
this.$refs.modalTitelEdit.show();
|
||||
},
|
||||
async saveTitel() {
|
||||
const validation = validateThesisTitle(this.editingTitel);
|
||||
|
||||
if (!validation.isValid) {
|
||||
if (validation.error === 'empty') {
|
||||
this.$fhcAlert.alertWarning(this.$p.t('abgabetool/c4emptyThesisTitle'))
|
||||
} else if (validation.error === 'invalid_characters') {
|
||||
this.$fhcAlert.alertWarning(this.$p.t('abgabetool/c4invalidCharactersThesisTitle'))
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
const confirmed = await this.$fhcAlert.confirm({
|
||||
message: this.$p.t('abgabetool/c4confirmTitelSpeichern'),
|
||||
acceptLabel: this.$capitalize(this.$p.t('ui/speichern')),
|
||||
acceptClass: 'p-button-primary',
|
||||
rejectLabel: this.$capitalize(this.$p.t('abgabetool/c4Cancel')),
|
||||
rejectClass: 'p-button-secondary'
|
||||
});
|
||||
|
||||
if (confirmed === false) return;
|
||||
|
||||
this.loading = true;
|
||||
this.$api.call(
|
||||
ApiAbgabe.postStudentProjektarbeitTitel(
|
||||
this.editingProjektarbeit.projektarbeit_id,
|
||||
validation.cleanedTitle
|
||||
)
|
||||
).then(res => {
|
||||
if (res.meta.status === 'success') {
|
||||
// update the local list entry in-place so the accordion header reflects it immediately
|
||||
this.editingProjektarbeit.titel = res.data;
|
||||
// keep the open detail modal in sync if it happens to be showing this projektarbeit
|
||||
if (this.selectedProjektarbeit?.projektarbeit_id === this.editingProjektarbeit.projektarbeit_id) {
|
||||
this.selectedProjektarbeit.titel = res.data;
|
||||
}
|
||||
this.$fhcAlert.alertSuccess(this.$capitalize(this.$p.t('abgabetool/c4titelSavedSuccess')));
|
||||
this.$refs.modalTitelEdit.hide();
|
||||
} else {
|
||||
this.$fhcAlert.alertError(this.$capitalize(this.$p.t('abgabetool/c4titelSaveError')));
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleTitelUpdated(projektarbeit_id, titel) {
|
||||
const pa = this.projektarbeiten?.find(p => p.projektarbeit_id === projektarbeit_id);
|
||||
if (pa) pa.titel = titel;
|
||||
},
|
||||
checkQualityGatesStrict(termine) {
|
||||
let qgate1Passed = false
|
||||
let qgate2Passed = false
|
||||
|
||||
|
||||
termine.forEach(t => {
|
||||
const noteOption = this.notenOptions?.find(opt => opt.note == t.note)
|
||||
if(noteOption && noteOption.positiv) {
|
||||
@@ -139,7 +70,7 @@ export const AbgabetoolStudent = {
|
||||
checkQualityGatesOptional(termine) {
|
||||
const qgate1found = termine.find(t => t.paabgabetyp_kurzbz == 'qualgate1')
|
||||
const qgate2found = termine.find(t => t.paabgabetyp_kurzbz == 'qualgate2')
|
||||
|
||||
|
||||
let qgate1positiv = true
|
||||
if(qgate1found) {
|
||||
qgate1positiv = false
|
||||
@@ -180,35 +111,47 @@ export const AbgabetoolStudent = {
|
||||
this.loadAbgaben(details).then((res)=> {
|
||||
const pa = this.projektarbeiten?.find(projekarbeit => projekarbeit.projektarbeit_id == details.projektarbeit_id)
|
||||
pa.abgabetermine = res.data[0].retval
|
||||
|
||||
|
||||
const paIsBenotet = pa.note !== null
|
||||
|
||||
|
||||
pa.abgabetermine.forEach(termin => {
|
||||
termin.file = []
|
||||
termin.allowedToUpload = false
|
||||
|
||||
|
||||
if(termin.paabgabetyp_kurzbz == 'end') {
|
||||
// old assumed production logic when qgates are required
|
||||
// termin.allowedToUpload = !this.isPastDate(termin.datum) && this.checkQualityGatesStrict(pa.abgabetermine)
|
||||
|
||||
const inTime = termin.fixtermin ? !this.isPastDate(termin.datum) : true
|
||||
termin.allowedToUpload = inTime && this.checkQualityGatesOptional(pa.abgabetermine)
|
||||
|
||||
|
||||
// development purposes
|
||||
// termin.allowedToUpload = this.checkQualityGatesStrict(pa.abgabetermine)
|
||||
// termin.allowedToUpload = true
|
||||
|
||||
} else if(termin.fixtermin) {
|
||||
termin.allowedToUpload = !this.isPastDate(termin.datum)
|
||||
} else {
|
||||
termin.allowedToUpload = termin.upload_allowed
|
||||
// this could confuse people since we should dont show people this flag
|
||||
termin.allowedToUpload = termin.upload_allowed
|
||||
}
|
||||
|
||||
// blocks client upload button if projektarbeitet is already beurteilt und thus further abgaben on any termin should be blocked
|
||||
if(paIsBenotet) termin.allowedToUpload = false
|
||||
|
||||
|
||||
|
||||
termin.bezeichnung = this.abgabeTypeOptions.find(opt => opt.paabgabetyp_kurzbz === termin.paabgabetyp_kurzbz)
|
||||
termin.dateStyle = getDateStyleClass(termin, this.notenOptions)
|
||||
})
|
||||
|
||||
|
||||
pa.betreuer = this.buildBetreuer(pa)
|
||||
pa.student_uid = this.student_uid
|
||||
|
||||
|
||||
this.selectedProjektarbeit = pa
|
||||
|
||||
this.$refs.modalContainerAbgabeDetail.show()
|
||||
|
||||
|
||||
}).finally(()=>{this.loading=false})
|
||||
},
|
||||
centeredTextFormatter(cell) {
|
||||
@@ -230,8 +173,8 @@ export const AbgabetoolStudent = {
|
||||
},
|
||||
mailFormatter(cell) {
|
||||
const val = cell.getValue()
|
||||
return '<div style="display: flex; justify-content: center; align-items: center; height: 100%;">' +
|
||||
'<a href='+val+'><i class="fa fa-envelope" style="color:#00649C"></i></a></div>'
|
||||
return '<div style="display: flex; justify-content: center; align-items: center; height: 100%;">' +
|
||||
'<a href='+val+'><i class="fa fa-envelope" style="color:#00649C"></i></a></div>'
|
||||
},
|
||||
beurteilungFormatter(cell) {
|
||||
const val = cell.getValue()
|
||||
@@ -241,17 +184,19 @@ export const AbgabetoolStudent = {
|
||||
} else return '-'
|
||||
},
|
||||
buildMailToLink(projekt) {
|
||||
// should always be "projekt.mitarbeiter_uid +'@'+ this.domain", built in backend
|
||||
return 'mailto:' + projekt.email
|
||||
},
|
||||
buildBetreuer(abgabe) {
|
||||
return (abgabe.btitelpre ? abgabe.btitelpre + ' ' : '') + abgabe.bvorname + ' ' + abgabe.bnachname + (abgabe.btitelpost ? ' ' + abgabe.btitelpost : '')
|
||||
},
|
||||
async setupData(data){
|
||||
// this.projektarbeiten = data[0]
|
||||
const projektarbeiten = data[0] ?? null
|
||||
if(!projektarbeiten) return
|
||||
this.projektarbeiten = projektarbeiten.map(projekt => {
|
||||
let mode = 'detailTermine'
|
||||
|
||||
|
||||
return {
|
||||
...projekt,
|
||||
details: {
|
||||
@@ -285,14 +230,16 @@ export const AbgabetoolStudent = {
|
||||
.then(res => {
|
||||
resolve(res)
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
async setupMounted() {
|
||||
this.loadProjektarbeiten()
|
||||
},
|
||||
getAccTabHeaderForProjektarbeit(projektarbeit) {
|
||||
let title = ''
|
||||
|
||||
title += projektarbeit.titel ?? this.$p.t('abgabetool/keinTitel')
|
||||
|
||||
return title
|
||||
},
|
||||
getMailLink(projektarbeit) {
|
||||
@@ -300,31 +247,6 @@ export const AbgabetoolStudent = {
|
||||
return 'mailto:'+projektarbeit.email
|
||||
} else return ''
|
||||
},
|
||||
getZweitbetreuerMailLink(projektarbeit) {
|
||||
if(projektarbeit.zweitbetreuer_mail) {
|
||||
return 'mailto:'+projektarbeit.zweitbetreuer_mail
|
||||
} else return ''
|
||||
},
|
||||
hasZweitbetreuer(projektarbeit) {
|
||||
return !!(projektarbeit.zweitbetreuer_person_id || projektarbeit.zweitbetreuer)
|
||||
},
|
||||
getErstbetreuerEmailLabel(projektarbeit) {
|
||||
// with only one betreuer keep the generic label; with multiple betreuer
|
||||
// distinguish the email rows by their betreuungsart bezeichnung
|
||||
if(!this.hasZweitbetreuer(projektarbeit)) {
|
||||
return this.$capitalize(this.$p.t('abgabetool/c4betreuerEmailKontaktv2'))
|
||||
}
|
||||
const art = projektarbeit.betreuerart_kurzbz
|
||||
? this.$p.t('abgabetool/c4betrart' + projektarbeit.betreuerart_kurzbz)
|
||||
: this.$p.t('abgabetool/c4betreuerv2')
|
||||
return this.$capitalize(this.$p.t('abgabetool/c4emailBetreuungsart', [art]))
|
||||
},
|
||||
getZweitbetreuerEmailLabel(projektarbeit) {
|
||||
const art = projektarbeit.zweitbetreuer_betreuerart_kurzbz
|
||||
? this.$p.t('abgabetool/c4betrart' + projektarbeit.zweitbetreuer_betreuerart_kurzbz)
|
||||
: ''
|
||||
return this.$capitalize(this.$p.t('abgabetool/c4emailBetreuungsart', [art]))
|
||||
},
|
||||
getNoteBezeichnung(projektarbeit) {
|
||||
if(projektarbeit.note && this.notenOptions) {
|
||||
const noteOpt = this.notenOptions.find(opt => opt.note == projektarbeit.note)
|
||||
@@ -344,15 +266,12 @@ export const AbgabetoolStudent = {
|
||||
this.uid = authIdResponse.data.uid;
|
||||
},
|
||||
},
|
||||
watch: {},
|
||||
async created() {
|
||||
// make sure zoom media query doesnt spill ever to other CIS4 sites
|
||||
document.documentElement.classList.add('abgabetool');
|
||||
|
||||
this.phrasenPromise = this.$p.loadCategory(['abgabetool', 'global'])
|
||||
this.phrasenPromise.then(()=> {this.phrasenResolved = true})
|
||||
|
||||
|
||||
this.loading = true
|
||||
//TODO: SWITCH TO NOTEN API ONCE NOTENTOOL IS IN MASTER TO AVOID DUPLICATE API
|
||||
await this.$api.call(ApiAbgabe.getNoten()).then(res => {
|
||||
if(res.meta.status == 'success') {
|
||||
this.notenOptions = res.data[0]
|
||||
@@ -365,18 +284,16 @@ export const AbgabetoolStudent = {
|
||||
this.loading = false
|
||||
})
|
||||
|
||||
// fetch abgabetypen options
|
||||
this.$api.call(ApiAbgabe.getPaAbgabetypen()).then(res => {
|
||||
this.abgabeTypeOptions = res.data
|
||||
}).catch(e => {
|
||||
this.loading = false
|
||||
})
|
||||
|
||||
// fetch config to avoid hard coded links
|
||||
this.$api.call(ApiAbgabe.getConfigStudent()).then(res => {
|
||||
this.moodle_link = res.data?.moodle_link
|
||||
this.title_edit_allowed = res.data?.title_edit_allowed
|
||||
this.confetti_on_endupload = res.data?.confetti_on_endupload
|
||||
this.siginfolink_german = res.data?.siginfolink_german
|
||||
this.siginfolink_english = res.data?.siginfolink_english
|
||||
}).catch(e => {
|
||||
this.loading = false
|
||||
})
|
||||
@@ -386,73 +303,26 @@ export const AbgabetoolStudent = {
|
||||
mounted() {
|
||||
this.setupMounted()
|
||||
},
|
||||
beforeUnmount() {
|
||||
document.documentElement.classList.remove('abgabetool');
|
||||
},
|
||||
template: `
|
||||
<template v-if="phrasenResolved">
|
||||
<FhcOverlay :active="loading"></FhcOverlay>
|
||||
|
||||
<bs-modal ref="modalContainerAbgabeDetail" class="bootstrap-prompt"
|
||||
dialogClass="modal-xl" :allowFullscreenExpand="true" bodyClass="px-4 py-4">
|
||||
dialogClass="modal-xl" :allowFullscreenExpand="true">
|
||||
<template v-slot:title>
|
||||
<div>
|
||||
{{$capitalize( $p.t('abgabetool/c4abgabeStudentDetailTitle') )}}
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<AbgabeDetail
|
||||
:projektarbeit="selectedProjektarbeit"
|
||||
@titel-updated="handleTitelUpdated"
|
||||
></AbgabeDetail>
|
||||
</template>
|
||||
</bs-modal>
|
||||
<bs-modal
|
||||
ref="modalTitelEdit"
|
||||
class="bootstrap-prompt"
|
||||
dialogClass="bordered-modal"
|
||||
bodyClass="px-4 py-4"
|
||||
>
|
||||
<template v-slot:title>
|
||||
{{$capitalize( $p.t('abgabetool/c4titelBearbeiten') )}}
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="mb-2">
|
||||
<label class="form-label fw-bold">
|
||||
{{$capitalize( $p.t('abgabetool/c4titel') )}}
|
||||
</label>
|
||||
<Textarea
|
||||
v-model="editingTitel"
|
||||
rows="2"
|
||||
maxlength="1024"
|
||||
class="form-control w-100"
|
||||
@keydown.enter.prevent="saveTitel"
|
||||
/>
|
||||
<div class="form-text text-end">{{ editingTitel.length }} / 1024</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:footer>
|
||||
<button
|
||||
class="btn btn-secondary"
|
||||
@click="$refs.modalTitelEdit.hide()"
|
||||
>
|
||||
{{$capitalize( $p.t('abgabetool/c4Cancel') )}}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
:disabled="!editingTitel.trim()"
|
||||
@click="saveTitel"
|
||||
>
|
||||
<i class="fa-solid fa-floppy-disk me-1"></i>
|
||||
{{$capitalize( $p.t('ui/speichern') )}}
|
||||
</button>
|
||||
<AbgabeDetail :projektarbeit="selectedProjektarbeit"></AbgabeDetail>
|
||||
</template>
|
||||
</bs-modal>
|
||||
|
||||
<h2>{{$capitalize( $p.t('abgabetool/abgabetoolTitle') )}}</h2>
|
||||
<hr>
|
||||
|
||||
<div v-if="projektarbeiten === null || projektarbeiten?.length == 0">
|
||||
<div v-if="projektarbeiten === null">
|
||||
{{$capitalize( $p.t('abgabetool/c4abgabeStudentNoProjectsFound') )}}
|
||||
</div>
|
||||
|
||||
@@ -462,12 +332,8 @@ export const AbgabetoolStudent = {
|
||||
|
||||
<template #header>
|
||||
<div class="d-flex row w-100">
|
||||
<div class="text-start" :class="projektarbeit.note != null ? 'col-6' : 'col-12'"
|
||||
style="min-width: 0;">
|
||||
<span
|
||||
:title="getAccTabHeaderForProjektarbeit(projektarbeit)"
|
||||
style="display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 600px;"
|
||||
>{{getAccTabHeaderForProjektarbeit(projektarbeit)}}</span>
|
||||
<div class="text-start" :class="projektarbeit.note != null ? 'col-6' : 'col-12'">
|
||||
<span>{{getAccTabHeaderForProjektarbeit(projektarbeit)}}</span>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<span>{{getNoteBezeichnung(projektarbeit)}}</span>
|
||||
@@ -516,7 +382,7 @@ export const AbgabetoolStudent = {
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col-4 col-md-3 fw-bold">{{ getErstbetreuerEmailLabel(projektarbeit) }}</div>
|
||||
<div class="col-4 col-md-3 fw-bold">{{$capitalize( $p.t('abgabetool/c4betreuerEmailKontaktv2') )}}</div>
|
||||
<div class="col-8 col-md-9">
|
||||
<a :href="getMailLink(projektarbeit)"><i class="fa fa-envelope" style="color:#00649C"></i></a>
|
||||
</div>
|
||||
@@ -527,45 +393,17 @@ export const AbgabetoolStudent = {
|
||||
{{ projektarbeit.zweitbetreuer?.first }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="projektarbeit.zweitbetreuer_person_id || projektarbeit.zweitbetreuer" class="row mt-2">
|
||||
<div class="col-4 col-md-3 fw-bold">{{ getZweitbetreuerEmailLabel(projektarbeit) }}</div>
|
||||
<div class="col-8 col-md-9">
|
||||
<a v-if="projektarbeit.zweitbetreuer_mail" :href="getZweitbetreuerMailLink(projektarbeit)"><i class="fa fa-envelope" style="color:#00649C"></i></a>
|
||||
<span v-else>-</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col-4 col-md-3 fw-bold">{{$capitalize( $p.t('abgabetool/c4projekttyp') )}}</div>
|
||||
<div class="col-8 col-md-9">
|
||||
{{ projektarbeit.projekttypbezeichnung }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col-4 col-md-3 fw-bold">{{$capitalize( $p.t('abgabetool/c4titel') )}}</div>
|
||||
<div class="col-8 col-md-9 d-flex align-items-center gap-2" style="min-width: 0;">
|
||||
<span
|
||||
:title="projektarbeit.titel"
|
||||
style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"
|
||||
>{{ projektarbeit.titel }}</span>
|
||||
<button
|
||||
v-if="title_edit_allowed && !isViewMode && projektarbeit.note == null"
|
||||
class="btn btn-sm btn-outline-secondary border-0 p-1"
|
||||
v-tooltip.right="{ value: $capitalize($p.t('abgabetool/c4titelBearbeiten')), class: 'custom-tooltip' }"
|
||||
@click="openTitelEdit(projektarbeit, $event)"
|
||||
>
|
||||
<i class="fa-solid fa-pen"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col-4 col-md-3 fw-bold">{{$capitalize( $p.t('abgabetool/c4note') )}}</div>
|
||||
|
||||
<div class="col-8 col-md-9">
|
||||
<span>{{getNoteBezeichnung(projektarbeit)}}</span>
|
||||
{{ projektarbeit.titel }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</AccordionTab>
|
||||
</template>
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
const zone = 'Europe/Vienna';
|
||||
|
||||
export function getViennaTodayISO() {
|
||||
return luxon.DateTime.now().setZone(zone).toISODate();
|
||||
}
|
||||
|
||||
export function formatISODate(dateParam) {
|
||||
if (!dateParam) return '';
|
||||
|
||||
const date = luxon.DateTime.fromISO(String(dateParam), { zone });
|
||||
return date.isValid ? date.toFormat('dd.MM.yyyy') : '';
|
||||
}
|
||||
|
||||
export function formatDateTime(dateParam) {
|
||||
if (!dateParam) return '';
|
||||
|
||||
const date = luxon.DateTime.fromSQL(dateParam);
|
||||
return date.isValid ? date.toFormat("dd.MM.yyyy HH:mm") : '';
|
||||
}
|
||||
|
||||
export function toViennaDate(dateParam) {
|
||||
if (!dateParam) return null;
|
||||
|
||||
return luxon.DateTime.fromISO(String(dateParam), { zone });
|
||||
}
|
||||
|
||||
export function compareISODateValues(a, b) {
|
||||
if (!a && !b) return 0;
|
||||
if (!a) return 1;
|
||||
if (!b) return -1;
|
||||
|
||||
return String(a).localeCompare(String(b));
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
const zone = 'Europe/Vienna';
|
||||
const today = luxon.DateTime.now().setZone(zone);
|
||||
|
||||
export function getDateStyleClass(termin, notenOptions) {
|
||||
const today = luxon.DateTime.now().setZone(zone);
|
||||
const datum = luxon.DateTime.fromISO(termin.datum, { zone }).endOf('day');
|
||||
const abgabedatum = termin.abgabedatum ? luxon.DateTime.fromISO(termin.abgabedatum, { zone }) : null;
|
||||
termin.diffindays = datum.diff(today, 'days').days;
|
||||
@@ -28,11 +28,10 @@ export function getDateStyleClass(termin, notenOptions) {
|
||||
|
||||
// no submission yet
|
||||
if (datum < today) return 'verpasst';
|
||||
|
||||
if (termin.diffindays <= 12) return 'abzugeben';
|
||||
return 'standard';
|
||||
}
|
||||
|
||||
// GENERIC STATUS — applies to all termine
|
||||
if (datum < today) return 'verpasst';
|
||||
if (termin.diffindays <= 12) return 'abzugeben';
|
||||
return 'standard';
|
||||
}
|
||||
// GENERIC STATUS
|
||||
return datum < today ? 'verpasst' : 'standard';
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
/**
|
||||
* Validates the thesis title on the frontend
|
||||
* @param {string} title - The raw input from the title field
|
||||
* @returns {object} Validation result containing status and cleaned title
|
||||
*/
|
||||
export function validateThesisTitle(title) {
|
||||
if (!title) {
|
||||
return { isValid: false, error: 'empty' };
|
||||
}
|
||||
|
||||
// Replicate strip_tags / trim
|
||||
const cleanedTitle = title.replace(/<\/?[^>]+(>|$)/g, "").trim();
|
||||
|
||||
if (cleanedTitle === '') {
|
||||
return { isValid: false, error: 'empty' };
|
||||
}
|
||||
|
||||
// Replicate the emoji/pictograph rejection
|
||||
const emojiRegex = /\p{Extended_Pictographic}/u;
|
||||
if (emojiRegex.test(cleanedTitle)) {
|
||||
return { isValid: false, error: 'invalid_characters' };
|
||||
}
|
||||
|
||||
return { isValid: true, cleanedTitle: cleanedTitle };
|
||||
}
|
||||
@@ -21,21 +21,23 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
propsWatchHelper: function() {
|
||||
let currentiFrameURL = this.$refs.compatiframe ? this.$refs.compatiframe.src : '';
|
||||
if(this.lastLoadediFrameURL === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('currentiFrameURL: ' + currentiFrameURL);
|
||||
console.log('lastLoadediFrameURL: ' + this.lastLoadediFrameURL);
|
||||
let currentiFrameURL = this.$refs.compatiframe ? this.$refs.compatiframe.src : '';
|
||||
|
||||
let url = this.buildSrcUrl();
|
||||
if(this.lastLoadediFrameURL !== url) {
|
||||
this.srcUrl = url;
|
||||
if(this.srcUrl === url) {
|
||||
this.$refs.compatiframe.contentWindow.location.href = url;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
buildSrcUrl: function() {
|
||||
console.log('srcUrl begin: ' + this.path);
|
||||
|
||||
let url = false;
|
||||
switch(this.mode) {
|
||||
case 'ci':
|
||||
@@ -51,13 +53,9 @@ export default {
|
||||
url += '?' + this.query_string;
|
||||
}
|
||||
|
||||
console.log('srcUrl end: ' + url);
|
||||
return url;
|
||||
},
|
||||
loadHandler: function() {
|
||||
console.log('loadHandler');
|
||||
console.log(JSON.stringify(this.$refs.compatiframe.contentWindow.location));
|
||||
|
||||
let iframe_href = this.$refs.compatiframe.contentWindow.location.href;
|
||||
let ci_urlstart = FHC_JS_DATA_STORAGE_OBJECT.app_root + 'index.ci.php/';
|
||||
let legacy_urlstart = FHC_JS_DATA_STORAGE_OBJECT.app_root;
|
||||
@@ -65,10 +63,6 @@ export default {
|
||||
|
||||
this.lastLoadediFrameURL = iframe_href;
|
||||
|
||||
console.log('iframe_href: ' + iframe_href);
|
||||
console.log('ci_urlstart: ' + ci_urlstart);
|
||||
console.log('legacy_url_start: ' + legacy_urlstart);
|
||||
|
||||
if(iframe_href.startsWith(ci_urlstart)) {
|
||||
routerpath = iframe_href.replace(
|
||||
ci_urlstart, '/Cis/Compat/ci/');
|
||||
@@ -79,8 +73,6 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(routerpath);
|
||||
|
||||
if(this.$route.fullPath !== routerpath) {
|
||||
this.$router.push(routerpath);
|
||||
}
|
||||
|
||||
@@ -64,9 +64,6 @@ export default {
|
||||
return this.propsViewData?.mode;
|
||||
},
|
||||
downloadLinks() {
|
||||
// do not show download links in otherLvPlan Mode
|
||||
return false;
|
||||
|
||||
if (
|
||||
!this.studiensemester_start ||
|
||||
!this.studiensemester_ende ||
|
||||
|
||||
@@ -72,9 +72,6 @@ export default {
|
||||
return this.propsViewData?.mode;
|
||||
},
|
||||
downloadLinks() {
|
||||
// do not show download links in StgOrg Mode
|
||||
return false;
|
||||
|
||||
if (
|
||||
!this.studiensemester_start ||
|
||||
!this.studiensemester_ende ||
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
import FhcCalendar from "../../Calendar/LvPlan.js";
|
||||
|
||||
import ApiLvPlan from '../.././../api/factory/lvPlan.js';
|
||||
import ApiAuthinfo from '../../../api/factory/authinfo.js';
|
||||
|
||||
export const DEFAULT_MODE_LVPLAN = 'Week';
|
||||
|
||||
export default {
|
||||
name: 'LvPlanStgOrg',
|
||||
inject: {
|
||||
cisRoot: {
|
||||
from: 'cisRoot'
|
||||
},
|
||||
},
|
||||
components: {
|
||||
FhcCalendar,
|
||||
},
|
||||
props: {
|
||||
viewData: Object,
|
||||
propsViewData: Object
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
studiensemester_kurzbz: null,
|
||||
studiensemester_start: null,
|
||||
studiensemester_ende: null,
|
||||
uid: null,
|
||||
isMitarbeiter: false,
|
||||
isStudent: false,
|
||||
listStg: [],
|
||||
currentStgBezeichnung: null
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
currentDay() {
|
||||
if (!this.propsViewData?.focus_date || isNaN(new Date(this.propsViewData?.focus_date)))
|
||||
return luxon.DateTime.now().setZone(this.viewData.timezone).toISODate();
|
||||
return this.propsViewData?.focus_date;
|
||||
},
|
||||
currentMode() {
|
||||
if (!this.propsViewData?.mode || !['day', 'week', 'month'].includes(this.propsViewData?.mode.toLowerCase()))
|
||||
return DEFAULT_MODE_LVPLAN;
|
||||
return this.propsViewData?.mode;
|
||||
},
|
||||
downloadLinks() {
|
||||
if (!this.studiensemester_start || !this.studiensemester_ende || !this.uid)
|
||||
return false;
|
||||
|
||||
let type = false;
|
||||
type = this.isStudent ? 'student' : type;
|
||||
type = this.isMitarbeiter ? 'lektor' : type;
|
||||
if (false === type)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const opts = { zone: this.viewData.timezone };
|
||||
const start = luxon.DateTime
|
||||
.fromISO(this.studiensemester_start, opts)
|
||||
.toUnixInteger();
|
||||
const ende = luxon.DateTime
|
||||
.fromISO(this.studiensemester_ende, opts)
|
||||
.toUnixInteger();
|
||||
|
||||
const download_link = FHC_JS_DATA_STORAGE_OBJECT.app_root
|
||||
+ 'cis/private/lvplan/stpl_kalender.php'
|
||||
+ '?type=' + type
|
||||
+ '&pers_uid=' + this.uid
|
||||
+ '&begin=' + start
|
||||
+ '&ende=' + ende;
|
||||
|
||||
return [
|
||||
{ title: "excel", icon: 'fa-solid fa-file-excel', link: download_link + '&format=excel' },
|
||||
{ title: "csv", icon: 'fa-solid fa-file-csv', link: download_link + '&format=csv' },
|
||||
{ title: "ical1", icon: 'fa-regular fa-calendar', link: download_link + '&format=ical&version=1&target=ical' },
|
||||
{ title: "ical2", icon: 'fa-regular fa-calendar', link: download_link + '&format=ical&version=2&target=ical' }
|
||||
];
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleChangeDate(day, newMode) {
|
||||
return this.handleChangeMode(newMode, day);
|
||||
},
|
||||
handleChangeMode(newMode, day) {
|
||||
const mode = newMode[0].toUpperCase() + newMode.slice(1)
|
||||
const focus_date = day.toISODate();
|
||||
|
||||
this.$router.push({
|
||||
name: "StgOrgLvPlan",
|
||||
params: {
|
||||
mode,
|
||||
focus_date,
|
||||
stgkz: this.propsViewData.stgkz,
|
||||
sem: this.propsViewData.sem,
|
||||
verband: this.propsViewData.verband,
|
||||
gruppe: this.propsViewData.gruppe,
|
||||
}
|
||||
});
|
||||
},
|
||||
updateRange(rangeInterval) {
|
||||
this.$api
|
||||
.call(ApiLvPlan.studiensemesterDateInterval(
|
||||
rangeInterval.end.startOf('week').toISODate()
|
||||
))
|
||||
.then(res => {
|
||||
this.studiensemester_kurzbz = res.data.studiensemester_kurzbz;
|
||||
this.studiensemester_start = res.data.start;
|
||||
this.studiensemester_ende = res.data.ende;
|
||||
});
|
||||
},
|
||||
getPromiseFunc(start, end) {
|
||||
return [
|
||||
this.$api.call(ApiLvPlan.eventsStgOrg(start.toISODate(), end.toISODate(), this.propsViewData.stgkz, this.propsViewData.sem, this.propsViewData.verband, this.propsViewData.gruppe)),
|
||||
//local for test
|
||||
/* this.$api.call(ApiLvPlan.eventsStgOrg(start.toISODate(), end.toISODate(), this.stgkz, this.sem, this.verband, this.gruppe))*/
|
||||
];
|
||||
},
|
||||
backToDropdown(){
|
||||
this.$router.push({
|
||||
name: "OverviewLvPlan",
|
||||
});
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.$api
|
||||
.call(ApiAuthinfo.getAuthInfo())
|
||||
.then(res => {
|
||||
this.uid = res.data.uid;
|
||||
this.isMitarbeiter = res.data.isMitarbeiter;
|
||||
this.isStudent = res.data.isStudent;
|
||||
});
|
||||
|
||||
if(this.propsViewData.stgkz) {
|
||||
this.$api
|
||||
.call(ApiLvPlan.getStudiengaenge())
|
||||
.then(result => {
|
||||
const currentStg = result.data.find(
|
||||
item => item.studiengang_kz == this.propsViewData.stgkz
|
||||
);
|
||||
this.currentStgBezeichnung = currentStg.kurzbzlang + " - " + currentStg.bezeichnung;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div class="cis-lvplan-stg-org d-flex flex-column h-100">
|
||||
<h2>{{ $p.t('LvPlan/headerLvPlanLvVerband') }}</h2>
|
||||
<p v-if="propsViewData.stgkz"><span><strong>{{currentStgBezeichnung}}</strong></span>
|
||||
<span v-if="propsViewData.sem" style="margin-left:10px;"> Semester: {{propsViewData.sem}} </span>
|
||||
<span v-if="propsViewData.verband" style="margin-left:10px;"> Verband: {{propsViewData.verband}} </span>
|
||||
<span v-if="propsViewData.gruppe" style="margin-left:10px;"> Gruppe: {{propsViewData.gruppe}} </span>
|
||||
<button class="py-1 btn btn-outline-secondary" :title="this.$p.t('LvPlan', 'backToDropdown')" style="margin-left:10px;"> <i class="fa fa-arrow-left fa-xs" @click="backToDropdown"></i></button>
|
||||
</p>
|
||||
<p v-else>{{ $p.t('LvPlan/noStgProvided') }}</p>
|
||||
|
||||
<fhc-calendar
|
||||
ref="calendar"
|
||||
:timezone="viewData.timezone"
|
||||
:get-promise-func="getPromiseFunc"
|
||||
:date="currentDay"
|
||||
:mode="currentMode"
|
||||
@update:date="handleChangeDate"
|
||||
@update:mode="handleChangeMode"
|
||||
@update:range="updateRange"
|
||||
class="responsive-calendar"
|
||||
>
|
||||
<div
|
||||
v-if="downloadLinks"
|
||||
class="d-flex gap-1 justify-items-start"
|
||||
>
|
||||
<div v-for="{ title, icon, link } in downloadLinks">
|
||||
<a
|
||||
:href="link"
|
||||
:aria-label="title"
|
||||
class="py-1 btn btn-outline-secondary"
|
||||
>
|
||||
<div class="d-flex flex-column">
|
||||
<i aria-hidden="true" :class="icon"></i>
|
||||
<span style="font-size:.5rem">{{ title }}</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</fhc-calendar>
|
||||
</div>
|
||||
`,
|
||||
};
|
||||
@@ -1,5 +1,10 @@
|
||||
import CisMenuLink from "./Link.js";
|
||||
|
||||
export default {
|
||||
name: 'CisMenuEntry',
|
||||
components: {
|
||||
CisMenuLink
|
||||
},
|
||||
props: {
|
||||
entry: Object,
|
||||
level: {
|
||||
@@ -170,7 +175,7 @@ export default {
|
||||
<template v-else>
|
||||
<template v-if="hasChilds">
|
||||
<div class="btn-group w-100">
|
||||
<a :target="target"
|
||||
<cis-menu-link :target="target"
|
||||
:href="(entry.menu_open && hasFullLink) ? entry.url : null"
|
||||
@click="toggleCollapse"
|
||||
:class="{
|
||||
@@ -179,7 +184,7 @@ export default {
|
||||
'fw-bold':active
|
||||
}">
|
||||
{{ entry.titel }}
|
||||
</a>
|
||||
</cis-menu-link>
|
||||
<button @click.prevent="toggleCollapse" :aria-expanded="entry.menu_open"
|
||||
:class="{
|
||||
'btn btn-default rounded-0 dropdown-toggle dropdown-toggle-split flex-grow-0': true,
|
||||
@@ -193,7 +198,7 @@ export default {
|
||||
<cis-menu-entry :highestMatchingUrlCount="highestMatchingUrlCount" :activeContent="activeContent" v-for="child in entry.childs" :key="child" :entry="child" :level="level + 1"/>
|
||||
</ul>
|
||||
</template>
|
||||
<a v-else
|
||||
<cis-menu-link v-else
|
||||
:href="entry.url"
|
||||
:target="target"
|
||||
:class="{
|
||||
@@ -203,6 +208,6 @@ export default {
|
||||
}"
|
||||
@mouseup="setActiveEntry(entry.content_id)">
|
||||
{{ entry.titel }}
|
||||
</a>
|
||||
</cis-menu-link>
|
||||
</template>`
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
import {isCompatLink, calcCompatRouterLink} from '../../../helpers/CompatLinkHelpers.js';
|
||||
|
||||
export default {
|
||||
name: 'CisMenuLink',
|
||||
props: {
|
||||
href: {
|
||||
type: [String, null],
|
||||
default: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isRouterHandled() {
|
||||
let isrouterhandled = this.$route.matched.length > 0;
|
||||
return isrouterhandled;
|
||||
},
|
||||
isCompatLink() {
|
||||
if(this.href === null) {
|
||||
return false;
|
||||
}
|
||||
return isCompatLink(this.href);
|
||||
},
|
||||
calcCompatRouterLink() {
|
||||
return calcCompatRouterLink(this.href);
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<router-link v-if="this.isRouterHandled() && this.isCompatLink()"
|
||||
:to="this.calcCompatRouterLink()"
|
||||
>
|
||||
<slot></slot>
|
||||
</router-link>
|
||||
<a v-else
|
||||
:href="this.href"
|
||||
>
|
||||
<slot></slot>
|
||||
</a>
|
||||
`
|
||||
};
|
||||
@@ -3,6 +3,8 @@ import LvPruefungen from "./Lv/Pruefungen.js";
|
||||
import ApiLehre from '../../../../../api/factory/lehre.js';
|
||||
import ApiAddons from '../../../../../api/factory/addons.js';
|
||||
|
||||
import {isCompatLink, calcCompatRouterLink} from '../../../../../helpers/CompatLinkHelpers.js';
|
||||
|
||||
// TODO(chris): L10n
|
||||
|
||||
export default {
|
||||
@@ -106,6 +108,12 @@ export default {
|
||||
pruefungenData: this.pruefungenData,
|
||||
bezeichnung: this.bezeichnung
|
||||
});
|
||||
},
|
||||
isCompatLink(link) {
|
||||
return isCompatLink(link);
|
||||
},
|
||||
calcCompatRouterLink(link) {
|
||||
return calcCompatRouterLink(link);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -159,7 +167,13 @@ export default {
|
||||
|
||||
<ul v-else class="dropdown-menu dropdown-menu p-0">
|
||||
<li v-for="([text, link], i) in menuItem.c4_linkList" :key="i">
|
||||
<a class="dropdown-item border-bottom" :href="link" target="#">{{ text }}</a>
|
||||
<template v-if="this.isCompatLink(link)">
|
||||
<router-link
|
||||
class="dropdown-item border-bottom"
|
||||
:to="this.calcCompatRouterLink(link)"
|
||||
>{{ text }}</router-link>
|
||||
</template>
|
||||
<a v-else="" class="dropdown-item border-bottom" :href="link" target="#">{{ text }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -36,6 +36,7 @@ export default {
|
||||
return {
|
||||
showModal: false,
|
||||
editDataFilter: null,
|
||||
arePhrasesPreloaded: false,
|
||||
// tabulator options
|
||||
funktionen_table_options: {
|
||||
persistenceID: "filterTableMaProfilFunktionen",
|
||||
@@ -48,7 +49,6 @@ export default {
|
||||
responsiveLayoutCollapseUseFormatters: false,
|
||||
responsiveLayoutCollapseFormatter: Vue.$collapseFormatter,
|
||||
responsiveLayoutCollapseStartOpen: false,
|
||||
locale: true,
|
||||
columns: [
|
||||
{
|
||||
title:
|
||||
@@ -63,8 +63,7 @@ export default {
|
||||
responsive: 0,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "ui/bezeichnung",
|
||||
title: Vue.computed(() => this.$p.t('ui/bezeichnung')),
|
||||
field: "Bezeichnung",
|
||||
headerFilter: true,
|
||||
minWidth: 200,
|
||||
@@ -72,8 +71,7 @@ export default {
|
||||
responsive: 0,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "lehre/organisationseinheit",
|
||||
title: Vue.computed(() => this.$p.t('lehre/organisationseinheit')),
|
||||
field: "Organisationseinheit",
|
||||
headerFilter: true,
|
||||
minWidth: 200,
|
||||
@@ -81,8 +79,7 @@ export default {
|
||||
responsive: 1,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "global/gueltigVon",
|
||||
title: Vue.computed(() => this.$p.t('global/gueltigVon')),
|
||||
field: "Gültig_von",
|
||||
headerFilterFunc: 'dates',
|
||||
headerFilter: dateFilter,
|
||||
@@ -94,8 +91,7 @@ export default {
|
||||
responsive: 4,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "global/gueltigBis",
|
||||
title: Vue.computed(() => this.$p.t('global/gueltigBis')),
|
||||
field: "Gültig_bis",
|
||||
headerFilterFunc: 'dates',
|
||||
headerFilter: dateFilter,
|
||||
@@ -107,8 +103,7 @@ export default {
|
||||
responsive: 3,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "profil/wochenstunden",
|
||||
title: Vue.computed(() => this.$p.t('profil/wochenstunden')),
|
||||
field: "Wochenstunden",
|
||||
headerFilter: true,
|
||||
minWidth: 200,
|
||||
@@ -129,7 +124,6 @@ export default {
|
||||
responsiveLayoutCollapseFormatter: Vue.$collapseFormatter,
|
||||
data: [{betriebsmittel: "", Nummer: "", Ausgegeben_am: ""}],
|
||||
responsiveLayoutCollapseStartOpen: false,
|
||||
locale: true,
|
||||
columns: [
|
||||
{
|
||||
title:
|
||||
@@ -144,8 +138,7 @@ export default {
|
||||
responsive: 0,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "profil/entlehnteBetriebsmittel",
|
||||
title: Vue.computed(() => this.$p.t('profil/entlehnteBetriebsmittel')),
|
||||
field: "betriebsmittel",
|
||||
headerFilter: true,
|
||||
minWidth: 200,
|
||||
@@ -153,8 +146,7 @@ export default {
|
||||
responsive: 0,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "profil/inventarnummer",
|
||||
title: Vue.computed(() => this.$p.t('profil/inventarnummer')),
|
||||
field: "Nummer",
|
||||
headerFilter: true,
|
||||
resizable: true,
|
||||
@@ -163,8 +155,7 @@ export default {
|
||||
responsive: 2,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "profil/ausgabedatum",
|
||||
title: Vue.computed(() => this.$p.t('profil/ausgabedatum')),
|
||||
field: "Ausgegeben_am",
|
||||
headerFilterFunc: 'dates',
|
||||
headerFilter: dateFilter,
|
||||
@@ -239,6 +230,10 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
setTableColumnTitles() { // reevaluates computed phrasen
|
||||
if(this.$refs.betriebsmittelTable) this.$refs.betriebsmittelTable.tabulator.setColumns(this.betriebsmittel_table_options.columns);
|
||||
if(this.$refs.funktionenTable) this.$refs.funktionenTable.tabulator.setColumns(this.funktionen_table_options.columns);
|
||||
},
|
||||
datetimeFormatterParams: function() {
|
||||
const params = {
|
||||
inputFormat:"yyyy-MM-dd",
|
||||
@@ -321,6 +316,10 @@ export default {
|
||||
},
|
||||
|
||||
created() {
|
||||
// preload phrasen
|
||||
this.$p.loadCategory(["ui","lehre","global","profil"]).then(() => {
|
||||
this.arePhrasesPreloaded = true;
|
||||
});
|
||||
//? sorts the profil Updates: pending -> accepted -> rejected
|
||||
this.data.profilUpdates?.sort(this.sortProfilUpdates);
|
||||
},
|
||||
@@ -331,6 +330,9 @@ export default {
|
||||
'data.mittel'(newVal) {
|
||||
if(this.$refs.betriebsmittelTable) this.$refs.betriebsmittelTable.tabulator.setData(newVal);
|
||||
},
|
||||
'language.value'(newVal) {
|
||||
this.setTableColumnTitles()
|
||||
}
|
||||
},
|
||||
template: /*html*/ `
|
||||
<div class="container-fluid text-break fhc-form" >
|
||||
@@ -452,6 +454,7 @@ export default {
|
||||
<!-- FUNKTIONEN TABELLE -->
|
||||
<div class="col-12 mb-4" >
|
||||
<core-filter-cmpt
|
||||
v-if="arePhrasesPreloaded"
|
||||
@tableBuilt="funktionenTableBuilt"
|
||||
:title="$p.t('person','funktionen')"
|
||||
ref="funktionenTable"
|
||||
@@ -463,6 +466,7 @@ export default {
|
||||
<!-- BETRIEBSMITTEL TABELLE -->
|
||||
<div class="col-12 mb-4" >
|
||||
<core-filter-cmpt
|
||||
v-if="arePhrasesPreloaded"
|
||||
@tableBuilt="betriebsmittelTableBuilt"
|
||||
:title="$p.t('profil','entlehnteBetriebsmittel')"
|
||||
ref="betriebsmittelTable"
|
||||
|
||||
@@ -20,6 +20,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
collapseIconFunktionen: true,
|
||||
arePhrasesPreloaded: false,
|
||||
funktionen_table_options: {
|
||||
persistenceID: "filterTableMaViewProfilFunktionen",
|
||||
persistence: {
|
||||
@@ -30,7 +31,6 @@ export default {
|
||||
responsiveLayout: "collapse",
|
||||
responsiveLayoutCollapseUseFormatters: false,
|
||||
responsiveLayoutCollapseFormatter: Vue.$collapseFormatter,
|
||||
locale: true,
|
||||
columns: [
|
||||
//? option when wanting to hide the collapsed list
|
||||
|
||||
@@ -46,8 +46,7 @@ export default {
|
||||
responsive: 0,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "ui/bezeichnung",
|
||||
title: Vue.computed(() => this.$p.t("ui/bezeichnung")),
|
||||
field: "Bezeichnung",
|
||||
headerFilter: true,
|
||||
minWidth: 200,
|
||||
@@ -55,8 +54,9 @@ export default {
|
||||
responsive: 0,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "lehre/organisationseinheit",
|
||||
title: Vue.computed(() =>
|
||||
this.$p.t("lehre/organisationseinheit"),
|
||||
),
|
||||
field: "Organisationseinheit",
|
||||
headerFilter: true,
|
||||
minWidth: 200,
|
||||
@@ -64,8 +64,9 @@ export default {
|
||||
responsive: 1,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "global/gueltigVon",
|
||||
title: Vue.computed(() =>
|
||||
this.$p.t("global/gueltigVon"),
|
||||
),
|
||||
field: "Gültig_von",
|
||||
headerFilterFunc: "dates",
|
||||
headerFilter: dateFilter,
|
||||
@@ -77,8 +78,9 @@ export default {
|
||||
responsive: 4,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "global/gueltigBis",
|
||||
title: Vue.computed(() =>
|
||||
this.$p.t("global/gueltigBis"),
|
||||
),
|
||||
field: "Gültig_bis",
|
||||
headerFilterFunc: "dates",
|
||||
headerFilter: dateFilter,
|
||||
@@ -90,8 +92,9 @@ export default {
|
||||
responsive: 3,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "profil/wochenstunden",
|
||||
title: Vue.computed(() =>
|
||||
this.$p.t("profil/wochenstunden"),
|
||||
),
|
||||
field: "Wochenstunden",
|
||||
headerFilter: true,
|
||||
minWidth: 200,
|
||||
@@ -217,6 +220,11 @@ export default {
|
||||
return quickLinks;
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.$p.loadCategory(["ui", "lehre", "global", "profil"]).then(() => {
|
||||
this.arePhrasesPreloaded = true;
|
||||
});
|
||||
},
|
||||
|
||||
template: /*html*/ `
|
||||
|
||||
@@ -271,7 +279,7 @@ export default {
|
||||
<div class="row">
|
||||
<!-- FIRST TABLE -->
|
||||
<div class="col-12 mb-4" >
|
||||
<core-filter-cmpt @tableBuilt="funktionenTableBuilt" :title="$p.t('person','funktionen')" ref="funktionenTable" :tabulator-options="funktionen_table_options" tableOnly :sideMenu="false" />
|
||||
<core-filter-cmpt v-if="arePhrasesPreloaded" @tableBuilt="funktionenTableBuilt" :title="$p.t('person','funktionen')" ref="funktionenTable" :tabulator-options="funktionen_table_options" tableOnly :sideMenu="false" />
|
||||
</div>
|
||||
<!-- END OF THE ROW WITH THE TABLES UNDER THE PROFIL INFORMATION -->
|
||||
</div>
|
||||
|
||||
@@ -29,12 +29,13 @@ export default {
|
||||
QuickLinks,
|
||||
CalendarSync,
|
||||
},
|
||||
inject: ["sortProfilUpdates", "collapseFunction", "isEditable"],
|
||||
inject: ["sortProfilUpdates", "collapseFunction", "language","isEditable"],
|
||||
data() {
|
||||
return {
|
||||
showModal: false,
|
||||
collapseIconBetriebsmittel: true,
|
||||
editDataFilter: null,
|
||||
arePhrasesPreloaded: false,
|
||||
// tabulator options
|
||||
zutrittsgruppen_table_options: {
|
||||
persistenceID: "filterTableStudentProfilZutrittsgruppen",
|
||||
@@ -43,9 +44,9 @@ export default {
|
||||
},
|
||||
minHeight: 200,
|
||||
layout: "fitColumns",
|
||||
columns: [{
|
||||
title: "placeholder",
|
||||
titlePhrase: "profil/zutrittsGruppen",
|
||||
columns: [
|
||||
{
|
||||
title: Vue.computed(() => this.$p.t('profil/zutrittsGruppen')),
|
||||
field: "bezeichnung"
|
||||
}
|
||||
],
|
||||
@@ -61,7 +62,6 @@ export default {
|
||||
responsiveLayoutCollapseUseFormatters: false,
|
||||
responsiveLayoutCollapseFormatter: Vue.$collapseFormatter,
|
||||
responsiveLayoutCollapseStartOpen: false,
|
||||
locale: true,
|
||||
columns: [
|
||||
{
|
||||
title:
|
||||
@@ -75,8 +75,7 @@ export default {
|
||||
responsive: 0,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "profil/entlehnteBetriebsmittel",
|
||||
title: Vue.computed(()=>this.$p.t('profil/entlehnteBetriebsmittel')),
|
||||
field: "betriebsmittel",
|
||||
headerFilter: true,
|
||||
minWidth: 200,
|
||||
@@ -84,8 +83,7 @@ export default {
|
||||
responsive: 0,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "profil/inventarnummer",
|
||||
title: Vue.computed(() => this.$p.t('profil/inventarnummer')) ,
|
||||
field: "Nummer",
|
||||
headerFilter: true,
|
||||
resizable: true,
|
||||
@@ -94,8 +92,7 @@ export default {
|
||||
responsive: 2,
|
||||
},
|
||||
{
|
||||
title: "placeholder",
|
||||
titlePhrase: "profil/ausgabedatum",
|
||||
title: Vue.computed(() => this.$p.t('profil/ausgabedatum')) ,
|
||||
field: "Ausgegeben_am",
|
||||
headerFilterFunc: 'dates',
|
||||
headerFilter: dateFilter,
|
||||
@@ -262,9 +259,19 @@ export default {
|
||||
},
|
||||
},
|
||||
created() {
|
||||
// preload phrasen
|
||||
this.$p.loadCategory('profil').then(() => {
|
||||
this.arePhrasesPreloaded = true;
|
||||
});
|
||||
//? sorts the profil Updates: pending -> accepted -> rejected
|
||||
this.data.profilUpdates?.sort(this.sortProfilUpdates);
|
||||
},
|
||||
watch: {
|
||||
'language.value'(newVal) {
|
||||
if(this.$refs.betriebsmittelTable) this.$refs.betriebsmittelTable.tabulator.setColumns(this.betriebsmittel_table_options.columns)
|
||||
if(this.$refs.zutrittsgruppenTable) this.$refs.zutrittsgruppenTable.tabulator.setColumns(this.zutrittsgruppen_table_options.columns)
|
||||
}
|
||||
},
|
||||
template: /*html*/ `
|
||||
<div class="container-fluid text-break fhc-form">
|
||||
<edit-profil v-if="showModal" ref="editModal" @hideBsModal="hideEditProfilModal"
|
||||
@@ -388,6 +395,7 @@ export default {
|
||||
<div class="row">
|
||||
<div class="col-12 mb-4" >
|
||||
<core-filter-cmpt
|
||||
v-if="arePhrasesPreloaded"
|
||||
@tableBuilt="betriebsmittelTableBuilt"
|
||||
:title="$p.t('profil','entlehnteBetriebsmittel')"
|
||||
ref="betriebsmittelTable"
|
||||
@@ -397,6 +405,7 @@ export default {
|
||||
</div>
|
||||
<div class="col-12 mb-4" >
|
||||
<core-filter-cmpt
|
||||
v-if="arePhrasesPreloaded"
|
||||
@tableBuilt="zutrittsgruppenTableBuilt"
|
||||
:title="$p.t('profil','zutrittsGruppen')"
|
||||
ref="zutrittsgruppenTable"
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
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
|
||||
ModalUploadFoto,
|
||||
PvSkeleton,
|
||||
CoreTag
|
||||
},
|
||||
props: {
|
||||
headerData: {
|
||||
@@ -38,8 +44,30 @@ 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
|
||||
},
|
||||
currentSemester: {
|
||||
from: 'currentSemester',
|
||||
required: true
|
||||
},
|
||||
lists: {
|
||||
from: 'lists',
|
||||
required: true
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
appRoot() {
|
||||
return FHC_JS_DATA_STORAGE_OBJECT.app_root;
|
||||
@@ -61,17 +89,30 @@ 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 requried.'
|
||||
'[DetailHeader] "person_id", "mitarbeiter_uid", and "domain" are required.'
|
||||
)
|
||||
}
|
||||
this.loadHeaderData(this.person_id, this.mitarbeiter_uid);
|
||||
@@ -86,13 +127,34 @@ 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
|
||||
isFetchingIssues: false,
|
||||
noCurrentStatus: false,
|
||||
semesterStatiLoading: false,
|
||||
leitungOrgLoading: false,
|
||||
departmentDataLoading: false,
|
||||
headerDataMaLoading: false,
|
||||
tagEndpoint: ApiTag,
|
||||
tagData: null,
|
||||
rebuildData: null,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -108,29 +170,40 @@ 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);
|
||||
.catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
this.headerDataMaLoading = false;
|
||||
});
|
||||
},
|
||||
loadDepartmentData(mitarbeiter_uid) {
|
||||
this.departmentDataLoading = true;
|
||||
return this.$api
|
||||
.call(ApiDetailHeader.getPersonAbteilung(mitarbeiter_uid))
|
||||
.then(result => {
|
||||
this.departmentData = result.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
.catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
this.departmentDataLoading = false;
|
||||
});
|
||||
},
|
||||
getLeitungOrg(oekurzbz){
|
||||
this.leitungOrgLoading = true;
|
||||
return this.$api
|
||||
.call(ApiDetailHeader.getLeitungOrg(oekurzbz))
|
||||
.then(result => {
|
||||
this.leitungData = result.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
.catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
this.leitungOrgLoading = false;
|
||||
});
|
||||
},
|
||||
async goToLeitung() {
|
||||
this.loadHeaderData(this.leitungData.person_id, this.leitungData.uid);
|
||||
@@ -179,7 +252,86 @@ 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
|
||||
);
|
||||
|
||||
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;">
|
||||
@@ -200,7 +352,6 @@ export default {
|
||||
</modal-upload-foto>
|
||||
|
||||
<template v-if="typeHeader==='student'">
|
||||
|
||||
<div
|
||||
v-for="person in headerData"
|
||||
:key="person.person_id"
|
||||
@@ -236,62 +387,120 @@ export default {
|
||||
<small class="text-muted">{{person.uid}}</small>
|
||||
</div>
|
||||
|
||||
<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 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>
|
||||
<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">
|
||||
<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">{{$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}}
|
||||
</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">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>
|
||||
<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"> | 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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
@@ -330,27 +539,51 @@ export default {
|
||||
|
||||
<!--show Ma-Details-->
|
||||
<div class="col-md-9 text-nowrap mt-2">
|
||||
<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 }}
|
||||
<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}}
|
||||
</a>
|
||||
</span>
|
||||
<span v-else>
|
||||
<a :href="'mailto:'+headerDataMa?.alias+'@'+domain">{{headerDataMa.alias}}@{{domain}}</a>
|
||||
<pv-skeleton width="5rem"></pv-skeleton>
|
||||
</span>
|
||||
<span v-if="headerDataMa?.telefonklappe" class="mb-2"> | <strong class="text-muted">DW </strong>{{headerDataMa?.telefonklappe}}</span>
|
||||
</p>
|
||||
</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>
|
||||
|
||||
<slot name="tag"></slot>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 d-flex flex-column align-items-end justify-content-start ms-auto">
|
||||
@@ -360,20 +593,33 @@ 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 text-center"><slot name="valueGammaTile"></slot></h6>
|
||||
<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 text-center"><slot name="valueBetaTile" :valueBetaTile="valueBetaTile"></slot></h6>
|
||||
<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 text-center"><slot name="valueAlphaTile"></slot></h6>
|
||||
<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 text-center"><slot name="uid"></slot></h6>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -29,7 +29,8 @@ export default {
|
||||
label: String,
|
||||
// NOTE(chris): remove these from $attrs array to prevent doubled event listeners
|
||||
onInput: [Array, Function],
|
||||
'onUpdate:modelValue': [Array, Function]
|
||||
'onUpdate:modelValue': [Array, Function],
|
||||
titleActionButton: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -317,6 +318,7 @@ export default {
|
||||
:id="idCmp"
|
||||
:name="name"
|
||||
:class="validationClass"
|
||||
:titleActionButton="titleActionButton"
|
||||
@update:model-value="clearValidationForThisName"
|
||||
>
|
||||
<slot></slot>
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
export default {
|
||||
emits: [
|
||||
'update:modelValue'
|
||||
'update:modelValue',
|
||||
'actionbutton-clicked'
|
||||
],
|
||||
props: {
|
||||
modelValue: String
|
||||
modelValue: String,
|
||||
titleActionButton: {
|
||||
type: String,
|
||||
default: ""
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
valueAsBase64DataString() {
|
||||
@@ -28,6 +33,9 @@ export default {
|
||||
},
|
||||
deleteImage() {
|
||||
this.$emit('update:modelValue', '');
|
||||
},
|
||||
emitAction(){
|
||||
this.$emit('actionbutton-clicked', this.modelValue);
|
||||
}
|
||||
},
|
||||
template: `
|
||||
@@ -42,6 +50,7 @@ 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,6 +18,7 @@
|
||||
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";
|
||||
@@ -37,6 +38,7 @@ export default {
|
||||
CoreSearchbar,
|
||||
NavLanguage,
|
||||
VerticalSplit,
|
||||
HorizontalSplit,
|
||||
AppMenu,
|
||||
AppConfig,
|
||||
StvVerband,
|
||||
@@ -192,7 +194,44 @@ 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) {
|
||||
@@ -212,6 +251,7 @@ export default {
|
||||
'url_studiengang': function (newVal, oldVal) {
|
||||
if (newVal !== oldVal) {
|
||||
this.checkUrlStudiengang();
|
||||
this.$refs.stvList.clearSelection();
|
||||
}
|
||||
},
|
||||
'url_mode': function () {
|
||||
@@ -235,6 +275,10 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
sidebarCollapsed(newVal) {
|
||||
if(newVal) this.$refs.hSplit.collapseLeft()
|
||||
else this.$refs.hSplit.showBoth()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -431,6 +475,9 @@ export default {
|
||||
},
|
||||
deleteCustomFilter(){
|
||||
this.$refs.stvList.resetFilter();
|
||||
},
|
||||
showAlertNoSelectedStudent(){
|
||||
this.$fhcAlert.alertError(this.$p.t('ui', 'alert_chooseStudent'));
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -509,7 +556,7 @@ export default {
|
||||
},
|
||||
template: /* html */`
|
||||
<div class="stv" :class="{ 'sidebar-collapsed': sidebarCollapsed }">
|
||||
<header class="navbar navbar-expand-lg navbar-dark bg-dark flex-md-nowrap p-0 shadow">
|
||||
<header class="navbar navbar-expand-lg navbar-dark bg-dark flex-md-nowrap p-0 shadow" style="background-color: green !important;">
|
||||
<div class="col-md-4 col-lg-3 col-xl-2 d-flex align-items-center">
|
||||
<button
|
||||
class="btn btn-outline-light border-0 m-1 collapsed"
|
||||
@@ -522,7 +569,12 @@ export default {
|
||||
>
|
||||
<span class="svg-icon svg-icon-apps"></span>
|
||||
</button>
|
||||
<a class="navbar-brand me-0" :href="stvRoot">StudVw: {{studiensemesterKurzbz}} {{studiengangKuerzel}}</a>
|
||||
<a class="navbar-brand me-0" :href="stvRoot">
|
||||
<span style="font-size: 10px; line-height: 1; display: block; width: 100%; text-wrap: wrap; text-align: left;">
|
||||
DEMO Datenstand 06.05.2026
|
||||
</span>
|
||||
StudVw: {{studiensemesterKurzbz}} {{studiengangKuerzel}}
|
||||
</a>
|
||||
<button
|
||||
class="btn btn-outline-light border-0 d-none d-md-inline-flex m-1 ms-auto"
|
||||
type="button"
|
||||
@@ -629,26 +681,69 @@ 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>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<app-config ref="config" v-model="appconfig" :endpoints="configEndpoints"></app-config>
|
||||
|
||||
@@ -2,12 +2,18 @@ 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
|
||||
@@ -15,7 +21,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
configStudent: {},
|
||||
configStudents: {}
|
||||
configStudents: {},
|
||||
activeTab: null,
|
||||
localStudent: null
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -40,6 +48,9 @@ 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;
|
||||
@@ -57,6 +68,21 @@ 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: {
|
||||
@@ -74,10 +100,28 @@ 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');
|
||||
},
|
||||
@@ -92,10 +136,12 @@ export default {
|
||||
</div>
|
||||
<div v-else-if="configStudent && configStudents" class="d-flex flex-column h-100">
|
||||
<fhc-header
|
||||
:headerData="students"
|
||||
:headerData="localStudent || students"
|
||||
:currentSemester="currentSemester"
|
||||
typeHeader="student"
|
||||
@reload="reloadList"
|
||||
fotoEditable
|
||||
:isLoading="isLoading"
|
||||
>
|
||||
<template #uid>{{students[0].uid}}</template>
|
||||
<template #titleAlphaTile>PersID</template>
|
||||
@@ -107,16 +153,16 @@ export default {
|
||||
</fhc-header>
|
||||
<fhc-tabs
|
||||
v-if="students.length == 1"
|
||||
ref="tabs"
|
||||
ref="tabs"
|
||||
:useprimevue="true"
|
||||
:modelValue="students[0]"
|
||||
:modelValue="(Array.isArray(localStudent) && localStudent[0]) || students[0]"
|
||||
:config="config"
|
||||
:default="$route.params.tab"
|
||||
:default="activeTab ?? $route.params.tab"
|
||||
style="flex: 1 1 0%; height: 0%"
|
||||
@changed="reload"
|
||||
@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>
|
||||
<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>
|
||||
</div>
|
||||
<div v-else>
|
||||
Loading...
|
||||
|
||||
+161
-37
@@ -238,6 +238,16 @@ 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)
|
||||
{
|
||||
@@ -287,10 +297,50 @@ export default {
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
actionNewAbschlusspruefung() {
|
||||
this.resetForm();
|
||||
this.statusNew = true;
|
||||
this.$refs.finalexamModal.show();
|
||||
this.setDefaultFormData();
|
||||
this.statusNew = true;
|
||||
|
||||
//prepare local Storage
|
||||
let STORAGE_KEY = 'finalExamDefaultData';
|
||||
const id = '20260224_02';
|
||||
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;
|
||||
|
||||
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();
|
||||
},
|
||||
actionEditAbschlusspruefung(abschlusspruefung_id) {
|
||||
this.resetForm();
|
||||
@@ -305,20 +355,23 @@ export default {
|
||||
};
|
||||
if (data.p1_person_id) {
|
||||
this.selectedPruefer1 = {
|
||||
label: this.getPersonLabel(data.p1_titelpre, data.p1_nachname, data.p1_vorname, data.p1_titelpost),
|
||||
person_id: data.p1_person_id
|
||||
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
|
||||
};
|
||||
}
|
||||
if (data.p2_person_id) {
|
||||
this.selectedPruefer2 = {
|
||||
label: this.getPersonLabel(data.p2_titelpre, data.p2_nachname, data.p2_vorname, data.p2_titelpost),
|
||||
person_id: data.p2_person_id
|
||||
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
|
||||
}
|
||||
};
|
||||
if (data.p3_person_id) {
|
||||
this.selectedPruefer3= {
|
||||
label: this.getPersonLabel(data.p3_titelpre, data.p3_nachname, data.p3_vorname, data.p3_titelpost),
|
||||
person_id: data.p3_person_id
|
||||
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
|
||||
};
|
||||
}
|
||||
});
|
||||
@@ -337,6 +390,29 @@ export default {
|
||||
.then(this.deleteAbschlusspruefung)
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
saveOrUpdateLocalStorage(){
|
||||
let STORAGE_KEY = 'finalExamDefaultData';
|
||||
|
||||
const id = '20260224_02';
|
||||
const stored = JSON.parse(localStorage.getItem(STORAGE_KEY)) || {};
|
||||
|
||||
stored[id] = {
|
||||
pruefungstyp_kurzbz: this.formData.pruefungstyp_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,
|
||||
@@ -347,6 +423,8 @@ 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();
|
||||
})
|
||||
@@ -355,6 +433,26 @@ export default {
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
async addNewAbschlusspruefungMulti(){
|
||||
try {
|
||||
for (const student of this.studentUids) {
|
||||
|
||||
await this.$refs.formFinalExam.call(
|
||||
ApiStvAbschlusspruefung.addNewAbschlusspruefung({
|
||||
uid: student,
|
||||
formData: this.formData
|
||||
})
|
||||
);
|
||||
}
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
//save formData fields in LocalStorage
|
||||
this.saveOrUpdateLocalStorage();
|
||||
this.hideModal('finalexamModal');
|
||||
this.resetForm();
|
||||
} catch (error) {
|
||||
this.$fhcAlert.handleSystemError(error);
|
||||
}
|
||||
},
|
||||
hideModal(modalRef){
|
||||
this.$refs[modalRef].hide();
|
||||
},
|
||||
@@ -376,6 +474,9 @@ 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 => {
|
||||
@@ -417,7 +518,6 @@ export default {
|
||||
this.selectedPruefer1 = null;
|
||||
this.selectedPruefer2 = null;
|
||||
this.selectedPruefer3 = null;
|
||||
|
||||
},
|
||||
setDefaultFormData() {
|
||||
|
||||
@@ -471,29 +571,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.person_uid
|
||||
),
|
||||
person_id: person.person_id
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
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
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
created() {
|
||||
@@ -526,7 +626,7 @@ export default {
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
this.$api
|
||||
.call(ApiStvAbschlusspruefung.getAkadGrade(this.student.studiengang_kz))
|
||||
.call(ApiStvAbschlusspruefung.getAkadGrade(this.stg_kz))
|
||||
.then(result => {
|
||||
this.arrAkadGrad = result.data;
|
||||
})
|
||||
@@ -547,7 +647,8 @@ 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">
|
||||
<div v-if="this.student.length" class="d-flex gap-2">
|
||||
<button class="btn btn-primary" @click="actionNewAbschlusspruefung()"> + {{$p.t('stv', 'tab_finalexam')}}</button>
|
||||
<abschlusspruefung-dropdown
|
||||
:showAllFormats="showAllFormats"
|
||||
:studentUids="studentUids"
|
||||
@@ -579,12 +680,14 @@ 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>
|
||||
<small v-if="this.student.length" class="text-muted">{{studentNames}}</small>
|
||||
</template>
|
||||
|
||||
<form-form v-if="!this.student.length" ref="formFinalExam" @submit.prevent>
|
||||
<form-form 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"
|
||||
@@ -602,6 +705,7 @@ 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"
|
||||
@@ -670,9 +774,10 @@ 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"
|
||||
@@ -698,7 +803,23 @@ export default {
|
||||
optionValue="person_id"
|
||||
dropdown
|
||||
forceSelection
|
||||
:suggestions="filteredPersons"
|
||||
: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"
|
||||
@complete="searchPerson"
|
||||
:min-length="3"
|
||||
>
|
||||
@@ -722,6 +843,7 @@ 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')"
|
||||
@@ -731,7 +853,7 @@ export default {
|
||||
optionValue="person_id"
|
||||
dropdown
|
||||
forceSelection
|
||||
:suggestions="filteredPersons"
|
||||
:suggestions="filteredPersons"
|
||||
@complete="searchPerson"
|
||||
:min-length="3"
|
||||
>
|
||||
@@ -779,6 +901,7 @@ 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"
|
||||
@@ -790,7 +913,7 @@ export default {
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3 col-6">
|
||||
<div v-if="!this.student.length" class="row mb-3 col-6">
|
||||
<div class="col">
|
||||
<p >{{$p.t('abschlusspruefung', 'zurBeurteilung')}}</p>
|
||||
</div>
|
||||
@@ -807,8 +930,9 @@ export default {
|
||||
|
||||
<template #footer>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{$p.t('ui', 'abbrechen')}}</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>
|
||||
<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>
|
||||
</template>
|
||||
|
||||
</bs-modal>
|
||||
|
||||
@@ -158,6 +158,16 @@ 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() {
|
||||
@@ -386,8 +396,10 @@ 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>
|
||||
|
||||
@@ -26,13 +26,13 @@ export default {
|
||||
internMail(event) {
|
||||
if (this.internMails.length)
|
||||
{
|
||||
splitMailsHelper(this.internMails, event, null, null, this.$fhcAlert, this.$p)
|
||||
splitMailsHelper(this.internMails, event, null, this.$fhcAlert, this.$p)
|
||||
}
|
||||
},
|
||||
privateMail(event) {
|
||||
if (this.privateMails.length)
|
||||
{
|
||||
splitMailsHelper(this.privateMails, event, null,null, this.$fhcAlert, this.$p)
|
||||
splitMailsHelper(this.privateMails, event, null, this.$fhcAlert, this.$p)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -289,8 +289,9 @@ export default {
|
||||
},
|
||||
updateProjektarbeit() {
|
||||
this.$refs.projektarbeitDetails.updateProjektarbeit()
|
||||
.then(() => this.$refs.projektbetreuer.saveIfOpen())
|
||||
.then(() => this.projektarbeitSaved())
|
||||
.then((result) => {
|
||||
this.projektarbeitSaved();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
deleteProjektarbeit(projektarbeit_id) {
|
||||
|
||||
+9
-32
@@ -121,7 +121,7 @@ export default {
|
||||
layoutColumnsOnNewData: false,
|
||||
height: 'auto',
|
||||
minHeight: '100',
|
||||
selectableRows: 1,
|
||||
selectableRows: true,
|
||||
index: 'betreuer_id',
|
||||
persistence:{
|
||||
columns: true, //persist column layout
|
||||
@@ -293,44 +293,21 @@ export default {
|
||||
this.$refs.projektbetreuerTable.tabulator.replaceData(this.addIds(result.data));
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
// get other initial data
|
||||
this.$api
|
||||
.call(ApiStvProjektbetreuer.getBetreuerarten())
|
||||
.then(result => {
|
||||
this.arrBetreuerart = result.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
this.$api
|
||||
.call(ApiStvProjektbetreuer.getNoten())
|
||||
.then(result => {
|
||||
this.arrNoten = result.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
} else {
|
||||
this.emptyBetreuerList();
|
||||
}
|
||||
},
|
||||
_doSaveBetreuer() {
|
||||
return this.$refs.formProjektbetreuer.call(
|
||||
saveProjektbetreuer() {
|
||||
this.$refs.formProjektbetreuer.call(
|
||||
ApiStvProjektbetreuer.saveProjektbetreuer(this.projektarbeit_id, this.getFormDataWithBetreuer())
|
||||
).then(result => {
|
||||
)
|
||||
.then(result => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.getProjektbetreuer(this.projektarbeit_id, this.studiensemester_kurzbz);
|
||||
this.resetModes();
|
||||
this.$emit('betreuerSaved');
|
||||
return result;
|
||||
});
|
||||
},
|
||||
// called by combined save button
|
||||
saveIfOpen() {
|
||||
if (!this.betreuerFormOpened) return Promise.resolve(null);
|
||||
return this._doSaveBetreuer();
|
||||
},
|
||||
saveProjektbetreuer() {
|
||||
this._doSaveBetreuer()
|
||||
.then(() => this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')))
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
searchBetreuer(event) {
|
||||
if (this.abortController.betreuer) {
|
||||
@@ -563,7 +540,7 @@ export default {
|
||||
</form-form>
|
||||
|
||||
<button class="btn btn-primary" v-show="betreuerFormOpened" @click="saveProjektbetreuer">
|
||||
{{ $p.t('projektarbeit', 'betreuerSpeichernv2') }}
|
||||
{{ $p.t('projektarbeit', 'betreuerSpeichern') }}
|
||||
</button>
|
||||
<!-- <div class = "mt-5" v-if="beurteilungDownloadLink !== null">
|
||||
<div class="mb-1">
|
||||
|
||||
@@ -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", headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title:"Sem.", field:"semester_berechnet", 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',
|
||||
persistenceID: 'stv-list-20260223_01'
|
||||
},
|
||||
tabulatorEvents: [
|
||||
{
|
||||
@@ -195,7 +195,15 @@ export default {
|
||||
},
|
||||
{
|
||||
event: 'dataLoaded',
|
||||
handler: data => this.count = data.length
|
||||
handler: data => {
|
||||
if (Array.isArray(data)) {
|
||||
this.count = data.length;
|
||||
this.allPrestudents = data.map(item => item.prestudent_id);
|
||||
} else {
|
||||
this.count = 0;
|
||||
this.allPrestudents = [];
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
event: 'dataFiltered',
|
||||
@@ -237,7 +245,8 @@ export default {
|
||||
dragSource: [],
|
||||
oldScrollUrl: '',
|
||||
oldScrollLeft: 0,
|
||||
oldScrollTop: 0
|
||||
oldScrollTop: 0,
|
||||
allPrestudents: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -274,6 +283,7 @@ export default {
|
||||
};
|
||||
});
|
||||
},
|
||||
//TODO(Manu) check: replace download or additional entry?
|
||||
downloadConfig() {
|
||||
return {
|
||||
csv: {
|
||||
@@ -291,8 +301,24 @@ 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',
|
||||
@@ -312,7 +338,7 @@ export default {
|
||||
if (n !== o && o !== undefined && this.$refs.table.tableBuilt) {
|
||||
this.translateTabulator();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
translateTabulator() {
|
||||
@@ -330,7 +356,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: capitalize(this.$p.t('lehre/sem')),
|
||||
semester_berechnet: 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')),
|
||||
@@ -391,15 +417,23 @@ export default {
|
||||
actionNewPrestudent() {
|
||||
this.$refs.new.open();
|
||||
},
|
||||
rowSelectionChanged(data, rows) {
|
||||
rowSelectionChanged(data, rows, selected, deselected) {
|
||||
this.selectedcount = data.length;
|
||||
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){
|
||||
this.lastSelected = this.selected;
|
||||
|
||||
this.$emit('update:selected', data);
|
||||
//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);
|
||||
}
|
||||
},
|
||||
autoSelectRows(data) {
|
||||
if (Array.isArray(this.lastSelected) && this.lastSelected.length){
|
||||
@@ -546,6 +580,10 @@ export default {
|
||||
this.changeFocus(this.focusObj, el);
|
||||
}
|
||||
},
|
||||
clearSelection(){
|
||||
this.lastSelected = [];
|
||||
this.$emit('update:selected',[]);
|
||||
},
|
||||
//methods tags
|
||||
addedTag(addedTag)
|
||||
{
|
||||
@@ -600,7 +638,7 @@ export default {
|
||||
// TODO(chris): focusin, focusout, keydown and tabindex should be in the filter component
|
||||
// TODO(chris): filter component column chooser has no accessibilty features
|
||||
template: `
|
||||
<div class="stv-list h-100 pt-3">
|
||||
<div class="stv-list h-100 pt-3">
|
||||
<div
|
||||
class="tabulator-container d-flex flex-column h-100"
|
||||
:class="{'has-filter': filter.length}"
|
||||
@@ -627,6 +665,27 @@ 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"
|
||||
@@ -637,22 +696,23 @@ export default {
|
||||
@updated="updatedTag"
|
||||
zuordnung_typ="prestudent_id"
|
||||
></core-tag>
|
||||
</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>
|
||||
<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>
|
||||
|
||||
<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,6 +3,7 @@ import FormInput from "../Form/Input.js";
|
||||
import BsModal from '../Bootstrap/Modal.js';
|
||||
|
||||
export default {
|
||||
name: 'TagComponent',
|
||||
components: {
|
||||
CoreForm,
|
||||
FormInput,
|
||||
@@ -44,7 +45,9 @@ export default {
|
||||
insertvon: "",
|
||||
updateamum: "",
|
||||
updatevon: "",
|
||||
response: ""
|
||||
response: "",
|
||||
start: "",
|
||||
ende: ""
|
||||
},
|
||||
mode: "create"
|
||||
};
|
||||
@@ -87,6 +90,10 @@ 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)
|
||||
{
|
||||
@@ -201,6 +208,14 @@ 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);
|
||||
}
|
||||
@@ -258,6 +273,15 @@ 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>
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
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;
|
||||
}
|
||||
@@ -22,14 +22,8 @@ import TableDownload from './Table/Download.js';
|
||||
import collapseAutoClose from '../../directives/collapseAutoClose.js';
|
||||
|
||||
import moduleLayoutFitDataStretchFrozen from '../../tabulator/layouts/fitDataStretchFrozen.js';
|
||||
import InternalToExternalEventBroadcastModule from "../../tabulator/customModules/InternalToExternalEventBroadcastModule.js"
|
||||
import MenuExtensionModule from "../../tabulator/customModules/MenuExtensionModule.js"
|
||||
import ResponsiveLayoutExtensionModule from "../../tabulator/customModules/ResponsiveLayoutExtensionModule.js"
|
||||
|
||||
import { debounce } from "../../helpers/DebounceHelper.js";
|
||||
|
||||
import ApiFilter from '../../api/factory/filter.js';
|
||||
import ApiPhrases from '../../api/factory/phrasen.js';
|
||||
|
||||
//
|
||||
const FILTER_COMPONENT_NEW_FILTER = 'Filter Component New Filter';
|
||||
@@ -90,9 +84,8 @@ export const CoreFilterCmpt = {
|
||||
useSelectionSpan: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
}
|
||||
},
|
||||
inject: ["language"],
|
||||
data: function() {
|
||||
return {
|
||||
uuid: 0,
|
||||
@@ -127,8 +120,7 @@ export const CoreFilterCmpt = {
|
||||
headerFilter: false,
|
||||
group: false,
|
||||
page: false,
|
||||
},
|
||||
collapsedHeadingLocalizationTimer: null,
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -191,25 +183,20 @@ export const CoreFilterCmpt = {
|
||||
return columns;
|
||||
},
|
||||
fieldIdsForVisibilty() {
|
||||
if (!this.tableBuilt) return [];
|
||||
|
||||
const localizedColumnTitles = this.tabulator.getLang().columns;
|
||||
const isTabulatorLocalized = !!this.$props.tabulatorOptions.locale;
|
||||
return this.tabulator
|
||||
.getColumns()
|
||||
.filter((col) => {
|
||||
let def = col.getDefinition();
|
||||
let title =
|
||||
isTabulatorLocalized && localizedColumnTitles[def.field]
|
||||
? localizedColumnTitles[def.field]
|
||||
: def.title;
|
||||
return (
|
||||
!def.frozen &&
|
||||
title &&
|
||||
def.formatter != "responsiveCollapse"
|
||||
);
|
||||
})
|
||||
.map((col) => col.getField());
|
||||
if (!this.tableBuilt)
|
||||
return [];
|
||||
return this.tabulator.getColumns().filter(col => {
|
||||
let def = col.getDefinition();
|
||||
return !def.frozen && def.title && def.formatter != "responsiveCollapse";
|
||||
}).map(col => col.getField());
|
||||
},
|
||||
fieldNames() {
|
||||
if (!this.tableBuilt)
|
||||
return {};
|
||||
return this.tabulator.getColumns().reduce((res, col) => {
|
||||
res[col.getField()] = col.getDefinition().title;
|
||||
return res;
|
||||
}, {});
|
||||
},
|
||||
idExtra() {
|
||||
if (!this.uuid)
|
||||
@@ -217,38 +204,14 @@ export const CoreFilterCmpt = {
|
||||
return '-' + this.uuid;
|
||||
},
|
||||
columnsForFilter() {
|
||||
if (!this.filteredColumns || !this.datasetMetadata) return [];
|
||||
|
||||
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;
|
||||
}, {});
|
||||
}
|
||||
|
||||
return this.datasetMetadata.map((el) => ({
|
||||
...el,
|
||||
...{ title: filterTitles[el.name] },
|
||||
}));
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
"language.value": {
|
||||
handler(newSelectedLanguage) {
|
||||
if (!this.$props.tabulatorOptions.locale) return;
|
||||
|
||||
this.tabulator.setLocale(newSelectedLanguage);
|
||||
},
|
||||
},
|
||||
if (!this.filteredColumns || !this.datasetMetadata)
|
||||
return [];
|
||||
const filterTitles = this.filteredColumns.reduce((a,c) => {
|
||||
a[c.field] = c.title;
|
||||
return a;
|
||||
}, {});
|
||||
return this.datasetMetadata.map(el => ({...el, ...{title: filterTitles[el.name]}}));
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reloadTable() {
|
||||
@@ -257,10 +220,6 @@ export const CoreFilterCmpt = {
|
||||
else
|
||||
this.getFilter();
|
||||
},
|
||||
setSelectedFields() {
|
||||
const cols = this.tabulator.getColumns();
|
||||
this.selectedFields = cols.filter(col => col.isVisible()).map(col => col.getField());
|
||||
},
|
||||
async initTabulator() {
|
||||
let placeholder = '< Phrasen Plugin not loaded! >';
|
||||
if (this.$p) {
|
||||
@@ -304,10 +263,6 @@ export const CoreFilterCmpt = {
|
||||
persistence: this.persistence,
|
||||
}, ...(this.tabulatorOptions || {})};
|
||||
|
||||
if (tabulatorOptions.locale) {
|
||||
tabulatorOptions = await this.configureTabulatorLocalizations(tabulatorOptions);
|
||||
}
|
||||
|
||||
// set default height if no height property is set
|
||||
if (tabulatorOptions.height === undefined &&
|
||||
tabulatorOptions.minHeight === undefined &&
|
||||
@@ -336,10 +291,10 @@ export const CoreFilterCmpt = {
|
||||
}
|
||||
|
||||
// Start the tabulator with the build options
|
||||
this.tabulator = new Tabulator(this.$refs.table, {
|
||||
...tabulatorOptions,
|
||||
debugInvalidOptions: false,
|
||||
});
|
||||
this.tabulator = new Tabulator(
|
||||
this.$refs.table,
|
||||
tabulatorOptions
|
||||
);
|
||||
// If event handlers have been provided
|
||||
if (Array.isArray(this.tabulatorEvents) && this.tabulatorEvents.length > 0)
|
||||
{
|
||||
@@ -347,10 +302,7 @@ export const CoreFilterCmpt = {
|
||||
for (let evt of this.tabulatorEvents)
|
||||
this.tabulator.on(evt.event, evt.handler);
|
||||
}
|
||||
this.tabulator.on('tableBuilt', () => {
|
||||
this.tableBuilt = true;
|
||||
this.$emit('tableBuilt');
|
||||
});
|
||||
this.tabulator.on('tableBuilt', () => {this.tableBuilt = true; this.$emit('tableBuilt');});
|
||||
this.tabulator.on("rowSelectionChanged", data => {
|
||||
this.selectedData = data;
|
||||
});
|
||||
@@ -385,7 +337,7 @@ export const CoreFilterCmpt = {
|
||||
this.tabulator.on('tableBuilt', () => {
|
||||
const cols = this.tabulator.getColumns();
|
||||
this.fields = cols.map(col => col.getField());
|
||||
this.setSelectedFields();
|
||||
this.selectedFields = cols.filter(col => col.isVisible()).map(col => col.getField());
|
||||
if (this.tabulator.options.persistence.headerFilter)
|
||||
this._setHeaderFilter();
|
||||
});
|
||||
@@ -396,121 +348,6 @@ export const CoreFilterCmpt = {
|
||||
this.filterActive = filters.length > 0;
|
||||
this.$emit("headerFilterOn", this.filterActive);
|
||||
});
|
||||
this.tabulator.on("localized", () => {
|
||||
this.tabulator.modules.responsiveLayout.generateCollapsedContent();
|
||||
});
|
||||
},
|
||||
async configureTabulatorLocalizations(tabulatorOptions) {
|
||||
tabulatorOptions.locale = this.$p.user_language.value;
|
||||
tabulatorOptions.langs = {};
|
||||
|
||||
const genericTabulatorPhrasesResponse = await this.$api.call(
|
||||
ApiPhrases.getTabulatorPhrases(),
|
||||
);
|
||||
const genericTabulatorPhrasesData = genericTabulatorPhrasesResponse.data;
|
||||
Object.keys(genericTabulatorPhrasesData).forEach((language) => {
|
||||
let genericTabulatorPhraseToTranslationMapper = {};
|
||||
genericTabulatorPhrasesData[language].forEach((phrase) => {
|
||||
genericTabulatorPhraseToTranslationMapper[phrase.phrase] = phrase.text;
|
||||
});
|
||||
|
||||
tabulatorOptions.langs[language] = {
|
||||
data: {
|
||||
loading: genericTabulatorPhraseToTranslationMapper["loading"],
|
||||
error: genericTabulatorPhraseToTranslationMapper["error"],
|
||||
},
|
||||
groups: {
|
||||
item: genericTabulatorPhraseToTranslationMapper["item"],
|
||||
items: genericTabulatorPhraseToTranslationMapper["items"],
|
||||
},
|
||||
pagination: {
|
||||
page_size:
|
||||
genericTabulatorPhraseToTranslationMapper["page_size"],
|
||||
page_title:
|
||||
genericTabulatorPhraseToTranslationMapper["page_title"],
|
||||
first: genericTabulatorPhraseToTranslationMapper["first"],
|
||||
first_title:
|
||||
genericTabulatorPhraseToTranslationMapper["first_title"],
|
||||
last: genericTabulatorPhraseToTranslationMapper["last"],
|
||||
last_title:
|
||||
genericTabulatorPhraseToTranslationMapper["last_title"],
|
||||
prev: genericTabulatorPhraseToTranslationMapper["prev"],
|
||||
prev_title:
|
||||
genericTabulatorPhraseToTranslationMapper["prev_title"],
|
||||
next: genericTabulatorPhraseToTranslationMapper["next"],
|
||||
next_title:
|
||||
genericTabulatorPhraseToTranslationMapper["next_title"],
|
||||
all: genericTabulatorPhraseToTranslationMapper["all"],
|
||||
counter: {
|
||||
showing:
|
||||
genericTabulatorPhraseToTranslationMapper["showing"],
|
||||
of: genericTabulatorPhraseToTranslationMapper["of"],
|
||||
rows: genericTabulatorPhraseToTranslationMapper["rows"],
|
||||
pages: genericTabulatorPhraseToTranslationMapper["pages"],
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
let phrasesGroupedByCategoryRequestParam = {};
|
||||
tabulatorOptions.columns.forEach((column) => {
|
||||
if (!column.titlePhrase?.length) return;
|
||||
|
||||
let [category, phrase] = column.titlePhrase.split("/");
|
||||
if (phrasesGroupedByCategoryRequestParam[category]) {
|
||||
phrasesGroupedByCategoryRequestParam[category].push(phrase);
|
||||
} else {
|
||||
phrasesGroupedByCategoryRequestParam[category] = [phrase];
|
||||
}
|
||||
});
|
||||
tabulatorOptions.menuItemPhrases?.forEach((menuItemPhrase) => {
|
||||
let [category, phrase] = menuItemPhrase.split("/");
|
||||
if (phrasesGroupedByCategoryRequestParam[category]) {
|
||||
phrasesGroupedByCategoryRequestParam[category].push(phrase);
|
||||
} else {
|
||||
phrasesGroupedByCategoryRequestParam[category] = [phrase];
|
||||
}
|
||||
});
|
||||
|
||||
if (!Object.keys(phrasesGroupedByCategoryRequestParam).length) {
|
||||
return tabulatorOptions;
|
||||
}
|
||||
|
||||
const phrasesResponse = await this.$api.call(
|
||||
ApiPhrases.getPhrases(phrasesGroupedByCategoryRequestParam),
|
||||
);
|
||||
const phrasesData = phrasesResponse.data;
|
||||
|
||||
Object.keys(phrasesData).forEach((language) => {
|
||||
let phraseToTranslationMapper = {};
|
||||
phrasesData[language].forEach((phrase) => {
|
||||
phraseToTranslationMapper[
|
||||
phrase.category + "/" + phrase.phrase
|
||||
] = phrase.text;
|
||||
});
|
||||
|
||||
let columnFieldToTranslationMapper = {};
|
||||
tabulatorOptions.columns.forEach((column) => {
|
||||
if (!column.titlePhrase?.length) return;
|
||||
|
||||
columnFieldToTranslationMapper[column.field] =
|
||||
phraseToTranslationMapper[column.titlePhrase] ??
|
||||
"<< PHRASE " + column.titlePhrase + " >>";
|
||||
});
|
||||
tabulatorOptions.langs[language].columns =
|
||||
columnFieldToTranslationMapper;
|
||||
|
||||
let menuItemPhraseToTranslationMapper = {};
|
||||
tabulatorOptions.menuItemPhrases?.forEach((menuItemPhrase) => {
|
||||
menuItemPhraseToTranslationMapper[menuItemPhrase] =
|
||||
phraseToTranslationMapper[menuItemPhrase] ??
|
||||
"<< PHRASE " + menuItemPhrase + " >>";
|
||||
});
|
||||
tabulatorOptions.langs[language].menuItems =
|
||||
menuItemPhraseToTranslationMapper;
|
||||
});
|
||||
|
||||
return tabulatorOptions;
|
||||
},
|
||||
updateTabulator() {
|
||||
if (this.tabulator) {
|
||||
@@ -534,7 +371,6 @@ export const CoreFilterCmpt = {
|
||||
});
|
||||
this.tabulator.clearFilter();
|
||||
this.filterActive = false;
|
||||
this.$emit('headerFilterOn', this.filterActive)
|
||||
},
|
||||
_setHeaderFilter()
|
||||
{
|
||||
@@ -818,18 +654,7 @@ export const CoreFilterCmpt = {
|
||||
|
||||
// parent not found
|
||||
return false;
|
||||
},
|
||||
getColumnNames() {
|
||||
if (!this.tableBuilt) {
|
||||
return {};
|
||||
} else if (this.tabulator.options.locale) {
|
||||
return this.tabulator.getLang().columns;
|
||||
}
|
||||
return this.tabulator.getColumns().reduce((res, col) => {
|
||||
res[col.getField()] = col.getDefinition().title;
|
||||
return res;
|
||||
}, {});
|
||||
},
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
if (!this.tableOnly == !this.filterType)
|
||||
@@ -840,10 +665,6 @@ export const CoreFilterCmpt = {
|
||||
alert('"nwNewEntry" listener is mandatory when sideMenu is true');
|
||||
this.uuid = _uuid++;
|
||||
this.$emit('uuidDefined', this.uuid)
|
||||
|
||||
Tabulator.registerModule(InternalToExternalEventBroadcastModule);
|
||||
Tabulator.registerModule(MenuExtensionModule);
|
||||
Tabulator.registerModule(ResponsiveLayoutExtensionModule);
|
||||
},
|
||||
mounted() {
|
||||
this.initTabulator().then(() => {
|
||||
@@ -902,6 +723,7 @@ 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>
|
||||
|
||||
@@ -911,7 +733,7 @@ export const CoreFilterCmpt = {
|
||||
:data-bs-parent="'#filterCollapsables' + idExtra"
|
||||
:fields="fieldIdsForVisibilty"
|
||||
:selected="selectedFields"
|
||||
:names="getColumnNames()"
|
||||
:names="fieldNames"
|
||||
@hide="tabulator.hideColumn($event)"
|
||||
@show="tabulator.showColumn($event)"
|
||||
v-collapse-auto-close
|
||||
|
||||
@@ -42,7 +42,7 @@ export default {
|
||||
watch: {
|
||||
selected(n) {
|
||||
this.selectedFields = n;
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggle(field) {
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
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';
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -8,7 +8,6 @@ import dms from "./result/dms.js";
|
||||
import cms from "./result/cms.js";
|
||||
import mergedStudent from "./result/mergedstudent.js";
|
||||
import mergedPerson from "./result/mergedperson.js";
|
||||
import { debounce } from "../../helpers/DebounceHelper.js";
|
||||
|
||||
export default {
|
||||
name: "FhcSearchbar",
|
||||
@@ -58,107 +57,6 @@ export default {
|
||||
settingsDropdown: null,
|
||||
lastQuery: "",
|
||||
isSearchShownInMobileView: false,
|
||||
callsearchapi: debounce(() => {
|
||||
this.error = null;
|
||||
this.searchresult.splice(0, this.searchresult.length);
|
||||
this.searching = true;
|
||||
this.showsearchresult();
|
||||
if (this.searchsettings.types.length === 0) {
|
||||
this.error = this.$p.t("search/error_missing_type");
|
||||
this.searching = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.abortController) this.abortController.abort();
|
||||
|
||||
if (!this.searchsettings.searchstr?.length) return;
|
||||
|
||||
this.abortController = new AbortController();
|
||||
|
||||
this.searchfunction(this.searchsettings, {
|
||||
timeout: 50000,
|
||||
signal: this.abortController.signal,
|
||||
})
|
||||
.then((response) => {
|
||||
if (!response.data) {
|
||||
this.error = this.$p.t("search/error_general");
|
||||
} else {
|
||||
let res = response.data.map((el) =>
|
||||
el.data ? { ...el, ...JSON.parse(el.data) } : el,
|
||||
);
|
||||
this.lastQuery = response.meta.searchstring;
|
||||
if (this.searchoptions.mergeResults) {
|
||||
let counter = 0;
|
||||
let mergeTypes = [];
|
||||
let mergedType = "merged-";
|
||||
let mergeKey = "";
|
||||
|
||||
switch (this.searchoptions.mergeResults) {
|
||||
case "student":
|
||||
mergeTypes = ["student", "prestudent"];
|
||||
mergedType +=
|
||||
this.searchoptions.mergeResults;
|
||||
mergeKey = "uid";
|
||||
break;
|
||||
case "person":
|
||||
mergeTypes = [
|
||||
"person",
|
||||
"employee",
|
||||
"student",
|
||||
"prestudent",
|
||||
];
|
||||
mergedType +=
|
||||
this.searchoptions.mergeResults;
|
||||
mergeKey = "person_id";
|
||||
break;
|
||||
}
|
||||
|
||||
if (mergeTypes.length) {
|
||||
res = Object.values(
|
||||
res.reduce((a, c) => {
|
||||
if (!mergeTypes.includes(c.renderer)) {
|
||||
a["nomerge" + counter++] = c;
|
||||
} else if (c[mergeKey] === null) {
|
||||
a["nomerge" + counter++] = c;
|
||||
} else if (
|
||||
a[c[mergeKey]] === undefined
|
||||
) {
|
||||
a[c[mergeKey]] = {
|
||||
rank: c.rank,
|
||||
renderer: mergedType,
|
||||
type: mergedType,
|
||||
list: [c],
|
||||
};
|
||||
} else {
|
||||
a[c[mergeKey]].list.push(c);
|
||||
if (c.rank > a[c[mergeKey]].rank)
|
||||
a[c[mergeKey]].rank = c.rank;
|
||||
}
|
||||
return a;
|
||||
}, {}),
|
||||
).sort((a, b) => b.rank - a.rank);
|
||||
}
|
||||
}
|
||||
this.searchresult = res;
|
||||
this.searchmode = response.meta.mode;
|
||||
}
|
||||
this.searching = false;
|
||||
this.retry = 0;
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.code == "ERR_CANCELED") {
|
||||
return (this.retry = 0);
|
||||
}
|
||||
if (error.code == "ECONNABORTED" && this.retry) {
|
||||
this.retry--;
|
||||
return this.callsearchapi();
|
||||
}
|
||||
|
||||
this.error = this.$p.t("search/error_general", error);
|
||||
this.searching = false;
|
||||
this.retry = 0;
|
||||
});
|
||||
}, 500),
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -447,18 +345,122 @@ export default {
|
||||
this.abort();
|
||||
if (this.searchsettings.searchstr.length >= 2) {
|
||||
this.calcSearchResultExtent();
|
||||
this.callsearchapi();
|
||||
this.searchtimer = setTimeout(this.callsearchapi, 500);
|
||||
} else {
|
||||
this.showresult = false;
|
||||
}
|
||||
},
|
||||
abort() {
|
||||
if (this.searchtimer !== null) {
|
||||
clearTimeout(this.searchtimer);
|
||||
}
|
||||
if (this.abortController) {
|
||||
this.abortController.abort();
|
||||
this.abortController = null;
|
||||
}
|
||||
this.searchresult = [];
|
||||
},
|
||||
callsearchapi: function () {
|
||||
this.error = null;
|
||||
this.searchresult.splice(0, this.searchresult.length);
|
||||
this.searching = true;
|
||||
this.showsearchresult();
|
||||
if (this.searchsettings.types.length === 0) {
|
||||
this.error = this.$p.t("search/error_missing_type");
|
||||
this.searching = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.abortController) this.abortController.abort();
|
||||
|
||||
if (!this.searchsettings.searchstr?.length) return;
|
||||
|
||||
this.abortController = new AbortController();
|
||||
|
||||
this.searchfunction(this.searchsettings, {
|
||||
timeout: 50000,
|
||||
signal: this.abortController.signal,
|
||||
})
|
||||
.then((response) => {
|
||||
if (!response.data) {
|
||||
this.error = this.$p.t("search/error_general");
|
||||
} else {
|
||||
let res = response.data.map((el) =>
|
||||
el.data ? { ...el, ...JSON.parse(el.data) } : el,
|
||||
);
|
||||
this.lastQuery = response.meta.searchstring;
|
||||
if (this.searchoptions.mergeResults) {
|
||||
let counter = 0;
|
||||
let mergeTypes = [];
|
||||
let mergedType = "merged-";
|
||||
let mergeKey = "";
|
||||
|
||||
switch (this.searchoptions.mergeResults) {
|
||||
case "student":
|
||||
mergeTypes = ["student", "prestudent"];
|
||||
mergedType +=
|
||||
this.searchoptions.mergeResults;
|
||||
mergeKey = "uid";
|
||||
break;
|
||||
case "person":
|
||||
mergeTypes = [
|
||||
"person",
|
||||
"employee",
|
||||
"student",
|
||||
"prestudent",
|
||||
];
|
||||
mergedType +=
|
||||
this.searchoptions.mergeResults;
|
||||
mergeKey = "person_id";
|
||||
break;
|
||||
}
|
||||
|
||||
if (mergeTypes.length) {
|
||||
res = Object.values(
|
||||
res.reduce((a, c) => {
|
||||
if (!mergeTypes.includes(c.renderer)) {
|
||||
a["nomerge" + counter++] = c;
|
||||
} else if (c[mergeKey] === null) {
|
||||
a["nomerge" + counter++] = c;
|
||||
} else if (
|
||||
a[c[mergeKey]] === undefined
|
||||
) {
|
||||
a[c[mergeKey]] = {
|
||||
rank: c.rank,
|
||||
renderer: mergedType,
|
||||
type: mergedType,
|
||||
list: [c],
|
||||
};
|
||||
} else {
|
||||
a[c[mergeKey]].list.push(c);
|
||||
if (c.rank > a[c[mergeKey]].rank)
|
||||
a[c[mergeKey]].rank = c.rank;
|
||||
}
|
||||
return a;
|
||||
}, {}),
|
||||
).sort((a, b) => b.rank - a.rank);
|
||||
}
|
||||
}
|
||||
this.searchresult = res;
|
||||
this.searchmode = response.meta.mode;
|
||||
}
|
||||
this.searching = false;
|
||||
this.retry = 0;
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.code == "ERR_CANCELED") {
|
||||
return (this.retry = 0);
|
||||
}
|
||||
if (error.code == "ECONNABORTED" && this.retry) {
|
||||
this.retry--;
|
||||
return this.callsearchapi();
|
||||
}
|
||||
|
||||
this.error = this.$p.t("search/error_general", error);
|
||||
this.searching = false;
|
||||
this.retry = 0;
|
||||
});
|
||||
},
|
||||
refreshsearch: function () {
|
||||
this.search();
|
||||
this.togglesettings();
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
export default {
|
||||
name: 'VerticalSplit',
|
||||
props: {
|
||||
defaultRatio: {
|
||||
type: Array,
|
||||
default: () => [50, 50]
|
||||
}
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
availHeight: 0,
|
||||
@@ -50,17 +56,22 @@ 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/2);
|
||||
this.topheight = Math.floor(this.availHeight * (this.defaultRatio[0] / 100));
|
||||
} else {
|
||||
this.topheight = Math.floor( ((((this.topheight * 100) / oldavailHeight) / 100) * this.availHeight) );
|
||||
}
|
||||
|
||||
this.bottomheight = this.availHeight - this.topheight;
|
||||
},
|
||||
collapseTop: function() {
|
||||
@@ -74,8 +85,8 @@ export default {
|
||||
this.bottomheight = 0;
|
||||
},
|
||||
showBoth: function() {
|
||||
this.topheight = Math.floor(this.availHeight/2);
|
||||
this.bottomheight = Math.floor(this.availHeight/2);
|
||||
this.topheight = Math.floor(this.availHeight * (this.defaultRatio[0] / 100));
|
||||
this.bottomheight = this.availHeight - this.topheight
|
||||
},
|
||||
isCollapsed: function() {
|
||||
if( this.topheight === 0 ) {
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* check if an absolute url is a URL to Compat CI-Controller
|
||||
*
|
||||
* @param {string} link
|
||||
* @returns {boolean}
|
||||
*/
|
||||
const isCompatLink = function(link) {
|
||||
let ci_router_url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
|
||||
let isCompatLink = link.startsWith(ci_router_url + '/Cis/Compat/');
|
||||
return isCompatLink;
|
||||
};
|
||||
|
||||
/**
|
||||
* calc Param Object with path and query members for use with router-link component
|
||||
*
|
||||
* @param {string} link
|
||||
* @returns {object}
|
||||
*/
|
||||
const calcCompatRouterLink = function (link) {
|
||||
let ci_router_url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
|
||||
let uri = link.replace(ci_router_url, '').split('?');
|
||||
let path = uri[0];
|
||||
let query = (uri.length === 2) ? VueRouter.parseQuery(uri[1]) : {};
|
||||
return {
|
||||
"path": path,
|
||||
"query": query
|
||||
};
|
||||
};
|
||||
|
||||
const isRouterLink = function(router, url) {
|
||||
if(url === null) {
|
||||
return false;
|
||||
}
|
||||
const robj = router.resolve(url, router.currentRoute);
|
||||
console.log('isRouterLink');
|
||||
};
|
||||
|
||||
export {
|
||||
isCompatLink,
|
||||
calcCompatRouterLink,
|
||||
isRouterLink
|
||||
};
|
||||
|
||||
export default {
|
||||
isCompatLink,
|
||||
calcCompatRouterLink,
|
||||
isRouterLink
|
||||
};
|
||||
@@ -1,7 +0,0 @@
|
||||
export const debounce = (callback, wait) => {
|
||||
let timeoutId = null;
|
||||
return (context) => {
|
||||
window.clearTimeout(timeoutId);
|
||||
timeoutId = window.setTimeout(() => callback(), wait);
|
||||
}
|
||||
}
|
||||
@@ -1,66 +1,45 @@
|
||||
export async function splitMailsHelper(mails, event, subject, body, alertPluginRef, phrasenPluginRef) {
|
||||
await phrasenPluginRef.loadCategory('ui');
|
||||
export async function splitMailsHelper(mails, event, subject, alertPluginRef, phrasenPluginRef) {
|
||||
let splititem = ",";
|
||||
let maillist = mails.join(splititem);
|
||||
let useBcc = event?.ctrlKey || event?.metaKey;
|
||||
|
||||
// build query parameters using URLSearchParams to get encoding
|
||||
const urlParams = new URLSearchParams();
|
||||
if (subject && typeof subject === 'string') {
|
||||
urlParams.append('subject', subject);
|
||||
}
|
||||
if (body && typeof body === 'string') {
|
||||
urlParams.append('body', body);
|
||||
}
|
||||
|
||||
// initial overhead: "mailto:?bcc=" -> 12 chars, "mailto:" -> 7 chars
|
||||
const baseOverhead = useBcc ? 12 : 7;
|
||||
let queryString = urlParams.toString().replace(/\+/g, '%20');;
|
||||
let overhead = baseOverhead + (queryString ? 1 + queryString.length : 0); // +1 accounts for '?' or '&'
|
||||
|
||||
// calculate overhead with body to exceed the limit
|
||||
if (overhead > 2024) {
|
||||
await alertPluginRef.alertWarning(phrasenPluginRef.t('ui', 'bodyZuLang'));
|
||||
urlParams.delete('body').replace(/\+/g, '%20');;
|
||||
queryString = urlParams.toString();
|
||||
overhead = baseOverhead + (queryString ? 1 + queryString.length : 0);
|
||||
let mailto = "";
|
||||
// take subject line length + '?subject=' length into account
|
||||
const subjectlength = subject && typeof subject === 'string' ? subject.length + 9 : 0
|
||||
if (maillist.length > 2024)
|
||||
{
|
||||
if (await alertPluginRef.confirm({message: phrasenPluginRef.t('stv', 'zuvieleEMails') }) === false)
|
||||
return;
|
||||
}
|
||||
|
||||
let firstrun = true;
|
||||
while (maillist.length > 0) {
|
||||
let mailto = "";
|
||||
if (maillist.length + overhead > 2024) {
|
||||
let splitposition = maillist.lastIndexOf(splititem, 2024 - overhead);
|
||||
|
||||
// Fallback guard: if a single email address is somehow longer than the remaining space
|
||||
if (splitposition === -1) {
|
||||
splitposition = maillist.indexOf(splititem);
|
||||
if (splitposition === -1) splitposition = maillist.length;
|
||||
}
|
||||
|
||||
let useBcc = event?.ctrlKey || event?.metaKey;
|
||||
while (maillist.length > 0)
|
||||
{
|
||||
if (maillist.length + subjectlength > 2024)
|
||||
{
|
||||
let splitposition = maillist.lastIndexOf(splititem, 1900);
|
||||
mailto = maillist.substring(0, splitposition);
|
||||
maillist = maillist.substring(splitposition + 1);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
mailto = maillist;
|
||||
maillist = "";
|
||||
}
|
||||
|
||||
// construct the clean mailLink
|
||||
let mailLink = useBcc ? `mailto:?bcc=${mailto}` : `mailto:${mailto}`;
|
||||
if (queryString) {
|
||||
// If using BCC, the string already has a '?', so append with '&'. Otherwise, start with '?'
|
||||
mailLink += useBcc ? `&${queryString}` : `?${queryString}`;
|
||||
}
|
||||
|
||||
if (firstrun) {
|
||||
if(subject && typeof subject === 'string') mailLink += `?subject=${subject}`
|
||||
if (firstrun)
|
||||
{
|
||||
window.location.href = mailLink;
|
||||
firstrun = false;
|
||||
} else {
|
||||
if (await alertPluginRef.confirm({message: phrasenPluginRef.t('ui', 'weitereEMail')}) === true) {
|
||||
}
|
||||
else
|
||||
{
|
||||
if (await alertPluginRef.confirm({message: phrasenPluginRef.t('stv', 'weitereEMail')}) === true)
|
||||
{
|
||||
window.location.href = mailLink;
|
||||
} else {
|
||||
break; // Stop processing further batches if the user cancels
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -16,49 +16,4 @@ export function capitalize(string) {
|
||||
|
||||
return '';
|
||||
|
||||
}
|
||||
|
||||
export function convertCase(string, from, to) {
|
||||
const possibleCases = ["kebab", "snake", "camel"];
|
||||
if (
|
||||
from === to ||
|
||||
!possibleCases.includes(from) ||
|
||||
!possibleCases.includes(to)
|
||||
)
|
||||
return string;
|
||||
|
||||
const individualWords =
|
||||
from === "kebab"
|
||||
? string.split("-")
|
||||
: from === "snake"
|
||||
? string.split("_")
|
||||
: splitWordsInCamelCase(string);
|
||||
|
||||
const formattedIndividualWords = ["snake", "kebab"].includes(to)
|
||||
? individualWords.map((word) => word.toLowerCase())
|
||||
: individualWords.map((word, index) => {
|
||||
if (!index) return word.toLowerCase();
|
||||
return word.slice(0, 1).toUpperCase() + word.slice(1).toLowerCase();
|
||||
});
|
||||
|
||||
const joinCharacter = to === "snake" ? "_" : to === "kebab" ? "-" : "";
|
||||
return formattedIndividualWords.join(joinCharacter);
|
||||
}
|
||||
|
||||
function splitWordsInCamelCase(string) {
|
||||
const lastUpperCaseLetterIndex = string
|
||||
.split("")
|
||||
.findLastIndex((character) => {
|
||||
return character.toUpperCase() === character;
|
||||
});
|
||||
|
||||
if (lastUpperCaseLetterIndex < 1) {
|
||||
return [string];
|
||||
}
|
||||
|
||||
let splitWords = splitWordsInCamelCase(
|
||||
string.slice(0, lastUpperCaseLetterIndex),
|
||||
);
|
||||
splitWords.push(string.slice(lastUpperCaseLetterIndex));
|
||||
return splitWords;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,284 @@
|
||||
import FhcDashboard from '../../components/Dashboard/Dashboard.js';
|
||||
import LvPlan from "../../components/Cis/LvPlan/Lehrveranstaltung.js";
|
||||
import MyLvPlan from "../../components/Cis/LvPlan/MyLvPlan.js";
|
||||
import Mylv from "../../components/Cis/Mylv/MyLv.js";
|
||||
import Profil from "../../components/Cis/Profil/Profil.js";
|
||||
import Raumsuche from "../../components/Cis/Raumsuche/Raumsuche.js";
|
||||
import CmsNews from "../../components/Cis/Cms/News.js";
|
||||
import CmsContent from "../../components/Cis/Cms/Content.js";
|
||||
import Info from "../../components/Cis/Mylv/Semester/Studiengang/Lv/Info.js";
|
||||
import RoomInformation, {DEFAULT_MODE_RAUMINFO_DESKTOP, DEFAULT_MODE_RAUMINFO_MOBILE} from "../../components/Cis/Mylv/RoomInformation.js";
|
||||
import AbgabetoolStudent from "../../components/Cis/Abgabetool/AbgabetoolStudent.js";
|
||||
import AbgabetoolMitarbeiter from "../../components/Cis/Abgabetool/AbgabetoolMitarbeiter.js";
|
||||
import AbgabetoolAssistenz from "../../components/Cis/Abgabetool/AbgabetoolAssistenz.js";
|
||||
import DeadlineOverview from "../../components/Cis/Abgabetool/DeadlineOverview.js";
|
||||
import Studium from "../../components/Cis/Studium/Studium.js";
|
||||
import StgOrgLvPlan from "../../components/Cis/LvPlan/StgOrg.js";
|
||||
import OtherLvPlan from "../../components/Cis/LvPlan/OtherLvPlan.js";
|
||||
import PaabgabeUebersicht from "../../components/Cis/ProjektabgabeUebersicht/ProjektabgabeUebersicht.js";
|
||||
import Benotungstool from "../../components/Cis/Benotungstool/Benotungstool.js";
|
||||
import Zeitsperren from "../../components/Cis/Zeitsperren/Zeitsperren.js";
|
||||
import Compat from "../../components/Cis/Compat.js";
|
||||
|
||||
const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
|
||||
const isMobile = window.matchMedia("(max-width: 767px)").matches;
|
||||
|
||||
const router = VueRouter.createRouter({
|
||||
history: VueRouter.createWebHistory(`/${ciPath}`),
|
||||
routes: [
|
||||
{
|
||||
path: `/Cis/Compat/:mode(ci|legacy)/:path(.*)`,
|
||||
name: 'Compat',
|
||||
component: Compat,
|
||||
props: (route) => {
|
||||
return {
|
||||
mode: route.params.mode,
|
||||
path: route.params.path,
|
||||
query_string: VueRouter.stringifyQuery(route.query)
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: `/Cis/Studium`,
|
||||
name: 'Studium',
|
||||
component: Studium,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Profil/View/:uid`,
|
||||
name: 'ProfilView',
|
||||
component: Profil,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Profil`,
|
||||
name: 'Profil',
|
||||
component: Profil,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Abgabetool/Student/:student_uid_prop?`,
|
||||
name: 'AbgabetoolStudent',
|
||||
component: AbgabetoolStudent,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Abgabetool/Mitarbeiter`,
|
||||
name: 'AbgabetoolMitarbeiter',
|
||||
component: AbgabetoolMitarbeiter,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Abgabetool/Assistenz/:stg_kz_prop?`,
|
||||
name: 'AbgabetoolAssistenz',
|
||||
component: AbgabetoolAssistenz,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Abgabetool/Deadlines/:person_uid_prop?`,
|
||||
name: 'DeadlineOverview',
|
||||
component: DeadlineOverview,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Raumsuche`,
|
||||
name: 'Raumsuche',
|
||||
component: Raumsuche,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/ProjektabgabeUebersicht`,
|
||||
name: 'PaabgabeUebersicht',
|
||||
component: PaabgabeUebersicht,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Benotungstool/:lv_id?/:sem_kurzbz?`,
|
||||
name: 'Benotungstool',
|
||||
component: Benotungstool,
|
||||
props: true
|
||||
},
|
||||
// Redirect old links to new format
|
||||
{
|
||||
path: "/CisVue/Cms/getRoomInformation/:ort_kurzbz",
|
||||
name: "RoomInformationOld",
|
||||
component: RoomInformation,
|
||||
redirect: (to) => {
|
||||
return { // redirect to longer Rauminfo url and map params
|
||||
name: "RoomInformation",
|
||||
params: { // in this case always populate other params since they are not optional
|
||||
ort_kurzbz: to.params.ort_kurzbz,
|
||||
mode: isMobile ? DEFAULT_MODE_RAUMINFO_MOBILE : DEFAULT_MODE_RAUMINFO_DESKTOP,
|
||||
focus_date: new Date().toISOString().split("T")[0]
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
path: `/CisVue/Cms/getRoomInformation/:mode/:focus_date/:ort_kurzbz`,
|
||||
name: 'RoomInformation',
|
||||
component: RoomInformation,
|
||||
props: (route) => { // validate and set mode/focus date if for some reason missing
|
||||
const validModes = ["Month", "Week", "Day"];
|
||||
|
||||
// check mode string
|
||||
const mode = route.params.mode &&
|
||||
validModes.includes(route.params.mode.charAt(0).toUpperCase() + route.params.mode.slice(1).toLowerCase())
|
||||
? route.params.mode.charAt(0).toUpperCase() + route.params.mode.slice(1).toLowerCase()
|
||||
: (isMobile ? DEFAULT_MODE_RAUMINFO_MOBILE : DEFAULT_MODE_RAUMINFO_DESKTOP);
|
||||
|
||||
// default to today date if not provided
|
||||
const d = new Date(route.params.focus_date)
|
||||
const focus_date = !isNaN(d) ? route.params.focus_date : new Date().toISOString().split("T")[0];
|
||||
|
||||
// for consistency reasons format the props into one object but actually use a new name to we dont collide with
|
||||
// existing viewData declaration written from codeigniter 3 into routerview tag
|
||||
return {
|
||||
propsViewData: {
|
||||
mode,
|
||||
focus_date,
|
||||
ort_kurzbz: route.params.ort_kurzbz
|
||||
}
|
||||
};
|
||||
},
|
||||
beforeEnter: (to, from, next) => {
|
||||
// missing mode or focus_date -> set defaults
|
||||
if (!to.params.mode || !to.params.focus_date) {
|
||||
next({
|
||||
name: "RoomInformation",
|
||||
params: {
|
||||
mode: to.params.mode || DEFAULT_MODE_RAUMINFO,
|
||||
focus_date: to.params.focus_date || new Date().toISOString().split("T")[0],
|
||||
ort_kurzbz: route.params.ort_kurzbz
|
||||
}
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
path: `/CisVue/Cms/Content/:content_id`,
|
||||
name: 'Content',
|
||||
component: CmsContent,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/CisVue/Cms/News`,
|
||||
name: 'News',
|
||||
component: CmsNews,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/MyLv/:studiensemester?`,
|
||||
name: 'MyLv',
|
||||
component: Mylv,
|
||||
props: true,
|
||||
},
|
||||
{
|
||||
path: `/Cis/MyLv/Info/:studien_semester/:lehrveranstaltung_id`,
|
||||
name: 'LvInfo',
|
||||
component: Info,
|
||||
props: true
|
||||
},
|
||||
// Redirect old links to new format
|
||||
{
|
||||
// only trigger on first param being numeric to avoid paths like "LvPlan/Month" entering here
|
||||
path: "/Cis/LvPlan/:lv_id(\\d+)",
|
||||
name: "LvPlanOld",
|
||||
component: LvPlan,
|
||||
redirect(to) {
|
||||
const route = Vue.unref(router.currentRoute);
|
||||
const { mode, focus_date } = route.params; // keep mode and focus_date if available
|
||||
return { // redirect to longer LvPlan url and map params
|
||||
name: "LvPlan",
|
||||
params: {
|
||||
mode,
|
||||
focus_date,
|
||||
lv_id: to.params.lv_id
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
path: `/Cis/LvPlan/:mode?/:focus_date?/:lv_id?`,
|
||||
name: 'LvPlan',
|
||||
component: LvPlan,
|
||||
props(route) {
|
||||
return {
|
||||
propsViewData: route.params
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: `/Cis/MyLvPlan/:mode?/:focus_date?`,
|
||||
name: 'MyLvPlan',
|
||||
component: MyLvPlan,
|
||||
props(route) {
|
||||
return {
|
||||
propsViewData: route.params
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: `/Cis/StgOrgLvPlan/:mode?/:focus_date?/:stgkz?/:sem?/:verband?/:gruppe?`,
|
||||
name: 'StgOrgLvPlan',
|
||||
component: StgOrgLvPlan,
|
||||
props(route) {
|
||||
return {
|
||||
propsViewData: route.params
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: `/Cis/OtherLvPlan/:otherUid/:mode?/:focus_date?`,
|
||||
name: "OtherLvPlan",
|
||||
component: OtherLvPlan,
|
||||
props(route) {
|
||||
return {
|
||||
propsViewData: route.params
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: `/Cis4`,
|
||||
name: 'Cis4',
|
||||
component: FhcDashboard,
|
||||
props: {dashboard: 'CIS'},
|
||||
},
|
||||
{
|
||||
path: `/`,
|
||||
name: 'FhcDashboard',
|
||||
component: FhcDashboard,
|
||||
props: {dashboard: 'CIS'},
|
||||
},
|
||||
/*
|
||||
* TODO(ma0080): 2026-07-06: commented out => check if needed
|
||||
*
|
||||
{
|
||||
path: '/:pathMatch(.*)*',
|
||||
name: 'Fallback',
|
||||
component: FhcDashboard,
|
||||
props: {dashboard: 'CIS'},
|
||||
redirect: () => {
|
||||
return {
|
||||
name: "Cis4",
|
||||
params: {
|
||||
dashboard: 'CIS'
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
*/
|
||||
{
|
||||
path: `/Cis/Zeitsperren`,
|
||||
name: 'Zeitsperren',
|
||||
component: Zeitsperren,
|
||||
props: true
|
||||
},
|
||||
]
|
||||
});
|
||||
|
||||
export {
|
||||
router
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
// changes within tabulator are often not adequately broadcast to the external component
|
||||
// this module exposes tabulator's internal events
|
||||
// if external event name is not specified, the dispatched external event will be the camelCase version of the kebab-case internal event
|
||||
|
||||
import Module from "../../../../vendor/olifolkerd/tabulator5/src/js/core/Module.js";
|
||||
import { convertCase } from "../../helpers/StringHelpers.js";
|
||||
|
||||
export default class InternalToExternalEventBroadcastModule extends Module {
|
||||
static moduleName = "internalToExternalEventBroadcast";
|
||||
static moduleInitNumber = 1;
|
||||
|
||||
constructor(table) {
|
||||
super(table);
|
||||
|
||||
this.eventsToBroadcast = [
|
||||
// example event
|
||||
// {
|
||||
// internal: "layout-refreshed",
|
||||
// external: null,
|
||||
// },
|
||||
];
|
||||
}
|
||||
|
||||
initialize() {
|
||||
this.eventsToBroadcast.forEach((event) => {
|
||||
this.subscribe(event.internal, () => {
|
||||
this.dispatchExternal(event.external ?? convertCase(event.internal, "kebab", "camel"));
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import Menu from "../../../../vendor/olifolkerd/tabulator5/src/js/modules/Menu/Menu.js";
|
||||
|
||||
export default class MenuExtensionModule extends Menu {
|
||||
static moduleName = "menu";
|
||||
static moduleInitNumber = 1;
|
||||
|
||||
constructor(table) {
|
||||
super(table);
|
||||
}
|
||||
|
||||
loadMenu(e, component, menu, parentEl, parentPopup){
|
||||
const isLocalizationEnabled = component.table.options.locale && component.table.options.locale !== "default";
|
||||
const menuItemTranslations = component.table.getLang().menuItems;
|
||||
if (isLocalizationEnabled && menuItemTranslations) {
|
||||
menu = menu.map((menuItem) => {
|
||||
if (menuItem.phrase && menuItemTranslations[menuItem.phrase]) {
|
||||
menuItem.label = menuItemTranslations[menuItem.phrase];
|
||||
}
|
||||
return menuItem;
|
||||
});
|
||||
}
|
||||
|
||||
super.loadMenu(e, component, menu, parentEl, parentPopup);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
import ResponsiveLayout from "../../../../vendor/olifolkerd/tabulator5/src/js/modules/ResponsiveLayout/ResponsiveLayout.js";
|
||||
|
||||
export default class ResponsiveLayoutExtensionModule extends ResponsiveLayout {
|
||||
static moduleName = "responsiveLayout";
|
||||
static moduleInitNumber = 1;
|
||||
|
||||
constructor(table) {
|
||||
super(table);
|
||||
}
|
||||
|
||||
generateCollapsedRowData(row) {
|
||||
let result = super.generateCollapsedRowData(row)
|
||||
const isLocalizationEnabled = this.table.options.locale && this.table.options.locale !== "default";
|
||||
const columnHeadingTranslations = this.table?.getLang()?.columns;
|
||||
|
||||
if (isLocalizationEnabled && columnHeadingTranslations) {
|
||||
result = result.map((column) => {
|
||||
if (columnHeadingTranslations[column.field]) {
|
||||
column.title = columnHeadingTranslations[column.field];
|
||||
}
|
||||
return column;
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
// DatesManual.js: implemented custom input handling for tabulator date header filter,
|
||||
// since primevue3 calendar manual input seems to be broken in this case. Main difference
|
||||
// to normal Dates.js headerfilter is that this one does not automatically open the calendar
|
||||
// overlay, as it tries to aggressively steal the focus away from the input field. try it out!
|
||||
|
||||
// Custom evaluation logic so Tabulator knows how to filter the array of Date objects
|
||||
Tabulator.extendModule('filter', 'filters', {
|
||||
"dates": (headerValue, rowValue) => {
|
||||
if (!headerValue) return true;
|
||||
|
||||
let rowDate = new Date(rowValue);
|
||||
|
||||
if (Array.isArray(headerValue)) {
|
||||
let startDate = new Date(headerValue[0]);
|
||||
if (headerValue[1]) {
|
||||
let endDate = new Date(headerValue[1]);
|
||||
endDate.setHours(23, 59, 59, 999);
|
||||
return rowDate >= startDate && rowDate <= endDate;
|
||||
}
|
||||
return rowDate.toDateString() === startDate.toDateString();
|
||||
}
|
||||
let singleDate = new Date(headerValue);
|
||||
return rowDate.toDateString() === singleDate.toDateString();
|
||||
}
|
||||
});
|
||||
|
||||
export function dateFilter(cell, onRendered, success) {
|
||||
let div = document.createElement('div');
|
||||
|
||||
let initialValue = null;
|
||||
let val = cell.getValue();
|
||||
if (Array.isArray(val)) {
|
||||
const start = val[0] ? new Date(val[0]) : null;
|
||||
const end = val[1] ? new Date(val[1]) : null;
|
||||
initialValue = [start, end];
|
||||
}
|
||||
|
||||
// Manual parser needed since we are bypassing PrimeVue's broken manualInput mode
|
||||
function parseDMY(str) {
|
||||
const m = str.trim().match(/^(\d{1,2})\.(\d{1,2})\.(\d{2,4})$/);
|
||||
if (!m) return null;
|
||||
let year = parseInt(m[3]);
|
||||
if (year < 100) year += 2000;
|
||||
const d = new Date(year, parseInt(m[2]) - 1, parseInt(m[1]));
|
||||
return isNaN(d.getTime()) ? null : d;
|
||||
}
|
||||
|
||||
// String formatter to sync the raw text field when dates are picked via the calendar UI
|
||||
function formatRange(dates) {
|
||||
if (!dates) return '';
|
||||
const fmt = d => d
|
||||
? `${String(d.getDate()).padStart(2,'0')}.${String(d.getMonth()+1).padStart(2,'0')}.${d.getFullYear()}`
|
||||
: '';
|
||||
if (Array.isArray(dates)) {
|
||||
return fmt(dates[0]) + (dates[1] ? ` - ${fmt(dates[1])}` : '');
|
||||
}
|
||||
return fmt(dates);
|
||||
}
|
||||
|
||||
Vue.createApp({
|
||||
components: { PrimevueCalendar: primevue.calendar },
|
||||
data() {
|
||||
return {
|
||||
// Split state into a proper Date object (calendar) and a raw string (text input)
|
||||
calVal: initialValue,
|
||||
textVal: formatRange(initialValue)
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
calVal(n) {
|
||||
// Centralized synchronization: updates text representation
|
||||
// AND safely notifies Tabulator of the value change
|
||||
this.textVal = formatRange(n);
|
||||
success(n);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// Translates the typed string back into Date objects for Tabulator's filter
|
||||
onTextChange() {
|
||||
if (!this.textVal) {
|
||||
this.calVal = null; // Triggers watcher -> success(null)
|
||||
return;
|
||||
}
|
||||
const parts = this.textVal.split(/\s*-\s*/);
|
||||
const start = parseDMY(parts[0]);
|
||||
const end = parts[1] ? parseDMY(parts[1]) : null;
|
||||
|
||||
if (start) {
|
||||
// Changing calVal automatically triggers the watcher,
|
||||
// which handles executing success() exactly once.
|
||||
this.calVal = [start, end];
|
||||
}
|
||||
}
|
||||
},
|
||||
// Native HTML input handles typing, PrimeVue calendar input is hidden (icon-only)
|
||||
// Placeholder removed to match the rest of the application's header filters
|
||||
template: `
|
||||
<div style="display:flex;align-items:center;width:100%">
|
||||
<input
|
||||
type="text"
|
||||
v-model="textVal"
|
||||
@change="onTextChange"
|
||||
@keydown.stop
|
||||
@keypress.stop
|
||||
@keyup.stop
|
||||
@mousedown.stop
|
||||
class="p-inputtext p-component"
|
||||
style="flex:1;min-width:0"
|
||||
/>
|
||||
<primevue-calendar
|
||||
v-model="calVal"
|
||||
selection-mode="range"
|
||||
show-button-bar
|
||||
:showIcon="true"
|
||||
:input-style="{display:'none'}"
|
||||
dateFormat="dd.mm.yy">
|
||||
</primevue-calendar>
|
||||
</div>`
|
||||
}).use(primevue.config.default).mount(div);
|
||||
|
||||
return div;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user