dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31066
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15802: Add/edit program, more fixes
------------------------------------------------------------
revno: 15802
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-06-22 13:20:48 +0200
message:
Add/edit program, more fixes
modified:
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
--
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-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-22 11:01:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramForm.vm 2014-06-22 11:20:48 +0000
@@ -63,27 +63,27 @@
<table>
<thead>
<tr>
- <th colspan="2" style="width: 590px;">$i18n.getString( "program_details" )</th>
+ <th colspan="2">$i18n.getString( "program_details" )</th>
</tr>
</thead>
<tbody>
<tr>
<td><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input style="width: 330px;" type="text" id="name" name="name" class="{validate:{required:true,minlength:4}}"></td>
+ <td><input type="text" id="name" name="name" class="{validate:{required:true,minlength:4}}"></td>
<td></td>
</tr>
<tr>
<td><label for="description">$i18n.getString( "description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input style="width: 330px;" type="text" id="description" name="description" class="{validate:{required:true,minlength:4}}"></td>
+ <td><input type="text" id="description" name="description" class="{validate:{required:true,minlength:4}}"></td>
<td></td>
</tr>
<tr>
<td><label for="type">$i18n.getString( "type" ) </label></td>
<td>
- <select style="width: 336px;" id="type" name="type" onchange='programOnChange();' class="{validate:{required:true}}">
+ <select id="type" name="type" onchange='programOnChange();' class="{validate:{required:true}}">
<option value='1'>$i18n.getString('multiple_events_with_registration')</option>
<option value='2'>$i18n.getString('single_event_with_registration')</option>
<option value='3'>$i18n.getString('single_event_without_registration')</option>
@@ -94,7 +94,7 @@
<tr name='nonAnonymous' class='multiEvents'>
<td><label for="trackedEntityId">$i18n.getString( "tracked_entity" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
<td>
- <select id='trackedEntityId' name='trackedEntityId' style="width: 335px;" class="{validate:{required:true}}">
+ <select id='trackedEntityId' name='trackedEntityId' class="{validate:{required:true}}">
<option value=''>[$i18n.getString('please_select')]</option>
#foreach($trackedEntity in $trackedEntities)
<option value='$trackedEntity.id'>$trackedEntity.displayName</option>
@@ -104,10 +104,10 @@
<td></td>
</tr>
- <tr name='advanced'>
+ <tr>
<td><label for="dataEntryMethod">$i18n.getString( "data_entry_method_for_option_sets" ) </label></td>
<td>
- <select id='dataEntryMethod' name='dataEntryMethod' style="width: 335px;">
+ <select id='dataEntryMethod' name='dataEntryMethod'>
<option value='false' selected>$i18n.getString('drop_down_lists')</option>
<option value='true'>$i18n.getString('radio_buttons')</option>
</select>
@@ -116,7 +116,7 @@
</tr>
<tr name='nonAnonymous'>
- <th colspan="2" style="width: 590px;">$i18n.getString( "enrollment_details" )</th>
+ <th colspan="2">$i18n.getString( "enrollment_details" )</th>
</tr>
<tr name='nonAnonymous'>
@@ -145,13 +145,13 @@
<tr name='nonAnonymous'>
<td><label for="dateOfIncidentDescription">$i18n.getString( "date_of_incident_description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input style="width: 330px;" type="text" id="dateOfIncidentDescription" name="dateOfIncidentDescription" class="{validate:{required:true,minlength:2}}" value="$i18n.getString('incident_date')"></td>
+ <td><input type="text" id="dateOfIncidentDescription" name="dateOfIncidentDescription" class="{validate:{required:true,minlength:2}}" value="$i18n.getString('incident_date')"></td>
<td></td>
</tr>
<tr name='nonAnonymous'>
<td><label for="dateOfEnrollmentDescription">$i18n.getString( "date_of_enrollment_description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input style="width: 330px;" type="text" id="dateOfEnrollmentDescription" name="dateOfEnrollmentDescription" class="{validate:{required:true,minlength:4}}" value="$i18n.getString('enrollment_date')"></td>
+ <td><input type="text" id="dateOfEnrollmentDescription" name="dateOfEnrollmentDescription" class="{validate:{required:true,minlength:4}}" value="$i18n.getString('enrollment_date')"></td>
<td></td>
</tr>
@@ -209,7 +209,7 @@
<table name='nonAnonymous'>
<thead>
<tr>
- <th colspan="2" style="width: 590px;">$i18n.getString( "scheduling_of_events" )</th>
+ <th colspan="2">$i18n.getString( "scheduling_of_events" )</th>
</tr>
</thead>
=== 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-21 09:02:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/program.js 2014-06-22 11:20:48 +0000
@@ -109,7 +109,6 @@
function programOnChange() {
var type = getFieldValue('type');
- var isShowAdvancedOptions = jQuery('#showAdvancedOptionLink').is(':hidden');
// anonymous
if( type == "3" ) {
@@ -128,6 +127,7 @@
jQuery("[name=displayed]").removeAttr("checked");
jQuery("[name=nonAnonymous]").hide();
+ jQuery('.multiEvents').hide();
}
else {
enable('onlyEnrollOnce');
@@ -154,13 +154,7 @@
else {
disable("dateOfIncidentDescription");
}
- }
-
- if( isShowAdvancedOptions ){
- showAdvancedOptions();
- }
- else{
- hideAdvancedOptions();
+ jQuery('.multiEvents').show();
}
}
@@ -301,32 +295,3 @@
}
}
}
-
-function showAdvancedOptions()
-{
- jQuery('[name=advanced]').show();
- if( getFieldValue('type')!=3){
- jQuery('[name=nonAnonymous]').show();
- jQuery('.multiEvents').show();
- }
- else{
- jQuery('.multiEvents').hide();
- }
- hideById('showAdvancedOptionLink');
- showById('hideAdvancedOptionLink');
-}
-
-function hideAdvancedOptions()
-{
- jQuery('[name=advanced]').hide();
- if( getFieldValue('type')!=3){
- jQuery('[name=nonAnonymous]').hide();
- jQuery('.multiEvents').show();
- }
- else{
- jQuery('.multiEvents').hide();
- }
-
- hideById('hideAdvancedOptionLink');
- showById('showAdvancedOptionLink');
-}
=== 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-22 11:01:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramForm.vm 2014-06-22 11:20:48 +0000
@@ -64,26 +64,26 @@
<table id="detailsList">
<thead>
<tr>
- <th colspan="2" style="width: 590px;">$i18n.getString( "program_details" )</th>
+ <th colspan="2">$i18n.getString( "program_details" )</th>
</tr>
</thead>
<tbody>
<tr>
<td><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input style="width: 330px;" type="text" id="name" name="name" value="$encoder.htmlEncode( $program.displayName )" class="{validate:{required:true,minlength:4}}"></td>
+ <td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $program.displayName )" class="{validate:{required:true,minlength:4}}"></td>
<td></td>
</tr>
<tr>
<td><label for="description">$i18n.getString( "description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input style="width: 330px;" type="text" id="description" name="description" value="$encoder.htmlEncode( $program.description )" class="{validate:{required:true,minlength:2}}"></td>
+ <td><input type="text" id="description" name="description" value="$encoder.htmlEncode( $program.description )" class="{validate:{required:true,minlength:2}}"></td>
<td></td>
</tr>
<tr>
<td><label for="type">$i18n.getString( "type" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
<td>
- <select style="width: 336px;" id="type" name="type" onchange='programOnChange();' class="{validate:{required:true}}">
+ <select id="type" name="type" onchange='programOnChange();' class="{validate:{required:true}}">
<option value='1' #if( $program.type=='1' ) selected #end>$i18n.getString('multiple_events_with_registration')</option>
<option value='2' #if( $program.type=='2' ) selected #end>$i18n.getString('single_event_with_registration')</option>
<option value='3' #if( $program.type=='3' ) selected #end>$i18n.getString('single_event_without_registration')</option>
@@ -95,7 +95,7 @@
<tr name='nonAnonymous' class='multiEvents'>
<td><label for="trackedEntityId">$i18n.getString( "tracked_entity" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
<td>
- <select id='trackedEntityId' name='trackedEntityId' style="width: 335px;" class="{validate:{required:true}}">
+ <select id='trackedEntityId' name='trackedEntityId' class="{validate:{required:true}}">
<option value=''>[$i18n.getString('please_select')]</option>
#foreach($trackedEntity in $trackedEntities)
<option value='$trackedEntity.id' #if($trackedEntity.id==$program.trackedEntity.id) selected #end >$trackedEntity.displayName</option>
@@ -107,14 +107,14 @@
<tr>
<td><label for="version">$i18n.getString( "version" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input type="text" id="version" name="version" style="width: 330px;" value="$program.version" class="{validate:{required:true,integer:true}}"></td>
+ <td><input type="text" id="version" name="version" value="$program.version" class="{validate:{required:true,integer:true}}"></td>
<td></td>
</tr>
- <tr name='advanced'>
+ <tr>
<td><label for="dataEntryMethod">$i18n.getString( "data_entry_method_for_option_sets" ) </label></td>
<td>
- <select id='dataEntryMethod' name='dataEntryMethod' style="width: 335px;">
+ <select id='dataEntryMethod' name='dataEntryMethod'>
<option value='false' #if( $program.dataEntryMethod=='false' ) selected #end>$i18n.getString('drop_down_lists')</option>
<option value='true' #if( $program.dataEntryMethod=='true' ) selected #end>$i18n.getString('radio_buttons')</option>
</select>
@@ -152,13 +152,13 @@
<tr name='nonAnonymous'>
<td><label for="dateOfIncidentDescription">$i18n.getString( "date_of_incident_description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input style="width: 330px;" type="text" id="dateOfIncidentDescription" name="dateOfIncidentDescription" value="$!program.dateOfIncidentDescription" class="{validate:{required:true,minlength:4}}" #if( $program.type=='2' || $program.type=='3') disabled #end ></td>
+ <td><input type="text" id="dateOfIncidentDescription" name="dateOfIncidentDescription" value="$!program.dateOfIncidentDescription" class="{validate:{required:true,minlength:4}}" #if( $program.type=='2' || $program.type=='3') disabled #end ></td>
<td></td>
</tr name='nonAnonymous'>
<tr name='nonAnonymous'>
<td><label for="dateOfEnrollmentDescription">$i18n.getString( "date_of_enrollment_description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input style="width: 330px;" type="text" id="dateOfEnrollmentDescription" name="dateOfEnrollmentDescription" value="$!program.dateOfEnrollmentDescription" class="{validate:{required:true,minlength:4}}" #if( $program.type=='3' ) disabled #end></td>
+ <td><input type="text" id="dateOfEnrollmentDescription" name="dateOfEnrollmentDescription" value="$!program.dateOfEnrollmentDescription" class="{validate:{required:true,minlength:4}}" #if( $program.type=='3' ) disabled #end></td>
<td></td>
</tr>
@@ -223,7 +223,7 @@
<table name='nonAnonymous'>
<thead>
<tr>
- <th colspan="2" style="width: 590px;">$i18n.getString( "scheduling_of_events" )</th>
+ <th colspan="2">$i18n.getString( "scheduling_of_events" )</th>
</tr>
</thead>