Birthday Buddies', 'erp' ), 'erp_hr_dashboard_widget_birthday' ); erp_admin_dash_metabox( __( ' Who is out', 'erp' ), 'erp_hr_dashboard_widget_whoisout' ); } function erp_hr_dashboard_widget_announcement_callback() { erp_admin_dash_metabox( __( ' Latest Announcement', 'erp' ), 'erp_hr_dashboard_widget_latest_announcement' ); erp_admin_dash_metabox( __( ' My Leave Calendar', 'erp' ), 'erp_hr_dashboard_widget_leave_calendar' ); } add_action( 'erp_hr_dashboard_widgets_right', 'erp_hr_dashboard_widget_birthday_callback' ); add_action( 'erp_hr_dashboard_widgets_left', 'erp_hr_dashboard_widget_announcement_callback' ); /** Widgets *****************************/ /** * Birthday widget * * @return void */ function erp_hr_dashboard_widget_birthday() { $todays_birthday = erp_hr_get_todays_birthday(); $upcoming_birtday = erp_hr_get_next_seven_days_birthday(); if ( $todays_birthday ) { ?>

'erp_hr_announcement', 'posts_per_page' => '5', 'order' => 'DESC' ) ); $announcements = $query->get_posts(); } else { $announcements = erp_hr_employee_dashboard_announcement( get_current_user_id() ); } if ( $announcements ) { ?>

toArray() ); $events = []; $holiday_events = []; $event_data = []; foreach ( $leave_requests as $key => $leave_request ) { //if status pending $policy = erp_hr_leave_get_policy( $leave_request->policy_id ); $event_label = $policy->name; if ( 2 == $leave_request->status ) { $policy = erp_hr_leave_get_policy( $leave_request->policy_id ); $event_label .= sprintf( ' ( %s ) ', __( 'Pending', 'erp' ) ); } $events[] = array( 'id' => $leave_request->id, 'title' => $event_label, 'start' => $leave_request->start_date, 'end' => $leave_request->end_date, 'url' => erp_hr_url_single_employee( $leave_request->user_id, 'leave' ), 'color' => $leave_request->color, ); } foreach ( $holidays as $key => $holiday ) { $holiday_events[] = [ 'id' => $holiday->id, 'title' => $holiday->title, 'start' => $holiday->start, 'end' => $holiday->end, 'color' => '#FF5354', 'img' => '', 'holiday' => true ]; } $event_data = array_merge( $events, $holiday_events ); ?>
'erp-hr-employee' ]; $url = add_query_arg( $args, admin_url( 'admin.php' ) ); $url = apply_filters( 'erp_hr_employee_list_url', $url, $args ); return $url; }