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
1ea9805c
Commit
1ea9805c
authored
7 years ago
by
Tobias Reischmann
Browse files
Options
Downloads
Patches
Plain Diff
Added new workflow definition to process_manager
parent
91622f6a
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/manager/process_manager.php
+5
-5
5 additions, 5 deletions
classes/manager/process_manager.php
classes/manager/step_manager.php
+21
-0
21 additions, 0 deletions
classes/manager/step_manager.php
with
26 additions
and
5 deletions
classes/manager/process_manager.php
+
5
−
5
View file @
1ea9805c
...
...
@@ -39,11 +39,11 @@ class process_manager {
*/
public
static
function
create_process
(
$courseid
,
$trigger
)
{
global
$DB
;
if
(
$trigger
->
followedby
!==
null
)
{
if
(
$trigger
->
worflowid
!==
null
)
{
$record
=
new
\stdClass
();
$record
->
id
=
null
;
$record
->
courseid
=
$courseid
;
$record
->
step
id
=
$trigger
->
followedby
;
$record
->
worflow
id
=
$trigger
->
worflowid
;
$record
->
timestepchanged
=
time
();
$process
=
process
::
from_record
(
$record
);
$process
->
id
=
$DB
->
insert_record
(
'tool_cleanupcourses_process'
,
$process
);
...
...
@@ -88,9 +88,9 @@ class process_manager {
*/
public
static
function
proceed_process
(
&
$process
)
{
global
$DB
;
$step
=
step_manager
::
get_step_instance
(
$process
->
stepid
);
if
(
$step
->
followedby
)
{
$process
->
stepi
d
=
$step
->
followedby
;
$step
=
step_manager
::
get_step_instance
_by_workflow_index
(
$process
->
workflowid
,
$process
->
stepindex
+
1
);
if
(
$step
)
{
$process
->
stepi
ndex
++
;
$process
->
waiting
=
false
;
$process
->
timestepchanged
=
time
();
$DB
->
update_record
(
'tool_cleanupcourses_process'
,
$process
);
...
...
This diff is collapsed.
Click to expand it.
classes/manager/step_manager.php
+
21
−
0
View file @
1ea9805c
...
...
@@ -46,6 +46,27 @@ class step_manager extends subplugin_manager {
}
}
/**
* Returns a step instance for a workflow with a specific sortindex.
* @param int $workflowid id of the workflow
* @param int $sortindex sortindex of the step within the workflow
* @return step_subplugin|null
*/
public
static
function
get_step_instance_by_workflow_index
(
$workflowid
,
$sortindex
)
{
global
$DB
;
$record
=
$DB
->
get_record
(
'tool_cleanupcourses_step'
,
array
(
'workflowid'
=>
$workflowid
,
'sortindex'
=>
$sortindex
)
);
if
(
$record
)
{
$subplugin
=
step_subplugin
::
from_record
(
$record
);
return
$subplugin
;
}
else
{
return
null
;
}
}
/**
* Persists a subplugin to the database.
* @param step_subplugin $subplugin
...
...
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