コード例 #1
0
def get_result(filters):
    user_id = frappe.db.get_value("User", filters.get("agent"), "user_id")
    res_list = []
    if user_id:
        request_data = json.dumps({
            "user_id": user_id,
            "project_id": filters.get("project_id")
        })
        if not filters.get("project_id"):
            response = get_builder_projects(request_data)
        else:
            try:
                response = get_project_of_given_id(request_data)
            except Exception, e:
                frappe.throw(e)
            response["data"] = [response.get("data")]
        for prop in response.get("data"):
            proj_id = prop.get("project_id")
            project_id = "<a onclick=get_on_click_trigger('{0}')>{0}</a>".format(
                proj_id)
            res_list.append([
                project_id,
                prop.get("overview"),
                prop.get("project_type"),
                prop.get("project_subtype"),
                prop.get("project_by"),
                prop.get("location"),
                prop.get("status")
            ])
コード例 #2
0
def get_my_projects(doctype, txt, searchfield, start, page_len, filters):
	user_id = frappe.db.get_value("User", filters.get("agent"), "user_id")
	res_list = []
	if user_id:
		request_data = json.dumps({"user_id":user_id})
		response = get_builder_projects(request_data)
		for prop in response.get("data"):
			if re.search(txt, prop.get("project_id"), re.IGNORECASE) or re.search(txt, prop.get("overview"), re.IGNORECASE): 
				res_list.append([prop.get("project_id"),prop.get("overview")])
	return res_list
コード例 #3
0
def get_my_projects(doctype, txt, searchfield, start, page_len, filters):
    user_id = frappe.db.get_value("User", filters.get("agent"), "user_id")
    res_list = []
    if user_id:
        request_data = json.dumps({"user_id": user_id})
        response = get_builder_projects(request_data)
        for prop in response.get("data"):
            if re.search(txt,
                         prop.get("project_id"), re.IGNORECASE) or re.search(
                             txt, prop.get("overview"), re.IGNORECASE):
                res_list.append([prop.get("project_id"), prop.get("overview")])
    return res_list
コード例 #4
0
def get_result(filters):
	user_id = frappe.db.get_value("User", filters.get("agent"), "user_id")
	res_list = []
	if user_id:
		request_data = json.dumps({"user_id":user_id, "project_id":filters.get("project_id")})
		if not filters.get("project_id"):
			response = get_builder_projects(request_data) 
		else: 
			try:
				response = get_project_of_given_id(request_data)
			except Exception,e:
				frappe.throw(e)
			response["data"] = [response.get("data")]
		for prop in response.get("data"):
			proj_id = prop.get("project_id")
			project_id = "<a onclick=get_on_click_trigger('{0}')>{0}</a>".format(proj_id)
			res_list.append([ project_id , prop.get("overview"), prop.get("project_type"),
							prop.get("project_subtype"), prop.get("project_by"), prop.get("location"), 
							prop.get("status")])