--- a/src/pyams_scheduler/zmi/task.py Wed Mar 11 17:16:21 2015 +0100
+++ b/src/pyams_scheduler/zmi/task.py Wed Mar 11 21:30:17 2015 +0100
@@ -18,7 +18,7 @@
# import interfaces
from pyams_form.interfaces.form import IWidgetsSuffixViewletsManager, IWidgetsPrefixViewletsManager
from pyams_scheduler.interfaces import ITaskInfo, IScheduler, ITask, ICronTask, ICronTaskScheduling, IDateTask, \
- IDateTaskScheduling, ILoopTask, ILoopTaskScheduling, ITaskHistory
+ IDateTaskScheduling, ILoopTask, ILoopTaskScheduling, ITaskHistory, IBaseTaskScheduling
from pyams_skin.interfaces import IContentHelp
from pyams_skin.layer import IPyAMSLayer
from pyams_zmi.layer import IAdminLayer
@@ -158,6 +158,12 @@
class CronTaskScheduleAJAXEditForm(AJAXEditForm, CronTaskScheduleEditForm):
"""Cron-style task schedule edit form, AJAX view"""
+ def get_ajax_output(self, changes):
+ if 'active' in changes.get(IBaseTaskScheduling, ()):
+ return {'status': 'reload'}
+ else:
+ return super(CronTaskScheduleAJAXEditForm, self).get_ajax_output(changes)
+
@pagelet_config(name='schedule.html', context=IDateTask, layer=IPyAMSLayer, permission='system.view')
class DateTaskScheduleEditForm(TaskScheduleEditForm):
@@ -171,6 +177,12 @@
class DateTaskScheduleAJAXEditForm(AJAXEditForm, DateTaskScheduleEditForm):
"""Date-style task schedule edit form, AJAX view"""
+ def get_ajax_output(self, changes):
+ if 'active' in changes.get(IBaseTaskScheduling, ()):
+ return {'status': 'reload'}
+ else:
+ return super(DateTaskScheduleAJAXEditForm, self).get_ajax_output(changes)
+
@pagelet_config(name='schedule.html', context=ILoopTask, layer=IPyAMSLayer, permission='system.view')
class LoopTaskScheduleEditForm(TaskScheduleEditForm):
@@ -184,6 +196,12 @@
class LoopTaskScheduleAJAXEditForm(AJAXEditForm, LoopTaskScheduleEditForm):
"""Loop-style task schedule edit form, AJAX view"""
+ def get_ajax_output(self, changes):
+ if 'active' in changes.get(IBaseTaskScheduling, ()):
+ return {'status': 'reload'}
+ else:
+ return super(LoopTaskScheduleAJAXEditForm, self).get_ajax_output(changes)
+
class ITaskRunnerButtons(Interface):
"""Task runner buttons"""