dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #04312
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1411: Completed ajax-based object delete methods.
------------------------------------------------------------
revno: 1411
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-02-10 20:12:22 +0100
message:
Completed ajax-based object delete methods.
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroup.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroupSet.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnit.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroup.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroupSet.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/responseOrganisationUnitGroupSetObject.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/RemoveRoleAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allRole.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allUser.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/role.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/user.js
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/ValidateDocumentAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDocumentForm.vm
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewReportForm.vm
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewTableForm.vm
dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/RemoveValidationRuleGroupAction.java
dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/general.js
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRuleGroup.js
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/searchResult.vm
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRule.vm
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRuleGroup.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-organisationunit/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/struts.xml 2010-01-31 22:36:37 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/struts.xml 2010-02-10 19:12:22 +0000
@@ -96,10 +96,10 @@
<action name="removeOrganisationUnit"
class="org.hisp.dhis.oum.action.organisationunit.RemoveOrganisationUnitAction">
- <result name="success" type="velocity-xml">
- /dhis-web-maintenance-organisationunit/responseSuccess.vm</result>
- <result name="error" type="velocity-xml">
- /dhis-web-maintenance-organisationunit/responseError.vm</result>
+ <result name="success" type="velocity-json">
+ /dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+ <result name="error" type="velocity-json">
+ /dhis-web-commons/ajax/jsonResponseError.vm</result>
<param name="onExceptionReturn">plainTextError</param>
<param name="requiredAuthorities">F_ORGANISATIONUNIT_DELETE</param>
</action>
@@ -176,8 +176,8 @@
<action name="removeOrganisationUnitGroup"
class="org.hisp.dhis.oum.action.organisationunitgroup.RemoveOrganisationUnitGroupAction">
- <result name="success" type="redirect">organisationUnitGroup.action
- </result>
+ <result name="success" type="velocity-json">
+ /dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<param name="requiredAuthorities">F_ORGUNITGROUP_DELETE</param>
</action>
@@ -273,8 +273,8 @@
<action name="removeOrganisationUnitGroupSet"
class="org.hisp.dhis.oum.action.organisationunitgroupset.RemoveGroupSetAction">
- <result name="success" type="redirect">organisationUnitGroupSet.action
- </result>
+ <result name="success" type="velocity-json">
+ /dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<param name="requiredAuthorities">F_ORGUNITGROUPSET_DELETE</param>
</action>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js 2009-11-03 13:11:45 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js 2010-02-10 19:12:22 +0000
@@ -52,32 +52,7 @@
function removeOrganisationUnit( unitId, unitName )
{
- var result = window.confirm( confirm_to_delete_org_unit + '\n\n' + unitName );
-
- if ( result )
- {
- var request = new Request();
- request.setResponseTypeXML( 'message' );
- request.setCallbackSuccess( removeOrganisationUnitCompleted );
- request.send( 'removeOrganisationUnit.action?id=' + unitId );
- }
-}
-
-function removeOrganisationUnitCompleted( messageElement )
-{
- var type = messageElement.getAttribute( 'type' );
- var message = messageElement.firstChild.nodeValue;
-
- if ( type == 'success' )
- {
- window.location.href = 'organisationUnit.action';
- }
- else if ( type = 'error' )
- {
- setFieldValue( 'warningField', message );
-
- showWarning();
- }
+ removeItem( unitId, unitName, confirm_to_delete_org_unit, 'removeOrganisationUnit.action' );
}
// -----------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroup.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroup.js 2009-10-26 15:39:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroup.js 2010-02-10 19:12:22 +0000
@@ -25,12 +25,7 @@
function removeOrganisationUnitGroup( unitGroupId, unitGroupName )
{
- var result = window.confirm( confirm_to_delete_org_unit_group + '\n\n' + unitGroupName );
-
- if ( result )
- {
- window.location.href = 'removeOrganisationUnitGroup.action?id=' + unitGroupId;
- }
+ removeItem( unitGroupId, unitGroupName, confirm_to_delete_org_unit_group, 'removeOrganisationUnitGroup.action' );
}
// -----------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroupSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroupSet.js 2010-01-19 21:48:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroupSet.js 2010-02-10 19:12:22 +0000
@@ -41,12 +41,7 @@
function removeOrganisationUnitGroupSet( groupSetId, groupSetName )
{
- var result = window.confirm( confirm_to_delete_org_unit_group_set + '\n\n' + groupSetName );
-
- if ( result )
- {
- window.location.href = 'removeOrganisationUnitGroupSet.action?id=' + groupSetId;
- }
+ removeItem( groupSetId, groupSetName, confirm_to_delete_org_unit_group_set, 'removeOrganisationUnitGroupSet.action' );
}
// -----------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnit.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnit.vm 2009-11-12 17:59:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnit.vm 2010-02-10 19:12:22 +0000
@@ -18,20 +18,16 @@
<th>$i18n.getString( "name" )</th>
<th colspan="3">$i18n.getString( "operations" )</th>
</tr>
- #set( $mark = false )
+ <tbody id="list">
#foreach( $organisationUnit in $organisationUnits )
- <tr>
- <td#alternate( $mark )>$encoder.htmlEncode( $organisationUnit.name )</td>
- <td style="text-align:center"#alternate( $mark )><a href="showUpdateOrganisationUnitForm.action?id=$organisationUnit.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
- <td style="text-align:center"#alternate( $mark )>#if( $organisationUnit.children.size() == 0 )<a href="javascript:removeOrganisationUnit( $organisationUnit.id, '$encoder.jsEncode( $organisationUnit.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>#end</td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:showOrganisationUnitDetails( $organisationUnit.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
+ <tr id="tr${organisationUnit.id}">
+ <td>$encoder.htmlEncode( $organisationUnit.name )</td>
+ <td style="text-align:center"><a href="showUpdateOrganisationUnitForm.action?id=$organisationUnit.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+ <td style="text-align:center">#if( $organisationUnit.children.size() == 0 )<a href="javascript:removeOrganisationUnit( $organisationUnit.id, '$encoder.jsEncode( $organisationUnit.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>#end</td>
+ <td style="text-align:center"><a href="javascript:showOrganisationUnitDetails( $organisationUnit.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
</tr>
- #if( $mark )
- #set( $mark = false )
- #else
- #set( $mark = true )
- #end
#end
+ </tbody>
#if ( $organisationUnits.size() == 0 )
<tr>
<td colspan="4">$i18n.getString( "this_org_unit_has_no_children" )</td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroup.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroup.vm 2009-11-12 17:59:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroup.vm 2010-02-10 19:12:22 +0000
@@ -19,26 +19,15 @@
<th colspan="3">$i18n.getString( "operations" )</th>
</tr>
<tbody id="list">
- #set( $mark = false )
#foreach( $organisationUnitGroup in $organisationUnitGroups )
- <tr>
- <td#alternate( $mark )>$encoder.htmlEncode( $organisationUnitGroup.name )</td>
- <td style="text-align:center"#alternate( $mark )><a href="openUpdateOrganisationUnitGroup.action?id=$organisationUnitGroup.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:removeOrganisationUnitGroup( $organisationUnitGroup.id, '$encoder.jsEncode( $organisationUnitGroup.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:showOrganisationUnitGroupDetails( $organisationUnitGroup.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
+ <tr id="tr${organisationUnitGroup.id}">
+ <td>$encoder.htmlEncode( $organisationUnitGroup.name )</td>
+ <td style="text-align:center"><a href="openUpdateOrganisationUnitGroup.action?id=$organisationUnitGroup.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+ <td style="text-align:center"><a href="javascript:removeOrganisationUnitGroup( $organisationUnitGroup.id, '$encoder.jsEncode( $organisationUnitGroup.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
+ <td style="text-align:center"><a href="javascript:showOrganisationUnitGroupDetails( $organisationUnitGroup.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
</tr>
- #if( $mark )
- #set( $mark = false )
- #else
- #set( $mark = true )
- #end
#end
</tbody>
- #if ( $organisationUnitGroups.size() == 0 )
- <tr>
- <td colspan="4">$i18n.getString( "there_are_no_org_unit_groups" )</td>
- </tr>
- #end
</table>
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroupSet.vm 2009-11-12 17:59:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroupSet.vm 2010-02-10 19:12:22 +0000
@@ -19,26 +19,15 @@
<th colspan="3">$i18n.getString( "operations" )</th>
</tr>
<tbody id="list">
- #set( $mark = false )
#foreach( $organisationUnitGroupSet in $organisationUnitGroupSets )
- <tr>
- <td#alternate( $mark )>$encoder.htmlEncode( $organisationUnitGroupSet.name )</td>
- <td style="text-align:center"#alternate( $mark )><a href="showUpdateOrganisationUnitGroupSetForm.action?id=$organisationUnitGroupSet.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:removeOrganisationUnitGroupSet( $organisationUnitGroupSet.id, '$encoder.jsEncode( $organisationUnitGroupSet.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:showOrganisationUnitGroupSetDetails( $organisationUnitGroupSet.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
+ <tr id="tr${organisationUnitGroupSet.id}">
+ <td>$encoder.htmlEncode( $organisationUnitGroupSet.name )</td>
+ <td style="text-align:center"><a href="showUpdateOrganisationUnitGroupSetForm.action?id=$organisationUnitGroupSet.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+ <td style="text-align:center"><a href="javascript:removeOrganisationUnitGroupSet( $organisationUnitGroupSet.id, '$encoder.jsEncode( $organisationUnitGroupSet.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
+ <td style="text-align:center"><a href="javascript:showOrganisationUnitGroupSetDetails( $organisationUnitGroupSet.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
</tr>
- #if( $mark )
- #set( $mark = false )
- #else
- #set( $mark = true )
- #end
#end
</tbody>
- #if ( $organisationUnitGroupSets.size() == 0 )
- <tr>
- <td colspan="4">$i18n.getString( "there_are_no_org_unit_group_sets" )</td>
- </tr>
- #end
</table>
</td>
@@ -51,7 +40,6 @@
<p><label>$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
<p><label>$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
<p><label>$i18n.getString( "compulsory" ):</label><br><span id="compulsoryField"></span></p>
- <p><label>$i18n.getString( "exclusive" ):</label><br><span id="exclusiveField"></span></p>
<p><label>$i18n.getString( "number_of_members" ):</label><br><span id="memberCountField"></span></p>
</div>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/responseOrganisationUnitGroupSetObject.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/responseOrganisationUnitGroupSetObject.vm 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/responseOrganisationUnitGroupSetObject.vm 2010-02-10 19:12:22 +0000
@@ -4,6 +4,5 @@
<name>$encoder.xmlEncode( $organisationUnitGroupSet.name )</name>
<description>$encoder.xmlEncode( $organisationUnitGroupSet.description )</description>
<compulsory>$organisationUnitGroupSet.compulsory</compulsory>
- <exclusive>$organisationUnitGroupSet.exclusive</exclusive>
<memberCount>$memberCount</memberCount>
</organisationUnitGroupSet>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/RemoveRoleAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/RemoveRoleAction.java 2009-12-22 08:04:43 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/RemoveRoleAction.java 2010-02-10 19:12:22 +0000
@@ -85,7 +85,6 @@
public String execute()
throws Exception
{
-
UserAuthorityGroup authorityGroup = userStore.getUserAuthorityGroup( id );
if ( authorityGroup != null )
@@ -97,6 +96,7 @@
catch ( DataIntegrityViolationException e )
{
message = i18n.getString( "user_use_group" );
+
return ERROR;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/struts.xml 2010-01-31 22:36:37 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/struts.xml 2010-02-10 19:12:22 +0000
@@ -48,8 +48,8 @@
<param name="onExceptionReturn">plainTextError</param>
</action>
- <action name="removeUser" class="org.hisp.dhis.user.action.RemoveUserAction">
- <result name="success" type="redirect">alluser.action</result>
+ <action name="removeUser" class="org.hisp.dhis.user.action.RemoveUserAction">
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<result name="logout" type="redirect">/dhis-web-commons-security/logout.action</result>
<param name="requiredAuthorities">F_USER_DELETE</param>
</action>
@@ -118,7 +118,8 @@
</action>
<action name="removeRole" class="org.hisp.dhis.user.action.RemoveRoleAction">
- <result name="success" type="redirect">allRole.action</result>
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+ <result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm</result>
<result name="logout" type="redirect">/</result>
<param name="requiredAuthorities">F_USERROLE_DELETE</param>
</action>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allRole.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allRole.vm 2009-12-21 08:11:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allRole.vm 2010-02-10 19:12:22 +0000
@@ -22,28 +22,22 @@
<th colspan="3">$i18n.getString( "operations" )</th>
</tr>
<tbody id="list">
- #set( $mark = false )
#foreach( $userAuthorityGroup in $userAuthorityGroups )
- <tr>
- <td#alternate( $mark )>$!encoder.htmlEncode( $userAuthorityGroup.name )</td>
- <td#alternate( $mark )>$!encoder.htmlEncode( $userAuthorityGroup.description )</td>
+ <tr id="tr${userAuthorityGroup.id}">
+ <td>$!encoder.htmlEncode( $userAuthorityGroup.name )</td>
+ <td>$!encoder.htmlEncode( $userAuthorityGroup.description )</td>
<td style="text-align:center"#alternate( $mark )>
- #if($userAuthorityGroup.name != $!encoder.htmlEncode( $superuserRole))
+ #if($userAuthorityGroup.name != $!encoder.htmlEncode( $superuserRole ) )
<a href="showUpdateRoleForm.action?id=$userAuthorityGroup.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
#end
</td>
- <td style="text-align:center"#alternate( $mark )>
- #if($userAuthorityGroup.name != $!encoder.htmlEncode( $superuserRole))
+ <td style="text-align:center">
+ #if($userAuthorityGroup.name != $!encoder.htmlEncode( $superuserRole ) )
<a href="javascript:removeRole( $userAuthorityGroup.id, '$encoder.jsEncode( $userAuthorityGroup.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
#end
</td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:showRoleDetails( $userAuthorityGroup.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
+ <td style="text-align:center"><a href="javascript:showRoleDetails( $userAuthorityGroup.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
</tr>
- #if( $mark )
- #set( $mark = false )
- #else
- #set( $mark = true )
- #end
#end
</tbody>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allUser.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allUser.vm 2009-12-21 08:11:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allUser.vm 2010-02-10 19:12:22 +0000
@@ -24,28 +24,22 @@
<th colspan="3">$i18n.getString( "operations" )</th>
</tr>
<tbody id="list">
- #set( $mark = false )
#foreach( $userCredentials in $userCredentialsList )
- <tr>
- <td#alternate( $mark )>$encoder.htmlEncode( $userCredentials.username )</td>
- <td#alternate( $mark )>$encoder.htmlEncode( $userCredentials.user.surname ), $encoder.htmlEncode( $userCredentials.user.firstName )</td>
- <td#alternate( $mark )>$!encoder.htmlEncode( $userCredentials.user.organisationUnit.name )</td>
- <td style="text-align:center"#alternate( $mark )>
- #if($encoder.htmlEncode( $userCredentials.username ) != $!encoder.htmlEncode( $userAdmin))
+ <tr id="tr${userCredentials.id}">
+ <td>$encoder.htmlEncode( $userCredentials.username )</td>
+ <td>$encoder.htmlEncode( $userCredentials.user.surname ), $encoder.htmlEncode( $userCredentials.user.firstName )</td>
+ <td>$!encoder.htmlEncode( $userCredentials.user.organisationUnit.name )</td>
+ <td style="text-align:center">
+ #if( $encoder.htmlEncode( $userCredentials.username ) != $!encoder.htmlEncode( $userAdmin ) )
<a href="showUpdateUserForm.action?id=$userCredentials.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
#end
- <td style="text-align:center"#alternate( $mark )>
- #if($encoder.htmlEncode( $userCredentials.username ) != $!encoder.htmlEncode( $userAdmin))
+ <td style="text-align:center">
+ #if( $encoder.htmlEncode( $userCredentials.username ) != $!encoder.htmlEncode( $userAdmin ) )
<a href="javascript:removeUser( $userCredentials.id, '$encoder.jsEncode( $userCredentials.username )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
#end
</td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:showUserDetails( $userCredentials.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
+ <td style="text-align:center"><a href="javascript:showUserDetails( $userCredentials.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
</tr>
- #if( $mark )
- #set( $mark = false )
- #else
- #set( $mark = true )
- #end
#end
</tbody>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/role.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/role.js 2009-12-21 08:11:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/role.js 2010-02-10 19:12:22 +0000
@@ -26,28 +26,9 @@
function removeRole(id, role)
{
- if ( confirm( i18n_confirm_delete ) )
- {
- var request = new Request();
- request.setResponseTypeXML( 'message' );
- request.setCallbackSuccess( removeRoleCompleted );
- request.send( 'removeRole.action?id=' + id );
- //window.location.href = 'removeRole.action?id=' + id;
- }
+ removeItem( id, role, i18n_confirm_delete, 'removeRole.action' );
}
-function removeRoleCompleted(xmlObject){
- var type = xmlObject.getAttribute( 'type' );
-
- if ( type == 'success' )
- {
- windown.location.href = 'allRole.action';
- }
-
- else{
- setMessage(xmlObject.firstChild.nodeValue);
- }
-}
// -----------------------------------------------------------------------------
// Add role
// -----------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/user.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/user.js 2009-05-05 15:24:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/user.js 2010-02-10 19:12:22 +0000
@@ -59,12 +59,7 @@
function removeUser( userId, username )
{
- var result = window.confirm( i18n_confirm_delete + '\n\n' + username );
-
- if ( result )
- {
- window.location.href = 'removeUser.action?id=' + userId;
- }
+ removeItem( userId, username, i18n_confirm_delete, 'removeUser.action' );
}
// -----------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/ValidateDocumentAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/ValidateDocumentAction.java 2009-08-20 08:17:49 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/document/action/ValidateDocumentAction.java 2010-02-10 19:12:22 +0000
@@ -119,7 +119,9 @@
return INPUT;
}
}
-
+
+ message = i18n.getString( "everything_is_ok" );
+
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2009-12-21 12:03:44 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2010-02-10 19:12:22 +0000
@@ -23,7 +23,7 @@
</action>
<action name="removeDocument" class="org.hisp.dhis.reporting.document.action.RemoveDocumentAction">
- <result name="success" type="redirect">displayViewDocumentForm.action</result>
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<param name="requiredAuthorities">F_DOCUMENT_DELETE</param>
</action>
@@ -74,7 +74,7 @@
</action>
<action name="removeChart" class="org.hisp.dhis.reporting.chart.action.RemoveChartAction">
- <result name="success" type="redirect">displayViewChartForm.action</result>
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<param name="requiredAuthorities">F_CHART_DELETE</param>
</action>
@@ -130,8 +130,8 @@
</action>
<action name="removeReport" class="org.hisp.dhis.reporting.reportviewer.action.RemoveReportAction">
- <result name="success" type="redirect">displayViewReportForm.action</result>
- <param name="requiredAuthorities">F_REPORT_DELETE</param>
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+ <param name="requiredAuthorities">F_REPORT_DELETE</param>
</action>
<action name="createReportTable" class="org.hisp.dhis.reporting.tablecreator.action.CreateTableAction">
@@ -187,7 +187,7 @@
</action>
<action name="removeTable" class="org.hisp.dhis.reporting.tablecreator.action.RemoveTableAction">
- <result name="success" type="redirect">displayManageTableForm.action</result>
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<param name="requiredAuthorities">F_REPORTTABLE_DELETE</param>
</action>
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js 2010-02-10 19:12:22 +0000
@@ -57,12 +57,7 @@
function removeChart( chartId, chartTitle )
{
- var result = window.confirm( i18n_confirm_delete + '\n\n' + chartTitle );
-
- if ( result )
- {
- window.location.href = "removeChart.action?id=" + chartId;
- }
+ removeItem( chartId, chartTitle, i18n_confirm_delete, "removeChart.action" );
}
// -----------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js 2009-03-07 13:10:38 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js 2010-02-10 19:12:22 +0000
@@ -1,7 +1,7 @@
function saveDocument()
{
- var name = document.getElementById( "name" );
+ var name = document.getElementById( "name" ).value;
var url = "validateDocument.action?name=" + name;
@@ -30,12 +30,7 @@
function removeDocument( id )
{
- var dialog = window.confirm( i18n_confirm_remove_report );
-
- if ( dialog )
- {
- window.location.href = "removeDocument.action?id=" + id;
- }
+ removeItem( id, "", i18n_confirm_remove_report, "removeDocument.action" );
}
function addDocumentToDashboard( id )
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js 2010-02-01 20:21:20 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js 2010-02-10 19:12:22 +0000
@@ -87,12 +87,7 @@
function removeReport( id )
{
- var dialog = window.confirm( i18n_confirm_remove_report );
-
- if ( dialog )
- {
- window.location.href = "removeReport.action?id=" + id;
- }
+ removeItem( id, "", i18n_confirm_remove_report, "removeReport.action" );
}
function addToDashboard( id )
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js 2010-02-01 20:21:20 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js 2010-02-10 19:12:22 +0000
@@ -134,12 +134,7 @@
function removeTable( tableId, tableName )
{
- var result = window.confirm( i18n_confirm_delete + '\n\n' + tableName );
-
- if ( result )
- {
- window.location.href = "removeTable.action?id=" + tableId;
- }
+ removeItem( tableId, tableName, i18n_confirm_delete, "removeTable.action" );
}
// -----------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm 2010-02-10 19:12:22 +0000
@@ -22,22 +22,18 @@
<th>$i18n.getString( "title" )</th>
<th colspan="5">$i18n.getString( "operations" )</th>
</tr>
- #set( $mark = false )
+ <tbody id="list">
#foreach ( $chart in $charts )
- <tr>
- <td#alternate( $mark )>$encoder.htmlEncode( $chart.title )</td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:runAndViewChart( '$chart.id' )" title="$i18n.getString( "generate_datasource_and_view_chart" )"><img src="../images/open.png" alt="$i18n.getString( "generate_datasource_and_view_chart" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:viewChart( 'viewChart.action?id=$chart.id' )" title="$i18n.getString( "view_chart_based_on_existing_datasource" )"><img src="../images/view_report.png" alt="$i18n.getString( "view_report_based_on_existing_datasource" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="displayAddChartForm.action?id=$chart.id&dimension=$chart.dimension" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:removeChart( '$chart.id', '$encoder.jsEncode( $chart.title )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:showChartDetails( '$chart.id' )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
+ <tr id="tr${chart.id}">
+ <td>$encoder.htmlEncode( $chart.title )</td>
+ <td style="text-align:center"><a href="javascript:runAndViewChart( '$chart.id' )" title="$i18n.getString( "generate_datasource_and_view_chart" )"><img src="../images/open.png" alt="$i18n.getString( "generate_datasource_and_view_chart" )"></a></td>
+ <td style="text-align:center"><a href="javascript:viewChart( 'viewChart.action?id=$chart.id' )" title="$i18n.getString( "view_chart_based_on_existing_datasource" )"><img src="../images/view_report.png" alt="$i18n.getString( "view_report_based_on_existing_datasource" )"></a></td>
+ <td style="text-align:center"><a href="displayAddChartForm.action?id=$chart.id&dimension=$chart.dimension" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+ <td style="text-align:center"><a href="javascript:removeChart( '$chart.id', '$encoder.jsEncode( $chart.title )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
+ <td style="text-align:center"><a href="javascript:showChartDetails( '$chart.id' )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
</tr>
- #if( $mark )
- #set( $mark = false )
- #else
- #set( $mark = true )
- #end
#end
+ </tbody>
</table>
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDocumentForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDocumentForm.vm 2009-03-07 13:10:38 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDocumentForm.vm 2010-02-10 19:12:22 +0000
@@ -19,11 +19,11 @@
<th>$i18n.getString( "name" )</th>
<th colspan="3">$i18n.getString( "operations" )</th>
</tr>
- #set( $mark = false )
+ <tbody id="list">
#foreach ( $document in $documents )
- <tr>
- <td#alternate( $mark )>$encoder.htmlEncode( $document.name )</td>
- <td style="text-align:center"#alternate( $mark )>
+ <tr id="tr${document.id}">
+ <td>$encoder.htmlEncode( $document.name )</td>
+ <td style="text-align:center">
#if ( $document.external )
<a href="$document.url" title="$i18n.getString( 'view_report' )">
#else
@@ -31,15 +31,11 @@
#end
<img src="../images/view_report.png" alt="$i18n.getString( 'view_report' )"></a>
</td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:addDocumentToDashboard( '$document.id' )" title="$i18n.getString( 'add_to_dashboard' )"><img src="../images/add_to_dashboard.png" alt="$i18n.getString( 'add_to_dashboard' )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:removeDocument( '$encoder.htmlEncode( $document.id )' )" title="$i18n.getString( 'remove_report' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove_report' )"></a></td>
+ <td style="text-align:center"><a href="javascript:addDocumentToDashboard( '$document.id' )" title="$i18n.getString( 'add_to_dashboard' )"><img src="../images/add_to_dashboard.png" alt="$i18n.getString( 'add_to_dashboard' )"></a></td>
+ <td style="text-align:center"><a href="javascript:removeDocument( '$encoder.htmlEncode( $document.id )' )" title="$i18n.getString( 'remove_report' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove_report' )"></a></td>
</tr>
- #if( $mark )
- #set( $mark = false )
- #else
- #set( $mark = true )
- #end
#end
+ </tbody>
</table>
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewReportForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewReportForm.vm 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewReportForm.vm 2010-02-10 19:12:22 +0000
@@ -21,22 +21,18 @@
<th>$i18n.getString( "name" )</th>
<th colspan="5">$i18n.getString( "operations" )</th>
</tr>
- #set( $mark = false )
+ <tbody id="list">
#foreach ( $report in $reports )
- <tr>
- <td#alternate( $mark )>$encoder.htmlEncode( $report.name )</td>
- <td style="text-align:center"#alternate( $mark )>#if ( $report.hasReportTable )<a href="getReportParams.action?id=$report.id&url=$report.url&mode=report" title="$i18n.getString( 'generate_datasource_and_view_report' )"><img src="../images/open.png" alt="$i18n.getString( 'generate_datasource_and_view_report' )"></a>#end</td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:viewReport( '$encoder.htmlEncode( $report.url )' )" title="$i18n.getString( 'view_report_based_on_existing_datasource' )"><img src="../images/view_report.png" alt="$i18n.getString( 'view_report_based_on_existing_datasource' )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="displayAddReportForm.action?id=$report.id" title="$i18n.getString( 'edit_report' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit_report' )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:addToDashboard( '$report.id' )" title="$i18n.getString( 'add_to_dashboard' )"><img src="../images/add_to_dashboard.png" alt="$i18n.getString( 'add_to_dashboard' )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:removeReport( '$encoder.htmlEncode( $report.id )' )" title="$i18n.getString( 'remove_report' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove_report' )"></a></td>
+ <tr id="tr${report.id}">
+ <td>$encoder.htmlEncode( $report.name )</td>
+ <td style="text-align:center">#if ( $report.hasReportTable )<a href="getReportParams.action?id=$report.id&url=$report.url&mode=report" title="$i18n.getString( 'generate_datasource_and_view_report' )"><img src="../images/open.png" alt="$i18n.getString( 'generate_datasource_and_view_report' )"></a>#end</td>
+ <td style="text-align:center"><a href="javascript:viewReport( '$encoder.htmlEncode( $report.url )' )" title="$i18n.getString( 'view_report_based_on_existing_datasource' )"><img src="../images/view_report.png" alt="$i18n.getString( 'view_report_based_on_existing_datasource' )"></a></td>
+ <td style="text-align:center"><a href="displayAddReportForm.action?id=$report.id" title="$i18n.getString( 'edit_report' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit_report' )"></a></td>
+ <td style="text-align:center"><a href="javascript:addToDashboard( '$report.id' )" title="$i18n.getString( 'add_to_dashboard' )"><img src="../images/add_to_dashboard.png" alt="$i18n.getString( 'add_to_dashboard' )"></a></td>
+ <td style="text-align:center"><a href="javascript:removeReport( '$encoder.htmlEncode( $report.id )' )" title="$i18n.getString( 'remove_report' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove_report' )"></a></td>
</tr>
- #if( $mark )
- #set( $mark = false )
- #else
- #set( $mark = true )
- #end
#end
+ </tbody>
</table>
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewTableForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewTableForm.vm 2009-11-16 10:32:46 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewTableForm.vm 2010-02-10 19:12:22 +0000
@@ -28,26 +28,22 @@
<th>$i18n.getString( "name" )</th>
<th colspan="9">$i18n.getString( "operations" )</th>
</tr>
- #set( $mark = false )
+ <tbody id="list">
#foreach ( $table in $tables )
- <tr>
- <td#alternate( $mark )>$encoder.htmlEncode( $table.name )</td>
- <td style="text-align:center"#alternate( $mark )><a href="getReportParams.action?id=$table.id&mode=table" title="$i18n.getString( "create" )"><img src="../images/start_process.png" alt="$i18n.getString( "create" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="displayAddTableForm.action?id=$table.id&mode=$table.mode&dimension=$table.isDimensional()" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="displayTable.action?id=$table.id" title="$i18n.getString( "display" )"><img src="../images/display.png" alt="$i18n.getString( "display" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="generateTableDataWorkbook.action?id=$table.id" title="$i18n.getString( "export_to_excel" )"><img src="../images/excel.png" alt="$i18n.getString( "export_to_excel" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="getTableData.action?id=$table.id" title="$i18n.getString( "export_to_html" )"><img src="../images/html.png" alt="$i18n.getString( "export_to_html" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="getTableDataExport.action?id=$table.id&exportFormat=CSV" title="$i18n.getString( "export_to_csv" )"><img src="../images/csv.png" alt="$i18n.getString( "export_to_csv" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:addReportTableToDashboard( '$table.id' )" title="$i18n.getString( 'add_to_dashboard' )"><img src="../images/add_to_dashboard.png" alt="$i18n.getString( 'add_to_dashboard' )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:removeTable( $table.id, '$encoder.jsEncode( $table.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:showTableDetails( $table.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
+ <tr id="tr${table.id}">
+ <td>$encoder.htmlEncode( $table.name )</td>
+ <td style="text-align:center"><a href="getReportParams.action?id=$table.id&mode=table" title="$i18n.getString( "create" )"><img src="../images/start_process.png" alt="$i18n.getString( "create" )"></a></td>
+ <td style="text-align:center"><a href="displayAddTableForm.action?id=$table.id&mode=$table.mode&dimension=$table.isDimensional()" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+ <td style="text-align:center"><a href="displayTable.action?id=$table.id" title="$i18n.getString( "display" )"><img src="../images/display.png" alt="$i18n.getString( "display" )"></a></td>
+ <td style="text-align:center"><a href="generateTableDataWorkbook.action?id=$table.id" title="$i18n.getString( "export_to_excel" )"><img src="../images/excel.png" alt="$i18n.getString( "export_to_excel" )"></a></td>
+ <td style="text-align:center"><a href="getTableData.action?id=$table.id" title="$i18n.getString( "export_to_html" )"><img src="../images/html.png" alt="$i18n.getString( "export_to_html" )"></a></td>
+ <td style="text-align:center"><a href="getTableDataExport.action?id=$table.id&exportFormat=CSV" title="$i18n.getString( "export_to_csv" )"><img src="../images/csv.png" alt="$i18n.getString( "export_to_csv" )"></a></td>
+ <td style="text-align:center"><a href="javascript:addReportTableToDashboard( '$table.id' )" title="$i18n.getString( 'add_to_dashboard' )"><img src="../images/add_to_dashboard.png" alt="$i18n.getString( 'add_to_dashboard' )"></a></td>
+ <td style="text-align:center"><a href="javascript:removeTable( $table.id, '$encoder.jsEncode( $table.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
+ <td style="text-align:center"><a href="javascript:showTableDetails( $table.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
</tr>
- #if( $mark )
- #set( $mark = false )
- #else
- #set( $mark = true )
- #end
#end
+ </tbody>
</table>
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/RemoveValidationRuleGroupAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/RemoveValidationRuleGroupAction.java 2009-08-20 08:17:49 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/RemoveValidationRuleGroupAction.java 2010-02-10 19:12:22 +0000
@@ -69,10 +69,7 @@
{
ValidationRuleGroup group = validationRuleService.getValidationRuleGroup( id );
- if ( group != null )
- {
- validationRuleService.deleteValidationRuleGroup( group );
- }
+ validationRuleService.deleteValidationRuleGroup( group );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml 2010-02-09 09:10:29 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml 2010-02-10 19:12:22 +0000
@@ -45,7 +45,7 @@
</action>
<action name="removeValidationRule" class="org.hisp.dhis.validationrule.action.RemoveValidationRuleAction">
- <result name="success" type="redirect">showValidationRuleForm.action</result>
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<param name="requiredAuthorities">F_VALIDATIONRULE_DELETE</param>
</action>
@@ -107,7 +107,7 @@
</action>
<action name="removeValidationRuleGroup" class="org.hisp.dhis.validationrule.action.validationrulegroup.RemoveValidationRuleGroupAction">
- <result name="success" type="redirect">showValidationRuleGroupForm.action</result>
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<param name="requiredAuthorities">F_VALIDATIONRULEGROUP_DELETE</param>
</action>
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/general.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/general.js 2009-09-05 09:34:43 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/general.js 2010-02-10 19:12:22 +0000
@@ -71,10 +71,5 @@
function removeValidationRule( ruleId, ruleName )
{
- var result = window.confirm( i18n_confirm_delete + '\n\n' + ruleName );
-
- if ( result )
- {
- window.location.href = 'removeValidationRule.action?id=' + ruleId;
- }
+ removeItem( ruleId, ruleName, i18n_confirm_delete, 'removeValidationRule.action' );
}
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRuleGroup.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRuleGroup.js 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRuleGroup.js 2010-02-10 19:12:22 +0000
@@ -26,12 +26,7 @@
function removeValidationRuleGroup( validationRuleGroupId, validationRuleGroupName )
{
- var result = window.confirm( i18n_confirm_delete + '\n\n' + validationRuleGroupName );
-
- if ( result )
- {
- window.location.href = 'removeValidationRuleGroup.action?id=' + validationRuleGroupId;
- }
+ removeItem( validationRuleGroupId, validationRuleGroupName, i18n_confirm_delete, 'removeValidationRuleGroup.action' );
}
// -----------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/searchResult.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/searchResult.vm 2010-01-29 15:51:59 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/searchResult.vm 2010-02-10 19:12:22 +0000
@@ -19,22 +19,21 @@
<th style="text-align:center">$i18n.getString( "max" )</th>
<th style="text-align:center">$i18n.getString( "mark" )</th>
</tr>
- #set( $mark = false )
#set( $count = 0 )
+ <tbody id="list">
#foreach( $value in $dataValues )
#set( $count = $count + 1 )
- <tr #if( $mark == 0 ) style="background-color:#dddddd" #end>
-
- <td#alternate( $mark )><span id="value[$count].name">$value.dataElementName $value.categoryOptionComboNameParsed</span></td>
-
- <td#alternate( $mark )>$value.sourceName</td>
-
- <td#alternate( $mark )>$format.formatPeriod( $value.period )</td>
-
- <td style="text-align:center"#alternate( $mark )>$value.min</td>
-
- <td style="width:100px"#alternate( $mark )>
+ <tr>
+ <td><span id="value[$count].name">$value.dataElementName $value.categoryOptionComboNameParsed</span></td>
+
+ <td>$value.sourceName</td>
+
+ <td>$format.formatPeriod( $value.period )</td>
+
+ <td style="text-align:center">$value.min</td>
+
+ <td style="width:100px">
<input id="value[$count].value" value="$value.value"
style="width: 95%; text-align: center;" tabindex="$count" type="text" onchange="editValue( $count )">
<input type="hidden" id="value[$count].dataElement" value="$value.dataElementId">
@@ -45,23 +44,18 @@
<input type="hidden" id="value[$count].max" value="$value.max">
</td>
- <td style="text-align:center"#alternate( $mark )>$value.max</td>
+ <td style="text-align:center">$value.max</td>
- <td style="text-align:center"#alternate( $mark )>
+ <td style="text-align:center">
#if ( $value.followup )
<img id="value[$count].followup" src="../images/marked.png" onclick="markValueForFollowup($count)" style="cursor:pointer">
#else
<img id="value[$count].followup" src="../images/unmarked.png" onclick="markValueForFollowup($count)" style="cursor:pointer">
#end
- </td>
-
+ </td>
</tr>
- #if( $mark )
- #set( $mark = false )
- #else
- #set( $mark = true )
- #end
#end
+ </tbody>
</table>
#end
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRule.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRule.vm 2009-11-12 17:59:58 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRule.vm 2010-02-10 19:12:22 +0000
@@ -18,19 +18,13 @@
<th colspan="3">$i18n.getString( "operations" )</th>
</tr>
<tbody id="list">
- #set( $mark = false )
#foreach( $validationRule in $validationRulesList )
- <tr>
- <td#alternate( $mark )>$!encoder.htmlEncode( $validationRule.name )</td>
- <td style="text-align:center"#alternate( $mark )><a href="showUpdateValidationRuleForm.action?id=$validationRule.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:removeValidationRule( $validationRule.id, '$encoder.jsEncode( $validationRule.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:showValidationRuleDetails( $validationRule.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
+ <tr id="tr${validationRule.id}">
+ <td>$!encoder.htmlEncode( $validationRule.name )</td>
+ <td style="text-align:center"><a href="showUpdateValidationRuleForm.action?id=$validationRule.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+ <td style="text-align:center"><a href="javascript:removeValidationRule( $validationRule.id, '$encoder.jsEncode( $validationRule.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
+ <td style="text-align:center"><a href="javascript:showValidationRuleDetails( $validationRule.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
</tr>
- #if( $mark )
- #set( $mark = false )
- #else
- #set( $mark = true )
- #end
#end
</tbody>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRuleGroup.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRuleGroup.vm 2009-11-12 17:59:58 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRuleGroup.vm 2010-02-10 19:12:22 +0000
@@ -18,19 +18,13 @@
<th colspan="3">$i18n.getString( "operations" )</th>
</tr>
<tbody id="list">
- #set( $mark = false )
#foreach( $group in $validationRuleGroups )
- <tr>
- <td#alternate( $mark )>$!encoder.htmlEncode( $group.name )</td>
- <td style="text-align:center"#alternate( $mark )><a href="showUpdateValidationRuleGroupForm.action?id=$group.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:removeValidationRuleGroup( $group.id, '$encoder.jsEncode( $group.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
- <td style="text-align:center"#alternate( $mark )><a href="javascript:showValidationRuleGroupDetails( $group.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
+ <tr id="tr${group.id}">
+ <td>$!encoder.htmlEncode( $group.name )</td>
+ <td style="text-align:center"><a href="showUpdateValidationRuleGroupForm.action?id=$group.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+ <td style="text-align:center"><a href="javascript:removeValidationRuleGroup( $group.id, '$encoder.jsEncode( $group.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
+ <td style="text-align:center"><a href="javascript:showValidationRuleGroupDetails( $group.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>
</tr>
- #if( $mark )
- #set( $mark = false )
- #else
- #set( $mark = true )
- #end
#end
</tbody>
</table>