← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8317: Minor fix for remove program-stage-section.

 

------------------------------------------------------------
revno: 8317
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-10-01 16:38:04 +0700
message:
  Minor fix for remove program-stage-section.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStageSection.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageSection.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-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml	2012-10-01 04:09:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml	2012-10-01 09:38:04 +0000
@@ -309,7 +309,6 @@
 	
 	<bean id="org.hisp.dhis.patient.action.programstage.RemoveProgramStageSectionAction"
 		class="org.hisp.dhis.patient.action.programstage.RemoveProgramStageSectionAction" scope="prototype">
-		<property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
 		<property name="programStageSectionService" ref="org.hisp.dhis.program.ProgramStageSectionService" />
 	</bean>
 	

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStageSection.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStageSection.js	2012-09-17 06:40:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStageSection.js	2012-10-01 09:38:04 +0000
@@ -17,25 +17,7 @@
 	});
 }
 
-function removeSection( programStageId, sectionId, name )
+function removeSection( id, name )
 {
-	var result = window.confirm( i18n_confirm_delete + "\n" + name );
-    if ( result )
-    {
-		jQuery.getJSON( "removeProgramStageSection.action",
-			{
-				programStageId:programStageId,
-				id:sectionId
-			}, 
-			function( json ) 
-			{   
-				jQuery( "tr#tr" + sectionId ).remove();
-				jQuery( "table.listTable tbody tr" ).removeClass( "listRow listAlternateRow" );
-				jQuery( "table.listTable tbody tr:odd" ).addClass( "listAlternateRow" );
-				jQuery( "table.listTable tbody tr:even" ).addClass( "listRow" );
-				jQuery( "table.listTable tbody" ).trigger("update");
-				
-				showSuccessMessage( i18n_delete_success );
-			});
-	}
+	removeItem( id, name, i18n_confirm_delete, 'removeProgramStageSection.action' );
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageSection.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageSection.vm	2012-09-17 06:40:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageSection.vm	2012-10-01 09:38:04 +0000
@@ -29,7 +29,7 @@
 							<td onclick="showSectionDetails( $section.id )">$encoder.htmlEncode( $section.name )</td>							
 							<td style="text-align:center"#alternate( $mark )>
 							  <a href="showUpdateProgramStageSectionForm.action?programStageId=$programStage.id&id=$section.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
-							  <a href="javascript:removeSection( '$programStage.id', '$section.id', '$encoder.jsEncode( $section.name )', i18n_confirm_delete , 'removeProgramStage.action' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
+							  <a href="javascript:removeSection( '$section.id', '$section.name' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
 							  <a href="javascript:showSectionDetails( $section.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
 							</td>
 						</tr>
@@ -53,6 +53,6 @@
 
 
 <script type="text/javascript">
-    var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_prorgam_stage" ) , "'" )';
+    var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_prorgam_stage_section" ) , "'" )';
 	var i18n_delete_success = '$encoder.jsEscape( $i18n.getString( "delete_success" ) , "'" )';
 </script>