dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #08518
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2057: Added Functionality to display Tranferred but not Joine Employees in Manpower Module- Bangladesh
------------------------------------------------------------
revno: 2057
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2010-11-15 13:56:40 +0530
message:
Added Functionality to display Tranferred but not Joine Employees in Manpower Module- Bangladesh
modified:
local/bd/dhis-web-linelisting-bd/src/main/java/org/hisp/dhis/ll/action/NoAction.java
local/bd/dhis-web-linelisting-bd/src/main/webapp/dhis-web-linelisting-bd/welcome.vm
local/bd/dhis-web-linelisting-manpower/src/main/java/org/hisp/dhis/ll/action/NoAction.java
local/bd/dhis-web-linelisting-manpower/src/main/resources/META-INF/dhis/beans.xml
local/bd/dhis-web-linelisting-manpower/src/main/resources/struts.xml
local/bd/dhis-web-linelisting-manpower/src/main/webapp/dhis-web-linelisting-mp/welcome.vm
local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/Employee.java
local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/EmployeeService.java
local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/EmployeeStore.java
local/in/dhis-in-services/dhis-in-service-linelisting/src/main/java/org/hisp/dhis/linelisting/DefaultEmployeeService.java
local/in/dhis-in-services/dhis-in-service-linelisting/src/main/java/org/hisp/dhis/linelisting/hibernate/HiberateEmployeeStore.java
local/in/dhis-in-services/dhis-in-service-linelisting/src/main/resources/org/hisp/dhis/linelisting/hibernate/Employee.hbm.xml
--
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 'local/bd/dhis-web-linelisting-bd/src/main/java/org/hisp/dhis/ll/action/NoAction.java'
--- local/bd/dhis-web-linelisting-bd/src/main/java/org/hisp/dhis/ll/action/NoAction.java 2010-10-20 06:14:25 +0000
+++ local/bd/dhis-web-linelisting-bd/src/main/java/org/hisp/dhis/ll/action/NoAction.java 2010-11-15 08:26:40 +0000
@@ -27,11 +27,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.opensymphony.xwork2.ActionSupport;
+import com.opensymphony.xwork2.Action;
-public class NoAction
- extends ActionSupport
+public class NoAction implements Action
{
+
public String execute()
{
return SUCCESS;
=== modified file 'local/bd/dhis-web-linelisting-bd/src/main/webapp/dhis-web-linelisting-bd/welcome.vm'
--- local/bd/dhis-web-linelisting-bd/src/main/webapp/dhis-web-linelisting-bd/welcome.vm 2010-10-20 06:14:25 +0000
+++ local/bd/dhis-web-linelisting-bd/src/main/webapp/dhis-web-linelisting-bd/welcome.vm 2010-11-15 08:26:40 +0000
@@ -1,2 +1,2 @@
- <font face"Arial" color="blue"><H1>Home Page</H1></font>
\ No newline at end of file
+<font face"Arial" color="blue"><H1>Home Page</H1></font>
\ No newline at end of file
=== modified file 'local/bd/dhis-web-linelisting-manpower/src/main/java/org/hisp/dhis/ll/action/NoAction.java'
--- local/bd/dhis-web-linelisting-manpower/src/main/java/org/hisp/dhis/ll/action/NoAction.java 2010-10-20 06:14:25 +0000
+++ local/bd/dhis-web-linelisting-manpower/src/main/java/org/hisp/dhis/ll/action/NoAction.java 2010-11-15 08:26:40 +0000
@@ -27,13 +27,47 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.opensymphony.xwork2.ActionSupport;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hisp.dhis.linelisting.Employee;
+import org.hisp.dhis.linelisting.EmployeeService;
+
+import com.opensymphony.xwork2.Action;
public class NoAction
- extends ActionSupport
+ implements Action
{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private EmployeeService employeeService;
+
+ public void setEmployeeService( EmployeeService employeeService )
+ {
+ this.employeeService = employeeService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Parameters
+ // -------------------------------------------------------------------------
+
+ private List<Employee> employeeList;
+
+ public List<Employee> getEmployeeList()
+ {
+ return employeeList;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
public String execute()
{
+ employeeList = new ArrayList<Employee>( employeeService.getEmployeeByisTransferred( true ) );
+
return SUCCESS;
}
}
=== modified file 'local/bd/dhis-web-linelisting-manpower/src/main/resources/META-INF/dhis/beans.xml'
--- local/bd/dhis-web-linelisting-manpower/src/main/resources/META-INF/dhis/beans.xml 2010-11-14 14:20:26 +0000
+++ local/bd/dhis-web-linelisting-manpower/src/main/resources/META-INF/dhis/beans.xml 2010-11-15 08:26:40 +0000
@@ -4,6 +4,13 @@
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+ <bean id="org.hisp.dhis.ll.action.NoAction"
+ class="org.hisp.dhis.ll.action.NoAction"
+ scope="prototype">
+ <property name="employeeService" ref="org.hisp.dhis.linelisting.EmployeeService" />
+ </bean>
+
<!-- Line List Option -->
<bean id="org.hisp.dhis.ll.action.llOption.GetLineListOptionListAction"
=== modified file 'local/bd/dhis-web-linelisting-manpower/src/main/resources/struts.xml'
--- local/bd/dhis-web-linelisting-manpower/src/main/resources/struts.xml 2010-11-14 14:20:26 +0000
+++ local/bd/dhis-web-linelisting-manpower/src/main/resources/struts.xml 2010-11-15 08:26:40 +0000
@@ -8,12 +8,13 @@
<package name="dhis-web-linelisting-mp" extends="dhis-web-commons" namespace="/dhis-web-linelisting-mp">
- <action name="index"
- class="">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-linelisting-mp/welcome.vm</param>
- <param name="menu">/dhis-web-linelisting-mp/menu.vm</param>
- </action>
+ <action name="index"
+ class="org.hisp.dhis.ll.action.NoAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-linelisting-mp/welcome.vm</param>
+ <param name="menu">/dhis-web-linelisting-mp/menu.vm</param>
+ <param name="javascripts">javascript/employee.js,javascript/filterTable.js</param>
+ </action>
<!-- LineListOption -->
=== modified file 'local/bd/dhis-web-linelisting-manpower/src/main/webapp/dhis-web-linelisting-mp/welcome.vm'
--- local/bd/dhis-web-linelisting-manpower/src/main/webapp/dhis-web-linelisting-mp/welcome.vm 2010-10-20 06:14:25 +0000
+++ local/bd/dhis-web-linelisting-manpower/src/main/webapp/dhis-web-linelisting-mp/welcome.vm 2010-11-15 08:26:40 +0000
@@ -1,2 +1,65 @@
- <font face"Arial" color="blue"><H1>Home Page</H1></font>
\ No newline at end of file
+<H1><font face"Arial" color="blue">Home Page</font></H1>
+
+<H3><font face"Arial" color="red">List of Employees who got transferred but not yet Joined...</font></H3>
+
+<table class="mainPageTable">
+ <tr>
+ <td style="vertical-align:top">
+ <table class="listTable" id="listTable">
+ <col>
+ <col>
+ <col width="20">
+ <tr>
+ <td>$i18n.getString( "filter_by_name" ) : <form style="display:inline" action="none" onsubmit="return false"><div style="inline"><input type="text" onkeyup="filterValues( this.value )"></div></form></td>
+ <td> </td>
+ <td> </td>
+ </tr>
+ <tr>
+ <th>$i18n.getString( "name" )</th>
+ <th>$i18n.getString( "pdscode" )</th>
+ <th>$i18n.getString( "operations" )</th>
+ </tr>
+ <tbody id="list">
+ #set( $mark = false )
+ #foreach( $employee in $employeeList )
+ <tr id="tr${employee.pdsCode}">
+ <td#alternate( $mark )>$encoder.htmlEncode( $employee.name )</td>
+ <td#alternate( $mark )>$employee.pdsCode</td>
+ <td style="text-align:center"#alternate( $mark )><a href="javascript:showEmployeeDetails( '$employee.pdsCode' )" 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>
+ <td style="width:20em; padding-left:2em; vertical-align:top">
+ <div id="detailsArea" style="display:none">
+ <div style="float:right">
+ <a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/close.png" alt="$i18n.getString( "hide_details" )"></a>
+ </div>
+ <p><label>$i18n.getString( "pdscode" )</label><br><span id="pdsCodeField"></span></p>
+ <p><label>$i18n.getString( "name" )</label><br><span id="nameField"></span></p>
+ <p><label>$i18n.getString( "dob" ):</label><br/><span id="dateOfBirthField"></span></p>
+ <p><label>$i18n.getString( "lprDate" ):</label><br/><span id="lprDateField"></span></p>
+ <p><label>$i18n.getString( "sex" ):</label><br/><span id="sexField"></span></p>
+ <p><label>$i18n.getString( "joinDate" ):</label><br/><span id="joinDateToGovtServiceField"></span></p>
+ <p><label>$i18n.getString( "res_Add" ):</label><br/><span id="resAddressField"></span></p>
+ <p><label>$i18n.getString( "contact_no" ):</label><br/><span id="contactNumberField"></span></p>
+ <p><label>$i18n.getString( "emer_cont_no" ):</label><br/><span id="emergencyContactNumberField"></span></p>
+ </div>
+
+ <div id="warningArea" style="display:none">
+ <div style="float:right">
+ <a href="javascript:hideWarning()" title="$i18n.getString( "hide_warning" )"><img src="../images/close.png" alt="$i18n.getString( "hide_warning" )"></a>
+ </div>
+ <p><span id="warningField"></span></p>
+ </div>
+
+ </td>
+ </tr>
+</table>
=== modified file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/Employee.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/Employee.java 2010-10-28 11:40:15 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/Employee.java 2010-11-15 08:26:40 +0000
@@ -29,84 +29,105 @@
import java.io.Serializable;
import java.util.Date;
-
/**
* @author Mithilesh Kumar Thakur
- *
+ *
* @version Employee.java Oct 15, 2010 1:42:16 PM
*/
public class Employee
{
-
- public static final Integer LPR_PERIOD = 40;
+
+ public static final Integer LPR_PERIOD = 40;
/**
* The unique identifier for Employee
*/
private String pdsCode;
-
+
/**
* Name of the employee, required
*/
private String name;
-
+
/**
* Date of Birth
*/
private Date dateOfBirth;
-
+
/**
* LPR Date
*/
private Date lprDate;
-
+
/**
* Gender
*/
private String sex;
-
+
/**
* Date of Join to Government Service.
*/
private Date joinDateToGovtService;
-
+
/**
* Residential Address
*/
private String resAddress;
-
+
/**
* Mobile Number
*/
private String contactNumber;
-
+
/**
* Emergency Contact Number
*/
private String emergencyContactNumber;
-
+
+ /**
+ * isTransferred
+ */
+ private boolean isTransferred = false;
+
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
public Employee()
- {
- }
-
- public Employee( String pdsCode, String name, Date dateOfBirth, Date lprDate, String sex, Date joinDateToGovtService, String resAddress, String contactNumber, String emergencyContactNumber)
- {
- this.pdsCode = pdsCode;
- this.name = name;
- this.dateOfBirth = dateOfBirth;
- this.lprDate = lprDate;
- this.sex = sex;
- this.joinDateToGovtService = joinDateToGovtService;
- this.resAddress = resAddress;
- this.contactNumber = contactNumber;
- this.emergencyContactNumber = emergencyContactNumber;
- }
-
+ {
+ }
+
+ public Employee( String pdsCode, String name, Date dateOfBirth, Date lprDate, String sex,
+ Date joinDateToGovtService, String resAddress, String contactNumber, String emergencyContactNumber )
+ {
+ this.pdsCode = pdsCode;
+ this.name = name;
+ this.dateOfBirth = dateOfBirth;
+ this.lprDate = lprDate;
+ this.sex = sex;
+ this.joinDateToGovtService = joinDateToGovtService;
+ this.resAddress = resAddress;
+ this.contactNumber = contactNumber;
+ this.emergencyContactNumber = emergencyContactNumber;
+ }
+
+ public Employee( String pdsCode, String name, Date dateOfBirth, Date lprDate, String sex,
+ Date joinDateToGovtService, String resAddress, String contactNumber, String emergencyContactNumber,
+ boolean isTransferred )
+ {
+ this.pdsCode = pdsCode;
+ this.name = name;
+ this.dateOfBirth = dateOfBirth;
+ this.lprDate = lprDate;
+ this.sex = sex;
+ this.joinDateToGovtService = joinDateToGovtService;
+ this.resAddress = resAddress;
+ this.contactNumber = contactNumber;
+ this.emergencyContactNumber = emergencyContactNumber;
+ this.isTransferred = isTransferred;
+ }
+
// -------------------------------------------------------------------------
// hashCode and equals
// -------------------------------------------------------------------------
@@ -233,5 +254,15 @@
{
this.emergencyContactNumber = emergencyContactNumber;
}
+
+ public boolean getIsTransferred()
+ {
+ return isTransferred;
+ }
+
+ public void setIsTransferred( Boolean isTransferred )
+ {
+ this.isTransferred = isTransferred;
+ }
+
}
-
=== modified file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/EmployeeService.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/EmployeeService.java 2010-10-20 06:14:25 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/EmployeeService.java 2010-11-15 08:26:40 +0000
@@ -52,5 +52,7 @@
Employee getEmployeeByPDSCode( String pdsCode );
Collection<Employee> getAllEmployee();
+
+ Collection<Employee> getEmployeeByisTransferred( Boolean isTransferred );
}
=== modified file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/EmployeeStore.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/EmployeeStore.java 2010-10-20 06:14:25 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/EmployeeStore.java 2010-11-15 08:26:40 +0000
@@ -53,4 +53,6 @@
Employee getEmployeeByPDSCode( String pdsCode );
Collection<Employee> getAllEmployee();
+
+ Collection<Employee> getEmployeeByisTransferred( Boolean isTransferred );
}
\ No newline at end of file
=== modified file 'local/in/dhis-in-services/dhis-in-service-linelisting/src/main/java/org/hisp/dhis/linelisting/DefaultEmployeeService.java'
--- local/in/dhis-in-services/dhis-in-service-linelisting/src/main/java/org/hisp/dhis/linelisting/DefaultEmployeeService.java 2010-10-20 06:14:25 +0000
+++ local/in/dhis-in-services/dhis-in-service-linelisting/src/main/java/org/hisp/dhis/linelisting/DefaultEmployeeService.java 2010-11-15 08:26:40 +0000
@@ -28,6 +28,9 @@
import java.util.Collection;
+import org.hibernate.Criteria;
+import org.hibernate.Session;
+import org.hibernate.criterion.Restrictions;
import org.springframework.transaction.annotation.Transactional;
/**
@@ -77,5 +80,10 @@
{
return employeeStore.getAllEmployee();
}
+
+ public Collection<Employee> getEmployeeByisTransferred( Boolean isTransferred )
+ {
+ return employeeStore.getEmployeeByisTransferred( isTransferred );
+ }
}
=== modified file 'local/in/dhis-in-services/dhis-in-service-linelisting/src/main/java/org/hisp/dhis/linelisting/hibernate/HiberateEmployeeStore.java'
--- local/in/dhis-in-services/dhis-in-service-linelisting/src/main/java/org/hisp/dhis/linelisting/hibernate/HiberateEmployeeStore.java 2010-10-20 06:14:25 +0000
+++ local/in/dhis-in-services/dhis-in-service-linelisting/src/main/java/org/hisp/dhis/linelisting/hibernate/HiberateEmployeeStore.java 2010-11-15 08:26:40 +0000
@@ -58,7 +58,6 @@
// Employee
// -------------------------------------------------------------------------
-
public void addEmployee( Employee employee )
{
Session session = sessionFactory.getCurrentSession();
@@ -97,6 +96,16 @@
return session.createCriteria( Employee.class ).list();
}
+
+ public Collection<Employee> getEmployeeByisTransferred( Boolean isTransferred )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ Criteria criteria = session.createCriteria( Employee.class );
+ criteria.add( Restrictions.eq( "isTransferred", isTransferred ) );
+
+ return criteria.list();
+ }
}
=== modified file 'local/in/dhis-in-services/dhis-in-service-linelisting/src/main/resources/org/hisp/dhis/linelisting/hibernate/Employee.hbm.xml'
--- local/in/dhis-in-services/dhis-in-service-linelisting/src/main/resources/org/hisp/dhis/linelisting/hibernate/Employee.hbm.xml 2010-10-20 06:14:25 +0000
+++ local/in/dhis-in-services/dhis-in-service-linelisting/src/main/resources/org/hisp/dhis/linelisting/hibernate/Employee.hbm.xml 2010-11-15 08:26:40 +0000
@@ -23,6 +23,8 @@
<property name="contactNumber" column="contactno" not-null="true" length="25" />
<property name="emergencyContactNumber" column="emergencycontactno" not-null="true" length="25" />
+
+ <property name="isTransferred" column="istransferred" />
</class>
</hibernate-mapping>
\ No newline at end of file