Removed spaces
This commit is contained in:
parent
8506d6d27e
commit
3de0cc840f
|
@ -59,7 +59,7 @@ return [
|
|||
// multiply 'night shifts' and freeloaded shifts (start or end between 2 and 6 exclusive) by 2
|
||||
'shift_sum_formula' => '
|
||||
SUM(
|
||||
(1 +
|
||||
(1 +
|
||||
(
|
||||
(HOUR(FROM_UNIXTIME(`Shifts`.`end`)) > 2 AND HOUR(FROM_UNIXTIME(`Shifts`.`end`)) < 6)
|
||||
OR (HOUR(FROM_UNIXTIME(`Shifts`.`start`)) > 2 AND HOUR(FROM_UNIXTIME(`Shifts`.`start`)) < 6)
|
||||
|
|
|
@ -82,7 +82,7 @@ function AngelType_contact_info($angeltype)
|
|||
function AngelType_delete($angeltype)
|
||||
{
|
||||
$result = DB::delete('
|
||||
DELETE FROM `AngelTypes`
|
||||
DELETE FROM `AngelTypes`
|
||||
WHERE `id`=?
|
||||
LIMIT 1
|
||||
', [$angeltype['id']]);
|
||||
|
@ -102,8 +102,8 @@ function AngelType_delete($angeltype)
|
|||
function AngelType_update($angeltype)
|
||||
{
|
||||
$result = DB::update('
|
||||
UPDATE `AngelTypes` SET
|
||||
`name` = ?,
|
||||
UPDATE `AngelTypes` SET
|
||||
`name` = ?,
|
||||
`restricted` = ?,
|
||||
`description` = ?,
|
||||
`requires_driver_license` = ?,
|
||||
|
@ -201,7 +201,7 @@ function AngelType_validate_name($name, $angeltype)
|
|||
if ($angeltype != null && isset($angeltype['id'])) {
|
||||
$valid = (count(DB::select('
|
||||
SELECT `id`
|
||||
FROM `AngelTypes`
|
||||
FROM `AngelTypes`
|
||||
WHERE `name`=?
|
||||
AND NOT `id`=?
|
||||
LIMIT 1
|
||||
|
@ -209,8 +209,8 @@ function AngelType_validate_name($name, $angeltype)
|
|||
return new ValidationResult($valid, $name);
|
||||
}
|
||||
$valid = (count(DB::select('
|
||||
SELECT `id`
|
||||
FROM `AngelTypes`
|
||||
SELECT `id`
|
||||
FROM `AngelTypes`
|
||||
WHERE `name`=?
|
||||
LIMIT 1', [$name])) == 0);
|
||||
return new ValidationResult($valid, $name);
|
||||
|
@ -225,12 +225,12 @@ function AngelType_validate_name($name, $angeltype)
|
|||
function AngelTypes_with_user($user)
|
||||
{
|
||||
$result = DB::select('
|
||||
SELECT `AngelTypes`.*,
|
||||
SELECT `AngelTypes`.*,
|
||||
`UserAngelTypes`.`id` AS `user_angeltype_id`,
|
||||
`UserAngelTypes`.`confirm_user_id`,
|
||||
`UserAngelTypes`.`supporter`
|
||||
FROM `AngelTypes`
|
||||
LEFT JOIN `UserAngelTypes` ON `AngelTypes`.`id`=`UserAngelTypes`.`angeltype_id`
|
||||
FROM `AngelTypes`
|
||||
LEFT JOIN `UserAngelTypes` ON `AngelTypes`.`id`=`UserAngelTypes`.`angeltype_id`
|
||||
AND `UserAngelTypes`.`user_id` = ?
|
||||
ORDER BY `name`', [$user['UID']]);
|
||||
|
||||
|
@ -248,8 +248,8 @@ function AngelTypes_with_user($user)
|
|||
function AngelTypes()
|
||||
{
|
||||
$result = DB::select('
|
||||
SELECT *
|
||||
FROM `AngelTypes`
|
||||
SELECT *
|
||||
FROM `AngelTypes`
|
||||
ORDER BY `name`');
|
||||
|
||||
if (DB::getStm()->errorCode() != '00000') {
|
||||
|
|
|
@ -70,7 +70,7 @@ function EventConfig_update(
|
|||
`buildup_start_date` = ?,
|
||||
`event_start_date` = ?,
|
||||
`event_end_date` = ?,
|
||||
`teardown_end_date` = ?,
|
||||
`teardown_end_date` = ?,
|
||||
`event_welcome_msg` = ?
|
||||
',
|
||||
[
|
||||
|
|
|
@ -26,7 +26,7 @@ function ShiftType_update($shifttype_id, $name, $angeltype_id, $description)
|
|||
{
|
||||
DB::update('
|
||||
UPDATE `ShiftTypes` SET
|
||||
`name`=?,
|
||||
`name`=?,
|
||||
`angeltype_id`=?,
|
||||
`description`=?
|
||||
WHERE `id`=?
|
||||
|
|
|
@ -35,9 +35,9 @@ function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
|
|||
AND `NeededAngelTypes`.`angel_type_id` IN (' . implode(',', $shiftsFilter->getTypes()) . ')
|
||||
AND `NeededAngelTypes`.`count` > 0
|
||||
AND `Shifts`.`PSID` IS NULL
|
||||
|
||||
|
||||
UNION
|
||||
|
||||
|
||||
SELECT DISTINCT `Shifts`.*, `ShiftTypes`.`name`, `Room`.`Name` AS `room_name`
|
||||
FROM `Shifts`
|
||||
JOIN `Room` USING (`RID`)
|
||||
|
@ -48,7 +48,7 @@ function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
|
|||
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`';
|
||||
$result = DB::select($sql);
|
||||
if (DB::getStm()->errorCode() != '00000') {
|
||||
|
@ -122,9 +122,9 @@ function NeededAngeltype_by_Shift_and_Angeltype($shift, $angeltype)
|
|||
WHERE `Shifts`.`SID`=?
|
||||
AND `AngelTypes`.`id`=?
|
||||
AND `Shifts`.`PSID` IS NULL
|
||||
|
||||
|
||||
UNION
|
||||
|
||||
|
||||
SELECT
|
||||
`NeededAngelTypes`.*,
|
||||
`Shifts`.`SID`,
|
||||
|
@ -532,12 +532,12 @@ function Shifts_by_user($user, $include_freeload_comments = false)
|
|||
SELECT `ShiftTypes`.`id` AS `shifttype_id`, `ShiftTypes`.`name`,
|
||||
`ShiftEntry`.`id`, `ShiftEntry`.`SID`, `ShiftEntry`.`TID`, `ShiftEntry`.`UID`, `ShiftEntry`.`freeloaded`, `ShiftEntry`.`Comment`,
|
||||
' . ($include_freeload_comments ? '`ShiftEntry`.`freeload_comment`, ' : '') . '
|
||||
`Shifts`.*, `Room`.*
|
||||
FROM `ShiftEntry`
|
||||
JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID`)
|
||||
`Shifts`.*, `Room`.*
|
||||
FROM `ShiftEntry`
|
||||
JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID`)
|
||||
JOIN `ShiftTypes` ON (`ShiftTypes`.`id` = `Shifts`.`shifttype_id`)
|
||||
JOIN `Room` ON (`Shifts`.`RID` = `Room`.`RID`)
|
||||
WHERE `UID` = ?
|
||||
JOIN `Room` ON (`Shifts`.`RID` = `Room`.`RID`)
|
||||
WHERE `UID` = ?
|
||||
ORDER BY `start`
|
||||
',
|
||||
[
|
||||
|
@ -560,7 +560,7 @@ function Shift($shift_id)
|
|||
{
|
||||
$shifts_source = DB::select('
|
||||
SELECT `Shifts`.*, `ShiftTypes`.`name`
|
||||
FROM `Shifts`
|
||||
FROM `Shifts`
|
||||
JOIN `ShiftTypes` ON (`ShiftTypes`.`id` = `Shifts`.`shifttype_id`)
|
||||
WHERE `SID`=?', [$shift_id]);
|
||||
|
||||
|
@ -603,7 +603,7 @@ function Shift($shift_id)
|
|||
function Shifts()
|
||||
{
|
||||
$shifts_source = DB::select('
|
||||
SELECT `ShiftTypes`.`name`, `Shifts`.*, `Room`.`RID`, `Room`.`Name` AS `room_name`
|
||||
SELECT `ShiftTypes`.`name`, `Shifts`.*, `Room`.`RID`, `Room`.`Name` AS `room_name`
|
||||
FROM `Shifts`
|
||||
JOIN `ShiftTypes` ON (`ShiftTypes`.`id` = `Shifts`.`shifttype_id`)
|
||||
JOIN `Room` ON `Room`.`RID` = `Shifts`.`RID`
|
||||
|
|
|
@ -16,7 +16,7 @@ use Engelsystem\Database\DB;
|
|||
function UserAngelType_exists($user, $angeltype)
|
||||
{
|
||||
return count(DB::select('
|
||||
SELECT `id`
|
||||
SELECT `id`
|
||||
FROM `UserAngelTypes`
|
||||
WHERE `UserAngelTypes`.`user_id`=?
|
||||
AND `angeltype_id`=?
|
||||
|
@ -55,10 +55,10 @@ function User_angeltypes($user)
|
|||
function User_unconfirmed_AngelTypes($user)
|
||||
{
|
||||
$result = DB::select('
|
||||
SELECT
|
||||
`UserAngelTypes`.*,
|
||||
`AngelTypes`.`name`,
|
||||
count(`UnconfirmedMembers`.`user_id`) AS `count`
|
||||
SELECT
|
||||
`UserAngelTypes`.*,
|
||||
`AngelTypes`.`name`,
|
||||
count(`UnconfirmedMembers`.`user_id`) AS `count`
|
||||
FROM `UserAngelTypes`
|
||||
JOIN `AngelTypes` ON `UserAngelTypes`.`angeltype_id`=`AngelTypes`.`id`
|
||||
JOIN `UserAngelTypes` AS `UnconfirmedMembers` ON `UserAngelTypes`.`angeltype_id`=`UnconfirmedMembers`.`angeltype_id`
|
||||
|
@ -90,8 +90,8 @@ function User_is_AngelType_supporter(&$user, $angeltype)
|
|||
$user['privileges'] = privileges_for_user($user['UID']);
|
||||
}
|
||||
return (count(DB::select('
|
||||
SELECT `id`
|
||||
FROM `UserAngelTypes`
|
||||
SELECT `id`
|
||||
FROM `UserAngelTypes`
|
||||
WHERE `user_id`=?
|
||||
AND `angeltype_id`=?
|
||||
AND `supporter`=TRUE
|
||||
|
@ -201,7 +201,7 @@ function UserAngelType_confirm($user_angeltype_id, $confirm_user)
|
|||
function UserAngelType_delete($user_angeltype)
|
||||
{
|
||||
return (bool)DB::delete('
|
||||
DELETE FROM `UserAngelTypes`
|
||||
DELETE FROM `UserAngelTypes`
|
||||
WHERE `id`=?
|
||||
LIMIT 1', [$user_angeltype['id']]);
|
||||
}
|
||||
|
|
|
@ -486,8 +486,7 @@ function User_by_password_recovery_token($token)
|
|||
function User_reset_api_key(&$user, $log = true)
|
||||
{
|
||||
$user['api_key'] = md5($user['Nick'] . time() . rand());
|
||||
DB::update(
|
||||
'
|
||||
DB::update('
|
||||
UPDATE `User`
|
||||
SET `api_key`=?
|
||||
WHERE `UID`=?
|
||||
|
|
|
@ -53,8 +53,7 @@ function admin_active()
|
|||
}
|
||||
if (isset($_REQUEST['ack'])) {
|
||||
DB::update('UPDATE `User` SET `Aktiv` = 0 WHERE `Tshirt` = 0');
|
||||
$users = DB::select(sprintf(
|
||||
'
|
||||
$users = DB::select(sprintf('
|
||||
SELECT
|
||||
`User`.*,
|
||||
COUNT(`ShiftEntry`.`id`) AS `shift_count`,
|
||||
|
@ -137,11 +136,11 @@ function admin_active()
|
|||
`User`.*,
|
||||
COUNT(`ShiftEntry`.`id`) AS `shift_count`,
|
||||
%s AS `shift_length`
|
||||
FROM `User` LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID`
|
||||
FROM `User` LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID`
|
||||
LEFT JOIN `Shifts` ON `ShiftEntry`.`SID` = `Shifts`.`SID` '
|
||||
. ($show_all_shifts ? '' : 'AND (`Shifts`.`end` < ' . time() . " OR `Shifts`.`end` IS NULL)") . '
|
||||
WHERE `User`.`Gekommen` = 1
|
||||
GROUP BY `User`.`UID`
|
||||
GROUP BY `User`.`UID`
|
||||
ORDER BY `force_active` DESC, `shift_length` DESC
|
||||
%s
|
||||
',
|
||||
|
|
|
@ -44,10 +44,10 @@ function admin_free()
|
|||
}
|
||||
|
||||
$users = DB::select('
|
||||
SELECT `User`.*
|
||||
FROM `User`
|
||||
SELECT `User`.*
|
||||
FROM `User`
|
||||
' . $angelTypeSearch . '
|
||||
LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID`
|
||||
LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID`
|
||||
LEFT JOIN `Shifts`
|
||||
ON (
|
||||
`ShiftEntry`.`SID` = `Shifts`.`SID`
|
||||
|
@ -55,8 +55,8 @@ function admin_free()
|
|||
AND `Shifts`.`end` > ?
|
||||
)
|
||||
WHERE `User`.`Gekommen` = 1
|
||||
AND `Shifts`.`SID` IS NULL
|
||||
GROUP BY `User`.`UID`
|
||||
AND `Shifts`.`SID` IS NULL
|
||||
GROUP BY `User`.`UID`
|
||||
ORDER BY `Nick`
|
||||
',
|
||||
[
|
||||
|
|
|
@ -46,7 +46,7 @@ function admin_news()
|
|||
|
||||
case 'save':
|
||||
DB::update('
|
||||
UPDATE `News` SET
|
||||
UPDATE `News` SET
|
||||
`Datum`=?,
|
||||
`Betreff`=?,
|
||||
`Text`=?,
|
||||
|
|
|
@ -116,8 +116,7 @@ function admin_questions()
|
|||
));
|
||||
|
||||
if ($answer != '') {
|
||||
DB::update(
|
||||
'
|
||||
DB::update('
|
||||
UPDATE `Questions`
|
||||
SET `AID`=?, `Answer`=?
|
||||
WHERE `QID`=?
|
||||
|
|
|
@ -247,7 +247,7 @@ function admin_user()
|
|||
$force_active = $_REQUEST['force_active'];
|
||||
}
|
||||
$sql = '
|
||||
UPDATE `User` SET
|
||||
UPDATE `User` SET
|
||||
`Nick` = ?,
|
||||
`Name` = ?,
|
||||
`Vorname` = ?,
|
||||
|
|
|
@ -24,7 +24,7 @@ function user_atom()
|
|||
|
||||
$news = DB::select('
|
||||
SELECT *
|
||||
FROM `News`
|
||||
FROM `News`
|
||||
' . (empty($_REQUEST['meetings']) ? '' : 'WHERE `Treffen` = 1 ') . '
|
||||
ORDER BY `ID`
|
||||
DESC LIMIT ' . (int)config('display_news')
|
||||
|
|
|
@ -132,8 +132,8 @@ function user_myshifts()
|
|||
$user_id = $_REQUEST['cancel'];
|
||||
$shift = DB::select('
|
||||
SELECT *
|
||||
FROM `Shifts`
|
||||
INNER JOIN `ShiftEntry` USING (`SID`)
|
||||
FROM `Shifts`
|
||||
INNER JOIN `ShiftEntry` USING (`SID`)
|
||||
WHERE `ShiftEntry`.`id`=? AND `UID`=?
|
||||
',
|
||||
[
|
||||
|
|
|
@ -186,10 +186,10 @@ function toolbar_popover($glyphicon, $label, $content, $class = '')
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#' . $dom_id . '").popover({
|
||||
trigger: "focus",
|
||||
html: true,
|
||||
content: "' . addslashes(join('', $content)) . '",
|
||||
placement: "bottom",
|
||||
trigger: "focus",
|
||||
html: true,
|
||||
content: "' . addslashes(join('', $content)) . '",
|
||||
placement: "bottom",
|
||||
container: "#navbar-collapse-1"
|
||||
})
|
||||
});
|
||||
|
|
|
@ -54,7 +54,7 @@ function UserDriverLicense_edit_view($user_source, $wants_to_drive, $user_driver
|
|||
$("#driving_license").show();
|
||||
else
|
||||
$("#driving_license").hide();
|
||||
|
||||
|
||||
checkbox.click(
|
||||
function() {
|
||||
if($("#wants_to_drive").is(":checked"))
|
||||
|
|
Loading…
Reference in New Issue