Bug #1500: Fix material needed at date report only showing information in projects with permissions
FEA: ItEr76S04BugFixing
This commit is contained in:
parent
e86bcb4647
commit
c1f9ca8804
2 changed files with 16 additions and 12 deletions
|
|
@ -22,6 +22,7 @@
|
|||
package org.libreplan.business.materials.daos;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
|
@ -136,6 +137,9 @@ public class MaterialDAO extends IntegrationEntityDAO<Material> implements
|
|||
public List<MaterialAssignment> getFilterMaterial(
|
||||
MaterialStatusEnum filterStatus, List<Order> orders,
|
||||
List<MaterialCategory> categories, List<Material> materials) {
|
||||
if (orders.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
boolean addedWhere = false;
|
||||
boolean addfilterCategory = false;
|
||||
|
|
@ -163,14 +167,14 @@ public class MaterialDAO extends IntegrationEntityDAO<Material> implements
|
|||
addedWhere = true;
|
||||
strQuery += "WHERE materialAssignment.status = :filterStatus ";
|
||||
}
|
||||
if (!allOrders.isEmpty()) {
|
||||
if (addedWhere) {
|
||||
strQuery += "AND orderElement IN (:allOrders) ";
|
||||
} else {
|
||||
addedWhere = true;
|
||||
strQuery += "WHERE orderElement IN (:allOrders) ";
|
||||
}
|
||||
|
||||
if (addedWhere) {
|
||||
strQuery += "AND orderElement IN (:allOrders) ";
|
||||
} else {
|
||||
addedWhere = true;
|
||||
strQuery += "WHERE orderElement IN (:allOrders) ";
|
||||
}
|
||||
|
||||
if (categories != null && !categories.isEmpty()) {
|
||||
if (addedWhere) {
|
||||
strQuery += "AND ";
|
||||
|
|
|
|||
|
|
@ -158,22 +158,22 @@ public class TimeLineRequiredMaterialModel implements
|
|||
Date endingDate, MaterialStatusEnum status, List<Order> listOrders,
|
||||
List<MaterialCategory> categories, List<Material> materials) {
|
||||
|
||||
List<Order> orderToInitialized = new ArrayList<Order>(listOrders);
|
||||
List<Order> orders = listOrders;
|
||||
if (listOrders.isEmpty()) {
|
||||
orderToInitialized.addAll(getOrders());
|
||||
orders = allOrders;
|
||||
}
|
||||
|
||||
for (Order each : orderToInitialized) {
|
||||
for (Order each : orders) {
|
||||
reattachmentOrder(each);
|
||||
}
|
||||
|
||||
Scenario currentScenario = scenarioManager.getCurrent();
|
||||
for (Order each : orderToInitialized) {
|
||||
for (Order each : orders) {
|
||||
each.useSchedulingDataFor(currentScenario);
|
||||
}
|
||||
|
||||
List<TimeLineRequiredMaterialDTO> result = filterConsult(startingDate,
|
||||
endingDate, status, listOrders, categories, materials);
|
||||
endingDate, status, orders, categories, materials);
|
||||
|
||||
|
||||
if (result != null && !result.isEmpty()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue