CCM NG: Some minor fixes for the Workflow tab of the Content Section Admin
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5219 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
e3900a4583
commit
522dbfd7e3
|
|
@ -64,6 +64,7 @@ class BaseTaskForm extends BaseForm {
|
|||
BaseTaskForm(final String key,
|
||||
final GlobalizedMessage message,
|
||||
final WorkflowRequestLocal workflowRequestLocal) {
|
||||
|
||||
super(key, message);
|
||||
|
||||
this.workflowRequestLocal = workflowRequestLocal;
|
||||
|
|
@ -166,7 +167,9 @@ class BaseTaskForm extends BaseForm {
|
|||
|
||||
@Override
|
||||
public void prepare(final PrintEvent event) {
|
||||
|
||||
final OptionGroup target = (OptionGroup) event.getTarget();
|
||||
target.clearOptions();
|
||||
|
||||
for (final CmsTaskType type : CmsTaskType.values()) {
|
||||
final GlobalizedMessage label = new GlobalizedMessage(
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ package com.arsdigita.cms.ui.workflow;
|
|||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SingleSelectionModel;
|
||||
import com.arsdigita.bebop.Text;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.PrintEvent;
|
||||
|
|
@ -51,28 +52,31 @@ class TaskAddForm extends BaseTaskForm {
|
|||
+ "name already exists in this "
|
||||
+ "content section.";
|
||||
|
||||
private final SingleSelectionModel<Long> m_model;
|
||||
private final SingleSelectionModel<Long> selectedWorkflowId;
|
||||
|
||||
public TaskAddForm(final WorkflowRequestLocal workflow,
|
||||
final SingleSelectionModel<Long> model) {
|
||||
final SingleSelectionModel<Long> selectedWorkflowId) {
|
||||
|
||||
super("task", gz("cms.ui.workflow.task.add"), workflow);
|
||||
|
||||
m_model = model;
|
||||
this.selectedWorkflowId = selectedWorkflowId;
|
||||
|
||||
try {
|
||||
getDependenciesOptionGroup()
|
||||
super
|
||||
.getDependenciesOptionGroup()
|
||||
.addPrintListener(new DependencyPrinter());
|
||||
} catch (TooManyListenersException tmle) {
|
||||
throw new UncheckedWrapperException(tmle);
|
||||
} catch (TooManyListenersException ex) {
|
||||
throw new UncheckedWrapperException(ex);
|
||||
}
|
||||
|
||||
addProcessListener(new ProcessListener());
|
||||
super.addProcessListener(new ProcessListener());
|
||||
}
|
||||
|
||||
private class DependencyPrinter implements PrintListener {
|
||||
|
||||
@Override
|
||||
public final void prepare(final PrintEvent event) {
|
||||
|
||||
final PageState state = event.getPageState();
|
||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||
final WorkflowAdminPaneController controller = cdiUtil
|
||||
|
|
@ -88,7 +92,7 @@ class TaskAddForm extends BaseTaskForm {
|
|||
options.clearOptions();
|
||||
tasks.forEach(task -> options.addOption(new Option(
|
||||
Long.toString(task.getTaskId()),
|
||||
task.getLabel().getValue(defaultLocale))));
|
||||
new Text(task.getLabel().getValue(defaultLocale)))));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -113,7 +117,7 @@ class TaskAddForm extends BaseTaskForm {
|
|||
.getValue(state)),
|
||||
(String[]) getDependenciesOptionGroup().getValue(state));
|
||||
|
||||
m_model.setSelectedKey(state, task.getTaskId());
|
||||
selectedWorkflowId.setSelectedKey(state, task.getTaskId());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue