Skip to content

Commit

Permalink
no upload button if approved, show download link instead
Browse files Browse the repository at this point in the history
  • Loading branch information
mrothauer committed Dec 6, 2024
1 parent dbabd0b commit 2f2739c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/Model/Table/WorkshopsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ public function transformForDropdown($workshops)

public function getFundingContain() {
return [
'WorkshopFundings.OwnerUsers',
'WorkshopFundings' => [
'OwnerUsers',
'FundinguploadsZuwendungsbestaetigungs',
],
'FundingAllPastEvents' => function (Query $q) {
return $q->select(['workshop_uid', 'count' => $q->func()->count('*')])->groupBy('workshop_uid');
},
Expand Down
21 changes: 14 additions & 7 deletions templates/element/funding/zuwendungsbestaetigungInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

echo '<span style="margin-right:5px;">Downloads:</span>';

if ($funding->zuwendungsbestaetigung_status == Funding::STATUS_VERIFIED_BY_ADMIN) {
echo $this->Html->link('Zuwendungsbestätigung', $this->Html->urlFundinguploadDetail($funding->fundinguploads_zuwendungsbestaetigungs[0]->id), ['target' => '_blank']);
echo ' / ';
}

echo $this->Html->link(
'Formular-Vorlage Zuwendungsbestätigung',
'https://anstiftung.de/images/vorlage_zuwendungsbestaetigung_geldzuwendung.pdf',
Expand All @@ -32,11 +37,13 @@
echo '</div>';

echo '<div style="margin-top:10px;">';
echo $this->Html->link(
'Upload-Formular der Zuwendungsbestätigung',
$this->Html->urlFundingsUploadZuwendungsbestaetigung($funding->uid),
[
'class' => 'button',
],
);
if ($funding->zuwendungsbestaetigung_status != Funding::STATUS_VERIFIED_BY_ADMIN) {
echo $this->Html->link(
'Upload-Formular der Zuwendungsbestätigung',
$this->Html->urlFundingsUploadZuwendungsbestaetigung($funding->uid),
[
'class' => 'button',
],
);
}
echo '</div>';

0 comments on commit 2f2739c

Please sign in to comment.