use of net.sourceforge.processdash.team.group.UserFilter in project processdash by dtuma.
the class SelectGroupFilter method writeFilterOptions.
private void writeFilterOptions(Collection filters, String extraLinkArgs) throws IOException {
List<UserFilter> l = new ArrayList(filters);
Collections.sort((List) l);
for (UserFilter f : l) writeFilterOption(f, extraLinkArgs, true);
}
use of net.sourceforge.processdash.team.group.UserFilter in project processdash by dtuma.
the class TimeLogReport method getTimeLogEntries.
private List getTimeLogEntries() throws IOException {
// ensure the user has permission to view time log entries
UserFilter privacyFilt = GroupPermission.getGrantedMembers(PERMISSION);
noPermission = (privacyFilt == null);
someEntriesBlocked = false;
if (noPermission)
return Collections.EMPTY_LIST;
TimeLog tl = null;
List l = null;
String type = getParameter("type");
if ("rollup".equals(type)) {
// permission to view time logs from "Everyone," block the data.
if (!UserGroup.isEveryone(privacyFilt)) {
someEntriesBlocked = true;
return Collections.EMPTY_LIST;
} else {
tl = new RolledUpTimeLog.FromResultSet(getDashboardContext(), getPrefix(), parameters);
}
} else if ("db".equals(type)) {
l = queryDatabaseForTimeLogEntries(privacyFilt);
} else {
tl = getDashboardContext().getTimeLog();
}
if (tl != null)
l = Collections.list(tl.filter(getPrefix(), null, null));
Collections.sort(l);
return l;
}
use of net.sourceforge.processdash.team.group.UserFilter in project processdash by dtuma.
the class EVReport method printFilterInfo.
public static void printFilterInfo(PrintWriter out, EVTaskFilter filter, EVReportSettings settings, boolean exporting, boolean textOnly) {
String labelFilter = (filter == null ? null : filter.getAttribute(EVLabelFilter.LABEL_FILTER_ATTR));
String pathFilter = (filter == null ? null : filter.getAttribute(EVHierarchicalFilter.HIER_FILTER_ATTR));
UserFilter groupFilter = (settings == null ? null : settings.getUserGroupFilter());
if (labelFilter == null && pathFilter == null && groupFilter == null)
return;
out.print("<h2 style='position:relative; left:-10px'>");
if (labelFilter != null) {
if (!textOnly)
out.print("<img border=0 src='/Images/filter.png' " + "style='margin: 0px 2px 0px 10px; position:relative; top:3px' " + "width='16' height='23' title=\"");
out.print(resources.getHTML("Report.Filter_Tooltip"));
out.print(textOnly ? " - " : "\">");
out.print(HTMLUtils.escapeEntities(labelFilter));
}
if (pathFilter != null) {
if (!textOnly)
out.print("<img border=0 src='/Images/hier.png' " + "style='margin: 0px 2px 0px 10px; position:relative; top:3px' " + "width='16' height='23' title=\"");
out.print(resources.getHTML("Report.Filter_Tooltip"));
out.print(textOnly ? " - " : "\">");
out.print(HTMLUtils.escapeEntities(pathFilter));
}
if (groupFilter != null) {
boolean isPrivacyViolation = groupFilter instanceof UserGroupPrivacyBlock;
// display an icon to represent this group filter
if (!textOnly) {
boolean showGroupHyperlink = !exporting && (settings.getParameters().containsKey(//
EVReportSettings.GROUP_FILTER_PARAM) || settings.getParameters().containsKey(EVReportSettings.GROUP_FILTER_AUTO_PARAM));
if (showGroupHyperlink)
out.print("<a href='../team/setup/selectGroupFilter'>");
out.print("<img border=0 src='/Images/userGroup");
if (isPrivacyViolation)
out.print("Privacy");
else if (groupFilter instanceof UserGroupMember)
out.print("Member");
out.print(".png' ");
if (isPrivacyViolation)
out.print("title='Group filter blocked to protect data privacy' ");
else if (showGroupHyperlink)
out.print("title='Filter to group' ");
out.print("style='margin: 0px 2px 0px 10px; position:relative; top:3px' " + "width='23' height='23'>");
if (showGroupHyperlink)
out.print("</a>");
}
// display the name of the filter
if (isPrivacyViolation)
out.print("<span style='color:#888; font-weight:normal; text-decoration:line-through'>");
out.print(HTMLUtils.escapeEntities(groupFilter.toString()));
if (isPrivacyViolation)
out.print("</span>");
}
out.println("</h2>");
}
use of net.sourceforge.processdash.team.group.UserFilter in project processdash by dtuma.
the class TimeRatioMemberTrackingChartData method recalc.
public void recalc() {
clearSeries();
// see if the user has permission to view personal data in this chart
UserFilter f = GroupPermission.getGrantedMembers(permissionID);
if (f == null)
return;
EVTaskListFilter pf = new EVTaskListGroupFilter(f);
MemberChartNameHelper nameHelper = new MemberChartNameHelper(rollup);
for (int i = 0; i < rollup.getSubScheduleCount(); i++) {
EVTaskList tl = rollup.getSubSchedule(i);
String personalDataID = tl.getPersonalDataID();
if (personalDataID != null && !pf.include(personalDataID))
continue;
EVSchedule subsched = tl.getSchedule();
String seriesName = nameHelper.get(tl);
maybeAddSeries(subsched.getTimeRatioTrackingChartSeries(seriesName, maxDataPoints));
}
}
use of net.sourceforge.processdash.team.group.UserFilter in project processdash by dtuma.
the class ScheduleBalancingDialog method showEditorDialog.
@Override
protected Object showEditorDialog(Object value) throws EditingCancelled {
// identify the privacy controls governing visibility of personal hours
UserFilter pf = GroupPermission.getGrantedMembers(EVSchedule.VIEW_INDIV_HOURS_PERMISSION);
if (pf == null) {
showBlockedByPrivacyMessage(true);
return null;
}
privacyFilter = new EVTaskListGroupFilter(pf);
collectScheduleRows();
if (!scheduleRows.isEmpty()) {
buildAndShowGUI();
} else if (rowsWereFiltered) {
showBlockedByPrivacyMessage(false);
}
return null;
}
Aggregations