dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30927
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15722: Added option for Future Date in Program Attributes.
------------------------------------------------------------
revno: 15722
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-06-17 20:21:26 +0800
message:
Added option for Future Date in Program Attributes.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.java
dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.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/program/hibernate/ProgramTrackedEntityAttribute.hbm.xml
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/caseagg.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.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/addProgramForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/program.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/viewTrackedEntityForm.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/ProgramTrackedEntityAttribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.java 2014-06-07 12:52:12 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramTrackedEntityAttribute.java 2014-06-17 12:21:26 +0000
@@ -33,6 +33,7 @@
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
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.view.DetailedView;
@@ -61,6 +62,8 @@
private Boolean mandatory;
+ private Boolean allowDateInFuture;
+
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -84,6 +87,16 @@
this.displayInList = displayInList;
this.mandatory = mandatory;
}
+
+ public ProgramTrackedEntityAttribute( TrackedEntityAttribute attribute, Integer sortOrder, boolean displayInList,
+ Boolean mandatory, Boolean allowDateInFuture )
+ {
+ this.attribute = attribute;
+ this.sortOrder = sortOrder;
+ this.displayInList = displayInList;
+ this.mandatory = mandatory;
+ this.allowDateInFuture = allowDateInFuture;
+ }
// -------------------------------------------------------------------------
// Getters && Setters
@@ -150,4 +163,17 @@
this.displayInList = displayInList;
}
+ @JsonProperty
+ @JsonSerialize( as = BaseIdentifiableObject.class )
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+ public Boolean getAllowDateInFuture()
+ {
+ return allowDateInFuture;
+ }
+
+ public void setAllowDateInFuture( Boolean allowDateInFuture )
+ {
+ this.allowDateInFuture = allowDateInFuture;
+ }
}
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.java 2014-05-17 12:04:42 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.java 2014-06-17 12:21:26 +0000
@@ -37,6 +37,7 @@
import org.hisp.dhis.i18n.I18nFormat;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramInstance;
+import org.hisp.dhis.program.ProgramTrackedEntityAttribute;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService;
import org.hisp.dhis.user.User;
@@ -276,10 +277,13 @@
String value, I18n i18n, int index, String hidden, String style )
{
boolean mandatory = false;
+ boolean allowDateInFuture = false;
if ( program != null && program.getAttribute( attribute ) != null )
{
- mandatory = program.getAttribute( attribute ).isMandatory();
+ ProgramTrackedEntityAttribute programAttribute = program.getAttribute( attribute );
+ mandatory = programAttribute.isMandatory();
+ allowDateInFuture = programAttribute.getAllowDateInFuture();
}
inputHtml = TAG_OPEN + "input id=\"attr" + attribute.getId() + "\" name=\"attr" + attribute.getId()
@@ -342,8 +346,16 @@
}
else if ( attribute.getValueType().equals( TrackedEntityAttribute.TYPE_DATE ) )
{
- String jQueryCalendar = "<script>datePicker(\"attr" + attribute.getId() + "\", false);</script>";
- inputHtml += " value=\"" + value + "\"" + TAG_CLOSE;
+ String jQueryCalendar = "<script>";
+ if( allowDateInFuture ){
+ jQueryCalendar += "datePicker";
+ }
+ else{
+ jQueryCalendar += "datePickerValid";
+ }
+ jQueryCalendar += "(\"attr" + attribute.getId() + "\", false, false);</script>";
+
+ inputHtml += " value=\"" + value + "\"" + TAG_CLOSE;
inputHtml += jQueryCalendar;
}
else
=== 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-13 10:58:05 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java 2014-06-17 12:21:26 +0000
@@ -273,6 +273,9 @@
executeSql( "UPDATE trackedentityaudit SET accessedmodule='tracked_entity_instance_dashboard' WHERE accessedmodule='instance_dashboard' or accessedmodule='patient_dashboard'" );
updateUidColumn();
+
+ executeSql( "UPDATE program_attributes SET allowDateInFuture='false' WHERE allowDateInFuture is null" );
+
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramTrackedEntityAttribute.hbm.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramTrackedEntityAttribute.hbm.xml 2014-03-20 15:05:57 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/program/hibernate/ProgramTrackedEntityAttribute.hbm.xml 2014-06-17 12:21:26 +0000
@@ -20,6 +20,8 @@
<property name="displayInList" column="displayinlist" />
<property name="mandatory" column="mandatory" />
+
+ <property name="allowDateInFuture" column="allowDateInFuture" />
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java 2014-06-09 12:47:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java 2014-06-17 12:21:26 +0000
@@ -270,6 +270,13 @@
return mandatoryMap;
}
+ private Map<Integer, Boolean> allowDateInFutureMap = new HashMap<Integer, Boolean>();
+
+ public Map<Integer, Boolean> getAllowDateInFutureMap()
+ {
+ return allowDateInFutureMap;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -334,6 +341,7 @@
for ( TrackedEntityAttribute attribute : attributes )
{
mandatoryMap.put( attribute.getId(), false );
+ allowDateInFutureMap.put( attribute.getId(), false );
}
}
else
@@ -342,6 +350,7 @@
for ( ProgramTrackedEntityAttribute programAttribute : program.getAttributes() )
{
mandatoryMap.put( programAttribute.getAttribute().getId(), programAttribute.isMandatory() );
+ allowDateInFutureMap.put( programAttribute.getAttribute().getId(), programAttribute.getAllowDateInFuture() );
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java 2014-06-10 07:41:19 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java 2014-06-17 12:21:26 +0000
@@ -277,6 +277,13 @@
return mandatoryMap;
}
+ private Map<Integer, Boolean> allowDateInFutureMap = new HashMap<Integer, Boolean>();
+
+ public Map<Integer, Boolean> getAllowDateInFutureMap()
+ {
+ return allowDateInFutureMap;
+ }
+
private List<TrackedEntityAttribute> attributes = new ArrayList<TrackedEntityAttribute>();
public List<TrackedEntityAttribute> getAttributes()
@@ -356,6 +363,7 @@
for ( TrackedEntityAttribute attribute : attributes )
{
mandatoryMap.put( attribute.getId(), false );
+ allowDateInFutureMap.put( attribute.getId(), false );
}
}
else
@@ -364,6 +372,7 @@
for ( ProgramTrackedEntityAttribute programAttribute : program.getAttributes() )
{
mandatoryMap.put( programAttribute.getAttribute().getId(), programAttribute.isMandatory() );
+ allowDateInFutureMap.put( programAttribute.getAttribute().getId(), programAttribute.getAllowDateInFuture() );
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/caseagg.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/caseagg.js 2014-03-21 09:29:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/caseagg.js 2014-06-17 12:21:26 +0000
@@ -143,6 +143,9 @@
}
});
}
+ else{
+ unLockScreen();
+ }
}
function toogleAllCheckBoxes( tableDiv, checked )
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceForm.vm 2014-06-09 12:17:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceForm.vm 2014-06-17 12:21:26 +0000
@@ -46,6 +46,7 @@
#set($value = "")
#set($value = $attributeValueMap.get($attribute.id))
#set($mandatory = $mandatoryMap.get($attribute.id))
+ #set($allowDateInFuture = $allowDateInFutureMap.get($attribute.id))
#if( $mandatory ) #else #set($mandatory=false) #end
<tr name='attributesFields'>
<td class='text-column'><label>$encoder.htmlEncode($attribute.displayName) #if($mandatory ) <em title="$i18n.getString( 'required' )" class="required">*</em> #end</label></td>
@@ -61,8 +62,12 @@
#elseif( $attribute.valueType == "date" )
<input type="text" id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" value='$value' class="{validate:{required:$mandatory }}" />
<script type="text/javascript">
+ #if($allowDateInFuture=='true')
+ datePicker( 'attr$attribute.id', false, false );
+ #else
datePickerValid( 'attr$attribute.id', false, false );
- </script>
+ #end
+ </script>
#elseif( $attribute.valueType == "optionSet" )
<select id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" class="{validate:{required:$mandatory }}" >
<option value="">[$i18n.getString( "please_select" )]</option>
@@ -109,7 +114,7 @@
#set( $attributeValue = $!attributeValueMap.get( $attribute.id ) )
#set($mandatory = $mandatoryMap.get($attribute.id))
#if( $mandatory ) #else #set($mandatory=false) #end
- #if( $attribute.valueType != 'calculated')
+ #set($allowDateInFuture = $allowDateInFutureMap.get($attribute.id))
<tr name='attributesFields'>
<td class='text-column'><label>$encoder.htmlEncode($attribute.displayName) #if($mandatory ) <em title="$i18n.getString( "required" )" class="required">*</em> #end</label></td>
<td class="input-column">
@@ -124,7 +129,11 @@
#elseif( $attribute.valueType == "date" )
<input type="text" id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" value="$!attributeValue" class=' #validate( "default" $mandatory )'>
<script type="text/javascript">
- datePickerValid( 'attr$attribute.id', false, false );
+ #if($allowDateInFuture=='true')
+ datePicker( 'attr$attribute.id', false, false );
+ #else
+ datePickerValid( 'attr$attribute.id', false, false );
+ #end
</script>
#elseif( $attribute.valueType == "optionSet" )
<select id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" class=' #validate( "default" $mandatory )' >
@@ -156,7 +165,6 @@
#end
</td>
</tr>
- #end
#end
#end
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java 2014-03-20 05:43:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/AddProgramAction.java 2014-06-17 12:21:26 +0000
@@ -163,13 +163,20 @@
this.personDisplayNames = personDisplayNames;
}
+ private List<Boolean> allowDateInFuture = new ArrayList<Boolean>();
+
+ public void setAllowDateInFuture( List<Boolean> allowDateInFuture )
+ {
+ this.allowDateInFuture = allowDateInFuture;
+ }
+
private List<Boolean> mandatory = new ArrayList<Boolean>();
public void setMandatory( List<Boolean> mandatory )
{
this.mandatory = mandatory;
}
-
+
private Boolean ignoreOverdueEvents;
public void setIgnoreOverdueEvents( Boolean ignoreOverdueEvents )
@@ -318,7 +325,7 @@
.parseInt( ids[1] ) );
ProgramTrackedEntityAttribute programAttribute = new ProgramTrackedEntityAttribute( attribute,
- index + 1, personDisplayNames.get( index ), mandatory.get( index ) );
+ index + 1, personDisplayNames.get( index ), mandatory.get( index ), allowDateInFuture.get( index ) );
program.getAttributes().add( programAttribute );
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java 2014-03-20 05:43:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/UpdateProgramAction.java 2014-06-17 12:21:26 +0000
@@ -271,6 +271,13 @@
this.trackedEntityId = trackedEntityId;
}
+ private List<Boolean> allowDateInFuture = new ArrayList<Boolean>();
+
+ public void setAllowDateInFuture( List<Boolean> allowDateInFuture )
+ {
+ this.allowDateInFuture = allowDateInFuture;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -353,7 +360,7 @@
TrackedEntityAttribute attribute = attributeService.getTrackedEntityAttribute( Integer
.parseInt( ids[1] ) );
ProgramTrackedEntityAttribute programAttribute = new ProgramTrackedEntityAttribute( attribute,
- index + 1, personDisplayNames.get( index ), mandatory.get( index ) );
+ index + 1, personDisplayNames.get( index ), mandatory.get( index ), allowDateInFuture.get( index ) );
program.getAttributes().add( programAttribute );
}
=== 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-13 10:58:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties 2014-06-17 12:21:26 +0000
@@ -494,4 +494,5 @@
program_within_orgunit = Program within organisation unit
auto_save_registration_forms = Auto save registration form
show_advanced_options = Show advanced options
-hide_advanced_options = Hide advanced options
\ No newline at end of file
+hide_advanced_options = Hide advanced options
+tracked_entity_registration_form_manegement = Tracked entity registration form management
\ 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/addProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramForm.vm 2014-06-02 04:53:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramForm.vm 2014-06-17 12:21:26 +0000
@@ -17,6 +17,8 @@
compulsaryIdentifier.empty();
var mandatorySelector = jQuery( "#mandatory" );
mandatorySelector.empty();
+ var allowDateInFutureSelector = jQuery( "#allowDateInFuture" );
+ allowDateInFutureSelector.empty();
if( getFieldValue('type') != 3 ){
@@ -34,6 +36,11 @@
var mandatory = jQuery( item ).find( "input[name='mandatory']:first");
checked = mandatory.attr('checked') ? true : false;
mandatorySelector.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+
+ // allowDateInFuture
+ var allowDateInFuture = jQuery( item ).find( "input[name='allowDateInFuture']:first");
+ checked = allowDateInFuture.attr('checked') ? true : false;
+ allowDateInFutureSelector.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
});
if( jQuery("#selectedList").find("tr").length > 0 && isDisplayed ){
compulsaryIdentifier.append( "<option value='0' selected='true'></option>");
@@ -231,6 +238,7 @@
<select style='display:none;' multiple id="selectedPropertyIds" name="selectedPropertyIds" ></select>
<select style='display:none;' multiple id="personDisplayNames" name="personDisplayNames" ></select>
<select style='display:none;' multiple id="mandatory" name="mandatory" ></select>
+ <select style='display:none;' multiple id="allowDateInFuture" name="allowDateInFuture" ></select>
<select id='compulsaryIdentifier' name="compulsaryIdentifier" multiple="multiple" class="hidden {validate:{required:true}}" title="$i18n.getString('please_select_at_least_attribute_for_displaying_in_list')"></select>
</th>
</tr>
@@ -239,7 +247,7 @@
<td>
<select style="width:100%;" size="15" multiple id="availablePropertyIds" name="availablePropertyIds" ondblclick="selectProperties();">
#foreach( $attribute in $availableAttributes )
- <option value="attr_$attribute.id">$attribute.displayName</option>
+ <option value="attr_$attribute.id" valuetype='$attribute.valueType'>$attribute.displayName</option>
#end
</select>
</td>
@@ -261,6 +269,7 @@
<th style="width:180px;">$i18n.getString( "name" )</th>
<th style="width:20px;">$i18n.getString( "displayed_in_list" )</th>
<th style="width:20px;">$i18n.getString( "mandatory" )</th>
+ <th style="width:20px;">$i18n.getString( "date_in_future" )</th>
</tr>
</thead>
<tbody id="selectedList"></tbody>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/program.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/program.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/program.js 2014-06-17 12:21:26 +0000
@@ -172,10 +172,18 @@
var selectedList = jQuery("#selectedList");
jQuery("#availablePropertyIds").children().each(function( i, item ) {
if( item.selected ) {
- html = "<tr class='selected' id='" + item.value + "' ondblclick='unSelectProperties( this )'><td onmousedown='select(event,this)'>" + item.text + "</td>";
- html += "<td align='center'><input type='checkbox' name='displayed' value='" + item.value + "'";
- html += "></td>"
- html += "<td align='center'><input type='checkbox' name='mandatory'></tr>";
+ html = "<tr class='selected' id='" + item.value + "' ondblclick='unSelectProperties( this )'>";
+ html += "<td onmousedown='select(event,this)'>" + item.text + "</td>";
+ html += "<td align='center'><input type='checkbox' name='displayed' value='" + item.value + "'></td>"
+ html += "<td align='center'><input type='checkbox' name='mandatory'></td>";
+ if( jQuery(item).attr('valuetype') =='date'){
+ html += "<td align='center'><input type='checkbox' name='allowDateInFuture'></td>";
+ }
+ else{
+ html += "<td align='center'><input type='hidden' name='allowDateInFuture'></td>";
+ }
+ html += "</tr>";
+
selectedList.append(html);
jQuery(item).remove();
}
@@ -189,10 +197,18 @@
function selectAllProperties() {
var selectedList = jQuery("#selectedList");
jQuery("#availablePropertyIds").children().each(function( i, item ) {
- html = "<tr class='selected' id='" + item.value + "' ondblclick='unSelectDataElement( this )'><td onmousedown='select(this)'>" + item.text + "</td>";
- html += "<td align='center'><input type='checkbox' name='displayed' value='" + item.value + "'";
- html += "><td align='center'><input type='checkbox' name='mandatory'></td></tr>";
-
+ html = "<tr class='selected' id='" + item.value + "' ondblclick='unSelectDataElement( this )'>";
+ html += "<td onmousedown='select(this)'>" + item.text + "</td>";
+ html += "<td align='center'><input type='checkbox' name='displayed' value='" + item.value + "'></td>";
+ html += "<td align='center'><input type='checkbox' name='mandatory'></td>";
+ if( jQuery(item).attr('valuetype') =='date'){
+ html += "<td align='center'><input type='checkbox' name='allowDateInFuture'></td>";
+ }
+ else{
+ html += "<td align='center'><input type='hidden' name='allowDateInFuture'></td>";
+ }
+ html += "</tr>";
+
selectedList.append(html);
jQuery(item).remove();
});
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm 2014-06-02 04:53:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm 2014-06-17 12:21:26 +0000
@@ -13,8 +13,10 @@
var compulsaryIdentifier = jQuery( "#compulsaryIdentifier" );
compulsaryIdentifier.empty();
var mandatorySelector = jQuery( "#mandatory" );
- mandatorySelector.empty();
-
+ mandatorySelector.empty();
+ var allowDateInFutureSelector = jQuery( "#allowDateInFuture" );
+ allowDateInFutureSelector.empty();
+
if( getFieldValue('type') != 3 ){
var isDisplayed = false;
jQuery("#selectedList").find("tr").each( function( i, item ){
@@ -31,6 +33,10 @@
checked = mandatory.attr('checked') ? true : false;
mandatorySelector.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+ // allowDateInFuture
+ var allowDateInFuture = jQuery( item ).find( "input[name='allowDateInFuture']:first");
+ checked = allowDateInFuture.attr('checked') ? true : false;
+ allowDateInFutureSelector.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
});
if( jQuery("#selectedList").find("tr").length > 0 && isDisplayed ){
compulsaryIdentifier.append( "<option value='0' selected='true'></option>");
@@ -242,6 +248,7 @@
<select style='display:none;' multiple id="selectedPropertyIds" name="selectedPropertyIds" ></select>
<select style='display:none;' multiple id="personDisplayNames" name="personDisplayNames" ></select>
<select style='display:none;' multiple id="mandatory" name="mandatory" ></select>
+ <select style='display:none;' multiple id="allowDateInFuture" name="allowDateInFuture" ></select>
<select id='compulsaryIdentifier' name="compulsaryIdentifier" multiple="multiple" class="hidden {validate:{required:true}}" title="$i18n.getString('please_select_at_least_attribute_for_displaying_in_list')"></select>
</th>
</tr>
@@ -251,7 +258,7 @@
<td>
<select size="15" style="width:100%;" multiple id="availablePropertyIds" name="availablePropertyIds" ondblclick="selectProperties();" #if( $program.type=='3' ) disabled #end>
#foreach( $attribute in $availableAttributes )
- <option value="attr_$attribute.id">$attribute.displayName</option>
+ <option value="attr_$attribute.id" valuetype='$attribute.valueType'>$attribute.displayName</option>
#end
</select>
</td>
@@ -273,6 +280,7 @@
<th style="width:180px;">$i18n.getString( "name" )</th>
<th style="width:20px;">$i18n.getString( "displayed_in_list" )</th>
<th style="width:20px;">$i18n.getString( "mandatory" )</th>
+ <th style="width:20px;">$i18n.getString( "date_in_future" )</th>
</tr>
</thead>
<tbody id="selectedList" #if($program.type==3) style="display:none;" #end>
@@ -282,6 +290,13 @@
<td onmousedown="select(event, this)">$encoder.htmlEncode( $attribute.name )</td>
<td align="center"><input type="checkbox" name="displayed" value="attr_$programAttribute.attribute.id" #if($programAttribute.displayInList == true ) checked #end #if($program.type==3) disabled #end /></td>
<td align="center"><input type="checkbox" name="mandatory" #if($programAttribute.mandatory == "true" ) checked #end #if($program.type==3) disabled #end /></td>
+ <td align="center">
+ #if($attribute.valueType=='date')
+ <input type="checkbox" name="allowDateInFuture" #if($programAttribute.allowDateInFuture == "true" ) checked #end #if($program.type==3) disabled #end />
+ #else
+ <input type="hidden" name="allowDateInFuture" />
+ #end
+ </td>
</tr>
#end
</tbody>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/viewTrackedEntityForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/viewTrackedEntityForm.vm 2014-04-30 08:19:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/viewTrackedEntityForm.vm 2014-06-17 12:21:26 +0000
@@ -57,7 +57,7 @@
<input type="hidden" name="programId" id="programId" value="$!program.id"/>
<input type="hidden" name="dataEntryFormId" id="dataEntryFormId" value="$!registrationForm.dataEntryForm.id"/>
-<h3>$i18n.getString( "add_tracked_entity_registration_form" )</h3>
+<h3>$i18n.getString( "tracked_entity_registration_form_manegement" )</h3>
<h4>$!program.displayName</h4>
<div class="container" >