← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7488: Added jobTitle property to user

 

------------------------------------------------------------
revno: 7488
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-07-02 14:40:50 +0200
message:
  Added jobTitle property to user
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.xml
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramStageDataElementDeletionHandler.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.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-api/src/main/java/org/hisp/dhis/user/User.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2012-07-01 11:33:07 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2012-07-02 12:40:50 +0000
@@ -74,6 +74,8 @@
     private String email;
 
     private String phoneNumber;
+    
+    private String jobTitle;
 
     private Date lastCheckedInterpretations;
     
@@ -310,6 +312,19 @@
     @JsonProperty
     @JsonView( {DetailedView.class, ExportView.class} )
     @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
+    public String getJobTitle()
+    {
+        return jobTitle;
+    }
+
+    public void setJobTitle( String jobTitle )
+    {
+        this.jobTitle = jobTitle;
+    }
+
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
     public String getPhoneNumber()
     {
         return phoneNumber;

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.xml	2012-07-01 11:33:07 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.xml	2012-07-02 12:40:50 +0000
@@ -25,6 +25,8 @@
     <property name="email" length="160" />
 
     <property name="phoneNumber" length="80" />
+	
+	<property name="jobTitle" length="160" />
 
 	<property name="lastCheckedInterpretations" type="timestamp" />
 

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramStageDataElementDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramStageDataElementDeletionHandler.java	2012-07-01 07:12:58 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramStageDataElementDeletionHandler.java	2012-07-02 12:40:50 +0000
@@ -28,6 +28,7 @@
 package org.hisp.dhis.program;
 
 import java.util.Collection;
+import java.util.Iterator;
 import java.util.Set;
 
 import org.hisp.dhis.dataelement.DataElement;
@@ -111,13 +112,15 @@
         {
             // TODO use a query which will be more efficient
 
-            Collection<ProgramStageDataElement> psDataElements = programStageDEService.getAllProgramStageDataElements();
+            Iterator<ProgramStageDataElement> iterator = programStageDEService.getAllProgramStageDataElements().iterator();
             
-            for ( ProgramStageDataElement psDataElement : psDataElements )
+            while ( iterator.hasNext() )
             {
-                if ( psDataElement.getDataElement() != null && psDataElement.getDataElement().equals( dataElement ) )
+                ProgramStageDataElement element = iterator.next();
+                
+                if ( element.getDataElement() != null && element.getDataElement().equals( dataElement ) )
                 {
-                    return dataElement.getName();
+                    programStageDEService.deleteProgramStageDataElement( element );
                 }
             }
         }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserAction.java	2012-07-02 12:40:50 +0000
@@ -144,6 +144,13 @@
         this.phoneNumber = phoneNumber;
     }
 
+    private String jobTitle;
+    
+    public void setJobTitle( String jobTitle )
+    {
+        this.jobTitle = jobTitle;
+    }
+
     private String passwordUnMatched;
 
     public String getPasswordUnMatched()
@@ -202,6 +209,7 @@
         user.setFirstName( firstName );
         user.setEmail( email );
         user.setPhoneNumber( phoneNumber );
+        user.setJobTitle( jobTitle );
         user.updateOrganisationUnits( new HashSet<OrganisationUnit>( orgUnits ) );
 
         UserCredentials userCredentials = new UserCredentials();

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java	2012-06-01 11:35:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java	2012-07-02 12:40:50 +0000
@@ -136,6 +136,13 @@
         this.phoneNumber = phoneNumber;
     }
 
+    private String jobTitle;
+    
+    public void setJobTitle( String jobTitle )
+    {
+        this.jobTitle = jobTitle;
+    }
+
     private Collection<String> selectedList = new ArrayList<String>();
 
     public void setSelectedList( Collection<String> selectedList )
@@ -185,6 +192,7 @@
         user.setFirstName( firstName );
         user.setEmail( email );
         user.setPhoneNumber( phoneNumber );
+        user.setJobTitle( jobTitle );
         user.updateOrganisationUnits( new HashSet<OrganisationUnit>( units ) );
 
         UserCredentials userCredentials = userService.getUserCredentials( user );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties	2012-05-30 07:22:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties	2012-07-02 12:40:50 +0000
@@ -258,3 +258,4 @@
 months=months
 select=Select
 object_not_deleted_associated_by_objects=Object not deleted because it is associated by objects of type
+job_title=Job title
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserForm.vm	2011-09-21 12:46:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserForm.vm	2012-07-02 12:40:50 +0000
@@ -81,7 +81,11 @@
     <tr>
         <td><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
         <td colspan="3"><input type="text" id="phoneNumber" name="phoneNumber" style="width:20em"></td>             
-    </tr>	
+    </tr>
+    <tr>
+    	<td><label for="jobTitle">$i18n.getString( "job_title" )</label></td>
+    	<td colspan="3"><input type="text" id="jobTitle" name="jobTitle" style="width:20em"></td>
+    </tr>
 </table>
 
 #tblDynamicAttributes( { "attributes": $attributes } )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm	2011-09-21 12:46:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm	2012-07-02 12:40:50 +0000
@@ -89,6 +89,10 @@
         <td><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
         <td colspan="3"><input type="text" id="phoneNumber" name="phoneNumber" value="$!encoder.htmlEncode( $userCredentials.user.phoneNumber )" style="width:20em"/></td> 
     </tr>
+    <tr>
+    	<td><label for="jobTitle">$i18n.getString( "job_title" )</label></td>
+    	<td colspan="3"><input type="text" id="jobTitle" name="jobTitle" value="$!encoder.htmlEncode( $userCredentials.user.jobTitle )" style="width:20em"></td>
+    </tr>
 </table>
 
 #tblDynamicAttributes( { "attributes": $attributes, "attributeValues": $attributeValues } )