You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(146) |
Jun
(188) |
Jul
(11) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: <sv...@de...> - 2005-06-16 18:34:47
|
Author: marcelo
Date: 2005-06-16 14:34:48 -0400 (Thu, 16 Jun 2005)
New Revision: 1336
Modified:
humano2/trunk/core/schema/mssql/mssql-3-view.sql
Log:
FIXED: SQL not working properly.
Modified: humano2/trunk/core/schema/mssql/mssql-3-view.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/core/schema/mssql/mssql-3-view.sql 2005-06-16 18:15:57 =
UTC (rev 1335)
+++ humano2/trunk/core/schema/mssql/mssql-3-view.sql 2005-06-16 18:34:48 =
UTC (rev 1336)
@@ -52,8 +52,8 @@
=20
INSERT INTO textline VALUES (1018, NULL, NULL, NULL, NULL);
=20
-INSERT INTO view ("id_entity","columns","where","idClassView","viewName=
") VALUES (1404,"0,1018","1017^66|4|'[to]'|0|0",1011,"Views of a class V=
iews");
-INSERT INTO view ("id_entity","columns","where","idClassView","viewName=
") VALUES (1405,"0,66","34|4|'[DomainId]'|0|0",2,"View of Domain Clases"=
);
+INSERT INTO [view] ("id_entity","columns","where","idClassView","viewNa=
me") VALUES (1404,'0,1018','1017^66|4|''[to]''|0|0',1011,'Views of a cla=
ss Views');
+INSERT INTO [view] ("id_entity","columns","where","idClassView","viewNa=
me") VALUES (1405,'0,66','34|4|''[DomainId]''|0|0',2,'View of Domain Cla=
ses');
=20
-UPDATE pertinance set "filterView" =3D '1405,DomainId' WHERE id_entity =3D=
57
-UPDATE pertinance set "filterView" =3D '1404,to' WHERE id_entity =3D 71
+UPDATE pertinence set "filterView" =3D '1405,DomainId' WHERE id_entity =3D=
57
+UPDATE pertinence set "filterView" =3D '1404,to' WHERE id_entity =3D 71
|
|
From: <sv...@de...> - 2005-06-16 18:16:03
|
Author: marcelo Date: 2005-06-16 14:15:57 -0400 (Thu, 16 Jun 2005) New Revision: 1335 Added: humano2/trunk/core/schema/mssql/mssql-9-HelpDeskSMB.sql Log: ADDED: schema for helpdesk for MsSQl server Added: humano2/trunk/core/schema/mssql/mssql-9-HelpDeskSMB.sql =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/core/schema/mssql/mssql-9-HelpDeskSMB.sql 2005-06-16 13= :48:30 UTC (rev 1334) +++ humano2/trunk/core/schema/mssql/mssql-9-HelpDeskSMB.sql 2005-06-16 18= :15:57 UTC (rev 1335) @@ -0,0 +1,219 @@ + + +CREATE TABLE "d10160cAsset" ( + id_entity integer NOT NULL, + "c10165Name" varchar(20), + "c10165Serial Nr." varchar(20), + "c10165Details" text, + "c10165User" integer, + "c10165Purchase Data" datetime, + "c10165User1" integer, +PRIMARY KEY (id_entity) +); + +CREATE TABLE "d10160cAsset Type" ( + id_entity integer NOT NULL, + "c10213Type Name" varchar(20), +PRIMARY KEY (id_entity) +); + + +CREATE TABLE "d10160cProblem Type" ( + id_entity integer NOT NULL, + "c10189Problem Type" varchar(20), +PRIMARY KEY (id_entity) +); + + +CREATE TABLE "d10160cTicket" ( + id_entity integer NOT NULL, + "c10162Title" varchar(20), + "c10162Detail" text, + "c10162Request by" integer, + "c10162Assigned to" integer, + "c10162Assigned to1" integer, + "c10162Status" integer, + "c10162Solution Detail" text, + "c10162Problem Type" integer, + "c10162Attachment" varchar(255), + "c10162Date" datetime, + "c10162Resolution Date" datetime, + "c10162Request by1" integer, + "c10162Assigned to2" integer, + "c10162Assigned to3" integer, +PRIMARY KEY (id_entity) +); + +CREATE TABLE "d10160cTicket Status" ( + id_entity integer NOT NULL, + "c10163Status Name" varchar(20), +PRIMARY KEY (id_entity) +); + +INSERT INTO "domain" (id_entity, "domainName", "statusDomain") VALUES (1= 0160, 'HelpDesk SMB', NULL); + +INSERT INTO user_domain (id_entity, "userTable", "domainTable") VALUES (= 10161, 110, 10160); + + +INSERT INTO "class" (id_entity, "classType", "sysName", name, "parentId"= , "isAbstract", "isHidden", "descClass") VALUES (10162, 29, 'd10160cTicke= t', 'Ticket', 3, '0', '0', NULL); +INSERT INTO "class" (id_entity, "classType", "sysName", name, "parentId"= , "isAbstract", "isHidden", "descClass") VALUES (10163, 29, 'd10160cTicke= t Status', 'Ticket Status', 3, '0', '0', NULL); +INSERT INTO "class" (id_entity, "classType", "sysName", name, "parentId"= , "isAbstract", "isHidden", "descClass") VALUES (10165, 29, 'd10160cAsset= ', 'Asset', 3, '0', '0', NULL); +INSERT INTO "class" (id_entity, "classType", "sysName", name, "parentId"= , "isAbstract", "isHidden", "descClass") VALUES (10189, 29, 'd10160cProbl= em Type', 'Problem Type', 3, '0', '0', NULL); +INSERT INTO "class" (id_entity, "classType", "sysName", name, "parentId"= , "isAbstract", "isHidden", "descClass") VALUES (10213, 29, 'd10160cAsset= Type', 'Asset Type', 3, '0', '0', NULL); + +set identity_insert entity ON +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10160, 10, 6, '2005-06-03 13:42:40', '200= 5-06-03 13:42:40', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10161, 10, 26, '2005-06-03 13:42:40', '20= 05-06-03 13:42:40', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10183, 10160, 13, '2005-06-03 13:49:23', = '2005-06-03 13:50:51', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10188, 10160, 13, '2005-06-03 13:51:06', = '2005-06-03 13:51:06', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10191, 10160, 1011, '2005-06-03 13:52:08'= , '2005-06-03 14:00:51', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10180, 10160, 1011, '2005-06-03 13:49:03'= , '2005-06-03 14:01:03', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10213, 10160, 2, '2005-06-03 14:01:25', '= 2005-06-03 14:01:25', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10217, 10160, 8, '2005-06-03 14:02:01', '= 2005-06-03 14:02:01', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10211, 10160, 1400, '2005-06-03 14:00:13'= , '2005-06-03 14:09:25', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10169, 10160, 13, '2005-06-03 13:45:57', = '2005-06-03 14:22:30', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10168, 10160, 8, '2005-06-03 13:45:43', '= 2005-06-03 14:25:37', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10208, 10160, 12, '2005-06-03 13:58:04', = '2005-06-03 14:26:15', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10192, 10160, 81, '2005-06-03 13:52:32', = '2005-06-03 14:28:15', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10229, 10160, 81, '2005-06-03 14:39:34', = '2005-06-03 14:40:29', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10231, 10160, 81, '2005-06-03 14:42:01', = '2005-06-03 14:42:19', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10182, 10160, 1011, '2005-06-03 13:49:16'= , '2005-06-03 14:46:42', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10228, 10160, 1300, '2005-06-03 14:19:33'= , '2005-06-03 14:53:13', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10234, 10160, 81, '2005-06-03 14:54:09', = '2005-06-03 14:54:09', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10167, 10160, 1011, '2005-06-03 13:45:32'= , '2005-06-03 14:55:26', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10187, 10160, 81, '2005-06-03 13:50:34', = '2005-06-03 14:56:52', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10162, 10160, 2, '2005-06-03 13:43:27', '= 2005-06-03 13:43:27', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10163, 10160, 2, '2005-06-03 13:43:46', '= 2005-06-03 13:43:46', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10165, 10160, 2, '2005-06-03 13:45:18', '= 2005-06-03 13:45:18', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10166, 10160, 8, '2005-06-03 13:45:32', '= 2005-06-03 13:45:32', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10179, 10160, 8, '2005-06-03 13:49:03', '= 2005-06-03 13:49:03', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10189, 10160, 2, '2005-06-03 13:51:55', '= 2005-06-03 13:51:55', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10190, 10160, 8, '2005-06-03 13:52:08', '= 2005-06-03 13:52:08', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10171, 10160, 1011, '2005-06-03 13:46:14'= , '2005-06-03 14:11:48', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10218, 10160, 1011, '2005-06-03 14:02:01'= , '2005-06-03 14:12:17', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10216, 10160, 1011, '2005-06-03 14:01:49'= , '2005-06-03 14:12:32', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10207, 10160, 12, '2005-06-03 13:57:45', = '2005-06-03 14:22:45', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10181, 10160, 8, '2005-06-03 13:49:16', '= 2005-06-03 14:26:07', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10209, 10160, 12, '2005-06-03 13:58:16', = '2005-06-03 14:28:37', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10212, 10160, 1400, '2005-06-03 14:00:21'= , '2005-06-03 14:41:01', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10227, 10160, 1011, '2005-06-03 14:14:50'= , '2005-06-03 14:46:50', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10226, 10160, 1011, '2005-06-03 14:14:03'= , '2005-06-03 14:46:59', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10210, 10160, 1400, '2005-06-03 14:00:06'= , '2005-06-03 14:53:42', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10193, 10160, 39, '2005-06-03 13:52:55', = '2005-06-03 14:56:44', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10194, 10160, 10163, '2005-06-03 13:53:51= ', '2005-06-03 13:53:51', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10195, 10160, 10163, '2005-06-03 13:53:59= ', '2005-06-03 13:53:59', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10196, 10160, 10189, '2005-06-03 13:54:17= ', '2005-06-03 13:54:17', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10197, 10160, 10189, '2005-06-03 13:54:46= ', '2005-06-03 13:54:46', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10198, 10160, 10189, '2005-06-03 13:54:53= ', '2005-06-03 13:54:53', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10199, 10160, 10189, '2005-06-03 13:55:04= ', '2005-06-03 13:55:04', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10200, 10160, 10189, '2005-06-03 13:55:17= ', '2005-06-03 13:55:17', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10201, 10160, 10189, '2005-06-03 13:55:41= ', '2005-06-03 13:55:41', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10202, 10160, 10189, '2005-06-03 13:55:49= ', '2005-06-03 13:55:49', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10203, 10160, 10189, '2005-06-03 13:56:15= ', '2005-06-03 13:56:15', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10204, 10160, 10189, '2005-06-03 13:56:25= ', '2005-06-03 13:56:25', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10205, 10160, 10189, '2005-06-03 13:56:36= ', '2005-06-03 13:56:36', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10206, 10160, 10189, '2005-06-03 13:56:46= ', '2005-06-03 13:56:46', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10221, 10160, 10213, '2005-06-03 14:03:01= ', '2005-06-03 14:03:01', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10222, 10160, 10213, '2005-06-03 14:03:11= ', '2005-06-03 14:03:11', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10223, 10160, 10213, '2005-06-03 14:03:19= ', '2005-06-03 14:03:19', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10224, 10160, 10213, '2005-06-03 14:03:27= ', '2005-06-03 14:03:27', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10225, 10160, 10213, '2005-06-03 14:03:34= ', '2005-06-03 14:03:34', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10233, 10160, 10162, '2005-06-03 14:48:54= ', '2005-06-03 14:48:54', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10235, 10160, 10165, '2005-06-03 14:54:50= ', '2005-06-03 14:55:44', NULL, NULL); +INSERT INTO entity (id_entity, "domainId", "class", "createDate", "modDa= te", "delDate", status) VALUES (10232, 10160, 10162, '2005-06-03 14:43:15= ', '2005-06-03 14:57:13', NULL, NULL); +set identity_insert entity OFF + + +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10183, 10162, 'c10162Detail', 'Problem Detail', 0.00, '0', '= 1', '0', '1', '0', '0', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10188, 10162, 'c10162Solution Detail', 'Solution Detail', 0.= 00, '0', '1', '0', '1', '0', '0', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10217, 10213, 'c10213Type Name', 'Type Name', 0.00, '0', '1'= , '0', '1', '0', '1', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10169, 10165, 'c10165Details', 'Details', 10.00, '0', '1', '= 0', '1', '0', '0', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10168, 10165, 'c10165Serial Nr.', 'Serial Nr.', 4.00, '0', '= 1', '0', '1', '0', '0', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10208, 10162, 'c10162Date', 'Date', -9.00, '0', '1', '0', '1= ', '0', '0', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10192, 10162, 'c10162Problem Type', 'Problem Type', -4.00, '= 0', '1', '0', '1', '0', '0', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10229, 10162, 'c10162Request by1', 'Request by', -5.00, '0',= '1', '1', '1', '0', '0', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10231, 10162, 'c10162Assigned to3', 'Assigned to', 0.00, '0'= , '1', '1', '1', '0', '0', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10234, 10165, 'c10165User1', 'User', 0.00, '0', '1', '1', '1= ', '0', '0', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10187, 10162, 'c10162Status', 'Status', 15.00, '0', '1', '0'= , '1', '0', '0', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10166, 10165, 'c10165Name', 'Name', 0.00, '0', '1', '0', '1'= , '0', '1', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10179, 10163, 'c10163Status Name', 'Status Name', 0.00, '0',= '1', '0', '1', '0', '1', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10190, 10189, 'c10189Problem Type', 'Problem Type', 0.00, '0= ', '1', '0', '1', '0', '1', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10207, 10165, 'c10165Purchase Data', 'Purchase Date', 5.00, = '0', '1', '0', '1', '0', '0', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10181, 10162, 'c10162Title', 'Title', -10.00, '0', '1', '0',= '1', '0', '1', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10209, 10162, 'c10162Resolution Date', 'Resolution Date', 8.= 00, '0', '1', '0', '1', '0', '0', '0', '0', NULL, '0', NULL); +INSERT INTO attribute (id_entity, "classId", "sysAttName", "attName", "o= rder", "isObligatory", "isActive", "isSearchable", "isEditable", "isSelfL= ookup", "isPrimary", "isUnique", "isVirtual", "descAtt", protection, disp= lay) VALUES (10193, 10162, 'c10162Attachment', 'Attachment', 20.00, '0', = '1', '0', '1', '0', '0', '0', '0', NULL, '0', NULL); + + +INSERT INTO "dateTime" (id_entity, format, "dispHours", custom) VALUES (= 10207, NULL, NULL, NULL); +INSERT INTO "dateTime" (id_entity, format, "dispHours", custom) VALUES (= 10208, NULL, NULL, NULL); +INSERT INTO "dateTime" (id_entity, format, "dispHours", custom) VALUES (= 10209, NULL, NULL, NULL); + + +INSERT INTO [file] (id_entity, maxsize, path, extensions, link) VALUES (= 10193, 100000, NULL, NULL, '1'); + + +INSERT INTO folder (id_entity, "folderName", "folderParent", "folderForm= s") VALUES (10211, 'Assets', 0, '10167'); +INSERT INTO folder (id_entity, "folderName", "folderParent", "folderForm= s") VALUES (10212, 'Users and Setup', 0, '10191,10180,10218'); +INSERT INTO folder (id_entity, "folderName", "folderParent", "folderForm= s") VALUES (10210, 'Tickets', 0, '10227,10226'); + + +INSERT INTO pertinence (id_entity, "owner", "to", ratio, "parentPertinen= ce", "visualAttrib", "filterView") VALUES (10192, 10192, 10189, 'n:1', NU= LL, NULL, NULL); +INSERT INTO pertinence (id_entity, "owner", "to", ratio, "parentPertinen= ce", "visualAttrib", "filterView") VALUES (10229, 10229, 7, 'n:1', NULL, = NULL, NULL); +INSERT INTO pertinence (id_entity, "owner", "to", ratio, "parentPertinen= ce", "visualAttrib", "filterView") VALUES (10231, 10231, 7, 'n:1', NULL, = NULL, NULL); +INSERT INTO pertinence (id_entity, "owner", "to", ratio, "parentPertinen= ce", "visualAttrib", "filterView") VALUES (10234, 10234, 7, 'n:1', NULL, = NULL, NULL); +INSERT INTO pertinence (id_entity, "owner", "to", ratio, "parentPertinen= ce", "visualAttrib", "filterView") VALUES (10187, 10187, 10163, 'n:1', NU= LL, NULL, NULL); + + +INSERT INTO report (id_entity, columns, "where", groupby, "having", "ord= er", "idClassReport", "reportName") VALUES (10228, '10181|1,10187^10179',= NULL, '10187^10179', NULL, NULL, 10162, 'Tickets by Assignment'); + + +INSERT INTO text (id_entity, "rows", cols, "isHtml") VALUES (10183, 7, 3= 0, '0'); +INSERT INTO text (id_entity, "rows", cols, "isHtml") VALUES (10188, 7, 3= 0, '0'); +INSERT INTO text (id_entity, "rows", cols, "isHtml") VALUES (10169, 7, 3= 0, '0'); + + +INSERT INTO textline (id_entity, "maxLength", "minLength", "defaultText"= , "dispSize") VALUES (10166, 20, NULL, NULL, NULL); +INSERT INTO textline (id_entity, "maxLength", "minLength", "defaultText"= , "dispSize") VALUES (10179, 20, NULL, NULL, NULL); +INSERT INTO textline (id_entity, "maxLength", "minLength", "defaultText"= , "dispSize") VALUES (10190, 20, NULL, NULL, NULL); +INSERT INTO textline (id_entity, "maxLength", "minLength", "defaultText"= , "dispSize") VALUES (10217, 20, NULL, NULL, NULL); +INSERT INTO textline (id_entity, "maxLength", "minLength", "defaultText"= , "dispSize") VALUES (10168, 20, NULL, NULL, NULL); +INSERT INTO textline (id_entity, "maxLength", "minLength", "defaultText"= , "dispSize") VALUES (10181, 20, NULL, NULL, NULL); + + +INSERT INTO "view" (id_entity, columns, "where", groupby, "having", "ord= er", "idClassView", "viewName") VALUES (10218, '0,10217', NULL, NULL, NUL= L, NULL, 10213, 'Asset Type Pick List'); +INSERT INTO "view" (id_entity, columns, "where", groupby, "having", "ord= er", "idClassView", "viewName") VALUES (10227, '0,10181,10208,10231^18,10= 209', '10187^10179|7|''closed''|0|0', NULL, NULL, NULL, 10162, 'Closed Ti= ckets'); +INSERT INTO "view" (id_entity, columns, "where", groupby, "having", "ord= er", "idClassView", "viewName") VALUES (10226, '0,10181,10208,10231^18,10= 187^10179', '10187^10179|7|''open''|0|0', NULL, NULL, NULL, 10162, 'Open = Tickets'); +INSERT INTO "view" (id_entity, columns, "where", groupby, "having", "ord= er", "idClassView", "viewName") VALUES (10191, '0,10190', NULL, NULL, NUL= L, NULL, 10189, 'Problem Type Pick List'); +INSERT INTO "view" (id_entity, columns, "where", groupby, "having", "ord= er", "idClassView", "viewName") VALUES (10180, '0,10179', NULL, NULL, NUL= L, NULL, 10163, 'Ticket Status Pick List'); +INSERT INTO "view" (id_entity, columns, "where", groupby, "having", "ord= er", "idClassView", "viewName") VALUES (10182, '0,10181,10208,10231^18,10= 187^10179', NULL, NULL, NULL, NULL, 10162, 'All Tickets'); +INSERT INTO "view" (id_entity, columns, "where", groupby, "having", "ord= er", "idClassView", "viewName") VALUES (10167, '0,10166,10168,10207,10169= ', NULL, NULL, NULL, NULL, 10165, 'All Assets'); + + +INSERT INTO "d10160cAsset" (id_entity, "c10165Name", "c10165Serial Nr.",= "c10165Details", "c10165User", "c10165Purchase Data", "c10165User1") VAL= UES (10235, 'PC Work Station', '453345345', 'Dell Work Station with Monit= or VisewSonic 14F', NULL, '2005-06-14 00:00:00', 110); + +INSERT INTO "d10160cAsset Type" (id_entity, "c10213Type Name") VALUES (1= 0221, 'PC Work Station'); +INSERT INTO "d10160cAsset Type" (id_entity, "c10213Type Name") VALUES (1= 0222, 'PC Notebook'); +INSERT INTO "d10160cAsset Type" (id_entity, "c10213Type Name") VALUES (1= 0223, 'Monitor'); +INSERT INTO "d10160cAsset Type" (id_entity, "c10213Type Name") VALUES (1= 0224, 'Printer'); +INSERT INTO "d10160cAsset Type" (id_entity, "c10213Type Name") VALUES (1= 0225, 'Other'); + + +INSERT INTO "d10160cProblem Type" (id_entity, "c10189Problem Type") VALU= ES (10196, 'Conectivity'); +INSERT INTO "d10160cProblem Type" (id_entity, "c10189Problem Type") VALU= ES (10197, 'Bug'); +INSERT INTO "d10160cProblem Type" (id_entity, "c10189Problem Type") VALU= ES (10198, 'Crash'); +INSERT INTO "d10160cProblem Type" (id_entity, "c10189Problem Type") VALU= ES (10199, 'Priniting'); +INSERT INTO "d10160cProblem Type" (id_entity, "c10189Problem Type") VALU= ES (10200, 'System Start-up'); +INSERT INTO "d10160cProblem Type" (id_entity, "c10189Problem Type") VALU= ES (10201, 'Audio Visual'); +INSERT INTO "d10160cProblem Type" (id_entity, "c10189Problem Type") VALU= ES (10202, 'Virus'); +INSERT INTO "d10160cProblem Type" (id_entity, "c10189Problem Type") VALU= ES (10203, 'eMail'); +INSERT INTO "d10160cProblem Type" (id_entity, "c10189Problem Type") VALU= ES (10204, 'Software - Windows'); +INSERT INTO "d10160cProblem Type" (id_entity, "c10189Problem Type") VALU= ES (10205, 'Software - Office'); +INSERT INTO "d10160cProblem Type" (id_entity, "c10189Problem Type") VALU= ES (10206, 'Software - Outlook'); + + +INSERT INTO "d10160cTicket" (id_entity, "c10162Title", "c10162Detail", "= c10162Request by", "c10162Assigned to", "c10162Assigned to1", "c10162Stat= us", "c10162Solution Detail", "c10162Problem Type", "c10162Attachment", "= c10162Date", "c10162Resolution Date", "c10162Request by1", "c10162Assigne= d to2", "c10162Assigned to3") VALUES (10233, 'Internet Down', 'User can n= ot connect to the Internet', NULL, NULL, NULL, 10194, NULL, 10196, NULL, = '2005-06-03 00:00:00', '2005-06-03 00:00:00', 110, NULL, 110); +INSERT INTO "d10160cTicket" (id_entity, "c10162Title", "c10162Detail", "= c10162Request by", "c10162Assigned to", "c10162Assigned to1", "c10162Stat= us", "c10162Solution Detail", "c10162Problem Type", "c10162Attachment", "= c10162Date", "c10162Resolution Date", "c10162Request by1", "c10162Assigne= d to2", "c10162Assigned to3") VALUES (10232, 'PC does not startup', 'PC d= oes not startup', NULL, NULL, NULL, 10195, 'PC was not plugged in. I plug= ged in the PC. Now the PC works fine. User happy.', 10200, NULL, '2005-06= -03 00:00:00', '2005-06-03 00:00:00', 110, NULL, 110); + + +INSERT INTO "d10160cTicket Status" (id_entity, "c10163Status Name") VALU= ES (10194, 'open'); +INSERT INTO "d10160cTicket Status" (id_entity, "c10163Status Name") VALU= ES (10195, 'closed'); |
|
From: <sv...@de...> - 2005-06-16 13:48:27
|
Author: pcamacho
Date: 2005-06-16 09:48:30 -0400 (Thu, 16 Jun 2005)
New Revision: 1334
Modified:
humano2/trunk/web/portal/site/readXslt.aspx
Log:
* FIX: when clicking somewhere outside of a pertinence attribute=20
(creation/update of a class) a javascript error was raised.=20
* ADD of comments.
Modified: humano2/trunk/web/portal/site/readXslt.aspx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/readXslt.aspx 2005-06-15 23:36:06 UTC (=
rev 1333)
+++ humano2/trunk/web/portal/site/readXslt.aspx 2005-06-16 13:48:30 UTC (=
rev 1334)
@@ -44,10 +44,18 @@
}
else return "no date";
}
+ =20
+ // These to variables are globals and used by the at=
tribute pertinence (see xsl/pertinence.xsl)
+ // to close an iframe when you click outside of if
var IframeToClose =3D '';
var CurrentIframe =3D '';
=20
- function CloseOpenIframe(e)
+ /**
+ * If one iframe is opened and the user clicks outsi=
de, this iframe is closed
+ * @param IframeToClose: not a real param as it is a=
globlal var... The id of the Iframe to be closed
+ * @param IDEM ... The id of the iframe that has jus=
t been clicked
+ */
+ function CloseOpenIframe()
{
//alert("CurrentIframe: " + CurrentIframe);
if(CurrentIframe !=3D '' ) //Update values
@@ -60,13 +68,16 @@
else //Delete the IframeToClose
{
//alert("IframeToClose:" + IframeToClose);
- var iframe =3D document.getElementById(Ifram=
eToClose);
- iframe.style.visibility =3D 'hidden';
+ if(IframeToClose !=3D '')
+ {
+ var iframe =3D document.getElementById(I=
frameToClose);
+ iframe.style.visibility =3D 'hidden';
+ }
}
}
</script>
</head>
- <body style=3D"MARGIN: 10px" text=3D"#000000" vLink=3D"#000=
000" aLink=3D"#000000" link=3D"#000000" bgColor=3D"#ffffff" onclick=3D"Cl=
oseOpenIframe(Event)">
+ <body style=3D"MARGIN: 10px" text=3D"#000000" vLink=3D"#000=
000" aLink=3D"#000000" link=3D"#000000" bgColor=3D"#ffffff" onclick=3D"Cl=
oseOpenIframe()">
<form method=3D"POST" name=3D"MainForm" enctype=3D"multi=
part/form-data" target=3D"mainFrame" onsubmit=3D"return saveInstance(true=
)">
<xsl:attribute name=3D"action">
<xsl:if test=3D"/page/flagaction=3D'Create'">
|
|
From: <sv...@de...> - 2005-06-15 23:36:07
|
Author: marcelo Date: 2005-06-15 19:36:06 -0400 (Wed, 15 Jun 2005) New Revision: 1333 Added: humano2/trunk/web/builder/site/importWz-step1.aspx humano2/trunk/web/builder/site/importWz-step1.aspx.cs humano2/trunk/web/builder/site/importWz-step2.aspx humano2/trunk/web/builder/site/importWz-step2.aspx.cs humano2/trunk/web/builder/site/importWz-step3.aspx humano2/trunk/web/builder/site/importWz-step3.aspx.cs Modified: humano2/trunk/README.txt humano2/trunk/web/builder/Builder.csproj humano2/trunk/web/builder/site/leftbar.aspx humano2/trunk/web/portal/portal.csproj Log: CHANGE: README.txt - Updated URLs ADDED: Import related files. Changed Projects to reflect new files Modified: humano2/trunk/README.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/README.txt 2005-06-15 23:05:11 UTC (rev 1332) +++ humano2/trunk/README.txt 2005-06-15 23:36:06 UTC (rev 1333) @@ -8,20 +8,21 @@ About this Release =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -This release is part of the 4.9.x Humano2 experimental releases. This +This release is part of the 5.0.x Humano2 experimental releases. This is a developer release. They contain many untested and new functions. This release only has comunity support.=20 =20 -For further information -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +For further information and support +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 For more information you can consult:=20 -Humano2 user community (http://www.humano2.org) +Humano2 user community (http://www.humano2.com/network) The developer community (http://devel.humano2.org) =20 Subscribe to the mailling lists at list.humano2.org The IRC channel #humano2 on the irc.freenode.net servers. =20 + Commercial support =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 Modified: humano2/trunk/web/builder/Builder.csproj =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/Builder.csproj 2005-06-15 23:05:11 UTC (rev= 1332) +++ humano2/trunk/web/builder/Builder.csproj 2005-06-15 23:36:06 UTC (rev= 1333) @@ -442,6 +442,36 @@ BuildAction =3D "Compile" /> <File + RelPath =3D "site\importWz-step1.aspx" + BuildAction =3D "Content" + /> + <File + RelPath =3D "site\importWz-step1.aspx.cs" + DependentUpon =3D "importWz-step1.aspx" + SubType =3D "ASPXCodeBehind" + BuildAction =3D "Compile" + /> + <File + RelPath =3D "site\importWz-step2.aspx" + BuildAction =3D "Content" + /> + <File + RelPath =3D "site\importWz-step2.aspx.cs" + DependentUpon =3D "importWz-step2.aspx" + SubType =3D "ASPXCodeBehind" + BuildAction =3D "Compile" + /> + <File + RelPath =3D "site\importWz-step3.aspx" + BuildAction =3D "Content" + /> + <File + RelPath =3D "site\importWz-step3.aspx.cs" + DependentUpon =3D "importWz-step3.aspx" + SubType =3D "ASPXCodeBehind" + BuildAction =3D "Compile" + /> + <File RelPath =3D "site\index.aspx" SubType =3D "Form" BuildAction =3D "Content" @@ -475,6 +505,11 @@ BuildAction =3D "Compile" /> <File + RelPath =3D "site\leftbar.aspx.resx" + DependentUpon =3D "leftbar.aspx.cs" + BuildAction =3D "EmbeddedResource" + /> + <File RelPath =3D "site\portalXslt.aspx" BuildAction =3D "Content" /> @@ -589,6 +624,11 @@ BuildAction =3D "Compile" /> <File + RelPath =3D "site\xBarFrame.aspx.resx" + DependentUpon =3D "xBarFrame.aspx.cs" + BuildAction =3D "EmbeddedResource" + /> + <File RelPath =3D "site\GFX\1x1.gif" BuildAction =3D "Content" /> Added: humano2/trunk/web/builder/site/importWz-step1.aspx =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/importWz-step1.aspx 2005-06-15 23:05:1= 1 UTC (rev 1332) +++ humano2/trunk/web/builder/site/importWz-step1.aspx 2005-06-15 23:36:0= 6 UTC (rev 1333) @@ -0,0 +1,43 @@ +<%@ Page language=3D"c#" Codebehind=3D"importWz-step1.aspx.cs" AutoEvent= Wireup=3D"false" Inherits=3D"Portal.site.import" %> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > +<HTML> + <HEAD> + <title>import</title> + <meta content=3D"C#" name=3D"CODE_LANGUAGE"> + </HEAD> + <body > + <form id=3D"Form1" action=3D"importWz-step2.aspx" method=3D"post" encT= ype=3D"multipart/form-data"> + <input type=3D"hidden" name=3D"domainID" value=3D"<%GetDomain();%>"> + <table> + <tr> + <td>1. Select which class you wish to populate</td> + <td><SELECT id=3D"classId" name=3D"classId"> + <OPTION value=3D"0" selected>Select a class to import</OPTION> + <% GetClasses(); %> + </SELECT> + </td> + </tr> + <tr> + <td>2. Choose an ASCII file to upload:</td> + <td><INPUT id=3D"File1" type=3D"file" name=3D"File1"></td> + </tr> + <tr> + <td>3. Field delimitator:</td> + <td><input type=3D"radio" id=3D"delimitator" name=3D"delimitator" v= alue=3D"tab">Tab + <input type=3D"radio" id=3D"delimitator" name=3D"delimitator" valu= e=3D";">Semi-colon + <input type=3D"radio" id=3D"delimitator" name=3D"delimitator" valu= e=3D",">Coma + </td> + </tr> + <tr> + <td>4. Text qualifier:</td> + <td><input type=3D"radio" id=3D"qualifier" name=3D"qualifier" value= =3D"single">single quote(') + <input type=3D"radio" id=3D"qualifier" name=3D"qualifier" value=3D= "double">double quote (") + </td> + </tr> + <tr> + <td colspan=3D"2" align=3D"center"><INPUT id=3D"cmdUpload" type=3D"= submit" value=3D"Upload" name=3D"cmdUpload"></td> + </tr> + </table> + </form> + </body> +</HTML> Added: humano2/trunk/web/builder/site/importWz-step1.aspx.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/importWz-step1.aspx.cs 2005-06-15 23:0= 5:11 UTC (rev 1332) +++ humano2/trunk/web/builder/site/importWz-step1.aspx.cs 2005-06-15 23:3= 6:06 UTC (rev 1333) @@ -0,0 +1,90 @@ +// +// The Humano2 Business solution. +// Copyright (C) 2004,5 Humano2 Chile S.A. (http://www.humano2.com) +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. =20 +// +// $Id: importWz-step1.aspx.cs 921 2005-05-09 22:39:26Z marcelo $ +// + +using System; +using System.Collections; +using System.ComponentModel; +using System.Data; +using System.Data.SqlClient; +using System.Drawing; +using System.Web; +using System.Web.SessionState; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.HtmlControls; + +using Humano2.Components.WebTools; + +namespace Portal.site +{ + /// <summary> + /// Summary description for import. + /// </summary> + public class import : basePage + { + private int domainId; + private void Page_Load(object sender, System.EventArgs e) + { + + // FIXME : cuando este funccionando el codigo de arriba (se guarde el= id del dominio en la sesion) eliminar esta linea + =09 + domainId =3D userCred.DomainIds[userCred.CurrentDomainIndex]; + } + ///<summary>Generates list of classes which can be imported into a spe= cific domain.</summary> + ///<param name=3D"domainID">Id of the domain which we are importing in= to.</param> + public void GetClasses() + { + int[] classIds; + string[] classNames; + adapter dbAdapter =3D userCred.CoreAdapter; + + dbAdapter.ClassByDomainId(domainId, out classNames,out classIds); + =09 + Response.Write("<option value=3D\"8\" >textline</option>\r\n"); + for (int i=3D0;i<classIds.Length;i++) + { + Response.Write("<option value=3D\"" + classIds[i] + "\" >" + classN= ames[i] + "</option>\r\n"); +// getViews(Convert.ToString(cd[i*2])); +// Response.Write(@"<UL><a href=3D""createInstance.aspx?id_entity=3D"= +cd[i*2]+@""" target=3D""mainFrame"">Crear: "+cd[i*2+1]+"</a></UL>"); + + } + =09 + } +=09 + public void GetDomain() + { + Response.Write(domainId); + } + + #region Web Form Designer generated code + override protected void OnInit(EventArgs e) + { + // + // CODEGEN: This call is required by the ASP.NET Web Form Designer. + // + InitializeComponent(); + base.OnInit(e); + } + =09 + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { =20 + this.Load +=3D new System.EventHandler(this.Page_Load); + + } + #endregion + + } +} Added: humano2/trunk/web/builder/site/importWz-step2.aspx =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/importWz-step2.aspx 2005-06-15 23:05:1= 1 UTC (rev 1332) +++ humano2/trunk/web/builder/site/importWz-step2.aspx 2005-06-15 23:36:0= 6 UTC (rev 1333) @@ -0,0 +1,30 @@ +<%@ Page language=3D"c#" Codebehind=3D"importWz-step2.aspx.cs" AutoEvent= Wireup=3D"false" Inherits=3D"Portal.site.import2" %> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > +<HTML> + <HEAD> + <title>import2</title> + <meta content=3D"C#" name=3D"CODE_LANGUAGE"> + </HEAD> + <body> + <form id=3D"Form1" method=3D"post" action=3D"importWz-step3.aspx"> + <table> + <tr> + <td colspan=3D"3">The system tried to automatically match up the fi= elds from the=20 + textfile with the fields in the database, please double check the = match-ups and=20 + match-up any missing columns.<br> + If you are updating the information in the database, please select= wich column=20 + should be used as the key.</td> + </tr> + <tr> + <td>Databse Column</td> + <td>Text file Field</td> + <td>Update field</td> + </tr> + <% GetAttributesList(); %> + <tr> + <td colspan=3D"2"><input type=3D"submit" value=3D"Continuar"></td> + </tr> + </table> + </form> + </body> +</HTML> Added: humano2/trunk/web/builder/site/importWz-step2.aspx.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/importWz-step2.aspx.cs 2005-06-15 23:0= 5:11 UTC (rev 1332) +++ humano2/trunk/web/builder/site/importWz-step2.aspx.cs 2005-06-15 23:3= 6:06 UTC (rev 1333) @@ -0,0 +1,348 @@ +//=20 +// The Humano2 Business solution.=20 +// Copyright (C) 2004,5 Humano2 Chile S.A. (http://www.humano2.com)=20 +//=20 +// This program is free software; you can redistribute it and/or modify=20 +// it under the terms of the GNU General Public License as published by=20 +// the Free Software Foundation; either version 2 of the License, or=20 +// (at your option) any later version. =20 +//=20 +// $Id: config.cs 295 2005-02-17$ + +using System; +using System.Collections; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.IO; +using System.Text; +using System.Web; +using System.Web.SessionState; +using System.Web.UI; +using System.Web.UI.WebControls; + +using Humano2.Components.WebTools; +using Humano2.Core; + + +namespace Portal.site +{ + /// <summary> + /// Summary description for import2. + /// </summary> + public class import2 : basePage + { + private Hashtable formObjList =3D new Hashtable(); + private int userId, domainId, maxsize; + private string basePath, baseDir; + private int uploaded =3D 0; + private string pathFilename; + private int classId; + private double now =3D DateTime.Now.ToOADate(); + private char qualifier, delimitator ; + + private void Page_Load(object sender, System.EventArgs e) + { + =09 + userId =3D userCred.UserId; + domainId =3D userCred.DomainIds[userCred.CurrentDomainIndex]; + basePath =3D Humano2.Core.Config.Instance().GetAbsoluteLocation("clie= ntPath") + "\\import\\uploadTmp\\"; + + LoadXMLvals(); + + ProcessRequest(); + + if (!formObjList.Contains("classId") || !formObjList.Contains("delimi= tator")) + return; + + classId =3D Convert.ToInt32(formObjList["classId"].ToString()); + if (formObjList["delimitator"].ToString() =3D=3D "tab") + { + delimitator =3D Convert.ToChar("\t"); + }else{ + delimitator =3D Convert.ToChar(formObjList["delimitator"].ToString()= ); + } + if (formObjList.Contains("qualifier")) + qualifier =3D Convert.ToChar(formObjList["qualifier"].ToString()); + + if (uploaded =3D=3D 0 && pathFilename !=3D "") + { + Response.Write("El archivo NO se subio, este no debe ser mayor a " += maxsize + " Bytes"); + return; + } + else + { + + File.Move(pathFilename, pathFilename.Replace(now.ToString(),"idDomai= n-idUser"+now)); + pathFilename =3D pathFilename.Replace(now.ToString(),"idDomain-idUse= r"+now.ToString()); +=09 + } + + } + + ///<summary>Sets the variable values.</summary> + ///<remarks>Eventually these values should be read from an XML config = file</remarks> + private void LoadXMLvals() + { + maxsize =3D 0; + } + + + ///<summary>Fills the dictionay with the form name/value pair and trie= s to upload the file.</summary> + ///<remarks>Perhaps the 2 things should be seperated into seperate fun= ctions.</remarks> + private void ProcessRequest() + { + =09 + // Put user code to initialize the page here + string sPostData =3D ""; + + // get form-data + byte [] biData =3D Request.BinaryRead (Request.TotalBytes); + =20 + // convert byte-array to its string representation + sPostData =3D System.Text.Encoding.Default.GetString (biData, 0, biDa= ta.Length); + =20 + // we get the content type and try to pull out the boundary informati= on + string sContentType =3D Request.ContentType; + string [] arrContentType =3D sContentType.Split (new char [] {';'}); + + if (arrContentType [0] =3D=3D "multipart/form-data") + { + // parse the boundary information + string [] arrBoundary =3D arrContentType [1].Trim ().Split (new char= [] {'=3D'}); + string sBoundary =3D "--" + arrBoundary [1].Trim (); + + // on a Windows98/IE5.0x machine the boundary ends with the enctype, + // so we just cut that off + if (sBoundary.IndexOf (",multipart/form-data") >=3D 0) + { + sBoundary =3D sBoundary.Replace (",multipart/form-data", ""); + } + + // loop for every item in the forms collection (enclosed by the boun= dary) + string sTemp =3D sPostData; + int iStartBoundary =3D sTemp.IndexOf (sBoundary, 0); + int i =3D 0; + bool bEndForm =3D false; + if (iStartBoundary >=3D 0) + { + // start: loop for form items + do + { + string sFormField =3D ""; + string sFormValue =3D ""; + + // parse the item's name and general information + int iStartField =3D iStartBoundary + sBoundary.Length + 2; + string sCRLF =3D sTemp.Substring (iStartBoundary + sBoundary.Lengt= h, 2); + int iStartCRLF =3D sTemp.IndexOf (sCRLF, iStartField); + int iStartNextBoundary =3D sTemp.IndexOf (sBoundary, iStartField); + sFormField =3D sTemp.Substring (iStartField, iStartCRLF - iStartFi= eld); + + // is the current item the <input type=3D"file">? + if (sFormField.IndexOf ("filename=3D") >=3D 0) + { + // then the next line contains the content-type of the uploaded f= ile + int iStartFieldContentType =3D iStartCRLF + 2; + iStartCRLF =3D sTemp.IndexOf (sCRLF, iStartFieldContentType); + string sFieldContentType =3D sTemp.Substring (iStartFieldContentT= ype, iStartCRLF - iStartFieldContentType); + + sFormField +=3D "; " + sFieldContentType; + } + + // parse the item's name + int iStartFieldName =3D sFormField.IndexOf (" name=3D"); + string sFieldName =3D sFormField.Substring (iStartFieldName + 7, s= FormField.Length - iStartFieldName - 7); + int iEndFieldName =3D sFieldName.IndexOf (";"); + if (iEndFieldName =3D=3D -1) iEndFieldName =3D sFieldName.Length; + sFieldName =3D sFieldName.Substring (0, iEndFieldName - 1); + + // parse the item's value + int iStartValue =3D iStartCRLF + 4; + iStartCRLF =3D sTemp.IndexOf (sCRLF, iStartValue); + int iEndValue =3D iStartNextBoundary - iStartValue - 2; + sFormValue =3D sTemp.Substring (iStartValue, iEndValue); + + // is the current item the <input type=3D"file">? + if (sFormField.IndexOf ("filename=3D") >=3D 0) + { + // parse the name of the uploaded file (without the path) + int iStartFileName =3D sFormField.IndexOf ("filename=3D"); + string sFileName =3D sFormField.Substring (iStartFileName + 10, s= FormField.Length - iStartFileName - 10); + int iEndFileName =3D sFileName.IndexOf (";"); + sFileName =3D sFileName.Substring (0, iEndFileName - 1); + int iPos =3D sFileName.LastIndexOf ("\\"); + iPos++; + sFileName =3D sFileName.Substring (iPos, sFileName.Length - iPos)= ; + + // parse the content-type of the uploaded file + + // get the binary data of the uploaded file + byte [] bFileContent =3D Encoding.Default.GetBytes (sFormValue); + =09 + if (maxsize =3D=3D 0 || (maxsize > 0 && bFileContent.Length <=3D= maxsize )) + { + // we could save the uploaded file here + pathFilename =3D basePath + now + sFileName ; + FileStream fs =3D new FileStream (pathFilename, FileMode.Create,= FileAccess.Write); + //fs.Write (bAux, 0, bFileContent.Length); + fs.Write (bFileContent, 0, bFileContent.Length); + fs.Close (); + uploaded =3D 1; + } + + // write file to db here + =20 + ViewState ["UrlReferrer4ChapterImage"] +=3D "true"; + + formObjList.Add(sFieldName,baseDir + sFileName); + + }else + formObjList.Add(sFieldName,sFormValue); + + // cut off the current item from the rest of the post data + sTemp =3D sTemp.Substring (iStartValue + iEndValue + 2, sTemp.Leng= th - iStartValue - iEndValue - 2); + =20 + // look for the next item + iStartBoundary =3D sTemp.IndexOf (sBoundary, 0); + + // the last item ends with two additional hyphens + if (sTemp.Substring (0, sBoundary.Length + 2) =3D=3D sBoundary + "= --") + { + bEndForm =3D true; + } + + // increment the counter + i++; + } while (iStartBoundary >=3D 0 && !bEndForm); + // end of: loop for form items + } + } + } + + + ///<summary>Builds the interface to match-up the columns to be importe= d.</summary> + ///<param name=3D"classId">Id of the class which we are importing into= .</param> + ///<remarks>Currently generates HTML, should change to XML.</remarks> + public void GetAttributesList() + { + =09 + DataSet dsAtts =3D new DataSet(); + string rawFileFields; + string allDbAtts =3D ""; + bool dateCols =3D false; + //Read the first line of the file uploaded + using (StreamReader sr =3D new StreamReader(pathFilename))=20 + { + if ((rawFileFields =3D sr.ReadLine()) =3D=3D null)=20 + { + Response.Write ("File is Empty"); + } + } + =09 + string[] colsArr =3D rawFileFields.Split(delimitator); + =09 + //absCrud crud =3D Factory.Crud(); + //This section will need to be modified in the future to restrict=20 + // the attributes which the user can manipulate + //DataSet dsAtts=3D crud.ReadStructure(classId); + + //For debuging reasons I use these 2 calls to get the XML version of = the dataset. + adapter dbAdapter =3D new adapter(); + string xmlStr =3D dbAdapter.ReadStructureAsXml(classId); + + StringReader strReader =3D new StringReader(xmlStr);=20 + dsAtts.ReadXml(strReader); + + //load allowed or forbiden attributes (to be definded) + // attribs =3D somefunc(classId); + + StringBuilder HtmlData =3D new StringBuilder(); + StringWriter swHtml =3D new StringWriter(HtmlData); + + + if(dsAtts.Tables.Contains("attribute")) + { + if(dsAtts.Tables["attribute"].Rows.Count>0) + { + foreach(DataRow attRow in dsAtts.Tables["attribute"].Rows) + { + if (attRow["classId"].ToString() !=3D "3") + { + if (attRow["refClassSysName"].ToString() =3D=3D "dateTime") + dateCols =3D true; + + allDbAtts =3D allDbAtts + attRow["id_entity"].ToString() +","; + // if attribute is allowed to be manipulated... + swHtml.WriteLine("<tr><td>" + attRow["attName"].ToString() + "</t= d>" ); + swHtml.WriteLine("<td><select name=3D\"strFieldPosName\">"); + swHtml.WriteLine("<option value=3D\"0\">Select an Attribute</opti= on>"); + int i; + for (i=3D0;i<colsArr.Length;i++) + { + if (colsArr[i].ToUpper() !=3D "ID") + { + swHtml.Write("<option value=3D'" + Convert.ToString(i + 1) + "|= " + colsArr[i] + "' "); + if (attRow["attName"].ToString().ToUpper() =3D=3D colsArr[i].Tr= im().ToUpper()) swHtml.Write(" SELECTED "); + swHtml.Write(">" + colsArr[i] + "</option>\r\n") ; + } + } + swHtml.WriteLine("</select>"); + swHtml.WriteLine("</td><td><input type=3D\"checkbox\" name=3D\"up= dateAtts\" value=3D\""+ attRow["id_entity"].ToString() + "\">"); + swHtml.WriteLine("</tr>"); + } + } + }else + Response.Write ("This class has no attributes defined"); + }else + Response.Write ("This class has no attributes defined"); + if (dateCols) + { + // text to be obtained from language file + swHtml.WriteLine("<tr><td>Por favor indica en que formato estan las = fechas</td>" ); + swHtml.WriteLine("<td><select name=3D\"dateFormat\">"); + swHtml.WriteLine("<option value=3D'mm/dd/yyyy'>mm/dd/yyyy</option>")= ; + swHtml.WriteLine("<option value=3D'mm-dd-yyyy'>mm-dd-yyyy</option>")= ; + swHtml.WriteLine("<option value=3D'dd/mm/yyyy'>dd/mm/yyyy</option>")= ; + swHtml.WriteLine("<option value=3D'dd-mm-yyyy'>dd-mm-yyyy</option>")= ; + swHtml.WriteLine("<option value=3D'yyyy-mm-dd'>yyyy-mm-dd</option>")= ; + swHtml.WriteLine("<option value=3D'yyyy/mm/dd'>yyyy/mm/dd</option>")= ; + swHtml.WriteLine("</select>"); + }else + swHtml.WriteLine("<input type=3D\"hidden\" name=3D\"dateFormat\" val= ue=3D\"\">"); + + swHtml.WriteLine("<input type=3D\"hidden\" name=3D\"classId\" value=3D= \"" + classId + "\">"); + swHtml.WriteLine("<input type=3D\"hidden\" name=3D\"delimitator\" val= ue=3D\"" + delimitator + "\">"); + swHtml.WriteLine("<input type=3D\"hidden\" name=3D\"qualifier\" value= =3D\"" + qualifier + "\">"); + swHtml.WriteLine("<input type=3D\"hidden\" name=3D\"srcFile\" value=3D= \"" + pathFilename + "\">"); + swHtml.WriteLine("<input type=3D\"hidden\" name=3D\"rawFileFields\" v= alue=3D\"" + rawFileFields + "\">"); + swHtml.WriteLine("<input type=3D\"hidden\" name=3D\"allDbAtts\" value= =3D\"" + allDbAtts.Substring(0,allDbAtts.Length-1) + "\">"); + =09 + swHtml.Flush(); + swHtml.Close(); + + Response.Write (swHtml.ToString()); + } + + + #region Web Form Designer generated code + override protected void OnInit(EventArgs e) + { + // + // CODEGEN: This call is required by the ASP.NET Web Form Designer. + // + InitializeComponent(); + base.OnInit(e); + } + =09 + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { =20 + this.Load +=3D new System.EventHandler(this.Page_Load); + } + #endregion + } +} Added: humano2/trunk/web/builder/site/importWz-step3.aspx =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/importWz-step3.aspx 2005-06-15 23:05:1= 1 UTC (rev 1332) +++ humano2/trunk/web/builder/site/importWz-step3.aspx 2005-06-15 23:36:0= 6 UTC (rev 1333) @@ -0,0 +1,13 @@ +<%@ Page language=3D"c#" Codebehind=3D"importWz-step3.aspx.cs" AutoEvent= Wireup=3D"false" Inherits=3D"Portal.site.import3" %> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > +<HTML> + <HEAD> + <title>import3</title> + <meta name=3D"CODE_LANGUAGE" Content=3D"C#"> + </HEAD> + <body > + <% createFiles(); %> + Your file is ready to be uploaded. + + </body> +</HTML> Added: humano2/trunk/web/builder/site/importWz-step3.aspx.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/importWz-step3.aspx.cs 2005-06-15 23:0= 5:11 UTC (rev 1332) +++ humano2/trunk/web/builder/site/importWz-step3.aspx.cs 2005-06-15 23:3= 6:06 UTC (rev 1333) @@ -0,0 +1,119 @@ +//=20 +// The Humano2 Business solution.=20 +// Copyright (C) 2004,5 Humano2 Chile S.A. (http://www.humano2.com)=20 +//=20 +// This program is free software; you can redistribute it and/or modify=20 +// it under the terms of the GNU General Public License as published by=20 +// the Free Software Foundation; either version 2 of the License, or=20 +// (at your option) any later version. =20 +//=20 +// $Id: config.cs 295 2005-02-17$ + +using System; +using System.Collections; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Web; +using System.Web.SessionState; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.HtmlControls; +using System.IO; +using Humano2.Components.WebTools; + +namespace Portal.site +{ + /// <summary> + /// Summary description for import3. + /// </summary> + public class import3 : basePage + { + private int userId, domainId, classId; + private string delimitator, qualifier, dbAtts, fileAtts, rawFileField= s, srcFile; + private string baseDir, updateAtts; + private string[] arrFieldPosName, allDbAtts; + + private void Page_Load(object sender, System.EventArgs e) + { + // FIXME : cuando este funccionando el codigo de arriba (se guarde el= id del dominio en la sesion) eliminar esta linea + //userId =3D userCred.Id; + //domainId =3D userCred.Domain; + userId =3D userCred.UserId; + domainId =3D userCred.DomainIds[userCred.CurrentDomainIndex]; + + baseDir =3D Humano2.Core.Config.Instance().GetAbsoluteLocation("clien= tPath"); + classId =3D Convert.ToInt32(Request.Form["classId"]); + delimitator =3D Request.Form["delimitator"]; + qualifier =3D Request.Form["qualifier"]; + updateAtts =3D Request.Form["updateAtts"]; + allDbAtts =3D Request.Form["allDbAtts"].Split(','); + rawFileFields =3D Request.Form["rawFileFields"]; + srcFile =3D Request.Form["srcFile"]; + arrFieldPosName =3D Request.Form["strFieldPosName"].Split(','); + } + + public void createFiles() + { + string basename; + int i; + //remove the path from the file name + int iPos =3D srcFile.LastIndexOf ("\\"); + iPos++; + basename =3D srcFile.Substring (iPos, srcFile.Length - iPos); + for (i=3D0;i<arrFieldPosName.Length;i++) + { + if (arrFieldPosName[i] !=3D "0")=20 + { + dbAtts =3D dbAtts + allDbAtts[i] + ","; + fileAtts =3D fileAtts + arrFieldPosName[i].Substring(0,arrFieldPosN= ame[i].IndexOf("|")) + ","; + + } + } + dbAtts =3D dbAtts.Substring(0,dbAtts.Length -1); + fileAtts =3D fileAtts.Substring(0,fileAtts.Length -1); + + //remove the path from the file extension and add the .xml extension + iPos =3D basename.LastIndexOf ("."); + basename =3D basename.Substring (0, iPos) + ".xml"; + =09 + using (StreamWriter sw =3D new StreamWriter(baseDir + "\\import\\toBe= Procesed\\"+basename))=20 + { + sw.WriteLine("<?xml version=3D\"1.0\" encoding=3D\"UTF-8\"?>"); + sw.WriteLine("<config>"); + sw.WriteLine(" <userId>" + userId + "</userId>"); + sw.WriteLine(" <domainId>" + domainId + "</domainId>"); + sw.WriteLine(" <classId>" + classId + "</classId>"); + sw.WriteLine(" <delimitator>" + delimitator + "</delimitator>"); + sw.WriteLine(" <qualifier>" + qualifier + "</qualifier>"); + sw.WriteLine(" <updateAtts>" + updateAtts + "</updateAtts>"); + sw.WriteLine(" <dbAtts>" + dbAtts + "</dbAtts>"); + sw.WriteLine(" <fileAtts>" + fileAtts + "</fileAtts>"); + sw.WriteLine(" <rawFileFields>" + rawFileFields + "</rawFileFields>"= ); + sw.WriteLine("</config>"); + + } + File.Move(srcFile,baseDir + "\\import\\toBeProcesed\\" + basename.Rep= lace(".xml","-TMP.TXT")); =09 + } + + #region Web Form Designer generated code + override protected void OnInit(EventArgs e) + { + // + // CODEGEN: This call is required by the ASP.NET Web Form Designer. + // + InitializeComponent(); + base.OnInit(e); + } + =09 + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { =20 + this.Load +=3D new System.EventHandler(this.Page_Load); + } + #endregion + } +} Modified: humano2/trunk/web/builder/site/leftbar.aspx =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/leftbar.aspx 2005-06-15 23:05:11 UTC (= rev 1332) +++ humano2/trunk/web/builder/site/leftbar.aspx 2005-06-15 23:36:06 UTC (= rev 1333) @@ -193,6 +193,14 @@ </a> </td> <tr> =09 + <tr id=3D'1' fname=3D'Application' style=3D"cursor: hand;"> + <td id=3D'folder1' align=3D"center" width=3D"100%" nowrap> + <a target=3D"mainFrame" href=3D"importWz-step1.aspx"> + <img src=3D"img/icon_import_XL.gif" border=3D0><br> + Import Data + </a> + </td> + <tr> =09 </table>=20 </div> =09 <!-- </td> Modified: humano2/trunk/web/portal/portal.csproj =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/portal/portal.csproj 2005-06-15 23:05:11 UTC (rev 1= 332) +++ humano2/trunk/web/portal/portal.csproj 2005-06-15 23:36:06 UTC (rev 1= 333) @@ -167,7 +167,7 @@ <File RelPath =3D "site\domain.aspx.cs" DependentUpon =3D "domain.aspx" - SubType =3D "Code" + SubType =3D "ASPXCodeBehind" BuildAction =3D "Compile" /> <File @@ -199,7 +199,7 @@ <File RelPath =3D "site\index.aspx.cs" DependentUpon =3D "index.aspx" - SubType =3D "Code" + SubType =3D "ASPXCodeBehind" BuildAction =3D "Compile" /> <File @@ -209,7 +209,7 @@ <File RelPath =3D "site\indexPortal.aspx.cs" DependentUpon =3D "indexPortal.aspx" - SubType =3D "Code" + SubType =3D "ASPXCodeBehind" BuildAction =3D "Compile" /> <File @@ -234,7 +234,7 @@ <File RelPath =3D "site\instancedelete.aspx.cs" DependentUpon =3D "instancedelete.aspx" - SubType =3D "Code" + SubType =3D "ASPXCodeBehind" BuildAction =3D "Compile" /> <File @@ -286,7 +286,7 @@ <File RelPath =3D "site\Report.aspx.cs" DependentUpon =3D "Report.aspx" - SubType =3D "Code" + SubType =3D "ASPXCodeBehind" BuildAction =3D "Compile" /> <File @@ -306,7 +306,7 @@ <File RelPath =3D "site\showView.aspx.cs" DependentUpon =3D "showView.aspx" - SubType =3D "Code" + SubType =3D "ASPXCodeBehind" BuildAction =3D "Compile" /> <File @@ -322,7 +322,7 @@ <File RelPath =3D "site\topbar.aspx.cs" DependentUpon =3D "topbar.aspx" - SubType =3D "Code" + SubType =3D "ASPXCodeBehind" BuildAction =3D "Compile" /> <File @@ -363,7 +363,7 @@ <File RelPath =3D "site\viewrelations.aspx.cs" DependentUpon =3D "viewrelations.aspx" - SubType =3D "Code" + SubType =3D "ASPXCodeBehind" BuildAction =3D "Compile" /> <File |
|
From: <sv...@de...> - 2005-06-15 23:05:09
|
Author: pcamacho
Date: 2005-06-15 19:05:11 -0400 (Wed, 15 Jun 2005)
New Revision: 1332
Modified:
humano2/trunk/web/builder/site/js/form.js
humano2/trunk/web/portal/site/js/iframe.js
humano2/trunk/web/portal/site/readXslt.aspx
humano2/trunk/web/portal/site/viewpertinencelist.aspx
humano2/trunk/web/portal/site/viewpertinencelist.aspx.cs
humano2/trunk/web/portal/site/xsl/pertinence.xsl
Log:
FIX: bugs for iframe and pertinence:
* empty value no is possible to choose
* hidde for the iframe when clicking out of it
Modified: humano2/trunk/web/builder/site/js/form.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/form.js 2005-06-15 15:25:49 UTC (re=
v 1331)
+++ humano2/trunk/web/builder/site/js/form.js 2005-06-15 23:05:11 UTC (re=
v 1332)
@@ -66,7 +66,7 @@
//The filter
//alert("filter SelfRefName:" + filter.GetSelfRefName());
var whereStr =3D this.infosToSubmit.filter.ReturnValues();
- alert("whereStr: " + whereStr);
+ //alert("whereStr: " + whereStr);
=20
if(this.type =3D=3D 'REPORT')
{
Modified: humano2/trunk/web/portal/site/js/iframe.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/js/iframe.js 2005-06-15 15:25:49 UTC (r=
ev 1331)
+++ humano2/trunk/web/portal/site/js/iframe.js 2005-06-15 23:05:11 UTC (r=
ev 1332)
@@ -19,11 +19,11 @@
return now.getTime();
}
=20
-function toggleIFrame(nframe,urlToLoad) {
+function toggleIFrame(nframe,urlToLoad)=20
+{
var f =3D document.getElementById(nframe); // The iframe object
urlToLoad +=3D "¤tTime=3D" + currentTime();
- if(f.style.visibility =3D=3D "hidden") {
- =20
+ if(f.style.visibility =3D=3D "hidden") { =20
if(f.src !=3D urlToLoad) { // If the frame was not loaded yet, load it=
again.
f.src =3D urlToLoad;
} =20
@@ -33,8 +33,9 @@
f.style.visibility =3D "hidden";=09
}
=09
- f.style.left=3Dx - 180
- f.style.top =3Dy + 10
+ f.style.left=3Dx - 180;
+ f.style.top =3Dy + 10;
+ =20
//window.open(urlToLoad);
}
=20
Modified: humano2/trunk/web/portal/site/readXslt.aspx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/readXslt.aspx 2005-06-15 15:25:49 UTC (=
rev 1331)
+++ humano2/trunk/web/portal/site/readXslt.aspx 2005-06-15 23:05:11 UTC (=
rev 1332)
@@ -44,9 +44,29 @@
}
else return "no date";
}
+ var IframeToClose =3D '';
+ var CurrentIframe =3D '';
+ =20
+ function CloseOpenIframe(e)
+ {
+ //alert("CurrentIframe: " + CurrentIframe);
+ if(CurrentIframe !=3D '' ) //Update values
+ {
+ IframeToClose =3D CurrentIframe;
+ CurrentIframe =3D '';
+ //alert("IframeToClose:" + IframeToClose);
+ =20
+ }
+ else //Delete the IframeToClose
+ {
+ //alert("IframeToClose:" + IframeToClose);
+ var iframe =3D document.getElementById(Ifram=
eToClose);
+ iframe.style.visibility =3D 'hidden';
+ }
+ }
</script>
</head>
- <body style=3D"MARGIN: 10px" text=3D"#000000" vLink=3D"#000=
000" aLink=3D"#000000" link=3D"#000000" bgColor=3D"#ffffff" >
+ <body style=3D"MARGIN: 10px" text=3D"#000000" vLink=3D"#000=
000" aLink=3D"#000000" link=3D"#000000" bgColor=3D"#ffffff" onclick=3D"Cl=
oseOpenIframe(Event)">
<form method=3D"POST" name=3D"MainForm" enctype=3D"multi=
part/form-data" target=3D"mainFrame" onsubmit=3D"return saveInstance(true=
)">
<xsl:attribute name=3D"action">
<xsl:if test=3D"/page/flagaction=3D'Create'">
Modified: humano2/trunk/web/portal/site/viewpertinencelist.aspx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/viewpertinencelist.aspx 2005-06-15 15:2=
5:49 UTC (rev 1331)
+++ humano2/trunk/web/portal/site/viewpertinencelist.aspx 2005-06-15 23:0=
5:11 UTC (rev 1332)
@@ -1,5 +1,6 @@
<%@ Page language=3D"c#" Codebehind=3D"viewpertinencelist.aspx.cs" AutoE=
ventWireup=3D"false" Inherits=3D"Portal.site.ViewPertinenceList" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<!-- $Id$ -->
<HTML>
<HEAD>
<title>ViewPertinenceList</title>
@@ -24,11 +25,21 @@
=20
obj1 =3D myframe.document.getElementsByName(sysAttName)[0]; =09
obj2 =3D myframe.document.getElementsByName(elem2)[0];
+ //alert("idSelected:" + idSelected);
+ if(idSelected!=3D'-- Nothing --') //Update input tag if not =
"--Nothing--" is selected
+ {
+ obj1.value =3D idSelected;
+ obj2.value =3D txtSelected;
+ }
+ else
+ {
+ obj1.value =3D '';
+ obj2.value =3D '';
+ }
+ =20
+ obj2.focus();
+ =20
=20
- obj1.value =3D idSelected;
- obj2.value =3D txtSelected;
- obj2.focus();
-
return true;
}
=20
@@ -39,4 +50,4 @@
<asp:listbox id=3D"ListBox1" runat=3D"server" Width=3D"192px" Height=3D=
"168px"></asp:listbox>
</form>
</body>
-</HTML>
\ No newline at end of file
+</HTML>
Property changes on: humano2/trunk/web/portal/site/viewpertinencelist.asp=
x
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: humano2/trunk/web/portal/site/viewpertinencelist.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/viewpertinencelist.aspx.cs 2005-06-15 1=
5:25:49 UTC (rev 1331)
+++ humano2/trunk/web/portal/site/viewpertinencelist.aspx.cs 2005-06-15 2=
3:05:11 UTC (rev 1332)
@@ -110,10 +110,12 @@
dtParam.Rows.Add(dr); =09
=09
dt1 =3D dbAdapter.GetDataTableView(dtParam, idClass);
+ =20
this.ListBox1.DataValueField =3D "id_entity";
this.ListBox1.DataTextField =3D dt1.Columns[1].ColumnName;//"col"+c=
olumnPrimary;
this.ListBox1.DataSource =3D dt1;
this.ListBox1.DataBind();
+ this.ListBox1.Items.Add("-- Nothing --");
}
}
=20
Modified: humano2/trunk/web/portal/site/xsl/pertinence.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/xsl/pertinence.xsl 2005-06-15 15:25:49 =
UTC (rev 1331)
+++ humano2/trunk/web/portal/site/xsl/pertinence.xsl 2005-06-15 23:05:11 =
UTC (rev 1332)
@@ -1,4 +1,5 @@
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<!-- $Id$ -->
<xsl:stylesheet version=3D"1.0" xmlns:xsl=3D"http://www.w3.org/1999/XSL/=
Transform">
<xsl:template match=3D"pertinence">
<xsl:param name=3D"idEntity" select=3D"$idEntity"/>
@@ -17,55 +18,55 @@
</xsl:when>
=09
<xsl:when test=3D"/page/flagaction=3D'Update'">
- <xsl:if test=3D"string($isEditable)=3D'true'">
- <table border=3D"0" cellSpacing=3D"0" cellPa=
dding=3D"0" >
- <tr>
- <td valign=3D"top">
- <input type=3D"text" name=3D"{co=
ncat('txt_',$sysAttName)}" value=3D"{$refData}" onfocus=3D"hideIFrame('{c=
oncat('frame_',$idEntity)}')" readonly=3D"readonly"/>
- </td>
- <td valign=3D"center">
- <xsl:if test=3D"not($filterView)=
">
- <img src=3D"img/arrowDown.gi=
f" border=3D"0" onclick=3D"toggleIFrame('{concat('frame_',$idEntity)}','v=
iewpertinencelist.aspx?idClass=3D{$idClass}&idEntity=3D{$idEntity}&am=
p;sysAttName=3D{$sysAttName}');"></img>
- </xsl:if>=20
- <xsl:if test=3D"$filterView">
- <img src=3D"img/arrowDown.gi=
f" border=3D"0" onclick=3D"toggleIFrameWithFilter('{concat('frame_',$idEn=
tity)}','viewpertinencelist.aspx?idClass=3D{$idClass}&idEntity=3D{$id=
Entity}&sysAttName=3D{$sysAttName}', '{$filterView}');"></img>
- </xsl:if>=20
- <img src=3D"img/1x1.gif" border=3D=
"0" width=3D"22" heigth=3D"22"></img>
- </td>
- </tr>
- </table>=09
- <!--<input type=3D"button" name=3D"aaa" value=3D"Ver" onclick=3D"=
toggleIFrame('{concat('frame_',$idEntity)}','viewpertinencelist.aspx?idCl=
ass=3D{$idClass}&idEntity=3D{$idEntity}&sysAttName=3D{$sysAttName=
}');" />-->
- <input type=3D"hidden" name=3D"{$sysAttName}" value=3D"{$data}" r=
eadonly=3D"readonly"/>
- <iframe id=3D"{concat('frame_',$idEntity)}" src=3D"" style=3D"vis=
ibility: hidden; position:absolute;" width=3D"190" height=3D"165" framebo=
rder=3D"0" scrolling=3D"no" align=3D"middle"></iframe>
- </xsl:if>
- <xsl:if test=3D"not(string($isEditable)=3D'true'=
)"> =20
- <input type=3D"text" name=3D"{concat('tx=
t_',$sysAttName)}" value=3D"{$refData}" onfocus=3D"hideIFrame('{concat('f=
rame_',$idEntity)}')" readonly=3D"readonly" />
- </xsl:if>
+ <xsl:if test=3D"string($isEditable)=3D'true'">
+ <table border=3D"0" cellSpacing=3D"0" cellPadding=3D=
"0" >
+ <tr>
+ <td valign=3D"top">
+ <input type=3D"text" name=3D"{concat('tx=
t_',$sysAttName)}" value=3D"{$refData}" onfocus=3D"hideIFrame('{concat('f=
rame_',$idEntity)}')" readonly=3D"readonly"/>
+ </td>
+ <td valign=3D"center">
+ <xsl:if test=3D"not($filterView)">
+ <img src=3D"img/arrowDown.gif" borde=
r=3D"0" onclick=3D"CurrentIframe=3D'{concat('frame_',$idEntity)}';toggleI=
Frame('{concat('frame_',$idEntity)}','viewpertinencelist.aspx?idClass=3D{=
$idClass}&idEntity=3D{$idEntity}&sysAttName=3D{$sysAttName}');"><=
/img>
+ </xsl:if>=20
+ <xsl:if test=3D"$filterView">
+ <img src=3D"img/arrowDown.gif" borde=
r=3D"0" onclick=3D"CurrentIframe=3D'{concat('frame_',$idEntity)}';toggleI=
FrameWithFilter('{concat('frame_',$idEntity)}','viewpertinencelist.aspx?i=
dClass=3D{$idClass}&idEntity=3D{$idEntity}&sysAttName=3D{$sysAttN=
ame}', '{$filterView}');"></img>
+ </xsl:if>=20
+ <img src=3D"img/1x1.gif" border=3D"0" w=
idth=3D"22" heigth=3D"22"></img>
+ </td>
+ </tr>
+ </table>=09
+ <!--<input type=3D"button" name=3D"aaa" value=3D"Ver=
" onclick=3D"toggleIFrame('{concat('frame_',$idEntity)}','viewpertinencel=
ist.aspx?idClass=3D{$idClass}&idEntity=3D{$idEntity}&sysAttName=3D=
{$sysAttName}');" />-->
+ <input type=3D"hidden" name=3D"{$sysAttName}" value=3D=
"{$data}"/>
+ <iframe scrolling=3D"no" id=3D"{concat('frame_',$idE=
ntity)}" src=3D"" style=3D"visibility: hidden; position:absolute;" width=3D=
"190" height=3D"165" frameborder=3D"0" align=3D"middle"></iframe>
+ </xsl:if>
+ =20
+ <xsl:if test=3D"not(string($isEditable)=3D'true')"> =20
+ <input type=3D"text" name=3D"{concat('txt_',$sysAttN=
ame)}" value=3D"{$refData}" onfocus=3D"hideIFrame('{concat('frame_',$idEn=
tity)}')" readonly=3D"readonly" />
+ </xsl:if>
+ =20
</xsl:when>
=09
<xsl:when test=3D"/page/flagaction=3D'Create'">
- <xsl:if test=3D"string($isEditable)=3D'true'"> =20
- =20
- <table border=3D"0" cellSpacing=3D"0" cellPaddin=
g=3D"0" >
- <tr>
- <td valign=3D"top">
- <input type=3D"text" name=3D"{concat=
('txt_',$sysAttName)}" value=3D"{$refData}" onfocus=3D"hideIFrame('{conca=
t('frame_',$idEntity)}')" readonly=3D"readonly"/>
- </td>
- <td valign=3D"center">
- <xsl:if test=3D"not($filterView)">
- <img src=3D"img/arrowDown.gif" b=
order=3D"0" onclick=3D"toggleIFrame('{concat('frame_',$idEntity)}','viewp=
ertinencelist.aspx?idClass=3D{$idClass}&idEntity=3D{$idEntity}&sy=
sAttName=3D{$sysAttName}');"></img>
- </xsl:if>=20
- <xsl:if test=3D"$filterView">
- <img src=3D"img/arrowDown.gif" b=
order=3D"0" onclick=3D"toggleIFrameWithFilter('{concat('frame_',$idEntity=
)}','viewpertinencelist.aspx?idClass=3D{$idClass}&idEntity=3D{$idEnti=
ty}&sysAttName=3D{$sysAttName}', '{$filterView}');"></img>
- </xsl:if>=20
- <img src=3D"img/1x1.gif" border=3D"0=
" width=3D"22" heigth=3D"22"></img>
- </td>
- </tr>
- </table>=09
- =20
- <input type=3D"hidden" name=3D"{$sysAttName}" />
- <iframe id=3D"{concat('frame_',$idEntity)}" src=3D"" style=3D"visi=
bility: hidden; position:absolute;" width=3D"190" height=3D"165" framebor=
der=3D"0" scrolling=3D"no" align=3D"middle" ></iframe>
- </xsl:if>
+ <xsl:if test=3D"string($isEditable)=3D'true'"> =20
+ <table border=3D"0" cellSpacing=3D"0" cellPadding=3D=
"0" >
+ <tr>
+ <td valign=3D"top">
+ <input type=3D"text" name=3D"{concat('tx=
t_',$sysAttName)}" value=3D"{$refData}" onfocus=3D"hideIFrame('{concat('f=
rame_',$idEntity)}')" readonly=3D"readonly"/>
+ </td>
+ <td valign=3D"center">
+ <xsl:if test=3D"not($filterView)">
+ <img src=3D"img/arrowDown.gif" borde=
r=3D"0" onclick=3D"CurrentIframe=3D'{concat('frame_',$idEntity)}';toggleI=
Frame('{concat('frame_',$idEntity)}','viewpertinencelist.aspx?idClass=3D{=
$idClass}&idEntity=3D{$idEntity}&sysAttName=3D{$sysAttName}');"><=
/img>
+ </xsl:if>=20
+ <xsl:if test=3D"$filterView">
+ <img src=3D"img/arrowDown.gif" borde=
r=3D"0" onclick=3D"CurrentIframe=3D'{concat('frame_',$idEntity)}';toggleI=
FrameWithFilter('{concat('frame_',$idEntity)}','viewpertinencelist.aspx?i=
dClass=3D{$idClass}&idEntity=3D{$idEntity}&sysAttName=3D{$sysAttN=
ame}', '{$filterView}');"></img>
+ </xsl:if>=20
+ <img src=3D"img/1x1.gif" border=3D"0" w=
idth=3D"22" heigth=3D"22"></img>
+ </td>
+ </tr>
+ </table>=09
+ <input type=3D"hidden" name=3D"{$sysAttName}" />
+ <iframe id=3D"{concat('frame_',$idEntity)}" src=3D""=
style=3D"visibility: hidden; position:absolute;" scrolling=3D"no" width=3D=
"190" height=3D"165" frameborder=3D"0" align=3D"middle" ></iframe>
+ </xsl:if>
</xsl:when>
</xsl:choose>
<xsl:if test=3D"/page/flagaction!=3D'Read'"> <!-- Only for create and =
update -->
Property changes on: humano2/trunk/web/portal/site/xsl/pertinence.xsl
___________________________________________________________________
Name: svn:keywords
+ Id
|
|
From: <sv...@de...> - 2005-06-15 15:25:45
|
Author: pcamacho
Date: 2005-06-15 11:25:49 -0400 (Wed, 15 Jun 2005)
New Revision: 1331
Modified:
humano2/trunk/components/webTools/interfacetools.cs
humano2/trunk/web/builder/site/viewmain.aspx.cs
Log:
FIX: bug #207.
Modified: humano2/trunk/components/webTools/interfacetools.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/components/webTools/interfacetools.cs 2005-06-15 14:34:=
11 UTC (rev 1330)
+++ humano2/trunk/components/webTools/interfacetools.cs 2005-06-15 15:25:=
49 UTC (rev 1331)
@@ -218,7 +218,6 @@
res.Rows.InsertAt(startRow, 0);
=20
//Parse the table and build the xml string
- =20
foreach(DataRow row in res.Rows)
{
//int classId =3D Convert.ToInt32(row["id_entity"]);
@@ -235,6 +234,18 @@
//Logger.Log("ReportMain getClassList: " + xmlString, LogLev=
el.Trace);
return xmlString;
}
- =20
+ =20
+ ///<summary>
+ ///returns the first column in a string getted from the js inter=
face of creation of view/report, that is
+ /// of the form: col1,col2,col3... concatened with |0 meaning fo=
r viewtools: order by this column asc
+ ///<param name=3D"receivedColumn">The string from which we want =
to extract the first column</param>
+ ///<returns></returns>
+ ///</summary>
+ public static string GetFirstColumnForOrder(string receivedColum=
n)
+ {
+ string [] columns =3D receivedColumn.Split(",".ToCharArray()=
);
+ string res =3D columns[1] + "|0";=20
+ return res; =20
+ }
}
}
Modified: humano2/trunk/web/builder/site/viewmain.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-15 14:34:11 U=
TC (rev 1330)
+++ humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-15 15:25:49 U=
TC (rev 1331)
@@ -392,7 +392,16 @@
dr["columns"] =3D receivedColumnsStr; //If a column is a per=
tinence, change it
//Special case for IN filter
dr["where"] =3D Interface.ParseWhere(receivedWhereStr);=20
- dr["order"] =3D Interface.ParseOrder(receivedOrderStr);
+ =20
+ if(receivedOrderStr !=3D "")
+ {
+ dr["order"] =3D Interface.ParseOrder(receivedOrderStr);
+ }
+ else //Add a order by default with the first column
+ {
+ dr["order"] =3D Interface.GetFirstColumnForOrder(receive=
dColumnsStr);
+ }
+ =20
Logger.Log("receivedOrderStr" + receivedOrderStr, LogLevel.T=
race);
Logger.Log("receivedWhereStr" + receivedWhereStr, LogLevel.T=
race);
=09
|
|
From: <sv...@de...> - 2005-06-15 14:34:40
|
Author: pcamacho Date: 2005-06-15 10:34:11 -0400 (Wed, 15 Jun 2005) New Revision: 1330 Modified: humano2/trunk/components/webTools/interfacetools.cs humano2/trunk/web/builder/site/createreport.aspx.cs humano2/trunk/web/builder/site/viewmain.aspx.cs Log: CHANGE: factorization of the function that get the list of class for a us= er in report/view creation. Modified: humano2/trunk/components/webTools/interfacetools.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/components/webTools/interfacetools.cs 2005-06-15 14:01:= 53 UTC (rev 1329) +++ humano2/trunk/components/webTools/interfacetools.cs 2005-06-15 14:34:= 11 UTC (rev 1330) @@ -10,10 +10,12 @@ // $Id$ =20 using System; +using System.Collections; +using System.ComponentModel; +using System.Data; using System.IO; using System.Web; using System.Xml.Xsl; -using System.Collections; using System.Collections.Specialized; using System.Net; using System.Text.RegularExpressions; @@ -195,6 +197,44 @@ Logger.Log("parseHavings=3D " + res,LogLevel.Trace); =20 return res; - } =20 + } + + ///<summary> + /// Returns an xml string as this: + /// <class> + /// <id> </id> + /// <name> </name> + /// </class> + /// Where the classes are the classes of the user + ///</summary> + public static string GetClassListForUser(SessionCredencial userC= red)=20 + { + string xmlString =3D ""; + + DataTable res =3D userCred.CoreAdapter.GetAllClassesOfDomain= (userCred); + DataRow startRow =3D res.NewRow(); + startRow["id_entity"] =3D 0; + startRow["name"] =3D "-- Classes --"; + res.Rows.InsertAt(startRow, 0); + =20 + //Parse the table and build the xml string + =20 + foreach(DataRow row in res.Rows) + { + //int classId =3D Convert.ToInt32(row["id_entity"]); + =20 + xmlString +=3D "<class>"; + xmlString +=3D "<id>"; + xmlString +=3D row["id_entity"]; + xmlString +=3D "</id>"; =20 + xmlString +=3D "<name>"; =20 + xmlString +=3D row["name"]; + xmlString +=3D "</name>";=20 + xmlString +=3D "</class>"; + } + //Logger.Log("ReportMain getClassList: " + xmlString, LogLev= el.Trace); + return xmlString; + } + =20 } } Modified: humano2/trunk/web/builder/site/createreport.aspx.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/createreport.aspx.cs 2005-06-15 14:01:= 53 UTC (rev 1329) +++ humano2/trunk/web/builder/site/createreport.aspx.cs 2005-06-15 14:34:= 11 UTC (rev 1330) @@ -132,7 +132,7 @@ { strXml +=3D getXmlAttribListForClass(Convert.ToInt32(cla= ssId)); } - strXml +=3D getClassList(); + strXml +=3D Interface.GetClassListForUser(userCred= ); strXml +=3D "</classes>"; strXml +=3D "</report>"; =20 @@ -413,42 +413,8 @@ return xmlRes; } =20 - ///<summary> - /// Returns an xml string as this: - /// <class> - /// <id> </id> - /// <name> </name> - /// </class> - ///</summary> - private string getClassList()=20 - { - string xmlString =3D ""; - - DataTable res =3D userCred.CoreAdapter.GetAllClassesOfDomain= (userCred); - DataRow startRow =3D res.NewRow(); - startRow["id_entity"] =3D 0; - startRow["name"] =3D "-- Classes --"; - res.Rows.InsertAt(startRow, 0); - =20 - //Parse the table and build the xml string - =20 - foreach(DataRow row in res.Rows) - { - //int classId =3D Convert.ToInt32(row["id_entity"]); - =20 - xmlString +=3D "<class>"; - xmlString +=3D "<id>"; - xmlString +=3D row["id_entity"]; - xmlString +=3D "</id>"; =20 - xmlString +=3D "<name>"; =20 - xmlString +=3D row["name"]; - xmlString +=3D "</name>";=20 - xmlString +=3D "</class>"; - } - //Logger.Log("ReportMain getClassList: " + xmlString, LogLev= el.Trace); - return xmlString; - } =20 + =20 private void deleteReport() { Logger.Log("deleteReport called", LogLevel.Trace); Modified: humano2/trunk/web/builder/site/viewmain.aspx.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-15 14:01:53 U= TC (rev 1329) +++ humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-15 14:34:11 U= TC (rev 1330) @@ -130,7 +130,7 @@ { strXml +=3D getXmlAttribListForClass(Convert.ToInt32(cla= ssId)); } - strXml +=3D getClassList(); + strXml +=3D Interface.GetClassListForUser(userCred= ); strXml +=3D "</classes>"; strXml +=3D "</view>"; =20 @@ -348,41 +348,6 @@ return xmlRes; } =20 - ///<summary> - /// Returns an xml string as this: - /// <class> - /// <id> </id> - /// <name> </name> - /// </class> - ///</summary> - private string getClassList()=20 - { - string xmlString =3D ""; - - DataTable res =3D userCred.CoreAdapter.GetAllClassesOfDomain= (userCred); - DataRow startRow =3D res.NewRow(); - startRow["id_entity"] =3D 0; - startRow["name"] =3D "-- Classes --"; - res.Rows.InsertAt(startRow, 0); - =20 - //Parse the table and build the xml string - =20 - foreach(DataRow row in res.Rows) - { - //int classId =3D Convert.ToInt32(row["id_entity"]); - =20 - xmlString +=3D "<class>"; - xmlString +=3D "<id>"; - xmlString +=3D row["id_entity"]; - xmlString +=3D "</id>"; =20 - xmlString +=3D "<name>"; =20 - xmlString +=3D row["name"]; - xmlString +=3D "</name>";=20 - xmlString +=3D "</class>"; - } - //Logger.Log("ViewMain getClassList: " + xmlString, LogLevel= .Trace); - return xmlString; - } =20 private void deleteView() { |
|
From: <sv...@de...> - 2005-06-15 14:01:54
|
Author: pcamacho
Date: 2005-06-15 10:01:53 -0400 (Wed, 15 Jun 2005)
New Revision: 1329
Modified:
humano2/trunk/web/portal/site/downloadView.aspx.cs
Log:
FIX: in the exportation of a view to CSV, the column id_entity was appear=
ing.
Modified: humano2/trunk/web/portal/site/downloadView.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/downloadView.aspx.cs 2005-06-14 23:32:2=
8 UTC (rev 1328)
+++ humano2/trunk/web/portal/site/downloadView.aspx.cs 2005-06-15 14:01:5=
3 UTC (rev 1329)
@@ -94,28 +94,29 @@
//Add the name of columns
foreach (DataColumn col in resp.Columns)=20
{
- string colName =3D col.ColumnName;
- string userColName =3D complex.ConvertSysAttNameToUs=
erAttName(colName);
- sb.Append(userColName + sep);
+ if(col.ColumnName!=3D"id_entity") //Don't show colum=
n with id_entity
+ {
+ string colName =3D col.ColumnName;
+ string userColName =3D complex.ConvertSysAttName=
ToUserAttName(colName);
+ sb.Append(userColName + sep);
+ }
}
sb.Append("\n");
=20
- for(int i=3D0;i<rows;i++)
+ foreach(DataRow row in resp.Rows)
{
- for(int j=3D0;j<cols;j++)
+ foreach (DataColumn col in row.Table.Columns)
{
- data =3D resp.Rows[i][j].ToString();
- if(data.IndexOf(sep) !=3D -1) { // If the data contains the delimi=
ter, add a delimter.
- data =3D delimiter + data + delimiter;
- }
- if(j!=3Dcols-1)
- {
- sb.Append(data + sep);
- }
- else
- {
- sb.Append(data);
- }
+ Logger.Log("col.ColumnName:" + col.ColumnName,Lo=
gLevel.Trace);
+ if(col.ColumnName!=3D"id_entity") //Don't show c=
olumn with id_entity
+ {
+ data =3D Convert.ToString(row[col.ColumnName=
]);
+ if(data.IndexOf(sep) !=3D -1)=20
+ { // If the data contains the delimiter, add=
a delimter.
+ data =3D delimiter + data + delimiter;
+ }
+ sb.Append(data + sep);
+ }
}
sb.Append("\n");
}
|
|
From: <sv...@de...> - 2005-06-14 23:32:29
|
Author: marcelo
Date: 2005-06-14 19:32:28 -0400 (Tue, 14 Jun 2005)
New Revision: 1328
Modified:
humano2/trunk/components/webTools/Html.cs
humano2/trunk/components/webTools/session.cs
humano2/trunk/config/config.xml.tmpl
humano2/trunk/core/config.cs
humano2/trunk/core/db/loader.cs
humano2/trunk/web/portal/portal.csproj
humano2/trunk/web/portal/site/domain.aspx.cs
humano2/trunk/web/portal/site/login.aspx.cs
Log:
* config.xml.tmpl changed the concepts of how the directories are specif=
ied, most files changed to reflect this.
* Login changed to show image of database being used
* Portal changed to eliminate files from poyect
Modified: humano2/trunk/components/webTools/Html.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/components/webTools/Html.cs 2005-06-14 23:14:25 UTC (re=
v 1327)
+++ humano2/trunk/components/webTools/Html.cs 2005-06-14 23:32:28 UTC (re=
v 1328)
@@ -90,21 +90,21 @@
///This path is taken from the config.xml <clientPath> tag which=
is concatenated to the current domainId
///<returns>The path of client</return>
///</summary>
- public static string GetClientPath(SessionCredencial userCred)=20
+ public static string GetClientPath(SessionCredencial userCred)
{
int domainId =3D userCred.DomainIds[userCred.CurrentDomainIn=
dex];
- string res =3D Config.Instance().GetOption("locations", "cli=
entPath") + Path.DirectorySeparatorChar + domainId;
+ string res =3D Config.Instance().GetAbsoluteLocation("client=
Path") + Path.DirectorySeparatorChar + domainId;
return res;
}
///<summary>
/// Allows to upload a collection of file in the directory
- /// specified in config.xml=20
+ /// specified in config.xml
///</summary>
public static void UploadFile(HttpPostedFile file,int idEntity, =
string attId, System.Web.HttpResponse Response,SessionCredencial userCred=
)
{
- string strFileName; =20
+ string strFileName;
=20
- if (file.FileName !=3D "")=20
+ if (file.FileName !=3D "")
{
//Due to a difference between Mono an .NET we must do a =
check here
string fileNameWithoutExtension =3D Path.GetFileName(fil=
e.FileName);
@@ -133,9 +133,9 @@
string fullFileName =3D uploadPath + Path.Directory=
SeparatorChar + strFileName;
file.SaveAs(fullFileName);
}
- catch (Exception err)=20
+ catch (Exception err)
{
- Response.Write("Failed uploading " + strFileName + "=
: " + err.ToString()+"<br>"); =20
+ Response.Write("Failed uploading " + strFileName + "=
: " + err.ToString()+"<br>");
}
}
}
Modified: humano2/trunk/components/webTools/session.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/components/webTools/session.cs 2005-06-14 23:14:25 UTC =
(rev 1327)
+++ humano2/trunk/components/webTools/session.cs 2005-06-14 23:32:28 UTC =
(rev 1328)
@@ -37,12 +37,12 @@
=09
/// <summary>Test if a user has the right to do a certain task.</summa=
ry>
/// <returns>Returns true if the user has the right, false otherwise.<=
/returns>
- public bool HasPrivilege(Privileges priv)=20
+ public bool HasPrivilege(Privileges priv)
{
switch(priv) {
case Privileges.UserModify: // See if the user has the privilege to =
modify users.
foreach(int dId in DomainIds) {
- if(dId =3D=3D (int) MetaModelConsts.DomainsSystem) {=20
+ if(dId =3D=3D (int) MetaModelConsts.DomainsSystem) {
return true;
}
}
@@ -66,7 +66,7 @@
static SessionManager currentSessionManager =3D null;
=20
///<summary>El path del directorio con las sessiones.</summary>
- private string sessionPath =3D Core.Config.Instance().GetOption("locat=
ions","session");
+ private string sessionPath =3D Core.Config.Instance().GetAbsoluteLocat=
ion("session");
=20
/// <summary>
/// Tiempo de vida de las sesiones.
@@ -101,13 +101,13 @@
Thread timerControler =3D new Thread(new ThreadStart(timeDeletion));
timerControler.Start();
}
-
- public void setNewLastAccess()
- {
- SessionManager cs =3D SessionManager.currentSessionManager;
- cs.newAccess =3D DateTime.Now;
- }
=20
+ public void setNewLastAccess()
+ {
+ SessionManager cs =3D SessionManager.currentSessionManager;
+ cs.newAccess =3D DateTime.Now;
+ }
+
/// <summary>
/// Libera todos los recursos de la session manager
/// </summary>
Modified: humano2/trunk/config/config.xml.tmpl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/config/config.xml.tmpl 2005-06-14 23:14:25 UTC (rev 132=
7)
+++ humano2/trunk/config/config.xml.tmpl 2005-06-14 23:32:28 UTC (rev 132=
8)
@@ -9,10 +9,11 @@
<pass>h2_dbase!</pass> <!-- The password of the database -->
</database>
<locations>
- <dbdrivers>C:\h2_install\bin</dbdrivers> <!-- Where is the datab=
ase driver direcotory -->
- <session>C:\h2_sessions</session> <!-- Directory where ar=
e the session xml files stored -->
+ <basedir>C:\h2_install</basedir> <!-- The base directory where the Hum=
ano2 files are located. -->
+ <dbdrivers>bin</dbdrivers> <!-- Where is the database driver dir=
ecotory -->
+ <session>h2_sessions</session> <!-- Directory where are t=
he session xml files stored -->
<webbase>http://localhost:8080</webbase> <!-- what's the base lo=
cation where the humano2 installation lives? -->=20
- <clientPath>C:\upload</clientPath> <!-- Where the user will stor=
e his files, and where other files related to him will remain -->
+ <clientPath>upload</clientPath> <!-- Where the user will store h=
is files, and where other files related to him will remain -->
</locations>
<log>
<level>0</level> <!-- detail of error logging. higher numer is high=
er logging level. 0 =3D off. -->
Modified: humano2/trunk/core/config.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/core/config.cs 2005-06-14 23:14:25 UTC (rev 1327)
+++ humano2/trunk/core/config.cs 2005-06-14 23:32:28 UTC (rev 1328)
@@ -137,12 +137,35 @@
/// <returns>The platform version.</returns>
public string GetVersion()
{
- return String.Format("{0}.{1}.{2}", major, minor, patch);
- //Version ver =3D new Version( major, minor, patch );
- //return ver.ToString( );
- =20
+ return String.Format("{0}.{1}.{2}", major, minor, patch);
}
+
=09
+ /// <summary>
+ /// Returns the absolute location of a variable.
+ /// </summary>
+ /// <returns>The absolute location</returns>
+ /// <param name=3D"variableName">The name of the option in the locatio=
ns section.</param>
+ public string GetAbsoluteLocation(string variableName)
+ {
+ string fileName =3D GetOption("locations", variableName);
+ =09
+ if( (fileName[0] =3D=3D Path.DirectorySeparatorChar) || // "/home" et=
c..
+ (fileName[1] =3D=3D ':') ) // "C:" or "F:".
+ { // The path reference is already absolute, don't add any base path.
+ return fileName;
+ }
+ =09
+ string baseDir =3D GetOption("locations", "basedir");
+ =09
+ if(baseDir[baseDir.Length-1] !=3D Path.DirectorySeparatorChar)
+ { // If the baseDir didn't add with a "/" or "\", add it.
+ baseDir =3D baseDir + Path.DirectorySeparatorChar;
+ }
+ =09
+ return baseDir + fileName;
+ }
+ =09
RunTimeEnum _runtime =3D RunTimeEnum.Unknown;
DataBaseEnum _database =3D DataBaseEnum.Unknown;
=09
Modified: humano2/trunk/core/db/loader.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/core/db/loader.cs 2005-06-14 23:14:25 UTC (rev 1327)
+++ humano2/trunk/core/db/loader.cs 2005-06-14 23:32:28 UTC (rev 1328)
@@ -75,7 +75,7 @@
private void genObjectConstructors(Config conf)
{
string driverFile =3D conf.GetOption("database", "driver");
- string driverDir =3D conf.GetOption("locations", "dbdrivers");
+ string driverDir =3D conf.GetAbsoluteLocation("dbdrivers");
string driverPath =3D driverDir + Path.DirectorySeparatorChar + drive=
rFile;
=20
Assembly dbAssem =3D Assembly.LoadFrom(driverPath);
Modified: humano2/trunk/web/portal/portal.csproj
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/portal.csproj 2005-06-14 23:14:25 UTC (rev 1=
327)
+++ humano2/trunk/web/portal/portal.csproj 2005-06-14 23:32:28 UTC (rev 1=
328)
@@ -290,17 +290,6 @@
BuildAction =3D "Compile"
/>
<File
- RelPath =3D "site\search.aspx"
- SubType =3D "Form"
- BuildAction =3D "Content"
- />
- <File
- RelPath =3D "site\search.aspx.cs"
- DependentUpon =3D "search.aspx"
- SubType =3D "Code"
- BuildAction =3D "Compile"
- />
- <File
RelPath =3D "site\showimage.aspx"
BuildAction =3D "Content"
/>
Modified: humano2/trunk/web/portal/site/domain.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/domain.aspx.cs 2005-06-14 23:14:25 UTC =
(rev 1327)
+++ humano2/trunk/web/portal/site/domain.aspx.cs 2005-06-14 23:32:28 UTC =
(rev 1328)
@@ -81,7 +81,7 @@
}
protected void databaseImage()
{
- if(Config.Instance().GetOption("database", "driver") =3D=3D "Humano2.=
Core.Db.Pgsql.dll") {
+ if(Config.Instance().DataBase =3D=3D DataBaseEnum.PostgreSQL) {
Response.Write(@"<a href=3D""http://www.postgresql.org""><img src=3D=
""img/postgresql-powered.png"" border=3D""0""></a>");
}
}
Modified: humano2/trunk/web/portal/site/login.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/login.aspx.cs 2005-06-14 23:14:25 UTC (=
rev 1327)
+++ humano2/trunk/web/portal/site/login.aspx.cs 2005-06-14 23:32:28 UTC (=
rev 1328)
@@ -110,7 +110,7 @@
}
protected void databaseImage()
{
- if(Config.Instance().GetOption("database", "driver") =3D=3D "Humano2.=
Core.Db.Pgsql.dll") {
+ if(Config.Instance().DataBase =3D=3D DataBaseEnum.PostgreSQL) {
Response.Write(@"<a href=3D""http://www.postgresql.org""><img src=3D=
""img/postgresql-powered.png"" border=3D""0""></a>");
}
}
|
|
From: <sv...@de...> - 2005-06-14 23:14:22
|
Author: pcamacho
Date: 2005-06-14 19:14:25 -0400 (Tue, 14 Jun 2005)
New Revision: 1327
Modified:
humano2/trunk/web/portal/site/downloadView.aspx.cs
Log:
FIX: bug #203.
Modified: humano2/trunk/web/portal/site/downloadView.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/downloadView.aspx.cs 2005-06-14 22:21:3=
1 UTC (rev 1326)
+++ humano2/trunk/web/portal/site/downloadView.aspx.cs 2005-06-14 23:14:2=
5 UTC (rev 1327)
@@ -24,6 +24,8 @@
using System.Text;
=20
using Humano2.Components.WebTools;
+using Humano2.Core;
+using Humano2.Core.Db;
=20
namespace Portal.site
{
@@ -65,6 +67,7 @@
else
{
DataTable resp =3D dbAdapter.GetDataTableView(viewTable, iniClass);
+ =20
StringBuilder sb =3D new StringBuilder();
int rows, cols;
int div =3D Convert.ToInt32(Request.QueryString["separador"]);
@@ -85,10 +88,21 @@
=20
rows =3D resp.Rows.Count;
cols =3D resp.Columns.Count;
-
- for(int i =3D 0;i <=3D rows - 1;i++)
+ =20
+ absCrud crud =3D Factory.Crud();
+ absComplex complex =3D crud.GetCore().Complex;
+ //Add the name of columns
+ foreach (DataColumn col in resp.Columns)=20
+ {
+ string colName =3D col.ColumnName;
+ string userColName =3D complex.ConvertSysAttNameToUs=
erAttName(colName);
+ sb.Append(userColName + sep);
+ }
+ sb.Append("\n");
+ =20
+ for(int i=3D0;i<rows;i++)
{
- for(int j =3D 0; j <=3D cols - 1; j++)
+ for(int j=3D0;j<cols;j++)
{
data =3D resp.Rows[i][j].ToString();
if(data.IndexOf(sep) !=3D -1) { // If the data contains the delimi=
ter, add a delimter.
@@ -111,7 +125,6 @@
Response.AddHeader("Content-Disposition", "attachment;filename=3Dvie=
w.csv");=20
Response.Write(sb.ToString());=20
}
- =09
}=20
}
}
|
|
From: <sv...@de...> - 2005-06-14 22:21:30
|
Author: pcamacho Date: 2005-06-14 18:21:31 -0400 (Tue, 14 Jun 2005) New Revision: 1326 Added: humano2/trunk/components/webTools/interfacetools.cs Modified: humano2/trunk/components/webTools/xmltools.cs humano2/trunk/web/builder/site/createreport.aspx.cs humano2/trunk/web/builder/site/js/createinterfacetools.js humano2/trunk/web/builder/site/viewmain.aspx.cs humano2/trunk/web/builder/site/xsl/createreport.xsl humano2/trunk/web/builder/site/xsl/createview.xsl Log: CHANGE: * factorization of C# code for creation of view and report * factorization of Reload function in createview.xsl / createreport.xsl Added: humano2/trunk/components/webTools/interfacetools.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/components/webTools/interfacetools.cs 2005-06-14 21:50:= 38 UTC (rev 1325) +++ humano2/trunk/components/webTools/interfacetools.cs 2005-06-14 22:21:= 31 UTC (rev 1326) @@ -0,0 +1,200 @@ +// +// The Humano2 Business solution. +// Copyright (C) 2004,5 Humano2 Chile S.A. (http://www.humano2.com) +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// $Id$ + +using System; +using System.IO; +using System.Web; +using System.Xml.Xsl; +using System.Collections; +using System.Collections.Specialized; +using System.Net; +using System.Text.RegularExpressions; + +using Humano2.Core; + +namespace Humano2.Components.WebTools +{ + public class Interface + { + ///<summary> + /// A order string is received from the web page in this format: + /// idAtt0 | 0 or 1,idAtt1 | 0 or 1 etc... + /// We have to add the queue to each where condition (1|0 or 0|0= ) + ///</summary> + public static string ParseOrder(string order) =20 + { + if(order=3D=3D"" || order =3D=3D null) + { + return ""; =20 + } + =20 + string res =3D ""; + string [] orderSplit =3D order.Split((";").ToCharArray()); /= /First get the lines + =20 + for(int i=3D0;i<orderSplit.Length;i++) + { + string [] lineSplit =3D orderSplit[i].Split(("|").ToChar= Array()); + string line =3D ""; + =20 + line +=3D lineSplit[0]; + line +=3D '|'; =20 + line +=3D lineSplit[1]; + =20 + res +=3D line; + if(i!=3D orderSplit.Length-1) + { + res +=3D ","; =20 + } + //Last line nothing to add + } + =20 + Logger.Log("parseOrder=3D " + res,LogLevel.Trace); + =20 + return res; + } + =20 + ///<summary> + /// A where string is received from the web page in this format: + /// idAtt0 | idOp0 | 'value'|;idAtt1 | idOp1 | 'value'|; ... etc + /// We have to add the queue to each where condition (1|0 or 0|0= ) + ///</summary> + public static string ParseWhere(string where) =20 + { + + if(where=3D=3D"" || where =3D=3D null) //Nothing to do + { + return ""; //Don't return "" because in this case the fi= eld of database won't be updated + } + =20 + string res =3D ""; + string [] whereSplit =3D where.Split((";").ToCharArray()); /= /First get the lines + =20 + for(int i=3D0;i<whereSplit.Length;i++) + { + string [] lineSplit =3D whereSplit[i].Split(("|").ToChar= Array()); + string line =3D ""; + for(int j=3D0; j<lineSplit.Length;j++) + { + line +=3D lineSplit[j]; + line +=3D '|'; =20 + =20 + } + res +=3D line; + if(i!=3D whereSplit.Length-1) + { + res +=3D "1|0;"; =20 + } + else //Last line + { + res +=3D"0|0"; + } + } + Logger.Log("parseWhere(before treatin)=3D " + res,LogLevel.= Trace); + =20 + res =3D treatInSpecialCase(res);=20 + =20 + Logger.Log("parseWhere=3D " + res,LogLevel.Trace); + =20 + return res; + } + =20 + ///<summary> + /// The IN filter must be treated in a special maner. If the val= ue to compare to is "20 30", then=20 + /// this value must be changed to ['20','30']; (ReportToolsDoc) + ///</summary> =20 + private static string treatInSpecialCase(string where) + { + if(where =3D=3D "") + { + return ""; =20 + } + string [] whereArr =3D where.Split(new char [] {'|',';'}); + =20 + for(int i=3D0;i<whereArr.Length;i++) + { + Logger.Log("whereArr" +"[" + Convert.ToString(i) + "]=3D= " + whereArr[i],LogLevel.Trace); + } + =20 + string newWhere=3D"";=20 + for(int i=3D0;i<whereArr.Length;i+=3D5) + { =20 + if(whereArr[i+1] =3D=3D "8") //In case + { + string [] inStrArr =3D whereArr[i+2].Split(new char = [] {' ','\''}); + //rebuild the where str + string whereValueStr =3D ""; + whereValueStr +=3D "[("; + for(int j=3D0;j<inStrArr.Length;j++)=20 + { + if(inStrArr[j] !=3D "") //Remove empty strings a= fter split + whereValueStr +=3D "'" + inStrArr[j] + "'" += ","; =20 + } + whereValueStr =3D whereValueStr.Substring(0,whereVal= ueStr.Length-1); //Remove last coma + whereValueStr +=3D")]"; + =20 + newWhere +=3D whereArr[0+i] + "|" + whereArr[1+i] + = "|" + whereValueStr + "|" +whereArr[3+i] + "|" +whereArr[4+i] + ";"; + } + else + { + newWhere +=3D whereArr[0+i] + "|" + whereArr[1+i] + = "|" + whereArr[2+i] + "|" +whereArr[3+i] + "|" +whereArr[4+i] + ";"; + } + } + newWhere =3D newWhere.Substring(0,newWhere.Length-1); //remo= ve last ';' + Logger.Log("viewmain: treatInSpecialCase return=3D " + newWh= ere, LogLevel.Trace); + return newWhere; + } + + + ///<summary> + /// A having string is received from the web page in this format= : + /// idFunc0 |idAtt0 | idOp0 | 'value'|;idFunc1|idAtt1 | idOp1 | = 'value'|; ... etc + /// We have to add the queue to each where condition (1|0 or 0|0= ) + ///</summary> + public static string ParseHavings(string havings) =20 + { + + if(havings=3D=3D"") //Nothing to do + { + return ""; + } + =20 + string res =3D ""; + string [] havingsSplit =3D havings.Split((";").ToCharArray()= ); //First get the lines + =20 + for(int i=3D0;i<havingsSplit.Length;i++) + { + string [] lineSplit =3D havingsSplit[i].Split(("|").ToCh= arArray()); + string line =3D ""; + for(int j=3D0; j<lineSplit.Length;j++) + { + line +=3D lineSplit[j]; + line +=3D '|'; =20 + } + res +=3D line; + if(i!=3D havingsSplit.Length-1) + { + res +=3D "1|0;"; =20 + } + else //Last line + { + res +=3D"0|0"; + } + } + Logger.Log("parseHavings(before treatin)=3D " + res,LogLeve= l.Trace); + =20 + //res =3D treatInSpecialCase(res);=20 + =20 + Logger.Log("parseHavings=3D " + res,LogLevel.Trace); + =20 + return res; + } =20 + } +} Property changes on: humano2/trunk/components/webTools/interfacetools.cs ___________________________________________________________________ Name: svn:keywords + Id Modified: humano2/trunk/components/webTools/xmltools.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/components/webTools/xmltools.cs 2005-06-14 21:50:38 UTC= (rev 1325) +++ humano2/trunk/components/webTools/xmltools.cs 2005-06-14 22:21:31 UTC= (rev 1326) @@ -7,7 +7,7 @@ // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // -// $Id $ +// $Id$ =20 using System; using System.IO; @@ -22,118 +22,116 @@ =20 namespace Humano2.Components.WebTools { - public class Xml + public class Xml + { + ///<summary> + ///Applies an xsl transformation to a xml document + ///</summary> + ///<param name=3D'strXML'>The string of the xml document</param> + ///<param name=3D'strXSLURL'>The url of the xsl</param> + ///<param name=3D'Response'>The html response object to send exc= eption if needed</param> + ///<returns>The result of transformation</returns> + public static string TransformXML(string strXML, string strXSLUR= L, System.Web.HttpResponse Response) { - ///<summary> - ///Applies an xsl transformation to a xml document - ///</summary> - ///<param name=3D'strXML'>The string of the xml document= </param> - ///<param name=3D'strXSLURL'>The url of the xsl</param> - ///<param name=3D'Response'>The html response object to = send exception if needed</param> - ///<returns>The result of transformation</returns> - public static string TransformXML(string strXML, string = strXSLURL, System.Web.HttpResponse Response) - { - System.Xml.Xsl.XslTransform oXSLT =3D new System= .Xml.Xsl.XslTransform(); - oXSLT.Load(strXSLURL); - return TransformXML(strXML,oXSLT,Response); - } - =20 - ///<summary> - ///Build a xsl via APS page and a list of names (that re= presents xsl) and applies - ///the transformation to an xml string - ///</summary> - ///<param name=3D'strXML'>The string of the xml document= </param> - ///<param name=3D'strXSLURL'>The url of the xsl</param> - ///<param name=3D'parameters'>La lista de nombre que rep= resentan xsl</param> - ///<param name=3D'Response'>The html response object to = send exception if needed</param> - ///<returns>The result of transformation</returns> - public static string TransformXMLASP( string strXML,=20 - string strXSLURL= ,=20 - NameValueCollect= ion parameters, - System.Web.HttpR= esponse Response) - { - System.Xml.Xsl.XslTransform oXSLT =3D GetXSLFrom= ASP(strXSLURL,parameters); - return TransformXML(strXML,oXSLT,Response); - } - =20 - ///<summary> - ///Do an XSLT transform with an xml string and an System= .Xml.Xsl.XslTransform object - ///</summary> - ///<param name=3D'strXML'>The string of the xml document= </param> - ///<param name=3D'xsl'>The url of the xsl</param> - ///<param name=3D'Response'>The html response object to = send exception if needed</param> - ///<returns>The result of transformation</returns> - private static string TransformXML(string strXML, System= .Xml.Xsl.XslTransform xsl, System.Web.HttpResponse Response) - { - =20 - //Logger.Log("Result of transformation: " + strX= ML, LogLevel.Trace); - System.IO.StringWriter oSW =3D new System.IO.Str= ingWriter(); - try - { - System.Xml.XmlTextReader oXR =3D new Sy= stem.Xml.XmlTextReader(new StringReader(strXML)); - System.Xml.XPath.XPathDocument oXPath =3D= new System.Xml.XPath.XPathDocument(oXR); - xsl.Transform(oXPath,null,oSW); - } - catch (System.Exception e) - { - //Put in custom error handler here... - //string x =3D e.ToString(); - //Response.Write(x); - } - =20 - return oSW.ToString(); - } - =20 - ///<summary> - ///Call an asp page that will build an xsl object from p= arameters that represents other xsl... Whoaw! - ///</summary> - ///<param name=3D'url'>The string of the xml document</p= aram> - ///<param name=3D'parameters'>The url of the xsl</param> - ///<returns>An xsl object ; ready to apply a transformat= ion</returns> - private static System.Xml.Xsl.XslTransform GetXSLFromASP= (string url, NameValueCollection parameters) - { - System.Net.WebClient wcXsl =3D new WebClient(); - byte[] page =3D wcXsl.UploadValues(url,"POST",parameters); - - System.Xml.Xsl.XslTransform xsl =3D new System.Xml.Xsl.XslTransform()= ; + System.Xml.Xsl.XslTransform oXSLT =3D new System.Xml.Xsl.Xsl= Transform(); + oXSLT.Load(strXSLURL); + return TransformXML(strXML,oXSLT,Response); + } + =20 + ///<summary> + ///Build a xsl via APS page and a list of names (that represents= xsl) and applies + ///the transformation to an xml string + ///</summary> + ///<param name=3D'strXML'>The string of the xml document</param> + ///<param name=3D'strXSLURL'>The url of the xsl</param> + ///<param name=3D'parameters'>La lista de nombre que representan= xsl</param> + ///<param name=3D'Response'>The html response object to send exc= eption if needed</param> + ///<returns>The result of transformation</returns> + public static string TransformXMLASP( string strXML,=20 + string strXSLURL,=20 + NameValueCollection para= meters, + System.Web.HttpResponse = Response) + { + System.Xml.Xsl.XslTransform oXSLT =3D GetXSLFromASP(strXSLUR= L,parameters); + return TransformXML(strXML,oXSLT,Response); + } + =20 + ///<summary> + ///Do an XSLT transform with an xml string and an System.Xml.Xsl= .XslTransform object + ///</summary> + ///<param name=3D'strXML'>The string of the xml document</param> + ///<param name=3D'xsl'>The url of the xsl</param> + ///<param name=3D'Response'>The html response object to send exc= eption if needed</param> + ///<returns>The result of transformation</returns> + private static string TransformXML(string strXML, System.Xml.Xsl= .XslTransform xsl, System.Web.HttpResponse Response) + { + //Logger.Log("Result of transformation: " + strXML, LogLevel= .Trace); + System.IO.StringWriter oSW =3D new System.IO.StringWriter(); + try + { + System.Xml.XmlTextReader oXR =3D new System.Xml.Xml= TextReader(new StringReader(strXML)); + System.Xml.XPath.XPathDocument oXPath =3D new Syste= m.Xml.XPath.XPathDocument(oXR); + xsl.Transform(oXPath,null,oSW); + } + catch (System.Exception e) + { + //Put in custom error handler here... + //string x =3D e.ToString(); + //Response.Write(x); + } =20 + return oSW.ToString(); + } + =20 + ///<summary> + ///Call an asp page that will build an xsl object from parameter= s that represents other xsl... Whoaw! + ///</summary> + ///<param name=3D'url'>The string of the xml document</param> + ///<param name=3D'parameters'>The url of the xsl</param> + ///<returns>An xsl object ; ready to apply a transformation</ret= urns> + private static System.Xml.Xsl.XslTransform GetXSLFromASP(string = url, NameValueCollection parameters) + { + System.Net.WebClient wcXsl =3D new WebClient(); + byte[] page =3D wcXsl.UploadValues(url,"POST",parameters); + =20 + System.Xml.Xsl.XslTransform xsl =3D new System.Xml.Xsl.XslTr= ansform(); =20 page =3D cleanXsl(page); //Throw the bad charact= ers (\r,\n that causes trouble in windows) System.IO.MemoryStream memPage =3D new MemoryStr= eam(page); - xsl.Load(new System.Xml.XmlTextReader(memPage),new System.Xml.XmlUrlR= esolver() ,null); =09 - return xsl; - } - =20 - private static byte [] cleanXsl(byte [] xslArray) - { - string xslString =3D ByteArrayToString(xslArray)= ; - //xslString =3D xslString.Replace("\n",""); //th= row \n - //xslString =3D xslString.Replace("\r",""); // t= hrow \r - if(xslString[0]!=3D'<') - xslString=3D xslString.Substring(2); //S= kip the two first caracters - =20 - return StringToByteArray(xslString); - } - =20 - private static byte [] StringToByteArray(string str) - { - byte [] array =3D new byte[str.Length]; - =20 - for(int i=3D0; i< str.Length;i++) - { - array[i] =3D Convert.ToByte(str[i]); - } - =20 - return array; - } - =20 - private static string ByteArrayToString(byte [] array) - { - string result =3D ""; - for(int i=3D0; i<array.Length;i++) =20 - { - result +=3D Convert.ToChar(array[i]); - } - return result; - } + xsl.Load(new System.Xml.XmlTextReader(memPage),new System.Xm= l.XmlUrlResolver() ,null); =09 + return xsl; } + =20 + private static byte [] cleanXsl(byte [] xslArray) + { + string xslString =3D ByteArrayToString(xslArray); + //xslString =3D xslString.Replace("\n",""); //throw \n + //xslString =3D xslString.Replace("\r",""); // throw \r + if(xslString[0]!=3D'<') + xslString=3D xslString.Substring(2); //Skip the two firs= t caracters + =20 + return StringToByteArray(xslString); + } + =20 + private static byte [] StringToByteArray(string str) + { + byte [] array =3D new byte[str.Length]; + =20 + for(int i=3D0; i< str.Length;i++) + { + array[i] =3D Convert.ToByte(str[i]); + } + =20 + return array; + } + =20 + private static string ByteArrayToString(byte [] array) + { + string result =3D ""; + for(int i=3D0; i<array.Length;i++) =20 + { + result +=3D Convert.ToChar(array[i]); + } + return result; + } + } } Property changes on: humano2/trunk/components/webTools/xmltools.cs ___________________________________________________________________ Name: svn:keywords + Id Modified: humano2/trunk/web/builder/site/createreport.aspx.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/createreport.aspx.cs 2005-06-14 21:50:= 38 UTC (rev 1325) +++ humano2/trunk/web/builder/site/createreport.aspx.cs 2005-06-14 22:21:= 31 UTC (rev 1326) @@ -474,9 +474,6 @@ return null; } =20 - // List of attributes to show. - //string columnsStr =3D "0,"; - =20 if(receivedColumnsStr =3D=3D "0") //No columns =3D> No Updat= e/Create { Logger.Log("No columns for report",LogLevel.Trace); @@ -487,26 +484,14 @@ DataRow dr =3D dt.NewRow(); dr["idClassReport"] =3D receivedClassId; dr["reportName"] =3D receivedReportName; - =20 - //Logger.Log("reportmain: checkForPertinence: " + userCred.C= oreAdapter.CheckForPertinence(receivedColumnsStr),LogLevel.Trace); - =20 - //dr["columns"] =3D userCred.CoreAdapter.CheckForPertinence(= receivedColumnsStr); //If a column is a pertinence, change it dr["groupby"] =3D receivedColumnsStr; //The columns selected= by user are to put in group by - =20 - //Special case for IN filter - dr["where"] =3D parseWhere(receivedWhereStr); - =20 + dr["where"] =3D Interface.ParseWhere(receivedWhereStr); dr["columns"] =3D buildColumnsForReport(receivedPersoColumns= Str,dr["groupby"].ToString()); // - =20 - dr["order"] =3D parseOrder(receivedOrderStr); - =20 - dr["having"] =3D parseHavings(receivedHavingsStr); - =20 + dr["order"] =3D Interface.ParseOrder(receivedOrderStr); + dr["having"] =3D Interface.ParseHavings(receivedHavingsStr); Logger.Log("receivedOrderStr" + receivedOrderStr, LogLevel.T= race); Logger.Log("receivedWhereStr" + receivedWhereStr, LogLevel.T= race); - =09 dt.Rows.Add(dr); - =20 return dt; } =20 @@ -551,182 +536,7 @@ =20 return res; } - =20 - ///<summary> - /// A order string is received from the web page in this format: - /// idAtt0 | 0 or 1,idAtt1 | 0 or 1 etc... - /// We have to add the queue to each where condition (1|0 or 0|0= ) - ///</summary> - private string parseOrder(string order) =20 - { - if(order=3D=3D"" || order =3D=3D null) - { - return ""; =20 - } =20 - string res =3D ""; - string [] orderSplit =3D order.Split((";").ToCharArray()); /= /First get the lines - =20 - for(int i=3D0;i<orderSplit.Length;i++) - { - string [] lineSplit =3D orderSplit[i].Split(("|").ToChar= Array()); - string line =3D ""; - =20 - line +=3D lineSplit[0]; - line +=3D '|'; =20 - line +=3D lineSplit[1]; - =20 - res +=3D line; - if(i!=3D orderSplit.Length-1) - { - res +=3D ","; =20 - } - //Last line nothing to add - } - =20 - Logger.Log("parseOrder=3D " + res,LogLevel.Trace); - =20 - return res; - } - =20 - =20 - ///<summary> - /// A where string is received from the web page in this format: - /// idAtt0 | idOp0 | 'value'|;idAtt1 | idOp1 | 'value'|; ... etc - /// We have to add the queue to each where condition (1|0 or 0|0= ) - ///</summary> - private string parseWhere(string where) =20 - { - - if(where=3D=3D"" || where =3D=3D null) //Nothing to do - { - return ""; //Don't return "" because in this case the fi= eld of database won't be updated - } - =20 - string res =3D ""; - string [] whereSplit =3D where.Split((";").ToCharArray()); /= /First get the lines - =20 - for(int i=3D0;i<whereSplit.Length;i++) - { - string [] lineSplit =3D whereSplit[i].Split(("|").ToChar= Array()); - string line =3D ""; - for(int j=3D0; j<lineSplit.Length;j++) - { - line +=3D lineSplit[j]; - line +=3D '|'; =20 - =20 - } - res +=3D line; - if(i!=3D whereSplit.Length-1) - { - res +=3D "1|0;"; =20 - } - else //Last line - { - res +=3D"0|0"; - } - } - Logger.Log("parseWhere(before treatin)=3D " + res,LogLevel.= Trace); - =20 - res =3D treatInSpecialCase(res);=20 - =20 - Logger.Log("parseWhere=3D " + res,LogLevel.Trace); - =20 - return res; - } - =20 - =20 - ///<summary> - /// A having string is received from the web page in this format= : - /// idFunc0 |idAtt0 | idOp0 | 'value'|;idFunc1|idAtt1 | idOp1 | = 'value'|; ... etc - /// We have to add the queue to each where condition (1|0 or 0|0= ) - ///</summary> - private string parseHavings(string havings) =20 - { - - if(havings=3D=3D"") //Nothing to do - { - return ""; - } - =20 - string res =3D ""; - string [] havingsSplit =3D havings.Split((";").ToCharArray()= ); //First get the lines - =20 - for(int i=3D0;i<havingsSplit.Length;i++) - { - string [] lineSplit =3D havingsSplit[i].Split(("|").ToCh= arArray()); - string line =3D ""; - for(int j=3D0; j<lineSplit.Length;j++) - { - line +=3D lineSplit[j]; - line +=3D '|'; =20 - } - res +=3D line; - if(i!=3D havingsSplit.Length-1) - { - res +=3D "1|0;"; =20 - } - else //Last line - { - res +=3D"0|0"; - } - } - Logger.Log("parseHavings(before treatin)=3D " + res,LogLeve= l.Trace); - =20 - //res =3D treatInSpecialCase(res);=20 - =20 - Logger.Log("parseHavings=3D " + res,LogLevel.Trace); - =20 - return res; - } - =20 - =20 - ///<summary> - /// The IN filter must be treated in a special maner. If the val= ue to compare to is "20 30", then=20 - /// this value must be changed to ['20','30']; (ReportToolsDoc) - ///</summary> =20 - private string treatInSpecialCase(string where) - { - if(where =3D=3D "") - { - return ""; =20 - } - string [] whereArr =3D where.Split(new char [] {'|',';'}); - =20 - for(int i=3D0;i<whereArr.Length;i++) - { - Logger.Log("whereArr" +"[" + Convert.ToString(i) + "]=3D= " + whereArr[i],LogLevel.Trace); - } - =20 - string newWhere=3D"";=20 - for(int i=3D0;i<whereArr.Length;i+=3D5) - { =20 - if(whereArr[i+1] =3D=3D "8") //In case - { - string [] inStrArr =3D whereArr[i+2].Split(new char = [] {' ','\''}); - //rebuild the where str - string whereValueStr =3D ""; - whereValueStr +=3D "[("; - for(int j=3D0;j<inStrArr.Length;j++)=20 - { - if(inStrArr[j] !=3D "") //Remove empty strings a= fter split - whereValueStr +=3D "'" + inStrArr[j] + "'" += ","; =20 - } - whereValueStr =3D whereValueStr.Substring(0,whereVal= ueStr.Length-1); //Remove last coma - whereValueStr +=3D")]"; - =20 - newWhere +=3D whereArr[0+i] + "|" + whereArr[1+i] + = "|" + whereValueStr + "|" +whereArr[3+i] + "|" +whereArr[4+i] + ";"; - } - else - { - newWhere +=3D whereArr[0+i] + "|" + whereArr[1+i] + = "|" + whereArr[2+i] + "|" +whereArr[3+i] + "|" +whereArr[4+i] + ";"; - } - } - newWhere =3D newWhere.Substring(0,newWhere.Length-1); //remo= ve last ';' - Logger.Log("reportmain: treatInSpecialCase return=3D " + new= Where, LogLevel.Trace); - return newWhere; - } =20 - =20 private void ProcessCreationUpdate() { =20 Modified: humano2/trunk/web/builder/site/js/createinterfacetools.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/js/createinterfacetools.js 2005-06-14 = 21:50:38 UTC (rev 1325) +++ humano2/trunk/web/builder/site/js/createinterfacetools.js 2005-06-14 = 22:21:31 UTC (rev 1326) @@ -178,13 +178,14 @@ return optionArray; } =20 -function Reload() + +function Reload(page) { var indice =3D document.formulario.classList.selectedIndex; if(indice>0) { valor =3D document.formulario.classList.options[indice].value; - self.location =3D "createreport.aspx?classList=3D"+valor; + self.location =3D page + "?classList=3D"+valor; } } =20 Modified: humano2/trunk/web/builder/site/viewmain.aspx.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-14 21:50:38 U= TC (rev 1325) +++ humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-14 22:21:31 U= TC (rev 1326) @@ -412,7 +412,6 @@ // List of attributes to show. //string columnsStr =3D "0,"; =20 - =20 if(receivedColumnsStr =3D=3D "0") //No columns =3D> No Updat= e/Create { Logger.Log("No columns for view",LogLevel.Trace); @@ -424,15 +423,11 @@ dr["idClassView"] =3D receivedClassId; dr["viewName"] =3D receivedViewName; =20 - //Logger.Log("viewmain: checkForPertinence: " + userCred.Cor= eAdapter.CheckForPertinence(receivedColumnsStr),LogLevel.Trace); - =20 //dr["columns"] =3D userCred.CoreAdapter.CheckForPertinence(= receivedColumnsStr); //If a column is a pertinence, change it dr["columns"] =3D receivedColumnsStr; //If a column is a per= tinence, change it - =20 //Special case for IN filter - dr["where"] =3D parseWhere(receivedWhereStr);=20 - =20 - dr["order"] =3D parseOrder(receivedOrderStr); + dr["where"] =3D Interface.ParseWhere(receivedWhereStr);=20 + dr["order"] =3D Interface.ParseOrder(receivedOrderStr); Logger.Log("receivedOrderStr" + receivedOrderStr, LogLevel.T= race); Logger.Log("receivedWhereStr" + receivedWhereStr, LogLevel.T= race); =09 @@ -440,187 +435,9 @@ =20 return dt; } - =20 - ///<summary> - /// A order string is received from the web page in this format: - /// idAtt0 | 0 or 1,idAtt1 | 0 or 1 etc... - /// We have to add the queue to each where condition (1|0 or 0|0= ) - ///</summary> - private string parseOrder(string order) =20 - { - if(order=3D=3D"" || order =3D=3D null) - { - return ""; =20 - } - =20 - string res =3D ""; - string [] orderSplit =3D order.Split((";").ToCharArray()); /= /First get the lines - =20 - for(int i=3D0;i<orderSplit.Length;i++) - { - string [] lineSplit =3D orderSplit[i].Split(("|").ToChar= Array()); - string line =3D ""; - =20 - line +=3D lineSplit[0]; - line +=3D '|'; =20 - line +=3D lineSplit[1]; - =20 - res +=3D line; - if(i!=3D orderSplit.Length-1) - { - res +=3D ","; =20 - } - //Last line nothing to add - } - =20 - Logger.Log("parseOrder=3D " + res,LogLevel.Trace); - =20 - return res; - } =20 - =20 - =20 - ///<summary> - /// The IN filter must be treated in a special maner. If the val= ue to compare to is "20 30", then=20 - /// this value must be changed to ['20','30']; (ViewToolsDoc) - ///</summary> =20 - /* - private string treatInSpecialCase(string where) - { - if(where =3D=3D "") - { - return ""; =20 - } - string [] whereArr =3D where.Split(new char [] {'|',';'}); - =20 - for(int i=3D0;i<whereArr.Length;i++) - { - Logger.Log("whereArr" +"[" + Convert.ToString(i) + "]=3D= " + whereArr[i],LogLevel.Trace); - } - =20 - string newWhere=3D"";=20 - for(int i=3D0;i<whereArr.Length;i+=3D5) - { =20 - if(whereArr[i+1] =3D=3D "8") //In case - { - string [] inStrArr =3D whereArr[i+2].Split(new char = [] {' ','\''}); - //rebuild the where str - string whereValueStr =3D ""; - whereValueStr +=3D "[("; - for(int j=3D0;j<inStrArr.Length;j++)=20 - { - if(inStrArr[j] !=3D "") //Remove empty strings a= fter split - whereValueStr +=3D "'" + inStrArr[j] + "'" += ","; =20 - } - whereValueStr =3D whereValueStr.Substring(0,whereVal= ueStr.Length-1); //Remove last coma - whereValueStr +=3D")]"; - =20 - newWhere +=3D whereArr[0+i] + "|" + whereArr[1+i] + = "|" + whereValueStr + "|" +whereArr[3+i] + "|" +whereArr[4+i] + ";"; - } - else - { - newWhere +=3D whereArr[0+i] + "|" + whereArr[1+i] + = "|" + whereArr[2+i] + "|" +whereArr[3+i] + "|" +whereArr[4+i] + ";"; - } - } - newWhere =3D newWhere.Substring(0,newWhere.Length-1); //remo= ve last ';' - Logger.Log("viewmain: treatInSpecialCase return=3D " + newWh= ere, LogLevel.Trace); - return newWhere; - } =20 - */ - ///<summary> - /// The IN filter must be treated in a special maner. If the val= ue to compare to is "20 30", then=20 - /// this value must be changed to ['20','30']; (ReportToolsDoc) - ///</summary> =20 - private string treatInSpecialCase(string where) - { - if(where =3D=3D "") - { - return ""; =20 - } - string [] whereArr =3D where.Split(new char [] {'|',';'}); - =20 - for(int i=3D0;i<whereArr.Length;i++) - { - Logger.Log("whereArr" +"[" + Convert.ToString(i) + "]=3D= " + whereArr[i],LogLevel.Trace); - } - =20 - string newWhere=3D"";=20 - for(int i=3D0;i<whereArr.Length;i+=3D5) - { =20 - if(whereArr[i+1] =3D=3D "8") //In case - { - string [] inStrArr =3D whereArr[i+2].Split(new char = [] {' ','\''}); - //rebuild the where str - string whereValueStr =3D ""; - whereValueStr +=3D "[("; - for(int j=3D0;j<inStrArr.Length;j++)=20 - { - if(inStrArr[j] !=3D "") //Remove empty strings a= fter split - whereValueStr +=3D "'" + inStrArr[j] + "'" += ","; =20 - } - whereValueStr =3D whereValueStr.Substring(0,whereVal= ueStr.Length-1); //Remove last coma - whereValueStr +=3D")]"; - =20 - newWhere +=3D whereArr[0+i] + "|" + whereArr[1+i] + = "|" + whereValueStr + "|" +whereArr[3+i] + "|" +whereArr[4+i] + ";"; - } - else - { - newWhere +=3D whereArr[0+i] + "|" + whereArr[1+i] + = "|" + whereArr[2+i] + "|" +whereArr[3+i] + "|" +whereArr[4+i] + ";"; - } - } - newWhere =3D newWhere.Substring(0,newWhere.Length-1); //remo= ve last ';' - Logger.Log("viewmain: treatInSpecialCase return=3D " + newWh= ere, LogLevel.Trace); - return newWhere; - } =20 - =20 - =20 - ///<summary> - /// A where string is received from the web page in this format: - /// idAtt0 | idOp0 | 'value'|;idAtt1 | idOp1 | 'value'|; ... etc - /// We have to add the queue to each where condition (1|0 or 0|0= ) - ///</summary> - private string parseWhere(string where) =20 - { =20 - if(where=3D=3D"" || where =3D=3D null) //Nothing to do - { - return ""; //Don't return "" because in this case the fi= eld of database won't be updated - } - =20 - string res =3D ""; - string [] whereSplit =3D where.Split((";").ToCharArray()); /= /First get the lines - =20 - for(int i=3D0;i<whereSplit.Length;i++) - { - string [] lineSplit =3D whereSplit[i].Split(("|").ToChar= Array()); - string line =3D ""; - for(int j=3D0; j<lineSplit.Length;j++) - { - line +=3D lineSplit[j]; - line +=3D '|'; =20 - =20 - } - res +=3D line; - if(i!=3D whereSplit.Length-1) - { - res +=3D "1|0;"; =20 - } - else //Last line - { - res +=3D"0|0"; - } - } - Logger.Log("parseWhere(before treatin)=3D " + res,LogLevel.= Trace); - =20 - res =3D treatInSpecialCase(res);=20 - =20 - Logger.Log("parseWhere=3D " + res,LogLevel.Trace); - =20 - return res; - } - =20 private void ProcessCreationUpdate() { - =20 Logger.Log("ViewMain: ProcessCreationUpdate", LogLevel.Trace= ); =20 receivedClassId =3D Request["sendClassId"]; Modified: humano2/trunk/web/builder/site/xsl/createreport.xsl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-14 21:50:= 38 UTC (rev 1325) +++ humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-14 22:21:= 31 UTC (rev 1326) @@ -223,7 +223,7 @@ <!-- Only show classes f= or select when creating --> <xsl:if test=3D"/report/= reportDatas/saveName=3D'Create'" >=20 <td> - <select class=3D"drp= dwn2" id=3D"classList" onchange=3D"Reload();"> + <select class=3D"drp= dwn2" id=3D"classList" onchange=3D"Reload('createreport.aspx');"> <xsl:for-each se= lect=3D"report/classes/class"> <option> <xsl:att= ribute name=3D"name"> Modified: humano2/trunk/web/builder/site/xsl/createview.xsl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-14 21:50:38= UTC (rev 1325) +++ humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-14 22:21:31= UTC (rev 1326) @@ -42,10 +42,7 @@ i++; </xsl:for-each> </xsl:for-each> - =20 - =20 =20 - =20 ////////////////// //Filter =20 @@ -157,16 +154,6 @@ leftAttribsArr =3D splitColTab["left"]; rightAttribsArr =3D splitColTab["right"]; =20 - function recargar() - { - var indice =3D document.formulario.classList.selecte= dIndex; - if(indice>0) - { - valor =3D document.formulario.classList.options[= indice].value; - self.location =3D "viewmain.aspx?classList=3D"+v= alor; - } - } - =20 </script> </head> <body> @@ -207,7 +194,7 @@ = Form.UpdateFilter(expandFormFilter,this.value); = ">=20 = --> - <select class=3D= "drpdwn2" id=3D"classList" onchange=3D"recargar();"> + <select class=3D= "drpdwn2" id=3D"classList" onchange=3D"Reload('viewmain.aspx');"> <xsl:for-eac= h select=3D"view/classes/class"> <option> <xsl= :attribute name=3D"name"> |
|
From: <sv...@de...> - 2005-06-14 21:50:36
|
Author: pcamacho
Date: 2005-06-14 17:50:38 -0400 (Tue, 14 Jun 2005)
New Revision: 1325
Modified:
humano2/trunk/web/builder/site/js/form.js
humano2/trunk/web/builder/site/viewmain.aspx.cs
humano2/trunk/web/builder/site/xsl/createview.xsl
Log:
CHANGE: create view / report factorisation worked well. Missing: factoriz=
e C# code.
Modified: humano2/trunk/web/builder/site/js/form.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/form.js 2005-06-14 20:27:39 UTC (re=
v 1324)
+++ humano2/trunk/web/builder/site/js/form.js 2005-06-14 21:50:38 UTC (re=
v 1325)
@@ -66,7 +66,7 @@
//The filter
//alert("filter SelfRefName:" + filter.GetSelfRefName());
var whereStr =3D this.infosToSubmit.filter.ReturnValues();
- //alert("whereStr: " + whereStr);
+ alert("whereStr: " + whereStr);
=20
if(this.type =3D=3D 'REPORT')
{
Modified: humano2/trunk/web/builder/site/viewmain.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-14 20:27:39 U=
TC (rev 1324)
+++ humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-14 21:50:38 U=
TC (rev 1325)
@@ -154,12 +154,11 @@
=20
private string getViewContent()
{
- //adapter dbAdapter =3D userCred.CoreAdapter;
absCrud crud =3D Factory.Crud();
absComplex complex =3D crud.GetCore().Complex;
=20
string [] viewContent =3D complex.GetParamsView(viewId);
- //Response.Write(viewContent[0]);
+ Logger.Log("viewContent[2]=3D" + viewContent[2], LogLevel.Trace);
=20
string res =3D"";
=20
@@ -326,7 +325,7 @@
string [] tabOrder =3D order.Split(new char [] {',','|'}); =
=20
string xmlRes =3D "";
string [] columnsList =3D getColumnsList();
- =20
+ Logger.Log("getViewOrderXml:",LogLevel.Trace);
if(tabOrder.Length <=3D 1)
{
return "";
@@ -337,6 +336,8 @@
{
string orderAtt =3D Convert.ToString(Convert.ToInt32(get=
IndexOfElement(tabOrder[i+0],columnsList))+1);
string orderAscOrDesc =3D Convert.ToString(Convert.ToInt=
32(tabOrder[i+1])+1);
+ Logger.Log("orderAtt=3D" + orderAtt,LogLevel.Trace);
+ Logger.Log("orderAscOrDesc=3D" + orderAscOrDesc,LogLevel=
.Trace);
xmlRes +=3D"<order>";
xmlRes +=3D"<idAtt>" + orderAtt + "</idAtt>";
xmlRes +=3D"<ascOrDesc>" + orderAscOrDesc + "</ascOrDesc=
>";
@@ -429,9 +430,9 @@
dr["columns"] =3D receivedColumnsStr; //If a column is a per=
tinence, change it
=20
//Special case for IN filter
- dr["where"] =3D treatInSpecialCase(receivedWhereStr);=20
+ dr["where"] =3D parseWhere(receivedWhereStr);=20
=20
- dr["order"] =3D receivedOrderStr;
+ dr["order"] =3D parseOrder(receivedOrderStr);
Logger.Log("receivedOrderStr" + receivedOrderStr, LogLevel.T=
race);
Logger.Log("receivedWhereStr" + receivedWhereStr, LogLevel.T=
race);
=09
@@ -441,9 +442,48 @@
}
=20
///<summary>
+ /// A order string is received from the web page in this format:
+ /// idAtt0 | 0 or 1,idAtt1 | 0 or 1 etc...
+ /// We have to add the queue to each where condition (1|0 or 0|0=
)
+ ///</summary>
+ private string parseOrder(string order) =20
+ {
+ if(order=3D=3D"" || order =3D=3D null)
+ {
+ return ""; =20
+ }
+ =20
+ string res =3D "";
+ string [] orderSplit =3D order.Split((";").ToCharArray()); /=
/First get the lines
+ =20
+ for(int i=3D0;i<orderSplit.Length;i++)
+ {
+ string [] lineSplit =3D orderSplit[i].Split(("|").ToChar=
Array());
+ string line =3D "";
+ =20
+ line +=3D lineSplit[0];
+ line +=3D '|'; =20
+ line +=3D lineSplit[1];
+ =20
+ res +=3D line;
+ if(i!=3D orderSplit.Length-1)
+ {
+ res +=3D ","; =20
+ }
+ //Last line nothing to add
+ }
+ =20
+ Logger.Log("parseOrder=3D " + res,LogLevel.Trace);
+ =20
+ return res;
+ } =20
+ =20
+ =20
+ ///<summary>
/// The IN filter must be treated in a special maner. If the val=
ue to compare to is "20 30", then=20
/// this value must be changed to ['20','30']; (ViewToolsDoc)
///</summary> =20
+ /*
private string treatInSpecialCase(string where)
{
if(where =3D=3D "")
@@ -484,8 +524,100 @@
newWhere =3D newWhere.Substring(0,newWhere.Length-1); //remo=
ve last ';'
Logger.Log("viewmain: treatInSpecialCase return=3D " + newWh=
ere, LogLevel.Trace);
return newWhere;
+ } =20
+ */
+ ///<summary>
+ /// The IN filter must be treated in a special maner. If the val=
ue to compare to is "20 30", then=20
+ /// this value must be changed to ['20','30']; (ReportToolsDoc)
+ ///</summary> =20
+ private string treatInSpecialCase(string where)
+ {
+ if(where =3D=3D "")
+ {
+ return ""; =20
+ }
+ string [] whereArr =3D where.Split(new char [] {'|',';'});
+ =20
+ for(int i=3D0;i<whereArr.Length;i++)
+ {
+ Logger.Log("whereArr" +"[" + Convert.ToString(i) + "]=3D=
" + whereArr[i],LogLevel.Trace);
+ }
+ =20
+ string newWhere=3D"";=20
+ for(int i=3D0;i<whereArr.Length;i+=3D5)
+ { =20
+ if(whereArr[i+1] =3D=3D "8") //In case
+ {
+ string [] inStrArr =3D whereArr[i+2].Split(new char =
[] {' ','\''});
+ //rebuild the where str
+ string whereValueStr =3D "";
+ whereValueStr +=3D "[(";
+ for(int j=3D0;j<inStrArr.Length;j++)=20
+ {
+ if(inStrArr[j] !=3D "") //Remove empty strings a=
fter split
+ whereValueStr +=3D "'" + inStrArr[j] + "'" +=
","; =20
+ }
+ whereValueStr =3D whereValueStr.Substring(0,whereVal=
ueStr.Length-1); //Remove last coma
+ whereValueStr +=3D")]";
+ =20
+ newWhere +=3D whereArr[0+i] + "|" + whereArr[1+i] + =
"|" + whereValueStr + "|" +whereArr[3+i] + "|" +whereArr[4+i] + ";";
+ }
+ else
+ {
+ newWhere +=3D whereArr[0+i] + "|" + whereArr[1+i] + =
"|" + whereArr[2+i] + "|" +whereArr[3+i] + "|" +whereArr[4+i] + ";";
+ }
+ }
+ newWhere =3D newWhere.Substring(0,newWhere.Length-1); //remo=
ve last ';'
+ Logger.Log("viewmain: treatInSpecialCase return=3D " + newWh=
ere, LogLevel.Trace);
+ return newWhere;
} =20
=20
+ =20
+ ///<summary>
+ /// A where string is received from the web page in this format:
+ /// idAtt0 | idOp0 | 'value'|;idAtt1 | idOp1 | 'value'|; ... etc
+ /// We have to add the queue to each where condition (1|0 or 0|0=
)
+ ///</summary>
+ private string parseWhere(string where) =20
+ {
+
+ if(where=3D=3D"" || where =3D=3D null) //Nothing to do
+ {
+ return ""; //Don't return "" because in this case the fi=
eld of database won't be updated
+ }
+ =20
+ string res =3D "";
+ string [] whereSplit =3D where.Split((";").ToCharArray()); /=
/First get the lines
+ =20
+ for(int i=3D0;i<whereSplit.Length;i++)
+ {
+ string [] lineSplit =3D whereSplit[i].Split(("|").ToChar=
Array());
+ string line =3D "";
+ for(int j=3D0; j<lineSplit.Length;j++)
+ {
+ line +=3D lineSplit[j];
+ line +=3D '|'; =20
+ =20
+ }
+ res +=3D line;
+ if(i!=3D whereSplit.Length-1)
+ {
+ res +=3D "1|0;"; =20
+ }
+ else //Last line
+ {
+ res +=3D"0|0";
+ }
+ }
+ Logger.Log("parseWhere(before treatin)=3D " + res,LogLevel.=
Trace);
+ =20
+ res =3D treatInSpecialCase(res);=20
+ =20
+ Logger.Log("parseWhere=3D " + res,LogLevel.Trace);
+ =20
+ return res;
+ }
+ =20
private void ProcessCreationUpdate()
{
=20
Modified: humano2/trunk/web/builder/site/xsl/createview.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-14 20:27:39=
UTC (rev 1324)
+++ humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-14 21:50:38=
UTC (rev 1325)
@@ -430,7 +430,7 @@
<xsl=
:value-of select=3D"/view/viewDatas/saveName" />
</xsl:at=
tribute>
<xsl:att=
ribute name=3D"onclick">
- retu=
rn Form.UpdateSubmitAll(rightColumn,expandFormOrder,expandFormFilter); //=
Don't forget to do the same in Form.UpdateHeader
+ retu=
rn Form.UpdateSubmitAll();=20
</xsl:at=
tribute>
</input>
</div>
@@ -440,7 +440,7 @@
<xsl:if test=
=3D"/view/viewDatas/displayDeleteButton=3D'true'" >
<input t=
ype=3D"submit" value=3D"Delete">
<xsl=
:attribute name=3D"onclick">
- =
Form.DeleteView(<xsl:value-of select=3D"/view/id" />);
+ =
Form.DeleteView();
</xs=
l:attribute>
</input>
</xsl:if>
@@ -467,6 +467,20 @@
</div>
<script language=3D"Javascript">
<xsl:if test=3D"/view/viewDatas/classId!=3D''">
+ var infosToSubmit =3D
+ {
+ <xsl:if test=3D"/view/viewDatas/name!=3D=
''"> <!-- UPDATE -->
+ id:<xsl:value-of select=3D"/view/vie=
wDatas/id" />,
+ </xsl:if>
+ divName:document.getElementById('viewNam=
eInput'),
+ rightColumn: rightColumn,
+ sort: expandFormOrder,
+ filter: expandFormFilter,
+ divSubmitAll: document.getElementById('S=
ubmitAll')
+ }
+ var Form =3D new Form(<xsl:value-of select=3D=
"/view/viewDatas/classId" />,"VIEW", infosToSubmit);
+ </xsl:if>
+ <xsl:if test=3D"/view/viewDatas/classId!=3D''">
var Form =3D new Form(<xsl:value-of select=3D=
"/view/viewDatas/classId" />,"VIEW");
</xsl:if>
</script>
|
|
From: <sv...@de...> - 2005-06-14 20:27:43
|
Author: pcamacho
Date: 2005-06-14 16:27:39 -0400 (Tue, 14 Jun 2005)
New Revision: 1324
Modified:
humano2/trunk/web/builder/site/createreport.aspx.cs
humano2/trunk/web/builder/site/js/form.js
humano2/trunk/web/builder/site/js/grafcomponents/expandform.js
humano2/trunk/web/builder/site/viewmain.aspx.cs
humano2/trunk/web/builder/site/xsl/createreport.xsl
humano2/trunk/web/builder/site/xsl/createview.xsl
Log:
CHANGE: factorisation of form. Works for reports. Remain views.
Modified: humano2/trunk/web/builder/site/createreport.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/createreport.aspx.cs 2005-06-14 19:11:=
02 UTC (rev 1323)
+++ humano2/trunk/web/builder/site/createreport.aspx.cs 2005-06-14 20:27:=
39 UTC (rev 1324)
@@ -733,7 +733,7 @@
Logger.Log("ReportMain: ProcessCreationUpdate", LogLevel.Tra=
ce);
=20
receivedClassId =3D Request["sendClassId"];
- receivedReportName =3D Request["sendReportName"];
+ receivedReportName =3D Request["sendName"];
receivedColumnsStr =3D Request["sendColumnsStr"];
receivedOrderStr =3D Request["sendOrderStr"];
receivedWhereStr =3D Request["sendWhereStr"];
Modified: humano2/trunk/web/builder/site/js/form.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/form.js 2005-06-14 19:11:02 UTC (re=
v 1323)
+++ humano2/trunk/web/builder/site/js/form.js 2005-06-14 20:27:39 UTC (re=
v 1324)
@@ -12,28 +12,27 @@
*/
=20
////////////////////////////////////////////// Form Class //////////////=
///////////////////////////////////////////////
-function Form(formArray, classId) //, ReportParams)
+function Form(classId,type,infosToSubmit)=20
{
//Fields
- this.attributeLeftArray =3D new Array();
- this.attributeRightArray =3D new Array();
- this.formArray =3D formArray;
+ this.type =3D type;
this.classId =3D classId;
+ this.infosToSubmit =3D infosToSubmit;
=20
//Methods
this.UpdateSubmitAll =3D FormUpdateSubmitAll;
this.DeleteReport =3D FormDeleteReport;
}
=20
-function FormUpdateSubmitAll(rightColumn,sort,filter,persoColumns,having=
s)
+function FormUpdateSubmitAll()
{
//Get the ReportName
- var reportNameInput =3D GetNodeByTagNameAndAttName("input","reportNa=
meInput")[0];
- var reportName =3D reportNameInput.value;
+ var name =3D this.infosToSubmit.divName.value; //GetNodeByTagNameAnd=
AttName("input","reportNameInput")[0];
+ //var reportName =3D reportNameInput.value;
=20
- if(reportName =3D=3D "")
+ if(name =3D=3D "")
{
- alert("You must enter the name of report."); =20
+ alert("You must enter the name."); =20
return false;
}
=20
@@ -46,7 +45,7 @@
//Build the columnstr string
//alert(rightColumn);
var i;
- var sortedList =3D rightColumn.fSortedList;
+ var sortedList =3D this.infosToSubmit.rightColumn.fSortedList;
//alert(sortedList.Length());
var columnsStr =3D "";
for(i=3D0;i<sortedList.Length();i++)
@@ -61,46 +60,70 @@
//Now the sort
//alert("sort SelfRefName:" + sort.GetSelfRefName());
=20
- var orderStr =3D sort.ReturnValues();=20
+ var orderStr =3D this.infosToSubmit.sort.ReturnValues();=20
//alert("orderStr: " + orderStr);
=20
//The filter
//alert("filter SelfRefName:" + filter.GetSelfRefName());
- var whereStr =3D filter.ReturnValues();
+ var whereStr =3D this.infosToSubmit.filter.ReturnValues();
//alert("whereStr: " + whereStr);
=20
- var persoColumnsStr =3D persoColumns.ReturnValues();
- //alert("persoColumnsStr: " + persoColumnsStr);
+ if(this.type =3D=3D 'REPORT')
+ {
+ var persoColumnsStr =3D this.infosToSubmit.persoColumns.ReturnVa=
lues();
+ //var havingsStr =3D this.infosToSubmit.havings.ReturnValues(); =
Commented due to bug#123
+ var havingsStr =3D "";
+ }
=20
- //var havingsStr =3D havings.ReturnValues(); Commented due to bug#12=
3
- var havingsStr =3D "";
- =20
//Update the submit all TD
- var divSubmitAll =3D GetNodeByTagNameAndAttName("div","SubmitAll")[0=
];
+ var divSubmitAll =3D this.infosToSubmit.divSubmitAll;
//alert(divSubmitAll);
divSubmitAll.innerHTML +=3D=20
=20
"<input type=3D\"hidden\" name=3D\"sendCreateUpdate\" value=3D\"=
true\"></input>"
+"<input type=3D\"hidden\" name=3D\"sendClassId\" value=3D\""+ c=
lassId +"\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendReportName\" value=3D\""=
+ reportName + "\"></input>"
+ +"<input type=3D\"hidden\" name=3D\"sendName\" value=3D\"" + nam=
e + "\"></input>"
+"<input type=3D\"hidden\" name=3D\"sendColumnsStr\" value=3D\""=
+ columnsStr + "\"></input>"
+"<input type=3D\"hidden\" name=3D\"sendOrderStr\" value=3D\"" +=
orderStr + "\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendWhereStr\" value=3D\"" +=
whereStr + "\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendPersoColumnsStr\" value=3D=
\"" + persoColumnsStr + "\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendHavingsStr\" value=3D\""=
+ havingsStr + "\"></input>";
- =20
+ +"<input type=3D\"hidden\" name=3D\"sendWhereStr\" value=3D\"" +=
whereStr + "\"></input>";
+ =20
+ if (this.type =3D=3D 'REPORT')
+ {
+ divSubmitAll.innerHTML +=3D=20
+ "<input type=3D\"hidden\" name=3D\"sendPersoColumnsStr\" val=
ue=3D\"" + persoColumnsStr + "\"></input>"
+ +"<input type=3D\"hidden\" name=3D\"sendHavingsStr\" value=3D=
\"" + havingsStr + "\"></input>";
+ } =20
//alert(divSubmitAll.innerHTML);
return true;
}
=20
-function FormDeleteReport(reportId)
+function FormDeleteReport()
{
- if (confirm("Are you sure you want to delete the report?"))
+ var msg =3D "Are you sure you want to delete the ";
+ switch(this.type)
{
+ case 'VIEW': =20
+ msg +=3D "view";
+ case 'REPORT':
+ msg +=3D "report"; =20
+ }
+ msg +=3D"?";
+ =20
+ if (confirm(msg))
+ {
+ var id =3D this.infosToSubmit.id;
+ var name;
+ switch(this.type)
+ {
+ case 'VIEW': =20
+ name =3D "viewId";
+ case 'REPORT':
+ name =3D "reportId"; =20
+ }
var divSubmitAll =3D GetNodeByTagNameAndAttName("div","SubmitAll=
")[0];
- //alert(divSubmitAll);
- divSubmitAll.innerHTML +=3D "<input type=3D\"hidden\" name=3D=
\"delete\" value=3D\"true\"></input>";
- divSubmitAll.innerHTML +=3D "<input type=3D\"hidden\" name=3D=
\"reportId\" value=3D\"" + reportId + "\"></input>";
+ //alert(divSubmitAll);
+ divSubmitAll.innerHTML +=3D "<input type=3D\"hidden\" name=3D\"d=
elete\" value=3D\"true\"></input>";
+ divSubmitAll.innerHTML +=3D "<input type=3D\"hidden\" name=3D\""=
+ name + "\" value=3D\"" + id + "\"></input>";
return true; =20
}
else
Modified: humano2/trunk/web/builder/site/js/grafcomponents/expandform.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/grafcomponents/expandform.js 2005-0=
6-14 19:11:02 UTC (rev 1323)
+++ humano2/trunk/web/builder/site/js/grafcomponents/expandform.js 2005-0=
6-14 20:27:39 UTC (rev 1324)
@@ -25,7 +25,6 @@
//this.optionArray2 =3D new Array();
this.title =3D title;
=20
- =20
//Methods
this.PutAllComponents =3D ExpandFormPutAllComponents;
this.AddLine =3D ExpandFormAddLine;
Modified: humano2/trunk/web/builder/site/viewmain.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-14 19:11:02 U=
TC (rev 1323)
+++ humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-14 20:27:39 U=
TC (rev 1324)
@@ -492,7 +492,7 @@
Logger.Log("ViewMain: ProcessCreationUpdate", LogLevel.Trace=
);
=20
receivedClassId =3D Request["sendClassId"];
- receivedViewName =3D Request["sendViewName"];
+ receivedViewName =3D Request["sendName"];
receivedColumnsStr =3D Request["sendColumnsStr"];
receivedOrderStr =3D Request["sendOrderStr"];
receivedWhereStr =3D Request["sendWhereStr"];
Modified: humano2/trunk/web/builder/site/xsl/createreport.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-14 19:11:=
02 UTC (rev 1323)
+++ humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-14 20:27:=
39 UTC (rev 1324)
@@ -27,32 +27,6 @@
=20
<!-- Here we create an array and use it as parameter for For=
m class constructor -->
<script language=3D"Javascript">
- =20
- ////////////////////////
- //The form
- var formArray =3D new Array();
- var i; //Counter
- =20
- <xsl:for-each select=3D"/report/classes/class[count(attr=
ibutes)>0]">
- <xsl:variable name=3D"classId">
- <xsl:value-of select=3D"id" />
- </xsl:variable>
- formArray[<xsl:value-of select=3D"$classId"/>] =3D n=
ew Array();
- i=3D0;
- <xsl:for-each select=3D"attributes/attribute">
- formArray[<xsl:value-of select=3D"$classId"/>][i=
] =3D new Array();
- formArray[<xsl:value-of select=3D"$classId"/>][i=
]["value"] =3D "<xsl:value-of select=3D"id"/>";
- formArray[<xsl:value-of select=3D"$classId"/>][i=
]["name"] =3D "<xsl:value-of select=3D"name" />";
- i++;
- </xsl:for-each>
- </xsl:for-each>
- =20
- <xsl:if test=3D"/report/reportDatas/classId!=3D''">
- var Form =3D new Form(formArray,<xsl:value-of select=3D"=
/report/reportDatas/classId" />);
- </xsl:if>
- //alert(Form.GetOptionString(0));
- =20
- =20
///////////////
/// The columns of attributes (group columns)
var attribsArr =3D new Array();
@@ -539,12 +513,7 @@
<xsl:val=
ue-of select=3D"/report/reportDatas/saveName" />
</xsl:attrib=
ute>
<xsl:attribu=
te name=3D"onclick">
- Form.Upd=
ateSubmitAll(rightColumn,
- =
expandFormSort,
- =
expandFormFilter,
- =
expandFormPersoColumns,
- =
null);
- =
//expandFormHavings); Commented due to bug #123 (replaced te=
mporarly by null)
+ Form.Upd=
ateSubmitAll();
</xsl:attrib=
ute>
</input>
</div>
@@ -554,7 +523,7 @@
<xsl:if test=3D"=
/report/reportDatas/displayDeleteButton=3D'true'" >
<input type=3D=
"submit" value=3D"Delete">
<xsl:att=
ribute name=3D"onclick">
- Form=
.DeleteReport(<xsl:value-of select=3D"/report/id" />);
+ Form=
.DeleteReport();
</xsl:at=
tribute>
</input>
</xsl:if>
@@ -579,6 +548,24 @@
</xsl:attribute>
</input>=20
</div>
+ <script language=3D"Javascript">
+ <xsl:if test=3D"/report/reportDatas/classId!=3D''">
+ var infosToSubmit =3D
+ {
+ <xsl:if test=3D"/report/reportDatas/name!=3D=
''"> <!-- UPDATE -->
+ id:<xsl:value-of select=3D"/report/repor=
tDatas/id" />,
+ </xsl:if>
+ divName:document.getElementById('reportNameI=
nput'),
+ rightColumn: rightColumn,
+ sort: expandFormSort,
+ filter: expandFormFilter,
+ persoColumns:expandFormPersoColumns,
+ divSubmitAll: document.getElementById('Submi=
tAll')
+ //havings =3D=20
+ }
+ var Form =3D new Form(<xsl:value-of select=3D"/r=
eport/reportDatas/classId" />,"REPORT", infosToSubmit);
+ </xsl:if>
+ </script>
</form>
</body>
</html>
Modified: humano2/trunk/web/builder/site/xsl/createview.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-14 19:11:02=
UTC (rev 1323)
+++ humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-14 20:27:39=
UTC (rev 1324)
@@ -43,9 +43,7 @@
</xsl:for-each>
</xsl:for-each>
=20
- <xsl:if test=3D"/view/viewDatas/classId!=3D''">
- var Form =3D new Form(formArray,<xsl:value-of select=3D"=
/view/viewDatas/classId" />);
- </xsl:if>
+ =20
=20
=20
//////////////////
@@ -467,6 +465,11 @@
</xsl:attribute>
</input>=20
</div>
+ <script language=3D"Javascript">
+ <xsl:if test=3D"/view/viewDatas/classId!=3D''">
+ var Form =3D new Form(<xsl:value-of select=3D=
"/view/viewDatas/classId" />,"VIEW");
+ </xsl:if>
+ </script>
</form>
</body>
</html>
|
|
From: <sv...@de...> - 2005-06-14 19:11:02
|
Author: pcamacho Date: 2005-06-14 15:11:02 -0400 (Tue, 14 Jun 2005) New Revision: 1323 Added: humano2/trunk/web/builder/site/js/createinterfacetools.js Removed: humano2/trunk/web/builder/site/createinterfacetools.js Modified: humano2/trunk/web/builder/site/xsl/createreport.xsl humano2/trunk/web/builder/site/xsl/createview.xsl Log: CHANGE: factorization between create(view/report) of the creation of the = arrays (update/create) for the left and=20 right SortedGraphicalList. Deleted: humano2/trunk/web/builder/site/createinterfacetools.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/createinterfacetools.js 2005-06-14 18:= 26:33 UTC (rev 1322) +++ humano2/trunk/web/builder/site/createinterfacetools.js 2005-06-14 19:= 11:02 UTC (rev 1323) @@ -1,95 +0,0 @@ -// -// The Humano2 Business solution. -// Copyright (C) 2004,5 Humano2 Chile S.A. (http://www.humano2.com) -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. =20 -// $Id$ -// - - -function OperatorsGetSelectArray() -{ - var optionArray =3D new Array(); - =20 - optionArray[0] =3D new Array(); - optionArray[0]["value"] =3D "-1"; - optionArray[0]["text"] =3D "--Nothing--"; - optionArray[1] =3D new Array(); - optionArray[1]["value"] =3D "0"; - optionArray[1]["text"] =3D "GreaterOrEqualThan"; - optionArray[2] =3D new Array(); - optionArray[2]["value"] =3D "1"; - optionArray[2]["text"] =3D "LessEqualThan"; - optionArray[3] =3D new Array(); - optionArray[3]["value"] =3D "2"; - optionArray[3]["text"] =3D "GreaterThan"; - optionArray[4] =3D new Array(); - optionArray[4]["value"] =3D "3"; - optionArray[4]["text"] =3D "LessThan"; - optionArray[5] =3D new Array(); - optionArray[5]["value"] =3D "4"; - optionArray[5]["text"] =3D "EqualTo"; - optionArray[6] =3D new Array(); - optionArray[6]["value"] =3D "5"; - optionArray[6]["text"] =3D "DistinctTo"; - optionArray[7] =3D new Array(); - optionArray[7]["value"] =3D "6"; - optionArray[7]["text"] =3D "BeginWith"; - optionArray[8] =3D new Array(); - optionArray[8]["value"] =3D "7"; - optionArray[8]["text"] =3D "ContainsTo"; - optionArray[9] =3D new Array(); - optionArray[9]["value"] =3D "8"; - optionArray[9]["text"] =3D "In"; - =20 - return optionArray; -} - - -function OrderGetSelectArray() -{ - var optionArray =3D new Array(); - =20 - optionArray[0] =3D new Array(); - optionArray[0]["value"] =3D "-1"; - optionArray[0]["text"] =3D "--Nothing--"; - optionArray[1] =3D new Array(); - optionArray[1]["value"] =3D "0"; - optionArray[1]["text"] =3D "Asc"; - optionArray[2] =3D new Array(); - optionArray[2]["value"] =3D "1"; - optionArray[2]["text"] =3D "Desc"; - =20 - return optionArray; -} - -function FunctionsGetSelectArray() -{ - var optionArray =3D new Array(); - - optionArray[0] =3D new Array(); - optionArray[0]["value"] =3D "-1"; - optionArray[0]["text"] =3D "--Nothing--"; - optionArray[1] =3D new Array(); - optionArray[1]["value"] =3D "1"; - optionArray[1]["text"] =3D "Count"; - optionArray[2] =3D new Array(); - optionArray[2]["value"] =3D "2"; - optionArray[2]["text"] =3D "Sum"; - =20 - return optionArray; -} - -function Reload() -{ - indice =3D document.formulario.classList.selectedIndex; - if(indice>0) - { - valor =3D document.formulario.classList.options[indice].value; - self.location =3D "createreport.aspx?classList=3D"+valor; - } -} - Copied: humano2/trunk/web/builder/site/js/createinterfacetools.js (from r= ev 1322, humano2/trunk/web/builder/site/createinterfacetools.js) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/createinterfacetools.js 2005-06-14 18:= 26:33 UTC (rev 1322) +++ humano2/trunk/web/builder/site/js/createinterfacetools.js 2005-06-14 = 19:11:02 UTC (rev 1323) @@ -0,0 +1,190 @@ +// +// The Humano2 Business solution. +// Copyright (C) 2004,5 Humano2 Chile S.A. (http://www.humano2.com) +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. =20 +// $Id$ +// + + +//FIXME this function and the next one could be factorized again I think= ... +/** + * Take a tab containing infos of columns and split it in two (left and = right) + * to be displayed in the left and right sorted graphical list + * @param attribsArr the array with all the attribtes + * @param maxLimit (the number of attributes to put in the right tab + * @returns an array containing two arrays: left and right + */ +function BuildColumnsByDefault(attribsArr,maxLimit) +{ + var maxPreSelectedNum =3D attribsArr.length; + =20 + if(maxPreSelectedNum < maxLimit) + { + maxPreSelectedNum =3D 0; + } + else + { + maxPreSelectedNum =3D maxLimit;=20 + } + var leftAttribsArr =3D new Array();=20 + var rightAttribsArr =3D new Array(); + var i=3D0; + for(i=3D0;i<maxPreSelectedNum;i++) + { + rightAttribsArr[i] =3D new ListElement(attribsArr[i].GetName(),a= ttribsArr[i].GetValue(),false); + } + =20 + var i=3D0; + for(i=3D0;i<sizeAttribsArr;i++) + { + leftAttribsArr[i] =3D new ListElement(attribsArr[i].GetName(),at= tribsArr[i].GetValue(),false); + if(i<maxPreSelectedNum) + { + leftAttribsArr[i].SetDisabled(true); + } + } + =20 + var res =3D new Array(); + res["left"] =3D leftAttribsArr; + res["right"] =3D rightAttribsArr; + =20 + return res; +} + +/** + * Given the arr with all attribs and the array of selected attribs buil= d the left and right sorted lists + * @param attribsArr the array with all attributes + * @param selectedColumnsArr the array with the selected attributes + * @returns left and right a arrays ready to be inserted into left and r= ight SortedGraphicalList + */ +function BuildPreselectedColumns(attribsArr,selectedColumnsArr) +{ + var j=3D0; + var i=3D0; + var leftAttribsArr =3D new Array();=20 + var rightAttribsArr =3D new Array(); + //alert("size: " + sizeAttribsArr); + for(i=3D0;i<sizeAttribsArr;i++) + { + var idAtt =3D attribsArr[i].GetValue(); + =20 + if(IsInArray(idAtt,selectedColumnsArr) =3D=3D true) + { + //The left array + var element =3D new ListElement( attribsArr[i].GetName(), + attribsArr[i].GetValue(), + true); + leftAttribsArr[i] =3D element; =20 + //The right array: the element + //alert(attribsArr[i].GetName()); + var element =3D new ListElement( attribsArr[i].GetName(), + attribsArr[i].GetValue(), + false); + rightAttribsArr[j++] =3D element; =20 + } + else + { + //The left array + //alert(attribsArr[i].GetName()); + var element =3D new ListElement( attribsArr[i].GetName(), + attribsArr[i].GetValue(), + false); + leftAttribsArr[i] =3D element; =20 + //The right array: nothing=20 + } + } + =20 + var res =3D new Array(); + res["left"] =3D leftAttribsArr; + res["right"] =3D rightAttribsArr; + =20 + return res; +} + +function OperatorsGetSelectArray() +{ + var optionArray =3D new Array(); + =20 + optionArray[0] =3D new Array(); + optionArray[0]["value"] =3D "-1"; + optionArray[0]["text"] =3D "--Nothing--"; + optionArray[1] =3D new Array(); + optionArray[1]["value"] =3D "0"; + optionArray[1]["text"] =3D "GreaterOrEqualThan"; + optionArray[2] =3D new Array(); + optionArray[2]["value"] =3D "1"; + optionArray[2]["text"] =3D "LessEqualThan"; + optionArray[3] =3D new Array(); + optionArray[3]["value"] =3D "2"; + optionArray[3]["text"] =3D "GreaterThan"; + optionArray[4] =3D new Array(); + optionArray[4]["value"] =3D "3"; + optionArray[4]["text"] =3D "LessThan"; + optionArray[5] =3D new Array(); + optionArray[5]["value"] =3D "4"; + optionArray[5]["text"] =3D "EqualTo"; + optionArray[6] =3D new Array(); + optionArray[6]["value"] =3D "5"; + optionArray[6]["text"] =3D "DistinctTo"; + optionArray[7] =3D new Array(); + optionArray[7]["value"] =3D "6"; + optionArray[7]["text"] =3D "BeginWith"; + optionArray[8] =3D new Array(); + optionArray[8]["value"] =3D "7"; + optionArray[8]["text"] =3D "ContainsTo"; + optionArray[9] =3D new Array(); + optionArray[9]["value"] =3D "8"; + optionArray[9]["text"] =3D "In"; + =20 + return optionArray; +} + + +function OrderGetSelectArray() +{ + var optionArray =3D new Array(); + =20 + optionArray[0] =3D new Array(); + optionArray[0]["value"] =3D "-1"; + optionArray[0]["text"] =3D "--Nothing--"; + optionArray[1] =3D new Array(); + optionArray[1]["value"] =3D "0"; + optionArray[1]["text"] =3D "Asc"; + optionArray[2] =3D new Array(); + optionArray[2]["value"] =3D "1"; + optionArray[2]["text"] =3D "Desc"; + =20 + return optionArray; +} + +function FunctionsGetSelectArray() +{ + var optionArray =3D new Array(); + + optionArray[0] =3D new Array(); + optionArray[0]["value"] =3D "-1"; + optionArray[0]["text"] =3D "--Nothing--"; + optionArray[1] =3D new Array(); + optionArray[1]["value"] =3D "1"; + optionArray[1]["text"] =3D "Count"; + optionArray[2] =3D new Array(); + optionArray[2]["value"] =3D "2"; + optionArray[2]["text"] =3D "Sum"; + =20 + return optionArray; +} + +function Reload() +{ + var indice =3D document.formulario.classList.selectedIndex; + if(indice>0) + { + valor =3D document.formulario.classList.options[indice].value; + self.location =3D "createreport.aspx?classList=3D"+valor; + } +} + Modified: humano2/trunk/web/builder/site/xsl/createreport.xsl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-14 18:26:= 33 UTC (rev 1322) +++ humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-14 19:11:= 02 UTC (rev 1323) @@ -67,90 +67,24 @@ i++; </xsl:for-each> var sizeAttribsArr =3D attribsArr.length; + var leftAttribsArr =3D new Array(); + var rightAttribsArr =3D new Array(); <xsl:if test=3D"/report/reportDatas/name=3D''"> <!-- Cre= ation --> - <![CDATA[ - //Now builds left and right array for columns - var maxPreSelectedNum =3D sizeAttribsArr; - =20 - if(maxPreSelectedNum < 3) - { - maxPreSelectedNum =3D 0; - } - else - { - maxPreSelectedNum =3D 3;=20 - } - var leftAttribsArr =3D new Array();=20 - var rightAttribsArr =3D new Array(); - var i=3D0; - for(i=3D0;i<maxPreSelectedNum;i++) - { - rightAttribsArr[i] =3D new ListElement(attri= bsArr[i].GetName(),attribsArr[i].GetValue(),false); - } - =20 - var i=3D0; - for(i=3D0;i<sizeAttribsArr;i++) - { - leftAttribsArr[i] =3D new ListElement(attrib= sArr[i].GetName(),attribsArr[i].GetValue(),false); - if(i<maxPreSelectedNum) - { - leftAttribsArr[i].SetDisabled(true); - } - } - ]]> + var splitColTab =3D BuildColumnsByDefault(attribsArr= ,4); </xsl:if> <xsl:if test=3D"report/reportDatas/name!=3D''"> <!-- Upd= ate --> - =20 - //Columns var reportColumnsArray =3D new Array(); var i=3D0; <xsl:for-each select=3D"/report/reportDatas/reportPa= rams/columns/column"> reportColumnsArray[i++] =3D "<xsl:value-of selec= t=3D"." />"; </xsl:for-each> //alert(reportColumnsArray.length); - =20 - <![CDATA[ - var leftAttribsArr =3D new Array(); - var rightAttribsArr =3D new Array(); - var j=3D0; - var i=3D0; - //alert("size: " + sizeAttribsArr); - for(i=3D0;i<sizeAttribsArr;i++) - { - var idAtt =3D attribsArr[i].GetValue(); - =20 - if(IsInArray(idAtt,reportColumnsArray) =3D=3D= true) - { - //The left array - var element =3D new ListElement( attrib= sArr[i].GetName(), - attribsA= rr[i].GetValue(), - true); - leftAttribsArr[i] =3D element; =20 - //The right array: the element - //alert(attribsArr[i].GetName()); - var element =3D new ListElement( attrib= sArr[i].GetName(), - attribsA= rr[i].GetValue(), - false); - this.rightAttribsArr[j++] =3D element; = =20 - } - else - { - //The left array - //alert(attribsArr[i].GetName()); - var element =3D new ListElement( attrib= sArr[i].GetName(), - attribsA= rr[i].GetValue(), - false); - leftAttribsArr[i] =3D element; =20 - //The right array: nothing=20 - } - =20 - } - ]]> + var splitColTab =3D BuildPreselectedColumns(attribsA= rr,reportColumnsArray); </xsl:if> + leftAttribsArr =3D splitColTab["left"]; + rightAttribsArr =3D splitColTab["right"]; =20 - =20 //Filters =20 - =20 //This array is used by filter and sort as both require = the list of attributes for the class var attList =3D new Array(); attList[0] =3D new Array(); @@ -167,7 +101,6 @@ i++; </xsl:for-each> =20 - =20 var selectOption0ArrayFilter =3D new Array(); var selectOption1ArrayFilter =3D new Array(); var inputTagValuesArrayFilter =3D new Array(); Modified: humano2/trunk/web/builder/site/xsl/createview.xsl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-14 18:26:33= UTC (rev 1322) +++ humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-14 19:11:02= UTC (rev 1323) @@ -141,37 +141,10 @@ i++; </xsl:for-each> var sizeAttribsArr =3D attribsArr.length; + var leftAttribsArr =3D new Array(); + var rightAttribsArr =3D new Array(); <xsl:if test=3D"/view/viewDatas/name=3D''"> <!-- Creatio= n --> - <![CDATA[ - //Now builds left and right array for columns - var maxPreSelectedNum =3D sizeAttribsArr; - =20 - if(maxPreSelectedNum < 3) - { - maxPreSelectedNum =3D 0; - } - else - { - maxPreSelectedNum =3D 3;=20 - } - var leftAttribsArr =3D new Array();=20 - var rightAttribsArr =3D new Array(); - var i=3D0; - for(i=3D0;i<maxPreSelectedNum;i++) - { - rightAttribsArr[i] =3D new ListElement(attri= bsArr[i].GetName(),attribsArr[i].GetValue(),false); - } - =20 - var i=3D0; - for(i=3D0;i<sizeAttribsArr;i++) - { - leftAttribsArr[i] =3D new ListElement(attrib= sArr[i].GetName(),attribsArr[i].GetValue(),false); - if(i<maxPreSelectedNum) - { - leftAttribsArr[i].SetDisabled(true); - } - } - ]]> + var splitColTab =3D BuildColumnsByDefault(attribsArr= ,4); </xsl:if> <xsl:if test=3D"view/viewDatas/name!=3D''"> <!-- Update = --> //Columns @@ -180,50 +153,15 @@ <xsl:for-each select=3D"/view/viewDatas/viewParams/c= olumns/column"> reportColumnsArray[i++] =3D "<xsl:value-of selec= t=3D"." />"; </xsl:for-each> - //alert(reportColumnsArray.length); - =20 - <![CDATA[ - var leftAttribsArr =3D new Array(); - var rightAttribsArr =3D new Array(); - var j=3D0; - var i=3D0; - //alert("size: " + sizeAttribsArr); - for(i=3D0;i<sizeAttribsArr;i++) - { - var idAtt =3D attribsArr[i].GetValue(); - =20 - if(IsInArray(idAtt,reportColumnsArray) =3D=3D= true) - { - //The left array - var element =3D new ListElement( attrib= sArr[i].GetName(), - attribsA= rr[i].GetValue(), - true); - leftAttribsArr[i] =3D element; =20 - //The right array: the element - //alert(attribsArr[i].GetName()); - var element =3D new ListElement( attrib= sArr[i].GetName(), - attribsA= rr[i].GetValue(), - false); - this.rightAttribsArr[j++] =3D element; = =20 - } - else - { - //The left array - //alert(attribsArr[i].GetName()); - var element =3D new ListElement( attrib= sArr[i].GetName(), - attribsA= rr[i].GetValue(), - false); - leftAttribsArr[i] =3D element; =20 - //The right array: nothing=20 - } - =20 - } - ]]> + //alert(reportColumnsArray.length); =20 + var splitColTab =3D BuildPreselectedColumns(attribsA= rr,reportColumnsArray); </xsl:if> + leftAttribsArr =3D splitColTab["left"]; + rightAttribsArr =3D splitColTab["right"]; =20 function recargar() { - indice =3D document.formulario.classList.selectedInd= ex; + var indice =3D document.formulario.classList.selecte= dIndex; if(indice>0) { valor =3D document.formulario.classList.options[= indice].value; |
|
From: <sv...@de...> - 2005-06-14 18:26:33
|
Author: pcamacho Date: 2005-06-14 14:26:33 -0400 (Tue, 14 Jun 2005) New Revision: 1322 Added: humano2/trunk/web/builder/site/createinterfacetools.js Removed: humano2/trunk/web/builder/site/js/createreport.js Modified: humano2/trunk/web/builder/site/js/form.js humano2/trunk/web/builder/site/xsl/createreport.xsl humano2/trunk/web/builder/site/xsl/createview.xsl Log: CHANGE: name of file for factorization. Copied: humano2/trunk/web/builder/site/createinterfacetools.js (from rev = 1321, humano2/trunk/web/builder/site/js/createreport.js) Deleted: humano2/trunk/web/builder/site/js/createreport.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/js/createreport.js 2005-06-14 18:21:41= UTC (rev 1321) +++ humano2/trunk/web/builder/site/js/createreport.js 2005-06-14 18:26:33= UTC (rev 1322) @@ -1,95 +0,0 @@ -// -// The Humano2 Business solution. -// Copyright (C) 2004,5 Humano2 Chile S.A. (http://www.humano2.com) -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. =20 -// $Id$ -// - - -function OperatorsGetSelectArray() -{ - var optionArray =3D new Array(); - =20 - optionArray[0] =3D new Array(); - optionArray[0]["value"] =3D "-1"; - optionArray[0]["text"] =3D "--Nothing--"; - optionArray[1] =3D new Array(); - optionArray[1]["value"] =3D "0"; - optionArray[1]["text"] =3D "GreaterOrEqualThan"; - optionArray[2] =3D new Array(); - optionArray[2]["value"] =3D "1"; - optionArray[2]["text"] =3D "LessEqualThan"; - optionArray[3] =3D new Array(); - optionArray[3]["value"] =3D "2"; - optionArray[3]["text"] =3D "GreaterThan"; - optionArray[4] =3D new Array(); - optionArray[4]["value"] =3D "3"; - optionArray[4]["text"] =3D "LessThan"; - optionArray[5] =3D new Array(); - optionArray[5]["value"] =3D "4"; - optionArray[5]["text"] =3D "EqualTo"; - optionArray[6] =3D new Array(); - optionArray[6]["value"] =3D "5"; - optionArray[6]["text"] =3D "DistinctTo"; - optionArray[7] =3D new Array(); - optionArray[7]["value"] =3D "6"; - optionArray[7]["text"] =3D "BeginWith"; - optionArray[8] =3D new Array(); - optionArray[8]["value"] =3D "7"; - optionArray[8]["text"] =3D "ContainsTo"; - optionArray[9] =3D new Array(); - optionArray[9]["value"] =3D "8"; - optionArray[9]["text"] =3D "In"; - =20 - return optionArray; -} - - -function OrderGetSelectArray() -{ - var optionArray =3D new Array(); - =20 - optionArray[0] =3D new Array(); - optionArray[0]["value"] =3D "-1"; - optionArray[0]["text"] =3D "--Nothing--"; - optionArray[1] =3D new Array(); - optionArray[1]["value"] =3D "0"; - optionArray[1]["text"] =3D "Asc"; - optionArray[2] =3D new Array(); - optionArray[2]["value"] =3D "1"; - optionArray[2]["text"] =3D "Desc"; - =20 - return optionArray; -} - -function FunctionsGetSelectArray() -{ - var optionArray =3D new Array(); - - optionArray[0] =3D new Array(); - optionArray[0]["value"] =3D "-1"; - optionArray[0]["text"] =3D "--Nothing--"; - optionArray[1] =3D new Array(); - optionArray[1]["value"] =3D "1"; - optionArray[1]["text"] =3D "Count"; - optionArray[2] =3D new Array(); - optionArray[2]["value"] =3D "2"; - optionArray[2]["text"] =3D "Sum"; - =20 - return optionArray; -} - -function Reload() -{ - indice =3D document.formulario.classList.selectedIndex; - if(indice>0) - { - valor =3D document.formulario.classList.options[indice].value; - self.location =3D "createreport.aspx?classList=3D"+valor; - } -} - Modified: humano2/trunk/web/builder/site/js/form.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/js/form.js 2005-06-14 18:21:41 UTC (re= v 1321) +++ humano2/trunk/web/builder/site/js/form.js 2005-06-14 18:26:33 UTC (re= v 1322) @@ -8,7 +8,7 @@ // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. =20 // -// $Id$ +// $Id$=20 */ =20 ////////////////////////////////////////////// Form Class //////////////= /////////////////////////////////////////////// Modified: humano2/trunk/web/builder/site/xsl/createreport.xsl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-14 18:21:= 41 UTC (rev 1321) +++ humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-14 18:26:= 33 UTC (rev 1322) @@ -22,7 +22,7 @@ <script language=3D"Javascript" src=3D"js/grafcomponents/exp= andform.js"></script> <!-- Load this script before the next one --> <script language=3D"Javascript" src=3D"js/form.js" type=3D"t= ext/javascript"></script>=20 - <script language=3D"Javascript" src=3D"js/createreport.js" t= ype=3D"text/javascript"></script>=20 + <script language=3D"Javascript" src=3D"js/createinterfacetoo= ls.js" type=3D"text/javascript"></script>=20 <link href=3D"css/createinterface.css" rel=3D"stylesheet" ty= pe=3D"text/css"></link> =20 <!-- Here we create an array and use it as parameter for For= m class constructor --> Modified: humano2/trunk/web/builder/site/xsl/createview.xsl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-14 18:21:41= UTC (rev 1321) +++ humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-14 18:26:33= UTC (rev 1322) @@ -20,14 +20,12 @@ <script language=3D"Javascript" src=3D"js/grafcomponents/rad= iobuttonexpand.js"></script> <script language=3D"Javascript" src=3D"js/grafcomponents/inp= utline.js"></script> <script language=3D"Javascript" src=3D"js/grafcomponents/exp= andform.js"></script> - <script language=3D"Javascript" src=3D"js/createreport.js" t= ype=3D"text/javascript"></script> <!-- Fixme factorize it --> - <!-- Load this script before the next one --> + <script language=3D"Javascript" src=3D"js/createinterfacetoo= ls.js" type=3D"text/javascript"></script> <script language=3D"Javascript" src=3D"js/form.js" type=3D"t= ext/javascript"></script> <link href=3D"css/createinterface.css" rel=3D"stylesheet" ty= pe=3D"text/css"/> =20 <!-- Here we create an array and use it as parameter for For= m class constructor --> <script language=3D"Javascript"> - =20 //The form var formArray =3D new Array(); var i; //Counter |
|
From: <sv...@de...> - 2005-06-14 18:21:49
|
Author: pcamacho
Date: 2005-06-14 14:21:41 -0400 (Tue, 14 Jun 2005)
New Revision: 1321
Modified:
humano2/trunk/web/builder/site/js/createreport.js
humano2/trunk/web/builder/site/js/grafcomponents/expandform.js
humano2/trunk/web/builder/site/xsl/createreport.xsl
humano2/trunk/web/builder/site/xsl/createview.xsl
Log:
CHANGE: remove of unuseful function in createreport.js
Modified: humano2/trunk/web/builder/site/js/createreport.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/createreport.js 2005-06-14 18:06:59=
UTC (rev 1320)
+++ humano2/trunk/web/builder/site/js/createreport.js 2005-06-14 18:21:41=
UTC (rev 1321)
@@ -9,26 +9,7 @@
// $Id$
//
=20
-//FIXME: now the use of classId, is not necessary as the class is select=
ed first
-function AttribsGetSelectArray(formArray,classId)
-{
- var lengthArray =3D formArray[classId].length;
- alert("lengthArray: " + lengthArray);
=20
- var optionArray =3D new Array();
- optionArray[0] =3D new Array();
- optionArray[0]["value"] =3D "-1";
- optionArray[0]["text"] =3D "--Nothing--"
- for (var i =3D 0; i < lengthArray ;i++)=20
- {
- optionArray[i+1] =3D new Array(); //Begin to second element
- optionArray[i+1]["value"] =3D formArray[classId][i]["value"];
- optionArray[i+1]["text"] =3D formArray[classId][i]["name"];
- }
- =20
- return optionArray;
-} =20
-
function OperatorsGetSelectArray()
{
var optionArray =3D new Array();
Modified: humano2/trunk/web/builder/site/js/grafcomponents/expandform.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/grafcomponents/expandform.js 2005-0=
6-14 18:06:59 UTC (rev 1320)
+++ humano2/trunk/web/builder/site/js/grafcomponents/expandform.js 2005-0=
6-14 18:21:41 UTC (rev 1321)
@@ -6,8 +6,8 @@
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version. =20
-//
-//
+//=20
+// $Id$
=20
=20
/**
Property changes on: humano2/trunk/web/builder/site/js/grafcomponents/exp=
andform.js
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: humano2/trunk/web/builder/site/xsl/createreport.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-14 18:06:=
59 UTC (rev 1320)
+++ humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-14 18:21:=
41 UTC (rev 1321)
@@ -149,7 +149,25 @@
</xsl:if>
=20
=20
- //Filters =20
+ //Filters =20
+ =20
+ //This array is used by filter and sort as both require =
the list of attributes for the class
+ var attList =3D new Array();
+ attList[0] =3D new Array();
+ attList[0]["value"] =3D "-1";
+ attList[0]["text"] =3D "--Nothing--"
+ var i=3D1; //The first line is by default
+ <xsl:for-each select=3D"/report/classes/class[count(attr=
ibutes)>0]/attributes/attribute"> //Get all attributes
+ <xsl:variable name=3D"classId">
+ <xsl:value-of select=3D"id" />
+ </xsl:variable>
+ attList[i] =3D new Array();
+ attList[i]["value"] =3D '<xsl:value-of select=3D"id"=
/>';
+ attList[i]["text"] =3D '<xsl:value-of select=3D"name=
"/>';
+ i++;
+ </xsl:for-each>
+ =20
+ =20
var selectOption0ArrayFilter =3D new Array();
var selectOption1ArrayFilter =3D new Array();
var inputTagValuesArrayFilter =3D new Array();
@@ -166,7 +184,7 @@
var InputLineParamsFilters =3D
{
type: 'TWOSELECTANDINPUT',
- select0: AttribsGetSelectArray(formArray,<xsl:va=
lue-of select=3D"/report/reportDatas/classId" />),
+ select0: attList,
select1: OperatorsGetSelectArray(),
lineTitle: 'Filter',
input0: '',
@@ -193,7 +211,7 @@
var InputLineParamsOrders =3D
{
type: 'TWOSELECT',
- select0: AttribsGetSelectArray(formArray,<xsl:va=
lue-of select=3D"/report/reportDatas/classId" />),
+ select0: attList,
select1: OrderGetSelectArray(),
lineTitle: 'Order',
input0: '',
@@ -205,7 +223,6 @@
var InputLineOrders =3D new InputLine(InputLineParam=
sOrders);
</xsl:if>
=20
- =20
//Personalized columns
var selectOption0ArrayPersoColumns =3D new Array();
var selectOption1ArrayPersoColumns =3D new Array();
@@ -220,7 +237,7 @@
var InputLineParamsPersoColumns =3D
{
type: 'TWOSELECT', //For the moment
- select0: AttribsGetSelectArray(formArray,<xsl:va=
lue-of select=3D"/report/reportDatas/classId" />),
+ select0: attList,
select1: FunctionsGetSelectArray(),
lineTitle: 'PersoCol',
input0: '',
@@ -253,7 +270,7 @@
var InputLineParamsHavings =3D
{
type: 'THREESELECTANDINPUT',
- select0: AttribsGetSelectArray(formArray,<xsl:va=
lue-of select=3D"/report/reportDatas/classId" />),
+ select0: attList,
select1: FunctionsGetSelectArray(),
select2: OperatorsGetSelectArray(),
lineTitle: 'GroupFilter',
Modified: humano2/trunk/web/builder/site/xsl/createview.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-14 18:06:59=
UTC (rev 1320)
+++ humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-14 18:21:41=
UTC (rev 1321)
@@ -28,19 +28,6 @@
<!-- Here we create an array and use it as parameter for For=
m class constructor -->
<script language=3D"Javascript">
=20
- //////////////////////
- //The view params
- /*
- //Columns
- var viewColumnsArray =3D new Array();
- var i=3D0;
- <xsl:for-each select=3D"/view/viewDatas/viewParams/colum=
ns/column">
- viewColumnsArray[i++] =3D "<xsl:value-of select=3D"." />=
";
- </xsl:for-each>
- //alert(viewColumnsArray.length);
- var ViewParams =3D new ViewParams(viewColumnsArray,null,=
null);
- */
- ////////////////////////
//The form
var formArray =3D new Array();
var i; //Counter
|
|
From: <sv...@de...> - 2005-06-14 18:06:57
|
Author: pcamacho Date: 2005-06-14 14:06:59 -0400 (Tue, 14 Jun 2005) New Revision: 1320 Added: humano2/trunk/web/builder/site/js/grafcomponents/expandform.js Removed: humano2/trunk/web/builder/site/js/grafcomponents/expandformreport.js Log: CHANGE: name of file. Now not everything's perfect but much more things w= ork. Copied: humano2/trunk/web/builder/site/js/grafcomponents/expandform.js (f= rom rev 1314, humano2/trunk/web/builder/site/js/grafcomponents/expandform= report.js) Deleted: humano2/trunk/web/builder/site/js/grafcomponents/expandformrepor= t.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/web/builder/site/js/grafcomponents/expandformreport.js = 2005-06-14 18:02:49 UTC (rev 1319) +++ humano2/trunk/web/builder/site/js/grafcomponents/expandformreport.js = 2005-06-14 18:06:59 UTC (rev 1320) @@ -1,269 +0,0 @@ -// -// The Humano2 Business solution. -// Copyright (C) 2004,5 Humano2 Chile S.A. (http://www.humano2.com) -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. =20 -// -// - - -/** - * Constructor - * @param line object that contains the fields to display for each line = and that also contains preselected values - */ -function ExpandForm(selfRefName,receptorNode,title,inputLine) -{ - //Fields - this.selfRefName =3D selfRefName; - this.receptorNode =3D receptorNode; - this.inputLine =3D inputLine; - =20 - //this.optionArray1 =3D new Array(); - //this.optionArray2 =3D new Array(); - this.title =3D title; - - =20 - //Methods - this.PutAllComponents =3D ExpandFormPutAllComponents; - this.AddLine =3D ExpandFormAddLine; - this.RemoveLine =3D ExpandFormRemoveLine; - this.ReturnValues =3D ExpandFormReturnValues; - this.GetReceptorNode =3D ExpandFormGetReceptorNode; - this.GetSelfRefName =3D ExpandFormGetSelfRefName; - this.GetTitle =3D ExpandFormGetTitle; - =20 - this.PutAllComponents(receptorNode); - =20 - return this; =20 -} - - -/** - * This function adds a line to the expand form but - * with preselect values - */ -function ExpandFormAddLine(index) -{ - var divReceptor =3D GetNodeByTagNameAndAttName("div",this.selfRefNam= e)[0]; //Unique id in the document as every - = // graphical components should have unique identificator - //alert("divReceptor: " + divReceptor); - var lineNumber =3D divReceptor.childNodes.length; - =20 - var innerHtml =3D ""; - =20 - if(index !=3D null) - { - innerHtml =3D this.inputLine.GetPreselectedLineHtml(index,lineNum= ber); =20 - } - else - { - innerHtml =3D this.inputLine.GetEmptyLineHtml(lineNumber); - } - =20 - var divLine =3D document.createElement("div"); - =20 - divLine.innerHTML =3D innerHtml; - =20 - //alert("divLine.childNodes.length: " + divLine.childNodes.length) - //alert("innerHtml: " + innerHtml); - //Add the line - divReceptor.appendChild(divLine); -} - - -/** - * Should be conform to viewtools norm - */ -function ExpandFormReturnValues() -{ =20 - var res =3D ""; - - var divWithLines =3D GetNodeByTagNameAndAttName("div",this.selfRefNa= me)[0]; //Unique id in the document as every - = // graphical components should have unique identificator - var node =3D divWithLines.firstChild; - //alert("divWithLines.firstChild.childNodes.length: " + divWithLines= .firstChild.childNodes.length); - //alert("divWithLines.firstChild.innerHTML: " + divWithLines.firstCh= ild.innerHTML) - while(node !=3D null) - { - =20 - //Here we must get the input value moreover - //CAUTION: we start from the second child because the first is a= text node (title) !!!! - var divFirstSelect =3D node.firstChild.nextSibling; - var divSecondSelect =3D divFirstSelect.nextSibling; - var divThirdSelect =3D divSecondSelect.nextSibling; - =20 - ///FIXME: this code should be inside inputline - =20 - if((divFirstSelect.value !=3D -1) && (divSecondSelect.value!=3D = -1)) //Verify if something has been selected - { - if(this.inputLine.type =3D=3D 'TWOSELECTANDINPUT') - { - //alert("divFirstSelect:" + divFirstSelect); - res +=3D divFirstSelect.value + "|"; - //alert("divSecondSelect:" + divSecondSelect); - res +=3D divSecondSelect.value + "|"; - var divInput =3D divSecondSelect.nextSibling; - //alert("divInput:" + divInput); - res +=3D "\'" + divInput.value + "\'"; - } - =20 - =20 - if(this.inputLine.type =3D=3D 'THREESELECTANDINPUT') - { - //alert("divFirstSelect:" + divFirstSelect); - res +=3D divFirstSelect.value + "|"; - //alert("divSecondSelect:" + divSecondSelect); - res +=3D divSecondSelect.value + "|"; - res +=3D divThirdSelect.value + "|"; - var divInput =3D divThirdSelect.nextSibling; - //alert("divInput:" + divInput); - res +=3D "\'" + divInput.value + "\'"; - } - =20 - if(this.inputLine.type =3D=3D 'TWOSELECT') - { - //alert("divFirstSelect:" + divFirstSelect); - res +=3D divFirstSelect.value + "|"; =20 - //alert("divSecondSelect:" + divSecondSelect); - res +=3D divSecondSelect.value; =20 - } - res+=3D ";"; //Separator between two lines - } - node =3D node.nextSibling; - } - =20 - res =3D res.substring(0,res.length-1);//remove last ; - =20 - //alert("res:" + res); - return res; -} - - -function ExpandFormRemoveLine() -{ - var divReceptor =3D GetNodeByTagNameAndAttName("div",this.selfRefNam= e)[0]; //Unique id in the document as every - = // graphical components should have uni - if(divReceptor.childNodes.length =3D=3D 0) //Nothing ot remove - { - return; =20 - } - =20 - divReceptor.removeChild(divReceptor.lastChild); =20 - =20 - return divReceptor.childNodes.length; -} - -function ExpandFormGetTitle() -{ - return this.title; =20 -} - -function ExpandFormPutAllComponents() -{ - var innerHtml =3D=20 - "<table>" =20 - + "<tr>" - + "<td valign=3D\"top\">" - + "<div id=3D\"" + this.selfRefName +"\" name=3D\"= " + this.selfRefName + "\" >" //Id that will contain the form lines - + "</div>" - + "</td>" - + "<td valign=3D\"top\">" - + "<center>" - + "<input type=3D\"button\" value=3D\"Add criteria= \" onclick=3D\"" + this.selfRefName +".AddLine();\"></input>" - + "<br/>" - + "<input type=3D\"button\" value=3D\"Remove\" onc= lick=3D\"" + this.selfRefName +".RemoveLine();\">" - + "</center>"; - + "</td>" - + "</tr>" - + "</table>"; - =20 - //alert("innerHTML:" + innerHtml); - this.receptorNode.innerHTML =3D innerHtml; =20 - =20 - //Add lines with preselected values if inputValues exists - if(this.inputLine.HasPreselected() =3D=3D true) - { - var i; - var nbPreselected =3D this.inputLine.GetNumberOfPreselected(); - //alert("size inputs: " + this.inputValues.Size()); - for(i=3D0; i < nbPreselected;i++) - { - this.AddLine(i); - } - } - else - { - this.AddLine(); //Add empty line - } -} - -function ExpandFormGetReceptorNode() -{ - return this.receptorNode; =20 -} - -function ExpandFormGetSelfRefName() -{ - return this.selfRefName; -} - -function ExpandFormTest() -{ - /////////////////////////////////////////////// - TestGroupWrite("ExpandFormTest"); - =20 - =20 - var divReceptor =3D GetNodeByTagNameAndAttName("div","ExpandForm")[0= ];=20 - var divInsideReceptor =3D document.createElement("div"); - divReceptor.appendChild(divInsideReceptor); - =20 - var buttonShowValues =3D document.createElement("div"); - buttonShowValues.innerHTML =3D "<input type=3D\"button\" value=3D\"G= et values\" onclick=3D\"aExpandForm.ReturnValues();\"></input>"; - =20 - divReceptor.appendChild(buttonShowValues); - =20 - =20 - //Preselected values - var select0Arr =3D new Array(); - select0Arr[0] =3D new Array(); - select0Arr[0]["text"] =3D 'attribute0'; - select0Arr[0]["value"] =3D 'att0'; - =20 - select0Arr[1] =3D new Array(); - select0Arr[1]["text"] =3D 'attribute1'; - select0Arr[1]["value"] =3D 'att1'; - =20 - select0Arr[2] =3D new Array(); - select0Arr[2]["text"] =3D 'attribute2'; - select0Arr[2]["value"] =3D 'att2'; - =20 - var select1Arr =3D new Array(); - select1Arr[0] =3D new Array(); - select1Arr[0]["text"] =3D 'EqualTo'; - select1Arr[0]["value"] =3D '4'; - =20 - select1Arr[1] =3D new Array(); - select1Arr[1]["text"] =3D 'GreaterThan'; - select1Arr[1]["value"] =3D '5'; - =20 - var InputLineParams =3D - { - type: 'TWOSELECTANDINPUT', - select0: select0Arr, - select1: select1Arr, - input0: '', - PreselectedInput0: new Array('hola','hola2'), - PreselectedSelect0: new Array(0,2), - PreselectedSelect1: new Array(1,0), - refName: 'aExpandForm' - } - - anInputLine =3D new InputLine(InputLineParams); - =20 - aExpandForm =3D new ExpandForm("aExpandForm",divInsideReceptor,"Expa= ndFormReport",anInputLine); -} - - |
|
From: <sv...@de...> - 2005-06-14 18:02:55
|
Author: pcamacho
Date: 2005-06-14 14:02:49 -0400 (Tue, 14 Jun 2005)
New Revision: 1319
Added:
humano2/trunk/web/builder/site/js/form.js
Removed:
humano2/trunk/web/builder/site/js/formreport.js
humano2/trunk/web/builder/site/js/formview.js
humano2/trunk/web/builder/site/js/grafcomponents/expandform.js
Modified:
humano2/trunk/web/builder/site/js/createreport.js
humano2/trunk/web/builder/site/xsl/createreport.xsl
humano2/trunk/web/builder/site/xsl/createview.xsl
Log:
CHANGE: files name to begin factorisation. Beware!! Many things are perma=
nently broken!!
Modified: humano2/trunk/web/builder/site/js/createreport.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/createreport.js 2005-06-13 23:14:13=
UTC (rev 1318)
+++ humano2/trunk/web/builder/site/js/createreport.js 2005-06-14 18:02:49=
UTC (rev 1319)
@@ -9,11 +9,11 @@
// $Id$
//
=20
-
+//FIXME: now the use of classId, is not necessary as the class is select=
ed first
function AttribsGetSelectArray(formArray,classId)
{
var lengthArray =3D formArray[classId].length;
- //alert("lengthArray: " + lengthArray);
+ alert("lengthArray: " + lengthArray);
=20
var optionArray =3D new Array();
optionArray[0] =3D new Array();
Copied: humano2/trunk/web/builder/site/js/form.js (from rev 1316, humano2=
/trunk/web/builder/site/js/formreport.js)
Deleted: humano2/trunk/web/builder/site/js/formreport.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/formreport.js 2005-06-13 23:14:13 U=
TC (rev 1318)
+++ humano2/trunk/web/builder/site/js/formreport.js 2005-06-14 18:02:49 U=
TC (rev 1319)
@@ -1,113 +0,0 @@
-/*
-//
-// The Humano2 Business solution.
-// Copyright (C) 2004,5 Humano2 Chile S.A. (http://www.humano2.com)
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version. =20
-//
-// $Id$
-*/
-
-////////////////////////////////////////////// Form Class //////////////=
///////////////////////////////////////////////
-function Form(formArray, classId) //, ReportParams)
-{
- //Fields
- this.attributeLeftArray =3D new Array();
- this.attributeRightArray =3D new Array();
- this.formArray =3D formArray;
- this.classId =3D classId;
- =20
- //Methods
- this.UpdateSubmitAll =3D FormUpdateSubmitAll;
- this.DeleteReport =3D FormDeleteReport;
-}
-
-function FormUpdateSubmitAll(rightColumn,sort,filter,persoColumns,having=
s)
-{
- //Get the ReportName
- var reportNameInput =3D GetNodeByTagNameAndAttName("input","reportNa=
meInput")[0];
- var reportName =3D reportNameInput.value;
- =20
- if(reportName =3D=3D "")
- {
- alert("You must enter the name of report."); =20
- return false;
- }
- =20
- //alert("reportName:" + reportName);
- =20
- //Get the classId
- var classId =3D this.classId;
- //alert("classId:" + classId);
- =20
- //Build the columnstr string
- //alert(rightColumn);
- var i;
- var sortedList =3D rightColumn.fSortedList;
- //alert(sortedList.Length());
- var columnsStr =3D "";
- for(i=3D0;i<sortedList.Length();i++)
- {
- columnsStr +=3D sortedList.GetItem(i).GetValue() + ",";
- }
- //Remove the last coma
- columnsStr =3D columnsStr;=20
- columnsStr =3D columnsStr.substring(0,columnsStr.length-1); =
=20
- //alert("columnsStr:" + columnsStr);
- =20
- //Now the sort
- //alert("sort SelfRefName:" + sort.GetSelfRefName());
- =20
- var orderStr =3D sort.ReturnValues();=20
- //alert("orderStr: " + orderStr);
- =20
- //The filter
- //alert("filter SelfRefName:" + filter.GetSelfRefName());
- var whereStr =3D filter.ReturnValues();
- //alert("whereStr: " + whereStr);
- =20
- var persoColumnsStr =3D persoColumns.ReturnValues();
- //alert("persoColumnsStr: " + persoColumnsStr);
- =20
- //var havingsStr =3D havings.ReturnValues(); Commented due to bug#12=
3
- var havingsStr =3D "";
- =20
- //Update the submit all TD
- var divSubmitAll =3D GetNodeByTagNameAndAttName("div","SubmitAll")[0=
];
- //alert(divSubmitAll);
- divSubmitAll.innerHTML +=3D=20
- =20
- "<input type=3D\"hidden\" name=3D\"sendCreateUpdate\" value=3D\"=
true\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendClassId\" value=3D\""+ c=
lassId +"\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendReportName\" value=3D\""=
+ reportName + "\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendColumnsStr\" value=3D\""=
+ columnsStr + "\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendOrderStr\" value=3D\"" +=
orderStr + "\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendWhereStr\" value=3D\"" +=
whereStr + "\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendPersoColumnsStr\" value=3D=
\"" + persoColumnsStr + "\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendHavingsStr\" value=3D\""=
+ havingsStr + "\"></input>";
- =20
- //alert(divSubmitAll.innerHTML);
- return true;
-}
-
-function FormDeleteReport(reportId)
-{
- if (confirm("Are you sure you want to delete the report?"))
- {
- var divSubmitAll =3D GetNodeByTagNameAndAttName("div","SubmitAll=
")[0];
- //alert(divSubmitAll);
- divSubmitAll.innerHTML +=3D "<input type=3D\"hidden\" name=3D=
\"delete\" value=3D\"true\"></input>";
- divSubmitAll.innerHTML +=3D "<input type=3D\"hidden\" name=3D=
\"reportId\" value=3D\"" + reportId + "\"></input>";
- return true; =20
- }
- else
- {
- return false; =20
- }
-}
-
-
-////////////////////////////////////////////// END: Form Class /////////=
////////////////////////////////////////////////
Deleted: humano2/trunk/web/builder/site/js/formview.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/formview.js 2005-06-13 23:14:13 UTC=
(rev 1318)
+++ humano2/trunk/web/builder/site/js/formview.js 2005-06-14 18:02:49 UTC=
(rev 1319)
@@ -1,442 +0,0 @@
-/*
-//
-// The Humano2 Business solution.
-// Copyright (C) 2004,5 Humano2 Chile S.A. (http://www.humano2.com)
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version. =20
-//
-//
-*/
-
-
-/**
- * When you choose a class you have to update the buttons Crud
- */
-function UpdateHeader()
-{
- //Update crudbuttons =20
- var crudTag1 =3D GetNodeByTagNameAndAttName("div","CrudButtons1")[0]=
;
- =20
- crudTag1.innerHTML=3D
- "<input type=3D\"submit\" value=3D\"Create\" onclick=3D=
\"Form.UpdateSubmitAll(rightColumn,expandFormSort,expandFormFilter);\">"
- + "</input>";
- =20
- var crudTag2 =3D GetNodeByTagNameAndAttName("div","CrudButtons2")[0]=
;
- //alert("crudTag2: " + crudTag2);
- crudTag2.innerHTML =3D ""; //No delete button
- =20
- =20
- //update input viewname =20
- var viewNameDiv =3D GetNodeByTagNameAndAttName("div","ViewName")[0];
- viewNameDiv.innerHTML =3D=20
- "<input type=3D\"text\" id=3D \"viewNameInput\" name=3D\"vie=
wNameInput\">"
- +"</input>";
-}
-
-
-//////////////////////////////////////////////ViewParams Class /////////=
//////////////////////////////////////////////
-function ViewParams(columns,where,order)
-{
- =20
- //Fields
- this.columns =3D columns;
- this.where =3D where;
- this.order =3D order;
-
- //alert("columns.length: " + columns.length);
- =20
- //Methods
- this.GetColumns =3D ViewParamsGetColumns;
- this.GetWhere =3D ViewParamsGetWhere;
- this.GetOrder =3D ViewParamsGetOrder;
- this.Empty =3D ViewParamsEmpty;
-=20
-}
-
-function ViewParamsEmpty()
-{
- var res =3D ((this.GetColumns().length =3D=3D 0) && (this.where =3D=3D=
null) && (this.order =3D=3D null));
- //alert("ViewParamsEmpty: " + res);
- return res;
-}
-
-function ViewParamsGetColumns()
-{
- //Jump the first unuseful element (0,10035,10025) for example
- var res =3D new Array()
- for(i=3D1;i<this.columns.length;i++)
- {
- res[i-1] =3D this.columns[i]; =20
- }
- //alert("ViewParamsGetColumns: length=3D " + res.length);
- return res;
-}
-
-function ViewParamsGetWhere()
-{
- return this.where; =20
-}
-
-function ViewParamsGetOrder()
-{
- return this.order; =20
-}
-
-
-////////////////////////////////////////////// Form Class //////////////=
///////////////////////////////////////////////
-function Form(formArray, classId, ViewParams)
-{
- //Fields
- this.attributeLeftArray =3D new Array();
- this.attributeRightArray =3D new Array();
- this.formArray =3D formArray;
- this.classId =3D classId;
- this.ViewParams =3D ViewParams;
- =20
- =20
- //Methods
- this.UpdateAttributes =3D FormUpdateAttributes;
- this.GetRightAtt =3D FormGetRightAtt;
- this.GetLeftAtt =3D FormGetLeftAtt;
- this.UpdateList =3D FormUpdateList;
- this.UpdateLists =3D FormUpdateLists;
- this.SetToDefault =3D FormSetToDefault;
- this.UpdateSubmitAll =3D FormUpdateSubmitAll;
- this.DeleteView =3D FormDeleteView;
- this.GetSortArray =3D FormGetSortArray;
- this.GetFilterArray =3D FormGetFilterArray;
- this.UpdateSort =3D FormUpdateSort;
- this.UpdateFilter =3D FormUpdateFilter;
- this.GetNameOfAttribute =3D FormGetNameOfAttribute;
- =20
- //Update the attributes
- this.UpdateAttributes(this.classId);
-}
-
-function FormUpdateSubmitAll(rightColumn,sort,filter)
-{
- //Get the viewName
- var viewNameInput =3D GetNodeByTagNameAndAttName("input","viewNameIn=
put")[0];
- var viewName =3D viewNameInput.value;
- =20
- if(viewName =3D=3D "")
- {
- alert("You must enter the name of view."); =20
- return false;
- }
- =20
- //alert("viewName:" + viewName);
- =20
- //Get the classId
- var classId =3D this.classId;
- //alert("classId:" + classId);
- =20
- //Build the columnstr string
- //alert(rightColumn);
- var i;
- var sortedList =3D rightColumn.fSortedList;
- //alert(sortedList.Length());
- var columnsStr =3D "";
- for(i=3D0;i<sortedList.Length();i++)
- {
- columnsStr +=3D sortedList.GetItem(i).GetValue() + ",";
- }
- //Remove the last coma
- columnsStr =3D "0," + columnsStr; //Don't forget 0!
- columnsStr =3D columnsStr.substring(0,columnsStr.length-1); =
=20
- //alert("columnsStr:" + columnsStr);
- =20
- //Now the sort
- //alert("sort SelfRefName:" + sort.GetSelfRefName());
- =20
- //TODO: order is unavailable yet due to a problem in ViewTools
- var orderStr =3D sort.ReturnValues();=20
- //var orderStr=3D"";
- =20
- //The filter
- //alert("filter SelfRefName:" + filter.GetSelfRefName());
- var whereStr =3D filter.ReturnValues();
- =20
- //Update the submit all TD
- var divSubmitAll =3D GetNodeByTagNameAndAttName("div","SubmitAll")[0=
];
- //alert(divSubmitAll);
- divSubmitAll.innerHTML +=3D=20
- =20
- "<input type=3D\"hidden\" name=3D\"sendCreateUpdate\" value=3D\"=
true\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendClassId\" value=3D\""+ c=
lassId +"\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendViewName\" value=3D\"" +=
viewName + "\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendColumnsStr\" value=3D\""=
+ columnsStr + "\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendOrderStr\" value=3D\"" +=
orderStr + "\"></input>"
- +"<input type=3D\"hidden\" name=3D\"sendWhereStr\" value=3D\"" +=
whereStr + "\"></input>";
- =20
- //alert(divSubmitAll.innerHTML);
- return true;
-}
-
-function FormDeleteView(viewId)
-{
- if (confirm("Are you sure you want to delete the view?"))
- {
- var divSubmitAll =3D GetNodeByTagNameAndAttName("div","SubmitAll=
")[0];
- //alert(divSubmitAll);
- divSubmitAll.innerHTML +=3D "<input type=3D\"hidden\" name=3D=
\"delete\" value=3D\"true\"></input>";
- divSubmitAll.innerHTML +=3D "<input type=3D\"hidden\" name=3D=
\"viewId\" value=3D\"" + viewId + "\"></input>";
- return true; =20
- }
- else
- {
- return false; =20
- }
-}
-
-function FormGetRightAtt()
-{
- return this.attributeRightArray;
-}
-
-function FormGetLeftAtt()
-{
- return this.attributeLeftArray;
-}
-
-function FormUpdateList(list,classId,leftOrRight)
-{
- =20
- this.classId =3D classId; //stores classId
- this.UpdateAttributes(classId);
- =20
- var updateArray;
- if(leftOrRight =3D=3D "left")
- {
- updateArray =3D this.attributeLeftArray;
- }
- else
- {
- updateArray =3D this.attributeRightArray; =20
- }
- =20
- list.Set(updateArray);
-}
-
-function FormUpdateLists(left,right,classId)
-{
- this.UpdateList(left,classId,"left");
- this.UpdateList(right,classId,"right");
-}
-
-function FormSetToDefault(left,right)
-{
- this.UpdateLists(left,right,this.classId); =20
-}
-
-function FormGetSortArray(number)
-{
- var optionArray =3D new Array();
- =20
- if(number =3D=3D 1) // The attributes
- {
- var lengthArray =3D this.formArray[this.classId].length;
- //alert("lengthArray: " + lengthArray);
- =20
- optionArray[0] =3D new Array(); //Begin to second element
- optionArray[0]["value"] =3D "-1";
- optionArray[0]["text"] =3D "--Nothing--";
- =20
- for (var i =3D 0; i < lengthArray ;i++)
- {
- optionArray[i+1] =3D new Array(); //Begin to second element
- optionArray[i+1]["value"] =3D this.formArray[this.classId][i=
]["value"];
- optionArray[i+1]["text"] =3D this.formArray[this.classId][i=
]["name"];
- }
- }
- else // Asc Desc etc...
- {
- optionArray[0] =3D new Array();
- optionArray[0]["value"] =3D "-1";
- optionArray[0]["text"] =3D "--Nothing--";
- optionArray[1] =3D new Array();
- optionArray[1]["value"] =3D "0";
- optionArray[1]["text"] =3D "Ascendent";
- optionArray[2] =3D new Array();
- optionArray[2]["value"] =3D "1";
- optionArray[2]["text"] =3D "Descendent";
- }
- return optionArray;
-}
-
-
-function FormGetFilterArray(number)
-{
- var optionArray =3D new Array();
- =20
- if(number =3D=3D 1) // The attributes (as for sort)
- {
- var lengthArray =3D this.formArray[this.classId].length;
- //alert("lengthArray: " + lengthArray);
- =20
- optionArray[0] =3D new Array();
- optionArray[0]["value"] =3D "-1";
- optionArray[0]["text"] =3D "--Nothing--"
- for (var i =3D 0; i < lengthArray ;i++)=20
- {
- optionArray[i+1] =3D new Array(); //Begin to second element
- optionArray[i+1]["value"] =3D this.formArray[this.classId][i=
]["value"];
- optionArray[i+1]["text"] =3D this.formArray[this.classId][i=
]["name"];
- }
- }
- else // Asc Desc etc...
- {
- optionArray[0] =3D new Array();
- optionArray[0]["value"] =3D "-1";
- optionArray[0]["text"] =3D "--Nothing--";
- optionArray[1] =3D new Array();
- optionArray[1]["value"] =3D "0";
- optionArray[1]["text"] =3D "GreaterOrEqualThan";
- optionArray[2] =3D new Array();
- optionArray[2]["value"] =3D "1";
- optionArray[2]["text"] =3D "LessEqualThan";
- optionArray[3] =3D new Array();
- optionArray[3]["value"] =3D "2";
- optionArray[3]["text"] =3D "GreaterThan";
- optionArray[4] =3D new Array();
- optionArray[4]["value"] =3D "3";
- optionArray[4]["text"] =3D "LessThan";
- optionArray[5] =3D new Array();
- optionArray[5]["value"] =3D "4";
- optionArray[5]["text"] =3D "EqualTo";
- optionArray[6] =3D new Array();
- optionArray[6]["value"] =3D "5";
- optionArray[6]["text"] =3D "DistinctTo";
- optionArray[7] =3D new Array();
- optionArray[7]["value"] =3D "6";
- optionArray[7]["text"] =3D "BeginWith";
- optionArray[8] =3D new Array();
- optionArray[8]["value"] =3D "7";
- optionArray[8]["text"] =3D "ContainsTo";
- optionArray[9] =3D new Array();
- optionArray[9]["value"] =3D "8";
- optionArray[9]["text"] =3D "In";
- =20
- }
- =20
- return optionArray;
-}
-
-function FormUpdateSort(sort,classId)
-{
- this.classId =3D classId;
- sort.Update(this.GetSortArray(1),this.GetSortArray(2)); //TODO: sort=
doesn't work yet
-}
-
-function FormUpdateFilter(filter,classId)
-{
- this.classId =3D classId;
- filter.Update(this.GetFilterArray(1),this.GetFilterArray(2)); =20
-}
-
-function FormUpdateAttributes(classId)
-{
- //alert(classId);
- this.classId =3D classId; //stores classId
- this.attributeLeftArray =3D new Array();
- this.attributeRightArray =3D new Array();
- =20
- if(this.ViewParams.Empty() =3D=3D true) //In the case of creation of=
a class
- {
- =20
- //For the columns
- var maxAttNumber =3D this.formArray[classId].length;
- if(maxAttNumber < 3)
- {
- maxAttNumber =3D 0; =20
- }
- else
- {
- maxAttNumber =3D 3;
- }
- =20
- for (var i =3D 0; i < maxAttNumber ;i++)
- {
- var element =3D new ListElement( this.formArray[classId][i]=
["name"],
- this.formArray[classId][i]["=
value"],
- false);
- this.attributeRightArray[i] =3D element; =
=20
- }
- =20
- for (var i =3D 0; i < this.formArray[classId].length ;i++)
- {
- if(i<maxAttNumber)
- {
- var element =3D new ListElement( this.formArray[classId=
][i]["name"],
- this.formArray[classId][=
i]["value"],
- true);
- =20
- }
- else
- {
- var element =3D new ListElement( this.formArray[classId=
][i]["name"],
- this.formArray[classId][=
i]["value"],
- false);
- }
- this.attributeLeftArray[i] =3D element; =
=20
- }
- =20
- }
- else //In the case of update of a class
- {
- var j=3D0; //the counter for rightArray
- for(var i=3D0; i<this.formArray[classId].length;i++)
- {
- var idAttForm =3D this.formArray[classId][i]["value"];
- if(IsInArray(idAttForm,this.ViewParams.GetColumns()) =3D=3D =
true) //If the attribute is in the view
- {
- =20
- =20
- //The left array
- var element =3D new ListElement( this.formArray[classId=
][i]["name"],
- this.formArray[classId][=
i]["value"],
- true);
- this.attributeLeftArray[i] =3D element; =20
- //The right array: the element
- var element =3D new ListElement( this.formArray[classId=
][i]["name"],
- this.formArray[classId][=
i]["value"],
- false);
- this.attributeRightArray[j++] =3D element; =
=20
- =20
- }
- else
- {
- var element =3D new ListElement( this.formArray[classId=
][i]["name"],
- this.formArray[classId][=
i]["value"],
- false);
- //The left array
- this.attributeLeftArray[i] =3D element; =20
- =20
- //The right array: nothing
- =20
- }
- }
- }
-}
-
-
-/**
- * Returns the name of attribute give its id
- */
-function FormGetNameOfAttribute(idAtt)
-{
- for(i=3D0;i<this.formArray[classId].length;i++)
- {
- var elTab =3D this.formArray[classId][i];
- if(idAtt =3D=3D elTab["value"])
- {
- return elTab["name"];
- }
- }
- return "";
-}
-
-////////////////////////////////////////////// END: Form Class /////////=
////////////////////////////////////////////////
Deleted: humano2/trunk/web/builder/site/js/grafcomponents/expandform.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/grafcomponents/expandform.js 2005-0=
6-13 23:14:13 UTC (rev 1318)
+++ humano2/trunk/web/builder/site/js/grafcomponents/expandform.js 2005-0=
6-14 18:02:49 UTC (rev 1319)
@@ -1,464 +0,0 @@
-//
-// The Humano2 Business solution.
-// Copyright (C) 2004,5 Humano2 Chile S.A. (http://www.humano2.com)
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version. =20
-//
-//
-
-
-/**
- * Constructor
- * class used to build an expand form with predeterminated values
- * @param selectedOption1Array the options selected for select tag #1
- * @param selectedOption2Array the options selected for select tag #2
- * @param inputTagValuesArray the input values
- */
-function InputValues(selectOption1Array,selectOption2Array,inputTagValue=
sArray)
-{
- //Fields
- this.selectOption1 =3D CopyArray(selectOption1Array);
- this.selectOption2 =3D CopyArray(selectOption2Array);
- this.inputTagValuesArray =3D CopyArray(inputTagValuesArray);
- =20
- //Methods
- this.GetTriplet =3D InputValuesGetTriplet; =20
- this.Size =3D InputValuesSize;
- =20
- if((this.selectOption1 !=3D null) &&=20
- (this.selectOption2 !=3D null))
- {
- return this; =20
- }
- else=20
- return null; =20
-}
- =20
-/**
- * @param index the index used for the free fields array of class
- * @returns a triplet (selected option 1, selected option2, input)
- */ =20
-function InputValuesGetTriplet(index)
-{
- var triplet =3D new Array();
- triplet["option1"] =3D this.selectOption1[index];
- triplet["option2"] =3D this.selectOption2[index];
- //alert("this.inputTagValuesArray: " + this.inputTagValuesArray);
- if(this.inputTagValuesArray !=3D null) //Only if there's a text of c=
ourse
- {
- triplet["input"] =3D this.inputTagValuesArray[index];
- }
- //alert("triplet[\"option1\"]:" + triplet["option1"] + " triplet[\"o=
ption2\"]: " + triplet["option2"] + "triplet[\"input\"]: " + triplet["inp=
ut"]);
- return triplet;
-}
-
-/**
- * @return size of one
- */
-function InputValuesSize()
-{
- //Whatever array minus the input one that may be empty
- return this.selectOption1.length; =20
-}
-
-
-/**
- * Constructor
- * with input: add an input as third field
- * @param htmlForm text: the form: no matters the Id of Name of the inpu=
ts / select, they will be renamed
- * @param withInput: add an <input> tag or not (depending on the value o=
f the boolean)
- * @param inputValues is an object ExpanFormInput that contains the sele=
cted options (1 & 2) and eventually the inputs
- */
-function ExpandForm(selfRefName,receptorNode,withInput,optionArray1,opti=
onArray2,title,inputValues)
-{
- //Fields
- this.selfRefName =3D selfRefName;
- this.receptorNode =3D receptorNode;
- this.withInput =3D withInput;
- this.optionArray1 =3D new Array();
- this.optionArray2 =3D new Array();
- this.title =3D title;
- this.inputValues =3D inputValues;
- =20
- //Methods
- this.PutAllComponents =3D ExpandFormPutAllComponents;
- this.AddLine =3D ExpandFormAddLine;
- this.RemoveLine =3D ExpandFormRemoveLine;
- this.ReturnValues =3D ExpandFormReturnValues;
- this.GetOptionsString =3D ExpandFormGetOptionsString;
- this.GetReceptorNode =3D ExpandFormGetReceptorNode;
- this.GetSelfRefName =3D ExpandFormGetSelfRefName;
- this.GetTitle =3D ExpandFormGetTitle;
- this.Update =3D ExpandFormUpdate;
- =20
- //Copy the arrays passed in parameters=20
- var i;
- for(i=3D0;i<optionArray1.length;i++)
- {
- this.optionArray1[i] =3D new Array();
- this.optionArray1[i]["text"] =3D optionArray1[i]["text"];
- this.optionArray1[i]["value"] =3D optionArray1[i]["value"];
- }
- =20
- for(i=3D0;i<optionArray2.length;i++)
- {
- this.optionArray2[i] =3D new Array();
- this.optionArray2[i]["text"] =3D optionArray2[i]["text"];
- this.optionArray2[i]["value"] =3D optionArray2[i]["value"];
- }
- //alert("inputValues=3D " + this.inputValues);
- //Update the current document
- this.PutAllComponents(receptorNode);
- =20
- return this; =20
-}
-
-function ExpandFormUpdate(optionArray1,optionArray2)
-{
- //Don't forget to clear the existing arrays
- this.optionArray1 =3D new Array();
- this.optionArray2 =3D new Array();
-
- //option tables
- //Copy the arrays passed in parameters=20
-
- var i;
- for(i=3D0;i<optionArray1.length;i++)
- {
- this.optionArray1[i] =3D new Array();
- this.optionArray1[i]["text"] =3D optionArray1[i]["text"];
- this.optionArray1[i]["value"] =3D optionArray1[i]["value"];
- }
- =20
- for(i=3D0;i<optionArray2.length;i++)
- {
- this.optionArray2[i] =3D new Array();
- this.optionArray2[i]["text"] =3D optionArray2[i]["text"];
- this.optionArray2[i]["value"] =3D optionArray2[i]["value"];
- }
- =20
- //Remove all lines but one
- var nbNodes =3D this.receptorNode.childNodes.length;
- while(nbNodes>0)
- {
- nbNodes =3D this.RemoveLine(); =20
- }
- =20
- //Add a line
- this.AddLine();
-}
-
-
-/**
- * This function adds a line to the expand form but
- * with preselect values
- * @param indexOption1=20
- * @param indexOption2
- * @param blank if true insert a blank form if not use the inputValues o=
bject and the index
- */
-function ExpandFormAddLine(index,blank)
-{
- var divReceptor =3D GetNodeByTagNameAndAttName("div",this.selfRefNam=
e)[0]; //Unique id in the document as every
- =
// graphical components should have unique identificator
- //alert("divReceptor: " + divReceptor);
- var lineNumber =3D divReceptor.childNodes.length;
- =20
- var option1String;
- var option2String;
- var inputValue;
- //alert("index:" + index + " blank: " + blank + " inputValues:" + th=
is.inputValues);
- if((this.inputValues!=3D null)=20
- && (blank =3D=3D false)) //Insert new line with preselected valu=
es
- {
- var triplet =3D this.inputValues.GetTriplet(index);
- option1String =3D this.GetOptionsString(1,triplet["option1"])
- option2String =3D this.GetOptionsString(2,triplet["option2"])
- inputValue =3D triplet["input"];
- }
- else
- {
- option1String =3D this.GetOptionsString(1,0) //first selected by=
default
- option2String =3D this.GetOptionsString(2,0) // idem
- inputValue =3D "";
- }
- =20
- var innerHtml =3D this.title + lineNumber + ": "
- + "<select style=3D\"width:100px;\" name=3D\"selec=
t1" + this.selfRefName + lineNumber + "\" class=3D\"drpdwn2\">"
- + option1String
- + "</select>"
- + "<select style=3D\"width:100px;\" name=3D\"selec=
t2" + this.selfRefName + lineNumber + "\" class=3D\"drpdwn2\">"
- + option2String
- + "</select>";=20
- =20
- if(this.withInput =3D=3D true) =
=20
- {
- innerHtml +=3D "<input name=3D\"input" + this.selfRefName + line=
Number + "\" value=3D\"" + inputValue + "\" id=3D\"\"></input>";
- }
- //alert("innerHtml:" + innerHtml);
- =20
- var divLine =3D document.createElement("div");
- =20
- divLine.innerHTML =3D innerHtml;
- =20
- //alert("divLine.childNodes.length: " + divLine.childNodes.length)
- =20
- //Add the line
- divReceptor.appendChild(divLine);
-}
-
-
-
-
-
-/**
- * Should be conform to viewtools norm
- */
-function ExpandFormReturnValues()
-{ =20
- var res =3D "";
- =20
- var divWithLines =3D GetNodeByTagNameAndAttName("div",this.selfRefNa=
me)[0]; //Unique id in the document as every
- =
// graphical components should have unique identificator
- var node =3D divWithLines.firstChild;
- //alert("divWithLines.firstChild.childNodes.length: " + divWithLines=
.firstChild.childNodes.length);
- //alert("divWithLines.firstChild.innerHTML: " + divWithLines.firstCh=
ild.innerHTML)
- while(node !=3D null)
- {
- if(this.withInput =3D=3D false)
- {
- //CAUTION: we start from the second child because the first =
is a text node (title) !!!!
- var divFirstSelect =3D node.firstChild.nextSibling;
- var divSecondSelect =3D divFirstSelect.nextSibling;
- =20
- if((divFirstSelect.value !=3D -1) && (divSecondSelect.value!=
=3D -1)) //Verify if something has been selected
- {
- //alert("divFirstSelect:" + divFirstSelect);
- res +=3D divFirstSelect.value + "|";
- //alert("divSecondSelect:" + divSecondSelect);
- res +=3D divSecondSelect.value;
- res +=3D ","; //Separator between two order
- }
- }
- else
- {
- //Here we must get the input value moreover
- //CAUTION: we start from the second child because the first =
is a text node (title) !!!!
- var divFirstSelect =3D node.firstChild.nextSibling;
- var divSecondSelect =3D divFirstSelect.nextSibling;
- =20
- if((divFirstSelect.value !=3D -1) && (divSecondSelect.value!=
=3D -1)) //Verify if something has been selected
- {
- //alert("divFirstSelect:" + divFirstSelect);
- res +=3D divFirstSelect.value + "|";
- =20
- //alert("divSecondSelect:" + divSecondSelect);
- res +=3D divSecondSelect.value + "|";
- =20
- var divInput =3D divSecondSelect.nextSibling;
- //alert("divInput:" + divInput);
- res +=3D "\'" + divInput.value + "\'";
- =20
- var queue =3D "";
- if(node.nextSibling =3D=3D null) //Last criteria ?
- {
- queue =3D "|0|0";
- }
- else=20
- {
- queue =3D "|1|0";
- }
- res +=3D queue;
- res+=3D ";"; //Separator between two where
- }
- }
- node =3D node.nextSibling;
- }
- //Leave last coma (caracter)
- if(res !=3D "") //In case select was put to nothing
- {
- res =3D res.substring(0,res.length-1);
- }
- //alert("res expand:" + res);
-
- return res;
-}
-
-function ExpandFormGetOptionsString(value,selectedValueIndex)
-{
- var optionsArray;
- =20
- if( value=3D=3D 1)
- {
- optionArray =3D this.optionArray1;
- }
- else
- {
- optionArray =3D this.optionArray2; =20
- }
- =20
- var resStr =3D "";
- =20
- for(i=3D0;i<optionArray.length;i++)
- {
- =20
- var selected =3D "";
- if (selectedValueIndex =3D=3D i)
- {
- selected =3D " selected ";
- }
- resStr +=3D "<option name=3D\"" + this.selfRefName + i + "\"=
value =3D\"" + optionArray[i]["value"] + "\"" + selected + ">"
- + optionArray[i]["text"] + "</option>";
- }
- //alert(resStr);
- return resStr;
-}
-
-function ExpandFormRemoveLine()
-{
- var divReceptor =3D GetNodeByTagNameAndAttName("div",this.selfRefNam=
e)[0]; //Unique id in the document as every
- =
// graphical components should have uni
- if(divReceptor.childNodes.length =3D=3D 0) //Nothing ot remove
- {
- return; =20
- }
- =20
- divReceptor.removeChild(divReceptor.lastChild); =20
- =20
- return divReceptor.childNodes.length;
-}
-
-function ExpandFormGetTitle()
-{
- return this.title; =20
-}
-
-function ExpandFormPutAllComponents()
-{
- var innerHtml =3D=20
- "<table>" =20
- + "<tr>"
- + "<td valign=3D\"top\">"
- + "<div id=3D\"" + this.selfRefName +"\" name=3D\"=
" + this.selfRefName + "\" >" //Id that will contain the form lines
- + "</div>"
- + "</td>"
- + "<td valign=3D\"top\">"
- + "<center>"
- + "<input type=3D\"button\" value=3D\"Add criteria=
\" onclick=3D\"" + this.selfRefName +".AddLine();\"></input>"
- + "<br/>"
- + "<input type=3D\"button\" value=3D\"Remove\" onc=
lick=3D\"" + this.selfRefName +".RemoveLine();\">"
- + "</center>";
- + "</td>"
- + "</tr>"
- + "</table>";
- =20
- //alert("innerHTML:" + innerHtml);
- this.receptorNode.innerHTML =3D innerHtml; =20
- =20
- //Add lines with preselected values if inputValues exists
- if(this.inputValues !=3D null)
- {
- var i;
- //alert("size inputs: " + this.inputValues.Size());
- for(i=3D0; i < this.inputValues.Size();i++)
- {
- this.AddLine(i,false);
- }
- }
- else
- {
- this.AddLine(); =20
- }
-}
-
-function ExpandFormGetReceptorNode()
-{
- return this.receptorNode; =20
-}
-
-function ExpandFormGetSelfRefName()
-{
- return this.selfRefName;
-}
-
-function ExpandFormTest()
-{
- ///////////////////////////////////////////////
- TestGroupWrite("ExpandFormTest");
- var divReceptor =3D GetNodeByTagNameAndAttName("div","ExpandForm")[0=
];=20
- var divInsideReceptor =3D document.createElement("div");
- divReceptor.appendChild(divInsideReceptor);
- =20
- var buttonShowValues =3D document.createElement("div");
- buttonShowValues.innerHTML =3D "<input type=3D\"button\" value=3D\"G=
et values\" onclick=3D\"aExpandForm.ReturnValues();\"></input>";
- =20
- divReceptor.appendChild(buttonShowValues);
- =20
- var optionArray1 =3D new Array();
- optionArray1[0] =3D new Array();
- optionArray1[0]["value"] =3D "17";
- optionArray1[0]["text"] =3D "email";
- optionArray1[1] =3D new Array();
- optionArray1[1]["value"] =3D "18";
- optionArray1[1]["text"] =3D "file";
- =20
- var optionArray2 =3D new Array();
- optionArray2[0] =3D new Array();
- optionArray2[0]["value"] =3D "asc";
- optionArray2[0]["text"] =3D "Ascendant";
- optionArray2[1] =3D new Array();
- optionArray2[1]["value"] =3D "desc";
- optionArray2[1]["text"] =3D "Descendant";
- =20
- aExpandForm =3D new ExpandForm("aExpandForm",divInsideReceptor,false=
,optionArray1,optionArray2,"Order");
- =20
- ////////////////////////////////////////////////////////////////////=
////////////////////////////////////
- =20
- =20
- //Build an expand form with preselected values
- var optionArray1 =3D new Array();
- optionArray1[0] =3D new Array();
- optionArray1[0]["value"] =3D "17";
- optionArray1[0]["text"] =3D "email";
- optionArray1[1] =3D new Array();
- optionArray1[1]["value"] =3D "18";
- optionArray1[1]["text"] =3D "file";
- optionArray1[2] =3D new Array();
- optionArray1[2]["value"] =3D "19";
- optionArray1[2]["text"] =3D "text";
- =20
- var optionArray2 =3D new Array();
- optionArray2[0] =3D new Array();
- optionArray2[0]["value"] =3D "0";
- optionArray2[0]["text"] =3D "<=3D";
- optionArray2[1] =3D new Array();
- optionArray2[1]["value"] =3D "1";
- optionArray2[1]["text"] =3D "=3D";
- =20
- var selectOption1Arr =3D new Array();
- selectOption1Arr[0] =3D 0; //select file by default
- selectOption1Arr[1] =3D 2; //select text by default
- =20
- var selectOption2Arr =3D new Array();
- selectOption2Arr[0] =3D 0; //asc
- selectOption2Arr[1] =3D 1; //desc
- =20
- var inputValuesArr =3D new Array();
- inputValuesArr[0] =3D "toto.xsl";
- inputValuesArr[1] =3D "texto... Hola";
- =20
- aInputValues =3D new InputValues(selectOption1Arr,selectOption2Arr,i=
nputValuesArr);
- otherExpandForm =3D new ExpandForm("otherExpandForm",divInsideRecept=
or,true,optionArray1,optionArray2,"TestExpand: ",aInputValues);
- Test("LENGTH","Size of inputValues",aInputValues.Size() =3D=3D 2); =
=20
- Test("GetTriplet","Call #1",aInputValues.GetTriplet(0)["option1"] =3D=
=3D 0=20
- && aInputValues.GetTriplet(0)["option2"]=
=3D=3D 0
- && aInputValues.GetTriplet(0)["input"] =3D=
=3D "toto.xsl");
- Test("GetTriplet","Call #2",aInputValues.GetTriplet(1)["option1"] =3D=
=3D 2=20
- && aInputValues.GetTriplet(1)["option2"]=
=3D=3D 1
- && aInputValues.GetTriplet(1)["input"] =3D=
=3D "texto... Hola");
- =20
-}
-
-
Modified: humano2/trunk/web/builder/site/xsl/createreport.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-13 23:14:=
13 UTC (rev 1318)
+++ humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-14 18:02:=
49 UTC (rev 1319)
@@ -19,9 +19,9 @@
<script language=3D"Javascript" src=3D"js/grafcomponents/sor=
tedgraphicallist.js"></script>
<script language=3D"Javascript" src=3D"js/grafcomponents/rad=
iobuttonexpand.js"></script>
<script language=3D"Javascript" src=3D"js/grafcomponents/inp=
utline.js"></script>
- <script language=3D"Javascript" src=3D"js/grafcomponents/exp=
andformreport.js"></script>
+ <script language=3D"Javascript" src=3D"js/grafcomponents/exp=
andform.js"></script>
<!-- Load this script before the next one -->
- <script language=3D"Javascript" src=3D"js/formreport.js" typ=
e=3D"text/javascript"></script>=20
+ <script language=3D"Javascript" src=3D"js/form.js" type=3D"t=
ext/javascript"></script>=20
<script language=3D"Javascript" src=3D"js/createreport.js" t=
ype=3D"text/javascript"></script>=20
<link href=3D"css/createinterface.css" rel=3D"stylesheet" ty=
pe=3D"text/css"></link>
=20
Modified: humano2/trunk/web/builder/site/xsl/createview.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-13 23:14:13=
UTC (rev 1318)
+++ humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-14 18:02:49=
UTC (rev 1319)
@@ -18,9 +18,11 @@
<script language=3D"Javascript" src=3D"js/grafcomponents/sor=
tedlist.js"></script>
<script language=3D"Javascript" src=3D"js/grafcomponents/sor=
tedgraphicallist.js"></script>
<script language=3D"Javascript" src=3D"js/grafcomponents/rad=
iobuttonexpand.js"></script>
+ <script language=3D"Javascript" src=3D"js/grafcomponents/inp=
utline.js"></script>
<script language=3D"Javascript" src=3D"js/grafcomponents/exp=
andform.js"></script>
+ <script language=3D"Javascript" src=3D"js/createreport.js" t=
ype=3D"text/javascript"></script> <!-- Fixme factorize it -->
<!-- Load this script before the next one -->
- <script language=3D"Javascript" src=3D"js/formview.js" type=3D=
"text/javascript"></script>=20
+ <script language=3D"Javascript" src=3D"js/form.js" type=3D"t=
ext/javascript"></script>
<link href=3D"css/createinterface.css" rel=3D"stylesheet" ty=
pe=3D"text/css"/>
=20
<!-- Here we create an array and use it as parameter for For=
m class constructor -->
@@ -28,7 +30,7 @@
=20
//////////////////////
//The view params
- =20
+ /*
//Columns
var viewColumnsArray =3D new Array();
var i=3D0;
@@ -37,40 +39,11 @@
</xsl:for-each>
//alert(viewColumnsArray.length);
var ViewParams =3D new ViewParams(viewColumnsArray,null,=
null);
- =20
- //Filters =20
- var selectOption1Array =3D new Array();
- var selectOption2Array =3D new Array();
- var inputTagValuesArray =3D new Array();
- =20
- var i=3D0;
- <xsl:for-each select=3D"/view/viewDatas/viewParams/condi=
tions/condition">
- selectOption1Array[i] =3D <xsl:value-of select=3D"i=
dAtt" />;
- selectOption2Array[i] =3D <xsl:value-of select=3D"o=
perator" />;
- inputTagValuesArray[i] =3D <xsl:value-of select=3D"=
value" />;
- i++;
- </xsl:for-each>
- =20
- var inputValuesFilter;
- inputValuesFilter =3D new InputValues(selectOption1Array=
,selectOption2Array,inputTagValuesArray);
- =20
- //Order
- var selectOption1ArrayOrder =3D new Array();
- var selectOption2ArrayOrder =3D new Array();
- var i=3D0;
- <xsl:for-each select=3D"/view/viewDatas/viewParams/order=
s/order">
- selectOption1ArrayOrder[i] =3D <xsl:value-of select=
=3D"idAtt" />;
- selectOption2ArrayOrder[i] =3D <xsl:value-of select=
=3D"ascOrDesc" />;
- i++;
- </xsl:for-each>
- var inputValuesOrder;
- inputValuesOrder =3D new InputValues(selectOption1ArrayO=
rder,selectOption2ArrayOrder,null);
- =20
+ */
////////////////////////
//The form
var formArray =3D new Array();
var i; //Counter
- =20
<xsl:for-each select=3D"/view/classes/class">
<xsl:variable name=3D"classId">
<xsl:value-of select=3D"id" />
@@ -86,10 +59,89 @@
</xsl:for-each>
=20
<xsl:if test=3D"/view/viewDatas/classId!=3D''">
- var Form =3D new Form(formArray,<xsl:value-of select=3D"=
/view/viewDatas/classId" />,ViewParams);
+ var Form =3D new Form(formArray,<xsl:value-of select=3D"=
/view/viewDatas/classId" />);
</xsl:if>
- //alert(Form.GetOptionString(0));
=20
+ =20
+ //////////////////
+ //Filter
+ =20
+ //This array is used by filter and sort as both require =
the list of attributes for the class
+ var attList =3D new Array();
+ attList[0] =3D new Array();
+ attList[0]["value"] =3D "-1";
+ attList[0]["text"] =3D "--Nothing--"
+ var i=3D1; //The first line is by default
+ <xsl:for-each select=3D"/view/classes/class[count(attrib=
utes)>0]/attributes/attribute"> //Get all attributes
+ <xsl:variable name=3D"classId">
+ <xsl:value-of select=3D"id" />
+ </xsl:variable>
+ attList[i] =3D new Array();
+ attList[i]["value"] =3D '<xsl:value-of select=3D"id"=
/>';
+ attList[i]["text"] =3D '<xsl:value-of select=3D"name=
"/>';
+ i++;
+ </xsl:for-each>
+ =20
+ //When updating: get the values back into interface
+ var selectOption0ArrayFilter =3D new Array();
+ var selectOption1ArrayFilter =3D new Array();
+ var inputTagValuesArrayFilter =3D new Array();
+ =20
+ var i=3D0;
+ <xsl:for-each select=3D"/view/viewDatas/viewParams/condi=
tions/condition">
+ selectOption0ArrayFilter[i] =3D <xsl:value-of selec=
t=3D"idAtt" />;
+ selectOption1ArrayFilter[i] =3D <xsl:value-of selec=
t=3D"operator" />;
+ inputTagValuesArrayFilter[i] =3D <xsl:value-of sele=
ct=3D"value" />;
+ i++;
+ </xsl:for-each>
+ =20
+ <xsl:if test=3D"/view/viewDatas/classId!=3D''">
+ var InputLineParamsFilters =3D
+ {
+ type: 'TWOSELECTANDINPUT',
+ select0: attList,
+ select1: OperatorsGetSelectArray(),
+ lineTitle: 'Filter',
+ input0: '',
+ PreselectedInput0: inputTagValuesArrayFilter,
+ PreselectedSelect0: selectOption0ArrayFilter,
+ PreselectedSelect1: selectOption1ArrayFilter,
+ refName: 'expandFormFilter'
+ }
+ var InputLineFilters =3D new InputLine(InputLinePara=
msFilters);
+ </xsl:if>
+ =20
+ //////////////
+ //Order
+ =20
+ //When updating: get the values of view back
+ var selectOption0ArrayOrder =3D new Array();
+ var selectOption1ArrayOrder =3D new Array();
+ var inputTagValuesArrayOrder =3D new Array();
+ =20
+ var i=3D0;
+ <xsl:for-each select=3D"/view/viewDatas/viewParams/order=
s/order">
+ selectOption0ArrayOrder[i] =3D <xsl:value-of select=
=3D"idAtt" />;
+ selectOption1ArrayOrder[i] =3D <xsl:value-of select=
=3D"ascOrDesc" />;
+ i++;
+ </xsl:for-each>
+ <xsl:if test=3D"/view/viewDatas/classId!=3D''">
+ var InputLineParamsOrders =3D
+ {
+ type: 'TWOSELECT',
+ select0: attList,
+ select1: OrderGetSelectArray(),
+ lineTitle: 'Order',
+ input0: '',
+ PreselectedInput0: null,
+ PreselectedSelect0: selectOption0ArrayOrder,
+ PreselectedSelect1: selectOption1ArrayOrder,
+ refName: 'expandFormOrder'
+ }
+ var InputLineOrders =3D new InputLine(InputLineParam=
sOrders);
+ </xsl:if>
+ =20
+ =20
///////////////
/// The columns of attributes
var attribsArr =3D new Array();
@@ -287,13 +339,11 @@
</table>
<script language=3D"Javascri=
pt">
var divFilter =3D GetNod=
eByTagNameAndAttName("div","Filter")[0];
+ =20
var expandFormFilter =3D=
new ExpandForm("expandFormFilter",
- =
divFilter,
- =
true,
- =
Form.GetFilterArray(1),
- =
Form.GetFilterArray(2),
- =
"Filter",
- =
inputValuesFilter);
+ =
divFilter,
+ =
"Filter",
+ =
InputLineFilters);
</script>
</td>
</tr>
@@ -423,15 +473,14 @@
</td>
</tr>
</table>
+ =20
<script language=3D"Javascri=
pt">
var divSort =3D GetNodeB=
yTagNameAndAttName("div","Sort")[0];
- var expandFormSort =3D n=
ew ExpandForm("expandFormSort",
- =
divSort,
- =
false,
- =
Form.GetSortArray(1),
- =
Form.GetSortArray(2),
- =
"Order",
- =
inputValuesOrder);
+ =20
+ var expandFormOrder =3D =
new ExpandForm("expandFormOrder",
+ =
divSort,
+ =
"Order",
+ =
InputLineOrders);
</script>
</td>
</tr>
@@ -460,7 +509,7 @@
<xsl=
:value-of select=3D"/view/viewDatas/saveName" />
</xsl:at=
tribute>
<xsl:att=
ribute name=3D"onclick">
- retu=
rn Form.UpdateSubmitAll(rightColumn,expandFormSort,expandFormFilter); //D=
on't forget to do the same in Form.UpdateHeader
+ retu=
rn Form.UpdateSubmitAll(rightColumn,expandFormOrder,expandFormFilter); //=
Don't forget to do the same in Form.UpdateHeader
</xsl:at=
tribute>
</input>
</div>
|
|
From: <sv...@de...> - 2005-06-13 23:14:21
|
Author: pcamacho
Date: 2005-06-13 19:14:13 -0400 (Mon, 13 Jun 2005)
New Revision: 1318
Modified:
humano2/trunk/web/builder/site/viewmain.aspx.cs
Log:
DELETE: unuseful code in viewmain.aspx.cs
Modified: humano2/trunk/web/builder/site/viewmain.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-13 23:08:47 U=
TC (rev 1317)
+++ humano2/trunk/web/builder/site/viewmain.aspx.cs 2005-06-13 23:14:13 U=
TC (rev 1318)
@@ -128,7 +128,7 @@
//relacionadas...
if(Convert.ToInt32(classId) > 0)
{
- strXml +=3D formAttribList(Convert.ToInt32(classId));
+ strXml +=3D getXmlAttribListForClass(Convert.ToInt32(cla=
ssId));
}
strXml +=3D getClassList();
strXml +=3D "</classes>";
@@ -524,7 +524,7 @@
}
=20
// Funcion agregada por negro que solo traera la informacion necesaria=
...
- private string formAttribList(int classId)=20
+ private string getXmlAttribListForClass(int classId)=20
{
string salida=3D"";
int attlogin =3D 0;
@@ -585,40 +585,6 @@
salida +=3D "</attributes>";
salida +=3D "</class>";
=20
- foreach(DataRow row in dt.Select("attType=3D'pertinence'"))=20
- {
- idatt =3D Convert.ToInt32(row["id_entity"]);
- dtpert =3D userCred.CoreAdapter.GetClassesFromPertinence(idatt);
- =20
-
- foreach(DataRow dr in dtpert.Rows)
- {
- idClassRel =3D Convert.ToInt32(dr["to"].ToString());
- dtrel =3D userCred.CoreAdapter.GetAttributesFromClass(idClassRel);
- className =3D dbAdapter.GetClassNameById(idClassRel);
-
- salida +=3D "<class>";
- salida +=3D "<id>" + idClassRel + "</id>";
- salida +=3D "<name>" + className + "</name>";
- salida +=3D "<attributes>";
-
- foreach(DataRow row2 in dtrel.Rows)=20
- {
- string attName =3D Convert.ToString(row2["attName"]);
- className =3D Convert.ToString(dr["name"]);
- //res.Append("<option>"+className+":"+attName+"</option>");
- salida +=3D "<attribute>";
- salida +=3D "<id>" + idatt + "^" + row2["id_entity"].ToString() + =
"</id>";
- salida +=3D "<name>" + className + "." + attName + "</name>";
- salida +=3D "</attribute>";
-
- }
- salida +=3D "</attributes>";
- salida +=3D "</class>";
- }
-
- }
- =09
return salida;
}
=20
|
|
From: <sv...@de...> - 2005-06-13 23:09:29
|
Author: pcamacho
Date: 2005-06-13 19:08:47 -0400 (Mon, 13 Jun 2005)
New Revision: 1317
Modified:
humano2/trunk/web/builder/site/xsl/createreport.xsl
humano2/trunk/web/builder/site/xsl/createview.xsl
Log:
FIX: view can get back attributes when updating (creation of view in buil=
der).
Modified: humano2/trunk/web/builder/site/xsl/createreport.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-13 22:51:=
14 UTC (rev 1316)
+++ humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-13 23:08:=
47 UTC (rev 1317)
@@ -28,8 +28,6 @@
<!-- Here we create an array and use it as parameter for For=
m class constructor -->
<script language=3D"Javascript">
=20
- //var ReportParams =3D new ReportParams(new Array(),null=
,null); //To be removed
- =20
////////////////////////
//The form
var formArray =3D new Array();
Modified: humano2/trunk/web/builder/site/xsl/createview.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-13 22:51:14=
UTC (rev 1316)
+++ humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-13 23:08:47=
UTC (rev 1317)
@@ -95,45 +95,95 @@
var attribsArr =3D new Array();
var item;
var i=3D0;
- <xsl:for-each select=3D"/view/classes/class/attributes/a=
ttribute"> //Get all attributes
+ <xsl:for-each select=3D"/view/classes/class[count(attrib=
utes)>0]/attributes/attribute"> //Get all attributes
<xsl:variable name=3D"classId">
<xsl:value-of select=3D"id" />
</xsl:variable>
- =20
var item =3D new ListElement("<xsl:value-of select=3D=
"name" />","<xsl:value-of select=3D"id"/>",false);
attribsArr[i] =3D item;
i++;
</xsl:for-each>
- <![CDATA[=20
- //Now builds left and right array for columns
- var sizeAttribsArr =3D attribsArr.length;
- var maxPreSelectedNum =3D sizeAttribsArr;
- if(maxPreSelectedNum < 3)
- {
- maxPreSelectedNum =3D 0;
- }
- else
- {
- maxPreSelectedNum =3D 3;=20
- }
- var leftAttribsArr =3D new Array();=20
- var rightAttribsArr =3D new Array();
- for(i=3D0;i<maxPreSelectedNum;i++)
- {
- rightAttribsArr[i] =3D new ListElement(attribsAr=
r[i].GetName(),attribsArr[i].GetValue(),false);
- }
+ var sizeAttribsArr =3D attribsArr.length;
+ <xsl:if test=3D"/view/viewDatas/name=3D''"> <!-- Creatio=
n -->
+ <![CDATA[
+ //Now builds left and right array for columns
+ var maxPreSelectedNum =3D sizeAttribsArr;
=20
- for(i=3D0;i<sizeAttribsArr;i++)
- {
- leftAttribsArr[i] =3D new ListElement(attribsArr=
[i].GetName(),attribsArr[i].GetValue(),false);
- if(i<maxPreSelectedNum)
+ if(maxPreSelectedNum < 3)
{
- leftAttribsArr[i].SetDisabled(true);
+ maxPreSelectedNum =3D 0;
}
- }
- ]]>
+ else
+ {
+ maxPreSelectedNum =3D 3;=20
+ }
+ var leftAttribsArr =3D new Array();=20
+ var rightAttribsArr =3D new Array();
+ var i=3D0;
+ for(i=3D0;i<maxPreSelectedNum;i++)
+ {
+ rightAttribsArr[i] =3D new ListElement(attri=
bsArr[i].GetName(),attribsArr[i].GetValue(),false);
+ }
+ =20
+ var i=3D0;
+ for(i=3D0;i<sizeAttribsArr;i++)
+ {
+ leftAttribsArr[i] =3D new ListElement(attrib=
sArr[i].GetName(),attribsArr[i].GetValue(),false);
+ if(i<maxPreSelectedNum)
+ {
+ leftAttribsArr[i].SetDisabled(true);
+ }
+ }
+ ]]>
+ </xsl:if>
+ <xsl:if test=3D"view/viewDatas/name!=3D''"> <!-- Update =
-->
+ //Columns
+ var reportColumnsArray =3D new Array();
+ var i=3D0;
+ <xsl:for-each select=3D"/view/viewDatas/viewParams/c=
olumns/column">
+ reportColumnsArray[i++] =3D "<xsl:value-of selec=
t=3D"." />";
+ </xsl:for-each>
+ //alert(reportColumnsArray.length);
+ =20
+ <![CDATA[
+ var leftAttribsArr =3D new Array();
+ var rightAttribsArr =3D new Array();
+ var j=3D0;
+ var i=3D0;
+ //alert("size: " + sizeAttribsArr);
+ for(i=3D0;i<sizeAttribsArr;i++)
+ {
+ var idAtt =3D attribsArr[i].GetValue();
+ =20
+ if(IsInArray(idAtt,reportColumnsArray) =3D=3D=
true)
+ {
+ //The left array
+ var element =3D new ListElement( attrib=
sArr[i].GetName(),
+ attribsA=
rr[i].GetValue(),
+ true);
+ leftAttribsArr[i] =3D element; =20
+ //The right array: the element
+ //alert(attribsArr[i].GetName());
+ var element =3D new ListElement( attrib=
sArr[i].GetName(),
+ attribsA=
rr[i].GetValue(),
+ false);
+ this.rightAttribsArr[j++] =3D element; =
=20
+ }
+ else
+ {
+ //The left array
+ //alert(attribsArr[i].GetName());
+ var element =3D new ListElement( attrib=
sArr[i].GetName(),
+ attribsA=
rr[i].GetValue(),
+ false);
+ leftAttribsArr[i] =3D element; =20
+ //The right array: nothing=20
+ }
+ =20
+ }
+ ]]>
+ </xsl:if>
=20
- =20
function recargar()
{
indice =3D document.formulario.classList.selectedInd=
ex;
@@ -219,7 +269,7 @@
</td>
</tr>
<tr>
- <td class=3D"lev1hea=
d" valign=3D"top"><font size=3D"2">Filtros...</font></td>
+ <td class=3D"lev1hea=
d" valign=3D"top"><font size=3D"2">Filters...</font></td>
</tr>
</table>
</td>
@@ -357,7 +407,7 @@
</td>
</tr>
<tr>
- <td class=3D"lev1hea=
d" valign=3D"top"><font size=3D"2">Orden...</font></td>
+ <td class=3D"lev1hea=
d" valign=3D"top"><font size=3D"2">Order...</font></td>
</tr>
</table>
</td>
|
|
From: <sv...@de...> - 2005-06-13 22:51:20
|
Author: pcamacho
Date: 2005-06-13 18:51:14 -0400 (Mon, 13 Jun 2005)
New Revision: 1316
Modified:
humano2/trunk/web/builder/site/js/formreport.js
humano2/trunk/web/builder/site/xsl/createreport.xsl
Log:
DELETE: unuseful code for formreport.js. Now it only takes care of the fo=
rm's variables.
Modified: humano2/trunk/web/builder/site/js/formreport.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/formreport.js 2005-06-13 22:41:05 U=
TC (rev 1315)
+++ humano2/trunk/web/builder/site/js/formreport.js 2005-06-13 22:51:14 U=
TC (rev 1316)
@@ -11,79 +11,18 @@
// $Id$
*/
=20
-//////////////////////////////////////////////ReportParams Class ///////=
////////////////////////////////////////////////
-function ReportParams(columns,where,order)
-{
- =20
- //Fields
- this.columns =3D columns;
- this.where =3D where;
- this.order =3D order;
- =20
- //alert("columns.length: " + columns.length);
- =20
- //Methods
- this.GetColumns =3D ReportParamsGetColumns;
- this.GetWhere =3D ReportParamsGetWhere;
- this.GetOrder =3D ReportParamsGetOrder;
- this.Empty =3D ReportParamsEmpty;
-=20
-}
-
-function ReportParamsEmpty()
-{
- var res =3D ((this.GetColumns().length =3D=3D 0) && (this.where =3D=3D=
null) && (this.order =3D=3D null));
- //alert("ReportParamsEmpty: " + res);
- return res;
-}
-
-function ReportParamsGetColumns()
-{
- //Jump the first unuseful element (0,10035,10025) for example
- var res =3D new Array()
- for(i=3D1;i<this.columns.length;i++)
- {
- res[i-1] =3D this.columns[i]; =20
- }
- //alert("ReportParamsGetColumns: length=3D " + res.length);
- return res;
-}
-
-function ReportParamsGetWhere()
-{
- return this.where; =20
-}
-
-function ReportParamsGetOrder()
-{
- return this.order; =20
-}
-
-
////////////////////////////////////////////// Form Class //////////////=
///////////////////////////////////////////////
-function Form(formArray, classId, ReportParams)
+function Form(formArray, classId) //, ReportParams)
{
//Fields
this.attributeLeftArray =3D new Array();
this.attributeRightArray =3D new Array();
this.formArray =3D formArray;
this.classId =3D classId;
- this.ReportParams =3D ReportParams;
=20
- =20
//Methods
- this.UpdateAttributes =3D FormUpdateAttributes;
- this.GetRightAtt =3D FormGetRightAtt;
- this.GetLeftAtt =3D FormGetLeftAtt;
- this.UpdateList =3D FormUpdateList;
- this.UpdateLists =3D FormUpdateLists;
- this.SetToDefault =3D FormSetToDefault;
this.UpdateSubmitAll =3D FormUpdateSubmitAll;
this.DeleteReport =3D FormDeleteReport;
- this.GetNameOfAttribute =3D FormGetNameOfAttribute;
- =20
- //Update the attributes
- this.UpdateAttributes(this.classId);
}
=20
function FormUpdateSubmitAll(rightColumn,sort,filter,persoColumns,having=
s)
@@ -170,145 +109,5 @@
}
}
=20
-function FormGetRightAtt()
-{
- return this.attributeRightArray;
-}
=20
-function FormGetLeftAtt()
-{
- return this.attributeLeftArray;
-}
-
-function FormUpdateList(list,classId,leftOrRight)
-{
- =20
- this.classId =3D classId; //stores classId
- this.UpdateAttributes(classId);
- =20
- var updateArray;
- if(leftOrRight =3D=3D "left")
- {
- updateArray =3D this.attributeLeftArray;
- }
- else
- {
- updateArray =3D this.attributeRightArray; =20
- }
- =20
- list.Set(updateArray);
-}
-
-function FormUpdateLists(left,right,classId)
-{
- this.UpdateList(left,classId,"left");
- this.UpdateList(right,classId,"right");
-}
-
-function FormSetToDefault(left,right)
-{
- this.UpdateLists(left,right,this.classId); =20
-}
-
-function FormUpdateAttributes(classId)
-{
- //alert(classId);
- this.classId =3D classId; //stores classId
- this.attributeLeftArray =3D new Array();
- this.attributeRightArray =3D new Array();
- =20
- if(this.ReportParams.Empty() =3D=3D true) //In the case of creation =
of a class
- {
- =20
- //For the columns
- var maxAttNumber =3D this.formArray[classId].length;
- if(maxAttNumber < 3)
- {
- maxAttNumber =3D 0; =20
- }
- else
- {
- maxAttNumber =3D 3;
- }
- =20
- for (var i =3D 0; i < maxAttNumber ;i++)
- {
- var element =3D new ListElement( this.formArray[classId][i]=
["name"],
- this.formArray[classId][i]["=
value"],
- false);
- this.attributeRightArray[i] =3D element; =
=20
- }
- =20
- for (var i =3D 0; i < this.formArray[classId].length ;i++)
- {
- if(i<maxAttNumber)
- {
- var element =3D new ListElement( this.formArray[classId=
][i]["name"],
- this.formArray[classId][=
i]["value"],
- true);
- =20
- }
- else
- {
- var element =3D new ListElement( this.formArray[classId=
][i]["name"],
- this.formArray[classId][=
i]["value"],
- false);
- }
- this.attributeLeftArray[i] =3D element; =
=20
- }
- }
- else //In the case of update of a class
- {
- var j=3D0; //the counter for rightArray
- for(var i=3D0; i<this.formArray[classId].length;i++)
- {
- var idAttForm =3D this.formArray[classId][i]["value"];
- if(IsInArray(idAttForm,this.ReportParams.GetColumns()) =3D=3D=
true) //If the attribute is in the report
- {
- =20
- =20
- //The left array
- var element =3D new ListElement( this.formArray[classId=
][i]["name"],
- this.formArray[classId][=
i]["value"],
- true);
- this.attributeLeftArray[i] =3D element; =20
- //The right array: the element
- var element =3D new ListElement( this.formArray[classId=
][i]["name"],
- this.formArray[classId][=
i]["value"],
- false);
- this.attributeRightArray[j++] =3D element; =
=20
- =20
- }
- else
- {
- var element =3D new ListElement( this.formArray[classId=
][i]["name"],
- this.formArray[classId][=
i]["value"],
- false);
- //The left array
- this.attributeLeftArray[i] =3D element; =20
- =20
- //The right array: nothing
- =20
- }
- }
- }
-}
-
-
-/**
- * Returns the name of attribute give its id
- */
-function FormGetNameOfAttribute(idAtt)
-{
- for(i=3D0;i<this.formArray[classId].length;i++)
- {
- var elTab =3D this.formArray[classId][i];
- if(idAtt =3D=3D elTab["value"])
- {
- return elTab["name"];
- }
- }
- return "";
-}
-
////////////////////////////////////////////// END: Form Class /////////=
////////////////////////////////////////////////
Modified: humano2/trunk/web/builder/site/xsl/createreport.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-13 22:41:=
05 UTC (rev 1315)
+++ humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-13 22:51:=
14 UTC (rev 1316)
@@ -28,7 +28,7 @@
<!-- Here we create an array and use it as parameter for For=
m class constructor -->
<script language=3D"Javascript">
=20
- var ReportParams =3D new ReportParams(new Array(),null,n=
ull); //To be removed
+ //var ReportParams =3D new ReportParams(new Array(),null=
,null); //To be removed
=20
////////////////////////
//The form
@@ -50,7 +50,7 @@
</xsl:for-each>
=20
<xsl:if test=3D"/report/reportDatas/classId!=3D''">
- var Form =3D new Form(formArray,<xsl:value-of select=3D"=
/report/reportDatas/classId" />,ReportParams);
+ var Form =3D new Form(formArray,<xsl:value-of select=3D"=
/report/reportDatas/classId" />);
</xsl:if>
//alert(Form.GetOptionString(0));
=20
|
|
From: <sv...@de...> - 2005-06-13 22:42:36
|
Author: pcamacho
Date: 2005-06-13 18:41:05 -0400 (Mon, 13 Jun 2005)
New Revision: 1315
Modified:
humano2/trunk/web/builder/site/createreport.aspx.cs
humano2/trunk/web/builder/site/js/createreport.js
humano2/trunk/web/builder/site/js/grafcomponents/misc.js
humano2/trunk/web/builder/site/js/grafcomponents/sortedlist.js
humano2/trunk/web/builder/site/xsl/createreport.xsl
humano2/trunk/web/builder/site/xsl/createview.xsl
Log:
CHANGE:=20
* in the interface for creation of the builder, no use of ReportParam cl=
ass.
FIX:
* in report.aspx.cs: unuseful data about attributes from pertinence clas=
s was causing a trouble (same attrib was=20
appearing twice).
Modified: humano2/trunk/web/builder/site/createreport.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/createreport.aspx.cs 2005-06-13 17:43:=
37 UTC (rev 1314)
+++ humano2/trunk/web/builder/site/createreport.aspx.cs 2005-06-13 22:41:=
05 UTC (rev 1315)
@@ -46,6 +46,7 @@
=20
private void Page_Load(object sender, System.EventArgs e)
{
+ Logger.Log("=3D=3D createreport.aspx.cs =3D=3D",LogLevel.Tra=
ce);
reportId =3D Convert.ToInt32(Request["reportId"]);
delete =3D Request["delete"];
receivedCreateUpdate =3D Request["sendCreateUpdate"];
@@ -129,13 +130,13 @@
//relacionadas...
if(Convert.ToInt32(classId) > 0)
{
- strXml +=3D formAttribList(Convert.ToInt32(classId));
+ strXml +=3D getXmlAttribListForClass(Convert.ToInt32(cla=
ssId));
}
strXml +=3D getClassList();
strXml +=3D "</classes>";
strXml +=3D "</report>";
=20
- //Logger.Log("ReportMain: createXml(): " + strXml, LogLevel.=
Trace);
+ Logger.Log("ReportMain: createXml(): " + strXml, LogLevel.Tr=
ace);
=20
return strXml;
}
@@ -771,8 +772,10 @@
=09
}
=20
- // Funcion agregada por negro que solo traera la informacion necesaria=
...
- private string formAttribList(int classId)=20
+ ///<summary>
+ ///Get the attributes of a class
+ ///</summary>
+ private string getXmlAttribListForClass(int classId)=20
{
string salida=3D"";
int attlogin =3D 0;
@@ -828,38 +831,7 @@
}
salida +=3D "</attributes>";
salida +=3D "</class>";
-
- foreach(DataRow row in dt.Select("attType=3D'pertinence'"))=20
- {
- idatt =3D Convert.ToInt32(row["id_entity"]);
- dtpert =3D userCred.CoreAdapter.GetClassesFromPertinence(idatt);
- =20
-
- foreach(DataRow dr in dtpert.Rows)
- {
- idClassRel =3D Convert.ToInt32(dr["to"].ToString());
- dtrel =3D userCred.CoreAdapter.GetAttributesFromClass(idClassRel);
- className =3D dbAdapter.GetClassNameById(idClassRel);
-
- salida +=3D "<class>";
- salida +=3D "<id>" + idClassRel + "</id>";
- salida +=3D "<name>" + className + "</name>";
- salida +=3D "<attributes>";
-
- foreach(DataRow row2 in dtrel.Rows)=20
- {
- string attName =3D Convert.ToString(row2["attName"]);
- className =3D Convert.ToString(dr["name"]);
- //res.Append("<option>"+className+":"+attName+"</option>");
- salida +=3D "<attribute>";
- salida +=3D "<id>" + idatt + "^" + row2["id_entity"].ToString() + =
"</id>";
- salida +=3D "<name>" + className + "." + attName + "</name>";
- salida +=3D "</attribute>";
- }
- salida +=3D "</attributes>";
- salida +=3D "</class>";
- }
- }
+ =20
return salida;
}
=20
Modified: humano2/trunk/web/builder/site/js/createreport.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/createreport.js 2005-06-13 17:43:37=
UTC (rev 1314)
+++ humano2/trunk/web/builder/site/js/createreport.js 2005-06-13 22:41:05=
UTC (rev 1315)
@@ -6,8 +6,8 @@
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version. =20
+// $Id$
//
-//
=20
=20
function AttribsGetSelectArray(formArray,classId)
Property changes on: humano2/trunk/web/builder/site/js/createreport.js
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: humano2/trunk/web/builder/site/js/grafcomponents/misc.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/grafcomponents/misc.js 2005-06-13 1=
7:43:37 UTC (rev 1314)
+++ humano2/trunk/web/builder/site/js/grafcomponents/misc.js 2005-06-13 2=
2:41:05 UTC (rev 1315)
@@ -1,3 +1,15 @@
+//
+// The Humano2 Business solution.
+// Copyright (C) 2004,5 Humano2 Chile S.A. (http://www.humano2.com)
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version. =20
+//
+// $Id$
+//
+
/**
* Gets a tag with its tag name and attribute name.
* Works in IE and Firefox
@@ -31,15 +43,14 @@
function IsInArray(element,tab)
{
var res =3D false;
+ var i;
for(i=3D0;i<tab.length;i++)
{
- //alert("tab" + tab[i] + "/ element: " + element);
if(tab[i] =3D=3D element) =20
{
return true; =20
}
}
- =20
return res;
}
=20
Property changes on: humano2/trunk/web/builder/site/js/grafcomponents/mis=
c.js
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: humano2/trunk/web/builder/site/js/grafcomponents/sortedlist.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/grafcomponents/sortedlist.js 2005-0=
6-13 17:43:37 UTC (rev 1314)
+++ humano2/trunk/web/builder/site/js/grafcomponents/sortedlist.js 2005-0=
6-13 22:41:05 UTC (rev 1315)
@@ -1 +1 @@
-//=0D// The Humano2 Business solution.=0D// Copyright (C) 2004,5 Humano=
2 Chile S.A. (http://www.humano2.com)=0D//=0D// This program is free soft=
ware; you can redistribute it and/or modify=0D// it under the terms of th=
e GNU General Public License as published by=0D// the Free Software Found=
ation; either version 2 of the License, or=0D// (at your option) any late=
r version. =0D//=0D// $Id$=0D//=0D=0D/**=0D * Constructor of ListEleme=
nt=0D */=0Dfunction ListElement(name,value,disabled)=0D{=0D //Fields=0D=
this.name =3D name;=0D this.value =3D value;=0D this.disabled =3D=
disabled;=0D =0D //Methods=0D this.GetName =3D ListElementGetNa=
me;=0D this.GetValue =3D ListElementGetValue;=0D this.GetDisabled =3D=
ListElementGetDisabled;=0D this.SetDisabled =3D ListElementSetDisable=
d;=0D}=0D=0Dfunction ListElementGetDisabled()=0D{ =0D return this.di=
sabled;=0D}=0D=0Dfunction ListElementSetDisabled(disabled)=0D{=0D this=
.disabled =3D disabled; =0D}=0D=0Dfunction ListElementGetValue()=0D{=0D=
return this.value; =0D}=0D=0Dfunction ListElementGetName()=0D{=0D =
return this.name;=0D}=0D=0D=0Dfunction CopyList(src)=0D{=0D var dst=
=3D new Array(); =0D var i =3D 0;=0D for(i=3D0;i<src.length=
;i++)=0D {=0D dst[i] =3D new ListElement( src[i].GetName(),=0D=
src[i].GetValue(),=0D =
src[i].GetDisabled());=0D }=0D =0D return dst;=
=0D}=0D=0D/**=0D* Constructor of a sorted list=0D*/=0Dfunction SortedList=
(itemList)=0D{=0D =0D //Fields copy everything to be indepe=
ndent=0D this.itemList =3D new Array(); =0D =0D =
=0D //Public Methods=0D this.GetItem =3D SortedListGetItem=
;=0D this.ToString =3D SortedListToString;=0D this.ItemUp =3D=
SortedListItemUp;=0D this.ItemDown =3D SortedListItemDown;=0D =
this.Sort =3D SortedListSort;=0D this.ToTop =3D SortedListToTo=
p;=0D this.ToBottom =3D SortedListToBottom;=0D this.Add =3D=
SortedListAdd;=0D this.Replace =3D SortedListReplace;=0D t=
his.Remove =3D SortedListRemove;=0D this.Set =3D SortedListSet;=0D=
this.EnableAll =3D SortedListEnableAll;=0D this.RemoveAll =
=3D SortedListRemoveAll;=0D this.Length =3D SortedListLength;=0D =
=0D //Init the object=0D this.itemList =3D CopyList(i=
temList);=0D}=0D=0D=0D/**=0D* Used to debug=0D*/=0Dfunction SortedListToS=
tring()=0D{=0D str =3D "**** SORTED LIST ****<br>";=0D s=
tr +=3D "<b>itemList</b><br/>: ";=0D var i;=0D //alert("t=
his.itemList[i].length: " + this.itemList.length);=0D for(i=3D0;i=
<this.itemList.length;i++)=0D {=0D str +=3D "("+ i+=
")" + " name:" + this.itemList[i].GetName() + "<br/>";=0D }=0D =
=0D document.write(str);=0D}=0D=0D/**=0D * Get length of l=
ist=0D */=0Dfunction SortedListLength()=0D{=0D return this.itemLis=
t.length; =0D}=0D=0D/**=0D* Simple getter=0D*/=0Dfunction SortedLi=
stGetItem(indexOfItem)=0D{=0D return this.itemList[indexOfItem];=0D=
}=0D=0D=0D/**=0D* Sorts the list=0D*/=0Dfunction SortedListSort()=0D{=0D =
//Bubble sort=0D var sorted =3D false; =0D while( sorted =3D=
=3D false)=0D {=0D var i;=0D sorted =3D true;=0D =
for(i=3D0;i<this.itemList.length-1;i++) =0D {=0D if(=
this.itemList[i].name > this.itemList[i+1].name) //Invert elements=0D =
{=0D var aux =3D this.itemList[i];=0D =
this.itemList[i] =3D this.itemList[i+1];=0D this.ite=
mList[i+1] =3D aux;=0D sorted =3D false;=0D }=0D=
}=0D }=0D}=0D=0D/**=0D* Takes an item and make changes its pla=
ce from p to p-1 in the list=0D* @param indexOfItem the index of item to =
move=0D* @return the new index of item=0D*/=0Dfunction SortedListItemUp(i=
ndexOfItem)=0D{=0D if((indexOfItem =3D=3D 0) || (indexOfItem =3D=3D=
-1))=0D return indexOfItem;=0D var aux =3D this.item=
List[indexOfItem -1];=0D this.itemList[indexOfItem-1] =3D this.item=
List[indexOfItem];=0D this.itemList[indexOfItem] =3D aux;=0D =
=0D return (indexOfItem-1);=0D}=0D=0D=0D/**=0D* Takes an item and m=
ake changes its place from p to p+1 in the list=0D* @param indexOfItem th=
e index of item to move=0D* @return the new index of the item =0D*/ =0Dfu=
nction SortedListItemDown(indexOfItem)=0D{=0D=0D var lastIndex =3D=
this.itemList.length - 1;=0D =0D if( (indexOfItem =3D=3D=
lastIndex) =0D || (indexOfItem =3D=3D -1))=0D =
return indexOfItem;=0D =0D =0D var aux =3D =
this.itemList[indexOfItem+1];=0D this.itemList[indexOfItem+1] =3D =
this.itemList[indexOfItem];=0D this.itemList[indexOfItem] =3D aux;=
=0D =0D return (indexOfItem+1);=0D}=0D =0D/**=0D * Move an =
item to the top of the list=0D */=0Dfunction SortedListToTop(indexOfItem)=
=0D{=0D if((indexOfItem =3D=3D 0) || (indexOfItem =3D=3D -1))=0D =
return;=0D var topReached =3D indexOfItem;=0D =
while (topReached !=3D 0)=0D {=0D topReached =3D =
this.ItemUp(topReached);=0D }=0D}=0D=0Dfunction SortedListToBottom=
(indexOfItem)=0D{=0D if((indexOfItem =3D=3D (this.itemList.length-=
1)) || (indexOfItem =3D=3D -1) )=0D return;=0D var =
topReached =3D indexOfItem;=0D while (topReached !=3D (this.itemLi=
st.length-1))=0D {=0D topReached =3D this.ItemDown(=
topReached);=0D }=0D}=0D=0D/**=0D * Add a new element at the end o=
f the list=0D */=0Dfunction SortedListAdd(value)=0D{=0D //alert("Next =
index: " + this.itemList.length);=0D this.itemList[this.itemList.lengt=
h] =3D value;=0D}=0D=0D/**=0D * Looks for the element in the list that as=
the same id as element=0D * when found replace it by element=0D * if not=
found simply add element to the list=0D */=0Dfunction SortedListReplace(=
element)=0D{=0D var founded =3D false;=0D var i;=0D =0D for(i=
=3D0;i<this.itemList.length;i++)=0D {=0D if(this.itemList[i].Ge=
tValue() =3D=3D element.GetValue()) =0D {=0D founded=
=3D true;=0D this.itemList[i] =3D element;=0D retu=
rn;=0D }=0D }=0D =0D if (founded =3D=3D false)=0D {=0D =
this.Add(element);=0D }=0D}=0D=0D/**=0D * Set the list to a tab=
values=0D * doing a copy=0D */=0Dfunction SortedListSet(values)=0D{=0D =
this.itemList =3D CopyList(values);=0D}=0D=0D=0D/**=0D * Put the disabl=
ed attribute of every element to false=0D */=0Dfunction SortedListEnableA=
ll()=0D{=0D var i;=0D for(i=3D0;i<this.itemList.length;i++)=0D {=
=0D var element =3D this.itemList[i];=0D element.SetDisab=
led(false);=0D }=0D}=0D=0Dfunction SortedListRemoveAll()=0D{=0D thi=
s.itemList =3D new Array(); =0D}=0D=0D=0Dfunction SortedListRemove(ind=
exOfItem)=0D{=0D var newArray =3D new Array();=0D var indexNewArray=
=3D 0;=0D for(var i=3D0;i<this.itemList.length;i++)=0D {=0D =
if(i!=3DindexOfItem)=0D {=0D newArray[=
indexNewArray++] =3D this.itemList[i];=0D }=0D }=0D this=
.itemList =3D newArray;=0D}=0D=0D =0D//////////////////////////////////=0D=
// TESTS =0D/////////////////////////////////=0Dfunction SortedListTest()=
=0D{=0D =0D TestGroupWrite("SortedListTest");=0D =0D=
//ItemUp=0D var list =3D new SortedList( new Array( new =
ListElement("item1","",false),=0D =
new ListElement("item2","",false),=0D =
new ListElement("item3","",false)));=0D =0D =
list.ItemUp(1);=0D Test("ITEMUP","Push the second item up",li=
st.GetItem(0).GetName() =3D=3D 'item2' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item3');=0D =
list.ItemUp(0); =0D Tes=
t("ITEMUP","Push the first item up (no change)",list.GetItem(0).GetName()=
=3D=3D 'item2' =0D && list.GetIte=
m(1).GetName() =3D=3D 'item1'=0D &=
& list.GetItem(2).GetName() =3D=3D 'item3');=0D list.ItemUp(-1); =
=0D Test("ITEMUP","-1: no cha=
nge",list.GetItem(0).GetName() =3D=3D 'item2' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item3')=
;=0D =0D =0D =0D //ItemDown =
=0D var list =3D new SortedList(new Array(new ListEle=
ment("item1","",false),new ListElement("item2","",false),new ListElement(=
"item3","",false)));=0D =0D list.ItemDown(1);=0D Test("ITE=
MDOWN","Push the second item down",list.GetItem(0).GetName() =3D=3D 'item=
1' =0D && list.GetItem(1)=
.GetName() =3D=3D 'item3'=0D && =
list.GetItem(2).GetName() =3D=3D 'item2');=0D =
=0D list.ItemDown(2); =
=0D Test("ITEMDOWN","Push the last item down (no chan=
ge)", list.GetItem(0).GetName() =3D=3D 'item1' =0D =
&& list.GetItem(1).GetName() =3D=3D=
'item3'=0D && =
list.GetItem(2).GetName() =3D=3D 'item2');=0D =0D l=
ist.ItemDown(-1); =0D Test("=
ITEMDOWN","-1 :no change",list.GetItem(0).GetName() =3D=3D 'item1' =0D =
&& list.GetItem(1).GetName() =3D=3D =
'item3'=0D && list.GetItem(2).GetN=
ame() =3D=3D 'item2');=0D =0D //ToTop=0D var list =3D=
new SortedList(new Array(new ListElement("item1"),=0D =
new ListElement("item2"),=0D =
new ListElement("item3"),=0D =
new ListElement("item4")));=0D =0D l=
ist.ToTop(3);=0D Test("ITEMTOTOP","Push the last item to the top o=
f list",list.GetItem(0).GetName() =3D=3D 'item4' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item=
2'=0D && list.GetItem(3).GetName()=
=3D=3D 'item3');=0D =0D list.ToTop(0); =
=0D Test("ITEMTOTOP","Push the first item to th=
e top (no change)", list.GetItem(0).GetName() =3D=3D 'item4' =0D =
&& list.GetI=
tem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item2'=
=0D && =
list.GetItem(3).GetName() =3D=3D 'item3');=0D list.ToTop(-1); =
=0D Test("ITEMTOTOP","-1: no c=
hange",list.GetItem(0).GetName() =3D=3D 'item4' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item2=
'=0D && list.GetItem(3).GetName() =
=3D=3D 'item3');=0D =0D =0D //ToBottom=0D var=
list =3D new SortedList(new Array(new ListElement("item1"),=0D =
new ListElement("item2"),=0D =
new ListElement("item3"),=0D =
new ListElement("item4")));=0D =0D=
list.ToBottom(0);=0D Test("ITEMTOBOTTOM","Push the first i=
tem to the bottom of list",list.GetItem(0).GetName() =3D=3D 'item2' =0D =
&& list.GetItem(1).GetName() =3D=3D=
'item3'=0D && list.GetItem(2).Get=
Name() =3D=3D 'item4'=0D && list.G=
etItem(3).GetName() =3D=3D 'item1');=0D =0D list.ToBottom(3=
); =0D Test("ITEMTOBOTTOM","=
Push the last item to the bottom (no change)",list.GetItem(0).GetName() =3D=
=3D 'item2' =0D && list.GetItem(1)=
.GetName() =3D=3D 'item3'=0D && li=
st.GetItem(2).GetName() =3D=3D 'item4'=0D =
&& list.GetItem(3).GetName() =3D=3D 'item1');=0D =0D =
list.ToBottom(-1); =0D Tes=
t("ITEMTOBOTTOM","-1: no change",list.GetItem(0).GetName() =3D=3D 'item2'=
=0D && list.GetItem(1).GetName() =
=3D=3D 'item3'=0D && list.GetItem(=
2).GetName() =3D=3D 'item4'=0D && =
list.GetItem(3).GetName() =3D=3D 'item1');=0D //Sort=0D var=
list =3D new SortedList(new Array(new ListElement("Marijn"),new ListElem=
ent("Sebastian"),new ListElement("Philippe")));=0D list.Sort();=0D=
Test("SORT","Sorts the list",list.GetItem(0).GetName()=3D=3D"Mari=
jn"=0D && list.GetItem(1).GetName(=
) =3D=3D "Philippe"=0D && list.Get=
Item(2).GetName() =3D=3D "Sebastian");=0D =0D =
//Add=0D var list =3D new SortedList(new Array(new ListElemen=
t("Marijn"),new ListElement("Sebastian"),new ListElement("Philippe")));=0D=
list.Add(new ListElement("Rodrigo"));=0D Test("ADD","Add a=
n element to the list",list.GetItem(0).GetName()=3D=3D"Marijn"=0D =
&& list.GetItem(1).GetName() =3D=3D "Seba=
stian"=0D && list.GetItem(2).GetNa=
me() =3D=3D "Philippe"=0D && list.=
GetItem(3).GetName() =3D=3D "Rodrigo"); =0D =
=0D //Remove=0D var list =3D new SortedList(n=
ew Array(new ListElement("Marijn"),new ListElement("Sebastian"),new ListE=
lement("Philippe")));=0D list.Remove(1);=0D Test("REMOVE","=
Remove an element from the list",list.GetItem(0).GetName()=3D=3D"Marijn"=0D=
&& list.GetItem(1=
).GetName() =3D=3D "Philippe")=0D =
=0D =
=0D //EnableAll =
=0D var list =3D new SortedList(new Array(new ListElement("=
Marijn","",true),=0D new ListE=
lement("Sebastian","",false),=0D =
new ListElement("Sebastian","",true)));=0D list.EnableAll();=0D=
Test("ENABLEALL","Enable all elements of the list", list.GetI=
tem(0).GetDisabled()=3D=3Dfalse=0D =
&& list.GetItem(1).GetDisabled()=3D=3Dfalse=0D =
&& list.GetItem(2=
).GetDisabled()=3D=3Dfalse); =0D =
=0D //RemoveAll =
=0D var list =3D new SortedList(new=
Array(new ListElement("Marijn"),new ListElement("Sebastian"),new ListEle=
ment("Philippe")));=0D list.RemoveAll();=0D Test("REMOVEALL=
","Remove all elements of the list",list.Length()=3D=3D0);=0D =0D =
=0D //SetToDefault=0D var list =3D new SortedList(ne=
w Array(new ListElement("Marijn"),new ListElement("Sebastian"),new ListEl=
ement("Philippe")));=0D list.Set(new Array(new ListElement("Paris"=
),new ListElement("Lyon"),new ListElement("Marseille")));=0D Test(=
"SET","Set the elements of the list",list.Length()=3D=3D3 =0D =
&& list.GetItem(0).GetName()=3D=3D=
"Paris"=0D && list.Get=
Item(1).GetName()=3D=3D"Lyon"=0D =
&& list.GetItem(2).GetName()=3D=3D"Marseille");=0D=0D /=
/Replace=0D var list =3D new SortedList(new Array(new ListElement(=
"Marijn","1",false),=0D new Li=
stElement("Sebastian","2",false),=0D =
new ListElement("Philippe","3",false)));=0D =0D var =
element =3D new ListElement("Mozart","1",false);=0D list.Replace(e=
lement); =0D Test("REPLACE","Replace the first element of t=
he list (1)",=0D li=
st.GetItem(0).GetName()=3D=3D"Mozart"=0D =
&& list.GetItem(1).GetName()=3D=3D"Sebastian"=0D =
&& list.GetItem(2).GetName(=
)=3D=3D"Philippe"); =0D element =3D new ListElement("Lulu","4",fal=
se); =0D list.R=
eplace(element); =0D Test("REPLACE","Replace the first element o=
f the list (2)", list.Length() =3D=3D 4 =0D =
&& list.GetItem(0).GetName()=3D=3D"Mozart"=0D =
&& list.GetItem(1).GetName(=
)=3D=3D"Sebastian"=0D =
&& list.GetItem(2).GetName()=3D=3D"Philippe"=0D =
&& list.GetItem(3).GetName()=3D=3D"Lulu");=0D =
=0D //Length =
=0D var list =3D new S=
ortedList(new Array(new ListElement("Marijn"),new ListElement("Sebastian"=
),new ListElement("Philippe")));=0D var length =3D list.Length();=0D=
Test("LENGTH","Length of list",length =3D=3D 3);=0D}=0D=20
\ No newline at end of file
+//=0D// The Humano2 Business solution.=0D// Copyright (C) 2004,5 Humano=
2 Chile S.A. (http://www.humano2.com)=0D//=0D// This program is free soft=
ware; you can redistribute it and/or modify=0D// it under the terms of th=
e GNU General Public License as published by=0D// the Free Software Found=
ation; either version 2 of the License, or=0D// (at your option) any late=
r version. =0D//=0D// $Id$=0D//=0D=0D/**=0D * Constructor of ListEleme=
nt=0D */=0Dfunction ListElement(name,value,disabled)=0D{=0D //Fields=0D=
this.name =3D name;=0D this.value =3D value;=0D this.disabled =3D=
disabled;=0D =0D //Methods=0D this.GetName =3D ListElementGetNa=
me;=0D this.GetValue =3D ListElementGetValue;=0D this.GetDisabled =3D=
ListElementGetDisabled;=0D this.SetDisabled =3D ListElementSetDisable=
d;=0D}=0D=0Dfunction ListElementGetDisabled()=0D{ =0D return this.di=
sabled;=0D}=0D=0Dfunction ListElementSetDisabled(disabled)=0D{=0D this=
.disabled =3D disabled; =0D}=0D=0Dfunction ListElementGetValue()=0D{=0D=
return this.value; =0D}=0D=0Dfunction ListElementGetName()=0D{=0D =
return this.name;=0D}=0D=0D=0Dfunction CopyList(src)=0D{=0D var dst=
=3D new Array(); =0D var i =3D 0;=0D =0D for(i=3D0;i<src=
.length;i++)=0D {=0D dst[i] =3D new ListElement( src[i].GetNam=
e(),=0D src[i].GetValue(),=0D =
src[i].GetDisabled());=0D }=0D =0D retu=
rn dst;=0D}=0D=0D/**=0D* Constructor of a sorted list=0D*/=0Dfunction Sor=
tedList(itemList)=0D{=0D =0D //Fields copy everything to be=
independent=0D this.itemList =3D new Array(); =0D =0D=
=0D //Public Methods=0D this.GetItem =3D SortedList=
GetItem;=0D this.ToString =3D SortedListToString;=0D this.I=
temUp =3D SortedListItemUp;=0D this.ItemDown =3D SortedListItemDow=
n;=0D this.Sort =3D SortedListSort;=0D this.ToTop =3D Sorte=
dListToTop;=0D this.ToBottom =3D SortedListToBottom;=0D thi=
s.Add =3D SortedListAdd;=0D this.Replace =3D SortedListReplace;=0D=
this.Remove =3D SortedListRemove;=0D this.Set =3D SortedLi=
stSet;=0D this.EnableAll =3D SortedListEnableAll;=0D this.R=
emoveAll =3D SortedListRemoveAll;=0D this.Length =3D SortedListLen=
gth;=0D =0D //Init the object=0D this.itemList =3D C=
opyList(itemList);=0D}=0D=0D=0D/**=0D* Used to debug=0D*/=0Dfunction Sort=
edListToString()=0D{=0D str =3D "**** SORTED LIST ****<br>";=0D =
str +=3D "<b>itemList</b><br/>: ";=0D var i;=0D /=
/alert("this.itemList[i].length: " + this.itemList.length);=0D fo=
r(i=3D0;i<this.itemList.length;i++)=0D {=0D str +=3D=
"("+ i+ ")" + " name:" + this.itemList[i].GetName() + "<br/>";=0D =
}=0D =0D document.write(str);=0D}=0D=0D/**=0D * Get len=
gth of list=0D */=0Dfunction SortedListLength()=0D{=0D return this=
.itemList.length; =0D}=0D=0D/**=0D* Simple getter=0D*/=0Dfunction =
SortedListGetItem(indexOfItem)=0D{=0D return this.itemList[indexOf=
Item];=0D}=0D=0D=0D/**=0D* Sorts the list=0D*/=0Dfunction SortedListSort(=
)=0D{=0D //Bubble sort=0D var sorted =3D false; =0D while( s=
orted =3D=3D false)=0D {=0D var i;=0D sorted =3D true;=0D=
for(i=3D0;i<this.itemList.length-1;i++) =0D {=0D =
if(this.itemList[i].name > this.itemList[i+1].name) //Invert elem=
ents=0D {=0D var aux =3D this.itemList[i];=0D =
this.itemList[i] =3D this.itemList[i+1];=0D =
this.itemList[i+1] =3D aux;=0D sorted =3D false;=0D =
}=0D }=0D }=0D}=0D=0D/**=0D* Takes an item and make change=
s its place from p to p-1 in the list=0D* @param indexOfItem the index of=
item to move=0D* @return the new index of item=0D*/=0Dfunction SortedLis=
tItemUp(indexOfItem)=0D{=0D if((indexOfItem =3D=3D 0) || (indexOfIt=
em =3D=3D -1))=0D return indexOfItem;=0D var aux =3D =
this.itemList[indexOfItem -1];=0D this.itemList[indexOfItem-1] =3D =
this.itemList[indexOfItem];=0D this.itemList[indexOfItem] =3D aux;=0D=
=0D return (indexOfItem-1);=0D}=0D=0D=0D/**=0D* Takes an ite=
m and make changes its place from p to p+1 in the list=0D* @param indexOf=
Item the index of item to move=0D* @return the new index of the item =0D*=
/ =0Dfunction SortedListItemDown(indexOfItem)=0D{=0D=0D var lastIn=
dex =3D this.itemList.length - 1;=0D =0D if( (indexOfIt=
em =3D=3D lastIndex) =0D || (indexOfItem =3D=3D -1))=0D =
return indexOfItem;=0D =0D =0D var=
aux =3D this.itemList[indexOfItem+1];=0D this.itemList[indexOfIte=
m+1] =3D this.itemList[indexOfItem];=0D this.itemList[indexOfItem]=
=3D aux;=0D =0D return (indexOfItem+1);=0D}=0D =0D/**=0D *=
Move an item to the top of the list=0D */=0Dfunction SortedListToTop(ind=
exOfItem)=0D{=0D if((indexOfItem =3D=3D 0) || (indexOfItem =3D=3D=
-1))=0D return;=0D var topReached =3D indexOfItem;=
=0D while (topReached !=3D 0)=0D {=0D topRea=
ched =3D this.ItemUp(topReached);=0D }=0D}=0D=0Dfunction SortedLis=
tToBottom(indexOfItem)=0D{=0D if((indexOfItem =3D=3D (this.itemLis=
t.length-1)) || (indexOfItem =3D=3D -1) )=0D return;=0D =
var topReached =3D indexOfItem;=0D while (topReached !=3D (th=
is.itemList.length-1))=0D {=0D topReached =3D this.=
ItemDown(topReached);=0D }=0D}=0D=0D/**=0D * Add a new element at =
the end of the list=0D */=0Dfunction SortedListAdd(value)=0D{=0D //ale=
rt("Next index: " + this.itemList.length);=0D this.itemList[this.itemL=
ist.length] =3D value;=0D}=0D=0D/**=0D * Looks for the element in the lis=
t that as the same id as element=0D * when found replace it by element=0D=
* if not found simply add element to the list=0D */=0Dfunction SortedLis=
tReplace(element)=0D{=0D var founded =3D false;=0D var i;=0D =0D=
for(i=3D0;i<this.itemList.length;i++)=0D {=0D if(this.itemL=
ist[i].GetValue() =3D=3D element.GetValue()) =0D {=0D =
founded =3D true;=0D this.itemList[i] =3D element;=0D =
return;=0D }=0D }=0D =0D if (founded =3D=3D false)=0D=
{=0D this.Add(element);=0D }=0D}=0D=0D/**=0D * Set the list=
to a tab values=0D * doing a copy=0D */=0Dfunction SortedListSet(values)=
=0D{=0D this.itemList =3D CopyList(values);=0D}=0D=0D=0D/**=0D * Put t=
he disabled attribute of every element to false=0D */=0Dfunction SortedLi=
stEnableAll()=0D{=0D var i;=0D for(i=3D0;i<this.itemList.length;i++=
)=0D {=0D var element =3D this.itemList[i];=0D element=
.SetDisabled(false);=0D }=0D}=0D=0Dfunction SortedListRemoveAll()=0D{=0D=
this.itemList =3D new Array(); =0D}=0D=0D=0Dfunction SortedListRem=
ove(indexOfItem)=0D{=0D var newArray =3D new Array();=0D var indexN=
ewArray =3D 0;=0D for(var i=3D0;i<this.itemList.length;i++)=0D {=0D=
if(i!=3DindexOfItem)=0D {=0D ne=
wArray[indexNewArray++] =3D this.itemList[i];=0D }=0D }=0D =
this.itemList =3D newArray;=0D}=0D=0D =0D/////////////////////////////=
/////=0D// TESTS =0D/////////////////////////////////=0Dfunction SortedLi=
stTest()=0D{=0D =0D TestGroupWrite("SortedListTest");=0D =
=0D //ItemUp=0D var list =3D new SortedList( new Arra=
y( new ListElement("item1","",false),=0D =
new ListElement("item2","",false),=0D =
new ListElement("item3","",false)));=0D =
=0D list.ItemUp(1);=0D Test("ITEMUP","Push the second ite=
m up",list.GetItem(0).GetName() =3D=3D 'item2' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item3'=
);=0D list.ItemUp(0); =0D =
Test("ITEMUP","Push the first item up (no change)",list.GetItem(0).G=
etName() =3D=3D 'item2' =0D && lis=
t.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item3');=0D list.ItemU=
p(-1); =0D Test("ITEMUP","-1=
: no change",list.GetItem(0).GetName() =3D=3D 'item2' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D =
'item3');=0D =0D =0D =0D //ItemDown =
=0D var list =3D new SortedList(new Array(new=
ListElement("item1","",false),new ListElement("item2","",false),new List=
Element("item3","",false)));=0D =0D list.ItemDown(1);=0D T=
est("ITEMDOWN","Push the second item down",list.GetItem(0).GetName() =3D=3D=
'item1' =0D && list.GetI=
tem(1).GetName() =3D=3D 'item3'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item2');=0D =
=0D list.ItemDown(2); =
=0D Test("ITEMDOWN","Push the last item down (n=
o change)", list.GetItem(0).GetName() =3D=3D 'item1' =0D =
&& list.GetItem(1).GetName()=
=3D=3D 'item3'=0D && =
list.GetItem(2).GetName() =3D=3D 'item2');=0D =0D =
list.ItemDown(-1); =0D =
Test("ITEMDOWN","-1 :no change",list.GetItem(0).GetName() =3D=3D 'item1'=
=0D && list.GetItem(1).GetName() =
=3D=3D 'item3'=0D && list.GetItem(=
2).GetName() =3D=3D 'item2');=0D =0D //ToTop=0D var =
list =3D new SortedList(new Array(new ListElement("item1"),=0D =
new ListElement("item2"),=0D =
new ListElement("item3"),=0D =
new ListElement("item4")));=0D =0D =
list.ToTop(3);=0D Test("ITEMTOTOP","Push the last item to t=
he top of list",list.GetItem(0).GetName() =3D=3D 'item4' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item1'=0D=
&& list.GetItem(2).GetName() =3D=3D=
'item2'=0D && list.GetItem(3).Get=
Name() =3D=3D 'item3');=0D =0D list.ToTop(0); =
=0D Test("ITEMTOTOP","Push the first item=
to the top (no change)", list.GetItem(0).GetName() =3D=3D 'item4' =0D =
&& lis=
t.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D '=
item2'=0D && =
list.GetItem(3).GetName() =3D=3D 'item3');=0D list.ToTop(-=
1); =0D Test("ITEMTOTOP","-1=
: no change",list.GetItem(0).GetName() =3D=3D 'item4' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D =
'item2'=0D && list.GetItem(3).GetN=
ame() =3D=3D 'item3');=0D =0D =0D //ToBottom=0D =
var list =3D new SortedList(new Array(new ListElement("item1"),=0D =
new ListElement("item2"),=0D =
new ListElement("item3"),=0D =
new ListElement("item4")));=0D =
=0D list.ToBottom(0);=0D Test("ITEMTOBOTTOM","Push the f=
irst item to the bottom of list",list.GetItem(0).GetName() =3D=3D 'item2'=
=0D && list.GetItem(1).GetName() =
=3D=3D 'item3'=0D && list.GetItem(=
2).GetName() =3D=3D 'item4'=0D && =
list.GetItem(3).GetName() =3D=3D 'item1');=0D =0D list.ToBo=
ttom(3); =0D Test("ITEMTOBOT=
TOM","Push the last item to the bottom (no change)",list.GetItem(0).GetNa=
me() =3D=3D 'item2' =0D && list.Ge=
tItem(1).GetName() =3D=3D 'item3'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item4'=0D =
&& list.GetItem(3).GetName() =3D=3D 'item1');=0D =0D=
list.ToBottom(-1); =0D =
Test("ITEMTOBOTTOM","-1: no change",list.GetItem(0).GetName() =3D=3D '=
item2' =0D && list.GetItem(1).GetN=
ame() =3D=3D 'item3'=0D && list.Ge=
tItem(2).GetName() =3D=3D 'item4'=0D =
&& list.GetItem(3).GetName() =3D=3D 'item1');=0D //Sort=0D =
var list =3D new SortedList(new Array(new ListElement("Marijn"),new Li=
stElement("Sebastian"),new ListElement("Philippe")));=0D list.Sort=
();=0D Test("SORT","Sorts the list",list.GetItem(0).GetName()=3D=3D=
"Marijn"=0D && list.GetItem(1).Get=
Name() =3D=3D "Philippe"=0D && lis=
t.GetItem(2).GetName() =3D=3D "Sebastian");=0D =0D=
//Add=0D var list =3D new SortedList(new Array(new ListEle=
ment("Marijn"),new ListElement("Sebastian"),new ListElement("Philippe")))=
;=0D list.Add(new ListElement("Rodrigo"));=0D Test("ADD","A=
dd an element to the list",list.GetItem(0).GetName()=3D=3D"Marijn"=0D =
&& list.GetItem(1).GetName() =3D=3D "=
Sebastian"=0D && list.GetItem(2).G=
etName() =3D=3D "Philippe"=0D && l=
ist.GetItem(3).GetName() =3D=3D "Rodrigo"); =0D =
=0D //Remove=0D var list =3D new SortedLi=
st(new Array(new ListElement("Marijn"),new ListElement("Sebastian"),new L=
istElement("Philippe")));=0D list.Remove(1);=0D Test("REMOV=
E","Remove an element from the list",list.GetItem(0).GetName()=3D=3D"Mari=
jn"=0D && list.Get=
Item(1).GetName() =3D=3D "Philippe")=0D =
=0D =
=0D //EnableAll =
=0D var list =3D new SortedList(new Array(new ListEle=
ment("Marijn","",true),=0D new=
ListElement("Sebastian","",false),=0D =
new ListElement("Sebastian","",true)));=0D list.EnableAll=
();=0D Test("ENABLEALL","Enable all elements of the list", lis=
t.GetItem(0).GetDisabled()=3D=3Dfalse=0D =
&& list.GetItem(1).GetDisabled()=3D=3Dfalse=0D=
&& list.GetI=
tem(2).GetDisabled()=3D=3Dfalse); =0D =
=0D //RemoveAll =
=0D var list =3D new SortedLis=
t(new Array(new ListElement("Marijn"),new ListElement("Sebastian"),new Li=
stElement("Philippe")));=0D list.RemoveAll();=0D Test("REMO=
VEALL","Remove all elements of the list",list.Length()=3D=3D0);=0D =
=0D =0D //SetToDefault=0D var list =3D new SortedLi=
st(new Array(new ListElement("Marijn"),new ListElement("Sebastian"),new L=
istElement("Philippe")));=0D list.Set(new Array(new ListElement("P=
aris"),new ListElement("Lyon"),new ListElement("Marseille")));=0D =
Test("SET","Set the elements of the list",list.Length()=3D=3D3 =0D =
&& list.GetItem(0).GetName()=3D=
=3D"Paris"=0D && list.=
GetItem(1).GetName()=3D=3D"Lyon"=0D =
&& list.GetItem(2).GetName()=3D=3D"Marseille");=0D=0D =
//Replace=0D var list =3D new SortedList(new Array(new ListEleme=
nt("Marijn","1",false),=0D new=
ListElement("Sebastian","2",false),=0D =
new ListElement("Philippe","3",false)));=0D =0D v=
ar element =3D new ListElement("Mozart","1",false);=0D list.Replac=
e(element); =0D Test("REPLACE","Replace the first element o=
f the list (1)",=0D =
list.GetItem(0).GetName()=3D=3D"Mozart"=0D =
&& list.GetItem(1).GetName()=3D=3D"Sebastian"=0D =
&& list.GetItem(2).GetNa=
me()=3D=3D"Philippe"); =0D element =3D new ListElement("Lulu","4",=
false); =0D lis=
t.Replace(element); =0D Test("REPLACE","Replace the first elemen=
t of the list (2)", list.Length() =3D=3D 4 =0D =
&& list.GetItem(0).GetName()=3D=3D"Mozart"=0D =
&& list.GetItem(1).GetNa=
me()=3D=3D"Sebastian"=0D =
&& list.GetItem(2).GetName()=3D=3D"Philippe"=0D =
&& list.GetItem(3).GetName()=3D=3D"Lulu");=0D=
=0D //Length =
=0D var list =3D new=
SortedList(new Array(new ListElement("Marijn"),new ListElement("Sebastia=
n"),new ListElement("Philippe")));=0D var length =3D list.Length()=
;=0D Test("LENGTH","Length of list",length =3D=3D 3);=0D}=0D=20
\ No newline at end of file
Modified: humano2/trunk/web/builder/site/xsl/createreport.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-13 17:43:=
37 UTC (rev 1314)
+++ humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-13 22:41:=
05 UTC (rev 1315)
@@ -25,22 +25,11 @@
<script language=3D"Javascript" src=3D"js/createreport.js" t=
ype=3D"text/javascript"></script>=20
<link href=3D"css/createinterface.css" rel=3D"stylesheet" ty=
pe=3D"text/css"></link>
=20
- =09
<!-- Here we create an array and use it as parameter for For=
m class constructor -->
<script language=3D"Javascript">
=20
- //////////////////////
- //The report params
+ var ReportParams =3D new ReportParams(new Array(),null,n=
ull); //To be removed
=20
- //Columns
- var reportColumnsArray =3D new Array();
- var i=3D0;
- <xsl:for-each select=3D"/report/reportDatas/reportParams=
/columns/column">
- reportColumnsArray[i++] =3D "<xsl:value-of select=3D=
"." />";
- </xsl:for-each>
- //alert(reportColumnsArray.length);
- var ReportParams =3D new ReportParams(reportColumnsArray=
,null,null);
- =20
////////////////////////
//The form
var formArray =3D new Array();
@@ -65,6 +54,103 @@
</xsl:if>
//alert(Form.GetOptionString(0));
=20
+ =20
+ ///////////////
+ /// The columns of attributes (group columns)
+ var attribsArr =3D new Array();
+ var item;
+ var i=3D0;
+ <xsl:for-each select=3D"/report/classes/class[count(attr=
ibutes)>0]/attributes/attribute"> //Get all attributes
+ <xsl:variable name=3D"classId">
+ <xsl:value-of select=3D"id" />
+ </xsl:variable>
+ var item =3D new ListElement("<xsl:value-of select=3D=
"name" />","<xsl:value-of select=3D"id"/>",false);
+ attribsArr[i] =3D item;
+ i++;
+ </xsl:for-each>
+ var sizeAttribsArr =3D attribsArr.length;
+ <xsl:if test=3D"/report/reportDatas/name=3D''"> <!-- Cre=
ation -->
+ <![CDATA[
+ //Now builds left and right array for columns
+ var maxPreSelectedNum =3D sizeAttribsArr;
+ =20
+ if(maxPreSelectedNum < 3)
+ {
+ maxPreSelectedNum =3D 0;
+ }
+ else
+ {
+ maxPreSelectedNum =3D 3;=20
+ }
+ var leftAttribsArr =3D new Array();=20
+ var rightAttribsArr =3D new Array();
+ var i=3D0;
+ for(i=3D0;i<maxPreSelectedNum;i++)
+ {
+ rightAttribsArr[i] =3D new ListElement(attri=
bsArr[i].GetName(),attribsArr[i].GetValue(),false);
+ }
+ =20
+ var i=3D0;
+ for(i=3D0;i<sizeAttribsArr;i++)
+ {
+ leftAttribsArr[i] =3D new ListElement(attrib=
sArr[i].GetName(),attribsArr[i].GetValue(),false);
+ if(i<maxPreSelectedNum)
+ {
+ leftAttribsArr[i].SetDisabled(true);
+ }
+ }
+ ]]>
+ </xsl:if>
+ <xsl:if test=3D"report/reportDatas/name!=3D''"> <!-- Upd=
ate -->
+ =20
+ //Columns
+ var reportColumnsArray =3D new Array();
+ var i=3D0;
+ <xsl:for-each select=3D"/report/reportDatas/reportPa=
rams/columns/column">
+ reportColumnsArray[i++] =3D "<xsl:value-of selec=
t=3D"." />";
+ </xsl:for-each>
+ //alert(reportColumnsArray.length);
+ =20
+ <![CDATA[
+ var leftAttribsArr =3D new Array();
+ var rightAttribsArr =3D new Array();
+ var j=3D0;
+ var i=3D0;
+ //alert("size: " + sizeAttribsArr);
+ for(i=3D0;i<sizeAttribsArr;i++)
+ {
+ var idAtt =3D attribsArr[i].GetValue();
+ =20
+ if(IsInArray(idAtt,reportColumnsArray) =3D=3D=
true)
+ {
+ //The left array
+ var element =3D new ListElement( attrib=
sArr[i].GetName(),
+ attribsA=
rr[i].GetValue(),
+ true);
+ leftAttribsArr[i] =3D element; =20
+ //The right array: the element
+ //alert(attribsArr[i].GetName());
+ var element =3D new ListElement( attrib=
sArr[i].GetName(),
+ attribsA=
rr[i].GetValue(),
+ false);
+ this.rightAttribsArr[j++] =3D element; =
=20
+ }
+ else
+ {
+ //The left array
+ //alert(attribsArr[i].GetName());
+ var element =3D new ListElement( attrib=
sArr[i].GetName(),
+ attribsA=
rr[i].GetValue(),
+ false);
+ leftAttribsArr[i] =3D element; =20
+ //The right array: nothing=20
+ }
+ =20
+ }
+ ]]>
+ </xsl:if>
+ =20
+ =20
//Filters =20
var selectOption0ArrayFilter =3D new Array();
var selectOption1ArrayFilter =3D new Array();
@@ -371,53 +457,53 @@
<tr>
<td class=3D"smallgraytextnolink" c=
olspan=3D"2">
<table>
- <tr>
- <td>
- <div id=3D"ColumnsToShow=
Left" ondblclick=3D"leftColumn.Move(leftColumn.GetSelectedIndex(),rightCo=
lumn,false);">
- </div>
- </td>
- <td>
- <center>
- <input type=3D"butto=
n"=20
- width=3D"20"
- value=3D">>=
;"=20
- onclick =3D "lef=
tColumn.Move(leftColumn.GetSelectedIndex(),rightColumn,false);"></input>
+ <tr>
+ <td>
+ <div id=3D"ColumnsTo=
ShowLeft" ondblclick=3D"leftColumn.Move(leftColumn.GetSelectedIndex(),rig=
htColumn,false);">
+ </div>
+ </td>
+ <td>
+ <center>
+ <input type=3D"b=
utton"=20
+ width=3D"20"
+ value=3D">=
;>"=20
+ onclick =3D =
"leftColumn.Move(leftColumn.GetSelectedIndex(),rightColumn,false);"></inp=
ut>
+ <br/>
+ <input type=3D"=
button"=20
+ width=3D=
"20"
+ value=3D=
"<<"=20
+ onclick =
=3D "rightColumn.Move(rightColumn.GetSelectedIndex(),leftColumn,true);"><=
/input>
+ </center>
+ </td>
+ <td>
+ <div id=3D"ColumnsTo=
ShowRight" ondblclick=3D"rightColumn.Move(rightColumn.GetSelectedIndex(),=
leftColumn,true);">
+ </div>
+ </td>
+ <td>
+ <a href=3D"#" onclic=
k=3D"rightColumn.Top(rightColumn.GetSelectedIndex())">
+ <img src=3D"img/=
upuparrow.gif" border=3D"0"/>
+ </a>
<br/>
- <input type=3D"butt=
on"=20
- width=3D"20"
- value=3D"<=
;<"=20
- onclick =3D =
"rightColumn.Move(rightColumn.GetSelectedIndex(),leftColumn,true);"></inp=
ut>
- </center>
- </td>
- <td>
- <div id=3D"ColumnsToShow=
Right" ondblclick=3D"rightColumn.Move(rightColumn.GetSelectedIndex(),left=
Column,true);">
- </div>
- </td>
- <td>
- <a href=3D"#" onclick=3D=
"rightColumn.Top(rightColumn.GetSelectedIndex())">
- <img src=3D"img/upup=
arrow.gif" border=3D"0"/>
- </a>
- <br/>
- <a href=3D"#" onclick=3D=
"rightColumn.Up(rightColumn.GetSelectedIndex())">
- <img src=3D"img/upar=
row.gif" border=3D"0" />
- </a>
- <br/>
- <a href=3D"#" onclick=3D=
"rightColumn.Down(rightColumn.GetSelectedIndex())">
- <img src=3D"img/down=
arrow.gif" border=3D"0" />
- </a>
- <br/>
- <a href=3D"#" onclick=3D=
"rightColumn.Bottom(rightColumn.GetSelectedIndex())">
- <img src=3D"img/down=
downarrow.gif" border=3D"0" />
- </a>
- </td>
- <td>
- <input type=3D"button" v=
alue=3D"SetToDefault"=20
- onclick=3D"leftColum=
n.SetToDefault();rightColumn.SetToDefault();"></input>
- <br/>
- <!-- Do not forget to en=
able all item of the left list -->
- <input type=3D"button" v=
alue=3D"RemoveAll" onclick=3D"leftColumn.EnableAll();rightColumn.RemoveAl=
l();"></input>
- </td>
- </tr>
+ <a href=3D"#" onclic=
k=3D"rightColumn.Up(rightColumn.GetSelectedIndex())">
+ <img src=3D"img/=
uparrow.gif" border=3D"0" />
+ </a>
+ <br/>
+ <a href=3D"#" onclic=
k=3D"rightColumn.Down(rightColumn.GetSelectedIndex())">
+ <img src=3D"img/=
downarrow.gif" border=3D"0" />
+ </a>
+ <br/>
+ <a href=3D"#" onclic=
k=3D"rightColumn.Bottom(rightColumn.GetSelectedIndex())">
+ <img src=3D"img/=
downdownarrow.gif" border=3D"0" />
+ </a>
+ </td>
+ <td>
+ <input type=3D"butto=
n" value=3D"SetToDefault"=20
+ onclick=3D"leftC=
olumn.SetToDefault();rightColumn.SetToDefault();"></input>
+ <br/>
+ <!-- Do not forget t=
o enable all item of the left list -->
+ <input type=3D"butto=
n" value=3D"RemoveAll" onclick=3D"leftColumn.EnableAll();rightColumn.Remo=
veAll();"></input>
+ </td>
+ </tr>
</table>
<script>
//First List
@@ -426,7 +512,7 @@
{
divReceptor: divColumnsT=
oShowLeft,
showButtons: false,
- itemList: Form.GetLeftAt=
t(),
+ itemList: leftAttribsArr=
,
selfRefName: "leftColumn=
"
}
var leftColumn =3D new Sorte=
dGraphicalList(leftColumnParams);
@@ -437,7 +523,7 @@
{
divReceptor: divColumnsT=
oShowRight,
...
[truncated message content] |
|
From: <sv...@de...> - 2005-06-13 17:43:38
|
Author: marcelo Date: 2005-06-13 13:43:37 -0400 (Mon, 13 Jun 2005) New Revision: 1314 Modified: humano2/trunk/INSTALL-LINUX.en.txt humano2/trunk/INSTALL-LINUX.es.txt Log: * Merge of marijns changes. Modified: humano2/trunk/INSTALL-LINUX.en.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/INSTALL-LINUX.en.txt 2005-06-13 16:24:00 UTC (rev 1313) +++ humano2/trunk/INSTALL-LINUX.en.txt 2005-06-13 17:43:37 UTC (rev 1314) @@ -17,17 +17,19 @@ ./configure -with-preview=3Dyes (It is needed to compile XPS) =20 - 2. Get and install PostgreSQL ( http://www.postgresql.org ) (version >=3D= 8.0.3 se debe usar) + 2. Get and install PostgreSQL 8.0 or later ( http://www.postgresql.org = )=20 3. Get XSP (http://www.go-mono.com/archive/1.0.6/xsp-1.0.6.tar.gz) - =20 -=20 + 4. Get the latest Humano2 source code=20 + ( http://sourceforge.net/project/showfiles.php?group_id=3D117865&pac= kage_id=3D152308 ) + Compiling: - 1. Get the latest Humano2 source code (http://devel.humano2.org/release= s/) - 2. Compile the code with make: + 1. Compile the code with make: =20 $ make =20 -The Database: +Creating The Database: +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + 1. Create the database with the UNICODE encoding=20 =20 (creating database "h2_solution"): @@ -49,7 +51,7 @@ =20 host all all 10.1.11.0 255.255.255.0 md5 =20 - =20 + =20 =20 Configuring the system: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -65,7 +67,10 @@ bin . <session> The complete path of a temporary directory where the session files are to be stored. The user that runs the application=20 - server has to have write access to this directory. + server has to have read and WRITE access to this directory. + <clientPath> The Complete path of a directory where the uploaded + files will be stored. The user that runs the application=20 + server has to have read and WRITE access to this directory. <webbase> The Complete URL of instalation. This is used for redirections HTTP and other operations that need full URL paths. =20 Modified: humano2/trunk/INSTALL-LINUX.es.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- humano2/trunk/INSTALL-LINUX.es.txt 2005-06-13 16:24:00 UTC (rev 1313) +++ humano2/trunk/INSTALL-LINUX.es.txt 2005-06-13 17:43:37 UTC (rev 1314) @@ -14,21 +14,22 @@ 1. Mono ( http://www.mono-project.com ) Remarca: si usa Mono 1.1.6, configuralo asi: =20 - ./configure -with-preview=3Dyes -=20 + ./configure -with-preview=3Dyes=20 (Eso es necesario para compilar XSP) =20 - 2. PostgreSQL ( http://www.postgresql.org ) (version >=3D 8.0.3 must be= used) + 2. PostgreSQL version 8.0 o posterior ( http://www.postgresql.org ) 3. Instale XSP (http://www.go-mono.com/archive/1.0.6/xsp-1.0.6.tar.gz) + 4. Obtenga la ultima version del codigo fuente de Humano2 + ( http://sourceforge.net/project/showfiles.php?group_id=3D117865&pac= kage_id=3D152308 ) =20 -=20 Compilacion: - 1. Obtenga la ultima version del codigo fuente de Humano2 (http://devel= .humano2.org/releases/) - 2. Compile ejecutando: + 1. Compile ejecutando: =20 $ make =20 + Creacion de la Base de Datos: +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D 1. Cree la base de datos con la codificacion UNICODE =20 (creando base de datos "h2_solution"): @@ -67,8 +68,11 @@ <dbdrivers> Apunta al directorio en donde se encuentra el driver para = la conexion a la base de datos PostgreSQL. Esto es normalmente en bin. <session> La ubicacion completo del directorio cual mantendra los arch= ivos=20 - temporales. Notace que el servidor usuario bajo cual corre el servido= r debe - tener derechos de escritura y lectura en este directorio. + temporales de session. Notace que el servidor usuario bajo cual corre= el=20 + servidor debe tener derechos de ESCRITURA y lectura en este directori= o. + <clientPath> La ubicacion completo del directorio cual mantendra los a= rchivos=20 + subido en la plataforma. Notace que el servidor usuario bajo cual cor= re el=20 + servidor debe tener derechos de ESCRITURA y lectura en este directori= o. <webbase> El URL completo donde estara accesible el systema. El system= a=20 utilizara ese direccion para redirecionamiento y otras operaciones cu= al=20 necesitan la direccion completa.=20 |
|
From: <sv...@de...> - 2005-06-13 16:45:58
|
Author: pcamacho
Date: 2005-06-13 12:24:00 -0400 (Mon, 13 Jun 2005)
New Revision: 1313
Modified:
humano2/trunk/web/builder/site/foldermanagement.aspx
humano2/trunk/web/builder/site/formmanagement.aspx
humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphicallist.j=
s
humano2/trunk/web/builder/site/xsl/createfolder.xsl
humano2/trunk/web/builder/site/xsl/createreport.xsl
humano2/trunk/web/builder/site/xsl/createview.xsl
Log:
FIX: bug #169.
Modified: humano2/trunk/web/builder/site/foldermanagement.aspx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/foldermanagement.aspx 2005-06-13 15:51=
:49 UTC (rev 1312)
+++ humano2/trunk/web/builder/site/foldermanagement.aspx 2005-06-13 16:24=
:00 UTC (rev 1313)
@@ -103,7 +103,7 @@
</a>
</td>
<td rowspan=3D"4">
- <input onclick=3D"Form.SetToDefault(=
leftColumn,rightColumn)" type=3D"button" value=3D"SetToDefault">
+ <input onclick=3D"rightColumn.SetToD=
efault();leftColumn.SetToDefault();" type=3D"button" value=3D"SetToDefaul=
t">
<br>
<!-- Do not forget to enable all ite=
m of the left list -->
<input type=3D"button" value=3D"Remo=
veAll" onclick=3D"leftColumn.EnableAll();rightColumn.RemoveAll();">
Modified: humano2/trunk/web/builder/site/formmanagement.aspx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/formmanagement.aspx 2005-06-13 15:51:4=
9 UTC (rev 1312)
+++ humano2/trunk/web/builder/site/formmanagement.aspx 2005-06-13 16:24:0=
0 UTC (rev 1313)
@@ -111,7 +111,7 @@
</a>
</td>
<td rowspan=3D"4">
- <input onclick=3D"Form.SetToDefault(left=
Column,rightColumn)" type=3D"button" value=3D"SetToDefault">
+ <input onclick=3D"leftColumn.SetToDefaul=
t();rightColumn.SetToDefault();" type=3D"button" value=3D"SetToDefault">
<br>
<!-- Do not forget to enable all item of=
the left list -->
<input type=3D"button" value=3D"RemoveAl=
l" onclick=3D"leftColumn.EnableAll();rightColumn.RemoveAll();">
Modified: humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphica=
llist.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphicallist.=
js 2005-06-13 15:51:49 UTC (rev 1312)
+++ humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphicallist.=
js 2005-06-13 16:24:00 UTC (rev 1313)
@@ -21,6 +21,7 @@
//Fields
this.selfRefName =3D params.selfRefName;
this.fSortedList =3D new SortedList(params.itemList);
+ this.defaultList =3D params.itemList; //the list by default must be =
saved
this.showButtons =3D params.showButtons;
=20
//Graphical elements
@@ -48,6 +49,7 @@
this.RemoveAll =3D SortedGraphicalListRemoveAll;
this.Set =3D SortedGraphicalListSet;
this.Move =3D SortedGraphicalListMove;
+ this.SetToDefault =3D SortedGraphicalListSetToDefault;
=20
//Update the current document
this.PutAllComponents(params.divReceptor);
@@ -115,7 +117,6 @@
this.RefreshListBox();
}
=20
-
function SortedGraphicalListEnableAll()
{
this.fSortedList.EnableAll();
@@ -135,6 +136,14 @@
}
=20
/**
+ * Init the sortedgraphical list to the default values
+ */
+function SortedGraphicalListSetToDefault()
+{
+ this.Set(this.defaultList);
+}
+
+/**
* Take an item delete it from this object and then send it to another S=
ortedGraphicalList
* @param indexOfItem the index of the item from the first list to move
* @param receptor the receptor list
@@ -169,26 +178,26 @@
=20
function SortedGraphicalListRefreshListBox()
{
- var innerHtml =3D "";
- var sizeList =3D this.fSortedList.Length();
- =20
- innerHtml +=3D "<select size=3D\"10\" style=3D\"width:220px;\" =
class=3D\"drpdwn2\">";
- for(var i=3D0; i<sizeList;i++)
- {
- //alert(this.fSortedList.GetItem(i).GetName());
- var displayName =3D this.fSortedList.GetItem(i).GetName(=
);
- var value =3D this.fSortedList.GetItem(i).GetValue();
- var disabled =3D this.fSortedList.GetItem(i).GetDisabled=
();
- =20
- var displayOption =3D "";
- if (disabled =3D=3D true)
- {
- displayOption =3D "style=3D\"color:gray;\"";
- }
- innerHtml +=3D "<option value=3D\"" + value + "\" " + di=
splayOption + ">" + displayName + "</option>";
- }
- innerHtml +=3D"</select>";
- this.listBoxElement.innerHTML =3D innerHtml;
+ var innerHtml =3D "";
+ var sizeList =3D this.fSortedList.Length();
+ =20
+ innerHtml +=3D "<select size=3D\"10\" style=3D\"width:220px;\" clas=
s=3D\"drpdwn2\">";
+ for(var i=3D0; i<sizeList;i++)
+ {
+ //alert(this.fSortedList.GetItem(i).GetName());
+ var displayName =3D this.fSortedList.GetItem(i).GetName();
+ var value =3D this.fSortedList.GetItem(i).GetValue();
+ var disabled =3D this.fSortedList.GetItem(i).GetDisabled();
+ =20
+ var displayOption =3D "";
+ if (disabled =3D=3D true)
+ {
+ displayOption =3D "style=3D\"color:gray;\"";
+ }
+ innerHtml +=3D "<option value=3D\"" + value + "\" " + displa=
yOption + ">" + displayName + "</option>";
+ }
+ innerHtml +=3D"</select>";
+ this.listBoxElement.innerHTML =3D innerHtml;
}
=20
=20
Modified: humano2/trunk/web/builder/site/xsl/createfolder.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createfolder.xsl 2005-06-13 15:51:=
49 UTC (rev 1312)
+++ humano2/trunk/web/builder/site/xsl/createfolder.xsl 2005-06-13 16:24:=
00 UTC (rev 1313)
@@ -102,7 +102,7 @@
</a>
</td>
<td rowspan=3D"4">
- <input onclick=3D"Form.SetToDefault(=
leftColumn,rightColumn)" type=3D"button" value=3D"SetToDefault">
+ <input onclick=3D"leftColumn.SetToDe=
fault();rightColumn.SetToDefault()" type=3D"button" value=3D"SetToDefault=
">
<br>
<!-- Do not forget to enable all ite=
m of the left list -->
<input type=3D"button" value=3D"Remo=
veAll" onclick=3D"leftColumn.EnableAll();rightColumn.RemoveAll();">
Modified: humano2/trunk/web/builder/site/xsl/createreport.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-13 15:51:=
49 UTC (rev 1312)
+++ humano2/trunk/web/builder/site/xsl/createreport.xsl 2005-06-13 16:24:=
00 UTC (rev 1313)
@@ -412,7 +412,7 @@
</td>
<td>
<input type=3D"button" v=
alue=3D"SetToDefault"=20
- onclick=3D"Form.SetT=
oDefault(leftColumn,rightColumn)"></input>
+ onclick=3D"leftColum=
n.SetToDefault();rightColumn.SetToDefault();"></input>
<br/>
<!-- Do not forget to en=
able all item of the left list -->
<input type=3D"button" v=
alue=3D"RemoveAll" onclick=3D"leftColumn.EnableAll();rightColumn.RemoveAl=
l();"></input>
Modified: humano2/trunk/web/builder/site/xsl/createview.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-13 15:51:49=
UTC (rev 1312)
+++ humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-13 16:24:00=
UTC (rev 1313)
@@ -92,10 +92,6 @@
=20
function recargar()
{
- <![CDATA[
- //for(i=3D0;i<document.formulario.elements.length;i+=
+)
- // alert(document.formulario.elements[i].name);
- ]]>
indice =3D document.formulario.classList.selectedInd=
ex;
if(indice>0)
{
@@ -268,7 +264,7 @@
</td>
<td>
<input type=3D"butto=
n" value=3D"SetToDefault"=20
- onclick=3D"Form.=
SetToDefault(leftColumn,rightColumn)"></input>
+ onclick=3D"leftC=
olumn.SetToDefault();rightColumn.SetToDefault();"></input>
<br/>
<!-- Do not forget t=
o enable all item of the left list -->
<input type=3D"butto=
n" value=3D"RemoveAll" onclick=3D"leftColumn.EnableAll();rightColumn.Remo=
veAll();"></input>
|
|
From: <sv...@de...> - 2005-06-13 15:52:03
|
Author: pcamacho
Date: 2005-06-13 11:51:49 -0400 (Mon, 13 Jun 2005)
New Revision: 1312
Added:
humano2/trunk/web/builder/site/xsl/createfolder.xsl
Modified:
humano2/trunk/web/builder/site/foldermanagement.aspx
humano2/trunk/web/builder/site/foldermanagement.aspx.cs
humano2/trunk/web/builder/site/formmanagement.aspx
humano2/trunk/web/builder/site/js/formreport.js
humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphicallist.j=
s
humano2/trunk/web/builder/site/js/grafcomponents/sortedlist.js
humano2/trunk/web/builder/site/xsl/createreport.xsl
humano2/trunk/web/builder/site/xsl/createview.xsl
Log:
CHANGE: change of interface for "SortedGraphicalList" component.
Modified: humano2/trunk/web/builder/site/foldermanagement.aspx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/foldermanagement.aspx 2005-06-13 14:27=
:13 UTC (rev 1311)
+++ humano2/trunk/web/builder/site/foldermanagement.aspx 2005-06-13 15:51=
:49 UTC (rev 1312)
@@ -112,19 +112,31 @@
</table>
=20
<script>
- var rigthElements =3D new Array(<% html_getA=
ttrList(2); %>);
+ var rightElements =3D new Array(<% html_getA=
ttrList(2); %>);
var leftElements =3D new Array(<% html_getAt=
trList(1); %>);
=20
//First List
var divColumnsToShowLeft =3D GetNodeByTagNam=
eAndAttName("div","ColumnsToShowLeft")[0]; =20
- var leftColumn =3D new SortedGraphicalList(l=
eftElements,
- divC=
olumnsToShowLeft,"leftColumn"); =20
+ var leftColumnParams =3D=20
+ {
+ selfRefName: "leftColumn",
+ itemList: leftElements,
+ divReceptor: divColumnsToShowLeft,
+ showButtons: false
+ }
+ =20
+ var leftColumn =3D new SortedGraphicalList(l=
eftColumnParams); =20
=
=20
//Second List
var divColumnsToShowRight =3D GetNodeByTagNa=
meAndAttName("div","ColumnsToShowRight")[0]; =20
- var rightColumn =3D new SortedGraphicalList(=
rigthElements,
- divC=
olumnsToShowRight,"rightColumn"); =
=20
- =20
+ var rightColumnParams =3D=20
+ {
+ selfRefName: "rightColumn",
+ itemList: rightElements,
+ divReceptor: divColumnsToShowRight,
+ showButtons: false
+ }
+ var rightColumn =3D new SortedGraphicalList(=
rightColumnParams); =20
</script>
</td> =20
</tr>
Modified: humano2/trunk/web/builder/site/foldermanagement.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/foldermanagement.aspx.cs 2005-06-13 14=
:27:13 UTC (rev 1311)
+++ humano2/trunk/web/builder/site/foldermanagement.aspx.cs 2005-06-13 15=
:51:49 UTC (rev 1312)
@@ -535,11 +535,7 @@
{
Response.Write("0");
}
- public void html_sendMessage()
- {
- Response.Write(htmlMsgError);
- }
-
+ =09
#endregion=20
}
}
Modified: humano2/trunk/web/builder/site/formmanagement.aspx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/formmanagement.aspx 2005-06-13 14:27:1=
3 UTC (rev 1311)
+++ humano2/trunk/web/builder/site/formmanagement.aspx 2005-06-13 15:51:4=
9 UTC (rev 1312)
@@ -126,18 +126,31 @@
</table>
<script>
=20
- var rigthElements =3D new Array(<% html_getAttrL=
ist(2); %>);
+ var rightElements =3D new Array(<% html_getAttrL=
ist(2); %>);
var leftElements =3D new Array(<% html_getAttrLi=
st(1); %>);
=20
//First List
var divColumnsToShowLeft =3D GetNodeByTagNameAnd=
AttName("div","ColumnsToShowLeft")[0]; =20
- var leftColumn =3D new SortedGraphicalList(leftE=
lements,
- divColumnsToShowLeft,"leftColumn"); =20
=20
+ var leftColumnParams =3D=20
+ {
+ selfRefName: "leftColumn",
+ itemList: leftElements,
+ divReceptor: divColumnsToShowLeft,
+ showButtons: false
+ }
+ var leftColumn =3D new SortedGraphicalList(leftC=
olumnParams); =20
+ =20
//Second List
var divColumnsToShowRight =3D GetNodeByTagNameAn=
dAttName("div","ColumnsToShowRight")[0]; =20
- var rightColumn =3D new SortedGraphicalList(rigt=
hElements,
- divColumnsToShowRight,"rightColumn"); =
=20
+ var rightColumnParams =3D=20
+ {
+ selfRefName: "rightColumn",
+ itemList: rightElements,
+ divReceptor: divColumnsToShowRight,
+ showButtons: false
+ }
+ var rightColumn =3D new SortedGraphicalList(righ=
tColumnParams); =20
=20
</script>
</td>
Modified: humano2/trunk/web/builder/site/js/formreport.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/formreport.js 2005-06-13 14:27:13 U=
TC (rev 1311)
+++ humano2/trunk/web/builder/site/js/formreport.js 2005-06-13 15:51:49 U=
TC (rev 1312)
@@ -256,7 +256,6 @@
}
this.attributeLeftArray[i] =3D element; =
=20
}
- =20
}
else //In the case of update of a class
{
Modified: humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphica=
llist.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphicallist.=
js 2005-06-13 14:27:13 UTC (rev 1311)
+++ humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphicallist.=
js 2005-06-13 15:51:49 UTC (rev 1312)
@@ -7,81 +7,82 @@
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version. =20
//
-// $Id: $
+// $Id$
//
=20
+
/**
* Constructor of SortedGraphicalList
- * @param itemList The list items
- * @param showInput boolean, to know if the inputs (to update and delete=
) are used
+ * @param itemList The list items (array)
+ * @param showButtons boolean, to know if the buttons (to update and del=
ete) are used
*/
-function SortedGraphicalList(itemList,divReceptor,selfRefName,showButton=
s)
+function SortedGraphicalList(params)
{
- //Fields
- this.selfRefName =3D selfRefName;
- this.fSortedList =3D new SortedList(itemList);
- this.showButtons =3D showButtons;
- =20
- //Graphical elements
- this.listBoxElement =3D document.createElement('div');
- this.sortButton =3D document.createElement('div');
- this.downButton =3D document.createElement('div');
- this.upButton =3D document.createElement('div');
- this.topButton =3D document.createElement('div');
- this.bottomButton =3D document.createElement('div');
- =20
- //Methods
- this.RefreshListBox =3D SortedGraphicalListRefreshListBox;
- this.GetSelectedIndex =3D SortedGraphicalListGetSelectedIndex;
- this.CreateButton =3D SortedGraphicalListCreateButton; =20
- this.PutAllComponents =3D SortedGraphicalListPutAllComponents;
- this.Sort =3D SortedGraphicalListSort;
- this.Up =3D SortedGraphicalListUp;
- this.Down =3D SortedGraphicalListDown;
- this.Top =3D SortedGraphicalListTop;
- this.Bottom =3D SortedGraphicalListBottom;
- this.AddElement =3D SortedGraphicalListAddElement;
- this.ReplaceElement =3D SortedGraphicalListReplaceElement;
- this.RemoveElement =3D SortedGraphicalListRemoveElement;
- this.EnableAll =3D SortedGraphicalListEnableAll;
- this.RemoveAll =3D SortedGraphicalListRemoveAll;
- this.Set =3D SortedGraphicalListSet;
- this.Move =3D SortedGraphicalListMove;
- =20
- //Update the current document
- this.PutAllComponents(divReceptor);
- =20
- return this;
+ //Fields
+ this.selfRefName =3D params.selfRefName;
+ this.fSortedList =3D new SortedList(params.itemList);
+ this.showButtons =3D params.showButtons;
+ =20
+ //Graphical elements
+ this.listBoxElement =3D document.createElement('div');
+ this.sortButton =3D document.createElement('div');
+ this.downButton =3D document.createElement('div');
+ this.upButton =3D document.createElement('div');
+ this.topButton =3D document.createElement('div');
+ this.bottomButton =3D document.createElement('div');
+ =20
+ //Methods
+ this.RefreshListBox =3D SortedGraphicalListRefreshListBox;
+ this.GetSelectedIndex =3D SortedGraphicalListGetSelectedIndex;
+ this.CreateButton =3D SortedGraphicalListCreateButton; =20
+ this.PutAllComponents =3D SortedGraphicalListPutAllComponents;
+ this.Sort =3D SortedGraphicalListSort;
+ this.Up =3D SortedGraphicalListUp;
+ this.Down =3D SortedGraphicalListDown;
+ this.Top =3D SortedGraphicalListTop;
+ this.Bottom =3D SortedGraphicalListBottom;
+ this.AddElement =3D SortedGraphicalListAddElement;
+ this.ReplaceElement =3D SortedGraphicalListReplaceElement;
+ this.RemoveElement =3D SortedGraphicalListRemoveElement;
+ this.EnableAll =3D SortedGraphicalListEnableAll;
+ this.RemoveAll =3D SortedGraphicalListRemoveAll;
+ this.Set =3D SortedGraphicalListSet;
+ this.Move =3D SortedGraphicalListMove;
+ =20
+ //Update the current document
+ this.PutAllComponents(params.divReceptor);
+ =20
+ return this;
}
=20
function SortedGraphicalListSort()
{
- this.fSortedList.Sort();
- this.RefreshListBox(); =20
+ this.fSortedList.Sort();
+ this.RefreshListBox(); =20
}
=20
function SortedGraphicalListUp(index)
{
- this.fSortedList.ItemUp(index);
- this.RefreshListBox(); =20
+ this.fSortedList.ItemUp(index);
+ this.RefreshListBox(); =20
}
=20
function SortedGraphicalListDown(index)
{
- this.fSortedList.ItemDown(index);
- this.RefreshListBox(); =20
+ this.fSortedList.ItemDown(index);
+ this.RefreshListBox(); =20
}
=20
function SortedGraphicalListTop(index)
{
- this.fSortedList.ToTop(index);
- this.RefreshListBox(); =20
+ this.fSortedList.ToTop(index);
+ this.RefreshListBox(); =20
}
=20
function SortedGraphicalListBottom(index)
{
- this.fSortedList.ToBottom(index);
- this.RefreshListBox(); =20
+ this.fSortedList.ToBottom(index);
+ this.RefreshListBox(); =20
}
=20
/**
@@ -250,24 +251,24 @@
=20
function SortedGraphicalListPutAllComponents(divReceptor)
{
- this.RefreshListBox();
- divReceptor.appendChild(this.listBoxElement);
- =20
- =20
- if(this.showButtons =3D=3D true)
- {
- this.CreateButton("Up");
- this.CreateButton("Down");
- this.CreateButton("Top");
- this.CreateButton("Bottom");
- this.CreateButton("Sort");
- }
- =20
- divReceptor.appendChild(this.sortButton);
- divReceptor.appendChild(this.upButton);
- divReceptor.appendChild(this.downButton);
- divReceptor.appendChild(this.topButton);
- divReceptor.appendChild(this.bottomButton);
+ this.RefreshListBox();
+ divReceptor.appendChild(this.listBoxElement);
+ =20
+ =20
+ if(this.showButtons =3D=3D true)
+ {
+ this.CreateButton("Up");
+ this.CreateButton("Down");
+ this.CreateButton("Top");
+ this.CreateButton("Bottom");
+ this.CreateButton("Sort");
+ }
+ =20
+ divReceptor.appendChild(this.sortButton);
+ divReceptor.appendChild(this.upButton);
+ divReceptor.appendChild(this.downButton);
+ divReceptor.appendChild(this.topButton);
+ divReceptor.appendChild(this.bottomButton);
} =20
=20
function SortedGraphicalListGetSelectedIndex()
@@ -281,6 +282,15 @@
function SortedGraphicalListTest()
{
TestGroupWrite("SortedGraphicalListTest");
+ =20
+ =20
+ =20
+ Test("GetDefaultItemList","an empty line", EmptyLineHtml =3D=3D =
'');
+ =20
+ Test("");
+ =20
+ =20
+ /*
//var newDiv =3D document.createElement('div');
//var node =3D document.getElementsByTagName("body")[0]; =20
//node.appendChild(newDiv);
@@ -292,7 +302,6 @@
anotherSortedGraphicalList =3D new SortedGraphicalList(new Array=
(new ListElement("France"), new ListElement("Chili"), new ListElement("Pe=
rou")),
divRef,"aSortedG=
raphicalList",false); =20
=20
- =20
//CreateButtonRemove
var divRemoveButton =3D document.createElement("div");
divRemoveButton.innerHTML =3D "<div>"
@@ -336,4 +345,6 @@
+ "</div>";
divRef.appendChild(divMove);
=20
-}
\ No newline at end of file
+ */
+ =20
+}
Property changes on: humano2/trunk/web/builder/site/js/grafcomponents/sor=
tedgraphicallist.js
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: humano2/trunk/web/builder/site/js/grafcomponents/sortedlist.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/grafcomponents/sortedlist.js 2005-0=
6-13 14:27:13 UTC (rev 1311)
+++ humano2/trunk/web/builder/site/js/grafcomponents/sortedlist.js 2005-0=
6-13 15:51:49 UTC (rev 1312)
@@ -1 +1 @@
-//=0D// The Humano2 Business solution.=0D// Copyright (C) 2004,5 Humano=
2 Chile S.A. (http://www.humano2.com)=0D//=0D// This program is free soft=
ware; you can redistribute it and/or modify=0D// it under the terms of th=
e GNU General Public License as published by=0D// the Free Software Found=
ation; either version 2 of the License, or=0D// (at your option) any late=
r version. =0D//=0D// $Id: viewmain.aspx.cs 795 2005-05-04 14:26:33Z p=
camacho $=0D//=0D=0D/**=0D * Constructor of ListElement=0D */=0Dfunction =
ListElement(name,value,disabled)=0D{=0D //Fields=0D this.name =3D n=
ame;=0D this.value =3D value;=0D this.disabled =3D disabled;=0D =
=0D //Methods=0D this.GetName =3D ListElementGetName;=0D this.Ge=
tValue =3D ListElementGetValue;=0D this.GetDisabled =3D ListElementGet=
Disabled;=0D this.SetDisabled =3D ListElementSetDisabled;=0D}=0D=0Dfun=
ction ListElementGetDisabled()=0D{ =0D return this.disabled;=0D}=0D=0D=
function ListElementSetDisabled(disabled)=0D{=0D this.disabled =3D dis=
abled; =0D}=0D=0Dfunction ListElementGetValue()=0D{=0D return this.=
value; =0D}=0D=0Dfunction ListElementGetName()=0D{=0D return this.n=
ame;=0D}=0D=0D=0Dfunction CopyList(src)=0D{=0D var dst =3D new Array()=
; =0D var i =3D 0;=0D for(i=3D0;i<src.length;i++)=0D {=0D=
dst[i] =3D new ListElement( src[i].GetName(),=0D =
src[i].GetValue(),=0D =
src[i].GetDisabled());=0D }=0D =0D return dst;=0D}=0D=0D/**=0D=
* Constructor of a sorted list=0D*/=0Dfunction SortedList(itemList)=0D{=0D=
=0D //Fields copy everything to be independent=0D t=
his.itemList =3D new Array(); =0D =0D =0D //Pub=
lic Methods=0D this.GetItem =3D SortedListGetItem;=0D this.=
ToString =3D SortedListToString;=0D this.ItemUp =3D SortedListItem=
Up;=0D this.ItemDown =3D SortedListItemDown;=0D this.Sort =3D=
SortedListSort;=0D this.ToTop =3D SortedListToTop;=0D this=
.ToBottom =3D SortedListToBottom;=0D this.Add =3D SortedListAdd;=0D=
this.Replace =3D SortedListReplace;=0D this.Remove =3D Sor=
tedListRemove;=0D this.Set =3D SortedListSet;=0D this.Enabl=
eAll =3D SortedListEnableAll;=0D this.RemoveAll =3D SortedListRemo=
veAll;=0D this.Length =3D SortedListLength;=0D =0D /=
/Init the object=0D this.itemList =3D CopyList(itemList);=0D}=0D=0D=
=0D/**=0D* Used to debug=0D*/=0Dfunction SortedListToString()=0D{=0D =
str =3D "**** SORTED LIST ****<br>";=0D str +=3D "<b>itemLis=
t</b><br/>: ";=0D var i;=0D //alert("this.itemList[i].len=
gth: " + this.itemList.length);=0D for(i=3D0;i<this.itemList.leng=
th;i++)=0D {=0D str +=3D "("+ i+ ")" + " name:" + t=
his.itemList[i].GetName() + "<br/>";=0D }=0D =0D =
document.write(str);=0D}=0D=0D/**=0D * Get length of list=0D */=0Dfunctio=
n SortedListLength()=0D{=0D return this.itemList.length; =0D=
}=0D=0D/**=0D* Simple getter=0D*/=0Dfunction SortedListGetItem(indexOfIte=
m)=0D{=0D return this.itemList[indexOfItem];=0D}=0D=0D=0D/**=0D* S=
orts the list=0D*/=0Dfunction SortedListSort()=0D{=0D //Bubble sort=0D=
var sorted =3D false; =0D while( sorted =3D=3D false)=0D {=0D=
var i;=0D sorted =3D true;=0D for(i=3D0;i<this.item=
List.length-1;i++) =0D {=0D if(this.itemList[i].name=
> this.itemList[i+1].name) //Invert elements=0D {=0D =
var aux =3D this.itemList[i];=0D this.itemList[i=
] =3D this.itemList[i+1];=0D this.itemList[i+1] =3D aux;=0D=
sorted =3D false;=0D }=0D }=0D }=0D}=
=0D=0D/**=0D* Takes an item and make changes its place from p to p-1 in t=
he list=0D* @param indexOfItem the index of item to move=0D* @return the =
new index of item=0D*/=0Dfunction SortedListItemUp(indexOfItem)=0D{=0D =
if((indexOfItem =3D=3D 0) || (indexOfItem =3D=3D -1))=0D =
return indexOfItem;=0D var aux =3D this.itemList[indexOfItem -1];=
=0D this.itemList[indexOfItem-1] =3D this.itemList[indexOfItem];=0D=
this.itemList[indexOfItem] =3D aux;=0D =0D return (ind=
exOfItem-1);=0D}=0D=0D=0D/**=0D* Takes an item and make changes its place=
from p to p+1 in the list=0D* @param indexOfItem the index of item to mo=
ve=0D* @return the new index of the item =0D*/ =0Dfunction SortedListItem=
Down(indexOfItem)=0D{=0D=0D var lastIndex =3D this.itemList.length=
- 1;=0D =0D if( (indexOfItem =3D=3D lastIndex) =0D =
|| (indexOfItem =3D=3D -1))=0D return indexOfItem=
;=0D =0D =0D var aux =3D this.itemList[index=
OfItem+1];=0D this.itemList[indexOfItem+1] =3D this.itemList[index=
OfItem];=0D this.itemList[indexOfItem] =3D aux;=0D =0D =
return (indexOfItem+1);=0D}=0D =0D/**=0D * Move an item to the top of =
the list=0D */=0Dfunction SortedListToTop(indexOfItem)=0D{=0D if((=
indexOfItem =3D=3D 0) || (indexOfItem =3D=3D -1))=0D retu=
rn;=0D var topReached =3D indexOfItem;=0D while (topReached=
!=3D 0)=0D {=0D topReached =3D this.ItemUp(topReac=
hed);=0D }=0D}=0D=0Dfunction SortedListToBottom(indexOfItem)=0D{=0D=
if((indexOfItem =3D=3D (this.itemList.length-1)) || (indexOfItem =
=3D=3D -1) )=0D return;=0D var topReached =3D index=
OfItem;=0D while (topReached !=3D (this.itemList.length-1))=0D =
{=0D topReached =3D this.ItemDown(topReached);=0D =
}=0D}=0D=0D/**=0D * Add a new element at the end of the list=0D */=0Df=
unction SortedListAdd(value)=0D{=0D //alert("Next index: " + this.item=
List.length);=0D this.itemList[this.itemList.length] =3D value;=0D}=0D=
=0D/**=0D * Looks for the element in the list that as the same id as elem=
ent=0D * when found replace it by element=0D * if not found simply add el=
ement to the list=0D */=0Dfunction SortedListReplace(element)=0D{=0D v=
ar founded =3D false;=0D var i;=0D =0D for(i=3D0;i<this.itemList=
.length;i++)=0D {=0D if(this.itemList[i].GetValue() =3D=3D elem=
ent.GetValue()) =0D {=0D founded =3D true;=0D =
this.itemList[i] =3D element;=0D return;=0D }=0D =
}=0D =0D if (founded =3D=3D false)=0D {=0D this.Add(elem=
ent);=0D }=0D}=0D=0D/**=0D * Set the list to a tab values=0D * doing a=
copy=0D */=0Dfunction SortedListSet(values)=0D{=0D this.itemList =3D =
CopyList(values);=0D}=0D=0D=0D/**=0D * Put the disabled attribute of ever=
y element to false=0D */=0Dfunction SortedListEnableAll()=0D{=0D var i=
;=0D for(i=3D0;i<this.itemList.length;i++)=0D {=0D var elem=
ent =3D this.itemList[i];=0D element.SetDisabled(false);=0D }=0D=
}=0D=0Dfunction SortedListRemoveAll()=0D{=0D this.itemList =3D new Arr=
ay(); =0D}=0D=0D=0Dfunction SortedListRemove(indexOfItem)=0D{=0D va=
r newArray =3D new Array();=0D var indexNewArray =3D 0;=0D for(var =
i=3D0;i<this.itemList.length;i++)=0D {=0D if(i!=3DindexOfIt=
em)=0D {=0D newArray[indexNewArray++] =3D t=
his.itemList[i];=0D }=0D }=0D this.itemList =3D newArray=
;=0D}=0D=0D =0D//////////////////////////////////=0D// TESTS =0D/////////=
////////////////////////=0Dfunction SortedListTest()=0D{=0D =0D =
TestGroupWrite("SortedListTest");=0D =0D //ItemUp=0D =
var list =3D new SortedList( new Array( new ListElement("item1","=
",false),=0D new ListEleme=
nt("item2","",false),=0D n=
ew ListElement("item3","",false)));=0D =0D list.ItemUp(1);=0D=
Test("ITEMUP","Push the second item up",list.GetItem(0).GetName()=
=3D=3D 'item2' =0D && list.GetIte=
m(1).GetName() =3D=3D 'item1'=0D &=
& list.GetItem(2).GetName() =3D=3D 'item3');=0D list.ItemUp(0); =
=0D Test("ITEMUP","Push the fi=
rst item up (no change)",list.GetItem(0).GetName() =3D=3D 'item2' =0D =
&& list.GetItem(1).GetName() =3D=3D '=
item1'=0D && list.GetItem(2).GetNa=
me() =3D=3D 'item3');=0D list.ItemUp(-1); =
=0D Test("ITEMUP","-1: no change",list.GetItem(0).Ge=
tName() =3D=3D 'item2' =0D && list=
.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item3');=0D =0D =
=0D =0D //ItemDown =0D =
var list =3D new SortedList(new Array(new ListElement("item1","",false),=
new ListElement("item2","",false),new ListElement("item3","",false)));=0D=
=0D list.ItemDown(1);=0D Test("ITEMDOWN","Push the second=
item down",list.GetItem(0).GetName() =3D=3D 'item1' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item=
3'=0D && list.GetItem(2).=
GetName() =3D=3D 'item2');=0D =0D =
list.ItemDown(2); =0D =
Test("ITEMDOWN","Push the last item down (no change)", list.GetItem(0).=
GetName() =3D=3D 'item1' =0D && =
list.GetItem(1).GetName() =3D=3D 'item3'=0D =
&& list.GetItem(2).GetN=
ame() =3D=3D 'item2');=0D =0D list.ItemDown(-1); =
=0D Test("ITEMDOWN","-1 :no chan=
ge",list.GetItem(0).GetName() =3D=3D 'item1' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item3'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item2');=
=0D =0D //ToTop=0D var list =3D new SortedList(new A=
rray(new ListElement("item1"),=0D =
new ListElement("item2"),=0D =
new ListElement("item3"),=0D =
new ListElement("item4")));=0D =0D list.ToTop(3);=0D =
Test("ITEMTOTOP","Push the last item to the top of list",list.GetItem(=
0).GetName() =3D=3D 'item4' =0D &&=
list.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item2'=0D =
&& list.GetItem(3).GetName() =3D=3D 'item3');=0D =
=0D list.ToTop(0); =0D=
Test("ITEMTOTOP","Push the first item to the top (no change)", l=
ist.GetItem(0).GetName() =3D=3D 'item4' =0D =
&& list.GetItem(1).GetName() =3D=3D=
'item1'=0D && =
list.GetItem(2).GetName() =3D=3D 'item2'=0D =
&& list.GetItem(3).GetNa=
me() =3D=3D 'item3');=0D list.ToTop(-1); =
=0D Test("ITEMTOTOP","-1: no change",list.GetItem(0).=
GetName() =3D=3D 'item4' =0D && li=
st.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item2'=0D =
&& list.GetItem(3).GetName() =3D=3D 'item3');=0D =
=0D =0D //ToBottom=0D var list =3D new SortedLis=
t(new Array(new ListElement("item1"),=0D =
new ListElement("item2"),=0D =
new ListElement("item3"),=0D =
new ListElement("item4")));=0D =0D list.ToBottom(0=
);=0D Test("ITEMTOBOTTOM","Push the first item to the bottom of li=
st",list.GetItem(0).GetName() =3D=3D 'item2' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item3'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item4'=0D=
&& list.GetItem(3).GetName() =3D=3D=
'item1');=0D =0D list.ToBottom(3); =
=0D Test("ITEMTOBOTTOM","Push the last item to the =
bottom (no change)",list.GetItem(0).GetName() =3D=3D 'item2' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item3=
'=0D && list.GetItem(2).GetName() =
=3D=3D 'item4'=0D && list.GetItem(=
3).GetName() =3D=3D 'item1');=0D =0D list.ToBottom(-1); =
=0D Test("ITEMTOBOTTOM","-1: no=
change",list.GetItem(0).GetName() =3D=3D 'item2' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item3'=0D =
&& list.GetItem(2).GetName() =3D=3D 'ite=
m4'=0D && list.GetItem(3).GetName(=
) =3D=3D 'item1');=0D //Sort=0D var list =3D new SortedList=
(new Array(new ListElement("Marijn"),new ListElement("Sebastian"),new Lis=
tElement("Philippe")));=0D list.Sort();=0D Test("SORT","Sor=
ts the list",list.GetItem(0).GetName()=3D=3D"Marijn"=0D =
&& list.GetItem(1).GetName() =3D=3D "Philippe"=0D =
&& list.GetItem(2).GetName() =3D=3D=
"Sebastian");=0D =0D //Add=0D var=
list =3D new SortedList(new Array(new ListElement("Marijn"),new ListElem=
ent("Sebastian"),new ListElement("Philippe")));=0D list.Add(new Li=
stElement("Rodrigo"));=0D Test("ADD","Add an element to the list",=
list.GetItem(0).GetName()=3D=3D"Marijn"=0D =
&& list.GetItem(1).GetName() =3D=3D "Sebastian"=0D =
&& list.GetItem(2).GetName() =3D=3D "Philippe"=0D=
&& list.GetItem(3).GetName() =3D=3D=
"Rodrigo"); =0D =0D //=
Remove=0D var list =3D new SortedList(new Array(new ListElement("M=
arijn"),new ListElement("Sebastian"),new ListElement("Philippe")));=0D =
list.Remove(1);=0D Test("REMOVE","Remove an element from the =
list",list.GetItem(0).GetName()=3D=3D"Marijn"=0D =
&& list.GetItem(1).GetName() =3D=3D "Phili=
ppe")=0D =0D =
=0D //EnableAll =
=0D var lis=
t =3D new SortedList(new Array(new ListElement("Marijn","",true),=0D =
new ListElement("Sebastian","",fal=
se),=0D new ListElement("Sebas=
tian","",true)));=0D list.EnableAll();=0D Test("ENABLEALL",=
"Enable all elements of the list", list.GetItem(0).GetDisabled()=3D=3D=
false=0D && l=
ist.GetItem(1).GetDisabled()=3D=3Dfalse=0D =
&& list.GetItem(2).GetDisabled()=3D=3Dfalse=
); =0D =
=0D //RemoveAll =
=0D var list =3D new SortedList(new Array(new ListElement("Ma=
rijn"),new ListElement("Sebastian"),new ListElement("Philippe")));=0D =
list.RemoveAll();=0D Test("REMOVEALL","Remove all elements of =
the list",list.Length()=3D=3D0);=0D =0D =0D //SetToD=
efault=0D var list =3D new SortedList(new Array(new ListElement("M=
arijn"),new ListElement("Sebastian"),new ListElement("Philippe")));=0D =
list.Set(new Array(new ListElement("Paris"),new ListElement("Lyon"),=
new ListElement("Marseille")));=0D Test("SET","Set the elements of=
the list",list.Length()=3D=3D3 =0D =
&& list.GetItem(0).GetName()=3D=3D"Paris"=0D =
&& list.GetItem(1).GetName()=3D=3D"Ly=
on"=0D && list.GetItem=
(2).GetName()=3D=3D"Marseille");=0D=0D //Replace=0D var lis=
t =3D new SortedList(new Array(new ListElement("Marijn","1",false),=0D =
new ListElement("Sebastian","2",=
false),=0D new ListElement("Ph=
ilippe","3",false)));=0D =0D var element =3D new ListElemen=
t("Mozart","1",false);=0D list.Replace(element); =0D =
Test("REPLACE","Replace the first element of the list (1)",=0D =
list.GetItem(0).GetName()=3D=
=3D"Mozart"=0D && list=
.GetItem(1).GetName()=3D=3D"Sebastian"=0D =
&& list.GetItem(2).GetName()=3D=3D"Philippe"); =0D =
element =3D new ListElement("Lulu","4",false); =
=0D list.Replace(element); =0D =
Test("REPLACE","Replace the first element of the list (2)", list.Leng=
th() =3D=3D 4 =0D && l=
ist.GetItem(0).GetName()=3D=3D"Mozart"=0D =
&& list.GetItem(1).GetName()=3D=3D"Sebastian"=0D =
&& list.GetItem(2).GetName=
()=3D=3D"Philippe"=0D =
&& list.GetItem(3).GetName()=3D=3D"Lulu");=0D =
=0D //Length =
=0D var list =3D new SortedList(new Array(new Li=
stElement("Marijn"),new ListElement("Sebastian"),new ListElement("Philipp=
e")));=0D var length =3D list.Length();=0D Test("LENGTH","L=
ength of list",length =3D=3D 3);=0D}=0D=20
\ No newline at end of file
+//=0D// The Humano2 Business solution.=0D// Copyright (C) 2004,5 Humano=
2 Chile S.A. (http://www.humano2.com)=0D//=0D// This program is free soft=
ware; you can redistribute it and/or modify=0D// it under the terms of th=
e GNU General Public License as published by=0D// the Free Software Found=
ation; either version 2 of the License, or=0D// (at your option) any late=
r version. =0D//=0D// $Id$=0D//=0D=0D/**=0D * Constructor of ListEleme=
nt=0D */=0Dfunction ListElement(name,value,disabled)=0D{=0D //Fields=0D=
this.name =3D name;=0D this.value =3D value;=0D this.disabled =3D=
disabled;=0D =0D //Methods=0D this.GetName =3D ListElementGetNa=
me;=0D this.GetValue =3D ListElementGetValue;=0D this.GetDisabled =3D=
ListElementGetDisabled;=0D this.SetDisabled =3D ListElementSetDisable=
d;=0D}=0D=0Dfunction ListElementGetDisabled()=0D{ =0D return this.di=
sabled;=0D}=0D=0Dfunction ListElementSetDisabled(disabled)=0D{=0D this=
.disabled =3D disabled; =0D}=0D=0Dfunction ListElementGetValue()=0D{=0D=
return this.value; =0D}=0D=0Dfunction ListElementGetName()=0D{=0D =
return this.name;=0D}=0D=0D=0Dfunction CopyList(src)=0D{=0D var dst=
=3D new Array(); =0D var i =3D 0;=0D for(i=3D0;i<src.length=
;i++)=0D {=0D dst[i] =3D new ListElement( src[i].GetName(),=0D=
src[i].GetValue(),=0D =
src[i].GetDisabled());=0D }=0D =0D return dst;=
=0D}=0D=0D/**=0D* Constructor of a sorted list=0D*/=0Dfunction SortedList=
(itemList)=0D{=0D =0D //Fields copy everything to be indepe=
ndent=0D this.itemList =3D new Array(); =0D =0D =
=0D //Public Methods=0D this.GetItem =3D SortedListGetItem=
;=0D this.ToString =3D SortedListToString;=0D this.ItemUp =3D=
SortedListItemUp;=0D this.ItemDown =3D SortedListItemDown;=0D =
this.Sort =3D SortedListSort;=0D this.ToTop =3D SortedListToTo=
p;=0D this.ToBottom =3D SortedListToBottom;=0D this.Add =3D=
SortedListAdd;=0D this.Replace =3D SortedListReplace;=0D t=
his.Remove =3D SortedListRemove;=0D this.Set =3D SortedListSet;=0D=
this.EnableAll =3D SortedListEnableAll;=0D this.RemoveAll =
=3D SortedListRemoveAll;=0D this.Length =3D SortedListLength;=0D =
=0D //Init the object=0D this.itemList =3D CopyList(i=
temList);=0D}=0D=0D=0D/**=0D* Used to debug=0D*/=0Dfunction SortedListToS=
tring()=0D{=0D str =3D "**** SORTED LIST ****<br>";=0D s=
tr +=3D "<b>itemList</b><br/>: ";=0D var i;=0D //alert("t=
his.itemList[i].length: " + this.itemList.length);=0D for(i=3D0;i=
<this.itemList.length;i++)=0D {=0D str +=3D "("+ i+=
")" + " name:" + this.itemList[i].GetName() + "<br/>";=0D }=0D =
=0D document.write(str);=0D}=0D=0D/**=0D * Get length of l=
ist=0D */=0Dfunction SortedListLength()=0D{=0D return this.itemLis=
t.length; =0D}=0D=0D/**=0D* Simple getter=0D*/=0Dfunction SortedLi=
stGetItem(indexOfItem)=0D{=0D return this.itemList[indexOfItem];=0D=
}=0D=0D=0D/**=0D* Sorts the list=0D*/=0Dfunction SortedListSort()=0D{=0D =
//Bubble sort=0D var sorted =3D false; =0D while( sorted =3D=
=3D false)=0D {=0D var i;=0D sorted =3D true;=0D =
for(i=3D0;i<this.itemList.length-1;i++) =0D {=0D if(=
this.itemList[i].name > this.itemList[i+1].name) //Invert elements=0D =
{=0D var aux =3D this.itemList[i];=0D =
this.itemList[i] =3D this.itemList[i+1];=0D this.ite=
mList[i+1] =3D aux;=0D sorted =3D false;=0D }=0D=
}=0D }=0D}=0D=0D/**=0D* Takes an item and make changes its pla=
ce from p to p-1 in the list=0D* @param indexOfItem the index of item to =
move=0D* @return the new index of item=0D*/=0Dfunction SortedListItemUp(i=
ndexOfItem)=0D{=0D if((indexOfItem =3D=3D 0) || (indexOfItem =3D=3D=
-1))=0D return indexOfItem;=0D var aux =3D this.item=
List[indexOfItem -1];=0D this.itemList[indexOfItem-1] =3D this.item=
List[indexOfItem];=0D this.itemList[indexOfItem] =3D aux;=0D =
=0D return (indexOfItem-1);=0D}=0D=0D=0D/**=0D* Takes an item and m=
ake changes its place from p to p+1 in the list=0D* @param indexOfItem th=
e index of item to move=0D* @return the new index of the item =0D*/ =0Dfu=
nction SortedListItemDown(indexOfItem)=0D{=0D=0D var lastIndex =3D=
this.itemList.length - 1;=0D =0D if( (indexOfItem =3D=3D=
lastIndex) =0D || (indexOfItem =3D=3D -1))=0D =
return indexOfItem;=0D =0D =0D var aux =3D =
this.itemList[indexOfItem+1];=0D this.itemList[indexOfItem+1] =3D =
this.itemList[indexOfItem];=0D this.itemList[indexOfItem] =3D aux;=
=0D =0D return (indexOfItem+1);=0D}=0D =0D/**=0D * Move an =
item to the top of the list=0D */=0Dfunction SortedListToTop(indexOfItem)=
=0D{=0D if((indexOfItem =3D=3D 0) || (indexOfItem =3D=3D -1))=0D =
return;=0D var topReached =3D indexOfItem;=0D =
while (topReached !=3D 0)=0D {=0D topReached =3D =
this.ItemUp(topReached);=0D }=0D}=0D=0Dfunction SortedListToBottom=
(indexOfItem)=0D{=0D if((indexOfItem =3D=3D (this.itemList.length-=
1)) || (indexOfItem =3D=3D -1) )=0D return;=0D var =
topReached =3D indexOfItem;=0D while (topReached !=3D (this.itemLi=
st.length-1))=0D {=0D topReached =3D this.ItemDown(=
topReached);=0D }=0D}=0D=0D/**=0D * Add a new element at the end o=
f the list=0D */=0Dfunction SortedListAdd(value)=0D{=0D //alert("Next =
index: " + this.itemList.length);=0D this.itemList[this.itemList.lengt=
h] =3D value;=0D}=0D=0D/**=0D * Looks for the element in the list that as=
the same id as element=0D * when found replace it by element=0D * if not=
found simply add element to the list=0D */=0Dfunction SortedListReplace(=
element)=0D{=0D var founded =3D false;=0D var i;=0D =0D for(i=
=3D0;i<this.itemList.length;i++)=0D {=0D if(this.itemList[i].Ge=
tValue() =3D=3D element.GetValue()) =0D {=0D founded=
=3D true;=0D this.itemList[i] =3D element;=0D retu=
rn;=0D }=0D }=0D =0D if (founded =3D=3D false)=0D {=0D =
this.Add(element);=0D }=0D}=0D=0D/**=0D * Set the list to a tab=
values=0D * doing a copy=0D */=0Dfunction SortedListSet(values)=0D{=0D =
this.itemList =3D CopyList(values);=0D}=0D=0D=0D/**=0D * Put the disabl=
ed attribute of every element to false=0D */=0Dfunction SortedListEnableA=
ll()=0D{=0D var i;=0D for(i=3D0;i<this.itemList.length;i++)=0D {=
=0D var element =3D this.itemList[i];=0D element.SetDisab=
led(false);=0D }=0D}=0D=0Dfunction SortedListRemoveAll()=0D{=0D thi=
s.itemList =3D new Array(); =0D}=0D=0D=0Dfunction SortedListRemove(ind=
exOfItem)=0D{=0D var newArray =3D new Array();=0D var indexNewArray=
=3D 0;=0D for(var i=3D0;i<this.itemList.length;i++)=0D {=0D =
if(i!=3DindexOfItem)=0D {=0D newArray[=
indexNewArray++] =3D this.itemList[i];=0D }=0D }=0D this=
.itemList =3D newArray;=0D}=0D=0D =0D//////////////////////////////////=0D=
// TESTS =0D/////////////////////////////////=0Dfunction SortedListTest()=
=0D{=0D =0D TestGroupWrite("SortedListTest");=0D =0D=
//ItemUp=0D var list =3D new SortedList( new Array( new =
ListElement("item1","",false),=0D =
new ListElement("item2","",false),=0D =
new ListElement("item3","",false)));=0D =0D =
list.ItemUp(1);=0D Test("ITEMUP","Push the second item up",li=
st.GetItem(0).GetName() =3D=3D 'item2' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item3');=0D =
list.ItemUp(0); =0D Tes=
t("ITEMUP","Push the first item up (no change)",list.GetItem(0).GetName()=
=3D=3D 'item2' =0D && list.GetIte=
m(1).GetName() =3D=3D 'item1'=0D &=
& list.GetItem(2).GetName() =3D=3D 'item3');=0D list.ItemUp(-1); =
=0D Test("ITEMUP","-1: no cha=
nge",list.GetItem(0).GetName() =3D=3D 'item2' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item3')=
;=0D =0D =0D =0D //ItemDown =
=0D var list =3D new SortedList(new Array(new ListEle=
ment("item1","",false),new ListElement("item2","",false),new ListElement(=
"item3","",false)));=0D =0D list.ItemDown(1);=0D Test("ITE=
MDOWN","Push the second item down",list.GetItem(0).GetName() =3D=3D 'item=
1' =0D && list.GetItem(1)=
.GetName() =3D=3D 'item3'=0D && =
list.GetItem(2).GetName() =3D=3D 'item2');=0D =
=0D list.ItemDown(2); =
=0D Test("ITEMDOWN","Push the last item down (no chan=
ge)", list.GetItem(0).GetName() =3D=3D 'item1' =0D =
&& list.GetItem(1).GetName() =3D=3D=
'item3'=0D && =
list.GetItem(2).GetName() =3D=3D 'item2');=0D =0D l=
ist.ItemDown(-1); =0D Test("=
ITEMDOWN","-1 :no change",list.GetItem(0).GetName() =3D=3D 'item1' =0D =
&& list.GetItem(1).GetName() =3D=3D =
'item3'=0D && list.GetItem(2).GetN=
ame() =3D=3D 'item2');=0D =0D //ToTop=0D var list =3D=
new SortedList(new Array(new ListElement("item1"),=0D =
new ListElement("item2"),=0D =
new ListElement("item3"),=0D =
new ListElement("item4")));=0D =0D l=
ist.ToTop(3);=0D Test("ITEMTOTOP","Push the last item to the top o=
f list",list.GetItem(0).GetName() =3D=3D 'item4' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item=
2'=0D && list.GetItem(3).GetName()=
=3D=3D 'item3');=0D =0D list.ToTop(0); =
=0D Test("ITEMTOTOP","Push the first item to th=
e top (no change)", list.GetItem(0).GetName() =3D=3D 'item4' =0D =
&& list.GetI=
tem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item2'=
=0D && =
list.GetItem(3).GetName() =3D=3D 'item3');=0D list.ToTop(-1); =
=0D Test("ITEMTOTOP","-1: no c=
hange",list.GetItem(0).GetName() =3D=3D 'item4' =0D =
&& list.GetItem(1).GetName() =3D=3D 'item1'=0D =
&& list.GetItem(2).GetName() =3D=3D 'item2=
'=0D && list.GetItem(3).GetName() =
=3D=3D 'item3');=0D =0D =0D //ToBottom=0D var=
list =3D new SortedList(new Array(new ListElement("item1"),=0D =
new ListElement("item2"),=0D =
new ListElement("item3"),=0D =
new ListElement("item4")));=0D =0D=
list.ToBottom(0);=0D Test("ITEMTOBOTTOM","Push the first i=
tem to the bottom of list",list.GetItem(0).GetName() =3D=3D 'item2' =0D =
&& list.GetItem(1).GetName() =3D=3D=
'item3'=0D && list.GetItem(2).Get=
Name() =3D=3D 'item4'=0D && list.G=
etItem(3).GetName() =3D=3D 'item1');=0D =0D list.ToBottom(3=
); =0D Test("ITEMTOBOTTOM","=
Push the last item to the bottom (no change)",list.GetItem(0).GetName() =3D=
=3D 'item2' =0D && list.GetItem(1)=
.GetName() =3D=3D 'item3'=0D && li=
st.GetItem(2).GetName() =3D=3D 'item4'=0D =
&& list.GetItem(3).GetName() =3D=3D 'item1');=0D =0D =
list.ToBottom(-1); =0D Tes=
t("ITEMTOBOTTOM","-1: no change",list.GetItem(0).GetName() =3D=3D 'item2'=
=0D && list.GetItem(1).GetName() =
=3D=3D 'item3'=0D && list.GetItem(=
2).GetName() =3D=3D 'item4'=0D && =
list.GetItem(3).GetName() =3D=3D 'item1');=0D //Sort=0D var=
list =3D new SortedList(new Array(new ListElement("Marijn"),new ListElem=
ent("Sebastian"),new ListElement("Philippe")));=0D list.Sort();=0D=
Test("SORT","Sorts the list",list.GetItem(0).GetName()=3D=3D"Mari=
jn"=0D && list.GetItem(1).GetName(=
) =3D=3D "Philippe"=0D && list.Get=
Item(2).GetName() =3D=3D "Sebastian");=0D =0D =
//Add=0D var list =3D new SortedList(new Array(new ListElemen=
t("Marijn"),new ListElement("Sebastian"),new ListElement("Philippe")));=0D=
list.Add(new ListElement("Rodrigo"));=0D Test("ADD","Add a=
n element to the list",list.GetItem(0).GetName()=3D=3D"Marijn"=0D =
&& list.GetItem(1).GetName() =3D=3D "Seba=
stian"=0D && list.GetItem(2).GetNa=
me() =3D=3D "Philippe"=0D && list.=
GetItem(3).GetName() =3D=3D "Rodrigo"); =0D =
=0D //Remove=0D var list =3D new SortedList(n=
ew Array(new ListElement("Marijn"),new ListElement("Sebastian"),new ListE=
lement("Philippe")));=0D list.Remove(1);=0D Test("REMOVE","=
Remove an element from the list",list.GetItem(0).GetName()=3D=3D"Marijn"=0D=
&& list.GetItem(1=
).GetName() =3D=3D "Philippe")=0D =
=0D =
=0D //EnableAll =
=0D var list =3D new SortedList(new Array(new ListElement("=
Marijn","",true),=0D new ListE=
lement("Sebastian","",false),=0D =
new ListElement("Sebastian","",true)));=0D list.EnableAll();=0D=
Test("ENABLEALL","Enable all elements of the list", list.GetI=
tem(0).GetDisabled()=3D=3Dfalse=0D =
&& list.GetItem(1).GetDisabled()=3D=3Dfalse=0D =
&& list.GetItem(2=
).GetDisabled()=3D=3Dfalse); =0D =
=0D //RemoveAll =
=0D var list =3D new SortedList(new=
Array(new ListElement("Marijn"),new ListElement("Sebastian"),new ListEle=
ment("Philippe")));=0D list.RemoveAll();=0D Test("REMOVEALL=
","Remove all elements of the list",list.Length()=3D=3D0);=0D =0D =
=0D //SetToDefault=0D var list =3D new SortedList(ne=
w Array(new ListElement("Marijn"),new ListElement("Sebastian"),new ListEl=
ement("Philippe")));=0D list.Set(new Array(new ListElement("Paris"=
),new ListElement("Lyon"),new ListElement("Marseille")));=0D Test(=
"SET","Set the elements of the list",list.Length()=3D=3D3 =0D =
&& list.GetItem(0).GetName()=3D=3D=
"Paris"=0D && list.Get=
Item(1).GetName()=3D=3D"Lyon"=0D =
&& list.GetItem(2).GetName()=3D=3D"Marseille");=0D=0D /=
/Replace=0D var list =3D new SortedList(new Array(new ListElement(=
"Marijn","1",false),=0D new Li=
stElement("Sebastian","2",false),=0D =
new ListElement("Philippe","3",false)));=0D =0D var =
element =3D new ListElement("Mozart","1",false);=0D list.Replace(e=
lement); =0D Test("REPLACE","Replace the first element of t=
he list (1)",=0D li=
st.GetItem(0).GetName()=3D=3D"Mozart"=0D =
&& list.GetItem(1).GetName()=3D=3D"Sebastian"=0D =
&& list.GetItem(2).GetName(=
)=3D=3D"Philippe"); =0D element =3D new ListElement("Lulu","4",fal=
se); =0D list.R=
eplace(element); =0D Test("REPLACE","Replace the first element o=
f the list (2)", list.Length() =3D=3D 4 =0D =
&& list.GetItem(0).GetName()=3D=3D"Mozart"=0D =
&& list.GetItem(1).GetName(=
)=3D=3D"Sebastian"=0D =
&& list.GetItem(2).GetName()=3D=3D"Philippe"=0D =
&& list.GetItem(3).GetName()=3D=3D"Lulu");=0D =
=0D //Length =
=0D var list =3D new S=
ortedList(new Array(new ListElement("Marijn"),new ListElement("Sebastian"=
),new ListElement("Philippe")));=0D var length =3D list.Length();=0D=
Test("LENGTH","Length of list",length =3D=3D 3);=0D}=0D=20
\ No newline at end of file
Property changes on: humano2/trunk/web/builder/site/js/grafcomponents/sor=
tedlist.js
___________________________________________________________________
Name: svn:keywords
+ Id
Added: humano2/trunk/web/builder/site/xsl/createfolder.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createfolder.xsl 2005-06-13 14:27:=
13 UTC (rev 1311)
+++ humano2/trunk/web/builder/site/xsl/createfolder.xsl 2005-06-13 15:51:=
49 UTC (rev 1312)
@@ -0,0 +1,149 @@
+<!-- $Id$ -->
+<html>
+ <head>
+ <title>Folders</title>
+ <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-=
8859-1">
+ <script src=3D"js/functions.js"></script>
+ <script language=3D"javascript" src=3D"js/grafcomponents/misc.js"></sc=
ript>
+ <script language=3D"javascript" src=3D"js/grafcomponents/test.js"></sc=
ript>
+ <script language=3D"Javascript" src=3D"js/grafcomponents/sortedlist.js=
"></script>
+ <script language=3D"Javascript" src=3D"js/grafcomponents/sortedgraphic=
allist.js"></script>
+ <script language=3D"Javascript" src=3D"js/grafcomponents/radiobuttonex=
pand.js"></script>
+ <!-- Load this script before the next one -->
+ <script language=3D"Javascript" src=3D"js/form.js"></script>
+ <script src=3D"js/fn_formsmng.js"></script>
+ <link href=3D"css/createinterface.css" rel=3D"stylesheet" type=3D=
"text/css">
+ </head>
+ <body>
+ <form name=3D"formulario" action=3D"#" method=3D"post">
+ <input type=3D"hidden" name=3D"opaction" id=3D"opaction" value=3D"<% =
html_getAction(); %>">
+ <input type=3D"hidden" name=3D"folderid" id=3D"folderid" value=3D"<% =
html_getFolderId(); %>">
+ <input type=3D"hidden" name=3D"LstAttrib" id=3D"LstAttrib">
+ <input type=3D"hidden" name=3D"classId" id=3D"classId" value=3D"1400"=
>
+ <input type=3D"hidden" name=3D"first" id=3D"first" value=3D"<% html_g=
etFirst(); %>">
+ <table width=3D"100%" class=3D"conttablecenter2">
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <td class=3D"smallgraytextnolink">
+ Folder Name:
+ </td>
+ <td class=3D"smallgraytextnolink">
+ <input id=3D"formName" type=3D"text"=
name=3D"formName" value=3D"<% html_getFolderName(); %>">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Folder Father:=20
+ </td>
+ <td>
+ <select name=3D"select" size=3D"1" i=
d=3D"folderparent" onChange=3D"fn_setFolderParentId(this.options[this.sel=
ectedIndex].value);">
+ <% html_getFolderParent();%>
+ </select>
+ <input type=3D"hidden" id=3D"folderp=
arentid" name=3D"folderparentid" value=3D"<% html_getFolderParentId(); %>=
">
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ =20
+ <tr>
+ <td>
+ <table width=3D"100%" border=3D"0" cellSpacing=3D=
"0" cellPadding=3D"0">
+ <tr>
+ <td width=3D"100%" colspan=3D"2" class=3D=
"separatorLine">
+ </td>
+ </tr>
+ <tr>
+ <td class=3D"lev1head" valign=3D"top"><f=
ont size=3D"2">Items for Folder</font></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan=3D"2">
+ <table>
+ <tr>
+ <td>Available Columns</td>
+ <td></td>
+ <td>Your Columns</td>
+ </tr>
+ <tr>
+ <td rowspan=3D"4">
+ <div id=3D"ColumnsToShowLeft" ondblc=
lick=3D"leftColumn.Move(leftColumn.GetSelectedIndex(),rightColumn,false);=
" ></div>
+ </td>
+ <td rowspan=3D"4">
+ <input onclick=3D"leftColumn.Move(le=
ftColumn.GetSelectedIndex(),rightColumn,false);" type=3D"button"
+ value=3D"Add">
+ <br>
+ <input onclick=3D"rightColumn.Move(r=
ightColumn.GetSelectedIndex(),leftColumn,true);" type=3D"button"
+ value=3D"Remove">
+ </td>
+ <td rowspan=3D"4">
+ <div id=3D"ColumnsToShowRight" ondbl=
click=3D"rightColumn.Move(rightColumn.GetSelectedIndex(),leftColumn,true)=
;"></div>
+ </td>
+ <td rowspan=3D"4">
+ <a onclick=3D"rightColumn.Top(rightC=
olumn.GetSelectedIndex())" href=3D"#">
+ <img src=3D"img/upuparrow.gif">
+ </a>
+ <br>
+ <a onclick=3D"rightColumn.Up(rightCo=
lumn.GetSelectedIndex())" href=3D"#">
+ <img src=3D"img/uparrow.gif">
+ </a>
+ <br>
+ <a onclick=3D"rightColumn.Down(right=
Column.GetSelectedIndex())" href=3D"#">
+ <img src=3D"img/downarrow.gif">
+ </a>
+ <br>
+ <a onclick=3D"rightColumn.Bottom(rig=
htColumn.GetSelectedIndex())" href=3D"#">
+ <img src=3D"img/downdownarrow.gi=
f">
+ ...
[truncated message content] |