|
|
@ -203,7 +203,7 @@ class ScriptForm: |
|
|
|
form['fields'], |
|
|
|
form['fields'], |
|
|
|
script, |
|
|
|
script, |
|
|
|
output=form.get('output', 'escaped'), |
|
|
|
output=form.get('output', 'escaped'), |
|
|
|
hide=form.get('hide', False), |
|
|
|
hidden=form.get('hidden', False), |
|
|
|
submit_title=form.get('submit_title', 'Submit'), |
|
|
|
submit_title=form.get('submit_title', 'Submit'), |
|
|
|
allowed_users=form.get('allowed_users', None)) |
|
|
|
allowed_users=form.get('allowed_users', None)) |
|
|
|
) |
|
|
|
) |
|
|
@ -269,14 +269,14 @@ class FormConfig: |
|
|
|
def get_visible_forms(self, username=None): |
|
|
|
def get_visible_forms(self, username=None): |
|
|
|
""" |
|
|
|
""" |
|
|
|
Return a list of all visible forms. Excluded forms are those that have |
|
|
|
Return a list of all visible forms. Excluded forms are those that have |
|
|
|
the 'hide' property set, and where the user has no access to. |
|
|
|
the 'hidden' property set, and where the user has no access to. |
|
|
|
""" |
|
|
|
""" |
|
|
|
form_list = [] |
|
|
|
form_list = [] |
|
|
|
for form_def in self.forms: |
|
|
|
for form_def in self.forms: |
|
|
|
if form_def.allowed_users is not None and \ |
|
|
|
if form_def.allowed_users is not None and \ |
|
|
|
username not in form_def.allowed_users: |
|
|
|
username not in form_def.allowed_users: |
|
|
|
continue # User is not allowed to run this form |
|
|
|
continue # User is not allowed to run this form |
|
|
|
if form_def.hide: |
|
|
|
if form_def.hidden: |
|
|
|
continue # Don't show hidden forms in the list. |
|
|
|
continue # Don't show hidden forms in the list. |
|
|
|
else: |
|
|
|
else: |
|
|
|
form_list.append(form_def) |
|
|
|
form_list.append(form_def) |
|
|
@ -331,7 +331,7 @@ class FormDefinition: |
|
|
|
for validation of the form values. |
|
|
|
for validation of the form values. |
|
|
|
""" |
|
|
|
""" |
|
|
|
def __init__(self, name, title, description, fields, script, |
|
|
|
def __init__(self, name, title, description, fields, script, |
|
|
|
output='escaped', hide=False, submit_title="Submit", |
|
|
|
output='escaped', hidden=False, submit_title="Submit", |
|
|
|
allowed_users=None): |
|
|
|
allowed_users=None): |
|
|
|
self.name = name |
|
|
|
self.name = name |
|
|
|
self.title = title |
|
|
|
self.title = title |
|
|
@ -339,7 +339,7 @@ class FormDefinition: |
|
|
|
self.fields = fields |
|
|
|
self.fields = fields |
|
|
|
self.script = script |
|
|
|
self.script = script |
|
|
|
self.output = output |
|
|
|
self.output = output |
|
|
|
self.hide = hide |
|
|
|
self.hidden = hidden |
|
|
|
self.submit_title = submit_title |
|
|
|
self.submit_title = submit_title |
|
|
|
self.allowed_users = allowed_users |
|
|
|
self.allowed_users = allowed_users |
|
|
|
|
|
|
|
|
|
|
|