From ca667feb0dc76276c0f3025a368366a2155332f5 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Mon, 20 Jun 2022 18:55:29 +0200 Subject: [PATCH 01/21] Added document type "Grant Agreement" for syncing of documents with Mobility Online --- system/dbupdate_3.3.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 7965a0518..cfa0ca8b0 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -6244,6 +6244,20 @@ if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berecht } } +// Insert document type Grant Agreement +if($result = @$db->db_query("SELECT 1 FROM public.tbl_dokument WHERE dokument_kurzbz = 'GrantAgr';")) +{ + if($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO public.tbl_dokument(dokument_kurzbz, bezeichnung, bezeichnung_mehrsprachig) VALUES('GrantAgr', 'Grant Agreement', '{\"Grant Agreement\",\"Grant Agreement\"}');"; + + if(!$db->db_query($qry)) + echo 'public.tbl_dokument '.$db->db_last_error().'
'; + else + echo 'public.tbl_dokument: Added value \'GrantAgr\'
'; + } +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; From 500bbec2c159af10e273ef9ac2f50aaff04345a3 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Tue, 28 Jun 2022 19:07:09 +0200 Subject: [PATCH 02/21] added "hasSequence" = false to crm/Dokumentprestudent_model to avoid "lastval not found" error --- application/models/crm/Dokumentprestudent_model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/models/crm/Dokumentprestudent_model.php b/application/models/crm/Dokumentprestudent_model.php index ab4764479..0a6669359 100644 --- a/application/models/crm/Dokumentprestudent_model.php +++ b/application/models/crm/Dokumentprestudent_model.php @@ -10,6 +10,7 @@ class Dokumentprestudent_model extends DB_Model parent::__construct(); $this->dbTable = 'public.tbl_dokumentprestudent'; $this->pk = array('prestudent_id', 'dokument_kurzbz'); + $this->hasSequence = false; } /** From 0055243a64a19b548c8b09196fdb81b6514eb2b6 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 27 Jul 2022 01:52:08 +0200 Subject: [PATCH 03/21] DmsLib: replaced _writeFile function with _copyFile to copy all file in one go (php copy method) instead of reading blocks and writing them --- application/libraries/DmsLib.php | 287 +++++++++++++------------------ 1 file changed, 118 insertions(+), 169 deletions(-) diff --git a/application/libraries/DmsLib.php b/application/libraries/DmsLib.php index b2c53a7d9..fccfe503b 100644 --- a/application/libraries/DmsLib.php +++ b/application/libraries/DmsLib.php @@ -50,62 +50,57 @@ class DmsLib $kategorie_kurzbz = null, $dokument_kurzbz = null, $beschreibung = null, $cis_suche = false, $schlagworte = null ) { - // write file with content of fileHandle - $writeFileResult = $this->_writeNewFile($name, $fileHandle); + // create unique filename, using original document name to detect file extension + $filename = $this->_getUniqueFilename($name); - if (isError($writeFileResult)) return $writeFileResult; + // copy file from fileHandle to dms folder + $copyFileResult = $this->_copyFile($fileHandle, $filename); - if (hasData($writeFileResult)) + if (isError($copyFileResult)) return $copyFileResult; + + // if file written successful, insert dms + $dmsResult = $this->_ci->DmsModel->insert( + array( + 'kategorie_kurzbz' => $kategorie_kurzbz, + 'dokument_kurzbz' => $dokument_kurzbz + ) + ); + + if (isError($dmsResult)) return $dmsResult; + + if (hasData($dmsResult)) { - $writeFileData = getData($writeFileResult); - $filename = $writeFileData->filename; + $dms_id = getData($dmsResult); + $version = 0; - // if file written successful, insert dms - $dmsResult = $this->_ci->DmsModel->insert( - array( - 'kategorie_kurzbz' => $kategorie_kurzbz, - 'dokument_kurzbz' => $dokument_kurzbz - ) + // insert dms version + $dmsVersion = array( + 'dms_id' => $dms_id, + 'version' => $version, + 'filename' => $filename, + 'mimetype' => $mimetype, + 'name' => $name, + 'beschreibung' => $beschreibung, + 'cis_suche' => $cis_suche, + 'schlagworte' => $schlagworte, + 'insertvon' => $this->_who, + 'insertamum' => date('Y-m-d H:i:s') ); - if (isError($dmsResult)) return $dmsResult; + $dmsVersionResult = $this->_ci->DmsVersionModel->insert($dmsVersion); - if (hasData($dmsResult)) - { - $dms_id = getData($dmsResult); - $version = 0; + if (isError($dmsVersionResult)) return $dmsVersionResult; - // insert dms version - $dmsVersion = array( - 'dms_id' => $dms_id, - 'version' => $version, - 'filename' => $filename, - 'mimetype' => $mimetype, - 'name' => $name, - 'beschreibung' => $beschreibung, - 'cis_suche' => $cis_suche, - 'schlagworte' => $schlagworte, - 'insertvon' => $this->_who, - 'insertamum' => date('Y-m-d H:i:s') - ); + // return dms info + $resObj = new stdClass(); + $resObj->dms_id = $dms_id; + $resObj->version = $version; + $resObj->filename = $filename; - $dmsVersionResult = $this->_ci->DmsVersionModel->insert($dmsVersion); - - if (isError($dmsVersionResult)) return $dmsVersionResult; - - // return dms info - $resObj = new stdClass(); - $resObj->dms_id = $dms_id; - $resObj->version = $version; - $resObj->filename = $filename; - - return success($resObj); - } - else - return error("error when inserting DMS"); + return success($resObj); } else - return error("file could not be written"); + return error("error when inserting DMS"); } /** @@ -125,46 +120,41 @@ class DmsLib $originalName = isset($name) ? $name : $lastVersion->name; - // write new file with content of fileHandle - $writeFileResult = $this->_writeNewFile($originalName, $fileHandle); + // create unique filename, using original document name to detect file extension + $filename = $this->_getUniqueFilename($originalName); - if (isError($writeFileResult)) return $writeFileResult; + // copy file from fileHandle to dms folder + $copyFileResult = $this->_copyFile($fileHandle, $filename); - if (hasData($writeFileResult)) - { - $writeFileData = getData($writeFileResult); - $filename = $writeFileData->filename; + if (isError($copyFileResult)) return $copyFileResult; - // insert new version - $newVersionNumber = $lastVersion->version + 1; + // insert new version + $newVersionNumber = $lastVersion->version + 1; - // if new parameters given, use them, otherwise use parameters from last version - $newVersion = array( - 'dms_id' => $dms_id, - 'name' => $originalName, - 'filename' => $filename, - 'version' => $newVersionNumber, - 'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype, - 'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung, - 'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche, - 'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte, - 'insertvon' => $this->_who, - 'insertamum' => date('Y-m-d H:i:s') - ); + // if new parameters given, use them, otherwise use parameters from last version + $newVersion = array( + 'dms_id' => $dms_id, + 'name' => $originalName, + 'filename' => $filename, + 'version' => $newVersionNumber, + 'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype, + 'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung, + 'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche, + 'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte, + 'insertvon' => $this->_who, + 'insertamum' => date('Y-m-d H:i:s') + ); - $addVersionResult = $this->_ci->DmsVersionModel->insert($newVersion); + $addVersionResult = $this->_ci->DmsVersionModel->insert($newVersion); - if (isError($addVersionResult)) return $addVersionResult; + if (isError($addVersionResult)) return $addVersionResult; - // return dms info - $resObj = new stdClass(); - $resObj->version = $newVersionNumber; - $resObj->filename = $filename; + // return dms info + $resObj = new stdClass(); + $resObj->version = $newVersionNumber; + $resObj->filename = $filename; - return success($resObj); - } - else - return error("file could not be written"); + return success($resObj); } else return error("last version not found"); @@ -185,44 +175,37 @@ class DmsLib if (hasData($lastVersionResult)) { $lastVersion = getData($lastVersionResult); + $filename = $lastVersion->filename; // update file in filesystem - $writeFileResult = $this->_writeFile($lastVersion->filename, $fileHandle); + $copyFileResult = $this->_copyFile($fileHandle, $filename); - if (isError($writeFileResult)) return $writeFileResult; + if (isError($copyFileResult)) return $copyFileResult; - if (hasData($writeFileResult)) - { - $writeFileData = getData($writeFileResult); - $filename = $writeFileData->filename; + // if new parameters given, use them, otherwise use parameters from last version + $newVersion = array( + 'name' => isset($name) ? $name : $lastVersion->name, + 'filename' => $filename, + 'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype, + 'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung, + 'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche, + 'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte, + ); - // if new parameters given, use them, otherwise use parameters from last version - $newVersion = array( - 'name' => isset($name) ? $name : $lastVersion->name, - 'filename' => $filename, - 'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype, - 'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung, - 'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche, - 'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte, - ); + // update last dms version + $addVersionResult = $this->_ci->DmsVersionModel->update( + array($dms_id, $lastVersion->version), + $newVersion + ); - // update last dms version - $addVersionResult = $this->_ci->DmsVersionModel->update( - array($dms_id, $lastVersion->version), - $newVersion - ); + if (isError($addVersionResult)) return $addVersionResult; - if (isError($addVersionResult)) return $addVersionResult; + // return dms info + $resObj = new stdClass(); + $resObj->version = $lastVersion->version; + $resObj->filename = $filename; - // return dms info - $resObj = new stdClass(); - $resObj->version = $lastVersion->version; - $resObj->filename = $filename; - - return success($resObj); - } - else - return error("file could not be written"); + return success($resObj); } else return error("last version not found"); @@ -441,68 +424,35 @@ class DmsLib // Private methods /** - * Writes file with content of fileHandle using original document name for file extension + * Copies file from sourceFileHandle to destinationFilename in DMS folder + * Returns success or error on fail */ - private function _writeNewFile($originalName, $fileHandle) + private function _copyFile($sourceFileHandle, $destinationFilename) { - // create unique filename, using original document name to detect file extension - $filename = $this->_getUniqueFilename($originalName); + // get file location from file handle + $metaData = stream_get_meta_data($sourceFileHandle); - // write the file - return $this->_writeFile($filename, $fileHandle); - } - - /** - * Writes file with content of fileHandle - * Returns number of bytes written and filename - */ - private function _writeFile($filename, $fileHandle) - { - // file content provided by fileHandle - $fileContent = ''; - - $readBlockResult = success(); - - // While the end of the file is not reached and the read does not fail - while (!feof($fileHandle) && isSuccess($readBlockResult = $this->_ci->DmsFSModel->readBlock($fileHandle))) + if (isset($metaData['uri']) && !isEmptyString($metaData['uri'])) { - // Concatenate the content of the file - $fileContent .= getData($readBlockResult); + // if file location determined, copy file + $source = $metaData['uri']; + + if (copy($source, DMS_PATH.$destinationFilename)) + { + return success(); + } + else + { + // error if copy returned false + return error('error occured while copying file'); + } } - - // If an error occurred while reading then return it - if (isError($readBlockResult)) return $readBlockResult; - - // open file for writing - $openFileResult = $this->_ci->DmsFSModel->openReadWrite($filename); - - if (isError($openFileResult)) return $openFileResult; - - if (!hasData($openFileResult)) return error("File could not be opened"); - - $newFileHandle = getData($openFileResult); - - // write file - $writeFileResult = $this->_ci->DmsFSModel->write($newFileHandle, $fileContent); - - if (isError($writeFileResult)) return $writeFileResult; - - // return number of bytes written and filename - $resObj = new stdClass(); - $resObj->bytesWritten = 0; - $resObj->filename = ''; - - if (hasData($writeFileResult)) + else { - $resObj->bytesWritten = getData($writeFileResult); - $resObj->filename = $filename; + // error when source location could not be determined + return error('error occured while getting source file name'); } - // close handle - $closeResult = $this->_ci->DmsFSModel->close($newFileHandle, $fileContent); - - if (isError($closeResult)) return $closeResult; - return success($resObj); } @@ -527,7 +477,7 @@ class DmsLib // ----------------------------------------------------------------------------------------------------------- // Deprecated methods, not to be used - + /** * Load a DMS Document. * If no version is particularly given, the latest version is loaded. @@ -543,7 +493,7 @@ class DmsLib $this->_ci->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id'); $this->_ci->DmsModel->addOrder('version', 'DESC'); $this->_ci->DmsModel->addLimit(1); - + if (!is_numeric($version)) { return $this->_ci->DmsModel->load($dms_id); @@ -620,7 +570,7 @@ class DmsLib return $result; } - + /** * Uploads a document and saves it to DMS * @param $dms DMS assoc array @@ -659,7 +609,7 @@ class DmsLib // Return result of uploaded data return success($upload_data); } - + /** * Download a document. * @@ -678,7 +628,7 @@ class DmsLib if (hasData($fileInfoResult)) { $fileObj = getData($fileInfoResult); - + // Change filename, if filename is provided if (!isEmptyString($filename)) $fileObj->name = $filename; @@ -694,7 +644,7 @@ class DmsLib // If no data have been found then return an empty success return success(); } - + /** * Get file information. * @@ -706,7 +656,7 @@ class DmsLib { // Checks the dms_id parameter if (!is_numeric($dms_id)) return error('Wrong parameter'); - + // Load DMS from database $result = $this->load($dms_id, $version); if (isError($result)) return error(getError($result)); @@ -951,4 +901,3 @@ class DmsLib $this->_ci->upload->initialize($config); } } - From f19e13ffd8b1b02cd96c083b6541ff10acdeb46c Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 11 Aug 2022 14:11:59 +0200 Subject: [PATCH 04/21] ermoeglicht das planen, akzeptieren und erstellen der massnahmen --- system/phrasesupdate.php | 652 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 651 insertions(+), 1 deletion(-) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index ca59997fa..f2e20cedf 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -15972,7 +15972,657 @@ array( 'insertvon' => 'system' ) ) - ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'studiensemesterGeplant', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Studiensemester geplant', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Semester planned', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'bestaetigungHochladen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bestätigung hochladen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Upload confirmation', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'massnahmeLoeschen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Maßnahme löschen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Delete measure', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'massnahmen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Maßnahmen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Measures', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'internationalskills', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'International skills', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'International skills', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'massnahmen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Internationalisierungsmaßnahmen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Internationalization measures', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'internationalbeschreibung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Ab dem Studienjahr 2022/23 ist der Erwerb von internationalen und interkulturellen Kompetenzen Teil des Curriculums.
+ Auf der Grundlage der vorliegenden Maßnahmen absolvieren Sie im Laufe ihres Studiums Internationalisierungsaktivitäten, die mit unterschiedlichen ECTS-Punkten hinterlegt sind.
+ In Summe müssen 5 ECTS erworben werden, die im 6. Semester wirksam werden.
+ Das Modul „International skills“ wird mit der Beurteilung „Mit Erfolg teilgenommen“ abgeschlossen.
+ Bitte wählen Sie die für Sie in Frage kommenden Maßnahmen aus und planen Sie das entsprechende Semester.
+ Sobald die 5 ECTS erreicht wurden, überprüft der Studiengang die von Ihnen hochgeladenen Dokumente.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Starting with the study year 2022/23, the acquisition of international and intercultural competencies is part of the curriculum.
+ On the basis of the measures at-hand, you will complete internationalization activities during the course of your studies, which are assigned different ECTS credits.
+ In total, 5 ECTS must be acquired, which become effective in the 6th semester.
+ The module “International skills” is completed with the assessment "Successfully participated".
+ Please select the measures that apply to you and schedule the appropriate semester.
+ Once the 5 ECTS have been achieved, the degree program will review the documents you have uploaded.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'nurBachelor', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nur für Bachelorstudiengänge.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Only for bachelor programmes.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'bezeichnung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bezeichnung Deutsch', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'title german', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'bezeichnungeng', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bezeichnung Englisch', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'title english', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'beschreibung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Beschreibung Deutsch', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'description german', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'beschreibungeng', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Beschreibung Englisch', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'description english', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'massnahmeBearbeiten', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Massnahme bearbeiten', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Edit measure', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'massnahmeLoeschenConfirm', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Wollen Sie die ausgewählte Maßnahme wirklich löschen?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Do you really want to delete the measure?', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'fileLoeschenConfirm', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Wollen Sie die ausgewählte Bestätigung wirklich löschen?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Do you really want to delete the confirmation?', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'planAblehnen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Wollen Sie die ausgewählte Maßnahme wirklich löschen?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Do you really want to delete the measure?', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'entbestaetigenConfirm', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Wollen Sie die Bestätigung wirklich widerrufen?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Do you really want to cancel the confirmation?', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'entakzeptierenConfirm', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Wollen Sie die Planbestätigung wirklich widerrufen?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Do you really want to cancel the plan confirmation?', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'allegeplanten', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Alle geplanten', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'All planned', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'alleMassnahmenJetzt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Alle Maßnahmen anzeigen die im jetzigen Studiensemester geplant sind', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Show all measures that are planned for the current study semester', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'alleStudierendeJetzt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Alle Studierende anzeigen aus dem jetzigen Studiensemester', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Show all students from the current study semester', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'lastSemester', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Alle Studierende anzeigen aus dem letzten Semester', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Show all students from the last semester"', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'meinMassnahmeplan', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Mein Maßnahmenplan', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'My action plan', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'ectsBestaetigt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ECTS bestätigt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'ECTS confirmed', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'ectsMassnahme', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ECTS - Maßnahme', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'ECTS - Measures', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'geplanteMassnahmen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Maßnahmen - geplant', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Measures - planned', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'akzpetierteMassnahmen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Plan - akzeptiert', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Plan - accepted', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'durchgefuehrteMassnahmen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Maßnahmen - durchgeführt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => ' Measures - performed', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'bestaetigteMassnahmen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ECTS - bestätigt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => ' ECTS - confirmed', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'abgelehnteMassnahmen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Plan - abgelehnt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => ' Plan - declined', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'planAkzeptieren', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Plan akzeptieren', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => ' Accept plan', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'international', + 'category' => 'international', + 'phrase' => 'bestaetigungAkzeptieren', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bestätigung akzeptieren', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => ' Accept confirmation', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), ); From 979f8d96bc2de823025f44d3c428e9208ea45ae1 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 11 Aug 2022 14:29:56 +0200 Subject: [PATCH 05/21] ermoeglicht das sperren der zutrittskarten --- application/models/crm/Student_model.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/application/models/crm/Student_model.php b/application/models/crm/Student_model.php index 4d1c84521..4404beb54 100644 --- a/application/models/crm/Student_model.php +++ b/application/models/crm/Student_model.php @@ -66,4 +66,20 @@ class Student_model extends DB_Model return $result->retval[0]->student_uid; } + + public function searchStudent($filter) + { + $this->addSelect('vorname, nachname, gebdatum, person.person_id, student_uid'); + $this->addJoin('public.tbl_prestudent ps', 'prestudent_id'); + $this->addJoin('public.tbl_person person', 'person_id'); + + $result = $this->loadWhere( + "lower(student_uid) like ".$this->db->escape('%'.$filter.'%')." + OR lower(person.nachname) like ".$this->db->escape('%'.$filter.'%')." + OR lower(person.vorname) like ".$this->db->escape('%'.$filter.'%')." + OR lower(person.nachname || ' ' || person.vorname) like ".$this->db->escape('%'.$filter.'%')." + OR lower(person.vorname || ' ' || person.nachname) like ".$this->db->escape('%'.$filter.'%')); + + return $result; + } } From 083c36033834166624051694ac6d2b0222c18478 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Thu, 11 Aug 2022 16:05:15 +0200 Subject: [PATCH 06/21] remove duplicate body tags --- application/views/lehre/anrechnung/approveAnrechnungDetail.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php index 6dff83867..248dd33ca 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -60,7 +60,6 @@ $this->load->view( ); ?> -
@@ -428,6 +427,5 @@ $this->load->view(
- load->view('templates/FHC-Footer'); ?> From 06e62cac119d3d7341db0d4b0b9c2fd8505cdc00 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 22 Aug 2022 14:35:05 +0200 Subject: [PATCH 07/21] phrasen angepasst --- system/phrasesupdate.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index f2e20cedf..4dc18c37f 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -16537,7 +16537,7 @@ array( ), array( 'sprache' => 'English', - 'text' => ' Measures - performed', + 'text' => 'Measures - performed', 'description' => '', 'insertvon' => 'system' ) @@ -16557,7 +16557,7 @@ array( ), array( 'sprache' => 'English', - 'text' => ' ECTS - confirmed', + 'text' => 'ECTS - confirmed', 'description' => '', 'insertvon' => 'system' ) @@ -16577,7 +16577,7 @@ array( ), array( 'sprache' => 'English', - 'text' => ' Plan - declined', + 'text' => 'Plan - declined', 'description' => '', 'insertvon' => 'system' ) @@ -16597,7 +16597,7 @@ array( ), array( 'sprache' => 'English', - 'text' => ' Accept plan', + 'text' => 'Accept plan', 'description' => '', 'insertvon' => 'system' ) @@ -16617,7 +16617,7 @@ array( ), array( 'sprache' => 'English', - 'text' => ' Accept confirmation', + 'text' => 'Accept confirmation', 'description' => '', 'insertvon' => 'system' ) From f2fcdf2cbfa945d9d345039523d19718c050721e Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 22 Aug 2022 14:40:39 +0200 Subject: [PATCH 08/21] app per dbupdate hinzufuegen --- system/dbupdate_3.3.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 6824d350f..2d8f51901 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -5668,6 +5668,19 @@ if($result = $db->db_query("SELECT 1 FROM system.tbl_app WHERE app='dvuh'")) } } +if($result = $db->db_query("SELECT 1 FROM system.tbl_app WHERE app = 'international' ")) +{ + if($db->db_num_rows($result)==0) + { + $qry = "INSERT INTO system.tbl_app(app) VALUES('international');"; + + if(!$db->db_query($qry)) + echo 'App: '.$db->db_last_error().'
'; + else + echo '
Neue App international in system.tbl_app hinzugefügt'; + } +} + // Add table issue_status if(!$result = @$db->db_query("SELECT 1 FROM system.tbl_issue_status LIMIT 1;")) { From c234843bfda228e46a78e0605f510be55bbd74dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Tue, 23 Aug 2022 16:20:19 +0200 Subject: [PATCH 09/21] Satzungsteil Paragrahen korrigiert --- system/phrasesupdate.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index b1f22c473..613dc423f 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -10557,13 +10557,13 @@ Any unusual occurrences 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'eines Zeugnisses (vgl. § 4 Abs. 5 Satzung „Studienrechtliche Bestimmungen / Prüfungsordnung)', + 'text' => 'eines Zeugnisses (vgl. § 4 Abs. 8 Satzung „Studienrechtliche Bestimmungen / Prüfungsordnung)', 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', - 'text' => 'a certificate (see § 4 para. 5, Statute on Studies Act Provisions / Examination Regulations of the UASTW)', + 'text' => 'a certificate (see § 4 para. 8, Statute on Studies Act Provisions / Examination Regulations of the UASTW)', 'description' => '', 'insertvon' => 'system' ) @@ -10577,13 +10577,13 @@ Any unusual occurrences 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'eines Hochschulzeugnisses (vgl. § 4 Abs. 5 Satzung „Studienrechtliche Bestimmungen / Prüfungsordnung)', + 'text' => 'eines Hochschulzeugnisses (vgl. § 4 Abs. 8 Satzung „Studienrechtliche Bestimmungen / Prüfungsordnung)', 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', - 'text' => 'a university certificate (see § 4 para. 5, Statute on Studies Act Provisions / Examination Regulations of the UASTW)', + 'text' => 'a university certificate (see § 4 para. 8, Statute on Studies Act Provisions / Examination Regulations of the UASTW)', 'description' => '', 'insertvon' => 'system' ) @@ -10597,13 +10597,13 @@ Any unusual occurrences 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'der nachgewiesenen beruflichen Praxis ((vgl. § 4 Abs. 6 Satzung „Studienrechtliche Bestimmungen / Prüfungsordnung)', + 'text' => 'der nachgewiesenen beruflichen Praxis (vgl. § 4 Abs. 9 Satzung „Studienrechtliche Bestimmungen / Prüfungsordnung)', 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', - 'text' => 'professional practice (see § 4 para. 6, Statute on Studies Act Provisions / Examination Regulations of the UASTW)', + 'text' => 'professional practice (see § 4 para. 9, Statute on Studies Act Provisions / Examination Regulations of the UASTW)', 'description' => '', 'insertvon' => 'system' ) From a13c010cd5e5b33884e8a1da2e5a340872b6bab4 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 25 Aug 2022 10:43:26 +0200 Subject: [PATCH 10/21] textaenderungen und getzutrittskarte by uid --- .../ressource/Betriebsmittelperson_model.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/application/models/ressource/Betriebsmittelperson_model.php b/application/models/ressource/Betriebsmittelperson_model.php index 7d9689753..04878a9ad 100644 --- a/application/models/ressource/Betriebsmittelperson_model.php +++ b/application/models/ressource/Betriebsmittelperson_model.php @@ -72,4 +72,28 @@ class Betriebsmittelperson_model extends DB_Model return $this->loadWhere($where); } + + public function getBetriebsmittelByUid($uid, $betriebsmitteltyp = null, $isRetourniert = false) + { + $this->addJoin('wawi.tbl_betriebsmittel', 'betriebsmittel_id'); + + $condition = ' wawi.tbl_betriebsmittelperson.uid = '. $this->escape($uid); + + if (is_string($betriebsmitteltyp)) + { + $condition .= ' AND betriebsmitteltyp = ' . $this->escape($betriebsmitteltyp); + } + + if ($isRetourniert === true) { + $condition .= ' AND retouram IS NOT NULL'; + } + elseif ($isRetourniert === false) + { + $condition .= ' AND retouram IS NULL'; + } + + $this->addOrder('ausgegebenam', 'DESC'); + + return $this->loadWhere($condition); + } } From da85c69f36cdc497eb868f13dcfe09fbf79035dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 25 Aug 2022 14:34:40 +0200 Subject: [PATCH 11/21] Problem behoben wodurch die Anrechnungen im FAS nicht angezeigt werden wenn diese ohne Anrechnungstool im FAS erfasst werden --- rdf/anrechnung.rdf.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rdf/anrechnung.rdf.php b/rdf/anrechnung.rdf.php index 14fc1fd1a..8b4858679 100644 --- a/rdf/anrechnung.rdf.php +++ b/rdf/anrechnung.rdf.php @@ -32,8 +32,10 @@ if(is_numeric($anrechnung_id)) // Add last Anrechnungstatus $anrechnungstatus = new Anrechnung(); $anrechnungstatus->getLastAnrechnungstatus($anrechnung_id); - - $anrechnung->result[0]->status = $anrechnungstatus->result[0]->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE]; + if(isset($anrechnungstatus->result[0])) + $anrechnung->result[0]->status = $anrechnungstatus->result[0]->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE]; + else + $anrechnung->result[0]->status = ''; } elseif(is_numeric($prestudent_id)) { @@ -46,7 +48,10 @@ elseif(is_numeric($prestudent_id)) { $anrechnungstatus = new Anrechnung(); $status = $anrechnungstatus->getLastAnrechnungstatus($row->anrechnung_id); - $row->status = $anrechnungstatus->result[0]->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE]; + if(isset($anrechnungstatus->result[0])) + $row->status = $anrechnungstatus->result[0]->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE]; + else + $row->status = ''; } } } From ca9281dbf9a1385ead7978008c2d838ed62fb094 Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Mon, 29 Aug 2022 09:08:27 +0200 Subject: [PATCH 12/21] =?UTF-8?q?Text=C3=A4nderung=20KVP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/phrasesupdate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index ca59997fa..364dcb4c4 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -15041,13 +15041,13 @@ array( 'phrases' => array( array( 'sprache' => 'German', - 'text' => "Im Rahmen des KVP (Kontinuierlicher Verbesserungsprozess) können Sie hier wichtige Fehler und/oder Verbesserungen einmelden. Diese können sich auf technische, inhaltliche, medien-didaktische oder test- und prüfungsrelevante Aspekte beziehen. Eine mögliche Umsetzung Ihrer Einmeldungen für das folgende Studienjahr wird im KVP geprüft und priorisiert, und ggf. im Anschluss vom Teamlead im Quellkurs entsprechend eingearbeitet.", + 'text' => "Im Rahmen der Weiterentwicklung von Lehrveranstaltungen können Sie hier wichtige Ideen für die Weiterentwicklung und/oder Verbesserungen einmelden. Diese können sich auf technische, inhaltliche, medien-didaktische oder test- und prüfungsrelevante Aspekte beziehen. Eine mögliche Umsetzung Ihrer Einmeldungen für das folgende Studienjahr wird im KVP geprüft und priorisiert, und ggf. im Anschluss vom Teamlead im Quellkurs entsprechend eingearbeitet.", 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', - 'text' => "Im Rahmen des KVP (Kontinuierlicher Verbesserungsprozess) können Sie hier wichtige Fehler und/oder Verbesserungen einmelden. Diese können sich auf technische, inhaltliche, medien-didaktische oder test- und prüfungsrelevante Aspekte beziehen. Eine mögliche Umsetzung Ihrer Einmeldungen für das folgende Studienjahr wird im KVP geprüft und priorisiert, und ggf. im Anschluss vom Teamlead im Quellkurs entsprechend eingearbeitet.", + 'text' => "Im Rahmen der Weiterentwicklung von Lehrveranstaltungen können Sie hier wichtige Ideen für die Weiterentwicklung und/oder Verbesserungen einmelden. Diese können sich auf technische, inhaltliche, medien-didaktische oder test- und prüfungsrelevante Aspekte beziehen. Eine mögliche Umsetzung Ihrer Einmeldungen für das folgende Studienjahr wird im KVP geprüft und priorisiert, und ggf. im Anschluss vom Teamlead im Quellkurs entsprechend eingearbeitet.", 'description' => '', 'insertvon' => 'system' ) From 49647c8ded6ec522121cc6409ef05aaa2f5add85 Mon Sep 17 00:00:00 2001 From: cgfhtw <100686654+cgfhtw@users.noreply.github.com> Date: Mon, 29 Aug 2022 14:05:15 +0200 Subject: [PATCH 13/21] =?UTF-8?q?Text=C3=A4nderungen=20"KVP"=20entfernen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/phrasesupdate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 364dcb4c4..ecf99a5a3 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -15041,13 +15041,13 @@ array( 'phrases' => array( array( 'sprache' => 'German', - 'text' => "Im Rahmen der Weiterentwicklung von Lehrveranstaltungen können Sie hier wichtige Ideen für die Weiterentwicklung und/oder Verbesserungen einmelden. Diese können sich auf technische, inhaltliche, medien-didaktische oder test- und prüfungsrelevante Aspekte beziehen. Eine mögliche Umsetzung Ihrer Einmeldungen für das folgende Studienjahr wird im KVP geprüft und priorisiert, und ggf. im Anschluss vom Teamlead im Quellkurs entsprechend eingearbeitet.", + 'text' => "Im Rahmen der Weiterentwicklung von Lehrveranstaltungen können Sie hier wichtige Ideen für die Weiterentwicklung und/oder Verbesserungen einmelden. Diese können sich auf technische, inhaltliche, medien-didaktische oder test- und prüfungsrelevante Aspekte beziehen. Eine mögliche Umsetzung Ihrer Einmeldungen für das folgende Studienjahr wird im Weiteren Ablauf geprüft und priorisiert, und ggf. im Anschluss vom Teamlead im Quellkurs entsprechend eingearbeitet.", 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', - 'text' => "Im Rahmen der Weiterentwicklung von Lehrveranstaltungen können Sie hier wichtige Ideen für die Weiterentwicklung und/oder Verbesserungen einmelden. Diese können sich auf technische, inhaltliche, medien-didaktische oder test- und prüfungsrelevante Aspekte beziehen. Eine mögliche Umsetzung Ihrer Einmeldungen für das folgende Studienjahr wird im KVP geprüft und priorisiert, und ggf. im Anschluss vom Teamlead im Quellkurs entsprechend eingearbeitet.", + 'text' => "Im Rahmen der Weiterentwicklung von Lehrveranstaltungen können Sie hier wichtige Ideen für die Weiterentwicklung und/oder Verbesserungen einmelden. Diese können sich auf technische, inhaltliche, medien-didaktische oder test- und prüfungsrelevante Aspekte beziehen. Eine mögliche Umsetzung Ihrer Einmeldungen für das folgende Studienjahr wird im Weiteren Ablauf geprüft und priorisiert, und ggf. im Anschluss vom Teamlead im Quellkurs entsprechend eingearbeitet.", 'description' => '', 'insertvon' => 'system' ) From 03535b75895e66d9a9d3710b8c2b55f9be28c23f Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 30 Aug 2022 14:08:00 +0200 Subject: [PATCH 14/21] text aenderung und holen alle studienbeitraege --- application/models/crm/Konto_model.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/application/models/crm/Konto_model.php b/application/models/crm/Konto_model.php index 32fdd97c9..4b2a259c9 100644 --- a/application/models/crm/Konto_model.php +++ b/application/models/crm/Konto_model.php @@ -74,10 +74,11 @@ class Konto_model extends DB_Model } } - public function getLastStudienbeitrag($uid, $buchungstypen) + public function getStudienbeitraege($uid, $buchungstypen) { $query = 'SELECT konto.studiensemester_kurzbz - FROM public.tbl_konto konto, + FROM public.tbl_konto konto + JOIN public.tbl_studiensemester studiensemester ON konto.studiensemester_kurzbz = studiensemester.studiensemester_kurzbz, public.tbl_benutzer, public.tbl_student WHERE tbl_benutzer.uid = \'' . $uid . '\' @@ -91,7 +92,7 @@ class Konto_model extends DB_Model WHERE skonto.buchungsnr = konto.buchungsnr_verweis OR skonto.buchungsnr_verweis = konto.buchungsnr_verweis ) - ORDER BY buchungsnr DESC LIMIT 1; + ORDER BY studiensemester.start DESC; '; return $this->execQuery($query); From 90a13e445c370f985886077850e5e2bf06c3f30d Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 31 Aug 2022 11:33:29 +0200 Subject: [PATCH 15/21] fix damit messages wieder geschickt werden --- public/js/infocenter/infocenterDetails.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 7a8849f71..c7d4d326b 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -543,8 +543,8 @@ var InfocenterDetails = { var prestudentdata = prestudentresponse.retval; - var prestudent_id = freigabedata.prestudent_id; - var statusgrund_id = freigabedata.statusgrund_id; + var prestudent_id = parseInt(freigabedata.prestudent_id); + var statusgrund_id = parseInt(freigabedata.statusgrund_id); var rtfreigabe = !$.isNumeric(statusgrund_id);//no Statusgrund - RT Freigabe var rtFreigegeben = false; From 74331d5e6c4cb4518028ed507ce96bce6480e007 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 31 Aug 2022 11:56:19 +0200 Subject: [PATCH 16/21] dms kategoerie hinzugefuegt --- system/dbupdate_3.3.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 2d8f51901..4d274b0fc 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -5681,6 +5681,33 @@ if($result = $db->db_query("SELECT 1 FROM system.tbl_app WHERE app = 'internatio } } + +// Add DMS category "international_nachweis" +if ($result = @$db->db_query("SELECT 1 FROM campus.tbl_dms_kategorie WHERE kategorie_kurzbz = 'international_nachweis';")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO campus.tbl_dms_kategorie ( + kategorie_kurzbz, + bezeichnung, + beschreibung, + parent_kategorie_kurzbz, + oe_kurzbz, + berechtigung_kurzbz + ) VALUES( + 'international_nachweis', + 'International Nachweis', + 'Nachweis der Internationalisierungsmaßnahmen', + 'fas', + 'etw', + NULL + );"; + if (!$db->db_query($qry)) + echo 'campus.tbl_dms_kategorie '.$db->db_last_error().'
'; + else + echo ' campus.tbl_dms_kategorie: Added category "international_nachweis"!
'; + } +} // Add table issue_status if(!$result = @$db->db_query("SELECT 1 FROM system.tbl_issue_status LIMIT 1;")) { From 259dbe9bdc5f9526ab7dbd08b73fa1752a0b2b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 5 Sep 2022 18:46:13 +0200 Subject: [PATCH 17/21] Fixed Error on File Download from Student View --- .../lehre/anrechnung/RequestAnrechnung.php | 105 +++++++++--------- 1 file changed, 54 insertions(+), 51 deletions(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index bc8ab562e..2e9726c82 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -6,13 +6,13 @@ class requestAnrechnung extends Auth_Controller { const REQUEST_ANRECHNUNG_URI = '/lehre/anrechnung/RequestAnrechnung'; const APPROVE_ANRECHNUNG_URI = '/lehre/anrechnung/ApproveAnrechnungUebersicht'; - + const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; const ANRECHNUNGSTATUS_APPROVED = 'approved'; const ANRECHNUNGSTATUS_REJECTED = 'rejected'; - + public function __construct() { // Set required permissions @@ -23,25 +23,25 @@ class requestAnrechnung extends Auth_Controller 'download' => 'student/anrechnung_beantragen:rw', ) ); - + // Load models $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); $this->load->model('content/DmsVersion_model', 'DmsVersionModel'); - + // Load libraries $this->load->library('WidgetLib'); $this->load->library('PermissionLib'); $this->load->library('AnrechnungLib'); $this->load->library('DmsLib'); - + // Load helpers $this->load->helper('form'); $this->load->helper('url'); $this->load->helper('hlp_sancho_helper'); - + // Load configs $this->load->config('anrechnung'); - + // Load language phrases $this->loadPhrases( array( @@ -52,59 +52,59 @@ class requestAnrechnung extends Auth_Controller 'lehre' ) ); - + $this->_setAuthUID(); - + $this->setControllerId(); } - + public function index() { $studiensemester_kurzbz = $this->input->get('studiensemester'); $lehrveranstaltung_id = $this->input->get('lv_id'); - + if (isEmptyString($lehrveranstaltung_id) || isEmptyString($studiensemester_kurzbz)) { show_error('Missing correct parameter'); } - + // Exit if user is not a student $result = $this->StudentModel->load(array('student_uid' => $this->_uid)); - + if (!hasData($result)) { show_error('Cant load user'); } - + // Get Prestudent ID $prestudent_id = getData($result)[0]->prestudent_id; - + // Check if application deadline is expired $is_expired = self::_isExpired( $this->config->item('submit_application_start'), $this->config->item('submit_application_end'), $studiensemester_kurzbz ); - + // Check if Lehrveranstaltung was already graded with application blocking grades $is_blocked = self::_LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id); - + // Get Anrechung data $anrechnungData = $this->anrechnunglib->getAnrechnungDataByLv($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id); // Get Antrag data $antragData = $this->anrechnunglib->getAntragData($prestudent_id, $studiensemester_kurzbz, $lehrveranstaltung_id); - + $viewData = array( 'antragData' => $antragData, 'anrechnungData' => $anrechnungData, 'is_expired' => $is_expired, 'is_blocked' => $is_blocked ); - + $this->load->view('lehre/anrechnung/requestAnrechnung.php', $viewData); } - + /** * Apply Anrechnungsantrag and send to STGL */ @@ -129,35 +129,35 @@ class requestAnrechnung extends Auth_Controller { return $this->outputJsonError($this->p->t('ui', 'errorFelderFehlen')); } - + if (isEmptyString($bestaetigung)) { return $this->outputJsonError($this->p->t('ui', 'errorBestaetigungFehlt')); } - + // Exit if user is not a student $result = $this->StudentModel->load(array('student_uid' => $this->_uid)); - + if (!hasData($result)) { return $this->outputJsonError('Cant load user'); } - + // Get Prestudent ID $prestudent_id = getData($result)[0]->prestudent_id; - + // Exit if application already exists if (self::_applicationExists($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id)) { return $this->outputJsonError($this->p->t('anrechnung', 'antragBereitsGestellt')); } - + // Exit if application is not for actual studysemester if (!self::_applicationIsForActualSS($studiensemester_kurzbz)) { return $this->outputJsonError($this->p->t('anrechnung', 'antragNurImAktSS')); } - + // Upload document $result = self::_uploadFile(); @@ -165,10 +165,10 @@ class requestAnrechnung extends Auth_Controller { return $this->outputJsonError($result->retval); } - + // Hold just inserted DMS ID $lastInsert_dms_id = $result->retval['dms_id']; - + // Save Anrechnung and Anrechnungstatus $result = $this->AnrechnungModel->createAnrechnungsantrag( $prestudent_id, @@ -178,12 +178,12 @@ class requestAnrechnung extends Auth_Controller $lastInsert_dms_id, $anmerkung ); - + if (isError($result)) { $this->terminateWithJsonError(getError($result)); } - + // Output to AJAX $this->outputJsonSuccess(array( 'antragdatum' => (new DateTime())->format('d.m.Y'), @@ -206,6 +206,9 @@ class requestAnrechnung extends Auth_Controller // Check if user is entitled to read dms doc $this->_checkIfEntitledToReadDMSDoc($dms_id); + + // Set filename to be used on downlaod + $filename = $this->anrechnunglib->setFilenameOnDownload($dms_id); // Get file to be downloaded from DMS $download = $this->dmslib->download($dms_id, $filename); @@ -221,10 +224,10 @@ class requestAnrechnung extends Auth_Controller private function _setAuthUID() { $this->_uid = getAuthUID(); - + if (!$this->_uid) show_error('User authentification failed'); } - + /** * Check if application deadline is expired. * @@ -237,7 +240,7 @@ class requestAnrechnung extends Auth_Controller private function _isExpired($start, $ende, $studiensemester_kurzbz) { $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); - + // If start is not given, set to Semesterstart. if (!isset($start) || isEmptyString($start)) { @@ -245,7 +248,7 @@ class requestAnrechnung extends Auth_Controller $result = $this->StudiensemesterModel->load($studiensemester_kurzbz); $start = getData($result)[0]->start; } - + // If ende is not given, set to Semesterende. if (!isset($ende) || isEmptyString($ende)) { @@ -253,15 +256,15 @@ class requestAnrechnung extends Auth_Controller $result = $this->StudiensemesterModel->load($studiensemester_kurzbz); $ende = getData($result)[0]->ende; } - + $today = new DateTime('today midnight'); $start = new DateTime($start); $ende = new DateTime($ende); - + // True if expired return ($today < $start || $today > $ende); } - + /** * Check if user is entitled to read dms doc. * @@ -273,9 +276,9 @@ class requestAnrechnung extends Auth_Controller { show_error('Failed loading Student'); } - + $result = $this->AnrechnungModel->loadWhere(array('dms_id' => $dms_id)); - + if($result = getData($result)[0]) { if ($result->prestudent_id == $student->prestudent_id) @@ -283,10 +286,10 @@ class requestAnrechnung extends Auth_Controller return; } } - + show_error('You are not entitled to read this document'); } - + /** * Check if application already exists. * @@ -302,15 +305,15 @@ class requestAnrechnung extends Auth_Controller 'studiensemester_kurzbz' => $studiensemester_kurzbz, 'prestudent_id' => $prestudent_id )); - + if (isError($result)) { show_error(getError($result)); } - + return hasData($result); } - + /** * Check if applications' study semester is actual study semester. * @@ -322,10 +325,10 @@ class requestAnrechnung extends Auth_Controller $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); $result = $this->StudiensemesterModel->getNearest(); $actual_ss = getData($result)[0]->studiensemester_kurzbz; - + return $studiensemester_kurzbz == $actual_ss; } - + private function _LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id) { // Get Note of Lehrveranstaltung @@ -336,12 +339,12 @@ class requestAnrechnung extends Auth_Controller 'lehrveranstaltung_id' => $lehrveranstaltung_id ) ); - + // If Lehrveranstaltung has Note if (hasData($result)) { $note = getData($result)[0]->note; - + // Check if Note is a blocking grade if (in_array($note, $this->config->item('grades_blocking_application'))) { @@ -350,7 +353,7 @@ class requestAnrechnung extends Auth_Controller } return false; } - + /** * Upload file via DMS library. * @@ -367,7 +370,7 @@ class requestAnrechnung extends Auth_Controller 'insertamum' => (new DateTime())->format('Y-m-d H:i:s'), 'insertvon' => $this->_uid ); - + // Upload document return $this->dmslib->upload($dms, 'uploadfile', array('pdf')); } From c88061463f3a3eb38faf918821ec8b9f931d2eca Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 6 Sep 2022 14:21:54 +0200 Subject: [PATCH 18/21] =?UTF-8?q?Hotfix=20Anrechnung=20Student=20View:=20?= =?UTF-8?q?=C3=84nderung=20des=20Download-Dokumentnamens=20zur=C3=BCckgeno?= =?UTF-8?q?mmen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Der Download-Dokumentname ist in der Studierendenansicht nun wieder gleich wie der originale Dokuementname beim Hochladen. --- .../lehre/anrechnung/RequestAnrechnung.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index 2e9726c82..964dae246 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -206,16 +206,13 @@ class requestAnrechnung extends Auth_Controller // Check if user is entitled to read dms doc $this->_checkIfEntitledToReadDMSDoc($dms_id); - - // Set filename to be used on downlaod - $filename = $this->anrechnunglib->setFilenameOnDownload($dms_id); // Get file to be downloaded from DMS - $download = $this->dmslib->download($dms_id, $filename); - if (isError($download)) return $download; + $download = $this->dmslib->download($dms_id); + if (isError($download)) return $download; - // Download file - $this->outputFile(getData($download)); + // Download file + $this->outputFile(getData($download)); } /** From 522e341d3dcb32d7916178a22f598c950f5d039d Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 6 Sep 2022 15:29:42 +0200 Subject: [PATCH 19/21] Dashboard Test V1 --- application/controllers/Test.php | 51 +++++ .../api/v1/dashboard/Dashboard.php | 54 +++++ .../controllers/api/v1/dashboard/User.php | 89 ++++++++ .../models/dashboard/Dashboard_model.php | 18 ++ .../dashboard/Dashboardpreset_model.php | 28 +++ .../dashboard/Dashboardwidget_model.php | 29 +++ application/models/dashboard/Widget_model.php | 18 ++ application/views/test/Test.php | 63 ++++++ public/js/apps/Test.js | 15 ++ public/js/components/CoreDashboard.js | 206 ++++++++++++++++++ public/js/components/DBW/KPI.js | 26 +++ public/js/components/Dashboard/DragAndDrop.js | 139 ++++++++++++ public/js/components/Dashboard/Item.js | 52 +++++ 13 files changed, 788 insertions(+) create mode 100644 application/controllers/Test.php create mode 100644 application/controllers/api/v1/dashboard/Dashboard.php create mode 100644 application/controllers/api/v1/dashboard/User.php create mode 100644 application/models/dashboard/Dashboard_model.php create mode 100644 application/models/dashboard/Dashboardpreset_model.php create mode 100644 application/models/dashboard/Dashboardwidget_model.php create mode 100644 application/models/dashboard/Widget_model.php create mode 100644 application/views/test/Test.php create mode 100644 public/js/apps/Test.js create mode 100644 public/js/components/CoreDashboard.js create mode 100644 public/js/components/DBW/KPI.js create mode 100644 public/js/components/Dashboard/DragAndDrop.js create mode 100644 public/js/components/Dashboard/Item.js diff --git a/application/controllers/Test.php b/application/controllers/Test.php new file mode 100644 index 000000000..aa21f6296 --- /dev/null +++ b/application/controllers/Test.php @@ -0,0 +1,51 @@ + 'user:r', + ) + ); + + $this->load->library('AuthLib'); + $this->load->library('WidgetLib'); + + $this->_setAuthUID(); // sets property uid + + $this->setControllerId(); // sets the controller id + } + + // ----------------------------------------------------------------------------------------------------------------- + // Public methods + public function index() + { + $this->load->view('test/Test.php', []); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Private methods + + /** + * Retrieve the UID of the logged user and checks if it is valid + */ + private function _setAuthUID() + { + $this->_uid = getAuthUID(); + + if (!$this->_uid) show_error('User authentification failed'); + } + +} diff --git a/application/controllers/api/v1/dashboard/Dashboard.php b/application/controllers/api/v1/dashboard/Dashboard.php new file mode 100644 index 000000000..28365525b --- /dev/null +++ b/application/controllers/api/v1/dashboard/Dashboard.php @@ -0,0 +1,54 @@ + 'user:r' + ]); + } + + /** + * @return void + */ + public function getWidgets() + { + $this->load->model('dashboard/Dashboard_model', 'DashboardModel'); + $result = $this->DashboardModel->loadWhere(['name'=>$this->get('dashboard')]); + if (isError($result)) + return $this->response($result, REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + if (!hasData($result)) + return $this->response('No Dashboard with the name "' . $this->get('dashboard') . '" found.', REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + $dashboard_id = current(getData($result))->dashboard_id; + + $this->load->model('dashboard/Dashboardwidget_model', 'DashboardwidgetModel'); + $result = $this->DashboardwidgetModel->loadWidgets($dashboard_id); + if (isError($result)) + return $this->response($result, REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + if (!hasData($result)) + return $this->response('No Widgets for Dashboard "' . $this->get('dashboard') . '" found.', REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + + $this->response(getData($result), REST_Controller::HTTP_OK); + } + + protected function _check_whitelist_auth() {} + +} diff --git a/application/controllers/api/v1/dashboard/User.php b/application/controllers/api/v1/dashboard/User.php new file mode 100644 index 000000000..fdc5d7a1e --- /dev/null +++ b/application/controllers/api/v1/dashboard/User.php @@ -0,0 +1,89 @@ + 'user:r', + 'Widget' => 'user:r', + 'Widgets' => 'user:r' + ]); + } + + /** + * @return void + */ + public function getAuthObj() + { + $result = $this->authlib->getAuthObj(); + + $this->response($result, REST_Controller::HTTP_OK); + } + + /** + * @return void + */ + public function getWidget() + { + $this->load->model('dashboard/Widget_model', 'WidgetModel'); + $result = $this->WidgetModel->load($this->get('widget_id')); + if (isError($result)) + return $this->response($result, REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + if (!hasData($result)) + return $this->response('No Widget with the id "' . $this->get('widget_id') . '" found.', REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + $result = current(getData($result)); + + $this->response($result, REST_Controller::HTTP_OK); + } + + /** + * @return void + */ + public function getWidgets() + { + $this->load->model('dashboard/Dashboard_model', 'DashboardModel'); + $result = $this->DashboardModel->loadWhere(['name'=>$this->get('dashboard')]); + if (isError($result)) + return $this->response($result, REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + if (!hasData($result)) + return $this->response('No Dashboard with the name "' . $this->get('dashboard') . '" found.', REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + $dashboard_id = current(getData($result))->dashboard_id; + + $authObj = $this->authlib->getAuthObj(); + + $this->load->model('dashboard/Dashboardpreset_model', 'DashboardpresetModel'); + $result = $this->DashboardpresetModel->loadForUser($dashboard_id, $authObj->username); + if (isError($result)) + return $this->response($result, REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + if (!hasData($result)) + return $this->response('No Dashboard for user "' . $authObj->username . '" found.', REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + + $result = (current(getData($result))->config); + $result = json_decode($result); + if ($result === null) + return $this->response(json_last_error_msg(), REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + + $this->response($result, REST_Controller::HTTP_OK); + } + + protected function _check_whitelist_auth() {} + +} diff --git a/application/models/dashboard/Dashboard_model.php b/application/models/dashboard/Dashboard_model.php new file mode 100644 index 000000000..2aa567282 --- /dev/null +++ b/application/models/dashboard/Dashboard_model.php @@ -0,0 +1,18 @@ +dbTable = "( WITH vals (dashboard_id, name) AS (VALUES + (0,'CIS'), + (1,'PV21') + ) SELECT * FROM vals ) AS tbl_dashboard"; + $this->pk = 'dashboard_id'; + } + +} diff --git a/application/models/dashboard/Dashboardpreset_model.php b/application/models/dashboard/Dashboardpreset_model.php new file mode 100644 index 000000000..070fb77be --- /dev/null +++ b/application/models/dashboard/Dashboardpreset_model.php @@ -0,0 +1,28 @@ +dbTable = "( WITH vals (dashboard_preset_id, config) AS (VALUES + (0,CONCAT('[[0',',','0',',','0',',','0',',','[]]',',','[1',',','2',',','2',',','2',',','{\"display\":2}]]')), + (1,CONCAT('[[0',',','1',',','0',',','1',',','{}]',',','[1',',','0',',','1',',','0',',','{\"display\":1}]]')) + ) SELECT * FROM vals ) AS tbl_dashboard_preset"; + $this->pk = 'dashboard_preset_id'; + } + + public function loadForUser($dashboard_id, $uid) + { + $this->addJoin("( WITH vals (dashboard_preset_user_id, uid, dashboard_id, dashboard_preset_id) AS (VALUES + (0,'ma0168', 0, 0) + ) SELECT * FROM vals ) AS tbl_dashboard_preset_user", 'dashboard_preset_id'); + return $this->loadWhere(['uid' => $uid, 'dashboard_id' => $dashboard_id]); + + return success(); + } + +} diff --git a/application/models/dashboard/Dashboardwidget_model.php b/application/models/dashboard/Dashboardwidget_model.php new file mode 100644 index 000000000..e9349aae4 --- /dev/null +++ b/application/models/dashboard/Dashboardwidget_model.php @@ -0,0 +1,29 @@ +dbTable = "( WITH vals (dashboard_widget_id, dashboard_id, widget_id) AS (VALUES + (0,0,0), + (1,0,1), + (2,1,0) + ) SELECT * FROM vals ) AS tbl_dashboard_widget"; + $this->pk = 'dashboard_widget_id'; + } + + public function loadWidgets($dashboard_id) + { + $this->addJoin("( WITH vals (widget_id, name, component_name, component_path, arguments) AS (VALUES + (0,'KPI Single','DbwKpi','./DBW/KPI.js',CONCAT('{\"data\":[1]',',','\"display\":0}')), + (1,'KPI Multi','DbwKpi','./DBW/KPI.js',CONCAT('{\"data\":[1,2,3]}')) + ) SELECT * FROM vals ) AS tbl_widget", 'widget_id'); + + return $this->loadWhere(['dashboard_id' => $dashboard_id]); + } + +} diff --git a/application/models/dashboard/Widget_model.php b/application/models/dashboard/Widget_model.php new file mode 100644 index 000000000..c5d39e99d --- /dev/null +++ b/application/models/dashboard/Widget_model.php @@ -0,0 +1,18 @@ +dbTable = "( WITH vals (widget_id, name, component_name, component_path, arguments) AS (VALUES + (0,'KPI Single','DbwKpi','./DBW/KPI.js',CONCAT('{\"data\":[1]',',','\"display\":0}')), + (1,'KPI Multi','DbwKpi','./DBW/KPI.js',CONCAT('{\"data\":[1,2,3]}')) + ) SELECT * FROM vals ) AS tbl_widget"; + $this->pk = 'widget_id'; + } + +} diff --git a/application/views/test/Test.php b/application/views/test/Test.php new file mode 100644 index 000000000..84a2a5ece --- /dev/null +++ b/application/views/test/Test.php @@ -0,0 +1,63 @@ +load->view('templates/FHC-Header', + array( + 'title' => 'FH-Complete', + 'bootstrap5' => true, + 'fontawesome6' => true, + 'axios027' => true, + 'restclient' => true, + 'vue3' => true, + 'customJSModules' => ['public/js/apps/Test.js'], + 'navigationcomponent' => true + ) +); +?> + + + +
+ + + +
+
+

Dashboard

+
+ + + +
+
+ +load->view('templates/FHC-Footer'); ?> diff --git a/public/js/apps/Test.js b/public/js/apps/Test.js new file mode 100644 index 000000000..ec6e74a9b --- /dev/null +++ b/public/js/apps/Test.js @@ -0,0 +1,15 @@ +import {CoreNavigationCmpt} from '../components/navigation/Navigation.js'; +import CoreDashboard from '../components/CoreDashboard.js'; + +Vue.createApp({ + data: () => ({ + appSideMenuEntries: {} + }), + components: { + CoreNavigationCmpt, + CoreDashboard/*, + "CoreFilterCmpt": CoreFilterCmpt, + "verticalsplit": verticalsplit, + "searchbar": searchbar*/ + } +}).mount('#main'); diff --git a/public/js/components/CoreDashboard.js b/public/js/components/CoreDashboard.js new file mode 100644 index 000000000..e6d5c77ac --- /dev/null +++ b/public/js/components/CoreDashboard.js @@ -0,0 +1,206 @@ +import CoreDashboardItem from './Dashboard/Item.js'; +import DragAndDrop from './Dashboard/DragAndDrop.js'; + +export default { + components: { + CoreDashboardItem, + DragAndDrop + }, + data: () => ({ + widgetCache: {}, + componentCache: {}, + widgetWizard: null, + allowedWidgets: [], + widgets: [], + name: '', + newMode: false, + editMode: false + }), + computed: { + loaded: function() { + return this.widgets && this.name; + } + }, + props: [ + "dashboard" + ], + methods: { + saveConfig() { + // TODO(chris): SAVE! + console.log('SAVE', this.widgets); + this.editMode = false; + }, + startWidgetWizard() { + // TODO(chris): load widgets! + let self = this; + axios.get('/fhcomplete/index.ci.php/api/v1/dashboard/Dashboard/Widgets', { + headers: { + 'FHC-API-KEY':'itservice@technikum-wien.at' + }, + params: { + dashboard: this.dashboard + } + }).then(function(result) {console.log(result); + self.allowedWidgets = result.data; + }); + this.widgetWizard.show(); + }, + newWidget(widget) { + let self = this; + let newWidget = [widget.widget_id, this.widgets.length, this.widgets.length, this.widgets.length, []]; + // TODO(chris): loadingscreen? + (new Promise(function (resolve, reject) { + if (self.widgetCache[widget.widget_id]) { + resolve(self.widgetCache[widget.widget_id]); + } else { + this.extendWidgetAndCache(widget).then(widget => { + resolve(widget); + }); + } + })).then(widget => { + newWidget[5] = widget; + self.widgets.push(newWidget); + self.widgetWizard.hide(); + }); + }, + removeWidget(id) { + if (confirm('Are you sure you want to delete this widget?')) + this.widgets = this.widgets.filter(widget => widget[0] != id); + }, + getWidget(widget_id) { + let self = this; + return new Promise(function(resolve, reject) { + if (self.widgetCache[widget_id]) + return resolve(self.widgetCache[widget_id]); + axios.get('/fhcomplete/index.ci.php/api/v1/dashboard/User/Widget', { + headers: { + 'FHC-API-KEY':'itservice@technikum-wien.at' + }, + params: { + widget_id: widget_id + } + }) + .then(result => self.extendWidgetAndCache(result.data)) + .then(widget => resolve(widget)); + }); + }, + extendWidgetAndCache(widget) { + let self = this; + return new Promise(function(resolve, reject) { + let name = widget.component_name; + widget.arguments = JSON.parse(widget.arguments); + widget.component_name = widget.component_name.replace(/[A-Z]/g, (m,o) => (o > 0 ? "-" : "") + m.toLowerCase()); + self.getComponent(name, widget.component_path).then(component => { + widget.component = component; + return widget; + }).then(() => { + self.widgetCache[widget.widget_id] = widget; + resolve(self.widgetCache[widget.widget_id]); + }); + }); + }, + getComponent(name, path) { + let self = this; + return new Promise(async function(resolve, reject) { + if (self.componentCache[name]) + return resolve(self.componentCache[name]); + + + self.componentCache[name] = (await import(path)).default; + resolve(self.componentCache[name]); + }); + } + }, + mounted() { + let self = this; + this.widgetWizard = new bootstrap.Modal(this.$refs.widgetWizard); + axios.get('/fhcomplete/index.ci.php/api/v1/dashboard/User/AuthObj', { + headers: { + 'FHC-API-KEY':'itservice@technikum-wien.at' + } + }).then(function(result) { + self.name = result.data.name; + }); + axios.get('/fhcomplete/index.ci.php/api/v1/dashboard/User/Widgets', { + headers: { + 'FHC-API-KEY':'itservice@technikum-wien.at' + }, + params: { + dashboard: this.dashboard + } + }).then(function(result) { + let promises = []; + result.data.forEach(function(item) { + promises.push(new Promise(function(resolve, reject) { + self.getWidget(item[0]).then(function(widget) { + item[5] = widget; + resolve(); + }); + })); + }); + Promise.all(promises).then(function() { + self.widgets = result.data; + }) + }); + }, + template: `
+
+ +
+

+ Hallo {{name}}! + + + + + +

+
Loading...
+
+ +
+
+
+ +
+
+
+
+ +
` +} diff --git a/public/js/components/DBW/KPI.js b/public/js/components/DBW/KPI.js new file mode 100644 index 000000000..3346685f8 --- /dev/null +++ b/public/js/components/DBW/KPI.js @@ -0,0 +1,26 @@ +export default { + props: [ + "configMode", + "config" + ], + methods: { + changeConfig() { + this.config.display = parseInt(this.$refs.display.value); + this.$emit('config', this.config); + } + }, + template: `
+
KPI Widget
+
+ + +
+ +
` +} diff --git a/public/js/components/Dashboard/DragAndDrop.js b/public/js/components/Dashboard/DragAndDrop.js new file mode 100644 index 000000000..cd24c0ef6 --- /dev/null +++ b/public/js/components/Dashboard/DragAndDrop.js @@ -0,0 +1,139 @@ +export default { + data: () => ({ + isMounted: 0, + movedObjects: [], + tmpStyle: { + display: 'none', + background: 'gray', + 'grid-column-start': 0, + 'grid-column-end': 0, + 'grid-row-start': 0, + 'grid-row-end': 0, + } + }), + props: [ + "width", + "height", + "items" + ], + computed: { + gridWidth() { + if(!this.isMounted) + return 0; + return window.getComputedStyle(this.$refs.container).getPropertyValue('grid-template-columns').split(" ").length; + }, + gridHeight() { + if (!this.gridWidth) + return 0; + let minH = 0; + this.items.forEach(item => { + // TODO(chris): item change is not detected? + minH = Math.max(minH, item.y + item.h - 1); + }); + return Math.max(1, minH); + }, + gridOccupiers() { + let occupiers = []; + let gridWidth = this.gridWidth; + this.items.forEach(item => { + for (var i = 0; i < item.w; i++) + for (var j = 0; j < item.h; j++) + occupiers[(item.y+j) * gridWidth + (item.x+i)] = item.id; + }); + return occupiers; + } + }, + methods: { + startDrag(evt, item) { + evt.dataTransfer.dropEffect = 'move'; + evt.dataTransfer.effectAllowed = 'move'; + evt.dataTransfer.setData('itemId', item.id) + evt.dataTransfer.setData('itemW', item.w) + evt.dataTransfer.setData('itemH', item.h) + console.log(evt.target.style.display); + }, + moveItem(item) { + // TODO(chris): IMPLEMENT + if (!item._x) + item._x = item.x; + item.x++; + }, + moveItemBack(item) { + item.x = item._x; + }, + onDragOver(evt) { + this.tmpStyle.display = 'block'; + + let x = Math.floor(this.gridWidth * (evt.layerX / this.$refs.container.clientWidth)) + 1; + let y = Math.floor(this.gridHeight * (evt.layerY / this.$refs.container.clientHeight)) + 1; + let w = parseInt(evt.dataTransfer.getData('itemW')); + let h = parseInt(evt.dataTransfer.getData('itemH')); + + while (x + w > this.gridWidth + 1) + x--; + + // TODO(chris): start + let id = 0; + while (id = this.movedObjects.pop()) + /*this.items[id].c = this.items[id]._c;*/ + this.moveItemBack(this.items[id]); + for (var i = 0; i < w; i++) { + for (var j = 0; j < h; j++) { + let id = (y+j) * this.gridWidth + (x+i); + if (this.gridOccupiers[id] && this.gridOccupiers[id] != evt.dataTransfer.getData('itemID')) { + + /*if (!this.items[this.gridOccupiers[id]]._c) + this.items[this.gridOccupiers[id]]._c = this.items[this.gridOccupiers[id]].c; + this.items[this.gridOccupiers[id]].c = 'grey';*/ + this.moveItem(this.items[this.gridOccupiers[id]]); + + this.movedObjects.push(this.gridOccupiers[id]); + } + } + } + // TODO(chris): end + + this.tmpStyle['grid-column-start'] = x; + this.tmpStyle['grid-column-end'] = x + w; + this.tmpStyle['grid-row-start'] = y; + this.tmpStyle['grid-row-end'] = y + h; + }, + onDrop(evt, list) { + this.tmpStyle.display = 'none'; + + let id = evt.dataTransfer.getData('itemId'); + let x = Math.floor(this.gridWidth * (evt.layerX / this.$refs.container.clientWidth)) + 1; + let y = Math.floor(this.gridHeight * (evt.layerY / this.$refs.container.clientHeight)) + 1; + let w = parseInt(evt.dataTransfer.getData('itemW')); + + while (x + w > this.gridWidth + 1) + x--; + + this.items.forEach(item => { + if (id == item.id) { + item.x = x; + item.y = y; + console.log(item, id); + } + }); + // TODO(chris): find better way to trigger change for gridHeight + this.isMounted++ + } + }, + watchers: { + items() { + console.log(this.items); + } + }, + mounted() { + this.isMounted = 1; + window.addEventListener('resize', e => { this.isMounted ? this.isMounted++ : 0 }) + }, + template: `
+
+
+
{{gridWidth2}} +
+
+
` +} diff --git a/public/js/components/Dashboard/Item.js b/public/js/components/Dashboard/Item.js new file mode 100644 index 000000000..9a956a3ce --- /dev/null +++ b/public/js/components/Dashboard/Item.js @@ -0,0 +1,52 @@ +export default { + components: {}, + data: () => ({ + configMode: false, + name: '', + component: '', + arguments: null + }), + props: [ + "widget", + "config", + "editMode" + ], + computed: { + ready() { + return this.name && this.component && this.arguments !== null; + } + }, + methods: { + changeConfig(v) { + this.arguments = v; + this.configMode = false; + // TODO(chris): diff arguments widget.arguments + this.$emit('change', v); + } + }, + mounted() { + let self = this; + + if (!this.isPlaceholder) { + this.$options.components[this.widget.component_name] = this.widget.component; + this.name = this.widget.name; + this.component = this.widget.component_name; + this.arguments = {...this.widget.arguments, ...this.config}; + } + }, + template: `
+
+
+
+ + {{name}} + + +
+
+ +
+
+
+
` +} From 00f1eb38d178d1d5a750e123d5bf5e85dea41038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 7 Sep 2022 08:27:31 +0200 Subject: [PATCH 20/21] Added missing index files --- cis/private/coodle/index.html | 0 cis/private/index.html | 0 cis/private/info/index.html | 0 cis/private/tools/index.html | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 cis/private/coodle/index.html create mode 100644 cis/private/index.html create mode 100644 cis/private/info/index.html create mode 100644 cis/private/tools/index.html diff --git a/cis/private/coodle/index.html b/cis/private/coodle/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/cis/private/index.html b/cis/private/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/cis/private/info/index.html b/cis/private/info/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/cis/private/tools/index.html b/cis/private/tools/index.html new file mode 100644 index 000000000..e69de29bb From 393eaea91dc377df132f4681e1ced4072ca13621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 7 Sep 2022 09:00:00 +0200 Subject: [PATCH 21/21] Removed Dashboard Testfiles --- application/controllers/Test.php | 51 ----- .../api/v1/dashboard/Dashboard.php | 54 ----- .../controllers/api/v1/dashboard/User.php | 89 -------- .../models/dashboard/Dashboard_model.php | 18 -- .../dashboard/Dashboardpreset_model.php | 28 --- .../dashboard/Dashboardwidget_model.php | 29 --- application/models/dashboard/Widget_model.php | 18 -- application/views/test/Test.php | 63 ------ public/js/apps/Test.js | 15 -- public/js/components/CoreDashboard.js | 206 ------------------ public/js/components/DBW/KPI.js | 26 --- public/js/components/Dashboard/DragAndDrop.js | 139 ------------ public/js/components/Dashboard/Item.js | 52 ----- 13 files changed, 788 deletions(-) delete mode 100644 application/controllers/Test.php delete mode 100644 application/controllers/api/v1/dashboard/Dashboard.php delete mode 100644 application/controllers/api/v1/dashboard/User.php delete mode 100644 application/models/dashboard/Dashboard_model.php delete mode 100644 application/models/dashboard/Dashboardpreset_model.php delete mode 100644 application/models/dashboard/Dashboardwidget_model.php delete mode 100644 application/models/dashboard/Widget_model.php delete mode 100644 application/views/test/Test.php delete mode 100644 public/js/apps/Test.js delete mode 100644 public/js/components/CoreDashboard.js delete mode 100644 public/js/components/DBW/KPI.js delete mode 100644 public/js/components/Dashboard/DragAndDrop.js delete mode 100644 public/js/components/Dashboard/Item.js diff --git a/application/controllers/Test.php b/application/controllers/Test.php deleted file mode 100644 index aa21f6296..000000000 --- a/application/controllers/Test.php +++ /dev/null @@ -1,51 +0,0 @@ - 'user:r', - ) - ); - - $this->load->library('AuthLib'); - $this->load->library('WidgetLib'); - - $this->_setAuthUID(); // sets property uid - - $this->setControllerId(); // sets the controller id - } - - // ----------------------------------------------------------------------------------------------------------------- - // Public methods - public function index() - { - $this->load->view('test/Test.php', []); - } - - // ----------------------------------------------------------------------------------------------------------------- - // Private methods - - /** - * Retrieve the UID of the logged user and checks if it is valid - */ - private function _setAuthUID() - { - $this->_uid = getAuthUID(); - - if (!$this->_uid) show_error('User authentification failed'); - } - -} diff --git a/application/controllers/api/v1/dashboard/Dashboard.php b/application/controllers/api/v1/dashboard/Dashboard.php deleted file mode 100644 index 28365525b..000000000 --- a/application/controllers/api/v1/dashboard/Dashboard.php +++ /dev/null @@ -1,54 +0,0 @@ - 'user:r' - ]); - } - - /** - * @return void - */ - public function getWidgets() - { - $this->load->model('dashboard/Dashboard_model', 'DashboardModel'); - $result = $this->DashboardModel->loadWhere(['name'=>$this->get('dashboard')]); - if (isError($result)) - return $this->response($result, REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - if (!hasData($result)) - return $this->response('No Dashboard with the name "' . $this->get('dashboard') . '" found.', REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - $dashboard_id = current(getData($result))->dashboard_id; - - $this->load->model('dashboard/Dashboardwidget_model', 'DashboardwidgetModel'); - $result = $this->DashboardwidgetModel->loadWidgets($dashboard_id); - if (isError($result)) - return $this->response($result, REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - if (!hasData($result)) - return $this->response('No Widgets for Dashboard "' . $this->get('dashboard') . '" found.', REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - - $this->response(getData($result), REST_Controller::HTTP_OK); - } - - protected function _check_whitelist_auth() {} - -} diff --git a/application/controllers/api/v1/dashboard/User.php b/application/controllers/api/v1/dashboard/User.php deleted file mode 100644 index fdc5d7a1e..000000000 --- a/application/controllers/api/v1/dashboard/User.php +++ /dev/null @@ -1,89 +0,0 @@ - 'user:r', - 'Widget' => 'user:r', - 'Widgets' => 'user:r' - ]); - } - - /** - * @return void - */ - public function getAuthObj() - { - $result = $this->authlib->getAuthObj(); - - $this->response($result, REST_Controller::HTTP_OK); - } - - /** - * @return void - */ - public function getWidget() - { - $this->load->model('dashboard/Widget_model', 'WidgetModel'); - $result = $this->WidgetModel->load($this->get('widget_id')); - if (isError($result)) - return $this->response($result, REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - if (!hasData($result)) - return $this->response('No Widget with the id "' . $this->get('widget_id') . '" found.', REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - $result = current(getData($result)); - - $this->response($result, REST_Controller::HTTP_OK); - } - - /** - * @return void - */ - public function getWidgets() - { - $this->load->model('dashboard/Dashboard_model', 'DashboardModel'); - $result = $this->DashboardModel->loadWhere(['name'=>$this->get('dashboard')]); - if (isError($result)) - return $this->response($result, REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - if (!hasData($result)) - return $this->response('No Dashboard with the name "' . $this->get('dashboard') . '" found.', REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - $dashboard_id = current(getData($result))->dashboard_id; - - $authObj = $this->authlib->getAuthObj(); - - $this->load->model('dashboard/Dashboardpreset_model', 'DashboardpresetModel'); - $result = $this->DashboardpresetModel->loadForUser($dashboard_id, $authObj->username); - if (isError($result)) - return $this->response($result, REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - if (!hasData($result)) - return $this->response('No Dashboard for user "' . $authObj->username . '" found.', REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - - $result = (current(getData($result))->config); - $result = json_decode($result); - if ($result === null) - return $this->response(json_last_error_msg(), REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - - $this->response($result, REST_Controller::HTTP_OK); - } - - protected function _check_whitelist_auth() {} - -} diff --git a/application/models/dashboard/Dashboard_model.php b/application/models/dashboard/Dashboard_model.php deleted file mode 100644 index 2aa567282..000000000 --- a/application/models/dashboard/Dashboard_model.php +++ /dev/null @@ -1,18 +0,0 @@ -dbTable = "( WITH vals (dashboard_id, name) AS (VALUES - (0,'CIS'), - (1,'PV21') - ) SELECT * FROM vals ) AS tbl_dashboard"; - $this->pk = 'dashboard_id'; - } - -} diff --git a/application/models/dashboard/Dashboardpreset_model.php b/application/models/dashboard/Dashboardpreset_model.php deleted file mode 100644 index 070fb77be..000000000 --- a/application/models/dashboard/Dashboardpreset_model.php +++ /dev/null @@ -1,28 +0,0 @@ -dbTable = "( WITH vals (dashboard_preset_id, config) AS (VALUES - (0,CONCAT('[[0',',','0',',','0',',','0',',','[]]',',','[1',',','2',',','2',',','2',',','{\"display\":2}]]')), - (1,CONCAT('[[0',',','1',',','0',',','1',',','{}]',',','[1',',','0',',','1',',','0',',','{\"display\":1}]]')) - ) SELECT * FROM vals ) AS tbl_dashboard_preset"; - $this->pk = 'dashboard_preset_id'; - } - - public function loadForUser($dashboard_id, $uid) - { - $this->addJoin("( WITH vals (dashboard_preset_user_id, uid, dashboard_id, dashboard_preset_id) AS (VALUES - (0,'ma0168', 0, 0) - ) SELECT * FROM vals ) AS tbl_dashboard_preset_user", 'dashboard_preset_id'); - return $this->loadWhere(['uid' => $uid, 'dashboard_id' => $dashboard_id]); - - return success(); - } - -} diff --git a/application/models/dashboard/Dashboardwidget_model.php b/application/models/dashboard/Dashboardwidget_model.php deleted file mode 100644 index e9349aae4..000000000 --- a/application/models/dashboard/Dashboardwidget_model.php +++ /dev/null @@ -1,29 +0,0 @@ -dbTable = "( WITH vals (dashboard_widget_id, dashboard_id, widget_id) AS (VALUES - (0,0,0), - (1,0,1), - (2,1,0) - ) SELECT * FROM vals ) AS tbl_dashboard_widget"; - $this->pk = 'dashboard_widget_id'; - } - - public function loadWidgets($dashboard_id) - { - $this->addJoin("( WITH vals (widget_id, name, component_name, component_path, arguments) AS (VALUES - (0,'KPI Single','DbwKpi','./DBW/KPI.js',CONCAT('{\"data\":[1]',',','\"display\":0}')), - (1,'KPI Multi','DbwKpi','./DBW/KPI.js',CONCAT('{\"data\":[1,2,3]}')) - ) SELECT * FROM vals ) AS tbl_widget", 'widget_id'); - - return $this->loadWhere(['dashboard_id' => $dashboard_id]); - } - -} diff --git a/application/models/dashboard/Widget_model.php b/application/models/dashboard/Widget_model.php deleted file mode 100644 index c5d39e99d..000000000 --- a/application/models/dashboard/Widget_model.php +++ /dev/null @@ -1,18 +0,0 @@ -dbTable = "( WITH vals (widget_id, name, component_name, component_path, arguments) AS (VALUES - (0,'KPI Single','DbwKpi','./DBW/KPI.js',CONCAT('{\"data\":[1]',',','\"display\":0}')), - (1,'KPI Multi','DbwKpi','./DBW/KPI.js',CONCAT('{\"data\":[1,2,3]}')) - ) SELECT * FROM vals ) AS tbl_widget"; - $this->pk = 'widget_id'; - } - -} diff --git a/application/views/test/Test.php b/application/views/test/Test.php deleted file mode 100644 index 84a2a5ece..000000000 --- a/application/views/test/Test.php +++ /dev/null @@ -1,63 +0,0 @@ -load->view('templates/FHC-Header', - array( - 'title' => 'FH-Complete', - 'bootstrap5' => true, - 'fontawesome6' => true, - 'axios027' => true, - 'restclient' => true, - 'vue3' => true, - 'customJSModules' => ['public/js/apps/Test.js'], - 'navigationcomponent' => true - ) -); -?> - - - -
- - - -
-
-

Dashboard

-
- - - -
-
- -load->view('templates/FHC-Footer'); ?> diff --git a/public/js/apps/Test.js b/public/js/apps/Test.js deleted file mode 100644 index ec6e74a9b..000000000 --- a/public/js/apps/Test.js +++ /dev/null @@ -1,15 +0,0 @@ -import {CoreNavigationCmpt} from '../components/navigation/Navigation.js'; -import CoreDashboard from '../components/CoreDashboard.js'; - -Vue.createApp({ - data: () => ({ - appSideMenuEntries: {} - }), - components: { - CoreNavigationCmpt, - CoreDashboard/*, - "CoreFilterCmpt": CoreFilterCmpt, - "verticalsplit": verticalsplit, - "searchbar": searchbar*/ - } -}).mount('#main'); diff --git a/public/js/components/CoreDashboard.js b/public/js/components/CoreDashboard.js deleted file mode 100644 index e6d5c77ac..000000000 --- a/public/js/components/CoreDashboard.js +++ /dev/null @@ -1,206 +0,0 @@ -import CoreDashboardItem from './Dashboard/Item.js'; -import DragAndDrop from './Dashboard/DragAndDrop.js'; - -export default { - components: { - CoreDashboardItem, - DragAndDrop - }, - data: () => ({ - widgetCache: {}, - componentCache: {}, - widgetWizard: null, - allowedWidgets: [], - widgets: [], - name: '', - newMode: false, - editMode: false - }), - computed: { - loaded: function() { - return this.widgets && this.name; - } - }, - props: [ - "dashboard" - ], - methods: { - saveConfig() { - // TODO(chris): SAVE! - console.log('SAVE', this.widgets); - this.editMode = false; - }, - startWidgetWizard() { - // TODO(chris): load widgets! - let self = this; - axios.get('/fhcomplete/index.ci.php/api/v1/dashboard/Dashboard/Widgets', { - headers: { - 'FHC-API-KEY':'itservice@technikum-wien.at' - }, - params: { - dashboard: this.dashboard - } - }).then(function(result) {console.log(result); - self.allowedWidgets = result.data; - }); - this.widgetWizard.show(); - }, - newWidget(widget) { - let self = this; - let newWidget = [widget.widget_id, this.widgets.length, this.widgets.length, this.widgets.length, []]; - // TODO(chris): loadingscreen? - (new Promise(function (resolve, reject) { - if (self.widgetCache[widget.widget_id]) { - resolve(self.widgetCache[widget.widget_id]); - } else { - this.extendWidgetAndCache(widget).then(widget => { - resolve(widget); - }); - } - })).then(widget => { - newWidget[5] = widget; - self.widgets.push(newWidget); - self.widgetWizard.hide(); - }); - }, - removeWidget(id) { - if (confirm('Are you sure you want to delete this widget?')) - this.widgets = this.widgets.filter(widget => widget[0] != id); - }, - getWidget(widget_id) { - let self = this; - return new Promise(function(resolve, reject) { - if (self.widgetCache[widget_id]) - return resolve(self.widgetCache[widget_id]); - axios.get('/fhcomplete/index.ci.php/api/v1/dashboard/User/Widget', { - headers: { - 'FHC-API-KEY':'itservice@technikum-wien.at' - }, - params: { - widget_id: widget_id - } - }) - .then(result => self.extendWidgetAndCache(result.data)) - .then(widget => resolve(widget)); - }); - }, - extendWidgetAndCache(widget) { - let self = this; - return new Promise(function(resolve, reject) { - let name = widget.component_name; - widget.arguments = JSON.parse(widget.arguments); - widget.component_name = widget.component_name.replace(/[A-Z]/g, (m,o) => (o > 0 ? "-" : "") + m.toLowerCase()); - self.getComponent(name, widget.component_path).then(component => { - widget.component = component; - return widget; - }).then(() => { - self.widgetCache[widget.widget_id] = widget; - resolve(self.widgetCache[widget.widget_id]); - }); - }); - }, - getComponent(name, path) { - let self = this; - return new Promise(async function(resolve, reject) { - if (self.componentCache[name]) - return resolve(self.componentCache[name]); - - - self.componentCache[name] = (await import(path)).default; - resolve(self.componentCache[name]); - }); - } - }, - mounted() { - let self = this; - this.widgetWizard = new bootstrap.Modal(this.$refs.widgetWizard); - axios.get('/fhcomplete/index.ci.php/api/v1/dashboard/User/AuthObj', { - headers: { - 'FHC-API-KEY':'itservice@technikum-wien.at' - } - }).then(function(result) { - self.name = result.data.name; - }); - axios.get('/fhcomplete/index.ci.php/api/v1/dashboard/User/Widgets', { - headers: { - 'FHC-API-KEY':'itservice@technikum-wien.at' - }, - params: { - dashboard: this.dashboard - } - }).then(function(result) { - let promises = []; - result.data.forEach(function(item) { - promises.push(new Promise(function(resolve, reject) { - self.getWidget(item[0]).then(function(widget) { - item[5] = widget; - resolve(); - }); - })); - }); - Promise.all(promises).then(function() { - self.widgets = result.data; - }) - }); - }, - template: `
-
- -
-

- Hallo {{name}}! - - - - - -

-
Loading...
-
- -
-
-
- -
-
-
-
- -
` -} diff --git a/public/js/components/DBW/KPI.js b/public/js/components/DBW/KPI.js deleted file mode 100644 index 3346685f8..000000000 --- a/public/js/components/DBW/KPI.js +++ /dev/null @@ -1,26 +0,0 @@ -export default { - props: [ - "configMode", - "config" - ], - methods: { - changeConfig() { - this.config.display = parseInt(this.$refs.display.value); - this.$emit('config', this.config); - } - }, - template: `
-
KPI Widget
-
- - -
- -
` -} diff --git a/public/js/components/Dashboard/DragAndDrop.js b/public/js/components/Dashboard/DragAndDrop.js deleted file mode 100644 index cd24c0ef6..000000000 --- a/public/js/components/Dashboard/DragAndDrop.js +++ /dev/null @@ -1,139 +0,0 @@ -export default { - data: () => ({ - isMounted: 0, - movedObjects: [], - tmpStyle: { - display: 'none', - background: 'gray', - 'grid-column-start': 0, - 'grid-column-end': 0, - 'grid-row-start': 0, - 'grid-row-end': 0, - } - }), - props: [ - "width", - "height", - "items" - ], - computed: { - gridWidth() { - if(!this.isMounted) - return 0; - return window.getComputedStyle(this.$refs.container).getPropertyValue('grid-template-columns').split(" ").length; - }, - gridHeight() { - if (!this.gridWidth) - return 0; - let minH = 0; - this.items.forEach(item => { - // TODO(chris): item change is not detected? - minH = Math.max(minH, item.y + item.h - 1); - }); - return Math.max(1, minH); - }, - gridOccupiers() { - let occupiers = []; - let gridWidth = this.gridWidth; - this.items.forEach(item => { - for (var i = 0; i < item.w; i++) - for (var j = 0; j < item.h; j++) - occupiers[(item.y+j) * gridWidth + (item.x+i)] = item.id; - }); - return occupiers; - } - }, - methods: { - startDrag(evt, item) { - evt.dataTransfer.dropEffect = 'move'; - evt.dataTransfer.effectAllowed = 'move'; - evt.dataTransfer.setData('itemId', item.id) - evt.dataTransfer.setData('itemW', item.w) - evt.dataTransfer.setData('itemH', item.h) - console.log(evt.target.style.display); - }, - moveItem(item) { - // TODO(chris): IMPLEMENT - if (!item._x) - item._x = item.x; - item.x++; - }, - moveItemBack(item) { - item.x = item._x; - }, - onDragOver(evt) { - this.tmpStyle.display = 'block'; - - let x = Math.floor(this.gridWidth * (evt.layerX / this.$refs.container.clientWidth)) + 1; - let y = Math.floor(this.gridHeight * (evt.layerY / this.$refs.container.clientHeight)) + 1; - let w = parseInt(evt.dataTransfer.getData('itemW')); - let h = parseInt(evt.dataTransfer.getData('itemH')); - - while (x + w > this.gridWidth + 1) - x--; - - // TODO(chris): start - let id = 0; - while (id = this.movedObjects.pop()) - /*this.items[id].c = this.items[id]._c;*/ - this.moveItemBack(this.items[id]); - for (var i = 0; i < w; i++) { - for (var j = 0; j < h; j++) { - let id = (y+j) * this.gridWidth + (x+i); - if (this.gridOccupiers[id] && this.gridOccupiers[id] != evt.dataTransfer.getData('itemID')) { - - /*if (!this.items[this.gridOccupiers[id]]._c) - this.items[this.gridOccupiers[id]]._c = this.items[this.gridOccupiers[id]].c; - this.items[this.gridOccupiers[id]].c = 'grey';*/ - this.moveItem(this.items[this.gridOccupiers[id]]); - - this.movedObjects.push(this.gridOccupiers[id]); - } - } - } - // TODO(chris): end - - this.tmpStyle['grid-column-start'] = x; - this.tmpStyle['grid-column-end'] = x + w; - this.tmpStyle['grid-row-start'] = y; - this.tmpStyle['grid-row-end'] = y + h; - }, - onDrop(evt, list) { - this.tmpStyle.display = 'none'; - - let id = evt.dataTransfer.getData('itemId'); - let x = Math.floor(this.gridWidth * (evt.layerX / this.$refs.container.clientWidth)) + 1; - let y = Math.floor(this.gridHeight * (evt.layerY / this.$refs.container.clientHeight)) + 1; - let w = parseInt(evt.dataTransfer.getData('itemW')); - - while (x + w > this.gridWidth + 1) - x--; - - this.items.forEach(item => { - if (id == item.id) { - item.x = x; - item.y = y; - console.log(item, id); - } - }); - // TODO(chris): find better way to trigger change for gridHeight - this.isMounted++ - } - }, - watchers: { - items() { - console.log(this.items); - } - }, - mounted() { - this.isMounted = 1; - window.addEventListener('resize', e => { this.isMounted ? this.isMounted++ : 0 }) - }, - template: `
-
-
-
{{gridWidth2}} -
-
-
` -} diff --git a/public/js/components/Dashboard/Item.js b/public/js/components/Dashboard/Item.js deleted file mode 100644 index 9a956a3ce..000000000 --- a/public/js/components/Dashboard/Item.js +++ /dev/null @@ -1,52 +0,0 @@ -export default { - components: {}, - data: () => ({ - configMode: false, - name: '', - component: '', - arguments: null - }), - props: [ - "widget", - "config", - "editMode" - ], - computed: { - ready() { - return this.name && this.component && this.arguments !== null; - } - }, - methods: { - changeConfig(v) { - this.arguments = v; - this.configMode = false; - // TODO(chris): diff arguments widget.arguments - this.$emit('change', v); - } - }, - mounted() { - let self = this; - - if (!this.isPlaceholder) { - this.$options.components[this.widget.component_name] = this.widget.component; - this.name = this.widget.name; - this.component = this.widget.component_name; - this.arguments = {...this.widget.arguments, ...this.config}; - } - }, - template: `
-
-
-
- - {{name}} - - -
-
- -
-
-
-
` -}