From 3768b4273321a0c59f82fb3012ae2c7eb84bdd27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Ho=CC=88=C3=9Fl?= Date: Sun, 17 Nov 2024 09:45:44 +0100 Subject: [PATCH] Allow using the agenda item in ODT export --- views/amendment/LayoutHelper.php | 1 + views/motion/LayoutHelper.php | 1 + 2 files changed, 2 insertions(+) diff --git a/views/amendment/LayoutHelper.php b/views/amendment/LayoutHelper.php index d98abc28d..e5e8836d3 100644 --- a/views/amendment/LayoutHelper.php +++ b/views/amendment/LayoutHelper.php @@ -335,6 +335,7 @@ public static function printAmendmentToOdt(Amendment $amendment, \CatoTH\HTML2Op } $initiatorStr .= ': ' . implode(', ', $initiators); $doc->addReplace('/\{\{ANTRAGSGRUEN:TITLE\}\}/siu', $amendment->getTitle()); + $doc->addReplace('/\{\{ANTRAGSGRUEN:AGENDA\}\}/siu', ($amendment->getMyAgendaItem() ? $amendment->getMyAgendaItem()->title : '')); $doc->addReplace('/\{\{ANTRAGSGRUEN:INITIATORS\}\}/siu', $initiatorStr); if ($amendment->getMyMotionType()->getSettingsObj()->showProposalsInExports && $amendment->proposalStatus !== null && $amendment->isProposalPublic()) { $doc->addReplace('/\{\{ANTRAGSGRUEN:STATUS\}\}/siu', \Yii::t('export', 'proposed_procedure') . ': ' . strip_tags($amendment->getFormattedProposalStatus(false))); diff --git a/views/motion/LayoutHelper.php b/views/motion/LayoutHelper.php index 308513556..65a5a274a 100644 --- a/views/motion/LayoutHelper.php +++ b/views/motion/LayoutHelper.php @@ -1061,6 +1061,7 @@ public static function printMotionToOdt(Motion $motion, \CatoTH\HTML2OpenDocumen $initiatorStr = \Yii::t('export', 'InitiatorMulti'); } $initiatorStr .= ': ' . implode(', ', $initiators); + $doc->addReplace('/\{\{ANTRAGSGRUEN:AGENDA\}\}/siu', ($motion->getMyAgendaItem() ? $motion->getMyAgendaItem()->title : '')); $doc->addReplace('/\{\{ANTRAGSGRUEN:TITLE\}\}/siu', $motion->getTitleWithPrefix()); $doc->addReplace('/\{\{ANTRAGSGRUEN:INITIATORS\}\}/siu', $initiatorStr); if ($motion->getMyMotionType()->getSettingsObj()->showProposalsInExports && $motion->proposalStatus !== null && $motion->isProposalPublic()) {