Fix for mysql 5.7 strict date issue
This commit is contained in:
@@ -26,19 +26,24 @@ define('MODULE_PATH',dirname(__FILE__));
|
|||||||
include APP_BASE_PATH.'header.php';
|
include APP_BASE_PATH.'header.php';
|
||||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||||
|
|
||||||
$billingActionManager = new \Billing\Admin\Api\BillingActionManager();
|
$invoices = [];
|
||||||
|
|
||||||
$invoices = $billingActionManager->getInvoices(null)->getData();
|
|
||||||
if(!empty($invoices)){
|
|
||||||
$invoices = json_decode(json_encode($invoices));
|
|
||||||
}
|
|
||||||
$numOfUnpaidInvoices = 0;
|
$numOfUnpaidInvoices = 0;
|
||||||
foreach($invoices as $inv){
|
if (class_exists('\\Billing\\Admin\\Api\\BillingActionManager')) {
|
||||||
if($inv->status == "Sent"){
|
$billingActionManager = new \Billing\Admin\Api\BillingActionManager();
|
||||||
$numOfUnpaidInvoices++;
|
|
||||||
|
$invoices = $billingActionManager->getInvoices(null)->getData();
|
||||||
|
if(!empty($invoices)){
|
||||||
|
$invoices = json_decode(json_encode($invoices));
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($invoices as $inv){
|
||||||
|
if($inv->status == "Sent"){
|
||||||
|
$numOfUnpaidInvoices++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?><div class="span9">
|
?><div class="span9">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<?php if($numOfUnpaidInvoices == 1){?>
|
<?php if($numOfUnpaidInvoices == 1){?>
|
||||||
@@ -116,26 +121,5 @@ modJsList['tabDashboard'] = new DashboardAdapter('Dashboard','Dashboard');
|
|||||||
|
|
||||||
var modJs = modJsList['tabDashboard'];
|
var modJs = modJsList['tabDashboard'];
|
||||||
|
|
||||||
/*
|
|
||||||
$("#employeeLink").attr("href",modJs.getCustomUrl('?g=admin&n=employees&m=admin_Admin'));
|
|
||||||
$("#companyLink").attr("href",modJs.getCustomUrl('?g=admin&n=company_structure&m=admin_Admin'));
|
|
||||||
$("#usersLink").attr("href",modJs.getCustomUrl('?g=admin&n=users&m=admin_System'));
|
|
||||||
$("#projectsLink").attr("href",modJs.getCustomUrl('?g=admin&n=projects&m=admin_Admin'));
|
|
||||||
$("#attendanceLink").attr("href",modJs.getCustomUrl('?g=admin&n=attendance&m=admin_Admin'));
|
|
||||||
$("#leaveLink").attr("href",modJs.getCustomUrl('?g=admin&n=leaves&m=admin_Admin'));
|
|
||||||
$("#reportsLink").attr("href",modJs.getCustomUrl('?g=admin&n=reports&m=admin_Reports'));
|
|
||||||
$("#settingsLink").attr("href",modJs.getCustomUrl('?g=admin&n=settings&m=admin_System'));
|
|
||||||
$("#jobsLink").attr("href",modJs.getCustomUrl('?g=admin&n=jobpositions&m=admin_Recruitment'));
|
|
||||||
$("#candidatesLink").attr("href",modJs.getCustomUrl('?g=admin&n=candidates&m=admin_Recruitment'));
|
|
||||||
$("#trainingLink").attr("href",modJs.getCustomUrl('?g=admin&n=training&m=admin_Admin'));
|
|
||||||
$("#travelLink").attr("href",modJs.getCustomUrl('?g=admin&n=travel&m=admin_Employees'));
|
|
||||||
$("#documentLink").attr("href",modJs.getCustomUrl('?g=admin&n=documents&m=admin_Employees'));
|
|
||||||
$("#expenseLink").attr("href",modJs.getCustomUrl('?g=admin&n=expenses&m=admin_Employees'));
|
|
||||||
$("#permissionLink").attr("href",modJs.getCustomUrl('?g=admin&n=permissions&m=admin_System'));
|
|
||||||
$("#upgradeLink").attr("href",modJs.getCustomUrl('?g=admin&n=billing&m=admin_System'));
|
|
||||||
|
|
||||||
modJs.getInitData();
|
|
||||||
*/
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<?php include APP_BASE_PATH.'footer.php';?>
|
<?php include APP_BASE_PATH.'footer.php';?>
|
||||||
|
|||||||
13
api/Base.js
13
api/Base.js
@@ -1003,6 +1003,7 @@ IceHRMBase.method('save', function(callGetFunction, successCallback) {
|
|||||||
if(id != null && id != undefined && id != ""){
|
if(id != null && id != undefined && id != ""){
|
||||||
$(params).attr('id',id);
|
$(params).attr('id',id);
|
||||||
}
|
}
|
||||||
|
params = this.makeEmptyDateFieldsNull(params);
|
||||||
this.add(params,[],callGetFunction, successCallback);
|
this.add(params,[],callGetFunction, successCallback);
|
||||||
}else{
|
}else{
|
||||||
$("#"+this.getTableName()+'Form .label').html(msg);
|
$("#"+this.getTableName()+'Form .label').html(msg);
|
||||||
@@ -1012,6 +1013,18 @@ IceHRMBase.method('save', function(callGetFunction, successCallback) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
IceHRMBase.method('makeEmptyDateFieldsNull', function(params) {
|
||||||
|
var fields = this.getFormFields();
|
||||||
|
fields.forEach(function(field) {
|
||||||
|
if((field[1].type == 'date' || field[1].type == 'datetime')
|
||||||
|
&& (params[field[0]] === '' || params[field[0]] === '0000-00-00' || params[field[0]] === '0000-00-00 00:00:00')){
|
||||||
|
delete params[field[0]];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return params;
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override this method to inject attitional parameters or modify existing parameters retrived from add/edit form before sending to the server
|
* Override this method to inject attitional parameters or modify existing parameters retrived from add/edit form before sending to the server
|
||||||
* @method forceInjectValuesBeforeSave
|
* @method forceInjectValuesBeforeSave
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ ini_set('display_errors', false);
|
|||||||
error_reporting(E_ERROR);
|
error_reporting(E_ERROR);
|
||||||
require dirname(__FILE__).'/lib/composer/vendor/autoload.php';
|
require dirname(__FILE__).'/lib/composer/vendor/autoload.php';
|
||||||
|
|
||||||
$whoops = new \Whoops\Run;
|
//$whoops = new \Whoops\Run;
|
||||||
$whoops->pushHandler(new \Whoops\Handler\PlainTextHandler);
|
//$whoops->pushHandler(new \Whoops\Handler\PlainTextHandler);
|
||||||
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
|
//$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
|
||||||
$whoops->register();
|
//$whoops->register();
|
||||||
|
|
||||||
function t($text)
|
function t($text)
|
||||||
{
|
{
|
||||||
@@ -18,9 +18,9 @@ $jsVersion = defined('CACHE_VALUE')?CACHE_VALUE:"v".VERSION;
|
|||||||
$cssVersion = defined('CACHE_VALUE')?CACHE_VALUE:"v".VERSION;
|
$cssVersion = defined('CACHE_VALUE')?CACHE_VALUE:"v".VERSION;
|
||||||
|
|
||||||
if(!isset($_REQUEST['content']) || $_REQUEST['content'] != 'HTML'){
|
if(!isset($_REQUEST['content']) || $_REQUEST['content'] != 'HTML'){
|
||||||
$_REQUEST = \Utils\InputCleaner::cleanParameters($_REQUEST);
|
$_REQUEST = \Utils\InputCleaner::cleanParameters($_REQUEST);
|
||||||
$_GET = \Utils\InputCleaner::cleanParameters($_GET);
|
$_GET = \Utils\InputCleaner::cleanParameters($_GET);
|
||||||
$_POST = \Utils\InputCleaner::cleanParameters($_POST);
|
$_POST = \Utils\InputCleaner::cleanParameters($_POST);
|
||||||
}
|
}
|
||||||
|
|
||||||
date_default_timezone_set('Asia/Colombo');
|
date_default_timezone_set('Asia/Colombo');
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class Employee extends BaseModel
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($obj->$k) && ($oldObjOrig->$k = '0000-00-00' || empty($oldObjOrig->$k))) {
|
if (empty($obj->$k) && $oldObjOrig->$k == '0000-00-00') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user