- You have a pending invoice. Please make you complete the payment so we can provide a better service.
-
-
- Make a Payment
-
+
+
+
+
You have a pending invoice
+
+ You have a pending invoice. Please make you complete the payment so we can provide a better service.
+
+
+ Make a Payment
+
+
+ 1){?>
+
+
You have =$numOfUnpaidInvoices?> pending invoices
+
+ You have =$numOfUnpaidInvoices?> pending invoice. None of your employees are currently allowed to login. Please make sure you complete payments to all the invoices to restore your service.
+ Please logout and login after completing the payment to get your service restored.
+
+
+ Make a Payment
+
+
+
+
+
+
+
Your Trial Has Expired
+
+ Your Icehrm Trial has expired. Please upgrade subscription to continue. If not upgraded your account will be deleted with in few days.
+
+
+ Upgrade Subscription
+
- You have =$numOfUnpaidInvoices?> pending invoice. None of your employees are currently allowed to login. Please make sure you complete payments to all the invoices to restore your service.
- Please logout and login after completing the payment to get your service restored.
-
-
- Make a Payment
-
-
-
-
-
-
-
Your Trial Has Expired
-
- Your Icehrm Trial has expired. Please upgrade subscription to continue. If not upgraded your account will be deleted with in few days.
-
-
- Upgrade Subscription
-
',
+ "validation":"none"
+ }],
+ [ "display_order", {"label":"Priority","type":"text","validation":"number"}],
+ [ "display_section", {"label":"Display Section","type":"text","validation":""}]
];
});
diff --git a/admin/loans/meta.json b/admin/loans/meta.json
index abe4aa75..1ba48748 100644
--- a/admin/loans/meta.json
+++ b/admin/loans/meta.json
@@ -1,7 +1,7 @@
{
"label": "Company Loans",
"menu": "Admin",
- "order": "81",
+ "order": "89",
"icon": "fa-shield",
"user_levels": [
"Admin"
@@ -9,4 +9,4 @@
"permissions": [],
"model_namespace": "\\Loans\\Common\\Model",
"manager": "\\Loans\\Admin\\Api\\LoansAdminManager"
-}
\ No newline at end of file
+}
diff --git a/admin/overtime/meta.json b/admin/overtime/meta.json
index 0e506cf6..36f58106 100644
--- a/admin/overtime/meta.json
+++ b/admin/overtime/meta.json
@@ -1,7 +1,7 @@
{
"label": "Overtime Administration",
- "menu": "Employees",
- "order": "94",
+ "menu": "Admin",
+ "order": "82",
"icon": "fa-align-center",
"user_levels": [
"Admin",
@@ -11,4 +11,4 @@
"permissions": [],
"model_namespace": "\\Overtime\\Common\\Model",
"manager": "\\Overtime\\Admin\\Api\\OvertimeAdminManager"
-}
\ No newline at end of file
+}
diff --git a/admin/travel/meta.json b/admin/travel/meta.json
index c9fe6f19..529b0fe3 100644
--- a/admin/travel/meta.json
+++ b/admin/travel/meta.json
@@ -1,5 +1,5 @@
{
- "label": "Travel Administration",
+ "label": "Travel Requests",
"menu": "Employees",
"order": "6",
"icon": "fa-plane",
@@ -11,4 +11,4 @@
"permissions": [],
"model_namespace": "\\Travel\\Common\\Model",
"manager": "\\Travel\\Admin\\Api\\TravelAdminManager"
-}
\ No newline at end of file
+}
diff --git a/api/Base.js b/api/Base.js
index 71c848b2..59dc103f 100644
--- a/api/Base.js
+++ b/api/Base.js
@@ -1,23 +1,23 @@
/*
-This file is part of Ice Framework.
+ This file is part of Ice Framework.
-Ice Framework is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+ Ice Framework is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
-Ice Framework is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ Ice Framework is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with Ice Framework. If not, see .
+ You should have received a copy of the GNU General Public License
+ along with Ice Framework. If not, see .
-------------------------------------------------------------------
+ ------------------------------------------------------------------
-Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
-Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+ Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
*/
@@ -624,12 +624,12 @@ IceHRMBase.method('createTable', function(elementId) {
var html = "";
html = this.getTableTopButtonHtml() + this.getTableHTMLTemplate();
/*
- if(this.getShowAddNew()){
- html = this.getTableTopButtonHtml()+'
+
+
diff --git a/include.common.php b/include.common.php
index df61b791..afeb20a5 100644
--- a/include.common.php
+++ b/include.common.php
@@ -18,9 +18,9 @@ $jsVersion = defined('CACHE_VALUE')?CACHE_VALUE:"v".VERSION;
$cssVersion = defined('CACHE_VALUE')?CACHE_VALUE:"v".VERSION;
if(!isset($_REQUEST['content']) || $_REQUEST['content'] != 'HTML'){
- $_REQUEST = \Utils\InputCleaner::cleanParameters($_REQUEST);
- $_GET = \Utils\InputCleaner::cleanParameters($_GET);
- $_POST = \Utils\InputCleaner::cleanParameters($_POST);
+ $_REQUEST = \Utils\InputCleaner::cleanParameters($_REQUEST);
+ $_GET = \Utils\InputCleaner::cleanParameters($_GET);
+ $_POST = \Utils\InputCleaner::cleanParameters($_POST);
}
date_default_timezone_set('Asia/Colombo');
diff --git a/migrations/list.php b/migrations/list.php
index 9fca10ab..d4fedfdb 100644
--- a/migrations/list.php
+++ b/migrations/list.php
@@ -1,5 +1,8 @@
executeQuery($sql);
+ }
+
+ public function down(){
+ $sql = <<<'SQL'
+ alter table LeaveRules drop column `exp_days`;
+SQL;
+
+ return $this->executeQuery($sql);
+ }
+
+}
+{
+
+}
diff --git a/migrations/v20180325_210101_delete_leave_group_employee.php b/migrations/v20180325_210101_delete_leave_group_employee.php
new file mode 100644
index 00000000..4f1a9cb7
--- /dev/null
+++ b/migrations/v20180325_210101_delete_leave_group_employee.php
@@ -0,0 +1,31 @@
+executeQuery($sql);
+
+ $sql = <<<'SQL'
+ alter table LeaveGroupEmployees drop index `LeaveGroupEmployees_employee`;
+SQL;
+ $this->executeQuery($sql);
+
+ $sql = <<<'SQL'
+ alter table LeaveGroupEmployees add CONSTRAINT `Fk_LeaveGroupEmployees_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
+SQL;
+ return $this->executeQuery($sql);
+ }
+
+ public function down(){
+ $sql = <<<'SQL'
+ alter table LeaveGroupEmployees add UNIQUE KEY `LeaveGroupEmployees_employee` (`employee`);
+SQL;
+ return $this->executeQuery($sql);
+ }
+
+}
diff --git a/migrations/v20180417_210501_update_menu_names.php b/migrations/v20180417_210501_update_menu_names.php
new file mode 100644
index 00000000..1d4850e4
--- /dev/null
+++ b/migrations/v20180417_210501_update_menu_names.php
@@ -0,0 +1,19 @@
+executeQuery($sql);
+ }
+
+ public function down(){
+
+ return true;
+ }
+
+}
diff --git a/src/Classes/Approval/ApproveAdminActionManager.php b/src/Classes/Approval/ApproveAdminActionManager.php
index 4e2c660b..4efcf937 100644
--- a/src/Classes/Approval/ApproveAdminActionManager.php
+++ b/src/Classes/Approval/ApproveAdminActionManager.php
@@ -34,9 +34,9 @@ abstract class ApproveAdminActionManager extends ApproveCommonActionManager
}
/*
- if($this->user->user_level != 'Admin' && $this->user->user_level != 'Manager'){
- return new IceResponse(IceResponse::ERROR,"Only an admin or manager can do this");
- }*/
+ if($this->user->user_level != 'Admin' && $this->user->user_level != 'Manager'){
+ return new IceResponse(IceResponse::ERROR,"Only an admin or manager can do this");
+ }*/
//Check if this needs to be multi-approved
$apStatus = 0;
diff --git a/src/Classes/BaseService.php b/src/Classes/BaseService.php
index ac6169f0..7779d9cc 100644
--- a/src/Classes/BaseService.php
+++ b/src/Classes/BaseService.php
@@ -799,6 +799,7 @@ class BaseService
$ele = new $nsTable();
$ele->Load('id = ?', array($id));
+
if (empty($ele->id) || $ele->id !== $id) {
return new IceResponse(
IceResponse::ERROR,
@@ -806,6 +807,10 @@ class BaseService
);
}
+ $preDeleteResponse = $ele->executePreDeleteActions($ele);
+ if ($preDeleteResponse->getStatus() !== IceResponse::SUCCESS) {
+ return $preDeleteResponse;
+ }
$this->checkSecureAccess("delete", $ele);
@@ -1029,7 +1034,6 @@ class BaseService
public function setCurrentAdminProfile($profileId)
{
-
if ($profileId == "-1") {
SessionUtils::saveSessionObject('admin_current_profile', null);
return;
@@ -1037,25 +1041,12 @@ class BaseService
if ($this->currentUser->user_level == 'Admin') {
SessionUtils::saveSessionObject('admin_current_profile', $profileId);
- } elseif ($this->currentUser->user_level == 'Manager') {
- $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- $signInMappingFieldTable = ucfirst($signInMappingField);
- $subordinate = new $signInMappingFieldTable();
- $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
- $subordinates = $subordinate->Find("supervisor = ?", array($this->currentUser->$signInMappingField));
- $subFound = false;
- foreach ($subordinates as $sub) {
- if ($sub->id == $profileId) {
- $subFound = true;
- break;
- }
- }
-
- if (!$subFound) {
- return;
- }
-
+ } elseif ($this->currentUser->user_level == 'Manager'
+ && $this->canManageEmployee($profileId)
+ ) {
SessionUtils::saveSessionObject('admin_current_profile', $profileId);
+ } else {
+ SessionUtils::saveSessionObject('admin_current_profile', null);
}
}
@@ -1595,4 +1586,63 @@ END;
}
return '\\Model\\'.$class;
}
+
+ /**
+ * @param $profileId
+ * @return bool
+ */
+ protected function canManageEmployee($profileId)
+ {
+ $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
+ $signInMappingFieldTable = $this->getFullQualifiedModelClassName(ucfirst($signInMappingField));
+ $subordinate = new $signInMappingFieldTable();
+
+ $subordinates = $subordinate->Find("supervisor = ?", array($this->currentUser->$signInMappingField));
+ $subFound = false;
+ foreach ($subordinates as $sub) {
+ if ($sub->id == $profileId) {
+ $subFound = true;
+ break;
+ }
+ }
+
+ $departmentHeadFound = false;
+ $subordinate = new $signInMappingFieldTable();
+ $subordinate->Load('id = ?', array($profileId));
+ if (SettingsManager::getInstance()->getSetting('System: Company Structure Managers Enabled') == 1
+ && CompanyStructure::isHeadOfCompanyStructure(
+ $subordinate->department,
+ $this->currentUser->$signInMappingField
+ )
+ ) {
+ $departmentHeadFound = true;
+ } elseif (SettingsManager::getInstance()->getSetting(
+ 'System: Child Company Structure Managers Enabled'
+ ) == '1'
+ ) {
+ $companyStructure = new CompanyStructure();
+ $companyStructure->Load('id = ?', array($subordinate->department));
+ do {
+ if (CompanyStructure::isHeadOfCompanyStructure(
+ $companyStructure->id,
+ $this->currentUser->$signInMappingField
+ )
+ ) {
+ $departmentHeadFound = true;
+ break;
+ }
+
+ $parentCompanyStructure = $companyStructure->parent;
+ if (!empty($parentCompanyStructure)) {
+ $companyStructure = new CompanyStructure();
+ $companyStructure->Load('id = ?', array($parentCompanyStructure));
+ }
+ } while (!empty($companyStructure->id)
+ && !empty($parentCompanyStructure)
+ );
+ }
+
+
+ return $subFound || $departmentHeadFound;
+ }
}
diff --git a/src/Company/Common/Model/CompanyStructure.php b/src/Company/Common/Model/CompanyStructure.php
index ecbe20bf..cfbbbb60 100644
--- a/src/Company/Common/Model/CompanyStructure.php
+++ b/src/Company/Common/Model/CompanyStructure.php
@@ -2,6 +2,7 @@
namespace Company\Common\Model;
use Classes\IceResponse;
+use Employees\Common\Model\Employee;
use Model\BaseModel;
class CompanyStructure extends BaseModel
@@ -32,6 +33,25 @@ class CompanyStructure extends BaseModel
);
}
+ $heads = json_decode($obj->heads);
+ foreach ($heads as $head) {
+ $employee = new Employee();
+ $employee->Load('id = ?', array($head));
+ if (!empty($obj->id) && $employee->department != $obj->id) {
+ $companyStructure = new CompanyStructure();
+ $companyStructure->Load("id = ?", array($employee->department));
+
+ return new IceResponse(
+ IceResponse::ERROR,
+ "An employee who is not attached to a company structure can not be the
+ head of the company structure. ".
+ "Please remove ".$employee->first_name.' '.$employee->last_name
+ ." from list of heads as this person is attached to ".
+ $companyStructure->title
+ );
+ }
+ }
+
return new IceResponse(IceResponse::SUCCESS, "");
}
diff --git a/src/Model/BaseModel.php b/src/Model/BaseModel.php
index b234bdf2..97143444 100644
--- a/src/Model/BaseModel.php
+++ b/src/Model/BaseModel.php
@@ -79,6 +79,11 @@ class BaseModel extends \ADOdb_Active_Record
return new IceResponse(IceResponse::SUCCESS, $obj);
}
+ public function executePreDeleteActions($obj)
+ {
+ return new IceResponse(IceResponse::SUCCESS, null);
+ }
+
public function executePostSaveActions($obj)
{
}
diff --git a/src/Reports/Admin/Reports/ActiveEmployeeReport.php b/src/Reports/Admin/Reports/ActiveEmployeeReport.php
index 2361f7fb..f53474fe 100644
--- a/src/Reports/Admin/Reports/ActiveEmployeeReport.php
+++ b/src/Reports/Admin/Reports/ActiveEmployeeReport.php
@@ -12,7 +12,7 @@ class ActiveEmployeeReport extends CSVReportBuilder implements CSVReportBuilderI
public function getMainQuery()
{
$query = "Select id, employee_id as 'Employee ID',
-concat(`first_name`,' ',`middle_name`,' ', `last_name`) as 'Name',
+concat(`first_name`, ' ', `last_name`) as 'Name',
(SELECT name from Nationality where id = nationality) as 'Nationality',
birthday as 'Birthday',
gender as 'Gender',
diff --git a/src/Reports/Admin/Reports/EmployeeAttendanceReport.php b/src/Reports/Admin/Reports/EmployeeAttendanceReport.php
index 195b64f2..86b10941 100644
--- a/src/Reports/Admin/Reports/EmployeeAttendanceReport.php
+++ b/src/Reports/Admin/Reports/EmployeeAttendanceReport.php
@@ -11,8 +11,8 @@ class EmployeeAttendanceReport extends CSVReportBuilder implements CSVReportBuil
public function getMainQuery()
{
$query = "SELECT
-(SELECT `employee_id` from Employees where id = at.employee) as 'Employee',
-(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = at.employee) as 'Employee',
+(SELECT `employee_id` from Employees where id = at.employee) as 'Employee ID',
+(SELECT concat(`first_name`, ' ', `last_name`) from Employees where id = at.employee) as 'Employee',
in_time as 'Time In',
out_time as 'Time Out',
note as 'Note'
diff --git a/src/Reports/Admin/Reports/EmployeeLeavesReport.php b/src/Reports/Admin/Reports/EmployeeLeavesReport.php
index e10ce769..5dfb8243 100644
--- a/src/Reports/Admin/Reports/EmployeeLeavesReport.php
+++ b/src/Reports/Admin/Reports/EmployeeLeavesReport.php
@@ -12,7 +12,7 @@ class EmployeeLeavesReport extends CSVReportBuilder implements CSVReportBuilderI
public function getMainQuery()
{
$query = "SELECT
-(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = employee)
+(SELECT concat(`first_name`, ' ', `last_name`) from Employees where id = employee)
as 'Employee',
(SELECT name from LeaveTypes where id = leave_type) as 'Leave Type',
(SELECT name from LeavePeriods where id = leave_period) as 'Leave Period',
diff --git a/src/Reports/Admin/Reports/EmployeeTimesheetReport.php b/src/Reports/Admin/Reports/EmployeeTimesheetReport.php
index dcb53f60..efc7ba53 100644
--- a/src/Reports/Admin/Reports/EmployeeTimesheetReport.php
+++ b/src/Reports/Admin/Reports/EmployeeTimesheetReport.php
@@ -12,7 +12,7 @@ class EmployeeTimesheetReport extends CSVReportBuilder implements CSVReportBuild
public function getMainQuery()
{
$query = "SELECT
-(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`)
+(SELECT concat(`first_name`, ' ', `last_name`)
from Employees where id = te.employee) as 'Employee',
(SELECT name from Projects where id = te.project) as 'Project',
details as 'Details',
diff --git a/src/Reports/Admin/Reports/ExpenseReport.php b/src/Reports/Admin/Reports/ExpenseReport.php
index 38ef9b0d..bd5052ac 100644
--- a/src/Reports/Admin/Reports/ExpenseReport.php
+++ b/src/Reports/Admin/Reports/ExpenseReport.php
@@ -10,7 +10,7 @@ class ExpenseReport extends CSVReportBuilder implements CSVReportBuilderInterfac
public function getMainQuery()
{
$query = "SELECT
-(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`)
+(SELECT concat(`first_name`, ' ', `last_name`)
from Employees where id = employee) as 'Employee',
expense_date as 'Date',
(SELECT name from ExpensesPaymentMethods where id = payment_method) as 'Payment Method',
diff --git a/src/Reports/Admin/Reports/OvertimeRequestReport.php b/src/Reports/Admin/Reports/OvertimeRequestReport.php
index 5453493a..28f85bed 100644
--- a/src/Reports/Admin/Reports/OvertimeRequestReport.php
+++ b/src/Reports/Admin/Reports/OvertimeRequestReport.php
@@ -11,8 +11,8 @@ class OvertimeRequestReport extends CSVReportBuilder implements CSVReportBuilder
public function getMainQuery()
{
$query = "SELECT
-(SELECT `employee_id` from Employees where id = at.employee) as 'Employee',
-(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = at.employee) as 'Employee',
+(SELECT `employee_id` from Employees where id = at.employee) as 'Employee ID',
+(SELECT concat(`first_name`, ' ', `last_name`) from Employees where id = at.employee) as 'Employee',
(SELECT `name` from OvertimeCategories where id = at.category) as 'Category',
(SELECT `name` from Projects where id = at.project) as 'Project',
start_time as 'Start Time',
diff --git a/src/Reports/Admin/Reports/TravelRequestReport.php b/src/Reports/Admin/Reports/TravelRequestReport.php
index dc2d4a35..cfb2f2fa 100644
--- a/src/Reports/Admin/Reports/TravelRequestReport.php
+++ b/src/Reports/Admin/Reports/TravelRequestReport.php
@@ -10,7 +10,7 @@ class TravelRequestReport extends CSVReportBuilder implements CSVReportBuilderIn
public function getMainQuery()
{
$query = "SELECT
-(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`)
+(SELECT concat(`first_name`, ' ', `last_name`)
from Employees where id = employee) as 'Employee',
type as 'Type',
purpose as 'Purpose',
diff --git a/src/Reports/User/Reports/EmployeeAttendanceReport.php b/src/Reports/User/Reports/EmployeeAttendanceReport.php
index a0cde2f2..c165f8e3 100644
--- a/src/Reports/User/Reports/EmployeeAttendanceReport.php
+++ b/src/Reports/User/Reports/EmployeeAttendanceReport.php
@@ -12,8 +12,8 @@ class EmployeeAttendanceReport extends CSVReportBuilder implements CSVReportBuil
public function getMainQuery()
{
$query = "SELECT
-(SELECT `employee_id` from Employees where id = at.employee) as 'Employee',
-(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = at.employee) as 'Employee',
+(SELECT `employee_id` from Employees where id = at.employee) as 'Employee ID',
+(SELECT concat(`first_name`, ' ', `last_name`) from Employees where id = at.employee) as 'Employee',
in_time as 'Time In',
out_time as 'Time Out',
note as 'Note'
diff --git a/src/Reports/User/Reports/EmployeeLeavesReport.php b/src/Reports/User/Reports/EmployeeLeavesReport.php
index 136e4ff7..62dbc75b 100644
--- a/src/Reports/User/Reports/EmployeeLeavesReport.php
+++ b/src/Reports/User/Reports/EmployeeLeavesReport.php
@@ -12,7 +12,7 @@ class EmployeeLeavesReport extends CSVReportBuilder implements CSVReportBuilderI
public function getMainQuery()
{
$query = "SELECT
-(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`)
+(SELECT concat(`first_name`, ' ', `last_name`)
from Employees where id = employee) as 'Employee',
(SELECT name from LeaveTypes where id = leave_type) as 'Leave Type',
(SELECT name from LeavePeriods where id = leave_period) as 'Leave Period',
diff --git a/src/Reports/User/Reports/EmployeeTimesheetReport.php b/src/Reports/User/Reports/EmployeeTimesheetReport.php
index b03fdd34..f38e3153 100644
--- a/src/Reports/User/Reports/EmployeeTimesheetReport.php
+++ b/src/Reports/User/Reports/EmployeeTimesheetReport.php
@@ -13,7 +13,7 @@ class EmployeeTimesheetReport extends CSVReportBuilder implements CSVReportBuild
public function getMainQuery()
{
$query = "SELECT
-(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`)
+(SELECT concat(`first_name`, ' ', `last_name`)
from Employees where id = te.employee) as 'Employee',
(SELECT name from Projects where id = te.project) as 'Project',
details as 'Details',
diff --git a/src/Reports/User/Reports/ExpenseReport.php b/src/Reports/User/Reports/ExpenseReport.php
index 09b01111..5790972d 100644
--- a/src/Reports/User/Reports/ExpenseReport.php
+++ b/src/Reports/User/Reports/ExpenseReport.php
@@ -11,7 +11,7 @@ class ExpenseReport extends CSVReportBuilder implements CSVReportBuilderInterfac
public function getMainQuery()
{
$query = "SELECT
-(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = employee) as 'Employee',
+(SELECT concat(`first_name`, ' ', `last_name`) from Employees where id = employee) as 'Employee',
expense_date as 'Date',
(SELECT name from ExpensesPaymentMethods where id = payment_method) as 'Payment Method',
transaction_no as 'Transaction Ref',
diff --git a/src/Reports/User/Reports/TravelRequestReport.php b/src/Reports/User/Reports/TravelRequestReport.php
index 320036ed..a15c2b8f 100644
--- a/src/Reports/User/Reports/TravelRequestReport.php
+++ b/src/Reports/User/Reports/TravelRequestReport.php
@@ -11,7 +11,7 @@ class TravelRequestReport extends CSVReportBuilder implements CSVReportBuilderIn
public function getMainQuery()
{
$query = "SELECT
-(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = employee) as 'Employee',
+(SELECT concat(`first_name`, ' ', `last_name`) from Employees where id = employee) as 'Employee',
type as 'Type',
purpose as 'Purpose',
travel_from as 'Travel From',
diff --git a/src/Utils/CalendarTools.php b/src/Utils/CalendarTools.php
index 2d3667aa..f9766990 100644
--- a/src/Utils/CalendarTools.php
+++ b/src/Utils/CalendarTools.php
@@ -64,4 +64,12 @@ class CalendarTools
return $time->format($format);
}
+
+ public static function getNumberOfDaysBetweenDates($first, $second)
+ {
+ $timeFirst = new \DateTime($first);
+ $timeSecond = new \DateTime($second);
+ $interval = $timeSecond->diff($timeFirst);
+ return intval($interval->format('%a'));
+ }
}
diff --git a/src/Utils/InputCleaner.php b/src/Utils/InputCleaner.php
index 5204b8f1..56951e1f 100644
--- a/src/Utils/InputCleaner.php
+++ b/src/Utils/InputCleaner.php
@@ -16,17 +16,17 @@ class InputCleaner
{
$val = strip_tags($val, TAGS_TO_PRESERVE);
/*
- / # Start Pattern
- < # Match '<' at beginning of tags
- ( # Start Capture Group $1 - Tag Name
- [a-z] # Match 'a' through 'z'
- [a-z0-9]* # Match 'a' through 'z' or '0' through '9' zero or more times
- ) # End Capture Group
- [^>]*? # Match anything other than '>', Zero or More times, not-greedy (wont eat the /)
- (\/?) # Capture Group $2 - '/' if it is there
- > # Match '>'
- /i # End Pattern - Case Insensitive
- */
+ / # Start Pattern
+ < # Match '<' at beginning of tags
+ ( # Start Capture Group $1 - Tag Name
+ [a-z] # Match 'a' through 'z'
+ [a-z0-9]* # Match 'a' through 'z' or '0' through '9' zero or more times
+ ) # End Capture Group
+ [^>]*? # Match anything other than '>', Zero or More times, not-greedy (wont eat the /)
+ (\/?) # Capture Group $2 - '/' if it is there
+ > # Match '>'
+ /i # End Pattern - Case Insensitive
+ */
$val = preg_replace("/<([a-z][a-z0-9]*)[^>]*?(\/?)>/i", '<$1$2>', $val);
return $val;
}
diff --git a/templates/menu/menuButtonHelp.html b/templates/menu/menuButtonHelp.html
index 68197122..151ce4d0 100644
--- a/templates/menu/menuButtonHelp.html
+++ b/templates/menu/menuButtonHelp.html
@@ -1,11 +1,11 @@