ItEr37S11CUAdministracionMateriaisItEr36S13: Show all materials if not category is selected
This commit is contained in:
parent
5a9d27bbd5
commit
a3a8e55ae2
3 changed files with 14 additions and 2 deletions
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
package org.navalplanner.web.materials;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.navalplanner.business.common.exceptions.ValidationException;
|
||||
|
|
@ -38,16 +39,18 @@ public interface IMaterialsModel {
|
|||
|
||||
void addMaterialToMaterialCategory(MaterialCategory materialCategory);
|
||||
|
||||
void confirmRemoveMaterialCategory(MaterialCategory materialCategory);
|
||||
|
||||
void confirmSave() throws ValidationException;
|
||||
|
||||
MutableTreeModel<MaterialCategory> getMaterialCategories();
|
||||
|
||||
Collection<? extends Material> getMaterials();
|
||||
|
||||
List<Material> getMaterials(MaterialCategory materialCategory);
|
||||
|
||||
void reloadMaterialCategories();
|
||||
|
||||
void removeMaterial(Material material);
|
||||
|
||||
void confirmRemoveMaterialCategory(MaterialCategory materialCategory);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -378,6 +378,8 @@ public class MaterialsController extends
|
|||
final List<Material> result = new ArrayList<Material>();
|
||||
if (treeitem != null) {
|
||||
result.addAll(getMaterials((MaterialCategory) treeitem.getValue()));
|
||||
} else {
|
||||
result.addAll(materialsModel.getMaterials());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.navalplanner.web.materials;
|
|||
import static org.navalplanner.web.I18nHelper._;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
@ -168,4 +169,10 @@ public class MaterialsModel implements IMaterialsModel {
|
|||
material.getCategory().removeMaterial(material);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public Collection<? extends Material> getMaterials() {
|
||||
return materialDAO.getAll();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue