dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #29363
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14818: Fixed paging in Find/Add Instance .
------------------------------------------------------------
revno: 14818
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-04-13 22:11:24 +0800
message:
Fixed paging in Find/Add Instance .
modified:
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/trackedEntityInstance.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceForm.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/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2014-04-12 09:21:12 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2014-04-13 14:11:24 +0000
@@ -90,7 +90,7 @@
var key = getKeyCode(event);
if (key == 13)// Enter
{
- validateAdvancedSearch();
+ validateAdvancedSearch( 1 );
}
}
@@ -101,11 +101,11 @@
return (e) ? e.which : null;
}
-function validateAdvancedSearch() {
+function validateAdvancedSearch( page ) {
hideById('listEntityInstanceDiv');
var flag = true;
- if (getFieldValue('startDueDate') == ''
- && getFieldValue('endDueDate') == '') {
+ if (getFieldValue('startDate') == ''
+ && getFieldValue('endDate') == '') {
if (getFieldValue('searchByProgramStage') == "false"
|| (getFieldValue('searchByProgramStage') == "true" && jQuery('#advancedSearchTB tr').length > 1)) {
jQuery("#searchDiv :input").each(function(i, item) {
@@ -121,7 +121,7 @@
if (flag) {
contentDiv = 'listEntityInstanceDiv';
jQuery("#loaderDiv").show();
- advancedSearch(getSearchParams(1), 1);
+ advancedSearch(getSearchParams(page), page);
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.js 2014-04-12 04:55:36 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.js 2014-04-13 14:11:24 +0000
@@ -366,6 +366,11 @@
// Paging
function paging(json, page) {
+ var searchMethod = "listAllTrackedEntityInstance";
+ if( isAdvancedSearch ){
+ searchMethod = "validateAdvancedSearch";
+ }
+
var table = "<table width='100%' style='background-color: #ebf0f6;'><tr><td colspan='"
+ json.width + "'>";
table += "<div class='paging'>";
@@ -377,7 +382,7 @@
+ i + "</span>";
} else {
table += "<a class='page' title='" + i18n_page + " " + i
- + "' href='javascript:listAllTrackedEntityInstance( " + i
+ + "' href='javascript:" + searchMethod + "( " + i
+ ");'>" + i + "</a>";
}
table += "<span class='seperator'>|</span>";
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm 2014-04-12 02:37:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm 2014-04-13 14:11:24 +0000
@@ -27,7 +27,7 @@
<span id="programLoader" style="display:none;" ><img src="../images/ajax-loader-bar.gif" /></span>
</td>
<td id='listEntityInstanceBtnTD'>
- <input type="button" id='listEntityInstanceBtn' value="$i18n.getString( 'list_all_tracked_entity_instances' )" onclick="listAllTrackedEntityInstance(1);">
+ <input type="button" id='listEntityInstanceBtn' value="$i18n.getString( 'list_all_tracked_entity_instances' )" onclick="isAdvancedSearch=false;listAllTrackedEntityInstance(1);">
<input type="button" id='advancedSearchBtn' value='$i18n.getString( "advanced_search" )' onclick="advancedSearchOnclick();">
</td>
</tr>
@@ -141,7 +141,7 @@
</table>
<div style="padding: 10px 0 15px 3px">
<input type="button" class='large-button' value='$i18n.getString( "add_filter" )' onclick='addAttributeOption();'>
- <input type="button" class='large-button' value='$i18n.getString( "search" )' onclick='validateAdvancedSearch();' id='searchEntityInstanceBtn'>
+ <input type="button" class='large-button' value='$i18n.getString( "search" )' onclick='isAdvancedSearch=true;validateAdvancedSearch(1);' id='searchEntityInstanceBtn'>
<input type="button" class='large-button hidden' id='sendSmsToListBtn' value="$i18n.getString('sms')" onclick="setFieldValue('sendToList', true);showSendSmsForm();">
</div>
</div>
@@ -160,5 +160,6 @@
datePicker( 'startDueDate', true );
datePicker( 'endDueDate', true );
+ var isAdvancedSearch = false;
var searchTextBox = '<input type="text" id="searchText" name="searchText" class="searchInput" onkeyup="searchTrackedEntityInstancesOnKeyUp( event );">';
</script>
\ No newline at end of file
=== 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-04-11 10:36:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceForm.vm 2014-04-13 14:11:24 +0000
@@ -13,7 +13,7 @@
<tr>
<td class='text-column'><label>$i18n.getString('tracked_entity')<em title="$i18n.getString( 'required' )" class="required">*</em> </label></td>
<td class="input-column">
- <select type='hidden' id='trackedEntityId' name='trackedEntityId' value='$trackedEntityId'>
+ <select type='hidden' id='trackedEntityId' name='trackedEntityId' value='$trackedEntityId' class="{validate:{required:true }}">
<option value=''>[$i18n.getString('please_select')]</option>
#foreach($trackedEntity in $trackedEntities)
<option value='$trackedEntity.id' #if($entityInstance.trackedEntity.id==$trackedEntity.id) selected #end >$trackedEntity.displayName</option>