Plugin Directory

Changeset 2651414


Ignore:
Timestamp:
12/31/2021 03:39:45 PM (4 years ago)
Author:
wphrmanager
Message:

Fixed Leave Entitlement issue
Fixed wp-hr-field issue

Location:
wp-hr-manager/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wp-hr-manager/trunk/includes/class-install.php

    r2631006 r2651414  
    438438                `data` longtext,
    439439                `date` datetime NOT NULL,
    440                 `additional` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL,
     440                `additional` varchar(500) COLLATE utf8mb4_unicode_520_ci NOT NULL,
    441441                PRIMARY KEY (`id`),
    442442                KEY `user_id` (`user_id`),
     
    593593                `type` text,
    594594                `performance_date` datetime DEFAULT NULL,
    595                 `additional` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL,
     595                `additional` varchar(500) COLLATE utf8mb4_unicode_520_ci NOT NULL,
    596596                PRIMARY KEY (`id`),
    597597                KEY `employee_id` (`employee_id`)
     
    720720
    721721        if (!check_table_column_exists($wpdb->prefix . 'wphr_hr_employee_history', 'additional')) {
    722             $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "wphr_hr_employee_history` ADD additional varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL");
     722            $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "wphr_hr_employee_history` ADD additional varchar(500) COLLATE utf8mb4_unicode_520_ci NOT NULL");
    723723        }
    724724
     
    727727        }
    728728        if (!check_table_column_exists($wpdb->prefix . 'wphr_hr_employee_performance', 'additional')) {
    729             $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "wphr_hr_employee_performance` ADD additional varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL");
     729            $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "wphr_hr_employee_performance` ADD additional varchar(500) COLLATE utf8mb4_unicode_520_ci NOT NULL");
    730730        }
    731731
  • wp-hr-manager/trunk/modules/hrm/views/leave/leave-entitlements.php

    r2631006 r2651414  
    11<?php
    2 $cur_year   = date( 'Y' );
    3 $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field($_GET['tab']) : '';
     2$cur_year = date('Y');
     3$active_tab = isset($_GET['tab']) ? sanitize_text_field($_GET['tab']) : '';
    44?>
    55<div class="wrap wphr-hr-employees" id="wp-wphr">
    66
    77    <h2>
    8         <?php _e( 'Leave Entitlements', 'wphr' ); ?>
    9         <?php if ( 'assignment' == $active_tab ): ?>
    10             <a href="<?php echo admin_url( 'admin.php?page=wphr-leave-assign' ); ?>" id="wphr-new-leave-request" class="add-new-h2"><?php _e( 'Back to Entitlement list', 'wphr' ); ?></a>
     8        <?php _e('Leave Entitlements', 'wphr');?>
     9        <?php if ('assignment' == $active_tab): ?>
     10            <a href="<?php echo admin_url('admin.php?page=wphr-leave-assign'); ?>" id="wphr-new-leave-request" class="add-new-h2"><?php _e('Back to Entitlement list', 'wphr');?></a>
    1111        <?php else: ?>
    1212        <!-- Mostrar Boton-->
    13            <!--   <a href="<?php echo add_query_arg( array( 'tab' => 'assignment' ), admin_url( 'admin.php?page=wphr-leave-assign' ) ); ?>" id="wphr-new-leave-request" class="add-new-h2"><?php _e( ' ', 'wphr' ); ?></a>  -->
    14         <?php endif ?>
     13              <a href="<?php echo add_query_arg(array('tab' => 'assignment'), admin_url('admin.php?page=wphr-leave-assign')); ?>" id="wphr-new-leave-request" class="add-new-h2"><?php _e('Add New ', 'wphr');?></a>
     14        <?php endif?>
    1515    </h2>
    1616
    17     <?php if ( 'assignment' == $active_tab ) { ?>
     17    <?php if ('assignment' == $active_tab) {
     18    ?>
    1819
    1920        <p class="description">
    20             <?php _e( 'Assign a leave policy to employees.', 'wphr' ); ?>
     21            <?php _e('Assign a leave policy to employees.', 'wphr');?>
    2122        </p>
    2223
    2324        <?php
    24         $errors = array(
    25             'invalid-policy'   => __( 'Error: Please select a leave policy.', 'wphr' ),
    26             'invalid-period'   => __( 'Error: Please select a valid period.', 'wphr' ),
    27             'invalid-employee' => __( 'Error: Please select an employee.', 'wphr' )
    28         );
     25$errors = array(
     26        'invalid-policy' => __('Error: Please select a leave policy.', 'wphr'),
     27        'invalid-period' => __('Error: Please select a valid period.', 'wphr'),
     28        'invalid-employee' => __('Error: Please select an employee.', 'wphr'),
     29    );
    2930
    30         if ( isset( $_GET['affected' ] ) ) {
    31             wphr_html_show_notice( sprintf( __( '%d Employee(s) has been entitled to this leave policy.', 'wphr' ), $_GET['affected'] ) );
    32         }
     31    if (isset($_GET['affected'])) {
     32        wphr_html_show_notice(sprintf(__('%d Employee(s) has been entitled to this leave policy.', 'wphr'), $_GET['affected']));
     33    }
    3334
    34         if ( isset( $_GET['error'] ) && array_key_exists( sanitize_text_field( $_GET['error'] ), $errors ) ) {
    35             wphr_html_show_notice( $errors[ $_GET['error'] ], 'error' );
    36         }
    37         ?>
     35    if (isset($_GET['error']) && array_key_exists(sanitize_text_field($_GET['error']), $errors)) {
     36        wphr_html_show_notice($errors[$_GET['error']], 'error');
     37    }
     38    ?>
    3839
    3940        <form action="" method="post">
     
    4142            <ul class="wphr-list separated">
    4243            <?php
    43             wphr_html_form_input( array(
    44                 'label'    => __( 'Assignment', 'wphr' ),
    45                 'name'    => 'assignment_to',
    46                 'type'    => 'checkbox',
    47                 'help'     => __( 'Assign to multiple employees', 'wphr' ),
    48                 'tag'      => 'li',
    49             ) );
     44wphr_html_form_input(array(
     45        'label' => __('Assignment', 'wphr'),
     46        'name' => 'assignment_to',
     47        'type' => 'checkbox',
     48        'help' => __('Assign to multiple employees', 'wphr'),
     49        'tag' => 'li',
     50    ));
    5051
    51             wphr_html_form_input( array(
    52                 'label'    => __( 'Leave Policy', 'wphr' ),
    53                 'name'    => 'leave_policy',
    54                 'type'    => 'select',
    55                 'class'    => 'leave-policy-select',
    56                 'tag'      => 'li',
    57                 'required' => true,
    58                 'options'  => array( 0 => __( '- Select -', 'wphr' ) ) + wphr_hr_leave_get_policies_dropdown_raw()
    59             ) );
     52    wphr_html_form_input(array(
     53        'label' => __('Leave Policy', 'wphr'),
     54        'name' => 'leave_policy',
     55        'type' => 'select',
     56        'class' => 'leave-policy-select',
     57        'tag' => 'li',
     58        'required' => true,
     59        'options' => array(0 => __('- Select -', 'wphr')) + wphr_hr_leave_get_policies_dropdown_raw(),
     60    ));
    6061
    61             wphr_html_form_input( array(
    62                 'label'    => __( 'Leave Period', 'wphr' ),
    63                 'name'    => 'leave_period',
    64                 'type'    => 'select',
    65                 'tag'      => 'li',
    66                 'required' => true,
    67                 'class'    => 'leave-period-select',
    68                 'options' => wphr_hr_leave_period(),
    69             ) );
     62    wphr_html_form_input(array(
     63        'label' => __('Leave Period', 'wphr'),
     64        'name' => 'leave_period',
     65        'type' => 'select',
     66        'tag' => 'li',
     67        'required' => true,
     68        'class' => 'leave-period-select',
     69        'options' => wphr_hr_leave_period(),
     70    ));
    7071
    71             wphr_html_form_input( array(
    72                 'label'    => __( 'Employee', 'wphr' ),
    73                 'name'    => 'single_employee',
    74                 'type'    => 'select',
    75                 'class'    => 'wphr-select2 show-if-single',
    76                 'tag'      => 'li',
    77                 'required' => true,
    78                 'options'  => wphr_hr_get_employees_dropdown_raw()
    79             ) );
     72    wphr_html_form_input(array(
     73        'label' => __('Employee', 'wphr'),
     74        'name' => 'single_employee',
     75        'type' => 'select',
     76        'class' => 'wphr-select2 show-if-single',
     77        'tag' => 'li',
     78        'required' => true,
     79        'options' => wphr_hr_get_employees_dropdown_raw(),
     80    ));
    8081
    81             wphr_html_form_input( array(
    82                 'label'    => __( 'Location', 'wphr' ),
    83                 'name'    => 'location',
    84                 'type'    => 'select',
    85                 'class'    => 'wphr-select2 show-if-multiple',
    86                 'tag'      => 'li',
    87                 'options'  => wphr_company_get_location_dropdown_raw( __( 'All Locations', 'wphr' ) )
    88             ) );
     82    wphr_html_form_input(array(
     83        'label' => __('Location', 'wphr'),
     84        'name' => 'location',
     85        'type' => 'select',
     86        'class' => 'wphr-select2 show-if-multiple',
     87        'tag' => 'li',
     88        'options' => wphr_company_get_location_dropdown_raw(__('All Locations', 'wphr')),
     89    ));
    8990
    90             wphr_html_form_input( array(
    91                 'label'    => __( 'Department', 'wphr' ),
    92                 'name'    => 'department',
    93                 'type'    => 'select',
    94                 'class'    => 'wphr-select2 show-if-multiple',
    95                 'tag'      => 'li',
    96                 'options'  => wphr_hr_get_departments_dropdown_raw( __( 'All Departments', 'wphr' ) )
    97             ) );
     91    wphr_html_form_input(array(
     92        'label' => __('Department', 'wphr'),
     93        'name' => 'department',
     94        'type' => 'select',
     95        'class' => 'wphr-select2 show-if-multiple',
     96        'tag' => 'li',
     97        'options' => wphr_hr_get_departments_dropdown_raw(__('All Departments', 'wphr')),
     98    ));
    9899
    99             wphr_html_form_input( array(
    100                 'label'    => __( 'Comment', 'wphr' ),
    101                 'name'    => 'comment',
    102                 'type'    => 'textarea',
    103                 'tag'      => 'li',
    104                 'placeholder' => __( 'Optional Comment', 'wphr' ),
    105             ) );
     100    wphr_html_form_input(array(
     101        'label' => __('Comment', 'wphr'),
     102        'name' => 'comment',
     103        'type' => 'textarea',
     104        'tag' => 'li',
     105        'placeholder' => __('Optional Comment', 'wphr'),
     106    ));
    106107
    107             ?>
     108    ?>
    108109            </ul>
    109110
    110111            <input type="hidden" name="wphr-action" value="hr-leave-assign-policy">
    111112
    112             <?php wp_nonce_field( 'wphr-hr-leave-assign' ); ?>
    113             <?php submit_button( __( 'Assign Policies', 'wphr' ), 'primary' ); ?>
     113            <?php wp_nonce_field('wphr-hr-leave-assign');?>
     114            <?php submit_button(__('Assign Policies', 'wphr'), 'primary');?>
    114115        </form>
    115116
     
    130131        </script>
    131132
    132     <?php } else { ?>
     133    <?php } else {
     134    ?>
    133135
    134136        <div id="wphr-entitlement-table-wrap">
     
    140142                    <input type="hidden" name="tab" value="entitlements">
    141143                    <?php
    142                     $entitlement = new \WPHR\HR_MANAGER\HRM\Entitlement_List_Table();
    143                     $entitlement->prepare_items();
    144                     $entitlement->views();
     144$entitlement = new \WPHR\HR_MANAGER\HRM\Entitlement_List_Table();
     145    $entitlement->prepare_items();
     146    $entitlement->views();
    145147
    146                     $entitlement->display();
    147                     ?>
     148    $entitlement->display();
     149    ?>
    148150                </form>
    149151
    150152            </div><!-- .list-table-inner -->
    151153        </div><!-- .list-table-wrap -->
    152     <?php } ?>
     154    <?php }?>
    153155</div>
  • wp-hr-manager/trunk/readme.txt

    r2631006 r2651414  
    66Requires at least: 5.0
    77Tested up to: 5.8.2
    8 Stable tag: 3.0.0
     8Stable tag: 3.0.1
    99License: GPLv2
    1010Donate Link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GLKGN964GRZJW
     
    191191
    192192== Changelog ==
     193= v3.0.1 -> 31 December 2021
     194* Fixed Leave Entitlement Add issue
     195*Fixed WP-HR-Field issue
     196
    193197= v3.0.0 -> 16 November 2021
    194198* Fixed Employee Shift Issue
     
    380384
    381385== Upgrade Notice ==
     386= v3.0.1 -> 31 December 2021
     387* Fixed Leave Entitlement Add issue
     388*Fixed WP-HR-Field issue
     389
    382390= v3.0.0 -> 16 November 2021
    383391* Fixed Employee Shift Issue
  • wp-hr-manager/trunk/wp-hr-manager.php

    r2631006 r2651414  
    77 * Author: Black and White Digital Ltd
    88 * Author URI: http://www.wphrmanager.com
    9  * Version: 3.0.0
     9 * Version: 3.0.1
    1010 * Requires at least: 5
    1111 * License: GPLv2
Note: See TracChangeset for help on using the changeset viewer.