← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13508: Fixed bug - Remove the assign validation criteria context menu in Validation criteria management.

 

------------------------------------------------------------
revno: 13508
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-12-31 14:25:24 +0700
message:
  Fixed bug - Remove the assign validation criteria context menu in Validation criteria management.
removed:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/DefineProgramListForValidationCriteriaAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/GetProgramListForValidationCriteriaAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programsForValidationCriteriaAssociations.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/validationcriteria.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteria.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/validation/DefineProgramListForValidationCriteriaAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/DefineProgramListForValidationCriteriaAction.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/DefineProgramListForValidationCriteriaAction.java	1970-01-01 00:00:00 +0000
@@ -1,127 +0,0 @@
-package org.hisp.dhis.patient.action.validation;
-
-/*
- * Copyright (c) 2004-2013, 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.
- */
-
-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 DefineProgramListForValidationCriteriaAction.java May 17, 2010
- */
-public class DefineProgramListForValidationCriteriaAction
-    implements Action
-{
-    // -------------------------------------------------------------------------
-    // Dependency
-    // -------------------------------------------------------------------------
-
-    private ValidationCriteriaService validationCriteriaService;
-
-    private ProgramService programService;
-
-    // -------------------------------------------------------------------------
-    // Input && Output
-    // -------------------------------------------------------------------------
-    private Integer criteriaId;
-
-    private Integer[] programIds;
-
-    // -------------------------------------------------------------------------
-    // Setters
-    // -------------------------------------------------------------------------
-
-    public void setValidationCriteriaService( ValidationCriteriaService validationCriteriaService )
-    {
-        this.validationCriteriaService = validationCriteriaService;
-    }
-
-    public void setProgramIds( Integer[] programIds )
-    {
-        this.programIds = programIds;
-    }
-
-    public void setProgramService( ProgramService programService )
-    {
-        this.programService = programService;
-    }
-
-    public void setCriteriaId( Integer criteriaId )
-    {
-        this.criteriaId = criteriaId;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action Implementation
-    // -------------------------------------------------------------------------
-
-    @Override
-    public String execute()
-        throws Exception
-    {
-        ValidationCriteria validationCriteria = validationCriteriaService.getValidationCriteria( criteriaId );
-
-        Set<Program> selectedProgram = new HashSet<Program>();
-
-        if ( programIds != null )
-        {
-            for ( Integer id : programIds )
-            {
-                Program program = programService.getProgram( id );
-
-                program.getPatientValidationCriteria().add( validationCriteria );
-
-                selectedProgram.add( program );
-
-                programService.updateProgram( program );
-
-            }
-        }
-
-        Set<Program> removePrograms = new HashSet<Program>( programService.getAllPrograms() );
-        removePrograms.removeAll( selectedProgram );
-
-        for ( Program program : removePrograms )
-        {
-            program.getPatientValidationCriteria().remove( validationCriteria );
-
-            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/validation/GetProgramListForValidationCriteriaAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/GetProgramListForValidationCriteriaAction.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/GetProgramListForValidationCriteriaAction.java	1970-01-01 00:00:00 +0000
@@ -1,119 +0,0 @@
-package org.hisp.dhis.patient.action.validation;
-
-/*
- * Copyright (c) 2004-2013, 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.
- */
-
-import java.util.Collection;
-
-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 GetProgramListForValidationCriteriaAction.java May 17, 2010
- */
-public class GetProgramListForValidationCriteriaAction
-    implements Action
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private ValidationCriteriaService validationCriteriaService;
-
-    private ProgramService programService;
-
-    // -------------------------------------------------------------------------
-    // Input && Output
-    // -------------------------------------------------------------------------
-    
-    private Integer criteriaId;
-
-    private Collection<Program> selectedPrograms;
-
-    private Collection<Program> availablePrograms;
-
-    private ValidationCriteria validationCriteria;
-
-    // -------------------------------------------------------------------------
-    // Setters
-    // -------------------------------------------------------------------------
-
-    public void setValidationCriteriaService( ValidationCriteriaService validationCriteriaService )
-    {
-        this.validationCriteriaService = validationCriteriaService;
-    }
-
-    public Collection<Program> getSelectedPrograms()
-    {
-        return selectedPrograms;
-    }
-
-    public ValidationCriteria getValidationCriteria()
-    {
-        return validationCriteria;
-    }
-
-    public Collection<Program> getAvailablePrograms()
-    {
-        return availablePrograms;
-    }
-
-    public void setProgramService( ProgramService programService )
-    {
-        this.programService = programService;
-    }
-
-    public void setCriteriaId( Integer criteriaId )
-    {
-        this.criteriaId = criteriaId;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action Implementation
-    // -------------------------------------------------------------------------
-
-    @Override
-    public String execute()
-        throws Exception
-    {
-        validationCriteria = validationCriteriaService.getValidationCriteria( criteriaId );
-
-        selectedPrograms = programService.getPrograms( validationCriteria );
-
-        availablePrograms = programService.getAllPrograms();
-        availablePrograms.removeAll( selectedPrograms );
-        availablePrograms.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
-        
-        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	2013-12-26 08:38:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml	2013-12-31 07:25:24 +0000
@@ -920,31 +920,7 @@
       <ref bean="org.hisp.dhis.program.ProgramService" />
     </property>
   </bean>
-
-  <bean
-    id="org.hisp.dhis.patient.action.validation.GetProgramListForValidationCriteriaAction"
-    class="org.hisp.dhis.patient.action.validation.GetProgramListForValidationCriteriaAction"
-    scope="prototype">
-    <property name="validationCriteriaService">
-      <ref bean="org.hisp.dhis.validation.ValidationCriteriaService" />
-    </property>
-    <property name="programService">
-      <ref bean="org.hisp.dhis.program.ProgramService" />
-    </property>
-  </bean>
-
-  <bean
-    id="org.hisp.dhis.patient.action.validation.DefineProgramListForValidationCriteriaAction"
-    class="org.hisp.dhis.patient.action.validation.DefineProgramListForValidationCriteriaAction"
-    scope="prototype">
-    <property name="validationCriteriaService">
-      <ref bean="org.hisp.dhis.validation.ValidationCriteriaService" />
-    </property>
-    <property name="programService">
-      <ref bean="org.hisp.dhis.program.ProgramService" />
-    </property>
-  </bean>
-
+  
   <bean
     id="org.hisp.dhis.patient.action.validation.GetValidationCriteriaAction"
     class="org.hisp.dhis.patient.action.validation.GetValidationCriteriaAction"

=== 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	2013-12-21 23:14:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2013-12-31 07:25:24 +0000
@@ -978,22 +978,6 @@
 			</result>
 		</action>
 
-		<action name="showProgramsForValidationCriteriaForm"
-			class="org.hisp.dhis.patient.action.validation.GetProgramListForValidationCriteriaAction">
-			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">/dhis-web-maintenance-patient/programsForValidationCriteriaAssociations.vm</param>
-			<param name="javascripts">javascript/program.js</param>
-      <param name="anyAuthorities">F_PROGRAM_PUBLIC_ADD,F_PROGRAM_PRIVATE_ADD</param>
-		</action>
-
-		<action name="defineProgramsForValidationCriteria"
-			class="org.hisp.dhis.patient.action.validation.DefineProgramListForValidationCriteriaAction">
-			<result name="success" type="redirect">
-				validationCriteria.action
-			</result>
-      <param name="anyAuthorities">F_PROGRAM_PUBLIC_ADD,F_PROGRAM_PRIVATE_ADD</param>
-		</action>
-
 		<!-- Program Validation -->
 
 		<action name="programValidation"

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/validationcriteria.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/validationcriteria.js	2013-12-21 23:14:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/validationcriteria.js	2013-12-31 07:25:24 +0000
@@ -5,10 +5,6 @@
   });
 });
 
-function showProgramsForValidationCriteriaForm( context ) {
-  location.href = 'showProgramsForValidationCriteriaForm.action?criteriaId=' + context.id;
-}
-
 function showUpdateValidationCriteriaForm( context ) {
   location.href = 'showUpdateValidationCriteriaForm.action?id=' + context.id + '&programId=' + getFieldValue('programId');
 }

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programsForValidationCriteriaAssociations.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programsForValidationCriteriaAssociations.vm	2013-02-28 07:55:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programsForValidationCriteriaAssociations.vm	1970-01-01 00:00:00 +0000
@@ -1,56 +0,0 @@
-
-<h3>$i18n.getString( "assign_validation_for_programs" ) </h3>
-<h4>$validationCriteria.name</h4>
-
-<form action='defineProgramsForValidationCriteria.action' method='post' onsubmit="selectAllById('programIds');">
-	<input type='hidden' id='criteriaId' name='criteriaId' value="$validationCriteria.id">
-	<table>
-		<colgroup>
-			<col style="width:400px;"/>
-			<col/>
-			<col style="width:400px;"/>
-		</colgroup>
-		<thead>
-			<tr>
-			  <th>$i18n.getString('available_program')</th>
-			  <th>$i18n.getString('filter')</th>
-			  <th>$i18n.getString('selected_program')</th>
-			</tr>
-		</thead>
-		<tr>
-			<td>
-				<select multiple id='avalableProgramIds' name='avalableProgramIds' size="15" style="width:100%;" ondblclick="moveSelectedById('avalableProgramIds', 'programIds');">
-					#foreach($p in $availablePrograms)
-					<option value='$p.id'>$p.name</option>
-					#end
-				</select>
-			</td>
-			<td width="42" align='center'>
-				<input type="button" value="&gt;" onclick="moveSelectedById('avalableProgramIds', 'programIds');" style="width:42px">
-				<input type="button" value="&lt;" onclick="moveSelectedById('programIds', 'avalableProgramIds');" style="width:42px"><br>
-				<input type="button" value="&gt;&gt;" onclick="moveAllById('avalableProgramIds', 'programIds');" style="width:42px"><br>
-				<input type="button" value="&lt;&lt;" onclick="moveAllById('programIds', 'avalableProgramIds');" style="width:42px">
-			</td>
-			<td>
-				<select multiple id='programIds' name='programIds' size="15" style="width:100%;" ondblClick="moveSelectedById('programIds', 'avalableProgramIds');">
-					#foreach($p in $selectedPrograms)
-					<option value='$p.id'>$p.name</option>
-					#end
-				</select>
-			</td>
-		</tr>
-
-		<tr>
-			<td>
-				<input type="submit"value="$i18n.getString('save')" style="width:10em">
-				<input type="button" onClick="window.location.href = 'validationCriteria.action';" value="$i18n.getString('cancel')" style="width:10em">
-			</td>
-			<td></td>
-			<td></td>
-		</tr>
-	</table>
-</form>
-
-<script>
-	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patient" ) , "'" )';
-</script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteria.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteria.vm	2013-12-21 23:14:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteria.vm	2013-12-31 07:25:24 +0000
@@ -3,7 +3,6 @@
 
 <div id="contextMenu" class="contextMenu" style="width: 210px;">
   <ul id="contextMenuItems" class="contextMenuItems">
-    <li><a data-target-fn="showProgramsForValidationCriteriaForm"><i class="fa fa-plus"></i>&nbsp;&nbsp;$i18n.getString( "assign_validation_for_programs" )</a></li>
     <li><a data-target-fn="showUpdateValidationCriteriaForm"><i class="fa fa-edit"></i>&nbsp;&nbsp;$i18n.getString( "edit" )</a></li>
     <li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i>&nbsp;&nbsp;$i18n.getString( "translation_translate" )</a></li>
     <li><a data-target-fn="removeCriteria"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;$i18n.getString( "remove" )</a></li>