PluginProbe
ShiftController Employee Shift Scheduling / 4.9.66
ShiftController Employee Shift Scheduling v4.9.66
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
← All changes | sh4/schedule/html/view/controloptions.php +20 -25 4.9.954.9.66 View file →
@@ -22,11 +22,8 @@
22 22 HC3_Time $t,
23 23 HC3_Auth $auth,
24 24 HC3_Settings $settings,
25 25
26 - SH4_Calendars_Presenter $calendarPresenter,
27 - SH4_Employees_Presenter $employeePresenter,
28 -
29 26 SH4_Employees_Query $employeesQuery,
30 27 SH4_Schedule_Html_View_Common $viewCommon
31 28 )
32 29 {
@@ -39,10 +36,8 @@
39 36 $this->settings = $hooks->wrap( $settings );
40 37
41 38 $this->viewCommon = $hooks->wrap( $viewCommon );
42 39 $this->employeesQuery = $hooks->wrap( $employeesQuery );
43 - $this->calendarPresenter = $hooks->wrap( $calendarPresenter );
44 - $this->employeePresenter = $hooks->wrap( $employeePresenter );
45 40 }
46 41
47 42 public function render()
48 43 {
@@ -100,16 +95,8 @@
100 95 $to = $this->uriAction->makeUrl( array($slug, $thisParams) );
101 96 $options['download'] = $this->ui->makeAhref( $to, '__Download__' )
102 97 ->tag('tab-link')
103 98 ;
104 -
105 - $thisParams = $toParams;
106 - $thisParams['download'] = 1;
107 - $thisParams['report'] = 1;
108 - $to = $this->uriAction->makeUrl( array($slug, $thisParams) );
109 - $options['downloadreport'] = $this->ui->makeAhref( $to, '__Download report__' )
110 - ->tag('tab-link')
111 - ;
112 99 }
113 100
114 101 if( ! array_intersect(array('print', 'all'), $hideui) ){
115 102 $thisParams = $toParams;
@@ -223,13 +210,10 @@
223 210 $selectedView = array();
224 211 foreach( $selectedEmployees as $e ){
225 212 $thisParams = $toParams;
226 213
227 - $eView = $this->employeePresenter->presentTitle( $e );
228 - $eView = $this->ui->makeListInline( array('&times', $eView) )
229 - ->gutter(1)
230 - ->tag('nowrap')
231 - ;
214 + $eView = $e->getTitle();
215 + $eView = $this->ui->makeListInline( array('&times', $eView) )->gutter(1);
232 216
233 217 $thisParams['employee'] = HC3_Functions::removeFromArray( $thisParams['employee'], $e->getId() );
234 218 if( ! $thisParams['employee'] ){
235 219 $thisParams['employee'] = array('x');
@@ -248,13 +232,24 @@
248 232 foreach( $all as $e ){
249 233 $thisParams = $toParams;
250 234
251 235 $thisParams['employee'][] = $e->getId();
252 - $label = $this->employeePresenter->presentTitle( $e );
236 + $label = $e->getTitle();
253 237 $eView = $this->ui->makeAhref( array($slug, $thisParams), $label )
254 238 ->tag('tab-link')
255 239 ;
256 240 $toSelectView[] = $eView;
241 +
242 + // if( 0 == $e->getId() ){
243 + // $thisParams = $toParams;
244 + // $thisParams['employee'][] = $assignedShiftEmployee->getId();
245 +
246 + // $label = $assignedShiftEmployee->getTitle();
247 + // $eView = $this->ui->makeAhref( array($slug, $thisParams), $label )
248 + // ->tag('tab-link')
249 + // ;
250 + // $toSelectView[] = $eView;
251 + // }
257 252 }
258 253
259 254 if( ! ($selectedEmployees OR $toSelectView) ){
260 255 return $return;
@@ -351,13 +346,10 @@
351 346 if( $selectedCalendars ){
352 347 foreach( $selectedCalendars as $e ){
353 348 $thisParams = $toParams;
354 349
355 - $eView = $this->calendarPresenter->presentTitle( $e );
356 - $eView = $this->ui->makeListInline( array('&times', $eView) )
357 - ->gutter(1)
358 - ->tag('nowrap')
359 - ;
350 + $eView = $e->getTitle();
351 + $eView = $this->ui->makeListInline( array('&times', $eView) )->gutter(1);
360 352
361 353 $thisParams['calendar'] = HC3_Functions::removeFromArray( $thisParams['calendar'], $e->getId() );
362 354 if( ! $thisParams['calendar'] ){
363 355 $thisParams['calendar'] = array('x');
@@ -376,9 +368,12 @@
376 368 foreach( $all as $e ){
377 369 $thisParams = $toParams;
378 370 $thisParams['calendar'][] = $e->getId();
379 371
380 - $label = $this->calendarPresenter->presentTitle( $e );
372 + $label = $e->getTitle();
373 + $color = $this->ui->makeBlockInline(' ')->paddingX(1)->tag('bgcolor', $e->getColor() );
374 + $label = $this->ui->makeListInline( array($color, $label) )->gutter(1);
375 +
381 376 $eView = $this->ui->makeAhref( array($slug, $thisParams), $label )
382 377 ->tag('tab-link')
383 378 ;
384 379