View | Details | Raw Unified | Return to bug 32888 | Differences between
and this patch

Collapse All | Expand All

(-)ucs-school-umc-distribution/umc/js/distribution/DetailPage.js (-11 / +43 lines)
 Lines 150-155    Link Here 
150
				})
150
				})
151
			}, {
151
			}, {
152
				type: MultiUploader,
152
				type: MultiUploader,
153
				multiFile: true,
153
				name: 'files',
154
				name: 'files',
154
				command: 'distribution/upload',
155
				command: 'distribution/upload',
155
				dynamicOptions: {
156
				dynamicOptions: {
 Lines 312-333    Link Here 
312
		},
313
		},
313
314
314
		_checkFilenameUpload: function(fileInfo) {
315
		_checkFilenameUpload: function(fileInfo) {
316
			var filename;
317
			if ('name' in fileInfo){
318
				filename = [ fileInfo.name ];
319
			}else{
320
				if (fileInfo.length > 1) {
321
					filename = [];
322
					fileInfo.forEach(function(ifile){
323
						filename.push(ifile.name);
324
					});
325
				}
326
			}
315
			var nameWidget = this._form.getWidget('name');
327
			var nameWidget = this._form.getWidget('name');
316
			var isNewProject = !nameWidget.get('disabled');
328
			var isNewProject = !nameWidget.get('disabled');
329
317
			return this.umcpCommand('distribution/checkfiles', {
330
			return this.umcpCommand('distribution/checkfiles', {
318
				project: isNewProject ? null : nameWidget.get('value'),
331
				project: isNewProject ? null : nameWidget.get('value'),
319
				filenames: [ fileInfo.name ]
332
				filenames: filename
320
			}).then(lang.hitch(this, function(response) {
333
			}).then(function(response) {
321
				var result = response.result[0];
334
322
				if (result.distributed) {
335
				var distributed = [];
336
				var projectDuplicate = [];
337
				var sessionDuplicate = [];
338
				var result = response.result;
339
340
				array.forEach(result, lang.hitch(this, function(ifile){
341
					if (ifile.distributed){
342
						distributed.push(ifile.filename);
343
					}
344
					if (ifile.projectDuplicate){
345
						projectDuplicate.push(ifile.filename);
346
					}
347
					if (ifile.sessionDuplicate){
348
						sessionDuplicate.push(ifile.filename);
349
					}
350
				}));
351
352
				if (distributed.length > 0){
323
					// do not allow the upload of an already distributed file
353
					// do not allow the upload of an already distributed file
324
					dialog.alert(_('The file "%s" cannot be uploaded as it has already been distributed.', fileInfo.name));
354
					var files = distributed.join();
355
					dialog.alert(_('The following files cannot be uploaded as they have already been distributed: %s','<ul><li>' + distributed.join('</li><li>') + '</li></ul>'));
325
					return false;
356
					return false;
326
				}
357
				}
327
358
328
				if (result.projectDuplicate) {
359
				if (projectDuplicate.length > 0){
329
					// the file exists in the project, but has not been distributed yet
360
					// a file exists in the project, but has not been distributed yet
330
					return dialog.confirm(_('The file "%s" has already been assigned to the project, please confirm to overwrite it.', fileInfo.name), [{
361
					return dialog.confirm(_('The following files have already been assigned to the project, please confirm to overwrite them: %s','<ul><li>' + projectDuplicate.join('</li><li>') + '</li></ul>'), [{
331
						name: 'cancel',
362
						name: 'cancel',
332
						label: _('Cancel upload')
363
						label: _('Cancel upload')
333
					}, {
364
					}, {
 Lines 339-347    Link Here 
339
					});
370
					});
340
				}
371
				}
341
372
342
				if (result.sessionDuplicate) {
373
				if (sessionDuplicate.length > 0){
343
					// a file with the same name has already been uploaded during this session
374
					// a file with the same name has already been uploaded during this session
344
					return dialog.confirm(_('The file "%s" has already been uploaded, please confirm to overwrite it.', fileInfo.name), [{
375
					return dialog.confirm(_('The following files have already been uploaded, please confirm to overwrite them: %s', '<ul><li>' + sessionDuplicate.join('</li><li>') + '</li></ul>'), [{
345
						name: 'cancel',
376
						name: 'cancel',
346
						label: _('Cancel upload')
377
						label: _('Cancel upload')
347
					}, {
378
					}, {
 Lines 355-361    Link Here 
355
386
356
				// everything OK :)
387
				// everything OK :)
357
				return true;
388
				return true;
358
			}));
389
			});
390
359
		},
391
		},
360
392
361
		_resetForm: function() {
393
		_resetForm: function() {
(-)ucs-school-umc-distribution/umc/js/de.po (-52 / +62 lines)
 Lines 3-9    Link Here 
3
msgstr ""
3
msgstr ""
4
"Project-Id-Version: ucs-school-umc-distribution\n"
4
"Project-Id-Version: ucs-school-umc-distribution\n"
5
"Report-Msgid-Bugs-To: packages@univention.de\n"
5
"Report-Msgid-Bugs-To: packages@univention.de\n"
6
"POT-Creation-Date: 2015-02-16 16:40+0100\n"
6
"POT-Creation-Date: 2015-04-15 13:54+0200\n"
7
"PO-Revision-Date: 2012-05-14 11:48+0200\n"
7
"PO-Revision-Date: 2012-05-14 11:48+0200\n"
8
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
"Language-Team: LANGUAGE <LL@li.org>\n"
9
"Language-Team: LANGUAGE <LL@li.org>\n"
 Lines 32-50    Link Here 
32
msgid "All projects"
32
msgid "All projects"
33
msgstr "Alle Projekte"
33
msgstr "Alle Projekte"
34
34
35
#: umc/js/distribution/DetailPage.js:167
35
#: umc/js/distribution/DetailPage.js:168
36
msgid "Assign classes/workgroups"
36
msgid "Assign classes/workgroups"
37
msgstr "Klassen/Arbeitsgruppen zuordnen"
37
msgstr "Klassen/Arbeitsgruppen zuordnen"
38
38
39
#: umc/js/distribution/DetailPage.js:168
39
#: umc/js/distribution/DetailPage.js:169
40
msgid "Assigned classes/workgroups"
40
msgid "Assigned classes/workgroups"
41
msgstr "Zugeordnete Klassen/Arbeitsgruppen"
41
msgstr "Zugeordnete Klassen/Arbeitsgruppen"
42
42
43
#: umc/js/distribution/DetailPage.js:230
43
#: umc/js/distribution/DetailPage.js:231
44
msgid "Automatic collection"
44
msgid "Automatic collection"
45
msgstr "Automatisches Einsammeln"
45
msgstr "Automatisches Einsammeln"
46
46
47
#: umc/js/distribution/DetailPage.js:205
47
#: umc/js/distribution/DetailPage.js:206
48
msgid "Automatic distribution"
48
msgid "Automatic distribution"
49
msgstr "Automatisches Austeilen"
49
msgstr "Automatisches Austeilen"
50
50
 Lines 57-63    Link Here 
57
msgid "Cancel"
57
msgid "Cancel"
58
msgstr "Abbrechen"
58
msgstr "Abbrechen"
59
59
60
#: umc/js/distribution/DetailPage.js:332 umc/js/distribution/DetailPage.js:346
60
#: umc/js/distribution/DetailPage.js:363 umc/js/distribution/DetailPage.js:377
61
msgid "Cancel upload"
61
msgid "Cancel upload"
62
msgstr "Dateitransfer abbrechen"
62
msgstr "Dateitransfer abbrechen"
63
63
 Lines 73-87    Link Here 
73
msgid "Collect project files from users."
73
msgid "Collect project files from users."
74
msgstr "Projektdateien von Schüler einsammeln."
74
msgstr "Projektdateien von Schüler einsammeln."
75
75
76
#: umc/js/distribution/DetailPage.js:235
76
#: umc/js/distribution/DetailPage.js:236
77
msgid "Collection date"
77
msgid "Collection date"
78
msgstr "Einsammeldatum"
78
msgstr "Einsammeldatum"
79
79
80
#: umc/js/distribution/DetailPage.js:222
80
#: umc/js/distribution/DetailPage.js:223
81
msgid "Collection of project files"
81
msgid "Collection of project files"
82
msgstr "Einsammeln der Projektdateien"
82
msgstr "Einsammeln der Projektdateien"
83
83
84
#: umc/js/distribution/DetailPage.js:240
84
#: umc/js/distribution/DetailPage.js:241
85
msgid "Collection time"
85
msgid "Collection time"
86
msgstr "Einsammelzeit"
86
msgstr "Einsammelzeit"
87
87
 Lines 89-103    Link Here 
89
msgid "Create a new distribution project"
89
msgid "Create a new distribution project"
90
msgstr "Neues Verteilungsprojekt erstellen"
90
msgstr "Neues Verteilungsprojekt erstellen"
91
91
92
#: umc/js/distribution/DetailPage.js:428
92
#: umc/js/distribution/DetailPage.js:460
93
msgid "Create project"
93
msgid "Create project"
94
msgstr "Projekt erstellen"
94
msgstr "Projekt erstellen"
95
95
96
#: umc/js/distribution/DetailPage.js:236
96
#: umc/js/distribution/DetailPage.js:237
97
msgid "Date at which the project files will be collected automatically."
97
msgid "Date at which the project files will be collected automatically."
98
msgstr "Datum, an dem die Projektdateien automatisch eingesammelt werden."
98
msgstr "Datum, an dem die Projektdateien automatisch eingesammelt werden."
99
99
100
#: umc/js/distribution/DetailPage.js:211
100
#: umc/js/distribution/DetailPage.js:212
101
msgid "Date at which the project files will be distributed automatically."
101
msgid "Date at which the project files will be distributed automatically."
102
msgstr "Datum, an dem die Projektdateien automatisch verteilt werden."
102
msgstr "Datum, an dem die Projektdateien automatisch verteilt werden."
103
103
 Lines 121-139    Link Here 
121
msgid "Distribute project files to users."
121
msgid "Distribute project files to users."
122
msgstr "Projektdateien an Schüler verteilen."
122
msgstr "Projektdateien an Schüler verteilen."
123
123
124
#: umc/js/distribution/DetailPage.js:250
124
#: umc/js/distribution/DetailPage.js:251
125
msgid "Distribution and collection of project files"
125
msgid "Distribution and collection of project files"
126
msgstr "Verteilen und Einsammeln der Projektdateien"
126
msgstr "Verteilen und Einsammeln der Projektdateien"
127
127
128
#: umc/js/distribution/DetailPage.js:210
128
#: umc/js/distribution/DetailPage.js:211
129
msgid "Distribution date"
129
msgid "Distribution date"
130
msgstr "Verteilungsdatum"
130
msgstr "Verteilungsdatum"
131
131
132
#: umc/js/distribution/DetailPage.js:197
132
#: umc/js/distribution/DetailPage.js:198
133
msgid "Distribution of project files"
133
msgid "Distribution of project files"
134
msgstr "Verteilen der Projektdateien"
134
msgstr "Verteilen der Projektdateien"
135
135
136
#: umc/js/distribution/DetailPage.js:216
136
#: umc/js/distribution/DetailPage.js:217
137
msgid "Distribution time"
137
msgid "Distribution time"
138
msgstr "Verteilungszeit"
138
msgstr "Verteilungszeit"
139
139
 Lines 153-183    Link Here 
153
msgid "Error: No recipients have been assigned to the project!"
153
msgid "Error: No recipients have been assigned to the project!"
154
msgstr "Fehler: Kein Empfänger wurde für das Projekt ausgewählt!"
154
msgstr "Fehler: Kein Empfänger wurde für das Projekt ausgewählt!"
155
155
156
#: umc/js/distribution/DetailPage.js:159 umc/js/distribution/DetailPage.js:259
156
#: umc/js/distribution/DetailPage.js:160 umc/js/distribution/DetailPage.js:260
157
msgid "Files"
157
msgid "Files"
158
msgstr "Dateien"
158
msgstr "Dateien"
159
159
160
#: umc/js/distribution/DetailPage.js:160
160
#: umc/js/distribution/DetailPage.js:161
161
msgid "Files that have been added to this teaching material project"
161
msgid "Files that have been added to this teaching material project"
162
msgstr "Dateien, die mit Materialverteilungsprojekt verknüpft sind"
162
msgstr "Dateien, die mit Materialverteilungsprojekt verknüpft sind"
163
163
164
#: umc/js/distribution/DetailPage.js:247
164
#: umc/js/distribution/DetailPage.js:248
165
msgid "General"
165
msgid "General"
166
msgstr "Allgemein"
166
msgstr "Allgemein"
167
167
168
#: umc/js/distribution/DetailPage.js:169
168
#: umc/js/distribution/DetailPage.js:170
169
msgid "List of groups that are marked to receive the teaching materials"
169
msgid "List of groups that are marked to receive the teaching materials"
170
msgstr "Liste der Gruppen, die die Projektmaterialien empfangen werden"
170
msgstr "Liste der Gruppen, die die Projektmaterialien empfangen werden"
171
171
172
#: umc/js/distribution/DetailPage.js:227
172
#: umc/js/distribution/DetailPage.js:228
173
msgid "Manual collection"
173
msgid "Manual collection"
174
msgstr "Manuelles Einsammeln"
174
msgstr "Manuelles Einsammeln"
175
175
176
#: umc/js/distribution/DetailPage.js:202
176
#: umc/js/distribution/DetailPage.js:203
177
msgid "Manual distribution"
177
msgid "Manual distribution"
178
msgstr "Manuelles Verteilen"
178
msgstr "Manuelles Verteilen"
179
179
180
#: umc/js/distribution/DetailPage.js:256
180
#: umc/js/distribution/DetailPage.js:257
181
msgid "Members"
181
msgid "Members"
182
msgstr "Mitglieder"
182
msgstr "Mitglieder"
183
183
 Lines 200-206    Link Here 
200
msgid "Only the owner of a project is able to remove it."
200
msgid "Only the owner of a project is able to remove it."
201
msgstr "Nur der Eigentümer eines Projektes kann es entfernen."
201
msgstr "Nur der Eigentümer eines Projektes kann es entfernen."
202
202
203
#: umc/js/distribution/DetailPage.js:335 umc/js/distribution/DetailPage.js:349
203
#: umc/js/distribution/DetailPage.js:366 umc/js/distribution/DetailPage.js:380
204
msgid "Overwrite file"
204
msgid "Overwrite file"
205
msgstr "Datei überschreiben"
205
msgstr "Datei überschreiben"
206
206
 Lines 252-266    Link Here 
252
msgid "Removes the project from the internal database."
252
msgid "Removes the project from the internal database."
253
msgstr "Löscht das Projekt aus der internen Datenbank."
253
msgstr "Löscht das Projekt aus der internen Datenbank."
254
254
255
#: umc/js/distribution/DetailPage.js:84 umc/js/distribution/DetailPage.js:408
255
#: umc/js/distribution/DetailPage.js:84 umc/js/distribution/DetailPage.js:440
256
msgid "Save changes"
256
msgid "Save changes"
257
msgstr "Änderungen speichern"
257
msgstr "Änderungen speichern"
258
258
259
#: umc/js/distribution/DetailPage.js:173
259
#: umc/js/distribution/DetailPage.js:174
260
msgid "School"
260
msgid "School"
261
msgstr "Schule"
261
msgstr "Schule"
262
262
263
#: umc/js/distribution/DetailPage.js:180
263
#: umc/js/distribution/DetailPage.js:181
264
msgid "Search name"
264
msgid "Search name"
265
msgstr "Suchname"
265
msgstr "Suchname"
266
266
 Lines 277-288    Link Here 
277
msgstr ""
277
msgstr ""
278
"Gibt die Zeichenkette an, nach der in den Projektbeschreibungen gesucht wird."
278
"Gibt die Zeichenkette an, nach der in den Projektbeschreibungen gesucht wird."
279
279
280
#: umc/js/distribution/DetailPage.js:223
280
#: umc/js/distribution/DetailPage.js:224
281
msgid ""
281
msgid ""
282
"Specifies whether the project data is collected automatically or manually."
282
"Specifies whether the project data is collected automatically or manually."
283
msgstr "Gibt an, ob das Projekte automatisch oder manuell eingesammelt wird."
283
msgstr "Gibt an, ob das Projekte automatisch oder manuell eingesammelt wird."
284
284
285
#: umc/js/distribution/DetailPage.js:198
285
#: umc/js/distribution/DetailPage.js:199
286
msgid ""
286
msgid ""
287
"Specifies whether the project data is distributed automatically or manually."
287
"Specifies whether the project data is distributed automatically or manually."
288
msgstr "Gibt an, ob das Projekte automatisch oder manuell verteilt wird."
288
msgstr "Gibt an, ob das Projekte automatisch oder manuell verteilt wird."
 Lines 295-336    Link Here 
295
msgid "The description of the teaching material project"
295
msgid "The description of the teaching material project"
296
msgstr "Die Beschreibung des Materialverteilungsprojekts"
296
msgstr "Die Beschreibung des Materialverteilungsprojekts"
297
297
298
#: umc/js/distribution/DetailPage.js:324
298
#: umc/js/distribution.js:320 umc/js/distribution.js:384
299
#, python-format
299
#, python-format
300
msgid "The file \"%s\" cannot be uploaded as it has already been distributed."
300
msgid "The following error occurred: %s"
301
msgstr ""
301
msgstr "Der folgende Fehler trat auf: %s"
302
"Die Datei \"%s\" kann nicht übertragen werden, da sie bereits verteilt wurde"
303
302
304
#: umc/js/distribution/DetailPage.js:330
303
#: umc/js/distribution/DetailPage.js:306
305
#, python-format
304
#, python-format
306
msgid ""
305
msgid ""
307
"The file \"%s\" has already been assigned to the project, please confirm to "
306
"The following files cannot be removed as they have already been distributed: "
308
"overwrite it."
307
"%s"
309
msgstr ""
308
msgstr ""
310
"Die Datei \"%s\" wurde bereits dem Projekt hinzugefügt. Bitte bestätigen "
309
"Die folgenden Dateien können nicht entfernt werden, da sie bereits verteilt "
311
"Sie, um die vorhandene Datei zu überschreiben."
310
"wurden."
312
311
313
#: umc/js/distribution/DetailPage.js:344
312
#: umc/js/distribution/DetailPage.js:355
314
#, python-format
313
#, python-format
315
msgid ""
314
msgid ""
316
"The file \"%s\" has already been uploaded, please confirm to overwrite it."
315
"The following files cannot be uploaded as they have already been "
316
"distributed: %s"
317
msgstr ""
317
msgstr ""
318
"Die Datei \"%s\" wurde bereits während der Sitzung hochgeladen. Bitte "
318
"Die folgenden Dateien können nicht hochgeladen werden, da sie bereits verteilt "
319
"bestätigen Sie, um die vorhandene Datei zu überschreiben."
319
"wurden: %s"
320
320
321
#: umc/js/distribution.js:320 umc/js/distribution.js:384
321
#: umc/js/distribution/DetailPage.js:361
322
#, python-format
322
#, python-format
323
msgid "The following error occurred: %s"
323
msgid ""
324
msgstr "Der folgende Fehler trat auf: %s"
324
"The following files have already been assigned to the project, please "
325
"confirm to overwrite them: %s"
326
msgstr ""
327
"Die folgenden Dateien wurde bereits dem Projekt hinzugefügt. Bitte bestätigen "
328
"Sie, um die vorhandenen Dateien zu überschreiben: %s"
325
329
326
#: umc/js/distribution/DetailPage.js:305
330
#: umc/js/distribution/DetailPage.js:375
327
#, python-format
331
#, python-format
328
msgid ""
332
msgid ""
329
"The following files cannot be removed as they have already been distributed: "
333
"The following files have already been uploaded, please confirm to overwrite "
330
"%s"
334
"them: %s"
331
msgstr ""
335
msgstr ""
332
"Die folgenden Dateien können nicht entfernt werden, da sie bereits verteilt "
336
"Die folgenden Dateien wurde bereits während der Sitzung hochgeladen. Bitte "
333
"wurden."
337
"bestätigen Sie, um die vorhandenen Dateien zu überschreiben: %s"
334
338
335
#: umc/js/distribution/DetailPage.js:132
339
#: umc/js/distribution/DetailPage.js:132
336
msgid ""
340
msgid ""
 Lines 354-364    Link Here 
354
"Diese Seite ermöglicht es, Eigenschaften eines bestehenden oder neuen "
358
"Diese Seite ermöglicht es, Eigenschaften eines bestehenden oder neuen "
355
"Materialverteilungsprojekts zu bearbeiten."
359
"Materialverteilungsprojekts zu bearbeiten."
356
360
357
#: umc/js/distribution/DetailPage.js:241
361
#: umc/js/distribution/DetailPage.js:242
358
msgid "Time at which the project files will be collected automatically."
362
msgid "Time at which the project files will be collected automatically."
359
msgstr "Zeit, zu der die Projektdateien automatisch eingesammelt werden."
363
msgstr "Zeit, zu der die Projektdateien automatisch eingesammelt werden."
360
364
361
#: umc/js/distribution/DetailPage.js:217
365
#: umc/js/distribution/DetailPage.js:218
362
msgid "Time at which the project files will be distributed automatically."
366
msgid "Time at which the project files will be distributed automatically."
363
msgstr "Zeit, zu der die Projektdateien automatisch verteilt werden."
367
msgstr "Zeit, zu der die Projektdateien automatisch verteilt werden."
364
368
 Lines 396-401    Link Here 
396
#~ msgstr "Speichern"
400
#~ msgstr "Speichern"
397
401
398
#~ msgid ""
402
#~ msgid ""
403
#~ "The file \"%s\" cannot be uploaded as it has already been distributed."
404
#~ msgstr ""
405
#~ "Die Datei \"%s\" kann nicht übertragen werden, da sie bereits verteilt "
406
#~ "wurde"
407
408
#~ msgid ""
399
#~ "This page demonstrates how object properties can be viewed for editing."
409
#~ "This page demonstrates how object properties can be viewed for editing."
400
#~ msgstr "Diese "
410
#~ msgstr "Diese "
401
411
(-)ucs-school-umc-distribution/umc/python/distribution/de.po (-21 / +21 lines)
 Lines 3-9    Link Here 
3
msgstr ""
3
msgstr ""
4
"Project-Id-Version: ucs-school-umc-distribution\n"
4
"Project-Id-Version: ucs-school-umc-distribution\n"
5
"Report-Msgid-Bugs-To: packages@univention.de\n"
5
"Report-Msgid-Bugs-To: packages@univention.de\n"
6
"POT-Creation-Date: 2014-08-15 11:21+0200\n"
6
"POT-Creation-Date: 2015-04-15 13:54+0200\n"
7
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
7
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
"Language-Team: LANGUAGE <LL@li.org>\n"
9
"Language-Team: LANGUAGE <LL@li.org>\n"
 Lines 16-37    Link Here 
16
msgid "A valid project owner needs to be specified."
16
msgid "A valid project owner needs to be specified."
17
msgstr "Für ein gültiges Projekt muss ein Besitzer definiert sein."
17
msgstr "Für ein gültiges Projekt muss ein Besitzer definiert sein."
18
18
19
#: umc/python/distribution/__init__.py:173
19
#: umc/python/distribution/__init__.py:197
20
#, python-format
20
#, python-format
21
msgid "Could not authenticate user \"%s\"!"
21
msgid "Could not authenticate user \"%s\"!"
22
msgstr "Der Benutzer konnte nicht authentifizieren werden: \"%s\"!"
22
msgstr "Der Benutzer konnte nicht authentifizieren werden: \"%s\"!"
23
23
24
#: umc/python/distribution/util.py:439
24
#: umc/python/distribution/util.py:437
25
#, python-format
25
#, python-format
26
msgid "Could not save project file: %s (%s)"
26
msgid "Could not save project file: %s (%s)"
27
msgstr "Das Projekt konnte nicht gespeichert werden: %s (%s)"
27
msgstr "Das Projekt konnte nicht gespeichert werden: %s (%s)"
28
28
29
#: umc/python/distribution/__init__.py:226
29
#: umc/python/distribution/__init__.py:253
30
#, python-format
30
#, python-format
31
msgid "Could not set date for: %s"
31
msgid "Could not set date for: %s"
32
msgstr "Die Zeit konnte nicht gesetzt werden: %s"
32
msgstr "Die Zeit konnte nicht gesetzt werden: %s"
33
33
34
#: umc/python/distribution/__init__.py:238
34
#: umc/python/distribution/__init__.py:265
35
msgid ""
35
msgid ""
36
"Distributing the data needs to happen sufficiently long enough before "
36
"Distributing the data needs to happen sufficiently long enough before "
37
"collecting them"
37
"collecting them"
 Lines 39-72    Link Here 
39
"Die Verteilung der Daten muss ausreichend lange vor ihrem Einsammeln "
39
"Die Verteilung der Daten muss ausreichend lange vor ihrem Einsammeln "
40
"geschehen"
40
"geschehen"
41
41
42
#: umc/python/distribution/__init__.py:171
42
#: umc/python/distribution/__init__.py:195
43
#, python-format
43
#, python-format
44
msgid "Failed to load user information: %s"
44
msgid "Failed to load user information: %s"
45
msgstr "Das Laden der Benutzerinformationen schlug fehl: %s"
45
msgstr "Das Laden der Benutzerinformationen schlug fehl: %s"
46
46
47
#: umc/python/distribution/__init__.py:557
47
#: umc/python/distribution/__init__.py:584
48
msgid "Only the owner himself or an administrator may delete a project."
48
msgid "Only the owner himself or an administrator may delete a project."
49
msgstr ""
49
msgstr ""
50
"Nur der Eigentümer selbst oder ein Administrator können ein Projekt löschen."
50
"Nur der Eigentümer selbst oder ein Administrator können ein Projekt löschen."
51
51
52
#: umc/python/distribution/__init__.py:426
52
#: umc/python/distribution/__init__.py:453
53
msgid "Only the owner himself or an administrator may distribute a project."
53
msgid "Only the owner himself or an administrator may distribute a project."
54
msgstr ""
54
msgstr ""
55
"Nur der Eigentümer selbst oder ein Administrator können ein Projekt "
55
"Nur der Eigentümer selbst oder ein Administrator können ein Projekt "
56
"austeilen."
56
"austeilen."
57
57
58
#: umc/python/distribution/__init__.py:421
58
#: umc/python/distribution/__init__.py:448
59
#: umc/python/distribution/__init__.py:473
59
#: umc/python/distribution/__init__.py:500
60
#: umc/python/distribution/__init__.py:520
60
#: umc/python/distribution/__init__.py:547
61
#, python-format
61
#, python-format
62
msgid "Project \"%s\" could not be loaded"
62
msgid "Project \"%s\" could not be loaded"
63
msgstr "Das Projekt \"%s\" konnte nicht geladen werden"
63
msgstr "Das Projekt \"%s\" konnte nicht geladen werden"
64
64
65
#: umc/python/distribution/__init__.py:215
65
#: umc/python/distribution/__init__.py:242
66
msgid "Project collection"
66
msgid "Project collection"
67
msgstr "Projekteinsammlung"
67
msgstr "Projekteinsammlung"
68
68
69
#: umc/python/distribution/__init__.py:365
69
#: umc/python/distribution/__init__.py:392
70
msgid ""
70
msgid ""
71
"Project details are only visible to the project owner himself or an "
71
"Project details are only visible to the project owner himself or an "
72
"administrator."
72
"administrator."
 Lines 74-84    Link Here 
74
"Projekteigenschaften sind nur sichtbar für den Eigentümer selbst oder einen "
74
"Projekteigenschaften sind nur sichtbar für den Eigentümer selbst oder einen "
75
"Administrator."
75
"Administrator."
76
76
77
#: umc/python/distribution/__init__.py:215
77
#: umc/python/distribution/__init__.py:242
78
msgid "Project distribution"
78
msgid "Project distribution"
79
msgstr "Projektverteilung"
79
msgstr "Projektverteilung"
80
80
81
#: umc/python/distribution/__init__.py:486
81
#: umc/python/distribution/__init__.py:513
82
#, python-format
82
#, python-format
83
msgid "The following user directories could not been collected: %s"
83
msgid "The following user directories could not been collected: %s"
84
msgstr ""
84
msgstr ""
 Lines 92-103    Link Here 
92
msgid "The given project directory name must be non-empty."
92
msgid "The given project directory name must be non-empty."
93
msgstr "Das angegebene Projektverzeichnis darf nicht leer sein."
93
msgstr "Das angegebene Projektverzeichnis darf nicht leer sein."
94
94
95
#: umc/python/distribution/__init__.py:212
95
#: umc/python/distribution/__init__.py:239
96
msgid "The project can only be modified by the owner himself"
96
msgid "The project can only be modified by the owner himself"
97
msgstr "Ein Projekt kann nur durch den Eigentümer selbst bearbeitet werden"
97
msgstr "Ein Projekt kann nur durch den Eigentümer selbst bearbeitet werden"
98
98
99
#: umc/python/distribution/__init__.py:290
99
#: umc/python/distribution/__init__.py:317
100
#: umc/python/distribution/__init__.py:436
100
#: umc/python/distribution/__init__.py:463
101
#, python-format
101
#, python-format
102
msgid "The project could not distributed to the following users: %s"
102
msgid "The project could not distributed to the following users: %s"
103
msgstr ""
103
msgstr ""
 Lines 131-149    Link Here 
131
msgstr ""
131
msgstr ""
132
"Das angegebene Projektverzeichnis muss verschieden sein von \".\" and \"..\"."
132
"Das angegebene Projektverzeichnis muss verschieden sein von \".\" and \"..\"."
133
133
134
#: umc/python/distribution/__init__.py:257
134
#: umc/python/distribution/__init__.py:284
135
#, python-format
135
#, python-format
136
msgid ""
136
msgid ""
137
"The specified project directory name \"%s\" is already in use by a different "
137
"The specified project directory name \"%s\" is already in use by a different "
138
"project."
138
"project."
139
msgstr "Das angegebene Projektverzeichnis \"%s\" wird bereits verwendet."
139
msgstr "Das angegebene Projektverzeichnis \"%s\" wird bereits verwendet."
140
140
141
#: umc/python/distribution/__init__.py:201
141
#: umc/python/distribution/__init__.py:228
142
#, python-format
142
#, python-format
143
msgid "The specified project does not exist: %s"
143
msgid "The specified project does not exist: %s"
144
msgstr "Das angegebene Projekt existiert nicht: %s"
144
msgstr "Das angegebene Projekt existiert nicht: %s"
145
145
146
#: umc/python/distribution/__init__.py:230
146
#: umc/python/distribution/__init__.py:257
147
#, python-format
147
#, python-format
148
msgid "The specified time needs to lie in the future for: %s"
148
msgid "The specified time needs to lie in the future for: %s"
149
msgstr "Die angegebene Zeit muss in der Zukunft liegen: %s"
149
msgstr "Die angegebene Zeit muss in der Zukunft liegen: %s"
(-)ucs-school-umc-distribution/umc/python/distribution/__init__.py (-13 / +16 lines)
 Lines 72-93    Link Here 
72
	@file_upload
72
	@file_upload
73
	def upload(self, request):
73
	def upload(self, request):
74
		# make sure that we got a list
74
		# make sure that we got a list
75
		MODULE.info('### upload: %r' % (request, ))
76
		MODULE.info('### upload options: %r' % (request.options, ))
75
		if not isinstance(request.options, (tuple, list)):
77
		if not isinstance(request.options, (tuple, list)):
76
			raise UMC_OptionTypeError( 'Expected list of dicts, but got: %s' % str(request.options) )
78
			raise UMC_OptionTypeError( 'Expected list of dicts, but got: %s' % str(request.options) )
77
		file = request.options[0]
78
		if not ('tmpfile' in file and 'filename' in file):
79
			raise UMC_OptionTypeError( 'Invalid upload data, got: %s' % str(file) )
80
79
81
		# create a temporary upload directory, if it does not already exist
80
		#file = request.options[0]
82
		if not self._tmpDir:
81
		for file in request.options:
83
			self._tmpDir = tempfile.mkdtemp(prefix='ucsschool-distribution-upload-')
82
			if not ('tmpfile' in file and 'filename' in file):
84
			MODULE.info('Created temporary directory: %s' % self._tmpDir)
83
				raise UMC_OptionTypeError( 'Invalid upload data, got: %s' % str(file) )
85
84
86
		filename = self.__workaround_filename_bug(file)
85
			# create a temporary upload directory, if it does not already exist
87
		destPath = os.path.join(self._tmpDir, filename)
86
			if not self._tmpDir:
88
		MODULE.info('Received file %r, saving it to %r' % (file['tmpfile'], destPath))
87
				self._tmpDir = tempfile.mkdtemp(prefix='ucsschool-distribution-upload-')
89
		shutil.move(file['tmpfile'], destPath)
88
				MODULE.info('Created temporary directory: %s' % self._tmpDir)
90
89
90
			filename = self.__workaround_filename_bug(file)
91
			destPath = os.path.join(self._tmpDir, filename)
92
			MODULE.info('Received file %r, saving it to %r' % (file['tmpfile'], destPath))
93
			shutil.move(file['tmpfile'], destPath)
94
91
		# done
95
		# done
92
		self.finished( request.id, None )
96
		self.finished( request.id, None )
93
97
 Lines 135-140    Link Here 
135
		if request.options.get('project'):
139
		if request.options.get('project'):
136
			project = util.Project.load(request.options.get('project'))
140
			project = util.Project.load(request.options.get('project'))
137
141
142
138
		result = []
143
		result = []
139
		for ifile in request.options.get('filenames'):
144
		for ifile in request.options.get('filenames'):
140
			ifile = ifile.encode('UTF-8')
145
			ifile = ifile.encode('UTF-8')
 Lines 148-156    Link Here 
148
			if project:
153
			if project:
149
				iresult['projectDuplicate'] = ifile in project.files
154
				iresult['projectDuplicate'] = ifile in project.files
150
				iresult['distributed'] = ifile in project.files and not os.path.exists(os.path.join(project.cachedir, ifile))
155
				iresult['distributed'] = ifile in project.files and not os.path.exists(os.path.join(project.cachedir, ifile))
151
152
			result.append(iresult)
156
			result.append(iresult)
153
154
		# done :)
157
		# done :)
155
		self.finished( request.id, result )
158
		self.finished( request.id, result )
156
159

Return to bug 32888