1
2
3
4
5
6
7
8
9
10
11
12
13 import logging
14 log = logging.getLogger("zen.ActionRuleWindow")
15
16 import time
17
18 from Globals import DTMLFile
19 from AccessControl import ClassSecurityInfo
20 from Products.ZenModel.ZenossSecurity import *
21 from Products.ZenModel.MaintenanceWindow import MaintenanceWindow
22 from Products.ZenRelations.RelSchema import *
23 from Products.ZenUtils.Utils import unused
24
31
32 addActionRuleWindow = DTMLFile('dtml/addActionRuleWindow',globals())
33
35
36 backCrumb = 'editActionRuleSchedule'
37
38 actionRule = None
39
40 factory_type_information = (
41 {
42 'immediate_view' : 'actionRuleWindowDetail',
43 'actions' :
44 (
45 { 'id' : 'status'
46 , 'name' : 'Status'
47 , 'action' : 'actionRuleWindowDetail'
48 , 'permissions' : ( ZEN_VIEW, )
49 },
50 { 'id' : 'viewHistory'
51 , 'name' : 'Modifications'
52 , 'action' : 'viewHistory'
53 , 'permissions' : (ZEN_VIEW_MODIFICATIONS,)
54 },
55 )
56 },
57 )
58
59 _relations = (
60 ("actionRule", ToOne(ToManyCont,"Products.ZenEvents.ActionRule","windows")),
61 )
62
63 security = ClassSecurityInfo()
64
67
68 - def begin(self, now = None):
73
77
78 security.declareProtected(ZEN_CHANGE_ALERTING_RULES, 'manage_editActionRuleWindow')
79 - def manage_editActionRuleWindow(self,
80 startDate='',
81 startHours='',
82 startMinutes='00',
83 durationDays='0',
84 durationHours='00',
85 durationMinutes='00',
86 repeat='Never',
87 enabled=True,
88 REQUEST=None,
89 **kw):
107