register_exception(req=req,alert_admin=True,prefix="Error in evaluating response element %s with globals %s"%(pprint.pformat(full_field),pprint.pformat(the_globals)))
## There was a serious function-error. Execution ends.
returnwarningMsg(_("A serious function-error has been encountered. Adminstrators have been alerted. <br /><em>Please not that this might be due to wrong characters inserted into the form</em> (e.g. by copy and pasting some text from a PDF file)."),req,c,ln)
exceptInvenioWebSubmitFunctionStop,e:
## For one reason or another, one of the functions has determined that
## the data-processing phase (i.e. the functions execution) should be
## halted and the user should be returned to the form interface once
## more. (NOTE: Redirecting the user to the Web-form interface is
## currently done using JavaScript. The "InvenioWebSubmitFunctionStop"
## exception contains a "value" string, which is effectively JavaScript
## - probably an alert box and a form that is submitted). **THIS WILL
## CHANGE IN THE FUTURE WHEN JavaScript IS REMOVED!**
ife.valueisnotNone:
function_content=e.value
else:
function_content=e
else:
## No function exceptions (InvenioWebSubmitFunctionStop,
## InvenioWebSubmitFunctionError) were raised by the functions. Propose
## the next action (if applicable), and log the submission as finished:
## If the action was mandatory we propose the next
## mandatory action (if any)
ifaction_score!=-1andlast_step==1:
next_action=Propose_Next_Action(doctype, \
action_score, \
access, \
current_level, \
indir)
## If we are in the last step of an action, we can update
register_exception(req=req,alert_admin=True,prefix="Warning in executing function %s with globals %s"%(pprint.pformat(currfunction),pprint.pformat(the_globals)))
## The function the NoneType. Don't keep that value as
## the currfunction->text. Replace it with the empty
## string.
currfunction['text']=""
else:
currfunction['error']=1
functions.append(currfunction)
exceptInvenioWebSubmitFunctionStop,err:
## The submission asked to stop execution. This is
## ok. Do not alert admin, and raise exception further
log_function(curdir,"***Stop*** from %s: %s" \
%(function_name,str(err)),start_time)
raise
except:
register_exception(req=req,alert_admin=True,prefix="Error in executing function %s with globals %s"%(pprint.pformat(currfunction),pprint.pformat(the_globals)))
raise
t=websubmit_templates.tmpl_function_output(
ln=ln,
display_on=(dismode=='S'),
action=action,
doctype=doctype,
step=step,
functions=functions,
)
else:
ifdismode=='S':
t="<br /><br /><b>"+_("The chosen action is not supported by the document type.")+"</b>"