Improved motion import/export (Fix #3614).

- Fix motion import if names of paricipants are sorted by surname.
- Support multiple submitters in motion export csv.
This commit is contained in:
Emanuel Schütze 2018-03-01 11:21:23 +01:00
parent d185e05ab1
commit a733f2edb4
2 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -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;
}