-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathInstall.py
More file actions
37 lines (33 loc) · 1.93 KB
/
Install.py
File metadata and controls
37 lines (33 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# This script adds NonWeekly Meetings to the MorningBatch so meetings are created automatically.
# Then, execute the first round of creation.
global model, Data, q
batchContent = model.PythonContent('MorningBatch')
if '''model.CallScript("NonweeklyMeetings")''' not in batchContent and '''model.CallScript('NonweeklyMeetings')''' not in batchContent:
batchContent = batchContent + '''\n\nmodel.CallScript("NonweeklyMeetings")'''
model.WriteContentPython("MorningBatch", batchContent)
standardValues = model.TextContent('StandardExtraValues2')
if '''Name="Meeting Frequency" ''' not in standardValues:
if '''View Table="Organization" Location="Standard"''' in standardValues:
standardValueXml = ''' <Value Name="Meeting Frequency" Type="Bits" VisibilityRoles="Access">
<Code>Frequency:Every Other</Code>
<Code>Frequency:First</Code>
<Code>Frequency:Second</Code>
<Code>Frequency:Third</Code>
<Code>Frequency:Fourth</Code>
<Code>Frequency:Fifth</Code>
</Value>'''
sectionStart = '''<View Table="Organization" Location="Standard">'''
standardValues = standardValues.replace(sectionStart, sectionStart + "\n" + standardValueXml, 1)
else:
standardValueXml = ''' <View Table="Organization" Location="Standard">\n <Value Name="Meeting Frequency" Type="Bits" VisibilityRoles="Access">
<Code>Frequency:Every Other</Code>
<Code>Frequency:First</Code>
<Code>Frequency:Second</Code>
<Code>Frequency:Third</Code>
<Code>Frequency:Fourth</Code>
<Code>Frequency:Fifth</Code>
</Value>\n </View>'''
sectionStart = '''<Views>'''
standardValues = standardValues.replace(sectionStart, sectionStart + "\n" + standardValueXml, 1)
model.WriteContentText("StandardExtraValues2", standardValues)
model.CallScript("NonweeklyMeetings")