=== 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 2013-10-28 15:49:09 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/general.js 2013-12-06 13:37:28 +0000 @@ -1,6 +1,11 @@ -function showValidationRuleDetails( validationId ) + +function showUpdateValidationRuleForm( context ) { + location.href = 'showUpdateValidationRuleForm.action?id=' + context.id; +} + +function showValidationRuleDetails( context ) { - jQuery.post( 'getValidationRule.action', { id: validationId }, function ( json ) { + jQuery.post( 'getValidationRule.action', { id: context.id }, function ( json ) { setText( 'nameField', json.validationRule.name ); var description = json.validationRule.description; @@ -123,7 +128,6 @@ return null; } -function removeValidationRule( ruleId, ruleName ) -{ - removeItem( ruleId, ruleName, i18n_confirm_delete, 'removeValidationRule.action' ); +function removeValidationRule( context ) { + removeItem( context.id, context.name, i18n_confirm_delete, 'removeValidationRule.action' ); } === modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRule.js' --- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRule.js 2013-10-28 15:49:09 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRule.js 2013-12-06 13:37:28 +0000 @@ -1,31 +1,27 @@ -function changeRuleType() -{ - var ruleType = $( '#ruleType' ).val(); - - if ( ruleType == 'validation' ) - { - hideById( 'organisationUnitLevelTR' ); - hideById( 'sequentialSampleCountTR' ); - hideById( 'annualSampleCountTR' ); - hideById( 'highOutliersTR' ); - hideById( 'lowOutliersTR' ); - - showById( 'compulsory_pair' ); - } - else - { - showById( 'organisationUnitLevelTR' ); - showById( 'sequentialSampleCountTR' ); - showById( 'annualSampleCountTR' ); - showById( 'highOutliersTR' ); - showById( 'lowOutliersTR' ); - - var op = document.getElementById( 'operator' ); - if ( 'compulsory_pair' == op.value ) - { - showById( 'select_operator' ); - op.selectedIndex = 0; - } - hideById( 'compulsory_pair' ); +function changeRuleType() { + var ruleType = $('#ruleType').val(); + + if( ruleType == 'validation' ) { + hideById('organisationUnitLevelTR'); + hideById('sequentialSampleCountTR'); + hideById('annualSampleCountTR'); + hideById('highOutliersTR'); + hideById('lowOutliersTR'); + + showById('compulsory_pair'); + } + else { + showById('organisationUnitLevelTR'); + showById('sequentialSampleCountTR'); + showById('annualSampleCountTR'); + showById('highOutliersTR'); + showById('lowOutliersTR'); + + var op = document.getElementById('operator'); + if( 'compulsory_pair' == op.value ) { + showById('select_operator'); + op.selectedIndex = 0; } + hideById('compulsory_pair'); + } } === 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 2013-10-13 18:35:46 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRuleGroup.js 2013-12-06 13:37:28 +0000 @@ -1,201 +1,179 @@ + +function showUpdateValidationRuleGroupForm( context ) { + location.href = 'showUpdateValidationRuleGroupForm.action?id=' + context.id; +} + // ----------------------------------------------------------------------------- // View details // ----------------------------------------------------------------------------- -function showValidationRuleGroupDetails( id ) -{ - jQuery.post( 'getValidationRuleGroup.action', { 'id': id }, function ( json ) { - setInnerHTML( 'nameField', json.validationRuleGroup.name ); - setInnerHTML( 'descriptionField', json.validationRuleGroup.description ); - setInnerHTML( 'memberCountField', json.validationRuleGroup.memberCount ); - setInnerHTML( 'userRolesToAlertCountField', json.validationRuleGroup.userRolesToAlertCount ); +function showValidationRuleGroupDetails( context ) { + jQuery.post('getValidationRuleGroup.action', { 'id': context.id }, function( json ) { + setInnerHTML('nameField', json.validationRuleGroup.name); + setInnerHTML('descriptionField', json.validationRuleGroup.description); + setInnerHTML('memberCountField', json.validationRuleGroup.memberCount); + setInnerHTML('userRolesToAlertCountField', json.validationRuleGroup.userRolesToAlertCount); - showDetails(); - }); + showDetails(); + }); } // ----------------------------------------------------------------------------- // Remove data element group // ----------------------------------------------------------------------------- -function removeValidationRuleGroup( validationRuleGroupId, validationRuleGroupName ) -{ - removeItem( validationRuleGroupId, validationRuleGroupName, i18n_confirm_delete, 'removeValidationRuleGroup.action' ); +function removeValidationRuleGroup( context ) { + removeItem(context.id, context.name, i18n_confirm_delete, 'removeValidationRuleGroup.action'); } // ----------------------------------------------------------------------------- // Select lists // ----------------------------------------------------------------------------- -function initLists() -{ - for ( var id in groupMembers ) - { - $( "#groupMembers" ).append( $( "" ).attr( "value", id ).text( groupMembers[id] ) ); - } - - for ( var id in availableValidationRules ) - { - $( "#availableValidationRules" ).append( - $( "" ).attr( "value", id ).text( availableValidationRules[id] ) ); - } - - for ( var id in availableUserRolesToAlert ) - { - $( "#availableUserRolesToAlert" ).append( $( "" ).attr( "value", id ).text( availableUserRolesToAlert[id] ) ); - } - - for ( var id in selectedUserRolesToAlert ) - { - $( "#availableValidationRules" ).append( - $( "" ).attr( "value", id ).text( selectedUserRolesToAlert[id] ) ); - } -} - -function filterGroupMembers() -{ - var filter = document.getElementById( 'groupMembersFilter' ).value; - var list = document.getElementById( 'groupMembers' ); - - list.options.length = 0; - - for ( var id in groupMembers ) - { - var value = groupMembers[id]; - - if ( value.toLowerCase().indexOf( filter.toLowerCase() ) != -1 ) - { - list.add( new Option( value, id ), null ); - } - } -} - -function filterAvailableValidationRules() -{ - var filter = document.getElementById( 'availableValidationRulesFilter' ).value; - var list = document.getElementById( 'availableValidationRules' ); - - list.options.length = 0; - - for ( var id in availableValidationRules ) - { - var value = availableValidationRules[id]; - - if ( value.toLowerCase().indexOf( filter.toLowerCase() ) != -1 ) - { - list.add( new Option( value, id ), null ); - } - } -} - -function addGroupMembers() -{ - var list = document.getElementById( 'availableValidationRules' ); - - while ( list.selectedIndex != -1 ) - { - var id = list.options[list.selectedIndex].value; - - list.options[list.selectedIndex].selected = false; - - groupMembers[id] = availableValidationRules[id]; - - delete availableValidationRules[id]; - } - - filterGroupMembers(); - filterAvailableValidationRules(); -} - -function removeGroupMembers() -{ - var list = document.getElementById( 'groupMembers' ); - - while ( list.selectedIndex != -1 ) - { - var id = list.options[list.selectedIndex].value; - - list.options[list.selectedIndex].selected = false; - - availableValidationRules[id] = groupMembers[id]; - - delete groupMembers[id]; - } - - filterGroupMembers(); - filterAvailableValidationRules(); -} - -function filterAvailableUserRolesToAlert() -{ - var filter = document.getElementById( 'availableUserRolesToAlertFilter' ).value; - var list = document.getElementById( 'availableUserRolesToAlert' ); - - list.options.length = 0; - - for ( var id in availableUserRolesToAlert ) - { - var value = availableUserRolesToAlert[id]; - - if ( value.toLowerCase().indexOf( filter.toLowerCase() ) != -1 ) - { - list.add( new Option( value, id ), null ); - } - } -} - -function filterSelectedUserRolesToAlert() -{ - var filter = document.getElementById( 'selectedUserRolesToAlertFilter' ).value; - var list = document.getElementById( 'selectedUserRolesToAlert' ); - - list.options.length = 0; - - for ( var id in selectedUserRolesToAlert ) - { - var value = selectedUserRolesToAlert[id]; - - if ( value.toLowerCase().indexOf( filter.toLowerCase() ) != -1 ) - { - list.add( new Option( value, id ), null ); - } - } -} - -function addSelectedUserRolesToAlert() -{ - var list = document.getElementById( 'selectedUserRolesToAlert' ); - - while ( list.selectedIndex != -1 ) - { - var id = list.options[list.selectedIndex].value; - - list.options[list.selectedIndex].selected = false; - - selectedUserRolesToAlert[id] = availableUserRolesToAlert[id]; - - delete availableUserRolesToAlert[id]; - } - - filterAvailableUserRolesToAlert(); - filterSelectedUserRolesToAlert(); -} - -function removeSelectedUserRolesToAlert() -{ - var list = document.getElementById( 'selectedUserRolesToAlert' ); - - while ( list.selectedIndex != -1 ) - { - var id = list.options[list.selectedIndex].value; - - list.options[list.selectedIndex].selected = false; - - availableUserRolesToAlert[id] = selectedUserRolesToAlert[id]; - - delete selectedUserRolesToAlert[id]; - } - - filterAvailableUserRolesToAlert(); - filterSelectedUserRolesToAlert(); +function initLists() { + for( var id in groupMembers ) { + $("#groupMembers").append($("").attr("value", id).text(groupMembers[id])); + } + + for( var id in availableValidationRules ) { + $("#availableValidationRules").append( + $("").attr("value", id).text(availableValidationRules[id])); + } + + for( var id in availableUserRolesToAlert ) { + $("#availableUserRolesToAlert").append($("").attr("value", id).text(availableUserRolesToAlert[id])); + } + + for( var id in selectedUserRolesToAlert ) { + $("#availableValidationRules").append( + $("").attr("value", id).text(selectedUserRolesToAlert[id])); + } +} + +function filterGroupMembers() { + var filter = document.getElementById('groupMembersFilter').value; + var list = document.getElementById('groupMembers'); + + list.options.length = 0; + + for( var id in groupMembers ) { + var value = groupMembers[id]; + + if( value.toLowerCase().indexOf(filter.toLowerCase()) != -1 ) { + list.add(new Option(value, id), null); + } + } +} + +function filterAvailableValidationRules() { + var filter = document.getElementById('availableValidationRulesFilter').value; + var list = document.getElementById('availableValidationRules'); + + list.options.length = 0; + + for( var id in availableValidationRules ) { + var value = availableValidationRules[id]; + + if( value.toLowerCase().indexOf(filter.toLowerCase()) != -1 ) { + list.add(new Option(value, id), null); + } + } +} + +function addGroupMembers() { + var list = document.getElementById('availableValidationRules'); + + while( list.selectedIndex != -1 ) { + var id = list.options[list.selectedIndex].value; + + list.options[list.selectedIndex].selected = false; + + groupMembers[id] = availableValidationRules[id]; + + delete availableValidationRules[id]; + } + + filterGroupMembers(); + filterAvailableValidationRules(); +} + +function removeGroupMembers() { + var list = document.getElementById('groupMembers'); + + while( list.selectedIndex != -1 ) { + var id = list.options[list.selectedIndex].value; + + list.options[list.selectedIndex].selected = false; + + availableValidationRules[id] = groupMembers[id]; + + delete groupMembers[id]; + } + + filterGroupMembers(); + filterAvailableValidationRules(); +} + +function filterAvailableUserRolesToAlert() { + var filter = document.getElementById('availableUserRolesToAlertFilter').value; + var list = document.getElementById('availableUserRolesToAlert'); + + list.options.length = 0; + + for( var id in availableUserRolesToAlert ) { + var value = availableUserRolesToAlert[id]; + + if( value.toLowerCase().indexOf(filter.toLowerCase()) != -1 ) { + list.add(new Option(value, id), null); + } + } +} + +function filterSelectedUserRolesToAlert() { + var filter = document.getElementById('selectedUserRolesToAlertFilter').value; + var list = document.getElementById('selectedUserRolesToAlert'); + + list.options.length = 0; + + for( var id in selectedUserRolesToAlert ) { + var value = selectedUserRolesToAlert[id]; + + if( value.toLowerCase().indexOf(filter.toLowerCase()) != -1 ) { + list.add(new Option(value, id), null); + } + } +} + +function addSelectedUserRolesToAlert() { + var list = document.getElementById('selectedUserRolesToAlert'); + + while( list.selectedIndex != -1 ) { + var id = list.options[list.selectedIndex].value; + + list.options[list.selectedIndex].selected = false; + + selectedUserRolesToAlert[id] = availableUserRolesToAlert[id]; + + delete availableUserRolesToAlert[id]; + } + + filterAvailableUserRolesToAlert(); + filterSelectedUserRolesToAlert(); +} + +function removeSelectedUserRolesToAlert() { + var list = document.getElementById('selectedUserRolesToAlert'); + + while( list.selectedIndex != -1 ) { + var id = list.options[list.selectedIndex].value; + + list.options[list.selectedIndex].selected = false; + + availableUserRolesToAlert[id] = selectedUserRolesToAlert[id]; + + delete selectedUserRolesToAlert[id]; + } + + filterAvailableUserRolesToAlert(); + filterSelectedUserRolesToAlert(); } === 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 2013-10-28 15:49:09 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRule.vm 2013-12-06 13:37:28 +0000 @@ -1,53 +1,62 @@

$encoder.htmlEncode( $i18n.getString( "validation_rule_management" ) ) #openHelp( "validationRule" )

+
+ +
+ - #foreach( $validationRule in $validationRulesList ) - - - - - + + + + #end
@@ -70,35 +79,28 @@ $encoder.htmlEncode( $i18n.getString("importance") )     $encoder.htmlEncode( $i18n.getString("period_type") )    $encoder.htmlEncode( $i18n.getString( "operations" ) )
$!encoder.htmlEncode( $validationRule.displayName )$encoder.htmlEncode( $i18n.getString($!validationRule.importance) ) $encoder.htmlEncode( $i18n.getString($!validationRule.periodType.name) ) - $i18n.getString( 'edit' ) - $i18n.getString( 'translation_translate' ) - #if( $auth.hasAccess( "dhis-web-validationrule", "removeValidationRule" ) ) - $i18n.getString( 'remove' ) - #else #end - $i18n.getString( 'show_details' ) -
$encoder.htmlEncode( $!validationRule.displayName )$encoder.htmlEncode( $i18n.getString($!validationRule.importance) )$encoder.htmlEncode( $i18n.getString($!validationRule.periodType.name) )

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


@@ -120,7 +122,7 @@

+ - === 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 2013-10-13 18:35:46 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRuleGroup.vm 2013-12-06 13:37:28 +0000 @@ -1,63 +1,69 @@

$encoder.htmlEncode( $i18n.getString( "validation_rule_group_management" ) ) #openHelp( "validationRuleGroup" )

+
+ +
+ - + + +
- - - + + +
#filterDiv( "showValidationRuleGroupForm" )
#filterDiv( "showValidationRuleGroupForm" )
- - - - - - - - - - - #foreach( $group in $validationRuleGroups ) - - - - - #end - -
$i18n.getString( "name" )$i18n.getString( "operations" )
$!encoder.htmlEncode( $group.displayName ) - $i18n.getString( - $i18n.getString( 'translation_translate' ) - #if( $auth.hasAccess( "dhis-web-validationrule", "removeValidationRuleGroup" ) ) - $i18n.getString( - #else #end - $i18n.getString( -
+ + + + + + + + + #foreach( $group in $validationRuleGroups ) + + + + #end + +
$i18n.getString( "name" )
$encoder.htmlEncode( $!group.displayName )

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


-


-


-


-
+
+
+
+ $i18n.getString( +
+


+


+


+


+
@@ -66,6 +72,6 @@

-