Example #1
0
        private void getItensFolder(BsFolder f)
        {
            Business.BsForms fs = new BsForm(f).GetObjects();
            createPageXML();

            for (int i = 0; i < fs.Count; i++)
            {
                Response.Write("<idItem>");
                Response.Write(fs[i].Id + "");
                Response.Write("</idItem>");

                Response.Write("<idUser>");
                Response.Write(fs[i].User.Id + "");
                Response.Write("</idUser>");

                Response.Write("<description>");
                Response.Write(Server.HtmlEncode(fs[i].Name));
                Response.Write("</description>");

                Response.Write("<idFolder>");
                Response.Write(f.Id);
                Response.Write("</idFolder>");
            }

            closePageXML();
        }
Example #2
0
 private void createForm(BsForm f)
 {
     RegisterStartupScript("date", "<script>" + f.MountForm(tbFormMount, false) + "</script>");
     item.GetObject();
     if (form.Anexo && (item.User.Id == usr.Id || usr.Admin || item.Id == 0))
     {
         tbAnexo.Visible = true;
     }
 }
Example #3
0
        private void alterFormLocation(BsForm f, BsFolder fNew)
        {
            f.AlterFormLocation(fNew);
            createPageXML();

            Response.Write("<return>");
            Response.Write("1");
            Response.Write("</return>");

            closePageXML();
        }
Example #4
0
        private void getItensForm(BsForm f)
        {
            string ordem = Convert.ToString(Session["ordem"]);

            if (ordem == null)
            {
                ordem = "desc";
            }
            else
            {
                if (ordem == "asc")
                {
                    ordem = "desc";
                }
                else
                {
                    ordem = "asc";
                }
            }

            Session["ordem"] = ordem;

            Business.BsFields fds = new Business.BsField(f).GetObjects();
            createPageXML();
            string htm = "<TABLE  BORDER=\"1\" bordercolor=\"#ffffff\" width=\"100%\" CELLSPACING=\"2\" CELLPADDING=\"3\">" +
                         "<TR  height=\"20\">" +
                         "<TD background=\"imagens/bordaForm.gif\" width=\"1\" ></TD>" +
                         "<TD background=\"imagens/bordaForm.gif\" width=\"1\" ></TD>";

            BsFields filds      = new BsFields();;
            bool     exceptions = false;

            for (int i = 0; i < fds.Count; i++)
            {
                if (fds[i].Preview)
                {
                    htm += "<TD onmousedown=\"createMenu(4);\" background=\"imagens/bordaForm.gif\" title=\"Clique no campo para organizar em ordem " + (ordem != "asc" ? "ascendente" : "decrescente") + " \" width=\"" + (fds[i].Size * 7) + "\" ><a href=\"javascript:openItemForm( 'tbChild" + f.Id + "', 'block','campo" + fds[i].Id + "' )\"><b>" + fds[i].Name.Replace(":", "") + "</b></a></TD>";
                    filds.Add(fds[i].Id, fds[i]);
                    if (fds[i].ExceptionsUser)
                    {
                        exceptions = true;
                    }
                }
            }

            f.GetObject();

            if (f.EnabledUser)
            {
                htm += "<TD onmousedown=\"createMenu(4);\" background=\"imagens/bordaForm.gif\" title=\"Clique no campo para organizar em ordem " + (ordem != "asc" ? "ascendente" : "decrescente") + " \" width=\"20\" ><a href=\"javascript:openItemForm( 'tbChild" + f.Id + "', 'block','idUser' )\"><b>Usuário</b></a></TD>";
            }
            if (f.EnabledDate)
            {
                htm += "<TD onmousedown=\"createMenu(4);\" background=\"imagens/bordaForm.gif\" title=\"Clique no campo para organizar em ordem " + (ordem != "asc" ? "ascendente" : "decrescente") + " \" width=\"15\" ><a href=\"javascript:openItemForm( 'tbChild" + f.Id + "', 'block','data' )\"><b>Data</b></a></TD>";
            }
            if (f.Anexo)
            {
                htm += "<TD onmousedown=\"createMenu(4);\" background=\"imagens/bordaForm.gif\" width=\"20\" ><b>Anexo</b></TD>";
            }

            htm += "</TR>";

            string field = Convert.ToString(Request["field"]);

            string where = Request["where"];

            BsItensForm itens;

            if (field.Length > 2)
            {
                ordem = field + " " + ordem;
            }
            else
            {
                ordem = "";
            }

            if (usr.Admin)
            {
                itens = new BsItemForm(0, f.Folder, f, null, null, null).GetObjects(ordem, where);
            }
            else
            {
                itens = new BsItemForm(0, f.Folder, f, null, null, usr.Groups).GetObjectsByGroups(ordem, where);
            }

            for (int j = 0; j < itens.Count; j++)
            {
                htm += "<TR style=\"cursor:hand\" bgcolor=\"#ffffff\" id=\"tbItem" + itens[j].Id + "-" + f.Id + "\" idItem=" + itens[j].Id + " idUser="******" exceptions=\"" + exceptions.ToString().ToLower() + "\"  ondblClick=\"EditService( " + itens[j].Id + "," + itens[j].User.Id + "," + f.Id + " )\"  >";
                htm += "<TD width=\"1\" onmousedown=\"createMenuItem();openItem(" + itens[j].Id + ", " + f.Id + ")\" ><img alt=\"Clique e arraste para mover\" width=10 height=10 src=\"imagens/move.gif\" style=\"cursor:move\" onmousedown=\"startDrag('" + itens[j].Id + "','" + itens[j].User.Id + "','Item')\" ></TD>";
                htm += "<TD width=\"1\" onmousedown=\"createMenuItem();openItem(" + itens[j].Id + ", " + f.Id + ")\" ><img alt=\"Clique para abrir os Comentários\" id=\"imgReviews" + itens[j].Id + "-" + itens[j].Form.Id + "\" width=10 height=10 src=\"imagens/setMCima.gif\" style=\"cursor:hand\" onclick=\"openReviewsForm(" + itens[j].Id + ", " + itens[j].Form.Id + ", '', '')\" ></TD>";

                for (int i = 0; i < filds.Count; i++)
                {
                    htm += "<TD onmousedown=\"createMenuItem();openItem(" + itens[j].Id + ", " + f.Id + ")\" >" + itens[j].GFields.GetKey(filds[i]).Value + "</TD>";
                }

                if (f.EnabledDate)
                {
                    htm += "<TD width=\"20\" onmousedown=\"createMenuItem();openItem(" + itens[j].Id + ", " + f.Id + ")\" >" + itens[j].User.Name + "</TD>";
                }
                if (f.EnabledUser)
                {
                    htm += "<TD width=\"15\" onmousedown=\"createMenuItem();openItem(" + itens[j].Id + ", " + f.Id + ")\" >" + itens[j].Date.ToString("dd/MM/yyyy") + "</TD>";
                }
                if (f.Anexo)
                {
                    htm += "<TD width=\"5\" onmousedown=\"createMenu(5);\" >" + (itens[j].ContaisFiles()? "<img src=\"imagens/anexo.gif\">" : "") + "</TD>";
                }
                htm += "</TR>";

                htm += "<TR style=\"display:none\" id=\"itemFormReview" + itens[j].Id + "-" + itens[j].Form.Id + "\" ><TD width=\"10\" bgcolor=\"#F8F5F0\" >&nbsp;</TD><TD width=\"10\" bgcolor=\"#F8F5F0\" >&nbsp;</TD><TD colspan=\"100%\"><nobr><img width=\"10\" height=\"10\" src=\"imagens/26-1.gif\"> Carregando...</nobr></TD></TR>";
            }

            htm += "</TABLE>";

            Response.Write("<return>");
            Response.Write(Server.HtmlEncode(htm));
            Response.Write("</return>");

            Response.Write("<countItem>");
            Response.Write(itens.Count + "");
            Response.Write("</countItem>");

            closePageXML();
        }
Example #5
0
 private void createForm(BsForm f)
 {
     RegisterStartupScript("date", "<script>" + f.MountForm(tbFormMount, true) + "</script>");
 }