← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19262: Program app, removed use of commons.js

 

------------------------------------------------------------
revno: 19262
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-06-02 17:46:55 +0200
message:
  Program app, removed use of commons.js
removed:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/commons.js
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/ProgramIndicatorController.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.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-api/src/main/java/org/hisp/dhis/webapi/controller/event/ProgramIndicatorController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/ProgramIndicatorController.java	2015-06-02 15:19:55 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/ProgramIndicatorController.java	2015-06-02 15:46:55 +0000
@@ -89,7 +89,7 @@
     public void validateFilter( @RequestParam String filter, HttpServletResponse response )
         throws IOException
     {
-        Boolean result = ExpressionUtils.isBoolean( filter, null );
+        boolean result = ExpressionUtils.isBoolean( filter, null );
         
         ValidationResult validation = new ValidationResult();
         validation.setValid( result );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml	2015-06-02 15:19:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml	2015-06-02 15:46:55 +0000
@@ -308,7 +308,7 @@
       <param name="page">
         /dhis-web-maintenance-program/addProgramStageForm.vm
       </param>
-      <param name="javascripts">javascript/commons.js,javascript/programStage.js</param>
+      <param name="javascripts">javascript/programStage.js</param>
       <param name="stylesheets">style/basic.css</param>
       <param name="requiredAuthorities">F_PROGRAMSTAGE_ADD</param>
     </action>
@@ -345,7 +345,7 @@
       <param name="page">
         /dhis-web-maintenance-program/updateProgramStageForm.vm
       </param>
-      <param name="javascripts">javascript/commons.js,javascript/programStage.js</param>
+      <param name="javascripts">javascript/programStage.js</param>
       <param name="stylesheets">style/basic.css</param>
       <param name="requiredAuthorities">F_PROGRAMSTAGE_ADD</param>
     </action>
@@ -393,7 +393,7 @@
         /dhis-web-maintenance-program/programStageSection.vm
       </param>
       <param name="menu">/dhis-web-maintenance-program/menu.vm</param>
-      <param name="javascripts">javascript/commons.js,javascript/programStageSection.js</param>
+      <param name="javascripts">javascript/programStageSection.js</param>
       <param name="stylesheets">style/basic.css</param>
       <param name="requiredAuthorities">F_PROGRAMSTAGE_SECTION_MANAGEMENT</param>
     </action>
@@ -404,7 +404,7 @@
       <param name="page">
         /dhis-web-maintenance-program/addProgramStageSectionForm.vm
       </param>
-      <param name="javascripts">javascript/commons.js,javascript/programStageSection.js</param>
+      <param name="javascripts">javascript/programStageSection.js</param>
       <param name="stylesheets">style/basic.css</param>
       <param name="requiredAuthorities">F_PROGRAMSTAGE_SECTION_ADD</param>
     </action>
@@ -422,7 +422,7 @@
       <param name="page">
         /dhis-web-maintenance-program/updateProgramStageSectionForm.vm
       </param>
-      <param name="javascripts">javascript/commons.js,javascript/programStageSection.js</param>
+      <param name="javascripts">javascript/programStageSection.js</param>
       <param name="stylesheets">style/basic.css</param>
       <param name="requiredAuthorities">F_PROGRAMSTAGE_SECTION_ADD</param>
     </action>
@@ -458,7 +458,7 @@
       <param name="page">
         /dhis-web-maintenance-program/programStageSectionSortOder.vm
       </param>
-      <param name="javascripts">javascript/commons.js,javascript/programStageSection.js</param>
+      <param name="javascripts">javascript/programStageSection.js</param>
       <param name="stylesheets">style/basic.css</param>
       <param name="requiredAuthorities">F_PROGRAMSTAGE_SECTION_MANAGEMENT</param>
     </action>
@@ -704,7 +704,7 @@
       class="org.hisp.dhis.trackedentity.action.caseaggregation.ShowAddCaseAggregationConditionFormAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-program/addCaseAggregation.vm</param>
-      <param name="javascripts">javascript/commons.js,javascript/caseaggregation.js</param>
+      <param name="javascripts">javascript/caseaggregation.js</param>
       <param name="stylesheets">style/basic.css</param>
     </action>
 
@@ -712,7 +712,7 @@
       class="org.hisp.dhis.trackedentity.action.caseaggregation.ShowUpdateCaseAggregationConditionFormAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-program/updateCaseAggregation.vm</param>
-      <param name="javascripts">javascript/commons.js,javascript/caseaggregation.js</param>
+      <param name="javascripts">javascript/caseaggregation.js</param>
       <param name="stylesheets">style/basic.css</param>
     </action>
 
@@ -1027,7 +1027,7 @@
       class="org.hisp.dhis.trackedentity.action.program.GetProgramAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-program/addProgramIndicator.vm</param>
-      <param name="javascripts">javascript/commons.js,javascript/programIndicator.js</param>
+      <param name="javascripts">javascript/programIndicator.js</param>
       <param name="requiredAuthorities">F_ADD_PROGRAM_INDICATOR</param>
     </action>
 
@@ -1042,7 +1042,7 @@
       class="org.hisp.dhis.trackedentity.action.programindicator.GetProgramIndicatorAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-program/updateProgramIndicator.vm</param>
-      <param name="javascripts">javascript/commons.js,javascript/programIndicator.js</param>
+      <param name="javascripts">javascript/programIndicator.js</param>
       <param name="requiredAuthorities">F_ADD_PROGRAM_INDICATOR</param>
     </action>
 
@@ -1087,7 +1087,7 @@
       class="org.hisp.dhis.trackedentity.action.trackedentityinstancereminder.ShowAddProgramReminderAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-program/addProgramReminder.vm</param>
-      <param name="javascripts">javascript/commons.js,javascript/programReminder.js</param>
+      <param name="javascripts">javascript/programReminder.js</param>
       <param name="requiredAuthorities">F_TRACKED_ENTITY_INSTANCE_REMINDER_MANAGEMENT</param>
     </action>
 
@@ -1102,7 +1102,7 @@
       class="org.hisp.dhis.trackedentity.action.trackedentityinstancereminder.GetInstanceReminderAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-program/updateProgramReminder.vm</param>
-      <param name="javascripts">javascript/commons.js,javascript/programReminder.js</param>
+      <param name="javascripts">javascript/programReminder.js</param>
       <param name="requiredAuthorities">F_TRACKED_ENTITY_INSTANCE_REMINDER_MANAGEMENT</param>
     </action>
 
@@ -1154,7 +1154,7 @@
       class="org.hisp.dhis.trackedentity.action.trackedentityinstancereminder.ShowAddProgramStageReminderAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-program/addProgramStageReminder.vm</param>
-      <param name="javascripts">javascript/commons.js,javascript/programStageReminder.js</param>
+      <param name="javascripts">javascript/programStageReminder.js</param>
       <param name="requiredAuthorities">F_TRACKED_ENTITY_INSTANCE_REMINDER_MANAGEMENT</param>
     </action>
 
@@ -1169,7 +1169,7 @@
       class="org.hisp.dhis.trackedentity.action.trackedentityinstancereminder.GetProgramStageReminderAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-program/updateProgramStageReminder.vm</param>
-      <param name="javascripts">javascript/commons.js,javascript/programStageReminder.js</param>
+      <param name="javascripts">javascript/programStageReminder.js</param>
       <param name="requiredAuthorities">F_TRACKED_ENTITY_INSTANCE_REMINDER_MANAGEMENT</param>
     </action>
 

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/commons.js	2015-06-02 12:03:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/commons.js	1970-01-01 00:00:00 +0000
@@ -1,49 +0,0 @@
-
-//------------------------------------------------------------------------------
-// Filter data-element
-//------------------------------------------------------------------------------
-
-function filterIndicatorSelect( event, value, fieldName )
-{
-	var field = byId(fieldName);
-	
-	for ( var index = 0; index < field.options.length; index++ )
-    {
-		var option = field.options[index];
-		
-		if ( value.length == 0 || option.text.toLowerCase().indexOf( value.toLowerCase() ) != -1 )
-		{
-			option.style.display = "block";
-		}
-		else
-		{
-			option.style.display = "none";
-		}
-    }	    
-}
-
-// ----------------------------------------------------------------
-// Get Params form Div
-// ----------------------------------------------------------------
-
-function getParamsForDiv( trackedEntityDiv)
-{
-	var params = '';
-	jQuery("#" + trackedEntityDiv + " :input").each(function()
-		{
-			var elementId = $(this).attr('id');
-			
-			if( $(this).attr('type') == 'checkbox' )
-			{
-				var checked = jQuery(this).attr('checked') ? true : false;
-				params += elementId + "=" + checked + "&";
-			}
-			else if( $(this).attr('type') != 'button' )
-			{
-				params += elementId + "="+ jQuery(this).val() + "&";
-			}
-		});
-		
-	return params;
-}
-

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.js	2015-06-02 15:19:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.js	2015-06-02 15:46:55 +0000
@@ -39,6 +39,24 @@
   removeItem(context.id, context.name, i18n_confirm_delete, 'removeProgramIndicator.action');
 }
 
+function filterExpressionSelect( event, value, fieldName ) {
+	var field = byId(fieldName);
+	
+	for ( var index = 0; index < field.options.length; index++ )
+    {
+		var option = field.options[index];
+		
+		if ( value.length == 0 || option.text.toLowerCase().indexOf( value.toLowerCase() ) != -1 )
+		{
+			option.style.display = "block";
+		}
+		else
+		{
+			option.style.display = "none";
+		}
+    }	    
+}
+
 function getTrackedEntityDataElements() {
   clearListById('dataElements');
   clearListById('deSumId');

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm	2015-06-02 15:19:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm	2015-06-02 15:46:55 +0000
@@ -5,21 +5,21 @@
 	<tr>
 		<td>
 	
-		<div id="tabs" style="width:670px; margin: 1px 0;">
+		<div id="expression-tabs" style="width:670px; margin: 1px 0;">
 			<ul>
-				<li><a href="#tab-1">$i18n.getString("dataelements")</a></li>
+				<li><a href="#expression-tab1">$i18n.getString("data_elements")</a></li>
 				#if($program.type!='3')
-					<li><a href="#tab-2">$i18n.getString("attributes")</a></li>
-					<li><a href="#tab-3">$i18n.getString("variables")</a></li>
+					<li><a href="#expression-tab2">$i18n.getString("attributes")</a></li>
+					<li><a href="#expression-tab3">$i18n.getString("variables")</a></li>
 				#end
-				<li><a href="#tab-4">$i18n.getString("constants")</a></li>
+				<li><a href="#expression-tab4">$i18n.getString("constants")</a></li>
 			</ul>	
 			
-			<div id="tab-1">
+			<div id="expression-tab1">
 			  <table style="width:100%">
 		        <tr>
 					<td>
-						<input type='text' id='txtSearchValue' name='txtSearchValue' onKeyUp="filterIndicatorSelect(event, this.value, 'dataElements');" placeholder="$i18n.getString('filter')" />
+						<input type='text' id='txtSearchValue' name='txtSearchValue' onKeyUp="filterExpressionSelect(event, this.value, 'dataElements');" placeholder="$i18n.getString('filter')" />
 						<input type='button' value='$i18n.getString("clear")' onClick="setFieldValue('txtSearchValue', '');" />			
 					</td>
 		        </tr>
@@ -33,11 +33,11 @@
 			
 		#if($program.type!='3')
 		
-			<div id="tab-2">
+			<div id="expression-tab2">
 				<table style="width:100%">
 		        <tr>
 					<td>
-						<input type='text' id='txtSearchAttrValue' name='txtSearchAttrValue' onKeyUp="filterIndicatorSelect(event, this.value, 'attributes');" placeholder="$i18n.getString('filter')" />
+						<input type='text' id='txtSearchAttrValue' name='txtSearchAttrValue' onKeyUp="filterExpressionSelect(event, this.value, 'attributes');" placeholder="$i18n.getString('filter')" />
 						<input type='button' value='$i18n.getString("clear")' onClick="setFieldValue('txtSearchAttrValue', '');" />			
 					</td>
 		        </tr>
@@ -55,11 +55,11 @@
 		      </table>
 			</div>
 			
-			<div id="tab-3">
+			<div id="expression-tab3">
 				<table style="width:100%">
 				  <tr>
 				    <td>
-					  <input type='text' id='txtSearchPropertyValue' name='txtSearchValue' onKeyUp="filterIndicatorSelect(event, this.value, 'programProperty');" placeholder="$i18n.getString('filter')" />
+					  <input type='text' id='txtSearchPropertyValue' name='txtSearchValue' onKeyUp="filterExpressionSelect(event, this.value, 'programProperty');" placeholder="$i18n.getString('filter')" />
 					  <input type='button' value='$i18n.getString("clear")' onClick="setFieldValue('txtSearchPropertyValue', '');" />			
 					</td>
 		        </tr>
@@ -79,11 +79,11 @@
 			
 		#end
 		
-			<div id="tab-4">
+			<div id="expression-tab4">
 				<table style="width:100%">
 		        <tr>
 					<td>
-						<input type='text' id='txtSearchContsValue' name='txtSearchAttrValue' onKeyUp="filterIndicatorSelect(event, this.value, 'constants');" placeholder="$i18n.getString('filter')" />
+						<input type='text' id='txtSearchContsValue' name='txtSearchAttrValue' onKeyUp="filterExpressionSelect(event, this.value, 'constants');" placeholder="$i18n.getString('filter')" />
 						<input type='button' value='$i18n.getString("clear")' onClick="setFieldValue('txtSearchContsValue', '');" />			
 					</td>
 		        </tr>
@@ -133,5 +133,5 @@
 </table>		
 
 <script type="text/javascript">
-	$('#tabs').tabs();
+	$('#expression-tabs').tabs();
 </script>