diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php index b818546fc..5a3c4ba27 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php @@ -99,11 +99,16 @@ class approveAnrechnungDetail extends Auth_Controller // Get Genehmigung data $genehmigungData = $this->anrechnunglib->getGenehmigungData($anrechnung_id); + $hasReadOnlyAccess = + $this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's', $antragData->studiengang_kz) + && !$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 'suid', $antragData->studiengang_kz); + $viewData = array( 'antragData' => $antragData, 'anrechnungData' => $anrechnungData, 'empfehlungData' => $empfehlungData, - 'genehmigungData' => $genehmigungData + 'genehmigungData' => $genehmigungData, + 'hasReadOnlyAccess' => $hasReadOnlyAccess ); $this->load->view('lehre/anrechnung/approveAnrechnungDetail.php', $viewData); diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index c667c9d33..2030f9923 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -5,7 +5,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); class approveAnrechnungUebersicht extends Auth_Controller { const BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN = 'lehre/anrechnung_genehmigen'; - + const BERECHTIGUNG_ANRECHNUNG_ANLEGEN = 'lehre/anrechnung_anlegen'; + const REVIEW_ANRECHNUNG_URI = '/lehre/anrechnung/ReviewAnrechnungUebersicht'; const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; @@ -76,10 +77,19 @@ class approveAnrechnungUebersicht extends Auth_Controller { show_error(getError($studiengang_kz_arr)); } - + + $hasReadOnlyAccess = + $this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's') + && !$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 'suid'); + + // This permission is checked here to disable create Anrechnung button, if permission is not given + $hasCreateAnrechnungAccess = $this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_ANLEGEN, 's'); + $viewData = array( 'studiensemester_selected' => $studiensemester_kurzbz, - 'studiengaenge_entitled' => $studiengang_kz_arr + 'studiengaenge_entitled' => $studiengang_kz_arr, + 'hasReadOnlyAccess' => $hasReadOnlyAccess, + 'hasCreateAnrechnungAccess' => $hasCreateAnrechnungAccess ); $this->load->view('lehre/anrechnung/approveAnrechnungUebersicht.php', $viewData); diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 3bec62dce..ee197ab05 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -89,6 +89,7 @@ class AnrechnungLib $antrag_data->vorname = $person->vorname; $antrag_data->nachname = $person->nachname; $antrag_data->matrikelnr = $student->matrikelnr; + $antrag_data->studiengang_kz = $studiengang->studiengang_kz; $antrag_data->stg_bezeichnung = $studiengang->bezeichnung; $antrag_data->lektoren = $lv_lektoren_arr; $antrag_data->zgv = $latest_zgv_bezeichnung; diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php index 4603708f4..cd38fd9ac 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -25,7 +25,8 @@ $this->load->view( 'bitteBegruendungAngeben', 'empfehlungWurdeAngefordert', 'anrechnungenWurdenGenehmigt', - 'anrechnungenWurdenAbgelehnt' + 'anrechnungenWurdenAbgelehnt', + 'nurLeseberechtigung' ), 'person' => array( 'student', @@ -72,7 +73,7 @@ $this->load->view( -
+
diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index 850affeea..308f702a3 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -48,7 +48,8 @@ $this->load->view( 'empfehlungWurdeAngefordert', 'empfehlungWurdeAngefordertAusnahmeWoKeineLektoren', 'anrechnungenWurdenGenehmigt', - 'anrechnungenWurdenAbgelehnt' + 'anrechnungenWurdenAbgelehnt', + 'nurLeseberechtigung' ), 'person' => array( 'student', @@ -101,7 +102,7 @@ $this->load->view(
-
+
widgetlib->widget( @@ -226,7 +227,7 @@ $this->load->view( class='fa fa-times'>
- ' target='_blank'> + ' target='_blank'> p->t('global', 'antragAnlegen'); ?>
diff --git a/public/js/lehre/anrechnung/approveAnrechnungDetail.js b/public/js/lehre/anrechnung/approveAnrechnungDetail.js index c2c2899ee..c5c0519f3 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungDetail.js +++ b/public/js/lehre/anrechnung/approveAnrechnungDetail.js @@ -10,6 +10,7 @@ $(function(){ const genehmigung_panel = $('#approveAnrechnungDetail-genehmigung-panel'); const begruendung_panel = $('#approveAnrechnungDetail-begruendung-panel'); + const hasReadOnlyAccess = $('#approveAnrechnungDetail-generell').data('readonly'); // Pruefen ob Promise unterstuetzt wird // Tabulator funktioniert nicht mit IE @@ -21,6 +22,11 @@ $(function(){ return; } + if (hasReadOnlyAccess) + { + approveAnrechnungDetail.disableEditElements(); + } + // Set status alert color approveAnrechnungDetail.setStatusAlertColor(); @@ -417,6 +423,34 @@ var approveAnrechnungDetail = { } ); }, + disableEditElements: function() + { + // Disable: + // ...button Empfehlung anfordern + $('#approveAnrechnungDetail-request-recommendation') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + // ...button Empfehlung zuruecknehmen + $('#approveAnrechnungDetail-withdraw-request-recommedation') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + // ...button Genehmigen + $('#approveAnrechnungDetail-approve-anrechnung-ask') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + // ...button Ablehnen + $('#approveAnrechnungDetail-reject-anrechnung-ask') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + // ...button Genehmigung zurücknehmen + $('#approveAnrechnungDetail-withdraw-anrechnung-approvement') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + // ... form Empfehlungsnotiz + $('#form-empfehlungNotiz :input') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + }, copyIntoTextarea: function(elem){ // Find closest textarea diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index ff3235e52..fe78217b9 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -148,6 +148,8 @@ $(function(){ const genehmigung_panel = $('#approveAnrechnungUebersicht-genehmigung-panel'); const begruendung_panel = $('#approveAnrechnungUebersicht-begruendung-panel'); + const hasReadOnlyAccess = $('#formApproveAnrechnungUebersicht').data('readonly'); + const hasCreateAnrechnungAccess = $('#formApproveAnrechnungUebersicht').data('createaccess'); // Pruefen ob Promise unterstuetzt wird // Tabulator funktioniert nicht mit IE @@ -165,6 +167,16 @@ $(function(){ $('#tableWidgetTabulator').tabulator('redraw', true); }); + if (hasReadOnlyAccess) + { + approveAnrechnung.disableEditElements(); + } + + if (!hasCreateAnrechnungAccess) + { + approveAnrechnung.disableCreateAnrechnungButton(); + } + // Set status alert color approveAnrechnung.setStatusAlertColor(); @@ -517,6 +529,30 @@ var approveAnrechnung = { $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-warning'); } }, + disableEditElements: function() + { + // Disable: + // ...button Empfehlung anfordern + $('#approveAnrechnungUebersicht-request-recommendation') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + // ...button Ablehnen + $('#approveAnrechnungUebersicht-reject-anrechnungen-ask') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + // ...button Genehmigen + $('#approveAnrechnungUebersicht-approve-anrechnungen-ask') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + + }, + disableCreateAnrechnungButton: function() + { + // Disable button Antrag anlegen + $('#approveAnrechnungUebersicht-create-anrechnung') + .removeAttr('href') + .css({'color': 'grey', 'pointer-events': 'none'}); // property disabled does not work for link + }, copyIntoTextarea: function(elem){ // Find closest textarea diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 1baffa93b..f96b0eb0c 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -13694,7 +13694,27 @@ array( 'insertvon' => 'system' ) ) - ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'nurLeseberechtigung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Nur Leseberechtigung", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Read-Only Access", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ) );