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 / schedule / html / view / newoptions.php

newoptions.php in ShiftController Employee Shift Scheduling 4.9.85, at sh4/schedule/html/view/newoptions.php

78 lines 1.8 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_Schedule_Html_View_NewOptions
4 {
5 public function __construct(
6 SH4_New_Acl $newAcl,
7 HC3_Hooks $hooks,
8 HC3_Ui $ui,
9 HC3_Request $request
10 )
11 {
12 $this->self = $hooks->wrap( $this );
13 $this->ui = $ui;
14 $this->request = $request;
15 $this->newAcl = $hooks->wrap( $newAcl );
16
17 $this->allCombosShift = $this->newAcl->findAllCombosShift();
18 $this->allCombosTimeoff = $this->newAcl->findAllCombosTimeoff();
19 }
20
21 public function render()
22 {
23 $out = NULL;
24
25 $options = $this->self->options();
26 if( ! $options ){
27 return $out;
28 }
29
30 $out = $this->ui->makeListInline( $options )
31 ->gutter(2)
32 ;
33
34 return $out;
35 }
36
37 public function options()
38 {
39 $out = array();
40
41 $params = $this->request->getParams();
42
43 $toParams = array();
44 if( array_key_exists('employee', $params) && (count($params['employee']) == 1) ){
45 $toParams['employee'] = $params['employee'][0];
46 }
47
48 if( $this->allCombosShift ){
49 $label = '+' . ' ' . '__Shift__';
50 $to = 'new/shift';
51 $to = array( $to, $toParams );
52 $newShiftLink = $this->ui->makeAhref( $to, $label )
53 ->tag('secondary')
54 ;
55 $out[] = $newShiftLink;
56 }
57
58 if( $this->allCombosTimeoff ){
59 $label = '+' . ' ' . '__Time Off__';
60 $to = 'new/timeoff';
61 $to = array( $to, $toParams );
62 $newTimeoffLink = $this->ui->makeAhref( $to, $label )
63 ->tag('secondary')
64 ;
65 $out[] = $newTimeoffLink;
66 }
67
68 // $label = '+' . ' ' . '__Availability__';
69 // $to = 'new/availability';
70 // $to = array( $to, $toParams );
71 // $newAvailabilityLink = $this->ui->makeAhref( $to, $label )
72 // ->tag('secondary')
73 // ;
74 // $out[] = $newAvailabilityLink;
75
76 return $out;
77 }
78 }