dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31309
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15937: Add confidential property for TrackedEntityAttribute object.
------------------------------------------------------------
revno: 15937
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-07-02 20:11:16 +0800
message:
Add confidential property for TrackedEntityAttribute object.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttribute.java
dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java
dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/trackedentity/hibernate/TrackedEntityAttribute.hbm.xml
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonTrackedEntityAttribute.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/AddAttributeAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/UpdateAttributeAction.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/addAttributeForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/attribute.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/attribute.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateAttibuteForm.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/trackedentity/TrackedEntityAttribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttribute.java 2014-05-27 11:24:09 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttribute.java 2014-07-02 12:11:16 +0000
@@ -93,7 +93,9 @@
private Boolean displayInListNoProgram = false;
private Integer sortOrderInListNoProgram;
-
+
+ private Boolean confidential = false;
+
private Boolean unique = false;
// For Local ID type
@@ -310,6 +312,20 @@
this.optionSet = optionSet;
}
+ @JsonProperty
+ @JsonSerialize( as = BaseIdentifiableObject.class )
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+ public Boolean getConfidential()
+ {
+ return confidential;
+ }
+
+ public void setConfidential( Boolean confidential )
+ {
+ this.confidential = confidential;
+ }
+
// -------------------------------------------------------------------------
// Static methods
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java 2014-06-25 21:36:27 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java 2014-07-02 12:11:16 +0000
@@ -285,6 +285,8 @@
int attributeoptioncomboid = categoryService.getDefaultDataElementCategoryOptionCombo().getId();
executeSql( "update datavalue set attributeoptioncomboid=" + attributeoptioncomboid + " where storedby='aggregated_from_tracker' or comment='aggregated_from_tracker'" );
+
+ executeSql( "update trackedentityattribute set confidential = false where confidential is null;" );
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/trackedentity/hibernate/TrackedEntityAttribute.hbm.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/trackedentity/hibernate/TrackedEntityAttribute.hbm.xml 2014-04-13 13:14:11 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/trackedentity/hibernate/TrackedEntityAttribute.hbm.xml 2014-07-02 12:11:16 +0000
@@ -38,6 +38,8 @@
<property name="displayInListNoProgram" />
<property name="sortOrderInListNoProgram" />
+
+ <property name="confidential" />
<property name="unique" column="uniquefield" />
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonTrackedEntityAttribute.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonTrackedEntityAttribute.vm 2014-06-13 10:58:05 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonTrackedEntityAttribute.vm 2014-07-02 12:11:16 +0000
@@ -9,6 +9,7 @@
"valueType": "$!attribute.valueType",
"displayInListNoProgram": "$!attribute.displayInListNoProgram",
"inherit": "$!attribute.inherit",
+ "confidential": "$!attribute.confidential",
"optionSet": "$!attribute.optionSet.name",
"orgunitScope": "$!attribute.orgunitScope",
"programScope": "$!attribute.programScope"
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/AddAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/AddAttributeAction.java 2014-05-17 12:04:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/AddAttributeAction.java 2014-07-02 12:11:16 +0000
@@ -141,6 +141,13 @@
this.scope = scope;
}
+ private Boolean confidential;
+
+ public void setConfidential( Boolean confidential )
+ {
+ this.confidential = confidential;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -164,6 +171,9 @@
inherit = (inherit == null) ? false : true;
attribute.setInherit( inherit );
+ confidential = (confidential == null) ? false : true;
+ attribute.setConfidential( confidential );
+
if ( unique )
{
boolean orgunitScope = false;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/UpdateAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/UpdateAttributeAction.java 2014-05-17 12:04:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/UpdateAttributeAction.java 2014-07-02 12:11:16 +0000
@@ -148,6 +148,13 @@
this.scope = scope;
}
+ private Boolean confidential;
+
+ public void setConfidential( Boolean confidential )
+ {
+ this.confidential = confidential;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -171,6 +178,9 @@
inherit = (inherit == null) ? false : true;
attribute.setInherit( inherit );
+ confidential = (confidential == null) ? false : true;
+ attribute.setConfidential( confidential );
+
if ( unique )
{
boolean orgunitScope = false;
=== 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-06-25 03:57:10 +0000
+++ 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
@@ -495,4 +495,5 @@
show_advanced_options = Show advanced options
hide_advanced_options = Hide advanced options
tracked_entity_registration_form_manegement = Tracked entity registration form management
-program_validation_rule_management=Program validation rule management
\ No newline at end of file
+program_validation_rule_management=Program validation rule management
+confidential = Confidential
\ 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/addAttributeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addAttributeForm.vm 2014-06-02 02:07:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addAttributeForm.vm 2014-07-02 12:11:16 +0000
@@ -60,6 +60,14 @@
<td></td>
</tr>
+ <tr>
+ <td><label for="confidential">$i18n.getString( "confidential" )</label></td>
+ <td>
+ <input type='checkbox' id="confidential" name="confidential" value='true'>
+ </td>
+ <td></td>
+ </tr>
+
<tr>
<td><label for="valueType">$i18n.getString( "value_type" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/attribute.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/attribute.vm 2014-06-13 10:58:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/attribute.vm 2014-07-02 12:11:16 +0000
@@ -58,6 +58,7 @@
<p><label class="bold">$i18n.getString( "unique" ):</label><br><span id="uniqueField"></span></p>
<p><label class="bold">$i18n.getString( "scope" ):</label><br><span id="scopeField"></span></p>
<p><label class="bold">$i18n.getString( "inherit" ):</label><br><span id="inheritField"></span></p>
+ <p><label class="bold">$i18n.getString( "confidential" ):</label><br><span id="confidentialField"></span></p>
<p><label class="bold">$i18n.getString( "value_type" ):</label><br><span id="valueTypeField"></span></p>
<p><label class="bold">$i18n.getString( "option_set" ):</label><br><span id="optionSetField"></span></p>
<p><label class="bold">$i18n.getString( "id" ):</label><br><span id="idField"></span></p>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/attribute.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/attribute.js 2014-06-13 10:58:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/attribute.js 2014-07-02 12:11:16 +0000
@@ -28,6 +28,9 @@
var inherit = ( json.attribute.inherit == 'true') ? i18n_yes : i18n_no;
setInnerHTML( 'inheritField', inherit );
+ var confidential = ( json.attribute.confidential == 'true') ? i18n_yes : i18n_no;
+ setInnerHTML( 'confidentialField', confidential );
+
var valueType = json.attribute.valueType;
var typeMap = attributeTypeMap();
setInnerHTML( 'valueTypeField', typeMap[valueType] );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateAttibuteForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateAttibuteForm.vm 2014-06-02 02:07:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateAttibuteForm.vm 2014-07-02 12:11:16 +0000
@@ -57,6 +57,14 @@
<td></td>
</tr>
+ <tr>
+ <td><label for="confidential">$i18n.getString( "confidential" )</label></td>
+ <td>
+ <input type='checkbox' id="confidential" name="confidential" value='true' #if( $attribute.confidential ) checked #end>
+ </td>
+ <td></td>
+ </tr>
+
<tr>
<td><label for="valueType">$i18n.getString( "value_type" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
<td>