From 772c4fa308fd16f278a26eaec91aa71460ad16d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 28 May 2020 09:44:52 +0200 Subject: [PATCH] =?UTF-8?q?Pr=C3=BCfungsprotokoll=20=C3=9Cbersichtsliste?= =?UTF-8?q?=20f=C3=BCr=20Vorsitz=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/lehre/Pruefungsprotokoll.php | 10 ++- .../lehre/pruefungsprotokollUebersicht.php | 46 ++++++++++++ .../pruefungsprotokollUebersichtData.php | 67 +++++++++++++++++ public/js/TableWidget.js | 73 +++++++++++-------- system/phrasesupdate.php | 40 ++++++++++ 5 files changed, 206 insertions(+), 30 deletions(-) create mode 100644 application/views/lehre/pruefungsprotokollUebersicht.php create mode 100644 application/views/lehre/pruefungsprotokollUebersichtData.php diff --git a/application/controllers/lehre/Pruefungsprotokoll.php b/application/controllers/lehre/Pruefungsprotokoll.php index 9ac439fe1..0a5c13646 100644 --- a/application/controllers/lehre/Pruefungsprotokoll.php +++ b/application/controllers/lehre/Pruefungsprotokoll.php @@ -28,7 +28,10 @@ class Pruefungsprotokoll extends Auth_Controller // Load language phrases $this->loadPhrases( array( - 'abschlusspruefung' + 'abschlusspruefung', + 'global', + 'person', + 'lehre' ) ); @@ -39,6 +42,11 @@ class Pruefungsprotokoll extends Auth_Controller // ----------------------------------------------------------------------------------------------------------------- // Public methods + public function index() + { + $this->load->library('WidgetLib'); + $this->load->view('lehre/pruefungsprotokollUebersicht.php'); + } /** */ diff --git a/application/views/lehre/pruefungsprotokollUebersicht.php b/application/views/lehre/pruefungsprotokollUebersicht.php new file mode 100644 index 000000000..a827bcf5b --- /dev/null +++ b/application/views/lehre/pruefungsprotokollUebersicht.php @@ -0,0 +1,46 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => 'Prüfungsprotokoll', + 'jquery' => true, + 'jqueryui' => true, + 'jquerycheckboxes' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'tablesorter' => true, + 'ajaxlib' => true, + 'dialoglib' => true, + 'tablewidget' => true, + 'phrases' => array( + 'ui' => array( + 'keineDatenVorhanden', + ) + ), + 'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css'), + 'customJSs' => array('public/js/bootstrapper.js') + ) + ); +?> + + +
+
+
+
+ +
+
+ p->t('abschlusspruefung','einfuehrungstext'); ?> +
+
+ load->view('lehre/pruefungsprotokollUebersichtData.php'); ?> +
+
+
+
+ + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/lehre/pruefungsprotokollUebersichtData.php b/application/views/lehre/pruefungsprotokollUebersichtData.php new file mode 100644 index 000000000..b2d8b9948 --- /dev/null +++ b/application/views/lehre/pruefungsprotokollUebersichtData.php @@ -0,0 +1,67 @@ +='2020-05-27' +ORDER BY datum +"; + +$filterWidgetArray = array( + 'query' => $query, + 'tableUniqueId' => 'pruefungsprotokoll', + 'requiredPermissions' => 'lehre/pruefungsbeurteilung', + 'datasetRepresentation' => 'tablesorter', + 'columnsAliases' => array( + ucfirst($this->p->t('global', 'details')), + ucfirst($this->p->t('global', 'name')), + ucfirst($this->p->t('lehre', 'studiengang')), + ucfirst($this->p->t('global', 'datum')), + ucfirst($this->p->t('global', 'status')), + ), + 'formatRow' => function($datasetRaw) { + + /* NOTE: Dont use $this here for PHP Version compatibility */ + $datasetRaw->{'abschlusspruefung_id'} = sprintf( + 'Protokoll ausfüllen', + site_url('lehre/Pruefungsprotokoll/Protokoll'), + $datasetRaw->{'abschlusspruefung_id'} + ); + + if ($datasetRaw->{'datum'} == null) + { + $datasetRaw->{'datum'} = '-'; + } + else + { + $datasetRaw->{'datum'} = date_format(date_create($datasetRaw->{'datum'}),'d.m.Y'); + } + if ($datasetRaw->{'freigabedatum'} == null) + { + $datasetRaw->{'freigabedatum'} = 'offen'; + } + else + { + $datasetRaw->{'freigabedatum'} = 'Freigegeben am: '.date_format(date_create($datasetRaw->{'freigabedatum'}),'d.m.Y'); + } + return $datasetRaw; + }, +); + +echo $this->widgetlib->widget('TableWidget', $filterWidgetArray); + +?> diff --git a/public/js/TableWidget.js b/public/js/TableWidget.js index 60dde8ccf..049959796 100644 --- a/public/js/TableWidget.js +++ b/public/js/TableWidget.js @@ -336,47 +336,62 @@ var FHC_TableWidget = { if (typeof tableWidgetDiv.find("#tableWidgetTableDataset").checkboxes === 'function') tableWidgetDiv.find("#tableWidgetTableDataset").checkboxes("range", true); } - - for (var i = 0; i < data.dataset.length; i++) + if (data.dataset.length == 0) { - var record = data.dataset[i]; - - if ($.isEmptyObject(record)) + // Display placeholder if Table is empty + var numColumns = arrayFieldsToDisplay.length; + if (data.hasOwnProperty("additionalColumns") && $.isArray(data.additionalColumns)) { - continue; + numColumns += data.additionalColumns.length; } - - var strHtml = ""; - - if (data.checkboxes != null && data.checkboxes != "") + var strHtml = ''; + strHtml += FHC_PhrasesLib.t('ui', 'keineDatenVorhanden'); + strHtml += ''; + tableWidgetDiv.find("#tableWidgetTableDataset > tbody").append(strHtml); + } + else + { + for (var i = 0; i < data.dataset.length; i++) { - strHtml += ""; - strHtml += ""; - strHtml += ""; - } + var record = data.dataset[i]; - $.each(arrayFieldsToDisplay, function(i, fieldToDisplay) { - - if (record.hasOwnProperty(data.fields[i])) + if ($.isEmptyObject(record)) { - strHtml += "" + record[data.fields[i]] + ""; + continue; } - }); - if (data.additionalColumns != null && $.isArray(data.additionalColumns)) - { - $.each(data.additionalColumns, function(i, additionalColumn) { + var strHtml = ""; - if (record.hasOwnProperty(additionalColumn)) + if (data.checkboxes != null && data.checkboxes != "") + { + strHtml += ""; + strHtml += ""; + strHtml += ""; + } + + $.each(arrayFieldsToDisplay, function(i, fieldToDisplay) { + + if (record.hasOwnProperty(data.fields[i])) { - strHtml += "" + record[additionalColumn] + ""; + strHtml += "" + record[data.fields[i]] + ""; } }); + + if (data.additionalColumns != null && $.isArray(data.additionalColumns)) + { + $.each(data.additionalColumns, function(i, additionalColumn) { + + if (record.hasOwnProperty(additionalColumn)) + { + strHtml += "" + record[additionalColumn] + ""; + } + }); + } + + strHtml += ""; + + tableWidgetDiv.find("#tableWidgetTableDataset > tbody").append(strHtml); } - - strHtml += ""; - - tableWidgetDiv.find("#tableWidgetTableDataset > tbody").append(strHtml); } } } @@ -540,7 +555,7 @@ var FHC_TableWidget = { options.columnVisibilityChanged = function(column, visible) { _func_columnVisibilityChanged(column, visible); }; - + // Renders the tabulator tableWidgetDiv.find("#tableWidgetTabulator").tabulator(options); } diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 45d4183de..78bcebad3 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -4174,6 +4174,26 @@ When on hold, the date is only a reminder.', ) ) ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'status', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Status', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Status', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'global', @@ -6766,6 +6786,26 @@ When on hold, the date is only a reminder.', ) ) ), + array( + 'app' => 'core', + 'category' => 'abschlusspruefung', + 'phrase' => 'einfuehrungstext', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Hier sehen Sie alle Abschlussprüfungen zu denen Sie als Vorsitz zugeteilt sind. Klicken Sie auf den entsprechenden Link um das Prüfungsprotokoll zu erstellen.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Here you can see all the Examination where you are assigned as a chair. Select the entry to create the protocol.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'abschlusspruefung',