dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31860
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16272: Allow to add indicators for program stages in Add/Update program-stage forms and display the sele...
------------------------------------------------------------
revno: 16272
committer: Tran Chau<tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-07-30 00:14:27 +0700
message:
Allow to add indicators for program stages in Add/Update program-stage forms and display the selected indicator values in case entry form.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/GetProgramStageAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/RemoveProgramStageAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/addProgramStageForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/updateProgramStageForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.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/program/ProgramStage.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2014-07-12 21:07:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2014-07-29 17:14:27 +0000
@@ -34,6 +34,7 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.DxfNamespaces;
import org.hisp.dhis.common.IdentifiableObject;
@@ -43,7 +44,9 @@
import org.hisp.dhis.dataentryform.DataEntryForm;
import org.hisp.dhis.trackedentity.TrackedEntityInstanceReminder;
+import java.util.ArrayList;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
/**
@@ -72,7 +75,9 @@
private Program program;
- private Set<ProgramStageDataElement> programStageDataElements = new HashSet<>();
+ private Set<ProgramStageDataElement> programStageDataElements = new HashSet<ProgramStageDataElement>();
+
+ private List<ProgramIndicator> programIndicators = new ArrayList<ProgramIndicator>();
@Scanned
private Set<ProgramStageSection> programStageSections = new HashSet<>();
@@ -419,6 +424,20 @@
this.reportDateToUse = reportDateToUse;
}
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlElementWrapper( localName = "programIndicators", namespace = DxfNamespaces.DXF_2_0 )
+ @JacksonXmlProperty( localName = "programIndicator", namespace = DxfNamespaces.DXF_2_0 )
+ public List<ProgramIndicator> getProgramIndicators()
+ {
+ return programIndicators;
+ }
+
+ public void setProgramIndicators( List<ProgramIndicator> programIndicators )
+ {
+ this.programIndicators = programIndicators;
+ }
+
@Override
public void mergeWith( IdentifiableObject other )
{
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml 2014-06-12 09:41:31 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml 2014-07-29 17:14:27 +0000
@@ -70,6 +70,12 @@
<property name="openAfterEnrollment" />
<property name="reportDateToUse" />
+
+ <list name="programIndicators" table="programstage_programindicators">
+ <key column="programStageid" />
+ <list-index column="sort_order" base="1" />
+ <many-to-many class="org.hisp.dhis.program.ProgramIndicator" column="programindicatorid" />
+ </list>
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java 2014-07-29 17:14:27 +0000
@@ -310,7 +310,7 @@
// ---------------------------------------------------------------------
// Get program indicators
// ---------------------------------------------------------------------
-
+
programIndicatorsMap.putAll( programIndicatorService.getProgramIndicatorValues( programStageInstance
.getProgramInstance() ) );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm 2014-07-08 06:30:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm 2014-07-29 17:14:27 +0000
@@ -50,16 +50,16 @@
</tr>
#end
- #foreach($key in $programIndicatorsMap.keySet())
+ #foreach( $indicator in $programStage.programIndicators )
<tr>
- <td colspan='3' class='bold'>$key: $programIndicatorsMap.get($key)</td>
+ <td>$indicator.displayName</td>
+ <td>$encoder.htmlEncode( $programIndicatorsMap.get($indicator.displayName) )</td>
</tr>
#end
-
</table>
<br>
-
+
#if( $customDataEntryFormCode )
#parse( "/dhis-web-caseentry/customDataEntryForm.vm" )
#elseif( $sections && $sections.size() > 0 )
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramAction.java 2014-05-14 15:14:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramAction.java 2014-07-29 17:14:27 +0000
@@ -29,15 +29,20 @@
*/
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
import org.hisp.dhis.oust.manager.SelectionTreeManager;
import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramIndicator;
+import org.hisp.dhis.program.ProgramIndicatorService;
import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.user.UserGroup;
import org.hisp.dhis.user.UserGroupService;
+import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.Action;
@@ -73,6 +78,9 @@
this.userGroupService = userGroupService;
}
+ @Autowired
+ private ProgramIndicatorService programIndicatorService;
+
// -------------------------------------------------------------------------
// Input/Output
// -------------------------------------------------------------------------
@@ -129,6 +137,13 @@
return userGroups;
}
+ private List<ProgramIndicator> programIndicators;
+
+ public List<ProgramIndicator> getProgramIndicators()
+ {
+ return programIndicators;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -141,7 +156,11 @@
selectionTreeManager.setSelectedOrganisationUnits( program.getOrganisationUnits() );
userGroups = new ArrayList<UserGroup>( userGroupService.getAllUserGroups() );
-
+
+ programIndicators = new ArrayList<ProgramIndicator>( programIndicatorService.getProgramIndicators( program ) );
+
+ Collections.sort( programIndicators, IdentifiableObjectNameComparator.INSTANCE );
+
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java 2014-07-27 12:49:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java 2014-07-29 17:14:27 +0000
@@ -37,6 +37,8 @@
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramIndicator;
+import org.hisp.dhis.program.ProgramIndicatorService;
import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageDataElement;
@@ -46,6 +48,7 @@
import org.hisp.dhis.trackedentity.TrackedEntityInstanceReminder;
import org.hisp.dhis.user.UserGroup;
import org.hisp.dhis.user.UserGroupService;
+import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.Action;
@@ -96,6 +99,9 @@
this.userGroupService = userGroupService;
}
+ @Autowired
+ private ProgramIndicatorService programIndicatorService;
+
// -------------------------------------------------------------------------
// Input/Output
// -------------------------------------------------------------------------
@@ -308,6 +314,13 @@
this.reportDateToUse = reportDateToUse;
}
+ private List<Integer> selectedIndicators = new ArrayList<Integer>();
+
+ public void setSelectedIndicators( List<Integer> selectedIndicators )
+ {
+ this.selectedIndicators = selectedIndicators;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -356,13 +369,26 @@
programStage.setOpenAfterEnrollment( openAfterEnrollment );
programStage.setReportDateToUse( reportDateToUse );
+ // Program indicators
+
+ List<ProgramIndicator> programIndicators = new ArrayList<ProgramIndicator>();
+ for ( Integer id : selectedIndicators )
+ {
+ ProgramIndicator indicator = programIndicatorService.getProgramIndicator( id );
+ programIndicators.add( indicator );
+ }
+ programStage.setProgramIndicators( programIndicators );
+
+
+ // SMS Reminder
+
Set<TrackedEntityInstanceReminder> reminders = new HashSet<TrackedEntityInstanceReminder>();
for ( int i = 0; i < daysAllowedSendMessages.size(); i++ )
{
- TrackedEntityInstanceReminder reminder = new TrackedEntityInstanceReminder( "", daysAllowedSendMessages.get( i ),
- templateMessages.get( i ) );
+ TrackedEntityInstanceReminder reminder = new TrackedEntityInstanceReminder( "",
+ daysAllowedSendMessages.get( i ), templateMessages.get( i ) );
reminder.setDateToCompare( TrackedEntityInstanceReminder.DUE_DATE_TO_COMPARE );
- reminder.setName(program.getName() + "-" + name + "-" + i);
+ reminder.setName( program.getName() + "-" + name + "-" + i );
reminder.setSendTo( sendTo.get( i ) );
reminder.setWhenToSend( whenToSend.get( i ) );
reminder.setMessageType( messageType.get( i ) );
@@ -379,14 +405,17 @@
}
programStage.setReminders( reminders );
program.getProgramStages().add( programStage );
+
programStageService.saveProgramStage( programStage );
List<ProgramStage> programStages = new ArrayList<ProgramStage>( program.getProgramStages() );
Collections.sort( programStages, new ProgramStageMinDaysComparator() );
program.getProgramStages().clear();
- program.setProgramStages(programStages);
+ program.setProgramStages( programStages );
programService.updateProgram( program );
-
+
+ // Data elements
+
for ( int i = 0; i < this.selectedDataElementsValidator.size(); i++ )
{
DataElement dataElement = dataElementService.getDataElement( selectedDataElementsValidator.get( i ) );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/GetProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/GetProgramStageAction.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/GetProgramStageAction.java 2014-07-29 17:14:27 +0000
@@ -32,11 +32,14 @@
import java.util.Collection;
import java.util.List;
+import org.hisp.dhis.program.ProgramIndicator;
+import org.hisp.dhis.program.ProgramIndicatorService;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageDataElement;
import org.hisp.dhis.program.ProgramStageService;
import org.hisp.dhis.user.UserGroup;
import org.hisp.dhis.user.UserGroupService;
+import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.Action;
@@ -66,6 +69,9 @@
this.userGroupService = userGroupService;
}
+ @Autowired
+ private ProgramIndicatorService programIndicatorService;
+
// -------------------------------------------------------------------------
// Input/Output
// -------------------------------------------------------------------------
@@ -107,6 +113,13 @@
{
this.userGroups = userGroups;
}
+
+ private List<ProgramIndicator> programIndicators;
+
+ public List<ProgramIndicator> getProgramIndicators()
+ {
+ return programIndicators;
+ }
// -------------------------------------------------------------------------
// Action implementation
@@ -120,7 +133,10 @@
programStageDataElements = programStage.getProgramStageDataElements();
userGroups = new ArrayList<UserGroup>( userGroupService.getAllUserGroups() );
-
+
+ programIndicators = new ArrayList<ProgramIndicator>( programIndicatorService.getProgramIndicators( programStage.getProgram() ) );
+ programIndicators.removeAll( programStage.getProgramIndicators() );
+
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/RemoveProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/RemoveProgramStageAction.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/RemoveProgramStageAction.java 2014-07-29 17:14:27 +0000
@@ -28,9 +28,18 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
import org.hisp.dhis.common.DeleteNotAllowedException;
import org.hisp.dhis.i18n.I18n;
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramService;
+import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageService;
+import org.hisp.dhis.program.comparator.ProgramStageMinDaysComparator;
+import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.Action;
@@ -52,6 +61,9 @@
{
this.programStageService = programStageService;
}
+
+ @Autowired
+ private ProgramService programService;
// -------------------------------------------------------------------------
// Input/Output
@@ -91,7 +103,15 @@
{
try
{
- programStageService.deleteProgramStage( programStageService.getProgramStage( id ) );
+ ProgramStage programStage = programStageService.getProgramStage( id );
+ Program program = programStage.getProgram();
+ program.getProgramStages().remove( programStage );
+ programStageService.deleteProgramStage( programStage );
+
+ List<ProgramStage> programStages = new ArrayList<ProgramStage>( program.getProgramStages() );
+ Collections.sort( programStages, new ProgramStageMinDaysComparator() );
+ program.setProgramStages( programStages );
+ programService.updateProgram( program );
}
catch ( DeleteNotAllowedException ex )
{
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java 2014-07-27 12:49:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java 2014-07-29 17:14:27 +0000
@@ -37,6 +37,8 @@
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramIndicator;
+import org.hisp.dhis.program.ProgramIndicatorService;
import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageDataElement;
@@ -306,7 +308,17 @@
{
this.reportDateToUse = reportDateToUse;
}
-
+
+ private List<Integer> selectedIndicators = new ArrayList<Integer>();
+
+ public void setSelectedIndicators( List<Integer> selectedIndicators )
+ {
+ this.selectedIndicators = selectedIndicators;
+ }
+
+ @Autowired
+ private ProgramIndicatorService programIndicatorService;
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -356,7 +368,18 @@
programStage.setValidCompleteOnly( validCompleteOnly );
programStage.setCaptureCoordinates( captureCoordinates );
+ // Program indicators
+
+ List<ProgramIndicator> programIndicators = new ArrayList<ProgramIndicator>();
+ for ( Integer id : selectedIndicators )
+ {
+ ProgramIndicator indicator = programIndicatorService.getProgramIndicator( id );
+ programIndicators.add( indicator );
+ }
+ programStage.setProgramIndicators( programIndicators );
+
// SMS Reminder
+
programStage.getReminders().clear();
Set<TrackedEntityInstanceReminder> reminders = new HashSet<TrackedEntityInstanceReminder>();
for ( int i = 0; i < this.daysAllowedSendMessages.size(); i++ )
@@ -380,7 +403,6 @@
reminders.add( reminder );
}
programStage.setReminders( reminders );
-
programStageService.updateProgramStage( programStage );
Program program = programStage.getProgram();
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties 2014-07-02 12:11:16 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties 2014-07-29 17:14:27 +0000
@@ -496,4 +496,7 @@
hide_advanced_options = Hide advanced options
tracked_entity_registration_form_manegement = Tracked entity registration form management
program_validation_rule_management=Program validation rule management
-confidential = Confidential
\ No newline at end of file
+confidential = Confidential
+available_indicators = Available indicators
+selected_indicators = Selected indicators
+program_indicator_management_form = Program indicator management form
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm 2014-07-27 15:02:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramStageForm.vm 2014-07-29 17:14:27 +0000
@@ -208,6 +208,42 @@
</tbody>
</table>
+<table>
+ <colgroup>
+ <col style='width:500px'/>
+ <col/>
+ <col style='width:500px'/>
+ </colgroup>
+ <tr>
+ <th>$i18n.getString( "available_indicators" )</th>
+ <th>$i18n.getString( "filter" )</th>
+ <th>$i18n.getString( "selected_indicators" )</th>
+ </tr>
+
+ <tr>
+ <td>
+ <select style="height: 200px; width: 100%;" multiple="multiple" id="availableIndicators" name="availableIndicators" ondblclick="moveSelectedById( 'availableIndicators', 'selectedIndicators' )" >
+ #foreach( $indicator in $programIndicators )
+ <option value="$indicator.id">$encoder.htmlEncode( $indicator.displayName )</option>
+ #end
+ </select>
+ </td>
+ <td>
+ <input type="button" value=">" title="$i18n.getString('move_selected')" onclick="moveSelectedById( 'availableIndicators', 'selectedIndicators' )" class='filterButton'/><br/>
+ <input type="button" value="<" title="$i18n.getString('remove_selected')" onclick="moveSelectedById( 'selectedIndicators', 'availableIndicators' )" class='filterButton'/><br/>
+ <input type="button" value=">>" onclick="moveAllById( 'availableIndicators', 'selectedIndicators' )" class='filterButton' /><br/>
+ <input type="button" value="<<" onclick="moveAllById( 'selectedIndicators', 'availableIndicators' )" class='filterButton' />
+ </td>
+ <td>
+ <select style="height: 200px; width: 100%; margin-top: 22px;" multiple="multiple" id="selectedIndicators" name="selectedIndicators" ondblclick="moveSelectedById( 'selectedIndicators', 'availableIndicators' )"></select>
+ </td>
+ <td>
+ <a href="javascript:moveUpSelectedOption( 'selectedIndicators')" title="$i18n.getString( 'move_up' )"><img src="../images/move_up.png" alt="$i18n.getString( 'move_up' )"/></a><br/><br/>
+ <a href="javascript:moveDownSelectedOption( 'selectedIndicators' )" title="$i18n.getString( 'move_down' )"><img src="../images/move_down.png" alt="$i18n.getString( 'move_up' )"/></a>
+ </td>
+ </tr>
+</table>
+
<p>
<input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/>
<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='programStage.action?id=$program.id'" style="width:10em"/>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/addProgramStageForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/addProgramStageForm.js 2014-06-21 09:56:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/addProgramStageForm.js 2014-07-29 17:14:27 +0000
@@ -4,6 +4,8 @@
validation( 'addProgramStageForm', function( form ){
form.submit();
}, function(){
+ selectAllById('selectedIndicators');
+
var selectedDataElementsValidator = jQuery( "#selectedDataElementsValidator" );
selectedDataElementsValidator.empty();
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/updateProgramStageForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/updateProgramStageForm.js 2014-06-21 09:56:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/updateProgramStageForm.js 2014-07-29 17:14:27 +0000
@@ -5,6 +5,8 @@
validation( 'updateProgramStageForm', function( form ){
form.submit();
}, function(){
+ selectAllById('selectedIndicators');
+
var selectedDataElementsValidator = jQuery( "#selectedDataElementsValidator" );
selectedDataElementsValidator.empty();
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm 2014-07-28 09:24:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramStageForm.vm 2014-07-29 17:14:27 +0000
@@ -235,6 +235,47 @@
</table>
+
+<table>
+ <colgroup>
+ <col style='width:500px'/>
+ <col/>
+ <col style='width:500px'/>
+ </colgroup>
+ <tr>
+ <th>$i18n.getString( "available_indicators" )</th>
+ <th>$i18n.getString( "filter" )</th>
+ <th>$i18n.getString( "selected_indicators" )</th>
+ </tr>
+
+ <tr>
+ <td>
+ <select style="height: 200px; width: 100%;" multiple="multiple" id="availableIndicators" name="availableIndicators" ondblclick="moveSelectedById( 'availableIndicators', 'selectedIndicators' )" >
+ #foreach( $indicator in $programIndicators )
+ <option value="$indicator.id">$encoder.htmlEncode( $indicator.displayName )</option>
+ #end
+ </select>
+ </td>
+ <td>
+ <input type="button" value=">" title="$i18n.getString('move_selected')" onclick="dhisAjaxSelect_moveAllSelected( 'availableIndicators', 'selectedIndicators' )" class='filterButton'/><br/>
+ <input type="button" value="<" title="$i18n.getString('remove_selected')" onclick="dhisAjaxSelect_moveAllSelected( 'selectedIndicators', 'availableIndicators' )" class='filterButton'/><br/>
+ <input type="button" value=">>" onclick="moveAllById( 'availableIndicators', 'selectedIndicators' )" class='filterButton' /><br/>
+ <input type="button" value="<<" onclick="moveAllById( 'selectedIndicators', 'availableIndicators' )" class='filterButton' />
+ </td>
+ <td>
+ <select style="height: 200px; width: 100%; margin-top: 22px;" multiple="multiple" id="selectedIndicators" name="selectedIndicators" ondblclick="moveSelectedById( 'selectedIndicators', 'availableIndicators' )" >
+ #foreach( $indicator in $programStage.programIndicators )
+ <option value="$indicator.id">$encoder.htmlEncode( $indicator.displayName )</option>
+ #end
+ </select>
+ </td>
+ <td>
+ <a href="javascript:moveUpSelectedOption( 'selectedIndicators')" title="$i18n.getString( 'move_up' )"><img src="../images/move_up.png" alt="$i18n.getString( 'move_up' )"/></a><br/><br/>
+ <a href="javascript:moveDownSelectedOption( 'selectedIndicators' )" title="$i18n.getString( 'move_down' )"><img src="../images/move_down.png" alt="$i18n.getString( 'move_up' )"/></a>
+ </td>
+ </tr>
+</table>
+
<p>
<input type="submit" value="$i18n.getString( 'update' )" style="width:10em">
<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='programStage.action?id=$programStage.program.id'" style="width:10em"/>