Search in sources :

Example 6 with EVTaskListGroupFilter

use of net.sourceforge.processdash.ev.EVTaskListGroupFilter 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)

Example 7 with EVTaskListGroupFilter

use of net.sourceforge.processdash.ev.EVTaskListGroupFilter in project processdash by dtuma.

the class EVReport method getEVModel.

private void getEVModel() throws TinyCGIException {
    taskListName = settings.getTaskListName();
    if (taskListName == null)
        throw new TinyCGIException(400, "schedule name missing");
    else if (FAKE_MODEL_NAME.equals(taskListName)) {
        evModel = null;
        return;
    }
    long now = System.currentTimeMillis();
    synchronized (EVReport.class) {
        if (drawingChart && (now - lastRecalcTime < MAX_DELAY) && taskListName.equals(lastTaskListName)) {
            evModel = lastEVModel.get();
            if (evModel != null)
                return;
        }
    }
    evModel = EVTaskList.openExisting(taskListName, getDataRepository(), getPSPProperties(), getObjectCache(), // change notification not required
    false);
    if (evModel == null)
        throw new TinyCGIException(404, "Not Found", "No such task/schedule");
    UserFilter f = settings.getUserGroupFilter();
    if (f != null && !UserGroup.isEveryone(f) && evModel instanceof EVTaskListRollup) {
        EVTaskListRollup rollup = (EVTaskListRollup) evModel;
        rollup.applyTaskListFilter(new EVTaskListGroupFilter(f));
        String permID = (parameters.containsKey(CHARTS_PARAM) ? EVPermissions.PERSONAL_CHARTS : EVPermissions.PERSONAL_REPORT);
        settings.checkPersonalDataPermission(rollup, permID);
    }
    EVDependencyCalculator depCalc = new EVDependencyCalculator(getDataRepository(), getPSPProperties(), getObjectCache());
    evModel.setDependencyCalculator(depCalc);
    evModel.setTaskLabeler(new DefaultTaskLabeler(getDashboardContext()));
    if (settings.getBool(CUSTOMIZE_HIDE_BASELINE))
        evModel.disableBaselineData();
    evModel.recalc();
    synchronized (EVReport.class) {
        lastTaskListName = taskListName;
        lastRecalcTime = now;
        lastEVModel = new WeakReference<EVTaskList>(evModel);
    }
}
Also used : EVTaskListGroupFilter(net.sourceforge.processdash.ev.EVTaskListGroupFilter) EVDependencyCalculator(net.sourceforge.processdash.ev.EVDependencyCalculator) EVTaskListRollup(net.sourceforge.processdash.ev.EVTaskListRollup) UserFilter(net.sourceforge.processdash.team.group.UserFilter) EVTaskList(net.sourceforge.processdash.ev.EVTaskList) DefaultTaskLabeler(net.sourceforge.processdash.ev.DefaultTaskLabeler) TinyCGIException(net.sourceforge.processdash.net.http.TinyCGIException)

Example 8 with EVTaskListGroupFilter

use of net.sourceforge.processdash.ev.EVTaskListGroupFilter 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 9 with EVTaskListGroupFilter

use of net.sourceforge.processdash.ev.EVTaskListGroupFilter in project processdash by dtuma.

the class TaskScheduleDialog method checkPermission.

private boolean checkPermission(AbstractAction a, int row, String permissionID, String resKey) {
    // if this is not a rollup in a team dashboard, permissions are OK
    if (!isRollup() || !Settings.isTeamMode())
        return true;
    // get the list of people we can view data for. If null, the current
    // user does not have permission to view personal data at all.
    UserFilter userFilter = GroupPermission.getGrantedMembers(permissionID);
    if (userFilter == null) {
        a.putValue(Action.SHORT_DESCRIPTION, resources.getString("Buttons.Filtered_" + resKey + "_Blocked"));
        return false;
    }
    // if the user is allowed to view data for everyone, return true
    if (UserGroup.isEveryone(userFilter))
        return true;
    // find the personal schedule we are asking to view data for.
    TreePath path = treeTable.getTree().getPathForRow(row);
    if (path.getPathCount() < 2)
        return false;
    EVTask rootTask = (EVTask) path.getPathComponent(1);
    EVTaskList subSchedule = findTaskListWithRoot(model, rootTask);
    if (subSchedule == null)
        return false;
    // see if the current user has permission to view this schedule
    EVTaskListGroupFilter filter = new EVTaskListGroupFilter(userFilter);
    if (filter.include(subSchedule.getID()))
        return true;
    // if we don't have permission, display an explanatory tooltip
    a.putValue(Action.SHORT_DESCRIPTION, resources.getString("Buttons.Filtered_" + resKey + "_Restricted"));
    return false;
}
Also used : EVTaskListGroupFilter(net.sourceforge.processdash.ev.EVTaskListGroupFilter) TreePath(javax.swing.tree.TreePath) EVTask(net.sourceforge.processdash.ev.EVTask) UserFilter(net.sourceforge.processdash.team.group.UserFilter) EVTaskList(net.sourceforge.processdash.ev.EVTaskList)

Aggregations

EVTaskListGroupFilter (net.sourceforge.processdash.ev.EVTaskListGroupFilter)9 UserFilter (net.sourceforge.processdash.team.group.UserFilter)9 EVTaskList (net.sourceforge.processdash.ev.EVTaskList)7 EVTaskListFilter (net.sourceforge.processdash.ev.EVTaskListFilter)6 EVSchedule (net.sourceforge.processdash.ev.EVSchedule)4 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 IOException (java.io.IOException)1 TreePath (javax.swing.tree.TreePath)1 EVTask (net.sourceforge.processdash.ev.EVTask)1 EVTaskFilter (net.sourceforge.processdash.ev.EVTaskFilter)1 SingleValueConfidenceInterval (net.sourceforge.processdash.ev.ci.SingleValueConfidenceInterval)1 UserGroupPrivacyBlock (net.sourceforge.processdash.team.group.UserGroupPrivacyBlock)1