| @@ -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 | { |
| @@ -215,13 +210,10 @@ | ||
| 215 | 210 | $selectedView = array(); |
| 216 | 211 | foreach( $selectedEmployees as $e ){ |
| 217 | 212 | $thisParams = $toParams; |
| 218 | 213 | |
| 219 | - $eView = $this->employeePresenter->presentTitle( $e ); | |
| 220 | - $eView = $this->ui->makeListInline( array('×', $eView) ) | |
| 221 | - ->gutter(1) | |
| 222 | - ->tag('nowrap') | |
| 223 | - ; | |
| 214 | + $eView = $e->getTitle(); | |
| 215 | + $eView = $this->ui->makeListInline( array('×', $eView) )->gutter(1); | |
| 224 | 216 | |
| 225 | 217 | $thisParams['employee'] = HC3_Functions::removeFromArray( $thisParams['employee'], $e->getId() ); |
| 226 | 218 | if( ! $thisParams['employee'] ){ |
| 227 | 219 | $thisParams['employee'] = array('x'); |
| @@ -240,9 +232,9 @@ | ||
| 240 | 232 | foreach( $all as $e ){ |
| 241 | 233 | $thisParams = $toParams; |
| 242 | 234 | |
| 243 | 235 | $thisParams['employee'][] = $e->getId(); |
| 244 | - $label = $this->employeePresenter->presentTitle( $e ); | |
| 236 | + $label = $e->getTitle(); | |
| 245 | 237 | $eView = $this->ui->makeAhref( array($slug, $thisParams), $label ) |
| 246 | 238 | ->tag('tab-link') |
| 247 | 239 | ; |
| 248 | 240 | $toSelectView[] = $eView; |
| @@ -354,13 +346,10 @@ | ||
| 354 | 346 | if( $selectedCalendars ){ |
| 355 | 347 | foreach( $selectedCalendars as $e ){ |
| 356 | 348 | $thisParams = $toParams; |
| 357 | 349 | |
| 358 | - $eView = $this->calendarPresenter->presentTitle( $e ); | |
| 359 | - $eView = $this->ui->makeListInline( array('×', $eView) ) | |
| 360 | - ->gutter(1) | |
| 361 | - ->tag('nowrap') | |
| 362 | - ; | |
| 350 | + $eView = $e->getTitle(); | |
| 351 | + $eView = $this->ui->makeListInline( array('×', $eView) )->gutter(1); | |
| 363 | 352 | |
| 364 | 353 | $thisParams['calendar'] = HC3_Functions::removeFromArray( $thisParams['calendar'], $e->getId() ); |
| 365 | 354 | if( ! $thisParams['calendar'] ){ |
| 366 | 355 | $thisParams['calendar'] = array('x'); |
| @@ -379,9 +368,12 @@ | ||
| 379 | 368 | foreach( $all as $e ){ |
| 380 | 369 | $thisParams = $toParams; |
| 381 | 370 | $thisParams['calendar'][] = $e->getId(); |
| 382 | 371 | |
| 383 | - $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 | + | |
| 384 | 376 | $eView = $this->ui->makeAhref( array($slug, $thisParams), $label ) |
| 385 | 377 | ->tag('tab-link') |
| 386 | 378 | ; |
| 387 | 379 | |