Do UserServis byla přidána metoda getUsersForCombo, která vrátí seznam

uživatelů podle abecedy. Volá se pro plnění comboboxů u filtrů a na
formuláři pro zadání žádosti o služební cestu- combo spolucestující.
closes #191
Verze_1.0
Josef Rokos 10 years ago
parent 537cc563ac
commit f4fe974931

@ -27,5 +27,6 @@ public interface UserService extends UserDetailsService, Service<User> {
public void setUserSettings(UserSettingsData settings); public void setUserSettings(UserSettingsData settings);
public void setAuthMethod(AuthMethod method); public void setAuthMethod(AuthMethod method);
public AuthMethod getAuthMethod(); public AuthMethod getAuthMethod();
public List<User> getUsersForCombo();
} }

@ -230,4 +230,12 @@ public class UserServiceImpl extends AbstractService<User> implements UserServic
} }
} }
@SuppressWarnings("unchecked")
@Override
@Transactional
public List<User> getUsersForCombo() {
Query q = dao.getQuery("from User u order by u.lastName");
return q.list();
}
} }

@ -25,7 +25,7 @@ public class RequirementSubpage<T extends RequirementBase> extends ListViewModel
public List<User> getAllUsers() public List<User> getAllUsers()
{ {
return userService.getAll(); return userService.getUsersForCombo();
} }
private BigDecimalConverter bigDecimalConverter; private BigDecimalConverter bigDecimalConverter;

@ -42,7 +42,7 @@ public class TripRequirementForm extends FormViewModel<TripRequirement> {
public void init() { public void init() {
tripRequirementService.loadType(getDataBean()); tripRequirementService.loadType(getDataBean());
centres = reqTypeService.filterCentres(getDataBean().getType(), workgroupService.getUserCentres(userService.getCurrent())); centres = reqTypeService.filterCentres(getDataBean().getType(), workgroupService.getUserCentres(userService.getCurrent()));
users = userService.getAll(); users = userService.getUsersForCombo();
passengers = getDataBean().getPassengers(); passengers = getDataBean().getPassengers();
validator = new TripRequirementFormValidator(); validator = new TripRequirementFormValidator();
} }

@ -312,6 +312,7 @@ DateTimeFormat=dd. MM. yyyy, HH:MM:ss
AddItem=Přidat položku AddItem=Přidat položku
SelectGroup=Vybrat skupinu... SelectGroup=Vybrat skupinu...
RemoveItem=Smazat RemoveItem=Smazat
Confirm=Potvrdit
StudentProject = Studentský projekt StudentProject = Studentský projekt
StudentProjectAbr = St. projekt StudentProjectAbr = St. projekt

@ -129,7 +129,7 @@
<comboitem label="@load(each)"/> <comboitem label="@load(each)"/>
</template> </template>
</combobox> </combobox>
<button label="${labels.AddItem}" <button label="${labels.Confirm}"
onClick="@command('addPassanger')" onClick="@command('addPassanger')"
sclass="nicebutton" sclass="nicebutton"
disabled="@load(vm.selUser eq null)"/> disabled="@load(vm.selUser eq null)"/>

Loading…
Cancel
Save