Merge remote-tracking branch 'MyIgel/translations'

main
Igor Scheller 6 years ago
commit d0abc27c07

@ -17,7 +17,10 @@
"php": ">=7.0.0",
"ext-gettext": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-PDO": "*",
"ext-SimpleXML": "*",
"ext-xml": "*",
"erusev/parsedown": "^1.6",
"illuminate/container": "5.5.*",
"illuminate/database": "5.5.*",

@ -113,7 +113,6 @@ return [
// Available T-Shirt sizes, set value to null if not available
'tshirt_sizes' => [
'' => _('Please select...'),
'S' => 'S',
'S-G' => 'S Girl',
'M' => 'M',

@ -10,7 +10,7 @@ use Engelsystem\ShiftsFilterRenderer;
*/
function angeltypes_title()
{
return _('Angeltypes');
return __('Angeltypes');
}
/**
@ -66,7 +66,7 @@ function angeltypes_about_controller()
}
return [
_('Teams/Job description'),
__('Teams/Job description'),
AngelTypes_about_view($angeltypes, isset($user))
];
}
@ -88,12 +88,12 @@ function angeltype_delete_controller()
if (request()->has('confirmed')) {
AngelType_delete($angeltype);
success(sprintf(_('Angeltype %s deleted.'), AngelType_name_render($angeltype)));
success(sprintf(__('Angeltype %s deleted.'), AngelType_name_render($angeltype)));
redirect(page_link_to('angeltypes'));
}
return [
sprintf(_('Delete angeltype %s'), $angeltype['name']),
sprintf(__('Delete angeltype %s'), $angeltype['name']),
AngelType_delete_view($angeltype)
];
}
@ -136,7 +136,7 @@ function angeltype_edit_controller()
$angeltype['name'] = $result->getValue();
if (!$result->isValid()) {
$valid = false;
error(_('Please check the name. Maybe it already exists.'));
error(__('Please check the name. Maybe it already exists.'));
}
}
@ -166,7 +166,7 @@ function angeltype_edit_controller()
}
return [
sprintf(_('Edit %s'), $angeltype['name']),
sprintf(__('Edit %s'), $angeltype['name']),
AngelType_edit_view($angeltype, $supporter_mode)
];
}
@ -204,7 +204,7 @@ function angeltype_controller()
}
return [
sprintf(_('Team %s'), $angeltype['name']),
sprintf(__('Team %s'), $angeltype['name']),
AngelType_view(
$angeltype,
$members,
@ -289,7 +289,7 @@ function angeltypes_list_controller()
$actions = [
button(
page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]),
_('view'),
__('view'),
'btn-xs'
)
];
@ -297,12 +297,12 @@ function angeltypes_list_controller()
if (in_array('admin_angel_types', $privileges)) {
$actions[] = button(
page_link_to('angeltypes', ['action' => 'edit', 'angeltype_id' => $angeltype['id']]),
_('edit'),
__('edit'),
'btn-xs'
);
$actions[] = button(
page_link_to('angeltypes', ['action' => 'delete', 'angeltype_id' => $angeltype['id']]),
_('delete'),
__('delete'),
'btn-xs'
);
}
@ -313,13 +313,13 @@ function angeltypes_list_controller()
page_link_to('user_angeltypes',
['action' => 'delete', 'user_angeltype_id' => $angeltype['user_angeltype_id']]
),
_('leave'),
__('leave'),
'btn-xs'
);
} else {
$actions[] = button(
page_link_to('user_angeltypes', ['action' => 'add', 'angeltype_id' => $angeltype['id']]),
_('join'),
__('join'),
'btn-xs'
);
}
@ -356,7 +356,7 @@ function load_angeltype()
$angeltype = AngelType($request->input('angeltype_id'));
if (empty($angeltype)) {
error(_('Angeltype doesn\'t exist . '));
error(__('Angeltype doesn\'t exist . '));
redirect(page_link_to('angeltypes'));
}

@ -5,7 +5,7 @@
*/
function event_config_title()
{
return _('Event config');
return __('Event config');
}
/**
@ -54,40 +54,40 @@ function event_config_edit_controller()
$event_welcome_msg = null;
}
$result = check_request_date('buildup_start_date', _('Please enter buildup start date.'), true);
$result = check_request_date('buildup_start_date', __('Please enter buildup start date.'), true);
$buildup_start_date = $result->getValue();
$valid &= $result->isValid();
$result = check_request_date('event_start_date', _('Please enter event start date.'), true);
$result = check_request_date('event_start_date', __('Please enter event start date.'), true);
$event_start_date = $result->getValue();
$valid &= $result->isValid();
$result = check_request_date('event_end_date', _('Please enter event end date.'), true);
$result = check_request_date('event_end_date', __('Please enter event end date.'), true);
$event_end_date = $result->getValue();
$valid &= $result->isValid();
$result = check_request_date('teardown_end_date', _('Please enter teardown end date.'), true);
$result = check_request_date('teardown_end_date', __('Please enter teardown end date.'), true);
$teardown_end_date = $result->getValue();
$valid &= $result->isValid();
if (!is_null($buildup_start_date) && !is_null($event_start_date) && $buildup_start_date > $event_start_date) {
$valid = false;
error(_('The buildup start date has to be before the event start date.'));
error(__('The buildup start date has to be before the event start date.'));
}
if (!is_null($event_start_date) && !is_null($event_end_date) && $event_start_date > $event_end_date) {
$valid = false;
error(_('The event start date has to be before the event end date.'));
error(__('The event start date has to be before the event end date.'));
}
if (!is_null($event_end_date) && !is_null($teardown_end_date) && $event_end_date > $teardown_end_date) {
$valid = false;
error(_('The event end date has to be before the teardown end date.'));
error(__('The event end date has to be before the teardown end date.'));
}
if (!is_null($buildup_start_date) && !is_null($teardown_end_date) && $buildup_start_date > $teardown_end_date) {
$valid = false;
error(_('The buildup start date has to be before the teardown end date.'));
error(__('The buildup start date has to be before the teardown end date.'));
}
if ($valid) {
@ -111,7 +111,7 @@ function event_config_edit_controller()
date('Y-m-d', $teardown_end_date)
)
);
success(_('Settings saved.'));
success(__('Settings saved.'));
redirect(page_link_to('admin_event_config'));
}
}

@ -24,7 +24,7 @@ function public_dashboard_controller()
}
return [
_('Public Dashboard'),
__('Public Dashboard'),
public_dashboard_view($stats, $free_shifts)
];
}

@ -106,7 +106,7 @@ function shift_entry_create_controller_admin($shift, $angeltype)
'freeload_comment' => ''
]);
success(sprintf(_('%s has been subscribed to the shift.'), User_Nick_render($signup_user)));
success(sprintf(__('%s has been subscribed to the shift.'), User_Nick_render($signup_user)));
redirect(shift_link($shift));
}
@ -146,7 +146,7 @@ function shift_entry_create_controller_supporter($shift, $angeltype)
$signup_user = User($request->input('user_id'));
}
if (!UserAngelType_exists($signup_user, $angeltype)) {
error(_('User is not in angeltype.'));
error(__('User is not in angeltype.'));
redirect(shift_link($shift));
}
@ -163,7 +163,7 @@ function shift_entry_create_controller_supporter($shift, $angeltype)
);
if (!$shift_signup_state->isSignupAllowed()) {
if ($shift_signup_state->getState() == ShiftSignupState::OCCUPIED) {
error(_('This shift is already occupied.'));
error(__('This shift is already occupied.'));
}
redirect(shift_link($shift));
}
@ -178,7 +178,7 @@ function shift_entry_create_controller_supporter($shift, $angeltype)
'freeload_comment' => ''
]);
success(sprintf(_('%s has been subscribed to the shift.'), User_Nick_render($signup_user)));
success(sprintf(__('%s has been subscribed to the shift.'), User_Nick_render($signup_user)));
redirect(shift_link($shift));
}
@ -203,17 +203,17 @@ function shift_entry_create_controller_supporter($shift, $angeltype)
function shift_entry_error_message(ShiftSignupState $shift_signup_state)
{
if ($shift_signup_state->getState() == ShiftSignupState::ANGELTYPE) {
error(_('You need be accepted member of the angeltype.'));
error(__('You need be accepted member of the angeltype.'));
} elseif ($shift_signup_state->getState() == ShiftSignupState::COLLIDES) {
error(_('This shift collides with one of your shifts.'));
error(__('This shift collides with one of your shifts.'));
} elseif ($shift_signup_state->getState() == ShiftSignupState::OCCUPIED) {
error(_('This shift is already occupied.'));
error(__('This shift is already occupied.'));
} elseif ($shift_signup_state->getState() == ShiftSignupState::SHIFT_ENDED) {
error(_('This shift ended already.'));
error(__('This shift ended already.'));
} elseif ($shift_signup_state->getState() == ShiftSignupState::NOT_ARRIVED) {
error(_('You are not marked as arrived.'));
error(__('You are not marked as arrived.'));
} elseif ($shift_signup_state->getState() == ShiftSignupState::SIGNED_UP) {
error(_('You are signed up for this shift.'));
error(__('You are signed up for this shift.'));
}
}
@ -263,7 +263,7 @@ function shift_entry_create_controller_user($shift, $angeltype)
UserAngelType_create($signup_user, $angeltype);
}
success(_('You are subscribed. Thank you!'));
success(__('You are subscribed. Thank you!'));
redirect(shift_link($shift));
}
@ -322,7 +322,7 @@ function shift_entry_load()
}
$shiftEntry = ShiftEntry($request->input('shift_entry_id'));
if (empty($shiftEntry)) {
error(_('Shift entry not found.'));
error(__('Shift entry not found.'));
redirect(page_link_to('user_shifts'));
}
@ -344,13 +344,13 @@ function shift_entry_delete_controller()
$angeltype = AngelType($shiftEntry['TID']);
$signout_user = User($shiftEntry['UID']);
if (!Shift_signout_allowed($shift, $angeltype, $signout_user)) {
error(_('You are not allowed to remove this shift entry. If necessary, ask your supporter or heaven to do so.'));
error(__('You are not allowed to remove this shift entry. If necessary, ask your supporter or heaven to do so.'));
redirect(user_link($signout_user));
}
if ($request->has('continue')) {
ShiftEntry_delete($shiftEntry);
success(_('Shift entry removed.'));
success(__('Shift entry removed.'));
redirect(shift_link($shift));
}

@ -94,33 +94,33 @@ function shift_edit_controller()
$rid = $request->input('rid');
} else {
$valid = false;
$msg .= error(_('Please select a room.'), true);
$msg .= error(__('Please select a room.'), true);
}
if ($request->has('shifttype_id') && isset($shifttypes[$request->input('shifttype_id')])) {
$shifttype_id = $request->input('shifttype_id');
} else {
$valid = false;
$msg .= error(_('Please select a shifttype.'), true);
$msg .= error(__('Please select a shifttype.'), true);
}
if ($request->has('start') && $tmp = parse_date('Y-m-d H:i', $request->input('start'))) {
$start = $tmp;
} else {
$valid = false;
$msg .= error(_('Please enter a valid starting time for the shifts.'), true);
$msg .= error(__('Please enter a valid starting time for the shifts.'), true);
}
if ($request->has('end') && $tmp = parse_date('Y-m-d H:i', $request->input('end'))) {
$end = $tmp;
} else {
$valid = false;
$msg .= error(_('Please enter a valid ending time for the shifts.'), true);
$msg .= error(__('Please enter a valid ending time for the shifts.'), true);
}
if ($start >= $end) {
$valid = false;
$msg .= error(_('The ending time has to be after the starting time.'), true);
$msg .= error(__('The ending time has to be after the starting time.'), true);
}
foreach ($needed_angel_types as $needed_angeltype_id => $count) {
@ -133,7 +133,7 @@ function shift_edit_controller()
} else {
$valid = false;
$msg .= error(sprintf(
_('Please check your input for needed angels of type %s.'),
__('Please check your input for needed angels of type %s.'),
$angeltypes[$needed_angeltype_id]
), true);
}
@ -163,7 +163,7 @@ function shift_edit_controller()
. ' to ' . date('Y-m-d H:i', $end)
. ' with angel types ' . join(', ', $needed_angel_types_info)
);
success(_('Shift updated.'));
success(__('Shift updated.'));
redirect(shift_link([
'SID' => $shift_id
@ -182,17 +182,17 @@ function shift_edit_controller()
[
msg(),
'<noscript>'
. info(_('This page is much more comfortable with javascript.'), true)
. info(__('This page is much more comfortable with javascript.'), true)
. '</noscript>',
form([
form_select('shifttype_id', _('Shifttype'), $shifttypes, $shifttype_id),
form_text('title', _('Title'), $title),
form_select('rid', _('Room:'), $room, $rid),
form_text('start', _('Start:'), date('Y-m-d H:i', $start)),
form_text('end', _('End:'), date('Y-m-d H:i', $end)),
'<h2>' . _('Needed angels') . '</h2>',
form_select('shifttype_id', __('Shifttype'), $shifttypes, $shifttype_id),
form_text('title', __('Title'), $title),
form_select('rid', __('Room:'), $room, $rid),
form_text('start', __('Start:'), date('Y-m-d H:i', $start)),
form_text('end', __('End:'), date('Y-m-d H:i', $end)),
'<h2>' . __('Needed angels') . '</h2>',
$angel_types_spinner,
form_submit('submit', _('Save'))
form_submit('submit', __('Save'))
])
]
);
@ -230,20 +230,20 @@ function shift_delete_controller()
. ' from ' . date('Y-m-d H:i', $shift['start'])
. ' to ' . date('Y-m-d H:i', $shift['end'])
);
success(_('Shift deleted.'));
success(__('Shift deleted.'));
redirect(page_link_to('user_shifts'));
}
return page_with_title(shifts_title(), [
error(sprintf(
_('Do you want to delete the shift %s from %s to %s?'),
__('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),
'<a class="button" href="'
. page_link_to('user_shifts', ['delete_shift' => $shift_id, 'delete' => 1]) .
'">' . _('delete') . '</a>'
'">' . __('delete') . '</a>'
]);
}
@ -265,7 +265,7 @@ function shift_controller()
$shift = Shift($request->input('shift_id'));
if (empty($shift)) {
error(_('Shift could not be found.'));
error(__('Shift could not be found.'));
redirect(page_link_to('user_shifts'));
}

@ -30,12 +30,12 @@ function shifttype_delete_controller()
ShiftType_delete($shifttype['id']);
engelsystem_log('Deleted shifttype ' . $shifttype['name']);
success(sprintf(_('Shifttype %s deleted.'), $shifttype['name']));
success(sprintf(__('Shifttype %s deleted.'), $shifttype['name']));
redirect(page_link_to('shifttypes'));
}
return [
sprintf(_('Delete shifttype %s'), $shifttype['name']),
sprintf(__('Delete shifttype %s'), $shifttype['name']),
ShiftType_delete_view($shifttype)
];
}
@ -58,7 +58,7 @@ function shifttype_edit_controller()
if ($request->has('shifttype_id')) {
$shifttype = ShiftType($request->input('shifttype_id'));
if (empty($shifttype)) {
error(_('Shifttype not found.'));
error(__('Shifttype not found.'));
redirect(page_link_to('shifttypes'));
}
$shifttype_id = $shifttype['id'];
@ -74,7 +74,7 @@ function shifttype_edit_controller()
$name = strip_request_item('name');
} else {
$valid = false;
error(_('Please enter a name.'));
error(__('Please enter a name.'));
}
if ($request->has('angeltype_id') && preg_match('/^\d+$/', $request->input('angeltype_id'))) {
@ -92,12 +92,12 @@ function shifttype_edit_controller()
ShiftType_update($shifttype_id, $name, $angeltype_id, $description);
engelsystem_log('Updated shifttype ' . $name);
success(_('Updated shifttype.'));
success(__('Updated shifttype.'));
} else {
$shifttype_id = ShiftType_create($name, $angeltype_id, $description);
engelsystem_log('Created shifttype ' . $name);
success(_('Created shifttype.'));
success(__('Created shifttype.'));
}
redirect(page_link_to('shifttypes', ['action' => 'view', 'shifttype_id' => $shifttype_id]));
}
@ -156,7 +156,7 @@ function shifttypes_list_controller()
*/
function shifttypes_title()
{
return _('Shifttypes');
return __('Shifttypes');
}
/**

@ -25,7 +25,7 @@ function user_angeltypes_unconfirmed_hint()
return sprintf(ngettext('There is %d unconfirmed angeltype.', 'There are %d unconfirmed angeltypes.',
count($unconfirmed_user_angeltypes)),
count($unconfirmed_user_angeltypes)) . ' ' . _('Angel types which need approvals:') . ' ' . join(', ',
count($unconfirmed_user_angeltypes)) . ' ' . __('Angel types which need approvals:') . ' ' . join(', ',
$unconfirmed_links);
}
@ -40,18 +40,18 @@ function user_angeltypes_delete_all_controller()
$request = request();
if (!$request->has('angeltype_id')) {
error(_('Angeltype doesn\'t exist.'));
error(__('Angeltype doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
$angeltype = AngelType($request->input('angeltype_id'));
if (empty($angeltype)) {
error(_('Angeltype doesn\'t exist.'));
error(__('Angeltype doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
if (!User_is_AngelType_supporter($user, $angeltype)) {
error(_('You are not allowed to delete all users for this angeltype.'));
error(__('You are not allowed to delete all users for this angeltype.'));
redirect(page_link_to('angeltypes'));
}
@ -59,12 +59,12 @@ function user_angeltypes_delete_all_controller()
UserAngelTypes_delete_all($angeltype['id']);
engelsystem_log(sprintf('Denied all users for angeltype %s', AngelType_name_render($angeltype)));
success(sprintf(_('Denied all users for angeltype %s.'), AngelType_name_render($angeltype)));
success(sprintf(__('Denied all users for angeltype %s.'), AngelType_name_render($angeltype)));
redirect(page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]));
}
return [
_('Deny all users'),
__('Deny all users'),
UserAngelTypes_delete_all_view($angeltype)
];
}
@ -80,18 +80,18 @@ function user_angeltypes_confirm_all_controller()
$request = request();
if (!$request->has('angeltype_id')) {
error(_('Angeltype doesn\'t exist.'));
error(__('Angeltype doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
$angeltype = AngelType($request->input('angeltype_id'));
if (empty($angeltype)) {
error(_('Angeltype doesn\'t exist.'));
error(__('Angeltype doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
if (!in_array('admin_user_angeltypes', $privileges) && !User_is_AngelType_supporter($user, $angeltype)) {
error(_('You are not allowed to confirm all users for this angeltype.'));
error(__('You are not allowed to confirm all users for this angeltype.'));
redirect(page_link_to('angeltypes'));
}
@ -99,12 +99,12 @@ function user_angeltypes_confirm_all_controller()
UserAngelTypes_confirm_all($angeltype['id'], $user);
engelsystem_log(sprintf('Confirmed all users for angeltype %s', AngelType_name_render($angeltype)));
success(sprintf(_('Confirmed all users for angeltype %s.'), AngelType_name_render($angeltype)));
success(sprintf(__('Confirmed all users for angeltype %s.'), AngelType_name_render($angeltype)));
redirect(page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]));
}
return [
_('Confirm all users'),
__('Confirm all users'),
UserAngelTypes_confirm_all_view($angeltype)
];
}
@ -120,30 +120,30 @@ function user_angeltype_confirm_controller()
$request = request();
if (!$request->has('user_angeltype_id')) {
error(_('User angeltype doesn\'t exist.'));
error(__('User angeltype doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
$user_angeltype = UserAngelType($request->input('user_angeltype_id'));
if (empty($user_angeltype)) {
error(_('User angeltype doesn\'t exist.'));
error(__('User angeltype doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
$angeltype = AngelType($user_angeltype['angeltype_id']);
if (empty($angeltype)) {
error(_('Angeltype doesn\'t exist.'));
error(__('Angeltype doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
if (!User_is_AngelType_supporter($user, $angeltype)) {
error(_('You are not allowed to confirm this users angeltype.'));
error(__('You are not allowed to confirm this users angeltype.'));
redirect(page_link_to('angeltypes'));
}
$user_source = User($user_angeltype['user_id']);
if (empty($user_source)) {
error(_('User doesn\'t exist.'));
error(__('User doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
@ -156,7 +156,7 @@ function user_angeltype_confirm_controller()
AngelType_name_render($angeltype)
));
success(sprintf(
_('%s confirmed for angeltype %s.'),
__('%s confirmed for angeltype %s.'),
User_Nick_render($user_source),
AngelType_name_render($angeltype)
));
@ -164,7 +164,7 @@ function user_angeltype_confirm_controller()
}
return [
_('Confirm angeltype for user'),
__('Confirm angeltype for user'),
UserAngelType_confirm_view($user_angeltype, $user_source, $angeltype)
];
}
@ -180,37 +180,37 @@ function user_angeltype_delete_controller()
$request = request();
if (!$request->has('user_angeltype_id')) {
error(_('User angeltype doesn\'t exist.'));
error(__('User angeltype doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
$user_angeltype = UserAngelType($request->input('user_angeltype_id'));
if (empty($user_angeltype)) {
error(_('User angeltype doesn\'t exist.'));
error(__('User angeltype doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
$angeltype = AngelType($user_angeltype['angeltype_id']);
if (empty($angeltype)) {
error(_('Angeltype doesn\'t exist.'));
error(__('Angeltype doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
$user_source = User($user_angeltype['user_id']);
if (empty($user_source)) {
error(_('User doesn\'t exist.'));
error(__('User doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
if ($user['UID'] != $user_angeltype['user_id'] && !User_is_AngelType_supporter($user, $angeltype)) {
error(_('You are not allowed to delete this users angeltype.'));
error(__('You are not allowed to delete this users angeltype.'));
redirect(page_link_to('angeltypes'));
}
if ($request->has('confirmed')) {
UserAngelType_delete($user_angeltype);
$success_message = sprintf(_('User %s removed from %s.'), User_Nick_render($user_source), $angeltype['name']);
$success_message = sprintf(__('User %s removed from %s.'), User_Nick_render($user_source), $angeltype['name']);
engelsystem_log($success_message);
success($success_message);
@ -218,7 +218,7 @@ function user_angeltype_delete_controller()
}
return [
_('Remove angeltype'),
__('Remove angeltype'),
UserAngelType_delete_view($user_angeltype, $user_source, $angeltype)
];
}
@ -235,37 +235,37 @@ function user_angeltype_update_controller()
$request = request();
if (!in_array('admin_angel_types', $privileges)) {
error(_('You are not allowed to set supporter rights.'));
error(__('You are not allowed to set supporter rights.'));
redirect(page_link_to('angeltypes'));
}
if (!$request->has('user_angeltype_id')) {
error(_('User angeltype doesn\'t exist.'));
error(__('User angeltype doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
if ($request->has('supporter') && preg_match('/^[01]$/', $request->input('supporter'))) {
$supporter = $request->input('supporter') == '1';
} else {
error(_('No supporter update given.'));
error(__('No supporter update given.'));
redirect(page_link_to('angeltypes'));
}
$user_angeltype = UserAngelType($request->input('user_angeltype_id'));
if (empty($user_angeltype)) {
error(_('User angeltype doesn\'t exist.'));
error(__('User angeltype doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
$angeltype = AngelType($user_angeltype['angeltype_id']);
if (empty($angeltype)) {
error(_('Angeltype doesn\'t exist.'));
error(__('Angeltype doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
$user_source = User($user_angeltype['user_id']);
if (empty($user_source)) {
error(_('User doesn\'t exist.'));
error(__('User doesn\'t exist.'));
redirect(page_link_to('angeltypes'));
}
@ -274,8 +274,8 @@ function user_angeltype_update_controller()
$success_message = sprintf(
$supporter
? _('Added supporter rights for %s to %s.')
: _('Removed supporter rights for %s from %s.'),
? __('Added supporter rights for %s to %s.')
: __('Removed supporter rights for %s from %s.'),
AngelType_name_render($angeltype),
User_Nick_render($user_source)
);
@ -286,7 +286,7 @@ function user_angeltype_update_controller()
}
return [
$supporter ? _('Add supporter rights') : _('Remove supporter rights'),
$supporter ? __('Add supporter rights') : __('Remove supporter rights'),
UserAngelType_update_view($user_angeltype, $user_source, $angeltype, $supporter)
];
}
@ -326,7 +326,7 @@ function user_angeltype_add_controller()
AngelType_name_render($angeltype)
));
success(sprintf(
_('User %s added to %s.'),
__('User %s added to %s.'),
User_Nick_render($user_source),
AngelType_name_render($angeltype)
));
@ -343,7 +343,7 @@ function user_angeltype_add_controller()
}
return [
_('Add user to angeltype'),
__('Add user to angeltype'),
UserAngelType_add_view($angeltype, $users_source, $user_source['UID'])
];
}
@ -360,14 +360,14 @@ function user_angeltype_join_controller($angeltype)
$user_angeltype = UserAngelType_by_User_and_AngelType($user, $angeltype);
if (!empty($user_angeltype)) {
error(sprintf(_('You are already a %s.'), $angeltype['name']));
error(sprintf(__('You are already a %s.'), $angeltype['name']));
redirect(page_link_to('angeltypes'));
}
if (request()->has('confirmed')) {
$user_angeltype_id = UserAngelType_create($user, $angeltype);
$success_message = sprintf(_('You joined %s.'), $angeltype['name']);
$success_message = sprintf(__('You joined %s.'), $angeltype['name']);
engelsystem_log(sprintf(
'User %s joined %s.',
User_Nick_render($user),
@ -388,7 +388,7 @@ function user_angeltype_join_controller($angeltype)
}
return [
sprintf(_('Become a %s'), $angeltype['name']),
sprintf(__('Become a %s'), $angeltype['name']),
UserAngelType_join_view($user, $angeltype)
];
}

@ -21,8 +21,8 @@ function user_driver_license_required_hint()
foreach ($angeltypes as $angeltype) {
if ($angeltype['requires_driver_license']) {
return sprintf(
_('You joined an angeltype which requires a driving license. Please edit your driving license information here: %s.'),
'<a href="' . user_driver_license_edit_link() . '">' . _('driving license information') . '</a>'
__('You joined an angeltype which requires a driving license. Please edit your driving license information here: %s.'),
'<a href="' . user_driver_license_edit_link() . '">' . __('driving license information') . '</a>'
);
}
}
@ -128,21 +128,21 @@ function user_driver_license_edit_controller()
UserDriverLicenses_update($user_driver_license);
}
engelsystem_log('Driver license information updated.');
success(_('Your driver license information has been saved.'));
success(__('Your driver license information has been saved.'));
redirect(user_link($user_source));
} else {
error(_('Please select at least one driving license.'));
error(__('Please select at least one driving license.'));
}
} elseif (!empty($user_driver_license['user_id'])) {
UserDriverLicenses_delete($user_source['UID']);
engelsystem_log('Driver license information removed.');
success(_('Your driver license information has been removed.'));
success(__('Your driver license information has been removed.'));
redirect(user_link($user_source));
}
}
return [
sprintf(_('Edit %s driving license information'), $user_source['Nick']),
sprintf(__('Edit %s driving license information'), $user_source['Nick']),
UserDriverLicense_edit_view($user_source, $wants_to_drive, $user_driver_license)
];
}

@ -19,7 +19,7 @@ function user_worklog_delete_controller()
if ($request->has('confirmed')) {
UserWorkLog_delete($userWorkLog);
success(_('Work log entry deleted.'));
success(__('Work log entry deleted.'));
redirect(user_link($user_source));
}
@ -51,7 +51,7 @@ function user_worklog_edit_controller()
if ($valid) {
UserWorkLog_update($userWorkLog);
success(_('Work log entry updated.'));
success(__('Work log entry updated.'));
redirect(user_link($user_source));
}
}
@ -80,19 +80,19 @@ function user_worklog_from_request($userWorkLog)
);
if (is_null($userWorkLog['work_timestamp'])) {
$valid = false;
error(_('Please enter work date.'));
error(__('Please enter work date.'));
}
$userWorkLog['work_hours'] = $request->input('work_hours');
if (!preg_match("/[0-9]+(\.[0-9]+)?/", $userWorkLog['work_hours'])) {
$valid = false;
error(_('Please enter work hours in format ##[.##].'));
error(__('Please enter work hours in format ##[.##].'));
}
$userWorkLog['comment'] = $request->input('comment');
if (empty($userWorkLog['comment'])) {
$valid = false;
error(_('Please enter a comment.'));
error(__('Please enter a comment.'));
}
return [
@ -124,7 +124,7 @@ function user_worklog_add_controller()
if ($valid) {
UserWorkLog_create($userWorkLog);
success(_('Work log entry created.'));
success(__('Work log entry created.'));
redirect(user_link($user_source));
}
}

@ -58,7 +58,7 @@ function user_delete_controller()
// You cannot delete yourself
if ($user['UID'] == $user_source['UID']) {
error(_('You cannot delete yourself.'));
error(__('You cannot delete yourself.'));
redirect(user_link($user));
}
@ -72,14 +72,14 @@ function user_delete_controller()
)
) {
$valid = false;
error(_('Your password is incorrect. Please try it again.'));
error(__('Your password is incorrect. Please try it again.'));
}
if ($valid) {
User_delete($user_source['UID']);
mail_user_delete($user_source);
success(_('User deleted.'));
success(__('User deleted.'));
engelsystem_log(sprintf('Deleted %s', User_Nick_render($user_source)));
redirect(users_link());
@ -87,7 +87,7 @@ function user_delete_controller()
}
return [
sprintf(_('Delete %s'), $user_source['Nick']),
sprintf(__('Delete %s'), $user_source['Nick']),
User_delete_view($user_source)
];
}
@ -157,7 +157,7 @@ function user_edit_vouchers_controller()
$vouchers = trim($request->input('vouchers'));
} else {
$valid = false;
error(_('Please enter a valid number of vouchers.'));
error(__('Please enter a valid number of vouchers.'));
}
if ($valid) {
@ -165,7 +165,7 @@ function user_edit_vouchers_controller()
User_update($user_source);
success(_('Saved the number of vouchers.'));
success(__('Saved the number of vouchers.'));
engelsystem_log(User_Nick_render($user_source) . ': ' . sprintf('Got %s vouchers',
$user_source['got_voucher']));
@ -174,7 +174,7 @@ function user_edit_vouchers_controller()
}
return [
sprintf(_('%s\'s vouchers'), $user_source['Nick']),
sprintf(__('%s\'s vouchers'), $user_source['Nick']),
User_edit_vouchers_view($user_source)
];
}
@ -191,7 +191,7 @@ function user_controller()
if ($request->has('user_id')) {
$user_source = User($request->input('user_id'));
if (empty($user_source)) {
error(_('User not found.'));
error(__('User not found.'));
redirect(page_link_to('/'));
}
}
@ -226,7 +226,7 @@ function user_controller()
}
if ($user_source['force_active']) {
$tshirt_score = _('Enough');
$tshirt_score = __('Enough');
} else {
$tshirt_score = sprintf('%.2f', User_tshirt_score($user_source)) . '&nbsp;h';
}
@ -274,7 +274,7 @@ function users_list_controller()
}
return [
_('All users'),
__('All users'),
Users_view(
$users,
$order_by,
@ -298,7 +298,7 @@ function user_password_recovery_set_new_controller()
$request = request();
$user_source = User_by_password_recovery_token($request->input('token'));
if (empty($user_source)) {
error(_('Token is not correct.'));
error(__('Token is not correct.'));
redirect(page_link_to('login'));
}
@ -311,16 +311,16 @@ function user_password_recovery_set_new_controller()
) {
if ($request->postData('password') != $request->postData('password2')) {
$valid = false;
error(_('Your passwords don\'t match.'));
error(__('Your passwords don\'t match.'));
}
} else {
$valid = false;
error(_('Your password is to short (please use at least 6 characters).'));
error(__('Your password is to short (please use at least 6 characters).'));
}
if ($valid) {
set_password($user_source['UID'], $request->postData('password'));
success(_('Password saved.'));
success(__('Password saved.'));
redirect(page_link_to('login'));
}
}
@ -345,28 +345,28 @@ function user_password_recovery_start_controller()
$user_source = User_by_email($email);
if (empty($user_source)) {
$valid = false;
error(_('E-mail address is not correct.'));
error(__('E-mail address is not correct.'));
}
} else {
$valid = false;
error(_('E-mail address is not correct.'));
error(__('E-mail address is not correct.'));
}
} else {
$valid = false;
error(_('Please enter your e-mail.'));
error(__('Please enter your e-mail.'));
}
if ($valid) {
$token = User_generate_password_recovery_token($user_source);
engelsystem_email_to_user(
$user_source,
_('Password recovery'),
__('Password recovery'),
sprintf(
_('Please visit %s to recover your password.'),
__('Please visit %s to recover your password.'),
page_link_to('user_password_recovery', ['token' => $token])
)
);
success(_('We sent an email containing your password recovery link.'));
success(__('We sent an email containing your password recovery link.'));
redirect(page_link_to('login'));
}
}
@ -396,7 +396,7 @@ function user_password_recovery_controller()
*/
function user_password_recovery_title()
{
return _('Password recovery');
return __('Password recovery');
}
/**
@ -413,7 +413,7 @@ function load_user()
$user = User($request->input('user_id'));
if (empty($user)) {
error(_('User doesn\'t exist.'));
error(__('User doesn\'t exist.'));
redirect(page_link_to());
}

@ -20,10 +20,10 @@ function engelsystem_email_to_user($recipient_user, $title, $message, $not_if_it
$locale = $translator->getLocale();
$translator->setLocale($recipient_user['Sprache']);
$message = sprintf(_('Hi %s,'), $recipient_user['Nick']) . "\n\n"
. _('here is a message for you from the engelsystem:') . "\n\n"
$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 been signed. You got this email because you are registered in the engelsystem.');
. __('This email is autogenerated and has not been signed. You got this email because you are registered in the engelsystem.');
$translator->setLocale($locale);
return engelsystem_email($recipient_user['email'], $title, $message);

@ -12,22 +12,22 @@ function mail_shift_change($old_shift, $new_shift)
$noticeable_changes = false;
$message = _('A Shift you are registered on has changed:');
$message = __('A Shift you are registered on has changed:');
$message .= "\n";
if ($old_shift['name'] != $new_shift['name']) {
$message .= sprintf(_('* Shift type changed from %s to %s'), $old_shift['name'], $new_shift['name']) . "\n";
$message .= sprintf(__('* Shift type changed from %s to %s'), $old_shift['name'], $new_shift['name']) . "\n";
$noticeable_changes = true;
}
if ($old_shift['title'] != $new_shift['title']) {
$message .= sprintf(_('* Shift title changed from %s to %s'), $old_shift['title'], $new_shift['title']) . "\n";
$message .= sprintf(__('* Shift title changed from %s to %s'), $old_shift['title'], $new_shift['title']) . "\n";
$noticeable_changes = true;
}
if ($old_shift['start'] != $new_shift['start']) {
$message .= sprintf(
_('* Shift Start changed from %s to %s'),
__('* Shift Start changed from %s to %s'),
date('Y-m-d H:i', $old_shift['start']),
date('Y-m-d H:i', $new_shift['start'])
) . "\n";
@ -36,7 +36,7 @@ function mail_shift_change($old_shift, $new_shift)
if ($old_shift['end'] != $new_shift['end']) {
$message .= sprintf(
_('* Shift End changed from %s to %s'),
__('* Shift End changed from %s to %s'),
date('Y-m-d H:i', $old_shift['end']),
date('Y-m-d H:i', $new_shift['end'])
) . "\n";
@ -44,7 +44,7 @@ function mail_shift_change($old_shift, $new_shift)
}
if ($old_shift['RID'] != $new_shift['RID']) {
$message .= sprintf(_('* Shift Location changed from %s to %s'), $old_room['Name'], $new_room['Name']) . "\n";
$message .= sprintf(__('* Shift Location changed from %s to %s'), $old_room['Name'], $new_room['Name']) . "\n";
$noticeable_changes = true;
}
@ -54,7 +54,7 @@ function mail_shift_change($old_shift, $new_shift)
}
$message .= "\n";
$message .= _('The updated Shift:') . "\n";
$message .= __('The updated Shift:') . "\n";
$message .= $new_shift['name'] . "\n";
$message .= $new_shift['title'] . "\n";
@ -65,7 +65,7 @@ function mail_shift_change($old_shift, $new_shift)
if ($user['email_shiftinfo']) {
engelsystem_email_to_user(
$user,
'[engelsystem] ' . _('Your Shift has changed'),
'[engelsystem] ' . __('Your Shift has changed'),
$message,
true
);
@ -81,7 +81,7 @@ function mail_shift_delete($shift)
$users = ShiftEntries_by_shift($shift['SID']);
$room = Room($shift['RID']);
$message = _('A Shift you are registered on was deleted:') . "\n";
$message = __('A Shift you are registered on was deleted:') . "\n";
$message .= $shift['name'] . "\n";
$message .= $shift['title'] . "\n";
@ -90,7 +90,7 @@ function mail_shift_delete($shift)
foreach ($users as $user) {
if ($user['email_shiftinfo']) {
engelsystem_email_to_user($user, '[engelsystem] ' . _('Your Shift was deleted'), $message, true);
engelsystem_email_to_user($user, '[engelsystem] ' . __('Your Shift was deleted'), $message, true);
}
}
}
@ -107,13 +107,13 @@ function mail_shift_assign($user, $shift)
$room = Room($shift['RID']);
$message = _('You have been assigned to a Shift:') . "\n";
$message = __('You have been assigned to a Shift:') . "\n";
$message .= $shift['name'] . "\n";
$message .= $shift['title'] . "\n";
$message .= date('Y-m-d H:i', $shift['start']) . ' - ' . date('H:i', $shift['end']) . "\n";
$message .= $room['Name'] . "\n";
engelsystem_email_to_user($user, '[engelsystem] ' . _('Assigned to Shift'), $message, true);
engelsystem_email_to_user($user, '[engelsystem] ' . __('Assigned to Shift'), $message, true);
}
/**
@ -128,11 +128,11 @@ function mail_shift_removed($user, $shift)
$room = Room($shift['RID']);
$message = _('You have been removed from a Shift:') . "\n";
$message = __('You have been removed from a Shift:') . "\n";
$message .= $shift['name'] . "\n";
$message .= $shift['title'] . "\n";
$message .= date('Y-m-d H:i', $shift['start']) . ' - ' . date('H:i', $shift['end']) . "\n";
$message .= $room['Name'] . "\n";
engelsystem_email_to_user($user, '[engelsystem] ' . _('Removed from Shift'), $message, true);
engelsystem_email_to_user($user, '[engelsystem] ' . __('Removed from Shift'), $message, true);
}

@ -8,7 +8,7 @@ function mail_user_delete($user)
{
return 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] ' . __('Your account has been deleted'),
__('Your angelsystem account has been deleted. If you have any questions regarding your account deletion, please contact heaven.')
);
}

@ -293,7 +293,9 @@ function Shift_free_entries($needed_angeltype, $shift_entries)
$taken++;
}
}
return max(0, $needed_angeltype['count'] - $taken);
$neededAngels = !empty($needed_angeltype) ? $needed_angeltype['count'] : 0;
return max(0, $neededAngels - $taken);
}
/**

@ -39,6 +39,10 @@ function User_tshirt_score($user)
$user['UID'],
time()
]);
if (!isset($result_shifts['tshirt_score'])) {
$result_shifts = ['tshirt_score' => 0];
}
$result_worklog = DB::selectOne('
SELECT SUM(`work_hours`) AS `tshirt_score`
FROM `User`
@ -49,6 +53,9 @@ function User_tshirt_score($user)
$user['UID'],
time()
]);
if (!isset($result_worklog['tshirt_score'])) {
$result_worklog = ['tshirt_score' => 0];
}
return $result_shifts['tshirt_score'] + $result_worklog['tshirt_score'];
}

@ -7,7 +7,7 @@ use Engelsystem\Database\DB;
*/
function admin_active_title()
{
return _('Active angels');
return __('Active angels');
}
/**
@ -39,14 +39,14 @@ function admin_active()
$count = strip_request_item('count');
if ($count < $forced_count) {
error(sprintf(
_('At least %s angels are forced to be active. The number has to be greater.'),
__('At least %s angels are forced to be active. The number has to be greater.'),
$forced_count
));
redirect(page_link_to('admin_active'));
}
} else {
$valid = false;
$msg .= error(_('Please enter a number of angels to be marked as active.'), true);
$msg .= error(__('Please enter a number of angels to be marked as active.'), true);
}
if ($valid) {
@ -84,16 +84,16 @@ function admin_active()
engelsystem_log('These angels are active now: ' . join(', ', $user_nicks));
$limit = '';
$msg = success(_('Marked angels.'), true);
$msg = success(__('Marked angels.'), true);
} else {
$set_active = '<a href="' . page_link_to('admin_active', ['search' => $search]) . '">&laquo; '
. _('back')
. __('back')
. '</a> | <a href="'
. page_link_to(
'admin_active',
['search' => $search, 'count' => $count, 'set_active' => 1, 'ack' => 1]
) . '">'
. _('apply')
. __('apply')
. '</a>';
}
}
@ -104,9 +104,9 @@ function admin_active()
if (!empty($user_source)) {
DB::update('UPDATE `User` SET `Aktiv`=1 WHERE `UID`=? LIMIT 1', [$user_id]);
engelsystem_log('User ' . User_Nick_render($user_source) . ' is active now.');
$msg = success(_('Angel has been marked as active.'), true);
$msg = success(__('Angel has been marked as active.'), true);
} else {
$msg = error(_('Angel not found.'), true);
$msg = error(__('Angel not found.'), true);
}
} elseif ($request->has('not_active') && preg_match('/^\d+$/', $request->input('not_active'))) {
$user_id = $request->input('not_active');
@ -114,9 +114,9 @@ function admin_active()
if (!empty($user_source)) {
DB::update('UPDATE `User` SET `Aktiv`=0 WHERE `UID`=? LIMIT 1', [$user_id]);
engelsystem_log('User ' . User_Nick_render($user_source) . ' is NOT active now.');
$msg = success(_('Angel has been marked as not active.'), true);
$msg = success(__('Angel has been marked as not active.'), true);
} else {
$msg = error(_('Angel not found.'), true);
$msg = error(__('Angel not found.'), true);
}
} elseif ($request->has('tshirt') && preg_match('/^\d+$/', $request->input('tshirt'))) {
$user_id = $request->input('tshirt');
@ -124,7 +124,7 @@ function admin_active()
if (!empty($user_source)) {
DB::update('UPDATE `User` SET `Tshirt`=1 WHERE `UID`=? LIMIT 1', [$user_id]);
engelsystem_log('User ' . User_Nick_render($user_source) . ' has tshirt now.');
$msg = success(_('Angel has got a t-shirt.'), true);
$msg = success(__('Angel has got a t-shirt.'), true);
} else {
$msg = error('Angel not found.', true);
}
@ -134,9 +134,9 @@ function admin_active()
if (!empty($user_source)) {
DB::update('UPDATE `User` SET `Tshirt`=0 WHERE `UID`=? LIMIT 1', [$user_id]);
engelsystem_log('User ' . User_Nick_render($user_source) . ' has NO tshirt.');
$msg = success(_('Angel has got no t-shirt.'), true);
$msg = success(__('Angel has got no t-shirt.'), true);
} else {
$msg = error(_('Angel not found.'), true);
$msg = error(__('Angel not found.'), true);
}
}
@ -197,7 +197,7 @@ function admin_active()
$parameters['show_all_shifts'] = 1;
}
$actions[] = '<a href="' . page_link_to('admin_active', $parameters) . '">'
. _('set active')
. __('set active')
. '</a>';
}
if ($usr['Aktiv'] == 1) {
@ -209,7 +209,7 @@ function admin_active()
$parametersRemove['show_all_shifts'] = 1;
}
$actions[] = '<a href="' . page_link_to('admin_active', $parametersRemove) . '">'
. _('remove active')
. __('remove active')
. '</a>';
}
if ($usr['Tshirt'] == 0) {
@ -221,7 +221,7 @@ function admin_active()
$parametersShirt['show_all_shifts'] = 1;
}
$actions[] = '<a href="' . page_link_to('admin_active', $parametersShirt) . '">'
. _('got t-shirt')
. __('got t-shirt')
. '</a>';
}
if ($usr['Tshirt'] == 1) {
@ -233,7 +233,7 @@ function admin_active()
$parameters['show_all_shifts'] = 1;
}
$actions[] = '<a href="' . page_link_to('admin_active', $parameters) . '">'
. _('remove t-shirt')
. __('remove t-shirt')
. '</a>';
}
@ -244,7 +244,6 @@ function admin_active()
$shirt_statistics = [];
foreach (array_keys($tshirt_sizes) as $size) {
if (!empty($size)) {
$gc = DB::selectOne(
'SELECT count(*) FROM `User` WHERE `Size`=? AND `Tshirt`=1',
[$size]
@ -256,40 +255,39 @@ function admin_active()
'given' => (int)$gc
];
}
}
$shirtCount = User_tshirts_count();
$shirt_statistics[] = [
'size' => '<b>' . _('Sum') . '</b>',
'size' => '<b>' . __('Sum') . '</b>',
'given' => '<b>' . $shirtCount . '</b>'
];
return page_with_title(admin_active_title(), [
form([
form_text('search', _('Search angel:'), $search),
form_checkbox('show_all_shifts', _('Show all shifts'), $show_all_shifts),
form_submit('submit', _('Search'))
form_text('search', __('Search angel:'), $search),
form_checkbox('show_all_shifts', __('Show all shifts'), $show_all_shifts),
form_submit('submit', __('Search'))
], page_link_to('admin_active')),
$set_active == '' ? form([
form_text('count', _('How much angels should be active?'), $count),
form_submit('set_active', _('Preview'))
form_text('count', __('How much angels should be active?'), $count),
form_submit('set_active', __('Preview'))
]) : $set_active,
$msg . msg(),
table([
'nick' => _('Nickname'),
'shirt_size' => _('Size'),
'shift_count' => _('Shifts'),
'work_time' => _('Length'),
'active' => _('Active?'),
'force_active' => _('Forced'),
'tshirt' => _('T-shirt?'),
'nick' => __('Nickname'),
'shirt_size' => __('Size'),
'shift_count' => __('Shifts'),
'work_time' => __('Length'),
'active' => __('Active?'),
'force_active' => __('Forced'),
'tshirt' => __('T-shirt?'),
'actions' => ''
], $matched_users),
'<h2>' . _('Shirt statistics') . '</h2>',
'<h2>' . __('Shirt statistics') . '</h2>',
table([
'size' => _('Size'),
'given' => _('Given shirts')
'size' => __('Size'),
'given' => __('Given shirts')
], $shirt_statistics)
]);
}

@ -7,7 +7,7 @@ use Engelsystem\Database\DB;
*/
function admin_arrive_title()
{
return _('Arrived angels');
return __('Arrived angels');
}
/**
@ -35,10 +35,10 @@ function admin_arrive()
LIMIT 1
', [$user_id]);
engelsystem_log('User set to not arrived: ' . User_Nick_render($user_source));
success(_('Reset done. Angel has not arrived.'));
success(__('Reset done. Angel has not arrived.'));
redirect(user_link($user_source));
} else {
$msg = error(_('Angel not found.'), true);
$msg = error(__('Angel not found.'), true);
}
} elseif ($request->has('arrived') && preg_match('/^\d+$/', $request->input('arrived'))) {
$user_id = $request->input('arrived');
@ -51,10 +51,10 @@ function admin_arrive()
LIMIT 1
', [time(), $user_id]);
engelsystem_log('User set has arrived: ' . User_Nick_render($user_source));
success(_('Angel has been marked as arrived.'));
success(__('Angel has been marked as arrived.'));
redirect(user_link($user_source));
} else {
$msg = error(_('Angel not found.'), true);
$msg = error(__('Angel not found.'), true);
}
}
@ -91,16 +91,16 @@ function admin_arrive()
}
$usr['rendered_planned_arrival_date'] = date('Y-m-d', $usr['planned_arrival_date']);
$usr['rendered_arrival_date'] = $usr['arrival_date'] > 0 ? date('Y-m-d', $usr['arrival_date']) : '-';
$usr['arrived'] = $usr['Gekommen'] == 1 ? _('yes') : '';
$usr['arrived'] = $usr['Gekommen'] == 1 ? __('yes') : '';
$usr['actions'] = $usr['Gekommen'] == 1
? '<a href="' . page_link_to(
'admin_arrive',
['reset' => $usr['UID'], 'search' => $search]
) . '">' . _('reset') . '</a>'
) . '">' . __('reset') . '</a>'
: '<a href="' . page_link_to(
'admin_arrive',
['arrived' => $usr['UID'], 'search' => $search]
) . '">' . _('arrived') . '</a>';
) . '">' . __('arrived') . '</a>';
if ($usr['arrival_date'] > 0) {
$day = date('Y-m-d', $usr['arrival_date']);
@ -169,61 +169,61 @@ function admin_arrive()
return page_with_title(admin_arrive_title(), [
$msg . msg(),
form([
form_text('search', _('Search'), $search),
form_submit('submit', _('Search'))
form_text('search', __('Search'), $search),
form_submit('submit', __('Search'))
]),
table([
'nick' => _('Nickname'),
'rendered_planned_arrival_date' => _('Planned arrival'),
'arrived' => _('Arrived?'),
'rendered_arrival_date' => _('Arrival date'),
'rendered_planned_departure_date' => _('Planned departure'),
'nick' => __('Nickname'),
'rendered_planned_arrival_date' => __('Planned arrival'),
'arrived' => __('Arrived?'),
'rendered_arrival_date' => __('Arrival date'),
'rendered_planned_departure_date' => __('Planned departure'),
'actions' => ''
], $users_matched),
div('row', [
div('col-md-4', [
heading(_('Planned arrival statistics'), 2),
heading(__('Planned arrival statistics'), 2),
bargraph('planned_arrives', 'day', [
'count' => _('arrived'),
'sum' => _('arrived sum')
'count' => __('arrived'),
'sum' => __('arrived sum')
], [
'count' => '#090',
'sum' => '#888'
], $planned_arrival_at_day),
table([
'day' => _('Date'),
'count' => _('Count'),
'sum' => _('Sum')
'day' => __('Date'),
'count' => __('Count'),
'sum' => __('Sum')
], $planned_arrival_at_day)
]),
div('col-md-4', [
heading(_('Arrival statistics'), 2),
heading(__('Arrival statistics'), 2),
bargraph('arrives', 'day', [
'count' => _('arrived'),
'sum' => _('arrived sum')
'count' => __('arrived'),
'sum' => __('arrived sum')
], [
'count' => '#090',
'sum' => '#888'
], $arrival_at_day),
table([
'day' => _('Date'),
'count' => _('Count'),
'sum' => _('Sum')
'day' => __('Date'),
'count' => __('Count'),
'sum' => __('Sum')
], $arrival_at_day)
]),
div('col-md-4', [
heading(_('Planned departure statistics'), 2),
heading(__('Planned departure statistics'), 2),
bargraph('planned_departures', 'day', [
'count' => _('arrived'),
'sum' => _('arrived sum')
'count' => __('arrived'),
'sum' => __('arrived sum')
], [
'count' => '#090',
'sum' => '#888'
], $planned_departure_at_day),
table([
'day' => _('Date'),
'count' => _('Count'),
'sum' => _('Sum')
'day' => __('Date'),
'count' => __('Count'),
'sum' => __('Sum')
], $planned_departure_at_day)
])
])

@ -7,7 +7,7 @@ use Engelsystem\Database\DB;
*/
function admin_free_title()
{
return _('Free angels');
return __('Free angels');
}
/**
@ -94,7 +94,7 @@ function admin_free()
'email' => $usr['email_by_human_allowed'] ? $usr['email'] : glyph('eye-close'),
'actions' =>
in_array('admin_user', $privileges)
? button(page_link_to('admin_user', ['id' => $usr['UID']]), _('edit'), 'btn-xs')
? button(page_link_to('admin_user', ['id' => $usr['UID']]), __('edit'), 'btn-xs')
: ''
];
}
@ -102,25 +102,25 @@ function admin_free()
form([
div('row', [
div('col-md-4', [
form_text('search', _('Search'), $search)
form_text('search', __('Search'), $search)
]),
div('col-md-4', [
form_select('angeltype', _('Angeltype'), $angel_types, $angelType)
form_select('angeltype', __('Angeltype'), $angel_types, $angelType)
]),
div('col-md-2', [
form_checkbox('confirmed_only', _('Only confirmed'), $request->has('confirmed_only'))
form_checkbox('confirmed_only', __('Only confirmed'), $request->has('confirmed_only'))
]),
div('col-md-2', [
form_submit('submit', _('Search'))
form_submit('submit', __('Search'))
])
])
]),
table([
'name' => _('Nick'),
'name' => __('Nick'),
'shift_state' => '',
'dect' => _('DECT'),
'jabber' => _('Jabber'),
'email' => _('E-Mail'),
'dect' => __('DECT'),
'jabber' => __('Jabber'),
'email' => __('E-Mail'),
'actions' => ''
], $free_users_table)
]);

@ -7,7 +7,7 @@ use Engelsystem\Database\DB;
*/
function admin_groups_title()
{
return _('Grouprights');
return __('Grouprights');
}
/**
@ -40,7 +40,7 @@ function admin_groups()
'actions' => button(
page_link_to('admin_groups',
['action' => 'edit', 'id' => $group['UID']]),
_('edit'),
__('edit'),
'btn-xs'
)
];
@ -48,8 +48,8 @@ function admin_groups()
return page_with_title(admin_groups_title(), [
table([
'name' => _('Name'),
'privileges' => _('Privileges'),
'name' => __('Name'),
'privileges' => __('Privileges'),
'actions' => ''
], $groups_table)
]);
@ -97,8 +97,8 @@ function admin_groups()
);
}
$privileges_form[] = form_submit('submit', _('Save'));
$html .= page_with_title(_('Edit group'), [
$privileges_form[] = form_submit('submit', __('Save'));
$html .= page_with_title(__('Edit group'), [
form(
$privileges_form,
page_link_to('admin_groups', ['action' => 'save', 'id' => $group_id])

@ -5,7 +5,7 @@
*/
function admin_import_title()
{
return _('Frab import');
return __('Frab import');
}
/**
@ -35,7 +35,7 @@ function admin_import()
fclose($test_handle);
@unlink($import_dir . '/tmp');
} catch (Exception $e) {
error(_('Webserver has no write-permission on import directory.'));
error(__('Webserver has no write-permission on import directory.'));
}
$import_file = $import_dir . '/import_' . $user['UID'] . '.xml';
@ -60,7 +60,7 @@ function admin_import()
$shifttype_id = $request->input('shifttype_id');
} else {
$valid = false;
error(_('Please select a shift type.'));
error(__('Please select a shift type.'));
}
$minutes_start = trim($request->input('add_minutes_start'));
@ -68,14 +68,14 @@ function admin_import()
$add_minutes_start = $minutes_start;
} else {
$valid = false;
error(_('Please enter an amount of minutes to add to a talk\'s begin.'));
error(__('Please enter an amount of minutes to add to a talk\'s begin.'));
}
if ($request->has('add_minutes_end') && is_numeric(trim($request->input('add_minutes_end')))) {
$add_minutes_end = trim($request->input('add_minutes_end'));
} else {
$valid = false;
error(_('Please enter an amount of minutes to add to a talk\'s end.'));
error(__('Please enter an amount of minutes to add to a talk\'s end.'));
}
if (isset($_FILES['xcal_file']) && ($_FILES['xcal_file']['error'] == 0)) {
@ -83,16 +83,16 @@ function admin_import()
libxml_use_internal_errors(true);
if (simplexml_load_file($import_file) === false) {
$valid = false;
error(_('No valid xml/xcal file provided.'));
error(__('No valid xml/xcal file provided.'));
unlink($import_file);
}
} else {
$valid = false;
error(_('File upload went wrong.'));
error(__('File upload went wrong.'));
}
} else {
$valid = false;
error(_('Please provide some data.'));
error(__('Please provide some data.'));
}
}
@ -107,23 +107,23 @@ function admin_import()
);
} else {
$html .= div('well well-sm text-center', [
_('File Upload')
__('File Upload')
. mute(glyph('arrow-right'))
. mute(_('Validation'))
. mute(__('Validation'))
. mute(glyph('arrow-right'))
. mute(_('Import'))
. mute(__('Import'))
]) . div('row', [
div('col-md-offset-3 col-md-6', [
form([
form_info(
'',
_('This import will create/update/delete rooms and shifts by given FRAB-export file. The needed file format is xcal.')
__('This import will create/update/delete rooms and shifts by given FRAB-export file. The needed file format is xcal.')
),
form_select('shifttype_id', _('Shifttype'), $shifttypes, $shifttype_id),
form_spinner('add_minutes_start', _('Add minutes to start'), $add_minutes_start),
form_spinner('add_minutes_end', _('Add minutes to end'), $add_minutes_end),
form_file('xcal_file', _('xcal-File (.xcal)')),
form_submit('submit', _('Import'))
form_select('shifttype_id', __('Shifttype'), $shifttypes, $shifttype_id),
form_spinner('add_minutes_start', __('Add minutes to start'), $add_minutes_start),
form_spinner('add_minutes_end', __('Add minutes to end'), $add_minutes_end),
form_file('xcal_file', __('xcal-File (.xcal)')),
form_submit('submit', __('Import'))
])
])
]);
@ -132,28 +132,28 @@ function admin_import()
case 'check':
if (!file_exists($import_file)) {
error(_('Missing import file.'));
error(__('Missing import file.'));
redirect(page_link_to('admin_import'));
}
if ($request->has('shifttype_id') && isset($shifttypes[$request->input('shifttype_id')])) {
$shifttype_id = $request->input('shifttype_id');
} else {
error(_('Please select a shift type.'));
error(__('Please select a shift type.'));
redirect(page_link_to('admin_import'));
}
if ($request->has('add_minutes_start') && is_numeric(trim($request->input('add_minutes_start')))) {
$add_minutes_start = trim($request->input('add_minutes_start'));
} else {
error(_('Please enter an amount of minutes to add to a talk\'s begin.'));
error(__('Please enter an amount of minutes to add to a talk\'s begin.'));
redirect(page_link_to('admin_import'));
}
if ($request->has('add_minutes_end') && is_numeric(trim($request->input(('add_minutes_end'))))) {
$add_minutes_end = trim($request->input('add_minutes_end'));
} else {
error(_('Please enter an amount of minutes to add to a talk\'s end.'));
error(__('Please enter an amount of minutes to add to a talk\'s end.'));
redirect(page_link_to('admin_import'));
}
@ -168,53 +168,53 @@ function admin_import()
$html .= div(
'well well-sm text-center',
[
'<span class="text-success">' . _('File Upload') . glyph('ok-circle') . '</span>'
'<span class="text-success">' . __('File Upload') . glyph('ok-circle') . '</span>'
. mute(glyph('arrow-right'))
. _('Validation')
. __('Validation')
. mute(glyph('arrow-right'))
. mute(_('Import'))
. mute(__('Import'))
]
)
. form(
[
div('row', [
div('col-sm-6', [
'<h3>' . _('Rooms to create') . '</h3>',
table(_('Name'), $rooms_new)
'<h3>' . __('Rooms to create') . '</h3>',
table(__('Name'), $rooms_new)
]),
div('col-sm-6', [
'<h3>' . _('Rooms to delete') . '</h3>',
table(_('Name'), $rooms_deleted)
'<h3>' . __('Rooms to delete') . '</h3>',
table(__('Name'), $rooms_deleted)
])
]),
'<h3>' . _('Shifts to create') . '</h3>',
'<h3>' . __('Shifts to create') . '</h3>',
table([
'day' => _('Day'),
'start' => _('Start'),
'end' => _('End'),
'shifttype' => _('Shift type'),
'title' => _('Title'),
'room' => _('Room')
'day' => __('Day'),
'start' => __('Start'),
'end' => __('End'),
'shifttype' => __('Shift type'),
'title' => __('Title'),
'room' => __('Room')
], shifts_printable($events_new, $shifttypes)),
'<h3>' . _('Shifts to update') . '</h3>',
'<h3>' . __('Shifts to update') . '</h3>',
table([
'day' => _('Day'),
'start' => _('Start'),
'end' => _('End'),
'shifttype' => _('Shift type'),
'title' => _('Title'),
'room' => _('Room')
'day' => __('Day'),
'start' => __('Start'),
'end' => __('End'),
'shifttype' => __('Shift type'),
'title' => __('Title'),
'room' => __('Room')
], shifts_printable($events_updated, $shifttypes)),
'<h3>' . _('Shifts to delete') . '</h3>',
'<h3>' . __('Shifts to delete') . '</h3>',
table([
'day' => _('Day'),
'start' => _('Start'),
'end' => _('End'),
'shifttype' => _('Shift type'),
'title' => _('Title'),
'room' => _('Room')
'day' => __('Day'),
'start' => __('Start'),
'end' => __('End'),
'shifttype' => __('Shift type'),
'title' => __('Title'),
'room' => __('Room')
], shifts_printable($events_deleted, $shifttypes)),
form_submit('submit', _('Import'))
form_submit('submit', __('Import'))
],
page_link_to('admin_import', [
'step' => 'import',
@ -227,7 +227,7 @@ function admin_import()
case 'import':
if (!file_exists($import_file)) {
error(_('Missing import file.'));
error(__('Missing import file.'));
redirect(page_link_to('admin_import'));
}
@ -238,21 +238,21 @@ function admin_import()
if ($request->has('shifttype_id') && isset($shifttypes[$request->input('shifttype_id')])) {
$shifttype_id = $request->input('shifttype_id');
} else {
error(_('Please select a shift type.'));
error(__('Please select a shift type.'));
redirect(page_link_to('admin_import'));
}
if ($request->has('add_minutes_start') && is_numeric(trim($request->input('add_minutes_start')))) {
$add_minutes_start = trim($request->input('add_minutes_start'));
} else {
error(_('Please enter an amount of minutes to add to a talk\'s begin.'));
error(__('Please enter an amount of minutes to add to a talk\'s begin.'));
redirect(page_link_to('admin_import'));
}
if ($request->has('add_minutes_end') && is_numeric(trim($request->input('add_minutes_end')))) {
$add_minutes_end = trim($request->input('add_minutes_end'));
} else {
error(_('Please enter an amount of minutes to add to a talk\'s end.'));
error(__('Please enter an amount of minutes to add to a talk\'s end.'));
redirect(page_link_to('admin_import'));
}
@ -288,12 +288,12 @@ function admin_import()
unlink($import_file);
$html .= div('well well-sm text-center', [
'<span class="text-success">' . _('File Upload') . glyph('ok-circle') . '</span>'
'<span class="text-success">' . __('File Upload') . glyph('ok-circle') . '</span>'
. mute(glyph('arrow-right'))
. '<span class="text-success">' . _('Validation') . glyph('ok-circle') . '</span>'
. '<span class="text-success">' . __('Validation') . glyph('ok-circle') . '</span>'
. mute(glyph('arrow-right'))
. '<span class="text-success">' . _('Import') . glyph('ok-circle') . '</span>'
]) . success(_('It\'s done!'), true);
. '<span class="text-success">' . __('Import') . glyph('ok-circle') . '</span>'
]) . success(__('It\'s done!'), true);
break;
default:
redirect(page_link_to('admin_import'));

@ -5,7 +5,7 @@
*/
function admin_log_title()
{
return _('Log');
return __('Log');
}
/**
@ -26,8 +26,8 @@ function admin_log()
return page_with_title(admin_log_title(), [
msg(),
form([
form_text('keyword', _('Search'), $filter),
form_submit(_('Search'), 'Go')
form_text('keyword', __('Search'), $filter),
form_submit(__('Search'), 'Go')
]),
table([
'date' => 'Time',

@ -14,7 +14,7 @@ function admin_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 ($request->has('id') && preg_match('/^\d{1,11}$/', $request->input('id'))) {
$news_id = $request->input('id');
} else {
@ -34,19 +34,19 @@ function admin_news()
&& strip_tags($news['Text']) != $news['Text']
) {
$html .= warning(
_('This message contains HTML. After saving the post some formatting will be lost!'),
__('This message contains HTML. After saving the post some formatting will be lost!'),
true
);
}
$html .= form(
[
form_info(_('Date'), date('Y-m-d H:i', $news['Datum'])),
form_info(_('Author'), User_Nick_render($user_source)),
form_text('eBetreff', _('Subject'), $news['Betreff']),
form_textarea('eText', _('Message'), $news['Text']),
form_checkbox('eTreffen', _('Meeting'), $news['Treffen'] == 1, 1),
form_submit('submit', _('Save'))
form_info(__('Date'), date('Y-m-d H:i', $news['Datum'])),
form_info(__('Author'), User_Nick_render($user_source)),
form_text('eBetreff', __('Subject'), $news['Betreff']),
form_textarea('eText', __('Message'), $news['Text']),
form_checkbox('eTreffen', __('Meeting'), $news['Treffen'] == 1, 1),
form_submit('submit', __('Save'))
],
page_link_to('admin_news', ['action' => 'save', 'id' => $news_id])
);
@ -54,7 +54,7 @@ function admin_news()
$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;
@ -84,14 +84,14 @@ function admin_news()
);
engelsystem_log('News updated: ' . $request->postData('eBetreff'));
success(_('News entry updated.'));
success(__('News entry updated.'));
redirect(page_link_to('news'));
break;
case 'delete':
DB::delete('DELETE FROM `News` WHERE `ID`=? LIMIT 1', [$news_id]);
engelsystem_log('News deleted: ' . $news['Betreff']);
success(_('News entry deleted.'));
success(__('News entry deleted.'));
redirect(page_link_to('news'));
break;
default:

@ -7,7 +7,7 @@ use Engelsystem\Database\DB;
*/
function admin_questions_title()
{
return _('Answer questions');
return __('Answer questions');
}
/**
@ -25,7 +25,7 @@ function admin_new_questions()
if ($new_messages > 0) {
return '<a href="' . page_link_to('admin_questions') . '">'
. _('There are unanswered questions!')
. __('There are unanswered questions!')
. '</a>';
}
}
@ -53,11 +53,11 @@ function admin_questions()
'question' => str_replace("\n", '<br />', $question['Question']),
'answer' => form([
form_textarea('answer', '', ''),
form_submit('submit', _('Save'))
form_submit('submit', __('Save'))
], page_link_to('admin_questions', ['action' => 'answer', 'id' => $question['QID']])),
'actions' => button(
page_link_to('admin_questions', ['action' => 'delete', 'id' => $question['QID']]),
_('delete'),
__('delete'),
'btn-xs'
)
];
@ -75,26 +75,26 @@ function admin_questions()
'answer' => str_replace("\n", '<br />', $question['Answer']),
'actions' => button(
page_link_to('admin_questions', ['action' => 'delete', 'id' => $question['QID']]),
_('delete'),
__('delete'),
'btn-xs'
)
];
}
return page_with_title(admin_questions_title(), [
'<h2>' . _('Unanswered questions') . '</h2>',
'<h2>' . __('Unanswered questions') . '</h2>',
table([
'from' => _('From'),
'question' => _('Question'),
'answer' => _('Answer'),
'from' => __('From'),
'question' => __('Question'),
'answer' => __('Answer'),
'actions' => ''
], $unanswered_questions_table),
'<h2>' . _('Answered questions') . '</h2>',
'<h2>' . __('Answered questions') . '</h2>',
table([
'from' => _('From'),
'question' => _('Question'),
'answered_by' => _('Answered by'),
'answer' => _('Answer'),
'from' => __('From'),
'question' => __('Question'),
'answered_by' => __('Answered by'),
'answer' => __('Answer'),
'actions' => ''
], $answered_questions_table)
]);

@ -4,7 +4,7 @@
*/
function admin_rooms_title()
{
return _('Rooms');
return __('Rooms');
}
/**
@ -24,12 +24,12 @@ function admin_rooms()
'actions' => table_buttons([
button(
page_link_to('admin_rooms', ['show' => 'edit', 'id' => $room['RID']]),
_('edit'),
__('edit'),
'btn-xs'
),
button(
page_link_to('admin_rooms', ['show' => 'delete', 'id' => $room['RID']]),
_('delete'),
__('delete'),
'btn-xs'
)
])
@ -79,13 +79,13 @@ function admin_rooms()
$result = Room_validate_name(strip_request_item('name'), $room_id);
if (!$result->isValid()) {
$valid = false;
$msg .= error(_('This name is already in use.'), true);
$msg .= error(__('This name is already in use.'), true);
} else {
$name = $result->getValue();
}
} else {
$valid = false;
$msg .= error(_('Please enter a name.'), true);
$msg .= error(__('Please enter a name.'), true);
}
$from_frab = $request->has('from_frab');
@ -110,7 +110,7 @@ function admin_rooms()
} else {
$valid = false;
$msg .= error(sprintf(
_('Please enter needed angels for type %s.'),
__('Please enter needed angels for type %s.'),
$angeltype
), true);
}
@ -139,7 +139,7 @@ function admin_rooms()
'Set needed angeltypes of room ' . $name
. ' to: ' . join(', ', $needed_angeltype_info)
);
success(_('Room saved.'));
success(__('Room saved.'));
redirect(page_link_to('admin_rooms'));
}
}
@ -152,29 +152,29 @@ function admin_rooms()
return page_with_title(admin_rooms_title(), [
buttons([
button(page_link_to('admin_rooms'), _('back'), 'back')
button(page_link_to('admin_rooms'), __('back'), 'back')
]),
$msg,
form([
div('row', [
div('col-md-6', [
form_text('name', _('Name'), $name),
form_checkbox('from_frab', _('Frab import'), $from_frab),
form_text('map_url', _('Map URL'), $map_url),
form_info('', _('The map url is used to display an iframe on the room page.')),
form_textarea('description', _('Description'), $description),
form_info('', _('Please use markdown for the description.')),
form_text('name', __('Name'), $name),
form_checkbox('from_frab', __('Frab import'), $from_frab),
form_text('map_url', __('Map URL'), $map_url),
form_info('', __('The map url is used to display an iframe on the room page.')),
form_textarea('description', __('Description'), $description),
form_info('', __('Please use markdown for the description.')),
]),
div('col-md-6', [
div('row', [
div('col-md-12', [
form_info(_('Needed angels:'))
form_info(__('Needed angels:'))
]),
join($angeltypes_count_form)
])
])
]),
form_submit('submit', _('Save'))
form_submit('submit', __('Save'))
])
]);
} elseif ($request->input('show') == 'delete') {
@ -182,19 +182,19 @@ function admin_rooms()
Room_delete($room_id);
engelsystem_log('Room deleted: ' . $name);
success(sprintf(_('Room %s deleted.'), $name));
success(sprintf(__('Room %s deleted.'), $name));
redirect(page_link_to('admin_rooms'));
}
return page_with_title(admin_rooms_title(), [
buttons([
button(page_link_to('admin_rooms'), _('back'), 'back')
button(page_link_to('admin_rooms'), __('back'), 'back')
]),
sprintf(_('Do you want to delete room %s?'), $name),
sprintf(__('Do you want to delete room %s?'), $name),
buttons([
button(
page_link_to('admin_rooms', ['show' => 'delete', 'id' => $room_id, 'ack' => 1]),
_('Delete'),
__('Delete'),
'delete btn-danger'
)
])
@ -204,13 +204,13 @@ function admin_rooms()
return page_with_title(admin_rooms_title(), [
buttons([
button(page_link_to('admin_rooms', ['show' => 'edit']), _('add'))
button(page_link_to('admin_rooms', ['show' => 'edit']), __('add'))
]),
msg(),
table([
'name' => _('Name'),
'from_frab' => _('Frab import'),
'map_url' => _('Map'),
'name' => __('Name'),
'from_frab' => __('Frab import'),
'map_url' => __('Map'),
'actions' => ''
], $rooms)
]);

@ -7,7 +7,7 @@ use Engelsystem\Database\DB;
*/
function admin_shifts_title()
{
return _('Create shifts');
return __('Create shifts');
}
/**
@ -55,13 +55,13 @@ function admin_shifts()
$shifttype = ShiftType($request->input('shifttype_id'));
if (empty($shifttype)) {
$valid = false;
error(_('Please select a shift type.'));
error(__('Please select a shift type.'));
} else {
$shifttype_id = $request->input('shifttype_id');
}
} else {
$valid = false;
error(_('Please select a shift type.'));
error(__('Please select a shift type.'));
}
// Name/Bezeichnung der Schicht, darf leer sein
@ -77,26 +77,26 @@ function admin_shifts()
} else {
$valid = false;
$rid = $rooms[0]['RID'];
error(_('Please select a location.'));
error(__('Please select a location.'));
}
if ($request->has('start') && $tmp = parse_date('Y-m-d H:i', $request->input('start'))) {
$start = $tmp;
} else {
$valid = false;
error(_('Please select a start time.'));
error(__('Please select a start time.'));
}
if ($request->has('end') && $tmp = parse_date('Y-m-d H:i', $request->input('end'))) {
$end = $tmp;
} else {
$valid = false;
error(_('Please select an end time.'));
error(__('Please select an end time.'));
}
if ($start >= $end) {
$valid = false;
error(_('The shifts end has to be after its start.'));
error(__('The shifts end has to be after its start.'));
}
if ($request->has('mode')) {
@ -108,7 +108,7 @@ function admin_shifts()
$length = trim($request->input('length'));
} else {
$valid = false;
error(_('Please enter a shift duration in minutes.'));
error(__('Please enter a shift duration in minutes.'));
}
} elseif ($request->input('mode') == 'variable') {
if (
@ -125,12 +125,12 @@ function admin_shifts()
);
} else {
$valid = false;
error(_('Please split the shift-change hours by colons.'));
error(__('Please split the shift-change hours by colons.'));
}
}
} else {
$valid = false;
error(_('Please select a mode.'));
error(__('Please select a mode.'));
}
if ($request->has('angelmode')) {
@ -143,21 +143,21 @@ function admin_shifts()
$needed_angel_types[$type['id']] = trim($request->input('type_' . $type['id'], 0));
} else {
$valid = false;
error(sprintf(_('Please check the needed angels for team %s.'), $type['name']));
error(sprintf(__('Please check the needed angels for team %s.'), $type['name']));
}
}
if (array_sum($needed_angel_types) == 0) {
$valid = false;
error(_('There are 0 angels needed. Please enter the amounts of needed angels.'));
error(__('There are 0 angels needed. Please enter the amounts of needed angels.'));
}
} else {
$valid = false;
error(_('Please select a mode for needed angels.'));
error(__('Please select a mode for needed angels.'));
}
} else {
$valid = false;
error(_('Please select needed angels.'));
error(__('Please select needed angels.'));
}
// Beim Zurück-Knopf das Formular zeigen
@ -285,7 +285,7 @@ function admin_shifts()
foreach ($needed_angel_types as $type_id => $count) {
$hidden_types .= form_hidden('type_' . $type_id, $count);
}
return page_with_title(_('Preview'), [
return page_with_title(__('Preview'), [
form([
$hidden_types,
form_hidden('shifttype_id', $shifttype_id),
@ -297,13 +297,13 @@ function admin_shifts()
form_hidden('length', $length),
form_hidden('change_hours', implode(', ', $change_hours)),
form_hidden('angelmode', $angelmode),
form_submit('back', _('back')),
form_submit('back', __('back')),
table([
'timeslot' => _('Time and location'),
'title' => _('Type and title'),
'needed_angels' => _('Needed angels')
'timeslot' => __('Time and location'),
'title' => __('Type and title'),
'needed_angels' => __('Needed angels')
], $shifts_table),
form_submit('submit', _('Save'))
form_submit('submit', __('Save'))
])
]);
}
@ -379,48 +379,48 @@ function admin_shifts()
return page_with_title(admin_shifts_title(), [
msg(),
form([
form_select('shifttype_id', _('Shifttype'), $shifttypes, $shifttype_id),
form_text('title', _('Title'), $title),
form_select('rid', _('Room'), $room_array, $rid),
form_select('shifttype_id', __('Shifttype'), $shifttypes, $shifttype_id),
form_text('title', __('Title'), $title),
form_select('rid', __('Room'), $room_array, $rid),
div('row', [
div('col-md-6', [
form_text('start', _('Start'), date('Y-m-d H:i', $start)),
form_text('end', _('End'), date('Y-m-d H:i', $end)),
form_info(_('Mode'), ''),
form_radio('mode', _('Create one shift'), $mode == 'single', 'single'),
form_radio('mode', _('Create multiple shifts'), $mode == 'multi', 'multi'),
form_text('start', __('Start'), date('Y-m-d H:i', $start)),
form_text('end', __('End'), date('Y-m-d H:i', $end)),
form_info(__('Mode'), ''),
form_radio('mode', __('Create one shift'), $mode == 'single', 'single'),
form_radio('mode', __('Create multiple shifts'), $mode == 'multi', 'multi'),
form_text(
'length',
_('Length'),
__('Length'),
$request->has('length')
? $request->input('length')
: '120'
),
form_radio(
'mode',
_('Create multiple shifts with variable length'),
__('Create multiple shifts with variable length'),
$mode == 'variable',
'variable'
),
form_text(
'change_hours',
_('Shift change hours'),
__('Shift change hours'),
$request->has('change_hours')
? $request->input('input')
: '00, 04, 08, 10, 12, 14, 16, 18, 20, 22'
)
]),
div('col-md-6', [
form_info(_('Needed angels'), ''),
form_info(__('Needed angels'), ''),
form_radio(
'angelmode',
_('Take needed angels from room settings'),
__('Take needed angels from room settings'),
$angelmode == 'location',
'location'
),
form_radio(
'angelmode',
_('The following angels are needed'),
__('The following angels are needed'),
$angelmode == 'manually',
'manually'
),
@ -429,7 +429,7 @@ function admin_shifts()
])
])
]),
form_submit('preview', _('Preview'))
form_submit('preview', __('Preview'))
])
]);
}

@ -7,7 +7,7 @@ use Engelsystem\Database\DB;
*/
function admin_user_title()
{
return _('All Angels');
return __('All Angels');
}
/**
@ -18,13 +18,6 @@ function admin_user()
global $user, $privileges;
$tshirt_sizes = config('tshirt_sizes');
$request = request();
foreach ($tshirt_sizes as $key => $size) {
if (empty($size)) {
unset($tshirt_sizes[$key]);
}
}
$html = '';
if (!$request->has('id')) {
@ -35,7 +28,7 @@ function admin_user()
if (!$request->has('action')) {
$user_source = User($user_id);
if (empty($user_source)) {
error(_('This user does not exist.'));
error(__('This user does not exist.'));
redirect(users_link());
}
@ -68,11 +61,11 @@ function admin_user()
}
$html .= " <tr><td>jabber</td><td>" . '<input size="40" name="ejabber" value="' . $user_source['jabber'] . '" class="form-control"></td></tr>' . "\n";
$html .= ' <tr><td>Size</td><td>'
. html_select_key('size', 'eSize', $tshirt_sizes, $user_source['Size']) . '</td></tr>' . "\n";
. html_select_key('size', 'eSize', $tshirt_sizes, $user_source['Size'], __('Please select...')) . '</td></tr>' . "\n";
$options = [
'1' => _('Yes'),
'0' => _('No')
'1' => __('Yes'),
'0' => __('No')
];
// Gekommen?
@ -85,7 +78,7 @@ function admin_user()
// Aktiv erzwingen
if (in_array('admin_active', $privileges)) {
$html .= ' <tr><td>' . _('Force active') . '</td><td>' . "\n";
$html .= ' <tr><td>' . __('Force active') . '</td><td>' . "\n";
$html .= html_options('force_active', $options, $user_source['force_active']) . '</td></tr>' . "\n";
}
@ -104,7 +97,7 @@ function admin_user()
$html .= '<hr />';
$html .= form_info('', _('Please visit the angeltypes page or the users profile to manage users angeltypes.'));
$html .= form_info('', __('Please visit the angeltypes page or the users profile to manage users angeltypes.'));
$html .= 'Hier kannst Du das Passwort dieses Engels neu setzen:<form action="'
. page_link_to('admin_user', ['action' => 'change_pw', 'id' => $user_id])
@ -171,7 +164,7 @@ function admin_user()
}
$html .= buttons([
button(user_delete_link($user_source), glyph('lock') . _('delete'), 'btn-danger')
button(user_delete_link($user_source), glyph('lock') . __('delete'), 'btn-danger')
]);
$html .= "<hr />";
@ -319,7 +312,7 @@ function admin_user()
}
}
return page_with_title(_('Edit user'), [
return page_with_title(__('Edit user'), [
$html
]);
}

@ -5,7 +5,7 @@
*/
function credits_title()
{
return _('Credits');
return __('Credits');
}
/**

@ -7,7 +7,7 @@ use Engelsystem\Database\DB;
*/
function login_title()
{
return _('Login');
return __('Login');
}
/**
@ -15,7 +15,7 @@ function login_title()
*/
function register_title()
{
return _('Register');
return __('Register');
}
/**
@ -23,7 +23,7 @@ function register_title()
*/
function logout_title()
{
return _('Logout');
return __('Logout');
}
/**
@ -69,14 +69,8 @@ function guest_register()
}
}
foreach ($tshirt_sizes as $key => $size) {
if (empty($size)) {
unset($tshirt_sizes[$key]);
}
}
if (!in_array('register', $privileges) || (!isset($user) && !config('registration_enabled'))) {
error(_('Registration is disabled.'));
error(__('Registration is disabled.'));
return page_with_title(register_title(), [
msg(),
@ -90,12 +84,12 @@ function guest_register()
$nick = User_validate_Nick($request->input('nick'));
if (count(DB::select('SELECT `UID` FROM `User` WHERE `Nick`=? LIMIT 1', [$nick])) > 0) {
$valid = false;
$msg .= error(sprintf(_('Your nick &quot;%s&quot; already exists.'), $nick), true);
$msg .= error(sprintf(__('Your nick &quot;%s&quot; already exists.'), $nick), true);
}
} else {
$valid = false;
$msg .= error(sprintf(
_('Your nick &quot;%s&quot; is too short (min. 2 characters).'),
__('Your nick &quot;%s&quot; is too short (min. 2 characters).'),
User_validate_Nick($request->input('nick'))
), true);
}
@ -104,11 +98,11 @@ function guest_register()
$mail = strip_request_item('mail');
if (!check_email($mail)) {
$valid = false;
$msg .= error(_('E-mail address is not correct.'), true);
$msg .= error(__('E-mail address is not correct.'), true);
}
} else {
$valid = false;
$msg .= error(_('Please enter your e-mail.'), true);
$msg .= error(__('Please enter your e-mail.'), true);
}
if ($request->has('email_shiftinfo')) {
@ -123,7 +117,7 @@ function guest_register()
$jabber = strip_request_item('jabber');
if (!check_email($jabber)) {
$valid = false;
$msg .= error(_('Please check your jabber account information.'), true);
$msg .= error(__('Please check your jabber account information.'), true);
}
}
@ -132,19 +126,19 @@ function guest_register()
$tshirt_size = $request->input('tshirt_size');
} else {
$valid = false;
$msg .= error(_('Please select your shirt size.'), true);
$msg .= error(__('Please select your shirt size.'), true);
}
}
if ($request->has('password') && strlen($request->postData('password')) >= $min_password_length) {
if ($request->postData('password') != $request->postData('password2')) {
$valid = false;
$msg .= error(_('Your passwords don\'t match.'), true);
$msg .= error(__('Your passwords don\'t match.'), true);
}
} else {
$valid = false;
$msg .= error(sprintf(
_('Your password is too short (please use at least %s characters).'),
__('Your password is too short (please use at least %s characters).'),
$min_password_length
), true);
}
@ -155,11 +149,11 @@ function guest_register()
$planned_arrival_date = $result->getValue();
if (!$result->isValid()) {
$valid = false;
error(_('Please enter your planned date of arrival. It should be after the buildup start date and before teardown end date.'));
error(__('Please enter your planned date of arrival. It should be after the buildup start date and before teardown end date.'));
}
} else {
$valid = false;
error(_('Please enter your planned date of arrival. It should be after the buildup start date and before teardown end date.'));
error(__('Please enter your planned date of arrival. It should be after the buildup start date and before teardown end date.'));
}
$selected_angel_types = [];
@ -187,7 +181,7 @@ function guest_register()
$dect = strip_request_item('dect');
} else {
$valid = false;
error(_('For dect numbers are only 5 digits allowed.'));
error(__('For dect numbers are only 5 digits allowed.'));
}
}
if ($request->has('mobile')) {
@ -271,7 +265,7 @@ function guest_register()
'User ' . User_Nick_render(User($user_id))
. ' signed up as: ' . join(', ', $user_angel_types_info)
);
success(_('Angel registration successful!'));
success(__('Angel registration successful!'));
// User is already logged in - that means a supporter has registered an angel. Return to register page.
if (isset($user)) {
@ -299,7 +293,7 @@ function guest_register()
}
return page_with_title(register_title(), [
_('By completing this form you\'re registering as a Chaos-Angel. This script will create you an account in the angel task scheduler.'),
__('By completing this form you\'re registering as a Chaos-Angel. This script will create you an account in the angel task scheduler.'),
$msg,
msg(),
form([
@ -307,18 +301,18 @@ function guest_register()
div('col-md-6', [
div('row', [
div('col-sm-4', [
form_text('nick', _('Nick') . ' ' . entry_required(), $nick)
form_text('nick', __('Nick') . ' ' . entry_required(), $nick)
]),
div('col-sm-8', [
form_email('mail', _('E-Mail') . ' ' . entry_required(), $mail),
form_email('mail', __('E-Mail') . ' ' . entry_required(), $mail),
form_checkbox(
'email_shiftinfo',
_('The engelsystem is allowed to send me an email (e.g. when my shifts change)'),
__('The engelsystem is allowed to send me an email (e.g. when my shifts change)'),
$email_shiftinfo
),
form_checkbox(
'email_by_human_allowed',
_('Humans are allowed to send me an email (e.g. for ticket vouchers)'),
__('Humans are allowed to send me an email (e.g. for ticket vouchers)'),
$email_by_human_allowed
)
])
@ -327,72 +321,72 @@ function guest_register()
div('col-sm-6', [
form_date(
'planned_arrival_date',
_('Planned date of arrival') . ' ' . entry_required(),
__('Planned date of arrival') . ' ' . entry_required(),
$planned_arrival_date, $buildup_start_date, $teardown_end_date
)
]),
div('col-sm-6', [
$enable_tshirt_size ? form_select('tshirt_size',
_('Shirt size') . ' ' . entry_required(),
$tshirt_sizes, $tshirt_size) : ''
__('Shirt size') . ' ' . entry_required(),
$tshirt_sizes, $tshirt_size, __('Please select...')) : ''
])
]),
div('row', [
div('col-sm-6', [
form_password('password', _('Password') . ' ' . entry_required())
form_password('password', __('Password') . ' ' . entry_required())
]),
div('col-sm-6', [
form_password('password2', _('Confirm password') . ' ' . entry_required())
form_password('password2', __('Confirm password') . ' ' . entry_required())
])
]),
form_checkboxes(
'angel_types',
_('What do you want to do?') . sprintf(
__('What do you want to do?') . sprintf(
' (<a href="%s">%s</a>)',
page_link_to('angeltypes', ['action' => 'about']),
_('Description of job types')
__('Description of job types')
),
$angel_types,
$selected_angel_types
),
form_info(
'',
_('Restricted angel types need will be confirmed later by a supporter. You can change your selection in the options section.')
__('Restricted angel types need will be confirmed later by a supporter. You can change your selection in the options section.')
)
]),
div('col-md-6', [
div('row', [
div('col-sm-4', [
form_text('dect', _('DECT'), $dect)
form_text('dect', __('DECT'), $dect)
]),
div('col-sm-4', [
form_text('mobile', _('Mobile'), $mobile)
form_text('mobile', __('Mobile'), $mobile)
]),
div('col-sm-4', [
form_text('tel', _('Phone'), $tel)
form_text('tel', __('Phone'), $tel)
])
]),
form_text('jabber', _('Jabber'), $jabber),
form_text('jabber', __('Jabber'), $jabber),
div('row', [
div('col-sm-6', [
form_text('prename', _('First name'), $preName)
form_text('prename', __('First name'), $preName)
]),
div('col-sm-6', [
form_text('lastname', _('Last name'), $lastName)
form_text('lastname', __('Last name'), $lastName)
])
]),
div('row', [
div('col-sm-3', [
form_text('age', _('Age'), $age)
form_text('age', __('Age'), $age)
]),
div('col-sm-9', [
form_text('hometown', _('Hometown'), $hometown)
form_text('hometown', __('Hometown'), $hometown)
])
]),
form_info(entry_required() . ' = ' . _('Entry required!'))
form_info(entry_required() . ' = ' . __('Entry required!'))
])
]),
form_submit('submit', _('Register'))
form_submit('submit', __('Register'))
])
]);
}
@ -435,19 +429,19 @@ function guest_login()
if ($request->has('password')) {
if (!verify_password($request->postData('password'), $login_user['Passwort'], $login_user['UID'])) {
$valid = false;
error(_('Your password is incorrect. Please try it again.'));
error(__('Your password is incorrect. Please try it again.'));
}
} else {
$valid = false;
error(_('Please enter a password.'));
error(__('Please enter a password.'));
}
} else {
$valid = false;
error(_('No user was found with that Nickname. Please try again. If you are still having problems, ask a Dispatcher.'));
error(__('No user was found with that Nickname. Please try again. If you are still having problems, ask a Dispatcher.'));
}
} else {
$valid = false;
error(_('Please enter a nickname.'));
error(__('Please enter a nickname.'));
}
if ($valid && !empty($login_user)) {
@ -469,21 +463,21 @@ function guest_login()
div('col-sm-6 col-sm-offset-3 col-md-4 col-md-offset-4', [
div('panel panel-primary first', [
div('panel-heading', [
'<span class="icon-icon_angel"></span> ' . _('Login')
'<span class="icon-icon_angel"></span> ' . __('Login')
]),
div('panel-body', [
msg(),
form([
form_text_placeholder('nick', _('Nick'), $nick),
form_password_placeholder('password', _('Password')),
form_submit('submit', _('Login')),
form_text_placeholder('nick', __('Nick'), $nick),
form_password_placeholder('password', __('Password')),
form_submit('submit', __('Login')),
!$valid ? buttons([
button(page_link_to('user_password_recovery'), _('I forgot my password'))
button(page_link_to('user_password_recovery'), __('I forgot my password'))
]) : ''
])
]),
div('panel-footer', [
glyph('info-sign') . _('Please note: You have to activate cookies!')
glyph('info-sign') . __('Please note: You have to activate cookies!')
])
])
])
@ -494,12 +488,12 @@ function guest_login()
get_register_hint()
]),
div('col-sm-6 text-center', [
heading(_('What can I do?'), 2),
'<p>' . _('Please read about the jobs you can do to help us.') . '</p>',
heading(__('What can I do?'), 2),
'<p>' . __('Please read about the jobs you can do to help us.') . '</p>',
buttons([
button(
page_link_to('angeltypes', ['action' => 'about']),
_('Teams/Job description') . ' &raquo;'
__('Teams/Job description') . ' &raquo;'
)
])
])
@ -517,12 +511,12 @@ function get_register_hint()
if (in_array('register', $privileges) && config('registration_enabled')) {
return join('', [
'<p>' . _('Please sign up, if you want to help us!') . '</p>',
'<p>' . __('Please sign up, if you want to help us!') . '</p>',
buttons([
button(page_link_to('register'), register_title() . ' &raquo;')
])
]);
}
return error(_('Registration is disabled.'), true);
return error(__('Registration is disabled.'), true);
}

@ -7,7 +7,7 @@ use Engelsystem\Database\DB;
*/
function messages_title()
{
return _('Messages');
return __('Messages');
}
/**
@ -44,7 +44,7 @@ function user_messages()
);
$to_select_data = [
'' => _('Select recipient...')
'' => __('Select recipient...')
];
foreach ($users as $u) {
@ -73,7 +73,7 @@ function user_messages()
'from' => User_Nick_render($user),
'to' => $to_select,
'text' => form_textarea('text', '', ''),
'actions' => form_submit('submit', _('Save'))
'actions' => form_submit('submit', __('Save'))
]
];
@ -93,14 +93,14 @@ function user_messages()
if ($message['isRead'] == 'N') {
$messages_table_entry['actions'] = button(
page_link_to('user_messages', ['action' => 'read', 'id' => $message['id']]),
_('mark as read'),
__('mark as read'),
'btn-xs'
);
}
} else {
$messages_table_entry['actions'] = button(
page_link_to('user_messages', ['action' => 'delete', 'id' => $message['id']]),
_('delete message'),
__('delete message'),
'btn-xs'
);
}
@ -109,14 +109,14 @@ function user_messages()
return page_with_title(messages_title(), [
msg(),
sprintf(_('Hello %s, here can you leave messages for other angels'), User_Nick_render($user)),
sprintf(__('Hello %s, here can you leave messages for other angels'), User_Nick_render($user)),
form([
table([
'new' => _('New'),
'timestamp' => _('Date'),
'from' => _('Transmitted'),
'to' => _('Recipient'),
'text' => _('Message'),
'new' => __('New'),
'timestamp' => __('Date'),
'from' => __('Transmitted'),
'to' => __('Recipient'),
'text' => __('Message'),
'actions' => ''
], $messages_table)
], page_link_to('user_messages', ['action' => 'send']))
@ -127,7 +127,7 @@ function user_messages()
if ($request->has('id') && preg_match('/^\d{1,11}$/', $request->input('id'))) {
$message_id = $request->input('id');
} else {
return error(_('Incomplete call, missing Message ID.'), true);
return error(__('Incomplete call, missing Message ID.'), true);
}
$message = DB::selectOne(
@ -141,7 +141,7 @@ function user_messages()
);
redirect(page_link_to('user_messages'));
} else {
return error(_('No Message found.'), true);
return error(__('No Message found.'), true);
}
break;
@ -149,7 +149,7 @@ function user_messages()
if ($request->has('id') && preg_match('/^\d{1,11}$/', $request->input('id'))) {
$message_id = $request->input('id');
} else {
return error(_('Incomplete call, missing Message ID.'), true);
return error(__('Incomplete call, missing Message ID.'), true);
}
$message = DB::selectOne(
@ -160,7 +160,7 @@ function user_messages()
DB::delete('DELETE FROM `Messages` WHERE `id`=? LIMIT 1', [$message_id]);
redirect(page_link_to('user_messages'));
} else {
return error(_('No Message found.'), true);
return error(__('No Message found.'), true);
}
break;
@ -169,12 +169,12 @@ function user_messages()
if (Message_send($request->input('to'), $request->input('text'))) {
redirect(page_link_to('user_messages'));
} else {
return error(_('Transmitting was terminated with an Error.'), true);
return error(__('Transmitting was terminated with an Error.'), true);
}
break;
default:
return error(_('Wrong action.'), true);
return error(__('Wrong action.'), true);
}
}

@ -7,7 +7,7 @@ use Engelsystem\Database\DB;
*/
function myshifts_title()
{
return _('My shifts');
return __('My shifts');
}
/**
@ -35,15 +35,15 @@ function user_myshifts()
if ($request->has('reset')) {
if ($request->input('reset') == 'ack') {
User_reset_api_key($user);
success(_('Key changed.'));
success(__('Key changed.'));
redirect(page_link_to('users', ['action' => 'view', 'user_id' => $shifts_user['UID']]));
}
return page_with_title(_('Reset API key'), [
return page_with_title(__('Reset API key'), [
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.'),
__('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
),
button(page_link_to('user_myshifts', ['reset' => 'ack']), _('Continue'), 'btn-danger')
button(page_link_to('user_myshifts', ['reset' => 'ack']), __('Continue'), 'btn-danger')
]);
} elseif ($request->has('edit') && preg_match('/^\d+$/', $request->input('edit'))) {
$shift_entry_id = $request->input('edit');
@ -82,7 +82,7 @@ function user_myshifts()
$freeload_comment = strip_request_item_nl('freeload_comment');
if ($freeloaded && $freeload_comment == '') {
$valid = false;
error(_('Please enter a freeload comment!'));
error(__('Please enter a freeload comment!'));
}
}
@ -104,7 +104,7 @@ function user_myshifts()
. ' with comment ' . $comment
. '. Freeloaded: ' . ($freeloaded ? 'YES Comment: ' . $freeload_comment : 'NO')
);
success(_('Shift saved.'));
success(__('Shift saved.'));
redirect(page_link_to('users', ['action' => 'view', 'user_id' => $shifts_user['UID']]));
}
}

@ -7,7 +7,7 @@ use Engelsystem\Database\DB;
*/
function user_news_comments_title()
{
return _('News comments');
return __('News comments');
}
/**
@ -15,7 +15,7 @@ function user_news_comments_title()
*/
function news_title()
{
return _('News');
return __('News');
}
/**
@ -23,7 +23,7 @@ function news_title()
*/
function meetings_title()
{
return _('Meetings');
return __('Meetings');
}
/**
@ -117,7 +117,7 @@ function display_news($news)
if ($page != 'news_comments') {
$html .= '&emsp;<a href="' . page_link_to('news_comments', ['nid' => $news['ID']]) . '">'
. '<span class="glyphicon glyphicon-comment"></span> '
. _('Comments') . ' &raquo;</a> '
. __('Comments') . ' &raquo;</a> '
. '<span class="badge">'
. count(DB::select('SELECT `ID` FROM `NewsComments` WHERE `Refid`=?', [$news['ID']]))
. '</span>';
@ -162,7 +162,7 @@ function user_news_comments()
]
);
engelsystem_log('Created news_comment: ' . $text);
$html .= success(_('Entry saved.'), true);
$html .= success(__('Entry saved.'), true);
}
$html .= display_news($news);
@ -183,13 +183,13 @@ function user_news_comments()
$html .= '</div>';
}
$html .= '<hr /><h2>' . _('New Comment:') . '</h2>';
$html .= '<hr /><h2>' . __('New Comment:') . '</h2>';
$html .= form([
form_textarea('text', _('Message'), ''),
form_submit('submit', _('Save'))
form_textarea('text', __('Message'), ''),
form_submit('submit', __('Save'))
], page_link_to('news_comments', ['nid' => $news['ID']]));
} else {
$html .= _('Invalid request.');
$html .= __('Invalid request.');
}
return $html . '</div>';
@ -230,7 +230,7 @@ function user_news()
]
);
engelsystem_log('Created news: ' . $request->postData('betreff') . ', treffen: ' . $isMeeting);
success(_('Entry saved.'));
success(__('Entry saved.'));
redirect(page_link_to('news'));
}
@ -269,13 +269,13 @@ function user_news()
if (in_array('admin_news', $privileges)) {
$html .= '<hr />';
$html .= '<h2>' . _('Create news:') . '</h2>';
$html .= '<h2>' . __('Create news:') . '</h2>';
$html .= form([
form_text('betreff', _('Subject'), ''),
form_textarea('text', _('Message'), ''),
form_checkbox('treffen', _('Meeting'), false, 1),
form_submit('submit', _('Save'))
form_text('betreff', __('Subject'), ''),
form_textarea('text', __('Message'), ''),
form_checkbox('treffen', __('Meeting'), false, 1),
form_submit('submit', __('Save'))
]);
}
return $html . '</div>';

@ -7,7 +7,7 @@ use Engelsystem\Database\DB;
*/
function questions_title()
{
return _('Ask the Heaven');
return __('Ask the Heaven');
}
/**
@ -50,11 +50,11 @@ function user_questions()
[$user['UID'], $question]
);
success(_('You question was saved.'));
success(__('You question was saved.'));
redirect(page_link_to('user_questions'));
} else {
return page_with_title(questions_title(), [
error(_('Please enter a question!'), true)
error(__('Please enter a question!'), true)
]);
}
break;
@ -62,7 +62,7 @@ function user_questions()
if ($request->has('id') && preg_match('/^\d{1,11}$/', $request->input('id'))) {
$question_id = $request->input('id');
} else {
return error(_('Incomplete call, missing Question ID.'), true);
return error(__('Incomplete call, missing Question ID.'), true);
}
$question = DB::selectOne(
@ -77,7 +77,7 @@ function user_questions()
redirect(page_link_to('user_questions'));
} else {
return page_with_title(questions_title(), [
error(_('No question found.'), true)
error(__('No question found.'), true)
]);
}
break;

@ -7,7 +7,7 @@ use Engelsystem\Database\DB;
*/
function settings_title()
{
return _('Settings');
return __('Settings');
}
/**
@ -28,11 +28,11 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes)
$user_source['email'] = $result->getValue();
if (!$result->isValid()) {
$valid = false;
error(_('E-mail address is not correct.'));
error(__('E-mail address is not correct.'));
}
} else {
$valid = false;
error(_('Please enter your e-mail.'));
error(__('Please enter your e-mail.'));
}
$user_source['email_shiftinfo'] = $request->has('email_shiftinfo');
@ -43,7 +43,7 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes)
$user_source['jabber'] = $result->getValue();
if (!$result->isValid()) {
$valid = false;
error(_('Please check your jabber account information.'));
error(__('Please check your jabber account information.'));
}
}
@ -59,7 +59,7 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes)
$user_source['planned_arrival_date'] = $result->getValue();
if (!$result->isValid()) {
$valid = false;
error(_('Please enter your planned date of arrival. It should be after the buildup start date and before teardown end date.'));
error(__('Please enter your planned date of arrival. It should be after the buildup start date and before teardown end date.'));
}
}
@ -69,7 +69,7 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes)
$user_source['planned_departure_date'] = $result->getValue();
if (!$result->isValid()) {
$valid = false;
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.'));
}
}
@ -82,7 +82,7 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes)
$user_source['DECT'] = strip_request_item('dect', $user_source['DECT']);
} else {
$valid = false;
error(_('For dect numbers are only 5 digits allowed.'));
error(__('For dect numbers are only 5 digits allowed.'));
}
$user_source['Handy'] = strip_request_item('mobile', $user_source['Handy']);
$user_source['Hometown'] = strip_request_item('hometown', $user_source['Hometown']);
@ -90,7 +90,7 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes)
if ($valid) {
User_update($user_source);
success(_('Settings saved.'));
success(__('Settings saved.'));
redirect(page_link_to('user_settings'));
}
@ -109,14 +109,14 @@ function user_settings_password($user_source)
!$request->has('password')
|| !verify_password($request->postData('password'), $user_source['Passwort'], $user_source['UID'])
) {
error(_('-> not OK. Please try again.'));
error(__('-> not OK. Please try again.'));
} elseif (strlen($request->postData('new_password')) < config('min_password_length')) {
error(_('Your password is to short (please use at least 6 characters).'));
error(__('Your password is to short (please use at least 6 characters).'));
} elseif ($request->postData('new_password') != $request->postData('new_password2')) {
error(_('Your passwords don\'t match.'));
error(__('Your passwords don\'t match.'));
} else {
set_password($user_source['UID'], $request->postData('new_password'));
success(_('Password saved.'));
success(__('Password saved.'));
}
redirect(page_link_to('user_settings'));
}
@ -151,7 +151,7 @@ function user_settings_theme($user_source, $themes)
]
);
success(_('Theme changed.'));
success(__('Theme changed.'));
redirect(page_link_to('user_settings'));
}
@ -224,12 +224,6 @@ function user_settings()
}
}
foreach ($tshirt_sizes as $key => $size) {
if (empty($size)) {
unset($tshirt_sizes[$key]);
}
}
$user_source = $user;
if ($request->has('submit')) {

@ -8,7 +8,7 @@ use Engelsystem\ShiftsFilter;
*/
function shifts_title()
{
return _('Shifts');
return __('Shifts');
}
/**
@ -99,7 +99,7 @@ function load_rooms()
'SELECT `RID` AS `id`, `Name` AS `name` FROM `Room` ORDER BY `Name`'
);
if (empty($rooms)) {
error(_('The administration has not configured any rooms yet.'));
error(__('The administration has not configured any rooms yet.'));
redirect(page_link_to('/'));
}
return $rooms;
@ -118,7 +118,7 @@ function load_days()
$days = array_map('array_shift', $days);
if (empty($days)) {
error(_('The administration has not configured any shifts yet.'));
error(__('The administration has not configured any shifts yet.'));
redirect(page_link_to('/'));
}
return $days;
@ -132,7 +132,7 @@ function load_types()
global $user;
if (!count(DB::select('SELECT `id`, `name` FROM `AngelTypes` WHERE `restricted` = 0'))) {
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(page_link_to('/'));
}
$types = DB::select('
@ -200,11 +200,11 @@ function view_user_shifts()
$filled = [
[
'id' => '1',
'name' => _('occupied')
'name' => __('occupied')
],
[
'id' => '0',
'name' => _('free')
'name' => __('free')
]
];
$start_day = date('Y-m-d', $shiftsFilter->getStartTime());
@ -226,7 +226,7 @@ function view_user_shifts()
msg(),
view(__DIR__ . '/../../resources/views/pages/user-shifts.html', [
'title' => shifts_title(),
'room_select' => make_select($rooms, $shiftsFilter->getRooms(), 'rooms', _('Rooms')),
'room_select' => make_select($rooms, $shiftsFilter->getRooms(), 'rooms', __('Rooms')),
'start_select' => html_select_key(
'start_day',
'start_day',
@ -245,34 +245,34 @@ function view_user_shifts()
$types,
$shiftsFilter->getTypes(),
'types',
_('Angeltypes') . '<sup>1</sup>',
__('Angeltypes') . '<sup>1</sup>',
[
button(
'javascript: checkOwnTypes(\'selection_types\', ' . json_encode($ownTypes) . ')',
_('Own')
__('Own')
),
]
),
'filled_select' => make_select($filled, $shiftsFilter->getFilled(), 'filled', _('Occupancy')),
'filled_select' => make_select($filled, $shiftsFilter->getFilled(), 'filled', __('Occupancy')),
'task_notice' =>
'<sup>1</sup>'
. _('The tasks shown here are influenced by the angeltypes you joined already!')
. __('The tasks shown here are influenced by the angeltypes you joined already!')
. ' <a href="' . page_link_to('angeltypes', ['action' => 'about']) . '">'
. _('Description of the jobs.')
. __('Description of the jobs.')
. '</a>',
'shifts_table' => msg() . $shiftCalendarRenderer->render(),
'ical_text' => ical_hint(),
'filter' => _('Filter'),
'set_yesterday' => _('Yesterday'),
'set_today' => _('Today'),
'set_tomorrow' => _('Tomorrow'),
'set_last_8h' => _('last 8h'),
'set_last_4h' => _('last 4h'),
'set_next_4h' => _('next 4h'),
'set_next_8h' => _('next 8h'),
'filter' => __('Filter'),
'set_yesterday' => __('Yesterday'),
'set_today' => __('Today'),
'set_tomorrow' => __('Tomorrow'),
'set_last_8h' => __('last 8h'),
'set_last_4h' => __('last 4h'),
'set_next_4h' => __('next 4h'),
'set_next_8h' => __('next 8h'),
'buttons' => button(
public_dashboard_link(),
glyph('dashboard') . _('Public Dashboard')
glyph('dashboard') . __('Public Dashboard')
)
])
])
@ -286,9 +286,9 @@ function ical_hint()
{
global $user;
return heading(_('iCal export'), 2)
return heading(__('iCal export'), 2)
. '<p>' . sprintf(
_('Export your own shifts. <a href="%s">iCal format</a> or <a href="%s">JSON format</a> available (please keep secret, otherwise <a href="%s">reset the api key</a>).'),
__('Export your own shifts. <a href="%s">iCal format</a> or <a href="%s">JSON format</a> available (please keep secret, otherwise <a href="%s">reset the api key</a>).'),
page_link_to('ical', ['key' => $user['api_key']]),
page_link_to('shifts_json_export', ['key' => $user['api_key']]),
page_link_to('user_myshifts', ['reset' => 1])
@ -321,8 +321,8 @@ function make_select($items, $selected, $name, $title = null, $additionalButtons
}
$buttons = [];
$buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', true)', _('All'));
$buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', false)', _('None'));
$buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', true)', __('All'));
$buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', false)', __('None'));
$buttons = array_merge($buttons, $additionalButtons);
$html .= buttons($buttons);

@ -367,11 +367,16 @@ function form_textarea($name, $label, $value, $disabled = false)
* @param string $label
* @param string[] $values
* @param string $selected
* @param string $selectText
* @return string
*/
function form_select($name, $label, $values, $selected)
function form_select($name, $label, $values, $selected, $selectText = '')
{
return form_element($label, html_select_key('form_' . $name, $name, $values, $selected), 'form_' . $name);
return form_element(
$label,
html_select_key('form_' . $name, $name, $values, $selected, $selectText),
'form_' . $name
);
}
/**
@ -425,11 +430,15 @@ function html_options($name, $options, $selected = '')
* @param string $name
* @param string[] $rows
* @param string $selected
* @param string $selectText
* @return string
*/
function html_select_key($dom_id, $name, $rows, $selected)
function html_select_key($dom_id, $name, $rows, $selected, $selectText = '')
{
$html = '<select class="form-control" id="' . $dom_id . '" name="' . $name . '">';
if (!empty($selectText)) {
$html .= '<option value="">' . $selectText . '</option>';
}
foreach ($rows as $key => $row) {
if (($key == $selected) || ($row === $selected)) {
$html .= '<option value="' . $key . '" selected="selected">' . $row . '</option>';

@ -189,7 +189,7 @@ function make_navigation()
}
if (count($admin_menu) > 0) {
$menu[] = toolbar_dropdown('', _('Admin'), $admin_menu);
$menu[] = toolbar_dropdown('', __('Admin'), $admin_menu);
}
return toolbar($menu);
@ -213,7 +213,7 @@ function make_room_navigation($menu)
$rooms = Rooms();
$room_menu = [];
if (in_array('admin_rooms', $privileges)) {
$room_menu[] = toolbar_item_link(page_link_to('admin_rooms'), 'list', _('Manage rooms'));
$room_menu[] = toolbar_item_link(page_link_to('admin_rooms'), 'list', __('Manage rooms'));
}
if (count($room_menu) > 0) {
$room_menu[] = toolbar_item_divider();
@ -222,7 +222,7 @@ function make_room_navigation($menu)
$room_menu[] = toolbar_item_link(room_link($room), 'map-marker', $room['Name']);
}
if (count($room_menu) > 0) {
$menu[] = toolbar_dropdown('map-marker', _('Rooms'), $room_menu);
$menu[] = toolbar_dropdown('map-marker', __('Rooms'), $room_menu);
}
return $menu;
}

@ -325,7 +325,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' : '') . '">';

@ -31,15 +31,15 @@ function AngelType_render_membership($user_angeltype)
if (!empty($user_angeltype['user_angeltype_id'])) {
if ($user_angeltype['restricted']) {
if (empty($user_angeltype['confirm_user_id'])) {
return glyph('lock') . _('Unconfirmed');
return glyph('lock') . __('Unconfirmed');
} elseif ($user_angeltype['supporter']) {
return glyph_bool(true) . _('Supporter');
return glyph_bool(true) . __('Supporter');
}
return glyph_bool(true) . _('Member');
return glyph_bool(true) . __('Member');
} elseif ($user_angeltype['supporter']) {
return glyph_bool(true) . _('Supporter');
return glyph_bool(true) . __('Supporter');
}
return glyph_bool(true) . _('Member');
return glyph_bool(true) . __('Member');
}
return glyph_bool(false);
}
@ -50,16 +50,16 @@ function AngelType_render_membership($user_angeltype)
*/
function AngelType_delete_view($angeltype)
{
return page_with_title(sprintf(_('Delete angeltype %s'), $angeltype['name']), [
info(sprintf(_('Do you want to delete angeltype %s?'), $angeltype['name']), true),
return page_with_title(sprintf(__('Delete angeltype %s'), $angeltype['name']), [
info(sprintf(__('Do you want to delete angeltype %s?'), $angeltype['name']), true),
buttons([
button(page_link_to('angeltypes'), glyph('remove') . _('cancel')),
button(page_link_to('angeltypes'), glyph('remove') . __('cancel')),
button(
page_link_to(
'angeltypes',
['action' => 'delete', 'angeltype_id' => $angeltype['id'], 'confirmed' => 1]
),
glyph('ok') . _('delete'),
glyph('ok') . __('delete'),
'btn-danger'
)
])
@ -75,48 +75,48 @@ function AngelType_delete_view($angeltype)
*/
function AngelType_edit_view($angeltype, $supporter_mode)
{
return page_with_title(sprintf(_('Edit %s'), $angeltype['name']), [
return page_with_title(sprintf(__('Edit %s'), $angeltype['name']), [
buttons([
button(page_link_to('angeltypes'), _('Angeltypes'), 'back')
button(page_link_to('angeltypes'), __('Angeltypes'), 'back')
]),
msg(),
form([
$supporter_mode
? form_info(_('Name'), $angeltype['name'])
: form_text('name', _('Name'), $angeltype['name']),
? form_info(__('Name'), $angeltype['name'])
: form_text('name', __('Name'), $angeltype['name']),
$supporter_mode
? form_info(_('Restricted'), $angeltype['restricted'] ? _('Yes') : _('No'))
: form_checkbox('restricted', _('Restricted'), $angeltype['restricted']),
? form_info(__('Restricted'), $angeltype['restricted'] ? __('Yes') : __('No'))
: form_checkbox('restricted', __('Restricted'), $angeltype['restricted']),
form_info(
'',
_('Restricted angel types can only be used by an angel if enabled by a supporter (double opt-in).')
__('Restricted angel types can only be used by an angel if enabled by a supporter (double opt-in).')
),
$supporter_mode
? form_info(_('No Self Sign Up'), $angeltype['no_self_signup'] ? _('Yes') : _('No'))
: form_checkbox('no_self_signup', _('No Self Sign Up'), $angeltype['no_self_signup']),
? form_info(__('No Self Sign Up'), $angeltype['no_self_signup'] ? __('Yes') : __('No'))
: form_checkbox('no_self_signup', __('No Self Sign Up'), $angeltype['no_self_signup']),
$supporter_mode
? form_info(_('Requires driver license'),
? form_info(__('Requires driver license'),
$angeltype['requires_driver_license']
? _('Yes')
: _('No'))
? __('Yes')
: __('No'))
: form_checkbox(
'requires_driver_license',
_('Requires driver license'),
__('Requires driver license'),
$angeltype['requires_driver_license']),
$supporter_mode
? form_info(_('Show on dashboard'), $angeltype['show_on_dashboard'] ? _('Yes') : _('No'))
: form_checkbox('show_on_dashboard', _('Show on dashboard'), $angeltype['show_on_dashboard']),
form_textarea('description', _('Description'), $angeltype['description']),
form_info('', _('Please use markdown for the description.')),
heading(_('Contact'), 3),
? form_info(__('Show on dashboard'), $angeltype['show_on_dashboard'] ? __('Yes') : __('No'))
: form_checkbox('show_on_dashboard', __('Show on dashboard'), $angeltype['show_on_dashboard']),
form_textarea('description', __('Description'), $angeltype['description']),
form_info('', __('Please use markdown for the description.')),
heading(__('Contact'), 3),
form_info(
'',
_('Primary contact person/desk for user questions.')
__('Primary contact person/desk for user questions.')
),
form_text('contact_name', _('Name'), $angeltype['contact_name']),
form_text('contact_dect', _('DECT'), $angeltype['contact_dect']),
form_text('contact_email', _('E-Mail'), $angeltype['contact_email']),
form_submit('submit', _('Save'))
form_text('contact_name', __('Name'), $angeltype['contact_name']),
form_text('contact_dect', __('DECT'), $angeltype['contact_dect']),
form_text('contact_email', __('E-Mail'), $angeltype['contact_email']),
form_submit('submit', __('Save'))
])
]);
}
@ -135,50 +135,50 @@ function AngelType_edit_view($angeltype, $supporter_mode)
function AngelType_view_buttons($angeltype, $user_angeltype, $admin_angeltypes, $supporter, $user_driver_license, $user)
{
$buttons = [
button(page_link_to('angeltypes'), _('Angeltypes'), 'back')
button(page_link_to('angeltypes'), __('Angeltypes'), 'back')
];
if ($angeltype['requires_driver_license']) {
$buttons[] = button(
user_driver_license_edit_link($user),
glyph('road') . _('my driving license')
glyph('road') . __('my driving license')
);
}
if (is_null($user_angeltype)) {
$buttons[] = button(
page_link_to('user_angeltypes', ['action' => 'add', 'angeltype_id' => $angeltype['id']]),
_('join'),
__('join'),
'add'
);
} else {
if ($angeltype['requires_driver_license'] && empty($user_driver_license)) {
error(_('This angeltype requires a driver license. Please enter your driver license information!'));
error(__('This angeltype requires a driver license. Please enter your driver license information!'));
}
if ($angeltype['restricted'] && empty($user_angeltype['confirm_user_id'])) {
error(sprintf(
_('You are unconfirmed for this angeltype. Please go to the introduction for %s to get confirmed.'),
__('You are unconfirmed for this angeltype. Please go to the introduction for %s to get confirmed.'),
$angeltype['name']
));
}
$buttons[] = button(
page_link_to('user_angeltypes', ['action' => 'delete', 'user_angeltype_id' => $user_angeltype['id']]),
_('leave')
__('leave')
);
}
if ($admin_angeltypes || $supporter) {
$buttons[] = button(
page_link_to('angeltypes', ['action' => 'edit', 'angeltype_id' => $angeltype['id']]),
_('edit'),
__('edit'),
'edit'
);
}
if ($admin_angeltypes) {
$buttons[] = button(
page_link_to('angeltypes', ['action' => 'delete', 'angeltype_id' => $angeltype['id']]),
_('delete'),
__('delete'),
'delete'
);
}
@ -219,7 +219,7 @@ function AngelType_view_members($angeltype, $members, $admin_user_angeltypes, $a
'user_angeltypes',
['action' => 'confirm', 'user_angeltype_id' => $member['user_angeltype_id']]
),
_('confirm'),
__('confirm'),
'btn-xs'
),
button(
@ -227,7 +227,7 @@ function AngelType_view_members($angeltype, $members, $admin_user_angeltypes, $a
'user_angeltypes',
['action' => 'delete', 'user_angeltype_id' => $member['user_angeltype_id']]
),
_('deny'),
__('deny'),
'btn-xs'
)
]);
@ -241,7 +241,7 @@ function AngelType_view_members($angeltype, $members, $admin_user_angeltypes, $a
'user_angeltype_id' => $member['user_angeltype_id'],
'supporter' => 0
]),
_('Remove supporter rights'),
__('Remove supporter rights'),
'btn-xs'
)
]);
@ -258,14 +258,14 @@ function AngelType_view_members($angeltype, $members, $admin_user_angeltypes, $a
'user_angeltype_id' => $member['user_angeltype_id'],
'supporter' => 1
]),
_('Add supporter rights'), 'btn-xs')
__('Add supporter rights'), 'btn-xs')
: '',
button(
page_link_to('user_angeltypes', [
'action' => 'delete',
'user_angeltype_id' => $member['user_angeltype_id']
]),
_('remove'),
__('remove'),
'btn-xs'
)
]);
@ -293,21 +293,21 @@ function AngelType_view_table_headers($angeltype, $supporter, $admin_angeltypes)
{
if ($angeltype['requires_driver_license'] && ($supporter || $admin_angeltypes)) {
return [
'Nick' => _('Nick'),
'DECT' => _('DECT'),
'wants_to_drive' => _('Driver'),
'has_car' => _('Has car'),
'has_license_car' => _('Car'),
'has_license_3_5t_transporter' => _('3,5t Transporter'),
'has_license_7_5t_truck' => _('7,5t Truck'),
'has_license_12_5t_truck' => _('12,5t Truck'),
'has_license_forklift' => _('Forklift'),
'Nick' => __('Nick'),
'DECT' => __('DECT'),
'wants_to_drive' => __('Driver'),
'has_car' => __('Has car'),
'has_license_car' => __('Car'),
'has_license_3_5t_transporter' => __('3,5t Transporter'),
'has_license_7_5t_truck' => __('7,5t Truck'),
'has_license_12_5t_truck' => __('12,5t Truck'),
'has_license_forklift' => __('Forklift'),
'actions' => ''
];
}
return [
'Nick' => _('Nick'),
'DECT' => _('DECT'),
'Nick' => __('Nick'),
'DECT' => __('DECT'),
'actions' => ''
];
}
@ -341,18 +341,18 @@ function AngelType_view(
ShiftCalendarRenderer $shiftCalendarRenderer,
$tab
) {
return page_with_title(sprintf(_('Team %s'), $angeltype['name']), [
return page_with_title(sprintf(__('Team %s'), $angeltype['name']), [
AngelType_view_buttons($angeltype, $user_angeltype, $admin_angeltypes, $supporter, $user_driver_license, $user),
msg(),
tabs([
_('Info') => AngelType_view_info(
__('Info') => AngelType_view_info(
$angeltype,
$members,
$admin_user_angeltypes,
$admin_angeltypes,
$supporter
),
_('Shifts') => AngelType_view_shifts(
__('Shifts') => AngelType_view_shifts(
$angeltype,
$shiftsFilterRenderer,
$shiftCalendarRenderer
@ -398,7 +398,7 @@ function AngelType_view_info(
$info[] = AngelTypes_render_contact_info($angeltype);
}
$info[] = '<h3>' . _('Description') . '</h3>';
$info[] = '<h3>' . __('Description') . '</h3>';
$parsedown = new Parsedown();
if ($angeltype['description'] != '') {
$info[] = '<div class="well">' . $parsedown->parse($angeltype['description']) . '</div>';
@ -413,13 +413,13 @@ function AngelType_view_info(
$table_headers = AngelType_view_table_headers($angeltype, $supporter, $admin_angeltypes);
if (count($supporters) > 0) {
$info[] = '<h3>' . _('Supporters') . '</h3>';
$info[] = '<h3>' . __('Supporters') . '</h3>';
$info[] = table($table_headers, $supporters);
}
if (count($members_confirmed) > 0) {
$members_confirmed[] = [
'Nick' => _('Sum'),
'Nick' => __('Sum'),
'DECT' => count($members_confirmed),
'actions' => ''
];
@ -427,13 +427,13 @@ function AngelType_view_info(
if (count($members_unconfirmed) > 0) {
$members_unconfirmed[] = [
'Nick' => _('Sum'),
'Nick' => __('Sum'),
'DECT' => count($members_unconfirmed),
'actions' => ''
];
}
$info[] = '<h3>' . _('Members') . '</h3>';
$info[] = '<h3>' . __('Members') . '</h3>';
if ($admin_user_angeltypes) {
$info[] = buttons([
button(
@ -441,7 +441,7 @@ function AngelType_view_info(
'user_angeltypes',
['action' => 'add', 'angeltype_id' => $angeltype['id']]
),
_('Add'),
__('Add'),
'add'
)
]);
@ -449,15 +449,15 @@ function AngelType_view_info(
$info[] = table($table_headers, $members_confirmed);
if ($admin_user_angeltypes && $angeltype['restricted'] && count($members_unconfirmed) > 0) {
$info[] = '<h3>' . _('Unconfirmed') . '</h3>';
$info[] = '<h3>' . __('Unconfirmed') . '</h3>';
$info[] = buttons([
button(
page_link_to('user_angeltypes', ['action' => 'confirm_all', 'angeltype_id' => $angeltype['id']]),
glyph('ok') . _('confirm all')
glyph('ok') . __('confirm all')
),
button(
page_link_to('user_angeltypes', ['action' => 'delete_all', 'angeltype_id' => $angeltype['id']]),
glyph('remove') . _('deny all')
glyph('remove') . __('deny all')
)
]);
$info[] = table($table_headers, $members_unconfirmed);
@ -474,10 +474,10 @@ function AngelType_view_info(
*/
function AngelTypes_render_contact_info($angeltype)
{
return heading(_('Contact'), 3) . description([
_('Name') => $angeltype['contact_name'],
_('DECT') => $angeltype['contact_dect'],
_('E-Mail') => $angeltype['contact_email']
return heading(__('Contact'), 3) . description([
__('Name') => $angeltype['contact_name'],
__('DECT') => $angeltype['contact_dect'],
__('E-Mail') => $angeltype['contact_email']
]);
}
@ -494,15 +494,15 @@ function AngelTypes_list_view($angeltypes, $admin_angeltypes)
msg(),
buttons([
$admin_angeltypes
? button(page_link_to('angeltypes', ['action' => 'edit']), _('New angeltype'), 'add')
? button(page_link_to('angeltypes', ['action' => 'edit']), __('New angeltype'), 'add')
: '',
button(page_link_to('angeltypes', ['action' => 'about']), _('Teams/Job description'))
button(page_link_to('angeltypes', ['action' => 'about']), __('Teams/Job description'))
]),
table([
'name' => _('Name'),
'restricted' => glyph('lock') . _('Restricted'),
'no_self_signup' => glyph('share') . _('Self Sign Up Allowed'),
'membership' => _('Membership'),
'name' => __('Name'),
'restricted' => glyph('lock') . __('Restricted'),
'no_self_signup' => glyph('share') . __('Self Sign Up Allowed'),
'membership' => __('Membership'),
'actions' => ''
], $angeltypes)
]);
@ -532,12 +532,12 @@ function AngelTypes_about_view_angeltype($angeltype)
'user_angeltypes',
['action' => 'delete', 'user_angeltype_id' => $angeltype['user_angeltype_id']]
),
_('leave')
__('leave')
);
} else {
$buttons[] = button(
page_link_to('user_angeltypes', ['action' => 'add', 'angeltype_id' => $angeltype['id']]),
_('join'),
__('join'),
'add'
);
}
@ -546,7 +546,7 @@ function AngelTypes_about_view_angeltype($angeltype)
if ($angeltype['restricted']) {
$html .= info(
_('This angeltype is restricted by double-opt-in by a team supporter. Please show up at the according introduction meetings.'),
__('This angeltype is restricted by double-opt-in by a team supporter. Please show up at the according introduction meetings.'),
true
);
}
@ -583,17 +583,17 @@ function AngelTypes_about_view($angeltypes, $user_logged_in)
$faqUrl = config('faq_url');
if (!empty($faqUrl)) {
$buttons[] = button($faqUrl, _('FAQ'), 'btn-primary');
$buttons[] = button($faqUrl, __('FAQ'), 'btn-primary');
}
$content = [
buttons($buttons),
'<p>' . _('Here is the list of teams and their tasks. If you have questions, read the FAQ.') . '</p>',
'<p>' . __('Here is the list of teams and their tasks. If you have questions, read the FAQ.') . '</p>',
'<hr />'
];
foreach ($angeltypes as $angeltype) {
$content[] = AngelTypes_about_view_angeltype($angeltype);
}
return page_with_title(_('Teams/Job description'), $content);
return page_with_title(__('Teams/Job description'), $content);
}

@ -10,7 +10,7 @@ function EventConfig_countdown_page($event_config)
{
if (empty($event_config)) {
return div('col-md-12 text-center', [
heading(sprintf(_('Welcome to the %s!'), '<span class="icon-icon_angel"></span> ENGELSYSTEM'), 2)
heading(sprintf(__('Welcome to the %s!'), '<span class="icon-icon_angel"></span> ENGELSYSTEM'), 2)
]);
}
@ -19,7 +19,7 @@ function EventConfig_countdown_page($event_config)
if (!is_null($event_config['event_name'])) {
$elements[] = div('col-sm-12 text-center', [
heading(sprintf(
_('Welcome to the %s!'),
__('Welcome to the %s!'),
$event_config['event_name'] . ' <span class="icon-icon_angel"></span> ENGELSYSTEM'
), 2)
]);
@ -27,33 +27,33 @@ function EventConfig_countdown_page($event_config)
if (!is_null($event_config['buildup_start_date']) && time() < $event_config['buildup_start_date']) {
$elements[] = div('col-sm-3 text-center hidden-xs', [
heading(_('Buildup starts'), 4),
heading(__('Buildup starts'), 4),
'<span class="moment-countdown text-big" data-timestamp="' . $event_config['buildup_start_date'] . '">%c</span>',
'<small>' . date(_('Y-m-d'), $event_config['buildup_start_date']) . '</small>'
'<small>' . date(__('Y-m-d'), $event_config['buildup_start_date']) . '</small>'
]);
}
if (!is_null($event_config['event_start_date']) && time() < $event_config['event_start_date']) {
$elements[] = div('col-sm-3 text-center hidden-xs', [
heading(_('Event starts'), 4),
heading(__('Event starts'), 4),
'<span class="moment-countdown text-big" data-timestamp="' . $event_config['event_start_date'] . '">%c</span>',
'<small>' . date(_('Y-m-d'), $event_config['event_start_date']) . '</small>'
'<small>' . date(__('Y-m-d'), $event_config['event_start_date']) . '</small>'
]);
}
if (!is_null($event_config['event_end_date']) && time() < $event_config['event_end_date']) {
$elements[] = div('col-sm-3 text-center hidden-xs', [
heading(_('Event ends'), 4),
heading(__('Event ends'), 4),
'<span class="moment-countdown text-big" data-timestamp="' . $event_config['event_end_date'] . '">%c</span>',
'<small>' . date(_('Y-m-d'), $event_config['event_end_date']) . '</small>'
'<small>' . date(__('Y-m-d'), $event_config['event_end_date']) . '</small>'
]);
}
if (!is_null($event_config['teardown_end_date']) && time() < $event_config['teardown_end_date']) {
$elements[] = div('col-sm-3 text-center hidden-xs', [
heading(_('Teardown ends'), 4),
heading(__('Teardown ends'), 4),
'<span class="moment-countdown text-big" data-timestamp="' . $event_config['teardown_end_date'] . '">%c</span>',
'<small>' . date(_('Y-m-d'), $event_config['teardown_end_date']) . '</small>'
'<small>' . date(__('Y-m-d'), $event_config['teardown_end_date']) . '</small>'
]);
}
@ -79,27 +79,27 @@ function EventConfig_info($event_config)
&& !is_null($event_config['event_end_date'])
) {
return sprintf(
_('%s, from %s to %s'),
__('%s, from %s to %s'),
$event_config['event_name'],
date(_('Y-m-d'), $event_config['event_start_date']),
date(_('Y-m-d'), $event_config['event_end_date'])
date(__('Y-m-d'), $event_config['event_start_date']),
date(__('Y-m-d'), $event_config['event_end_date'])
);
}
// Event name, start date are set
if (!is_null($event_config['event_name']) && !is_null($event_config['event_start_date'])) {
return sprintf(
_('%s, starting %s'), $event_config['event_name'],
date(_('Y-m-d'), $event_config['event_start_date'])
__('%s, starting %s'), $event_config['event_name'],
date(__('Y-m-d'), $event_config['event_start_date'])
);
}
// Event start+end date are set
if (!is_null($event_config['event_start_date']) && !is_null($event_config['event_end_date'])) {
return sprintf(
_('Event from %s to %s'),
date(_('Y-m-d'), $event_config['event_start_date']),
date(_('Y-m-d'), $event_config['event_end_date'])
__('Event from %s to %s'),
date(__('Y-m-d'), $event_config['event_start_date']),
date(__('Y-m-d'), $event_config['event_end_date'])
);
}
@ -135,26 +135,26 @@ function EventConfig_edit_view(
form([
div('row', [
div('col-md-6', [
form_text('event_name', _('Event Name'), $event_name),
form_info('', _('Event Name is shown on the start page.')),
form_textarea('event_welcome_msg', _('Event Welcome Message'), $event_welcome_msg),
form_text('event_name', __('Event Name'), $event_name),
form_info('', __('Event Name is shown on the start page.')),
form_textarea('event_welcome_msg', __('Event Welcome Message'), $event_welcome_msg),
form_info(
'',
_('Welcome message is shown after successful registration. You can use markdown.')
__('Welcome message is shown after successful registration. You can use markdown.')
)
]),
div('col-md-3 col-xs-6', [
form_date('buildup_start_date', _('Buildup date'), $buildup_start_date),
form_date('event_start_date', _('Event start date'), $event_start_date)
form_date('buildup_start_date', __('Buildup date'), $buildup_start_date),
form_date('event_start_date', __('Event start date'), $event_start_date)
]),
div('col-md-3 col-xs-6', [
form_date('teardown_end_date', _('Teardown end date'), $teardown_end_date),
form_date('event_end_date', _('Event end date'), $event_end_date)
form_date('teardown_end_date', __('Teardown end date'), $teardown_end_date),
form_date('event_end_date', __('Event end date'), $event_end_date)
])
]),
div('row', [
div('col-md-6', [
form_submit('submit', _('Save'))
form_submit('submit', __('Save'))
])
])
])

@ -23,7 +23,7 @@ function public_dashboard_view($stats, $free_shifts)
$shift_panels[] = '</div>';
$needed_angels = div('first', [
div('col-md-12', [
heading(_('Needed angels:'), 1)
heading(__('Needed angels:'), 1)
]),
div('container-fluid', [
join($shift_panels)
@ -34,10 +34,10 @@ function public_dashboard_view($stats, $free_shifts)
return page([
div('public-dashboard', [
div('first', [
stats(_('Angels needed in the next 3 hrs'), $stats['needed-3-hours']),
stats(_('Angels needed for nightshifts'), $stats['needed-night']),
stats(_('Angels currently working'), $stats['angels-working'], 'default'),
stats(_('Hours to be worked'), $stats['hours-to-work'], 'default'),
stats(__('Angels needed in the next 3 hrs'), $stats['needed-3-hours']),
stats(__('Angels needed for nightshifts'), $stats['needed-night']),
stats(__('Angels currently working'), $stats['angels-working'], 'default'),
stats(__('Hours to be worked'), $stats['hours-to-work'], 'default'),
'<script>
$(function() {
setInterval(function() {
@ -52,8 +52,8 @@ function public_dashboard_view($stats, $free_shifts)
buttons([
button_js('
$(\'#navbar-collapse-1,#footer,#fullscreen-button\').remove();
$(\'.navbar-brand\').append(\' ' . _('Public Dashboard') . '\');
', glyph('fullscreen') . _('Fullscreen'))
$(\'.navbar-brand\').append(\' ' . __('Public Dashboard') . '\');
', glyph('fullscreen') . __('Fullscreen'))
])
], 'fullscreen-button')
]);

@ -12,7 +12,7 @@ function Questions_view($open_questions, $answered_questions, $ask_action)
$question['actions'] = '<a href="'
. page_link_to('user_questions', ['action' => 'delete', 'id' => $question['QID']])
. '">'
. _('delete')
. __('delete')
. '</a>';
$question['Question'] = str_replace("\n", '<br />', $question['Question']);
}
@ -23,28 +23,28 @@ function Questions_view($open_questions, $answered_questions, $ask_action)
$question['actions'] = '<a href="'
. page_link_to('user_questions', ['action' => 'delete', 'id' => $question['QID']])
. '">'
. _('delete')
. __('delete')
. '</a>';
}
return page_with_title(questions_title(), [
msg(),
heading(_('Open questions'), 2),
heading(__('Open questions'), 2),
table([
'Question' => _('Question'),
'Question' => __('Question'),
'actions' => ''
], $open_questions),
heading(_('Answered questions'), 2),
heading(__('Answered questions'), 2),
table([
'Question' => _('Question'),
'answer_user' => _('Answered by'),
'Answer' => _('Answer'),
'Question' => __('Question'),
'answer_user' => __('Answered by'),
'Answer' => __('Answer'),
'actions' => ''
], $answered_questions),
heading(_('Ask the Heaven'), 2),
heading(__('Ask the Heaven'), 2),
form([
form_textarea('question', _('Your Question:'), ''),
form_submit('submit', _('Save'))
form_textarea('question', __('Your Question:'), ''),
form_submit('submit', __('Save'))
], $ask_action)
]);
}

@ -21,14 +21,14 @@ function Room_view($room, ShiftsFilterRenderer $shiftsFilterRenderer, ShiftCalen
$description = '';
if (!empty($room['description'])) {
$description = '<h3>' . _('Description') . '</h3>';
$description = '<h3>' . __('Description') . '</h3>';
$parsedown = new Parsedown();
$description .= '<div class="well">' . $parsedown->parse($room['description']) . '</div>';
}
$tabs = [];
if (!empty($room['map_url'])) {
$tabs[_('Map')] = sprintf(
$tabs[__('Map')] = sprintf(
'<div class="map">'
. '<iframe style="width: 100%%; min-height: 400px; border: 0 none;" src="%s"></iframe>'
. '</div>',
@ -36,7 +36,7 @@ function Room_view($room, ShiftsFilterRenderer $shiftsFilterRenderer, ShiftCalen
);
}
$tabs[_('Shifts')] = div('first', [
$tabs[__('Shifts')] = div('first', [
$shiftsFilterRenderer->render(page_link_to('rooms', [
'action' => 'view',
'room_id' => $room['RID']

@ -143,7 +143,7 @@ class ShiftCalendarRenderer
public function render()
{
if (count($this->lanes) == 0) {
return info(_('No shifts found.'), true);
return info(__('No shifts found.'), true);
}
return div('shift-calendar', [
$this->renderTimeLane(),
@ -245,7 +245,7 @@ class ShiftCalendarRenderer
{
$time_slot = [
div('header', [
_('Time')
__('Time')
])
];
for ($block = 0; $block < $this->getBlocksPerSlot(); $block++) {
@ -311,11 +311,11 @@ class ShiftCalendarRenderer
private function renderLegend()
{
return div('legend', [
label(_('Your shift'), 'primary'),
label(_('Help needed'), 'danger'),
label(_('Other angeltype needed / collides with my shifts'), 'warning'),
label(_('Shift is full'), 'success'),
label(_('Shift running/ended or user not arrived'), 'default')
label(__('Your shift'), 'primary'),
label(__('Help needed'), 'danger'),
label(__('Other angeltype needed / collides with my shifts'), 'warning'),
label(__('Shift is full'), 'success'),
label(__('Shift running/ended or user not arrived'), 'default')
]);
}
}

@ -131,7 +131,7 @@ class ShiftCalendarShiftRenderer
if (in_array('user_shifts_admin', $privileges)) {
$html .= '<li class="list-group-item">';
$html .= button(shift_entry_create_link_admin($shift),
glyph('plus') . _('Add more angels'),
glyph('plus') . __('Add more angels'),
'btn-xs'
);
$html .= '</li>';
@ -191,18 +191,18 @@ class ShiftCalendarShiftRenderer
. '</a> '
. button(
shift_entry_create_link($shift, $angeltype),
_('Sign up'), 'btn-xs btn-primary'
__('Sign up'), 'btn-xs btn-primary'
);
break;
case ShiftSignupState::SHIFT_ENDED:
// No link and add a text hint, when the shift ended
$entry_list[] = $inner_text . ' (' . _('ended') . ')';
$entry_list[] = $inner_text . ' (' . __('ended') . ')';
break;
case ShiftSignupState::NOT_ARRIVED:
// No link and add a text hint, when the shift ended
$entry_list[] = $inner_text . ' (' . _('please arrive for signup') . ')';
$entry_list[] = $inner_text . ' (' . __('please arrive for signup') . ')';
break;
case ShiftSignupState::ANGELTYPE:
@ -217,7 +217,7 @@ class ShiftCalendarShiftRenderer
'user_angeltypes',
['action' => 'add', 'angeltype_id' => $angeltype['id']]
),
sprintf(_('Become %s'), $angeltype['name']),
sprintf(__('Become %s'), $angeltype['name']),
'btn-xs'
);
}

@ -14,7 +14,7 @@ function ShiftEntry_delete_view_admin($shiftEntry, $shift, $angeltype, $signoff_
{
return page_with_title(ShiftEntry_delete_title(), [
info(sprintf(
_('Do you want to sign off %s from shift %s from %s to %s as %s?'),
__('Do you want to sign off %s from shift %s from %s to %s as %s?'),
User_Nick_render($signoff_user),
$shift['name'],
date('Y-m-d H:i', $shift['start']),
@ -22,10 +22,10 @@ function ShiftEntry_delete_view_admin($shiftEntry, $shift, $angeltype, $signoff_
$angeltype['name']
), true),
buttons([
button(user_link($signoff_user), glyph('remove') . _('cancel')),
button(user_link($signoff_user), glyph('remove') . __('cancel')),
button(shift_entry_delete_link($shiftEntry, [
'continue' => 1
]), glyph('ok') . _('delete'), 'btn-danger')
]), glyph('ok') . __('delete'), 'btn-danger')
])
]);
}
@ -44,17 +44,17 @@ function ShiftEntry_delete_view($shiftEntry, $shift, $angeltype, $signoff_user)
{
return page_with_title(ShiftEntry_delete_title(), [
info(sprintf(
_('Do you want to sign off from your shift %s from %s to %s as %s?'),
__('Do you want to sign off from your shift %s from %s to %s as %s?'),
$shift['name'],
date('Y-m-d H:i', $shift['start']),
date('Y-m-d H:i', $shift['end']),
$angeltype['name']
), true),
buttons([
button(user_link($signoff_user), glyph('remove') . _('cancel')),
button(user_link($signoff_user), glyph('remove') . __('cancel')),
button(shift_entry_delete_link($shiftEntry, [
'continue' => 1
]), glyph('ok') . _('delete'), 'btn-danger')
]), glyph('ok') . __('delete'), 'btn-danger')
])
]);
}
@ -64,7 +64,7 @@ function ShiftEntry_delete_view($shiftEntry, $shift, $angeltype, $signoff_user)
*/
function ShiftEntry_delete_title()
{
return _('Shift sign off');
return __('Shift sign off');
}
/**
@ -85,11 +85,11 @@ function ShiftEntry_create_view_admin($shift, $room, $angeltype, $angeltypes_sel
. ' <small class="moment-countdown" data-timestamp="' . $shift['start'] . '">%c</small>',
[
Shift_view_header($shift, $room),
info(_('Do you want to sign up the following user for this shift?'), true),
info(__('Do you want to sign up the following user for this shift?'), true),
form([
form_select('angeltype_id', _('Angeltype'), $angeltypes_select, $angeltype['id']),
form_select('user_id', _('User'), $users_select, $signup_user['UID']),
form_submit('submit', glyph('ok') . _('Save'))
form_select('angeltype_id', __('Angeltype'), $angeltypes_select, $angeltype['id']),
form_select('user_id', __('User'), $users_select, $signup_user['UID']),
form_submit('submit', glyph('ok') . __('Save'))
])
]);
}
@ -110,11 +110,11 @@ function ShiftEntry_create_view_supporter($shift, $room, $angeltype, $signup_use
. ' <small class="moment-countdown" data-timestamp="' . $shift['start'] . '">%c</small>',
[
Shift_view_header($shift, $room),
info(sprintf(_('Do you want to sign up the following user for this shift as %s?'),
info(sprintf(__('Do you want to sign up the following user for this shift as %s?'),
AngelType_name_render($angeltype)), true),
form([
form_select('user_id', _('User'), $users_select, $signup_user['UID']),
form_submit('submit', glyph('ok') . _('Save'))
form_select('user_id', __('User'), $users_select, $signup_user['UID']),
form_submit('submit', glyph('ok') . __('Save'))
])
]);
}
@ -134,10 +134,10 @@ function ShiftEntry_create_view_user($shift, $room, $angeltype, $comment)
. ' <small class="moment-countdown" data-timestamp="' . $shift['start'] . '">%c</small>',
[
Shift_view_header($shift, $room),
info(sprintf(_('Do you want to sign up for this shift as %s?'), AngelType_name_render($angeltype)), true),
info(sprintf(__('Do you want to sign up for this shift as %s?'), AngelType_name_render($angeltype)), true),
form([
form_textarea('comment', _('Comment (for your eyes only):'), $comment),
form_submit('submit', glyph('ok') . _('Save'))
form_textarea('comment', __('Comment (for your eyes only):'), $comment),
form_submit('submit', glyph('ok') . __('Save'))
])
]);
}
@ -147,7 +147,7 @@ function ShiftEntry_create_view_user($shift, $room, $angeltype, $comment)
*/
function ShiftEntry_create_title()
{
return _('Shift signup');
return __('Shift signup');
}
/**
@ -178,25 +178,25 @@ function ShiftEntry_edit_view(
$freeload_form = [];
if ($user_admin_shifts) {
$freeload_form = [
form_checkbox('freeloaded', _('Freeloaded'), $freeloaded),
form_checkbox('freeloaded', __('Freeloaded'), $freeloaded),
form_textarea(
'freeload_comment',
_('Freeload comment (Only for shift coordination):'),
__('Freeload comment (Only for shift coordination):'),
$freeload_comment
)
];
}
return page_with_title(_('Edit shift entry'), [
return page_with_title(__('Edit shift entry'), [
msg(),
form([
form_info(_('Angel:'), $angel),
form_info(_('Date, Duration:'), $date),
form_info(_('Location:'), $location),
form_info(_('Title:'), $title),
form_info(_('Type:'), $type),
form_textarea('comment', _('Comment (for your eyes only):'), $comment),
form_info(__('Angel:'), $angel),
form_info(__('Date, Duration:'), $date),
form_info(__('Location:'), $location),
form_info(__('Title:'), $title),
form_info(__('Type:'), $type),
form_textarea('comment', __('Comment (for your eyes only):'), $comment),
join('', $freeload_form),
form_submit('submit', _('Save'))
form_submit('submit', __('Save'))
])
]);
}

@ -19,16 +19,16 @@ function ShiftType_name_render($shifttype)
*/
function ShiftType_delete_view($shifttype)
{
return page_with_title(sprintf(_('Delete shifttype %s'), $shifttype['name']), [
info(sprintf(_('Do you want to delete shifttype %s?'), $shifttype['name']), true),
return page_with_title(sprintf(__('Delete shifttype %s'), $shifttype['name']), [
info(sprintf(__('Do you want to delete shifttype %s?'), $shifttype['name']), true),
buttons([
button(page_link_to('shifttypes'), glyph('remove') . _('cancel')),
button(page_link_to('shifttypes'), glyph('remove') . __('cancel')),
button(
page_link_to(
'shifttypes',
['action' => 'delete', 'shifttype_id' => $shifttype['id'], 'confirmed' => 1]
),
glyph('ok') . _('delete'),
glyph('ok') . __('delete'),
'btn-danger'
)
])
@ -46,23 +46,23 @@ function ShiftType_delete_view($shifttype)
function ShiftType_edit_view($name, $angeltype_id, $angeltypes, $description, $shifttype_id)
{
$angeltypes_select = [
'' => _('All')
'' => __('All')
];
foreach ($angeltypes as $angeltype) {
$angeltypes_select[$angeltype['id']] = $angeltype['name'];
}
return page_with_title($shifttype_id ? _('Edit shifttype') : _('Create shifttype'), [
return page_with_title($shifttype_id ? __('Edit shifttype') : __('Create shifttype'), [
msg(),
buttons([
button(page_link_to('shifttypes'), shifttypes_title(), 'back')
]),
form([
form_text('name', _('Name'), $name),
form_select('angeltype_id', _('Angeltype'), $angeltypes_select, $angeltype_id),
form_textarea('description', _('Description'), $description),
form_info('', _('Please use markdown for the description.')),
form_submit('submit', _('Save'))
form_text('name', __('Name'), $name),
form_select('angeltype_id', __('Angeltype'), $angeltypes_select, $angeltype_id),
form_textarea('description', __('Description'), $description),
form_info('', __('Please use markdown for the description.')),
form_submit('submit', __('Save'))
])
]);
}
@ -77,7 +77,7 @@ function ShiftType_view($shifttype, $angeltype)
$parsedown = new Parsedown();
$title = $shifttype['name'];
if ($angeltype) {
$title .= ' <small>' . sprintf(_('for team %s'), $angeltype['name']) . '</small>';
$title .= ' <small>' . sprintf(__('for team %s'), $angeltype['name']) . '</small>';
}
return page_with_title($title, [
msg(),
@ -89,16 +89,16 @@ function ShiftType_view($shifttype, $angeltype)
) : '',
button(
page_link_to('shifttypes', ['action' => 'edit', 'shifttype_id' => $shifttype['id']]),
_('edit'),
__('edit'),
'edit'
),
button(
page_link_to('shifttypes', ['action' => 'delete', 'shifttype_id' => $shifttype['id']]),
_('delete'),
__('delete'),
'delete'
)
]),
heading(_('Description'), 2),
heading(__('Description'), 2),
$parsedown->parse($shifttype['description'])
]);
}
@ -121,12 +121,12 @@ function ShiftTypes_list_view($shifttypes)
'shifttypes',
['action' => 'edit', 'shifttype_id' => $shifttype['id']]
),
_('edit'),
__('edit'),
'btn-xs'
),
button(
page_link_to('shifttypes', ['action' => 'delete', 'shifttype_id' => $shifttype['id']]),
_('delete'),
__('delete'),
'btn-xs'
)
]);
@ -135,10 +135,10 @@ function ShiftTypes_list_view($shifttypes)
return page_with_title(shifttypes_title(), [
msg(),
buttons([
button(page_link_to('shifttypes', ['action' => 'edit']), _('New shifttype'), 'add')
button(page_link_to('shifttypes', ['action' => 'edit']), __('New shifttype'), 'add')
]),
table([
'name' => _('Name'),
'name' => __('Name'),
'actions' => ''
], $shifttypes)
]);

@ -13,7 +13,7 @@ function Shift_view_header($shift, $room)
{
return div('row', [
div('col-sm-3 col-xs-6', [
'<h4>' . _('Title') . '</h4>',
'<h4>' . __('Title') . '</h4>',
'<p class="lead">'
. ($shift['URL'] != ''
? '<a href="' . $shift['URL'] . '">' . $shift['title'] . '</a>'
@ -21,23 +21,23 @@ function Shift_view_header($shift, $room)
. '</p>'
]),
div('col-sm-3 col-xs-6', [
'<h4>' . _('Start') . '</h4>',
'<h4>' . __('Start') . '</h4>',
'<p class="lead' . (time() >= $shift['start'] ? ' text-success' : '') . '">',
glyph('calendar') . date(_('Y-m-d'), $shift['start']),
glyph('calendar') . date(__('Y-m-d'), $shift['start']),
'<br />',
glyph('time') . date('H:i', $shift['start']),
'</p>'
]),
div('col-sm-3 col-xs-6', [
'<h4>' . _('End') . '</h4>',
'<h4>' . __('End') . '</h4>',
'<p class="lead' . (time() >= $shift['end'] ? ' text-success' : '') . '">',
glyph('calendar') . date(_('Y-m-d'), $shift['end']),
glyph('calendar') . date(__('Y-m-d'), $shift['end']),
'<br />',
glyph('time') . date('H:i', $shift['end']),
'</p>'
]),
div('col-sm-3 col-xs-6', [
'<h4>' . _('Location') . '</h4>',
'<h4>' . __('Location') . '</h4>',
'<p class="lead">' . Room_name_render($room) . '</p>'
])
]);
@ -52,14 +52,14 @@ function Shift_editor_info_render($shift)
$info = [];
if (!empty($shift['created_by_user_id'])) {
$info[] = sprintf(
glyph('plus') . _('created at %s by %s'),
glyph('plus') . __('created at %s by %s'),
date('Y-m-d H:i', $shift['created_at_timestamp']),
User_Nick_render(User($shift['created_by_user_id']))
);
}
if (!empty($shift['edited_by_user_id'])) {
$info[] = sprintf(
glyph('pencil') . _('edited at %s by %s'),
glyph('pencil') . __('edited at %s by %s'),
date('Y-m-d H:i', $shift['edited_at_timestamp']),
User_Nick_render(User($shift['edited_by_user_id']))
);
@ -82,11 +82,11 @@ function Shift_signup_button_render($shift, $angeltype, $user_angeltype = null)
}
if ($angeltype['shift_signup_state']->isSignupAllowed()) {
return button(shift_entry_create_link($shift, $angeltype), _('Sign up'));
return button(shift_entry_create_link($shift, $angeltype), __('Sign up'));
} elseif (empty($user_angeltype)) {
return button(
page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]),
sprintf(_('Become %s'),
sprintf(__('Become %s'),
$angeltype['name'])
);
}
@ -125,33 +125,33 @@ function Shift_view($shift, $shifttype, $room, $angeltypes_source, ShiftSignupSt
$content = [msg()];
if ($shift_signup_state->getState() == ShiftSignupState::COLLIDES) {
$content[] = info(_('This shift collides with one of your shifts.'), true);
$content[] = info(__('This shift collides with one of your shifts.'), true);
}
if ($shift_signup_state->getState() == ShiftSignupState::SIGNED_UP) {
$content[] = info(_('You are signed up for this shift.'), true);
$content[] = info(__('You are signed up for this shift.'), true);
}
$buttons = [];
if ($shift_admin || $admin_shifttypes || $admin_rooms) {
$buttons = [
$shift_admin ? button(shift_edit_link($shift), glyph('pencil') . _('edit')) : '',
$shift_admin ? button(shift_delete_link($shift), glyph('trash') . _('delete')) : '',
$shift_admin ? button(shift_edit_link($shift), glyph('pencil') . __('edit')) : '',
$shift_admin ? button(shift_delete_link($shift), glyph('trash') . __('delete')) : '',
$admin_shifttypes ? button(shifttype_link($shifttype), $shifttype['name']) : '',
$admin_rooms ? button(room_link($room), glyph('map-marker') . $room['Name']) : '',
];
}
$buttons[] = button(user_link($user), '<span class="icon-icon_angel"></span> ' . _('My shifts'));
$buttons[] = button(user_link($user), '<span class="icon-icon_angel"></span> ' . __('My shifts'));
$content[] = buttons($buttons);
$content[] = Shift_view_header($shift, $room);
$content[] = div('row', [
div('col-sm-6', [
'<h2>' . _('Needed angels') . '</h2>',
'<h2>' . __('Needed angels') . '</h2>',
'<div class="list-group">' . $needed_angels . '</div>'
]),
div('col-sm-6', [
'<h2>' . _('Description') . '</h2>',
'<h2>' . __('Description') . '</h2>',
$parsedown->parse($shifttype['description'])
])
]);

@ -9,19 +9,19 @@
*/
function UserAngelType_update_view($user_angeltype, $user, $angeltype, $supporter)
{
return page_with_title($supporter ? _('Add supporter rights') : _('Remove supporter rights'), [
return page_with_title($supporter ? __('Add supporter rights') : __('Remove supporter rights'), [
msg(),
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?'),
? __('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),
buttons([
button(
page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]),
glyph('remove') . _('cancel')
glyph('remove') . __('cancel')
),
button(
page_link_to('user_angeltypes', [
@ -30,7 +30,7 @@ function UserAngelType_update_view($user_angeltype, $user, $angeltype, $supporte
'supporter' => ($supporter ? '1' : '0'),
'confirmed' => 1,
]),
glyph('ok') . _('yes'),
glyph('ok') . __('yes'),
'btn-primary'
)
])
@ -43,23 +43,23 @@ function UserAngelType_update_view($user_angeltype, $user, $angeltype, $supporte
*/
function UserAngelTypes_delete_all_view($angeltype)
{
return page_with_title(_('Deny all users'), [
return page_with_title(__('Deny all users'), [
msg(),
info(sprintf(_('Do you really want to deny all users for %s?'), $angeltype['name']), true),
info(sprintf(__('Do you really want to deny all users for %s?'), $angeltype['name']), true),
buttons([
button(
page_link_to(
'angeltypes',
['action' => 'view', 'angeltype_id' => $angeltype['id']]
),
glyph('remove') . _('cancel')
glyph('remove') . __('cancel')
),
button(
page_link_to(
'user_angeltypes',
['action' => 'delete_all', 'angeltype_id' => $angeltype['id'], 'confirmed' => 1]
),
glyph('ok') . _('yes'),
glyph('ok') . __('yes'),
'btn-primary'
)
])
@ -72,15 +72,15 @@ function UserAngelTypes_delete_all_view($angeltype)
*/
function UserAngelTypes_confirm_all_view($angeltype)
{
return page_with_title(_('Confirm all users'), [
return page_with_title(__('Confirm all users'), [
msg(),
info(sprintf(_('Do you really want to confirm all users for %s?'), $angeltype['name']), true),
info(sprintf(__('Do you really want to confirm all users for %s?'), $angeltype['name']), true),
buttons([
button(angeltype_link($angeltype['id']), glyph('remove') . _('cancel')),
button(angeltype_link($angeltype['id']), glyph('remove') . __('cancel')),
button(
page_link_to('user_angeltypes',
['action' => 'confirm_all', 'angeltype_id' => $angeltype['id'], 'confirmed' => 1]),
glyph('ok') . _('yes'),
glyph('ok') . __('yes'),
'btn-primary'
)
])
@ -95,21 +95,21 @@ function UserAngelTypes_confirm_all_view($angeltype)
*/
function UserAngelType_confirm_view($user_angeltype, $user, $angeltype)
{
return page_with_title(_('Confirm angeltype for user'), [
return page_with_title(__('Confirm angeltype for user'), [
msg(),
info(sprintf(
_('Do you really want to confirm %s for %s?'),
__('Do you really want to confirm %s for %s?'),
User_Nick_render($user),
$angeltype['name']
), true),
buttons([
button(angeltype_link($angeltype['id']), glyph('remove') . _('cancel')),
button(angeltype_link($angeltype['id']), glyph('remove') . __('cancel')),
button(
page_link_to(
'user_angeltypes',
['action' => 'confirm', 'user_angeltype_id' => $user_angeltype['id'], 'confirmed' => 1]
),
glyph('ok') . _('yes'),
glyph('ok') . __('yes'),
'btn-primary'
)
])
@ -124,19 +124,19 @@ function UserAngelType_confirm_view($user_angeltype, $user, $angeltype)
*/
function UserAngelType_delete_view($user_angeltype, $user, $angeltype)
{
return page_with_title(_('Remove angeltype'), [
return page_with_title(__('Remove angeltype'), [
msg(),
info(sprintf(
_('Do you really want to delete %s from %s?'),
__('Do you really want to delete %s from %s?'),
User_Nick_render($user),
$angeltype['name']
), true),
buttons([
button(angeltype_link($angeltype['id']), glyph('remove') . _('cancel')),
button(angeltype_link($angeltype['id']), glyph('remove') . __('cancel')),
button(
page_link_to('user_angeltypes',
['action' => 'delete', 'user_angeltype_id' => $user_angeltype['id'], 'confirmed' => 1]),
glyph('ok') . _('yes'),
glyph('ok') . __('yes'),
'btn-primary'
)
])
@ -156,19 +156,19 @@ function UserAngelType_add_view($angeltype, $users_source, $user_id)
$users[$user_source['UID']] = User_Nick_render($user_source);
}
return page_with_title(_('Add user to angeltype'), [
return page_with_title(__('Add user to angeltype'), [
msg(),
buttons([
button(
page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]),
_('back'),
__('back'),
'back'
)
]),
form([
form_info(_('Angeltype'), $angeltype['name']),
form_select('user_id', _('User'), $users, $user_id),
form_submit('submit', _('Add'))
form_info(__('Angeltype'), $angeltype['name']),
form_select('user_id', __('User'), $users, $user_id),
form_submit('submit', __('Add'))
])
]);
}
@ -180,21 +180,21 @@ function UserAngelType_add_view($angeltype, $users_source, $user_id)
*/
function UserAngelType_join_view($user, $angeltype)
{
return page_with_title(sprintf(_('Become a %s'), $angeltype['name']), [
return page_with_title(sprintf(__('Become a %s'), $angeltype['name']), [
msg(),
info(sprintf(
_('Do you really want to add %s to %s?'),
__('Do you really want to add %s to %s?'),
User_Nick_render($user),
$angeltype['name']
), true),
buttons([
button(angeltype_link($angeltype['id']), glyph('remove') . _('cancel')),
button(angeltype_link($angeltype['id']), glyph('remove') . __('cancel')),
button(
page_link_to(
'user_angeltypes',
['action' => 'add', 'angeltype_id' => $angeltype['id'], 'user_id' => $user['UID'], 'confirmed' => 1]
),
glyph('ok') . _('save'),
glyph('ok') . __('save'),
'btn-primary'
)
])

@ -10,46 +10,46 @@
*/
function UserDriverLicense_edit_view($user_source, $wants_to_drive, $user_driver_license)
{
return page_with_title(sprintf(_('Edit %s driving license information'), User_Nick_render($user_source)), [
return page_with_title(sprintf(__('Edit %s driving license information'), User_Nick_render($user_source)), [
buttons([
button(user_link($user_source), _('Back to profile'), 'back')
button(user_link($user_source), __('Back to profile'), 'back')
]),
msg(),
form([
form_info(_('Privacy'), _('Your driving license information is only visible for supporters and admins.')),
form_checkbox('wants_to_drive', _('I am willing to drive a car for the event'), $wants_to_drive),
form_info(__('Privacy'), __('Your driving license information is only visible for supporters and admins.')),
form_checkbox('wants_to_drive', __('I am willing to drive a car for the event'), $wants_to_drive),
div('panel panel-default', [
div('panel-body', [
form_checkbox(
'has_car',
_('I have my own car with me and am willing to use it for the event (You\'ll get reimbursed for fuel)'),
__('I have my own car with me and am willing to use it for the event (You\'ll get reimbursed for fuel)'),
$user_driver_license['has_car']
),
heading(_('Driver license'), 3),
form_checkbox('has_license_car', _('Car'), $user_driver_license['has_license_car']),
heading(__('Driver license'), 3),
form_checkbox('has_license_car', __('Car'), $user_driver_license['has_license_car']),
form_checkbox(
'has_license_3_5t_transporter',
_('Transporter 3,5t'),
__('Transporter 3,5t'),
$user_driver_license['has_license_3_5t_transporter']
),
form_checkbox(
'has_license_7_5t_truck',
_('Truck 7,5t'),
__('Truck 7,5t'),
$user_driver_license['has_license_7_5t_truck']
),
form_checkbox(
'has_license_12_5t_truck',
_('Truck 12,5t'),
__('Truck 12,5t'),
$user_driver_license['has_license_12_5t_truck']
),
form_checkbox(
'has_license_forklift',
_('Forklift'),
__('Forklift'),
$user_driver_license['has_license_forklift']
)
])
], 'driving_license'),
form_submit('submit', _('Save'))
form_submit('submit', __('Save'))
]),
'<script type="text/javascript">
$(function() {

@ -11,14 +11,14 @@ function UserWorkLog_delete_view($user_source, $userWorkLog)
{
return page_with_title(UserWorkLog_delete_title(), [
info(sprintf(
_('Do you want to delete the worklog entry for %s?'),
__('Do you want to delete the worklog entry for %s?'),
User_Nick_render($user_source)
), true),
buttons([
button(user_link($user_source), glyph('remove') . _('cancel')),
button(user_link($user_source), glyph('remove') . __('cancel')),
button(user_worklog_delete_link($userWorkLog, [
'confirmed' => 1
]), glyph('ok') . _('delete'), 'btn-danger')
]), glyph('ok') . __('delete'), 'btn-danger')
])
]);
}
@ -28,7 +28,7 @@ function UserWorkLog_delete_view($user_source, $userWorkLog)
*/
function UserWorkLog_delete_title()
{
return _('Delete work log entry');
return __('Delete work log entry');
}
/**
@ -41,11 +41,11 @@ function UserWorkLog_delete_title()
function UserWorkLog_edit_form($user_source, $userWorkLog)
{
return form([
form_info(_('User'), User_Nick_render($user_source)),
form_date('work_timestamp', _('Work date'), $userWorkLog['work_timestamp'], null, time()),
form_text('work_hours', _('Work hours'), $userWorkLog['work_hours']),
form_text('comment', _('Comment'), $userWorkLog['comment']),
form_submit('submit', _('Save'))
form_info(__('User'), User_Nick_render($user_source)),
form_date('work_timestamp', __('Work date'), $userWorkLog['work_timestamp'], null, time()),
form_text('work_hours', __('Work hours'), $userWorkLog['work_hours']),
form_text('comment', __('Comment'), $userWorkLog['comment']),
form_submit('submit', __('Save'))
]);
}
@ -60,7 +60,7 @@ function UserWorkLog_edit_view($user_source, $userWorkLog)
{
return page_with_title(UserWorkLog_edit_title(), [
buttons([
button(user_link($user_source), _('back'))
button(user_link($user_source), __('back'))
]),
msg(),
UserWorkLog_edit_form($user_source, $userWorkLog)
@ -78,7 +78,7 @@ function UserWorkLog_add_view($user_source, $userWorkLog)
{
return page_with_title(UserWorkLog_add_title(), [
buttons([
button(user_link($user_source), _('back'))
button(user_link($user_source), __('back'))
]),
msg(),
UserWorkLog_edit_form($user_source, $userWorkLog)
@ -90,7 +90,7 @@ function UserWorkLog_add_view($user_source, $userWorkLog)
*/
function UserWorkLog_edit_title()
{
return _('Edit work log entry');
return __('Edit work log entry');
}
/**
@ -98,5 +98,5 @@ function UserWorkLog_edit_title()
*/
function UserWorkLog_add_title()
{
return _('Add work log entry');
return __('Add work log entry');
}

@ -26,69 +26,70 @@ function User_settings_view(
div('row', [
div('col-md-6', [
form([
form_info('', _('Here you can change your user details.')),
form_info(entry_required() . ' = ' . _('Entry required!')),
form_text('nick', _('Nick'), $user_source['Nick'], true),
form_text('lastname', _('Last name'), $user_source['Name']),
form_text('prename', _('First name'), $user_source['Vorname']),
form_info('', __('Here you can change your user details.')),
form_info(entry_required() . ' = ' . __('Entry required!')),
form_text('nick', __('Nick'), $user_source['Nick'], true),
form_text('lastname', __('Last name'), $user_source['Name']),
form_text('prename', __('First name'), $user_source['Vorname']),
form_date(
'planned_arrival_date',
_('Planned date of arrival') . ' ' . entry_required(),
__('Planned date of arrival') . ' ' . entry_required(),
$user_source['planned_arrival_date'],
$buildup_start_date,
$teardown_end_date
),
form_date(
'planned_departure_date',
_('Planned date of departure'),
__('Planned date of departure'),
$user_source['planned_departure_date'],
$buildup_start_date,
$teardown_end_date
),
form_text('age', _('Age'), $user_source['Alter']),
form_text('tel', _('Phone'), $user_source['Telefon']),
form_text('dect', _('DECT'), $user_source['DECT']),
form_text('mobile', _('Mobile'), $user_source['Handy']),
form_text('mail', _('E-Mail') . ' ' . entry_required(), $user_source['email']),
form_text('age', __('Age'), $user_source['Alter']),
form_text('tel', __('Phone'), $user_source['Telefon']),
form_text('dect', __('DECT'), $user_source['DECT']),
form_text('mobile', __('Mobile'), $user_source['Handy']),
form_text('mail', __('E-Mail') . ' ' . entry_required(), $user_source['email']),
form_checkbox(
'email_shiftinfo',
_('The engelsystem is allowed to send me an email (e.g. when my shifts change)'),
__('The engelsystem is allowed to send me an email (e.g. when my shifts change)'),
$user_source['email_shiftinfo']
),
form_checkbox(
'email_by_human_allowed',
_('Humans are allowed to send me an email (e.g. for ticket vouchers)'),
__('Humans are allowed to send me an email (e.g. for ticket vouchers)'),
$user_source['email_by_human_allowed']
),
form_text('jabber', _('Jabber'), $user_source['jabber']),
form_text('hometown', _('Hometown'), $user_source['Hometown']),
form_text('jabber', __('Jabber'), $user_source['jabber']),
form_text('hometown', __('Hometown'), $user_source['Hometown']),
$enable_tshirt_size ? form_select(
'tshirt_size',
_('Shirt size'),
__('Shirt size'),
$tshirt_sizes,
$user_source['Size']
$user_source['Size'],
__('Please select...')
) : '',
form_info('', _('Please visit the angeltypes page to manage your angeltypes.')),
form_submit('submit', _('Save'))
form_info('', __('Please visit the angeltypes page to manage your angeltypes.')),
form_submit('submit', __('Save'))
])
]),
div('col-md-6', [
form([
form_info(_('Here you can change your password.')),
form_password('password', _('Old password:')),
form_password('new_password', _('New password:')),
form_password('new_password2', _('Password confirmation:')),
form_submit('submit_password', _('Save'))
form_info(__('Here you can change your password.')),
form_password('password', __('Old password:')),
form_password('new_password', __('New password:')),
form_password('new_password2', __('Password confirmation:')),
form_submit('submit_password', __('Save'))
]),
form([
form_info(_('Here you can choose your color settings:')),
form_select('theme', _('Color settings:'), $themes, $user_source['color']),
form_submit('submit_theme', _('Save'))
form_info(__('Here you can choose your color settings:')),
form_select('theme', __('Color settings:'), $themes, $user_source['color']),
form_submit('submit_theme', __('Save'))
]),
form([
form_info(_('Here you can choose your language:')),
form_select('language', _('Language:'), $locales, $user_source['Sprache']),
form_submit('submit_language', _('Save'))
form_info(__('Here you can choose your language:')),
form_select('language', __('Language:'), $locales, $user_source['Sprache']),
form_submit('submit_language', __('Save'))
])
])
])
@ -106,29 +107,29 @@ function User_registration_success_view($event_welcome_message)
$parsedown = new Parsedown();
$event_welcome_message = $parsedown->text($event_welcome_message);
return page_with_title(_('Registration successful'), [
return page_with_title(__('Registration successful'), [
msg(),
div('row', [
div('col-md-4', [
$event_welcome_message
]),
div('col-md-4', [
'<h2>' . _('Login') . '</h2>',
'<h2>' . __('Login') . '</h2>',
form([
form_text('nick', _('Nick'), ''),
form_password('password', _('Password')),
form_submit('submit', _('Login')),
form_text('nick', __('Nick'), ''),
form_password('password', __('Password')),
form_submit('submit', __('Login')),
buttons([
button(page_link_to('user_password_recovery'), _('I forgot my password'))
button(page_link_to('user_password_recovery'), __('I forgot my password'))
]),
info(_('Please note: You have to activate cookies!'), true)
info(__('Please note: You have to activate cookies!'), true)
], page_link_to('login'))
]),
div('col-md-4', [
'<h2>' . _('What can I do?') . '</h2>',
'<p>' . _('Please read about the jobs you can do to help us.') . '</p>',
'<h2>' . __('What can I do?') . '</h2>',
'<p>' . __('Please read about the jobs you can do to help us.') . '</p>',
buttons([
button(page_link_to('angeltypes', ['action' => 'about']), _('Teams/Job description') . ' &raquo;')
button(page_link_to('angeltypes', ['action' => 'about']), __('Teams/Job description') . ' &raquo;')
])
])
])
@ -143,18 +144,18 @@ function User_registration_success_view($event_welcome_message)
*/
function User_delete_view($user)
{
return page_with_title(sprintf(_('Delete %s'), User_Nick_render($user)), [
return page_with_title(sprintf(__('Delete %s'), User_Nick_render($user)), [
msg(),
buttons([
button(user_edit_link($user), glyph('chevron-left') . _('back'))
button(user_edit_link($user), glyph('chevron-left') . __('back'))
]),
error(
_('Do you really want to delete the user including all his shifts and every other piece of his data?'),
__('Do you really want to delete the user including all his shifts and every other piece of his data?'),
true
),
form([
form_password('password', _('Your password')),
form_submit('submit', _('Delete'))
form_password('password', __('Your password')),
form_submit('submit', __('Delete'))
])
]);
}
@ -167,19 +168,19 @@ function User_delete_view($user)
*/
function User_edit_vouchers_view($user)
{
return page_with_title(sprintf(_('%s\'s vouchers'), User_Nick_render($user)), [
return page_with_title(sprintf(__('%s\'s vouchers'), User_Nick_render($user)), [
msg(),
buttons([
button(user_link($user), glyph('chevron-left') . _('back'))
button(user_link($user), glyph('chevron-left') . __('back'))
]),
info(sprintf(
_('Angel should receive at least %d vouchers.'),
__('Angel should receive at least %d vouchers.'),
User_get_eligable_voucher_count($user)
), true),
form(
[
form_spinner('vouchers', _('Number of vouchers given out'), $user['got_voucher']),
form_submit('submit', _('Save'))
form_spinner('vouchers', __('Number of vouchers given out'), $user['got_voucher']),
form_submit('submit', __('Save'))
],
page_link_to('users', ['action' => 'edit_vouchers', 'user_id' => $user['UID']])
)
@ -213,13 +214,13 @@ function Users_view(
$user['Aktiv'] = glyph_bool($user['Aktiv']);
$user['force_active'] = glyph_bool($user['force_active']);
$user['Tshirt'] = glyph_bool($user['Tshirt']);
$user['lastLogIn'] = date(_('m/d/Y h:i a'), $user['lastLogIn']);
$user['lastLogIn'] = date(__('m/d/Y h:i a'), $user['lastLogIn']);
$user['actions'] = table_buttons([
button_glyph(page_link_to('admin_user', ['id' => $user['UID']]), 'edit', 'btn-xs')
]);
}
$users[] = [
'Nick' => '<strong>' . _('Sum') . '</strong>',
'Nick' => '<strong>' . __('Sum') . '</strong>',
'Gekommen' => $arrived_count,
'got_voucher' => $voucher_count,
'Aktiv' => $active_count,
@ -229,24 +230,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),
'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),
'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),
'actions' => ''
], $users)
]);
@ -280,7 +281,7 @@ function User_shift_state_render($user)
$upcoming_shifts = ShiftEntries_upcoming_for_user($user);
if (empty($upcoming_shifts)) {
return '<span class="text-success">' . _('Free') . '</span>';
return '<span class="text-success">' . __('Free') . '</span>';
}
$nextShift = array_shift($upcoming_shifts);
@ -288,23 +289,23 @@ function User_shift_state_render($user)
if ($nextShift['start'] > time()) {
if ($nextShift['start'] - time() > 3600) {
return '<span class="text-success moment-countdown" data-timestamp="' . $nextShift['start'] . '">'
. _('Next shift %c')
. __('Next shift %c')
. '</span>';
}
return '<span class="text-warning moment-countdown" data-timestamp="' . $nextShift['start'] . '">'
. _('Next shift %c')
. __('Next shift %c')
. '</span>';
}
$halfway = ($nextShift['start'] + $nextShift['end']) / 2;
if (time() < $halfway) {
return '<span class="text-danger moment-countdown" data-timestamp="' . $nextShift['start'] . '">'
. _('Shift started %c')
. __('Shift started %c')
. '</span>';
}
return '<span class="text-danger moment-countdown" data-timestamp="' . $nextShift['end'] . '">'
. _('Shift ends %c')
. __('Shift ends %c')
. '</span>';
}
@ -372,26 +373,26 @@ function User_view_myshift($shift, $user_source, $its_me)
. '</p>';
if (in_array('user_shifts_admin', $privileges)) {
$myshift['comment'] .= '<br />'
. '<p class="text-danger">' . _('Freeloaded') . ': ' . $shift['freeload_comment'] . '</p>';
. '<p class="text-danger">' . __('Freeloaded') . ': ' . $shift['freeload_comment'] . '</p>';
} else {
$myshift['comment'] .= '<br /><p class="text-danger">' . _('Freeloaded') . '</p>';
$myshift['comment'] .= '<br /><p class="text-danger">' . __('Freeloaded') . '</p>';
}
}
$myshift['actions'] = [
button(shift_link($shift), glyph('eye-open') . _('view'), 'btn-xs')
button(shift_link($shift), glyph('eye-open') . __('view'), 'btn-xs')
];
if ($its_me || in_array('user_shifts_admin', $privileges)) {
$myshift['actions'][] = button(
page_link_to('user_myshifts', ['edit' => $shift['id'], 'id' => $user_source['UID']]),
glyph('edit') . _('edit'),
glyph('edit') . __('edit'),
'btn-xs'
);
}
if (Shift_signout_allowed($shift, ['id' => $shift['TID']], $user_source)) {
$myshift['actions'][] = button(
shift_entry_delete_link($shift),
glyph('trash') . _('sign off'),
glyph('trash') . __('sign off'),
'btn-xs'
);
}
@ -441,7 +442,7 @@ function User_view_myshifts(
if (count($myshifts_table) > 0) {
ksort($myshifts_table);
$myshifts_table[] = [
'date' => '<b>' . _('Sum:') . '</b>',
'date' => '<b>' . __('Sum:') . '</b>',
'duration' => '<b>' . sprintf('%.2f', round($timesum / 3600, 2)) . '&nbsp;h</b>',
'room' => '',
'shift_info' => '',
@ -450,7 +451,7 @@ function User_view_myshifts(
];
if (config('enable_tshirt_size', false) && ($its_me || $tshirt_admin)) {
$myshifts_table[] = [
'date' => '<b>' . _('Your t-shirt score') . '&trade;:</b>',
'date' => '<b>' . __('Your t-shirt score') . '&trade;:</b>',
'duration' => '<b>' . $tshirt_score . '</b>',
'room' => '',
'shift_info' => '',
@ -476,12 +477,12 @@ function User_view_worklog($worklog, $admin_user_worklog_privilege)
$actions = table_buttons([
button(
user_worklog_edit_link($worklog),
glyph('edit') . _('edit'),
glyph('edit') . __('edit'),
'btn-xs'
),
button(
user_worklog_delete_link($worklog),
glyph('trash') . _('delete'),
glyph('trash') . __('delete'),
'btn-xs'
)
]);
@ -491,10 +492,10 @@ function User_view_worklog($worklog, $admin_user_worklog_privilege)
'date' => glyph('calendar') . date('Y-m-d', $worklog['work_timestamp']),
'duration' => '<b>' . sprintf('%.2f', $worklog['work_hours']) . '</b>',
'room' => '',
'shift_info' => _('Work log entry'),
'shift_info' => __('Work log entry'),
'comment' => $worklog['comment'] . '<br>'
. sprintf(
_('Added by %s at %s'),
__('Added by %s at %s'),
User_Nick_render(User($worklog['created_user_id'])),
date('Y-m-d H:i', $worklog['created_timestamp'])
),
@ -545,15 +546,15 @@ function User_view(
);
if (count($my_shifts) > 0) {
$myshifts_table = table([
'date' => _('Day &amp; time'),
'duration' => _('Duration'),
'room' => _('Location'),
'shift_info' => _('Name &amp; workmates'),
'comment' => _('Comment'),
'actions' => _('Action')
'date' => __('Day &amp; time'),
'duration' => __('Duration'),
'room' => __('Location'),
'shift_info' => __('Name &amp; workmates'),
'comment' => __('Comment'),
'actions' => __('Action')
], $my_shifts);
} elseif ($user_source['force_active']) {
$myshifts_table = success(_('You have done enough to get a t-shirt.'), true);
$myshifts_table = success(__('You have done enough to get a t-shirt.'), true);
}
}
@ -568,42 +569,42 @@ function User_view(
buttons([
$admin_user_privilege ? button(
page_link_to('admin_user', ['id' => $user_source['UID']]),
glyph('edit') . _('edit')
glyph('edit') . __('edit')
) : '',
$admin_user_privilege ? button(
user_driver_license_edit_link($user_source),
glyph('road') . _('driving license')
glyph('road') . __('driving license')
) : '',
($admin_user_privilege && !$user_source['Gekommen']) ? button(
page_link_to('admin_arrive', ['arrived' => $user_source['UID']]),
_('arrived')
__('arrived')
) : '',
$admin_user_privilege ? button(
page_link_to(
'users',
['action' => 'edit_vouchers', 'user_id' => $user_source['UID']]
),
glyph('cutlery') . _('Edit vouchers')
glyph('cutlery') . __('Edit vouchers')
) : '',
$admin_user_worklog_privilege ? button(
user_worklog_add_link($user_source),
glyph('list') . _('Add work log')
glyph('list') . __('Add work log')
) : '',
$its_me ? button(
page_link_to('user_settings'),
glyph('list-alt') . _('Settings')
glyph('list-alt') . __('Settings')
) : '',
$its_me ? button(
page_link_to('ical', ['key' => $user_source['api_key']]),
glyph('calendar') . _('iCal Export')
glyph('calendar') . __('iCal Export')
) : '',
$its_me ? button(
page_link_to('shifts_json_export', ['key' => $user_source['api_key']]),
glyph('export') . _('JSON Export')
glyph('export') . __('JSON Export')
) : '',
$its_me ? button(
page_link_to('user_myshifts', ['reset' => 1]),
glyph('repeat') . _('Reset API key')
glyph('repeat') . __('Reset API key')
) : ''
])
])
@ -616,15 +617,15 @@ function User_view(
User_angeltypes_render($user_angeltypes),
User_groups_render($user_groups)
]),
($its_me || $admin_user_privilege) ? '<h2>' . _('Shifts') . '</h2>' : '',
($its_me || $admin_user_privilege) ? '<h2>' . __('Shifts') . '</h2>' : '',
$myshifts_table,
$its_me ? info(
glyph('info-sign') . _('Your night shifts between 2 and 8 am count twice.'),
glyph('info-sign') . __('Your night shifts between 2 and 8 am count twice.'),
true
) : '',
$its_me && count($shifts) == 0
? error(sprintf(
_('Go to the <a href="%s">shifts table</a> to sign yourself up for some shifts.'),
__('Go to the <a href="%s">shifts table</a> to sign yourself up for some shifts.'),
page_link_to('user_shifts')
), true)
: '',
@ -650,7 +651,7 @@ function User_view_state($admin_user_privilege, $freeloader, $user_source)
}
return div('col-md-3', [
heading(_('User state'), 4),
heading(__('User state'), 4),
join('<br>', $state)
]);
}
@ -668,9 +669,9 @@ function User_view_state_user($user_source)
];
if ($user_source['Gekommen']) {
$state[] = '<span class="text-success">' . glyph('home') . _('Arrived') . '</span>';
$state[] = '<span class="text-success">' . glyph('home') . __('Arrived') . '</span>';
} else {
$state[] = '<span class="text-danger">' . _('Not arrived') . '</span>';
$state[] = '<span class="text-danger">' . __('Not arrived') . '</span>';
}
return $state;
@ -689,27 +690,27 @@ function User_view_state_admin($freeloader, $user_source)
$state = [];
if ($freeloader) {
$state[] = '<span class="text-danger">' . glyph('exclamation-sign') . _('Freeloader') . '</span>';
$state[] = '<span class="text-danger">' . glyph('exclamation-sign') . __('Freeloader') . '</span>';
}
$state[] = User_shift_state_render($user_source);
if ($user_source['Gekommen']) {
$state[] = '<span class="text-success">' . glyph('home')
. sprintf(_('Arrived at %s'), date('Y-m-d', $user_source['arrival_date']))
. sprintf(__('Arrived at %s'), date('Y-m-d', $user_source['arrival_date']))
. '</span>';
if ($user_source['force_active']) {
$state[] = '<span class="text-success">' . _('Active (forced)') . '</span>';
$state[] = '<span class="text-success">' . __('Active (forced)') . '</span>';
} elseif ($user_source['Aktiv']) {
$state[] = '<span class="text-success">' . _('Active') . '</span>';
$state[] = '<span class="text-success">' . __('Active') . '</span>';
}
if ($user_source['Tshirt']) {
$state[] = '<span class="text-success">' . _('T-Shirt') . '</span>';
$state[] = '<span class="text-success">' . __('T-Shirt') . '</span>';
}
} else {
$state[] = '<span class="text-danger">'
. sprintf(_('Not arrived (Planned: %s)'), date('Y-m-d', $user_source['planned_arrival_date']))
. sprintf(__('Not arrived (Planned: %s)'), date('Y-m-d', $user_source['planned_arrival_date']))
. '</span>';
}
@ -722,7 +723,7 @@ function User_view_state_admin($freeloader, $user_source)
)
. '</span>';
} else {
$state[] = '<span class="text-danger">' . _('Got no vouchers') . '</span>';
$state[] = '<span class="text-danger">' . __('Got no vouchers') . '</span>';
}
return $state;
@ -737,10 +738,10 @@ function User_password_recovery_view()
{
return page_with_title(user_password_recovery_title(), [
msg(),
_('We will send you an e-mail with a password recovery link. Please use the email address you used for registration.'),
__('We will send you an e-mail with a password recovery link. Please use the email address you used for registration.'),
form([
form_text('email', _('E-Mail'), ''),
form_submit('submit', _('Recover'))
form_text('email', __('E-Mail'), ''),
form_submit('submit', __('Recover'))
])
]);
}
@ -754,11 +755,11 @@ function User_password_set_view()
{
return page_with_title(user_password_recovery_title(), [
msg(),
_('Please enter a new password.'),
__('Please enter a new password.'),
form([
form_password('password', _('Password')),
form_password('password2', _('Confirm password')),
form_submit('submit', _('Save'))
form_password('password', __('Password')),
form_password('password2', __('Confirm password')),
form_submit('submit', __('Save'))
])
]);
}
@ -780,7 +781,7 @@ function User_angeltypes_render($user_angeltypes)
. '</a>';
}
return div('col-md-3', [
heading(_('Angeltypes'), 4),
heading(__('Angeltypes'), 4),
join('<br>', $output)
]);
}
@ -797,7 +798,7 @@ function User_groups_render($user_groups)
}
return div('col-md-3', [
'<h4>' . _('Rights') . '</h4>',
'<h4>' . __('Rights') . '</h4>',
join('<br>', $output)
]);
}
@ -846,7 +847,7 @@ function render_user_departure_date_hint()
global $user;
if (!isset($user['planned_departure_date']) || empty($user['planned_departure_date'])) {
$text = _('Please enter your planned date of departure on your settings page to give us a feeling for teardown capacities.');
$text = __('Please enter your planned date of departure on your settings page to give us a feeling for teardown capacities.');
return render_profile_link($text, null, 'alert-link');
}
@ -862,7 +863,7 @@ function render_user_freeloader_hint()
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.'),
__('You freeloaded at least %s shifts. Shift signup is locked. Please go to heavens desk to be unlocked again.'),
config('max_freeloadable_shifts')
);
}
@ -884,7 +885,7 @@ function render_user_arrived_hint()
if (!empty($event_config)
&& !is_null($event_config['buildup_start_date'])
&& time() > $event_config['buildup_start_date']) {
return _('You are not marked as arrived. Please go to heaven\'s desk, get your angel badge and/or tell them that you arrived already.');
return __('You are not marked as arrived. Please go to heaven\'s desk, get your angel badge and/or tell them that you arrived already.');
}
}
@ -899,7 +900,7 @@ function render_user_tshirt_hint()
global $user;
if (config('enable_tshirt_size') && $user['Size'] == '') {
$text = _('You need to specify a tshirt size in your settings!');
$text = __('You need to specify a tshirt size in your settings!');
return render_profile_link($text, null, 'alert-link');
}
@ -914,7 +915,7 @@ function render_user_dect_hint()
global $user;
if ($user['Gekommen'] == 1 && $user['DECT'] == '') {
$text = _('You need to specify a DECT phone number in your settings! If you don\'t have a DECT phone, just enter \'-\'.');
$text = __('You need to specify a DECT phone number in your settings! If you don\'t have a DECT phone, just enter \'-\'.');
return render_profile_link($text, null, 'alert-link');
}

@ -2,6 +2,7 @@
namespace Engelsystem\Middleware;
use Engelsystem\Helpers\Translator;
use Engelsystem\Http\Request;
use Engelsystem\Http\Response;
use Psr\Container\ContainerInterface;
@ -83,9 +84,12 @@ class LegacyMiddleware implements MiddlewareInterface
}
if (empty($title) and empty($content)) {
/** @var Translator $translator */
$translator = $this->container->get('translator');
$page = 404;
$title = _('Page not found');
$content = _('This page could not be found or you don\'t have permission to view it. You probably have to sign in or register in order to gain access!');
$title = $translator->translate('Page not found');
$content = $translator->translate('This page could not be found or you don\'t have permission to view it. You probably have to sign in or register in order to gain access!');
}
return $this->renderPage($page, $title, $content);

@ -2,6 +2,7 @@
namespace Engelsystem\Test\Unit\Middleware;
use Engelsystem\Helpers\Translator;
use Engelsystem\Http\Request;
use Engelsystem\Middleware\LegacyMiddleware;
use PHPUnit\Framework\TestCase;
@ -37,6 +38,10 @@ class LegacyMiddlewareTest extends TestCase
$handler = $this->getMockForAbstractClass(RequestHandlerInterface::class);
/** @var ServerRequestInterface|MockObject $request */
$request = $this->getMockForAbstractClass(ServerRequestInterface::class);
/** @var Translator|MockObject $translator */
$translator = $this->getMockBuilder(Translator::class)
->disableOriginalConstructor()
->getMock();
$middleware->expects($this->exactly(2))
->method('loadPage')
@ -50,15 +55,27 @@ class LegacyMiddlewareTest extends TestCase
->method('renderPage')
->withConsecutive(
['user_worklog', 'title', 'content'],
['404', 'Page not found'],
['404', 'Page not found', 'It\'s not available!'],
['login', 'title2', 'content2']
)
->willReturn($response);
$container->expects($this->atLeastOnce())
$container->expects($this->exactly(4))
->method('get')
->with('request')
->willReturn($defaultRequest);
->withConsecutive(['request'], ['request'], ['translator'], ['request'])
->willReturnOnConsecutiveCalls(
$defaultRequest,
$defaultRequest,
$translator,
$defaultRequest
);
$translator->expects($this->exactly(2))
->method('translate')
->willReturnOnConsecutiveCalls(
'Page not found',
'It\'s not available!'
);
$defaultRequest->query = $parameters;
$defaultRequest->expects($this->once())

Loading…
Cancel
Save