Skip to content
Snippets Groups Projects
Commit e08a0b21 authored by srosse's avatar srosse
Browse files

OO-1906: check if the question type already exists in the validate method, wording

parent 73414ac8
No related branches found
No related tags found
No related merge requests found
...@@ -213,8 +213,9 @@ public class PoolsAdminController extends FormBasicController { ...@@ -213,8 +213,9 @@ public class PoolsAdminController extends FormBasicController {
poolEditCtrl = new PoolEditController(ureq, getWindowControl(), pool); poolEditCtrl = new PoolEditController(ureq, getWindowControl(), pool);
listenTo(poolEditCtrl); listenTo(poolEditCtrl);
String title = pool == null ? translate("create.pool") : translate("edit.pool");
cmc = new CloseableModalController(getWindowControl(), translate("close"), cmc = new CloseableModalController(getWindowControl(), translate("close"),
poolEditCtrl.getInitialComponent(), true, translate("edit.pool")); poolEditCtrl.getInitialComponent(), true, title);
cmc.activate(); cmc.activate();
listenTo(cmc); listenTo(cmc);
} }
......
...@@ -81,6 +81,12 @@ public class QItemTypeEditController extends FormBasicController { ...@@ -81,6 +81,12 @@ public class QItemTypeEditController extends FormBasicController {
if(!StringHelper.containsNonWhitespace(nameEl.getValue())) { if(!StringHelper.containsNonWhitespace(nameEl.getValue())) {
nameEl.setErrorKey("form.mandatory.hover", null); nameEl.setErrorKey("form.mandatory.hover", null);
allOk = false; allOk = false;
} else if(itemType == null) {
QItemType type = qpoolService.getItemType(nameEl.getValue());
if(type != null) {
nameEl.setErrorKey("error.item.type.unique", null);
allOk = false;
}
} }
return allOk && super.validateFormLogic(ureq); return allOk && super.validateFormLogic(ureq);
......
...@@ -19,6 +19,7 @@ delete.type.confirm=Wollen Sie wirklich diesen Typ l\u00F6schen? ...@@ -19,6 +19,7 @@ delete.type.confirm=Wollen Sie wirklich diesen Typ l\u00F6schen?
edit.taxonomyLevel=Fachbereich bearbeiten edit.taxonomyLevel=Fachbereich bearbeiten
educational.context.deleted=Fachbereich wurde erfolgreich gel\u00F6scht educational.context.deleted=Fachbereich wurde erfolgreich gel\u00F6scht
educational.context.notdeleted=Fachbereich konnte nicht gel\u00F6scht werden, eventuell wird er bereits verwendet educational.context.notdeleted=Fachbereich konnte nicht gel\u00F6scht werden, eventuell wird er bereits verwendet
error.item.type.unique=Ein Fragetyp mit diesem Name existiert schon.
item.type.deleted=Fragetyp wurde erfolgreich gel\u00F6scht item.type.deleted=Fragetyp wurde erfolgreich gel\u00F6scht
item.type.notdeleted=Fragetyp konnte nicht gel\u00F6scht werden, eventuell wird er bereits verwendet item.type.notdeleted=Fragetyp konnte nicht gel\u00F6scht werden, eventuell wird er bereits verwendet
level.key=ID level.key=ID
......
...@@ -19,6 +19,7 @@ delete.type.confirm=Do you really want to delete this type? ...@@ -19,6 +19,7 @@ delete.type.confirm=Do you really want to delete this type?
edit.taxonomyLevel=Edit subject edit.taxonomyLevel=Edit subject
educational.context.deleted=Subject has been successfully deleted. educational.context.deleted=Subject has been successfully deleted.
educational.context.notdeleted=Subject cannot be deleted, it is probably in use. educational.context.notdeleted=Subject cannot be deleted, it is probably in use.
error.item.type.unique=A question type with this name already exists.
item.type.deleted=Type has been successfully deleted. item.type.deleted=Type has been successfully deleted.
item.type.notdeleted=Type cannot be deleted, it is probably in use. item.type.notdeleted=Type cannot be deleted, it is probably in use.
level.key=ID level.key=ID
......
...@@ -19,6 +19,7 @@ delete.type.confirm=Voulez-vous vraiment effacer ce type? ...@@ -19,6 +19,7 @@ delete.type.confirm=Voulez-vous vraiment effacer ce type?
edit.taxonomyLevel=Editer le sujet edit.taxonomyLevel=Editer le sujet
educational.context.deleted=Le sujet a \u00E9t\u00E9 effac\u00E9 avec succ\u00E8s. educational.context.deleted=Le sujet a \u00E9t\u00E9 effac\u00E9 avec succ\u00E8s.
educational.context.notdeleted=Le sujet n'a pas pu \u00EAtre effac\u00E9, il est probablement utilis\u00E9. educational.context.notdeleted=Le sujet n'a pas pu \u00EAtre effac\u00E9, il est probablement utilis\u00E9.
error.item.type.unique=Un type de question avec ce nom existe déjà.
item.type.deleted=Le type a \u00E9t\u00E9 effac\u00E9 avec succ\u00E8s. item.type.deleted=Le type a \u00E9t\u00E9 effac\u00E9 avec succ\u00E8s.
item.type.notdeleted=Le type n'a pas pu \u00EAtre effac\u00E9 avec succ\u00E8s, il est probablement encore utilis\u00E9. item.type.notdeleted=Le type n'a pas pu \u00EAtre effac\u00E9 avec succ\u00E8s, il est probablement encore utilis\u00E9.
level.key=ID level.key=ID
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment