mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-21 05:59:27 +00:00
Disabled edit elements / create Anrechnung in GUI if user has readonly access / no permission to create Anrechnung
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -25,7 +25,8 @@ $this->load->view(
|
||||
'bitteBegruendungAngeben',
|
||||
'empfehlungWurdeAngefordert',
|
||||
'anrechnungenWurdenGenehmigt',
|
||||
'anrechnungenWurdenAbgelehnt'
|
||||
'anrechnungenWurdenAbgelehnt',
|
||||
'nurLeseberechtigung'
|
||||
),
|
||||
'person' => array(
|
||||
'student',
|
||||
@@ -72,7 +73,7 @@ $this->load->view(
|
||||
</div>
|
||||
<!--end header -->
|
||||
|
||||
<div class="row">
|
||||
<div class="row" id="approveAnrechnungDetail-generell" data-readonly="<?php echo json_encode($hasReadOnlyAccess)?>">
|
||||
<div class="col-xs-8">
|
||||
<!-- Antragsdaten -->
|
||||
<div class="row">
|
||||
|
||||
@@ -48,7 +48,8 @@ $this->load->view(
|
||||
'empfehlungWurdeAngefordert',
|
||||
'empfehlungWurdeAngefordertAusnahmeWoKeineLektoren',
|
||||
'anrechnungenWurdenGenehmigt',
|
||||
'anrechnungenWurdenAbgelehnt'
|
||||
'anrechnungenWurdenAbgelehnt',
|
||||
'nurLeseberechtigung'
|
||||
),
|
||||
'person' => array(
|
||||
'student',
|
||||
@@ -101,7 +102,7 @@ $this->load->view(
|
||||
<!-- dropdown studiensemester -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<form id="formApproveAnrechnungUebersicht" class="form-inline" action="" method="get">
|
||||
<form id="formApproveAnrechnungUebersicht" class="form-inline" action="" method="get" data-readonly="<?php echo json_encode($hasReadOnlyAccess)?>" data-createaccess="<?php echo json_encode($hasCreateAnrechnungAccess)?>">
|
||||
<div class="form-group">
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
@@ -226,7 +227,7 @@ $this->load->view(
|
||||
class='fa fa-times'></i>
|
||||
</button>
|
||||
</div>
|
||||
<a type="button" class="btn btn-default" style="margin-left: 20px;" href='<?php echo site_url('lehre/anrechnung/createAnrechnung') ?>' target='_blank'>
|
||||
<a type="button" id="approveAnrechnungUebersicht-create-anrechnung" class="btn btn-default" style="margin-left: 20px;" href='<?php echo site_url('lehre/anrechnung/createAnrechnung') ?>' target='_blank'>
|
||||
<i class='fa fa-plus' aria-hidden='true'></i> <?php echo $this->p->t('global', 'antragAnlegen'); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 <a> link
|
||||
},
|
||||
copyIntoTextarea: function(elem){
|
||||
|
||||
// Find closest textarea
|
||||
|
||||
@@ -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'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user