Search in sources :

Example 11 with UserFilter

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);
}
Also used : ArrayList(java.util.ArrayList) UserFilter(net.sourceforge.processdash.team.group.UserFilter)

Example 12 with UserFilter

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;
}
Also used : TimeLog(net.sourceforge.processdash.log.time.TimeLog) RolledUpTimeLog(net.sourceforge.processdash.log.time.RolledUpTimeLog) UserFilter(net.sourceforge.processdash.team.group.UserFilter) RolledUpTimeLog(net.sourceforge.processdash.log.time.RolledUpTimeLog) ArrayList(java.util.ArrayList) List(java.util.List)

Example 13 with UserFilter

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>");
}
Also used : UserFilter(net.sourceforge.processdash.team.group.UserFilter) UserGroupPrivacyBlock(net.sourceforge.processdash.team.group.UserGroupPrivacyBlock) UserGroupMember(net.sourceforge.processdash.team.group.UserGroupMember)

Example 14 with UserFilter

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));
    }
}
Also used : EVTaskListFilter(net.sourceforge.processdash.ev.EVTaskListFilter) EVTaskListGroupFilter(net.sourceforge.processdash.ev.EVTaskListGroupFilter) EVSchedule(net.sourceforge.processdash.ev.EVSchedule) UserFilter(net.sourceforge.processdash.team.group.UserFilter) EVTaskList(net.sourceforge.processdash.ev.EVTaskList)

Example 15 with UserFilter

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;
}
Also used : EVTaskListGroupFilter(net.sourceforge.processdash.ev.EVTaskListGroupFilter) UserFilter(net.sourceforge.processdash.team.group.UserFilter)

Aggregations

UserFilter (net.sourceforge.processdash.team.group.UserFilter)17 EVTaskListGroupFilter (net.sourceforge.processdash.ev.EVTaskListGroupFilter)9 EVTaskList (net.sourceforge.processdash.ev.EVTaskList)7 EVTaskListFilter (net.sourceforge.processdash.ev.EVTaskListFilter)6 EVSchedule (net.sourceforge.processdash.ev.EVSchedule)4 UserGroupPrivacyBlock (net.sourceforge.processdash.team.group.UserGroupPrivacyBlock)4 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 DefaultTaskLabeler (net.sourceforge.processdash.ev.DefaultTaskLabeler)2 EVDependencyCalculator (net.sourceforge.processdash.ev.EVDependencyCalculator)2 EVTaskListRollup (net.sourceforge.processdash.ev.EVTaskListRollup)2 TinyCGIException (net.sourceforge.processdash.net.http.TinyCGIException)2 UserGroupMember (net.sourceforge.processdash.team.group.UserGroupMember)2 Rectangle (java.awt.Rectangle)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 IOException (java.io.IOException)1 List (java.util.List)1 JCheckBoxMenuItem (javax.swing.JCheckBoxMenuItem)1 JMenu (javax.swing.JMenu)1