Commit f32f623c authored by Marc Duez's avatar Marc Duez

server : result file function confirm/delete (TODO create is own controller)

parent d23dc80e
......@@ -174,8 +174,43 @@ def delete():
res = {"message": "acces denied"}
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
## display run page result
## need ["data_file_id"]
def result_info():
if (auth.has_permission('admin', 'patient', db.sequence_file[db.data_file[request.vars["data_file_id"]].sequence_file_id].patient_id ) ):
return dict(message=T('result info'))
else :
res = {"message": "acces denied"}
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
def result_confirm():
if (auth.has_permission('admin', 'patient', db.sequence_file[db.data_file[request.vars["data_file_id"]].sequence_file_id].patient_id )
& auth.has_permission("run", "data_file") ):
return dict(message=T('result confirm'))
else :
res = {"message": "acces denied"}
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
#
def result_delete():
if (auth.has_permission('admin', 'patient', db.sequence_file[db.data_file[request.vars["data_file_id"]].sequence_file_id].patient_id )
& auth.has_permission("run", "data_file") ):
config_id = db.data_file[request.vars["data_file_id"]].config_id
patient_id = db.sequence_file[db.data_file[request.vars["data_file_id"]].sequence_file_id].patient_id
db(db.data_file.id == request.vars["data_file_id"]).delete()
res = {"redirect": "patient/info",
"args" : { "id" : patient_id,
"config_id" : config_id},
"success": "true",
"message": "run ("+str(request.vars["id"])+") deleted"}
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
else :
res = {"message": "acces denied"}
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
#
def permission():
if (auth.has_permission('admin', 'patient', request.vars["id"]) ):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment