def ajax_empresas(request): kendo = Kendo() combo_empresas = None if "lista_empresas" in request.session: if "combo_empresas" not in request.session: combo_empresas = kendo.get_combobox_from_listaempresa(request.session["lista_empresas"]) request.session["combo_empresas"] = combo_empresas else: combo_empresas = request.session["combo_empresas"] return kendo.get_json_kendoui(request, combo_empresas)
def ajax_empresas(request): kendo = Kendo() combo_empresas = None if 'lista_empresas' in request.session: if 'combo_empresas' not in request.session: combo_empresas = kendo.get_combobox_from_listaempresa( request.session['lista_empresas']) request.session['combo_empresas'] = combo_empresas else: combo_empresas = request.session['combo_empresas'] return kendo.get_json_kendoui(request, combo_empresas)
def ajax_tarefas(request): kendo = Kendo() filter = str(request.GET["$filter"].encode("utf-8")) if filter.find("(") == -1: option = int(re.search(r"IdProjeto eq '(.*)'", filter).group(1)) pmo = Pmo() lista_tarefas = pmo.extrairTarefasFromIdProjeto(request, option) request.session["lista_tarefas"] = lista_tarefas combo_tarefas = kendo.get_combobox_from_listatarefas(lista_tarefas) else: combo_tarefas = kendo.get_combobox_from_listatarefas(request.session["lista_tarefas"]) return kendo.get_json_kendoui(request, combo_tarefas)
def ajax_tarefas(request): kendo = Kendo() filter = str(request.GET['$filter'].encode('utf-8')) if filter.find('(') == -1: option = int(re.search(r"IdProjeto eq '(.*)'", filter).group(1)) pmo = Pmo() lista_tarefas = pmo.extrairTarefasFromIdProjeto(request, option) request.session['lista_tarefas'] = lista_tarefas combo_tarefas = kendo.get_combobox_from_listatarefas(lista_tarefas) else: combo_tarefas = kendo.get_combobox_from_listatarefas( request.session['lista_tarefas']) return kendo.get_json_kendoui(request, combo_tarefas)
def ajax_projetos(request): kendo = Kendo() if "lista_projetos" in request.session: filter = str(request.GET["$filter"].encode("utf-8")) if filter.find("(") == -1: lista_projetos = request.session["lista_projetos"] option = int(re.search(r"IdEmpresa eq '(.*)'", filter).group(1)) lista_projetos_selecao = [] for projeto in lista_projetos: if projeto.company_id == option or option == 0: lista_projetos_selecao.append(projeto) request.session["lista_projetos_selecao"] = lista_projetos_selecao combo_projetos = kendo.get_combobox_from_listaprojetos(lista_projetos_selecao) else: combo_projetos = kendo.get_combobox_from_listaprojetos(request.session["lista_projetos_selecao"]) return kendo.get_json_kendoui(request, combo_projetos)
def ajax_projetos(request): kendo = Kendo() if 'lista_projetos' in request.session: filter = str(request.GET['$filter'].encode('utf-8')) if filter.find('(') == -1: lista_projetos = request.session['lista_projetos'] option = int(re.search(r"IdEmpresa eq '(.*)'", filter).group(1)) lista_projetos_selecao = [] for projeto in lista_projetos: if projeto.company_id == option or option == 0: lista_projetos_selecao.append(projeto) request.session['lista_projetos_selecao'] = lista_projetos_selecao combo_projetos = kendo.get_combobox_from_listaprojetos( lista_projetos_selecao) else: combo_projetos = kendo.get_combobox_from_listaprojetos( request.session['lista_projetos_selecao']) return kendo.get_json_kendoui(request, combo_projetos)