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;
}
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();
}
}
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();
}
}
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());
}
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;
}
Aggregations