dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #10072
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2749: Reverted r 2745, 2746
------------------------------------------------------------
revno: 2749
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-01-25 20:26:03 +0100
message:
Reverted r 2745, 2746
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateDataSetStore.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataSetServiceTest.java
dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ValidateValidationRuleAction.java
dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties
dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module_vi_VN.properties
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleForm.vm
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationForm.js
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleForm.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java 2011-01-25 16:29:50 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java 2011-01-25 19:26:03 +0000
@@ -278,11 +278,4 @@
Collection<DataSet> getDataSetsBetween(int first, int max );
- /**
- * Retrieves true/false with data set has members for a given PeriodType.
- *
- * @param periodType the PeriodType.
- * @return true or false.
- */
- boolean dataSetHasMembers( PeriodType periodType );
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetStore.java 2011-01-25 16:29:50 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetStore.java 2011-01-25 19:26:03 +0000
@@ -189,7 +189,5 @@
int getDataSetCount();
Collection<DataSet> getDataSetsBetween(int first, int max );
-
- boolean dataSetHasMembers( PeriodType periodType );
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java 2011-01-25 16:29:50 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java 2011-01-25 19:26:03 +0000
@@ -344,10 +344,4 @@
{
return dataSetStore.getDataSetsBetweenByName( name, first, max );
}
-
- @Override
- public boolean dataSetHasMembers( PeriodType periodType )
- {
- return dataSetStore.dataSetHasMembers( periodType );
- }
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateDataSetStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateDataSetStore.java 2011-01-25 16:29:50 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/hibernate/HibernateDataSetStore.java 2011-01-25 19:26:03 +0000
@@ -358,15 +358,4 @@
{
return getBetweenByName( name, first, max );
}
-
- public boolean dataSetHasMembers( PeriodType periodType )
- {
- periodType = periodStore.getPeriodType( periodType.getClass() );
-
- String hql = "select count(*) from DataSet d where d.dataElements.size > 0 and d.periodType = :periodType";
- Query query = sessionFactory.getCurrentSession().createQuery( hql );
- Number rs = (Number)query.setEntity( "periodType", periodType ).uniqueResult();
-
- return rs == null ? false : rs.intValue() > 0;
- }
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataSetServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataSetServiceTest.java 2011-01-25 16:52:21 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataSetServiceTest.java 2011-01-25 19:26:03 +0000
@@ -32,13 +32,10 @@
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import org.hisp.dhis.DhisSpringTest;
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.period.PeriodType;
@@ -62,10 +59,8 @@
{
dataSetService = (DataSetService) getBean( DataSetService.ID );
- dataElementService = (DataElementService) getBean( DataElementService.ID );
-
organisationUnitService = (OrganisationUnitService) getBean( OrganisationUnitService.ID );
-
+
periodType = PeriodType.getAvailablePeriodTypes().iterator().next();
}
@@ -79,7 +74,7 @@
assertEquals( "ShortName" + uniqueCharacter, dataSet.getShortName() );
assertEquals( periodType, dataSet.getPeriodType() );
}
-
+
// -------------------------------------------------------------------------
// DataSet
// -------------------------------------------------------------------------
@@ -89,16 +84,16 @@
{
DataSet dataSetA = createDataSet( 'A', periodType );
DataSet dataSetB = createDataSet( 'B', periodType );
-
+
int idA = dataSetService.addDataSet( dataSetA );
- int idB = dataSetService.addDataSet( dataSetB );
-
+ int idB = dataSetService.addDataSet( dataSetB );
+
dataSetA = dataSetService.getDataSet( idA );
dataSetB = dataSetService.getDataSet( idB );
-
+
assertEquals( idA, dataSetA.getId() );
assertEq( 'A', dataSetA );
-
+
assertEquals( idB, dataSetB.getId() );
assertEq( 'B', dataSetB );
}
@@ -107,19 +102,19 @@
public void testUpdateDataSet()
{
DataSet dataSet = createDataSet( 'A', periodType );
-
+
int id = dataSetService.addDataSet( dataSet );
-
+
dataSet = dataSetService.getDataSet( id );
-
+
assertEq( 'A', dataSet );
-
+
dataSet.setName( "DataSetB" );
-
+
dataSetService.updateDataSet( dataSet );
-
+
dataSet = dataSetService.getDataSet( id );
-
+
assertEquals( dataSet.getName(), "DataSetB" );
}
@@ -128,22 +123,22 @@
{
DataSet dataSetA = createDataSet( 'A', periodType );
DataSet dataSetB = createDataSet( 'B', periodType );
-
+
int idA = dataSetService.addDataSet( dataSetA );
int idB = dataSetService.addDataSet( dataSetB );
-
+
assertNotNull( dataSetService.getDataSet( idA ) );
assertNotNull( dataSetService.getDataSet( idB ) );
-
+
dataSetService.deleteDataSet( dataSetService.getDataSet( idA ) );
-
+
assertNull( dataSetService.getDataSet( idA ) );
assertNotNull( dataSetService.getDataSet( idB ) );
dataSetService.deleteDataSet( dataSetService.getDataSet( idB ) );
-
+
assertNull( dataSetService.getDataSet( idA ) );
- assertNull( dataSetService.getDataSet( idB ) );
+ assertNull( dataSetService.getDataSet( idB ) );
}
@Test
@@ -152,10 +147,10 @@
{
DataSet dataSetA = createDataSet( 'A', periodType );
DataSet dataSetB = createDataSet( 'B', periodType );
-
+
int idA = dataSetService.addDataSet( dataSetA );
int idB = dataSetService.addDataSet( dataSetB );
-
+
assertEquals( dataSetService.getDataSetByName( "DataSetA" ).getId(), idA );
assertEquals( dataSetService.getDataSetByName( "DataSetB" ).getId(), idB );
assertNull( dataSetService.getDataSetByName( "DataSetC" ) );
@@ -181,15 +176,15 @@
{
DataSet dataSetA = createDataSet( 'A', periodType );
DataSet dataSetB = createDataSet( 'B', periodType );
-
+
dataSetService.addDataSet( dataSetA );
dataSetService.addDataSet( dataSetB );
-
+
Collection<DataSet> dataSets = dataSetService.getAllDataSets();
-
+
assertEquals( dataSets.size(), 2 );
assertTrue( dataSets.contains( dataSetA ) );
- assertTrue( dataSets.contains( dataSetB ) );
+ assertTrue( dataSets.contains( dataSetB ) );
}
@Test
@@ -198,53 +193,53 @@
OrganisationUnit sourceA = createOrganisationUnit( 'A' );
OrganisationUnit sourceB = createOrganisationUnit( 'B' );
OrganisationUnit sourceC = createOrganisationUnit( 'C' );
-
+
organisationUnitService.addOrganisationUnit( sourceA );
organisationUnitService.addOrganisationUnit( sourceB );
organisationUnitService.addOrganisationUnit( sourceC );
-
+
DataSet dataSetA = createDataSet( 'A', periodType );
DataSet dataSetB = createDataSet( 'B', periodType );
DataSet dataSetC = createDataSet( 'C', periodType );
-
+
dataSetA.getSources().add( sourceA );
dataSetA.getSources().add( sourceB );
-
+
dataSetB.getSources().add( sourceB );
- dataSetB.getSources().add( sourceC );
+ dataSetB.getSources().add( sourceC );
dataSetC.getSources().add( sourceA );
dataSetC.getSources().add( sourceC );
-
+
dataSetService.addDataSet( dataSetA );
dataSetService.addDataSet( dataSetB );
dataSetService.addDataSet( dataSetC );
-
+
Collection<DataSet> dataSets = dataSetService.getDataSetsBySource( sourceA );
-
+
assertEquals( 2, dataSets.size() );
assertTrue( dataSets.contains( dataSetA ) );
assertTrue( dataSets.contains( dataSetC ) );
-
- dataSets = dataSetService.getDataSetsBySource( sourceB );
+
+ dataSets = dataSetService.getDataSetsBySource( sourceB );
assertEquals( 2, dataSets.size() );
assertTrue( dataSets.contains( dataSetA ) );
assertTrue( dataSets.contains( dataSetB ) );
dataSets = dataSetService.getDataSetsBySource( sourceC );
-
+
assertEquals( 2, dataSets.size() );
assertTrue( dataSets.contains( dataSetB ) );
- assertTrue( dataSets.contains( dataSetC ) );
+ assertTrue( dataSets.contains( dataSetC ) );
}
@Test
public void testGetDataSetsBySources()
{
OrganisationUnit unitA = createOrganisationUnit( 'A' );
- OrganisationUnit unitB = createOrganisationUnit( 'B' );
- OrganisationUnit unitC = createOrganisationUnit( 'C' );
+ OrganisationUnit unitB = createOrganisationUnit( 'B' );
+ OrganisationUnit unitC = createOrganisationUnit( 'C' );
organisationUnitService.addOrganisationUnit( unitA );
organisationUnitService.addOrganisationUnit( unitB );
organisationUnitService.addOrganisationUnit( unitC );
@@ -257,16 +252,16 @@
dataSetA.getSources().add( unitB );
dataSetB.getSources().add( unitA );
dataSetC.getSources().add( unitB );
-
+
dataSetService.addDataSet( dataSetA );
dataSetService.addDataSet( dataSetB );
dataSetService.addDataSet( dataSetC );
dataSetService.addDataSet( dataSetD );
-
+
Collection<Source> sources = new HashSet<Source>();
sources.add( unitA );
sources.add( unitB );
-
+
Collection<DataSet> dataSets = dataSetService.getDataSetsBySources( sources );
assertEquals( 3, dataSets.size() );
@@ -276,14 +271,14 @@
sources = new HashSet<Source>();
sources.add( unitA );
-
+
dataSets = dataSetService.getDataSetsBySources( sources );
-
+
assertEquals( 2, dataSets.size() );
assertTrue( dataSets.contains( dataSetA ) );
assertTrue( dataSets.contains( dataSetB ) );
}
-
+
@Test
public void testGetSourcesAssociatedWithDataSet()
{
@@ -293,68 +288,36 @@
OrganisationUnit sourceD = createOrganisationUnit( 'D' );
OrganisationUnit sourceE = createOrganisationUnit( 'E' );
OrganisationUnit sourceF = createOrganisationUnit( 'F' );
-
+
organisationUnitService.addOrganisationUnit( sourceA );
organisationUnitService.addOrganisationUnit( sourceB );
organisationUnitService.addOrganisationUnit( sourceC );
organisationUnitService.addOrganisationUnit( sourceD );
organisationUnitService.addOrganisationUnit( sourceE );
organisationUnitService.addOrganisationUnit( sourceF );
-
+
DataSet dataSetA = createDataSet( 'A', periodType );
DataSet dataSetB = createDataSet( 'B', periodType );
-
+
dataSetA.getSources().add( sourceA );
dataSetA.getSources().add( sourceB );
dataSetA.getSources().add( sourceC );
dataSetB.getSources().add( sourceC );
dataSetB.getSources().add( sourceD );
- dataSetB.getSources().add( sourceE );
-
+ dataSetB.getSources().add( sourceE );
+
dataSetService.addDataSet( dataSetA );
dataSetService.addDataSet( dataSetB );
Collection<Source> sources = new HashSet<Source>();
-
+
sources.add( sourceA );
sources.add( sourceB );
sources.add( sourceD );
sources.add( sourceE );
-
+
assertEquals( 2, dataSetService.getSourcesAssociatedWithDataSet( dataSetA, sources ) );
assertEquals( 2, dataSetService.getSourcesAssociatedWithDataSet( dataSetB, sources ) );
}
-
- @Test
- public void testDataSetHasMembers()
- {
- DataElement elementA = createDataElement( 'A' );
- DataElement elementB = createDataElement( 'B' );
- DataElement elementC = createDataElement( 'C' );
-
- dataElementService.addDataElement( elementA );
- dataElementService.addDataElement( elementB );
- dataElementService.addDataElement( elementC );
-
- Collection<DataElement> dataElements = new ArrayList<DataElement>();
-
- dataElements.add( elementA );
- dataElements.add( elementB );
- dataElements.add( elementC );
-
- DataSet dataSetA = createDataSet( 'A', periodType );
-
- dataSetA.getDataElements().add( elementA );
- dataSetA.getDataElements().add( elementB );
- dataSetA.getDataElements().add( elementC );
-
- int idA = dataSetService.addDataSet( dataSetA );
-
- assertTrue( dataSetService.dataSetHasMembers( periodType ) );
-
- dataSetService.getDataSet( idA ).getDataElements().removeAll( dataElements );
-
- assertTrue( !dataSetService.dataSetHasMembers( periodType ) );
- }
}
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ValidateValidationRuleAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ValidateValidationRuleAction.java 2011-01-25 16:29:50 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ValidateValidationRuleAction.java 2011-01-25 19:26:03 +0000
@@ -27,18 +27,15 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import org.hisp.dhis.dataset.DataSetService;
import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.period.PeriodService;
import org.hisp.dhis.validation.ValidationRule;
import org.hisp.dhis.validation.ValidationRuleService;
import com.opensymphony.xwork2.ActionSupport;
-/**
+/**
* @author Margrethe Store
- * @version $Id: ValidateValidationRuleAction.java 3868 2007-11-08 15:11:12Z
- * larshelg $
+ * @version $Id: ValidateValidationRuleAction.java 3868 2007-11-08 15:11:12Z larshelg $
*/
public class ValidateValidationRuleAction
extends ActionSupport
@@ -53,21 +50,7 @@
{
this.validationRuleService = validationRuleService;
}
-
- private PeriodService periodService;
-
- public void setPeriodService( PeriodService periodService )
- {
- this.periodService = periodService;
- }
-
- private DataSetService dataSetService;
-
- public void setDataSetService( DataSetService dataSetService )
- {
- this.dataSetService = dataSetService;
- }
-
+
private I18n i18n;
public void setI18n( I18n i18n )
@@ -78,7 +61,7 @@
// -------------------------------------------------------------------------
// Input
// -------------------------------------------------------------------------
-
+
private Integer id;
public void setId( Integer id )
@@ -92,14 +75,7 @@
{
this.name = validationName;
}
-
- private String periodTypeName;
-
- public void setPeriodTypeName( String periodTypeName )
- {
- this.periodTypeName = periodTypeName;
- }
-
+
// -------------------------------------------------------------------------
// Output
// -------------------------------------------------------------------------
@@ -117,46 +93,33 @@
public String execute()
{
- if ( name != null )
+ if ( name == null )
+ {
+ message = i18n.getString( "specify_name" );
+
+ return INPUT;
+ }
+ else
{
name = name.trim();
if ( name.length() == 0 )
{
message = i18n.getString( "specify_name" );
-
+
return INPUT;
}
ValidationRule match = validationRuleService.getValidationRuleByName( name );
- if ( match != null && (id == null || match.getId() != id) )
+ if ( match != null && ( id == null || match.getId() != id ) )
{
message = i18n.getString( "name_in_use" );
return INPUT;
}
}
-
- if ( periodTypeName != null )
- {
- periodTypeName = periodTypeName.trim();
-
- if ( periodTypeName.length() == 0 )
- {
- message = i18n.getString( "specify_period_type" );
-
- return INPUT;
- }
-
- if ( !dataSetService.dataSetHasMembers( periodService.getPeriodTypeByName( periodTypeName ) ) )
- {
- message = i18n.getString( "specify_period_type_used_in_dataset_has_member" );
-
- return INPUT;
- }
- }
-
+
message = i18n.getString( "everything_is_ok" );
return SUCCESS;
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml 2011-01-25 16:29:50 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml 2011-01-25 19:26:03 +0000
@@ -71,12 +71,6 @@
<property name="validationRuleService">
<ref bean="org.hisp.dhis.validation.ValidationRuleService"/>
</property>
- <property name="periodService">
- <ref bean="org.hisp.dhis.period.PeriodService"/>
- </property>
- <property name="dataSetService">
- <ref bean="org.hisp.dhis.dataset.DataSetService"/>
- </property>
</bean>
<bean id="org.hisp.dhis.validationrule.action.SetupTreeAction"
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties 2011-01-25 16:29:50 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties 2011-01-25 19:26:03 +0000
@@ -145,5 +145,4 @@
specify_organisationunit_has_children = Please specify an organisationunit which has children.
get_report_as_xls = Download as Excel
get_report_as_csv = Download as CSV
-get_report_as_pdf = Download as PDF
-specify_period_type_used_in_dataset_has_member = Please specify a period type which being used in data set has elements.
\ No newline at end of file
+get_report_as_pdf = Download as PDF
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module_vi_VN.properties'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module_vi_VN.properties 2011-01-25 16:29:50 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module_vi_VN.properties 2011-01-25 19:26:03 +0000
@@ -49,5 +49,4 @@
source= \u0110\u01a1n v\u1ecb
period= Th\u1eddi \u0111i\u1ec3m
value= Gi\u00e1 tr\u1ecb
-data_quality_report = B\u00e1o c\u00e1o ch\u1ea5t l\u01b0\u1ee3ng d\u1eef li\u1ec7u
-specify_period_type_used_in_dataset_has_member = Vui lo\u0300ng cho\u0323n ki\u00ea\u0309u th\u01a1\u0300i \u0111i\u00ea\u0309m \u0111ang \u0111\u01b0\u01a1\u0323c s\u01b0\u0309 du\u0323ng trong t\u00e2\u0323p d\u01b0\u0303 li\u00ea\u0323u ma\u0300 co\u0301 ch\u01b0\u0301a ph\u00e2\u0300n t\u01b0\u0309 d\u01b0\u0303 li\u00ea\u0323u.
\ No newline at end of file
+data_quality_report = B\u00e1o c\u00e1o ch\u1ea5t l\u01b0\u1ee3ng d\u1eef li\u1ec7u
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleForm.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleForm.vm 2011-01-25 16:29:50 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleForm.vm 2011-01-25 19:26:03 +0000
@@ -14,7 +14,6 @@
});
checkValueIsExist( "name", "validateValidationRule.action");
- changePeriodType();
}
);
@@ -35,9 +34,9 @@
<td><textarea name="description" style="width:20em; height:6em" class="{validate:{maxlength:255}}"></textarea></td>
</tr>
<tr>
- <td><label for="periodType">$encoder.htmlEncode( $i18n.getString( "period_type" ) )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><label for="periodType">$encoder.htmlEncode( $i18n.getString( "period_type" ) )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
<td>
- <select type="text" id="periodTypeName" name="periodTypeName" style="min-width:20em" onchange="changePeriodType()">
+ <select type="text" id="periodTypeName" name="periodTypeName" style="min-width:20em" >
#foreach ( $periodType in $periodTypes )
<option value="$periodType.name" #if( $periodType.name.equals( ${monthlyPeriodTypeName} ) ) selected #end>$i18n.getString($periodType.name)</option>
#end
@@ -46,7 +45,7 @@
</td>
</tr>
<tr>
- <td><label for="operatorId">$encoder.htmlEncode( $i18n.getString( "operator" ) ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><label for="operatorId">$encoder.htmlEncode( $i18n.getString( "operator" ) ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
<td>
<select id="operator" name="operator" style="width:20em" class="{validate:{required:true}}">
<option value="">[ $i18n.getString( "select_operator" ) ]</option>
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationForm.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationForm.js 2011-01-25 16:29:50 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationForm.js 2011-01-25 19:26:03 +0000
@@ -90,30 +90,8 @@
}
// ---------------------------------------------------------------------
-// PeriodType field
+// disabled PeriodType field
// ---------------------------------------------------------------------
-
-function changePeriodType()
-{
- $.getJSON(
- "validateValidationRule.action",
- {
- "periodTypeName": getFieldValue("periodTypeName")
- },
- function( json )
- {
- if ( json.response == "input" )
- {
- showWarningMessage( json.message );
- }
- }
- );
-}
-
-/**
- * Disabled PeriodType field
- */
-
function disabledPeriodTypeField(){
if(getFieldValue( 'leftSideExpression' ) == '' &&
getFieldValue( 'rightSideExpression' ) == '') {
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleForm.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleForm.vm 2011-01-25 16:29:50 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleForm.vm 2011-01-25 19:26:03 +0000
@@ -12,9 +12,12 @@
validation( 'updateValidationRuleForm', function( form ){
form.submit();
});
-
- checkValueIsExist( "name", "validateValidationRule.action", {id:getFieldValue('id')});
- changePeriodType();
+ /* validation( 'updateValidationRuleForm', function( form ){
+ form.submit();
+ },function(){
+ validateExpression();
+ }); */
+ checkValueIsExist( "name", "validateValidationRule.action", {id:getFieldValue('id')});
}
);
@@ -41,8 +44,8 @@
<td><textarea name="description" style="width:20em; height:6em" class="{validate:{maxlength:255}}">$!encoder.htmlEncode( $validationRule.description )</textarea></td>
</tr>
<tr>
- <td><label for="periodType">$encoder.htmlEncode( $i18n.getString( "period_type" ) )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td><select type="text" id="periodTypeName" name="periodTypeName" style="min-width:20em" onchange="changePeriodType()" disabled>
+ <td><label for="periodType">$encoder.htmlEncode( $i18n.getString( "period_type" ) )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
+ <td><select type="text" id="periodTypeName" name="periodTypeName" style="min-width:20em" disabled>
#foreach ( $periodType in $periodTypes )
<option value="$periodType.name" #if( $validationRule.periodType.name.equals($periodType.name ) ) selected #end>$i18n.getString($periodType.name)</option>
#end
@@ -51,7 +54,7 @@
</td>
</tr>
<tr>
- <td><label for="operatorId">$encoder.htmlEncode( $i18n.getString( "operator" ) ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><label for="operatorId">$encoder.htmlEncode( $i18n.getString( "operator" ) ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
<td>
<select id="operator" name="operator" style="width:20em">
<option value="equal_to" #if ( $validationRule.operator == 'equal_to' )selected="selected"#end>$encoder.htmlEncode( $i18n.getString( "equal_to" ) )</option>