summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-10-08 09:18:04 +0200
committermsquare <msquare@notrademark.de>2016-10-08 09:18:04 +0200
commit1d4811cca51a00de27328d5608dbc23e46854297 (patch)
tree3e8f088e9b72ff32acacd57e078dddc70ff1cac8
parentc48335e702361eec3818a6b1021d443fee9037f5 (diff)
remove unused code
-rw-r--r--includes/controller/rooms_controller.php2
-rw-r--r--includes/view/ShiftCalendarRenderer.php8
-rw-r--r--includes/view/ShiftsFilterRenderer.php1
3 files changed, 4 insertions, 7 deletions
diff --git a/includes/controller/rooms_controller.php b/includes/controller/rooms_controller.php
index 4573409a..0e8560d5 100644
--- a/includes/controller/rooms_controller.php
+++ b/includes/controller/rooms_controller.php
@@ -55,8 +55,6 @@ function room_controller() {
* Dispatch different room actions.
*/
function rooms_controller() {
- global $privileges;
-
if (! isset($_REQUEST['action'])) {
$_REQUEST['action'] = 'list';
}
diff --git a/includes/view/ShiftCalendarRenderer.php b/includes/view/ShiftCalendarRenderer.php
index 04ecdf61..ab13a5f3 100644
--- a/includes/view/ShiftCalendarRenderer.php
+++ b/includes/view/ShiftCalendarRenderer.php
@@ -44,7 +44,7 @@ class ShiftCalendarRenderer {
return $shifts_table;
}
- private function initTableBody($rooms, $slotSizes, $first_block_start_time, $blocks_per_slot) {
+ private function initTableBody($slotSizes, $first_block_start_time, $blocks_per_slot) {
// Slot sizes plus 1 for the time
$columns_needed = array_sum($slotSizes) + 1;
$table_line = array_fill(0, $columns_needed, ShiftCalendarRenderer::EMPTY_CELL);
@@ -67,7 +67,7 @@ class ShiftCalendarRenderer {
private function calcRoomSlots($rooms, $slotSizes) {
$result = [];
$slot = 1; // 1 for the time
- foreach ($rooms as $room_id => $room_name) {
+ foreach (array_keys($rooms) as $room_id) {
$result[$room_id] = $slot;
$slot += $slotSizes[$room_id];
}
@@ -81,7 +81,7 @@ class ShiftCalendarRenderer {
}
private function renderShift($shift) {
- global $privileges, $user;
+ global $privileges;
$collides = $this->collides();
$is_free = false;
@@ -206,7 +206,7 @@ class ShiftCalendarRenderer {
}
private function renderTableBody($rooms, $slotSizes, $first_block_start_time, $blocks_per_slot) {
- $table = $this->initTableBody($rooms, $slotSizes, $first_block_start_time, $blocks_per_slot);
+ $table = $this->initTableBody($slotSizes, $first_block_start_time, $blocks_per_slot);
$room_slots = $this->calcRoomSlots($rooms, $slotSizes);
diff --git a/includes/view/ShiftsFilterRenderer.php b/includes/view/ShiftsFilterRenderer.php
index 289ed210..301f31a2 100644
--- a/includes/view/ShiftsFilterRenderer.php
+++ b/includes/view/ShiftsFilterRenderer.php
@@ -38,7 +38,6 @@ class ShiftsFilterRenderer {
public function render($link_base) {
$toolbar = [];
if ($this->daySelectionEnabled && ! empty($this->days)) {
- $today = date("Y-m-d");
$selected_day = date("Y-m-d", $this->shiftsFilter->getStartTime());
$day_dropdown_items = [];
foreach ($this->days as $day) {