Replaced " with '

main
Bot 8 years ago committed by Igor Scheller
parent 9a3ad88834
commit 915ce28fee

@ -118,12 +118,12 @@ function shift_entry_add_controller()
'SELECT `id` FROM `ShiftEntry` WHERE `SID`= ? AND `UID` = ?', 'SELECT `id` FROM `ShiftEntry` WHERE `SID`= ? AND `UID` = ?',
[$shift['SID'], $user_id])) [$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; $freeloaded = isset($shift['freeloaded']) ? $shift['freeloaded'] : false;
$freeload_comment = isset($shift['freeload_comment']) ? $shift['freeload_comment'] : ''; $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']); $freeloaded = isset($_REQUEST['freeloaded']);
$freeload_comment = strip_request_item_nl('freeload_comment'); $freeload_comment = strip_request_item_nl('freeload_comment');
} }
@ -144,7 +144,7 @@ function shift_entry_add_controller()
if ( if (
$type['restricted'] == 0 $type['restricted'] == 0
&& count(DB::select(' && count(DB::select('
SELECT `id` FROM `UserAngelTypes` SELECT `UserAngelTypes`.`id` FROM `UserAngelTypes`
INNER JOIN `AngelTypes` ON `AngelTypes`.`id` = `UserAngelTypes`.`angeltype_id` INNER JOIN `AngelTypes` ON `AngelTypes`.`id` = `UserAngelTypes`.`angeltype_id`
WHERE `angeltype_id` = ? WHERE `angeltype_id` = ?
AND `user_id` = ? AND `user_id` = ?

@ -46,7 +46,7 @@ function ShiftEntries_freeleaded_count()
*/ */
function ShiftEntries_by_shift($shift_id) function ShiftEntries_by_shift($shift_id)
{ {
return DB::select(" return DB::select('
SELECT SELECT
`User`.`Nick`, `User`.`Nick`,
`User`.`email`, `User`.`email`,
@ -62,7 +62,7 @@ function ShiftEntries_by_shift($shift_id)
FROM `ShiftEntry` FROM `ShiftEntry`
JOIN `User` ON `ShiftEntry`.`UID`=`User`.`UID` JOIN `User` ON `ShiftEntry`.`UID`=`User`.`UID`
JOIN `AngelTypes` ON `ShiftEntry`.`TID`=`AngelTypes`.`id` JOIN `AngelTypes` ON `ShiftEntry`.`TID`=`AngelTypes`.`id`
WHERE `ShiftEntry`.`SID` = ?", WHERE `ShiftEntry`.`SID` = ?',
[$shift_id] [$shift_id]
); );
} }

@ -24,15 +24,15 @@ function Shifts_by_room($room)
function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter) function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
{ {
//@TODO //@TODO
$sql = "SELECT * FROM ( $sql = 'SELECT * FROM (
SELECT DISTINCT `Shifts`.*, `ShiftTypes`.`name`, `Room`.`Name` AS `room_name` SELECT DISTINCT `Shifts`.*, `ShiftTypes`.`name`, `Room`.`Name` AS `room_name`
FROM `Shifts` FROM `Shifts`
JOIN `Room` USING (`RID`) JOIN `Room` USING (`RID`)
JOIN `ShiftTypes` ON `ShiftTypes`.`id` = `Shifts`.`shifttype_id` JOIN `ShiftTypes` ON `ShiftTypes`.`id` = `Shifts`.`shifttype_id`
JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`shift_id`=`Shifts`.`SID` JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`shift_id`=`Shifts`.`SID`
WHERE `Shifts`.`RID` IN (" . implode(',', $shiftsFilter->getRooms()) . ") WHERE `Shifts`.`RID` IN (' . implode(',', $shiftsFilter->getRooms()) . ')
AND `start` BETWEEN " . $shiftsFilter->getStartTime() . " AND " . $shiftsFilter->getEndTime() . " AND `start` BETWEEN ' . $shiftsFilter->getStartTime() . ' AND ' . $shiftsFilter->getEndTime() . '
AND `NeededAngelTypes`.`angel_type_id` IN (" . implode(',', $shiftsFilter->getTypes()) . ") AND `NeededAngelTypes`.`angel_type_id` IN (' . implode(',', $shiftsFilter->getTypes()) . ')
AND `NeededAngelTypes`.`count` > 0 AND `NeededAngelTypes`.`count` > 0
AND `Shifts`.`PSID` IS NULL AND `Shifts`.`PSID` IS NULL
@ -43,13 +43,13 @@ function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
JOIN `Room` USING (`RID`) JOIN `Room` USING (`RID`)
JOIN `ShiftTypes` ON `ShiftTypes`.`id` = `Shifts`.`shifttype_id` JOIN `ShiftTypes` ON `ShiftTypes`.`id` = `Shifts`.`shifttype_id`
JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`room_id`=`Shifts`.`RID` JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`room_id`=`Shifts`.`RID`
WHERE `Shifts`.`RID` IN (" . implode(',', $shiftsFilter->getRooms()) . ") WHERE `Shifts`.`RID` IN (' . implode(',', $shiftsFilter->getRooms()) . ')
AND `start` BETWEEN " . $shiftsFilter->getStartTime() . " AND " . $shiftsFilter->getEndTime() . " AND `start` BETWEEN ' . $shiftsFilter->getStartTime() . ' AND ' . $shiftsFilter->getEndTime() . '
AND `NeededAngelTypes`.`angel_type_id` IN (" . implode(',', $shiftsFilter->getTypes()) . ") AND `NeededAngelTypes`.`angel_type_id` IN (' . implode(',', $shiftsFilter->getTypes()) . ')
AND `NeededAngelTypes`.`count` > 0 AND `NeededAngelTypes`.`count` > 0
AND NOT `Shifts`.`PSID` IS NULL) AS tmp_shifts AND NOT `Shifts`.`PSID` IS NULL) AS tmp_shifts
ORDER BY `start`"; ORDER BY `start`';
$result = DB::select($sql); $result = DB::select($sql);
if (DB::getStm()->errorCode() != '00000') { if (DB::getStm()->errorCode() != '00000') {
engelsystem_error('Unable to load shifts by filter.'); engelsystem_error('Unable to load shifts by filter.');
@ -64,7 +64,7 @@ function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter) function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
{ {
//@TODO //@TODO
$sql = " $sql = '
SELECT SELECT
`NeededAngelTypes`.*, `NeededAngelTypes`.*,
`Shifts`.`SID`, `Shifts`.`SID`,
@ -75,8 +75,8 @@ function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
FROM `Shifts` FROM `Shifts`
JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`shift_id`=`Shifts`.`SID` JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`shift_id`=`Shifts`.`SID`
JOIN `AngelTypes` ON `AngelTypes`.`id`= `NeededAngelTypes`.`angel_type_id` JOIN `AngelTypes` ON `AngelTypes`.`id`= `NeededAngelTypes`.`angel_type_id`
WHERE `Shifts`.`RID` IN (" . implode(',', $shiftsFilter->getRooms()) . ") WHERE `Shifts`.`RID` IN (' . implode(',', $shiftsFilter->getRooms()) . ')
AND `start` BETWEEN " . $shiftsFilter->getStartTime() . " AND " . $shiftsFilter->getEndTime() . " AND `start` BETWEEN ' . $shiftsFilter->getStartTime() . ' AND ' . $shiftsFilter->getEndTime() . '
AND `Shifts`.`PSID` IS NULL AND `Shifts`.`PSID` IS NULL
UNION UNION
@ -91,9 +91,9 @@ function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
FROM `Shifts` FROM `Shifts`
JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`room_id`=`Shifts`.`RID` JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`room_id`=`Shifts`.`RID`
JOIN `AngelTypes` ON `AngelTypes`.`id`= `NeededAngelTypes`.`angel_type_id` JOIN `AngelTypes` ON `AngelTypes`.`id`= `NeededAngelTypes`.`angel_type_id`
WHERE `Shifts`.`RID` IN (" . implode(',', $shiftsFilter->getRooms()) . ") WHERE `Shifts`.`RID` IN (' . implode(',', $shiftsFilter->getRooms()) . ')
AND `start` BETWEEN " . $shiftsFilter->getStartTime() . " AND " . $shiftsFilter->getEndTime() . " AND `start` BETWEEN ' . $shiftsFilter->getStartTime() . ' AND ' . $shiftsFilter->getEndTime() . '
AND NOT `Shifts`.`PSID` IS NULL"; AND NOT `Shifts`.`PSID` IS NULL';
$result = DB::select($sql); $result = DB::select($sql);
if (DB::getStm()->errorCode() != '00000') { if (DB::getStm()->errorCode() != '00000') {
engelsystem_error('Unable to load needed angeltypes by filter.'); 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) function ShiftEntries_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
{ {
// @TODO // @TODO
$sql = " $sql = '
SELECT SELECT
`User`.`Nick`, `User`.`Nick`,
`User`.`email`, `User`.`email`,
@ -177,9 +177,9 @@ function ShiftEntries_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
FROM `Shifts` FROM `Shifts`
JOIN `ShiftEntry` ON `ShiftEntry`.`SID`=`Shifts`.`SID` JOIN `ShiftEntry` ON `ShiftEntry`.`SID`=`Shifts`.`SID`
JOIN `User` ON `ShiftEntry`.`UID`=`User`.`UID` JOIN `User` ON `ShiftEntry`.`UID`=`User`.`UID`
WHERE `Shifts`.`RID` IN (" . implode(',', $shiftsFilter->getRooms()) . ") WHERE `Shifts`.`RID` IN (' . implode(',', $shiftsFilter->getRooms()) . ')
AND `start` BETWEEN " . $shiftsFilter->getStartTime() . " AND " . $shiftsFilter->getEndTime() . " AND `start` BETWEEN ' . $shiftsFilter->getStartTime() . ' AND ' . $shiftsFilter->getEndTime() . '
ORDER BY `Shifts`.`start`"; ORDER BY `Shifts`.`start`';
$result = DB::select($sql); $result = DB::select($sql);
if (DB::getStm()->errorCode() != '00000') { if (DB::getStm()->errorCode() != '00000') {
engelsystem_error('Unable to load shift entries by filter.'); engelsystem_error('Unable to load shift entries by filter.');

@ -28,7 +28,7 @@ function User_delete($user_id)
*/ */
function User_update($user) function User_update($user)
{ {
return (bool)DB::update(" return (bool)DB::update('
UPDATE `User` SET UPDATE `User` SET
`Nick`=?, `Nick`=?,
`Name`=?, `Name`=?,
@ -54,7 +54,7 @@ function User_update($user)
`planned_arrival_date`=?, `planned_arrival_date`=?,
`planned_departure_date`=? `planned_departure_date`=?
WHERE `UID`=? WHERE `UID`=?
", ',
[ [
$user['Nick'], $user['Nick'],
$user['Name'], $user['Name'],
@ -241,7 +241,7 @@ function Users_by_angeltype_inverted($angeltype)
] ]
); );
if (DB::getStm()->errorCode() != '00000') { if (DB::getStm()->errorCode() != '00000') {
engelsystem_error("Unable to load users."); engelsystem_error('Unable to load users.');
} }
return $result; return $result;
} }

@ -114,7 +114,7 @@ function admin_groups()
DB::delete('DELETE FROM `GroupPrivileges` WHERE `group_id`=?', [$group_id]); DB::delete('DELETE FROM `GroupPrivileges` WHERE `group_id`=?', [$group_id]);
$privilege_names = []; $privilege_names = [];
foreach ($_REQUEST['privileges'] as $privilege) { foreach ($_REQUEST['privileges'] as $privilege) {
if (preg_match("/^[0-9]{1,}$/", $privilege)) { if (preg_match('/^[0-9]{1,}$/', $privilege)) {
$group_privileges_source = DB::select( $group_privileges_source = DB::select(
'SELECT `name` FROM `Privileges` WHERE `id`=? LIMIT 1', 'SELECT `name` FROM `Privileges` WHERE `id`=? LIMIT 1',
[$privilege] [$privilege]

@ -13,8 +13,8 @@ function admin_news()
redirect(page_link_to('news')); redirect(page_link_to('news'));
} }
$html = '<div class="col-md-12"><h1>' . _("Edit news entry") . '</h1>' . msg(); $html = '<div class="col-md-12"><h1>' . _('Edit news entry') . '</h1>' . msg();
if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) { if (isset($_REQUEST['id']) && preg_match('/^[0-9]{1,11}$/', $_REQUEST['id'])) {
$news_id = $_REQUEST['id']; $news_id = $_REQUEST['id'];
} else { } else {
return error('Incomplete call, missing News ID.', true); 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)); ], 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) . '">' $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>'; . '</a>';
break; break;

@ -24,7 +24,7 @@ function admin_new_questions()
$new_messages = count(DB::select('SELECT `QID` FROM `Questions` WHERE `AID` IS NULL')); $new_messages = count(DB::select('SELECT `QID` FROM `Questions` WHERE `AID` IS NULL'));
if ($new_messages > 0) { 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'])) { if (isset($_REQUEST['prename'])) {
$preName = strip_request_item('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'); $age = strip_request_item('age');
} }
if (isset($_REQUEST['tel'])) { if (isset($_REQUEST['tel'])) {
@ -317,8 +317,8 @@ function guest_register()
]), ]),
form_checkboxes( form_checkboxes(
'angel_types', 'angel_types',
_("What do you want to do?") . sprintf( _('What do you want to do?') . sprintf(
" (<a href=\"%s\">%s</a>)", ' (<a href="%s">%s</a>)',
page_link_to('angeltypes') . '&action=about', page_link_to('angeltypes') . '&action=about',
_('Description of job types') _('Description of job types')
), ),

@ -134,7 +134,7 @@ function user_news_comments()
', ',
[ [
$nid, $nid,
date("Y-m-d H:i:s"), date('Y-m-d H:i:s'),
$text, $text,
$user["UID"], $user["UID"],
] ]

@ -265,8 +265,8 @@ function make_select($items, $selected, $name, $title = null)
$html = '<div id="selection_' . $name . '" class="selection ' . $name . '">' . "\n"; $html = '<div id="selection_' . $name . '" class="selection ' . $name . '">' . "\n";
$html .= implode("\n", $html_items); $html .= implode("\n", $html_items);
$html .= buttons([ $html .= buttons([
button("javascript: checkAll('selection_" . $name . "', true)", _('All'), ''), button('javascript: checkAll(\'selection_' . $name . '\', true)', _('All'), ''),
button("javascript: checkAll('selection_" . $name . "', false)", _('None'), '') button('javascript: checkAll(\'selection_' . $name . '\', false)', _('None'), '')
]); ]);
$html .= '</div>' . "\n"; $html .= '</div>' . "\n";
return $html; return $html;

@ -260,7 +260,7 @@ function table($columns, $rows_raw, $data = true)
function render_table($columns, $rows, $data = true) function render_table($columns, $rows, $data = true)
{ {
if (count($rows) == 0) { if (count($rows) == 0) {
return info(_("No data found."), true); return info(_('No data found.'), true);
} }
$html = '<table class="table table-striped' . ($data ? ' data' : '') . '">'; $html = '<table class="table table-striped' . ($data ? ' data' : '') . '">';

@ -241,24 +241,24 @@ function Users_view(
'actions' => '<strong>' . count($users) . '</strong>' 'actions' => '<strong>' . count($users) . '</strong>'
]; ];
return page_with_title(_("All users"), [ return page_with_title(_('All users'), [
msg(), msg(),
buttons([ buttons([
button(page_link_to('register'), glyph('plus') . _("New user")) button(page_link_to('register'), glyph('plus') . _('New user'))
]), ]),
table([ table([
'Nick' => Users_table_header_link('Nick', _("Nick"), $order_by), 'Nick' => Users_table_header_link('Nick', _('Nick'), $order_by),
'Vorname' => Users_table_header_link('Vorname', _("Prename"), $order_by), 'Vorname' => Users_table_header_link('Vorname', _('Prename'), $order_by),
'Name' => Users_table_header_link('Name', _("Name"), $order_by), 'Name' => Users_table_header_link('Name', _('Name'), $order_by),
'DECT' => Users_table_header_link('DECT', _("DECT"), $order_by), 'DECT' => Users_table_header_link('DECT', _('DECT'), $order_by),
'Gekommen' => Users_table_header_link('Gekommen', _("Arrived"), $order_by), 'Gekommen' => Users_table_header_link('Gekommen', _('Arrived'), $order_by),
'got_voucher' => Users_table_header_link('got_voucher', _("Voucher"), $order_by), 'got_voucher' => Users_table_header_link('got_voucher', _('Voucher'), $order_by),
'freeloads' => _('Freeloads'), 'freeloads' => _('Freeloads'),
'Aktiv' => Users_table_header_link('Aktiv', _("Active"), $order_by), 'Aktiv' => Users_table_header_link('Aktiv', _('Active'), $order_by),
'force_active' => Users_table_header_link('force_active', _("Forced"), $order_by), 'force_active' => Users_table_header_link('force_active', _('Forced'), $order_by),
'Tshirt' => Users_table_header_link('Tshirt', _("T-Shirt"), $order_by), 'Tshirt' => Users_table_header_link('Tshirt', _('T-Shirt'), $order_by),
'Size' => Users_table_header_link('Size', _("Size"), $order_by), 'Size' => Users_table_header_link('Size', _('Size'), $order_by),
'lastLogIn' => Users_table_header_link('lastLogIn', _("Last login"), $order_by), 'lastLogIn' => Users_table_header_link('lastLogIn', _('Last login'), $order_by),
'actions' => '' 'actions' => ''
], $users) ], $users)
]); ]);
@ -320,7 +320,7 @@ function User_view_shiftentries($needed_angel_type)
$shift_entries[] = $member; $shift_entries[] = $member;
} }
$shift_info .= join(", ", $shift_entries); $shift_info .= join(', ', $shift_entries);
return $shift_info; return $shift_info;
} }

Loading…
Cancel
Save