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
7688a676
Commit
7688a676
authored
Oct 09, 2015
by
Robert Lyon
Committed by
Gerrit Code Review
Oct 09, 2015
Browse files
Merge "Bug 1501052: Plan block option to restrict tasks via config form"
parents
c72db5be
de5fbe9f
Changes
4
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/plans/blocktype/plans/lang/en.utf8/blocktype.plans.php
View file @
7688a676
...
@@ -18,3 +18,4 @@ $string['newerplans'] = 'Newer plans';
...
@@ -18,3 +18,4 @@ $string['newerplans'] = 'Newer plans';
$string
[
'noplansaddone'
]
=
'No plans yet. %sAdd one%s!'
;
$string
[
'noplansaddone'
]
=
'No plans yet. %sAdd one%s!'
;
$string
[
'olderplans'
]
=
'Older plans'
;
$string
[
'olderplans'
]
=
'Older plans'
;
$string
[
'planstoshow'
]
=
'Plan to show'
;
$string
[
'planstoshow'
]
=
'Plan to show'
;
$string
[
'taskstodisplay'
]
=
'Tasks to display'
;
\ No newline at end of file
htdocs/artefact/plans/blocktype/plans/lib.php
View file @
7688a676
...
@@ -55,11 +55,12 @@ class PluginBlocktypePlans extends PluginBlocktype {
...
@@ -55,11 +55,12 @@ class PluginBlocktypePlans extends PluginBlocktype {
safe_require
(
'artefact'
,
'plans'
);
safe_require
(
'artefact'
,
'plans'
);
$configdata
=
$instance
->
get
(
'configdata'
);
$configdata
=
$instance
->
get
(
'configdata'
);
$limit
=
(
!
empty
(
$configdata
[
'count'
]))
?
$configdata
[
'count'
]
:
10
;
$smarty
=
smarty_core
();
$smarty
=
smarty_core
();
if
(
isset
(
$configdata
[
'artefactid'
]))
{
if
(
isset
(
$configdata
[
'artefactid'
]))
{
$plan
=
artefact_instance_from_id
(
$configdata
[
'artefactid'
]);
$plan
=
artefact_instance_from_id
(
$configdata
[
'artefactid'
]);
$tasks
=
ArtefactTypeTask
::
get_tasks
(
$configdata
[
'artefactid'
]);
$tasks
=
ArtefactTypeTask
::
get_tasks
(
$configdata
[
'artefactid'
]
,
0
,
$limit
);
$template
=
'artefact:plans:taskrows.tpl'
;
$template
=
'artefact:plans:taskrows.tpl'
;
$blockid
=
$instance
->
get
(
'id'
);
$blockid
=
$instance
->
get
(
'id'
);
if
(
$exporter
)
{
if
(
$exporter
)
{
...
@@ -107,6 +108,12 @@ class PluginBlocktypePlans extends PluginBlocktype {
...
@@ -107,6 +108,12 @@ class PluginBlocktypePlans extends PluginBlocktype {
// Which resume field does the user want
// Which resume field does the user want
$form
[]
=
self
::
artefactchooser_element
((
isset
(
$configdata
[
'artefactid'
]))
?
$configdata
[
'artefactid'
]
:
null
);
$form
[]
=
self
::
artefactchooser_element
((
isset
(
$configdata
[
'artefactid'
]))
?
$configdata
[
'artefactid'
]
:
null
);
$form
[
'count'
]
=
array
(
'type'
=>
'text'
,
'title'
=>
get_string
(
'taskstodisplay'
,
'blocktype.plans/plans'
),
'defaultvalue'
=>
isset
(
$configdata
[
'count'
])
?
$configdata
[
'count'
]
:
10
,
'size'
=>
3
,
);
return
$form
;
return
$form
;
}
}
...
...
htdocs/artefact/plans/viewtasks.json.php
View file @
7688a676
...
@@ -26,7 +26,8 @@ if ($blockid = param_integer('block', null)) {
...
@@ -26,7 +26,8 @@ if ($blockid = param_integer('block', null)) {
json_reply
(
true
,
get_string
(
'accessdenied'
,
'error'
));
json_reply
(
true
,
get_string
(
'accessdenied'
,
'error'
));
}
}
$options
=
$configdata
=
$bi
->
get
(
'configdata'
);
$options
=
$configdata
=
$bi
->
get
(
'configdata'
);
// If block sets limit use that instead
$limit
=
!
empty
(
$configdata
[
'count'
])
?
$configdata
[
'count'
]
:
$limit
;
$tasks
=
ArtefactTypeTask
::
get_tasks
(
$configdata
[
'artefactid'
],
$offset
,
$limit
);
$tasks
=
ArtefactTypeTask
::
get_tasks
(
$configdata
[
'artefactid'
],
$offset
,
$limit
);
$template
=
'artefact:plans:taskrows.tpl'
;
$template
=
'artefact:plans:taskrows.tpl'
;
...
...
test/behat/features/artefact/plans/plan_add_tasks.feature
View file @
7688a676
...
@@ -97,7 +97,10 @@ Scenario: Creating a plan with 11 tasks
...
@@ -97,7 +97,10 @@ Scenario: Creating a plan with 11 tasks
And
I press
"Add"
And
I press
"Add"
And I set the following fields to these values
:
And I set the following fields to these values
:
|
Plan
9
from
outer
space
|
1
|
|
Plan
9
from
outer
space
|
1
|
|
Tasks
to
display
|
5
|
And
I press
"Save"
And
I press
"Save"
And
I follow
"Display page"
And
I follow
"Display page"
And
I follow
"Next page"
And
I follow
"Next page"
Then
I should see
"Build utopia"
And
I follow
"Next page"
Then
I should see
"Social collapse"
Then
I should see
"Social collapse"
\ No newline at end of file
Write
Preview
Markdown
is supported
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