← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16375: Add search-field for option-values of optionsets which are assigned for data elements in Aggregat...

 

------------------------------------------------------------
revno: 16375
committer: Tran Chau<tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-08-11 20:54:43 +0700
message:
  Add search-field for option-values of optionsets which are assigned for data elements in Aggregate query builder.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addCaseAggregation.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/caseAggregationForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/caseaggregation.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateCaseAggregation.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/addCaseAggregation.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addCaseAggregation.vm	2014-08-06 15:20:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addCaseAggregation.vm	2014-08-11 13:54:43 +0000
@@ -52,12 +52,12 @@
 	<tr>
 		<td><label for="operator">$i18n.getString( "operator" )</label></td>
 		<td>
-			<input type="radio" id="operator" name="operator" value="COUNT" checked onchange='operatorOnchange(this.value)'> $i18n.getString('number_of_tracked_entity_instances')<br>
-			<input type="radio" id="operator" name="operator" value="times" onchange='operatorOnchange(this.value)'> $i18n.getString('number_of_visits')<br>
-			<input type="radio" id="operator" name="operator" value="sum" onchange='operatorOnchange(this.value)'> $i18n.getString('sum_dataelement_value')<br>
-			<input type="radio" id="operator" name="operator" value="avg" onchange='operatorOnchange(this.value)'> $i18n.getString('avg_dataelement_value')<br>
-			<input type="radio" id="operator" name="operator" value="min" onchange='operatorOnchange(this.value)'> $i18n.getString('min_dataelement_value')<br>
-			<input type="radio" id="operator" name="operator" value="max" onchange='operatorOnchange(this.value)'> $i18n.getString('max_dataelement_value')
+			<input type="radio" id="operator1" name="operator" value="COUNT" checked onchange='operatorOnchange(this.value)'> <label for='operator1'>$i18n.getString('number_of_tracked_entity_instances')</label><br>
+			<input type="radio" id="operator2" name="operator" value="times" onchange='operatorOnchange(this.value)'> <label for='operator2'>$i18n.getString('number_of_visits')</label><br>
+			<input type="radio" id="operator3" name="operator" value="sum" onchange='operatorOnchange(this.value)'> <label for='operator3'>$i18n.getString('sum_dataelement_value')</label><br>
+			<input type="radio" id="operator4" name="operator" value="avg" onchange='operatorOnchange(this.value)'> <label for='operator4'>$i18n.getString('avg_dataelement_value')</label><br>
+			<input type="radio" id="operator5" name="operator" value="min" onchange='operatorOnchange(this.value)'> <label for='operator5'>$i18n.getString('min_dataelement_value')</label><br>
+			<input type="radio" id="operator6" name="operator" value="max" onchange='operatorOnchange(this.value)'> <label for='operator6'>$i18n.getString('max_dataelement_value')</label>
 		</td>
 	</tr>
 	

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/caseAggregationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/caseAggregationForm.vm	2014-08-11 12:53:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/caseAggregationForm.vm	2014-08-11 13:54:43 +0000
@@ -30,17 +30,21 @@
 					<option value="username">$i18n.getString( "user_name" )</option>
 				</select>
 			</td>
+			<td>
+				<input type="text" disabled placeholder="$i18n.getString('enter_a_key')" id="deSuggestedValues" name="deSuggestedValues" style="width:300px;" />
+				<a style='width:20px; margin-bottom:-5px;height:20px;' id='deButton' name='deButton'></a>
+			</td>
 		</tr>
         <tr>
 			<td colspan='2'>
-				<select id="dataElements" name="dataElements" size="8" ondblclick="insertDataElement(this);" onclick="getSuggestedValues(this, 'suggestedDEValues' )"></select>
+				<select id="dataElements" name="dataElements" size="8" ondblclick="insertDataElement(this);" onclick="getSuggestedValues(this,'deSuggestedValues','deButton','suggestedDEValues' )" ></select>
 				<select id="dataElementBackups" name="dataElementBackups" style='display:none;'></select>
 			</td>
 			<td rowspan='4'>
 				<select name="suggestedDEValues" size="12" multiple id='suggestedDEValues' ondblclick="insertSingleValue('suggestedDEValues');" ></select>			
 			</td>
 		</tr>
-		 <tr>
+		<tr>
 			<td>
 				<table style='background-color:#CBDDEB'>
 					<tr>
@@ -71,16 +75,15 @@
 			<tr>
 				<td>$i18n.getString('filter_by_name')
 					<input style="width:180px;" type='text' id='txtSearchAttribue' name='txtSearchAttribue' placeholder="$i18n.getString('enter_an_attribute')" onKeyUp="filterAttribute(event, this.value, 'caseProperty','casePropertyBackups');"/>
-					<a style='width:20px; margin-bottom:-5px;height:20px;' id='attributesButton' name='attributesButton'></a>
 					<input type='button' value='$i18n.getString("clear")' onClick="setFieldValue('txtSearchAttribue', '');" style='width:50px'>			
 				</td>
 				<td>
 					<label>$i18n.getString( "available_values" )</label>
-						<input type="text" disabled placeholder="$i18n.getString('enter_a_key')" id="caSuggestedValues" name="caSuggestedValues" ondblclick="insertSingleValue('caSuggestedValues');" style="width:200px;">
+					<input type='button' title="$i18n.getString( 'insert_selected_values' )" value="&raquo;" class="small-button"  onClick="insertMultiValues('attributeId');" >
 				</td>
 			</tr>
 			<tr>
-				<td rowspan='2'>
+				<td rowspan='3'>
 					<select id='casePropertyBackups' name='casePropertyBackups' style='display:none;'>
 						#foreach($attribute in $attributes)
 							#if($attribute.valueType=='age')
@@ -93,7 +96,7 @@
 							#end
 						#end
 					</select>
-					<select id="caseProperty" name="caseProperty" size="10" ondblclick="insertInfo(this, false);" onclick="getSuggestedValues(this, 'caSuggestedValues' )">
+					<select id="caseProperty" name="caseProperty" size="10" ondblclick="insertInfo(this, false);" onclick="getSuggestedValues(this,'caSuggestedValues','attributesButton','attributeId' )">
 						#foreach($attribute in $attributes)
 							#if($attribute.valueType=='age')
 								#set($attId=$attribute.id + ".age")
@@ -109,8 +112,13 @@
 			</tr>
 			<tr>
 				<td>
-					<select multiple id='attributeId' name='attributeId' size=10 ondblclick="removeOption('attributeId')"></select>
-					<input type='button' title="$i18n.getString( 'insert_selected_values' )" value="&raquo;" class="small-button"  onClick="insertMultiValues('attributeId');" >
+					<input type="text" disabled placeholder="$i18n.getString('enter_a_key')" id="caSuggestedValues" name="caSuggestedValues" ondblclick="insertSingleValue('caSuggestedValues');" style="width:300px;">
+					<a style='width:20px; margin-bottom:-5px;height:20px;' id='attributesButton' name='attributesButton'></a>
+				</td>
+			</tr>
+			<tr>
+				<td>
+					<select multiple id='attributeId' name='attributeId' size=8 ondblclick="removeOption('attributeId')"></select>
 				</td>
 			</tr>
 			

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/caseaggregation.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/caseaggregation.js	2014-08-11 12:53:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/caseaggregation.js	2014-08-11 13:54:43 +0000
@@ -504,10 +504,10 @@
   window.location.href = 'caseAggregation.action?dataSetId=' + dataSetId;
 }
 
-function attributeAutocompletedField( idField, optionSetUid )
+function attributeAutocompletedField( idField, optionSetUid, btnId, optionId )
 {
-	$("#attributesButton").unbind('click');
-	enable('attributesButton');
+	$("#" + btnId).unbind('click');
+	enable(btnId);
 	var input = jQuery( "#" + idField );
 	var select = jQuery( "#attributeId" );
 	input.autocomplete({
@@ -529,7 +529,7 @@
 		  },
 		  select: function( event, ui ) {
 			input.val(ui.item.label);
-			jQuery("#attributeId").append( "<option value='" + ui.item.id + "'>" + ui.item.label + "</option>" );
+			jQuery("#" + optionId).append( "<option value='" + ui.item.id + "'>" + ui.item.label + "</option>" );
 			input.autocomplete("close");
 			
 			return false;
@@ -566,7 +566,7 @@
 		.addClass("ui-combobox")
 		.insertAfter(input);
 
-	var button = $("#attributesButton")
+	var button = $("#" + btnId)
 		.attr("tabIndex", -1)
 		.attr("title", i18n_show_all_items)
 		.appendTo(wrapper)
@@ -594,19 +594,19 @@
   return val.split( /,\s*/ );
 }
 
-function getSuggestedValues( _this, suggestedField )
+function getSuggestedValues( _this, suggestedField, btnId, optionId )
 {
-	clearListById('attributeId');
+	clearListById(optionId);
 	var field = jQuery( '#' + suggestedField );
 	var option =  jQuery("#" + _this.id + " option:selected" );
 	if( option.attr('optionset') != "" ){
-		attributeAutocompletedField( suggestedField, option.attr('optionset') );
+		attributeAutocompletedField( suggestedField, option.attr('optionset'), btnId, optionId );
 		enable(suggestedField);
-		jQuery( '#attributesButton').css("display", "");
+		jQuery( '#' + btnId ).css("display", "");
 	}
 	else{
 		disable(suggestedField);
-		jQuery( '#attributesButton').css("display", "none");
+		jQuery( '#' + btnId ).css("display", "none");
 	}
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateCaseAggregation.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateCaseAggregation.vm	2014-08-06 15:20:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateCaseAggregation.vm	2014-08-11 13:54:43 +0000
@@ -50,12 +50,12 @@
 	<tr>
 		<td><label for="operator">$i18n.getString( "operator" )</label></td>
 		<td>
-			<input type="radio" id="operator" name="operator" value="COUNT" onchange='operatorOnchange(this.value)' #if($caseAggregation.operator=="COUNT") checked #end > $i18n.getString('number_of_tracked_entities')<br>
-			<input type="radio" id="operator" name="operator" value="times" onchange='operatorOnchange(this.value)' #if($caseAggregation.operator=="times") checked #end > $i18n.getString('number_of_visits')<br>
-			<input type="radio" id="operator" name="operator" value="sum" onchange='operatorOnchange(this.value)' #if($caseAggregation.operator=="sum") checked #end > $i18n.getString('sum_dataelement_value')<br>
-			<input type="radio" id="operator" name="operator" value="avg" onchange='operatorOnchange(this.value)' #if($caseAggregation.operator=="avg") checked #end > $i18n.getString('avg_dataelement_value')<br>
-			<input type="radio" id="operator" name="operator" value="min" onchange='operatorOnchange(this.value)' #if($caseAggregation.operator=="min") checked #end > $i18n.getString('min_dataelement_value')<br>
-			<input type="radio" id="operator" name="operator" value="max" onchange='operatorOnchange(this.value)' #if($caseAggregation.operator=="max") checked #end > $i18n.getString('max_dataelement_value')
+			<input type="radio" id="operator1" name="operator" value="COUNT" onchange='operatorOnchange(this.value)' #if($caseAggregation.operator=="COUNT") checked #end > <label for='operator1'>$i18n.getString('number_of_tracked_entities')</label><br>
+			<input type="radio" id="operator2" name="operator" value="times" onchange='operatorOnchange(this.value)' #if($caseAggregation.operator=="times") checked #end > <label for='operator2'>$i18n.getString('number_of_visits')</label><br>
+			<input type="radio" id="operator3" name="operator" value="sum" onchange='operatorOnchange(this.value)' #if($caseAggregation.operator=="sum") checked #end > <label for='operator3'>$i18n.getString('sum_dataelement_value')</label><br>
+			<input type="radio" id="operator4" name="operator" value="avg" onchange='operatorOnchange(this.value)' #if($caseAggregation.operator=="avg") checked #end > <label for='operator4'>$i18n.getString('avg_dataelement_value')</label><br>
+			<input type="radio" id="operator5" name="operator" value="min" onchange='operatorOnchange(this.value)' #if($caseAggregation.operator=="min") checked #end > <label for='operator5'>$i18n.getString('min_dataelement_value')</label><br>
+			<input type="radio" id="operator6" name="operator" value="max" onchange='operatorOnchange(this.value)' #if($caseAggregation.operator=="max") checked #end > <label for='operator6'>$i18n.getString('max_dataelement_value')</label>
 		</td>
 	</tr>
 	<tr>