| @@ -472,32 +472,8 @@ | ||
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | $rows = array(); |
| 475 | 475 | |
| 476 | -// link templates to speed things up | |
| 477 | -$toParams = array( | |
| 478 | - 'calendar' => '{CID}', | |
| 479 | - 'date' => '{DATE}' | |
| 480 | -); | |
| 481 | -$thisTo = 'new/shift'; | |
| 482 | -$thisTo = array( $thisTo, $toParams ); | |
| 483 | -$thisHref = $this->uri->makeUrl( $thisTo ); | |
| 484 | - | |
| 485 | -$linkTemplateShift = '<a title="+ __Shift__" class="hc-block hc-theme-tab-link hc-align-center" href="' . $thisHref . '">+ __Shift__</a>'; | |
| 486 | -$linkTemplateShiftMuted = '<a title="+ __Shift__" class="hc-block hc-theme-tab-link hc-align-center hc-muted3" href="' . $thisHref . '">+ __Shift__</a>'; | |
| 487 | - | |
| 488 | -$toParams = array( | |
| 489 | - 'calendar' => '{CID}', | |
| 490 | - 'date' => '{DATE}' | |
| 491 | -); | |
| 492 | -$thisTo = 'new/timeoff'; | |
| 493 | -$thisTo = array( $thisTo, $toParams ); | |
| 494 | -$thisHref = $this->uri->makeUrl( $thisTo ); | |
| 495 | - | |
| 496 | -$linkTemplateTimeoff = '<a title="+ __Time Off__" class="hc-block hc-theme-tab-link hc-align-center" href="' . $thisHref . '">+ __Time Off__</a>'; | |
| 497 | -$linkTemplateTimeoffMuted = '<a title="+ __Time Off__" class="hc-block hc-theme-tab-link hc-align-center hc-muted3" href="' . $thisHref . '">+ __Time Off__</a>'; | |
| 498 | -$isPrintView = $this->request->isPrintView(); | |
| 499 | - | |
| 500 | 476 | foreach( $view_calendars as $id => $calendarView ){ |
| 501 | 477 | $row = array(); |
| 502 | 478 | |
| 503 | 479 | $thisCalendar = $calendars[$id]; |
| @@ -611,12 +587,9 @@ | ||
| 611 | 587 | $toParams['employee'] = $params['employee'][0]; |
| 612 | 588 | } |
| 613 | 589 | } |
| 614 | 590 | |
| 615 | - if( $isPrintView ) $addOk = false; | |
| 616 | - | |
| 617 | 591 | if( $addOk ){ |
| 618 | -/* | |
| 619 | 592 | $to = array( $to, $toParams ); |
| 620 | 593 | |
| 621 | 594 | $link = $this->ui->makeAhref( $to, $label ) |
| 622 | 595 | ->tag('tab-link') |
| @@ -624,25 +597,8 @@ | ||
| 624 | 597 | ; |
| 625 | 598 | if( $today > $date ){ |
| 626 | 599 | $link->tag('muted', 3); |
| 627 | 600 | } |
| 628 | -*/ | |
| 629 | - if( $today > $date ){ | |
| 630 | - if( $thisCalendar->isTimeoff() ){ | |
| 631 | - $link = str_replace( array('{CID}', '{DATE}'), array($id, $date), $linkTemplateTimeoffMuted ); | |
| 632 | - } | |
| 633 | - else { | |
| 634 | - $link = str_replace( array('{CID}', '{DATE}'), array($id, $date), $linkTemplateShiftMuted ); | |
| 635 | - } | |
| 636 | - } | |
| 637 | - else { | |
| 638 | - if( $thisCalendar->isTimeoff() ){ | |
| 639 | - $link = str_replace( array('{CID}', '{DATE}'), array($id, $date), $linkTemplateTimeoff ); | |
| 640 | - } | |
| 641 | - else { | |
| 642 | - $link = str_replace( array('{CID}', '{DATE}'), array($id, $date), $linkTemplateShift ); | |
| 643 | - } | |
| 644 | - } | |
| 645 | 601 | |
| 646 | 602 | $cell[] = $link; |
| 647 | 603 | } |
| 648 | 604 | |
| @@ -737,19 +693,14 @@ | ||
| 737 | 693 | |
| 738 | 694 | $view_employees = array(); |
| 739 | 695 | foreach( $employees as $employee ){ |
| 740 | 696 | $label = $this->employeesPresenter->presentTitle( $employee ); |
| 697 | + | |
| 741 | 698 | $title = htmlspecialchars( $label ); |
| 742 | - | |
| 743 | 699 | $description = $employee->getDescription(); |
| 744 | 700 | if( strlen($description) ){ |
| 745 | - $imgpos = strpos( $description, '<img' ); | |
| 746 | - if( false !== $imgpos ){ | |
| 747 | - $label = $this->ui->makeList( array($label, $description) ); | |
| 748 | - } | |
| 749 | - else { | |
| 750 | - $title .= "\n" . htmlspecialchars( $description ); | |
| 751 | - } | |
| 701 | + $description = htmlspecialchars( $description ); | |
| 702 | + $title .= "\n" . $description; | |
| 752 | 703 | } |
| 753 | 704 | |
| 754 | 705 | $label = $this->ui->makeSpan( $label ) |
| 755 | 706 | ->tag( 'font-size', 4 ) |
| @@ -861,37 +812,13 @@ | ||
| 861 | 812 | } |
| 862 | 813 | |
| 863 | 814 | $rows = array(); |
| 864 | 815 | |
| 865 | -// link templates to speed things up | |
| 866 | -$toParams = array( | |
| 867 | - 'employee' => '{EID}', | |
| 868 | - 'date' => '{DATE}' | |
| 869 | -); | |
| 870 | -$thisTo = 'new/shift'; | |
| 871 | -$thisTo = array( $thisTo, $toParams ); | |
| 872 | -$thisHref = $this->uri->makeUrl( $thisTo ); | |
| 873 | - | |
| 874 | -$linkTemplateShift = '<a title="+ __Shift__" class="hc-block hc-theme-tab-link hc-align-center" href="' . $thisHref . '">+ __Shift__</a>'; | |
| 875 | -$linkTemplateShiftMuted = '<a title="+ __Shift__" class="hc-block hc-theme-tab-link hc-align-center hc-muted3" href="' . $thisHref . '">+ __Shift__</a>'; | |
| 876 | - | |
| 877 | -$toParams = array( | |
| 878 | - 'employee' => '{EID}', | |
| 879 | - 'date' => '{DATE}' | |
| 880 | -); | |
| 881 | -$thisTo = 'new/timeoff'; | |
| 882 | -$thisTo = array( $thisTo, $toParams ); | |
| 883 | -$thisHref = $this->uri->makeUrl( $thisTo ); | |
| 884 | - | |
| 885 | -$linkTemplateTimeoff = '<a title="+ __Time Off__" class="hc-block hc-theme-tab-link hc-align-center" href="' . $thisHref . '">+ __Time Off__</a>'; | |
| 886 | -$linkTemplateTimeoffMuted = '<a title="+ __Time Off__" class="hc-block hc-theme-tab-link hc-align-center hc-muted3" href="' . $thisHref . '">+ __Time Off__</a>'; | |
| 887 | -$isPrintView = $this->request->isPrintView(); | |
| 888 | - | |
| 889 | 816 | foreach( $view_employees as $id => $employeeView ){ |
| 890 | 817 | $row = array(); |
| 891 | 818 | |
| 819 | + $this->shiftsDuration->reset(); | |
| 892 | 820 | if( isset($view_shifts[$id]) ){ |
| 893 | - $this->shiftsDuration->reset(); | |
| 894 | 821 | $counted = 0; |
| 895 | 822 | foreach( $view_shifts[$id] as $date => $dateShifts ){ |
| 896 | 823 | foreach( $dateShifts as $shift ){ |
| 897 | 824 | $shiftCalendar = $shift->getCalendar(); |
| @@ -938,10 +865,10 @@ | ||
| 938 | 865 | |
| 939 | 866 | $links = array(); |
| 940 | 867 | |
| 941 | 868 | $comboId = 0 . '-' . $id; |
| 869 | + | |
| 942 | 870 | if( isset($this->allCombosShift[$comboId]) ){ |
| 943 | -/* | |
| 944 | 871 | $label = '+' . ' ' . '__Shift__'; |
| 945 | 872 | $thisTo = 'new/shift'; |
| 946 | 873 | $thisTo = array( $thisTo, $toParams ); |
| 947 | 874 | $link = $this->ui->makeAhref( $thisTo, $label ) |
| @@ -950,23 +877,12 @@ | ||
| 950 | 877 | ; |
| 951 | 878 | if( $today > $date ){ |
| 952 | 879 | $link->tag('muted', 3); |
| 953 | 880 | } |
| 954 | -*/ | |
| 955 | - if( $today > $date ){ | |
| 956 | - $link = str_replace( array('{EID}', '{DATE}'), array($id, $date), $linkTemplateShiftMuted ); | |
| 957 | - } | |
| 958 | - else { | |
| 959 | - $link = str_replace( array('{EID}', '{DATE}'), array($id, $date), $linkTemplateShift ); | |
| 960 | - } | |
| 961 | - | |
| 962 | - if( ! $isPrintView ){ | |
| 963 | - $cell[] = $link; | |
| 964 | - } | |
| 881 | + $links[] = $link; | |
| 965 | 882 | } |
| 966 | 883 | |
| 967 | 884 | if( isset($this->allCombosTimeoff[$comboId]) ){ |
| 968 | -/* | |
| 969 | 885 | $label = '+' . ' ' . '__Time Off__'; |
| 970 | 886 | $thisTo = 'new/timeoff'; |
| 971 | 887 | $thisTo = array( $thisTo, $toParams ); |
| 972 | 888 | $link = $this->ui->makeAhref( $thisTo, $label ) |
| @@ -975,27 +891,14 @@ | ||
| 975 | 891 | ; |
| 976 | 892 | if( $today > $date ){ |
| 977 | 893 | $link->tag('muted', 3); |
| 978 | 894 | } |
| 979 | -*/ | |
| 980 | - | |
| 981 | - if( $today > $date ){ | |
| 982 | - $link = str_replace( array('{EID}', '{DATE}'), array($id, $date), $linkTemplateTimeoffMuted ); | |
| 983 | - } | |
| 984 | - else { | |
| 985 | - $link = str_replace( array('{EID}', '{DATE}'), array($id, $date), $linkTemplateTimeoff ); | |
| 986 | - } | |
| 987 | - | |
| 988 | - if( ! $isPrintView ){ | |
| 989 | - $cell[] = $link; | |
| 990 | - } | |
| 895 | + $links[] = $link; | |
| 991 | 896 | } |
| 992 | 897 | |
| 993 | - if( ! $isPrintView ){ | |
| 994 | - if( $links ){ | |
| 995 | - $links = $this->ui->makeList( $links )->gutter(0); | |
| 996 | - $cell[] = $links; | |
| 997 | - } | |
| 898 | + if( $links ){ | |
| 899 | + $links = $this->ui->makeList( $links )->gutter(0); | |
| 900 | + $cell[] = $links; | |
| 998 | 901 | } |
| 999 | 902 | |
| 1000 | 903 | $cell = $this->ui->makeList( $cell ) |
| 1001 | 904 | ->gutter(1) |