← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2367: Added new fields which are presenting at the contact information in OrganisationUnit.

 

------------------------------------------------------------
revno: 2367
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2010-12-14 10:56:00 +0700
message:
  Added new fields which are presenting at the contact information in OrganisationUnit.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_vi_VN.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.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/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2010-12-12 13:35:21 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2010-12-14 03:56:00 +0000
@@ -81,6 +81,14 @@
     
     private transient int level;
     
+    private String contactPerson;
+    
+    private String address;
+    
+    private String email;
+    
+    private String phoneNumber;
+    
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------
@@ -489,4 +497,45 @@
     {
         this.level = level;
     }
+
+    public String getContactPerson()
+    {
+        return contactPerson;
+    }
+
+    public void setContactPerson( String contactPerson )
+    {
+        this.contactPerson = contactPerson;
+    }
+
+    public String getAddress()
+    {
+        return address;
+    }
+
+    public void setAddress( String address )
+    {
+        this.address = address;
+    }
+
+    public String getEmail()
+    {
+        return email;
+    }
+
+    public void setEmail( String email )
+    {
+        this.email = email;
+    }
+
+    public String getPhoneNumber()
+    {
+        return phoneNumber;
+    }
+
+    public void setPhoneNumber( String phoneNumber )
+    {
+        this.phoneNumber = phoneNumber;
+    }
+    
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml	2010-08-27 10:58:42 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml	2010-12-14 03:56:00 +0000
@@ -55,6 +55,16 @@
       <key column="organisationunitid"/>
       <many-to-many class="org.hisp.dhis.organisationunit.OrganisationUnitGroup" column="orgunitgroupid"/>
     </set>
-    
+	
+	<!-- Contact info -->
+	
+	<property name="contactPerson" length="255"/>
+	
+	<property name="address" length="255"/>
+	
+	<property name="email" length="150"/>
+	
+	<property name="phoneNumber" length="150"/>
+	
   </joined-subclass>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2010-12-09 06:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2010-12-14 03:56:00 +0000
@@ -302,6 +302,12 @@
 help_intro          = Welcome to the DHIS 2 Help Center. Please select an item from the menu to the left.
 please_wait_while_the_system_is_processing = Please wait while the system is processing
 
+#-- Contact info ----------------------------------------------------------------------#
+
+address             = Address
+contact_details     = Contact information
+contact_person      = Contact person
+
 #-- Form validation messages  ----------------------------------------------------------------------#
 
 this_field_is_required	=	This field is required.

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_vi_VN.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_vi_VN.properties	2010-12-09 06:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global_vi_VN.properties	2010-12-14 03:56:00 +0000
@@ -259,13 +259,19 @@
 retype_password		= X\u00e1c nh\u1eadn m\u1eadt kh\u1ea9u
 surname 			= H\u1ecd
 first_name 			= T\u00ean
-email 				= E-mail
+email 				= Th\u01b0 \u0111i\u1ec7n t\u1eed
 phone_number 		= \u0110i\u1ec7n tho\u1ea1i li\u00ean l\u1ea1c
 save 				= L\u01b0u 
 cancel				= H\u1ee7y
 password_not_match  = X\u00e1c nh\u1eadn m\u1eadt kh\u1ea9u kh\u00f4ng \u0111\u00fang
 update_user_success	= Th\u00f4ng tin c\u1ee7a b\u1ea1n \u0111\u00e3 \u0111\u01b0\u1ee3c th\u00e2y \u0111\u1ed5i
 
+#-- Contact info ----------------------------------------------------------------------#
+
+address             = \u0110\u1ecba ch\u1ec9
+contact_details     = Th\u00f4ng tin li\u00ean h\u1ec7
+contact_person      = Ng\u01b0\u1eddi li\u00ean h\u1ec7
+
 #-- Form validation messages  ----------------------------------------------------------------------#
 
 this_field_is_required	       =	Tr\u01b0\u1eddng n\u00e0y ph\u1ea3i nh\u1eadp

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java	2010-09-22 06:44:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java	2010-12-14 03:56:00 +0000
@@ -40,7 +40,8 @@
 
 /**
  * @author Torgeir Lorange Ostby
- * @version $Id: AddOrganisationUnitAction.java 1898 2006-09-22 12:06:56Z torgeilo $
+ * @version $Id: AddOrganisationUnitAction.java 1898 2006-09-22 12:06:56Z
+ *          torgeilo $
  */
 public class AddOrganisationUnitAction
     extends ActionSupport
@@ -95,23 +96,22 @@
         this.code = code;
     }
 
-
     private String openingDate;
 
     public void setOpeningDate( String openingDate )
     {
         this.openingDate = openingDate;
     }
-    
+
     private String comment;
 
     public void setComment( String comment )
     {
         this.comment = comment;
     }
-    
+
     private String coordinates;
-    
+
     public void setCoordinates( String coordinates )
     {
         this.coordinates = coordinates;
@@ -124,6 +124,34 @@
         this.url = url;
     }
 
+    private String contactPerson;
+
+    public void setContactPerson( String contactPerson )
+    {
+        this.contactPerson = contactPerson;
+    }
+
+    private String address;
+
+    public void setAddress( String address )
+    {
+        this.address = address;
+    }
+
+    private String email;
+
+    public void setEmail( String email )
+    {
+        this.email = email;
+    }
+
+    private String phoneNumber;
+
+    public void setPhoneNumber( String phoneNumber )
+    {
+        this.phoneNumber = phoneNumber;
+    }
+
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
@@ -146,6 +174,11 @@
         comment = nullIfEmpty( comment );
         coordinates = nullIfEmpty( coordinates );
         url = nullIfEmpty( url );
+        
+        contactPerson = nullIfEmpty( contactPerson );
+        address = nullIfEmpty( address );
+        email = nullIfEmpty( email );
+        phoneNumber = nullIfEmpty( phoneNumber );
 
         Date date = format.parseDate( openingDate );
 
@@ -169,15 +202,19 @@
         // Create organisation unit
         // ---------------------------------------------------------------------
 
-        OrganisationUnit organisationUnit = new OrganisationUnit( name, shortName, 
-            code, date, null, true, comment );
-        
+        OrganisationUnit organisationUnit = new OrganisationUnit( name, shortName, code, date, null, true, comment );
+
         organisationUnit.setCoordinates( coordinates );
         organisationUnit.setUrl( url );
         organisationUnit.setParent( parent );
+        organisationUnit.setContactPerson( contactPerson );
+        organisationUnit.setAddress( address );
+        organisationUnit.setEmail( email );
+        organisationUnit.setPhoneNumber( phoneNumber );
 
         organisationUnitId = organisationUnitService.addOrganisationUnit( organisationUnit );
 
         return SUCCESS;
     }
+
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java	2010-05-26 09:57:16 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java	2010-12-14 03:56:00 +0000
@@ -135,6 +135,34 @@
     {
         this.url = url;
     }
+    
+    private String contactPerson;
+
+    public void setContactPerson( String contactPerson )
+    {
+        this.contactPerson = contactPerson;
+    }
+
+    private String address;
+
+    public void setAddress( String address )
+    {
+        this.address = address;
+    }
+
+    private String email;
+
+    public void setEmail( String email )
+    {
+        this.email = email;
+    }
+
+    private String phoneNumber;
+
+    public void setPhoneNumber( String phoneNumber )
+    {
+        this.phoneNumber = phoneNumber;
+    }
 
     // -------------------------------------------------------------------------
     // Action implementation
@@ -147,6 +175,11 @@
         comment = nullIfEmpty( comment );
         coordinates = nullIfEmpty( coordinates );
         url = nullIfEmpty( url );
+        
+        contactPerson = nullIfEmpty( contactPerson );
+        address = nullIfEmpty( address );
+        email = nullIfEmpty( email );
+        phoneNumber = nullIfEmpty( phoneNumber );
 
         Date oDate = format.parseDate( openingDate );
 
@@ -172,6 +205,10 @@
         organisationUnit.setComment( comment );
         organisationUnit.setCoordinates( coordinates );
         organisationUnit.setUrl( url );
+        organisationUnit.setContactPerson( contactPerson );
+        organisationUnit.setAddress( address );
+        organisationUnit.setEmail( email );
+        organisationUnit.setPhoneNumber( phoneNumber );
 
         organisationUnitService.updateOrganisationUnit( organisationUnit );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm	2010-12-09 22:05:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm	2010-12-14 03:56:00 +0000
@@ -47,6 +47,25 @@
         <td><input type="text" id="url" name="url" style="width:20em" maxlength="255" class="{validate:{url:true}}"/></td>
     </tr>
 	<tr>
+		<th colspan="3">$i18n.getString( "contact_details" )</th>
+	</tr>
+	<tr>
+		<td><label for="contactPerson">$i18n.getString( "contact_person" ) </label></td>
+		<td colspan="3"><input type="text" id="contactPerson" name="contactPerson" style="width:20em" maxlength="255"/></td>
+	</tr>
+	<tr>
+		<td><label for="address">$i18n.getString( "address" ) </label></td>
+		<td colspan="3"><input type="text" id="address" name="address" style="width:20em" maxlength="255"/></td>
+	</tr>
+	<tr>
+		<td><label for="email">$i18n.getString( "email" )</label></td>
+		<td colspan="3"><input type="text" id="email" name="email" style="width:20em" maxlength="150" class="{validate:{email:true}}"/></td>
+	</tr>
+    <tr>
+        <td><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
+        <td colspan="3"><input type="text" id="phoneNumber" name="phoneNumber" style="width:20em" maxlength="150"/></td>
+    </tr>
+	<tr>
 		<td></td>
 		<td><input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/><input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='organisationUnit.action'" style="width:10em"/></td>
 	</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm	2010-12-09 22:05:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm	2010-12-14 03:56:00 +0000
@@ -76,8 +76,27 @@
         <td><input type="text" id="url" name="url" value="$!encoder.htmlEncode( $organisationUnit.url )" style="width:20em" maxlength="255" class="{validate:{maxlength:255,url:true}}"/></td>
     </tr>
 	<tr>
+		<th colspan="3">$i18n.getString( "contact_details" )</th>
+	</tr>
+	<tr>
+		<td><label for="contactPerson">$i18n.getString( "contact_person" ) </label></td>
+		<td colspan="3"><input type="text" id="contactPerson" name="contactPerson" value="$!encoder.htmlEncode( $organisationUnit.contactPerson )" style="width:20em" maxlength="255"/></td>
+	</tr>
+	<tr>
+		<td><label for="address">$i18n.getString( "address" ) </label></td>
+		<td colspan="3"><input type="text" id="address" name="address" value="$!encoder.htmlEncode( $organisationUnit.address )" style="width:20em" maxlength="255"/></td>
+	</tr>
+	<tr>
+		<td><label for="email">$i18n.getString( "email" )</label></td>
+		<td colspan="3"><input type="text" id="email" name="email" value="$!encoder.htmlEncode( $organisationUnit.email )" style="width:20em" maxlength="150" class="{validate:{email:true}}"/></td>
+	</tr>
+    <tr>
+        <td><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
+        <td colspan="3"><input type="text" id="phoneNumber" name="phoneNumber" value="$!encoder.htmlEncode( $organisationUnit.phoneNumber )" style="width:20em" maxlength="150"/></td>
+    </tr>
+	<tr>
 		<td></td>
-		<td><input type="submit" value="$i18n.getString( "save" )" style="width:10em"/><input type="button" value="$i18n.getString( "cancel" )" onclick="window.location.href='organisationUnit.action'" style="width:10em"/></td>
+		<td><input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/><input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='organisationUnit.action'" style="width:10em"/></td>
 	</tr>
 </table>