Plugin Directory

Changeset 2275431


Ignore:
Timestamp:
04/03/2020 07:45:31 PM (6 years ago)
Author:
hitcode
Message:

4.6.0

Location:
shiftcontroller/trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • shiftcontroller/trunk/hc3/profiler.php

    r1864047 r2275431  
    3131        foreach ($this->_available_sections as $section){
    3232            if ( ! isset($config[$section])){
    33                 $this->_compile_{$section} = TRUE;
     33                $this->{'_compile_' . $section} = TRUE;
    3434            }
    3535        }
     
    5454        foreach ($config as $method => $enable){
    5555            if (in_array($method, $this->_available_sections)){
    56                 $this->_compile_{$method} = ($enable !== FALSE) ? TRUE : FALSE;
     56                $this->{'_compile_' . $method} = ($enable !== FALSE) ? TRUE : FALSE;
    5757            }
    5858        }
     
    329329
    330330        foreach ($this->_available_sections as $section){
    331             if ($this->_compile_{$section} !== FALSE){
     331            if ($this->{'_compile_' . $section} !== FALSE){
    332332                $func = "_compile_{$section}";
    333333                $output .= $this->{$func}();
  • shiftcontroller/trunk/hc3/session.php

    r1851180 r2275431  
    4949     */
    5050
     51    protected function _isRest()
     52    {
     53        // if wordpress
     54        if( ! defined('WPINC') ){
     55            return FALSE;
     56        }
     57
     58        $prefix = rest_get_url_prefix( );
     59        if (defined('REST_REQUEST') && REST_REQUEST // (#1)
     60            || isset($_GET['rest_route']) // (#2)
     61                 && strpos( trim( $_GET['rest_route'], '\\/' ), $prefix , 0 ) === 0)
     62            return true;
     63
     64        // (#3)
     65        $rest_url = wp_parse_url( site_url( $prefix ) );
     66        $current_url = wp_parse_url( add_query_arg( array( ) ) );
     67        return strpos( $current_url['path'], $rest_url['path'], 0 ) === 0;
     68    }
     69
    5170    public function __construct( $prefix = 'hc3' )
    5271    {
     72        if( $this->_isRest() ){
     73            return;
     74        }
     75
    5376        // $this->request = $request;
    5477        $this->_prefix = $prefix;
     
    5780
    5881// echo "INIT SESSION FOR '$this->_prefix'<br>";
    59 
    6082        if( session_id() == '' ){
    6183            @session_start();
  • shiftcontroller/trunk/readme.txt

    r2258787 r2275431  
    6060
    6161== Changelog ==
     62
     63= 4.6.0 =
     64* Added a setting if a conflict is considered for overlapping shifts only in the same calendar.
     65* BUG: there was a "REST API" error in Wordpress SiteHealth.
    6266
    6367= 4.5.9 =
  • shiftcontroller/trunk/sh4/app/boot.php

    r2258787 r2275431  
    3030
    3131            ->init( 'datetime_hide_schedule_reports', 0 )
     32            ->init( 'conflicts_calendar_only', 0 )
    3233            ;
    3334
  • shiftcontroller/trunk/sh4/conf/boot.php

    r1856992 r2275431  
    1313            ->add( 'sh4/app/html/view/admin::menu::after', function( $return ){
    1414                $return['admin/datetime'] = array( 'admin/conf/datetime', '__Date and Time__' );
     15                $return['admin/conflicts'] = array( 'admin/conf/conflicts', '__Conflicts__' );
    1516                $return['admin/about'] = array( 'admin/about', '__About__' );
    1617                return $return;
     
    2122            ->register( 'get:admin/conf/datetime', array('SH4_Conf_Html_Admin_View_Datetime', 'render') )
    2223            ->register( 'post:admin/conf/datetime', array('SH4_Conf_Html_Admin_Controller_Datetime', 'execute') )
     24
     25            ->register( 'get:admin/conf/conflicts', array('SH4_Conf_Html_Admin_View_Conflicts', 'render') )
     26            ->register( 'post:admin/conf/conflicts', array('SH4_Conf_Html_Admin_Controller_Conflicts', 'execute') )
    2327            ;
    2428    }
  • shiftcontroller/trunk/sh4/shifts/conflict/overlap.php

    r1954223 r2275431  
    77        HC3_Hooks $hooks,
    88        HC3_Ui $ui,
     9        HC3_Settings $settings,
    910        SH4_Shifts_Query $shiftsQuery,
    1011        SH4_Shifts_View_Widget $widget
     
    1415        $this->shiftsQuery = $hooks->wrap( $shiftsQuery );
    1516        $this->widget = $hooks->wrap( $widget );
     17        $this->settings = $hooks->wrap($settings);
    1618    }
    1719
     
    2022    {
    2123        $return = TRUE;
     24
     25        $conflictSameCalendarOnly = $this->settings->get( 'conflicts_calendar_only' );
    2226
    2327        $this->_conflictingShifts = array();
     
    8387            }
    8488
     89            if( $conflictSameCalendarOnly && (! $testCalendar->isTimeoff()) && ( ! $calendar->isTimeoff() ) ){
     90                if( $testCalendar->getId() != $calendar->getId() ){
     91                    continue;
     92                }
     93            }
     94
    8595            $this->_conflictingShifts[] = $testShift;
    8696        }
  • shiftcontroller/trunk/shiftcontroller4.php

    r2258787 r2275431  
    44 * Plugin URI: http://www.shiftcontroller.com/
    55 * Description: Staff scheduling plugin
    6  * Version: 4.5.9
     6 * Version: 4.6.0
    77 * Author: hitcode.com
    88 * Author URI: http://www.shiftcontroller.com/
     
    1111*/
    1212
    13 define( 'SH4_VERSION', 459 );
     13define( 'SH4_VERSION', 460 );
    1414
    1515if (! defined('ABSPATH')) exit; // Exit if accessed directly
Note: See TracChangeset for help on using the changeset viewer.