=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueService.java 2009-09-25 21:45:01 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueService.java 2009-11-25 08:19:22 +0000 @@ -256,16 +256,4 @@ * @return a collection of all DataValues which mach the given collection of DataElements. */ Collection getDataValues( DataElement dataElement ); - - /** - * Returns all DataValueAudits for a given DataElement, CategoryOptionCombo, Period, - * Sources. - * - * @param dataElement the DataElement of the DataValue. - * @param optionCombo the DataElementCategoryOptionCombo of the DataElement. - * @param source the Source of the DataValue. - * @param period the Period of the DataValue. - * @return a collection of all DataValueAudits which match the given parameters. - */ - Collection getDataValueAudits( Source source, Period period, DataElement dataElement, DataElementCategoryOptionCombo optionCombo ); } === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueStore.java 2009-09-25 21:45:01 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueStore.java 2009-11-25 08:19:22 +0000 @@ -248,16 +248,4 @@ * @return a collection of all DataValues which mach the given collection of DataElements. */ Collection getDataValues( DataElement dataElement ); - - /** - * Returns all DataValueAudits for a given DataElement, CategoryOptionCombo, Period, - * Sources. - * - * @param dataElement the DataElement of the DataValue. - * @param optionCombo the DataElementCategoryOptionCombo of the DataElement. - * @param source the Source of the DataValue. - * @param period the Period of the DataValue. - * @return a collection of all DataValueAudits which match the given parameters. - */ - Collection getDataValueAudits( Source source, Period period, DataElement dataElement, DataElementCategoryOptionCombo optionCombo ); } === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DefaultDataValueService.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DefaultDataValueService.java 2009-09-25 21:45:01 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DefaultDataValueService.java 2009-11-25 08:19:22 +0000 @@ -61,7 +61,7 @@ public void addDataValue( DataValue dataValue ) { - if ( !(dataValue.getValue() == null && dataValue.getComment() == null) ) + if ( !( dataValue.getValue() == null && dataValue.getComment() == null ) ) { dataValueStore.addDataValue( dataValue ); } @@ -178,10 +178,4 @@ { return dataValueStore.getDataValues( dataElement ); } - - public Collection getDataValueAudits( Source source, Period period, DataElement dataElement, - DataElementCategoryOptionCombo optionCombo ) - { - return dataValueStore.getDataValueAudits( source, period, dataElement, optionCombo ); - } } === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.java 2009-09-25 21:45:01 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.java 2009-11-25 08:19:22 +0000 @@ -45,7 +45,6 @@ import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; import org.hisp.dhis.datavalue.DataValue; -import org.hisp.dhis.datavalue.DataValueAudit; import org.hisp.dhis.datavalue.DataValueStore; import org.hisp.dhis.period.Period; import org.hisp.dhis.period.PeriodStore; @@ -124,11 +123,6 @@ Session session = sessionFactory.getCurrentSession(); session.save( dataValue ); - - DataValueAudit dataValueAudit = new DataValueAudit(dataValue); - dataValueAudit.setRevisionType("dv_added"); - - session.save( dataValueAudit ); } public void updateDataValue( DataValue dataValue ) @@ -138,11 +132,6 @@ Session session = sessionFactory.getCurrentSession(); session.update( dataValue ); - - DataValueAudit dataValueAudit = new DataValueAudit(dataValue); - dataValueAudit.setRevisionType("dv_updated"); - - session.save( dataValueAudit ); } public void deleteDataValue( DataValue dataValue ) @@ -150,11 +139,6 @@ Session session = sessionFactory.getCurrentSession(); session.delete( dataValue ); - - DataValueAudit dataValueAudit = new DataValueAudit(dataValue); - dataValueAudit.setRevisionType("dv_deleted"); - - session.save( dataValueAudit ); } public int deleteDataValuesBySource( Source source ) @@ -478,18 +462,4 @@ return criteria.list(); } - - @SuppressWarnings( "unchecked" ) - public Collection getDataValueAudits( Source source, Period period, DataElement dataElement, DataElementCategoryOptionCombo optionCombo ) - { - Session session = sessionFactory.getCurrentSession(); - - Criteria criteria = session.createCriteria( DataValueAudit.class ); - criteria.add( Restrictions.eq( "source", source ) ); - criteria.add( Restrictions.eq( "period", period ) ); - criteria.add( Restrictions.eq( "dataElement", dataElement ) ); - criteria.add( Restrictions.eq( "optionCombo", optionCombo ) ); - - return criteria.list(); - } } === removed file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/ViewDataValueAuditPopupAction.java' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/ViewDataValueAuditPopupAction.java 2009-10-18 22:44:41 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/ViewDataValueAuditPopupAction.java 1970-01-01 00:00:00 +0000 @@ -1,225 +0,0 @@ -package org.hisp.dhis.de.action; - -/* - * Copyright (c) 2004-2009, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.List; - -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.dataelement.DataElementCategoryService; -import org.hisp.dhis.dataelement.DataElementService; -import org.hisp.dhis.datavalue.DataValueAudit; -import org.hisp.dhis.datavalue.DataValueService; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitService; -import org.hisp.dhis.period.Period; -import org.hisp.dhis.period.PeriodService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Latifov Murodillo Abdusamadovich - * @version $Id$ - */ -public class ViewDataValueAuditPopupAction - implements Action -{ - private Integer organisationUnitId; - - private Integer dataElementComboId; - - private Integer dataElementId; - - private Integer periodId; - - private List dataValueAudits; - - private DataValueAudit dataValueAudit; - - private OrganisationUnit organisationUnit; - - private Period period; - - private DataElementCategoryOptionCombo dataElementCategoryOptionCombo; - - private DataElement dataElement; - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - public DataElementCategoryOptionCombo getDataElementCategoryOptionCombo() - { - return dataElementCategoryOptionCombo; - } - - public void setDataElementCategoryOptionCombo( DataElementCategoryOptionCombo dataElementCategoryOptionCombo ) - { - this.dataElementCategoryOptionCombo = dataElementCategoryOptionCombo; - } - - private DataValueService dataValueService; - - public void setDataValueService( DataValueService dataValueService ) - { - this.dataValueService = dataValueService; - } - - private DataElementService dataElementService; - - public void setDataElementService( DataElementService dataElementService ) - { - this.dataElementService = dataElementService; - } - - private DataElementCategoryService categoryService; - - public void setCategoryService( DataElementCategoryService categoryService ) - { - this.categoryService = categoryService; - } - - private PeriodService periodService; - - public void setPeriodService( PeriodService periodService ) - { - this.periodService = periodService; - } - - private OrganisationUnitService organisationUnitService; - - public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) - { - this.organisationUnitService = organisationUnitService; - } - - public DataElement getDataElement() - { - return dataElement; - } - - public void setDataElement( DataElement dataElement ) - { - this.dataElement = dataElement; - } - - public OrganisationUnit getOrganisationUnit() - { - return organisationUnit; - } - - public void setOrganisationUnit( OrganisationUnit organisationUnit ) - { - this.organisationUnit = organisationUnit; - } - - public Period getPeriod() - { - return period; - } - - public void setPeriod( Period period ) - { - this.period = period; - } - - public DataValueAudit getDataValueAudit() - { - return dataValueAudit; - } - - public void setDataValueAudit( DataValueAudit dataValueAudit ) - { - this.dataValueAudit = dataValueAudit; - } - - public List getDataValueAudits() - { - return dataValueAudits; - } - - public void setDataValueAudits( List dataValueAudits ) - { - this.dataValueAudits = dataValueAudits; - } - - public Integer getOrganisationUnitId() - { - return organisationUnitId; - } - - public void setOrganisationUnitId( Integer organisationUnitId ) - { - this.organisationUnitId = organisationUnitId; - } - - public Integer getDataElementComboId() - { - return dataElementComboId; - } - - public void setDataElementComboId( Integer dataElementComboId ) - { - this.dataElementComboId = dataElementComboId; - } - - public Integer getDataElementId() - { - return dataElementId; - } - - public void setDataElementId( Integer dataElementId ) - { - this.dataElementId = dataElementId; - } - - public Integer getPeriodId() - { - return periodId; - } - - public void setPeriodId( Integer periodId ) - { - this.periodId = periodId; - } - - public String execute() - throws Exception - { - dataElement = dataElementService.getDataElement( getDataElementId() ); - organisationUnit = organisationUnitService.getOrganisationUnit( getOrganisationUnitId() ); - period = periodService.getPeriod( getPeriodId() ); - - dataElementCategoryOptionCombo = categoryService.getDataElementCategoryOptionCombo( getDataElementComboId() ); - - dataValueAudits = (List) dataValueService.getDataValueAudits( organisationUnit, period, - dataElement, dataElementCategoryOptionCombo ); - - return SUCCESS; - } -} === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml 2009-10-26 15:39:29 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml 2009-11-25 08:19:22 +0000 @@ -285,19 +285,6 @@ - - - - - - - - - - === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml 2009-08-20 08:30:11 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml 2009-11-25 08:19:22 +0000 @@ -198,12 +198,6 @@ /dhis-web-dataentry/responseSuccess.vm /dhis-web-dataentry/responseNone.vm - - - - /dhis-web-dataentry/auditResponseSuccess.vm - - + === removed file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/auditResponseSuccess.vm' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/auditResponseSuccess.vm 2009-05-22 22:55:18 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/auditResponseSuccess.vm 1970-01-01 00:00:00 +0000 @@ -1,27 +0,0 @@ - - - - -

$i18n.getString( 'audit' )


- - $dataElement.name   $dataElementCategoryOptionCombo.name
- $organisationUnit.name
-
-$i18n.getString( 'audit_from' ) $period.startDate $i18n.getString( 'audit_to' ) $period.EndDate
- -#foreach( $dataValueAudit in $dataValueAudits ) - - - - - - -#end -
$i18n.getString( 'audit_value' )$i18n.getString( 'audit_stored_by' )$i18n.getString( 'audit_time' )$i18n.getString( 'audit_operation' )
$dataValueAudit.value $dataValueAudit.storedBy $dataValueAudit.timestamp $i18n.getString( $dataValueAudit.revisionType )
- \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2009-05-22 22:53:13 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2009-11-25 08:19:22 +0000 @@ -181,22 +181,10 @@ barHeight = Math.round( maxBarHeight * historyPoints[i][1] / maxValue ); g.drawStringRect( historyPoints[i][1].toFixed(), cellWidth * ( i - 1 ) + cellWidth / 2, barBase - barHeight - verticalPadding - fontSizePixels, cellWidth * 2, 'center' ); } -var qstr = ''; -qstr = qstr + historyPoints[i][0]; -qstr = qstr + ''; -// g.drawStringRect( "" + historyPoints[i][0] + "", cellWidth * i, barBase + verticalPadding, cellWidth, 'center' ); - g.drawStringRect( qstr , cellWidth * i, barBase + verticalPadding, cellWidth, 'center' ); + g.drawStringRect( historyPoints[i][0], cellWidth * i, barBase + verticalPadding, cellWidth, 'center' ); } - + g.paint(); } @@ -282,11 +270,6 @@ } } -function openAuditForm (idou, idco, idde, psd) - { - window.open ('../dhis-web-dataentry/viewDataValuePopupForm.action?organisationUnitId=' + idou + '&dataElementComboId=' +idco + '&dataElementId=' + idde +'&periodId=' + psd + '&width=800,height=600,scrollbars=yes'); - } - function refreshWindow() { window.location.reload();