PluginProbe
ShiftController Employee Shift Scheduling / 4.9.85
ShiftController Employee Shift Scheduling v4.9.85
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
shiftcontroller / sh4 / new / controller / employee.php

employee.php in ShiftController Employee Shift Scheduling 4.9.85, at sh4/new/controller/employee.php

57 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
2 #[AllowDynamicProperties]
3 class SH4_New_Controller_Employee
4 {
5 public function __construct(
6 HC3_Hooks $hooks,
7 HC3_Post $post,
8 HC3_Request $request,
9
10 SH4_Calendars_Query $calendars,
11 SH4_ShiftTypes_Query $shiftTypes,
12
13 HC3_Time $t
14 )
15 {
16 $this->t = $t;
17 $this->request = $request;
18 $this->post = $hooks->wrap( $post );
19
20 $this->calendars = $hooks->wrap($calendars);
21 $this->shiftTypes = $hooks->wrap($shiftTypes);
22
23 $this->self = $hooks->wrap($this);
24 }
25
26 public function execute()
27 {
28 $thisId = array();
29
30 $params = $this->request->getParams();
31 $employees = $this->post->get('employee');
32 if( ! $employees ){
33 $employees = array();
34 }
35
36 if( in_array('0', $employees) ){
37 $employees = HC3_Functions::removeFromArray( $employees, '0' );
38 }
39
40 if( ! $employees ){
41 $errors = array();
42 $errors['employee'] = '__Select Employee__';
43 $return = array( '-referrer-', $errors, TRUE );
44 return $return;
45 }
46
47 $employeeString = HC3_Functions::glueArray( $employees );
48
49 $to = 'new';
50 $toParams = $params;
51 $toParams['employee'] = $employeeString;
52 $to = array( $to, $toParams );
53
54 $return = array( $to, NULL );
55 return $return;
56 }
57 }