File formatting fixes
This commit is contained in:
parent
a33298c3ce
commit
390db395a6
|
@ -69,7 +69,8 @@ function AngelType_update($angeltype)
|
|||
`contact_dect` = ?,
|
||||
`contact_email` = ?,
|
||||
`show_on_dashboard` = ?
|
||||
WHERE `id` = ?',
|
||||
WHERE `id` = ?
|
||||
',
|
||||
[
|
||||
$angeltype['name'],
|
||||
(int)$angeltype['restricted'],
|
||||
|
@ -207,7 +208,8 @@ function AngelTypes()
|
|||
return DB::select('
|
||||
SELECT *
|
||||
FROM `AngelTypes`
|
||||
ORDER BY `name`');
|
||||
ORDER BY `name`
|
||||
');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -59,7 +59,8 @@ function ShiftEntries_by_shift($shift_id)
|
|||
FROM `ShiftEntry`
|
||||
JOIN `users` ON `ShiftEntry`.`UID`=`users`.`id`
|
||||
JOIN `AngelTypes` ON `ShiftEntry`.`TID`=`AngelTypes`.`id`
|
||||
WHERE `ShiftEntry`.`SID` = ?',
|
||||
WHERE `ShiftEntry`.`SID` = ?
|
||||
',
|
||||
[$shift_id]
|
||||
);
|
||||
}
|
||||
|
@ -124,7 +125,8 @@ function ShiftEntry_update($shift_entry)
|
|||
`Comment` = ?,
|
||||
`freeload_comment` = ?,
|
||||
`freeloaded` = ?
|
||||
WHERE `id` = ?',
|
||||
WHERE `id` = ?
|
||||
',
|
||||
[
|
||||
$shift_entry['Comment'],
|
||||
$shift_entry['freeload_comment'],
|
||||
|
|
|
@ -91,7 +91,8 @@ function Shifts_by_room($room)
|
|||
*/
|
||||
function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
|
||||
{
|
||||
$sql = 'SELECT * FROM (
|
||||
$sql = '
|
||||
SELECT * FROM (
|
||||
SELECT DISTINCT `Shifts`.*, `ShiftTypes`.`name`, `Room`.`Name` AS `room_name`
|
||||
FROM `Shifts`
|
||||
JOIN `Room` USING (`RID`)
|
||||
|
@ -116,9 +117,11 @@ function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
|
|||
AND `start` BETWEEN ? AND ?
|
||||
AND `NeededAngelTypes`.`angel_type_id` IN (' . implode(',', $shiftsFilter->getTypes()) . ')
|
||||
AND `NeededAngelTypes`.`count` > 0
|
||||
AND NOT s.shift_id IS NULL) AS tmp_shifts
|
||||
AND NOT s.shift_id IS NULL
|
||||
) AS tmp_shifts
|
||||
|
||||
ORDER BY `room_name`, `start`';
|
||||
ORDER BY `room_name`, `start`
|
||||
';
|
||||
|
||||
return DB::select(
|
||||
$sql,
|
||||
|
@ -168,7 +171,8 @@ function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
|
|||
LEFT JOIN schedule_shift AS s on Shifts.SID = s.shift_id
|
||||
WHERE `Shifts`.`RID` IN (' . implode(',', $shiftsFilter->getRooms()) . ')
|
||||
AND `start` BETWEEN ? AND ?
|
||||
AND NOT s.shift_id IS NULL';
|
||||
AND NOT s.shift_id IS NULL
|
||||
';
|
||||
|
||||
return DB::select(
|
||||
$sql,
|
||||
|
|
|
@ -281,13 +281,11 @@ function User_get_shifts_sum_query()
|
|||
|
||||
return sprintf('
|
||||
COALESCE(SUM(
|
||||
(1 +
|
||||
(
|
||||
(1 + (
|
||||
(HOUR(FROM_UNIXTIME(`Shifts`.`end`)) > %1$d AND HOUR(FROM_UNIXTIME(`Shifts`.`end`)) < %2$d)
|
||||
OR (HOUR(FROM_UNIXTIME(`Shifts`.`start`)) > %1$d AND HOUR(FROM_UNIXTIME(`Shifts`.`start`)) < %2$d)
|
||||
OR (HOUR(FROM_UNIXTIME(`Shifts`.`start`)) <= %1$d AND HOUR(FROM_UNIXTIME(`Shifts`.`end`)) >= %2$d)
|
||||
)
|
||||
)
|
||||
))
|
||||
* (`Shifts`.`end` - `Shifts`.`start`)
|
||||
* (1 - (%3$d + 1) * `ShiftEntry`.`freeloaded`)
|
||||
), 0)
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
|
||||
use Engelsystem\Renderer\Twig\Extensions\Assets;
|
||||
|
||||
/**
|
||||
* Render a stat for dashborad (big number with label).
|
||||
* If no style given, style is danger if number > 0, and success if number == 0.
|
||||
|
@ -194,12 +192,12 @@ function toolbar_item_divider()
|
|||
*/
|
||||
function toolbar_dropdown($glyphicon, $label, $submenu, $class = '')
|
||||
{
|
||||
return '<li class="dropdown ' . $class . '">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">'
|
||||
return '<li class="dropdown ' . $class . '">'
|
||||
. '<a href="#" class="dropdown-toggle" data-toggle="dropdown">'
|
||||
. ($glyphicon != '' ? '<span class="glyphicon glyphicon-' . $glyphicon . '"></span> ' : '')
|
||||
. $label
|
||||
. ' <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">'
|
||||
. '<span class="caret"></span></a>'
|
||||
. '<ul class="dropdown-menu" role="menu">'
|
||||
. join("\n", $submenu)
|
||||
. '</ul></li>';
|
||||
}
|
||||
|
@ -214,12 +212,12 @@ function toolbar_dropdown($glyphicon, $label, $submenu, $class = '')
|
|||
function toolbar_popover($glyphicon, $label, $content, $class = '')
|
||||
{
|
||||
$dom_id = md5(microtime() . $glyphicon . $label);
|
||||
return '<li class="dropdown messages ' . $class . '">
|
||||
<a id="' . $dom_id . '" href="#" tabindex="0">'
|
||||
return '<li class="dropdown messages ' . $class . '">'
|
||||
. '<a id="' . $dom_id . '" href="#" tabindex="0">'
|
||||
. ($glyphicon != '' ? '<span class="glyphicon glyphicon-' . $glyphicon . '"></span> ' : '')
|
||||
. $label
|
||||
. ' <span class="caret"></span></a>
|
||||
<script type="text/javascript">
|
||||
. ' <span class="caret"></span></a>'
|
||||
. '<script type="text/javascript">
|
||||
$(function(){
|
||||
$(\'#' . $dom_id . '\').popover({
|
||||
trigger: \'click\',
|
||||
|
|
|
@ -53,7 +53,8 @@ function UserDriverLicense_edit_view($user_source, $wants_to_drive, $user_driver
|
|||
], 'driving_license'),
|
||||
form_submit('submit', __('Save'))
|
||||
]),
|
||||
'<script type="text/javascript">
|
||||
'
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var checkbox = $(\'#wants_to_drive\');
|
||||
if(checkbox.is(\':checked\'))
|
||||
|
@ -61,15 +62,14 @@ function UserDriverLicense_edit_view($user_source, $wants_to_drive, $user_driver
|
|||
else
|
||||
$(\'#driving_license\').hide();
|
||||
|
||||
checkbox.click(
|
||||
function() {
|
||||
checkbox.click(function() {
|
||||
if($(\'#wants_to_drive\').is(\':checked\'))
|
||||
$(\'#driving_license\').show();
|
||||
else
|
||||
$(\'#driving_license\').hide();
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>'
|
||||
});
|
||||
</script>
|
||||
'
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue