Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-customfield_semester
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-customfield_semester
Commits
6a462953
Commit
6a462953
authored
5 years ago
by
Justus Dieckmann
Browse files
Options
Downloads
Patches
Plain Diff
Interpret 1 as semesterindependent instead of 0, because 0 counts as no value
parent
efe9f15f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
classes/data_controller.php
+2
-2
2 additions, 2 deletions
classes/data_controller.php
with
2 additions
and
2 deletions
classes/data_controller.php
+
2
−
2
View file @
6a462953
...
@@ -68,7 +68,7 @@ class data_controller extends \core_customfield\data_controller {
...
@@ -68,7 +68,7 @@ class data_controller extends \core_customfield\data_controller {
public
function
instance_form_definition
(
\MoodleQuickForm
$mform
)
{
public
function
instance_form_definition
(
\MoodleQuickForm
$mform
)
{
$field
=
$this
->
get_field
();
$field
=
$this
->
get_field
();
$formattedoptions
=
array
(
$formattedoptions
=
array
(
0
=>
get_string
(
'semesterindependent'
,
'customfield_semester'
)
1
=>
get_string
(
'semesterindependent'
,
'customfield_semester'
)
);
);
$showmonthsintofuture
=
$this
->
get_field
()
->
get_configdata_property
(
'showmonthsintofuture'
);
$showmonthsintofuture
=
$this
->
get_field
()
->
get_configdata_property
(
'showmonthsintofuture'
);
$endtime
=
new
DateTime
(
"+
$showmonthsintofuture
months"
);
$endtime
=
new
DateTime
(
"+
$showmonthsintofuture
months"
);
...
@@ -132,7 +132,7 @@ class data_controller extends \core_customfield\data_controller {
...
@@ -132,7 +132,7 @@ class data_controller extends \core_customfield\data_controller {
* @return string|null The human readable semester name
* @return string|null The human readable semester name
*/
*/
public
static
function
get_name_for_semester
(
int
$value
)
{
public
static
function
get_name_for_semester
(
int
$value
)
{
if
(
$value
===
0
)
{
if
(
$value
===
1
)
{
return
get_string
(
'semesterindependent'
,
'customfield_semester'
);
return
get_string
(
'semesterindependent'
,
'customfield_semester'
);
}
else
if
(
$value
==
null
)
{
}
else
if
(
$value
==
null
)
{
return
null
;
return
null
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment