Compare commits

...

19 Commits

Author SHA1 Message Date
Thilina Hasantha
9ffa8617e9 Adding overtime report classes 2016-03-13 23:55:54 +05:30
Thilina Hasantha
f25a3ffd75 Adding overtime report classes 2016-03-13 23:32:05 +05:30
Thilina Hasantha
712b2025f1 Adding some sample data for attendance 2016-03-13 13:36:40 +05:30
Thilina Hasantha
0b37e9b573 Change release version 2016-03-13 13:34:22 +05:30
Thilina Hasantha
c1cd17d7b0 Update all reports 2016-03-13 13:28:41 +05:30
Thilina Hasantha
43533c6570 Changes to db scripts 2016-03-13 13:19:08 +05:30
Thilina Hasantha
2041071d00 Release note v15.2
------------------

### Features
 * Overtime Reports
 * Overtime calculation for california

### Fixes
 * Fix issue: uncaught error when placeholder value is empty
 * Log email sending success status
 * Fix broken longer company name issue
 * Make the application accessible when client on an intranet with no internet connection
 * Fix issue: when a module is disabled other modules depend on it stops working
2016-03-13 12:30:20 +05:30
Thilina Hasantha
78faf64770 Fix sql issue 2016-02-25 15:31:10 +05:30
Thilina Hasantha
e2368e526b Fix timesheet report issue 2016-02-09 05:07:35 +05:30
Thilina Hasantha
76b3aff37d Adding upgrade scripts 2016-02-08 05:52:54 +05:30
Thilina Hasantha
078396d5d7 Upgrade to v15.0.OS 2016-02-08 04:25:58 +05:30
Thilina Hasantha
b99b6f6f77 Update Readme 2015-12-29 07:35:48 +05:30
Thilina Hasantha
4c97461ec6 Remove non functional dashboard icon 2015-12-27 05:56:28 +05:30
Thilina Hasantha
5b728aa551 Add purchase modules 2015-12-27 05:15:41 +05:30
Thilina Hasantha
cdbea02b46 Add purchase modules 2015-12-27 05:09:33 +05:30
Thilina Hasantha
e46aca54f9 Add quick access menu 2015-12-27 05:05:08 +05:30
Thilina Hasantha
cfdaeaad50 Add salary module 2015-12-27 05:03:40 +05:30
Thilina Hasantha
09071a0f21 Fix dashboard message 2015-12-27 04:48:05 +05:30
Thilina Hasantha
785c210c4e Travel report added 2015-12-27 04:47:35 +05:30
112 changed files with 22725 additions and 1732 deletions

View File

@@ -9,9 +9,9 @@ define('HOME_LINK_ADMIN', CLIENT_BASE_URL."?g=admin&n=dashboard&m=admin_Admin");
define('HOME_LINK_OTHERS', CLIENT_BASE_URL."?g=modules&n=dashboard&m=module_Personal_Information");
//Version
define('VERSION', '14.0.OS');
define('CACHE_VALUE', '14.0.OS');
define('VERSION_DATE', '12/12/2015');
define('VERSION', '15.2.OS');
define('CACHE_VALUE', '15.2.OS');
define('VERSION_DATE', '12/03/2016');
if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','icehrm@gamonoid.com');}
if(!defined('KEY_PREFIX')){define('KEY_PREFIX','IceHrm');}

View File

@@ -0,0 +1,586 @@
ALTER table `Reports` ADD COLUMN `report_group` varchar(500) NULL;
ALTER table `Employees` ADD COLUMN `indirect_supervisors` VARCHAR(250) default null after `supervisor`;
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Leave: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve leave requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Default Country', '0', 'Set the default Country','[ "value", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}]');
UPDATE Reports set report_group = 'Employee Information' where name = 'Employee Details Report';
UPDATE Reports set report_group = 'Leave Management' where name = 'Employee Leaves Report';
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Time Entry Report';
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Attendance Report';
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Time Tracking Report';
UPDATE Reports set report_group = 'Employee Information' where name = 'Active Employee Report';
UPDATE Reports set report_group = 'Employee Information' where name = 'New Hires Employee Report';
UPDATE Reports set report_group = 'Employee Information' where name = 'Terminated Employee Report';
UPDATE Reports set report_group = 'Leave Management' where name = 'Employee Leave Entitlement';
UPDATE Reports set report_group = 'Travel and Expense Management' where name = 'Travel Request Report';
UPDATE Reports set report_group = 'Travel and Expense Management' where name = 'Expense Report';
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Employee Time Sheet Report', 'This report list all employee time sheets by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]', 'EmployeeTimeSheetData', '["employee","date_start","date_end","status"]', 'Class','Time Management');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Files: Upload Files to S3', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Files: Amazon S3 Key for File Upload', '', 'Please provide S3 Key for uploading files',''),
('Files: Amazone S3 Secret for File Upload', '', 'Please provide S3 Secret for uploading files',''),
('Files: S3 Bucket', '', 'Please provide S3 Bucket name for uploading files',''),
('Files: S3 Web Url', '', 'Please provide Url to the s3 bucket','');
create table `Crons` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`class` varchar(100) NOT NULL,
`lastrun` DATETIME default '0000-00-00 00:00:00',
`frequency` int(4) NOT NULL,
`time` varchar(50) NOT NULL,
`type` enum('Minutely','Hourly','Daily','Weekly','Monthly','Yearly') default 'Hourly',
`status` enum('Enabled','Disabled') default 'Enabled',
primary key (`id`),
key `KEY_Crons_frequency` (`frequency`)
) engine=innodb default charset=utf8;
INSERT INTO `Crons` (`name`,`class`, `lastrun`, `frequency`, `time`, `type`, `status`) VALUES
('Email Sender Task', 'EmailSenderTask', NULL, 1, 1, 'Minutely', 'Enabled'),
('Document Expire Alert', 'DocumentExpiryNotificationTask', NULL, 1, 1, 'Minutely', 'Enabled');
create table `LeaveTypes` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`supervisor_leave_assign` enum('Yes','No') default 'Yes',
`employee_can_apply` enum('Yes','No') default 'Yes',
`apply_beyond_current` enum('Yes','No') default 'Yes',
`leave_accrue` enum('No','Yes') default 'No',
`carried_forward` enum('No','Yes') default 'No',
`default_per_year` decimal(10,3) NOT NULL,
`carried_forward_percentage` int(11) NULL default 0,
`carried_forward_leave_availability` int(11) NULL default 365,
`propotionate_on_joined_date` enum('No','Yes') default 'No',
`send_notification_emails` enum('Yes','No') default 'Yes',
`leave_group` bigint(20) NULL,
`leave_color` varchar(10) NULL,
`max_carried_forward_amount` int(11) NULL default 0,
primary key (`id`),
unique key (`name`)
) engine=innodb default charset=utf8;
create table `LeaveRules` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`leave_type` bigint(20) NOT NULL,
`job_title` bigint(20) NULL,
`employment_status` bigint(20) NULL,
`employee` bigint(20) NULL,
`supervisor_leave_assign` enum('Yes','No') default 'Yes',
`employee_can_apply` enum('Yes','No') default 'Yes',
`apply_beyond_current` enum('Yes','No') default 'Yes',
`leave_accrue` enum('No','Yes') default 'No',
`carried_forward` enum('No','Yes') default 'No',
`default_per_year` decimal(10,3) NOT NULL,
`carried_forward_percentage` int(11) NULL default 0,
`carried_forward_leave_availability` int(11) NULL default 365,
`propotionate_on_joined_date` enum('No','Yes') default 'No',
`leave_group` bigint(20) NULL,
`max_carried_forward_amount` int(11) NULL default 0,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `LeaveGroups` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `LeaveGroupEmployees` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`leave_group` bigint(20) NOT NULL,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
CONSTRAINT `Fk_LeaveGroupEmployees_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_LeaveGroupEmployees_LeaveGroups` FOREIGN KEY (`leave_group`) REFERENCES `LeaveGroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`),
unique key `LeaveGroupEmployees_employee` (`employee`)
) engine=innodb default charset=utf8;
create table `LeavePeriods` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`date_start` date default '0000-00-00',
`date_end` date default '0000-00-00',
`status` enum('Active','Inactive') default 'Inactive',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `WorkDays` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`status` enum('Full Day','Half Day','Non-working Day') default 'Full Day',
`country` bigint(20) DEFAULT NULL,
primary key (`id`),
unique key `workdays_name_country` (`name`,`country`)
) engine=innodb default charset=utf8;
create table `HoliDays` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`dateh` date default '0000-00-00',
`status` enum('Full Day','Half Day') default 'Full Day',
`country` bigint(20) DEFAULT NULL,
primary key (`id`),
unique key `holidays_dateh_country` (`dateh`,`country`)
) engine=innodb default charset=utf8;
create table `EmployeeLeaves` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`leave_type` bigint(20) NOT NULL,
`leave_period` bigint(20) NOT NULL,
`date_start` date default '0000-00-00',
`date_end` date default '0000-00-00',
`details` text default null,
`status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
`attachment` varchar(100) NULL,
CONSTRAINT `Fk_EmployeeLeaves_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeLeaves_LeaveTypes` FOREIGN KEY (`leave_type`) REFERENCES `LeaveTypes` (`id`),
CONSTRAINT `Fk_EmployeeLeaves_LeavePeriods` FOREIGN KEY (`leave_period`) REFERENCES `LeavePeriods` (`id`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeLeaveLog` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee_leave` bigint(20) NOT NULL,
`user_id` bigint(20) NULL,
`data` varchar(500) NOT NULL,
`status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
`status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
`created` timestamp default '0000-00-00 00:00:00',
CONSTRAINT `Fk_EmployeeLeaveLog_EmployeeLeaves` FOREIGN KEY (`employee_leave`) REFERENCES `EmployeeLeaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeLeaveLog_Users` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeLeaveDays` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee_leave` bigint(20) NOT NULL,
`leave_date` date default '0000-00-00',
`leave_type` enum('Full Day','Half Day - Morning','Half Day - Afternoon','1 Hour - Morning','2 Hours - Morning','3 Hours - Morning','1 Hour - Afternoon','2 Hours - Afternoon','3 Hours - Afternoon') NOT NULL,
CONSTRAINT `Fk_EmployeeLeaveDays_EmployeeLeaves` FOREIGN KEY (`employee_leave`) REFERENCES `EmployeeLeaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Documents` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
`expire_notification` enum('Yes','No') default 'Yes',
`expire_notification_month` enum('Yes','No') default 'Yes',
`expire_notification_week` enum('Yes','No') default 'Yes',
`expire_notification_day` enum('Yes','No') default 'Yes',
`sign` enum('Yes','No') default 'Yes',
`sign_label` VARCHAR(500) default null,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeDocuments` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`document` bigint(20) NULL,
`date_added` date NOT NULL,
`valid_until` date NOT NULL,
`status` enum('Active','Inactive','Draft') default 'Active',
`details` text default null,
`attachment` varchar(100) NULL,
`signature` text default null,
`expire_notification_last` int(4) NULL,
CONSTRAINT `Fk_EmployeeDocuments_Documents` FOREIGN KEY (`document`) REFERENCES `Documents` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeDocuments_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`),
KEY `KEY_EmployeeDocuments_valid_until` (`valid_until`),
KEY `KEY_EmployeeDocuments_valid_until_status` (`valid_until`,`status`,`expire_notification_last`)
) engine=innodb default charset=utf8;
create table `CompanyDocuments` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
`valid_until` date NOT NULL,
`status` enum('Active','Inactive','Draft') default 'Active',
`notify_employees` enum('Yes','No') default 'Yes',
`attachment` varchar(100) NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Courses` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`code` varchar(300) NOT NULL,
`name` varchar(300) NOT NULL,
`description` text default null,
`coordinator` bigint(20) NULL,
`trainer` varchar(300) NULL,
`trainer_info` text default null,
`paymentType` enum('Company Sponsored','Paid by Employee') default 'Company Sponsored',
`currency` varchar(3) null,
`cost` decimal(12,2) DEFAULT 0.00,
`status` enum('Active','Inactive') default 'Active',
`created` datetime default '0000-00-00 00:00:00',
`updated` datetime default '0000-00-00 00:00:00',
CONSTRAINT `Fk_Courses_Employees` FOREIGN KEY (`coordinator`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `TrainingSessions` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(300) NOT NULL,
`course` bigint(20) NOT NULL,
`description` text default null,
`scheduled` datetime default '0000-00-00 00:00:00',
`dueDate` datetime default '0000-00-00 00:00:00',
`deliveryMethod` enum('Classroom','Self Study','Online') default 'Classroom',
`deliveryLocation` varchar(500) NULL,
`status` enum('Pending','Approved','Completed','Cancelled') default 'Pending',
`attendanceType` enum('Sign Up','Assign') default 'Sign Up',
`attachment` varchar(300) NULL,
`created` datetime default '0000-00-00 00:00:00',
`updated` datetime default '0000-00-00 00:00:00',
`requireProof` enum('Yes','No') default 'Yes',
CONSTRAINT `Fk_TrainingSessions_Courses` FOREIGN KEY (`course`) REFERENCES `Courses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeTrainingSessions` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`trainingSession` bigint(20) NULL,
`feedBack` varchar(1500) NULL,
`status` enum('Scheduled','Attended','Not-Attended','Completed') default 'Scheduled',
`proof` varchar(300) NULL,
CONSTRAINT `Fk_EmployeeTrainingSessions_TrainingSessions` FOREIGN KEY (`trainingSession`) REFERENCES `TrainingSessions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeTrainingSessions_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployementType` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Industry` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `ExperienceLevel` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `JobFunction` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EducationLevel` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Benifits` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Tags` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(250) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Job` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(200) NOT NULL,
`shortDescription` text DEFAULT NULL,
`description` text DEFAULT NULL,
`requirements` text DEFAULT NULL,
`benefits` text DEFAULT NULL,
`country` bigint(20) DEFAULT NULL,
`company` bigint(20) DEFAULT NULL,
`department` VARCHAR(100) NULL,
`code` VARCHAR(20) NULL,
`employementType` bigint(20) DEFAULT NULL,
`industry` bigint(20) DEFAULT NULL,
`experienceLevel` bigint(20) DEFAULT NULL,
`jobFunction` bigint(20) DEFAULT NULL,
`educationLevel` bigint(20) DEFAULT NULL,
`currency` bigint(20) DEFAULT NULL,
`showSalary` enum('Yes','No') default NULL,
`salaryMin` bigint(20) DEFAULT NULL,
`salaryMax` bigint(20) DEFAULT NULL,
`keywords` text DEFAULT NULL,
`status` enum('Active','On hold','Closed') default NULL,
`closingDate` DATETIME default '0000-00-00 00:00:00',
`attachment` varchar(100) NULL,
`display` varchar(200) NOT NULL,
`postedBy` bigint(20) DEFAULT NULL,
INDEX `Job_status` (`status`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Candidates` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`first_name` varchar(100) default '' not null,
`last_name` varchar(100) default '' not null,
`nationality` bigint(20) default null,
`birthday` DATETIME default '0000-00-00 00:00:00',
`gender` enum('Male','Female') default NULL,
`marital_status` enum('Married','Single','Divorced','Widowed','Other') default NULL,
`address1` varchar(100) default '',
`address2` varchar(100) default '',
`city` varchar(150) default '',
`country` char(2) default null,
`province` bigint(20) default null,
`postal_code` varchar(20) default null,
`email` varchar(200) default null,
`home_phone` varchar(50) default null,
`mobile_phone` varchar(50) default null,
`cv_title` varchar(200) default '' not null,
`cv` varchar(150) NULL,
`cvtext` text NULL,
`industry` text DEFAULT NULL,
`profileImage` varchar(150) NULL,
`head_line` text DEFAULT NULL,
`objective` text DEFAULT NULL,
`work_history` text DEFAULT NULL,
`education` text DEFAULT NULL,
`skills` text DEFAULT NULL,
`referees` text DEFAULT NULL,
`linkedInUrl` varchar(500) DEFAULT NULL,
`linkedInData` text DEFAULT NULL,
`totalYearsOfExperience` int(11) default null,
`totalMonthsOfExperience` int(11) default null,
`htmlCVData` longtext DEFAULT NULL,
`generatedCVFile` varchar(150) DEFAULT NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`expectedSalary` int(11) default null,
`preferedPositions` text default null,
`preferedJobtype` varchar(60) default null,
`preferedCountries` text default null,
`tags` text default null,
`notes` text default null,
`calls` text default null,
`age` int(11) default null,
`hash` varchar(100) DEFAULT NULL,
`linkedInProfileLink` varchar(250) DEFAULT NULL,
`linkedInProfileId` varchar(50) DEFAULT NULL,
`facebookProfileLink` varchar(250) DEFAULT NULL,
`facebookProfileId` varchar(50) DEFAULT NULL,
`twitterProfileLink` varchar(250) DEFAULT NULL,
`twitterProfileId` varchar(50) DEFAULT NULL,
`googleProfileLink` varchar(250) DEFAULT NULL,
`googleProfileId` varchar(50) DEFAULT NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Applications` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job` bigint(20) NOT NULL,
`candidate` bigint(20) DEFAULT NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`referredByEmail` varchar(200) DEFAULT NULL,
`notes` text DEFAULT NULL,
primary key (`id`),
unique key (`job`,`candidate`),
CONSTRAINT `Fk_Applications_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_Applications_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) engine=innodb default charset=utf8;
create table `Interviews` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job` bigint(20) NOT NULL,
`candidate` bigint(20) DEFAULT NULL,
`level` varchar(100) DEFAULT NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`scheduled` DATETIME default '0000-00-00 00:00:00',
`location` varchar(500) DEFAULT NULL,
`mapId` bigint(20) NULL,
`status` varchar(100) default null,
`notes` text DEFAULT NULL,
primary key (`id`),
CONSTRAINT `Fk_Interviews_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_Interviews_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) engine=innodb default charset=utf8;
create table `Calls` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job` bigint(20) NOT NULL,
`candidate` bigint(20) DEFAULT NULL,
`phone` varchar(20) default null,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`status` varchar(100) default null,
`notes` text DEFAULT NULL,
primary key (`id`),
CONSTRAINT `Fk_Calls_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_Calls_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) engine=innodb default charset=utf8;
create table `LeaveStartingBalance` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`leave_type` bigint(20) NOT NULL,
`employee` bigint(20) NULL,
`leave_period` bigint(20) NOT NULL,
`amount` decimal(10,3) NOT NULL,
`note` text DEFAULT NULL,
`created` datetime default '0000-00-00 00:00:00',
`updated` datetime default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
INSERT INTO `WorkDays` (`id`, `name`, `status`, `country`) VALUES
(1, 'Monday', 'Full Day',NULL),
(2, 'Tuesday', 'Full Day',NULL),
(3, 'Wednesday', 'Full Day',NULL),
(4, 'Thursday', 'Full Day',NULL),
(5, 'Friday', 'Full Day',NULL),
(6, 'Saturday', 'Non-working Day',NULL),
(7, 'Sunday', 'Non-working Day',NULL);
INSERT INTO `Documents` (`id`, `name`, `details`, `expire_notification`, `expire_notification_month`, `expire_notification_week`, `expire_notification_day`,`sign`,`created`, `updated`) VALUES
(1, 'ID Copy', 'Your ID copy','Yes','Yes','Yes','Yes','No',NOW(), NOW()),
(2, 'Degree Certificate', 'Degree Certificate','Yes','Yes','Yes','Yes','Yes',NOW(), NOW()),
(3, 'Driving License', 'Driving License','Yes','Yes','Yes','Yes','Yes',NOW(), NOW());
INSERT INTO `HoliDays` (`id`, `name`, `dateh`, `status`) VALUES
(1, 'New Year''s Day', '2015-01-01', 'Full Day'),
(2, 'Christmas Day', '2015-12-25', 'Full Day');
INSERT INTO `LeavePeriods` (`id`, `name`, `date_start`, `date_end`, `status`) VALUES
(3, 'Year 2015', '2015-01-01', '2015-12-31', 'Active'),
(4, 'Year 2016', '2016-01-01', '2016-12-31', 'Active'),
(5, 'Year 2017', '2017-01-01', '2017-12-31', 'Active');
INSERT INTO `LeaveTypes` (`id`, `name`, `supervisor_leave_assign`, `employee_can_apply`, `apply_beyond_current`, `leave_accrue`, `carried_forward`, `default_per_year`) VALUES
(1, 'Annual leave', 'No', 'Yes', 'No', 'No', 'No', 14),
(2, 'Casual leave', 'Yes', 'Yes', 'No', 'No', 'No', 7),
(3, 'Medical leave', 'Yes', 'Yes', 'Yes', 'No', 'No', 7);
INSERT INTO `Courses` (`id`,`code`, `name`, `description`, `coordinator`, `trainer`, `trainer_info`, `paymentType`, `currency`, `cost`, `status`, `created`, `updated`) VALUES
(1,'C0001', 'Info Marketing', 'Learn how to Create and Outsource Info Marketing Products', 1, 'Tim Jhon', 'Tim Jhon has a background in business management and has been working with small business to establish their online presence','Company Sponsored','USD','55','Active',now(), now()),
(2,'C0002', 'People Management', 'Learn how to Manage People', 1, 'Tim Jhon', 'Tim Jhon has a background in business management and has been working with small business to establish their online presence','Company Sponsored','USD','59','Active',now(), now());
INSERT INTO `EmployementType` (`name`) VALUES
('Full-time'),
('Part-time'),
('Contract'),
('Temporary'),
('Other');
INSERT INTO `Benifits` (`name`) VALUES
('Retirement plan'),
('Health plan'),
('Life insurance'),
('Paid vacations');
INSERT INTO `ExperienceLevel` (`name`) VALUES
('Not Applicable'),
('Internship'),
('Entry level'),
('Associate'),
('Mid-Senior level'),
('Director'),
('Executive');
INSERT INTO `JobFunction` (`name`) VALUES
('Accounting/Auditing'),
('Administrative'),
('Advertising'),
('Business Analyst'),
('Financial Analyst'),
('Data Analyst'),
('Art/Creative'),
('Business Development'),
('Consulting'),
('Customer Service'),
('Distribution'),
('Design'),
('Education'),
('Engineering'),
('Finance'),
('General Business'),
('Health Care Provider'),
('Human Resources'),
('Information Technology'),
('Legal'),
('Management'),
('Manufacturing'),
('Marketing'),
('Other'),
('Public Relations'),
('Purchasing'),
('Product Management'),
('Project Management'),
('Production'),
('Quality Assurance'),
('Research'),
('Sales'),
('Science'),
('Strategy/Planning'),
('Supply Chain'),
('Training'),
('Writing/Editing');
INSERT INTO `EducationLevel` (`name`) VALUES
('Unspecified'),
('High School or equivalent'),
('Certification'),
('Vocational'),
('Associate Degree'),
('Bachelor\'s Degree'),
('Master\'s Degree'),
('Doctorate'),
('Professional'),
('Some College Coursework Completed'),
('Vocational - HS Diploma'),
('Vocational - Degree'),
('Some High School Coursework');

View File

@@ -0,0 +1,70 @@
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Default Country', '0', 'Set the default Country','[ "value", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Calculation Class', 'BasicOvertimeCalculator', 'Set the method used to calculate overtime','["value", {"label":"Value","type":"select","source":[["BasicOvertimeCalculator","BasicOvertimeCalculator"],["CaliforniaOvertimeCalculator","CaliforniaOvertimeCalculator"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Start Hour', '8', 'Overtime calculation will start after an employee work this number of hours per day, 0 to indicate no overtime', ''),
('Attendance: Double time Start Hour', '12', 'Double time calculation will start after an employee work this number of hours per day, 0 to indicate no double time', '');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Work Week Start Day', '0', 'Set the starting day of the work week','["value", {"label":"Value","type":"select","source":[["0","Sunday"],["1","Monday"],["2","Tuesday"],["3","Wednesday"],["4","Thursday"],["5","Friday"],["6","Saturday"]]}]');
ALTER table `Reports` ADD COLUMN `report_group` varchar(500) NULL;
UPDATE Reports set report_group = 'Employee Information' where name = 'Employee Details Report';
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Time Entry Report';
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Attendance Report';
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Time Tracking Report';
UPDATE Reports set report_group = 'Employee Information' where name = 'Active Employee Report';
UPDATE Reports set report_group = 'Employee Information' where name = 'New Hires Employee Report';
UPDATE Reports set report_group = 'Employee Information' where name = 'Terminated Employee Report';
UPDATE Reports set report_group = 'Travel and Expense Management' where name = 'Travel Request Report';
REPLACE INTO `Reports` (`id`, `name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
(1, 'Employee Details Report', 'This report list all employee details and you can filter employees by department, employment status or job title', '[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"],"allow-null":true}],\r\n[ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"],"allow-null":true}]\r\n]', 'Select id, employee_id as ''Employee ID'',\r\nconcat(`first_name`,'' '',`middle_name`,'' '', `last_name`) as ''Name'',\r\n(SELECT name from Nationality where id = nationality) as ''Nationality'',\r\nbirthday as ''Birthday'',\r\ngender as ''Gender'',\r\nmarital_status as ''Marital Status'',\r\nssn_num as ''SSN Number'',\r\nnic_num as ''NIC Number'',\r\nother_id as ''Other IDs'',\r\ndriving_license as ''Driving License Number'',\r\n(SELECT name from EmploymentStatus where id = employment_status) as ''Employment Status'',\r\n(SELECT name from JobTitles where id = job_title) as ''Job Title'',\r\n(SELECT name from PayGrades where id = pay_grade) as ''Pay Grade'',\r\nwork_station_id as ''Work Station ID'',\r\naddress1 as ''Address 1'',\r\naddress2 as ''Address 2'',\r\ncity as ''City'',\r\n(SELECT name from Country where code = country) as ''Country'',\r\n(SELECT name from Province where id = province) as ''Province'',\r\npostal_code as ''Postal Code'',\r\nhome_phone as ''Home Phone'',\r\nmobile_phone as ''Mobile Phone'',\r\nwork_phone as ''Work Phone'',\r\nwork_email as ''Work Email'',\r\nprivate_email as ''Private Email'',\r\njoined_date as ''Joined Date'',\r\nconfirmation_date as ''Confirmation Date'',\r\n(SELECT title from CompanyStructures where id = department) as ''Department'',\r\n(SELECT concat(`first_name`,'' '',`middle_name`,'' '', `last_name`,'' [Employee ID:'',`employee_id`,'']'') from Employees e1 where e1.id = e.supervisor) as ''Supervisor'' \r\nFROM Employees e _where_', '["department","employment_status","job_title"]', 'Query', 'Employee Information'),
(3, 'Employee Time Entry Report', 'This report list all employee time entries by employee, date range and project', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "project", {"label":"Project","type":"select","allow-null":true,"remote-source":["Project","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimesheetReport', '["employee","date_start","date_end","status"]', 'Class','Time Management'),
(4, 'Employee Attendance Report', 'This report list all employee attendance entries by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["employee","date_start","date_end"]', 'Class','Time Management'),
(5, 'Employee Time Tracking Report', 'This report list employee working hours and attendance details for each day for a given period ', '[\r\n[ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["employee","date_start","date_end"]', 'Class','Time Management');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Active Employee Report', 'This report list employees who are currently active based on joined date and termination date ',
'[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}]\r\n]',
'ActiveEmployeeReport',
'["department"]', 'Class','Employee Information');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`) VALUES
('New Hires Employee Report', 'This report list employees who are joined between given two dates ',
'[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'NewHiresEmployeeReport',
'["department","date_start","date_end"]', 'Class','Employee Information');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Travel Request Report', 'This report list employees travel requests for a specified period',
'[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"]]}]\r\n]',
'TravelRequestReport',
'["employee","date_start","date_end","status"]', 'Class', 'Travel and Expense Management');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Employee Time Sheet Report', 'This report list all employee time sheets by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]', 'EmployeeTimeSheetData', '["employee","date_start","date_end","status"]', 'Class','Time Management');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Overtime Report', 'This report list all employee attendance entries by employee with overtime calculations', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeReport', '["employee","date_start","date_end"]', 'Class','Time Management');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Overtime Summary Report', 'This report list all employee attendance entries by employee with overtime calculation summary', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeSummaryReport', '["employee","date_start","date_end"]', 'Class','Time Management');
Alter table `Employees` modify column `joined_date` date default '0000-00-00';
Alter table `Employees` modify column `confirmation_date` date default '0000-00-00';
Alter table `Employees` modify column `termination_date` date default '0000-00-00';
Alter table `Employees` modify column `birthday` date default '0000-00-00';

View File

@@ -1,54 +1,78 @@
<?php
define('CLIENT_PATH',dirname(__FILE__));
include ("config.base.php");
include ("include.common.php");
include ("include.common.php");
include("server.includes.inc.php");
if(empty($user)){
if(!empty($_REQUEST['username']) && !empty($_REQUEST['password'])){
$suser = null;
$ssoUserLoaded = false;
if(empty($suser)){
$suser = new User();
$suser->Load("(username = ? or email = ?) and password = ?",array($_REQUEST['username'],$_REQUEST['username'],md5($_REQUEST['password'])));
}
if($suser->password == md5($_REQUEST['password']) || $ssoUserLoaded){
$user = $suser;
SessionUtils::saveSessionObject('user', $user);
$suser->last_login = date("Y-m-d H:i:s");
$suser->Save();
if(!$ssoUserLoaded && !empty(BaseService::getInstance()->auditManager)){
BaseService::getInstance()->auditManager->user = $user;
BaseService::getInstance()->audit(IceConstants::AUDIT_AUTHENTICATION, "User Login");
}
if($user->user_level == "Admin"){
header("Location:".HOME_LINK_ADMIN);
}else{
header("Location:".HOME_LINK_OTHERS);
}
}else{
header("Location:".CLIENT_BASE_URL."login.php?f=1");
}
}
if(!empty($_REQUEST['username']) && !empty($_REQUEST['password'])){
$suser = null;
$ssoUserLoaded = false;
if(empty($suser)){
$suser = new User();
$suser->Load("(username = ? or email = ?) and password = ?",array($_REQUEST['username'],$_REQUEST['username'],md5($_REQUEST['password'])));
}
if($suser->password == md5($_REQUEST['password']) || $ssoUserLoaded){
$user = $suser;
SessionUtils::saveSessionObject('user', $user);
$suser->last_login = date("Y-m-d H:i:s");
$suser->Save();
if(!$ssoUserLoaded && !empty(BaseService::getInstance()->auditManager)){
BaseService::getInstance()->auditManager->user = $user;
BaseService::getInstance()->audit(IceConstants::AUDIT_AUTHENTICATION, "User Login");
}
$redirectUrl = SessionUtils::getSessionObject('loginRedirect');
if(!empty($redirectUrl)){
header("Location:".$redirectUrl);
}else{
if($user->user_level == "Admin"){
header("Location:".HOME_LINK_ADMIN);
}else{
if(empty($user->default_module)){
header("Location:".HOME_LINK_OTHERS);
}else{
$defaultModule = new Module();
$defaultModule->Load("id = ?",array($user->default_module));
if($defaultModule->mod_group == "user"){
$defaultModule->mod_group = "modules";
}
$homeLink = CLIENT_BASE_URL."?g=".$defaultModule->mod_group."&n=".$defaultModule->name.
"&m=".$defaultModule->mod_group."_".str_replace(" ","_",$defaultModule->menu);
header("Location:".$homeLink);
}
}
}
}else{
header("Location:".CLIENT_BASE_URL."login.php?f=1");
}
}
}else{
if($user->user_level == "Admin"){
header("Location:".HOME_LINK_ADMIN);
}else{
header("Location:".HOME_LINK_OTHERS);
}
if($user->user_level == "Admin"){
header("Location:".HOME_LINK_ADMIN);
}else{
if(empty($user->default_module)){
header("Location:".HOME_LINK_OTHERS);
}else{
$defaultModule = new Module();
$defaultModule->Load("id = ?",array($user->default_module));
if($defaultModule->mod_group == "user"){
$defaultModule->mod_group = "modules";
}
$homeLink = CLIENT_BASE_URL."?g=".$defaultModule->mod_group."&n=".$defaultModule->name.
"&m=".$defaultModule->mod_group."_".str_replace(" ","_",$defaultModule->menu);
header("Location:".$homeLink);
}
}
}
$tuser = SessionUtils::getSessionObject('user');
//check user
$logoFileName = CLIENT_BASE_PATH."data/logo.png";
$logoFileUrl = CLIENT_BASE_URL."data/logo.png";
if(!file_exists($logoFileName)){
$logoFileUrl = BASE_URL."images/logo.png";
}
$logoFileUrl = UIManager::getInstance()->getCompanyLogoUrl();
?><!DOCTYPE html>
<html lang="en">

View File

@@ -69,4 +69,8 @@ class ICEHRM_Record extends ADOdb_Active_Record{
return array(
);
}
}
public function allowIndirectMapping(){
return false;
}
}

View File

@@ -783,17 +783,44 @@ INSERT INTO `Nationality` (`id`, `name`) VALUES
INSERT INTO `Reports` (`id`, `name`, `details`, `parameters`, `query`, `paramOrder`, `type`) VALUES
(1, 'Employee Details Report', 'This report list all employee details and you can filter employees by department, employment status or job title', '[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"],"allow-null":true}],\r\n[ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"],"allow-null":true}]\r\n]', 'Select id, employee_id as ''Employee ID'',\r\nconcat(`first_name`,'' '',`middle_name`,'' '', `last_name`) as ''Name'',\r\n(SELECT name from Nationality where id = nationality) as ''Nationality'',\r\nbirthday as ''Birthday'',\r\ngender as ''Gender'',\r\nmarital_status as ''Marital Status'',\r\nssn_num as ''SSN Number'',\r\nnic_num as ''NIC Number'',\r\nother_id as ''Other IDs'',\r\ndriving_license as ''Driving License Number'',\r\n(SELECT name from EmploymentStatus where id = employment_status) as ''Employment Status'',\r\n(SELECT name from JobTitles where id = job_title) as ''Job Title'',\r\n(SELECT name from PayGrades where id = pay_grade) as ''Pay Grade'',\r\nwork_station_id as ''Work Station ID'',\r\naddress1 as ''Address 1'',\r\naddress2 as ''Address 2'',\r\ncity as ''City'',\r\n(SELECT name from Country where code = country) as ''Country'',\r\n(SELECT name from Province where id = province) as ''Province'',\r\npostal_code as ''Postal Code'',\r\nhome_phone as ''Home Phone'',\r\nmobile_phone as ''Mobile Phone'',\r\nwork_phone as ''Work Phone'',\r\nwork_email as ''Work Email'',\r\nprivate_email as ''Private Email'',\r\njoined_date as ''Joined Date'',\r\nconfirmation_date as ''Confirmation Date'',\r\n(SELECT title from CompanyStructures where id = department) as ''Department'',\r\n(SELECT concat(`first_name`,'' '',`middle_name`,'' '', `last_name`,'' [Employee ID:'',`employee_id`,'']'') from Employees e1 where e1.id = e.supervisor) as ''Supervisor'' \r\nFROM Employees e _where_', '["department","employment_status","job_title"]', 'Query'),
(3, 'Employee Time Entry Report', 'This report list all employee time entries by employee, date range and project', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "project", {"label":"Project","type":"select","allow-null":true,"remote-source":["Project","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimesheetReport', '["employee","date_start","date_end","status"]', 'Class'),
(4, 'Employee Attendance Report', 'This report list all employee attendance entries by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["employee","date_start","date_end"]', 'Class'),
(5, 'Employee Time Tracking Report', 'This report list employee working hours and attendance details for each day for a given period ', '[\r\n[ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["employee","date_start","date_end"]', 'Class');
INSERT INTO `Reports` (`id`, `name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
(1, 'Employee Details Report', 'This report list all employee details and you can filter employees by department, employment status or job title', '[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"],"allow-null":true}],\r\n[ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"],"allow-null":true}]\r\n]', 'Select id, employee_id as ''Employee ID'',\r\nconcat(`first_name`,'' '',`middle_name`,'' '', `last_name`) as ''Name'',\r\n(SELECT name from Nationality where id = nationality) as ''Nationality'',\r\nbirthday as ''Birthday'',\r\ngender as ''Gender'',\r\nmarital_status as ''Marital Status'',\r\nssn_num as ''SSN Number'',\r\nnic_num as ''NIC Number'',\r\nother_id as ''Other IDs'',\r\ndriving_license as ''Driving License Number'',\r\n(SELECT name from EmploymentStatus where id = employment_status) as ''Employment Status'',\r\n(SELECT name from JobTitles where id = job_title) as ''Job Title'',\r\n(SELECT name from PayGrades where id = pay_grade) as ''Pay Grade'',\r\nwork_station_id as ''Work Station ID'',\r\naddress1 as ''Address 1'',\r\naddress2 as ''Address 2'',\r\ncity as ''City'',\r\n(SELECT name from Country where code = country) as ''Country'',\r\n(SELECT name from Province where id = province) as ''Province'',\r\npostal_code as ''Postal Code'',\r\nhome_phone as ''Home Phone'',\r\nmobile_phone as ''Mobile Phone'',\r\nwork_phone as ''Work Phone'',\r\nwork_email as ''Work Email'',\r\nprivate_email as ''Private Email'',\r\njoined_date as ''Joined Date'',\r\nconfirmation_date as ''Confirmation Date'',\r\n(SELECT title from CompanyStructures where id = department) as ''Department'',\r\n(SELECT concat(`first_name`,'' '',`middle_name`,'' '', `last_name`,'' [Employee ID:'',`employee_id`,'']'') from Employees e1 where e1.id = e.supervisor) as ''Supervisor'' \r\nFROM Employees e _where_', '["department","employment_status","job_title"]', 'Query', 'Employee Information'),
(3, 'Employee Time Entry Report', 'This report list all employee time entries by employee, date range and project', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "project", {"label":"Project","type":"select","allow-null":true,"remote-source":["Project","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimesheetReport', '["employee","date_start","date_end","status"]', 'Class','Time Management'),
(4, 'Employee Attendance Report', 'This report list all employee attendance entries by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["employee","date_start","date_end"]', 'Class','Time Management'),
(5, 'Employee Time Tracking Report', 'This report list employee working hours and attendance details for each day for a given period ', '[\r\n[ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["employee","date_start","date_end"]', 'Class','Time Management');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`) VALUES
('Expense Report', 'This report list employees expenses for a specified period',
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Active Employee Report', 'This report list employees who are currently active based on joined date and termination date ',
'[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}]\r\n]',
'ActiveEmployeeReport',
'["department"]', 'Class','Employee Information');
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`) VALUES
('New Hires Employee Report', 'This report list employees who are joined between given two dates ',
'[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'NewHiresEmployeeReport',
'["department","date_start","date_end"]', 'Class','Employee Information');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Travel Request Report', 'This report list employees travel requests for a specified period',
'[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"]]}]\r\n]',
'ExpenseReport',
'["employee","date_start","date_end","status"]', 'Class');
'TravelRequestReport',
'["employee","date_start","date_end","status"]', 'Class', 'Travel and Expense Management');
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Employee Time Sheet Report', 'This report list all employee time sheets by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]', 'EmployeeTimeSheetData', '["employee","date_start","date_end","status"]', 'Class','Time Management');
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Overtime Report', 'This report list all employee attendance entries by employee with overtime calculations', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeReport', '["employee","date_start","date_end"]', 'Class','Time Management');
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Overtime Summary Report', 'This report list all employee attendance entries by employee with overtime calculation summary', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeSummaryReport', '["employee","date_start","date_end"]', 'Class','Time Management');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
@@ -829,6 +856,19 @@ INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Analytics: Google Key', 'UA-48048570-2', 'Google Analytics Key','');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Calculation Class', 'BasicOvertimeCalculator', 'Set the method used to calculate overtime','["value", {"label":"Value","type":"select","source":[["BasicOvertimeCalculator","BasicOvertimeCalculator"],["CaliforniaOvertimeCalculator","CaliforniaOvertimeCalculator"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Start Hour', '8', 'Overtime calculation will start after an employee work this number of hours per day, 0 to indicate no overtime', ''),
('Attendance: Double time Start Hour', '12', 'Double time calculation will start after an employee work this number of hours per day, 0 to indicate no double time', '');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Work Week Start Day', '0', 'Set the starting day of the work week','["value", {"label":"Value","type":"select","source":[["0","Sunday"],["1","Monday"],["2","Tuesday"],["3","Wednesday"],["4","Thursday"],["5","Friday"],["6","Saturday"]]}]');
INSERT INTO `Certifications` (`id`, `name`, `description`) VALUES
(1, 'Red Hat Certified Architect (RHCA)', 'Red Hat Certified Architect (RHCA)'),
@@ -1010,6 +1050,12 @@ INSERT INTO `SalaryComponent` (`id`,`name`, `componentType`) VALUES
(2,'Fixed Allowance', 1),
(3,'Car Allowance', 2),
(4,'Telephone Allowance', 2);
INSERT INTO `Crons` (`name`,`class`, `lastrun`, `frequency`, `time`, `type`, `status`) VALUES
('Email Sender Task', 'EmailSenderTask', NULL, 1, 1, 'Minutely', 'Enabled'),
('Document Expire Alert', 'DocumentExpiryNotificationTask', NULL, 1, 1, 'Minutely', 'Enabled');
INSERT INTO `ExpensesPaymentMethods` (`name`) VALUES
('Cash'),
('Check'),

View File

@@ -74,6 +74,49 @@ INSERT INTO `Users` (`id`, `username`, `email`, `password`, `employee`, `user_le
(3, 'user1', 'icehrm+user1@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 3, 'Employee', '2013-01-03 02:48:32', '2013-01-03 02:48:32', '2013-01-03 02:48:32'),
(4, 'user2', 'icehrm+user2@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 4, 'Employee', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55');
INSERT INTO `Attendance` (`employee`,`in_time`,`out_time`,`note`) VALUES
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 20 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 20 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 19 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 19 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 18 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 18 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 17 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 17 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 16 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 16 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 15 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 15 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), '');
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;

View File

@@ -427,6 +427,7 @@ create table `Reports` (
`query` text default null,
`paramOrder` varchar(500) NOT NULL,
`type` enum('Query','Class') default 'Query',
`report_group` varchar(500) NULL,
primary key (`id`),
UNIQUE KEY `Reports_Name` (`name`)
) engine=innodb default charset=utf8;
@@ -708,7 +709,18 @@ create table `DeductionRules` (
) engine=innodb default charset=utf8;
create table `Crons` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`class` varchar(100) NOT NULL,
`lastrun` DATETIME default '0000-00-00 00:00:00',
`frequency` int(4) NOT NULL,
`time` varchar(50) NOT NULL,
`type` enum('Minutely','Hourly','Daily','Weekly','Monthly','Yearly') default 'Hourly',
`status` enum('Enabled','Disabled') default 'Enabled',
primary key (`id`),
key `KEY_Crons_frequency` (`frequency`)
) engine=innodb default charset=utf8;
create table `Emails` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,

View File

@@ -19,6 +19,44 @@ if (!class_exists('AttendanceAdminManager')) {
$this->addModelClass('Attendance');
}
public function getDashboardItemData(){
$data = array();
$attendance = new Attendance();
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
if(empty($data['numberOfAttendanceLastWeek'])){
$data['numberOfAttendanceLastWeek'] = 0;
}
return $data;
}
public function initQuickAccessMenu(){
UIManager::getInstance()->addQuickAccessMenuItem("Clocked In Employees","fa-clock-o",CLIENT_BASE_URL."?g=admin&n=attendance&m=admin_Employees#tabAttendanceStatus",array("Admin","Manager"));
}
}
}
if (!class_exists('AttendanceDashboardManager')) {
class AttendanceDashboardManager extends AbstractModuleManager{
public function initializeUserClasses(){
}
public function initializeFieldMappings(){
}
public function initializeDatabaseErrorMappings(){
}
public function setupModuleClassDefinitions(){
$this->addModelClass('Attendance');
}
}
}
@@ -173,4 +211,220 @@ if (!class_exists('AttendanceStatus')) {
return array("element","save","delete");
}
}
}
}
if (!class_exists('BasicOvertimeCalculator')) {
class BasicOvertimeCalculator{
public function createAttendanceSummary($atts){
$atTimeByDay = array();
foreach($atts as $atEntry){
if($atEntry->out_time == "0000-00-00 00:00:00" || empty($atEntry->out_time)){
continue;
}
$atDate = date("Y-m-d",strtotime($atEntry->in_time));
if(!isset($atTimeByDay[$atDate])){
$atTimeByDay[$atDate] = 0;
}
$diff = strtotime($atEntry->out_time) - strtotime($atEntry->in_time);
if($diff < 0){
$diff = 0;
}
$atTimeByDay[$atDate] += $diff;
}
return $atTimeByDay;
}
public function calculateOvertime($atTimeByDay){
$overtimeStarts = SettingsManager::getInstance()->getSetting('Attendance: Overtime Start Hour');
$doubletimeStarts = SettingsManager::getInstance()->getSetting('Attendance: Double time Start Hour');
$overtimeStarts = (is_numeric($overtimeStarts))?floatval($overtimeStarts)*60*60:0;
$doubletimeStarts = (is_numeric($doubletimeStarts))?floatval($doubletimeStarts)*60*60:0;
$atTimeByDayNew = array();
foreach($atTimeByDay as $k=>$v){
$atTimeByDayNewEntry = array("t"=>$v,"r"=>0,"o"=>0,"d"=>0);
if($overtimeStarts > 0 && $v > $overtimeStarts){
$atTimeByDayNewEntry["r"] = $overtimeStarts;
if($doubletimeStarts > 0 && $doubletimeStarts > $overtimeStarts){
//calculate double time
if($v > $doubletimeStarts){
$atTimeByDayNewEntry['d'] = $v - $doubletimeStarts;
$atTimeByDayNewEntry['o'] = $doubletimeStarts - $overtimeStarts;
}else{
$atTimeByDayNewEntry['d'] = 0 ;
$atTimeByDayNewEntry['o'] = $v - $overtimeStarts;
}
}else{
//ignore double time
$atTimeByDayNewEntry['o'] = $v - $overtimeStarts;
}
}else{
//ignore overtime
$atTimeByDayNewEntry['r'] = $v;
}
$atTimeByDayNew[$k] = $atTimeByDayNewEntry;
}
return $atTimeByDayNew;
}
protected function removeAdditionalDays($atSummary, $actualStartDate){
$newAtSummary = array();
foreach($atSummary as $k => $v){
if(strtotime($k) >= strtotime($actualStartDate)){
$newAtSummary[$k] = $v;
}
}
return $newAtSummary;
}
public function getData($atts, $actualStartDate, $aggregate = false){
$atSummary = $this->createAttendanceSummary($atts);
$overtime = $this->calculateOvertime($this->removeAdditionalDays($atSummary, $actualStartDate));
if($aggregate){
$overtime = $this->aggregateData($overtime);
return $this->convertToHoursAggregated($overtime);
}else{
return $this->convertToHours($overtime);
}
}
public function convertToHours($overtime){
foreach($overtime as $k=>$v){
$overtime[$k]['t'] = $this->convertToHoursAndMinutes($overtime[$k]['t']);
$overtime[$k]['r'] = $this->convertToHoursAndMinutes($overtime[$k]['r']);
$overtime[$k]['o'] = $this->convertToHoursAndMinutes($overtime[$k]['o']);
$overtime[$k]['d'] = $this->convertToHoursAndMinutes($overtime[$k]['d']);
}
return $overtime;
}
public function convertToHoursAggregated($overtime){
$overtime['t'] = $this->convertToHoursAndMinutes($overtime['t']);
$overtime['r'] = $this->convertToHoursAndMinutes($overtime['r']);
$overtime['o'] = $this->convertToHoursAndMinutes($overtime['o']);
$overtime['d'] = $this->convertToHoursAndMinutes($overtime['d']);
return $overtime;
}
protected function aggregateData($overtime){
$ag = array("t"=>0,"r"=>0,"o"=>0,"d"=>0);
foreach($overtime as $k=>$v){
$ag['t'] += $v['t'];
$ag['r'] += $v['r'];
$ag['o'] += $v['o'];
$ag['d'] += $v['d'];
}
return $ag;
}
public function convertToHoursAndMinutes($val){
$sec = $val % 60;
$minutesTot = ($val - $sec)/60;
$minutes = $minutesTot % 60;
$hours = ($minutesTot - $minutes)/60;
if($hours < 10){
$hours = "0".$hours;
}
if($minutes < 10){
$minutes = "0".$minutes;
}
return $hours.":".$minutes;
}
}
}
if (!class_exists('CaliforniaOvertimeCalculator')) {
class CaliforniaOvertimeCalculator extends BasicOvertimeCalculator{
public function getData($atts, $actualStartDate, $aggregate = false){
if(count($atts) == 0){
return array();
}
$atSummary = $this->createAttendanceSummary($atts);
$overtime = $this->calculateOvertime($atSummary);
$workWeekStartDate = SettingsManager::getInstance()->getSetting('Attendance: Work Week Start Day');
//TODO - just assume a work week from Sunday to Saturday
//Find first Sunday in array
$firstDate = null;
//Find double time days (7th work day of a week without a break)
$doubleTimeDates = array();
$prvDate = null;
$consecutiveWorkDays = 1;
foreach($overtime as $k=>$v){
if($firstDate == null) {
$dw = date("w", strtotime($k));
if ($dw == $workWeekStartDate) {
$firstDate = $k;
}
}
if($firstDate != null){
if($prvDate != null && date('Y-m-d', strtotime('-1 day',strtotime($k))) == $prvDate){
$consecutiveWorkDays++;
if($consecutiveWorkDays == 7){
//This is a double time day
$overtime[$k]['d'] = $overtime[$k]['d'] + $overtime[$k]['o'];
$overtime[$k]['o'] = 0;
}
}
//Resetting $consecutiveWorkDays at the start of the work week
if($prvDate != null && date( "w", strtotime($k)) == $workWeekStartDate){
$consecutiveWorkDays = 1;
$prvDate = null;
}
$prvDate = $k;
}
}
$overtime = $this->removeAdditionalDays($overtime, $actualStartDate);
if($aggregate){
$overtime = $this->aggregateData($overtime);
return $this->convertToHoursAggregated($overtime);
}else{
return $this->convertToHours($overtime);
}
}
}
}

View File

@@ -0,0 +1,18 @@
<div class="col-lg-3 col-xs-12">
<div class="small-box bg-yellow">
<div class="inner">
<h3>
Attendance
</h3>
<p id="numberOfAttendanceLastWeek">
#_numberOfAttendanceLastWeek_# Entries Last Week
</p>
</div>
<div class="icon">
<i class="ion ion-clock"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="attendanceLink">
Monitor Attendance <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -4,6 +4,7 @@
"order":"8",
"icon":"fa-clock-o",
"user_levels":["Admin","Manager"],
"dashboardPosition":5,
"permissions":
{}

View File

@@ -20,6 +20,14 @@ if (!class_exists('Company_structureAdminManager')) {
$this->addModelClass('CompanyStructure');
}
public function getDashboardItemData(){
$data = array();
$company = new CompanyStructure();
$data['numberOfCompanyStuctures'] = $company->Count("1 = 1");
return $data;
}
}
}

View File

@@ -0,0 +1,17 @@
<div class="col-lg-3 col-xs-12">
<div class="small-box bg-green">
<div class="inner">
<h3>Company</h3>
<p id="numberOfCompanyStuctures">
#_numberOfCompanyStuctures_# Departments
</p>
</div>
<div class="icon">
<i class="ion ion-shuffle"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="companyLink">
Manage Company <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -41,8 +41,8 @@ CompanyStructureAdapter.method('getFormFields', function() {
[ "description", {"label":"Details","type":"textarea","validation":""}],
[ "address", {"label":"Address","type":"textarea","validation":"none"}],
[ "type", {"label":"Type","type":"select","source":[["Company","Company"],["Head Office","Head Office"],["Regional Office","Regional Office"],["Department","Department"],["Unit","Unit"],["Sub Unit","Sub Unit"],["Other","Other"]]}],
[ "country", {"label":"Country","type":"select","remote-source":["Country","code","name"]}],
[ "timezone", {"label":"Time Zone","type":"select","allow-null":false,"remote-source":["Timezone","name","details"]}],
[ "country", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}],
[ "timezone", {"label":"Time Zone","type":"select2","allow-null":false,"remote-source":["Timezone","name","details"]}],
[ "parent", {"label":"Parent Structure","type":"select","allow-null":true,"remote-source":["CompanyStructure","id","title"]}]
];
});

View File

@@ -1,16 +1,17 @@
{
"label":"Company Structure",
"menu":"Admin",
"order":"2",
"icon":"fa-building-o",
"user_levels":["Admin","Manager"],
"label":"Company Structure",
"menu":"Admin",
"order":"2",
"icon":"fa-building-o",
"user_levels":["Admin","Manager"],
"dashboardPosition":2,
"permissions":
{
"Manager":{
"Add Company Structure":"No",
"Edit Company Structure":"No",
"Delete Company Structure":"No"
}
}
"permissions":
{
"Manager":{
"Add Company Structure":"No",
"Edit Company Structure":"No",
"Delete Company Structure":"No"
}
}
}

View File

@@ -40,13 +40,26 @@ class DashboardActionManager extends SubActionManager{
$attendance = new Attendance();
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
if(empty($data['numberOfAttendanceLastWeek'])){
$data['numberOfAttendanceLastWeek'] = 0;
}
$data['numberOfLeaves'] = 0;
$empLeave = new EmployeeLeave();
$data['numberOfLeaves'] = $empLeave->Count("date_start > '".date("Y-m-d")."'");
$timeEntry = new EmployeeTimeEntry();
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
$data['numberOfAttendanceLastWeek'] = $timeEntry->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
$candidate = new Candidate();
$data['numberOfCandidates'] = $candidate->Count("1 = 1");
$job = new Job();
$data['numberOfJobs'] = $job->Count("status = 'Active'");
$course = new Course();
$data['numberOfCourses'] = $course->Count("1 = 1");
return new IceResponse(IceResponse::SUCCESS,$data);
}

View File

@@ -17,7 +17,7 @@ along with iCE Hrm. If not, see <http://www.gnu.org/licenses/>.
------------------------------------------------------------------
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
*/
@@ -25,223 +25,48 @@ $moduleName = 'dashboard';
define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.php';
?><div class="span9">
<div class="row">
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner">
<h3>
People
</h3>
<p id="numberOfEmployees">
.. Employees
</p>
</div>
<div class="icon">
<i class="ion ion-person-stalker"></i>
</div>
<a href="#" class="small-box-footer" id="employeeLink">
Manage Employees <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<h3 id="numberOfCompanyStuctures">..</h3>
<p >
Company Structures
</p>
</div>
<div class="icon">
<i class="ion ion-shuffle"></i>
</div>
<a href="#" class="small-box-footer" id="companyLink">
Manage Company <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3>Users</h3>
<p id="numberOfUsers">
.. Users
</p>
</div>
<div class="icon">
<i class="ion ion-person-add"></i>
</div>
<a href="#" class="small-box-footer" id="usersLink">
Manage Users <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3 id="numberOfProjects">..</h3>
<p>
Active Projects
</p>
</div>
<div class="icon">
<i class="ion ion-pie-graph"></i>
</div>
<a href="#" class="small-box-footer" id="projectsLink">
Update Clients/Projects <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="row">
<?php
$moduleManagers = BaseService::getInstance()->getModuleManagers();
$dashBoardList = array();
foreach($moduleManagers as $moduleManagerObj){
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3>
Attendance
</h3>
<p id="numberOfAttendanceLastWeek">
.. Entries Last Week
</p>
</div>
<div class="icon">
<i class="ion ion-clock"></i>
</div>
<a href="#" class="small-box-footer" id="attendanceLink">
Monitor Attendance <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-teal">
<div class="inner">
<h3>Reports</h3>
<p>
View / Download Reports
</p>
</div>
<div class="icon">
<i class="ion ion-document-text"></i>
</div>
<a href="#" class="small-box-footer" id="reportsLink">
Create a Report <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<h3>Settings</h3>
<p>
Configure IceHrm
</p>
</div>
<div class="icon">
<i class="ion ion-settings"></i>
</div>
<a href="#" class="small-box-footer" id="settingsLink">
Update Settings <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3>
Travel
</h3>
<p id="numberOfTravel">
Requests
</p>
</div>
<div class="icon">
<i class="ion ion-plane"></i>
</div>
<a href="#" class="small-box-footer" id="travelLink">
Manage Travel <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3>
Help
</h3>
<p>
User Guide
</p>
</div>
<div class="icon">
<i class="ion ion-help"></i>
</div>
<a href="http://blog.icehrm.com/docs/home/" target="_blank" class="small-box-footer" id="icehrmHelpLink">
Documentation <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
</div>
//Check if this is not an admin module
if($moduleManagerObj->getModuleType() != 'admin'){
continue;
}
<div id="iceannon">
<div class="callout callout-danger lead" style="font-size: 14px;font-weight: bold;">
<h4>Why not upgrade to IceHrm Pro Version</h4>
<p>
IceHrm Pro is the feature rich upgrade to IceHrm open source version. It comes with improved modules for
employee management, leave management, LDAP support and number of other features over open source version.
Hit this <a href="http://icehrm.com/#compare" class="btn btn-primary btn-xs target="_blank">link</a> to do a full one to one comparison.
$allowed = BaseService::getInstance()->isModuleAllowedForUser($moduleManagerObj);
Also you can learn more about IceHrm Pro <a href="http://blog.icehrm.com/docs/icehrm-pro/" class="btn btn-primary btn-xs" target="_blank">here</a>
<br/>
<br/>
<a href="http://icehrm.com/modules.php" class="btn btn-success btm-xs" target="_blank"><i class="fa fa-checkout"></i> Buy IceHrm Pro</a>
</p>
</div>
if(!$allowed){
continue;
}
$item = $moduleManagerObj->getDashboardItem();
if(!empty($item)) {
$index = $moduleManagerObj->getDashboardItemIndex();
$dashBoardList[$index] = $item;
}
}
ksort($dashBoardList);
foreach($dashBoardList as $k=>$v){
echo $v;
}
?>
</div>
</div>
<script>
var modJsList = new Array();
var modJsList = new Array();
modJsList['tabDashboard'] = new DashboardAdapter('Dashboard','Dashboard');
modJsList['tabDashboard'] = new DashboardAdapter('Dashboard','Dashboard');
var modJs = modJsList['tabDashboard'];
$("#employeeLink").attr("href",modJs.getCustomUrl('?g=admin&n=employees&m=admin_Admin'));
$("#companyLink").attr("href",modJs.getCustomUrl('?g=admin&n=company_structure&m=admin_Admin'));
$("#usersLink").attr("href",modJs.getCustomUrl('?g=admin&n=users&m=admin_System'));
$("#projectsLink").attr("href",modJs.getCustomUrl('?g=admin&n=projects&m=admin_Admin'));
$("#attendanceLink").attr("href",modJs.getCustomUrl('?g=admin&n=attendance&m=admin_Admin'));
$("#leaveLink").attr("href",modJs.getCustomUrl('?g=admin&n=leaves&m=admin_Admin'));
$("#reportsLink").attr("href",modJs.getCustomUrl('?g=admin&n=reports&m=admin_Reports'));
$("#settingsLink").attr("href",modJs.getCustomUrl('?g=admin&n=settings&m=admin_System'));
$("#travelLink").attr("href",modJs.getCustomUrl('?g=admin&n=travel&m=admin_Employees'));
modJs.getInitData();
$(document).ready(function(){
try{
$.ajax({
url : "https://icehrm-public.s3.amazonaws.com/icehrmnews.html",
success : function(result){
$('#iceannon').html(result);
}
});
}catch(e){}
});
var modJs = modJsList['tabDashboard'];
</script>
<?php include APP_BASE_PATH.'footer.php';?>
<?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -62,13 +62,16 @@ DashboardAdapter.method('getInitData', function() {
DashboardAdapter.method('getInitDataSuccessCallBack', function(data) {
$("#numberOfEmployees").html(data['numberOfEmployees']+" Employees");
$("#numberOfCompanyStuctures").html(data['numberOfCompanyStuctures']);
$("#numberOfCompanyStuctures").html(data['numberOfCompanyStuctures']+" Departments");
$("#numberOfUsers").html(data['numberOfUsers']+" Users");
$("#numberOfProjects").html(data['numberOfProjects']);
$("#numberOfProjects").html(data['numberOfProjects']+" Active Projects");
$("#numberOfAttendanceLastWeek").html(data['numberOfAttendanceLastWeek']+" Entries Last Week");
$("#numberOfLeaves").html(data['numberOfLeaves']);
$("#numberOfLeaves").html(data['numberOfLeaves']+" Upcoming");
$("#numberOfTimeEntries").html(data['numberOfTimeEntries']);
$("#numberOfCandidates").html(data['numberOfCandidates']+" Candidates");
$("#numberOfJobs").html(data['numberOfJobs']+" Active");
$("#numberOfCourses").html(data['numberOfCourses']+" Courses");
});
DashboardAdapter.method('getInitDataFailCallBack', function(callBackData) {

View File

@@ -3,7 +3,7 @@
"menu":"Admin",
"order":"1",
"icon":"fa-desktop",
"user_levels":["Admin"],
"user_levels":["Admin","Other"],
"permissions":
{

View File

@@ -20,6 +20,21 @@ if (!class_exists('EmployeesAdminManager')) {
$this->addModelClass('EmploymentStatus');
}
public function getDashboardItemData(){
$data = array();
$emp = new Employee();
$data['numberOfEmployees'] = $emp->Count("1 = 1");
return $data;
}
public function initQuickAccessMenu(){
UIManager::getInstance()->addQuickAccessMenuItem("View Employees","fa-users",CLIENT_BASE_URL."?g=admin&n=employees&m=admin_Employees",array("Admin","Manager"));
UIManager::getInstance()->addQuickAccessMenuItem("Add a New Employee","fa-edit",CLIENT_BASE_URL."?g=admin&n=employees&m=admin_Employees&action=new",array("Admin"));
}
}
}

View File

@@ -0,0 +1,19 @@
<div class="col-lg-3 col-xs-12">
<div class="small-box bg-aqua">
<div class="inner">
<h3>
People
</h3>
<p id="numberOfEmployees">
#_numberOfEmployees_# Employees
</p>
</div>
<div class="icon">
<i class="ion ion-person-stalker"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="employeeLink">
Manage Employees <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -1,11 +1,12 @@
{
"label":"Employees",
"menu":"Employees",
"order":"1",
"icon":"fa-users",
"user_levels":["Admin"],
"label":"Employees",
"menu":"Employees",
"order":"1",
"icon":"fa-users",
"user_levels":["Admin","Manager"],
"dashboardPosition":1,
"permissions":
{
}
"permissions":
{
}
}

View File

@@ -46,7 +46,8 @@ ModuleAdapter.method('getFormFields', function() {
[ "id", {"label":"ID","type":"hidden"}],
[ "label", {"label":"Label","type":"text","validation":""}],
[ "status", {"label":"Status","type":"select","source":[["Enabled","Enabled"],["Disabled","Disabled"]]}],
[ "user_levels", {"label":"User Levels","type":"select2multi","source":[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"],["Other","Other"]]}]
[ "user_levels", {"label":"User Levels","type":"select2multi","source":[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"],["Other","Other"]]}],
[ "user_roles", {"label":"User Roles","type":"select2multi","remote-source":["UserRole","id","name"]}]
];
});
@@ -65,7 +66,8 @@ ModuleAdapter.method('getActionButtonsHtml', function(id,data) {
nonEditableFields["admin_Settings"] = 1;
nonEditableFields["admin_Users"] = 1;
nonEditableFields["admin_Upgrade"] = 1;
nonEditableFields["admin_Upgrade"] = 1;
nonEditableFields["user_Basic Information"] = 1;
if(nonEditableFields[data[3]+"_"+data[1]] == 1){

View File

@@ -0,0 +1,44 @@
ICEHRM END USER LICENSE AGREEMENT
NOTICE TO ALL USERS: BY PURCHASING THE MODULE, YOU (EITHER AN INDIVIDUAL OR A SINGLE ENTITY) CONSENT TO BE BOUND BY AND BECOME A PARTY TO THIS AGREEMENT.
All references to "Software" herein shall be deemed to include the software license with which you will be provided by Gamonoid Media Pvt Ltd, as part of the Software.
1. LICENSE GRANT. Subject to the payment of the applicable licence fees, and subject to the terms and conditions of this Agreement, ICEHRM hereby grants to you a non-exclusive, non-transferable right to use one copy of the specified version of the Software and the accompanying documentation (the "Documentation") for the term of this Agreement solely for your own internal business purposes. You may install one copy of the Software for production use.
.
2. USE. The Software is licensed as a single product; it may not be used on more than one ICEHRM Server at a time. The Software is "in use" on a Server when its installed on a Server. You shall not, nor permit any third party to copy (other than as expressly permitted herein). You shall not rent, lease or lend the Software to any other person, nor transfer or sub-licence your licence rights to any other person.
3. TERM. This Agreement is effective until terminated as set forth herein. This Agreement will terminate automatically if you fail to comply with any of the conditions, limitations or other requirements described herein. Upon any termination of this Agreement, you must immediately destroy all copies of the Software and the Documentation. You may terminate this Agreement at any point by destroying all copies of the Software and the Documentation.
4. SUPPORT. Gamonoid Media Pvt Ltd will provide you support according to the support agreement subscribed by the company.
5. OWNERSHIP RIGHTS. The Software is protected by copyright laws. ICEHRM and Gamonoid Media Pvt Ltd own and retain all right, title and interest in and to the Software, including all copyrights, patents, trademarks and other intellectual property rights therein. Your possession, installation, or use of the Software does not transfer to you any title to the intellectual property in the Software, and you will not acquire any rights to the Software except as expressly set forth in this Agreement.
6. LIMITED WARRANTY. You may not rent, lease, loan or resell the Software. You may not permit third parties to benefit from the use or functionality of the Software via a timesharing, service bureau or other arrangement, except to the extent such use is specified in the applicable list price or product packaging for the Software. You may not transfer any of the rights granted to you under this Agreement. You may not modify, or create derivative works based upon, the Software in whole or in part. You may not copy the Software or Documentation except as expressly permitted in Section 1 above. You may not remove any proprietary notices or labels on the Software. All rights not expressly set forth hereunder are reserved by ICEHRM. ICEHRM reserves the right to periodically conduct audits upon advance written notice to verify compliance with the terms of this Agreement.
7. WARRANTY and DISCLAIMER.
(i) Gamonoid Media Pvt Ltd. warrants that for 30 days from first download or installation the Software will perform substantially in accordance with the functionality described in the Documentation (http://blog.icehrm.com) when operated properly and in the manner specified in the Documentation.
(ii) You accept all responsibility for the selection of this Software to meet your requirements.
(iii) Gamonoid Media Pvt Ltd. does not warrant that the Software and/or the Documentation will be suitable for such requirements nor that any use will be uninterrupted and error free.
(iv) The warranty in (i) shall not apply if you (a) make or cause to be made any modifications to this Software, (b) use the Software in a manner for which it was not intended or (c) use the Software other than as permitted under this Agreement.
(vii) The warranties and conditions stated in this Agreement are in lieu of all other conditions, warranties or other terms concerning the supply or purported supply of, failure to supply or delay in supplying the Software or the Documentation which might but for this paragraph (vii) have effect between the ICEHRM and you or would otherwise be implied into or incorporated into this Agreement or any collateral contract, whether by statute, common law or otherwise, all of which are hereby excluded (including, without limitation, the implied conditions, warranties or other terms as to satisfactory quality, fitness for purpose or as to the use of reasonable skill and care).
8. LIMITATION of LIABILITY. Gamonoid Media Pvt Ltd. shall have no liability (whether in contract, tort, restitution or otherwise) for any of the following losses or damage (whether such losses or damage were foreseen, foreseeable, known or otherwise):
- Loss of revenue;
- Loss of actual or anticipated profits (including for loss of profits on contracts);
- Loss of the use of money;
- Loss of anticipated savings;
- Loss of business;
- Loss of opportunity;
- Loss of goodwill;
- Loss of reputation;
- Loss of, damage to or corruption of data;
or
Any indirect or consequential loss or damage howsoever caused (including, for the avoidance of doubt, where such loss or damage is of the type specified in paragraph (ii), (a) to (ii), (i).
The ICEHRM liability (whether in contract, tort, restitution or otherwise) arising out of or in connection with the supply of the Software shall in no circumstances exceed a sum equal to the amount equally paid by you for the Software.
The construction and interpretation of this Agreement shall be governed in accordance with the laws of Sri Lanka. The parties hereby submit to the jurisdiction of the courts of Sri Lanka save that ICEHRM as claimant shall be entitled to initiate proceedings in any court of competent jurisdiction.
This Agreement contains the entire understanding of the parties with respect to the subject matter hereof and supersedes all and any prior understandings, undertakings and promises between you and ICEHRM, whether oral or in writing, which have been given or may be implied from anything written or said in negotiations between us or our representatives prior to this Agreement and all prior agreements between the parties relating to the matters aforesaid shall cease to have effect as from the Effective Date.

View File

@@ -0,0 +1,7 @@
This module is licensed under IceHrm Commercial License, which can be found in LICENSE.txt.
You are allowed to make any modification required to these module, but only allowed to use
the module in one production server (even with modifications).
Installation
------------
Copy this module into <icehrm path>/admin/ directory

View File

@@ -0,0 +1,69 @@
<?php
if (!class_exists('PayrollAdminManager')) {
class PayrollAdminManager extends AbstractModuleManager{
public function initializeUserClasses(){
}
public function initializeFieldMappings(){
}
public function initializeDatabaseErrorMappings(){
}
public function setupModuleClassDefinitions(){
$this->addModelClass('SalaryComponentType');
$this->addModelClass('SalaryComponent');
$this->addModelClass('Deduction');
}
}
}
if (!class_exists('SalaryComponentType')) {
class SalaryComponentType extends ICEHRM_Record {
var $_table = 'SalaryComponentType';
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getUserAccess(){
return array("get","element");
}
}
}
if (!class_exists('SalaryComponent')) {
class SalaryComponent extends ICEHRM_Record {
var $_table = 'SalaryComponent';
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getUserAccess(){
return array("get","element");
}
}
}
if (!class_exists('Deduction')) {
class Deduction extends ICEHRM_Record {
var $_table = 'Deductions';
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getUserAccess(){
return array("get","element");
}
}
}

View File

@@ -0,0 +1,17 @@
<?php
$moduleName = 'metadata';
define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.php';
$moduleBuilder = new ModuleBuilder();
$moduleBuilder->addModuleOrGroup(new ModuleTab('SalaryComponentType','SalaryComponentType','Salary Component Types','SalaryComponentTypeAdapter','','',true));
$moduleBuilder->addModuleOrGroup(new ModuleTab('SalaryComponent','SalaryComponent','Salary Components','SalaryComponentAdapter','',''));
$moduleBuilder->addModuleOrGroup(new ModuleTab('EmployeeSalary','EmployeeSalary','Employee Salary','EmployeeSalaryAdapter','','',false,array("setRemoteTable"=>"true")));
echo UIManager::getInstance()->renderModule($moduleBuilder);
include APP_BASE_PATH.'footer.php';

274
ext/admin/payroll/lib.js Normal file
View File

@@ -0,0 +1,274 @@
/**
* Author: Thilina Hasantha
*/
/**
* SalaryComponentTypeAdapter
*/
function SalaryComponentTypeAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
}
SalaryComponentTypeAdapter.inherits(AdapterBase);
SalaryComponentTypeAdapter.method('getDataMapping', function() {
return [
"id",
"code",
"name"
];
});
SalaryComponentTypeAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Code" },
{ "sTitle": "Name"}
];
});
SalaryComponentTypeAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "code", {"label":"Code","type":"text","validation":""}],
[ "name", {"label":"Name","type":"text","validation":""}]
];
});
/**
* SalaryComponentAdapter
*/
function SalaryComponentAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
}
SalaryComponentAdapter.inherits(AdapterBase);
SalaryComponentAdapter.method('getDataMapping', function() {
return [
"id",
"name",
"componentType",
"details"
];
});
SalaryComponentAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Name" },
{ "sTitle": "Salary Component Type" },
{ "sTitle": "Details"}
];
});
SalaryComponentAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "name", {"label":"Name","type":"text","validation":""}],
[ "componentType", {"label":"Salary Component Type","type":"select2","remote-source":["SalaryComponentType","id","name"]}],
[ "details", {"label":"Details","type":"textarea","validation":"none"}]
];
});
/**
* DeductionAdapter
*/
function DeductionAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
}
DeductionAdapter.inherits(AdapterBase);
DeductionAdapter.method('getDataMapping', function() {
return [
"id",
"name",
"contributor",
"type",
];
});
DeductionAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Name" },
{ "sTitle": "Contributor"},
{ "sTitle": "Deduction Type"}
];
});
DeductionAdapter.method('getFormFields', function() {
var rangeAmounts = [ "rangeAmounts", {"label":"Deduction Amounts","type":"datagroup",
"form":[
[ "lowerCondition", {"label":"Lower Limit Condition","type":"select","source":[["No Lower Limit","No Lower Limit"],[">","Greater than"],[">=","Greater than or Equal"]]}],
[ "lowerLimit", {"label":"Lower Limit","type":"text","validation":"none"}],
[ "upperCondition", {"label":"Upper Limit Condition","type":"select","source":[["No Upper Limit","No Upper Limit"],["<","Less than"],["<=","Less than or Equal"]]}],
[ "upperLimit", {"label":"Upper Limit","type":"text","validation":"none"}],
[ "amount", {"label":"Value","type":"text","validation":"float"}]
],
"html":'<div id="#_id_#" class="panel panel-default">#_delete_##_edit_#<div class="panel-body">#_renderFunction_#</div></div>',
"validation":"none",
"render":function(item){
var output = "";
if(item.lowerCondition != "No Lower Limit"){
output += item.lowerLimit + " " + item.lowerCondition + " ";
output += " and ";
}
if(item.upperCondition != "No Upper Limit"){
output += item.upperCondition + " " + item.upperLimit + " ";
}
if(output == ""){
return "Deduction is "+item.amount + " for all ranges";
}else{
return "If salary component "+output+ " deduction is "+item.amount;
}
return output;
}
}];
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "name", {"label":"Name","type":"text","validation":""}],
[ "contributor", {"label":"Contributor","type":"select","source":[["Employee","Employee"],["Employer","Employer"]]}],
[ "type", {"label":"Deduction Type","type":"select","source":[["Fixed","Fixed"],["Percentage","Percentage"]]}],
[ "percentage_type", {"label":"Percentage Type","type":"select","source":[["On Component","On Component"],["On Component Type","On Component Type"]]}],
[ "componentType", {"label":"Salary Component Type","type":"select2","allow-null":true,"null-label":"N/A","remote-source":["SalaryComponentType","id","name"]}],
[ "component", {"label":"Salary Component","type":"select2","allow-null":true,"null-label":"N/A","remote-source":["SalaryComponent","id","name"]}],
rangeAmounts,
[ "country", {"label":"Country","type":"select2","remote-source":["Country","id","name"]}]
];
});
DeductionAdapter.method('doCustomValidation', function(params) {
if(params.type == "Fixed"){
return null;
}
if(params.percentage_type == "On Component Type"){
params.component = "NULL";
if(params.componentType == "NULL"){
return "Salary component type should be selected";
}
}else if(params.percentage_type == "On Component"){
params.componentType = "NULL";
if(params.component == "NULL"){
return "Salary component should be selected";
}
}
return null;
});
DeductionAdapter.method('postRenderForm', function(object, $tempDomObj) {
$tempDomObj.find("#field_componentType").hide();
$tempDomObj.find("#field_percentage_type").hide();
$tempDomObj.find("#field_component").hide();
$tempDomObj.find("#percentage_type").off().on('change',function(e){
if(e.val == "On Component"){
$("#componentType").hide();
$("#component").show();
}else{
$("#componentType").show();
$("#component").hide();
}
});
$tempDomObj.find("#type").off().on('change',function(e){
if(e.val == "Fixed"){
$("#componentType").hide();
$("#percentage_type").hide();
$("#component").hide();
}else{
$("#percentage_type").show();
if($("#percentage_type").select2('data').id == 'On Component'){
$("#field_componentType").hide();
$("#field_component").show();
}else{
$("#field_componentType").show();
$("#field_component").hide();
}
}
});
});
/*
* EmployeeSalaryAdapter
*/
function EmployeeSalaryAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
}
EmployeeSalaryAdapter.inherits(AdapterBase);
EmployeeSalaryAdapter.method('getDataMapping', function() {
return [
"id",
"employee",
"component",
"pay_frequency",
"currency",
"amount",
"details"
];
});
EmployeeSalaryAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Employee" },
{ "sTitle": "Salary Component" },
{ "sTitle": "Pay Frequency"},
{ "sTitle": "Currency"},
{ "sTitle": "Amount"},
{ "sTitle": "Details"}
];
});
EmployeeSalaryAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}],
[ "component", {"label":"Salary Component","type":"select2","remote-source":["SalaryComponent","id","name"]}],
[ "pay_frequency", {"label":"Pay Frequency","type":"select","source":[["Hourly","Hourly"],["Daily","Daily"],["Bi Weekly","Bi Weekly"],["Weekly","Weekly"],["Semi Monthly","Semi Monthly"],["Monthly","Monthly"]]}],
[ "currency", {"label":"Currency","type":"select2","remote-source":["CurrencyType","id","name"]}],
[ "amount", {"label":"Amount","type":"text","validation":"float"}],
[ "details", {"label":"Details","type":"textarea","validation":"none"}]
];
});
EmployeeSalaryAdapter.method('getFilters', function() {
return [
[ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}]
];
});

View File

@@ -0,0 +1,11 @@
{
"label":"Setup",
"menu":"Salary Details",
"order":"6",
"icon":"fa-cogs",
"user_levels":["Admin"],
"permissions":
{
}
}

View File

@@ -0,0 +1,19 @@
<div class="col-lg-3 col-xs-12">
<div class="small-box bg-aqua">
<div class="inner">
<h3>
Permission
</h3>
<p>
Management
</p>
</div>
<div class="icon">
<i class="ion ion-locked"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="permissionLink">
Manage Permissions <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -1,11 +1,12 @@
{
"label":"Manage Permissions",
"menu":"System",
"order":"4",
"icon":"fa-unlock",
"user_levels":["Admin"],
"label":"Manage Permissions",
"menu":"System",
"order":"4",
"icon":"fa-unlock",
"user_levels":["Admin"],
"dashboardPosition":15,
"permissions":
{
}
"permissions":
{
}
}

View File

@@ -21,6 +21,19 @@ if (!class_exists('ProjectsAdminManager')) {
}
public function getDashboardItemData(){
$data = array();
$project = new Project();
$data['numberOfProjects'] = $project->Count("status = 'Active'");
return $data;
}
public function initQuickAccessMenu(){
UIManager::getInstance()->addQuickAccessMenuItem("Manage Client/Projects","fa-list-alt",CLIENT_BASE_URL."?g=admin&n=projects&m=admin_Admin",array("Admin","Manager"));
}
}
}

View File

@@ -0,0 +1,17 @@
<div class="col-lg-3 col-xs-12">
<div class="small-box bg-red">
<div class="inner">
<h3>Projects</h3>
<p id="numberOfProjects">
#_numberOfProjects_# Active Projects
</p>
</div>
<div class="icon">
<i class="ion ion-pie-graph"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="projectsLink">
Update Clients/Projects <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -1,19 +1,20 @@
{
"label":"Projects/Client Setup",
"menu":"Admin",
"order":"5",
"icon":"fa-list-alt",
"user_levels":["Admin","Manager"],
"label":"Projects/Client Setup",
"menu":"Admin",
"order":"51",
"icon":"fa-list-alt",
"user_levels":["Admin","Manager"],
"dashboardPosition":4,
"permissions":
{
"Manager":{
"Add Projects":"Yes",
"Edit Projects":"Yes",
"Delete Projects":"No",
"Add Clients":"Yes",
"Edit Clients":"Yes",
"Delete Clients":"No"
}
}
"permissions":
{
"Manager":{
"Add Projects":"Yes",
"Edit Projects":"Yes",
"Delete Projects":"No",
"Add Clients":"Yes",
"Edit Clients":"Yes",
"Delete Clients":"No"
}
}
}

View File

@@ -0,0 +1,17 @@
<div class="col-lg-3 col-xs-12">
<div class="small-box bg-teal">
<div class="inner">
<h3>Reports</h3>
<p>
View / Download Reports
</p>
</div>
<div class="icon">
<i class="ion ion-document-text"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="reportsLink">
Create a Report <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -19,14 +19,21 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</div>
</div>
</div>
</div>
<script>
var modJsList = new Array();
modJsList['tabReport'] = new ReportAdapter('Report','Report');
modJsList['tabReport'] = new ReportAdapter('Report','Report','','report_group');
modJsList['tabReport'].setShowAddNew(false);
modJsList['tabReport'].setRemoteTable(true);
/*
modJsList['tabReport'] = new ReportGenAdapter('File','File','{"file_group":"Report"}','group');
modJsList['tabReport'].setShowAddNew(false);
*/
var modJs = modJsList['tabReport'];

View File

@@ -7,8 +7,9 @@
* ReportAdapter
*/
function ReportAdapter(endPoint) {
this.initAdapter(endPoint);
function ReportAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
this._formFileds = [
[ "id", {"label":"ID","type":"hidden"}],
[ "name", {"label":"Name","type":"label","validation":""}],
@@ -162,3 +163,42 @@ ReportAdapter.method('fillForm', function(object) {
}
});
function ReportGenAdapter(endPoint) {
this.initAdapter(endPoint);
}
ReportGenAdapter.inherits(AdapterBase);
ReportGenAdapter.method('getDataMapping', function() {
return [
"id",
"name",
];
});
ReportGenAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Name" }
];
});
ReportGenAdapter.method('getFormFields', function() {
return [
];
});
ReportGenAdapter.method('getActionButtonsHtml', function(id,data) {
var html = '<div style="width:80px;"><img class="tableActionButton" src="_BASE_images/download.png" style="cursor:pointer;" rel="tooltip" title="Download" onclick="download(_name_);return false;"></img></div>';
html = html.replace(/_id_/g,id);
html = html.replace(/_name_/g,data[1]);
html = html.replace(/_BASE_/g,this.baseUrl);
return html;
});

View File

@@ -1,11 +1,11 @@
{
"label":"Reports",
"menu":"Reports",
"order":"1",
"icon":"fa-file-o",
"user_levels":["Admin","Manager"],
"permissions":
{
}
"label":"Reports",
"menu":"Reports",
"order":"1",
"icon":"fa-file-o",
"user_levels":["Admin","Manager"],
"dashboardPosition":7,
"permissions":
{
}
}

View File

@@ -1,6 +1,6 @@
<?php
if(!class_exists('ReportBuilder')){
include_once MODULE_PATH.'/reportClasses/ReportBuilder.php';
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
}
class ActiveEmployeeReport extends ReportBuilder{

View File

@@ -1,6 +1,6 @@
<?php
if(!class_exists('ReportBuilder')){
include_once MODULE_PATH.'/reportClasses/ReportBuilder.php';
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
}
class EmployeeAttendanceReport extends ReportBuilder{

View File

@@ -0,0 +1,53 @@
<?php
if(!interface_exists('ReportBuilderInterface')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
}
if(!class_exists('LeavesActionManager')){
include_once APP_BASE_PATH.'modules/leaves/api/LeavesActionManager.php';
}
class EmployeeLeaveEntitlementReport implements ReportBuilderInterface{
public function getData($report,$req){
$leaveActionManager = new LeavesActionManager();
$department = $req['department'];
$employeeId = $req['employee'];
if(($employeeId == "NULL" || empty($employeeId)) && ($department == "NULL" || empty($department))){
$emp = new Employee();
$employees = $emp->Find("status = 'Active'",array());
}else if($employeeId != "NULL" && !empty($employeeId)){
$emp = new Employee();
$employees = $emp->Find("id = ?",array($employeeId));
}else{
$emp = new Employee();
$employees = $emp->Find("department = ? and status = 'Active'",array($department));
}
$reportData = array();
$reportData[] = array("Employee ID","Employee","Leave Type","Pending","Approved","Rejected","Canceled","Available","To be Accrued","Carried Forward from Previous Years");
foreach($employees as $employee){
$leaveEntitlements = $leaveActionManager->getEntitlementByEmployee($employee)->getObject();
foreach($leaveEntitlements as $leaveEntitlement){
$reportData[] = array(
$employee->employee_id,
$employee->first_name." ".$employee->last_name,
$leaveEntitlement['name'],
$leaveEntitlement['pendingLeaves'],
$leaveEntitlement['approvedLeaves'],
$leaveEntitlement['rejectedLeaves'],
$leaveEntitlement['cancelRequestedLeaves'],
$leaveEntitlement['availableLeaves'],
$leaveEntitlement['tobeAccrued'],
$leaveEntitlement['carriedForward']
);
}
}
return $reportData;
}
}

View File

@@ -0,0 +1,70 @@
<?php
if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
}
class EmployeeLeavesReport extends ReportBuilder{
public function getMainQuery(){
$query = "SELECT
(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = employee) as 'Employee',
(SELECT name from LeaveTypes where id = leave_type) as 'Leave Type',
(SELECT name from LeavePeriods where id = leave_period) as 'Leave Period',
date_start as 'Start Date',
date_end as 'End Date',
details as 'Reason',
status as 'Leave Status',
(select count(*) from EmployeeLeaveDays d where d.employee_leave = lv.id and leave_type = 'Full Day') as 'Full Day Count',
(select count(*) from EmployeeLeaveDays d where d.employee_leave = lv.id and leave_type = 'Half Day - Morning') as 'Half Day (Morning) Count',
(select count(*) from EmployeeLeaveDays d where d.employee_leave = lv.id and leave_type = 'Half Day - Afternoon') as 'Half Day (Afternoon) Count'
from EmployeeLeaves lv";
return $query;
}
public function getWhereQuery($request){
$employeeList = array();
if(!empty($request['employee'])){
$employeeList = json_decode($request['employee'],true);
}
if(in_array("NULL", $employeeList) ){
$employeeList = array();
}
if(!empty($employeeList) && ($request['status'] != "NULL" && !empty($request['status']))){
$query = "where employee in (".implode(",", $employeeList).") and date_start >= ? and date_end <= ? and status = ?;";
$params = array(
$request['date_start'],
$request['date_end'],
$request['status']
);
}else if(!empty($employeeList)){
$query = "where employee in (".implode(",", $employeeList).") and date_start >= ? and date_end <= ?;";
$params = array(
$request['date_start'],
$request['date_end']
);
}else if(($request['status'] != "NULL" && !empty($request['status']))){
$query = "where status = ? and date_start >= ? and date_end <= ?;";
$params = array(
$request['status'],
$request['date_start'],
$request['date_end']
);
}else{
$query = "where date_start >= ? and date_end <= ?;";
$params = array(
$request['date_start'],
$request['date_end']
);
}
LogManager::getInstance()->info("Query:".$query);
LogManager::getInstance()->info("Params:".json_encode($params));
return array($query, $params);
}
}

View File

@@ -0,0 +1,69 @@
<?php
if(!interface_exists('ReportBuilderInterface')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
}
class EmployeeTimeSheetData implements ReportBuilderInterface{
public function getData($report,$request){
$employeeCache = array();
$employeeList = array();
if(!empty($request['employee'])){
$employeeList = json_decode($request['employee'],true);
}
if(in_array("NULL", $employeeList) ){
$employeeList = array();
}
$employee_query = "";
if(!empty($employeeList)){
$employee_query = "employee in (".implode(",", $employeeList).") and ";
}
$timeSheet = new EmployeeTimeSheet();
if($request['status'] != "NULL"){
$timeSheets = $timeSheet->Find($employee_query."status = ? and date_start >= ? and date_end <= ?",
array($request['status'],$request['date_start'],$request['date_end']));
}else{
$timeSheets = $timeSheet->Find($employee_query."date_start >= ? and date_end <= ?",
array($request['date_start'],$request['date_end']));
}
if(!$timeSheets){
LogManager::getInstance()->info($timeSheet->ErrorMsg());
}
$reportData = array();
$reportData[] = array("Employee ID","Employee","Name","Start","End","Total Time","Status");
foreach($timeSheets as $ts){
$employee = $employeeCache[$ts->employee];
if(empty($employee)){
$employee = new Employee();
$employee->Load("id = ?",array($ts->employee));
if(empty($employee->id)){
continue;
}
$employeeCache[$employee->id] = $employee;
}
$reportData[] = array(
$employee->employee_id,
$employee->first_name." ".$employee->last_name,
date("F j, Y",strtotime($ts->date_start))." - ".date("F j, Y",strtotime($ts->date_end)),
$ts->date_start,
$ts->date_end,
$ts->getTotalTime(),
$ts->status
);
}
return $reportData;
}
}

View File

@@ -1,6 +1,6 @@
<?php
if(!interface_exists('ReportBuilderInterface')){
include_once MODULE_PATH.'/reportClasses/ReportBuilderInterface.php';
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
}
class EmployeeTimeTrackReport implements ReportBuilderInterface{
public function getData($report,$req){

View File

@@ -1,6 +1,6 @@
<?php
if(!class_exists('ReportBuilder')){
include_once MODULE_PATH.'/reportClasses/ReportBuilder.php';
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
}
class EmployeeTimesheetReport extends ReportBuilder{

View File

@@ -0,0 +1,68 @@
<?php
if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
}
class ExpenseReport extends ReportBuilder{
public function getMainQuery(){
$query = "SELECT
(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = employee) as 'Employee',
expense_date as 'Date',
(SELECT name from ExpensesPaymentMethods where id = payment_method) as 'Payment Method',
transaction_no as 'Transaction Ref',
payee as 'Payee',
(SELECT name from ExpensesCategories where id = category) as 'Category',
notes as 'Notes',
concat(`amount`,' ',`currency`) as 'Amount',
status as 'Status',
created as 'Created',
updated as 'Updated'
from EmployeeExpenses";
return $query;
}
public function getWhereQuery($request){
$employeeList = array();
if(!empty($request['employee'])){
$employeeList = json_decode($request['employee'],true);
}
if(in_array("NULL", $employeeList) ){
$employeeList = array();
}
if(!empty($employeeList) && ($request['status'] != "NULL" && !empty($request['status']))){
$query = "where employee in (".implode(",", $employeeList).") and date(expense_date) >= ? and date(expense_date) <= ? and status = ?;";
$params = array(
$request['date_start'],
$request['date_end'],
$request['status']
);
}else if(!empty($employeeList)){
$query = "where employee in (".implode(",", $employeeList).") and date(expense_date) >= ? and date(expense_date) <= ?;";
$params = array(
$request['date_start'],
$request['date_end']
);
}else if(($request['status'] != "NULL" && !empty($request['status']))){
$query = "where status = ? and date(expense_date) >= ? and date(expense_date) <= ?;";
$params = array(
$request['status'],
$request['date_start'],
$request['date_end']
);
}else{
$query = "where date(expense_date) >= ? and date(expense_date) <= ?;";
$params = array(
$request['date_start'],
$request['date_end']
);
}
return array($query, $params);
}
}

View File

@@ -1,6 +1,6 @@
<?php
if(!class_exists('ActiveEmployeeReport')){
include_once MODULE_PATH.'/reportClasses/ActiveEmployeeReport.php';
include_once APP_BASE_PATH.'admin/reports/reportClasses/ActiveEmployeeReport.php';
}
class NewHiresEmployeeReport extends ActiveEmployeeReport{

View File

@@ -0,0 +1,100 @@
<?php
if(!interface_exists('ReportBuilderInterface')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
}
if(!class_exists('AttendanceAdminManager')){
include_once APP_BASE_PATH.'admin/attendance/api/AttendanceAdminManager.php';
}
class OvertimeReport implements ReportBuilderInterface{
public function getData($report,$request){
$employeeList = array();
if(!empty($request['employee'])){
$employeeList = json_decode($request['employee'],true);
}
if(in_array("NULL", $employeeList) ){
$employeeList = array();
}
$sevenDateBefore = date('Y-m-d', strtotime('-7 days',strtotime($request['date_start'])));
if(!empty($employeeList)){
$query = "employee in (".implode(",", $employeeList).") and in_time >= ? and out_time <= ? order by in_time;";
$params = array(
$sevenDateBefore." 00:00:00",
$request['date_end']." 23:59:59",
);
}else{
$query = "in_time >= ? and out_time <= ? order by in_time;";
$params = array(
$sevenDateBefore." 00:00:00",
$request['date_end']." 23:59:59",
);
}
$at = new Attendance();
$attendance = $at->Find($query, $params);
//Group records by employee
$employeeAttendance = array();
foreach($attendance as $entry){
if(!isset($employeeAttendance[$entry->employee])){
$employeeAttendance[$entry->employee] = array();
}
$employeeAttendance[$entry->employee][] = $entry;
}
$atCalClassName = SettingsManager::getInstance()->getSetting('Attendance: Overtime Calculation Class');
$atCal = new $atCalClassName();
$reportData = array();
if(!$this->isAggregated()) {
$reportData[] = array("Date", "Employee ID", "Employee", "Time in Office", "Regular Time", "Overtime", "Double Time");
}else{
$reportData[] = array("Employee ID", "Employee", "Time in Office", "Regular Time", "Overtime", "Double Time");
}
foreach($employeeAttendance as $employeeId => $atData){
$employee = new Employee();
$employee->Load("id = ?",array($employeeId));
$atSum = $atCal->getData($atData, $request['date_start'], $this->isAggregated());
if(!$this->isAggregated()){
foreach($atSum as $date=>$counts){
$reportData[] = array(
$date,
$employee->employee_id,
$employee->first_name." ".$employee->last_name,
$counts['t'],
$counts['r'],
$counts['o'],
$counts['d']
);
}
}else{
$reportData[] = array(
$employee->employee_id,
$employee->first_name." ".$employee->last_name,
$atSum['t'],
$atSum['r'],
$atSum['o'],
$atSum['d']
);
}
}
return $reportData;
}
protected function isAggregated(){
return false;
}
}

View File

@@ -0,0 +1,10 @@
<?php
if(!interface_exists('OvertimeReport')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/OvertimeReport.php';
}
class OvertimeSummaryReport extends OvertimeReport{
protected function isAggregated(){
return true;
}
}

View File

@@ -1,6 +1,6 @@
<?php
if(!interface_exists('ReportBuilderInterface')){
include_once MODULE_PATH.'/reportClasses/ReportBuilderInterface.php';
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
}
abstract class ReportBuilder implements ReportBuilderInterface{

View File

@@ -1,6 +1,6 @@
<?php
if(!class_exists('ActiveEmployeeReport')){
include_once MODULE_PATH.'/reportClasses/ActiveEmployeeReport.php';
include_once APP_BASE_PATH.'admin/reports/reportClasses/ActiveEmployeeReport.php';
}
class TerminatedEmployeeReport extends ActiveEmployeeReport{

View File

@@ -0,0 +1,69 @@
<?php
if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
}
class TravelRequestReport extends ReportBuilder{
public function getMainQuery(){
$query = "SELECT
(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = employee) as 'Employee',
type as 'Type',
purpose as 'Purpose',
travel_from as 'Travel From',
travel_to as 'Travel To',
travel_date as 'Travel Date',
return_date as 'Return Date',
details as 'Other Details',
concat(`funding`,' ',`currency`) as 'Funding',
status as 'Status',
created as 'Created',
updated as 'Updated'
from EmployeeTravelRecords";
return $query;
}
public function getWhereQuery($request){
$employeeList = array();
if(!empty($request['employee'])){
$employeeList = json_decode($request['employee'],true);
}
if(in_array("NULL", $employeeList) ){
$employeeList = array();
}
if(!empty($employeeList) && ($request['status'] != "NULL" && !empty($request['status']))){
$query = "where employee in (".implode(",", $employeeList).") and date(travel_date) >= ? and date(return_date) <= ? and status = ?;";
$params = array(
$request['date_start'],
$request['date_end'],
$request['status']
);
}else if(!empty($employeeList)){
$query = "where employee in (".implode(",", $employeeList).") and date(travel_date) >= ? and date(return_date) <= ?;";
$params = array(
$request['date_start'],
$request['date_end']
);
}else if(($request['status'] != "NULL" && !empty($request['status']))){
$query = "where status = ? and date(travel_date) >= ? and date(return_date) <= ?;";
$params = array(
$request['status'],
$request['date_start'],
$request['date_end']
);
}else{
$query = "where date(travel_date) >= ? and date(return_date) <= ?;";
$params = array(
$request['date_start'],
$request['date_end']
);
}
return array($query, $params);
}
}

View File

@@ -0,0 +1,17 @@
<div class="col-lg-3 col-xs-12">
<div class="small-box bg-green">
<div class="inner">
<h3>Settings</h3>
<p>
Configure IceHrm
</p>
</div>
<div class="icon">
<i class="ion ion-settings"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="settingsLink">
Update Settings <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -51,5 +51,11 @@ modJsList['tabSetting'].setShowAddNew(false);
var modJs = modJsList['tabSetting'];
$(window).load(function() {
modJs.loadRemoteDataForSettings();
});
</script>
<?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -55,6 +55,11 @@ SettingAdapter.method('getMetaFieldForRendering', function(fieldName) {
return "";
});
SettingAdapter.method('edit', function(id) {
this.loadRemoteDataForSettings();
this.uber('edit',id);
});
SettingAdapter.method('fillForm', function(object) {
this.uber('fillForm',object);
@@ -62,6 +67,22 @@ SettingAdapter.method('fillForm', function(object) {
});
SettingAdapter.method('loadRemoteDataForSettings', function () {
var field = ["country", {"label": "Country", "type": "select2", "remote-source": ["Country", "code", "name"]}];
if (field[1]['remote-source'] != undefined && field[1]['remote-source'] != null) {
var key = field[1]['remote-source'][0] + "_" + field[1]['remote-source'][1] + "_" + field[1]['remote-source'][2];
this.fieldMasterDataKeys[key] = false;
this.sourceMapping[field[0]] = field[1]['remote-source'];
var callBackData = {};
callBackData['callBack'] = 'initFieldMasterDataResponse';
callBackData['callBackData'] = [key];
this.getFieldValues(field[1]['remote-source'], callBackData);
}
});
SettingAdapter.method('getHelpLink', function () {
return 'http://blog.icehrm.com/docs/settings/';
});
});

View File

@@ -1,11 +1,11 @@
{
"label":"Settings",
"menu":"System",
"order":"1",
"icon":"fa-cogs",
"user_levels":["Admin"],
"permissions":
{
}
"label":"Settings",
"menu":"System",
"order":"1",
"icon":"fa-cogs",
"user_levels":["Admin"],
"dashboardPosition":8,
"permissions":
{
}
}

View File

@@ -0,0 +1,19 @@
<div class="col-lg-3 col-xs-12">
<div class="small-box bg-red">
<div class="inner">
<h3>
Travel
</h3>
<p id="numberOfTravel">
Requests
</p>
</div>
<div class="icon">
<i class="ion ion-plane"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="travelLink">
Manage Travel <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -1,11 +1,12 @@
{
"label":"Travel Administration",
"menu":"Employees",
"order":"6",
"icon":"fa-plane",
"user_levels":["Admin","Manager"],
"label":"Travel Administration",
"menu":"Employees",
"order":"6",
"icon":"fa-plane",
"user_levels":["Admin","Manager"],
"dashboardPosition":12,
"permissions":
{
}
"permissions":
{
}
}

View File

@@ -19,6 +19,14 @@ if (!class_exists('UsersAdminManager')) {
$this->addModelClass('User');
}
public function getDashboardItemData(){
$data = array();
$user = new User();
$data['numberOfUsers'] = $user->Count("1 = 1");
return $data;
}
}
}
@@ -53,4 +61,18 @@ if (!class_exists('User')) {
var $_table = 'Users';
}
}
if (!class_exists('UserRole')) {
class UserRole extends ICEHRM_Record {
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getUserAccess(){
return array();
}
var $_table = 'UserRoles';
}
}

View File

@@ -0,0 +1,17 @@
<div class="col-lg-3 col-xs-12">
<div class="small-box bg-yellow">
<div class="inner">
<h3>Users</h3>
<p id="numberOfUsers">
#_numberOfUsers_# Users
</p>
</div>
<div class="icon">
<i class="ion ion-person-add"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="usersLink">
Manage Users <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -30,6 +30,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
<li class="active"><a id="tabUser" href="#tabPageUser">Users</a></li>
<li class=""><a id="tabUserRole" href="#tabPageUserRole">User Roles</a></li>
</ul>
<div class="tab-content">
@@ -41,6 +42,14 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</div>
</div>
<div class="tab-pane" id="tabPageUserRole">
<div id="UserRole" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="UserRoleForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
</div>
</div>
@@ -50,7 +59,7 @@ modJsList['tabUser'] = new UserAdapter('User');
<?php if(isset($_REQUEST['action']) && $_REQUEST['action'] == "new" && isset($_REQUEST['object'])){?>
modJsList['tabUser'].newInitObject = JSON.parse(Base64.decode('<?=$_REQUEST['object']?>'));
<?php }?>
modJsList['tabUserRole'] = new UserRoleAdapter('UserRole');
var modJs = modJsList['tabUser'];
</script>

View File

@@ -35,7 +35,9 @@ UserAdapter.method('getFormFields', function() {
[ "username", {"label":"User Name","type":"text","validation":"username"}],
[ "email", {"label":"Email","type":"text","validation":"email"}],
[ "employee", {"label":"Employee","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
[ "user_level", {"label":"User Level","type":"select","source":[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"]]}]
[ "user_level", {"label":"User Level","type":"select","source":[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"],["Other","Other"]]}],
[ "user_roles", {"label":"User Roles","type":"select2multi","remote-source":["UserRole","id","name"]}],
[ "default_module", {"label":"Default Module","type":"select2","null-label":"No Default Module","allow-null":true,"remote-source":["Module","id","menu+label"]}]
];
});
@@ -62,8 +64,8 @@ UserAdapter.method('saveUserFailCallBack', function(callBackData,serverData) {
UserAdapter.method('doCustomValidation', function(params) {
var msg = null;
if(params['user_level'] != "Admin" && params['employee'] == "NULL"){
msg = "For non Admin users, you have to assign an employee when adding or editing the user.<br/>";
if((params['user_level'] != "Admin" && params['user_level'] != "Other") && params['employee'] == "NULL"){
msg = "For this user type, you have to assign an employee when adding or editing the user.<br/>";
msg += " You may create a new employee through 'Admin'->'Employees' menu";
}
return msg;
@@ -154,9 +156,39 @@ UserAdapter.method('changePasswordFailCallBack', function(callBackData,serverDat
this.showMessage("Error",callBackData);
});
UserAdapter.method('getHelpLink', function () {
return 'http://blog.icehrm.com/?page_id=132';
/**
* UserRoleAdapter
*/
function UserRoleAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
}
UserRoleAdapter.inherits(AdapterBase);
UserRoleAdapter.method('getDataMapping', function() {
return [
"id",
"name"
];
});
UserRoleAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Name"}
];
});
UserRoleAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "name", {"label":"Name","type":"text","validation":""}]
];
});

View File

@@ -1,11 +1,12 @@
{
"label":"Users",
"menu":"System",
"order":"2",
"icon":"fa-user",
"user_levels":["Admin"],
"label":"Users",
"menu":"System",
"order":"2",
"icon":"fa-user",
"user_levels":["Admin"],
"dashboardPosition":3,
"permissions":
{
}
"permissions":
{
}
}

View File

@@ -0,0 +1,17 @@
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner">
<h3 id="lastPunchTime">
Punch In
</h3>
<p>or punch out</p>
</div>
<div class="icon">
<i class="ion ion-ios7-alarm-outline"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="atteandanceLink">
Record Attendance <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -4,7 +4,7 @@
"order":"2",
"icon":"fa-clock-o",
"user_levels":["Admin","Manager","Employee"],
"dashboardPosition":102,
"permissions":
{
}

View File

@@ -21,49 +21,82 @@ Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
*/
include (APP_BASE_PATH."modules/leaves/api/LeavesActionManager.php");
class DashboardActionManager extends SubActionManager{
public function getPendingLeaves($req){
return new IceResponse(IceResponse::SUCCESS,0);
}
public function getLastTimeSheetHours($req){
$timeSheet = new EmployeeTimeSheet();
$timeSheet->Load("employee = ? order by date_end desc limit 1",array($this->getCurrentProfileId()));
if(empty($timeSheet->employee)){
return new IceResponse(IceResponse::SUCCESS,"0:00");
}
$timeSheetEntry = new EmployeeTimeEntry();
$list = $timeSheetEntry->Find("timesheet = ?",array($timeSheet->id));
$seconds = 0;
foreach($list as $entry){
$seconds += (strtotime($entry->date_end) - strtotime($entry->date_start));
}
$minutes = (int)($seconds/60);
$rem = $minutes % 60;
$hours = ($minutes - $rem)/60;
if($rem < 10){
$rem ="0".$rem;
}
return new IceResponse(IceResponse::SUCCESS,$hours.":".$rem);
}
public function getEmployeeActiveProjects($req){
$project = new EmployeeProject();
$projects = $project->Find("employee = ? and status =?",array($this->getCurrentProfileId(),'Current'));
return new IceResponse(IceResponse::SUCCESS,count($projects));
}
public function getPendingLeaves($req){
$lam = new LeavesActionManager();
$leavePeriod = $lam->getCurrentLeavePeriod(date("Y-m-d H:i:s"), date("Y-m-d H:i:s"));
$leave = new EmployeeLeave();
$pendingLeaves = $leave->Find("status = ? and employee = ?",array("Pending", $this->getCurrentProfileId()));
return new IceResponse(IceResponse::SUCCESS,count($pendingLeaves));
}
public function getInitData($req){
$data = array();
$emp = new Employee();
$data['numberOfEmployees'] = $emp->Count("status = 'Active' and supervisor = ?",array($this->getCurrentProfileId()));
$data['lastTimeSheetHours'] = $this->getLastTimeSheetHours($req)->getData();
$data['activeProjects'] = $this->getEmployeeActiveProjects($req)->getData();
$data['pendingLeaves'] = $this->getPendingLeaves($req)->getData();
$candidate = new Candidate();
$data['numberOfCandidates'] = $candidate->Count("1 = 1");
$job = new Job();
$data['numberOfJobs'] = $job->Count("status = 'Active'");
$attendance = new Attendance();
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
$course = new Course();
$data['numberOfCourses'] = $course->Count("1 = 1");
return new IceResponse(IceResponse::SUCCESS,$data);
}
public function getLastTimeSheetHours($req){
$timeSheet = new EmployeeTimeSheet();
$timeSheet->Load("employee = ? order by date_end desc limit 1",array($this->getCurrentProfileId()));
if(empty($timeSheet->employee)){
return new IceResponse(IceResponse::SUCCESS,"0:00");
}
$timeSheetEntry = new EmployeeTimeEntry();
$list = $timeSheetEntry->Find("timesheet = ?",array($timeSheet->id));
$seconds = 0;
foreach($list as $entry){
$seconds += (strtotime($entry->date_end) - strtotime($entry->date_start));
}
$minutes = (int)($seconds/60);
$rem = $minutes % 60;
$hours = ($minutes - $rem)/60;
if($rem < 10){
$rem ="0".$rem;
}
return new IceResponse(IceResponse::SUCCESS,$hours.":".$rem);
}
public function getEmployeeActiveProjects($req){
$project = new EmployeeProject();
$projects = $project->Find("employee = ? and status =?",array($this->getCurrentProfileId(),'Current'));
return new IceResponse(IceResponse::SUCCESS,count($projects));
}
}

View File

@@ -26,186 +26,41 @@ define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.php';
?><div class="span9">
<div class="row">
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner">
<h3 id="lastPunchTime">
..
</h3>
<p id="punchTimeText">
Waiting for Response..
</p>
</div>
<div class="icon">
<i class="ion ion-ios7-alarm-outline"></i>
</div>
<a href="#" class="small-box-footer" id="atteandanceLink">
Record Attendance <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3 id="timeSheetHoursWorked">..</h3>
<p>
Hours worked Last Week
</p>
</div>
<div class="icon">
<i class="ion ion-clock"></i>
</div>
<a href="#" class="small-box-footer" id="timesheetLink">
Update Time Sheet <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3 id="numberOfProjects">..</h3>
<p>
Active Projects
</p>
</div>
<div class="icon">
<i class="ion ion-pie-graph"></i>
</div>
<a href="#" class="small-box-footer" id="projectsLink">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-teal">
<div class="inner">
<h3>
My Travel
</h3>
<p>
Requests
</p>
</div>
<div class="icon">
<i class="ion ion-plane"></i>
</div>
<a href="#" class="small-box-footer" id="travelLink">
Travel Requests <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3>
Help
</h3>
<p>
User Guide
</p>
</div>
<div class="icon">
<i class="ion ion-help"></i>
</div>
<a href="http://blog.icehrm.com/docs/home/" target="_blank" class="small-box-footer" id="icehrmHelpLink">
Documentation <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<?php if($user->user_level == "Manager" || $user->user_level == "Admin"){?>
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner">
<h3>
Employees
</h3>
<p id="numberOfEmployees">
Subordinates
</p>
</div>
<div class="icon">
<i class="ion ion-person-stalker"></i>
</div>
<a href="#" class="small-box-footer" id="employeeLink">
Manage Subordinates <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="row">
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3>
Travel
</h3>
<p id="numberOfTravel">
Management
</p>
</div>
<div class="icon">
<i class="ion ion-plane"></i>
</div>
<a href="#" class="small-box-footer" id="traveAdminlLink">
Manage Travel <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3>
Attendance
</h3>
<p id="numberOfDocuments">
Monitor
</p>
</div>
<div class="icon">
<i class="ion ion-ios7-timer"></i>
</div>
<a href="#" class="small-box-footer" id="attendanceAdminLink">
View Attendance <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<?php
$moduleManagers = BaseService::getInstance()->getModuleManagers();
$dashBoardList = array();
foreach($moduleManagers as $moduleManagerObj){
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-teal">
<div class="inner">
<h3>Reports</h3>
<p>
View / Download Reports
</p>
</div>
<div class="icon">
<i class="ion ion-document-text"></i>
</div>
<a href="#" class="small-box-footer" id="reportsLink">
Create a Report <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
$allowed = BaseService::getInstance()->isModuleAllowedForUser($moduleManagerObj);
if(!$allowed){
continue;
}
$item = $moduleManagerObj->getDashboardItem();
if(!empty($item)) {
$index = $moduleManagerObj->getDashboardItemIndex();
$dashBoardList[$index] = $item;
}
}
ksort($dashBoardList);
foreach($dashBoardList as $k=>$v){
echo $v;
}
?>
<?php }?>
</div>
</div>
</div>
<script>
@@ -214,22 +69,30 @@ var modJsList = new Array();
modJsList['tabDashboard'] = new DashboardAdapter('Dashboard','Dashboard');
var modJs = modJsList['tabDashboard'];
/*
$("#employeeLink").attr("href",modJs.getCustomUrl('?g=admin&n=employees&m=admin_Admin'));
$("#jobsLink").attr("href",modJs.getCustomUrl('?g=admin&n=jobpositions&m=admin_Recruitment'));
$("#candidatesLink").attr("href",modJs.getCustomUrl('?g=admin&n=candidates&m=admin_Recruitment'));
$("#projectAdminLink").attr("href",modJs.getCustomUrl('?g=admin&n=projects&m=admin_Admin'));
$("#trainingLink").attr("href",modJs.getCustomUrl('?g=admin&n=training&m=admin_Admin'));
$("#travelLink").attr("href",modJs.getCustomUrl('?g=admin&n=travel&m=admin_Employees'));
$("#documentLink").attr("href",modJs.getCustomUrl('?g=admin&n=documents&m=admin_Employees'));
$("#expenseLink").attr("href",modJs.getCustomUrl('?g=admin&n=expenses&m=admin_Employees'));
$("#myProfileLink").attr("href",modJs.getCustomUrl('?g=modules&n=employees&m=module_Personal_Information'));
$("#atteandanceLink").attr("href",modJs.getCustomUrl('?g=modules&n=attendance&m=module_Time_Management'));
$("#attendanceAdminLink").attr("href",modJs.getCustomUrl('?g=admin&n=attendance&m=admin_Admin'));
$("#leavesLink").attr("href",modJs.getCustomUrl('?g=modules&n=leaves&m=module_Leaves'));
$("#timesheetLink").attr("href",modJs.getCustomUrl('?g=modules&n=time_sheets&m=module_Time_Management'));
$("#projectsLink").attr("href",modJs.getCustomUrl('?g=modules&n=projects&m=module_Time_Management'));
$("#traveAdminlLink").attr("href",modJs.getCustomUrl('?g=admin&n=travel&m=admin_Employees'));
$("#travelLink").attr("href",modJs.getCustomUrl('?g=modules&n=travel&m=module_Travel_Management'));
$("#reportsLink").attr("href",modJs.getCustomUrl('?g=admin&n=reports&m=admin_Reports'));
$("#projectsLink").attr("href",modJs.getCustomUrl('?g=modules&n=projects&m=module_Personal_Information'));
$("#myDocumentsLink").attr("href",modJs.getCustomUrl('?g=modules&n=documents&m=module_Documents'));
$("#mytravelLink").attr("href",modJs.getCustomUrl('?g=modules&n=travel&m=module_Travel_Management'));
$("#myExpensesLink").attr("href",modJs.getCustomUrl('?g=modules&n=expenses&m=module_Finance'));
modJs.getPunch();
modJs.getPendingLeaves();
modJs.getLastTimeSheetHours();
modJs.getEmployeeActiveProjects();
modJs.getInitData();
*/
</script>
<?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -1,27 +1,27 @@
/*
This file is part of iCE Hrm.
This file is part of iCE Hrm.
iCE Hrm is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
iCE Hrm is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
iCE Hrm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
iCE Hrm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with iCE Hrm. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with iCE Hrm. If not, see <http://www.gnu.org/licenses/>.
------------------------------------------------------------------
------------------------------------------------------------------
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
*/
function DashboardAdapter(endPoint) {
this.initAdapter(endPoint);
this.initAdapter(endPoint);
}
DashboardAdapter.inherits(AdapterBase);
@@ -29,15 +29,15 @@ DashboardAdapter.inherits(AdapterBase);
DashboardAdapter.method('getDataMapping', function() {
return [];
return [];
});
DashboardAdapter.method('getHeaders', function() {
return [];
return [];
});
DashboardAdapter.method('getFormFields', function() {
return [];
return [];
});
@@ -46,128 +46,85 @@ DashboardAdapter.method('get', function(callBackData) {
DashboardAdapter.method('getPunch', function() {
var that = this;
var object = {};
object['date'] = this.getClientDate(new Date()).toISOString().slice(0, 19).replace('T', ' ');
object['offset'] = this.getClientGMTOffset();
var reqJson = JSON.stringify(object);
var callBackData = [];
callBackData['callBackData'] = [];
callBackData['callBackSuccess'] = 'getPunchSuccessCallBack';
callBackData['callBackFail'] = 'getPunchFailCallBack';
this.customAction('getPunch','modules=attendance',reqJson,callBackData);
var that = this;
var object = {};
object['date'] = this.getClientDate(new Date()).toISOString().slice(0, 19).replace('T', ' ');
object['offset'] = this.getClientGMTOffset();
var reqJson = JSON.stringify(object);
var callBackData = [];
callBackData['callBackData'] = [];
callBackData['callBackSuccess'] = 'getPunchSuccessCallBack';
callBackData['callBackFail'] = 'getPunchFailCallBack';
this.customAction('getPunch','modules=attendance',reqJson,callBackData);
});
DashboardAdapter.method('getPunchSuccessCallBack', function(callBackData) {
var punch = callBackData;
if(punch == null){
$("#lastPunchTime").html("Not");
$("#punchTimeText").html("Punched In");
}else{
$("#lastPunchTime").html(Date.parse(punch.in_time).toString('h:mm tt'));
$("#punchTimeText").html("Punched In");
}
var punch = callBackData;
if(punch == null){
$("#lastPunchTime").html("Not");
$("#punchTimeText").html("Punched In");
}else{
$("#lastPunchTime").html(Date.parse(punch.in_time).toString('h:mm tt'));
$("#punchTimeText").html("Punched In");
}
});
DashboardAdapter.method('getPunchFailCallBack', function(callBackData) {
});
DashboardAdapter.method('getInitData', function() {
var that = this;
var object = {};
var reqJson = JSON.stringify(object);
var callBackData = [];
callBackData['callBackData'] = [];
callBackData['callBackSuccess'] = 'getInitDataSuccessCallBack';
callBackData['callBackFail'] = 'getInitDataFailCallBack';
DashboardAdapter.method('getPendingLeaves', function() {
var that = this;
var object = {};
var reqJson = JSON.stringify(object);
var callBackData = [];
callBackData['callBackData'] = [];
callBackData['callBackSuccess'] = 'getPendingLeavesSuccessCallBack';
callBackData['callBackFail'] = 'getPendingLeavesFailCallBack';
this.customAction('getPendingLeaves','modules=dashboard',reqJson,callBackData);
this.customAction('getInitData','modules=dashboard',reqJson,callBackData);
});
DashboardAdapter.method('getPendingLeavesSuccessCallBack', function(callBackData) {
var leaveCount = callBackData;
$("#pendingLeaveCount").html(leaveCount);
DashboardAdapter.method('getInitDataSuccessCallBack', function(data) {
$("#timeSheetHoursWorked").html(data['lastTimeSheetHours']);
$("#numberOfProjects").html(data['activeProjects']);
$("#pendingLeaveCount").html(data['pendingLeaves']);
$("#numberOfEmployees").html(data['numberOfEmployees']+" Subordinates");
$("#numberOfCandidates").html(data['numberOfCandidates']+" Candidates");
$("#numberOfJobs").html(data['numberOfJobs']+" Active");
$("#numberOfCourses").html(data['numberOfCourses']+" Active");
});
DashboardAdapter.method('getPendingLeavesFailCallBack', function(callBackData) {
DashboardAdapter.method('getInitDataFailCallBack', function(callBackData) {
});
DashboardAdapter.method('getLastTimeSheetHours', function() {
var that = this;
var object = {};
var reqJson = JSON.stringify(object);
var callBackData = [];
callBackData['callBackData'] = [];
callBackData['callBackSuccess'] = 'getLastTimeSheetHoursSuccessCallBack';
callBackData['callBackFail'] = 'getLastTimeSheetHoursFailCallBack';
this.customAction('getLastTimeSheetHours','modules=dashboard',reqJson,callBackData);
});
DashboardAdapter.method('getLastTimeSheetHoursSuccessCallBack', function(callBackData) {
var hours = callBackData;
$("#timeSheetHoursWorked").html(hours);
});
DashboardAdapter.method('getLastTimeSheetHoursFailCallBack', function(callBackData) {
});
DashboardAdapter.method('getEmployeeActiveProjects', function() {
var that = this;
var object = {};
var reqJson = JSON.stringify(object);
var callBackData = [];
callBackData['callBackData'] = [];
callBackData['callBackSuccess'] = 'getEmployeeActiveProjectsSuccessCallBack';
callBackData['callBackFail'] = 'getEmployeeActiveProjectsFailCallBack';
this.customAction('getEmployeeActiveProjects','modules=dashboard',reqJson,callBackData);
});
DashboardAdapter.method('getEmployeeActiveProjectsSuccessCallBack', function(callBackData) {
var hours = callBackData;
$("#numberOfProjects").html(hours);
});
DashboardAdapter.method('getEmployeeActiveProjectsFailCallBack', function(callBackData) {
});
DashboardAdapter.method('getClientDate', function (date) {
var offset = this.getClientGMTOffset();
var offset = this.getClientGMTOffset();
var tzDate = date.addMinutes(offset*60);
return tzDate;
});
DashboardAdapter.method('getClientGMTOffset', function () {
var rightNow = new Date();
var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
var temp = jan1.toGMTString();
var jan2 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
return std_time_offset;
var rightNow = new Date();
var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
var temp = jan1.toGMTString();
var jan2 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
return std_time_offset;
});

View File

@@ -0,0 +1,15 @@
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3>My Projects</h3>
<p>Projects Assigned</p>
</div>
<div class="icon">
<i class="ion ion-pie-graph"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="projectsLink">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -4,7 +4,7 @@
"order":"1",
"icon":"fa-pencil-square",
"user_levels":["Admin","Manager","Employee"],
"dashboardPosition":105,
"permissions":
{
"Manager":{

View File

@@ -19,4 +19,4 @@
"Delete Salary":"No"
}
}
}
}

View File

@@ -64,6 +64,13 @@ class Time_sheetsActionManager extends SubActionManager{
$oldStatus = $timeSheet->status;
$timeSheet->status = $req->status;
//Auto approve admin timesheets
if($req->status == 'Submitted' && BaseService::getInstance()->getCurrentUser()->user_level == "Admin"){
$timeSheet->status = 'Approved';
}
if($oldStatus == $req->status){
return new IceResponse(IceResponse::SUCCESS,"");

View File

@@ -23,6 +23,39 @@ if (!class_exists('Time_sheetsModulesManager')) {
}
public function getDashboardItemData(){
$data = array();
$data['timeSheetHoursWorked'] = $this->getLastTimeSheetHours()->getData();
return $data;
}
private function getLastTimeSheetHours(){
$timeSheet = new EmployeeTimeSheet();
$timeSheet->Load("employee = ? order by date_end desc limit 1",array(BaseService::getInstance()->getCurrentProfileId()));
if(empty($timeSheet->employee)){
return new IceResponse(IceResponse::SUCCESS,"0:00");
}
$timeSheetEntry = new EmployeeTimeEntry();
$list = $timeSheetEntry->Find("timesheet = ?",array($timeSheet->id));
$seconds = 0;
foreach($list as $entry){
$seconds += (strtotime($entry->date_end) - strtotime($entry->date_start));
}
$minutes = (int)($seconds/60);
$rem = $minutes % 60;
$hours = ($minutes - $rem)/60;
if($rem < 10){
$rem ="0".$rem;
}
return new IceResponse(IceResponse::SUCCESS,$hours.":".$rem);
}
}
}
@@ -46,6 +79,41 @@ if (!class_exists('EmployeeTimeSheet')) {
public function getUserOnlyMeAccess(){
return array("element","save","delete");
}
public function getTotalTime()
{
$start = $this->date_start . " 00:00:00";
$end = $this->date_end . " 23:59:59";
$timeEntry = new EmployeeTimeEntry();
$list = $timeEntry->Find("employee = ? and ((date_start >= ? and date_start <= ?) or (date_end >= ? and date_end <= ?))", array($this->employee, $start, $end, $start, $end));
$seconds = 0;
foreach ($list as $entry) {
$secondsTemp = (strtotime($entry->date_end) - strtotime($entry->date_start));
if ($secondsTemp < 0) {
$secondsTemp = 0;
}
$seconds += $secondsTemp;
}
$totMinutes = round($seconds / 60);
$minutes = $totMinutes % 60;
$hours = ($totMinutes - $minutes) / 60;
return CalendarTools::addLeadingZero($hours) . ":" . CalendarTools::addLeadingZero($minutes);
}
public function postProcessGetData($entry){
$entry->total_time = $this->getTotalTime();
return $entry;
}
}
class EmployeeTimeEntry extends ICEHRM_Record {

View File

@@ -0,0 +1,17 @@
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3>#_timeSheetHoursWorked_#</h3>
<p>
Hours worked Last Week
</p>
</div>
<div class="icon">
<i class="ion ion-clock"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="timesheetLink">
Update Time Sheet <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -34,6 +34,7 @@ EmployeeTimeSheetAdapter.method('getDataMapping', function() {
"id",
"date_start",
"date_end",
"total_time",
"status"
];
});
@@ -43,6 +44,7 @@ EmployeeTimeSheetAdapter.method('getHeaders', function() {
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Start Date"},
{ "sTitle": "End Date"},
{ "sTitle": "Total Time"},
{ "sTitle": "Status"}
];
});
@@ -533,14 +535,16 @@ EmployeeTimeEntryAdapter.method('renderForm', function(object) {
//append dates
var dateStart = new Date(this.currentTimesheet.date_start.replace(" ","T"));
var dateStop = new Date(this.currentTimesheet.date_end.replace(" ","T"));
var dateStart = new Date(this.currentTimesheet.date_start);
var dateStop = new Date(this.currentTimesheet.date_end);
var datesArray = this.getDates(dateStart, dateStop);
var optionList = "";
for(var i=0; i<datesArray.length; i++){
optionList += '<option value="'+datesArray[i].toString("yyyy-MM-dd")+'">'+datesArray[i].toString("d-MMM-yyyy")+'</option>';
var k = datesArray[i];
//optionList += '<option value="'+datesArray[i].toString("yyyy-MM-dd")+'">'+datesArray[i].toString("d-MMM-yyyy")+'</option>';
optionList += '<option value="'+k.getUTCFullYear()+"-"+(k.getUTCMonth()+1)+"-"+k.getUTCDate()+'">'+k.toUTCString().slice(0, -13)+'</option>';
}
@@ -665,8 +669,8 @@ EmployeeTimeEntryAdapter.method('save', function() {
});
EmployeeTimeEntryAdapter.method('doCustomValidation', function(params) {
var st = Date.parse(params.date_start.replace(" ","T"));
var et = Date.parse(params.date_end.replace(" ","T"));
var st = Date.parse(params.date_start);
var et = Date.parse(params.date_end);
if(st.compareTo(et) != -1){
return "Start time should be less than End time";
}

View File

@@ -4,6 +4,7 @@
"order":"3",
"icon":"fa-check-circle-o",
"user_levels":["Admin","Manager","Employee"],
"dashboardPosition":104,
"permissions":
{

View File

@@ -0,0 +1,17 @@
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner">
<h3>My Travel</h3>
<p>
Management
</p>
</div>
<div class="icon">
<i class="ion ion-plane"></i>
</div>
<a href="#_moduleLink_#" class="small-box-footer" id="mytravelLink">
Travel Management <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>

View File

@@ -4,7 +4,7 @@
"order":"1",
"icon":"fa-plane",
"user_levels":["Admin","Manager","Employee"],
"dashboardPosition":107,
"permissions":
{
"Manager":{

View File

@@ -49,7 +49,7 @@ Following is a list of features supported in each version of icehrm
* [Travel Management](http://icehrm.com) - Module for managing travel requests
### IceHrm Pro Version | [Buy now for 199 USD](http://icehrm.com)
### IceHrm Pro Version | [Buy now for 349.49 USD](http://icehrm.com)
IceHrm Profession version (in short IceHrmPro) is the feature rich commercial alternative for icehrm
open source version. IceHrm Pro supports following features
@@ -90,7 +90,7 @@ You can learn more about [IceHrm Pro here](http://blog.icehrm.com/docs/icehrm-pr
To purchase IceHrmPro please visit [http://icehrm.com/modules.php](http://icehrm.com/modules.php)
### IceHrm Enterprise Version [Starts from 575 USD](http://icehrm.com)
### IceHrm Enterprise Version [Starts from 1498 USD](http://icehrm.com)
In addition to pro version features icehrm enterprise version includes following features
@@ -532,6 +532,46 @@ That way you can attach each and every project to a client.
Under employee projects tab you can assign projects to employees. You need to add projects to employees to enable them to add time against
these projects in time-sheets.
Release note v15.2
------------------
### Features
* Overtime Reports
* Overtime calculation for california
### Fixes
* Fix issue: uncaught error when placeholder value is empty
* Log email sending success status
* Fix broken longer company name issue
* Make the application accessible when client on an intranet with no internet connection
* Fix issue: when a module is disabled other modules depend on it stops working
Release note v15.0
------------------
### Features
* Clear HTML5 local storage when logging in and switching users
* Showing a loading message while getting data from server
* Adding a new field to show total time of each time sheet
* New report added for listing Employee Time Sheets
* Company logo uploaded via settings will be used for all email headers
### Fixes
* Fix issue: default module URL is incorrect for Employees
* Fix date parsing issue in time sheets
* AWS phar is included only when required
Release note v14.1
------------------
### Features
* Add Quick access menu
### Fixes
* Fix issue: salary module not loading
* Add travel report
Release note v14.0
------------------

View File

@@ -95,13 +95,14 @@ AdapterBase.method('add', function(object,getFunctionCallBackData,callGetFunctio
}
$(object).attr('a','add');
$(object).attr('t',this.table);
that.showLoader();
$.post(this.moduleRelativeURL, object, function(data) {
if(data.status == "SUCCESS"){
that.addSuccessCallBack(getFunctionCallBackData,data.object, callGetFunction, successCallback, that);
}else{
that.addFailCallBack(getFunctionCallBackData,data.object);
}
},"json");
},"json").always(function() {that.hideLoader()});
this.trackEvent("add",this.tab,this.table);
});
@@ -126,13 +127,14 @@ AdapterBase.method('addFailCallBack', function(callBackData,serverData) {
AdapterBase.method('deleteObj', function(id,callBackData) {
var that = this;
that.showLoader();
$.post(this.moduleRelativeURL, {'t':this.table,'a':'delete','id':id}, function(data) {
if(data.status == "SUCCESS"){
that.deleteSuccessCallBack(callBackData,data.object);
}else{
that.deleteFailCallBack(callBackData,data.object);
}
},"json");
},"json").always(function() {that.hideLoader()});
this.trackEvent("delete",this.tab,this.table);
});
@@ -170,14 +172,15 @@ AdapterBase.method('get', function(callBackData) {
sourceMappingJson = this.fixJSON(sourceMappingJson);
filterJson = this.fixJSON(filterJson);
that.showLoader();
$.post(this.moduleRelativeURL, {'t':this.table,'a':'get','sm':sourceMappingJson,'ft':filterJson,'ob':orderBy}, function(data) {
if(data.status == "SUCCESS"){
that.getSuccessCallBack(callBackData,data.object);
}else{
that.getFailCallBack(callBackData,data.object);
}
},"json");
},"json").always(function() {that.hideLoader()});
that.initFieldMasterData();
@@ -274,13 +277,14 @@ AdapterBase.method('getElement', function(id,callBackData) {
var that = this;
var sourceMappingJson = JSON.stringify(this.getSourceMapping());
sourceMappingJson = this.fixJSON(sourceMappingJson);
$.post(this.moduleRelativeURL, {'t':this.table,'a':'getElement','id':id,'sm':sourceMappingJson}, function(data) {
that.showLoader();
$.post(this.moduleRelativeURL, {'t':this.table,'a':'getElement','id':id,'sm':sourceMappingJson}, function(data) {
if(data.status == "SUCCESS"){
that.getElementSuccessCallBack.apply(that,[callBackData,data.object]);
}else{
that.getElementFailCallBack.apply(that,[callBackData,data.object]);
}
},"json");
},"json").always(function() {that.hideLoader()});
this.trackEvent("getElement",this.tab,this.table);
});
@@ -361,6 +365,9 @@ AdapterBase.method('getFieldValues', function(fieldMaster,callBackData) {
AdapterBase.method('setAdminProfile', function(empId) {
var that = this;
try{
localStorage.clear();
}catch(e){}
$.post(this.moduleRelativeURL, {'a':'setAdminEmp','empid':empId}, function(data) {
top.location.href = clientUrl;
},"json");

View File

@@ -1094,6 +1094,12 @@ IceHRMBase.method('showFilters', function(object) {
});
});
/*
$tempDomObj.find('.signatureField').each(function() {
$(this).data('signaturePad',new SignaturePad($(this)));
});
*/
//var tHtml = $tempDomObj.wrap('<div>').parent().html();
this.showDomElement("Edit",$tempDomObj,null,null,true);
$(".filterBtn").off();
@@ -1134,6 +1140,7 @@ IceHRMBase.method('preRenderForm', function(object) {
IceHRMBase.method('renderForm', function(object) {
var that = this;
var signatureIds = [];
if(object == null || object == undefined){
this.currentId = null;
}
@@ -1200,6 +1207,12 @@ IceHRMBase.method('renderForm', function(object) {
});
});
$tempDomObj.find('.signatureField').each(function() {
//$(this).data('signaturePad',new SignaturePad($(this)));
signatureIds.push($(this).attr('id'));
});
for(var i=0;i<fields.length;i++){
if(fields[i][1].type == "datagroup"){
@@ -1239,6 +1252,14 @@ IceHRMBase.method('renderForm', function(object) {
if(!this.showFormOnPopup){
$("#"+this.getTableName()+'Form').show();
$("#"+this.getTableName()).hide();
for(var i=0;i<signatureIds.length;i++){
$("#"+signatureIds[i])
.data('signaturePad',
new SignaturePad(document.getElementById(signatureIds[i])));
}
if(object != undefined && object != null){
this.fillForm(object);
}
@@ -1253,6 +1274,14 @@ IceHRMBase.method('renderForm', function(object) {
$("#plainMessageModel .modal-body").html("");
$("#plainMessageModel .modal-body").append($tempDomObj);
for(var i=0;i<signatureIds.length;i++){
$("#"+signatureIds[i])
.data('signaturePad',
new SignaturePad(document.getElementById(signatureIds[i])));
}
if(object != undefined && object != null){
this.fillForm(object,"#"+randomFormId);
@@ -1406,7 +1435,11 @@ IceHRMBase.method('showDataGroup', function(field, object) {
});
});
/*
$tempDomObj.find('.signatureField').each(function() {
$(this).data('signaturePad',new SignaturePad($(this)));
});
*/
this.currentDataGroupField = field;
this.showDomElement("Add "+field[1]['label'],$tempDomObj,null,null,true);
@@ -1645,7 +1678,10 @@ IceHRMBase.method('fillForm', function(object, formId, fields) {
if(placeHolderVal == undefined || placeHolderVal == null){
placeHolderVal = "";
}else{
placeHolderVal = placeHolderVal.replace(/(?:\r\n|\r|\n)/g, '<br />');
try{
placeHolderVal = placeHolderVal.replace(/(?:\r\n|\r|\n)/g, '<br />');
}catch(e){}
}
@@ -1696,6 +1732,14 @@ IceHRMBase.method('fillForm', function(object, formId, fields) {
$(formId + ' #'+fields[i][0]).val(object[fields[i][0]]);
$(formId + ' #'+fields[i][0]+"_div").html(html);
}catch(e){}
}else if(fields[i][1].type == 'signature'){
if(object[fields[i][0]] != '' || object[fields[i][0]] != undefined
|| object[fields[i][0]] != null){
$(formId + ' #'+fields[i][0]).data('signaturePad').fromDataURL(object[fields[i][0]]);
}
}else{
$(formId + ' #'+fields[i][0]).val(object[fields[i][0]]);
}
@@ -1774,7 +1818,11 @@ IceHRMBase.method('renderFormField', function(field) {
}else if(field[1].type == 'datagroup'){
t = t.replace(/_id_/g,field[0]);
t = t.replace(/_label_/g,field[1].label);
}
}else if(field[1].type == 'signature'){
t = t.replace(/_id_/g,field[0]);
t = t.replace(/_label_/g,field[1].label);
}
if(field[1].validation != undefined && field[1].validation != null && field[1].validation != ""){
t = t.replace(/_validation_/g,'validation="'+field[1].validation+'"');
@@ -2097,3 +2145,30 @@ IceHRMBase.method('getHelpLink', function () {
return null;
});
IceHRMBase.method('showLoader', function () {
$('#iceloader').show();
});
IceHRMBase.method('hideLoader', function () {
$('#iceloader').hide();
});
IceHRMBase.method('generateOptions', function (data) {
var template = '<option value="__val__">__text__</option>';
var options = "";
for(index in data){
options += template.replace("__val__",index).replace("__text__",data[index]);
}
return options;
});
IceHRMBase.method('isModuleInstalled', function (type, name) {
if(modulesInstalled == undefined || modulesInstalled == null){
return false;
}
return (modulesInstalled[type+"_"+name] == 1);
});

View File

@@ -34,7 +34,7 @@ function FormValidation(formId,validateAll,options) {
this.settings = jQuery.extend(this.settings,options);
this.inputTypes = new Array( "text", "radio", "checkbox", "file", "password", "select-one","select-multi", "textarea","fileupload");
this.inputTypes = new Array( "text", "radio", "checkbox", "file", "password", "select-one","select-multi", "textarea","fileupload" ,"signature");
this.validator = {
@@ -202,8 +202,15 @@ FormValidation.method('checkValues' , function(options) {
inputValue = JSON.stringify(inputValue);
}else{
inputValue = "";
}
}else{
}
}else if(inputObject.hasClass('signatureField')){
if($('#'+id).data('signaturePad').isEmpty()){
inputValue = '';
}else{
inputValue = $('#'+id).data('signaturePad').toDataURL();
}
}else{
inputValue = inputObject.val();
}
}

View File

@@ -10,6 +10,11 @@ abstract class AbstractModuleManager{
private $userClasses = array();
private $errorMappings = array();
private $modelClasses = array();
private $modulePath = null;
private $moduleObject = null;
private $moduleType = null;
/**
* Override this method in module manager class to define user classes.
@@ -60,9 +65,82 @@ abstract class AbstractModuleManager{
*/
public abstract function setupModuleClassDefinitions();
public function initQuickAccessMenu(){
}
public function setModuleObject($obj){
$this->moduleObject = $obj;
}
public function getModuleObject(){
return $this->moduleObject;
}
public function setModuleType($type){
$this->moduleType = $type;
}
public function getModuleType(){
return $this->moduleType;
}
public function getModulePath(){
$subClass = get_called_class();
$reflector = new ReflectionClass($subClass);
$fn = $reflector->getFileName();
$this->modulePath = realpath(dirname($fn)."/..");
LogManager::getInstance()->info("Module Path: [$subClass | $fn]".$this->modulePath);
}
public function getDashboardItemData(){
return array();
}
public function getDashboardItem(){
return null;
$this->getModulePath();
if(!file_exists($this->modulePath."/dashboard.html")){
//LogManager::getInstance()->error("Dashboard file not found :".$this->modulePath."/dashboard.html");
return null;
}
$dashboardItem = file_get_contents($this->modulePath."/dashboard.html");
if(empty($dashboardItem)){
//LogManager::getInstance()->error("Dashboard file is empty :".$this->modulePath."/dashboard.html");
return null;
}
$data = $this->getDashboardItemData();
$data['moduleLink'] = $this->getModuleLink();
LogManager::getInstance()->info("Module Link:".$data['moduleLink']);
foreach($data as $k => $v){
$dashboardItem = str_replace("#_".$k."_#", $v, $dashboardItem);
}
return $dashboardItem;
}
public function getDashboardItemIndex(){
$metaData = json_decode(file_get_contents($this->modulePath."/meta.json"),true);
if(!isset($metaData['dashboardPosition'])){
return 100;
}else{
return $metaData['dashboardPosition'];
}
}
private function getModuleLink(){
$metaData = json_decode(file_get_contents($this->modulePath."/meta.json"),true);
$mod = basename($this->modulePath);
$group = basename(realpath($this->modulePath."/.."));
//?g=admin&n=candidates&m=admin_Recruitment
return CLIENT_BASE_URL."?g=".$group."&n=".$mod."&m=".$group."_".str_replace(" ","_",$metaData['label']);
}
@@ -116,5 +194,19 @@ abstract class AbstractModuleManager{
$this->modelClasses[] = $className;
}
protected function addHistoryGeneric($type, $table, $refName, $refId, $field, $oldValue, $newValue){
$eh = new $table();
$eh->type = $type;
$eh->$refName = $refId;
$eh->field = $field;
$eh->user = BaseService::getInstance()->getCurrentUser()->id;
$eh->old_value = $oldValue;
$eh->new_value = $newValue;
$eh->created = date("Y-m-d H:i:s");
$eh->updated = date("Y-m-d H:i:s");
$eh->Save();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -23,17 +23,25 @@ class CronUtils{
$count = 0;
foreach($ams as $am){
if(is_dir($this->clientBasePath.$am) && $am != '.' && $am != '..'){
//$command = "php ".$this->cronFile." -c".$this->clientBasePath.$am;
$command = "php ".$this->clientBasePath.$am."/".$this->cronFile;
echo "Run:".$command."\r\n";
passthru($command, $res);
echo "Result :".$res."\r\n";
$command = "php ".$this->clientBasePath.$am."/".$this->cronFile;
if(file_exists($this->clientBasePath.$am."/".$this->cronFile)){
$count++;
if($count > 25){
sleep(1);
$count = 0;
echo "Run:".$command."\r\n";
error_log("Run:".$command);
passthru($command, $res);
echo "Result :".$res."\r\n";
error_log("Result :".$res);
$count++;
if($count > 25){
sleep(1);
$count = 0;
}
}else{
echo "Error (File Not Found):".$command."\r\n";
error_log("Error (File Not Found):".$command);
}
}
}
}

View File

@@ -40,7 +40,7 @@ abstract class EmailSender{
array(),
array(),
array()
);
);
}
}
@@ -79,7 +79,7 @@ abstract class EmailSender{
$emailBody = str_replace("#_emailBody_#", $body, $emailBody);
$emailBody = str_replace("#_logourl_#",
BASE_URL."images/logo.png"
UIManager::getInstance()->getCompanyLogoUrl()
, $emailBody);
$user = new User();
@@ -113,7 +113,7 @@ abstract class EmailSender{
//Convert to an html email
$emailBody = $body;
$emailBody = str_replace("#_logourl_#",
BASE_URL."images/logo.png"
UIManager::getInstance()->getCompanyLogoUrl()
, $emailBody);
$user = new User();
@@ -271,9 +271,19 @@ class SMTPEmailSender extends EmailSender{
'Reply-To' => $replyToEmail,
'Subject' => $subject);
if(!empty($ccList)){
$headers['Cc'] = implode(",",$ccList);
}
if(!empty($bccList)){
$headers['Bcc'] = implode(",",$bccList);
}
$mail = $smtp->send($toEmail, $headers, $body);
if (PEAR::isError($mail)) {
LogManager::getInstance()->info("SMTP Error Response:".$mail->getMessage());
}
return $mail;
}
@@ -297,6 +307,12 @@ class PHPMailer extends EmailSender{
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: '.$fromEmail. "\r\n";
if(!empty($ccList)){
$headers .= 'CC: '.implode(",",$ccList). "\r\n";
}
if(!empty($bccList)){
$headers .= 'BCC: '.implode(",",$bccList). "\r\n";
}
$headers .= 'ReplyTo: '.$replyToEmail. "\r\n";
$headers .= 'Ice-Mailer: PHP/' . phpversion();

View File

@@ -41,17 +41,22 @@ class FileService{
public function getFromCache($key){
try{
/*
if(empty($this->memcache)){
$this->memcache = new Memcached();
$this->memcache->addServer("127.0.0.1", 11211);
}
$data = $this->memcache->get($key);
*/
$data = MemcacheService::getInstance()->get($key);
if(!empty($data)){
return $data;
}
return null;
}catch(Exception $e){
return null;
}

View File

@@ -9,4 +9,4 @@ if(!defined('SIGN_IN_ELEMENT_MAPPING_FIELD_NAME')){define('SIGN_IN_ELEMENT_MAPPI
if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','ice-framework@gamonoid.com');}
if(!defined('KEY_PREFIX')){define('KEY_PREFIX','iCEf');}
if(!defined('APP_SEC')){define('APP_SEC','4dcxudersqw');}
if(!defined('APP_SEC')){define('APP_SEC','4dcxswfrds');}

View File

@@ -2,3 +2,12 @@
UIManager::getInstance()->setCurrentUser($user);
UIManager::getInstance()->setProfiles($profileCurrent, $profileSwitched);
UIManager::getInstance()->setHomeLink($homeLink);
$moduleManagers = BaseService::getInstance()->getModuleManagers();
foreach($moduleManagers as $moduleManagerObj){
$allowed = BaseService::getInstance()->isModuleAllowedForUser($moduleManagerObj);
if($allowed){
$moduleManagerObj->initQuickAccessMenu();
}
}

View File

@@ -2,7 +2,7 @@
if(php_sapi_name() != 'cli'){
exit();
}
include "../config.base.php";
include dirname(__FILE__)."/../config.base.php";
ini_set('error_log',CRON_LOG);
$opts = getopt('f:p:');
$file = $opts['f'];

View File

@@ -651,4 +651,14 @@ table.dataTable{
border-radius: 0px;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
}
.logoResponsive{
background: #3c8dbc !important;
text-align: left !important;
width:50% !important;
}
@media screen and (min-width: 0px) and (max-width: 600px) {
.logoResponsive { display: none !important;}
}

View File

@@ -14,9 +14,9 @@ if($_REQUEST['file_type']=="image"){
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.js?v=1.1"></script>
<script type="text/javascript" src="https://webstalk-js.s3.amazonaws.com/date.js"></script>
<script type="text/javascript" src="https://webstalk-js.s3.amazonaws.com/json2.js"></script>
<script type="text/javascript" src="<?=BASE_URL?>js/jquery-1.5.2.js"></script>
<script type="text/javascript" src="<?=BASE_URL?>js/date.js"></script>
<script type="text/javascript" src="<?=BASE_URL?>js/json2.js"></script>
</head>
<body>

View File

@@ -105,6 +105,8 @@
});
var clientUrl = '<?=CLIENT_BASE_URL?>';
var modulesInstalled = <?=json_encode(BaseService::getInstance()->getModuleManagerNames())?>;
$(document).ready(function() {
$(".dataTables_paginate ul").addClass("pagination");

View File

@@ -37,7 +37,10 @@ if(empty($user->default_module)){
}else{
$defaultModule = new Module();
$defaultModule->Load("id = ?",array($user->default_module));
$homeLink = CLIENT_BASE_URL."?g=".$defaultModule->mod_group."&&n=".$defaultModule->name.
if($defaultModule->mod_group == "user"){
$defaultModule->mod_group = "modules";
}
$homeLink = CLIENT_BASE_URL."?g=".$defaultModule->mod_group."&n=".$defaultModule->name.
"&m=".$defaultModule->mod_group."_".str_replace(" ","_",$defaultModule->menu);
}
@@ -55,22 +58,25 @@ if(!in_array($user->user_level, $modulePermissions['user'])){
}
$commonRoles = array_intersect($modulePermissions['user_roles'], $userRoles);
if(empty($commonRoles)){
echo "You are not allowed to access this page";
header("Location:".CLIENT_BASE_URL."logout.php");
session_start();
$_SESSION['user'] = null;
session_destroy();
session_write_close();
$user = null;
header("Location:".CLIENT_BASE_URL."login.php?f=1&fm=You are not allowed to access this module");
exit();
}
}
$logoFileName = CLIENT_BASE_PATH."data/logo.png";
$logoFileUrl = CLIENT_BASE_URL."data/logo.png";
if(!file_exists($logoFileName)){
$logoFileUrl = BASE_URL."images/logo.png";
}
$logoFileUrl = UIManager::getInstance()->getCompanyLogoUrl();
$companyName = SettingsManager::getInstance()->getSetting('Company: Name');
if(empty($companyName) || $companyName == "Sample Company Pvt Ltd"){
$companyName = APP_NAME;
}
//Load meta info
$meta = json_decode(file_get_contents(MODULE_PATH."/meta.json"),true);
@@ -80,7 +86,7 @@ include('configureUIManager.php');
<html>
<head>
<meta charset="utf-8">
<title><?=APP_NAME?></title>
<title><?=$companyName?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
@@ -129,6 +135,7 @@ include('configureUIManager.php');
<link href="<?=BASE_URL?>css/style.css?v=<?=$cssVersion?>" rel="stylesheet">
<script type="text/javascript" src="<?=BASE_URL?>js/signature_pad.js"></script>
<script type="text/javascript" src="<?=BASE_URL?>js/date.js"></script>
<script type="text/javascript" src="<?=BASE_URL?>js/json2.js"></script>
<script type="text/javascript" src="<?=BASE_URL?>js/CrockfordInheritance.v0.1.js"></script>
@@ -146,8 +153,8 @@ include('configureUIManager.php');
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<script src="<?=BASE_URL?>js/html5shiv.js"></script>
<script src="<?=BASE_URL?>js/respond.min.js"></script>
<![endif]-->
<script>
var baseUrl = '<?=CLIENT_BASE_URL?>service.php';
@@ -175,8 +182,8 @@ include('configureUIManager.php');
</script>
<header id="delegationDiv" class="header">
<a href="<?=$homeLink?>" class="logo" style="font-family: 'Source Sans Pro', sans-serif;">
<?=APP_NAME?>
<a href="<?=$homeLink?>" class="logo" style="overflow: hidden;font-family: 'Source Sans Pro', sans-serif;">
Home
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top" role="navigation">
@@ -187,6 +194,9 @@ include('configureUIManager.php');
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="logo logoResponsive">
<?=$companyName?>
</div>
<div class="navbar-right">
<ul class="nav navbar-nav">
<?=UIManager::getInstance()->getMenuItemsHTML();?>
@@ -195,6 +205,17 @@ include('configureUIManager.php');
</nav>
</header>
<div class="wrapper row-offcanvas row-offcanvas-left">
<div id="iceloader" style="
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 9999;
background: rgba(0, 0, 0, 0);
background-image: url('<?=BASE_URL?>images/icehrm-loader.gif');
background-repeat: no-repeat;
background-position: center;display:none;"></div>
<!-- Left side column. contains the logo and sidebar -->
<aside class="left-side sidebar-offcanvas">
<!-- sidebar: style can be found in sidebar.less -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@@ -53,6 +53,7 @@ $fieldTemplates['label'] = file_get_contents(CLIENT_PATH.'/templates/fields/labe
$fieldTemplates['placeholder'] = file_get_contents(CLIENT_PATH.'/templates/fields/placeholder.html');
$fieldTemplates['datagroup'] = file_get_contents(CLIENT_PATH.'/templates/fields/datagroup.html');
$fieldTemplates['colorpick'] = file_get_contents(CLIENT_PATH.'/templates/fields/colorpick.html');
$fieldTemplates['signature'] = file_get_contents(CLIENT_PATH.'/templates/fields/signature.html');
$templates = array();
$templates['formTemplate'] = file_get_contents(CLIENT_PATH.'/templates/form_template.html');
@@ -101,6 +102,11 @@ if(file_exists(MODULE_PATH.'/templates/fields/colorpick.html')){
$fieldTemplates['colorpick'] = file_get_contents(MODULE_PATH.'/templates/fields/colorpick.html');
}
if(file_exists(MODULE_PATH.'/templates/fields/signature.html')){
$fieldTemplates['signature'] = file_get_contents(MODULE_PATH.'/templates/fields/signature.html');
}
if(file_exists(MODULE_PATH.'/templates/form_template.html')){
$templates['orig_formTemplate'] = $templates['formTemplate'];
$templates['formTemplate'] = file_get_contents(MODULE_PATH.'/templates/form_template.html');

8
src/js/html5.js Normal file
View File

@@ -0,0 +1,8 @@
/*
HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}</style>";
c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);
if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);

8
src/js/html5shiv.js vendored Normal file
View File

@@ -0,0 +1,8 @@
/*
HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}</style>";
c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);
if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);

8374
src/js/jquery-1.5.2.js vendored Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More