def GET(self, args): if session.login == 1: if session.user: args = web.input() #更改任务动态 if str(args.type) == 'mission_doer': mission_doer = session.user elif str(args.type) == 'mission_publisher': mission_doer = args.mission_doer else: print "not mission_doer and not mission_publisher" mission.mission_sta_change(args.mission_id, unquote(args.mission_status),mission_doer) #ws_file if args.mission_status == ('已完成').decode('utf-8'): print "mission_doer...........................mission_doer" print mission_doer file.file_type_change(args.mission_id,mission_doer) #更改后跳转 mission_list = mission.mission_list(account_name=session.user, role=web.input().type,mission_status='执行中') page_info = {'page':1} page_info['count'] = len(mission_list) mission_list = mission_list[0:30] return render_template(type=session.type, template_name='my_'+web.input().type+'.html', user=session.user, mission_list=mission_list, page_info = page_info) #返回m,m[0]['mission_name'], m[0]['mission_content']等等 else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
def POST(self): #需要接收mission_id if session.login == 1: if session.user: mission_id = web.input().mission_id #先添加任务,再把原来的任务删除 #创建任务 try: mission_duplicate = web.input().mission_duplicate except Exception, e: mission_duplicate = "off" #检查输入信息 result = mission.mission_check(web.input().mission_name, \ web.input().mission_content, web.input().mission_starttime, web.input().mission_plan_end_time) if result == "no error": #存储任务信息 mission.mission_save(web.input().mission_name, session.user, \ web.input().mission_content, web.input().mission_starttime, \ web.input().mission_plan_end_time, mission_duplicate) mission_list = mission.mission_list(account_name=session.user, role='mission_publisher') #return render.my_mission(session.user, mission_list) ajax_result = {"statusCode":"200", "message":"任修改成功", "callbackType":"closeCurrent"} try: result_del = mission.mission_delete(mission_id) except Exception, e: print e finally: mission_list = mission.mission_list(account_name=session.user, role='mission_publisher')
def POST(self): #需要接收mission_id if session.login == 1: if session.user: mission_id = web.input().mission_id #先添加任务,再把原来的任务删除 #创建任务 try: mission_duplicate = web.input().mission_duplicate except Exception, e: mission_duplicate = "off" #检查输入信息 result = mission.mission_check(web.input().mission_name, \ web.input().mission_content, web.input().mission_starttime, web.input().mission_plan_end_time) if result == "no error": #存储任务信息 mission.mission_save(web.input().mission_name, session.user, \ web.input().mission_content, web.input().mission_starttime, \ web.input().mission_plan_end_time, mission_duplicate) mission_list = mission.mission_list(account_name=session.user, role='mission_publisher') #return render.my_mission(session.user, mission_list) ajax_result = {"statusCode":"200", "message":"任务修改成功", "callbackType":"closeCurrent"} try: result_del = mission.mission_delete(mission_id) except Exception, e: print e finally: mission_list = mission.mission_list(account_name=session.user, role='mission_publisher')
def GET(self, args): if session.login == 1: if session.user: #找到当前账户所有任务 mission_list = mission.mission_list(account_name=session.user, role=web.input().type) return render_template(type=session.type, template_name='my_'+web.input().type+'.html', user=session.user, mission_list=mission_list, totalCount=len(mission_list)) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
def GET(self,arg): if session.login == 1: if session.user: arg = web.input() mission_id = arg.mission_id mission.mission_audit(mission_id) mission_list = mission.mission_list(account_name=session.user, role='mission_publisher') return render_template(type=session.type, template_name='my_mission_publisher.html', user=session.user, mission_list=mission_list) else:return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else:return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
def POST(self): mission_id = web.input().mission_id if session.login==1: if session.user: result = mission.mission_delete(mission_id) mission_list = mission.mission_list(account_name=session.user, role='mission_publisher') return render_template(type=session.type, template_name='my_mission.html', user=session.user, mission_list=mission_list) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
def POST(self, args): if session.login == 1: if session.user: #找到当前账户所有任务 args = web.input() mission_list = mission.mission_list(account_name=session.user, role=web.input().type,mission_status='执行中') page_info = {} page_info['page'] = pagenum = int(args.pageNum) page_info['count'] = len(mission_list) mission_list = mission_list[(pagenum-1)*30:pagenum*30] mission_list = mission_list[0:30] mission_list = mission.mission_list(account_name=session.user, role=web.input().type,mission_status='执行中') return render_template(type=session.type, \ template_name='my_'+web.input().type+'.html', user=session.user, \ mission_list=mission_list, \ page_info = page_info) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
def GET(self, args): if session.login == 1: if session.user: #找到当前账户所有任务 mission_list = mission.mission_list(account_name=session.user, role=web.input().type,mission_status='执行中') page_info = {'page':1} page_info['count'] = len(mission_list) mission_list = mission_list[0:30] return render_template(type=session.type, \ template_name='my_'+web.input().type+'.html', user=session.user, mission_list=mission_list, \ page_info = page_info) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
def POST(self): #登陆控制 if session.login == 1: if session.user: mission_name = web.input().mission_name mission_content = web.input().mission_content mission_starttime = web.input().mission_starttime mission_plan_end_time = web.input().mission_plan_end_time try: mission_duplicate = web.input().mission_duplicate except: mission_duplicate = "off" #检查任务信息是否合法 result = mission.mission_check(mission_name, mission_content, mission_starttime, mission_plan_end_time) ajax_result = {"statusCode":"300", "message":result} web.header('Content-Type', 'application/json') #如果任务合法,将任务信息存储进MISSION表 if result == "no error": mission.mission_save(mission_name, session.user, mission_content, mission_starttime, mission_plan_end_time, mission_duplicate) mission_list = mission.mission_list(account_name=session.user, role='mission_doer') ajax_result = {"statusCode":"200", "message":"任务新添加成功", "callbackType":"closeCurrent"} return json.dumps(ajax_result) #如果任务不合法,把已填写的表单数据返回给new_mission页面 """ else: return render_template( type=session.type, template_name='new_mission.html', user=session.user, mission_name=mission_name, mission_content=mission_content, mission_starttime=mission_starttime, mission_plan_end_time=mission_plan_end_time, error=result ) """ else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})
def GET(self, args): if session.login == 1: if session.user: #找到当前账户所有任务 #mission_list包含mission_name,mission_id,mission_publisher,mission_starttime,mission_plan_end_time,mission_status,mission_doer mission_list = mission.mission_list(account_name=session.user, role=web.input().type,mission_status='执行中') # if len(mission_list) == 0: # mission_list = [{}] print "mission_list on my_mission" print mission_list page_info = {'page':1} page_info['count'] = len(mission_list) mission_list = mission_list[0:30] return render_template(type=session.type, \ template_name='my_'+web.input().type+'.html',\ user=session.user, \ mission_list=mission_list, \ page_info = page_info) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"}) else: return json.dumps({"statusCode":"301", "message":"会话超时,请重新登录"})