summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleaneb <lea-e@bluewin.ch>2016-11-24 22:29:06 +0100
committerGitHub <noreply@github.com>2016-11-24 22:29:06 +0100
commit96728fedd76069175bcb3462b1fbdd38b47e00f7 (patch)
tree2bd52191c3e67c7117090be669bb76812d3151e1
parent4116e0114e94f7c4ee5dba686c029b7e988bd7b3 (diff)
parent07e8d8dfbd9bdcfbaecf12894bc0e3cfb9e0126e (diff)
Merge pull request #1 from engelsystem/master
Merge with Master
-rw-r--r--includes/controller/shifts_controller.php5
-rw-r--r--includes/pages/guest_login.php4
-rw-r--r--includes/pages/user_settings.php4
-rw-r--r--includes/sys_page.php2
-rw-r--r--locale/de_DE.UTF-8/LC_MESSAGES/default.po2
5 files changed, 9 insertions, 8 deletions
diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php
index f273c097..1500b449 100644
--- a/includes/controller/shifts_controller.php
+++ b/includes/controller/shifts_controller.php
@@ -1,5 +1,6 @@
<?php
+use Engelsystem\ShiftSignupState;
function shift_link($shift) {
return page_link_to('shifts') . '&action=view&shift_id=' . $shift['SID'];
}
@@ -200,13 +201,13 @@ function shift_controller() {
$angeltypes = AngelTypes();
$user_shifts = Shifts_by_user($user);
- $shift_signup_state = null;
+ $shift_signup_state = new ShiftSignupState(ShiftSignupState::OCCUPIED, 0);
foreach ($angeltypes as $angeltype) {
$angeltype_signup_state = Shift_signup_allowed($user, $shift, $angeltype, null, $user_shifts);
if ($shift_signup_state == null) {
$shift_signup_state = $angeltype_signup_state;
} else {
- $shift_signup_state = $shift_signup_state->combineWith($angeltype_signup_state);
+ $shift_signup_state->combineWith($angeltype_signup_state);
}
}
diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php
index b7f85555..e0a32423 100644
--- a/includes/pages/guest_login.php
+++ b/includes/pages/guest_login.php
@@ -106,7 +106,7 @@ function guest_register() {
$msg .= error(sprintf(_("Your password is too short (please use at least %s characters)."), MIN_PASSWORD_LENGTH), true);
}
- if (isset($_REQUEST['planned_arrival_date']) && $tmp = parse_date("Y-m-d", $_REQUEST['planned_arrival_date'])) {
+ if (isset($_REQUEST['planned_arrival_date']) && $tmp = parse_date("Y-m-d H:i", $_REQUEST['planned_arrival_date'] . " 00:00")) {
$planned_arrival_date = $tmp;
} else {
$valid = false;
@@ -306,7 +306,7 @@ function guest_login() {
}
} else {
$valid = false;
- error(_("No user was found with that Nickname. Please try again. If you are still having problems, ask an Dispatcher."));
+ error(_("No user was found with that Nickname. Please try again. If you are still having problems, ask a Dispatcher."));
}
} else {
$valid = false;
diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php
index 02c61a20..a147b437 100644
--- a/includes/pages/user_settings.php
+++ b/includes/pages/user_settings.php
@@ -44,7 +44,7 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes) {
}
if (isset($_REQUEST['planned_arrival_date'])) {
- $tmp = parse_date("Y-m-d", $_REQUEST['planned_arrival_date']);
+ $tmp = parse_date("Y-m-d H:i", $_REQUEST['planned_arrival_date'] . " 00:00");
$result = User_validate_planned_arrival_date($tmp);
$user_source['planned_arrival_date'] = $result->getValue();
if (! $result->isValid()) {
@@ -54,7 +54,7 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes) {
}
if (isset($_REQUEST['planned_departure_date'])) {
- $tmp = parse_date("Y-m-d", $_REQUEST['planned_departure_date']);
+ $tmp = parse_date("Y-m-d H:i", $_REQUEST['planned_departure_date'] . " 00:00");
$result = User_validate_planned_departure_date($user_source['planned_arrival_date'], $tmp);
$user_source['planned_departure_date'] = $result->getValue();
if (! $result->isValid()) {
diff --git a/includes/sys_page.php b/includes/sys_page.php
index 8eb32962..82ce9896 100644
--- a/includes/sys_page.php
+++ b/includes/sys_page.php
@@ -132,7 +132,7 @@ function check_request_date($name, $error_message = null, $null_allowed = false)
* @return ValidationResult containing the parsed date
*/
function check_date($input, $error_message = null, $null_allowed = false) {
- if ($tmp = parse_date("Y-m-d", trim($input))) {
+ if ($tmp = parse_date("Y-m-d H:i", trim($input) . " 00:00")) {
return new ValidationResult(true, $tmp);
}
if ($null_allowed) {
diff --git a/locale/de_DE.UTF-8/LC_MESSAGES/default.po b/locale/de_DE.UTF-8/LC_MESSAGES/default.po
index e8c64a22..2d6b805d 100644
--- a/locale/de_DE.UTF-8/LC_MESSAGES/default.po
+++ b/locale/de_DE.UTF-8/LC_MESSAGES/default.po
@@ -1544,7 +1544,7 @@ msgstr "Gib bitte ein Passwort ein."
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:309
msgid ""
"No user was found with that Nickname. Please try again. If you are still "
-"having problems, ask an Dispatcher."
+"having problems, ask a Dispatcher."
msgstr ""
"Es wurde kein Engel mit diesem Namen gefunden. Probiere es bitte noch "
"einmal. Wenn das Problem weiterhin besteht, frage einen Dispatcher."