|
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
|