@ -13,8 +13,8 @@ function shift_entry_add_controller()
redirect(page_link_to('user_shifts'));
redirect(page_link_to('user_shifts'));
}
}
// Locations laden
// Locations laden
$rooms = sql_select("SELECT * FROM `Room` WHERE `show`='Y' ORDER BY `Name`");
$rooms = sql_select("SELECT * FROM `Room` WHERE `show`='Y' ORDER BY `Name`");
$room_array = [];
$room_array = [];
foreach ($rooms as $room) {
foreach ($rooms as $room) {
$room_array[$room['RID']] = $room['Name'];
$room_array[$room['RID']] = $room['Name'];
@ -35,7 +35,18 @@ function shift_entry_add_controller()
if (in_array('user_shifts_admin', $privileges) || in_array('shiftentry_edit_angeltype_supporter', $privileges)) {
if (in_array('user_shifts_admin', $privileges) || in_array('shiftentry_edit_angeltype_supporter', $privileges)) {
$type = AngelType($type_id);
$type = AngelType($type_id);
} else {
} else {
$type = sql_select("SELECT * FROM `UserAngelTypes` JOIN `AngelTypes` ON (`UserAngelTypes`.`angeltype_id` = `AngelTypes`.`id`) WHERE `AngelTypes`.`id` = '" . sql_escape($type_id) . "' AND (`AngelTypes`.`restricted` = 0 OR (`UserAngelTypes`.`user_id` = '" . sql_escape($user['UID']) . "' AND NOT `UserAngelTypes`.`confirm_user_id` IS NULL))");
$type = sql_select("
SELECT * FROM `UserAngelTypes`
JOIN `AngelTypes` ON (`UserAngelTypes`.`angeltype_id` = `AngelTypes`.`id`)
WHERE `AngelTypes`.`id` = '" . sql_escape($type_id) . "'
$users = sql_select("SELECT *, (SELECT count(*) FROM `ShiftEntry` WHERE `freeloaded`=1 AND `ShiftEntry`.`UID`=`User`.`UID`) AS `freeloaded` FROM `User` ORDER BY `Nick`");
$users = sql_select("
SELECT *, (SELECT count(*) FROM `ShiftEntry` WHERE `freeloaded`=1 AND `ShiftEntry`.`UID`=`User`.`UID`) AS `freeloaded`
error(sprintf(_("Do you want to delete the shift %s from %s to %s?"), $shift['name'], date("Y-m-d H:i", $shift['start']), date("H:i", $shift['end'])), true),
$success_message = sprintf($supporter ? _("Added supporter rights for %s to %s.") : _("Removed supporter rights for %s from %s."), AngelType_name_render($angeltype), User_Nick_render($user_source));
$success_message = sprintf(
$supporter ? _("Added supporter rights for %s to %s.") : _("Removed supporter rights for %s from %s."),
AngelType_name_render($angeltype),
User_Nick_render($user_source)
);
engelsystem_log($success_message);
engelsystem_log($success_message);
success($success_message);
success($success_message);
@ -259,9 +274,9 @@ function user_angeltype_update_controller()
return sprintf(_("You joined an angeltype which requires a driving license. Please edit your driving license information here: %s."), '<ahref="' . user_driver_license_edit_link() . '">' . _("driving license information") . '</a>');
return sprintf(
_("You joined an angeltype which requires a driving license. Please edit your driving license information here: %s."),
$shift['needed_angeltypes'] = sql_select("SELECT DISTINCT `AngelTypes`.* FROM `ShiftEntry` JOIN `AngelTypes` ON `ShiftEntry`.`TID`=`AngelTypes`.`id` WHERE `ShiftEntry`.`SID`='" . sql_escape($shift['SID']) . "' ORDER BY `AngelTypes`.`name`");
$shift['needed_angeltypes'] = sql_select("SELECT DISTINCT `AngelTypes`.* FROM `ShiftEntry` JOIN `AngelTypes` ON `ShiftEntry`.`TID`=`AngelTypes`.`id` WHERE `ShiftEntry`.`SID`='" . sql_escape($shift['SID']) . "' ORDER BY `AngelTypes`.`name`");
foreach ($shift['needed_angeltypes'] as &$needed_angeltype) {
foreach ($shift['needed_angeltypes'] as &$needed_angeltype) {
@ -10,7 +10,10 @@ function engelsystem_email_to_user($recipient_user, $title, $message, $not_if_it
gettext_locale($recipient_user['Sprache']);
gettext_locale($recipient_user['Sprache']);
$message = sprintf(_("Hi %s,"), $recipient_user['Nick']) . "\n\n" . _("here is a message for you from the engelsystem:") . "\n\n" . $message . "\n\n" . _("This email is autogenerated and has not to be signed. You got this email because you are registered in the engelsystem.");
engelsystem_email_to_user($user, '[engelsystem] ' . _("Your account has been deleted"), _("Your angelsystem account has been deleted. If you have any questions regarding your account deletion, please contact heaven."));
engelsystem_email_to_user(
$user,
'[engelsystem] ' . _("Your account has been deleted"),
_("Your angelsystem account has been deleted. If you have any questions regarding your account deletion, please contact heaven.")
if (isset($_REQUEST['id']) && preg_match("/^-[0-9]{1,11}$/", $_REQUEST['id'])) {
if (isset($_REQUEST['id']) && preg_match("/^-[0-9]{1,11}$/", $_REQUEST['id'])) {
$group_id = $_REQUEST['id'];
$group_id = $_REQUEST['id'];
} else {
} else {
return error("Incomplete call, missing Groups ID.", true);
return error("Incomplete call, missing Groups ID.", true);
}
}
$group = sql_select("SELECT * FROM `Groups` WHERE `UID`='" . sql_escape($group_id) . "' LIMIT 1");
$group = sql_select("SELECT * FROM `Groups` WHERE `UID`='" . sql_escape($group_id) . "' LIMIT 1");
if (count($group) > 0) {
if (count($group) > 0) {
list($group) = $group;
list($group) = $group;
$privileges = sql_select("SELECT `Privileges`.*, `GroupPrivileges`.`group_id` FROM `Privileges` LEFT OUTER JOIN `GroupPrivileges` ON (`Privileges`.`id` = `GroupPrivileges`.`privilege_id` AND `GroupPrivileges`.`group_id`='" . sql_escape($group_id) . "') ORDER BY `Privileges`.`name`");
$groups_source = sql_select("SELECT * FROM `Groups` LEFT OUTER JOIN `UserGroups` ON (`UserGroups`.`group_id` = `Groups`.`UID` AND `UserGroups`.`uid` = '" . sql_escape($user_id) . "') WHERE `Groups`.`UID` >= '" . sql_escape($my_highest_group[0]['group_id']) . "' ORDER BY `Groups`.`Name`");
$groups_source = sql_select("SELECT * FROM `Groups` LEFT OUTER JOIN `UserGroups` ON (`UserGroups`.`group_id` = `Groups`.`UID` AND `UserGroups`.`uid` = '" . sql_escape($user_id) . "') WHERE `Groups`.`UID` >= '" . sql_escape($my_highest_group[0]['group_id']) . "' ORDER BY `Groups`.`Name`");
$groups = [];
$groups = [];
$grouplist = [];
$grouplist = [];
foreach ($groups_source as $group) {
foreach ($groups_source as $group) {
$groups[$group['UID']] = $group;
$groups[$group['UID']] = $group;
$grouplist[] = $group['UID'];
$grouplist[] = $group['UID'];
}
}
if (! is_array($_REQUEST['groups'])) {
if (!is_array($_REQUEST['groups'])) {
$_REQUEST['groups'] = [];
$_REQUEST['groups'] = [];
}
}
sql_query("DELETE FROM `UserGroups` WHERE `uid`='" . sql_escape($user_id) . "'");
sql_query("DELETE FROM `UserGroups` WHERE `uid`='" . sql_escape($user_id) . "'");
$user_groups_info = [];
$user_groups_info = [];
foreach ($_REQUEST['groups'] as $group) {
foreach ($_REQUEST['groups'] as $group) {
if (in_array($group, $grouplist)) {
if (in_array($group, $grouplist)) {
sql_query("INSERT INTO `UserGroups` SET `uid`='" . sql_escape($user_id) . "', `group_id`='" . sql_escape($group) . "'");
sql_query("INSERT INTO `UserGroups` SET `uid`='" . sql_escape($user_id) . "', `group_id`='" . sql_escape($group) . "'");
$user_groups_info[] = $groups[$group]['Name'];
$user_groups_info[] = $groups[$group]['Name'];
}
}
$user_source = User($user_id);
engelsystem_log("Set groups of " . User_Nick_render($user_source) . " to: " . join(", ",
form_checkboxes('angel_types', _("What do you want to do?") . sprintf(" (<ahref=\"%s\">%s</a>)", page_link_to('angeltypes') . '&action=about', _("Description of job types")), $angel_types, $selected_angel_types),
div('col-sm-6', [
form_info("", _("Restricted angel types need will be confirmed later by a supporter. You can change your selection in the options section."))
$done_shifts_seconds = sql_select_single_cell("SELECT SUM(`Shifts`.`end` - `Shifts`.`start`) FROM `ShiftEntry` JOIN `Shifts` USING (`SID`) WHERE `Shifts`.`end` <UNIX_TIMESTAMP()");
$done_shifts_seconds = sql_select_single_cell("SELECT SUM(`Shifts`.`end` - `Shifts`.`start`) FROM `ShiftEntry` JOIN `Shifts` USING (`SID`) WHERE `Shifts`.`end` <UNIX_TIMESTAMP()");
$users = sql_select("SELECT * FROM `User` WHERE NOT `UID`='" . sql_escape($user['UID']) . "' ORDER BY `Nick`");
$users = sql_select("SELECT * FROM `User` WHERE NOT `UID`='" . sql_escape($user['UID']) . "' ORDER BY `Nick`");
$to_select_data = [
$to_select_data = [
"" => _("Select recipient...")
"" => _("Select recipient...")
];
];
foreach ($users as $u) {
foreach ($users as $u) {
$to_select_data[$u['UID']] = $u['Nick'];
$to_select_data[$u['UID']] = $u['Nick'];
@ -38,96 +38,104 @@ function user_messages()
$messages = sql_select("SELECT * FROM `Messages` WHERE `SUID`='" . sql_escape($user['UID']) . "' OR `RUID`='" . sql_escape($user['UID']) . "' ORDER BY `isRead`,`Datum` DESC");
$messages = sql_select("SELECT * FROM `Messages` WHERE `SUID`='" . sql_escape($user['UID']) . "' OR `RUID`='" . sql_escape($user['UID']) . "' ORDER BY `isRead`,`Datum` DESC");
error(_("If you reset the key, the url to your iCal- and JSON-export and your atom feed changes! You have to update it in every application using one of these exports."), true),
_("If you reset the key, the url to your iCal- and JSON-export and your atom feed changes! You have to update it in every application using one of these exports."),
error(_("Please enter your planned date of departure. It should be after your planned arrival date and after buildup start date and before teardown end date."));
error(_("Please enter your planned date of departure. It should be after your planned arrival date and after buildup start date and before teardown end date."));
// Löschen einzelner Schicht-Einträge (Also Belegung einer Schicht von Engeln) durch Admins
// Löschen einzelner Schicht-Einträge (Also Belegung einer Schicht von Engeln) durch Admins
if (isset($_REQUEST['entry_id'])) {
if (isset($_REQUEST['entry_id'])) {
return shift_entry_delete_controller();
return shift_entry_delete_controller();
} elseif (isset($_REQUEST['edit_shift'])) {
} elseif (isset($_REQUEST['edit_shift'])) {
return shift_edit_controller();
return shift_edit_controller();
} elseif (isset($_REQUEST['delete_shift'])) {
} elseif (isset($_REQUEST['delete_shift'])) {
return shift_delete_controller();
return shift_delete_controller();
} elseif (isset($_REQUEST['shift_id'])) {
} elseif (isset($_REQUEST['shift_id'])) {
return shift_entry_add_controller();
return shift_entry_add_controller();
}
}
return view_user_shifts();
return view_user_shifts();
}
}
@ -66,9 +66,9 @@ function update_ShiftsFilter_timerange(ShiftsFilter $shiftsFilter, $days)
*
*
* @param ShiftsFilter $shiftsFilter
* @param ShiftsFilter $shiftsFilter
* The shifts filter to update from request data
* The shifts filter to update from request data
* @param boolean $user_shifts_admin
* @param boolean $user_shifts_admin
* Has the user user_shift_admin privilege?
* Has the user user_shift_admin privilege?
* @param string[] $days
* @param string[] $days
* An array of available filter days
* An array of available filter days
*/
*/
function update_ShiftsFilter(ShiftsFilter $shiftsFilter, $user_shifts_admin, $days)
function update_ShiftsFilter(ShiftsFilter $shiftsFilter, $user_shifts_admin, $days)
@ -111,7 +111,25 @@ function load_types()
error(_("The administration has not configured any angeltypes yet - or you are not subscribed to any angeltype."));
error(_("The administration has not configured any angeltypes yet - or you are not subscribed to any angeltype."));
redirect('?');
redirect('?');
}
}
$types = sql_select("SELECT `AngelTypes`.`id`, `AngelTypes`.`name`, (`AngelTypes`.`restricted`=0 OR (NOT `UserAngelTypes`.`confirm_user_id` IS NULL OR `UserAngelTypes`.`id` IS NULL)) as `enabled` FROM `AngelTypes` LEFT JOIN `UserAngelTypes` ON (`UserAngelTypes`.`angeltype_id`=`AngelTypes`.`id` AND `UserAngelTypes`.`user_id`='" . sql_escape($user['UID']) . "') ORDER BY `AngelTypes`.`name`");
$types = sql_select("
SELECT
`AngelTypes`.`id`,
`AngelTypes`.`name`,
(
`AngelTypes`.`restricted`=0
OR (
NOT `UserAngelTypes`.`confirm_user_id` IS NULL
OR `UserAngelTypes`.`id` IS NULL
)
) AS `enabled`
FROM `AngelTypes`
LEFT JOIN `UserAngelTypes`
ON (
`UserAngelTypes`.`angeltype_id`=`AngelTypes`.`id`
AND `UserAngelTypes`.`user_id`='" . sql_escape($user['UID']) . "'
)
ORDER BY `AngelTypes`.`name`
");
if (empty($types)) {
if (empty($types)) {
return sql_select("SELECT `id`, `name` FROM `AngelTypes` WHERE `restricted` = 0");
return sql_select("SELECT `id`, `name` FROM `AngelTypes` WHERE `restricted` = 0");
'task_notice' => '<sup>1</sup>' . _("The tasks shown here are influenced by the angeltypes you joined already!") . " <ahref=\"".page_link_to('angeltypes').'&action=about'."\">" . _("Description of the jobs.") . "</a>",
_("Export of shown shifts. <ahref=\"%s\">iCal format</a> or <ahref=\"%s\">JSON format</a> available (please keep secret, otherwise <ahref=\"%s\">reset the api key</a>)."),
info(sprintf($supporter ? _("Do you really want to add supporter rights for %s to %s?") : _("Do you really want to remove supporter rights for %s from %s?"), $angeltype['name'], User_Nick_render($user)), true),
button(user_link($user_source), _("Back to profile"), 'back')
button(user_link($user_source), _("Back to profile"), 'back')
]),
]),
msg(),
msg(),
form([
form([
form_info(_("Privacy"), _("Your driving license information is only visible for supporters and admins.")),
form_info(_("Privacy"), _("Your driving license information is only visible for supporters and admins.")),
form_checkbox('wants_to_drive', _("I am willing to operate cars for the PL"), $wants_to_drive),
form_checkbox('wants_to_drive', _("I am willing to operate cars for the PL"), $wants_to_drive),
div('panel panel-default', [
div('panel panel-default', [
div('panel-body', [
div('panel-body', [
form_checkbox('has_car', _("I have my own car with me and am willing to use it for the PL (You'll get reimbursed for fuel)"), $user_driver_license['has_car']),
form_checkbox('email_shiftinfo', _("The engelsystem is allowed to send me an email (e.g. when my shifts change)"), $user_source['email_shiftinfo']),
'planned_departure_date',
form_checkbox('email_by_human_allowed', _("Humans are allowed to send me an email (e.g. for ticket vouchers)"), $user_source['email_by_human_allowed']),
$its_me ? info(glyph('info-sign') . _("Your night shifts between 2 and 8 am count twice."), true) : '',
: '',
$its_me && count($shifts) == 0 ? error(sprintf(_("Go to the <ahref=\"%s\">shifts table</a> to sign yourself up for some shifts."), page_link_to('user_shifts')), true) : ''
@ -460,7 +566,7 @@ function render_user_departure_date_hint()
{
{
global $user;
global $user;
if (!isset($user['planned_departure_date']) || $user['planned_departure_date'] == null) {
if (!isset($user['planned_departure_date']) || $user['planned_departure_date'] == null) {
return _("Please enter your planned date of departure on your settings page to give us a feeling for teardown capacities.");
return _("Please enter your planned date of departure on your settings page to give us a feeling for teardown capacities.");
}
}
@ -472,7 +578,10 @@ function render_user_freeloader_hint()
global $user, $max_freeloadable_shifts;
global $user, $max_freeloadable_shifts;
if (User_is_freeloader($user)) {
if (User_is_freeloader($user)) {
return sprintf(_("You freeloaded at least %s shifts. Shift signup is locked. Please go to heavens desk to be unlocked again."), $max_freeloadable_shifts);
return sprintf(
_("You freeloaded at least %s shifts. Shift signup is locked. Please go to heavens desk to be unlocked again."),
The <spanclass="icon-icon_angel"></span><strong>ENGELSYSTEM</strong> is in maintenance mode.
<divclass="col-md-6">
</h2>
<h2>
<p>This may be due to...</p>
The <spanclass="icon-icon_angel"></span><strong>ENGELSYSTEM</strong> is in maintenance mode.
<p>
</h2>
...archangels closing the gates of heaven. <br>...somebody's stolen the power chord and now the battery is empty. <br>...DHCP decided to give me another ip address.
<p>This may be due to...</p>
</p>
<p>
</div>
...archangels closing the gates of heaven. <br>
<divclass="col-md-6">
...somebody's stolen the power chord and now the battery is empty. <br>
<p>The great interest in becoming an angel and participating at 33C3 is is something we are grateful for every time. There is a record number of angels and helping volunteers this year.</p>
<p>
<p>We did anticipate a great number but we are overwhelmed by this endless wave of support. We do want to enable each and every one of you to be an angel at the congress, but sadly our resources and capacities at Heaven are limited. The amount of angels at this point is beyond our
The great interest in becoming an angel and participating at 33C3 is is something we are
planing and to ensure we can support the angels already checked in. We did make a choice never thought possible on a chaos event:</p>
grateful for every time. There is a record number of angels and helping volunteers this year.
<p>We closed the registration in the Engelsystem and at Heaven Desk at 19:00 27. Dec. 2016.</p>
</p>
<p>Everyone of us works for you to support you in being an angel, but the Heaven Desk and the Kitchen among others are limited and so we decided to focus our effort to support those of you already arrived to the best of our abilities.</p>
<p>
<p>
We did anticipate a great number but we are overwhelmed by this endless wave of support. We do
For the Heaven Team<br/> Agnes, Jen, LLF and Knuth
want to enable each and every one of you to be an angel at the congress, but sadly our resources
</p>
and capacities at Heaven are limited. The amount of angels at this point is beyond our
</div>
planing and to ensure we can support the angels already checked in. We did make a choice never
thought possible on a chaos event:
</p>
<p>
We closed the registration in the Engelsystem and at Heaven Desk at 19:00 27. Dec. 2016.
</p>
<p>
Everyone of us works for you to support you in being an angel, but the Heaven Desk and the
Kitchen among others are limited and so we decided to focus our effort to support those of you
The original system was written by <ahref="https://github.com/cookieBerlin/engelsystem">cookie</a>. It was then completely rewritten and greatly enhanced by <ahref="http://notrademark.de/">msquare</a> and <ahref="http://mortzu.de/">mortzu</a> of <ahref="http://planetcyborg.de">planet
The original system was written by <ahref="https://github.com/cookieBerlin/engelsystem">cookie</a>.
cyborg</a>, <ahref="http://jplitza.de/">jplitza</a> and gnomus.
It was then completely rewritten and greatly enhanced by <ahref="http://notrademark.de/">msquare</a>
</p>
and <ahref="http://myigel.name/">MyIgel</a>,
<p>
<ahref="http://mortzu.de/">mortzu</a> of <ahref="http://planetcyborg.de">planet cyborg</a>,
Please look at the <ahref="https://github.com/engelsystem/engelsystem/graphs/contributors">contributor list on github</a> for a more complete version.
<ahref="http://jplitza.de/">jplitza</a> and gnomus.
</p>
</p>
<p>
Please look at the <ahref="https://github.com/engelsystem/engelsystem/graphs/contributors">contributor
list on github</a> for a more complete version.
</p>
</div>
<divclass="col-md-4">
<h2>Hosting</h2>
<p>
Webspace, development platform and domain is currently provided by
<ahref="https://www.wybt.net/">would you buy this?</a> (ichdasich)<br/>
and adminstrated by <ahref="http://mortzu.de/">mortzu</a>,
<ahref="http://derf.homelinux.org/">derf</a>
and ichdasich.
</p>
</div>
<divclass="col-md-4">
<h2>Translation</h2>
<p>
Many thanks for the german translation: <ahref="http://e7p.de">e7p</a>
</p>
</div>
</div>
</div>
<divclass="col-md-4">
<h2>Hosting</h2>
<p>
Webspace, development platform and domain is currently provided by <ahref="https://www.wybt.net/">would you buy this?</a> (ichdasich)<br/> and adminstrated by <ahref="http://mortzu.de/">mortzu</a>, <ahref="http://derf.homelinux.org/">derf</a> and ichdasich.
</p>
</div>
<divclass="col-md-4">
<h2>Translation</h2>
<p>
Many thanks for the german translation: <ahref="http://e7p.de">e7p</a>