Plugin Directory

Changeset 2217010


Ignore:
Timestamp:
12/23/2019 02:24:55 PM (6 years ago)
Author:
hitcode
Message:

4.5.6

Location:
shiftcontroller/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • shiftcontroller/trunk/readme.txt

    r2214469 r2217010  
    6060
    6161== Changelog ==
     62
     63= 4.5.6 =
     64* Added a permission settings per each calendar if to allow employees from other calendars see shifts in this calendar. It configures the feature added in version 4.5.5.
     65* BUG: Custom fields were not saved when repeating a shift for multiple days (Pro Version).
    6266
    6367= 4.5.5 =
  • shiftcontroller/trunk/sh4/calendars/html/admin/view/permissions.php

    r1864047 r2217010  
    2929        $options = array();
    3030        foreach( $permissionsOptions as $o ){
    31             list( $label, $employeeOption, $visitorOption ) = $o;
     31            $label = array_shift( $o );
     32            $employeeOption = array_shift( $o );
     33            $visitorOption = array_shift( $o );
     34            $employee2Option = array_shift( $o );
     35            // list( $label, $employeeOption, $visitorOption ) = $o;
    3236
    3337            $option = array();
     
    3539            $option[] = $employeeOption ? $employeeOption[0] : NULL;
    3640            $option[] = $visitorOption ? $visitorOption[0] : NULL;
     41            $option[] = $employee2Option ? $employee2Option[0] : NULL;
    3742
    3843            $options[] = $option;
     
    4146        $header = array(
    4247            'action'    => NULL,
    43             'employee'  => '__Employee__',
    44             'visitor'   => '__Visitor__',
     48            'employee'  => '<div class="hc-align-center">' . '__Calendar Employees__' . '</div>',
     49            'employee2' => '<div class="hc-align-center">' . '__Other Employees__' . '</div>',
     50            'visitor'   => '<div class="hc-align-center">' . '__Visitor__' . '</div>',
    4551            );
    4652
    4753        $rows = array();
    4854        foreach( $options as $k => $conf ){
    49             list( $label, $kEmployee, $kVisitor ) = $conf;
     55            list( $label, $kEmployee, $kVisitor, $kEmployee2 ) = $conf;
    5056
    5157            $row = array(
     
    5359                'employee'  => $kEmployee ? $this->ui->makeInputCheckbox( $kEmployee, NULL, 1, $this->cp->get($calendar, $kEmployee) ) : NULL,
    5460                'visitor'   => $kVisitor ? $this->ui->makeInputCheckbox( $kVisitor, NULL, 1, $this->cp->get($calendar, $kVisitor) ) : NULL,
     61                'employee2' => $kEmployee2 ? $this->ui->makeInputCheckbox( $kEmployee2, NULL, 1, $this->cp->get($calendar, $kEmployee2) ) : NULL,
    5562                );
     63
     64            $keys = array_keys( $row );
     65            foreach( $keys as $kk ){
     66                if( 'action' === $kk ) continue;
     67                if( isset($row[$kk]) ){
     68                    $row[$kk] = '<label class="hc-block hc-align-center">' . $row[$kk] . '</label>';
     69                }
     70            }
     71
    5672            $rows[] = $row;
    5773        }
  • shiftcontroller/trunk/sh4/calendars/permissions.php

    r2178321 r2217010  
    7474            '__View Others Published Shifts__',
    7575            array( 'employee_view_others_publish', 1 ),
    76             array( 'visitor_view_others_publish', 1 )
     76            array( 'visitor_view_others_publish', 1 ),
     77            array( 'employee2_view_others_publish', 1 )
    7778            );
    7879
     
    8081            '__View Others Draft Shifts__',
    8182            array( 'employee_view_others_draft', 0 ),
    82             array( 'visitor_view_others_draft', 0 )
     83            array( 'visitor_view_others_draft', 0 ),
     84            array( 'employee2_view_others_draft', 0 )
    8385            );
    8486
     
    8688            '__View Open Published Shifts__',
    8789            array( 'employee_view_open_publish', 1 ),
    88             array( 'visitor_view_open_publish', 0 )
     90            array( 'visitor_view_open_publish', 0 ),
     91            array( 'employee2_view_open_publish', 0 )
    8992            );
    9093
     
    9295            '__View Open Draft Shifts__',
    9396            array( 'employee_view_open_draft', 0 ),
    94             array( 'visitor_view_open_draft', 0 )
     97            array( 'visitor_view_open_draft', 0 ),
     98            array( 'employee2_view_open_draft', 0 )
    9599            );
    96100
  • shiftcontroller/trunk/sh4/schedule/html/view/common.php

    r2214469 r2217010  
    193193        // is other employee
    194194            if( $meEmployeeId != $shiftEmployeeId ){
    195 
    196                 if( ! isset($meEmployeeCalendars[$shiftCalendarId]) ){
    197                     unset( $return[$id] );
    198                     continue;
    199                 }
    200 
    201                 if( $shift->isOpen() ){
    202                     $permName = $shift->isPublished() ? 'employee_view_open_publish' : 'employee_view_open_draft';
    203                 }
     195            // calendar employees
     196                if( isset($meEmployeeCalendars[$shiftCalendarId]) ){
     197                    if( $shift->isOpen() ){
     198                        $permName = $shift->isPublished() ? 'employee_view_open_publish' : 'employee_view_open_draft';
     199                    }
     200                    else {
     201                        $permName = $shift->isPublished() ? 'employee_view_others_publish' : 'employee_view_others_draft';
     202                    }
     203                }
     204            // other employees
    204205                else {
    205                     $permName = $shift->isPublished() ? 'employee_view_others_publish' : 'employee_view_others_draft';
     206                    if( $shift->isOpen() ){
     207                        $permName = $shift->isPublished() ? 'employee2_view_open_publish' : 'employee2_view_open_draft';
     208                    }
     209                    else {
     210                        $permName = $shift->isPublished() ? 'employee2_view_others_publish' : 'employee2_view_others_draft';
     211                    }
    206212                }
    207213
     
    210216                    unset( $return[$id] );
    211217                }
     218
    212219                continue;
    213220            }
     
    349356
    350357            if( $currentUserId ){
    351                 if( ! isset($calendarsForEmployee[$currentUserId]) ){
    352                     continue;
    353                 }
    354                 $permNames[] = 'employee_view_others_publish';
    355                 $permNames[] = 'employee_view_others_draft';
     358                // if( ! isset($calendarsForEmployee[$currentUserId]) ){
     359                    // continue;
     360                // }
     361
     362                if( isset($calendarsForEmployee[$currentUserId]) ){
     363                    $permNames[] = 'employee_view_others_publish';
     364                    $permNames[] = 'employee_view_others_draft';
     365                }
     366                else {
     367                    $permNames[] = 'employee2_view_others_publish';
     368                    $permNames[] = 'employee2_view_others_draft';
     369                }
    356370            }
    357371
  • shiftcontroller/trunk/sh4/shifts/acl.php

    r2214469 r2217010  
    316316
    317317        $employeeCalendars = $this->appQuery->findCalendarsForEmployee( $meEmployee );
    318         if( ! isset($employeeCalendars[$calendarId]) ){
    319             return $return;
    320         }
     318        // if( ! isset($employeeCalendars[$calendarId]) ){
     319            // return $return;
     320        // }
    321321
    322322        $shiftEmployee = $shift->getEmployee();
     
    330330        }
    331331
    332         if( $shift->isOpen() ){
    333             $permName = $shift->isPublished() ? 'employee_view_open_publish' : 'employee_view_open_draft';
     332        if( isset($employeeCalendars[$calendarId]) ){
     333            if( $shift->isOpen() ){
     334                $permName = $shift->isPublished() ? 'employee_view_open_publish' : 'employee_view_open_draft';
     335            }
     336            else {
     337                $permName = $shift->isPublished() ? 'employee_view_others_publish' : 'employee_view_others_draft';
     338            }
    334339        }
    335340        else {
    336             $permName = $shift->isPublished() ? 'employee_view_others_publish' : 'employee_view_others_draft';
     341            if( $shift->isOpen() ){
     342                $permName = $shift->isPublished() ? 'employee2_view_open_publish' : 'employee2_view_open_draft';
     343            }
     344            else {
     345                $permName = $shift->isPublished() ? 'employee2_view_others_publish' : 'employee2_view_others_draft';
     346            }
    337347        }
    338348        $perm = $this->calendarsPermissions->get( $calendar, $permName );
  • shiftcontroller/trunk/shiftcontroller4.php

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