From 2e2d28288a6aa6a832b61f05a6e24d0e5fe6cc52 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Thu, 27 Jul 2017 12:44:13 +0200 Subject: [PATCH] Hide special comments in export --- openslides/motions/static/js/motions/docx.js | 3 ++- openslides/motions/static/js/motions/pdf.js | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/openslides/motions/static/js/motions/docx.js b/openslides/motions/static/js/motions/docx.js index ede74639f..31ba35ac3 100644 --- a/openslides/motions/static/js/motions/docx.js +++ b/openslides/motions/static/js/motions/docx.js @@ -153,7 +153,8 @@ angular.module('OpenSlidesApp.motions.docx', ['OpenSlidesApp.core.docx']) var getMotionComments = function (motion) { var fields = Config.get('motions_comments').value; var canSeeComment = function (index) { - return fields[index].public || operator.hasPerms('motions.can_manage'); + var specialComment = fields[index].forState || fields[index].forRecommendation; + return (fields[index].public || operator.hasPerms('motions.can_manage')) && !specialComment; }; var comments = []; for (var i = 0; i < fields.length; i++) { diff --git a/openslides/motions/static/js/motions/pdf.js b/openslides/motions/static/js/motions/pdf.js index 205bcbca9..3f4f87401 100644 --- a/openslides/motions/static/js/motions/pdf.js +++ b/openslides/motions/static/js/motions/pdf.js @@ -298,7 +298,8 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) if (includeComments) { var fields = Config.get('motions_comments').value; var canSeeComment = function (index) { - return fields[index].public || operator.hasPerms('motions.can_manage'); + var specialComment = fields[index].forState || fields[index].forRecommendation; + return (fields[index].public || operator.hasPerms('motions.can_manage')) && !specialComment; }; var comments = []; for (var i = 0; i < fields.length; i++) { @@ -958,7 +959,8 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) exportComments: function (motion, filename) { var fields = Config.get('motions_comments').value; var canSeeComment = function (index) { - return fields[index].public || operator.hasPerms('motions.can_manage'); + var specialComment = fields[index].forState || fields[index].forRecommendation; + return (fields[index].public || operator.hasPerms('motions.can_manage')) && !specialComment; }; var content = []; for (var i = 0; i < fields.length; i++) {