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 / view / dispatcher.php

dispatcher.php in ShiftController Employee Shift Scheduling 4.9.85, at sh4/new/view/dispatcher.php

61 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_View_Dispatcher
4 {
5 public function __construct(
6 HC3_Hooks $hooks,
7
8 HC3_Request $request,
9
10 SH4_App_Query $appQuery,
11 SH4_Employees_Query $employeesQuery,
12 SH4_New_Query $newQuery
13 )
14 {
15 $this->self = $hooks->wrap( $this );
16 $this->request = $request;
17
18 $this->appQuery = $hooks->wrap( $appQuery );
19 $this->employeesQuery = $hooks->wrap( $employeesQuery );
20 $this->newQuery = $hooks->wrap( $newQuery );
21
22 }
23
24 public function render()
25 {
26 $to = $this->getTo();
27 $params = $this->request->getParams();
28 if( $params ){
29 $to = array( $to, $params );
30 }
31
32 $return = array( $to, NULL );
33 return $return;
34 }
35
36 protected function getTo()
37 {
38 $return = NULL;
39 $params = $this->request->getParams();
40
41 if( ! (array_key_exists('calendar', $params) && array_key_exists('shifttype', $params)) ){
42 $return = 'new/calendar';
43 return $return;
44 }
45
46 if( ! array_key_exists('date', $params) ){
47 $return = 'new/date';
48 return $return;
49 }
50
51 if( ! array_key_exists('employee', $params) ){
52 $return = 'new/employee';
53 return $return;
54 }
55
56 if( ! $return ){
57 $return = 'new/confirm';
58 return $return;
59 }
60 }
61 }