|
|
@ -200,6 +200,7 @@ class ScriptForm: |
|
|
|
form['fields'], |
|
|
|
form['fields'], |
|
|
|
script, |
|
|
|
script, |
|
|
|
output=form.get('output', 'escaped'), |
|
|
|
output=form.get('output', 'escaped'), |
|
|
|
|
|
|
|
hide=form.get('hide', 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)) |
|
|
|
) |
|
|
|
) |
|
|
@ -303,7 +304,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', submit_title="Submit", |
|
|
|
output='escaped', hide=False, submit_title="Submit", |
|
|
|
allowed_users=None): |
|
|
|
allowed_users=None): |
|
|
|
self.name = name |
|
|
|
self.name = name |
|
|
|
self.title = title |
|
|
|
self.title = title |
|
|
@ -311,6 +312,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.submit_title = submit_title |
|
|
|
self.submit_title = submit_title |
|
|
|
self.allowed_users = allowed_users |
|
|
|
self.allowed_users = allowed_users |
|
|
|
|
|
|
|
|
|
|
@ -604,6 +606,8 @@ class ScriptFormWebApp(WebAppHandler): |
|
|
|
if form_def.allowed_users is not None and \ |
|
|
|
if form_def.allowed_users is not None and \ |
|
|
|
self.username not in form_def.allowed_users: |
|
|
|
self.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: |
|
|
|
|
|
|
|
continue # Don't show hidden forms in the list. |
|
|
|
h_form_list.append(u''' |
|
|
|
h_form_list.append(u''' |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<h2 class="form-title">{title}</h2> |
|
|
|
<h2 class="form-title">{title}</h2> |
|
|
|