Compare commits

..

9 Commits

Author SHA1 Message Date
Kusal Kalhara
190984a560 add custom data to table 2019-09-05 15:49:02 +05:30
Thilina Hasantha
91bb1d2d8a Add ant to travis ci 2019-08-30 03:18:38 +02:00
Thilina Hasantha
526ee66e2d Fix travis CI build 2019-08-30 03:17:35 +02:00
Thilina Hasantha
0d92c820f7 Fix travis CI build 2019-08-30 03:12:53 +02:00
Thilina Hasantha
15a45150cb Update mysql version for travis 2019-08-30 03:09:48 +02:00
Thilina Hasantha
984b0fac5c Fix npm module vulnerabilities 2019-08-29 08:26:43 +02:00
Thilina Hasantha
08a52d216c Automate vagrant setup 2019-08-29 08:07:57 +02:00
Thilina Hasantha
61abe71314 Add more php versions 2019-07-28 10:27:10 +02:00
Thilina Hasantha
cae28f03a5 Fix code style issues 2019-07-28 10:23:45 +02:00
13 changed files with 2073 additions and 2764 deletions

BIN
.swp Normal file

Binary file not shown.

View File

@@ -1,7 +1,11 @@
services: services:
- mysql - mysql
addons:
apt:
packages:
- ant
before_script: before_script:
- echo "USE mysql;\nUPDATE user SET password=PASSWORD('dev') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root - echo "USE mysql;\nUPDATE user SET authentication_string=PASSWORD('dev') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root
install: install:
#- rm $TRAVIS_BUILD_DIR/tools/phpunit #- rm $TRAVIS_BUILD_DIR/tools/phpunit
#- composer require --dev phpunit/phpunit ~6.5.5 #- composer require --dev phpunit/phpunit ~6.5.5
@@ -10,6 +14,8 @@ install:
script: ant build-ci script: ant build-ci
language: php language: php
php: php:
- '5.6'
- '7.0' - '7.0'
- '7.1' - '7.1'
- '7.2'
after_failure: "cat /tmp/icehrm.test.log" after_failure: "cat /tmp/icehrm.test.log"

8
Vagrantfile vendored
View File

@@ -15,14 +15,12 @@ Vagrant.configure(2) do |config|
config.vm.provision "shell", inline: <<-SHELL config.vm.provision "shell", inline: <<-SHELL
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA8E81B4331F7F50
sudo apt-get update sudo apt-get update
chmod ugo+x /vagrant/deployment/vagrant/runonce.sh
sh /vagrant/deployment/vagrant/runonce.sh
SHELL SHELL
config.vm.hostname = "icehrm.open" config.vm.hostname = "icehrm.open"
config.hostsupdater.aliases = [
"app.icehrm-open.test",
"clients.icehrm-open.test"
]
end end

View File

@@ -90,9 +90,9 @@ class AttendanceRestEndPoint extends RestEndPoint
} }
if ($user->user_level !== 'Admin' && !PermissionManager::manipulationAllowed( if ($user->user_level !== 'Admin' && !PermissionManager::manipulationAllowed(
BaseService::getInstance()->getCurrentProfileId(), BaseService::getInstance()->getCurrentProfileId(),
$this->getModelObject($parameter) $this->getModelObject($parameter)
) )
) { ) {
return new IceResponse(IceResponse::ERROR, self::RESPONSE_ERR_PERMISSION_DENIED, 403); return new IceResponse(IceResponse::ERROR, self::RESPONSE_ERR_PERMISSION_DENIED, 403);
} }
@@ -277,8 +277,16 @@ class AttendanceRestEndPoint extends RestEndPoint
} }
} }
protected function savePunch($employeeId, $inDateTime, $note = null, $outDateTime = null, $id = null, $latitude = null, $longitude = null, $ip = null) protected function savePunch(
{ $employeeId,
$inDateTime,
$note = null,
$outDateTime = null,
$id = null,
$latitude = null,
$longitude = null,
$ip = null
) {
$employee = BaseService::getInstance()->getElement( $employee = BaseService::getInstance()->getElement(
'Employee', 'Employee',
$employeeId, $employeeId,
@@ -399,6 +407,5 @@ class AttendanceRestEndPoint extends RestEndPoint
} }
return null; return null;
} }
} }

View File

@@ -35,25 +35,27 @@ class Timezone extends BaseModel
$modifiedTimeZones[] = $tz; $modifiedTimeZones[] = $tz;
} catch (\Exception $e) { } catch (\Exception $e) {
} }
} }
usort($modifiedTimeZones, function ($a, $b) { return strcmp($a->details, $b->details); }); usort($modifiedTimeZones, function ($a, $b) {
return strcmp($a->details, $b->details);
});
return $modifiedTimeZones; return $modifiedTimeZones;
} }
public function formatOffset($offset) { public function formatOffset($offset)
{
$hours = $offset / 3600; $hours = $offset / 3600;
$remainder = $offset % 3600; $remainder = $offset % 3600;
$sign = $hours > 0 ? '+' : '-'; $sign = $hours > 0 ? '+' : '-';
$hour = (int) abs($hours); $hour = (int) abs($hours);
$minutes = (int) abs($remainder / 60); $minutes = (int) abs($remainder / 60);
if ($hour == 0 AND $minutes == 0) { if ($hour == 0 and $minutes == 0) {
$sign = ' '; $sign = ' ';
} }
return 'GMT' . $sign . str_pad($hour, 2, '0', STR_PAD_LEFT) return 'GMT' . $sign . str_pad($hour, 2, '0', STR_PAD_LEFT)
.':'. str_pad($minutes,2, '0'); .':'. str_pad($minutes, 2, '0');
} }
public function fieldValueMethods() public function fieldValueMethods()

View File

@@ -35,7 +35,16 @@ abstract class AbstractDataImporter implements DataImporter
public function processHeader($data) public function processHeader($data)
{ {
$columns = $this->dataImport->columns; $columns = $this->dataImport->columns;
$headers = json_decode($columns);
$headers = json_decode($columns);
while(sizeof($headers)!=sizeof($data)){
$name = $data[sizeof($headers)];
$test = (object)["name" => $name, "title" => "", "type" => "Normal", "dependOn" => "NULL", "dependOnField" => "", "isKeyField" => "No", "idField" => "No", "id" => "columns_36"];
array_push($headers, $test);
}
LogManager::getInstance()->info("test --------------");
$counter = 0; $counter = 0;
foreach ($headers as $column) { foreach ($headers as $column) {
@@ -69,6 +78,7 @@ abstract class AbstractDataImporter implements DataImporter
{ {
$this->dataImport = new DataImport(); $this->dataImport = new DataImport();
$this->dataImport->Load("id =?", array($dataImportId)); $this->dataImport->Load("id =?", array($dataImportId));
} }
public function updateCustomFields() public function updateCustomFields()

View File

@@ -3,7 +3,6 @@
namespace Settings\Rest; namespace Settings\Rest;
use Classes\IceResponse; use Classes\IceResponse;
use Classes\RestEndPoint; use Classes\RestEndPoint;
use Classes\SettingsManager; use Classes\SettingsManager;

View File

@@ -7,20 +7,21 @@ class NetworkUtils
public static function getClientIp() public static function getClientIp()
{ {
$ipaddress = ''; $ipaddress = '';
if (isset($_SERVER['HTTP_CLIENT_IP'])) if (isset($_SERVER['HTTP_CLIENT_IP'])) {
$ipaddress = $_SERVER['HTTP_CLIENT_IP']; $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
else if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
else if(isset($_SERVER['HTTP_X_FORWARDED'])) } elseif (isset($_SERVER['HTTP_X_FORWARDED'])) {
$ipaddress = $_SERVER['HTTP_X_FORWARDED']; $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
else if(isset($_SERVER['HTTP_FORWARDED_FOR'])) } elseif (isset($_SERVER['HTTP_FORWARDED_FOR'])) {
$ipaddress = $_SERVER['HTTP_FORWARDED_FOR']; $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
else if(isset($_SERVER['HTTP_FORWARDED'])) } elseif (isset($_SERVER['HTTP_FORWARDED'])) {
$ipaddress = $_SERVER['HTTP_FORWARDED']; $ipaddress = $_SERVER['HTTP_FORWARDED'];
else if(isset($_SERVER['REMOTE_ADDR'])) } elseif (isset($_SERVER['REMOTE_ADDR'])) {
$ipaddress = $_SERVER['REMOTE_ADDR']; $ipaddress = $_SERVER['REMOTE_ADDR'];
else } else {
$ipaddress = 'UNKNOWN'; $ipaddress = 'UNKNOWN';
}
return $ipaddress; return $ipaddress;
} }
} }

26
deployment/vagrant/runonce.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
if [ ! -f ~/runonce ]
then
sudo apt-get install ant
sudo chmod -R 777 /var/log/nginx
cd /vagrant
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install
sudo npm install -g gulp-cli
sudo sed 's/server_name clients.app.dev/server_name clients.icehrm-open.test/g' /etc/nginx/sites-available/clients.app.com > /tmp/clients.app.com
sudo mv /tmp/clients.app.com /etc/nginx/sites-available/clients.app.com
sudo sed 's/server_name app.app.dev/server_name app.icehrm-open.test/g' /etc/nginx/sites-available/app.app.com > /tmp/app.app.com
sudo sed 's#root /vagrant/build/app#root /vagrant#g' /tmp/app.app.com > /tmp/mod.app.app.com
sudo mv /tmp/mod.app.app.com /etc/nginx/sites-available/app.app.com
sudo sed 's#xdebug.remote_host=192.168.30.1#xdebug.remote_host=192.168.40.1#g' /etc/php/7.0/fpm/conf.d/90-app.ini > /tmp/mod.90-app.ini
sudo mv /tmp/mod.90-app.ini /etc/php/7.0/fpm/conf.d/90-app.ini
sudo service php7.0-fpm restart
sudo service nginx restart
touch ~/runonce
fi

4677
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "icehrm", "name": "icehrm",
"version": "25.0.0", "version": "1.0.0",
"description": "IceHrm is a human resource management system", "description": "IceHrm is a human resource management system",
"main": "gulpfile.js", "main": "gulpfile.js",
"directories": { "directories": {
@@ -35,7 +35,7 @@
"d3": "^5.9.1", "d3": "^5.9.1",
"event-stream": "^4.0.1", "event-stream": "^4.0.1",
"gulp-concat": "^2.6.1", "gulp-concat": "^2.6.1",
"gulp-copy": "^1.1.0", "gulp-copy": "^4.0.1",
"gulp-rename": "^1.4.0", "gulp-rename": "^1.4.0",
"qrcode": "^1.3.3" "qrcode": "^1.3.3"
} }

View File

@@ -70,9 +70,6 @@ Preparing development VM with Vagrant
- Install Vagrant [https://www.vagrantup.com/downloads.html](https://www.vagrantup.com/downloads.html) - Install Vagrant [https://www.vagrantup.com/downloads.html](https://www.vagrantup.com/downloads.html)
- Install Vagrant host updater plugin [https://github.com/cogitatio/vagrant-hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater)
- Run vagrant up in icehrm root directory (this will download icehrm vagrant image which is ~1 GB) - Run vagrant up in icehrm root directory (this will download icehrm vagrant image which is ~1 GB)
``` ```
@@ -85,55 +82,23 @@ Preparing development VM with Vagrant
~ $ vagrant ssh ~ $ vagrant ssh
``` ```
- Setup the Vagrant box - 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)
``` ```
~ $ sudo apt-get install ant 192.168.40.40 app.icehrm-open.test
~ $ sudo chmod -R 777 /var/log/nginx 192.168.40.40 clients.icehrm-open.test
~ $ cd /vagrant
~ $ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
~ $ sudo apt-get install -y nodejs
~ $ npm install
~ $ sudo npm install -g gulp-cli
```
- Make Changes to enable domain icehrm-open.test in Vagrant Box
```
~ $ sudo sed 's/server_name clients.app.dev/server_name clients.icehrm-open.test/g' /etc/nginx/sites-available/clients.app.com > /tmp/clients.app.com
~ $ sudo mv /tmp/clients.app.com /etc/nginx/sites-available/clients.app.com
~ $ sudo sed 's/server_name app.app.dev/server_name app.icehrm-open.test/g' /etc/nginx/sites-available/app.app.com > /tmp/app.app.com
~ $ sudo sed 's#root /vagrant/build/app#root /vagrant#g' /tmp/app.app.com > /tmp/mod.app.app.com
~ $ sudo mv /tmp/mod.app.app.com /etc/nginx/sites-available/app.app.com
~ $ sudo service php7.0-fpm restart
~ $ sudo service nginx restart
```
- Build Icehrm (your icehrm root directory is mapped to /vagrant/ directory in VM)
```
~ $ gulp
~ $ ant buildlocal
``` ```
- Navigate to [http://clients.icehrm-open.test/dev](http://clients.icehrm-open.test/dev) to load icehrm from VM. (user:admin/pass:admin) - 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 ### Notes to Developers
- When ever you have done a change to JavaScript or CSS files in icehrm/web - When ever you have done a change to JavaScript or CSS files in icehrm/web rebuild the frontend
``` ```
~ $ cd /vagrant ~ $ cd /vagrant
~ $ gulp ~ $ gulp
``` ```
- When ever you have done a change to icehrm/core/src
```
~ $ cd /vagrant
~ $ ant phpcs-ci
```

View File

@@ -2,15 +2,21 @@ Release note v26.6.0.OS
------------------------ ------------------------
### Features ### Features
* Improvements to UI * Some Improvements to UI such as updating Icons and upgrading font-awesome to its latest version
* Track IP and location of the employee when marking attendance * Tracking IP and location of the employee when marking attendance, this is done when updating attendance via mobile
* Ability to control location tracking via mobile using server side settings
* Improvements to translations * Improvements to translations
* Compatible with location tracking with icehrm mobile app * Compatible with location tracking with icehrm mobile app
### Mobile App
* This release is coupled with mobile application release on AppStore (https://apple.co/2Yrtxoy) and Google Play (http://bit.ly/2OkMmKe)
### Fixes ### Fixes
* Order projects by name on timesheets * Order projects by name on Timesheet project listing (This is to make it easier to edit timesheets with many projects)
* Link home page user profile to employee profile update page * Link home page user profile to employee profile update page
* Fix issues related to configuring Api with mobile app * Fix issues related to configuring Api with mobile app
### Security Improvements
* Upgrade npm missing dependencies * Upgrade npm missing dependencies