dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #39122
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19842: Added execution_date variable for program indicators. Added variables to program indicator filter.
------------------------------------------------------------
revno: 19842
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-08-25 11:48:55 +0200
message:
Added execution_date variable for program indicators. Added variables to program indicator filter.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties
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/programIndicatorForm.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/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java 2015-08-06 17:12:37 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java 2015-08-25 09:48:55 +0000
@@ -74,9 +74,9 @@
private int version;
- private String dateOfEnrollmentDescription;
+ private String dateOfEnrollmentDescription; //TODO rename to enrollmentDateDescription
- private String dateOfIncidentDescription;
+ private String dateOfIncidentDescription; //TODO rename to incidentDateDescription
@Scanned
private Set<OrganisationUnit> organisationUnits = new HashSet<>();
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java 2015-08-22 15:04:37 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java 2015-08-25 09:48:55 +0000
@@ -58,11 +58,14 @@
public static final String KEY_ATTRIBUTE = "A";
public static final String KEY_PROGRAM_VARIABLE = "V";
public static final String KEY_CONSTANT = "C";
+
+ public static final String VAR_EXECUTION_DATE = "execution_date";
public static final String VAR_INCIDENT_DATE = "incident_date";
public static final String VAR_ENROLLMENT_DATE = "enrollment_date";
public static final String VAR_CURRENT_DATE = "current_date";
public static final String VAR_VALUE_COUNT = "value_count";
public static final String VAR_ZERO_POS_VALUE_COUNT = "zero_pos_value_count";
+
public static final String VALUE_TYPE_DATE = "date";
public static final String VALUE_TYPE_INT = "int";
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java 2015-04-09 19:03:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java 2015-08-25 09:48:55 +0000
@@ -74,7 +74,7 @@
private OrganisationUnit organisationUnit;
- private Date dateOfIncident; // TODO rename to incidenceDate
+ private Date dateOfIncident; // TODO rename to incidentDate
private Date enrollmentDate;
=== 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 2015-07-13 12:34:39 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java 2015-08-25 09:48:55 +0000
@@ -65,9 +65,7 @@
extends BaseIdentifiableObject
{
public static final String TYPE_DEFAULT = "default";
-
public static final String TYPE_SECTION = "section";
-
public static final String TYPE_CUSTOM = "custom";
/**
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java 2015-08-22 15:11:02 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java 2015-08-25 09:48:55 +0000
@@ -715,6 +715,10 @@
{
date = programInstance.getDateOfIncident();
}
+ else if ( ProgramIndicator.VAR_EXECUTION_DATE.equals( uid ) )
+ {
+ date = programStageInstance != null ? programStageInstance.getExecutionDate() : null;
+ }
else if ( ProgramIndicator.VAR_CURRENT_DATE.equals( uid ) )
{
date = currentDate;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties 2015-08-23 13:22:07 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties 2015-08-25 09:48:55 +0000
@@ -1004,6 +1004,7 @@
#-- Program indicators --------------------------------------------------------#
+execution_date=Execution date
incident_date=Incident date
enrollment_date=Enrollment date
current_date=Current date
=== 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 2015-08-07 15:23:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties 2015-08-25 09:48:55 +0000
@@ -79,8 +79,6 @@
attribute_options=Attribute options
add_more_option=Add Option
mandatory=Mandatory
-value_count=Value count
-zero_pos_value_count=Zero or positive value count
tracked_entity_attribute_group_management=Tracked entity attribute group management
move_selected=Move selected items
remove_selected=Remove selected items
@@ -311,8 +309,6 @@
display_generate_event_box_after_completed = Display generate event box after completed
pre_generate_event_uid = Pre-generate event UID
calculated = Calculated
-enrollment_date = Enrollment date
-current_date = Current date
display_name = Display name
code_and_name = Code and Name
sort_by = Sort by
@@ -366,7 +362,6 @@
validate_success = The registration form passed validation successfully
ask_user_to_complete_program_when_stage_complete = Ask user to complete program when stage is complete
days_since_enrollment_date = Days since enrollment date
-incident_date = Incident date
date_to_compare = Date to compare
program_indicator_management = Program Indicator Management
view_program_indicators = View program indicators
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm 2015-08-22 14:45:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm 2015-08-25 09:48:55 +0000
@@ -76,8 +76,9 @@
<tr>
<td>
<select multiple id="expression-variables" name="expression-variables" size="7" style="width:100%" ondblclick="insertVariable('expression');" >
+ <option value="execution_date">$i18n.getString( "execution_date" )</option>
<option value="incident_date">$i18n.getString( "incident_date" )</option>
- <option value="enrollment_date">$i18n.getString( "date_of_enrollment" )</option>
+ <option value="enrollment_date">$i18n.getString( "enrollment_date" )</option>
<option value="current_date">$i18n.getString( "current_date" )</option>
<option value="value_count">$i18n.getString( "value_count" )</option>
<option value="zero_pos_value_count">$i18n.getString( "zero_pos_value_count" )</option>
@@ -159,6 +160,7 @@
<li><a href="#filter-tab1">$i18n.getString("data_elements")</a></li>
#if($program.type!='3')
<li><a href="#filter-tab2">$i18n.getString("attributes")</a></li>
+ <li><a href="#filter-tab3">$i18n.getString("variables")</a></li>
#end
<li><a href="#filter-tab4">$i18n.getString("constants")</a></li>
</ul>
@@ -206,6 +208,29 @@
</tr>
</table>
</div>
+
+ <div id="filter-tab3">
+ <table style="width:100%">
+ <tr>
+ <td>
+ <input type='text' id='filter-var-search' onKeyUp="filterExpressionSelect(event, this.value, 'filter-variables');" placeholder="$i18n.getString('filter')" />
+ <input type='button' value='$i18n.getString("clear")' onClick="setFieldValue('filter-var-search', '');" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select multiple id="filter-variables" name="filter-variables" size="7" style="width:100%" ondblclick="insertVariable('filter');" >
+ <option value="execution_date">$i18n.getString( "execution_date" )</option>
+ <option value="incident_date">$i18n.getString( "incident_date" )</option>
+ <option value="enrollment_date">$i18n.getString( "enrollment_date" )</option>
+ <option value="current_date">$i18n.getString( "current_date" )</option>
+ <option value="value_count">$i18n.getString( "value_count" )</option>
+ <option value="zero_pos_value_count">$i18n.getString( "zero_pos_value_count" )</option>
+ </select>
+ </td>
+ </tr>
+ </table>
+ </div>
#end