\n"
t=t+" \n"
t=t+"
\n"
# we specify here whether we are in the last step of the action or not
res = run_sql("SELECT step FROM sbmFUNCTIONS WHERE action=%s and doctype=%s and step>%s", (act,doctype,step,))
if len(res) == 0:
last_step = 1
else:
last_step = 0
# Prints the action details, returning the mandatory score
action_score = action_details(doctype,act)
current_level = get_level(doctype, act)
# Calls all the function's actions
try:
t=t+print_function_calls(doctype, act, step, form)
except functionError,e:
return errorMsg(e.value,req)
except functionStop,e:
if e.value != None:
t=t+e.value
else:
t=t+e
# If the action was mandatory we propose the next mandatory action (if any)
if action_score != -1 and last_step == 1:
t=t+Propose_Next_Action(doctype,action_score,access,current_level,indir)
# If we are in the last step of an action, we can update the "journal of submissions"
if last_step == 1:
if uid_email != "" and uid_email != "guest" and rn != "":
res = run_sql("SELECT * FROM sbmSUBMISSIONS WHERE doctype=%s and action=%s and id=%s and email=%s", (doctype,act,access,uid_email,))
if len(res) == 0:
run_sql("INSERT INTO sbmSUBMISSIONS values(%s,%s,%s,'finished',%s,%s,NOW(),NOW())", (uid_email,doctype,act,access,rn,))
else:
run_sql("UPDATE sbmSUBMISSIONS SET md=NOW(),reference=%s,status='finished' WHERE doctype=%s and action=%s and id=%s and email=%s", (rn,doctype,act,access,uid_email,))
t=t+"""
|