Plugin Directory

Changeset 3416995


Ignore:
Timestamp:
12/11/2025 05:48:09 AM (4 months ago)
Author:
weblizar
Message:

update

Location:
hr-management-lite
Files:
168 added
4 edited

Legend:

Unmodified
Added
Removed
  • hr-management-lite/trunk/admin/inc/controllers/wl-hrm-lite-staff-dash-actions.php

    r2961951 r3416995  
    143143                                /* Working hours */
    144144                                $attendences = get_option( 'ehrm_staff_attendence_data' );
     145                                $lunch_duration = 0;
    145146
    146147                                if ( ! empty( $attendence['lunch_out'] ) && ! empty( $attendence['lunch_in'] ) ) {
     
    148149                                } elseif ( empty( $attendence['lunch_out'] ) && ! empty( $attendence['lunch_in'] ) ) {
    149150                                    $savesetting    = get_option('ehrm_settings_data');
    150                                     $lunch_out      = $savesetting['lunch_end'];
    151                                     $lunch_duration = strtotime( $lunch_out ) - strtotime( $attendence['lunch_in'] );
    152                                 }
    153 
    154                                 $total_working_duration = HRMLiteHelperClass::get_time_difference( $attendence['office_in'], $attendence[$key]['office_in'] ?? null );
     151                                    $lunch_out      = isset( $savesetting['lunch_end'] ) ? $savesetting['lunch_end'] : '';
     152                                    if ( ! empty( $lunch_out ) ) {
     153                                        $lunch_duration = strtotime( $lunch_out ) - strtotime( $attendence['lunch_in'] );
     154                                    }
     155                                }
     156
     157                                $total_working_duration = HRMLiteHelperClass::get_time_difference( $attendence['office_in'], $attendences[$key]['office_out'] ?? null );
    155158                               
    156159                           
    157                                 if ( ! empty( $lunch_duration ) && $save_settings['lunchtime'] == 'Exclude') {
     160                                if ( ! empty( $lunch_duration ) && isset( $save_settings['lunchtime'] ) && $save_settings['lunchtime'] == 'Exclude') {
    158161                                    $today_total_hours = strtotime( $total_working_duration ) - strtotime( $lunch_duration );
    159162                                } else {
     
    163166                                $attendences[$key]['working_hour'] = $today_total_hours;
    164167
    165                                 if ( update_option( 'ehrm_staff_attendence_data', $attendences ) ) {
    166                                     $message = esc_html__( 'Your Office Out Time is', 'hr-management-lite' ).'  '.esc_html( date( HRMLiteHelperClass::get_time_format(), strtotime( $attendence[$key]['office_out'] ) ) );
    167                                     $status  = 'success';
    168 
    169                                     $save_settings  = get_option( 'ehrm_settings_data' );
    170                                     if ( $save_settings['shoot_mail'] == 'Yes' ) {
    171                                         HRMLiteHelperClass::ehrm_shoot_mail_staff_details( get_current_user_id(), $attendence['office_in'], $current_time, HRMLiteHelperClass::get_user_location( $_SERVER['REMOTE_ADDR'] ), $_SERVER['REMOTE_ADDR'] );
    172                                     }
    173 
     168                            if ( update_option( 'ehrm_staff_attendence_data', $attendences ) ) {
     169                                $attendences = get_option( 'ehrm_staff_attendence_data' );
     170                                if ( isset( $attendences[$key]['office_out'] ) && ! empty( $attendences[$key]['office_out'] ) ) {
     171                                    $message = esc_html__( 'Your Office Out Time is', 'hr-management-lite' ).'  '.esc_html( date( HRMLiteHelperClass::get_time_format(), strtotime( $attendences[$key]['office_out'] ) ) );
    174172                                } else {
     173                                    $message = esc_html__( 'Your Office Out Time is', 'hr-management-lite' );
     174                                }
     175                                $status  = 'success';
     176
     177                                $save_settings  = get_option( 'ehrm_settings_data' );
     178                                if ( isset( $save_settings['shoot_mail'] ) && $save_settings['shoot_mail'] == 'Yes' && ! empty( $attendence['office_in'] ) ) {
     179                                    HRMLiteHelperClass::ehrm_shoot_mail_staff_details( get_current_user_id(), $attendence['office_in'], $current_time, HRMLiteHelperClass::get_user_location( $_SERVER['REMOTE_ADDR'] ), $_SERVER['REMOTE_ADDR'] );
     180                                }                               } else {
    175181                                    $message = esc_html__( 'Something went wrong.!', 'hr-management-lite' );
    176182                                    $status  = 'error';
  • hr-management-lite/trunk/admin/inc/helpers/wl-hrm-lite-helper.php

    r2961951 r3416995  
    426426     */
    427427    public static function get_time_difference( $start, $end ) {
     428        if ( empty( $start ) || empty( $end ) ) {
     429            return '00:00:00';
     430        }
    428431        $dteStart = new DateTime( $start );
    429432        $dteEnd   = new DateTime( $end );
     
    636639
    637640        $request = wp_remote_get( 'http://ip-api.com/php/'.$ip.'?fields=status,message,continent,continentCode,country,countryCode,region,regionName,city,district,zip,lat,lon,timezone,isp,org,as,query' );
     641       
     642        if ( is_wp_error( $request ) || empty( $request['body'] ) ) {
     643            return '';
     644        }
     645       
    638646        $request = unserialize( $request['body'] );
     647       
     648        if ( ! is_array( $request ) ) {
     649            return '';
     650        }
    639651
    640652        if ( ! empty ( $request['city'] ) ) {
  • hr-management-lite/trunk/hr-management-lite.php

    r3326764 r3416995  
    66* Author: weblizar
    77* Author URI: https://weblizar.com/
    8 * Version: 3.4
     8* Version: 3.5
    99* License: GPL-2.0+
    1010* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
  • hr-management-lite/trunk/readme.txt

    r3326764 r3416995  
    22Contributors: weblizar
    33Donate link: https://weblizar.com/
    4 Tags: hr Management, shift, hrm, crm, erp clock in and out, attendance, leave management , project manaegment tool , salaries management
     4Tags: HR Management, Attendance, Leave Management, Shift Management, Project Management
    55Requires at least: 7.4
    6 Tested up to: 6.8.1
    7 Stable tag: 3.4
     6Tested up to: 6.9
     7Stable tag: 3.5
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    101101
    102102== Changelog ==
     103= 3.5 = [10-12-2025]
     104* Tested upto WordPress 6.9
     105* Tested upto Php 8.4
     106
    103107= 3.4 = [12-07-2025]
    104108* Tested upto WordPress 6.8.1
    105 *  Tested upto Php 8.3.16
     109* Tested upto Php 8.3.16
    106110
    107111= 3.3 = [01-05-2025]
Note: See TracChangeset for help on using the changeset viewer.