dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21754
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10388: Minor fix for multi entry form.
------------------------------------------------------------
revno: 10388
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-03-21 22:18:52 +0700
message:
Minor fix for multi entry form.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.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-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2013-03-20 09:21:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2013-03-21 15:18:52 +0000
@@ -578,9 +578,10 @@
insert_a_report_date = Please enter a report date.
insert_a_due_date = Please enter a due date.
view_all = View all
-scheduled_today = Scheduled today
-scheduled_7_days = Scheduled 7 days
-scheduled_30_days = Scheduled 30 days
+scheduled_visits = Scheduled Visits
+today = Today
+last_7_days = Last 7 days
+last_30_days = Last 30 days
program_overview = Program overview
total_new_enrollments_in_this_period = Total new enrollments in this period
total_programs_completed_in_this_period = Total programs completed in this period
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2013-03-20 09:21:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2013-03-21 15:18:52 +0000
@@ -487,11 +487,10 @@
{
var programIdAddPatient = getFieldValue('programIdAddPatient');
if( programIdAddPatient!='' ){
- enable('listPatientBtn');
+ disable('listPatientBtn');
enable('addPatientBtn');
enable('advancedSearchBtn');
- enable('scheduled7DaysBtn');
- enable('scheduled30DaysBtn');
+ enable('scheduledVisitDays');
jQuery('#advanced-search :input').each( function( idx, item ){
enable(this.id);
});
@@ -501,8 +500,7 @@
disable('listPatientBtn');
disable('addPatientBtn');
disable('advancedSearchBtn');
- disable('scheduled7DaysBtn');
- disable('scheduled30DaysBtn');
+ disable('scheduledVisitDays');
jQuery('#advanced-search :input').each( function( idx, item ){
disable(this.id);
});
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js 2013-03-21 08:01:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js 2013-03-21 15:18:52 +0000
@@ -24,44 +24,22 @@
function listAllPatient()
{
- var today = getCurrentDate();
- var searchTexts = "stat_" + getFieldValue('programIdAddPatient') + "_"
- + today + "_" + today + "_"
- + getFieldValue('orgunitId') + "_false_4_3";
-
- getPatientList(searchTexts);
-}
-
-function scheduled7Days()
-{
- var today = getCurrentDate();
- var date = new Date();
- var d = date.getDate();
- var m = date.getMonth();
- var y= date.getFullYear();
- var last7day = jQuery.datepicker.formatDate( dateFormat, new Date(y, m, d-7) ) ;
-
- var searchTexts = "stat_" + getFieldValue('programIdAddPatient') + "_"
- + last7day + "_" + today + "_"
- + getFieldValue('orgunitId') + "_false_4_3";
-
- getPatientList(searchTexts);
-}
-
-function scheduled30Days()
-{
- var today = getCurrentDate();
- var date = new Date();
- var d = date.getDate();
- var m = date.getMonth();
- var y= date.getFullYear();
- var last30day = jQuery.datepicker.formatDate( dateFormat, new Date(y, m-1, d) ) ;
-
- var searchTexts = "stat_" + getFieldValue('programIdAddPatient') + "_"
- + last30day + "_" + today + "_"
- + getFieldValue('orgunitId') + "_false_4_3";
-
- getPatientList(searchTexts);
+ var scheduledVisitDays = getFieldValue('scheduledVisitDays');
+ if( scheduledVisitDays != '' )
+ {
+ var today = getCurrentDate();
+ var date = new Date();
+ var d = date.getDate();
+ var m = date.getMonth();
+ var y= date.getFullYear();
+ var lastDays = jQuery.datepicker.formatDate( dateFormat, new Date(y, m, d - eval(scheduledVisitDays)) ) ;
+
+ var searchTexts = "stat_" + getFieldValue('programIdAddPatient') + "_"
+ + lastDays + "_" + today + "_"
+ + getFieldValue('orgunitId') + "_false_4_3";
+
+ getPatientList(searchTexts);
+ }
}
function getPatientList(searchTexts)
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm 2013-03-20 09:21:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm 2013-03-21 15:18:52 +0000
@@ -6,15 +6,15 @@
item.remove();
}
});
+
+ hideById('addPatientBtn');
+ hideById('listPatientBtn');
showById('dueDateTR');
showById('programStageAddPatientTR');
- hideById('addPatientBtn');
+ showById('scheduleVisitTR');
+
jQuery("#searchObjectId [value=prg]").remove();
registration = false;
- var i18n_scheduled_today = '$encoder.jsEscape( $i18n.getString( "scheduled_today" ) , "'")';
- setFieldValue('listPatientBtn', i18n_scheduled_today);
- showById('scheduled7DaysBtn');
- showById('scheduled30DaysBtn');
});
</script>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm 2013-03-19 08:08:50 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm 2013-03-21 15:18:52 +0000
@@ -11,10 +11,8 @@
<td>
<input type="text" id='orgunitName' readonly="readonly" #if( $organisationUnit ) value="$encoder.htmlEncode( $organisationUnit.name )" #else value="[$i18n.getString( 'please_select_village' )]" #end >
</td>
- <td rowspan='2' valign='bottom'>
+ <td rowspan='3' valign='bottom'>
<input type="button" style='width:130px' id='listPatientBtn' style='260px;' value="$i18n.getString( 'list_all_patients' )" onclick="javascript:listAllPatient();" disabled >
- <input type="button" style='width:130px' class='hidden' id='scheduled7DaysBtn' style='260px;' value="$i18n.getString( 'scheduled_7_days' )" onclick="javascript:scheduled7Days();" disabled >
- <input type="button" style='width:130px' class='hidden' id='scheduled30DaysBtn' style='260px;' value="$i18n.getString( 'scheduled_30_days' )" onclick="javascript:scheduled30Days();" disabled >
<input type="button" style='width:130px' id='addPatientBtn' name='addPatientBtn' class='large-button' value='$i18n.getString( "add_new" )' onclick="showAddPatientForm();" disabled >
<input type="button" style='width:130px' id='advancedSearchBtn' value='$i18n.getString( "advanced_search" )' onclick="jQuery('#advanced-search').toggle();" disabled>
</td>
@@ -30,6 +28,17 @@
</select>
</td>
</tr>
+ <tr id='scheduleVisitTR' class='hidden'>
+ <td>$i18n.getString('scheduled_visits')</td>
+ <td>
+ <select id='scheduledVisitDays' name='scheduledVisitDays' onchange='javascript:listAllPatient();' disabled >
+ <option value=''>[$i18n.getString("please_select")]</option>
+ <option value='0'>$i18n.getString("today")</option>
+ <option value='7'>$i18n.getString("last_7_days")</option>
+ <option value='30'>$i18n.getString("last_30_days")</option>
+ </select>
+ </td>
+ </tr>
</table>
<div id='advanced-search' class='hidden advanced-search'>