Replaced " with '
This commit is contained in:
parent
9a3ad88834
commit
915ce28fee
|
@ -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` = ?
|
||||
|
|
|
@ -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]
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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.');
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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')
|
||||
),
|
||||
|
|
|
@ -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"],
|
||||
]
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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' : '') . '">';
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue