Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
5b02c400
Commit
5b02c400
authored
May 04, 2011
by
Richard Mansfield
Committed by
Gerrit Code Review
May 04, 2011
Browse files
Merge "Error message changes for invalid dates when setting access"
parents
867a7623
b89da59d
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/lang/en.utf8/view.php
View file @
5b02c400
...
...
@@ -41,8 +41,8 @@ $string['description'] = 'Page Description';
$string
[
'startdate'
]
=
'Access Start Date/Time'
;
$string
[
'stopdate'
]
=
'Access End Date/Time'
;
$string
[
'accessdates'
]
=
'Access Date/Time'
;
$string
[
'stopdatecannotbeinpast'
]
=
'The
stop date
cannot be in the past'
;
$string
[
'startdatemustbebeforestopdate'
]
=
'The start date must be before the
stop
date'
;
$string
[
'
new
stopdatecannotbeinpast'
]
=
'The
end date for \'%s\' access
cannot be in the past'
;
$string
[
'
new
startdatemustbebeforestopdate'
]
=
'The start date
for \'%s\' access
must be before the
end
date'
;
$string
[
'unrecogniseddateformat'
]
=
'Unrecognised date format'
;
$string
[
'allowcommentsonview'
]
=
'If checked, users will be allowed to leave comments.'
;
$string
[
'ownerformat'
]
=
'Name display format'
;
...
...
htdocs/view/access.php
View file @
5b02c400
...
...
@@ -378,7 +378,7 @@ function editaccess_validate(Pieform $form, $values) {
}
}
if
(
$values
[
'startdate'
]
&&
$values
[
'stopdate'
]
&&
$values
[
'startdate'
]
>
$values
[
'stopdate'
])
{
$form
->
set_error
(
'startdate'
,
get_string
(
'startdatemustbebeforestopdate'
,
'view'
));
$form
->
set_error
(
'startdate'
,
get_string
(
'
new
startdatemustbebeforestopdate'
,
'view'
,
'Overriding'
));
}
$loggedinaccess
=
false
;
if
(
$values
[
'accesslist'
])
{
...
...
@@ -405,12 +405,12 @@ function editaccess_validate(Pieform $form, $values) {
}
$now
=
strptime
(
date
(
'Y/m/d H:i'
),
$dateformat
);
if
(
$item
[
'stopdate'
]
&&
ptimetotime
(
$now
)
>
ptimetotime
(
$item
[
'stopdate'
]))
{
$SESSION
->
add_error_msg
(
get_string
(
'stopdatecannotbeinpast'
,
'view'
));
$SESSION
->
add_error_msg
(
get_string
(
'
new
stopdatecannotbeinpast'
,
'view'
,
get_string
(
$item
[
'type'
],
'view'
)
));
$form
->
set_error
(
'accesslist'
,
''
);
break
;
}
if
(
$item
[
'startdate'
]
&&
$item
[
'stopdate'
]
&&
ptimetotime
(
$item
[
'startdate'
])
>
ptimetotime
(
$item
[
'stopdate'
]))
{
$SESSION
->
add_error_msg
(
get_string
(
'startdatemustbebeforestopdate'
,
'view'
));
$SESSION
->
add_error_msg
(
get_string
(
'
new
startdatemustbebeforestopdate'
,
'view'
,
get_string
(
$item
[
'type'
],
'view'
)
));
$form
->
set_error
(
'accesslist'
,
''
);
break
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment