diff options
-rw-r--r-- | includes/controller/shift_entries_controller.php | 6 | ||||
-rw-r--r-- | includes/model/ShiftEntry_model.php | 4 | ||||
-rw-r--r-- | includes/model/Shifts_model.php | 36 | ||||
-rw-r--r-- | includes/model/User_model.php | 6 | ||||
-rw-r--r-- | includes/pages/admin_groups.php | 2 | ||||
-rw-r--r-- | includes/pages/admin_news.php | 6 | ||||
-rw-r--r-- | includes/pages/admin_questions.php | 2 | ||||
-rw-r--r-- | includes/pages/guest_login.php | 6 | ||||
-rw-r--r-- | includes/pages/user_news.php | 2 | ||||
-rw-r--r-- | includes/pages/user_shifts.php | 4 | ||||
-rw-r--r-- | includes/sys_template.php | 2 | ||||
-rw-r--r-- | includes/view/User_view.php | 28 |
12 files changed, 52 insertions, 52 deletions
diff --git a/includes/controller/shift_entries_controller.php b/includes/controller/shift_entries_controller.php index 0df1f430..c2851c7c 100644 --- a/includes/controller/shift_entries_controller.php +++ b/includes/controller/shift_entries_controller.php @@ -118,12 +118,12 @@ function shift_entry_add_controller() 'SELECT `id` FROM `ShiftEntry` WHERE `SID`= ? AND `UID` = ?', [$shift['SID'], $user_id])) ) { - return error("This angel does already have an entry for this shift.", true); + return error('This angel does already have an entry for this shift.', true); } $freeloaded = isset($shift['freeloaded']) ? $shift['freeloaded'] : false; $freeload_comment = isset($shift['freeload_comment']) ? $shift['freeload_comment'] : ''; - if (in_array("user_shifts_admin", $privileges)) { + if (in_array('user_shifts_admin', $privileges)) { $freeloaded = isset($_REQUEST['freeloaded']); $freeload_comment = strip_request_item_nl('freeload_comment'); } @@ -144,7 +144,7 @@ function shift_entry_add_controller() if ( $type['restricted'] == 0 && count(DB::select(' - SELECT `id` FROM `UserAngelTypes` + SELECT `UserAngelTypes`.`id` FROM `UserAngelTypes` INNER JOIN `AngelTypes` ON `AngelTypes`.`id` = `UserAngelTypes`.`angeltype_id` WHERE `angeltype_id` = ? AND `user_id` = ? diff --git a/includes/model/ShiftEntry_model.php b/includes/model/ShiftEntry_model.php index 87e186ac..d7810feb 100644 --- a/includes/model/ShiftEntry_model.php +++ b/includes/model/ShiftEntry_model.php @@ -46,7 +46,7 @@ function ShiftEntries_freeleaded_count() */ function ShiftEntries_by_shift($shift_id) { - return DB::select(" + return DB::select(' SELECT `User`.`Nick`, `User`.`email`, @@ -62,7 +62,7 @@ function ShiftEntries_by_shift($shift_id) FROM `ShiftEntry` JOIN `User` ON `ShiftEntry`.`UID`=`User`.`UID` JOIN `AngelTypes` ON `ShiftEntry`.`TID`=`AngelTypes`.`id` - WHERE `ShiftEntry`.`SID` = ?", + WHERE `ShiftEntry`.`SID` = ?', [$shift_id] ); } diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php index 3f199803..c70ba830 100644 --- a/includes/model/Shifts_model.php +++ b/includes/model/Shifts_model.php @@ -24,15 +24,15 @@ function Shifts_by_room($room) function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter) { //@TODO - $sql = "SELECT * FROM ( + $sql = 'SELECT * FROM ( SELECT DISTINCT `Shifts`.*, `ShiftTypes`.`name`, `Room`.`Name` AS `room_name` FROM `Shifts` JOIN `Room` USING (`RID`) JOIN `ShiftTypes` ON `ShiftTypes`.`id` = `Shifts`.`shifttype_id` JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`shift_id`=`Shifts`.`SID` - WHERE `Shifts`.`RID` IN (" . implode(',', $shiftsFilter->getRooms()) . ") - AND `start` BETWEEN " . $shiftsFilter->getStartTime() . " AND " . $shiftsFilter->getEndTime() . " - AND `NeededAngelTypes`.`angel_type_id` IN (" . implode(',', $shiftsFilter->getTypes()) . ") + WHERE `Shifts`.`RID` IN (' . implode(',', $shiftsFilter->getRooms()) . ') + AND `start` BETWEEN ' . $shiftsFilter->getStartTime() . ' AND ' . $shiftsFilter->getEndTime() . ' + AND `NeededAngelTypes`.`angel_type_id` IN (' . implode(',', $shiftsFilter->getTypes()) . ') AND `NeededAngelTypes`.`count` > 0 AND `Shifts`.`PSID` IS NULL @@ -43,13 +43,13 @@ function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter) JOIN `Room` USING (`RID`) JOIN `ShiftTypes` ON `ShiftTypes`.`id` = `Shifts`.`shifttype_id` JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`room_id`=`Shifts`.`RID` - WHERE `Shifts`.`RID` IN (" . implode(',', $shiftsFilter->getRooms()) . ") - AND `start` BETWEEN " . $shiftsFilter->getStartTime() . " AND " . $shiftsFilter->getEndTime() . " - AND `NeededAngelTypes`.`angel_type_id` IN (" . implode(',', $shiftsFilter->getTypes()) . ") + WHERE `Shifts`.`RID` IN (' . implode(',', $shiftsFilter->getRooms()) . ') + AND `start` BETWEEN ' . $shiftsFilter->getStartTime() . ' AND ' . $shiftsFilter->getEndTime() . ' + AND `NeededAngelTypes`.`angel_type_id` IN (' . implode(',', $shiftsFilter->getTypes()) . ') AND `NeededAngelTypes`.`count` > 0 AND NOT `Shifts`.`PSID` IS NULL) AS tmp_shifts - ORDER BY `start`"; + ORDER BY `start`'; $result = DB::select($sql); if (DB::getStm()->errorCode() != '00000') { engelsystem_error('Unable to load shifts by filter.'); @@ -64,7 +64,7 @@ function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter) function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter) { //@TODO - $sql = " + $sql = ' SELECT `NeededAngelTypes`.*, `Shifts`.`SID`, @@ -75,8 +75,8 @@ function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter) FROM `Shifts` JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`shift_id`=`Shifts`.`SID` JOIN `AngelTypes` ON `AngelTypes`.`id`= `NeededAngelTypes`.`angel_type_id` - WHERE `Shifts`.`RID` IN (" . implode(',', $shiftsFilter->getRooms()) . ") - AND `start` BETWEEN " . $shiftsFilter->getStartTime() . " AND " . $shiftsFilter->getEndTime() . " + WHERE `Shifts`.`RID` IN (' . implode(',', $shiftsFilter->getRooms()) . ') + AND `start` BETWEEN ' . $shiftsFilter->getStartTime() . ' AND ' . $shiftsFilter->getEndTime() . ' AND `Shifts`.`PSID` IS NULL UNION @@ -91,9 +91,9 @@ function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter) FROM `Shifts` JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`room_id`=`Shifts`.`RID` JOIN `AngelTypes` ON `AngelTypes`.`id`= `NeededAngelTypes`.`angel_type_id` - WHERE `Shifts`.`RID` IN (" . implode(',', $shiftsFilter->getRooms()) . ") - AND `start` BETWEEN " . $shiftsFilter->getStartTime() . " AND " . $shiftsFilter->getEndTime() . " - AND NOT `Shifts`.`PSID` IS NULL"; + WHERE `Shifts`.`RID` IN (' . implode(',', $shiftsFilter->getRooms()) . ') + AND `start` BETWEEN ' . $shiftsFilter->getStartTime() . ' AND ' . $shiftsFilter->getEndTime() . ' + AND NOT `Shifts`.`PSID` IS NULL'; $result = DB::select($sql); if (DB::getStm()->errorCode() != '00000') { engelsystem_error('Unable to load needed angeltypes by filter.'); @@ -162,7 +162,7 @@ function NeededAngeltype_by_Shift_and_Angeltype($shift, $angeltype) function ShiftEntries_by_ShiftsFilter(ShiftsFilter $shiftsFilter) { // @TODO - $sql = " + $sql = ' SELECT `User`.`Nick`, `User`.`email`, @@ -177,9 +177,9 @@ function ShiftEntries_by_ShiftsFilter(ShiftsFilter $shiftsFilter) FROM `Shifts` JOIN `ShiftEntry` ON `ShiftEntry`.`SID`=`Shifts`.`SID` JOIN `User` ON `ShiftEntry`.`UID`=`User`.`UID` - WHERE `Shifts`.`RID` IN (" . implode(',', $shiftsFilter->getRooms()) . ") - AND `start` BETWEEN " . $shiftsFilter->getStartTime() . " AND " . $shiftsFilter->getEndTime() . " - ORDER BY `Shifts`.`start`"; + WHERE `Shifts`.`RID` IN (' . implode(',', $shiftsFilter->getRooms()) . ') + AND `start` BETWEEN ' . $shiftsFilter->getStartTime() . ' AND ' . $shiftsFilter->getEndTime() . ' + ORDER BY `Shifts`.`start`'; $result = DB::select($sql); if (DB::getStm()->errorCode() != '00000') { engelsystem_error('Unable to load shift entries by filter.'); diff --git a/includes/model/User_model.php b/includes/model/User_model.php index 836ca914..097e8faf 100644 --- a/includes/model/User_model.php +++ b/includes/model/User_model.php @@ -28,7 +28,7 @@ function User_delete($user_id) */ function User_update($user) { - return (bool)DB::update(" + return (bool)DB::update(' UPDATE `User` SET `Nick`=?, `Name`=?, @@ -54,7 +54,7 @@ function User_update($user) `planned_arrival_date`=?, `planned_departure_date`=? WHERE `UID`=? - ", + ', [ $user['Nick'], $user['Name'], @@ -241,7 +241,7 @@ function Users_by_angeltype_inverted($angeltype) ] ); if (DB::getStm()->errorCode() != '00000') { - engelsystem_error("Unable to load users."); + engelsystem_error('Unable to load users.'); } return $result; } diff --git a/includes/pages/admin_groups.php b/includes/pages/admin_groups.php index bc33a2b0..104fa274 100644 --- a/includes/pages/admin_groups.php +++ b/includes/pages/admin_groups.php @@ -114,7 +114,7 @@ function admin_groups() DB::delete('DELETE FROM `GroupPrivileges` WHERE `group_id`=?', [$group_id]); $privilege_names = []; foreach ($_REQUEST['privileges'] as $privilege) { - if (preg_match("/^[0-9]{1,}$/", $privilege)) { + if (preg_match('/^[0-9]{1,}$/', $privilege)) { $group_privileges_source = DB::select( 'SELECT `name` FROM `Privileges` WHERE `id`=? LIMIT 1', [$privilege] diff --git a/includes/pages/admin_news.php b/includes/pages/admin_news.php index 86631d6b..af5dffc6 100644 --- a/includes/pages/admin_news.php +++ b/includes/pages/admin_news.php @@ -13,8 +13,8 @@ function admin_news() redirect(page_link_to('news')); } - $html = '<div class="col-md-12"><h1>' . _("Edit news entry") . '</h1>' . msg(); - if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) { + $html = '<div class="col-md-12"><h1>' . _('Edit news entry') . '</h1>' . msg(); + if (isset($_REQUEST['id']) && preg_match('/^[0-9]{1,11}$/', $_REQUEST['id'])) { $news_id = $_REQUEST['id']; } else { return error('Incomplete call, missing News ID.', true); @@ -40,7 +40,7 @@ function admin_news() ], page_link_to('admin_news&action=save&id=' . $news_id)); $html .= '<a class="btn btn-danger" href="' . page_link_to('admin_news&action=delete&id=' . $news_id) . '">' - . '<span class="glyphicon glyphicon-trash"></span> ' . _("Delete") + . '<span class="glyphicon glyphicon-trash"></span> ' . _('Delete') . '</a>'; break; diff --git a/includes/pages/admin_questions.php b/includes/pages/admin_questions.php index ef84b111..aca9b570 100644 --- a/includes/pages/admin_questions.php +++ b/includes/pages/admin_questions.php @@ -24,7 +24,7 @@ function admin_new_questions() $new_messages = count(DB::select('SELECT `QID` FROM `Questions` WHERE `AID` IS NULL')); if ($new_messages > 0) { - return '<a href="' . page_link_to("admin_questions") . '">' . _('There are unanswered questions!') . '</a>'; + return '<a href="' . page_link_to('admin_questions') . '">' . _('There are unanswered questions!') . '</a>'; } } } diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index f08f9260..647fa585 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -155,7 +155,7 @@ function guest_register() if (isset($_REQUEST['prename'])) { $preName = strip_request_item('prename'); } - if (isset($_REQUEST['age']) && preg_match("/^[0-9]{0,4}$/", $_REQUEST['age'])) { + if (isset($_REQUEST['age']) && preg_match('/^[0-9]{0,4}$/', $_REQUEST['age'])) { $age = strip_request_item('age'); } if (isset($_REQUEST['tel'])) { @@ -317,8 +317,8 @@ function guest_register() ]), form_checkboxes( 'angel_types', - _("What do you want to do?") . sprintf( - " (<a href=\"%s\">%s</a>)", + _('What do you want to do?') . sprintf( + ' (<a href="%s">%s</a>)', page_link_to('angeltypes') . '&action=about', _('Description of job types') ), diff --git a/includes/pages/user_news.php b/includes/pages/user_news.php index 3828e293..7dfc7d0c 100644 --- a/includes/pages/user_news.php +++ b/includes/pages/user_news.php @@ -134,7 +134,7 @@ function user_news_comments() ', [ $nid, - date("Y-m-d H:i:s"), + date('Y-m-d H:i:s'), $text, $user["UID"], ] diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 16af0197..55e49e4f 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -265,8 +265,8 @@ function make_select($items, $selected, $name, $title = null) $html = '<div id="selection_' . $name . '" class="selection ' . $name . '">' . "\n"; $html .= implode("\n", $html_items); $html .= buttons([ - button("javascript: checkAll('selection_" . $name . "', true)", _('All'), ''), - button("javascript: checkAll('selection_" . $name . "', false)", _('None'), '') + button('javascript: checkAll(\'selection_' . $name . '\', true)', _('All'), ''), + button('javascript: checkAll(\'selection_' . $name . '\', false)', _('None'), '') ]); $html .= '</div>' . "\n"; return $html; diff --git a/includes/sys_template.php b/includes/sys_template.php index 9b85df59..107609ad 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -260,7 +260,7 @@ function table($columns, $rows_raw, $data = true) function render_table($columns, $rows, $data = true) { if (count($rows) == 0) { - return info(_("No data found."), true); + return info(_('No data found.'), true); } $html = '<table class="table table-striped' . ($data ? ' data' : '') . '">'; diff --git a/includes/view/User_view.php b/includes/view/User_view.php index 832569a6..50c54f5a 100644 --- a/includes/view/User_view.php +++ b/includes/view/User_view.php @@ -241,24 +241,24 @@ function Users_view( 'actions' => '<strong>' . count($users) . '</strong>' ]; - return page_with_title(_("All users"), [ + return page_with_title(_('All users'), [ msg(), buttons([ - button(page_link_to('register'), glyph('plus') . _("New user")) + button(page_link_to('register'), glyph('plus') . _('New user')) ]), table([ - 'Nick' => Users_table_header_link('Nick', _("Nick"), $order_by), - 'Vorname' => Users_table_header_link('Vorname', _("Prename"), $order_by), - 'Name' => Users_table_header_link('Name', _("Name"), $order_by), - 'DECT' => Users_table_header_link('DECT', _("DECT"), $order_by), - 'Gekommen' => Users_table_header_link('Gekommen', _("Arrived"), $order_by), - 'got_voucher' => Users_table_header_link('got_voucher', _("Voucher"), $order_by), + 'Nick' => Users_table_header_link('Nick', _('Nick'), $order_by), + 'Vorname' => Users_table_header_link('Vorname', _('Prename'), $order_by), + 'Name' => Users_table_header_link('Name', _('Name'), $order_by), + 'DECT' => Users_table_header_link('DECT', _('DECT'), $order_by), + 'Gekommen' => Users_table_header_link('Gekommen', _('Arrived'), $order_by), + 'got_voucher' => Users_table_header_link('got_voucher', _('Voucher'), $order_by), 'freeloads' => _('Freeloads'), - 'Aktiv' => Users_table_header_link('Aktiv', _("Active"), $order_by), - 'force_active' => Users_table_header_link('force_active', _("Forced"), $order_by), - 'Tshirt' => Users_table_header_link('Tshirt', _("T-Shirt"), $order_by), - 'Size' => Users_table_header_link('Size', _("Size"), $order_by), - 'lastLogIn' => Users_table_header_link('lastLogIn', _("Last login"), $order_by), + 'Aktiv' => Users_table_header_link('Aktiv', _('Active'), $order_by), + 'force_active' => Users_table_header_link('force_active', _('Forced'), $order_by), + 'Tshirt' => Users_table_header_link('Tshirt', _('T-Shirt'), $order_by), + 'Size' => Users_table_header_link('Size', _('Size'), $order_by), + 'lastLogIn' => Users_table_header_link('lastLogIn', _('Last login'), $order_by), 'actions' => '' ], $users) ]); @@ -320,7 +320,7 @@ function User_view_shiftentries($needed_angel_type) $shift_entries[] = $member; } - $shift_info .= join(", ", $shift_entries); + $shift_info .= join(', ', $shift_entries); return $shift_info; } |