/**
 * Erp dashboard who is out widget
 *
 * @since 0.1
 *
 * @return void
 */
function erp_hr_dashboard_widget_whoisout()
{
    $leave_requests = erp_hr_get_current_month_leave_list();
    $leave_requests_nextmonth = erp_hr_get_next_month_leave_list();
    ?>
    <h4><?php 
    _e('This Month', 'wp-erp');
    ?>
</h4>
    <?php 
    if ($leave_requests) {
        ?>
        <ul class="erp-list list-two-side list-sep">
            <?php 
        foreach ($leave_requests as $key => $leave) {
            ?>
                <?php 
            $employee = new \WeDevs\ERP\HRM\Employee(intval($leave->user_id));
            ?>
                <li>
                    <a href="<?php 
            echo $employee->get_details_url();
            ?>
"><?php 
            echo $employee->get_full_name();
            ?>
</a>
                    <span><i class="fa fa-calendar"></i> <?php 
            echo erp_format_date($leave->start_date, 'M d,y') . ' - ' . erp_format_date($leave->end_date, 'M d,y');
            ?>
</span>
                </li>
            <?php 
        }
        ?>
        </ul>
    <?php 
    } else {
        ?>
        <?php 
        _e('No one is in vacation', 'wp-erp');
        ?>
    <?php 
    }
    ?>
    <hr>
    <h4><?php 
    _e('Next Month', 'wp-erp');
    ?>
</h4>
    <?php 
    if ($leave_requests_nextmonth) {
        ?>
        <ul class="erp-list list-two-side list-sep">
            <?php 
        foreach ($leave_requests_nextmonth as $key => $leave) {
            ?>
                <?php 
            $employee = new \WeDevs\ERP\HRM\Employee(intval($leave->user_id));
            ?>
                <li>
                    <a href="<?php 
            echo $employee->get_details_url();
            ?>
"><?php 
            echo $employee->get_full_name();
            ?>
</a>
                    <span><i class="fa fa-calendar"></i> <?php 
            echo erp_format_date($leave->start_date, 'M d,y') . ' - ' . erp_format_date($leave->end_date, 'M d,y');
            ?>
</span>
                </li>
            <?php 
        }
        ?>
        </ul>
    <?php 
    } else {
        ?>
        <?php 
        _e('No one is vacation on next month', 'wp-erp');
        ?>
    <?php 
    }
    ?>

    <?php 
}
Esempio n. 2
0
 /**
  * Add log when entitlement created
  *
  * @since 0.1
  *
  * @param  integer $entitlement_id
  * @param  array $fields
  *
  * @return void
  */
 public function create_entitlement($entitlement_id, $fields)
 {
     if (!$entitlement_id) {
         return;
     }
     $employee = new \WeDevs\ERP\HRM\Employee(intval($fields['user_id']));
     $message = sprintf('%s <strong>%s</strong>', __('A new entitlement has been created for'), $employee->get_full_name());
     erp_log()->add(['sub_component' => 'leave', 'message' => $message, 'created_by' => get_current_user_id(), 'changetype' => 'add']);
 }
Esempio n. 3
0
                        <td><?php 
        echo erp_format_date($row->completion_date);
        ?>
</td>
                        <td><?php 
        echo esc_textarea($row->goal_description);
        ?>
</td>
                        <td><?php 
        echo esc_textarea($row->employee_assessment);
        ?>
</td>
                        <td>
                            <?php 
        $reporting_user = new \WeDevs\ERP\HRM\Employee(intval($row->supervisor));
        echo $reporting_user->get_full_name();
        ?>
                        </td>
                        <td><?php 
        echo esc_textarea($row->supervisor_assessment);
        ?>
</td>
                        
                        <td class="action">
                            <?php 
        if (current_user_can('erp_delete_review')) {
            ?>
                                <a href="#" class="performance-remove" data-id="<?php 
            echo $row->id;
            ?>
"><span class="dashicons dashicons-trash"></span></a>