PluginProbe
ShiftController Employee Shift Scheduling / 2.2.3
ShiftController Employee Shift Scheduling v2.2.3
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 / application / modules / wall / views / _shift.php

_shift.php in ShiftController Employee Shift Scheduling 2.2.3, at application/modules/wall/views/_shift.php

163 lines 3.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if( ! isset($wide_view) )
3 {
4 $wide_view = FALSE;
5 }
6
7 $this->hc_time->setNow();
8 $today = $this->hc_time->formatDate_Db();
9
10 /* CLASS */
11 $class = array();
12 $class[] = 'alert';
13 $class[] = 'alert-condensed';
14
15 if( $sh->user_id )
16 {
17 $class[] = ( $sh->status == SHIFT_MODEL::STATUS_ACTIVE ) ? 'alert-success' : 'alert-warning';
18 }
19 else
20 {
21 $class[] = 'alert-danger';
22 }
23 $class = join( ' ', $class );
24
25 $trade_label = '';
26 $trade_icon = '';
27 if( $sh->user_id && $sh->has_trade && $this->hc_modules->exists('shift_trades') )
28 {
29 $trade_label = lang('trade_request');
30 $trade_icon = '<i class="fa fa-exchange"></i>';
31 }
32
33 /* TITLES */
34 $title = array();
35
36 /* TITLE - TIME */
37 if( in_array('time', $titles) )
38 {
39 $time_key = $sh->start . '-' . $sh->end;
40 $time_title = isset($shift_template_titles[$time_key]) ? $shift_template_titles[$time_key] : $this->hc_time->formatTimeOfDay($sh->start) . ' - ' . $this->hc_time->formatTimeOfDay($sh->end);
41 // $time_title = '<i class="fa fa-clock-o"></i> ' . $time_title;
42 $time_title = $time_title;
43 $title['time'] = $time_title;
44 }
45
46 /* TITLE - LOCATION */
47 if( in_array('location', $titles) )
48 {
49 $icon = ( $trade_icon && (! in_array('staff', $titles)) ) ? $trade_icon : '<i class="fa fa-home"></i>';
50 $title['location'] = $icon . ' ' . $sh->location_name;
51 }
52
53 /* TITLE - STAFF */
54 if( in_array('staff', $titles) )
55 {
56 /* TITLE - STAFF */
57 $icon = $trade_icon ? $trade_icon : '<i class="fa fa-user"></i>';
58 if( $sh->user_id && isset($staffs[$sh->user_id]) )
59 {
60 $title['staff'] = $icon . ' ' . $staffs[$sh->user_id]->full_name();
61 }
62 elseif( count($titles) <= 1 )
63 {
64 $title['staff'] = $icon . ' ' . '________';
65 }
66 else
67 {
68 $title['staff'] = '';
69 }
70 }
71
72 $final_title = array();
73 $final_title[] = '<ul class="list-unstyled">';
74
75 if( isset($title['location']) && isset($title['staff']) )
76 {
77 $final_title[] = '<li>';
78 $final_title[] = $title['location'];
79 $final_title[] = '</li>';
80 }
81
82 if( $wide_view && ( isset($title['staff']) OR isset($title['location']) ) )
83 {
84 $final_title[] = '<li>';
85 $final_title[] = '<ul class="list-inline">';
86
87 list( $this_title_title, $this_title_icon ) = Hc_lib::parse_icon( $title['time'] );
88 $final_title[] = '<li class="squeeze-in pull-left" style="width: 50%;" title="' . $this_title_title . '">';
89 $final_title[] = $title['time'];
90 $final_title[] = '</li>';
91
92 $this_title = '&nbsp;';
93 if( isset($title['staff']) )
94 $this_title = $title['staff'];
95 elseif( isset($title['location']) )
96 $this_title = $title['location'];
97 list( $this_title_title, $this_title_icon ) = Hc_lib::parse_icon( $this_title );
98 if( $trade_label )
99 $this_title_title = $trade_label;
100 $final_title[] = '<li class="squeeze-in pull-right" style="width: 50%;" title="' . $this_title_title . '">';
101 $final_title[] = $this_title;
102 $final_title[] = '</li>';
103
104
105 $final_title[] = '</ul>';
106 $final_title[] = '<div class="clearfix"></div>';
107 $final_title[] = '</li>';
108 }
109 else
110 {
111 if( isset($title['time']) )
112 {
113 $final_title[] = '<li>';
114 $final_title[] = $title['time'];
115 $final_title[] = '</li>';
116 }
117 if( isset($title['staff']) )
118 {
119 $final_title[] = '<li>';
120 $final_title[] = $title['staff'];
121 $final_title[] = '</li>';
122 }
123 elseif( isset($title['location']) )
124 {
125 $final_title[] = '<li>';
126 $final_title[] = $title['location'];
127 $final_title[] = '</li>';
128 }
129 }
130 $final_title[] = '</ul>';
131
132 $title = join( '', $final_title );
133 ?>
134 <div class="<?php echo $class; ?>">
135 <?php echo $title; ?>
136
137 <?php
138 if(
139 ($today <= $sh->date) &&
140 $this->auth &&
141 $this->auth->user()
142 ) :
143 ?>
144 <?php
145 if(
146 (
147 (! $sh->user_id) &&
148 $this->app_conf->get('staff_pick_shifts')
149 )
150 OR
151 (
152 $sh->has_trade &&
153 $this->hc_modules->exists('shift_trades')
154 )
155 ) :
156 ?>
157 <a class="btn btn-default btn-sm" href="<?php echo ci_site_url( array('staff/shifts', 'pickup', $sh->id) ); ?>">
158 <i class="fa fa-check text-success"></i> <?php echo lang('shift_pick_up'); ?>
159 </a>
160 <?php endif; ?>
161
162 <?php endif; ?>
163 </div>