Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-tool_lifecycle
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-tool_lifecycle
Commits
a56b8746
Commit
a56b8746
authored
5 years ago
by
Justus Dieckmann
Committed by
Tobias Reischmann
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Delays: Add delete button, only show active workflows
parent
065312a2
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
classes/table/delayed_courses_table.php
+3
-1
3 additions, 1 deletion
classes/table/delayed_courses_table.php
delayedcourses.php
+21
-1
21 additions, 1 deletion
delayedcourses.php
with
24 additions
and
2 deletions
classes/table/delayed_courses_table.php
+
3
−
1
View file @
a56b8746
...
@@ -49,6 +49,7 @@ class delayed_courses_table extends \table_sql {
...
@@ -49,6 +49,7 @@ class delayed_courses_table extends \table_sql {
'FROM {tool_lifecycle_delayed_workf} dw '
.
'FROM {tool_lifecycle_delayed_workf} dw '
.
'JOIN {tool_lifecycle_workflow} w ON dw.workflowid = w.id '
.
// To make sure no outdated delays are counted.
'JOIN {tool_lifecycle_workflow} w ON dw.workflowid = w.id '
.
// To make sure no outdated delays are counted.
'WHERE dw.delayeduntil >= :time '
.
'WHERE dw.delayeduntil >= :time '
.
'AND w.timeactive IS NOT NULL '
.
// TODO AND dw.workflowid IN $workflows
// TODO AND dw.workflowid IN $workflows
'GROUP BY courseid '
.
'GROUP BY courseid '
.
') maxtable '
.
') maxtable '
.
...
@@ -137,7 +138,8 @@ class delayed_courses_table extends \table_sql {
...
@@ -137,7 +138,8 @@ class delayed_courses_table extends \table_sql {
public
function
col_tools
(
$row
)
{
public
function
col_tools
(
$row
)
{
global
$PAGE
,
$OUTPUT
;
global
$PAGE
,
$OUTPUT
;
$button
=
new
\single_button
(
$button
=
new
\single_button
(
new
\moodle_url
(
$PAGE
->
url
,
array
(
'cid'
=>
$row
->
courseid
)),
new
\moodle_url
(
$PAGE
->
url
,
array
(
'action'
=>
'delete'
,
'cid'
=>
$row
->
courseid
,
'sesskey'
=>
sesskey
())),
get_string
(
'delete_delay'
,
'tool_lifecycle'
));
get_string
(
'delete_delay'
,
'tool_lifecycle'
));
return
$OUTPUT
->
render
(
$button
);
return
$OUTPUT
->
render
(
$button
);
}
}
...
...
This diff is collapsed.
Click to expand it.
delayedcourses.php
+
21
−
1
View file @
a56b8746
...
@@ -33,6 +33,27 @@ require_capability('moodle/site:config', context_system::instance());
...
@@ -33,6 +33,27 @@ require_capability('moodle/site:config', context_system::instance());
admin_externalpage_setup
(
'tool_lifecycle_delayed_courses'
);
admin_externalpage_setup
(
'tool_lifecycle_delayed_courses'
);
$action
=
optional_param
(
'action'
,
null
,
PARAM_ALPHANUMEXT
);
if
(
$action
)
{
if
(
$action
==
'delete'
)
{
global
$DB
;
require_sesskey
();
$cid
=
required_param
(
'cid'
,
PARAM_INT
);
$workflow
=
optional_param
(
'workflow'
,
null
,
PARAM_ALPHANUM
);
if
(
$workflow
)
{
if
(
is_int
(
$workflow
))
{
$DB
->
delete_records
(
'tool_lifecycle_delayed_workf'
,
array
(
'courseid'
=>
$cid
,
'workflowid'
=>
$workflow
));
}
else
if
(
$workflow
==
'global'
)
{
$DB
->
delete_records
(
'tool_lifecycle_delayed'
,
array
(
'courseid'
=>
$cid
));
}
}
else
{
$DB
->
delete_records
(
'tool_lifecycle_delayed'
,
array
(
'courseid'
=>
$cid
));
$DB
->
delete_records
(
'tool_lifecycle_delayed_workf'
,
array
(
'courseid'
=>
$cid
));
}
}
redirect
(
$PAGE
->
url
);
}
$PAGE
->
set_url
(
new
\moodle_url
(
'/admin/tool/lifecycle/delayedcourses.php'
));
$PAGE
->
set_url
(
new
\moodle_url
(
'/admin/tool/lifecycle/delayedcourses.php'
));
$PAGE
->
set_title
(
get_string
(
'delayed_courses_header'
,
'tool_lifecycle'
));
$PAGE
->
set_title
(
get_string
(
'delayed_courses_header'
,
'tool_lifecycle'
));
...
@@ -41,7 +62,6 @@ $PAGE->set_heading(get_string('delayed_courses_header', 'tool_lifecycle'));
...
@@ -41,7 +62,6 @@ $PAGE->set_heading(get_string('delayed_courses_header', 'tool_lifecycle'));
$table
=
new
delayed_courses_table
();
$table
=
new
delayed_courses_table
();
$table
->
define_baseurl
(
$PAGE
->
url
);
$table
->
define_baseurl
(
$PAGE
->
url
);
echo
$OUTPUT
->
header
();
echo
$OUTPUT
->
header
();
$table
->
out
(
100
,
false
);
$table
->
out
(
100
,
false
);
echo
$OUTPUT
->
footer
();
echo
$OUTPUT
->
footer
();
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