Disabled recommendation buttons if Lector is not empfehlungsberechtigt

If lector should see Anrechnung but not give a recommendation (because is not the LV-Leitung),
then recommendation buttons are disabled.
This commit is contained in:
Cris
2023-01-11 18:13:14 +01:00
parent 3f4efbcd16
commit f2231fcba2
2 changed files with 7 additions and 3 deletions
@@ -94,10 +94,14 @@ class reviewAnrechnungDetail extends Auth_Controller
// Get Empfehlung data
$empfehlungData = $this->anrechnunglib->getEmpfehlungData($anrechnung_id);
// False if LV-Leitung is present and user is not LV-Leitung. Otherwise always true.
$isEmpfehlungsberechtigt = $this->anrechnunglib->isEmpfehlungsberechtigt($anrechnung_id);
$viewData = array(
'antragData' => $antragData,
'anrechnungData' => $anrechnungData,
'empfehlungData' => $empfehlungData
'empfehlungData' => $empfehlungData,
'isEmpfehlungsberechtigt' => $isEmpfehlungsberechtigt
);
$this->load->view('lehre/anrechnung/reviewAnrechnungDetail.php', $viewData);
@@ -287,12 +287,12 @@ $this->load->view(
<div class="pull-right">
<button id="reviewAnrechnungDetail-dont-recommend-anrechnung-ask" class="btn btn-danger btn-w200"
type="button"
<?php echo is_null($empfehlungData->empfehlung) ? '' : 'disabled' ?>>
<?php echo (is_null($empfehlungData->empfehlung) && $isEmpfehlungsberechtigt) ? '' : 'disabled' ?>>
<?php echo ucfirst($this->p->t('anrechnung', 'nichtEmpfehlen')); ?>
</button>
<button id="reviewAnrechnungDetail-recommend-anrechnung-ask" class="btn btn-primary btn-w200"
type="button"
<?php echo is_null($empfehlungData->empfehlung) ? '' : 'disabled' ?>>
<?php echo (is_null($empfehlungData->empfehlung) && $isEmpfehlungsberechtigt) ? '' : 'disabled' ?>>
<?php echo ucfirst($this->p->t('anrechnung', 'empfehlen')); ?>
</button>
</div>