| @@ -169,9 +169,9 @@ | ||
| 169 | 169 | { |
| 170 | 170 | return $employeeView; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - public function renderReport( $shiftsDuration, $alignRight = true, $isVert = false ) | |
| 173 | + public function renderReport( $shiftsDuration, $alignRight = TRUE ) | |
| 174 | 174 | { |
| 175 | 175 | $return = NULL; |
| 176 | 176 | |
| 177 | 177 | $hide = $this->settings->get('datetime_hide_schedule_reports'); |
| @@ -200,20 +200,20 @@ | ||
| 200 | 200 | $return = array(); |
| 201 | 201 | // $return[] = $this->ui->makeBlockInline( $shiftsDuration->getQty() ) |
| 202 | 202 | // ->addAttr( 'title', '__Number Of Shifts__' ) |
| 203 | 203 | // ; |
| 204 | - $thisView = $shiftsDuration->formatDuration($duration); | |
| 205 | - $return[] = $this->ui->makeSpan( $thisView ) | |
| 206 | - ->addAttr( 'title', '__Hours__' . ': ' . $thisView ) | |
| 204 | + $return[] = $this->ui->makeSpan( $shiftsDuration->formatDuration($duration) ) | |
| 205 | + ->addAttr( 'title', '__Hours__' ) | |
| 207 | 206 | ; |
| 208 | 207 | $return[] = $this->ui->makeBlockInline( '(' . $qty . ')' ) |
| 209 | - ->addAttr( 'title', '__Shifts__' . ': ' . $qty ) | |
| 208 | + ->addAttr( 'title', '__Shifts__' ) | |
| 210 | 209 | ->tag('muted') |
| 211 | 210 | ->tag('font-size', 2) |
| 212 | 211 | ; |
| 212 | + $return = $this->ui->makeListInline( $return ) | |
| 213 | + ->gutter(1) | |
| 214 | + ; | |
| 213 | 215 | |
| 214 | - $return = $isVert ? $this->ui->makeList( $return )->gutter(1) : $this->ui->makeListInline( $return )->gutter(1); | |
| 215 | - | |
| 216 | 216 | if( $qtyTimeoff ){ |
| 217 | 217 | $timeoffReturn = array(); |
| 218 | 218 | $timeoffReturn[] = $this->ui->makeSpan( $shiftsDuration->formatDuration($durationTimeoff) ) |
| 219 | 219 | ->addAttr( 'title', '__Hours__' ) |
| @@ -226,23 +226,17 @@ | ||
| 226 | 226 | $timeoffReturn = $this->ui->makeListInline( $timeoffReturn ) |
| 227 | 227 | ->gutter(1) |
| 228 | 228 | ; |
| 229 | 229 | |
| 230 | - $return = $isVert ? $this->ui->makeList( array($return, $timeoffReturn) )->gutter(1) : $this->ui->makeListInline( array($return, $timeoffReturn) )->gutter(1); | |
| 230 | + $return = $this->ui->makeListInline( array($return, $timeoffReturn) ) | |
| 231 | + ->gutter(1) | |
| 232 | + ; | |
| 231 | 233 | } |
| 232 | 234 | |
| 233 | - if( $isVert ){ | |
| 234 | - $return = $this->ui->makeBlock( $return ) | |
| 235 | - // ->tag('border') | |
| 236 | - ->tag('padding', 1 ) | |
| 237 | - ; | |
| 238 | - } | |
| 239 | - else { | |
| 240 | - $return = $this->ui->makeBlockInline( $return ) | |
| 241 | - ->tag('border') | |
| 242 | - ->tag('padding', 1 ) | |
| 243 | - ; | |
| 244 | - } | |
| 235 | + $return = $this->ui->makeBlockInline( $return ) | |
| 236 | + ->tag('border') | |
| 237 | + ->tag('padding', 1 ) | |
| 238 | + ; | |
| 245 | 239 | if( $alignRight ){ |
| 246 | 240 | $return = $this->ui->makeBlock( $return ) |
| 247 | 241 | ->tag('align', 'right') |
| 248 | 242 | ; |
| @@ -761,11 +755,11 @@ | ||
| 761 | 755 | $this->request->setParam('start', $startDate); |
| 762 | 756 | $endDate = $this->t->formatDateDb(); |
| 763 | 757 | $this->request->setParam('end', $endDate); |
| 764 | 758 | |
| 765 | - $daysToShow = isset( SH4_Schedule_Html_View_Day::$daysToShow ) ? SH4_Schedule_Html_View_Day::$daysToShow : 1; | |
| 766 | - if( $daysToShow > 1 ){ | |
| 767 | - $this->t->modify( '+' . ($daysToShow - 1) . ' days' ); | |
| 759 | + $daysToShow = isset( SH4_Schedule_Html_View_Day::$daysToShow ) ? SH4_Schedule_Html_View_Day::$daysToShow : 7; | |
| 760 | + if( $daysToShow ){ | |
| 761 | + $this->t->modify( '+' . $daysToShow . ' days' ); | |
| 768 | 762 | } |
| 769 | 763 | $end = $this->t->setEndDay()->formatDateTimeDb(); |
| 770 | 764 | break; |
| 771 | 765 | |
| @@ -868,8 +862,12 @@ | ||
| 868 | 862 | foreach( array_keys($return) as $id ){ |
| 869 | 863 | $shift = $return[$id]; |
| 870 | 864 | |
| 871 | 865 | $calendar = $shift->getCalendar(); |
| 866 | + // if( ! array_key_exists($calendar->getId(), $calendars) ){ | |
| 867 | + // unset( $return[$id] ); | |
| 868 | + // continue; | |
| 869 | + // } | |
| 872 | 870 | if( $calendarFilter && (! in_array($calendar->getId(), $calendarFilter)) ){ |
| 873 | 871 | unset( $return[$id] ); |
| 874 | 872 | continue; |
| 875 | 873 | } |
| @@ -874,8 +872,13 @@ | ||
| 874 | 872 | continue; |
| 875 | 873 | } |
| 876 | 874 | |
| 877 | 875 | $employee = $shift->getEmployee(); |
| 876 | + // if( ! array_key_exists($employee->getId(), $employees) ){ | |
| 877 | + // unset( $return[$id] ); | |
| 878 | + // continue; | |
| 879 | + // } | |
| 880 | + | |
| 878 | 881 | $employeeId = $employee->getId(); |
| 879 | 882 | |
| 880 | 883 | if( $employeeFilter ){ |
| 881 | 884 | // any assigned |
| @@ -946,86 +949,8 @@ | ||
| 946 | 949 | unset( $return[$id] ); |
| 947 | 950 | } |
| 948 | 951 | } |
| 949 | 952 | } |
| 950 | - | |
| 951 | - // t1: array of start/end time like this: 32400-576000_36000-64800 | |
| 952 | - if (isset($params['t'])) { | |
| 953 | - $tParam = $params['t']; | |
| 954 | - | |
| 955 | - if (false !== strpos($tParam, '_')) { | |
| 956 | - $tParam = explode('_', $tParam); | |
| 957 | - } else { | |
| 958 | - $tParam = [$tParam]; | |
| 959 | - } | |
| 960 | - | |
| 961 | - foreach (array_keys($tParam) as $ii) { | |
| 962 | - $tParam[$ii] = explode('-', $tParam[$ii]); | |
| 963 | - $tParam[$ii] = array_map('intval', $tParam[$ii]); | |
| 964 | - } | |
| 965 | - | |
| 966 | - foreach (array_keys($return) as $id) { | |
| 967 | - $startTime = (int) $return[$id]->getStartInDay(); | |
| 968 | - $endTime = (int) $return[$id]->getEndInDay(); | |
| 969 | - | |
| 970 | - $ok = false; | |
| 971 | - reset($tParam); | |
| 972 | - foreach ($tParam as $p) { | |
| 973 | - if (($p[0] == $startTime) && ($p[1] == $endTime)) { | |
| 974 | - $ok = true; | |
| 975 | - break; | |
| 976 | - } | |
| 977 | - } | |
| 978 | - | |
| 979 | - if (!$ok) { | |
| 980 | - unset($return[$id]); | |
| 981 | - continue; | |
| 982 | - } | |
| 983 | - } | |
| 984 | - } | |
| 985 | - | |
| 986 | - // t1 or t2 params: start/end time | |
| 987 | - if (isset($params['t1']) or isset($params['t2'])) { | |
| 988 | - $t1 = $t2 = array(); | |
| 989 | - | |
| 990 | - if (isset($params['t1'])) { | |
| 991 | - $t1 = $params['t1']; | |
| 992 | - if (false !== strpos($t1, '-')) { | |
| 993 | - $t1 = explode('-', $t1); | |
| 994 | - } else { | |
| 995 | - $t1 = [$t1]; | |
| 996 | - } | |
| 997 | - $t1 = array_map('intval', $t1); | |
| 998 | - } | |
| 999 | - | |
| 1000 | - if (isset($params['t2'])) { | |
| 1001 | - $t2 = $params['t2']; | |
| 1002 | - if (false !== strpos($t2, '-')) { | |
| 1003 | - $t2 = explode('-', $t2); | |
| 1004 | - } else { | |
| 1005 | - $t2 = [$t2]; | |
| 1006 | - } | |
| 1007 | - $t2 = array_map('intval', $t2); | |
| 1008 | - } | |
| 1009 | - | |
| 1010 | - foreach (array_keys($return) as $id) { | |
| 1011 | - if ($t1) { | |
| 1012 | - $startTime = (int) $return[$id]->getStartInDay(); | |
| 1013 | - if (!in_array($startTime, $t1)) { | |
| 1014 | - unset($return[$id]); | |
| 1015 | - continue; | |
| 1016 | - } | |
| 1017 | - } | |
| 1018 | - | |
| 1019 | - if ($t2) { | |
| 1020 | - $endTime = (int) $return[$id]->getEndInDay(); | |
| 1021 | - if (!in_array($endTime, $t2)) { | |
| 1022 | - unset($return[$id]); | |
| 1023 | - continue; | |
| 1024 | - } | |
| 1025 | - } | |
| 1026 | - } | |
| 1027 | - } | |
| 1028 | 953 | |
| 1029 | 954 | $return = $this->self->filterShifts( $return ); |
| 1030 | 955 | $cache = $return; |
| 1031 | 956 | return $return; |