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/day.php +3 -114 4.9.774.9.66 View file →
@@ -23,9 +23,8 @@
23 23 SH4_Schedule_Html_Widget_DayGrid $widgetDayGrid,
24 24
25 25 SH4_Shifts_Duration $shiftsDuration,
26 26 SH4_Shifts_View_Widget $widget,
27 - SH4_Calendars_Query $calendarsQuery,
28 27 SH4_Calendars_Presenter $calendarsPresenter,
29 28 SH4_Employees_Presenter $employeesPresenter,
30 29 SH4_Schedule_Html_View_Common $common,
31 30 SH4_Shifts_View_Common $shiftsCommon
@@ -43,9 +42,8 @@
43 42 $this->newAcl = $hooks->wrap( $newAcl );
44 43
45 44 $this->widgetDayGrid = $hooks->wrap( $widgetDayGrid );
46 45 $this->shiftsDuration = $hooks->wrap( $shiftsDuration );
47 - $this->calendarsQuery = $hooks->wrap( $calendarsQuery );
48 46 $this->calendarsPresenter = $hooks->wrap( $calendarsPresenter );
49 47 $this->employeesPresenter = $hooks->wrap( $employeesPresenter );
50 48
51 49 $this->widget = $hooks->wrap( $widget );
@@ -557,19 +555,14 @@
557 555
558 556 $viewEmployees = array();
559 557 foreach( $employees as $employee ){
560 558 $label = $this->employeesPresenter->presentTitle( $employee );
559 +
561 560 $title = htmlspecialchars( $label );
562 -
563 561 $description = $employee->getDescription();
564 562 if( strlen($description) ){
565 - $imgpos = strpos( $description, '<img' );
566 - if( false !== $imgpos ){
567 - $label = $this->ui->makeList( array($label, $description) );
568 - }
569 - else {
570 - $title .= "\n" . htmlspecialchars( $description );
571 - }
563 + $description = htmlspecialchars( $description );
564 + $title .= "\n" . $description;
572 565 }
573 566
574 567 $label = $this->ui->makeSpan( $label )
575 568 ->tag( 'font-size', 4 )
@@ -711,108 +704,8 @@
711 704 $rows[] = $row;
712 705 }
713 706
714 707
715 - /* append calendars summary */
716 - $appendCalendars = $this->settings->get('datetime_summary_by_calendar');
717 - if( $appendCalendars ){
718 - foreach( $shifts as $shift ){
719 - $calendar = $shift->getCalendar();
720 - $calendarId = $calendar ? $calendar->getId() : 0;
721 - if( ! $calendarId ) continue;
722 - $calendarIds[ $calendarId ] = $calendarId;
723 - }
724 -
725 - $calendars = $this->calendarsQuery->findManyById( $calendarIds );
726 -
727 - $shiftsByCalendar = $shiftsByDate = array();
728 - foreach( $shifts as $shift ){
729 - $thisCalendar = $shift->getCalendar();
730 - if( ! $thisCalendar ) continue;
731 - $shiftId = $shift->getId();
732 - $thisCalendarId = $thisCalendar->getId();
733 - $shiftsByCalendar[ $thisCalendarId ][ $shiftId ] = $shift;
734 -
735 - $start = $shift->getStart();
736 - $end = $shift->getEnd();
737 -
738 - $startDayTime = substr($start, 8, 4);
739 - $endDayTime = substr($end, 8, 4);
740 - $shiftAllDay = ( (0 == $startDayTime) && (0 == $endDayTime) ) ? TRUE : FALSE;
741 -
742 - $this->t->setDateTimeDb( $end )->modify('-1 second');
743 - $shiftEndDate = $this->t->formatDateDb();
744 -
745 - $this->t->setDateTimeDb( $start );
746 - $shiftStartDate = $this->t->formatDateDb();
747 -
748 - $rexDate = $shiftStartDate;
749 - while( $rexDate <= $shiftEndDate ){
750 - if( in_array($rexDate, $dates) ){
751 - $shiftsByDate[ $rexDate ][ $shiftId ] = $shift;
752 - }
753 -
754 - if( ! $shiftAllDay ){
755 - break;
756 - }
757 - $this->t->modify( '+1 day' );
758 - $rexDate = $this->t->formatDateDb();
759 - }
760 - }
761 -
762 - foreach( $calendars as $calendarId => $calendar ){
763 - $row = array();
764 -
765 - $calendarView = $this->calendarsPresenter->presentTitle( $calendar );
766 - $title = htmlspecialchars( $calendar->getTitle() );
767 - $calendarView = $this->ui->makeSpan( $calendarView )
768 - ->addAttr( 'title', $title )
769 - ;
770 -
771 - $this->shiftsDuration->reset();
772 - foreach( $shiftsByCalendar[$calendarId] as $shift ){
773 - $this->shiftsDuration->add( $shift );
774 - }
775 -
776 - $outReport = $this->common->renderReport( $this->shiftsDuration, FALSE );
777 - $outReport = $this->ui->makeSpan( $outReport )
778 - ->tag('font-size', 2)
779 - ;
780 - $calendarView = $this->ui->makeList( array($calendarView, $outReport) )
781 - ->gutter(1)
782 - ;
783 -
784 - $calendarView = $this->ui->makeBlock( $calendarView )
785 - ->tag('padding', 2)
786 - ->tag('nowrap')
787 - ;
788 - $row[] = $calendarView;
789 -
790 - foreach( $dates as $date ){
791 - $cell = '';
792 - if( isset($shiftsByDate[$date]) ){
793 - $thisShifts = array_intersect_key( $shiftsByDate[$date], $shiftsByCalendar[$calendarId] );
794 - if( $thisShifts ){
795 - $this->shiftsDuration->reset();
796 - foreach( $thisShifts as $shift ){
797 - $this->shiftsDuration->add( $shift );
798 - }
799 - $outReport = $this->common->renderReport( $this->shiftsDuration, FALSE );
800 - $outReport = $this->ui->makeSpan( $outReport )
801 - ->tag('font-size', 2)
802 - ;
803 - $outReport = $this->ui->makeBlock( $outReport )
804 - ->tag('align', 'center')
805 - ;
806 - $cell = $outReport;
807 - }
808 - }
809 - $row[] = $cell;
810 - }
811 - $rows[] = $row;
812 - }
813 - }
814 -
815 708 $thisOut[] = $this->ui->makeTable( $header, $rows, FALSE )
816 709 ->gutter(0)
817 710 ->setBordered( $this->borderColor )
818 711 // ->setSegments( $weekSegments )
@@ -865,10 +758,8 @@
865 758 else {
866 759 $this->t->modify('+1 day');
867 760 }
868 761 $dayEnd = $this->t->formatDateTimeDb();
869 -// echo "DAY END $dayEnd<br>";
870 -// exit;
871 762
872 763 // check if we need to extend ranges to show overtime shifts
873 764 if( $shifts ){
874 765 $this->t->setDateDb( $startDate )->modify('+1 day');
@@ -877,11 +768,9 @@
877 768 $this->t->modify('+1 day');
878 769 $maxCheckEnd = $this->t->formatDateTimeDb();
879 770
880 771 foreach( $shifts as $shift ){
881 - $thisStart = $shift->getStart();
882 772 $thisEnd = $shift->getEnd();
883 - // if( ($thisStart < $dayEnd) && ($thisEnd > $minCheckEnd) && ($thisEnd < $maxCheckEnd) ){
884 773 if( ($thisEnd > $minCheckEnd) && ($thisEnd < $maxCheckEnd) ){
885 774 if( $thisEnd > $dayEnd ){
886 775 $dayEnd = $thisEnd;
887 776 }