=== modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultQualityScorePaymentService.java' --- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultQualityScorePaymentService.java 2014-05-08 11:03:37 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/DefaultQualityScorePaymentService.java 2014-05-09 05:53:05 +0000 @@ -5,7 +5,9 @@ import org.hisp.dhis.rbf.api.QualityScorePayment; import org.hisp.dhis.rbf.api.QualityScorePaymentService; import org.hisp.dhis.rbf.api.QualityScorePaymentStore; +import org.springframework.transaction.annotation.Transactional; +@Transactional public class DefaultQualityScorePaymentService implements QualityScorePaymentService { === modified file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateQualityScorePaymentStore.java' --- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateQualityScorePaymentStore.java 2014-05-08 11:03:37 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/impl/HibernateQualityScorePaymentStore.java 2014-05-09 05:53:05 +0000 @@ -66,6 +66,7 @@ return (QualityScorePayment) criteria.uniqueResult(); } + @SuppressWarnings( "unchecked" ) @Override public Collection getAllQualityScorePayments() { === added directory 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment' === added directory 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action' === added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/AddQualityScorePaymentAction.java' --- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/AddQualityScorePaymentAction.java 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/AddQualityScorePaymentAction.java 2014-05-09 05:53:05 +0000 @@ -0,0 +1,67 @@ +package org.hisp.dhis.rbf.qualityscorepayment.action; + +import org.hisp.dhis.rbf.api.QualityScorePayment; +import org.hisp.dhis.rbf.api.QualityScorePaymentService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Mithilesh Kumar Thakur + */ +public class AddQualityScorePaymentAction implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private QualityScorePaymentService qualityScorePaymentService; + + public void setQualityScorePaymentService( QualityScorePaymentService qualityScorePaymentService ) + { + this.qualityScorePaymentService = qualityScorePaymentService; + } + + // ------------------------------------------------------------------------- + // Input & output + // ------------------------------------------------------------------------- + + private String startRange; + + public void setStartRange( String startRange ) + { + this.startRange = startRange; + } + + private String endRange; + + public void setEndRange( String endRange ) + { + this.endRange = endRange; + } + + private String addQualityPayment; + + public void setAddQualityPayment( String addQualityPayment ) + { + this.addQualityPayment = addQualityPayment; + } + + // ------------------------------------------------------------------------- + // Action + // ------------------------------------------------------------------------- + + public String execute() throws Exception + { + + QualityScorePayment qualityScorePayment = new QualityScorePayment(); + + qualityScorePayment.setStartRange( Double.parseDouble( startRange ) ); + qualityScorePayment.setEndRange( Double.parseDouble( endRange ) ); + qualityScorePayment.setAddQtyPayment( Double.parseDouble( addQualityPayment ) ); + + qualityScorePaymentService.addQualityScorePayment( qualityScorePayment ); + + return SUCCESS; + } + +} === added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/AddQualityScorePaymentFormAction.java' --- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/AddQualityScorePaymentFormAction.java 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/AddQualityScorePaymentFormAction.java 2014-05-09 05:53:05 +0000 @@ -0,0 +1,21 @@ +package org.hisp.dhis.rbf.qualityscorepayment.action; + +import com.opensymphony.xwork2.Action; + +/** + * @author Mithilesh Kumar Thakur + */ +public class AddQualityScorePaymentFormAction implements Action +{ + + // ------------------------------------------------------------------------- + // Action Implementation + // ------------------------------------------------------------------------- + + public String execute() throws Exception + { + + return SUCCESS; + } + +} === added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/DeleteQualityScorePaymentAction.java' --- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/DeleteQualityScorePaymentAction.java 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/DeleteQualityScorePaymentAction.java 2014-05-09 05:53:05 +0000 @@ -0,0 +1,89 @@ +package org.hisp.dhis.rbf.qualityscorepayment.action; + +import org.hisp.dhis.common.DeleteNotAllowedException; +import org.hisp.dhis.i18n.I18n; +import org.hisp.dhis.rbf.api.QualityScorePayment; +import org.hisp.dhis.rbf.api.QualityScorePaymentService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Mithilesh Kumar Thakur + */ +public class DeleteQualityScorePaymentAction implements Action +{ + + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private QualityScorePaymentService qualityScorePaymentService; + + public void setQualityScorePaymentService( QualityScorePaymentService qualityScorePaymentService ) + { + this.qualityScorePaymentService = qualityScorePaymentService; + } + + + // ------------------------------------------------------------------------- + // Getters & setters + // ------------------------------------------------------------------------- + + private Integer id; + + public void setId( Integer id ) + { + this.id = id; + } + + // ------------------------------------------------------------------------- + // I18n + // ------------------------------------------------------------------------- + + private I18n i18n; + + public void setI18n( I18n i18n ) + { + this.i18n = i18n; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private String message; + + public String getMessage() + { + return message; + } + + // ------------------------------------------------------------------------- + // Action + // ------------------------------------------------------------------------- + + public String execute() throws Exception + { + //System.out.println( "Inside Delete Action : " + id ); + try + { + QualityScorePayment qualityScorePayment = qualityScorePaymentService.getQualityScorePayment( id ); + + qualityScorePaymentService.deleteQualityScorePayment( qualityScorePayment ); + + message = i18n.getString( "delete_success" ); + } + catch ( DeleteNotAllowedException ex ) + { + if ( ex.getErrorCode().equals( DeleteNotAllowedException.ERROR_ASSOCIATED_BY_OTHER_OBJECTS ) ) + { + message = i18n.getString( "object_not_deleted_associated_by_objects" ) + " " + ex.getMessage(); + + return ERROR; + } + } + + return SUCCESS; + } +} + === added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/GetQualityScorePaymentAction.java' --- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/GetQualityScorePaymentAction.java 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/GetQualityScorePaymentAction.java 2014-05-09 05:53:05 +0000 @@ -0,0 +1,66 @@ +package org.hisp.dhis.rbf.qualityscorepayment.action; + +import org.hisp.dhis.rbf.api.Lookup; +import org.hisp.dhis.rbf.api.LookupService; +import org.hisp.dhis.rbf.api.QualityScorePayment; +import org.hisp.dhis.rbf.api.QualityScorePaymentService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Mithilesh Kumar Thakur + */ +public class GetQualityScorePaymentAction implements Action +{ + + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private QualityScorePaymentService qualityScorePaymentService; + + public void setQualityScorePaymentService( QualityScorePaymentService qualityScorePaymentService ) + { + this.qualityScorePaymentService = qualityScorePaymentService; + } + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer id; + + public void setId( Integer id ) + { + this.id = id; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private QualityScorePayment qualityscorepayment; + + public QualityScorePayment getQualityscorepayment() + { + return qualityscorepayment; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public String execute() throws Exception + { + + qualityscorepayment = qualityScorePaymentService.getQualityScorePayment( id ); + + System.out.println( qualityscorepayment.getStartRange() ); + System.out.println( qualityscorepayment.getEndRange() ); + System.out.println( qualityscorepayment.getAddQtyPayment() ); + + return SUCCESS; + } + +} + === added file 'local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/GetQualityScorePaymentList.java' --- local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/GetQualityScorePaymentList.java 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/java/org/hisp/dhis/rbf/qualityscorepayment/action/GetQualityScorePaymentList.java 2014-05-09 05:53:05 +0000 @@ -0,0 +1,89 @@ +package org.hisp.dhis.rbf.qualityscorepayment.action; + +import static org.apache.commons.lang.StringUtils.isNotBlank; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.hisp.dhis.paging.ActionPagingSupport; +import org.hisp.dhis.rbf.api.Lookup; +import org.hisp.dhis.rbf.api.LookupService; +import org.hisp.dhis.rbf.api.QualityScorePayment; +import org.hisp.dhis.rbf.api.QualityScorePaymentService; + +/** + * @author Mithilesh Kumar Thakur + */ + +public class GetQualityScorePaymentList extends ActionPagingSupport +{ + + // ------------------------------------------------------------------------- + // Dependency + // ------------------------------------------------------------------------- + + private QualityScorePaymentService qualityScorePaymentService; + + public void setQualityScorePaymentService( QualityScorePaymentService qualityScorePaymentService ) + { + this.qualityScorePaymentService = qualityScorePaymentService; + } + + // ------------------------------------------------------------------------- + // Input & Output + // ------------------------------------------------------------------------- + + private List qualityScorePayments; + + public List getQualityScorePayments() + { + return qualityScorePayments; + } + + private String key; + + public String getKey() + { + return key; + } + + public void setKey( String key ) + { + this.key = key; + } + + // ------------------------------------------------------------------------- + // Action Implementation + // ------------------------------------------------------------------------- + + + public String execute() throws Exception + { + qualityScorePayments = new ArrayList( qualityScorePaymentService.getAllQualityScorePayments() ); + + /* + for( QualityScorePayment qualityScorePayment : qualityScorePayments ) + { + System.out.println( qualityScorePayment ); + } + */ + + + + /* + if ( isNotBlank( key ) ) + { + qualityScorePaymentService.searchLookupByName( qualityScorePayments, key ); + } + + this.paging = createPaging( qualityScorePayments.size() ); + qualityScorePayments = getBlockElement( qualityScorePayments, paging.getStartPos(), paging.getPageSize() ); + */ + + //Collections.sort( qualityScorePayments ); + + return SUCCESS; + + } +} === modified file 'local/in/dhis-web-maintenance-rbf/src/main/resources/META-INF/dhis/beans.xml' --- local/in/dhis-web-maintenance-rbf/src/main/resources/META-INF/dhis/beans.xml 2014-05-08 11:03:37 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/resources/META-INF/dhis/beans.xml 2014-05-09 05:53:05 +0000 @@ -376,6 +376,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + plainTextError + + + + + /main.vm + /dhis-web-maintenance-rbf/qualityScorePaymentList.vm + javascript/qualityScorePayment.js + /dhis-web-maintenance-rbf/menu.vm + + + + + + /main.vm + /dhis-web-maintenance-rbf/addqualityScorePaymentForm.vm + javascript/qualityScorePayment.js + F_QUALITY_SCORE_PAYMENT_ADD + + + + + qualityScorePaymentList.action?currentPage=${keyCurrentPage}&key=${keyCurrentKey} + F_QUALITY_SCORE_PAYMENT_ADD + + + + + /dhis-web-commons/ajax/jsonResponseSuccess.vm + /dhis-web-commons/ajax/jsonResponseError.vm + plainTextError + F_QUALITY_SCORE_PAYMENT_DELETE + + + + + /dhis-web-maintenance-rbf/jsonQualityScorePaymentDetails.vm + plainTextError + + + + + + @@ -339,6 +382,23 @@ + + + + + + + + + + + + + + + + + /main.vm === added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/addqualityScorePaymentForm.vm' --- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/addqualityScorePaymentForm.vm 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/addqualityScorePaymentForm.vm 2014-05-09 05:53:05 +0000 @@ -0,0 +1,60 @@ + + + +

$i18n.getString( "add_quality_score_payment_details" )

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
$i18n.getString( "quality_score_payment_details" )
+ + +
+
=== added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/addQualityScorePayment.js' --- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/addQualityScorePayment.js 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/addQualityScorePayment.js 2014-05-09 05:53:05 +0000 @@ -0,0 +1,12 @@ +jQuery(document).ready(function() { + validation2('addQualityScorePaymentForm', function(form) { + form.submit(); + }, + function(){ + + isSubmit = true; + + }); + + +}); === added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/qualityScorePayment.js' --- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/qualityScorePayment.js 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/javascript/qualityScorePayment.js 2014-05-09 05:53:05 +0000 @@ -0,0 +1,38 @@ + +// ---------------------------------------------------------------------- +// Edit Quality Score Payment +// ---------------------------- ------------------------------------------ + +function editQualityScorePaymentForm(context) +{ + location.href = 'editQualityScorePaymentForm.action?scoreId=' + context.id; +} + +//----------------------------------------------------------------------------- +// Quality Score Payment details +//----------------------------------------------------------------------------- + +function showQualityScorePaymentDetails(context) +{ + + jQuery.getJSON('getQualityScorePayment.action', { + id : context.id + }, function(json) { + setInnerHTML('stateRangeField', json.qualityscorepayment.startRange); + setInnerHTML('endRangeField', json.qualityscorepayment.endRange); + setInnerHTML('additionalPaymentField', json.qualityscorepayment.addQtyPayment); + + showDetails(); + }); +} + + +//----------------------------------------------------------------------------- +// Delete Quality Score Payment +//----------------------------------------------------------------------------- + +function removeQualityScorePayment(context) { + + removeItem( context.id, context.name, i18n_confirm_delete, + 'delQualityScorePayment.action'); +} === added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/jsonQualityScorePaymentDetails.vm' --- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/jsonQualityScorePaymentDetails.vm 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/jsonQualityScorePaymentDetails.vm 2014-05-09 05:53:05 +0000 @@ -0,0 +1,8 @@ +{ "qualityscorepayment": + { + "id": "$!{qualityscorepayment.id}", + "startRange": "$!{qualityscorepayment.startRange}", + "endRange": "$!{qualityscorepayment.endRange}", + "addQtyPayment": "$!{qualityscorepayment.addQtyPayment}" + } +} \ No newline at end of file === modified file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm' --- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm 2014-04-26 11:27:06 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/menu.vm 2014-05-09 05:53:05 +0000 @@ -12,6 +12,14 @@
  • $i18n.getString( "bank_details_management" )
  • +

    $i18n.getString( "quality_score_payment" )

    + + + + +

    $i18n.getString( "aggregation_builder" )

    • $i18n.getString( "aggregation_query_list" )
    • === added file 'local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityScorePaymentList.vm' --- local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityScorePaymentList.vm 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-rbf/src/main/webapp/dhis-web-maintenance-rbf/qualityScorePaymentList.vm 2014-05-09 05:53:05 +0000 @@ -0,0 +1,87 @@ +#sharingDialog() + + + +

      $i18n.getString( "quality_score_payment_management" ) #openHelp("lookup")

      + + + + + + + + + +
      + + + + + +
      + +
      + + + + + + + + + + + #foreach( $qualityScorePayment in $qualityScorePayments ) + + + + + + #end + +
      $i18n.getString( "stare_range" )$i18n.getString( "end_range" )$i18n.getString( "additional_quality_payment" )
      $encoder.htmlEncode( $!qualityScorePayment.getStartRange() )$encoder.htmlEncode( $!qualityScorePayment.getEndRange() )$encoder.htmlEncode( $!qualityScorePayment.getAddQtyPayment() )
      +

      + ##parse( "/dhis-web-commons/paging/paging.vm" ) +
      +
      +
      + $i18n.getString( 'hide_details' ) +
      +


      +


      +


      + +
      + +
      +
      + $i18n.getString( 'hide_warning' ) +
      +

      +
      + +