Upgrade to v15.0.OS
This commit is contained in:
@@ -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.1.OS');
|
||||
define('CACHE_VALUE', '14.1.OS');
|
||||
define('VERSION_DATE', '26/12/2015');
|
||||
define('VERSION', '15.0.OS');
|
||||
define('CACHE_VALUE', '15.0.OS');
|
||||
define('VERSION_DATE', '07/02/2016');
|
||||
|
||||
if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','icehrm@gamonoid.com');}
|
||||
if(!defined('KEY_PREFIX')){define('KEY_PREFIX','IceHrm');}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
UIManager::getInstance()->setCurrentUser($user);
|
||||
UIManager::getInstance()->setProfiles($profileCurrent, $profileSwitched);
|
||||
UIManager::getInstance()->setHomeLink($homeLink);
|
||||
|
||||
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"));
|
||||
UIManager::getInstance()->addQuickAccessMenuItem("Manage Client/Projects","fa-list-alt",CLIENT_BASE_URL."?g=admin&n=projects&m=admin_Admin",array("Admin","Manager"));
|
||||
UIManager::getInstance()->addQuickAccessMenuItem("Clocked In Employees","fa-clock-o",CLIENT_BASE_URL."?g=admin&n=attendance&m=admin_Employees#tabAttendanceStatus",array("Admin","Manager"));
|
||||
UIManager::getInstance()->addQuickAccessMenuItem("Additional Modules","fa-shopping-cart","http://icehrm.com/modules.php",array("Admin"));
|
||||
45
core-ext/db_upgrade/icehrmdb_upgrade_v14.0.OS_v15.0.OS.sql
Normal file
45
core-ext/db_upgrade/icehrmdb_upgrade_v14.0.OS_v15.0.OS.sql
Normal file
@@ -0,0 +1,45 @@
|
||||
ALTER table `Employees` ADD COLUMN `indirect_supervisors` VARCHAR(250) default null after `supervisor`;
|
||||
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';
|
||||
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');
|
||||
|
||||
|
||||
@@ -1,54 +1,100 @@
|
||||
<?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($_REQUEST['username'] != "admin") {
|
||||
LogManager::getInstance()->debug("LDAP: Enabled :" . SettingsManager::getInstance()->getSetting("LDAP: Enabled"));
|
||||
if (SettingsManager::getInstance()->getSetting("LDAP: Enabled") == "1") {
|
||||
$ldapResp = LDAPManager::getInstance()->checkLDAPLogin($_REQUEST['username'], $_REQUEST['password']);
|
||||
LogManager::getInstance()->debug("LDAP Response :" . json_encode($ldapResp));
|
||||
if ($ldapResp->getStatus() == IceResponse::ERROR) {
|
||||
header("Location:" . CLIENT_BASE_URL . "login.php?f=1");
|
||||
exit();
|
||||
} else {
|
||||
$suser = new User();
|
||||
$suser->Load("username = ?", array($_REQUEST['username']));
|
||||
|
||||
if (empty($suser)) {
|
||||
header("Location:" . CLIENT_BASE_URL . "login.php?f=1");
|
||||
exit();
|
||||
}
|
||||
|
||||
$ssoUserLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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">
|
||||
|
||||
@@ -69,4 +69,8 @@ class ICEHRM_Record extends ADOdb_Active_Record{
|
||||
return array(
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function allowIndirectMapping(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1012,6 +1012,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'),
|
||||
|
||||
@@ -708,7 +708,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,
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
18
ext/admin/attendance/dashboard.html
Normal file
18
ext/admin/attendance/dashboard.html
Normal 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>
|
||||
@@ -4,6 +4,7 @@
|
||||
"order":"8",
|
||||
"icon":"fa-clock-o",
|
||||
"user_levels":["Admin","Manager"],
|
||||
"dashboardPosition":5,
|
||||
|
||||
"permissions":
|
||||
{}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
17
ext/admin/company_structure/dashboard.html
Normal file
17
ext/admin/company_structure/dashboard.html
Normal 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>
|
||||
@@ -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"]}]
|
||||
];
|
||||
});
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -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,242 +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 class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-red">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
Purchase
|
||||
</h3>
|
||||
<p>
|
||||
Additional Modules
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-ios-cart"></i>
|
||||
</div>
|
||||
<a href="http://icehrm.com/modules.php" target="_blank" class="small-box-footer">
|
||||
From Icehrm.com <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 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';?>
|
||||
@@ -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) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"menu":"Admin",
|
||||
"order":"1",
|
||||
"icon":"fa-desktop",
|
||||
"user_levels":["Admin"],
|
||||
"user_levels":["Admin","Other"],
|
||||
|
||||
"permissions":
|
||||
{
|
||||
|
||||
@@ -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"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
19
ext/admin/employees/dashboard.html
Normal file
19
ext/admin/employees/dashboard.html
Normal 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>
|
||||
@@ -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":
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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){
|
||||
|
||||
7
ext/admin/payroll/README.txt
Normal file
7
ext/admin/payroll/README.txt
Normal 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
|
||||
19
ext/admin/permissions/dashboard.html
Normal file
19
ext/admin/permissions/dashboard.html
Normal 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>
|
||||
@@ -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":
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
17
ext/admin/projects/dashboard.html
Normal file
17
ext/admin/projects/dashboard.html
Normal 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>
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
17
ext/admin/reports/dashboard.html
Normal file
17
ext/admin/reports/dashboard.html
Normal 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>
|
||||
@@ -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'];
|
||||
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
|
||||
@@ -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":
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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{
|
||||
|
||||
|
||||
@@ -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{
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
70
ext/admin/reports/reportClasses/EmployeeLeavesReport.php
Normal file
70
ext/admin/reports/reportClasses/EmployeeLeavesReport.php
Normal 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);
|
||||
}
|
||||
}
|
||||
67
ext/admin/reports/reportClasses/EmployeeTimeSheetData.php
Normal file
67
ext/admin/reports/reportClasses/EmployeeTimeSheetData.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?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","Time Sheet","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,
|
||||
$ts->name,
|
||||
$ts->getTotalTime(),
|
||||
$ts->status
|
||||
);
|
||||
}
|
||||
|
||||
return $reportData;
|
||||
}
|
||||
}
|
||||
@@ -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){
|
||||
|
||||
@@ -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{
|
||||
|
||||
|
||||
68
ext/admin/reports/reportClasses/ExpenseReport.php
Normal file
68
ext/admin/reports/reportClasses/ExpenseReport.php
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -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{
|
||||
|
||||
|
||||
@@ -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{
|
||||
|
||||
|
||||
@@ -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{
|
||||
|
||||
|
||||
69
ext/admin/reports/reportClasses/TravelRequestReport.php
Normal file
69
ext/admin/reports/reportClasses/TravelRequestReport.php
Normal 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);
|
||||
}
|
||||
}
|
||||
17
ext/admin/settings/dashboard.html
Normal file
17
ext/admin/settings/dashboard.html
Normal 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>
|
||||
@@ -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';?>
|
||||
@@ -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/';
|
||||
});
|
||||
});
|
||||
@@ -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":
|
||||
{
|
||||
}
|
||||
}
|
||||
19
ext/admin/travel/dashboard.html
Normal file
19
ext/admin/travel/dashboard.html
Normal 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>
|
||||
@@ -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":
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
}
|
||||
17
ext/admin/users/dashboard.html
Normal file
17
ext/admin/users/dashboard.html
Normal 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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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":""}]
|
||||
];
|
||||
});
|
||||
|
||||
@@ -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":
|
||||
{
|
||||
}
|
||||
}
|
||||
17
ext/modules/attendance/dashboard.html
Normal file
17
ext/modules/attendance/dashboard.html
Normal 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>
|
||||
@@ -4,7 +4,7 @@
|
||||
"order":"2",
|
||||
"icon":"fa-clock-o",
|
||||
"user_levels":["Admin","Manager","Employee"],
|
||||
|
||||
"dashboardPosition":102,
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -26,166 +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-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="row">
|
||||
|
||||
|
||||
<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 -->
|
||||
|
||||
<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 -->
|
||||
|
||||
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php
|
||||
$moduleManagers = BaseService::getInstance()->getModuleManagers();
|
||||
$dashBoardList = array();
|
||||
foreach($moduleManagers as $moduleManagerObj){
|
||||
|
||||
$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;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
@@ -194,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';?>
|
||||
@@ -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;
|
||||
|
||||
});
|
||||
|
||||
15
ext/modules/projects/dashboard.html
Normal file
15
ext/modules/projects/dashboard.html
Normal 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>
|
||||
@@ -4,7 +4,7 @@
|
||||
"order":"1",
|
||||
"icon":"fa-pencil-square",
|
||||
"user_levels":["Admin","Manager","Employee"],
|
||||
|
||||
"dashboardPosition":105,
|
||||
"permissions":
|
||||
{
|
||||
"Manager":{
|
||||
|
||||
@@ -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,"");
|
||||
|
||||
@@ -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 {
|
||||
|
||||
17
ext/modules/time_sheets/dashboard.html
Normal file
17
ext/modules/time_sheets/dashboard.html
Normal 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>
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"order":"3",
|
||||
"icon":"fa-check-circle-o",
|
||||
"user_levels":["Admin","Manager","Employee"],
|
||||
"dashboardPosition":104,
|
||||
|
||||
"permissions":
|
||||
{
|
||||
|
||||
17
ext/modules/travel/dashboard.html
Normal file
17
ext/modules/travel/dashboard.html
Normal 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>
|
||||
@@ -4,7 +4,7 @@
|
||||
"order":"1",
|
||||
"icon":"fa-plane",
|
||||
"user_levels":["Admin","Manager","Employee"],
|
||||
|
||||
"dashboardPosition":107,
|
||||
"permissions":
|
||||
{
|
||||
"Manager":{
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
@@ -1696,6 +1729,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 +1815,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 +2142,21 @@ 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;
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,6 +271,14 @@ 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);
|
||||
|
||||
@@ -297,6 +305,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();
|
||||
|
||||
|
||||
@@ -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');}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'];
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -62,15 +65,14 @@ if(!in_array($user->user_level, $modulePermissions['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();
|
||||
|
||||
$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 +82,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 +131,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>
|
||||
@@ -175,8 +178,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 +190,9 @@ include('configureUIManager.php');
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</a>
|
||||
<div class="logo" style="background: #3c8dbc;text-align: left;">
|
||||
<?=$companyName?>
|
||||
</div>
|
||||
<div class="navbar-right">
|
||||
<ul class="nav navbar-nav">
|
||||
<?=UIManager::getInstance()->getMenuItemsHTML();?>
|
||||
@@ -195,6 +201,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 -->
|
||||
|
||||
BIN
src/images/icehrm-loader.gif
Normal file
BIN
src/images/icehrm-loader.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
@@ -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');
|
||||
|
||||
352
src/js/signature_pad.js
Normal file
352
src/js/signature_pad.js
Normal file
@@ -0,0 +1,352 @@
|
||||
var SignaturePad = (function (document) {
|
||||
"use strict";
|
||||
|
||||
var SignaturePad = function (canvas, options) {
|
||||
var self = this,
|
||||
opts = options || {};
|
||||
|
||||
this.velocityFilterWeight = opts.velocityFilterWeight || 0.7;
|
||||
this.minWidth = opts.minWidth || 0.5;
|
||||
this.maxWidth = opts.maxWidth || 2.5;
|
||||
this.dotSize = opts.dotSize || function () {
|
||||
return (this.minWidth + this.maxWidth) / 2;
|
||||
};
|
||||
this.penColor = opts.penColor || "black";
|
||||
this.backgroundColor = opts.backgroundColor || "rgba(0,0,0,0)";
|
||||
this.onEnd = opts.onEnd;
|
||||
this.onBegin = opts.onBegin;
|
||||
|
||||
this._canvas = canvas;
|
||||
this._ctx = canvas.getContext("2d");
|
||||
this.clear();
|
||||
|
||||
// we need add these inline so they are available to unbind while still having
|
||||
// access to 'self' we could use _.bind but it's not worth adding a dependency
|
||||
this._handleMouseDown = function (event) {
|
||||
if (event.which === 1) {
|
||||
self._mouseButtonDown = true;
|
||||
self._strokeBegin(event);
|
||||
}
|
||||
};
|
||||
|
||||
this._handleMouseMove = function (event) {
|
||||
if (self._mouseButtonDown) {
|
||||
self._strokeUpdate(event);
|
||||
}
|
||||
};
|
||||
|
||||
this._handleMouseUp = function (event) {
|
||||
if (event.which === 1 && self._mouseButtonDown) {
|
||||
self._mouseButtonDown = false;
|
||||
self._strokeEnd(event);
|
||||
}
|
||||
};
|
||||
|
||||
this._handleTouchStart = function (event) {
|
||||
if (event.targetTouches.length == 1) {
|
||||
var touch = event.changedTouches[0];
|
||||
self._strokeBegin(touch);
|
||||
}
|
||||
};
|
||||
|
||||
this._handleTouchMove = function (event) {
|
||||
// Prevent scrolling.
|
||||
event.preventDefault();
|
||||
|
||||
var touch = event.targetTouches[0];
|
||||
self._strokeUpdate(touch);
|
||||
};
|
||||
|
||||
this._handleTouchEnd = function (event) {
|
||||
var wasCanvasTouched = event.target === self._canvas;
|
||||
if (wasCanvasTouched) {
|
||||
event.preventDefault();
|
||||
self._strokeEnd(event);
|
||||
}
|
||||
};
|
||||
|
||||
this._handleMouseEvents();
|
||||
this._handleTouchEvents();
|
||||
};
|
||||
|
||||
SignaturePad.prototype.clear = function () {
|
||||
var ctx = this._ctx,
|
||||
canvas = this._canvas;
|
||||
|
||||
ctx.fillStyle = this.backgroundColor;
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
this._reset();
|
||||
};
|
||||
|
||||
SignaturePad.prototype.toDataURL = function (imageType, quality) {
|
||||
var canvas = this._canvas;
|
||||
return canvas.toDataURL.apply(canvas, arguments);
|
||||
};
|
||||
|
||||
SignaturePad.prototype.fromDataURL = function (dataUrl) {
|
||||
var self = this,
|
||||
image = new Image(),
|
||||
ratio = window.devicePixelRatio || 1,
|
||||
width = this._canvas.width / ratio,
|
||||
height = this._canvas.height / ratio;
|
||||
|
||||
this._reset();
|
||||
image.src = dataUrl;
|
||||
image.onload = function () {
|
||||
self._ctx.drawImage(image, 0, 0, width, height);
|
||||
};
|
||||
this._isEmpty = false;
|
||||
};
|
||||
|
||||
SignaturePad.prototype._strokeUpdate = function (event) {
|
||||
var point = this._createPoint(event);
|
||||
this._addPoint(point);
|
||||
};
|
||||
|
||||
SignaturePad.prototype._strokeBegin = function (event) {
|
||||
this._reset();
|
||||
this._strokeUpdate(event);
|
||||
if (typeof this.onBegin === 'function') {
|
||||
this.onBegin(event);
|
||||
}
|
||||
};
|
||||
|
||||
SignaturePad.prototype._strokeDraw = function (point) {
|
||||
var ctx = this._ctx,
|
||||
dotSize = typeof(this.dotSize) === 'function' ? this.dotSize() : this.dotSize;
|
||||
|
||||
ctx.beginPath();
|
||||
this._drawPoint(point.x, point.y, dotSize);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
};
|
||||
|
||||
SignaturePad.prototype._strokeEnd = function (event) {
|
||||
var canDrawCurve = this.points.length > 2,
|
||||
point = this.points[0];
|
||||
|
||||
if (!canDrawCurve && point) {
|
||||
this._strokeDraw(point);
|
||||
}
|
||||
if (typeof this.onEnd === 'function') {
|
||||
this.onEnd(event);
|
||||
}
|
||||
};
|
||||
|
||||
SignaturePad.prototype._handleMouseEvents = function () {
|
||||
this._mouseButtonDown = false;
|
||||
|
||||
this._canvas.addEventListener("mousedown", this._handleMouseDown);
|
||||
this._canvas.addEventListener("mousemove", this._handleMouseMove);
|
||||
document.addEventListener("mouseup", this._handleMouseUp);
|
||||
};
|
||||
|
||||
SignaturePad.prototype._handleTouchEvents = function () {
|
||||
// Pass touch events to canvas element on mobile IE11 and Edge.
|
||||
this._canvas.style.msTouchAction = 'none';
|
||||
this._canvas.style.touchAction = 'none';
|
||||
|
||||
this._canvas.addEventListener("touchstart", this._handleTouchStart);
|
||||
this._canvas.addEventListener("touchmove", this._handleTouchMove);
|
||||
document.addEventListener("touchend", this._handleTouchEnd);
|
||||
};
|
||||
|
||||
SignaturePad.prototype.on = function () {
|
||||
this._handleMouseEvents();
|
||||
this._handleTouchEvents();
|
||||
};
|
||||
|
||||
SignaturePad.prototype.off = function () {
|
||||
this._canvas.removeEventListener("mousedown", this._handleMouseDown);
|
||||
this._canvas.removeEventListener("mousemove", this._handleMouseMove);
|
||||
document.removeEventListener("mouseup", this._handleMouseUp);
|
||||
|
||||
this._canvas.removeEventListener("touchstart", this._handleTouchStart);
|
||||
this._canvas.removeEventListener("touchmove", this._handleTouchMove);
|
||||
document.removeEventListener("touchend", this._handleTouchEnd);
|
||||
};
|
||||
|
||||
SignaturePad.prototype.isEmpty = function () {
|
||||
return this._isEmpty;
|
||||
};
|
||||
|
||||
SignaturePad.prototype._reset = function () {
|
||||
this.points = [];
|
||||
this._lastVelocity = 0;
|
||||
this._lastWidth = (this.minWidth + this.maxWidth) / 2;
|
||||
this._isEmpty = true;
|
||||
this._ctx.fillStyle = this.penColor;
|
||||
};
|
||||
|
||||
SignaturePad.prototype._createPoint = function (event) {
|
||||
var rect = this._canvas.getBoundingClientRect();
|
||||
return new Point(
|
||||
event.clientX - rect.left,
|
||||
event.clientY - rect.top
|
||||
);
|
||||
};
|
||||
|
||||
SignaturePad.prototype._addPoint = function (point) {
|
||||
var points = this.points,
|
||||
c2, c3,
|
||||
curve, tmp;
|
||||
|
||||
points.push(point);
|
||||
|
||||
if (points.length > 2) {
|
||||
// To reduce the initial lag make it work with 3 points
|
||||
// by copying the first point to the beginning.
|
||||
if (points.length === 3) points.unshift(points[0]);
|
||||
|
||||
tmp = this._calculateCurveControlPoints(points[0], points[1], points[2]);
|
||||
c2 = tmp.c2;
|
||||
tmp = this._calculateCurveControlPoints(points[1], points[2], points[3]);
|
||||
c3 = tmp.c1;
|
||||
curve = new Bezier(points[1], c2, c3, points[2]);
|
||||
this._addCurve(curve);
|
||||
|
||||
// Remove the first element from the list,
|
||||
// so that we always have no more than 4 points in points array.
|
||||
points.shift();
|
||||
}
|
||||
};
|
||||
|
||||
SignaturePad.prototype._calculateCurveControlPoints = function (s1, s2, s3) {
|
||||
var dx1 = s1.x - s2.x, dy1 = s1.y - s2.y,
|
||||
dx2 = s2.x - s3.x, dy2 = s2.y - s3.y,
|
||||
|
||||
m1 = {x: (s1.x + s2.x) / 2.0, y: (s1.y + s2.y) / 2.0},
|
||||
m2 = {x: (s2.x + s3.x) / 2.0, y: (s2.y + s3.y) / 2.0},
|
||||
|
||||
l1 = Math.sqrt(dx1*dx1 + dy1*dy1),
|
||||
l2 = Math.sqrt(dx2*dx2 + dy2*dy2),
|
||||
|
||||
dxm = (m1.x - m2.x),
|
||||
dym = (m1.y - m2.y),
|
||||
|
||||
k = l2 / (l1 + l2),
|
||||
cm = {x: m2.x + dxm*k, y: m2.y + dym*k},
|
||||
|
||||
tx = s2.x - cm.x,
|
||||
ty = s2.y - cm.y;
|
||||
|
||||
return {
|
||||
c1: new Point(m1.x + tx, m1.y + ty),
|
||||
c2: new Point(m2.x + tx, m2.y + ty)
|
||||
};
|
||||
};
|
||||
|
||||
SignaturePad.prototype._addCurve = function (curve) {
|
||||
var startPoint = curve.startPoint,
|
||||
endPoint = curve.endPoint,
|
||||
velocity, newWidth;
|
||||
|
||||
velocity = endPoint.velocityFrom(startPoint);
|
||||
velocity = this.velocityFilterWeight * velocity
|
||||
+ (1 - this.velocityFilterWeight) * this._lastVelocity;
|
||||
|
||||
newWidth = this._strokeWidth(velocity);
|
||||
this._drawCurve(curve, this._lastWidth, newWidth);
|
||||
|
||||
this._lastVelocity = velocity;
|
||||
this._lastWidth = newWidth;
|
||||
};
|
||||
|
||||
SignaturePad.prototype._drawPoint = function (x, y, size) {
|
||||
var ctx = this._ctx;
|
||||
|
||||
ctx.moveTo(x, y);
|
||||
ctx.arc(x, y, size, 0, 2 * Math.PI, false);
|
||||
this._isEmpty = false;
|
||||
};
|
||||
|
||||
SignaturePad.prototype._drawCurve = function (curve, startWidth, endWidth) {
|
||||
var ctx = this._ctx,
|
||||
widthDelta = endWidth - startWidth,
|
||||
drawSteps, width, i, t, tt, ttt, u, uu, uuu, x, y;
|
||||
|
||||
drawSteps = Math.floor(curve.length());
|
||||
ctx.beginPath();
|
||||
for (i = 0; i < drawSteps; i++) {
|
||||
// Calculate the Bezier (x, y) coordinate for this step.
|
||||
t = i / drawSteps;
|
||||
tt = t * t;
|
||||
ttt = tt * t;
|
||||
u = 1 - t;
|
||||
uu = u * u;
|
||||
uuu = uu * u;
|
||||
|
||||
x = uuu * curve.startPoint.x;
|
||||
x += 3 * uu * t * curve.control1.x;
|
||||
x += 3 * u * tt * curve.control2.x;
|
||||
x += ttt * curve.endPoint.x;
|
||||
|
||||
y = uuu * curve.startPoint.y;
|
||||
y += 3 * uu * t * curve.control1.y;
|
||||
y += 3 * u * tt * curve.control2.y;
|
||||
y += ttt * curve.endPoint.y;
|
||||
|
||||
width = startWidth + ttt * widthDelta;
|
||||
this._drawPoint(x, y, width);
|
||||
}
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
};
|
||||
|
||||
SignaturePad.prototype._strokeWidth = function (velocity) {
|
||||
return Math.max(this.maxWidth / (velocity + 1), this.minWidth);
|
||||
};
|
||||
|
||||
|
||||
var Point = function (x, y, time) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.time = time || new Date().getTime();
|
||||
};
|
||||
|
||||
Point.prototype.velocityFrom = function (start) {
|
||||
return (this.time !== start.time) ? this.distanceTo(start) / (this.time - start.time) : 1;
|
||||
};
|
||||
|
||||
Point.prototype.distanceTo = function (start) {
|
||||
return Math.sqrt(Math.pow(this.x - start.x, 2) + Math.pow(this.y - start.y, 2));
|
||||
};
|
||||
|
||||
var Bezier = function (startPoint, control1, control2, endPoint) {
|
||||
this.startPoint = startPoint;
|
||||
this.control1 = control1;
|
||||
this.control2 = control2;
|
||||
this.endPoint = endPoint;
|
||||
};
|
||||
|
||||
// Returns approximated length.
|
||||
Bezier.prototype.length = function () {
|
||||
var steps = 10,
|
||||
length = 0,
|
||||
i, t, cx, cy, px, py, xdiff, ydiff;
|
||||
|
||||
for (i = 0; i <= steps; i++) {
|
||||
t = i / steps;
|
||||
cx = this._point(t, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x);
|
||||
cy = this._point(t, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
|
||||
if (i > 0) {
|
||||
xdiff = cx - px;
|
||||
ydiff = cy - py;
|
||||
length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);
|
||||
}
|
||||
px = cx;
|
||||
py = cy;
|
||||
}
|
||||
return length;
|
||||
};
|
||||
|
||||
Bezier.prototype._point = function (t, start, c1, c2, end) {
|
||||
return start * (1.0 - t) * (1.0 - t) * (1.0 - t)
|
||||
+ 3.0 * c1 * (1.0 - t) * (1.0 - t) * t
|
||||
+ 3.0 * c2 * (1.0 - t) * t * t
|
||||
+ end * t * t * t;
|
||||
};
|
||||
|
||||
return SignaturePad;
|
||||
})(document);
|
||||
@@ -218,6 +218,9 @@ $logoFileUrl = UIManager::getInstance()->getCompanyLogoUrl();
|
||||
}
|
||||
|
||||
function submitLogin(){
|
||||
try{
|
||||
localStorage.clear();
|
||||
}catch(e){}
|
||||
$("#loginForm").submit();
|
||||
}
|
||||
|
||||
|
||||
@@ -69,4 +69,8 @@ class ICEHRM_Record extends ADOdb_Active_Record{
|
||||
return array(
|
||||
);
|
||||
}
|
||||
|
||||
public function allowIndirectMapping(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -23,14 +23,17 @@ if(SettingsManager::getInstance()->getSetting("System: Add New Permissions") ==
|
||||
SettingsManager::getInstance()->setSetting("System: Add New Permissions","0");
|
||||
}
|
||||
|
||||
function includeModuleManager($type,$name){
|
||||
function includeModuleManager($type,$name,$data){
|
||||
$moduleCapsName = ucfirst($name);
|
||||
$moduleTypeCapsName = ucfirst($type); // Admin or Modules
|
||||
$incFile = CLIENT_PATH.'/'.$type.'/'.$name.'/api/'.$moduleCapsName.$moduleTypeCapsName."Manager.php";
|
||||
|
||||
include ($incFile);
|
||||
$moduleManagerClass = $moduleCapsName.$moduleTypeCapsName."Manager";
|
||||
BaseService::getInstance()->addModuleManager(new $moduleManagerClass());
|
||||
$moduleManagerObj = new $moduleManagerClass();
|
||||
$moduleManagerObj->setModuleObject($data);
|
||||
$moduleManagerObj->setModuleType($type);
|
||||
BaseService::getInstance()->addModuleManager($moduleManagerObj);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,13 +85,14 @@ $currentLocation = 0;
|
||||
foreach($ams as $am){
|
||||
if(is_dir(CLIENT_PATH.'/admin/'.$am) && $am != '.' && $am != '..'){
|
||||
$meta = json_decode(file_get_contents(CLIENT_PATH.'/admin/'.$am.'/meta.json'));
|
||||
includeModuleManager('admin',$am);
|
||||
|
||||
$arr = array();
|
||||
$arr['name'] = $am;
|
||||
$arr['label'] = $meta->label;
|
||||
$arr['icon'] = $meta->icon;
|
||||
$arr['menu'] = $meta->menu;
|
||||
$arr['order'] = $meta->order;
|
||||
$arr['status'] = 'Enabled';
|
||||
$arr['user_levels'] = $meta->user_levels;
|
||||
$arr['user_roles'] = isset($meta->user_roles)?$meta->user_roles:"";
|
||||
|
||||
@@ -110,6 +114,7 @@ foreach($ams as $am){
|
||||
$arr['icon'] = $dbModule->icon;
|
||||
$arr['menu'] = $dbModule->menu;
|
||||
$arr['order'] = $dbModule->mod_order;
|
||||
$arr['status'] = $dbModule->status;
|
||||
$arr['user_levels'] = json_decode($dbModule->user_levels);
|
||||
$arr['user_roles'] = json_decode($dbModule->user_roles);
|
||||
|
||||
@@ -133,6 +138,8 @@ foreach($ams as $am){
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
includeModuleManager('admin',$am, $arr);
|
||||
|
||||
if(!isset($adminModulesTemp[$arr['menu']])){
|
||||
$adminModulesTemp[$arr['menu']] = array();
|
||||
@@ -166,13 +173,14 @@ $ams = scandir(CLIENT_PATH.'/modules/');
|
||||
foreach($ams as $am){
|
||||
if(is_dir(CLIENT_PATH.'/modules/'.$am) && $am != '.' && $am != '..'){
|
||||
$meta = json_decode(file_get_contents(CLIENT_PATH.'/modules/'.$am.'/meta.json'));
|
||||
includeModuleManager('modules',$am);
|
||||
|
||||
$arr = array();
|
||||
$arr['name'] = $am;
|
||||
$arr['label'] = $meta->label;
|
||||
$arr['icon'] = $meta->icon;
|
||||
$arr['menu'] = $meta->menu;
|
||||
$arr['order'] = $meta->order;
|
||||
$arr['status'] = 'Enabled';
|
||||
$arr['user_levels'] = $meta->user_levels;
|
||||
$arr['user_roles'] = isset($meta->user_roles)?$meta->user_roles:"";
|
||||
|
||||
@@ -193,6 +201,7 @@ foreach($ams as $am){
|
||||
$arr['icon'] = $dbModule->icon;
|
||||
$arr['menu'] = $dbModule->menu;
|
||||
$arr['order'] = $dbModule->mod_order;
|
||||
$arr['status'] = $dbModule->status;
|
||||
$arr['user_levels'] = json_decode($dbModule->user_levels);
|
||||
$arr['user_roles'] = json_decode($dbModule->user_roles);
|
||||
|
||||
@@ -215,6 +224,8 @@ foreach($ams as $am){
|
||||
createPermissions($meta, $dbModule->id);
|
||||
}
|
||||
}
|
||||
|
||||
includeModuleManager('modules',$am, $arr);
|
||||
|
||||
if(!isset($userModulesTemp[$arr['menu']])){
|
||||
$userModulesTemp[$arr['menu']] = array();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
if(!defined("AWS_REGION")){define('AWS_REGION','us-east-1');}
|
||||
include(APP_BASE_PATH.'lib/Mail.php');
|
||||
include(APP_BASE_PATH.'lib/aws.phar');
|
||||
include(APP_BASE_PATH.'adodb512/adodb.inc.php');
|
||||
include(APP_BASE_PATH.'adodb512/adodb-active-record.inc.php');
|
||||
$ADODB_ASSOC_CASE = 2;
|
||||
@@ -145,6 +144,12 @@ if(file_exists(APP_BASE_PATH.'admin/audit/api/AuditActionManager.php')){
|
||||
|
||||
$emailEnabled = SettingsManager::getInstance()->getSetting("Email: Enable");
|
||||
$emailMode = SettingsManager::getInstance()->getSetting("Email: Mode");
|
||||
$uploadS3 = SettingsManager::getInstance()->getSetting("Files: Upload Files to S3");
|
||||
|
||||
if($emailMode == "SES" || $uploadS3 == '1'){
|
||||
include(APP_BASE_PATH.'lib/aws.phar');
|
||||
}
|
||||
|
||||
$emailSender = null;
|
||||
if($emailEnabled == "1"){
|
||||
if($emailMode == "SMTP"){
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<td>
|
||||
<table cellpadding="15">
|
||||
<tr>
|
||||
<td><img style="max-width: 200px;max-height: 100px;" src="#_logourl_#" /></td>
|
||||
<td><img style="max-height: 100px;" src="#_logourl_#" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
9
src/templates/fields/signature.html
Normal file
9
src/templates/fields/signature.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<div class="row" id="field__id_">
|
||||
<label class="control-label col-sm-3" for="_id_">_label_</label>
|
||||
<div class="controls col-sm-6">
|
||||
<canvas class="form-control signatureField" type="signature" id="_id_" name="_id_" _validation_ style="height:120px;"></canvas>
|
||||
</div>
|
||||
<div class="controls col-sm-3">
|
||||
<span class="help-inline control-label" id="help__id_"></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3433,3 +3433,311 @@ fieldset[disabled] .btn-vk.active {
|
||||
color: #587ea3;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Styles from v2.2 */
|
||||
|
||||
/* Widget: TODO LIST */
|
||||
.todo-list {
|
||||
margin: 0;
|
||||
padding: 0px 0px;
|
||||
list-style: none;
|
||||
overflow: auto;
|
||||
}
|
||||
.todo-list > li {
|
||||
border-radius: 2px;
|
||||
padding: 10px;
|
||||
background: #f4f4f4;
|
||||
margin-bottom: 2px;
|
||||
border-left: 2px solid #e6e7e8;
|
||||
color: #444;
|
||||
}
|
||||
.todo-list > li:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.todo-list > li.danger {
|
||||
border-left-color: #dd4b39;
|
||||
}
|
||||
.todo-list > li.warning {
|
||||
border-left-color: #f39c12;
|
||||
}
|
||||
.todo-list > li.info {
|
||||
border-left-color: #00c0ef;
|
||||
}
|
||||
.todo-list > li.success {
|
||||
border-left-color: #00a65a;
|
||||
}
|
||||
.todo-list > li.primary {
|
||||
border-left-color: #3c8dbc;
|
||||
}
|
||||
.todo-list > li > input[type='checkbox'] {
|
||||
margin: 0 10px 0 5px;
|
||||
}
|
||||
.todo-list > li .text {
|
||||
display: inline-block;
|
||||
margin-left: 5px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.todo-list > li .label {
|
||||
margin-left: 10px;
|
||||
font-size: 9px;
|
||||
}
|
||||
.todo-list > li .tools {
|
||||
display: none;
|
||||
float: right;
|
||||
color: #dd4b39;
|
||||
}
|
||||
.todo-list > li .tools > .fa,
|
||||
.todo-list > li .tools > .glyphicon,
|
||||
.todo-list > li .tools > .ion {
|
||||
margin-right: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.todo-list > li:hover .tools {
|
||||
display: inline-block;
|
||||
}
|
||||
.todo-list > li.done {
|
||||
color: #999;
|
||||
}
|
||||
.todo-list > li.done .text {
|
||||
text-decoration: line-through;
|
||||
font-weight: 500;
|
||||
}
|
||||
.todo-list > li.done .label {
|
||||
background: #d2d6de !important;
|
||||
}
|
||||
.todo-list .handle {
|
||||
display: inline-block;
|
||||
cursor: move;
|
||||
margin: 0 5px;
|
||||
}
|
||||
/* Chat widget (DEPRECATED - this will be removed in the next major release. Use Direct Chat instead)*/
|
||||
.chat {
|
||||
padding: 5px 20px 5px 10px;
|
||||
}
|
||||
.chat .item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.chat .item:before,
|
||||
.chat .item:after {
|
||||
content: " ";
|
||||
display: table;
|
||||
}
|
||||
.chat .item:after {
|
||||
clear: both;
|
||||
}
|
||||
.chat .item > img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 2px solid transparent;
|
||||
border-radius: 50% !important;
|
||||
}
|
||||
.chat .item > img.online {
|
||||
border: 2px solid #00a65a;
|
||||
}
|
||||
.chat .item > img.offline {
|
||||
border: 2px solid #dd4b39;
|
||||
}
|
||||
.chat .item > .message {
|
||||
margin-left: 55px;
|
||||
margin-top: -40px;
|
||||
}
|
||||
.chat .item > .message > .name {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
}
|
||||
.chat .item > .attachment {
|
||||
border-radius: 3px;
|
||||
background: #f4f4f4;
|
||||
margin-left: 65px;
|
||||
margin-right: 15px;
|
||||
padding: 10px;
|
||||
}
|
||||
.chat .item > .attachment > h4 {
|
||||
margin: 0 0 5px 0;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
}
|
||||
.chat .item > .attachment > p,
|
||||
.chat .item > .attachment > .filename {
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
font-style: italic;
|
||||
margin: 0;
|
||||
}
|
||||
.chat .item > .attachment:before,
|
||||
.chat .item > .attachment:after {
|
||||
content: " ";
|
||||
display: table;
|
||||
}
|
||||
.chat .item > .attachment:after {
|
||||
clear: both;
|
||||
}
|
||||
.box-input {
|
||||
max-width: 200px;
|
||||
}
|
||||
.modal .panel-body {
|
||||
color: #444;
|
||||
}
|
||||
/*
|
||||
* Component: Info Box
|
||||
* -------------------
|
||||
*/
|
||||
.info-box {
|
||||
display: block;
|
||||
min-height: 90px;
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 2px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.info-box small {
|
||||
font-size: 14px;
|
||||
}
|
||||
.info-box .progress {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
margin: 5px -10px 5px -10px;
|
||||
height: 2px;
|
||||
}
|
||||
.info-box .progress,
|
||||
.info-box .progress .progress-bar {
|
||||
border-radius: 0;
|
||||
}
|
||||
.info-box .progress .progress-bar {
|
||||
background: #fff;
|
||||
}
|
||||
.info-box-icon {
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 2px;
|
||||
display: block;
|
||||
float: left;
|
||||
height: 90px;
|
||||
width: 90px;
|
||||
text-align: center;
|
||||
font-size: 45px;
|
||||
line-height: 90px;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
.info-box-icon > img {
|
||||
max-width: 100%;
|
||||
}
|
||||
.info-box-content {
|
||||
padding: 5px 10px;
|
||||
margin-left: 90px;
|
||||
}
|
||||
.info-box-number {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
}
|
||||
.progress-description,
|
||||
.info-box-text {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.info-box-text {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.info-box-more {
|
||||
display: block;
|
||||
}
|
||||
.progress-description {
|
||||
margin: 0;
|
||||
}
|
||||
/*
|
||||
* Component: Timeline
|
||||
* -------------------
|
||||
*/
|
||||
.timeline {
|
||||
position: relative;
|
||||
margin: 0 0 30px 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.timeline:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
bottom: 0;
|
||||
width: 4px;
|
||||
background: #ddd;
|
||||
left: 31px;
|
||||
margin: 0;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.timeline > li {
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.timeline > li:before,
|
||||
.timeline > li:after {
|
||||
content: " ";
|
||||
display: table;
|
||||
}
|
||||
.timeline > li:after {
|
||||
clear: both;
|
||||
}
|
||||
.timeline > li > .timeline-item {
|
||||
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 3px;
|
||||
margin-top: 0px;
|
||||
background: #fff;
|
||||
color: #444;
|
||||
margin-left: 60px;
|
||||
margin-right: 15px;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
.timeline > li > .timeline-item > .time {
|
||||
color: #999;
|
||||
float: right;
|
||||
padding: 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.timeline > li > .timeline-item > .timeline-header {
|
||||
margin: 0;
|
||||
color: #555;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
line-height: 1.1;
|
||||
}
|
||||
.timeline > li > .timeline-item > .timeline-header > a {
|
||||
font-weight: 600;
|
||||
}
|
||||
.timeline > li > .timeline-item > .timeline-body,
|
||||
.timeline > li > .timeline-item > .timeline-footer {
|
||||
padding: 10px;
|
||||
}
|
||||
.timeline > li.time-label > span {
|
||||
font-weight: 600;
|
||||
padding: 5px;
|
||||
display: inline-block;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.timeline > li > .fa,
|
||||
.timeline > li > .glyphicon,
|
||||
.timeline > li > .ion {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
font-size: 15px;
|
||||
line-height: 30px;
|
||||
position: absolute;
|
||||
color: #666;
|
||||
background: #d2d6de;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
left: 18px;
|
||||
top: 0;
|
||||
}
|
||||
@@ -19,5 +19,13 @@ if(!class_exists('CalendarTools')) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static function addLeadingZero($val)
|
||||
{
|
||||
if ($val < 10) {
|
||||
$val = "0" . $val;
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user