Commit c32caa2d authored by Srikanth Gajula's avatar Srikanth Gajula

MT-01:[Srikanth] Sync With Mytime Repo for New Changes

parent b05c283f
defaultTasks = ['clean','build']
buildscript {
ext {
springBootVersion = '1.5.8.RELEASE'
......@@ -16,6 +17,7 @@ apply plugin: 'org.springframework.boot'
apply plugin: 'war'
war {
dependsOn test
baseName = 'myTime'
version = ''
}
......@@ -42,7 +44,6 @@ dependencies {
compile('org.projectlombok:lombok:1.16.+')
compile('org.quartz-scheduler:quartz:2.2.1')
compile('org.quartz-scheduler:quartz:2.3.0')
compile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version:'1.5.8.RELEASE'
testCompile ('junit:junit:4.12')
compile('net.sf.ucanaccess:ucanaccess:4.0.1')
......
......@@ -53,16 +53,20 @@ public class AttendanceController {
@RequestMapping(value = "employeesDataSave/{searchDate}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Boolean> employeesDataSave(@PathVariable("searchDate") String searchDate)
throws MyTimeException {
Boolean result = userService.fetchEmployeesData(searchDate);
Boolean result = userService.fetchEmployeesData(searchDate,false);
return new ResponseEntity<>(result, HttpStatus.OK);
}
@RequestMapping(value = "copyRemoteMdbFileToLocal", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Boolean> copyRemoteMdbFileToLocal()
throws MyTimeException {
public ResponseEntity<Boolean> copyRemoteMdbFileToLocal() throws MyTimeException {
Boolean result = attendanceService.copyRemoteMdbFileToLocal();
return new ResponseEntity<>(result, HttpStatus.OK);
}
@RequestMapping(value = "resyncMonthData/{fromDate}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Boolean> resyncMonthData(@PathVariable("fromDate") String fromDate) throws MyTimeException {
Boolean result = userService.fetchEmployeesData(fromDate,true);
return new ResponseEntity<>(result, HttpStatus.OK);
}
}
\ No newline at end of file
......@@ -47,7 +47,6 @@ public class ProjectController {
String projectId= accountName+String.format("%04d", sequenceNumber+1);
projectAdded.setProjectId(projectId);
Project project = projectService.addProject(projectAdded);
System.out.println(project.getProjectId());
return new ResponseEntity<>(project, HttpStatus.OK);
}
......
package com.nisum.mytime.controller;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
......@@ -15,9 +16,13 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.EmployeeDashboardVO;
import com.nisum.mytime.model.EmployeeRoles;
import com.nisum.mytime.model.EmployeeVisa;
import com.nisum.mytime.model.Project;
import com.nisum.mytime.model.ProjectTeamMate;
import com.nisum.mytime.model.TeamMateBilling;
import com.nisum.mytime.repository.EmployeeVisaRepo;
import com.nisum.mytime.service.ProjectService;
import com.nisum.mytime.service.UserService;
......@@ -31,6 +36,9 @@ public class ProjectTeamController {
@Autowired
private ProjectService projectService;
@Autowired
private EmployeeVisaRepo employeeVisaRepo;
@RequestMapping(value = "/employee", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<EmployeeRoles> getEmployeeRole(@RequestParam("emailId") String emailId)
throws MyTimeException {
......@@ -83,10 +91,12 @@ public class ProjectTeamController {
}
@RequestMapping(value = "/addEmployeeToTeam", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<ProjectTeamMate> addEmployeeToTeam(@RequestBody ProjectTeamMate employeeRoles)
public ResponseEntity<ProjectTeamMate> addEmployeeToTeam(@RequestBody ProjectTeamMate teamMate)
throws MyTimeException {
ProjectTeamMate project = projectService.addProject(employeeRoles);
return new ResponseEntity<>(project, HttpStatus.OK);
teamMate.setActive(true);
teamMate.setStartDate(new Date());
ProjectTeamMate teamMateDB = projectService.addProjectTeamMate(teamMate);
return new ResponseEntity<>(teamMateDB, HttpStatus.OK);
}
@RequestMapping(value = "/updateTeammate", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
......@@ -96,10 +106,9 @@ public class ProjectTeamController {
return new ResponseEntity<>(updatedTeammate, HttpStatus.OK);
}
@RequestMapping(value = "/deleteTeammate", method = RequestMethod.DELETE, produces = MediaType.TEXT_PLAIN_VALUE)
public ResponseEntity<String> deleteTeammate(@RequestParam("empId") String empId,
@RequestParam("managerId") String managerId) throws MyTimeException {
projectService.deleteTeammate(empId, managerId);
@RequestMapping(value = "/deleteTeammate", method = RequestMethod.POST,produces = MediaType.TEXT_PLAIN_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<String> deleteTeammate(@RequestBody ProjectTeamMate projectTeamMate) throws MyTimeException {
projectService.deleteTeammate(projectTeamMate.getEmployeeId(), projectTeamMate.getProjectId(),projectTeamMate.getId());
return new ResponseEntity<>("Success", HttpStatus.OK);
}
......@@ -143,5 +152,63 @@ public class ProjectTeamController {
List<ProjectTeamMate> employeesRoles = projectService.getProjectDetails(projectId);
return new ResponseEntity<>(employeesRoles, HttpStatus.OK);
}
@RequestMapping(value = "/getMyProjectAllocations", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<ProjectTeamMate>> getMyProjectAllocations(@RequestParam("employeeId") String employeeId)
throws MyTimeException {
List<ProjectTeamMate> projectAllocations = projectService.getMyProjectAllocations(employeeId);
return new ResponseEntity<>(projectAllocations, HttpStatus.OK);
}
@RequestMapping(value = "/getEmployeeBillingDetails", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<TeamMateBilling>> getEmployeeBillingDetails(@RequestParam("employeeId") String employeeId,@RequestParam("projectId") String projectId)
throws MyTimeException {
List<TeamMateBilling> billings = projectService.getEmployeeBillingDetails(employeeId,projectId);
return new ResponseEntity<>(billings, HttpStatus.OK);
}
@RequestMapping(value = "/addEmployeeBilling", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<TeamMateBilling> addEmployeeBilling(@RequestBody TeamMateBilling teamMate)
throws MyTimeException {
TeamMateBilling billings = projectService.addEmployeeBillingDetails(teamMate);
return new ResponseEntity<>(billings, HttpStatus.OK);
}
@RequestMapping(value = "/updateEmployeeBilling", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<TeamMateBilling> updateEmployeeBilling(@RequestBody TeamMateBilling teamMate)
throws MyTimeException {
TeamMateBilling billings = projectService.updateEmployeeBilling(teamMate);
return new ResponseEntity<>(billings, HttpStatus.OK);
}
@RequestMapping(value = "/getEmployeesDashBoard", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<EmployeeDashboardVO>> getEmployeesDashBoard() throws MyTimeException {
List<EmployeeDashboardVO> employeesRoles = projectService.getEmployeesDashBoard();
return new ResponseEntity<>(employeesRoles, HttpStatus.OK);
}
@RequestMapping(value = "/getEmployeesHavingVisa", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<EmployeeRoles>> getEmployeesHavingVisa(@RequestParam("visa") String visa) throws MyTimeException {
if(visa!=null&&!visa.equalsIgnoreCase("passport")) {
List<EmployeeVisa> employeeVisas= employeeVisaRepo.findByVisaName(visa);
List<String> employeeIds=new ArrayList();
List<EmployeeRoles> employeesRoles = new ArrayList<>();
if(employeeVisas!=null) {
employeeIds=employeeVisas.stream().map(EmployeeVisa::getEmployeeId).collect(Collectors.toList());
}
if(employeeIds!=null&&employeeIds.size()>0) {
List<EmployeeRoles> emps=userService.getEmployeeRoles();
for(EmployeeRoles e:emps) {
if(employeeIds.contains(e.getEmployeeId())) {
employeesRoles.add(e);
}
}
}
return new ResponseEntity<>(employeesRoles, HttpStatus.OK);
}else {
List<EmployeeRoles> employeesRoles = new ArrayList<>();
if(userService.getEmployeeRoles()!=null) {
employeesRoles=userService.getEmployeeRoles().stream().sorted((o1, o2)->o1.getEmployeeName().
compareTo(o2.getEmployeeName())).
collect(Collectors.toList());
}
return new ResponseEntity<>(employeesRoles, HttpStatus.OK);
}
}
}
\ No newline at end of file
......@@ -72,8 +72,9 @@ public class UserController {
@RequestMapping(value = "/getManagers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<EmployeeRoles>> getManagers() throws MyTimeException {
List<EmployeeRoles> employeesRoles = userService.getEmployeeRoles();
List<EmployeeRoles> managers = employeesRoles
.stream().filter(e -> ("Manager".equalsIgnoreCase(e.getRole())
List<EmployeeRoles> managers = employeesRoles.stream()
.filter(e -> ("Director".equalsIgnoreCase(e.getRole())
|| "Delivery Manager".equalsIgnoreCase(e.getRole()) || "Manager".equalsIgnoreCase(e.getRole())
|| "HR Manager".equalsIgnoreCase(e.getRole()) || "Lead".equalsIgnoreCase(e.getRole())))
.sorted(Comparator.comparing(EmployeeRoles::getEmployeeName)).collect(Collectors.toList());
return new ResponseEntity<>(managers, HttpStatus.OK);
......@@ -106,22 +107,14 @@ public class UserController {
@RequestMapping(value = "/updateProfile", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<EmployeeRoles> updateProfile(@RequestBody EmployeeRoles employeeRoles)
throws MyTimeException {
EmployeeRoles employeeDB = userService.getEmployeesRoleData(employeeRoles.getEmployeeId());
employeeDB.setMobileNumber(employeeRoles.getMobileNumber());
employeeDB.setAlternateMobileNumber(employeeRoles.getAlternateMobileNumber());
employeeDB.setPersonalEmailId(employeeRoles.getPersonalEmailId());
employeeDB.setBaseTechnology(employeeRoles.getBaseTechnology());
employeeDB.setTechnologyKnown(employeeRoles.getTechnologyKnown());
EmployeeRoles employeeRole = userService.updateProfile(employeeDB);
EmployeeRoles employeeRole = userService.updateProfile(employeeRoles);
return new ResponseEntity<>(employeeRole, HttpStatus.OK);
}
@RequestMapping(value = "/getAccounts", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<String>> getAccounts() throws MyTimeException {
List<String> technologies = userService.getAccounts().stream()
.filter(e -> "Y".equalsIgnoreCase(e.getStatus())).map(Account::getAccountName).sorted()
.collect(Collectors.toList());
System.out.println("technologies"+technologies);
List<String> technologies = userService.getAccounts().stream().filter(e -> "Y".equalsIgnoreCase(e.getStatus()))
.map(Account::getAccountName).sorted().collect(Collectors.toList());
return new ResponseEntity<>(technologies, HttpStatus.OK);
}
}
}
\ No newline at end of file
package com.nisum.mytime.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.EmployeeVisa;
import com.nisum.mytime.model.TravelRequest;
import com.nisum.mytime.model.Visa;
import com.nisum.mytime.service.VisaService;
@RestController
@RequestMapping("/visa")
public class VisaController {
@Autowired
private VisaService visaService;
@RequestMapping(value = "/getAllVisas", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<Visa>> getAllVisas() throws MyTimeException {
List<Visa> visas = visaService.getAllVisas();
return new ResponseEntity<>(visas, HttpStatus.OK);
}
@RequestMapping(value = "/getAllEmployeeVisas", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<EmployeeVisa>> getAllEmployeeVisas() throws MyTimeException {
List<EmployeeVisa> employeeVisas = visaService.getAllEmployeeVisas();
return new ResponseEntity<>(employeeVisas, HttpStatus.OK);
}
@RequestMapping(value = "/addEemployeeVisa", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<EmployeeVisa> addEemployeeVisa(@RequestBody EmployeeVisa employeeVisa)
throws MyTimeException {
EmployeeVisa visa = visaService.addEmployeeVisas(employeeVisa);
return new ResponseEntity<>(visa, HttpStatus.OK);
}
@RequestMapping(value = "/updateEemployeeVisa", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<EmployeeVisa> updateEemployeeVisa(@RequestBody EmployeeVisa eVisa) throws MyTimeException {
EmployeeVisa visa = visaService.updateEmployeeVisas(eVisa);
return new ResponseEntity<>(visa, HttpStatus.OK);
}
@RequestMapping(value = "/deleteEemployeeVisa", method = RequestMethod.DELETE, produces = MediaType.TEXT_PLAIN_VALUE)
public ResponseEntity<String> deleteEemployeeVisa(@RequestBody EmployeeVisa eVisa) throws MyTimeException {
visaService.deleteEmployeeVisas(eVisa);
return new ResponseEntity<>("Success", HttpStatus.OK);
}
@RequestMapping(value = "/getAllTravelRequests", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<TravelRequest>> getAllTravelRequests() throws MyTimeException {
List<TravelRequest> employeeVisas = visaService.getAllTravels();
return new ResponseEntity<>(employeeVisas, HttpStatus.OK);
}
@RequestMapping(value = "/addTravelRequest", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<TravelRequest> addTravelRequest(@RequestBody TravelRequest employeeVisa)
throws MyTimeException {
TravelRequest visa = visaService.addTravelRequest(employeeVisa);
return new ResponseEntity<>(visa, HttpStatus.OK);
}
@RequestMapping(value = "/updateTravelRequest", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<TravelRequest> updateTravelRequest(@RequestBody TravelRequest eVisa) throws MyTimeException {
TravelRequest visa = visaService.updateTravelRequest(eVisa);
return new ResponseEntity<>(visa, HttpStatus.OK);
}
@RequestMapping(value = "/deleteTravelRequest", method = RequestMethod.DELETE, produces = MediaType.TEXT_PLAIN_VALUE)
public ResponseEntity<String> deleteTravelRequest(@RequestBody TravelRequest eVisa) throws MyTimeException {
visaService.deleteEmployeeVisas(eVisa);
return new ResponseEntity<>("Success", HttpStatus.OK);
}
}
\ No newline at end of file
package com.nisum.mytime.model;
import java.io.Serializable;
import java.util.List;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
......@@ -21,7 +20,6 @@ import lombok.ToString;
@Document(collection = "Accounts")
public class Account implements Serializable {
private static final long serialVersionUID = 1L;
@Id
......
package com.nisum.mytime.model;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
@AllArgsConstructor
@Setter
@Getter
public class EmailDomain {
private String[] toEmail;
private String[] ccEmail;
private String[] bccEmail;
private String empId;
private String fromDate;
private String toDate;
private String[] toEmail;
private String[] ccEmail;
private String[] bccEmail;
}
package com.nisum.mytime.model;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class EmployeeDashboardVO {
private String employeeId;
private String employeeName;
private String emailId;
private String baseTechnology;
private String technologyKnown;
private String alternateMobileNumber;
private String personalEmailId;
private Date createdOn;
private Date lastModifiedOn;
private String role;
private String shift;
private String projectId;
private String projectName;
private String account;
private String managerId;
private String managerName;
private String experience;
private String designation;
private String billableStatus;
private String mobileNumber;
@DateTimeFormat(iso = ISO.DATE)
private Date startDate;
@DateTimeFormat(iso = ISO.DATE)
private Date endDate;
private boolean active;
private boolean projectAssigned;
private boolean hasB1Visa;
private boolean hasH1Visa;
private boolean hasPassport;
}
......@@ -31,6 +31,7 @@ public class EmployeeRoles implements Serializable {
private String employeeName;
private String emailId;
private String role;
private String designation;
private String shift;
private String baseTechnology;
private String technologyKnown;
......@@ -40,5 +41,4 @@ public class EmployeeRoles implements Serializable {
private Date createdOn;
private Date lastModifiedOn;
}
package com.nisum.mytime.model;
import java.util.Date;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "EmployeeVisa")
public class EmployeeVisa {
@Id
private ObjectId id;
private String employeeId;
private String employeeName;
private String visaNo;
private String visaName;
private String visaCountry;
private Date visaIntiatedDate;
private Date approvedDate;
private Date visaExpiryDate;
private String status;
private String comments;
}
package com.nisum.mytime.model;
import java.io.Serializable;
import java.util.Date;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;
import lombok.AllArgsConstructor;
import lombok.Getter;
......@@ -38,4 +41,10 @@ public class ProjectTeamMate implements Serializable {
private String designation;
private String billableStatus;
private String mobileNumber;
@DateTimeFormat(iso = ISO.DATE)
private Date startDate;
@DateTimeFormat(iso = ISO.DATE)
private Date endDate;
private boolean active;
}
package com.nisum.mytime.model;
import java.io.Serializable;
import java.util.Date;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "TeamMateBilling")
public class TeamMateBilling implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private ObjectId id;
private String employeeId;
private String employeeName;
private String projectId;
private String projectName;
@DateTimeFormat(iso = ISO.DATE)
private Date billingStartDate;
@DateTimeFormat(iso = ISO.DATE)
private Date billingEndDate;
private String comments;
private boolean active;
@DateTimeFormat(iso = ISO.DATE)
private Date createDate;
}
package com.nisum.mytime.model;
import java.util.Date;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "TravelRequests")
public class TravelRequest {
@Id
private ObjectId id;
private String employeeId;
private String employeeName;
private String visaNo;
private String visaName;
private String visaCountry;
private Date visaExpiryDate;
private String status;
private String comments;
private String fromLocation;
private String toLocation;
private String buddy;
private String account;
private String project;
private Date travelDate;
private Date returnDate;
}
package com.nisum.mytime.model;
import org.springframework.data.mongodb.core.mapping.Document;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "Visa")
public class Visa {
private String visaName;
private String visaCountry;
}
package com.nisum.mytime.repository;
import java.util.List;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.EmployeeVisa;
public interface EmployeeVisaRepo extends MongoRepository<EmployeeVisa, String> {
List<EmployeeVisa> findByVisaName(String visaName);
}
\ No newline at end of file
......@@ -9,5 +9,6 @@ import com.nisum.mytime.model.Project;
public interface ProjectRepo extends MongoRepository<Project, String> {
Project findByProjectId(String projectId);
List<Project> findByManagerId(String managerId);
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.nisum.mytime.repository;
import java.util.List;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.ProjectTeamMate;
......@@ -14,6 +15,10 @@ public interface ProjectTeamMatesRepo extends MongoRepository<ProjectTeamMate, S
List<ProjectTeamMate> findByEmployeeId(String employeeId);
ProjectTeamMate findById(ObjectId id);
ProjectTeamMate findByEmployeeIdAndManagerId(String employeeId, String managerId);
ProjectTeamMate findByEmployeeIdAndProjectId(String employeeId, String projectId);
}
package com.nisum.mytime.repository;
import java.util.List;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.TeamMateBilling;
public interface TeamMatesBillingRepo extends MongoRepository<TeamMateBilling, String> {
List<TeamMateBilling> findByProjectId(String projectId);
List<TeamMateBilling> findByEmployeeId(String employeeId);
TeamMateBilling findById(ObjectId id);
List<TeamMateBilling> findByEmployeeIdAndProjectId(String employeeId, String projectId);
}
package com.nisum.mytime.repository;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.TravelRequest;
public interface TravelRepo extends MongoRepository<TravelRequest, String> {
}
\ No newline at end of file
package com.nisum.mytime.repository;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.Visa;
public interface VisaRepo extends MongoRepository<Visa, String> {
}
\ No newline at end of file
......@@ -12,4 +12,6 @@ public interface AttendanceService {
Boolean copyRemoteMdbFileToLocal() throws MyTimeException;
void triggerMailToAbsentees() throws MyTimeException;
}
......@@ -232,4 +232,10 @@ public class AttendanceServiceImpl implements AttendanceService {
return result;
}
@Override
public void triggerMailToAbsentees() throws MyTimeException {
}
}
......@@ -86,13 +86,15 @@ public class EmployeeDataService {
private File finalfile = null;
public Boolean fetchEmployeesData(String perticularDate) throws MyTimeException {
public Boolean fetchEmployeesData(String perticularDate, boolean resynchFlag) throws MyTimeException {
Boolean result = false;
StringBuilder queryMonthDecider = new StringBuilder();
long start_ms = System.currentTimeMillis();
List<EmpLoginData> loginsData = new ArrayList<>();
Map<String, List<EmpLoginData>> map = new HashMap<>();
boolean frstQuery = true;
Date searchdDate = null;
Date endOfsearchDate = null;
Map<String, EmpLoginData> emp = new HashMap<>();
try {
File dir = new File(localFileDirectory);
......@@ -113,10 +115,16 @@ public class EmployeeDataService {
connection = DbConnection.getDBConnection(dbURL);
statement = connection.createStatement();
if (!resynchFlag) {
calendar.set(year, (month - 1), calendar.get(Calendar.DAY_OF_MONTH), 6, 00, 00);
Date searchdDate = calendar.getTime();
Date endOfsearchDate = DateUtils.addHours(searchdDate, 24);
searchdDate = calendar.getTime();
endOfsearchDate = DateUtils.addHours(searchdDate, 24);
} else {
calendar.set(year, (month - 1), calendar.get(Calendar.DAY_OF_MONTH), 6, 00, 00);
endOfsearchDate = calendar.getTime();
calendar.set(year, (month - 1), calendar.get(Calendar.DAY_OF_MONTH) - 15, 6, 00, 00);
searchdDate = calendar.getTime();
}
queryMonthDecider.append(MyTimeUtils.QUERY);
queryMonthDecider.append((calendar.get(Calendar.MONTH)) + 1);
......
......@@ -2,11 +2,15 @@ package com.nisum.mytime.service;
import java.util.List;
import org.bson.types.ObjectId;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.EmpLoginData;
import com.nisum.mytime.model.EmployeeDashboardVO;
import com.nisum.mytime.model.EmployeeRoles;
import com.nisum.mytime.model.Project;
import com.nisum.mytime.model.ProjectTeamMate;
import com.nisum.mytime.model.TeamMateBilling;
public interface ProjectService {
......@@ -28,11 +32,11 @@ public interface ProjectService {
List<ProjectTeamMate> getTeamDetails(String empId);
ProjectTeamMate addProject(ProjectTeamMate project) throws MyTimeException;
public ProjectTeamMate addProjectTeamMate(ProjectTeamMate projectTeamMate) throws MyTimeException;
ProjectTeamMate updateTeammate(ProjectTeamMate projectTeamMate);
void deleteTeammate(String empId, String managerId);
void deleteTeammate(String empId, String projectId,ObjectId id);
List<Project> getProjects(String managerId) throws MyTimeException;
......@@ -45,4 +49,14 @@ public interface ProjectService {
List<ProjectTeamMate> getAllProjectDetails();
List<ProjectTeamMate> getProjectDetails(String projectId);
public List<ProjectTeamMate> getMyProjectAllocations(String empId);
List<TeamMateBilling> getEmployeeBillingDetails(String empId,String projectId);
TeamMateBilling addEmployeeBillingDetails(TeamMateBilling teamMate);
TeamMateBilling updateEmployeeBilling(TeamMateBilling teamMate);
public List<EmployeeDashboardVO> getEmployeesDashBoard();
}
......@@ -12,7 +12,7 @@ import com.nisum.mytime.model.Skill;
public interface UserService {
Boolean fetchEmployeesData(String perticularDate) throws MyTimeException;
Boolean fetchEmployeesData(String perticularDate,boolean resynchFlag) throws MyTimeException;
List<EmpLoginData> employeeLoginsBasedOnDate(long id, String fromDate, String toDate) throws MyTimeException;
......
......@@ -32,8 +32,10 @@ public class UserServiceImpl implements UserService {
@Autowired
private EmployeeRolesRepo employeeRolesRepo;
@Autowired
private ProjectTeamMatesRepo projectTeamMatesRepo;
@Autowired
private ShiftRepo shiftRepo;
......@@ -56,8 +58,8 @@ public class UserServiceImpl implements UserService {
private MongoTemplate mongoTemplate;
@Override
public Boolean fetchEmployeesData(String perticularDate) throws MyTimeException {
return employeeDataBaseService.fetchEmployeesData(perticularDate);
public Boolean fetchEmployeesData(String perticularDate,boolean resynchFlag) throws MyTimeException {
return employeeDataBaseService.fetchEmployeesData(perticularDate,resynchFlag);
}
@Override
......@@ -101,12 +103,20 @@ public class UserServiceImpl implements UserService {
update.set("employeeName", employeeRoles.getEmployeeName());
update.set("emailId", employeeRoles.getEmailId());
update.set("role", employeeRoles.getRole());
update.set("shift", employeeRoles.getShift());
update.set("lastModifiedOn", new Date());
FindAndModifyOptions options = new FindAndModifyOptions();
options.returnNew(true);
options.upsert(true);
return mongoTemplate.findAndModify(query, update, options, EmployeeRoles.class);
EmployeeRoles emp= mongoTemplate.findAndModify(query, update, options, EmployeeRoles.class);
try {
List<ProjectTeamMate> employeeProfiles= projectTeamMatesRepo.findByEmployeeId(emp.getEmployeeId());
if(employeeProfiles!=null&&!employeeProfiles.isEmpty()) {
for(ProjectTeamMate profile:employeeProfiles){
profile.setRole(emp.getRole());;
projectTeamMatesRepo.save(profile);
}
}}catch(Exception e) {}
return emp;
}
@Override
......@@ -123,31 +133,48 @@ public class UserServiceImpl implements UserService {
public List<Designation> getAllDesignations() throws MyTimeException {
return designationRepo.findAll();
}
@Override
public List<Account> getAccounts() throws MyTimeException {
return accountRepo.findAll();
}
@Override
public List<Skill> getTechnologies() throws MyTimeException {
return technologyRepo.findAll();
}
@Override
public EmployeeRoles updateProfile(EmployeeRoles employeeRoles) throws MyTimeException {
boolean mobileNumberChnaged=false;
boolean designationChnaged=false;
employeeRoles.setLastModifiedOn(new Date());
EmployeeRoles existingEmployee=employeeRolesRepo.findByEmployeeId(employeeRoles.getEmployeeId());
String newMobileNumber=employeeRoles.getMobileNumber();
String designation=employeeRoles.getDesignation();
if(newMobileNumber!=null&&!newMobileNumber.equalsIgnoreCase("")) {
if((existingEmployee!=null&&existingEmployee.getMobileNumber()!=null&&!existingEmployee.getMobileNumber().equalsIgnoreCase(newMobileNumber) )|| (existingEmployee.getMobileNumber()==null )){
mobileNumberChnaged=true;
}
}
EmployeeRoles employeeRolesDB= employeeRolesRepo.save(employeeRoles);
if(mobileNumberChnaged) {
if(designation!=null&&!designation.equalsIgnoreCase("")) {
if((existingEmployee!=null&&existingEmployee.getDesignation()!=null&&!existingEmployee.getDesignation().equalsIgnoreCase(newMobileNumber) )|| (existingEmployee.getDesignation()==null )){
designationChnaged=true;
}
}
existingEmployee.setDesignation(employeeRoles.getDesignation());
existingEmployee.setMobileNumber(employeeRoles.getMobileNumber());
existingEmployee.setAlternateMobileNumber(employeeRoles.getAlternateMobileNumber());
existingEmployee.setPersonalEmailId(employeeRoles.getPersonalEmailId());
existingEmployee.setBaseTechnology(employeeRoles.getBaseTechnology());
existingEmployee.setTechnologyKnown(employeeRoles.getTechnologyKnown());
EmployeeRoles employeeRolesDB= employeeRolesRepo.save(existingEmployee);
if(mobileNumberChnaged || designationChnaged) {
try {
List<ProjectTeamMate> employeeProfiles= projectTeamMatesRepo.findByEmployeeId(employeeRoles.getEmployeeId());
if(employeeProfiles!=null&&!employeeProfiles.isEmpty()) {
for(ProjectTeamMate profile:employeeProfiles){
profile.setDesignation(employeeRolesDB.getDesignation());
profile.setMobileNumber(employeeRolesDB.getMobileNumber());
projectTeamMatesRepo.save(profile);
}
......
/**
*
*/
package com.nisum.mytime.service;
import java.util.List;
import com.nisum.mytime.model.EmployeeVisa;
import com.nisum.mytime.model.TravelRequest;
import com.nisum.mytime.model.Visa;
/**
* @author nisum
*
*/
public interface VisaService {
List<Visa> getAllVisas();
List<EmployeeVisa> getAllEmployeeVisas();
EmployeeVisa addEmployeeVisas(EmployeeVisa e);
EmployeeVisa updateEmployeeVisas(EmployeeVisa e);
void deleteEmployeeVisas(EmployeeVisa e);
List<TravelRequest> getAllTravels();
TravelRequest addTravelRequest(TravelRequest e);
TravelRequest updateTravelRequest(TravelRequest e);
void deleteEmployeeVisas(TravelRequest e);
}
/**
*
*/
package com.nisum.mytime.service;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List;
import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Service;
import com.nisum.mytime.model.EmailDomain;
import com.nisum.mytime.model.EmployeeVisa;
import com.nisum.mytime.model.TravelRequest;
import com.nisum.mytime.model.Visa;
import com.nisum.mytime.repository.EmployeeRolesRepo;
import com.nisum.mytime.repository.EmployeeVisaRepo;
import com.nisum.mytime.repository.TravelRepo;
import com.nisum.mytime.repository.VisaRepo;
/**
* @author nisum
*
*/
@Service
public class VisaServiceImpl implements VisaService {
private static final Logger logger = LoggerFactory.getLogger(VisaServiceImpl.class);
@Autowired
private VisaRepo visaRepo;
@Autowired
private TravelRepo travelRepo;
@Autowired
private EmployeeVisaRepo employeeVisaRepo;
@Override
public List<Visa> getAllVisas() {
return visaRepo.findAll();
}
@Override
public List<EmployeeVisa> getAllEmployeeVisas() {
return employeeVisaRepo.findAll();
}
@Override
public EmployeeVisa addEmployeeVisas(EmployeeVisa e) {
// TODO Auto-generated method stub
return employeeVisaRepo.save(e);
}
@Override
public EmployeeVisa updateEmployeeVisas(EmployeeVisa e) {
// TODO Auto-generated method stub
return employeeVisaRepo.save(e);
}
@Override
public void deleteEmployeeVisas(EmployeeVisa e) {
// TODO Auto-generated method stub
employeeVisaRepo.delete(e);
}
@Override
public List<TravelRequest> getAllTravels() {
return travelRepo.findAll();
}
@Override
public TravelRequest addTravelRequest(TravelRequest e) {
// TODO Auto-generated method stub
return travelRepo.save(e);
}
@Override
public TravelRequest updateTravelRequest(TravelRequest e) {
// TODO Auto-generated method stub
return travelRepo.save(e);
}
@Override
public void deleteEmployeeVisas(TravelRequest e) {
// TODO Auto-generated method stub
travelRepo.delete(e);
}
}
......@@ -2,7 +2,8 @@ server.port=8080
server.context-path=/myTime/
#Mongo DB configuration
spring.data.mongodb.host=192.168.15.17
spring.data.mongodb.host=192.168.10.177
#192.168.15.17
spring.data.mongodb.port=27017
spring.data.mongodb.database=mytimedb
spring.data.mongodb.username=mytime
......@@ -14,7 +15,7 @@ spring.data.mongodb.password=nisum@123
#spring.data.mongodb.database=mytime
quartz.enabled=true
cron.expression=0 45 10/2 1/1 * ? *
cron.expression=0 45 10/3 1/1 * ? *
myTimejob.frequency=10000
mytime.remoteFileTransfer.required=true
......
......@@ -6,6 +6,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
"employeeName": "",
"emailId":"",
"role": "",
"designation":"",
"action":""
};
......@@ -17,15 +18,37 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
paginationPageSize : 10,
pageNumber: 1,
pageSize:10,
enableFiltering: true,
columnDefs : [
{field : 'employeeId',displayName: 'Employee ID', enableColumnMenu: true, enableSorting: true, width:120},
{field : 'employeeName',displayName: 'Name', enableColumnMenu: false, enableSorting: false},
{field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false},
{field : 'role',displayName: 'Role', enableColumnMenu: false, enableSorting: false, width:100},
{name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, width:100}
{field : 'employeeId',displayName: 'Employee ID', enableColumnMenu: true, enableSorting: true,enableFiltering: true, width:120},
{field : 'employeeName',displayName: 'Name', enableColumnMenu: false, enableSorting: false,enableFiltering: true},
{field : 'mobileNumber',displayName: 'Mobile', enableColumnMenu: false, enableSorting: false,enableFiltering: false},
{field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false,enableFiltering: true},
{field : 'baseTechnology',displayName: 'Skill', enableColumnMenu: false, enableSorting: false,enableFiltering: true},
{field : 'designation',displayName: 'Designation', enableColumnMenu: false, enableSorting: true,enableFiltering: true},
{field : 'role',displayName: 'Role', enableColumnMenu: false, enableSorting: true,enableFiltering: true, width:100},
{name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false,enableFiltering: false, width:100}
]
};
$scope.gridOptions.data = $scope.records;
$scope.gridOptionsOrgView = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10,
pageNumber: 1,
pageSize:10,
enableFiltering: true,
columnDefs : [
{field : 'employeeId',displayName: 'Employee ID', enableColumnMenu: true, enableSorting: true,enableFiltering: true, width:120},
{field : 'employeeName',displayName: 'Name', enableColumnMenu: false, enableSorting: false,enableFiltering: true},
//{field : 'mobileNumber',displayName: 'Mobile', enableColumnMenu: false, enableSorting: false,enableFiltering: false},
{field : 'emailId',displayName: 'Email', enableColumnMenu: false, enableSorting: false,enableFiltering: true},
{field : 'baseTechnology',displayName: 'Skill', enableColumnMenu: false, enableSorting: false,enableFiltering: true},
{field : 'designation',displayName: 'Designation', enableColumnMenu: false, enableSorting: true,enableFiltering: true},
// {field : 'role',displayName: 'Role', enableColumnMenu: false, enableSorting: true,enableFiltering: true, width:100},
// {name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false,enableFiltering: false, width:100}
]
};
//$scope.gridOptionsOrgView.data = $scope.records;
$scope.getRowData = function(row, action){
$scope.parentData.employeeId = row.entity.employeeId;
......@@ -42,7 +65,9 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.empSearchId = "";
$scope.getUserRoles();
}
$scope.refreshPageOrg = function(){
$scope.getOrgEmps();
}
$scope.getUserRoles = function(){
$http({
method : "GET",
......@@ -54,6 +79,17 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.gridOptions.data = [];
});
};
$scope.getOrgEmps = function(){
$http({
method : "GET",
url : appConfig.appUri + "user/getUserRoles"
}).then(function mySuccess(response) {
$scope.gridOptionsOrgView.data = response.data;
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
$scope.gridOptionsOrgView.data = [];
});
};
$scope.validateEmpId = function(){
var searchId = $scope.empSearchId;
......@@ -192,7 +228,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.empEmail = dataToPass.emailId;
$scope.isDisabled = true;
}
$scope.roles = ["Director","Employee","HR","HR Manager","Lead","Manager"];
$scope.roles = ["Delivery Manager","Director","Employee","HR","HR Manager","Lead","Manager"];
$scope.getSelectedRole = function(){
if ($scope.empRole !== undefined) {
return $scope.empRole;
......
This diff is collapsed.
......@@ -15,7 +15,7 @@ myApp.controller("headerController",function($scope, myFactory, $compile, $mdDia
auth2.disconnect();
//Clear if any values set to factory
var menuItems = [];
var menuItems = [], designations = [], accounts = [], technologies = [], shifts = [];
myFactory.setEmpId("");
myFactory.setEmpName("");
myFactory.setEmpEmailId("");
......@@ -23,6 +23,10 @@ myApp.controller("headerController",function($scope, myFactory, $compile, $mdDia
myFactory.setMenuItems(menuItems);
myFactory.setTemplateUrl("");
myFactory.setProfileUrl("");
myFactory.setDesignations(designations);
myFactory.setAccounts(accounts);
myFactory.setTechnologies(technologies);
myFactory.setShifts(shifts);
$timeout(function(){redirectToLoginPage();},2000);
......@@ -39,6 +43,7 @@ myApp.controller("headerController",function($scope, myFactory, $compile, $mdDia
}
function showProgressDialog(){
$('#home').addClass('md-scroll-mask');
$mdDialog.show({
templateUrl: 'templates/progressDialog.html',
controller: ProgressController,
......
......@@ -6,21 +6,20 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
function onSignIn(googleUser) {
var profile = googleUser.getBasicProfile();
console.log('Name: ' + profile.getName());
console.log('Email: ' + profile.getEmail());
console.log('Image URL: ' + profile.getImageUrl());
getUserRole(profile);
getAllUserRoles();
getAllShifts();
getAllDesignations();
getAllTechnologies();
getAllAccounts();
$("#start").trigger("click");
}
function onFailure(error){
if(error.type == "tokenFailed"){
showAlert('Please login with @Nisum account');
}
$("#stop").trigger("click");
}
function showAlert(message) {
......@@ -239,18 +238,23 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
menuItems.push({"menu" : "Attendance Report","icon" : "fa fa-bar-chart fa-2x","path" : "templates/attendanceReport.html"});
menuItems.push({"menu" : "Shift Details","icon" : "fa fa-superpowers fa-2x","path" : "templates/shiftdetails.html"});
menuItems.push({"menu" : "ReSync Data","icon" : "fa fa-recycle fa-2x","path" : "templates/resyncData.html"});
menuItems.push({"menu" : "My Project Allocations","icon" : "fa fa-address-card-o fa-2x","path" : "templates/myProjectAllocations.html"});
menuItems.push({"menu" : "My Org","icon" : "fa fa-address-card-o fa-2x","path" : "templates/myOrg.html"});
menuItems.push({"menu" : "My Profile","icon" : "fa fa-address-card-o fa-2x","path" : "templates/profile.html"});
}else if(role == "Manager"){
menuItems.push({"menu" : "My Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"});
menuItems.push({"menu" : "Reportee Details","icon" : "fa fa-users fa-2x","path" : "templates/reportees.html"});
menuItems.push({"menu" : "Manage Team","icon" : "fa fa-sitemap fa-2x","path" : "templates/projectDetails.html"});
menuItems.push({"menu" : "View Projects","icon" : "fa fa-tasks fa-2x","path" : "templates/viewProjects.html"});
menuItems.push({"menu" : "My Project Allocations","icon" : "fa fa-life-ring fa-2x","path" : "templates/myProjectAllocations.html"});
menuItems.push({"menu" : "My Org","icon" : "fa fa-address-card-o fa-2x","path" : "templates/myOrg.html"});
menuItems.push({"menu" : "My Profile","icon" : "fa fa-address-card-o fa-2x","path" : "templates/profile.html"});
}else if(role == "Employee"){
menuItems.push({"menu" : "My Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"});
menuItems.push({"menu" : "My Team","icon" : "fa fa-futbol-o fa-2x","path" : "templates/myTeam.html"});
menuItems.push({"menu" : "My Project Allocations","icon" : "fa fa-life-ring fa-2x","path" : "templates/myProjectAllocations.html"});
menuItems.push({"menu" : "My Profile","icon" : "fa fa-address-card-o fa-2x","path" : "templates/profile.html"});
}else if(role == "HR Manager" || role == "Director"){
}else if(role == "HR Manager"){
menuItems.push({"menu" : "My Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"});
menuItems.push({"menu" : "Employee Details","icon" : "fa fa-users fa-2x","path" : "templates/employees.html"});
menuItems.push({"menu" : "Reports","icon" : "fa fa-pie-chart fa-2x","path" : "templates/reports.html"});
......@@ -259,11 +263,30 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
menuItems.push({"menu" : "Manage Projects","icon" : "fa fa-tasks fa-2x","path" : "templates/projects.html"});
menuItems.push({"menu" : "Attendance Report","icon" : "fa fa-bar-chart fa-2x","path" : "templates/attendanceReport.html"});
menuItems.push({"menu" : "Shift Details","icon" : "fa fa-superpowers fa-2x","path" : "templates/shiftdetails.html"});
menuItems.push({"menu" : "My Project Allocations","icon" : "fa fa-life-ring fa-2x","path" : "templates/myProjectAllocations.html"});
menuItems.push({"menu" : "My Org","icon" : "fa fa-address-card-o fa-2x","path" : "templates/myOrg.html"});
menuItems.push({"menu" : "My Profile","icon" : "fa fa-address-card-o fa-2x","path" : "templates/profile.html"});
}else if(role == "Lead"){
menuItems.push({"menu" : "My Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"});
menuItems.push({"menu" : "Reportee Details","icon" : "fa fa-users fa-2x","path" : "templates/reportees.html"});
menuItems.push({"menu" : "Manage Team","icon" : "fa fa-sitemap fa-2x","path" : "templates/projectDetails.html"});
menuItems.push({"menu" : "My Project Allocations","icon" : "fa fa-life-ring fa-2x","path" : "templates/myProjectAllocations.html"});
menuItems.push({"menu" : "My Org","icon" : "fa fa-address-card-o fa-2x","path" : "templates/myOrg.html"});
menuItems.push({"menu" : "My Profile","icon" : "fa fa-address-card-o fa-2x","path" : "templates/profile.html"});
}else if(role == "Delivery Manager" || role == "Director"){
menuItems.push({"menu" : "My Details","icon" : "fa fa-indent fa-2x","path" : "templates/employee.html"});
menuItems.push({"menu" : "Employee Details","icon" : "fa fa-users fa-2x","path" : "templates/employees.html"});
menuItems.push({"menu" : "Reports","icon" : "fa fa-pie-chart fa-2x","path" : "templates/reports.html"});
menuItems.push({"menu" : "Manage Employees","icon" : "fa fa-user-plus fa-2x","path" : "templates/roles.html"});
menuItems.push({"menu" : "Manage Team","icon" : "fa fa-sitemap fa-2x","path" : "templates/projectDetails.html"});
menuItems.push({"menu" : "Manage Projects","icon" : "fa fa-tasks fa-2x","path" : "templates/projects.html"});
menuItems.push({"menu" : "Manage Visa","icon" : "fa fa-tasks fa-2x","path" : "templates/visaList.html"});
menuItems.push({"menu" : "Manage Travels","icon" : "fa fa-tasks fa-2x","path" : "templates/onsiteTravelsList.html"});
menuItems.push({"menu" : "Attendance Report","icon" : "fa fa-bar-chart fa-2x","path" : "templates/attendanceReport.html"});
menuItems.push({"menu" : "Shift Details","icon" : "fa fa-superpowers fa-2x","path" : "templates/shiftdetails.html"});
menuItems.push({"menu" : "Dashboard","icon" : "fa fa-life-ring fa-2x","path" : "templates/dashboard.html"});
menuItems.push({"menu" : "My Project Allocations","icon" : "fa fa-life-ring fa-2x","path" : "templates/myProjectAllocations.html"});
menuItems.push({"menu" : "My Org","icon" : "fa fa-address-card-o fa-2x","path" : "templates/myOrg.html"});
menuItems.push({"menu" : "My Profile","icon" : "fa fa-address-card-o fa-2x","path" : "templates/profile.html"});
}
......@@ -290,7 +313,7 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
auth2.disconnect();
//Clear if any values set to factory
var menuItems = [];
var menuItems = [], designations = [], accounts = [], technologies = [], shifts = [];
myFactory.setEmpId("");
myFactory.setEmpName("");
myFactory.setEmpEmailId("");
......@@ -298,6 +321,10 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
myFactory.setMenuItems(menuItems);
myFactory.setTemplateUrl("");
myFactory.setProfileUrl("");
myFactory.setDesignations(designations);
myFactory.setAccounts(accounts);
myFactory.setTechnologies(technologies);
myFactory.setShifts(shifts);
var element = document.getElementById('home');
var path = "'templates/login.html'";
......
......@@ -39,6 +39,7 @@ myApp.controller("reporteesController", function($scope, $http, myFactory, $mdDi
$scope.toDate = today;
$scope.gridOptions.data = [];
$scope.isVisible = false;
$scope.avgLoginHrs = "";
};
$scope.getReporteesDetails = function(){
......@@ -68,6 +69,7 @@ myApp.controller("reporteesController", function($scope, $http, myFactory, $mdDi
showAlert('Please select an Employee ID');
document.getElementById('reporteeDetail').focus();
}else{
$scope.avgLoginHrs = "";
getData(searchId.employeeId, fromDate, toDate);
}
......@@ -138,6 +140,7 @@ myApp.controller("reporteesController", function($scope, $http, myFactory, $mdDi
$scope.toDate = today;
$scope.gridOptions.data = [];
$scope.isVisible = false;
$scope.avgLoginHrs = "";
}
function treatAsUTC(date) {
......
......@@ -26,6 +26,7 @@ myApp.controller("employeeController", function($scope, $http, myFactory, $mdDia
$scope.gridOptions.data = [];
$scope.getEmployeeData = function(){
$scope.avgLoginHrs = "";
var fromDate = getFormattedDate($scope.fromDate);
var toDate = getFormattedDate($scope.toDate);
var empId = $scope.empId;
......@@ -34,7 +35,9 @@ myApp.controller("employeeController", function($scope, $http, myFactory, $mdDia
url : appConfig.appUri + "attendance/employeeLoginsBasedOnDate?empId=" + empId + "&fromDate=" + fromDate + "&toDate=" +toDate
}).then(function mySuccess(response) {
$scope.gridOptions.data = response.data;
if(response.data.length > 0){
$scope.avgLoginHrs = response.data[0].totalAvgTime + " Hrs";
}
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
$scope.gridOptions.data = [];
......
......@@ -38,11 +38,13 @@ myApp.controller("profileController", function($scope, $http, myFactory, $mdDial
function UpdateProfileController($scope, $mdDialog, dataToPass) {
$scope.profile = dataToPass;
$scope.technologies=myFactory.getTechnologies();
$scope.designations=myFactory.getDesignations();
$scope.baseTechnology=(dataToPass.baseTechnology == null ? undefined: dataToPass.baseTechnology);
$scope.mobileNumber=dataToPass.mobileNumber;
$scope.alternateMobileNumber=dataToPass.alternateMobileNumber;
$scope.personalEmailId=dataToPass.personalEmailId;
$scope.technologyKnown=dataToPass.technologyKnown;
$scope.designationEmp=(dataToPass.designation == null ? undefined: dataToPass.designation);
$scope.cancel = function() {
$mdDialog.hide();
};
......@@ -54,11 +56,17 @@ myApp.controller("profileController", function($scope, $http, myFactory, $mdDial
return "Please select primary skill";
}
};
$scope.getDesignationText = function(){
if ($scope.designationEmp !== undefined) {
return $scope.designationEmp;
} else {
return "Please select designation";
}
};
$scope.validateFields = function(){
var mobileNumber = $scope.mobileNumber;
$scope.alertMsg = "";
var record = {"employeeId":myFactory.getEmpId(), "mobileNumber": mobileNumber, "alternateMobileNumber": $scope.alternateMobileNumber, "personalEmailId": $scope.personalEmailId, "baseTechnology": $scope.baseTechnology, "technologyKnown": $scope.technologyKnown};
var record = {"employeeId":myFactory.getEmpId(),"designation": $scope.designationEmp, "mobileNumber": mobileNumber, "alternateMobileNumber": $scope.alternateMobileNumber, "personalEmailId": $scope.personalEmailId, "baseTechnology": $scope.baseTechnology, "technologyKnown": $scope.technologyKnown};
var urlRequest = "";
urlRequest = appConfig.appUri+ "user/updateProfile";
......
myApp.controller("myProjectAllocationsController",function($scope, myFactory, $mdDialog, $http, appConfig, $timeout){
$scope.records = [];
$scope.empSearchId = "";
$scope.parentData = {
"employeeId":"",
"projectName": "",
"account": "",
"managerName":"",
"billableStatus": "",
"shift":"",
"active": ""
};
$scope.employees = [];
$scope.projects = [];
var getCellTemplate = '<div class="ui-grid-cell-contents"><a href="#" ng-click="grid.appScope.getRowData(row,\'View\')">{{COL_FIELD}}</a></div>';
//var getCellTemplate = '<p class="col-lg-12"><i class="fa fa-2x" aria-hidden="true" style="font-size:1.5em;colormargin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Update\')">{{COL_FIELD}}</i></i></p>';
var getCellActiveTemplate='<div ng-show="COL_FIELD==true"><p class="col-lg-12">Y</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">N</p></div>';
$scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10,
pageNumber: 1,
pageSize:10,
columnDefs : [
{field : 'projectName',displayName: 'Project',cellTemplate:getCellTemplate, enableColumnMenu: true, enableSorting: true},
{field : 'account',displayName: 'Account', enableColumnMenu: false, enableSorting: false},
{field : 'managerName',displayName: 'Manager Name', enableColumnMenu: false, enableSorting: false},
{field : 'billableStatus',displayName: 'Billability', enableColumnMenu: false, enableSorting: false},
{field : 'shift',displayName: 'Shift', enableColumnMenu: false, enableSorting: false},
{field : 'active',displayName: 'Active', enableColumnMenu: false,cellTemplate:getCellActiveTemplate,enableSorting: false}
]
};
$scope.gridOptions.data = $scope.records;
$scope.getRowData = function(row, action){
$scope.parentData.employeeId = row.entity.employeeId;
$scope.parentData.employeeName = row.entity.employeeName;
$scope.parentData.emailId = row.entity.emailId;
$scope.parentData.role = row.entity.role;
$scope.parentData.shift = row.entity.shift;
$scope.parentData.projectId = row.entity.projectId;
$scope.parentData.projectName = row.entity.projectName;
$scope.parentData.managerId = row.entity.managerId;
$scope.parentData.managerName = row.entity.managerName;
$scope.parentData.experience = row.entity.experience;
$scope.parentData.designation = row.entity.designation;
if(action == "View")
$scope.viewTeamDetails(action, $scope.parentData);
}
$scope.refreshPage = function(){
$scope.empSearchId = "";
$scope.getMyProjectAllocations();
}
$scope.getMyProjectAllocations = function(){
$http({
method : "GET",
url : appConfig.appUri + "/projectTeam/getMyProjectAllocations?employeeId="+myFactory.getEmpId()
}).then(function mySuccess(response) {
$scope.gridOptions.data = response.data;
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
$scope.gridOptions.data = [];
});
};
$scope.viewTeamDetails = function(action, userData){
$('#home').addClass('md-scroll-mask');
userData.action = action;
$mdDialog.show({
controller: ProjectDetailsController,
templateUrl: 'templates/projectTeamDetails.html',
parent: angular.element(document.body),
clickOutsideToClose:true,
locals:{dataToPass: userData,gridOptionsData: $scope.gridOptions.data, managers: $scope.managers},
})
.then(function(result) {});
};
$scope.cancel = function() {
$mdDialog.hide();
};
function ProjectDetailsController($scope, $mdDialog, dataToPass,gridOptionsData, managers) {
$scope.templateTitle = dataToPass.action;
$scope.alertMsg = "";
$scope.isDisabled = false;
$scope.result = "";
$scope.managerDetails = managers;
$scope.prjctStses=["Active","Completed","On Hold","Proposed"];
$scope.accounts=myFactory.getAccounts();
if(dataToPass.action == "Assign"){}else if(dataToPass.action == "Update"){}else if(dataToPass.action == "View"){
$scope.projectId = dataToPass.projectId;
$scope.projectName = dataToPass.projectName;
$scope.managerId = dataToPass.managerId;
$scope.managerName = dataToPass.managerName;
$scope.projectStatus = dataToPass.status;
$scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10,
pageNumber: 1,
pageSize:10,
columnDefs : [
{field : 'employeeId',displayName: 'Emp ID', enableColumnMenu: true, enableSorting: true, width:100},
{field : 'employeeName',displayName: 'Empl Name ', enableColumnMenu: false, enableSorting: false},
{field : 'emailId',displayName: 'Email Id ', enableColumnMenu: false, enableSorting: false},
{field : 'experience',displayName: 'Exp', enableColumnMenu: true, enableSorting: true,width:80},
{field : 'designation',displayName: 'Designation ', enableColumnMenu: false, enableSorting: false},
{field : 'billableStatus',displayName: 'Billability ', enableColumnMenu: false, enableSorting: false},
]
};
$scope.isDisabled = true;
$http({
method : "GET",
url : appConfig.appUri + "/projectTeam/getProjectDetails?projectId="+$scope.projectId
}).then(function mySuccess(response) {
$scope.gridOptions.data = response.data;
}, function myError(response) {
showAlert("Something went wrong while fetching data!!!");
$scope.gridOptions.data = [];
});
}else if(dataToPass.action == "UnAssigned"){}else if(dataToPass.action == "allocated"){}
$scope.cancel = function() {
$mdDialog.hide();
};
}
function showAlert(message) {
$mdDialog.show($mdDialog.alert().parent(
angular.element(document.querySelector('#popupContainer')))
.clickOutsideToClose(true).textContent(message).ariaLabel(
'Alert Dialog').ok('Ok'));
}
});
\ No newline at end of file
......@@ -22,14 +22,15 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
paginationPageSize : 10,
pageNumber: 1,
pageSize:10,
enableFiltering: true,
columnDefs : [
{field : 'projectId',displayName: 'Project ID', enableColumnMenu: true, enableSorting: true, width:120},
{field : 'projectName',displayName: 'Project ', enableColumnMenu: false, enableSorting: false},
{field : 'account',displayName: 'Account ', enableColumnMenu: false, enableSorting: false},
{field : 'projectId',displayName: 'Project ID', enableColumnMenu: false, enableSorting: false,enableFiltering:false, width:120},
{field : 'projectName',displayName: 'Project ', enableColumnMenu: false, enableSorting: true,enableFiltering:true},
{field : 'account',displayName: 'Account ', enableColumnMenu: false, enableSorting: true,enableFiltering:true},
//{field : 'managerId',displayName: 'Manager ID ', enableColumnMenu: false, enableSorting: false},
{field : 'managerName',displayName: 'Manager Name ', enableColumnMenu: false, enableSorting: false},
{field : 'status',displayName: 'Status ', enableColumnMenu: false, enableSorting: false},
{name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, width:130}
{field : 'managerName',displayName: 'Manager Name ', enableColumnMenu: false, enableSorting: true,enableFiltering:true},
{field : 'status',displayName: 'Status ', enableColumnMenu: false, enableSorting: true,enableFiltering:false},
{name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:130}
]
};
$scope.gridOptions.data = $scope.records;
......@@ -280,6 +281,7 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
$scope.managerId = dataToPass.managerId;
$scope.managerName = dataToPass.managerName;
$scope.projectStatus = dataToPass.status;
var getCellActiveTemplate='<div ng-show="COL_FIELD==true"><p class="col-lg-12">Y</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">N</p></div>';
$scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10,
......@@ -291,6 +293,7 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
{field : 'emailId',displayName: 'Email Id ', enableColumnMenu: false, enableSorting: false},
{field : 'experience',displayName: 'Exp', enableColumnMenu: true, enableSorting: true,width:80},
{field : 'designation',displayName: 'Designation ', enableColumnMenu: false, enableSorting: false},
{field : 'active',displayName: 'Status ', enableColumnMenu: false, enableSorting: false,cellTemplate: getCellActiveTemplate},
{field : 'billableStatus',displayName: 'Billability ', enableColumnMenu: false, enableSorting: false},
]
};
......
......@@ -257,7 +257,7 @@ myApp.controller("projectMyTeamController",function($scope, myFactory, $mdDialog
$scope.empEmail = dataToPass.emailId;
$scope.isDisabled = true;
}
$scope.roles = ["HR","Manager","Employee","HR Manager","Director","Lead"];
$scope.roles = ["Delivery Manager","Director","Employee","HR","HR Manager","Lead","Manager"];
$scope.shifts = myFactory.getShifts();//["Shift 1(09:00 AM - 06:00 PM)","Shift 2(03:30 PM - 12:30 PM)", "Shift 3(09:00 PM - 06:00 AM)"];
$scope.getSelectedRole = function(){
if ($scope.empRole !== undefined) {
......
......@@ -100,8 +100,10 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
$scope.isVisible = false;
$scope.gridOptions.data = response.data;
}else{
if(response.data.length >0 ){
$scope.isVisible = true;
$scope.avgLoginHrs = response.data[0].totalAvgTime +" Hrs";
}
$scope.gridOptions.data = response.data;
}
......@@ -159,6 +161,7 @@ myApp.controller("employeesController", function($scope, $http, myFactory, $mdDi
$scope.toDate = today;
$scope.gridOptions.data = [];
$scope.isVisible = false;
$scope.avgLoginHrs = "";
}
function treatAsUTC(date) {
......
......@@ -150,9 +150,9 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
function previewPdfReport(){
var pdfTemplate = '';
if($scope.pdfUrl != "No data available"){
pdfTemplate = '<ng-pdf template-url="templates/pdf-viewer.html" canvasid="pdf" scale="page-fit" page=1 style="width:940px;border-radius:5px;"></ng-pdf>';
pdfTemplate = '<ng-pdf template-url="templates/pdf-viewer.html" canvasid="pdf" scale="page-fit" page=1 style="width:99%;border-radius:5px;"></ng-pdf>';
}else{
pdfTemplate = '<p style="color: #fff; font-size: 1.35em; vertical-align: middle; margin-top: 200px; margin-left: 300px;">No data available for the search criteria...</p>';
pdfTemplate = '<p style="color: #fff; font-size: 1.35em; text-align: center;vertical-align:middle;position:relative;top:50%;">No data available for the search criteria...</p>';
}
$("#pdfReportPreview").html($compile(pdfTemplate)($scope));
$mdDialog.hide();
......@@ -233,8 +233,8 @@ myApp.controller("reportsController", function($scope, $http, myFactory, $mdDial
}
function setDefaults(){
var defaultTemplate = '<p id="reportMsg" style="color: #fff; font-size: 1.35em; opacity: 0.5; vertical-align: middle; margin-top: 200px;'+
'margin-left: 300px;">Please generate a report for preview.</p>';
var defaultTemplate = '<p id="reportMsg" style="color: #fff; font-size: 1.35em; opacity: 0.5; text-align:center;vertical-align:middle;position:relative;top:50%;'+
'">Please generate a report for preview.</p>';
$("#pdfReportPreview").html($compile(defaultTemplate)($scope));
$scope.searchId="";
}
......
myApp.controller('SessionController',
function($scope, Idle, Keepalive, myFactory, $mdDialog, $compile) {
$scope.started = false;
function closeModals() {
$mdDialog.hide();
if ($scope.warning) {
$scope.warning = null;
}
if ($scope.timedout) {
$scope.timedout = null;
}
}
$scope.$on('IdleStart', function() {
closeModals();
$scope.warning = showProgressDialog('Your session is exipired!!! Please wait redirecting to Login page.');
});
$scope.$on('IdleEnd', function() {
closeModals();
});
$scope.$on('IdleTimeout', function() {
closeModals();
$scope.timedout = redirectToLoginPage();
});
$scope.start = function() {
closeModals();
Idle.watch();
$scope.started = true;
};
$scope.stop = function() {
closeModals();
Idle.unwatch();
$scope.started = false;
};
function redirectToLoginPage() {
$mdDialog.hide();
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function() {
console.log('User signed out.');
});
auth2.disconnect();
// Clear if any values set to factory
var menuItems = [], designations = [], accounts = [], technologies = [], shifts = [];
myFactory.setEmpId("");
myFactory.setEmpName("");
myFactory.setEmpEmailId("");
myFactory.setEmpRole("");
myFactory.setMenuItems(menuItems);
myFactory.setTemplateUrl("");
myFactory.setProfileUrl("");
myFactory.setDesignations(designations);
myFactory.setAccounts(accounts);
myFactory.setTechnologies(technologies);
myFactory.setShifts(shifts);
var element = document.getElementById('home');
var path = "'templates/login.html'";
element.setAttribute("src", path);
var newTemplate = angular.element(element);
$('#home').html(newTemplate);
$compile($('#home'))($scope)
}
function showProgressDialog(msg) {
$('#home').addClass('md-scroll-mask');
$mdDialog.show({
templateUrl : 'templates/progressDialog.html',
controller : ProgressController,
parent : angular.element(document.body),
clickOutsideToClose : false,
locals : {
dataToPass : msg
}
});
}
function ProgressController($scope, dataToPass) {
$scope.progressText = dataToPass;
}
})
.config(function(IdleProvider, KeepaliveProvider, appConfig) {
IdleProvider.idle(appConfig.sessionIdle);
IdleProvider.timeout(appConfig.timeOut);
KeepaliveProvider.interval(appConfig.keepAlive);
});
\ No newline at end of file
This diff is collapsed.
......@@ -257,7 +257,6 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
$scope.managerName = "";
$scope.isDisabled = false;
}else if(dataToPass.action == "Update"){
//alert("dataToPass"+dataToPass)
$scope.projectId = dataToPass.projectId;
$scope.projectName = dataToPass.projectName;
$scope.managerId = dataToPass.managerId;
......@@ -268,11 +267,6 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
'employeeId': dataToPass.managerId
};
$scope.managerDetails = managers;
// $scope.managerModel.managerId=$scope.managerId;
// $scope.managerModel.employeeName=$scope.managerName;
//alert('$scope.managers'+$scope.managerDetails)
//alert('$scope.managerModel'+$scope.managerModel)
//$scope.managerModel.employeeName=dataToPass.managerName;
$scope.isDisabled = true;
}else if(dataToPass.action == "View"){
$scope.projectId = dataToPass.projectId;
......@@ -421,8 +415,6 @@ myApp.controller("viewProjectController",function($scope, myFactory,exportUiGrid
$scope.gridOptions.data = [];
});
}
//$scope.roles = ["HR","Manager","Employee"];
//$scope.shifts = ["Shift 1(09:00 AM - 06:00 PM)","Shift 2(03:30 PM - 12:30 PM)", "Shift 3(09:00 PM - 06:00 PM)"];
$scope.getManagers = function(){
if ($scope.managerModel !== undefined) {
return $scope.managerModel.employeeName;
......
This diff is collapsed.
......@@ -1856,7 +1856,7 @@ legend {
width: 100%;
padding: 0;
margin-bottom: 20px;
font-size: 21px;
/* font-size: 21px;*/
line-height: inherit;
color: #333333;
border: 0;
......
*{box-sizing: border-box;}
.wrapper {margin: 0 auto; width: 940px;background: #888; }
.pdf-controls { width: 99%; background: #888; padding: 1em;}
.wrapper {margin: -10px auto; background: #888; }
.pdf-controls { background: #888; padding: 1em;}
.rotate0 {-webkit-transform: rotate(0deg); transform: rotate(0deg);background: #888;
padding-left: 10px;}
.rotate90 {-webkit-transform: rotate(90deg); transform: rotate(90deg); background: #888;
......@@ -9,4 +9,4 @@
padding-left: 10px;}
.rotate270 {-webkit-transform: rotate(270deg); transform: rotate(270deg); background: #888;
padding-left: 10px;}
.fixed { position: fixed; top: 0; left: calc(50% - 480px); z-index: 100; width: 99%; padding: 1em; background: #888; width: 940px; }
\ No newline at end of file
.fixed { position: fixed; top: 0; left: calc(50% - 480px); z-index: 100; padding: 1em; background: #888; }
\ No newline at end of file
......@@ -70,3 +70,7 @@
.ui-grid-pager-control input{
width: 65px;
}
.customBilling {
background-color:green !important;
font-weight:bold;
}
\ No newline at end of file
This diff is collapsed.
var myApp = angular.module(
"myTimeApp",
[ "ngRoute", "ngCookies", "ui.grid", "ui.grid.pagination",
"ngMaterial", "ui.bootstrap", "pdf", 'ui.grid.selection', 'ui.grid.exporter' ]).config(
function($mdDateLocaleProvider) {
"ngMaterial", "ui.bootstrap", "pdf", 'ui.grid.selection', 'ui.grid.exporter','ui.grid.edit', 'ui.grid.cellNav','ngIdle' ]).config(
function($mdDateLocaleProvider) {
$mdDateLocaleProvider.formatDate = function(date) {
var day = date.getDate();
var month = date.getMonth() + 1;
......@@ -15,10 +16,13 @@ var myApp = angular.module(
//TODO: Replace this appUri with the domain name created
myApp.constant('appConfig', {
appName: "MyTime",
appUri: "http://192.168.15.17:8080/myTime/",
appUri: "http://192.168.10.177:8080/myTime/",
version:"1.0",
empStartId:16001,
empEndId:16999
empEndId:16999,
sessionIdle: 900,
timeOut: 3,
keepAlive: 5
});
myApp.factory('myFactory', function() {
......
//var app = angular.module('myTimeApp');
var app = angular.module('UiGridDatepicker');
app.filter('textDate', ['$filter', function ($filter) {
return function (input, format) {
var date = new Date(input);
return $filter('date')(date, format);
};
}]);
\ No newline at end of file
var app = angular.module('ui.grid.edit');
app.directive('uiGridEditDatepicker', ['$timeout', '$document', 'uiGridConstants', 'uiGridEditConstants', function($timeout, $document, uiGridConstants, uiGridEditConstants) {
return {
template: function(element, attrs) {
var html = '<div class="datepicker-wrapper" ><input type="text" uib-datepicker-popup datepicker-options="datepickerOptions" datepicker-append-to-body="true" is-open="isOpen" ng-model="datePickerValue" ng-change="changeDate($event)" popup-placement="auto top"/></div>';
return html;
},
require: ['?^uiGrid', '?^uiGridRenderContainer'],
scope: true,
compile: function() {
return {
pre: function($scope, $elm, $attrs) {
if ($attrs.datepickerOptions){
if ($scope.col.grid.appScope[$attrs.datepickerOptions]){
$scope.datepickerOptions = $scope.col.grid.appScope[$attrs.datepickerOptions];
}
}
},
post: function($scope, $elm, $attrs, controllers) {
var setCorrectPosition = function() {
var gridElement = $('.ui-grid-viewport');
var gridPosition = {
width: gridElement.outerWidth(),
height: gridElement.outerHeight(),
offset: gridElement.offset()
};
var cellElement = $($elm);
var cellPosition = {
width: cellElement.outerWidth(),
height: cellElement.outerHeight(),
offset: cellElement.offset()
};
var datepickerElement = $('body > .dropdown-menu, body > div > .dropdown-menu');
var datepickerPosition = {
width: datepickerElement.outerWidth(),
height: datepickerElement.outerHeight()
};
var setCorrectTopPositionInGrid = function() {
var topPosition;
var freePixelsOnBottom = gridPosition.height - (cellPosition.offset.top - gridPosition.offset.top) - cellPosition.height;
var freePixelsOnTop = gridPosition.height - freePixelsOnBottom - cellPosition.height;
var requiredPixels = (datepickerPosition.height - cellPosition.height) / 2;
if (freePixelsOnBottom >= requiredPixels && freePixelsOnTop >= requiredPixels) {
topPosition = cellPosition.offset.top - requiredPixels + 10;
} else if (freePixelsOnBottom >= requiredPixels && freePixelsOnTop < requiredPixels) {
topPosition = cellPosition.offset.top - freePixelsOnTop + 10;
} else {
topPosition = gridPosition.height - datepickerPosition.height + gridPosition.offset.top - 20;
}
return topPosition;
};
var setCorrectTopPositionInWindow = function() {
var topPosition;
var windowHeight = window.innerHeight - 10;
var freePixelsOnBottom = windowHeight - cellPosition.offset.top;
var freePixelsOnTop = windowHeight - freePixelsOnBottom - cellPosition.height;
var requiredPixels = (datepickerPosition.height - cellPosition.height) / 2;
if (freePixelsOnBottom >= requiredPixels && freePixelsOnTop >= requiredPixels) {
topPosition = cellPosition.offset.top - requiredPixels;
} else if (freePixelsOnBottom >= requiredPixels && freePixelsOnTop < requiredPixels) {
topPosition = cellPosition.offset.top - freePixelsOnTop;
} else {
topPosition = windowHeight - datepickerPosition.height - 10;
}
return topPosition;
};
var newOffsetValues = {};
var isFreeOnRight = (gridPosition.width - (cellPosition.offset.left - gridPosition.offset.left) - cellPosition.width) > datepickerPosition.width;
if (isFreeOnRight) {
newOffsetValues.left = cellPosition.offset.left + cellPosition.width;
} else {
newOffsetValues.left = cellPosition.offset.left - datepickerPosition.width;
}
if (datepickerPosition.height < gridPosition.height) {
newOffsetValues.top = setCorrectTopPositionInGrid();
} else {
newOffsetValues.top = setCorrectTopPositionInWindow();
}
datepickerElement.offset(newOffsetValues);
datepickerElement.css("visibility", "visible");
};
$timeout(function() {
setCorrectPosition();
}, 0);
$scope.datePickerValue = new Date($scope.row.entity[$scope.col.field]);
$scope.isOpen = true;
var uiGridCtrl = controllers[0];
var renderContainerCtrl = controllers[1];
var onWindowClick = function (evt) {
var classNamed = angular.element(evt.target).attr('class');
if (classNamed) {
var inDatepicker = (classNamed.indexOf('datepicker-calendar') > -1);
if (!inDatepicker && evt.target.nodeName !== "INPUT") {
$scope.stopEdit(evt);
}
}
else {
$scope.stopEdit(evt);
}
};
var onCellClick = function (evt) {
angular.element(document.querySelectorAll('.ui-grid-cell-contents')).off('click', onCellClick);
$scope.stopEdit(evt);
};
$scope.changeDate = function (evt) {
$scope.row.entity[$scope.col.field] = $scope.datePickerValue;
$scope.stopEdit(evt);
};
$scope.$on(uiGridEditConstants.events.BEGIN_CELL_EDIT, function () {
if (uiGridCtrl.grid.api.cellNav) {
uiGridCtrl.grid.api.cellNav.on.navigate($scope, function (newRowCol, oldRowCol) {
$scope.stopEdit();
});
} else {
angular.element(document.querySelectorAll('.ui-grid-cell-contents')).on('click', onCellClick);
}
angular.element(window).on('click', onWindowClick);
});
$scope.$on('$destroy', function () {
angular.element(window).off('click', onWindowClick);
$('body > .dropdown-menu, body > div > .dropdown-menu').remove();
});
$scope.stopEdit = function(evt) {
$scope.$emit(uiGridEditConstants.events.END_CELL_EDIT);
};
$elm.on('keydown', function(evt) {
switch (evt.keyCode) {
case uiGridConstants.keymap.ESC:
evt.stopPropagation();
$scope.$emit(uiGridEditConstants.events.CANCEL_CELL_EDIT);
break;
}
if (uiGridCtrl && uiGridCtrl.grid.api.cellNav) {
evt.uiGridTargetRenderContainerId = renderContainerCtrl.containerId;
if (uiGridCtrl.cellNav.handleKeyDown(evt) !== null) {
$scope.stopEdit(evt);
}
} else {
switch (evt.keyCode) {
case uiGridConstants.keymap.ENTER:
case uiGridConstants.keymap.TAB:
evt.stopPropagation();
evt.preventDefault();
$scope.stopEdit(evt);
break;
}
}
return true;
});
}
};
}
};
}]);
var app = angular.module('ui.grid.edit');
app.directive('uiGridEditDatepicker', ['$timeout', '$document', 'uiGridConstants', 'uiGridEditConstants', function($timeout, $document, uiGridConstants, uiGridEditConstants) {
return {
template: function(element, attrs) {
var html = '<div class="datepicker-wrapper" ><input type="text" uib-datepicker-popup datepicker-options="datepickerOptions" datepicker-append-to-body="true" is-open="isOpen" ng-model="datePickerValue" ng-change="changeDate($event)" popup-placement="auto top"/></div>';
return html;
},
require: ['?^uiGrid', '?^uiGridRenderContainer'],
scope: true,
compile: function() {
return {
pre: function($scope, $elm, $attrs) {
if ($attrs.datepickerOptions){
if ($scope.col.grid.appScope[$attrs.datepickerOptions]){
$scope.datepickerOptions = $scope.col.grid.appScope[$attrs.datepickerOptions];
}
}
},
post: function($scope, $elm, $attrs, controllers) {
var setCorrectPosition = function() {
var gridElement = $('.ui-grid-viewport');
var gridPosition = {
width: gridElement.outerWidth(),
height: gridElement.outerHeight(),
offset: gridElement.offset()
};
var cellElement = $($elm);
var cellPosition = {
width: cellElement.outerWidth(),
height: cellElement.outerHeight(),
offset: cellElement.offset()
};
var datepickerElement = $('body > .dropdown-menu, body > div > .dropdown-menu');
var datepickerPosition = {
width: datepickerElement.outerWidth(),
height: datepickerElement.outerHeight()
};
var setCorrectTopPositionInGrid = function() {
var topPosition;
var freePixelsOnBottom = gridPosition.height - (cellPosition.offset.top - gridPosition.offset.top) - cellPosition.height;
var freePixelsOnTop = gridPosition.height - freePixelsOnBottom - cellPosition.height;
var requiredPixels = (datepickerPosition.height - cellPosition.height) / 2;
if (freePixelsOnBottom >= requiredPixels && freePixelsOnTop >= requiredPixels) {
topPosition = cellPosition.offset.top - requiredPixels + 10;
} else if (freePixelsOnBottom >= requiredPixels && freePixelsOnTop < requiredPixels) {
topPosition = cellPosition.offset.top - freePixelsOnTop + 10;
} else {
topPosition = gridPosition.height - datepickerPosition.height + gridPosition.offset.top - 20;
}
return topPosition;
};
var setCorrectTopPositionInWindow = function() {
var topPosition;
var windowHeight = window.innerHeight - 10;
var freePixelsOnBottom = windowHeight - cellPosition.offset.top;
var freePixelsOnTop = windowHeight - freePixelsOnBottom - cellPosition.height;
var requiredPixels = (datepickerPosition.height - cellPosition.height) / 2;
if (freePixelsOnBottom >= requiredPixels && freePixelsOnTop >= requiredPixels) {
topPosition = cellPosition.offset.top - requiredPixels;
} else if (freePixelsOnBottom >= requiredPixels && freePixelsOnTop < requiredPixels) {
topPosition = cellPosition.offset.top - freePixelsOnTop;
} else {
topPosition = windowHeight - datepickerPosition.height - 10;
}
return topPosition;
};
var newOffsetValues = {};
var isFreeOnRight = (gridPosition.width - (cellPosition.offset.left - gridPosition.offset.left) - cellPosition.width) > datepickerPosition.width;
if (isFreeOnRight) {
newOffsetValues.left = cellPosition.offset.left + cellPosition.width;
} else {
newOffsetValues.left = cellPosition.offset.left - datepickerPosition.width;
}
if (datepickerPosition.height < gridPosition.height) {
newOffsetValues.top = setCorrectTopPositionInGrid();
} else {
newOffsetValues.top = setCorrectTopPositionInWindow();
}
datepickerElement.offset(newOffsetValues);
datepickerElement.css("visibility", "visible");
};
$timeout(function() {
setCorrectPosition();
}, 0);
$scope.datePickerValue = new Date($scope.row.entity[$scope.col.field]);
$scope.isOpen = true;
var uiGridCtrl = controllers[0];
var renderContainerCtrl = controllers[1];
var onWindowClick = function (evt) {
var classNamed = angular.element(evt.target).attr('class');
if (classNamed) {
var inDatepicker = (classNamed.indexOf('datepicker-calendar') > -1);
if (!inDatepicker && evt.target.nodeName !== "INPUT") {
$scope.stopEdit(evt);
}
}
else {
$scope.stopEdit(evt);
}
};
var onCellClick = function (evt) {
angular.element(document.querySelectorAll('.ui-grid-cell-contents')).off('click', onCellClick);
$scope.stopEdit(evt);
};
$scope.changeDate = function (evt) {
$scope.row.entity[$scope.col.field] = $scope.datePickerValue;
$scope.stopEdit(evt);
};
$scope.$on(uiGridEditConstants.events.BEGIN_CELL_EDIT, function () {
if (uiGridCtrl.grid.api.cellNav) {
uiGridCtrl.grid.api.cellNav.on.navigate($scope, function (newRowCol, oldRowCol) {
$scope.stopEdit();
});
} else {
angular.element(document.querySelectorAll('.ui-grid-cell-contents')).on('click', onCellClick);
}
angular.element(window).on('click', onWindowClick);
});
$scope.$on('$destroy', function () {
angular.element(window).off('click', onWindowClick);
$('body > .dropdown-menu, body > div > .dropdown-menu').remove();
});
$scope.stopEdit = function(evt) {
$scope.$emit(uiGridEditConstants.events.END_CELL_EDIT);
};
$elm.on('keydown', function(evt) {
switch (evt.keyCode) {
case uiGridConstants.keymap.ESC:
evt.stopPropagation();
$scope.$emit(uiGridEditConstants.events.CANCEL_CELL_EDIT);
break;
}
if (uiGridCtrl && uiGridCtrl.grid.api.cellNav) {
evt.uiGridTargetRenderContainerId = renderContainerCtrl.containerId;
if (uiGridCtrl.cellNav.handleKeyDown(evt) !== null) {
$scope.stopEdit(evt);
}
} else {
switch (evt.keyCode) {
case uiGridConstants.keymap.ENTER:
case uiGridConstants.keymap.TAB:
evt.stopPropagation();
evt.preventDefault();
$scope.stopEdit(evt);
break;
}
}
return true;
});
}
};
}
};
}]);
......@@ -2,7 +2,7 @@
<form ng-cloak name="myForm">
<md-toolbar>
<div class="md-toolbar-tools" style="background: cadetblue;">
<h2>{{templateTitle}} Employee</h2>
<h2>{{templateTitle}} Team Mate</h2>
<span flex></span>
<md-button class="md-icon-button" ng-click="cancel()"> <i
class="fa fa-times fa-2x"
......@@ -18,6 +18,9 @@
<output>Employee Id : {{employeeId}}</output>
<output>Email Id : {{emailId}}</output>
<output>Role : {{role}}</output>
<output>Designation : {{designation}}</output>
<output>Experience : {{experience}}</output>
<output>Mobile Number : {{mobileNumber}}</output>
<md-select ng-model="projectModel"
md-selected-text="getProjectSelected()" id="selectProject">
<md-optgroup label="Project"> <md-option
......@@ -26,16 +29,16 @@
<md-select ng-model="shift" md-selected-text="getSelectedShift()" id="empShift">
<md-optgroup label="shifts"> <md-option ng-value="shift"
ng-repeat="shift in shifts">{{shift}}</md-option> </md-optgroup> </md-select>
<md-select ng-model="empDesignation" md-selected-text="getSelectedDesignation()" id="empDesignation">
<!-- <md-select ng-model="empDesignation" md-selected-text="getSelectedDesignation()" id="empDesignation">
<md-optgroup label="designations"> <md-option ng-value="designation"
ng-repeat="designation in designations">{{designation}}</md-option> </md-optgroup> </md-select>
ng-repeat="designation in designations">{{designation}}</md-option> </md-optgroup> </md-select> -->
<md-select ng-model="empBillableStatus" md-selected-text="getSelectedBillableStatus()" id="empBillableStatus">
<md-optgroup label="billable statuses"> <md-option ng-value="billableStatus"
ng-repeat="billableStatus in billableStatuses">{{billableStatus}}</md-option> </md-optgroup> </md-select>
<input type="text" class="form-control" id="experience"
<!-- <input type="text" class="form-control" id="experience"
name="experience" ng-model="experience" placeholder="Experience" /><br>
<input type="text" class="form-control" id="mobileNumber"
name="mobileNumber" ng-model="mobileNumber" placeholder="MobileNumber" /><br>
name="mobileNumber" ng-model="mobileNumber" placeholder="MobileNumber" /><br> -->
<div role="alert">
<span class="error" style="color: red;">{{alertMsg}}</span>
</div>
......
<md-dialog aria-label="Team Details" style="width:1200px;height:650px;">
<form ng-cloak name="myForm">
<md-toolbar>
<div class="md-toolbar-tools"
style="background: cadetblue;">
<h2>Billing Details </h2>
<span flex></span>
<md-button class="md-icon-button" ng-click="cancel()"> <i
class="fa fa-times fa-2x"
style="margin-top: 5px; font-size: 1.5em; float: left"></i> </md-button>
</div>
</md-toolbar>
<md-dialog-content>
<div class="md-dialog-content">
<div class="form-group">
<div class="row col-lg-12" style="margin-left: 0px;">
<div class="row col-lg-12">
<div class="col-xs-4">
<p>
<b>Employee Id:</b> {{employeeId}}
</p>
</div>
<div class="col-xs-4" style="margin-left: 0px;">
<p>
<b>Employee Name:</b>&nbsp;&nbsp;&nbsp; {{employeeName}}
</p>
</div>
<div class="col-xs-4" style="margin-left: 0px;">
<p>
<b>Project Name:</b>&nbsp;&nbsp;&nbsp; {{projectName}}
</p>
</div>
</div>
<div class="row col-lg-12">
<div class="row col-lg-12" style="margin-left: -25px;">
<div class="col-xs-4" style="margin-left: 0px;">
<md-button class="md-raised" ng-click="toggleBillability()" style="width:220px;background: cadetblue;color:white;">Add Billability </md-button>
</div>
</div>
<div class="row col-lg-12" ng-show="showBillable" style="margin-left: 10px;border: 2px solid #999;margin-right: 100px">
<div class="row col-lg-12" >
<div class="col-xs-12" style="margin-left: 20px;">
<p>
<b>Please enter new billing details:</b>
</p>
</div>
</div>
<div class="row col-lg-12" >
<div class="col-xs-4" style="margin-left: 100px;">
<p>
<b>Start Date:</b>
<md-datepicker ng-model="fromDate" md-placeholder="Enter date"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
></md-datepicker>
</p>
</div>
<div class="col-xs-4" style="margin-left: 100px;">
<p>
<b>End Date:</b>
<md-datepicker ng-model="toDate" md-placeholder="Enter date"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
></md-datepicker>
</p>
</div>
</div>
<div class="row col-lg-12" >
<div class="col-xs-12" align="center">
<p >
<md-button class="md-raised" ng-click="addBilling()" style="width:120px;background: cadetblue;color:white;">Add </md-button>
</p>
</div>
</div>
</div>
<div class="row col-lg-12"><br/>
<div id="gridTest" ui-grid="gridOptions" ui-grid-edit ui-grid-pagination class="grid"
style="width:99%;height:280px;margin-left:10px;">
<div class="watermark" ng-show="!gridOptions.data.length">No
data available</div>
</div>
</div>
</div>
</div>
</md-dialog-content>
<md-dialog-actions layout="row"> <md-button class="md-raised" ng-click="cancel()" style="width:120px;background: cadetblue;color:white;">
Close </md-button> </md-dialog-actions>
</form>
</md-dialog>
\ No newline at end of file
<md-dialog aria-label="Role Template" style="width:520px;height:740px;" ng-init="getProjects();getProjectsP()">
<form ng-cloak name="myForm">
<md-toolbar>
<div class="md-toolbar-tools"
style="background: cadetblue;">
<h2>{{templateTitle}} Travel Request </h2>
<span flex></span>
<md-button class="md-icon-button" ng-click="cancel()"> <i
class="fa fa-times fa-2x"
style="margin-top: 5px; font-size: 1.5em; float: left"></i> </md-button>
</div>
</md-toolbar>
<md-dialog-content>
<div class="md-dialog-content">
<div class="form-group">
<md-select ng-model="projectModel" md-selected-text="getProjectSelected()" id="selectProject" ng-change="fetchEmpVisa()">
<md-optgroup label="Visa"> <md-option ng-value="project"
ng-repeat="project in projectList">{{project.visaName}}</md-option> </md-optgroup> </md-select>
<md-select ng-model="employeeModel" md-selected-text="getEmployeeSelected()" id="selectEmp">
<md-optgroup label="Employee"> <md-option ng-value="employee"
ng-repeat="employee in employeeList">{{employee.employeeName}}</md-option> </md-optgroup> </md-select>
<output>Employee Name : {{employeeModel.employeeName}}</output>
<output>Employee Id : {{employeeModel.employeeId}}</output>
<output>Email Id : {{employeeModel.emailId}}</output>
<output>Role : {{employeeModel.role}}</output>
<output>Designation : {{employeeModel.designation}}</output><br>
<input type="text" class="form-control" id=fromLocation name="fromLocation"
ng-model="fromLocation" placeholder="From Location" /><br>
<input type="text" class="form-control" id=toLocation name="toLocation"
ng-model="toLocation" placeholder="To Location" /><br>
<input type="text" class="form-control" id=buddy name="buddy"
ng-model="buddy" placeholder="Buddy" /><br>
<md-select ng-model="account" md-selected-text="getAccountText()" id="account">
<md-optgroup label="account"> <md-option ng-value="account"
ng-repeat="account in accounts">{{account}}</md-option> </md-optgroup> </md-select>
<md-select ng-model="projectModelP" md-selected-text="getProjectSelectedP()" id="selectProjectP">
<md-optgroup label="Project"> <md-option ng-value="projectP"
ng-repeat="projectP in projectListP">{{projectP.projectName}}</md-option> </md-optgroup> </md-select>
<md-datepicker ng-model="travelDate" md-placeholder="Travel Date"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
></md-datepicker>
<md-datepicker ng-model="returnDate" md-placeholder="Return date"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
></md-datepicker>
<md-select ng-model="visaStatus" md-selected-text="getVisaStatus()" id="visaStatus">
<md-optgroup label="visaStatus"> <md-option ng-value="visaStatus"
ng-repeat="visaStatus in travelStatuses">{{visaStatus}}</md-option> </md-optgroup> </md-select>
<input type="text" class="form-control" id="comments" name="comments"
ng-model="comments" placeholder="Comments" />
<div role="alert">
<span class="error" style="color: red;">{{alertMsg}}</span>
</div>
</div>
</div>
</md-dialog-content>
<md-dialog-actions layout="row"> <md-button
class="md-raised" data-ng-click="validateFields(templateTitle)" style="width:120px;background: cadetblue;color:white;">
{{templateTitle}} </md-button> <md-button class="md-raised" ng-click="cancel()" style="width:120px;background: cadetblue;color:white;">
Cancel </md-button> </md-dialog-actions>
</form>
</md-dialog>
<md-dialog aria-label="Role Template" style="width:520px;height:640px;" ng-init="getProjects()">
<form ng-cloak name="myForm">
<md-toolbar>
<div class="md-toolbar-tools"
style="background: cadetblue;">
<h2>{{templateTitle}} Visa Details </h2>
<span flex></span>
<md-button class="md-icon-button" ng-click="cancel()"> <i
class="fa fa-times fa-2x"
style="margin-top: 5px; font-size: 1.5em; float: left"></i> </md-button>
</div>
</md-toolbar>
<md-dialog-content>
<div class="md-dialog-content">
<div class="form-group">
<md-select ng-model="projectModel" md-selected-text="getProjectSelected()" id="selectProject">
<md-optgroup label="Visa"> <md-option ng-value="project"
ng-repeat="project in projectList">{{project.visaName}}</md-option> </md-optgroup> </md-select>
<md-select ng-model="employeeModel" md-selected-text="getEmployeeSelected()" id="selectEmp">
<md-optgroup label="Employee"> <md-option ng-value="employee"
ng-repeat="employee in employeeList">{{employee.employeeName}}</md-option> </md-optgroup> </md-select>
<output>Employee Name : {{employeeModel.employeeName}}</output>
<output>Employee Id : {{employeeModel.employeeId}}</output>
<output>Email Id : {{employeeModel.emailId}}</output>
<output>Role : {{employeeModel.role}}</output>
<output>Designation : {{employeeModel.designation}}</output><br>
<input type="text" class="form-control" id="visaNo" name="visaNo"
ng-model="visaNo" placeholder="Visa No" />
<md-datepicker ng-model="expiryDate" md-placeholder="Expiry date"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
></md-datepicker>
<md-select ng-model="visaStatus" md-selected-text="getVisaStatus()" id="visaStatus">
<md-optgroup label="visaStatus"> <md-option ng-value="visaStatus"
ng-repeat="visaStatus in visaStatuses">{{visaStatus}}</md-option> </md-optgroup> </md-select>
<input type="text" class="form-control" id="comments" name="comments"
ng-model="comments" placeholder="Comments" />
<div role="alert">
<span class="error" style="color: red;">{{alertMsg}}</span>
</div>
</div>
</div>
</md-dialog-content>
<md-dialog-actions layout="row"> <md-button
class="md-raised" data-ng-click="validateFields(templateTitle)" style="width:120px;background: cadetblue;color:white;">
{{templateTitle}} </md-button> <md-button class="md-raised" ng-click="cancel()" style="width:120px;background: cadetblue;color:white;">
Cancel </md-button> </md-dialog-actions>
</form>
</md-dialog>
......@@ -13,9 +13,10 @@
</div>
</div>
<br />
<div class="container" style="text-align: center; padding-left: 75px;">
<div class="text-center">
<div class="row col-lg-12">
<div class="col-xs-4">
<div class="col-lg-3"></div>
<div class="col-lg-4 col-xs-12">
<p>
<b>Search Date:</b>
<md-datepicker ng-model="reportDate" md-placeholder="Enter date"
......@@ -23,39 +24,30 @@
onkeydown="return false" ng-change="setSearchDate(reportDate)"></md-datepicker>
</p>
</div>
<div class="col-xs-2" style="cursor: pointer;" align="right">
<div class="col-lg-2 col-xs-12" style="cursor: pointer;" align="right">
<md-button class="md-raised md-primary"
style="width:100px;background: cadetblue;" ng-click="getEmployeePresent('onclick')">
<i class="fa fa-search fa-2x"
style="margin-top: 5px; font-size: 1.5em; float: left"></i> Search</md-button>
</div>
<div class="col-lg-3"></div>
</div>
<div class="row col-lg-12" style="height: 15px;"></div>
<div class="row col-lg-12">
<div class="col-xs-2">
<div class="col-lg-3"></div>
<div class="col-lg-2 col-xs-12">
<p>
<b>Total Present:</b> {{totalPresent}}
</p>
</div>
<div class="col-xs-2">
<div class="col-lg-2 col-xs-12">
<p>
<b>Total Absent:</b> {{totalAbsent}}
</p>
</div>
<div class="col-lg-5"></div>
</div>
<div class="row col-lg-12" style="height: 15px;"></div>
<div class="row col-lg-12">
<div class="col-xs-3"></div>
<div class="col-xs-1">
<p></p>
</div>
<div class="col-xs-2">
<p></p>
</div>
<div class="col-xs-2">
<p></p>
</div>
</div>
</div>
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination ui-grid-selection ui-grid-exporter
class="myGrid" style="width:99%;height:330px;">
......
This diff is collapsed.
This diff is collapsed.
......@@ -2,12 +2,12 @@
<nav class="navbar navbar-fixed-bottom navbar-inverse"
role="navigation">
<div class="row col-lg-12">
<div class="col-lg-11">
<p style="text-align: center; margin: 15px 15px 15px 100px;">&copy Nisum
Consulting Pvt Ltd 2017-18</p>
<div class="col-lg-11 col-xs-8 text-center">
<p style="padding-top:15px;">&copy Nisum
Consulting Ltd 2018</p>
</div>
<div class="col-lg-1">
<img src="images/logo.png" style="width:180px;height:45px;margin-left:-65px;"/>
<div class="col-lg-1 col-xs-2">
<img class="img img-rounded" src="images/logo.png" style="width:180px;height:45px;margin-left:-55px;"/>
</div>
</div>
</nav>
......
This diff is collapsed.
This diff is collapsed.
......@@ -15,7 +15,7 @@
<div class="md-dialog-content">
<div class="form-group">
<input type="text" class="form-control" id="projectId" name="projectId"
ng-model="projectId" placeholder="Project Id Auto Generated" ng-blur="" ng-disabled="true"/> <br>
ng-model="projectId" placeholder="Project Id Auto Generates" ng-blur="" ng-disabled="true"/> <br>
<input type="text" class="form-control" id="projectName" name="projectName"
ng-model="projectName" placeholder="Project Name" /><br>
<md-select ng-model="account" md-selected-text="getAccountText()" id="account">
......
......@@ -24,6 +24,7 @@
<output>Employee Id : {{employeeModel.employeeId}}</output>
<output>Email Id : {{employeeModel.emailId}}</output>
<output>Role : {{employeeModel.role}}</output>
<output>Designation : {{employeeModel.designation}}</output>
<div role="alert">
<span class="error" style="color: red;">{{alertMsg}}</span>
......
This diff is collapsed.
......@@ -31,8 +31,8 @@
<div class="row col-lg-12" style="height: 15px;"></div>
<div class="row col-lg-12" style="margin-left: 0px;">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="myGrid" style="width:99%;height:380px;">
<div id="gridTest" ui-grid="gridOptions" ui-grid-edit ui-grid-cellNav ui-grid-pagination
class="grid" style="width:99%;height:380px;">
<div class="watermark" ng-show="!gridOptions.data.length">No
data available</div>
</div>
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment