From f783163a7830614818e1bcde560ae8f5c1cfcd9a Mon Sep 17 00:00:00 2001 From: gamonoid Date: Sat, 3 Feb 2018 04:42:17 +0100 Subject: [PATCH] Applying improvements selected from IcehrmPro for release v21.0.0 --- admin/settings/index.php | 8 +++++--- api/Base.js | 3 ++- build.xml | 2 +- config.base.php | 8 ++++---- header.php | 4 +++- lib/composer/composer.json | 8 ++++---- migrations/v20171126_200303_swift_mail.php | 4 ++-- release.md | 13 +++++++++++-- src/Classes/BaseService.php | 2 +- src/Utils/CalendarTools.php | 14 +++++++++++--- src/Utils/SessionUtils.php | 2 +- 11 files changed, 45 insertions(+), 23 deletions(-) diff --git a/admin/settings/index.php b/admin/settings/index.php index 7dd667ea6..ce16c9ead 100644 --- a/admin/settings/index.php +++ b/admin/settings/index.php @@ -37,9 +37,11 @@ $moduleBuilder->addModuleOrGroup(new \Classes\ModuleBuilder\ModuleTab( 'SystemSetting','Setting','System','SettingAdapter','{"name":["System:"]}','name',false,$options1 )); -$moduleBuilder->addModuleOrGroup(new \Classes\ModuleBuilder\ModuleTab( - 'EmailSetting','Setting','Email','SettingAdapter','{"name":["Email:"]}','name',false,$options1 -)); +if (!defined('CLOUD_INSTALLATION')) { + $moduleBuilder->addModuleOrGroup(new \Classes\ModuleBuilder\ModuleTab( + 'EmailSetting', 'Setting', 'Email', 'SettingAdapter', '{"name":["Email:"]}', 'name', false, $options1 + )); +} $moduleBuilder->addModuleOrGroup(new \Classes\ModuleBuilder\ModuleTab( 'LeaveSetting','Setting','Leave / PTO','SettingAdapter','{"name":["Leave:"]}','name',false,$options1 )); diff --git a/api/Base.js b/api/Base.js index 758a32fff..5c42c4710 100644 --- a/api/Base.js +++ b/api/Base.js @@ -2461,9 +2461,10 @@ IceHRMBase.method('clearFileElement', function (elementName) { IceHRMBase.method('fixJSON', function (json) { if(this.noJSONRequests == "1"){ - json = json.replace(/"/g,'|'); + json = window.btoa(json); } return json; + }); diff --git a/build.xml b/build.xml index 8bd7b4194..873a8db0b 100644 --- a/build.xml +++ b/build.xml @@ -1,5 +1,5 @@ - + diff --git a/config.base.php b/config.base.php index 573b472da..d8e734953 100644 --- a/config.base.php +++ b/config.base.php @@ -13,10 +13,10 @@ } //Version -define('VERSION', '20.3.0.OS'); -define('CACHE_VALUE', '20.3.0.OS'); -define('VERSION_NUMBER', '2030'); -define('VERSION_DATE', '26/11/2017'); +define('VERSION', '21.0.0.PRO'); +define('CACHE_VALUE', '21.0.0.OS'); +define('VERSION_NUMBER', '2100'); +define('VERSION_DATE', '02/02/2018'); if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','icehrm@gamonoid.com');} if(!defined('KEY_PREFIX')){define('KEY_PREFIX','IceHrm');} diff --git a/header.php b/header.php index 1d2fc7a4a..3e49c3a3c 100644 --- a/header.php +++ b/header.php @@ -20,7 +20,9 @@ Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd] Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah) */ - +if (!defined('MODULE_NAME')) { + define('MODULE_NAME', $moduleName); +} include 'includes.inc.php'; if(empty($user)){ $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; diff --git a/lib/composer/composer.json b/lib/composer/composer.json index 54a013475..8785efb3f 100644 --- a/lib/composer/composer.json +++ b/lib/composer/composer.json @@ -5,12 +5,12 @@ "gettext/gettext": "4.0.0", "consolidation/robo": "~1", "filp/whoops": "~2.1", - "swiftmailer/swiftmailer": "^6", - "pear/net_smtp": "~1.7", - "pear/mail": "~1.4" + "swiftmailer/swiftmailer": "^6.0", + "pear/net_smtp": "^1.7", + "pear/mail": "^1.4" }, "require-dev": { - "phpunit/phpunit": "~6.5.5" + "phpunit/phpunit": "~6" }, "autoload": { "psr-4": { diff --git a/migrations/v20171126_200303_swift_mail.php b/migrations/v20171126_200303_swift_mail.php index 5da79c3c7..3157c0d35 100644 --- a/migrations/v20171126_200303_swift_mail.php +++ b/migrations/v20171126_200303_swift_mail.php @@ -10,11 +10,11 @@ public function up(){ $setting = new Setting(); $setting->Load("name = ?", array('Email: Mode')); if(!empty($setting->id)){ - $setting->description = 'Require submitting a photo using web cam when marking attendance'; + $setting->description = 'Update email sender'; $setting->meta = '["value", {"label":"Value","type":"select","source":[["SMTP","SMTP"],["Swift SMTP","Swift SMTP"],["PHP Mailer","PHP Mailer"],["SES","Amazon SES"]]}]'; $setting->Save(); } - + return true; } diff --git a/release.md b/release.md index 70df2eb71..d0e1134fc 100644 --- a/release.md +++ b/release.md @@ -1,5 +1,14 @@ -Release note v20.3.0.OS ------------------------ +Release note v21.0.0.OS +------------------------ +### Features + * Fully compatible with php 7.1 + * Add Net_SMTP via composer (no pear installation needed) + +### Fixes + * Fixes for web servers not supporting JSON in GET request + +Release note v20.3.0.PRO +------------------------ ### Features * Employee and Attendance REST Api Released * Import/Export for Payroll Configurations diff --git a/src/Classes/BaseService.php b/src/Classes/BaseService.php index c3afc669d..ac6169f0c 100644 --- a/src/Classes/BaseService.php +++ b/src/Classes/BaseService.php @@ -1407,7 +1407,7 @@ public function fixJSON($json) { $noJSONRequests = SettingsManager::getInstance()->getSetting("System: Do not pass JSON in request"); if ($noJSONRequests."" == "1") { - $json = str_replace("|", '"', $json); + $json = base64_decode($json); } return $json; } diff --git a/src/Utils/CalendarTools.php b/src/Utils/CalendarTools.php index 344967aad..2d3667aaf 100644 --- a/src/Utils/CalendarTools.php +++ b/src/Utils/CalendarTools.php @@ -49,11 +49,19 @@ public static function getDaysBetweenDates($start, $end) return $days; } - public static function addMinutesToDateTime($datetime, $minutes) + public static function addMinutesToDateTime($datetime, $minutes, $format = 'Y-m-d H:i:s') { $time = new \DateTime($datetime); - $time->add(new \DateInterval('PT' . $minutes . 'M')); + $time = $time->add(new \DateInterval('PT' . $minutes . 'M')); - return $time->format('Y-m-d H:i:s'); + return $time->format($format); + } + + public static function addMonthsToDateTime($datetime, $months, $format = 'Y-m-d H:i:s') + { + $time = new \DateTime($datetime); + $time = $time->add(new \DateInterval('P' . $months . 'M')); + + return $time->format($format); } } diff --git a/src/Utils/SessionUtils.php b/src/Utils/SessionUtils.php index d6f19d51d..a4889e10c 100644 --- a/src/Utils/SessionUtils.php +++ b/src/Utils/SessionUtils.php @@ -23,7 +23,7 @@ public static function saveSessionObject($name, $obj) session_write_close(); } - public function unsetClientSession() + public static function unsetClientSession() { $names = [ "user",