WordPress.org

Plugin Directory

Changeset 1644375


Ignore:
Timestamp:
04/24/17 23:19:54 (5 months ago)
Author:
Gwendydd
Message:

fix expense receipts, improve geolocation error reporting

Location:
employee-scheduler/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • employee-scheduler/trunk/README.txt

    r1612229 r1644375  
    33Tags: employee, schedule, clock in, clock out, payroll, work schedule, timesheet, volunteer schedule, volunteer, human resources 
    44Requires at least: 4.0 
    5 Tested up to: 4.7.2 
     5Tested up to: 4.7.4 
    66Stable tag: trunk 
    77License: GPLv2 or later 
     
    6666 
    6767== Changelog == 
     68= 2.0.4 = 
     69* improvement: better error reporting if user has turned off geolocation data 
     70* bug fix: fix the syntax error that prevented expense receipts from saving 
     71* improvement: add filter to the 'CC:' on the notification email sent to employees when a shift is created and assigned to them 
     72 
    6873= 2.0.3 = 
    6974* improvement: add filter to today shortcode to make it customizable 
  • employee-scheduler/trunk/admin/class-shiftee-basic-admin.php

    r1612229 r1644375  
    10401040        $to = $employeeemail; 
    10411041 
     1042        $cc = apply_filters( 'shiftee_employee_shift_notification_cc', '' ); 
     1043 
    10421044        $subject = esc_attr( $options['notification_subject'] ); 
    10431045 
     
    10681070 
    10691071        $email = new Shiftee_Email(); 
    1070         $email->send_email( $from, $to, '', $subject, $message ); 
     1072        $email->send_email( $from, $to, $cc, $subject, $message ); 
    10711073    } 
    10721074 
  • employee-scheduler/trunk/employee-scheduler.php

    r1612229 r1644375  
    1010 * Plugin URI:        https://shiftee.co 
    1111 * Description:       Complete employee schedule management system: create and display schedule, let employees clock in and out, report expenses. 
    12  * Version:           2.0.3 
     12 * Version:           2.0.4 
    1313 * Author:            Range 
    1414 * Author URI:        http://ran.ge 
  • employee-scheduler/trunk/public/class-shiftee-basic-public.php

    r1612229 r1644375  
    16541654 
    16551655        //attach image 
    1656         if( isset( $_FILES['shiftee-expense-receipt'] ) && is_array( $_FILES['shiftee-expense-receipt'] && '' !== $_FILES['shiftee-expense-receipt']['name'] ) ) { 
    1657             wp_die( '<pre>' . print_r( $_FILES['shiftee-expense-receipt'], true ) ); 
     1656        if( isset( $_FILES['shiftee-expense-receipt'] ) && is_array( $_FILES['shiftee-expense-receipt'] ) && '' !== $_FILES['shiftee-expense-receipt']['name'] ) { 
     1657 
    16581658            $upload = wp_upload_bits( $_FILES['shiftee-expense-receipt']['name'], null, file_get_contents( $_FILES['shiftee-expense-receipt']['tmp_name'] ) ); 
    16591659 
  • employee-scheduler/trunk/public/js/geolocation.js

    r1563825 r1644375  
    11window.onload = getLocationConstant; 
    2 console.log('loaded'); 
    32 
    4 function getLocationConstant() 
    5 { 
    6     if(navigator.geolocation) 
    7     { 
    8         navigator.geolocation.getCurrentPosition(onGeoSuccess,onGeoError);   
     3function getLocationConstant() { 
     4    if(navigator.geolocation) { 
     5        navigator.geolocation.getCurrentPosition(onGeoSuccess,onGeoError); 
     6        console.log(navigator); 
     7        if( "1" == navigator.doNotTrack ) { 
     8            console.log('do not track'); 
     9            document.getElementById("latitude").value =  "User opted not to share geolocation information"; 
     10            document.getElementById("longitude").value = "User opted not to share geolocation information"; 
     11        } 
    912    } else { 
    10         alert("Your browser or device doesn't support Geolocation"); 
     13        alert( "Your browser or device doesn't support Geolocation" ); 
    1114    } 
    1215} 
    1316 
    1417// If we have a successful location update 
    15 function onGeoSuccess(event) 
    16 { 
    17     document.getElementById("latitude").value =  event.coords.latitude;  
    18     document.getElementById("longitude").value = event.coords.longitude; 
     18function onGeoSuccess(event) { 
     19    if( document.getElementById("latitude") !== null ) { 
     20        document.getElementById("latitude").value = event.coords.latitude; 
     21        document.getElementById("longitude").value = event.coords.longitude; 
     22    } 
    1923 
    2024} 
    2125 
    22 function onGeoError(event) 
    23 { 
    24     document.getElementById("latitude").value =  event.message;  
    25     document.getElementById("longitude").value = event.message; 
     26function onGeoError(event) { 
     27    if( document.getElementById("latitude") !== null ) { 
     28        document.getElementById("latitude").value = event.message; 
     29        document.getElementById("longitude").value = event.message; 
     30    } 
    2631} 
Note: See TracChangeset for help on using the changeset viewer.