diff options
Diffstat (limited to 'includes/controller')
-rw-r--r-- | includes/controller/angeltypes_controller.php | 26 | ||||
-rw-r--r-- | includes/controller/event_config_controller.php | 20 | ||||
-rw-r--r-- | includes/controller/public_dashboard_controller.php | 2 | ||||
-rw-r--r-- | includes/controller/shift_entries_controller.php | 28 | ||||
-rw-r--r-- | includes/controller/shifts_controller.php | 38 | ||||
-rw-r--r-- | includes/controller/shifttypes_controller.php | 14 | ||||
-rw-r--r-- | includes/controller/user_angeltypes_controller.php | 78 | ||||
-rw-r--r-- | includes/controller/user_driver_licenses_controller.php | 12 | ||||
-rw-r--r-- | includes/controller/user_worklog_controller.php | 12 | ||||
-rw-r--r-- | includes/controller/users_controller.php | 44 |
10 files changed, 137 insertions, 137 deletions
diff --git a/includes/controller/angeltypes_controller.php b/includes/controller/angeltypes_controller.php index 210b6209..027e63ed 100644 --- a/includes/controller/angeltypes_controller.php +++ b/includes/controller/angeltypes_controller.php @@ -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')); } diff --git a/includes/controller/event_config_controller.php b/includes/controller/event_config_controller.php index e64f47fd..c227b785 100644 --- a/includes/controller/event_config_controller.php +++ b/includes/controller/event_config_controller.php @@ -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')); } } diff --git a/includes/controller/public_dashboard_controller.php b/includes/controller/public_dashboard_controller.php index 23d5a4d6..37acbd63 100644 --- a/includes/controller/public_dashboard_controller.php +++ b/includes/controller/public_dashboard_controller.php @@ -24,7 +24,7 @@ function public_dashboard_controller() } return [ - _('Public Dashboard'), + __('Public Dashboard'), public_dashboard_view($stats, $free_shifts) ]; } diff --git a/includes/controller/shift_entries_controller.php b/includes/controller/shift_entries_controller.php index dbed09af..05a3a5e5 100644 --- a/includes/controller/shift_entries_controller.php +++ b/includes/controller/shift_entries_controller.php @@ -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)); } diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php index 326449cf..d2a37f3c 100644 --- a/includes/controller/shifts_controller.php +++ b/includes/controller/shifts_controller.php @@ -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')); } diff --git a/includes/controller/shifttypes_controller.php b/includes/controller/shifttypes_controller.php index bc9c5c52..8b30ea60 100644 --- a/includes/controller/shifttypes_controller.php +++ b/includes/controller/shifttypes_controller.php @@ -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'); } /** diff --git a/includes/controller/user_angeltypes_controller.php b/includes/controller/user_angeltypes_controller.php index 5dae0595..aa614cf3 100644 --- a/includes/controller/user_angeltypes_controller.php +++ b/includes/controller/user_angeltypes_controller.php @@ -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) ]; } diff --git a/includes/controller/user_driver_licenses_controller.php b/includes/controller/user_driver_licenses_controller.php index 889b03e3..6621866d 100644 --- a/includes/controller/user_driver_licenses_controller.php +++ b/includes/controller/user_driver_licenses_controller.php @@ -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) ]; } diff --git a/includes/controller/user_worklog_controller.php b/includes/controller/user_worklog_controller.php index a7218071..640dcaba 100644 --- a/includes/controller/user_worklog_controller.php +++ b/includes/controller/user_worklog_controller.php @@ -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)); } } diff --git a/includes/controller/users_controller.php b/includes/controller/users_controller.php index b6334803..d7f97c7e 100644 --- a/includes/controller/users_controller.php +++ b/includes/controller/users_controller.php @@ -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)) . ' 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()); } |