dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25416
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12608: Validationrule group, renamed variable selectedUserRolesToAlert to userRolesToAlert
------------------------------------------------------------
revno: 12608
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2013-10-13 20:20:54 +0200
message:
Validationrule group, renamed variable selectedUserRolesToAlert to userRolesToAlert
modified:
dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/AddValidationRuleGroupAction.java
dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/ShowUpdateValidationRuleGroupFormAction.java
dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/UpdateValidationRuleGroupAction.java
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleGroupForm.vm
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleGroupForm.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-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/AddValidationRuleGroupAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/AddValidationRuleGroupAction.java 2013-09-27 17:05:36 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/AddValidationRuleGroupAction.java 2013-10-13 18:20:54 +0000
@@ -28,7 +28,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.util.Collection;
+import java.util.Set;
import org.hisp.dhis.user.UserService;
import org.hisp.dhis.validation.ValidationRuleGroup;
@@ -79,20 +79,20 @@
this.description = description;
}
- private Collection<String> groupMembers;
+ private Set<String> groupMembers;
- public void setGroupMembers( Collection<String> groupMembers )
+ public void setGroupMembers( Set<String> groupMembers )
{
this.groupMembers = groupMembers;
}
- private Collection<String> selectedUserRolesToAlert;
+ private Set<String> userRolesToAlert;
+
+ public void setUserRolesToAlert( Set<String> userRolesToAlert )
+ {
+ this.userRolesToAlert = userRolesToAlert;
+ }
- public void setSelectedUserRolesToAlert( Collection<String> selectedUserRolesToAlert )
- {
- this.selectedUserRolesToAlert = selectedUserRolesToAlert;
- }
-
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -113,9 +113,9 @@
}
group.getUserAuthorityGroupsToAlert().clear();
- if ( selectedUserRolesToAlert != null )
+ if ( userRolesToAlert != null )
{
- for ( String id : selectedUserRolesToAlert )
+ for ( String id : userRolesToAlert )
{
group.getUserAuthorityGroupsToAlert().add( userService.getUserAuthorityGroup( Integer.valueOf( id ) ) );
}
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/ShowUpdateValidationRuleGroupFormAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/ShowUpdateValidationRuleGroupFormAction.java 2013-10-08 19:10:40 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/ShowUpdateValidationRuleGroupFormAction.java 2013-10-13 18:20:54 +0000
@@ -90,6 +90,13 @@
return validationRuleGroup;
}
+ private List<ValidationRule> availableValidationRules = new ArrayList<ValidationRule>();
+
+ public List<ValidationRule> getAvailableValidationRules()
+ {
+ return availableValidationRules;
+ }
+
private List<ValidationRule> groupMembers = new ArrayList<ValidationRule>();
public List<ValidationRule> getGroupMembers()
@@ -97,13 +104,6 @@
return groupMembers;
}
- private List<ValidationRule> availableValidationRules = new ArrayList<ValidationRule>();
-
- public List<ValidationRule> getAvailableValidationRules()
- {
- return availableValidationRules;
- }
-
private List<UserAuthorityGroup> availableUserRolesToAlert = new ArrayList<UserAuthorityGroup>();
public List<UserAuthorityGroup> getAvailableUserRolesToAlert()
@@ -111,11 +111,11 @@
return availableUserRolesToAlert;
}
- private List<UserAuthorityGroup> selectedUserRolesToAlert = new ArrayList<UserAuthorityGroup>();
-
- public List<UserAuthorityGroup> getSelectedUserRolesToAlert()
+ private List<UserAuthorityGroup> userRolesToAlert = new ArrayList<UserAuthorityGroup>();
+
+ public List<UserAuthorityGroup> getUserRolesToAlert()
{
- return selectedUserRolesToAlert;
+ return userRolesToAlert;
}
// -------------------------------------------------------------------------
@@ -124,10 +124,6 @@
public String execute()
{
- // ---------------------------------------------------------------------
- // Get selected group
- // ---------------------------------------------------------------------
-
validationRuleGroup = validationRuleService.getValidationRuleGroup( id, true );
groupMembers = new ArrayList<ValidationRule>( validationRuleGroup.getMembers() );
@@ -136,11 +132,10 @@
availableUserRolesToAlert = new ArrayList<UserAuthorityGroup>( userService.getAllUserAuthorityGroups() );
- selectedUserRolesToAlert = new ArrayList<UserAuthorityGroup>( validationRuleGroup.getUserAuthorityGroupsToAlert() );
+ userRolesToAlert = new ArrayList<UserAuthorityGroup>( validationRuleGroup.getUserAuthorityGroupsToAlert() );
- Collections.sort( selectedUserRolesToAlert, IdentifiableObjectNameComparator.INSTANCE );
+ Collections.sort( userRolesToAlert, IdentifiableObjectNameComparator.INSTANCE );
return SUCCESS;
}
-
}
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/UpdateValidationRuleGroupAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/UpdateValidationRuleGroupAction.java 2013-10-08 19:10:40 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/validationrulegroup/UpdateValidationRuleGroupAction.java 2013-10-13 18:20:54 +0000
@@ -28,7 +28,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.util.Collection;
+import java.util.Set;
import org.hisp.dhis.user.UserService;
import org.hisp.dhis.validation.ValidationRuleGroup;
@@ -86,20 +86,20 @@
this.description = description;
}
- private Collection<String> groupMembers;
+ private Set<String> groupMembers;
- public void setGroupMembers( Collection<String> groupMembers )
+ public void setGroupMembers( Set<String> groupMembers )
{
this.groupMembers = groupMembers;
}
- private Collection<String> selectedUserRolesToAlert;
+ private Set<String> userRolesToAlert;
+
+ public void setUserRolesToAlert( Set<String> userRolesToAlert )
+ {
+ this.userRolesToAlert = userRolesToAlert;
+ }
- public void setSelectedUserRolesToAlert( Collection<String> selectedUserRolesToAlert )
- {
- this.selectedUserRolesToAlert = selectedUserRolesToAlert;
- }
-
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -122,9 +122,9 @@
group.getUserAuthorityGroupsToAlert().clear();
- if ( selectedUserRolesToAlert != null )
+ if ( userRolesToAlert != null )
{
- for ( String id : selectedUserRolesToAlert )
+ for ( String id : userRolesToAlert )
{
group.getUserAuthorityGroupsToAlert().add( userService.getUserAuthorityGroup( Integer.valueOf( id ) ) );
}
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleGroupForm.vm 2013-10-08 19:10:40 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleGroupForm.vm 2013-10-13 18:20:54 +0000
@@ -15,7 +15,7 @@
jQuery("#availableUserRolesToAlert").dhisAjaxSelect({
source: "../dhis-web-commons-ajax-json/getUserRoles.action",
iterator: "userRoles",
- connectedTo: 'selectedUserRolesToAlert',
+ connectedTo: 'userRolesToAlert',
handler: function(item) {
var option = jQuery("<option />");
option.text( item.name );
@@ -88,13 +88,13 @@
<td style="text-align:center">
<input type="button" value=">" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'availableUserRolesToAlert' );"/><br/>
- <input type="button" value="<" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'selectedUserRolesToAlert' );"/><br/>
+ <input type="button" value="<" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'userRolesToAlert' );"/><br/>
<input type="button" value=">>" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableUserRolesToAlert' );"/><br/>
- <input type="button" value="<<" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'selectedUserRolesToAlert' );"/>
+ <input type="button" value="<<" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'userRolesToAlert' );"/>
</td>
<td>
- <select id="selectedUserRolesToAlert" name="selectedUserRolesToAlert" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px" />
+ <select id="userRolesToAlert" name="userRolesToAlert" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px" />
</td>
</tr>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleGroupForm.vm 2013-10-08 19:10:40 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleGroupForm.vm 2013-10-13 18:20:54 +0000
@@ -15,7 +15,7 @@
jQuery("#availableUserRolesToAlert").dhisAjaxSelect({
source: "../dhis-web-commons-ajax-json/getUserRoles.action",
iterator: "userRoles",
- connectedTo: 'selectedUserRolesToAlert',
+ connectedTo: 'userRolesToAlert',
handler: function(item) {
var option = jQuery("<option />");
option.text( item.name );
@@ -97,14 +97,14 @@
<td style="text-align:center">
<input type="button" value=">" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'availableUserRolesToAlert' );"/><br/>
- <input type="button" value="<" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'selectedUserRolesToAlert' );"/><br/>
+ <input type="button" value="<" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'userRolesToAlert' );"/><br/>
<input type="button" value=">>" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableUserRolesToAlert' );"/><br/>
- <input type="button" value="<<" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'selectedUserRolesToAlert' );"/>
+ <input type="button" value="<<" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'userRolesToAlert' );"/>
</td>
<td>
- <select id="selectedUserRolesToAlert" name="selectedUserRolesToAlert" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px" />
- #foreach( $userRole in $selectedUserRolesToAlert )
+ <select id="userRolesToAlert" name="userRolesToAlert" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px" />
+ #foreach( $userRole in $userRolesToAlert )
<option value="$userRole.id">$encoder.htmlEncode( $userRole.displayName )</option>
#end
</select>