Search in sources :

Example 16 with EVTaskList

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

the class MemberChartNameHelper method getRepeatedPersonNames.

private Set<String> getRepeatedPersonNames(EVTaskListRollup rollup) {
    Set<String> namesSeen = new HashSet<String>();
    Set<String> repeatedNames = new HashSet<String>();
    for (int i = 0; i < rollup.getSubScheduleCount(); i++) {
        EVTaskList tl = rollup.getSubSchedule(i);
        String personName = extractPersonName(tl.getDisplayName());
        if (namesSeen.contains(personName))
            repeatedNames.add(personName);
        else
            namesSeen.add(personName);
    }
    return repeatedNames;
}
Also used : EVTaskList(net.sourceforge.processdash.ev.EVTaskList) HashSet(java.util.HashSet)

Example 17 with EVTaskList

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

the class TaskScheduleChooser method deleteSelectedTaskList.

protected void deleteSelectedTaskList() {
    String taskListName = (String) list.getSelectedValue();
    if (taskListName == null)
        return;
    String message = resources.format("Delete_Window.Prompt_FMT", taskListName);
    if (JOptionPane.showConfirmDialog(dialog, message, resources.getString("Delete_Window.Title"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
        EVTaskList taskList = EVTaskList.openExisting(taskListName, dash.getData(), dash.getHierarchy(), dash.getCache(), false);
        if (taskList != null)
            taskList.save(null);
        refreshList();
        dialog.toFront();
    }
}
Also used : EVTaskList(net.sourceforge.processdash.ev.EVTaskList)

Example 18 with EVTaskList

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

the class TaskScheduleChooser method renameSelectedTaskList.

protected void renameSelectedTaskList() {
    String taskListName = (String) list.getSelectedValue();
    if (taskListName == null)
        return;
    String newName = getTemplateName(dialog, resources.getString("Rename_Window.Title"), resources.format("Rename_Window.Prompt_FMT", taskListName), taskListName, false);
    if (newName != null) {
        EVTaskList taskList = EVTaskList.openExisting(taskListName, dash.getData(), dash.getHierarchy(), dash.getCache(), false);
        if (taskList != null)
            taskList.save(newName);
        refreshList();
        dialog.toFront();
    }
}
Also used : EVTaskList(net.sourceforge.processdash.ev.EVTaskList)

Example 19 with EVTaskList

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

the class TaskScheduleDialog method save.

protected void save() {
    if (dirtySubschedules != null) {
        for (EVTaskList subschedule : dirtySubschedules) subschedule.save();
        dirtySubschedules = null;
    }
    model.save();
    setDirty(false);
    displayErrorDialog(getErrors());
}
Also used : EVTaskList(net.sourceforge.processdash.ev.EVTaskList)

Example 20 with EVTaskList

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

EVTaskList (net.sourceforge.processdash.ev.EVTaskList)26 EVTaskListRollup (net.sourceforge.processdash.ev.EVTaskListRollup)8 EVTaskListGroupFilter (net.sourceforge.processdash.ev.EVTaskListGroupFilter)7 UserFilter (net.sourceforge.processdash.team.group.UserFilter)7 ArrayList (java.util.ArrayList)5 EVSchedule (net.sourceforge.processdash.ev.EVSchedule)5 EVTask (net.sourceforge.processdash.ev.EVTask)5 EVTaskListFilter (net.sourceforge.processdash.ev.EVTaskListFilter)5 Iterator (java.util.Iterator)4 TreePath (javax.swing.tree.TreePath)4 Date (java.util.Date)3 HashSet (java.util.HashSet)3 DefaultTaskLabeler (net.sourceforge.processdash.ev.DefaultTaskLabeler)3 EVDependencyCalculator (net.sourceforge.processdash.ev.EVDependencyCalculator)3 EVTaskListData (net.sourceforge.processdash.ev.EVTaskListData)3 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 Set (java.util.Set)2 EVTaskFilter (net.sourceforge.processdash.ev.EVTaskFilter)2