← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18819: Approval, introduced property ignoreApproval on DataElementCategoryOptionCombo

 

------------------------------------------------------------
revno: 18819
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-04-07 12:51:20 +0200
message:
  Approval, introduced property ignoreApproval on DataElementCategoryOptionCombo
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOptionCombo.hbm.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateCategoryOptionComboAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateCategoryOptionCombo.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/dataelement/DataElementCategoryOptionCombo.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java	2015-03-10 14:11:07 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionCombo.java	2015-04-07 10:51:20 +0000
@@ -77,6 +77,11 @@
      */
     @Scanned
     private Set<DataElementCategoryOption> categoryOptions = new HashSet<>();
+    
+    /**
+     * Indicates whether to ignore data approval.
+     */
+    private boolean ignoreApproval;
 
     // -------------------------------------------------------------------------
     // Transient properties
@@ -361,7 +366,7 @@
     @Override
     public void setShortName( String shortName )
     {
-        // throw new UnsupportedOperationException( "Cannot set shortName on DataElementCategoryOptionCombo: " + shortName );
+        // Not supported
     }
 
     @JsonProperty
@@ -393,6 +398,18 @@
         this.categoryOptions = categoryOptions;
     }
 
+    @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public boolean isIgnoreApproval()
+    {
+        return ignoreApproval;
+    }
+
+    public void setIgnoreApproval( boolean ignoreApproval )
+    {
+        this.ignoreApproval = ignoreApproval;
+    }
+    
     @Override
     public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
     {

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2015-04-03 15:32:17 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2015-04-07 10:51:20 +0000
@@ -809,6 +809,8 @@
         executeSql( "UPDATE attributevalue SET lastupdated=now() WHERE lastupdated IS NULL" );
         
         executeSql( "update dashboarditem set shape = 'normal' where shape is null" );
+        
+        executeSql( "update categoryoptioncombo set ignoreapproval = false where ignoreapproval is null" );
 
         upgradeDataValuesWithAttributeOptionCombo();
         upgradeCompleteDataSetRegistrationsWithAttributeOptionCombo();

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOptionCombo.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOptionCombo.hbm.xml	2014-03-11 11:05:18 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOptionCombo.hbm.xml	2015-04-07 10:51:20 +0000
@@ -27,6 +27,8 @@
         foreign-key="fk_categoryoptioncombo_categoryoptionid" />
     </set>
 
+	<property name="ignoreApproval" column="ignoreapproval" />
+
     <join table="categorycombos_optioncombos">
       <key column="categoryoptioncomboid" />
       <many-to-one name="categoryCombo" column="categorycomboid" />

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateCategoryOptionComboAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateCategoryOptionComboAction.java	2015-03-11 11:01:16 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateCategoryOptionComboAction.java	2015-04-07 10:51:20 +0000
@@ -71,6 +71,13 @@
         this.code = code;
     }
 
+    private boolean ignoreApproval;
+
+    public void setIgnoreApproval( boolean ignoreApproval )
+    {
+        this.ignoreApproval = ignoreApproval;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -81,6 +88,7 @@
         DataElementCategoryOptionCombo optionCombo = categoryService.getDataElementCategoryOptionCombo( id );
         
         optionCombo.setCode( StringUtils.trimToNull( code ) );
+        optionCombo.setIgnoreApproval( ignoreApproval );
 
         categoryService.updateDataElementCategoryOptionCombo( optionCombo );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties	2015-01-24 11:55:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties	2015-04-07 10:51:20 +0000
@@ -239,4 +239,5 @@
 average_sum_in_org_unit_hierarchy=Average (sum in org unit hierarchy)
 approve_data=Approve data
 decimals_in_data_output=Decimals in data output
-categories = Categories
\ No newline at end of file
+categories = Categories
+ignore_data_approval=Ignore data approval
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateCategoryOptionCombo.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateCategoryOptionCombo.vm	2014-09-12 14:17:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateCategoryOptionCombo.vm	2015-04-07 10:51:20 +0000
@@ -28,6 +28,15 @@
 	  <td><label>$i18n.getString( "code" )</label></td>
 	  <td><input type="text" id="code" name="code" value="$!encoder.htmlEncode( $optionCombo.code )" /></td>
     </tr>
+    <tr>
+   		<td><label for="ignoreApproval ">$i18n.getString( "ignore_data_approval" )</label></td>
+   		<td>
+   			<select id="ignoreApproval" name="ignoreApproval">
+   				<option value="false">$i18n.getString( "no" )</option>
+   				<option value="true" #if( $!optionCombo.ignoreApproval ) selected="selected" #end>$i18n.getString( "yes" )</option>
+   			</select>
+        </td>
+    </tr>
 	<tr>
 		<td></td>
 		<td>