← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2392: Remove Define Criteria Association function into Program ( into Patient module ).

 

------------------------------------------------------------
revno: 2392
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-10-20 19:11:27 +0700
message:
  Remove Define Criteria Association function into Program ( into Patient module ).
removed:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/DefineCriteriaAssociationsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/ShowValidationCriteriaAssociationsFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteriaAssociations.vm
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.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
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/DefineCriteriaAssociationsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/DefineCriteriaAssociationsAction.java	2010-05-17 02:59:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/DefineCriteriaAssociationsAction.java	1970-01-01 00:00:00 +0000
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2004-2010, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.hisp.dhis.patient.action.program;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramService;
-import org.hisp.dhis.validation.ValidationCriteria;
-import org.hisp.dhis.validation.ValidationCriteriaService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Chau Thu Tran
- * @version DefineCriteriaAssociationsAction.java May 4, 2010 11:25:46 AM
- */
-public class DefineCriteriaAssociationsAction implements Action {
-	// -------------------------------------------------------------------------
-	// Dependencies
-	// -------------------------------------------------------------------------
-
-	private ProgramService programService;
-
-	private ValidationCriteriaService validationCriteriaService;
-
-	// -------------------------------------------------------------------------
-	// Input
-	// -------------------------------------------------------------------------
-
-	private Integer programId;
-
-	private Integer[] criteriaIds;
-
-	// -------------------------------------------------------------------------
-	// Setters
-	// -------------------------------------------------------------------------
-
-	public void setProgramService(ProgramService programService) {
-		this.programService = programService;
-	}
-
-	public void setValidationCriteriaService(
-			ValidationCriteriaService validationCriteriaService) {
-		this.validationCriteriaService = validationCriteriaService;
-	}
-
-	public void setProgramId(Integer programId) {
-		this.programId = programId;
-	}
-
-	public void setCriteriaIds(Integer[] criteriaIds) {
-		this.criteriaIds = criteriaIds;
-	}
-
-	// -------------------------------------------------------------------------
-	// Action implementation
-	// -------------------------------------------------------------------------
-
-	@Override
-	public String execute() throws Exception {
-		
-		Program program = programService.getProgram(programId);
-
-		Set<ValidationCriteria> criteria = new HashSet<ValidationCriteria>();
-		
-		if (criteriaIds != null) {
-		
-			for (Integer id : criteriaIds) {
-
-				criteria.add(validationCriteriaService.getValidationCriteria(id));
-			}
-		}
-		
-		program.setPatientValidationCriteria(criteria);
-		
-		programService.updateProgram(program);
-
-		return SUCCESS;
-	}
-}

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/ShowValidationCriteriaAssociationsFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/ShowValidationCriteriaAssociationsFormAction.java	2010-05-14 02:25:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/ShowValidationCriteriaAssociationsFormAction.java	1970-01-01 00:00:00 +0000
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2004-2010, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.hisp.dhis.patient.action.program;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramService;
-import org.hisp.dhis.program.ProgramStage;
-import org.hisp.dhis.validation.ValidationCriteria;
-import org.hisp.dhis.validation.ValidationCriteriaService;
-import org.hisp.dhis.validation.comparator.ValidationCriteriaComparator;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Chau Thu Tran
- * @version ShowValidationAssociationFormAction.java May 5, 2010 9:35:09 AM
- */
-public class ShowValidationCriteriaAssociationsFormAction
-    implements Action
-{
-
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private ProgramService programService;
-
-    private ValidationCriteriaService validationCriteriaService;
-
-    // -------------------------------------------------------------------------
-    // Input
-    // -------------------------------------------------------------------------
-
-    private Integer id;
-
-    // -------------------------------------------------------------------------
-    // Output
-    // -------------------------------------------------------------------------
-
-    private Program program;
-
-    private Collection<ProgramStage> stages;
-
-    private List<ValidationCriteria> criteria;
-
-    // -------------------------------------------------------------------------
-    // Getters && Setters
-    // -------------------------------------------------------------------------
-
-    public void setValidationCriteriaService( ValidationCriteriaService validationCriteriaService )
-    {
-        this.validationCriteriaService = validationCriteriaService;
-    }
-
-    public Program getProgram()
-    {
-        return program;
-    }
-
-    public List<ValidationCriteria> getCriteria()
-    {
-        return criteria;
-    }
-
-    public void setProgramService( ProgramService programService )
-    {
-        this.programService = programService;
-    }
-
-    public Collection<ProgramStage> getStages()
-    {
-        return stages;
-    }
-
-    public void setId( Integer id )
-    {
-        this.id = id;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    @Override
-    public String execute()
-        throws Exception
-    {
-        program = programService.getProgram( id );
-
-        // Get validation-criteria
-
-        criteria = new ArrayList<ValidationCriteria>( validationCriteriaService.getAllValidationCriterias() );
-
-        criteria.removeAll( program.getPatientValidationCriteria() );
-
-        Collections.sort( criteria, new ValidationCriteriaComparator() );
-
-        return SUCCESS;
-    }
-
-}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml	2010-10-20 07:16:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml	2010-10-20 12:11:27 +0000
@@ -621,24 +621,6 @@
 		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
 	</bean>
 	
-	<!-- Program_ValidationCriteria Association  -->
-
-	<bean
-		id="org.hisp.dhis.patient.action.program.ShowValidationCriteriaAssociationsFormAction"
-		class="org.hisp.dhis.patient.action.program.ShowValidationCriteriaAssociationsFormAction"
-		scope="prototype">
-		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
-		<property name="validationCriteriaService" ref="org.hisp.dhis.validation.ValidationCriteriaService" />
-	</bean>
-	
-	<bean
-		id="org.hisp.dhis.patient.action.program.DefineCriteriaAssociationsAction"
-		class="org.hisp.dhis.patient.action.program.DefineCriteriaAssociationsAction"
-		scope="prototype">
-		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
-		<property name="validationCriteriaService" ref="org.hisp.dhis.validation.ValidationCriteriaService" />
-	</bean>
-	
 	<!-- Program_ValidationDE Association  -->
 
 	<bean

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2010-10-20 09:27:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2010-10-20 12:11:27 +0000
@@ -625,26 +625,7 @@
 			<result name="success" type="redirect">program.action</result>
 			<param name="requiredAuthorities">F_PROGRAM_UPDATE</param>
 		</action>
-
-		<!-- Program_ValidationCriteria Association -->
-
-		<action name="defineValidationCriteriaAssociationsForm"
-			class="org.hisp.dhis.patient.action.program.ShowValidationCriteriaAssociationsFormAction">
-			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">/dhis-web-maintenance-patient/validationCriteriaAssociations.vm</param>
-			<param name="javascripts">
-				,javascript/program.js
-			</param>
-			<param name="requiredAuthorities">F_PROGRAM_UPDATE</param>
-		</action>
-
-		<action name="defineCriteriaAssociations"
-			class="org.hisp.dhis.patient.action.program.DefineCriteriaAssociationsAction">
-			<result name="success" type="velocity-xml">
-				/dhis-web-maintenance-patient/responseSuccess.vm</result>
-			<param name="requiredAuthorities">F_PROGRAM_UPDATE</param>
-		</action>
-
+	
 		<!-- Program_ValidationDE Association -->
 
 		<action name="defineValidationDEAssociationsForm"

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js	2010-10-01 09:41:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js	2010-10-20 12:11:27 +0000
@@ -30,24 +30,6 @@
 }
 
 // -----------------------------------------------------------------------------
-// Criteria association
-// -----------------------------------------------------------------------------
-
-function assignCriteria(){
-
-	var params = 'programId=' + getFieldValue( 'programId' ) + "&" + getParamString('criteriaIds');
-	
-	var request = new Request();
-    request.setResponseTypeXML( 'xmlObject' );
-    request.setCallbackSuccess( function(data){
-		window.location.href = 'program.action';
-	} );
-	request.sendAsPost( params );
-    request.send( "defineCriteriaAssociations.action" );
-        
-}
-
-// -----------------------------------------------------------------------------
 // Create validation for dataelements into program-stages
 // -----------------------------------------------------------------------------
 var dataelementId;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm	2010-10-20 09:27:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm	2010-10-20 12:11:27 +0000
@@ -42,10 +42,6 @@
 		</td>
 		
 		<td style="text-align:center" #alternate( $mark )>
-		  <a href="defineValidationCriteriaAssociationsForm.action?id=$program.id" title="$i18n.getString( "validation_associations" )"><img src="../images/assign_a.png" alt="$i18n.getString( "validation_associations" )"></a>
-		</td>
-		
-		<td style="text-align:center" #alternate( $mark )>
 		  <a href="defineValidationDEAssociationsForm.action?id=$program.id" title="$i18n.getString( "validationDE_associations" )"><img src="../images/assign_b.png" alt="$i18n.getString( "validationDE_associations" )"></a>
 		</td>
 		

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteriaAssociations.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteriaAssociations.vm	2010-05-14 04:13:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteriaAssociations.vm	1970-01-01 00:00:00 +0000
@@ -1,50 +0,0 @@
-
-<h3>$i18n.getString( "define_validation_associations" ) </h3>
-
-<form>
-<table>
-<input type='hidden' id='programId' name='programId' value="$program.id">
-<tr>
-  <th colspan="3">$i18n.getString('criteria')</th>
-</tr>
-<tr>
-  <td><label>$i18n.getString('available_criteria')</label></td>
-  <td>&nbsp;</td>
-  <td><label>$i18n.getString('selected_criteria')</label></td>
-</tr>
-<tr>
-	<td>
-		<select multiple id='avalableCriteriaIds' name='avalableCriteriaIds' size="8" style="width:30em " ondblclick="moveSelectedById('avalableCriteriaIds', 'criteriaIds');">
-			#foreach($c in $criteria)
-			<option value='$c.id'>$c.name</option>
-			#end
-		</select>
-	</td>
-	<td width="42" align='center'>
-		<input type="button" value="&gt;" onclick="moveSelectedById('avalableCriteriaIds', 'criteriaIds');" style="width:42px">
-		<input type="button" value="&lt;" onclick="moveSelectedById('criteriaIds', 'avalableCriteriaIds');" style="width:42px"><br>
-		<input type="button" value="&gt;&gt;" onclick="moveAllById('avalableCriteriaIds', 'criteriaIds');" style="width:42px"><br>
-		<input type="button" value="&lt;&lt;" onclick="moveAllById('criteriaIds', 'avalableCriteriaIds');" style="width:42px">
-	</td>
-	<td>
-		<select multiple id='criteriaIds' name='criteriaIds' size="8" style="width:30em " ondblClick="moveSelectedById('criteriaIds', 'avalableCriteriaIds');">
-			#foreach($c in $program.patientValidationCriteria)
-			<option value='$c.id'>$c.name</option>
-			#end
-		</select>
-	</td>
-</tr>
-
-<tr>
-    <td>
-		<input type="button" onClick="assignCriteria();" value="$i18n.getString('save')" style="width:10em">
-        <input type="button" onClick="window.location.href = 'program.action';" value="$i18n.getString('cancel')" style="width:10em">
-	</td>
-	<td></td>
-	<td></td>
-</tr>
-</table>
-
-<script>
-	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patient" ) , "'" )';
-</script>