Exemplo n.º 1
0
 def __call__(self):
     context = aq_inner(self.context)
     # Old style
     # context.toggleWatching()
     # New style
     watchers = IWatcherList(context)
     watchers.toggle_watching()
     self.request.RESPONSE.redirect(context.absolute_url())
Exemplo n.º 2
0
 def __call__(self):
     context = aq_inner(self.context)
     # Old style
     # context.toggleWatching()
     # New style
     watchers = IWatcherList(context)
     watchers.toggle_watching()
     self.request.RESPONSE.redirect(context.absolute_url())
Exemplo n.º 3
0
 def __call__(self):
     context = aq_inner(self.context)
     watchers = IWatcherList(context)
     email = self.request.form.get('email')
     if email:
         watchers.watchers.append(email)
     if self.request.form.get('toggle'):
         watchers.toggle_watching()
     # Return the rendered form.
     return self.index()
Exemplo n.º 4
0
 def __call__(self):
     context = aq_inner(self.context)
     watchers = IWatcherList(context)
     email = self.request.form.get('email')
     if email:
         watchers.watchers.append(email)
     if self.request.form.get('toggle'):
         watchers.toggle_watching()
     # Return the rendered form.
     return self.index()
def set_task_initial_date(task, event):
    ''' This subscriber will set the initial date
        for the task and send email for the
        author and for the responsible for the task.
        And create a local role enable responsible to
        add tasks
    '''
    watchers = IWatcherList(task)
    watchers.toggle_watching()
    if task.responsible:
        watchers.watchers.append(task.responsible)
        task.manage_setLocalRoles(task.responsible, ['Manager'],)
    task.initial_date = date.today()
    send_task_notification_mail(task)
Exemplo n.º 6
0
 def render(self):
     context = aq_inner(self.context)
     watchers = IWatcherList(context)
     watchers.toggle_watching()
     self.request.RESPONSE.redirect(context.absolute_url())