From a733f2edb4f1c796c8c3fa57bc5e20966b47f9bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Thu, 1 Mar 2018 11:21:23 +0100 Subject: [PATCH] Improved motion import/export (Fix #3614). - Fix motion import if names of paricipants are sorted by surname. - Support multiple submitters in motion export csv. --- openslides/motions/static/js/motions/csv.js | 8 ++++++-- openslides/motions/static/js/motions/site.js | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/openslides/motions/static/js/motions/csv.js b/openslides/motions/static/js/motions/csv.js index 68c2414ca..4e3e5c8ad 100644 --- a/openslides/motions/static/js/motions/csv.js +++ b/openslides/motions/static/js/motions/csv.js @@ -82,8 +82,12 @@ angular.module('OpenSlidesApp.motions.csv', []) // Submitters if (params.include.submitters) { - var submitters = motion.submitters[0] ? motion.submitters[0].get_full_name() : ''; - row.push('"' + submitters + '"'); + var submitters = []; + angular.forEach(motion.submitters, function(user) { + var user_short_name = [user.title, user.first_name, user.last_name].join(' ').trim(); + submitters.push(user_short_name); + }); + row.push('"' + submitters.join('; ') + '"'); } // Category diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index 1bc451aec..b88b4ca21 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -2119,7 +2119,8 @@ angular.module('OpenSlidesApp.motions.site', [ // submitter if (motion.submitter && motion.submitter !== '') { angular.forEach(User.getAll(), function (user) { - if (user.short_name == motion.submitter.trim()) { + var user_short_name = [user.title, user.first_name, user.last_name].join(' ').trim(); + if (user_short_name == motion.submitter.trim()) { motion.submitters_id = [user.id]; motion.submitter = user.full_name; }