Changeset 2217010
- Timestamp:
- 12/23/2019 02:24:55 PM (6 years ago)
- Location:
- shiftcontroller/trunk
- Files:
-
- 6 edited
-
readme.txt (modified) (1 diff)
-
sh4/calendars/html/admin/view/permissions.php (modified) (4 diffs)
-
sh4/calendars/permissions.php (modified) (4 diffs)
-
sh4/schedule/html/view/common.php (modified) (3 diffs)
-
sh4/shifts/acl.php (modified) (2 diffs)
-
shiftcontroller4.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shiftcontroller/trunk/readme.txt
r2214469 r2217010 60 60 61 61 == 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). 62 66 63 67 = 4.5.5 = -
shiftcontroller/trunk/sh4/calendars/html/admin/view/permissions.php
r1864047 r2217010 29 29 $options = array(); 30 30 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; 32 36 33 37 $option = array(); … … 35 39 $option[] = $employeeOption ? $employeeOption[0] : NULL; 36 40 $option[] = $visitorOption ? $visitorOption[0] : NULL; 41 $option[] = $employee2Option ? $employee2Option[0] : NULL; 37 42 38 43 $options[] = $option; … … 41 46 $header = array( 42 47 '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>', 45 51 ); 46 52 47 53 $rows = array(); 48 54 foreach( $options as $k => $conf ){ 49 list( $label, $kEmployee, $kVisitor ) = $conf;55 list( $label, $kEmployee, $kVisitor, $kEmployee2 ) = $conf; 50 56 51 57 $row = array( … … 53 59 'employee' => $kEmployee ? $this->ui->makeInputCheckbox( $kEmployee, NULL, 1, $this->cp->get($calendar, $kEmployee) ) : NULL, 54 60 '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, 55 62 ); 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 56 72 $rows[] = $row; 57 73 } -
shiftcontroller/trunk/sh4/calendars/permissions.php
r2178321 r2217010 74 74 '__View Others Published Shifts__', 75 75 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 ) 77 78 ); 78 79 … … 80 81 '__View Others Draft Shifts__', 81 82 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 ) 83 85 ); 84 86 … … 86 88 '__View Open Published Shifts__', 87 89 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 ) 89 92 ); 90 93 … … 92 95 '__View Open Draft Shifts__', 93 96 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 ) 95 99 ); 96 100 -
shiftcontroller/trunk/sh4/schedule/html/view/common.php
r2214469 r2217010 193 193 // is other employee 194 194 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 204 205 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 } 206 212 } 207 213 … … 210 216 unset( $return[$id] ); 211 217 } 218 212 219 continue; 213 220 } … … 349 356 350 357 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 } 356 370 } 357 371 -
shiftcontroller/trunk/sh4/shifts/acl.php
r2214469 r2217010 316 316 317 317 $employeeCalendars = $this->appQuery->findCalendarsForEmployee( $meEmployee ); 318 if( ! isset($employeeCalendars[$calendarId]) ){319 return $return;320 }318 // if( ! isset($employeeCalendars[$calendarId]) ){ 319 // return $return; 320 // } 321 321 322 322 $shiftEmployee = $shift->getEmployee(); … … 330 330 } 331 331 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 } 334 339 } 335 340 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 } 337 347 } 338 348 $perm = $this->calendarsPermissions->get( $calendar, $permName ); -
shiftcontroller/trunk/shiftcontroller4.php
r2214469 r2217010 4 4 * Plugin URI: http://www.shiftcontroller.com/ 5 5 * Description: Staff scheduling plugin 6 * Version: 4.5. 56 * Version: 4.5.6 7 7 * Author: hitcode.com 8 8 * Author URI: http://www.shiftcontroller.com/ … … 11 11 */ 12 12 13 define( 'SH4_VERSION', 45 5);13 define( 'SH4_VERSION', 456 ); 14 14 15 15 if (! defined('ABSPATH')) exit; // Exit if accessed directly
Note: See TracChangeset
for help on using the changeset viewer.