| 39 |
|
|
| 40 |
################################### |
################################### |
| 41 |
# Action Scope |
# Action Scope |
|
|
|
| 42 |
LinesField('country', |
LinesField('country', |
| 43 |
widget=MultiSelectionWidget(label='Participating Countries', |
widget=MultiSelectionWidget(label='Participating Countries', |
| 44 |
description="If the Uninted States is one of the countries, select the states that will be involved in this action"), |
description="If the Uninted States is one of the countries, select the states that will be involved in this action"), |
| 54 |
), |
), |
| 55 |
################################### |
################################### |
| 56 |
|
|
|
################################### |
|
|
# actions |
|
|
LinesField('allowedActions', |
|
|
widget=MultiSelectionWidget(label='Allowed Actions', |
|
|
description="What actions should the users be allowed to participate in."), |
|
|
vocabulary='getAvailableActions', |
|
|
schemata="actions", |
|
|
), |
|
|
################################### |
|
| 57 |
)) |
)) |
| 58 |
|
|
| 59 |
class PublicAction(BaseFolder): |
class PublicAction(BaseFolder): |
| 97 |
|
|
| 98 |
for item in mylist: |
for item in mylist: |
| 99 |
result.add(item[0], item[1]) |
result.add(item[0], item[1]) |
|
|
|
|
return result |
|
|
def getPoliticalParties(self): |
|
|
result = DisplayList() |
|
|
try: |
|
|
props = self.portal_properties.pac_properties.getProperty('political_parties') |
|
|
except: |
|
|
return DisplayList(()) |
|
|
|
|
|
mylist = [] |
|
|
|
|
|
for item in props: |
|
|
mylist.append(item.split('|')) |
|
|
|
|
|
for item in mylist: |
|
|
result.add(item[0], item[1]) |
|
|
|
|
|
return result |
|
|
|
|
|
def getAvailableActions(self): |
|
|
# id = label|action |
|
|
|
|
|
result = DisplayList() |
|
|
try: |
|
|
props = self.portal_properties.pac_actions.propertyIds() |
|
|
except: |
|
|
return DisplayList(()) |
|
|
|
|
|
mylist = [] |
|
|
|
|
|
for prop_id in props: |
|
|
if prop_id != 'title': |
|
|
mylist.append([prop_id, self.portal_properties.pac_actions.getProperty(prop_id).split('|')[0]]) |
|
|
|
|
|
for item in mylist: |
|
|
result.add(item[0], item[1]) |
|
| 100 |
|
|
| 101 |
return result |
return result |
| 102 |
|
|