Merge pull request #215 from gamonoid/feature/docker-setup

Feature/docker setup
This commit is contained in:
Thilina Hasantha
2020-05-25 04:13:28 +02:00
committed by GitHub
97 changed files with 14704 additions and 1993 deletions
+9 -1
View File
@@ -2,6 +2,7 @@
.buildpath
.project
.idea/
app/config.php
build
deployment/clients/dev/data/
deployment/clients/test/data/
@@ -14,4 +15,11 @@ node_modules/*
web/dist/*.map
web/admin/dist/*.map
web/modules/dist/*.map
.gitkeep
docker/development/db_data
docker/prod/db_data
docker/prod/app_data
docker/testing/db_data
test/frontend/cypress/videos/*
test/frontend/cypress/screenshots/*
test/frontend/node_modules/*
+64
View File
@@ -0,0 +1,64 @@
FROM alpine:3.11
LABEL Maintainer="Thilina, Pituwala <thilina@icehrm.com>" \
Description="IceHrm Docker Container with Nginx 1.16 & PHP-FPM 7.3 based on Alpine Linux."
ENV PHPIZE_DEPS \
autoconf \
dpkg-dev dpkg \
file \
g++ \
gcc \
libc-dev \
make \
pkgconf \
musl-dev \
re2c \
php7-dev \
php7-pear
RUN apk --no-cache add bind-tools
# Install packages
RUN apk --no-cache add php php-fpm php-opcache php-mysqli php-json php-openssl php-curl \
php-zlib php-xml php-phar php-intl php-dom php-xmlreader php-ctype php-session \
php-mbstring php-gd php7-ldap nginx supervisor curl
# Install xdebug
RUN apk add --no-cache $PHPIZE_DEPS \
&& pecl install xdebug-2.9.5
# Configure nginx
COPY docker/development/config/nginx.conf /etc/nginx/nginx.conf
# Remove default server definition
RUN rm /etc/nginx/conf.d/default.conf
# Configure PHP-FPM
COPY docker/development/config/fpm-pool.conf /etc/php7/php-fpm.d/www.conf
COPY docker/development/config/php.ini /etc/php7/conf.d/custom.ini
# Configure supervisord
COPY docker/development/config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Setup document root
RUN mkdir -p /var/www/html
# Make sure files/folders needed by the processes are accessable when they run under the nobody user
RUN chown -R nobody.nobody /var/www/html && \
chown -R nobody.nobody /run && \
chown -R nobody.nobody /var/lib/nginx && \
chown -R nobody.nobody /var/log/nginx
# Switch to use a non-root user from here on
USER nobody
# Add application
WORKDIR /var/www/html
# Expose the port nginx is reachable on
EXPOSE 8080
# Let supervisord start nginx & php-fpm
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
# Configure a healthcheck to validate that everything is up&running
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8080/fpm-ping
+49
View File
@@ -0,0 +1,49 @@
FROM alpine:3.11
LABEL Maintainer="Thilina, Pituwala <thilina@icehrm.com>" \
Description="IceHrm Docker Container with Nginx 1.16 & PHP-FPM 7.3 based on Alpine Linux."
# Install packages
RUN apk --no-cache add php7 php7-fpm php7-opcache php7-mysqli php7-json php7-openssl php7-curl \
php7-zlib php7-xml php7-phar php7-intl php7-dom php7-xmlreader php7-ctype php7-session \
php7-mbstring php7-gd php7-ldap nginx supervisor curl
# Configure nginx
COPY docker/prod/config/nginx.conf /etc/nginx/nginx.conf
# Remove default server definition
RUN rm /etc/nginx/conf.d/default.conf
# Configure PHP-FPM
COPY docker/prod/config/fpm-pool.conf /etc/php7/php-fpm.d/www.conf
COPY docker/prod/config/php.ini /etc/php7/conf.d/custom.ini
# Configure supervisord
COPY docker/prod/config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Setup document root
RUN mkdir -p /var/www/html
# Make sure files/folders needed by the processes are accessable when they run under the nobody user
RUN chown -R nobody.nobody /var/www/html && \
chown -R nobody.nobody /run && \
chown -R nobody.nobody /var/lib/nginx && \
chown -R nobody.nobody /var/log/nginx
# Switch to use a non-root user from here on
USER nobody
# Add application
WORKDIR /var/www/html
COPY --chown=nobody ./app /var/www/html/app/
COPY --chown=nobody ./core /var/www/html/core/
COPY --chown=nobody ./web /var/www/html/web/
COPY --chown=nobody ./index.php /var/www/html/index.php
COPY --chown=nobody ./docker/prod/config/config.php /var/www/html/app/config.php
# Expose the port nginx is reachable on
EXPOSE 8070
# Let supervisord start nginx & php-fpm
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
# Configure a healthcheck to validate that everything is up&running
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8071/fpm-ping
+50
View File
@@ -0,0 +1,50 @@
FROM alpine:3.11
LABEL Maintainer="Thilina, Pituwala <thilina@icehrm.com>" \
Description="IceHrm Docker Container with Nginx 1.16 & PHP-FPM 7.3 based on Alpine Linux."
# Install packages
RUN apk --no-cache add php7 php7-fpm php7-opcache php7-mysqli php7-json php7-openssl php7-curl \
php7-zlib php7-xml php7-phar php7-intl php7-dom php7-xmlreader php7-ctype php7-session \
php7-mbstring php7-gd php7-ldap nginx supervisor curl
# Configure nginx
COPY docker/testing/config/nginx.conf /etc/nginx/nginx.conf
# Remove default server definition
RUN rm /etc/nginx/conf.d/default.conf
# Configure PHP-FPM
COPY docker/testing/config/fpm-pool.conf /etc/php7/php-fpm.d/www.conf
COPY docker/testing/config/php.ini /etc/php7/conf.d/custom.ini
# Configure supervisord
COPY docker/testing/config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Setup document root
RUN mkdir -p /var/www/html
# Make sure files/folders needed by the processes are accessable when they run under the nobody user
RUN chown -R nobody.nobody /var/www/html && \
chown -R nobody.nobody /run && \
chown -R nobody.nobody /var/lib/nginx && \
chown -R nobody.nobody /var/log/nginx
# Switch to use a non-root user from here on
USER nobody
# Add application
WORKDIR /var/www/html
COPY --chown=nobody ./app /var/www/html/app/
COPY --chown=nobody ./core /var/www/html/core/
COPY --chown=nobody ./web /var/www/html/web/
COPY --chown=nobody ./index.php /var/www/html/index.php
COPY --chown=nobody ./docker/testing/config/config.php /var/www/html/app/config.php
COPY --chown=nobody ./docker/testing/config/reset-db.php /var/www/html/app/reset-db.php
# Expose the port nginx is reachable on
EXPOSE 8090
# Let supervisord start nginx & php-fpm
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
# Configure a healthcheck to validate that everything is up&running
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8091/fpm-ping
+32
View File
@@ -0,0 +1,32 @@
FROM alpine:3.11
LABEL Maintainer="Thilina, Pituwala <thilina@icehrm.com>" \
Description="IceHrm Docker Container with Nginx 1.16 & PHP-FPM 7.3 based on Alpine Linux."
ARG EXE_ENV
RUN apk upgrade --available
RUN apk add --no-cache tini openrc busybox-initscripts
# Install packages
RUN apk --no-cache add php7 php7-opcache php7-mysqli php7-json php7-openssl php7-curl \
php7-zlib php7-xml php7-phar php7-intl php7-dom php7-xmlreader php7-ctype php7-session \
php7-mbstring php7-gd curl
# Setup document root
RUN mkdir -p /var/www/html
# Add application
WORKDIR /var/www/html
COPY ./app /var/www/html/app/
COPY ./core /var/www/html/core/
COPY ./web /var/www/html/web/
COPY ./index.php /var/www/html/index.php
COPY ./docker/$EXE_ENV/config/config.php /var/www/html/app/config.php
COPY ./docker/worker/config/ice-cron /etc/crontabs/root
RUN rm /var/www/html/app/data/icehrm.log
CMD /usr/sbin/crond -f -l 8
Vendored
-26
View File
@@ -1,26 +0,0 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "thilinah/jessie64_isotope"
config.vm.box_version = "0.0.1"
config.vm.network "private_network", ip: "192.168.40.40"
config.vm.synced_folder ".", "/vagrant", type: "nfs"
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.cpus = "2"
vb.name = "icehrm.open"
end
config.vm.provision "shell", inline: <<-SHELL
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA8E81B4331F7F50
sudo apt-get update
chmod ugo+x /vagrant/deployment/vagrant/runonce.sh
sh /vagrant/deployment/vagrant/runonce.sh
SHELL
config.vm.hostname = "icehrm.open"
end
+51
View File
@@ -0,0 +1,51 @@
<?php
/*
Copyright (c) 2020 [Glacies UG, Berlin, Germany] (http://glacies.de)
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
*/
$moduleName = 'clients';
$moduleGroup = 'admin';
define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.php';
?><div class="span9">
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
<li class="active"><a id="tabClient" href="#tabPageClient"><?=t('Clients')?></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tabPageClient">
<div id="Client" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="ClientForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
</div>
</div>
<script>
var modJsList = [];
modJsList['tabClient'] = new ClientAdapter('Client','Client');
<?php if(isset($modulePermissions['perm']['Add Clients']) && $modulePermissions['perm']['Add Clients'] == "No"){?>
modJsList['tabClient'].setShowAddNew(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Delete Clients']) && $modulePermissions['perm']['Delete Clients'] == "No"){?>
modJsList['tabClient'].setShowDelete(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Edit Clients']) && $modulePermissions['perm']['Edit Clients'] == "No"){?>
modJsList['tabClient'].setShowSave(false);
<?php }?>
var modJs = modJsList['tabClient'];
</script>
<?php include APP_BASE_PATH.'footer.php';?>
+20
View File
@@ -0,0 +1,20 @@
{
"label": "Clients",
"menu": "Admin",
"order": "52",
"icon": "fa-user-circle",
"user_levels": [
"Admin",
"Manager"
],
"dashboardPosition": 4,
"permissions": {
"Manager": {
"Add Clients": "Yes",
"Edit Clients": "Yes",
"Delete Clients": "No"
}
},
"model_namespace": "\\Clients\\Common\\Model",
"manager": "\\Clients\\Admin\\Api\\ClientsAdminManager"
}
+2 -1
View File
@@ -13,8 +13,9 @@ class RoboFile extends \Robo\Tasks
{
private function includeCientConfig($client){
include dirname(__FILE__)."/../config.base.php";
include ALL_CLIENT_BASE_PATH. $client . "/config.php";
//include ALL_CLIENT_BASE_PATH. $client . "/config.php";
include (dirname(__FILE__)."/../../app/config.php");
include (dirname(__FILE__)."/../include.common.php");
include(dirname(__FILE__)."/../server.includes.inc.php");
Executable → Regular
BIN
View File
Binary file not shown.
+209
View File
@@ -0,0 +1,209 @@
INSERT INTO `CompanyStructures` (`id`, `title`, `description`, `address`, `type`, `country`, `parent`) VALUES
(4, 'Development Center', 'Development Center', 'PO Box 001002\nSample Road, Sample Town', 'Regional Office', 'SG', 1),
(5, 'Engineering Department', 'Engineering Department', 'PO Box 001002\nSample Road, Sample Town, 341234', 'Department', 'SG', 4),
(6, 'Development Team', 'Development Team', '', 'Unit', 'SG', 5),
(7, 'QA Team', 'QA Team', '', 'Unit', 'SG', 5),
(8, 'Server Administration', 'Server Administration', '', 'Unit', 'SG', 5),
(9, 'Administration & HR', 'Administration and Human Resource', '', 'Department', 'SG', 4);
REPLACE INTO Employees (id, employee_id, first_name, middle_name, last_name, nationality, birthday, gender, marital_status, ssn_num, nic_num, other_id, driving_license, driving_license_exp_date, employment_status, job_title, pay_grade, work_station_id, address1, address2, city, country, province, postal_code, home_phone, mobile_phone, work_phone, work_email, private_email, joined_date, confirmation_date, supervisor, indirect_supervisors, department, custom1, custom2, custom3, custom4, custom5, custom6, custom7, custom8, custom9, custom10, termination_date, notes, status, ethnicity, immigration_status, approver1, approver2, approver3) VALUES
(2, 'EMP002', 'Lala', 'Nadila ', 'Lamees', 175, '1984-03-12', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', null, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+manager@web-stalk.com', 'icehrm+manager@web-stalk.com', '2011-03-07', '2012-02-14', 1, '[3,4]', 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, 5, 6, null),
(3, 'EMP003', 'Sofia', '', 'O''Sullivan', 4, '1975-08-28', 'Female', 'Married', '', '768-20-4394', '768-20-4394', '', null, 3, 10, 2, '', '2792 Trails End Road', 'Fort Lauderdale', 'Fort Lauderdale', 'US', 12, '33308', '954-388-3340', '954-388-3340', '954-388-3340', 'icehrm+user1@web-stalk.com', 'icehrm+user1@web-stalk.com', '2010-02-08', null, 2, '[1,4]', 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, 5, null, null),
(4, 'EMP004', 'Taylor', '', 'Holmes', 10, '1979-07-15', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(5, 'EMP0.9649787330673809', 'Joseph', '', 'Frances', 10, '1979-07-15', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(6, 'EMP0.24060630727615795', 'Carol', '', 'Linda', 10, '1979-07-15', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(7, 'EMP0.19408038742288983', 'Walter', '', 'Deborah', 10, '1979-07-15', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(8, 'EMP0.03006229552446147', 'Anna', '', 'Daniel', 10, '1979-07-15', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(9, 'EMP0.16481477968843167', 'Richard', '', 'Susan', 10, '1979-07-15', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(10, 'EMP0.37350199406361395', 'Ronald', '', 'Carl', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(11, 'EMP0.43016207165099873', 'Carol', '', 'Kimberly', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(12, 'EMP0.3284134905118621', 'Christopher', '', 'Linda', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(13, 'EMP0.6587049045215406', 'Richard', '', 'Amy', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(14, 'EMP0.8292297160525152', 'Daniel', '', 'Eric', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(15, 'EMP0.5533464602691555', 'Stephanie', '', 'Jason', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(16, 'EMP0.8785160862640627', 'Ryan', '', 'Karen', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(17, 'EMP0.34093407200736375', 'Frances', '', 'Stephen', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(18, 'EMP0.5547930296089435', 'Joshua', '', 'William', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(19, 'EMP0.17822402266620102', 'Scott', '', 'Scott', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(20, 'EMP0.2785116120041456', 'Kimberly', '', 'Angela', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(21, 'EMP0.4688819464937616', 'Jeffrey', '', 'Jose', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(22, 'EMP0.9907437935385329', 'Helen', '', 'Deborah', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(23, 'EMP0.5996925259006141', 'Gary', '', 'Joshua', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(24, 'EMP0.22532124465827014', 'Harold', '', 'Andrew', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(25, 'EMP0.8340029714945731', 'Elizabeth', '', 'Joyce', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(26, 'EMP0.6365657119420969', 'Daniel', '', 'Lisa', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(27, 'EMP0.407178323163817', 'Brian', '', 'Raymond', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(28, 'EMP0.38699322881828363', 'Amanda', '', 'Harold', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(29, 'EMP0.9656451781891707', 'Dorothy', '', 'Barbara', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(30, 'EMP0.8027986751895385', 'Debra', '', 'Deborah', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(31, 'EMP0.1514758022050148', 'Karen', '', 'Carolyn', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(32, 'EMP0.4425015444331817', 'Rebecca', '', 'Michael', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(33, 'EMP0.3102784932686747', 'Donna', '', 'Debra', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null),
(34, 'EMP0.8747393599476101', 'Patricia', '', 'Shirley', 10, '1979-07-15', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', null, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12', null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 'Active', null, null, null, null, null);
UPDATE `Employees` set supervisor = 2, indirect_supervisors = '[3,4]', approver1 = 5, approver2 = 6, approver3 = 7 where id = 1;
UPDATE `Employees` set supervisor = 1, indirect_supervisors = '[3,4]', approver1 = 5, approver2 = 6 where id = 2;
UPDATE `Employees` set supervisor = 2, indirect_supervisors = '[1,4]', approver1 = 5 where id = 3;
INSERT INTO `EmergencyContacts` (`id`, `employee`, `name`, `relationship`, `home_phone`, `work_phone`, `mobile_phone`) VALUES
(1, 1, 'Emma Owns', 'Mother', '+874463422', '+874463422', '+874463422'),
(2, 2, 'Casey Watson', 'Sister', '231-453-876', '231-453-876', '231-453-876');
INSERT INTO `EmployeeCertifications` (`id`, `certification_id`, `employee`, `institute`, `date_start`, `date_end`) VALUES
(1, 21, 1, 'PHR', '2012-06-04', '2016-06-13'),
(2, 19, 1, 'CPA', '2010-02-16', '2019-02-28'),
(3, 17, 2, 'PMP', '2011-06-14', '2019-10-20'),
(4, 3, 2, 'PMI', '2004-06-08', '2017-09-14');
INSERT INTO `EmployeeCompanyLoans` (`id`, `employee`, `loan`, `start_date`, `last_installment_date`, `period_months`, `amount`, `monthly_installment`, `status`, `details`) VALUES
(1, 2, 2, '2013-02-05', '2016-02-05', 12, '12000.00', '1059.45', 'Approved', '');
INSERT INTO `EmployeeDependents` (`id`, `employee`, `name`, `relationship`, `dob`, `id_number`) VALUES
(1, 1, 'Emma Owns', 'Parent', '1940-06-11', '475209UHB'),
(2, 1, 'Mica Singroo', 'Other', '2000-06-13', '');
INSERT INTO `EmployeeEducations` (`id`, `education_id`, `employee`, `institute`, `date_start`, `date_end`) VALUES
(1, 1, 1, 'National University of Turky', '2004-02-03', '2006-06-13'),
(2, 1, 2, 'MIT', '1995-02-21', '1999-10-12');
INSERT INTO `EmployeeLanguages` (`id`, `language_id`, `employee`, `reading`, `speaking`, `writing`, `understanding`) VALUES
(1, 1, 1, 'Full Professional Proficiency', 'Full Professional Proficiency', 'Full Professional Proficiency', 'Native or Bilingual Proficiency'),
(2, 1, 2, 'Native or Bilingual Proficiency', 'Native or Bilingual Proficiency', 'Native or Bilingual Proficiency', 'Native or Bilingual Proficiency'),
(3, 2, 2, 'Limited Working Proficiency', 'Professional Working Proficiency', 'Limited Working Proficiency', 'Professional Working Proficiency');
INSERT INTO `EmployeeProjects` (`id`, `employee`, `project`, `date_start`, `date_end`, `status`, `details`) VALUES
(1, 2, 1, '2010-03-18', '2014-03-06', 'Inactive', ''),
(3, 2, 2, '2013-02-05', '2013-02-11', 'Current', ''),
(5, 2, 3, '2013-02-24', NULL, 'Current', '');
INSERT INTO `EmployeeSalary` (`employee`, `component`,`amount`, `details`) VALUES
(1, 1,'50000.00', ''),
(1, 2,'20000.00', ''),
(1, 3,'30000.00', ''),
(1, 4,'2000.00', ''),
(2, 1,'90500.00', ''),
(2, 2,'40000.00', ''),
(2, 3,'50000.00', ''),
(3, 1,'131409.00', ''),
(3, 2,'143471.00', ''),
(3, 3,'50000.00', ''),
(3, 4,'30000.00', ''),
(4, 5,'1432.00', ''),
(4, 6,'2100.00', ''),
(5, 5,'1200.00', ''),
(5, 6,'1500.00', ''),
(5, 7,'2000.00', ''),
(5, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(6, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(7, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(8, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(9, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(10, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(11, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(12, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(13, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
(14, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), '');
INSERT INTO `EmployeeSkills` (`id`, `skill_id`, `employee`, `details`) VALUES
(1, 9, 1, 'Creating web sites'),
(2, 6, 2, 'Certified Business Intelligence Professional');
INSERT INTO `LeaveRules` (`id`, `leave_type`, `job_title`, `employment_status`, `employee`, `supervisor_leave_assign`, `employee_can_apply`, `apply_beyond_current`, `leave_accrue`, `carried_forward`, `default_per_year`) VALUES
(1, 1, 11, NULL, NULL, 'No', 'Yes', 'Yes', 'No', 'No', 25),
(2, 2, NULL, NULL, 2, 'No', 'Yes', 'Yes', 'No', 'No', 10);
INSERT INTO `Users` (`id`, `username`, `email`, `password`, `employee`,`default_module`, `user_level`,`user_roles`, `last_login`, `last_update`, `created`) VALUES
(2, 'manager', 'icehrm+manager@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 2,NULL, 'Manager','', '2013-01-03 02:47:37', '2013-01-03 02:47:37', '2013-01-03 02:47:37'),
(3, 'user1', 'icehrm+user1@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 3,NULL, 'Employee','', '2013-01-03 02:48:32', '2013-01-03 02:48:32', '2013-01-03 02:48:32'),
(4, 'user2', 'icehrm+user2@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 4,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(5, 'user3', 'icehrm+user3@web-stalk.com', '4048bb914a704a0728549a26b92d8550', NULL,NULL, 'Restricted Admin','["1"]', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(6, 'user4', 'icehrm+user4@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 5,NULL, 'Manager','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(7, 'user5', 'icehrm+user5@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 6,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(8, 'user6', 'icehrm+user6@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 7,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(9, 'user7', 'icehrm+user7@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 8,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(10, 'user8', 'icehrm+user8@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 9,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(11, 'user9', 'icehrm+user9@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 10,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55');
INSERT INTO `EmployeeDocuments` (`id`,`employee`, `document`, `date_added`, `valid_until`, `status`, `details`, `attachment`, `expire_notification_last`) VALUES
(1, 1, 1, CURDATE(), DATE_ADD(CURDATE(), INTERVAL 30 DAY), 'Active', '', NULL, -1),
(2, 1, 2, CURDATE(), DATE_ADD(CURDATE(), INTERVAL 7 DAY), 'Active', '', NULL, -1),
(3, 1, 3, CURDATE(), DATE_ADD(CURDATE(), INTERVAL 1 DAY), 'Active', '', NULL, -1);
INSERT INTO `Attendance` (`employee`,`in_time`,`out_time`,`note`) VALUES
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 20 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 20 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 19 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 19 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 18 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 18 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 17 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 17 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 16 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 16 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 15 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 15 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), '');
INSERT INTO `Settings` (`name`, `value`, `description`, `category`, `meta`) VALUES
('Instance : ID', '0847429146712c108e23c435e8f93b4d', 'Instance', '',''),
('Instance: Key', 'UQHEYBx9H1eNR66nhNCNCz1WCDDhkjtx1OuJbO3ZQMt+8tfSGvuOH/YEHntRajY=', '', 'Instance','');
INSERT INTO `EmployeeTeams` (`id`,`name`, `description`, `lead`, `department`) VALUES
(1,'alpha', 'designing team', 5,2),
(2,'beta', 'marketing team', 4,3);
INSERT INTO `EmployeeTeamMembers` (`id`,`team`, `member`, `role`) VALUES
(1,1, 3, '1'),
(2,2,6, '2');
+7
View File
@@ -1350,6 +1350,7 @@ class BaseService
$settings->name = "Instance: Key";
}
$settings->value = $key;
$settings->category = 'Instance';
$settings->Save();
}
@@ -1376,11 +1377,17 @@ class BaseService
return false;
}
/*
$data = AesCtr::decrypt($key, $instanceId, 256);
$arr = explode("|", $data);
if ($arr[0] == KEY_PREFIX && $arr[1] == $instanceId) {
return true;
}
*/
if (strlen($key) > 20) {
return true;
}
return false;
}
@@ -0,0 +1,26 @@
<?php
namespace Clients\Admin\Api;
use Classes\AbstractModuleManager;
class ClientsAdminManager extends AbstractModuleManager
{
public function initializeUserClasses()
{
}
public function initializeFieldMappings()
{
}
public function initializeDatabaseErrorMappings()
{
}
public function setupModuleClassDefinitions()
{
$this->addModelClass('Client');
}
}
@@ -6,8 +6,9 @@
* Time: 5:53 PM
*/
namespace Projects\Common\Model;
namespace Clients\Common\Model;
use Classes\ModuleAccess;
use Model\BaseModel;
class Client extends BaseModel
@@ -22,4 +23,11 @@ class Client extends BaseModel
{
return array("get","element","save","delete");
}
public function getModuleAccess()
{
return [
new ModuleAccess('clients', 'admin'),
];
}
}
+6 -1
View File
@@ -22,10 +22,15 @@ class LogManager
if (empty(self::$me)) {
self::$me = new LogManager();
self::$me->log = new Logger(APP_NAME);
if (is_writable(ini_get('error_log'))) {
if (defined('LOG_STDERR') && LOG_STDERR === '1') {
self::$me->log->pushHandler(new StreamHandler('php://stderr', LOG_LEVEL));
} else if (is_writable(ini_get('error_log'))) {
self::$me->log->pushHandler(new StreamHandler(ini_get('error_log'), LOG_LEVEL));
} elseif (is_writable(CLIENT_BASE_PATH.'data/app.log')) {
self::$me->log->pushHandler(new StreamHandler(CLIENT_BASE_PATH.'data/app.log', LOG_LEVEL));
} else {
self::$me->log->pushHandler(new StreamHandler('php://stderr', LOG_LEVEL));
}
}
return self::$me;
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
cd /vagrant
sudo npm install
cd web
sudo npm install
+33
View File
@@ -0,0 +1,33 @@
version: "3.5"
services:
mysql-prod:
image: mysql:5.7
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: IceHrmR00t
MYSQL_USER: prod
MYSQL_PASSWORD: prod
MYSQL_DATABASE: icehrm
volumes:
- ./docker/prod/init.sql:/docker-entrypoint-initdb.d/setup.sql
- ./docker/prod/db_data:/var/lib/mysql
icehrm-prod:
build:
context: ./
dockerfile: Dockerfile-prod
ports:
- 8070:8070
volumes:
- ./docker/prod/app_data:/var/www/html/app/data
icehrm-worker:
build:
context: ./
dockerfile: Dockerfile-worker
args:
- EXE_ENV=prod
volumes:
db_data:
app_data:
+39
View File
@@ -0,0 +1,39 @@
version: "3.5"
services:
mysql-testing:
image: mysql:5.7
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: IceHrmR00t
MYSQL_USER: testing
MYSQL_PASSWORD: testing
MYSQL_DATABASE: icehrm
volumes:
- ./docker/testing/init.sql:/docker-entrypoint-initdb.d/setup.sql
- ./docker/testing/db_data:/var/lib/mysql
icehrm-testing:
build:
context: ./
dockerfile: Dockerfile-testing
ports:
- 8090:8090
logging:
driver: none
# Cypress container
cypress:
# the Docker image to use from https://github.com/cypress-io/cypress-docker-images
image: "cypress/included:3.2.0"
depends_on:
- icehrm-testing
environment:
# pass base url to test pointing at the web application
- CYPRESS_baseUrl=http://icehrm-testing:8090
# share the current folder as volume to avoid copying
working_dir: /e2e
volumes:
- ./test/frontend:/e2e
volumes:
db_data:
+30
View File
@@ -0,0 +1,30 @@
version: "2.4"
services:
mysql:
image: mysql:5.7
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: IceHrmR00t
MYSQL_USER: dev
MYSQL_PASSWORD: dev
MYSQL_DATABASE: icehrm
volumes:
- ./docker/development/init.sql:/docker-entrypoint-initdb.d/setup.sql
- ./docker/development/db_data:/var/lib/mysql
icehrm:
build: .
ports:
- 8080:8080
volumes:
- .:/var/www/html
icehrm-worker-dev:
build:
context: ./
dockerfile: Dockerfile-worker
args:
- EXE_ENV=development
volumes:
db_data:
+20
View File
@@ -0,0 +1,20 @@
<?php
ini_set('error_log', '/var/www/html/app/data/icehrm.log');
define('CLIENT_NAME', 'icehrm');
define('APP_BASE_PATH', '/var/www/html/core/');
define('CLIENT_BASE_PATH', '/var/www/html/app/');
define('BASE_URL','http://localhost:8080/web/');
define('CLIENT_BASE_URL','http://localhost:8080/app/');
define('APP_DB', 'icehrm');
define('APP_USERNAME', 'dev');
define('APP_PASSWORD', 'dev');
define('APP_HOST', 'mysql');
define('APP_CON_STR', 'mysqli://'.APP_USERNAME.':'.APP_PASSWORD.'@'.APP_HOST.'/'.APP_DB);
//file upload
define('FILE_TYPES', 'jpg,png,jpeg');
define('MAX_FILE_SIZE_KB', 10 * 1024);
define('LOG_STDERR', '1');
+56
View File
@@ -0,0 +1,56 @@
[global]
; Log to stderr
error_log = /dev/stderr
[www]
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
; a specific port;
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000
; Enable status page
pm.status_path = /fpm-status
; Ondemand process manager
pm = ondemand
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 100
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
pm.process_idle_timeout = 10s;
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
pm.max_requests = 1000
; Make sure the FPM workers can reach the environment variables for configuration
clear_env = no
; Catch output from PHP
catch_workers_output = yes
; Remove the 'child 10 said into stderr' prefix in the log and only show the actual message
decorate_workers_output = no
; Enable ping page to use in healthcheck
ping.path = /fpm-ping
+2
View File
@@ -0,0 +1,2 @@
<?php
phpinfo();
+86
View File
@@ -0,0 +1,86 @@
worker_processes 1;
error_log stderr warn;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
# Define custom log format to include reponse times
log_format main_timed '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'$request_time $upstream_response_time $pipe $upstream_cache_status';
access_log /dev/stdout main_timed;
error_log /dev/stderr notice;
keepalive_timeout 65;
# Write temporary files to /tmp so they can be created as a non-privileged user
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
# Default server definition
server {
listen [::]:8080 default_server;
listen 8080 default_server;
server_name _;
sendfile off;
root /var/www/html;
index index.php;
location /app/api/ {
try_files $uri /app/api/index.php?/$uri&$args;
}
# Pass the PHP scripts to PHP-FPM listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
expires 5d;
}
# Deny access to . files, for security
location ~ /\. {
log_not_found off;
deny all;
}
# Allow fpm ping and status from localhost
location ~ ^/(fpm-status|fpm-ping)$ {
access_log off;
allow 127.0.0.1;
deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
}
gzip on;
gzip_proxied any;
gzip_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/json application/xml+rss;
gzip_vary on;
gzip_disable "msie6";
# Include other server configs
include /etc/nginx/conf.d/*.conf;
}
+16
View File
@@ -0,0 +1,16 @@
[Date]
date.timezone="UTC"
[xdebug]
zend_extension=/usr/lib/php7/modules/xdebug.so
xdebug.cli_color=1
xdebug.remote_enable=1
xdebug.remote_host=host.docker.internal
xdebug.remote_connect_back=0
xdebug.var_display_max_children=512
xdebug.var_display_max_depth=20
xdebug.var_display_max_data=-1
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = "/tmp"
xdebug.max_nesting_level = 512
@@ -0,0 +1,23 @@
[supervisord]
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0
pidfile=/run/supervisord.pid
[program:php-fpm]
command=php-fpm7 -F
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=false
startretries=0
[program:nginx]
command=nginx -g 'daemon off;'
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=false
startretries=0
File diff suppressed because it is too large Load Diff
-2
View File
@@ -1,2 +0,0 @@
https://hub.docker.com/r/thilinah/icehrm/
docker run -i -t -p 192.168.99.100:80:80 thilinah/icehrm /bin/start.sh
+20
View File
@@ -0,0 +1,20 @@
<?php
ini_set('error_log', '/var/www/html/app/data/icehrm.log');
define('CLIENT_NAME', 'icehrm');
define('APP_BASE_PATH', '/var/www/html/core/');
define('CLIENT_BASE_PATH', '/var/www/html/app/');
define('BASE_URL','http://localhost:8070/web/');
define('CLIENT_BASE_URL','http://localhost:8070/app/');
define('APP_DB', 'icehrm');
define('APP_USERNAME', 'prod');
define('APP_PASSWORD', 'prod');
define('APP_HOST', 'mysql-prod');
define('APP_CON_STR', 'mysqli://'.APP_USERNAME.':'.APP_PASSWORD.'@'.APP_HOST.'/'.APP_DB);
//file upload
define('FILE_TYPES', 'jpg,png,jpeg');
define('MAX_FILE_SIZE_KB', 10 * 1024);
define('LOG_STDERR', '1');
+56
View File
@@ -0,0 +1,56 @@
[global]
; Log to stderr
error_log = /dev/stderr
[www]
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
; a specific port;
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000
; Enable status page
pm.status_path = /fpm-status
; Ondemand process manager
pm = ondemand
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 100
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
pm.process_idle_timeout = 10s;
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
pm.max_requests = 1000
; Make sure the FPM workers can reach the environment variables for configuration
clear_env = no
; Catch output from PHP
catch_workers_output = yes
; Remove the 'child 10 said into stderr' prefix in the log and only show the actual message
decorate_workers_output = no
; Enable ping page to use in healthcheck
ping.path = /fpm-ping
+86
View File
@@ -0,0 +1,86 @@
worker_processes 1;
error_log stderr warn;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
# Define custom log format to include reponse times
log_format main_timed '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'$request_time $upstream_response_time $pipe $upstream_cache_status';
access_log /dev/stdout main_timed;
error_log /dev/stderr notice;
keepalive_timeout 65;
# Write temporary files to /tmp so they can be created as a non-privileged user
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
# Default server definition
server {
listen [::]:8070 default_server;
listen 8070 default_server;
server_name _;
sendfile off;
root /var/www/html;
index index.php;
location /app/api/ {
try_files $uri /app/api/index.php?/$uri&$args;
}
# Pass the PHP scripts to PHP-FPM listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
expires 5d;
}
# Deny access to . files, for security
location ~ /\. {
log_not_found off;
deny all;
}
# Allow fpm ping and status from localhost
location ~ ^/(fpm-status|fpm-ping)$ {
access_log off;
allow 127.0.0.1;
deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
}
gzip on;
gzip_proxied any;
gzip_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/json application/xml+rss;
gzip_vary on;
gzip_disable "msie6";
# Include other server configs
include /etc/nginx/conf.d/*.conf;
}
+2
View File
@@ -0,0 +1,2 @@
[Date]
date.timezone="UTC"
+23
View File
@@ -0,0 +1,23 @@
[supervisord]
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0
pidfile=/run/supervisord.pid
[program:php-fpm]
command=php-fpm7 -F
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=false
startretries=0
[program:nginx]
command=nginx -g 'daemon off;'
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=false
startretries=0
+2961
View File
File diff suppressed because it is too large Load Diff
-30
View File
@@ -1,30 +0,0 @@
#!/bin/bash
service nginx start
service php5-fpm start
service mysql start
if [ -d "/usr/share/nginx/www/" ]; then
echo 'Already Installed'
else
echo 'Installing IceHrm'
cd /usr/share/nginx
curl -s https://api.github.com/repos/gamonoid/icehrm/releases/latest | jq -r ".assets[] | select(.name) | .browser_download_url" | grep '.zip' | xargs wget
ls | grep 'zip' | xargs unzip
mv `ls -d */ | grep icehrm | head -1` www/
rm *.zip
echo 'Your MySQL root password : icehrmpwd'
echo "Following will be needed during installation"
echo "--------------------------------------------"
echo 'IceHrm Database : icehrmdb'
echo 'IceHrm User : icehrmuser'
echo 'IceHrm User Password : icehrmuserpwd'
echo 'IceHrm Database host : localhost'
echo 'Please visit your docker installation url to begin installation.'
fi
/bin/bash
+20
View File
@@ -0,0 +1,20 @@
<?php
ini_set('error_log', '/var/www/html/app/data/icehrm.log');
define('CLIENT_NAME', 'icehrm');
define('APP_BASE_PATH', '/var/www/html/core/');
define('CLIENT_BASE_PATH', '/var/www/html/app/');
define('BASE_URL','http://icehrm-testing:8090/web/');
define('CLIENT_BASE_URL','http://icehrm-testing:8090/app/');
define('APP_DB', 'icehrm');
define('APP_USERNAME', 'testing');
define('APP_PASSWORD', 'testing');
define('APP_HOST', 'mysql-testing');
define('APP_CON_STR', 'mysqli://'.APP_USERNAME.':'.APP_PASSWORD.'@'.APP_HOST.'/'.APP_DB);
//file upload
define('FILE_TYPES', 'jpg,png,jpeg');
define('MAX_FILE_SIZE_KB', 10 * 1024);
define('LOG_STDERR', '1');
+56
View File
@@ -0,0 +1,56 @@
[global]
; Log to stderr
error_log = /dev/stderr
[www]
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
; a specific port;
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000
; Enable status page
pm.status_path = /fpm-status
; Ondemand process manager
pm = ondemand
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 100
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
pm.process_idle_timeout = 10s;
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
pm.max_requests = 1000
; Make sure the FPM workers can reach the environment variables for configuration
clear_env = no
; Catch output from PHP
catch_workers_output = yes
; Remove the 'child 10 said into stderr' prefix in the log and only show the actual message
decorate_workers_output = no
; Enable ping page to use in healthcheck
ping.path = /fpm-ping
+86
View File
@@ -0,0 +1,86 @@
worker_processes 1;
error_log stderr warn;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
# Define custom log format to include reponse times
log_format main_timed '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'$request_time $upstream_response_time $pipe $upstream_cache_status';
access_log /dev/stdout main_timed;
error_log /dev/stderr notice;
keepalive_timeout 65;
# Write temporary files to /tmp so they can be created as a non-privileged user
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
# Default server definition
server {
listen [::]:8090 default_server;
listen 8090 default_server;
server_name _;
sendfile off;
root /var/www/html;
index index.php;
location /app/api/ {
try_files $uri /app/api/index.php?/$uri&$args;
}
# Pass the PHP scripts to PHP-FPM listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
expires 5d;
}
# Deny access to . files, for security
location ~ /\. {
log_not_found off;
deny all;
}
# Allow fpm ping and status from localhost
location ~ ^/(fpm-status|fpm-ping)$ {
access_log off;
allow 127.0.0.1;
deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
}
gzip on;
gzip_proxied any;
gzip_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/json application/xml+rss;
gzip_vary on;
gzip_disable "msie6";
# Include other server configs
include /etc/nginx/conf.d/*.conf;
}
+3
View File
@@ -0,0 +1,3 @@
[Date]
date.timezone="UTC"
+4
View File
@@ -0,0 +1,4 @@
<?php
$output = shell_exec('cd /var/www/html/core/robo; php robo.phar reset:db test; php robo.phar create:tables test; php robo.phar migrate:all test; php robo.phar execute:fixtures test');
echo "<pre>$output</pre>";
+23
View File
@@ -0,0 +1,23 @@
[supervisord]
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0
pidfile=/run/supervisord.pid
[program:php-fpm]
command=php-fpm7 -F
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=false
startretries=0
[program:nginx]
command=nginx -g 'daemon off;'
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=false
startretries=0
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
* * * * * php /var/www/html/app/cron.php
+2
View File
@@ -0,0 +1,2 @@
[Date]
date.timezone="UTC"
+59 -14
View File
@@ -12,11 +12,22 @@ const es = require('event-stream');
const rename = require('gulp-rename');
const concat = require('gulp-concat');
const copy = require('gulp-copy');
const babel = require('gulp-babel');
const less = require('gulp-less');
const path = require('path');
const cleanCSS = require('gulp-clean-css');
const paths = {
pages: ['src/*.html'],
};
let mod = process.argv.filter((item) => item.substr(0, 3) === '--m');
if (mod.length === 1) {
mod = mod[0].substr(3);
} else {
mod = null;
}
gulp.task('pack-js', (done) => {
gulp.src([
'web/js/jquery2.0.2.min.js',
@@ -46,11 +57,23 @@ gulp.task('pack-js', (done) => {
done();
});
gulp.task('compile-ant-less', (done) => {
gulp.src([
'web/node_modules/antd/dist/antd.less',
]).pipe(less({
paths: [path.join(__dirname, 'less', 'includes')],
javascriptEnabled: true,
}))
.pipe(concat('antd.css'))
.pipe(gulp.dest('web/dist'));
done();
});
gulp.task('pack-css', (done) => {
gulp.src([
'web/themecss/bootstrap.min.css',
'web/themecss/fa-all-5.8.2.min.css',
//'web/themecss/font-awesome.css',
// 'web/themecss/font-awesome.css',
'web/themecss/ionicons.min.css',
'web/bower_components/material-design-icons/iconfont/material-icons.css',
'web/js/fullcaledar/fullcalendar.css',
@@ -64,7 +87,10 @@ gulp.task('pack-css', (done) => {
'web/css/fa-animations.css',
'web/css/style.css',
'web/bower_components/simplemde/dist/simplemde.min.css',
'web/node_modules/codemirror/lib/codemirror.css',
'web/dist/antd.css',
])
.pipe(cleanCSS())
.pipe(concat('third-party.css'))
.pipe(gulp.dest('web/dist'));
done();
@@ -95,8 +121,9 @@ gulp.task('api-common', (done) => {
packageCache: {},
})
.transform('babelify', {
presets: ['es2015'], extensions: ['.js'],
presets: ['@babel/preset-env', '@babel/preset-react'], extensions: ['.js', '.jsx'],
})
.transform(require('browserify-css'))
.bundle()
.pipe(source('common.js'))
.pipe(buffer())
@@ -124,11 +151,13 @@ gulp.task('api-common', (done) => {
gulp.task('admin-js', (done) => {
// we define our input files, which we want to have
// bundled:
const files = [
let files = [
'attendance',
'company_structure',
'clients',
'dashboard',
'data',
'documents',
'employees',
'fieldnames',
'jobs',
@@ -146,8 +175,13 @@ gulp.task('admin-js', (done) => {
'travel',
'users',
];
// map them to our stream function
const tasks = files.map(entry => browserify({
if (mod != null) {
files = files.filter((item) => item === mod);
}
// map them to our stream function
const tasks = files.map((entry) => browserify({
entries: [`web/admin/src/${entry}/index.js`],
basedir: '.',
debug: true,
@@ -155,11 +189,15 @@ gulp.task('admin-js', (done) => {
packageCache: {},
})
.transform('babelify', {
presets: ['es2015'], extensions: ['.js'],
plugins: [
['@babel/plugin-proposal-class-properties', { loose: true }],
],
presets: ['@babel/preset-env', '@babel/preset-react'],
extensions: ['.js', '.jsx'],
})
.transform(require('browserify-css'))
.bundle()
.pipe(source(`${entry}/lib.js`))
// rename them to have "bundle as postfix"
.pipe(rename(`${entry}.js`))
.pipe(buffer())
.pipe(sourcemaps.init({ loadMaps: true }))
@@ -173,17 +211,18 @@ gulp.task('admin-js', (done) => {
))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./web/admin/dist/')));
// create a merged stream
// create a merged stream
es.merge.apply(null, tasks).on('end', done);
});
gulp.task('modules-js', (done) => {
// we define our input files, which we want to have
// bundled:
const files = [
let files = [
'attendance',
'dashboard',
'dependents',
'documents',
'emergency_contact',
'employees',
'loans',
@@ -196,8 +235,13 @@ gulp.task('modules-js', (done) => {
'time_sheets',
'travel',
];
// map them to our stream function
const tasks = files.map(entry => browserify({
if (mod != null) {
files = files.filter((item) => item === mod);
}
// map them to our stream function
const tasks = files.map((entry) => browserify({
entries: [`web/modules/src/${entry}/index.js`],
basedir: '.',
debug: true,
@@ -205,11 +249,11 @@ gulp.task('modules-js', (done) => {
packageCache: {},
})
.transform('babelify', {
presets: ['es2015'], extensions: ['.js'],
presets: ['@babel/preset-env', '@babel/preset-react'], extensions: ['.js', '.jsx'],
})
.transform(require('browserify-css'))
.bundle()
.pipe(source(`${entry}/lib.js`))
// rename them to have "bundle as postfix"
.pipe(rename(`${entry}.js`))
.pipe(buffer())
.pipe(sourcemaps.init({ loadMaps: true }))
@@ -223,11 +267,12 @@ gulp.task('modules-js', (done) => {
))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./web/modules/dist/')));
// create a merged stream
// create a merged stream
es.merge.apply(null, tasks).on('end', done);
});
gulp.task('default', gulp.series(
'compile-ant-less',
'pack-js',
'pack-css',
'copy-assets',
+4188 -1681
View File
File diff suppressed because it is too large Load Diff
+29 -19
View File
@@ -1,7 +1,7 @@
{
"name": "icehrm",
"version": "1.0.0",
"description": "IceHrm is a human resource management system",
"version": "",
"description": "Simple HR Management",
"main": "gulpfile.js",
"directories": {
"test": "test"
@@ -12,31 +12,41 @@
"author": "",
"license": "ISC",
"devDependencies": {
"acorn": "^6.0.4",
"babel-core": "^6.26.3",
"babel-preset-es2015": "^6.24.1",
"babelify": "^8.0.0",
"browserify": "^16.2.2",
"eslint": "^5.11.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.11.1",
"@babel/core": "^7.9.0",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/preset-env": "^7.9.0",
"@babel/preset-react": "^7.9.4",
"acorn": "^7.1.1",
"babelify": "^10.0.0",
"browserify": "^16.5.1",
"browserify-css": "^0.15.0",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.1.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.19.0",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-clean-css": "^4.3.0",
"gulp-concat": "^2.6.1",
"gulp-copy": "^4.0.1",
"gulp-minify": "^3.1.0",
"gulp-obfuscate": "^0.2.9",
"gulp-sourcemaps": "^2.6.4",
"gulp-uglify": "^3.0.1",
"gulp-uglify-es": "^1.0.4",
"gulp-rename": "^2.0.0",
"gulp-sourcemaps": "^2.6.5",
"gulp-uglify": "^3.0.2",
"gulp-uglify-es": "^2.0.0",
"stdio": "^2.1.1",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
},
"dependencies": {
"browserify-less": "0.0.1",
"d3": "^5.9.1",
"event-stream": "^4.0.1",
"gulp-concat": "^2.6.1",
"gulp-copy": "^4.0.1",
"gulp-rename": "^1.4.0",
"qrcode": "^1.3.3"
"gulp-less": "^4.0.1",
"path": "^0.12.7",
"qrcode": "^1.3.3",
"reqwest": "^2.0.5"
}
}
+65 -23
View File
@@ -1,9 +1,40 @@
<img src="web/images/logo-sq.png" align="right" />
IceHrm
===========
[![Build Status](https://travis-ci.org/gamonoid/icehrm.svg?branch=master)](https://travis-ci.org/gamonoid/icehrm)
IceHrm is a [HRM software](https://icehrm.com) which enable companies of all sizes to [manage HR activities](https://icehrm.com)
properly.
properly.
- [IceHrm Demo](https://icehrm.com/icehrm-demo)
- Feature rich version of IceHrm (IceHrmPro) is available at [https://icehrm.com/purchase-icehrmpro](https://icehrm.com/purchase-icehrmpro)
Getting started
---------------
The easiest way to run IceHrm is using docker
- Install docker on Mac, Windows or Linux [https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/)
For Linux you need to install docker compose separately here [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/)
```
$ git clone https://github.com/gamonoid/icehrm.git
$ cd icehrm
$ docker-compose -f docker-compose-prod.yaml up -d
```
- Visit [http://localhost:8070/](http://localhost:8070/) to load icehrm, that's it
You can find database and app data under `icehrm/docker/production`
When you want to kill the docker containers
```
docker-compose -f docker-compose-prod.yaml down
```
IceHrm Mobile App (Beta)
------------------------
@@ -31,8 +62,8 @@ Useful Links
* Community Support: [http://stackoverflow.com/search?q=icehrm](http://stackoverflow.com/search?q=icehrm)
* IceHrm Opensource Blog: [http://icehrm.org](http://icehrm.org)
Installation
------------
Installation without Docker
---------------------------
* Download the latest release https://github.com/gamonoid/icehrm/releases/latest
* Copy the downloaded file to the path you want to install iCE Hrm in your server and extract.
@@ -60,45 +91,56 @@ Refer: [http://blog.icehrm.com/docs/upgrade/](http://blog.icehrm.com/docs/upgrad
Setup IceHrm Development Environment
------------------------------------
IceHrm development environment is packaged as a Vagrant box. I includes php7, nginx, phpunit and other
software required for running icehrm
IceHrm uses docker to setup development environment
Preparing development VM with Vagrant
-------------------------------------
- Clone icehrm from https://github.com/gamonoid/icehrm.git or download the source
- Install Vagrant [https://www.vagrantup.com/downloads.html](https://www.vagrantup.com/downloads.html)
- Run vagrant up in icehrm root directory (this will download icehrm vagrant image which is ~1 GB)
```
~ $ vagrant up
$ git clone https://github.com/gamonoid/icehrm.git
$ cd icehrm
$ docker-compose up
```
- Run vagrant ssh to login to the Virtual machine
- Load icehrm Development preview
```
~ $ vagrant ssh
http://localhost:8080
```
- Add following entries to the end of the host file to map icehrm domains to VagrantBox (on MacOS and Linux this is /etc/hosts | on windows this is Windows\System32\Drivers\etc\hosts)
- Make some changes and the changes will be reflected on the above url
- Run e2e (cypress) tests
```
192.168.40.40 app.icehrm-open.test
192.168.40.40 clients.icehrm-open.test
docker-compose -f docker-compose-testing.yaml up --exit-code-from cypress
```
- When you are ready to push your changes to production, make sure to build the production images
```
$ docker-compose -f docker-compose-prod.yaml up -d --build
```
- Navigate to [http://clients.icehrm-open.test/dev](http://clients.icehrm-open.test/dev) to load icehrm from VM. (user:admin/pass:admin)
### Notes to Developers
### Building frontend assets
- When ever you have done a change to JavaScript or CSS files in icehrm/web rebuild the frontend
- When ever you have done a change to JavaScript or CSS files in icehrm/web you need to rebuild the frontend
- First make sure you have all the dependencies (just doing this once is enough)
```
~ $ cd /vagrant
~ $ gulp
$ cd icehrm/web
$ npm install
$ cd ..
$ npm install
```
- Then run gulp
```
$ gulp
```
- If you have only changed an admin module and you know which module it is
```
$ gulp admin-js --memployees
```
@@ -20,9 +20,14 @@ class IceCypressTest {
cy.server().route('GET', `/${config.URL_PREFIX}/service.php*`).as('getElement');
cy.get(`#${this.element} table tbody`).find('tr').first()
.find(viewButtonSelector || `.center div img[${this.titleDataAttributeName}='View']`)
.should("be.visible")
.click();
cy.wait('@getElement').its('status').should('be', config.DEFAULT_WAIT_TIME);
if (config.WAIT_ON_TIME) {
cy.wait(config.WAIT_TIME);
} else {
cy.wait('@getElement').its('status').should('be', config.DEFAULT_STATUS);
}
}
viewElementValidate(cy, validation = []) {
@@ -34,9 +39,14 @@ class IceCypressTest {
editElement(cy, update, editButtonSelector = null) {
cy.server().route('POST', `/${config.URL_PREFIX}/service.php*`).as('getElement');
cy.get(`#${this.element} table tbody`).find('tr').first().find(editButtonSelector || `.center div img[${this.titleDataAttributeName}='Edit']`)
.should("be.visible")
.click();
cy.wait('@getElement').its('status').should('be', config.DEFAULT_WAIT_TIME);
if (config.WAIT_ON_TIME) {
cy.wait(config.WAIT_TIME);
} else {
cy.wait('@getElement').its('status').should('be', config.DEFAULT_STATUS);
}
update.forEach((item) => {
cy.get(item[0]).clear().type(item[1]).should('have.value', item[1]);
@@ -44,32 +54,27 @@ class IceCypressTest {
}
select2Click(id, value) {
cy.get(`#s2id_${id}`).click();
cy.get(`#s2id_${id}`).should("be.visible").click();
cy.focused().clear().type(value).should('have.value', value);
cy.get('.select2-drop:visible').find('.select2-results li').first()
.should("be.visible")
.click();
}
clickSave(cy) {
cy.get(`#${this.element}Form .saveBtn`).click();
cy.get(`#${this.element}Form .saveBtn`).should("be.visible").click();
cy.wait(config.WAIT_TIME);
}
editElementValidate(cy, validation = [], editButtonSelector) {
if (this.isRemoteTable) {
cy.server().route('GET', `/${config.URL_PREFIX}/data.php*`).as('getAfterSave');
} else {
cy.server().route('POST', `/${config.URL_PREFIX}/service.php*`).as('getAfterSave');
}
// Wait for data table response
cy.wait('@getAfterSave').its('status').should('be', config.DEFAULT_WAIT_TIME);
cy.server().route('POST', `/${config.URL_PREFIX}/service.php*`).as('getElementAfterSave');
// Click on edit and wait
cy.get(`#${this.element} table tbody`).find('tr').first().find(editButtonSelector || `.center div img[${this.titleDataAttributeName}='Edit']`)
.should("be.visible")
.click();
cy.wait('@getElementAfterSave').its('status').should('be', config.DEFAULT_WAIT_TIME);
cy.wait('@getElementAfterSave').its('status').should('be', config.DEFAULT_STATUS);
validation.forEach((item) => {
cy.get(item[0]).then(element => expect(element.val()).eq(item[1]));
@@ -95,7 +100,11 @@ class IceCypressTest {
cy.visit(`${config.BASE_URL}?${this.moduleUrl}`);
// Wait for data table response
cy.wait('@get').its('status').should('be', config.DEFAULT_WAIT_TIME);
if (config.WAIT_ON_TIME) {
cy.wait(config.WAIT_TIME);
} else {
cy.wait('@get').its('status').should('be', config.DEFAULT_STATUS);
}
}
switchTab(cy, tabName = null) {
@@ -104,8 +113,12 @@ class IceCypressTest {
} else {
cy.server().route('POST', `/${config.URL_PREFIX}/service.php*`).as('getTab');
}
cy.get(tabName || `#tab${this.element}`).click();
cy.wait('@getTab').its('status').should('be', config.DEFAULT_WAIT_TIME);
cy.get(tabName || `#tab${this.element}`).should("be.visible").click();
if (config.WAIT_ON_TIME) {
cy.wait(config.WAIT_TIME);
} else {
cy.wait('@getTab').its('status').should('be', config.DEFAULT_STATUS);
}
}
}
@@ -1,44 +0,0 @@
const IceCypressTest = require('../../commmon/ice-cypress-test');
const config = require('../../support/config');
const test = new IceCypressTest(
'g=admin&n=teams&m=admin_Employees',
'TeamMembers',
false,
);
context('Admin Teams Module - Team Members Tab', () => {
it('admin can view list', () => {
cy.login('admin', 'admin');
test.loadModule(cy);
test.switchTab(cy);
test.loadTable(cy, 2);
});
it('admin can edit element', () => {
cy.login('admin', 'admin');
test.loadModule(cy);
test.switchTab(cy);
cy.get('#TeamMembers table tbody').find('tr').first().find('.center div img[data-original-title=\'Edit\']')
.click();
test.select2Click('team', 'beta');
test.clickSave(cy);
});
it('manager can view list', () => {
cy.login('manager', config.DEFAULT_USER_PASS);
test.loadModule(cy);
test.switchTab(cy);
test.loadTable(cy, 2);
});
it('manager can edit element', () => {
cy.login('manager', config.DEFAULT_USER_PASS);
test.loadModule(cy);
test.switchTab(cy);
cy.get('#TeamMembers table tbody').find('tr').first().find('.center div img[data-original-title=\'Edit\']')
.click();
test.select2Click('team', 'beta');
test.clickSave(cy);
});
});
@@ -1,40 +0,0 @@
const IceCypressTest = require('../../commmon/ice-cypress-test');
const config = require('../../support/config');
const test = new IceCypressTest(
'g=admin&n=teams&m=admin_Employees',
'Teams',
false,
);
context('Admin Teams Module - Teams Tab', () => {
it('admin can view list', () => {
cy.login('admin', 'admin');
test.loadModule(cy);
test.loadTable(cy, 2);
});
it('admin can edit element', () => {
cy.login('admin', 'admin');
test.loadModule(cy);
test.editElement(cy, [['#description', 'creative designing team']]);
test.select2Click('department', 'Head Office');
test.clickSave(cy);
test.editElementValidate(cy, [['#description', 'creative designing team']]);
});
it('manager can view list', () => {
cy.login('manager', config.DEFAULT_USER_PASS);
test.loadModule(cy);
test.loadTable(cy, 2);
});
it('manager can edit element', () => {
cy.login('manager', config.DEFAULT_USER_PASS);
test.loadModule(cy);
test.editElement(cy, [['#description', 'creative designing team']]);
test.select2Click('department', 'Head Office');
test.clickSave(cy);
test.editElementValidate(cy, [['#description', 'creative designing team']]);
});
});
+3 -2
View File
@@ -27,12 +27,13 @@ const config = require('./config');
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
Cypress.Commands.add('login', (user, password) => {
cy.visit(`${config.BASE_URL}login.php`);
cy.visit(`${config.BASE_URL}logout.php`);
cy.get('#username').type(user).should('have.value', user);
cy.get('#password').type(password).should('have.value', password);
cy.get('.btn').first().click();
});
Cypress.Commands.add('resetDatabase', () => {
cy.exec('vagrant ssh -c \'cd /vagrant/core/robo; php robo.phar reset:db test; php robo.phar create:tables test; php robo.phar migrate:all test; php robo.phar execute:fixtures test\'');
cy.visit(`${config.BASE_URL}reset-db.php`);
//cy.exec('vagrant ssh -c \'cd /vagrant/core/robo; php robo.phar reset:db test; php robo.phar create:tables test; php robo.phar migrate:all test; php robo.phar execute:fixtures test\'');
});
+10 -4
View File
@@ -1,13 +1,19 @@
const BASE_URL = 'http://clients.icehrmpro.test/test/';
const BASE_URL = 'http://icehrm-testing:8090/app/';
//const BASE_URL = 'http://clients.icehrmpro.test/test/';
const DEFAULT_MAX_PAGE_SIZE = 15;
const DEFAULT_WAIT_TIME = 500;
const DEFAULT_STATUS = 200;
const DEFAULT_USER_PASS = 'demouserpwd';
const URL_PREFIX = 'test';
const URL_PREFIX = 'app';
const WAIT_ON_TIME = false;
const WAIT_TIME = 500;
module.exports = {
BASE_URL,
DEFAULT_MAX_PAGE_SIZE,
DEFAULT_WAIT_TIME,
DEFAULT_STATUS,
DEFAULT_USER_PASS,
URL_PREFIX,
WAIT_ON_TIME,
WAIT_TIME,
};
+6
View File
@@ -18,3 +18,9 @@ import './commands';
// Alternatively you can use CommonJS syntax:
// require('./commands')
Cypress.on('uncaught:exception', (err, runnable) => {
// returning false here prevents Cypress from
// failing the test
return false
});
+69 -51
View File
@@ -47,13 +47,19 @@
"lodash.once": "^4.1.1"
}
},
"@types/sizzle": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz",
"integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==",
"dev": true
},
"ajv": {
"version": "6.10.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",
"integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==",
"version": "6.12.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz",
"integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==",
"dev": true,
"requires": {
"fast-deep-equal": "^2.0.1",
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
@@ -120,9 +126,9 @@
"dev": true
},
"aws4": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz",
"integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==",
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz",
"integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==",
"dev": true
},
"balanced-match": {
@@ -328,13 +334,14 @@
}
},
"cypress": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-3.4.1.tgz",
"integrity": "sha512-1HBS7t9XXzkt6QHbwfirWYty8vzxNMawGj1yI+Fu6C3/VZJ8UtUngMW6layqwYZzLTZV8tiDpdCNBypn78V4Dg==",
"version": "3.8.3",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-3.8.3.tgz",
"integrity": "sha512-I9L/d+ilTPPA4vq3NC1OPKmw7jJIpMKNdyfR8t1EXYzYCjyqbc59migOm1YSse/VRbISLJ+QGb5k4Y3bz2lkYw==",
"dev": true,
"requires": {
"@cypress/listr-verbose-renderer": "0.4.1",
"@cypress/xvfb": "1.2.4",
"@types/sizzle": "2.3.2",
"arch": "2.1.1",
"bluebird": "3.5.0",
"cachedir": "1.3.0",
@@ -343,6 +350,7 @@
"commander": "2.15.1",
"common-tags": "1.8.0",
"debug": "3.2.6",
"eventemitter2": "4.1.2",
"execa": "0.10.0",
"executable": "4.1.1",
"extract-zip": "1.6.7",
@@ -361,6 +369,7 @@
"request-progress": "3.0.0",
"supports-color": "5.5.0",
"tmp": "0.1.0",
"untildify": "3.0.3",
"url": "0.11.0",
"yauzl": "2.10.0"
}
@@ -477,6 +486,12 @@
"object.entries": "^1.1.0"
}
},
"eventemitter2": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-4.1.2.tgz",
"integrity": "sha1-DhqEd6+CGm7zmVsxG/dMI6UkfxU=",
"dev": true
},
"execa": {
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz",
@@ -558,15 +573,15 @@
"dev": true
},
"fast-deep-equal": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
"dev": true
},
"fast-json-stable-stringify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
"dev": true
},
"fd-slicer": {
@@ -653,9 +668,9 @@
}
},
"glob": {
"version": "7.1.4",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
"integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
@@ -676,9 +691,9 @@
}
},
"graceful-fs": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz",
"integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==",
"version": "4.2.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
"dev": true
},
"har-schema": {
@@ -791,13 +806,10 @@
"dev": true
},
"is-finite": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz",
"integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=",
"dev": true,
"requires": {
"number-is-nan": "^1.0.0"
}
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz",
"integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==",
"dev": true
},
"is-fullwidth-code-point": {
"version": "1.0.0",
@@ -828,9 +840,9 @@
}
},
"is-promise": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
"integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=",
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz",
"integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==",
"dev": true
},
"is-regex": {
@@ -1109,18 +1121,18 @@
}
},
"mime-db": {
"version": "1.40.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz",
"integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==",
"version": "1.44.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
"integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==",
"dev": true
},
"mime-types": {
"version": "2.1.24",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz",
"integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
"version": "2.1.27",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
"integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
"dev": true,
"requires": {
"mime-db": "1.40.0"
"mime-db": "1.44.0"
}
},
"minimatch": {
@@ -1345,9 +1357,9 @@
"dev": true
},
"psl": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz",
"integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==",
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
"integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==",
"dev": true
},
"punycode": {
@@ -1375,9 +1387,9 @@
"dev": true
},
"readable-stream": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"dev": true,
"requires": {
"core-util-is": "~1.0.0",
@@ -1497,9 +1509,9 @@
"dev": true
},
"signal-exit": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
"dev": true
},
"slice-ansi": {
@@ -1661,6 +1673,12 @@
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
"dev": true
},
"untildify": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz",
"integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==",
"dev": true
},
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
@@ -1695,9 +1713,9 @@
"dev": true
},
"uuid": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==",
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
"dev": true
},
"verror": {
+1 -1
View File
@@ -12,7 +12,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"cypress": "^3.4.1",
"cypress": "^3.8.3",
"eslint-config-airbnb": "^18.0.1"
}
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+5
View File
@@ -0,0 +1,5 @@
import {
ClientAdapter,
} from './lib';
window.ClientAdapter = ClientAdapter;
+67
View File
@@ -0,0 +1,67 @@
/*
Copyright (c) 2018 [Glacies UG, Berlin, Germany] (http://glacies.de)
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
*/
import AdapterBase from '../../../api/AdapterBase';
/**
* ClientAdapter
*/
class ClientAdapter extends AdapterBase {
getDataMapping() {
return [
'id',
'name',
'details',
'address',
'contact_number',
];
}
getHeaders() {
return [
{ sTitle: 'ID', bVisible: false },
{ sTitle: 'Name' },
{ sTitle: 'Details' },
{ sTitle: 'Address' },
{ sTitle: 'Contact Number' },
];
}
getFormFields() {
if (this.showSave) {
return [
['id', { label: 'ID', type: 'hidden' }],
['name', { label: 'Name', type: 'text' }],
['details', { label: 'Details', type: 'textarea', validation: 'none' }],
['address', { label: 'Address', type: 'textarea', validation: 'none' }],
['contact_number', { label: 'Contact Number', type: 'text', validation: 'none' }],
['contact_email', { label: 'Contact Email', type: 'text', validation: 'none' }],
['company_url', { label: 'Company Url', type: 'text', validation: 'none' }],
['status', { label: 'Status', type: 'select', source: [['Active', 'Active'], ['Inactive', 'Inactive']] }],
['first_contact_date', { label: 'First Contact Date', type: 'date', validation: 'none' }],
];
}
return [
['id', { label: 'ID', type: 'hidden' }],
['name', { label: 'Name', type: 'placeholder' }],
['details', { label: 'Details', type: 'placeholder', validation: 'none' }],
['address', { label: 'Address', type: 'placeholder', validation: 'none' }],
['contact_number', { label: 'Contact Number', type: 'placeholder', validation: 'none' }],
['contact_email', { label: 'Contact Email', type: 'placeholder', validation: 'none' }],
['company_url', { label: 'Company Url', type: 'placeholder', validation: 'none' }],
['status', { label: 'Status', type: 'placeholder', source: [['Active', 'Active'], ['Inactive', 'Inactive']] }],
['first_contact_date', { label: 'First Contact Date', type: 'placeholder', validation: 'none' }],
];
}
getHelpLink() {
return 'http://blog.icehrm.com/docs/projects/';
}
}
module.exports = {
ClientAdapter,
};
+5 -1
View File
@@ -1213,7 +1213,11 @@ class TerminatedEmployeeAdapter extends EmployeeAdapter {
getActionButtonsHtml(id) {
// eslint-disable-next-line max-len
let html = '<div style="width:110px;"><img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;margin-left:15px;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img><img class="tableActionButton" src="_BASE_images/edit.png" style="display:none;cursor:pointer;margin-left:15px;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img><img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Archive Employee" onclick="modJs.deleteEmployee(_id_);return false;"></img><img class="tableActionButton" src="_BASE_images/redo.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Restore Employee" onclick="modJs.activateEmployee(_id_);return false;"></img></div>';
let html = `<div style="width:110px;">
<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;margin-left:15px;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>
<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Archive Employee" onclick="modJs.deleteEmployee(_id_);return false;"></img>
<img class="tableActionButton" src="_BASE_images/redo.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Restore Employee" onclick="modJs.activateEmployee(_id_);return false;"></img>
</div>`;
html = html.replace(/_id_/g, id);
html = html.replace(/_BASE_/g, this.baseUrl);
return html;
+8 -1
View File
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long